@js-joda/locale_ru 4.8.6 → 4.8.10

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.9
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
 
@@ -26630,8 +26594,7 @@ function cldrData(path) {
26630
26594
  /*
26631
26595
  * @copyright (c) 2017, Philipp Thuerwaechter & Pattrick Hueper
26632
26596
  * @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
26633
- */
26634
- var createEntry = function createEntry(text, field) {
26597
+ */var createEntry = function createEntry(text, field) {
26635
26598
  return {
26636
26599
  key: text,
26637
26600
  value: field,
@@ -26640,11 +26603,9 @@ var createEntry = function createEntry(text, field) {
26640
26603
  }
26641
26604
  };
26642
26605
  };
26643
-
26644
26606
  var _comparator = function _comparator(obj1, obj2) {
26645
26607
  return obj2.key.length - obj1.key.length;
26646
26608
  };
26647
-
26648
26609
  var LocaleStore = function () {
26649
26610
  function LocaleStore(valueTextMap) {
26650
26611
  this._valueTextMap = valueTextMap;
@@ -26655,7 +26616,6 @@ var LocaleStore = function () {
26655
26616
  var list = [];
26656
26617
  Object.keys(valueTextMap[style]).forEach(function (key) {
26657
26618
  var value = valueTextMap[style][key];
26658
-
26659
26619
  if (reverse[value] === undefined) {
26660
26620
  reverse[value] = createEntry(value, parseInt(key));
26661
26621
  list.push(reverse[value]);
@@ -26669,25 +26629,35 @@ var LocaleStore = function () {
26669
26629
  allList.sort(_comparator);
26670
26630
  this._parsable = map;
26671
26631
  }
26672
-
26673
26632
  var _proto = LocaleStore.prototype;
26674
-
26675
26633
  _proto.getText = function getText(value, style) {
26676
26634
  var map = this._valueTextMap[style];
26677
26635
  return map != null ? map[value] : null;
26678
26636
  };
26679
-
26680
26637
  _proto.getTextIterator = function getTextIterator(style) {
26681
26638
  var list = this._parsable[style];
26682
26639
  return list != null ? list[Symbol.iterator]() : null;
26683
26640
  };
26684
-
26685
26641
  return LocaleStore;
26686
26642
  }();
26687
26643
 
26688
26644
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
26689
26645
 
26690
- var cldr = {exports: {}};
26646
+ function getDefaultExportFromCjs (x) {
26647
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
26648
+ }
26649
+
26650
+ var node_mainExports = {};
26651
+ var node_main = {
26652
+ get exports(){ return node_mainExports; },
26653
+ set exports(v){ node_mainExports = v; },
26654
+ };
26655
+
26656
+ var cldrExports = {};
26657
+ var cldr = {
26658
+ get exports(){ return cldrExports; },
26659
+ set exports(v){ cldrExports = v; },
26660
+ };
26691
26661
 
26692
26662
  /**
26693
26663
  * CLDR JavaScript Library v0.5.4
@@ -26701,616 +26671,1090 @@ var cldr = {exports: {}};
26701
26671
  */
26702
26672
 
26703
26673
  (function (module) {
26704
- /*!
26705
- * CLDR JavaScript Library v0.5.4 2020-10-22T15:56Z MIT license © Rafael Xavier
26706
- * http://git.io/h4lmVg
26707
- */
26708
- (function (root, factory) {
26709
- {
26710
- // Node. CommonJS.
26711
- module.exports = factory();
26712
- }
26713
- })(commonjsGlobal, function () {
26714
- var arrayIsArray = Array.isArray || function (obj) {
26715
- return Object.prototype.toString.call(obj) === "[object Array]";
26716
- };
26717
-
26718
- var pathNormalize = function (path, attributes) {
26719
- if (arrayIsArray(path)) {
26720
- path = path.join("/");
26721
- }
26722
-
26723
- if (typeof path !== "string") {
26724
- throw new Error("invalid path \"" + path + "\"");
26725
- } // 1: Ignore leading slash `/`
26726
- // 2: Ignore leading `cldr/`
26727
-
26728
-
26729
- path = path.replace(/^\//, "")
26730
- /* 1 */
26731
- .replace(/^cldr\//, "");
26732
- /* 2 */
26733
- // Replace {attribute}'s
26734
-
26735
- path = path.replace(/{[a-zA-Z]+}/g, function (name) {
26736
- name = name.replace(/^{([^}]*)}$/, "$1");
26737
- return attributes[name];
26738
- });
26739
- return path.split("/");
26740
- };
26741
-
26742
- var arraySome = function (array, callback) {
26743
- var i, length;
26744
-
26745
- if (array.some) {
26746
- return array.some(callback);
26747
- }
26748
-
26749
- for (i = 0, length = array.length; i < length; i++) {
26750
- if (callback(array[i], i, array)) {
26751
- return true;
26752
- }
26753
- }
26754
-
26755
- return false;
26756
- };
26757
- /**
26758
- * Return the maximized language id as defined in
26759
- * http://www.unicode.org/reports/tr35/#Likely_Subtags
26760
- * 1. Canonicalize.
26761
- * 1.1 Make sure the input locale is in canonical form: uses the right
26762
- * separator, and has the right casing.
26763
- * TODO Right casing? What df? It seems languages are lowercase, scripts are
26764
- * Capitalized, territory is uppercase. I am leaving this as an exercise to
26765
- * the user.
26766
- *
26767
- * 1.2 Replace any deprecated subtags with their canonical values using the
26768
- * <alias> data in supplemental metadata. Use the first value in the
26769
- * replacement list, if it exists. Language tag replacements may have multiple
26770
- * parts, such as "sh" "sr_Latn" or mo" "ro_MD". In such a case, the
26771
- * original script and/or region are retained if there is one. Thus
26772
- * "sh_Arab_AQ" ➞ "sr_Arab_AQ", not "sr_Latn_AQ".
26773
- * TODO What <alias> data?
26774
- *
26775
- * 1.3 If the tag is grandfathered (see <variable id="$grandfathered"
26776
- * type="choice"> in the supplemental data), then return it.
26777
- * TODO grandfathered?
26778
- *
26779
- * 1.4 Remove the script code 'Zzzz' and the region code 'ZZ' if they occur.
26780
- * 1.5 Get the components of the cleaned-up source tag (languages, scripts,
26781
- * and regions), plus any variants and extensions.
26782
- * 2. Lookup. Lookup each of the following in order, and stop on the first
26783
- * match:
26784
- * 2.1 languages_scripts_regions
26785
- * 2.2 languages_regions
26786
- * 2.3 languages_scripts
26787
- * 2.4 languages
26788
- * 2.5 und_scripts
26789
- * 3. Return
26790
- * 3.1 If there is no match, either return an error value, or the match for
26791
- * "und" (in APIs where a valid language tag is required).
26792
- * 3.2 Otherwise there is a match = languagem_scriptm_regionm
26793
- * 3.3 Let xr = xs if xs is not empty, and xm otherwise.
26794
- * 3.4 Return the language tag composed of languager _ scriptr _ regionr +
26795
- * variants + extensions.
26796
- *
26797
- * @subtags [Array] normalized language id subtags tuple (see init.js).
26798
- */
26799
-
26800
-
26801
- var coreLikelySubtags = function (Cldr, cldr, subtags, options) {
26802
- var match,
26803
- matchFound,
26804
- language = subtags[0],
26805
- script = subtags[1],
26806
- sep = Cldr.localeSep,
26807
- territory = subtags[2],
26808
- variants = subtags.slice(3, 4);
26809
- options = options || {}; // Skip if (language, script, territory) is not empty [3.3]
26810
-
26811
- if (language !== "und" && script !== "Zzzz" && territory !== "ZZ") {
26812
- return [language, script, territory].concat(variants);
26813
- } // Skip if no supplemental likelySubtags data is present
26814
-
26815
-
26816
- if (typeof cldr.get("supplemental/likelySubtags") === "undefined") {
26817
- return;
26818
- } // [2]
26819
-
26820
-
26821
- matchFound = arraySome([[language, script, territory], [language, territory], [language, script], [language], ["und", script]], function (test) {
26822
- return match = !/\b(Zzzz|ZZ)\b/.test(test.join(sep))
26823
- /* [1.4] */
26824
- && cldr.get(["supplemental/likelySubtags", test.join(sep)]);
26825
- }); // [3]
26826
-
26827
- if (matchFound) {
26828
- // [3.2 .. 3.4]
26829
- match = match.split(sep);
26830
- return [language !== "und" ? language : match[0], script !== "Zzzz" ? script : match[1], territory !== "ZZ" ? territory : match[2]].concat(variants);
26831
- } else if (options.force) {
26832
- // [3.1.2]
26833
- return cldr.get("supplemental/likelySubtags/und").split(sep);
26834
- } else {
26835
- // [3.1.1]
26836
- return;
26837
- }
26838
- };
26839
- /**
26840
- * Given a locale, remove any fields that Add Likely Subtags would add.
26841
- * http://www.unicode.org/reports/tr35/#Likely_Subtags
26842
- * 1. First get max = AddLikelySubtags(inputLocale). If an error is signaled,
26843
- * return it.
26844
- * 2. Remove the variants from max.
26845
- * 3. Then for trial in {language, language _ region, language _ script}. If
26846
- * AddLikelySubtags(trial) = max, then return trial + variants.
26847
- * 4. If you do not get a match, return max + variants.
26848
- *
26849
- * @maxLanguageId [Array] maxLanguageId tuple (see init.js).
26850
- */
26851
-
26852
-
26853
- var coreRemoveLikelySubtags = function (Cldr, cldr, maxLanguageId) {
26854
- var match,
26855
- matchFound,
26856
- language = maxLanguageId[0],
26857
- script = maxLanguageId[1],
26858
- territory = maxLanguageId[2],
26859
- variants = maxLanguageId[3]; // [3]
26860
-
26861
- matchFound = arraySome([[[language, "Zzzz", "ZZ"], [language]], [[language, "Zzzz", territory], [language, territory]], [[language, script, "ZZ"], [language, script]]], function (test) {
26862
- var result = coreLikelySubtags(Cldr, cldr, test[0]);
26863
- match = test[1];
26864
- return result && result[0] === maxLanguageId[0] && result[1] === maxLanguageId[1] && result[2] === maxLanguageId[2];
26865
- });
26866
-
26867
- if (matchFound) {
26868
- if (variants) {
26869
- match.push(variants);
26870
- }
26871
-
26872
- return match;
26873
- } // [4]
26874
-
26875
-
26876
- return maxLanguageId;
26877
- };
26878
- /**
26879
- * subtags( locale )
26880
- *
26881
- * @locale [String]
26882
- */
26883
-
26884
-
26885
- var coreSubtags = function (locale) {
26886
- var aux,
26887
- unicodeLanguageId,
26888
- subtags = [];
26889
- locale = locale.replace(/_/, "-"); // Unicode locale extensions.
26890
-
26891
- aux = locale.split("-u-");
26892
-
26893
- if (aux[1]) {
26894
- aux[1] = aux[1].split("-t-");
26895
- locale = aux[0] + (aux[1][1] ? "-t-" + aux[1][1] : "");
26896
- subtags[4
26897
- /* unicodeLocaleExtensions */
26898
- ] = aux[1][0];
26899
- } // TODO normalize transformed extensions. Currently, skipped.
26900
- // subtags[ x ] = locale.split( "-t-" )[ 1 ];
26901
-
26902
-
26903
- unicodeLanguageId = locale.split("-t-")[0]; // unicode_language_id = "root"
26904
- // | unicode_language_subtag
26905
- // (sep unicode_script_subtag)?
26906
- // (sep unicode_region_subtag)?
26907
- // (sep unicode_variant_subtag)* ;
26908
- //
26909
- // Although unicode_language_subtag = alpha{2,8}, I'm using alpha{2,3}. Because, there's no language on CLDR lengthier than 3.
26910
-
26911
- 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)$/);
26912
-
26913
- if (aux === null) {
26914
- return ["und", "Zzzz", "ZZ"];
26915
- }
26916
-
26917
- subtags[0
26918
- /* language */
26919
- ] = aux[10]
26920
- /* root */
26921
- || aux[2] || "und";
26922
- subtags[1
26923
- /* script */
26924
- ] = aux[4] || "Zzzz";
26925
- subtags[2
26926
- /* territory */
26927
- ] = aux[6] || "ZZ";
26928
-
26929
- if (aux[7] && aux[7].length) {
26930
- subtags[3
26931
- /* variant */
26932
- ] = aux[7].slice(1)
26933
- /* remove leading "-" */
26934
- ;
26935
- } // 0: language
26936
- // 1: script
26937
- // 2: territory (aka region)
26938
- // 3: variant
26939
- // 4: unicodeLocaleExtensions
26940
-
26941
-
26942
- return subtags;
26943
- };
26944
-
26945
- var arrayForEach = function (array, callback) {
26946
- var i, length;
26947
-
26948
- if (array.forEach) {
26949
- return array.forEach(callback);
26950
- }
26951
-
26952
- for (i = 0, length = array.length; i < length; i++) {
26953
- callback(array[i], i, array);
26954
- }
26955
- };
26956
- /**
26957
- * bundleLookup( minLanguageId )
26958
- *
26959
- * @Cldr [Cldr class]
26960
- *
26961
- * @cldr [Cldr instance]
26962
- *
26963
- * @minLanguageId [String] requested languageId after applied remove likely subtags.
26964
- */
26965
-
26966
-
26967
- var bundleLookup = function (Cldr, cldr, minLanguageId) {
26968
- var availableBundleMap = Cldr._availableBundleMap,
26969
- availableBundleMapQueue = Cldr._availableBundleMapQueue;
26970
-
26971
- if (availableBundleMapQueue.length) {
26972
- arrayForEach(availableBundleMapQueue, function (bundle, i) {
26973
- var existing, maxBundle, minBundle, subtags;
26974
- subtags = coreSubtags(bundle);
26975
- maxBundle = coreLikelySubtags(Cldr, cldr, subtags);
26976
-
26977
- if (maxBundle === undefined) {
26978
- availableBundleMapQueue.splice(i, 1);
26979
- throw new Error("Could not find likelySubtags for " + bundle);
26980
- }
26981
-
26982
- minBundle = coreRemoveLikelySubtags(Cldr, cldr, maxBundle);
26983
- minBundle = minBundle.join(Cldr.localeSep);
26984
- existing = availableBundleMap[minBundle];
26985
-
26986
- if (existing && existing.length < bundle.length) {
26987
- return;
26988
- }
26989
-
26990
- availableBundleMap[minBundle] = bundle;
26991
- });
26992
- Cldr._availableBundleMapQueue = [];
26993
- }
26994
-
26995
- return availableBundleMap[minLanguageId] || null;
26996
- };
26997
-
26998
- var objectKeys = function (object) {
26999
- var i,
27000
- result = [];
27001
-
27002
- if (Object.keys) {
27003
- return Object.keys(object);
27004
- }
27005
-
27006
- for (i in object) {
27007
- result.push(i);
27008
- }
27009
-
27010
- return result;
27011
- };
27012
-
27013
- var createError = function (code, attributes) {
27014
- var error, message;
27015
- message = code + (attributes && JSON ? ": " + JSON.stringify(attributes) : "");
27016
- error = new Error(message);
27017
- error.code = code; // extend( error, attributes );
27018
-
27019
- arrayForEach(objectKeys(attributes), function (attribute) {
27020
- error[attribute] = attributes[attribute];
27021
- });
27022
- return error;
27023
- };
27024
-
27025
- var validate = function (code, check, attributes) {
27026
- if (!check) {
27027
- throw createError(code, attributes);
27028
- }
27029
- };
27030
-
27031
- var validatePresence = function (value, name) {
27032
- validate("E_MISSING_PARAMETER", typeof value !== "undefined", {
27033
- name: name
27034
- });
27035
- };
27036
-
27037
- var validateType = function (value, name, check, expected) {
27038
- validate("E_INVALID_PAR_TYPE", check, {
27039
- expected: expected,
27040
- name: name,
27041
- value: value
27042
- });
27043
- };
27044
-
27045
- var validateTypePath = function (value, name) {
27046
- validateType(value, name, typeof value === "string" || arrayIsArray(value), "String or Array");
27047
- };
27048
- /**
27049
- * Function inspired by jQuery Core, but reduced to our use case.
27050
- */
27051
-
27052
-
27053
- var isPlainObject = function (obj) {
27054
- return obj !== null && "" + obj === "[object Object]";
27055
- };
27056
-
27057
- var validateTypePlainObject = function (value, name) {
27058
- validateType(value, name, typeof value === "undefined" || isPlainObject(value), "Plain Object");
27059
- };
27060
-
27061
- var validateTypeString = function (value, name) {
27062
- validateType(value, name, typeof value === "string", "a string");
27063
- }; // @path: normalized path
27064
-
27065
-
27066
- var resourceGet = function (data, path) {
27067
- var i,
27068
- node = data,
27069
- length = path.length;
27070
-
27071
- for (i = 0; i < length - 1; i++) {
27072
- node = node[path[i]];
27073
-
27074
- if (!node) {
27075
- return undefined;
27076
- }
27077
- }
27078
-
27079
- return node[path[i]];
27080
- };
27081
- /**
27082
- * setAvailableBundles( Cldr, json )
27083
- *
27084
- * @Cldr [Cldr class]
27085
- *
27086
- * @json resolved/unresolved cldr data.
27087
- *
27088
- * Set available bundles queue based on passed json CLDR data. Considers a bundle as any String at /main/{bundle}.
27089
- */
27090
-
27091
-
27092
- var coreSetAvailableBundles = function (Cldr, json) {
27093
- var bundle,
27094
- availableBundleMapQueue = Cldr._availableBundleMapQueue,
27095
- main = resourceGet(json, ["main"]);
27096
-
27097
- if (main) {
27098
- for (bundle in main) {
27099
- if (main.hasOwnProperty(bundle) && bundle !== "root" && availableBundleMapQueue.indexOf(bundle) === -1) {
27100
- availableBundleMapQueue.push(bundle);
27101
- }
27102
- }
27103
- }
27104
- };
27105
-
27106
- var alwaysArray = function (somethingOrArray) {
27107
- return arrayIsArray(somethingOrArray) ? somethingOrArray : [somethingOrArray];
27108
- };
27109
-
27110
- var jsonMerge = function () {
27111
- // Returns new deeply merged JSON.
27112
- //
27113
- // Eg.
27114
- // merge( { a: { b: 1, c: 2 } }, { a: { b: 3, d: 4 } } )
27115
- // -> { a: { b: 3, c: 2, d: 4 } }
27116
- //
27117
- // @arguments JSON's
27118
- //
27119
- var merge = function () {
27120
- var destination = {},
27121
- sources = [].slice.call(arguments, 0);
27122
- arrayForEach(sources, function (source) {
27123
- var prop;
27124
-
27125
- for (prop in source) {
27126
- if (prop in destination && typeof destination[prop] === "object" && !arrayIsArray(destination[prop])) {
27127
- // Merge Objects
27128
- destination[prop] = merge(destination[prop], source[prop]);
27129
- } else {
27130
- // Set new values
27131
- destination[prop] = source[prop];
27132
- }
27133
- }
27134
- });
27135
- return destination;
27136
- };
27137
-
27138
- return merge;
27139
- }();
27140
- /**
27141
- * load( Cldr, source, jsons )
27142
- *
27143
- * @Cldr [Cldr class]
27144
- *
27145
- * @source [Object]
27146
- *
27147
- * @jsons [arguments]
27148
- */
27149
-
27150
-
27151
- var coreLoad = function (Cldr, source, jsons) {
27152
- var i, j, json;
27153
- validatePresence(jsons[0], "json"); // Support arbitrary parameters, e.g., `Cldr.load({...}, {...})`.
27154
-
27155
- for (i = 0; i < jsons.length; i++) {
27156
- // Support array parameters, e.g., `Cldr.load([{...}, {...}])`.
27157
- json = alwaysArray(jsons[i]);
27158
-
27159
- for (j = 0; j < json.length; j++) {
27160
- validateTypePlainObject(json[j], "json");
27161
- source = jsonMerge(source, json[j]);
27162
- coreSetAvailableBundles(Cldr, json[j]);
27163
- }
27164
- }
27165
-
27166
- return source;
27167
- };
27168
-
27169
- var itemGetResolved = function (Cldr, path, attributes) {
27170
- // Resolve path
27171
- var normalizedPath = pathNormalize(path, attributes);
27172
- return resourceGet(Cldr._resolved, normalizedPath);
27173
- };
27174
- /**
27175
- * new Cldr()
27176
- */
27177
-
27178
-
27179
- var Cldr = function (locale) {
27180
- this.init(locale);
27181
- }; // Build optimization hack to avoid duplicating functions across modules.
27182
-
27183
-
27184
- Cldr._alwaysArray = alwaysArray;
27185
- Cldr._coreLoad = coreLoad;
27186
- Cldr._createError = createError;
27187
- Cldr._itemGetResolved = itemGetResolved;
27188
- Cldr._jsonMerge = jsonMerge;
27189
- Cldr._pathNormalize = pathNormalize;
27190
- Cldr._resourceGet = resourceGet;
27191
- Cldr._validatePresence = validatePresence;
27192
- Cldr._validateType = validateType;
27193
- Cldr._validateTypePath = validateTypePath;
27194
- Cldr._validateTypePlainObject = validateTypePlainObject;
27195
- Cldr._availableBundleMap = {};
27196
- Cldr._availableBundleMapQueue = [];
27197
- 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.
27198
-
27199
- Cldr.localeSep = "-";
27200
- /**
27201
- * Cldr.load( json [, json, ...] )
27202
- *
27203
- * @json [JSON] CLDR data or [Array] Array of @json's.
27204
- *
27205
- * Load resolved cldr data.
27206
- */
27207
-
27208
- Cldr.load = function () {
27209
- Cldr._resolved = coreLoad(Cldr, Cldr._resolved, arguments);
27210
- };
27211
- /**
27212
- * .init() automatically run on instantiation/construction.
27213
- */
27214
-
27215
-
27216
- Cldr.prototype.init = function (locale) {
27217
- var attributes,
27218
- language,
27219
- maxLanguageId,
27220
- minLanguageId,
27221
- script,
27222
- subtags,
27223
- territory,
27224
- unicodeLocaleExtensions,
27225
- variant,
27226
- sep = Cldr.localeSep,
27227
- unicodeLocaleExtensionsRaw = "";
27228
- validatePresence(locale, "locale");
27229
- validateTypeString(locale, "locale");
27230
- subtags = coreSubtags(locale);
27231
-
27232
- if (subtags.length === 5) {
27233
- unicodeLocaleExtensions = subtags.pop();
27234
- unicodeLocaleExtensionsRaw = sep + "u" + sep + unicodeLocaleExtensions; // Remove trailing null when there is unicodeLocaleExtensions but no variants.
27235
-
27236
- if (!subtags[3]) {
27237
- subtags.pop();
27238
- }
27239
- }
27240
-
27241
- variant = subtags[3]; // Normalize locale code.
27242
- // Get (or deduce) the "triple subtags": language, territory (also aliased as region), and script subtags.
27243
- // Get the variant subtags (calendar, collation, currency, etc).
27244
- // refs:
27245
- // - http://www.unicode.org/reports/tr35/#Field_Definitions
27246
- // - http://www.unicode.org/reports/tr35/#Language_and_Locale_IDs
27247
- // - http://www.unicode.org/reports/tr35/#Unicode_locale_identifier
27248
- // When a locale id does not specify a language, or territory (region), or script, they are obtained by Likely Subtags.
27249
-
27250
- maxLanguageId = coreLikelySubtags(Cldr, this, subtags, {
27251
- force: true
27252
- }) || subtags;
27253
- language = maxLanguageId[0];
27254
- script = maxLanguageId[1];
27255
- territory = maxLanguageId[2];
27256
- minLanguageId = coreRemoveLikelySubtags(Cldr, this, maxLanguageId).join(sep); // Set attributes
27257
-
27258
- this.attributes = attributes = {
27259
- bundle: bundleLookup(Cldr, this, minLanguageId),
27260
- // Unicode Language Id
27261
- minLanguageId: minLanguageId + unicodeLocaleExtensionsRaw,
27262
- maxLanguageId: maxLanguageId.join(sep) + unicodeLocaleExtensionsRaw,
27263
- // Unicode Language Id Subtabs
27264
- language: language,
27265
- script: script,
27266
- territory: territory,
27267
- region: territory,
27268
-
27269
- /* alias */
27270
- variant: variant
27271
- }; // Unicode locale extensions.
27272
-
27273
- unicodeLocaleExtensions && ("-" + unicodeLocaleExtensions).replace(/-[a-z]{3,8}|(-[a-z]{2})-([a-z]{3,8})/g, function (attribute, key, type) {
27274
- if (key) {
27275
- // Extension is in the `keyword` form.
27276
- attributes["u" + key] = type;
27277
- } else {
27278
- // Extension is in the `attribute` form.
27279
- attributes["u" + attribute] = true;
27280
- }
27281
- });
27282
- this.locale = locale;
27283
- };
27284
- /**
27285
- * .get()
27286
- */
27287
-
27288
-
27289
- Cldr.prototype.get = function (path) {
27290
- validatePresence(path, "path");
27291
- validateTypePath(path, "path");
27292
- return itemGetResolved(Cldr, path, this.attributes);
27293
- };
27294
- /**
27295
- * .main()
27296
- */
27297
-
27298
-
27299
- Cldr.prototype.main = function (path) {
27300
- validatePresence(path, "path");
27301
- validateTypePath(path, "path");
27302
- validate("E_MISSING_BUNDLE", this.attributes.bundle !== null, {
27303
- locale: this.locale
27304
- });
27305
- path = alwaysArray(path);
27306
- return this.get(["main/{bundle}"].concat(path));
27307
- };
26674
+ /*!
26675
+ * CLDR JavaScript Library v0.5.4 2020-10-22T15:56Z MIT license © Rafael Xavier
26676
+ * http://git.io/h4lmVg
26677
+ */
26678
+ (function (root, factory) {
26679
+ {
26680
+ // Node. CommonJS.
26681
+ module.exports = factory();
26682
+ }
26683
+ })(commonjsGlobal, function () {
26684
+ var arrayIsArray = Array.isArray || function (obj) {
26685
+ return Object.prototype.toString.call(obj) === "[object Array]";
26686
+ };
26687
+ var pathNormalize = function (path, attributes) {
26688
+ if (arrayIsArray(path)) {
26689
+ path = path.join("/");
26690
+ }
26691
+ if (typeof path !== "string") {
26692
+ throw new Error("invalid path \"" + path + "\"");
26693
+ }
26694
+ // 1: Ignore leading slash `/`
26695
+ // 2: Ignore leading `cldr/`
26696
+ path = path.replace(/^\//, "") /* 1 */.replace(/^cldr\//, ""); /* 2 */
26697
+
26698
+ // Replace {attribute}'s
26699
+ path = path.replace(/{[a-zA-Z]+}/g, function (name) {
26700
+ name = name.replace(/^{([^}]*)}$/, "$1");
26701
+ return attributes[name];
26702
+ });
26703
+ return path.split("/");
26704
+ };
26705
+ var arraySome = function (array, callback) {
26706
+ var i, length;
26707
+ if (array.some) {
26708
+ return array.some(callback);
26709
+ }
26710
+ for (i = 0, length = array.length; i < length; i++) {
26711
+ if (callback(array[i], i, array)) {
26712
+ return true;
26713
+ }
26714
+ }
26715
+ return false;
26716
+ };
26717
+
26718
+ /**
26719
+ * Return the maximized language id as defined in
26720
+ * http://www.unicode.org/reports/tr35/#Likely_Subtags
26721
+ * 1. Canonicalize.
26722
+ * 1.1 Make sure the input locale is in canonical form: uses the right
26723
+ * separator, and has the right casing.
26724
+ * TODO Right casing? What df? It seems languages are lowercase, scripts are
26725
+ * Capitalized, territory is uppercase. I am leaving this as an exercise to
26726
+ * the user.
26727
+ *
26728
+ * 1.2 Replace any deprecated subtags with their canonical values using the
26729
+ * <alias> data in supplemental metadata. Use the first value in the
26730
+ * replacement list, if it exists. Language tag replacements may have multiple
26731
+ * parts, such as "sh" "sr_Latn" or mo" "ro_MD". In such a case, the
26732
+ * original script and/or region are retained if there is one. Thus
26733
+ * "sh_Arab_AQ" "sr_Arab_AQ", not "sr_Latn_AQ".
26734
+ * TODO What <alias> data?
26735
+ *
26736
+ * 1.3 If the tag is grandfathered (see <variable id="$grandfathered"
26737
+ * type="choice"> in the supplemental data), then return it.
26738
+ * TODO grandfathered?
26739
+ *
26740
+ * 1.4 Remove the script code 'Zzzz' and the region code 'ZZ' if they occur.
26741
+ * 1.5 Get the components of the cleaned-up source tag (languages, scripts,
26742
+ * and regions), plus any variants and extensions.
26743
+ * 2. Lookup. Lookup each of the following in order, and stop on the first
26744
+ * match:
26745
+ * 2.1 languages_scripts_regions
26746
+ * 2.2 languages_regions
26747
+ * 2.3 languages_scripts
26748
+ * 2.4 languages
26749
+ * 2.5 und_scripts
26750
+ * 3. Return
26751
+ * 3.1 If there is no match, either return an error value, or the match for
26752
+ * "und" (in APIs where a valid language tag is required).
26753
+ * 3.2 Otherwise there is a match = languagem_scriptm_regionm
26754
+ * 3.3 Let xr = xs if xs is not empty, and xm otherwise.
26755
+ * 3.4 Return the language tag composed of languager _ scriptr _ regionr +
26756
+ * variants + extensions.
26757
+ *
26758
+ * @subtags [Array] normalized language id subtags tuple (see init.js).
26759
+ */
26760
+ var coreLikelySubtags = function (Cldr, cldr, subtags, options) {
26761
+ var match,
26762
+ matchFound,
26763
+ language = subtags[0],
26764
+ script = subtags[1],
26765
+ sep = Cldr.localeSep,
26766
+ territory = subtags[2],
26767
+ variants = subtags.slice(3, 4);
26768
+ options = options || {};
26769
+
26770
+ // Skip if (language, script, territory) is not empty [3.3]
26771
+ if (language !== "und" && script !== "Zzzz" && territory !== "ZZ") {
26772
+ return [language, script, territory].concat(variants);
26773
+ }
26774
+
26775
+ // Skip if no supplemental likelySubtags data is present
26776
+ if (typeof cldr.get("supplemental/likelySubtags") === "undefined") {
26777
+ return;
26778
+ }
26779
+
26780
+ // [2]
26781
+ matchFound = arraySome([[language, script, territory], [language, territory], [language, script], [language], ["und", script]], function (test) {
26782
+ return match = !/\b(Zzzz|ZZ)\b/.test(test.join(sep)) /* [1.4] */ && cldr.get(["supplemental/likelySubtags", test.join(sep)]);
26783
+ });
26784
+
26785
+ // [3]
26786
+ if (matchFound) {
26787
+ // [3.2 .. 3.4]
26788
+ match = match.split(sep);
26789
+ return [language !== "und" ? language : match[0], script !== "Zzzz" ? script : match[1], territory !== "ZZ" ? territory : match[2]].concat(variants);
26790
+ } else if (options.force) {
26791
+ // [3.1.2]
26792
+ return cldr.get("supplemental/likelySubtags/und").split(sep);
26793
+ } else {
26794
+ // [3.1.1]
26795
+ return;
26796
+ }
26797
+ };
26798
+
26799
+ /**
26800
+ * Given a locale, remove any fields that Add Likely Subtags would add.
26801
+ * http://www.unicode.org/reports/tr35/#Likely_Subtags
26802
+ * 1. First get max = AddLikelySubtags(inputLocale). If an error is signaled,
26803
+ * return it.
26804
+ * 2. Remove the variants from max.
26805
+ * 3. Then for trial in {language, language _ region, language _ script}. If
26806
+ * AddLikelySubtags(trial) = max, then return trial + variants.
26807
+ * 4. If you do not get a match, return max + variants.
26808
+ *
26809
+ * @maxLanguageId [Array] maxLanguageId tuple (see init.js).
26810
+ */
26811
+ var coreRemoveLikelySubtags = function (Cldr, cldr, maxLanguageId) {
26812
+ var match,
26813
+ matchFound,
26814
+ language = maxLanguageId[0],
26815
+ script = maxLanguageId[1],
26816
+ territory = maxLanguageId[2],
26817
+ variants = maxLanguageId[3];
26818
+
26819
+ // [3]
26820
+ matchFound = arraySome([[[language, "Zzzz", "ZZ"], [language]], [[language, "Zzzz", territory], [language, territory]], [[language, script, "ZZ"], [language, script]]], function (test) {
26821
+ var result = coreLikelySubtags(Cldr, cldr, test[0]);
26822
+ match = test[1];
26823
+ return result && result[0] === maxLanguageId[0] && result[1] === maxLanguageId[1] && result[2] === maxLanguageId[2];
26824
+ });
26825
+ if (matchFound) {
26826
+ if (variants) {
26827
+ match.push(variants);
26828
+ }
26829
+ return match;
26830
+ }
26831
+
26832
+ // [4]
26833
+ return maxLanguageId;
26834
+ };
26835
+
26836
+ /**
26837
+ * subtags( locale )
26838
+ *
26839
+ * @locale [String]
26840
+ */
26841
+ var coreSubtags = function (locale) {
26842
+ var aux,
26843
+ unicodeLanguageId,
26844
+ subtags = [];
26845
+ locale = locale.replace(/_/, "-");
26846
+
26847
+ // Unicode locale extensions.
26848
+ aux = locale.split("-u-");
26849
+ if (aux[1]) {
26850
+ aux[1] = aux[1].split("-t-");
26851
+ locale = aux[0] + (aux[1][1] ? "-t-" + aux[1][1] : "");
26852
+ subtags[4 /* unicodeLocaleExtensions */] = aux[1][0];
26853
+ }
26854
+
26855
+ // TODO normalize transformed extensions. Currently, skipped.
26856
+ // subtags[ x ] = locale.split( "-t-" )[ 1 ];
26857
+ unicodeLanguageId = locale.split("-t-")[0];
26858
+
26859
+ // unicode_language_id = "root"
26860
+ // | unicode_language_subtag
26861
+ // (sep unicode_script_subtag)?
26862
+ // (sep unicode_region_subtag)?
26863
+ // (sep unicode_variant_subtag)* ;
26864
+ //
26865
+ // Although unicode_language_subtag = alpha{2,8}, I'm using alpha{2,3}. Because, there's no language on CLDR lengthier than 3.
26866
+ 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)$/);
26867
+ if (aux === null) {
26868
+ return ["und", "Zzzz", "ZZ"];
26869
+ }
26870
+ subtags[0 /* language */] = aux[10] /* root */ || aux[2] || "und";
26871
+ subtags[1 /* script */] = aux[4] || "Zzzz";
26872
+ subtags[2 /* territory */] = aux[6] || "ZZ";
26873
+ if (aux[7] && aux[7].length) {
26874
+ subtags[3 /* variant */] = aux[7].slice(1) /* remove leading "-" */;
26875
+ }
26876
+
26877
+ // 0: language
26878
+ // 1: script
26879
+ // 2: territory (aka region)
26880
+ // 3: variant
26881
+ // 4: unicodeLocaleExtensions
26882
+ return subtags;
26883
+ };
26884
+ var arrayForEach = function (array, callback) {
26885
+ var i, length;
26886
+ if (array.forEach) {
26887
+ return array.forEach(callback);
26888
+ }
26889
+ for (i = 0, length = array.length; i < length; i++) {
26890
+ callback(array[i], i, array);
26891
+ }
26892
+ };
26893
+
26894
+ /**
26895
+ * bundleLookup( minLanguageId )
26896
+ *
26897
+ * @Cldr [Cldr class]
26898
+ *
26899
+ * @cldr [Cldr instance]
26900
+ *
26901
+ * @minLanguageId [String] requested languageId after applied remove likely subtags.
26902
+ */
26903
+ var bundleLookup = function (Cldr, cldr, minLanguageId) {
26904
+ var availableBundleMap = Cldr._availableBundleMap,
26905
+ availableBundleMapQueue = Cldr._availableBundleMapQueue;
26906
+ if (availableBundleMapQueue.length) {
26907
+ arrayForEach(availableBundleMapQueue, function (bundle, i) {
26908
+ var existing, maxBundle, minBundle, subtags;
26909
+ subtags = coreSubtags(bundle);
26910
+ maxBundle = coreLikelySubtags(Cldr, cldr, subtags);
26911
+ if (maxBundle === undefined) {
26912
+ availableBundleMapQueue.splice(i, 1);
26913
+ throw new Error("Could not find likelySubtags for " + bundle);
26914
+ }
26915
+ minBundle = coreRemoveLikelySubtags(Cldr, cldr, maxBundle);
26916
+ minBundle = minBundle.join(Cldr.localeSep);
26917
+ existing = availableBundleMap[minBundle];
26918
+ if (existing && existing.length < bundle.length) {
26919
+ return;
26920
+ }
26921
+ availableBundleMap[minBundle] = bundle;
26922
+ });
26923
+ Cldr._availableBundleMapQueue = [];
26924
+ }
26925
+ return availableBundleMap[minLanguageId] || null;
26926
+ };
26927
+ var objectKeys = function (object) {
26928
+ var i,
26929
+ result = [];
26930
+ if (Object.keys) {
26931
+ return Object.keys(object);
26932
+ }
26933
+ for (i in object) {
26934
+ result.push(i);
26935
+ }
26936
+ return result;
26937
+ };
26938
+ var createError = function (code, attributes) {
26939
+ var error, message;
26940
+ message = code + (attributes && JSON ? ": " + JSON.stringify(attributes) : "");
26941
+ error = new Error(message);
26942
+ error.code = code;
26943
+
26944
+ // extend( error, attributes );
26945
+ arrayForEach(objectKeys(attributes), function (attribute) {
26946
+ error[attribute] = attributes[attribute];
26947
+ });
26948
+ return error;
26949
+ };
26950
+ var validate = function (code, check, attributes) {
26951
+ if (!check) {
26952
+ throw createError(code, attributes);
26953
+ }
26954
+ };
26955
+ var validatePresence = function (value, name) {
26956
+ validate("E_MISSING_PARAMETER", typeof value !== "undefined", {
26957
+ name: name
26958
+ });
26959
+ };
26960
+ var validateType = function (value, name, check, expected) {
26961
+ validate("E_INVALID_PAR_TYPE", check, {
26962
+ expected: expected,
26963
+ name: name,
26964
+ value: value
26965
+ });
26966
+ };
26967
+ var validateTypePath = function (value, name) {
26968
+ validateType(value, name, typeof value === "string" || arrayIsArray(value), "String or Array");
26969
+ };
26970
+
26971
+ /**
26972
+ * Function inspired by jQuery Core, but reduced to our use case.
26973
+ */
26974
+ var isPlainObject = function (obj) {
26975
+ return obj !== null && "" + obj === "[object Object]";
26976
+ };
26977
+ var validateTypePlainObject = function (value, name) {
26978
+ validateType(value, name, typeof value === "undefined" || isPlainObject(value), "Plain Object");
26979
+ };
26980
+ var validateTypeString = function (value, name) {
26981
+ validateType(value, name, typeof value === "string", "a string");
26982
+ };
26983
+
26984
+ // @path: normalized path
26985
+ var resourceGet = function (data, path) {
26986
+ var i,
26987
+ node = data,
26988
+ length = path.length;
26989
+ for (i = 0; i < length - 1; i++) {
26990
+ node = node[path[i]];
26991
+ if (!node) {
26992
+ return undefined;
26993
+ }
26994
+ }
26995
+ return node[path[i]];
26996
+ };
26997
+
26998
+ /**
26999
+ * setAvailableBundles( Cldr, json )
27000
+ *
27001
+ * @Cldr [Cldr class]
27002
+ *
27003
+ * @json resolved/unresolved cldr data.
27004
+ *
27005
+ * Set available bundles queue based on passed json CLDR data. Considers a bundle as any String at /main/{bundle}.
27006
+ */
27007
+ var coreSetAvailableBundles = function (Cldr, json) {
27008
+ var bundle,
27009
+ availableBundleMapQueue = Cldr._availableBundleMapQueue,
27010
+ main = resourceGet(json, ["main"]);
27011
+ if (main) {
27012
+ for (bundle in main) {
27013
+ if (main.hasOwnProperty(bundle) && bundle !== "root" && availableBundleMapQueue.indexOf(bundle) === -1) {
27014
+ availableBundleMapQueue.push(bundle);
27015
+ }
27016
+ }
27017
+ }
27018
+ };
27019
+ var alwaysArray = function (somethingOrArray) {
27020
+ return arrayIsArray(somethingOrArray) ? somethingOrArray : [somethingOrArray];
27021
+ };
27022
+ var jsonMerge = function () {
27023
+ // Returns new deeply merged JSON.
27024
+ //
27025
+ // Eg.
27026
+ // merge( { a: { b: 1, c: 2 } }, { a: { b: 3, d: 4 } } )
27027
+ // -> { a: { b: 3, c: 2, d: 4 } }
27028
+ //
27029
+ // @arguments JSON's
27030
+ //
27031
+ var merge = function () {
27032
+ var destination = {},
27033
+ sources = [].slice.call(arguments, 0);
27034
+ arrayForEach(sources, function (source) {
27035
+ var prop;
27036
+ for (prop in source) {
27037
+ if (prop in destination && typeof destination[prop] === "object" && !arrayIsArray(destination[prop])) {
27038
+ // Merge Objects
27039
+ destination[prop] = merge(destination[prop], source[prop]);
27040
+ } else {
27041
+ // Set new values
27042
+ destination[prop] = source[prop];
27043
+ }
27044
+ }
27045
+ });
27046
+ return destination;
27047
+ };
27048
+ return merge;
27049
+ }();
27050
+
27051
+ /**
27052
+ * load( Cldr, source, jsons )
27053
+ *
27054
+ * @Cldr [Cldr class]
27055
+ *
27056
+ * @source [Object]
27057
+ *
27058
+ * @jsons [arguments]
27059
+ */
27060
+ var coreLoad = function (Cldr, source, jsons) {
27061
+ var i, j, json;
27062
+ validatePresence(jsons[0], "json");
27063
+
27064
+ // Support arbitrary parameters, e.g., `Cldr.load({...}, {...})`.
27065
+ for (i = 0; i < jsons.length; i++) {
27066
+ // Support array parameters, e.g., `Cldr.load([{...}, {...}])`.
27067
+ json = alwaysArray(jsons[i]);
27068
+ for (j = 0; j < json.length; j++) {
27069
+ validateTypePlainObject(json[j], "json");
27070
+ source = jsonMerge(source, json[j]);
27071
+ coreSetAvailableBundles(Cldr, json[j]);
27072
+ }
27073
+ }
27074
+ return source;
27075
+ };
27076
+ var itemGetResolved = function (Cldr, path, attributes) {
27077
+ // Resolve path
27078
+ var normalizedPath = pathNormalize(path, attributes);
27079
+ return resourceGet(Cldr._resolved, normalizedPath);
27080
+ };
27081
+
27082
+ /**
27083
+ * new Cldr()
27084
+ */
27085
+ var Cldr = function (locale) {
27086
+ this.init(locale);
27087
+ };
27088
+
27089
+ // Build optimization hack to avoid duplicating functions across modules.
27090
+ Cldr._alwaysArray = alwaysArray;
27091
+ Cldr._coreLoad = coreLoad;
27092
+ Cldr._createError = createError;
27093
+ Cldr._itemGetResolved = itemGetResolved;
27094
+ Cldr._jsonMerge = jsonMerge;
27095
+ Cldr._pathNormalize = pathNormalize;
27096
+ Cldr._resourceGet = resourceGet;
27097
+ Cldr._validatePresence = validatePresence;
27098
+ Cldr._validateType = validateType;
27099
+ Cldr._validateTypePath = validateTypePath;
27100
+ Cldr._validateTypePlainObject = validateTypePlainObject;
27101
+ Cldr._availableBundleMap = {};
27102
+ Cldr._availableBundleMapQueue = [];
27103
+ Cldr._resolved = {};
27104
+
27105
+ // 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.
27106
+ Cldr.localeSep = "-";
27107
+
27108
+ /**
27109
+ * Cldr.load( json [, json, ...] )
27110
+ *
27111
+ * @json [JSON] CLDR data or [Array] Array of @json's.
27112
+ *
27113
+ * Load resolved cldr data.
27114
+ */
27115
+ Cldr.load = function () {
27116
+ Cldr._resolved = coreLoad(Cldr, Cldr._resolved, arguments);
27117
+ };
27118
+
27119
+ /**
27120
+ * .init() automatically run on instantiation/construction.
27121
+ */
27122
+ Cldr.prototype.init = function (locale) {
27123
+ var attributes,
27124
+ language,
27125
+ maxLanguageId,
27126
+ minLanguageId,
27127
+ script,
27128
+ subtags,
27129
+ territory,
27130
+ unicodeLocaleExtensions,
27131
+ variant,
27132
+ sep = Cldr.localeSep,
27133
+ unicodeLocaleExtensionsRaw = "";
27134
+ validatePresence(locale, "locale");
27135
+ validateTypeString(locale, "locale");
27136
+ subtags = coreSubtags(locale);
27137
+ if (subtags.length === 5) {
27138
+ unicodeLocaleExtensions = subtags.pop();
27139
+ unicodeLocaleExtensionsRaw = sep + "u" + sep + unicodeLocaleExtensions;
27140
+ // Remove trailing null when there is unicodeLocaleExtensions but no variants.
27141
+ if (!subtags[3]) {
27142
+ subtags.pop();
27143
+ }
27144
+ }
27145
+ variant = subtags[3];
27146
+
27147
+ // Normalize locale code.
27148
+ // Get (or deduce) the "triple subtags": language, territory (also aliased as region), and script subtags.
27149
+ // Get the variant subtags (calendar, collation, currency, etc).
27150
+ // refs:
27151
+ // - http://www.unicode.org/reports/tr35/#Field_Definitions
27152
+ // - http://www.unicode.org/reports/tr35/#Language_and_Locale_IDs
27153
+ // - http://www.unicode.org/reports/tr35/#Unicode_locale_identifier
27154
+
27155
+ // When a locale id does not specify a language, or territory (region), or script, they are obtained by Likely Subtags.
27156
+ maxLanguageId = coreLikelySubtags(Cldr, this, subtags, {
27157
+ force: true
27158
+ }) || subtags;
27159
+ language = maxLanguageId[0];
27160
+ script = maxLanguageId[1];
27161
+ territory = maxLanguageId[2];
27162
+ minLanguageId = coreRemoveLikelySubtags(Cldr, this, maxLanguageId).join(sep);
27163
+
27164
+ // Set attributes
27165
+ this.attributes = attributes = {
27166
+ bundle: bundleLookup(Cldr, this, minLanguageId),
27167
+ // Unicode Language Id
27168
+ minLanguageId: minLanguageId + unicodeLocaleExtensionsRaw,
27169
+ maxLanguageId: maxLanguageId.join(sep) + unicodeLocaleExtensionsRaw,
27170
+ // Unicode Language Id Subtabs
27171
+ language: language,
27172
+ script: script,
27173
+ territory: territory,
27174
+ region: territory,
27175
+ /* alias */
27176
+ variant: variant
27177
+ };
27178
+
27179
+ // Unicode locale extensions.
27180
+ unicodeLocaleExtensions && ("-" + unicodeLocaleExtensions).replace(/-[a-z]{3,8}|(-[a-z]{2})-([a-z]{3,8})/g, function (attribute, key, type) {
27181
+ if (key) {
27182
+ // Extension is in the `keyword` form.
27183
+ attributes["u" + key] = type;
27184
+ } else {
27185
+ // Extension is in the `attribute` form.
27186
+ attributes["u" + attribute] = true;
27187
+ }
27188
+ });
27189
+ this.locale = locale;
27190
+ };
27191
+
27192
+ /**
27193
+ * .get()
27194
+ */
27195
+ Cldr.prototype.get = function (path) {
27196
+ validatePresence(path, "path");
27197
+ validateTypePath(path, "path");
27198
+ return itemGetResolved(Cldr, path, this.attributes);
27199
+ };
27200
+
27201
+ /**
27202
+ * .main()
27203
+ */
27204
+ Cldr.prototype.main = function (path) {
27205
+ validatePresence(path, "path");
27206
+ validateTypePath(path, "path");
27207
+ validate("E_MISSING_BUNDLE", this.attributes.bundle !== null, {
27208
+ locale: this.locale
27209
+ });
27210
+ path = alwaysArray(path);
27211
+ return this.get(["main/{bundle}"].concat(path));
27212
+ };
27213
+ return Cldr;
27214
+ });
27215
+ } (cldr));
27216
+
27217
+ var eventExports = {};
27218
+ var event = {
27219
+ get exports(){ return eventExports; },
27220
+ set exports(v){ eventExports = v; },
27221
+ };
27308
27222
 
27309
- return Cldr;
27310
- });
27311
- }(cldr));
27223
+ /**
27224
+ * CLDR JavaScript Library v0.5.4
27225
+ * http://jquery.com/
27226
+ *
27227
+ * Copyright 2013 Rafael Xavier de Souza
27228
+ * Released under the MIT license
27229
+ * http://jquery.org/license
27230
+ *
27231
+ * Date: 2020-10-22T15:56Z
27232
+ */
27312
27233
 
27313
- var event = {exports: {}};
27234
+ (function (module) {
27235
+ /*!
27236
+ * CLDR JavaScript Library v0.5.4 2020-10-22T15:56Z MIT license © Rafael Xavier
27237
+ * http://git.io/h4lmVg
27238
+ */
27239
+ (function (factory) {
27240
+ {
27241
+ // Node. CommonJS.
27242
+ module.exports = factory(cldrExports);
27243
+ }
27244
+ })(function (Cldr) {
27245
+ // Build optimization hack to avoid duplicating functions across modules.
27246
+ var pathNormalize = Cldr._pathNormalize,
27247
+ validatePresence = Cldr._validatePresence,
27248
+ validateType = Cldr._validateType;
27249
+
27250
+ /*!
27251
+ * EventEmitter v4.2.7 - git.io/ee
27252
+ * Oliver Caldwell
27253
+ * MIT license
27254
+ * @preserve
27255
+ */
27256
+
27257
+ var EventEmitter;
27258
+ /* jshint ignore:start */
27259
+ EventEmitter = function () {
27260
+ /**
27261
+ * Class for managing events.
27262
+ * Can be extended to provide event functionality in other classes.
27263
+ *
27264
+ * @class EventEmitter Manages event registering and emitting.
27265
+ */
27266
+ function EventEmitter() {}
27267
+
27268
+ // Shortcuts to improve speed and size
27269
+ var proto = EventEmitter.prototype;
27270
+
27271
+ /**
27272
+ * Finds the index of the listener for the event in it's storage array.
27273
+ *
27274
+ * @param {Function[]} listeners Array of listeners to search through.
27275
+ * @param {Function} listener Method to look for.
27276
+ * @return {Number} Index of the specified listener, -1 if not found
27277
+ * @api private
27278
+ */
27279
+ function indexOfListener(listeners, listener) {
27280
+ var i = listeners.length;
27281
+ while (i--) {
27282
+ if (listeners[i].listener === listener) {
27283
+ return i;
27284
+ }
27285
+ }
27286
+ return -1;
27287
+ }
27288
+
27289
+ /**
27290
+ * Alias a method while keeping the context correct, to allow for overwriting of target method.
27291
+ *
27292
+ * @param {String} name The name of the target method.
27293
+ * @return {Function} The aliased method
27294
+ * @api private
27295
+ */
27296
+ function alias(name) {
27297
+ return function aliasClosure() {
27298
+ return this[name].apply(this, arguments);
27299
+ };
27300
+ }
27301
+
27302
+ /**
27303
+ * Returns the listener array for the specified event.
27304
+ * Will initialise the event object and listener arrays if required.
27305
+ * 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.
27306
+ * Each property in the object response is an array of listener functions.
27307
+ *
27308
+ * @param {String|RegExp} evt Name of the event to return the listeners from.
27309
+ * @return {Function[]|Object} All listener functions for the event.
27310
+ */
27311
+ proto.getListeners = function getListeners(evt) {
27312
+ var events = this._getEvents();
27313
+ var response;
27314
+ var key;
27315
+
27316
+ // Return a concatenated array of all matching events if
27317
+ // the selector is a regular expression.
27318
+ if (evt instanceof RegExp) {
27319
+ response = {};
27320
+ for (key in events) {
27321
+ if (events.hasOwnProperty(key) && evt.test(key)) {
27322
+ response[key] = events[key];
27323
+ }
27324
+ }
27325
+ } else {
27326
+ response = events[evt] || (events[evt] = []);
27327
+ }
27328
+ return response;
27329
+ };
27330
+
27331
+ /**
27332
+ * Takes a list of listener objects and flattens it into a list of listener functions.
27333
+ *
27334
+ * @param {Object[]} listeners Raw listener objects.
27335
+ * @return {Function[]} Just the listener functions.
27336
+ */
27337
+ proto.flattenListeners = function flattenListeners(listeners) {
27338
+ var flatListeners = [];
27339
+ var i;
27340
+ for (i = 0; i < listeners.length; i += 1) {
27341
+ flatListeners.push(listeners[i].listener);
27342
+ }
27343
+ return flatListeners;
27344
+ };
27345
+
27346
+ /**
27347
+ * 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.
27348
+ *
27349
+ * @param {String|RegExp} evt Name of the event to return the listeners from.
27350
+ * @return {Object} All listener functions for an event in an object.
27351
+ */
27352
+ proto.getListenersAsObject = function getListenersAsObject(evt) {
27353
+ var listeners = this.getListeners(evt);
27354
+ var response;
27355
+ if (listeners instanceof Array) {
27356
+ response = {};
27357
+ response[evt] = listeners;
27358
+ }
27359
+ return response || listeners;
27360
+ };
27361
+
27362
+ /**
27363
+ * Adds a listener function to the specified event.
27364
+ * The listener will not be added if it is a duplicate.
27365
+ * If the listener returns true then it will be removed after it is called.
27366
+ * If you pass a regular expression as the event name then the listener will be added to all events that match it.
27367
+ *
27368
+ * @param {String|RegExp} evt Name of the event to attach the listener to.
27369
+ * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.
27370
+ * @return {Object} Current instance of EventEmitter for chaining.
27371
+ */
27372
+ proto.addListener = function addListener(evt, listener) {
27373
+ var listeners = this.getListenersAsObject(evt);
27374
+ var listenerIsWrapped = typeof listener === 'object';
27375
+ var key;
27376
+ for (key in listeners) {
27377
+ if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) {
27378
+ listeners[key].push(listenerIsWrapped ? listener : {
27379
+ listener: listener,
27380
+ once: false
27381
+ });
27382
+ }
27383
+ }
27384
+ return this;
27385
+ };
27386
+
27387
+ /**
27388
+ * Alias of addListener
27389
+ */
27390
+ proto.on = alias('addListener');
27391
+
27392
+ /**
27393
+ * Semi-alias of addListener. It will add a listener that will be
27394
+ * automatically removed after it's first execution.
27395
+ *
27396
+ * @param {String|RegExp} evt Name of the event to attach the listener to.
27397
+ * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.
27398
+ * @return {Object} Current instance of EventEmitter for chaining.
27399
+ */
27400
+ proto.addOnceListener = function addOnceListener(evt, listener) {
27401
+ return this.addListener(evt, {
27402
+ listener: listener,
27403
+ once: true
27404
+ });
27405
+ };
27406
+
27407
+ /**
27408
+ * Alias of addOnceListener.
27409
+ */
27410
+ proto.once = alias('addOnceListener');
27411
+
27412
+ /**
27413
+ * 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.
27414
+ * You need to tell it what event names should be matched by a regex.
27415
+ *
27416
+ * @param {String} evt Name of the event to create.
27417
+ * @return {Object} Current instance of EventEmitter for chaining.
27418
+ */
27419
+ proto.defineEvent = function defineEvent(evt) {
27420
+ this.getListeners(evt);
27421
+ return this;
27422
+ };
27423
+
27424
+ /**
27425
+ * Uses defineEvent to define multiple events.
27426
+ *
27427
+ * @param {String[]} evts An array of event names to define.
27428
+ * @return {Object} Current instance of EventEmitter for chaining.
27429
+ */
27430
+ proto.defineEvents = function defineEvents(evts) {
27431
+ for (var i = 0; i < evts.length; i += 1) {
27432
+ this.defineEvent(evts[i]);
27433
+ }
27434
+ return this;
27435
+ };
27436
+
27437
+ /**
27438
+ * Removes a listener function from the specified event.
27439
+ * When passed a regular expression as the event name, it will remove the listener from all events that match it.
27440
+ *
27441
+ * @param {String|RegExp} evt Name of the event to remove the listener from.
27442
+ * @param {Function} listener Method to remove from the event.
27443
+ * @return {Object} Current instance of EventEmitter for chaining.
27444
+ */
27445
+ proto.removeListener = function removeListener(evt, listener) {
27446
+ var listeners = this.getListenersAsObject(evt);
27447
+ var index;
27448
+ var key;
27449
+ for (key in listeners) {
27450
+ if (listeners.hasOwnProperty(key)) {
27451
+ index = indexOfListener(listeners[key], listener);
27452
+ if (index !== -1) {
27453
+ listeners[key].splice(index, 1);
27454
+ }
27455
+ }
27456
+ }
27457
+ return this;
27458
+ };
27459
+
27460
+ /**
27461
+ * Alias of removeListener
27462
+ */
27463
+ proto.off = alias('removeListener');
27464
+
27465
+ /**
27466
+ * Adds listeners in bulk using the manipulateListeners method.
27467
+ * 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.
27468
+ * You can also pass it a regular expression to add the array of listeners to all events that match it.
27469
+ * Yeah, this function does quite a bit. That's probably a bad thing.
27470
+ *
27471
+ * @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.
27472
+ * @param {Function[]} [listeners] An optional array of listener functions to add.
27473
+ * @return {Object} Current instance of EventEmitter for chaining.
27474
+ */
27475
+ proto.addListeners = function addListeners(evt, listeners) {
27476
+ // Pass through to manipulateListeners
27477
+ return this.manipulateListeners(false, evt, listeners);
27478
+ };
27479
+
27480
+ /**
27481
+ * Removes listeners in bulk using the manipulateListeners method.
27482
+ * 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.
27483
+ * You can also pass it an event name and an array of listeners to be removed.
27484
+ * You can also pass it a regular expression to remove the listeners from all events that match it.
27485
+ *
27486
+ * @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.
27487
+ * @param {Function[]} [listeners] An optional array of listener functions to remove.
27488
+ * @return {Object} Current instance of EventEmitter for chaining.
27489
+ */
27490
+ proto.removeListeners = function removeListeners(evt, listeners) {
27491
+ // Pass through to manipulateListeners
27492
+ return this.manipulateListeners(true, evt, listeners);
27493
+ };
27494
+
27495
+ /**
27496
+ * 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.
27497
+ * The first argument will determine if the listeners are removed (true) or added (false).
27498
+ * 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.
27499
+ * You can also pass it an event name and an array of listeners to be added/removed.
27500
+ * You can also pass it a regular expression to manipulate the listeners of all events that match it.
27501
+ *
27502
+ * @param {Boolean} remove True if you want to remove listeners, false if you want to add.
27503
+ * @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.
27504
+ * @param {Function[]} [listeners] An optional array of listener functions to add/remove.
27505
+ * @return {Object} Current instance of EventEmitter for chaining.
27506
+ */
27507
+ proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) {
27508
+ var i;
27509
+ var value;
27510
+ var single = remove ? this.removeListener : this.addListener;
27511
+ var multiple = remove ? this.removeListeners : this.addListeners;
27512
+
27513
+ // If evt is an object then pass each of it's properties to this method
27514
+ if (typeof evt === 'object' && !(evt instanceof RegExp)) {
27515
+ for (i in evt) {
27516
+ if (evt.hasOwnProperty(i) && (value = evt[i])) {
27517
+ // Pass the single listener straight through to the singular method
27518
+ if (typeof value === 'function') {
27519
+ single.call(this, i, value);
27520
+ } else {
27521
+ // Otherwise pass back to the multiple function
27522
+ multiple.call(this, i, value);
27523
+ }
27524
+ }
27525
+ }
27526
+ } else {
27527
+ // So evt must be a string
27528
+ // And listeners must be an array of listeners
27529
+ // Loop over it and pass each one to the multiple method
27530
+ i = listeners.length;
27531
+ while (i--) {
27532
+ single.call(this, evt, listeners[i]);
27533
+ }
27534
+ }
27535
+ return this;
27536
+ };
27537
+
27538
+ /**
27539
+ * Removes all listeners from a specified event.
27540
+ * If you do not specify an event then all listeners will be removed.
27541
+ * That means every event will be emptied.
27542
+ * You can also pass a regex to remove all events that match it.
27543
+ *
27544
+ * @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed.
27545
+ * @return {Object} Current instance of EventEmitter for chaining.
27546
+ */
27547
+ proto.removeEvent = function removeEvent(evt) {
27548
+ var type = typeof evt;
27549
+ var events = this._getEvents();
27550
+ var key;
27551
+
27552
+ // Remove different things depending on the state of evt
27553
+ if (type === 'string') {
27554
+ // Remove all listeners for the specified event
27555
+ delete events[evt];
27556
+ } else if (evt instanceof RegExp) {
27557
+ // Remove all events matching the regex.
27558
+ for (key in events) {
27559
+ if (events.hasOwnProperty(key) && evt.test(key)) {
27560
+ delete events[key];
27561
+ }
27562
+ }
27563
+ } else {
27564
+ // Remove all listeners in all events
27565
+ delete this._events;
27566
+ }
27567
+ return this;
27568
+ };
27569
+
27570
+ /**
27571
+ * Alias of removeEvent.
27572
+ *
27573
+ * Added to mirror the node API.
27574
+ */
27575
+ proto.removeAllListeners = alias('removeEvent');
27576
+
27577
+ /**
27578
+ * Emits an event of your choice.
27579
+ * When emitted, every listener attached to that event will be executed.
27580
+ * If you pass the optional argument array then those arguments will be passed to every listener upon execution.
27581
+ * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately.
27582
+ * So they will not arrive within the array on the other side, they will be separate.
27583
+ * You can also pass a regular expression to emit to all events that match it.
27584
+ *
27585
+ * @param {String|RegExp} evt Name of the event to emit and execute listeners for.
27586
+ * @param {Array} [args] Optional array of arguments to be passed to each listener.
27587
+ * @return {Object} Current instance of EventEmitter for chaining.
27588
+ */
27589
+ proto.emitEvent = function emitEvent(evt, args) {
27590
+ var listeners = this.getListenersAsObject(evt);
27591
+ var listener;
27592
+ var i;
27593
+ var key;
27594
+ var response;
27595
+ for (key in listeners) {
27596
+ if (listeners.hasOwnProperty(key)) {
27597
+ i = listeners[key].length;
27598
+ while (i--) {
27599
+ // If the listener returns true then it shall be removed from the event
27600
+ // The function is executed either with a basic call or an apply if there is an args array
27601
+ listener = listeners[key][i];
27602
+ if (listener.once === true) {
27603
+ this.removeListener(evt, listener.listener);
27604
+ }
27605
+ response = listener.listener.apply(this, args || []);
27606
+ if (response === this._getOnceReturnValue()) {
27607
+ this.removeListener(evt, listener.listener);
27608
+ }
27609
+ }
27610
+ }
27611
+ }
27612
+ return this;
27613
+ };
27614
+
27615
+ /**
27616
+ * Alias of emitEvent
27617
+ */
27618
+ proto.trigger = alias('emitEvent');
27619
+
27620
+ /**
27621
+ * 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.
27622
+ * As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it.
27623
+ *
27624
+ * @param {String|RegExp} evt Name of the event to emit and execute listeners for.
27625
+ * @param {...*} Optional additional arguments to be passed to each listener.
27626
+ * @return {Object} Current instance of EventEmitter for chaining.
27627
+ */
27628
+ proto.emit = function emit(evt) {
27629
+ var args = Array.prototype.slice.call(arguments, 1);
27630
+ return this.emitEvent(evt, args);
27631
+ };
27632
+
27633
+ /**
27634
+ * Sets the current value to check against when executing listeners. If a
27635
+ * listeners return value matches the one set here then it will be removed
27636
+ * after execution. This value defaults to true.
27637
+ *
27638
+ * @param {*} value The new value to check for when executing listeners.
27639
+ * @return {Object} Current instance of EventEmitter for chaining.
27640
+ */
27641
+ proto.setOnceReturnValue = function setOnceReturnValue(value) {
27642
+ this._onceReturnValue = value;
27643
+ return this;
27644
+ };
27645
+
27646
+ /**
27647
+ * Fetches the current value to check against when executing listeners. If
27648
+ * the listeners return value matches this one then it should be removed
27649
+ * automatically. It will return true by default.
27650
+ *
27651
+ * @return {*|Boolean} The current value to check for or the default, true.
27652
+ * @api private
27653
+ */
27654
+ proto._getOnceReturnValue = function _getOnceReturnValue() {
27655
+ if (this.hasOwnProperty('_onceReturnValue')) {
27656
+ return this._onceReturnValue;
27657
+ } else {
27658
+ return true;
27659
+ }
27660
+ };
27661
+
27662
+ /**
27663
+ * Fetches the events object and creates one if required.
27664
+ *
27665
+ * @return {Object} The events storage object.
27666
+ * @api private
27667
+ */
27668
+ proto._getEvents = function _getEvents() {
27669
+ return this._events || (this._events = {});
27670
+ };
27671
+
27672
+ /**
27673
+ * Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version.
27674
+ *
27675
+ * @return {Function} Non conflicting EventEmitter class.
27676
+ */
27677
+ EventEmitter.noConflict = function noConflict() {
27678
+ originalGlobalValue;
27679
+ return EventEmitter;
27680
+ };
27681
+ return EventEmitter;
27682
+ }();
27683
+ /* jshint ignore:end */
27684
+
27685
+ var validateTypeFunction = function (value, name) {
27686
+ validateType(value, name, typeof value === "undefined" || typeof value === "function", "Function");
27687
+ };
27688
+ var superGet,
27689
+ superInit,
27690
+ globalEe = new EventEmitter();
27691
+ function validateTypeEvent(value, name) {
27692
+ validateType(value, name, typeof value === "string" || value instanceof RegExp, "String or RegExp");
27693
+ }
27694
+ function validateThenCall(method, self) {
27695
+ return function (event, listener) {
27696
+ validatePresence(event, "event");
27697
+ validateTypeEvent(event, "event");
27698
+ validatePresence(listener, "listener");
27699
+ validateTypeFunction(listener, "listener");
27700
+ return self[method].apply(self, arguments);
27701
+ };
27702
+ }
27703
+ function off(self) {
27704
+ return validateThenCall("off", self);
27705
+ }
27706
+ function on(self) {
27707
+ return validateThenCall("on", self);
27708
+ }
27709
+ function once(self) {
27710
+ return validateThenCall("once", self);
27711
+ }
27712
+ Cldr.off = off(globalEe);
27713
+ Cldr.on = on(globalEe);
27714
+ Cldr.once = once(globalEe);
27715
+
27716
+ /**
27717
+ * Overload Cldr.prototype.init().
27718
+ */
27719
+ superInit = Cldr.prototype.init;
27720
+ Cldr.prototype.init = function () {
27721
+ var ee;
27722
+ this.ee = ee = new EventEmitter();
27723
+ this.off = off(ee);
27724
+ this.on = on(ee);
27725
+ this.once = once(ee);
27726
+ superInit.apply(this, arguments);
27727
+ };
27728
+
27729
+ /**
27730
+ * getOverload is encapsulated, because of cldr/unresolved. If it's loaded
27731
+ * after cldr/event (and note it overwrites .get), it can trigger this
27732
+ * overload again.
27733
+ */
27734
+ function getOverload() {
27735
+ /**
27736
+ * Overload Cldr.prototype.get().
27737
+ */
27738
+ superGet = Cldr.prototype.get;
27739
+ Cldr.prototype.get = function (path) {
27740
+ var value = superGet.apply(this, arguments);
27741
+ path = pathNormalize(path, this.attributes).join("/");
27742
+ globalEe.trigger("get", [path, value]);
27743
+ this.ee.trigger("get", [path, value]);
27744
+ return value;
27745
+ };
27746
+ }
27747
+ Cldr._eventInit = getOverload;
27748
+ getOverload();
27749
+ return Cldr;
27750
+ });
27751
+ } (event));
27752
+
27753
+ var supplementalExports = {};
27754
+ var supplemental = {
27755
+ get exports(){ return supplementalExports; },
27756
+ set exports(v){ supplementalExports = v; },
27757
+ };
27314
27758
 
