@js-joda/locale_sv 4.8.6 → 4.8.11

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/dist/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- //! @version @js-joda/locale - 4.8.5
1
+ //! @version @js-joda/locale - 4.8.10
2
2
  //! @copyright (c) 2015-present, Philipp Thürwächter, Pattrick Hüper & js-joda contributors
3
3
  //! @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos
4
4
  //! @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
@@ -6,39 +6,31 @@
6
6
  import { IllegalArgumentException, DateTimeFormatterBuilder, SignStyle, TextStyle, ChronoField, IsoFields, _, TemporalQueries, ZoneOffset, ZoneRulesProvider, ZoneId, ValueRange, DayOfWeek, ChronoUnit, IllegalStateException, LocalDate, Year, ResolverStyle, DateTimeException, IsoChronology, TemporalField, DateTimeFormatter, use } from '@js-joda/core';
7
7
 
8
8
  function _extends() {
9
- _extends = Object.assign || function (target) {
9
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
10
10
  for (var i = 1; i < arguments.length; i++) {
11
11
  var source = arguments[i];
12
-
13
12
  for (var key in source) {
14
13
  if (Object.prototype.hasOwnProperty.call(source, key)) {
15
14
  target[key] = source[key];
16
15
  }
17
16
  }
18
17
  }
19
-
20
18
  return target;
21
19
  };
22
-
23
20
  return _extends.apply(this, arguments);
24
21
  }
25
-
26
22
  function _inheritsLoose(subClass, superClass) {
27
23
  subClass.prototype = Object.create(superClass.prototype);
28
24
  subClass.prototype.constructor = subClass;
29
-
30
25
  _setPrototypeOf(subClass, superClass);
31
26
  }
32
-
33
27
  function _setPrototypeOf(o, p) {
34
- _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
28
+ _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
35
29
  o.__proto__ = p;
36
30
  return o;
37
31
  };
38
-
39
32
  return _setPrototypeOf(o, p);
40
33
  }
41
-
42
34
  function _unsupportedIterableToArray(o, minLen) {
43
35
  if (!o) return;
44
36
  if (typeof o === "string") return _arrayLikeToArray(o, minLen);
@@ -47,19 +39,14 @@ function _unsupportedIterableToArray(o, minLen) {
47
39
  if (n === "Map" || n === "Set") return Array.from(o);
48
40
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
49
41
  }
50
-
51
42
  function _arrayLikeToArray(arr, len) {
52
43
  if (len == null || len > arr.length) len = arr.length;
53
-
54
44
  for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
55
-
56
45
  return arr2;
57
46
  }
58
-
59
47
  function _createForOfIteratorHelperLoose(o, allowArrayLike) {
60
48
  var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
61
49
  if (it) return (it = it.call(o)).next.bind(it);
62
-
63
50
  if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
64
51
  if (it) o = it;
65
52
  var i = 0;
@@ -73,7 +60,6 @@ function _createForOfIteratorHelperLoose(o, allowArrayLike) {
73
60
  };
74
61
  };
75
62
  }
76
-
77
63
  throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
78
64
  }
79
65
 
@@ -83,83 +69,61 @@ var TextPrinterParser = function () {
83
69
  this._textStyle = textStyle;
84
70
  this._provider = provider;
85
71
  }
86
-
87
72
  var _proto = TextPrinterParser.prototype;
88
-
89
73
  _proto.field = function field() {
90
74
  return this._field;
91
75
  };
92
-
93
76
  _proto.textStyle = function textStyle() {
94
77
  return this._textStyle;
95
78
  };
96
-
97
79
  _proto.provider = function provider() {
98
80
  return this._provider;
99
81
  };
100
-
101
82
  _proto.print = function print(context, buf) {
102
83
  var value = context.getValue(this._field);
103
-
104
84
  if (value === null) {
105
85
  return false;
106
86
  }
107
-
108
87
  var text = this._provider.getText(this._field, value, this._textStyle, context.locale());
109
-
110
88
  if (text === null) {
111
89
  return this._numberPrinterParser().print(context, buf);
112
90
  }
113
-
114
91
  buf.append(text);
115
92
  return true;
116
93
  };
117
-
118
94
  _proto.parse = function parse(context, parseText, position) {
119
95
  var length = parseText.length;
120
-
121
96
  if (position < 0 || position > length) {
122
97
  throw new IllegalArgumentException("The position is invalid: " + position);
123
98
  }
124
-
125
99
  var style = context.isStrict() ? this._textStyle : null;
126
-
127
100
  var it = this._provider.getTextIterator(this._field, style, context.locale());
128
-
129
101
  if (it != null) {
130
102
  for (var _iterator = _createForOfIteratorHelperLoose(it), _step; !(_step = _iterator()).done;) {
131
103
  var entry = _step.value;
132
104
  var itText = entry.key;
133
-
134
105
  if (context.subSequenceEquals(itText, 0, parseText, position, itText.length)) {
135
106
  return context.setParsedField(this._field, entry.value, position, position + itText.length);
136
107
  }
137
108
  }
138
-
139
109
  if (context.isStrict()) {
140
110
  return ~position;
141
111
  }
142
112
  }
143
-
144
113
  return this._numberPrinterParser().parse(context, parseText, position);
145
114
  };
146
-
147
115
  _proto._numberPrinterParser = function _numberPrinterParser() {
148
116
  if (this._currentNumberPrinterParser == null) {
149
117
  this._currentNumberPrinterParser = new DateTimeFormatterBuilder.NumberPrinterParser(this._field, 1, 19, SignStyle.NORMAL);
150
118
  }
151
-
152
119
  return this._currentNumberPrinterParser;
153
120
  };
154
-
155
121
  _proto.toString = function toString() {
156
122
  if (this._textStyle === TextStyle.FULL) {
157
123
  return "Text(" + this._field + ")";
158
124
  }
159
-
160
125
  return "Text(" + this._field + "," + this._textStyle + ")";
161
126
  };
162
-
163
127
  return TextPrinterParser;
164
128
  }();
165
129
 
