@jnrs/vue-core 1.1.2 → 1.1.3

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,1644 @@
1
+ import { getCurrentInstance as we, getCurrentScope as Ie, hasInjectionContext as Ce, inject as je, watch as Pe, shallowRef as B, watchEffect as Te, toValue as D, computed as ne, onMounted as De, unref as Ve, ref as Q } from "vue";
2
+ import { defineStore as Me } from "pinia";
3
+ const p = (r) => typeof r == "string", A = () => {
4
+ let r, e;
5
+ const t = new Promise((i, s) => {
6
+ r = i, e = s;
7
+ });
8
+ return t.resolve = r, t.reject = e, t;
9
+ }, ue = (r) => r == null ? "" : "" + r, Ae = (r, e, t) => {
10
+ r.forEach((i) => {
11
+ e[i] && (t[i] = e[i]);
12
+ });
13
+ }, Ke = /###/g, ce = (r) => r && r.indexOf("###") > -1 ? r.replace(Ke, ".") : r, fe = (r) => !r || p(r), K = (r, e, t) => {
14
+ const i = p(e) ? e.split(".") : e;
15
+ let s = 0;
16
+ for (; s < i.length - 1; ) {
17
+ if (fe(r)) return {};
18
+ const n = ce(i[s]);
19
+ !r[n] && t && (r[n] = new t()), Object.prototype.hasOwnProperty.call(r, n) ? r = r[n] : r = {}, ++s;
20
+ }
21
+ return fe(r) ? {} : {
22
+ obj: r,
23
+ k: ce(i[s])
24
+ };
25
+ }, he = (r, e, t) => {
26
+ const {
27
+ obj: i,
28
+ k: s
29
+ } = K(r, e, Object);
30
+ if (i !== void 0 || e.length === 1) {
31
+ i[s] = t;
32
+ return;
33
+ }
34
+ let n = e[e.length - 1], a = e.slice(0, e.length - 1), o = K(r, a, Object);
35
+ for (; o.obj === void 0 && a.length; )
36
+ n = `${a[a.length - 1]}.${n}`, a = a.slice(0, a.length - 1), o = K(r, a, Object), o?.obj && typeof o.obj[`${o.k}.${n}`] < "u" && (o.obj = void 0);
37
+ o.obj[`${o.k}.${n}`] = t;
38
+ }, Ue = (r, e, t, i) => {
39
+ const {
40
+ obj: s,
41
+ k: n
42
+ } = K(r, e, Object);
43
+ s[n] = s[n] || [], s[n].push(t);
44
+ }, W = (r, e) => {
45
+ const {
46
+ obj: t,
47
+ k: i
48
+ } = K(r, e);
49
+ if (t && Object.prototype.hasOwnProperty.call(t, i))
50
+ return t[i];
51
+ }, He = (r, e, t) => {
52
+ const i = W(r, t);
53
+ return i !== void 0 ? i : W(e, t);
54
+ }, Re = (r, e, t) => {
55
+ for (const i in e)
56
+ i !== "__proto__" && i !== "constructor" && (i in r ? p(r[i]) || r[i] instanceof String || p(e[i]) || e[i] instanceof String ? t && (r[i] = e[i]) : Re(r[i], e[i], t) : r[i] = e[i]);
57
+ return r;
58
+ }, T = (r) => r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
59
+ var Ze = {
60
+ "&": "&amp;",
61
+ "<": "&lt;",
62
+ ">": "&gt;",
63
+ '"': "&quot;",
64
+ "'": "&#39;",
65
+ "/": "&#x2F;"
66
+ };
67
+ const ze = (r) => p(r) ? r.replace(/[&<>"'\/]/g, (e) => Ze[e]) : r;
68
+ class Be {
69
+ constructor(e) {
70
+ this.capacity = e, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = [];
71
+ }
72
+ getRegExp(e) {
73
+ const t = this.regExpMap.get(e);
74
+ if (t !== void 0)
75
+ return t;
76
+ const i = new RegExp(e);
77
+ return this.regExpQueue.length === this.capacity && this.regExpMap.delete(this.regExpQueue.shift()), this.regExpMap.set(e, i), this.regExpQueue.push(e), i;
78
+ }
79
+ }
80
+ const We = [" ", ",", "?", "!", ";"], Je = new Be(20), Ge = (r, e, t) => {
81
+ e = e || "", t = t || "";
82
+ const i = We.filter((a) => e.indexOf(a) < 0 && t.indexOf(a) < 0);
83
+ if (i.length === 0) return !0;
84
+ const s = Je.getRegExp(`(${i.map((a) => a === "?" ? "\\?" : a).join("|")})`);
85
+ let n = !s.test(r);
86
+ if (!n) {
87
+ const a = r.indexOf(t);
88
+ a > 0 && !s.test(r.substring(0, a)) && (n = !0);
89
+ }
90
+ return n;
91
+ }, te = (r, e, t = ".") => {
92
+ if (!r) return;
93
+ if (r[e])
94
+ return Object.prototype.hasOwnProperty.call(r, e) ? r[e] : void 0;
95
+ const i = e.split(t);
96
+ let s = r;
97
+ for (let n = 0; n < i.length; ) {
98
+ if (!s || typeof s != "object")
99
+ return;
100
+ let a, o = "";
101
+ for (let l = n; l < i.length; ++l)
102
+ if (l !== n && (o += t), o += i[l], a = s[o], a !== void 0) {
103
+ if (["string", "number", "boolean"].indexOf(typeof a) > -1 && l < i.length - 1)
104
+ continue;
105
+ n += l - n + 1;
106
+ break;
107
+ }
108
+ s = a;
109
+ }
110
+ return s;
111
+ }, H = (r) => r?.replace("_", "-"), qe = {
112
+ type: "logger",
113
+ log(r) {
114
+ this.output("log", r);
115
+ },
116
+ warn(r) {
117
+ this.output("warn", r);
118
+ },
119
+ error(r) {
120
+ this.output("error", r);
121
+ },
122
+ output(r, e) {
123
+ console?.[r]?.apply?.(console, e);
124
+ }
125
+ };
126
+ class J {
127
+ constructor(e, t = {}) {
128
+ this.init(e, t);
129
+ }
130
+ init(e, t = {}) {
131
+ this.prefix = t.prefix || "i18next:", this.logger = e || qe, this.options = t, this.debug = t.debug;
132
+ }
133
+ log(...e) {
134
+ return this.forward(e, "log", "", !0);
135
+ }
136
+ warn(...e) {
137
+ return this.forward(e, "warn", "", !0);
138
+ }
139
+ error(...e) {
140
+ return this.forward(e, "error", "");
141
+ }
142
+ deprecate(...e) {
143
+ return this.forward(e, "warn", "WARNING DEPRECATED: ", !0);
144
+ }
145
+ forward(e, t, i, s) {
146
+ return s && !this.debug ? null : (p(e[0]) && (e[0] = `${i}${this.prefix} ${e[0]}`), this.logger[t](e));
147
+ }
148
+ create(e) {
149
+ return new J(this.logger, {
150
+ prefix: `${this.prefix}:${e}:`,
151
+ ...this.options
152
+ });
153
+ }
154
+ clone(e) {
155
+ return e = e || this.options, e.prefix = e.prefix || this.prefix, new J(this.logger, e);
156
+ }
157
+ }
158
+ var R = new J();
159
+ class q {
160
+ constructor() {
161
+ this.observers = {};
162
+ }
163
+ on(e, t) {
164
+ return e.split(" ").forEach((i) => {
165
+ this.observers[i] || (this.observers[i] = /* @__PURE__ */ new Map());
166
+ const s = this.observers[i].get(t) || 0;
167
+ this.observers[i].set(t, s + 1);
168
+ }), this;
169
+ }
170
+ off(e, t) {
171
+ if (this.observers[e]) {
172
+ if (!t) {
173
+ delete this.observers[e];
174
+ return;
175
+ }
176
+ this.observers[e].delete(t);
177
+ }
178
+ }
179
+ emit(e, ...t) {
180
+ this.observers[e] && Array.from(this.observers[e].entries()).forEach(([s, n]) => {
181
+ for (let a = 0; a < n; a++)
182
+ s(...t);
183
+ }), this.observers["*"] && Array.from(this.observers["*"].entries()).forEach(([s, n]) => {
184
+ for (let a = 0; a < n; a++)
185
+ s.apply(s, [e, ...t]);
186
+ });
187
+ }
188
+ }
189
+ class de extends q {
190
+ constructor(e, t = {
191
+ ns: ["translation"],
192
+ defaultNS: "translation"
193
+ }) {
194
+ super(), this.data = e || {}, this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.options.ignoreJSONStructure === void 0 && (this.options.ignoreJSONStructure = !0);
195
+ }
196
+ addNamespaces(e) {
197
+ this.options.ns.indexOf(e) < 0 && this.options.ns.push(e);
198
+ }
199
+ removeNamespaces(e) {
200
+ const t = this.options.ns.indexOf(e);
201
+ t > -1 && this.options.ns.splice(t, 1);
202
+ }
203
+ getResource(e, t, i, s = {}) {
204
+ const n = s.keySeparator !== void 0 ? s.keySeparator : this.options.keySeparator, a = s.ignoreJSONStructure !== void 0 ? s.ignoreJSONStructure : this.options.ignoreJSONStructure;
205
+ let o;
206
+ e.indexOf(".") > -1 ? o = e.split(".") : (o = [e, t], i && (Array.isArray(i) ? o.push(...i) : p(i) && n ? o.push(...i.split(n)) : o.push(i)));
207
+ const l = W(this.data, o);
208
+ return !l && !t && !i && e.indexOf(".") > -1 && (e = o[0], t = o[1], i = o.slice(2).join(".")), l || !a || !p(i) ? l : te(this.data?.[e]?.[t], i, n);
209
+ }
210
+ addResource(e, t, i, s, n = {
211
+ silent: !1
212
+ }) {
213
+ const a = n.keySeparator !== void 0 ? n.keySeparator : this.options.keySeparator;
214
+ let o = [e, t];
215
+ i && (o = o.concat(a ? i.split(a) : i)), e.indexOf(".") > -1 && (o = e.split("."), s = t, t = o[1]), this.addNamespaces(t), he(this.data, o, s), n.silent || this.emit("added", e, t, i, s);
216
+ }
217
+ addResources(e, t, i, s = {
218
+ silent: !1
219
+ }) {
220
+ for (const n in i)
221
+ (p(i[n]) || Array.isArray(i[n])) && this.addResource(e, t, n, i[n], {
222
+ silent: !0
223
+ });
224
+ s.silent || this.emit("added", e, t, i);
225
+ }
226
+ addResourceBundle(e, t, i, s, n, a = {
227
+ silent: !1,
228
+ skipCopy: !1
229
+ }) {
230
+ let o = [e, t];
231
+ e.indexOf(".") > -1 && (o = e.split("."), s = i, i = t, t = o[1]), this.addNamespaces(t);
232
+ let l = W(this.data, o) || {};
233
+ a.skipCopy || (i = JSON.parse(JSON.stringify(i))), s ? Re(l, i, n) : l = {
234
+ ...l,
235
+ ...i
236
+ }, he(this.data, o, l), a.silent || this.emit("added", e, t, i);
237
+ }
238
+ removeResourceBundle(e, t) {
239
+ this.hasResourceBundle(e, t) && delete this.data[e][t], this.removeNamespaces(t), this.emit("removed", e, t);
240
+ }
241
+ hasResourceBundle(e, t) {
242
+ return this.getResource(e, t) !== void 0;
243
+ }
244
+ getResourceBundle(e, t) {
245
+ return t || (t = this.options.defaultNS), this.getResource(e, t);
246
+ }
247
+ getDataByLanguage(e) {
248
+ return this.data[e];
249
+ }
250
+ hasLanguageSomeTranslations(e) {
251
+ const t = this.getDataByLanguage(e);
252
+ return !!(t && Object.keys(t) || []).find((s) => t[s] && Object.keys(t[s]).length > 0);
253
+ }
254
+ toJSON() {
255
+ return this.data;
256
+ }
257
+ }
258
+ var $e = {
259
+ processors: {},
260
+ addPostProcessor(r) {
261
+ this.processors[r.name] = r;
262
+ },
263
+ handle(r, e, t, i, s) {
264
+ return r.forEach((n) => {
265
+ e = this.processors[n]?.process(e, t, i, s) ?? e;
266
+ }), e;
267
+ }
268
+ };
269
+ const Ee = Symbol("i18next/PATH_KEY");
270
+ function Qe() {
271
+ const r = [], e = /* @__PURE__ */ Object.create(null);
272
+ let t;
273
+ return e.get = (i, s) => (t?.revoke?.(), s === Ee ? r : (r.push(s), t = Proxy.revocable(i, e), t.proxy)), Proxy.revocable(/* @__PURE__ */ Object.create(null), e).proxy;
274
+ }
275
+ function se(r, e) {
276
+ const {
277
+ [Ee]: t
278
+ } = r(Qe());
279
+ return t.join(e?.keySeparator ?? ".");
280
+ }
281
+ const pe = {}, Y = (r) => !p(r) && typeof r != "boolean" && typeof r != "number";
282
+ class G extends q {
283
+ constructor(e, t = {}) {
284
+ super(), Ae(["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], e, this), this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger = R.create("translator");
285
+ }
286
+ changeLanguage(e) {
287
+ e && (this.language = e);
288
+ }
289
+ exists(e, t = {
290
+ interpolation: {}
291
+ }) {
292
+ const i = {
293
+ ...t
294
+ };
295
+ if (e == null) return !1;
296
+ const s = this.resolve(e, i);
297
+ if (s?.res === void 0) return !1;
298
+ const n = Y(s.res);
299
+ return !(i.returnObjects === !1 && n);
300
+ }
301
+ extractFromKey(e, t) {
302
+ let i = t.nsSeparator !== void 0 ? t.nsSeparator : this.options.nsSeparator;
303
+ i === void 0 && (i = ":");
304
+ const s = t.keySeparator !== void 0 ? t.keySeparator : this.options.keySeparator;
305
+ let n = t.ns || this.options.defaultNS || [];
306
+ const a = i && e.indexOf(i) > -1, o = !this.options.userDefinedKeySeparator && !t.keySeparator && !this.options.userDefinedNsSeparator && !t.nsSeparator && !Ge(e, i, s);
307
+ if (a && !o) {
308
+ const l = e.match(this.interpolator.nestingRegexp);
309
+ if (l && l.length > 0)
310
+ return {
311
+ key: e,
312
+ namespaces: p(n) ? [n] : n
313
+ };
314
+ const u = e.split(i);
315
+ (i !== s || i === s && this.options.ns.indexOf(u[0]) > -1) && (n = u.shift()), e = u.join(s);
316
+ }
317
+ return {
318
+ key: e,
319
+ namespaces: p(n) ? [n] : n
320
+ };
321
+ }
322
+ translate(e, t, i) {
323
+ let s = typeof t == "object" ? {
324
+ ...t
325
+ } : t;
326
+ if (typeof s != "object" && this.options.overloadTranslationOptionHandler && (s = this.options.overloadTranslationOptionHandler(arguments)), typeof s == "object" && (s = {
327
+ ...s
328
+ }), s || (s = {}), e == null) return "";
329
+ typeof e == "function" && (e = se(e, {
330
+ ...this.options,
331
+ ...s
332
+ })), Array.isArray(e) || (e = [String(e)]);
333
+ const n = s.returnDetails !== void 0 ? s.returnDetails : this.options.returnDetails, a = s.keySeparator !== void 0 ? s.keySeparator : this.options.keySeparator, {
334
+ key: o,
335
+ namespaces: l
336
+ } = this.extractFromKey(e[e.length - 1], s), u = l[l.length - 1];
337
+ let f = s.nsSeparator !== void 0 ? s.nsSeparator : this.options.nsSeparator;
338
+ f === void 0 && (f = ":");
339
+ const c = s.lng || this.language, g = s.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
340
+ if (c?.toLowerCase() === "cimode")
341
+ return g ? n ? {
342
+ res: `${u}${f}${o}`,
343
+ usedKey: o,
344
+ exactUsedKey: o,
345
+ usedLng: c,
346
+ usedNS: u,
347
+ usedParams: this.getUsedParamsDetails(s)
348
+ } : `${u}${f}${o}` : n ? {
349
+ res: o,
350
+ usedKey: o,
351
+ exactUsedKey: o,
352
+ usedLng: c,
353
+ usedNS: u,
354
+ usedParams: this.getUsedParamsDetails(s)
355
+ } : o;
356
+ const h = this.resolve(e, s);
357
+ let d = h?.res;
358
+ const m = h?.usedKey || o, b = h?.exactUsedKey || o, L = ["[object Number]", "[object Function]", "[object RegExp]"], y = s.joinArrays !== void 0 ? s.joinArrays : this.options.joinArrays, F = !this.i18nFormat || this.i18nFormat.handleAsObject, v = s.count !== void 0 && !p(s.count), E = G.hasDefaultValue(s), I = v ? this.pluralResolver.getSuffix(c, s.count, s) : "", j = s.ordinal && v ? this.pluralResolver.getSuffix(c, s.count, {
359
+ ordinal: !1
360
+ }) : "", re = v && !s.ordinal && s.count === 0, N = re && s[`defaultValue${this.options.pluralSeparator}zero`] || s[`defaultValue${I}`] || s[`defaultValue${j}`] || s.defaultValue;
361
+ let w = d;
362
+ F && !d && E && (w = N);
363
+ const Fe = Y(w), ke = Object.prototype.toString.apply(w);
364
+ if (F && w && Fe && L.indexOf(ke) < 0 && !(p(y) && Array.isArray(w))) {
365
+ if (!s.returnObjects && !this.options.returnObjects) {
366
+ this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
367
+ const C = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(m, w, {
368
+ ...s,
369
+ ns: l
370
+ }) : `key '${o} (${this.language})' returned an object instead of string.`;
371
+ return n ? (h.res = C, h.usedParams = this.getUsedParamsDetails(s), h) : C;
372
+ }
373
+ if (a) {
374
+ const C = Array.isArray(w), O = C ? [] : {}, ae = C ? b : m;
375
+ for (const P in w)
376
+ if (Object.prototype.hasOwnProperty.call(w, P)) {
377
+ const $ = `${ae}${a}${P}`;
378
+ E && !d ? O[P] = this.translate($, {
379
+ ...s,
380
+ defaultValue: Y(N) ? N[P] : void 0,
381
+ joinArrays: !1,
382
+ ns: l
383
+ }) : O[P] = this.translate($, {
384
+ ...s,
385
+ joinArrays: !1,
386
+ ns: l
387
+ }), O[P] === $ && (O[P] = w[P]);
388
+ }
389
+ d = O;
390
+ }
391
+ } else if (F && p(y) && Array.isArray(d))
392
+ d = d.join(y), d && (d = this.extendTranslation(d, e, s, i));
393
+ else {
394
+ let C = !1, O = !1;
395
+ !this.isValidLookup(d) && E && (C = !0, d = N), this.isValidLookup(d) || (O = !0, d = o);
396
+ const P = (s.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && O ? void 0 : d, $ = E && N !== d && this.options.updateMissing;
397
+ if (O || C || $) {
398
+ if (this.logger.log($ ? "updateKey" : "missingKey", c, u, o, $ ? N : d), a) {
399
+ const S = this.resolve(o, {
400
+ ...s,
401
+ keySeparator: !1
402
+ });
403
+ S && S.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.");
404
+ }
405
+ let V = [];
406
+ const Z = this.languageUtils.getFallbackCodes(this.options.fallbackLng, s.lng || this.language);
407
+ if (this.options.saveMissingTo === "fallback" && Z && Z[0])
408
+ for (let S = 0; S < Z.length; S++)
409
+ V.push(Z[S]);
410
+ else this.options.saveMissingTo === "all" ? V = this.languageUtils.toResolveHierarchy(s.lng || this.language) : V.push(s.lng || this.language);
411
+ const oe = (S, k, M) => {
412
+ const le = E && M !== d ? M : P;
413
+ this.options.missingKeyHandler ? this.options.missingKeyHandler(S, u, k, le, $, s) : this.backendConnector?.saveMissing && this.backendConnector.saveMissing(S, u, k, le, $, s), this.emit("missingKey", S, u, k, d);
414
+ };
415
+ this.options.saveMissing && (this.options.saveMissingPlurals && v ? V.forEach((S) => {
416
+ const k = this.pluralResolver.getSuffixes(S, s);
417
+ re && s[`defaultValue${this.options.pluralSeparator}zero`] && k.indexOf(`${this.options.pluralSeparator}zero`) < 0 && k.push(`${this.options.pluralSeparator}zero`), k.forEach((M) => {
418
+ oe([S], o + M, s[`defaultValue${M}`] || N);
419
+ });
420
+ }) : oe(V, o, N));
421
+ }
422
+ d = this.extendTranslation(d, e, s, h, i), O && d === o && this.options.appendNamespaceToMissingKey && (d = `${u}${f}${o}`), (O || C) && this.options.parseMissingKeyHandler && (d = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${u}${f}${o}` : o, C ? d : void 0, s));
423
+ }
424
+ return n ? (h.res = d, h.usedParams = this.getUsedParamsDetails(s), h) : d;
425
+ }
426
+ extendTranslation(e, t, i, s, n) {
427
+ if (this.i18nFormat?.parse)
428
+ e = this.i18nFormat.parse(e, {
429
+ ...this.options.interpolation.defaultVariables,
430
+ ...i
431
+ }, i.lng || this.language || s.usedLng, s.usedNS, s.usedKey, {
432
+ resolved: s
433
+ });
434
+ else if (!i.skipInterpolation) {
435
+ i.interpolation && this.interpolator.init({
436
+ ...i,
437
+ interpolation: {
438
+ ...this.options.interpolation,
439
+ ...i.interpolation
440
+ }
441
+ });
442
+ const l = p(e) && (i?.interpolation?.skipOnVariables !== void 0 ? i.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);
443
+ let u;
444
+ if (l) {
445
+ const c = e.match(this.interpolator.nestingRegexp);
446
+ u = c && c.length;
447
+ }
448
+ let f = i.replace && !p(i.replace) ? i.replace : i;
449
+ if (this.options.interpolation.defaultVariables && (f = {
450
+ ...this.options.interpolation.defaultVariables,
451
+ ...f
452
+ }), e = this.interpolator.interpolate(e, f, i.lng || this.language || s.usedLng, i), l) {
453
+ const c = e.match(this.interpolator.nestingRegexp), g = c && c.length;
454
+ u < g && (i.nest = !1);
455
+ }
456
+ !i.lng && s && s.res && (i.lng = this.language || s.usedLng), i.nest !== !1 && (e = this.interpolator.nest(e, (...c) => n?.[0] === c[0] && !i.context ? (this.logger.warn(`It seems you are nesting recursively key: ${c[0]} in key: ${t[0]}`), null) : this.translate(...c, t), i)), i.interpolation && this.interpolator.reset();
457
+ }
458
+ const a = i.postProcess || this.options.postProcess, o = p(a) ? [a] : a;
459
+ return e != null && o?.length && i.applyPostProcessor !== !1 && (e = $e.handle(o, e, t, this.options && this.options.postProcessPassResolved ? {
460
+ i18nResolved: {
461
+ ...s,
462
+ usedParams: this.getUsedParamsDetails(i)
463
+ },
464
+ ...i
465
+ } : i, this)), e;
466
+ }
467
+ resolve(e, t = {}) {
468
+ let i, s, n, a, o;
469
+ return p(e) && (e = [e]), e.forEach((l) => {
470
+ if (this.isValidLookup(i)) return;
471
+ const u = this.extractFromKey(l, t), f = u.key;
472
+ s = f;
473
+ let c = u.namespaces;
474
+ this.options.fallbackNS && (c = c.concat(this.options.fallbackNS));
475
+ const g = t.count !== void 0 && !p(t.count), h = g && !t.ordinal && t.count === 0, d = t.context !== void 0 && (p(t.context) || typeof t.context == "number") && t.context !== "", m = t.lngs ? t.lngs : this.languageUtils.toResolveHierarchy(t.lng || this.language, t.fallbackLng);
476
+ c.forEach((b) => {
477
+ this.isValidLookup(i) || (o = b, !pe[`${m[0]}-${b}`] && this.utils?.hasLoadedNamespace && !this.utils?.hasLoadedNamespace(o) && (pe[`${m[0]}-${b}`] = !0, this.logger.warn(`key "${s}" for languages "${m.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!!!")), m.forEach((L) => {
478
+ if (this.isValidLookup(i)) return;
479
+ a = L;
480
+ const y = [f];
481
+ if (this.i18nFormat?.addLookupKeys)
482
+ this.i18nFormat.addLookupKeys(y, f, L, b, t);
483
+ else {
484
+ let v;
485
+ g && (v = this.pluralResolver.getSuffix(L, t.count, t));
486
+ const E = `${this.options.pluralSeparator}zero`, I = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
487
+ if (g && (t.ordinal && v.indexOf(I) === 0 && y.push(f + v.replace(I, this.options.pluralSeparator)), y.push(f + v), h && y.push(f + E)), d) {
488
+ const j = `${f}${this.options.contextSeparator || "_"}${t.context}`;
489
+ y.push(j), g && (t.ordinal && v.indexOf(I) === 0 && y.push(j + v.replace(I, this.options.pluralSeparator)), y.push(j + v), h && y.push(j + E));
490
+ }
491
+ }
492
+ let F;
493
+ for (; F = y.pop(); )
494
+ this.isValidLookup(i) || (n = F, i = this.getResource(L, b, F, t));
495
+ }));
496
+ });
497
+ }), {
498
+ res: i,
499
+ usedKey: s,
500
+ exactUsedKey: n,
501
+ usedLng: a,
502
+ usedNS: o
503
+ };
504
+ }
505
+ isValidLookup(e) {
506
+ return e !== void 0 && !(!this.options.returnNull && e === null) && !(!this.options.returnEmptyString && e === "");
507
+ }
508
+ getResource(e, t, i, s = {}) {
509
+ return this.i18nFormat?.getResource ? this.i18nFormat.getResource(e, t, i, s) : this.resourceStore.getResource(e, t, i, s);
510
+ }
511
+ getUsedParamsDetails(e = {}) {
512
+ const t = ["defaultValue", "ordinal", "context", "replace", "lng", "lngs", "fallbackLng", "ns", "keySeparator", "nsSeparator", "returnObjects", "returnDetails", "joinArrays", "postProcess", "interpolation"], i = e.replace && !p(e.replace);
513
+ let s = i ? e.replace : e;
514
+ if (i && typeof e.count < "u" && (s.count = e.count), this.options.interpolation.defaultVariables && (s = {
515
+ ...this.options.interpolation.defaultVariables,
516
+ ...s
517
+ }), !i) {
518
+ s = {
519
+ ...s
520
+ };
521
+ for (const n of t)
522
+ delete s[n];
523
+ }
524
+ return s;
525
+ }
526
+ static hasDefaultValue(e) {
527
+ const t = "defaultValue";
528
+ for (const i in e)
529
+ if (Object.prototype.hasOwnProperty.call(e, i) && t === i.substring(0, t.length) && e[i] !== void 0)
530
+ return !0;
531
+ return !1;
532
+ }
533
+ }
534
+ class ge {
535
+ constructor(e) {
536
+ this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = R.create("languageUtils");
537
+ }
538
+ getScriptPartFromCode(e) {
539
+ if (e = H(e), !e || e.indexOf("-") < 0) return null;
540
+ const t = e.split("-");
541
+ return t.length === 2 || (t.pop(), t[t.length - 1].toLowerCase() === "x") ? null : this.formatLanguageCode(t.join("-"));
542
+ }
543
+ getLanguagePartFromCode(e) {
544
+ if (e = H(e), !e || e.indexOf("-") < 0) return e;
545
+ const t = e.split("-");
546
+ return this.formatLanguageCode(t[0]);
547
+ }
548
+ formatLanguageCode(e) {
549
+ if (p(e) && e.indexOf("-") > -1) {
550
+ let t;
551
+ try {
552
+ t = Intl.getCanonicalLocales(e)[0];
553
+ } catch {
554
+ }
555
+ return t && this.options.lowerCaseLng && (t = t.toLowerCase()), t || (this.options.lowerCaseLng ? e.toLowerCase() : e);
556
+ }
557
+ return this.options.cleanCode || this.options.lowerCaseLng ? e.toLowerCase() : e;
558
+ }
559
+ isSupportedCode(e) {
560
+ return (this.options.load === "languageOnly" || this.options.nonExplicitSupportedLngs) && (e = this.getLanguagePartFromCode(e)), !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(e) > -1;
561
+ }
562
+ getBestMatchFromCodes(e) {
563
+ if (!e) return null;
564
+ let t;
565
+ return e.forEach((i) => {
566
+ if (t) return;
567
+ const s = this.formatLanguageCode(i);
568
+ (!this.options.supportedLngs || this.isSupportedCode(s)) && (t = s);
569
+ }), !t && this.options.supportedLngs && e.forEach((i) => {
570
+ if (t) return;
571
+ const s = this.getScriptPartFromCode(i);
572
+ if (this.isSupportedCode(s)) return t = s;
573
+ const n = this.getLanguagePartFromCode(i);
574
+ if (this.isSupportedCode(n)) return t = n;
575
+ t = this.options.supportedLngs.find((a) => {
576
+ if (a === n) return a;
577
+ if (!(a.indexOf("-") < 0 && n.indexOf("-") < 0) && (a.indexOf("-") > 0 && n.indexOf("-") < 0 && a.substring(0, a.indexOf("-")) === n || a.indexOf(n) === 0 && n.length > 1))
578
+ return a;
579
+ });
580
+ }), t || (t = this.getFallbackCodes(this.options.fallbackLng)[0]), t;
581
+ }
582
+ getFallbackCodes(e, t) {
583
+ if (!e) return [];
584
+ if (typeof e == "function" && (e = e(t)), p(e) && (e = [e]), Array.isArray(e)) return e;
585
+ if (!t) return e.default || [];
586
+ let i = e[t];
587
+ return i || (i = e[this.getScriptPartFromCode(t)]), i || (i = e[this.formatLanguageCode(t)]), i || (i = e[this.getLanguagePartFromCode(t)]), i || (i = e.default), i || [];
588
+ }
589
+ toResolveHierarchy(e, t) {
590
+ const i = this.getFallbackCodes((t === !1 ? [] : t) || this.options.fallbackLng || [], e), s = [], n = (a) => {
591
+ a && (this.isSupportedCode(a) ? s.push(a) : this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`));
592
+ };
593
+ return p(e) && (e.indexOf("-") > -1 || e.indexOf("_") > -1) ? (this.options.load !== "languageOnly" && n(this.formatLanguageCode(e)), this.options.load !== "languageOnly" && this.options.load !== "currentOnly" && n(this.getScriptPartFromCode(e)), this.options.load !== "currentOnly" && n(this.getLanguagePartFromCode(e))) : p(e) && n(this.formatLanguageCode(e)), i.forEach((a) => {
594
+ s.indexOf(a) < 0 && n(this.formatLanguageCode(a));
595
+ }), s;
596
+ }
597
+ }
598
+ const me = {
599
+ zero: 0,
600
+ one: 1,
601
+ two: 2,
602
+ few: 3,
603
+ many: 4,
604
+ other: 5
605
+ }, ye = {
606
+ select: (r) => r === 1 ? "one" : "other",
607
+ resolvedOptions: () => ({
608
+ pluralCategories: ["one", "other"]
609
+ })
610
+ };
611
+ class Ye {
612
+ constructor(e, t = {}) {
613
+ this.languageUtils = e, this.options = t, this.logger = R.create("pluralResolver"), this.pluralRulesCache = {};
614
+ }
615
+ addRule(e, t) {
616
+ this.rules[e] = t;
617
+ }
618
+ clearCache() {
619
+ this.pluralRulesCache = {};
620
+ }
621
+ getRule(e, t = {}) {
622
+ const i = H(e === "dev" ? "en" : e), s = t.ordinal ? "ordinal" : "cardinal", n = JSON.stringify({
623
+ cleanedCode: i,
624
+ type: s
625
+ });
626
+ if (n in this.pluralRulesCache)
627
+ return this.pluralRulesCache[n];
628
+ let a;
629
+ try {
630
+ a = new Intl.PluralRules(i, {
631
+ type: s
632
+ });
633
+ } catch {
634
+ if (!Intl)
635
+ return this.logger.error("No Intl support, please use an Intl polyfill!"), ye;
636
+ if (!e.match(/-|_/)) return ye;
637
+ const l = this.languageUtils.getLanguagePartFromCode(e);
638
+ a = this.getRule(l, t);
639
+ }
640
+ return this.pluralRulesCache[n] = a, a;
641
+ }
642
+ needsPlural(e, t = {}) {
643
+ let i = this.getRule(e, t);
644
+ return i || (i = this.getRule("dev", t)), i?.resolvedOptions().pluralCategories.length > 1;
645
+ }
646
+ getPluralFormsOfKey(e, t, i = {}) {
647
+ return this.getSuffixes(e, i).map((s) => `${t}${s}`);
648
+ }
649
+ getSuffixes(e, t = {}) {
650
+ let i = this.getRule(e, t);
651
+ return i || (i = this.getRule("dev", t)), i ? i.resolvedOptions().pluralCategories.sort((s, n) => me[s] - me[n]).map((s) => `${this.options.prepend}${t.ordinal ? `ordinal${this.options.prepend}` : ""}${s}`) : [];
652
+ }
653
+ getSuffix(e, t, i = {}) {
654
+ const s = this.getRule(e, i);
655
+ return s ? `${this.options.prepend}${i.ordinal ? `ordinal${this.options.prepend}` : ""}${s.select(t)}` : (this.logger.warn(`no plural rule found for: ${e}`), this.getSuffix("dev", t, i));
656
+ }
657
+ }
658
+ const xe = (r, e, t, i = ".", s = !0) => {
659
+ let n = He(r, e, t);
660
+ return !n && s && p(t) && (n = te(r, t, i), n === void 0 && (n = te(e, t, i))), n;
661
+ }, _ = (r) => r.replace(/\$/g, "$$$$");
662
+ class be {
663
+ constructor(e = {}) {
664
+ this.logger = R.create("interpolator"), this.options = e, this.format = e?.interpolation?.format || ((t) => t), this.init(e);
665
+ }
666
+ init(e = {}) {
667
+ e.interpolation || (e.interpolation = {
668
+ escapeValue: !0
669
+ });
670
+ const {
671
+ escape: t,
672
+ escapeValue: i,
673
+ useRawValueToEscape: s,
674
+ prefix: n,
675
+ prefixEscaped: a,
676
+ suffix: o,
677
+ suffixEscaped: l,
678
+ formatSeparator: u,
679
+ unescapeSuffix: f,
680
+ unescapePrefix: c,
681
+ nestingPrefix: g,
682
+ nestingPrefixEscaped: h,
683
+ nestingSuffix: d,
684
+ nestingSuffixEscaped: m,
685
+ nestingOptionsSeparator: b,
686
+ maxReplaces: L,
687
+ alwaysFormat: y
688
+ } = e.interpolation;
689
+ this.escape = t !== void 0 ? t : ze, this.escapeValue = i !== void 0 ? i : !0, this.useRawValueToEscape = s !== void 0 ? s : !1, this.prefix = n ? T(n) : a || "{{", this.suffix = o ? T(o) : l || "}}", this.formatSeparator = u || ",", this.unescapePrefix = f ? "" : c || "-", this.unescapeSuffix = this.unescapePrefix ? "" : f || "", this.nestingPrefix = g ? T(g) : h || T("$t("), this.nestingSuffix = d ? T(d) : m || T(")"), this.nestingOptionsSeparator = b || ",", this.maxReplaces = L || 1e3, this.alwaysFormat = y !== void 0 ? y : !1, this.resetRegExp();
690
+ }
691
+ reset() {
692
+ this.options && this.init(this.options);
693
+ }
694
+ resetRegExp() {
695
+ const e = (t, i) => t?.source === i ? (t.lastIndex = 0, t) : new RegExp(i, "g");
696
+ 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}`);
697
+ }
698
+ interpolate(e, t, i, s) {
699
+ let n, a, o;
700
+ const l = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, u = (h) => {
701
+ if (h.indexOf(this.formatSeparator) < 0) {
702
+ const L = xe(t, l, h, this.options.keySeparator, this.options.ignoreJSONStructure);
703
+ return this.alwaysFormat ? this.format(L, void 0, i, {
704
+ ...s,
705
+ ...t,
706
+ interpolationkey: h
707
+ }) : L;
708
+ }
709
+ const d = h.split(this.formatSeparator), m = d.shift().trim(), b = d.join(this.formatSeparator).trim();
710
+ return this.format(xe(t, l, m, this.options.keySeparator, this.options.ignoreJSONStructure), b, i, {
711
+ ...s,
712
+ ...t,
713
+ interpolationkey: m
714
+ });
715
+ };
716
+ this.resetRegExp();
717
+ const f = s?.missingInterpolationHandler || this.options.missingInterpolationHandler, c = s?.interpolation?.skipOnVariables !== void 0 ? s.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables;
718
+ return [{
719
+ regex: this.regexpUnescape,
720
+ safeValue: (h) => _(h)
721
+ }, {
722
+ regex: this.regexp,
723
+ safeValue: (h) => this.escapeValue ? _(this.escape(h)) : _(h)
724
+ }].forEach((h) => {
725
+ for (o = 0; n = h.regex.exec(e); ) {
726
+ const d = n[1].trim();
727
+ if (a = u(d), a === void 0)
728
+ if (typeof f == "function") {
729
+ const b = f(e, n, s);
730
+ a = p(b) ? b : "";
731
+ } else if (s && Object.prototype.hasOwnProperty.call(s, d))
732
+ a = "";
733
+ else if (c) {
734
+ a = n[0];
735
+ continue;
736
+ } else
737
+ this.logger.warn(`missed to pass in variable ${d} for interpolating ${e}`), a = "";
738
+ else !p(a) && !this.useRawValueToEscape && (a = ue(a));
739
+ const m = h.safeValue(a);
740
+ if (e = e.replace(n[0], m), c ? (h.regex.lastIndex += a.length, h.regex.lastIndex -= n[0].length) : h.regex.lastIndex = 0, o++, o >= this.maxReplaces)
741
+ break;
742
+ }
743
+ }), e;
744
+ }
745
+ nest(e, t, i = {}) {
746
+ let s, n, a;
747
+ const o = (l, u) => {
748
+ const f = this.nestingOptionsSeparator;
749
+ if (l.indexOf(f) < 0) return l;
750
+ const c = l.split(new RegExp(`${f}[ ]*{`));
751
+ let g = `{${c[1]}`;
752
+ l = c[0], g = this.interpolate(g, a);
753
+ const h = g.match(/'/g), d = g.match(/"/g);
754
+ ((h?.length ?? 0) % 2 === 0 && !d || d.length % 2 !== 0) && (g = g.replace(/'/g, '"'));
755
+ try {
756
+ a = JSON.parse(g), u && (a = {
757
+ ...u,
758
+ ...a
759
+ });
760
+ } catch (m) {
761
+ return this.logger.warn(`failed parsing options string in nesting for key ${l}`, m), `${l}${f}${g}`;
762
+ }
763
+ return a.defaultValue && a.defaultValue.indexOf(this.prefix) > -1 && delete a.defaultValue, l;
764
+ };
765
+ for (; s = this.nestingRegexp.exec(e); ) {
766
+ let l = [];
767
+ a = {
768
+ ...i
769
+ }, a = a.replace && !p(a.replace) ? a.replace : a, a.applyPostProcessor = !1, delete a.defaultValue;
770
+ const u = /{.*}/.test(s[1]) ? s[1].lastIndexOf("}") + 1 : s[1].indexOf(this.formatSeparator);
771
+ if (u !== -1 && (l = s[1].slice(u).split(this.formatSeparator).map((f) => f.trim()).filter(Boolean), s[1] = s[1].slice(0, u)), n = t(o.call(this, s[1].trim(), a), a), n && s[0] === e && !p(n)) return n;
772
+ p(n) || (n = ue(n)), n || (this.logger.warn(`missed to resolve ${s[1]} for nesting ${e}`), n = ""), l.length && (n = l.reduce((f, c) => this.format(f, c, i.lng, {
773
+ ...i,
774
+ interpolationkey: s[1].trim()
775
+ }), n.trim())), e = e.replace(s[0], n), this.regexp.lastIndex = 0;
776
+ }
777
+ return e;
778
+ }
779
+ }
780
+ const _e = (r) => {
781
+ let e = r.toLowerCase().trim();
782
+ const t = {};
783
+ if (r.indexOf("(") > -1) {
784
+ const i = r.split("(");
785
+ e = i[0].toLowerCase().trim();
786
+ const s = i[1].substring(0, i[1].length - 1);
787
+ e === "currency" && s.indexOf(":") < 0 ? t.currency || (t.currency = s.trim()) : e === "relativetime" && s.indexOf(":") < 0 ? t.range || (t.range = s.trim()) : s.split(";").forEach((a) => {
788
+ if (a) {
789
+ const [o, ...l] = a.split(":"), u = l.join(":").trim().replace(/^'+|'+$/g, ""), f = o.trim();
790
+ t[f] || (t[f] = u), u === "false" && (t[f] = !1), u === "true" && (t[f] = !0), isNaN(u) || (t[f] = parseInt(u, 10));
791
+ }
792
+ });
793
+ }
794
+ return {
795
+ formatName: e,
796
+ formatOptions: t
797
+ };
798
+ }, Se = (r) => {
799
+ const e = {};
800
+ return (t, i, s) => {
801
+ let n = s;
802
+ s && s.interpolationkey && s.formatParams && s.formatParams[s.interpolationkey] && s[s.interpolationkey] && (n = {
803
+ ...n,
804
+ [s.interpolationkey]: void 0
805
+ });
806
+ const a = i + JSON.stringify(n);
807
+ let o = e[a];
808
+ return o || (o = r(H(i), s), e[a] = o), o(t);
809
+ };
810
+ }, Xe = (r) => (e, t, i) => r(H(t), i)(e);
811
+ class et {
812
+ constructor(e = {}) {
813
+ this.logger = R.create("formatter"), this.options = e, this.init(e);
814
+ }
815
+ init(e, t = {
816
+ interpolation: {}
817
+ }) {
818
+ this.formatSeparator = t.interpolation.formatSeparator || ",";
819
+ const i = t.cacheInBuiltFormats ? Se : Xe;
820
+ this.formats = {
821
+ number: i((s, n) => {
822
+ const a = new Intl.NumberFormat(s, {
823
+ ...n
824
+ });
825
+ return (o) => a.format(o);
826
+ }),
827
+ currency: i((s, n) => {
828
+ const a = new Intl.NumberFormat(s, {
829
+ ...n,
830
+ style: "currency"
831
+ });
832
+ return (o) => a.format(o);
833
+ }),
834
+ datetime: i((s, n) => {
835
+ const a = new Intl.DateTimeFormat(s, {
836
+ ...n
837
+ });
838
+ return (o) => a.format(o);
839
+ }),
840
+ relativetime: i((s, n) => {
841
+ const a = new Intl.RelativeTimeFormat(s, {
842
+ ...n
843
+ });
844
+ return (o) => a.format(o, n.range || "day");
845
+ }),
846
+ list: i((s, n) => {
847
+ const a = new Intl.ListFormat(s, {
848
+ ...n
849
+ });
850
+ return (o) => a.format(o);
851
+ })
852
+ };
853
+ }
854
+ add(e, t) {
855
+ this.formats[e.toLowerCase().trim()] = t;
856
+ }
857
+ addCached(e, t) {
858
+ this.formats[e.toLowerCase().trim()] = Se(t);
859
+ }
860
+ format(e, t, i, s = {}) {
861
+ const n = t.split(this.formatSeparator);
862
+ if (n.length > 1 && n[0].indexOf("(") > 1 && n[0].indexOf(")") < 0 && n.find((o) => o.indexOf(")") > -1)) {
863
+ const o = n.findIndex((l) => l.indexOf(")") > -1);
864
+ n[0] = [n[0], ...n.splice(1, o)].join(this.formatSeparator);
865
+ }
866
+ return n.reduce((o, l) => {
867
+ const {
868
+ formatName: u,
869
+ formatOptions: f
870
+ } = _e(l);
871
+ if (this.formats[u]) {
872
+ let c = o;
873
+ try {
874
+ const g = s?.formatParams?.[s.interpolationkey] || {}, h = g.locale || g.lng || s.locale || s.lng || i;
875
+ c = this.formats[u](o, h, {
876
+ ...f,
877
+ ...s,
878
+ ...g
879
+ });
880
+ } catch (g) {
881
+ this.logger.warn(g);
882
+ }
883
+ return c;
884
+ } else
885
+ this.logger.warn(`there was no format function for ${u}`);
886
+ return o;
887
+ }, e);
888
+ }
889
+ }
890
+ const tt = (r, e) => {
891
+ r.pending[e] !== void 0 && (delete r.pending[e], r.pendingCount--);
892
+ };
893
+ class st extends q {
894
+ constructor(e, t, i, s = {}) {
895
+ super(), this.backend = e, this.store = t, this.services = i, this.languageUtils = i.languageUtils, this.options = s, this.logger = R.create("backendConnector"), this.waitingReads = [], this.maxParallelReads = s.maxParallelReads || 10, this.readingCalls = 0, this.maxRetries = s.maxRetries >= 0 ? s.maxRetries : 5, this.retryTimeout = s.retryTimeout >= 1 ? s.retryTimeout : 350, this.state = {}, this.queue = [], this.backend?.init?.(i, s.backend, s);
896
+ }
897
+ queueLoad(e, t, i, s) {
898
+ const n = {}, a = {}, o = {}, l = {};
899
+ return e.forEach((u) => {
900
+ let f = !0;
901
+ t.forEach((c) => {
902
+ const g = `${u}|${c}`;
903
+ !i.reload && this.store.hasResourceBundle(u, c) ? this.state[g] = 2 : this.state[g] < 0 || (this.state[g] === 1 ? a[g] === void 0 && (a[g] = !0) : (this.state[g] = 1, f = !1, a[g] === void 0 && (a[g] = !0), n[g] === void 0 && (n[g] = !0), l[c] === void 0 && (l[c] = !0)));
904
+ }), f || (o[u] = !0);
905
+ }), (Object.keys(n).length || Object.keys(a).length) && this.queue.push({
906
+ pending: a,
907
+ pendingCount: Object.keys(a).length,
908
+ loaded: {},
909
+ errors: [],
910
+ callback: s
911
+ }), {
912
+ toLoad: Object.keys(n),
913
+ pending: Object.keys(a),
914
+ toLoadLanguages: Object.keys(o),
915
+ toLoadNamespaces: Object.keys(l)
916
+ };
917
+ }
918
+ loaded(e, t, i) {
919
+ const s = e.split("|"), n = s[0], a = s[1];
920
+ t && this.emit("failedLoading", n, a, t), !t && i && this.store.addResourceBundle(n, a, i, void 0, void 0, {
921
+ skipCopy: !0
922
+ }), this.state[e] = t ? -1 : 2, t && i && (this.state[e] = 0);
923
+ const o = {};
924
+ this.queue.forEach((l) => {
925
+ Ue(l.loaded, [n], a), tt(l, e), t && l.errors.push(t), l.pendingCount === 0 && !l.done && (Object.keys(l.loaded).forEach((u) => {
926
+ o[u] || (o[u] = {});
927
+ const f = l.loaded[u];
928
+ f.length && f.forEach((c) => {
929
+ o[u][c] === void 0 && (o[u][c] = !0);
930
+ });
931
+ }), l.done = !0, l.errors.length ? l.callback(l.errors) : l.callback());
932
+ }), this.emit("loaded", o), this.queue = this.queue.filter((l) => !l.done);
933
+ }
934
+ read(e, t, i, s = 0, n = this.retryTimeout, a) {
935
+ if (!e.length) return a(null, {});
936
+ if (this.readingCalls >= this.maxParallelReads) {
937
+ this.waitingReads.push({
938
+ lng: e,
939
+ ns: t,
940
+ fcName: i,
941
+ tried: s,
942
+ wait: n,
943
+ callback: a
944
+ });
945
+ return;
946
+ }
947
+ this.readingCalls++;
948
+ const o = (u, f) => {
949
+ if (this.readingCalls--, this.waitingReads.length > 0) {
950
+ const c = this.waitingReads.shift();
951
+ this.read(c.lng, c.ns, c.fcName, c.tried, c.wait, c.callback);
952
+ }
953
+ if (u && f && s < this.maxRetries) {
954
+ setTimeout(() => {
955
+ this.read.call(this, e, t, i, s + 1, n * 2, a);
956
+ }, n);
957
+ return;
958
+ }
959
+ a(u, f);
960
+ }, l = this.backend[i].bind(this.backend);
961
+ if (l.length === 2) {
962
+ try {
963
+ const u = l(e, t);
964
+ u && typeof u.then == "function" ? u.then((f) => o(null, f)).catch(o) : o(null, u);
965
+ } catch (u) {
966
+ o(u);
967
+ }
968
+ return;
969
+ }
970
+ return l(e, t, o);
971
+ }
972
+ prepareLoading(e, t, i = {}, s) {
973
+ if (!this.backend)
974
+ return this.logger.warn("No backend was added via i18next.use. Will not load resources."), s && s();
975
+ p(e) && (e = this.languageUtils.toResolveHierarchy(e)), p(t) && (t = [t]);
976
+ const n = this.queueLoad(e, t, i, s);
977
+ if (!n.toLoad.length)
978
+ return n.pending.length || s(), null;
979
+ n.toLoad.forEach((a) => {
980
+ this.loadOne(a);
981
+ });
982
+ }
983
+ load(e, t, i) {
984
+ this.prepareLoading(e, t, {}, i);
985
+ }
986
+ reload(e, t, i) {
987
+ this.prepareLoading(e, t, {
988
+ reload: !0
989
+ }, i);
990
+ }
991
+ loadOne(e, t = "") {
992
+ const i = e.split("|"), s = i[0], n = i[1];
993
+ this.read(s, n, "read", void 0, void 0, (a, o) => {
994
+ a && this.logger.warn(`${t}loading namespace ${n} for language ${s} failed`, a), !a && o && this.logger.log(`${t}loaded namespace ${n} for language ${s}`, o), this.loaded(e, a, o);
995
+ });
996
+ }
997
+ saveMissing(e, t, i, s, n, a = {}, o = () => {
998
+ }) {
999
+ if (this.services?.utils?.hasLoadedNamespace && !this.services?.utils?.hasLoadedNamespace(t)) {
1000
+ this.logger.warn(`did not save key "${i}" 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!!!");
1001
+ return;
1002
+ }
1003
+ if (!(i == null || i === "")) {
1004
+ if (this.backend?.create) {
1005
+ const l = {
1006
+ ...a,
1007
+ isUpdate: n
1008
+ }, u = this.backend.create.bind(this.backend);
1009
+ if (u.length < 6)
1010
+ try {
1011
+ let f;
1012
+ u.length === 5 ? f = u(e, t, i, s, l) : f = u(e, t, i, s), f && typeof f.then == "function" ? f.then((c) => o(null, c)).catch(o) : o(null, f);
1013
+ } catch (f) {
1014
+ o(f);
1015
+ }
1016
+ else
1017
+ u(e, t, i, s, o, l);
1018
+ }
1019
+ !e || !e[0] || this.store.addResource(e[0], t, i, s);
1020
+ }
1021
+ }
1022
+ }
1023
+ const ve = () => ({
1024
+ debug: !1,
1025
+ initAsync: !0,
1026
+ ns: ["translation"],
1027
+ defaultNS: ["translation"],
1028
+ fallbackLng: ["dev"],
1029
+ fallbackNS: !1,
1030
+ supportedLngs: !1,
1031
+ nonExplicitSupportedLngs: !1,
1032
+ load: "all",
1033
+ preload: !1,
1034
+ simplifyPluralSuffix: !0,
1035
+ keySeparator: ".",
1036
+ nsSeparator: ":",
1037
+ pluralSeparator: "_",
1038
+ contextSeparator: "_",
1039
+ partialBundledLanguages: !1,
1040
+ saveMissing: !1,
1041
+ updateMissing: !1,
1042
+ saveMissingTo: "fallback",
1043
+ saveMissingPlurals: !0,
1044
+ missingKeyHandler: !1,
1045
+ missingInterpolationHandler: !1,
1046
+ postProcess: !1,
1047
+ postProcessPassResolved: !1,
1048
+ returnNull: !1,
1049
+ returnEmptyString: !0,
1050
+ returnObjects: !1,
1051
+ joinArrays: !1,
1052
+ returnedObjectHandler: !1,
1053
+ parseMissingKeyHandler: !1,
1054
+ appendNamespaceToMissingKey: !1,
1055
+ appendNamespaceToCIMode: !1,
1056
+ overloadTranslationOptionHandler: (r) => {
1057
+ let e = {};
1058
+ if (typeof r[1] == "object" && (e = r[1]), p(r[1]) && (e.defaultValue = r[1]), p(r[2]) && (e.tDescription = r[2]), typeof r[2] == "object" || typeof r[3] == "object") {
1059
+ const t = r[3] || r[2];
1060
+ Object.keys(t).forEach((i) => {
1061
+ e[i] = t[i];
1062
+ });
1063
+ }
1064
+ return e;
1065
+ },
1066
+ interpolation: {
1067
+ escapeValue: !0,
1068
+ format: (r) => r,
1069
+ prefix: "{{",
1070
+ suffix: "}}",
1071
+ formatSeparator: ",",
1072
+ unescapePrefix: "-",
1073
+ nestingPrefix: "$t(",
1074
+ nestingSuffix: ")",
1075
+ nestingOptionsSeparator: ",",
1076
+ maxReplaces: 1e3,
1077
+ skipOnVariables: !0
1078
+ },
1079
+ cacheInBuiltFormats: !0
1080
+ }), Le = (r) => (p(r.ns) && (r.ns = [r.ns]), p(r.fallbackLng) && (r.fallbackLng = [r.fallbackLng]), p(r.fallbackNS) && (r.fallbackNS = [r.fallbackNS]), r.supportedLngs?.indexOf?.("cimode") < 0 && (r.supportedLngs = r.supportedLngs.concat(["cimode"])), typeof r.initImmediate == "boolean" && (r.initAsync = r.initImmediate), r), z = () => {
1081
+ }, it = (r) => {
1082
+ Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach((t) => {
1083
+ typeof r[t] == "function" && (r[t] = r[t].bind(r));
1084
+ });
1085
+ };
1086
+ class U extends q {
1087
+ constructor(e = {}, t) {
1088
+ if (super(), this.options = Le(e), this.services = {}, this.logger = R, this.modules = {
1089
+ external: []
1090
+ }, it(this), t && !this.isInitialized && !e.isClone) {
1091
+ if (!this.options.initAsync)
1092
+ return this.init(e, t), this;
1093
+ setTimeout(() => {
1094
+ this.init(e, t);
1095
+ }, 0);
1096
+ }
1097
+ }
1098
+ init(e = {}, t) {
1099
+ this.isInitializing = !0, typeof e == "function" && (t = e, e = {}), e.defaultNS == null && e.ns && (p(e.ns) ? e.defaultNS = e.ns : e.ns.indexOf("translation") < 0 && (e.defaultNS = e.ns[0]));
1100
+ const i = ve();
1101
+ this.options = {
1102
+ ...i,
1103
+ ...this.options,
1104
+ ...Le(e)
1105
+ }, this.options.interpolation = {
1106
+ ...i.interpolation,
1107
+ ...this.options.interpolation
1108
+ }, 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);
1109
+ const s = (u) => u ? typeof u == "function" ? new u() : u : null;
1110
+ if (!this.options.isClone) {
1111
+ this.modules.logger ? R.init(s(this.modules.logger), this.options) : R.init(null, this.options);
1112
+ let u;
1113
+ this.modules.formatter ? u = this.modules.formatter : u = et;
1114
+ const f = new ge(this.options);
1115
+ this.store = new de(this.options.resources, this.options);
1116
+ const c = this.services;
1117
+ c.logger = R, c.resourceStore = this.store, c.languageUtils = f, c.pluralResolver = new Ye(f, {
1118
+ prepend: this.options.pluralSeparator,
1119
+ simplifyPluralSuffix: this.options.simplifyPluralSuffix
1120
+ }), 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"), u && (!this.options.interpolation.format || this.options.interpolation.format === i.interpolation.format) && (c.formatter = s(u), c.formatter.init && c.formatter.init(c, this.options), this.options.interpolation.format = c.formatter.format.bind(c.formatter)), c.interpolator = new be(this.options), c.utils = {
1121
+ hasLoadedNamespace: this.hasLoadedNamespace.bind(this)
1122
+ }, c.backendConnector = new st(s(this.modules.backend), c.resourceStore, c, this.options), c.backendConnector.on("*", (h, ...d) => {
1123
+ this.emit(h, ...d);
1124
+ }), this.modules.languageDetector && (c.languageDetector = s(this.modules.languageDetector), c.languageDetector.init && c.languageDetector.init(c, this.options.detection, this.options)), this.modules.i18nFormat && (c.i18nFormat = s(this.modules.i18nFormat), c.i18nFormat.init && c.i18nFormat.init(this)), this.translator = new G(this.services, this.options), this.translator.on("*", (h, ...d) => {
1125
+ this.emit(h, ...d);
1126
+ }), this.modules.external.forEach((h) => {
1127
+ h.init && h.init(this);
1128
+ });
1129
+ }
1130
+ if (this.format = this.options.interpolation.format, t || (t = z), this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
1131
+ const u = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
1132
+ u.length > 0 && u[0] !== "dev" && (this.options.lng = u[0]);
1133
+ }
1134
+ !this.services.languageDetector && !this.options.lng && this.logger.warn("init: no languageDetector is used and no lng is defined"), ["getResource", "hasResourceBundle", "getResourceBundle", "getDataByLanguage"].forEach((u) => {
1135
+ this[u] = (...f) => this.store[u](...f);
1136
+ }), ["addResource", "addResources", "addResourceBundle", "removeResourceBundle"].forEach((u) => {
1137
+ this[u] = (...f) => (this.store[u](...f), this);
1138
+ });
1139
+ const o = A(), l = () => {
1140
+ const u = (f, c) => {
1141
+ 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(c), t(f, c);
1142
+ };
1143
+ if (this.languages && !this.isInitialized) return u(null, this.t.bind(this));
1144
+ this.changeLanguage(this.options.lng, u);
1145
+ };
1146
+ return this.options.resources || !this.options.initAsync ? l() : setTimeout(l, 0), o;
1147
+ }
1148
+ loadResources(e, t = z) {
1149
+ let i = t;
1150
+ const s = p(e) ? e : this.language;
1151
+ if (typeof e == "function" && (i = e), !this.options.resources || this.options.partialBundledLanguages) {
1152
+ if (s?.toLowerCase() === "cimode" && (!this.options.preload || this.options.preload.length === 0)) return i();
1153
+ const n = [], a = (o) => {
1154
+ if (!o || o === "cimode") return;
1155
+ this.services.languageUtils.toResolveHierarchy(o).forEach((u) => {
1156
+ u !== "cimode" && n.indexOf(u) < 0 && n.push(u);
1157
+ });
1158
+ };
1159
+ s ? a(s) : this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((l) => a(l)), this.options.preload?.forEach?.((o) => a(o)), this.services.backendConnector.load(n, this.options.ns, (o) => {
1160
+ !o && !this.resolvedLanguage && this.language && this.setResolvedLanguage(this.language), i(o);
1161
+ });
1162
+ } else
1163
+ i(null);
1164
+ }
1165
+ reloadResources(e, t, i) {
1166
+ const s = A();
1167
+ return typeof e == "function" && (i = e, e = void 0), typeof t == "function" && (i = t, t = void 0), e || (e = this.languages), t || (t = this.options.ns), i || (i = z), this.services.backendConnector.reload(e, t, (n) => {
1168
+ s.resolve(), i(n);
1169
+ }), s;
1170
+ }
1171
+ use(e) {
1172
+ if (!e) throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
1173
+ if (!e.type) throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");
1174
+ 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" && $e.addPostProcessor(e), e.type === "formatter" && (this.modules.formatter = e), e.type === "3rdParty" && this.modules.external.push(e), this;
1175
+ }
1176
+ setResolvedLanguage(e) {
1177
+ if (!(!e || !this.languages) && !(["cimode", "dev"].indexOf(e) > -1)) {
1178
+ for (let t = 0; t < this.languages.length; t++) {
1179
+ const i = this.languages[t];
1180
+ if (!(["cimode", "dev"].indexOf(i) > -1) && this.store.hasLanguageSomeTranslations(i)) {
1181
+ this.resolvedLanguage = i;
1182
+ break;
1183
+ }
1184
+ }
1185
+ !this.resolvedLanguage && this.languages.indexOf(e) < 0 && this.store.hasLanguageSomeTranslations(e) && (this.resolvedLanguage = e, this.languages.unshift(e));
1186
+ }
1187
+ }
1188
+ changeLanguage(e, t) {
1189
+ this.isLanguageChangingTo = e;
1190
+ const i = A();
1191
+ this.emit("languageChanging", e);
1192
+ const s = (o) => {
1193
+ this.language = o, this.languages = this.services.languageUtils.toResolveHierarchy(o), this.resolvedLanguage = void 0, this.setResolvedLanguage(o);
1194
+ }, n = (o, l) => {
1195
+ l ? this.isLanguageChangingTo === e && (s(l), this.translator.changeLanguage(l), this.isLanguageChangingTo = void 0, this.emit("languageChanged", l), this.logger.log("languageChanged", l)) : this.isLanguageChangingTo = void 0, i.resolve((...u) => this.t(...u)), t && t(o, (...u) => this.t(...u));
1196
+ }, a = (o) => {
1197
+ !e && !o && this.services.languageDetector && (o = []);
1198
+ const l = p(o) ? o : o && o[0], u = this.store.hasLanguageSomeTranslations(l) ? l : this.services.languageUtils.getBestMatchFromCodes(p(o) ? [o] : o);
1199
+ u && (this.language || s(u), this.translator.language || this.translator.changeLanguage(u), this.services.languageDetector?.cacheUserLanguage?.(u)), this.loadResources(u, (f) => {
1200
+ n(f, u);
1201
+ });
1202
+ };
1203
+ return !e && this.services.languageDetector && !this.services.languageDetector.async ? a(this.services.languageDetector.detect()) : !e && this.services.languageDetector && this.services.languageDetector.async ? this.services.languageDetector.detect.length === 0 ? this.services.languageDetector.detect().then(a) : this.services.languageDetector.detect(a) : a(e), i;
1204
+ }
1205
+ getFixedT(e, t, i) {
1206
+ const s = (n, a, ...o) => {
1207
+ let l;
1208
+ typeof a != "object" ? l = this.options.overloadTranslationOptionHandler([n, a].concat(o)) : l = {
1209
+ ...a
1210
+ }, l.lng = l.lng || s.lng, l.lngs = l.lngs || s.lngs, l.ns = l.ns || s.ns, l.keyPrefix !== "" && (l.keyPrefix = l.keyPrefix || i || s.keyPrefix);
1211
+ const u = this.options.keySeparator || ".";
1212
+ let f;
1213
+ return l.keyPrefix && Array.isArray(n) ? f = n.map((c) => (typeof c == "function" && (c = se(c, {
1214
+ ...this.options,
1215
+ ...a
1216
+ })), `${l.keyPrefix}${u}${c}`)) : (typeof n == "function" && (n = se(n, {
1217
+ ...this.options,
1218
+ ...a
1219
+ })), f = l.keyPrefix ? `${l.keyPrefix}${u}${n}` : n), this.t(f, l);
1220
+ };
1221
+ return p(e) ? s.lng = e : s.lngs = e, s.ns = t, s.keyPrefix = i, s;
1222
+ }
1223
+ t(...e) {
1224
+ return this.translator?.translate(...e);
1225
+ }
1226
+ exists(...e) {
1227
+ return this.translator?.exists(...e);
1228
+ }
1229
+ setDefaultNamespace(e) {
1230
+ this.options.defaultNS = e;
1231
+ }
1232
+ hasLoadedNamespace(e, t = {}) {
1233
+ if (!this.isInitialized)
1234
+ return this.logger.warn("hasLoadedNamespace: i18next was not initialized", this.languages), !1;
1235
+ if (!this.languages || !this.languages.length)
1236
+ return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty", this.languages), !1;
1237
+ const i = t.lng || this.resolvedLanguage || this.languages[0], s = this.options ? this.options.fallbackLng : !1, n = this.languages[this.languages.length - 1];
1238
+ if (i.toLowerCase() === "cimode") return !0;
1239
+ const a = (o, l) => {
1240
+ const u = this.services.backendConnector.state[`${o}|${l}`];
1241
+ return u === -1 || u === 0 || u === 2;
1242
+ };
1243
+ if (t.precheck) {
1244
+ const o = t.precheck(this, a);
1245
+ if (o !== void 0) return o;
1246
+ }
1247
+ return !!(this.hasResourceBundle(i, e) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || a(i, e) && (!s || a(n, e)));
1248
+ }
1249
+ loadNamespaces(e, t) {
1250
+ const i = A();
1251
+ return this.options.ns ? (p(e) && (e = [e]), e.forEach((s) => {
1252
+ this.options.ns.indexOf(s) < 0 && this.options.ns.push(s);
1253
+ }), this.loadResources((s) => {
1254
+ i.resolve(), t && t(s);
1255
+ }), i) : (t && t(), Promise.resolve());
1256
+ }
1257
+ loadLanguages(e, t) {
1258
+ const i = A();
1259
+ p(e) && (e = [e]);
1260
+ const s = this.options.preload || [], n = e.filter((a) => s.indexOf(a) < 0 && this.services.languageUtils.isSupportedCode(a));
1261
+ return n.length ? (this.options.preload = s.concat(n), this.loadResources((a) => {
1262
+ i.resolve(), t && t(a);
1263
+ }), i) : (t && t(), Promise.resolve());
1264
+ }
1265
+ dir(e) {
1266
+ if (e || (e = this.resolvedLanguage || (this.languages?.length > 0 ? this.languages[0] : this.language)), !e) return "rtl";
1267
+ try {
1268
+ const s = new Intl.Locale(e);
1269
+ if (s && s.getTextInfo) {
1270
+ const n = s.getTextInfo();
1271
+ if (n && n.direction) return n.direction;
1272
+ }
1273
+ } catch {
1274
+ }
1275
+ const t = ["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"], i = this.services?.languageUtils || new ge(ve());
1276
+ return e.toLowerCase().indexOf("-latn") > 1 ? "ltr" : t.indexOf(i.getLanguagePartFromCode(e)) > -1 || e.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
1277
+ }
1278
+ static createInstance(e = {}, t) {
1279
+ const i = new U(e, t);
1280
+ return i.createInstance = U.createInstance, i;
1281
+ }
1282
+ cloneInstance(e = {}, t = z) {
1283
+ const i = e.forkResourceStore;
1284
+ i && delete e.forkResourceStore;
1285
+ const s = {
1286
+ ...this.options,
1287
+ ...e,
1288
+ isClone: !0
1289
+ }, n = new U(s);
1290
+ if ((e.debug !== void 0 || e.prefix !== void 0) && (n.logger = n.logger.clone(e)), ["store", "services", "language"].forEach((o) => {
1291
+ n[o] = this[o];
1292
+ }), n.services = {
1293
+ ...this.services
1294
+ }, n.services.utils = {
1295
+ hasLoadedNamespace: n.hasLoadedNamespace.bind(n)
1296
+ }, i) {
1297
+ const o = Object.keys(this.store.data).reduce((l, u) => (l[u] = {
1298
+ ...this.store.data[u]
1299
+ }, l[u] = Object.keys(l[u]).reduce((f, c) => (f[c] = {
1300
+ ...l[u][c]
1301
+ }, f), l[u]), l), {});
1302
+ n.store = new de(o, s), n.services.resourceStore = n.store;
1303
+ }
1304
+ return e.interpolation && (n.services.interpolator = new be(s)), n.translator = new G(n.services, s), n.translator.on("*", (o, ...l) => {
1305
+ n.emit(o, ...l);
1306
+ }), n.init(s, t), n.translator.options = s, n.translator.backendConnector.services.utils = {
1307
+ hasLoadedNamespace: n.hasLoadedNamespace.bind(n)
1308
+ }, n;
1309
+ }
1310
+ toJSON() {
1311
+ return {
1312
+ options: this.options,
1313
+ store: this.store,
1314
+ language: this.language,
1315
+ languages: this.languages,
1316
+ resolvedLanguage: this.resolvedLanguage
1317
+ };
1318
+ }
1319
+ }
1320
+ const x = U.createInstance();
1321
+ x.createInstance;
1322
+ x.dir;
1323
+ x.init;
1324
+ x.loadResources;
1325
+ x.reloadResources;
1326
+ x.use;
1327
+ x.changeLanguage;
1328
+ x.getFixedT;
1329
+ x.t;
1330
+ x.exists;
1331
+ x.setDefaultNamespace;
1332
+ x.hasLoadedNamespace;
1333
+ x.loadNamespaces;
1334
+ x.loadLanguages;
1335
+ var nt = {
1336
+ hello: "欢迎使用",
1337
+ utils: {
1338
+ date: {
1339
+ noSupport: "@jnrs/shared/date-fns 不支持该语言. 请使用:"
1340
+ },
1341
+ fullscreen: {
1342
+ failedIn: "进入全屏失败:",
1343
+ failedOut: "退出全屏失败:"
1344
+ },
1345
+ validator: {
1346
+ isNum: "请输入数字!",
1347
+ isNumberGtZero: "数字必须大于0",
1348
+ isMobile: "请输入正确的手机号码",
1349
+ isPhone: "请输入正确的电话号码!",
1350
+ isEmail: "请输入有效的邮箱!",
1351
+ isURL: "请输入有效的URL!",
1352
+ isLowerCase: "请输入小写字母!",
1353
+ isUpperCase: "请输入大写字母!",
1354
+ isAlphabets: "请输入大小写字母!",
1355
+ isName: "请输入有效的姓名!",
1356
+ isFloat: "请输入浮点数!",
1357
+ isNull: "必须为空!",
1358
+ isCardId: "请输入合法的身份证号!",
1359
+ isIntEqZero: "请输入0!",
1360
+ isIntGtZero: "整数必须大于0!",
1361
+ isIntGteZero: "整数必须大于或等于0!",
1362
+ isIntNEqZero: "整数必须不等于0!",
1363
+ isIntLtZero: "整数必须小于0!",
1364
+ isIntLteZero: "整数必须小于或等于0!",
1365
+ isFloatEqZero: "浮点数必须为0!",
1366
+ isFloatGtZero: "浮点数必须大于0!",
1367
+ isFloatGteZero: "浮点数必须大于或等于0!",
1368
+ isFloatNEqZero: "浮点数必须不等于0!",
1369
+ isFloatLtZero: "浮点数必须小于0!",
1370
+ isFloatLteZero: "浮点数必须小于或等于0!",
1371
+ isInteger: "必须为整数!",
1372
+ isNumber: "请输入数字!",
1373
+ isDigits: "只能输入[0-9]数字!",
1374
+ isEnglish: "只能包含英文字符。",
1375
+ isTel: "请正确填写您的联系方式",
1376
+ isQq: "请正确填写您QQ号码",
1377
+ isZipCode: "请正确填写您的邮政编码",
1378
+ isPwd: "以字母开头,长度在6-12之间,只能包含字符、数字和下划线",
1379
+ isWeakPwd: "只能包含字母(大小写)、数字和特殊字符",
1380
+ isStrongPwd: "最小长度 12 位,且必须包含大小写字母、数字和特殊字符",
1381
+ ip: "请填写正确的IP地址。",
1382
+ stringCheck: "只能包含中文、英文、数字、下划线等字符",
1383
+ isChinese: "匹配汉字",
1384
+ isChineseChar: "匹配中文(包括汉字和字符)",
1385
+ isRightfulString: "判断是否为合法字符(a-zA-Z0-9-_ )",
1386
+ isPlateNo: "请输入合法车牌号"
1387
+ }
1388
+ }
1389
+ }, rt = {
1390
+ hello: "Welcome",
1391
+ utils: {
1392
+ date: {
1393
+ noSupport: "@jnrs/shared/date-fns does not support this language. Please use:"
1394
+ },
1395
+ fullscreen: {
1396
+ failedIn: "Failed to enter fullscreen:",
1397
+ failedOut: "Failed to exit fullscreen:"
1398
+ },
1399
+ validator: {
1400
+ isNum: "Please enter a number!",
1401
+ isNumberGtZero: "The number must be greater than 0",
1402
+ isMobile: "Please enter a valid mobile number",
1403
+ isPhone: "Please enter a valid phone number!",
1404
+ isEmail: "Please enter a valid email address!",
1405
+ isURL: "Please enter a valid URL!",
1406
+ isLowerCase: "Please enter lowercase letters only!",
1407
+ isUpperCase: "Please enter uppercase letters only!",
1408
+ isAlphabets: "Please enter letters (a–z, A–Z) only!",
1409
+ isName: "Please enter a valid name!",
1410
+ isFloat: "Please enter a floating-point number!",
1411
+ isNull: "Must be empty!",
1412
+ isCardId: "Please enter a valid ID card number!",
1413
+ isIntEqZero: "Value must be 0!",
1414
+ isIntGtZero: "Integer must be greater than 0!",
1415
+ isIntGteZero: "Integer must be greater than or equal to 0!",
1416
+ isIntNEqZero: "Integer must not be equal to 0!",
1417
+ isIntLtZero: "Integer must be less than 0!",
1418
+ isIntLteZero: "Integer must be less than or equal to 0!",
1419
+ isFloatEqZero: "Floating-point number must be 0!",
1420
+ isFloatGtZero: "Floating-point number must be greater than 0!",
1421
+ isFloatGteZero: "Floating-point number must be greater than or equal to 0!",
1422
+ isFloatNEqZero: "Floating-point number must not be equal to 0!",
1423
+ isFloatLtZero: "Floating-point number must be less than 0!",
1424
+ isFloatLteZero: "Floating-point number must be less than or equal to 0!",
1425
+ isInteger: "Must be an integer!",
1426
+ isNumber: "Please enter a number!",
1427
+ isDigits: "Only digits [0–9] are allowed!",
1428
+ isEnglish: "Only English characters are allowed.",
1429
+ isTel: "Please provide your correct contact information",
1430
+ isQq: "Please enter a valid QQ number",
1431
+ isZipCode: "Please enter a valid postal code",
1432
+ isPwd: "Must start with a letter, be 6–12 characters long, and contain only letters, digits, and underscores",
1433
+ isWeakPwd: "Can only contain letters (uppercase/lowercase), digits, and special characters",
1434
+ isStrongPwd: "Minimum 12 characters; must include uppercase letters, lowercase letters, digits, and special characters",
1435
+ ip: "Please enter a valid IP address.",
1436
+ stringCheck: "Only Chinese, English, digits, underscores, and similar characters are allowed",
1437
+ isChinese: "Must be Chinese characters",
1438
+ isChineseChar: "Must be Chinese (including characters and symbols)",
1439
+ isRightfulString: "Valid characters: a–z, A–Z, 0–9, hyphen (-), underscore (_), and space",
1440
+ isPlateNo: "Please enter a valid license plate number"
1441
+ }
1442
+ }
1443
+ };
1444
+ const ie = x.createInstance();
1445
+ ie.init({
1446
+ lng: "zhCn",
1447
+ fallbackLng: "en",
1448
+ resources: {
1449
+ zhCn: { translation: nt },
1450
+ en: { translation: rt }
1451
+ }
1452
+ });
1453
+ class at {
1454
+ // 默认全屏元素,可配置
1455
+ defaultElement;
1456
+ constructor(e) {
1457
+ this.defaultElement = e || document.documentElement;
1458
+ }
1459
+ /**
1460
+ * 进入全屏
1461
+ * @param element 可选,指定要全屏的元素
1462
+ */
1463
+ async request(e) {
1464
+ const t = e || this.defaultElement;
1465
+ try {
1466
+ await t.requestFullscreen({
1467
+ navigationUI: "hide"
1468
+ });
1469
+ } catch (i) {
1470
+ console.error(ie.t("utils.fullscreen.failedIn"), i);
1471
+ }
1472
+ }
1473
+ /**
1474
+ * 退出全屏
1475
+ */
1476
+ async exit() {
1477
+ if (document.fullscreenElement)
1478
+ try {
1479
+ await document.exitFullscreen();
1480
+ } catch (e) {
1481
+ console.error(ie.t("utils.fullscreen.failedOut"), e);
1482
+ }
1483
+ }
1484
+ /**
1485
+ * 切换全屏状态
1486
+ * @param element 可选,指定要切换全屏的元素
1487
+ */
1488
+ async toggle(e) {
1489
+ document.fullscreenElement ? await this.exit() : await this.request(e);
1490
+ }
1491
+ /**
1492
+ * 判断当前是否处于全屏状态
1493
+ * @returns boolean
1494
+ */
1495
+ isFullscreen() {
1496
+ return !!document.fullscreenElement;
1497
+ }
1498
+ /**
1499
+ * 设置默认全屏元素
1500
+ * @param element 新的默认元素
1501
+ */
1502
+ setDefaultElement(e) {
1503
+ this.defaultElement = e;
1504
+ }
1505
+ /**
1506
+ * 获取当前全屏的元素(如果存在)
1507
+ * @returns HTMLElement | null
1508
+ */
1509
+ getFullscreenElement() {
1510
+ return document.fullscreenElement;
1511
+ }
1512
+ }
1513
+ const X = /* @__PURE__ */ new WeakMap(), ot = /* @__NO_SIDE_EFFECTS__ */ (...r) => {
1514
+ var e;
1515
+ const t = r[0], i = (e = we()) === null || e === void 0 ? void 0 : e.proxy, s = i ?? Ie();
1516
+ if (s == null && !Ce()) throw new Error("injectLocal must be called in setup");
1517
+ return s && X.has(s) && t in X.get(s) ? X.get(s)[t] : je(...r);
1518
+ }, lt = typeof window < "u" && typeof document < "u";
1519
+ typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
1520
+ const ut = Object.prototype.toString, ct = (r) => ut.call(r) === "[object Object]";
1521
+ function Oe(r) {
1522
+ return r.endsWith("rem") ? Number.parseFloat(r) * 16 : Number.parseFloat(r);
1523
+ }
1524
+ function ee(r) {
1525
+ return Array.isArray(r) ? r : [r];
1526
+ }
1527
+ function ft(r, e, t) {
1528
+ return Pe(r, e, {
1529
+ ...t,
1530
+ immediate: !0
1531
+ });
1532
+ }
1533
+ const Ne = lt ? window : void 0;
1534
+ function ht(r) {
1535
+ var e;
1536
+ const t = D(r);
1537
+ return (e = t?.$el) !== null && e !== void 0 ? e : t;
1538
+ }
1539
+ function dt(...r) {
1540
+ const e = (i, s, n, a) => (i.addEventListener(s, n, a), () => i.removeEventListener(s, n, a)), t = ne(() => {
1541
+ const i = ee(D(r[0])).filter((s) => s != null);
1542
+ return i.every((s) => typeof s != "string") ? i : void 0;
1543
+ });
1544
+ return ft(() => {
1545
+ var i, s;
1546
+ return [
1547
+ (i = (s = t.value) === null || s === void 0 ? void 0 : s.map((n) => ht(n))) !== null && i !== void 0 ? i : [Ne].filter((n) => n != null),
1548
+ ee(D(t.value ? r[1] : r[0])),
1549
+ ee(Ve(t.value ? r[2] : r[1])),
1550
+ D(t.value ? r[3] : r[2])
1551
+ ];
1552
+ }, ([i, s, n, a], o, l) => {
1553
+ if (!i?.length || !s?.length || !n?.length) return;
1554
+ const u = ct(a) ? { ...a } : a, f = i.flatMap((c) => s.flatMap((g) => n.map((h) => e(c, g, h, u))));
1555
+ l(() => {
1556
+ f.forEach((c) => c());
1557
+ });
1558
+ }, { flush: "post" });
1559
+ }
1560
+ // @__NO_SIDE_EFFECTS__
1561
+ function pt() {
1562
+ const r = B(!1), e = we();
1563
+ return e && De(() => {
1564
+ r.value = !0;
1565
+ }, e), r;
1566
+ }
1567
+ // @__NO_SIDE_EFFECTS__
1568
+ function gt(r) {
1569
+ const e = /* @__PURE__ */ pt();
1570
+ return ne(() => (e.value, !!r()));
1571
+ }
1572
+ const mt = Symbol("vueuse-ssr-width");
1573
+ // @__NO_SIDE_EFFECTS__
1574
+ function yt() {
1575
+ const r = Ce() ? /* @__PURE__ */ ot(mt, null) : null;
1576
+ return typeof r == "number" ? r : void 0;
1577
+ }
1578
+ function xt(r, e = {}) {
1579
+ const { window: t = Ne, ssrWidth: i = /* @__PURE__ */ yt() } = e, s = /* @__PURE__ */ gt(() => t && "matchMedia" in t && typeof t.matchMedia == "function"), n = B(typeof i == "number"), a = B(), o = B(!1), l = (u) => {
1580
+ o.value = u.matches;
1581
+ };
1582
+ return Te(() => {
1583
+ if (n.value) {
1584
+ n.value = !s.value, o.value = D(r).split(",").some((u) => {
1585
+ const f = u.includes("not all"), c = u.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/), g = u.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);
1586
+ let h = !!(c || g);
1587
+ return c && h && (h = i >= Oe(c[1])), g && h && (h = i <= Oe(g[1])), f ? !h : h;
1588
+ });
1589
+ return;
1590
+ }
1591
+ s.value && (a.value = t.matchMedia(D(r)), o.value = a.value.matches);
1592
+ }), dt(a, "change", l, { passive: !0 }), ne(() => o.value);
1593
+ }
1594
+ // @__NO_SIDE_EFFECTS__
1595
+ function bt(r) {
1596
+ return xt("(prefers-color-scheme: dark)", r);
1597
+ }
1598
+ const Lt = Me(
1599
+ "@jnrs/vue-core/pinia:system",
1600
+ () => {
1601
+ const r = Q(!1), e = () => r.value = !r.value, t = new at(), i = Q(!1), s = async () => {
1602
+ await t.toggle(), i.value = t.isFullscreen();
1603
+ }, n = Q({
1604
+ locale: "zhCn",
1605
+ mode: "auto",
1606
+ customColor: "oklch(0.6 0.19 41)"
1607
+ }), a = /* @__PURE__ */ bt(), o = (f) => {
1608
+ const c = document.documentElement;
1609
+ c.classList.remove("light", "dark"), f === "auto" ? c.classList.add(a.value ? "dark" : "light") : c.classList.add(f);
1610
+ };
1611
+ Pe(a, (f) => {
1612
+ n.value.mode === "auto" && (document.documentElement.classList.remove("light", "dark"), document.documentElement.classList.add(f ? "dark" : "light"));
1613
+ });
1614
+ const l = (f, c) => {
1615
+ if (f in n.value)
1616
+ switch (n.value[f] = c, f) {
1617
+ case "mode":
1618
+ o(c);
1619
+ break;
1620
+ case "customColor":
1621
+ document.documentElement.style.setProperty("--jnrs-color-primary", c ?? "");
1622
+ break;
1623
+ }
1624
+ };
1625
+ return (() => {
1626
+ o(n.value.mode), n.value.customColor && document.documentElement.style.setProperty("--jnrs-color-primary", n.value.customColor);
1627
+ })(), {
1628
+ theme: n,
1629
+ menuCollapse: r,
1630
+ documentFullscreen: i,
1631
+ toggleCollapse: e,
1632
+ toggleFullScreen: s,
1633
+ setTheme: l
1634
+ };
1635
+ },
1636
+ {
1637
+ persist: {
1638
+ pick: ["theme", "menuCollapse"]
1639
+ }
1640
+ }
1641
+ );
1642
+ export {
1643
+ Lt as u
1644
+ };