27315
27759
  /**
27316
27760
  * CLDR JavaScript Library v0.5.4
@@ -27324,841 +27768,231 @@ var event = {exports: {}};
27324
27768
  */
27325
27769
 
27326
27770
  (function (module) {
27327
- /*!
27328
- * CLDR JavaScript Library v0.5.4 2020-10-22T15:56Z MIT license © Rafael Xavier
27329
- * http://git.io/h4lmVg
27771
+ /*!
27772
+ * CLDR JavaScript Library v0.5.4 2020-10-22T15:56Z MIT license © Rafael Xavier
27773
+ * http://git.io/h4lmVg
27774
+ */
27775
+ (function (factory) {
27776
+ {
27777
+ // Node. CommonJS.
27778
+ module.exports = factory(cldrExports);
27779
+ }
27780
+ })(function (Cldr) {
27781
+ // Build optimization hack to avoid duplicating functions across modules.
27782
+ var alwaysArray = Cldr._alwaysArray;
27783
+ var supplementalMain = function (cldr) {
27784
+ var prepend, supplemental;
27785
+ prepend = function (prepend) {
27786
+ return function (path) {
27787
+ path = alwaysArray(path);
27788
+ return cldr.get([prepend].concat(path));
27789
+ };
27790
+ };
27791
+ supplemental = prepend("supplemental");
27792
+
27793
+ // Week Data
27794
+ // http://www.unicode.org/reports/tr35/tr35-dates.html#Week_Data
27795
+ supplemental.weekData = prepend("supplemental/weekData");
27796
+ supplemental.weekData.firstDay = function () {
27797
+ return cldr.get("supplemental/weekData/firstDay/{territory}") || cldr.get("supplemental/weekData/firstDay/001");
27798
+ };
27799
+ supplemental.weekData.minDays = function () {
27800
+ var minDays = cldr.get("supplemental/weekData/minDays/{territory}") || cldr.get("supplemental/weekData/minDays/001");
27801
+ return parseInt(minDays, 10);
27802
+ };
27803
+
27804
+ // Time Data
27805
+ // http://www.unicode.org/reports/tr35/tr35-dates.html#Time_Data
27806
+ supplemental.timeData = prepend("supplemental/timeData");
27807
+ supplemental.timeData.allowed = function () {
27808
+ return cldr.get("supplemental/timeData/{territory}/_allowed") || cldr.get("supplemental/timeData/001/_allowed");
27809
+ };
27810
+ supplemental.timeData.preferred = function () {
27811
+ return cldr.get("supplemental/timeData/{territory}/_preferred") || cldr.get("supplemental/timeData/001/_preferred");
27812
+ };
27813
+ return supplemental;
27814
+ };
27815
+ var initSuper = Cldr.prototype.init;
27816
+
27817
+ /**
27818
+ * .init() automatically ran on construction.
27819
+ *
27820
+ * Overload .init().
27821
+ */
27822
+ Cldr.prototype.init = function () {
27823
+ initSuper.apply(this, arguments);
27824
+ this.supplemental = supplementalMain(this);
27825
+ };
27826
+ return Cldr;
27827
+ });
27828
+ } (supplemental));
27829
+
27830
+ var unresolvedExports = {};
27831
+ var unresolved = {
27832
+ get exports(){ return unresolvedExports; },
27833
+ set exports(v){ unresolvedExports = v; },
27834
+ };
27835
+
27836
+ /**
27837
+ * CLDR JavaScript Library v0.5.4
27838
+ * http://jquery.com/
27839
+ *
27840
+ * Copyright 2013 Rafael Xavier de Souza
27841
+ * Released under the MIT license
27842
+ * http://jquery.org/license
27843
+ *
27844
+ * Date: 2020-10-22T15:56Z
27330
27845
  */
