@formatjs/intl-relativetimeformat 11.2.15 → 11.2.16
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/abstract/FormatRelativeTime.js +1 -2
- package/abstract/FormatRelativeTimeToParts.js +1 -2
- package/abstract/InitializeRelativeTimeFormat.js +1 -2
- package/abstract/MakePartsList.js +1 -2
- package/abstract/PartitionRelativeTimePattern.js +1 -2
- package/abstract/SingularRelativeTimeUnit.js +1 -2
- package/get_internal_slots.js +1 -1
- package/package.json +7 -7
- package/polyfill.iife.js +204 -160
- package/should-polyfill.js +1 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FormatRelativeTime =
|
|
3
|
+
exports.FormatRelativeTime = FormatRelativeTime;
|
|
4
4
|
var PartitionRelativeTimePattern_1 = require("./PartitionRelativeTimePattern");
|
|
5
5
|
function FormatRelativeTime(rtf, value, unit, implDetails) {
|
|
6
6
|
var parts = (0, PartitionRelativeTimePattern_1.PartitionRelativeTimePattern)(rtf, value, unit, implDetails);
|
|
@@ -11,4 +11,3 @@ function FormatRelativeTime(rtf, value, unit, implDetails) {
|
|
|
11
11
|
}
|
|
12
12
|
return result;
|
|
13
13
|
}
|
|
14
|
-
exports.FormatRelativeTime = FormatRelativeTime;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FormatRelativeTimeToParts =
|
|
3
|
+
exports.FormatRelativeTimeToParts = FormatRelativeTimeToParts;
|
|
4
4
|
var PartitionRelativeTimePattern_1 = require("./PartitionRelativeTimePattern");
|
|
5
5
|
function FormatRelativeTimeToParts(rtf, value, unit, implDetails) {
|
|
6
6
|
return (0, PartitionRelativeTimePattern_1.PartitionRelativeTimePattern)(rtf, value, unit, implDetails);
|
|
7
7
|
}
|
|
8
|
-
exports.FormatRelativeTimeToParts = FormatRelativeTimeToParts;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.InitializeRelativeTimeFormat =
|
|
3
|
+
exports.InitializeRelativeTimeFormat = InitializeRelativeTimeFormat;
|
|
4
4
|
var ecma402_abstract_1 = require("@formatjs/ecma402-abstract");
|
|
5
5
|
var intl_localematcher_1 = require("@formatjs/intl-localematcher");
|
|
6
6
|
var NUMBERING_SYSTEM_REGEX = /^[a-z0-9]{3,8}(-[a-z0-9]{3,8})*$/i;
|
|
@@ -35,4 +35,3 @@ function InitializeRelativeTimeFormat(rtf, locales, options, _a) {
|
|
|
35
35
|
internalSlots.numberingSystem = nu;
|
|
36
36
|
return rtf;
|
|
37
37
|
}
|
|
38
|
-
exports.InitializeRelativeTimeFormat = InitializeRelativeTimeFormat;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MakePartsList =
|
|
3
|
+
exports.MakePartsList = MakePartsList;
|
|
4
4
|
var ecma402_abstract_1 = require("@formatjs/ecma402-abstract");
|
|
5
5
|
function MakePartsList(pattern, unit, parts) {
|
|
6
6
|
var patternParts = (0, ecma402_abstract_1.PartitionPattern)(pattern);
|
|
@@ -27,4 +27,3 @@ function MakePartsList(pattern, unit, parts) {
|
|
|
27
27
|
}
|
|
28
28
|
return result;
|
|
29
29
|
}
|
|
30
|
-
exports.MakePartsList = MakePartsList;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PartitionRelativeTimePattern =
|
|
3
|
+
exports.PartitionRelativeTimePattern = PartitionRelativeTimePattern;
|
|
4
4
|
var ecma402_abstract_1 = require("@formatjs/ecma402-abstract");
|
|
5
5
|
var SingularRelativeTimeUnit_1 = require("./SingularRelativeTimeUnit");
|
|
6
6
|
var MakePartsList_1 = require("./MakePartsList");
|
|
@@ -54,4 +54,3 @@ function PartitionRelativeTimePattern(rtf, value, unit, _a) {
|
|
|
54
54
|
var pattern = po[pr];
|
|
55
55
|
return (0, MakePartsList_1.MakePartsList)(pattern, resolvedUnit, fv);
|
|
56
56
|
}
|
|
57
|
-
exports.PartitionRelativeTimePattern = PartitionRelativeTimePattern;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SingularRelativeTimeUnit =
|
|
3
|
+
exports.SingularRelativeTimeUnit = SingularRelativeTimeUnit;
|
|
4
4
|
var ecma402_abstract_1 = require("@formatjs/ecma402-abstract");
|
|
5
5
|
/**
|
|
6
6
|
* https://tc39.es/proposal-intl-relative-time/#sec-singularrelativetimeunit
|
|
@@ -36,4 +36,3 @@ function SingularRelativeTimeUnit(unit) {
|
|
|
36
36
|
}
|
|
37
37
|
return unit;
|
|
38
38
|
}
|
|
39
|
-
exports.SingularRelativeTimeUnit = SingularRelativeTimeUnit;
|
package/get_internal_slots.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// Type-only circular import
|
|
3
3
|
// eslint-disable-next-line import/no-cycle
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.default = getInternalSlots;
|
|
5
6
|
var internalSlotMap = new WeakMap();
|
|
6
7
|
function getInternalSlots(x) {
|
|
7
8
|
var internalSlots = internalSlotMap.get(x);
|
|
@@ -11,4 +12,3 @@ function getInternalSlots(x) {
|
|
|
11
12
|
}
|
|
12
13
|
return internalSlots;
|
|
13
14
|
}
|
|
14
|
-
exports.default = getInternalSlots;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formatjs/intl-relativetimeformat",
|
|
3
|
-
"version": "11.2.
|
|
3
|
+
"version": "11.2.16",
|
|
4
4
|
"description": "Formats JavaScript dates to relative time strings.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"intl",
|
|
@@ -20,14 +20,14 @@
|
|
|
20
20
|
"url": "git@github.com:formatjs/formatjs.git"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"tslib": "^2.
|
|
24
|
-
"@formatjs/ecma402-abstract": "2.
|
|
25
|
-
"@formatjs/intl-localematcher": "0.5.
|
|
23
|
+
"tslib": "^2.7.0",
|
|
24
|
+
"@formatjs/ecma402-abstract": "2.2.0",
|
|
25
|
+
"@formatjs/intl-localematcher": "0.5.5"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@formatjs/intl-
|
|
29
|
-
"@formatjs/intl-
|
|
30
|
-
"@formatjs/intl-pluralrules": "5.2.
|
|
28
|
+
"@formatjs/intl-locale": "4.0.2",
|
|
29
|
+
"@formatjs/intl-getcanonicallocales": "2.3.1",
|
|
30
|
+
"@formatjs/intl-pluralrules": "5.2.16"
|
|
31
31
|
},
|
|
32
32
|
"main": "index.js",
|
|
33
33
|
"types": "index.d.ts",
|
package/polyfill.iife.js
CHANGED
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
(() => {
|
|
2
|
-
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
|
+
var __publicField = (obj, key, value) => {
|
|
5
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
6
|
+
return value;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
// node_modules/.aspect_rules_js/@formatjs+ecma402-abstract@0.0.0/node_modules/@formatjs/ecma402-abstract/lib/CanonicalizeLocaleList.js
|
|
3
10
|
function CanonicalizeLocaleList(locales) {
|
|
4
11
|
return Intl.getCanonicalLocales(locales);
|
|
5
12
|
}
|
|
6
13
|
|
|
7
|
-
//
|
|
14
|
+
// node_modules/.aspect_rules_js/@formatjs+ecma402-abstract@0.0.0/node_modules/@formatjs/ecma402-abstract/lib/262.js
|
|
8
15
|
function ToString(o) {
|
|
9
16
|
if (typeof o === "symbol") {
|
|
10
17
|
throw TypeError("Cannot convert a Symbol value to a string");
|
|
@@ -58,7 +65,7 @@
|
|
|
58
65
|
var MS_PER_MINUTE = MS_PER_SECOND * SECONDS_PER_MINUTE;
|
|
59
66
|
var MS_PER_HOUR = MS_PER_MINUTE * MINUTES_PER_HOUR;
|
|
60
67
|
|
|
61
|
-
//
|
|
68
|
+
// node_modules/.aspect_rules_js/@formatjs+ecma402-abstract@0.0.0/node_modules/@formatjs/ecma402-abstract/lib/CoerceOptionsToObject.js
|
|
62
69
|
function CoerceOptionsToObject(options) {
|
|
63
70
|
if (typeof options === "undefined") {
|
|
64
71
|
return /* @__PURE__ */ Object.create(null);
|
|
@@ -66,7 +73,7 @@
|
|
|
66
73
|
return ToObject(options);
|
|
67
74
|
}
|
|
68
75
|
|
|
69
|
-
//
|
|
76
|
+
// node_modules/.aspect_rules_js/@formatjs+ecma402-abstract@0.0.0/node_modules/@formatjs/ecma402-abstract/lib/GetOption.js
|
|
70
77
|
function GetOption(opts, prop, type, values, fallback) {
|
|
71
78
|
if (typeof opts !== "object") {
|
|
72
79
|
throw new TypeError("Options must be an object");
|
|
@@ -92,7 +99,7 @@
|
|
|
92
99
|
return fallback;
|
|
93
100
|
}
|
|
94
101
|
|
|
95
|
-
//
|
|
102
|
+
// node_modules/.aspect_rules_js/@formatjs+ecma402-abstract@0.0.0/node_modules/@formatjs/ecma402-abstract/lib/IsSanctionedSimpleUnitIdentifier.js
|
|
96
103
|
var SANCTIONED_UNITS = [
|
|
97
104
|
"angle-degree",
|
|
98
105
|
"area-acre",
|
|
@@ -143,7 +150,7 @@
|
|
|
143
150
|
}
|
|
144
151
|
var SIMPLE_UNITS = SANCTIONED_UNITS.map(removeUnitNamespace);
|
|
145
152
|
|
|
146
|
-
//
|
|
153
|
+
// node_modules/.aspect_rules_js/tslib@2.7.0/node_modules/tslib/tslib.es6.mjs
|
|
147
154
|
var extendStatics = function(d, b) {
|
|
148
155
|
extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
|
|
149
156
|
d2.__proto__ = b2;
|
|
@@ -175,7 +182,7 @@
|
|
|
175
182
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
176
183
|
}
|
|
177
184
|
|
|
178
|
-
//
|
|
185
|
+
// node_modules/.aspect_rules_js/@formatjs+fast-memoize@0.0.0/node_modules/@formatjs/fast-memoize/lib/index.js
|
|
179
186
|
function memoize(fn, options) {
|
|
180
187
|
var cache = options && options.cache ? options.cache : cacheDefault;
|
|
181
188
|
var serializer = options && options.serializer ? options.serializer : serializerDefault;
|
|
@@ -242,7 +249,7 @@
|
|
|
242
249
|
monadic: strategyMonadic
|
|
243
250
|
};
|
|
244
251
|
|
|
245
|
-
//
|
|
252
|
+
// node_modules/.aspect_rules_js/@formatjs+ecma402-abstract@0.0.0/node_modules/@formatjs/ecma402-abstract/lib/utils.js
|
|
246
253
|
function invariant(condition, message, Err) {
|
|
247
254
|
if (Err === void 0) {
|
|
248
255
|
Err = Error;
|
|
@@ -302,19 +309,19 @@
|
|
|
302
309
|
strategy: strategies.variadic
|
|
303
310
|
});
|
|
304
311
|
|
|
305
|
-
//
|
|
312
|
+
// node_modules/.aspect_rules_js/@formatjs+ecma402-abstract@0.0.0/node_modules/@formatjs/ecma402-abstract/lib/regex.generated.js
|
|
306
313
|
var S_UNICODE_REGEX = /[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20BF\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC1\uFDFC\uFDFD\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEE0-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF73\uDF80-\uDFD8\uDFE0-\uDFEB]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDD78\uDD7A-\uDDCB\uDDCD-\uDE53\uDE60-\uDE6D\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6\uDF00-\uDF92\uDF94-\uDFCA]/;
|
|
307
314
|
|
|
308
|
-
//
|
|
315
|
+
// node_modules/.aspect_rules_js/@formatjs+ecma402-abstract@0.0.0/node_modules/@formatjs/ecma402-abstract/lib/NumberFormat/format_to_parts.js
|
|
309
316
|
var CARET_S_UNICODE_REGEX = new RegExp("^".concat(S_UNICODE_REGEX.source));
|
|
310
317
|
var S_DOLLAR_UNICODE_REGEX = new RegExp("".concat(S_UNICODE_REGEX.source, "$"));
|
|
311
318
|
|
|
312
|
-
//
|
|
319
|
+
// node_modules/.aspect_rules_js/@formatjs+intl-localematcher@0.0.0/node_modules/@formatjs/intl-localematcher/lib/abstract/CanonicalizeLocaleList.js
|
|
313
320
|
function CanonicalizeLocaleList2(locales) {
|
|
314
321
|
return Intl.getCanonicalLocales(locales);
|
|
315
322
|
}
|
|
316
323
|
|
|
317
|
-
//
|
|
324
|
+
// node_modules/.aspect_rules_js/@formatjs+intl-localematcher@0.0.0/node_modules/@formatjs/intl-localematcher/lib/abstract/languageMatching.js
|
|
318
325
|
var data = {
|
|
319
326
|
supplemental: {
|
|
320
327
|
languageMatching: {
|
|
@@ -2936,7 +2943,7 @@
|
|
|
2936
2943
|
}
|
|
2937
2944
|
};
|
|
2938
2945
|
|
|
2939
|
-
//
|
|
2946
|
+
// node_modules/.aspect_rules_js/@formatjs+intl-localematcher@0.0.0/node_modules/@formatjs/intl-localematcher/lib/abstract/regions.generated.js
|
|
2940
2947
|
var regions = {
|
|
2941
2948
|
"001": [
|
|
2942
2949
|
"001",
|
|
@@ -4271,7 +4278,7 @@
|
|
|
4271
4278
|
]
|
|
4272
4279
|
};
|
|
4273
4280
|
|
|
4274
|
-
//
|
|
4281
|
+
// node_modules/.aspect_rules_js/@formatjs+intl-localematcher@0.0.0/node_modules/@formatjs/intl-localematcher/lib/abstract/utils.js
|
|
4275
4282
|
var UNICODE_EXTENSION_SEQUENCE_REGEX = /-u(?:-[0-9a-z]{2,8})+/gi;
|
|
4276
4283
|
function invariant2(condition, message, Err) {
|
|
4277
4284
|
if (Err === void 0) {
|
|
@@ -4425,7 +4432,7 @@
|
|
|
4425
4432
|
return result;
|
|
4426
4433
|
}
|
|
4427
4434
|
|
|
4428
|
-
//
|
|
4435
|
+
// node_modules/.aspect_rules_js/@formatjs+intl-localematcher@0.0.0/node_modules/@formatjs/intl-localematcher/lib/abstract/BestFitMatcher.js
|
|
4429
4436
|
function BestFitMatcher(availableLocales, requestedLocales, getDefaultLocale) {
|
|
4430
4437
|
var foundLocale;
|
|
4431
4438
|
var extension;
|
|
@@ -4450,7 +4457,7 @@
|
|
|
4450
4457
|
};
|
|
4451
4458
|
}
|
|
4452
4459
|
|
|
4453
|
-
//
|
|
4460
|
+
// node_modules/.aspect_rules_js/@formatjs+intl-localematcher@0.0.0/node_modules/@formatjs/intl-localematcher/lib/abstract/BestAvailableLocale.js
|
|
4454
4461
|
function BestAvailableLocale(availableLocales, locale) {
|
|
4455
4462
|
var candidate = locale;
|
|
4456
4463
|
while (true) {
|
|
@@ -4468,7 +4475,7 @@
|
|
|
4468
4475
|
}
|
|
4469
4476
|
}
|
|
4470
4477
|
|
|
4471
|
-
//
|
|
4478
|
+
// node_modules/.aspect_rules_js/@formatjs+intl-localematcher@0.0.0/node_modules/@formatjs/intl-localematcher/lib/abstract/LookupMatcher.js
|
|
4472
4479
|
function LookupMatcher(availableLocales, requestedLocales, getDefaultLocale) {
|
|
4473
4480
|
var result = { locale: "" };
|
|
4474
4481
|
for (var _i = 0, requestedLocales_1 = requestedLocales; _i < requestedLocales_1.length; _i++) {
|
|
@@ -4487,7 +4494,7 @@
|
|
|
4487
4494
|
return result;
|
|
4488
4495
|
}
|
|
4489
4496
|
|
|
4490
|
-
//
|
|
4497
|
+
// node_modules/.aspect_rules_js/@formatjs+intl-localematcher@0.0.0/node_modules/@formatjs/intl-localematcher/lib/abstract/UnicodeExtensionValue.js
|
|
4491
4498
|
function UnicodeExtensionValue(extension, key) {
|
|
4492
4499
|
invariant2(key.length === 2, "key must have 2 elements");
|
|
4493
4500
|
var size = extension.length;
|
|
@@ -4526,7 +4533,7 @@
|
|
|
4526
4533
|
return void 0;
|
|
4527
4534
|
}
|
|
4528
4535
|
|
|
4529
|
-
//
|
|
4536
|
+
// node_modules/.aspect_rules_js/@formatjs+intl-localematcher@0.0.0/node_modules/@formatjs/intl-localematcher/lib/abstract/ResolveLocale.js
|
|
4530
4537
|
function ResolveLocale(availableLocales, requestedLocales, options, relevantExtensionKeys, localeData, getDefaultLocale) {
|
|
4531
4538
|
var matcher = options.localeMatcher;
|
|
4532
4539
|
var r;
|
|
@@ -4590,7 +4597,7 @@
|
|
|
4590
4597
|
return result;
|
|
4591
4598
|
}
|
|
4592
4599
|
|
|
4593
|
-
//
|
|
4600
|
+
// node_modules/.aspect_rules_js/@formatjs+intl-localematcher@0.0.0/node_modules/@formatjs/intl-localematcher/lib/abstract/LookupSupportedLocales.js
|
|
4594
4601
|
function LookupSupportedLocales(availableLocales, requestedLocales) {
|
|
4595
4602
|
var subset = [];
|
|
4596
4603
|
for (var _i = 0, requestedLocales_1 = requestedLocales; _i < requestedLocales_1.length; _i++) {
|
|
@@ -4604,7 +4611,7 @@
|
|
|
4604
4611
|
return subset;
|
|
4605
4612
|
}
|
|
4606
4613
|
|
|
4607
|
-
//
|
|
4614
|
+
// node_modules/.aspect_rules_js/@formatjs+intl-localematcher@0.0.0/node_modules/@formatjs/intl-localematcher/lib/index.js
|
|
4608
4615
|
function match(requestedLocales, availableLocales, defaultLocale, opts) {
|
|
4609
4616
|
return ResolveLocale(availableLocales, CanonicalizeLocaleList2(requestedLocales), {
|
|
4610
4617
|
localeMatcher: (opts === null || opts === void 0 ? void 0 : opts.algorithm) || "best fit"
|
|
@@ -4613,7 +4620,7 @@
|
|
|
4613
4620
|
}).locale;
|
|
4614
4621
|
}
|
|
4615
4622
|
|
|
4616
|
-
//
|
|
4623
|
+
// node_modules/.aspect_rules_js/@formatjs+ecma402-abstract@0.0.0/node_modules/@formatjs/ecma402-abstract/lib/PartitionPattern.js
|
|
4617
4624
|
function PartitionPattern(pattern) {
|
|
4618
4625
|
var result = [];
|
|
4619
4626
|
var beginIndex = pattern.indexOf("{");
|
|
@@ -4645,7 +4652,7 @@
|
|
|
4645
4652
|
return result;
|
|
4646
4653
|
}
|
|
4647
4654
|
|
|
4648
|
-
//
|
|
4655
|
+
// node_modules/.aspect_rules_js/@formatjs+ecma402-abstract@0.0.0/node_modules/@formatjs/ecma402-abstract/lib/SupportedLocales.js
|
|
4649
4656
|
function SupportedLocales(availableLocales, requestedLocales, options) {
|
|
4650
4657
|
var matcher = "best fit";
|
|
4651
4658
|
if (options !== void 0) {
|
|
@@ -4658,7 +4665,7 @@
|
|
|
4658
4665
|
return LookupSupportedLocales(Array.from(availableLocales), requestedLocales);
|
|
4659
4666
|
}
|
|
4660
4667
|
|
|
4661
|
-
//
|
|
4668
|
+
// node_modules/.aspect_rules_js/@formatjs+ecma402-abstract@0.0.0/node_modules/@formatjs/ecma402-abstract/lib/data.js
|
|
4662
4669
|
var MissingLocaleDataError = (
|
|
4663
4670
|
/** @class */
|
|
4664
4671
|
function(_super) {
|
|
@@ -4672,7 +4679,7 @@
|
|
|
4672
4679
|
}(Error)
|
|
4673
4680
|
);
|
|
4674
4681
|
|
|
4675
|
-
//
|
|
4682
|
+
// node_modules/.aspect_rules_js/@formatjs+ecma402-abstract@0.0.0/node_modules/@formatjs/ecma402-abstract/lib/types/date-time.js
|
|
4676
4683
|
var RangePatternType;
|
|
4677
4684
|
(function(RangePatternType2) {
|
|
4678
4685
|
RangePatternType2["startRange"] = "startRange";
|
|
@@ -4680,18 +4687,29 @@
|
|
|
4680
4687
|
RangePatternType2["endRange"] = "endRange";
|
|
4681
4688
|
})(RangePatternType || (RangePatternType = {}));
|
|
4682
4689
|
|
|
4683
|
-
//
|
|
4690
|
+
// packages/intl-relativetimeformat/abstract/InitializeRelativeTimeFormat.ts
|
|
4684
4691
|
var NUMBERING_SYSTEM_REGEX = /^[a-z0-9]{3,8}(-[a-z0-9]{3,8})*$/i;
|
|
4685
|
-
function InitializeRelativeTimeFormat(rtf, locales, options,
|
|
4686
|
-
|
|
4687
|
-
|
|
4692
|
+
function InitializeRelativeTimeFormat(rtf, locales, options, {
|
|
4693
|
+
getInternalSlots: getInternalSlots2,
|
|
4694
|
+
availableLocales,
|
|
4695
|
+
relevantExtensionKeys,
|
|
4696
|
+
localeData,
|
|
4697
|
+
getDefaultLocale
|
|
4698
|
+
}) {
|
|
4699
|
+
const internalSlots = getInternalSlots2(rtf);
|
|
4688
4700
|
internalSlots.initializedRelativeTimeFormat = true;
|
|
4689
|
-
|
|
4690
|
-
|
|
4691
|
-
|
|
4692
|
-
|
|
4701
|
+
const requestedLocales = CanonicalizeLocaleList(locales);
|
|
4702
|
+
const opt = /* @__PURE__ */ Object.create(null);
|
|
4703
|
+
const opts = CoerceOptionsToObject(options);
|
|
4704
|
+
const matcher = GetOption(
|
|
4705
|
+
opts,
|
|
4706
|
+
"localeMatcher",
|
|
4707
|
+
"string",
|
|
4708
|
+
["best fit", "lookup"],
|
|
4709
|
+
"best fit"
|
|
4710
|
+
);
|
|
4693
4711
|
opt.localeMatcher = matcher;
|
|
4694
|
-
|
|
4712
|
+
const numberingSystem = GetOption(
|
|
4695
4713
|
opts,
|
|
4696
4714
|
// @ts-expect-error TS option is wack
|
|
4697
4715
|
"numberingSystem",
|
|
@@ -4701,17 +4719,36 @@
|
|
|
4701
4719
|
);
|
|
4702
4720
|
if (numberingSystem !== void 0) {
|
|
4703
4721
|
if (!NUMBERING_SYSTEM_REGEX.test(numberingSystem)) {
|
|
4704
|
-
throw new RangeError(
|
|
4722
|
+
throw new RangeError(`Invalid numbering system ${numberingSystem}`);
|
|
4705
4723
|
}
|
|
4706
4724
|
}
|
|
4707
4725
|
opt.nu = numberingSystem;
|
|
4708
|
-
|
|
4709
|
-
|
|
4726
|
+
const r = ResolveLocale(
|
|
4727
|
+
availableLocales,
|
|
4728
|
+
requestedLocales,
|
|
4729
|
+
opt,
|
|
4730
|
+
relevantExtensionKeys,
|
|
4731
|
+
localeData,
|
|
4732
|
+
getDefaultLocale
|
|
4733
|
+
);
|
|
4734
|
+
const { locale, nu } = r;
|
|
4710
4735
|
internalSlots.locale = locale;
|
|
4711
|
-
internalSlots.style = GetOption(
|
|
4712
|
-
|
|
4713
|
-
|
|
4714
|
-
|
|
4736
|
+
internalSlots.style = GetOption(
|
|
4737
|
+
opts,
|
|
4738
|
+
"style",
|
|
4739
|
+
"string",
|
|
4740
|
+
["long", "narrow", "short"],
|
|
4741
|
+
"long"
|
|
4742
|
+
);
|
|
4743
|
+
internalSlots.numeric = GetOption(
|
|
4744
|
+
opts,
|
|
4745
|
+
"numeric",
|
|
4746
|
+
"string",
|
|
4747
|
+
["always", "auto"],
|
|
4748
|
+
"always"
|
|
4749
|
+
);
|
|
4750
|
+
const fields = localeData[r.dataLocale];
|
|
4751
|
+
invariant(!!fields, `Missing locale data for ${r.dataLocale}`);
|
|
4715
4752
|
internalSlots.fields = fields;
|
|
4716
4753
|
internalSlots.numberFormat = createMemoizedNumberFormat(locales);
|
|
4717
4754
|
internalSlots.pluralRules = createMemoizedPluralRules(locales);
|
|
@@ -4719,7 +4756,7 @@
|
|
|
4719
4756
|
return rtf;
|
|
4720
4757
|
}
|
|
4721
4758
|
|
|
4722
|
-
//
|
|
4759
|
+
// packages/intl-relativetimeformat/abstract/SingularRelativeTimeUnit.ts
|
|
4723
4760
|
function SingularRelativeTimeUnit(unit) {
|
|
4724
4761
|
invariant(Type(unit) === "String", "unit must be a string");
|
|
4725
4762
|
if (unit === "seconds")
|
|
@@ -4744,21 +4781,19 @@
|
|
|
4744
4781
|
return unit;
|
|
4745
4782
|
}
|
|
4746
4783
|
|
|
4747
|
-
//
|
|
4784
|
+
// packages/intl-relativetimeformat/abstract/MakePartsList.ts
|
|
4748
4785
|
function MakePartsList(pattern, unit, parts) {
|
|
4749
|
-
|
|
4750
|
-
|
|
4751
|
-
for (
|
|
4752
|
-
var patternPart = patternParts_1[_i];
|
|
4786
|
+
const patternParts = PartitionPattern(pattern);
|
|
4787
|
+
const result = [];
|
|
4788
|
+
for (const patternPart of patternParts) {
|
|
4753
4789
|
if (patternPart.type === "literal") {
|
|
4754
4790
|
result.push({
|
|
4755
4791
|
type: "literal",
|
|
4756
4792
|
value: patternPart.value
|
|
4757
4793
|
});
|
|
4758
4794
|
} else {
|
|
4759
|
-
invariant(patternPart.type === "0",
|
|
4760
|
-
for (
|
|
4761
|
-
var part = parts_1[_a];
|
|
4795
|
+
invariant(patternPart.type === "0", `Malformed pattern ${pattern}`);
|
|
4796
|
+
for (const part of parts) {
|
|
4762
4797
|
result.push({
|
|
4763
4798
|
type: part.type,
|
|
4764
4799
|
value: part.value,
|
|
@@ -4770,26 +4805,35 @@
|
|
|
4770
4805
|
return result;
|
|
4771
4806
|
}
|
|
4772
4807
|
|
|
4773
|
-
//
|
|
4774
|
-
function PartitionRelativeTimePattern(rtf, value, unit,
|
|
4775
|
-
|
|
4776
|
-
|
|
4777
|
-
invariant(
|
|
4808
|
+
// packages/intl-relativetimeformat/abstract/PartitionRelativeTimePattern.ts
|
|
4809
|
+
function PartitionRelativeTimePattern(rtf, value, unit, {
|
|
4810
|
+
getInternalSlots: getInternalSlots2
|
|
4811
|
+
}) {
|
|
4812
|
+
invariant(
|
|
4813
|
+
Type(value) === "Number",
|
|
4814
|
+
`value must be number, instead got ${typeof value}`,
|
|
4815
|
+
TypeError
|
|
4816
|
+
);
|
|
4817
|
+
invariant(
|
|
4818
|
+
Type(unit) === "String",
|
|
4819
|
+
`unit must be number, instead got ${typeof value}`,
|
|
4820
|
+
TypeError
|
|
4821
|
+
);
|
|
4778
4822
|
if (isNaN(value) || !isFinite(value)) {
|
|
4779
|
-
throw new RangeError(
|
|
4823
|
+
throw new RangeError(`Invalid value ${value}`);
|
|
4780
4824
|
}
|
|
4781
|
-
|
|
4782
|
-
|
|
4783
|
-
|
|
4825
|
+
const resolvedUnit = SingularRelativeTimeUnit(unit);
|
|
4826
|
+
const { fields, style, numeric, pluralRules, numberFormat } = getInternalSlots2(rtf);
|
|
4827
|
+
let entry = resolvedUnit;
|
|
4784
4828
|
if (style === "short") {
|
|
4785
|
-
entry =
|
|
4829
|
+
entry = `${resolvedUnit}-short`;
|
|
4786
4830
|
} else if (style === "narrow") {
|
|
4787
|
-
entry =
|
|
4831
|
+
entry = `${resolvedUnit}-narrow`;
|
|
4788
4832
|
}
|
|
4789
4833
|
if (!(entry in fields)) {
|
|
4790
4834
|
entry = resolvedUnit;
|
|
4791
4835
|
}
|
|
4792
|
-
|
|
4836
|
+
const patterns = fields[entry];
|
|
4793
4837
|
if (numeric === "auto") {
|
|
4794
4838
|
if (ToString(value) in patterns) {
|
|
4795
4839
|
return [
|
|
@@ -4800,12 +4844,12 @@
|
|
|
4800
4844
|
];
|
|
4801
4845
|
}
|
|
4802
4846
|
}
|
|
4803
|
-
|
|
4847
|
+
let tl = "future";
|
|
4804
4848
|
if (SameValue(value, -0) || value < 0) {
|
|
4805
4849
|
tl = "past";
|
|
4806
4850
|
}
|
|
4807
|
-
|
|
4808
|
-
|
|
4851
|
+
const po = patterns[tl];
|
|
4852
|
+
const fv = typeof numberFormat.formatToParts === "function" ? numberFormat.formatToParts(Math.abs(value)) : (
|
|
4809
4853
|
// TODO: If formatToParts is not supported, we assume the whole formatted
|
|
4810
4854
|
// number is a part
|
|
4811
4855
|
[
|
|
@@ -4816,15 +4860,15 @@
|
|
|
4816
4860
|
}
|
|
4817
4861
|
]
|
|
4818
4862
|
);
|
|
4819
|
-
|
|
4820
|
-
|
|
4863
|
+
const pr = pluralRules.select(value);
|
|
4864
|
+
const pattern = po[pr];
|
|
4821
4865
|
return MakePartsList(pattern, resolvedUnit, fv);
|
|
4822
4866
|
}
|
|
4823
4867
|
|
|
4824
|
-
//
|
|
4868
|
+
// packages/intl-relativetimeformat/get_internal_slots.ts
|
|
4825
4869
|
var internalSlotMap = /* @__PURE__ */ new WeakMap();
|
|
4826
4870
|
function getInternalSlots(x) {
|
|
4827
|
-
|
|
4871
|
+
let internalSlots = internalSlotMap.get(x);
|
|
4828
4872
|
if (!internalSlots) {
|
|
4829
4873
|
internalSlots = /* @__PURE__ */ Object.create(null);
|
|
4830
4874
|
internalSlotMap.set(x, internalSlots);
|
|
@@ -4832,93 +4876,96 @@
|
|
|
4832
4876
|
return internalSlots;
|
|
4833
4877
|
}
|
|
4834
4878
|
|
|
4835
|
-
//
|
|
4836
|
-
var
|
|
4837
|
-
|
|
4838
|
-
|
|
4839
|
-
|
|
4840
|
-
|
|
4841
|
-
if (!newTarget) {
|
|
4842
|
-
throw new TypeError("Intl.RelativeTimeFormat must be called with 'new'");
|
|
4843
|
-
}
|
|
4844
|
-
return InitializeRelativeTimeFormat(this, locales, options, {
|
|
4845
|
-
getInternalSlots,
|
|
4846
|
-
availableLocales: RelativeTimeFormat2.availableLocales,
|
|
4847
|
-
relevantExtensionKeys: RelativeTimeFormat2.relevantExtensionKeys,
|
|
4848
|
-
localeData: RelativeTimeFormat2.localeData,
|
|
4849
|
-
getDefaultLocale: RelativeTimeFormat2.getDefaultLocale
|
|
4850
|
-
});
|
|
4879
|
+
// packages/intl-relativetimeformat/index.ts
|
|
4880
|
+
var _RelativeTimeFormat = class _RelativeTimeFormat {
|
|
4881
|
+
constructor(locales, options) {
|
|
4882
|
+
const newTarget = this && this instanceof _RelativeTimeFormat ? this.constructor : void 0;
|
|
4883
|
+
if (!newTarget) {
|
|
4884
|
+
throw new TypeError("Intl.RelativeTimeFormat must be called with 'new'");
|
|
4851
4885
|
}
|
|
4852
|
-
|
|
4853
|
-
|
|
4854
|
-
|
|
4855
|
-
|
|
4856
|
-
|
|
4857
|
-
|
|
4858
|
-
|
|
4859
|
-
|
|
4860
|
-
|
|
4886
|
+
return InitializeRelativeTimeFormat(this, locales, options, {
|
|
4887
|
+
getInternalSlots,
|
|
4888
|
+
availableLocales: _RelativeTimeFormat.availableLocales,
|
|
4889
|
+
relevantExtensionKeys: _RelativeTimeFormat.relevantExtensionKeys,
|
|
4890
|
+
localeData: _RelativeTimeFormat.localeData,
|
|
4891
|
+
getDefaultLocale: _RelativeTimeFormat.getDefaultLocale
|
|
4892
|
+
});
|
|
4893
|
+
}
|
|
4894
|
+
format(value, unit) {
|
|
4895
|
+
if (typeof this !== "object") {
|
|
4896
|
+
throw new TypeError("format was called on a non-object");
|
|
4897
|
+
}
|
|
4898
|
+
const internalSlots = getInternalSlots(this);
|
|
4899
|
+
if (!internalSlots.initializedRelativeTimeFormat) {
|
|
4900
|
+
throw new TypeError("format was called on a invalid context");
|
|
4901
|
+
}
|
|
4902
|
+
return PartitionRelativeTimePattern(
|
|
4903
|
+
this,
|
|
4904
|
+
Number(value),
|
|
4905
|
+
ToString(unit),
|
|
4906
|
+
{
|
|
4861
4907
|
getInternalSlots
|
|
4862
|
-
}).map(function(el) {
|
|
4863
|
-
return el.value;
|
|
4864
|
-
}).join("");
|
|
4865
|
-
};
|
|
4866
|
-
RelativeTimeFormat2.prototype.formatToParts = function(value, unit) {
|
|
4867
|
-
if (typeof this !== "object") {
|
|
4868
|
-
throw new TypeError("formatToParts was called on a non-object");
|
|
4869
4908
|
}
|
|
4870
|
-
|
|
4871
|
-
|
|
4872
|
-
|
|
4873
|
-
|
|
4874
|
-
|
|
4875
|
-
}
|
|
4876
|
-
|
|
4877
|
-
|
|
4878
|
-
|
|
4879
|
-
|
|
4880
|
-
|
|
4881
|
-
|
|
4882
|
-
|
|
4883
|
-
|
|
4884
|
-
|
|
4885
|
-
|
|
4886
|
-
|
|
4887
|
-
|
|
4888
|
-
|
|
4889
|
-
|
|
4890
|
-
}
|
|
4891
|
-
|
|
4892
|
-
|
|
4909
|
+
).map((el) => el.value).join("");
|
|
4910
|
+
}
|
|
4911
|
+
formatToParts(value, unit) {
|
|
4912
|
+
if (typeof this !== "object") {
|
|
4913
|
+
throw new TypeError("formatToParts was called on a non-object");
|
|
4914
|
+
}
|
|
4915
|
+
const internalSlots = getInternalSlots(this);
|
|
4916
|
+
if (!internalSlots.initializedRelativeTimeFormat) {
|
|
4917
|
+
throw new TypeError("formatToParts was called on a invalid context");
|
|
4918
|
+
}
|
|
4919
|
+
return PartitionRelativeTimePattern(
|
|
4920
|
+
this,
|
|
4921
|
+
Number(value),
|
|
4922
|
+
ToString(unit),
|
|
4923
|
+
{ getInternalSlots }
|
|
4924
|
+
);
|
|
4925
|
+
}
|
|
4926
|
+
resolvedOptions() {
|
|
4927
|
+
if (typeof this !== "object") {
|
|
4928
|
+
throw new TypeError("resolvedOptions was called on a non-object");
|
|
4929
|
+
}
|
|
4930
|
+
const internalSlots = getInternalSlots(this);
|
|
4931
|
+
if (!internalSlots.initializedRelativeTimeFormat) {
|
|
4932
|
+
throw new TypeError("resolvedOptions was called on a invalid context");
|
|
4933
|
+
}
|
|
4934
|
+
return {
|
|
4935
|
+
locale: internalSlots.locale,
|
|
4936
|
+
style: internalSlots.style,
|
|
4937
|
+
numeric: internalSlots.numeric,
|
|
4938
|
+
numberingSystem: internalSlots.numberingSystem
|
|
4893
4939
|
};
|
|
4894
|
-
|
|
4895
|
-
|
|
4896
|
-
|
|
4897
|
-
|
|
4898
|
-
|
|
4899
|
-
|
|
4900
|
-
|
|
4901
|
-
|
|
4902
|
-
|
|
4903
|
-
|
|
4904
|
-
|
|
4905
|
-
|
|
4906
|
-
|
|
4907
|
-
|
|
4940
|
+
}
|
|
4941
|
+
static supportedLocalesOf(locales, options) {
|
|
4942
|
+
return SupportedLocales(
|
|
4943
|
+
_RelativeTimeFormat.availableLocales,
|
|
4944
|
+
CanonicalizeLocaleList(locales),
|
|
4945
|
+
options
|
|
4946
|
+
);
|
|
4947
|
+
}
|
|
4948
|
+
static __addLocaleData(...data2) {
|
|
4949
|
+
for (const { data: d, locale } of data2) {
|
|
4950
|
+
const minimizedLocale = new Intl.Locale(locale).minimize().toString();
|
|
4951
|
+
_RelativeTimeFormat.localeData[locale] = _RelativeTimeFormat.localeData[minimizedLocale] = d;
|
|
4952
|
+
_RelativeTimeFormat.availableLocales.add(minimizedLocale);
|
|
4953
|
+
_RelativeTimeFormat.availableLocales.add(locale);
|
|
4954
|
+
if (!_RelativeTimeFormat.__defaultLocale) {
|
|
4955
|
+
_RelativeTimeFormat.__defaultLocale = minimizedLocale;
|
|
4908
4956
|
}
|
|
4909
|
-
}
|
|
4910
|
-
|
|
4911
|
-
|
|
4912
|
-
|
|
4913
|
-
|
|
4914
|
-
|
|
4915
|
-
|
|
4916
|
-
|
|
4917
|
-
|
|
4918
|
-
|
|
4919
|
-
|
|
4920
|
-
|
|
4921
|
-
var lib_default = RelativeTimeFormat;
|
|
4957
|
+
}
|
|
4958
|
+
}
|
|
4959
|
+
static getDefaultLocale() {
|
|
4960
|
+
return _RelativeTimeFormat.__defaultLocale;
|
|
4961
|
+
}
|
|
4962
|
+
};
|
|
4963
|
+
__publicField(_RelativeTimeFormat, "localeData", {});
|
|
4964
|
+
__publicField(_RelativeTimeFormat, "availableLocales", /* @__PURE__ */ new Set());
|
|
4965
|
+
__publicField(_RelativeTimeFormat, "__defaultLocale", "");
|
|
4966
|
+
__publicField(_RelativeTimeFormat, "relevantExtensionKeys", ["nu"]);
|
|
4967
|
+
__publicField(_RelativeTimeFormat, "polyfilled", true);
|
|
4968
|
+
var RelativeTimeFormat = _RelativeTimeFormat;
|
|
4922
4969
|
try {
|
|
4923
4970
|
if (typeof Symbol !== "undefined") {
|
|
4924
4971
|
Object.defineProperty(RelativeTimeFormat.prototype, Symbol.toStringTag, {
|
|
@@ -4943,15 +4990,15 @@
|
|
|
4943
4990
|
} catch (e) {
|
|
4944
4991
|
}
|
|
4945
4992
|
|
|
4946
|
-
//
|
|
4993
|
+
// packages/intl-relativetimeformat/supported-locales.generated.ts
|
|
4947
4994
|
var supportedLocales = ["af", "af-NA", "agq", "ak", "am", "ar", "ar-AE", "ar-BH", "ar-DJ", "ar-DZ", "ar-EG", "ar-EH", "ar-ER", "ar-IL", "ar-IQ", "ar-JO", "ar-KM", "ar-KW", "ar-LB", "ar-LY", "ar-MA", "ar-MR", "ar-OM", "ar-PS", "ar-QA", "ar-SA", "ar-SD", "ar-SO", "ar-SS", "ar-SY", "ar-TD", "ar-TN", "ar-YE", "as", "asa", "ast", "az", "az-Cyrl", "az-Latn", "bas", "be", "be-tarask", "bem", "bez", "bg", "bm", "bn", "bn-IN", "bo", "bo-IN", "br", "brx", "bs", "bs-Cyrl", "bs-Latn", "ca", "ca-AD", "ca-ES-valencia", "ca-FR", "ca-IT", "ccp", "ccp-IN", "ce", "ceb", "cgg", "chr", "ckb", "ckb-IR", "cs", "cy", "da", "da-GL", "dav", "de", "de-AT", "de-BE", "de-CH", "de-IT", "de-LI", "de-LU", "dje", "doi", "dsb", "dua", "dyo", "dz", "ebu", "ee", "ee-TG", "el", "el-CY", "en", "en-001", "en-150", "en-AE", "en-AG", "en-AI", "en-AS", "en-AT", "en-AU", "en-BB", "en-BE", "en-BI", "en-BM", "en-BS", "en-BW", "en-BZ", "en-CA", "en-CC", "en-CH", "en-CK", "en-CM", "en-CX", "en-CY", "en-DE", "en-DG", "en-DK", "en-DM", "en-ER", "en-FI", "en-FJ", "en-FK", "en-FM", "en-GB", "en-GD", "en-GG", "en-GH", "en-GI", "en-GM", "en-GU", "en-GY", "en-HK", "en-IE", "en-IL", "en-IM", "en-IN", "en-IO", "en-JE", "en-JM", "en-KE", "en-KI", "en-KN", "en-KY", "en-LC", "en-LR", "en-LS", "en-MG", "en-MH", "en-MO", "en-MP", "en-MS", "en-MT", "en-MU", "en-MW", "en-MY", "en-NA", "en-NF", "en-NG", "en-NL", "en-NR", "en-NU", "en-NZ", "en-PG", "en-PH", "en-PK", "en-PN", "en-PR", "en-PW", "en-RW", "en-SB", "en-SC", "en-SD", "en-SE", "en-SG", "en-SH", "en-SI", "en-SL", "en-SS", "en-SX", "en-SZ", "en-TC", "en-TK", "en-TO", "en-TT", "en-TV", "en-TZ", "en-UG", "en-UM", "en-VC", "en-VG", "en-VI", "en-VU", "en-WS", "en-ZA", "en-ZM", "en-ZW", "eo", "es", "es-419", "es-AR", "es-BO", "es-BR", "es-BZ", "es-CL", "es-CO", "es-CR", "es-CU", "es-DO", "es-EA", "es-EC", "es-GQ", "es-GT", "es-HN", "es-IC", "es-MX", "es-NI", "es-PA", "es-PE", "es-PH", "es-PR", "es-PY", "es-SV", "es-US", "es-UY", "es-VE", "et", "eu", "ewo", "fa", "fa-AF", "ff", "ff-Adlm", "ff-Adlm-BF", "ff-Adlm-CM", "ff-Adlm-GH", "ff-Adlm-GM", "ff-Adlm-GW", "ff-Adlm-LR", "ff-Adlm-MR", "ff-Adlm-NE", "ff-Adlm-NG", "ff-Adlm-SL", "ff-Adlm-SN", "ff-Latn", "ff-Latn-BF", "ff-Latn-CM", "ff-Latn-GH", "ff-Latn-GM", "ff-Latn-GN", "ff-Latn-GW", "ff-Latn-LR", "ff-Latn-MR", "ff-Latn-NE", "ff-Latn-NG", "ff-Latn-SL", "fi", "fil", "fo", "fo-DK", "fr", "fr-BE", "fr-BF", "fr-BI", "fr-BJ", "fr-BL", "fr-CA", "fr-CD", "fr-CF", "fr-CG", "fr-CH", "fr-CI", "fr-CM", "fr-DJ", "fr-DZ", "fr-GA", "fr-GF", "fr-GN", "fr-GP", "fr-GQ", "fr-HT", "fr-KM", "fr-LU", "fr-MA", "fr-MC", "fr-MF", "fr-MG", "fr-ML", "fr-MQ", "fr-MR", "fr-MU", "fr-NC", "fr-NE", "fr-PF", "fr-PM", "fr-RE", "fr-RW", "fr-SC", "fr-SN", "fr-SY", "fr-TD", "fr-TG", "fr-TN", "fr-VU", "fr-WF", "fr-YT", "fur", "fy", "ga", "ga-GB", "gd", "gl", "gsw", "gsw-FR", "gsw-LI", "gu", "guz", "gv", "ha", "ha-GH", "ha-NE", "haw", "he", "hi", "hr", "hr-BA", "hsb", "hu", "hy", "ia", "id", "ig", "ii", "is", "it", "it-CH", "it-SM", "it-VA", "ja", "jgo", "jmc", "jv", "ka", "kab", "kam", "kde", "kea", "kgp", "khq", "ki", "kk", "kkj", "kl", "kln", "km", "kn", "ko", "ko-KP", "kok", "ks", "ks-Arab", "ksb", "ksf", "ksh", "ku", "kw", "ky", "lag", "lb", "lg", "lkt", "ln", "ln-AO", "ln-CF", "ln-CG", "lo", "lrc", "lrc-IQ", "lt", "lu", "luo", "luy", "lv", "mai", "mas", "mas-TZ", "mer", "mfe", "mg", "mgh", "mgo", "mi", "mk", "ml", "mn", "mni", "mni-Beng", "mr", "ms", "ms-BN", "ms-ID", "ms-SG", "mt", "mua", "my", "mzn", "naq", "nb", "nb-SJ", "nd", "nds", "nds-NL", "ne", "ne-IN", "nl", "nl-AW", "nl-BE", "nl-BQ", "nl-CW", "nl-SR", "nl-SX", "nmg", "nn", "nnh", "no", "nus", "nyn", "om", "om-KE", "or", "os", "os-RU", "pa", "pa-Arab", "pa-Guru", "pcm", "pl", "ps", "ps-PK", "pt", "pt-AO", "pt-CH", "pt-CV", "pt-GQ", "pt-GW", "pt-LU", "pt-MO", "pt-MZ", "pt-PT", "pt-ST", "pt-TL", "qu", "qu-BO", "qu-EC", "rm", "rn", "ro", "ro-MD", "rof", "ru", "ru-BY", "ru-KG", "ru-KZ", "ru-MD", "ru-UA", "rw", "rwk", "sa", "sah", "saq", "sat", "sat-Olck", "sbp", "sc", "sd", "sd-Arab", "sd-Deva", "se", "se-FI", "se-SE", "seh", "ses", "sg", "shi", "shi-Latn", "shi-Tfng", "si", "sk", "sl", "smn", "sn", "so", "so-DJ", "so-ET", "so-KE", "sq", "sq-MK", "sq-XK", "sr", "sr-Cyrl", "sr-Cyrl-BA", "sr-Cyrl-ME", "sr-Cyrl-XK", "sr-Latn", "sr-Latn-BA", "sr-Latn-ME", "sr-Latn-XK", "su", "su-Latn", "sv", "sv-AX", "sv-FI", "sw", "sw-CD", "sw-KE", "sw-UG", "ta", "ta-LK", "ta-MY", "ta-SG", "te", "teo", "teo-KE", "tg", "th", "ti", "ti-ER", "tk", "to", "tr", "tr-CY", "tt", "twq", "tzm", "ug", "uk", "und", "ur", "ur-IN", "uz", "uz-Arab", "uz-Cyrl", "uz-Latn", "vai", "vai-Latn", "vai-Vaii", "vi", "vun", "wae", "wo", "xh", "xog", "yav", "yi", "yo", "yo-BJ", "yrl", "yrl-CO", "yrl-VE", "yue", "yue-Hans", "yue-Hant", "zgh", "zh", "zh-Hans", "zh-Hans-HK", "zh-Hans-MO", "zh-Hans-SG", "zh-Hant", "zh-Hant-HK", "zh-Hant-MO", "zu"];
|
|
4948
4995
|
|
|
4949
|
-
//
|
|
4996
|
+
// packages/intl-relativetimeformat/should-polyfill.ts
|
|
4950
4997
|
function supportedLocalesOf(locale) {
|
|
4951
4998
|
if (!locale) {
|
|
4952
4999
|
return true;
|
|
4953
5000
|
}
|
|
4954
|
-
|
|
5001
|
+
const locales = Array.isArray(locale) ? locale : [locale];
|
|
4955
5002
|
return Intl.RelativeTimeFormat.supportedLocalesOf(locales).length === locales.length;
|
|
4956
5003
|
}
|
|
4957
5004
|
function hasResolvedOptionsNumberingSystem(locale) {
|
|
@@ -4963,19 +5010,16 @@
|
|
|
4963
5010
|
return false;
|
|
4964
5011
|
}
|
|
4965
5012
|
}
|
|
4966
|
-
function shouldPolyfill(locale) {
|
|
4967
|
-
if (locale === void 0) {
|
|
4968
|
-
locale = "en";
|
|
4969
|
-
}
|
|
5013
|
+
function shouldPolyfill(locale = "en") {
|
|
4970
5014
|
if (!("RelativeTimeFormat" in Intl) || !supportedLocalesOf(locale) || !hasResolvedOptionsNumberingSystem(locale)) {
|
|
4971
5015
|
return match([locale], supportedLocales, "en");
|
|
4972
5016
|
}
|
|
4973
5017
|
}
|
|
4974
5018
|
|
|
4975
|
-
//
|
|
5019
|
+
// packages/intl-relativetimeformat/polyfill.ts
|
|
4976
5020
|
if (shouldPolyfill()) {
|
|
4977
5021
|
Object.defineProperty(Intl, "RelativeTimeFormat", {
|
|
4978
|
-
value:
|
|
5022
|
+
value: RelativeTimeFormat,
|
|
4979
5023
|
writable: true,
|
|
4980
5024
|
enumerable: false,
|
|
4981
5025
|
configurable: true
|
package/should-polyfill.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.shouldPolyfill =
|
|
3
|
+
exports.shouldPolyfill = shouldPolyfill;
|
|
4
4
|
var intl_localematcher_1 = require("@formatjs/intl-localematcher");
|
|
5
5
|
var supported_locales_generated_1 = require("./supported-locales.generated");
|
|
6
6
|
function supportedLocalesOf(locale) {
|
|
@@ -30,4 +30,3 @@ function shouldPolyfill(locale) {
|
|
|
30
30
|
return (0, intl_localematcher_1.match)([locale], supported_locales_generated_1.supportedLocales, 'en');
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
exports.shouldPolyfill = shouldPolyfill;
|