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