@everymatrix/gamification-dropdown 0.1.0

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.
Files changed (71) hide show
  1. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  2. package/dist/cjs/gamification-dropdown-b0044320.js +173 -0
  3. package/dist/cjs/gamification-dropdown.cjs.js +25 -0
  4. package/dist/cjs/gamification-dropdown_4.cjs.entry.js +559 -0
  5. package/dist/cjs/index-1c31b1d6.js +1675 -0
  6. package/dist/cjs/index.cjs.js +10 -0
  7. package/dist/cjs/loader.cjs.js +15 -0
  8. package/dist/cjs/player-elevate-card-items-77750a62.js +2364 -0
  9. package/dist/cjs/player-elevate-card.cjs.entry.js +74 -0
  10. package/dist/cjs/player-elevate-pointcard.cjs.entry.js +76 -0
  11. package/dist/collection/collection-manifest.json +28 -0
  12. package/dist/collection/components/gamification-dropdown/gamification-dropdown.css +57 -0
  13. package/dist/collection/components/gamification-dropdown/gamification-dropdown.js +256 -0
  14. package/dist/collection/components/gamification-dropdown/index.js +1 -0
  15. package/dist/collection/index.js +1 -0
  16. package/dist/collection/utils/locale.utils.js +42 -0
  17. package/dist/collection/utils/utils.js +3 -0
  18. package/dist/esm/app-globals-0f993ce5.js +3 -0
  19. package/dist/esm/gamification-dropdown-498ae904.js +171 -0
  20. package/dist/esm/gamification-dropdown.js +20 -0
  21. package/dist/esm/gamification-dropdown_4.entry.js +552 -0
  22. package/dist/esm/index-0ad2daf0.js +1645 -0
  23. package/dist/esm/index.js +2 -0
  24. package/dist/esm/loader.js +11 -0
  25. package/dist/esm/player-elevate-card-items-50dbfe39.js +2351 -0
  26. package/dist/esm/player-elevate-card.entry.js +70 -0
  27. package/dist/esm/player-elevate-pointcard.entry.js +72 -0
  28. package/dist/gamification-dropdown/gamification-dropdown.esm.js +1 -0
  29. package/dist/gamification-dropdown/index.esm.js +1 -0
  30. package/dist/gamification-dropdown/p-09730cb4.entry.js +1 -0
  31. package/dist/gamification-dropdown/p-58a784a0.js +1 -0
  32. package/dist/gamification-dropdown/p-72844c24.js +1 -0
  33. package/dist/gamification-dropdown/p-95a21693.js +2 -0
  34. package/dist/gamification-dropdown/p-be2f5b0a.entry.js +1 -0
  35. package/dist/gamification-dropdown/p-d1603dd0.entry.js +1 -0
  36. package/dist/gamification-dropdown/p-e1255160.js +1 -0
  37. package/dist/index.cjs.js +1 -0
  38. package/dist/index.js +1 -0
  39. package/dist/static/button-default.svg +42 -0
  40. package/dist/static/button-disabled.svg +4 -0
  41. package/dist/static/button-hover.svg +4 -0
  42. package/dist/static/button-level.svg +27 -0
  43. package/dist/static/button-pressed.svg +18 -0
  44. package/dist/static/button-redeem.svg +36 -0
  45. package/dist/static/card-ground-over.png +0 -0
  46. package/dist/static/card-ground-over.svg +903 -0
  47. package/dist/static/card-ground.png +0 -0
  48. package/dist/static/card-ground.svg +34 -0
  49. package/dist/static/info.svg +4 -0
  50. package/dist/static/level-badge.png +0 -0
  51. package/dist/static/level-percent.svg +80 -0
  52. package/dist/static/tips-info.svg +21 -0
  53. package/dist/static/user.svg +3 -0
  54. package/dist/stencil.config.dev.js +15 -0
  55. package/dist/stencil.config.js +17 -0
  56. package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/gamification-dropdown/.stencil/packages/stencil/gamification-dropdown/stencil.config.d.ts +2 -0
  57. package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/gamification-dropdown/.stencil/packages/stencil/gamification-dropdown/stencil.config.dev.d.ts +2 -0
  58. package/dist/types/components/gamification-dropdown/gamification-dropdown.d.ts +43 -0
  59. package/dist/types/components/gamification-dropdown/index.d.ts +1 -0
  60. package/dist/types/components.d.ts +85 -0
  61. package/dist/types/index.d.ts +1 -0
  62. package/dist/types/stencil-public-runtime.d.ts +1674 -0
  63. package/dist/types/utils/locale.utils.d.ts +2 -0
  64. package/dist/types/utils/utils.d.ts +1 -0
  65. package/loader/cdn.js +1 -0
  66. package/loader/index.cjs.js +1 -0
  67. package/loader/index.d.ts +24 -0
  68. package/loader/index.es2017.js +1 -0
  69. package/loader/index.js +2 -0
  70. package/loader/package.json +11 -0
  71. package/package.json +29 -0
