@pie-element/simple-cloze 0.1.4-next.10 → 0.1.4-next.11
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.
- package/dist/browser/delivery/index.js +1 -1
- package/dist/browser/{i18n-BaF24Jzw.js → i18n-BDkxR45Z.js} +129 -125
- package/dist/browser/i18n-BDkxR45Z.js.map +1 -0
- package/dist/browser/print/index.js +1 -1
- package/dist/delivery/index.js +18 -13
- package/dist/delivery/index.js.map +1 -1
- package/dist/index.iife.js +2 -2
- package/dist/print/index.js +18 -13
- package/dist/print/index.js.map +1 -1
- package/module/print.js +161 -157
- package/module/print.js.map +1 -1
- package/package.json +3 -2
- package/dist/browser/i18n-BaF24Jzw.js.map +0 -1
package/module/print.js
CHANGED
|
@@ -2067,9 +2067,12 @@ function Hr(e, t, n, r, i, a) {
|
|
|
2067
2067
|
}
|
|
2068
2068
|
//#endregion
|
|
2069
2069
|
//#region ../../shared/math-rendering-mathjax/dist/index.js
|
|
2070
|
-
var Ur =
|
|
2070
|
+
var Ur = Symbol.for("@pie-element/shared-math-rendering-mathjax/loading");
|
|
2071
2071
|
function Wr(e) {
|
|
2072
|
-
|
|
2072
|
+
if (typeof window > "u" || window.MathJax?.typesetPromise) return Promise.resolve();
|
|
2073
|
+
let t = globalThis, n = t[Ur];
|
|
2074
|
+
if (n) return n;
|
|
2075
|
+
let r = new Promise((t, n) => {
|
|
2073
2076
|
let { useSingleDollar: r = !1, accessibility: i = !0, loadFonts: a = !0, srcUrl: o } = e, s = {
|
|
2074
2077
|
loader: { load: i ? ["a11y/assistive-mml"] : [] },
|
|
2075
2078
|
tex: {
|
|
@@ -2104,7 +2107,8 @@ function Wr(e) {
|
|
|
2104
2107
|
}, c.onerror = () => {
|
|
2105
2108
|
n(/* @__PURE__ */ Error("Failed to load MathJax"));
|
|
2106
2109
|
}, document.head.appendChild(c);
|
|
2107
|
-
})
|
|
2110
|
+
});
|
|
2111
|
+
return t[Ur] = r, r;
|
|
2108
2112
|
}
|
|
2109
2113
|
function Gr() {
|
|
2110
2114
|
let e = window.MathJax?.startup?.document;
|
|
@@ -2123,32 +2127,32 @@ function Kr(e = {}) {
|
|
|
2123
2127
|
await window.MathJax.typesetPromise([t]), Gr();
|
|
2124
2128
|
};
|
|
2125
2129
|
}
|
|
2126
|
-
var qr = null;
|
|
2127
|
-
function
|
|
2128
|
-
return
|
|
2130
|
+
var qr = "@pie-lib/math-rendering", Jr = null;
|
|
2131
|
+
function Yr() {
|
|
2132
|
+
return Jr ||= Kr({
|
|
2129
2133
|
accessibility: !0,
|
|
2130
2134
|
useSingleDollar: !0
|
|
2131
|
-
}),
|
|
2135
|
+
}), Jr;
|
|
2132
2136
|
}
|
|
2133
|
-
function
|
|
2137
|
+
function Xr() {
|
|
2134
2138
|
if (typeof window > "u") return null;
|
|
2135
|
-
let e = window[
|
|
2139
|
+
let e = window[qr];
|
|
2136
2140
|
return typeof e?.renderMath == "function" ? e : null;
|
|
2137
2141
|
}
|
|
2138
|
-
var
|
|
2142
|
+
var Zr = async (e) => {
|
|
2139
2143
|
if (typeof window > "u") return;
|
|
2140
2144
|
let t = typeof e == "string", n;
|
|
2141
2145
|
t ? (n = document.createElement("div"), n.innerHTML = e) : n = e || document.body;
|
|
2142
|
-
let r =
|
|
2143
|
-
return r ? await r.renderMath?.(n) : await
|
|
2144
|
-
},
|
|
2146
|
+
let r = Xr();
|
|
2147
|
+
return r ? await r.renderMath?.(n) : await Yr()(n), t ? n.innerHTML : void 0;
|
|
2148
|
+
}, Qr = [
|
|
2145
2149
|
"nbsp iexcl cent pound curren yen brvbar sect uml copy ordf laquo not shy reg macr",
|
|
2146
2150
|
"deg plusmn sup2 sup3 acute micro para middot cedil sup1 ordm raquo frac14 frac12 frac34 iquest",
|
|
2147
2151
|
"Agrave Aacute Acirc Atilde Auml Aring AElig Ccedil Egrave Eacute Ecirc Euml Igrave Iacute Icirc Iuml",
|
|
2148
2152
|
"ETH Ntilde Ograve Oacute Ocirc Otilde Ouml times Oslash Ugrave Uacute Ucirc Uuml Yacute THORN szlig",
|
|
2149
2153
|
"agrave aacute acirc atilde auml aring aelig ccedil egrave eacute ecirc euml igrave iacute icirc iuml",
|
|
2150
2154
|
"eth ntilde ograve oacute ocirc otilde ouml divide oslash ugrave uacute ucirc uuml yacute thorn yuml"
|
|
2151
|
-
].join(" "),
|
|
2155
|
+
].join(" "), $r = "alpha beta gamma delta epsilon zeta eta theta iota kappa lambda mu nu xi omicron pi rho sigmaf sigma tau upsilon phi chi psi omega", ei = new Map(Object.entries({
|
|
2152
2156
|
quot: 34,
|
|
2153
2157
|
amp: 38,
|
|
2154
2158
|
apos: 39,
|
|
@@ -2179,16 +2183,16 @@ var Xr = async (e) => {
|
|
|
2179
2183
|
le: 8804,
|
|
2180
2184
|
ge: 8805
|
|
2181
2185
|
}));
|
|
2182
|
-
for (let [e, t] of
|
|
2183
|
-
for (let [e, t] of
|
|
2184
|
-
var
|
|
2186
|
+
for (let [e, t] of Qr.split(" ").entries()) ei.set(t, 160 + e);
|
|
2187
|
+
for (let [e, t] of $r.split(" ").entries()) ei.set(t, 945 + e), t !== "sigmaf" && ei.set(t[0].toUpperCase() + t.slice(1), 913 + e);
|
|
2188
|
+
var ti = /<\/?(?:br|p|div|li|h[1-6]|blockquote|pre|tr|td|th)\b[^>]*>/gi, ni = /<\/?[a-z][^>]*>|<!--[\s\S]*?-->/gi, ri = /&(#[0-9]+|#x[0-9a-f]+|[a-z][a-z0-9]*);/gi, ii = (e, t) => {
|
|
2185
2189
|
if (t[0] === "#") {
|
|
2186
2190
|
let e = t[1] === "x" || t[1] === "X", n = Number.parseInt(t.slice(e ? 2 : 1), e ? 16 : 10), r = n > 0 && n <= 1114111 && (n < 55296 || n > 57343);
|
|
2187
2191
|
return String.fromCodePoint(r ? n : 65533);
|
|
2188
2192
|
}
|
|
2189
|
-
let n =
|
|
2193
|
+
let n = ei.get(t);
|
|
2190
2194
|
return n === void 0 ? e : String.fromCodePoint(n);
|
|
2191
|
-
},
|
|
2195
|
+
}, ai = (e) => typeof e == "string" ? e.replace(ti, " ").replace(ni, "").replace(ri, ii).replace(/\s+/g, " ").trim() : "", oi = {
|
|
2192
2196
|
translation: {
|
|
2193
2197
|
categorize: {
|
|
2194
2198
|
limitMaxChoicesPerCategory: "You've reached the limit of {{maxChoicesPerCategory}} responses per area. To add another response, one must first be removed.",
|
|
@@ -2328,7 +2332,7 @@ var ei = /<\/?(?:br|p|div|li|h[1-6]|blockquote|pre|tr|td|th)\b[^>]*>/gi, ti = /<
|
|
|
2328
2332
|
hideNote: "Hide Note",
|
|
2329
2333
|
cancel: "Cancel"
|
|
2330
2334
|
}
|
|
2331
|
-
},
|
|
2335
|
+
}, si = {
|
|
2332
2336
|
translation: {
|
|
2333
2337
|
categorize: {
|
|
2334
2338
|
limitMaxChoicesPerCategory: "Has alcanzado el límite de {{maxChoicesPerCategory}} respuestas por área. Para agregar otra respuesta, primero se debe eliminar una respuesta.",
|
|
@@ -2468,55 +2472,55 @@ var ei = /<\/?(?:br|p|div|li|h[1-6]|blockquote|pre|tr|td|th)\b[^>]*>/gi, ti = /<
|
|
|
2468
2472
|
hideNote: "Ocultar Nota",
|
|
2469
2473
|
cancel: "Cancelar"
|
|
2470
2474
|
}
|
|
2471
|
-
}, Z = (e) => typeof e == "string",
|
|
2475
|
+
}, Z = (e) => typeof e == "string", ci = () => {
|
|
2472
2476
|
let e, t, n = new Promise((n, r) => {
|
|
2473
2477
|
e = n, t = r;
|
|
2474
2478
|
});
|
|
2475
2479
|
return n.resolve = e, n.reject = t, n;
|
|
2476
|
-
},
|
|
2480
|
+
}, li = (e) => e == null ? "" : "" + e, ui = (e, t, n) => {
|
|
2477
2481
|
e.forEach((e) => {
|
|
2478
2482
|
t[e] && (n[e] = t[e]);
|
|
2479
2483
|
});
|
|
2480
|
-
},
|
|
2484
|
+
}, di = /###/g, fi = (e) => e && e.indexOf("###") > -1 ? e.replace(di, ".") : e, pi = (e) => !e || Z(e), mi = (e, t, n) => {
|
|
2481
2485
|
let r = Z(t) ? t.split(".") : t, i = 0;
|
|
2482
2486
|
for (; i < r.length - 1;) {
|
|
2483
|
-
if (
|
|
2484
|
-
let t =
|
|
2487
|
+
if (pi(e)) return {};
|
|
2488
|
+
let t = fi(r[i]);
|
|
2485
2489
|
!e[t] && n && (e[t] = new n()), e = Object.prototype.hasOwnProperty.call(e, t) ? e[t] : {}, ++i;
|
|
2486
2490
|
}
|
|
2487
|
-
return
|
|
2491
|
+
return pi(e) ? {} : {
|
|
2488
2492
|
obj: e,
|
|
2489
|
-
k:
|
|
2493
|
+
k: fi(r[i])
|
|
2490
2494
|
};
|
|
2491
|
-
},
|
|
2492
|
-
let { obj: r, k: i } =
|
|
2495
|
+
}, hi = (e, t, n) => {
|
|
2496
|
+
let { obj: r, k: i } = mi(e, t, Object);
|
|
2493
2497
|
if (r !== void 0 || t.length === 1) {
|
|
2494
2498
|
r[i] = n;
|
|
2495
2499
|
return;
|
|
2496
2500
|
}
|
|
2497
|
-
let a = t[t.length - 1], o = t.slice(0, t.length - 1), s =
|
|
2498
|
-
for (; s.obj === void 0 && o.length;) a = `${o[o.length - 1]}.${a}`, o = o.slice(0, o.length - 1), s =
|
|
2501
|
+
let a = t[t.length - 1], o = t.slice(0, t.length - 1), s = mi(e, o, Object);
|
|
2502
|
+
for (; s.obj === void 0 && o.length;) a = `${o[o.length - 1]}.${a}`, o = o.slice(0, o.length - 1), s = mi(e, o, Object), s?.obj && s.obj[`${s.k}.${a}`] !== void 0 && (s.obj = void 0);
|
|
2499
2503
|
s.obj[`${s.k}.${a}`] = n;
|
|
2500
|
-
},
|
|
2501
|
-
let { obj: i, k: a } =
|
|
2504
|
+
}, gi = (e, t, n, r) => {
|
|
2505
|
+
let { obj: i, k: a } = mi(e, t, Object);
|
|
2502
2506
|
i[a] = i[a] || [], i[a].push(n);
|
|
2503
|
-
},
|
|
2504
|
-
let { obj: n, k: r } =
|
|
2507
|
+
}, _i = (e, t) => {
|
|
2508
|
+
let { obj: n, k: r } = mi(e, t);
|
|
2505
2509
|
if (n && Object.prototype.hasOwnProperty.call(n, r)) return n[r];
|
|
2506
|
-
}, _i = (e, t, n) => {
|
|
2507
|
-
let r = gi(e, n);
|
|
2508
|
-
return r === void 0 ? gi(t, n) : r;
|
|
2509
2510
|
}, vi = (e, t, n) => {
|
|
2510
|
-
|
|
2511
|
+
let r = _i(e, n);
|
|
2512
|
+
return r === void 0 ? _i(t, n) : r;
|
|
2513
|
+
}, yi = (e, t, n) => {
|
|
2514
|
+
for (let r in t) r !== "__proto__" && r !== "constructor" && (r in e ? Z(e[r]) || e[r] instanceof String || Z(t[r]) || t[r] instanceof String ? n && (e[r] = t[r]) : yi(e[r], t[r], n) : e[r] = t[r]);
|
|
2511
2515
|
return e;
|
|
2512
|
-
},
|
|
2516
|
+
}, bi = (e) => e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"), xi = {
|
|
2513
2517
|
"&": "&",
|
|
2514
2518
|
"<": "<",
|
|
2515
2519
|
">": ">",
|
|
2516
2520
|
"\"": """,
|
|
2517
2521
|
"'": "'",
|
|
2518
2522
|
"/": "/"
|
|
2519
|
-
},
|
|
2523
|
+
}, Si = (e) => Z(e) ? e.replace(/[&<>"'\/]/g, (e) => xi[e]) : e, Ci = class {
|
|
2520
2524
|
constructor(e) {
|
|
2521
2525
|
this.capacity = e, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = [];
|
|
2522
2526
|
}
|
|
@@ -2526,23 +2530,23 @@ var ei = /<\/?(?:br|p|div|li|h[1-6]|blockquote|pre|tr|td|th)\b[^>]*>/gi, ti = /<
|
|
|
2526
2530
|
let n = new RegExp(e);
|
|
2527
2531
|
return this.regExpQueue.length === this.capacity && this.regExpMap.delete(this.regExpQueue.shift()), this.regExpMap.set(e, n), this.regExpQueue.push(e), n;
|
|
2528
2532
|
}
|
|
2529
|
-
},
|
|
2533
|
+
}, wi = [
|
|
2530
2534
|
" ",
|
|
2531
2535
|
",",
|
|
2532
2536
|
"?",
|
|
2533
2537
|
"!",
|
|
2534
2538
|
";"
|
|
2535
|
-
],
|
|
2539
|
+
], Ti = new Ci(20), Ei = (e, t, n) => {
|
|
2536
2540
|
t ||= "", n ||= "";
|
|
2537
|
-
let r =
|
|
2541
|
+
let r = wi.filter((e) => t.indexOf(e) < 0 && n.indexOf(e) < 0);
|
|
2538
2542
|
if (r.length === 0) return !0;
|
|
2539
|
-
let i =
|
|
2543
|
+
let i = Ti.getRegExp(`(${r.map((e) => e === "?" ? "\\?" : e).join("|")})`), a = !i.test(e);
|
|
2540
2544
|
if (!a) {
|
|
2541
2545
|
let t = e.indexOf(n);
|
|
2542
2546
|
t > 0 && !i.test(e.substring(0, t)) && (a = !0);
|
|
2543
2547
|
}
|
|
2544
2548
|
return a;
|
|
2545
|
-
},
|
|
2549
|
+
}, Di = (e, t, n = ".") => {
|
|
2546
2550
|
if (!e) return;
|
|
2547
2551
|
if (e[t]) return Object.prototype.hasOwnProperty.call(e, t) ? e[t] : void 0;
|
|
2548
2552
|
let r = t.split(n), i = e;
|
|
@@ -2561,7 +2565,7 @@ var ei = /<\/?(?:br|p|div|li|h[1-6]|blockquote|pre|tr|td|th)\b[^>]*>/gi, ti = /<
|
|
|
2561
2565
|
i = t;
|
|
2562
2566
|
}
|
|
2563
2567
|
return i;
|
|
2564
|
-
},
|
|
2568
|
+
}, Oi = (e) => e?.replace(/_/g, "-"), ki = {
|
|
2565
2569
|
type: "logger",
|
|
2566
2570
|
log(e) {
|
|
2567
2571
|
this.output("log", e);
|
|
@@ -2580,7 +2584,7 @@ var ei = /<\/?(?:br|p|div|li|h[1-6]|blockquote|pre|tr|td|th)\b[^>]*>/gi, ti = /<
|
|
|
2580
2584
|
this.init(e, t);
|
|
2581
2585
|
}
|
|
2582
2586
|
init(e, t = {}) {
|
|
2583
|
-
this.prefix = t.prefix || "i18next:", this.logger = e ||
|
|
2587
|
+
this.prefix = t.prefix || "i18next:", this.logger = e || ki, this.options = t, this.debug = t.debug;
|
|
2584
2588
|
}
|
|
2585
2589
|
log(...e) {
|
|
2586
2590
|
return this.forward(e, "log", "", !0);
|
|
@@ -2606,7 +2610,7 @@ var ei = /<\/?(?:br|p|div|li|h[1-6]|blockquote|pre|tr|td|th)\b[^>]*>/gi, ti = /<
|
|
|
2606
2610
|
clone(t) {
|
|
2607
2611
|
return t ||= this.options, t.prefix = t.prefix || this.prefix, new e(this.logger, t);
|
|
2608
2612
|
}
|
|
2609
|
-
}(),
|
|
2613
|
+
}(), Ai = class {
|
|
2610
2614
|
constructor() {
|
|
2611
2615
|
this.observers = {};
|
|
2612
2616
|
}
|
|
@@ -2633,7 +2637,7 @@ var ei = /<\/?(?:br|p|div|li|h[1-6]|blockquote|pre|tr|td|th)\b[^>]*>/gi, ti = /<
|
|
|
2633
2637
|
for (let i = 0; i < r; i++) n.apply(n, [e, ...t]);
|
|
2634
2638
|
});
|
|
2635
2639
|
}
|
|
2636
|
-
},
|
|
2640
|
+
}, ji = class extends Ai {
|
|
2637
2641
|
constructor(e, t = {
|
|
2638
2642
|
ns: ["translation"],
|
|
2639
2643
|
defaultNS: "translation"
|
|
@@ -2650,12 +2654,12 @@ var ei = /<\/?(?:br|p|div|li|h[1-6]|blockquote|pre|tr|td|th)\b[^>]*>/gi, ti = /<
|
|
|
2650
2654
|
getResource(e, t, n, r = {}) {
|
|
2651
2655
|
let i = r.keySeparator === void 0 ? this.options.keySeparator : r.keySeparator, a = r.ignoreJSONStructure === void 0 ? this.options.ignoreJSONStructure : r.ignoreJSONStructure, o;
|
|
2652
2656
|
e.indexOf(".") > -1 ? o = e.split(".") : (o = [e, t], n && (Array.isArray(n) ? o.push(...n) : Z(n) && i ? o.push(...n.split(i)) : o.push(n)));
|
|
2653
|
-
let s =
|
|
2654
|
-
return !s && !t && !n && e.indexOf(".") > -1 && (e = o[0], t = o[1], n = o.slice(2).join(".")), s || !a || !Z(n) ? s :
|
|
2657
|
+
let s = _i(this.data, o);
|
|
2658
|
+
return !s && !t && !n && e.indexOf(".") > -1 && (e = o[0], t = o[1], n = o.slice(2).join(".")), s || !a || !Z(n) ? s : Di(this.data?.[e]?.[t], n, i);
|
|
2655
2659
|
}
|
|
2656
2660
|
addResource(e, t, n, r, i = { silent: !1 }) {
|
|
2657
2661
|
let a = i.keySeparator === void 0 ? this.options.keySeparator : i.keySeparator, o = [e, t];
|
|
2658
|
-
n && (o = o.concat(a ? n.split(a) : n)), e.indexOf(".") > -1 && (o = e.split("."), r = t, t = o[1]), this.addNamespaces(t),
|
|
2662
|
+
n && (o = o.concat(a ? n.split(a) : n)), e.indexOf(".") > -1 && (o = e.split("."), r = t, t = o[1]), this.addNamespaces(t), hi(this.data, o, r), i.silent || this.emit("added", e, t, n, r);
|
|
2659
2663
|
}
|
|
2660
2664
|
addResources(e, t, n, r = { silent: !1 }) {
|
|
2661
2665
|
for (let r in n) (Z(n[r]) || Array.isArray(n[r])) && this.addResource(e, t, r, n[r], { silent: !0 });
|
|
@@ -2667,11 +2671,11 @@ var ei = /<\/?(?:br|p|div|li|h[1-6]|blockquote|pre|tr|td|th)\b[^>]*>/gi, ti = /<
|
|
|
2667
2671
|
}) {
|
|
2668
2672
|
let o = [e, t];
|
|
2669
2673
|
e.indexOf(".") > -1 && (o = e.split("."), r = n, n = t, t = o[1]), this.addNamespaces(t);
|
|
2670
|
-
let s =
|
|
2671
|
-
a.skipCopy || (n = JSON.parse(JSON.stringify(n))), r ?
|
|
2674
|
+
let s = _i(this.data, o) || {};
|
|
2675
|
+
a.skipCopy || (n = JSON.parse(JSON.stringify(n))), r ? yi(s, n, i) : s = {
|
|
2672
2676
|
...s,
|
|
2673
2677
|
...n
|
|
2674
|
-
},
|
|
2678
|
+
}, hi(this.data, o, s), a.silent || this.emit("added", e, t, n);
|
|
2675
2679
|
}
|
|
2676
2680
|
removeResourceBundle(e, t) {
|
|
2677
2681
|
this.hasResourceBundle(e, t) && delete this.data[e][t], this.removeNamespaces(t), this.emit("removed", e, t);
|
|
@@ -2692,7 +2696,7 @@ var ei = /<\/?(?:br|p|div|li|h[1-6]|blockquote|pre|tr|td|th)\b[^>]*>/gi, ti = /<
|
|
|
2692
2696
|
toJSON() {
|
|
2693
2697
|
return this.data;
|
|
2694
2698
|
}
|
|
2695
|
-
},
|
|
2699
|
+
}, Mi = {
|
|
2696
2700
|
processors: {},
|
|
2697
2701
|
addPostProcessor(e) {
|
|
2698
2702
|
this.processors[e.name] = e;
|
|
@@ -2702,22 +2706,22 @@ var ei = /<\/?(?:br|p|div|li|h[1-6]|blockquote|pre|tr|td|th)\b[^>]*>/gi, ti = /<
|
|
|
2702
2706
|
t = this.processors[e]?.process(t, n, r, i) ?? t;
|
|
2703
2707
|
}), t;
|
|
2704
2708
|
}
|
|
2705
|
-
},
|
|
2706
|
-
function
|
|
2709
|
+
}, Ni = Symbol("i18next/PATH_KEY");
|
|
2710
|
+
function Pi() {
|
|
2707
2711
|
let e = [], t = Object.create(null), n;
|
|
2708
|
-
return t.get = (r, i) => (n?.revoke?.(), i ===
|
|
2712
|
+
return t.get = (r, i) => (n?.revoke?.(), i === Ni ? e : (e.push(i), n = Proxy.revocable(r, t), n.proxy)), Proxy.revocable(Object.create(null), t).proxy;
|
|
2709
2713
|
}
|
|
2710
|
-
function
|
|
2711
|
-
let { [
|
|
2714
|
+
function Fi(e, t) {
|
|
2715
|
+
let { [Ni]: n } = e(Pi()), r = t?.keySeparator ?? ".", i = t?.nsSeparator ?? ":";
|
|
2712
2716
|
if (n.length > 1 && i) {
|
|
2713
2717
|
let e = t?.ns, a = Array.isArray(e) ? e : null;
|
|
2714
2718
|
if (a && a.length > 1 && a.slice(1).includes(n[0])) return `${n[0]}${i}${n.slice(1).join(r)}`;
|
|
2715
2719
|
}
|
|
2716
2720
|
return n.join(r);
|
|
2717
2721
|
}
|
|
2718
|
-
var
|
|
2722
|
+
var Ii = {}, Li = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number", Ri = class e extends Ai {
|
|
2719
2723
|
constructor(e, t = {}) {
|
|
2720
|
-
super(),
|
|
2724
|
+
super(), ui([
|
|
2721
2725
|
"resourceStore",
|
|
2722
2726
|
"languageUtils",
|
|
2723
2727
|
"pluralResolver",
|
|
@@ -2735,13 +2739,13 @@ var Fi = {}, Ii = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
2735
2739
|
if (e == null) return !1;
|
|
2736
2740
|
let r = this.resolve(e, n);
|
|
2737
2741
|
if (r?.res === void 0) return !1;
|
|
2738
|
-
let i =
|
|
2742
|
+
let i = Li(r.res);
|
|
2739
2743
|
return !(n.returnObjects === !1 && i);
|
|
2740
2744
|
}
|
|
2741
2745
|
extractFromKey(e, t) {
|
|
2742
2746
|
let n = t.nsSeparator === void 0 ? this.options.nsSeparator : t.nsSeparator;
|
|
2743
2747
|
n === void 0 && (n = ":");
|
|
2744
|
-
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 && !
|
|
2748
|
+
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 && !Ei(e, n, r);
|
|
2745
2749
|
if (a && !o) {
|
|
2746
2750
|
let t = e.match(this.interpolator.nestingRegexp);
|
|
2747
2751
|
if (t && t.length > 0) return {
|
|
@@ -2759,10 +2763,10 @@ var Fi = {}, Ii = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
2759
2763
|
translate(t, n, r) {
|
|
2760
2764
|
let i = typeof n == "object" ? { ...n } : n;
|
|
2761
2765
|
if (typeof i != "object" && this.options.overloadTranslationOptionHandler && (i = this.options.overloadTranslationOptionHandler(arguments)), typeof i == "object" && (i = { ...i }), i ||= {}, t == null) return "";
|
|
2762
|
-
typeof t == "function" && (t =
|
|
2766
|
+
typeof t == "function" && (t = Fi(t, {
|
|
2763
2767
|
...this.options,
|
|
2764
2768
|
...i
|
|
2765
|
-
})), Array.isArray(t) || (t = [String(t)]), t = t.map((e) => typeof e == "function" ?
|
|
2769
|
+
})), Array.isArray(t) || (t = [String(t)]), t = t.map((e) => typeof e == "function" ? Fi(e, {
|
|
2766
2770
|
...this.options,
|
|
2767
2771
|
...i
|
|
2768
2772
|
}) : String(e));
|
|
@@ -2790,7 +2794,7 @@ var Fi = {}, Ii = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
2790
2794
|
"[object RegExp]"
|
|
2791
2795
|
], _ = i.joinArrays === void 0 ? this.options.joinArrays : i.joinArrays, v = !this.i18nFormat || this.i18nFormat.handleAsObject, y = i.count !== void 0 && !Z(i.count), b = e.hasDefaultValue(i), te = y ? this.pluralResolver.getSuffix(d, i.count, i) : "", ne = i.ordinal && y ? this.pluralResolver.getSuffix(d, i.count, { ordinal: !1 }) : "", re = y && !i.ordinal && i.count === 0, x = re && i[`defaultValue${this.options.pluralSeparator}zero`] || i[`defaultValue${te}`] || i[`defaultValue${ne}`] || i.defaultValue, S = m;
|
|
2792
2796
|
v && !m && b && (S = x);
|
|
2793
|
-
let ie =
|
|
2797
|
+
let ie = Li(S), ae = Object.prototype.toString.apply(S);
|
|
2794
2798
|
if (v && S && ie && ee.indexOf(ae) < 0 && !(Z(_) && Array.isArray(S))) {
|
|
2795
2799
|
if (!i.returnObjects && !this.options.returnObjects) {
|
|
2796
2800
|
this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
|
|
@@ -2806,7 +2810,7 @@ var Fi = {}, Ii = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
2806
2810
|
let r = `${n}${o}${e}`;
|
|
2807
2811
|
b && !m ? t[e] = this.translate(r, {
|
|
2808
2812
|
...i,
|
|
2809
|
-
defaultValue:
|
|
2813
|
+
defaultValue: Li(x) ? x[e] : void 0,
|
|
2810
2814
|
joinArrays: !1,
|
|
2811
2815
|
ns: c
|
|
2812
2816
|
}) : t[e] = this.translate(r, {
|
|
@@ -2877,7 +2881,7 @@ var Fi = {}, Ii = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
2877
2881
|
!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();
|
|
2878
2882
|
}
|
|
2879
2883
|
let a = n.postProcess || this.options.postProcess, o = Z(a) ? [a] : a;
|
|
2880
|
-
return e != null && o?.length && n.applyPostProcessor !== !1 && (e =
|
|
2884
|
+
return e != null && o?.length && n.applyPostProcessor !== !1 && (e = Mi.handle(o, e, t, this.options && this.options.postProcessPassResolved ? {
|
|
2881
2885
|
i18nResolved: {
|
|
2882
2886
|
...r,
|
|
2883
2887
|
usedParams: this.getUsedParamsDetails(n)
|
|
@@ -2887,7 +2891,7 @@ var Fi = {}, Ii = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
2887
2891
|
}
|
|
2888
2892
|
resolve(e, t = {}) {
|
|
2889
2893
|
let n, r, i, a, o;
|
|
2890
|
-
return Z(e) && (e = [e]), Array.isArray(e) && (e = e.map((e) => typeof e == "function" ?
|
|
2894
|
+
return Z(e) && (e = [e]), Array.isArray(e) && (e = e.map((e) => typeof e == "function" ? Fi(e, {
|
|
2891
2895
|
...this.options,
|
|
2892
2896
|
...t
|
|
2893
2897
|
}) : e)), e.forEach((e) => {
|
|
@@ -2898,7 +2902,7 @@ var Fi = {}, Ii = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
2898
2902
|
this.options.fallbackNS && (l = l.concat(this.options.fallbackNS));
|
|
2899
2903
|
let u = t.count !== void 0 && !Z(t.count), d = u && !t.ordinal && t.count === 0, f = t.context !== void 0 && (Z(t.context) || typeof t.context == "number") && t.context !== "", p = t.lngs ? t.lngs : this.languageUtils.toResolveHierarchy(t.lng || this.language, t.fallbackLng);
|
|
2900
2904
|
l.forEach((e) => {
|
|
2901
|
-
this.isValidLookup(n) || (o = e, !
|
|
2905
|
+
this.isValidLookup(n) || (o = e, !Ii[`${p[0]}-${e}`] && this.utils?.hasLoadedNamespace && !this.utils?.hasLoadedNamespace(o) && (Ii[`${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) => {
|
|
2902
2906
|
if (this.isValidLookup(n)) return;
|
|
2903
2907
|
a = r;
|
|
2904
2908
|
let o = [c];
|
|
@@ -2961,17 +2965,17 @@ var Fi = {}, Ii = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
2961
2965
|
for (let t in e) if (Object.prototype.hasOwnProperty.call(e, t) && t.substring(0, 12) === "defaultValue" && e[t] !== void 0) return !0;
|
|
2962
2966
|
return !1;
|
|
2963
2967
|
}
|
|
2964
|
-
},
|
|
2968
|
+
}, zi = class {
|
|
2965
2969
|
constructor(e) {
|
|
2966
2970
|
this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = Q.create("languageUtils");
|
|
2967
2971
|
}
|
|
2968
2972
|
getScriptPartFromCode(e) {
|
|
2969
|
-
if (e =
|
|
2973
|
+
if (e = Oi(e), !e || e.indexOf("-") < 0) return null;
|
|
2970
2974
|
let t = e.split("-");
|
|
2971
2975
|
return t.length === 2 || (t.pop(), t[t.length - 1].toLowerCase() === "x") ? null : this.formatLanguageCode(t.join("-"));
|
|
2972
2976
|
}
|
|
2973
2977
|
getLanguagePartFromCode(e) {
|
|
2974
|
-
if (e =
|
|
2978
|
+
if (e = Oi(e), !e || e.indexOf("-") < 0) return e;
|
|
2975
2979
|
let t = e.split("-");
|
|
2976
2980
|
return this.formatLanguageCode(t[0]);
|
|
2977
2981
|
}
|
|
@@ -3021,17 +3025,17 @@ var Fi = {}, Ii = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3021
3025
|
r.indexOf(e) < 0 && i(this.formatLanguageCode(e));
|
|
3022
3026
|
}), r;
|
|
3023
3027
|
}
|
|
3024
|
-
},
|
|
3028
|
+
}, Bi = {
|
|
3025
3029
|
zero: 0,
|
|
3026
3030
|
one: 1,
|
|
3027
3031
|
two: 2,
|
|
3028
3032
|
few: 3,
|
|
3029
3033
|
many: 4,
|
|
3030
3034
|
other: 5
|
|
3031
|
-
},
|
|
3035
|
+
}, Vi = {
|
|
3032
3036
|
select: (e) => e === 1 ? "one" : "other",
|
|
3033
3037
|
resolvedOptions: () => ({ pluralCategories: ["one", "other"] })
|
|
3034
|
-
},
|
|
3038
|
+
}, Hi = class {
|
|
3035
3039
|
constructor(e, t = {}) {
|
|
3036
3040
|
this.languageUtils = e, this.options = t, this.logger = Q.create("pluralResolver"), this.pluralRulesCache = {};
|
|
3037
3041
|
}
|
|
@@ -3039,7 +3043,7 @@ var Fi = {}, Ii = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3039
3043
|
this.pluralRulesCache = {};
|
|
3040
3044
|
}
|
|
3041
3045
|
getRule(e, t = {}) {
|
|
3042
|
-
let n =
|
|
3046
|
+
let n = Oi(e === "dev" ? "en" : e), r = t.ordinal ? "ordinal" : "cardinal", i = JSON.stringify({
|
|
3043
3047
|
cleanedCode: n,
|
|
3044
3048
|
type: r
|
|
3045
3049
|
});
|
|
@@ -3048,8 +3052,8 @@ var Fi = {}, Ii = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3048
3052
|
try {
|
|
3049
3053
|
a = new Intl.PluralRules(n, { type: r });
|
|
3050
3054
|
} catch {
|
|
3051
|
-
if (typeof Intl > "u") return this.logger.error("No Intl support, please use an Intl polyfill!"),
|
|
3052
|
-
if (!e.match(/-|_/)) return
|
|
3055
|
+
if (typeof Intl > "u") return this.logger.error("No Intl support, please use an Intl polyfill!"), Vi;
|
|
3056
|
+
if (!e.match(/-|_/)) return Vi;
|
|
3053
3057
|
let n = this.languageUtils.getLanguagePartFromCode(e);
|
|
3054
3058
|
a = this.getRule(n, t);
|
|
3055
3059
|
}
|
|
@@ -3064,23 +3068,23 @@ var Fi = {}, Ii = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3064
3068
|
}
|
|
3065
3069
|
getSuffixes(e, t = {}) {
|
|
3066
3070
|
let n = this.getRule(e, t);
|
|
3067
|
-
return n ||= this.getRule("dev", t), n ? n.resolvedOptions().pluralCategories.sort((e, t) =>
|
|
3071
|
+
return n ||= this.getRule("dev", t), n ? n.resolvedOptions().pluralCategories.sort((e, t) => Bi[e] - Bi[t]).map((e) => `${this.options.prepend}${t.ordinal ? `ordinal${this.options.prepend}` : ""}${e}`) : [];
|
|
3068
3072
|
}
|
|
3069
3073
|
getSuffix(e, t, n = {}) {
|
|
3070
3074
|
let r = this.getRule(e, n);
|
|
3071
3075
|
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));
|
|
3072
3076
|
}
|
|
3073
|
-
},
|
|
3074
|
-
let a =
|
|
3075
|
-
return !a && i && Z(n) && (a =
|
|
3076
|
-
},
|
|
3077
|
+
}, Ui = (e, t, n, r = ".", i = !0) => {
|
|
3078
|
+
let a = vi(e, t, n);
|
|
3079
|
+
return !a && i && Z(n) && (a = Di(e, n, r), a === void 0 && (a = Di(t, n, r))), a;
|
|
3080
|
+
}, Wi = (e) => e.replace(/\$/g, "$$$$"), Gi = class {
|
|
3077
3081
|
constructor(e = {}) {
|
|
3078
3082
|
this.logger = Q.create("interpolator"), this.options = e, this.format = e?.interpolation?.format || ((e) => e), this.init(e);
|
|
3079
3083
|
}
|
|
3080
3084
|
init(e = {}) {
|
|
3081
3085
|
e.interpolation ||= { escapeValue: !0 };
|
|
3082
3086
|
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: ee } = e.interpolation;
|
|
3083
|
-
this.escape = t === void 0 ?
|
|
3087
|
+
this.escape = t === void 0 ? Si : t, this.escapeValue = n === void 0 || n, this.useRawValueToEscape = r !== void 0 && r, this.prefix = i ? bi(i) : a || "{{", this.suffix = o ? bi(o) : s || "}}", this.formatSeparator = c || ",", this.unescapePrefix = l ? "" : u || "-", this.unescapeSuffix = this.unescapePrefix ? "" : l || "", this.nestingPrefix = d ? bi(d) : f || bi("$t("), this.nestingSuffix = p ? bi(p) : m || bi(")"), this.nestingOptionsSeparator = h || ",", this.maxReplaces = g || 1e3, this.alwaysFormat = ee !== void 0 && ee, this.resetRegExp();
|
|
3084
3088
|
}
|
|
3085
3089
|
reset() {
|
|
3086
3090
|
this.options && this.init(this.options);
|
|
@@ -3092,7 +3096,7 @@ var Fi = {}, Ii = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3092
3096
|
interpolate(e, t, n, r) {
|
|
3093
3097
|
let i, a, o, s = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, c = (e) => {
|
|
3094
3098
|
if (e.indexOf(this.formatSeparator) < 0) {
|
|
3095
|
-
let i =
|
|
3099
|
+
let i = Ui(t, s, e, this.options.keySeparator, this.options.ignoreJSONStructure);
|
|
3096
3100
|
return this.alwaysFormat ? this.format(i, void 0, n, {
|
|
3097
3101
|
...r,
|
|
3098
3102
|
...t,
|
|
@@ -3100,7 +3104,7 @@ var Fi = {}, Ii = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3100
3104
|
}) : i;
|
|
3101
3105
|
}
|
|
3102
3106
|
let i = e.split(this.formatSeparator), a = i.shift().trim(), o = i.join(this.formatSeparator).trim();
|
|
3103
|
-
return this.format(
|
|
3107
|
+
return this.format(Ui(t, s, a, this.options.keySeparator, this.options.ignoreJSONStructure), o, n, {
|
|
3104
3108
|
...r,
|
|
3105
3109
|
...t,
|
|
3106
3110
|
interpolationkey: a
|
|
@@ -3110,10 +3114,10 @@ var Fi = {}, Ii = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3110
3114
|
let l = r?.missingInterpolationHandler || this.options.missingInterpolationHandler, u = r?.interpolation?.skipOnVariables === void 0 ? this.options.interpolation.skipOnVariables : r.interpolation.skipOnVariables;
|
|
3111
3115
|
return [{
|
|
3112
3116
|
regex: this.regexpUnescape,
|
|
3113
|
-
safeValue: (e) =>
|
|
3117
|
+
safeValue: (e) => Wi(e)
|
|
3114
3118
|
}, {
|
|
3115
3119
|
regex: this.regexp,
|
|
3116
|
-
safeValue: (e) => this.escapeValue ?
|
|
3120
|
+
safeValue: (e) => this.escapeValue ? Wi(this.escape(e)) : Wi(e)
|
|
3117
3121
|
}].forEach((t) => {
|
|
3118
3122
|
for (o = 0; i = t.regex.exec(e);) {
|
|
3119
3123
|
let n = i[1].trim();
|
|
@@ -3125,7 +3129,7 @@ var Fi = {}, Ii = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3125
3129
|
a = i[0];
|
|
3126
3130
|
continue;
|
|
3127
3131
|
} else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`), a = "";
|
|
3128
|
-
else !Z(a) && !this.useRawValueToEscape && (a =
|
|
3132
|
+
else !Z(a) && !this.useRawValueToEscape && (a = li(a));
|
|
3129
3133
|
let s = t.safeValue(a);
|
|
3130
3134
|
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;
|
|
3131
3135
|
}
|
|
@@ -3135,7 +3139,7 @@ var Fi = {}, Ii = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3135
3139
|
let r, i, a, o = (e, t) => {
|
|
3136
3140
|
let n = this.nestingOptionsSeparator;
|
|
3137
3141
|
if (e.indexOf(n) < 0) return e;
|
|
3138
|
-
let r = e.split(RegExp(`${
|
|
3142
|
+
let r = e.split(RegExp(`${bi(n)}[ ]*{`)), i = `{${r[1]}`;
|
|
3139
3143
|
e = r[0], i = this.interpolate(i, a);
|
|
3140
3144
|
let o = i.match(/'/g), s = i.match(/"/g);
|
|
3141
3145
|
((o?.length ?? 0) % 2 == 0 && !s || (s?.length ?? 0) % 2 != 0) && (i = i.replace(/'/g, "\""));
|
|
@@ -3154,14 +3158,14 @@ var Fi = {}, Ii = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3154
3158
|
a = { ...n }, a = a.replace && !Z(a.replace) ? a.replace : a, a.applyPostProcessor = !1, delete a.defaultValue;
|
|
3155
3159
|
let c = /{.*}/.test(r[1]) ? r[1].lastIndexOf("}") + 1 : r[1].indexOf(this.formatSeparator);
|
|
3156
3160
|
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 && !Z(i)) return i;
|
|
3157
|
-
Z(i) || (i =
|
|
3161
|
+
Z(i) || (i = li(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, {
|
|
3158
3162
|
...n,
|
|
3159
3163
|
interpolationkey: r[1].trim()
|
|
3160
3164
|
}), i.trim())), e = e.replace(r[0], i), this.regexp.lastIndex = 0;
|
|
3161
3165
|
}
|
|
3162
3166
|
return e;
|
|
3163
3167
|
}
|
|
3164
|
-
},
|
|
3168
|
+
}, Ki = (e) => {
|
|
3165
3169
|
let t = e.toLowerCase().trim(), n = {};
|
|
3166
3170
|
if (e.indexOf("(") > -1) {
|
|
3167
3171
|
let r = e.split("(");
|
|
@@ -3178,7 +3182,7 @@ var Fi = {}, Ii = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3178
3182
|
formatName: t,
|
|
3179
3183
|
formatOptions: n
|
|
3180
3184
|
};
|
|
3181
|
-
},
|
|
3185
|
+
}, qi = (e) => {
|
|
3182
3186
|
let t = {};
|
|
3183
3187
|
return (n, r, i) => {
|
|
3184
3188
|
let a = i;
|
|
@@ -3187,15 +3191,15 @@ var Fi = {}, Ii = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3187
3191
|
[i.interpolationkey]: void 0
|
|
3188
3192
|
});
|
|
3189
3193
|
let o = r + JSON.stringify(a), s = t[o];
|
|
3190
|
-
return s || (s = e(
|
|
3194
|
+
return s || (s = e(Oi(r), i), t[o] = s), s(n);
|
|
3191
3195
|
};
|
|
3192
|
-
},
|
|
3196
|
+
}, Ji = (e) => (t, n, r) => e(Oi(n), r)(t), Yi = class {
|
|
3193
3197
|
constructor(e = {}) {
|
|
3194
3198
|
this.logger = Q.create("formatter"), this.options = e, this.init(e);
|
|
3195
3199
|
}
|
|
3196
3200
|
init(e, t = { interpolation: {} }) {
|
|
3197
3201
|
this.formatSeparator = t.interpolation.formatSeparator || ",";
|
|
3198
|
-
let n = t.cacheInBuiltFormats ?
|
|
3202
|
+
let n = t.cacheInBuiltFormats ? qi : Ji;
|
|
3199
3203
|
this.formats = {
|
|
3200
3204
|
number: n((e, t) => {
|
|
3201
3205
|
let n = new Intl.NumberFormat(e, { ...t });
|
|
@@ -3226,7 +3230,7 @@ var Fi = {}, Ii = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3226
3230
|
this.formats[e.toLowerCase().trim()] = t;
|
|
3227
3231
|
}
|
|
3228
3232
|
addCached(e, t) {
|
|
3229
|
-
this.formats[e.toLowerCase().trim()] =
|
|
3233
|
+
this.formats[e.toLowerCase().trim()] = qi(t);
|
|
3230
3234
|
}
|
|
3231
3235
|
format(e, t, n, r = {}) {
|
|
3232
3236
|
let i = t.split(this.formatSeparator);
|
|
@@ -3235,7 +3239,7 @@ var Fi = {}, Ii = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3235
3239
|
i[0] = [i[0], ...i.splice(1, e)].join(this.formatSeparator);
|
|
3236
3240
|
}
|
|
3237
3241
|
return i.reduce((e, t) => {
|
|
3238
|
-
let { formatName: i, formatOptions: a } =
|
|
3242
|
+
let { formatName: i, formatOptions: a } = Ki(t);
|
|
3239
3243
|
if (this.formats[i]) {
|
|
3240
3244
|
let t = e;
|
|
3241
3245
|
try {
|
|
@@ -3253,9 +3257,9 @@ var Fi = {}, Ii = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3253
3257
|
return e;
|
|
3254
3258
|
}, e);
|
|
3255
3259
|
}
|
|
3256
|
-
},
|
|
3260
|
+
}, Xi = (e, t) => {
|
|
3257
3261
|
e.pending[t] !== void 0 && (delete e.pending[t], e.pendingCount--);
|
|
3258
|
-
},
|
|
3262
|
+
}, Zi = class extends Ai {
|
|
3259
3263
|
constructor(e, t, n, r = {}) {
|
|
3260
3264
|
super(), this.backend = e, this.store = t, this.services = n, this.languageUtils = n.languageUtils, this.options = r, this.logger = Q.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);
|
|
3261
3265
|
}
|
|
@@ -3285,7 +3289,7 @@ var Fi = {}, Ii = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3285
3289
|
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);
|
|
3286
3290
|
let o = {};
|
|
3287
3291
|
this.queue.forEach((n) => {
|
|
3288
|
-
|
|
3292
|
+
gi(n.loaded, [i], a), Xi(n, e), t && n.errors.push(t), n.pendingCount === 0 && !n.done && (Object.keys(n.loaded).forEach((e) => {
|
|
3289
3293
|
o[e] || (o[e] = {});
|
|
3290
3294
|
let t = n.loaded[e];
|
|
3291
3295
|
t.length && t.forEach((t) => {
|
|
@@ -3375,7 +3379,7 @@ var Fi = {}, Ii = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3375
3379
|
!e || !e[0] || this.store.addResource(e[0], t, n, r);
|
|
3376
3380
|
}
|
|
3377
3381
|
}
|
|
3378
|
-
},
|
|
3382
|
+
}, Qi = () => ({
|
|
3379
3383
|
debug: !1,
|
|
3380
3384
|
initAsync: !0,
|
|
3381
3385
|
ns: ["translation"],
|
|
@@ -3432,15 +3436,15 @@ var Fi = {}, Ii = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3432
3436
|
skipOnVariables: !0
|
|
3433
3437
|
},
|
|
3434
3438
|
cacheInBuiltFormats: !0
|
|
3435
|
-
}),
|
|
3439
|
+
}), $i = (e) => (Z(e.ns) && (e.ns = [e.ns]), Z(e.fallbackLng) && (e.fallbackLng = [e.fallbackLng]), Z(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), ea = () => {}, ta = (e) => {
|
|
3436
3440
|
Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((t) => {
|
|
3437
3441
|
typeof e[t] == "function" && (e[t] = e[t].bind(e));
|
|
3438
3442
|
});
|
|
3439
|
-
},
|
|
3440
|
-
typeof globalThis < "u" && (globalThis[
|
|
3441
|
-
},
|
|
3443
|
+
}, na = "__i18next_supportNoticeShown", ra = () => !!(typeof globalThis < "u" && globalThis[na] || typeof process < "u" && process.env && process.env.I18NEXT_NO_SUPPORT_NOTICE || typeof process < "u" && process.env), ia = () => {
|
|
3444
|
+
typeof globalThis < "u" && (globalThis[na] = !0);
|
|
3445
|
+
}, aa = (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)), $ = class e extends Ai {
|
|
3442
3446
|
constructor(e = {}, t) {
|
|
3443
|
-
if (super(), this.options =
|
|
3447
|
+
if (super(), this.options = $i(e), this.services = {}, this.logger = Q, this.modules = { external: [] }, ta(this), t && !this.isInitialized && !e.isClone) {
|
|
3444
3448
|
if (!this.options.initAsync) return this.init(e, t), this;
|
|
3445
3449
|
setTimeout(() => {
|
|
3446
3450
|
this.init(e, t);
|
|
@@ -3449,35 +3453,35 @@ var Fi = {}, Ii = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3449
3453
|
}
|
|
3450
3454
|
init(e = {}, t) {
|
|
3451
3455
|
this.isInitializing = !0, typeof e == "function" && (t = e, e = {}), e.defaultNS == null && e.ns && (Z(e.ns) ? e.defaultNS = e.ns : e.ns.indexOf("translation") < 0 && (e.defaultNS = e.ns[0]));
|
|
3452
|
-
let n =
|
|
3456
|
+
let n = Qi();
|
|
3453
3457
|
this.options = {
|
|
3454
3458
|
...n,
|
|
3455
3459
|
...this.options,
|
|
3456
|
-
|
|
3460
|
+
...$i(e)
|
|
3457
3461
|
}, this.options.interpolation = {
|
|
3458
3462
|
...n.interpolation,
|
|
3459
3463
|
...this.options.interpolation
|
|
3460
|
-
}, 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 && !
|
|
3464
|
+
}, 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 && !aa(this) && !ra() && (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 💙"), ia());
|
|
3461
3465
|
let r = (e) => e ? typeof e == "function" ? new e() : e : null;
|
|
3462
3466
|
if (!this.options.isClone) {
|
|
3463
3467
|
this.modules.logger ? Q.init(r(this.modules.logger), this.options) : Q.init(null, this.options);
|
|
3464
3468
|
let e;
|
|
3465
|
-
e = this.modules.formatter ? this.modules.formatter :
|
|
3466
|
-
let t = new
|
|
3467
|
-
this.store = new
|
|
3469
|
+
e = this.modules.formatter ? this.modules.formatter : Yi;
|
|
3470
|
+
let t = new zi(this.options);
|
|
3471
|
+
this.store = new ji(this.options.resources, this.options);
|
|
3468
3472
|
let i = this.services;
|
|
3469
|
-
i.logger = Q, i.resourceStore = this.store, i.languageUtils = t, i.pluralResolver = new
|
|
3473
|
+
i.logger = Q, i.resourceStore = this.store, i.languageUtils = t, i.pluralResolver = new Hi(t, {
|
|
3470
3474
|
prepend: this.options.pluralSeparator,
|
|
3471
3475
|
simplifyPluralSuffix: this.options.simplifyPluralSuffix
|
|
3472
|
-
}), 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
|
|
3476
|
+
}), 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 Gi(this.options), i.utils = { hasLoadedNamespace: this.hasLoadedNamespace.bind(this) }, i.backendConnector = new Zi(r(this.modules.backend), i.resourceStore, i, this.options), i.backendConnector.on("*", (e, ...t) => {
|
|
3473
3477
|
this.emit(e, ...t);
|
|
3474
|
-
}), 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
|
|
3478
|
+
}), 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 Ri(this.services, this.options), this.translator.on("*", (e, ...t) => {
|
|
3475
3479
|
this.emit(e, ...t);
|
|
3476
3480
|
}), this.modules.external.forEach((e) => {
|
|
3477
3481
|
e.init && e.init(this);
|
|
3478
3482
|
});
|
|
3479
3483
|
}
|
|
3480
|
-
if (this.format = this.options.interpolation.format, t ||=
|
|
3484
|
+
if (this.format = this.options.interpolation.format, t ||= ea, this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
|
|
3481
3485
|
let e = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
|
|
3482
3486
|
e.length > 0 && e[0] !== "dev" && (this.options.lng = e[0]);
|
|
3483
3487
|
}
|
|
@@ -3496,7 +3500,7 @@ var Fi = {}, Ii = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3496
3500
|
].forEach((e) => {
|
|
3497
3501
|
this[e] = (...t) => (this.store[e](...t), this);
|
|
3498
3502
|
});
|
|
3499
|
-
let i =
|
|
3503
|
+
let i = ci(), a = () => {
|
|
3500
3504
|
let e = (e, n) => {
|
|
3501
3505
|
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);
|
|
3502
3506
|
};
|
|
@@ -3505,7 +3509,7 @@ var Fi = {}, Ii = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3505
3509
|
};
|
|
3506
3510
|
return this.options.resources || !this.options.initAsync ? a() : setTimeout(a, 0), i;
|
|
3507
3511
|
}
|
|
3508
|
-
loadResources(e, t =
|
|
3512
|
+
loadResources(e, t = ea) {
|
|
3509
3513
|
let n = t, r = Z(e) ? e : this.language;
|
|
3510
3514
|
if (typeof e == "function" && (n = e), !this.options.resources || this.options.partialBundledLanguages) {
|
|
3511
3515
|
if (r?.toLowerCase() === "cimode" && (!this.options.preload || this.options.preload.length === 0)) return n();
|
|
@@ -3520,15 +3524,15 @@ var Fi = {}, Ii = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3520
3524
|
} else n(null);
|
|
3521
3525
|
}
|
|
3522
3526
|
reloadResources(e, t, n) {
|
|
3523
|
-
let r =
|
|
3524
|
-
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 ||=
|
|
3527
|
+
let r = ci();
|
|
3528
|
+
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 ||= ea, this.services.backendConnector.reload(e, t, (e) => {
|
|
3525
3529
|
r.resolve(), n(e);
|
|
3526
3530
|
}), r;
|
|
3527
3531
|
}
|
|
3528
3532
|
use(e) {
|
|
3529
3533
|
if (!e) throw Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
|
|
3530
3534
|
if (!e.type) throw Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");
|
|
3531
|
-
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" &&
|
|
3535
|
+
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" && Mi.addPostProcessor(e), e.type === "formatter" && (this.modules.formatter = e), e.type === "3rdParty" && this.modules.external.push(e), this;
|
|
3532
3536
|
}
|
|
3533
3537
|
setResolvedLanguage(e) {
|
|
3534
3538
|
if (!(!e || !this.languages) && !(["cimode", "dev"].indexOf(e) > -1)) {
|
|
@@ -3544,7 +3548,7 @@ var Fi = {}, Ii = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3544
3548
|
}
|
|
3545
3549
|
changeLanguage(e, t) {
|
|
3546
3550
|
this.isLanguageChangingTo = e;
|
|
3547
|
-
let n =
|
|
3551
|
+
let n = ci();
|
|
3548
3552
|
this.emit("languageChanging", e);
|
|
3549
3553
|
let r = (e) => {
|
|
3550
3554
|
this.language = e, this.languages = this.services.languageUtils.toResolveHierarchy(e), this.resolvedLanguage = void 0, this.setResolvedLanguage(e);
|
|
@@ -3567,9 +3571,9 @@ var Fi = {}, Ii = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3567
3571
|
...this.options,
|
|
3568
3572
|
...a
|
|
3569
3573
|
};
|
|
3570
|
-
typeof a.keyPrefix == "function" && (a.keyPrefix =
|
|
3574
|
+
typeof a.keyPrefix == "function" && (a.keyPrefix = Fi(a.keyPrefix, o));
|
|
3571
3575
|
let s = this.options.keySeparator || ".", c;
|
|
3572
|
-
return a.keyPrefix && Array.isArray(e) ? c = e.map((e) => (typeof e == "function" && (e =
|
|
3576
|
+
return a.keyPrefix && Array.isArray(e) ? c = e.map((e) => (typeof e == "function" && (e = Fi(e, o)), `${a.keyPrefix}${s}${e}`)) : (typeof e == "function" && (e = Fi(e, o)), c = a.keyPrefix ? `${a.keyPrefix}${s}${e}` : e), this.t(c, a);
|
|
3573
3577
|
};
|
|
3574
3578
|
return Z(e) ? r.lng = e : r.lngs = e, r.ns = t, r.keyPrefix = n, r;
|
|
3575
3579
|
}
|
|
@@ -3598,7 +3602,7 @@ var Fi = {}, Ii = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3598
3602
|
return !!(this.hasResourceBundle(n, e) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || a(n, e) && (!r || a(i, e)));
|
|
3599
3603
|
}
|
|
3600
3604
|
loadNamespaces(e, t) {
|
|
3601
|
-
let n =
|
|
3605
|
+
let n = ci();
|
|
3602
3606
|
return this.options.ns ? (Z(e) && (e = [e]), e.forEach((e) => {
|
|
3603
3607
|
this.options.ns.indexOf(e) < 0 && this.options.ns.push(e);
|
|
3604
3608
|
}), this.loadResources((e) => {
|
|
@@ -3606,7 +3610,7 @@ var Fi = {}, Ii = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3606
3610
|
}), n) : (t && t(), Promise.resolve());
|
|
3607
3611
|
}
|
|
3608
3612
|
loadLanguages(e, t) {
|
|
3609
|
-
let n =
|
|
3613
|
+
let n = ci();
|
|
3610
3614
|
Z(e) && (e = [e]);
|
|
3611
3615
|
let r = this.options.preload || [], i = e.filter((e) => r.indexOf(e) < 0 && this.services.languageUtils.isSupportedCode(e));
|
|
3612
3616
|
return i.length ? (this.options.preload = r.concat(i), this.loadResources((e) => {
|
|
@@ -3622,14 +3626,14 @@ var Fi = {}, Ii = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3622
3626
|
if (e && e.direction) return e.direction;
|
|
3623
3627
|
}
|
|
3624
3628
|
} catch {}
|
|
3625
|
-
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
|
|
3629
|
+
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 zi(Qi());
|
|
3626
3630
|
return e.toLowerCase().indexOf("-latn") > 1 ? "ltr" : t.indexOf(n.getLanguagePartFromCode(e)) > -1 || e.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
|
|
3627
3631
|
}
|
|
3628
3632
|
static createInstance(t = {}, n) {
|
|
3629
3633
|
let r = new e(t, n);
|
|
3630
3634
|
return r.createInstance = e.createInstance, r;
|
|
3631
3635
|
}
|
|
3632
|
-
cloneInstance(t = {}, n =
|
|
3636
|
+
cloneInstance(t = {}, n = ea) {
|
|
3633
3637
|
let r = t.forkResourceStore;
|
|
3634
3638
|
r && delete t.forkResourceStore;
|
|
3635
3639
|
let i = {
|
|
@@ -3643,18 +3647,18 @@ var Fi = {}, Ii = (e) => !Z(e) && typeof e != "boolean" && typeof e != "number",
|
|
|
3643
3647
|
"language"
|
|
3644
3648
|
].forEach((e) => {
|
|
3645
3649
|
a[e] = this[e];
|
|
3646
|
-
}), a.services = { ...this.services }, a.services.utils = { hasLoadedNamespace: a.hasLoadedNamespace.bind(a) }, r && (a.store = new
|
|
3650
|
+
}), a.services = { ...this.services }, a.services.utils = { hasLoadedNamespace: a.hasLoadedNamespace.bind(a) }, r && (a.store = new ji(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) {
|
|
3647
3651
|
let e = {
|
|
3648
|
-
...
|
|
3652
|
+
...Qi().interpolation,
|
|
3649
3653
|
...this.options.interpolation,
|
|
3650
3654
|
...t.interpolation
|
|
3651
3655
|
}, n = {
|
|
3652
3656
|
...i,
|
|
3653
3657
|
interpolation: e
|
|
3654
3658
|
};
|
|
3655
|
-
a.services.interpolator = new
|
|
3659
|
+
a.services.interpolator = new Gi(n);
|
|
3656
3660
|
}
|
|
3657
|
-
return a.translator = new
|
|
3661
|
+
return a.translator = new Ri(a.services, i), a.translator.on("*", (e, ...t) => {
|
|
3658
3662
|
a.emit(e, ...t);
|
|
3659
3663
|
}), a.init(i, n), a.translator.options = i, a.translator.backendConnector.services.utils = { hasLoadedNamespace: a.hasLoadedNamespace.bind(a) }, a;
|
|
3660
3664
|
}
|
|
@@ -3675,13 +3679,13 @@ $.createInstance, $.dir, $.init, $.loadResources, $.reloadResources, $.use, $.ch
|
|
|
3675
3679
|
lng: "en",
|
|
3676
3680
|
showSupportNotice: !1,
|
|
3677
3681
|
resources: {
|
|
3678
|
-
en:
|
|
3679
|
-
es:
|
|
3682
|
+
en: oi,
|
|
3683
|
+
es: si
|
|
3680
3684
|
}
|
|
3681
3685
|
});
|
|
3682
3686
|
//#endregion
|
|
3683
3687
|
//#region src/i18n.ts
|
|
3684
|
-
var { translator:
|
|
3688
|
+
var { translator: oa } = {
|
|
3685
3689
|
translator: {
|
|
3686
3690
|
...$,
|
|
3687
3691
|
t: (e, t) => {
|
|
@@ -3713,23 +3717,23 @@ var { translator: aa } = {
|
|
|
3713
3717
|
label: "Spanish"
|
|
3714
3718
|
}]
|
|
3715
3719
|
};
|
|
3716
|
-
function
|
|
3717
|
-
return
|
|
3720
|
+
function sa(e, t) {
|
|
3721
|
+
return oa.t(`translation:simpleCloze:${e}`, { lng: t });
|
|
3718
3722
|
}
|
|
3719
3723
|
//#endregion
|
|
3720
3724
|
//#region src/print/Print.svelte
|
|
3721
|
-
var
|
|
3725
|
+
var ca = /* @__PURE__ */ cr("<div class=\"simple-cloze-print-teacher-instructions svelte-1fx5wwa\"></div>"), la = /* @__PURE__ */ cr("<div class=\"simple-cloze-print-prompt svelte-1fx5wwa\"></div>"), ua = /* @__PURE__ */ cr("<span class=\"simple-cloze-print-key-label svelte-1fx5wwa\"> </span> <span class=\"simple-cloze-print-blank simple-cloze-print-blank--key svelte-1fx5wwa\"> </span>", 1), da = /* @__PURE__ */ cr("<span class=\"simple-cloze-print-blank svelte-1fx5wwa\" role=\"img\"></span>"), fa = /* @__PURE__ */ cr("<div class=\"simple-cloze-print svelte-1fx5wwa\"><!> <!> <div class=\"simple-cloze-print-response svelte-1fx5wwa\"><!></div></div>"), pa = {
|
|
3722
3726
|
hash: "svelte-1fx5wwa",
|
|
3723
3727
|
code: "\n /* Self-contained: print players ship no Tailwind or CSS reset. */.simple-cloze-print.svelte-1fx5wwa {padding:1rem;color:var(--pie-text, black);}.simple-cloze-print-teacher-instructions.svelte-1fx5wwa,\n .simple-cloze-print-prompt.svelte-1fx5wwa {margin-bottom:1rem;}.simple-cloze-print-teacher-instructions.svelte-1fx5wwa p,\n .simple-cloze-print-prompt.svelte-1fx5wwa p {margin:0.5em 0;}.simple-cloze-print-prompt.svelte-1fx5wwa strong {font-weight:600;}.simple-cloze-print-response.svelte-1fx5wwa {display:inline-flex;align-items:baseline;gap:0.5rem;}.simple-cloze-print-key-label.svelte-1fx5wwa {font-size:0.875rem;line-height:1.25rem;font-weight:600;}.simple-cloze-print-blank.svelte-1fx5wwa {display:inline-block;min-width:12rem;min-height:1.5rem;padding:0.5rem 0.75rem;border-bottom:2px solid var(--pie-text, black);}.simple-cloze-print-blank--key.svelte-1fx5wwa {min-width:6rem;font-weight:600;}\n\n @media print {.simple-cloze-print.svelte-1fx5wwa {padding:0;}\n }"
|
|
3724
3728
|
};
|
|
3725
|
-
function
|
|
3726
|
-
Ge(t, !0), Er(e,
|
|
3727
|
-
let n = Ir(t, "model", 7, null), r = Ir(t, "options", 7, null), i = /* @__PURE__ */ pt(() => r()?.role === "instructor"), a = /* @__PURE__ */ pt(() => n()?.promptEnabled !== !1 && typeof n()?.prompt == "string" ? n().prompt : ""), o = /* @__PURE__ */ pt(() =>
|
|
3729
|
+
function ma(e, t) {
|
|
3730
|
+
Ge(t, !0), Er(e, pa);
|
|
3731
|
+
let n = Ir(t, "model", 7, null), r = Ir(t, "options", 7, null), i = /* @__PURE__ */ pt(() => r()?.role === "instructor"), a = /* @__PURE__ */ pt(() => n()?.promptEnabled !== !1 && typeof n()?.prompt == "string" ? n().prompt : ""), o = /* @__PURE__ */ pt(() => ai(n()?.correctAnswer)), s = /* @__PURE__ */ pt(() => X(i) && !!X(o)), c = /* @__PURE__ */ pt(() => X(i) && n()?.teacherInstructionsEnabled !== !1 && n()?.teacherInstructions || ""), l = /* @__PURE__ */ M(null);
|
|
3728
3732
|
pn(() => {
|
|
3729
3733
|
if (!X(l) || !X(a)) return;
|
|
3730
3734
|
let e = (e) => console.warn("simple-cloze: MathJax render failed", e);
|
|
3731
3735
|
try {
|
|
3732
|
-
Promise.resolve(
|
|
3736
|
+
Promise.resolve(Zr(X(l))).catch(e);
|
|
3733
3737
|
} catch (t) {
|
|
3734
3738
|
e(t);
|
|
3735
3739
|
}
|
|
@@ -3747,41 +3751,41 @@ function pa(e, t) {
|
|
|
3747
3751
|
set options(e = null) {
|
|
3748
3752
|
r(e), At();
|
|
3749
3753
|
}
|
|
3750
|
-
}, d =
|
|
3751
|
-
var t =
|
|
3754
|
+
}, d = fa(), f = $t(d), p = (e) => {
|
|
3755
|
+
var t = ca();
|
|
3752
3756
|
Tr(t, () => X(c), !0), Ee(t), lr(e, t);
|
|
3753
3757
|
};
|
|
3754
3758
|
wr(f, (e) => {
|
|
3755
3759
|
X(c) && e(p);
|
|
3756
3760
|
});
|
|
3757
3761
|
var m = nn(f, 2), h = (e) => {
|
|
3758
|
-
var t =
|
|
3762
|
+
var t = la();
|
|
3759
3763
|
Tr(t, () => X(a), !0), Ee(t), Fr(t, (e) => N(l, e), () => X(l)), lr(e, t);
|
|
3760
3764
|
};
|
|
3761
3765
|
wr(m, (e) => {
|
|
3762
3766
|
X(a) && e(h);
|
|
3763
3767
|
});
|
|
3764
3768
|
var g = nn(m, 2), ee = $t(g), _ = (e) => {
|
|
3765
|
-
var t =
|
|
3769
|
+
var t = ua(), r = en(t), i = tn(r, !0), a = tn(nn(r, 2), !0);
|
|
3766
3770
|
bn((e) => {
|
|
3767
3771
|
gr(i, e), gr(a, X(o));
|
|
3768
|
-
}, [() =>
|
|
3772
|
+
}, [() => sa("printCorrectAnswer", n()?.language)]), lr(e, t);
|
|
3769
3773
|
}, v = (e) => {
|
|
3770
|
-
var t =
|
|
3771
|
-
bn((e) => Ar(t, "aria-label", e), [() =>
|
|
3774
|
+
var t = da();
|
|
3775
|
+
bn((e) => Ar(t, "aria-label", e), [() => sa("printAnswerBlank", n()?.language)]), lr(e, t);
|
|
3772
3776
|
};
|
|
3773
3777
|
return wr(ee, (e) => {
|
|
3774
3778
|
X(s) ? e(_) : e(v, -1);
|
|
3775
3779
|
}), Ee(g), Ee(d), lr(e, d), Ke(u);
|
|
3776
3780
|
}
|
|
3777
|
-
Hr(
|
|
3781
|
+
Hr(ma, {
|
|
3778
3782
|
model: { type: "Object" },
|
|
3779
3783
|
options: { type: "Object" }
|
|
3780
3784
|
}, [], []);
|
|
3781
3785
|
//#endregion
|
|
3782
3786
|
//#region src/print/index.ts
|
|
3783
|
-
var
|
|
3787
|
+
var ha = ma.element;
|
|
3784
3788
|
//#endregion
|
|
3785
|
-
export {
|
|
3789
|
+
export { ha as default };
|
|
3786
3790
|
|
|
3787
3791
|
//# sourceMappingURL=print.js.map
|