27331
- (function (factory) {
27332
- {
27333
- // Node. CommonJS.
27334
- module.exports = factory(cldr.exports);
27335
- }
27336
- })(function (Cldr) {
27337
- // Build optimization hack to avoid duplicating functions across modules.
27338
- var pathNormalize = Cldr._pathNormalize,
27339
- validatePresence = Cldr._validatePresence,
27340
- validateType = Cldr._validateType;
27341
- /*!
27342
- * EventEmitter v4.2.7 - git.io/ee
27343
- * Oliver Caldwell
27344
- * MIT license
27345
- * @preserve
27346
- */
27347
27846
 
27348
- var EventEmitter;
27349
- /* jshint ignore:start */
27847
+ (function (module) {
27848
+ /*!
27849
+ * CLDR JavaScript Library v0.5.4 2020-10-22T15:56Z MIT license © Rafael Xavier
27850
+ * http://git.io/h4lmVg
27851
+ */
27852
+ (function (factory) {
27853
+ {
27854
+ // Node. CommonJS.
27855
+ module.exports = factory(cldrExports);
27856
+ }
27857
+ })(function (Cldr) {
27858
+ // Build optimization hack to avoid duplicating functions across modules.
27859
+ var coreLoad = Cldr._coreLoad;
27860
+ var jsonMerge = Cldr._jsonMerge;
27861
+ var pathNormalize = Cldr._pathNormalize;
27862
+ var resourceGet = Cldr._resourceGet;
27863
+ var validatePresence = Cldr._validatePresence;
27864
+ var validateTypePath = Cldr._validateTypePath;
27865
+ var bundleParentLookup = function (Cldr, locale) {
27866
+ var normalizedPath, parent;
27867
+ if (locale === "root") {
27868
+ return;
27869
+ }
27870
+
27871
+ // First, try to find parent on supplemental data.
27872
+ normalizedPath = pathNormalize(["supplemental/parentLocales/parentLocale", locale]);
27873
+ parent = resourceGet(Cldr._resolved, normalizedPath) || resourceGet(Cldr._raw, normalizedPath);
27874
+ if (parent) {
27875
+ return parent;
27876
+ }
27877
+
27878
+ // Or truncate locale.
27879
+ parent = locale.substr(0, locale.lastIndexOf(Cldr.localeSep));
27880
+ if (!parent) {
27881
+ return "root";
27882
+ }
27883
+ return parent;
27884
+ };
27885
+
27886
+ // @path: normalized path
27887
+ var resourceSet = function (data, path, value) {
27888
+ var i,
27889
+ node = data,
27890
+ length = path.length;
27891
+ for (i = 0; i < length - 1; i++) {
27892
+ if (!node[path[i]]) {
27893
+ node[path[i]] = {};
27894
+ }
27895
+ node = node[path[i]];
27896
+ }
27897
+ node[path[i]] = value;
27898
+ };
27899
+ var itemLookup = function () {
27900
+ var lookup;
27901
+ lookup = function (Cldr, locale, path, attributes, childLocale) {
27902
+ var normalizedPath, parent, value;
27903
+
27904
+ // 1: Finish recursion
27905
+ // 2: Avoid infinite loop
27906
+ if (typeof locale === "undefined" /* 1 */ || locale === childLocale /* 2 */) {
27907
+ return;
27908
+ }
27909
+
27910
+ // Resolve path
27911
+ normalizedPath = pathNormalize(path, attributes);
27912
+
27913
+ // Check resolved (cached) data first
27914
+ // 1: Due to #16, never use the cached resolved non-leaf nodes. It may not
27915
+ // represent its leafs in its entirety.
27916
+ value = resourceGet(Cldr._resolved, normalizedPath);
27917
+ if (value !== undefined && typeof value !== "object" /* 1 */) {
27918
+ return value;
27919
+ }
27920
+
27921
+ // Check raw data
27922
+ value = resourceGet(Cldr._raw, normalizedPath);
27923
+ if (value === undefined) {
27924
+ // Or, lookup at parent locale
27925
+ parent = bundleParentLookup(Cldr, locale);
27926
+ value = lookup(Cldr, parent, path, jsonMerge(attributes, {
27927
+ bundle: parent
27928
+ }), locale);
27929
+ }
27930
+ if (value !== undefined) {
27931
+ // Set resolved (cached)
27932
+ resourceSet(Cldr._resolved, normalizedPath, value);
27933
+ }
27934
+ return value;
27935
+ };
27936
+ return lookup;
27937
+ }();
27938
+ Cldr._raw = {};
27939
+
27940
+ /**
27941
+ * Cldr.load( json [, json, ...] )
27942
+ *
27943
+ * @json [JSON] CLDR data or [Array] Array of @json's.
27944
+ *
27945
+ * Load resolved or unresolved cldr data.
27946
+ * Overwrite Cldr.load().
27947
+ */
27948
+ Cldr.load = function () {
27949
+ Cldr._raw = coreLoad(Cldr, Cldr._raw, arguments);
27950
+ };
27951
+
27952
+ /**
27953
+ * Overwrite Cldr.prototype.get().
27954
+ */
27955
+ Cldr.prototype.get = function (path) {
27956
+ validatePresence(path, "path");
27957
+ validateTypePath(path, "path");
27958
+
27959
+ // 1: use bundle as locale on item lookup for simplification purposes, because no other extended subtag is used anyway on bundle parent lookup.
27960
+ // 2: during init(), this method is called, but bundle is yet not defined. Use "" as a workaround in this very specific scenario.
27961
+ return itemLookup(Cldr, this.attributes && this.attributes.bundle /* 1 */ || "" /* 2 */, path, this.attributes);
27962
+ };
27963
+
27964
+ // In case cldr/unresolved is loaded after cldr/event, we trigger its overloads again. Because, .get is overwritten in here.
27965
+ if (Cldr._eventInit) {
27966
+ Cldr._eventInit();
27967
+ }
27968
+ return Cldr;
27969
+ });
27970
+ } (unresolved));
27350
27971
 
27351
- EventEmitter = function () {
27352
- /**
27353
- * Class for managing events.
27354
- * Can be extended to provide event functionality in other classes.
27355
- *
27356
- * @class EventEmitter Manages event registering and emitting.
27357
- */
27358
- function EventEmitter() {} // Shortcuts to improve speed and size
27972
+ /**
27973
+ * CLDR JavaScript Library v0.5.4
27974
+ * http://jquery.com/
27975
+ *
27976
+ * Copyright 2013 Rafael Xavier de Souza
27977
+ * Released under the MIT license
27978
+ * http://jquery.org/license
27979
+ *
27980
+ * Date: 2020-10-22T15:56Z
27981
+ */
27359
27982
 
27983
+ (function (module) {
27984
+ /*!
27985
+ * CLDR JavaScript Library v0.5.4 2020-10-22T15:56Z MIT license © Rafael Xavier
27986
+ * http://git.io/h4lmVg
27987
+ */
27360
27988
 
27361
- var proto = EventEmitter.prototype;
27362
- /**
27363
- * Finds the index of the listener for the event in it's storage array.
27364
- *
27365
- * @param {Function[]} listeners Array of listeners to search through.
27366
- * @param {Function} listener Method to look for.
27367
- * @return {Number} Index of the specified listener, -1 if not found
27368
- * @api private
27369
- */
27989
+ // Cldr
27990
+ module.exports = cldrExports;
27370
27991
 
27371
- function indexOfListener(listeners, listener) {
27372
- var i = listeners.length;
27992
+ // Extent Cldr with the following modules
27993
+ } (node_main));
27373
27994
 
27374
- while (i--) {
27375
- if (listeners[i].listener === listener) {
27376
- return i;
27377
- }
27378
- }
27379
-
27380
- return -1;
27381
- }
27382
- /**
27383
- * Alias a method while keeping the context correct, to allow for overwriting of target method.
27384
- *
27385
- * @param {String} name The name of the target method.
27386
- * @return {Function} The aliased method
27387
- * @api private
27388
- */
27389
-
27390
-
27391
- function alias(name) {
27392
- return function aliasClosure() {
27393
- return this[name].apply(this, arguments);
27394
- };
27395
- }
27396
- /**
27397
- * Returns the listener array for the specified event.
27398
- * Will initialise the event object and listener arrays if required.
27399
- * 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.
27400
- * Each property in the object response is an array of listener functions.
27401
- *
27402
- * @param {String|RegExp} evt Name of the event to return the listeners from.
27403
- * @return {Function[]|Object} All listener functions for the event.
27404
- */
27405
-
27406
-
27407
- proto.getListeners = function getListeners(evt) {
27408
- var events = this._getEvents();
27409
-
27410
- var response;
27411
- var key; // Return a concatenated array of all matching events if
27412
- // the selector is a regular expression.
27413
-
27414
- if (evt instanceof RegExp) {
27415
- response = {};
27416
-
27417
- for (key in events) {
27418
- if (events.hasOwnProperty(key) && evt.test(key)) {
27419
- response[key] = events[key];
27420
- }
27421
- }
27422
- } else {
27423
- response = events[evt] || (events[evt] = []);
27424
- }
27425
-
27426
- return response;
27427
- };
27428
- /**
27429
- * Takes a list of listener objects and flattens it into a list of listener functions.
27430
- *
27431
- * @param {Object[]} listeners Raw listener objects.
27432
- * @return {Function[]} Just the listener functions.
27433
- */
27434
-
27435
-
27436
- proto.flattenListeners = function flattenListeners(listeners) {
27437
- var flatListeners = [];
27438
- var i;
27439
-
27440
- for (i = 0; i < listeners.length; i += 1) {
27441
- flatListeners.push(listeners[i].listener);
27442
- }
27443
-
27444
- return flatListeners;
27445
- };
27446
- /**
27447
- * 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.
27448
- *
27449
- * @param {String|RegExp} evt Name of the event to return the listeners from.
27450
- * @return {Object} All listener functions for an event in an object.
27451
- */
27452
-
27453
-
27454
- proto.getListenersAsObject = function getListenersAsObject(evt) {
27455
- var listeners = this.getListeners(evt);
27456
- var response;
27457
-
27458
- if (listeners instanceof Array) {
27459
- response = {};
27460
- response[evt] = listeners;
27461
- }
27462
-
27463
- return response || listeners;
27464
- };
27465
- /**
27466
- * Adds a listener function to the specified event.
27467
- * The listener will not be added if it is a duplicate.
27468
- * If the listener returns true then it will be removed after it is called.
27469
- * If you pass a regular expression as the event name then the listener will be added to all events that match it.
27470
- *
27471
- * @param {String|RegExp} evt Name of the event to attach the listener to.
27472
- * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.
27473
- * @return {Object} Current instance of EventEmitter for chaining.
27474
- */
27475
-
27476
-
27477
- proto.addListener = function addListener(evt, listener) {
27478
- var listeners = this.getListenersAsObject(evt);
27479
- var listenerIsWrapped = typeof listener === 'object';
27480
- var key;
27481
-
27482
- for (key in listeners) {
27483
- if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) {
27484
- listeners[key].push(listenerIsWrapped ? listener : {
27485
- listener: listener,
27486
- once: false
27487
- });
27488
- }
27489
- }
27490
-
27491
- return this;
27492
- };
27493
- /**
27494
- * Alias of addListener
27495
- */
27496
-
27497
-
27498
- proto.on = alias('addListener');
27499
- /**
27500
- * Semi-alias of addListener. It will add a listener that will be
27501
- * automatically removed after it's first execution.
27502
- *
27503
- * @param {String|RegExp} evt Name of the event to attach the listener to.
27504
- * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.
27505
- * @return {Object} Current instance of EventEmitter for chaining.
27506
- */
27507
-
27508
- proto.addOnceListener = function addOnceListener(evt, listener) {
27509
- return this.addListener(evt, {
27510
- listener: listener,
27511
- once: true
27512
- });
27513
- };
27514
- /**
27515
- * Alias of addOnceListener.
27516
- */
27517
-
27518
-
27519
- proto.once = alias('addOnceListener');
27520
- /**
27521
- * 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.
27522
- * You need to tell it what event names should be matched by a regex.
27523
- *
27524
- * @param {String} evt Name of the event to create.
27525
- * @return {Object} Current instance of EventEmitter for chaining.
27526
- */
27527
-
27528
- proto.defineEvent = function defineEvent(evt) {
27529
- this.getListeners(evt);
27530
- return this;
27531
- };
27532
- /**
27533
- * Uses defineEvent to define multiple events.
27534
- *
27535
- * @param {String[]} evts An array of event names to define.
27536
- * @return {Object} Current instance of EventEmitter for chaining.
27537
- */
27538
-
27539
-
27540
- proto.defineEvents = function defineEvents(evts) {
27541
- for (var i = 0; i < evts.length; i += 1) {
27542
- this.defineEvent(evts[i]);
27543
- }
27544
-
27545
- return this;
27546
- };
27547
- /**
27548
- * Removes a listener function from the specified event.
27549
- * When passed a regular expression as the event name, it will remove the listener from all events that match it.
27550
- *
27551
- * @param {String|RegExp} evt Name of the event to remove the listener from.
27552
- * @param {Function} listener Method to remove from the event.
27553
- * @return {Object} Current instance of EventEmitter for chaining.
27554
- */
27555
-
27556
-
27557
- proto.removeListener = function removeListener(evt, listener) {
27558
- var listeners = this.getListenersAsObject(evt);
27559
- var index;
27560
- var key;
27561
-
27562
- for (key in listeners) {
27563
- if (listeners.hasOwnProperty(key)) {
27564
- index = indexOfListener(listeners[key], listener);
27565
-
27566
- if (index !== -1) {
27567
- listeners[key].splice(index, 1);
27568
- }
27569
- }
27570
- }
27571
-
27572
- return this;
27573
- };
27574
- /**
27575
- * Alias of removeListener
27576
- */
27577
-
27578
-
27579
- proto.off = alias('removeListener');
27580
- /**
27581
- * Adds listeners in bulk using the manipulateListeners method.
27582
- * 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.
27583
- * You can also pass it a regular expression to add the array of listeners to all events that match it.
27584
- * Yeah, this function does quite a bit. That's probably a bad thing.
27585
- *
27586
- * @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.
27587
- * @param {Function[]} [listeners] An optional array of listener functions to add.
27588
- * @return {Object} Current instance of EventEmitter for chaining.
27589
- */
27590
-
27591
- proto.addListeners = function addListeners(evt, listeners) {
27592
- // Pass through to manipulateListeners
27593
- return this.manipulateListeners(false, evt, listeners);
27594
- };
27595
- /**
27596
- * Removes listeners in bulk using the manipulateListeners method.
27597
- * 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.
27598
- * You can also pass it an event name and an array of listeners to be removed.
27599
- * You can also pass it a regular expression to remove the listeners from all events that match it.
27600
- *
27601
- * @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.
27602
- * @param {Function[]} [listeners] An optional array of listener functions to remove.
27603
- * @return {Object} Current instance of EventEmitter for chaining.
27604
- */
27605
-
27606
-
27607
- proto.removeListeners = function removeListeners(evt, listeners) {
27608
- // Pass through to manipulateListeners
27609
- return this.manipulateListeners(true, evt, listeners);
27610
- };
27611
- /**
27612
- * 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.
27613
- * The first argument will determine if the listeners are removed (true) or added (false).
27614
- * 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.
27615
- * You can also pass it an event name and an array of listeners to be added/removed.
27616
- * You can also pass it a regular expression to manipulate the listeners of all events that match it.
27617
- *
27618
- * @param {Boolean} remove True if you want to remove listeners, false if you want to add.
27619
- * @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.
27620
- * @param {Function[]} [listeners] An optional array of listener functions to add/remove.
27621
- * @return {Object} Current instance of EventEmitter for chaining.
27622
- */
27623
-
27624
-
27625
- proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) {
27626
- var i;
27627
- var value;
27628
- var single = remove ? this.removeListener : this.addListener;
27629
- var multiple = remove ? this.removeListeners : this.addListeners; // If evt is an object then pass each of it's properties to this method
27630
-
27631
- if (typeof evt === 'object' && !(evt instanceof RegExp)) {
27632
- for (i in evt) {
27633
- if (evt.hasOwnProperty(i) && (value = evt[i])) {
27634
- // Pass the single listener straight through to the singular method
27635
- if (typeof value === 'function') {
27636
- single.call(this, i, value);
27637
- } else {
27638
- // Otherwise pass back to the multiple function
27639
- multiple.call(this, i, value);
27640
- }
27641
- }
27642
- }
27643
- } else {
27644
- // So evt must be a string
27645
- // And listeners must be an array of listeners
27646
- // Loop over it and pass each one to the multiple method
27647
- i = listeners.length;
27648
-
27649
- while (i--) {
27650
- single.call(this, evt, listeners[i]);
27651
- }
27652
- }
27653
-
27654
- return this;
27655
- };
27656
- /**
27657
- * Removes all listeners from a specified event.
27658
- * If you do not specify an event then all listeners will be removed.
27659
- * That means every event will be emptied.
27660
- * You can also pass a regex to remove all events that match it.
27661
- *
27662
- * @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed.
27663
- * @return {Object} Current instance of EventEmitter for chaining.
27664
- */
27665
-
27666
-
27667
- proto.removeEvent = function removeEvent(evt) {
27668
- var type = typeof evt;
27669
-
27670
- var events = this._getEvents();
27671
-
27672
- var key; // Remove different things depending on the state of evt
27673
-
27674
- if (type === 'string') {
27675
- // Remove all listeners for the specified event
27676
- delete events[evt];
27677
- } else if (evt instanceof RegExp) {
27678
- // Remove all events matching the regex.
27679
- for (key in events) {
27680
- if (events.hasOwnProperty(key) && evt.test(key)) {
27681
- delete events[key];
27682
- }
27683
- }
27684
- } else {
27685
- // Remove all listeners in all events
27686
- delete this._events;
27687
- }
27688
-
27689
- return this;
27690
- };
27691
- /**
27692
- * Alias of removeEvent.
27693
- *
27694
- * Added to mirror the node API.
27695
- */
27696
-
27697
-
27698
- proto.removeAllListeners = alias('removeEvent');
27699
- /**
27700
- * Emits an event of your choice.
27701
- * When emitted, every listener attached to that event will be executed.
27702
- * If you pass the optional argument array then those arguments will be passed to every listener upon execution.
27703
- * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately.
27704
- * So they will not arrive within the array on the other side, they will be separate.
27705
- * You can also pass a regular expression to emit to all events that match it.
27706
- *
27707
- * @param {String|RegExp} evt Name of the event to emit and execute listeners for.
27708
- * @param {Array} [args] Optional array of arguments to be passed to each listener.
27709
- * @return {Object} Current instance of EventEmitter for chaining.
27710
- */
27711
-
27712
- proto.emitEvent = function emitEvent(evt, args) {
27713
- var listeners = this.getListenersAsObject(evt);
27714
- var listener;
27715
- var i;
27716
- var key;
27717
- var response;
27718
-
27719
- for (key in listeners) {
27720
- if (listeners.hasOwnProperty(key)) {
27721
- i = listeners[key].length;
27722
-
27723
- while (i--) {
27724
- // If the listener returns true then it shall be removed from the event
27725
- // The function is executed either with a basic call or an apply if there is an args array
27726
- listener = listeners[key][i];
27727
-
27728
- if (listener.once === true) {
27729
- this.removeListener(evt, listener.listener);
27730
- }
27731
-
27732
- response = listener.listener.apply(this, args || []);
27733
-
27734
- if (response === this._getOnceReturnValue()) {
27735
- this.removeListener(evt, listener.listener);
27736
- }
27737
- }
27738
- }
27739
- }
27740
-
27741
- return this;
27742
- };
27743
- /**
27744
- * Alias of emitEvent
27745
- */
27746
-
27747
-
27748
- proto.trigger = alias('emitEvent');
27749
- /**
27750
- * 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.
27751
- * As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it.
27752
- *
27753
- * @param {String|RegExp} evt Name of the event to emit and execute listeners for.
27754
- * @param {...*} Optional additional arguments to be passed to each listener.
27755
- * @return {Object} Current instance of EventEmitter for chaining.
27756
- */
27757
-
27758
- proto.emit = function emit(evt) {
27759
- var args = Array.prototype.slice.call(arguments, 1);
27760
- return this.emitEvent(evt, args);
27761
- };
27762
- /**
27763
- * Sets the current value to check against when executing listeners. If a
27764
- * listeners return value matches the one set here then it will be removed
27765
- * after execution. This value defaults to true.
27766
- *
27767
- * @param {*} value The new value to check for when executing listeners.
27768
- * @return {Object} Current instance of EventEmitter for chaining.
27769
- */
27770
-
27771
-
27772
- proto.setOnceReturnValue = function setOnceReturnValue(value) {
27773
- this._onceReturnValue = value;
27774
- return this;
27775
- };
27776
- /**
27777
- * Fetches the current value to check against when executing listeners. If
27778
- * the listeners return value matches this one then it should be removed
27779
- * automatically. It will return true by default.
27780
- *
27781
- * @return {*|Boolean} The current value to check for or the default, true.
27782
- * @api private
27783
- */
27784
-
27785
-
27786
- proto._getOnceReturnValue = function _getOnceReturnValue() {
27787
- if (this.hasOwnProperty('_onceReturnValue')) {
27788
- return this._onceReturnValue;
27789
- } else {
27790
- return true;
27791
- }
27792
- };
27793
- /**
27794
- * Fetches the events object and creates one if required.
27795
- *
27796
- * @return {Object} The events storage object.
27797
- * @api private
27798
- */
27799
-
27800
-
27801
- proto._getEvents = function _getEvents() {
27802
- return this._events || (this._events = {});
27803
- };
27804
- /**
27805
- * Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version.
27806
- *
27807
- * @return {Function} Non conflicting EventEmitter class.
27808
- */
27809
-
27810
-
27811
- EventEmitter.noConflict = function noConflict() {
27812
- originalGlobalValue;
27813
- return EventEmitter;
27814
- };
27815
-
27816
- return EventEmitter;
27817
- }();
27818
- /* jshint ignore:end */
27819
-
27820
-
27821
- var validateTypeFunction = function (value, name) {
27822
- validateType(value, name, typeof value === "undefined" || typeof value === "function", "Function");
27823
- };
27824
-
27825
- var superGet,
27826
- superInit,
27827
- globalEe = new EventEmitter();
27828
-
27829
- function validateTypeEvent(value, name) {
27830
- validateType(value, name, typeof value === "string" || value instanceof RegExp, "String or RegExp");
27831
- }
27832
-
27833
- function validateThenCall(method, self) {
27834
- return function (event, listener) {
27835
- validatePresence(event, "event");
27836
- validateTypeEvent(event, "event");
27837
- validatePresence(listener, "listener");
27838
- validateTypeFunction(listener, "listener");
27839
- return self[method].apply(self, arguments);
27840
- };
27841
- }
27842
-
27843
- function off(self) {
27844
- return validateThenCall("off", self);
27845
- }
27846
-
27847
- function on(self) {
27848
- return validateThenCall("on", self);
27849
- }
27850
-
27851
- function once(self) {
27852
- return validateThenCall("once", self);
27853
- }
27854
-
27855
- Cldr.off = off(globalEe);
27856
- Cldr.on = on(globalEe);
27857
- Cldr.once = once(globalEe);
27858
- /**
27859
- * Overload Cldr.prototype.init().
27860
- */
27861
-
27862
- superInit = Cldr.prototype.init;
27863
-
27864
- Cldr.prototype.init = function () {
27865
- var ee;
27866
- this.ee = ee = new EventEmitter();
27867
- this.off = off(ee);
27868
- this.on = on(ee);
27869
- this.once = once(ee);
27870
- superInit.apply(this, arguments);
27871
- };
27872
- /**
27873
- * getOverload is encapsulated, because of cldr/unresolved. If it's loaded
27874
- * after cldr/event (and note it overwrites .get), it can trigger this
27875
- * overload again.
27876
- */
27877
-
27878
-
27879
- function getOverload() {
27880
- /**
27881
- * Overload Cldr.prototype.get().
27882
- */
27883
- superGet = Cldr.prototype.get;
27884
-
27885
- Cldr.prototype.get = function (path) {
27886
- var value = superGet.apply(this, arguments);
27887
- path = pathNormalize(path, this.attributes).join("/");
27888
- globalEe.trigger("get", [path, value]);
27889
- this.ee.trigger("get", [path, value]);
27890
- return value;
27891
- };
27892
- }
27893
-
27894
- Cldr._eventInit = getOverload;
27895
- getOverload();
27896
- return Cldr;
27897
- });
27898
- }(event));
27899
-
27900
- var supplemental = {exports: {}};
27901
-
27902
- /**
27903
- * CLDR JavaScript Library v0.5.4
27904
- * http://jquery.com/
27905
- *
27906
- * Copyright 2013 Rafael Xavier de Souza
27907
- * Released under the MIT license
27908
- * http://jquery.org/license
27909
- *
27910
- * Date: 2020-10-22T15:56Z
27911
- */
27912
-
27913
- (function (module) {
27914
- /*!
27915
- * CLDR JavaScript Library v0.5.4 2020-10-22T15:56Z MIT license © Rafael Xavier
27916
- * http://git.io/h4lmVg
27917
- */
27918
- (function (factory) {
27919
- {
27920
- // Node. CommonJS.
27921
- module.exports = factory(cldr.exports);
27922
- }
27923
- })(function (Cldr) {
27924
- // Build optimization hack to avoid duplicating functions across modules.
27925
- var alwaysArray = Cldr._alwaysArray;
27926
-
27927
- var supplementalMain = function (cldr) {
27928
- var prepend, supplemental;
27929
-
27930
- prepend = function (prepend) {
27931
- return function (path) {
27932
- path = alwaysArray(path);
27933
- return cldr.get([prepend].concat(path));
27934
- };
27935
- };
27936
-
27937
- supplemental = prepend("supplemental"); // Week Data
27938
- // http://www.unicode.org/reports/tr35/tr35-dates.html#Week_Data
27939
-
27940
- supplemental.weekData = prepend("supplemental/weekData");
27941
-
27942
- supplemental.weekData.firstDay = function () {
27943
- return cldr.get("supplemental/weekData/firstDay/{territory}") || cldr.get("supplemental/weekData/firstDay/001");
27944
- };
27945
-
27946
- supplemental.weekData.minDays = function () {
27947
- var minDays = cldr.get("supplemental/weekData/minDays/{territory}") || cldr.get("supplemental/weekData/minDays/001");
27948
- return parseInt(minDays, 10);
27949
- }; // Time Data
27950
- // http://www.unicode.org/reports/tr35/tr35-dates.html#Time_Data
27951
-
27952
-
27953
- supplemental.timeData = prepend("supplemental/timeData");
27954
-
27955
- supplemental.timeData.allowed = function () {
27956
- return cldr.get("supplemental/timeData/{territory}/_allowed") || cldr.get("supplemental/timeData/001/_allowed");
27957
- };
27958
-
27959
- supplemental.timeData.preferred = function () {
27960
- return cldr.get("supplemental/timeData/{territory}/_preferred") || cldr.get("supplemental/timeData/001/_preferred");
27961
- };
27962
-
27963
- return supplemental;
27964
- };
27965
-
27966
- var initSuper = Cldr.prototype.init;
27967
- /**
27968
- * .init() automatically ran on construction.
27969
- *
27970
- * Overload .init().
27971
- */
27972
-
27973
- Cldr.prototype.init = function () {
27974
- initSuper.apply(this, arguments);
27975
- this.supplemental = supplementalMain(this);
27976
- };
27977
-
27978
- return Cldr;
27979
- });
27980
- }(supplemental));
27981
-
27982
- var unresolved = {exports: {}};
27983
-
27984
- /**
27985
- * CLDR JavaScript Library v0.5.4
27986
- * http://jquery.com/
27987
- *
27988
- * Copyright 2013 Rafael Xavier de Souza
27989
- * Released under the MIT license
27990
- * http://jquery.org/license
27991
- *
27992
- * Date: 2020-10-22T15:56Z
27993
- */
27994
-
27995
- (function (module) {
27996
- /*!
27997
- * CLDR JavaScript Library v0.5.4 2020-10-22T15:56Z MIT license © Rafael Xavier
27998
- * http://git.io/h4lmVg
27999
- */
28000
- (function (factory) {
28001
- {
28002
- // Node. CommonJS.
28003
- module.exports = factory(cldr.exports);
28004
- }
28005
- })(function (Cldr) {
28006
- // Build optimization hack to avoid duplicating functions across modules.
28007
- var coreLoad = Cldr._coreLoad;
28008
- var jsonMerge = Cldr._jsonMerge;
28009
- var pathNormalize = Cldr._pathNormalize;
28010
- var resourceGet = Cldr._resourceGet;
28011
- var validatePresence = Cldr._validatePresence;
28012
- var validateTypePath = Cldr._validateTypePath;
28013
-
28014
- var bundleParentLookup = function (Cldr, locale) {
28015
- var normalizedPath, parent;
28016
-
28017
- if (locale === "root") {
28018
- return;
28019
- } // First, try to find parent on supplemental data.
28020
-
28021
-
28022
- normalizedPath = pathNormalize(["supplemental/parentLocales/parentLocale", locale]);
28023
- parent = resourceGet(Cldr._resolved, normalizedPath) || resourceGet(Cldr._raw, normalizedPath);
28024
-
28025
- if (parent) {
28026
- return parent;
28027
- } // Or truncate locale.
28028
-
28029
-
28030
- parent = locale.substr(0, locale.lastIndexOf(Cldr.localeSep));
28031
-
28032
- if (!parent) {
28033
- return "root";
28034
- }
28035
-
28036
- return parent;
28037
- }; // @path: normalized path
28038
-
28039
-
28040
- var resourceSet = function (data, path, value) {
28041
- var i,
28042
- node = data,
28043
- length = path.length;
28044
-
28045
- for (i = 0; i < length - 1; i++) {
28046
- if (!node[path[i]]) {
28047
- node[path[i]] = {};
28048
- }
28049
-
28050
- node = node[path[i]];
28051
- }
28052
-
28053
- node[path[i]] = value;
28054
- };
28055
-
28056
- var itemLookup = function () {
28057
- var lookup;
28058
-
28059
- lookup = function (Cldr, locale, path, attributes, childLocale) {
28060
- var normalizedPath, parent, value; // 1: Finish recursion
28061
- // 2: Avoid infinite loop
28062
-
28063
- if (typeof locale === "undefined"
28064
- /* 1 */
28065
- || locale === childLocale
28066
- /* 2 */
28067
- ) {
28068
- return;
28069
- } // Resolve path
28070
-
28071
-
28072
- normalizedPath = pathNormalize(path, attributes); // Check resolved (cached) data first
28073
- // 1: Due to #16, never use the cached resolved non-leaf nodes. It may not
28074
- // represent its leafs in its entirety.
28075
-
28076
- value = resourceGet(Cldr._resolved, normalizedPath);
28077
-
28078
- if (value !== undefined && typeof value !== "object"
28079
- /* 1 */
28080
- ) {
28081
- return value;
28082
- } // Check raw data
28083
-
28084
-
28085
- value = resourceGet(Cldr._raw, normalizedPath);
28086
-
28087
- if (value === undefined) {
28088
- // Or, lookup at parent locale
28089
- parent = bundleParentLookup(Cldr, locale);
28090
- value = lookup(Cldr, parent, path, jsonMerge(attributes, {
28091
- bundle: parent
28092
- }), locale);
28093
- }
28094
-
28095
- if (value !== undefined) {
28096
- // Set resolved (cached)
28097
- resourceSet(Cldr._resolved, normalizedPath, value);
28098
- }
28099
-
28100
- return value;
28101
- };
28102
-
28103
- return lookup;
28104
- }();
28105
-
28106
- Cldr._raw = {};
28107
- /**
28108
- * Cldr.load( json [, json, ...] )
28109
- *
28110
- * @json [JSON] CLDR data or [Array] Array of @json's.
28111
- *
28112
- * Load resolved or unresolved cldr data.
28113
- * Overwrite Cldr.load().
28114
- */
28115
-
28116
- Cldr.load = function () {
28117
- Cldr._raw = coreLoad(Cldr, Cldr._raw, arguments);
28118
- };
28119
- /**
28120
- * Overwrite Cldr.prototype.get().
28121
- */
28122
-
28123
-
28124
- Cldr.prototype.get = function (path) {
28125
- validatePresence(path, "path");
28126
- 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.
28127
- // 2: during init(), this method is called, but bundle is yet not defined. Use "" as a workaround in this very specific scenario.
28128
-
28129
- return itemLookup(Cldr, this.attributes && this.attributes.bundle
28130
- /* 1 */
28131
- || ""
28132
- /* 2 */
28133
- , path, this.attributes);
28134
- }; // In case cldr/unresolved is loaded after cldr/event, we trigger its overloads again. Because, .get is overwritten in here.
28135
-
28136
-
28137
- if (Cldr._eventInit) {
28138
- Cldr._eventInit();
28139
- }
28140
-
28141
- return Cldr;
28142
- });
28143
- }(unresolved));
28144
-
28145
- /**
28146
- * CLDR JavaScript Library v0.5.4
28147
- * http://jquery.com/
28148
- *
28149
- * Copyright 2013 Rafael Xavier de Souza
28150
- * Released under the MIT license
28151
- * http://jquery.org/license
28152
- *
28153
- * Date: 2020-10-22T15:56Z
28154
- */
28155
-
28156
- /*!
28157
- * CLDR JavaScript Library v0.5.4 2020-10-22T15:56Z MIT license © Rafael Xavier
28158
- * http://git.io/h4lmVg
28159
- */
28160
- // Cldr
28161
- var node_main = cldr.exports; // Extent Cldr with the following modules
27995
+ var Cldr = /*@__PURE__*/getDefaultExportFromCjs(node_mainExports);
28162
27996
 