@@ -18083,8 +18047,7 @@ function cldrData(path) {
18083
18047
  /*
18084
18048
  * @copyright (c) 2017, Philipp Thuerwaechter & Pattrick Hueper
18085
18049
  * @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
18086
- */
18087
- var createEntry = function createEntry(text, field) {
18050
+ */var createEntry = function createEntry(text, field) {
18088
18051
  return {
18089
18052
  key: text,
18090
18053
  value: field,
@@ -18093,11 +18056,9 @@ var createEntry = function createEntry(text, field) {
18093
18056
  }
18094
18057
  };
18095
18058
  };
18096
-
18097
18059
  var _comparator = function _comparator(obj1, obj2) {
18098
18060
  return obj2.key.length - obj1.key.length;
18099
18061
  };
18100
-
18101
18062
  var LocaleStore = function () {
18102
18063
  function LocaleStore(valueTextMap) {
18103
18064
  this._valueTextMap = valueTextMap;
@@ -18108,7 +18069,6 @@ var LocaleStore = function () {
18108
18069
  var list = [];
18109
18070
  Object.keys(valueTextMap[style]).forEach(function (key) {
18110
18071
  var value = valueTextMap[style][key];
18111
-
18112
18072
  if (reverse[value] === undefined) {
18113
18073
  reverse[value] = createEntry(value, parseInt(key));
18114
18074
  list.push(reverse[value]);
@@ -18122,25 +18082,35 @@ var LocaleStore = function () {
18122
18082
  allList.sort(_comparator);
18123
18083
  this._parsable = map;
18124
18084
  }
18125
-
18126
18085
  var _proto = LocaleStore.prototype;
18127
-
18128
18086
  _proto.getText = function getText(value, style) {
18129
18087
  var map = this._valueTextMap[style];
18130
18088
  return map != null ? map[value] : null;
18131
18089
  };
18132
-
18133
18090
  _proto.getTextIterator = function getTextIterator(style) {
18134
18091
  var list = this._parsable[style];
18135
18092
  return list != null ? list[Symbol.iterator]() : null;
18136
18093
  };
18137
-
18138
18094
  return LocaleStore;
18139
18095
  }();
18140
18096
 
18141
18097
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
18142
18098
 
18143
- var cldr = {exports: {}};
18099
+ function getDefaultExportFromCjs (x) {
18100
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
18101
+ }
18102
+
18103
+ var node_mainExports = {};
18104
+ var node_main = {
18105
+ get exports(){ return node_mainExports; },
18106
+ set exports(v){ node_mainExports = v; },
18107
+ };
18108
+
18109
+ var cldrExports = {};
18110
+ var cldr = {
18111
+ get exports(){ return cldrExports; },
18112
+ set exports(v){ cldrExports = v; },
18113
+ };
18144
18114
 
18145
18115
  /**
18146
18116
  * CLDR JavaScript Library v0.5.4
@@ -18154,616 +18124,1090 @@ var cldr = {exports: {}};
18154
18124
  */
18155
18125
 
18156
18126
  (function (module) {
18157
- /*!
18158
- * CLDR JavaScript Library v0.5.4 2020-10-22T15:56Z MIT license © Rafael Xavier
18159
- * http://git.io/h4lmVg
18160
- */
18161
- (function (root, factory) {
18162
- {
18163
- // Node. CommonJS.
18164
- module.exports = factory();
18165
- }
18166
- })(commonjsGlobal, function () {
18167
- var arrayIsArray = Array.isArray || function (obj) {
18168
- return Object.prototype.toString.call(obj) === "[object Array]";
18169
- };
18170
-
18171
- var pathNormalize = function (path, attributes) {
18172
- if (arrayIsArray(path)) {
18173
- path = path.join("/");
18174
- }
18175
-
18176
- if (typeof path !== "string") {
18177
- throw new Error("invalid path \"" + path + "\"");
18178
- } // 1: Ignore leading slash `/`
18179
- // 2: Ignore leading `cldr/`
18180
-
18181
-
18182
- path = path.replace(/^\//, "")
18183
- /* 1 */
18184
- .replace(/^cldr\//, "");
18185
- /* 2 */
18186
- // Replace {attribute}'s
18187
-
18188
- path = path.replace(/{[a-zA-Z]+}/g, function (name) {
18189
- name = name.replace(/^{([^}]*)}$/, "$1");
18190
- return attributes[name];
18191
- });
18192
- return path.split("/");
18193
- };
18194
-
18195
- var arraySome = function (array, callback) {
18196
- var i, length;
18197
-
18198
- if (array.some) {
18199
- return array.some(callback);
18200
- }
18201
-
18202
- for (i = 0, length = array.length; i < length; i++) {
18203
- if (callback(array[i], i, array)) {
18204
- return true;
18205
- }
18206
- }
18207
-
18208
- return false;
18209
- };
18210
- /**
18211
- * Return the maximized language id as defined in
18212
- * http://www.unicode.org/reports/tr35/#Likely_Subtags
18213
- * 1. Canonicalize.
18214
- * 1.1 Make sure the input locale is in canonical form: uses the right
18215
- * separator, and has the right casing.
18216
- * TODO Right casing? What df? It seems languages are lowercase, scripts are
18217
- * Capitalized, territory is uppercase. I am leaving this as an exercise to
18218
- * the user.
18219
- *
18220
- * 1.2 Replace any deprecated subtags with their canonical values using the
18221
- * <alias> data in supplemental metadata. Use the first value in the
18222
- * replacement list, if it exists. Language tag replacements may have multiple
18223
- * parts, such as "sh" ➞ "sr_Latn" or mo" ➞ "ro_MD". In such a case, the
18224
- * original script and/or region are retained if there is one. Thus
18225
- * "sh_Arab_AQ" ➞ "sr_Arab_AQ", not "sr_Latn_AQ".
18226
- * TODO What <alias> data?
18227
- *
18228
- * 1.3 If the tag is grandfathered (see <variable id="$grandfathered"
18229
- * type="choice"> in the supplemental data), then return it.
18230
- * TODO grandfathered?
18231
- *
18232
- * 1.4 Remove the script code 'Zzzz' and the region code 'ZZ' if they occur.
18233
- * 1.5 Get the components of the cleaned-up source tag (languages, scripts,
18234
- * and regions), plus any variants and extensions.
18235
- * 2. Lookup. Lookup each of the following in order, and stop on the first
18236
- * match:
18237
- * 2.1 languages_scripts_regions
18238
- * 2.2 languages_regions
18239
- * 2.3 languages_scripts
18240
- * 2.4 languages
18241
- * 2.5 und_scripts
18242
- * 3. Return
18243
- * 3.1 If there is no match, either return an error value, or the match for
18244
- * "und" (in APIs where a valid language tag is required).
18245
- * 3.2 Otherwise there is a match = languagem_scriptm_regionm
18246
- * 3.3 Let xr = xs if xs is not empty, and xm otherwise.
18247
- * 3.4 Return the language tag composed of languager _ scriptr _ regionr +
18248
- * variants + extensions.
18249
- *
18250
- * @subtags [Array] normalized language id subtags tuple (see init.js).
18251
- */
18252
-
18253
-
18254
- var coreLikelySubtags = function (Cldr, cldr, subtags, options) {
18255
- var match,
18256
- matchFound,
18257
- language = subtags[0],
18258
- script = subtags[1],
18259
- sep = Cldr.localeSep,
18260
- territory = subtags[2],
18261
- variants = subtags.slice(3, 4);
18262
- options = options || {}; // Skip if (language, script, territory) is not empty [3.3]
18263
-
18264
- if (language !== "und" && script !== "Zzzz" && territory !== "ZZ") {
18265
- return [language, script, territory].concat(variants);
18266
- } // Skip if no supplemental likelySubtags data is present
18267
-
18268
-
18269
- if (typeof cldr.get("supplemental/likelySubtags") === "undefined") {
18270
- return;
18271
- } // [2]
18272
-
18273
-
18274
- matchFound = arraySome([[language, script, territory], [language, territory], [language, script], [language], ["und", script]], function (test) {
18275
- return match = !/\b(Zzzz|ZZ)\b/.test(test.join(sep))
18276
- /* [1.4] */
18277
- && cldr.get(["supplemental/likelySubtags", test.join(sep)]);
18278
- }); // [3]
18279
-
18280
- if (matchFound) {
18281
- // [3.2 .. 3.4]
18282
- match = match.split(sep);
18283
- return [language !== "und" ? language : match[0], script !== "Zzzz" ? script : match[1], territory !== "ZZ" ? territory : match[2]].concat(variants);
18284
- } else if (options.force) {
18285
- // [3.1.2]
18286
- return cldr.get("supplemental/likelySubtags/und").split(sep);
18287
- } else {
18288
- // [3.1.1]
18289
- return;
18290
- }
18291
- };
18292
- /**
18293
- * Given a locale, remove any fields that Add Likely Subtags would add.
18294
- * http://www.unicode.org/reports/tr35/#Likely_Subtags
18295
- * 1. First get max = AddLikelySubtags(inputLocale). If an error is signaled,
18296
- * return it.
18297
- * 2. Remove the variants from max.
18298
- * 3. Then for trial in {language, language _ region, language _ script}. If
18299
- * AddLikelySubtags(trial) = max, then return trial + variants.
18300
- * 4. If you do not get a match, return max + variants.
18301
- *
18302
- * @maxLanguageId [Array] maxLanguageId tuple (see init.js).
18303
- */
18304
-
18305
-
18306
- var coreRemoveLikelySubtags = function (Cldr, cldr, maxLanguageId) {
18307
- var match,
18308
- matchFound,
18309
- language = maxLanguageId[0],
18310
- script = maxLanguageId[1],
18311
- territory = maxLanguageId[2],
18312
- variants = maxLanguageId[3]; // [3]
18313
-
18314
- matchFound = arraySome([[[language, "Zzzz", "ZZ"], [language]], [[language, "Zzzz", territory], [language, territory]], [[language, script, "ZZ"], [language, script]]], function (test) {
18315
- var result = coreLikelySubtags(Cldr, cldr, test[0]);
18316
- match = test[1];
18317
- return result && result[0] === maxLanguageId[0] && result[1] === maxLanguageId[1] && result[2] === maxLanguageId[2];
18318
- });
18319
-
18320
- if (matchFound) {
18321
- if (variants) {
18322
- match.push(variants);
18323
- }
18324
-
18325
- return match;
18326
- } // [4]
18327
-
18328
-
18329
- return maxLanguageId;
18330
- };
18331
- /**
18332
- * subtags( locale )
18333
- *
18334
- * @locale [String]
18335
- */
18336
-
18337
-
18338
- var coreSubtags = function (locale) {
18339
- var aux,
18340
- unicodeLanguageId,
18341
- subtags = [];
18342
- locale = locale.replace(/_/, "-"); // Unicode locale extensions.
18343
-
18344
- aux = locale.split("-u-");
18345
-
18346
- if (aux[1]) {
18347
- aux[1] = aux[1].split("-t-");
18348
- locale = aux[0] + (aux[1][1] ? "-t-" + aux[1][1] : "");
18349
- subtags[4
18350
- /* unicodeLocaleExtensions */
18351
- ] = aux[1][0];
18352
- } // TODO normalize transformed extensions. Currently, skipped.
18353
- // subtags[ x ] = locale.split( "-t-" )[ 1 ];
18354
-
18355
-
18356
- unicodeLanguageId = locale.split("-t-")[0]; // unicode_language_id = "root"
18357
- // | unicode_language_subtag
18358
- // (sep unicode_script_subtag)?
18359
- // (sep unicode_region_subtag)?
18360
- // (sep unicode_variant_subtag)* ;
18361
- //
18362
- // Although unicode_language_subtag = alpha{2,8}, I'm using alpha{2,3}. Because, there's no language on CLDR lengthier than 3.
18363
-
18364
- aux = unicodeLanguageId.match(/^(([a-z]{2,3})(-([A-Z][a-z]{3}))?(-([A-Z]{2}|[0-9]{3}))?)((-([a-zA-Z0-9]{5,8}|[0-9][a-zA-Z0-9]{3}))*)$|^(root)$/);
18365
-
18366
- if (aux === null) {
18367
- return ["und", "Zzzz", "ZZ"];
18368
- }
18369
-
18370
- subtags[0
18371
- /* language */
18372
- ] = aux[10]
18373
- /* root */
18374
- || aux[2] || "und";
18375
- subtags[1
18376
- /* script */
18377
- ] = aux[4] || "Zzzz";
18378
- subtags[2
18379
- /* territory */
18380
- ] = aux[6] || "ZZ";
18381
-
18382
- if (aux[7] && aux[7].length) {
18383
- subtags[3
18384
- /* variant */
18385
- ] = aux[7].slice(1)
18386
- /* remove leading "-" */
18387
- ;
18388
- } // 0: language
18389
- // 1: script
18390
- // 2: territory (aka region)
18391
- // 3: variant
18392
- // 4: unicodeLocaleExtensions
18393
-
18394
-
18395
- return subtags;
18396
- };
18397
-
18398
- var arrayForEach = function (array, callback) {
18399
- var i, length;
18400
-
18401
- if (array.forEach) {
18402
- return array.forEach(callback);
18403
- }
18404
-
18405
- for (i = 0, length = array.length; i < length; i++) {
18406
- callback(array[i], i, array);
18407
- }
18408
- };
18409
- /**
18410
- * bundleLookup( minLanguageId )
18411
- *
18412
- * @Cldr [Cldr class]
18413
- *
18414
- * @cldr [Cldr instance]
18415
- *
18416
- * @minLanguageId [String] requested languageId after applied remove likely subtags.
18417
- */
18418
-
18419
-
18420
- var bundleLookup = function (Cldr, cldr, minLanguageId) {
18421
- var availableBundleMap = Cldr._availableBundleMap,
18422
- availableBundleMapQueue = Cldr._availableBundleMapQueue;
18423
-
18424
- if (availableBundleMapQueue.length) {
18425
- arrayForEach(availableBundleMapQueue, function (bundle, i) {
18426
- var existing, maxBundle, minBundle, subtags;
18427
- subtags = coreSubtags(bundle);
18428
- maxBundle = coreLikelySubtags(Cldr, cldr, subtags);
18429
-
18430
- if (maxBundle === undefined) {
18431
- availableBundleMapQueue.splice(i, 1);
18432
- throw new Error("Could not find likelySubtags for " + bundle);
18433
- }
18434
-
18435
- minBundle = coreRemoveLikelySubtags(Cldr, cldr, maxBundle);
18436
- minBundle = minBundle.join(Cldr.localeSep);
18437
- existing = availableBundleMap[minBundle];
18438
-
18439
- if (existing && existing.length < bundle.length) {
18440
- return;
18441
- }
18442
-
18443
- availableBundleMap[minBundle] = bundle;
18444
- });
18445
- Cldr._availableBundleMapQueue = [];
18446
- }
18447
-
18448
- return availableBundleMap[minLanguageId] || null;
18449
- };
18450
-
18451
- var objectKeys = function (object) {
18452
- var i,
18453
- result = [];
18454
-
18455
- if (Object.keys) {
18456
- return Object.keys(object);
18457
- }
18458
-
18459
- for (i in object) {
18460
- result.push(i);
18461
- }
18462
-
18463
- return result;
18464
- };
18465
-
18466
- var createError = function (code, attributes) {
18467
- var error, message;
18468
- message = code + (attributes && JSON ? ": " + JSON.stringify(attributes) : "");
18469
- error = new Error(message);
18470
- error.code = code; // extend( error, attributes );
18471
-
18472
- arrayForEach(objectKeys(attributes), function (attribute) {
18473
- error[attribute] = attributes[attribute];
18474
- });
18475
- return error;
18476
- };
18477
-
18478
- var validate = function (code, check, attributes) {
18479
- if (!check) {
18480
- throw createError(code, attributes);
18481
- }
18482
- };
18483
-
18484
- var validatePresence = function (value, name) {
18485
- validate("E_MISSING_PARAMETER", typeof value !== "undefined", {
18486
- name: name
18487
- });
18488
- };
18489
-
18490
- var validateType = function (value, name, check, expected) {
18491
- validate("E_INVALID_PAR_TYPE", check, {
18492
- expected: expected,
18493
- name: name,
18494
- value: value
18495
- });
18496
- };
18497
-
18498
- var validateTypePath = function (value, name) {
18499
- validateType(value, name, typeof value === "string" || arrayIsArray(value), "String or Array");
18500
- };
18501
- /**
18502
- * Function inspired by jQuery Core, but reduced to our use case.
18503
- */
18504
-
18505
-
18506
- var isPlainObject = function (obj) {
18507
- return obj !== null && "" + obj === "[object Object]";
18508
- };
18509
-
18510
- var validateTypePlainObject = function (value, name) {
18511
- validateType(value, name, typeof value === "undefined" || isPlainObject(value), "Plain Object");
18512
- };
18513
-
18514
- var validateTypeString = function (value, name) {
18515
- validateType(value, name, typeof value === "string", "a string");
18516
- }; // @path: normalized path
18517
-
18518
-
18519
- var resourceGet = function (data, path) {
18520
- var i,
18521
- node = data,
18522
- length = path.length;
18523
-
18524
- for (i = 0; i < length - 1; i++) {
18525
- node = node[path[i]];
18526
-
18527
- if (!node) {
18528
- return undefined;
18529
- }
18530
- }
18531
-
18532
- return node[path[i]];
18533
- };
18534
- /**
18535
- * setAvailableBundles( Cldr, json )
18536
- *
18537
- * @Cldr [Cldr class]
18538
- *
18539
- * @json resolved/unresolved cldr data.
18540
- *
18541
- * Set available bundles queue based on passed json CLDR data. Considers a bundle as any String at /main/{bundle}.
18542
- */
18543
-
18544
-
18545
- var coreSetAvailableBundles = function (Cldr, json) {
18546
- var bundle,
18547
- availableBundleMapQueue = Cldr._availableBundleMapQueue,
18548
- main = resourceGet(json, ["main"]);
18549
-
18550
- if (main) {
18551
- for (bundle in main) {
18552
- if (main.hasOwnProperty(bundle) && bundle !== "root" && availableBundleMapQueue.indexOf(bundle) === -1) {
18553
- availableBundleMapQueue.push(bundle);
18554
- }
18555
- }
18556
- }
18557
- };
18558
-
18559
- var alwaysArray = function (somethingOrArray) {
18560
- return arrayIsArray(somethingOrArray) ? somethingOrArray : [somethingOrArray];
18561
- };
18562
-
18563
- var jsonMerge = function () {
18564
- // Returns new deeply merged JSON.
18565
- //
18566
- // Eg.
18567
- // merge( { a: { b: 1, c: 2 } }, { a: { b: 3, d: 4 } } )
18568
- // -> { a: { b: 3, c: 2, d: 4 } }
18569
- //
18570
- // @arguments JSON's
18571
- //
18572
- var merge = function () {
18573
- var destination = {},
18574
- sources = [].slice.call(arguments, 0);
18575
- arrayForEach(sources, function (source) {
18576
- var prop;
18577
-
18578
- for (prop in source) {
18579
- if (prop in destination && typeof destination[prop] === "object" && !arrayIsArray(destination[prop])) {
18580
- // Merge Objects
18581
- destination[prop] = merge(destination[prop], source[prop]);
18582
- } else {
18583
- // Set new values
18584
- destination[prop] = source[prop];
18585
- }
18586
- }
18587
- });
18588
- return destination;
18589
- };
18590
-
18591
- return merge;
18592
- }();
18593
- /**
18594
- * load( Cldr, source, jsons )
18595
- *
18596
- * @Cldr [Cldr class]
18597
- *
18598
- * @source [Object]
18599
- *
18600
- * @jsons [arguments]
18601
- */
18602
-
18603
-
18604
- var coreLoad = function (Cldr, source, jsons) {
18605
- var i, j, json;
18606
- validatePresence(jsons[0], "json"); // Support arbitrary parameters, e.g., `Cldr.load({...}, {...})`.
18607
-
18608
- for (i = 0; i < jsons.length; i++) {
18609
- // Support array parameters, e.g., `Cldr.load([{...}, {...}])`.
18610
- json = alwaysArray(jsons[i]);
18611
-
18612
- for (j = 0; j < json.length; j++) {
18613
- validateTypePlainObject(json[j], "json");
18614
- source = jsonMerge(source, json[j]);
18615
- coreSetAvailableBundles(Cldr, json[j]);
18616
- }
18617
- }
18618
-
18619
- return source;
18620
- };
18621
-
18622
- var itemGetResolved = function (Cldr, path, attributes) {
18623
- // Resolve path
18624
- var normalizedPath = pathNormalize(path, attributes);
18625
- return resourceGet(Cldr._resolved, normalizedPath);
18626
- };
18627
- /**
18628
- * new Cldr()
18629
- */
18630
-
18631
-
18632
- var Cldr = function (locale) {
18633
- this.init(locale);
18634
- }; // Build optimization hack to avoid duplicating functions across modules.
18635
-
18636
-
18637
- Cldr._alwaysArray = alwaysArray;
18638
- Cldr._coreLoad = coreLoad;
18639
- Cldr._createError = createError;
18640
- Cldr._itemGetResolved = itemGetResolved;
18641
- Cldr._jsonMerge = jsonMerge;
18642
- Cldr._pathNormalize = pathNormalize;
18643
- Cldr._resourceGet = resourceGet;
18644
- Cldr._validatePresence = validatePresence;
18645
- Cldr._validateType = validateType;
18646
- Cldr._validateTypePath = validateTypePath;
18647
- Cldr._validateTypePlainObject = validateTypePlainObject;
18648
- Cldr._availableBundleMap = {};
18649
- Cldr._availableBundleMapQueue = [];
18650
- Cldr._resolved = {}; // Allow user to override locale separator "-" (default) | "_". According to http://www.unicode.org/reports/tr35/#Unicode_language_identifier, both "-" and "_" are valid locale separators (eg. "en_GB", "en-GB"). According to http://unicode.org/cldr/trac/ticket/6786 its usage must be consistent throughout the data set.
18651
-
18652
- Cldr.localeSep = "-";
18653
- /**
18654
- * Cldr.load( json [, json, ...] )
18655
- *
18656
- * @json [JSON] CLDR data or [Array] Array of @json's.
18657
- *
18658
- * Load resolved cldr data.
18659
- */
18660
-
18661
- Cldr.load = function () {
18662
- Cldr._resolved = coreLoad(Cldr, Cldr._resolved, arguments);
18663
- };
18664
- /**
18665
- * .init() automatically run on instantiation/construction.
18666
- */
18667
-
18668
-
18669
- Cldr.prototype.init = function (locale) {
18670
- var attributes,
18671
- language,
18672
- maxLanguageId,
18673
- minLanguageId,
18674
- script,
18675
- subtags,
18676
- territory,
18677
- unicodeLocaleExtensions,
18678
- variant,
18679
- sep = Cldr.localeSep,
18680
- unicodeLocaleExtensionsRaw = "";
18681
- validatePresence(locale, "locale");
18682
- validateTypeString(locale, "locale");
18683
- subtags = coreSubtags(locale);
18684
-
18685
- if (subtags.length === 5) {
18686
- unicodeLocaleExtensions = subtags.pop();
18687
- unicodeLocaleExtensionsRaw = sep + "u" + sep + unicodeLocaleExtensions; // Remove trailing null when there is unicodeLocaleExtensions but no variants.
18688
-
18689
- if (!subtags[3]) {
18690
- subtags.pop();
18691
- }
18692
- }
18693
-
18694
- variant = subtags[3]; // Normalize locale code.
18695
- // Get (or deduce) the "triple subtags": language, territory (also aliased as region), and script subtags.
18696
- // Get the variant subtags (calendar, collation, currency, etc).
18697
- // refs:
18698
- // - http://www.unicode.org/reports/tr35/#Field_Definitions
18699
- // - http://www.unicode.org/reports/tr35/#Language_and_Locale_IDs
18700
- // - http://www.unicode.org/reports/tr35/#Unicode_locale_identifier
18701
- // When a locale id does not specify a language, or territory (region), or script, they are obtained by Likely Subtags.
18702
-
18703
- maxLanguageId = coreLikelySubtags(Cldr, this, subtags, {
18704
- force: true
18705
- }) || subtags;
18706
- language = maxLanguageId[0];
18707
- script = maxLanguageId[1];
18708
- territory = maxLanguageId[2];
18709
- minLanguageId = coreRemoveLikelySubtags(Cldr, this, maxLanguageId).join(sep); // Set attributes
18710
-
18711
- this.attributes = attributes = {
18712
- bundle: bundleLookup(Cldr, this, minLanguageId),
18713
- // Unicode Language Id
18714
- minLanguageId: minLanguageId + unicodeLocaleExtensionsRaw,
18715
- maxLanguageId: maxLanguageId.join(sep) + unicodeLocaleExtensionsRaw,
18716
- // Unicode Language Id Subtabs
18717
- language: language,
18718
- script: script,
18719
- territory: territory,
18720
- region: territory,
18721
-
18722
- /* alias */
18723
- variant: variant
18724
- }; // Unicode locale extensions.
18725
-
18726
- unicodeLocaleExtensions && ("-" + unicodeLocaleExtensions).replace(/-[a-z]{3,8}|(-[a-z]{2})-([a-z]{3,8})/g, function (attribute, key, type) {
18727
- if (key) {
18728
- // Extension is in the `keyword` form.
18729
- attributes["u" + key] = type;
18730
- } else {
18731
- // Extension is in the `attribute` form.
18732
- attributes["u" + attribute] = true;
18733
- }
18734
- });
18735
- this.locale = locale;
18736
- };
18737
- /**
18738
- * .get()
18739
- */
18740
-
18741
-
18742
- Cldr.prototype.get = function (path) {
18743
- validatePresence(path, "path");
18744
- validateTypePath(path, "path");
18745
- return itemGetResolved(Cldr, path, this.attributes);
18746
- };
18747
- /**
18748
- * .main()
18749
- */
18750
-
18751
-
18752
- Cldr.prototype.main = function (path) {
18753
- validatePresence(path, "path");
18754
- validateTypePath(path, "path");
18755
- validate("E_MISSING_BUNDLE", this.attributes.bundle !== null, {
18756
- locale: this.locale
18757
- });
18758
- path = alwaysArray(path);
18759
- return this.get(["main/{bundle}"].concat(path));
18760
- };
18127
+ /*!
18128
+ * CLDR JavaScript Library v0.5.4 2020-10-22T15:56Z MIT license © Rafael Xavier
18129
+ * http://git.io/h4lmVg
18130
+ */
18131
+ (function (root, factory) {
18132
+ {
18133
+ // Node. CommonJS.
18134
+ module.exports = factory();
18135
+ }
18136
+ })(commonjsGlobal, function () {
18137
+ var arrayIsArray = Array.isArray || function (obj) {
18138
+ return Object.prototype.toString.call(obj) === "[object Array]";
18139
+ };
18140
+ var pathNormalize = function (path, attributes) {
18141
+ if (arrayIsArray(path)) {
18142
+ path = path.join("/");
18143
+ }
18144
+ if (typeof path !== "string") {
18145
+ throw new Error("invalid path \"" + path + "\"");
18146
+ }
18147
+ // 1: Ignore leading slash `/`
18148
+ // 2: Ignore leading `cldr/`
18149
+ path = path.replace(/^\//, "") /* 1 */.replace(/^cldr\//, ""); /* 2 */
18150
+
18151
+ // Replace {attribute}'s
18152
+ path = path.replace(/{[a-zA-Z]+}/g, function (name) {
18153
+ name = name.replace(/^{([^}]*)}$/, "$1");
18154
+ return attributes[name];
18155
+ });
18156
+ return path.split("/");
18157
+ };
18158
+ var arraySome = function (array, callback) {
18159
+ var i, length;
18160
+ if (array.some) {
18161
+ return array.some(callback);
18162
+ }
18163
+ for (i = 0, length = array.length; i < length; i++) {
18164
+ if (callback(array[i], i, array)) {
18165
+ return true;
18166
+ }
18167
+ }
18168
+ return false;
18169
+ };
18170
+
18171
+ /**
18172
+ * Return the maximized language id as defined in
18173
+ * http://www.unicode.org/reports/tr35/#Likely_Subtags
18174
+ * 1. Canonicalize.
18175
+ * 1.1 Make sure the input locale is in canonical form: uses the right
18176
+ * separator, and has the right casing.
18177
+ * TODO Right casing? What df? It seems languages are lowercase, scripts are
18178
+ * Capitalized, territory is uppercase. I am leaving this as an exercise to
18179
+ * the user.
18180
+ *
18181
+ * 1.2 Replace any deprecated subtags with their canonical values using the
18182
+ * <alias> data in supplemental metadata. Use the first value in the
18183
+ * replacement list, if it exists. Language tag replacements may have multiple
18184
+ * parts, such as "sh" ➞ "sr_Latn" or mo" ➞ "ro_MD". In such a case, the
18185
+ * original script and/or region are retained if there is one. Thus
18186
+ * "sh_Arab_AQ" ➞ "sr_Arab_AQ", not "sr_Latn_AQ".
18187
+ * TODO What <alias> data?
18188
+ *
18189
+ * 1.3 If the tag is grandfathered (see <variable id="$grandfathered"
18190
+ * type="choice"> in the supplemental data), then return it.
18191
+ * TODO grandfathered?
18192
+ *
18193
+ * 1.4 Remove the script code 'Zzzz' and the region code 'ZZ' if they occur.
18194
+ * 1.5 Get the components of the cleaned-up source tag (languages, scripts,
18195
+ * and regions), plus any variants and extensions.
18196
+ * 2. Lookup. Lookup each of the following in order, and stop on the first
18197
+ * match:
18198
+ * 2.1 languages_scripts_regions
18199
+ * 2.2 languages_regions
18200
+ * 2.3 languages_scripts
18201
+ * 2.4 languages
18202
+ * 2.5 und_scripts
18203
+ * 3. Return
18204
+ * 3.1 If there is no match, either return an error value, or the match for
18205
+ * "und" (in APIs where a valid language tag is required).
18206
+ * 3.2 Otherwise there is a match = languagem_scriptm_regionm
18207
+ * 3.3 Let xr = xs if xs is not empty, and xm otherwise.
18208
+ * 3.4 Return the language tag composed of languager _ scriptr _ regionr +
18209
+ * variants + extensions.
18210
+ *
18211
+ * @subtags [Array] normalized language id subtags tuple (see init.js).
18212
+ */
18213
+ var coreLikelySubtags = function (Cldr, cldr, subtags, options) {
18214
+ var match,
18215
+ matchFound,
18216
+ language = subtags[0],
18217
+ script = subtags[1],
18218
+ sep = Cldr.localeSep,
18219
+ territory = subtags[2],
18220
+ variants = subtags.slice(3, 4);
18221
+ options = options || {};
18222
+
18223
+ // Skip if (language, script, territory) is not empty [3.3]
18224
+ if (language !== "und" && script !== "Zzzz" && territory !== "ZZ") {
18225
+ return [language, script, territory].concat(variants);
18226
+ }
18227
+
18228
+ // Skip if no supplemental likelySubtags data is present
18229
+ if (typeof cldr.get("supplemental/likelySubtags") === "undefined") {
18230
+ return;
18231
+ }
18232
+
18233
+ // [2]
18234
+ matchFound = arraySome([[language, script, territory], [language, territory], [language, script], [language], ["und", script]], function (test) {
18235
+ return match = !/\b(Zzzz|ZZ)\b/.test(test.join(sep)) /* [1.4] */ && cldr.get(["supplemental/likelySubtags", test.join(sep)]);
18236
+ });
18237
+
18238
+ // [3]
18239
+ if (matchFound) {
18240
+ // [3.2 .. 3.4]
18241
+ match = match.split(sep);
18242
+ return [language !== "und" ? language : match[0], script !== "Zzzz" ? script : match[1], territory !== "ZZ" ? territory : match[2]].concat(variants);
18243
+ } else if (options.force) {
18244
+ // [3.1.2]
18245
+ return cldr.get("supplemental/likelySubtags/und").split(sep);
18246
+ } else {
18247
+ // [3.1.1]
18248
+ return;
18249
+ }
18250
+ };
18251
+
18252
+ /**
18253
+ * Given a locale, remove any fields that Add Likely Subtags would add.
18254
+ * http://www.unicode.org/reports/tr35/#Likely_Subtags
18255
+ * 1. First get max = AddLikelySubtags(inputLocale). If an error is signaled,
18256
+ * return it.
18257
+ * 2. Remove the variants from max.
18258
+ * 3. Then for trial in {language, language _ region, language _ script}. If
18259
+ * AddLikelySubtags(trial) = max, then return trial + variants.
18260
+ * 4. If you do not get a match, return max + variants.
18261
+ *
18262
+ * @maxLanguageId [Array] maxLanguageId tuple (see init.js).
18263
+ */
18264
+ var coreRemoveLikelySubtags = function (Cldr, cldr, maxLanguageId) {
18265
+ var match,
18266
+ matchFound,
18267
+ language = maxLanguageId[0],
18268
+ script = maxLanguageId[1],
18269
+ territory = maxLanguageId[2],
18270
+ variants = maxLanguageId[3];
18271
+
18272
+ // [3]
18273
+ matchFound = arraySome([[[language, "Zzzz", "ZZ"], [language]], [[language, "Zzzz", territory], [language, territory]], [[language, script, "ZZ"], [language, script]]], function (test) {
18274
+ var result = coreLikelySubtags(Cldr, cldr, test[0]);
18275
+ match = test[1];
18276
+ return result && result[0] === maxLanguageId[0] && result[1] === maxLanguageId[1] && result[2] === maxLanguageId[2];
18277
+ });
18278
+ if (matchFound) {
18279
+ if (variants) {
18280
+ match.push(variants);
18281
+ }
18282
+ return match;
18283
+ }
18284
+
18285
+ // [4]
18286
+ return maxLanguageId;
18287
+ };
18288
+
18289
+ /**
18290
+ * subtags( locale )
18291
+ *
18292
+ * @locale [String]
18293
+ */
18294
+ var coreSubtags = function (locale) {
18295
+ var aux,
18296
+ unicodeLanguageId,
18297
+ subtags = [];
18298
+ locale = locale.replace(/_/, "-");
18299
+
18300
+ // Unicode locale extensions.
18301
+ aux = locale.split("-u-");
18302
+ if (aux[1]) {
18303
+ aux[1] = aux[1].split("-t-");
18304
+ locale = aux[0] + (aux[1][1] ? "-t-" + aux[1][1] : "");
18305
+ subtags[4 /* unicodeLocaleExtensions */] = aux[1][0];
18306
+ }
18307
+
18308
+ // TODO normalize transformed extensions. Currently, skipped.
18309
+ // subtags[ x ] = locale.split( "-t-" )[ 1 ];
18310
+ unicodeLanguageId = locale.split("-t-")[0];
18311
+
18312
+ // unicode_language_id = "root"
18313
+ // | unicode_language_subtag
18314
+ // (sep unicode_script_subtag)?
18315
+ // (sep unicode_region_subtag)?
18316
+ // (sep unicode_variant_subtag)* ;
18317
+ //
18318
+ // Although unicode_language_subtag = alpha{2,8}, I'm using alpha{2,3}. Because, there's no language on CLDR lengthier than 3.
18319
+ aux = unicodeLanguageId.match(/^(([a-z]{2,3})(-([A-Z][a-z]{3}))?(-([A-Z]{2}|[0-9]{3}))?)((-([a-zA-Z0-9]{5,8}|[0-9][a-zA-Z0-9]{3}))*)$|^(root)$/);
18320
+ if (aux === null) {
18321
+ return ["und", "Zzzz", "ZZ"];
18322
+ }
18323
+ subtags[0 /* language */] = aux[10] /* root */ || aux[2] || "und";
18324
+ subtags[1 /* script */] = aux[4] || "Zzzz";
18325
+ subtags[2 /* territory */] = aux[6] || "ZZ";
18326
+ if (aux[7] && aux[7].length) {
18327
+ subtags[3 /* variant */] = aux[7].slice(1) /* remove leading "-" */;
18328
+ }
18329
+
18330
+ // 0: language
18331
+ // 1: script
18332
+ // 2: territory (aka region)
18333
+ // 3: variant
18334
+ // 4: unicodeLocaleExtensions
18335
+ return subtags;
18336
+ };
18337
+ var arrayForEach = function (array, callback) {
18338
+ var i, length;
18339
+ if (array.forEach) {
18340
+ return array.forEach(callback);
18341
+ }
18342
+ for (i = 0, length = array.length; i < length; i++) {
18343
+ callback(array[i], i, array);
18344
+ }
18345
+ };
18346
+
18347
+ /**
18348
+ * bundleLookup( minLanguageId )
18349
+ *
18350
+ * @Cldr [Cldr class]
18351
+ *
18352
+ * @cldr [Cldr instance]
18353
+ *
18354
+ * @minLanguageId [String] requested languageId after applied remove likely subtags.
18355
+ */
18356
+ var bundleLookup = function (Cldr, cldr, minLanguageId) {
18357
+ var availableBundleMap = Cldr._availableBundleMap,
18358
+ availableBundleMapQueue = Cldr._availableBundleMapQueue;
18359
+ if (availableBundleMapQueue.length) {
18360
+ arrayForEach(availableBundleMapQueue, function (bundle, i) {
18361
+ var existing, maxBundle, minBundle, subtags;
18362
+ subtags = coreSubtags(bundle);
18363
+ maxBundle = coreLikelySubtags(Cldr, cldr, subtags);
18364
+ if (maxBundle === undefined) {
18365
+ availableBundleMapQueue.splice(i, 1);
18366
+ throw new Error("Could not find likelySubtags for " + bundle);
18367
+ }
18368
+ minBundle = coreRemoveLikelySubtags(Cldr, cldr, maxBundle);
18369
+ minBundle = minBundle.join(Cldr.localeSep);
18370
+ existing = availableBundleMap[minBundle];
18371
+ if (existing && existing.length < bundle.length) {
18372
+ return;
18373
+ }
18374
+ availableBundleMap[minBundle] = bundle;
18375
+ });
18376
+ Cldr._availableBundleMapQueue = [];
18377
+ }
18378
+ return availableBundleMap[minLanguageId] || null;
18379
+ };
18380
+ var objectKeys = function (object) {
18381
+ var i,
18382
+ result = [];
18383
+ if (Object.keys) {
18384
+ return Object.keys(object);
18385
+ }
18386
+ for (i in object) {
18387
+ result.push(i);
18388
+ }
18389
+ return result;
18390
+ };
18391
+ var createError = function (code, attributes) {
18392
+ var error, message;
18393
+ message = code + (attributes && JSON ? ": " + JSON.stringify(attributes) : "");
18394
+ error = new Error(message);
18395
+ error.code = code;
18396
+
18397
+ // extend( error, attributes );
18398
+ arrayForEach(objectKeys(attributes), function (attribute) {
18399
+ error[attribute] = attributes[attribute];
18400
+ });
18401
+ return error;
18402
+ };
18403
+ var validate = function (code, check, attributes) {
18404
+ if (!check) {
18405
+ throw createError(code, attributes);
18406
+ }
18407
+ };
18408
+ var validatePresence = function (value, name) {
18409
+ validate("E_MISSING_PARAMETER", typeof value !== "undefined", {
18410
+ name: name
18411
+ });
18412
+ };
18413
+ var validateType = function (value, name, check, expected) {
18414
+ validate("E_INVALID_PAR_TYPE", check, {
18415
+ expected: expected,
18416
+ name: name,
18417
+ value: value
18418
+ });
18419
+ };
18420
+ var validateTypePath = function (value, name) {
18421
+ validateType(value, name, typeof value === "string" || arrayIsArray(value), "String or Array");
18422
+ };
18423
+
18424
+ /**
18425
+ * Function inspired by jQuery Core, but reduced to our use case.
18426
+ */
18427
+ var isPlainObject = function (obj) {
18428
+ return obj !== null && "" + obj === "[object Object]";
18429
+ };
18430
+ var validateTypePlainObject = function (value, name) {
18431
+ validateType(value, name, typeof value === "undefined" || isPlainObject(value), "Plain Object");
18432
+ };
18433
+ var validateTypeString = function (value, name) {
18434
+ validateType(value, name, typeof value === "string", "a string");
18435
+ };
18436
+
18437
+ // @path: normalized path
18438
+ var resourceGet = function (data, path) {
18439
+ var i,
18440
+ node = data,
18441
+ length = path.length;
18442
+ for (i = 0; i < length - 1; i++) {
18443
+ node = node[path[i]];
18444
+ if (!node) {
18445
+ return undefined;
18446
+ }
18447
+ }
18448
+ return node[path[i]];
18449
+ };
18450
+
18451
+ /**
18452
+ * setAvailableBundles( Cldr, json )
18453
+ *
18454
+ * @Cldr [Cldr class]
18455
+ *
18456
+ * @json resolved/unresolved cldr data.
18457
+ *
18458
+ * Set available bundles queue based on passed json CLDR data. Considers a bundle as any String at /main/{bundle}.
18459
+ */
18460
+ var coreSetAvailableBundles = function (Cldr, json) {
18461
+ var bundle,
18462
+ availableBundleMapQueue = Cldr._availableBundleMapQueue,
18463
+ main = resourceGet(json, ["main"]);
18464
+ if (main) {
18465
+ for (bundle in main) {
18466
+ if (main.hasOwnProperty(bundle) && bundle !== "root" && availableBundleMapQueue.indexOf(bundle) === -1) {
18467
+ availableBundleMapQueue.push(bundle);
18468
+ }
18469
+ }
18470
+ }
18471
+ };
18472
+ var alwaysArray = function (somethingOrArray) {
18473
+ return arrayIsArray(somethingOrArray) ? somethingOrArray : [somethingOrArray];
18474
+ };
18475
+ var jsonMerge = function () {
18476
+ // Returns new deeply merged JSON.
18477
+ //
18478
+ // Eg.
18479
+ // merge( { a: { b: 1, c: 2 } }, { a: { b: 3, d: 4 } } )
18480
+ // -> { a: { b: 3, c: 2, d: 4 } }
18481
+ //
18482
+ // @arguments JSON's
18483
+ //
18484
+ var merge = function () {
18485
+ var destination = {},
18486
+ sources = [].slice.call(arguments, 0);
18487
+ arrayForEach(sources, function (source) {
18488
+ var prop;
18489
+ for (prop in source) {
18490
+ if (prop in destination && typeof destination[prop] === "object" && !arrayIsArray(destination[prop])) {
18491
+ // Merge Objects
18492
+ destination[prop] = merge(destination[prop], source[prop]);
18493
+ } else {
18494
+ // Set new values
18495
+ destination[prop] = source[prop];
18496
+ }
18497
+ }
18498
+ });
18499
+ return destination;
18500
+ };
18501
+ return merge;
18502
+ }();
18503
+
18504
+ /**
18505
+ * load( Cldr, source, jsons )
18506
+ *
18507
+ * @Cldr [Cldr class]
18508
+ *
18509
+ * @source [Object]
18510
+ *
18511
+ * @jsons [arguments]
18512
+ */
18513
+ var coreLoad = function (Cldr, source, jsons) {
18514
+ var i, j, json;
18515
+ validatePresence(jsons[0], "json");
18516
+
18517
+ // Support arbitrary parameters, e.g., `Cldr.load({...}, {...})`.
18518
+ for (i = 0; i < jsons.length; i++) {
18519
+ // Support array parameters, e.g., `Cldr.load([{...}, {...}])`.
18520
+ json = alwaysArray(jsons[i]);
18521
+ for (j = 0; j < json.length; j++) {
18522
+ validateTypePlainObject(json[j], "json");
18523
+ source = jsonMerge(source, json[j]);
18524
+ coreSetAvailableBundles(Cldr, json[j]);
18525
+ }
18526
+ }
18527
+ return source;
18528
+ };
18529
+ var itemGetResolved = function (Cldr, path, attributes) {
18530
+ // Resolve path
18531
+ var normalizedPath = pathNormalize(path, attributes);
18532
+ return resourceGet(Cldr._resolved, normalizedPath);
18533
+ };
18534
+
18535
+ /**
18536
+ * new Cldr()
18537
+ */
18538
+ var Cldr = function (locale) {
18539
+ this.init(locale);
18540
+ };
18541
+
18542
+ // Build optimization hack to avoid duplicating functions across modules.
18543
+ Cldr._alwaysArray = alwaysArray;
18544
+ Cldr._coreLoad = coreLoad;
18545
+ Cldr._createError = createError;
18546
+ Cldr._itemGetResolved = itemGetResolved;
18547
+ Cldr._jsonMerge = jsonMerge;
18548
+ Cldr._pathNormalize = pathNormalize;
18549
+ Cldr._resourceGet = resourceGet;
18550
+ Cldr._validatePresence = validatePresence;
18551
+ Cldr._validateType = validateType;
18552
+ Cldr._validateTypePath = validateTypePath;
18553
+ Cldr._validateTypePlainObject = validateTypePlainObject;
18554
+ Cldr._availableBundleMap = {};
18555
+ Cldr._availableBundleMapQueue = [];
18556
+ Cldr._resolved = {};
18557
+
18558
+ // Allow user to override locale separator "-" (default) | "_". According to http://www.unicode.org/reports/tr35/#Unicode_language_identifier, both "-" and "_" are valid locale separators (eg. "en_GB", "en-GB"). According to http://unicode.org/cldr/trac/ticket/6786 its usage must be consistent throughout the data set.
18559
+ Cldr.localeSep = "-";
18560
+
18561
+ /**
18562
+ * Cldr.load( json [, json, ...] )
18563
+ *
18564
+ * @json [JSON] CLDR data or [Array] Array of @json's.
18565
+ *
18566
+ * Load resolved cldr data.
18567
+ */
18568
+ Cldr.load = function () {
18569
+ Cldr._resolved = coreLoad(Cldr, Cldr._resolved, arguments);
18570
+ };
18571
+
18572
+ /**
18573
+ * .init() automatically run on instantiation/construction.
18574
+ */
18575
+ Cldr.prototype.init = function (locale) {
18576
+ var attributes,
18577
+ language,
18578
+ maxLanguageId,
18579
+ minLanguageId,
18580
+ script,
18581
+ subtags,
18582
+ territory,
18583
+ unicodeLocaleExtensions,
18584
+ variant,
18585
+ sep = Cldr.localeSep,
18586
+ unicodeLocaleExtensionsRaw = "";
18587
+ validatePresence(locale, "locale");
18588
+ validateTypeString(locale, "locale");
18589
+ subtags = coreSubtags(locale);
18590
+ if (subtags.length === 5) {
18591
+ unicodeLocaleExtensions = subtags.pop();
18592
+ unicodeLocaleExtensionsRaw = sep + "u" + sep + unicodeLocaleExtensions;
18593
+ // Remove trailing null when there is unicodeLocaleExtensions but no variants.
18594
+ if (!subtags[3]) {
18595
+ subtags.pop();
18596
+ }
18597
+ }
18598
+ variant = subtags[3];
18599
+
18600
+ // Normalize locale code.
18601
+ // Get (or deduce) the "triple subtags": language, territory (also aliased as region), and script subtags.
18602
+ // Get the variant subtags (calendar, collation, currency, etc).
18603
+ // refs:
18604
+ // - http://www.unicode.org/reports/tr35/#Field_Definitions
18605
+ // - http://www.unicode.org/reports/tr35/#Language_and_Locale_IDs
18606
+ // - http://www.unicode.org/reports/tr35/#Unicode_locale_identifier
18607
+
18608
+ // When a locale id does not specify a language, or territory (region), or script, they are obtained by Likely Subtags.
18609
+ maxLanguageId = coreLikelySubtags(Cldr, this, subtags, {
18610
+ force: true
18611
+ }) || subtags;
18612
+ language = maxLanguageId[0];
18613
+ script = maxLanguageId[1];
18614
+ territory = maxLanguageId[2];
18615
+ minLanguageId = coreRemoveLikelySubtags(Cldr, this, maxLanguageId).join(sep);
18616
+
18617
+ // Set attributes
18618
+ this.attributes = attributes = {
18619
+ bundle: bundleLookup(Cldr, this, minLanguageId),
18620
+ // Unicode Language Id
18621
+ minLanguageId: minLanguageId + unicodeLocaleExtensionsRaw,
18622
+ maxLanguageId: maxLanguageId.join(sep) + unicodeLocaleExtensionsRaw,
18623
+ // Unicode Language Id Subtabs
18624
+ language: language,
18625
+ script: script,
18626
+ territory: territory,
18627
+ region: territory,
18628
+ /* alias */
18629
+ variant: variant
18630
+ };
18631
+
18632
+ // Unicode locale extensions.
18633
+ unicodeLocaleExtensions && ("-" + unicodeLocaleExtensions).replace(/-[a-z]{3,8}|(-[a-z]{2})-([a-z]{3,8})/g, function (attribute, key, type) {
18634
+ if (key) {
18635
+ // Extension is in the `keyword` form.
18636
+ attributes["u" + key] = type;
18637
+ } else {
18638
+ // Extension is in the `attribute` form.
18639
+ attributes["u" + attribute] = true;
18640
+ }
18641
+ });
18642
+ this.locale = locale;
18643
+ };
18644
+
18645
+ /**
18646
+ * .get()
18647
+ */
18648
+ Cldr.prototype.get = function (path) {
18649
+ validatePresence(path, "path");
18650
+ validateTypePath(path, "path");
18651
+ return itemGetResolved(Cldr, path, this.attributes);
18652
+ };
18653
+
18654
+ /**
18655
+ * .main()
18656
+ */
18657
+ Cldr.prototype.main = function (path) {
18658
+ validatePresence(path, "path");
18659
+ validateTypePath(path, "path");
18660
+ validate("E_MISSING_BUNDLE", this.attributes.bundle !== null, {
18661
+ locale: this.locale
18662
+ });
18663
+ path = alwaysArray(path);
18664
+ return this.get(["main/{bundle}"].concat(path));
18665
+ };
18666
+ return Cldr;
18667
+ });
18668
+ } (cldr));
18669
+
18670
+ var eventExports = {};
18671
+ var event = {
18672
+ get exports(){ return eventExports; },
18673
+ set exports(v){ eventExports = v; },
18674
+ };
18761
18675
 
18762
- return Cldr;
18763
- });
18764
- }(cldr));
18676
+ /**
18677
+ * CLDR JavaScript Library v0.5.4
18678
+ * http://jquery.com/
18679
+ *
18680
+ * Copyright 2013 Rafael Xavier de Souza
18681
+ * Released under the MIT license
18682
+ * http://jquery.org/license
18683
+ *
18684
+ * Date: 2020-10-22T15:56Z
18685
+ */
18765
18686
 
18766
- var event = {exports: {}};
18687
+ (function (module) {
18688
+ /*!
18689
+ * CLDR JavaScript Library v0.5.4 2020-10-22T15:56Z MIT license © Rafael Xavier
18690
+ * http://git.io/h4lmVg
18691
+ */
18692
+ (function (factory) {
18693
+ {
18694
+ // Node. CommonJS.
18695
+ module.exports = factory(cldrExports);
18696
+ }
18697
+ })(function (Cldr) {
18698
+ // Build optimization hack to avoid duplicating functions across modules.
18699
+ var pathNormalize = Cldr._pathNormalize,
18700
+ validatePresence = Cldr._validatePresence,
18701
+ validateType = Cldr._validateType;
18702
+
18703
+ /*!
18704
+ * EventEmitter v4.2.7 - git.io/ee
18705
+ * Oliver Caldwell
18706
+ * MIT license
18707
+ * @preserve
18708
+ */
18709
+
18710
+ var EventEmitter;
18711
+ /* jshint ignore:start */
18712
+ EventEmitter = function () {
18713
+ /**
18714
+ * Class for managing events.
18715
+ * Can be extended to provide event functionality in other classes.
18716
+ *
18717
+ * @class EventEmitter Manages event registering and emitting.
18718
+ */
18719
+ function EventEmitter() {}
18720
+
18721
+ // Shortcuts to improve speed and size
18722
+ var proto = EventEmitter.prototype;
18723
+
18724
+ /**
18725
+ * Finds the index of the listener for the event in it's storage array.
18726
+ *
18727
+ * @param {Function[]} listeners Array of listeners to search through.
18728
+ * @param {Function} listener Method to look for.
18729
+ * @return {Number} Index of the specified listener, -1 if not found
18730
+ * @api private
18731
+ */
18732
+ function indexOfListener(listeners, listener) {
18733
+ var i = listeners.length;
18734
+ while (i--) {
18735
+ if (listeners[i].listener === listener) {
18736
+ return i;
18737
+ }
18738
+ }
18739
+ return -1;
18740
+ }
18741
+
18742
+ /**
18743
+ * Alias a method while keeping the context correct, to allow for overwriting of target method.
18744
+ *
18745
+ * @param {String} name The name of the target method.
18746
+ * @return {Function} The aliased method
18747
+ * @api private
18748
+ */
18749
+ function alias(name) {
18750
+ return function aliasClosure() {
18751
+ return this[name].apply(this, arguments);
18752
+ };
18753
+ }
18754
+
18755
+ /**
18756
+ * Returns the listener array for the specified event.
18757
+ * Will initialise the event object and listener arrays if required.
18758
+ * Will return an object if you use a regex search. The object contains keys for each matched event. So /ba[rz]/ might return an object containing bar and baz. But only if you have either defined them with defineEvent or added some listeners to them.
18759
+ * Each property in the object response is an array of listener functions.
18760
+ *
18761
+ * @param {String|RegExp} evt Name of the event to return the listeners from.
18762
+ * @return {Function[]|Object} All listener functions for the event.
18763
+ */
18764
+ proto.getListeners = function getListeners(evt) {
18765
+ var events = this._getEvents();
18766
+ var response;
18767
+ var key;
18768
+
18769
+ // Return a concatenated array of all matching events if
18770
+ // the selector is a regular expression.
18771
+ if (evt instanceof RegExp) {
18772
+ response = {};
18773
+ for (key in events) {
18774
+ if (events.hasOwnProperty(key) && evt.test(key)) {
18775
+ response[key] = events[key];
18776
+ }
18777
+ }
18778
+ } else {
18779
+ response = events[evt] || (events[evt] = []);
18780
+ }
18781
+ return response;
18782
+ };
18783
+
18784
+ /**
18785
+ * Takes a list of listener objects and flattens it into a list of listener functions.
18786
+ *
18787
+ * @param {Object[]} listeners Raw listener objects.
18788
+ * @return {Function[]} Just the listener functions.
18789
+ */
18790
+ proto.flattenListeners = function flattenListeners(listeners) {
18791
+ var flatListeners = [];
18792
+ var i;
18793
+ for (i = 0; i < listeners.length; i += 1) {
18794
+ flatListeners.push(listeners[i].listener);
18795
+ }
18796
+ return flatListeners;
18797
+ };
18798
+
18799
+ /**
18800
+ * Fetches the requested listeners via getListeners but will always return the results inside an object. This is mainly for internal use but others may find it useful.
18801
+ *
18802
+ * @param {String|RegExp} evt Name of the event to return the listeners from.
18803
+ * @return {Object} All listener functions for an event in an object.
18804
+ */
18805
+ proto.getListenersAsObject = function getListenersAsObject(evt) {
18806
+ var listeners = this.getListeners(evt);
18807
+ var response;
18808
+ if (listeners instanceof Array) {
18809
+ response = {};
18810
+ response[evt] = listeners;
18811
+ }
18812
+ return response || listeners;
18813
+ };
18814
+
18815
+ /**
18816
+ * Adds a listener function to the specified event.
18817
+ * The listener will not be added if it is a duplicate.
18818
+ * If the listener returns true then it will be removed after it is called.
18819
+ * If you pass a regular expression as the event name then the listener will be added to all events that match it.
18820
+ *
18821
+ * @param {String|RegExp} evt Name of the event to attach the listener to.
18822
+ * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.
18823
+ * @return {Object} Current instance of EventEmitter for chaining.
18824
+ */
18825
+ proto.addListener = function addListener(evt, listener) {
18826
+ var listeners = this.getListenersAsObject(evt);
18827
+ var listenerIsWrapped = typeof listener === 'object';
18828
+ var key;
18829
+ for (key in listeners) {
18830
+ if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) {
18831
+ listeners[key].push(listenerIsWrapped ? listener : {
18832
+ listener: listener,
18833
+ once: false
18834
+ });
18835
+ }
18836
+ }
18837
+ return this;
18838
+ };
18839
+
18840
+ /**
18841
+ * Alias of addListener
18842
+ */
18843
+ proto.on = alias('addListener');
18844
+
18845
+ /**
18846
+ * Semi-alias of addListener. It will add a listener that will be
18847
+ * automatically removed after it's first execution.
18848
+ *
18849
+ * @param {String|RegExp} evt Name of the event to attach the listener to.
18850
+ * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.
18851
+ * @return {Object} Current instance of EventEmitter for chaining.
18852
+ */
18853
+ proto.addOnceListener = function addOnceListener(evt, listener) {
18854
+ return this.addListener(evt, {
18855
+ listener: listener,
18856
+ once: true
18857
+ });
18858
+ };
18859
+
18860
+ /**
18861
+ * Alias of addOnceListener.
18862
+ */
18863
+ proto.once = alias('addOnceListener');
18864
+
18865
+ /**
18866
+ * Defines an event name. This is required if you want to use a regex to add a listener to multiple events at once. If you don't do this then how do you expect it to know what event to add to? Should it just add to every possible match for a regex? No. That is scary and bad.
18867
+ * You need to tell it what event names should be matched by a regex.
18868
+ *
18869
+ * @param {String} evt Name of the event to create.
18870
+ * @return {Object} Current instance of EventEmitter for chaining.
18871
+ */
18872
+ proto.defineEvent = function defineEvent(evt) {
18873
+ this.getListeners(evt);
18874
+ return this;
18875
+ };
18876
+
18877
+ /**
18878
+ * Uses defineEvent to define multiple events.
18879
+ *
18880
+ * @param {String[]} evts An array of event names to define.
18881
+ * @return {Object} Current instance of EventEmitter for chaining.
18882
+ */
18883
+ proto.defineEvents = function defineEvents(evts) {
18884
+ for (var i = 0; i < evts.length; i += 1) {
18885
+ this.defineEvent(evts[i]);
18886
+ }
18887
+ return this;
18888
+ };
18889
+
18890
+ /**
18891
+ * Removes a listener function from the specified event.
18892
+ * When passed a regular expression as the event name, it will remove the listener from all events that match it.
18893
+ *
18894
+ * @param {String|RegExp} evt Name of the event to remove the listener from.
18895
+ * @param {Function} listener Method to remove from the event.
18896
+ * @return {Object} Current instance of EventEmitter for chaining.
18897
+ */
18898
+ proto.removeListener = function removeListener(evt, listener) {
18899
+ var listeners = this.getListenersAsObject(evt);
18900
+ var index;
18901
+ var key;
18902
+ for (key in listeners) {
18903
+ if (listeners.hasOwnProperty(key)) {
18904
+ index = indexOfListener(listeners[key], listener);
18905
+ if (index !== -1) {
18906
+ listeners[key].splice(index, 1);
18907
+ }
18908
+ }
18909
+ }
18910
+ return this;
18911
+ };
18912
+
18913
+ /**
18914
+ * Alias of removeListener
18915
+ */
18916
+ proto.off = alias('removeListener');
18917
+
18918
+ /**
18919
+ * Adds listeners in bulk using the manipulateListeners method.
18920
+ * If you pass an object as the second argument you can add to multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. You can also pass it an event name and an array of listeners to be added.
18921
+ * You can also pass it a regular expression to add the array of listeners to all events that match it.
18922
+ * Yeah, this function does quite a bit. That's probably a bad thing.
18923
+ *
18924
+ * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add to multiple events at once.
18925
+ * @param {Function[]} [listeners] An optional array of listener functions to add.
18926
+ * @return {Object} Current instance of EventEmitter for chaining.
18927
+ */
18928
+ proto.addListeners = function addListeners(evt, listeners) {
18929
+ // Pass through to manipulateListeners
18930
+ return this.manipulateListeners(false, evt, listeners);
18931
+ };
18932
+
18933
+ /**
18934
+ * Removes listeners in bulk using the manipulateListeners method.
18935
+ * If you pass an object as the second argument you can remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.
18936
+ * You can also pass it an event name and an array of listeners to be removed.
18937
+ * You can also pass it a regular expression to remove the listeners from all events that match it.
18938
+ *
18939
+ * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to remove from multiple events at once.
18940
+ * @param {Function[]} [listeners] An optional array of listener functions to remove.
18941
+ * @return {Object} Current instance of EventEmitter for chaining.
18942
+ */
18943
+ proto.removeListeners = function removeListeners(evt, listeners) {
18944
+ // Pass through to manipulateListeners
18945
+ return this.manipulateListeners(true, evt, listeners);
18946
+ };
18947
+
18948
+ /**
18949
+ * Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. You should really use those instead, this is a little lower level.
18950
+ * The first argument will determine if the listeners are removed (true) or added (false).
18951
+ * If you pass an object as the second argument you can add/remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.
18952
+ * You can also pass it an event name and an array of listeners to be added/removed.
18953
+ * You can also pass it a regular expression to manipulate the listeners of all events that match it.
18954
+ *
18955
+ * @param {Boolean} remove True if you want to remove listeners, false if you want to add.
18956
+ * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add/remove from multiple events at once.
18957
+ * @param {Function[]} [listeners] An optional array of listener functions to add/remove.
18958
+ * @return {Object} Current instance of EventEmitter for chaining.
18959
+ */
18960
+ proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) {
18961
+ var i;
18962
+ var value;
18963
+ var single = remove ? this.removeListener : this.addListener;
18964
+ var multiple = remove ? this.removeListeners : this.addListeners;
18965
+
18966
+ // If evt is an object then pass each of it's properties to this method
18967
+ if (typeof evt === 'object' && !(evt instanceof RegExp)) {
18968
+ for (i in evt) {
18969
+ if (evt.hasOwnProperty(i) && (value = evt[i])) {
18970
+ // Pass the single listener straight through to the singular method
18971
+ if (typeof value === 'function') {
18972
+ single.call(this, i, value);
18973
+ } else {
18974
+ // Otherwise pass back to the multiple function
18975
+ multiple.call(this, i, value);
18976
+ }
18977
+ }
18978
+ }
18979
+ } else {
18980
+ // So evt must be a string
18981
+ // And listeners must be an array of listeners
18982
+ // Loop over it and pass each one to the multiple method
18983
+ i = listeners.length;
18984
+ while (i--) {
18985
+ single.call(this, evt, listeners[i]);
18986
+ }
18987
+ }
18988
+ return this;
18989
+ };
18990
+
18991
+ /**
18992
+ * Removes all listeners from a specified event.
18993
+ * If you do not specify an event then all listeners will be removed.
18994
+ * That means every event will be emptied.
18995
+ * You can also pass a regex to remove all events that match it.
18996
+ *
18997
+ * @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed.
18998
+ * @return {Object} Current instance of EventEmitter for chaining.
18999
+ */
19000
+ proto.removeEvent = function removeEvent(evt) {
19001
+ var type = typeof evt;
19002
+ var events = this._getEvents();
19003
+ var key;
19004
+
19005
+ // Remove different things depending on the state of evt
19006
+ if (type === 'string') {
19007
+ // Remove all listeners for the specified event
19008
+ delete events[evt];
19009
+ } else if (evt instanceof RegExp) {
19010
+ // Remove all events matching the regex.
19011
+ for (key in events) {
19012
+ if (events.hasOwnProperty(key) && evt.test(key)) {
19013
+ delete events[key];
19014
+ }
19015
+ }
19016
+ } else {
19017
+ // Remove all listeners in all events
19018
+ delete this._events;
19019
+ }
19020
+ return this;
19021
+ };
19022
+
19023
+ /**
19024
+ * Alias of removeEvent.
19025
+ *
19026
+ * Added to mirror the node API.
19027
+ */
19028
+ proto.removeAllListeners = alias('removeEvent');
19029
+
19030
+ /**
19031
+ * Emits an event of your choice.
19032
+ * When emitted, every listener attached to that event will be executed.
19033
+ * If you pass the optional argument array then those arguments will be passed to every listener upon execution.
19034
+ * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately.
19035
+ * So they will not arrive within the array on the other side, they will be separate.
19036
+ * You can also pass a regular expression to emit to all events that match it.
19037
+ *
19038
+ * @param {String|RegExp} evt Name of the event to emit and execute listeners for.
19039
+ * @param {Array} [args] Optional array of arguments to be passed to each listener.
19040
+ * @return {Object} Current instance of EventEmitter for chaining.
19041
+ */
19042
+ proto.emitEvent = function emitEvent(evt, args) {
19043
+ var listeners = this.getListenersAsObject(evt);
19044
+ var listener;
19045
+ var i;
19046
+ var key;
19047
+ var response;
19048
+ for (key in listeners) {
19049
+ if (listeners.hasOwnProperty(key)) {
19050
+ i = listeners[key].length;
19051
+ while (i--) {
19052
+ // If the listener returns true then it shall be removed from the event
19053
+ // The function is executed either with a basic call or an apply if there is an args array
19054
+ listener = listeners[key][i];
19055
+ if (listener.once === true) {
19056
+ this.removeListener(evt, listener.listener);
19057
+ }
19058
+ response = listener.listener.apply(this, args || []);
19059
+ if (response === this._getOnceReturnValue()) {
19060
+ this.removeListener(evt, listener.listener);
19061
+ }
19062
+ }
19063
+ }
19064
+ }
19065
+ return this;
19066
+ };
19067
+
19068
+ /**
19069
+ * Alias of emitEvent
19070
+ */
19071
+ proto.trigger = alias('emitEvent');
19072
+
19073
+ /**
19074
+ * Subtly different from emitEvent in that it will pass its arguments on to the listeners, as opposed to taking a single array of arguments to pass on.
19075
+ * As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it.
19076
+ *
19077
+ * @param {String|RegExp} evt Name of the event to emit and execute listeners for.
19078
+ * @param {...*} Optional additional arguments to be passed to each listener.
19079
+ * @return {Object} Current instance of EventEmitter for chaining.
19080
+ */
19081
+ proto.emit = function emit(evt) {
19082
+ var args = Array.prototype.slice.call(arguments, 1);
19083
+ return this.emitEvent(evt, args);
19084
+ };
19085
+
19086
+ /**
19087
+ * Sets the current value to check against when executing listeners. If a
19088
+ * listeners return value matches the one set here then it will be removed
19089
+ * after execution. This value defaults to true.
19090
+ *
19091
+ * @param {*} value The new value to check for when executing listeners.
19092
+ * @return {Object} Current instance of EventEmitter for chaining.
19093
+ */
19094
+ proto.setOnceReturnValue = function setOnceReturnValue(value) {
19095
+ this._onceReturnValue = value;
19096
+ return this;
19097
+ };
19098
+
19099
+ /**
19100
+ * Fetches the current value to check against when executing listeners. If
19101
+ * the listeners return value matches this one then it should be removed
19102
+ * automatically. It will return true by default.
19103
+ *
19104
+ * @return {*|Boolean} The current value to check for or the default, true.
19105
+ * @api private
19106
+ */
19107
+ proto._getOnceReturnValue = function _getOnceReturnValue() {
19108
+ if (this.hasOwnProperty('_onceReturnValue')) {
19109
+ return this._onceReturnValue;
19110
+ } else {
19111
+ return true;
19112
+ }
19113
+ };
19114
+
19115
+ /**
19116
+ * Fetches the events object and creates one if required.
19117
+ *
19118
+ * @return {Object} The events storage object.
19119
+ * @api private
19120
+ */
19121
+ proto._getEvents = function _getEvents() {
19122
+ return this._events || (this._events = {});
19123
+ };
19124
+
19125
+ /**
19126
+ * Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version.
19127
+ *
19128
+ * @return {Function} Non conflicting EventEmitter class.
19129
+ */
19130
+ EventEmitter.noConflict = function noConflict() {
19131
+ originalGlobalValue;
19132
+ return EventEmitter;
19133
+ };
19134
+ return EventEmitter;
19135
+ }();
19136
+ /* jshint ignore:end */
19137
+
19138
+ var validateTypeFunction = function (value, name) {
19139
+ validateType(value, name, typeof value === "undefined" || typeof value === "function", "Function");
19140
+ };
19141
+ var superGet,
19142
+ superInit,
19143
+ globalEe = new EventEmitter();
19144
+ function validateTypeEvent(value, name) {
19145
+ validateType(value, name, typeof value === "string" || value instanceof RegExp, "String or RegExp");
19146
+ }
19147
+ function validateThenCall(method, self) {
19148
+ return function (event, listener) {
19149
+ validatePresence(event, "event");
19150
+ validateTypeEvent(event, "event");
19151
+ validatePresence(listener, "listener");
19152
+ validateTypeFunction(listener, "listener");
19153
+ return self[method].apply(self, arguments);
19154
+ };
19155
+ }
19156
+ function off(self) {
19157
+ return validateThenCall("off", self);
19158
+ }
19159
+ function on(self) {
19160
+ return validateThenCall("on", self);
19161
+ }
19162
+ function once(self) {
19163
+ return validateThenCall("once", self);
19164
+ }
19165
+ Cldr.off = off(globalEe);
19166
+ Cldr.on = on(globalEe);
19167
+ Cldr.once = once(globalEe);
19168
+
19169
+ /**
19170
+ * Overload Cldr.prototype.init().
19171
+ */
19172
+ superInit = Cldr.prototype.init;
19173
+ Cldr.prototype.init = function () {
19174
+ var ee;
19175
+ this.ee = ee = new EventEmitter();
19176
+ this.off = off(ee);
19177
+ this.on = on(ee);
19178
+ this.once = once(ee);
19179
+ superInit.apply(this, arguments);
19180
+ };
19181
+
19182
+ /**
19183
+ * getOverload is encapsulated, because of cldr/unresolved. If it's loaded
19184
+ * after cldr/event (and note it overwrites .get), it can trigger this
19185
+ * overload again.
19186
+ */
19187
+ function getOverload() {
19188
+ /**
19189
+ * Overload Cldr.prototype.get().
19190
+ */
19191
+ superGet = Cldr.prototype.get;
19192
+ Cldr.prototype.get = function (path) {
19193
+ var value = superGet.apply(this, arguments);
19194
+ path = pathNormalize(path, this.attributes).join("/");
19195
+ globalEe.trigger("get", [path, value]);
19196
+ this.ee.trigger("get", [path, value]);
19197
+ return value;
19198
+ };
19199
+ }
19200
+ Cldr._eventInit = getOverload;
19201
+ getOverload();
19202
+ return Cldr;
19203
+ });
19204
+ } (event));
19205
+
19206
+ var supplementalExports = {};
19207
+ var supplemental = {
19208
+ get exports(){ return supplementalExports; },
19209
+ set exports(v){ supplementalExports = v; },
19210
+ };
18767
19211
 
18768
19212
  /**
18769
19213
  * CLDR JavaScript Library v0.5.4
@@ -18777,841 +19221,231 @@ var event = {exports: {}};
18777
19221
  */
18778
19222
 
18779
19223
  (function (module) {
18780
- /*!
18781
- * CLDR JavaScript Library v0.5.4 2020-10-22T15:56Z MIT license © Rafael Xavier
18782
- * http://git.io/h4lmVg
19224
+ /*!
19225
+ * CLDR JavaScript Library v0.5.4 2020-10-22T15:56Z MIT license © Rafael Xavier
19226
+ * http://git.io/h4lmVg
19227
+ */
19228
+ (function (factory) {
19229
+ {
19230
+ // Node. CommonJS.
19231
+ module.exports = factory(cldrExports);
19232
+ }
19233
+ })(function (Cldr) {
19234
+ // Build optimization hack to avoid duplicating functions across modules.
19235
+ var alwaysArray = Cldr._alwaysArray;
19236
+ var supplementalMain = function (cldr) {
19237
+ var prepend, supplemental;
19238
+ prepend = function (prepend) {
19239
+ return function (path) {
19240
+ path = alwaysArray(path);
19241
+ return cldr.get([prepend].concat(path));
19242
+ };
19243
+ };
19244
+ supplemental = prepend("supplemental");
19245
+
19246
+ // Week Data
19247
+ // http://www.unicode.org/reports/tr35/tr35-dates.html#Week_Data
19248
+ supplemental.weekData = prepend("supplemental/weekData");
19249
+ supplemental.weekData.firstDay = function () {
19250
+ return cldr.get("supplemental/weekData/firstDay/{territory}") || cldr.get("supplemental/weekData/firstDay/001");
19251
+ };
19252
+ supplemental.weekData.minDays = function () {
19253
+ var minDays = cldr.get("supplemental/weekData/minDays/{territory}") || cldr.get("supplemental/weekData/minDays/001");
19254
+ return parseInt(minDays, 10);
19255
+ };
19256
+
19257
+ // Time Data
19258
+ // http://www.unicode.org/reports/tr35/tr35-dates.html#Time_Data
19259
+ supplemental.timeData = prepend("supplemental/timeData");
19260
+ supplemental.timeData.allowed = function () {
19261
+ return cldr.get("supplemental/timeData/{territory}/_allowed") || cldr.get("supplemental/timeData/001/_allowed");
19262
+ };
19263
+ supplemental.timeData.preferred = function () {
19264
+ return cldr.get("supplemental/timeData/{territory}/_preferred") || cldr.get("supplemental/timeData/001/_preferred");
19265
+ };
19266
+ return supplemental;
19267
+ };
19268
+ var initSuper = Cldr.prototype.init;
19269
+
19270
+ /**
19271
+ * .init() automatically ran on construction.
19272
+ *
19273
+ * Overload .init().
19274
+ */
19275
+ Cldr.prototype.init = function () {
19276
+ initSuper.apply(this, arguments);
19277
+ this.supplemental = supplementalMain(this);
19278
+ };
19279
+ return Cldr;
19280
+ });
19281
+ } (supplemental));
19282
+
19283
+ var unresolvedExports = {};
19284
+ var unresolved = {
19285
+ get exports(){ return unresolvedExports; },
19286
+ set exports(v){ unresolvedExports = v; },
19287
+ };
19288
+
19289
+ /**
19290
+ * CLDR JavaScript Library v0.5.4
19291
+ * http://jquery.com/
19292
+ *
19293
+ * Copyright 2013 Rafael Xavier de Souza
19294
+ * Released under the MIT license
19295
+ * http://jquery.org/license
19296
+ *
19297
+ * Date: 2020-10-22T15:56Z
18783
19298
  */
18784
- (function (factory) {
18785
- {
18786
- // Node. CommonJS.
18787
- module.exports = factory(cldr.exports);
18788
- }
18789
- })(function (Cldr) {
18790
- // Build optimization hack to avoid duplicating functions across modules.
18791
- var pathNormalize = Cldr._pathNormalize,
18792
- validatePresence = Cldr._validatePresence,
18793
- validateType = Cldr._validateType;
18794
- /*!
18795
- * EventEmitter v4.2.7 - git.io/ee
18796
- * Oliver Caldwell
18797
- * MIT license
18798
- * @preserve
18799
- */
18800
19299
 
18801
- var EventEmitter;
18802
- /* jshint ignore:start */
19300
+ (function (module) {
19301
+ /*!
19302
+ * CLDR JavaScript Library v0.5.4 2020-10-22T15:56Z MIT license © Rafael Xavier
19303
+ * http://git.io/h4lmVg
19304
+ */
19305
+ (function (factory) {
19306
+ {
19307
+ // Node. CommonJS.
19308
+ module.exports = factory(cldrExports);
19309
+ }
19310
+ })(function (Cldr) {
19311
+ // Build optimization hack to avoid duplicating functions across modules.
19312
+ var coreLoad = Cldr._coreLoad;
19313
+ var jsonMerge = Cldr._jsonMerge;
19314
+ var pathNormalize = Cldr._pathNormalize;
19315
+ var resourceGet = Cldr._resourceGet;
19316
+ var validatePresence = Cldr._validatePresence;
19317
+ var validateTypePath = Cldr._validateTypePath;
19318
+ var bundleParentLookup = function (Cldr, locale) {
19319
+ var normalizedPath, parent;
19320
+ if (locale === "root") {
19321
+ return;
19322
+ }
19323
+
19324
+ // First, try to find parent on supplemental data.
19325
+ normalizedPath = pathNormalize(["supplemental/parentLocales/parentLocale", locale]);
19326
+ parent = resourceGet(Cldr._resolved, normalizedPath) || resourceGet(Cldr._raw, normalizedPath);
19327
+ if (parent) {
19328
+ return parent;
19329
+ }
19330
+
19331
+ // Or truncate locale.
19332
+ parent = locale.substr(0, locale.lastIndexOf(Cldr.localeSep));
19333
+ if (!parent) {
19334
+ return "root";
19335
+ }
19336
+ return parent;
19337
+ };
19338
+
19339
+ // @path: normalized path
19340
+ var resourceSet = function (data, path, value) {
19341
+ var i,
19342
+ node = data,
19343
+ length = path.length;
19344
+ for (i = 0; i < length - 1; i++) {
19345
+ if (!node[path[i]]) {
19346
+ node[path[i]] = {};
19347
+ }
19348
+ node = node[path[i]];
19349
+ }
19350
+ node[path[i]] = value;
19351
+ };
19352
+ var itemLookup = function () {
19353
+ var lookup;
19354
+ lookup = function (Cldr, locale, path, attributes, childLocale) {
19355
+ var normalizedPath, parent, value;
19356
+
19357
+ // 1: Finish recursion
19358
+ // 2: Avoid infinite loop
19359
+ if (typeof locale === "undefined" /* 1 */ || locale === childLocale /* 2 */) {
19360
+ return;
19361
+ }
19362
+
19363
+ // Resolve path
19364
+ normalizedPath = pathNormalize(path, attributes);
19365
+
19366
+ // Check resolved (cached) data first
19367
+ // 1: Due to #16, never use the cached resolved non-leaf nodes. It may not
19368
+ // represent its leafs in its entirety.
19369
+ value = resourceGet(Cldr._resolved, normalizedPath);
19370
+ if (value !== undefined && typeof value !== "object" /* 1 */) {
19371
+ return value;
19372
+ }
19373
+
19374
+ // Check raw data
19375
+ value = resourceGet(Cldr._raw, normalizedPath);
19376
+ if (value === undefined) {
19377
+ // Or, lookup at parent locale
19378
+ parent = bundleParentLookup(Cldr, locale);
19379
+ value = lookup(Cldr, parent, path, jsonMerge(attributes, {
19380
+ bundle: parent
19381
+ }), locale);
19382
+ }
19383
+ if (value !== undefined) {
19384
+ // Set resolved (cached)
19385
+ resourceSet(Cldr._resolved, normalizedPath, value);
19386
+ }
19387
+ return value;
19388
+ };
19389
+ return lookup;
19390
+ }();
19391
+ Cldr._raw = {};
19392
+
19393
+ /**
19394
+ * Cldr.load( json [, json, ...] )
19395
+ *
19396
+ * @json [JSON] CLDR data or [Array] Array of @json's.
19397
+ *
19398
+ * Load resolved or unresolved cldr data.
19399
+ * Overwrite Cldr.load().
19400
+ */
19401
+ Cldr.load = function () {
19402
+ Cldr._raw = coreLoad(Cldr, Cldr._raw, arguments);
19403
+ };
19404
+
19405
+ /**
19406
+ * Overwrite Cldr.prototype.get().
19407
+ */
19408
+ Cldr.prototype.get = function (path) {
19409
+ validatePresence(path, "path");
19410
+ validateTypePath(path, "path");
19411
+
19412
+ // 1: use bundle as locale on item lookup for simplification purposes, because no other extended subtag is used anyway on bundle parent lookup.
19413
+ // 2: during init(), this method is called, but bundle is yet not defined. Use "" as a workaround in this very specific scenario.
19414
+ return itemLookup(Cldr, this.attributes && this.attributes.bundle /* 1 */ || "" /* 2 */, path, this.attributes);
19415
+ };
19416
+
19417
+ // In case cldr/unresolved is loaded after cldr/event, we trigger its overloads again. Because, .get is overwritten in here.
19418
+ if (Cldr._eventInit) {
19419
+ Cldr._eventInit();
19420
+ }
19421
+ return Cldr;
19422
+ });
19423
+ } (unresolved));
18803
19424
 
18804
- EventEmitter = function () {
18805
- /**
18806
- * Class for managing events.
18807
- * Can be extended to provide event functionality in other classes.
18808
- *
18809
- * @class EventEmitter Manages event registering and emitting.
18810
- */
18811
- function EventEmitter() {} // Shortcuts to improve speed and size
19425
+ /**
19426
+ * CLDR JavaScript Library v0.5.4
19427
+ * http://jquery.com/
19428
+ *
19429
+ * Copyright 2013 Rafael Xavier de Souza
19430
+ * Released under the MIT license
19431
+ * http://jquery.org/license
19432
+ *
19433
+ * Date: 2020-10-22T15:56Z
19434
+ */
18812
19435
 
19436
+ (function (module) {
19437
+ /*!
19438
+ * CLDR JavaScript Library v0.5.4 2020-10-22T15:56Z MIT license © Rafael Xavier
19439
+ * http://git.io/h4lmVg
19440
+ */
18813
19441
 
18814
- var proto = EventEmitter.prototype;
18815
- /**
18816
- * Finds the index of the listener for the event in it's storage array.
18817
- *
18818
- * @param {Function[]} listeners Array of listeners to search through.
18819
- * @param {Function} listener Method to look for.
18820
- * @return {Number} Index of the specified listener, -1 if not found
18821
- * @api private
18822
- */
19442
+ // Cldr
19443
+ module.exports = cldrExports;
18823
19444
 
18824
- function indexOfListener(listeners, listener) {
18825
- var i = listeners.length;
19445
+ // Extent Cldr with the following modules
19446
+ } (node_main));
18826
19447
 
18827
- while (i--) {
18828
- if (listeners[i].listener === listener) {
18829
- return i;
18830
- }
18831
- }
18832
-
18833
- return -1;
18834
- }
18835
- /**
18836
- * Alias a method while keeping the context correct, to allow for overwriting of target method.
18837
- *
18838
- * @param {String} name The name of the target method.
18839
- * @return {Function} The aliased method
18840
- * @api private
18841
- */
18842
-
18843
-
18844
- function alias(name) {
18845
- return function aliasClosure() {
18846
- return this[name].apply(this, arguments);
18847
- };
18848
- }
18849
- /**
18850
- * Returns the listener array for the specified event.
18851
- * Will initialise the event object and listener arrays if required.
18852
- * Will return an object if you use a regex search. The object contains keys for each matched event. So /ba[rz]/ might return an object containing bar and baz. But only if you have either defined them with defineEvent or added some listeners to them.
18853
- * Each property in the object response is an array of listener functions.
18854
- *
18855
- * @param {String|RegExp} evt Name of the event to return the listeners from.
18856
- * @return {Function[]|Object} All listener functions for the event.
18857
- */
18858
-
18859
-
18860
- proto.getListeners = function getListeners(evt) {
18861
- var events = this._getEvents();
18862
-
18863
- var response;
18864
- var key; // Return a concatenated array of all matching events if
18865
- // the selector is a regular expression.
18866
-
18867
- if (evt instanceof RegExp) {
18868
- response = {};
18869
-
18870
- for (key in events) {
18871
- if (events.hasOwnProperty(key) && evt.test(key)) {
18872
- response[key] = events[key];
18873
- }
18874
- }
18875
- } else {
18876
- response = events[evt] || (events[evt] = []);
18877
- }
18878
-
18879
- return response;
18880
- };
18881
- /**
18882
- * Takes a list of listener objects and flattens it into a list of listener functions.
18883
- *
18884
- * @param {Object[]} listeners Raw listener objects.
18885
- * @return {Function[]} Just the listener functions.
18886
- */
18887
-
18888
-
18889
- proto.flattenListeners = function flattenListeners(listeners) {
18890
- var flatListeners = [];
18891
- var i;
18892
-
18893
- for (i = 0; i < listeners.length; i += 1) {
18894
- flatListeners.push(listeners[i].listener);
18895
- }
18896
-
18897
- return flatListeners;
18898
- };
18899
- /**
18900
- * Fetches the requested listeners via getListeners but will always return the results inside an object. This is mainly for internal use but others may find it useful.
18901
- *
18902
- * @param {String|RegExp} evt Name of the event to return the listeners from.
18903
- * @return {Object} All listener functions for an event in an object.
18904
- */
18905
-
18906
-
18907
- proto.getListenersAsObject = function getListenersAsObject(evt) {
18908
- var listeners = this.getListeners(evt);
18909
- var response;
18910
-
18911
- if (listeners instanceof Array) {
18912
- response = {};
18913
- response[evt] = listeners;
18914
- }
18915
-
18916
- return response || listeners;
18917
- };
18918
- /**
18919
- * Adds a listener function to the specified event.
18920
- * The listener will not be added if it is a duplicate.
18921
- * If the listener returns true then it will be removed after it is called.
18922
- * If you pass a regular expression as the event name then the listener will be added to all events that match it.
18923
- *
18924
- * @param {String|RegExp} evt Name of the event to attach the listener to.
18925
- * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.
18926
- * @return {Object} Current instance of EventEmitter for chaining.
18927
- */
18928
-
18929
-
18930
- proto.addListener = function addListener(evt, listener) {
18931
- var listeners = this.getListenersAsObject(evt);
18932
- var listenerIsWrapped = typeof listener === 'object';
18933
- var key;
18934
-
18935
- for (key in listeners) {
18936
- if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) {
18937
- listeners[key].push(listenerIsWrapped ? listener : {
18938
- listener: listener,
18939
- once: false
18940
- });
18941
- }
18942
- }
18943
-
18944
- return this;
18945
- };
18946
- /**
18947
- * Alias of addListener
18948
- */
18949
-
18950
-
18951
- proto.on = alias('addListener');
18952
- /**
18953
- * Semi-alias of addListener. It will add a listener that will be
18954
- * automatically removed after it's first execution.
18955
- *
18956
- * @param {String|RegExp} evt Name of the event to attach the listener to.
18957
- * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.
18958
- * @return {Object} Current instance of EventEmitter for chaining.
18959
- */
18960
-
18961
- proto.addOnceListener = function addOnceListener(evt, listener) {
18962
- return this.addListener(evt, {
18963
- listener: listener,
18964
- once: true
18965
- });
18966
- };
18967
- /**
18968
- * Alias of addOnceListener.
18969
- */
18970
-
18971
-
18972
- proto.once = alias('addOnceListener');
18973
- /**
18974
- * Defines an event name. This is required if you want to use a regex to add a listener to multiple events at once. If you don't do this then how do you expect it to know what event to add to? Should it just add to every possible match for a regex? No. That is scary and bad.
18975
- * You need to tell it what event names should be matched by a regex.
18976
- *
18977
- * @param {String} evt Name of the event to create.
18978
- * @return {Object} Current instance of EventEmitter for chaining.
18979
- */
18980
-
18981
- proto.defineEvent = function defineEvent(evt) {
18982
- this.getListeners(evt);
18983
- return this;
18984
- };
18985
- /**
18986
- * Uses defineEvent to define multiple events.
18987
- *
18988
- * @param {String[]} evts An array of event names to define.
18989
- * @return {Object} Current instance of EventEmitter for chaining.
18990
- */
18991
-
18992
-
18993
- proto.defineEvents = function defineEvents(evts) {
18994
- for (var i = 0; i < evts.length; i += 1) {
18995
- this.defineEvent(evts[i]);
18996
- }
18997
-
18998
- return this;
18999
- };
19000
- /**
19001
- * Removes a listener function from the specified event.
19002
- * When passed a regular expression as the event name, it will remove the listener from all events that match it.
19003
- *
19004
- * @param {String|RegExp} evt Name of the event to remove the listener from.
19005
- * @param {Function} listener Method to remove from the event.
19006
- * @return {Object} Current instance of EventEmitter for chaining.
19007
- */
19008
-
19009
-
19010
- proto.removeListener = function removeListener(evt, listener) {
19011
- var listeners = this.getListenersAsObject(evt);
19012
- var index;
19013
- var key;
19014
-
19015
- for (key in listeners) {
19016
- if (listeners.hasOwnProperty(key)) {
19017
- index = indexOfListener(listeners[key], listener);
19018
-
19019
- if (index !== -1) {
19020
- listeners[key].splice(index, 1);
19021
- }
19022
- }
19023
- }
19024
-
19025
- return this;
19026
- };
19027
- /**
19028
- * Alias of removeListener
19029
- */
19030
-
19031
-
19032
- proto.off = alias('removeListener');
19033
- /**
19034
- * Adds listeners in bulk using the manipulateListeners method.
19035
- * If you pass an object as the second argument you can add to multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. You can also pass it an event name and an array of listeners to be added.
19036
- * You can also pass it a regular expression to add the array of listeners to all events that match it.
19037
- * Yeah, this function does quite a bit. That's probably a bad thing.
19038
- *
19039
- * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add to multiple events at once.
19040
- * @param {Function[]} [listeners] An optional array of listener functions to add.
19041
- * @return {Object} Current instance of EventEmitter for chaining.
19042
- */
19043
-
19044
- proto.addListeners = function addListeners(evt, listeners) {
19045
- // Pass through to manipulateListeners
19046
- return this.manipulateListeners(false, evt, listeners);
19047
- };
19048
- /**
19049
- * Removes listeners in bulk using the manipulateListeners method.
19050
- * If you pass an object as the second argument you can remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.
19051
- * You can also pass it an event name and an array of listeners to be removed.
19052
- * You can also pass it a regular expression to remove the listeners from all events that match it.
19053
- *
19054
- * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to remove from multiple events at once.
19055
- * @param {Function[]} [listeners] An optional array of listener functions to remove.
19056
- * @return {Object} Current instance of EventEmitter for chaining.
19057
- */
19058
-
19059
-
19060
- proto.removeListeners = function removeListeners(evt, listeners) {
19061
- // Pass through to manipulateListeners
19062
- return this.manipulateListeners(true, evt, listeners);
19063
- };
19064
- /**
19065
- * Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. You should really use those instead, this is a little lower level.
19066
- * The first argument will determine if the listeners are removed (true) or added (false).
19067
- * If you pass an object as the second argument you can add/remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.
19068
- * You can also pass it an event name and an array of listeners to be added/removed.
19069
- * You can also pass it a regular expression to manipulate the listeners of all events that match it.
19070
- *
19071
- * @param {Boolean} remove True if you want to remove listeners, false if you want to add.
19072
- * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add/remove from multiple events at once.
19073
- * @param {Function[]} [listeners] An optional array of listener functions to add/remove.
19074
- * @return {Object} Current instance of EventEmitter for chaining.
19075
- */
19076
-
19077
-
19078
- proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) {
19079
- var i;
19080
- var value;
19081
- var single = remove ? this.removeListener : this.addListener;
19082
- var multiple = remove ? this.removeListeners : this.addListeners; // If evt is an object then pass each of it's properties to this method
19083
-
19084
- if (typeof evt === 'object' && !(evt instanceof RegExp)) {
19085
- for (i in evt) {
19086
- if (evt.hasOwnProperty(i) && (value = evt[i])) {
19087
- // Pass the single listener straight through to the singular method
19088
- if (typeof value === 'function') {
19089
- single.call(this, i, value);
19090
- } else {
19091
- // Otherwise pass back to the multiple function
19092
- multiple.call(this, i, value);
19093
- }
19094
- }
19095
- }
19096
- } else {
19097
- // So evt must be a string
19098
- // And listeners must be an array of listeners
19099
- // Loop over it and pass each one to the multiple method
19100
- i = listeners.length;
19101
-
19102
- while (i--) {
19103
- single.call(this, evt, listeners[i]);
19104
- }
19105
- }
19106
-
19107
- return this;
19108
- };
19109
- /**
19110
- * Removes all listeners from a specified event.
19111
- * If you do not specify an event then all listeners will be removed.
19112
- * That means every event will be emptied.
19113
- * You can also pass a regex to remove all events that match it.
19114
- *
19115
- * @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed.
19116
- * @return {Object} Current instance of EventEmitter for chaining.
19117
- */
19118
-
19119
-
19120
- proto.removeEvent = function removeEvent(evt) {
19121
- var type = typeof evt;
19122
-
19123
- var events = this._getEvents();
19124
-
19125
- var key; // Remove different things depending on the state of evt
19126
-
19127
- if (type === 'string') {
19128
- // Remove all listeners for the specified event
19129
- delete events[evt];
19130
- } else if (evt instanceof RegExp) {
19131
- // Remove all events matching the regex.
19132
- for (key in events) {
19133
- if (events.hasOwnProperty(key) && evt.test(key)) {
19134
- delete events[key];
19135
- }
19136
- }
19137
- } else {
19138
- // Remove all listeners in all events
19139
- delete this._events;
19140
- }
19141
-
19142
- return this;
19143
- };
19144
- /**
19145
- * Alias of removeEvent.
19146
- *
19147
- * Added to mirror the node API.
19148
- */
19149
-
19150
-
19151
- proto.removeAllListeners = alias('removeEvent');
19152
- /**
19153
- * Emits an event of your choice.
19154
- * When emitted, every listener attached to that event will be executed.
19155
- * If you pass the optional argument array then those arguments will be passed to every listener upon execution.
19156
- * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately.
19157
- * So they will not arrive within the array on the other side, they will be separate.
19158
- * You can also pass a regular expression to emit to all events that match it.
19159
- *
19160
- * @param {String|RegExp} evt Name of the event to emit and execute listeners for.
19161
- * @param {Array} [args] Optional array of arguments to be passed to each listener.
19162
- * @return {Object} Current instance of EventEmitter for chaining.
19163
- */
19164
-
19165
- proto.emitEvent = function emitEvent(evt, args) {
19166
- var listeners = this.getListenersAsObject(evt);
19167
- var listener;
19168
- var i;
19169
- var key;
19170
- var response;
19171
-
19172
- for (key in listeners) {
19173
- if (listeners.hasOwnProperty(key)) {
19174
- i = listeners[key].length;
19175
-
19176
- while (i--) {
19177
- // If the listener returns true then it shall be removed from the event
19178
- // The function is executed either with a basic call or an apply if there is an args array
19179
- listener = listeners[key][i];
19180
-
19181
- if (listener.once === true) {
19182
- this.removeListener(evt, listener.listener);
19183
- }
19184
-
19185
- response = listener.listener.apply(this, args || []);
19186
-
19187
- if (response === this._getOnceReturnValue()) {
19188
- this.removeListener(evt, listener.listener);
19189
- }
19190
- }
19191
- }
19192
- }
19193
-
19194
- return this;
19195
- };
19196
- /**
19197
- * Alias of emitEvent
19198
- */
19199
-
19200
-
19201
- proto.trigger = alias('emitEvent');
19202
- /**
19203
- * Subtly different from emitEvent in that it will pass its arguments on to the listeners, as opposed to taking a single array of arguments to pass on.
19204
- * As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it.
19205
- *
19206
- * @param {String|RegExp} evt Name of the event to emit and execute listeners for.
19207
- * @param {...*} Optional additional arguments to be passed to each listener.
19208
- * @return {Object} Current instance of EventEmitter for chaining.
19209
- */
19210
-
19211
- proto.emit = function emit(evt) {
19212
- var args = Array.prototype.slice.call(arguments, 1);
19213
- return this.emitEvent(evt, args);
19214
- };
19215
- /**
19216
- * Sets the current value to check against when executing listeners. If a
19217
- * listeners return value matches the one set here then it will be removed
19218
- * after execution. This value defaults to true.
19219
- *
19220
- * @param {*} value The new value to check for when executing listeners.
19221
- * @return {Object} Current instance of EventEmitter for chaining.
19222
- */
19223
-
19224
-
19225
- proto.setOnceReturnValue = function setOnceReturnValue(value) {
19226
- this._onceReturnValue = value;
19227
- return this;
19228
- };
19229
- /**
19230
- * Fetches the current value to check against when executing listeners. If
19231
- * the listeners return value matches this one then it should be removed
19232
- * automatically. It will return true by default.
19233
- *
19234
- * @return {*|Boolean} The current value to check for or the default, true.
19235
- * @api private
19236
- */
19237
-
19238
-
19239
- proto._getOnceReturnValue = function _getOnceReturnValue() {
19240
- if (this.hasOwnProperty('_onceReturnValue')) {
19241
- return this._onceReturnValue;
19242
- } else {
19243
- return true;
19244
- }
19245
- };
19246
- /**
19247
- * Fetches the events object and creates one if required.
19248
- *
19249
- * @return {Object} The events storage object.
19250
- * @api private
19251
- */
19252
-
19253
-
19254
- proto._getEvents = function _getEvents() {
19255
- return this._events || (this._events = {});
19256
- };
19257
- /**
19258
- * Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version.
19259
- *
19260
- * @return {Function} Non conflicting EventEmitter class.
19261
- */
19262
-
19263
-
19264
- EventEmitter.noConflict = function noConflict() {
19265
- originalGlobalValue;
19266
- return EventEmitter;
19267
- };
19268
-
19269
- return EventEmitter;
19270
- }();
19271
- /* jshint ignore:end */
19272
-
19273
-
19274
- var validateTypeFunction = function (value, name) {
19275
- validateType(value, name, typeof value === "undefined" || typeof value === "function", "Function");
19276
- };
19277
-
19278
- var superGet,
19279
- superInit,
19280
- globalEe = new EventEmitter();
19281
-
19282
- function validateTypeEvent(value, name) {
19283
- validateType(value, name, typeof value === "string" || value instanceof RegExp, "String or RegExp");
19284
- }
19285
-
19286
- function validateThenCall(method, self) {
19287
- return function (event, listener) {
19288
- validatePresence(event, "event");
19289
- validateTypeEvent(event, "event");
19290
- validatePresence(listener, "listener");
19291
- validateTypeFunction(listener, "listener");
19292
- return self[method].apply(self, arguments);
19293
- };
19294
- }
19295
-
19296
- function off(self) {
19297
- return validateThenCall("off", self);
19298
- }
19299
-
19300
- function on(self) {
19301
- return validateThenCall("on", self);
19302
- }
19303
-
19304
- function once(self) {
19305
- return validateThenCall("once", self);
19306
- }
19307
-
19308
- Cldr.off = off(globalEe);
19309
- Cldr.on = on(globalEe);
19310
- Cldr.once = once(globalEe);
19311
- /**
19312
- * Overload Cldr.prototype.init().
19313
- */
19314
-
19315
- superInit = Cldr.prototype.init;
19316
-
19317
- Cldr.prototype.init = function () {
19318
- var ee;
19319
- this.ee = ee = new EventEmitter();
19320
- this.off = off(ee);
19321
- this.on = on(ee);
19322
- this.once = once(ee);
19323
- superInit.apply(this, arguments);
19324
- };
19325
- /**
19326
- * getOverload is encapsulated, because of cldr/unresolved. If it's loaded
19327
- * after cldr/event (and note it overwrites .get), it can trigger this
19328
- * overload again.
19329
- */
19330
-
19331
-
19332
- function getOverload() {
19333
- /**
19334
- * Overload Cldr.prototype.get().
19335
- */
19336
- superGet = Cldr.prototype.get;
19337
-
19338
- Cldr.prototype.get = function (path) {
19339
- var value = superGet.apply(this, arguments);
19340
- path = pathNormalize(path, this.attributes).join("/");
19341
- globalEe.trigger("get", [path, value]);
19342
- this.ee.trigger("get", [path, value]);
19343
- return value;
19344
- };
19345
- }
19346
-
19347
- Cldr._eventInit = getOverload;
19348
- getOverload();
19349
- return Cldr;
19350
- });
19351
- }(event));
19352
-
19353
- var supplemental = {exports: {}};
19354
-
19355
- /**
19356
- * CLDR JavaScript Library v0.5.4
19357
- * http://jquery.com/
19358
- *
19359
- * Copyright 2013 Rafael Xavier de Souza
19360
- * Released under the MIT license
19361
- * http://jquery.org/license
19362
- *
19363
- * Date: 2020-10-22T15:56Z
19364
- */
19365
-
19366
- (function (module) {
19367
- /*!
19368
- * CLDR JavaScript Library v0.5.4 2020-10-22T15:56Z MIT license © Rafael Xavier
19369
- * http://git.io/h4lmVg
19370
- */
19371
- (function (factory) {
19372
- {
19373
- // Node. CommonJS.
19374
- module.exports = factory(cldr.exports);
19375
- }
19376
- })(function (Cldr) {
19377
- // Build optimization hack to avoid duplicating functions across modules.
19378
- var alwaysArray = Cldr._alwaysArray;
19379
-
19380
- var supplementalMain = function (cldr) {
19381
- var prepend, supplemental;
19382
-
19383
- prepend = function (prepend) {
19384
- return function (path) {
19385
- path = alwaysArray(path);
19386
- return cldr.get([prepend].concat(path));
19387
- };
19388
- };
19389
-
19390
- supplemental = prepend("supplemental"); // Week Data
19391
- // http://www.unicode.org/reports/tr35/tr35-dates.html#Week_Data
19392
-
19393
- supplemental.weekData = prepend("supplemental/weekData");
19394
-
19395
- supplemental.weekData.firstDay = function () {
19396
- return cldr.get("supplemental/weekData/firstDay/{territory}") || cldr.get("supplemental/weekData/firstDay/001");
19397
- };
19398
-
19399
- supplemental.weekData.minDays = function () {
19400
- var minDays = cldr.get("supplemental/weekData/minDays/{territory}") || cldr.get("supplemental/weekData/minDays/001");
19401
- return parseInt(minDays, 10);
19402
- }; // Time Data
19403
- // http://www.unicode.org/reports/tr35/tr35-dates.html#Time_Data
19404
-
19405
-
19406
- supplemental.timeData = prepend("supplemental/timeData");
19407
-
19408
- supplemental.timeData.allowed = function () {
19409
- return cldr.get("supplemental/timeData/{territory}/_allowed") || cldr.get("supplemental/timeData/001/_allowed");
19410
- };
19411
-
19412
- supplemental.timeData.preferred = function () {
19413
- return cldr.get("supplemental/timeData/{territory}/_preferred") || cldr.get("supplemental/timeData/001/_preferred");
19414
- };
19415
-
19416
- return supplemental;
19417
- };
19418
-
19419
- var initSuper = Cldr.prototype.init;
19420
- /**
19421
- * .init() automatically ran on construction.
19422
- *
19423
- * Overload .init().
19424
- */
19425
-
19426
- Cldr.prototype.init = function () {
19427
- initSuper.apply(this, arguments);
19428
- this.supplemental = supplementalMain(this);
19429
- };
19430
-
19431
- return Cldr;
19432
- });
19433
- }(supplemental));
19434
-
19435
- var unresolved = {exports: {}};
19436
-
19437
- /**
19438
- * CLDR JavaScript Library v0.5.4
19439
- * http://jquery.com/
19440
- *
19441
- * Copyright 2013 Rafael Xavier de Souza
19442
- * Released under the MIT license
19443
- * http://jquery.org/license
19444
- *
19445
- * Date: 2020-10-22T15:56Z
19446
- */
19447
-
19448
- (function (module) {
19449
- /*!
19450
- * CLDR JavaScript Library v0.5.4 2020-10-22T15:56Z MIT license © Rafael Xavier
19451
- * http://git.io/h4lmVg
19452
- */
19453
- (function (factory) {
19454
- {
19455
- // Node. CommonJS.
19456
- module.exports = factory(cldr.exports);
19457
- }
19458
- })(function (Cldr) {
19459
- // Build optimization hack to avoid duplicating functions across modules.
19460
- var coreLoad = Cldr._coreLoad;
19461
- var jsonMerge = Cldr._jsonMerge;
19462
- var pathNormalize = Cldr._pathNormalize;
19463
- var resourceGet = Cldr._resourceGet;
19464
- var validatePresence = Cldr._validatePresence;
19465
- var validateTypePath = Cldr._validateTypePath;
19466
-
19467
- var bundleParentLookup = function (Cldr, locale) {
19468
- var normalizedPath, parent;
19469
-
19470
- if (locale === "root") {
19471
- return;
19472
- } // First, try to find parent on supplemental data.
19473
-
19474
-
19475
- normalizedPath = pathNormalize(["supplemental/parentLocales/parentLocale", locale]);
19476
- parent = resourceGet(Cldr._resolved, normalizedPath) || resourceGet(Cldr._raw, normalizedPath);
19477
-
19478
- if (parent) {
19479
- return parent;
19480
- } // Or truncate locale.
19481
-
19482
-
19483
- parent = locale.substr(0, locale.lastIndexOf(Cldr.localeSep));
19484
-
19485
- if (!parent) {
19486
- return "root";
19487
- }
19488
-
19489
- return parent;
19490
- }; // @path: normalized path
19491
-
19492
-
19493
- var resourceSet = function (data, path, value) {
19494
- var i,
19495
- node = data,
19496
- length = path.length;
19497
-
19498
- for (i = 0; i < length - 1; i++) {
19499
- if (!node[path[i]]) {
19500
- node[path[i]] = {};
19501
- }
19502
-
19503
- node = node[path[i]];
19504
- }
19505
-
19506
- node[path[i]] = value;
19507
- };
19508
-
19509
- var itemLookup = function () {
19510
- var lookup;
19511
-
19512
- lookup = function (Cldr, locale, path, attributes, childLocale) {
19513
- var normalizedPath, parent, value; // 1: Finish recursion
19514
- // 2: Avoid infinite loop
19515
-
19516
- if (typeof locale === "undefined"
19517
- /* 1 */
19518
- || locale === childLocale
19519
- /* 2 */
19520
- ) {
19521
- return;
19522
- } // Resolve path
19523
-
19524
-
19525
- normalizedPath = pathNormalize(path, attributes); // Check resolved (cached) data first
19526
- // 1: Due to #16, never use the cached resolved non-leaf nodes. It may not
19527
- // represent its leafs in its entirety.
19528
-
19529
- value = resourceGet(Cldr._resolved, normalizedPath);
19530
-
19531
- if (value !== undefined && typeof value !== "object"
19532
- /* 1 */
19533
- ) {
19534
- return value;
19535
- } // Check raw data
19536
-
19537
-
19538
- value = resourceGet(Cldr._raw, normalizedPath);
19539
-
19540
- if (value === undefined) {
19541
- // Or, lookup at parent locale
19542
- parent = bundleParentLookup(Cldr, locale);
19543
- value = lookup(Cldr, parent, path, jsonMerge(attributes, {
19544
- bundle: parent
19545
- }), locale);
19546
- }
19547
-
19548
- if (value !== undefined) {
19549
- // Set resolved (cached)
19550
- resourceSet(Cldr._resolved, normalizedPath, value);
19551
- }
19552
-
19553
- return value;
19554
- };
19555
-
19556
- return lookup;
19557
- }();
19558
-
19559
- Cldr._raw = {};
19560
- /**
19561
- * Cldr.load( json [, json, ...] )
19562
- *
19563
- * @json [JSON] CLDR data or [Array] Array of @json's.
19564
- *
19565
- * Load resolved or unresolved cldr data.
19566
- * Overwrite Cldr.load().
19567
- */
19568
-
19569
- Cldr.load = function () {
19570
- Cldr._raw = coreLoad(Cldr, Cldr._raw, arguments);
19571
- };
19572
- /**
19573
- * Overwrite Cldr.prototype.get().
19574
- */
19575
-
19576
-
19577
- Cldr.prototype.get = function (path) {
19578
- validatePresence(path, "path");
19579
- validateTypePath(path, "path"); // 1: use bundle as locale on item lookup for simplification purposes, because no other extended subtag is used anyway on bundle parent lookup.
19580
- // 2: during init(), this method is called, but bundle is yet not defined. Use "" as a workaround in this very specific scenario.
19581
-
19582
- return itemLookup(Cldr, this.attributes && this.attributes.bundle
19583
- /* 1 */
19584
- || ""
19585
- /* 2 */
19586
- , path, this.attributes);
19587
- }; // In case cldr/unresolved is loaded after cldr/event, we trigger its overloads again. Because, .get is overwritten in here.
19588
-
19589
-
19590
- if (Cldr._eventInit) {
19591
- Cldr._eventInit();
19592
- }
19593
-
19594
- return Cldr;
19595
- });
19596
- }(unresolved));
19597
-
19598
- /**
19599
- * CLDR JavaScript Library v0.5.4
19600
- * http://jquery.com/
19601
- *
19602
- * Copyright 2013 Rafael Xavier de Souza
19603
- * Released under the MIT license
19604
- * http://jquery.org/license
19605
- *
19606
- * Date: 2020-10-22T15:56Z
19607
- */
19608
-
19609
- /*!
19610
- * CLDR JavaScript Library v0.5.4 2020-10-22T15:56Z MIT license © Rafael Xavier
19611
- * http://git.io/h4lmVg
19612
- */
19613
- // Cldr
19614
- var node_main = cldr.exports; // Extent Cldr with the following modules
19448
+ var Cldr = /*@__PURE__*/getDefaultExportFromCjs(node_mainExports);
19615
19449
 