@@ -0,0 +1,2364 @@
1
+ 'use strict';
2
+
3
+ const index = require('./index-1c31b1d6.js');
4
+
5
+ function _typeof(o) {
6
+ "@babel/helpers - typeof";
7
+
8
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
9
+ return typeof o;
10
+ } : function (o) {
11
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
12
+ }, _typeof(o);
13
+ }
14
+
15
+ function toInteger(dirtyNumber) {
16
+ if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
17
+ return NaN;
18
+ }
19
+ var number = Number(dirtyNumber);
20
+ if (isNaN(number)) {
21
+ return number;
22
+ }
23
+ return number < 0 ? Math.ceil(number) : Math.floor(number);
24
+ }
25
+
26
+ function requiredArgs(required, args) {
27
+ if (args.length < required) {
28
+ throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');
29
+ }
30
+ }
31
+
32
+ /**
33
+ * @name toDate
34
+ * @category Common Helpers
35
+ * @summary Convert the given argument to an instance of Date.
36
+ *
37
+ * @description
38
+ * Convert the given argument to an instance of Date.
39
+ *
40
+ * If the argument is an instance of Date, the function returns its clone.
41
+ *
42
+ * If the argument is a number, it is treated as a timestamp.
43
+ *
44
+ * If the argument is none of the above, the function returns Invalid Date.
45
+ *
46
+ * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
47
+ *
48
+ * @param {Date|Number} argument - the value to convert
49
+ * @returns {Date} the parsed date in the local time zone
50
+ * @throws {TypeError} 1 argument required
51
+ *
52
+ * @example
53
+ * // Clone the date:
54
+ * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
55
+ * //=> Tue Feb 11 2014 11:30:30
56
+ *
57
+ * @example
58
+ * // Convert the timestamp to date:
59
+ * const result = toDate(1392098430000)
60
+ * //=> Tue Feb 11 2014 11:30:30
61
+ */
62
+ function toDate(argument) {
63
+ requiredArgs(1, arguments);
64
+ var argStr = Object.prototype.toString.call(argument);
65
+
66
+ // Clone the date
67
+ if (argument instanceof Date || _typeof(argument) === 'object' && argStr === '[object Date]') {
68
+ // Prevent the date to lose the milliseconds when passed to new Date() in IE10
69
+ return new Date(argument.getTime());
70
+ } else if (typeof argument === 'number' || argStr === '[object Number]') {
71
+ return new Date(argument);
72
+ } else {
73
+ if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
74
+ // eslint-disable-next-line no-console
75
+ console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments");
76
+ // eslint-disable-next-line no-console
77
+ console.warn(new Error().stack);
78
+ }
79
+ return new Date(NaN);
80
+ }
81
+ }
82
+
83
+ /**
84
+ * @name addMilliseconds
85
+ * @category Millisecond Helpers
86
+ * @summary Add the specified number of milliseconds to the given date.
87
+ *
88
+ * @description
89
+ * Add the specified number of milliseconds to the given date.
90
+ *
91
+ * @param {Date|Number} date - the date to be changed
92
+ * @param {Number} amount - the amount of milliseconds to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
93
+ * @returns {Date} the new date with the milliseconds added
94
+ * @throws {TypeError} 2 arguments required
95
+ *
96
+ * @example
97
+ * // Add 750 milliseconds to 10 July 2014 12:45:30.000:
98
+ * const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
99
+ * //=> Thu Jul 10 2014 12:45:30.750
100
+ */
101
+ function addMilliseconds(dirtyDate, dirtyAmount) {
102
+ requiredArgs(2, arguments);
103
+ var timestamp = toDate(dirtyDate).getTime();
104
+ var amount = toInteger(dirtyAmount);
105
+ return new Date(timestamp + amount);
106
+ }
107
+
108
+ var defaultOptions = {};
109
+ function getDefaultOptions() {
110
+ return defaultOptions;
111
+ }
112
+
113
+ /**
114
+ * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
115
+ * They usually appear for dates that denote time before the timezones were introduced
116
+ * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
117
+ * and GMT+01:00:00 after that date)
118
+ *
119
+ * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
120
+ * which would lead to incorrect calculations.
121
+ *
122
+ * This function returns the timezone offset in milliseconds that takes seconds in account.
123
+ */
124
+ function getTimezoneOffsetInMilliseconds(date) {
125
+ var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));
126
+ utcDate.setUTCFullYear(date.getFullYear());
127
+ return date.getTime() - utcDate.getTime();
128
+ }
129
+
130
+ /**
131
+ * @name isDate
132
+ * @category Common Helpers
133
+ * @summary Is the given value a date?
134
+ *
135
+ * @description
136
+ * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.
137
+ *
138
+ * @param {*} value - the value to check
139
+ * @returns {boolean} true if the given value is a date
140
+ * @throws {TypeError} 1 arguments required
141
+ *
142
+ * @example
143
+ * // For a valid date:
144
+ * const result = isDate(new Date())
145
+ * //=> true
146
+ *
147
+ * @example
148
+ * // For an invalid date:
149
+ * const result = isDate(new Date(NaN))
150
+ * //=> true
151
+ *
152
+ * @example
153
+ * // For some value:
154
+ * const result = isDate('2014-02-31')
155
+ * //=> false
156
+ *
157
+ * @example
158
+ * // For an object:
159
+ * const result = isDate({})
160
+ * //=> false
161
+ */
162
+ function isDate(value) {
163
+ requiredArgs(1, arguments);
164
+ return value instanceof Date || _typeof(value) === 'object' && Object.prototype.toString.call(value) === '[object Date]';
165
+ }
166
+
167
+ /**
168
+ * @name isValid
169
+ * @category Common Helpers
170
+ * @summary Is the given date valid?
171
+ *
172
+ * @description
173
+ * Returns false if argument is Invalid Date and true otherwise.
174
+ * Argument is converted to Date using `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate}
175
+ * Invalid Date is a Date, whose time value is NaN.
176
+ *
177
+ * Time value of Date: http://es5.github.io/#x15.9.1.1
178
+ *
179
+ * @param {*} date - the date to check
180
+ * @returns {Boolean} the date is valid
181
+ * @throws {TypeError} 1 argument required
182
+ *
183
+ * @example
184
+ * // For the valid date:
185
+ * const result = isValid(new Date(2014, 1, 31))
186
+ * //=> true
187
+ *
188
+ * @example
189
+ * // For the value, convertable into a date:
190
+ * const result = isValid(1393804800000)
191
+ * //=> true
192
+ *
193
+ * @example
194
+ * // For the invalid date:
195
+ * const result = isValid(new Date(''))
196
+ * //=> false
197
+ */
198
+ function isValid(dirtyDate) {
199
+ requiredArgs(1, arguments);
200
+ if (!isDate(dirtyDate) && typeof dirtyDate !== 'number') {
201
+ return false;
202
+ }
203
+ var date = toDate(dirtyDate);
204
+ return !isNaN(Number(date));
205
+ }
206
+
207
+ /**
208
+ * @name subMilliseconds
209
+ * @category Millisecond Helpers
210
+ * @summary Subtract the specified number of milliseconds from the given date.
211
+ *
212
+ * @description
213
+ * Subtract the specified number of milliseconds from the given date.
214
+ *
215
+ * @param {Date|Number} date - the date to be changed
216
+ * @param {Number} amount - the amount of milliseconds to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
217
+ * @returns {Date} the new date with the milliseconds subtracted
218
+ * @throws {TypeError} 2 arguments required
219
+ *
220
+ * @example
221
+ * // Subtract 750 milliseconds from 10 July 2014 12:45:30.000:
222
+ * const result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
223
+ * //=> Thu Jul 10 2014 12:45:29.250
224
+ */
225
+ function subMilliseconds(dirtyDate, dirtyAmount) {
226
+ requiredArgs(2, arguments);
227
+ var amount = toInteger(dirtyAmount);
228
+ return addMilliseconds(dirtyDate, -amount);
229
+ }
230
+
231
+ var MILLISECONDS_IN_DAY = 86400000;
232
+ function getUTCDayOfYear(dirtyDate) {
233
+ requiredArgs(1, arguments);
234
+ var date = toDate(dirtyDate);
235
+ var timestamp = date.getTime();
236
+ date.setUTCMonth(0, 1);
237
+ date.setUTCHours(0, 0, 0, 0);
238
+ var startOfYearTimestamp = date.getTime();
239
+ var difference = timestamp - startOfYearTimestamp;
240
+ return Math.floor(difference / MILLISECONDS_IN_DAY) + 1;
241
+ }
242
+
243
+ function startOfUTCISOWeek(dirtyDate) {
244
+ requiredArgs(1, arguments);
245
+ var weekStartsOn = 1;
246
+ var date = toDate(dirtyDate);
247
+ var day = date.getUTCDay();
248
+ var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
249
+ date.setUTCDate(date.getUTCDate() - diff);
250
+ date.setUTCHours(0, 0, 0, 0);
251
+ return date;
252
+ }
253
+
254
+ function getUTCISOWeekYear(dirtyDate) {
255
+ requiredArgs(1, arguments);
256
+ var date = toDate(dirtyDate);
257
+ var year = date.getUTCFullYear();
258
+ var fourthOfJanuaryOfNextYear = new Date(0);
259
+ fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4);
260
+ fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0);
261
+ var startOfNextYear = startOfUTCISOWeek(fourthOfJanuaryOfNextYear);
262
+ var fourthOfJanuaryOfThisYear = new Date(0);
263
+ fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4);
264
+ fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0);
265
+ var startOfThisYear = startOfUTCISOWeek(fourthOfJanuaryOfThisYear);
266
+ if (date.getTime() >= startOfNextYear.getTime()) {
267
+ return year + 1;
268
+ } else if (date.getTime() >= startOfThisYear.getTime()) {
269
+ return year;
270
+ } else {
271
+ return year - 1;
272
+ }
273
+ }
274
+
275
+ function startOfUTCISOWeekYear(dirtyDate) {
276
+ requiredArgs(1, arguments);
277
+ var year = getUTCISOWeekYear(dirtyDate);
278
+ var fourthOfJanuary = new Date(0);
279
+ fourthOfJanuary.setUTCFullYear(year, 0, 4);
280
+ fourthOfJanuary.setUTCHours(0, 0, 0, 0);
281
+ var date = startOfUTCISOWeek(fourthOfJanuary);
282
+ return date;
283
+ }
284
+
285
+ var MILLISECONDS_IN_WEEK$1 = 604800000;
286
+ function getUTCISOWeek(dirtyDate) {
287
+ requiredArgs(1, arguments);
288
+ var date = toDate(dirtyDate);
289
+ var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime();
290
+
291
+ // Round the number of days to the nearest integer
292
+ // because the number of milliseconds in a week is not constant
293
+ // (e.g. it's different in the week of the daylight saving time clock shift)
294
+ return Math.round(diff / MILLISECONDS_IN_WEEK$1) + 1;
295
+ }
296
+
297
+ function startOfUTCWeek(dirtyDate, options) {
298
+ var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
299
+ requiredArgs(1, arguments);
300
+ var defaultOptions = getDefaultOptions();
301
+ var weekStartsOn = toInteger((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0);
302
+
303
+ // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
304
+ if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
305
+ throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
306
+ }
307
+ var date = toDate(dirtyDate);
308
+ var day = date.getUTCDay();
309
+ var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
310
+ date.setUTCDate(date.getUTCDate() - diff);
311
+ date.setUTCHours(0, 0, 0, 0);
312
+ return date;
313
+ }
314
+
315
+ function getUTCWeekYear(dirtyDate, options) {
316
+ var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
317
+ requiredArgs(1, arguments);
318
+ var date = toDate(dirtyDate);
319
+ var year = date.getUTCFullYear();
320
+ var defaultOptions = getDefaultOptions();
321
+ var firstWeekContainsDate = toInteger((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1);
322
+
323
+ // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
324
+ if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
325
+ throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
326
+ }
327
+ var firstWeekOfNextYear = new Date(0);
328
+ firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);
329
+ firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);
330
+ var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear, options);
331
+ var firstWeekOfThisYear = new Date(0);
332
+ firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);
333
+ firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);
334
+ var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, options);
335
+ if (date.getTime() >= startOfNextYear.getTime()) {
336
+ return year + 1;
337
+ } else if (date.getTime() >= startOfThisYear.getTime()) {
338
+ return year;
339
+ } else {
340
+ return year - 1;
341
+ }
342
+ }
343
+
344
+ function startOfUTCWeekYear(dirtyDate, options) {
345
+ var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
346
+ requiredArgs(1, arguments);
347
+ var defaultOptions = getDefaultOptions();
348
+ var firstWeekContainsDate = toInteger((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1);
349
+ var year = getUTCWeekYear(dirtyDate, options);
350
+ var firstWeek = new Date(0);
351
+ firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate);
352
+ firstWeek.setUTCHours(0, 0, 0, 0);
353
+ var date = startOfUTCWeek(firstWeek, options);
354
+ return date;
355
+ }
356
+
357
+ var MILLISECONDS_IN_WEEK = 604800000;
358
+ function getUTCWeek(dirtyDate, options) {
359
+ requiredArgs(1, arguments);
360
+ var date = toDate(dirtyDate);
361
+ var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime();
362
+
363
+ // Round the number of days to the nearest integer
364
+ // because the number of milliseconds in a week is not constant
365
+ // (e.g. it's different in the week of the daylight saving time clock shift)
366
+ return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;
367
+ }
368
+
369
+ function addLeadingZeros(number, targetLength) {
370
+ var sign = number < 0 ? '-' : '';
371
+ var output = Math.abs(number).toString();
372
+ while (output.length < targetLength) {
373
+ output = '0' + output;
374
+ }
375
+ return sign + output;
376
+ }
377
+
378
+ /*
379
+ * | | Unit | | Unit |
380
+ * |-----|--------------------------------|-----|--------------------------------|
381
+ * | a | AM, PM | A* | |
382
+ * | d | Day of month | D | |
383
+ * | h | Hour [1-12] | H | Hour [0-23] |
384
+ * | m | Minute | M | Month |
385
+ * | s | Second | S | Fraction of second |
386
+ * | y | Year (abs) | Y | |
387
+ *
388
+ * Letters marked by * are not implemented but reserved by Unicode standard.
389
+ */
390
+ var formatters$2 = {
391
+ // Year
392
+ y: function y(date, token) {
393
+ // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens
394
+ // | Year | y | yy | yyy | yyyy | yyyyy |
395
+ // |----------|-------|----|-------|-------|-------|
396
+ // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
397
+ // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
398
+ // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
399
+ // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
400
+ // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
401
+
402
+ var signedYear = date.getUTCFullYear();
403
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
404
+ var year = signedYear > 0 ? signedYear : 1 - signedYear;
405
+ return addLeadingZeros(token === 'yy' ? year % 100 : year, token.length);
406
+ },
407
+ // Month
408
+ M: function M(date, token) {
409
+ var month = date.getUTCMonth();
410
+ return token === 'M' ? String(month + 1) : addLeadingZeros(month + 1, 2);
411
+ },
412
+ // Day of the month
413
+ d: function d(date, token) {
414
+ return addLeadingZeros(date.getUTCDate(), token.length);
415
+ },
416
+ // AM or PM
417
+ a: function a(date, token) {
418
+ var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? 'pm' : 'am';
419
+ switch (token) {
420
+ case 'a':
421
+ case 'aa':
422
+ return dayPeriodEnumValue.toUpperCase();
423
+ case 'aaa':
424
+ return dayPeriodEnumValue;
425
+ case 'aaaaa':
426
+ return dayPeriodEnumValue[0];
427
+ case 'aaaa':
428
+ default:
429
+ return dayPeriodEnumValue === 'am' ? 'a.m.' : 'p.m.';
430
+ }
431
+ },
432
+ // Hour [1-12]
433
+ h: function h(date, token) {
434
+ return addLeadingZeros(date.getUTCHours() % 12 || 12, token.length);
435
+ },
436
+ // Hour [0-23]
437
+ H: function H(date, token) {
438
+ return addLeadingZeros(date.getUTCHours(), token.length);
439
+ },
440
+ // Minute
441
+ m: function m(date, token) {
442
+ return addLeadingZeros(date.getUTCMinutes(), token.length);
443
+ },
444
+ // Second
445
+ s: function s(date, token) {
446
+ return addLeadingZeros(date.getUTCSeconds(), token.length);
447
+ },
448
+ // Fraction of second
449
+ S: function S(date, token) {
450
+ var numberOfDigits = token.length;
451
+ var milliseconds = date.getUTCMilliseconds();
452
+ var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3));
453
+ return addLeadingZeros(fractionalSeconds, token.length);
454
+ }
455
+ };
456
+ const formatters$3 = formatters$2;
457
+
458
+ var dayPeriodEnum = {
459
+ am: 'am',
460
+ pm: 'pm',
461
+ midnight: 'midnight',
462
+ noon: 'noon',
463
+ morning: 'morning',
464
+ afternoon: 'afternoon',
465
+ evening: 'evening',
466
+ night: 'night'
467
+ };
468
+ /*
469
+ * | | Unit | | Unit |
470
+ * |-----|--------------------------------|-----|--------------------------------|
471
+ * | a | AM, PM | A* | Milliseconds in day |
472
+ * | b | AM, PM, noon, midnight | B | Flexible day period |
473
+ * | c | Stand-alone local day of week | C* | Localized hour w/ day period |
474
+ * | d | Day of month | D | Day of year |
475
+ * | e | Local day of week | E | Day of week |
476
+ * | f | | F* | Day of week in month |
477
+ * | g* | Modified Julian day | G | Era |
478
+ * | h | Hour [1-12] | H | Hour [0-23] |
479
+ * | i! | ISO day of week | I! | ISO week of year |
480
+ * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
481
+ * | k | Hour [1-24] | K | Hour [0-11] |
482
+ * | l* | (deprecated) | L | Stand-alone month |
483
+ * | m | Minute | M | Month |
484
+ * | n | | N | |
485
+ * | o! | Ordinal number modifier | O | Timezone (GMT) |
486
+ * | p! | Long localized time | P! | Long localized date |
487
+ * | q | Stand-alone quarter | Q | Quarter |
488
+ * | r* | Related Gregorian year | R! | ISO week-numbering year |
489
+ * | s | Second | S | Fraction of second |
490
+ * | t! | Seconds timestamp | T! | Milliseconds timestamp |
491
+ * | u | Extended year | U* | Cyclic year |
492
+ * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
493
+ * | w | Local week of year | W* | Week of month |
494
+ * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
495
+ * | y | Year (abs) | Y | Local week-numbering year |
496
+ * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
497
+ *
498
+ * Letters marked by * are not implemented but reserved by Unicode standard.
499
+ *
500
+ * Letters marked by ! are non-standard, but implemented by date-fns:
501
+ * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)
502
+ * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
503
+ * i.e. 7 for Sunday, 1 for Monday, etc.
504
+ * - `I` is ISO week of year, as opposed to `w` which is local week of year.
505
+ * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
506
+ * `R` is supposed to be used in conjunction with `I` and `i`
507
+ * for universal ISO week-numbering date, whereas
508
+ * `Y` is supposed to be used in conjunction with `w` and `e`
509
+ * for week-numbering date specific to the locale.
510
+ * - `P` is long localized date format
511
+ * - `p` is long localized time format
512
+ */
513
+
514
+ var formatters = {
515
+ // Era
516
+ G: function G(date, token, localize) {
517
+ var era = date.getUTCFullYear() > 0 ? 1 : 0;
518
+ switch (token) {
519
+ // AD, BC
520
+ case 'G':
521
+ case 'GG':
522
+ case 'GGG':
523
+ return localize.era(era, {
524
+ width: 'abbreviated'
525
+ });
526
+ // A, B
527
+ case 'GGGGG':
528
+ return localize.era(era, {
529
+ width: 'narrow'
530
+ });
531
+ // Anno Domini, Before Christ
532
+ case 'GGGG':
533
+ default:
534
+ return localize.era(era, {
535
+ width: 'wide'
536
+ });
537
+ }
538
+ },
539
+ // Year
540
+ y: function y(date, token, localize) {
541
+ // Ordinal number
542
+ if (token === 'yo') {
543
+ var signedYear = date.getUTCFullYear();
544
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
545
+ var year = signedYear > 0 ? signedYear : 1 - signedYear;
546
+ return localize.ordinalNumber(year, {
547
+ unit: 'year'
548
+ });
549
+ }
550
+ return formatters$3.y(date, token);
551
+ },
552
+ // Local week-numbering year
553
+ Y: function Y(date, token, localize, options) {
554
+ var signedWeekYear = getUTCWeekYear(date, options);
555
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
556
+ var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
557
+
558
+ // Two digit year
559
+ if (token === 'YY') {
560
+ var twoDigitYear = weekYear % 100;
561
+ return addLeadingZeros(twoDigitYear, 2);
562
+ }
563
+
564
+ // Ordinal number
565
+ if (token === 'Yo') {
566
+ return localize.ordinalNumber(weekYear, {
567
+ unit: 'year'
568
+ });
569
+ }
570
+
571
+ // Padding
572
+ return addLeadingZeros(weekYear, token.length);
573
+ },
574
+ // ISO week-numbering year
575
+ R: function R(date, token) {
576
+ var isoWeekYear = getUTCISOWeekYear(date);
577
+
578
+ // Padding
579
+ return addLeadingZeros(isoWeekYear, token.length);
580
+ },
581
+ // Extended year. This is a single number designating the year of this calendar system.
582
+ // The main difference between `y` and `u` localizers are B.C. years:
583
+ // | Year | `y` | `u` |
584
+ // |------|-----|-----|
585
+ // | AC 1 | 1 | 1 |
586
+ // | BC 1 | 1 | 0 |
587
+ // | BC 2 | 2 | -1 |
588
+ // Also `yy` always returns the last two digits of a year,
589
+ // while `uu` pads single digit years to 2 characters and returns other years unchanged.
590
+ u: function u(date, token) {
591
+ var year = date.getUTCFullYear();
592
+ return addLeadingZeros(year, token.length);
593
+ },
594
+ // Quarter
595
+ Q: function Q(date, token, localize) {
596
+ var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
597
+ switch (token) {
598
+ // 1, 2, 3, 4
599
+ case 'Q':
600
+ return String(quarter);
601
+ // 01, 02, 03, 04
602
+ case 'QQ':
603
+ return addLeadingZeros(quarter, 2);
604
+ // 1st, 2nd, 3rd, 4th
605
+ case 'Qo':
606
+ return localize.ordinalNumber(quarter, {
607
+ unit: 'quarter'
608
+ });
609
+ // Q1, Q2, Q3, Q4
610
+ case 'QQQ':
611
+ return localize.quarter(quarter, {
612
+ width: 'abbreviated',
613
+ context: 'formatting'
614
+ });
615
+ // 1, 2, 3, 4 (narrow quarter; could be not numerical)
616
+ case 'QQQQQ':
617
+ return localize.quarter(quarter, {
618
+ width: 'narrow',
619
+ context: 'formatting'
620
+ });
621
+ // 1st quarter, 2nd quarter, ...
622
+ case 'QQQQ':
623
+ default:
624
+ return localize.quarter(quarter, {
625
+ width: 'wide',
626
+ context: 'formatting'
627
+ });
628
+ }
629
+ },
630
+ // Stand-alone quarter
631
+ q: function q(date, token, localize) {
632
+ var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
633
+ switch (token) {
634
+ // 1, 2, 3, 4
635
+ case 'q':
636
+ return String(quarter);
637
+ // 01, 02, 03, 04
638
+ case 'qq':
639
+ return addLeadingZeros(quarter, 2);
640
+ // 1st, 2nd, 3rd, 4th
641
+ case 'qo':
642
+ return localize.ordinalNumber(quarter, {
643
+ unit: 'quarter'
644
+ });
645
+ // Q1, Q2, Q3, Q4
646
+ case 'qqq':
647
+ return localize.quarter(quarter, {
648
+ width: 'abbreviated',
649
+ context: 'standalone'
650
+ });
651
+ // 1, 2, 3, 4 (narrow quarter; could be not numerical)
652
+ case 'qqqqq':
653
+ return localize.quarter(quarter, {
654
+ width: 'narrow',
655
+ context: 'standalone'
656
+ });
657
+ // 1st quarter, 2nd quarter, ...
658
+ case 'qqqq':
659
+ default:
660
+ return localize.quarter(quarter, {
661
+ width: 'wide',
662
+ context: 'standalone'
663
+ });
664
+ }
665
+ },
666
+ // Month
667
+ M: function M(date, token, localize) {
668
+ var month = date.getUTCMonth();
669
+ switch (token) {
670
+ case 'M':
671
+ case 'MM':
672
+ return formatters$3.M(date, token);
673
+ // 1st, 2nd, ..., 12th
674
+ case 'Mo':
675
+ return localize.ordinalNumber(month + 1, {
676
+ unit: 'month'
677
+ });
678
+ // Jan, Feb, ..., Dec
679
+ case 'MMM':
680
+ return localize.month(month, {
681
+ width: 'abbreviated',
682
+ context: 'formatting'
683
+ });
684
+ // J, F, ..., D
685
+ case 'MMMMM':
686
+ return localize.month(month, {
687
+ width: 'narrow',
688
+ context: 'formatting'
689
+ });
690
+ // January, February, ..., December
691
+ case 'MMMM':
692
+ default:
693
+ return localize.month(month, {
694
+ width: 'wide',
695
+ context: 'formatting'
696
+ });
697
+ }
698
+ },
699
+ // Stand-alone month
700
+ L: function L(date, token, localize) {
701
+ var month = date.getUTCMonth();
702
+ switch (token) {
703
+ // 1, 2, ..., 12
704
+ case 'L':
705
+ return String(month + 1);
706
+ // 01, 02, ..., 12
707
+ case 'LL':
708
+ return addLeadingZeros(month + 1, 2);
709
+ // 1st, 2nd, ..., 12th
710
+ case 'Lo':
711
+ return localize.ordinalNumber(month + 1, {
712
+ unit: 'month'
713
+ });
714
+ // Jan, Feb, ..., Dec
715
+ case 'LLL':
716
+ return localize.month(month, {
717
+ width: 'abbreviated',
718
+ context: 'standalone'
719
+ });
720
+ // J, F, ..., D
721
+ case 'LLLLL':
722
+ return localize.month(month, {
723
+ width: 'narrow',
724
+ context: 'standalone'
725
+ });
726
+ // January, February, ..., December
727
+ case 'LLLL':
728
+ default:
729
+ return localize.month(month, {
730
+ width: 'wide',
731
+ context: 'standalone'
732
+ });
733
+ }
734
+ },
735
+ // Local week of year
736
+ w: function w(date, token, localize, options) {
737
+ var week = getUTCWeek(date, options);
738
+ if (token === 'wo') {
739
+ return localize.ordinalNumber(week, {
740
+ unit: 'week'
741
+ });
742
+ }
743
+ return addLeadingZeros(week, token.length);
744
+ },
745
+ // ISO week of year
746
+ I: function I(date, token, localize) {
747
+ var isoWeek = getUTCISOWeek(date);
748
+ if (token === 'Io') {
749
+ return localize.ordinalNumber(isoWeek, {
750
+ unit: 'week'
751
+ });
752
+ }
753
+ return addLeadingZeros(isoWeek, token.length);
754
+ },
755
+ // Day of the month
756
+ d: function d(date, token, localize) {
757
+ if (token === 'do') {
758
+ return localize.ordinalNumber(date.getUTCDate(), {
759
+ unit: 'date'
760
+ });
761
+ }
762
+ return formatters$3.d(date, token);
763
+ },
764
+ // Day of year
765
+ D: function D(date, token, localize) {
766
+ var dayOfYear = getUTCDayOfYear(date);
767
+ if (token === 'Do') {
768
+ return localize.ordinalNumber(dayOfYear, {
769
+ unit: 'dayOfYear'
770
+ });
771
+ }
772
+ return addLeadingZeros(dayOfYear, token.length);
773
+ },
774
+ // Day of week
775
+ E: function E(date, token, localize) {
776
+ var dayOfWeek = date.getUTCDay();
777
+ switch (token) {
778
+ // Tue
779
+ case 'E':
780
+ case 'EE':
781
+ case 'EEE':
782
+ return localize.day(dayOfWeek, {
783
+ width: 'abbreviated',
784
+ context: 'formatting'
785
+ });
786
+ // T
787
+ case 'EEEEE':
788
+ return localize.day(dayOfWeek, {
789
+ width: 'narrow',
790
+ context: 'formatting'
791
+ });
792
+ // Tu
793
+ case 'EEEEEE':
794
+ return localize.day(dayOfWeek, {
795
+ width: 'short',
796
+ context: 'formatting'
797
+ });
798
+ // Tuesday
799
+ case 'EEEE':
800
+ default:
801
+ return localize.day(dayOfWeek, {
802
+ width: 'wide',
803
+ context: 'formatting'
804
+ });
805
+ }
806
+ },
807
+ // Local day of week
808
+ e: function e(date, token, localize, options) {
809
+ var dayOfWeek = date.getUTCDay();
810
+ var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
811
+ switch (token) {
812
+ // Numerical value (Nth day of week with current locale or weekStartsOn)
813
+ case 'e':
814
+ return String(localDayOfWeek);
815
+ // Padded numerical value
816
+ case 'ee':
817
+ return addLeadingZeros(localDayOfWeek, 2);
818
+ // 1st, 2nd, ..., 7th
819
+ case 'eo':
820
+ return localize.ordinalNumber(localDayOfWeek, {
821
+ unit: 'day'
822
+ });
823
+ case 'eee':
824
+ return localize.day(dayOfWeek, {
825
+ width: 'abbreviated',
826
+ context: 'formatting'
827
+ });
828
+ // T
829
+ case 'eeeee':
830
+ return localize.day(dayOfWeek, {
831
+ width: 'narrow',
832
+ context: 'formatting'
833
+ });
834
+ // Tu
835
+ case 'eeeeee':
836
+ return localize.day(dayOfWeek, {
837
+ width: 'short',
838
+ context: 'formatting'
839
+ });
840
+ // Tuesday
841
+ case 'eeee':
842
+ default:
843
+ return localize.day(dayOfWeek, {
844
+ width: 'wide',
845
+ context: 'formatting'
846
+ });
847
+ }
848
+ },
849
+ // Stand-alone local day of week
850
+ c: function c(date, token, localize, options) {
851
+ var dayOfWeek = date.getUTCDay();
852
+ var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
853
+ switch (token) {
854
+ // Numerical value (same as in `e`)
855
+ case 'c':
856
+ return String(localDayOfWeek);
857
+ // Padded numerical value
858
+ case 'cc':
859
+ return addLeadingZeros(localDayOfWeek, token.length);
860
+ // 1st, 2nd, ..., 7th
861
+ case 'co':
862
+ return localize.ordinalNumber(localDayOfWeek, {
863
+ unit: 'day'
864
+ });
865
+ case 'ccc':
866
+ return localize.day(dayOfWeek, {
867
+ width: 'abbreviated',
868
+ context: 'standalone'
869
+ });
870
+ // T
871
+ case 'ccccc':
872
+ return localize.day(dayOfWeek, {
873
+ width: 'narrow',
874
+ context: 'standalone'
875
+ });
876
+ // Tu
877
+ case 'cccccc':
878
+ return localize.day(dayOfWeek, {
879
+ width: 'short',
880
+ context: 'standalone'
881
+ });
882
+ // Tuesday
883
+ case 'cccc':
884
+ default:
885
+ return localize.day(dayOfWeek, {
886
+ width: 'wide',
887
+ context: 'standalone'
888
+ });
889
+ }
890
+ },
891
+ // ISO day of week
892
+ i: function i(date, token, localize) {
893
+ var dayOfWeek = date.getUTCDay();
894
+ var isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
895
+ switch (token) {
896
+ // 2
897
+ case 'i':
898
+ return String(isoDayOfWeek);
899
+ // 02
900
+ case 'ii':
901
+ return addLeadingZeros(isoDayOfWeek, token.length);
902
+ // 2nd
903
+ case 'io':
904
+ return localize.ordinalNumber(isoDayOfWeek, {
905
+ unit: 'day'
906
+ });
907
+ // Tue
908
+ case 'iii':
909
+ return localize.day(dayOfWeek, {
910
+ width: 'abbreviated',
911
+ context: 'formatting'
912
+ });
913
+ // T
914
+ case 'iiiii':
915
+ return localize.day(dayOfWeek, {
916
+ width: 'narrow',
917
+ context: 'formatting'
918
+ });
919
+ // Tu
920
+ case 'iiiiii':
921
+ return localize.day(dayOfWeek, {
922
+ width: 'short',
923
+ context: 'formatting'
924
+ });
925
+ // Tuesday
926
+ case 'iiii':
927
+ default:
928
+ return localize.day(dayOfWeek, {
929
+ width: 'wide',
930
+ context: 'formatting'
931
+ });
932
+ }
933
+ },
934
+ // AM or PM
935
+ a: function a(date, token, localize) {
936
+ var hours = date.getUTCHours();
937
+ var dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
938
+ switch (token) {
939
+ case 'a':
940
+ case 'aa':
941
+ return localize.dayPeriod(dayPeriodEnumValue, {
942
+ width: 'abbreviated',
943
+ context: 'formatting'
944
+ });
945
+ case 'aaa':
946
+ return localize.dayPeriod(dayPeriodEnumValue, {
947
+ width: 'abbreviated',
948
+ context: 'formatting'
949
+ }).toLowerCase();
950
+ case 'aaaaa':
951
+ return localize.dayPeriod(dayPeriodEnumValue, {
952
+ width: 'narrow',
953
+ context: 'formatting'
954
+ });
955
+ case 'aaaa':
956
+ default:
957
+ return localize.dayPeriod(dayPeriodEnumValue, {
958
+ width: 'wide',
959
+ context: 'formatting'
960
+ });
961
+ }
962
+ },
963
+ // AM, PM, midnight, noon
964
+ b: function b(date, token, localize) {
965
+ var hours = date.getUTCHours();
966
+ var dayPeriodEnumValue;
967
+ if (hours === 12) {
968
+ dayPeriodEnumValue = dayPeriodEnum.noon;
969
+ } else if (hours === 0) {
970
+ dayPeriodEnumValue = dayPeriodEnum.midnight;
971
+ } else {
972
+ dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
973
+ }
974
+ switch (token) {
975
+ case 'b':
976
+ case 'bb':
977
+ return localize.dayPeriod(dayPeriodEnumValue, {
978
+ width: 'abbreviated',
979
+ context: 'formatting'
980
+ });
981
+ case 'bbb':
982
+ return localize.dayPeriod(dayPeriodEnumValue, {
983
+ width: 'abbreviated',
984
+ context: 'formatting'
985
+ }).toLowerCase();
986
+ case 'bbbbb':
987
+ return localize.dayPeriod(dayPeriodEnumValue, {
988
+ width: 'narrow',
989
+ context: 'formatting'
990
+ });
991
+ case 'bbbb':
992
+ default:
993
+ return localize.dayPeriod(dayPeriodEnumValue, {
994
+ width: 'wide',
995
+ context: 'formatting'
996
+ });
997
+ }
998
+ },
999
+ // in the morning, in the afternoon, in the evening, at night
1000
+ B: function B(date, token, localize) {
1001
+ var hours = date.getUTCHours();
1002
+ var dayPeriodEnumValue;
1003
+ if (hours >= 17) {
1004
+ dayPeriodEnumValue = dayPeriodEnum.evening;
1005
+ } else if (hours >= 12) {
1006
+ dayPeriodEnumValue = dayPeriodEnum.afternoon;
1007
+ } else if (hours >= 4) {
1008
+ dayPeriodEnumValue = dayPeriodEnum.morning;
1009
+ } else {
1010
+ dayPeriodEnumValue = dayPeriodEnum.night;
1011
+ }
1012
+ switch (token) {
1013
+ case 'B':
1014
+ case 'BB':
1015
+ case 'BBB':
1016
+ return localize.dayPeriod(dayPeriodEnumValue, {
1017
+ width: 'abbreviated',
1018
+ context: 'formatting'
1019
+ });
1020
+ case 'BBBBB':
1021
+ return localize.dayPeriod(dayPeriodEnumValue, {
1022
+ width: 'narrow',
1023
+ context: 'formatting'
1024
+ });
1025
+ case 'BBBB':
1026
+ default:
1027
+ return localize.dayPeriod(dayPeriodEnumValue, {
1028
+ width: 'wide',
1029
+ context: 'formatting'
1030
+ });
1031
+ }
1032
+ },
1033
+ // Hour [1-12]
1034
+ h: function h(date, token, localize) {
1035
+ if (token === 'ho') {
1036
+ var hours = date.getUTCHours() % 12;
1037
+ if (hours === 0) hours = 12;
1038
+ return localize.ordinalNumber(hours, {
1039
+ unit: 'hour'
1040
+ });
1041
+ }
1042
+ return formatters$3.h(date, token);
1043
+ },
1044
+ // Hour [0-23]
1045
+ H: function H(date, token, localize) {
1046
+ if (token === 'Ho') {
1047
+ return localize.ordinalNumber(date.getUTCHours(), {
1048
+ unit: 'hour'
1049
+ });
1050
+ }
1051
+ return formatters$3.H(date, token);
1052
+ },
1053
+ // Hour [0-11]
1054
+ K: function K(date, token, localize) {
1055
+ var hours = date.getUTCHours() % 12;
1056
+ if (token === 'Ko') {
1057
+ return localize.ordinalNumber(hours, {
1058
+ unit: 'hour'
1059
+ });
1060
+ }
1061
+ return addLeadingZeros(hours, token.length);
1062
+ },
1063
+ // Hour [1-24]
1064
+ k: function k(date, token, localize) {
1065
+ var hours = date.getUTCHours();
1066
+ if (hours === 0) hours = 24;
1067
+ if (token === 'ko') {
1068
+ return localize.ordinalNumber(hours, {
1069
+ unit: 'hour'
1070
+ });
1071
+ }
1072
+ return addLeadingZeros(hours, token.length);
1073
+ },
1074
+ // Minute
1075
+ m: function m(date, token, localize) {
1076
+ if (token === 'mo') {
1077
+ return localize.ordinalNumber(date.getUTCMinutes(), {
1078
+ unit: 'minute'
1079
+ });
1080
+ }
1081
+ return formatters$3.m(date, token);
1082
+ },
1083
+ // Second
1084
+ s: function s(date, token, localize) {
1085
+ if (token === 'so') {
1086
+ return localize.ordinalNumber(date.getUTCSeconds(), {
1087
+ unit: 'second'
1088
+ });
1089
+ }
1090
+ return formatters$3.s(date, token);
1091
+ },
1092
+ // Fraction of second
1093
+ S: function S(date, token) {
1094
+ return formatters$3.S(date, token);
1095
+ },
1096
+ // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
1097
+ X: function X(date, token, _localize, options) {
1098
+ var originalDate = options._originalDate || date;
1099
+ var timezoneOffset = originalDate.getTimezoneOffset();
1100
+ if (timezoneOffset === 0) {
1101
+ return 'Z';
1102
+ }
1103
+ switch (token) {
1104
+ // Hours and optional minutes
1105
+ case 'X':
1106
+ return formatTimezoneWithOptionalMinutes(timezoneOffset);
1107
+
1108
+ // Hours, minutes and optional seconds without `:` delimiter
1109
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1110
+ // so this token always has the same output as `XX`
1111
+ case 'XXXX':
1112
+ case 'XX':
1113
+ // Hours and minutes without `:` delimiter
1114
+ return formatTimezone(timezoneOffset);
1115
+
1116
+ // Hours, minutes and optional seconds with `:` delimiter
1117
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1118
+ // so this token always has the same output as `XXX`
1119
+ case 'XXXXX':
1120
+ case 'XXX': // Hours and minutes with `:` delimiter
1121
+ default:
1122
+ return formatTimezone(timezoneOffset, ':');
1123
+ }
1124
+ },
1125
+ // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
1126
+ x: function x(date, token, _localize, options) {
1127
+ var originalDate = options._originalDate || date;
1128
+ var timezoneOffset = originalDate.getTimezoneOffset();
1129
+ switch (token) {
1130
+ // Hours and optional minutes
1131
+ case 'x':
1132
+ return formatTimezoneWithOptionalMinutes(timezoneOffset);
1133
+
1134
+ // Hours, minutes and optional seconds without `:` delimiter
1135
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1136
+ // so this token always has the same output as `xx`
1137
+ case 'xxxx':
1138
+ case 'xx':
1139
+ // Hours and minutes without `:` delimiter
1140
+ return formatTimezone(timezoneOffset);
1141
+
1142
+ // Hours, minutes and optional seconds with `:` delimiter
1143
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1144
+ // so this token always has the same output as `xxx`
1145
+ case 'xxxxx':
1146
+ case 'xxx': // Hours and minutes with `:` delimiter
1147
+ default:
1148
+ return formatTimezone(timezoneOffset, ':');
1149
+ }
1150
+ },
1151
+ // Timezone (GMT)
1152
+ O: function O(date, token, _localize, options) {
1153
+ var originalDate = options._originalDate || date;
1154
+ var timezoneOffset = originalDate.getTimezoneOffset();
1155
+ switch (token) {
1156
+ // Short
1157
+ case 'O':
1158
+ case 'OO':
1159
+ case 'OOO':
1160
+ return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
1161
+ // Long
1162
+ case 'OOOO':
1163
+ default:
1164
+ return 'GMT' + formatTimezone(timezoneOffset, ':');
1165
+ }
1166
+ },
1167
+ // Timezone (specific non-location)
1168
+ z: function z(date, token, _localize, options) {
1169
+ var originalDate = options._originalDate || date;
1170
+ var timezoneOffset = originalDate.getTimezoneOffset();
1171
+ switch (token) {
1172
+ // Short
1173
+ case 'z':
1174
+ case 'zz':
1175
+ case 'zzz':
1176
+ return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
1177
+ // Long
1178
+ case 'zzzz':
1179
+ default:
1180
+ return 'GMT' + formatTimezone(timezoneOffset, ':');
1181
+ }
1182
+ },
1183
+ // Seconds timestamp
1184
+ t: function t(date, token, _localize, options) {
1185
+ var originalDate = options._originalDate || date;
1186
+ var timestamp = Math.floor(originalDate.getTime() / 1000);
1187
+ return addLeadingZeros(timestamp, token.length);
1188
+ },
1189
+ // Milliseconds timestamp
1190
+ T: function T(date, token, _localize, options) {
1191
+ var originalDate = options._originalDate || date;
1192
+ var timestamp = originalDate.getTime();
1193
+ return addLeadingZeros(timestamp, token.length);
1194
+ }
1195
+ };
1196
+ function formatTimezoneShort(offset, dirtyDelimiter) {
1197
+ var sign = offset > 0 ? '-' : '+';
1198
+ var absOffset = Math.abs(offset);
1199
+ var hours = Math.floor(absOffset / 60);
1200
+ var minutes = absOffset % 60;
1201
+ if (minutes === 0) {
1202
+ return sign + String(hours);
1203
+ }
1204
+ var delimiter = dirtyDelimiter || '';
1205
+ return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
1206
+ }
1207
+ function formatTimezoneWithOptionalMinutes(offset, dirtyDelimiter) {
1208
+ if (offset % 60 === 0) {
1209
+ var sign = offset > 0 ? '-' : '+';
1210
+ return sign + addLeadingZeros(Math.abs(offset) / 60, 2);
1211
+ }
1212
+ return formatTimezone(offset, dirtyDelimiter);
1213
+ }
1214
+ function formatTimezone(offset, dirtyDelimiter) {
1215
+ var delimiter = dirtyDelimiter || '';
1216
+ var sign = offset > 0 ? '-' : '+';
1217
+ var absOffset = Math.abs(offset);
1218
+ var hours = addLeadingZeros(Math.floor(absOffset / 60), 2);
1219
+ var minutes = addLeadingZeros(absOffset % 60, 2);
1220
+ return sign + hours + delimiter + minutes;
1221
+ }
1222
+ const formatters$1 = formatters;
1223
+
1224
+ var dateLongFormatter = function dateLongFormatter(pattern, formatLong) {
1225
+ switch (pattern) {
1226
+ case 'P':
1227
+ return formatLong.date({
1228
+ width: 'short'
1229
+ });
1230
+ case 'PP':
1231
+ return formatLong.date({
1232
+ width: 'medium'
1233
+ });
1234
+ case 'PPP':
1235
+ return formatLong.date({
1236
+ width: 'long'
1237
+ });
1238
+ case 'PPPP':
1239
+ default:
1240
+ return formatLong.date({
1241
+ width: 'full'
1242
+ });
1243
+ }
1244
+ };
1245
+ var timeLongFormatter = function timeLongFormatter(pattern, formatLong) {
1246
+ switch (pattern) {
1247
+ case 'p':
1248
+ return formatLong.time({
1249
+ width: 'short'
1250
+ });
1251
+ case 'pp':
1252
+ return formatLong.time({
1253
+ width: 'medium'
1254
+ });
1255
+ case 'ppp':
1256
+ return formatLong.time({
1257
+ width: 'long'
1258
+ });
1259
+ case 'pppp':
1260
+ default:
1261
+ return formatLong.time({
1262
+ width: 'full'
1263
+ });
1264
+ }
1265
+ };
1266
+ var dateTimeLongFormatter = function dateTimeLongFormatter(pattern, formatLong) {
1267
+ var matchResult = pattern.match(/(P+)(p+)?/) || [];
1268
+ var datePattern = matchResult[1];
1269
+ var timePattern = matchResult[2];
1270
+ if (!timePattern) {
1271
+ return dateLongFormatter(pattern, formatLong);
1272
+ }
1273
+ var dateTimeFormat;
1274
+ switch (datePattern) {
1275
+ case 'P':
1276
+ dateTimeFormat = formatLong.dateTime({
1277
+ width: 'short'
1278
+ });
1279
+ break;
1280
+ case 'PP':
1281
+ dateTimeFormat = formatLong.dateTime({
1282
+ width: 'medium'
1283
+ });
1284
+ break;
1285
+ case 'PPP':
1286
+ dateTimeFormat = formatLong.dateTime({
1287
+ width: 'long'
1288
+ });
1289
+ break;
1290
+ case 'PPPP':
1291
+ default:
1292
+ dateTimeFormat = formatLong.dateTime({
1293
+ width: 'full'
1294
+ });
1295
+ break;
1296
+ }
1297
+ return dateTimeFormat.replace('{{date}}', dateLongFormatter(datePattern, formatLong)).replace('{{time}}', timeLongFormatter(timePattern, formatLong));
1298
+ };
1299
+ var longFormatters = {
1300
+ p: timeLongFormatter,
1301
+ P: dateTimeLongFormatter
1302
+ };
1303
+ const longFormatters$1 = longFormatters;
1304
+
1305
+ var protectedDayOfYearTokens = ['D', 'DD'];
1306
+ var protectedWeekYearTokens = ['YY', 'YYYY'];
1307
+ function isProtectedDayOfYearToken(token) {
1308
+ return protectedDayOfYearTokens.indexOf(token) !== -1;
1309
+ }
1310
+ function isProtectedWeekYearToken(token) {
1311
+ return protectedWeekYearTokens.indexOf(token) !== -1;
1312
+ }
1313
+ function throwProtectedError(token, format, input) {
1314
+ if (token === 'YYYY') {
1315
+ throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
1316
+ } else if (token === 'YY') {
1317
+ throw new RangeError("Use `yy` instead of `YY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
1318
+ } else if (token === 'D') {
1319
+ throw new RangeError("Use `d` instead of `D` (in `".concat(format, "`) for formatting days of the month to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
1320
+ } else if (token === 'DD') {
1321
+ throw new RangeError("Use `dd` instead of `DD` (in `".concat(format, "`) for formatting days of the month to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
1322
+ }
1323
+ }
1324
+
1325
+ var formatDistanceLocale = {
1326
+ lessThanXSeconds: {
1327
+ one: 'less than a second',
1328
+ other: 'less than {{count}} seconds'
1329
+ },
1330
+ xSeconds: {
1331
+ one: '1 second',
1332
+ other: '{{count}} seconds'
1333
+ },
1334
+ halfAMinute: 'half a minute',
1335
+ lessThanXMinutes: {
1336
+ one: 'less than a minute',
1337
+ other: 'less than {{count}} minutes'
1338
+ },
1339
+ xMinutes: {
1340
+ one: '1 minute',
1341
+ other: '{{count}} minutes'
1342
+ },
1343
+ aboutXHours: {
1344
+ one: 'about 1 hour',
1345
+ other: 'about {{count}} hours'
1346
+ },
1347
+ xHours: {
1348
+ one: '1 hour',
1349
+ other: '{{count}} hours'
1350
+ },
1351
+ xDays: {
1352
+ one: '1 day',
1353
+ other: '{{count}} days'
1354
+ },
1355
+ aboutXWeeks: {
1356
+ one: 'about 1 week',
1357
+ other: 'about {{count}} weeks'
1358
+ },
1359
+ xWeeks: {
1360
+ one: '1 week',
1361
+ other: '{{count}} weeks'
1362
+ },
1363
+ aboutXMonths: {
1364
+ one: 'about 1 month',
1365
+ other: 'about {{count}} months'
1366
+ },
1367
+ xMonths: {
1368
+ one: '1 month',
1369
+ other: '{{count}} months'
1370
+ },
1371
+ aboutXYears: {
1372
+ one: 'about 1 year',
1373
+ other: 'about {{count}} years'
1374
+ },
1375
+ xYears: {
1376
+ one: '1 year',
1377
+ other: '{{count}} years'
1378
+ },
1379
+ overXYears: {
1380
+ one: 'over 1 year',
1381
+ other: 'over {{count}} years'
1382
+ },
1383
+ almostXYears: {
1384
+ one: 'almost 1 year',
1385
+ other: 'almost {{count}} years'
1386
+ }
1387
+ };
1388
+ var formatDistance = function formatDistance(token, count, options) {
1389
+ var result;
1390
+ var tokenValue = formatDistanceLocale[token];
1391
+ if (typeof tokenValue === 'string') {
1392
+ result = tokenValue;
1393
+ } else if (count === 1) {
1394
+ result = tokenValue.one;
1395
+ } else {
1396
+ result = tokenValue.other.replace('{{count}}', count.toString());
1397
+ }
1398
+ if (options !== null && options !== void 0 && options.addSuffix) {
1399
+ if (options.comparison && options.comparison > 0) {
1400
+ return 'in ' + result;
1401
+ } else {
1402
+ return result + ' ago';
1403
+ }
1404
+ }
1405
+ return result;
1406
+ };
1407
+ const formatDistance$1 = formatDistance;
1408
+
1409
+ function buildFormatLongFn(args) {
1410
+ return function () {
1411
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1412
+ // TODO: Remove String()
1413
+ var width = options.width ? String(options.width) : args.defaultWidth;
1414
+ var format = args.formats[width] || args.formats[args.defaultWidth];
1415
+ return format;
1416
+ };
1417
+ }
1418
+
1419
+ var dateFormats = {
1420
+ full: 'EEEE, MMMM do, y',
1421
+ long: 'MMMM do, y',
1422
+ medium: 'MMM d, y',
1423
+ short: 'MM/dd/yyyy'
1424
+ };
1425
+ var timeFormats = {
1426
+ full: 'h:mm:ss a zzzz',
1427
+ long: 'h:mm:ss a z',
1428
+ medium: 'h:mm:ss a',
1429
+ short: 'h:mm a'
1430
+ };
1431
+ var dateTimeFormats = {
1432
+ full: "{{date}} 'at' {{time}}",
1433
+ long: "{{date}} 'at' {{time}}",
1434
+ medium: '{{date}}, {{time}}',
1435
+ short: '{{date}}, {{time}}'
1436
+ };
1437
+ var formatLong = {
1438
+ date: buildFormatLongFn({
1439
+ formats: dateFormats,
1440
+ defaultWidth: 'full'
1441
+ }),
1442
+ time: buildFormatLongFn({
1443
+ formats: timeFormats,
1444
+ defaultWidth: 'full'
1445
+ }),
1446
+ dateTime: buildFormatLongFn({
1447
+ formats: dateTimeFormats,
1448
+ defaultWidth: 'full'
1449
+ })
1450
+ };
1451
+ const formatLong$1 = formatLong;
1452
+
1453
+ var formatRelativeLocale = {
1454
+ lastWeek: "'last' eeee 'at' p",
1455
+ yesterday: "'yesterday at' p",
1456
+ today: "'today at' p",
1457
+ tomorrow: "'tomorrow at' p",
1458
+ nextWeek: "eeee 'at' p",
1459
+ other: 'P'
1460
+ };
1461
+ var formatRelative = function formatRelative(token, _date, _baseDate, _options) {
1462
+ return formatRelativeLocale[token];
1463
+ };
1464
+ const formatRelative$1 = formatRelative;
1465
+
1466
+ function buildLocalizeFn(args) {
1467
+ return function (dirtyIndex, options) {
1468
+ var context = options !== null && options !== void 0 && options.context ? String(options.context) : 'standalone';
1469
+ var valuesArray;
1470
+ if (context === 'formatting' && args.formattingValues) {
1471
+ var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
1472
+ var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth;
1473
+ valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
1474
+ } else {
1475
+ var _defaultWidth = args.defaultWidth;
1476
+ var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth;
1477
+ valuesArray = args.values[_width] || args.values[_defaultWidth];
1478
+ }
1479
+ var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex;
1480
+ // @ts-ignore: For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!
1481
+ return valuesArray[index];
1482
+ };
1483
+ }
1484
+
1485
+ var eraValues = {
1486
+ narrow: ['B', 'A'],
1487
+ abbreviated: ['BC', 'AD'],
1488
+ wide: ['Before Christ', 'Anno Domini']
1489
+ };
1490
+ var quarterValues = {
1491
+ narrow: ['1', '2', '3', '4'],
1492
+ abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
1493
+ wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter']
1494
+ };
1495
+
1496
+ // Note: in English, the names of days of the week and months are capitalized.
1497
+ // If you are making a new locale based on this one, check if the same is true for the language you're working on.
1498
+ // Generally, formatted dates should look like they are in the middle of a sentence,
1499
+ // e.g. in Spanish language the weekdays and months should be in the lowercase.
1500
+ var monthValues = {
1501
+ narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
1502
+ abbreviated: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
1503
+ wide: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
1504
+ };
1505
+ var dayValues = {
1506
+ narrow: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
1507
+ short: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
1508
+ abbreviated: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
1509
+ wide: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
1510
+ };
1511
+ var dayPeriodValues = {
1512
+ narrow: {
1513
+ am: 'a',
1514
+ pm: 'p',
1515
+ midnight: 'mi',
1516
+ noon: 'n',
1517
+ morning: 'morning',
1518
+ afternoon: 'afternoon',
1519
+ evening: 'evening',
1520
+ night: 'night'
1521
+ },
1522
+ abbreviated: {
1523
+ am: 'AM',
1524
+ pm: 'PM',
1525
+ midnight: 'midnight',
1526
+ noon: 'noon',
1527
+ morning: 'morning',
1528
+ afternoon: 'afternoon',
1529
+ evening: 'evening',
1530
+ night: 'night'
1531
+ },
1532
+ wide: {
1533
+ am: 'a.m.',
1534
+ pm: 'p.m.',
1535
+ midnight: 'midnight',
1536
+ noon: 'noon',
1537
+ morning: 'morning',
1538
+ afternoon: 'afternoon',
1539
+ evening: 'evening',
1540
+ night: 'night'
1541
+ }
1542
+ };
1543
+ var formattingDayPeriodValues = {
1544
+ narrow: {
1545
+ am: 'a',
1546
+ pm: 'p',
1547
+ midnight: 'mi',
1548
+ noon: 'n',
1549
+ morning: 'in the morning',
1550
+ afternoon: 'in the afternoon',
1551
+ evening: 'in the evening',
1552
+ night: 'at night'
1553
+ },
1554
+ abbreviated: {
1555
+ am: 'AM',
1556
+ pm: 'PM',
1557
+ midnight: 'midnight',
1558
+ noon: 'noon',
1559
+ morning: 'in the morning',
1560
+ afternoon: 'in the afternoon',
1561
+ evening: 'in the evening',
1562
+ night: 'at night'
1563
+ },
1564
+ wide: {
1565
+ am: 'a.m.',
1566
+ pm: 'p.m.',
1567
+ midnight: 'midnight',
1568
+ noon: 'noon',
1569
+ morning: 'in the morning',
1570
+ afternoon: 'in the afternoon',
1571
+ evening: 'in the evening',
1572
+ night: 'at night'
1573
+ }
1574
+ };
1575
+ var ordinalNumber = function ordinalNumber(dirtyNumber, _options) {
1576
+ var number = Number(dirtyNumber);
1577
+
1578
+ // If ordinal numbers depend on context, for example,
1579
+ // if they are different for different grammatical genders,
1580
+ // use `options.unit`.
1581
+ //
1582
+ // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
1583
+ // 'day', 'hour', 'minute', 'second'.
1584
+
1585
+ var rem100 = number % 100;
1586
+ if (rem100 > 20 || rem100 < 10) {
1587
+ switch (rem100 % 10) {
1588
+ case 1:
1589
+ return number + 'st';
1590
+ case 2:
1591
+ return number + 'nd';
1592
+ case 3:
1593
+ return number + 'rd';
1594
+ }
1595
+ }
1596
+ return number + 'th';
1597
+ };
1598
+ var localize = {
1599
+ ordinalNumber: ordinalNumber,
1600
+ era: buildLocalizeFn({
1601
+ values: eraValues,
1602
+ defaultWidth: 'wide'
1603
+ }),
1604
+ quarter: buildLocalizeFn({
1605
+ values: quarterValues,
1606
+ defaultWidth: 'wide',
1607
+ argumentCallback: function argumentCallback(quarter) {
1608
+ return quarter - 1;
1609
+ }
1610
+ }),
1611
+ month: buildLocalizeFn({
1612
+ values: monthValues,
1613
+ defaultWidth: 'wide'
1614
+ }),
1615
+ day: buildLocalizeFn({
1616
+ values: dayValues,
1617
+ defaultWidth: 'wide'
1618
+ }),
1619
+ dayPeriod: buildLocalizeFn({
1620
+ values: dayPeriodValues,
1621
+ defaultWidth: 'wide',
1622
+ formattingValues: formattingDayPeriodValues,
1623
+ defaultFormattingWidth: 'wide'
1624
+ })
1625
+ };
1626
+ const localize$1 = localize;
1627
+
1628
+ function buildMatchFn(args) {
1629
+ return function (string) {
1630
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1631
+ var width = options.width;
1632
+ var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
1633
+ var matchResult = string.match(matchPattern);
1634
+ if (!matchResult) {
1635
+ return null;
1636
+ }
1637
+ var matchedString = matchResult[0];
1638
+ var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
1639
+ var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {
1640
+ return pattern.test(matchedString);
1641
+ }) : findKey(parsePatterns, function (pattern) {
1642
+ return pattern.test(matchedString);
1643
+ });
1644
+ var value;
1645
+ value = args.valueCallback ? args.valueCallback(key) : key;
1646
+ value = options.valueCallback ? options.valueCallback(value) : value;
1647
+ var rest = string.slice(matchedString.length);
1648
+ return {
1649
+ value: value,
1650
+ rest: rest
1651
+ };
1652
+ };
1653
+ }
1654
+ function findKey(object, predicate) {
1655
+ for (var key in object) {
1656
+ if (object.hasOwnProperty(key) && predicate(object[key])) {
1657
+ return key;
1658
+ }
1659
+ }
1660
+ return undefined;
1661
+ }
1662
+ function findIndex(array, predicate) {
1663
+ for (var key = 0; key < array.length; key++) {
1664
+ if (predicate(array[key])) {
1665
+ return key;
1666
+ }
1667
+ }
1668
+ return undefined;
1669
+ }
1670
+
1671
+ function buildMatchPatternFn(args) {
1672
+ return function (string) {
1673
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1674
+ var matchResult = string.match(args.matchPattern);
1675
+ if (!matchResult) return null;
1676
+ var matchedString = matchResult[0];
1677
+ var parseResult = string.match(args.parsePattern);
1678
+ if (!parseResult) return null;
1679
+ var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
1680
+ value = options.valueCallback ? options.valueCallback(value) : value;
1681
+ var rest = string.slice(matchedString.length);
1682
+ return {
1683
+ value: value,
1684
+ rest: rest
1685
+ };
1686
+ };
1687
+ }
1688
+
1689
+ var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
1690
+ var parseOrdinalNumberPattern = /\d+/i;
1691
+ var matchEraPatterns = {
1692
+ narrow: /^(b|a)/i,
1693
+ abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
1694
+ wide: /^(before christ|before common era|anno domini|common era)/i
1695
+ };
1696
+ var parseEraPatterns = {
1697
+ any: [/^b/i, /^(a|c)/i]
1698
+ };
1699
+ var matchQuarterPatterns = {
1700
+ narrow: /^[1234]/i,
1701
+ abbreviated: /^q[1234]/i,
1702
+ wide: /^[1234](th|st|nd|rd)? quarter/i
1703
+ };
1704
+ var parseQuarterPatterns = {
1705
+ any: [/1/i, /2/i, /3/i, /4/i]
1706
+ };
1707
+ var matchMonthPatterns = {
1708
+ narrow: /^[jfmasond]/i,
1709
+ abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
1710
+ wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
1711
+ };
1712
+ var parseMonthPatterns = {
1713
+ narrow: [/^j/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i],
1714
+ any: [/^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i]
1715
+ };
1716
+ var matchDayPatterns = {
1717
+ narrow: /^[smtwf]/i,
1718
+ short: /^(su|mo|tu|we|th|fr|sa)/i,
1719
+ abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
1720
+ wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
1721
+ };
1722
+ var parseDayPatterns = {
1723
+ narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
1724
+ any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
1725
+ };
1726
+ var matchDayPeriodPatterns = {
1727
+ narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
1728
+ any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
1729
+ };
1730
+ var parseDayPeriodPatterns = {
1731
+ any: {
1732
+ am: /^a/i,
1733
+ pm: /^p/i,
1734
+ midnight: /^mi/i,
1735
+ noon: /^no/i,
1736
+ morning: /morning/i,
1737
+ afternoon: /afternoon/i,
1738
+ evening: /evening/i,
1739
+ night: /night/i
1740
+ }
1741
+ };
1742
+ var match = {
1743
+ ordinalNumber: buildMatchPatternFn({
1744
+ matchPattern: matchOrdinalNumberPattern,
1745
+ parsePattern: parseOrdinalNumberPattern,
1746
+ valueCallback: function valueCallback(value) {
1747
+ return parseInt(value, 10);
1748
+ }
1749
+ }),
1750
+ era: buildMatchFn({
1751
+ matchPatterns: matchEraPatterns,
1752
+ defaultMatchWidth: 'wide',
1753
+ parsePatterns: parseEraPatterns,
1754
+ defaultParseWidth: 'any'
1755
+ }),
1756
+ quarter: buildMatchFn({
1757
+ matchPatterns: matchQuarterPatterns,
1758
+ defaultMatchWidth: 'wide',
1759
+ parsePatterns: parseQuarterPatterns,
1760
+ defaultParseWidth: 'any',
1761
+ valueCallback: function valueCallback(index) {
1762
+ return index + 1;
1763
+ }
1764
+ }),
1765
+ month: buildMatchFn({
1766
+ matchPatterns: matchMonthPatterns,
1767
+ defaultMatchWidth: 'wide',
1768
+ parsePatterns: parseMonthPatterns,
1769
+ defaultParseWidth: 'any'
1770
+ }),
1771
+ day: buildMatchFn({
1772
+ matchPatterns: matchDayPatterns,
1773
+ defaultMatchWidth: 'wide',
1774
+ parsePatterns: parseDayPatterns,
1775
+ defaultParseWidth: 'any'
1776
+ }),
1777
+ dayPeriod: buildMatchFn({
1778
+ matchPatterns: matchDayPeriodPatterns,
1779
+ defaultMatchWidth: 'any',
1780
+ parsePatterns: parseDayPeriodPatterns,
1781
+ defaultParseWidth: 'any'
1782
+ })
1783
+ };
1784
+ const match$1 = match;
1785
+
1786
+ /**
1787
+ * @type {Locale}
1788
+ * @category Locales
1789
+ * @summary English locale (United States).
1790
+ * @language English
1791
+ * @iso-639-2 eng
1792
+ * @author Sasha Koss [@kossnocorp]{@link https://github.com/kossnocorp}
1793
+ * @author Lesha Koss [@leshakoss]{@link https://github.com/leshakoss}
1794
+ */
1795
+ var locale = {
1796
+ code: 'en-US',
1797
+ formatDistance: formatDistance$1,
1798
+ formatLong: formatLong$1,
1799
+ formatRelative: formatRelative$1,
1800
+ localize: localize$1,
1801
+ match: match$1,
1802
+ options: {
1803
+ weekStartsOn: 0 /* Sunday */,
1804
+ firstWeekContainsDate: 1
1805
+ }
1806
+ };
1807
+ const defaultLocale = locale;
1808
+
1809
+ // - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token
1810
+ // (one of the certain letters followed by `o`)
1811
+ // - (\w)\1* matches any sequences of the same letter
1812
+ // - '' matches two quote characters in a row
1813
+ // - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),
1814
+ // except a single quote symbol, which ends the sequence.
1815
+ // Two quote characters do not end the sequence.
1816
+ // If there is no matching single quote
1817
+ // then the sequence will continue until the end of the string.
1818
+ // - . matches any single character unmatched by previous parts of the RegExps
1819
+ var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
1820
+
1821
+ // This RegExp catches symbols escaped by quotes, and also
1822
+ // sequences of symbols P, p, and the combinations like `PPPPPPPppppp`
1823
+ var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
1824
+ var escapedStringRegExp = /^'([^]*?)'?$/;
1825
+ var doubleQuoteRegExp = /''/g;
1826
+ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
1827
+
1828
+ /**
1829
+ * @name format
1830
+ * @category Common Helpers
1831
+ * @summary Format the date.
1832
+ *
1833
+ * @description
1834
+ * Return the formatted date string in the given format. The result may vary by locale.
1835
+ *
1836
+ * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
1837
+ * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
1838
+ *
1839
+ * The characters wrapped between two single quotes characters (') are escaped.
1840
+ * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
1841
+ * (see the last example)
1842
+ *
1843
+ * Format of the string is based on Unicode Technical Standard #35:
1844
+ * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
1845
+ * with a few additions (see note 7 below the table).
1846
+ *
1847
+ * Accepted patterns:
1848
+ * | Unit | Pattern | Result examples | Notes |
1849
+ * |---------------------------------|---------|-----------------------------------|-------|
1850
+ * | Era | G..GGG | AD, BC | |
1851
+ * | | GGGG | Anno Domini, Before Christ | 2 |
1852
+ * | | GGGGG | A, B | |
1853
+ * | Calendar year | y | 44, 1, 1900, 2017 | 5 |
1854
+ * | | yo | 44th, 1st, 0th, 17th | 5,7 |
1855
+ * | | yy | 44, 01, 00, 17 | 5 |
1856
+ * | | yyy | 044, 001, 1900, 2017 | 5 |
1857
+ * | | yyyy | 0044, 0001, 1900, 2017 | 5 |
1858
+ * | | yyyyy | ... | 3,5 |
1859
+ * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |
1860
+ * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |
1861
+ * | | YY | 44, 01, 00, 17 | 5,8 |
1862
+ * | | YYY | 044, 001, 1900, 2017 | 5 |
1863
+ * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |
1864
+ * | | YYYYY | ... | 3,5 |
1865
+ * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |
1866
+ * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |
1867
+ * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |
1868
+ * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |
1869
+ * | | RRRRR | ... | 3,5,7 |
1870
+ * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |
1871
+ * | | uu | -43, 01, 1900, 2017 | 5 |
1872
+ * | | uuu | -043, 001, 1900, 2017 | 5 |
1873
+ * | | uuuu | -0043, 0001, 1900, 2017 | 5 |
1874
+ * | | uuuuu | ... | 3,5 |
1875
+ * | Quarter (formatting) | Q | 1, 2, 3, 4 | |
1876
+ * | | Qo | 1st, 2nd, 3rd, 4th | 7 |
1877
+ * | | QQ | 01, 02, 03, 04 | |
1878
+ * | | QQQ | Q1, Q2, Q3, Q4 | |
1879
+ * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |
1880
+ * | | QQQQQ | 1, 2, 3, 4 | 4 |
1881
+ * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |
1882
+ * | | qo | 1st, 2nd, 3rd, 4th | 7 |
1883
+ * | | qq | 01, 02, 03, 04 | |
1884
+ * | | qqq | Q1, Q2, Q3, Q4 | |
1885
+ * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |
1886
+ * | | qqqqq | 1, 2, 3, 4 | 4 |
1887
+ * | Month (formatting) | M | 1, 2, ..., 12 | |
1888
+ * | | Mo | 1st, 2nd, ..., 12th | 7 |
1889
+ * | | MM | 01, 02, ..., 12 | |
1890
+ * | | MMM | Jan, Feb, ..., Dec | |
1891
+ * | | MMMM | January, February, ..., December | 2 |
1892
+ * | | MMMMM | J, F, ..., D | |
1893
+ * | Month (stand-alone) | L | 1, 2, ..., 12 | |
1894
+ * | | Lo | 1st, 2nd, ..., 12th | 7 |
1895
+ * | | LL | 01, 02, ..., 12 | |
1896
+ * | | LLL | Jan, Feb, ..., Dec | |
1897
+ * | | LLLL | January, February, ..., December | 2 |
1898
+ * | | LLLLL | J, F, ..., D | |
1899
+ * | Local week of year | w | 1, 2, ..., 53 | |
1900
+ * | | wo | 1st, 2nd, ..., 53th | 7 |
1901
+ * | | ww | 01, 02, ..., 53 | |
1902
+ * | ISO week of year | I | 1, 2, ..., 53 | 7 |
1903
+ * | | Io | 1st, 2nd, ..., 53th | 7 |
1904
+ * | | II | 01, 02, ..., 53 | 7 |
1905
+ * | Day of month | d | 1, 2, ..., 31 | |
1906
+ * | | do | 1st, 2nd, ..., 31st | 7 |
1907
+ * | | dd | 01, 02, ..., 31 | |
1908
+ * | Day of year | D | 1, 2, ..., 365, 366 | 9 |
1909
+ * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |
1910
+ * | | DD | 01, 02, ..., 365, 366 | 9 |
1911
+ * | | DDD | 001, 002, ..., 365, 366 | |
1912
+ * | | DDDD | ... | 3 |
1913
+ * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |
1914
+ * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |
1915
+ * | | EEEEE | M, T, W, T, F, S, S | |
1916
+ * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |
1917
+ * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |
1918
+ * | | io | 1st, 2nd, ..., 7th | 7 |
1919
+ * | | ii | 01, 02, ..., 07 | 7 |
1920
+ * | | iii | Mon, Tue, Wed, ..., Sun | 7 |
1921
+ * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |
1922
+ * | | iiiii | M, T, W, T, F, S, S | 7 |
1923
+ * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |
1924
+ * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |
1925
+ * | | eo | 2nd, 3rd, ..., 1st | 7 |
1926
+ * | | ee | 02, 03, ..., 01 | |
1927
+ * | | eee | Mon, Tue, Wed, ..., Sun | |
1928
+ * | | eeee | Monday, Tuesday, ..., Sunday | 2 |
1929
+ * | | eeeee | M, T, W, T, F, S, S | |
1930
+ * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |
1931
+ * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |
1932
+ * | | co | 2nd, 3rd, ..., 1st | 7 |
1933
+ * | | cc | 02, 03, ..., 01 | |
1934
+ * | | ccc | Mon, Tue, Wed, ..., Sun | |
1935
+ * | | cccc | Monday, Tuesday, ..., Sunday | 2 |
1936
+ * | | ccccc | M, T, W, T, F, S, S | |
1937
+ * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |
1938
+ * | AM, PM | a..aa | AM, PM | |
1939
+ * | | aaa | am, pm | |
1940
+ * | | aaaa | a.m., p.m. | 2 |
1941
+ * | | aaaaa | a, p | |
1942
+ * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |
1943
+ * | | bbb | am, pm, noon, midnight | |
1944
+ * | | bbbb | a.m., p.m., noon, midnight | 2 |
1945
+ * | | bbbbb | a, p, n, mi | |
1946
+ * | Flexible day period | B..BBB | at night, in the morning, ... | |
1947
+ * | | BBBB | at night, in the morning, ... | 2 |
1948
+ * | | BBBBB | at night, in the morning, ... | |
1949
+ * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |
1950
+ * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |
1951
+ * | | hh | 01, 02, ..., 11, 12 | |
1952
+ * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |
1953
+ * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |
1954
+ * | | HH | 00, 01, 02, ..., 23 | |
1955
+ * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |
1956
+ * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |
1957
+ * | | KK | 01, 02, ..., 11, 00 | |
1958
+ * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |
1959
+ * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |
1960
+ * | | kk | 24, 01, 02, ..., 23 | |
1961
+ * | Minute | m | 0, 1, ..., 59 | |
1962
+ * | | mo | 0th, 1st, ..., 59th | 7 |
1963
+ * | | mm | 00, 01, ..., 59 | |
1964
+ * | Second | s | 0, 1, ..., 59 | |
1965
+ * | | so | 0th, 1st, ..., 59th | 7 |
1966
+ * | | ss | 00, 01, ..., 59 | |
1967
+ * | Fraction of second | S | 0, 1, ..., 9 | |
1968
+ * | | SS | 00, 01, ..., 99 | |
1969
+ * | | SSS | 000, 001, ..., 999 | |
1970
+ * | | SSSS | ... | 3 |
1971
+ * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |
1972
+ * | | XX | -0800, +0530, Z | |
1973
+ * | | XXX | -08:00, +05:30, Z | |
1974
+ * | | XXXX | -0800, +0530, Z, +123456 | 2 |
1975
+ * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |
1976
+ * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |
1977
+ * | | xx | -0800, +0530, +0000 | |
1978
+ * | | xxx | -08:00, +05:30, +00:00 | 2 |
1979
+ * | | xxxx | -0800, +0530, +0000, +123456 | |
1980
+ * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |
1981
+ * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |
1982
+ * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |
1983
+ * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |
1984
+ * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |
1985
+ * | Seconds timestamp | t | 512969520 | 7 |
1986
+ * | | tt | ... | 3,7 |
1987
+ * | Milliseconds timestamp | T | 512969520900 | 7 |
1988
+ * | | TT | ... | 3,7 |
1989
+ * | Long localized date | P | 04/29/1453 | 7 |
1990
+ * | | PP | Apr 29, 1453 | 7 |
1991
+ * | | PPP | April 29th, 1453 | 7 |
1992
+ * | | PPPP | Friday, April 29th, 1453 | 2,7 |
1993
+ * | Long localized time | p | 12:00 AM | 7 |
1994
+ * | | pp | 12:00:00 AM | 7 |
1995
+ * | | ppp | 12:00:00 AM GMT+2 | 7 |
1996
+ * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |
1997
+ * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |
1998
+ * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |
1999
+ * | | PPPppp | April 29th, 1453 at ... | 7 |
2000
+ * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |
2001
+ * Notes:
2002
+ * 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
2003
+ * are the same as "stand-alone" units, but are different in some languages.
2004
+ * "Formatting" units are declined according to the rules of the language
2005
+ * in the context of a date. "Stand-alone" units are always nominative singular:
2006
+ *
2007
+ * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`
2008
+ *
2009
+ * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`
2010
+ *
2011
+ * 2. Any sequence of the identical letters is a pattern, unless it is escaped by
2012
+ * the single quote characters (see below).
2013
+ * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)
2014
+ * the output will be the same as default pattern for this unit, usually
2015
+ * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units
2016
+ * are marked with "2" in the last column of the table.
2017
+ *
2018
+ * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`
2019
+ *
2020
+ * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`
2021
+ *
2022
+ * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`
2023
+ *
2024
+ * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`
2025
+ *
2026
+ * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`
2027
+ *
2028
+ * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).
2029
+ * The output will be padded with zeros to match the length of the pattern.
2030
+ *
2031
+ * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`
2032
+ *
2033
+ * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.
2034
+ * These tokens represent the shortest form of the quarter.
2035
+ *
2036
+ * 5. The main difference between `y` and `u` patterns are B.C. years:
2037
+ *
2038
+ * | Year | `y` | `u` |
2039
+ * |------|-----|-----|
2040
+ * | AC 1 | 1 | 1 |
2041
+ * | BC 1 | 1 | 0 |
2042
+ * | BC 2 | 2 | -1 |
2043
+ *
2044
+ * Also `yy` always returns the last two digits of a year,
2045
+ * while `uu` pads single digit years to 2 characters and returns other years unchanged:
2046
+ *
2047
+ * | Year | `yy` | `uu` |
2048
+ * |------|------|------|
2049
+ * | 1 | 01 | 01 |
2050
+ * | 14 | 14 | 14 |
2051
+ * | 376 | 76 | 376 |
2052
+ * | 1453 | 53 | 1453 |
2053
+ *
2054
+ * The same difference is true for local and ISO week-numbering years (`Y` and `R`),
2055
+ * except local week-numbering years are dependent on `options.weekStartsOn`
2056
+ * and `options.firstWeekContainsDate` (compare [getISOWeekYear]{@link https://date-fns.org/docs/getISOWeekYear}
2057
+ * and [getWeekYear]{@link https://date-fns.org/docs/getWeekYear}).
2058
+ *
2059
+ * 6. Specific non-location timezones are currently unavailable in `date-fns`,
2060
+ * so right now these tokens fall back to GMT timezones.
2061
+ *
2062
+ * 7. These patterns are not in the Unicode Technical Standard #35:
2063
+ * - `i`: ISO day of week
2064
+ * - `I`: ISO week of year
2065
+ * - `R`: ISO week-numbering year
2066
+ * - `t`: seconds timestamp
2067
+ * - `T`: milliseconds timestamp
2068
+ * - `o`: ordinal number modifier
2069
+ * - `P`: long localized date
2070
+ * - `p`: long localized time
2071
+ *
2072
+ * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
2073
+ * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2074
+ *
2075
+ * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.
2076
+ * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2077
+ *
2078
+ * @param {Date|Number} date - the original date
2079
+ * @param {String} format - the string of tokens
2080
+ * @param {Object} [options] - an object with options.
2081
+ * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
2082
+ * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)
2083
+ * @param {Number} [options.firstWeekContainsDate=1] - the day of January, which is
2084
+ * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;
2085
+ * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2086
+ * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;
2087
+ * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2088
+ * @returns {String} the formatted date string
2089
+ * @throws {TypeError} 2 arguments required
2090
+ * @throws {RangeError} `date` must not be Invalid Date
2091
+ * @throws {RangeError} `options.locale` must contain `localize` property
2092
+ * @throws {RangeError} `options.locale` must contain `formatLong` property
2093
+ * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6
2094
+ * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7
2095
+ * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2096
+ * @throws {RangeError} use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2097
+ * @throws {RangeError} use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2098
+ * @throws {RangeError} use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2099
+ * @throws {RangeError} format string contains an unescaped latin alphabet character
2100
+ *
2101
+ * @example
2102
+ * // Represent 11 February 2014 in middle-endian format:
2103
+ * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')
2104
+ * //=> '02/11/2014'
2105
+ *
2106
+ * @example
2107
+ * // Represent 2 July 2014 in Esperanto:
2108
+ * import { eoLocale } from 'date-fns/locale/eo'
2109
+ * const result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", {
2110
+ * locale: eoLocale
2111
+ * })
2112
+ * //=> '2-a de julio 2014'
2113
+ *
2114
+ * @example
2115
+ * // Escape string by single quote characters:
2116
+ * const result = format(new Date(2014, 6, 2, 15), "h 'o''clock'")
2117
+ * //=> "3 o'clock"
2118
+ */
2119
+
2120
+ function format(dirtyDate, dirtyFormatStr, options) {
2121
+ var _ref, _options$locale, _ref2, _ref3, _ref4, _options$firstWeekCon, _options$locale2, _options$locale2$opti, _defaultOptions$local, _defaultOptions$local2, _ref5, _ref6, _ref7, _options$weekStartsOn, _options$locale3, _options$locale3$opti, _defaultOptions$local3, _defaultOptions$local4;
2122
+ requiredArgs(2, arguments);
2123
+ var formatStr = String(dirtyFormatStr);
2124
+ var defaultOptions = getDefaultOptions();
2125
+ var locale = (_ref = (_options$locale = options === null || options === void 0 ? void 0 : options.locale) !== null && _options$locale !== void 0 ? _options$locale : defaultOptions.locale) !== null && _ref !== void 0 ? _ref : defaultLocale;
2126
+ var firstWeekContainsDate = toInteger((_ref2 = (_ref3 = (_ref4 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale2 = options.locale) === null || _options$locale2 === void 0 ? void 0 : (_options$locale2$opti = _options$locale2.options) === null || _options$locale2$opti === void 0 ? void 0 : _options$locale2$opti.firstWeekContainsDate) !== null && _ref4 !== void 0 ? _ref4 : defaultOptions.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : 1);
2127
+
2128
+ // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
2129
+ if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
2130
+ throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
2131
+ }
2132
+ var weekStartsOn = toInteger((_ref5 = (_ref6 = (_ref7 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale3 = options.locale) === null || _options$locale3 === void 0 ? void 0 : (_options$locale3$opti = _options$locale3.options) === null || _options$locale3$opti === void 0 ? void 0 : _options$locale3$opti.weekStartsOn) !== null && _ref7 !== void 0 ? _ref7 : defaultOptions.weekStartsOn) !== null && _ref6 !== void 0 ? _ref6 : (_defaultOptions$local3 = defaultOptions.locale) === null || _defaultOptions$local3 === void 0 ? void 0 : (_defaultOptions$local4 = _defaultOptions$local3.options) === null || _defaultOptions$local4 === void 0 ? void 0 : _defaultOptions$local4.weekStartsOn) !== null && _ref5 !== void 0 ? _ref5 : 0);
2133
+
2134
+ // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
2135
+ if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
2136
+ throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
2137
+ }
2138
+ if (!locale.localize) {
2139
+ throw new RangeError('locale must contain localize property');
2140
+ }
2141
+ if (!locale.formatLong) {
2142
+ throw new RangeError('locale must contain formatLong property');
2143
+ }
2144
+ var originalDate = toDate(dirtyDate);
2145
+ if (!isValid(originalDate)) {
2146
+ throw new RangeError('Invalid time value');
2147
+ }
2148
+
2149
+ // Convert the date in system timezone to the same date in UTC+00:00 timezone.
2150
+ // This ensures that when UTC functions will be implemented, locales will be compatible with them.
2151
+ // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376
2152
+ var timezoneOffset = getTimezoneOffsetInMilliseconds(originalDate);
2153
+ var utcDate = subMilliseconds(originalDate, timezoneOffset);
2154
+ var formatterOptions = {
2155
+ firstWeekContainsDate: firstWeekContainsDate,
2156
+ weekStartsOn: weekStartsOn,
2157
+ locale: locale,
2158
+ _originalDate: originalDate
2159
+ };
2160
+ var result = formatStr.match(longFormattingTokensRegExp).map(function (substring) {
2161
+ var firstCharacter = substring[0];
2162
+ if (firstCharacter === 'p' || firstCharacter === 'P') {
2163
+ var longFormatter = longFormatters$1[firstCharacter];
2164
+ return longFormatter(substring, locale.formatLong);
2165
+ }
2166
+ return substring;
2167
+ }).join('').match(formattingTokensRegExp).map(function (substring) {
2168
+ // Replace two single quote characters with one single quote character
2169
+ if (substring === "''") {
2170
+ return "'";
2171
+ }
2172
+ var firstCharacter = substring[0];
2173
+ if (firstCharacter === "'") {
2174
+ return cleanEscapedString(substring);
2175
+ }
2176
+ var formatter = formatters$1[firstCharacter];
2177
+ if (formatter) {
2178
+ if (!(options !== null && options !== void 0 && options.useAdditionalWeekYearTokens) && isProtectedWeekYearToken(substring)) {
2179
+ throwProtectedError(substring, dirtyFormatStr, String(dirtyDate));
2180
+ }
2181
+ if (!(options !== null && options !== void 0 && options.useAdditionalDayOfYearTokens) && isProtectedDayOfYearToken(substring)) {
2182
+ throwProtectedError(substring, dirtyFormatStr, String(dirtyDate));
2183
+ }
2184
+ return formatter(utcDate, substring, locale.localize, formatterOptions);
2185
+ }
2186
+ if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
2187
+ throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`');
2188
+ }
2189
+ return substring;
2190
+ }).join('');
2191
+ return result;
2192
+ }
2193
+ function cleanEscapedString(input) {
2194
+ var matched = input.match(escapedStringRegExp);
2195
+ if (!matched) {
2196
+ return input;
2197
+ }
2198
+ return matched[1].replace(doubleQuoteRegExp, "'");
2199
+ }
2200
+
2201
+ const DEFAULT_LANGUAGE = 'en';
2202
+ const SUPPORTED_LANGUAGES = ['ro', 'en'];
2203
+ const TRANSLATIONS = {
2204
+ en: {
2205
+ redeem: 'Redeem',
2206
+ expireOn: 'Expire on ',
2207
+ pointsToBeExpired: '${expirationPoints} points to expire in ${expireDay} days',
2208
+ pointsToBeExpiredDay: '${expirationPoints} points to expire in ${expireDay} day',
2209
+ pointsToBeExpiredHours: '${expirationPoints} points to expire in ${expireDay} hours',
2210
+ pointsToBeExpiredHour: '${expirationPoints} points to expire in ${expireDay} hour',
2211
+ tipsForNextLevel: 'Need ${pointsToReach} to reach ${levelName}',
2212
+ spendablePoints: 'Spendable Points:',
2213
+ details: 'Details',
2214
+ earningRules: 'Earning Rules',
2215
+ xp: 'XP',
2216
+ sp: 'Coins',
2217
+ termAndConditions: 'Term & Conditions',
2218
+ },
2219
+ 'zh-hk': {
2220
+ redeem: '兑奖',
2221
+ expireOn: 'Expire on ',
2222
+ pointsToBeExpired: '${expirationPoints} points to expire in ${expireDay} days',
2223
+ pointsToBeExpiredDay: '${expirationPoints} points to expire in ${expireDay} day',
2224
+ pointsToBeExpiredHours: '${expirationPoints} points to expire in ${expireDay} hours',
2225
+ pointsToBeExpiredHour: '${expirationPoints} points to expire in ${expireDay} hour',
2226
+ tipsForNextLevel: 'Need ${pointsToReach} to reach ${levelName}',
2227
+ spendablePoints: 'Spendable Points:',
2228
+ details: '明细',
2229
+ earningRules: 'Earning Rules',
2230
+ xp: 'XP',
2231
+ sp: 'Coins',
2232
+ termAndConditions: 'Term & Conditions',
2233
+ },
2234
+ de: {
2235
+ redeem: 'Redeem',
2236
+ expireOn: 'Expire on ',
2237
+ pointsToBeExpired: '${expirationPoints} points to expire in ${expireDay} days',
2238
+ pointsToBeExpiredDay: '${expirationPoints} points to expire in ${expireDay} day',
2239
+ pointsToBeExpiredHours: '${expirationPoints} points to expire in ${expireDay} hours',
2240
+ pointsToBeExpiredHour: '${expirationPoints} points to expire in ${expireDay} hour',
2241
+ tipsForNextLevel: 'Need ${pointsToReach} to reach ${levelName}',
2242
+ spendablePoints: 'Spendable Points:',
2243
+ details: 'Details',
2244
+ earningRules: 'Earning Rules',
2245
+ xp: 'XP',
2246
+ sp: 'Coins',
2247
+ termAndConditions: 'Term & Conditions',
2248
+ },
2249
+ it: {
2250
+ redeem: 'Redeem',
2251
+ expireOn: 'Expire on ',
2252
+ pointsToBeExpired: '${expirationPoints} points to expire in ${expireDay} days',
2253
+ pointsToBeExpiredDay: '${expirationPoints} points to expire in ${expireDay} day',
2254
+ pointsToBeExpiredHours: '${expirationPoints} points to expire in ${expireDay} hours',
2255
+ pointsToBeExpiredHour: '${expirationPoints} points to expire in ${expireDay} hour',
2256
+ tipsForNextLevel: 'Need ${pointsToReach} to reach ${levelName}',
2257
+ spendablePoints: 'Spendable Points:',
2258
+ details: 'Details',
2259
+ earningRules: 'Earning Rules',
2260
+ xp: 'XP',
2261
+ sp: 'Coins',
2262
+ termAndConditions: 'Term & Conditions',
2263
+ },
2264
+ fr: {
2265
+ redeem: 'Redeem',
2266
+ expireOn: 'Expire on ',
2267
+ pointsToBeExpired: '${expirationPoints} points to expire in ${expireDay} days',
2268
+ pointsToBeExpiredDay: '${expirationPoints} points to expire in ${expireDay} day',
2269
+ pointsToBeExpiredHours: '${expirationPoints} points to expire in ${expireDay} hours',
2270
+ pointsToBeExpiredHour: '${expirationPoints} points to expire in ${expireDay} hour',
2271
+ tipsForNextLevel: 'Need ${pointsToReach} to reach ${levelName}',
2272
+ spendablePoints: 'Spendable Points:',
2273
+ details: 'Details',
2274
+ earningRules: 'Earning Rules',
2275
+ xp: 'XP',
2276
+ sp: 'Coins',
2277
+ termAndConditions: 'Term & Conditions',
2278
+ },
2279
+ es: {
2280
+ redeem: 'Redeem'
2281
+ },
2282
+ tr: {
2283
+ redeem: 'Redeem'
2284
+ },
2285
+ ru: {
2286
+ redeem: 'Redeem'
2287
+ },
2288
+ ro: {
2289
+ redeem: 'Redeem'
2290
+ },
2291
+ hr: {
2292
+ redeem: 'Otkupiti',
2293
+ expireOn: 'Istječe',
2294
+ pointsToBeExpired: '${expirationPoints} bodova ističe za ${expireDay} dana',
2295
+ tipsForNextLevel: 'Trebate ${pointsToReach} da dosegnete razinu ${levelName}',
2296
+ spendablePoints: 'Bodovi za potrošit:',
2297
+ details: 'Detalji',
2298
+ xp: 'XP',
2299
+ },
2300
+ hu: {
2301
+ redeem: 'Redeem'
2302
+ },
2303
+ pl: {
2304
+ redeem: 'Redeem'
2305
+ },
2306
+ pt: {
2307
+ redeem: 'Redeem'
2308
+ },
2309
+ sl: {
2310
+ redeem: 'Redeem'
2311
+ },
2312
+ sr: {
2313
+ redeem: 'Redeem'
2314
+ }
2315
+ };
2316
+ const translate = (key, customLang) => {
2317
+ const lang = customLang;
2318
+ return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
2319
+ };
2320
+ const translateWithParams = (key, params) => {
2321
+ const lang = params['lang'];
2322
+ let templateString = TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
2323
+ if (!params) {
2324
+ return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
2325
+ }
2326
+ Object.keys(params).forEach((paramName) => {
2327
+ templateString = templateString.replace(new RegEx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iByZXN1bHQ9InNoYXBlIi8+CjwvZmlsdGVyPgo8L2RlZnM+Cjwvc3ZnPgo=';
2335
+
2336
+ const PlayerLoyaltyProcess = () => (index.h("span", { class: "LevelProgress", id: 'LevelProgress', innerHTML: levelPercentSvg }));
2337
+ const PlayerPoints = ({ loyaltyPoints, spendablePoints, pointExpireString, language, }) => (index.h("div", { class: "PointsInfo" }, loyaltyPoints &&
2338
+ index.h("div", { class: 'Points' }, loyaltyPoints, " ", index.h("sub", { class: "XP" }, translate('xp', language))), spendablePoints &&
2339
+ index.h("div", { class: 'Points' }, spendablePoints, " ", index.h("sub", { class: "XP" }, translate('sp', language))), pointExpireString && (index.h("div", { class: 'ExpirationPoints' }, pointExpireString, " "))));
2340
+ const PlayerElevateCardRedeem = ({ language, onRedeemClick }) => (index.h("div", { class: "CardCell Redeem" }, index.h("div", { class: "RedeemButton", onClick: () => {
2341
+ onRedeemClick();
2342
+ } }, index.h("span", null, translate('redeem', language)))));
2343
+ const PlayerNameDiv = (props) => (index.h("div", { class: 'CardCell PlayerName Txt' }, props.playerName));
2344
+ const PlayerElevateLoyaltyLevel = (props) => (index.h("div", { class: 'CardCell ElevateLevel' }, index.h("span", { class: "LevelName", title: props.level }, props.level), props.expireTime && (index.h("div", { class: "CardCell ExpirationDate Txt" }, translate('expireOn', props.language), index.h("span", { class: "ExpireTime" }, format(new Date(props.expireTime), props.dateFormat || 'yyyy-MM-dd')), !props.hideInfo && (index.h("span", { class: "fa Info", style: { 'background': `url(${index.getAssetPath('../static/info.svg')})` } }, index.h("span", { class: "InfoTips", innerHTML: tipsInfoSvg })))))));
2345
+ const PlayerAvatar = (props) => {
2346
+ const badge = props.loyaltyIconUrl
2347
+ ? index.h("img", { class: "Badge", src: props.loyaltyIconUrl })
2348
+ : props.hideIfNull ? '' : index.h("div", { class: "Badge" });
2349
+ const avatarSrc = props.playerAvatarUrl || index.getAssetPath('../static/user.svg');
2350
+ return index.h("div", { class: "PlayerAvatar", style: { 'position': `${props.onlyBadge ? '' : 'relative'}` } }, !props.onlyBadge && index.h("img", { class: "Avatar", src: avatarSrc }), badge);
2351
+ };
2352
+
2353
+ exports.PlayerAvatar = PlayerAvatar;
2354
+ exports.PlayerElevateCardRedeem = PlayerElevateCardRedeem;
2355
+ exports.PlayerElevateLoyaltyLevel = PlayerElevateLoyaltyLevel;
2356
+ exports.PlayerLoyaltyProcess = PlayerLoyaltyProcess;
2357
+ exports.PlayerNameDiv = PlayerNameDiv;
2358
+ exports.PlayerPoints = PlayerPoints;
2359
+ exports.TRANSLATIONS = TRANSLATIONS;
2360
+ exports.getTimezoneOffsetInMilliseconds = getTimezoneOffsetInMilliseconds;
2361
+ exports.requiredArgs = requiredArgs;
2362
+ exports.toDate = toDate;
2363
+ exports.translate = translate;
2364
+ exports.translateWithParams = translateWithParams;