28163
27997
  /*
28164
27998
  * @copyright (c) 2020, Philipp Thuerwaechter & Pattrick Hueper
@@ -28167,16 +28001,15 @@ var node_main = cldr.exports; // Extent Cldr with the following modules
28167
28001
  var cldrDataLoaded = new Set();
28168
28002
  var loadCldrData = function loadCldrData(path) {
28169
28003
  if (!cldrDataLoaded.has(path)) {
28170
- node_main.load(cldrData(path));
28004
+ Cldr.load(cldrData(path));
28171
28005
  cldrDataLoaded.add(path);
28172
28006
  }
28173
28007
  };
28174
28008
  var localeToCldrInstanceCache = {};
28175
28009
  var getOrCreateCldrInstance = function getOrCreateCldrInstance(locale) {
28176
28010
  if (localeToCldrInstanceCache[locale] == null) {
28177
- localeToCldrInstanceCache[locale] = new node_main(locale);
28011
+ localeToCldrInstanceCache[locale] = new Cldr(locale);
28178
28012
  }
28179
-
28180
28013
  return localeToCldrInstanceCache[locale];
28181
28014
  };
28182
28015
  var localeToMapZonesCache = {};
@@ -28188,13 +28021,11 @@ var getOrCreateMapZones = function getOrCreateMapZones(cldr) {
28188
28021
  if (!mapZones[metaZone.mapZone._other]) {
28189
28022
  mapZones[metaZone.mapZone._other] = {};
28190
28023
  }
28191
-
28192
28024
  mapZones[metaZone.mapZone._other][metaZone.mapZone._territory] = metaZone.mapZone._type;
28193
28025
  }
28194
28026
  });
28195
28027
  localeToMapZonesCache[cldr.locale] = mapZones;
28196
28028
  }
28197
-
28198
28029
  return localeToMapZonesCache[cldr.locale];
28199
28030
  };
28200
28031
 
@@ -28202,55 +28033,41 @@ var getOrCreateMapZones = function getOrCreateMapZones(cldr) {
28202
28033
  * @copyright (c) 2017, Philipp Thuerwaechter & Pattrick Hueper
28203
28034
  * @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
28204
28035
  */