19616
19450
  /*
19617
19451
  * @copyright (c) 2020, Philipp Thuerwaechter & Pattrick Hueper
@@ -19620,16 +19454,15 @@ var node_main = cldr.exports; // Extent Cldr with the following modules
19620
19454
  var cldrDataLoaded = new Set();
19621
19455
  var loadCldrData = function loadCldrData(path) {
19622
19456
  if (!cldrDataLoaded.has(path)) {
19623
- node_main.load(cldrData(path));
19457
+ Cldr.load(cldrData(path));
19624
19458
  cldrDataLoaded.add(path);
19625
19459
  }
19626
19460
  };
19627
19461
  var localeToCldrInstanceCache = {};
19628
19462
  var getOrCreateCldrInstance = function getOrCreateCldrInstance(locale) {
19629
19463
  if (localeToCldrInstanceCache[locale] == null) {
19630
- localeToCldrInstanceCache[locale] = new node_main(locale);
19464
+ localeToCldrInstanceCache[locale] = new Cldr(locale);
19631
19465
  }
19632
-
19633
19466
  return localeToCldrInstanceCache[locale];
19634
19467
  };
19635
19468
  var localeToMapZonesCache = {};
@@ -19641,13 +19474,11 @@ var getOrCreateMapZones = function getOrCreateMapZones(cldr) {
19641
19474
  if (!mapZones[metaZone.mapZone._other]) {
19642
19475
  mapZones[metaZone.mapZone._other] = {};
19643
19476
  }
19644
-
19645
19477
  mapZones[metaZone.mapZone._other][metaZone.mapZone._territory] = metaZone.mapZone._type;
19646
19478
  }
19647
19479
  });
19648
19480
  localeToMapZonesCache[cldr.locale] = mapZones;
19649
19481
  }
19650
-
19651
19482
  return localeToMapZonesCache[cldr.locale];
19652
19483
  };
19653
19484
 
@@ -19655,55 +19486,41 @@ var getOrCreateMapZones = function getOrCreateMapZones(cldr) {
19655
19486
  * @copyright (c) 2017, Philipp Thuerwaechter & Pattrick Hueper
19656
19487
  * @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
19657
19488
  */
