gc_i18n 1.1.1 → 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.
- package/lang/index.js +38 -0
- package/lang/index.json +12 -0
- package/lib/gc_i18n.js +3893 -335
- package/lib/gc_i18n.umd.cjs +22 -1
- package/package.json +3 -1
- package/packages/index.js +33 -30
- package/src/main.js +3 -12
- package/src/router/index.js +3 -3
- package/src/view/Home.vue +6 -10
- package/src/view/test.vue +6 -0
- package/vite.config.js +9 -3
- package/src/view/BOATNOTICE.vue +0 -108
package/lib/gc_i18n.js
CHANGED
|
@@ -1,82 +1,3644 @@
|
|
|
1
1
|
import './gc_i18n.css';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { createVNode as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
2
|
+
import Rs from "keyboardjs";
|
|
3
|
+
import cn, { Message as se } from "view-ui-plus";
|
|
4
|
+
import { effectScope as Ms, ref as Fs, shallowRef as ws, computed as Ye, watch as Pt, isRef as Us, defineComponent as Bt, getCurrentInstance as Ke, h as Jn, Fragment as Qn, inject as Vs, onMounted as Ws, onUnmounted as xs, createVNode as te, Text as $s, createTextVNode as Rt, resolveComponent as le, createBlock as Ie, openBlock as de, withCtx as ve, createElementBlock as un, createCommentVNode as fn, createElementVNode as tt, toDisplayString as Gs, createApp as Ys } from "vue";
|
|
5
|
+
import x from "lodash-es";
|
|
6
|
+
import ke from "axios";
|
|
7
|
+
import ye from "store2";
|
|
8
|
+
import { jws as Hs } from "jsrsasign";
|
|
9
|
+
/*!
|
|
10
|
+
* shared v11.1.3
|
|
11
|
+
* (c) 2025 kazuya kawaguchi
|
|
12
|
+
* Released under the MIT License.
|
|
13
|
+
*/
|
|
14
|
+
const ce = typeof window < "u";
|
|
15
|
+
let ne, Se;
|
|
16
|
+
if (process.env.NODE_ENV !== "production") {
|
|
17
|
+
const e = ce && window.performance;
|
|
18
|
+
e && e.mark && e.measure && e.clearMarks && // @ts-ignore browser compat
|
|
19
|
+
e.clearMeasures && (ne = (t) => {
|
|
20
|
+
e.mark(t);
|
|
21
|
+
}, Se = (t, n, s) => {
|
|
22
|
+
e.measure(t, n, s), e.clearMarks(n), e.clearMarks(s);
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
const Ks = /\{([0-9a-zA-Z]+)\}/g;
|
|
26
|
+
function lt(e, ...t) {
|
|
27
|
+
return t.length === 1 && M(t[0]) && (t = t[0]), (!t || !t.hasOwnProperty) && (t = {}), e.replace(Ks, (n, s) => t.hasOwnProperty(s) ? t[s] : "");
|
|
28
|
+
}
|
|
29
|
+
const _e = (e, t = !1) => t ? Symbol.for(e) : Symbol(e), Bs = (e, t, n) => js({ l: e, k: t, s: n }), js = (e) => JSON.stringify(e).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029").replace(/\u0027/g, "\\u0027"), j = (e) => typeof e == "number" && isFinite(e), Xs = (e) => jt(e) === "[object Date]", we = (e) => jt(e) === "[object RegExp]", it = (e) => R(e) && Object.keys(e).length === 0, Q = Object.assign, Js = Object.create, W = (e = null) => Js(e);
|
|
30
|
+
let _n;
|
|
31
|
+
const Ae = () => _n || (_n = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : W());
|
|
32
|
+
function mn(e) {
|
|
33
|
+
return e.replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
34
|
+
}
|
|
35
|
+
const Qs = Object.prototype.hasOwnProperty;
|
|
36
|
+
function ie(e, t) {
|
|
37
|
+
return Qs.call(e, t);
|
|
38
|
+
}
|
|
39
|
+
const B = Array.isArray, $ = (e) => typeof e == "function", I = (e) => typeof e == "string", F = (e) => typeof e == "boolean", M = (e) => e !== null && typeof e == "object", qs = (e) => M(e) && $(e.then) && $(e.catch), qn = Object.prototype.toString, jt = (e) => qn.call(e), R = (e) => jt(e) === "[object Object]", Zs = (e) => e == null ? "" : B(e) || R(e) && e.toString === qn ? JSON.stringify(e, null, 2) : String(e);
|
|
40
|
+
function Xt(e, t = "") {
|
|
41
|
+
return e.reduce((n, s, a) => a === 0 ? n + s : n + t + s, "");
|
|
42
|
+
}
|
|
43
|
+
const dn = 2;
|
|
44
|
+
function zs(e, t = 0, n = e.length) {
|
|
45
|
+
const s = e.split(/\r?\n/);
|
|
46
|
+
let a = 0;
|
|
47
|
+
const r = [];
|
|
48
|
+
for (let o = 0; o < s.length; o++)
|
|
49
|
+
if (a += s[o].length + 1, a >= t) {
|
|
50
|
+
for (let l = o - dn; l <= o + dn || n > a; l++) {
|
|
51
|
+
if (l < 0 || l >= s.length)
|
|
52
|
+
continue;
|
|
53
|
+
const u = l + 1;
|
|
54
|
+
r.push(`${u}${" ".repeat(3 - String(u).length)}| ${s[l]}`);
|
|
55
|
+
const _ = s[l].length;
|
|
56
|
+
if (l === o) {
|
|
57
|
+
const N = t - (a - _) + 1, T = Math.max(1, n > a ? _ - N : n - t);
|
|
58
|
+
r.push(" | " + " ".repeat(N) + "^".repeat(T));
|
|
59
|
+
} else if (l > o) {
|
|
60
|
+
if (n > a) {
|
|
61
|
+
const N = Math.max(Math.min(n - a, _), 1);
|
|
62
|
+
r.push(" | " + "^".repeat(N));
|
|
63
|
+
}
|
|
64
|
+
a += _ + 1;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
return r.join(`
|
|
70
|
+
`);
|
|
71
|
+
}
|
|
72
|
+
function he(e, t) {
|
|
73
|
+
typeof console < "u" && (console.warn("[intlify] " + e), t && console.warn(t.stack));
|
|
74
|
+
}
|
|
75
|
+
const gn = {};
|
|
76
|
+
function Jt(e) {
|
|
77
|
+
gn[e] || (gn[e] = !0, he(e));
|
|
78
|
+
}
|
|
79
|
+
function Qt() {
|
|
80
|
+
const e = /* @__PURE__ */ new Map();
|
|
81
|
+
return {
|
|
82
|
+
events: e,
|
|
83
|
+
on(n, s) {
|
|
84
|
+
const a = e.get(n);
|
|
85
|
+
a && a.push(s) || e.set(n, [s]);
|
|
86
|
+
},
|
|
87
|
+
off(n, s) {
|
|
88
|
+
const a = e.get(n);
|
|
89
|
+
a && a.splice(a.indexOf(s) >>> 0, 1);
|
|
90
|
+
},
|
|
91
|
+
emit(n, s) {
|
|
92
|
+
(e.get(n) || []).slice().map((a) => a(s)), (e.get("*") || []).slice().map((a) => a(n, s));
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
const nt = (e) => !M(e) || B(e);
|
|
97
|
+
function rt(e, t) {
|
|
98
|
+
if (nt(e) || nt(t))
|
|
99
|
+
throw new Error("Invalid value");
|
|
100
|
+
const n = [{ src: e, des: t }];
|
|
101
|
+
for (; n.length; ) {
|
|
102
|
+
const { src: s, des: a } = n.pop();
|
|
103
|
+
Object.keys(s).forEach((r) => {
|
|
104
|
+
r !== "__proto__" && (M(s[r]) && !M(a[r]) && (a[r] = Array.isArray(s[r]) ? [] : W()), nt(a[r]) || nt(s[r]) ? a[r] = s[r] : n.push({ src: s[r], des: a[r] }));
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
/*!
|
|
109
|
+
* message-compiler v11.1.3
|
|
110
|
+
* (c) 2025 kazuya kawaguchi
|
|
111
|
+
* Released under the MIT License.
|
|
112
|
+
*/
|
|
113
|
+
function ea(e, t, n) {
|
|
114
|
+
return { line: e, column: t, offset: n };
|
|
115
|
+
}
|
|
116
|
+
function Mt(e, t, n) {
|
|
117
|
+
return { start: e, end: t };
|
|
118
|
+
}
|
|
119
|
+
const k = {
|
|
120
|
+
// tokenizer error codes
|
|
121
|
+
EXPECTED_TOKEN: 1,
|
|
122
|
+
INVALID_TOKEN_IN_PLACEHOLDER: 2,
|
|
123
|
+
UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER: 3,
|
|
124
|
+
UNKNOWN_ESCAPE_SEQUENCE: 4,
|
|
125
|
+
INVALID_UNICODE_ESCAPE_SEQUENCE: 5,
|
|
126
|
+
UNBALANCED_CLOSING_BRACE: 6,
|
|
127
|
+
UNTERMINATED_CLOSING_BRACE: 7,
|
|
128
|
+
EMPTY_PLACEHOLDER: 8,
|
|
129
|
+
NOT_ALLOW_NEST_PLACEHOLDER: 9,
|
|
130
|
+
INVALID_LINKED_FORMAT: 10,
|
|
131
|
+
// parser error codes
|
|
132
|
+
MUST_HAVE_MESSAGES_IN_PLURAL: 11,
|
|
133
|
+
UNEXPECTED_EMPTY_LINKED_MODIFIER: 12,
|
|
134
|
+
UNEXPECTED_EMPTY_LINKED_KEY: 13,
|
|
135
|
+
UNEXPECTED_LEXICAL_ANALYSIS: 14,
|
|
136
|
+
// generator error codes
|
|
137
|
+
UNHANDLED_CODEGEN_NODE_TYPE: 15,
|
|
138
|
+
// minifier error codes
|
|
139
|
+
UNHANDLED_MINIFIER_NODE_TYPE: 16
|
|
140
|
+
}, ta = 17, na = {
|
|
141
|
+
// tokenizer error messages
|
|
142
|
+
[k.EXPECTED_TOKEN]: "Expected token: '{0}'",
|
|
143
|
+
[k.INVALID_TOKEN_IN_PLACEHOLDER]: "Invalid token in placeholder: '{0}'",
|
|
144
|
+
[k.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER]: "Unterminated single quote in placeholder",
|
|
145
|
+
[k.UNKNOWN_ESCAPE_SEQUENCE]: "Unknown escape sequence: \\{0}",
|
|
146
|
+
[k.INVALID_UNICODE_ESCAPE_SEQUENCE]: "Invalid unicode escape sequence: {0}",
|
|
147
|
+
[k.UNBALANCED_CLOSING_BRACE]: "Unbalanced closing brace",
|
|
148
|
+
[k.UNTERMINATED_CLOSING_BRACE]: "Unterminated closing brace",
|
|
149
|
+
[k.EMPTY_PLACEHOLDER]: "Empty placeholder",
|
|
150
|
+
[k.NOT_ALLOW_NEST_PLACEHOLDER]: "Not allowed nest placeholder",
|
|
151
|
+
[k.INVALID_LINKED_FORMAT]: "Invalid linked format",
|
|
152
|
+
// parser error messages
|
|
153
|
+
[k.MUST_HAVE_MESSAGES_IN_PLURAL]: "Plural must have messages",
|
|
154
|
+
[k.UNEXPECTED_EMPTY_LINKED_MODIFIER]: "Unexpected empty linked modifier",
|
|
155
|
+
[k.UNEXPECTED_EMPTY_LINKED_KEY]: "Unexpected empty linked key",
|
|
156
|
+
[k.UNEXPECTED_LEXICAL_ANALYSIS]: "Unexpected lexical analysis in token: '{0}'",
|
|
157
|
+
// generator error messages
|
|
158
|
+
[k.UNHANDLED_CODEGEN_NODE_TYPE]: "unhandled codegen node type: '{0}'",
|
|
159
|
+
// minimizer error messages
|
|
160
|
+
[k.UNHANDLED_MINIFIER_NODE_TYPE]: "unhandled mimifier node type: '{0}'"
|
|
161
|
+
};
|
|
162
|
+
function Ve(e, t, n = {}) {
|
|
163
|
+
const { domain: s, messages: a, args: r } = n, o = process.env.NODE_ENV !== "production" ? lt((a || na)[e] || "", ...r || []) : e, l = new SyntaxError(String(o));
|
|
164
|
+
return l.code = e, t && (l.location = t), l.domain = s, l;
|
|
165
|
+
}
|
|
166
|
+
function sa(e) {
|
|
167
|
+
throw e;
|
|
168
|
+
}
|
|
169
|
+
const aa = /<\/?[\w\s="/.':;#-\/]+>/, ra = (e) => aa.test(e), ge = " ", oa = "\r", Z = `
|
|
170
|
+
`, la = "\u2028", ia = "\u2029";
|
|
171
|
+
function ca(e) {
|
|
172
|
+
const t = e;
|
|
173
|
+
let n = 0, s = 1, a = 1, r = 0;
|
|
174
|
+
const o = (p) => t[p] === oa && t[p + 1] === Z, l = (p) => t[p] === Z, u = (p) => t[p] === ia, _ = (p) => t[p] === la, N = (p) => o(p) || l(p) || u(p) || _(p), T = () => n, E = () => s, A = () => a, C = () => r, y = (p) => o(p) || u(p) || _(p) ? Z : t[p], S = () => y(n), f = () => y(n + r);
|
|
175
|
+
function d() {
|
|
176
|
+
return r = 0, N(n) && (s++, a = 0), o(n) && n++, n++, a++, t[n];
|
|
177
|
+
}
|
|
178
|
+
function b() {
|
|
179
|
+
return o(n + r) && r++, r++, t[n + r];
|
|
180
|
+
}
|
|
181
|
+
function g() {
|
|
182
|
+
n = 0, s = 1, a = 1, r = 0;
|
|
183
|
+
}
|
|
184
|
+
function O(p = 0) {
|
|
185
|
+
r = p;
|
|
186
|
+
}
|
|
187
|
+
function v() {
|
|
188
|
+
const p = n + r;
|
|
189
|
+
for (; p !== n; )
|
|
190
|
+
d();
|
|
191
|
+
r = 0;
|
|
192
|
+
}
|
|
193
|
+
return {
|
|
194
|
+
index: T,
|
|
195
|
+
line: E,
|
|
196
|
+
column: A,
|
|
197
|
+
peekOffset: C,
|
|
198
|
+
charAt: y,
|
|
199
|
+
currentChar: S,
|
|
200
|
+
currentPeek: f,
|
|
201
|
+
next: d,
|
|
202
|
+
peek: b,
|
|
203
|
+
reset: g,
|
|
204
|
+
resetPeek: O,
|
|
205
|
+
skipToPeek: v
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
const pe = void 0, ua = ".", En = "'", fa = "tokenizer";
|
|
209
|
+
function _a(e, t = {}) {
|
|
210
|
+
const n = t.location !== !1, s = ca(e), a = () => s.index(), r = () => ea(s.line(), s.column(), s.index()), o = r(), l = a(), u = {
|
|
211
|
+
currentType: 13,
|
|
212
|
+
offset: l,
|
|
213
|
+
startLoc: o,
|
|
214
|
+
endLoc: o,
|
|
215
|
+
lastType: 13,
|
|
216
|
+
lastOffset: l,
|
|
217
|
+
lastStartLoc: o,
|
|
218
|
+
lastEndLoc: o,
|
|
219
|
+
braceNest: 0,
|
|
220
|
+
inLinked: !1,
|
|
221
|
+
text: ""
|
|
222
|
+
}, _ = () => u, { onError: N } = t;
|
|
223
|
+
function T(i, c, h, ...D) {
|
|
224
|
+
const Y = _();
|
|
225
|
+
if (c.column += h, c.offset += h, N) {
|
|
226
|
+
const H = n ? Mt(Y.startLoc, c) : null, w = Ve(i, H, {
|
|
227
|
+
domain: fa,
|
|
228
|
+
args: D
|
|
229
|
+
});
|
|
230
|
+
N(w);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
function E(i, c, h) {
|
|
234
|
+
i.endLoc = r(), i.currentType = c;
|
|
235
|
+
const D = { type: c };
|
|
236
|
+
return n && (D.loc = Mt(i.startLoc, i.endLoc)), h != null && (D.value = h), D;
|
|
237
|
+
}
|
|
238
|
+
const A = (i) => E(
|
|
239
|
+
i,
|
|
240
|
+
13
|
|
241
|
+
/* TokenTypes.EOF */
|
|
242
|
+
);
|
|
243
|
+
function C(i, c) {
|
|
244
|
+
return i.currentChar() === c ? (i.next(), c) : (T(k.EXPECTED_TOKEN, r(), 0, c), "");
|
|
245
|
+
}
|
|
246
|
+
function y(i) {
|
|
247
|
+
let c = "";
|
|
248
|
+
for (; i.currentPeek() === ge || i.currentPeek() === Z; )
|
|
249
|
+
c += i.currentPeek(), i.peek();
|
|
250
|
+
return c;
|
|
251
|
+
}
|
|
252
|
+
function S(i) {
|
|
253
|
+
const c = y(i);
|
|
254
|
+
return i.skipToPeek(), c;
|
|
255
|
+
}
|
|
256
|
+
function f(i) {
|
|
257
|
+
if (i === pe)
|
|
258
|
+
return !1;
|
|
259
|
+
const c = i.charCodeAt(0);
|
|
260
|
+
return c >= 97 && c <= 122 || // a-z
|
|
261
|
+
c >= 65 && c <= 90 || // A-Z
|
|
262
|
+
c === 95;
|
|
263
|
+
}
|
|
264
|
+
function d(i) {
|
|
265
|
+
if (i === pe)
|
|
266
|
+
return !1;
|
|
267
|
+
const c = i.charCodeAt(0);
|
|
268
|
+
return c >= 48 && c <= 57;
|
|
269
|
+
}
|
|
270
|
+
function b(i, c) {
|
|
271
|
+
const { currentType: h } = c;
|
|
272
|
+
if (h !== 2)
|
|
273
|
+
return !1;
|
|
274
|
+
y(i);
|
|
275
|
+
const D = f(i.currentPeek());
|
|
276
|
+
return i.resetPeek(), D;
|
|
277
|
+
}
|
|
278
|
+
function g(i, c) {
|
|
279
|
+
const { currentType: h } = c;
|
|
280
|
+
if (h !== 2)
|
|
281
|
+
return !1;
|
|
282
|
+
y(i);
|
|
283
|
+
const D = i.currentPeek() === "-" ? i.peek() : i.currentPeek(), Y = d(D);
|
|
284
|
+
return i.resetPeek(), Y;
|
|
285
|
+
}
|
|
286
|
+
function O(i, c) {
|
|
287
|
+
const { currentType: h } = c;
|
|
288
|
+
if (h !== 2)
|
|
289
|
+
return !1;
|
|
290
|
+
y(i);
|
|
291
|
+
const D = i.currentPeek() === En;
|
|
292
|
+
return i.resetPeek(), D;
|
|
293
|
+
}
|
|
294
|
+
function v(i, c) {
|
|
295
|
+
const { currentType: h } = c;
|
|
296
|
+
if (h !== 7)
|
|
297
|
+
return !1;
|
|
298
|
+
y(i);
|
|
299
|
+
const D = i.currentPeek() === ".";
|
|
300
|
+
return i.resetPeek(), D;
|
|
301
|
+
}
|
|
302
|
+
function p(i, c) {
|
|
303
|
+
const { currentType: h } = c;
|
|
304
|
+
if (h !== 8)
|
|
305
|
+
return !1;
|
|
306
|
+
y(i);
|
|
307
|
+
const D = f(i.currentPeek());
|
|
308
|
+
return i.resetPeek(), D;
|
|
309
|
+
}
|
|
310
|
+
function P(i, c) {
|
|
311
|
+
const { currentType: h } = c;
|
|
312
|
+
if (!(h === 7 || h === 11))
|
|
313
|
+
return !1;
|
|
314
|
+
y(i);
|
|
315
|
+
const D = i.currentPeek() === ":";
|
|
316
|
+
return i.resetPeek(), D;
|
|
317
|
+
}
|
|
318
|
+
function U(i, c) {
|
|
319
|
+
const { currentType: h } = c;
|
|
320
|
+
if (h !== 9)
|
|
321
|
+
return !1;
|
|
322
|
+
const D = () => {
|
|
323
|
+
const H = i.currentPeek();
|
|
324
|
+
return H === "{" ? f(i.peek()) : H === "@" || H === "|" || H === ":" || H === "." || H === ge || !H ? !1 : H === Z ? (i.peek(), D()) : oe(i, !1);
|
|
325
|
+
}, Y = D();
|
|
326
|
+
return i.resetPeek(), Y;
|
|
327
|
+
}
|
|
328
|
+
function X(i) {
|
|
329
|
+
y(i);
|
|
330
|
+
const c = i.currentPeek() === "|";
|
|
331
|
+
return i.resetPeek(), c;
|
|
332
|
+
}
|
|
333
|
+
function oe(i, c = !0) {
|
|
334
|
+
const h = (Y = !1, H = "") => {
|
|
335
|
+
const w = i.currentPeek();
|
|
336
|
+
return w === "{" || w === "@" || !w ? Y : w === "|" ? !(H === ge || H === Z) : w === ge ? (i.peek(), h(!0, ge)) : w === Z ? (i.peek(), h(!0, Z)) : !0;
|
|
337
|
+
}, D = h();
|
|
338
|
+
return c && i.resetPeek(), D;
|
|
339
|
+
}
|
|
340
|
+
function J(i, c) {
|
|
341
|
+
const h = i.currentChar();
|
|
342
|
+
return h === pe ? pe : c(h) ? (i.next(), h) : null;
|
|
343
|
+
}
|
|
344
|
+
function Pe(i) {
|
|
345
|
+
const c = i.charCodeAt(0);
|
|
346
|
+
return c >= 97 && c <= 122 || // a-z
|
|
347
|
+
c >= 65 && c <= 90 || // A-Z
|
|
348
|
+
c >= 48 && c <= 57 || // 0-9
|
|
349
|
+
c === 95 || // _
|
|
350
|
+
c === 36;
|
|
351
|
+
}
|
|
352
|
+
function _t(i) {
|
|
353
|
+
return J(i, Pe);
|
|
354
|
+
}
|
|
355
|
+
function mt(i) {
|
|
356
|
+
const c = i.charCodeAt(0);
|
|
357
|
+
return c >= 97 && c <= 122 || // a-z
|
|
358
|
+
c >= 65 && c <= 90 || // A-Z
|
|
359
|
+
c >= 48 && c <= 57 || // 0-9
|
|
360
|
+
c === 95 || // _
|
|
361
|
+
c === 36 || // $
|
|
362
|
+
c === 45;
|
|
363
|
+
}
|
|
364
|
+
function dt(i) {
|
|
365
|
+
return J(i, mt);
|
|
366
|
+
}
|
|
367
|
+
function gt(i) {
|
|
368
|
+
const c = i.charCodeAt(0);
|
|
369
|
+
return c >= 48 && c <= 57;
|
|
370
|
+
}
|
|
371
|
+
function Et(i) {
|
|
372
|
+
return J(i, gt);
|
|
373
|
+
}
|
|
374
|
+
function pt(i) {
|
|
375
|
+
const c = i.charCodeAt(0);
|
|
376
|
+
return c >= 48 && c <= 57 || // 0-9
|
|
377
|
+
c >= 65 && c <= 70 || // A-F
|
|
378
|
+
c >= 97 && c <= 102;
|
|
379
|
+
}
|
|
380
|
+
function me(i) {
|
|
381
|
+
return J(i, pt);
|
|
382
|
+
}
|
|
383
|
+
function We(i) {
|
|
384
|
+
let c = "", h = "";
|
|
385
|
+
for (; c = Et(i); )
|
|
386
|
+
h += c;
|
|
387
|
+
return h;
|
|
388
|
+
}
|
|
389
|
+
function ht(i) {
|
|
390
|
+
let c = "";
|
|
391
|
+
for (; ; ) {
|
|
392
|
+
const h = i.currentChar();
|
|
393
|
+
if (h === "{" || h === "}" || h === "@" || h === "|" || !h)
|
|
394
|
+
break;
|
|
395
|
+
if (h === ge || h === Z)
|
|
396
|
+
if (oe(i))
|
|
397
|
+
c += h, i.next();
|
|
398
|
+
else {
|
|
399
|
+
if (X(i))
|
|
400
|
+
break;
|
|
401
|
+
c += h, i.next();
|
|
402
|
+
}
|
|
403
|
+
else
|
|
404
|
+
c += h, i.next();
|
|
405
|
+
}
|
|
406
|
+
return c;
|
|
407
|
+
}
|
|
408
|
+
function Nt(i) {
|
|
409
|
+
S(i);
|
|
410
|
+
let c = "", h = "";
|
|
411
|
+
for (; c = dt(i); )
|
|
412
|
+
h += c;
|
|
413
|
+
return i.currentChar() === pe && T(k.UNTERMINATED_CLOSING_BRACE, r(), 0), h;
|
|
414
|
+
}
|
|
415
|
+
function Tt(i) {
|
|
416
|
+
S(i);
|
|
417
|
+
let c = "";
|
|
418
|
+
return i.currentChar() === "-" ? (i.next(), c += `-${We(i)}`) : c += We(i), i.currentChar() === pe && T(k.UNTERMINATED_CLOSING_BRACE, r(), 0), c;
|
|
419
|
+
}
|
|
420
|
+
function Lt(i) {
|
|
421
|
+
return i !== En && i !== Z;
|
|
422
|
+
}
|
|
423
|
+
function on(i) {
|
|
424
|
+
S(i), C(i, "'");
|
|
425
|
+
let c = "", h = "";
|
|
426
|
+
for (; c = J(i, Lt); )
|
|
427
|
+
c === "\\" ? h += bt(i) : h += c;
|
|
428
|
+
const D = i.currentChar();
|
|
429
|
+
return D === Z || D === pe ? (T(k.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER, r(), 0), D === Z && (i.next(), C(i, "'")), h) : (C(i, "'"), h);
|
|
430
|
+
}
|
|
431
|
+
function bt(i) {
|
|
432
|
+
const c = i.currentChar();
|
|
433
|
+
switch (c) {
|
|
434
|
+
case "\\":
|
|
435
|
+
case "'":
|
|
436
|
+
return i.next(), `\\${c}`;
|
|
437
|
+
case "u":
|
|
438
|
+
return ze(i, c, 4);
|
|
439
|
+
case "U":
|
|
440
|
+
return ze(i, c, 6);
|
|
441
|
+
default:
|
|
442
|
+
return T(k.UNKNOWN_ESCAPE_SEQUENCE, r(), 0, c), "";
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
function ze(i, c, h) {
|
|
446
|
+
C(i, c);
|
|
447
|
+
let D = "";
|
|
448
|
+
for (let Y = 0; Y < h; Y++) {
|
|
449
|
+
const H = me(i);
|
|
450
|
+
if (!H) {
|
|
451
|
+
T(k.INVALID_UNICODE_ESCAPE_SEQUENCE, r(), 0, `\\${c}${D}${i.currentChar()}`);
|
|
452
|
+
break;
|
|
453
|
+
}
|
|
454
|
+
D += H;
|
|
455
|
+
}
|
|
456
|
+
return `\\${c}${D}`;
|
|
457
|
+
}
|
|
458
|
+
function Ot(i) {
|
|
459
|
+
return i !== "{" && i !== "}" && i !== ge && i !== Z;
|
|
460
|
+
}
|
|
461
|
+
function It(i) {
|
|
462
|
+
S(i);
|
|
463
|
+
let c = "", h = "";
|
|
464
|
+
for (; c = J(i, Ot); )
|
|
465
|
+
h += c;
|
|
466
|
+
return h;
|
|
467
|
+
}
|
|
468
|
+
function vt(i) {
|
|
469
|
+
let c = "", h = "";
|
|
470
|
+
for (; c = _t(i); )
|
|
471
|
+
h += c;
|
|
472
|
+
return h;
|
|
473
|
+
}
|
|
474
|
+
function yt(i) {
|
|
475
|
+
const c = (h) => {
|
|
476
|
+
const D = i.currentChar();
|
|
477
|
+
return D === "{" || D === "@" || D === "|" || D === "(" || D === ")" || !D || D === ge ? h : (h += D, i.next(), c(h));
|
|
478
|
+
};
|
|
479
|
+
return c("");
|
|
480
|
+
}
|
|
481
|
+
function xe(i) {
|
|
482
|
+
S(i);
|
|
483
|
+
const c = C(
|
|
484
|
+
i,
|
|
485
|
+
"|"
|
|
486
|
+
/* TokenChars.Pipe */
|
|
487
|
+
);
|
|
488
|
+
return S(i), c;
|
|
489
|
+
}
|
|
490
|
+
function $e(i, c) {
|
|
491
|
+
let h = null;
|
|
492
|
+
switch (i.currentChar()) {
|
|
493
|
+
case "{":
|
|
494
|
+
return c.braceNest >= 1 && T(k.NOT_ALLOW_NEST_PLACEHOLDER, r(), 0), i.next(), h = E(
|
|
495
|
+
c,
|
|
496
|
+
2,
|
|
497
|
+
"{"
|
|
498
|
+
/* TokenChars.BraceLeft */
|
|
499
|
+
), S(i), c.braceNest++, h;
|
|
500
|
+
case "}":
|
|
501
|
+
return c.braceNest > 0 && c.currentType === 2 && T(k.EMPTY_PLACEHOLDER, r(), 0), i.next(), h = E(
|
|
502
|
+
c,
|
|
503
|
+
3,
|
|
504
|
+
"}"
|
|
505
|
+
/* TokenChars.BraceRight */
|
|
506
|
+
), c.braceNest--, c.braceNest > 0 && S(i), c.inLinked && c.braceNest === 0 && (c.inLinked = !1), h;
|
|
507
|
+
case "@":
|
|
508
|
+
return c.braceNest > 0 && T(k.UNTERMINATED_CLOSING_BRACE, r(), 0), h = Le(i, c) || A(c), c.braceNest = 0, h;
|
|
509
|
+
default: {
|
|
510
|
+
let Y = !0, H = !0, w = !0;
|
|
511
|
+
if (X(i))
|
|
512
|
+
return c.braceNest > 0 && T(k.UNTERMINATED_CLOSING_BRACE, r(), 0), h = E(c, 1, xe(i)), c.braceNest = 0, c.inLinked = !1, h;
|
|
513
|
+
if (c.braceNest > 0 && (c.currentType === 4 || c.currentType === 5 || c.currentType === 6))
|
|
514
|
+
return T(k.UNTERMINATED_CLOSING_BRACE, r(), 0), c.braceNest = 0, Ge(i, c);
|
|
515
|
+
if (Y = b(i, c))
|
|
516
|
+
return h = E(c, 4, Nt(i)), S(i), h;
|
|
517
|
+
if (H = g(i, c))
|
|
518
|
+
return h = E(c, 5, Tt(i)), S(i), h;
|
|
519
|
+
if (w = O(i, c))
|
|
520
|
+
return h = E(c, 6, on(i)), S(i), h;
|
|
521
|
+
if (!Y && !H && !w)
|
|
522
|
+
return h = E(c, 12, It(i)), T(k.INVALID_TOKEN_IN_PLACEHOLDER, r(), 0, h.value), S(i), h;
|
|
523
|
+
break;
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
return h;
|
|
527
|
+
}
|
|
528
|
+
function Le(i, c) {
|
|
529
|
+
const { currentType: h } = c;
|
|
530
|
+
let D = null;
|
|
531
|
+
const Y = i.currentChar();
|
|
532
|
+
switch ((h === 7 || h === 8 || h === 11 || h === 9) && (Y === Z || Y === ge) && T(k.INVALID_LINKED_FORMAT, r(), 0), Y) {
|
|
533
|
+
case "@":
|
|
534
|
+
return i.next(), D = E(
|
|
535
|
+
c,
|
|
536
|
+
7,
|
|
537
|
+
"@"
|
|
538
|
+
/* TokenChars.LinkedAlias */
|
|
539
|
+
), c.inLinked = !0, D;
|
|
540
|
+
case ".":
|
|
541
|
+
return S(i), i.next(), E(
|
|
542
|
+
c,
|
|
543
|
+
8,
|
|
544
|
+
"."
|
|
545
|
+
/* TokenChars.LinkedDot */
|
|
546
|
+
);
|
|
547
|
+
case ":":
|
|
548
|
+
return S(i), i.next(), E(
|
|
549
|
+
c,
|
|
550
|
+
9,
|
|
551
|
+
":"
|
|
552
|
+
/* TokenChars.LinkedDelimiter */
|
|
553
|
+
);
|
|
554
|
+
default:
|
|
555
|
+
return X(i) ? (D = E(c, 1, xe(i)), c.braceNest = 0, c.inLinked = !1, D) : v(i, c) || P(i, c) ? (S(i), Le(i, c)) : p(i, c) ? (S(i), E(c, 11, vt(i))) : U(i, c) ? (S(i), Y === "{" ? $e(i, c) || D : E(c, 10, yt(i))) : (h === 7 && T(k.INVALID_LINKED_FORMAT, r(), 0), c.braceNest = 0, c.inLinked = !1, Ge(i, c));
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
function Ge(i, c) {
|
|
559
|
+
let h = {
|
|
560
|
+
type: 13
|
|
561
|
+
/* TokenTypes.EOF */
|
|
562
|
+
};
|
|
563
|
+
if (c.braceNest > 0)
|
|
564
|
+
return $e(i, c) || A(c);
|
|
565
|
+
if (c.inLinked)
|
|
566
|
+
return Le(i, c) || A(c);
|
|
567
|
+
switch (i.currentChar()) {
|
|
568
|
+
case "{":
|
|
569
|
+
return $e(i, c) || A(c);
|
|
570
|
+
case "}":
|
|
571
|
+
return T(k.UNBALANCED_CLOSING_BRACE, r(), 0), i.next(), E(
|
|
572
|
+
c,
|
|
573
|
+
3,
|
|
574
|
+
"}"
|
|
575
|
+
/* TokenChars.BraceRight */
|
|
576
|
+
);
|
|
577
|
+
case "@":
|
|
578
|
+
return Le(i, c) || A(c);
|
|
579
|
+
default: {
|
|
580
|
+
if (X(i))
|
|
581
|
+
return h = E(c, 1, xe(i)), c.braceNest = 0, c.inLinked = !1, h;
|
|
582
|
+
if (oe(i))
|
|
583
|
+
return E(c, 0, ht(i));
|
|
584
|
+
break;
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
return h;
|
|
588
|
+
}
|
|
589
|
+
function At() {
|
|
590
|
+
const { currentType: i, offset: c, startLoc: h, endLoc: D } = u;
|
|
591
|
+
return u.lastType = i, u.lastOffset = c, u.lastStartLoc = h, u.lastEndLoc = D, u.offset = a(), u.startLoc = r(), s.currentChar() === pe ? E(
|
|
592
|
+
u,
|
|
593
|
+
13
|
|
594
|
+
/* TokenTypes.EOF */
|
|
595
|
+
) : Ge(s, u);
|
|
596
|
+
}
|
|
597
|
+
return {
|
|
598
|
+
nextToken: At,
|
|
599
|
+
currentOffset: a,
|
|
600
|
+
currentPosition: r,
|
|
601
|
+
context: _
|
|
602
|
+
};
|
|
603
|
+
}
|
|
604
|
+
const ma = "parser", da = /(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;
|
|
605
|
+
function ga(e, t, n) {
|
|
606
|
+
switch (e) {
|
|
607
|
+
case "\\\\":
|
|
608
|
+
return "\\";
|
|
609
|
+
// eslint-disable-next-line no-useless-escape
|
|
610
|
+
case "\\'":
|
|
611
|
+
return "'";
|
|
612
|
+
default: {
|
|
613
|
+
const s = parseInt(t || n, 16);
|
|
614
|
+
return s <= 55295 || s >= 57344 ? String.fromCodePoint(s) : "�";
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
function Ea(e = {}) {
|
|
619
|
+
const t = e.location !== !1, { onError: n } = e;
|
|
620
|
+
function s(f, d, b, g, ...O) {
|
|
621
|
+
const v = f.currentPosition();
|
|
622
|
+
if (v.offset += g, v.column += g, n) {
|
|
623
|
+
const p = t ? Mt(b, v) : null, P = Ve(d, p, {
|
|
624
|
+
domain: ma,
|
|
625
|
+
args: O
|
|
626
|
+
});
|
|
627
|
+
n(P);
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
function a(f, d, b) {
|
|
631
|
+
const g = { type: f };
|
|
632
|
+
return t && (g.start = d, g.end = d, g.loc = { start: b, end: b }), g;
|
|
633
|
+
}
|
|
634
|
+
function r(f, d, b, g) {
|
|
635
|
+
t && (f.end = d, f.loc && (f.loc.end = b));
|
|
636
|
+
}
|
|
637
|
+
function o(f, d) {
|
|
638
|
+
const b = f.context(), g = a(3, b.offset, b.startLoc);
|
|
639
|
+
return g.value = d, r(g, f.currentOffset(), f.currentPosition()), g;
|
|
640
|
+
}
|
|
641
|
+
function l(f, d) {
|
|
642
|
+
const b = f.context(), { lastOffset: g, lastStartLoc: O } = b, v = a(5, g, O);
|
|
643
|
+
return v.index = parseInt(d, 10), f.nextToken(), r(v, f.currentOffset(), f.currentPosition()), v;
|
|
644
|
+
}
|
|
645
|
+
function u(f, d) {
|
|
646
|
+
const b = f.context(), { lastOffset: g, lastStartLoc: O } = b, v = a(4, g, O);
|
|
647
|
+
return v.key = d, f.nextToken(), r(v, f.currentOffset(), f.currentPosition()), v;
|
|
648
|
+
}
|
|
649
|
+
function _(f, d) {
|
|
650
|
+
const b = f.context(), { lastOffset: g, lastStartLoc: O } = b, v = a(9, g, O);
|
|
651
|
+
return v.value = d.replace(da, ga), f.nextToken(), r(v, f.currentOffset(), f.currentPosition()), v;
|
|
652
|
+
}
|
|
653
|
+
function N(f) {
|
|
654
|
+
const d = f.nextToken(), b = f.context(), { lastOffset: g, lastStartLoc: O } = b, v = a(8, g, O);
|
|
655
|
+
return d.type !== 11 ? (s(f, k.UNEXPECTED_EMPTY_LINKED_MODIFIER, b.lastStartLoc, 0), v.value = "", r(v, g, O), {
|
|
656
|
+
nextConsumeToken: d,
|
|
657
|
+
node: v
|
|
658
|
+
}) : (d.value == null && s(f, k.UNEXPECTED_LEXICAL_ANALYSIS, b.lastStartLoc, 0, ue(d)), v.value = d.value || "", r(v, f.currentOffset(), f.currentPosition()), {
|
|
659
|
+
node: v
|
|
660
|
+
});
|
|
661
|
+
}
|
|
662
|
+
function T(f, d) {
|
|
663
|
+
const b = f.context(), g = a(7, b.offset, b.startLoc);
|
|
664
|
+
return g.value = d, r(g, f.currentOffset(), f.currentPosition()), g;
|
|
665
|
+
}
|
|
666
|
+
function E(f) {
|
|
667
|
+
const d = f.context(), b = a(6, d.offset, d.startLoc);
|
|
668
|
+
let g = f.nextToken();
|
|
669
|
+
if (g.type === 8) {
|
|
670
|
+
const O = N(f);
|
|
671
|
+
b.modifier = O.node, g = O.nextConsumeToken || f.nextToken();
|
|
672
|
+
}
|
|
673
|
+
switch (g.type !== 9 && s(f, k.UNEXPECTED_LEXICAL_ANALYSIS, d.lastStartLoc, 0, ue(g)), g = f.nextToken(), g.type === 2 && (g = f.nextToken()), g.type) {
|
|
674
|
+
case 10:
|
|
675
|
+
g.value == null && s(f, k.UNEXPECTED_LEXICAL_ANALYSIS, d.lastStartLoc, 0, ue(g)), b.key = T(f, g.value || "");
|
|
676
|
+
break;
|
|
677
|
+
case 4:
|
|
678
|
+
g.value == null && s(f, k.UNEXPECTED_LEXICAL_ANALYSIS, d.lastStartLoc, 0, ue(g)), b.key = u(f, g.value || "");
|
|
679
|
+
break;
|
|
680
|
+
case 5:
|
|
681
|
+
g.value == null && s(f, k.UNEXPECTED_LEXICAL_ANALYSIS, d.lastStartLoc, 0, ue(g)), b.key = l(f, g.value || "");
|
|
682
|
+
break;
|
|
683
|
+
case 6:
|
|
684
|
+
g.value == null && s(f, k.UNEXPECTED_LEXICAL_ANALYSIS, d.lastStartLoc, 0, ue(g)), b.key = _(f, g.value || "");
|
|
685
|
+
break;
|
|
686
|
+
default: {
|
|
687
|
+
s(f, k.UNEXPECTED_EMPTY_LINKED_KEY, d.lastStartLoc, 0);
|
|
688
|
+
const O = f.context(), v = a(7, O.offset, O.startLoc);
|
|
689
|
+
return v.value = "", r(v, O.offset, O.startLoc), b.key = v, r(b, O.offset, O.startLoc), {
|
|
690
|
+
nextConsumeToken: g,
|
|
691
|
+
node: b
|
|
692
|
+
};
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
return r(b, f.currentOffset(), f.currentPosition()), {
|
|
696
|
+
node: b
|
|
697
|
+
};
|
|
698
|
+
}
|
|
699
|
+
function A(f) {
|
|
700
|
+
const d = f.context(), b = d.currentType === 1 ? f.currentOffset() : d.offset, g = d.currentType === 1 ? d.endLoc : d.startLoc, O = a(2, b, g);
|
|
701
|
+
O.items = [];
|
|
702
|
+
let v = null;
|
|
703
|
+
do {
|
|
704
|
+
const U = v || f.nextToken();
|
|
705
|
+
switch (v = null, U.type) {
|
|
706
|
+
case 0:
|
|
707
|
+
U.value == null && s(f, k.UNEXPECTED_LEXICAL_ANALYSIS, d.lastStartLoc, 0, ue(U)), O.items.push(o(f, U.value || ""));
|
|
708
|
+
break;
|
|
709
|
+
case 5:
|
|
710
|
+
U.value == null && s(f, k.UNEXPECTED_LEXICAL_ANALYSIS, d.lastStartLoc, 0, ue(U)), O.items.push(l(f, U.value || ""));
|
|
711
|
+
break;
|
|
712
|
+
case 4:
|
|
713
|
+
U.value == null && s(f, k.UNEXPECTED_LEXICAL_ANALYSIS, d.lastStartLoc, 0, ue(U)), O.items.push(u(f, U.value || ""));
|
|
714
|
+
break;
|
|
715
|
+
case 6:
|
|
716
|
+
U.value == null && s(f, k.UNEXPECTED_LEXICAL_ANALYSIS, d.lastStartLoc, 0, ue(U)), O.items.push(_(f, U.value || ""));
|
|
717
|
+
break;
|
|
718
|
+
case 7: {
|
|
719
|
+
const X = E(f);
|
|
720
|
+
O.items.push(X.node), v = X.nextConsumeToken || null;
|
|
721
|
+
break;
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
} while (d.currentType !== 13 && d.currentType !== 1);
|
|
725
|
+
const p = d.currentType === 1 ? d.lastOffset : f.currentOffset(), P = d.currentType === 1 ? d.lastEndLoc : f.currentPosition();
|
|
726
|
+
return r(O, p, P), O;
|
|
727
|
+
}
|
|
728
|
+
function C(f, d, b, g) {
|
|
729
|
+
const O = f.context();
|
|
730
|
+
let v = g.items.length === 0;
|
|
731
|
+
const p = a(1, d, b);
|
|
732
|
+
p.cases = [], p.cases.push(g);
|
|
733
|
+
do {
|
|
734
|
+
const P = A(f);
|
|
735
|
+
v || (v = P.items.length === 0), p.cases.push(P);
|
|
736
|
+
} while (O.currentType !== 13);
|
|
737
|
+
return v && s(f, k.MUST_HAVE_MESSAGES_IN_PLURAL, b, 0), r(p, f.currentOffset(), f.currentPosition()), p;
|
|
738
|
+
}
|
|
739
|
+
function y(f) {
|
|
740
|
+
const d = f.context(), { offset: b, startLoc: g } = d, O = A(f);
|
|
741
|
+
return d.currentType === 13 ? O : C(f, b, g, O);
|
|
742
|
+
}
|
|
743
|
+
function S(f) {
|
|
744
|
+
const d = _a(f, Q({}, e)), b = d.context(), g = a(0, b.offset, b.startLoc);
|
|
745
|
+
return t && g.loc && (g.loc.source = f), g.body = y(d), e.onCacheKey && (g.cacheKey = e.onCacheKey(f)), b.currentType !== 13 && s(d, k.UNEXPECTED_LEXICAL_ANALYSIS, b.lastStartLoc, 0, f[b.offset] || ""), r(g, d.currentOffset(), d.currentPosition()), g;
|
|
746
|
+
}
|
|
747
|
+
return { parse: S };
|
|
748
|
+
}
|
|
749
|
+
function ue(e) {
|
|
750
|
+
if (e.type === 13)
|
|
751
|
+
return "EOF";
|
|
752
|
+
const t = (e.value || "").replace(/\r?\n/gu, "\\n");
|
|
753
|
+
return t.length > 10 ? t.slice(0, 9) + "…" : t;
|
|
754
|
+
}
|
|
755
|
+
function pa(e, t = {}) {
|
|
756
|
+
const n = {
|
|
757
|
+
ast: e,
|
|
758
|
+
helpers: /* @__PURE__ */ new Set()
|
|
759
|
+
};
|
|
760
|
+
return { context: () => n, helper: (r) => (n.helpers.add(r), r) };
|
|
761
|
+
}
|
|
762
|
+
function pn(e, t) {
|
|
763
|
+
for (let n = 0; n < e.length; n++)
|
|
764
|
+
qt(e[n], t);
|
|
765
|
+
}
|
|
766
|
+
function qt(e, t) {
|
|
767
|
+
switch (e.type) {
|
|
768
|
+
case 1:
|
|
769
|
+
pn(e.cases, t), t.helper(
|
|
770
|
+
"plural"
|
|
771
|
+
/* HelperNameMap.PLURAL */
|
|
772
|
+
);
|
|
773
|
+
break;
|
|
774
|
+
case 2:
|
|
775
|
+
pn(e.items, t);
|
|
776
|
+
break;
|
|
777
|
+
case 6: {
|
|
778
|
+
qt(e.key, t), t.helper(
|
|
779
|
+
"linked"
|
|
780
|
+
/* HelperNameMap.LINKED */
|
|
781
|
+
), t.helper(
|
|
782
|
+
"type"
|
|
783
|
+
/* HelperNameMap.TYPE */
|
|
784
|
+
);
|
|
785
|
+
break;
|
|
786
|
+
}
|
|
787
|
+
case 5:
|
|
788
|
+
t.helper(
|
|
789
|
+
"interpolate"
|
|
790
|
+
/* HelperNameMap.INTERPOLATE */
|
|
791
|
+
), t.helper(
|
|
792
|
+
"list"
|
|
793
|
+
/* HelperNameMap.LIST */
|
|
794
|
+
);
|
|
795
|
+
break;
|
|
796
|
+
case 4:
|
|
797
|
+
t.helper(
|
|
798
|
+
"interpolate"
|
|
799
|
+
/* HelperNameMap.INTERPOLATE */
|
|
800
|
+
), t.helper(
|
|
801
|
+
"named"
|
|
802
|
+
/* HelperNameMap.NAMED */
|
|
803
|
+
);
|
|
804
|
+
break;
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
function ha(e, t = {}) {
|
|
808
|
+
const n = pa(e);
|
|
809
|
+
n.helper(
|
|
810
|
+
"normalize"
|
|
811
|
+
/* HelperNameMap.NORMALIZE */
|
|
812
|
+
), e.body && qt(e.body, n);
|
|
813
|
+
const s = n.context();
|
|
814
|
+
e.helpers = Array.from(s.helpers);
|
|
815
|
+
}
|
|
816
|
+
function Na(e) {
|
|
817
|
+
const t = e.body;
|
|
818
|
+
return t.type === 2 ? hn(t) : t.cases.forEach((n) => hn(n)), e;
|
|
819
|
+
}
|
|
820
|
+
function hn(e) {
|
|
821
|
+
if (e.items.length === 1) {
|
|
822
|
+
const t = e.items[0];
|
|
823
|
+
(t.type === 3 || t.type === 9) && (e.static = t.value, delete t.value);
|
|
824
|
+
} else {
|
|
825
|
+
const t = [];
|
|
826
|
+
for (let n = 0; n < e.items.length; n++) {
|
|
827
|
+
const s = e.items[n];
|
|
828
|
+
if (!(s.type === 3 || s.type === 9) || s.value == null)
|
|
829
|
+
break;
|
|
830
|
+
t.push(s.value);
|
|
831
|
+
}
|
|
832
|
+
if (t.length === e.items.length) {
|
|
833
|
+
e.static = Xt(t);
|
|
834
|
+
for (let n = 0; n < e.items.length; n++) {
|
|
835
|
+
const s = e.items[n];
|
|
836
|
+
(s.type === 3 || s.type === 9) && delete s.value;
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
const Ta = "minifier";
|
|
842
|
+
function Fe(e) {
|
|
843
|
+
switch (e.t = e.type, e.type) {
|
|
844
|
+
case 0: {
|
|
845
|
+
const t = e;
|
|
846
|
+
Fe(t.body), t.b = t.body, delete t.body;
|
|
847
|
+
break;
|
|
848
|
+
}
|
|
849
|
+
case 1: {
|
|
850
|
+
const t = e, n = t.cases;
|
|
851
|
+
for (let s = 0; s < n.length; s++)
|
|
852
|
+
Fe(n[s]);
|
|
853
|
+
t.c = n, delete t.cases;
|
|
854
|
+
break;
|
|
855
|
+
}
|
|
856
|
+
case 2: {
|
|
857
|
+
const t = e, n = t.items;
|
|
858
|
+
for (let s = 0; s < n.length; s++)
|
|
859
|
+
Fe(n[s]);
|
|
860
|
+
t.i = n, delete t.items, t.static && (t.s = t.static, delete t.static);
|
|
861
|
+
break;
|
|
862
|
+
}
|
|
863
|
+
case 3:
|
|
864
|
+
case 9:
|
|
865
|
+
case 8:
|
|
866
|
+
case 7: {
|
|
867
|
+
const t = e;
|
|
868
|
+
t.value && (t.v = t.value, delete t.value);
|
|
869
|
+
break;
|
|
870
|
+
}
|
|
871
|
+
case 6: {
|
|
872
|
+
const t = e;
|
|
873
|
+
Fe(t.key), t.k = t.key, delete t.key, t.modifier && (Fe(t.modifier), t.m = t.modifier, delete t.modifier);
|
|
874
|
+
break;
|
|
875
|
+
}
|
|
876
|
+
case 5: {
|
|
877
|
+
const t = e;
|
|
878
|
+
t.i = t.index, delete t.index;
|
|
879
|
+
break;
|
|
880
|
+
}
|
|
881
|
+
case 4: {
|
|
882
|
+
const t = e;
|
|
883
|
+
t.k = t.key, delete t.key;
|
|
884
|
+
break;
|
|
885
|
+
}
|
|
886
|
+
default:
|
|
887
|
+
if (process.env.NODE_ENV !== "production")
|
|
888
|
+
throw Ve(k.UNHANDLED_MINIFIER_NODE_TYPE, null, {
|
|
889
|
+
domain: Ta,
|
|
890
|
+
args: [e.type]
|
|
891
|
+
});
|
|
892
|
+
}
|
|
893
|
+
delete e.type;
|
|
894
|
+
}
|
|
895
|
+
const La = "parser";
|
|
896
|
+
function ba(e, t) {
|
|
897
|
+
const { filename: n, breakLineCode: s, needIndent: a } = t, r = t.location !== !1, o = {
|
|
898
|
+
filename: n,
|
|
899
|
+
code: "",
|
|
900
|
+
column: 1,
|
|
901
|
+
line: 1,
|
|
902
|
+
offset: 0,
|
|
903
|
+
map: void 0,
|
|
904
|
+
breakLineCode: s,
|
|
905
|
+
needIndent: a,
|
|
906
|
+
indentLevel: 0
|
|
907
|
+
};
|
|
908
|
+
r && e.loc && (o.source = e.loc.source);
|
|
909
|
+
const l = () => o;
|
|
910
|
+
function u(y, S) {
|
|
911
|
+
o.code += y;
|
|
912
|
+
}
|
|
913
|
+
function _(y, S = !0) {
|
|
914
|
+
const f = S ? s : "";
|
|
915
|
+
u(a ? f + " ".repeat(y) : f);
|
|
916
|
+
}
|
|
917
|
+
function N(y = !0) {
|
|
918
|
+
const S = ++o.indentLevel;
|
|
919
|
+
y && _(S);
|
|
920
|
+
}
|
|
921
|
+
function T(y = !0) {
|
|
922
|
+
const S = --o.indentLevel;
|
|
923
|
+
y && _(S);
|
|
924
|
+
}
|
|
925
|
+
function E() {
|
|
926
|
+
_(o.indentLevel);
|
|
927
|
+
}
|
|
928
|
+
return {
|
|
929
|
+
context: l,
|
|
930
|
+
push: u,
|
|
931
|
+
indent: N,
|
|
932
|
+
deindent: T,
|
|
933
|
+
newline: E,
|
|
934
|
+
helper: (y) => `_${y}`,
|
|
935
|
+
needIndent: () => o.needIndent
|
|
936
|
+
};
|
|
937
|
+
}
|
|
938
|
+
function Oa(e, t) {
|
|
939
|
+
const { helper: n } = e;
|
|
940
|
+
e.push(`${n(
|
|
941
|
+
"linked"
|
|
942
|
+
/* HelperNameMap.LINKED */
|
|
943
|
+
)}(`), Ue(e, t.key), t.modifier ? (e.push(", "), Ue(e, t.modifier), e.push(", _type")) : e.push(", undefined, _type"), e.push(")");
|
|
944
|
+
}
|
|
945
|
+
function Ia(e, t) {
|
|
946
|
+
const { helper: n, needIndent: s } = e;
|
|
947
|
+
e.push(`${n(
|
|
948
|
+
"normalize"
|
|
949
|
+
/* HelperNameMap.NORMALIZE */
|
|
950
|
+
)}([`), e.indent(s());
|
|
951
|
+
const a = t.items.length;
|
|
952
|
+
for (let r = 0; r < a && (Ue(e, t.items[r]), r !== a - 1); r++)
|
|
953
|
+
e.push(", ");
|
|
954
|
+
e.deindent(s()), e.push("])");
|
|
955
|
+
}
|
|
956
|
+
function va(e, t) {
|
|
957
|
+
const { helper: n, needIndent: s } = e;
|
|
958
|
+
if (t.cases.length > 1) {
|
|
959
|
+
e.push(`${n(
|
|
960
|
+
"plural"
|
|
961
|
+
/* HelperNameMap.PLURAL */
|
|
962
|
+
)}([`), e.indent(s());
|
|
963
|
+
const a = t.cases.length;
|
|
964
|
+
for (let r = 0; r < a && (Ue(e, t.cases[r]), r !== a - 1); r++)
|
|
965
|
+
e.push(", ");
|
|
966
|
+
e.deindent(s()), e.push("])");
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
function ya(e, t) {
|
|
970
|
+
t.body ? Ue(e, t.body) : e.push("null");
|
|
971
|
+
}
|
|
972
|
+
function Ue(e, t) {
|
|
973
|
+
const { helper: n } = e;
|
|
974
|
+
switch (t.type) {
|
|
975
|
+
case 0:
|
|
976
|
+
ya(e, t);
|
|
977
|
+
break;
|
|
978
|
+
case 1:
|
|
979
|
+
va(e, t);
|
|
980
|
+
break;
|
|
981
|
+
case 2:
|
|
982
|
+
Ia(e, t);
|
|
983
|
+
break;
|
|
984
|
+
case 6:
|
|
985
|
+
Oa(e, t);
|
|
986
|
+
break;
|
|
987
|
+
case 8:
|
|
988
|
+
e.push(JSON.stringify(t.value), t);
|
|
989
|
+
break;
|
|
990
|
+
case 7:
|
|
991
|
+
e.push(JSON.stringify(t.value), t);
|
|
992
|
+
break;
|
|
993
|
+
case 5:
|
|
994
|
+
e.push(`${n(
|
|
995
|
+
"interpolate"
|
|
996
|
+
/* HelperNameMap.INTERPOLATE */
|
|
997
|
+
)}(${n(
|
|
998
|
+
"list"
|
|
999
|
+
/* HelperNameMap.LIST */
|
|
1000
|
+
)}(${t.index}))`, t);
|
|
1001
|
+
break;
|
|
1002
|
+
case 4:
|
|
1003
|
+
e.push(`${n(
|
|
1004
|
+
"interpolate"
|
|
1005
|
+
/* HelperNameMap.INTERPOLATE */
|
|
1006
|
+
)}(${n(
|
|
1007
|
+
"named"
|
|
1008
|
+
/* HelperNameMap.NAMED */
|
|
1009
|
+
)}(${JSON.stringify(t.key)}))`, t);
|
|
1010
|
+
break;
|
|
1011
|
+
case 9:
|
|
1012
|
+
e.push(JSON.stringify(t.value), t);
|
|
1013
|
+
break;
|
|
1014
|
+
case 3:
|
|
1015
|
+
e.push(JSON.stringify(t.value), t);
|
|
1016
|
+
break;
|
|
1017
|
+
default:
|
|
1018
|
+
if (process.env.NODE_ENV !== "production")
|
|
1019
|
+
throw Ve(k.UNHANDLED_CODEGEN_NODE_TYPE, null, {
|
|
1020
|
+
domain: La,
|
|
1021
|
+
args: [t.type]
|
|
1022
|
+
});
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
const Aa = (e, t = {}) => {
|
|
1026
|
+
const n = I(t.mode) ? t.mode : "normal", s = I(t.filename) ? t.filename : "message.intl";
|
|
1027
|
+
t.sourceMap;
|
|
1028
|
+
const a = t.breakLineCode != null ? t.breakLineCode : n === "arrow" ? ";" : `
|
|
1029
|
+
`, r = t.needIndent ? t.needIndent : n !== "arrow", o = e.helpers || [], l = ba(e, {
|
|
1030
|
+
filename: s,
|
|
1031
|
+
breakLineCode: a,
|
|
1032
|
+
needIndent: r
|
|
1033
|
+
});
|
|
1034
|
+
l.push(n === "normal" ? "function __msg__ (ctx) {" : "(ctx) => {"), l.indent(r), o.length > 0 && (l.push(`const { ${Xt(o.map((N) => `${N}: _${N}`), ", ")} } = ctx`), l.newline()), l.push("return "), Ue(l, e), l.deindent(r), l.push("}"), delete e.helpers;
|
|
1035
|
+
const { code: u, map: _ } = l.context();
|
|
1036
|
+
return {
|
|
1037
|
+
ast: e,
|
|
1038
|
+
code: u,
|
|
1039
|
+
map: _ ? _.toJSON() : void 0
|
|
1040
|
+
// eslint-disable-line @typescript-eslint/no-explicit-any
|
|
1041
|
+
};
|
|
1042
|
+
};
|
|
1043
|
+
function Sa(e, t = {}) {
|
|
1044
|
+
const n = Q({}, t), s = !!n.jit, a = !!n.minify, r = n.optimize == null ? !0 : n.optimize, l = Ea(n).parse(e);
|
|
1045
|
+
return s ? (r && Na(l), a && Fe(l), { ast: l, code: "" }) : (ha(l, n), Aa(l, n));
|
|
1046
|
+
}
|
|
1047
|
+
/*!
|
|
1048
|
+
* core-base v11.1.3
|
|
1049
|
+
* (c) 2025 kazuya kawaguchi
|
|
1050
|
+
* Released under the MIT License.
|
|
1051
|
+
*/
|
|
1052
|
+
function Ca() {
|
|
1053
|
+
typeof __INTLIFY_PROD_DEVTOOLS__ != "boolean" && (Ae().__INTLIFY_PROD_DEVTOOLS__ = !1), typeof __INTLIFY_DROP_MESSAGE_COMPILER__ != "boolean" && (Ae().__INTLIFY_DROP_MESSAGE_COMPILER__ = !1);
|
|
1054
|
+
}
|
|
1055
|
+
function re(e) {
|
|
1056
|
+
return M(e) && Zt(e) === 0 && (ie(e, "b") || ie(e, "body"));
|
|
1057
|
+
}
|
|
1058
|
+
const Zn = ["b", "body"];
|
|
1059
|
+
function Da(e) {
|
|
1060
|
+
return Ne(e, Zn);
|
|
1061
|
+
}
|
|
1062
|
+
const zn = ["c", "cases"];
|
|
1063
|
+
function ka(e) {
|
|
1064
|
+
return Ne(e, zn, []);
|
|
1065
|
+
}
|
|
1066
|
+
const es = ["s", "static"];
|
|
1067
|
+
function Pa(e) {
|
|
1068
|
+
return Ne(e, es);
|
|
1069
|
+
}
|
|
1070
|
+
const ts = ["i", "items"];
|
|
1071
|
+
function Ra(e) {
|
|
1072
|
+
return Ne(e, ts, []);
|
|
1073
|
+
}
|
|
1074
|
+
const ns = ["t", "type"];
|
|
1075
|
+
function Zt(e) {
|
|
1076
|
+
return Ne(e, ns);
|
|
1077
|
+
}
|
|
1078
|
+
const ss = ["v", "value"];
|
|
1079
|
+
function st(e, t) {
|
|
1080
|
+
const n = Ne(e, ss);
|
|
1081
|
+
if (n != null)
|
|
1082
|
+
return n;
|
|
1083
|
+
throw Be(t);
|
|
1084
|
+
}
|
|
1085
|
+
const as = ["m", "modifier"];
|
|
1086
|
+
function Ma(e) {
|
|
1087
|
+
return Ne(e, as);
|
|
1088
|
+
}
|
|
1089
|
+
const rs = ["k", "key"];
|
|
1090
|
+
function Fa(e) {
|
|
1091
|
+
const t = Ne(e, rs);
|
|
1092
|
+
if (t)
|
|
1093
|
+
return t;
|
|
1094
|
+
throw Be(
|
|
1095
|
+
6
|
|
1096
|
+
/* NodeTypes.Linked */
|
|
1097
|
+
);
|
|
1098
|
+
}
|
|
1099
|
+
function Ne(e, t, n) {
|
|
1100
|
+
for (let s = 0; s < t.length; s++) {
|
|
1101
|
+
const a = t[s];
|
|
1102
|
+
if (ie(e, a) && e[a] != null)
|
|
1103
|
+
return e[a];
|
|
1104
|
+
}
|
|
1105
|
+
return n;
|
|
1106
|
+
}
|
|
1107
|
+
const os = [
|
|
1108
|
+
...Zn,
|
|
1109
|
+
...zn,
|
|
1110
|
+
...es,
|
|
1111
|
+
...ts,
|
|
1112
|
+
...rs,
|
|
1113
|
+
...as,
|
|
1114
|
+
...ss,
|
|
1115
|
+
...ns
|
|
1116
|
+
];
|
|
1117
|
+
function Be(e) {
|
|
1118
|
+
return new Error(`unhandled node type: ${e}`);
|
|
1119
|
+
}
|
|
1120
|
+
function St(e) {
|
|
1121
|
+
return (n) => wa(n, e);
|
|
1122
|
+
}
|
|
1123
|
+
function wa(e, t) {
|
|
1124
|
+
const n = Da(t);
|
|
1125
|
+
if (n == null)
|
|
1126
|
+
throw Be(
|
|
1127
|
+
0
|
|
1128
|
+
/* NodeTypes.Resource */
|
|
1129
|
+
);
|
|
1130
|
+
if (Zt(n) === 1) {
|
|
1131
|
+
const r = ka(n);
|
|
1132
|
+
return e.plural(r.reduce((o, l) => [
|
|
1133
|
+
...o,
|
|
1134
|
+
Nn(e, l)
|
|
1135
|
+
], []));
|
|
1136
|
+
} else
|
|
1137
|
+
return Nn(e, n);
|
|
1138
|
+
}
|
|
1139
|
+
function Nn(e, t) {
|
|
1140
|
+
const n = Pa(t);
|
|
1141
|
+
if (n != null)
|
|
1142
|
+
return e.type === "text" ? n : e.normalize([n]);
|
|
1143
|
+
{
|
|
1144
|
+
const s = Ra(t).reduce((a, r) => [...a, Ft(e, r)], []);
|
|
1145
|
+
return e.normalize(s);
|
|
1146
|
+
}
|
|
1147
|
+
}
|
|
1148
|
+
function Ft(e, t) {
|
|
1149
|
+
const n = Zt(t);
|
|
1150
|
+
switch (n) {
|
|
1151
|
+
case 3:
|
|
1152
|
+
return st(t, n);
|
|
1153
|
+
case 9:
|
|
1154
|
+
return st(t, n);
|
|
1155
|
+
case 4: {
|
|
1156
|
+
const s = t;
|
|
1157
|
+
if (ie(s, "k") && s.k)
|
|
1158
|
+
return e.interpolate(e.named(s.k));
|
|
1159
|
+
if (ie(s, "key") && s.key)
|
|
1160
|
+
return e.interpolate(e.named(s.key));
|
|
1161
|
+
throw Be(n);
|
|
1162
|
+
}
|
|
1163
|
+
case 5: {
|
|
1164
|
+
const s = t;
|
|
1165
|
+
if (ie(s, "i") && j(s.i))
|
|
1166
|
+
return e.interpolate(e.list(s.i));
|
|
1167
|
+
if (ie(s, "index") && j(s.index))
|
|
1168
|
+
return e.interpolate(e.list(s.index));
|
|
1169
|
+
throw Be(n);
|
|
1170
|
+
}
|
|
1171
|
+
case 6: {
|
|
1172
|
+
const s = t, a = Ma(s), r = Fa(s);
|
|
1173
|
+
return e.linked(Ft(e, r), a ? Ft(e, a) : void 0, e.type);
|
|
1174
|
+
}
|
|
1175
|
+
case 7:
|
|
1176
|
+
return st(t, n);
|
|
1177
|
+
case 8:
|
|
1178
|
+
return st(t, n);
|
|
1179
|
+
default:
|
|
1180
|
+
throw new Error(`unhandled node on format message part: ${n}`);
|
|
1181
|
+
}
|
|
1182
|
+
}
|
|
1183
|
+
const Ua = "Detected HTML in '{source}' message. Recommend not using HTML messages to avoid XSS.";
|
|
1184
|
+
function Va(e, t) {
|
|
1185
|
+
t && ra(e) && he(lt(Ua, { source: e }));
|
|
1186
|
+
}
|
|
1187
|
+
const Wa = (e) => e;
|
|
1188
|
+
let at = W();
|
|
1189
|
+
function xa(e, t = {}) {
|
|
1190
|
+
let n = !1;
|
|
1191
|
+
const s = t.onError || sa;
|
|
1192
|
+
return t.onError = (a) => {
|
|
1193
|
+
n = !0, s(a);
|
|
1194
|
+
}, { ...Sa(e, t), detectError: n };
|
|
1195
|
+
}
|
|
1196
|
+
// @__NO_SIDE_EFFECTS__
|
|
1197
|
+
function $a(e, t) {
|
|
1198
|
+
if (!__INTLIFY_DROP_MESSAGE_COMPILER__ && I(e)) {
|
|
1199
|
+
const n = F(t.warnHtmlMessage) ? t.warnHtmlMessage : !0;
|
|
1200
|
+
process.env.NODE_ENV !== "production" && Va(e, n);
|
|
1201
|
+
const a = (t.onCacheKey || Wa)(e), r = at[a];
|
|
1202
|
+
if (r)
|
|
1203
|
+
return r;
|
|
1204
|
+
const { ast: o, detectError: l } = xa(e, {
|
|
1205
|
+
...t,
|
|
1206
|
+
location: process.env.NODE_ENV !== "production",
|
|
1207
|
+
jit: !0
|
|
1208
|
+
}), u = St(o);
|
|
1209
|
+
return l ? u : at[a] = u;
|
|
1210
|
+
} else {
|
|
1211
|
+
if (process.env.NODE_ENV !== "production" && !re(e))
|
|
1212
|
+
return he(`the message that is resolve with key '${t.key}' is not supported for jit compilation`), () => e;
|
|
1213
|
+
const n = e.cacheKey;
|
|
1214
|
+
if (n) {
|
|
1215
|
+
const s = at[n];
|
|
1216
|
+
return s || (at[n] = St(e));
|
|
1217
|
+
} else
|
|
1218
|
+
return St(e);
|
|
1219
|
+
}
|
|
1220
|
+
}
|
|
1221
|
+
let je = null;
|
|
1222
|
+
function Ga(e) {
|
|
1223
|
+
je = e;
|
|
1224
|
+
}
|
|
1225
|
+
function Ya(e, t, n) {
|
|
1226
|
+
je && je.emit("i18n:init", {
|
|
1227
|
+
timestamp: Date.now(),
|
|
1228
|
+
i18n: e,
|
|
1229
|
+
version: t,
|
|
1230
|
+
meta: n
|
|
1231
|
+
});
|
|
1232
|
+
}
|
|
1233
|
+
const Ha = /* @__PURE__ */ Ka("function:translate");
|
|
1234
|
+
function Ka(e) {
|
|
1235
|
+
return (t) => je && je.emit(e, t);
|
|
1236
|
+
}
|
|
1237
|
+
const q = {
|
|
1238
|
+
INVALID_ARGUMENT: ta,
|
|
1239
|
+
// 17
|
|
1240
|
+
INVALID_DATE_ARGUMENT: 18,
|
|
1241
|
+
INVALID_ISO_DATE_ARGUMENT: 19,
|
|
1242
|
+
NOT_SUPPORT_NON_STRING_MESSAGE: 20,
|
|
1243
|
+
NOT_SUPPORT_LOCALE_PROMISE_VALUE: 21,
|
|
1244
|
+
NOT_SUPPORT_LOCALE_ASYNC_FUNCTION: 22,
|
|
1245
|
+
NOT_SUPPORT_LOCALE_TYPE: 23
|
|
1246
|
+
}, Ba = 24;
|
|
1247
|
+
function Ee(e) {
|
|
1248
|
+
return Ve(e, null, process.env.NODE_ENV !== "production" ? { messages: ja } : void 0);
|
|
1249
|
+
}
|
|
1250
|
+
const ja = {
|
|
1251
|
+
[q.INVALID_ARGUMENT]: "Invalid arguments",
|
|
1252
|
+
[q.INVALID_DATE_ARGUMENT]: "The date provided is an invalid Date object.Make sure your Date represents a valid date.",
|
|
1253
|
+
[q.INVALID_ISO_DATE_ARGUMENT]: "The argument provided is not a valid ISO date string",
|
|
1254
|
+
[q.NOT_SUPPORT_NON_STRING_MESSAGE]: "Not support non-string message",
|
|
1255
|
+
[q.NOT_SUPPORT_LOCALE_PROMISE_VALUE]: "cannot support promise value",
|
|
1256
|
+
[q.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION]: "cannot support async function",
|
|
1257
|
+
[q.NOT_SUPPORT_LOCALE_TYPE]: "cannot support locale type"
|
|
1258
|
+
};
|
|
1259
|
+
function zt(e, t) {
|
|
1260
|
+
return t.locale != null ? Tn(t.locale) : Tn(e.locale);
|
|
1261
|
+
}
|
|
1262
|
+
let Ct;
|
|
1263
|
+
function Tn(e) {
|
|
1264
|
+
if (I(e))
|
|
1265
|
+
return e;
|
|
1266
|
+
if ($(e)) {
|
|
1267
|
+
if (e.resolvedOnce && Ct != null)
|
|
1268
|
+
return Ct;
|
|
1269
|
+
if (e.constructor.name === "Function") {
|
|
1270
|
+
const t = e();
|
|
1271
|
+
if (qs(t))
|
|
1272
|
+
throw Ee(q.NOT_SUPPORT_LOCALE_PROMISE_VALUE);
|
|
1273
|
+
return Ct = t;
|
|
1274
|
+
} else
|
|
1275
|
+
throw Ee(q.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION);
|
|
1276
|
+
} else
|
|
1277
|
+
throw Ee(q.NOT_SUPPORT_LOCALE_TYPE);
|
|
1278
|
+
}
|
|
1279
|
+
function Xa(e, t, n) {
|
|
1280
|
+
return [.../* @__PURE__ */ new Set([
|
|
1281
|
+
n,
|
|
1282
|
+
...B(t) ? t : M(t) ? Object.keys(t) : I(t) ? [t] : [n]
|
|
1283
|
+
])];
|
|
1284
|
+
}
|
|
1285
|
+
function ls(e, t, n) {
|
|
1286
|
+
const s = I(n) ? n : Xe, a = e;
|
|
1287
|
+
a.__localeChainCache || (a.__localeChainCache = /* @__PURE__ */ new Map());
|
|
1288
|
+
let r = a.__localeChainCache.get(s);
|
|
1289
|
+
if (!r) {
|
|
1290
|
+
r = [];
|
|
1291
|
+
let o = [n];
|
|
1292
|
+
for (; B(o); )
|
|
1293
|
+
o = Ln(r, o, t);
|
|
1294
|
+
const l = B(t) || !R(t) ? t : t.default ? t.default : null;
|
|
1295
|
+
o = I(l) ? [l] : l, B(o) && Ln(r, o, !1), a.__localeChainCache.set(s, r);
|
|
1296
|
+
}
|
|
1297
|
+
return r;
|
|
1298
|
+
}
|
|
1299
|
+
function Ln(e, t, n) {
|
|
1300
|
+
let s = !0;
|
|
1301
|
+
for (let a = 0; a < t.length && F(s); a++) {
|
|
1302
|
+
const r = t[a];
|
|
1303
|
+
I(r) && (s = Ja(e, t[a], n));
|
|
1304
|
+
}
|
|
1305
|
+
return s;
|
|
1306
|
+
}
|
|
1307
|
+
function Ja(e, t, n) {
|
|
1308
|
+
let s;
|
|
1309
|
+
const a = t.split("-");
|
|
1310
|
+
do {
|
|
1311
|
+
const r = a.join("-");
|
|
1312
|
+
s = Qa(e, r, n), a.splice(-1, 1);
|
|
1313
|
+
} while (a.length && s === !0);
|
|
1314
|
+
return s;
|
|
1315
|
+
}
|
|
1316
|
+
function Qa(e, t, n) {
|
|
1317
|
+
let s = !1;
|
|
1318
|
+
if (!e.includes(t) && (s = !0, t)) {
|
|
1319
|
+
s = t[t.length - 1] !== "!";
|
|
1320
|
+
const a = t.replace(/!/g, "");
|
|
1321
|
+
e.push(a), (B(n) || R(n)) && n[a] && (s = n[a]);
|
|
1322
|
+
}
|
|
1323
|
+
return s;
|
|
1324
|
+
}
|
|
1325
|
+
const Te = [];
|
|
1326
|
+
Te[
|
|
1327
|
+
0
|
|
1328
|
+
/* States.BEFORE_PATH */
|
|
1329
|
+
] = {
|
|
1330
|
+
w: [
|
|
1331
|
+
0
|
|
1332
|
+
/* States.BEFORE_PATH */
|
|
1333
|
+
],
|
|
1334
|
+
i: [
|
|
1335
|
+
3,
|
|
1336
|
+
0
|
|
1337
|
+
/* Actions.APPEND */
|
|
1338
|
+
],
|
|
1339
|
+
"[": [
|
|
1340
|
+
4
|
|
1341
|
+
/* States.IN_SUB_PATH */
|
|
1342
|
+
],
|
|
1343
|
+
o: [
|
|
1344
|
+
7
|
|
1345
|
+
/* States.AFTER_PATH */
|
|
1346
|
+
]
|
|
1347
|
+
};
|
|
1348
|
+
Te[
|
|
1349
|
+
1
|
|
1350
|
+
/* States.IN_PATH */
|
|
1351
|
+
] = {
|
|
1352
|
+
w: [
|
|
1353
|
+
1
|
|
1354
|
+
/* States.IN_PATH */
|
|
1355
|
+
],
|
|
1356
|
+
".": [
|
|
1357
|
+
2
|
|
1358
|
+
/* States.BEFORE_IDENT */
|
|
1359
|
+
],
|
|
1360
|
+
"[": [
|
|
1361
|
+
4
|
|
1362
|
+
/* States.IN_SUB_PATH */
|
|
1363
|
+
],
|
|
1364
|
+
o: [
|
|
1365
|
+
7
|
|
1366
|
+
/* States.AFTER_PATH */
|
|
1367
|
+
]
|
|
1368
|
+
};
|
|
1369
|
+
Te[
|
|
1370
|
+
2
|
|
1371
|
+
/* States.BEFORE_IDENT */
|
|
1372
|
+
] = {
|
|
1373
|
+
w: [
|
|
1374
|
+
2
|
|
1375
|
+
/* States.BEFORE_IDENT */
|
|
1376
|
+
],
|
|
1377
|
+
i: [
|
|
1378
|
+
3,
|
|
1379
|
+
0
|
|
1380
|
+
/* Actions.APPEND */
|
|
1381
|
+
],
|
|
1382
|
+
0: [
|
|
1383
|
+
3,
|
|
1384
|
+
0
|
|
1385
|
+
/* Actions.APPEND */
|
|
1386
|
+
]
|
|
1387
|
+
};
|
|
1388
|
+
Te[
|
|
1389
|
+
3
|
|
1390
|
+
/* States.IN_IDENT */
|
|
1391
|
+
] = {
|
|
1392
|
+
i: [
|
|
1393
|
+
3,
|
|
1394
|
+
0
|
|
1395
|
+
/* Actions.APPEND */
|
|
1396
|
+
],
|
|
1397
|
+
0: [
|
|
1398
|
+
3,
|
|
1399
|
+
0
|
|
1400
|
+
/* Actions.APPEND */
|
|
1401
|
+
],
|
|
1402
|
+
w: [
|
|
1403
|
+
1,
|
|
1404
|
+
1
|
|
1405
|
+
/* Actions.PUSH */
|
|
1406
|
+
],
|
|
1407
|
+
".": [
|
|
1408
|
+
2,
|
|
1409
|
+
1
|
|
1410
|
+
/* Actions.PUSH */
|
|
1411
|
+
],
|
|
1412
|
+
"[": [
|
|
1413
|
+
4,
|
|
1414
|
+
1
|
|
1415
|
+
/* Actions.PUSH */
|
|
1416
|
+
],
|
|
1417
|
+
o: [
|
|
1418
|
+
7,
|
|
1419
|
+
1
|
|
1420
|
+
/* Actions.PUSH */
|
|
1421
|
+
]
|
|
1422
|
+
};
|
|
1423
|
+
Te[
|
|
1424
|
+
4
|
|
1425
|
+
/* States.IN_SUB_PATH */
|
|
1426
|
+
] = {
|
|
1427
|
+
"'": [
|
|
1428
|
+
5,
|
|
1429
|
+
0
|
|
1430
|
+
/* Actions.APPEND */
|
|
1431
|
+
],
|
|
1432
|
+
'"': [
|
|
1433
|
+
6,
|
|
1434
|
+
0
|
|
1435
|
+
/* Actions.APPEND */
|
|
1436
|
+
],
|
|
1437
|
+
"[": [
|
|
1438
|
+
4,
|
|
1439
|
+
2
|
|
1440
|
+
/* Actions.INC_SUB_PATH_DEPTH */
|
|
1441
|
+
],
|
|
1442
|
+
"]": [
|
|
1443
|
+
1,
|
|
1444
|
+
3
|
|
1445
|
+
/* Actions.PUSH_SUB_PATH */
|
|
1446
|
+
],
|
|
1447
|
+
o: 8,
|
|
1448
|
+
l: [
|
|
1449
|
+
4,
|
|
1450
|
+
0
|
|
1451
|
+
/* Actions.APPEND */
|
|
1452
|
+
]
|
|
1453
|
+
};
|
|
1454
|
+
Te[
|
|
1455
|
+
5
|
|
1456
|
+
/* States.IN_SINGLE_QUOTE */
|
|
1457
|
+
] = {
|
|
1458
|
+
"'": [
|
|
1459
|
+
4,
|
|
1460
|
+
0
|
|
1461
|
+
/* Actions.APPEND */
|
|
1462
|
+
],
|
|
1463
|
+
o: 8,
|
|
1464
|
+
l: [
|
|
1465
|
+
5,
|
|
1466
|
+
0
|
|
1467
|
+
/* Actions.APPEND */
|
|
1468
|
+
]
|
|
1469
|
+
};
|
|
1470
|
+
Te[
|
|
1471
|
+
6
|
|
1472
|
+
/* States.IN_DOUBLE_QUOTE */
|
|
1473
|
+
] = {
|
|
1474
|
+
'"': [
|
|
1475
|
+
4,
|
|
1476
|
+
0
|
|
1477
|
+
/* Actions.APPEND */
|
|
1478
|
+
],
|
|
1479
|
+
o: 8,
|
|
1480
|
+
l: [
|
|
1481
|
+
6,
|
|
1482
|
+
0
|
|
1483
|
+
/* Actions.APPEND */
|
|
1484
|
+
]
|
|
1485
|
+
};
|
|
1486
|
+
const qa = /^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;
|
|
1487
|
+
function Za(e) {
|
|
1488
|
+
return qa.test(e);
|
|
1489
|
+
}
|
|
1490
|
+
function za(e) {
|
|
1491
|
+
const t = e.charCodeAt(0), n = e.charCodeAt(e.length - 1);
|
|
1492
|
+
return t === n && (t === 34 || t === 39) ? e.slice(1, -1) : e;
|
|
1493
|
+
}
|
|
1494
|
+
function er(e) {
|
|
1495
|
+
if (e == null)
|
|
1496
|
+
return "o";
|
|
1497
|
+
switch (e.charCodeAt(0)) {
|
|
1498
|
+
case 91:
|
|
1499
|
+
// [
|
|
1500
|
+
case 93:
|
|
1501
|
+
// ]
|
|
1502
|
+
case 46:
|
|
1503
|
+
// .
|
|
1504
|
+
case 34:
|
|
1505
|
+
// "
|
|
1506
|
+
case 39:
|
|
1507
|
+
return e;
|
|
1508
|
+
case 95:
|
|
1509
|
+
// _
|
|
1510
|
+
case 36:
|
|
1511
|
+
// $
|
|
1512
|
+
case 45:
|
|
1513
|
+
return "i";
|
|
1514
|
+
case 9:
|
|
1515
|
+
// Tab (HT)
|
|
1516
|
+
case 10:
|
|
1517
|
+
// Newline (LF)
|
|
1518
|
+
case 13:
|
|
1519
|
+
// Return (CR)
|
|
1520
|
+
case 160:
|
|
1521
|
+
// No-break space (NBSP)
|
|
1522
|
+
case 65279:
|
|
1523
|
+
// Byte Order Mark (BOM)
|
|
1524
|
+
case 8232:
|
|
1525
|
+
// Line Separator (LS)
|
|
1526
|
+
case 8233:
|
|
1527
|
+
return "w";
|
|
1528
|
+
}
|
|
1529
|
+
return "i";
|
|
1530
|
+
}
|
|
1531
|
+
function tr(e) {
|
|
1532
|
+
const t = e.trim();
|
|
1533
|
+
return e.charAt(0) === "0" && isNaN(parseInt(e)) ? !1 : Za(t) ? za(t) : "*" + t;
|
|
1534
|
+
}
|
|
1535
|
+
function nr(e) {
|
|
1536
|
+
const t = [];
|
|
1537
|
+
let n = -1, s = 0, a = 0, r, o, l, u, _, N, T;
|
|
1538
|
+
const E = [];
|
|
1539
|
+
E[
|
|
1540
|
+
0
|
|
1541
|
+
/* Actions.APPEND */
|
|
1542
|
+
] = () => {
|
|
1543
|
+
o === void 0 ? o = l : o += l;
|
|
1544
|
+
}, E[
|
|
1545
|
+
1
|
|
1546
|
+
/* Actions.PUSH */
|
|
1547
|
+
] = () => {
|
|
1548
|
+
o !== void 0 && (t.push(o), o = void 0);
|
|
1549
|
+
}, E[
|
|
1550
|
+
2
|
|
1551
|
+
/* Actions.INC_SUB_PATH_DEPTH */
|
|
1552
|
+
] = () => {
|
|
1553
|
+
E[
|
|
1554
|
+
0
|
|
1555
|
+
/* Actions.APPEND */
|
|
1556
|
+
](), a++;
|
|
1557
|
+
}, E[
|
|
1558
|
+
3
|
|
1559
|
+
/* Actions.PUSH_SUB_PATH */
|
|
1560
|
+
] = () => {
|
|
1561
|
+
if (a > 0)
|
|
1562
|
+
a--, s = 4, E[
|
|
1563
|
+
0
|
|
1564
|
+
/* Actions.APPEND */
|
|
1565
|
+
]();
|
|
1566
|
+
else {
|
|
1567
|
+
if (a = 0, o === void 0 || (o = tr(o), o === !1))
|
|
1568
|
+
return !1;
|
|
1569
|
+
E[
|
|
1570
|
+
1
|
|
1571
|
+
/* Actions.PUSH */
|
|
1572
|
+
]();
|
|
1573
|
+
}
|
|
1574
|
+
};
|
|
1575
|
+
function A() {
|
|
1576
|
+
const C = e[n + 1];
|
|
1577
|
+
if (s === 5 && C === "'" || s === 6 && C === '"')
|
|
1578
|
+
return n++, l = "\\" + C, E[
|
|
1579
|
+
0
|
|
1580
|
+
/* Actions.APPEND */
|
|
1581
|
+
](), !0;
|
|
1582
|
+
}
|
|
1583
|
+
for (; s !== null; )
|
|
1584
|
+
if (n++, r = e[n], !(r === "\\" && A())) {
|
|
1585
|
+
if (u = er(r), T = Te[s], _ = T[u] || T.l || 8, _ === 8 || (s = _[0], _[1] !== void 0 && (N = E[_[1]], N && (l = r, N() === !1))))
|
|
1586
|
+
return;
|
|
1587
|
+
if (s === 7)
|
|
1588
|
+
return t;
|
|
1589
|
+
}
|
|
1590
|
+
}
|
|
1591
|
+
const bn = /* @__PURE__ */ new Map();
|
|
1592
|
+
function sr(e, t) {
|
|
1593
|
+
return M(e) ? e[t] : null;
|
|
1594
|
+
}
|
|
1595
|
+
function ar(e, t) {
|
|
1596
|
+
if (!M(e))
|
|
1597
|
+
return null;
|
|
1598
|
+
let n = bn.get(t);
|
|
1599
|
+
if (n || (n = nr(t), n && bn.set(t, n)), !n)
|
|
1600
|
+
return null;
|
|
1601
|
+
const s = n.length;
|
|
1602
|
+
let a = e, r = 0;
|
|
1603
|
+
for (; r < s; ) {
|
|
1604
|
+
const o = n[r];
|
|
1605
|
+
if (os.includes(o) && re(a))
|
|
1606
|
+
return null;
|
|
1607
|
+
const l = a[o];
|
|
1608
|
+
if (l === void 0 || $(a))
|
|
1609
|
+
return null;
|
|
1610
|
+
a = l, r++;
|
|
1611
|
+
}
|
|
1612
|
+
return a;
|
|
1613
|
+
}
|
|
1614
|
+
const z = {
|
|
1615
|
+
NOT_FOUND_KEY: 1,
|
|
1616
|
+
FALLBACK_TO_TRANSLATE: 2,
|
|
1617
|
+
CANNOT_FORMAT_NUMBER: 3,
|
|
1618
|
+
FALLBACK_TO_NUMBER_FORMAT: 4,
|
|
1619
|
+
CANNOT_FORMAT_DATE: 5,
|
|
1620
|
+
FALLBACK_TO_DATE_FORMAT: 6,
|
|
1621
|
+
EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER: 7
|
|
1622
|
+
}, rr = 8, or = {
|
|
1623
|
+
[z.NOT_FOUND_KEY]: "Not found '{key}' key in '{locale}' locale messages.",
|
|
1624
|
+
[z.FALLBACK_TO_TRANSLATE]: "Fall back to translate '{key}' key with '{target}' locale.",
|
|
1625
|
+
[z.CANNOT_FORMAT_NUMBER]: "Cannot format a number value due to not supported Intl.NumberFormat.",
|
|
1626
|
+
[z.FALLBACK_TO_NUMBER_FORMAT]: "Fall back to number format '{key}' key with '{target}' locale.",
|
|
1627
|
+
[z.CANNOT_FORMAT_DATE]: "Cannot format a date value due to not supported Intl.DateTimeFormat.",
|
|
1628
|
+
[z.FALLBACK_TO_DATE_FORMAT]: "Fall back to datetime format '{key}' key with '{target}' locale.",
|
|
1629
|
+
[z.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER]: "This project is using Custom Message Compiler, which is an experimental feature. It may receive breaking changes or be removed in the future."
|
|
1630
|
+
};
|
|
1631
|
+
function Ce(e, ...t) {
|
|
1632
|
+
return lt(or[e], ...t);
|
|
1633
|
+
}
|
|
1634
|
+
const lr = "11.1.3", ct = -1, Xe = "en-US", ot = "", On = (e) => `${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;
|
|
1635
|
+
function ir() {
|
|
1636
|
+
return {
|
|
1637
|
+
upper: (e, t) => t === "text" && I(e) ? e.toUpperCase() : t === "vnode" && M(e) && "__v_isVNode" in e ? e.children.toUpperCase() : e,
|
|
1638
|
+
lower: (e, t) => t === "text" && I(e) ? e.toLowerCase() : t === "vnode" && M(e) && "__v_isVNode" in e ? e.children.toLowerCase() : e,
|
|
1639
|
+
capitalize: (e, t) => t === "text" && I(e) ? On(e) : t === "vnode" && M(e) && "__v_isVNode" in e ? On(e.children) : e
|
|
1640
|
+
};
|
|
1641
|
+
}
|
|
1642
|
+
let is;
|
|
1643
|
+
function cr(e) {
|
|
1644
|
+
is = e;
|
|
1645
|
+
}
|
|
1646
|
+
let cs;
|
|
1647
|
+
function ur(e) {
|
|
1648
|
+
cs = e;
|
|
1649
|
+
}
|
|
1650
|
+
let us;
|
|
1651
|
+
function fr(e) {
|
|
1652
|
+
us = e;
|
|
1653
|
+
}
|
|
1654
|
+
let fs = null;
|
|
1655
|
+
const _r = /* @__NO_SIDE_EFFECTS__ */ (e) => {
|
|
1656
|
+
fs = e;
|
|
1657
|
+
}, mr = /* @__NO_SIDE_EFFECTS__ */ () => fs;
|
|
1658
|
+
let _s = null;
|
|
1659
|
+
const In = (e) => {
|
|
1660
|
+
_s = e;
|
|
1661
|
+
}, dr = () => _s;
|
|
1662
|
+
let vn = 0;
|
|
1663
|
+
function gr(e = {}) {
|
|
1664
|
+
const t = $(e.onWarn) ? e.onWarn : he, n = I(e.version) ? e.version : lr, s = I(e.locale) || $(e.locale) ? e.locale : Xe, a = $(s) ? Xe : s, r = B(e.fallbackLocale) || R(e.fallbackLocale) || I(e.fallbackLocale) || e.fallbackLocale === !1 ? e.fallbackLocale : a, o = R(e.messages) ? e.messages : Dt(a), l = R(e.datetimeFormats) ? e.datetimeFormats : Dt(a), u = R(e.numberFormats) ? e.numberFormats : Dt(a), _ = Q(W(), e.modifiers, ir()), N = e.pluralRules || W(), T = $(e.missing) ? e.missing : null, E = F(e.missingWarn) || we(e.missingWarn) ? e.missingWarn : !0, A = F(e.fallbackWarn) || we(e.fallbackWarn) ? e.fallbackWarn : !0, C = !!e.fallbackFormat, y = !!e.unresolving, S = $(e.postTranslation) ? e.postTranslation : null, f = R(e.processor) ? e.processor : null, d = F(e.warnHtmlMessage) ? e.warnHtmlMessage : !0, b = !!e.escapeParameter, g = $(e.messageCompiler) ? e.messageCompiler : is;
|
|
1665
|
+
process.env.NODE_ENV !== "production" && $(e.messageCompiler) && Jt(Ce(z.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER));
|
|
1666
|
+
const O = $(e.messageResolver) ? e.messageResolver : cs || sr, v = $(e.localeFallbacker) ? e.localeFallbacker : us || Xa, p = M(e.fallbackContext) ? e.fallbackContext : void 0, P = e, U = M(P.__datetimeFormatters) ? P.__datetimeFormatters : /* @__PURE__ */ new Map(), X = M(P.__numberFormatters) ? P.__numberFormatters : /* @__PURE__ */ new Map(), oe = M(P.__meta) ? P.__meta : {};
|
|
1667
|
+
vn++;
|
|
1668
|
+
const J = {
|
|
1669
|
+
version: n,
|
|
1670
|
+
cid: vn,
|
|
1671
|
+
locale: s,
|
|
1672
|
+
fallbackLocale: r,
|
|
1673
|
+
messages: o,
|
|
1674
|
+
modifiers: _,
|
|
1675
|
+
pluralRules: N,
|
|
1676
|
+
missing: T,
|
|
1677
|
+
missingWarn: E,
|
|
1678
|
+
fallbackWarn: A,
|
|
1679
|
+
fallbackFormat: C,
|
|
1680
|
+
unresolving: y,
|
|
1681
|
+
postTranslation: S,
|
|
1682
|
+
processor: f,
|
|
1683
|
+
warnHtmlMessage: d,
|
|
1684
|
+
escapeParameter: b,
|
|
1685
|
+
messageCompiler: g,
|
|
1686
|
+
messageResolver: O,
|
|
1687
|
+
localeFallbacker: v,
|
|
1688
|
+
fallbackContext: p,
|
|
1689
|
+
onWarn: t,
|
|
1690
|
+
__meta: oe
|
|
1691
|
+
};
|
|
1692
|
+
return J.datetimeFormats = l, J.numberFormats = u, J.__datetimeFormatters = U, J.__numberFormatters = X, process.env.NODE_ENV !== "production" && (J.__v_emitter = P.__v_emitter != null ? P.__v_emitter : void 0), (process.env.NODE_ENV !== "production" || __INTLIFY_PROD_DEVTOOLS__) && Ya(J, n, oe), J;
|
|
1693
|
+
}
|
|
1694
|
+
const Dt = (e) => ({ [e]: W() });
|
|
1695
|
+
function ut(e, t) {
|
|
1696
|
+
return e instanceof RegExp ? e.test(t) : e;
|
|
1697
|
+
}
|
|
1698
|
+
function ms(e, t) {
|
|
1699
|
+
return e instanceof RegExp ? e.test(t) : e;
|
|
1700
|
+
}
|
|
1701
|
+
function en(e, t, n, s, a) {
|
|
1702
|
+
const { missing: r, onWarn: o } = e;
|
|
1703
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1704
|
+
const l = e.__v_emitter;
|
|
1705
|
+
l && l.emit("missing", {
|
|
1706
|
+
locale: n,
|
|
1707
|
+
key: t,
|
|
1708
|
+
type: a,
|
|
1709
|
+
groupId: `${a}:${t}`
|
|
1710
|
+
});
|
|
1711
|
+
}
|
|
1712
|
+
if (r !== null) {
|
|
1713
|
+
const l = r(e, n, t, a);
|
|
1714
|
+
return I(l) ? l : t;
|
|
1715
|
+
} else
|
|
1716
|
+
return process.env.NODE_ENV !== "production" && ms(s, t) && o(Ce(z.NOT_FOUND_KEY, { key: t, locale: n })), t;
|
|
1717
|
+
}
|
|
1718
|
+
function He(e, t, n) {
|
|
1719
|
+
const s = e;
|
|
1720
|
+
s.__localeChainCache = /* @__PURE__ */ new Map(), e.localeFallbacker(e, n, t);
|
|
1721
|
+
}
|
|
1722
|
+
function ds(e, t) {
|
|
1723
|
+
return e === t ? !1 : e.split("-")[0] === t.split("-")[0];
|
|
1724
|
+
}
|
|
1725
|
+
function Er(e, t) {
|
|
1726
|
+
const n = t.indexOf(e);
|
|
1727
|
+
if (n === -1)
|
|
1728
|
+
return !1;
|
|
1729
|
+
for (let s = n + 1; s < t.length; s++)
|
|
1730
|
+
if (ds(e, t[s]))
|
|
1731
|
+
return !0;
|
|
1732
|
+
return !1;
|
|
1733
|
+
}
|
|
1734
|
+
const yn = typeof Intl < "u", gs = {
|
|
1735
|
+
dateTimeFormat: yn && typeof Intl.DateTimeFormat < "u",
|
|
1736
|
+
numberFormat: yn && typeof Intl.NumberFormat < "u"
|
|
1737
|
+
};
|
|
1738
|
+
function An(e, ...t) {
|
|
1739
|
+
const { datetimeFormats: n, unresolving: s, fallbackLocale: a, onWarn: r, localeFallbacker: o } = e, { __datetimeFormatters: l } = e;
|
|
1740
|
+
if (process.env.NODE_ENV !== "production" && !gs.dateTimeFormat)
|
|
1741
|
+
return r(Ce(z.CANNOT_FORMAT_DATE)), ot;
|
|
1742
|
+
const [u, _, N, T] = wt(...t), E = F(N.missingWarn) ? N.missingWarn : e.missingWarn, A = F(N.fallbackWarn) ? N.fallbackWarn : e.fallbackWarn, C = !!N.part, y = zt(e, N), S = o(
|
|
1743
|
+
e,
|
|
1744
|
+
// eslint-disable-line @typescript-eslint/no-explicit-any
|
|
1745
|
+
a,
|
|
1746
|
+
y
|
|
1747
|
+
);
|
|
1748
|
+
if (!I(u) || u === "")
|
|
1749
|
+
return new Intl.DateTimeFormat(y, T).format(_);
|
|
1750
|
+
let f = {}, d, b = null, g = y, O = null;
|
|
1751
|
+
const v = "datetime format";
|
|
1752
|
+
for (let U = 0; U < S.length; U++) {
|
|
1753
|
+
if (d = O = S[U], process.env.NODE_ENV !== "production" && y !== d && ut(A, u) && r(Ce(z.FALLBACK_TO_DATE_FORMAT, {
|
|
1754
|
+
key: u,
|
|
1755
|
+
target: d
|
|
1756
|
+
})), process.env.NODE_ENV !== "production" && y !== d) {
|
|
1757
|
+
const X = e.__v_emitter;
|
|
1758
|
+
X && X.emit("fallback", {
|
|
1759
|
+
type: v,
|
|
1760
|
+
key: u,
|
|
1761
|
+
from: g,
|
|
1762
|
+
to: O,
|
|
1763
|
+
groupId: `${v}:${u}`
|
|
1764
|
+
});
|
|
1765
|
+
}
|
|
1766
|
+
if (f = n[d] || {}, b = f[u], R(b))
|
|
1767
|
+
break;
|
|
1768
|
+
en(e, u, d, E, v), g = O;
|
|
1769
|
+
}
|
|
1770
|
+
if (!R(b) || !I(d))
|
|
1771
|
+
return s ? ct : u;
|
|
1772
|
+
let p = `${d}__${u}`;
|
|
1773
|
+
it(T) || (p = `${p}__${JSON.stringify(T)}`);
|
|
1774
|
+
let P = l.get(p);
|
|
1775
|
+
return P || (P = new Intl.DateTimeFormat(d, Q({}, b, T)), l.set(p, P)), C ? P.formatToParts(_) : P.format(_);
|
|
1776
|
+
}
|
|
1777
|
+
const Es = [
|
|
1778
|
+
"localeMatcher",
|
|
1779
|
+
"weekday",
|
|
1780
|
+
"era",
|
|
1781
|
+
"year",
|
|
1782
|
+
"month",
|
|
1783
|
+
"day",
|
|
1784
|
+
"hour",
|
|
1785
|
+
"minute",
|
|
1786
|
+
"second",
|
|
1787
|
+
"timeZoneName",
|
|
1788
|
+
"formatMatcher",
|
|
1789
|
+
"hour12",
|
|
1790
|
+
"timeZone",
|
|
1791
|
+
"dateStyle",
|
|
1792
|
+
"timeStyle",
|
|
1793
|
+
"calendar",
|
|
1794
|
+
"dayPeriod",
|
|
1795
|
+
"numberingSystem",
|
|
1796
|
+
"hourCycle",
|
|
1797
|
+
"fractionalSecondDigits"
|
|
1798
|
+
];
|
|
1799
|
+
function wt(...e) {
|
|
1800
|
+
const [t, n, s, a] = e, r = W();
|
|
1801
|
+
let o = W(), l;
|
|
1802
|
+
if (I(t)) {
|
|
1803
|
+
const u = t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);
|
|
1804
|
+
if (!u)
|
|
1805
|
+
throw Ee(q.INVALID_ISO_DATE_ARGUMENT);
|
|
1806
|
+
const _ = u[3] ? u[3].trim().startsWith("T") ? `${u[1].trim()}${u[3].trim()}` : `${u[1].trim()}T${u[3].trim()}` : u[1].trim();
|
|
1807
|
+
l = new Date(_);
|
|
1808
|
+
try {
|
|
1809
|
+
l.toISOString();
|
|
1810
|
+
} catch {
|
|
1811
|
+
throw Ee(q.INVALID_ISO_DATE_ARGUMENT);
|
|
1812
|
+
}
|
|
1813
|
+
} else if (Xs(t)) {
|
|
1814
|
+
if (isNaN(t.getTime()))
|
|
1815
|
+
throw Ee(q.INVALID_DATE_ARGUMENT);
|
|
1816
|
+
l = t;
|
|
1817
|
+
} else if (j(t))
|
|
1818
|
+
l = t;
|
|
1819
|
+
else
|
|
1820
|
+
throw Ee(q.INVALID_ARGUMENT);
|
|
1821
|
+
return I(n) ? r.key = n : R(n) && Object.keys(n).forEach((u) => {
|
|
1822
|
+
Es.includes(u) ? o[u] = n[u] : r[u] = n[u];
|
|
1823
|
+
}), I(s) ? r.locale = s : R(s) && (o = s), R(a) && (o = a), [r.key || "", l, r, o];
|
|
1824
|
+
}
|
|
1825
|
+
function Sn(e, t, n) {
|
|
1826
|
+
const s = e;
|
|
1827
|
+
for (const a in n) {
|
|
1828
|
+
const r = `${t}__${a}`;
|
|
1829
|
+
s.__datetimeFormatters.has(r) && s.__datetimeFormatters.delete(r);
|
|
1830
|
+
}
|
|
1831
|
+
}
|
|
1832
|
+
function Cn(e, ...t) {
|
|
1833
|
+
const { numberFormats: n, unresolving: s, fallbackLocale: a, onWarn: r, localeFallbacker: o } = e, { __numberFormatters: l } = e;
|
|
1834
|
+
if (process.env.NODE_ENV !== "production" && !gs.numberFormat)
|
|
1835
|
+
return r(Ce(z.CANNOT_FORMAT_NUMBER)), ot;
|
|
1836
|
+
const [u, _, N, T] = Ut(...t), E = F(N.missingWarn) ? N.missingWarn : e.missingWarn, A = F(N.fallbackWarn) ? N.fallbackWarn : e.fallbackWarn, C = !!N.part, y = zt(e, N), S = o(
|
|
1837
|
+
e,
|
|
1838
|
+
// eslint-disable-line @typescript-eslint/no-explicit-any
|
|
1839
|
+
a,
|
|
1840
|
+
y
|
|
1841
|
+
);
|
|
1842
|
+
if (!I(u) || u === "")
|
|
1843
|
+
return new Intl.NumberFormat(y, T).format(_);
|
|
1844
|
+
let f = {}, d, b = null, g = y, O = null;
|
|
1845
|
+
const v = "number format";
|
|
1846
|
+
for (let U = 0; U < S.length; U++) {
|
|
1847
|
+
if (d = O = S[U], process.env.NODE_ENV !== "production" && y !== d && ut(A, u) && r(Ce(z.FALLBACK_TO_NUMBER_FORMAT, {
|
|
1848
|
+
key: u,
|
|
1849
|
+
target: d
|
|
1850
|
+
})), process.env.NODE_ENV !== "production" && y !== d) {
|
|
1851
|
+
const X = e.__v_emitter;
|
|
1852
|
+
X && X.emit("fallback", {
|
|
1853
|
+
type: v,
|
|
1854
|
+
key: u,
|
|
1855
|
+
from: g,
|
|
1856
|
+
to: O,
|
|
1857
|
+
groupId: `${v}:${u}`
|
|
1858
|
+
});
|
|
1859
|
+
}
|
|
1860
|
+
if (f = n[d] || {}, b = f[u], R(b))
|
|
1861
|
+
break;
|
|
1862
|
+
en(e, u, d, E, v), g = O;
|
|
1863
|
+
}
|
|
1864
|
+
if (!R(b) || !I(d))
|
|
1865
|
+
return s ? ct : u;
|
|
1866
|
+
let p = `${d}__${u}`;
|
|
1867
|
+
it(T) || (p = `${p}__${JSON.stringify(T)}`);
|
|
1868
|
+
let P = l.get(p);
|
|
1869
|
+
return P || (P = new Intl.NumberFormat(d, Q({}, b, T)), l.set(p, P)), C ? P.formatToParts(_) : P.format(_);
|
|
1870
|
+
}
|
|
1871
|
+
const ps = [
|
|
1872
|
+
"localeMatcher",
|
|
1873
|
+
"style",
|
|
1874
|
+
"currency",
|
|
1875
|
+
"currencyDisplay",
|
|
1876
|
+
"currencySign",
|
|
1877
|
+
"useGrouping",
|
|
1878
|
+
"minimumIntegerDigits",
|
|
1879
|
+
"minimumFractionDigits",
|
|
1880
|
+
"maximumFractionDigits",
|
|
1881
|
+
"minimumSignificantDigits",
|
|
1882
|
+
"maximumSignificantDigits",
|
|
1883
|
+
"compactDisplay",
|
|
1884
|
+
"notation",
|
|
1885
|
+
"signDisplay",
|
|
1886
|
+
"unit",
|
|
1887
|
+
"unitDisplay",
|
|
1888
|
+
"roundingMode",
|
|
1889
|
+
"roundingPriority",
|
|
1890
|
+
"roundingIncrement",
|
|
1891
|
+
"trailingZeroDisplay"
|
|
1892
|
+
];
|
|
1893
|
+
function Ut(...e) {
|
|
1894
|
+
const [t, n, s, a] = e, r = W();
|
|
1895
|
+
let o = W();
|
|
1896
|
+
if (!j(t))
|
|
1897
|
+
throw Ee(q.INVALID_ARGUMENT);
|
|
1898
|
+
const l = t;
|
|
1899
|
+
return I(n) ? r.key = n : R(n) && Object.keys(n).forEach((u) => {
|
|
1900
|
+
ps.includes(u) ? o[u] = n[u] : r[u] = n[u];
|
|
1901
|
+
}), I(s) ? r.locale = s : R(s) && (o = s), R(a) && (o = a), [r.key || "", l, r, o];
|
|
1902
|
+
}
|
|
1903
|
+
function Dn(e, t, n) {
|
|
1904
|
+
const s = e;
|
|
1905
|
+
for (const a in n) {
|
|
1906
|
+
const r = `${t}__${a}`;
|
|
1907
|
+
s.__numberFormatters.has(r) && s.__numberFormatters.delete(r);
|
|
1908
|
+
}
|
|
1909
|
+
}
|
|
1910
|
+
const pr = (e) => e, hr = (e) => "", Nr = "text", Tr = (e) => e.length === 0 ? "" : Xt(e), Lr = Zs;
|
|
1911
|
+
function kn(e, t) {
|
|
1912
|
+
return e = Math.abs(e), t === 2 ? e ? e > 1 ? 1 : 0 : 1 : e ? Math.min(e, 2) : 0;
|
|
1913
|
+
}
|
|
1914
|
+
function br(e) {
|
|
1915
|
+
const t = j(e.pluralIndex) ? e.pluralIndex : -1;
|
|
1916
|
+
return e.named && (j(e.named.count) || j(e.named.n)) ? j(e.named.count) ? e.named.count : j(e.named.n) ? e.named.n : t : t;
|
|
1917
|
+
}
|
|
1918
|
+
function Or(e, t) {
|
|
1919
|
+
t.count || (t.count = e), t.n || (t.n = e);
|
|
1920
|
+
}
|
|
1921
|
+
function Ir(e = {}) {
|
|
1922
|
+
const t = e.locale, n = br(e), s = M(e.pluralRules) && I(t) && $(e.pluralRules[t]) ? e.pluralRules[t] : kn, a = M(e.pluralRules) && I(t) && $(e.pluralRules[t]) ? kn : void 0, r = (f) => f[s(n, f.length, a)], o = e.list || [], l = (f) => o[f], u = e.named || W();
|
|
1923
|
+
j(e.pluralIndex) && Or(n, u);
|
|
1924
|
+
const _ = (f) => u[f];
|
|
1925
|
+
function N(f, d) {
|
|
1926
|
+
const b = $(e.messages) ? e.messages(f, !!d) : M(e.messages) ? e.messages[f] : !1;
|
|
1927
|
+
return b || (e.parent ? e.parent.message(f) : hr);
|
|
1928
|
+
}
|
|
1929
|
+
const T = (f) => e.modifiers ? e.modifiers[f] : pr, E = R(e.processor) && $(e.processor.normalize) ? e.processor.normalize : Tr, A = R(e.processor) && $(e.processor.interpolate) ? e.processor.interpolate : Lr, C = R(e.processor) && I(e.processor.type) ? e.processor.type : Nr, S = {
|
|
1930
|
+
list: l,
|
|
1931
|
+
named: _,
|
|
1932
|
+
plural: r,
|
|
1933
|
+
linked: (f, ...d) => {
|
|
1934
|
+
const [b, g] = d;
|
|
1935
|
+
let O = "text", v = "";
|
|
1936
|
+
d.length === 1 ? M(b) ? (v = b.modifier || v, O = b.type || O) : I(b) && (v = b || v) : d.length === 2 && (I(b) && (v = b || v), I(g) && (O = g || O));
|
|
1937
|
+
const p = N(f, !0)(S), P = (
|
|
1938
|
+
// The message in vnode resolved with linked are returned as an array by processor.nomalize
|
|
1939
|
+
O === "vnode" && B(p) && v ? p[0] : p
|
|
1940
|
+
);
|
|
1941
|
+
return v ? T(v)(P, O) : P;
|
|
1942
|
+
},
|
|
1943
|
+
message: N,
|
|
1944
|
+
type: C,
|
|
1945
|
+
interpolate: A,
|
|
1946
|
+
normalize: E,
|
|
1947
|
+
values: Q(W(), o, u)
|
|
1948
|
+
};
|
|
1949
|
+
return S;
|
|
1950
|
+
}
|
|
1951
|
+
const Pn = () => "", ae = (e) => $(e);
|
|
1952
|
+
function Rn(e, ...t) {
|
|
1953
|
+
const { fallbackFormat: n, postTranslation: s, unresolving: a, messageCompiler: r, fallbackLocale: o, messages: l } = e, [u, _] = Vt(...t), N = F(_.missingWarn) ? _.missingWarn : e.missingWarn, T = F(_.fallbackWarn) ? _.fallbackWarn : e.fallbackWarn, E = F(_.escapeParameter) ? _.escapeParameter : e.escapeParameter, A = !!_.resolvedMessage, C = I(_.default) || F(_.default) ? F(_.default) ? r ? u : () => u : _.default : n ? r ? u : () => u : null, y = n || C != null && (I(C) || $(C)), S = zt(e, _);
|
|
1954
|
+
E && vr(_);
|
|
1955
|
+
let [f, d, b] = A ? [
|
|
1956
|
+
u,
|
|
1957
|
+
S,
|
|
1958
|
+
l[S] || W()
|
|
1959
|
+
] : hs(e, u, S, o, T, N), g = f, O = u;
|
|
1960
|
+
if (!A && !(I(g) || re(g) || ae(g)) && y && (g = C, O = g), !A && (!(I(g) || re(g) || ae(g)) || !I(d)))
|
|
1961
|
+
return a ? ct : u;
|
|
1962
|
+
if (process.env.NODE_ENV !== "production" && I(g) && e.messageCompiler == null)
|
|
1963
|
+
return he(`The message format compilation is not supported in this build. Because message compiler isn't included. You need to pre-compilation all message format. So translate function return '${u}'.`), u;
|
|
1964
|
+
let v = !1;
|
|
1965
|
+
const p = () => {
|
|
1966
|
+
v = !0;
|
|
1967
|
+
}, P = ae(g) ? g : Ns(e, u, d, g, O, p);
|
|
1968
|
+
if (v)
|
|
1969
|
+
return g;
|
|
1970
|
+
const U = Cr(e, d, b, _), X = Ir(U), oe = yr(e, P, X), J = s ? s(oe, u) : oe;
|
|
1971
|
+
if (process.env.NODE_ENV !== "production" || __INTLIFY_PROD_DEVTOOLS__) {
|
|
1972
|
+
const Pe = {
|
|
1973
|
+
timestamp: Date.now(),
|
|
1974
|
+
key: I(u) ? u : ae(g) ? g.key : "",
|
|
1975
|
+
locale: d || (ae(g) ? g.locale : ""),
|
|
1976
|
+
format: I(g) ? g : ae(g) ? g.source : "",
|
|
1977
|
+
message: J
|
|
1978
|
+
};
|
|
1979
|
+
Pe.meta = Q({}, e.__meta, /* @__PURE__ */ mr() || {}), Ha(Pe);
|
|
1980
|
+
}
|
|
1981
|
+
return J;
|
|
1982
|
+
}
|
|
1983
|
+
function vr(e) {
|
|
1984
|
+
B(e.list) ? e.list = e.list.map((t) => I(t) ? mn(t) : t) : M(e.named) && Object.keys(e.named).forEach((t) => {
|
|
1985
|
+
I(e.named[t]) && (e.named[t] = mn(e.named[t]));
|
|
1986
|
+
});
|
|
1987
|
+
}
|
|
1988
|
+
function hs(e, t, n, s, a, r) {
|
|
1989
|
+
const { messages: o, onWarn: l, messageResolver: u, localeFallbacker: _ } = e, N = _(e, s, n);
|
|
1990
|
+
let T = W(), E, A = null, C = n, y = null;
|
|
1991
|
+
const S = "translate";
|
|
1992
|
+
for (let f = 0; f < N.length; f++) {
|
|
1993
|
+
if (E = y = N[f], process.env.NODE_ENV !== "production" && n !== E && !ds(n, E) && ut(a, t) && l(Ce(z.FALLBACK_TO_TRANSLATE, {
|
|
1994
|
+
key: t,
|
|
1995
|
+
target: E
|
|
1996
|
+
})), process.env.NODE_ENV !== "production" && n !== E) {
|
|
1997
|
+
const O = e.__v_emitter;
|
|
1998
|
+
O && O.emit("fallback", {
|
|
1999
|
+
type: S,
|
|
2000
|
+
key: t,
|
|
2001
|
+
from: C,
|
|
2002
|
+
to: y,
|
|
2003
|
+
groupId: `${S}:${t}`
|
|
2004
|
+
});
|
|
2005
|
+
}
|
|
2006
|
+
T = o[E] || W();
|
|
2007
|
+
let d = null, b, g;
|
|
2008
|
+
if (process.env.NODE_ENV !== "production" && ce && (d = window.performance.now(), b = "intlify-message-resolve-start", g = "intlify-message-resolve-end", ne && ne(b)), (A = u(T, t)) === null && (A = T[t]), process.env.NODE_ENV !== "production" && ce) {
|
|
2009
|
+
const O = window.performance.now(), v = e.__v_emitter;
|
|
2010
|
+
v && d && A && v.emit("message-resolve", {
|
|
2011
|
+
type: "message-resolve",
|
|
2012
|
+
key: t,
|
|
2013
|
+
message: A,
|
|
2014
|
+
time: O - d,
|
|
2015
|
+
groupId: `${S}:${t}`
|
|
2016
|
+
}), b && g && ne && Se && (ne(g), Se("intlify message resolve", b, g));
|
|
2017
|
+
}
|
|
2018
|
+
if (I(A) || re(A) || ae(A))
|
|
2019
|
+
break;
|
|
2020
|
+
if (!Er(E, N)) {
|
|
2021
|
+
const O = en(
|
|
2022
|
+
e,
|
|
2023
|
+
// eslint-disable-line @typescript-eslint/no-explicit-any
|
|
2024
|
+
t,
|
|
2025
|
+
E,
|
|
2026
|
+
r,
|
|
2027
|
+
S
|
|
2028
|
+
);
|
|
2029
|
+
O !== t && (A = O);
|
|
2030
|
+
}
|
|
2031
|
+
C = y;
|
|
2032
|
+
}
|
|
2033
|
+
return [A, E, T];
|
|
2034
|
+
}
|
|
2035
|
+
function Ns(e, t, n, s, a, r) {
|
|
2036
|
+
const { messageCompiler: o, warnHtmlMessage: l } = e;
|
|
2037
|
+
if (ae(s)) {
|
|
2038
|
+
const E = s;
|
|
2039
|
+
return E.locale = E.locale || n, E.key = E.key || t, E;
|
|
2040
|
+
}
|
|
2041
|
+
if (o == null) {
|
|
2042
|
+
const E = () => s;
|
|
2043
|
+
return E.locale = n, E.key = t, E;
|
|
2044
|
+
}
|
|
2045
|
+
let u = null, _, N;
|
|
2046
|
+
process.env.NODE_ENV !== "production" && ce && (u = window.performance.now(), _ = "intlify-message-compilation-start", N = "intlify-message-compilation-end", ne && ne(_));
|
|
2047
|
+
const T = o(s, Ar(e, n, a, s, l, r));
|
|
2048
|
+
if (process.env.NODE_ENV !== "production" && ce) {
|
|
2049
|
+
const E = window.performance.now(), A = e.__v_emitter;
|
|
2050
|
+
A && u && A.emit("message-compilation", {
|
|
2051
|
+
type: "message-compilation",
|
|
2052
|
+
message: s,
|
|
2053
|
+
time: E - u,
|
|
2054
|
+
groupId: `translate:${t}`
|
|
2055
|
+
}), _ && N && ne && Se && (ne(N), Se("intlify message compilation", _, N));
|
|
2056
|
+
}
|
|
2057
|
+
return T.locale = n, T.key = t, T.source = s, T;
|
|
2058
|
+
}
|
|
2059
|
+
function yr(e, t, n) {
|
|
2060
|
+
let s = null, a, r;
|
|
2061
|
+
process.env.NODE_ENV !== "production" && ce && (s = window.performance.now(), a = "intlify-message-evaluation-start", r = "intlify-message-evaluation-end", ne && ne(a));
|
|
2062
|
+
const o = t(n);
|
|
2063
|
+
if (process.env.NODE_ENV !== "production" && ce) {
|
|
2064
|
+
const l = window.performance.now(), u = e.__v_emitter;
|
|
2065
|
+
u && s && u.emit("message-evaluation", {
|
|
2066
|
+
type: "message-evaluation",
|
|
2067
|
+
value: o,
|
|
2068
|
+
time: l - s,
|
|
2069
|
+
groupId: `translate:${t.key}`
|
|
2070
|
+
}), a && r && ne && Se && (ne(r), Se("intlify message evaluation", a, r));
|
|
2071
|
+
}
|
|
2072
|
+
return o;
|
|
2073
|
+
}
|
|
2074
|
+
function Vt(...e) {
|
|
2075
|
+
const [t, n, s] = e, a = W();
|
|
2076
|
+
if (!I(t) && !j(t) && !ae(t) && !re(t))
|
|
2077
|
+
throw Ee(q.INVALID_ARGUMENT);
|
|
2078
|
+
const r = j(t) ? String(t) : (ae(t), t);
|
|
2079
|
+
return j(n) ? a.plural = n : I(n) ? a.default = n : R(n) && !it(n) ? a.named = n : B(n) && (a.list = n), j(s) ? a.plural = s : I(s) ? a.default = s : R(s) && Q(a, s), [r, a];
|
|
2080
|
+
}
|
|
2081
|
+
function Ar(e, t, n, s, a, r) {
|
|
2082
|
+
return {
|
|
2083
|
+
locale: t,
|
|
2084
|
+
key: n,
|
|
2085
|
+
warnHtmlMessage: a,
|
|
2086
|
+
onError: (o) => {
|
|
2087
|
+
if (r && r(o), process.env.NODE_ENV !== "production") {
|
|
2088
|
+
const l = Sr(s), u = `Message compilation error: ${o.message}`, _ = o.location && l && zs(l, o.location.start.offset, o.location.end.offset), N = e.__v_emitter;
|
|
2089
|
+
N && l && N.emit("compile-error", {
|
|
2090
|
+
message: l,
|
|
2091
|
+
error: o.message,
|
|
2092
|
+
start: o.location && o.location.start.offset,
|
|
2093
|
+
end: o.location && o.location.end.offset,
|
|
2094
|
+
groupId: `translate:${n}`
|
|
2095
|
+
}), console.error(_ ? `${u}
|
|
2096
|
+
${_}` : u);
|
|
2097
|
+
} else
|
|
2098
|
+
throw o;
|
|
2099
|
+
},
|
|
2100
|
+
onCacheKey: (o) => Bs(t, n, o)
|
|
2101
|
+
};
|
|
2102
|
+
}
|
|
2103
|
+
function Sr(e) {
|
|
2104
|
+
if (I(e))
|
|
2105
|
+
return e;
|
|
2106
|
+
if (e.loc && e.loc.source)
|
|
2107
|
+
return e.loc.source;
|
|
2108
|
+
}
|
|
2109
|
+
function Cr(e, t, n, s) {
|
|
2110
|
+
const { modifiers: a, pluralRules: r, messageResolver: o, fallbackLocale: l, fallbackWarn: u, missingWarn: _, fallbackContext: N } = e, E = {
|
|
2111
|
+
locale: t,
|
|
2112
|
+
modifiers: a,
|
|
2113
|
+
pluralRules: r,
|
|
2114
|
+
messages: (A, C) => {
|
|
2115
|
+
let y = o(n, A);
|
|
2116
|
+
if (y == null && (N || C)) {
|
|
2117
|
+
const [, , S] = hs(
|
|
2118
|
+
N || e,
|
|
2119
|
+
// NOTE: if has fallbackContext, fallback to root, else if use linked, fallback to local context
|
|
2120
|
+
A,
|
|
2121
|
+
t,
|
|
2122
|
+
l,
|
|
2123
|
+
u,
|
|
2124
|
+
_
|
|
2125
|
+
);
|
|
2126
|
+
y = o(S, A);
|
|
2127
|
+
}
|
|
2128
|
+
if (I(y) || re(y)) {
|
|
2129
|
+
let S = !1;
|
|
2130
|
+
const d = Ns(e, A, t, y, A, () => {
|
|
2131
|
+
S = !0;
|
|
2132
|
+
});
|
|
2133
|
+
return S ? Pn : d;
|
|
2134
|
+
} else return ae(y) ? y : Pn;
|
|
2135
|
+
}
|
|
2136
|
+
};
|
|
2137
|
+
return e.processor && (E.processor = e.processor), s.list && (E.list = s.list), s.named && (E.named = s.named), j(s.plural) && (E.pluralIndex = s.plural), E;
|
|
2138
|
+
}
|
|
2139
|
+
Ca();
|
|
2140
|
+
function Dr() {
|
|
2141
|
+
return Ts().__VUE_DEVTOOLS_GLOBAL_HOOK__;
|
|
2142
|
+
}
|
|
2143
|
+
function Ts() {
|
|
2144
|
+
return typeof navigator < "u" && typeof window < "u" ? window : typeof globalThis < "u" ? globalThis : {};
|
|
2145
|
+
}
|
|
2146
|
+
const kr = typeof Proxy == "function", Pr = "devtools-plugin:setup", Rr = "plugin:settings:set";
|
|
2147
|
+
let Me, Wt;
|
|
2148
|
+
function Mr() {
|
|
2149
|
+
var e;
|
|
2150
|
+
return Me !== void 0 || (typeof window < "u" && window.performance ? (Me = !0, Wt = window.performance) : typeof globalThis < "u" && (!((e = globalThis.perf_hooks) === null || e === void 0) && e.performance) ? (Me = !0, Wt = globalThis.perf_hooks.performance) : Me = !1), Me;
|
|
2151
|
+
}
|
|
2152
|
+
function Fr() {
|
|
2153
|
+
return Mr() ? Wt.now() : Date.now();
|
|
2154
|
+
}
|
|
2155
|
+
class wr {
|
|
2156
|
+
constructor(t, n) {
|
|
2157
|
+
this.target = null, this.targetQueue = [], this.onQueue = [], this.plugin = t, this.hook = n;
|
|
2158
|
+
const s = {};
|
|
2159
|
+
if (t.settings)
|
|
2160
|
+
for (const o in t.settings) {
|
|
2161
|
+
const l = t.settings[o];
|
|
2162
|
+
s[o] = l.defaultValue;
|
|
2163
|
+
}
|
|
2164
|
+
const a = `__vue-devtools-plugin-settings__${t.id}`;
|
|
2165
|
+
let r = Object.assign({}, s);
|
|
2166
|
+
try {
|
|
2167
|
+
const o = localStorage.getItem(a), l = JSON.parse(o);
|
|
2168
|
+
Object.assign(r, l);
|
|
2169
|
+
} catch {
|
|
2170
|
+
}
|
|
2171
|
+
this.fallbacks = {
|
|
2172
|
+
getSettings() {
|
|
2173
|
+
return r;
|
|
2174
|
+
},
|
|
2175
|
+
setSettings(o) {
|
|
2176
|
+
try {
|
|
2177
|
+
localStorage.setItem(a, JSON.stringify(o));
|
|
2178
|
+
} catch {
|
|
2179
|
+
}
|
|
2180
|
+
r = o;
|
|
2181
|
+
},
|
|
2182
|
+
now() {
|
|
2183
|
+
return Fr();
|
|
2184
|
+
}
|
|
2185
|
+
}, n && n.on(Rr, (o, l) => {
|
|
2186
|
+
o === this.plugin.id && this.fallbacks.setSettings(l);
|
|
2187
|
+
}), this.proxiedOn = new Proxy({}, {
|
|
2188
|
+
get: (o, l) => this.target ? this.target.on[l] : (...u) => {
|
|
2189
|
+
this.onQueue.push({
|
|
2190
|
+
method: l,
|
|
2191
|
+
args: u
|
|
2192
|
+
});
|
|
2193
|
+
}
|
|
2194
|
+
}), this.proxiedTarget = new Proxy({}, {
|
|
2195
|
+
get: (o, l) => this.target ? this.target[l] : l === "on" ? this.proxiedOn : Object.keys(this.fallbacks).includes(l) ? (...u) => (this.targetQueue.push({
|
|
2196
|
+
method: l,
|
|
2197
|
+
args: u,
|
|
2198
|
+
resolve: () => {
|
|
2199
|
+
}
|
|
2200
|
+
}), this.fallbacks[l](...u)) : (...u) => new Promise((_) => {
|
|
2201
|
+
this.targetQueue.push({
|
|
2202
|
+
method: l,
|
|
2203
|
+
args: u,
|
|
2204
|
+
resolve: _
|
|
2205
|
+
});
|
|
2206
|
+
})
|
|
2207
|
+
});
|
|
2208
|
+
}
|
|
2209
|
+
async setRealTarget(t) {
|
|
2210
|
+
this.target = t;
|
|
2211
|
+
for (const n of this.onQueue)
|
|
2212
|
+
this.target.on[n.method](...n.args);
|
|
2213
|
+
for (const n of this.targetQueue)
|
|
2214
|
+
n.resolve(await this.target[n.method](...n.args));
|
|
2215
|
+
}
|
|
2216
|
+
}
|
|
2217
|
+
function Ur(e, t) {
|
|
2218
|
+
const n = e, s = Ts(), a = Dr(), r = kr && n.enableEarlyProxy;
|
|
2219
|
+
if (a && (s.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !r))
|
|
2220
|
+
a.emit(Pr, e, t);
|
|
2221
|
+
else {
|
|
2222
|
+
const o = r ? new wr(n, a) : null;
|
|
2223
|
+
(s.__VUE_DEVTOOLS_PLUGINS__ = s.__VUE_DEVTOOLS_PLUGINS__ || []).push({
|
|
2224
|
+
pluginDescriptor: n,
|
|
2225
|
+
setupFn: t,
|
|
2226
|
+
proxy: o
|
|
2227
|
+
}), o && t(o.proxiedTarget);
|
|
2228
|
+
}
|
|
2229
|
+
}
|
|
2230
|
+
/*!
|
|
2231
|
+
* vue-i18n v11.1.3
|
|
2232
|
+
* (c) 2025 kazuya kawaguchi
|
|
2233
|
+
* Released under the MIT License.
|
|
2234
|
+
*/
|
|
2235
|
+
const Vr = "11.1.3";
|
|
2236
|
+
function Wr() {
|
|
2237
|
+
typeof __VUE_I18N_FULL_INSTALL__ != "boolean" && (Ae().__VUE_I18N_FULL_INSTALL__ = !0), typeof __VUE_I18N_LEGACY_API__ != "boolean" && (Ae().__VUE_I18N_LEGACY_API__ = !0), typeof __INTLIFY_DROP_MESSAGE_COMPILER__ != "boolean" && (Ae().__INTLIFY_DROP_MESSAGE_COMPILER__ = !1), typeof __INTLIFY_PROD_DEVTOOLS__ != "boolean" && (Ae().__INTLIFY_PROD_DEVTOOLS__ = !1);
|
|
2238
|
+
}
|
|
2239
|
+
const G = {
|
|
2240
|
+
// composer module errors
|
|
2241
|
+
UNEXPECTED_RETURN_TYPE: Ba,
|
|
2242
|
+
// 24
|
|
2243
|
+
// legacy module errors
|
|
2244
|
+
INVALID_ARGUMENT: 25,
|
|
2245
|
+
// i18n module errors
|
|
2246
|
+
MUST_BE_CALL_SETUP_TOP: 26,
|
|
2247
|
+
NOT_INSTALLED: 27,
|
|
2248
|
+
// directive module errors
|
|
2249
|
+
REQUIRED_VALUE: 28,
|
|
2250
|
+
INVALID_VALUE: 29,
|
|
2251
|
+
// vue-devtools errors
|
|
2252
|
+
CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN: 30,
|
|
2253
|
+
NOT_INSTALLED_WITH_PROVIDE: 31,
|
|
2254
|
+
// unexpected error
|
|
2255
|
+
UNEXPECTED_ERROR: 32,
|
|
2256
|
+
// not compatible legacy vue-i18n constructor
|
|
2257
|
+
NOT_COMPATIBLE_LEGACY_VUE_I18N: 33,
|
|
2258
|
+
// Not available Compostion API in Legacy API mode. Please make sure that the legacy API mode is working properly
|
|
2259
|
+
NOT_AVAILABLE_COMPOSITION_IN_LEGACY: 34
|
|
2260
|
+
};
|
|
2261
|
+
function ee(e, ...t) {
|
|
2262
|
+
return Ve(e, null, process.env.NODE_ENV !== "production" ? { messages: xr, args: t } : void 0);
|
|
2263
|
+
}
|
|
2264
|
+
const xr = {
|
|
2265
|
+
[G.UNEXPECTED_RETURN_TYPE]: "Unexpected return type in composer",
|
|
2266
|
+
[G.INVALID_ARGUMENT]: "Invalid argument",
|
|
2267
|
+
[G.MUST_BE_CALL_SETUP_TOP]: "Must be called at the top of a `setup` function",
|
|
2268
|
+
[G.NOT_INSTALLED]: "Need to install with `app.use` function",
|
|
2269
|
+
[G.UNEXPECTED_ERROR]: "Unexpected error",
|
|
2270
|
+
[G.REQUIRED_VALUE]: "Required in value: {0}",
|
|
2271
|
+
[G.INVALID_VALUE]: "Invalid value",
|
|
2272
|
+
[G.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN]: "Cannot setup vue-devtools plugin",
|
|
2273
|
+
[G.NOT_INSTALLED_WITH_PROVIDE]: "Need to install with `provide` function",
|
|
2274
|
+
[G.NOT_COMPATIBLE_LEGACY_VUE_I18N]: "Not compatible legacy VueI18n.",
|
|
2275
|
+
[G.NOT_AVAILABLE_COMPOSITION_IN_LEGACY]: "Not available Compostion API in Legacy API mode. Please make sure that the legacy API mode is working properly"
|
|
2276
|
+
}, xt = /* @__PURE__ */ _e("__translateVNode"), $t = /* @__PURE__ */ _e("__datetimeParts"), Gt = /* @__PURE__ */ _e("__numberParts"), De = /* @__PURE__ */ _e("__enableEmitter"), Je = /* @__PURE__ */ _e("__disableEmitter"), Ls = _e("__setPluralRules"), bs = /* @__PURE__ */ _e("__injectWithOption"), Yt = /* @__PURE__ */ _e("__dispose"), fe = {
|
|
2277
|
+
FALLBACK_TO_ROOT: rr,
|
|
2278
|
+
// 8
|
|
2279
|
+
NOT_FOUND_PARENT_SCOPE: 9,
|
|
2280
|
+
IGNORE_OBJ_FLATTEN: 10,
|
|
2281
|
+
/**
|
|
2282
|
+
* @deprecated will be removed at vue-i18n v12
|
|
2283
|
+
*/
|
|
2284
|
+
DEPRECATE_LEGACY_MODE: 11,
|
|
2285
|
+
/**
|
|
2286
|
+
* @deprecated will be removed at vue-i18n v12
|
|
2287
|
+
*/
|
|
2288
|
+
DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE: 12
|
|
2289
|
+
}, $r = {
|
|
2290
|
+
[fe.FALLBACK_TO_ROOT]: "Fall back to {type} '{key}' with root locale.",
|
|
2291
|
+
[fe.NOT_FOUND_PARENT_SCOPE]: "Not found parent scope. use the global scope.",
|
|
2292
|
+
[fe.IGNORE_OBJ_FLATTEN]: "Ignore object flatten: '{key}' key has an string value",
|
|
2293
|
+
/**
|
|
2294
|
+
* @deprecated will be removed at vue-i18n v12
|
|
2295
|
+
*/
|
|
2296
|
+
[fe.DEPRECATE_LEGACY_MODE]: `Legacy API mode has been deprecated in v11. Use Composition API mode instead.
|
|
2297
|
+
About how to use the Composition API mode, see https://vue-i18n.intlify.dev/guide/advanced/composition.html`,
|
|
2298
|
+
/**
|
|
2299
|
+
* @deprecated will be removed at vue-i18n v12
|
|
2300
|
+
*/
|
|
2301
|
+
[fe.DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE]: "'v-t' has been deprecated in v11. Use translate APIs ('t' or '$t') instead."
|
|
2302
|
+
};
|
|
2303
|
+
function Ze(e, ...t) {
|
|
2304
|
+
return lt($r[e], ...t);
|
|
2305
|
+
}
|
|
2306
|
+
function Qe(e) {
|
|
2307
|
+
if (!M(e) || re(e))
|
|
2308
|
+
return e;
|
|
2309
|
+
for (const t in e)
|
|
2310
|
+
if (ie(e, t))
|
|
2311
|
+
if (!t.includes("."))
|
|
2312
|
+
M(e[t]) && Qe(e[t]);
|
|
2313
|
+
else {
|
|
2314
|
+
const n = t.split("."), s = n.length - 1;
|
|
2315
|
+
let a = e, r = !1;
|
|
2316
|
+
for (let o = 0; o < s; o++) {
|
|
2317
|
+
if (n[o] === "__proto__")
|
|
2318
|
+
throw new Error(`unsafe key: ${n[o]}`);
|
|
2319
|
+
if (n[o] in a || (a[n[o]] = W()), !M(a[n[o]])) {
|
|
2320
|
+
process.env.NODE_ENV !== "production" && he(Ze(fe.IGNORE_OBJ_FLATTEN, {
|
|
2321
|
+
key: n[o]
|
|
2322
|
+
})), r = !0;
|
|
2323
|
+
break;
|
|
2324
|
+
}
|
|
2325
|
+
a = a[n[o]];
|
|
2326
|
+
}
|
|
2327
|
+
if (r || (re(a) ? os.includes(n[s]) || delete e[t] : (a[n[s]] = e[t], delete e[t])), !re(a)) {
|
|
2328
|
+
const o = a[n[s]];
|
|
2329
|
+
M(o) && Qe(o);
|
|
2330
|
+
}
|
|
2331
|
+
}
|
|
14
2332
|
return e;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
2333
|
+
}
|
|
2334
|
+
function tn(e, t) {
|
|
2335
|
+
const { messages: n, __i18n: s, messageResolver: a, flatJson: r } = t, o = R(n) ? n : B(s) ? W() : { [e]: W() };
|
|
2336
|
+
if (B(s) && s.forEach((l) => {
|
|
2337
|
+
if ("locale" in l && "resource" in l) {
|
|
2338
|
+
const { locale: u, resource: _ } = l;
|
|
2339
|
+
u ? (o[u] = o[u] || W(), rt(_, o[u])) : rt(_, o);
|
|
2340
|
+
} else
|
|
2341
|
+
I(l) && rt(JSON.parse(l), o);
|
|
2342
|
+
}), a == null && r)
|
|
2343
|
+
for (const l in o)
|
|
2344
|
+
ie(o, l) && Qe(o[l]);
|
|
2345
|
+
return o;
|
|
2346
|
+
}
|
|
2347
|
+
function Os(e) {
|
|
2348
|
+
return e.type;
|
|
2349
|
+
}
|
|
2350
|
+
function Is(e, t, n) {
|
|
2351
|
+
let s = M(t.messages) ? t.messages : W();
|
|
2352
|
+
"__i18nGlobal" in n && (s = tn(e.locale.value, {
|
|
2353
|
+
messages: s,
|
|
2354
|
+
__i18n: n.__i18nGlobal
|
|
2355
|
+
}));
|
|
2356
|
+
const a = Object.keys(s);
|
|
2357
|
+
a.length && a.forEach((r) => {
|
|
2358
|
+
e.mergeLocaleMessage(r, s[r]);
|
|
2359
|
+
});
|
|
2360
|
+
{
|
|
2361
|
+
if (M(t.datetimeFormats)) {
|
|
2362
|
+
const r = Object.keys(t.datetimeFormats);
|
|
2363
|
+
r.length && r.forEach((o) => {
|
|
2364
|
+
e.mergeDateTimeFormat(o, t.datetimeFormats[o]);
|
|
2365
|
+
});
|
|
2366
|
+
}
|
|
2367
|
+
if (M(t.numberFormats)) {
|
|
2368
|
+
const r = Object.keys(t.numberFormats);
|
|
2369
|
+
r.length && r.forEach((o) => {
|
|
2370
|
+
e.mergeNumberFormat(o, t.numberFormats[o]);
|
|
2371
|
+
});
|
|
2372
|
+
}
|
|
2373
|
+
}
|
|
2374
|
+
}
|
|
2375
|
+
function Mn(e) {
|
|
2376
|
+
return te($s, null, e, 0);
|
|
2377
|
+
}
|
|
2378
|
+
const Fn = "__INTLIFY_META__", wn = () => [], Gr = () => !1;
|
|
2379
|
+
let Un = 0;
|
|
2380
|
+
function Vn(e) {
|
|
2381
|
+
return (t, n, s, a) => e(n, s, Ke() || void 0, a);
|
|
2382
|
+
}
|
|
2383
|
+
const Yr = /* @__NO_SIDE_EFFECTS__ */ () => {
|
|
2384
|
+
const e = Ke();
|
|
2385
|
+
let t = null;
|
|
2386
|
+
return e && (t = Os(e)[Fn]) ? { [Fn]: t } : null;
|
|
2387
|
+
};
|
|
2388
|
+
function nn(e = {}) {
|
|
2389
|
+
const { __root: t, __injectWithOption: n } = e, s = t === void 0, a = e.flatJson, r = ce ? Fs : ws;
|
|
2390
|
+
let o = F(e.inheritLocale) ? e.inheritLocale : !0;
|
|
2391
|
+
const l = r(
|
|
2392
|
+
// prettier-ignore
|
|
2393
|
+
t && o ? t.locale.value : I(e.locale) ? e.locale : Xe
|
|
2394
|
+
), u = r(
|
|
2395
|
+
// prettier-ignore
|
|
2396
|
+
t && o ? t.fallbackLocale.value : I(e.fallbackLocale) || B(e.fallbackLocale) || R(e.fallbackLocale) || e.fallbackLocale === !1 ? e.fallbackLocale : l.value
|
|
2397
|
+
), _ = r(tn(l.value, e)), N = r(R(e.datetimeFormats) ? e.datetimeFormats : { [l.value]: {} }), T = r(R(e.numberFormats) ? e.numberFormats : { [l.value]: {} });
|
|
2398
|
+
let E = t ? t.missingWarn : F(e.missingWarn) || we(e.missingWarn) ? e.missingWarn : !0, A = t ? t.fallbackWarn : F(e.fallbackWarn) || we(e.fallbackWarn) ? e.fallbackWarn : !0, C = t ? t.fallbackRoot : F(e.fallbackRoot) ? e.fallbackRoot : !0, y = !!e.fallbackFormat, S = $(e.missing) ? e.missing : null, f = $(e.missing) ? Vn(e.missing) : null, d = $(e.postTranslation) ? e.postTranslation : null, b = t ? t.warnHtmlMessage : F(e.warnHtmlMessage) ? e.warnHtmlMessage : !0, g = !!e.escapeParameter;
|
|
2399
|
+
const O = t ? t.modifiers : R(e.modifiers) ? e.modifiers : {};
|
|
2400
|
+
let v = e.pluralRules || t && t.pluralRules, p;
|
|
2401
|
+
p = (() => {
|
|
2402
|
+
s && In(null);
|
|
2403
|
+
const m = {
|
|
2404
|
+
version: Vr,
|
|
2405
|
+
locale: l.value,
|
|
2406
|
+
fallbackLocale: u.value,
|
|
2407
|
+
messages: _.value,
|
|
2408
|
+
modifiers: O,
|
|
2409
|
+
pluralRules: v,
|
|
2410
|
+
missing: f === null ? void 0 : f,
|
|
2411
|
+
missingWarn: E,
|
|
2412
|
+
fallbackWarn: A,
|
|
2413
|
+
fallbackFormat: y,
|
|
2414
|
+
unresolving: !0,
|
|
2415
|
+
postTranslation: d === null ? void 0 : d,
|
|
2416
|
+
warnHtmlMessage: b,
|
|
2417
|
+
escapeParameter: g,
|
|
2418
|
+
messageResolver: e.messageResolver,
|
|
2419
|
+
messageCompiler: e.messageCompiler,
|
|
2420
|
+
__meta: { framework: "vue" }
|
|
2421
|
+
};
|
|
2422
|
+
m.datetimeFormats = N.value, m.numberFormats = T.value, m.__datetimeFormatters = R(p) ? p.__datetimeFormatters : void 0, m.__numberFormatters = R(p) ? p.__numberFormatters : void 0, process.env.NODE_ENV !== "production" && (m.__v_emitter = R(p) ? p.__v_emitter : void 0);
|
|
2423
|
+
const L = gr(m);
|
|
2424
|
+
return s && In(L), L;
|
|
2425
|
+
})(), He(p, l.value, u.value);
|
|
2426
|
+
function U() {
|
|
2427
|
+
return [
|
|
2428
|
+
l.value,
|
|
2429
|
+
u.value,
|
|
2430
|
+
_.value,
|
|
2431
|
+
N.value,
|
|
2432
|
+
T.value
|
|
2433
|
+
];
|
|
2434
|
+
}
|
|
2435
|
+
const X = Ye({
|
|
2436
|
+
get: () => l.value,
|
|
2437
|
+
set: (m) => {
|
|
2438
|
+
p.locale = m, l.value = m;
|
|
2439
|
+
}
|
|
2440
|
+
}), oe = Ye({
|
|
2441
|
+
get: () => u.value,
|
|
2442
|
+
set: (m) => {
|
|
2443
|
+
p.fallbackLocale = m, u.value = m, He(p, l.value, m);
|
|
2444
|
+
}
|
|
2445
|
+
}), J = Ye(() => _.value), Pe = /* @__PURE__ */ Ye(() => N.value), _t = /* @__PURE__ */ Ye(() => T.value);
|
|
2446
|
+
function mt() {
|
|
2447
|
+
return $(d) ? d : null;
|
|
2448
|
+
}
|
|
2449
|
+
function dt(m) {
|
|
2450
|
+
d = m, p.postTranslation = m;
|
|
2451
|
+
}
|
|
2452
|
+
function gt() {
|
|
2453
|
+
return S;
|
|
2454
|
+
}
|
|
2455
|
+
function Et(m) {
|
|
2456
|
+
m !== null && (f = Vn(m)), S = m, p.missing = f;
|
|
2457
|
+
}
|
|
2458
|
+
function pt(m, L) {
|
|
2459
|
+
return m !== "translate" || !L.resolvedMessage;
|
|
2460
|
+
}
|
|
2461
|
+
const me = (m, L, V, K, be, et) => {
|
|
2462
|
+
U();
|
|
2463
|
+
let Re;
|
|
2464
|
+
try {
|
|
2465
|
+
process.env.NODE_ENV !== "production" || __INTLIFY_PROD_DEVTOOLS__, s || (p.fallbackContext = t ? dr() : void 0), Re = m(p);
|
|
2466
|
+
} finally {
|
|
2467
|
+
process.env.NODE_ENV !== "production" || __INTLIFY_PROD_DEVTOOLS__, s || (p.fallbackContext = void 0);
|
|
2468
|
+
}
|
|
2469
|
+
if (V !== "translate exists" && // for not `te` (e.g `t`)
|
|
2470
|
+
j(Re) && Re === ct || V === "translate exists" && !Re) {
|
|
2471
|
+
const [Oe, Ps] = L();
|
|
2472
|
+
if (process.env.NODE_ENV !== "production" && t && I(Oe) && pt(V, Ps) && (C && (ut(A, Oe) || ms(E, Oe)) && he(Ze(fe.FALLBACK_TO_ROOT, {
|
|
2473
|
+
key: Oe,
|
|
2474
|
+
type: V
|
|
2475
|
+
})), process.env.NODE_ENV !== "production")) {
|
|
2476
|
+
const { __v_emitter: ln } = p;
|
|
2477
|
+
ln && C && ln.emit("fallback", {
|
|
2478
|
+
type: V,
|
|
2479
|
+
key: Oe,
|
|
2480
|
+
to: "global",
|
|
2481
|
+
groupId: `${V}:${Oe}`
|
|
2482
|
+
});
|
|
2483
|
+
}
|
|
2484
|
+
return t && C ? K(t) : be(Oe);
|
|
2485
|
+
} else {
|
|
2486
|
+
if (et(Re))
|
|
2487
|
+
return Re;
|
|
2488
|
+
throw ee(G.UNEXPECTED_RETURN_TYPE);
|
|
2489
|
+
}
|
|
2490
|
+
};
|
|
2491
|
+
function We(...m) {
|
|
2492
|
+
return me((L) => Reflect.apply(Rn, null, [L, ...m]), () => Vt(...m), "translate", (L) => Reflect.apply(L.t, L, [...m]), (L) => L, (L) => I(L));
|
|
2493
|
+
}
|
|
2494
|
+
function ht(...m) {
|
|
2495
|
+
const [L, V, K] = m;
|
|
2496
|
+
if (K && !M(K))
|
|
2497
|
+
throw ee(G.INVALID_ARGUMENT);
|
|
2498
|
+
return We(L, V, Q({ resolvedMessage: !0 }, K || {}));
|
|
2499
|
+
}
|
|
2500
|
+
function Nt(...m) {
|
|
2501
|
+
return me((L) => Reflect.apply(An, null, [L, ...m]), () => wt(...m), "datetime format", (L) => Reflect.apply(L.d, L, [...m]), () => ot, (L) => I(L));
|
|
2502
|
+
}
|
|
2503
|
+
function Tt(...m) {
|
|
2504
|
+
return me((L) => Reflect.apply(Cn, null, [L, ...m]), () => Ut(...m), "number format", (L) => Reflect.apply(L.n, L, [...m]), () => ot, (L) => I(L));
|
|
2505
|
+
}
|
|
2506
|
+
function Lt(m) {
|
|
2507
|
+
return m.map((L) => I(L) || j(L) || F(L) ? Mn(String(L)) : L);
|
|
2508
|
+
}
|
|
2509
|
+
const bt = {
|
|
2510
|
+
normalize: Lt,
|
|
2511
|
+
interpolate: (m) => m,
|
|
2512
|
+
type: "vnode"
|
|
2513
|
+
};
|
|
2514
|
+
function ze(...m) {
|
|
2515
|
+
return me((L) => {
|
|
2516
|
+
let V;
|
|
2517
|
+
const K = L;
|
|
2518
|
+
try {
|
|
2519
|
+
K.processor = bt, V = Reflect.apply(Rn, null, [K, ...m]);
|
|
2520
|
+
} finally {
|
|
2521
|
+
K.processor = null;
|
|
2522
|
+
}
|
|
2523
|
+
return V;
|
|
2524
|
+
}, () => Vt(...m), "translate", (L) => L[xt](...m), (L) => [Mn(L)], (L) => B(L));
|
|
2525
|
+
}
|
|
2526
|
+
function Ot(...m) {
|
|
2527
|
+
return me((L) => Reflect.apply(Cn, null, [L, ...m]), () => Ut(...m), "number format", (L) => L[Gt](...m), wn, (L) => I(L) || B(L));
|
|
2528
|
+
}
|
|
2529
|
+
function It(...m) {
|
|
2530
|
+
return me((L) => Reflect.apply(An, null, [L, ...m]), () => wt(...m), "datetime format", (L) => L[$t](...m), wn, (L) => I(L) || B(L));
|
|
2531
|
+
}
|
|
2532
|
+
function vt(m) {
|
|
2533
|
+
v = m, p.pluralRules = v;
|
|
2534
|
+
}
|
|
2535
|
+
function yt(m, L) {
|
|
2536
|
+
return me(() => {
|
|
2537
|
+
if (!m)
|
|
2538
|
+
return !1;
|
|
2539
|
+
const V = I(L) ? L : l.value, K = Le(V), be = p.messageResolver(K, m);
|
|
2540
|
+
return re(be) || ae(be) || I(be);
|
|
2541
|
+
}, () => [m], "translate exists", (V) => Reflect.apply(V.te, V, [m, L]), Gr, (V) => F(V));
|
|
2542
|
+
}
|
|
2543
|
+
function xe(m) {
|
|
2544
|
+
let L = null;
|
|
2545
|
+
const V = ls(p, u.value, l.value);
|
|
2546
|
+
for (let K = 0; K < V.length; K++) {
|
|
2547
|
+
const be = _.value[V[K]] || {}, et = p.messageResolver(be, m);
|
|
2548
|
+
if (et != null) {
|
|
2549
|
+
L = et;
|
|
2550
|
+
break;
|
|
2551
|
+
}
|
|
2552
|
+
}
|
|
2553
|
+
return L;
|
|
2554
|
+
}
|
|
2555
|
+
function $e(m) {
|
|
2556
|
+
const L = xe(m);
|
|
2557
|
+
return L ?? (t ? t.tm(m) || {} : {});
|
|
2558
|
+
}
|
|
2559
|
+
function Le(m) {
|
|
2560
|
+
return _.value[m] || {};
|
|
2561
|
+
}
|
|
2562
|
+
function Ge(m, L) {
|
|
2563
|
+
if (a) {
|
|
2564
|
+
const V = { [m]: L };
|
|
2565
|
+
for (const K in V)
|
|
2566
|
+
ie(V, K) && Qe(V[K]);
|
|
2567
|
+
L = V[m];
|
|
2568
|
+
}
|
|
2569
|
+
_.value[m] = L, p.messages = _.value;
|
|
2570
|
+
}
|
|
2571
|
+
function At(m, L) {
|
|
2572
|
+
_.value[m] = _.value[m] || {};
|
|
2573
|
+
const V = { [m]: L };
|
|
2574
|
+
if (a)
|
|
2575
|
+
for (const K in V)
|
|
2576
|
+
ie(V, K) && Qe(V[K]);
|
|
2577
|
+
L = V[m], rt(L, _.value[m]), p.messages = _.value;
|
|
2578
|
+
}
|
|
2579
|
+
function i(m) {
|
|
2580
|
+
return N.value[m] || {};
|
|
2581
|
+
}
|
|
2582
|
+
function c(m, L) {
|
|
2583
|
+
N.value[m] = L, p.datetimeFormats = N.value, Sn(p, m, L);
|
|
2584
|
+
}
|
|
2585
|
+
function h(m, L) {
|
|
2586
|
+
N.value[m] = Q(N.value[m] || {}, L), p.datetimeFormats = N.value, Sn(p, m, L);
|
|
2587
|
+
}
|
|
2588
|
+
function D(m) {
|
|
2589
|
+
return T.value[m] || {};
|
|
2590
|
+
}
|
|
2591
|
+
function Y(m, L) {
|
|
2592
|
+
T.value[m] = L, p.numberFormats = T.value, Dn(p, m, L);
|
|
2593
|
+
}
|
|
2594
|
+
function H(m, L) {
|
|
2595
|
+
T.value[m] = Q(T.value[m] || {}, L), p.numberFormats = T.value, Dn(p, m, L);
|
|
2596
|
+
}
|
|
2597
|
+
Un++, t && ce && (Pt(t.locale, (m) => {
|
|
2598
|
+
o && (l.value = m, p.locale = m, He(p, l.value, u.value));
|
|
2599
|
+
}), Pt(t.fallbackLocale, (m) => {
|
|
2600
|
+
o && (u.value = m, p.fallbackLocale = m, He(p, l.value, u.value));
|
|
2601
|
+
}));
|
|
2602
|
+
const w = {
|
|
2603
|
+
id: Un,
|
|
2604
|
+
locale: X,
|
|
2605
|
+
fallbackLocale: oe,
|
|
2606
|
+
get inheritLocale() {
|
|
2607
|
+
return o;
|
|
2608
|
+
},
|
|
2609
|
+
set inheritLocale(m) {
|
|
2610
|
+
o = m, m && t && (l.value = t.locale.value, u.value = t.fallbackLocale.value, He(p, l.value, u.value));
|
|
2611
|
+
},
|
|
2612
|
+
get availableLocales() {
|
|
2613
|
+
return Object.keys(_.value).sort();
|
|
2614
|
+
},
|
|
2615
|
+
messages: J,
|
|
2616
|
+
get modifiers() {
|
|
2617
|
+
return O;
|
|
2618
|
+
},
|
|
2619
|
+
get pluralRules() {
|
|
2620
|
+
return v || {};
|
|
2621
|
+
},
|
|
2622
|
+
get isGlobal() {
|
|
2623
|
+
return s;
|
|
2624
|
+
},
|
|
2625
|
+
get missingWarn() {
|
|
2626
|
+
return E;
|
|
2627
|
+
},
|
|
2628
|
+
set missingWarn(m) {
|
|
2629
|
+
E = m, p.missingWarn = E;
|
|
2630
|
+
},
|
|
2631
|
+
get fallbackWarn() {
|
|
2632
|
+
return A;
|
|
2633
|
+
},
|
|
2634
|
+
set fallbackWarn(m) {
|
|
2635
|
+
A = m, p.fallbackWarn = A;
|
|
2636
|
+
},
|
|
2637
|
+
get fallbackRoot() {
|
|
2638
|
+
return C;
|
|
2639
|
+
},
|
|
2640
|
+
set fallbackRoot(m) {
|
|
2641
|
+
C = m;
|
|
2642
|
+
},
|
|
2643
|
+
get fallbackFormat() {
|
|
2644
|
+
return y;
|
|
2645
|
+
},
|
|
2646
|
+
set fallbackFormat(m) {
|
|
2647
|
+
y = m, p.fallbackFormat = y;
|
|
2648
|
+
},
|
|
2649
|
+
get warnHtmlMessage() {
|
|
2650
|
+
return b;
|
|
2651
|
+
},
|
|
2652
|
+
set warnHtmlMessage(m) {
|
|
2653
|
+
b = m, p.warnHtmlMessage = m;
|
|
2654
|
+
},
|
|
2655
|
+
get escapeParameter() {
|
|
2656
|
+
return g;
|
|
2657
|
+
},
|
|
2658
|
+
set escapeParameter(m) {
|
|
2659
|
+
g = m, p.escapeParameter = m;
|
|
2660
|
+
},
|
|
2661
|
+
t: We,
|
|
2662
|
+
getLocaleMessage: Le,
|
|
2663
|
+
setLocaleMessage: Ge,
|
|
2664
|
+
mergeLocaleMessage: At,
|
|
2665
|
+
getPostTranslationHandler: mt,
|
|
2666
|
+
setPostTranslationHandler: dt,
|
|
2667
|
+
getMissingHandler: gt,
|
|
2668
|
+
setMissingHandler: Et,
|
|
2669
|
+
[Ls]: vt
|
|
2670
|
+
};
|
|
2671
|
+
return w.datetimeFormats = Pe, w.numberFormats = _t, w.rt = ht, w.te = yt, w.tm = $e, w.d = Nt, w.n = Tt, w.getDateTimeFormat = i, w.setDateTimeFormat = c, w.mergeDateTimeFormat = h, w.getNumberFormat = D, w.setNumberFormat = Y, w.mergeNumberFormat = H, w[bs] = n, w[xt] = ze, w[$t] = It, w[Gt] = Ot, process.env.NODE_ENV !== "production" && (w[De] = (m) => {
|
|
2672
|
+
p.__v_emitter = m;
|
|
2673
|
+
}, w[Je] = () => {
|
|
2674
|
+
p.__v_emitter = void 0;
|
|
2675
|
+
}), w;
|
|
2676
|
+
}
|
|
2677
|
+
const vs = "vue-i18n: composer properties", kt = {
|
|
2678
|
+
"vue-devtools-plugin-vue-i18n": "Vue I18n DevTools",
|
|
2679
|
+
"vue-i18n-resource-inspector": "Vue I18n DevTools",
|
|
2680
|
+
"vue-i18n-timeline": "Vue I18n"
|
|
2681
|
+
}, Hr = {
|
|
2682
|
+
"vue-i18n-resource-inspector": "Search for scopes ..."
|
|
2683
|
+
}, Kr = {
|
|
2684
|
+
"vue-i18n-timeline": 16764185
|
|
2685
|
+
};
|
|
2686
|
+
let Ht;
|
|
2687
|
+
async function Br(e, t) {
|
|
2688
|
+
return new Promise((n, s) => {
|
|
2689
|
+
try {
|
|
2690
|
+
Ur({
|
|
2691
|
+
id: "vue-devtools-plugin-vue-i18n",
|
|
2692
|
+
label: kt["vue-devtools-plugin-vue-i18n"],
|
|
2693
|
+
packageName: "vue-i18n",
|
|
2694
|
+
homepage: "https://vue-i18n.intlify.dev",
|
|
2695
|
+
logo: "https://vue-i18n.intlify.dev/vue-i18n-devtools-logo.png",
|
|
2696
|
+
componentStateTypes: [vs],
|
|
2697
|
+
app: e
|
|
2698
|
+
// eslint-disable-line @typescript-eslint/no-explicit-any
|
|
2699
|
+
}, (a) => {
|
|
2700
|
+
Ht = a, a.on.visitComponentTree(({ componentInstance: o, treeNode: l }) => {
|
|
2701
|
+
jr(o, l, t);
|
|
2702
|
+
}), a.on.inspectComponent(({ componentInstance: o, instanceData: l }) => {
|
|
2703
|
+
o.vnode.el && o.vnode.el.__VUE_I18N__ && l && (t.mode === "legacy" ? o.vnode.el.__VUE_I18N__ !== t.global.__composer && Wn(l, o.vnode.el.__VUE_I18N__) : Wn(l, o.vnode.el.__VUE_I18N__));
|
|
2704
|
+
}), a.addInspector({
|
|
2705
|
+
id: "vue-i18n-resource-inspector",
|
|
2706
|
+
label: kt["vue-i18n-resource-inspector"],
|
|
2707
|
+
icon: "language",
|
|
2708
|
+
treeFilterPlaceholder: Hr["vue-i18n-resource-inspector"]
|
|
2709
|
+
}), a.on.getInspectorTree((o) => {
|
|
2710
|
+
o.app === e && o.inspectorId === "vue-i18n-resource-inspector" && Zr(o, t);
|
|
2711
|
+
});
|
|
2712
|
+
const r = /* @__PURE__ */ new Map();
|
|
2713
|
+
a.on.getInspectorState(async (o) => {
|
|
2714
|
+
if (o.app === e && o.inspectorId === "vue-i18n-resource-inspector")
|
|
2715
|
+
if (a.unhighlightElement(), eo(o, t), o.nodeId === "global") {
|
|
2716
|
+
if (!r.has(o.app)) {
|
|
2717
|
+
const [l] = await a.getComponentInstances(o.app);
|
|
2718
|
+
r.set(o.app, l);
|
|
2719
|
+
}
|
|
2720
|
+
a.highlightElement(r.get(o.app));
|
|
2721
|
+
} else {
|
|
2722
|
+
const l = zr(o.nodeId, t);
|
|
2723
|
+
l && a.highlightElement(l);
|
|
2724
|
+
}
|
|
2725
|
+
}), a.on.editInspectorState((o) => {
|
|
2726
|
+
o.app === e && o.inspectorId === "vue-i18n-resource-inspector" && no(o, t);
|
|
2727
|
+
}), a.addTimelineLayer({
|
|
2728
|
+
id: "vue-i18n-timeline",
|
|
2729
|
+
label: kt["vue-i18n-timeline"],
|
|
2730
|
+
color: Kr["vue-i18n-timeline"]
|
|
2731
|
+
}), n(!0);
|
|
2732
|
+
});
|
|
2733
|
+
} catch (a) {
|
|
2734
|
+
console.error(a), s(!1);
|
|
2735
|
+
}
|
|
2736
|
+
});
|
|
2737
|
+
}
|
|
2738
|
+
function ys(e) {
|
|
2739
|
+
return e.type.name || e.type.displayName || e.type.__file || "Anonymous";
|
|
2740
|
+
}
|
|
2741
|
+
function jr(e, t, n) {
|
|
2742
|
+
const s = n.mode === "composition" ? n.global : n.global.__composer;
|
|
2743
|
+
if (e && e.vnode.el && e.vnode.el.__VUE_I18N__ && e.vnode.el.__VUE_I18N__ !== s) {
|
|
2744
|
+
const a = {
|
|
2745
|
+
label: `i18n (${ys(e)} Scope)`,
|
|
2746
|
+
textColor: 0,
|
|
2747
|
+
backgroundColor: 16764185
|
|
2748
|
+
};
|
|
2749
|
+
t.tags.push(a);
|
|
2750
|
+
}
|
|
2751
|
+
}
|
|
2752
|
+
function Wn(e, t) {
|
|
2753
|
+
const n = vs;
|
|
2754
|
+
e.state.push({
|
|
2755
|
+
type: n,
|
|
2756
|
+
key: "locale",
|
|
2757
|
+
editable: !0,
|
|
2758
|
+
value: t.locale.value
|
|
2759
|
+
}), e.state.push({
|
|
2760
|
+
type: n,
|
|
2761
|
+
key: "availableLocales",
|
|
2762
|
+
editable: !1,
|
|
2763
|
+
value: t.availableLocales
|
|
2764
|
+
}), e.state.push({
|
|
2765
|
+
type: n,
|
|
2766
|
+
key: "fallbackLocale",
|
|
2767
|
+
editable: !0,
|
|
2768
|
+
value: t.fallbackLocale.value
|
|
2769
|
+
}), e.state.push({
|
|
2770
|
+
type: n,
|
|
2771
|
+
key: "inheritLocale",
|
|
2772
|
+
editable: !0,
|
|
2773
|
+
value: t.inheritLocale
|
|
2774
|
+
}), e.state.push({
|
|
2775
|
+
type: n,
|
|
2776
|
+
key: "messages",
|
|
2777
|
+
editable: !1,
|
|
2778
|
+
value: sn(t.messages.value)
|
|
2779
|
+
}), e.state.push({
|
|
2780
|
+
type: n,
|
|
2781
|
+
key: "datetimeFormats",
|
|
2782
|
+
editable: !1,
|
|
2783
|
+
value: t.datetimeFormats.value
|
|
2784
|
+
}), e.state.push({
|
|
2785
|
+
type: n,
|
|
2786
|
+
key: "numberFormats",
|
|
2787
|
+
editable: !1,
|
|
2788
|
+
value: t.numberFormats.value
|
|
2789
|
+
});
|
|
2790
|
+
}
|
|
2791
|
+
function sn(e) {
|
|
2792
|
+
const t = {};
|
|
2793
|
+
return Object.keys(e).forEach((n) => {
|
|
2794
|
+
const s = e[n];
|
|
2795
|
+
$(s) && "source" in s ? t[n] = qr(s) : re(s) && s.loc && s.loc.source ? t[n] = s.loc.source : M(s) ? t[n] = sn(s) : t[n] = s;
|
|
2796
|
+
}), t;
|
|
2797
|
+
}
|
|
2798
|
+
const Xr = {
|
|
2799
|
+
"<": "<",
|
|
2800
|
+
">": ">",
|
|
2801
|
+
'"': """,
|
|
2802
|
+
"&": "&"
|
|
2803
|
+
};
|
|
2804
|
+
function Jr(e) {
|
|
2805
|
+
return e.replace(/[<>"&]/g, Qr);
|
|
2806
|
+
}
|
|
2807
|
+
function Qr(e) {
|
|
2808
|
+
return Xr[e] || e;
|
|
2809
|
+
}
|
|
2810
|
+
function qr(e) {
|
|
2811
|
+
return {
|
|
2812
|
+
_custom: {
|
|
2813
|
+
type: "function",
|
|
2814
|
+
display: `<span>ƒ</span> ${e.source ? `("${Jr(e.source)}")` : "(?)"}`
|
|
2815
|
+
}
|
|
2816
|
+
};
|
|
2817
|
+
}
|
|
2818
|
+
function Zr(e, t) {
|
|
2819
|
+
e.rootNodes.push({
|
|
2820
|
+
id: "global",
|
|
2821
|
+
label: "Global Scope"
|
|
2822
|
+
});
|
|
2823
|
+
const n = t.mode === "composition" ? t.global : t.global.__composer;
|
|
2824
|
+
for (const [s, a] of t.__instances) {
|
|
2825
|
+
const r = t.mode === "composition" ? a : a.__composer;
|
|
2826
|
+
n !== r && e.rootNodes.push({
|
|
2827
|
+
id: r.id.toString(),
|
|
2828
|
+
label: `${ys(s)} Scope`
|
|
2829
|
+
});
|
|
2830
|
+
}
|
|
2831
|
+
}
|
|
2832
|
+
function zr(e, t) {
|
|
2833
|
+
let n = null;
|
|
2834
|
+
if (e !== "global") {
|
|
2835
|
+
for (const [s, a] of t.__instances.entries())
|
|
2836
|
+
if (a.id.toString() === e) {
|
|
2837
|
+
n = s;
|
|
2838
|
+
break;
|
|
2839
|
+
}
|
|
2840
|
+
}
|
|
2841
|
+
return n;
|
|
2842
|
+
}
|
|
2843
|
+
function As(e, t) {
|
|
2844
|
+
if (e === "global")
|
|
2845
|
+
return t.mode === "composition" ? t.global : t.global.__composer;
|
|
2846
|
+
{
|
|
2847
|
+
const n = Array.from(t.__instances.values()).find((s) => s.id.toString() === e);
|
|
2848
|
+
return n ? t.mode === "composition" ? n : n.__composer : null;
|
|
2849
|
+
}
|
|
2850
|
+
}
|
|
2851
|
+
function eo(e, t) {
|
|
2852
|
+
const n = As(e.nodeId, t);
|
|
2853
|
+
return n && (e.state = to(n)), null;
|
|
2854
|
+
}
|
|
2855
|
+
function to(e) {
|
|
2856
|
+
const t = {}, n = "Locale related info", s = [
|
|
2857
|
+
{
|
|
2858
|
+
type: n,
|
|
2859
|
+
key: "locale",
|
|
2860
|
+
editable: !0,
|
|
2861
|
+
value: e.locale.value
|
|
2862
|
+
},
|
|
2863
|
+
{
|
|
2864
|
+
type: n,
|
|
2865
|
+
key: "fallbackLocale",
|
|
2866
|
+
editable: !0,
|
|
2867
|
+
value: e.fallbackLocale.value
|
|
2868
|
+
},
|
|
2869
|
+
{
|
|
2870
|
+
type: n,
|
|
2871
|
+
key: "availableLocales",
|
|
2872
|
+
editable: !1,
|
|
2873
|
+
value: e.availableLocales
|
|
2874
|
+
},
|
|
2875
|
+
{
|
|
2876
|
+
type: n,
|
|
2877
|
+
key: "inheritLocale",
|
|
2878
|
+
editable: !0,
|
|
2879
|
+
value: e.inheritLocale
|
|
2880
|
+
}
|
|
2881
|
+
];
|
|
2882
|
+
t[n] = s;
|
|
2883
|
+
const a = "Locale messages info", r = [
|
|
2884
|
+
{
|
|
2885
|
+
type: a,
|
|
2886
|
+
key: "messages",
|
|
2887
|
+
editable: !1,
|
|
2888
|
+
value: sn(e.messages.value)
|
|
2889
|
+
}
|
|
2890
|
+
];
|
|
2891
|
+
t[a] = r;
|
|
2892
|
+
{
|
|
2893
|
+
const o = "Datetime formats info", l = [
|
|
2894
|
+
{
|
|
2895
|
+
type: o,
|
|
2896
|
+
key: "datetimeFormats",
|
|
2897
|
+
editable: !1,
|
|
2898
|
+
value: e.datetimeFormats.value
|
|
2899
|
+
}
|
|
2900
|
+
];
|
|
2901
|
+
t[o] = l;
|
|
2902
|
+
const u = "Datetime formats info", _ = [
|
|
2903
|
+
{
|
|
2904
|
+
type: u,
|
|
2905
|
+
key: "numberFormats",
|
|
2906
|
+
editable: !1,
|
|
2907
|
+
value: e.numberFormats.value
|
|
2908
|
+
}
|
|
2909
|
+
];
|
|
2910
|
+
t[u] = _;
|
|
2911
|
+
}
|
|
2912
|
+
return t;
|
|
2913
|
+
}
|
|
2914
|
+
function qe(e, t) {
|
|
2915
|
+
if (Ht) {
|
|
2916
|
+
let n;
|
|
2917
|
+
t && "groupId" in t && (n = t.groupId, delete t.groupId), Ht.addTimelineEvent({
|
|
2918
|
+
layerId: "vue-i18n-timeline",
|
|
2919
|
+
event: {
|
|
2920
|
+
title: e,
|
|
2921
|
+
groupId: n,
|
|
2922
|
+
time: Date.now(),
|
|
2923
|
+
meta: {},
|
|
2924
|
+
data: t || {},
|
|
2925
|
+
logType: e === "compile-error" ? "error" : e === "fallback" || e === "missing" ? "warning" : "default"
|
|
2926
|
+
}
|
|
2927
|
+
});
|
|
2928
|
+
}
|
|
2929
|
+
}
|
|
2930
|
+
function no(e, t) {
|
|
2931
|
+
const n = As(e.nodeId, t);
|
|
2932
|
+
if (n) {
|
|
2933
|
+
const [s] = e.path;
|
|
2934
|
+
s === "locale" && I(e.state.value) ? n.locale.value = e.state.value : s === "fallbackLocale" && (I(e.state.value) || B(e.state.value) || M(e.state.value)) ? n.fallbackLocale.value = e.state.value : s === "inheritLocale" && F(e.state.value) && (n.inheritLocale = e.state.value);
|
|
2935
|
+
}
|
|
2936
|
+
}
|
|
2937
|
+
function so(e) {
|
|
2938
|
+
const t = I(e.locale) ? e.locale : Xe, n = I(e.fallbackLocale) || B(e.fallbackLocale) || R(e.fallbackLocale) || e.fallbackLocale === !1 ? e.fallbackLocale : t, s = $(e.missing) ? e.missing : void 0, a = F(e.silentTranslationWarn) || we(e.silentTranslationWarn) ? !e.silentTranslationWarn : !0, r = F(e.silentFallbackWarn) || we(e.silentFallbackWarn) ? !e.silentFallbackWarn : !0, o = F(e.fallbackRoot) ? e.fallbackRoot : !0, l = !!e.formatFallbackMessages, u = R(e.modifiers) ? e.modifiers : {}, _ = e.pluralizationRules, N = $(e.postTranslation) ? e.postTranslation : void 0, T = I(e.warnHtmlInMessage) ? e.warnHtmlInMessage !== "off" : !0, E = !!e.escapeParameterHtml, A = F(e.sync) ? e.sync : !0;
|
|
2939
|
+
let C = e.messages;
|
|
2940
|
+
if (R(e.sharedMessages)) {
|
|
2941
|
+
const O = e.sharedMessages;
|
|
2942
|
+
C = Object.keys(O).reduce((p, P) => {
|
|
2943
|
+
const U = p[P] || (p[P] = {});
|
|
2944
|
+
return Q(U, O[P]), p;
|
|
2945
|
+
}, C || {});
|
|
2946
|
+
}
|
|
2947
|
+
const { __i18n: y, __root: S, __injectWithOption: f } = e, d = e.datetimeFormats, b = e.numberFormats, g = e.flatJson;
|
|
2948
|
+
return {
|
|
2949
|
+
locale: t,
|
|
2950
|
+
fallbackLocale: n,
|
|
2951
|
+
messages: C,
|
|
2952
|
+
flatJson: g,
|
|
2953
|
+
datetimeFormats: d,
|
|
2954
|
+
numberFormats: b,
|
|
2955
|
+
missing: s,
|
|
2956
|
+
missingWarn: a,
|
|
2957
|
+
fallbackWarn: r,
|
|
2958
|
+
fallbackRoot: o,
|
|
2959
|
+
fallbackFormat: l,
|
|
2960
|
+
modifiers: u,
|
|
2961
|
+
pluralRules: _,
|
|
2962
|
+
postTranslation: N,
|
|
2963
|
+
warnHtmlMessage: T,
|
|
2964
|
+
escapeParameter: E,
|
|
2965
|
+
messageResolver: e.messageResolver,
|
|
2966
|
+
inheritLocale: A,
|
|
2967
|
+
__i18n: y,
|
|
2968
|
+
__root: S,
|
|
2969
|
+
__injectWithOption: f
|
|
2970
|
+
};
|
|
2971
|
+
}
|
|
2972
|
+
function Kt(e = {}) {
|
|
2973
|
+
const t = nn(so(e)), { __extender: n } = e, s = {
|
|
2974
|
+
// id
|
|
2975
|
+
id: t.id,
|
|
2976
|
+
// locale
|
|
2977
|
+
get locale() {
|
|
2978
|
+
return t.locale.value;
|
|
2979
|
+
},
|
|
2980
|
+
set locale(a) {
|
|
2981
|
+
t.locale.value = a;
|
|
2982
|
+
},
|
|
2983
|
+
// fallbackLocale
|
|
2984
|
+
get fallbackLocale() {
|
|
2985
|
+
return t.fallbackLocale.value;
|
|
2986
|
+
},
|
|
2987
|
+
set fallbackLocale(a) {
|
|
2988
|
+
t.fallbackLocale.value = a;
|
|
2989
|
+
},
|
|
2990
|
+
// messages
|
|
2991
|
+
get messages() {
|
|
2992
|
+
return t.messages.value;
|
|
2993
|
+
},
|
|
2994
|
+
// datetimeFormats
|
|
2995
|
+
get datetimeFormats() {
|
|
2996
|
+
return t.datetimeFormats.value;
|
|
2997
|
+
},
|
|
2998
|
+
// numberFormats
|
|
2999
|
+
get numberFormats() {
|
|
3000
|
+
return t.numberFormats.value;
|
|
3001
|
+
},
|
|
3002
|
+
// availableLocales
|
|
3003
|
+
get availableLocales() {
|
|
3004
|
+
return t.availableLocales;
|
|
3005
|
+
},
|
|
3006
|
+
// missing
|
|
3007
|
+
get missing() {
|
|
3008
|
+
return t.getMissingHandler();
|
|
3009
|
+
},
|
|
3010
|
+
set missing(a) {
|
|
3011
|
+
t.setMissingHandler(a);
|
|
3012
|
+
},
|
|
3013
|
+
// silentTranslationWarn
|
|
3014
|
+
get silentTranslationWarn() {
|
|
3015
|
+
return F(t.missingWarn) ? !t.missingWarn : t.missingWarn;
|
|
3016
|
+
},
|
|
3017
|
+
set silentTranslationWarn(a) {
|
|
3018
|
+
t.missingWarn = F(a) ? !a : a;
|
|
3019
|
+
},
|
|
3020
|
+
// silentFallbackWarn
|
|
3021
|
+
get silentFallbackWarn() {
|
|
3022
|
+
return F(t.fallbackWarn) ? !t.fallbackWarn : t.fallbackWarn;
|
|
3023
|
+
},
|
|
3024
|
+
set silentFallbackWarn(a) {
|
|
3025
|
+
t.fallbackWarn = F(a) ? !a : a;
|
|
3026
|
+
},
|
|
3027
|
+
// modifiers
|
|
3028
|
+
get modifiers() {
|
|
3029
|
+
return t.modifiers;
|
|
3030
|
+
},
|
|
3031
|
+
// formatFallbackMessages
|
|
3032
|
+
get formatFallbackMessages() {
|
|
3033
|
+
return t.fallbackFormat;
|
|
3034
|
+
},
|
|
3035
|
+
set formatFallbackMessages(a) {
|
|
3036
|
+
t.fallbackFormat = a;
|
|
3037
|
+
},
|
|
3038
|
+
// postTranslation
|
|
3039
|
+
get postTranslation() {
|
|
3040
|
+
return t.getPostTranslationHandler();
|
|
3041
|
+
},
|
|
3042
|
+
set postTranslation(a) {
|
|
3043
|
+
t.setPostTranslationHandler(a);
|
|
3044
|
+
},
|
|
3045
|
+
// sync
|
|
3046
|
+
get sync() {
|
|
3047
|
+
return t.inheritLocale;
|
|
3048
|
+
},
|
|
3049
|
+
set sync(a) {
|
|
3050
|
+
t.inheritLocale = a;
|
|
3051
|
+
},
|
|
3052
|
+
// warnInHtmlMessage
|
|
3053
|
+
get warnHtmlInMessage() {
|
|
3054
|
+
return t.warnHtmlMessage ? "warn" : "off";
|
|
3055
|
+
},
|
|
3056
|
+
set warnHtmlInMessage(a) {
|
|
3057
|
+
t.warnHtmlMessage = a !== "off";
|
|
3058
|
+
},
|
|
3059
|
+
// escapeParameterHtml
|
|
3060
|
+
get escapeParameterHtml() {
|
|
3061
|
+
return t.escapeParameter;
|
|
3062
|
+
},
|
|
3063
|
+
set escapeParameterHtml(a) {
|
|
3064
|
+
t.escapeParameter = a;
|
|
3065
|
+
},
|
|
3066
|
+
// pluralizationRules
|
|
3067
|
+
get pluralizationRules() {
|
|
3068
|
+
return t.pluralRules || {};
|
|
3069
|
+
},
|
|
3070
|
+
// for internal
|
|
3071
|
+
__composer: t,
|
|
3072
|
+
// t
|
|
3073
|
+
t(...a) {
|
|
3074
|
+
return Reflect.apply(t.t, t, [...a]);
|
|
3075
|
+
},
|
|
3076
|
+
// rt
|
|
3077
|
+
rt(...a) {
|
|
3078
|
+
return Reflect.apply(t.rt, t, [...a]);
|
|
3079
|
+
},
|
|
3080
|
+
// te
|
|
3081
|
+
te(a, r) {
|
|
3082
|
+
return t.te(a, r);
|
|
3083
|
+
},
|
|
3084
|
+
// tm
|
|
3085
|
+
tm(a) {
|
|
3086
|
+
return t.tm(a);
|
|
3087
|
+
},
|
|
3088
|
+
// getLocaleMessage
|
|
3089
|
+
getLocaleMessage(a) {
|
|
3090
|
+
return t.getLocaleMessage(a);
|
|
3091
|
+
},
|
|
3092
|
+
// setLocaleMessage
|
|
3093
|
+
setLocaleMessage(a, r) {
|
|
3094
|
+
t.setLocaleMessage(a, r);
|
|
3095
|
+
},
|
|
3096
|
+
// mergeLocaleMessage
|
|
3097
|
+
mergeLocaleMessage(a, r) {
|
|
3098
|
+
t.mergeLocaleMessage(a, r);
|
|
3099
|
+
},
|
|
3100
|
+
// d
|
|
3101
|
+
d(...a) {
|
|
3102
|
+
return Reflect.apply(t.d, t, [...a]);
|
|
3103
|
+
},
|
|
3104
|
+
// getDateTimeFormat
|
|
3105
|
+
getDateTimeFormat(a) {
|
|
3106
|
+
return t.getDateTimeFormat(a);
|
|
3107
|
+
},
|
|
3108
|
+
// setDateTimeFormat
|
|
3109
|
+
setDateTimeFormat(a, r) {
|
|
3110
|
+
t.setDateTimeFormat(a, r);
|
|
3111
|
+
},
|
|
3112
|
+
// mergeDateTimeFormat
|
|
3113
|
+
mergeDateTimeFormat(a, r) {
|
|
3114
|
+
t.mergeDateTimeFormat(a, r);
|
|
3115
|
+
},
|
|
3116
|
+
// n
|
|
3117
|
+
n(...a) {
|
|
3118
|
+
return Reflect.apply(t.n, t, [...a]);
|
|
3119
|
+
},
|
|
3120
|
+
// getNumberFormat
|
|
3121
|
+
getNumberFormat(a) {
|
|
3122
|
+
return t.getNumberFormat(a);
|
|
3123
|
+
},
|
|
3124
|
+
// setNumberFormat
|
|
3125
|
+
setNumberFormat(a, r) {
|
|
3126
|
+
t.setNumberFormat(a, r);
|
|
3127
|
+
},
|
|
3128
|
+
// mergeNumberFormat
|
|
3129
|
+
mergeNumberFormat(a, r) {
|
|
3130
|
+
t.mergeNumberFormat(a, r);
|
|
3131
|
+
}
|
|
3132
|
+
};
|
|
3133
|
+
return s.__extender = n, process.env.NODE_ENV !== "production" && (s.__enableEmitter = (a) => {
|
|
3134
|
+
const r = t;
|
|
3135
|
+
r[De] && r[De](a);
|
|
3136
|
+
}, s.__disableEmitter = () => {
|
|
3137
|
+
const a = t;
|
|
3138
|
+
a[Je] && a[Je]();
|
|
3139
|
+
}), s;
|
|
3140
|
+
}
|
|
3141
|
+
function ao(e, t, n) {
|
|
3142
|
+
return {
|
|
3143
|
+
beforeCreate() {
|
|
3144
|
+
const s = Ke();
|
|
3145
|
+
if (!s)
|
|
3146
|
+
throw ee(G.UNEXPECTED_ERROR);
|
|
3147
|
+
const a = this.$options;
|
|
3148
|
+
if (a.i18n) {
|
|
3149
|
+
const r = a.i18n;
|
|
3150
|
+
if (a.__i18n && (r.__i18n = a.__i18n), r.__root = t, this === this.$root)
|
|
3151
|
+
this.$i18n = xn(e, r);
|
|
3152
|
+
else {
|
|
3153
|
+
r.__injectWithOption = !0, r.__extender = n.__vueI18nExtend, this.$i18n = Kt(r);
|
|
3154
|
+
const o = this.$i18n;
|
|
3155
|
+
o.__extender && (o.__disposer = o.__extender(this.$i18n));
|
|
3156
|
+
}
|
|
3157
|
+
} else if (a.__i18n)
|
|
3158
|
+
if (this === this.$root)
|
|
3159
|
+
this.$i18n = xn(e, a);
|
|
3160
|
+
else {
|
|
3161
|
+
this.$i18n = Kt({
|
|
3162
|
+
__i18n: a.__i18n,
|
|
3163
|
+
__injectWithOption: !0,
|
|
3164
|
+
__extender: n.__vueI18nExtend,
|
|
3165
|
+
__root: t
|
|
3166
|
+
});
|
|
3167
|
+
const r = this.$i18n;
|
|
3168
|
+
r.__extender && (r.__disposer = r.__extender(this.$i18n));
|
|
3169
|
+
}
|
|
3170
|
+
else
|
|
3171
|
+
this.$i18n = e;
|
|
3172
|
+
a.__i18nGlobal && Is(t, a, a), this.$t = (...r) => this.$i18n.t(...r), this.$rt = (...r) => this.$i18n.rt(...r), this.$te = (r, o) => this.$i18n.te(r, o), this.$d = (...r) => this.$i18n.d(...r), this.$n = (...r) => this.$i18n.n(...r), this.$tm = (r) => this.$i18n.tm(r), n.__setInstance(s, this.$i18n);
|
|
3173
|
+
},
|
|
3174
|
+
mounted() {
|
|
3175
|
+
if (process.env.NODE_ENV !== "production" && this.$el && this.$i18n) {
|
|
3176
|
+
const s = this.$i18n;
|
|
3177
|
+
this.$el.__VUE_I18N__ = s.__composer;
|
|
3178
|
+
const a = this.__v_emitter = Qt();
|
|
3179
|
+
s.__enableEmitter && s.__enableEmitter(a), a.on("*", qe);
|
|
3180
|
+
}
|
|
3181
|
+
},
|
|
3182
|
+
unmounted() {
|
|
3183
|
+
const s = Ke();
|
|
3184
|
+
if (!s)
|
|
3185
|
+
throw ee(G.UNEXPECTED_ERROR);
|
|
3186
|
+
const a = this.$i18n;
|
|
3187
|
+
process.env.NODE_ENV !== "production" && this.$el && this.$el.__VUE_I18N__ && (this.__v_emitter && (this.__v_emitter.off("*", qe), delete this.__v_emitter), this.$i18n && (a.__disableEmitter && a.__disableEmitter(), delete this.$el.__VUE_I18N__)), delete this.$t, delete this.$rt, delete this.$te, delete this.$d, delete this.$n, delete this.$tm, a.__disposer && (a.__disposer(), delete a.__disposer, delete a.__extender), n.__deleteInstance(s), delete this.$i18n;
|
|
3188
|
+
}
|
|
3189
|
+
};
|
|
3190
|
+
}
|
|
3191
|
+
function xn(e, t) {
|
|
3192
|
+
e.locale = t.locale || e.locale, e.fallbackLocale = t.fallbackLocale || e.fallbackLocale, e.missing = t.missing || e.missing, e.silentTranslationWarn = t.silentTranslationWarn || e.silentFallbackWarn, e.silentFallbackWarn = t.silentFallbackWarn || e.silentFallbackWarn, e.formatFallbackMessages = t.formatFallbackMessages || e.formatFallbackMessages, e.postTranslation = t.postTranslation || e.postTranslation, e.warnHtmlInMessage = t.warnHtmlInMessage || e.warnHtmlInMessage, e.escapeParameterHtml = t.escapeParameterHtml || e.escapeParameterHtml, e.sync = t.sync || e.sync, e.__composer[Ls](t.pluralizationRules || e.pluralizationRules);
|
|
3193
|
+
const n = tn(e.locale, {
|
|
3194
|
+
messages: t.messages,
|
|
3195
|
+
__i18n: t.__i18n
|
|
3196
|
+
});
|
|
3197
|
+
return Object.keys(n).forEach((s) => e.mergeLocaleMessage(s, n[s])), t.datetimeFormats && Object.keys(t.datetimeFormats).forEach((s) => e.mergeDateTimeFormat(s, t.datetimeFormats[s])), t.numberFormats && Object.keys(t.numberFormats).forEach((s) => e.mergeNumberFormat(s, t.numberFormats[s])), e;
|
|
3198
|
+
}
|
|
3199
|
+
const an = {
|
|
3200
|
+
tag: {
|
|
3201
|
+
type: [String, Object]
|
|
3202
|
+
},
|
|
3203
|
+
locale: {
|
|
3204
|
+
type: String
|
|
3205
|
+
},
|
|
3206
|
+
scope: {
|
|
3207
|
+
type: String,
|
|
3208
|
+
// NOTE: avoid https://github.com/microsoft/rushstack/issues/1050
|
|
3209
|
+
validator: (e) => e === "parent" || e === "global",
|
|
3210
|
+
default: "parent"
|
|
3211
|
+
/* ComponentI18nScope */
|
|
3212
|
+
},
|
|
3213
|
+
i18n: {
|
|
3214
|
+
type: Object
|
|
3215
|
+
}
|
|
3216
|
+
};
|
|
3217
|
+
function ro({ slots: e }, t) {
|
|
3218
|
+
return t.length === 1 && t[0] === "default" ? (e.default ? e.default() : []).reduce((s, a) => [
|
|
3219
|
+
...s,
|
|
3220
|
+
// prettier-ignore
|
|
3221
|
+
...a.type === Qn ? a.children : [a]
|
|
3222
|
+
], []) : t.reduce((n, s) => {
|
|
3223
|
+
const a = e[s];
|
|
3224
|
+
return a && (n[s] = a()), n;
|
|
3225
|
+
}, W());
|
|
3226
|
+
}
|
|
3227
|
+
function Ss() {
|
|
3228
|
+
return Qn;
|
|
3229
|
+
}
|
|
3230
|
+
const oo = /* @__PURE__ */ Bt({
|
|
3231
|
+
/* eslint-disable */
|
|
3232
|
+
name: "i18n-t",
|
|
3233
|
+
props: Q({
|
|
3234
|
+
keypath: {
|
|
3235
|
+
type: String,
|
|
3236
|
+
required: !0
|
|
3237
|
+
},
|
|
3238
|
+
plural: {
|
|
3239
|
+
type: [Number, String],
|
|
3240
|
+
validator: (e) => j(e) || !isNaN(e)
|
|
3241
|
+
}
|
|
3242
|
+
}, an),
|
|
3243
|
+
/* eslint-enable */
|
|
3244
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3245
|
+
setup(e, t) {
|
|
3246
|
+
const { slots: n, attrs: s } = t, a = e.i18n || rn({
|
|
3247
|
+
useScope: e.scope,
|
|
3248
|
+
__useComponent: !0
|
|
3249
|
+
});
|
|
3250
|
+
return () => {
|
|
3251
|
+
const r = Object.keys(n).filter((T) => T !== "_"), o = W();
|
|
3252
|
+
e.locale && (o.locale = e.locale), e.plural !== void 0 && (o.plural = I(e.plural) ? +e.plural : e.plural);
|
|
3253
|
+
const l = ro(t, r), u = a[xt](e.keypath, l, o), _ = Q(W(), s), N = I(e.tag) || M(e.tag) ? e.tag : Ss();
|
|
3254
|
+
return Jn(N, _, u);
|
|
3255
|
+
};
|
|
3256
|
+
}
|
|
3257
|
+
}), $n = oo;
|
|
3258
|
+
function lo(e) {
|
|
3259
|
+
return B(e) && !I(e[0]);
|
|
3260
|
+
}
|
|
3261
|
+
function Cs(e, t, n, s) {
|
|
3262
|
+
const { slots: a, attrs: r } = t;
|
|
3263
|
+
return () => {
|
|
3264
|
+
const o = { part: !0 };
|
|
3265
|
+
let l = W();
|
|
3266
|
+
e.locale && (o.locale = e.locale), I(e.format) ? o.key = e.format : M(e.format) && (I(e.format.key) && (o.key = e.format.key), l = Object.keys(e.format).reduce((E, A) => n.includes(A) ? Q(W(), E, { [A]: e.format[A] }) : E, W()));
|
|
3267
|
+
const u = s(e.value, o, l);
|
|
3268
|
+
let _ = [o.key];
|
|
3269
|
+
B(u) ? _ = u.map((E, A) => {
|
|
3270
|
+
const C = a[E.type], y = C ? C({ [E.type]: E.value, index: A, parts: u }) : [E.value];
|
|
3271
|
+
return lo(y) && (y[0].key = `${E.type}-${A}`), y;
|
|
3272
|
+
}) : I(u) && (_ = [u]);
|
|
3273
|
+
const N = Q(W(), r), T = I(e.tag) || M(e.tag) ? e.tag : Ss();
|
|
3274
|
+
return Jn(T, N, _);
|
|
3275
|
+
};
|
|
3276
|
+
}
|
|
3277
|
+
const io = /* @__PURE__ */ Bt({
|
|
3278
|
+
/* eslint-disable */
|
|
3279
|
+
name: "i18n-n",
|
|
3280
|
+
props: Q({
|
|
3281
|
+
value: {
|
|
3282
|
+
type: Number,
|
|
3283
|
+
required: !0
|
|
3284
|
+
},
|
|
3285
|
+
format: {
|
|
3286
|
+
type: [String, Object]
|
|
3287
|
+
}
|
|
3288
|
+
}, an),
|
|
3289
|
+
/* eslint-enable */
|
|
3290
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3291
|
+
setup(e, t) {
|
|
3292
|
+
const n = e.i18n || rn({
|
|
3293
|
+
useScope: e.scope,
|
|
3294
|
+
__useComponent: !0
|
|
3295
|
+
});
|
|
3296
|
+
return Cs(e, t, ps, (...s) => (
|
|
3297
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3298
|
+
n[Gt](...s)
|
|
3299
|
+
));
|
|
3300
|
+
}
|
|
3301
|
+
}), Gn = io;
|
|
3302
|
+
function co(e, t) {
|
|
3303
|
+
const n = e;
|
|
3304
|
+
if (e.mode === "composition")
|
|
3305
|
+
return n.__getInstance(t) || e.global;
|
|
3306
|
+
{
|
|
3307
|
+
const s = n.__getInstance(t);
|
|
3308
|
+
return s != null ? s.__composer : e.global.__composer;
|
|
3309
|
+
}
|
|
3310
|
+
}
|
|
3311
|
+
function uo(e) {
|
|
3312
|
+
const t = (o) => {
|
|
3313
|
+
process.env.NODE_ENV !== "production" && Jt(Ze(fe.DEPRECATE_TRANSLATE_CUSTOME_DIRECTIVE));
|
|
3314
|
+
const { instance: l, value: u } = o;
|
|
3315
|
+
if (!l || !l.$)
|
|
3316
|
+
throw ee(G.UNEXPECTED_ERROR);
|
|
3317
|
+
const _ = co(e, l.$), N = Yn(u);
|
|
3318
|
+
return [
|
|
3319
|
+
Reflect.apply(_.t, _, [...Hn(N)]),
|
|
3320
|
+
_
|
|
3321
|
+
];
|
|
3322
|
+
};
|
|
3323
|
+
return {
|
|
3324
|
+
created: (o, l) => {
|
|
3325
|
+
const [u, _] = t(l);
|
|
3326
|
+
ce && e.global === _ && (o.__i18nWatcher = Pt(_.locale, () => {
|
|
3327
|
+
l.instance && l.instance.$forceUpdate();
|
|
3328
|
+
})), o.__composer = _, o.textContent = u;
|
|
3329
|
+
},
|
|
3330
|
+
unmounted: (o) => {
|
|
3331
|
+
ce && o.__i18nWatcher && (o.__i18nWatcher(), o.__i18nWatcher = void 0, delete o.__i18nWatcher), o.__composer && (o.__composer = void 0, delete o.__composer);
|
|
3332
|
+
},
|
|
3333
|
+
beforeUpdate: (o, { value: l }) => {
|
|
3334
|
+
if (o.__composer) {
|
|
3335
|
+
const u = o.__composer, _ = Yn(l);
|
|
3336
|
+
o.textContent = Reflect.apply(u.t, u, [
|
|
3337
|
+
...Hn(_)
|
|
3338
|
+
]);
|
|
3339
|
+
}
|
|
3340
|
+
},
|
|
3341
|
+
getSSRProps: (o) => {
|
|
3342
|
+
const [l] = t(o);
|
|
3343
|
+
return { textContent: l };
|
|
3344
|
+
}
|
|
3345
|
+
};
|
|
3346
|
+
}
|
|
3347
|
+
function Yn(e) {
|
|
3348
|
+
if (I(e))
|
|
3349
|
+
return { path: e };
|
|
3350
|
+
if (R(e)) {
|
|
3351
|
+
if (!("path" in e))
|
|
3352
|
+
throw ee(G.REQUIRED_VALUE, "path");
|
|
3353
|
+
return e;
|
|
3354
|
+
} else
|
|
3355
|
+
throw ee(G.INVALID_VALUE);
|
|
3356
|
+
}
|
|
3357
|
+
function Hn(e) {
|
|
3358
|
+
const { path: t, locale: n, args: s, choice: a, plural: r } = e, o = {}, l = s || {};
|
|
3359
|
+
return I(n) && (o.locale = n), j(a) && (o.plural = a), j(r) && (o.plural = r), [t, l, o];
|
|
3360
|
+
}
|
|
3361
|
+
function fo(e, t, ...n) {
|
|
3362
|
+
const s = R(n[0]) ? n[0] : {};
|
|
3363
|
+
(F(s.globalInstall) ? s.globalInstall : !0) && ([$n.name, "I18nT"].forEach((r) => e.component(r, $n)), [Gn.name, "I18nN"].forEach((r) => e.component(r, Gn)), [Bn.name, "I18nD"].forEach((r) => e.component(r, Bn))), e.directive("t", uo(t));
|
|
3364
|
+
}
|
|
3365
|
+
const _o = /* @__PURE__ */ _e("global-vue-i18n");
|
|
3366
|
+
function mo(e = {}) {
|
|
3367
|
+
const t = __VUE_I18N_LEGACY_API__ && F(e.legacy) ? e.legacy : __VUE_I18N_LEGACY_API__;
|
|
3368
|
+
process.env.NODE_ENV !== "production" && t && Jt(Ze(fe.DEPRECATE_LEGACY_MODE));
|
|
3369
|
+
const n = F(e.globalInjection) ? e.globalInjection : !0, s = /* @__PURE__ */ new Map(), [a, r] = go(e, t), o = /* @__PURE__ */ _e(process.env.NODE_ENV !== "production" ? "vue-i18n" : "");
|
|
3370
|
+
function l(T) {
|
|
3371
|
+
return s.get(T) || null;
|
|
3372
|
+
}
|
|
3373
|
+
function u(T, E) {
|
|
3374
|
+
s.set(T, E);
|
|
3375
|
+
}
|
|
3376
|
+
function _(T) {
|
|
3377
|
+
s.delete(T);
|
|
3378
|
+
}
|
|
3379
|
+
const N = {
|
|
3380
|
+
// mode
|
|
3381
|
+
get mode() {
|
|
3382
|
+
return __VUE_I18N_LEGACY_API__ && t ? "legacy" : "composition";
|
|
3383
|
+
},
|
|
3384
|
+
// install plugin
|
|
3385
|
+
async install(T, ...E) {
|
|
3386
|
+
if (process.env.NODE_ENV !== "production" && (T.__VUE_I18N__ = N), T.__VUE_I18N_SYMBOL__ = o, T.provide(T.__VUE_I18N_SYMBOL__, N), R(E[0])) {
|
|
3387
|
+
const y = E[0];
|
|
3388
|
+
N.__composerExtend = y.__composerExtend, N.__vueI18nExtend = y.__vueI18nExtend;
|
|
3389
|
+
}
|
|
3390
|
+
let A = null;
|
|
3391
|
+
!t && n && (A = Oo(T, N.global)), __VUE_I18N_FULL_INSTALL__ && fo(T, N, ...E), __VUE_I18N_LEGACY_API__ && t && T.mixin(ao(r, r.__composer, N));
|
|
3392
|
+
const C = T.unmount;
|
|
3393
|
+
if (T.unmount = () => {
|
|
3394
|
+
A && A(), N.dispose(), C();
|
|
3395
|
+
}, process.env.NODE_ENV !== "production") {
|
|
3396
|
+
if (!await Br(T, N))
|
|
3397
|
+
throw ee(G.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN);
|
|
3398
|
+
const S = Qt();
|
|
3399
|
+
if (t) {
|
|
3400
|
+
const f = r;
|
|
3401
|
+
f.__enableEmitter && f.__enableEmitter(S);
|
|
3402
|
+
} else {
|
|
3403
|
+
const f = r;
|
|
3404
|
+
f[De] && f[De](S);
|
|
3405
|
+
}
|
|
3406
|
+
S.on("*", qe);
|
|
3407
|
+
}
|
|
3408
|
+
},
|
|
3409
|
+
// global accessor
|
|
3410
|
+
get global() {
|
|
3411
|
+
return r;
|
|
3412
|
+
},
|
|
3413
|
+
dispose() {
|
|
3414
|
+
a.stop();
|
|
3415
|
+
},
|
|
3416
|
+
// @internal
|
|
3417
|
+
__instances: s,
|
|
3418
|
+
// @internal
|
|
3419
|
+
__getInstance: l,
|
|
3420
|
+
// @internal
|
|
3421
|
+
__setInstance: u,
|
|
3422
|
+
// @internal
|
|
3423
|
+
__deleteInstance: _
|
|
3424
|
+
};
|
|
3425
|
+
return N;
|
|
3426
|
+
}
|
|
3427
|
+
function rn(e = {}) {
|
|
3428
|
+
const t = Ke();
|
|
3429
|
+
if (t == null)
|
|
3430
|
+
throw ee(G.MUST_BE_CALL_SETUP_TOP);
|
|
3431
|
+
if (!t.isCE && t.appContext.app != null && !t.appContext.app.__VUE_I18N_SYMBOL__)
|
|
3432
|
+
throw ee(G.NOT_INSTALLED);
|
|
3433
|
+
const n = Eo(t), s = ho(n), a = Os(t), r = po(e, a);
|
|
3434
|
+
if (r === "global")
|
|
3435
|
+
return Is(s, e, a), s;
|
|
3436
|
+
if (r === "parent") {
|
|
3437
|
+
let u = No(n, t, e.__useComponent);
|
|
3438
|
+
return u == null && (process.env.NODE_ENV !== "production" && he(Ze(fe.NOT_FOUND_PARENT_SCOPE)), u = s), u;
|
|
3439
|
+
}
|
|
3440
|
+
const o = n;
|
|
3441
|
+
let l = o.__getInstance(t);
|
|
3442
|
+
if (l == null) {
|
|
3443
|
+
const u = Q({}, e);
|
|
3444
|
+
"__i18n" in a && (u.__i18n = a.__i18n), s && (u.__root = s), l = nn(u), o.__composerExtend && (l[Yt] = o.__composerExtend(l)), Lo(o, t, l), o.__setInstance(t, l);
|
|
3445
|
+
}
|
|
3446
|
+
return l;
|
|
3447
|
+
}
|
|
3448
|
+
function go(e, t) {
|
|
3449
|
+
const n = Ms(), s = __VUE_I18N_LEGACY_API__ && t ? n.run(() => Kt(e)) : n.run(() => nn(e));
|
|
3450
|
+
if (s == null)
|
|
3451
|
+
throw ee(G.UNEXPECTED_ERROR);
|
|
3452
|
+
return [n, s];
|
|
3453
|
+
}
|
|
3454
|
+
function Eo(e) {
|
|
3455
|
+
const t = Vs(e.isCE ? _o : e.appContext.app.__VUE_I18N_SYMBOL__);
|
|
3456
|
+
if (!t)
|
|
3457
|
+
throw ee(e.isCE ? G.NOT_INSTALLED_WITH_PROVIDE : G.UNEXPECTED_ERROR);
|
|
3458
|
+
return t;
|
|
3459
|
+
}
|
|
3460
|
+
function po(e, t) {
|
|
3461
|
+
return it(e) ? "__i18n" in t ? "local" : "global" : e.useScope ? e.useScope : "local";
|
|
3462
|
+
}
|
|
3463
|
+
function ho(e) {
|
|
3464
|
+
return e.mode === "composition" ? e.global : e.global.__composer;
|
|
3465
|
+
}
|
|
3466
|
+
function No(e, t, n = !1) {
|
|
3467
|
+
let s = null;
|
|
3468
|
+
const a = t.root;
|
|
3469
|
+
let r = To(t, n);
|
|
3470
|
+
for (; r != null; ) {
|
|
3471
|
+
const o = e;
|
|
3472
|
+
if (e.mode === "composition")
|
|
3473
|
+
s = o.__getInstance(r);
|
|
3474
|
+
else if (__VUE_I18N_LEGACY_API__) {
|
|
3475
|
+
const l = o.__getInstance(r);
|
|
3476
|
+
l != null && (s = l.__composer, n && s && !s[bs] && (s = null));
|
|
3477
|
+
}
|
|
3478
|
+
if (s != null || a === r)
|
|
3479
|
+
break;
|
|
3480
|
+
r = r.parent;
|
|
3481
|
+
}
|
|
3482
|
+
return s;
|
|
3483
|
+
}
|
|
3484
|
+
function To(e, t = !1) {
|
|
3485
|
+
return e == null ? null : t && e.vnode.ctx || e.parent;
|
|
3486
|
+
}
|
|
3487
|
+
function Lo(e, t, n) {
|
|
3488
|
+
let s = null;
|
|
3489
|
+
Ws(() => {
|
|
3490
|
+
if (process.env.NODE_ENV !== "production" && t.vnode.el) {
|
|
3491
|
+
t.vnode.el.__VUE_I18N__ = n, s = Qt();
|
|
3492
|
+
const a = n;
|
|
3493
|
+
a[De] && a[De](s), s.on("*", qe);
|
|
3494
|
+
}
|
|
3495
|
+
}, t), xs(() => {
|
|
3496
|
+
const a = n;
|
|
3497
|
+
process.env.NODE_ENV !== "production" && t.vnode.el && t.vnode.el.__VUE_I18N__ && (s && s.off("*", qe), a[Je] && a[Je](), delete t.vnode.el.__VUE_I18N__), e.__deleteInstance(t);
|
|
3498
|
+
const r = a[Yt];
|
|
3499
|
+
r && (r(), delete a[Yt]);
|
|
3500
|
+
}, t);
|
|
3501
|
+
}
|
|
3502
|
+
const bo = [
|
|
3503
|
+
"locale",
|
|
3504
|
+
"fallbackLocale",
|
|
3505
|
+
"availableLocales"
|
|
3506
|
+
], Kn = ["t", "rt", "d", "n", "tm", "te"];
|
|
3507
|
+
function Oo(e, t) {
|
|
3508
|
+
const n = /* @__PURE__ */ Object.create(null);
|
|
3509
|
+
return bo.forEach((a) => {
|
|
3510
|
+
const r = Object.getOwnPropertyDescriptor(t, a);
|
|
3511
|
+
if (!r)
|
|
3512
|
+
throw ee(G.UNEXPECTED_ERROR);
|
|
3513
|
+
const o = Us(r.value) ? {
|
|
3514
|
+
get() {
|
|
3515
|
+
return r.value.value;
|
|
3516
|
+
},
|
|
3517
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3518
|
+
set(l) {
|
|
3519
|
+
r.value.value = l;
|
|
3520
|
+
}
|
|
3521
|
+
} : {
|
|
3522
|
+
get() {
|
|
3523
|
+
return r.get && r.get();
|
|
3524
|
+
}
|
|
3525
|
+
};
|
|
3526
|
+
Object.defineProperty(n, a, o);
|
|
3527
|
+
}), e.config.globalProperties.$i18n = n, Kn.forEach((a) => {
|
|
3528
|
+
const r = Object.getOwnPropertyDescriptor(t, a);
|
|
3529
|
+
if (!r || !r.value)
|
|
3530
|
+
throw ee(G.UNEXPECTED_ERROR);
|
|
3531
|
+
Object.defineProperty(e.config.globalProperties, `$${a}`, r);
|
|
3532
|
+
}), () => {
|
|
3533
|
+
delete e.config.globalProperties.$i18n, Kn.forEach((a) => {
|
|
3534
|
+
delete e.config.globalProperties[`$${a}`];
|
|
3535
|
+
});
|
|
3536
|
+
};
|
|
3537
|
+
}
|
|
3538
|
+
const Io = /* @__PURE__ */ Bt({
|
|
3539
|
+
/* eslint-disable */
|
|
3540
|
+
name: "i18n-d",
|
|
3541
|
+
props: Q({
|
|
3542
|
+
value: {
|
|
3543
|
+
type: [Number, Date],
|
|
3544
|
+
required: !0
|
|
3545
|
+
},
|
|
3546
|
+
format: {
|
|
3547
|
+
type: [String, Object]
|
|
3548
|
+
}
|
|
3549
|
+
}, an),
|
|
3550
|
+
/* eslint-enable */
|
|
3551
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3552
|
+
setup(e, t) {
|
|
3553
|
+
const n = e.i18n || rn({
|
|
3554
|
+
useScope: e.scope,
|
|
3555
|
+
__useComponent: !0
|
|
3556
|
+
});
|
|
3557
|
+
return Cs(e, t, Es, (...s) => (
|
|
3558
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3559
|
+
n[$t](...s)
|
|
3560
|
+
));
|
|
3561
|
+
}
|
|
3562
|
+
}), Bn = Io;
|
|
3563
|
+
Wr();
|
|
3564
|
+
cr($a);
|
|
3565
|
+
ur(ar);
|
|
3566
|
+
fr(ls);
|
|
3567
|
+
if (process.env.NODE_ENV !== "production" || __INTLIFY_PROD_DEVTOOLS__) {
|
|
3568
|
+
const e = Ae();
|
|
3569
|
+
e.__INTLIFY__ = !0, Ga(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__);
|
|
3570
|
+
}
|
|
3571
|
+
process.env.NODE_ENV;
|
|
3572
|
+
const vo = (e) => {
|
|
3573
|
+
const t = {};
|
|
3574
|
+
for (const n of e)
|
|
3575
|
+
t[n.key] = n.value;
|
|
3576
|
+
return t;
|
|
3577
|
+
}, yo = (e, t) => (t.forEach((n) => {
|
|
3578
|
+
const s = x.find(e, { key: n.key });
|
|
3579
|
+
s ? x.merge(s, n) : e.push(n);
|
|
3580
|
+
}), e), ft = "https://test.ihotel.cn", Ds = async (e) => ke.get(ft + "/i18n-web/sysoption/getsupportedlangs", {
|
|
19
3581
|
headers: {
|
|
20
|
-
Authorization:
|
|
3582
|
+
Authorization: e
|
|
21
3583
|
}
|
|
22
|
-
}),
|
|
23
|
-
appCode:
|
|
24
|
-
language:
|
|
25
|
-
page:
|
|
26
|
-
lastPullDate:
|
|
27
|
-
token:
|
|
28
|
-
}) => new Promise(async (
|
|
29
|
-
const
|
|
30
|
-
url:
|
|
3584
|
+
}), jn = async ({
|
|
3585
|
+
appCode: e,
|
|
3586
|
+
language: t = "zh-CN",
|
|
3587
|
+
page: n,
|
|
3588
|
+
lastPullDate: s,
|
|
3589
|
+
token: a
|
|
3590
|
+
}) => new Promise(async (r, o) => {
|
|
3591
|
+
const l = ft + "/i18n-web/kv_translate/kv_translates", u = s ? l + "?lastPullDate=" + s : l, _ = await ke({
|
|
3592
|
+
url: u,
|
|
31
3593
|
method: "GET",
|
|
32
3594
|
headers: {
|
|
33
|
-
appCode:
|
|
34
|
-
page:
|
|
35
|
-
language:
|
|
36
|
-
Authorization:
|
|
3595
|
+
appCode: e,
|
|
3596
|
+
page: n,
|
|
3597
|
+
language: t,
|
|
3598
|
+
Authorization: a
|
|
37
3599
|
}
|
|
38
3600
|
});
|
|
39
|
-
|
|
40
|
-
}),
|
|
41
|
-
url:
|
|
3601
|
+
_.data && _.data.result == 0 ? r(_.data.retVal) : r(_);
|
|
3602
|
+
}), Xn = async (e, t) => ke({
|
|
3603
|
+
url: ft + "/i18n-web/kv_translate/kv_translates",
|
|
42
3604
|
method: "POST",
|
|
43
|
-
data:
|
|
44
|
-
headers: { Authorization:
|
|
45
|
-
}),
|
|
46
|
-
url:
|
|
3605
|
+
data: e,
|
|
3606
|
+
headers: { Authorization: t }
|
|
3607
|
+
}), Ao = async (e, t) => ke({
|
|
3608
|
+
url: ft + "/i18n-web/kv_translate/batch",
|
|
47
3609
|
method: "POST",
|
|
48
|
-
data:
|
|
3610
|
+
data: e,
|
|
49
3611
|
headers: {
|
|
50
|
-
Authorization:
|
|
3612
|
+
Authorization: t
|
|
51
3613
|
}
|
|
52
|
-
}),
|
|
53
|
-
const
|
|
54
|
-
appCode:
|
|
55
|
-
language:
|
|
56
|
-
token:
|
|
57
|
-
},
|
|
58
|
-
if (!
|
|
59
|
-
const
|
|
60
|
-
|
|
3614
|
+
}), So = async ({ appCode: e, language: t = "zh-CN", token: n }) => new Promise(async (s, a) => {
|
|
3615
|
+
const r = ye.namespace(`I18N_${x.toUpper(e)}`), o = {
|
|
3616
|
+
appCode: e,
|
|
3617
|
+
language: t,
|
|
3618
|
+
token: n
|
|
3619
|
+
}, l = r.get(t);
|
|
3620
|
+
if (!l || !l.lastPullDate) {
|
|
3621
|
+
const u = await jn(o);
|
|
3622
|
+
u && (r.set(t, u), s(u.translatesDTOs));
|
|
61
3623
|
} else {
|
|
62
|
-
const { lastPullDate:
|
|
63
|
-
...
|
|
64
|
-
lastPullDate:
|
|
3624
|
+
const { lastPullDate: u } = l, _ = await jn({
|
|
3625
|
+
...o,
|
|
3626
|
+
lastPullDate: u
|
|
65
3627
|
});
|
|
66
|
-
if (
|
|
67
|
-
const
|
|
68
|
-
if (
|
|
69
|
-
|
|
3628
|
+
if (_) {
|
|
3629
|
+
const N = x.get(l, "translatesDTOs");
|
|
3630
|
+
if (x.isEmpty(_.translatesDTOs))
|
|
3631
|
+
s(N);
|
|
70
3632
|
else {
|
|
71
|
-
const
|
|
72
|
-
lastPullDate:
|
|
73
|
-
translatesDTOs:
|
|
3633
|
+
const T = yo(N, _.translatesDTOs), E = {
|
|
3634
|
+
lastPullDate: _.lastPullDate,
|
|
3635
|
+
translatesDTOs: T
|
|
74
3636
|
};
|
|
75
|
-
|
|
3637
|
+
ye.namespace(`I18N_${x.toUpper(e)}`).set(t, E, ":"), s(T);
|
|
76
3638
|
}
|
|
77
3639
|
}
|
|
78
3640
|
}
|
|
79
|
-
}),
|
|
3641
|
+
}), Co = {
|
|
80
3642
|
data() {
|
|
81
3643
|
return {
|
|
82
3644
|
isModalVisible: !1,
|
|
@@ -100,7 +3662,7 @@ const A = (t) => {
|
|
|
100
3662
|
return this.page.firstResult / this.page.pageSize + 1;
|
|
101
3663
|
},
|
|
102
3664
|
columns() {
|
|
103
|
-
let
|
|
3665
|
+
let e = this.type === "pageData" ? [{
|
|
104
3666
|
title: "字典键",
|
|
105
3667
|
width: 150,
|
|
106
3668
|
key: "dictKey"
|
|
@@ -109,67 +3671,67 @@ const A = (t) => {
|
|
|
109
3671
|
width: 90,
|
|
110
3672
|
key: "icon",
|
|
111
3673
|
fixed: "left",
|
|
112
|
-
render: (
|
|
113
|
-
row:
|
|
114
|
-
}) =>
|
|
3674
|
+
render: (t, {
|
|
3675
|
+
row: n
|
|
3676
|
+
}) => n.localhost ? te("span", {
|
|
115
3677
|
style: {
|
|
116
3678
|
color: "red"
|
|
117
3679
|
}
|
|
118
|
-
}, [
|
|
3680
|
+
}, [te("span", {
|
|
119
3681
|
style: {
|
|
120
3682
|
marginRight: "2px"
|
|
121
3683
|
}
|
|
122
|
-
}, [
|
|
3684
|
+
}, [Rt("本地")]), te(le("Tooltip"), {
|
|
123
3685
|
content: "该字段未在翻译数据库中",
|
|
124
3686
|
placement: "top",
|
|
125
3687
|
transfer: !0
|
|
126
3688
|
}, {
|
|
127
|
-
default: () => [
|
|
3689
|
+
default: () => [te(le("Icon"), {
|
|
128
3690
|
type: "ios-alert-outline"
|
|
129
3691
|
}, null)]
|
|
130
|
-
})]) :
|
|
3692
|
+
})]) : te("span", {
|
|
131
3693
|
style: {
|
|
132
3694
|
color: "green"
|
|
133
3695
|
}
|
|
134
|
-
}, [
|
|
3696
|
+
}, [n.common ? "全局" : "当前页"])
|
|
135
3697
|
}] : [{
|
|
136
3698
|
title: "页面",
|
|
137
3699
|
fixed: "left",
|
|
138
3700
|
width: 150,
|
|
139
3701
|
key: "page",
|
|
140
|
-
render: (
|
|
141
|
-
row:
|
|
142
|
-
}) =>
|
|
3702
|
+
render: (t, {
|
|
3703
|
+
row: n
|
|
3704
|
+
}) => t("span", {}, n.page === "common" ? "全局" : n.page)
|
|
143
3705
|
}];
|
|
144
|
-
return
|
|
145
|
-
const
|
|
146
|
-
return
|
|
147
|
-
title:
|
|
148
|
-
fixed:
|
|
149
|
-
key:
|
|
150
|
-
render: (
|
|
151
|
-
row:
|
|
152
|
-
index:
|
|
3706
|
+
return x.map(this.languages, (t) => {
|
|
3707
|
+
const n = t.code;
|
|
3708
|
+
return e.push({
|
|
3709
|
+
title: t.name,
|
|
3710
|
+
fixed: t.name === "中文" ? "left" : "",
|
|
3711
|
+
key: n,
|
|
3712
|
+
render: (s, {
|
|
3713
|
+
row: a,
|
|
3714
|
+
index: r
|
|
153
3715
|
}) => {
|
|
154
|
-
const
|
|
155
|
-
return
|
|
156
|
-
modelValue:
|
|
157
|
-
onOnChange: (
|
|
158
|
-
const
|
|
159
|
-
dictKey:
|
|
160
|
-
} =
|
|
161
|
-
dictKey:
|
|
3716
|
+
const o = a[n];
|
|
3717
|
+
return te(le("Input"), {
|
|
3718
|
+
modelValue: o,
|
|
3719
|
+
onOnChange: (l) => {
|
|
3720
|
+
const u = l.target.value, {
|
|
3721
|
+
dictKey: _
|
|
3722
|
+
} = a, N = x.findIndex(this.mySaveData, {
|
|
3723
|
+
dictKey: _
|
|
162
3724
|
});
|
|
163
|
-
|
|
164
|
-
...
|
|
165
|
-
[
|
|
3725
|
+
N > -1 ? this.mySaveData[N][n] = u : this.mySaveData.push({
|
|
3726
|
+
...a,
|
|
3727
|
+
[n]: u,
|
|
166
3728
|
page: this.type === "pageData" ? this.name : "common"
|
|
167
3729
|
});
|
|
168
3730
|
}
|
|
169
3731
|
}, null);
|
|
170
3732
|
}
|
|
171
3733
|
});
|
|
172
|
-
}),
|
|
3734
|
+
}), e;
|
|
173
3735
|
}
|
|
174
3736
|
},
|
|
175
3737
|
props: {
|
|
@@ -183,188 +3745,188 @@ const A = (t) => {
|
|
|
183
3745
|
this.searchText = "", this.type = "pageData", this.isModalVisible = !1;
|
|
184
3746
|
},
|
|
185
3747
|
openModal({
|
|
186
|
-
name:
|
|
3748
|
+
name: e
|
|
187
3749
|
}) {
|
|
188
|
-
this.isModalVisible || (this.isModalVisible = !0, this.name =
|
|
3750
|
+
this.isModalVisible || (this.isModalVisible = !0, this.name = e, this.init());
|
|
189
3751
|
},
|
|
190
|
-
findShallowStringDiff(
|
|
191
|
-
return
|
|
3752
|
+
findShallowStringDiff(e) {
|
|
3753
|
+
return x.find(e, ["_isEdit", !0]);
|
|
192
3754
|
},
|
|
193
3755
|
async saveData({
|
|
194
|
-
msg:
|
|
195
|
-
},
|
|
196
|
-
const
|
|
197
|
-
if (!
|
|
3756
|
+
msg: e = "保存成功"
|
|
3757
|
+
}, t = !0) {
|
|
3758
|
+
const n = this.mySaveData.map((r) => x.map(this.languages, (o) => {
|
|
3759
|
+
if (!x.isEmpty(r[o.code]))
|
|
198
3760
|
return {
|
|
199
|
-
key:
|
|
200
|
-
page:
|
|
201
|
-
lang:
|
|
202
|
-
value: o
|
|
3761
|
+
key: r.dictKey,
|
|
3762
|
+
page: r.page,
|
|
3763
|
+
lang: o.code,
|
|
3764
|
+
value: r[o.code]
|
|
203
3765
|
};
|
|
204
|
-
})),
|
|
205
|
-
if (
|
|
206
|
-
|
|
3766
|
+
})), s = x.compact(n[0]);
|
|
3767
|
+
if (x.isEmpty(s)) {
|
|
3768
|
+
se.error({
|
|
207
3769
|
content: "没有需要保存的数据"
|
|
208
3770
|
});
|
|
209
3771
|
return;
|
|
210
3772
|
}
|
|
211
|
-
const
|
|
3773
|
+
const a = await Ao({
|
|
212
3774
|
appCode: this.appCode,
|
|
213
|
-
data:
|
|
3775
|
+
data: s
|
|
214
3776
|
}, this.token);
|
|
215
|
-
|
|
216
|
-
content:
|
|
217
|
-
}), this.setLanguage(), this.initialData =
|
|
218
|
-
content:
|
|
3777
|
+
a && a.data.result === 0 ? (se.success({
|
|
3778
|
+
content: e || a.data.msg
|
|
3779
|
+
}), this.setLanguage(), this.initialData = x.cloneDeep(this.data.datas), t && this.closeModal(), this.mySaveData = []) : se.error({
|
|
3780
|
+
content: a.data.msg || "保存失败"
|
|
219
3781
|
});
|
|
220
3782
|
},
|
|
221
3783
|
async saveNoEqual() {
|
|
222
|
-
|
|
3784
|
+
x.isEmpty(this.mySaveData) || this.saveData({
|
|
223
3785
|
msg: "已为您自动保存"
|
|
224
3786
|
}, !1);
|
|
225
3787
|
},
|
|
226
|
-
changePage(
|
|
227
|
-
this.saveNoEqual(), this.type === "pageData" ? this.getPageData(
|
|
228
|
-
firstResult: (
|
|
3788
|
+
changePage(e) {
|
|
3789
|
+
this.saveNoEqual(), this.type === "pageData" ? this.getPageData(e) : this.search({
|
|
3790
|
+
firstResult: (e - 1) * this.page.pageSize
|
|
229
3791
|
});
|
|
230
3792
|
},
|
|
231
|
-
async getPageData(
|
|
3793
|
+
async getPageData(e = 1) {
|
|
232
3794
|
this.loading = !0;
|
|
233
|
-
const
|
|
3795
|
+
const t = await Xn({
|
|
234
3796
|
appCode: this.appCode,
|
|
235
3797
|
searchBlur: this.searchText,
|
|
236
3798
|
commaSeparatedKeys: this.translationKeys.toString(),
|
|
237
|
-
commaSeparatedLangs:
|
|
3799
|
+
commaSeparatedLangs: x.map(this.languages, "code").toString(),
|
|
238
3800
|
firstResult: 0,
|
|
239
3801
|
pageSize: 99999
|
|
240
3802
|
}, this.token);
|
|
241
|
-
if (
|
|
242
|
-
let
|
|
243
|
-
|
|
244
|
-
const
|
|
245
|
-
dictKey:
|
|
3803
|
+
if (t) {
|
|
3804
|
+
let n = [];
|
|
3805
|
+
x.forEach(this.translationKeys, (s) => {
|
|
3806
|
+
const a = x.find(t.data.retVal.datas, {
|
|
3807
|
+
dictKey: s,
|
|
246
3808
|
page: this.name
|
|
247
3809
|
});
|
|
248
|
-
if (
|
|
249
|
-
|
|
3810
|
+
if (a)
|
|
3811
|
+
n.push(a);
|
|
250
3812
|
else {
|
|
251
|
-
const
|
|
252
|
-
dictKey:
|
|
3813
|
+
const r = x.find(t.data.retVal.datas, {
|
|
3814
|
+
dictKey: s,
|
|
253
3815
|
page: "common"
|
|
254
3816
|
});
|
|
255
|
-
|
|
256
|
-
...
|
|
3817
|
+
r ? n.push({
|
|
3818
|
+
...r,
|
|
257
3819
|
page: this.name,
|
|
258
3820
|
common: !0
|
|
259
|
-
}) :
|
|
260
|
-
dictKey:
|
|
3821
|
+
}) : n.push({
|
|
3822
|
+
dictKey: s,
|
|
261
3823
|
page: this.name,
|
|
262
|
-
"zh-CN":
|
|
3824
|
+
"zh-CN": s,
|
|
263
3825
|
localhost: !0
|
|
264
3826
|
});
|
|
265
3827
|
}
|
|
266
|
-
}), this.pageData =
|
|
3828
|
+
}), this.pageData = x.cloneDeep(n), this.initialData = x.cloneDeep(this.pageData), this.pageDataShow = n.slice((e - 1) * this.page.pageSize, e * this.page.pageSize), this.loading = !1;
|
|
267
3829
|
}
|
|
268
3830
|
},
|
|
269
|
-
async search(
|
|
3831
|
+
async search(e, t) {
|
|
270
3832
|
this.loading = !0;
|
|
271
|
-
const
|
|
3833
|
+
const n = await Xn({
|
|
272
3834
|
appCode: this.appCode,
|
|
273
3835
|
searchBlur: this.searchText,
|
|
274
|
-
commaSeparatedLangs:
|
|
3836
|
+
commaSeparatedLangs: x.map(this.languages, "code").toString(),
|
|
275
3837
|
firstResult: 0,
|
|
276
3838
|
pageSize: 10,
|
|
277
|
-
...
|
|
3839
|
+
...e
|
|
278
3840
|
}, this.token);
|
|
279
|
-
|
|
280
|
-
firstResult:
|
|
281
|
-
pageSize:
|
|
282
|
-
totalRows:
|
|
3841
|
+
n && (this.initialData = x.cloneDeep(n.data.retVal.datas), this.data = x.cloneDeep(n.data.retVal.datas), this.page = {
|
|
3842
|
+
firstResult: n.data.retVal.firstResult,
|
|
3843
|
+
pageSize: n.data.retVal.pageSize,
|
|
3844
|
+
totalRows: n.data.retVal.totalRows
|
|
283
3845
|
}), this.loading = !1;
|
|
284
3846
|
},
|
|
285
|
-
changeTab(
|
|
286
|
-
this.type =
|
|
3847
|
+
changeTab(e) {
|
|
3848
|
+
this.type = e, e === "data" ? this.search() : this.getPageData();
|
|
287
3849
|
},
|
|
288
3850
|
async init() {
|
|
289
|
-
const
|
|
290
|
-
|
|
3851
|
+
const e = await Ds(this.token);
|
|
3852
|
+
e && e.data.result == 0 ? (this.languages = e.data.retVal, this.getPageData()) : se.error("获取语言失败,出错了");
|
|
291
3853
|
}
|
|
292
3854
|
}
|
|
293
|
-
},
|
|
294
|
-
const
|
|
295
|
-
for (const [
|
|
296
|
-
|
|
297
|
-
return
|
|
298
|
-
},
|
|
3855
|
+
}, Do = (e, t) => {
|
|
3856
|
+
const n = e.__vccOpts || e;
|
|
3857
|
+
for (const [s, a] of t)
|
|
3858
|
+
n[s] = a;
|
|
3859
|
+
return n;
|
|
3860
|
+
}, ko = { key: 0 }, Po = {
|
|
299
3861
|
key: 0,
|
|
300
3862
|
class: "extra"
|
|
301
|
-
},
|
|
302
|
-
function
|
|
303
|
-
const
|
|
304
|
-
return
|
|
305
|
-
modelValue:
|
|
306
|
-
"onUpdate:modelValue":
|
|
3863
|
+
}, Ro = { class: "gc_i18n_page" }, Mo = { style: { display: "flex" } };
|
|
3864
|
+
function Fo(e, t, n, s, a, r) {
|
|
3865
|
+
const o = le("Spin"), l = le("Table"), u = le("TabPane"), _ = le("Input"), N = le("Tabs"), T = le("Page"), E = le("Button"), A = le("Modal");
|
|
3866
|
+
return de(), Ie(A, {
|
|
3867
|
+
modelValue: a.isModalVisible,
|
|
3868
|
+
"onUpdate:modelValue": t[4] || (t[4] = (C) => a.isModalVisible = C),
|
|
307
3869
|
"mask-closable": !1,
|
|
308
3870
|
width: 70,
|
|
309
3871
|
title: "多语言管理中心",
|
|
310
3872
|
"footer-hide": "",
|
|
311
|
-
onOnCancel:
|
|
3873
|
+
onOnCancel: r.closeModal
|
|
312
3874
|
}, {
|
|
313
|
-
default:
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
modelValue:
|
|
317
|
-
"onUpdate:modelValue":
|
|
3875
|
+
default: ve(() => [
|
|
3876
|
+
a.isModalVisible ? (de(), un("div", ko, [
|
|
3877
|
+
te(N, {
|
|
3878
|
+
modelValue: a.type,
|
|
3879
|
+
"onUpdate:modelValue": t[1] || (t[1] = (C) => a.type = C),
|
|
318
3880
|
type: "card",
|
|
319
3881
|
class: "gc_i18n_tabs",
|
|
320
|
-
onOnClick:
|
|
3882
|
+
onOnClick: r.changeTab
|
|
321
3883
|
}, {
|
|
322
|
-
extra:
|
|
323
|
-
|
|
324
|
-
|
|
3884
|
+
extra: ve(() => [
|
|
3885
|
+
a.type === "data" ? (de(), un("div", Po, [
|
|
3886
|
+
te(_, {
|
|
325
3887
|
prefix: "ios-search",
|
|
326
3888
|
placeholder: "请输入搜索内容",
|
|
327
|
-
modelValue:
|
|
328
|
-
"onUpdate:modelValue":
|
|
3889
|
+
modelValue: a.searchText,
|
|
3890
|
+
"onUpdate:modelValue": t[0] || (t[0] = (C) => a.searchText = C),
|
|
329
3891
|
clearable: "",
|
|
330
|
-
onOnEnter:
|
|
331
|
-
onOnClear:
|
|
3892
|
+
onOnEnter: r.search,
|
|
3893
|
+
onOnClear: r.search
|
|
332
3894
|
}, null, 8, ["modelValue", "onOnEnter", "onOnClear"])
|
|
333
|
-
])) :
|
|
3895
|
+
])) : fn("", !0)
|
|
334
3896
|
]),
|
|
335
|
-
default:
|
|
336
|
-
|
|
3897
|
+
default: ve(() => [
|
|
3898
|
+
te(u, {
|
|
337
3899
|
name: "pageData",
|
|
338
3900
|
label: "当前页面"
|
|
339
3901
|
}, {
|
|
340
|
-
default:
|
|
341
|
-
|
|
3902
|
+
default: ve(() => [
|
|
3903
|
+
a.loading ? (de(), Ie(o, {
|
|
342
3904
|
key: 0,
|
|
343
3905
|
class: "gc_i18n_spin"
|
|
344
|
-
})) : (
|
|
3906
|
+
})) : (de(), Ie(l, {
|
|
345
3907
|
key: 1,
|
|
346
3908
|
border: "",
|
|
347
3909
|
height: 380,
|
|
348
|
-
columns:
|
|
349
|
-
data:
|
|
3910
|
+
columns: r.columns,
|
|
3911
|
+
data: a.pageDataShow
|
|
350
3912
|
}, null, 8, ["columns", "data"]))
|
|
351
3913
|
]),
|
|
352
3914
|
_: 1
|
|
353
3915
|
}),
|
|
354
|
-
|
|
3916
|
+
te(u, {
|
|
355
3917
|
name: "data",
|
|
356
3918
|
label: "当前应用"
|
|
357
3919
|
}, {
|
|
358
|
-
default:
|
|
359
|
-
|
|
3920
|
+
default: ve(() => [
|
|
3921
|
+
a.loading ? (de(), Ie(o, {
|
|
360
3922
|
key: 0,
|
|
361
3923
|
class: "gc_i18n_spin"
|
|
362
|
-
})) : (
|
|
3924
|
+
})) : (de(), Ie(l, {
|
|
363
3925
|
key: 1,
|
|
364
3926
|
border: "",
|
|
365
3927
|
height: 380,
|
|
366
|
-
columns:
|
|
367
|
-
data:
|
|
3928
|
+
columns: r.columns,
|
|
3929
|
+
data: a.data
|
|
368
3930
|
}, null, 8, ["columns", "data"]))
|
|
369
3931
|
]),
|
|
370
3932
|
_: 1
|
|
@@ -372,247 +3934,243 @@ function Q(t, e, a, n, s, o) {
|
|
|
372
3934
|
]),
|
|
373
3935
|
_: 1
|
|
374
3936
|
}, 8, ["modelValue", "onOnClick"]),
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
3937
|
+
tt("div", Ro, [
|
|
3938
|
+
tt("div", Mo, [
|
|
3939
|
+
a.type === "pageData" ? (de(), Ie(T, {
|
|
378
3940
|
key: 0,
|
|
379
|
-
modelValue:
|
|
380
|
-
"onUpdate:modelValue":
|
|
381
|
-
total:
|
|
3941
|
+
modelValue: r.firstResult,
|
|
3942
|
+
"onUpdate:modelValue": t[2] || (t[2] = (C) => r.firstResult = C),
|
|
3943
|
+
total: n.translationKeys.length,
|
|
382
3944
|
"page-size": 10,
|
|
383
3945
|
simple: "",
|
|
384
3946
|
"show-total": "",
|
|
385
|
-
onOnChange:
|
|
386
|
-
}, null, 8, ["modelValue", "total", "onOnChange"])) : (
|
|
3947
|
+
onOnChange: r.changePage
|
|
3948
|
+
}, null, 8, ["modelValue", "total", "onOnChange"])) : (de(), Ie(T, {
|
|
387
3949
|
key: 1,
|
|
388
|
-
modelValue:
|
|
389
|
-
"onUpdate:modelValue":
|
|
390
|
-
total:
|
|
3950
|
+
modelValue: r.firstResult,
|
|
3951
|
+
"onUpdate:modelValue": t[3] || (t[3] = (C) => r.firstResult = C),
|
|
3952
|
+
total: a.page.totalRows,
|
|
391
3953
|
"page-size": 10,
|
|
392
3954
|
simple: "",
|
|
393
3955
|
"show-total": "",
|
|
394
|
-
onOnChange:
|
|
3956
|
+
onOnChange: r.changePage
|
|
395
3957
|
}, null, 8, ["modelValue", "total", "onOnChange"])),
|
|
396
|
-
|
|
3958
|
+
tt("div", null, " 共 " + Gs(a.type === "pageData" ? n.translationKeys.length : a.page.totalRows) + " 项数据 ", 1)
|
|
397
3959
|
]),
|
|
398
|
-
|
|
399
|
-
|
|
3960
|
+
tt("div", null, [
|
|
3961
|
+
te(E, {
|
|
400
3962
|
style: { "margin-right": "10px" },
|
|
401
|
-
onClick:
|
|
3963
|
+
onClick: r.closeModal
|
|
402
3964
|
}, {
|
|
403
|
-
default:
|
|
404
|
-
|
|
3965
|
+
default: ve(() => t[5] || (t[5] = [
|
|
3966
|
+
Rt("关闭")
|
|
405
3967
|
])),
|
|
406
3968
|
_: 1
|
|
407
3969
|
}, 8, ["onClick"]),
|
|
408
|
-
|
|
3970
|
+
te(E, {
|
|
409
3971
|
type: "primary",
|
|
410
|
-
onClick:
|
|
3972
|
+
onClick: r.saveData
|
|
411
3973
|
}, {
|
|
412
|
-
default:
|
|
413
|
-
|
|
3974
|
+
default: ve(() => t[6] || (t[6] = [
|
|
3975
|
+
Rt("保存")
|
|
414
3976
|
])),
|
|
415
3977
|
_: 1
|
|
416
3978
|
}, 8, ["onClick"])
|
|
417
3979
|
])
|
|
418
3980
|
])
|
|
419
|
-
])) :
|
|
3981
|
+
])) : fn("", !0)
|
|
420
3982
|
]),
|
|
421
3983
|
_: 1
|
|
422
3984
|
}, 8, ["modelValue", "onOnCancel"]);
|
|
423
3985
|
}
|
|
424
|
-
const
|
|
425
|
-
function
|
|
426
|
-
const
|
|
427
|
-
if (
|
|
428
|
-
let n;
|
|
429
|
-
for (; (n = a.exec(t.template)) !== null; )
|
|
430
|
-
e.push(n[2]);
|
|
431
|
-
}
|
|
432
|
-
if (t.render) {
|
|
433
|
-
const n = t.render.toString();
|
|
3986
|
+
const wo = /* @__PURE__ */ Do(Co, [["render", Fo], ["__scopeId", "data-v-4c99c88b"]]);
|
|
3987
|
+
function ks(e) {
|
|
3988
|
+
const t = [], n = /(?:\$t|_ctx\.\$t)\s*\(\s*(['"])([^'"]+?)\1/gs;
|
|
3989
|
+
if (e.template) {
|
|
434
3990
|
let s;
|
|
435
|
-
for (; (s =
|
|
436
|
-
|
|
3991
|
+
for (; (s = n.exec(e.template)) !== null; )
|
|
3992
|
+
t.push(s[2]);
|
|
437
3993
|
}
|
|
438
|
-
if (
|
|
439
|
-
const
|
|
440
|
-
let
|
|
441
|
-
for (; (
|
|
442
|
-
|
|
3994
|
+
if (e.render) {
|
|
3995
|
+
const s = e.render.toString();
|
|
3996
|
+
let a;
|
|
3997
|
+
for (; (a = n.exec(s)) !== null; )
|
|
3998
|
+
t.push(a[2]);
|
|
443
3999
|
}
|
|
444
|
-
if (
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
4000
|
+
if (e.setup) {
|
|
4001
|
+
const s = e.setup.toString();
|
|
4002
|
+
let a;
|
|
4003
|
+
for (; (a = n.exec(s)) !== null; )
|
|
4004
|
+
t.push(a[2]);
|
|
4005
|
+
}
|
|
4006
|
+
if (e.methods)
|
|
4007
|
+
for (const s in e.methods) {
|
|
4008
|
+
const a = e.methods[s].toString();
|
|
4009
|
+
let r;
|
|
4010
|
+
for (; (r = n.exec(a)) !== null; )
|
|
4011
|
+
t.push(r[2]);
|
|
450
4012
|
}
|
|
451
|
-
if (
|
|
452
|
-
for (const
|
|
453
|
-
const
|
|
454
|
-
|
|
4013
|
+
if (e.components)
|
|
4014
|
+
for (const s in e.components) {
|
|
4015
|
+
const a = e.components[s];
|
|
4016
|
+
t.push(...ks(a));
|
|
455
4017
|
}
|
|
456
|
-
return [...new Set(
|
|
4018
|
+
return [...new Set(t)];
|
|
457
4019
|
}
|
|
458
|
-
|
|
4020
|
+
se.config({
|
|
459
4021
|
duration: 3
|
|
460
4022
|
});
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
(
|
|
464
|
-
(
|
|
4023
|
+
ke.defaults.timeout = 6e4;
|
|
4024
|
+
ke.interceptors.request.use(
|
|
4025
|
+
(e) => (e.headers["Content-Type"] = "application/json", e),
|
|
4026
|
+
(e) => (se.error({
|
|
465
4027
|
content: "请求超时!"
|
|
466
|
-
}), Promise.resolve(
|
|
4028
|
+
}), Promise.resolve(e))
|
|
467
4029
|
);
|
|
468
|
-
|
|
469
|
-
(
|
|
470
|
-
const { nomsg:
|
|
471
|
-
return
|
|
472
|
-
content:
|
|
473
|
-
}) :
|
|
4030
|
+
ke.interceptors.response.use(
|
|
4031
|
+
(e) => {
|
|
4032
|
+
const { nomsg: t } = e.config.headers;
|
|
4033
|
+
return e.status && e.status != 200 ? t || se.error({
|
|
4034
|
+
content: e.data.message || "未知错误"
|
|
4035
|
+
}) : e.data.success = !0, e;
|
|
474
4036
|
},
|
|
475
|
-
(
|
|
476
|
-
content: `${
|
|
477
|
-
}) :
|
|
4037
|
+
(e) => (e.response ? e.response.status == 504 || e.response.status == 404 ? se.error({ content: "服务器被吃了⊙﹏⊙∥" }) : e.response.status == 403 ? se.error({ content: "权限不足,请联系管理员!" }) : se.error({
|
|
4038
|
+
content: `${e.response.status}:${e.response.statusText || e.response.error}`
|
|
4039
|
+
}) : e.code === "ECONNABORTED" && e.message.indexOf("timeout") !== -1 ? se.error({
|
|
478
4040
|
content: "请求超时!"
|
|
479
|
-
}) :
|
|
4041
|
+
}) : se.error({ content: e.message || "未知错误!" }), Promise.resolve(e))
|
|
480
4042
|
);
|
|
481
|
-
function
|
|
482
|
-
const
|
|
4043
|
+
function Uo(e) {
|
|
4044
|
+
const t = {
|
|
483
4045
|
alg: "HS512"
|
|
484
4046
|
// 算法
|
|
485
|
-
},
|
|
486
|
-
orgCode:
|
|
487
|
-
},
|
|
488
|
-
return
|
|
489
|
-
}
|
|
490
|
-
class
|
|
491
|
-
constructor(
|
|
492
|
-
const { router:
|
|
493
|
-
this.token =
|
|
494
|
-
|
|
495
|
-
}).catch((
|
|
496
|
-
console.error("路由首次加载出错:",
|
|
497
|
-
}),
|
|
4047
|
+
}, n = {
|
|
4048
|
+
orgCode: e
|
|
4049
|
+
}, s = JSON.stringify(t), a = JSON.stringify(n);
|
|
4050
|
+
return Hs.JWS.sign("HS512", s, a, "");
|
|
4051
|
+
}
|
|
4052
|
+
class Ko {
|
|
4053
|
+
constructor(t = {}) {
|
|
4054
|
+
const { router: n, appCode: s, messages: a, token: r, orgCode: o } = t;
|
|
4055
|
+
this.token = r || Uo(o), this.loadI18n = !0, this.appCode = s, this.router = n, this.locale = ye.get("I18N_LANGUAGE") || navigator.language || "zh-CN", this.modalLoad = !1, this.name = "", this.messages = a || {}, this.translationKeys = [], this.initRouterGuards(), this.initI18n(t), this.router.isReady().then(async () => {
|
|
4056
|
+
this.createModal();
|
|
4057
|
+
}).catch((l) => {
|
|
4058
|
+
console.error("路由首次加载出错:", l);
|
|
4059
|
+
}), Rs.bind("shift > t", (l) => {
|
|
498
4060
|
this.configInstance.openModal({ name: this.name });
|
|
499
4061
|
}), this.setupLanguageChangeListener();
|
|
500
4062
|
}
|
|
501
4063
|
// 监听浏览器语言变化
|
|
502
4064
|
setupLanguageChangeListener() {
|
|
503
4065
|
"onlanguagechange" in window && window.addEventListener("languagechange", () => {
|
|
504
|
-
const
|
|
505
|
-
|
|
4066
|
+
const t = navigator.language;
|
|
4067
|
+
t !== this.locale && this.setLanguage(t);
|
|
506
4068
|
});
|
|
507
4069
|
}
|
|
508
4070
|
// 初始化路由守卫
|
|
509
4071
|
initRouterGuards() {
|
|
510
|
-
this.router.beforeEach(async (
|
|
511
|
-
const { language:
|
|
512
|
-
if (this.configInstance && this.configInstance.closeModal(), this.name =
|
|
513
|
-
let
|
|
514
|
-
if (typeof
|
|
4072
|
+
this.router.beforeEach(async (t, n, s) => {
|
|
4073
|
+
const { language: a, token: r } = t.query;
|
|
4074
|
+
if (this.configInstance && this.configInstance.closeModal(), this.name = t.name, r && this.setToken(r), this.loadI18n && await this.setLanguage(a || this.locale), this.loadI18n = !1, t.matched.length > 0) {
|
|
4075
|
+
let o = t.matched[0].components.default;
|
|
4076
|
+
if (typeof o == "function" && o.toString().includes("import("))
|
|
515
4077
|
try {
|
|
516
|
-
|
|
517
|
-
} catch (
|
|
518
|
-
console.error("加载异步组件时出错:",
|
|
4078
|
+
o = await o(), o = o.default;
|
|
4079
|
+
} catch (l) {
|
|
4080
|
+
console.error("加载异步组件时出错:", l), s();
|
|
519
4081
|
return;
|
|
520
4082
|
}
|
|
521
|
-
this.translationKeys =
|
|
4083
|
+
this.translationKeys = ks(o);
|
|
522
4084
|
}
|
|
523
|
-
|
|
4085
|
+
s();
|
|
524
4086
|
});
|
|
525
4087
|
}
|
|
526
4088
|
// 初始化 i18n 实例
|
|
527
|
-
initI18n(
|
|
528
|
-
this.i18n =
|
|
4089
|
+
initI18n(t) {
|
|
4090
|
+
this.i18n = mo({
|
|
529
4091
|
locale: this.locale,
|
|
530
|
-
allowComposition: !0,
|
|
531
4092
|
globalInjection: !0,
|
|
532
4093
|
legacy: !1,
|
|
533
4094
|
silentTranslationWarn: !0,
|
|
534
4095
|
silentFallbackWarn: !0,
|
|
535
4096
|
missingWarn: !1,
|
|
536
4097
|
fallbackWarn: !1,
|
|
537
|
-
...
|
|
4098
|
+
...t
|
|
538
4099
|
});
|
|
539
|
-
const
|
|
540
|
-
globalThis.$t = this.i18n.global.t = (
|
|
541
|
-
var
|
|
542
|
-
const
|
|
543
|
-
if (
|
|
544
|
-
const
|
|
545
|
-
if (
|
|
546
|
-
return
|
|
4100
|
+
const n = this.i18n.global.t;
|
|
4101
|
+
globalThis.$t = this.i18n.global.t = (s, a) => {
|
|
4102
|
+
var o, l, u;
|
|
4103
|
+
const r = (u = (l = (o = this.router) == null ? void 0 : o.currentRoute) == null ? void 0 : l.value) == null ? void 0 : u.name;
|
|
4104
|
+
if (r) {
|
|
4105
|
+
const _ = `${r}.${s}`, N = n(_);
|
|
4106
|
+
if (N !== _)
|
|
4107
|
+
return N;
|
|
547
4108
|
{
|
|
548
|
-
const
|
|
549
|
-
return
|
|
4109
|
+
const T = `common.${s}`, E = n(T);
|
|
4110
|
+
return E !== T ? E : n(s, a);
|
|
550
4111
|
}
|
|
551
|
-
}
|
|
552
|
-
|
|
553
|
-
}, globalThis.$deepScan = function(
|
|
554
|
-
return
|
|
555
|
-
}, globalThis.$
|
|
556
|
-
|
|
557
|
-
return i.get(c, "value", s);
|
|
558
|
-
}, globalThis.$changeLocale = this.changeLocale = this.i18n.global.changeLocale = async (n) => {
|
|
559
|
-
await this.setLanguage(n || this.locale);
|
|
4112
|
+
} else
|
|
4113
|
+
return n(s, a);
|
|
4114
|
+
}, globalThis.$deepScan = function(s) {
|
|
4115
|
+
return s;
|
|
4116
|
+
}, globalThis.$changeLocale = this.changeLocale = this.i18n.global.changeLocale = async (s) => {
|
|
4117
|
+
await this.setLanguage(s || this.locale);
|
|
560
4118
|
};
|
|
561
4119
|
}
|
|
562
|
-
setToken(
|
|
563
|
-
this.token =
|
|
4120
|
+
setToken(t) {
|
|
4121
|
+
this.token = t;
|
|
564
4122
|
}
|
|
565
|
-
getLanguage(
|
|
566
|
-
return
|
|
4123
|
+
getLanguage(t) {
|
|
4124
|
+
return ye.get("I18N_TEST.zh-TW");
|
|
567
4125
|
}
|
|
568
|
-
async getLanguages(
|
|
569
|
-
const
|
|
570
|
-
if (
|
|
571
|
-
return
|
|
4126
|
+
async getLanguages(t = !1) {
|
|
4127
|
+
const n = ye.get("I18N_LANGUAGES");
|
|
4128
|
+
if (n && !t)
|
|
4129
|
+
return n;
|
|
572
4130
|
{
|
|
573
|
-
const
|
|
4131
|
+
const s = await Ds({
|
|
574
4132
|
appCode: this.appCode,
|
|
575
4133
|
token: this.token
|
|
576
4134
|
});
|
|
577
|
-
if (
|
|
578
|
-
const
|
|
579
|
-
return
|
|
4135
|
+
if (s.data) {
|
|
4136
|
+
const a = x.get(s.data, "retVal");
|
|
4137
|
+
return ye.set("I18N_LANGUAGES", a), a;
|
|
580
4138
|
}
|
|
581
4139
|
}
|
|
582
4140
|
}
|
|
583
|
-
async setLanguage(
|
|
584
|
-
return new Promise(async (
|
|
585
|
-
const
|
|
4141
|
+
async setLanguage(t) {
|
|
4142
|
+
return new Promise(async (n, s) => {
|
|
4143
|
+
const a = await So({
|
|
586
4144
|
appCode: this.appCode,
|
|
587
|
-
language:
|
|
4145
|
+
language: t || this.locale,
|
|
588
4146
|
token: this.token
|
|
589
4147
|
});
|
|
590
|
-
if (
|
|
591
|
-
const
|
|
4148
|
+
if (a) {
|
|
4149
|
+
const r = vo(a), o = x.assign(
|
|
592
4150
|
{},
|
|
593
|
-
|
|
594
|
-
|
|
4151
|
+
x.get(this.messages, t),
|
|
4152
|
+
r
|
|
595
4153
|
);
|
|
596
|
-
this.i18n.global.setLocaleMessage(
|
|
4154
|
+
this.i18n.global.setLocaleMessage(t, o);
|
|
597
4155
|
}
|
|
598
|
-
this.locale =
|
|
4156
|
+
this.locale = t, this.i18n.global.locale.value = t, ye.set("I18N_LANGUAGE", t), n(!0);
|
|
599
4157
|
});
|
|
600
4158
|
}
|
|
601
|
-
createModal(
|
|
602
|
-
this.modalLoad = !0, this.configInstance =
|
|
4159
|
+
createModal(t) {
|
|
4160
|
+
this.modalLoad = !0, this.configInstance = Ys(wo, {
|
|
603
4161
|
appCode: this.appCode,
|
|
604
4162
|
token: this.token,
|
|
605
4163
|
setLanguage: this.setLanguage.bind(this, this.locale),
|
|
606
|
-
name: this.name,
|
|
4164
|
+
name: t || this.name,
|
|
607
4165
|
translationKeys: this.translationKeys
|
|
608
|
-
}).use(
|
|
4166
|
+
}).use(cn).mount(document.createElement("div"));
|
|
609
4167
|
}
|
|
610
|
-
install(
|
|
611
|
-
|
|
4168
|
+
install(t, n = {}) {
|
|
4169
|
+
t.use(cn, {
|
|
612
4170
|
i18n: this.i18n
|
|
613
|
-
}),
|
|
4171
|
+
}), t.use(this.i18n);
|
|
614
4172
|
}
|
|
615
4173
|
}
|
|
616
4174
|
export {
|
|
617
|
-
|
|
4175
|
+
Ko as default
|
|
618
4176
|
};
|