28205
-
28206
28036
  var CldrDateTimeTextProvider = function () {
28207
28037
  function CldrDateTimeTextProvider() {
28208
28038
  this._cache = {};
28209
28039
  loadCldrData('supplemental/likelySubtags.json');
28210
28040
  }
28211
-
28212
28041
  var _proto = CldrDateTimeTextProvider.prototype;
28213
-
28214
28042
  _proto.getAvailableLocales = function getAvailableLocales() {
28215
28043
  return cldrData('availableLocales.json').availableLocales;
28216
28044
  };
28217
-
28218
28045
  _proto.getText = function getText(field, value, style, locale) {
28219
28046
  var store = this._findStore(field, locale);
28220
-
28221
28047
  if (store instanceof LocaleStore) {
28222
28048
  return store.getText(value, style);
28223
28049
  }
28224
-
28225
28050
  return null;
28226
28051
  };
28227
-
28228
28052
  _proto.getTextIterator = function getTextIterator(field, style, locale) {
28229
28053
  var store = this._findStore(field, locale);
28230
-
28231
28054
  if (store instanceof LocaleStore) {
28232
28055
  return store.getTextIterator(style);
28233
28056
  }
28234
-
28235
28057
  return null;
28236
28058
  };
28237
-
28238
28059
  _proto._findStore = function _findStore(field, locale) {
28239
28060
  var key = createEntry(field, locale);
28240
28061
  var store = this._cache[key];
28241
-
28242
28062
  if (store === undefined) {
28243
28063
  store = this._createStore(field, locale);
28244
28064
  this._cache[key] = store;
28245
28065
  }
28246
-
28247
28066
  return store;
28248
28067
  };
28249
-
28250
28068
  _proto._createStore = function _createStore(field, locale) {
28251
28069
  loadCldrData("main/" + locale.localeString() + "/ca-gregorian.json");
28252
28070
  var cldr = getOrCreateCldrInstance(locale.localeString());
28253
-
28254
28071
  if (field === ChronoField.MONTH_OF_YEAR) {
28255
28072
  var monthsData = cldr.main('dates/calendars/gregorian/months/format');
28256
28073
  var styleMap = {};
@@ -28298,7 +28115,6 @@ var CldrDateTimeTextProvider = function () {
28298
28115
  styleMap[TextStyle.SHORT] = data;
28299
28116
  return this._createLocaleStore(styleMap);
28300
28117
  }
28301
-
28302
28118
  if (field === ChronoField.DAY_OF_WEEK) {
28303
28119
  var daysData = cldr.main('dates/calendars/gregorian/days/format');
28304
28120
  var _styleMap = {};
@@ -28331,7 +28147,6 @@ var CldrDateTimeTextProvider = function () {
28331
28147
  _styleMap[TextStyle.SHORT] = _data;
28332
28148
  return this._createLocaleStore(_styleMap);
28333
28149
  }
28334
-
28335
28150
  if (field === ChronoField.AMPM_OF_DAY) {
28336
28151
  var dayPeriodsData = cldr.main('dates/calendars/gregorian/dayPeriods/format');
28337
28152
  var _styleMap2 = {};
@@ -28349,7 +28164,6 @@ var CldrDateTimeTextProvider = function () {
28349
28164
  _styleMap2[TextStyle.SHORT] = _data2;
28350
28165
  return this._createLocaleStore(_styleMap2);
28351
28166
  }
28352
-
28353
28167
  if (field === ChronoField.ERA) {
28354
28168
  var erasData = cldr.main('dates/calendars/gregorian/eras');
28355
28169
  var _styleMap3 = {};
@@ -28367,7 +28181,6 @@ var CldrDateTimeTextProvider = function () {
28367
28181
  _styleMap3[TextStyle.SHORT] = _data3;
28368
28182
  return this._createLocaleStore(_styleMap3);
28369
28183
  }
28370
-
28371
28184
  if (field === IsoFields.QUARTER_OF_YEAR) {
28372
28185
  var quartersData = cldr.main('dates/calendars/gregorian/quarters/format');
28373
28186
  var _styleMap4 = {};
@@ -28391,40 +28204,30 @@ var CldrDateTimeTextProvider = function () {
28391
28204
  _styleMap4[TextStyle.SHORT] = _data4;
28392
28205
  return this._createLocaleStore(_styleMap4);
28393
28206
  }
28394
-
28395
28207
  return null;
28396
28208
  };
28397
-
28398
28209
  _proto._createLocaleStore = function _createLocaleStore(valueTextMap) {
28399
28210
  valueTextMap[TextStyle.FULL_STANDALONE] = valueTextMap[TextStyle.FULL];
28400
28211
  valueTextMap[TextStyle.SHORT_STANDALONE] = valueTextMap[TextStyle.SHORT];
28401
-
28402
28212
  if (Object.keys(valueTextMap).indexOf(TextStyle.NARROW) > -1 && Object.keys(valueTextMap).indexOf(TextStyle.NARROW_STANDALONE) === -1) {
28403
28213
  valueTextMap[TextStyle.NARROW_STANDALONE] = valueTextMap[TextStyle.NARROW];
28404
28214
  }
28405
-
28406
28215
  return new LocaleStore(valueTextMap);
28407
28216
  };
28408
-
28409
28217
  return CldrDateTimeTextProvider;
28410
28218
  }();
28411
28219
 
28412
28220
  var _jodaInternal$assert$2 = _.assert,
28413
- requireNonNull$3 = _jodaInternal$assert$2.requireNonNull,
28414
- requireInstance$2 = _jodaInternal$assert$2.requireInstance;
28415
-
28221
+ requireNonNull$3 = _jodaInternal$assert$2.requireNonNull,
28222
+ requireInstance$2 = _jodaInternal$assert$2.requireInstance;
28416
28223
  var LENGTH_COMPARATOR = function LENGTH_COMPARATOR(str1, str2) {
28417
28224
  var cmp = str2.length - str1.length;
28418
-
28419
28225
  if (cmp === 0) {
28420
28226
  cmp = str1.localeCompare(str2);
28421
28227
  }
28422
-
28423
28228
  return cmp;
28424
28229
  };
28425
-
28426
28230
  var resolveZoneIdTextCache = {};
28427
-
28428
28231
  var CldrZoneTextPrinterParser = function () {
28429
28232
  function CldrZoneTextPrinterParser(textStyle) {
28430
28233
  requireNonNull$3(textStyle, 'textStyle');
@@ -28434,69 +28237,52 @@ var CldrZoneTextPrinterParser = function () {
28434
28237
  loadCldrData('supplemental/likelySubtags.json');
28435
28238
  loadCldrData('supplemental/metaZones.json');
28436
28239
  }
28437
-
28438
28240
  var _proto = CldrZoneTextPrinterParser.prototype;
28439
-
28440
28241
  _proto._cachedResolveZoneIdText = function _cachedResolveZoneIdText(cldr, zoneId, style, type) {
28441
28242
  if (resolveZoneIdTextCache[cldr.locale] == null) {
28442
28243
  resolveZoneIdTextCache[cldr.locale] = {};
28443
28244
  }
28444
-
28445
28245
  var zoneIdToStyle = resolveZoneIdTextCache[cldr.locale];
28446
-
28447
28246
  if (zoneIdToStyle[zoneId] == null) {
28448
28247
  zoneIdToStyle[zoneId] = {};
28449
28248
  }
28450
-
28451
28249
  var styleToType = zoneIdToStyle[zoneId];
28452
-
28453
28250
  if (styleToType[style] == null) {
28454
28251
  styleToType[style] = {};
28455
28252
  }
28456
-
28457
28253
  var typeToResolvedZoneIdText = styleToType[style];
28458
-
28459
28254
  if (typeToResolvedZoneIdText[type] == null) {
28460
28255
  typeToResolvedZoneIdText[type] = this._resolveZoneIdText(cldr, zoneId, style, type);
28461
28256
  }
28462
-
28463
28257
  return typeToResolvedZoneIdText[type];
28464
28258
  };
28465
-
28466
28259
  _proto._resolveZoneIdText = function _resolveZoneIdText(cldr, zoneId, style, type) {
28467
28260
  var zoneData = cldr.main("dates/timeZoneNames/zone/" + zoneId + "/" + style + "/" + type);
28468
-
28469
28261
  if (zoneData) {
28470
28262
  return zoneData;
28471
28263
  } else {
28472
28264
  var metazoneInfo = cldr.get("supplemental/metaZones/metazoneInfo/timezone/" + zoneId);
28473
-
28474
28265
  if (metazoneInfo) {
28475
28266
  var metazone = metazoneInfo[metazoneInfo.length - 1]['usesMetazone']['_mzone'];
28476
28267
  var metaZoneData = cldr.main("dates/timeZoneNames/metazone/" + metazone + "/" + style + "/" + type);
28477
-
28478
28268
  if (metaZoneData) {
28479
28269
  return metaZoneData;
28480
28270
  } else {
28481
28271
  metaZoneData = cldr.main("dates/timeZoneNames/metazone/" + metazone + "/" + style + "/generic");
28482
-
28483
28272
  if (!metaZoneData) {
28484
28273
  metaZoneData = cldr.main("dates/timeZoneNames/metazone/" + metazone + "/" + style + "/standard");
28485
28274
  }
28486
-
28487
28275
  if (metaZoneData) {
28488
28276
  return metaZoneData;
28489
28277
  } else {
28490
28278
  var mapZones = getOrCreateMapZones(cldr);
28491
28279
  var preferredZone = mapZones[metazone][cldr.attributes.territory];
28492
-
28493
28280
  if (preferredZone) {
28494
28281
  if (preferredZone !== zoneId) {
28495
28282
  return this._cachedResolveZoneIdText(cldr, preferredZone, style, type);
28496
28283
  }
28497
28284
  } else {
28498
28285
  var goldenZone = mapZones[metazone]['001'];
28499
-
28500
28286
  if (goldenZone !== zoneId) {
28501
28287
  return this._cachedResolveZoneIdText(cldr, goldenZone, style, type);
28502
28288
  }
@@ -28506,14 +28292,11 @@ var CldrZoneTextPrinterParser = function () {
28506
28292
  }
28507
28293
  }
28508
28294
  };
28509
-
28510
28295
  _proto.print = function print(context, buf) {
28511
28296
  var zone = context.getValueQuery(TemporalQueries.zoneId());
28512
-
28513
28297
  if (zone == null) {
28514
28298
  return false;
28515
28299
  }
28516
-
28517
28300
  if (zone.normalized() instanceof ZoneOffset) {
28518
28301
  buf.append(zone.id());
28519
28302
  return true;
@@ -28522,51 +28305,38 @@ var CldrZoneTextPrinterParser = function () {
28522
28305
  var tzstyle = this._textStyle.asNormal() === TextStyle.FULL ? 'long' : 'short';
28523
28306
  loadCldrData("main/" + context.locale().localeString() + "/timeZoneNames.json");
28524
28307
  var cldr = getOrCreateCldrInstance(context.locale().localeString());
28525
-
28526
28308
  var text = this._cachedResolveZoneIdText(cldr, zone.id(), tzstyle, tzType);
28527
-
28528
28309
  if (text) {
28529
28310
  buf.append(text);
28530
28311
  } else {
28531
28312
  buf.append(zone.id());
28532
28313
  }
28533
-
28534
28314
  return true;
28535
28315
  };
28536
-
28537
28316
  _proto._resolveZoneIds = function _resolveZoneIds(localString) {
28538
28317
  if (this._zoneIdsLocales[localString] != null) {
28539
28318
  return this._zoneIdsLocales[localString];
28540
28319
  }
28541
-
28542
28320
  var ids = {};
28543
28321
  loadCldrData("main/" + localString + "/timeZoneNames.json");
28544
28322
  var cldr = getOrCreateCldrInstance(localString);
28545
-
28546
28323
  for (var _iterator = _createForOfIteratorHelperLoose(ZoneRulesProvider.getAvailableZoneIds()), _step; !(_step = _iterator()).done;) {
28547
28324
  var id = _step.value;
28548
28325
  ids[id] = id;
28549
28326
  var tzstyle = this._textStyle.asNormal() === TextStyle.FULL ? 'long' : 'short';
28550
-
28551
28327
  var genericText = this._cachedResolveZoneIdText(cldr, id, tzstyle, 'generic');
28552
-
28553
28328
  if (genericText) {
28554
28329
  ids[genericText] = id;
28555
28330
  }
28556
-
28557
28331
  var standardText = this._cachedResolveZoneIdText(cldr, id, tzstyle, 'standard');
28558
-
28559
28332
  if (standardText) {
28560
28333
  ids[standardText] = id;
28561
28334
  }
28562
-
28563
28335
  var daylightText = this._cachedResolveZoneIdText(cldr, id, tzstyle, 'daylight');
28564
-
28565
28336
  if (daylightText) {
28566
28337
  ids[daylightText] = id;
28567
28338
  }
28568
28339
  }
28569
-
28570
28340
  var sortedKeys = Object.keys(ids).sort(LENGTH_COMPARATOR);
28571
28341
  this._zoneIdsLocales[localString] = {
28572
28342
  ids: ids,
@@ -28574,37 +28344,29 @@ var CldrZoneTextPrinterParser = function () {
28574
28344
  };
28575
28345
  return this._zoneIdsLocales[localString];
28576
28346
  };
28577
-
28578
28347
  _proto.parse = function parse(context, text, position) {
28579
28348
  for (var _i = 0, _arr = ['UTC', 'GMT']; _i < _arr.length; _i++) {
28580
28349
  var name = _arr[_i];
28581
-
28582
28350
  if (context.subSequenceEquals(text, position, name, 0, name.length)) {
28583
28351
  context.setParsedZone(ZoneId.of(name));
28584
28352
  return position + name.length;
28585
28353
  }
28586
28354
  }
28587
-
28588
28355
  var _this$_resolveZoneIds = this._resolveZoneIds(context.locale().localeString()),
28589
- ids = _this$_resolveZoneIds.ids,
28590
- sortedKeys = _this$_resolveZoneIds.sortedKeys;
28591
-
28356
+ ids = _this$_resolveZoneIds.ids,
28357
+ sortedKeys = _this$_resolveZoneIds.sortedKeys;
28592
28358
  for (var _iterator2 = _createForOfIteratorHelperLoose(sortedKeys), _step2; !(_step2 = _iterator2()).done;) {
28593
28359
  var _name = _step2.value;
28594
-
28595
28360
  if (context.subSequenceEquals(text, position, _name, 0, _name.length)) {
28596
28361
  context.setParsedZone(ZoneId.of(ids[_name]));
28597
28362
  return position + _name.length;
28598
28363
  }
28599
28364
  }
28600
-
28601
28365
  return ~position;
28602
28366
  };
28603
-
28604
28367
  _proto.toString = function toString() {
28605
28368
  return "ZoneText(" + this._textStyle + ")";
28606
28369
  };
28607
-
28608
28370
  return CldrZoneTextPrinterParser;
28609
28371
  }();
28610
28372
 
@@ -28614,178 +28376,127 @@ var CldrZoneTextPrinterParser = function () {
28614
28376
  * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
28615
28377
  */
28616
28378
  var MathUtil$1 = _.MathUtil;
28617
-
28618
28379
  var LocalizedOffsetPrinterParser = function () {
28619
28380
  function LocalizedOffsetPrinterParser(textStyle) {
28620
28381
  this._textStyle = textStyle;
28621
28382
  }
28622
-
28623
28383
  var _proto = LocalizedOffsetPrinterParser.prototype;
28624
-
28625
28384
  _proto.textStyle = function textStyle() {
28626
28385
  return this._textStyle;
28627
28386
  };
28628
-
28629
28387
  _proto.print = function print(context, buf) {
28630
28388
  var offsetSecs = context.getValue(ChronoField.OFFSET_SECONDS);
28631
-
28632
28389
  if (offsetSecs == null) {
28633
28390
  return false;
28634
28391
  }
28635
-
28636
28392
  buf.append('GMT');
28637
-
28638
28393
  if (this._textStyle === TextStyle.FULL) {
28639
28394
  return new DateTimeFormatterBuilder.OffsetIdPrinterParser('', '+HH:MM:ss').print(context, buf);
28640
28395
  }
28641
-
28642
28396
  var totalSecs = MathUtil$1.safeToInt(offsetSecs);
28643
-
28644
28397
  if (totalSecs !== 0) {
28645
28398
  var absHours = Math.abs(MathUtil$1.intMod(MathUtil$1.intDiv(totalSecs, 3600), 100));
28646
28399
  var absMinutes = Math.abs(MathUtil$1.intMod(MathUtil$1.intDiv(totalSecs, 60), 60));
28647
28400
  var absSeconds = Math.abs(MathUtil$1.intMod(totalSecs, 60));
28648
28401
  buf.append(totalSecs < 0 ? '-' : '+').append(absHours);
28649
-
28650
28402
  if (absMinutes > 0 || absSeconds > 0) {
28651
28403
  buf.append(':').append(MathUtil$1.intDiv(absMinutes, 10)).append(MathUtil$1.intMod(absMinutes, 10));
28652
-
28653
28404
  if (absSeconds > 0) {
28654
28405
  buf.append(':').append(MathUtil$1.intDiv(absSeconds, 10)).append(MathUtil$1.intMod(absSeconds, 10));
28655
28406
  }
28656
28407
  }
28657
28408
  }
28658
-
28659
28409
  return true;
28660
28410
  };
28661
-
28662
28411
  _proto.parse = function parse(context, text, position) {
28663
28412
  if (context.subSequenceEquals(text, position, 'GMT', 0, 3) === false) {
28664
28413
  return ~position;
28665
28414
  }
28666
-
28667
28415
  position += 3;
28668
-
28669
28416
  if (this._textStyle === TextStyle.FULL) {
28670
28417
  return new DateTimeFormatterBuilder.OffsetIdPrinterParser('', '+HH:MM:ss').parse(context, text, position);
28671
28418
  }
28672
-
28673
28419
  var end = text.length;
28674
-
28675
28420
  if (position === end) {
28676
28421
  return context.setParsedField(ChronoField.OFFSET_SECONDS, 0, position, position);
28677
28422
  }
28678
-
28679
28423
  var sign = text.charAt(position);
28680
-
28681
28424
  if (sign !== '+' && sign !== '-') {
28682
28425
  return context.setParsedField(ChronoField.OFFSET_SECONDS, 0, position, position);
28683
28426
  }
28684
-
28685
28427
  var negative = sign === '-' ? -1 : 1;
28686
-
28687
28428
  if (position === end) {
28688
28429
  return ~position;
28689
28430
  }
28690
-
28691
28431
  position++;
28692
28432
  var ch = text.charAt(position);
28693
-
28694
28433
  if (ch < '0' || ch > '9') {
28695
28434
  return ~position;
28696
28435
  }
28697
-
28698
28436
  position++;
28699
28437
  var hour = MathUtil$1.parseInt(ch);
28700
-
28701
28438
  if (position !== end) {
28702
28439
  ch = text.charAt(position);
28703
-
28704
28440
  if (ch >= '0' && ch <= '9') {
28705
28441
  hour = hour * 10 + MathUtil$1.parseInt(ch);
28706
-
28707
28442
  if (hour > 23) {
28708
28443
  return ~position;
28709
28444
  }
28710
-
28711
28445
  position++;
28712
28446
  }
28713
28447
  }
28714
-
28715
28448
  if (position === end || text.charAt(position) !== ':') {
28716
28449
  var _offset = negative * 3600 * hour;
28717
-
28718
28450
  return context.setParsedField(ChronoField.OFFSET_SECONDS, _offset, position, position);
28719
28451
  }
28720
-
28721
28452
  position++;
28722
-
28723
28453
  if (position > end - 2) {
28724
28454
  return ~position;
28725
28455
  }
28726
-
28727
28456
  ch = text.charAt(position);
28728
-
28729
28457
  if (ch < '0' || ch > '9') {
28730
28458
  return ~position;
28731
28459
  }
28732
-
28733
28460
  position++;
28734
28461
  var min = MathUtil$1.parseInt(ch);
28735
28462
  ch = text.charAt(position);
28736
-
28737
28463
  if (ch < '0' || ch > '9') {
28738
28464
  return ~position;
28739
28465
  }
28740
-
28741
28466
  position++;
28742
28467
  min = min * 10 + MathUtil$1.parseInt(ch);
28743
-
28744
28468
  if (min > 59) {
28745
28469
  return ~position;
28746
28470
  }
28747
-
28748
28471
  if (position === end || text.charAt(position) !== ':') {
28749
28472
  var _offset2 = negative * (3600 * hour + 60 * min);
28750
-
28751
28473
  return context.setParsedField(ChronoField.OFFSET_SECONDS, _offset2, position, position);
28752
28474
  }
28753
-
28754
28475
  position++;
28755
-
28756
28476
  if (position > end - 2) {
28757
28477
  return ~position;
28758
28478
  }
28759
-
28760
28479
  ch = text.charAt(position);
28761
-
28762
28480
  if (ch < '0' || ch > '9') {
28763
28481
  return ~position;
28764
28482
  }
28765
-
28766
28483
  position++;
28767
28484
  var sec = MathUtil$1.parseInt(ch);
28768
28485
  ch = text.charAt(position);
28769
-
28770
28486
  if (ch < '0' || ch > '9') {
28771
28487
  return ~position;
28772
28488
  }
28773
-
28774
28489
  position++;
28775
28490
  sec = sec * 10 + MathUtil$1.parseInt(ch);
28776
-
28777
28491
  if (sec > 59) {
28778
28492
  return ~position;
28779
28493
  }
28780
-
28781
28494
  var offset = negative * (3600 * hour + 60 * min + sec);
28782
28495
  return context.setParsedField(ChronoField.OFFSET_SECONDS, offset, position, position);
28783
28496
  };
28784
-
28785
28497
  _proto.toString = function toString() {
28786
28498
  return "LocalizedOffset(" + this._textStyle + ")";
28787
28499
  };
28788
-
28789
28500
  return LocalizedOffsetPrinterParser;
28790
28501
  }();
28791
28502
 
@@ -28794,9 +28505,9 @@ var LocalizedOffsetPrinterParser = function () {
28794
28505
  * @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
28795
28506
  */
28796
28507
  var MathUtil = _.MathUtil,
28797
- _jodaInternal$assert$1 = _.assert,
28798
- requireNonNull$2 = _jodaInternal$assert$1.requireNonNull,
28799
- requireInstance$1 = _jodaInternal$assert$1.requireInstance;
28508
+ _jodaInternal$assert$1 = _.assert,
28509
+ requireNonNull$2 = _jodaInternal$assert$1.requireNonNull,
28510
+ requireInstance$1 = _jodaInternal$assert$1.requireInstance;
28800
28511
  var DAY_OF_WEEK_RANGE = ValueRange.of(1, 7);
28801
28512
  var WEEK_OF_MONTH_RANGE = ValueRange.of(0, 1, 4, 6);
28802
28513
  var WEEK_OF_YEAR_RANGE = ValueRange.of(0, 1, 52, 54);
@@ -28815,23 +28526,18 @@ var ComputedDayOfField = function () {
28815
28526
  ComputedDayOfField.ofDayOfWeekField = function ofDayOfWeekField(weekDef) {
28816
28527
  return new ComputedDayOfField('DayOfWeek', weekDef, ChronoUnit.DAYS, ChronoUnit.WEEKS, DAY_OF_WEEK_RANGE);
28817
28528
  };
28818
-
28819
28529
  ComputedDayOfField.ofWeekOfMonthField = function ofWeekOfMonthField(weekDef) {
28820
28530
  return new ComputedDayOfField('WeekOfMonth', weekDef, ChronoUnit.WEEKS, ChronoUnit.MONTHS, WEEK_OF_MONTH_RANGE);
28821
28531
  };
28822
-
28823
28532
  ComputedDayOfField.ofWeekOfYearField = function ofWeekOfYearField(weekDef) {
28824
28533
  return new ComputedDayOfField('WeekOfYear', weekDef, ChronoUnit.WEEKS, ChronoUnit.YEARS, WEEK_OF_YEAR_RANGE);
28825
28534
  };
28826
-
28827
28535
  ComputedDayOfField.ofWeekOfWeekBasedYearField = function ofWeekOfWeekBasedYearField(weekDef) {
28828
28536
  return new ComputedDayOfField('WeekOfWeekBasedYear', weekDef, ChronoUnit.WEEKS, IsoFields.WEEK_BASED_YEARS, WEEK_OF_WEEK_BASED_YEAR_RANGE);
28829
28537
  };
28830
-
28831
28538
  ComputedDayOfField.ofWeekBasedYearField = function ofWeekBasedYearField(weekDef) {
28832
28539
  return new ComputedDayOfField('WeekBasedYear', weekDef, IsoFields.WEEK_BASED_YEARS, ChronoUnit.FOREVER, WEEK_BASED_YEAR_RANGE);
28833
28540
  };
28834
-
28835
28541
  function ComputedDayOfField(name, weekDef, baseUnit, rangeUnit, range) {
28836
28542
  this._name = name;
28837
28543
  this._weekDef = weekDef;
@@ -28839,14 +28545,10 @@ var ComputedDayOfField = function () {
28839
28545
  this._rangeUnit = rangeUnit;
28840
28546
  this._range = range;
28841
28547
  }
28842
-
28843
28548
  var _proto = ComputedDayOfField.prototype;
28844
-
28845
28549
  _proto.getFrom = function getFrom(temporal) {
28846
28550
  var sow = this._weekDef.firstDayOfWeek().value();
28847
-
28848
28551
  var dow = this._localizedDayOfWeek(temporal, sow);
28849
-
28850
28552
  if (this._rangeUnit === ChronoUnit.WEEKS) {
28851
28553
  return dow;
28852
28554
  } else if (this._rangeUnit === ChronoUnit.MONTHS) {
@@ -28861,112 +28563,79 @@ var ComputedDayOfField = function () {
28861
28563
  throw new IllegalStateException('unreachable');
28862
28564
  }
28863
28565
  };
28864
-
28865
28566
  _proto._localizedDayOfWeek = function _localizedDayOfWeek(temporal, sow) {
28866
28567
  var isoDow = temporal.get(ChronoField.DAY_OF_WEEK);
28867
28568
  return MathUtil.floorMod(isoDow - sow, 7) + 1;
28868
28569
  };
28869
-
28870
28570
  _proto._localizedWeekOfMonth = function _localizedWeekOfMonth(temporal, dow) {
28871
28571
  var dom = temporal.get(ChronoField.DAY_OF_MONTH);
28872
-
28873
28572
  var offset = this._startOfWeekOffset(dom, dow);
28874
-
28875
28573
  return ComputedDayOfField._computeWeek(offset, dom);
28876
28574
  };
28877
-
28878
28575
  _proto._localizedWeekOfYear = function _localizedWeekOfYear(temporal, dow) {
28879
28576
  var doy = temporal.get(ChronoField.DAY_OF_YEAR);
28880
-
28881
28577
  var offset = this._startOfWeekOffset(doy, dow);
28882
-
28883
28578
  return ComputedDayOfField._computeWeek(offset, doy);
28884
28579
  };
28885
-
28886
28580
  _proto._localizedWOWBY = function _localizedWOWBY(temporal) {
28887
28581
  var sow = this._weekDef.firstDayOfWeek().value();
28888
-
28889
28582
  var isoDow = temporal.get(ChronoField.DAY_OF_WEEK);
28890
28583
  var dow = MathUtil.floorMod(isoDow - sow, 7) + 1;
28891
-
28892
28584
  var woy = this._localizedWeekOfYear(temporal, dow);
28893
-
28894
28585
  if (woy === 0) {
28895
28586
  var previous = LocalDate.from(temporal).minus(1, ChronoUnit.WEEKS);
28896
28587
  return this._localizedWeekOfYear(previous, dow) + 1;
28897
28588
  } else if (woy >= 53) {
28898
28589
  var offset = this._startOfWeekOffset(temporal.get(ChronoField.DAY_OF_YEAR), dow);
28899
-
28900
28590
  var year = temporal.get(ChronoField.YEAR);
28901
28591
  var yearLen = Year.isLeap(year) ? 366 : 365;
28902
-
28903
28592
  var weekIndexOfFirstWeekNextYear = ComputedDayOfField._computeWeek(offset, yearLen + this._weekDef.minimalDaysInFirstWeek());
28904
-
28905
28593
  if (woy >= weekIndexOfFirstWeekNextYear) {
28906
28594
  return woy - (weekIndexOfFirstWeekNextYear - 1);
28907
28595
  }
28908
28596
  }
28909
-
28910
28597
  return woy;
28911
28598
  };
28912
-
28913
28599
  _proto._localizedWBY = function _localizedWBY(temporal) {
28914
28600
  var sow = this._weekDef.firstDayOfWeek().value();
28915
-
28916
28601
  var isoDow = temporal.get(ChronoField.DAY_OF_WEEK);
28917
28602
  var dow = MathUtil.floorMod(isoDow - sow, 7) + 1;
28918
28603
  var year = temporal.get(ChronoField.YEAR);
28919
-
28920
28604
  var woy = this._localizedWeekOfYear(temporal, dow);
28921
-
28922
28605
  if (woy === 0) {
28923
28606
  return year - 1;
28924
28607
  } else if (woy < 53) {
28925
28608
  return year;
28926
28609
  }
28927
-
28928
28610
  var offset = this._startOfWeekOffset(temporal.get(ChronoField.DAY_OF_YEAR), dow);
28929
-
28930
28611
  var yearLen = Year.isLeap(year) ? 366 : 365;
28931
-
28932
28612
  var weekIndexOfFirstWeekNextYear = ComputedDayOfField._computeWeek(offset, yearLen + this._weekDef.minimalDaysInFirstWeek());
28933
-
28934
28613
  if (woy >= weekIndexOfFirstWeekNextYear) {
28935
28614
  return year + 1;
28936
28615
  }
28937
-
28938
28616
  return year;
28939
28617
  };
28940
-
28941
28618
  _proto._startOfWeekOffset = function _startOfWeekOffset(day, dow) {
28942
28619
  var weekStart = MathUtil.floorMod(day - dow, 7);
28943
28620
  var offset = -weekStart;
28944
-
28945
28621
  if (weekStart + 1 > this._weekDef.minimalDaysInFirstWeek()) {
28946
28622
  offset = 7 - weekStart;
28947
28623
  }
28948
-
28949
28624
  return offset;
28950
28625
  };
28951
-
28952
28626
  ComputedDayOfField._computeWeek = function _computeWeek(offset, day) {
28953
28627
  return MathUtil.intDiv(7 + offset + (day - 1), 7);
28954
28628
  };
28955
-
28956
28629
  _proto.adjustInto = function adjustInto(temporal, newValue) {
28957
28630
  var newVal = this._range.checkValidIntValue(newValue, this);
28958
-
28959
28631
  var currentVal = temporal.get(this);
28960
-
28961
28632
  if (newVal === currentVal) {
28962
28633
  return temporal;
28963
28634
  }
28964
-
28965
28635
  if (this._rangeUnit === ChronoUnit.FOREVER) {
28966
28636
  var baseWowby = temporal.get(this._weekDef.weekOfWeekBasedYear());
28967
28637
  var diffWeeks = MathUtil.roundDown((newValue - currentVal) * 52.1775);
28968
28638
  var result = temporal.plus(diffWeeks, ChronoUnit.WEEKS);
28969
-
28970
28639
  if (result.get(this) > newVal) {
28971
28640
  var newWowby = result.get(this._weekDef.weekOfWeekBasedYear());
28972
28641
  result = result.minus(newWowby, ChronoUnit.WEEKS);
@@ -28974,140 +28643,96 @@ var ComputedDayOfField = function () {
28974
28643
  if (result.get(this) < newVal) {
28975
28644
  result = result.plus(2, ChronoUnit.WEEKS);
28976
28645
  }
28977
-
28978
28646
  var _newWowby = result.get(this._weekDef.weekOfWeekBasedYear());
28979
-
28980
28647
  result = result.plus(baseWowby - _newWowby, ChronoUnit.WEEKS);
28981
-
28982
28648
  if (result.get(this) > newVal) {
28983
28649
  result = result.minus(1, ChronoUnit.WEEKS);
28984
28650
  }
28985
28651
  }
28986
-
28987
28652
  return result;
28988
28653
  }
28989
-
28990
28654
  var delta = newVal - currentVal;
28991
28655
  return temporal.plus(delta, this._baseUnit);
28992
28656
  };
28993
-
28994
28657
  _proto.resolve = function resolve(fieldValues, partialTemporal, resolverStyle) {
28995
28658
  var sow = this._weekDef.firstDayOfWeek().value();
28996
-
28997
28659
  if (this._rangeUnit === ChronoUnit.WEEKS) {
28998
28660
  var value = fieldValues.remove(this);
28999
-
29000
28661
  var localDow = this._range.checkValidIntValue(value, this);
29001
-
29002
28662
  var _isoDow = MathUtil.floorMod(sow - 1 + (localDow - 1), 7) + 1;
29003
-
29004
28663
  fieldValues.put(ChronoField.DAY_OF_WEEK, _isoDow);
29005
28664
  return null;
29006
28665
  }
29007
-
29008
28666
  if (fieldValues.containsKey(ChronoField.DAY_OF_WEEK) === false) {
29009
28667
  return null;
29010
28668
  }
29011
-
29012
28669
  if (this._rangeUnit === ChronoUnit.FOREVER) {
29013
28670
  if (fieldValues.containsKey(this._weekDef.weekOfWeekBasedYear()) === false) {
29014
28671
  return null;
29015
28672
  }
29016
-
29017
28673
  var _isoDow2 = ChronoField.DAY_OF_WEEK.checkValidIntValue(fieldValues.get(ChronoField.DAY_OF_WEEK));
29018
-
29019
28674
  var _dow = MathUtil.floorMod(_isoDow2 - sow, 7) + 1;
29020
-
29021
28675
  var wby = this.range().checkValidIntValue(fieldValues.get(this), this);
29022
28676
  var date;
29023
28677
  var days;
29024
-
29025
28678
  if (resolverStyle === ResolverStyle.LENIENT) {
29026
28679
  date = LocalDate.of(wby, 1, this._weekDef.minimalDaysInFirstWeek());
29027
28680
  var wowby = fieldValues.get(this._weekDef.weekOfWeekBasedYear());
29028
-
29029
28681
  var dateDow = this._localizedDayOfWeek(date, sow);
29030
-
29031
28682
  var weeks = wowby - this._localizedWeekOfYear(date, dateDow);
29032
-
29033
28683
  days = weeks * 7 + (_dow - dateDow);
29034
28684
  } else {
29035
28685
  date = LocalDate.of(wby, 1, this._weekDef.minimalDaysInFirstWeek());
29036
-
29037
28686
  var _wowby = this._weekDef.weekOfWeekBasedYear().range().checkValidIntValue(fieldValues.get(this._weekDef.weekOfWeekBasedYear()), this._weekDef.weekOfWeekBasedYear);
29038
-
29039
28687
  var _dateDow = this._localizedDayOfWeek(date, sow);
29040
-
29041
28688
  var _weeks = _wowby - this._localizedWeekOfYear(date, _dateDow);
29042
-
29043
28689
  days = _weeks * 7 + (_dow - _dateDow);
29044
28690
  }
29045
-
29046
28691
  date = date.plus(days, ChronoUnit.DAYS);
29047
-
29048
28692
  if (resolverStyle === ResolverStyle.STRICT) {
29049
28693
  if (date.getLong(this) !== fieldValues.get(this)) {
29050
28694
  throw new DateTimeException('Strict mode rejected date parsed to a different year');
29051
28695
  }
29052
28696
  }
29053
-
29054
28697
  fieldValues.remove(this);
29055
28698
  fieldValues.remove(this._weekDef.weekOfWeekBasedYear());
29056
28699
  fieldValues.remove(ChronoField.DAY_OF_WEEK);
29057
28700
  return date;
29058
28701
  }
29059
-
29060
28702
  if (fieldValues.containsKey(ChronoField.YEAR) === false) {
29061
28703
  return null;
29062
28704
  }
29063
-
29064
28705
  var isoDow = ChronoField.DAY_OF_WEEK.checkValidIntValue(fieldValues.get(ChronoField.DAY_OF_WEEK));
29065
28706
  var dow = MathUtil.floorMod(isoDow - sow, 7) + 1;
29066
28707
  var year = ChronoField.YEAR.checkValidIntValue(fieldValues.get(ChronoField.YEAR));
29067
-
29068
28708
  if (this._rangeUnit === ChronoUnit.MONTHS) {
29069
28709
  if (fieldValues.containsKey(ChronoField.MONTH_OF_YEAR) === false) {
29070
28710
  return null;
29071
28711
  }
29072
-
29073
28712
  var _value = fieldValues.remove(this);
29074
-
29075
28713
  var _date;
29076
-
29077
28714
  var _days;
29078
-
29079
28715
  if (resolverStyle === ResolverStyle.LENIENT) {
29080
28716
  var month = fieldValues.get(ChronoField.MONTH_OF_YEAR);
29081
28717
  _date = LocalDate.of(year, 1, 1);
29082
28718
  _date = _date.plus(month - 1, ChronoUnit.MONTHS);
29083
-
29084
28719
  var _dateDow2 = this._localizedDayOfWeek(_date, sow);
29085
-
29086
28720
  var _weeks2 = _value - this._localizedWeekOfMonth(_date, _dateDow2);
29087
-
29088
28721
  _days = _weeks2 * 7 + (dow - _dateDow2);
29089
28722
  } else {
29090
28723
  var _month = ChronoField.MONTH_OF_YEAR.checkValidIntValue(fieldValues.get(ChronoField.MONTH_OF_YEAR));
29091
-
29092
28724
  _date = LocalDate.of(year, _month, 8);
29093
-
29094
28725
  var _dateDow3 = this._localizedDayOfWeek(_date, sow);
29095
-
29096
28726
  var wom = this._range.checkValidIntValue(_value, this);
29097
-
29098
28727
  var _weeks3 = wom - this._localizedWeekOfMonth(_date, _dateDow3);
29099
-
29100
28728
  _days = _weeks3 * 7 + (dow - _dateDow3);
29101
28729
  }
29102
-
29103
28730
  _date = _date.plus(_days, ChronoUnit.DAYS);
29104
-
29105
28731
  if (resolverStyle === ResolverStyle.STRICT) {
29106
28732
  if (_date.getLong(ChronoField.MONTH_OF_YEAR) !== fieldValues.get(ChronoField.MONTH_OF_YEAR)) {
29107
28733
  throw new DateTimeException('Strict mode rejected date parsed to a different month');
29108
28734
  }
29109
28735
  }
29110
-
29111
28736
  fieldValues.remove(this);
29112
28737
  fieldValues.remove(ChronoField.YEAR);
29113
28738
  fieldValues.remove(ChronoField.MONTH_OF_YEAR);
@@ -29115,35 +28740,24 @@ var ComputedDayOfField = function () {
29115
28740
  return _date;
29116
28741
  } else if (this._rangeUnit === ChronoUnit.YEARS) {
29117
28742
  var _value2 = fieldValues.remove(this);
29118
-
29119
28743
  var _date2 = LocalDate.of(year, 1, 1);
29120
-
29121
28744
  var _days2;
29122
-
29123
28745
  if (resolverStyle === ResolverStyle.LENIENT) {
29124
28746
  var _dateDow4 = this._localizedDayOfWeek(_date2, sow);
29125
-
29126
28747
  var _weeks4 = _value2 - this._localizedWeekOfYear(_date2, _dateDow4);
29127
-
29128
28748
  _days2 = _weeks4 * 7 + (dow - _dateDow4);
29129
28749
  } else {
29130
28750
  var _dateDow5 = this._localizedDayOfWeek(_date2, sow);
29131
-
29132
28751
  var woy = this._range.checkValidIntValue(_value2, this);
29133
-
29134
28752
  var _weeks5 = woy - this._localizedWeekOfYear(_date2, _dateDow5);
29135
-
29136
28753
  _days2 = _weeks5 * 7 + (dow - _dateDow5);
29137
28754
  }
29138
-
29139
28755
  _date2 = _date2.plus(_days2, ChronoUnit.DAYS);
29140
-
29141
28756
  if (resolverStyle === ResolverStyle.STRICT) {
29142
28757
  if (_date2.getLong(ChronoField.YEAR) !== fieldValues.get(ChronoField.YEAR)) {
29143
28758
  throw new DateTimeException('Strict mode rejected date parsed to a different year');
29144
28759
  }
29145
28760
  }
29146
-
29147
28761
  fieldValues.remove(this);
29148
28762
  fieldValues.remove(ChronoField.YEAR);
29149
28763
  fieldValues.remove(ChronoField.DAY_OF_WEEK);
@@ -29152,31 +28766,24 @@ var ComputedDayOfField = function () {
29152
28766
  throw new IllegalStateException('unreachable');
29153
28767
  }
29154
28768
  };
29155
-
29156
28769
  _proto.name = function name() {
29157
28770
  return this._name;
29158
28771
  };
29159
-
29160
28772
  _proto.baseUnit = function baseUnit() {
29161
28773
  return this._baseUnit;
29162
28774
  };
29163
-
29164
28775
  _proto.rangeUnit = function rangeUnit() {
29165
28776
  return this._rangeUnit;
29166
28777
  };
29167
-
29168
28778
  _proto.range = function range() {
29169
28779
  return this._range;
29170
28780
  };
29171
-
29172
28781
  _proto.isDateBased = function isDateBased() {
29173
28782
  return true;
29174
28783
  };
29175
-
29176
28784
  _proto.isTimeBased = function isTimeBased() {
29177
28785
  return false;
29178
28786
  };
29179
-
29180
28787
  _proto.isSupportedBy = function isSupportedBy(temporal) {
29181
28788
  if (temporal.isSupported(ChronoField.DAY_OF_WEEK)) {
29182
28789
  if (this._rangeUnit === ChronoUnit.WEEKS) {
@@ -29191,17 +28798,13 @@ var ComputedDayOfField = function () {
29191
28798
  return temporal.isSupported(ChronoField.EPOCH_DAY);
29192
28799
  }
29193
28800
  }
29194
-
29195
28801
  return false;
29196
28802
  };
29197
-
29198
28803
  _proto.rangeRefinedBy = function rangeRefinedBy(temporal) {
29199
28804
  if (this._rangeUnit === ChronoUnit.WEEKS) {
29200
28805
  return this._range;
29201
28806
  }
29202
-
29203
28807
  var field = null;
29204
-
29205
28808
  if (this._rangeUnit === ChronoUnit.MONTHS) {
29206
28809
  field = ChronoField.DAY_OF_MONTH;
29207
28810
  } else if (this._rangeUnit === ChronoUnit.YEARS) {
@@ -29213,58 +28816,40 @@ var ComputedDayOfField = function () {
29213
28816
  } else {
29214
28817
  throw new IllegalStateException('unreachable');
29215
28818
  }
29216
-
29217
28819
  var sow = this._weekDef.firstDayOfWeek().value();
29218
-
29219
28820
  var isoDow = temporal.get(ChronoField.DAY_OF_WEEK);
29220
28821
  var dow = MathUtil.floorMod(isoDow - sow, 7) + 1;
29221
-
29222
28822
  var offset = this._startOfWeekOffset(temporal.get(field), dow);
29223
-
29224
28823
  var fieldRange = temporal.range(field);
29225
28824
  return ValueRange.of(ComputedDayOfField._computeWeek(offset, fieldRange.minimum()), ComputedDayOfField._computeWeek(offset, fieldRange.maximum()));
29226
28825
  };
29227
-
29228
28826
  _proto._rangeWOWBY = function _rangeWOWBY(temporal) {
29229
28827
  var sow = this._weekDef.firstDayOfWeek().value();
29230
-
29231
28828
  var isoDow = temporal.get(ChronoField.DAY_OF_WEEK);
29232
28829
  var dow = MathUtil.floorMod(isoDow - sow, 7) + 1;
29233
-
29234
28830
  var woy = this._localizedWeekOfYear(temporal, dow);
29235
-
29236
28831
  if (woy === 0) {
29237
28832
  return this._rangeWOWBY(IsoChronology.INSTANCE.date(temporal).minus(2, ChronoUnit.WEEKS));
29238
28833
  }
29239
-
29240
28834
  var offset = this._startOfWeekOffset(temporal.get(ChronoField.DAY_OF_YEAR), dow);
29241
-
29242
28835
  var year = temporal.get(ChronoField.YEAR);
29243
28836
  var yearLen = Year.isLeap(year) ? 366 : 365;
29244
-
29245
28837
  var weekIndexOfFirstWeekNextYear = ComputedDayOfField._computeWeek(offset, yearLen + this._weekDef.minimalDaysInFirstWeek());
29246
-
29247
28838
  if (woy >= weekIndexOfFirstWeekNextYear) {
29248
28839
  return this._rangeWOWBY(IsoChronology.INSTANCE.date(temporal).plus(2, ChronoUnit.WEEKS));
29249
28840
  }
29250
-
29251
28841
  return ValueRange.of(1, weekIndexOfFirstWeekNextYear - 1);
29252
28842
  };
29253
-
29254
28843
  _proto.displayName = function displayName(locale) {
29255
28844
  requireNonNull$2(locale, 'locale');
29256
-
29257
28845
  if (this._rangeUnit === ChronoUnit.YEARS) {
29258
28846
  return 'Week';
29259
28847
  }
29260
-
29261
28848
  return this.toString();
29262
28849
  };
29263
-
29264
28850
  _proto.toString = function toString() {
29265
28851
  return this._name + "[" + this._weekDef.toString() + "]";
29266
28852
  };
29267
-
29268
28853
  return ComputedDayOfField;
29269
28854
  }();
29270
28855
  var WeekFieldsCache = new Map();
@@ -29276,54 +28861,42 @@ var WeekFields = function () {
29276
28861
  return WeekFields.ofFirstDayOfWeekMinDays(firstDayOrLocale, minDays);
29277
28862
  }
29278
28863
  };
29279
-
29280
28864
  WeekFields.ofLocale = function ofLocale(locale) {
29281
28865
  requireNonNull$2(locale, 'locale');
29282
- node_main.load(cldrData('supplemental/weekData.json'));
29283
- var cldr = new node_main(locale.localeString());
28866
+ Cldr.load(cldrData('supplemental/weekData.json'));
28867
+ var cldr = new Cldr(locale.localeString());
29284
28868
  var worldRegion = '001';
29285
28869
  var weekData = cldr.get('supplemental/weekData');
29286
-
29287
28870
  var dow = _weekDayMap[weekData.firstDay[locale.country()]];
29288
-
29289
28871
  if (!dow) {
29290
28872
  dow = _weekDayMap[weekData.firstDay[worldRegion]];
29291
28873
  }
29292
-
29293
28874
  var minDays = weekData.minDays[locale.country()];
29294
-
29295
28875
  if (!minDays) {
29296
28876
  minDays = weekData.minDays[worldRegion];
29297
28877
  }
29298
-
29299
28878
  return WeekFields.ofFirstDayOfWeekMinDays(dow, minDays);
29300
28879
  };
29301
-
29302
28880
  WeekFields.ofFirstDayOfWeekMinDays = function ofFirstDayOfWeekMinDays(firstDayOfWeek, minimalDaysInFirstWeek) {
29303
28881
  requireNonNull$2(firstDayOfWeek, 'firstDayOfWeek');
29304
28882
  requireInstance$1(firstDayOfWeek, DayOfWeek, 'firstDayOfWeek');
29305
28883
  requireNonNull$2(minimalDaysInFirstWeek, 'minimalDaysInFirstWeek');
29306
28884
  var key = firstDayOfWeek.toString() + minimalDaysInFirstWeek;
29307
28885
  var rules = WeekFieldsCache.get(key);
29308
-
29309
28886
  if (rules == null) {
29310
28887
  rules = new WeekFields(firstDayOfWeek, minimalDaysInFirstWeek);
29311
28888
  WeekFieldsCache.set(key, rules);
29312
28889
  rules = WeekFieldsCache.get(key);
29313
28890
  }
29314
-
29315
28891
  return rules;
29316
28892
  };
29317
-
29318
28893
  function WeekFields(firstDayOfWeek, minimalDaysInFirstWeek) {
29319
28894
  requireNonNull$2(firstDayOfWeek, 'firstDayOfWeek');
29320
28895
  requireInstance$1(firstDayOfWeek, DayOfWeek, 'firstDayOfWeek');
29321
28896
  requireNonNull$2(minimalDaysInFirstWeek, 'minimalDaysInFirstWeek');
29322
-
29323
28897
  if (minimalDaysInFirstWeek < 1 || minimalDaysInFirstWeek > 7) {
29324
28898
  throw new IllegalArgumentException('Minimal number of days is invalid');
29325
28899
  }
29326
-
29327
28900
  this._firstDayOfWeek = firstDayOfWeek;
29328
28901
  this._minimalDays = minimalDaysInFirstWeek;
29329
28902
  this._dayOfWeek = ComputedDayOfField.ofDayOfWeekField(this);
@@ -29331,59 +28904,45 @@ var WeekFields = function () {
29331
28904
  this._weekOfYear = ComputedDayOfField.ofWeekOfYearField(this);
29332
28905
  this._weekOfWeekBasedYear = ComputedDayOfField.ofWeekOfWeekBasedYearField(this);
29333
28906
  this._weekBasedYear = ComputedDayOfField.ofWeekBasedYearField(this);
29334
- node_main.load(cldrData('supplemental/likelySubtags.json'));
28907
+ Cldr.load(cldrData('supplemental/likelySubtags.json'));
29335
28908
  }
29336
-
29337
28909
  var _proto2 = WeekFields.prototype;
29338
-
29339
28910
  _proto2.firstDayOfWeek = function firstDayOfWeek() {
29340
28911
  return this._firstDayOfWeek;
29341
28912
  };
29342
-
29343
28913
  _proto2.minimalDaysInFirstWeek = function minimalDaysInFirstWeek() {
29344
28914
  return this._minimalDays;
29345
28915
  };
29346
-
29347
28916
  _proto2.dayOfWeek = function dayOfWeek() {
29348
28917
  return this._dayOfWeek;
29349
28918
  };
29350
-
29351
28919
  _proto2.weekOfMonth = function weekOfMonth() {
29352
28920
  return this._weekOfMonth;
29353
28921
  };
29354
-
29355
28922
  _proto2.weekOfYear = function weekOfYear() {
29356
28923
  return this._weekOfYear;
29357
28924
  };
29358
-
29359
28925
  _proto2.weekOfWeekBasedYear = function weekOfWeekBasedYear() {
29360
28926
  return this._weekOfWeekBasedYear;
29361
28927
  };
29362
-
29363
28928
  _proto2.weekBasedYear = function weekBasedYear() {
29364
28929
  return this._weekBasedYear;
29365
28930
  };
29366
-
29367
28931
  _proto2.equals = function equals(other) {
29368
28932
  if (this === other) {
29369
28933
  return true;
29370
28934
  }
29371
-
29372
28935
  if (other instanceof WeekFields) {
29373
28936
  return this.hashCode() === other.hashCode();
29374
28937
  }
29375
-
29376
28938
  return false;
29377
28939
  };
29378
-
29379
28940
  _proto2.hashCode = function hashCode() {
29380
28941
  return this._firstDayOfWeek.ordinal() * 7 + this._minimalDays;
29381
28942
  };
29382
-
29383
28943
  _proto2.toString = function toString() {
29384
28944
  return "WeekFields[" + this._firstDayOfWeek + "," + this._minimalDays + "]";
29385
28945
  };
29386
-
29387
28946
  return WeekFields;
29388
28947
  }();
29389
28948
  function _init$2() {
@@ -29396,68 +28955,50 @@ function _init$2() {
29396
28955
  * @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
29397
28956
  */
29398
28957
  var StringBuilder = _.StringBuilder;
29399
-
29400
28958
  var WeekFieldsPrinterParser = function () {
29401
28959
  function WeekFieldsPrinterParser(letter, count) {
29402
28960
  this._letter = letter;
29403
28961
  this._count = count;
29404
28962
  }
29405
-
29406
28963
  var _proto = WeekFieldsPrinterParser.prototype;
29407
-
29408
28964
  _proto.print = function print(context, buf) {
29409
28965
  var weekFields = WeekFields.of(context.locale());
29410
-
29411
28966
  var pp = this._evaluate(weekFields);
29412
-
29413
28967
  return pp.print(context, buf);
29414
28968
  };
29415
-
29416
28969
  _proto.parse = function parse(context, text, position) {
29417
28970
  var weekFields = WeekFields.of(context.locale());
29418
-
29419
28971
  var pp = this._evaluate(weekFields);
29420
-
29421
28972
  return pp.parse(context, text, position);
29422
28973
  };
29423
-
29424
28974
  _proto._evaluate = function _evaluate(weekFields) {
29425
28975
  var pp = null;
29426
-
29427
28976
  switch (this._letter) {
29428
28977
  case 'e':
29429
28978
  pp = new DateTimeFormatterBuilder.NumberPrinterParser(weekFields.dayOfWeek(), this._count, 2, SignStyle.NOT_NEGATIVE);
29430
28979
  break;
29431
-
29432
28980
  case 'c':
29433
28981
  pp = new DateTimeFormatterBuilder.NumberPrinterParser(weekFields.dayOfWeek(), this._count, 2, SignStyle.NOT_NEGATIVE);
29434
28982
  break;
29435
-
29436
28983
  case 'w':
29437
28984
  pp = new DateTimeFormatterBuilder.NumberPrinterParser(weekFields.weekOfWeekBasedYear(), this._count, 2, SignStyle.NOT_NEGATIVE);
29438
28985
  break;
29439
-
29440
28986
  case 'W':
29441
28987
  pp = new DateTimeFormatterBuilder.NumberPrinterParser(weekFields.weekOfMonth(), 1, 2, SignStyle.NOT_NEGATIVE);
29442
28988
  break;
29443
-
29444
28989
  case 'Y':
29445
28990
  if (this._count === 2) {
29446
28991
  pp = new DateTimeFormatterBuilder.ReducedPrinterParser(weekFields.weekBasedYear(), 2, 2, 0, DateTimeFormatterBuilder.ReducedPrinterParser.BASE_DATE);
29447
28992
  } else {
29448
28993
  pp = new DateTimeFormatterBuilder.NumberPrinterParser(weekFields.weekBasedYear(), this._count, 19, this._count < 4 ? SignStyle.NORMAL : SignStyle.EXCEEDS_PAD, -1);
29449
28994
  }
29450
-
29451
28995
  break;
29452
28996
  }
29453
-
29454
28997
  return pp;
29455
28998
  };
29456
-
29457
28999
  _proto.toString = function toString() {
29458
29000
  var sb = new StringBuilder(30);
29459
29001
  sb.append('Localized(');
29460
-
29461
29002
  if (this._letter === 'Y') {
29462
29003
  if (this._count === 1) {
29463
29004
  sb.append('WeekBasedYear');
@@ -29474,31 +29015,24 @@ var WeekFieldsPrinterParser = function () {
29474
29015
  } else if (this._letter === 'W') {
29475
29016
  sb.append('WeekOfMonth');
29476
29017
  }
29477
-
29478
29018
  sb.append(',');
29479
29019
  sb.append(this._count);
29480
29020
  }
29481
-
29482
29021
  sb.append(')');
29483
29022
  return sb.toString();
29484
29023
  };
29485
-
29486
29024
  return WeekFieldsPrinterParser;
29487
29025
  }();
29488
29026
 
29489
29027
  var _jodaInternal$assert = _.assert,
29490
- requireNonNull$1 = _jodaInternal$assert.requireNonNull,
29491
- requireInstance = _jodaInternal$assert.requireInstance;
29492
-
29028
+ requireNonNull$1 = _jodaInternal$assert.requireNonNull,
29029
+ requireInstance = _jodaInternal$assert.requireInstance;
29493
29030
  var CldrDateTimeFormatterBuilder = function (_DateTimeFormatterBui) {
29494
29031
  _inheritsLoose(CldrDateTimeFormatterBuilder, _DateTimeFormatterBui);
29495
-
29496
29032
  function CldrDateTimeFormatterBuilder() {
29497
29033
  return _DateTimeFormatterBui.apply(this, arguments) || this;
29498
29034
  }
29499
-
29500
29035
  var _proto = CldrDateTimeFormatterBuilder.prototype;
29501
-
29502
29036
  _proto.appendText = function appendText(field, styleOrMap) {
29503
29037
  if (styleOrMap === undefined) {
29504
29038
  return this.appendTextField(field);
@@ -29508,29 +29042,22 @@ var CldrDateTimeFormatterBuilder = function (_DateTimeFormatterBui) {
29508
29042
  return this.appendTextFieldMap(field, styleOrMap);
29509
29043
  }
29510
29044
  };
29511
-
29512
29045
  _proto.appendTextField = function appendTextField(field) {
29513
29046
  return this.appendTextFieldStyle(field, TextStyle.FULL);
29514
29047
  };
29515
-
29516
29048
  _proto.appendTextFieldStyle = function appendTextFieldStyle(field, textStyle) {
29517
29049
  requireNonNull$1(field, 'field');
29518
29050
  requireInstance(field, TemporalField, 'field');
29519
29051
  requireNonNull$1(textStyle, 'textStyle');
29520
29052
  requireInstance(textStyle, TextStyle, 'textStyle');
29521
-
29522
29053
  this._appendInternal(new TextPrinterParser(field, textStyle, new CldrDateTimeTextProvider()));
29523
-
29524
29054
  return this;
29525
29055
  };
29526
-
29527
29056
  _proto.appendTextFieldMap = function appendTextFieldMap(field, textLookup) {
29528
29057
  requireNonNull$1(field, 'field');
29529
29058
  requireInstance(field, ChronoField, 'field');
29530
29059
  requireNonNull$1(textLookup, 'textLookup');
29531
-
29532
29060
  var copy = _extends({}, textLookup);
29533
-
29534
29061
  var map = {};
29535
29062
  map[TextStyle.FULL] = copy;
29536
29063
  var store = new LocaleStore(map);
@@ -29542,39 +29069,27 @@ var CldrDateTimeFormatterBuilder = function (_DateTimeFormatterBui) {
29542
29069
  return store.getTextIterator(style);
29543
29070
  }
29544
29071
  };
29545
-
29546
29072
  this._appendInternal(new TextPrinterParser(field, TextStyle.FULL, provider));
29547
-
29548
29073
  return this;
29549
29074
  };
29550
-
29551
29075
  _proto.appendWeekField = function appendWeekField(field, count) {
29552
29076
  requireNonNull$1(field, 'field');
29553
29077
  requireNonNull$1(count, 'count');
29554
-
29555
29078
  this._appendInternal(new WeekFieldsPrinterParser(field, count));
29556
-
29557
29079
  return this;
29558
29080
  };
29559
-
29560
29081
  _proto.appendZoneText = function appendZoneText(textStyle) {
29561
29082
  this._appendInternal(new CldrZoneTextPrinterParser(textStyle));
29562
-
29563
29083
  return this;
29564
29084
  };
29565
-
29566
29085
  _proto.appendLocalizedOffset = function appendLocalizedOffset(textStyle) {
29567
29086
  requireNonNull$1(textStyle, 'textStyle');
29568
-
29569
29087
  if (textStyle !== TextStyle.FULL && textStyle !== TextStyle.SHORT) {
29570
29088
  throw new IllegalArgumentException('Style must be either full or short');
29571
29089
  }
29572
-
29573
29090
  this._appendInternal(new LocalizedOffsetPrinterParser(textStyle));
29574
-
29575
29091
  return this;
29576
29092
  };
29577
-
29578
29093
  return CldrDateTimeFormatterBuilder;
29579
29094
  }(DateTimeFormatterBuilder);
29580
29095
 
@@ -29582,64 +29097,50 @@ var CldrDateTimeFormatterBuilder = function (_DateTimeFormatterBui) {
29582
29097
  * @copyright (c) 2017, Philipp Thuerwaechter & Pattrick Hueper
29583
29098
  * @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
29584
29099
  */
29585
-
29586
29100
  var Locale = function () {
29587
29101
  Locale.getAvailableLocales = function getAvailableLocales() {
29588
29102
  return new CldrDateTimeTextProvider().getAvailableLocales();
29589
29103
  };
29590
-
29591
29104
  function Locale(language, country, localeString) {
29592
29105
  if (country === void 0) {
29593
29106
  country = '';
29594
29107
  }
29595
-
29596
29108
  if (localeString === void 0) {
29597
29109
  localeString = '';
29598
29110
  }
29599
-
29600
29111
  this._language = language;
29601
29112
  this._country = country;
29602
29113
  this._localeString = localeString;
29603
29114
  }
29604
-
29605
29115
  var _proto = Locale.prototype;
29606
-
29607
29116
  _proto.language = function language() {
29608
29117
  return this._language;
29609
29118
  };
29610
-
29611
29119
  _proto.country = function country() {
29612
29120
  return this._country;
29613
29121
  };
29614
-
29615
29122
  _proto.localeString = function localeString() {
29616
29123
  if (this._localeString.length > 0) {
29617
29124
  return this._localeString;
29618
29125
  }
29619
-
29620
29126
  if (this._country.length > 0) {
29621
29127
  return this._language + "-" + this._country;
29622
29128
  } else {
29623
29129
  return this._language;
29624
29130
  }
29625
29131
  };
29626
-
29627
29132
  _proto.toString = function toString() {
29628
29133
  return "Locale[" + this.localeString() + "]";
29629
29134
  };
29630
-
29631
29135
  _proto.equals = function equals(other) {
29632
29136
  if (!other) {
29633
29137
  return false;
29634
29138
  }
29635
-
29636
29139
  if (!(other instanceof Locale)) {
29637
29140
  return false;
29638
29141
  }
29639
-
29640
29142
  return this.localeString() === other.localeString();
29641
29143
  };
29642
-
29643
29144
  return Locale;
29644
29145
  }();
29645
29146
  function _init$1() {
@@ -29665,26 +29166,19 @@ function _init$1() {
29665
29166
  }
29666
29167
 
29667
29168
  var requireNonNull = _.assert.requireNonNull;
29668
-
29669
29169
  var LocaleDateTimeFormatter = function (_DateTimeFormatter) {
29670
29170
  _inheritsLoose(LocaleDateTimeFormatter, _DateTimeFormatter);
29671
-
29672
29171
  function LocaleDateTimeFormatter() {
29673
29172
  return _DateTimeFormatter.apply(this, arguments) || this;
29674
29173
  }
29675
-
29676
29174
  var _proto = LocaleDateTimeFormatter.prototype;
29677
-
29678
29175
  _proto.withLocale = function withLocale(locale) {
29679
29176
  requireNonNull(locale, 'locale');
29680
-
29681
29177
  if (locale.equals(this._locale)) {
29682
29178
  return this;
29683
29179
  }
29684
-
29685
29180
  return new DateTimeFormatter(this._printerParser, locale, this._decimalStyle, this._resolverStyle, this._resolverFields, this._chrono, this._zone);
29686
29181
  };
29687
-
29688
29182
  return LocaleDateTimeFormatter;
29689
29183
  }(DateTimeFormatter);
29690
29184
  function _init() {
@@ -29719,24 +29213,17 @@ function _init() {
29719
29213
  * @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
29720
29214
  */
29721
29215
  var isInit = false;
29722
-
29723
29216
  function init() {
29724
29217
  if (isInit) {
29725
29218
  return;
29726
29219
  }
29727
-
29728
29220
  isInit = true;
29729
29221
  _init$1();
29730
29222
  _init$2();
29731
29223
  _init();
29732
29224
  }
29733
-
29734
29225
  init();
29735
29226
 
29736
- /*
29737
- * @copyright (c) 2017, Philipp Thuerwaechter & Pattrick Hueper
29738
- * @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
29739
- */
29740
29227
  function plug (jsJoda) {
29741
29228
  Object.getOwnPropertyNames(CldrDateTimeFormatterBuilder.prototype).forEach(function (prop) {
29742
29229
  if (prop !== 'constructor') {