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