@vc-shell/framework 1.1.63 → 1.1.64

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,947 @@
1
+ import { l as Se, e as ne, a as Z, v as re } from "./vendor-intlify-shared-CE1Dfvjf.js";
2
+ /*!
3
+ * message-compiler v11.1.11
4
+ * (c) 2025 kazuya kawaguchi
5
+ * Released under the MIT License.
6
+ */
7
+ function ke(r, n, c) {
8
+ return { line: r, column: n, offset: c };
9
+ }
10
+ function q(r, n, c) {
11
+ return { start: r, end: n };
12
+ }
13
+ const d = {
14
+ // tokenizer error codes
15
+ EXPECTED_TOKEN: 1,
16
+ INVALID_TOKEN_IN_PLACEHOLDER: 2,
17
+ UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER: 3,
18
+ UNKNOWN_ESCAPE_SEQUENCE: 4,
19
+ INVALID_UNICODE_ESCAPE_SEQUENCE: 5,
20
+ UNBALANCED_CLOSING_BRACE: 6,
21
+ UNTERMINATED_CLOSING_BRACE: 7,
22
+ EMPTY_PLACEHOLDER: 8,
23
+ NOT_ALLOW_NEST_PLACEHOLDER: 9,
24
+ INVALID_LINKED_FORMAT: 10,
25
+ // parser error codes
26
+ MUST_HAVE_MESSAGES_IN_PLURAL: 11,
27
+ UNEXPECTED_EMPTY_LINKED_MODIFIER: 12,
28
+ UNEXPECTED_EMPTY_LINKED_KEY: 13,
29
+ UNEXPECTED_LEXICAL_ANALYSIS: 14,
30
+ // generator error codes
31
+ UNHANDLED_CODEGEN_NODE_TYPE: 15,
32
+ // minifier error codes
33
+ UNHANDLED_MINIFIER_NODE_TYPE: 16
34
+ }, Je = 17, De = {
35
+ // tokenizer error messages
36
+ [d.EXPECTED_TOKEN]: "Expected token: '{0}'",
37
+ [d.INVALID_TOKEN_IN_PLACEHOLDER]: "Invalid token in placeholder: '{0}'",
38
+ [d.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER]: "Unterminated single quote in placeholder",
39
+ [d.UNKNOWN_ESCAPE_SEQUENCE]: "Unknown escape sequence: \\{0}",
40
+ [d.INVALID_UNICODE_ESCAPE_SEQUENCE]: "Invalid unicode escape sequence: {0}",
41
+ [d.UNBALANCED_CLOSING_BRACE]: "Unbalanced closing brace",
42
+ [d.UNTERMINATED_CLOSING_BRACE]: "Unterminated closing brace",
43
+ [d.EMPTY_PLACEHOLDER]: "Empty placeholder",
44
+ [d.NOT_ALLOW_NEST_PLACEHOLDER]: "Not allowed nest placeholder",
45
+ [d.INVALID_LINKED_FORMAT]: "Invalid linked format",
46
+ // parser error messages
47
+ [d.MUST_HAVE_MESSAGES_IN_PLURAL]: "Plural must have messages",
48
+ [d.UNEXPECTED_EMPTY_LINKED_MODIFIER]: "Unexpected empty linked modifier",
49
+ [d.UNEXPECTED_EMPTY_LINKED_KEY]: "Unexpected empty linked key",
50
+ [d.UNEXPECTED_LEXICAL_ANALYSIS]: "Unexpected lexical analysis in token: '{0}'",
51
+ // generator error messages
52
+ [d.UNHANDLED_CODEGEN_NODE_TYPE]: "unhandled codegen node type: '{0}'",
53
+ // minimizer error messages
54
+ [d.UNHANDLED_MINIFIER_NODE_TYPE]: "unhandled mimifier node type: '{0}'"
55
+ };
56
+ function G(r, n, c = {}) {
57
+ const { domain: a, messages: _, args: u } = c, h = process.env.NODE_ENV !== "production" ? Se((_ || De)[r] || "", ...u || []) : r, I = new SyntaxError(String(h));
58
+ return I.code = r, n && (I.location = n), I.domain = a, I;
59
+ }
60
+ function je(r) {
61
+ throw r;
62
+ }
63
+ const Pe = /<\/?[\w\s="/.':;#-\/]+>/, Ze = (r) => Pe.test(r), X = " ", Oe = "\r", y = `
64
+ `, me = "\u2028", ye = "\u2029";
65
+ function be(r) {
66
+ const n = r;
67
+ let c = 0, a = 1, _ = 1, u = 0;
68
+ const h = (p) => n[p] === Oe && n[p + 1] === y, I = (p) => n[p] === y, S = (p) => n[p] === ye, O = (p) => n[p] === me, b = (p) => h(p) || I(p) || S(p) || O(p), k = () => c, T = () => a, R = () => _, v = () => u, A = (p) => h(p) || S(p) || O(p) ? y : n[p], C = () => A(c), s = () => A(c + u);
69
+ function l() {
70
+ return u = 0, b(c) && (a++, _ = 0), h(c) && c++, c++, _++, n[c];
71
+ }
72
+ function E() {
73
+ return h(c + u) && u++, u++, n[c + u];
74
+ }
75
+ function o() {
76
+ c = 0, a = 1, _ = 1, u = 0;
77
+ }
78
+ function L(p = 0) {
79
+ u = p;
80
+ }
81
+ function N() {
82
+ const p = c + u;
83
+ for (; p !== c; )
84
+ l();
85
+ u = 0;
86
+ }
87
+ return {
88
+ index: k,
89
+ line: T,
90
+ column: R,
91
+ peekOffset: v,
92
+ charAt: A,
93
+ currentChar: C,
94
+ currentPeek: s,
95
+ next: l,
96
+ peek: E,
97
+ reset: o,
98
+ resetPeek: L,
99
+ skipToPeek: N
100
+ };
101
+ }
102
+ const Y = void 0, Re = ".", z = "'", Ue = "tokenizer";
103
+ function ve(r, n = {}) {
104
+ const c = n.location !== !1, a = be(r), _ = () => a.index(), u = () => ke(a.line(), a.column(), a.index()), h = u(), I = _(), S = {
105
+ currentType: 13,
106
+ offset: I,
107
+ startLoc: h,
108
+ endLoc: h,
109
+ lastType: 13,
110
+ lastOffset: I,
111
+ lastStartLoc: h,
112
+ lastEndLoc: h,
113
+ braceNest: 0,
114
+ inLinked: !1,
115
+ text: ""
116
+ }, O = () => S, { onError: b } = n;
117
+ function k(e, t, i, ...f) {
118
+ const D = O();
119
+ if (t.column += i, t.offset += i, b) {
120
+ const P = c ? q(D.startLoc, t) : null, U = G(e, P, {
121
+ domain: Ue,
122
+ args: f
123
+ });
124
+ b(U);
125
+ }
126
+ }
127
+ function T(e, t, i) {
128
+ e.endLoc = u(), e.currentType = t;
129
+ const f = { type: t };
130
+ return c && (f.loc = q(e.startLoc, e.endLoc)), i != null && (f.value = i), f;
131
+ }
132
+ const R = (e) => T(
133
+ e,
134
+ 13
135
+ /* TokenTypes.EOF */
136
+ );
137
+ function v(e, t) {
138
+ return e.currentChar() === t ? (e.next(), t) : (k(d.EXPECTED_TOKEN, u(), 0, t), "");
139
+ }
140
+ function A(e) {
141
+ let t = "";
142
+ for (; e.currentPeek() === X || e.currentPeek() === y; )
143
+ t += e.currentPeek(), e.peek();
144
+ return t;
145
+ }
146
+ function C(e) {
147
+ const t = A(e);
148
+ return e.skipToPeek(), t;
149
+ }
150
+ function s(e) {
151
+ if (e === Y)
152
+ return !1;
153
+ const t = e.charCodeAt(0);
154
+ return t >= 97 && t <= 122 || // a-z
155
+ t >= 65 && t <= 90 || // A-Z
156
+ t === 95;
157
+ }
158
+ function l(e) {
159
+ if (e === Y)
160
+ return !1;
161
+ const t = e.charCodeAt(0);
162
+ return t >= 48 && t <= 57;
163
+ }
164
+ function E(e, t) {
165
+ const { currentType: i } = t;
166
+ if (i !== 2)
167
+ return !1;
168
+ A(e);
169
+ const f = s(e.currentPeek());
170
+ return e.resetPeek(), f;
171
+ }
172
+ function o(e, t) {
173
+ const { currentType: i } = t;
174
+ if (i !== 2)
175
+ return !1;
176
+ A(e);
177
+ const f = e.currentPeek() === "-" ? e.peek() : e.currentPeek(), D = l(f);
178
+ return e.resetPeek(), D;
179
+ }
180
+ function L(e, t) {
181
+ const { currentType: i } = t;
182
+ if (i !== 2)
183
+ return !1;
184
+ A(e);
185
+ const f = e.currentPeek() === z;
186
+ return e.resetPeek(), f;
187
+ }
188
+ function N(e, t) {
189
+ const { currentType: i } = t;
190
+ if (i !== 7)
191
+ return !1;
192
+ A(e);
193
+ const f = e.currentPeek() === ".";
194
+ return e.resetPeek(), f;
195
+ }
196
+ function p(e, t) {
197
+ const { currentType: i } = t;
198
+ if (i !== 8)
199
+ return !1;
200
+ A(e);
201
+ const f = s(e.currentPeek());
202
+ return e.resetPeek(), f;
203
+ }
204
+ function w(e, t) {
205
+ const { currentType: i } = t;
206
+ if (!(i === 7 || i === 11))
207
+ return !1;
208
+ A(e);
209
+ const f = e.currentPeek() === ":";
210
+ return e.resetPeek(), f;
211
+ }
212
+ function m(e, t) {
213
+ const { currentType: i } = t;
214
+ if (i !== 9)
215
+ return !1;
216
+ const f = () => {
217
+ const P = e.currentPeek();
218
+ return P === "{" ? s(e.peek()) : P === "@" || P === "|" || P === ":" || P === "." || P === X || !P ? !1 : P === y ? (e.peek(), f()) : F(e, !1);
219
+ }, D = f();
220
+ return e.resetPeek(), D;
221
+ }
222
+ function g(e) {
223
+ A(e);
224
+ const t = e.currentPeek() === "|";
225
+ return e.resetPeek(), t;
226
+ }
227
+ function F(e, t = !0) {
228
+ const i = (D = !1, P = "") => {
229
+ const U = e.currentPeek();
230
+ return U === "{" || U === "@" || !U ? D : U === "|" ? !(P === X || P === y) : U === X ? (e.peek(), i(!0, X)) : U === y ? (e.peek(), i(!0, y)) : !0;
231
+ }, f = i();
232
+ return t && e.resetPeek(), f;
233
+ }
234
+ function H(e, t) {
235
+ const i = e.currentChar();
236
+ return i === Y ? Y : t(i) ? (e.next(), i) : null;
237
+ }
238
+ function se(e) {
239
+ const t = e.charCodeAt(0);
240
+ return t >= 97 && t <= 122 || // a-z
241
+ t >= 65 && t <= 90 || // A-Z
242
+ t >= 48 && t <= 57 || // 0-9
243
+ t === 95 || // _
244
+ t === 36;
245
+ }
246
+ function ie(e) {
247
+ return H(e, se);
248
+ }
249
+ function ce(e) {
250
+ const t = e.charCodeAt(0);
251
+ return t >= 97 && t <= 122 || // a-z
252
+ t >= 65 && t <= 90 || // A-Z
253
+ t >= 48 && t <= 57 || // 0-9
254
+ t === 95 || // _
255
+ t === 36 || // $
256
+ t === 45;
257
+ }
258
+ function ue(e) {
259
+ return H(e, ce);
260
+ }
261
+ function ae(e) {
262
+ const t = e.charCodeAt(0);
263
+ return t >= 48 && t <= 57;
264
+ }
265
+ function oe(e) {
266
+ return H(e, ae);
267
+ }
268
+ function le(e) {
269
+ const t = e.charCodeAt(0);
270
+ return t >= 48 && t <= 57 || // 0-9
271
+ t >= 65 && t <= 70 || // A-F
272
+ t >= 97 && t <= 102;
273
+ }
274
+ function fe(e) {
275
+ return H(e, le);
276
+ }
277
+ function J(e) {
278
+ let t = "", i = "";
279
+ for (; t = oe(e); )
280
+ i += t;
281
+ return i;
282
+ }
283
+ function Ee(e) {
284
+ let t = "";
285
+ for (; ; ) {
286
+ const i = e.currentChar();
287
+ if (i === "{" || i === "}" || i === "@" || i === "|" || !i)
288
+ break;
289
+ if (i === X || i === y)
290
+ if (F(e))
291
+ t += i, e.next();
292
+ else {
293
+ if (g(e))
294
+ break;
295
+ t += i, e.next();
296
+ }
297
+ else
298
+ t += i, e.next();
299
+ }
300
+ return t;
301
+ }
302
+ function de(e) {
303
+ C(e);
304
+ let t = "", i = "";
305
+ for (; t = ue(e); )
306
+ i += t;
307
+ return e.currentChar() === Y && k(d.UNTERMINATED_CLOSING_BRACE, u(), 0), i;
308
+ }
309
+ function Le(e) {
310
+ C(e);
311
+ let t = "";
312
+ return e.currentChar() === "-" ? (e.next(), t += `-${J(e)}`) : t += J(e), e.currentChar() === Y && k(d.UNTERMINATED_CLOSING_BRACE, u(), 0), t;
313
+ }
314
+ function Ne(e) {
315
+ return e !== z && e !== y;
316
+ }
317
+ function _e(e) {
318
+ C(e), v(e, "'");
319
+ let t = "", i = "";
320
+ for (; t = H(e, Ne); )
321
+ t === "\\" ? i += pe(e) : i += t;
322
+ const f = e.currentChar();
323
+ return f === y || f === Y ? (k(d.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER, u(), 0), f === y && (e.next(), v(e, "'")), i) : (v(e, "'"), i);
324
+ }
325
+ function pe(e) {
326
+ const t = e.currentChar();
327
+ switch (t) {
328
+ case "\\":
329
+ case "'":
330
+ return e.next(), `\\${t}`;
331
+ case "u":
332
+ return j(e, t, 4);
333
+ case "U":
334
+ return j(e, t, 6);
335
+ default:
336
+ return k(d.UNKNOWN_ESCAPE_SEQUENCE, u(), 0, t), "";
337
+ }
338
+ }
339
+ function j(e, t, i) {
340
+ v(e, t);
341
+ let f = "";
342
+ for (let D = 0; D < i; D++) {
343
+ const P = fe(e);
344
+ if (!P) {
345
+ k(d.INVALID_UNICODE_ESCAPE_SEQUENCE, u(), 0, `\\${t}${f}${e.currentChar()}`);
346
+ break;
347
+ }
348
+ f += P;
349
+ }
350
+ return `\\${t}${f}`;
351
+ }
352
+ function Ie(e) {
353
+ return e !== "{" && e !== "}" && e !== X && e !== y;
354
+ }
355
+ function Ce(e) {
356
+ C(e);
357
+ let t = "", i = "";
358
+ for (; t = H(e, Ie); )
359
+ i += t;
360
+ return i;
361
+ }
362
+ function he(e) {
363
+ let t = "", i = "";
364
+ for (; t = ie(e); )
365
+ i += t;
366
+ return i;
367
+ }
368
+ function Te(e) {
369
+ const t = (i) => {
370
+ const f = e.currentChar();
371
+ return f === "{" || f === "@" || f === "|" || f === "(" || f === ")" || !f || f === X ? i : (i += f, e.next(), t(i));
372
+ };
373
+ return t("");
374
+ }
375
+ function V(e) {
376
+ C(e);
377
+ const t = v(
378
+ e,
379
+ "|"
380
+ /* TokenChars.Pipe */
381
+ );
382
+ return C(e), t;
383
+ }
384
+ function B(e, t) {
385
+ let i = null;
386
+ switch (e.currentChar()) {
387
+ case "{":
388
+ return t.braceNest >= 1 && k(d.NOT_ALLOW_NEST_PLACEHOLDER, u(), 0), e.next(), i = T(
389
+ t,
390
+ 2,
391
+ "{"
392
+ /* TokenChars.BraceLeft */
393
+ ), C(e), t.braceNest++, i;
394
+ case "}":
395
+ return t.braceNest > 0 && t.currentType === 2 && k(d.EMPTY_PLACEHOLDER, u(), 0), e.next(), i = T(
396
+ t,
397
+ 3,
398
+ "}"
399
+ /* TokenChars.BraceRight */
400
+ ), t.braceNest--, t.braceNest > 0 && C(e), t.inLinked && t.braceNest === 0 && (t.inLinked = !1), i;
401
+ case "@":
402
+ return t.braceNest > 0 && k(d.UNTERMINATED_CLOSING_BRACE, u(), 0), i = $(e, t) || R(t), t.braceNest = 0, i;
403
+ default: {
404
+ let D = !0, P = !0, U = !0;
405
+ if (g(e))
406
+ return t.braceNest > 0 && k(d.UNTERMINATED_CLOSING_BRACE, u(), 0), i = T(t, 1, V(e)), t.braceNest = 0, t.inLinked = !1, i;
407
+ if (t.braceNest > 0 && (t.currentType === 4 || t.currentType === 5 || t.currentType === 6))
408
+ return k(d.UNTERMINATED_CLOSING_BRACE, u(), 0), t.braceNest = 0, Q(e, t);
409
+ if (D = E(e, t))
410
+ return i = T(t, 4, de(e)), C(e), i;
411
+ if (P = o(e, t))
412
+ return i = T(t, 5, Le(e)), C(e), i;
413
+ if (U = L(e, t))
414
+ return i = T(t, 6, _e(e)), C(e), i;
415
+ if (!D && !P && !U)
416
+ return i = T(t, 12, Ce(e)), k(d.INVALID_TOKEN_IN_PLACEHOLDER, u(), 0, i.value), C(e), i;
417
+ break;
418
+ }
419
+ }
420
+ return i;
421
+ }
422
+ function $(e, t) {
423
+ const { currentType: i } = t;
424
+ let f = null;
425
+ const D = e.currentChar();
426
+ switch ((i === 7 || i === 8 || i === 11 || i === 9) && (D === y || D === X) && k(d.INVALID_LINKED_FORMAT, u(), 0), D) {
427
+ case "@":
428
+ return e.next(), f = T(
429
+ t,
430
+ 7,
431
+ "@"
432
+ /* TokenChars.LinkedAlias */
433
+ ), t.inLinked = !0, f;
434
+ case ".":
435
+ return C(e), e.next(), T(
436
+ t,
437
+ 8,
438
+ "."
439
+ /* TokenChars.LinkedDot */
440
+ );
441
+ case ":":
442
+ return C(e), e.next(), T(
443
+ t,
444
+ 9,
445
+ ":"
446
+ /* TokenChars.LinkedDelimiter */
447
+ );
448
+ default:
449
+ return g(e) ? (f = T(t, 1, V(e)), t.braceNest = 0, t.inLinked = !1, f) : N(e, t) || w(e, t) ? (C(e), $(e, t)) : p(e, t) ? (C(e), T(t, 11, he(e))) : m(e, t) ? (C(e), D === "{" ? B(e, t) || f : T(t, 10, Te(e))) : (i === 7 && k(d.INVALID_LINKED_FORMAT, u(), 0), t.braceNest = 0, t.inLinked = !1, Q(e, t));
450
+ }
451
+ }
452
+ function Q(e, t) {
453
+ let i = {
454
+ type: 13
455
+ /* TokenTypes.EOF */
456
+ };
457
+ if (t.braceNest > 0)
458
+ return B(e, t) || R(t);
459
+ if (t.inLinked)
460
+ return $(e, t) || R(t);
461
+ switch (e.currentChar()) {
462
+ case "{":
463
+ return B(e, t) || R(t);
464
+ case "}":
465
+ return k(d.UNBALANCED_CLOSING_BRACE, u(), 0), e.next(), T(
466
+ t,
467
+ 3,
468
+ "}"
469
+ /* TokenChars.BraceRight */
470
+ );
471
+ case "@":
472
+ return $(e, t) || R(t);
473
+ default: {
474
+ if (g(e))
475
+ return i = T(t, 1, V(e)), t.braceNest = 0, t.inLinked = !1, i;
476
+ if (F(e))
477
+ return T(t, 0, Ee(e));
478
+ break;
479
+ }
480
+ }
481
+ return i;
482
+ }
483
+ function Ae() {
484
+ const { currentType: e, offset: t, startLoc: i, endLoc: f } = S;
485
+ return S.lastType = e, S.lastOffset = t, S.lastStartLoc = i, S.lastEndLoc = f, S.offset = _(), S.startLoc = u(), a.currentChar() === Y ? T(
486
+ S,
487
+ 13
488
+ /* TokenTypes.EOF */
489
+ ) : Q(a, S);
490
+ }
491
+ return {
492
+ nextToken: Ae,
493
+ currentOffset: _,
494
+ currentPosition: u,
495
+ context: O
496
+ };
497
+ }
498
+ const Me = "parser", Xe = /(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;
499
+ function we(r, n, c) {
500
+ switch (r) {
501
+ case "\\\\":
502
+ return "\\";
503
+ // eslint-disable-next-line no-useless-escape
504
+ case "\\'":
505
+ return "'";
506
+ default: {
507
+ const a = parseInt(n || c, 16);
508
+ return a <= 55295 || a >= 57344 ? String.fromCodePoint(a) : "�";
509
+ }
510
+ }
511
+ }
512
+ function Ye(r = {}) {
513
+ const n = r.location !== !1, { onError: c } = r;
514
+ function a(s, l, E, o, ...L) {
515
+ const N = s.currentPosition();
516
+ if (N.offset += o, N.column += o, c) {
517
+ const p = n ? q(E, N) : null, w = G(l, p, {
518
+ domain: Me,
519
+ args: L
520
+ });
521
+ c(w);
522
+ }
523
+ }
524
+ function _(s, l, E) {
525
+ const o = { type: s };
526
+ return n && (o.start = l, o.end = l, o.loc = { start: E, end: E }), o;
527
+ }
528
+ function u(s, l, E, o) {
529
+ n && (s.end = l, s.loc && (s.loc.end = E));
530
+ }
531
+ function h(s, l) {
532
+ const E = s.context(), o = _(3, E.offset, E.startLoc);
533
+ return o.value = l, u(o, s.currentOffset(), s.currentPosition()), o;
534
+ }
535
+ function I(s, l) {
536
+ const E = s.context(), { lastOffset: o, lastStartLoc: L } = E, N = _(5, o, L);
537
+ return N.index = parseInt(l, 10), s.nextToken(), u(N, s.currentOffset(), s.currentPosition()), N;
538
+ }
539
+ function S(s, l) {
540
+ const E = s.context(), { lastOffset: o, lastStartLoc: L } = E, N = _(4, o, L);
541
+ return N.key = l, s.nextToken(), u(N, s.currentOffset(), s.currentPosition()), N;
542
+ }
543
+ function O(s, l) {
544
+ const E = s.context(), { lastOffset: o, lastStartLoc: L } = E, N = _(9, o, L);
545
+ return N.value = l.replace(Xe, we), s.nextToken(), u(N, s.currentOffset(), s.currentPosition()), N;
546
+ }
547
+ function b(s) {
548
+ const l = s.nextToken(), E = s.context(), { lastOffset: o, lastStartLoc: L } = E, N = _(8, o, L);
549
+ return l.type !== 11 ? (a(s, d.UNEXPECTED_EMPTY_LINKED_MODIFIER, E.lastStartLoc, 0), N.value = "", u(N, o, L), {
550
+ nextConsumeToken: l,
551
+ node: N
552
+ }) : (l.value == null && a(s, d.UNEXPECTED_LEXICAL_ANALYSIS, E.lastStartLoc, 0, M(l)), N.value = l.value || "", u(N, s.currentOffset(), s.currentPosition()), {
553
+ node: N
554
+ });
555
+ }
556
+ function k(s, l) {
557
+ const E = s.context(), o = _(7, E.offset, E.startLoc);
558
+ return o.value = l, u(o, s.currentOffset(), s.currentPosition()), o;
559
+ }
560
+ function T(s) {
561
+ const l = s.context(), E = _(6, l.offset, l.startLoc);
562
+ let o = s.nextToken();
563
+ if (o.type === 8) {
564
+ const L = b(s);
565
+ E.modifier = L.node, o = L.nextConsumeToken || s.nextToken();
566
+ }
567
+ switch (o.type !== 9 && a(s, d.UNEXPECTED_LEXICAL_ANALYSIS, l.lastStartLoc, 0, M(o)), o = s.nextToken(), o.type === 2 && (o = s.nextToken()), o.type) {
568
+ case 10:
569
+ o.value == null && a(s, d.UNEXPECTED_LEXICAL_ANALYSIS, l.lastStartLoc, 0, M(o)), E.key = k(s, o.value || "");
570
+ break;
571
+ case 4:
572
+ o.value == null && a(s, d.UNEXPECTED_LEXICAL_ANALYSIS, l.lastStartLoc, 0, M(o)), E.key = S(s, o.value || "");
573
+ break;
574
+ case 5:
575
+ o.value == null && a(s, d.UNEXPECTED_LEXICAL_ANALYSIS, l.lastStartLoc, 0, M(o)), E.key = I(s, o.value || "");
576
+ break;
577
+ case 6:
578
+ o.value == null && a(s, d.UNEXPECTED_LEXICAL_ANALYSIS, l.lastStartLoc, 0, M(o)), E.key = O(s, o.value || "");
579
+ break;
580
+ default: {
581
+ a(s, d.UNEXPECTED_EMPTY_LINKED_KEY, l.lastStartLoc, 0);
582
+ const L = s.context(), N = _(7, L.offset, L.startLoc);
583
+ return N.value = "", u(N, L.offset, L.startLoc), E.key = N, u(E, L.offset, L.startLoc), {
584
+ nextConsumeToken: o,
585
+ node: E
586
+ };
587
+ }
588
+ }
589
+ return u(E, s.currentOffset(), s.currentPosition()), {
590
+ node: E
591
+ };
592
+ }
593
+ function R(s) {
594
+ const l = s.context(), E = l.currentType === 1 ? s.currentOffset() : l.offset, o = l.currentType === 1 ? l.endLoc : l.startLoc, L = _(2, E, o);
595
+ L.items = [];
596
+ let N = null;
597
+ do {
598
+ const m = N || s.nextToken();
599
+ switch (N = null, m.type) {
600
+ case 0:
601
+ m.value == null && a(s, d.UNEXPECTED_LEXICAL_ANALYSIS, l.lastStartLoc, 0, M(m)), L.items.push(h(s, m.value || ""));
602
+ break;
603
+ case 5:
604
+ m.value == null && a(s, d.UNEXPECTED_LEXICAL_ANALYSIS, l.lastStartLoc, 0, M(m)), L.items.push(I(s, m.value || ""));
605
+ break;
606
+ case 4:
607
+ m.value == null && a(s, d.UNEXPECTED_LEXICAL_ANALYSIS, l.lastStartLoc, 0, M(m)), L.items.push(S(s, m.value || ""));
608
+ break;
609
+ case 6:
610
+ m.value == null && a(s, d.UNEXPECTED_LEXICAL_ANALYSIS, l.lastStartLoc, 0, M(m)), L.items.push(O(s, m.value || ""));
611
+ break;
612
+ case 7: {
613
+ const g = T(s);
614
+ L.items.push(g.node), N = g.nextConsumeToken || null;
615
+ break;
616
+ }
617
+ }
618
+ } while (l.currentType !== 13 && l.currentType !== 1);
619
+ const p = l.currentType === 1 ? l.lastOffset : s.currentOffset(), w = l.currentType === 1 ? l.lastEndLoc : s.currentPosition();
620
+ return u(L, p, w), L;
621
+ }
622
+ function v(s, l, E, o) {
623
+ const L = s.context();
624
+ let N = o.items.length === 0;
625
+ const p = _(1, l, E);
626
+ p.cases = [], p.cases.push(o);
627
+ do {
628
+ const w = R(s);
629
+ N || (N = w.items.length === 0), p.cases.push(w);
630
+ } while (L.currentType !== 13);
631
+ return N && a(s, d.MUST_HAVE_MESSAGES_IN_PLURAL, E, 0), u(p, s.currentOffset(), s.currentPosition()), p;
632
+ }
633
+ function A(s) {
634
+ const l = s.context(), { offset: E, startLoc: o } = l, L = R(s);
635
+ return l.currentType === 13 ? L : v(s, E, o, L);
636
+ }
637
+ function C(s) {
638
+ const l = ve(s, ne({}, r)), E = l.context(), o = _(0, E.offset, E.startLoc);
639
+ return n && o.loc && (o.loc.source = s), o.body = A(l), r.onCacheKey && (o.cacheKey = r.onCacheKey(s)), E.currentType !== 13 && a(l, d.UNEXPECTED_LEXICAL_ANALYSIS, E.lastStartLoc, 0, s[E.offset] || ""), u(o, l.currentOffset(), l.currentPosition()), o;
640
+ }
641
+ return { parse: C };
642
+ }
643
+ function M(r) {
644
+ if (r.type === 13)
645
+ return "EOF";
646
+ const n = (r.value || "").replace(/\r?\n/gu, "\\n");
647
+ return n.length > 10 ? n.slice(0, 9) + "…" : n;
648
+ }
649
+ function ge(r, n = {}) {
650
+ const c = {
651
+ ast: r,
652
+ helpers: /* @__PURE__ */ new Set()
653
+ };
654
+ return { context: () => c, helper: (u) => (c.helpers.add(u), u) };
655
+ }
656
+ function ee(r, n) {
657
+ for (let c = 0; c < r.length; c++)
658
+ W(r[c], n);
659
+ }
660
+ function W(r, n) {
661
+ switch (r.type) {
662
+ case 1:
663
+ ee(r.cases, n), n.helper(
664
+ "plural"
665
+ /* HelperNameMap.PLURAL */
666
+ );
667
+ break;
668
+ case 2:
669
+ ee(r.items, n);
670
+ break;
671
+ case 6: {
672
+ W(r.key, n), n.helper(
673
+ "linked"
674
+ /* HelperNameMap.LINKED */
675
+ ), n.helper(
676
+ "type"
677
+ /* HelperNameMap.TYPE */
678
+ );
679
+ break;
680
+ }
681
+ case 5:
682
+ n.helper(
683
+ "interpolate"
684
+ /* HelperNameMap.INTERPOLATE */
685
+ ), n.helper(
686
+ "list"
687
+ /* HelperNameMap.LIST */
688
+ );
689
+ break;
690
+ case 4:
691
+ n.helper(
692
+ "interpolate"
693
+ /* HelperNameMap.INTERPOLATE */
694
+ ), n.helper(
695
+ "named"
696
+ /* HelperNameMap.NAMED */
697
+ );
698
+ break;
699
+ }
700
+ }
701
+ function He(r, n = {}) {
702
+ const c = ge(r);
703
+ c.helper(
704
+ "normalize"
705
+ /* HelperNameMap.NORMALIZE */
706
+ ), r.body && W(r.body, c);
707
+ const a = c.context();
708
+ r.helpers = Array.from(a.helpers);
709
+ }
710
+ function Ke(r) {
711
+ const n = r.body;
712
+ return n.type === 2 ? te(n) : n.cases.forEach((c) => te(c)), r;
713
+ }
714
+ function te(r) {
715
+ if (r.items.length === 1) {
716
+ const n = r.items[0];
717
+ (n.type === 3 || n.type === 9) && (r.static = n.value, delete n.value);
718
+ } else {
719
+ const n = [];
720
+ for (let c = 0; c < r.items.length; c++) {
721
+ const a = r.items[c];
722
+ if (!(a.type === 3 || a.type === 9) || a.value == null)
723
+ break;
724
+ n.push(a.value);
725
+ }
726
+ if (n.length === r.items.length) {
727
+ r.static = re(n);
728
+ for (let c = 0; c < r.items.length; c++) {
729
+ const a = r.items[c];
730
+ (a.type === 3 || a.type === 9) && delete a.value;
731
+ }
732
+ }
733
+ }
734
+ }
735
+ const xe = "minifier";
736
+ function K(r) {
737
+ switch (r.t = r.type, r.type) {
738
+ case 0: {
739
+ const n = r;
740
+ K(n.body), n.b = n.body, delete n.body;
741
+ break;
742
+ }
743
+ case 1: {
744
+ const n = r, c = n.cases;
745
+ for (let a = 0; a < c.length; a++)
746
+ K(c[a]);
747
+ n.c = c, delete n.cases;
748
+ break;
749
+ }
750
+ case 2: {
751
+ const n = r, c = n.items;
752
+ for (let a = 0; a < c.length; a++)
753
+ K(c[a]);
754
+ n.i = c, delete n.items, n.static && (n.s = n.static, delete n.static);
755
+ break;
756
+ }
757
+ case 3:
758
+ case 9:
759
+ case 8:
760
+ case 7: {
761
+ const n = r;
762
+ n.value && (n.v = n.value, delete n.value);
763
+ break;
764
+ }
765
+ case 6: {
766
+ const n = r;
767
+ K(n.key), n.k = n.key, delete n.key, n.modifier && (K(n.modifier), n.m = n.modifier, delete n.modifier);
768
+ break;
769
+ }
770
+ case 5: {
771
+ const n = r;
772
+ n.i = n.index, delete n.index;
773
+ break;
774
+ }
775
+ case 4: {
776
+ const n = r;
777
+ n.k = n.key, delete n.key;
778
+ break;
779
+ }
780
+ default:
781
+ if (process.env.NODE_ENV !== "production")
782
+ throw G(d.UNHANDLED_MINIFIER_NODE_TYPE, null, {
783
+ domain: xe,
784
+ args: [r.type]
785
+ });
786
+ }
787
+ delete r.type;
788
+ }
789
+ const $e = "parser";
790
+ function Ge(r, n) {
791
+ const { filename: c, breakLineCode: a, needIndent: _ } = n, u = n.location !== !1, h = {
792
+ filename: c,
793
+ code: "",
794
+ column: 1,
795
+ line: 1,
796
+ offset: 0,
797
+ map: void 0,
798
+ breakLineCode: a,
799
+ needIndent: _,
800
+ indentLevel: 0
801
+ };
802
+ u && r.loc && (h.source = r.loc.source);
803
+ const I = () => h;
804
+ function S(A, C) {
805
+ h.code += A;
806
+ }
807
+ function O(A, C = !0) {
808
+ const s = C ? a : "";
809
+ S(_ ? s + " ".repeat(A) : s);
810
+ }
811
+ function b(A = !0) {
812
+ const C = ++h.indentLevel;
813
+ A && O(C);
814
+ }
815
+ function k(A = !0) {
816
+ const C = --h.indentLevel;
817
+ A && O(C);
818
+ }
819
+ function T() {
820
+ O(h.indentLevel);
821
+ }
822
+ return {
823
+ context: I,
824
+ push: S,
825
+ indent: b,
826
+ deindent: k,
827
+ newline: T,
828
+ helper: (A) => `_${A}`,
829
+ needIndent: () => h.needIndent
830
+ };
831
+ }
832
+ function Fe(r, n) {
833
+ const { helper: c } = r;
834
+ r.push(`${c(
835
+ "linked"
836
+ /* HelperNameMap.LINKED */
837
+ )}(`), x(r, n.key), n.modifier ? (r.push(", "), x(r, n.modifier), r.push(", _type")) : r.push(", undefined, _type"), r.push(")");
838
+ }
839
+ function Ve(r, n) {
840
+ const { helper: c, needIndent: a } = r;
841
+ r.push(`${c(
842
+ "normalize"
843
+ /* HelperNameMap.NORMALIZE */
844
+ )}([`), r.indent(a());
845
+ const _ = n.items.length;
846
+ for (let u = 0; u < _ && (x(r, n.items[u]), u !== _ - 1); u++)
847
+ r.push(", ");
848
+ r.deindent(a()), r.push("])");
849
+ }
850
+ function Be(r, n) {
851
+ const { helper: c, needIndent: a } = r;
852
+ if (n.cases.length > 1) {
853
+ r.push(`${c(
854
+ "plural"
855
+ /* HelperNameMap.PLURAL */
856
+ )}([`), r.indent(a());
857
+ const _ = n.cases.length;
858
+ for (let u = 0; u < _ && (x(r, n.cases[u]), u !== _ - 1); u++)
859
+ r.push(", ");
860
+ r.deindent(a()), r.push("])");
861
+ }
862
+ }
863
+ function Qe(r, n) {
864
+ n.body ? x(r, n.body) : r.push("null");
865
+ }
866
+ function x(r, n) {
867
+ const { helper: c } = r;
868
+ switch (n.type) {
869
+ case 0:
870
+ Qe(r, n);
871
+ break;
872
+ case 1:
873
+ Be(r, n);
874
+ break;
875
+ case 2:
876
+ Ve(r, n);
877
+ break;
878
+ case 6:
879
+ Fe(r, n);
880
+ break;
881
+ case 8:
882
+ r.push(JSON.stringify(n.value), n);
883
+ break;
884
+ case 7:
885
+ r.push(JSON.stringify(n.value), n);
886
+ break;
887
+ case 5:
888
+ r.push(`${c(
889
+ "interpolate"
890
+ /* HelperNameMap.INTERPOLATE */
891
+ )}(${c(
892
+ "list"
893
+ /* HelperNameMap.LIST */
894
+ )}(${n.index}))`, n);
895
+ break;
896
+ case 4:
897
+ r.push(`${c(
898
+ "interpolate"
899
+ /* HelperNameMap.INTERPOLATE */
900
+ )}(${c(
901
+ "named"
902
+ /* HelperNameMap.NAMED */
903
+ )}(${JSON.stringify(n.key)}))`, n);
904
+ break;
905
+ case 9:
906
+ r.push(JSON.stringify(n.value), n);
907
+ break;
908
+ case 3:
909
+ r.push(JSON.stringify(n.value), n);
910
+ break;
911
+ default:
912
+ if (process.env.NODE_ENV !== "production")
913
+ throw G(d.UNHANDLED_CODEGEN_NODE_TYPE, null, {
914
+ domain: $e,
915
+ args: [n.type]
916
+ });
917
+ }
918
+ }
919
+ const qe = (r, n = {}) => {
920
+ const c = Z(n.mode) ? n.mode : "normal", a = Z(n.filename) ? n.filename : "message.intl";
921
+ n.sourceMap;
922
+ const _ = n.breakLineCode != null ? n.breakLineCode : c === "arrow" ? ";" : `
923
+ `, u = n.needIndent ? n.needIndent : c !== "arrow", h = r.helpers || [], I = Ge(r, {
924
+ filename: a,
925
+ breakLineCode: _,
926
+ needIndent: u
927
+ });
928
+ I.push(c === "normal" ? "function __msg__ (ctx) {" : "(ctx) => {"), I.indent(u), h.length > 0 && (I.push(`const { ${re(h.map((b) => `${b}: _${b}`), ", ")} } = ctx`), I.newline()), I.push("return "), x(I, r), I.deindent(u), I.push("}"), delete r.helpers;
929
+ const { code: S, map: O } = I.context();
930
+ return {
931
+ ast: r,
932
+ code: S,
933
+ map: O ? O.toJSON() : void 0
934
+ // eslint-disable-line @typescript-eslint/no-explicit-any
935
+ };
936
+ };
937
+ function ze(r, n = {}) {
938
+ const c = ne({}, n), a = !!c.jit, _ = !!c.minify, u = c.optimize == null ? !0 : c.optimize, I = Ye(c).parse(r);
939
+ return a ? (u && Ke(I), _ && K(I), { ast: I, code: "" }) : (He(I, c), qe(I, c));
940
+ }
941
+ export {
942
+ Je as C,
943
+ je as a,
944
+ ze as b,
945
+ G as c,
946
+ Ze as d
947
+ };