intl-messageformat 9.11.4 → 10.0.1
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/intl-messageformat.esm.js +3255 -1266
- package/intl-messageformat.iife.js +3304 -1355
- package/lib/src/core.d.ts +2 -0
- package/lib/src/core.d.ts.map +1 -1
- package/lib/src/core.js +21 -5
- package/lib/src/formatters.js +1 -1
- package/package.json +5 -5
- package/src/core.d.ts +2 -0
- package/src/core.d.ts.map +1 -1
- package/src/core.js +21 -5
- package/src/formatters.js +1 -1
|
@@ -1,1344 +1,3334 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
2
7
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
9
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
3
20
|
var __publicField = (obj, key, value) => {
|
|
4
21
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
22
|
return value;
|
|
6
23
|
};
|
|
7
24
|
|
|
8
|
-
// node_modules/tslib/tslib.
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
ErrorKind2[ErrorKind2["MISSING_OTHER_CLAUSE"] = 22] = "MISSING_OTHER_CLAUSE";
|
|
47
|
-
ErrorKind2[ErrorKind2["INVALID_TAG"] = 23] = "INVALID_TAG";
|
|
48
|
-
ErrorKind2[ErrorKind2["INVALID_TAG_NAME"] = 25] = "INVALID_TAG_NAME";
|
|
49
|
-
ErrorKind2[ErrorKind2["UNMATCHED_CLOSING_TAG"] = 26] = "UNMATCHED_CLOSING_TAG";
|
|
50
|
-
ErrorKind2[ErrorKind2["UNCLOSED_TAG"] = 27] = "UNCLOSED_TAG";
|
|
51
|
-
})(ErrorKind || (ErrorKind = {}));
|
|
52
|
-
|
|
53
|
-
// bazel-out/darwin-fastbuild/bin/packages/icu-messageformat-parser/lib/types.js
|
|
54
|
-
var TYPE;
|
|
55
|
-
(function(TYPE2) {
|
|
56
|
-
TYPE2[TYPE2["literal"] = 0] = "literal";
|
|
57
|
-
TYPE2[TYPE2["argument"] = 1] = "argument";
|
|
58
|
-
TYPE2[TYPE2["number"] = 2] = "number";
|
|
59
|
-
TYPE2[TYPE2["date"] = 3] = "date";
|
|
60
|
-
TYPE2[TYPE2["time"] = 4] = "time";
|
|
61
|
-
TYPE2[TYPE2["select"] = 5] = "select";
|
|
62
|
-
TYPE2[TYPE2["plural"] = 6] = "plural";
|
|
63
|
-
TYPE2[TYPE2["pound"] = 7] = "pound";
|
|
64
|
-
TYPE2[TYPE2["tag"] = 8] = "tag";
|
|
65
|
-
})(TYPE || (TYPE = {}));
|
|
66
|
-
var SKELETON_TYPE;
|
|
67
|
-
(function(SKELETON_TYPE2) {
|
|
68
|
-
SKELETON_TYPE2[SKELETON_TYPE2["number"] = 0] = "number";
|
|
69
|
-
SKELETON_TYPE2[SKELETON_TYPE2["dateTime"] = 1] = "dateTime";
|
|
70
|
-
})(SKELETON_TYPE || (SKELETON_TYPE = {}));
|
|
71
|
-
function isLiteralElement(el) {
|
|
72
|
-
return el.type === TYPE.literal;
|
|
73
|
-
}
|
|
74
|
-
function isArgumentElement(el) {
|
|
75
|
-
return el.type === TYPE.argument;
|
|
76
|
-
}
|
|
77
|
-
function isNumberElement(el) {
|
|
78
|
-
return el.type === TYPE.number;
|
|
79
|
-
}
|
|
80
|
-
function isDateElement(el) {
|
|
81
|
-
return el.type === TYPE.date;
|
|
82
|
-
}
|
|
83
|
-
function isTimeElement(el) {
|
|
84
|
-
return el.type === TYPE.time;
|
|
85
|
-
}
|
|
86
|
-
function isSelectElement(el) {
|
|
87
|
-
return el.type === TYPE.select;
|
|
88
|
-
}
|
|
89
|
-
function isPluralElement(el) {
|
|
90
|
-
return el.type === TYPE.plural;
|
|
91
|
-
}
|
|
92
|
-
function isPoundElement(el) {
|
|
93
|
-
return el.type === TYPE.pound;
|
|
94
|
-
}
|
|
95
|
-
function isTagElement(el) {
|
|
96
|
-
return el.type === TYPE.tag;
|
|
97
|
-
}
|
|
98
|
-
function isNumberSkeleton(el) {
|
|
99
|
-
return !!(el && typeof el === "object" && el.type === SKELETON_TYPE.number);
|
|
100
|
-
}
|
|
101
|
-
function isDateTimeSkeleton(el) {
|
|
102
|
-
return !!(el && typeof el === "object" && el.type === SKELETON_TYPE.dateTime);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
// bazel-out/darwin-fastbuild/bin/packages/icu-messageformat-parser/lib/regex.generated.js
|
|
106
|
-
var SPACE_SEPARATOR_REGEX = /[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/;
|
|
107
|
-
|
|
108
|
-
// bazel-out/darwin-fastbuild/bin/packages/icu-skeleton-parser/lib/date-time.js
|
|
109
|
-
var DATE_TIME_REGEX = /(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;
|
|
110
|
-
function parseDateTimeSkeleton(skeleton) {
|
|
111
|
-
var result = {};
|
|
112
|
-
skeleton.replace(DATE_TIME_REGEX, function(match) {
|
|
113
|
-
var len = match.length;
|
|
114
|
-
switch (match[0]) {
|
|
115
|
-
case "G":
|
|
116
|
-
result.era = len === 4 ? "long" : len === 5 ? "narrow" : "short";
|
|
117
|
-
break;
|
|
118
|
-
case "y":
|
|
119
|
-
result.year = len === 2 ? "2-digit" : "numeric";
|
|
120
|
-
break;
|
|
121
|
-
case "Y":
|
|
122
|
-
case "u":
|
|
123
|
-
case "U":
|
|
124
|
-
case "r":
|
|
125
|
-
throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");
|
|
126
|
-
case "q":
|
|
127
|
-
case "Q":
|
|
128
|
-
throw new RangeError("`q/Q` (quarter) patterns are not supported");
|
|
129
|
-
case "M":
|
|
130
|
-
case "L":
|
|
131
|
-
result.month = ["numeric", "2-digit", "short", "long", "narrow"][len - 1];
|
|
132
|
-
break;
|
|
133
|
-
case "w":
|
|
134
|
-
case "W":
|
|
135
|
-
throw new RangeError("`w/W` (week) patterns are not supported");
|
|
136
|
-
case "d":
|
|
137
|
-
result.day = ["numeric", "2-digit"][len - 1];
|
|
138
|
-
break;
|
|
139
|
-
case "D":
|
|
140
|
-
case "F":
|
|
141
|
-
case "g":
|
|
142
|
-
throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");
|
|
143
|
-
case "E":
|
|
144
|
-
result.weekday = len === 4 ? "short" : len === 5 ? "narrow" : "short";
|
|
145
|
-
break;
|
|
146
|
-
case "e":
|
|
147
|
-
if (len < 4) {
|
|
148
|
-
throw new RangeError("`e..eee` (weekday) patterns are not supported");
|
|
149
|
-
}
|
|
150
|
-
result.weekday = ["short", "long", "narrow", "short"][len - 4];
|
|
151
|
-
break;
|
|
152
|
-
case "c":
|
|
153
|
-
if (len < 4) {
|
|
154
|
-
throw new RangeError("`c..ccc` (weekday) patterns are not supported");
|
|
155
|
-
}
|
|
156
|
-
result.weekday = ["short", "long", "narrow", "short"][len - 4];
|
|
157
|
-
break;
|
|
158
|
-
case "a":
|
|
159
|
-
result.hour12 = true;
|
|
160
|
-
break;
|
|
161
|
-
case "b":
|
|
162
|
-
case "B":
|
|
163
|
-
throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");
|
|
164
|
-
case "h":
|
|
165
|
-
result.hourCycle = "h12";
|
|
166
|
-
result.hour = ["numeric", "2-digit"][len - 1];
|
|
167
|
-
break;
|
|
168
|
-
case "H":
|
|
169
|
-
result.hourCycle = "h23";
|
|
170
|
-
result.hour = ["numeric", "2-digit"][len - 1];
|
|
171
|
-
break;
|
|
172
|
-
case "K":
|
|
173
|
-
result.hourCycle = "h11";
|
|
174
|
-
result.hour = ["numeric", "2-digit"][len - 1];
|
|
175
|
-
break;
|
|
176
|
-
case "k":
|
|
177
|
-
result.hourCycle = "h24";
|
|
178
|
-
result.hour = ["numeric", "2-digit"][len - 1];
|
|
179
|
-
break;
|
|
180
|
-
case "j":
|
|
181
|
-
case "J":
|
|
182
|
-
case "C":
|
|
183
|
-
throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");
|
|
184
|
-
case "m":
|
|
185
|
-
result.minute = ["numeric", "2-digit"][len - 1];
|
|
186
|
-
break;
|
|
187
|
-
case "s":
|
|
188
|
-
result.second = ["numeric", "2-digit"][len - 1];
|
|
189
|
-
break;
|
|
190
|
-
case "S":
|
|
191
|
-
case "A":
|
|
192
|
-
throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");
|
|
193
|
-
case "z":
|
|
194
|
-
result.timeZoneName = len < 4 ? "short" : "long";
|
|
195
|
-
break;
|
|
196
|
-
case "Z":
|
|
197
|
-
case "O":
|
|
198
|
-
case "v":
|
|
199
|
-
case "V":
|
|
200
|
-
case "X":
|
|
201
|
-
case "x":
|
|
202
|
-
throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead");
|
|
203
|
-
}
|
|
204
|
-
return "";
|
|
205
|
-
});
|
|
206
|
-
return result;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
// bazel-out/darwin-fastbuild/bin/packages/icu-skeleton-parser/lib/regex.generated.js
|
|
210
|
-
var WHITE_SPACE_REGEX = /[\t-\r \x85\u200E\u200F\u2028\u2029]/i;
|
|
211
|
-
|
|
212
|
-
// bazel-out/darwin-fastbuild/bin/packages/icu-skeleton-parser/lib/number.js
|
|
213
|
-
function parseNumberSkeletonFromString(skeleton) {
|
|
214
|
-
if (skeleton.length === 0) {
|
|
215
|
-
throw new Error("Number skeleton cannot be empty");
|
|
216
|
-
}
|
|
217
|
-
var stringTokens = skeleton.split(WHITE_SPACE_REGEX).filter(function(x) {
|
|
218
|
-
return x.length > 0;
|
|
219
|
-
});
|
|
220
|
-
var tokens = [];
|
|
221
|
-
for (var _i = 0, stringTokens_1 = stringTokens; _i < stringTokens_1.length; _i++) {
|
|
222
|
-
var stringToken = stringTokens_1[_i];
|
|
223
|
-
var stemAndOptions = stringToken.split("/");
|
|
224
|
-
if (stemAndOptions.length === 0) {
|
|
225
|
-
throw new Error("Invalid number skeleton");
|
|
226
|
-
}
|
|
227
|
-
var stem = stemAndOptions[0], options = stemAndOptions.slice(1);
|
|
228
|
-
for (var _a2 = 0, options_1 = options; _a2 < options_1.length; _a2++) {
|
|
229
|
-
var option = options_1[_a2];
|
|
230
|
-
if (option.length === 0) {
|
|
231
|
-
throw new Error("Invalid number skeleton");
|
|
25
|
+
// bazel-out/darwin-fastbuild/bin/external/npm/node_modules/tslib/tslib.js
|
|
26
|
+
var require_tslib = __commonJS({
|
|
27
|
+
"bazel-out/darwin-fastbuild/bin/external/npm/node_modules/tslib/tslib.js"(exports, module) {
|
|
28
|
+
var __extends;
|
|
29
|
+
var __assign;
|
|
30
|
+
var __rest;
|
|
31
|
+
var __decorate;
|
|
32
|
+
var __param;
|
|
33
|
+
var __metadata;
|
|
34
|
+
var __awaiter;
|
|
35
|
+
var __generator;
|
|
36
|
+
var __exportStar;
|
|
37
|
+
var __values;
|
|
38
|
+
var __read;
|
|
39
|
+
var __spread;
|
|
40
|
+
var __spreadArrays;
|
|
41
|
+
var __spreadArray;
|
|
42
|
+
var __await;
|
|
43
|
+
var __asyncGenerator;
|
|
44
|
+
var __asyncDelegator;
|
|
45
|
+
var __asyncValues;
|
|
46
|
+
var __makeTemplateObject;
|
|
47
|
+
var __importStar;
|
|
48
|
+
var __importDefault;
|
|
49
|
+
var __classPrivateFieldGet;
|
|
50
|
+
var __classPrivateFieldSet;
|
|
51
|
+
var __classPrivateFieldIn;
|
|
52
|
+
var __createBinding;
|
|
53
|
+
(function(factory) {
|
|
54
|
+
var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {};
|
|
55
|
+
if (typeof define === "function" && define.amd) {
|
|
56
|
+
define("tslib", ["exports"], function(exports2) {
|
|
57
|
+
factory(createExporter(root, createExporter(exports2)));
|
|
58
|
+
});
|
|
59
|
+
} else if (typeof module === "object" && typeof module.exports === "object") {
|
|
60
|
+
factory(createExporter(root, createExporter(module.exports)));
|
|
61
|
+
} else {
|
|
62
|
+
factory(createExporter(root));
|
|
232
63
|
}
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
function
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
str.replace(SIGNIFICANT_PRECISION_REGEX, function(_, g1, g2) {
|
|
253
|
-
if (typeof g2 !== "string") {
|
|
254
|
-
result.minimumSignificantDigits = g1.length;
|
|
255
|
-
result.maximumSignificantDigits = g1.length;
|
|
256
|
-
} else if (g2 === "+") {
|
|
257
|
-
result.minimumSignificantDigits = g1.length;
|
|
258
|
-
} else if (g1[0] === "#") {
|
|
259
|
-
result.maximumSignificantDigits = g1.length;
|
|
260
|
-
} else {
|
|
261
|
-
result.minimumSignificantDigits = g1.length;
|
|
262
|
-
result.maximumSignificantDigits = g1.length + (typeof g2 === "string" ? g2.length : 0);
|
|
263
|
-
}
|
|
264
|
-
return "";
|
|
265
|
-
});
|
|
266
|
-
return result;
|
|
267
|
-
}
|
|
268
|
-
function parseSign(str) {
|
|
269
|
-
switch (str) {
|
|
270
|
-
case "sign-auto":
|
|
271
|
-
return {
|
|
272
|
-
signDisplay: "auto"
|
|
64
|
+
function createExporter(exports2, previous) {
|
|
65
|
+
if (exports2 !== root) {
|
|
66
|
+
if (typeof Object.create === "function") {
|
|
67
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
68
|
+
} else {
|
|
69
|
+
exports2.__esModule = true;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return function(id, v) {
|
|
73
|
+
return exports2[id] = previous ? previous(id, v) : v;
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
})(function(exporter) {
|
|
77
|
+
var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
|
|
78
|
+
d.__proto__ = b;
|
|
79
|
+
} || function(d, b) {
|
|
80
|
+
for (var p in b)
|
|
81
|
+
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
82
|
+
d[p] = b[p];
|
|
273
83
|
};
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
84
|
+
__extends = function(d, b) {
|
|
85
|
+
if (typeof b !== "function" && b !== null)
|
|
86
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
87
|
+
extendStatics(d, b);
|
|
88
|
+
function __() {
|
|
89
|
+
this.constructor = d;
|
|
90
|
+
}
|
|
91
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
278
92
|
};
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
93
|
+
__assign = Object.assign || function(t) {
|
|
94
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
95
|
+
s = arguments[i];
|
|
96
|
+
for (var p in s)
|
|
97
|
+
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
98
|
+
t[p] = s[p];
|
|
99
|
+
}
|
|
100
|
+
return t;
|
|
283
101
|
};
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
102
|
+
__rest = function(s, e) {
|
|
103
|
+
var t = {};
|
|
104
|
+
for (var p in s)
|
|
105
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
106
|
+
t[p] = s[p];
|
|
107
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
108
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
109
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
110
|
+
t[p[i]] = s[p[i]];
|
|
111
|
+
}
|
|
112
|
+
return t;
|
|
289
113
|
};
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
114
|
+
__decorate = function(decorators, target, key, desc) {
|
|
115
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
116
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
117
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
118
|
+
else
|
|
119
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
120
|
+
if (d = decorators[i])
|
|
121
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
122
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
123
|
+
};
|
|
124
|
+
__param = function(paramIndex, decorator) {
|
|
125
|
+
return function(target, key) {
|
|
126
|
+
decorator(target, key, paramIndex);
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
__metadata = function(metadataKey, metadataValue) {
|
|
130
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
131
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
132
|
+
};
|
|
133
|
+
__awaiter = function(thisArg, _arguments, P, generator) {
|
|
134
|
+
function adopt(value) {
|
|
135
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
136
|
+
resolve(value);
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
140
|
+
function fulfilled(value) {
|
|
141
|
+
try {
|
|
142
|
+
step(generator.next(value));
|
|
143
|
+
} catch (e) {
|
|
144
|
+
reject(e);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
function rejected(value) {
|
|
148
|
+
try {
|
|
149
|
+
step(generator["throw"](value));
|
|
150
|
+
} catch (e) {
|
|
151
|
+
reject(e);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
function step(result) {
|
|
155
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
156
|
+
}
|
|
157
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
158
|
+
});
|
|
159
|
+
};
|
|
160
|
+
__generator = function(thisArg, body) {
|
|
161
|
+
var _ = { label: 0, sent: function() {
|
|
162
|
+
if (t[0] & 1)
|
|
163
|
+
throw t[1];
|
|
164
|
+
return t[1];
|
|
165
|
+
}, trys: [], ops: [] }, f, y, t, g;
|
|
166
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
167
|
+
return this;
|
|
168
|
+
}), g;
|
|
169
|
+
function verb(n) {
|
|
170
|
+
return function(v) {
|
|
171
|
+
return step([n, v]);
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
function step(op) {
|
|
175
|
+
if (f)
|
|
176
|
+
throw new TypeError("Generator is already executing.");
|
|
177
|
+
while (_)
|
|
178
|
+
try {
|
|
179
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
|
180
|
+
return t;
|
|
181
|
+
if (y = 0, t)
|
|
182
|
+
op = [op[0] & 2, t.value];
|
|
183
|
+
switch (op[0]) {
|
|
184
|
+
case 0:
|
|
185
|
+
case 1:
|
|
186
|
+
t = op;
|
|
187
|
+
break;
|
|
188
|
+
case 4:
|
|
189
|
+
_.label++;
|
|
190
|
+
return { value: op[1], done: false };
|
|
191
|
+
case 5:
|
|
192
|
+
_.label++;
|
|
193
|
+
y = op[1];
|
|
194
|
+
op = [0];
|
|
195
|
+
continue;
|
|
196
|
+
case 7:
|
|
197
|
+
op = _.ops.pop();
|
|
198
|
+
_.trys.pop();
|
|
199
|
+
continue;
|
|
200
|
+
default:
|
|
201
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
202
|
+
_ = 0;
|
|
203
|
+
continue;
|
|
204
|
+
}
|
|
205
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
206
|
+
_.label = op[1];
|
|
207
|
+
break;
|
|
208
|
+
}
|
|
209
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
210
|
+
_.label = t[1];
|
|
211
|
+
t = op;
|
|
212
|
+
break;
|
|
213
|
+
}
|
|
214
|
+
if (t && _.label < t[2]) {
|
|
215
|
+
_.label = t[2];
|
|
216
|
+
_.ops.push(op);
|
|
217
|
+
break;
|
|
218
|
+
}
|
|
219
|
+
if (t[2])
|
|
220
|
+
_.ops.pop();
|
|
221
|
+
_.trys.pop();
|
|
222
|
+
continue;
|
|
223
|
+
}
|
|
224
|
+
op = body.call(thisArg, _);
|
|
225
|
+
} catch (e) {
|
|
226
|
+
op = [6, e];
|
|
227
|
+
y = 0;
|
|
228
|
+
} finally {
|
|
229
|
+
f = t = 0;
|
|
230
|
+
}
|
|
231
|
+
if (op[0] & 5)
|
|
232
|
+
throw op[1];
|
|
233
|
+
return { value: op[0] ? op[1] : void 0, done: true };
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
__exportStar = function(m, o) {
|
|
237
|
+
for (var p in m)
|
|
238
|
+
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
239
|
+
__createBinding(o, m, p);
|
|
240
|
+
};
|
|
241
|
+
__createBinding = Object.create ? function(o, m, k, k2) {
|
|
242
|
+
if (k2 === void 0)
|
|
243
|
+
k2 = k;
|
|
244
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
245
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
246
|
+
desc = { enumerable: true, get: function() {
|
|
247
|
+
return m[k];
|
|
248
|
+
} };
|
|
249
|
+
}
|
|
250
|
+
Object.defineProperty(o, k2, desc);
|
|
251
|
+
} : function(o, m, k, k2) {
|
|
252
|
+
if (k2 === void 0)
|
|
253
|
+
k2 = k;
|
|
254
|
+
o[k2] = m[k];
|
|
255
|
+
};
|
|
256
|
+
__values = function(o) {
|
|
257
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
258
|
+
if (m)
|
|
259
|
+
return m.call(o);
|
|
260
|
+
if (o && typeof o.length === "number")
|
|
261
|
+
return {
|
|
262
|
+
next: function() {
|
|
263
|
+
if (o && i >= o.length)
|
|
264
|
+
o = void 0;
|
|
265
|
+
return { value: o && o[i++], done: !o };
|
|
266
|
+
}
|
|
267
|
+
};
|
|
268
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
269
|
+
};
|
|
270
|
+
__read = function(o, n) {
|
|
271
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
272
|
+
if (!m)
|
|
273
|
+
return o;
|
|
274
|
+
var i = m.call(o), r, ar = [], e;
|
|
275
|
+
try {
|
|
276
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
277
|
+
ar.push(r.value);
|
|
278
|
+
} catch (error) {
|
|
279
|
+
e = { error };
|
|
280
|
+
} finally {
|
|
281
|
+
try {
|
|
282
|
+
if (r && !r.done && (m = i["return"]))
|
|
283
|
+
m.call(i);
|
|
284
|
+
} finally {
|
|
285
|
+
if (e)
|
|
286
|
+
throw e.error;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
return ar;
|
|
290
|
+
};
|
|
291
|
+
__spread = function() {
|
|
292
|
+
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
293
|
+
ar = ar.concat(__read(arguments[i]));
|
|
294
|
+
return ar;
|
|
295
|
+
};
|
|
296
|
+
__spreadArrays = function() {
|
|
297
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
298
|
+
s += arguments[i].length;
|
|
299
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
300
|
+
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
301
|
+
r[k] = a[j];
|
|
302
|
+
return r;
|
|
303
|
+
};
|
|
304
|
+
__spreadArray = function(to, from, pack) {
|
|
305
|
+
if (pack || arguments.length === 2)
|
|
306
|
+
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
307
|
+
if (ar || !(i in from)) {
|
|
308
|
+
if (!ar)
|
|
309
|
+
ar = Array.prototype.slice.call(from, 0, i);
|
|
310
|
+
ar[i] = from[i];
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
314
|
+
};
|
|
315
|
+
__await = function(v) {
|
|
316
|
+
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
317
|
+
};
|
|
318
|
+
__asyncGenerator = function(thisArg, _arguments, generator) {
|
|
319
|
+
if (!Symbol.asyncIterator)
|
|
320
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
321
|
+
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
322
|
+
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() {
|
|
323
|
+
return this;
|
|
324
|
+
}, i;
|
|
325
|
+
function verb(n) {
|
|
326
|
+
if (g[n])
|
|
327
|
+
i[n] = function(v) {
|
|
328
|
+
return new Promise(function(a, b) {
|
|
329
|
+
q.push([n, v, a, b]) > 1 || resume(n, v);
|
|
330
|
+
});
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
function resume(n, v) {
|
|
334
|
+
try {
|
|
335
|
+
step(g[n](v));
|
|
336
|
+
} catch (e) {
|
|
337
|
+
settle(q[0][3], e);
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
function step(r) {
|
|
341
|
+
r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r);
|
|
342
|
+
}
|
|
343
|
+
function fulfill(value) {
|
|
344
|
+
resume("next", value);
|
|
345
|
+
}
|
|
346
|
+
function reject(value) {
|
|
347
|
+
resume("throw", value);
|
|
348
|
+
}
|
|
349
|
+
function settle(f, v) {
|
|
350
|
+
if (f(v), q.shift(), q.length)
|
|
351
|
+
resume(q[0][0], q[0][1]);
|
|
352
|
+
}
|
|
353
|
+
};
|
|
354
|
+
__asyncDelegator = function(o) {
|
|
355
|
+
var i, p;
|
|
356
|
+
return i = {}, verb("next"), verb("throw", function(e) {
|
|
357
|
+
throw e;
|
|
358
|
+
}), verb("return"), i[Symbol.iterator] = function() {
|
|
359
|
+
return this;
|
|
360
|
+
}, i;
|
|
361
|
+
function verb(n, f) {
|
|
362
|
+
i[n] = o[n] ? function(v) {
|
|
363
|
+
return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v;
|
|
364
|
+
} : f;
|
|
365
|
+
}
|
|
294
366
|
};
|
|
295
|
-
|
|
296
|
-
|
|
367
|
+
__asyncValues = function(o) {
|
|
368
|
+
if (!Symbol.asyncIterator)
|
|
369
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
370
|
+
var m = o[Symbol.asyncIterator], i;
|
|
371
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() {
|
|
372
|
+
return this;
|
|
373
|
+
}, i);
|
|
374
|
+
function verb(n) {
|
|
375
|
+
i[n] = o[n] && function(v) {
|
|
376
|
+
return new Promise(function(resolve, reject) {
|
|
377
|
+
v = o[n](v), settle(resolve, reject, v.done, v.value);
|
|
378
|
+
});
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
function settle(resolve, reject, d, v) {
|
|
382
|
+
Promise.resolve(v).then(function(v2) {
|
|
383
|
+
resolve({ value: v2, done: d });
|
|
384
|
+
}, reject);
|
|
385
|
+
}
|
|
386
|
+
};
|
|
387
|
+
__makeTemplateObject = function(cooked, raw) {
|
|
388
|
+
if (Object.defineProperty) {
|
|
389
|
+
Object.defineProperty(cooked, "raw", { value: raw });
|
|
390
|
+
} else {
|
|
391
|
+
cooked.raw = raw;
|
|
392
|
+
}
|
|
393
|
+
return cooked;
|
|
394
|
+
};
|
|
395
|
+
var __setModuleDefault = Object.create ? function(o, v) {
|
|
396
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
397
|
+
} : function(o, v) {
|
|
398
|
+
o["default"] = v;
|
|
399
|
+
};
|
|
400
|
+
__importStar = function(mod) {
|
|
401
|
+
if (mod && mod.__esModule)
|
|
402
|
+
return mod;
|
|
403
|
+
var result = {};
|
|
404
|
+
if (mod != null) {
|
|
405
|
+
for (var k in mod)
|
|
406
|
+
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
407
|
+
__createBinding(result, mod, k);
|
|
408
|
+
}
|
|
409
|
+
__setModuleDefault(result, mod);
|
|
410
|
+
return result;
|
|
411
|
+
};
|
|
412
|
+
__importDefault = function(mod) {
|
|
413
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
414
|
+
};
|
|
415
|
+
__classPrivateFieldGet = function(receiver, state, kind, f) {
|
|
416
|
+
if (kind === "a" && !f)
|
|
417
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
418
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
419
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
420
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
421
|
+
};
|
|
422
|
+
__classPrivateFieldSet = function(receiver, state, value, kind, f) {
|
|
423
|
+
if (kind === "m")
|
|
424
|
+
throw new TypeError("Private method is not writable");
|
|
425
|
+
if (kind === "a" && !f)
|
|
426
|
+
throw new TypeError("Private accessor was defined without a setter");
|
|
427
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
428
|
+
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
429
|
+
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
|
|
430
|
+
};
|
|
431
|
+
__classPrivateFieldIn = function(state, receiver) {
|
|
432
|
+
if (receiver === null || typeof receiver !== "object" && typeof receiver !== "function")
|
|
433
|
+
throw new TypeError("Cannot use 'in' operator on non-object");
|
|
434
|
+
return typeof state === "function" ? receiver === state : state.has(receiver);
|
|
435
|
+
};
|
|
436
|
+
exporter("__extends", __extends);
|
|
437
|
+
exporter("__assign", __assign);
|
|
438
|
+
exporter("__rest", __rest);
|
|
439
|
+
exporter("__decorate", __decorate);
|
|
440
|
+
exporter("__param", __param);
|
|
441
|
+
exporter("__metadata", __metadata);
|
|
442
|
+
exporter("__awaiter", __awaiter);
|
|
443
|
+
exporter("__generator", __generator);
|
|
444
|
+
exporter("__exportStar", __exportStar);
|
|
445
|
+
exporter("__createBinding", __createBinding);
|
|
446
|
+
exporter("__values", __values);
|
|
447
|
+
exporter("__read", __read);
|
|
448
|
+
exporter("__spread", __spread);
|
|
449
|
+
exporter("__spreadArrays", __spreadArrays);
|
|
450
|
+
exporter("__spreadArray", __spreadArray);
|
|
451
|
+
exporter("__await", __await);
|
|
452
|
+
exporter("__asyncGenerator", __asyncGenerator);
|
|
453
|
+
exporter("__asyncDelegator", __asyncDelegator);
|
|
454
|
+
exporter("__asyncValues", __asyncValues);
|
|
455
|
+
exporter("__makeTemplateObject", __makeTemplateObject);
|
|
456
|
+
exporter("__importStar", __importStar);
|
|
457
|
+
exporter("__importDefault", __importDefault);
|
|
458
|
+
exporter("__classPrivateFieldGet", __classPrivateFieldGet);
|
|
459
|
+
exporter("__classPrivateFieldSet", __classPrivateFieldSet);
|
|
460
|
+
exporter("__classPrivateFieldIn", __classPrivateFieldIn);
|
|
461
|
+
});
|
|
462
|
+
}
|
|
463
|
+
});
|
|
464
|
+
|
|
465
|
+
// bazel-out/darwin-fastbuild/bin/packages/icu-messageformat-parser/error.js
|
|
466
|
+
var require_error = __commonJS({
|
|
467
|
+
"bazel-out/darwin-fastbuild/bin/packages/icu-messageformat-parser/error.js"(exports) {
|
|
468
|
+
"use strict";
|
|
469
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
470
|
+
exports.ErrorKind = void 0;
|
|
471
|
+
var ErrorKind;
|
|
472
|
+
(function(ErrorKind2) {
|
|
473
|
+
ErrorKind2[ErrorKind2["EXPECT_ARGUMENT_CLOSING_BRACE"] = 1] = "EXPECT_ARGUMENT_CLOSING_BRACE";
|
|
474
|
+
ErrorKind2[ErrorKind2["EMPTY_ARGUMENT"] = 2] = "EMPTY_ARGUMENT";
|
|
475
|
+
ErrorKind2[ErrorKind2["MALFORMED_ARGUMENT"] = 3] = "MALFORMED_ARGUMENT";
|
|
476
|
+
ErrorKind2[ErrorKind2["EXPECT_ARGUMENT_TYPE"] = 4] = "EXPECT_ARGUMENT_TYPE";
|
|
477
|
+
ErrorKind2[ErrorKind2["INVALID_ARGUMENT_TYPE"] = 5] = "INVALID_ARGUMENT_TYPE";
|
|
478
|
+
ErrorKind2[ErrorKind2["EXPECT_ARGUMENT_STYLE"] = 6] = "EXPECT_ARGUMENT_STYLE";
|
|
479
|
+
ErrorKind2[ErrorKind2["INVALID_NUMBER_SKELETON"] = 7] = "INVALID_NUMBER_SKELETON";
|
|
480
|
+
ErrorKind2[ErrorKind2["INVALID_DATE_TIME_SKELETON"] = 8] = "INVALID_DATE_TIME_SKELETON";
|
|
481
|
+
ErrorKind2[ErrorKind2["EXPECT_NUMBER_SKELETON"] = 9] = "EXPECT_NUMBER_SKELETON";
|
|
482
|
+
ErrorKind2[ErrorKind2["EXPECT_DATE_TIME_SKELETON"] = 10] = "EXPECT_DATE_TIME_SKELETON";
|
|
483
|
+
ErrorKind2[ErrorKind2["UNCLOSED_QUOTE_IN_ARGUMENT_STYLE"] = 11] = "UNCLOSED_QUOTE_IN_ARGUMENT_STYLE";
|
|
484
|
+
ErrorKind2[ErrorKind2["EXPECT_SELECT_ARGUMENT_OPTIONS"] = 12] = "EXPECT_SELECT_ARGUMENT_OPTIONS";
|
|
485
|
+
ErrorKind2[ErrorKind2["EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE"] = 13] = "EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE";
|
|
486
|
+
ErrorKind2[ErrorKind2["INVALID_PLURAL_ARGUMENT_OFFSET_VALUE"] = 14] = "INVALID_PLURAL_ARGUMENT_OFFSET_VALUE";
|
|
487
|
+
ErrorKind2[ErrorKind2["EXPECT_SELECT_ARGUMENT_SELECTOR"] = 15] = "EXPECT_SELECT_ARGUMENT_SELECTOR";
|
|
488
|
+
ErrorKind2[ErrorKind2["EXPECT_PLURAL_ARGUMENT_SELECTOR"] = 16] = "EXPECT_PLURAL_ARGUMENT_SELECTOR";
|
|
489
|
+
ErrorKind2[ErrorKind2["EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT"] = 17] = "EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT";
|
|
490
|
+
ErrorKind2[ErrorKind2["EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT"] = 18] = "EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT";
|
|
491
|
+
ErrorKind2[ErrorKind2["INVALID_PLURAL_ARGUMENT_SELECTOR"] = 19] = "INVALID_PLURAL_ARGUMENT_SELECTOR";
|
|
492
|
+
ErrorKind2[ErrorKind2["DUPLICATE_PLURAL_ARGUMENT_SELECTOR"] = 20] = "DUPLICATE_PLURAL_ARGUMENT_SELECTOR";
|
|
493
|
+
ErrorKind2[ErrorKind2["DUPLICATE_SELECT_ARGUMENT_SELECTOR"] = 21] = "DUPLICATE_SELECT_ARGUMENT_SELECTOR";
|
|
494
|
+
ErrorKind2[ErrorKind2["MISSING_OTHER_CLAUSE"] = 22] = "MISSING_OTHER_CLAUSE";
|
|
495
|
+
ErrorKind2[ErrorKind2["INVALID_TAG"] = 23] = "INVALID_TAG";
|
|
496
|
+
ErrorKind2[ErrorKind2["INVALID_TAG_NAME"] = 25] = "INVALID_TAG_NAME";
|
|
497
|
+
ErrorKind2[ErrorKind2["UNMATCHED_CLOSING_TAG"] = 26] = "UNMATCHED_CLOSING_TAG";
|
|
498
|
+
ErrorKind2[ErrorKind2["UNCLOSED_TAG"] = 27] = "UNCLOSED_TAG";
|
|
499
|
+
})(ErrorKind = exports.ErrorKind || (exports.ErrorKind = {}));
|
|
500
|
+
}
|
|
501
|
+
});
|
|
502
|
+
|
|
503
|
+
// bazel-out/darwin-fastbuild/bin/packages/icu-messageformat-parser/types.js
|
|
504
|
+
var require_types = __commonJS({
|
|
505
|
+
"bazel-out/darwin-fastbuild/bin/packages/icu-messageformat-parser/types.js"(exports) {
|
|
506
|
+
"use strict";
|
|
507
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
508
|
+
exports.createNumberElement = exports.createLiteralElement = exports.isDateTimeSkeleton = exports.isNumberSkeleton = exports.isTagElement = exports.isPoundElement = exports.isPluralElement = exports.isSelectElement = exports.isTimeElement = exports.isDateElement = exports.isNumberElement = exports.isArgumentElement = exports.isLiteralElement = exports.SKELETON_TYPE = exports.TYPE = void 0;
|
|
509
|
+
var TYPE;
|
|
510
|
+
(function(TYPE2) {
|
|
511
|
+
TYPE2[TYPE2["literal"] = 0] = "literal";
|
|
512
|
+
TYPE2[TYPE2["argument"] = 1] = "argument";
|
|
513
|
+
TYPE2[TYPE2["number"] = 2] = "number";
|
|
514
|
+
TYPE2[TYPE2["date"] = 3] = "date";
|
|
515
|
+
TYPE2[TYPE2["time"] = 4] = "time";
|
|
516
|
+
TYPE2[TYPE2["select"] = 5] = "select";
|
|
517
|
+
TYPE2[TYPE2["plural"] = 6] = "plural";
|
|
518
|
+
TYPE2[TYPE2["pound"] = 7] = "pound";
|
|
519
|
+
TYPE2[TYPE2["tag"] = 8] = "tag";
|
|
520
|
+
})(TYPE = exports.TYPE || (exports.TYPE = {}));
|
|
521
|
+
var SKELETON_TYPE;
|
|
522
|
+
(function(SKELETON_TYPE2) {
|
|
523
|
+
SKELETON_TYPE2[SKELETON_TYPE2["number"] = 0] = "number";
|
|
524
|
+
SKELETON_TYPE2[SKELETON_TYPE2["dateTime"] = 1] = "dateTime";
|
|
525
|
+
})(SKELETON_TYPE = exports.SKELETON_TYPE || (exports.SKELETON_TYPE = {}));
|
|
526
|
+
function isLiteralElement2(el) {
|
|
527
|
+
return el.type === TYPE.literal;
|
|
528
|
+
}
|
|
529
|
+
exports.isLiteralElement = isLiteralElement2;
|
|
530
|
+
function isArgumentElement2(el) {
|
|
531
|
+
return el.type === TYPE.argument;
|
|
532
|
+
}
|
|
533
|
+
exports.isArgumentElement = isArgumentElement2;
|
|
534
|
+
function isNumberElement2(el) {
|
|
535
|
+
return el.type === TYPE.number;
|
|
536
|
+
}
|
|
537
|
+
exports.isNumberElement = isNumberElement2;
|
|
538
|
+
function isDateElement2(el) {
|
|
539
|
+
return el.type === TYPE.date;
|
|
540
|
+
}
|
|
541
|
+
exports.isDateElement = isDateElement2;
|
|
542
|
+
function isTimeElement2(el) {
|
|
543
|
+
return el.type === TYPE.time;
|
|
544
|
+
}
|
|
545
|
+
exports.isTimeElement = isTimeElement2;
|
|
546
|
+
function isSelectElement2(el) {
|
|
547
|
+
return el.type === TYPE.select;
|
|
548
|
+
}
|
|
549
|
+
exports.isSelectElement = isSelectElement2;
|
|
550
|
+
function isPluralElement2(el) {
|
|
551
|
+
return el.type === TYPE.plural;
|
|
552
|
+
}
|
|
553
|
+
exports.isPluralElement = isPluralElement2;
|
|
554
|
+
function isPoundElement2(el) {
|
|
555
|
+
return el.type === TYPE.pound;
|
|
556
|
+
}
|
|
557
|
+
exports.isPoundElement = isPoundElement2;
|
|
558
|
+
function isTagElement2(el) {
|
|
559
|
+
return el.type === TYPE.tag;
|
|
560
|
+
}
|
|
561
|
+
exports.isTagElement = isTagElement2;
|
|
562
|
+
function isNumberSkeleton2(el) {
|
|
563
|
+
return !!(el && typeof el === "object" && el.type === SKELETON_TYPE.number);
|
|
564
|
+
}
|
|
565
|
+
exports.isNumberSkeleton = isNumberSkeleton2;
|
|
566
|
+
function isDateTimeSkeleton2(el) {
|
|
567
|
+
return !!(el && typeof el === "object" && el.type === SKELETON_TYPE.dateTime);
|
|
568
|
+
}
|
|
569
|
+
exports.isDateTimeSkeleton = isDateTimeSkeleton2;
|
|
570
|
+
function createLiteralElement(value) {
|
|
297
571
|
return {
|
|
298
|
-
|
|
299
|
-
|
|
572
|
+
type: TYPE.literal,
|
|
573
|
+
value
|
|
300
574
|
};
|
|
301
|
-
|
|
302
|
-
|
|
575
|
+
}
|
|
576
|
+
exports.createLiteralElement = createLiteralElement;
|
|
577
|
+
function createNumberElement(value, style) {
|
|
303
578
|
return {
|
|
304
|
-
|
|
579
|
+
type: TYPE.number,
|
|
580
|
+
value,
|
|
581
|
+
style
|
|
305
582
|
};
|
|
583
|
+
}
|
|
584
|
+
exports.createNumberElement = createNumberElement;
|
|
306
585
|
}
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
};
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
notation: "scientific"
|
|
318
|
-
};
|
|
319
|
-
stem = stem.slice(1);
|
|
586
|
+
});
|
|
587
|
+
|
|
588
|
+
// bazel-out/darwin-fastbuild/bin/packages/icu-messageformat-parser/regex.generated.js
|
|
589
|
+
var require_regex_generated = __commonJS({
|
|
590
|
+
"bazel-out/darwin-fastbuild/bin/packages/icu-messageformat-parser/regex.generated.js"(exports) {
|
|
591
|
+
"use strict";
|
|
592
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
593
|
+
exports.WHITE_SPACE_REGEX = exports.SPACE_SEPARATOR_REGEX = void 0;
|
|
594
|
+
exports.SPACE_SEPARATOR_REGEX = /[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/;
|
|
595
|
+
exports.WHITE_SPACE_REGEX = /[\t-\r \x85\u200E\u200F\u2028\u2029]/;
|
|
320
596
|
}
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
|
|
597
|
+
});
|
|
598
|
+
|
|
599
|
+
// bazel-out/darwin-fastbuild/bin/packages/icu-skeleton-parser/date-time.js
|
|
600
|
+
var require_date_time = __commonJS({
|
|
601
|
+
"bazel-out/darwin-fastbuild/bin/packages/icu-skeleton-parser/date-time.js"(exports) {
|
|
602
|
+
"use strict";
|
|
603
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
604
|
+
exports.parseDateTimeSkeleton = void 0;
|
|
605
|
+
var DATE_TIME_REGEX = /(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;
|
|
606
|
+
function parseDateTimeSkeleton(skeleton) {
|
|
607
|
+
var result = {};
|
|
608
|
+
skeleton.replace(DATE_TIME_REGEX, function(match) {
|
|
609
|
+
var len = match.length;
|
|
610
|
+
switch (match[0]) {
|
|
611
|
+
case "G":
|
|
612
|
+
result.era = len === 4 ? "long" : len === 5 ? "narrow" : "short";
|
|
613
|
+
break;
|
|
614
|
+
case "y":
|
|
615
|
+
result.year = len === 2 ? "2-digit" : "numeric";
|
|
616
|
+
break;
|
|
617
|
+
case "Y":
|
|
618
|
+
case "u":
|
|
619
|
+
case "U":
|
|
620
|
+
case "r":
|
|
621
|
+
throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");
|
|
622
|
+
case "q":
|
|
623
|
+
case "Q":
|
|
624
|
+
throw new RangeError("`q/Q` (quarter) patterns are not supported");
|
|
625
|
+
case "M":
|
|
626
|
+
case "L":
|
|
627
|
+
result.month = ["numeric", "2-digit", "short", "long", "narrow"][len - 1];
|
|
628
|
+
break;
|
|
629
|
+
case "w":
|
|
630
|
+
case "W":
|
|
631
|
+
throw new RangeError("`w/W` (week) patterns are not supported");
|
|
632
|
+
case "d":
|
|
633
|
+
result.day = ["numeric", "2-digit"][len - 1];
|
|
634
|
+
break;
|
|
635
|
+
case "D":
|
|
636
|
+
case "F":
|
|
637
|
+
case "g":
|
|
638
|
+
throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");
|
|
639
|
+
case "E":
|
|
640
|
+
result.weekday = len === 4 ? "short" : len === 5 ? "narrow" : "short";
|
|
641
|
+
break;
|
|
642
|
+
case "e":
|
|
643
|
+
if (len < 4) {
|
|
644
|
+
throw new RangeError("`e..eee` (weekday) patterns are not supported");
|
|
645
|
+
}
|
|
646
|
+
result.weekday = ["short", "long", "narrow", "short"][len - 4];
|
|
647
|
+
break;
|
|
648
|
+
case "c":
|
|
649
|
+
if (len < 4) {
|
|
650
|
+
throw new RangeError("`c..ccc` (weekday) patterns are not supported");
|
|
651
|
+
}
|
|
652
|
+
result.weekday = ["short", "long", "narrow", "short"][len - 4];
|
|
653
|
+
break;
|
|
654
|
+
case "a":
|
|
655
|
+
result.hour12 = true;
|
|
656
|
+
break;
|
|
657
|
+
case "b":
|
|
658
|
+
case "B":
|
|
659
|
+
throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");
|
|
660
|
+
case "h":
|
|
661
|
+
result.hourCycle = "h12";
|
|
662
|
+
result.hour = ["numeric", "2-digit"][len - 1];
|
|
663
|
+
break;
|
|
664
|
+
case "H":
|
|
665
|
+
result.hourCycle = "h23";
|
|
666
|
+
result.hour = ["numeric", "2-digit"][len - 1];
|
|
667
|
+
break;
|
|
668
|
+
case "K":
|
|
669
|
+
result.hourCycle = "h11";
|
|
670
|
+
result.hour = ["numeric", "2-digit"][len - 1];
|
|
671
|
+
break;
|
|
672
|
+
case "k":
|
|
673
|
+
result.hourCycle = "h24";
|
|
674
|
+
result.hour = ["numeric", "2-digit"][len - 1];
|
|
675
|
+
break;
|
|
676
|
+
case "j":
|
|
677
|
+
case "J":
|
|
678
|
+
case "C":
|
|
679
|
+
throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");
|
|
680
|
+
case "m":
|
|
681
|
+
result.minute = ["numeric", "2-digit"][len - 1];
|
|
682
|
+
break;
|
|
683
|
+
case "s":
|
|
684
|
+
result.second = ["numeric", "2-digit"][len - 1];
|
|
685
|
+
break;
|
|
686
|
+
case "S":
|
|
687
|
+
case "A":
|
|
688
|
+
throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");
|
|
689
|
+
case "z":
|
|
690
|
+
result.timeZoneName = len < 4 ? "short" : "long";
|
|
691
|
+
break;
|
|
692
|
+
case "Z":
|
|
693
|
+
case "O":
|
|
694
|
+
case "v":
|
|
695
|
+
case "V":
|
|
696
|
+
case "X":
|
|
697
|
+
case "x":
|
|
698
|
+
throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead");
|
|
699
|
+
}
|
|
700
|
+
return "";
|
|
701
|
+
});
|
|
702
|
+
return result;
|
|
332
703
|
}
|
|
333
|
-
|
|
704
|
+
exports.parseDateTimeSkeleton = parseDateTimeSkeleton;
|
|
334
705
|
}
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
706
|
+
});
|
|
707
|
+
|
|
708
|
+
// bazel-out/darwin-fastbuild/bin/packages/icu-skeleton-parser/regex.generated.js
|
|
709
|
+
var require_regex_generated2 = __commonJS({
|
|
710
|
+
"bazel-out/darwin-fastbuild/bin/packages/icu-skeleton-parser/regex.generated.js"(exports) {
|
|
711
|
+
"use strict";
|
|
712
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
713
|
+
exports.WHITE_SPACE_REGEX = void 0;
|
|
714
|
+
exports.WHITE_SPACE_REGEX = /[\t-\r \x85\u200E\u200F\u2028\u2029]/i;
|
|
342
715
|
}
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
result.style = "unit";
|
|
373
|
-
result.unit = icuUnitToEcma(token.options[0]);
|
|
374
|
-
continue;
|
|
375
|
-
case "compact-short":
|
|
376
|
-
case "K":
|
|
377
|
-
result.notation = "compact";
|
|
378
|
-
result.compactDisplay = "short";
|
|
379
|
-
continue;
|
|
380
|
-
case "compact-long":
|
|
381
|
-
case "KK":
|
|
382
|
-
result.notation = "compact";
|
|
383
|
-
result.compactDisplay = "long";
|
|
384
|
-
continue;
|
|
385
|
-
case "scientific":
|
|
386
|
-
result = __assign(__assign(__assign({}, result), { notation: "scientific" }), token.options.reduce(function(all, opt2) {
|
|
387
|
-
return __assign(__assign({}, all), parseNotationOptions(opt2));
|
|
388
|
-
}, {}));
|
|
389
|
-
continue;
|
|
390
|
-
case "engineering":
|
|
391
|
-
result = __assign(__assign(__assign({}, result), { notation: "engineering" }), token.options.reduce(function(all, opt2) {
|
|
392
|
-
return __assign(__assign({}, all), parseNotationOptions(opt2));
|
|
393
|
-
}, {}));
|
|
394
|
-
continue;
|
|
395
|
-
case "notation-simple":
|
|
396
|
-
result.notation = "standard";
|
|
397
|
-
continue;
|
|
398
|
-
case "unit-width-narrow":
|
|
399
|
-
result.currencyDisplay = "narrowSymbol";
|
|
400
|
-
result.unitDisplay = "narrow";
|
|
401
|
-
continue;
|
|
402
|
-
case "unit-width-short":
|
|
403
|
-
result.currencyDisplay = "code";
|
|
404
|
-
result.unitDisplay = "short";
|
|
405
|
-
continue;
|
|
406
|
-
case "unit-width-full-name":
|
|
407
|
-
result.currencyDisplay = "name";
|
|
408
|
-
result.unitDisplay = "long";
|
|
409
|
-
continue;
|
|
410
|
-
case "unit-width-iso-code":
|
|
411
|
-
result.currencyDisplay = "symbol";
|
|
412
|
-
continue;
|
|
413
|
-
case "scale":
|
|
414
|
-
result.scale = parseFloat(token.options[0]);
|
|
415
|
-
continue;
|
|
416
|
-
case "integer-width":
|
|
417
|
-
if (token.options.length > 1) {
|
|
418
|
-
throw new RangeError("integer-width stems only accept a single optional option");
|
|
419
|
-
}
|
|
420
|
-
token.options[0].replace(INTEGER_WIDTH_REGEX, function(_, g1, g2, g3, g4, g5) {
|
|
421
|
-
if (g1) {
|
|
422
|
-
result.minimumIntegerDigits = g2.length;
|
|
423
|
-
} else if (g3 && g4) {
|
|
424
|
-
throw new Error("We currently do not support maximum integer digits");
|
|
425
|
-
} else if (g5) {
|
|
426
|
-
throw new Error("We currently do not support exact integer digits");
|
|
716
|
+
});
|
|
717
|
+
|
|
718
|
+
// bazel-out/darwin-fastbuild/bin/packages/icu-skeleton-parser/number.js
|
|
719
|
+
var require_number = __commonJS({
|
|
720
|
+
"bazel-out/darwin-fastbuild/bin/packages/icu-skeleton-parser/number.js"(exports) {
|
|
721
|
+
"use strict";
|
|
722
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
723
|
+
exports.parseNumberSkeleton = exports.parseNumberSkeletonFromString = void 0;
|
|
724
|
+
var tslib_1 = require_tslib();
|
|
725
|
+
var regex_generated_1 = require_regex_generated2();
|
|
726
|
+
function parseNumberSkeletonFromString(skeleton) {
|
|
727
|
+
if (skeleton.length === 0) {
|
|
728
|
+
throw new Error("Number skeleton cannot be empty");
|
|
729
|
+
}
|
|
730
|
+
var stringTokens = skeleton.split(regex_generated_1.WHITE_SPACE_REGEX).filter(function(x) {
|
|
731
|
+
return x.length > 0;
|
|
732
|
+
});
|
|
733
|
+
var tokens = [];
|
|
734
|
+
for (var _i = 0, stringTokens_1 = stringTokens; _i < stringTokens_1.length; _i++) {
|
|
735
|
+
var stringToken = stringTokens_1[_i];
|
|
736
|
+
var stemAndOptions = stringToken.split("/");
|
|
737
|
+
if (stemAndOptions.length === 0) {
|
|
738
|
+
throw new Error("Invalid number skeleton");
|
|
739
|
+
}
|
|
740
|
+
var stem = stemAndOptions[0], options = stemAndOptions.slice(1);
|
|
741
|
+
for (var _a = 0, options_1 = options; _a < options_1.length; _a++) {
|
|
742
|
+
var option = options_1[_a];
|
|
743
|
+
if (option.length === 0) {
|
|
744
|
+
throw new Error("Invalid number skeleton");
|
|
427
745
|
}
|
|
428
|
-
|
|
429
|
-
});
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
746
|
+
}
|
|
747
|
+
tokens.push({ stem, options });
|
|
748
|
+
}
|
|
749
|
+
return tokens;
|
|
750
|
+
}
|
|
751
|
+
exports.parseNumberSkeletonFromString = parseNumberSkeletonFromString;
|
|
752
|
+
function icuUnitToEcma(unit) {
|
|
753
|
+
return unit.replace(/^(.*?)-/, "");
|
|
754
|
+
}
|
|
755
|
+
var FRACTION_PRECISION_REGEX = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g;
|
|
756
|
+
var SIGNIFICANT_PRECISION_REGEX = /^(@+)?(\+|#+)?[rs]?$/g;
|
|
757
|
+
var INTEGER_WIDTH_REGEX = /(\*)(0+)|(#+)(0+)|(0+)/g;
|
|
758
|
+
var CONCISE_INTEGER_WIDTH_REGEX = /^(0+)$/;
|
|
759
|
+
function parseSignificantPrecision(str) {
|
|
760
|
+
var result = {};
|
|
761
|
+
if (str[str.length - 1] === "r") {
|
|
762
|
+
result.roundingPriority = "morePrecision";
|
|
763
|
+
} else if (str[str.length - 1] === "s") {
|
|
764
|
+
result.roundingPriority = "lessPrecision";
|
|
439
765
|
}
|
|
440
|
-
|
|
441
|
-
if (g2
|
|
442
|
-
result.
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
result.
|
|
766
|
+
str.replace(SIGNIFICANT_PRECISION_REGEX, function(_, g1, g2) {
|
|
767
|
+
if (typeof g2 !== "string") {
|
|
768
|
+
result.minimumSignificantDigits = g1.length;
|
|
769
|
+
result.maximumSignificantDigits = g1.length;
|
|
770
|
+
} else if (g2 === "+") {
|
|
771
|
+
result.minimumSignificantDigits = g1.length;
|
|
772
|
+
} else if (g1[0] === "#") {
|
|
773
|
+
result.maximumSignificantDigits = g1.length;
|
|
448
774
|
} else {
|
|
449
|
-
result.
|
|
450
|
-
result.
|
|
775
|
+
result.minimumSignificantDigits = g1.length;
|
|
776
|
+
result.maximumSignificantDigits = g1.length + (typeof g2 === "string" ? g2.length : 0);
|
|
451
777
|
}
|
|
452
778
|
return "";
|
|
453
779
|
});
|
|
454
|
-
|
|
455
|
-
if (opt === "w") {
|
|
456
|
-
result = __assign(__assign({}, result), { trailingZeroDisplay: "stripIfInteger" });
|
|
457
|
-
} else if (opt) {
|
|
458
|
-
result = __assign(__assign({}, result), parseSignificantPrecision(opt));
|
|
459
|
-
}
|
|
460
|
-
continue;
|
|
780
|
+
return result;
|
|
461
781
|
}
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
782
|
+
function parseSign(str) {
|
|
783
|
+
switch (str) {
|
|
784
|
+
case "sign-auto":
|
|
785
|
+
return {
|
|
786
|
+
signDisplay: "auto"
|
|
787
|
+
};
|
|
788
|
+
case "sign-accounting":
|
|
789
|
+
case "()":
|
|
790
|
+
return {
|
|
791
|
+
currencySign: "accounting"
|
|
792
|
+
};
|
|
793
|
+
case "sign-always":
|
|
794
|
+
case "+!":
|
|
795
|
+
return {
|
|
796
|
+
signDisplay: "always"
|
|
797
|
+
};
|
|
798
|
+
case "sign-accounting-always":
|
|
799
|
+
case "()!":
|
|
800
|
+
return {
|
|
801
|
+
signDisplay: "always",
|
|
802
|
+
currencySign: "accounting"
|
|
803
|
+
};
|
|
804
|
+
case "sign-except-zero":
|
|
805
|
+
case "+?":
|
|
806
|
+
return {
|
|
807
|
+
signDisplay: "exceptZero"
|
|
808
|
+
};
|
|
809
|
+
case "sign-accounting-except-zero":
|
|
810
|
+
case "()?":
|
|
811
|
+
return {
|
|
812
|
+
signDisplay: "exceptZero",
|
|
813
|
+
currencySign: "accounting"
|
|
814
|
+
};
|
|
815
|
+
case "sign-never":
|
|
816
|
+
case "+_":
|
|
817
|
+
return {
|
|
818
|
+
signDisplay: "never"
|
|
819
|
+
};
|
|
820
|
+
}
|
|
465
821
|
}
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
822
|
+
function parseConciseScientificAndEngineeringStem(stem) {
|
|
823
|
+
var result;
|
|
824
|
+
if (stem[0] === "E" && stem[1] === "E") {
|
|
825
|
+
result = {
|
|
826
|
+
notation: "engineering"
|
|
827
|
+
};
|
|
828
|
+
stem = stem.slice(2);
|
|
829
|
+
} else if (stem[0] === "E") {
|
|
830
|
+
result = {
|
|
831
|
+
notation: "scientific"
|
|
832
|
+
};
|
|
833
|
+
stem = stem.slice(1);
|
|
834
|
+
}
|
|
835
|
+
if (result) {
|
|
836
|
+
var signDisplay = stem.slice(0, 2);
|
|
837
|
+
if (signDisplay === "+!") {
|
|
838
|
+
result.signDisplay = "always";
|
|
839
|
+
stem = stem.slice(2);
|
|
840
|
+
} else if (signDisplay === "+?") {
|
|
841
|
+
result.signDisplay = "exceptZero";
|
|
842
|
+
stem = stem.slice(2);
|
|
843
|
+
}
|
|
844
|
+
if (!CONCISE_INTEGER_WIDTH_REGEX.test(stem)) {
|
|
845
|
+
throw new Error("Malformed concise eng/scientific notation");
|
|
846
|
+
}
|
|
847
|
+
result.minimumIntegerDigits = stem.length;
|
|
848
|
+
}
|
|
849
|
+
return result;
|
|
469
850
|
}
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
851
|
+
function parseNotationOptions(opt) {
|
|
852
|
+
var result = {};
|
|
853
|
+
var signOpts = parseSign(opt);
|
|
854
|
+
if (signOpts) {
|
|
855
|
+
return signOpts;
|
|
856
|
+
}
|
|
857
|
+
return result;
|
|
858
|
+
}
|
|
859
|
+
function parseNumberSkeleton(tokens) {
|
|
860
|
+
var result = {};
|
|
861
|
+
for (var _i = 0, tokens_1 = tokens; _i < tokens_1.length; _i++) {
|
|
862
|
+
var token = tokens_1[_i];
|
|
863
|
+
switch (token.stem) {
|
|
864
|
+
case "percent":
|
|
865
|
+
case "%":
|
|
866
|
+
result.style = "percent";
|
|
867
|
+
continue;
|
|
868
|
+
case "%x100":
|
|
869
|
+
result.style = "percent";
|
|
870
|
+
result.scale = 100;
|
|
871
|
+
continue;
|
|
872
|
+
case "currency":
|
|
873
|
+
result.style = "currency";
|
|
874
|
+
result.currency = token.options[0];
|
|
875
|
+
continue;
|
|
876
|
+
case "group-off":
|
|
877
|
+
case ",_":
|
|
878
|
+
result.useGrouping = false;
|
|
879
|
+
continue;
|
|
880
|
+
case "precision-integer":
|
|
881
|
+
case ".":
|
|
882
|
+
result.maximumFractionDigits = 0;
|
|
883
|
+
continue;
|
|
884
|
+
case "measure-unit":
|
|
885
|
+
case "unit":
|
|
886
|
+
result.style = "unit";
|
|
887
|
+
result.unit = icuUnitToEcma(token.options[0]);
|
|
888
|
+
continue;
|
|
889
|
+
case "compact-short":
|
|
890
|
+
case "K":
|
|
891
|
+
result.notation = "compact";
|
|
892
|
+
result.compactDisplay = "short";
|
|
893
|
+
continue;
|
|
894
|
+
case "compact-long":
|
|
895
|
+
case "KK":
|
|
896
|
+
result.notation = "compact";
|
|
897
|
+
result.compactDisplay = "long";
|
|
898
|
+
continue;
|
|
899
|
+
case "scientific":
|
|
900
|
+
result = (0, tslib_1.__assign)((0, tslib_1.__assign)((0, tslib_1.__assign)({}, result), { notation: "scientific" }), token.options.reduce(function(all, opt2) {
|
|
901
|
+
return (0, tslib_1.__assign)((0, tslib_1.__assign)({}, all), parseNotationOptions(opt2));
|
|
902
|
+
}, {}));
|
|
903
|
+
continue;
|
|
904
|
+
case "engineering":
|
|
905
|
+
result = (0, tslib_1.__assign)((0, tslib_1.__assign)((0, tslib_1.__assign)({}, result), { notation: "engineering" }), token.options.reduce(function(all, opt2) {
|
|
906
|
+
return (0, tslib_1.__assign)((0, tslib_1.__assign)({}, all), parseNotationOptions(opt2));
|
|
907
|
+
}, {}));
|
|
908
|
+
continue;
|
|
909
|
+
case "notation-simple":
|
|
910
|
+
result.notation = "standard";
|
|
911
|
+
continue;
|
|
912
|
+
case "unit-width-narrow":
|
|
913
|
+
result.currencyDisplay = "narrowSymbol";
|
|
914
|
+
result.unitDisplay = "narrow";
|
|
915
|
+
continue;
|
|
916
|
+
case "unit-width-short":
|
|
917
|
+
result.currencyDisplay = "code";
|
|
918
|
+
result.unitDisplay = "short";
|
|
919
|
+
continue;
|
|
920
|
+
case "unit-width-full-name":
|
|
921
|
+
result.currencyDisplay = "name";
|
|
922
|
+
result.unitDisplay = "long";
|
|
923
|
+
continue;
|
|
924
|
+
case "unit-width-iso-code":
|
|
925
|
+
result.currencyDisplay = "symbol";
|
|
926
|
+
continue;
|
|
927
|
+
case "scale":
|
|
928
|
+
result.scale = parseFloat(token.options[0]);
|
|
929
|
+
continue;
|
|
930
|
+
case "integer-width":
|
|
931
|
+
if (token.options.length > 1) {
|
|
932
|
+
throw new RangeError("integer-width stems only accept a single optional option");
|
|
933
|
+
}
|
|
934
|
+
token.options[0].replace(INTEGER_WIDTH_REGEX, function(_, g1, g2, g3, g4, g5) {
|
|
935
|
+
if (g1) {
|
|
936
|
+
result.minimumIntegerDigits = g2.length;
|
|
937
|
+
} else if (g3 && g4) {
|
|
938
|
+
throw new Error("We currently do not support maximum integer digits");
|
|
939
|
+
} else if (g5) {
|
|
940
|
+
throw new Error("We currently do not support exact integer digits");
|
|
941
|
+
}
|
|
942
|
+
return "";
|
|
943
|
+
});
|
|
944
|
+
continue;
|
|
945
|
+
}
|
|
946
|
+
if (CONCISE_INTEGER_WIDTH_REGEX.test(token.stem)) {
|
|
947
|
+
result.minimumIntegerDigits = token.stem.length;
|
|
948
|
+
continue;
|
|
949
|
+
}
|
|
950
|
+
if (FRACTION_PRECISION_REGEX.test(token.stem)) {
|
|
951
|
+
if (token.options.length > 1) {
|
|
952
|
+
throw new RangeError("Fraction-precision stems only accept a single optional option");
|
|
953
|
+
}
|
|
954
|
+
token.stem.replace(FRACTION_PRECISION_REGEX, function(_, g1, g2, g3, g4, g5) {
|
|
955
|
+
if (g2 === "*") {
|
|
956
|
+
result.minimumFractionDigits = g1.length;
|
|
957
|
+
} else if (g3 && g3[0] === "#") {
|
|
958
|
+
result.maximumFractionDigits = g3.length;
|
|
959
|
+
} else if (g4 && g5) {
|
|
960
|
+
result.minimumFractionDigits = g4.length;
|
|
961
|
+
result.maximumFractionDigits = g4.length + g5.length;
|
|
962
|
+
} else {
|
|
963
|
+
result.minimumFractionDigits = g1.length;
|
|
964
|
+
result.maximumFractionDigits = g1.length;
|
|
965
|
+
}
|
|
966
|
+
return "";
|
|
967
|
+
});
|
|
968
|
+
var opt = token.options[0];
|
|
969
|
+
if (opt === "w") {
|
|
970
|
+
result = (0, tslib_1.__assign)((0, tslib_1.__assign)({}, result), { trailingZeroDisplay: "stripIfInteger" });
|
|
971
|
+
} else if (opt) {
|
|
972
|
+
result = (0, tslib_1.__assign)((0, tslib_1.__assign)({}, result), parseSignificantPrecision(opt));
|
|
973
|
+
}
|
|
974
|
+
continue;
|
|
975
|
+
}
|
|
976
|
+
if (SIGNIFICANT_PRECISION_REGEX.test(token.stem)) {
|
|
977
|
+
result = (0, tslib_1.__assign)((0, tslib_1.__assign)({}, result), parseSignificantPrecision(token.stem));
|
|
978
|
+
continue;
|
|
979
|
+
}
|
|
980
|
+
var signOpts = parseSign(token.stem);
|
|
981
|
+
if (signOpts) {
|
|
982
|
+
result = (0, tslib_1.__assign)((0, tslib_1.__assign)({}, result), signOpts);
|
|
983
|
+
}
|
|
984
|
+
var conciseScientificAndEngineeringOpts = parseConciseScientificAndEngineeringStem(token.stem);
|
|
985
|
+
if (conciseScientificAndEngineeringOpts) {
|
|
986
|
+
result = (0, tslib_1.__assign)((0, tslib_1.__assign)({}, result), conciseScientificAndEngineeringOpts);
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
return result;
|
|
473
990
|
}
|
|
991
|
+
exports.parseNumberSkeleton = parseNumberSkeleton;
|
|
474
992
|
}
|
|
475
|
-
|
|
476
|
-
}
|
|
993
|
+
});
|
|
477
994
|
|
|
478
|
-
// bazel-out/darwin-fastbuild/bin/packages/icu-
|
|
479
|
-
var
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
var hasNativeFromCodePoint = !!String.fromCodePoint;
|
|
487
|
-
var hasNativeFromEntries = !!Object.fromEntries;
|
|
488
|
-
var hasNativeCodePointAt = !!String.prototype.codePointAt;
|
|
489
|
-
var hasTrimStart = !!String.prototype.trimStart;
|
|
490
|
-
var hasTrimEnd = !!String.prototype.trimEnd;
|
|
491
|
-
var hasNativeIsSafeInteger = !!Number.isSafeInteger;
|
|
492
|
-
var isSafeInteger = hasNativeIsSafeInteger ? Number.isSafeInteger : function(n) {
|
|
493
|
-
return typeof n === "number" && isFinite(n) && Math.floor(n) === n && Math.abs(n) <= 9007199254740991;
|
|
494
|
-
};
|
|
495
|
-
var REGEX_SUPPORTS_U_AND_Y = true;
|
|
496
|
-
try {
|
|
497
|
-
re = RE("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu");
|
|
498
|
-
REGEX_SUPPORTS_U_AND_Y = ((_a = re.exec("a")) === null || _a === void 0 ? void 0 : _a[0]) === "a";
|
|
499
|
-
} catch (_) {
|
|
500
|
-
REGEX_SUPPORTS_U_AND_Y = false;
|
|
501
|
-
}
|
|
502
|
-
var re;
|
|
503
|
-
var startsWith = hasNativeStartsWith ? function startsWith2(s, search, position) {
|
|
504
|
-
return s.startsWith(search, position);
|
|
505
|
-
} : function startsWith3(s, search, position) {
|
|
506
|
-
return s.slice(position, position + search.length) === search;
|
|
507
|
-
};
|
|
508
|
-
var fromCodePoint = hasNativeFromCodePoint ? String.fromCodePoint : function fromCodePoint2() {
|
|
509
|
-
var codePoints = [];
|
|
510
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
511
|
-
codePoints[_i] = arguments[_i];
|
|
995
|
+
// bazel-out/darwin-fastbuild/bin/packages/icu-skeleton-parser/index.js
|
|
996
|
+
var require_icu_skeleton_parser = __commonJS({
|
|
997
|
+
"bazel-out/darwin-fastbuild/bin/packages/icu-skeleton-parser/index.js"(exports) {
|
|
998
|
+
"use strict";
|
|
999
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1000
|
+
var tslib_1 = require_tslib();
|
|
1001
|
+
(0, tslib_1.__exportStar)(require_date_time(), exports);
|
|
1002
|
+
(0, tslib_1.__exportStar)(require_number(), exports);
|
|
512
1003
|
}
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
1004
|
+
});
|
|
1005
|
+
|
|
1006
|
+
// bazel-out/darwin-fastbuild/bin/packages/icu-messageformat-parser/time-data.generated.js
|
|
1007
|
+
var require_time_data_generated = __commonJS({
|
|
1008
|
+
"bazel-out/darwin-fastbuild/bin/packages/icu-messageformat-parser/time-data.generated.js"(exports) {
|
|
1009
|
+
"use strict";
|
|
1010
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1011
|
+
exports.timeData = void 0;
|
|
1012
|
+
exports.timeData = {
|
|
1013
|
+
"AX": [
|
|
1014
|
+
"H"
|
|
1015
|
+
],
|
|
1016
|
+
"BQ": [
|
|
1017
|
+
"H"
|
|
1018
|
+
],
|
|
1019
|
+
"CP": [
|
|
1020
|
+
"H"
|
|
1021
|
+
],
|
|
1022
|
+
"CZ": [
|
|
1023
|
+
"H"
|
|
1024
|
+
],
|
|
1025
|
+
"DK": [
|
|
1026
|
+
"H"
|
|
1027
|
+
],
|
|
1028
|
+
"FI": [
|
|
1029
|
+
"H"
|
|
1030
|
+
],
|
|
1031
|
+
"ID": [
|
|
1032
|
+
"H"
|
|
1033
|
+
],
|
|
1034
|
+
"IS": [
|
|
1035
|
+
"H"
|
|
1036
|
+
],
|
|
1037
|
+
"ML": [
|
|
1038
|
+
"H"
|
|
1039
|
+
],
|
|
1040
|
+
"NE": [
|
|
1041
|
+
"H"
|
|
1042
|
+
],
|
|
1043
|
+
"RU": [
|
|
1044
|
+
"H"
|
|
1045
|
+
],
|
|
1046
|
+
"SE": [
|
|
1047
|
+
"H"
|
|
1048
|
+
],
|
|
1049
|
+
"SJ": [
|
|
1050
|
+
"H"
|
|
1051
|
+
],
|
|
1052
|
+
"SK": [
|
|
1053
|
+
"H"
|
|
1054
|
+
],
|
|
1055
|
+
"AS": [
|
|
1056
|
+
"h",
|
|
1057
|
+
"H"
|
|
1058
|
+
],
|
|
1059
|
+
"BT": [
|
|
1060
|
+
"h",
|
|
1061
|
+
"H"
|
|
1062
|
+
],
|
|
1063
|
+
"DJ": [
|
|
1064
|
+
"h",
|
|
1065
|
+
"H"
|
|
1066
|
+
],
|
|
1067
|
+
"ER": [
|
|
1068
|
+
"h",
|
|
1069
|
+
"H"
|
|
1070
|
+
],
|
|
1071
|
+
"GH": [
|
|
1072
|
+
"h",
|
|
1073
|
+
"H"
|
|
1074
|
+
],
|
|
1075
|
+
"IN": [
|
|
1076
|
+
"h",
|
|
1077
|
+
"H"
|
|
1078
|
+
],
|
|
1079
|
+
"LS": [
|
|
1080
|
+
"h",
|
|
1081
|
+
"H"
|
|
1082
|
+
],
|
|
1083
|
+
"PG": [
|
|
1084
|
+
"h",
|
|
1085
|
+
"H"
|
|
1086
|
+
],
|
|
1087
|
+
"PW": [
|
|
1088
|
+
"h",
|
|
1089
|
+
"H"
|
|
1090
|
+
],
|
|
1091
|
+
"SO": [
|
|
1092
|
+
"h",
|
|
1093
|
+
"H"
|
|
1094
|
+
],
|
|
1095
|
+
"TO": [
|
|
1096
|
+
"h",
|
|
1097
|
+
"H"
|
|
1098
|
+
],
|
|
1099
|
+
"VU": [
|
|
1100
|
+
"h",
|
|
1101
|
+
"H"
|
|
1102
|
+
],
|
|
1103
|
+
"WS": [
|
|
1104
|
+
"h",
|
|
1105
|
+
"H"
|
|
1106
|
+
],
|
|
1107
|
+
"001": [
|
|
1108
|
+
"H",
|
|
1109
|
+
"h"
|
|
1110
|
+
],
|
|
1111
|
+
"AL": [
|
|
1112
|
+
"h",
|
|
1113
|
+
"H",
|
|
1114
|
+
"hB"
|
|
1115
|
+
],
|
|
1116
|
+
"TD": [
|
|
1117
|
+
"h",
|
|
1118
|
+
"H",
|
|
1119
|
+
"hB"
|
|
1120
|
+
],
|
|
1121
|
+
"ca-ES": [
|
|
1122
|
+
"H",
|
|
1123
|
+
"h",
|
|
1124
|
+
"hB"
|
|
1125
|
+
],
|
|
1126
|
+
"CF": [
|
|
1127
|
+
"H",
|
|
1128
|
+
"h",
|
|
1129
|
+
"hB"
|
|
1130
|
+
],
|
|
1131
|
+
"CM": [
|
|
1132
|
+
"H",
|
|
1133
|
+
"h",
|
|
1134
|
+
"hB"
|
|
1135
|
+
],
|
|
1136
|
+
"fr-CA": [
|
|
1137
|
+
"H",
|
|
1138
|
+
"h",
|
|
1139
|
+
"hB"
|
|
1140
|
+
],
|
|
1141
|
+
"gl-ES": [
|
|
1142
|
+
"H",
|
|
1143
|
+
"h",
|
|
1144
|
+
"hB"
|
|
1145
|
+
],
|
|
1146
|
+
"it-CH": [
|
|
1147
|
+
"H",
|
|
1148
|
+
"h",
|
|
1149
|
+
"hB"
|
|
1150
|
+
],
|
|
1151
|
+
"it-IT": [
|
|
1152
|
+
"H",
|
|
1153
|
+
"h",
|
|
1154
|
+
"hB"
|
|
1155
|
+
],
|
|
1156
|
+
"LU": [
|
|
1157
|
+
"H",
|
|
1158
|
+
"h",
|
|
1159
|
+
"hB"
|
|
1160
|
+
],
|
|
1161
|
+
"NP": [
|
|
1162
|
+
"H",
|
|
1163
|
+
"h",
|
|
1164
|
+
"hB"
|
|
1165
|
+
],
|
|
1166
|
+
"PF": [
|
|
1167
|
+
"H",
|
|
1168
|
+
"h",
|
|
1169
|
+
"hB"
|
|
1170
|
+
],
|
|
1171
|
+
"SC": [
|
|
1172
|
+
"H",
|
|
1173
|
+
"h",
|
|
1174
|
+
"hB"
|
|
1175
|
+
],
|
|
1176
|
+
"SM": [
|
|
1177
|
+
"H",
|
|
1178
|
+
"h",
|
|
1179
|
+
"hB"
|
|
1180
|
+
],
|
|
1181
|
+
"SN": [
|
|
1182
|
+
"H",
|
|
1183
|
+
"h",
|
|
1184
|
+
"hB"
|
|
1185
|
+
],
|
|
1186
|
+
"TF": [
|
|
1187
|
+
"H",
|
|
1188
|
+
"h",
|
|
1189
|
+
"hB"
|
|
1190
|
+
],
|
|
1191
|
+
"VA": [
|
|
1192
|
+
"H",
|
|
1193
|
+
"h",
|
|
1194
|
+
"hB"
|
|
1195
|
+
],
|
|
1196
|
+
"CY": [
|
|
1197
|
+
"h",
|
|
1198
|
+
"H",
|
|
1199
|
+
"hb",
|
|
1200
|
+
"hB"
|
|
1201
|
+
],
|
|
1202
|
+
"GR": [
|
|
1203
|
+
"h",
|
|
1204
|
+
"H",
|
|
1205
|
+
"hb",
|
|
1206
|
+
"hB"
|
|
1207
|
+
],
|
|
1208
|
+
"CO": [
|
|
1209
|
+
"h",
|
|
1210
|
+
"H",
|
|
1211
|
+
"hB",
|
|
1212
|
+
"hb"
|
|
1213
|
+
],
|
|
1214
|
+
"DO": [
|
|
1215
|
+
"h",
|
|
1216
|
+
"H",
|
|
1217
|
+
"hB",
|
|
1218
|
+
"hb"
|
|
1219
|
+
],
|
|
1220
|
+
"KP": [
|
|
1221
|
+
"h",
|
|
1222
|
+
"H",
|
|
1223
|
+
"hB",
|
|
1224
|
+
"hb"
|
|
1225
|
+
],
|
|
1226
|
+
"KR": [
|
|
1227
|
+
"h",
|
|
1228
|
+
"H",
|
|
1229
|
+
"hB",
|
|
1230
|
+
"hb"
|
|
1231
|
+
],
|
|
1232
|
+
"NA": [
|
|
1233
|
+
"h",
|
|
1234
|
+
"H",
|
|
1235
|
+
"hB",
|
|
1236
|
+
"hb"
|
|
1237
|
+
],
|
|
1238
|
+
"PA": [
|
|
1239
|
+
"h",
|
|
1240
|
+
"H",
|
|
1241
|
+
"hB",
|
|
1242
|
+
"hb"
|
|
1243
|
+
],
|
|
1244
|
+
"PR": [
|
|
1245
|
+
"h",
|
|
1246
|
+
"H",
|
|
1247
|
+
"hB",
|
|
1248
|
+
"hb"
|
|
1249
|
+
],
|
|
1250
|
+
"VE": [
|
|
1251
|
+
"h",
|
|
1252
|
+
"H",
|
|
1253
|
+
"hB",
|
|
1254
|
+
"hb"
|
|
1255
|
+
],
|
|
1256
|
+
"AC": [
|
|
1257
|
+
"H",
|
|
1258
|
+
"h",
|
|
1259
|
+
"hb",
|
|
1260
|
+
"hB"
|
|
1261
|
+
],
|
|
1262
|
+
"AI": [
|
|
1263
|
+
"H",
|
|
1264
|
+
"h",
|
|
1265
|
+
"hb",
|
|
1266
|
+
"hB"
|
|
1267
|
+
],
|
|
1268
|
+
"BW": [
|
|
1269
|
+
"H",
|
|
1270
|
+
"h",
|
|
1271
|
+
"hb",
|
|
1272
|
+
"hB"
|
|
1273
|
+
],
|
|
1274
|
+
"BZ": [
|
|
1275
|
+
"H",
|
|
1276
|
+
"h",
|
|
1277
|
+
"hb",
|
|
1278
|
+
"hB"
|
|
1279
|
+
],
|
|
1280
|
+
"CC": [
|
|
1281
|
+
"H",
|
|
1282
|
+
"h",
|
|
1283
|
+
"hb",
|
|
1284
|
+
"hB"
|
|
1285
|
+
],
|
|
1286
|
+
"CK": [
|
|
1287
|
+
"H",
|
|
1288
|
+
"h",
|
|
1289
|
+
"hb",
|
|
1290
|
+
"hB"
|
|
1291
|
+
],
|
|
1292
|
+
"CX": [
|
|
1293
|
+
"H",
|
|
1294
|
+
"h",
|
|
1295
|
+
"hb",
|
|
1296
|
+
"hB"
|
|
1297
|
+
],
|
|
1298
|
+
"DG": [
|
|
1299
|
+
"H",
|
|
1300
|
+
"h",
|
|
1301
|
+
"hb",
|
|
1302
|
+
"hB"
|
|
1303
|
+
],
|
|
1304
|
+
"FK": [
|
|
1305
|
+
"H",
|
|
1306
|
+
"h",
|
|
1307
|
+
"hb",
|
|
1308
|
+
"hB"
|
|
1309
|
+
],
|
|
1310
|
+
"GB": [
|
|
1311
|
+
"H",
|
|
1312
|
+
"h",
|
|
1313
|
+
"hb",
|
|
1314
|
+
"hB"
|
|
1315
|
+
],
|
|
1316
|
+
"GG": [
|
|
1317
|
+
"H",
|
|
1318
|
+
"h",
|
|
1319
|
+
"hb",
|
|
1320
|
+
"hB"
|
|
1321
|
+
],
|
|
1322
|
+
"GI": [
|
|
1323
|
+
"H",
|
|
1324
|
+
"h",
|
|
1325
|
+
"hb",
|
|
1326
|
+
"hB"
|
|
1327
|
+
],
|
|
1328
|
+
"IE": [
|
|
1329
|
+
"H",
|
|
1330
|
+
"h",
|
|
1331
|
+
"hb",
|
|
1332
|
+
"hB"
|
|
1333
|
+
],
|
|
1334
|
+
"IM": [
|
|
1335
|
+
"H",
|
|
1336
|
+
"h",
|
|
1337
|
+
"hb",
|
|
1338
|
+
"hB"
|
|
1339
|
+
],
|
|
1340
|
+
"IO": [
|
|
1341
|
+
"H",
|
|
1342
|
+
"h",
|
|
1343
|
+
"hb",
|
|
1344
|
+
"hB"
|
|
1345
|
+
],
|
|
1346
|
+
"JE": [
|
|
1347
|
+
"H",
|
|
1348
|
+
"h",
|
|
1349
|
+
"hb",
|
|
1350
|
+
"hB"
|
|
1351
|
+
],
|
|
1352
|
+
"LT": [
|
|
1353
|
+
"H",
|
|
1354
|
+
"h",
|
|
1355
|
+
"hb",
|
|
1356
|
+
"hB"
|
|
1357
|
+
],
|
|
1358
|
+
"MK": [
|
|
1359
|
+
"H",
|
|
1360
|
+
"h",
|
|
1361
|
+
"hb",
|
|
1362
|
+
"hB"
|
|
1363
|
+
],
|
|
1364
|
+
"MN": [
|
|
1365
|
+
"H",
|
|
1366
|
+
"h",
|
|
1367
|
+
"hb",
|
|
1368
|
+
"hB"
|
|
1369
|
+
],
|
|
1370
|
+
"MS": [
|
|
1371
|
+
"H",
|
|
1372
|
+
"h",
|
|
1373
|
+
"hb",
|
|
1374
|
+
"hB"
|
|
1375
|
+
],
|
|
1376
|
+
"NF": [
|
|
1377
|
+
"H",
|
|
1378
|
+
"h",
|
|
1379
|
+
"hb",
|
|
1380
|
+
"hB"
|
|
1381
|
+
],
|
|
1382
|
+
"NG": [
|
|
1383
|
+
"H",
|
|
1384
|
+
"h",
|
|
1385
|
+
"hb",
|
|
1386
|
+
"hB"
|
|
1387
|
+
],
|
|
1388
|
+
"NR": [
|
|
1389
|
+
"H",
|
|
1390
|
+
"h",
|
|
1391
|
+
"hb",
|
|
1392
|
+
"hB"
|
|
1393
|
+
],
|
|
1394
|
+
"NU": [
|
|
1395
|
+
"H",
|
|
1396
|
+
"h",
|
|
1397
|
+
"hb",
|
|
1398
|
+
"hB"
|
|
1399
|
+
],
|
|
1400
|
+
"PN": [
|
|
1401
|
+
"H",
|
|
1402
|
+
"h",
|
|
1403
|
+
"hb",
|
|
1404
|
+
"hB"
|
|
1405
|
+
],
|
|
1406
|
+
"SH": [
|
|
1407
|
+
"H",
|
|
1408
|
+
"h",
|
|
1409
|
+
"hb",
|
|
1410
|
+
"hB"
|
|
1411
|
+
],
|
|
1412
|
+
"SX": [
|
|
1413
|
+
"H",
|
|
1414
|
+
"h",
|
|
1415
|
+
"hb",
|
|
1416
|
+
"hB"
|
|
1417
|
+
],
|
|
1418
|
+
"TA": [
|
|
1419
|
+
"H",
|
|
1420
|
+
"h",
|
|
1421
|
+
"hb",
|
|
1422
|
+
"hB"
|
|
1423
|
+
],
|
|
1424
|
+
"ZA": [
|
|
1425
|
+
"H",
|
|
1426
|
+
"h",
|
|
1427
|
+
"hb",
|
|
1428
|
+
"hB"
|
|
1429
|
+
],
|
|
1430
|
+
"af-ZA": [
|
|
1431
|
+
"H",
|
|
1432
|
+
"h",
|
|
1433
|
+
"hB",
|
|
1434
|
+
"hb"
|
|
1435
|
+
],
|
|
1436
|
+
"AR": [
|
|
1437
|
+
"H",
|
|
1438
|
+
"h",
|
|
1439
|
+
"hB",
|
|
1440
|
+
"hb"
|
|
1441
|
+
],
|
|
1442
|
+
"CL": [
|
|
1443
|
+
"H",
|
|
1444
|
+
"h",
|
|
1445
|
+
"hB",
|
|
1446
|
+
"hb"
|
|
1447
|
+
],
|
|
1448
|
+
"CR": [
|
|
1449
|
+
"H",
|
|
1450
|
+
"h",
|
|
1451
|
+
"hB",
|
|
1452
|
+
"hb"
|
|
1453
|
+
],
|
|
1454
|
+
"CU": [
|
|
1455
|
+
"H",
|
|
1456
|
+
"h",
|
|
1457
|
+
"hB",
|
|
1458
|
+
"hb"
|
|
1459
|
+
],
|
|
1460
|
+
"EA": [
|
|
1461
|
+
"H",
|
|
1462
|
+
"h",
|
|
1463
|
+
"hB",
|
|
1464
|
+
"hb"
|
|
1465
|
+
],
|
|
1466
|
+
"es-BO": [
|
|
1467
|
+
"H",
|
|
1468
|
+
"h",
|
|
1469
|
+
"hB",
|
|
1470
|
+
"hb"
|
|
1471
|
+
],
|
|
1472
|
+
"es-BR": [
|
|
1473
|
+
"H",
|
|
1474
|
+
"h",
|
|
1475
|
+
"hB",
|
|
1476
|
+
"hb"
|
|
1477
|
+
],
|
|
1478
|
+
"es-EC": [
|
|
1479
|
+
"H",
|
|
1480
|
+
"h",
|
|
1481
|
+
"hB",
|
|
1482
|
+
"hb"
|
|
1483
|
+
],
|
|
1484
|
+
"es-ES": [
|
|
1485
|
+
"H",
|
|
1486
|
+
"h",
|
|
1487
|
+
"hB",
|
|
1488
|
+
"hb"
|
|
1489
|
+
],
|
|
1490
|
+
"es-GQ": [
|
|
1491
|
+
"H",
|
|
1492
|
+
"h",
|
|
1493
|
+
"hB",
|
|
1494
|
+
"hb"
|
|
1495
|
+
],
|
|
1496
|
+
"es-PE": [
|
|
1497
|
+
"H",
|
|
1498
|
+
"h",
|
|
1499
|
+
"hB",
|
|
1500
|
+
"hb"
|
|
1501
|
+
],
|
|
1502
|
+
"GT": [
|
|
1503
|
+
"H",
|
|
1504
|
+
"h",
|
|
1505
|
+
"hB",
|
|
1506
|
+
"hb"
|
|
1507
|
+
],
|
|
1508
|
+
"HN": [
|
|
1509
|
+
"H",
|
|
1510
|
+
"h",
|
|
1511
|
+
"hB",
|
|
1512
|
+
"hb"
|
|
1513
|
+
],
|
|
1514
|
+
"IC": [
|
|
1515
|
+
"H",
|
|
1516
|
+
"h",
|
|
1517
|
+
"hB",
|
|
1518
|
+
"hb"
|
|
1519
|
+
],
|
|
1520
|
+
"KG": [
|
|
1521
|
+
"H",
|
|
1522
|
+
"h",
|
|
1523
|
+
"hB",
|
|
1524
|
+
"hb"
|
|
1525
|
+
],
|
|
1526
|
+
"KM": [
|
|
1527
|
+
"H",
|
|
1528
|
+
"h",
|
|
1529
|
+
"hB",
|
|
1530
|
+
"hb"
|
|
1531
|
+
],
|
|
1532
|
+
"LK": [
|
|
1533
|
+
"H",
|
|
1534
|
+
"h",
|
|
1535
|
+
"hB",
|
|
1536
|
+
"hb"
|
|
1537
|
+
],
|
|
1538
|
+
"MA": [
|
|
1539
|
+
"H",
|
|
1540
|
+
"h",
|
|
1541
|
+
"hB",
|
|
1542
|
+
"hb"
|
|
1543
|
+
],
|
|
1544
|
+
"MX": [
|
|
1545
|
+
"H",
|
|
1546
|
+
"h",
|
|
1547
|
+
"hB",
|
|
1548
|
+
"hb"
|
|
1549
|
+
],
|
|
1550
|
+
"NI": [
|
|
1551
|
+
"H",
|
|
1552
|
+
"h",
|
|
1553
|
+
"hB",
|
|
1554
|
+
"hb"
|
|
1555
|
+
],
|
|
1556
|
+
"PY": [
|
|
1557
|
+
"H",
|
|
1558
|
+
"h",
|
|
1559
|
+
"hB",
|
|
1560
|
+
"hb"
|
|
1561
|
+
],
|
|
1562
|
+
"SV": [
|
|
1563
|
+
"H",
|
|
1564
|
+
"h",
|
|
1565
|
+
"hB",
|
|
1566
|
+
"hb"
|
|
1567
|
+
],
|
|
1568
|
+
"UY": [
|
|
1569
|
+
"H",
|
|
1570
|
+
"h",
|
|
1571
|
+
"hB",
|
|
1572
|
+
"hb"
|
|
1573
|
+
],
|
|
1574
|
+
"JP": [
|
|
1575
|
+
"H",
|
|
1576
|
+
"h",
|
|
1577
|
+
"K"
|
|
1578
|
+
],
|
|
1579
|
+
"AD": [
|
|
1580
|
+
"H",
|
|
1581
|
+
"hB"
|
|
1582
|
+
],
|
|
1583
|
+
"AM": [
|
|
1584
|
+
"H",
|
|
1585
|
+
"hB"
|
|
1586
|
+
],
|
|
1587
|
+
"AO": [
|
|
1588
|
+
"H",
|
|
1589
|
+
"hB"
|
|
1590
|
+
],
|
|
1591
|
+
"AT": [
|
|
1592
|
+
"H",
|
|
1593
|
+
"hB"
|
|
1594
|
+
],
|
|
1595
|
+
"AW": [
|
|
1596
|
+
"H",
|
|
1597
|
+
"hB"
|
|
1598
|
+
],
|
|
1599
|
+
"BE": [
|
|
1600
|
+
"H",
|
|
1601
|
+
"hB"
|
|
1602
|
+
],
|
|
1603
|
+
"BF": [
|
|
1604
|
+
"H",
|
|
1605
|
+
"hB"
|
|
1606
|
+
],
|
|
1607
|
+
"BJ": [
|
|
1608
|
+
"H",
|
|
1609
|
+
"hB"
|
|
1610
|
+
],
|
|
1611
|
+
"BL": [
|
|
1612
|
+
"H",
|
|
1613
|
+
"hB"
|
|
1614
|
+
],
|
|
1615
|
+
"BR": [
|
|
1616
|
+
"H",
|
|
1617
|
+
"hB"
|
|
1618
|
+
],
|
|
1619
|
+
"CG": [
|
|
1620
|
+
"H",
|
|
1621
|
+
"hB"
|
|
1622
|
+
],
|
|
1623
|
+
"CI": [
|
|
1624
|
+
"H",
|
|
1625
|
+
"hB"
|
|
1626
|
+
],
|
|
1627
|
+
"CV": [
|
|
1628
|
+
"H",
|
|
1629
|
+
"hB"
|
|
1630
|
+
],
|
|
1631
|
+
"DE": [
|
|
1632
|
+
"H",
|
|
1633
|
+
"hB"
|
|
1634
|
+
],
|
|
1635
|
+
"EE": [
|
|
1636
|
+
"H",
|
|
1637
|
+
"hB"
|
|
1638
|
+
],
|
|
1639
|
+
"FR": [
|
|
1640
|
+
"H",
|
|
1641
|
+
"hB"
|
|
1642
|
+
],
|
|
1643
|
+
"GA": [
|
|
1644
|
+
"H",
|
|
1645
|
+
"hB"
|
|
1646
|
+
],
|
|
1647
|
+
"GF": [
|
|
1648
|
+
"H",
|
|
1649
|
+
"hB"
|
|
1650
|
+
],
|
|
1651
|
+
"GN": [
|
|
1652
|
+
"H",
|
|
1653
|
+
"hB"
|
|
1654
|
+
],
|
|
1655
|
+
"GP": [
|
|
1656
|
+
"H",
|
|
1657
|
+
"hB"
|
|
1658
|
+
],
|
|
1659
|
+
"GW": [
|
|
1660
|
+
"H",
|
|
1661
|
+
"hB"
|
|
1662
|
+
],
|
|
1663
|
+
"HR": [
|
|
1664
|
+
"H",
|
|
1665
|
+
"hB"
|
|
1666
|
+
],
|
|
1667
|
+
"IL": [
|
|
1668
|
+
"H",
|
|
1669
|
+
"hB"
|
|
1670
|
+
],
|
|
1671
|
+
"IT": [
|
|
1672
|
+
"H",
|
|
1673
|
+
"hB"
|
|
1674
|
+
],
|
|
1675
|
+
"KZ": [
|
|
1676
|
+
"H",
|
|
1677
|
+
"hB"
|
|
1678
|
+
],
|
|
1679
|
+
"MC": [
|
|
1680
|
+
"H",
|
|
1681
|
+
"hB"
|
|
1682
|
+
],
|
|
1683
|
+
"MD": [
|
|
1684
|
+
"H",
|
|
1685
|
+
"hB"
|
|
1686
|
+
],
|
|
1687
|
+
"MF": [
|
|
1688
|
+
"H",
|
|
1689
|
+
"hB"
|
|
1690
|
+
],
|
|
1691
|
+
"MQ": [
|
|
1692
|
+
"H",
|
|
1693
|
+
"hB"
|
|
1694
|
+
],
|
|
1695
|
+
"MZ": [
|
|
1696
|
+
"H",
|
|
1697
|
+
"hB"
|
|
1698
|
+
],
|
|
1699
|
+
"NC": [
|
|
1700
|
+
"H",
|
|
1701
|
+
"hB"
|
|
1702
|
+
],
|
|
1703
|
+
"NL": [
|
|
1704
|
+
"H",
|
|
1705
|
+
"hB"
|
|
1706
|
+
],
|
|
1707
|
+
"PM": [
|
|
1708
|
+
"H",
|
|
1709
|
+
"hB"
|
|
1710
|
+
],
|
|
1711
|
+
"PT": [
|
|
1712
|
+
"H",
|
|
1713
|
+
"hB"
|
|
1714
|
+
],
|
|
1715
|
+
"RE": [
|
|
1716
|
+
"H",
|
|
1717
|
+
"hB"
|
|
1718
|
+
],
|
|
1719
|
+
"RO": [
|
|
1720
|
+
"H",
|
|
1721
|
+
"hB"
|
|
1722
|
+
],
|
|
1723
|
+
"SI": [
|
|
1724
|
+
"H",
|
|
1725
|
+
"hB"
|
|
1726
|
+
],
|
|
1727
|
+
"SR": [
|
|
1728
|
+
"H",
|
|
1729
|
+
"hB"
|
|
1730
|
+
],
|
|
1731
|
+
"ST": [
|
|
1732
|
+
"H",
|
|
1733
|
+
"hB"
|
|
1734
|
+
],
|
|
1735
|
+
"TG": [
|
|
1736
|
+
"H",
|
|
1737
|
+
"hB"
|
|
1738
|
+
],
|
|
1739
|
+
"TR": [
|
|
1740
|
+
"H",
|
|
1741
|
+
"hB"
|
|
1742
|
+
],
|
|
1743
|
+
"WF": [
|
|
1744
|
+
"H",
|
|
1745
|
+
"hB"
|
|
1746
|
+
],
|
|
1747
|
+
"YT": [
|
|
1748
|
+
"H",
|
|
1749
|
+
"hB"
|
|
1750
|
+
],
|
|
1751
|
+
"BD": [
|
|
1752
|
+
"h",
|
|
1753
|
+
"hB",
|
|
1754
|
+
"H"
|
|
1755
|
+
],
|
|
1756
|
+
"PK": [
|
|
1757
|
+
"h",
|
|
1758
|
+
"hB",
|
|
1759
|
+
"H"
|
|
1760
|
+
],
|
|
1761
|
+
"AZ": [
|
|
1762
|
+
"H",
|
|
1763
|
+
"hB",
|
|
1764
|
+
"h"
|
|
1765
|
+
],
|
|
1766
|
+
"BA": [
|
|
1767
|
+
"H",
|
|
1768
|
+
"hB",
|
|
1769
|
+
"h"
|
|
1770
|
+
],
|
|
1771
|
+
"BG": [
|
|
1772
|
+
"H",
|
|
1773
|
+
"hB",
|
|
1774
|
+
"h"
|
|
1775
|
+
],
|
|
1776
|
+
"CH": [
|
|
1777
|
+
"H",
|
|
1778
|
+
"hB",
|
|
1779
|
+
"h"
|
|
1780
|
+
],
|
|
1781
|
+
"GE": [
|
|
1782
|
+
"H",
|
|
1783
|
+
"hB",
|
|
1784
|
+
"h"
|
|
1785
|
+
],
|
|
1786
|
+
"LI": [
|
|
1787
|
+
"H",
|
|
1788
|
+
"hB",
|
|
1789
|
+
"h"
|
|
1790
|
+
],
|
|
1791
|
+
"ME": [
|
|
1792
|
+
"H",
|
|
1793
|
+
"hB",
|
|
1794
|
+
"h"
|
|
1795
|
+
],
|
|
1796
|
+
"RS": [
|
|
1797
|
+
"H",
|
|
1798
|
+
"hB",
|
|
1799
|
+
"h"
|
|
1800
|
+
],
|
|
1801
|
+
"UA": [
|
|
1802
|
+
"H",
|
|
1803
|
+
"hB",
|
|
1804
|
+
"h"
|
|
1805
|
+
],
|
|
1806
|
+
"UZ": [
|
|
1807
|
+
"H",
|
|
1808
|
+
"hB",
|
|
1809
|
+
"h"
|
|
1810
|
+
],
|
|
1811
|
+
"XK": [
|
|
1812
|
+
"H",
|
|
1813
|
+
"hB",
|
|
1814
|
+
"h"
|
|
1815
|
+
],
|
|
1816
|
+
"AG": [
|
|
1817
|
+
"h",
|
|
1818
|
+
"hb",
|
|
1819
|
+
"H",
|
|
1820
|
+
"hB"
|
|
1821
|
+
],
|
|
1822
|
+
"AU": [
|
|
1823
|
+
"h",
|
|
1824
|
+
"hb",
|
|
1825
|
+
"H",
|
|
1826
|
+
"hB"
|
|
1827
|
+
],
|
|
1828
|
+
"BB": [
|
|
1829
|
+
"h",
|
|
1830
|
+
"hb",
|
|
1831
|
+
"H",
|
|
1832
|
+
"hB"
|
|
1833
|
+
],
|
|
1834
|
+
"BM": [
|
|
1835
|
+
"h",
|
|
1836
|
+
"hb",
|
|
1837
|
+
"H",
|
|
1838
|
+
"hB"
|
|
1839
|
+
],
|
|
1840
|
+
"BS": [
|
|
1841
|
+
"h",
|
|
1842
|
+
"hb",
|
|
1843
|
+
"H",
|
|
1844
|
+
"hB"
|
|
1845
|
+
],
|
|
1846
|
+
"CA": [
|
|
1847
|
+
"h",
|
|
1848
|
+
"hb",
|
|
1849
|
+
"H",
|
|
1850
|
+
"hB"
|
|
1851
|
+
],
|
|
1852
|
+
"DM": [
|
|
1853
|
+
"h",
|
|
1854
|
+
"hb",
|
|
1855
|
+
"H",
|
|
1856
|
+
"hB"
|
|
1857
|
+
],
|
|
1858
|
+
"en-001": [
|
|
1859
|
+
"h",
|
|
1860
|
+
"hb",
|
|
1861
|
+
"H",
|
|
1862
|
+
"hB"
|
|
1863
|
+
],
|
|
1864
|
+
"FJ": [
|
|
1865
|
+
"h",
|
|
1866
|
+
"hb",
|
|
1867
|
+
"H",
|
|
1868
|
+
"hB"
|
|
1869
|
+
],
|
|
1870
|
+
"FM": [
|
|
1871
|
+
"h",
|
|
1872
|
+
"hb",
|
|
1873
|
+
"H",
|
|
1874
|
+
"hB"
|
|
1875
|
+
],
|
|
1876
|
+
"GD": [
|
|
1877
|
+
"h",
|
|
1878
|
+
"hb",
|
|
1879
|
+
"H",
|
|
1880
|
+
"hB"
|
|
1881
|
+
],
|
|
1882
|
+
"GM": [
|
|
1883
|
+
"h",
|
|
1884
|
+
"hb",
|
|
1885
|
+
"H",
|
|
1886
|
+
"hB"
|
|
1887
|
+
],
|
|
1888
|
+
"GU": [
|
|
1889
|
+
"h",
|
|
1890
|
+
"hb",
|
|
1891
|
+
"H",
|
|
1892
|
+
"hB"
|
|
1893
|
+
],
|
|
1894
|
+
"GY": [
|
|
1895
|
+
"h",
|
|
1896
|
+
"hb",
|
|
1897
|
+
"H",
|
|
1898
|
+
"hB"
|
|
1899
|
+
],
|
|
1900
|
+
"JM": [
|
|
1901
|
+
"h",
|
|
1902
|
+
"hb",
|
|
1903
|
+
"H",
|
|
1904
|
+
"hB"
|
|
1905
|
+
],
|
|
1906
|
+
"KI": [
|
|
1907
|
+
"h",
|
|
1908
|
+
"hb",
|
|
1909
|
+
"H",
|
|
1910
|
+
"hB"
|
|
1911
|
+
],
|
|
1912
|
+
"KN": [
|
|
1913
|
+
"h",
|
|
1914
|
+
"hb",
|
|
1915
|
+
"H",
|
|
1916
|
+
"hB"
|
|
1917
|
+
],
|
|
1918
|
+
"KY": [
|
|
1919
|
+
"h",
|
|
1920
|
+
"hb",
|
|
1921
|
+
"H",
|
|
1922
|
+
"hB"
|
|
1923
|
+
],
|
|
1924
|
+
"LC": [
|
|
1925
|
+
"h",
|
|
1926
|
+
"hb",
|
|
1927
|
+
"H",
|
|
1928
|
+
"hB"
|
|
1929
|
+
],
|
|
1930
|
+
"LR": [
|
|
1931
|
+
"h",
|
|
1932
|
+
"hb",
|
|
1933
|
+
"H",
|
|
1934
|
+
"hB"
|
|
1935
|
+
],
|
|
1936
|
+
"MH": [
|
|
1937
|
+
"h",
|
|
1938
|
+
"hb",
|
|
1939
|
+
"H",
|
|
1940
|
+
"hB"
|
|
1941
|
+
],
|
|
1942
|
+
"MP": [
|
|
1943
|
+
"h",
|
|
1944
|
+
"hb",
|
|
1945
|
+
"H",
|
|
1946
|
+
"hB"
|
|
1947
|
+
],
|
|
1948
|
+
"MW": [
|
|
1949
|
+
"h",
|
|
1950
|
+
"hb",
|
|
1951
|
+
"H",
|
|
1952
|
+
"hB"
|
|
1953
|
+
],
|
|
1954
|
+
"NZ": [
|
|
1955
|
+
"h",
|
|
1956
|
+
"hb",
|
|
1957
|
+
"H",
|
|
1958
|
+
"hB"
|
|
1959
|
+
],
|
|
1960
|
+
"SB": [
|
|
1961
|
+
"h",
|
|
1962
|
+
"hb",
|
|
1963
|
+
"H",
|
|
1964
|
+
"hB"
|
|
1965
|
+
],
|
|
1966
|
+
"SG": [
|
|
1967
|
+
"h",
|
|
1968
|
+
"hb",
|
|
1969
|
+
"H",
|
|
1970
|
+
"hB"
|
|
1971
|
+
],
|
|
1972
|
+
"SL": [
|
|
1973
|
+
"h",
|
|
1974
|
+
"hb",
|
|
1975
|
+
"H",
|
|
1976
|
+
"hB"
|
|
1977
|
+
],
|
|
1978
|
+
"SS": [
|
|
1979
|
+
"h",
|
|
1980
|
+
"hb",
|
|
1981
|
+
"H",
|
|
1982
|
+
"hB"
|
|
1983
|
+
],
|
|
1984
|
+
"SZ": [
|
|
1985
|
+
"h",
|
|
1986
|
+
"hb",
|
|
1987
|
+
"H",
|
|
1988
|
+
"hB"
|
|
1989
|
+
],
|
|
1990
|
+
"TC": [
|
|
1991
|
+
"h",
|
|
1992
|
+
"hb",
|
|
1993
|
+
"H",
|
|
1994
|
+
"hB"
|
|
1995
|
+
],
|
|
1996
|
+
"TT": [
|
|
1997
|
+
"h",
|
|
1998
|
+
"hb",
|
|
1999
|
+
"H",
|
|
2000
|
+
"hB"
|
|
2001
|
+
],
|
|
2002
|
+
"UM": [
|
|
2003
|
+
"h",
|
|
2004
|
+
"hb",
|
|
2005
|
+
"H",
|
|
2006
|
+
"hB"
|
|
2007
|
+
],
|
|
2008
|
+
"US": [
|
|
2009
|
+
"h",
|
|
2010
|
+
"hb",
|
|
2011
|
+
"H",
|
|
2012
|
+
"hB"
|
|
2013
|
+
],
|
|
2014
|
+
"VC": [
|
|
2015
|
+
"h",
|
|
2016
|
+
"hb",
|
|
2017
|
+
"H",
|
|
2018
|
+
"hB"
|
|
2019
|
+
],
|
|
2020
|
+
"VG": [
|
|
2021
|
+
"h",
|
|
2022
|
+
"hb",
|
|
2023
|
+
"H",
|
|
2024
|
+
"hB"
|
|
2025
|
+
],
|
|
2026
|
+
"VI": [
|
|
2027
|
+
"h",
|
|
2028
|
+
"hb",
|
|
2029
|
+
"H",
|
|
2030
|
+
"hB"
|
|
2031
|
+
],
|
|
2032
|
+
"ZM": [
|
|
2033
|
+
"h",
|
|
2034
|
+
"hb",
|
|
2035
|
+
"H",
|
|
2036
|
+
"hB"
|
|
2037
|
+
],
|
|
2038
|
+
"BO": [
|
|
2039
|
+
"H",
|
|
2040
|
+
"hB",
|
|
2041
|
+
"h",
|
|
2042
|
+
"hb"
|
|
2043
|
+
],
|
|
2044
|
+
"EC": [
|
|
2045
|
+
"H",
|
|
2046
|
+
"hB",
|
|
2047
|
+
"h",
|
|
2048
|
+
"hb"
|
|
2049
|
+
],
|
|
2050
|
+
"ES": [
|
|
2051
|
+
"H",
|
|
2052
|
+
"hB",
|
|
2053
|
+
"h",
|
|
2054
|
+
"hb"
|
|
2055
|
+
],
|
|
2056
|
+
"GQ": [
|
|
2057
|
+
"H",
|
|
2058
|
+
"hB",
|
|
2059
|
+
"h",
|
|
2060
|
+
"hb"
|
|
2061
|
+
],
|
|
2062
|
+
"PE": [
|
|
2063
|
+
"H",
|
|
2064
|
+
"hB",
|
|
2065
|
+
"h",
|
|
2066
|
+
"hb"
|
|
2067
|
+
],
|
|
2068
|
+
"AE": [
|
|
2069
|
+
"h",
|
|
2070
|
+
"hB",
|
|
2071
|
+
"hb",
|
|
2072
|
+
"H"
|
|
2073
|
+
],
|
|
2074
|
+
"ar-001": [
|
|
2075
|
+
"h",
|
|
2076
|
+
"hB",
|
|
2077
|
+
"hb",
|
|
2078
|
+
"H"
|
|
2079
|
+
],
|
|
2080
|
+
"BH": [
|
|
2081
|
+
"h",
|
|
2082
|
+
"hB",
|
|
2083
|
+
"hb",
|
|
2084
|
+
"H"
|
|
2085
|
+
],
|
|
2086
|
+
"DZ": [
|
|
2087
|
+
"h",
|
|
2088
|
+
"hB",
|
|
2089
|
+
"hb",
|
|
2090
|
+
"H"
|
|
2091
|
+
],
|
|
2092
|
+
"EG": [
|
|
2093
|
+
"h",
|
|
2094
|
+
"hB",
|
|
2095
|
+
"hb",
|
|
2096
|
+
"H"
|
|
2097
|
+
],
|
|
2098
|
+
"EH": [
|
|
2099
|
+
"h",
|
|
2100
|
+
"hB",
|
|
2101
|
+
"hb",
|
|
2102
|
+
"H"
|
|
2103
|
+
],
|
|
2104
|
+
"HK": [
|
|
2105
|
+
"h",
|
|
2106
|
+
"hB",
|
|
2107
|
+
"hb",
|
|
2108
|
+
"H"
|
|
2109
|
+
],
|
|
2110
|
+
"IQ": [
|
|
2111
|
+
"h",
|
|
2112
|
+
"hB",
|
|
2113
|
+
"hb",
|
|
2114
|
+
"H"
|
|
2115
|
+
],
|
|
2116
|
+
"JO": [
|
|
2117
|
+
"h",
|
|
2118
|
+
"hB",
|
|
2119
|
+
"hb",
|
|
2120
|
+
"H"
|
|
2121
|
+
],
|
|
2122
|
+
"KW": [
|
|
2123
|
+
"h",
|
|
2124
|
+
"hB",
|
|
2125
|
+
"hb",
|
|
2126
|
+
"H"
|
|
2127
|
+
],
|
|
2128
|
+
"LB": [
|
|
2129
|
+
"h",
|
|
2130
|
+
"hB",
|
|
2131
|
+
"hb",
|
|
2132
|
+
"H"
|
|
2133
|
+
],
|
|
2134
|
+
"LY": [
|
|
2135
|
+
"h",
|
|
2136
|
+
"hB",
|
|
2137
|
+
"hb",
|
|
2138
|
+
"H"
|
|
2139
|
+
],
|
|
2140
|
+
"MO": [
|
|
2141
|
+
"h",
|
|
2142
|
+
"hB",
|
|
2143
|
+
"hb",
|
|
2144
|
+
"H"
|
|
2145
|
+
],
|
|
2146
|
+
"MR": [
|
|
2147
|
+
"h",
|
|
2148
|
+
"hB",
|
|
2149
|
+
"hb",
|
|
2150
|
+
"H"
|
|
2151
|
+
],
|
|
2152
|
+
"OM": [
|
|
2153
|
+
"h",
|
|
2154
|
+
"hB",
|
|
2155
|
+
"hb",
|
|
2156
|
+
"H"
|
|
2157
|
+
],
|
|
2158
|
+
"PH": [
|
|
2159
|
+
"h",
|
|
2160
|
+
"hB",
|
|
2161
|
+
"hb",
|
|
2162
|
+
"H"
|
|
2163
|
+
],
|
|
2164
|
+
"PS": [
|
|
2165
|
+
"h",
|
|
2166
|
+
"hB",
|
|
2167
|
+
"hb",
|
|
2168
|
+
"H"
|
|
2169
|
+
],
|
|
2170
|
+
"QA": [
|
|
2171
|
+
"h",
|
|
2172
|
+
"hB",
|
|
2173
|
+
"hb",
|
|
2174
|
+
"H"
|
|
2175
|
+
],
|
|
2176
|
+
"SA": [
|
|
2177
|
+
"h",
|
|
2178
|
+
"hB",
|
|
2179
|
+
"hb",
|
|
2180
|
+
"H"
|
|
2181
|
+
],
|
|
2182
|
+
"SD": [
|
|
2183
|
+
"h",
|
|
2184
|
+
"hB",
|
|
2185
|
+
"hb",
|
|
2186
|
+
"H"
|
|
2187
|
+
],
|
|
2188
|
+
"SY": [
|
|
2189
|
+
"h",
|
|
2190
|
+
"hB",
|
|
2191
|
+
"hb",
|
|
2192
|
+
"H"
|
|
2193
|
+
],
|
|
2194
|
+
"TN": [
|
|
2195
|
+
"h",
|
|
2196
|
+
"hB",
|
|
2197
|
+
"hb",
|
|
2198
|
+
"H"
|
|
2199
|
+
],
|
|
2200
|
+
"YE": [
|
|
2201
|
+
"h",
|
|
2202
|
+
"hB",
|
|
2203
|
+
"hb",
|
|
2204
|
+
"H"
|
|
2205
|
+
],
|
|
2206
|
+
"AF": [
|
|
2207
|
+
"H",
|
|
2208
|
+
"hb",
|
|
2209
|
+
"hB",
|
|
2210
|
+
"h"
|
|
2211
|
+
],
|
|
2212
|
+
"LA": [
|
|
2213
|
+
"H",
|
|
2214
|
+
"hb",
|
|
2215
|
+
"hB",
|
|
2216
|
+
"h"
|
|
2217
|
+
],
|
|
2218
|
+
"CN": [
|
|
2219
|
+
"H",
|
|
2220
|
+
"hB",
|
|
2221
|
+
"hb",
|
|
2222
|
+
"h"
|
|
2223
|
+
],
|
|
2224
|
+
"LV": [
|
|
2225
|
+
"H",
|
|
2226
|
+
"hB",
|
|
2227
|
+
"hb",
|
|
2228
|
+
"h"
|
|
2229
|
+
],
|
|
2230
|
+
"TL": [
|
|
2231
|
+
"H",
|
|
2232
|
+
"hB",
|
|
2233
|
+
"hb",
|
|
2234
|
+
"h"
|
|
2235
|
+
],
|
|
2236
|
+
"zu-ZA": [
|
|
2237
|
+
"H",
|
|
2238
|
+
"hB",
|
|
2239
|
+
"hb",
|
|
2240
|
+
"h"
|
|
2241
|
+
],
|
|
2242
|
+
"CD": [
|
|
2243
|
+
"hB",
|
|
2244
|
+
"H"
|
|
2245
|
+
],
|
|
2246
|
+
"IR": [
|
|
2247
|
+
"hB",
|
|
2248
|
+
"H"
|
|
2249
|
+
],
|
|
2250
|
+
"hi-IN": [
|
|
2251
|
+
"hB",
|
|
2252
|
+
"h",
|
|
2253
|
+
"H"
|
|
2254
|
+
],
|
|
2255
|
+
"kn-IN": [
|
|
2256
|
+
"hB",
|
|
2257
|
+
"h",
|
|
2258
|
+
"H"
|
|
2259
|
+
],
|
|
2260
|
+
"ml-IN": [
|
|
2261
|
+
"hB",
|
|
2262
|
+
"h",
|
|
2263
|
+
"H"
|
|
2264
|
+
],
|
|
2265
|
+
"te-IN": [
|
|
2266
|
+
"hB",
|
|
2267
|
+
"h",
|
|
2268
|
+
"H"
|
|
2269
|
+
],
|
|
2270
|
+
"KH": [
|
|
2271
|
+
"hB",
|
|
2272
|
+
"h",
|
|
2273
|
+
"H",
|
|
2274
|
+
"hb"
|
|
2275
|
+
],
|
|
2276
|
+
"ta-IN": [
|
|
2277
|
+
"hB",
|
|
2278
|
+
"h",
|
|
2279
|
+
"hb",
|
|
2280
|
+
"H"
|
|
2281
|
+
],
|
|
2282
|
+
"BN": [
|
|
2283
|
+
"hb",
|
|
2284
|
+
"hB",
|
|
2285
|
+
"h",
|
|
2286
|
+
"H"
|
|
2287
|
+
],
|
|
2288
|
+
"MY": [
|
|
2289
|
+
"hb",
|
|
2290
|
+
"hB",
|
|
2291
|
+
"h",
|
|
2292
|
+
"H"
|
|
2293
|
+
],
|
|
2294
|
+
"ET": [
|
|
2295
|
+
"hB",
|
|
2296
|
+
"hb",
|
|
2297
|
+
"h",
|
|
2298
|
+
"H"
|
|
2299
|
+
],
|
|
2300
|
+
"gu-IN": [
|
|
2301
|
+
"hB",
|
|
2302
|
+
"hb",
|
|
2303
|
+
"h",
|
|
2304
|
+
"H"
|
|
2305
|
+
],
|
|
2306
|
+
"mr-IN": [
|
|
2307
|
+
"hB",
|
|
2308
|
+
"hb",
|
|
2309
|
+
"h",
|
|
2310
|
+
"H"
|
|
2311
|
+
],
|
|
2312
|
+
"pa-IN": [
|
|
2313
|
+
"hB",
|
|
2314
|
+
"hb",
|
|
2315
|
+
"h",
|
|
2316
|
+
"H"
|
|
2317
|
+
],
|
|
2318
|
+
"TW": [
|
|
2319
|
+
"hB",
|
|
2320
|
+
"hb",
|
|
2321
|
+
"h",
|
|
2322
|
+
"H"
|
|
2323
|
+
],
|
|
2324
|
+
"KE": [
|
|
2325
|
+
"hB",
|
|
2326
|
+
"hb",
|
|
2327
|
+
"H",
|
|
2328
|
+
"h"
|
|
2329
|
+
],
|
|
2330
|
+
"MM": [
|
|
2331
|
+
"hB",
|
|
2332
|
+
"hb",
|
|
2333
|
+
"H",
|
|
2334
|
+
"h"
|
|
2335
|
+
],
|
|
2336
|
+
"TZ": [
|
|
2337
|
+
"hB",
|
|
2338
|
+
"hb",
|
|
2339
|
+
"H",
|
|
2340
|
+
"h"
|
|
2341
|
+
],
|
|
2342
|
+
"UG": [
|
|
2343
|
+
"hB",
|
|
2344
|
+
"hb",
|
|
2345
|
+
"H",
|
|
2346
|
+
"h"
|
|
2347
|
+
]
|
|
2348
|
+
};
|
|
539
2349
|
}
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
2350
|
+
});
|
|
2351
|
+
|
|
2352
|
+
// bazel-out/darwin-fastbuild/bin/packages/icu-messageformat-parser/date-time-pattern-generator.js
|
|
2353
|
+
var require_date_time_pattern_generator = __commonJS({
|
|
2354
|
+
"bazel-out/darwin-fastbuild/bin/packages/icu-messageformat-parser/date-time-pattern-generator.js"(exports) {
|
|
2355
|
+
"use strict";
|
|
2356
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2357
|
+
exports.getBestPattern = void 0;
|
|
2358
|
+
var time_data_generated_1 = require_time_data_generated();
|
|
2359
|
+
function getBestPattern(skeleton, locale) {
|
|
2360
|
+
var skeletonCopy = "";
|
|
2361
|
+
for (var patternPos = 0; patternPos < skeleton.length; patternPos++) {
|
|
2362
|
+
var patternChar = skeleton.charAt(patternPos);
|
|
2363
|
+
if (patternChar === "j") {
|
|
2364
|
+
var extraLength = 0;
|
|
2365
|
+
while (patternPos + 1 < skeleton.length && skeleton.charAt(patternPos + 1) === patternChar) {
|
|
2366
|
+
extraLength++;
|
|
2367
|
+
patternPos++;
|
|
2368
|
+
}
|
|
2369
|
+
var hourLen = 1 + (extraLength & 1);
|
|
2370
|
+
var dayPeriodLen = extraLength < 2 ? 1 : 3 + (extraLength >> 1);
|
|
2371
|
+
var dayPeriodChar = "a";
|
|
2372
|
+
var hourChar = getDefaultHourSymbolFromLocale(locale);
|
|
2373
|
+
if (hourChar == "H" || hourChar == "k") {
|
|
2374
|
+
dayPeriodLen = 0;
|
|
2375
|
+
}
|
|
2376
|
+
while (dayPeriodLen-- > 0) {
|
|
2377
|
+
skeletonCopy += dayPeriodChar;
|
|
2378
|
+
}
|
|
2379
|
+
while (hourLen-- > 0) {
|
|
2380
|
+
skeletonCopy = hourChar + skeletonCopy;
|
|
2381
|
+
}
|
|
2382
|
+
} else if (patternChar === "J") {
|
|
2383
|
+
skeletonCopy += "H";
|
|
2384
|
+
} else {
|
|
2385
|
+
skeletonCopy += patternChar;
|
|
2386
|
+
}
|
|
573
2387
|
}
|
|
574
|
-
|
|
575
|
-
index += c >= 65536 ? 2 : 1;
|
|
2388
|
+
return skeletonCopy;
|
|
576
2389
|
}
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
2390
|
+
exports.getBestPattern = getBestPattern;
|
|
2391
|
+
function getDefaultHourSymbolFromLocale(locale) {
|
|
2392
|
+
var hourCycle = locale.hourCycle;
|
|
2393
|
+
if (hourCycle === void 0 && locale.hourCycles && locale.hourCycles.length) {
|
|
2394
|
+
hourCycle = locale.hourCycles[0];
|
|
2395
|
+
}
|
|
2396
|
+
if (hourCycle) {
|
|
2397
|
+
switch (hourCycle) {
|
|
2398
|
+
case "h24":
|
|
2399
|
+
return "k";
|
|
2400
|
+
case "h23":
|
|
2401
|
+
return "H";
|
|
2402
|
+
case "h12":
|
|
2403
|
+
return "h";
|
|
2404
|
+
case "h11":
|
|
2405
|
+
return "K";
|
|
2406
|
+
default:
|
|
2407
|
+
throw new Error("Invalid hourCycle");
|
|
2408
|
+
}
|
|
2409
|
+
}
|
|
2410
|
+
var languageTag = locale.language;
|
|
2411
|
+
var regionTag;
|
|
2412
|
+
if (languageTag !== "root") {
|
|
2413
|
+
regionTag = locale.maximize().region;
|
|
2414
|
+
}
|
|
2415
|
+
var hourCycles = time_data_generated_1.timeData[regionTag || ""] || time_data_generated_1.timeData[languageTag || ""] || time_data_generated_1.timeData["".concat(languageTag, "-001")] || time_data_generated_1.timeData["001"];
|
|
2416
|
+
return hourCycles[0];
|
|
585
2417
|
}
|
|
586
|
-
this.message = message;
|
|
587
|
-
this.position = { offset: 0, line: 1, column: 1 };
|
|
588
|
-
this.ignoreTag = !!options.ignoreTag;
|
|
589
|
-
this.requiresOtherClause = !!options.requiresOtherClause;
|
|
590
|
-
this.shouldParseSkeletons = !!options.shouldParseSkeletons;
|
|
591
2418
|
}
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
2419
|
+
});
|
|
2420
|
+
|
|
2421
|
+
// bazel-out/darwin-fastbuild/bin/packages/icu-messageformat-parser/parser.js
|
|
2422
|
+
var require_parser = __commonJS({
|
|
2423
|
+
"bazel-out/darwin-fastbuild/bin/packages/icu-messageformat-parser/parser.js"(exports) {
|
|
2424
|
+
"use strict";
|
|
2425
|
+
var _a;
|
|
2426
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2427
|
+
exports.Parser = void 0;
|
|
2428
|
+
var tslib_1 = require_tslib();
|
|
2429
|
+
var error_1 = require_error();
|
|
2430
|
+
var types_1 = require_types();
|
|
2431
|
+
var regex_generated_1 = require_regex_generated();
|
|
2432
|
+
var icu_skeleton_parser_1 = require_icu_skeleton_parser();
|
|
2433
|
+
var date_time_pattern_generator_1 = require_date_time_pattern_generator();
|
|
2434
|
+
var SPACE_SEPARATOR_START_REGEX = new RegExp("^".concat(regex_generated_1.SPACE_SEPARATOR_REGEX.source, "*"));
|
|
2435
|
+
var SPACE_SEPARATOR_END_REGEX = new RegExp("".concat(regex_generated_1.SPACE_SEPARATOR_REGEX.source, "*$"));
|
|
2436
|
+
function createLocation(start, end) {
|
|
2437
|
+
return { start, end };
|
|
2438
|
+
}
|
|
2439
|
+
var hasNativeStartsWith = !!String.prototype.startsWith;
|
|
2440
|
+
var hasNativeFromCodePoint = !!String.fromCodePoint;
|
|
2441
|
+
var hasNativeFromEntries = !!Object.fromEntries;
|
|
2442
|
+
var hasNativeCodePointAt = !!String.prototype.codePointAt;
|
|
2443
|
+
var hasTrimStart = !!String.prototype.trimStart;
|
|
2444
|
+
var hasTrimEnd = !!String.prototype.trimEnd;
|
|
2445
|
+
var hasNativeIsSafeInteger = !!Number.isSafeInteger;
|
|
2446
|
+
var isSafeInteger = hasNativeIsSafeInteger ? Number.isSafeInteger : function(n) {
|
|
2447
|
+
return typeof n === "number" && isFinite(n) && Math.floor(n) === n && Math.abs(n) <= 9007199254740991;
|
|
2448
|
+
};
|
|
2449
|
+
var REGEX_SUPPORTS_U_AND_Y = true;
|
|
2450
|
+
try {
|
|
2451
|
+
re = RE("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu");
|
|
2452
|
+
REGEX_SUPPORTS_U_AND_Y = ((_a = re.exec("a")) === null || _a === void 0 ? void 0 : _a[0]) === "a";
|
|
2453
|
+
} catch (_) {
|
|
2454
|
+
REGEX_SUPPORTS_U_AND_Y = false;
|
|
2455
|
+
}
|
|
2456
|
+
var re;
|
|
2457
|
+
var startsWith = hasNativeStartsWith ? function startsWith2(s, search, position) {
|
|
2458
|
+
return s.startsWith(search, position);
|
|
2459
|
+
} : function startsWith2(s, search, position) {
|
|
2460
|
+
return s.slice(position, position + search.length) === search;
|
|
2461
|
+
};
|
|
2462
|
+
var fromCodePoint = hasNativeFromCodePoint ? String.fromCodePoint : function fromCodePoint2() {
|
|
2463
|
+
var codePoints = [];
|
|
2464
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
2465
|
+
codePoints[_i] = arguments[_i];
|
|
2466
|
+
}
|
|
2467
|
+
var elements = "";
|
|
2468
|
+
var length = codePoints.length;
|
|
2469
|
+
var i = 0;
|
|
2470
|
+
var code;
|
|
2471
|
+
while (length > i) {
|
|
2472
|
+
code = codePoints[i++];
|
|
2473
|
+
if (code > 1114111)
|
|
2474
|
+
throw RangeError(code + " is not a valid code point");
|
|
2475
|
+
elements += code < 65536 ? String.fromCharCode(code) : String.fromCharCode(((code -= 65536) >> 10) + 55296, code % 1024 + 56320);
|
|
2476
|
+
}
|
|
2477
|
+
return elements;
|
|
2478
|
+
};
|
|
2479
|
+
var fromEntries = hasNativeFromEntries ? Object.fromEntries : function fromEntries2(entries) {
|
|
2480
|
+
var obj = {};
|
|
2481
|
+
for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {
|
|
2482
|
+
var _a2 = entries_1[_i], k = _a2[0], v = _a2[1];
|
|
2483
|
+
obj[k] = v;
|
|
2484
|
+
}
|
|
2485
|
+
return obj;
|
|
2486
|
+
};
|
|
2487
|
+
var codePointAt = hasNativeCodePointAt ? function codePointAt2(s, index) {
|
|
2488
|
+
return s.codePointAt(index);
|
|
2489
|
+
} : function codePointAt2(s, index) {
|
|
2490
|
+
var size = s.length;
|
|
2491
|
+
if (index < 0 || index >= size) {
|
|
2492
|
+
return void 0;
|
|
2493
|
+
}
|
|
2494
|
+
var first = s.charCodeAt(index);
|
|
2495
|
+
var second;
|
|
2496
|
+
return first < 55296 || first > 56319 || index + 1 === size || (second = s.charCodeAt(index + 1)) < 56320 || second > 57343 ? first : (first - 55296 << 10) + (second - 56320) + 65536;
|
|
2497
|
+
};
|
|
2498
|
+
var trimStart = hasTrimStart ? function trimStart2(s) {
|
|
2499
|
+
return s.trimStart();
|
|
2500
|
+
} : function trimStart2(s) {
|
|
2501
|
+
return s.replace(SPACE_SEPARATOR_START_REGEX, "");
|
|
2502
|
+
};
|
|
2503
|
+
var trimEnd = hasTrimEnd ? function trimEnd2(s) {
|
|
2504
|
+
return s.trimEnd();
|
|
2505
|
+
} : function trimEnd2(s) {
|
|
2506
|
+
return s.replace(SPACE_SEPARATOR_END_REGEX, "");
|
|
2507
|
+
};
|
|
2508
|
+
function RE(s, flag) {
|
|
2509
|
+
return new RegExp(s, flag);
|
|
2510
|
+
}
|
|
2511
|
+
var matchIdentifierAtIndex;
|
|
2512
|
+
if (REGEX_SUPPORTS_U_AND_Y) {
|
|
2513
|
+
IDENTIFIER_PREFIX_RE_1 = RE("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu");
|
|
2514
|
+
matchIdentifierAtIndex = function matchIdentifierAtIndex2(s, index) {
|
|
2515
|
+
var _a2;
|
|
2516
|
+
IDENTIFIER_PREFIX_RE_1.lastIndex = index;
|
|
2517
|
+
var match = IDENTIFIER_PREFIX_RE_1.exec(s);
|
|
2518
|
+
return (_a2 = match[1]) !== null && _a2 !== void 0 ? _a2 : "";
|
|
2519
|
+
};
|
|
2520
|
+
} else {
|
|
2521
|
+
matchIdentifierAtIndex = function matchIdentifierAtIndex2(s, index) {
|
|
2522
|
+
var match = [];
|
|
2523
|
+
while (true) {
|
|
2524
|
+
var c = codePointAt(s, index);
|
|
2525
|
+
if (c === void 0 || _isWhiteSpace(c) || _isPatternSyntax(c)) {
|
|
2526
|
+
break;
|
|
2527
|
+
}
|
|
2528
|
+
match.push(c);
|
|
2529
|
+
index += c >= 65536 ? 2 : 1;
|
|
2530
|
+
}
|
|
2531
|
+
return fromCodePoint.apply(void 0, match);
|
|
2532
|
+
};
|
|
595
2533
|
}
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
var char = this.char();
|
|
602
|
-
if (char === 123) {
|
|
603
|
-
var result = this.parseArgument(nestingLevel, expectingCloseTag);
|
|
604
|
-
if (result.err) {
|
|
605
|
-
return result;
|
|
606
|
-
}
|
|
607
|
-
elements.push(result.val);
|
|
608
|
-
} else if (char === 125 && nestingLevel > 0) {
|
|
609
|
-
break;
|
|
610
|
-
} else if (char === 35 && (parentArgType === "plural" || parentArgType === "selectordinal")) {
|
|
611
|
-
var position = this.clonePosition();
|
|
612
|
-
this.bump();
|
|
613
|
-
elements.push({
|
|
614
|
-
type: TYPE.pound,
|
|
615
|
-
location: createLocation(position, this.clonePosition())
|
|
616
|
-
});
|
|
617
|
-
} else if (char === 60 && !this.ignoreTag && this.peek() === 47) {
|
|
618
|
-
if (expectingCloseTag) {
|
|
619
|
-
break;
|
|
620
|
-
} else {
|
|
621
|
-
return this.error(ErrorKind.UNMATCHED_CLOSING_TAG, createLocation(this.clonePosition(), this.clonePosition()));
|
|
2534
|
+
var IDENTIFIER_PREFIX_RE_1;
|
|
2535
|
+
var Parser = function() {
|
|
2536
|
+
function Parser2(message, options) {
|
|
2537
|
+
if (options === void 0) {
|
|
2538
|
+
options = {};
|
|
622
2539
|
}
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
2540
|
+
this.message = message;
|
|
2541
|
+
this.position = { offset: 0, line: 1, column: 1 };
|
|
2542
|
+
this.ignoreTag = !!options.ignoreTag;
|
|
2543
|
+
this.locale = options.locale;
|
|
2544
|
+
this.requiresOtherClause = !!options.requiresOtherClause;
|
|
2545
|
+
this.shouldParseSkeletons = !!options.shouldParseSkeletons;
|
|
2546
|
+
}
|
|
2547
|
+
Parser2.prototype.parse = function() {
|
|
2548
|
+
if (this.offset() !== 0) {
|
|
2549
|
+
throw Error("parser can only be used once");
|
|
627
2550
|
}
|
|
628
|
-
|
|
629
|
-
}
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
2551
|
+
return this.parseMessage(0, "", false);
|
|
2552
|
+
};
|
|
2553
|
+
Parser2.prototype.parseMessage = function(nestingLevel, parentArgType, expectingCloseTag) {
|
|
2554
|
+
var elements = [];
|
|
2555
|
+
while (!this.isEOF()) {
|
|
2556
|
+
var char = this.char();
|
|
2557
|
+
if (char === 123) {
|
|
2558
|
+
var result = this.parseArgument(nestingLevel, expectingCloseTag);
|
|
2559
|
+
if (result.err) {
|
|
2560
|
+
return result;
|
|
2561
|
+
}
|
|
2562
|
+
elements.push(result.val);
|
|
2563
|
+
} else if (char === 125 && nestingLevel > 0) {
|
|
2564
|
+
break;
|
|
2565
|
+
} else if (char === 35 && (parentArgType === "plural" || parentArgType === "selectordinal")) {
|
|
2566
|
+
var position = this.clonePosition();
|
|
2567
|
+
this.bump();
|
|
2568
|
+
elements.push({
|
|
2569
|
+
type: types_1.TYPE.pound,
|
|
2570
|
+
location: createLocation(position, this.clonePosition())
|
|
2571
|
+
});
|
|
2572
|
+
} else if (char === 60 && !this.ignoreTag && this.peek() === 47) {
|
|
2573
|
+
if (expectingCloseTag) {
|
|
2574
|
+
break;
|
|
2575
|
+
} else {
|
|
2576
|
+
return this.error(error_1.ErrorKind.UNMATCHED_CLOSING_TAG, createLocation(this.clonePosition(), this.clonePosition()));
|
|
2577
|
+
}
|
|
2578
|
+
} else if (char === 60 && !this.ignoreTag && _isAlpha(this.peek() || 0)) {
|
|
2579
|
+
var result = this.parseTag(nestingLevel, parentArgType);
|
|
2580
|
+
if (result.err) {
|
|
2581
|
+
return result;
|
|
2582
|
+
}
|
|
2583
|
+
elements.push(result.val);
|
|
2584
|
+
} else {
|
|
2585
|
+
var result = this.parseLiteral(nestingLevel, parentArgType);
|
|
2586
|
+
if (result.err) {
|
|
2587
|
+
return result;
|
|
2588
|
+
}
|
|
2589
|
+
elements.push(result.val);
|
|
2590
|
+
}
|
|
633
2591
|
}
|
|
634
|
-
elements
|
|
635
|
-
}
|
|
636
|
-
}
|
|
637
|
-
return { val: elements, err: null };
|
|
638
|
-
};
|
|
639
|
-
Parser2.prototype.parseTag = function(nestingLevel, parentArgType) {
|
|
640
|
-
var startPosition = this.clonePosition();
|
|
641
|
-
this.bump();
|
|
642
|
-
var tagName = this.parseTagName();
|
|
643
|
-
this.bumpSpace();
|
|
644
|
-
if (this.bumpIf("/>")) {
|
|
645
|
-
return {
|
|
646
|
-
val: {
|
|
647
|
-
type: TYPE.literal,
|
|
648
|
-
value: "<".concat(tagName, "/>"),
|
|
649
|
-
location: createLocation(startPosition, this.clonePosition())
|
|
650
|
-
},
|
|
651
|
-
err: null
|
|
2592
|
+
return { val: elements, err: null };
|
|
652
2593
|
};
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
2594
|
+
Parser2.prototype.parseTag = function(nestingLevel, parentArgType) {
|
|
2595
|
+
var startPosition = this.clonePosition();
|
|
2596
|
+
this.bump();
|
|
2597
|
+
var tagName = this.parseTagName();
|
|
2598
|
+
this.bumpSpace();
|
|
2599
|
+
if (this.bumpIf("/>")) {
|
|
2600
|
+
return {
|
|
2601
|
+
val: {
|
|
2602
|
+
type: types_1.TYPE.literal,
|
|
2603
|
+
value: "<".concat(tagName, "/>"),
|
|
2604
|
+
location: createLocation(startPosition, this.clonePosition())
|
|
2605
|
+
},
|
|
2606
|
+
err: null
|
|
2607
|
+
};
|
|
2608
|
+
} else if (this.bumpIf(">")) {
|
|
2609
|
+
var childrenResult = this.parseMessage(nestingLevel + 1, parentArgType, true);
|
|
2610
|
+
if (childrenResult.err) {
|
|
2611
|
+
return childrenResult;
|
|
2612
|
+
}
|
|
2613
|
+
var children = childrenResult.val;
|
|
2614
|
+
var endTagStartPosition = this.clonePosition();
|
|
2615
|
+
if (this.bumpIf("</")) {
|
|
2616
|
+
if (this.isEOF() || !_isAlpha(this.char())) {
|
|
2617
|
+
return this.error(error_1.ErrorKind.INVALID_TAG, createLocation(endTagStartPosition, this.clonePosition()));
|
|
2618
|
+
}
|
|
2619
|
+
var closingTagNameStartPosition = this.clonePosition();
|
|
2620
|
+
var closingTagName = this.parseTagName();
|
|
2621
|
+
if (tagName !== closingTagName) {
|
|
2622
|
+
return this.error(error_1.ErrorKind.UNMATCHED_CLOSING_TAG, createLocation(closingTagNameStartPosition, this.clonePosition()));
|
|
2623
|
+
}
|
|
2624
|
+
this.bumpSpace();
|
|
2625
|
+
if (!this.bumpIf(">")) {
|
|
2626
|
+
return this.error(error_1.ErrorKind.INVALID_TAG, createLocation(endTagStartPosition, this.clonePosition()));
|
|
2627
|
+
}
|
|
2628
|
+
return {
|
|
2629
|
+
val: {
|
|
2630
|
+
type: types_1.TYPE.tag,
|
|
2631
|
+
value: tagName,
|
|
2632
|
+
children,
|
|
2633
|
+
location: createLocation(startPosition, this.clonePosition())
|
|
2634
|
+
},
|
|
2635
|
+
err: null
|
|
2636
|
+
};
|
|
2637
|
+
} else {
|
|
2638
|
+
return this.error(error_1.ErrorKind.UNCLOSED_TAG, createLocation(startPosition, this.clonePosition()));
|
|
2639
|
+
}
|
|
2640
|
+
} else {
|
|
2641
|
+
return this.error(error_1.ErrorKind.INVALID_TAG, createLocation(startPosition, this.clonePosition()));
|
|
663
2642
|
}
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
2643
|
+
};
|
|
2644
|
+
Parser2.prototype.parseTagName = function() {
|
|
2645
|
+
var startOffset = this.offset();
|
|
2646
|
+
this.bump();
|
|
2647
|
+
while (!this.isEOF() && _isPotentialElementNameChar(this.char())) {
|
|
2648
|
+
this.bump();
|
|
668
2649
|
}
|
|
669
|
-
this.
|
|
670
|
-
|
|
671
|
-
|
|
2650
|
+
return this.message.slice(startOffset, this.offset());
|
|
2651
|
+
};
|
|
2652
|
+
Parser2.prototype.parseLiteral = function(nestingLevel, parentArgType) {
|
|
2653
|
+
var start = this.clonePosition();
|
|
2654
|
+
var value = "";
|
|
2655
|
+
while (true) {
|
|
2656
|
+
var parseQuoteResult = this.tryParseQuote(parentArgType);
|
|
2657
|
+
if (parseQuoteResult) {
|
|
2658
|
+
value += parseQuoteResult;
|
|
2659
|
+
continue;
|
|
2660
|
+
}
|
|
2661
|
+
var parseUnquotedResult = this.tryParseUnquoted(nestingLevel, parentArgType);
|
|
2662
|
+
if (parseUnquotedResult) {
|
|
2663
|
+
value += parseUnquotedResult;
|
|
2664
|
+
continue;
|
|
2665
|
+
}
|
|
2666
|
+
var parseLeftAngleResult = this.tryParseLeftAngleBracket();
|
|
2667
|
+
if (parseLeftAngleResult) {
|
|
2668
|
+
value += parseLeftAngleResult;
|
|
2669
|
+
continue;
|
|
2670
|
+
}
|
|
2671
|
+
break;
|
|
672
2672
|
}
|
|
2673
|
+
var location = createLocation(start, this.clonePosition());
|
|
673
2674
|
return {
|
|
674
|
-
val: {
|
|
675
|
-
type: TYPE.tag,
|
|
676
|
-
value: tagName,
|
|
677
|
-
children,
|
|
678
|
-
location: createLocation(startPosition, this.clonePosition())
|
|
679
|
-
},
|
|
2675
|
+
val: { type: types_1.TYPE.literal, value, location },
|
|
680
2676
|
err: null
|
|
681
2677
|
};
|
|
682
|
-
}
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
if (parseLeftAngleResult) {
|
|
713
|
-
value += parseLeftAngleResult;
|
|
714
|
-
continue;
|
|
715
|
-
}
|
|
716
|
-
break;
|
|
717
|
-
}
|
|
718
|
-
var location = createLocation(start, this.clonePosition());
|
|
719
|
-
return {
|
|
720
|
-
val: { type: TYPE.literal, value, location },
|
|
721
|
-
err: null
|
|
722
|
-
};
|
|
723
|
-
};
|
|
724
|
-
Parser2.prototype.tryParseLeftAngleBracket = function() {
|
|
725
|
-
if (!this.isEOF() && this.char() === 60 && (this.ignoreTag || !_isAlphaOrSlash(this.peek() || 0))) {
|
|
726
|
-
this.bump();
|
|
727
|
-
return "<";
|
|
728
|
-
}
|
|
729
|
-
return null;
|
|
730
|
-
};
|
|
731
|
-
Parser2.prototype.tryParseQuote = function(parentArgType) {
|
|
732
|
-
if (this.isEOF() || this.char() !== 39) {
|
|
733
|
-
return null;
|
|
734
|
-
}
|
|
735
|
-
switch (this.peek()) {
|
|
736
|
-
case 39:
|
|
2678
|
+
};
|
|
2679
|
+
Parser2.prototype.tryParseLeftAngleBracket = function() {
|
|
2680
|
+
if (!this.isEOF() && this.char() === 60 && (this.ignoreTag || !_isAlphaOrSlash(this.peek() || 0))) {
|
|
2681
|
+
this.bump();
|
|
2682
|
+
return "<";
|
|
2683
|
+
}
|
|
2684
|
+
return null;
|
|
2685
|
+
};
|
|
2686
|
+
Parser2.prototype.tryParseQuote = function(parentArgType) {
|
|
2687
|
+
if (this.isEOF() || this.char() !== 39) {
|
|
2688
|
+
return null;
|
|
2689
|
+
}
|
|
2690
|
+
switch (this.peek()) {
|
|
2691
|
+
case 39:
|
|
2692
|
+
this.bump();
|
|
2693
|
+
this.bump();
|
|
2694
|
+
return "'";
|
|
2695
|
+
case 123:
|
|
2696
|
+
case 60:
|
|
2697
|
+
case 62:
|
|
2698
|
+
case 125:
|
|
2699
|
+
break;
|
|
2700
|
+
case 35:
|
|
2701
|
+
if (parentArgType === "plural" || parentArgType === "selectordinal") {
|
|
2702
|
+
break;
|
|
2703
|
+
}
|
|
2704
|
+
return null;
|
|
2705
|
+
default:
|
|
2706
|
+
return null;
|
|
2707
|
+
}
|
|
737
2708
|
this.bump();
|
|
2709
|
+
var codePoints = [this.char()];
|
|
738
2710
|
this.bump();
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
}
|
|
753
|
-
this.bump();
|
|
754
|
-
var codePoints = [this.char()];
|
|
755
|
-
this.bump();
|
|
756
|
-
while (!this.isEOF()) {
|
|
757
|
-
var ch = this.char();
|
|
758
|
-
if (ch === 39) {
|
|
759
|
-
if (this.peek() === 39) {
|
|
760
|
-
codePoints.push(39);
|
|
2711
|
+
while (!this.isEOF()) {
|
|
2712
|
+
var ch = this.char();
|
|
2713
|
+
if (ch === 39) {
|
|
2714
|
+
if (this.peek() === 39) {
|
|
2715
|
+
codePoints.push(39);
|
|
2716
|
+
this.bump();
|
|
2717
|
+
} else {
|
|
2718
|
+
this.bump();
|
|
2719
|
+
break;
|
|
2720
|
+
}
|
|
2721
|
+
} else {
|
|
2722
|
+
codePoints.push(ch);
|
|
2723
|
+
}
|
|
761
2724
|
this.bump();
|
|
2725
|
+
}
|
|
2726
|
+
return fromCodePoint.apply(void 0, codePoints);
|
|
2727
|
+
};
|
|
2728
|
+
Parser2.prototype.tryParseUnquoted = function(nestingLevel, parentArgType) {
|
|
2729
|
+
if (this.isEOF()) {
|
|
2730
|
+
return null;
|
|
2731
|
+
}
|
|
2732
|
+
var ch = this.char();
|
|
2733
|
+
if (ch === 60 || ch === 123 || ch === 35 && (parentArgType === "plural" || parentArgType === "selectordinal") || ch === 125 && nestingLevel > 0) {
|
|
2734
|
+
return null;
|
|
762
2735
|
} else {
|
|
763
2736
|
this.bump();
|
|
764
|
-
|
|
2737
|
+
return fromCodePoint(ch);
|
|
765
2738
|
}
|
|
766
|
-
}
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
this.bump();
|
|
770
|
-
}
|
|
771
|
-
return fromCodePoint.apply(void 0, codePoints);
|
|
772
|
-
};
|
|
773
|
-
Parser2.prototype.tryParseUnquoted = function(nestingLevel, parentArgType) {
|
|
774
|
-
if (this.isEOF()) {
|
|
775
|
-
return null;
|
|
776
|
-
}
|
|
777
|
-
var ch = this.char();
|
|
778
|
-
if (ch === 60 || ch === 123 || ch === 35 && (parentArgType === "plural" || parentArgType === "selectordinal") || ch === 125 && nestingLevel > 0) {
|
|
779
|
-
return null;
|
|
780
|
-
} else {
|
|
781
|
-
this.bump();
|
|
782
|
-
return fromCodePoint(ch);
|
|
783
|
-
}
|
|
784
|
-
};
|
|
785
|
-
Parser2.prototype.parseArgument = function(nestingLevel, expectingCloseTag) {
|
|
786
|
-
var openingBracePosition = this.clonePosition();
|
|
787
|
-
this.bump();
|
|
788
|
-
this.bumpSpace();
|
|
789
|
-
if (this.isEOF()) {
|
|
790
|
-
return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));
|
|
791
|
-
}
|
|
792
|
-
if (this.char() === 125) {
|
|
793
|
-
this.bump();
|
|
794
|
-
return this.error(ErrorKind.EMPTY_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));
|
|
795
|
-
}
|
|
796
|
-
var value = this.parseIdentifierIfPossible().value;
|
|
797
|
-
if (!value) {
|
|
798
|
-
return this.error(ErrorKind.MALFORMED_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));
|
|
799
|
-
}
|
|
800
|
-
this.bumpSpace();
|
|
801
|
-
if (this.isEOF()) {
|
|
802
|
-
return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));
|
|
803
|
-
}
|
|
804
|
-
switch (this.char()) {
|
|
805
|
-
case 125: {
|
|
806
|
-
this.bump();
|
|
807
|
-
return {
|
|
808
|
-
val: {
|
|
809
|
-
type: TYPE.argument,
|
|
810
|
-
value,
|
|
811
|
-
location: createLocation(openingBracePosition, this.clonePosition())
|
|
812
|
-
},
|
|
813
|
-
err: null
|
|
814
|
-
};
|
|
815
|
-
}
|
|
816
|
-
case 44: {
|
|
2739
|
+
};
|
|
2740
|
+
Parser2.prototype.parseArgument = function(nestingLevel, expectingCloseTag) {
|
|
2741
|
+
var openingBracePosition = this.clonePosition();
|
|
817
2742
|
this.bump();
|
|
818
2743
|
this.bumpSpace();
|
|
819
2744
|
if (this.isEOF()) {
|
|
820
|
-
return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));
|
|
2745
|
+
return this.error(error_1.ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));
|
|
2746
|
+
}
|
|
2747
|
+
if (this.char() === 125) {
|
|
2748
|
+
this.bump();
|
|
2749
|
+
return this.error(error_1.ErrorKind.EMPTY_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));
|
|
2750
|
+
}
|
|
2751
|
+
var value = this.parseIdentifierIfPossible().value;
|
|
2752
|
+
if (!value) {
|
|
2753
|
+
return this.error(error_1.ErrorKind.MALFORMED_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));
|
|
821
2754
|
}
|
|
822
|
-
return this.parseArgumentOptions(nestingLevel, expectingCloseTag, value, openingBracePosition);
|
|
823
|
-
}
|
|
824
|
-
default:
|
|
825
|
-
return this.error(ErrorKind.MALFORMED_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));
|
|
826
|
-
}
|
|
827
|
-
};
|
|
828
|
-
Parser2.prototype.parseIdentifierIfPossible = function() {
|
|
829
|
-
var startingPosition = this.clonePosition();
|
|
830
|
-
var startOffset = this.offset();
|
|
831
|
-
var value = matchIdentifierAtIndex(this.message, startOffset);
|
|
832
|
-
var endOffset = startOffset + value.length;
|
|
833
|
-
this.bumpTo(endOffset);
|
|
834
|
-
var endPosition = this.clonePosition();
|
|
835
|
-
var location = createLocation(startingPosition, endPosition);
|
|
836
|
-
return { value, location };
|
|
837
|
-
};
|
|
838
|
-
Parser2.prototype.parseArgumentOptions = function(nestingLevel, expectingCloseTag, value, openingBracePosition) {
|
|
839
|
-
var _a2;
|
|
840
|
-
var typeStartPosition = this.clonePosition();
|
|
841
|
-
var argType = this.parseIdentifierIfPossible().value;
|
|
842
|
-
var typeEndPosition = this.clonePosition();
|
|
843
|
-
switch (argType) {
|
|
844
|
-
case "":
|
|
845
|
-
return this.error(ErrorKind.EXPECT_ARGUMENT_TYPE, createLocation(typeStartPosition, typeEndPosition));
|
|
846
|
-
case "number":
|
|
847
|
-
case "date":
|
|
848
|
-
case "time": {
|
|
849
2755
|
this.bumpSpace();
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
return result;
|
|
857
|
-
}
|
|
858
|
-
var style = trimEnd(result.val);
|
|
859
|
-
if (style.length === 0) {
|
|
860
|
-
return this.error(ErrorKind.EXPECT_ARGUMENT_STYLE, createLocation(this.clonePosition(), this.clonePosition()));
|
|
861
|
-
}
|
|
862
|
-
var styleLocation = createLocation(styleStartPosition, this.clonePosition());
|
|
863
|
-
styleAndLocation = { style, styleLocation };
|
|
864
|
-
}
|
|
865
|
-
var argCloseResult = this.tryParseArgumentClose(openingBracePosition);
|
|
866
|
-
if (argCloseResult.err) {
|
|
867
|
-
return argCloseResult;
|
|
868
|
-
}
|
|
869
|
-
var location_1 = createLocation(openingBracePosition, this.clonePosition());
|
|
870
|
-
if (styleAndLocation && startsWith(styleAndLocation === null || styleAndLocation === void 0 ? void 0 : styleAndLocation.style, "::", 0)) {
|
|
871
|
-
var skeleton = trimStart(styleAndLocation.style.slice(2));
|
|
872
|
-
if (argType === "number") {
|
|
873
|
-
var result = this.parseNumberSkeletonFromString(skeleton, styleAndLocation.styleLocation);
|
|
874
|
-
if (result.err) {
|
|
875
|
-
return result;
|
|
876
|
-
}
|
|
2756
|
+
if (this.isEOF()) {
|
|
2757
|
+
return this.error(error_1.ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));
|
|
2758
|
+
}
|
|
2759
|
+
switch (this.char()) {
|
|
2760
|
+
case 125: {
|
|
2761
|
+
this.bump();
|
|
877
2762
|
return {
|
|
878
|
-
val: {
|
|
2763
|
+
val: {
|
|
2764
|
+
type: types_1.TYPE.argument,
|
|
2765
|
+
value,
|
|
2766
|
+
location: createLocation(openingBracePosition, this.clonePosition())
|
|
2767
|
+
},
|
|
879
2768
|
err: null
|
|
880
2769
|
};
|
|
881
|
-
}
|
|
882
|
-
|
|
883
|
-
|
|
2770
|
+
}
|
|
2771
|
+
case 44: {
|
|
2772
|
+
this.bump();
|
|
2773
|
+
this.bumpSpace();
|
|
2774
|
+
if (this.isEOF()) {
|
|
2775
|
+
return this.error(error_1.ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));
|
|
2776
|
+
}
|
|
2777
|
+
return this.parseArgumentOptions(nestingLevel, expectingCloseTag, value, openingBracePosition);
|
|
2778
|
+
}
|
|
2779
|
+
default:
|
|
2780
|
+
return this.error(error_1.ErrorKind.MALFORMED_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));
|
|
2781
|
+
}
|
|
2782
|
+
};
|
|
2783
|
+
Parser2.prototype.parseIdentifierIfPossible = function() {
|
|
2784
|
+
var startingPosition = this.clonePosition();
|
|
2785
|
+
var startOffset = this.offset();
|
|
2786
|
+
var value = matchIdentifierAtIndex(this.message, startOffset);
|
|
2787
|
+
var endOffset = startOffset + value.length;
|
|
2788
|
+
this.bumpTo(endOffset);
|
|
2789
|
+
var endPosition = this.clonePosition();
|
|
2790
|
+
var location = createLocation(startingPosition, endPosition);
|
|
2791
|
+
return { value, location };
|
|
2792
|
+
};
|
|
2793
|
+
Parser2.prototype.parseArgumentOptions = function(nestingLevel, expectingCloseTag, value, openingBracePosition) {
|
|
2794
|
+
var _a2;
|
|
2795
|
+
var typeStartPosition = this.clonePosition();
|
|
2796
|
+
var argType = this.parseIdentifierIfPossible().value;
|
|
2797
|
+
var typeEndPosition = this.clonePosition();
|
|
2798
|
+
switch (argType) {
|
|
2799
|
+
case "":
|
|
2800
|
+
return this.error(error_1.ErrorKind.EXPECT_ARGUMENT_TYPE, createLocation(typeStartPosition, typeEndPosition));
|
|
2801
|
+
case "number":
|
|
2802
|
+
case "date":
|
|
2803
|
+
case "time": {
|
|
2804
|
+
this.bumpSpace();
|
|
2805
|
+
var styleAndLocation = null;
|
|
2806
|
+
if (this.bumpIf(",")) {
|
|
2807
|
+
this.bumpSpace();
|
|
2808
|
+
var styleStartPosition = this.clonePosition();
|
|
2809
|
+
var result = this.parseSimpleArgStyleIfPossible();
|
|
2810
|
+
if (result.err) {
|
|
2811
|
+
return result;
|
|
2812
|
+
}
|
|
2813
|
+
var style = trimEnd(result.val);
|
|
2814
|
+
if (style.length === 0) {
|
|
2815
|
+
return this.error(error_1.ErrorKind.EXPECT_ARGUMENT_STYLE, createLocation(this.clonePosition(), this.clonePosition()));
|
|
2816
|
+
}
|
|
2817
|
+
var styleLocation = createLocation(styleStartPosition, this.clonePosition());
|
|
2818
|
+
styleAndLocation = { style, styleLocation };
|
|
2819
|
+
}
|
|
2820
|
+
var argCloseResult = this.tryParseArgumentClose(openingBracePosition);
|
|
2821
|
+
if (argCloseResult.err) {
|
|
2822
|
+
return argCloseResult;
|
|
2823
|
+
}
|
|
2824
|
+
var location_1 = createLocation(openingBracePosition, this.clonePosition());
|
|
2825
|
+
if (styleAndLocation && startsWith(styleAndLocation === null || styleAndLocation === void 0 ? void 0 : styleAndLocation.style, "::", 0)) {
|
|
2826
|
+
var skeleton = trimStart(styleAndLocation.style.slice(2));
|
|
2827
|
+
if (argType === "number") {
|
|
2828
|
+
var result = this.parseNumberSkeletonFromString(skeleton, styleAndLocation.styleLocation);
|
|
2829
|
+
if (result.err) {
|
|
2830
|
+
return result;
|
|
2831
|
+
}
|
|
2832
|
+
return {
|
|
2833
|
+
val: { type: types_1.TYPE.number, value, location: location_1, style: result.val },
|
|
2834
|
+
err: null
|
|
2835
|
+
};
|
|
2836
|
+
} else {
|
|
2837
|
+
if (skeleton.length === 0) {
|
|
2838
|
+
return this.error(error_1.ErrorKind.EXPECT_DATE_TIME_SKELETON, location_1);
|
|
2839
|
+
}
|
|
2840
|
+
var dateTimePattern = skeleton;
|
|
2841
|
+
if (this.locale) {
|
|
2842
|
+
dateTimePattern = (0, date_time_pattern_generator_1.getBestPattern)(skeleton, this.locale);
|
|
2843
|
+
}
|
|
2844
|
+
var style = {
|
|
2845
|
+
type: types_1.SKELETON_TYPE.dateTime,
|
|
2846
|
+
pattern: dateTimePattern,
|
|
2847
|
+
location: styleAndLocation.styleLocation,
|
|
2848
|
+
parsedOptions: this.shouldParseSkeletons ? (0, icu_skeleton_parser_1.parseDateTimeSkeleton)(dateTimePattern) : {}
|
|
2849
|
+
};
|
|
2850
|
+
var type = argType === "date" ? types_1.TYPE.date : types_1.TYPE.time;
|
|
2851
|
+
return {
|
|
2852
|
+
val: { type, value, location: location_1, style },
|
|
2853
|
+
err: null
|
|
2854
|
+
};
|
|
2855
|
+
}
|
|
884
2856
|
}
|
|
885
|
-
var style = {
|
|
886
|
-
type: SKELETON_TYPE.dateTime,
|
|
887
|
-
pattern: skeleton,
|
|
888
|
-
location: styleAndLocation.styleLocation,
|
|
889
|
-
parsedOptions: this.shouldParseSkeletons ? parseDateTimeSkeleton(skeleton) : {}
|
|
890
|
-
};
|
|
891
|
-
var type = argType === "date" ? TYPE.date : TYPE.time;
|
|
892
2857
|
return {
|
|
893
|
-
val: {
|
|
2858
|
+
val: {
|
|
2859
|
+
type: argType === "number" ? types_1.TYPE.number : argType === "date" ? types_1.TYPE.date : types_1.TYPE.time,
|
|
2860
|
+
value,
|
|
2861
|
+
location: location_1,
|
|
2862
|
+
style: (_a2 = styleAndLocation === null || styleAndLocation === void 0 ? void 0 : styleAndLocation.style) !== null && _a2 !== void 0 ? _a2 : null
|
|
2863
|
+
},
|
|
894
2864
|
err: null
|
|
895
2865
|
};
|
|
896
2866
|
}
|
|
2867
|
+
case "plural":
|
|
2868
|
+
case "selectordinal":
|
|
2869
|
+
case "select": {
|
|
2870
|
+
var typeEndPosition_1 = this.clonePosition();
|
|
2871
|
+
this.bumpSpace();
|
|
2872
|
+
if (!this.bumpIf(",")) {
|
|
2873
|
+
return this.error(error_1.ErrorKind.EXPECT_SELECT_ARGUMENT_OPTIONS, createLocation(typeEndPosition_1, (0, tslib_1.__assign)({}, typeEndPosition_1)));
|
|
2874
|
+
}
|
|
2875
|
+
this.bumpSpace();
|
|
2876
|
+
var identifierAndLocation = this.parseIdentifierIfPossible();
|
|
2877
|
+
var pluralOffset = 0;
|
|
2878
|
+
if (argType !== "select" && identifierAndLocation.value === "offset") {
|
|
2879
|
+
if (!this.bumpIf(":")) {
|
|
2880
|
+
return this.error(error_1.ErrorKind.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, createLocation(this.clonePosition(), this.clonePosition()));
|
|
2881
|
+
}
|
|
2882
|
+
this.bumpSpace();
|
|
2883
|
+
var result = this.tryParseDecimalInteger(error_1.ErrorKind.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, error_1.ErrorKind.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);
|
|
2884
|
+
if (result.err) {
|
|
2885
|
+
return result;
|
|
2886
|
+
}
|
|
2887
|
+
this.bumpSpace();
|
|
2888
|
+
identifierAndLocation = this.parseIdentifierIfPossible();
|
|
2889
|
+
pluralOffset = result.val;
|
|
2890
|
+
}
|
|
2891
|
+
var optionsResult = this.tryParsePluralOrSelectOptions(nestingLevel, argType, expectingCloseTag, identifierAndLocation);
|
|
2892
|
+
if (optionsResult.err) {
|
|
2893
|
+
return optionsResult;
|
|
2894
|
+
}
|
|
2895
|
+
var argCloseResult = this.tryParseArgumentClose(openingBracePosition);
|
|
2896
|
+
if (argCloseResult.err) {
|
|
2897
|
+
return argCloseResult;
|
|
2898
|
+
}
|
|
2899
|
+
var location_2 = createLocation(openingBracePosition, this.clonePosition());
|
|
2900
|
+
if (argType === "select") {
|
|
2901
|
+
return {
|
|
2902
|
+
val: {
|
|
2903
|
+
type: types_1.TYPE.select,
|
|
2904
|
+
value,
|
|
2905
|
+
options: fromEntries(optionsResult.val),
|
|
2906
|
+
location: location_2
|
|
2907
|
+
},
|
|
2908
|
+
err: null
|
|
2909
|
+
};
|
|
2910
|
+
} else {
|
|
2911
|
+
return {
|
|
2912
|
+
val: {
|
|
2913
|
+
type: types_1.TYPE.plural,
|
|
2914
|
+
value,
|
|
2915
|
+
options: fromEntries(optionsResult.val),
|
|
2916
|
+
offset: pluralOffset,
|
|
2917
|
+
pluralType: argType === "plural" ? "cardinal" : "ordinal",
|
|
2918
|
+
location: location_2
|
|
2919
|
+
},
|
|
2920
|
+
err: null
|
|
2921
|
+
};
|
|
2922
|
+
}
|
|
2923
|
+
}
|
|
2924
|
+
default:
|
|
2925
|
+
return this.error(error_1.ErrorKind.INVALID_ARGUMENT_TYPE, createLocation(typeStartPosition, typeEndPosition));
|
|
2926
|
+
}
|
|
2927
|
+
};
|
|
2928
|
+
Parser2.prototype.tryParseArgumentClose = function(openingBracePosition) {
|
|
2929
|
+
if (this.isEOF() || this.char() !== 125) {
|
|
2930
|
+
return this.error(error_1.ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));
|
|
2931
|
+
}
|
|
2932
|
+
this.bump();
|
|
2933
|
+
return { val: true, err: null };
|
|
2934
|
+
};
|
|
2935
|
+
Parser2.prototype.parseSimpleArgStyleIfPossible = function() {
|
|
2936
|
+
var nestedBraces = 0;
|
|
2937
|
+
var startPosition = this.clonePosition();
|
|
2938
|
+
while (!this.isEOF()) {
|
|
2939
|
+
var ch = this.char();
|
|
2940
|
+
switch (ch) {
|
|
2941
|
+
case 39: {
|
|
2942
|
+
this.bump();
|
|
2943
|
+
var apostrophePosition = this.clonePosition();
|
|
2944
|
+
if (!this.bumpUntil("'")) {
|
|
2945
|
+
return this.error(error_1.ErrorKind.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE, createLocation(apostrophePosition, this.clonePosition()));
|
|
2946
|
+
}
|
|
2947
|
+
this.bump();
|
|
2948
|
+
break;
|
|
2949
|
+
}
|
|
2950
|
+
case 123: {
|
|
2951
|
+
nestedBraces += 1;
|
|
2952
|
+
this.bump();
|
|
2953
|
+
break;
|
|
2954
|
+
}
|
|
2955
|
+
case 125: {
|
|
2956
|
+
if (nestedBraces > 0) {
|
|
2957
|
+
nestedBraces -= 1;
|
|
2958
|
+
} else {
|
|
2959
|
+
return {
|
|
2960
|
+
val: this.message.slice(startPosition.offset, this.offset()),
|
|
2961
|
+
err: null
|
|
2962
|
+
};
|
|
2963
|
+
}
|
|
2964
|
+
break;
|
|
2965
|
+
}
|
|
2966
|
+
default:
|
|
2967
|
+
this.bump();
|
|
2968
|
+
break;
|
|
2969
|
+
}
|
|
2970
|
+
}
|
|
2971
|
+
return {
|
|
2972
|
+
val: this.message.slice(startPosition.offset, this.offset()),
|
|
2973
|
+
err: null
|
|
2974
|
+
};
|
|
2975
|
+
};
|
|
2976
|
+
Parser2.prototype.parseNumberSkeletonFromString = function(skeleton, location) {
|
|
2977
|
+
var tokens = [];
|
|
2978
|
+
try {
|
|
2979
|
+
tokens = (0, icu_skeleton_parser_1.parseNumberSkeletonFromString)(skeleton);
|
|
2980
|
+
} catch (e) {
|
|
2981
|
+
return this.error(error_1.ErrorKind.INVALID_NUMBER_SKELETON, location);
|
|
897
2982
|
}
|
|
898
2983
|
return {
|
|
899
2984
|
val: {
|
|
900
|
-
type:
|
|
901
|
-
|
|
902
|
-
location
|
|
903
|
-
|
|
2985
|
+
type: types_1.SKELETON_TYPE.number,
|
|
2986
|
+
tokens,
|
|
2987
|
+
location,
|
|
2988
|
+
parsedOptions: this.shouldParseSkeletons ? (0, icu_skeleton_parser_1.parseNumberSkeleton)(tokens) : {}
|
|
904
2989
|
},
|
|
905
2990
|
err: null
|
|
906
2991
|
};
|
|
907
|
-
}
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
var
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
2992
|
+
};
|
|
2993
|
+
Parser2.prototype.tryParsePluralOrSelectOptions = function(nestingLevel, parentArgType, expectCloseTag, parsedFirstIdentifier) {
|
|
2994
|
+
var _a2;
|
|
2995
|
+
var hasOtherClause = false;
|
|
2996
|
+
var options = [];
|
|
2997
|
+
var parsedSelectors = /* @__PURE__ */ new Set();
|
|
2998
|
+
var selector = parsedFirstIdentifier.value, selectorLocation = parsedFirstIdentifier.location;
|
|
2999
|
+
while (true) {
|
|
3000
|
+
if (selector.length === 0) {
|
|
3001
|
+
var startPosition = this.clonePosition();
|
|
3002
|
+
if (parentArgType !== "select" && this.bumpIf("=")) {
|
|
3003
|
+
var result = this.tryParseDecimalInteger(error_1.ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR, error_1.ErrorKind.INVALID_PLURAL_ARGUMENT_SELECTOR);
|
|
3004
|
+
if (result.err) {
|
|
3005
|
+
return result;
|
|
3006
|
+
}
|
|
3007
|
+
selectorLocation = createLocation(startPosition, this.clonePosition());
|
|
3008
|
+
selector = this.message.slice(startPosition.offset, this.offset());
|
|
3009
|
+
} else {
|
|
3010
|
+
break;
|
|
3011
|
+
}
|
|
3012
|
+
}
|
|
3013
|
+
if (parsedSelectors.has(selector)) {
|
|
3014
|
+
return this.error(parentArgType === "select" ? error_1.ErrorKind.DUPLICATE_SELECT_ARGUMENT_SELECTOR : error_1.ErrorKind.DUPLICATE_PLURAL_ARGUMENT_SELECTOR, selectorLocation);
|
|
3015
|
+
}
|
|
3016
|
+
if (selector === "other") {
|
|
3017
|
+
hasOtherClause = true;
|
|
922
3018
|
}
|
|
923
3019
|
this.bumpSpace();
|
|
924
|
-
var
|
|
925
|
-
if (
|
|
926
|
-
return
|
|
3020
|
+
var openingBracePosition = this.clonePosition();
|
|
3021
|
+
if (!this.bumpIf("{")) {
|
|
3022
|
+
return this.error(parentArgType === "select" ? error_1.ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT : error_1.ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT, createLocation(this.clonePosition(), this.clonePosition()));
|
|
3023
|
+
}
|
|
3024
|
+
var fragmentResult = this.parseMessage(nestingLevel + 1, parentArgType, expectCloseTag);
|
|
3025
|
+
if (fragmentResult.err) {
|
|
3026
|
+
return fragmentResult;
|
|
927
3027
|
}
|
|
3028
|
+
var argCloseResult = this.tryParseArgumentClose(openingBracePosition);
|
|
3029
|
+
if (argCloseResult.err) {
|
|
3030
|
+
return argCloseResult;
|
|
3031
|
+
}
|
|
3032
|
+
options.push([
|
|
3033
|
+
selector,
|
|
3034
|
+
{
|
|
3035
|
+
value: fragmentResult.val,
|
|
3036
|
+
location: createLocation(openingBracePosition, this.clonePosition())
|
|
3037
|
+
}
|
|
3038
|
+
]);
|
|
3039
|
+
parsedSelectors.add(selector);
|
|
928
3040
|
this.bumpSpace();
|
|
929
|
-
|
|
930
|
-
pluralOffset = result.val;
|
|
3041
|
+
_a2 = this.parseIdentifierIfPossible(), selector = _a2.value, selectorLocation = _a2.location;
|
|
931
3042
|
}
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
return optionsResult;
|
|
3043
|
+
if (options.length === 0) {
|
|
3044
|
+
return this.error(parentArgType === "select" ? error_1.ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR : error_1.ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR, createLocation(this.clonePosition(), this.clonePosition()));
|
|
935
3045
|
}
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
return argCloseResult;
|
|
3046
|
+
if (this.requiresOtherClause && !hasOtherClause) {
|
|
3047
|
+
return this.error(error_1.ErrorKind.MISSING_OTHER_CLAUSE, createLocation(this.clonePosition(), this.clonePosition()));
|
|
939
3048
|
}
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
},
|
|
949
|
-
err: null
|
|
950
|
-
};
|
|
951
|
-
} else {
|
|
952
|
-
return {
|
|
953
|
-
val: {
|
|
954
|
-
type: TYPE.plural,
|
|
955
|
-
value,
|
|
956
|
-
options: fromEntries(optionsResult.val),
|
|
957
|
-
offset: pluralOffset,
|
|
958
|
-
pluralType: argType === "plural" ? "cardinal" : "ordinal",
|
|
959
|
-
location: location_2
|
|
960
|
-
},
|
|
961
|
-
err: null
|
|
962
|
-
};
|
|
3049
|
+
return { val: options, err: null };
|
|
3050
|
+
};
|
|
3051
|
+
Parser2.prototype.tryParseDecimalInteger = function(expectNumberError, invalidNumberError) {
|
|
3052
|
+
var sign = 1;
|
|
3053
|
+
var startingPosition = this.clonePosition();
|
|
3054
|
+
if (this.bumpIf("+")) {
|
|
3055
|
+
} else if (this.bumpIf("-")) {
|
|
3056
|
+
sign = -1;
|
|
963
3057
|
}
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
return { val: true, err: null };
|
|
975
|
-
};
|
|
976
|
-
Parser2.prototype.parseSimpleArgStyleIfPossible = function() {
|
|
977
|
-
var nestedBraces = 0;
|
|
978
|
-
var startPosition = this.clonePosition();
|
|
979
|
-
while (!this.isEOF()) {
|
|
980
|
-
var ch = this.char();
|
|
981
|
-
switch (ch) {
|
|
982
|
-
case 39: {
|
|
983
|
-
this.bump();
|
|
984
|
-
var apostrophePosition = this.clonePosition();
|
|
985
|
-
if (!this.bumpUntil("'")) {
|
|
986
|
-
return this.error(ErrorKind.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE, createLocation(apostrophePosition, this.clonePosition()));
|
|
3058
|
+
var hasDigits = false;
|
|
3059
|
+
var decimal = 0;
|
|
3060
|
+
while (!this.isEOF()) {
|
|
3061
|
+
var ch = this.char();
|
|
3062
|
+
if (ch >= 48 && ch <= 57) {
|
|
3063
|
+
hasDigits = true;
|
|
3064
|
+
decimal = decimal * 10 + (ch - 48);
|
|
3065
|
+
this.bump();
|
|
3066
|
+
} else {
|
|
3067
|
+
break;
|
|
987
3068
|
}
|
|
988
|
-
this.bump();
|
|
989
|
-
break;
|
|
990
3069
|
}
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
this.
|
|
994
|
-
break;
|
|
3070
|
+
var location = createLocation(startingPosition, this.clonePosition());
|
|
3071
|
+
if (!hasDigits) {
|
|
3072
|
+
return this.error(expectNumberError, location);
|
|
995
3073
|
}
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
3074
|
+
decimal *= sign;
|
|
3075
|
+
if (!isSafeInteger(decimal)) {
|
|
3076
|
+
return this.error(invalidNumberError, location);
|
|
3077
|
+
}
|
|
3078
|
+
return { val: decimal, err: null };
|
|
3079
|
+
};
|
|
3080
|
+
Parser2.prototype.offset = function() {
|
|
3081
|
+
return this.position.offset;
|
|
3082
|
+
};
|
|
3083
|
+
Parser2.prototype.isEOF = function() {
|
|
3084
|
+
return this.offset() === this.message.length;
|
|
3085
|
+
};
|
|
3086
|
+
Parser2.prototype.clonePosition = function() {
|
|
3087
|
+
return {
|
|
3088
|
+
offset: this.position.offset,
|
|
3089
|
+
line: this.position.line,
|
|
3090
|
+
column: this.position.column
|
|
3091
|
+
};
|
|
3092
|
+
};
|
|
3093
|
+
Parser2.prototype.char = function() {
|
|
3094
|
+
var offset = this.position.offset;
|
|
3095
|
+
if (offset >= this.message.length) {
|
|
3096
|
+
throw Error("out of bound");
|
|
3097
|
+
}
|
|
3098
|
+
var code = codePointAt(this.message, offset);
|
|
3099
|
+
if (code === void 0) {
|
|
3100
|
+
throw Error("Offset ".concat(offset, " is at invalid UTF-16 code unit boundary"));
|
|
3101
|
+
}
|
|
3102
|
+
return code;
|
|
3103
|
+
};
|
|
3104
|
+
Parser2.prototype.error = function(kind, location) {
|
|
3105
|
+
return {
|
|
3106
|
+
val: null,
|
|
3107
|
+
err: {
|
|
3108
|
+
kind,
|
|
3109
|
+
message: this.message,
|
|
3110
|
+
location
|
|
1004
3111
|
}
|
|
1005
|
-
|
|
3112
|
+
};
|
|
3113
|
+
};
|
|
3114
|
+
Parser2.prototype.bump = function() {
|
|
3115
|
+
if (this.isEOF()) {
|
|
3116
|
+
return;
|
|
1006
3117
|
}
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
} catch (e) {
|
|
1022
|
-
return this.error(ErrorKind.INVALID_NUMBER_SKELETON, location);
|
|
1023
|
-
}
|
|
1024
|
-
return {
|
|
1025
|
-
val: {
|
|
1026
|
-
type: SKELETON_TYPE.number,
|
|
1027
|
-
tokens,
|
|
1028
|
-
location,
|
|
1029
|
-
parsedOptions: this.shouldParseSkeletons ? parseNumberSkeleton(tokens) : {}
|
|
1030
|
-
},
|
|
1031
|
-
err: null
|
|
1032
|
-
};
|
|
1033
|
-
};
|
|
1034
|
-
Parser2.prototype.tryParsePluralOrSelectOptions = function(nestingLevel, parentArgType, expectCloseTag, parsedFirstIdentifier) {
|
|
1035
|
-
var _a2;
|
|
1036
|
-
var hasOtherClause = false;
|
|
1037
|
-
var options = [];
|
|
1038
|
-
var parsedSelectors = /* @__PURE__ */ new Set();
|
|
1039
|
-
var selector = parsedFirstIdentifier.value, selectorLocation = parsedFirstIdentifier.location;
|
|
1040
|
-
while (true) {
|
|
1041
|
-
if (selector.length === 0) {
|
|
1042
|
-
var startPosition = this.clonePosition();
|
|
1043
|
-
if (parentArgType !== "select" && this.bumpIf("=")) {
|
|
1044
|
-
var result = this.tryParseDecimalInteger(ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR, ErrorKind.INVALID_PLURAL_ARGUMENT_SELECTOR);
|
|
1045
|
-
if (result.err) {
|
|
1046
|
-
return result;
|
|
3118
|
+
var code = this.char();
|
|
3119
|
+
if (code === 10) {
|
|
3120
|
+
this.position.line += 1;
|
|
3121
|
+
this.position.column = 1;
|
|
3122
|
+
this.position.offset += 1;
|
|
3123
|
+
} else {
|
|
3124
|
+
this.position.column += 1;
|
|
3125
|
+
this.position.offset += code < 65536 ? 1 : 2;
|
|
3126
|
+
}
|
|
3127
|
+
};
|
|
3128
|
+
Parser2.prototype.bumpIf = function(prefix) {
|
|
3129
|
+
if (startsWith(this.message, prefix, this.offset())) {
|
|
3130
|
+
for (var i = 0; i < prefix.length; i++) {
|
|
3131
|
+
this.bump();
|
|
1047
3132
|
}
|
|
1048
|
-
|
|
1049
|
-
|
|
3133
|
+
return true;
|
|
3134
|
+
}
|
|
3135
|
+
return false;
|
|
3136
|
+
};
|
|
3137
|
+
Parser2.prototype.bumpUntil = function(pattern) {
|
|
3138
|
+
var currentOffset = this.offset();
|
|
3139
|
+
var index = this.message.indexOf(pattern, currentOffset);
|
|
3140
|
+
if (index >= 0) {
|
|
3141
|
+
this.bumpTo(index);
|
|
3142
|
+
return true;
|
|
1050
3143
|
} else {
|
|
1051
|
-
|
|
3144
|
+
this.bumpTo(this.message.length);
|
|
3145
|
+
return false;
|
|
1052
3146
|
}
|
|
1053
|
-
}
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
}
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
3147
|
+
};
|
|
3148
|
+
Parser2.prototype.bumpTo = function(targetOffset) {
|
|
3149
|
+
if (this.offset() > targetOffset) {
|
|
3150
|
+
throw Error("targetOffset ".concat(targetOffset, " must be greater than or equal to the current offset ").concat(this.offset()));
|
|
3151
|
+
}
|
|
3152
|
+
targetOffset = Math.min(targetOffset, this.message.length);
|
|
3153
|
+
while (true) {
|
|
3154
|
+
var offset = this.offset();
|
|
3155
|
+
if (offset === targetOffset) {
|
|
3156
|
+
break;
|
|
3157
|
+
}
|
|
3158
|
+
if (offset > targetOffset) {
|
|
3159
|
+
throw Error("targetOffset ".concat(targetOffset, " is at invalid UTF-16 code unit boundary"));
|
|
3160
|
+
}
|
|
3161
|
+
this.bump();
|
|
3162
|
+
if (this.isEOF()) {
|
|
3163
|
+
break;
|
|
3164
|
+
}
|
|
3165
|
+
}
|
|
3166
|
+
};
|
|
3167
|
+
Parser2.prototype.bumpSpace = function() {
|
|
3168
|
+
while (!this.isEOF() && _isWhiteSpace(this.char())) {
|
|
3169
|
+
this.bump();
|
|
3170
|
+
}
|
|
3171
|
+
};
|
|
3172
|
+
Parser2.prototype.peek = function() {
|
|
3173
|
+
if (this.isEOF()) {
|
|
3174
|
+
return null;
|
|
3175
|
+
}
|
|
3176
|
+
var code = this.char();
|
|
3177
|
+
var offset = this.offset();
|
|
3178
|
+
var nextCode = this.message.charCodeAt(offset + (code >= 65536 ? 2 : 1));
|
|
3179
|
+
return nextCode !== null && nextCode !== void 0 ? nextCode : null;
|
|
3180
|
+
};
|
|
3181
|
+
return Parser2;
|
|
3182
|
+
}();
|
|
3183
|
+
exports.Parser = Parser;
|
|
3184
|
+
function _isAlpha(codepoint) {
|
|
3185
|
+
return codepoint >= 97 && codepoint <= 122 || codepoint >= 65 && codepoint <= 90;
|
|
1083
3186
|
}
|
|
1084
|
-
|
|
1085
|
-
return
|
|
3187
|
+
function _isAlphaOrSlash(codepoint) {
|
|
3188
|
+
return _isAlpha(codepoint) || codepoint === 47;
|
|
1086
3189
|
}
|
|
1087
|
-
|
|
1088
|
-
return
|
|
3190
|
+
function _isPotentialElementNameChar(c) {
|
|
3191
|
+
return c === 45 || c === 46 || c >= 48 && c <= 57 || c === 95 || c >= 97 && c <= 122 || c >= 65 && c <= 90 || c == 183 || c >= 192 && c <= 214 || c >= 216 && c <= 246 || c >= 248 && c <= 893 || c >= 895 && c <= 8191 || c >= 8204 && c <= 8205 || c >= 8255 && c <= 8256 || c >= 8304 && c <= 8591 || c >= 11264 && c <= 12271 || c >= 12289 && c <= 55295 || c >= 63744 && c <= 64975 || c >= 65008 && c <= 65533 || c >= 65536 && c <= 983039;
|
|
1089
3192
|
}
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
Parser2.prototype.tryParseDecimalInteger = function(expectNumberError, invalidNumberError) {
|
|
1093
|
-
var sign = 1;
|
|
1094
|
-
var startingPosition = this.clonePosition();
|
|
1095
|
-
if (this.bumpIf("+")) {
|
|
1096
|
-
} else if (this.bumpIf("-")) {
|
|
1097
|
-
sign = -1;
|
|
3193
|
+
function _isWhiteSpace(c) {
|
|
3194
|
+
return c >= 9 && c <= 13 || c === 32 || c === 133 || c >= 8206 && c <= 8207 || c === 8232 || c === 8233;
|
|
1098
3195
|
}
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
while (!this.isEOF()) {
|
|
1102
|
-
var ch = this.char();
|
|
1103
|
-
if (ch >= 48 && ch <= 57) {
|
|
1104
|
-
hasDigits = true;
|
|
1105
|
-
decimal = decimal * 10 + (ch - 48);
|
|
1106
|
-
this.bump();
|
|
1107
|
-
} else {
|
|
1108
|
-
break;
|
|
1109
|
-
}
|
|
3196
|
+
function _isPatternSyntax(c) {
|
|
3197
|
+
return c >= 33 && c <= 35 || c === 36 || c >= 37 && c <= 39 || c === 40 || c === 41 || c === 42 || c === 43 || c === 44 || c === 45 || c >= 46 && c <= 47 || c >= 58 && c <= 59 || c >= 60 && c <= 62 || c >= 63 && c <= 64 || c === 91 || c === 92 || c === 93 || c === 94 || c === 96 || c === 123 || c === 124 || c === 125 || c === 126 || c === 161 || c >= 162 && c <= 165 || c === 166 || c === 167 || c === 169 || c === 171 || c === 172 || c === 174 || c === 176 || c === 177 || c === 182 || c === 187 || c === 191 || c === 215 || c === 247 || c >= 8208 && c <= 8213 || c >= 8214 && c <= 8215 || c === 8216 || c === 8217 || c === 8218 || c >= 8219 && c <= 8220 || c === 8221 || c === 8222 || c === 8223 || c >= 8224 && c <= 8231 || c >= 8240 && c <= 8248 || c === 8249 || c === 8250 || c >= 8251 && c <= 8254 || c >= 8257 && c <= 8259 || c === 8260 || c === 8261 || c === 8262 || c >= 8263 && c <= 8273 || c === 8274 || c === 8275 || c >= 8277 && c <= 8286 || c >= 8592 && c <= 8596 || c >= 8597 && c <= 8601 || c >= 8602 && c <= 8603 || c >= 8604 && c <= 8607 || c === 8608 || c >= 8609 && c <= 8610 || c === 8611 || c >= 8612 && c <= 8613 || c === 8614 || c >= 8615 && c <= 8621 || c === 8622 || c >= 8623 && c <= 8653 || c >= 8654 && c <= 8655 || c >= 8656 && c <= 8657 || c === 8658 || c === 8659 || c === 8660 || c >= 8661 && c <= 8691 || c >= 8692 && c <= 8959 || c >= 8960 && c <= 8967 || c === 8968 || c === 8969 || c === 8970 || c === 8971 || c >= 8972 && c <= 8991 || c >= 8992 && c <= 8993 || c >= 8994 && c <= 9e3 || c === 9001 || c === 9002 || c >= 9003 && c <= 9083 || c === 9084 || c >= 9085 && c <= 9114 || c >= 9115 && c <= 9139 || c >= 9140 && c <= 9179 || c >= 9180 && c <= 9185 || c >= 9186 && c <= 9254 || c >= 9255 && c <= 9279 || c >= 9280 && c <= 9290 || c >= 9291 && c <= 9311 || c >= 9472 && c <= 9654 || c === 9655 || c >= 9656 && c <= 9664 || c === 9665 || c >= 9666 && c <= 9719 || c >= 9720 && c <= 9727 || c >= 9728 && c <= 9838 || c === 9839 || c >= 9840 && c <= 10087 || c === 10088 || c === 10089 || c === 10090 || c === 10091 || c === 10092 || c === 10093 || c === 10094 || c === 10095 || c === 10096 || c === 10097 || c === 10098 || c === 10099 || c === 10100 || c === 10101 || c >= 10132 && c <= 10175 || c >= 10176 && c <= 10180 || c === 10181 || c === 10182 || c >= 10183 && c <= 10213 || c === 10214 || c === 10215 || c === 10216 || c === 10217 || c === 10218 || c === 10219 || c === 10220 || c === 10221 || c === 10222 || c === 10223 || c >= 10224 && c <= 10239 || c >= 10240 && c <= 10495 || c >= 10496 && c <= 10626 || c === 10627 || c === 10628 || c === 10629 || c === 10630 || c === 10631 || c === 10632 || c === 10633 || c === 10634 || c === 10635 || c === 10636 || c === 10637 || c === 10638 || c === 10639 || c === 10640 || c === 10641 || c === 10642 || c === 10643 || c === 10644 || c === 10645 || c === 10646 || c === 10647 || c === 10648 || c >= 10649 && c <= 10711 || c === 10712 || c === 10713 || c === 10714 || c === 10715 || c >= 10716 && c <= 10747 || c === 10748 || c === 10749 || c >= 10750 && c <= 11007 || c >= 11008 && c <= 11055 || c >= 11056 && c <= 11076 || c >= 11077 && c <= 11078 || c >= 11079 && c <= 11084 || c >= 11085 && c <= 11123 || c >= 11124 && c <= 11125 || c >= 11126 && c <= 11157 || c === 11158 || c >= 11159 && c <= 11263 || c >= 11776 && c <= 11777 || c === 11778 || c === 11779 || c === 11780 || c === 11781 || c >= 11782 && c <= 11784 || c === 11785 || c === 11786 || c === 11787 || c === 11788 || c === 11789 || c >= 11790 && c <= 11798 || c === 11799 || c >= 11800 && c <= 11801 || c === 11802 || c === 11803 || c === 11804 || c === 11805 || c >= 11806 && c <= 11807 || c === 11808 || c === 11809 || c === 11810 || c === 11811 || c === 11812 || c === 11813 || c === 11814 || c === 11815 || c === 11816 || c === 11817 || c >= 11818 && c <= 11822 || c === 11823 || c >= 11824 && c <= 11833 || c >= 11834 && c <= 11835 || c >= 11836 && c <= 11839 || c === 11840 || c === 11841 || c === 11842 || c >= 11843 && c <= 11855 || c >= 11856 && c <= 11857 || c === 11858 || c >= 11859 && c <= 11903 || c >= 12289 && c <= 12291 || c === 12296 || c === 12297 || c === 12298 || c === 12299 || c === 12300 || c === 12301 || c === 12302 || c === 12303 || c === 12304 || c === 12305 || c >= 12306 && c <= 12307 || c === 12308 || c === 12309 || c === 12310 || c === 12311 || c === 12312 || c === 12313 || c === 12314 || c === 12315 || c === 12316 || c === 12317 || c >= 12318 && c <= 12319 || c === 12320 || c === 12336 || c === 64830 || c === 64831 || c >= 65093 && c <= 65094;
|
|
1110
3198
|
}
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
3199
|
+
}
|
|
3200
|
+
});
|
|
3201
|
+
|
|
3202
|
+
// bazel-out/darwin-fastbuild/bin/packages/icu-messageformat-parser/index.js
|
|
3203
|
+
var require_icu_messageformat_parser = __commonJS({
|
|
3204
|
+
"bazel-out/darwin-fastbuild/bin/packages/icu-messageformat-parser/index.js"(exports) {
|
|
3205
|
+
"use strict";
|
|
3206
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3207
|
+
exports.parse = void 0;
|
|
3208
|
+
var tslib_1 = require_tslib();
|
|
3209
|
+
var error_1 = require_error();
|
|
3210
|
+
var parser_1 = require_parser();
|
|
3211
|
+
var types_1 = require_types();
|
|
3212
|
+
function pruneLocation(els) {
|
|
3213
|
+
els.forEach(function(el) {
|
|
3214
|
+
delete el.location;
|
|
3215
|
+
if ((0, types_1.isSelectElement)(el) || (0, types_1.isPluralElement)(el)) {
|
|
3216
|
+
for (var k in el.options) {
|
|
3217
|
+
delete el.options[k].location;
|
|
3218
|
+
pruneLocation(el.options[k].value);
|
|
3219
|
+
}
|
|
3220
|
+
} else if ((0, types_1.isNumberElement)(el) && (0, types_1.isNumberSkeleton)(el.style)) {
|
|
3221
|
+
delete el.style.location;
|
|
3222
|
+
} else if (((0, types_1.isDateElement)(el) || (0, types_1.isTimeElement)(el)) && (0, types_1.isDateTimeSkeleton)(el.style)) {
|
|
3223
|
+
delete el.style.location;
|
|
3224
|
+
} else if ((0, types_1.isTagElement)(el)) {
|
|
3225
|
+
pruneLocation(el.children);
|
|
3226
|
+
}
|
|
3227
|
+
});
|
|
1114
3228
|
}
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
3229
|
+
function parse2(message, opts) {
|
|
3230
|
+
if (opts === void 0) {
|
|
3231
|
+
opts = {};
|
|
3232
|
+
}
|
|
3233
|
+
opts = (0, tslib_1.__assign)({ shouldParseSkeletons: true, requiresOtherClause: true }, opts);
|
|
3234
|
+
var result = new parser_1.Parser(message, opts).parse();
|
|
3235
|
+
if (result.err) {
|
|
3236
|
+
var error = SyntaxError(error_1.ErrorKind[result.err.kind]);
|
|
3237
|
+
error.location = result.err.location;
|
|
3238
|
+
error.originalMessage = result.err.message;
|
|
3239
|
+
throw error;
|
|
3240
|
+
}
|
|
3241
|
+
if (!(opts === null || opts === void 0 ? void 0 : opts.captureLocation)) {
|
|
3242
|
+
pruneLocation(result.val);
|
|
3243
|
+
}
|
|
3244
|
+
return result.val;
|
|
1118
3245
|
}
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
3246
|
+
exports.parse = parse2;
|
|
3247
|
+
(0, tslib_1.__exportStar)(require_types(), exports);
|
|
3248
|
+
}
|
|
3249
|
+
});
|
|
3250
|
+
|
|
3251
|
+
// bazel-out/darwin-fastbuild/bin/packages/fast-memoize/index.js
|
|
3252
|
+
var require_fast_memoize = __commonJS({
|
|
3253
|
+
"bazel-out/darwin-fastbuild/bin/packages/fast-memoize/index.js"(exports) {
|
|
3254
|
+
"use strict";
|
|
3255
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3256
|
+
exports.strategies = void 0;
|
|
3257
|
+
function memoize2(fn, options) {
|
|
3258
|
+
var cache = options && options.cache ? options.cache : cacheDefault;
|
|
3259
|
+
var serializer = options && options.serializer ? options.serializer : serializerDefault;
|
|
3260
|
+
var strategy = options && options.strategy ? options.strategy : strategyDefault;
|
|
3261
|
+
return strategy(fn, {
|
|
3262
|
+
cache,
|
|
3263
|
+
serializer
|
|
3264
|
+
});
|
|
1138
3265
|
}
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
3266
|
+
exports.default = memoize2;
|
|
3267
|
+
function isPrimitive(value) {
|
|
3268
|
+
return value == null || typeof value === "number" || typeof value === "boolean";
|
|
1142
3269
|
}
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
kind,
|
|
1150
|
-
message: this.message,
|
|
1151
|
-
location
|
|
3270
|
+
function monadic(fn, cache, serializer, arg) {
|
|
3271
|
+
var cacheKey = isPrimitive(arg) ? arg : serializer(arg);
|
|
3272
|
+
var computedValue = cache.get(cacheKey);
|
|
3273
|
+
if (typeof computedValue === "undefined") {
|
|
3274
|
+
computedValue = fn.call(this, arg);
|
|
3275
|
+
cache.set(cacheKey, computedValue);
|
|
1152
3276
|
}
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
this.position.column = 1;
|
|
1163
|
-
this.position.offset += 1;
|
|
1164
|
-
} else {
|
|
1165
|
-
this.position.column += 1;
|
|
1166
|
-
this.position.offset += code < 65536 ? 1 : 2;
|
|
1167
|
-
}
|
|
1168
|
-
};
|
|
1169
|
-
Parser2.prototype.bumpIf = function(prefix) {
|
|
1170
|
-
if (startsWith(this.message, prefix, this.offset())) {
|
|
1171
|
-
for (var i = 0; i < prefix.length; i++) {
|
|
1172
|
-
this.bump();
|
|
3277
|
+
return computedValue;
|
|
3278
|
+
}
|
|
3279
|
+
function variadic(fn, cache, serializer) {
|
|
3280
|
+
var args = Array.prototype.slice.call(arguments, 3);
|
|
3281
|
+
var cacheKey = serializer(args);
|
|
3282
|
+
var computedValue = cache.get(cacheKey);
|
|
3283
|
+
if (typeof computedValue === "undefined") {
|
|
3284
|
+
computedValue = fn.apply(this, args);
|
|
3285
|
+
cache.set(cacheKey, computedValue);
|
|
1173
3286
|
}
|
|
1174
|
-
return
|
|
3287
|
+
return computedValue;
|
|
1175
3288
|
}
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
Parser2.prototype.bumpUntil = function(pattern) {
|
|
1179
|
-
var currentOffset = this.offset();
|
|
1180
|
-
var index = this.message.indexOf(pattern, currentOffset);
|
|
1181
|
-
if (index >= 0) {
|
|
1182
|
-
this.bumpTo(index);
|
|
1183
|
-
return true;
|
|
1184
|
-
} else {
|
|
1185
|
-
this.bumpTo(this.message.length);
|
|
1186
|
-
return false;
|
|
3289
|
+
function assemble(fn, context, strategy, cache, serialize) {
|
|
3290
|
+
return strategy.bind(context, fn, cache, serialize);
|
|
1187
3291
|
}
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
throw Error("targetOffset ".concat(targetOffset, " must be greater than or equal to the current offset ").concat(this.offset()));
|
|
3292
|
+
function strategyDefault(fn, options) {
|
|
3293
|
+
var strategy = fn.length === 1 ? monadic : variadic;
|
|
3294
|
+
return assemble(fn, this, strategy, options.cache.create(), options.serializer);
|
|
1192
3295
|
}
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
var offset = this.offset();
|
|
1196
|
-
if (offset === targetOffset) {
|
|
1197
|
-
break;
|
|
1198
|
-
}
|
|
1199
|
-
if (offset > targetOffset) {
|
|
1200
|
-
throw Error("targetOffset ".concat(targetOffset, " is at invalid UTF-16 code unit boundary"));
|
|
1201
|
-
}
|
|
1202
|
-
this.bump();
|
|
1203
|
-
if (this.isEOF()) {
|
|
1204
|
-
break;
|
|
1205
|
-
}
|
|
3296
|
+
function strategyVariadic(fn, options) {
|
|
3297
|
+
return assemble(fn, this, variadic, options.cache.create(), options.serializer);
|
|
1206
3298
|
}
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
while (!this.isEOF() && _isWhiteSpace(this.char())) {
|
|
1210
|
-
this.bump();
|
|
3299
|
+
function strategyMonadic(fn, options) {
|
|
3300
|
+
return assemble(fn, this, monadic, options.cache.create(), options.serializer);
|
|
1211
3301
|
}
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
3302
|
+
var serializerDefault = function() {
|
|
3303
|
+
return JSON.stringify(arguments);
|
|
3304
|
+
};
|
|
3305
|
+
function ObjectWithoutPrototypeCache() {
|
|
3306
|
+
this.cache = /* @__PURE__ */ Object.create(null);
|
|
1216
3307
|
}
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
function
|
|
1225
|
-
|
|
1226
|
-
}
|
|
1227
|
-
function _isAlphaOrSlash(codepoint) {
|
|
1228
|
-
return _isAlpha(codepoint) || codepoint === 47;
|
|
1229
|
-
}
|
|
1230
|
-
function _isPotentialElementNameChar(c) {
|
|
1231
|
-
return c === 45 || c === 46 || c >= 48 && c <= 57 || c === 95 || c >= 97 && c <= 122 || c >= 65 && c <= 90 || c == 183 || c >= 192 && c <= 214 || c >= 216 && c <= 246 || c >= 248 && c <= 893 || c >= 895 && c <= 8191 || c >= 8204 && c <= 8205 || c >= 8255 && c <= 8256 || c >= 8304 && c <= 8591 || c >= 11264 && c <= 12271 || c >= 12289 && c <= 55295 || c >= 63744 && c <= 64975 || c >= 65008 && c <= 65533 || c >= 65536 && c <= 983039;
|
|
1232
|
-
}
|
|
1233
|
-
function _isWhiteSpace(c) {
|
|
1234
|
-
return c >= 9 && c <= 13 || c === 32 || c === 133 || c >= 8206 && c <= 8207 || c === 8232 || c === 8233;
|
|
1235
|
-
}
|
|
1236
|
-
function _isPatternSyntax(c) {
|
|
1237
|
-
return c >= 33 && c <= 35 || c === 36 || c >= 37 && c <= 39 || c === 40 || c === 41 || c === 42 || c === 43 || c === 44 || c === 45 || c >= 46 && c <= 47 || c >= 58 && c <= 59 || c >= 60 && c <= 62 || c >= 63 && c <= 64 || c === 91 || c === 92 || c === 93 || c === 94 || c === 96 || c === 123 || c === 124 || c === 125 || c === 126 || c === 161 || c >= 162 && c <= 165 || c === 166 || c === 167 || c === 169 || c === 171 || c === 172 || c === 174 || c === 176 || c === 177 || c === 182 || c === 187 || c === 191 || c === 215 || c === 247 || c >= 8208 && c <= 8213 || c >= 8214 && c <= 8215 || c === 8216 || c === 8217 || c === 8218 || c >= 8219 && c <= 8220 || c === 8221 || c === 8222 || c === 8223 || c >= 8224 && c <= 8231 || c >= 8240 && c <= 8248 || c === 8249 || c === 8250 || c >= 8251 && c <= 8254 || c >= 8257 && c <= 8259 || c === 8260 || c === 8261 || c === 8262 || c >= 8263 && c <= 8273 || c === 8274 || c === 8275 || c >= 8277 && c <= 8286 || c >= 8592 && c <= 8596 || c >= 8597 && c <= 8601 || c >= 8602 && c <= 8603 || c >= 8604 && c <= 8607 || c === 8608 || c >= 8609 && c <= 8610 || c === 8611 || c >= 8612 && c <= 8613 || c === 8614 || c >= 8615 && c <= 8621 || c === 8622 || c >= 8623 && c <= 8653 || c >= 8654 && c <= 8655 || c >= 8656 && c <= 8657 || c === 8658 || c === 8659 || c === 8660 || c >= 8661 && c <= 8691 || c >= 8692 && c <= 8959 || c >= 8960 && c <= 8967 || c === 8968 || c === 8969 || c === 8970 || c === 8971 || c >= 8972 && c <= 8991 || c >= 8992 && c <= 8993 || c >= 8994 && c <= 9e3 || c === 9001 || c === 9002 || c >= 9003 && c <= 9083 || c === 9084 || c >= 9085 && c <= 9114 || c >= 9115 && c <= 9139 || c >= 9140 && c <= 9179 || c >= 9180 && c <= 9185 || c >= 9186 && c <= 9254 || c >= 9255 && c <= 9279 || c >= 9280 && c <= 9290 || c >= 9291 && c <= 9311 || c >= 9472 && c <= 9654 || c === 9655 || c >= 9656 && c <= 9664 || c === 9665 || c >= 9666 && c <= 9719 || c >= 9720 && c <= 9727 || c >= 9728 && c <= 9838 || c === 9839 || c >= 9840 && c <= 10087 || c === 10088 || c === 10089 || c === 10090 || c === 10091 || c === 10092 || c === 10093 || c === 10094 || c === 10095 || c === 10096 || c === 10097 || c === 10098 || c === 10099 || c === 10100 || c === 10101 || c >= 10132 && c <= 10175 || c >= 10176 && c <= 10180 || c === 10181 || c === 10182 || c >= 10183 && c <= 10213 || c === 10214 || c === 10215 || c === 10216 || c === 10217 || c === 10218 || c === 10219 || c === 10220 || c === 10221 || c === 10222 || c === 10223 || c >= 10224 && c <= 10239 || c >= 10240 && c <= 10495 || c >= 10496 && c <= 10626 || c === 10627 || c === 10628 || c === 10629 || c === 10630 || c === 10631 || c === 10632 || c === 10633 || c === 10634 || c === 10635 || c === 10636 || c === 10637 || c === 10638 || c === 10639 || c === 10640 || c === 10641 || c === 10642 || c === 10643 || c === 10644 || c === 10645 || c === 10646 || c === 10647 || c === 10648 || c >= 10649 && c <= 10711 || c === 10712 || c === 10713 || c === 10714 || c === 10715 || c >= 10716 && c <= 10747 || c === 10748 || c === 10749 || c >= 10750 && c <= 11007 || c >= 11008 && c <= 11055 || c >= 11056 && c <= 11076 || c >= 11077 && c <= 11078 || c >= 11079 && c <= 11084 || c >= 11085 && c <= 11123 || c >= 11124 && c <= 11125 || c >= 11126 && c <= 11157 || c === 11158 || c >= 11159 && c <= 11263 || c >= 11776 && c <= 11777 || c === 11778 || c === 11779 || c === 11780 || c === 11781 || c >= 11782 && c <= 11784 || c === 11785 || c === 11786 || c === 11787 || c === 11788 || c === 11789 || c >= 11790 && c <= 11798 || c === 11799 || c >= 11800 && c <= 11801 || c === 11802 || c === 11803 || c === 11804 || c === 11805 || c >= 11806 && c <= 11807 || c === 11808 || c === 11809 || c === 11810 || c === 11811 || c === 11812 || c === 11813 || c === 11814 || c === 11815 || c === 11816 || c === 11817 || c >= 11818 && c <= 11822 || c === 11823 || c >= 11824 && c <= 11833 || c >= 11834 && c <= 11835 || c >= 11836 && c <= 11839 || c === 11840 || c === 11841 || c === 11842 || c >= 11843 && c <= 11855 || c >= 11856 && c <= 11857 || c === 11858 || c >= 11859 && c <= 11903 || c >= 12289 && c <= 12291 || c === 12296 || c === 12297 || c === 12298 || c === 12299 || c === 12300 || c === 12301 || c === 12302 || c === 12303 || c === 12304 || c === 12305 || c >= 12306 && c <= 12307 || c === 12308 || c === 12309 || c === 12310 || c === 12311 || c === 12312 || c === 12313 || c === 12314 || c === 12315 || c === 12316 || c === 12317 || c >= 12318 && c <= 12319 || c === 12320 || c === 12336 || c === 64830 || c === 64831 || c >= 65093 && c <= 65094;
|
|
1238
|
-
}
|
|
1239
|
-
|
|
1240
|
-
// bazel-out/darwin-fastbuild/bin/packages/icu-messageformat-parser/lib/index.js
|
|
1241
|
-
function pruneLocation(els) {
|
|
1242
|
-
els.forEach(function(el) {
|
|
1243
|
-
delete el.location;
|
|
1244
|
-
if (isSelectElement(el) || isPluralElement(el)) {
|
|
1245
|
-
for (var k in el.options) {
|
|
1246
|
-
delete el.options[k].location;
|
|
1247
|
-
pruneLocation(el.options[k].value);
|
|
3308
|
+
ObjectWithoutPrototypeCache.prototype.get = function(key) {
|
|
3309
|
+
return this.cache[key];
|
|
3310
|
+
};
|
|
3311
|
+
ObjectWithoutPrototypeCache.prototype.set = function(key, value) {
|
|
3312
|
+
this.cache[key] = value;
|
|
3313
|
+
};
|
|
3314
|
+
var cacheDefault = {
|
|
3315
|
+
create: function create() {
|
|
3316
|
+
return new ObjectWithoutPrototypeCache();
|
|
1248
3317
|
}
|
|
1249
|
-
}
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
}
|
|
1254
|
-
pruneLocation(el.children);
|
|
1255
|
-
}
|
|
1256
|
-
});
|
|
1257
|
-
}
|
|
1258
|
-
function parse(message, opts) {
|
|
1259
|
-
if (opts === void 0) {
|
|
1260
|
-
opts = {};
|
|
1261
|
-
}
|
|
1262
|
-
opts = __assign({ shouldParseSkeletons: true, requiresOtherClause: true }, opts);
|
|
1263
|
-
var result = new Parser(message, opts).parse();
|
|
1264
|
-
if (result.err) {
|
|
1265
|
-
var error = SyntaxError(ErrorKind[result.err.kind]);
|
|
1266
|
-
error.location = result.err.location;
|
|
1267
|
-
error.originalMessage = result.err.message;
|
|
1268
|
-
throw error;
|
|
1269
|
-
}
|
|
1270
|
-
if (!(opts === null || opts === void 0 ? void 0 : opts.captureLocation)) {
|
|
1271
|
-
pruneLocation(result.val);
|
|
3318
|
+
};
|
|
3319
|
+
exports.strategies = {
|
|
3320
|
+
variadic: strategyVariadic,
|
|
3321
|
+
monadic: strategyMonadic
|
|
3322
|
+
};
|
|
1272
3323
|
}
|
|
1273
|
-
|
|
1274
|
-
}
|
|
3324
|
+
});
|
|
1275
3325
|
|
|
1276
|
-
// bazel-out/darwin-fastbuild/bin/packages/
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
cache,
|
|
1283
|
-
serializer
|
|
1284
|
-
});
|
|
1285
|
-
}
|
|
1286
|
-
function isPrimitive(value) {
|
|
1287
|
-
return value == null || typeof value === "number" || typeof value === "boolean";
|
|
1288
|
-
}
|
|
1289
|
-
function monadic(fn, cache, serializer, arg) {
|
|
1290
|
-
var cacheKey = isPrimitive(arg) ? arg : serializer(arg);
|
|
1291
|
-
var computedValue = cache.get(cacheKey);
|
|
1292
|
-
if (typeof computedValue === "undefined") {
|
|
1293
|
-
computedValue = fn.call(this, arg);
|
|
1294
|
-
cache.set(cacheKey, computedValue);
|
|
1295
|
-
}
|
|
1296
|
-
return computedValue;
|
|
1297
|
-
}
|
|
1298
|
-
function variadic(fn, cache, serializer) {
|
|
1299
|
-
var args = Array.prototype.slice.call(arguments, 3);
|
|
1300
|
-
var cacheKey = serializer(args);
|
|
1301
|
-
var computedValue = cache.get(cacheKey);
|
|
1302
|
-
if (typeof computedValue === "undefined") {
|
|
1303
|
-
computedValue = fn.apply(this, args);
|
|
1304
|
-
cache.set(cacheKey, computedValue);
|
|
1305
|
-
}
|
|
1306
|
-
return computedValue;
|
|
1307
|
-
}
|
|
1308
|
-
function assemble(fn, context, strategy, cache, serialize) {
|
|
1309
|
-
return strategy.bind(context, fn, cache, serialize);
|
|
1310
|
-
}
|
|
1311
|
-
function strategyDefault(fn, options) {
|
|
1312
|
-
var strategy = fn.length === 1 ? monadic : variadic;
|
|
1313
|
-
return assemble(fn, this, strategy, options.cache.create(), options.serializer);
|
|
1314
|
-
}
|
|
1315
|
-
function strategyVariadic(fn, options) {
|
|
1316
|
-
return assemble(fn, this, variadic, options.cache.create(), options.serializer);
|
|
1317
|
-
}
|
|
1318
|
-
function strategyMonadic(fn, options) {
|
|
1319
|
-
return assemble(fn, this, monadic, options.cache.create(), options.serializer);
|
|
1320
|
-
}
|
|
1321
|
-
var serializerDefault = function() {
|
|
1322
|
-
return JSON.stringify(arguments);
|
|
1323
|
-
};
|
|
1324
|
-
function ObjectWithoutPrototypeCache() {
|
|
1325
|
-
this.cache = /* @__PURE__ */ Object.create(null);
|
|
1326
|
-
}
|
|
1327
|
-
ObjectWithoutPrototypeCache.prototype.get = function(key) {
|
|
1328
|
-
return this.cache[key];
|
|
1329
|
-
};
|
|
1330
|
-
ObjectWithoutPrototypeCache.prototype.set = function(key, value) {
|
|
1331
|
-
this.cache[key] = value;
|
|
1332
|
-
};
|
|
1333
|
-
var cacheDefault = {
|
|
1334
|
-
create: function create() {
|
|
1335
|
-
return new ObjectWithoutPrototypeCache();
|
|
1336
|
-
}
|
|
1337
|
-
};
|
|
1338
|
-
var strategies = {
|
|
1339
|
-
variadic: strategyVariadic,
|
|
1340
|
-
monadic: strategyMonadic
|
|
1341
|
-
};
|
|
3326
|
+
// bazel-out/darwin-fastbuild/bin/packages/intl-messageformat/lib_esnext/src/core.js
|
|
3327
|
+
var import_icu_messageformat_parser2 = __toESM(require_icu_messageformat_parser());
|
|
3328
|
+
var import_fast_memoize = __toESM(require_fast_memoize());
|
|
3329
|
+
|
|
3330
|
+
// bazel-out/darwin-fastbuild/bin/packages/intl-messageformat/lib_esnext/src/formatters.js
|
|
3331
|
+
var import_icu_messageformat_parser = __toESM(require_icu_messageformat_parser());
|
|
1342
3332
|
|
|
1343
3333
|
// bazel-out/darwin-fastbuild/bin/packages/intl-messageformat/lib_esnext/src/error.js
|
|
1344
3334
|
var ErrorCode;
|
|
@@ -1399,7 +3389,7 @@ function isFormatXMLElementFn(el) {
|
|
|
1399
3389
|
return typeof el === "function";
|
|
1400
3390
|
}
|
|
1401
3391
|
function formatToParts(els, locales, formatters, formats, values, currentPluralValue, originalMessage) {
|
|
1402
|
-
if (els.length === 1 && isLiteralElement(els[0])) {
|
|
3392
|
+
if (els.length === 1 && (0, import_icu_messageformat_parser.isLiteralElement)(els[0])) {
|
|
1403
3393
|
return [
|
|
1404
3394
|
{
|
|
1405
3395
|
type: PART_TYPE.literal,
|
|
@@ -1409,14 +3399,14 @@ function formatToParts(els, locales, formatters, formats, values, currentPluralV
|
|
|
1409
3399
|
}
|
|
1410
3400
|
const result = [];
|
|
1411
3401
|
for (const el of els) {
|
|
1412
|
-
if (isLiteralElement(el)) {
|
|
3402
|
+
if ((0, import_icu_messageformat_parser.isLiteralElement)(el)) {
|
|
1413
3403
|
result.push({
|
|
1414
3404
|
type: PART_TYPE.literal,
|
|
1415
3405
|
value: el.value
|
|
1416
3406
|
});
|
|
1417
3407
|
continue;
|
|
1418
3408
|
}
|
|
1419
|
-
if (isPoundElement(el)) {
|
|
3409
|
+
if ((0, import_icu_messageformat_parser.isPoundElement)(el)) {
|
|
1420
3410
|
if (typeof currentPluralValue === "number") {
|
|
1421
3411
|
result.push({
|
|
1422
3412
|
type: PART_TYPE.literal,
|
|
@@ -1430,7 +3420,7 @@ function formatToParts(els, locales, formatters, formats, values, currentPluralV
|
|
|
1430
3420
|
throw new MissingValueError(varName, originalMessage);
|
|
1431
3421
|
}
|
|
1432
3422
|
let value = values[varName];
|
|
1433
|
-
if (isArgumentElement(el)) {
|
|
3423
|
+
if ((0, import_icu_messageformat_parser.isArgumentElement)(el)) {
|
|
1434
3424
|
if (!value || typeof value === "string" || typeof value === "number") {
|
|
1435
3425
|
value = typeof value === "string" || typeof value === "number" ? String(value) : "";
|
|
1436
3426
|
}
|
|
@@ -1440,24 +3430,24 @@ function formatToParts(els, locales, formatters, formats, values, currentPluralV
|
|
|
1440
3430
|
});
|
|
1441
3431
|
continue;
|
|
1442
3432
|
}
|
|
1443
|
-
if (isDateElement(el)) {
|
|
1444
|
-
const style = typeof el.style === "string" ? formats.date[el.style] : isDateTimeSkeleton(el.style) ? el.style.parsedOptions : void 0;
|
|
3433
|
+
if ((0, import_icu_messageformat_parser.isDateElement)(el)) {
|
|
3434
|
+
const style = typeof el.style === "string" ? formats.date[el.style] : (0, import_icu_messageformat_parser.isDateTimeSkeleton)(el.style) ? el.style.parsedOptions : void 0;
|
|
1445
3435
|
result.push({
|
|
1446
3436
|
type: PART_TYPE.literal,
|
|
1447
3437
|
value: formatters.getDateTimeFormat(locales, style).format(value)
|
|
1448
3438
|
});
|
|
1449
3439
|
continue;
|
|
1450
3440
|
}
|
|
1451
|
-
if (isTimeElement(el)) {
|
|
1452
|
-
const style = typeof el.style === "string" ? formats.time[el.style] : isDateTimeSkeleton(el.style) ? el.style.parsedOptions :
|
|
3441
|
+
if ((0, import_icu_messageformat_parser.isTimeElement)(el)) {
|
|
3442
|
+
const style = typeof el.style === "string" ? formats.time[el.style] : (0, import_icu_messageformat_parser.isDateTimeSkeleton)(el.style) ? el.style.parsedOptions : formats.time.medium;
|
|
1453
3443
|
result.push({
|
|
1454
3444
|
type: PART_TYPE.literal,
|
|
1455
3445
|
value: formatters.getDateTimeFormat(locales, style).format(value)
|
|
1456
3446
|
});
|
|
1457
3447
|
continue;
|
|
1458
3448
|
}
|
|
1459
|
-
if (isNumberElement(el)) {
|
|
1460
|
-
const style = typeof el.style === "string" ? formats.number[el.style] : isNumberSkeleton(el.style) ? el.style.parsedOptions : void 0;
|
|
3449
|
+
if ((0, import_icu_messageformat_parser.isNumberElement)(el)) {
|
|
3450
|
+
const style = typeof el.style === "string" ? formats.number[el.style] : (0, import_icu_messageformat_parser.isNumberSkeleton)(el.style) ? el.style.parsedOptions : void 0;
|
|
1461
3451
|
if (style && style.scale) {
|
|
1462
3452
|
value = value * (style.scale || 1);
|
|
1463
3453
|
}
|
|
@@ -1467,7 +3457,7 @@ function formatToParts(els, locales, formatters, formats, values, currentPluralV
|
|
|
1467
3457
|
});
|
|
1468
3458
|
continue;
|
|
1469
3459
|
}
|
|
1470
|
-
if (isTagElement(el)) {
|
|
3460
|
+
if ((0, import_icu_messageformat_parser.isTagElement)(el)) {
|
|
1471
3461
|
const { children, value: value2 } = el;
|
|
1472
3462
|
const formatFn = values[value2];
|
|
1473
3463
|
if (!isFormatXMLElementFn(formatFn)) {
|
|
@@ -1485,7 +3475,7 @@ function formatToParts(els, locales, formatters, formats, values, currentPluralV
|
|
|
1485
3475
|
};
|
|
1486
3476
|
}));
|
|
1487
3477
|
}
|
|
1488
|
-
if (isSelectElement(el)) {
|
|
3478
|
+
if ((0, import_icu_messageformat_parser.isSelectElement)(el)) {
|
|
1489
3479
|
const opt = el.options[value] || el.options.other;
|
|
1490
3480
|
if (!opt) {
|
|
1491
3481
|
throw new InvalidValueError(el.value, value, Object.keys(el.options), originalMessage);
|
|
@@ -1493,7 +3483,7 @@ function formatToParts(els, locales, formatters, formats, values, currentPluralV
|
|
|
1493
3483
|
result.push(...formatToParts(opt.value, locales, formatters, formats, values));
|
|
1494
3484
|
continue;
|
|
1495
3485
|
}
|
|
1496
|
-
if (isPluralElement(el)) {
|
|
3486
|
+
if ((0, import_icu_messageformat_parser.isPluralElement)(el)) {
|
|
1497
3487
|
let opt = el.options[`=${value}`];
|
|
1498
3488
|
if (!opt) {
|
|
1499
3489
|
if (!Intl.PluralRules) {
|
|
@@ -1560,23 +3550,24 @@ function createDefaultFormatters(cache = {
|
|
|
1560
3550
|
pluralRules: {}
|
|
1561
3551
|
}) {
|
|
1562
3552
|
return {
|
|
1563
|
-
getNumberFormat:
|
|
3553
|
+
getNumberFormat: (0, import_fast_memoize.default)((...args) => new Intl.NumberFormat(...args), {
|
|
1564
3554
|
cache: createFastMemoizeCache(cache.number),
|
|
1565
|
-
strategy: strategies.variadic
|
|
3555
|
+
strategy: import_fast_memoize.strategies.variadic
|
|
1566
3556
|
}),
|
|
1567
|
-
getDateTimeFormat:
|
|
3557
|
+
getDateTimeFormat: (0, import_fast_memoize.default)((...args) => new Intl.DateTimeFormat(...args), {
|
|
1568
3558
|
cache: createFastMemoizeCache(cache.dateTime),
|
|
1569
|
-
strategy: strategies.variadic
|
|
3559
|
+
strategy: import_fast_memoize.strategies.variadic
|
|
1570
3560
|
}),
|
|
1571
|
-
getPluralRules:
|
|
3561
|
+
getPluralRules: (0, import_fast_memoize.default)((...args) => new Intl.PluralRules(...args), {
|
|
1572
3562
|
cache: createFastMemoizeCache(cache.pluralRules),
|
|
1573
|
-
strategy: strategies.variadic
|
|
3563
|
+
strategy: import_fast_memoize.strategies.variadic
|
|
1574
3564
|
})
|
|
1575
3565
|
};
|
|
1576
3566
|
}
|
|
1577
3567
|
var _IntlMessageFormat = class {
|
|
1578
3568
|
ast;
|
|
1579
3569
|
locales;
|
|
3570
|
+
resolvedLocale;
|
|
1580
3571
|
formatters;
|
|
1581
3572
|
formats;
|
|
1582
3573
|
message;
|
|
@@ -1586,13 +3577,16 @@ var _IntlMessageFormat = class {
|
|
|
1586
3577
|
pluralRules: {}
|
|
1587
3578
|
};
|
|
1588
3579
|
constructor(message, locales = _IntlMessageFormat.defaultLocale, overrideFormats, opts) {
|
|
3580
|
+
this.locales = locales;
|
|
3581
|
+
this.resolvedLocale = _IntlMessageFormat.resolveLocale(locales);
|
|
1589
3582
|
if (typeof message === "string") {
|
|
1590
3583
|
this.message = message;
|
|
1591
3584
|
if (!_IntlMessageFormat.__parse) {
|
|
1592
3585
|
throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");
|
|
1593
3586
|
}
|
|
1594
3587
|
this.ast = _IntlMessageFormat.__parse(message, {
|
|
1595
|
-
ignoreTag: opts?.ignoreTag
|
|
3588
|
+
ignoreTag: opts?.ignoreTag,
|
|
3589
|
+
locale: this.resolvedLocale
|
|
1596
3590
|
});
|
|
1597
3591
|
} else {
|
|
1598
3592
|
this.ast = message;
|
|
@@ -1601,7 +3595,6 @@ var _IntlMessageFormat = class {
|
|
|
1601
3595
|
throw new TypeError("A message must be provided as a String or AST.");
|
|
1602
3596
|
}
|
|
1603
3597
|
this.formats = mergeConfigs(_IntlMessageFormat.formats, overrideFormats);
|
|
1604
|
-
this.locales = locales;
|
|
1605
3598
|
this.formatters = opts && opts.formatters || createDefaultFormatters(this.formatterCache);
|
|
1606
3599
|
}
|
|
1607
3600
|
format = (values) => {
|
|
@@ -1624,7 +3617,7 @@ var _IntlMessageFormat = class {
|
|
|
1624
3617
|
};
|
|
1625
3618
|
formatToParts = (values) => formatToParts(this.ast, this.locales, this.formatters, this.formats, values, void 0, this.message);
|
|
1626
3619
|
resolvedOptions = () => ({
|
|
1627
|
-
locale: Intl.NumberFormat.supportedLocalesOf(this.locales)[0]
|
|
3620
|
+
locale: this.resolvedLocale?.toString() || Intl.NumberFormat.supportedLocalesOf(this.locales)[0]
|
|
1628
3621
|
});
|
|
1629
3622
|
getAst = () => this.ast;
|
|
1630
3623
|
static get defaultLocale() {
|
|
@@ -1636,7 +3629,17 @@ var _IntlMessageFormat = class {
|
|
|
1636
3629
|
};
|
|
1637
3630
|
var IntlMessageFormat = _IntlMessageFormat;
|
|
1638
3631
|
__publicField(IntlMessageFormat, "memoizedDefaultLocale", null);
|
|
1639
|
-
__publicField(IntlMessageFormat, "
|
|
3632
|
+
__publicField(IntlMessageFormat, "resolveLocale", (locales) => {
|
|
3633
|
+
if (typeof Intl.Locale === "undefined") {
|
|
3634
|
+
return;
|
|
3635
|
+
}
|
|
3636
|
+
const supportedLocales = Intl.NumberFormat.supportedLocalesOf(locales);
|
|
3637
|
+
if (supportedLocales.length > 0) {
|
|
3638
|
+
return new Intl.Locale(supportedLocales[0]);
|
|
3639
|
+
}
|
|
3640
|
+
return new Intl.Locale(typeof locales === "string" ? locales : locales[0]);
|
|
3641
|
+
});
|
|
3642
|
+
__publicField(IntlMessageFormat, "__parse", import_icu_messageformat_parser2.parse);
|
|
1640
3643
|
__publicField(IntlMessageFormat, "formats", {
|
|
1641
3644
|
number: {
|
|
1642
3645
|
integer: {
|
|
@@ -1711,18 +3714,4 @@ export {
|
|
|
1711
3714
|
formatToParts,
|
|
1712
3715
|
isFormatXMLElementFn
|
|
1713
3716
|
};
|
|
1714
|
-
/*! *****************************************************************************
|
|
1715
|
-
Copyright (c) Microsoft Corporation.
|
|
1716
|
-
|
|
1717
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
1718
|
-
purpose with or without fee is hereby granted.
|
|
1719
|
-
|
|
1720
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
1721
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
1722
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
1723
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
1724
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
1725
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
1726
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
1727
|
-
***************************************************************************** */
|
|
1728
3717
|
//# sourceMappingURL=intl-messageformat.esm.js.map
|