19658
-
19659
19489
  var CldrDateTimeTextProvider = function () {
19660
19490
  function CldrDateTimeTextProvider() {
19661
19491
  this._cache = {};
19662
19492
  loadCldrData('supplemental/likelySubtags.json');
19663
19493
  }
19664
-
19665
19494
  var _proto = CldrDateTimeTextProvider.prototype;
19666
-
19667
19495
  _proto.getAvailableLocales = function getAvailableLocales() {
19668
19496
  return cldrData('availableLocales.json').availableLocales;
19669
19497
  };
19670
-
19671
19498
  _proto.getText = function getText(field, value, style, locale) {
19672
19499
  var store = this._findStore(field, locale);
19673
-
19674
19500
  if (store instanceof LocaleStore) {
19675
19501
  return store.getText(value, style);
19676
19502
  }
19677
-
19678
19503
  return null;
19679
19504
  };
19680
-
19681
19505
  _proto.getTextIterator = function getTextIterator(field, style, locale) {
19682
19506
  var store = this._findStore(field, locale);
19683
-
19684
19507
  if (store instanceof LocaleStore) {
19685
19508
  return store.getTextIterator(style);
19686
19509
  }
19687
-
19688
19510
  return null;
19689
19511
  };
19690
-
19691
19512
  _proto._findStore = function _findStore(field, locale) {
19692
19513
  var key = createEntry(field, locale);
19693
19514
  var store = this._cache[key];
19694
-
19695
19515
  if (store === undefined) {
19696
19516
  store = this._createStore(field, locale);
19697
19517
  this._cache[key] = store;
19698
19518
  }
19699
-
19700
19519
  return store;
19701
19520
  };
19702
-
19703
19521
  _proto._createStore = function _createStore(field, locale) {
19704
19522
  loadCldrData("main/" + locale.localeString() + "/ca-gregorian.json");
19705
19523
  var cldr = getOrCreateCldrInstance(locale.localeString());
19706
-
19707
19524
  if (field === ChronoField.MONTH_OF_YEAR) {
19708
19525
  var monthsData = cldr.main('dates/calendars/gregorian/months/format');
19709
19526
  var styleMap = {};
@@ -19751,7 +19568,6 @@ var CldrDateTimeTextProvider = function () {
19751
19568
  styleMap[TextStyle.SHORT] = data;
19752
19569
  return this._createLocaleStore(styleMap);
19753
19570
  }
19754
-
19755
19571
  if (field === ChronoField.DAY_OF_WEEK) {
19756
19572
  var daysData = cldr.main('dates/calendars/gregorian/days/format');
19757
19573
  var _styleMap = {};
@@ -19784,7 +19600,6 @@ var CldrDateTimeTextProvider = function () {
19784
19600
  _styleMap[TextStyle.SHORT] = _data;
19785
19601
  return this._createLocaleStore(_styleMap);
19786
19602
  }
19787
-
19788
19603
  if (field === ChronoField.AMPM_OF_DAY) {
19789
19604
  var dayPeriodsData = cldr.main('dates/calendars/gregorian/dayPeriods/format');
19790
19605
  var _styleMap2 = {};
@@ -19802,7 +19617,6 @@ var CldrDateTimeTextProvider = function () {
19802
19617
  _styleMap2[TextStyle.SHORT] = _data2;
19803
19618
  return this._createLocaleStore(_styleMap2);
19804
19619
  }
19805
-
19806
19620
  if (field === ChronoField.ERA) {
19807
19621
  var erasData = cldr.main('dates/calendars/gregorian/eras');
19808
19622
  var _styleMap3 = {};
@@ -19820,7 +19634,6 @@ var CldrDateTimeTextProvider = function () {
19820
19634
  _styleMap3[TextStyle.SHORT] = _data3;
19821
19635
  return this._createLocaleStore(_styleMap3);
19822
19636
  }
19823
-
19824
19637
  if (field === IsoFields.QUARTER_OF_YEAR) {
19825
19638
  var quartersData = cldr.main('dates/calendars/gregorian/quarters/format');
19826
19639
  var _styleMap4 = {};
@@ -19844,40 +19657,30 @@ var CldrDateTimeTextProvider = function () {
19844
19657
  _styleMap4[TextStyle.SHORT] = _data4;
19845
19658
  return this._createLocaleStore(_styleMap4);
19846
19659
  }
19847
-
19848
19660
  return null;
19849
19661
  };
19850
-
19851
19662
  _proto._createLocaleStore = function _createLocaleStore(valueTextMap) {
19852
19663
  valueTextMap[TextStyle.FULL_STANDALONE] = valueTextMap[TextStyle.FULL];
19853
19664
  valueTextMap[TextStyle.SHORT_STANDALONE] = valueTextMap[TextStyle.SHORT];
19854
-
19855
19665
  if (Object.keys(valueTextMap).indexOf(TextStyle.NARROW) > -1 && Object.keys(valueTextMap).indexOf(TextStyle.NARROW_STANDALONE) === -1) {
19856
19666
  valueTextMap[TextStyle.NARROW_STANDALONE] = valueTextMap[TextStyle.NARROW];
19857
19667
  }
19858
-
19859
19668
  return new LocaleStore(valueTextMap);
19860
19669
  };
19861
-
19862
19670
  return CldrDateTimeTextProvider;
19863
19671
  }();
19864
19672
 
19865
19673
  var _jodaInternal$assert$2 = _.assert,
19866
- requireNonNull$3 = _jodaInternal$assert$2.requireNonNull,
19867
- requireInstance$2 = _jodaInternal$assert$2.requireInstance;
19868
-
19674
+ requireNonNull$3 = _jodaInternal$assert$2.requireNonNull,
19675
+ requireInstance$2 = _jodaInternal$assert$2.requireInstance;
19869
19676
  var LENGTH_COMPARATOR = function LENGTH_COMPARATOR(str1, str2) {
19870
19677
  var cmp = str2.length - str1.length;
19871
-
19872
19678
  if (cmp === 0) {
19873
19679
  cmp = str1.localeCompare(str2);
19874
19680
  }
19875
-
19876
19681
  return cmp;
19877
19682
  };
19878
-
19879
19683
  var resolveZoneIdTextCache = {};
19880
-
19881
19684
  var CldrZoneTextPrinterParser = function () {
19882
19685
  function CldrZoneTextPrinterParser(textStyle) {
19883
19686
  requireNonNull$3(textStyle, 'textStyle');
@@ -19887,69 +19690,52 @@ var CldrZoneTextPrinterParser = function () {
19887
19690
  loadCldrData('supplemental/likelySubtags.json');
19888
19691
  loadCldrData('supplemental/metaZones.json');
19889
19692
  }
19890
-
19891
19693
  var _proto = CldrZoneTextPrinterParser.prototype;
19892
-
19893
19694
  _proto._cachedResolveZoneIdText = function _cachedResolveZoneIdText(cldr, zoneId, style, type) {
19894
19695
  if (resolveZoneIdTextCache[cldr.locale] == null) {
19895
19696
  resolveZoneIdTextCache[cldr.locale] = {};
19896
19697
  }
19897
-
19898
19698
  var zoneIdToStyle = resolveZoneIdTextCache[cldr.locale];
19899
-
19900
19699
  if (zoneIdToStyle[zoneId] == null) {
19901
19700
  zoneIdToStyle[zoneId] = {};
19902
19701
  }
19903
-
19904
19702
  var styleToType = zoneIdToStyle[zoneId];
19905
-
19906
19703
  if (styleToType[style] == null) {
19907
19704
  styleToType[style] = {};
19908
19705
  }
19909
-
19910
19706
  var typeToResolvedZoneIdText = styleToType[style];
19911
-
19912
19707
  if (typeToResolvedZoneIdText[type] == null) {
19913
19708
  typeToResolvedZoneIdText[type] = this._resolveZoneIdText(cldr, zoneId, style, type);
19914
19709
  }
19915
-
19916
19710
  return typeToResolvedZoneIdText[type];
19917
19711
  };
19918
-
19919
19712
  _proto._resolveZoneIdText = function _resolveZoneIdText(cldr, zoneId, style, type) {
19920
19713
  var zoneData = cldr.main("dates/timeZoneNames/zone/" + zoneId + "/" + style + "/" + type);
19921
-
19922
19714
  if (zoneData) {
19923
19715
  return zoneData;
19924
19716
  } else {
19925
19717
  var metazoneInfo = cldr.get("supplemental/metaZones/metazoneInfo/timezone/" + zoneId);
19926
-
19927
19718
  if (metazoneInfo) {
19928
19719
  var metazone = metazoneInfo[metazoneInfo.length - 1]['usesMetazone']['_mzone'];
19929
19720
  var metaZoneData = cldr.main("dates/timeZoneNames/metazone/" + metazone + "/" + style + "/" + type);
19930
-
19931
19721
  if (metaZoneData) {
19932
19722
  return metaZoneData;
19933
19723
  } else {
19934
19724
  metaZoneData = cldr.main("dates/timeZoneNames/metazone/" + metazone + "/" + style + "/generic");
19935
-
19936
19725
  if (!metaZoneData) {
19937
19726
  metaZoneData = cldr.main("dates/timeZoneNames/metazone/" + metazone + "/" + style + "/standard");
19938
19727
  }
19939
-
19940
19728
  if (metaZoneData) {
19941
19729
  return metaZoneData;
19942
19730
  } else {
19943
19731
  var mapZones = getOrCreateMapZones(cldr);
19944
19732
  var preferredZone = mapZones[metazone][cldr.attributes.territory];
19945
-
19946
19733
  if (preferredZone) {
19947
19734
  if (preferredZone !== zoneId) {
19948
19735
  return this._cachedResolveZoneIdText(cldr, preferredZone, style, type);
19949
19736
  }
19950
19737
  } else {
19951
19738
  var goldenZone = mapZones[metazone]['001'];
19952
-
19953
19739
  if (goldenZone !== zoneId) {
19954
19740
  return this._cachedResolveZoneIdText(cldr, goldenZone, style, type);
19955
19741
  }
@@ -19959,14 +19745,11 @@ var CldrZoneTextPrinterParser = function () {
19959
19745
  }
19960
19746
  }
19961
19747
  };
19962
-
19963
19748
  _proto.print = function print(context, buf) {
19964
19749
  var zone = context.getValueQuery(TemporalQueries.zoneId());
19965
-
19966
19750
  if (zone == null) {
19967
19751
  return false;
19968
19752
  }
19969
-
19970
19753
  if (zone.normalized() instanceof ZoneOffset) {
19971
19754
  buf.append(zone.id());
19972
19755
  return true;
@@ -19975,51 +19758,38 @@ var CldrZoneTextPrinterParser = function () {
19975
19758
  var tzstyle = this._textStyle.asNormal() === TextStyle.FULL ? 'long' : 'short';
19976
19759
  loadCldrData("main/" + context.locale().localeString() + "/timeZoneNames.json");
19977
19760
  var cldr = getOrCreateCldrInstance(context.locale().localeString());
19978
-
19979
19761
  var text = this._cachedResolveZoneIdText(cldr, zone.id(), tzstyle, tzType);
19980
-
19981
19762
  if (text) {
19982
19763
  buf.append(text);
19983
19764
  } else {
19984
19765
  buf.append(zone.id());
19985
19766
  }
19986
-
19987
19767
  return true;
19988
19768
  };
19989
-
19990
19769
  _proto._resolveZoneIds = function _resolveZoneIds(localString) {
19991
19770
  if (this._zoneIdsLocales[localString] != null) {
19992
19771
  return this._zoneIdsLocales[localString];
19993
19772
  }
19994
-
19995
19773
  var ids = {};
19996
19774
  loadCldrData("main/" + localString + "/timeZoneNames.json");
19997
19775
  var cldr = getOrCreateCldrInstance(localString);
19998
-
19999
19776
  for (var _iterator = _createForOfIteratorHelperLoose(ZoneRulesProvider.getAvailableZoneIds()), _step; !(_step = _iterator()).done;) {
20000
19777
  var id = _step.value;
20001
19778
  ids[id] = id;
20002
19779
  var tzstyle = this._textStyle.asNormal() === TextStyle.FULL ? 'long' : 'short';
20003
-
20004
19780
  var genericText = this._cachedResolveZoneIdText(cldr, id, tzstyle, 'generic');
20005
-
20006
19781
  if (genericText) {
20007
19782
  ids[genericText] = id;
20008
19783
  }
20009
-
20010
19784
  var standardText = this._cachedResolveZoneIdText(cldr, id, tzstyle, 'standard');
20011
-
20012
19785
  if (standardText) {
20013
19786
  ids[standardText] = id;
20014
19787
  }
20015
-
20016
19788
  var daylightText = this._cachedResolveZoneIdText(cldr, id, tzstyle, 'daylight');
20017
-
20018
19789
  if (daylightText) {
20019
19790
  ids[daylightText] = id;
20020
19791
  }
20021
19792
  }
20022
-
20023
19793
  var sortedKeys = Object.keys(ids).sort(LENGTH_COMPARATOR);
20024
19794
  this._zoneIdsLocales[localString] = {
20025
19795
  ids: ids,
@@ -20027,37 +19797,29 @@ var CldrZoneTextPrinterParser = function () {
20027
19797
  };
20028
19798
  return this._zoneIdsLocales[localString];
20029
19799
  };
20030
-
20031
19800
  _proto.parse = function parse(context, text, position) {
20032
19801
  for (var _i = 0, _arr = ['UTC', 'GMT']; _i < _arr.length; _i++) {
20033
19802
  var name = _arr[_i];
20034
-
20035
19803
  if (context.subSequenceEquals(text, position, name, 0, name.length)) {
20036
19804
  context.setParsedZone(ZoneId.of(name));
20037
19805
  return position + name.length;
20038
19806
  }
20039
19807
  }
20040
-
20041
19808
  var _this$_resolveZoneIds = this._resolveZoneIds(context.locale().localeString()),
20042
- ids = _this$_resolveZoneIds.ids,
20043
- sortedKeys = _this$_resolveZoneIds.sortedKeys;
20044
-
19809
+ ids = _this$_resolveZoneIds.ids,
19810
+ sortedKeys = _this$_resolveZoneIds.sortedKeys;
20045
19811
  for (var _iterator2 = _createForOfIteratorHelperLoose(sortedKeys), _step2; !(_step2 = _iterator2()).done;) {
20046
19812
  var _name = _step2.value;
20047
-
20048
19813
  if (context.subSequenceEquals(text, position, _name, 0, _name.length)) {
20049
19814
  context.setParsedZone(ZoneId.of(ids[_name]));
20050
19815
  return position + _name.length;
20051
19816
  }
20052
19817
  }
20053
-
20054
19818
  return ~position;
20055
19819
  };
20056
-
20057
19820
  _proto.toString = function toString() {
20058
19821
  return "ZoneText(" + this._textStyle + ")";
20059
19822
  };
20060
-
20061
19823
  return CldrZoneTextPrinterParser;
20062
19824
  }();
20063
19825
 
@@ -20067,178 +19829,127 @@ var CldrZoneTextPrinterParser = function () {
20067
19829
  * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
20068
19830
  */
20069
19831
  var MathUtil$1 = _.MathUtil;
20070
-
20071
19832
  var LocalizedOffsetPrinterParser = function () {
20072
19833
  function LocalizedOffsetPrinterParser(textStyle) {
20073
19834
  this._textStyle = textStyle;
20074
19835
  }
20075
-
20076
19836
  var _proto = LocalizedOffsetPrinterParser.prototype;
20077
-
20078
19837
  _proto.textStyle = function textStyle() {
20079
19838
  return this._textStyle;
20080
19839
  };
20081
-
20082
19840
  _proto.print = function print(context, buf) {
20083
19841
  var offsetSecs = context.getValue(ChronoField.OFFSET_SECONDS);
20084
-
20085
19842
  if (offsetSecs == null) {
20086
19843
  return false;
20087
19844
  }
20088
-
20089
19845
  buf.append('GMT');
20090
-
20091
19846
  if (this._textStyle === TextStyle.FULL) {
20092
19847
  return new DateTimeFormatterBuilder.OffsetIdPrinterParser('', '+HH:MM:ss').print(context, buf);
20093
19848
  }
20094
-
20095
19849
  var totalSecs = MathUtil$1.safeToInt(offsetSecs);
20096
-
20097
19850
  if (totalSecs !== 0) {
20098
19851
  var absHours = Math.abs(MathUtil$1.intMod(MathUtil$1.intDiv(totalSecs, 3600), 100));
20099
19852
  var absMinutes = Math.abs(MathUtil$1.intMod(MathUtil$1.intDiv(totalSecs, 60), 60));
20100
19853
  var absSeconds = Math.abs(MathUtil$1.intMod(totalSecs, 60));
20101
19854
  buf.append(totalSecs < 0 ? '-' : '+').append(absHours);
20102
-
20103
19855
  if (absMinutes > 0 || absSeconds > 0) {
20104
19856
  buf.append(':').append(MathUtil$1.intDiv(absMinutes, 10)).append(MathUtil$1.intMod(absMinutes, 10));
20105
-
20106
19857
  if (absSeconds > 0) {
20107
19858
  buf.append(':').append(MathUtil$1.intDiv(absSeconds, 10)).append(MathUtil$1.intMod(absSeconds, 10));
20108
19859
  }
20109
19860
  }
20110
19861
  }
20111
-
20112
19862
  return true;
20113
19863
  };
20114
-
20115
19864
  _proto.parse = function parse(context, text, position) {
20116
19865
  if (context.subSequenceEquals(text, position, 'GMT', 0, 3) === false) {
20117
19866
  return ~position;
20118
19867
  }
20119
-
20120
19868
  position += 3;
20121
-
20122
19869
  if (this._textStyle === TextStyle.FULL) {
20123
19870
  return new DateTimeFormatterBuilder.OffsetIdPrinterParser('', '+HH:MM:ss').parse(context, text, position);
20124
19871
  }
20125
-
20126
19872
  var end = text.length;
20127
-
20128
19873
  if (position === end) {
20129
19874
  return context.setParsedField(ChronoField.OFFSET_SECONDS, 0, position, position);
20130
19875
  }
20131
-
20132
19876
  var sign = text.charAt(position);
20133
-
20134
19877
  if (sign !== '+' && sign !== '-') {
20135
19878
  return context.setParsedField(ChronoField.OFFSET_SECONDS, 0, position, position);
20136
19879
  }
20137
-
20138
19880
  var negative = sign === '-' ? -1 : 1;
20139
-
20140
19881
  if (position === end) {
20141
19882
  return ~position;
20142
19883
  }
20143
-
20144
19884
  position++;
20145
19885
  var ch = text.charAt(position);
20146
-
20147
19886
  if (ch < '0' || ch > '9') {
20148
19887
  return ~position;
20149
19888
  }
20150
-
20151
19889
  position++;
20152
19890
  var hour = MathUtil$1.parseInt(ch);
20153
-
20154
19891
  if (position !== end) {
20155
19892
  ch = text.charAt(position);
20156
-
20157
19893
  if (ch >= '0' && ch <= '9') {
20158
19894
  hour = hour * 10 + MathUtil$1.parseInt(ch);
20159
-
20160
19895
  if (hour > 23) {
20161
19896
  return ~position;
20162
19897
  }
20163
-
20164
19898
  position++;
20165
19899
  }
20166
19900
  }
20167
-
20168
19901
  if (position === end || text.charAt(position) !== ':') {
20169
19902
  var _offset = negative * 3600 * hour;
20170
-
20171
19903
  return context.setParsedField(ChronoField.OFFSET_SECONDS, _offset, position, position);
20172
19904
  }
20173
-
20174
19905
  position++;
20175
-
20176
19906
  if (position > end - 2) {
20177
19907
  return ~position;
20178
19908
  }
20179
-
20180
19909
  ch = text.charAt(position);
20181
-
20182
19910
  if (ch < '0' || ch > '9') {
20183
19911
  return ~position;
20184
19912
  }
20185
-
20186
19913
  position++;
20187
19914
  var min = MathUtil$1.parseInt(ch);
20188
19915
  ch = text.charAt(position);
20189
-
20190
19916
  if (ch < '0' || ch > '9') {
20191
19917
  return ~position;
20192
19918
  }
20193
-
20194
19919
  position++;
20195
19920
  min = min * 10 + MathUtil$1.parseInt(ch);
20196
-
20197
19921
  if (min > 59) {
20198
19922
  return ~position;
20199
19923
  }
20200
-
20201
19924
  if (position === end || text.charAt(position) !== ':') {
20202
19925
  var _offset2 = negative * (3600 * hour + 60 * min);
20203
-
20204
19926
  return context.setParsedField(ChronoField.OFFSET_SECONDS, _offset2, position, position);
20205
19927
  }
20206
-
20207
19928
  position++;
20208
-
20209
19929
  if (position > end - 2) {
20210
19930
  return ~position;
20211
19931
  }
20212
-
20213
19932
  ch = text.charAt(position);
20214
-
20215
19933
  if (ch < '0' || ch > '9') {
20216
19934
  return ~position;
20217
19935
  }
20218
-
20219
19936
  position++;
20220
19937
  var sec = MathUtil$1.parseInt(ch);
20221
19938
  ch = text.charAt(position);
20222
-
20223
19939
  if (ch < '0' || ch > '9') {
20224
19940
  return ~position;
20225
19941
  }
20226
-
20227
19942
  position++;
20228
19943
  sec = sec * 10 + MathUtil$1.parseInt(ch);
20229
-
20230
19944
  if (sec > 59) {
20231
19945
  return ~position;
20232
19946
  }
20233
-
20234
19947
  var offset = negative * (3600 * hour + 60 * min + sec);
20235
19948
  return context.setParsedField(ChronoField.OFFSET_SECONDS, offset, position, position);
20236
19949
  };
20237
-
20238
19950
  _proto.toString = function toString() {
20239
19951
  return "LocalizedOffset(" + this._textStyle + ")";
20240
19952
  };
20241
-
20242
19953
  return LocalizedOffsetPrinterParser;
20243
19954
  }();
20244
19955
 
@@ -20247,9 +19958,9 @@ var LocalizedOffsetPrinterParser = function () {
20247
19958
  * @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
20248
19959
  */
20249
19960
  var MathUtil = _.MathUtil,
20250
- _jodaInternal$assert$1 = _.assert,
20251
- requireNonNull$2 = _jodaInternal$assert$1.requireNonNull,
20252
- requireInstance$1 = _jodaInternal$assert$1.requireInstance;
19961
+ _jodaInternal$assert$1 = _.assert,
19962
+ requireNonNull$2 = _jodaInternal$assert$1.requireNonNull,
19963
+ requireInstance$1 = _jodaInternal$assert$1.requireInstance;
20253
19964
  var DAY_OF_WEEK_RANGE = ValueRange.of(1, 7);
20254
19965
  var WEEK_OF_MONTH_RANGE = ValueRange.of(0, 1, 4, 6);
20255
19966
  var WEEK_OF_YEAR_RANGE = ValueRange.of(0, 1, 52, 54);
@@ -20268,23 +19979,18 @@ var ComputedDayOfField = function () {
20268
19979
  ComputedDayOfField.ofDayOfWeekField = function ofDayOfWeekField(weekDef) {
20269
19980
  return new ComputedDayOfField('DayOfWeek', weekDef, ChronoUnit.DAYS, ChronoUnit.WEEKS, DAY_OF_WEEK_RANGE);
20270
19981
  };
20271
-
20272
19982
  ComputedDayOfField.ofWeekOfMonthField = function ofWeekOfMonthField(weekDef) {
20273
19983
  return new ComputedDayOfField('WeekOfMonth', weekDef, ChronoUnit.WEEKS, ChronoUnit.MONTHS, WEEK_OF_MONTH_RANGE);
20274
19984
  };
20275
-
20276
19985
  ComputedDayOfField.ofWeekOfYearField = function ofWeekOfYearField(weekDef) {
20277
19986
  return new ComputedDayOfField('WeekOfYear', weekDef, ChronoUnit.WEEKS, ChronoUnit.YEARS, WEEK_OF_YEAR_RANGE);
20278
19987
  };
20279
-
20280
19988
  ComputedDayOfField.ofWeekOfWeekBasedYearField = function ofWeekOfWeekBasedYearField(weekDef) {
20281
19989
  return new ComputedDayOfField('WeekOfWeekBasedYear', weekDef, ChronoUnit.WEEKS, IsoFields.WEEK_BASED_YEARS, WEEK_OF_WEEK_BASED_YEAR_RANGE);
20282
19990
  };
20283
-
20284
19991
  ComputedDayOfField.ofWeekBasedYearField = function ofWeekBasedYearField(weekDef) {
20285
19992
  return new ComputedDayOfField('WeekBasedYear', weekDef, IsoFields.WEEK_BASED_YEARS, ChronoUnit.FOREVER, WEEK_BASED_YEAR_RANGE);
20286
19993
  };
20287
-
20288
19994
  function ComputedDayOfField(name, weekDef, baseUnit, rangeUnit, range) {
20289
19995
  this._name = name;
20290
19996
  this._weekDef = weekDef;
@@ -20292,14 +19998,10 @@ var ComputedDayOfField = function () {
20292
19998
  this._rangeUnit = rangeUnit;
20293
19999
  this._range = range;
20294
20000
  }
20295
-
20296
20001
  var _proto = ComputedDayOfField.prototype;
20297
-
20298
20002
  _proto.getFrom = function getFrom(temporal) {
20299
20003
  var sow = this._weekDef.firstDayOfWeek().value();
20300
-
20301
20004
  var dow = this._localizedDayOfWeek(temporal, sow);
20302
-
20303
20005
  if (this._rangeUnit === ChronoUnit.WEEKS) {
20304
20006
  return dow;
20305
20007
  } else if (this._rangeUnit === ChronoUnit.MONTHS) {
@@ -20314,112 +20016,79 @@ var ComputedDayOfField = function () {
20314
20016
  throw new IllegalStateException('unreachable');
20315
20017
  }
20316
20018
  };
20317
-
20318
20019
  _proto._localizedDayOfWeek = function _localizedDayOfWeek(temporal, sow) {
20319
20020
  var isoDow = temporal.get(ChronoField.DAY_OF_WEEK);
20320
20021
  return MathUtil.floorMod(isoDow - sow, 7) + 1;
20321
20022
  };
20322
-
20323
20023
  _proto._localizedWeekOfMonth = function _localizedWeekOfMonth(temporal, dow) {
20324
20024
  var dom = temporal.get(ChronoField.DAY_OF_MONTH);
20325
-
20326
20025
  var offset = this._startOfWeekOffset(dom, dow);
20327
-
20328
20026
  return ComputedDayOfField._computeWeek(offset, dom);
20329
20027
  };
20330
-
20331
20028
  _proto._localizedWeekOfYear = function _localizedWeekOfYear(temporal, dow) {
20332
20029
  var doy = temporal.get(ChronoField.DAY_OF_YEAR);
20333
-
20334
20030
  var offset = this._startOfWeekOffset(doy, dow);
20335
-
20336
20031
  return ComputedDayOfField._computeWeek(offset, doy);
20337
20032
  };
20338
-
20339
20033
  _proto._localizedWOWBY = function _localizedWOWBY(temporal) {
20340
20034
  var sow = this._weekDef.firstDayOfWeek().value();
20341
-
20342
20035
  var isoDow = temporal.get(ChronoField.DAY_OF_WEEK);
20343
20036
  var dow = MathUtil.floorMod(isoDow - sow, 7) + 1;
20344
-
20345
20037
  var woy = this._localizedWeekOfYear(temporal, dow);
20346
-
20347
20038
  if (woy === 0) {
20348
20039
  var previous = LocalDate.from(temporal).minus(1, ChronoUnit.WEEKS);
20349
20040
  return this._localizedWeekOfYear(previous, dow) + 1;
20350
20041
  } else if (woy >= 53) {
20351
20042
  var offset = this._startOfWeekOffset(temporal.get(ChronoField.DAY_OF_YEAR), dow);
20352
-
20353
20043
  var year = temporal.get(ChronoField.YEAR);
20354
20044
  var yearLen = Year.isLeap(year) ? 366 : 365;
20355
-
20356
20045
  var weekIndexOfFirstWeekNextYear = ComputedDayOfField._computeWeek(offset, yearLen + this._weekDef.minimalDaysInFirstWeek());
20357
-
20358
20046
  if (woy >= weekIndexOfFirstWeekNextYear) {
20359
20047
  return woy - (weekIndexOfFirstWeekNextYear - 1);
20360
20048
  }
20361
20049
  }
20362
-
20363
20050
  return woy;
20364
20051
  };
20365
-
20366
20052
  _proto._localizedWBY = function _localizedWBY(temporal) {
20367
20053
  var sow = this._weekDef.firstDayOfWeek().value();
20368
-
20369
20054
  var isoDow = temporal.get(ChronoField.DAY_OF_WEEK);
20370
20055
  var dow = MathUtil.floorMod(isoDow - sow, 7) + 1;
20371
20056
  var year = temporal.get(ChronoField.YEAR);
20372
-
20373
20057
  var woy = this._localizedWeekOfYear(temporal, dow);
20374
-
20375
20058
  if (woy === 0) {
20376
20059
  return year - 1;
20377
20060
  } else if (woy < 53) {
20378
20061
  return year;
20379
20062
  }
20380
-
20381
20063
  var offset = this._startOfWeekOffset(temporal.get(ChronoField.DAY_OF_YEAR), dow);
20382
-
20383
20064
  var yearLen = Year.isLeap(year) ? 366 : 365;
20384
-
20385
20065
  var weekIndexOfFirstWeekNextYear = ComputedDayOfField._computeWeek(offset, yearLen + this._weekDef.minimalDaysInFirstWeek());
20386
-
20387
20066
  if (woy >= weekIndexOfFirstWeekNextYear) {
20388
20067
  return year + 1;
20389
20068
  }
20390
-
20391
20069
  return year;
20392
20070
  };
20393
-
20394
20071
  _proto._startOfWeekOffset = function _startOfWeekOffset(day, dow) {
20395
20072
  var weekStart = MathUtil.floorMod(day - dow, 7);
20396
20073
  var offset = -weekStart;
20397
-
20398
20074
  if (weekStart + 1 > this._weekDef.minimalDaysInFirstWeek()) {
20399
20075
  offset = 7 - weekStart;
20400
20076
  }
20401
-
20402
20077
  return offset;
20403
20078
  };
20404
-
20405
20079
  ComputedDayOfField._computeWeek = function _computeWeek(offset, day) {
20406
20080
  return MathUtil.intDiv(7 + offset + (day - 1), 7);
20407
20081
  };
20408
-
20409
20082
  _proto.adjustInto = function adjustInto(temporal, newValue) {
20410
20083
  var newVal = this._range.checkValidIntValue(newValue, this);
20411
-
20412
20084
  var currentVal = temporal.get(this);
20413
-
20414
20085
  if (newVal === currentVal) {
20415
20086
  return temporal;
20416
20087
  }
20417
-
20418
20088
  if (this._rangeUnit === ChronoUnit.FOREVER) {
20419
20089
  var baseWowby = temporal.get(this._weekDef.weekOfWeekBasedYear());
20420
20090
  var diffWeeks = MathUtil.roundDown((newValue - currentVal) * 52.1775);
20421
20091
  var result = temporal.plus(diffWeeks, ChronoUnit.WEEKS);
20422
-
20423
20092
  if (result.get(this) > newVal) {
20424
20093
  var newWowby = result.get(this._weekDef.weekOfWeekBasedYear());
20425
20094
  result = result.minus(newWowby, ChronoUnit.WEEKS);
@@ -20427,140 +20096,96 @@ var ComputedDayOfField = function () {
20427
20096
  if (result.get(this) < newVal) {
20428
20097
  result = result.plus(2, ChronoUnit.WEEKS);
20429
20098
  }
20430
-
20431
20099
  var _newWowby = result.get(this._weekDef.weekOfWeekBasedYear());
20432
-
20433
20100
  result = result.plus(baseWowby - _newWowby, ChronoUnit.WEEKS);
20434
-
20435
20101
  if (result.get(this) > newVal) {
20436
20102
  result = result.minus(1, ChronoUnit.WEEKS);
20437
20103
  }
20438
20104
  }
20439
-
20440
20105
  return result;
20441
20106
  }
20442
-
20443
20107
  var delta = newVal - currentVal;
20444
20108
  return temporal.plus(delta, this._baseUnit);
20445
20109
  };
20446
-
20447
20110
  _proto.resolve = function resolve(fieldValues, partialTemporal, resolverStyle) {
20448
20111
  var sow = this._weekDef.firstDayOfWeek().value();
20449
-
20450
20112
  if (this._rangeUnit === ChronoUnit.WEEKS) {
20451
20113
  var value = fieldValues.remove(this);
20452
-
20453
20114
  var localDow = this._range.checkValidIntValue(value, this);
20454
-
20455
20115
  var _isoDow = MathUtil.floorMod(sow - 1 + (localDow - 1), 7) + 1;
20456
-
20457
20116
  fieldValues.put(ChronoField.DAY_OF_WEEK, _isoDow);
20458
20117
  return null;
20459
20118
  }
20460
-
20461
20119
  if (fieldValues.containsKey(ChronoField.DAY_OF_WEEK) === false) {
20462
20120
  return null;
20463
20121
  }
20464
-
20465
20122
  if (this._rangeUnit === ChronoUnit.FOREVER) {
20466
20123
  if (fieldValues.containsKey(this._weekDef.weekOfWeekBasedYear()) === false) {
20467
20124
  return null;
20468
20125
  }
20469
-
20470
20126
  var _isoDow2 = ChronoField.DAY_OF_WEEK.checkValidIntValue(fieldValues.get(ChronoField.DAY_OF_WEEK));
20471
-
20472
20127
  var _dow = MathUtil.floorMod(_isoDow2 - sow, 7) + 1;
20473
-
20474
20128
  var wby = this.range().checkValidIntValue(fieldValues.get(this), this);
20475
20129
  var date;
20476
20130
  var days;
20477
-
20478
20131
  if (resolverStyle === ResolverStyle.LENIENT) {
20479
20132
  date = LocalDate.of(wby, 1, this._weekDef.minimalDaysInFirstWeek());
20480
20133
  var wowby = fieldValues.get(this._weekDef.weekOfWeekBasedYear());
20481
-
20482
20134
  var dateDow = this._localizedDayOfWeek(date, sow);
20483
-
20484
20135
  var weeks = wowby - this._localizedWeekOfYear(date, dateDow);
20485
-
20486
20136
  days = weeks * 7 + (_dow - dateDow);
20487
20137
  } else {
20488
20138
  date = LocalDate.of(wby, 1, this._weekDef.minimalDaysInFirstWeek());
20489
-
20490
20139
  var _wowby = this._weekDef.weekOfWeekBasedYear().range().checkValidIntValue(fieldValues.get(this._weekDef.weekOfWeekBasedYear()), this._weekDef.weekOfWeekBasedYear);
20491
-
20492
20140
  var _dateDow = this._localizedDayOfWeek(date, sow);
20493
-
20494
20141
  var _weeks = _wowby - this._localizedWeekOfYear(date, _dateDow);
20495
-
20496
20142
  days = _weeks * 7 + (_dow - _dateDow);
20497
20143
  }
20498
-
20499
20144
  date = date.plus(days, ChronoUnit.DAYS);
20500
-
20501
20145
  if (resolverStyle === ResolverStyle.STRICT) {
20502
20146
  if (date.getLong(this) !== fieldValues.get(this)) {
20503
20147
  throw new DateTimeException('Strict mode rejected date parsed to a different year');
20504
20148
  }
20505
20149
  }
20506
-
20507
20150
  fieldValues.remove(this);
20508
20151
  fieldValues.remove(this._weekDef.weekOfWeekBasedYear());
20509
20152
  fieldValues.remove(ChronoField.DAY_OF_WEEK);
20510
20153
  return date;
20511
20154
  }
20512
-
20513
20155
  if (fieldValues.containsKey(ChronoField.YEAR) === false) {
20514
20156
  return null;
20515
20157
  }
20516
-
20517
20158
  var isoDow = ChronoField.DAY_OF_WEEK.checkValidIntValue(fieldValues.get(ChronoField.DAY_OF_WEEK));
20518
20159
  var dow = MathUtil.floorMod(isoDow - sow, 7) + 1;
20519
20160
  var year = ChronoField.YEAR.checkValidIntValue(fieldValues.get(ChronoField.YEAR));
20520
-
20521
20161
  if (this._rangeUnit === ChronoUnit.MONTHS) {
20522
20162
  if (fieldValues.containsKey(ChronoField.MONTH_OF_YEAR) === false) {
20523
20163
  return null;
20524
20164
  }
20525
-
20526
20165
  var _value = fieldValues.remove(this);
20527
-
20528
20166
  var _date;
20529
-
20530
20167
  var _days;
20531
-
20532
20168
  if (resolverStyle === ResolverStyle.LENIENT) {
20533
20169
  var month = fieldValues.get(ChronoField.MONTH_OF_YEAR);
20534
20170
  _date = LocalDate.of(year, 1, 1);
20535
20171
  _date = _date.plus(month - 1, ChronoUnit.MONTHS);
20536
-
20537
20172
  var _dateDow2 = this._localizedDayOfWeek(_date, sow);
20538
-
20539
20173
  var _weeks2 = _value - this._localizedWeekOfMonth(_date, _dateDow2);
20540
-
20541
20174
  _days = _weeks2 * 7 + (dow - _dateDow2);
20542
20175
  } else {
20543
20176
  var _month = ChronoField.MONTH_OF_YEAR.checkValidIntValue(fieldValues.get(ChronoField.MONTH_OF_YEAR));
20544
-
20545
20177
  _date = LocalDate.of(year, _month, 8);
20546
-
20547
20178
  var _dateDow3 = this._localizedDayOfWeek(_date, sow);
20548
-
20549
20179
  var wom = this._range.checkValidIntValue(_value, this);
20550
-
20551
20180
  var _weeks3 = wom - this._localizedWeekOfMonth(_date, _dateDow3);
20552
-
20553
20181
  _days = _weeks3 * 7 + (dow - _dateDow3);
20554
20182
  }
20555
-
20556
20183
  _date = _date.plus(_days, ChronoUnit.DAYS);
20557
-
20558
20184
  if (resolverStyle === ResolverStyle.STRICT) {
20559
20185
  if (_date.getLong(ChronoField.MONTH_OF_YEAR) !== fieldValues.get(ChronoField.MONTH_OF_YEAR)) {
20560
20186
  throw new DateTimeException('Strict mode rejected date parsed to a different month');
20561
20187
  }
20562
20188
  }
20563
-
20564
20189
  fieldValues.remove(this);
20565
20190
  fieldValues.remove(ChronoField.YEAR);
20566
20191
  fieldValues.remove(ChronoField.MONTH_OF_YEAR);
@@ -20568,35 +20193,24 @@ var ComputedDayOfField = function () {
20568
20193
  return _date;
20569
20194
  } else if (this._rangeUnit === ChronoUnit.YEARS) {
20570
20195
  var _value2 = fieldValues.remove(this);
20571
-
20572
20196
  var _date2 = LocalDate.of(year, 1, 1);
20573
-
20574
20197
  var _days2;
20575
-
20576
20198
  if (resolverStyle === ResolverStyle.LENIENT) {
20577
20199
  var _dateDow4 = this._localizedDayOfWeek(_date2, sow);
20578
-
20579
20200
  var _weeks4 = _value2 - this._localizedWeekOfYear(_date2, _dateDow4);
20580
-
20581
20201
  _days2 = _weeks4 * 7 + (dow - _dateDow4);
20582
20202
  } else {
20583
20203
  var _dateDow5 = this._localizedDayOfWeek(_date2, sow);
20584
-
20585
20204
  var woy = this._range.checkValidIntValue(_value2, this);
20586
-
20587
20205
  var _weeks5 = woy - this._localizedWeekOfYear(_date2, _dateDow5);
20588
-
20589
20206
  _days2 = _weeks5 * 7 + (dow - _dateDow5);
20590
20207
  }
20591
-
20592
20208
  _date2 = _date2.plus(_days2, ChronoUnit.DAYS);
20593
-
20594
20209
  if (resolverStyle === ResolverStyle.STRICT) {
20595
20210
  if (_date2.getLong(ChronoField.YEAR) !== fieldValues.get(ChronoField.YEAR)) {
20596
20211
  throw new DateTimeException('Strict mode rejected date parsed to a different year');
20597
20212
  }
20598
20213
  }
20599
-
20600
20214
  fieldValues.remove(this);
20601
20215
  fieldValues.remove(ChronoField.YEAR);
20602
20216
  fieldValues.remove(ChronoField.DAY_OF_WEEK);
@@ -20605,31 +20219,24 @@ var ComputedDayOfField = function () {
20605
20219
  throw new IllegalStateException('unreachable');
20606
20220
  }
20607
20221
  };
20608
-
20609
20222
  _proto.name = function name() {
20610
20223
  return this._name;
20611
20224
  };
20612
-
20613
20225
  _proto.baseUnit = function baseUnit() {
20614
20226
  return this._baseUnit;
20615
20227
  };
20616
-
20617
20228
  _proto.rangeUnit = function rangeUnit() {
20618
20229
  return this._rangeUnit;
20619
20230
  };
20620
-
20621
20231
  _proto.range = function range() {
20622
20232
  return this._range;
20623
20233
  };
20624
-
20625
20234
  _proto.isDateBased = function isDateBased() {
20626
20235
  return true;
20627
20236
  };
20628
-
20629
20237
  _proto.isTimeBased = function isTimeBased() {
20630
20238
  return false;
20631
20239
  };
20632
-
20633
20240
  _proto.isSupportedBy = function isSupportedBy(temporal) {
20634
20241
  if (temporal.isSupported(ChronoField.DAY_OF_WEEK)) {
20635
20242
  if (this._rangeUnit === ChronoUnit.WEEKS) {
@@ -20644,17 +20251,13 @@ var ComputedDayOfField = function () {
20644
20251
  return temporal.isSupported(ChronoField.EPOCH_DAY);
20645
20252
  }
20646
20253
  }
20647
-
20648
20254
  return false;
20649
20255
  };
20650
-
20651
20256
  _proto.rangeRefinedBy = function rangeRefinedBy(temporal) {
20652
20257
  if (this._rangeUnit === ChronoUnit.WEEKS) {
20653
20258
  return this._range;
20654
20259
  }
20655
-
20656
20260
  var field = null;
20657
-
20658
20261
  if (this._rangeUnit === ChronoUnit.MONTHS) {
20659
20262
  field = ChronoField.DAY_OF_MONTH;
20660
20263
  } else if (this._rangeUnit === ChronoUnit.YEARS) {
@@ -20666,58 +20269,40 @@ var ComputedDayOfField = function () {
20666
20269
  } else {
20667
20270
  throw new IllegalStateException('unreachable');
20668
20271
  }
20669
-
20670
20272
  var sow = this._weekDef.firstDayOfWeek().value();
20671
-
20672
20273
  var isoDow = temporal.get(ChronoField.DAY_OF_WEEK);
20673
20274
  var dow = MathUtil.floorMod(isoDow - sow, 7) + 1;
20674
-
20675
20275
  var offset = this._startOfWeekOffset(temporal.get(field), dow);
20676
-
20677
20276
  var fieldRange = temporal.range(field);
20678
20277
  return ValueRange.of(ComputedDayOfField._computeWeek(offset, fieldRange.minimum()), ComputedDayOfField._computeWeek(offset, fieldRange.maximum()));
20679
20278
  };
20680
-
20681
20279
  _proto._rangeWOWBY = function _rangeWOWBY(temporal) {
20682
20280
  var sow = this._weekDef.firstDayOfWeek().value();
20683
-
20684
20281
  var isoDow = temporal.get(ChronoField.DAY_OF_WEEK);
20685
20282
  var dow = MathUtil.floorMod(isoDow - sow, 7) + 1;
20686
-
20687
20283
  var woy = this._localizedWeekOfYear(temporal, dow);
20688
-
20689
20284
  if (woy === 0) {
20690
20285
  return this._rangeWOWBY(IsoChronology.INSTANCE.date(temporal).minus(2, ChronoUnit.WEEKS));
20691
20286
  }
20692
-
20693
20287
  var offset = this._startOfWeekOffset(temporal.get(ChronoField.DAY_OF_YEAR), dow);
20694
-
20695
20288
  var year = temporal.get(ChronoField.YEAR);
20696
20289
  var yearLen = Year.isLeap(year) ? 366 : 365;
20697
-
20698
20290
  var weekIndexOfFirstWeekNextYear = ComputedDayOfField._computeWeek(offset, yearLen + this._weekDef.minimalDaysInFirstWeek());
20699
-
20700
20291
  if (woy >= weekIndexOfFirstWeekNextYear) {
20701
20292
  return this._rangeWOWBY(IsoChronology.INSTANCE.date(temporal).plus(2, ChronoUnit.WEEKS));
20702
20293
  }
20703
-
20704
20294
  return ValueRange.of(1, weekIndexOfFirstWeekNextYear - 1);
20705
20295
  };
20706
-
20707
20296
  _proto.displayName = function displayName(locale) {
20708
20297
  requireNonNull$2(locale, 'locale');
20709
-
20710
20298
  if (this._rangeUnit === ChronoUnit.YEARS) {
20711
20299
  return 'Week';
20712
20300
  }
20713
-
20714
20301
  return this.toString();
20715
20302
  };
20716
-
20717
20303
  _proto.toString = function toString() {
20718
20304
  return this._name + "[" + this._weekDef.toString() + "]";
20719
20305
  };
20720
-
20721
20306
  return ComputedDayOfField;
20722
20307
  }();
20723
20308
  var WeekFieldsCache = new Map();
@@ -20729,54 +20314,42 @@ var WeekFields = function () {
20729
20314
  return WeekFields.ofFirstDayOfWeekMinDays(firstDayOrLocale, minDays);
20730
20315
  }
20731
20316
  };
20732
-
20733
20317
  WeekFields.ofLocale = function ofLocale(locale) {
20734
20318
  requireNonNull$2(locale, 'locale');
20735
- node_main.load(cldrData('supplemental/weekData.json'));
20736
- var cldr = new node_main(locale.localeString());
20319
+ Cldr.load(cldrData('supplemental/weekData.json'));
20320
+ var cldr = new Cldr(locale.localeString());
20737
20321
  var worldRegion = '001';
20738
20322
  var weekData = cldr.get('supplemental/weekData');
20739
-
20740
20323
  var dow = _weekDayMap[weekData.firstDay[locale.country()]];
20741
-
20742
20324
  if (!dow) {
20743
20325
  dow = _weekDayMap[weekData.firstDay[worldRegion]];
20744
20326
  }
20745
-
20746
20327
  var minDays = weekData.minDays[locale.country()];
20747
-
20748
20328
  if (!minDays) {
20749
20329
  minDays = weekData.minDays[worldRegion];
20750
20330
  }
20751
-
20752
20331
  return WeekFields.ofFirstDayOfWeekMinDays(dow, minDays);
20753
20332
  };
20754
-
20755
20333
  WeekFields.ofFirstDayOfWeekMinDays = function ofFirstDayOfWeekMinDays(firstDayOfWeek, minimalDaysInFirstWeek) {
20756
20334
  requireNonNull$2(firstDayOfWeek, 'firstDayOfWeek');
20757
20335
  requireInstance$1(firstDayOfWeek, DayOfWeek, 'firstDayOfWeek');
20758
20336
  requireNonNull$2(minimalDaysInFirstWeek, 'minimalDaysInFirstWeek');
20759
20337
  var key = firstDayOfWeek.toString() + minimalDaysInFirstWeek;
20760
20338
  var rules = WeekFieldsCache.get(key);
20761
-
20762
20339
  if (rules == null) {
20763
20340
  rules = new WeekFields(firstDayOfWeek, minimalDaysInFirstWeek);
20764
20341
  WeekFieldsCache.set(key, rules);
20765
20342
  rules = WeekFieldsCache.get(key);
20766
20343
  }
20767
-
20768
20344
  return rules;
20769
20345
  };
20770
-
20771
20346
  function WeekFields(firstDayOfWeek, minimalDaysInFirstWeek) {
20772
20347
  requireNonNull$2(firstDayOfWeek, 'firstDayOfWeek');
20773
20348
  requireInstance$1(firstDayOfWeek, DayOfWeek, 'firstDayOfWeek');
20774
20349
  requireNonNull$2(minimalDaysInFirstWeek, 'minimalDaysInFirstWeek');
20775
-
20776
20350
  if (minimalDaysInFirstWeek < 1 || minimalDaysInFirstWeek > 7) {
20777
20351
  throw new IllegalArgumentException('Minimal number of days is invalid');
20778
20352
  }
20779
-
20780
20353
  this._firstDayOfWeek = firstDayOfWeek;
20781
20354
  this._minimalDays = minimalDaysInFirstWeek;
20782
20355
  this._dayOfWeek = ComputedDayOfField.ofDayOfWeekField(this);
@@ -20784,59 +20357,45 @@ var WeekFields = function () {
20784
20357
  this._weekOfYear = ComputedDayOfField.ofWeekOfYearField(this);
20785
20358
  this._weekOfWeekBasedYear = ComputedDayOfField.ofWeekOfWeekBasedYearField(this);
20786
20359
  this._weekBasedYear = ComputedDayOfField.ofWeekBasedYearField(this);
20787
- node_main.load(cldrData('supplemental/likelySubtags.json'));
20360
+ Cldr.load(cldrData('supplemental/likelySubtags.json'));
20788
20361
  }
20789
-
20790
20362
  var _proto2 = WeekFields.prototype;
20791
-
20792
20363
  _proto2.firstDayOfWeek = function firstDayOfWeek() {
20793
20364
  return this._firstDayOfWeek;
20794
20365
  };
20795
-
20796
20366
  _proto2.minimalDaysInFirstWeek = function minimalDaysInFirstWeek() {
20797
20367
  return this._minimalDays;
20798
20368
  };
20799
-
20800
20369
  _proto2.dayOfWeek = function dayOfWeek() {
20801
20370
  return this._dayOfWeek;
20802
20371
  };
20803
-
20804
20372
  _proto2.weekOfMonth = function weekOfMonth() {
20805
20373
  return this._weekOfMonth;
20806
20374
  };
20807
-
20808
20375
  _proto2.weekOfYear = function weekOfYear() {
20809
20376
  return this._weekOfYear;
20810
20377
  };
20811
-
20812
20378
  _proto2.weekOfWeekBasedYear = function weekOfWeekBasedYear() {
20813
20379
  return this._weekOfWeekBasedYear;
20814
20380
  };
20815
-
20816
20381
  _proto2.weekBasedYear = function weekBasedYear() {
20817
20382
  return this._weekBasedYear;
20818
20383
  };
20819
-
20820
20384
  _proto2.equals = function equals(other) {
20821
20385
  if (this === other) {
20822
20386
  return true;
20823
20387
  }
20824
-
20825
20388
  if (other instanceof WeekFields) {
20826
20389
  return this.hashCode() === other.hashCode();
20827
20390
  }
20828
-
20829
20391
  return false;
20830
20392
  };
20831
-
20832
20393
  _proto2.hashCode = function hashCode() {
20833
20394
  return this._firstDayOfWeek.ordinal() * 7 + this._minimalDays;
20834
20395
  };
20835
-
20836
20396
  _proto2.toString = function toString() {
20837
20397
  return "WeekFields[" + this._firstDayOfWeek + "," + this._minimalDays + "]";
20838
20398
  };
20839
-
20840
20399
  return WeekFields;
20841
20400
  }();
20842
20401
  function _init$2() {
@@ -20849,68 +20408,50 @@ function _init$2() {
20849
20408
  * @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
20850
20409
  */
20851
20410
  var StringBuilder = _.StringBuilder;
20852
-
20853
20411
  var WeekFieldsPrinterParser = function () {
20854
20412
  function WeekFieldsPrinterParser(letter, count) {
20855
20413
  this._letter = letter;
20856
20414
  this._count = count;
20857
20415
  }
20858
-
20859
20416
  var _proto = WeekFieldsPrinterParser.prototype;
20860
-
20861
20417
  _proto.print = function print(context, buf) {
20862
20418
  var weekFields = WeekFields.of(context.locale());
20863
-
20864
20419
  var pp = this._evaluate(weekFields);
20865
-
20866
20420
  return pp.print(context, buf);
20867
20421
  };
20868
-
20869
20422
  _proto.parse = function parse(context, text, position) {
20870
20423
  var weekFields = WeekFields.of(context.locale());
20871
-
20872
20424
  var pp = this._evaluate(weekFields);
20873
-
20874
20425
  return pp.parse(context, text, position);
20875
20426
  };
20876
-
20877
20427
  _proto._evaluate = function _evaluate(weekFields) {
20878
20428
  var pp = null;
20879
-
20880
20429
  switch (this._letter) {
20881
20430
  case 'e':
20882
20431
  pp = new DateTimeFormatterBuilder.NumberPrinterParser(weekFields.dayOfWeek(), this._count, 2, SignStyle.NOT_NEGATIVE);
20883
20432
  break;
20884
-
20885
20433
  case 'c':
20886
20434
  pp = new DateTimeFormatterBuilder.NumberPrinterParser(weekFields.dayOfWeek(), this._count, 2, SignStyle.NOT_NEGATIVE);
20887
20435
  break;
20888
-
20889
20436
  case 'w':
20890
20437
  pp = new DateTimeFormatterBuilder.NumberPrinterParser(weekFields.weekOfWeekBasedYear(), this._count, 2, SignStyle.NOT_NEGATIVE);
20891
20438
  break;
20892
-
20893
20439
  case 'W':
20894
20440
  pp = new DateTimeFormatterBuilder.NumberPrinterParser(weekFields.weekOfMonth(), 1, 2, SignStyle.NOT_NEGATIVE);
20895
20441
  break;
20896
-
20897
20442
  case 'Y':
20898
20443
  if (this._count === 2) {
20899
20444
  pp = new DateTimeFormatterBuilder.ReducedPrinterParser(weekFields.weekBasedYear(), 2, 2, 0, DateTimeFormatterBuilder.ReducedPrinterParser.BASE_DATE);
20900
20445
  } else {
20901
20446
  pp = new DateTimeFormatterBuilder.NumberPrinterParser(weekFields.weekBasedYear(), this._count, 19, this._count < 4 ? SignStyle.NORMAL : SignStyle.EXCEEDS_PAD, -1);
20902
20447
  }
20903
-
20904
20448
  break;
20905
20449
  }
20906
-
20907
20450
  return pp;
20908
20451
  };
20909
-
20910
20452
  _proto.toString = function toString() {
20911
20453
  var sb = new StringBuilder(30);
20912
20454
  sb.append('Localized(');
20913
-
20914
20455
  if (this._letter === 'Y') {
20915
20456
  if (this._count === 1) {
20916
20457
  sb.append('WeekBasedYear');
@@ -20927,31 +20468,24 @@ var WeekFieldsPrinterParser = function () {
20927
20468
  } else if (this._letter === 'W') {
20928
20469
  sb.append('WeekOfMonth');
20929
20470
  }
20930
-
20931
20471
  sb.append(',');
20932
20472
  sb.append(this._count);
20933
20473
  }
20934
-
20935
20474
  sb.append(')');
20936
20475
  return sb.toString();
20937
20476
  };
20938
-
20939
20477
  return WeekFieldsPrinterParser;
20940
20478
  }();
20941
20479
 
20942
20480
  var _jodaInternal$assert = _.assert,
20943
- requireNonNull$1 = _jodaInternal$assert.requireNonNull,
20944
- requireInstance = _jodaInternal$assert.requireInstance;
20945
-
20481
+ requireNonNull$1 = _jodaInternal$assert.requireNonNull,
20482
+ requireInstance = _jodaInternal$assert.requireInstance;
20946
20483
  var CldrDateTimeFormatterBuilder = function (_DateTimeFormatterBui) {
20947
20484
  _inheritsLoose(CldrDateTimeFormatterBuilder, _DateTimeFormatterBui);
20948
-
20949
20485
  function CldrDateTimeFormatterBuilder() {
20950
20486
  return _DateTimeFormatterBui.apply(this, arguments) || this;
20951
20487
  }
20952
-
20953
20488
  var _proto = CldrDateTimeFormatterBuilder.prototype;
20954
-
20955
20489
  _proto.appendText = function appendText(field, styleOrMap) {
20956
20490
  if (styleOrMap === undefined) {
20957
20491
  return this.appendTextField(field);
@@ -20961,29 +20495,22 @@ var CldrDateTimeFormatterBuilder = function (_DateTimeFormatterBui) {
20961
20495
  return this.appendTextFieldMap(field, styleOrMap);
20962
20496
  }
20963
20497
  };
20964
-
20965
20498
  _proto.appendTextField = function appendTextField(field) {
20966
20499
  return this.appendTextFieldStyle(field, TextStyle.FULL);
20967
20500
  };
20968
-
20969
20501
  _proto.appendTextFieldStyle = function appendTextFieldStyle(field, textStyle) {
20970
20502
  requireNonNull$1(field, 'field');
20971
20503
  requireInstance(field, TemporalField, 'field');
20972
20504
  requireNonNull$1(textStyle, 'textStyle');
20973
20505
  requireInstance(textStyle, TextStyle, 'textStyle');
20974
-
20975
20506
  this._appendInternal(new TextPrinterParser(field, textStyle, new CldrDateTimeTextProvider()));
20976
-
20977
20507
  return this;
20978
20508
  };
20979
-
20980
20509
  _proto.appendTextFieldMap = function appendTextFieldMap(field, textLookup) {
20981
20510
  requireNonNull$1(field, 'field');
20982
20511
  requireInstance(field, ChronoField, 'field');
20983
20512
  requireNonNull$1(textLookup, 'textLookup');
20984
-
20985
20513
  var copy = _extends({}, textLookup);
20986
-
20987
20514
  var map = {};
20988
20515
  map[TextStyle.FULL] = copy;
20989
20516
  var store = new LocaleStore(map);
@@ -20995,39 +20522,27 @@ var CldrDateTimeFormatterBuilder = function (_DateTimeFormatterBui) {
20995
20522
  return store.getTextIterator(style);
20996
20523
  }
20997
20524
  };
20998
-
20999
20525
  this._appendInternal(new TextPrinterParser(field, TextStyle.FULL, provider));
21000
-
21001
20526
  return this;
21002
20527
  };
21003
-
21004
20528
  _proto.appendWeekField = function appendWeekField(field, count) {
21005
20529
  requireNonNull$1(field, 'field');
21006
20530
  requireNonNull$1(count, 'count');
21007
-
21008
20531
  this._appendInternal(new WeekFieldsPrinterParser(field, count));
21009
-
21010
20532
  return this;
21011
20533
  };
21012
-
21013
20534
  _proto.appendZoneText = function appendZoneText(textStyle) {
21014
20535
  this._appendInternal(new CldrZoneTextPrinterParser(textStyle));
21015
-
21016
20536
  return this;
21017
20537
  };
21018
-
21019
20538
  _proto.appendLocalizedOffset = function appendLocalizedOffset(textStyle) {
21020
20539
  requireNonNull$1(textStyle, 'textStyle');
21021
-
21022
20540
  if (textStyle !== TextStyle.FULL && textStyle !== TextStyle.SHORT) {
21023
20541
  throw new IllegalArgumentException('Style must be either full or short');
21024
20542
  }
21025
-
21026
20543
  this._appendInternal(new LocalizedOffsetPrinterParser(textStyle));
21027
-
21028
20544
  return this;
21029
20545
  };
21030
-
21031
20546
  return CldrDateTimeFormatterBuilder;
21032
20547
  }(DateTimeFormatterBuilder);
21033
20548
 
@@ -21035,64 +20550,50 @@ var CldrDateTimeFormatterBuilder = function (_DateTimeFormatterBui) {
21035
20550
  * @copyright (c) 2017, Philipp Thuerwaechter & Pattrick Hueper
21036
20551
  * @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
21037
20552
  */
21038
-
21039
20553
  var Locale = function () {
21040
20554
  Locale.getAvailableLocales = function getAvailableLocales() {
21041
20555
  return new CldrDateTimeTextProvider().getAvailableLocales();
21042
20556
  };
21043
-
21044
20557
  function Locale(language, country, localeString) {
21045
20558
  if (country === void 0) {
21046
20559
  country = '';
21047
20560
  }
21048
-
21049
20561
  if (localeString === void 0) {
21050
20562
  localeString = '';
21051
20563
  }
21052
-
21053
20564
  this._language = language;
21054
20565
  this._country = country;
21055
20566
  this._localeString = localeString;
21056
20567
  }
21057
-
21058
20568
  var _proto = Locale.prototype;
21059
-
21060
20569
  _proto.language = function language() {
21061
20570
  return this._language;
21062
20571
  };
21063
-
21064
20572
  _proto.country = function country() {
21065
20573
  return this._country;
21066
20574
  };
21067
-
21068
20575
  _proto.localeString = function localeString() {
21069
20576
  if (this._localeString.length > 0) {
21070
20577
  return this._localeString;
21071
20578
  }
21072
-
21073
20579
  if (this._country.length > 0) {
21074
20580
  return this._language + "-" + this._country;
21075
20581
  } else {
21076
20582
  return this._language;
21077
20583
  }
21078
20584
  };
21079
-
21080
20585
  _proto.toString = function toString() {
21081
20586
  return "Locale[" + this.localeString() + "]";
21082
20587
  };
21083
-
21084
20588
  _proto.equals = function equals(other) {
21085
20589
  if (!other) {
21086
20590
  return false;
21087
20591
  }
21088
-
21089
20592
  if (!(other instanceof Locale)) {
21090
20593
  return false;
21091
20594
  }
21092
-
21093
20595
  return this.localeString() === other.localeString();
21094
20596
  };
21095
-
21096
20597
  return Locale;
21097
20598
  }();
21098
20599
  function _init$1() {
@@ -21118,26 +20619,19 @@ function _init$1() {
21118
20619
  }
21119
20620
 
21120
20621
  var requireNonNull = _.assert.requireNonNull;
21121
-
21122
20622
  var LocaleDateTimeFormatter = function (_DateTimeFormatter) {
21123
20623
  _inheritsLoose(LocaleDateTimeFormatter, _DateTimeFormatter);
21124
-
21125
20624
  function LocaleDateTimeFormatter() {
21126
20625
  return _DateTimeFormatter.apply(this, arguments) || this;
21127
20626
  }
21128
-
21129
20627
  var _proto = LocaleDateTimeFormatter.prototype;
21130
-
21131
20628
  _proto.withLocale = function withLocale(locale) {
21132
20629
  requireNonNull(locale, 'locale');
21133
-
21134
20630
  if (locale.equals(this._locale)) {
21135
20631
  return this;
21136
20632
  }
21137
-
21138
20633
  return new DateTimeFormatter(this._printerParser, locale, this._decimalStyle, this._resolverStyle, this._resolverFields, this._chrono, this._zone);
21139
20634
  };
21140
-
21141
20635
  return LocaleDateTimeFormatter;
21142
20636
  }(DateTimeFormatter);
21143
20637
  function _init() {
@@ -21172,24 +20666,17 @@ function _init() {
21172
20666
  * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
21173
20667
  */
21174
20668
  var isInit = false;
21175
-
21176
20669
  function init() {
21177
20670
  if (isInit) {
21178
20671
  return;
21179
20672
  }
21180
-
21181
20673
  isInit = true;
21182
20674
  _init$1();
21183
20675
  _init$2();
21184
20676
  _init();
21185
20677
  }
21186
-
21187
20678
  init();
21188
20679
 
21189
- /*
21190
- * @copyright (c) 2017, Philipp Thuerwaechter & Pattrick Hueper
21191
- * @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
21192
- */
21193
20680
  function plug (jsJoda) {
21194
20681
  Object.getOwnPropertyNames(CldrDateTimeFormatterBuilder.prototype).forEach(function (prop) {
21195
20682
  if (prop !== 'constructor') {