@everymatrix/casino-engagement-suite-challenges-list 1.43.4 → 1.45.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 (56) hide show
  1. package/dist/casino-engagement-suite-challenges-list/casino-engagement-suite-challenges-list.esm.js +1 -1
  2. package/dist/casino-engagement-suite-challenges-list/p-7fd72b22.js +2 -0
  3. package/dist/casino-engagement-suite-challenges-list/p-dd67e263.entry.js +1 -0
  4. package/dist/casino-engagement-suite-challenges-list/p-e1255160.js +1 -0
  5. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  6. package/dist/cjs/casino-engagement-suite-challenges-list.cjs.js +17 -11
  7. package/dist/cjs/casino-engagement-suite-challenges-list_2.cjs.entry.js +444 -466
  8. package/dist/cjs/index-97488095.js +1316 -0
  9. package/dist/cjs/loader.cjs.js +7 -13
  10. package/dist/collection/collection-manifest.json +3 -3
  11. package/dist/collection/components/casino-engagement-suite-challenges-list/casino-engagement-suite-challenges-list.css +112 -111
  12. package/dist/collection/components/casino-engagement-suite-challenges-list/casino-engagement-suite-challenges-list.js +480 -524
  13. package/dist/collection/components/casino-engagement-suite-challenges-list/index.js +1 -0
  14. package/dist/collection/models/challenge.js +18 -18
  15. package/dist/collection/renders/ChallengesHistory.js +31 -47
  16. package/dist/collection/utils/locale.utils.js +26 -26
  17. package/dist/collection/utils/utils.js +3 -0
  18. package/dist/esm/app-globals-0f993ce5.js +3 -0
  19. package/dist/esm/casino-engagement-suite-challenges-list.js +14 -11
  20. package/dist/esm/casino-engagement-suite-challenges-list_2.entry.js +444 -466
  21. package/dist/esm/index-00eb432b.js +1288 -0
  22. package/dist/esm/loader.js +7 -13
  23. package/dist/stencil.config.dev.js +17 -0
  24. package/dist/stencil.config.js +14 -19
  25. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/casino-engagement-suite-challenges-list/.stencil/packages/stencil/casino-engagement-suite-challenges-list/stencil.config.d.ts +2 -0
  26. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/casino-engagement-suite-challenges-list/.stencil/packages/stencil/casino-engagement-suite-challenges-list/stencil.config.dev.d.ts +2 -0
  27. package/dist/types/components/casino-engagement-suite-challenges-list/casino-engagement-suite-challenges-list.d.ts +81 -81
  28. package/dist/types/components/casino-engagement-suite-challenges-list/index.d.ts +1 -0
  29. package/dist/types/components.d.ts +19 -2
  30. package/dist/types/models/challenge.d.ts +65 -65
  31. package/dist/types/stencil-public-runtime.d.ts +142 -33
  32. package/dist/types/utils/utils.d.ts +1 -0
  33. package/loader/cdn.js +1 -3
  34. package/loader/index.cjs.js +1 -3
  35. package/loader/index.d.ts +13 -1
  36. package/loader/index.es2017.js +1 -3
  37. package/loader/index.js +1 -3
  38. package/loader/package.json +1 -0
  39. package/package.json +12 -2
  40. package/dist/casino-engagement-suite-challenges-list/p-2061b71e.entry.js +0 -1
  41. package/dist/casino-engagement-suite-challenges-list/p-fad4589e.js +0 -1
  42. package/dist/cjs/index-0a011384.js +0 -1336
  43. package/dist/components/casino-engagement-suite-challenges-list.d.ts +0 -11
  44. package/dist/components/casino-engagement-suite-challenges-list.js +0 -2650
  45. package/dist/components/casino-engagement-suite-progress-bar.js +0 -6
  46. package/dist/components/casino-engagement-suite-progress-bar2.js +0 -107
  47. package/dist/components/index.d.ts +0 -26
  48. package/dist/components/index.js +0 -1
  49. package/dist/esm/index-ddf7e990.js +0 -1309
  50. package/dist/esm/polyfills/core-js.js +0 -11
  51. package/dist/esm/polyfills/css-shim.js +0 -1
  52. package/dist/esm/polyfills/dom.js +0 -79
  53. package/dist/esm/polyfills/es5-html-element.js +0 -1
  54. package/dist/esm/polyfills/index.js +0 -34
  55. package/dist/esm/polyfills/system.js +0 -6
  56. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/casino-engagement-suite-challenges-list/.stencil/packages/casino-engagement-suite-challenges-list/stencil.config.d.ts +0 -2
@@ -1,2650 +0,0 @@
1
- import { h, proxyCustomElement, HTMLElement, createEvent } from '@stencil/core/internal/client';
2
- import { d as defineCustomElement$2 } from './casino-engagement-suite-progress-bar2.js';
3
-
4
- var ChallengeRewardType;
5
- (function (ChallengeRewardType) {
6
- ChallengeRewardType[ChallengeRewardType["FreeSpins"] = 0] = "FreeSpins";
7
- ChallengeRewardType[ChallengeRewardType["LuckyWheel"] = 1] = "LuckyWheel";
8
- ChallengeRewardType[ChallengeRewardType["Leaderboard"] = 2] = "Leaderboard";
9
- ChallengeRewardType[ChallengeRewardType["Challenge"] = 3] = "Challenge";
10
- ChallengeRewardType[ChallengeRewardType["Custom"] = 4] = "Custom";
11
- })(ChallengeRewardType || (ChallengeRewardType = {}));
12
- var ChallengeHistoryLevelStatus;
13
- (function (ChallengeHistoryLevelStatus) {
14
- ChallengeHistoryLevelStatus[ChallengeHistoryLevelStatus["Completed"] = 0] = "Completed";
15
- ChallengeHistoryLevelStatus[ChallengeHistoryLevelStatus["Expired"] = 1] = "Expired";
16
- ChallengeHistoryLevelStatus[ChallengeHistoryLevelStatus["Forfeited"] = 2] = "Forfeited";
17
- })(ChallengeHistoryLevelStatus || (ChallengeHistoryLevelStatus = {}));
18
- var ChallengeLevelProgressStatus;
19
- (function (ChallengeLevelProgressStatus) {
20
- ChallengeLevelProgressStatus[ChallengeLevelProgressStatus["Closed"] = 0] = "Closed";
21
- ChallengeLevelProgressStatus[ChallengeLevelProgressStatus["InProgress"] = 1] = "InProgress";
22
- ChallengeLevelProgressStatus[ChallengeLevelProgressStatus["Fillup"] = 2] = "Fillup";
23
- ChallengeLevelProgressStatus[ChallengeLevelProgressStatus["Completed"] = 3] = "Completed";
24
- })(ChallengeLevelProgressStatus || (ChallengeLevelProgressStatus = {}));
25
- var ChallengeProgressStatus;
26
- (function (ChallengeProgressStatus) {
27
- ChallengeProgressStatus[ChallengeProgressStatus["Started"] = 0] = "Started";
28
- ChallengeProgressStatus[ChallengeProgressStatus["InProgress"] = 1] = "InProgress";
29
- ChallengeProgressStatus[ChallengeProgressStatus["PendingLevelReward"] = 2] = "PendingLevelReward";
30
- ChallengeProgressStatus[ChallengeProgressStatus["Completed"] = 3] = "Completed";
31
- ChallengeProgressStatus[ChallengeProgressStatus["Expired"] = 4] = "Expired";
32
- ChallengeProgressStatus[ChallengeProgressStatus["Forfeited"] = 5] = "Forfeited";
33
- })(ChallengeProgressStatus || (ChallengeProgressStatus = {}));
34
-
35
- const DEFAULT_LANGUAGE = 'en';
36
- const SUPPORTED_LANGUAGES = ['en'];
37
- const TRANSLATIONS = {
38
- en: {
39
- missions: 'Missions',
40
- join: 'Join',
41
- unjoin: 'Unjoin',
42
- new: 'new',
43
- noMissions: 'No Missions yet',
44
- tryOtherGames: 'Try winning Missions as rewards or launching other booster games',
45
- tooltip: 'Mission where your real money bets contribute towards the level progress to achieve the level reward',
46
- history: 'History',
47
- level: 'Level',
48
- status: 'Status',
49
- time: 'Time',
50
- loading: 'Loading...',
51
- completed: 'Completed',
52
- expired: 'Expired',
53
- forfeited: 'Forfeited',
54
- noHistory: 'No missions’ history available (last 30 days)',
55
- freeSpins: 'Free Spins',
56
- luckyWheel: 'Lucky Wheel',
57
- leaderboard: 'Leaderboard',
58
- mission: 'Mission',
59
- missionHasBeenForfeited: 'The mission has been canceled.',
60
- support: 'Please, contact support.'
61
- }
62
- };
63
- const translate = (key, customLang) => {
64
- const lang = customLang;
65
- return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
66
- };
67
-
68
- function _typeof(o) {
69
- "@babel/helpers - typeof";
70
-
71
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
72
- return typeof o;
73
- } : function (o) {
74
- return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
75
- }, _typeof(o);
76
- }
77
-
78
- function toInteger(dirtyNumber) {
79
- if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
80
- return NaN;
81
- }
82
- var number = Number(dirtyNumber);
83
- if (isNaN(number)) {
84
- return number;
85
- }
86
- return number < 0 ? Math.ceil(number) : Math.floor(number);
87
- }
88
-
89
- function requiredArgs(required, args) {
90
- if (args.length < required) {
91
- throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');
92
- }
93
- }
94
-
95
- /**
96
- * @name toDate
97
- * @category Common Helpers
98
- * @summary Convert the given argument to an instance of Date.
99
- *
100
- * @description
101
- * Convert the given argument to an instance of Date.
102
- *
103
- * If the argument is an instance of Date, the function returns its clone.
104
- *
105
- * If the argument is a number, it is treated as a timestamp.
106
- *
107
- * If the argument is none of the above, the function returns Invalid Date.
108
- *
109
- * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
110
- *
111
- * @param {Date|Number} argument - the value to convert
112
- * @returns {Date} the parsed date in the local time zone
113
- * @throws {TypeError} 1 argument required
114
- *
115
- * @example
116
- * // Clone the date:
117
- * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
118
- * //=> Tue Feb 11 2014 11:30:30
119
- *
120
- * @example
121
- * // Convert the timestamp to date:
122
- * const result = toDate(1392098430000)
123
- * //=> Tue Feb 11 2014 11:30:30
124
- */
125
- function toDate(argument) {
126
- requiredArgs(1, arguments);
127
- var argStr = Object.prototype.toString.call(argument);
128
-
129
- // Clone the date
130
- if (argument instanceof Date || _typeof(argument) === 'object' && argStr === '[object Date]') {
131
- // Prevent the date to lose the milliseconds when passed to new Date() in IE10
132
- return new Date(argument.getTime());
133
- } else if (typeof argument === 'number' || argStr === '[object Number]') {
134
- return new Date(argument);
135
- } else {
136
- if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
137
- // eslint-disable-next-line no-console
138
- 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");
139
- // eslint-disable-next-line no-console
140
- console.warn(new Error().stack);
141
- }
142
- return new Date(NaN);
143
- }
144
- }
145
-
146
- /**
147
- * @name addMilliseconds
148
- * @category Millisecond Helpers
149
- * @summary Add the specified number of milliseconds to the given date.
150
- *
151
- * @description
152
- * Add the specified number of milliseconds to the given date.
153
- *
154
- * @param {Date|Number} date - the date to be changed
155
- * @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`.
156
- * @returns {Date} the new date with the milliseconds added
157
- * @throws {TypeError} 2 arguments required
158
- *
159
- * @example
160
- * // Add 750 milliseconds to 10 July 2014 12:45:30.000:
161
- * const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
162
- * //=> Thu Jul 10 2014 12:45:30.750
163
- */
164
- function addMilliseconds(dirtyDate, dirtyAmount) {
165
- requiredArgs(2, arguments);
166
- var timestamp = toDate(dirtyDate).getTime();
167
- var amount = toInteger(dirtyAmount);
168
- return new Date(timestamp + amount);
169
- }
170
-
171
- var defaultOptions = {};
172
- function getDefaultOptions() {
173
- return defaultOptions;
174
- }
175
-
176
- /**
177
- * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
178
- * They usually appear for dates that denote time before the timezones were introduced
179
- * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
180
- * and GMT+01:00:00 after that date)
181
- *
182
- * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
183
- * which would lead to incorrect calculations.
184
- *
185
- * This function returns the timezone offset in milliseconds that takes seconds in account.
186
- */
187
- function getTimezoneOffsetInMilliseconds(date) {
188
- var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));
189
- utcDate.setUTCFullYear(date.getFullYear());
190
- return date.getTime() - utcDate.getTime();
191
- }
192
-
193
- /**
194
- * @name isDate
195
- * @category Common Helpers
196
- * @summary Is the given value a date?
197
- *
198
- * @description
199
- * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.
200
- *
201
- * @param {*} value - the value to check
202
- * @returns {boolean} true if the given value is a date
203
- * @throws {TypeError} 1 arguments required
204
- *
205
- * @example
206
- * // For a valid date:
207
- * const result = isDate(new Date())
208
- * //=> true
209
- *
210
- * @example
211
- * // For an invalid date:
212
- * const result = isDate(new Date(NaN))
213
- * //=> true
214
- *
215
- * @example
216
- * // For some value:
217
- * const result = isDate('2014-02-31')
218
- * //=> false
219
- *
220
- * @example
221
- * // For an object:
222
- * const result = isDate({})
223
- * //=> false
224
- */
225
- function isDate(value) {
226
- requiredArgs(1, arguments);
227
- return value instanceof Date || _typeof(value) === 'object' && Object.prototype.toString.call(value) === '[object Date]';
228
- }
229
-
230
- /**
231
- * @name isValid
232
- * @category Common Helpers
233
- * @summary Is the given date valid?
234
- *
235
- * @description
236
- * Returns false if argument is Invalid Date and true otherwise.
237
- * Argument is converted to Date using `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate}
238
- * Invalid Date is a Date, whose time value is NaN.
239
- *
240
- * Time value of Date: http://es5.github.io/#x15.9.1.1
241
- *
242
- * @param {*} date - the date to check
243
- * @returns {Boolean} the date is valid
244
- * @throws {TypeError} 1 argument required
245
- *
246
- * @example
247
- * // For the valid date:
248
- * const result = isValid(new Date(2014, 1, 31))
249
- * //=> true
250
- *
251
- * @example
252
- * // For the value, convertable into a date:
253
- * const result = isValid(1393804800000)
254
- * //=> true
255
- *
256
- * @example
257
- * // For the invalid date:
258
- * const result = isValid(new Date(''))
259
- * //=> false
260
- */
261
- function isValid(dirtyDate) {
262
- requiredArgs(1, arguments);
263
- if (!isDate(dirtyDate) && typeof dirtyDate !== 'number') {
264
- return false;
265
- }
266
- var date = toDate(dirtyDate);
267
- return !isNaN(Number(date));
268
- }
269
-
270
- /**
271
- * @name subMilliseconds
272
- * @category Millisecond Helpers
273
- * @summary Subtract the specified number of milliseconds from the given date.
274
- *
275
- * @description
276
- * Subtract the specified number of milliseconds from the given date.
277
- *
278
- * @param {Date|Number} date - the date to be changed
279
- * @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`.
280
- * @returns {Date} the new date with the milliseconds subtracted
281
- * @throws {TypeError} 2 arguments required
282
- *
283
- * @example
284
- * // Subtract 750 milliseconds from 10 July 2014 12:45:30.000:
285
- * const result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
286
- * //=> Thu Jul 10 2014 12:45:29.250
287
- */
288
- function subMilliseconds(dirtyDate, dirtyAmount) {
289
- requiredArgs(2, arguments);
290
- var amount = toInteger(dirtyAmount);
291
- return addMilliseconds(dirtyDate, -amount);
292
- }
293
-
294
- var MILLISECONDS_IN_DAY = 86400000;
295
- function getUTCDayOfYear(dirtyDate) {
296
- requiredArgs(1, arguments);
297
- var date = toDate(dirtyDate);
298
- var timestamp = date.getTime();
299
- date.setUTCMonth(0, 1);
300
- date.setUTCHours(0, 0, 0, 0);
301
- var startOfYearTimestamp = date.getTime();
302
- var difference = timestamp - startOfYearTimestamp;
303
- return Math.floor(difference / MILLISECONDS_IN_DAY) + 1;
304
- }
305
-
306
- function startOfUTCISOWeek(dirtyDate) {
307
- requiredArgs(1, arguments);
308
- var weekStartsOn = 1;
309
- var date = toDate(dirtyDate);
310
- var day = date.getUTCDay();
311
- var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
312
- date.setUTCDate(date.getUTCDate() - diff);
313
- date.setUTCHours(0, 0, 0, 0);
314
- return date;
315
- }
316
-
317
- function getUTCISOWeekYear(dirtyDate) {
318
- requiredArgs(1, arguments);
319
- var date = toDate(dirtyDate);
320
- var year = date.getUTCFullYear();
321
- var fourthOfJanuaryOfNextYear = new Date(0);
322
- fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4);
323
- fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0);
324
- var startOfNextYear = startOfUTCISOWeek(fourthOfJanuaryOfNextYear);
325
- var fourthOfJanuaryOfThisYear = new Date(0);
326
- fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4);
327
- fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0);
328
- var startOfThisYear = startOfUTCISOWeek(fourthOfJanuaryOfThisYear);
329
- if (date.getTime() >= startOfNextYear.getTime()) {
330
- return year + 1;
331
- } else if (date.getTime() >= startOfThisYear.getTime()) {
332
- return year;
333
- } else {
334
- return year - 1;
335
- }
336
- }
337
-
338
- function startOfUTCISOWeekYear(dirtyDate) {
339
- requiredArgs(1, arguments);
340
- var year = getUTCISOWeekYear(dirtyDate);
341
- var fourthOfJanuary = new Date(0);
342
- fourthOfJanuary.setUTCFullYear(year, 0, 4);
343
- fourthOfJanuary.setUTCHours(0, 0, 0, 0);
344
- var date = startOfUTCISOWeek(fourthOfJanuary);
345
- return date;
346
- }
347
-
348
- var MILLISECONDS_IN_WEEK$1 = 604800000;
349
- function getUTCISOWeek(dirtyDate) {
350
- requiredArgs(1, arguments);
351
- var date = toDate(dirtyDate);
352
- var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime();
353
-
354
- // Round the number of days to the nearest integer
355
- // because the number of milliseconds in a week is not constant
356
- // (e.g. it's different in the week of the daylight saving time clock shift)
357
- return Math.round(diff / MILLISECONDS_IN_WEEK$1) + 1;
358
- }
359
-
360
- function startOfUTCWeek(dirtyDate, options) {
361
- var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
362
- requiredArgs(1, arguments);
363
- var defaultOptions = getDefaultOptions();
364
- 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);
365
-
366
- // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
367
- if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
368
- throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
369
- }
370
- var date = toDate(dirtyDate);
371
- var day = date.getUTCDay();
372
- var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
373
- date.setUTCDate(date.getUTCDate() - diff);
374
- date.setUTCHours(0, 0, 0, 0);
375
- return date;
376
- }
377
-
378
- function getUTCWeekYear(dirtyDate, options) {
379
- var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
380
- requiredArgs(1, arguments);
381
- var date = toDate(dirtyDate);
382
- var year = date.getUTCFullYear();
383
- var defaultOptions = getDefaultOptions();
384
- 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);
385
-
386
- // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
387
- if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
388
- throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
389
- }
390
- var firstWeekOfNextYear = new Date(0);
391
- firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);
392
- firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);
393
- var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear, options);
394
- var firstWeekOfThisYear = new Date(0);
395
- firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);
396
- firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);
397
- var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, options);
398
- if (date.getTime() >= startOfNextYear.getTime()) {
399
- return year + 1;
400
- } else if (date.getTime() >= startOfThisYear.getTime()) {
401
- return year;
402
- } else {
403
- return year - 1;
404
- }
405
- }
406
-
407
- function startOfUTCWeekYear(dirtyDate, options) {
408
- var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
409
- requiredArgs(1, arguments);
410
- var defaultOptions = getDefaultOptions();
411
- 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);
412
- var year = getUTCWeekYear(dirtyDate, options);
413
- var firstWeek = new Date(0);
414
- firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate);
415
- firstWeek.setUTCHours(0, 0, 0, 0);
416
- var date = startOfUTCWeek(firstWeek, options);
417
- return date;
418
- }
419
-
420
- var MILLISECONDS_IN_WEEK = 604800000;
421
- function getUTCWeek(dirtyDate, options) {
422
- requiredArgs(1, arguments);
423
- var date = toDate(dirtyDate);
424
- var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime();
425
-
426
- // Round the number of days to the nearest integer
427
- // because the number of milliseconds in a week is not constant
428
- // (e.g. it's different in the week of the daylight saving time clock shift)
429
- return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;
430
- }
431
-
432
- function addLeadingZeros(number, targetLength) {
433
- var sign = number < 0 ? '-' : '';
434
- var output = Math.abs(number).toString();
435
- while (output.length < targetLength) {
436
- output = '0' + output;
437
- }
438
- return sign + output;
439
- }
440
-
441
- /*
442
- * | | Unit | | Unit |
443
- * |-----|--------------------------------|-----|--------------------------------|
444
- * | a | AM, PM | A* | |
445
- * | d | Day of month | D | |
446
- * | h | Hour [1-12] | H | Hour [0-23] |
447
- * | m | Minute | M | Month |
448
- * | s | Second | S | Fraction of second |
449
- * | y | Year (abs) | Y | |
450
- *
451
- * Letters marked by * are not implemented but reserved by Unicode standard.
452
- */
453
- var formatters$1 = {
454
- // Year
455
- y: function y(date, token) {
456
- // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens
457
- // | Year | y | yy | yyy | yyyy | yyyyy |
458
- // |----------|-------|----|-------|-------|-------|
459
- // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
460
- // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
461
- // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
462
- // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
463
- // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
464
-
465
- var signedYear = date.getUTCFullYear();
466
- // Returns 1 for 1 BC (which is year 0 in JavaScript)
467
- var year = signedYear > 0 ? signedYear : 1 - signedYear;
468
- return addLeadingZeros(token === 'yy' ? year % 100 : year, token.length);
469
- },
470
- // Month
471
- M: function M(date, token) {
472
- var month = date.getUTCMonth();
473
- return token === 'M' ? String(month + 1) : addLeadingZeros(month + 1, 2);
474
- },
475
- // Day of the month
476
- d: function d(date, token) {
477
- return addLeadingZeros(date.getUTCDate(), token.length);
478
- },
479
- // AM or PM
480
- a: function a(date, token) {
481
- var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? 'pm' : 'am';
482
- switch (token) {
483
- case 'a':
484
- case 'aa':
485
- return dayPeriodEnumValue.toUpperCase();
486
- case 'aaa':
487
- return dayPeriodEnumValue;
488
- case 'aaaaa':
489
- return dayPeriodEnumValue[0];
490
- case 'aaaa':
491
- default:
492
- return dayPeriodEnumValue === 'am' ? 'a.m.' : 'p.m.';
493
- }
494
- },
495
- // Hour [1-12]
496
- h: function h(date, token) {
497
- return addLeadingZeros(date.getUTCHours() % 12 || 12, token.length);
498
- },
499
- // Hour [0-23]
500
- H: function H(date, token) {
501
- return addLeadingZeros(date.getUTCHours(), token.length);
502
- },
503
- // Minute
504
- m: function m(date, token) {
505
- return addLeadingZeros(date.getUTCMinutes(), token.length);
506
- },
507
- // Second
508
- s: function s(date, token) {
509
- return addLeadingZeros(date.getUTCSeconds(), token.length);
510
- },
511
- // Fraction of second
512
- S: function S(date, token) {
513
- var numberOfDigits = token.length;
514
- var milliseconds = date.getUTCMilliseconds();
515
- var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3));
516
- return addLeadingZeros(fractionalSeconds, token.length);
517
- }
518
- };
519
-
520
- var dayPeriodEnum = {
521
- am: 'am',
522
- pm: 'pm',
523
- midnight: 'midnight',
524
- noon: 'noon',
525
- morning: 'morning',
526
- afternoon: 'afternoon',
527
- evening: 'evening',
528
- night: 'night'
529
- };
530
- /*
531
- * | | Unit | | Unit |
532
- * |-----|--------------------------------|-----|--------------------------------|
533
- * | a | AM, PM | A* | Milliseconds in day |
534
- * | b | AM, PM, noon, midnight | B | Flexible day period |
535
- * | c | Stand-alone local day of week | C* | Localized hour w/ day period |
536
- * | d | Day of month | D | Day of year |
537
- * | e | Local day of week | E | Day of week |
538
- * | f | | F* | Day of week in month |
539
- * | g* | Modified Julian day | G | Era |
540
- * | h | Hour [1-12] | H | Hour [0-23] |
541
- * | i! | ISO day of week | I! | ISO week of year |
542
- * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
543
- * | k | Hour [1-24] | K | Hour [0-11] |
544
- * | l* | (deprecated) | L | Stand-alone month |
545
- * | m | Minute | M | Month |
546
- * | n | | N | |
547
- * | o! | Ordinal number modifier | O | Timezone (GMT) |
548
- * | p! | Long localized time | P! | Long localized date |
549
- * | q | Stand-alone quarter | Q | Quarter |
550
- * | r* | Related Gregorian year | R! | ISO week-numbering year |
551
- * | s | Second | S | Fraction of second |
552
- * | t! | Seconds timestamp | T! | Milliseconds timestamp |
553
- * | u | Extended year | U* | Cyclic year |
554
- * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
555
- * | w | Local week of year | W* | Week of month |
556
- * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
557
- * | y | Year (abs) | Y | Local week-numbering year |
558
- * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
559
- *
560
- * Letters marked by * are not implemented but reserved by Unicode standard.
561
- *
562
- * Letters marked by ! are non-standard, but implemented by date-fns:
563
- * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)
564
- * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
565
- * i.e. 7 for Sunday, 1 for Monday, etc.
566
- * - `I` is ISO week of year, as opposed to `w` which is local week of year.
567
- * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
568
- * `R` is supposed to be used in conjunction with `I` and `i`
569
- * for universal ISO week-numbering date, whereas
570
- * `Y` is supposed to be used in conjunction with `w` and `e`
571
- * for week-numbering date specific to the locale.
572
- * - `P` is long localized date format
573
- * - `p` is long localized time format
574
- */
575
-
576
- var formatters = {
577
- // Era
578
- G: function G(date, token, localize) {
579
- var era = date.getUTCFullYear() > 0 ? 1 : 0;
580
- switch (token) {
581
- // AD, BC
582
- case 'G':
583
- case 'GG':
584
- case 'GGG':
585
- return localize.era(era, {
586
- width: 'abbreviated'
587
- });
588
- // A, B
589
- case 'GGGGG':
590
- return localize.era(era, {
591
- width: 'narrow'
592
- });
593
- // Anno Domini, Before Christ
594
- case 'GGGG':
595
- default:
596
- return localize.era(era, {
597
- width: 'wide'
598
- });
599
- }
600
- },
601
- // Year
602
- y: function y(date, token, localize) {
603
- // Ordinal number
604
- if (token === 'yo') {
605
- var signedYear = date.getUTCFullYear();
606
- // Returns 1 for 1 BC (which is year 0 in JavaScript)
607
- var year = signedYear > 0 ? signedYear : 1 - signedYear;
608
- return localize.ordinalNumber(year, {
609
- unit: 'year'
610
- });
611
- }
612
- return formatters$1.y(date, token);
613
- },
614
- // Local week-numbering year
615
- Y: function Y(date, token, localize, options) {
616
- var signedWeekYear = getUTCWeekYear(date, options);
617
- // Returns 1 for 1 BC (which is year 0 in JavaScript)
618
- var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
619
-
620
- // Two digit year
621
- if (token === 'YY') {
622
- var twoDigitYear = weekYear % 100;
623
- return addLeadingZeros(twoDigitYear, 2);
624
- }
625
-
626
- // Ordinal number
627
- if (token === 'Yo') {
628
- return localize.ordinalNumber(weekYear, {
629
- unit: 'year'
630
- });
631
- }
632
-
633
- // Padding
634
- return addLeadingZeros(weekYear, token.length);
635
- },
636
- // ISO week-numbering year
637
- R: function R(date, token) {
638
- var isoWeekYear = getUTCISOWeekYear(date);
639
-
640
- // Padding
641
- return addLeadingZeros(isoWeekYear, token.length);
642
- },
643
- // Extended year. This is a single number designating the year of this calendar system.
644
- // The main difference between `y` and `u` localizers are B.C. years:
645
- // | Year | `y` | `u` |
646
- // |------|-----|-----|
647
- // | AC 1 | 1 | 1 |
648
- // | BC 1 | 1 | 0 |
649
- // | BC 2 | 2 | -1 |
650
- // Also `yy` always returns the last two digits of a year,
651
- // while `uu` pads single digit years to 2 characters and returns other years unchanged.
652
- u: function u(date, token) {
653
- var year = date.getUTCFullYear();
654
- return addLeadingZeros(year, token.length);
655
- },
656
- // Quarter
657
- Q: function Q(date, token, localize) {
658
- var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
659
- switch (token) {
660
- // 1, 2, 3, 4
661
- case 'Q':
662
- return String(quarter);
663
- // 01, 02, 03, 04
664
- case 'QQ':
665
- return addLeadingZeros(quarter, 2);
666
- // 1st, 2nd, 3rd, 4th
667
- case 'Qo':
668
- return localize.ordinalNumber(quarter, {
669
- unit: 'quarter'
670
- });
671
- // Q1, Q2, Q3, Q4
672
- case 'QQQ':
673
- return localize.quarter(quarter, {
674
- width: 'abbreviated',
675
- context: 'formatting'
676
- });
677
- // 1, 2, 3, 4 (narrow quarter; could be not numerical)
678
- case 'QQQQQ':
679
- return localize.quarter(quarter, {
680
- width: 'narrow',
681
- context: 'formatting'
682
- });
683
- // 1st quarter, 2nd quarter, ...
684
- case 'QQQQ':
685
- default:
686
- return localize.quarter(quarter, {
687
- width: 'wide',
688
- context: 'formatting'
689
- });
690
- }
691
- },
692
- // Stand-alone quarter
693
- q: function q(date, token, localize) {
694
- var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
695
- switch (token) {
696
- // 1, 2, 3, 4
697
- case 'q':
698
- return String(quarter);
699
- // 01, 02, 03, 04
700
- case 'qq':
701
- return addLeadingZeros(quarter, 2);
702
- // 1st, 2nd, 3rd, 4th
703
- case 'qo':
704
- return localize.ordinalNumber(quarter, {
705
- unit: 'quarter'
706
- });
707
- // Q1, Q2, Q3, Q4
708
- case 'qqq':
709
- return localize.quarter(quarter, {
710
- width: 'abbreviated',
711
- context: 'standalone'
712
- });
713
- // 1, 2, 3, 4 (narrow quarter; could be not numerical)
714
- case 'qqqqq':
715
- return localize.quarter(quarter, {
716
- width: 'narrow',
717
- context: 'standalone'
718
- });
719
- // 1st quarter, 2nd quarter, ...
720
- case 'qqqq':
721
- default:
722
- return localize.quarter(quarter, {
723
- width: 'wide',
724
- context: 'standalone'
725
- });
726
- }
727
- },
728
- // Month
729
- M: function M(date, token, localize) {
730
- var month = date.getUTCMonth();
731
- switch (token) {
732
- case 'M':
733
- case 'MM':
734
- return formatters$1.M(date, token);
735
- // 1st, 2nd, ..., 12th
736
- case 'Mo':
737
- return localize.ordinalNumber(month + 1, {
738
- unit: 'month'
739
- });
740
- // Jan, Feb, ..., Dec
741
- case 'MMM':
742
- return localize.month(month, {
743
- width: 'abbreviated',
744
- context: 'formatting'
745
- });
746
- // J, F, ..., D
747
- case 'MMMMM':
748
- return localize.month(month, {
749
- width: 'narrow',
750
- context: 'formatting'
751
- });
752
- // January, February, ..., December
753
- case 'MMMM':
754
- default:
755
- return localize.month(month, {
756
- width: 'wide',
757
- context: 'formatting'
758
- });
759
- }
760
- },
761
- // Stand-alone month
762
- L: function L(date, token, localize) {
763
- var month = date.getUTCMonth();
764
- switch (token) {
765
- // 1, 2, ..., 12
766
- case 'L':
767
- return String(month + 1);
768
- // 01, 02, ..., 12
769
- case 'LL':
770
- return addLeadingZeros(month + 1, 2);
771
- // 1st, 2nd, ..., 12th
772
- case 'Lo':
773
- return localize.ordinalNumber(month + 1, {
774
- unit: 'month'
775
- });
776
- // Jan, Feb, ..., Dec
777
- case 'LLL':
778
- return localize.month(month, {
779
- width: 'abbreviated',
780
- context: 'standalone'
781
- });
782
- // J, F, ..., D
783
- case 'LLLLL':
784
- return localize.month(month, {
785
- width: 'narrow',
786
- context: 'standalone'
787
- });
788
- // January, February, ..., December
789
- case 'LLLL':
790
- default:
791
- return localize.month(month, {
792
- width: 'wide',
793
- context: 'standalone'
794
- });
795
- }
796
- },
797
- // Local week of year
798
- w: function w(date, token, localize, options) {
799
- var week = getUTCWeek(date, options);
800
- if (token === 'wo') {
801
- return localize.ordinalNumber(week, {
802
- unit: 'week'
803
- });
804
- }
805
- return addLeadingZeros(week, token.length);
806
- },
807
- // ISO week of year
808
- I: function I(date, token, localize) {
809
- var isoWeek = getUTCISOWeek(date);
810
- if (token === 'Io') {
811
- return localize.ordinalNumber(isoWeek, {
812
- unit: 'week'
813
- });
814
- }
815
- return addLeadingZeros(isoWeek, token.length);
816
- },
817
- // Day of the month
818
- d: function d(date, token, localize) {
819
- if (token === 'do') {
820
- return localize.ordinalNumber(date.getUTCDate(), {
821
- unit: 'date'
822
- });
823
- }
824
- return formatters$1.d(date, token);
825
- },
826
- // Day of year
827
- D: function D(date, token, localize) {
828
- var dayOfYear = getUTCDayOfYear(date);
829
- if (token === 'Do') {
830
- return localize.ordinalNumber(dayOfYear, {
831
- unit: 'dayOfYear'
832
- });
833
- }
834
- return addLeadingZeros(dayOfYear, token.length);
835
- },
836
- // Day of week
837
- E: function E(date, token, localize) {
838
- var dayOfWeek = date.getUTCDay();
839
- switch (token) {
840
- // Tue
841
- case 'E':
842
- case 'EE':
843
- case 'EEE':
844
- return localize.day(dayOfWeek, {
845
- width: 'abbreviated',
846
- context: 'formatting'
847
- });
848
- // T
849
- case 'EEEEE':
850
- return localize.day(dayOfWeek, {
851
- width: 'narrow',
852
- context: 'formatting'
853
- });
854
- // Tu
855
- case 'EEEEEE':
856
- return localize.day(dayOfWeek, {
857
- width: 'short',
858
- context: 'formatting'
859
- });
860
- // Tuesday
861
- case 'EEEE':
862
- default:
863
- return localize.day(dayOfWeek, {
864
- width: 'wide',
865
- context: 'formatting'
866
- });
867
- }
868
- },
869
- // Local day of week
870
- e: function e(date, token, localize, options) {
871
- var dayOfWeek = date.getUTCDay();
872
- var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
873
- switch (token) {
874
- // Numerical value (Nth day of week with current locale or weekStartsOn)
875
- case 'e':
876
- return String(localDayOfWeek);
877
- // Padded numerical value
878
- case 'ee':
879
- return addLeadingZeros(localDayOfWeek, 2);
880
- // 1st, 2nd, ..., 7th
881
- case 'eo':
882
- return localize.ordinalNumber(localDayOfWeek, {
883
- unit: 'day'
884
- });
885
- case 'eee':
886
- return localize.day(dayOfWeek, {
887
- width: 'abbreviated',
888
- context: 'formatting'
889
- });
890
- // T
891
- case 'eeeee':
892
- return localize.day(dayOfWeek, {
893
- width: 'narrow',
894
- context: 'formatting'
895
- });
896
- // Tu
897
- case 'eeeeee':
898
- return localize.day(dayOfWeek, {
899
- width: 'short',
900
- context: 'formatting'
901
- });
902
- // Tuesday
903
- case 'eeee':
904
- default:
905
- return localize.day(dayOfWeek, {
906
- width: 'wide',
907
- context: 'formatting'
908
- });
909
- }
910
- },
911
- // Stand-alone local day of week
912
- c: function c(date, token, localize, options) {
913
- var dayOfWeek = date.getUTCDay();
914
- var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
915
- switch (token) {
916
- // Numerical value (same as in `e`)
917
- case 'c':
918
- return String(localDayOfWeek);
919
- // Padded numerical value
920
- case 'cc':
921
- return addLeadingZeros(localDayOfWeek, token.length);
922
- // 1st, 2nd, ..., 7th
923
- case 'co':
924
- return localize.ordinalNumber(localDayOfWeek, {
925
- unit: 'day'
926
- });
927
- case 'ccc':
928
- return localize.day(dayOfWeek, {
929
- width: 'abbreviated',
930
- context: 'standalone'
931
- });
932
- // T
933
- case 'ccccc':
934
- return localize.day(dayOfWeek, {
935
- width: 'narrow',
936
- context: 'standalone'
937
- });
938
- // Tu
939
- case 'cccccc':
940
- return localize.day(dayOfWeek, {
941
- width: 'short',
942
- context: 'standalone'
943
- });
944
- // Tuesday
945
- case 'cccc':
946
- default:
947
- return localize.day(dayOfWeek, {
948
- width: 'wide',
949
- context: 'standalone'
950
- });
951
- }
952
- },
953
- // ISO day of week
954
- i: function i(date, token, localize) {
955
- var dayOfWeek = date.getUTCDay();
956
- var isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
957
- switch (token) {
958
- // 2
959
- case 'i':
960
- return String(isoDayOfWeek);
961
- // 02
962
- case 'ii':
963
- return addLeadingZeros(isoDayOfWeek, token.length);
964
- // 2nd
965
- case 'io':
966
- return localize.ordinalNumber(isoDayOfWeek, {
967
- unit: 'day'
968
- });
969
- // Tue
970
- case 'iii':
971
- return localize.day(dayOfWeek, {
972
- width: 'abbreviated',
973
- context: 'formatting'
974
- });
975
- // T
976
- case 'iiiii':
977
- return localize.day(dayOfWeek, {
978
- width: 'narrow',
979
- context: 'formatting'
980
- });
981
- // Tu
982
- case 'iiiiii':
983
- return localize.day(dayOfWeek, {
984
- width: 'short',
985
- context: 'formatting'
986
- });
987
- // Tuesday
988
- case 'iiii':
989
- default:
990
- return localize.day(dayOfWeek, {
991
- width: 'wide',
992
- context: 'formatting'
993
- });
994
- }
995
- },
996
- // AM or PM
997
- a: function a(date, token, localize) {
998
- var hours = date.getUTCHours();
999
- var dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
1000
- switch (token) {
1001
- case 'a':
1002
- case 'aa':
1003
- return localize.dayPeriod(dayPeriodEnumValue, {
1004
- width: 'abbreviated',
1005
- context: 'formatting'
1006
- });
1007
- case 'aaa':
1008
- return localize.dayPeriod(dayPeriodEnumValue, {
1009
- width: 'abbreviated',
1010
- context: 'formatting'
1011
- }).toLowerCase();
1012
- case 'aaaaa':
1013
- return localize.dayPeriod(dayPeriodEnumValue, {
1014
- width: 'narrow',
1015
- context: 'formatting'
1016
- });
1017
- case 'aaaa':
1018
- default:
1019
- return localize.dayPeriod(dayPeriodEnumValue, {
1020
- width: 'wide',
1021
- context: 'formatting'
1022
- });
1023
- }
1024
- },
1025
- // AM, PM, midnight, noon
1026
- b: function b(date, token, localize) {
1027
- var hours = date.getUTCHours();
1028
- var dayPeriodEnumValue;
1029
- if (hours === 12) {
1030
- dayPeriodEnumValue = dayPeriodEnum.noon;
1031
- } else if (hours === 0) {
1032
- dayPeriodEnumValue = dayPeriodEnum.midnight;
1033
- } else {
1034
- dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
1035
- }
1036
- switch (token) {
1037
- case 'b':
1038
- case 'bb':
1039
- return localize.dayPeriod(dayPeriodEnumValue, {
1040
- width: 'abbreviated',
1041
- context: 'formatting'
1042
- });
1043
- case 'bbb':
1044
- return localize.dayPeriod(dayPeriodEnumValue, {
1045
- width: 'abbreviated',
1046
- context: 'formatting'
1047
- }).toLowerCase();
1048
- case 'bbbbb':
1049
- return localize.dayPeriod(dayPeriodEnumValue, {
1050
- width: 'narrow',
1051
- context: 'formatting'
1052
- });
1053
- case 'bbbb':
1054
- default:
1055
- return localize.dayPeriod(dayPeriodEnumValue, {
1056
- width: 'wide',
1057
- context: 'formatting'
1058
- });
1059
- }
1060
- },
1061
- // in the morning, in the afternoon, in the evening, at night
1062
- B: function B(date, token, localize) {
1063
- var hours = date.getUTCHours();
1064
- var dayPeriodEnumValue;
1065
- if (hours >= 17) {
1066
- dayPeriodEnumValue = dayPeriodEnum.evening;
1067
- } else if (hours >= 12) {
1068
- dayPeriodEnumValue = dayPeriodEnum.afternoon;
1069
- } else if (hours >= 4) {
1070
- dayPeriodEnumValue = dayPeriodEnum.morning;
1071
- } else {
1072
- dayPeriodEnumValue = dayPeriodEnum.night;
1073
- }
1074
- switch (token) {
1075
- case 'B':
1076
- case 'BB':
1077
- case 'BBB':
1078
- return localize.dayPeriod(dayPeriodEnumValue, {
1079
- width: 'abbreviated',
1080
- context: 'formatting'
1081
- });
1082
- case 'BBBBB':
1083
- return localize.dayPeriod(dayPeriodEnumValue, {
1084
- width: 'narrow',
1085
- context: 'formatting'
1086
- });
1087
- case 'BBBB':
1088
- default:
1089
- return localize.dayPeriod(dayPeriodEnumValue, {
1090
- width: 'wide',
1091
- context: 'formatting'
1092
- });
1093
- }
1094
- },
1095
- // Hour [1-12]
1096
- h: function h(date, token, localize) {
1097
- if (token === 'ho') {
1098
- var hours = date.getUTCHours() % 12;
1099
- if (hours === 0) hours = 12;
1100
- return localize.ordinalNumber(hours, {
1101
- unit: 'hour'
1102
- });
1103
- }
1104
- return formatters$1.h(date, token);
1105
- },
1106
- // Hour [0-23]
1107
- H: function H(date, token, localize) {
1108
- if (token === 'Ho') {
1109
- return localize.ordinalNumber(date.getUTCHours(), {
1110
- unit: 'hour'
1111
- });
1112
- }
1113
- return formatters$1.H(date, token);
1114
- },
1115
- // Hour [0-11]
1116
- K: function K(date, token, localize) {
1117
- var hours = date.getUTCHours() % 12;
1118
- if (token === 'Ko') {
1119
- return localize.ordinalNumber(hours, {
1120
- unit: 'hour'
1121
- });
1122
- }
1123
- return addLeadingZeros(hours, token.length);
1124
- },
1125
- // Hour [1-24]
1126
- k: function k(date, token, localize) {
1127
- var hours = date.getUTCHours();
1128
- if (hours === 0) hours = 24;
1129
- if (token === 'ko') {
1130
- return localize.ordinalNumber(hours, {
1131
- unit: 'hour'
1132
- });
1133
- }
1134
- return addLeadingZeros(hours, token.length);
1135
- },
1136
- // Minute
1137
- m: function m(date, token, localize) {
1138
- if (token === 'mo') {
1139
- return localize.ordinalNumber(date.getUTCMinutes(), {
1140
- unit: 'minute'
1141
- });
1142
- }
1143
- return formatters$1.m(date, token);
1144
- },
1145
- // Second
1146
- s: function s(date, token, localize) {
1147
- if (token === 'so') {
1148
- return localize.ordinalNumber(date.getUTCSeconds(), {
1149
- unit: 'second'
1150
- });
1151
- }
1152
- return formatters$1.s(date, token);
1153
- },
1154
- // Fraction of second
1155
- S: function S(date, token) {
1156
- return formatters$1.S(date, token);
1157
- },
1158
- // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
1159
- X: function X(date, token, _localize, options) {
1160
- var originalDate = options._originalDate || date;
1161
- var timezoneOffset = originalDate.getTimezoneOffset();
1162
- if (timezoneOffset === 0) {
1163
- return 'Z';
1164
- }
1165
- switch (token) {
1166
- // Hours and optional minutes
1167
- case 'X':
1168
- return formatTimezoneWithOptionalMinutes(timezoneOffset);
1169
-
1170
- // Hours, minutes and optional seconds without `:` delimiter
1171
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1172
- // so this token always has the same output as `XX`
1173
- case 'XXXX':
1174
- case 'XX':
1175
- // Hours and minutes without `:` delimiter
1176
- return formatTimezone(timezoneOffset);
1177
-
1178
- // Hours, minutes and optional seconds with `:` delimiter
1179
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1180
- // so this token always has the same output as `XXX`
1181
- case 'XXXXX':
1182
- case 'XXX': // Hours and minutes with `:` delimiter
1183
- default:
1184
- return formatTimezone(timezoneOffset, ':');
1185
- }
1186
- },
1187
- // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
1188
- x: function x(date, token, _localize, options) {
1189
- var originalDate = options._originalDate || date;
1190
- var timezoneOffset = originalDate.getTimezoneOffset();
1191
- switch (token) {
1192
- // Hours and optional minutes
1193
- case 'x':
1194
- return formatTimezoneWithOptionalMinutes(timezoneOffset);
1195
-
1196
- // Hours, minutes and optional seconds without `:` delimiter
1197
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1198
- // so this token always has the same output as `xx`
1199
- case 'xxxx':
1200
- case 'xx':
1201
- // Hours and minutes without `:` delimiter
1202
- return formatTimezone(timezoneOffset);
1203
-
1204
- // Hours, minutes and optional seconds with `:` delimiter
1205
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1206
- // so this token always has the same output as `xxx`
1207
- case 'xxxxx':
1208
- case 'xxx': // Hours and minutes with `:` delimiter
1209
- default:
1210
- return formatTimezone(timezoneOffset, ':');
1211
- }
1212
- },
1213
- // Timezone (GMT)
1214
- O: function O(date, token, _localize, options) {
1215
- var originalDate = options._originalDate || date;
1216
- var timezoneOffset = originalDate.getTimezoneOffset();
1217
- switch (token) {
1218
- // Short
1219
- case 'O':
1220
- case 'OO':
1221
- case 'OOO':
1222
- return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
1223
- // Long
1224
- case 'OOOO':
1225
- default:
1226
- return 'GMT' + formatTimezone(timezoneOffset, ':');
1227
- }
1228
- },
1229
- // Timezone (specific non-location)
1230
- z: function z(date, token, _localize, options) {
1231
- var originalDate = options._originalDate || date;
1232
- var timezoneOffset = originalDate.getTimezoneOffset();
1233
- switch (token) {
1234
- // Short
1235
- case 'z':
1236
- case 'zz':
1237
- case 'zzz':
1238
- return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
1239
- // Long
1240
- case 'zzzz':
1241
- default:
1242
- return 'GMT' + formatTimezone(timezoneOffset, ':');
1243
- }
1244
- },
1245
- // Seconds timestamp
1246
- t: function t(date, token, _localize, options) {
1247
- var originalDate = options._originalDate || date;
1248
- var timestamp = Math.floor(originalDate.getTime() / 1000);
1249
- return addLeadingZeros(timestamp, token.length);
1250
- },
1251
- // Milliseconds timestamp
1252
- T: function T(date, token, _localize, options) {
1253
- var originalDate = options._originalDate || date;
1254
- var timestamp = originalDate.getTime();
1255
- return addLeadingZeros(timestamp, token.length);
1256
- }
1257
- };
1258
- function formatTimezoneShort(offset, dirtyDelimiter) {
1259
- var sign = offset > 0 ? '-' : '+';
1260
- var absOffset = Math.abs(offset);
1261
- var hours = Math.floor(absOffset / 60);
1262
- var minutes = absOffset % 60;
1263
- if (minutes === 0) {
1264
- return sign + String(hours);
1265
- }
1266
- var delimiter = dirtyDelimiter || '';
1267
- return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
1268
- }
1269
- function formatTimezoneWithOptionalMinutes(offset, dirtyDelimiter) {
1270
- if (offset % 60 === 0) {
1271
- var sign = offset > 0 ? '-' : '+';
1272
- return sign + addLeadingZeros(Math.abs(offset) / 60, 2);
1273
- }
1274
- return formatTimezone(offset, dirtyDelimiter);
1275
- }
1276
- function formatTimezone(offset, dirtyDelimiter) {
1277
- var delimiter = dirtyDelimiter || '';
1278
- var sign = offset > 0 ? '-' : '+';
1279
- var absOffset = Math.abs(offset);
1280
- var hours = addLeadingZeros(Math.floor(absOffset / 60), 2);
1281
- var minutes = addLeadingZeros(absOffset % 60, 2);
1282
- return sign + hours + delimiter + minutes;
1283
- }
1284
-
1285
- var dateLongFormatter = function dateLongFormatter(pattern, formatLong) {
1286
- switch (pattern) {
1287
- case 'P':
1288
- return formatLong.date({
1289
- width: 'short'
1290
- });
1291
- case 'PP':
1292
- return formatLong.date({
1293
- width: 'medium'
1294
- });
1295
- case 'PPP':
1296
- return formatLong.date({
1297
- width: 'long'
1298
- });
1299
- case 'PPPP':
1300
- default:
1301
- return formatLong.date({
1302
- width: 'full'
1303
- });
1304
- }
1305
- };
1306
- var timeLongFormatter = function timeLongFormatter(pattern, formatLong) {
1307
- switch (pattern) {
1308
- case 'p':
1309
- return formatLong.time({
1310
- width: 'short'
1311
- });
1312
- case 'pp':
1313
- return formatLong.time({
1314
- width: 'medium'
1315
- });
1316
- case 'ppp':
1317
- return formatLong.time({
1318
- width: 'long'
1319
- });
1320
- case 'pppp':
1321
- default:
1322
- return formatLong.time({
1323
- width: 'full'
1324
- });
1325
- }
1326
- };
1327
- var dateTimeLongFormatter = function dateTimeLongFormatter(pattern, formatLong) {
1328
- var matchResult = pattern.match(/(P+)(p+)?/) || [];
1329
- var datePattern = matchResult[1];
1330
- var timePattern = matchResult[2];
1331
- if (!timePattern) {
1332
- return dateLongFormatter(pattern, formatLong);
1333
- }
1334
- var dateTimeFormat;
1335
- switch (datePattern) {
1336
- case 'P':
1337
- dateTimeFormat = formatLong.dateTime({
1338
- width: 'short'
1339
- });
1340
- break;
1341
- case 'PP':
1342
- dateTimeFormat = formatLong.dateTime({
1343
- width: 'medium'
1344
- });
1345
- break;
1346
- case 'PPP':
1347
- dateTimeFormat = formatLong.dateTime({
1348
- width: 'long'
1349
- });
1350
- break;
1351
- case 'PPPP':
1352
- default:
1353
- dateTimeFormat = formatLong.dateTime({
1354
- width: 'full'
1355
- });
1356
- break;
1357
- }
1358
- return dateTimeFormat.replace('{{date}}', dateLongFormatter(datePattern, formatLong)).replace('{{time}}', timeLongFormatter(timePattern, formatLong));
1359
- };
1360
- var longFormatters = {
1361
- p: timeLongFormatter,
1362
- P: dateTimeLongFormatter
1363
- };
1364
-
1365
- var protectedDayOfYearTokens = ['D', 'DD'];
1366
- var protectedWeekYearTokens = ['YY', 'YYYY'];
1367
- function isProtectedDayOfYearToken(token) {
1368
- return protectedDayOfYearTokens.indexOf(token) !== -1;
1369
- }
1370
- function isProtectedWeekYearToken(token) {
1371
- return protectedWeekYearTokens.indexOf(token) !== -1;
1372
- }
1373
- function throwProtectedError(token, format, input) {
1374
- if (token === 'YYYY') {
1375
- 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"));
1376
- } else if (token === 'YY') {
1377
- 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"));
1378
- } else if (token === 'D') {
1379
- 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"));
1380
- } else if (token === 'DD') {
1381
- 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"));
1382
- }
1383
- }
1384
-
1385
- var formatDistanceLocale = {
1386
- lessThanXSeconds: {
1387
- one: 'less than a second',
1388
- other: 'less than {{count}} seconds'
1389
- },
1390
- xSeconds: {
1391
- one: '1 second',
1392
- other: '{{count}} seconds'
1393
- },
1394
- halfAMinute: 'half a minute',
1395
- lessThanXMinutes: {
1396
- one: 'less than a minute',
1397
- other: 'less than {{count}} minutes'
1398
- },
1399
- xMinutes: {
1400
- one: '1 minute',
1401
- other: '{{count}} minutes'
1402
- },
1403
- aboutXHours: {
1404
- one: 'about 1 hour',
1405
- other: 'about {{count}} hours'
1406
- },
1407
- xHours: {
1408
- one: '1 hour',
1409
- other: '{{count}} hours'
1410
- },
1411
- xDays: {
1412
- one: '1 day',
1413
- other: '{{count}} days'
1414
- },
1415
- aboutXWeeks: {
1416
- one: 'about 1 week',
1417
- other: 'about {{count}} weeks'
1418
- },
1419
- xWeeks: {
1420
- one: '1 week',
1421
- other: '{{count}} weeks'
1422
- },
1423
- aboutXMonths: {
1424
- one: 'about 1 month',
1425
- other: 'about {{count}} months'
1426
- },
1427
- xMonths: {
1428
- one: '1 month',
1429
- other: '{{count}} months'
1430
- },
1431
- aboutXYears: {
1432
- one: 'about 1 year',
1433
- other: 'about {{count}} years'
1434
- },
1435
- xYears: {
1436
- one: '1 year',
1437
- other: '{{count}} years'
1438
- },
1439
- overXYears: {
1440
- one: 'over 1 year',
1441
- other: 'over {{count}} years'
1442
- },
1443
- almostXYears: {
1444
- one: 'almost 1 year',
1445
- other: 'almost {{count}} years'
1446
- }
1447
- };
1448
- var formatDistance = function formatDistance(token, count, options) {
1449
- var result;
1450
- var tokenValue = formatDistanceLocale[token];
1451
- if (typeof tokenValue === 'string') {
1452
- result = tokenValue;
1453
- } else if (count === 1) {
1454
- result = tokenValue.one;
1455
- } else {
1456
- result = tokenValue.other.replace('{{count}}', count.toString());
1457
- }
1458
- if (options !== null && options !== void 0 && options.addSuffix) {
1459
- if (options.comparison && options.comparison > 0) {
1460
- return 'in ' + result;
1461
- } else {
1462
- return result + ' ago';
1463
- }
1464
- }
1465
- return result;
1466
- };
1467
-
1468
- function buildFormatLongFn(args) {
1469
- return function () {
1470
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1471
- // TODO: Remove String()
1472
- var width = options.width ? String(options.width) : args.defaultWidth;
1473
- var format = args.formats[width] || args.formats[args.defaultWidth];
1474
- return format;
1475
- };
1476
- }
1477
-
1478
- var dateFormats = {
1479
- full: 'EEEE, MMMM do, y',
1480
- long: 'MMMM do, y',
1481
- medium: 'MMM d, y',
1482
- short: 'MM/dd/yyyy'
1483
- };
1484
- var timeFormats = {
1485
- full: 'h:mm:ss a zzzz',
1486
- long: 'h:mm:ss a z',
1487
- medium: 'h:mm:ss a',
1488
- short: 'h:mm a'
1489
- };
1490
- var dateTimeFormats = {
1491
- full: "{{date}} 'at' {{time}}",
1492
- long: "{{date}} 'at' {{time}}",
1493
- medium: '{{date}}, {{time}}',
1494
- short: '{{date}}, {{time}}'
1495
- };
1496
- var formatLong = {
1497
- date: buildFormatLongFn({
1498
- formats: dateFormats,
1499
- defaultWidth: 'full'
1500
- }),
1501
- time: buildFormatLongFn({
1502
- formats: timeFormats,
1503
- defaultWidth: 'full'
1504
- }),
1505
- dateTime: buildFormatLongFn({
1506
- formats: dateTimeFormats,
1507
- defaultWidth: 'full'
1508
- })
1509
- };
1510
-
1511
- var formatRelativeLocale = {
1512
- lastWeek: "'last' eeee 'at' p",
1513
- yesterday: "'yesterday at' p",
1514
- today: "'today at' p",
1515
- tomorrow: "'tomorrow at' p",
1516
- nextWeek: "eeee 'at' p",
1517
- other: 'P'
1518
- };
1519
- var formatRelative = function formatRelative(token, _date, _baseDate, _options) {
1520
- return formatRelativeLocale[token];
1521
- };
1522
-
1523
- function buildLocalizeFn(args) {
1524
- return function (dirtyIndex, options) {
1525
- var context = options !== null && options !== void 0 && options.context ? String(options.context) : 'standalone';
1526
- var valuesArray;
1527
- if (context === 'formatting' && args.formattingValues) {
1528
- var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
1529
- var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth;
1530
- valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
1531
- } else {
1532
- var _defaultWidth = args.defaultWidth;
1533
- var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth;
1534
- valuesArray = args.values[_width] || args.values[_defaultWidth];
1535
- }
1536
- var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex;
1537
- // @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!
1538
- return valuesArray[index];
1539
- };
1540
- }
1541
-
1542
- var eraValues = {
1543
- narrow: ['B', 'A'],
1544
- abbreviated: ['BC', 'AD'],
1545
- wide: ['Before Christ', 'Anno Domini']
1546
- };
1547
- var quarterValues = {
1548
- narrow: ['1', '2', '3', '4'],
1549
- abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
1550
- wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter']
1551
- };
1552
-
1553
- // Note: in English, the names of days of the week and months are capitalized.
1554
- // If you are making a new locale based on this one, check if the same is true for the language you're working on.
1555
- // Generally, formatted dates should look like they are in the middle of a sentence,
1556
- // e.g. in Spanish language the weekdays and months should be in the lowercase.
1557
- var monthValues = {
1558
- narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
1559
- abbreviated: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
1560
- wide: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
1561
- };
1562
- var dayValues = {
1563
- narrow: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
1564
- short: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
1565
- abbreviated: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
1566
- wide: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
1567
- };
1568
- var dayPeriodValues = {
1569
- narrow: {
1570
- am: 'a',
1571
- pm: 'p',
1572
- midnight: 'mi',
1573
- noon: 'n',
1574
- morning: 'morning',
1575
- afternoon: 'afternoon',
1576
- evening: 'evening',
1577
- night: 'night'
1578
- },
1579
- abbreviated: {
1580
- am: 'AM',
1581
- pm: 'PM',
1582
- midnight: 'midnight',
1583
- noon: 'noon',
1584
- morning: 'morning',
1585
- afternoon: 'afternoon',
1586
- evening: 'evening',
1587
- night: 'night'
1588
- },
1589
- wide: {
1590
- am: 'a.m.',
1591
- pm: 'p.m.',
1592
- midnight: 'midnight',
1593
- noon: 'noon',
1594
- morning: 'morning',
1595
- afternoon: 'afternoon',
1596
- evening: 'evening',
1597
- night: 'night'
1598
- }
1599
- };
1600
- var formattingDayPeriodValues = {
1601
- narrow: {
1602
- am: 'a',
1603
- pm: 'p',
1604
- midnight: 'mi',
1605
- noon: 'n',
1606
- morning: 'in the morning',
1607
- afternoon: 'in the afternoon',
1608
- evening: 'in the evening',
1609
- night: 'at night'
1610
- },
1611
- abbreviated: {
1612
- am: 'AM',
1613
- pm: 'PM',
1614
- midnight: 'midnight',
1615
- noon: 'noon',
1616
- morning: 'in the morning',
1617
- afternoon: 'in the afternoon',
1618
- evening: 'in the evening',
1619
- night: 'at night'
1620
- },
1621
- wide: {
1622
- am: 'a.m.',
1623
- pm: 'p.m.',
1624
- midnight: 'midnight',
1625
- noon: 'noon',
1626
- morning: 'in the morning',
1627
- afternoon: 'in the afternoon',
1628
- evening: 'in the evening',
1629
- night: 'at night'
1630
- }
1631
- };
1632
- var ordinalNumber = function ordinalNumber(dirtyNumber, _options) {
1633
- var number = Number(dirtyNumber);
1634
-
1635
- // If ordinal numbers depend on context, for example,
1636
- // if they are different for different grammatical genders,
1637
- // use `options.unit`.
1638
- //
1639
- // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
1640
- // 'day', 'hour', 'minute', 'second'.
1641
-
1642
- var rem100 = number % 100;
1643
- if (rem100 > 20 || rem100 < 10) {
1644
- switch (rem100 % 10) {
1645
- case 1:
1646
- return number + 'st';
1647
- case 2:
1648
- return number + 'nd';
1649
- case 3:
1650
- return number + 'rd';
1651
- }
1652
- }
1653
- return number + 'th';
1654
- };
1655
- var localize = {
1656
- ordinalNumber: ordinalNumber,
1657
- era: buildLocalizeFn({
1658
- values: eraValues,
1659
- defaultWidth: 'wide'
1660
- }),
1661
- quarter: buildLocalizeFn({
1662
- values: quarterValues,
1663
- defaultWidth: 'wide',
1664
- argumentCallback: function argumentCallback(quarter) {
1665
- return quarter - 1;
1666
- }
1667
- }),
1668
- month: buildLocalizeFn({
1669
- values: monthValues,
1670
- defaultWidth: 'wide'
1671
- }),
1672
- day: buildLocalizeFn({
1673
- values: dayValues,
1674
- defaultWidth: 'wide'
1675
- }),
1676
- dayPeriod: buildLocalizeFn({
1677
- values: dayPeriodValues,
1678
- defaultWidth: 'wide',
1679
- formattingValues: formattingDayPeriodValues,
1680
- defaultFormattingWidth: 'wide'
1681
- })
1682
- };
1683
-
1684
- function buildMatchFn(args) {
1685
- return function (string) {
1686
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1687
- var width = options.width;
1688
- var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
1689
- var matchResult = string.match(matchPattern);
1690
- if (!matchResult) {
1691
- return null;
1692
- }
1693
- var matchedString = matchResult[0];
1694
- var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
1695
- var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {
1696
- return pattern.test(matchedString);
1697
- }) : findKey(parsePatterns, function (pattern) {
1698
- return pattern.test(matchedString);
1699
- });
1700
- var value;
1701
- value = args.valueCallback ? args.valueCallback(key) : key;
1702
- value = options.valueCallback ? options.valueCallback(value) : value;
1703
- var rest = string.slice(matchedString.length);
1704
- return {
1705
- value: value,
1706
- rest: rest
1707
- };
1708
- };
1709
- }
1710
- function findKey(object, predicate) {
1711
- for (var key in object) {
1712
- if (object.hasOwnProperty(key) && predicate(object[key])) {
1713
- return key;
1714
- }
1715
- }
1716
- return undefined;
1717
- }
1718
- function findIndex(array, predicate) {
1719
- for (var key = 0; key < array.length; key++) {
1720
- if (predicate(array[key])) {
1721
- return key;
1722
- }
1723
- }
1724
- return undefined;
1725
- }
1726
-
1727
- function buildMatchPatternFn(args) {
1728
- return function (string) {
1729
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1730
- var matchResult = string.match(args.matchPattern);
1731
- if (!matchResult) return null;
1732
- var matchedString = matchResult[0];
1733
- var parseResult = string.match(args.parsePattern);
1734
- if (!parseResult) return null;
1735
- var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
1736
- value = options.valueCallback ? options.valueCallback(value) : value;
1737
- var rest = string.slice(matchedString.length);
1738
- return {
1739
- value: value,
1740
- rest: rest
1741
- };
1742
- };
1743
- }
1744
-
1745
- var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
1746
- var parseOrdinalNumberPattern = /\d+/i;
1747
- var matchEraPatterns = {
1748
- narrow: /^(b|a)/i,
1749
- abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
1750
- wide: /^(before christ|before common era|anno domini|common era)/i
1751
- };
1752
- var parseEraPatterns = {
1753
- any: [/^b/i, /^(a|c)/i]
1754
- };
1755
- var matchQuarterPatterns = {
1756
- narrow: /^[1234]/i,
1757
- abbreviated: /^q[1234]/i,
1758
- wide: /^[1234](th|st|nd|rd)? quarter/i
1759
- };
1760
- var parseQuarterPatterns = {
1761
- any: [/1/i, /2/i, /3/i, /4/i]
1762
- };
1763
- var matchMonthPatterns = {
1764
- narrow: /^[jfmasond]/i,
1765
- abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
1766
- wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
1767
- };
1768
- var parseMonthPatterns = {
1769
- 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],
1770
- 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]
1771
- };
1772
- var matchDayPatterns = {
1773
- narrow: /^[smtwf]/i,
1774
- short: /^(su|mo|tu|we|th|fr|sa)/i,
1775
- abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
1776
- wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
1777
- };
1778
- var parseDayPatterns = {
1779
- narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
1780
- any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
1781
- };
1782
- var matchDayPeriodPatterns = {
1783
- narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
1784
- any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
1785
- };
1786
- var parseDayPeriodPatterns = {
1787
- any: {
1788
- am: /^a/i,
1789
- pm: /^p/i,
1790
- midnight: /^mi/i,
1791
- noon: /^no/i,
1792
- morning: /morning/i,
1793
- afternoon: /afternoon/i,
1794
- evening: /evening/i,
1795
- night: /night/i
1796
- }
1797
- };
1798
- var match = {
1799
- ordinalNumber: buildMatchPatternFn({
1800
- matchPattern: matchOrdinalNumberPattern,
1801
- parsePattern: parseOrdinalNumberPattern,
1802
- valueCallback: function valueCallback(value) {
1803
- return parseInt(value, 10);
1804
- }
1805
- }),
1806
- era: buildMatchFn({
1807
- matchPatterns: matchEraPatterns,
1808
- defaultMatchWidth: 'wide',
1809
- parsePatterns: parseEraPatterns,
1810
- defaultParseWidth: 'any'
1811
- }),
1812
- quarter: buildMatchFn({
1813
- matchPatterns: matchQuarterPatterns,
1814
- defaultMatchWidth: 'wide',
1815
- parsePatterns: parseQuarterPatterns,
1816
- defaultParseWidth: 'any',
1817
- valueCallback: function valueCallback(index) {
1818
- return index + 1;
1819
- }
1820
- }),
1821
- month: buildMatchFn({
1822
- matchPatterns: matchMonthPatterns,
1823
- defaultMatchWidth: 'wide',
1824
- parsePatterns: parseMonthPatterns,
1825
- defaultParseWidth: 'any'
1826
- }),
1827
- day: buildMatchFn({
1828
- matchPatterns: matchDayPatterns,
1829
- defaultMatchWidth: 'wide',
1830
- parsePatterns: parseDayPatterns,
1831
- defaultParseWidth: 'any'
1832
- }),
1833
- dayPeriod: buildMatchFn({
1834
- matchPatterns: matchDayPeriodPatterns,
1835
- defaultMatchWidth: 'any',
1836
- parsePatterns: parseDayPeriodPatterns,
1837
- defaultParseWidth: 'any'
1838
- })
1839
- };
1840
-
1841
- /**
1842
- * @type {Locale}
1843
- * @category Locales
1844
- * @summary English locale (United States).
1845
- * @language English
1846
- * @iso-639-2 eng
1847
- * @author Sasha Koss [@kossnocorp]{@link https://github.com/kossnocorp}
1848
- * @author Lesha Koss [@leshakoss]{@link https://github.com/leshakoss}
1849
- */
1850
- var locale = {
1851
- code: 'en-US',
1852
- formatDistance: formatDistance,
1853
- formatLong: formatLong,
1854
- formatRelative: formatRelative,
1855
- localize: localize,
1856
- match: match,
1857
- options: {
1858
- weekStartsOn: 0 /* Sunday */,
1859
- firstWeekContainsDate: 1
1860
- }
1861
- };
1862
-
1863
- // - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token
1864
- // (one of the certain letters followed by `o`)
1865
- // - (\w)\1* matches any sequences of the same letter
1866
- // - '' matches two quote characters in a row
1867
- // - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),
1868
- // except a single quote symbol, which ends the sequence.
1869
- // Two quote characters do not end the sequence.
1870
- // If there is no matching single quote
1871
- // then the sequence will continue until the end of the string.
1872
- // - . matches any single character unmatched by previous parts of the RegExps
1873
- var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
1874
-
1875
- // This RegExp catches symbols escaped by quotes, and also
1876
- // sequences of symbols P, p, and the combinations like `PPPPPPPppppp`
1877
- var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
1878
- var escapedStringRegExp = /^'([^]*?)'?$/;
1879
- var doubleQuoteRegExp = /''/g;
1880
- var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
1881
-
1882
- /**
1883
- * @name format
1884
- * @category Common Helpers
1885
- * @summary Format the date.
1886
- *
1887
- * @description
1888
- * Return the formatted date string in the given format. The result may vary by locale.
1889
- *
1890
- * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
1891
- * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
1892
- *
1893
- * The characters wrapped between two single quotes characters (') are escaped.
1894
- * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
1895
- * (see the last example)
1896
- *
1897
- * Format of the string is based on Unicode Technical Standard #35:
1898
- * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
1899
- * with a few additions (see note 7 below the table).
1900
- *
1901
- * Accepted patterns:
1902
- * | Unit | Pattern | Result examples | Notes |
1903
- * |---------------------------------|---------|-----------------------------------|-------|
1904
- * | Era | G..GGG | AD, BC | |
1905
- * | | GGGG | Anno Domini, Before Christ | 2 |
1906
- * | | GGGGG | A, B | |
1907
- * | Calendar year | y | 44, 1, 1900, 2017 | 5 |
1908
- * | | yo | 44th, 1st, 0th, 17th | 5,7 |
1909
- * | | yy | 44, 01, 00, 17 | 5 |
1910
- * | | yyy | 044, 001, 1900, 2017 | 5 |
1911
- * | | yyyy | 0044, 0001, 1900, 2017 | 5 |
1912
- * | | yyyyy | ... | 3,5 |
1913
- * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |
1914
- * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |
1915
- * | | YY | 44, 01, 00, 17 | 5,8 |
1916
- * | | YYY | 044, 001, 1900, 2017 | 5 |
1917
- * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |
1918
- * | | YYYYY | ... | 3,5 |
1919
- * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |
1920
- * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |
1921
- * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |
1922
- * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |
1923
- * | | RRRRR | ... | 3,5,7 |
1924
- * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |
1925
- * | | uu | -43, 01, 1900, 2017 | 5 |
1926
- * | | uuu | -043, 001, 1900, 2017 | 5 |
1927
- * | | uuuu | -0043, 0001, 1900, 2017 | 5 |
1928
- * | | uuuuu | ... | 3,5 |
1929
- * | Quarter (formatting) | Q | 1, 2, 3, 4 | |
1930
- * | | Qo | 1st, 2nd, 3rd, 4th | 7 |
1931
- * | | QQ | 01, 02, 03, 04 | |
1932
- * | | QQQ | Q1, Q2, Q3, Q4 | |
1933
- * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |
1934
- * | | QQQQQ | 1, 2, 3, 4 | 4 |
1935
- * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |
1936
- * | | qo | 1st, 2nd, 3rd, 4th | 7 |
1937
- * | | qq | 01, 02, 03, 04 | |
1938
- * | | qqq | Q1, Q2, Q3, Q4 | |
1939
- * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |
1940
- * | | qqqqq | 1, 2, 3, 4 | 4 |
1941
- * | Month (formatting) | M | 1, 2, ..., 12 | |
1942
- * | | Mo | 1st, 2nd, ..., 12th | 7 |
1943
- * | | MM | 01, 02, ..., 12 | |
1944
- * | | MMM | Jan, Feb, ..., Dec | |
1945
- * | | MMMM | January, February, ..., December | 2 |
1946
- * | | MMMMM | J, F, ..., D | |
1947
- * | Month (stand-alone) | L | 1, 2, ..., 12 | |
1948
- * | | Lo | 1st, 2nd, ..., 12th | 7 |
1949
- * | | LL | 01, 02, ..., 12 | |
1950
- * | | LLL | Jan, Feb, ..., Dec | |
1951
- * | | LLLL | January, February, ..., December | 2 |
1952
- * | | LLLLL | J, F, ..., D | |
1953
- * | Local week of year | w | 1, 2, ..., 53 | |
1954
- * | | wo | 1st, 2nd, ..., 53th | 7 |
1955
- * | | ww | 01, 02, ..., 53 | |
1956
- * | ISO week of year | I | 1, 2, ..., 53 | 7 |
1957
- * | | Io | 1st, 2nd, ..., 53th | 7 |
1958
- * | | II | 01, 02, ..., 53 | 7 |
1959
- * | Day of month | d | 1, 2, ..., 31 | |
1960
- * | | do | 1st, 2nd, ..., 31st | 7 |
1961
- * | | dd | 01, 02, ..., 31 | |
1962
- * | Day of year | D | 1, 2, ..., 365, 366 | 9 |
1963
- * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |
1964
- * | | DD | 01, 02, ..., 365, 366 | 9 |
1965
- * | | DDD | 001, 002, ..., 365, 366 | |
1966
- * | | DDDD | ... | 3 |
1967
- * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |
1968
- * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |
1969
- * | | EEEEE | M, T, W, T, F, S, S | |
1970
- * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |
1971
- * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |
1972
- * | | io | 1st, 2nd, ..., 7th | 7 |
1973
- * | | ii | 01, 02, ..., 07 | 7 |
1974
- * | | iii | Mon, Tue, Wed, ..., Sun | 7 |
1975
- * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |
1976
- * | | iiiii | M, T, W, T, F, S, S | 7 |
1977
- * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |
1978
- * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |
1979
- * | | eo | 2nd, 3rd, ..., 1st | 7 |
1980
- * | | ee | 02, 03, ..., 01 | |
1981
- * | | eee | Mon, Tue, Wed, ..., Sun | |
1982
- * | | eeee | Monday, Tuesday, ..., Sunday | 2 |
1983
- * | | eeeee | M, T, W, T, F, S, S | |
1984
- * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |
1985
- * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |
1986
- * | | co | 2nd, 3rd, ..., 1st | 7 |
1987
- * | | cc | 02, 03, ..., 01 | |
1988
- * | | ccc | Mon, Tue, Wed, ..., Sun | |
1989
- * | | cccc | Monday, Tuesday, ..., Sunday | 2 |
1990
- * | | ccccc | M, T, W, T, F, S, S | |
1991
- * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |
1992
- * | AM, PM | a..aa | AM, PM | |
1993
- * | | aaa | am, pm | |
1994
- * | | aaaa | a.m., p.m. | 2 |
1995
- * | | aaaaa | a, p | |
1996
- * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |
1997
- * | | bbb | am, pm, noon, midnight | |
1998
- * | | bbbb | a.m., p.m., noon, midnight | 2 |
1999
- * | | bbbbb | a, p, n, mi | |
2000
- * | Flexible day period | B..BBB | at night, in the morning, ... | |
2001
- * | | BBBB | at night, in the morning, ... | 2 |
2002
- * | | BBBBB | at night, in the morning, ... | |
2003
- * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |
2004
- * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |
2005
- * | | hh | 01, 02, ..., 11, 12 | |
2006
- * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |
2007
- * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |
2008
- * | | HH | 00, 01, 02, ..., 23 | |
2009
- * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |
2010
- * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |
2011
- * | | KK | 01, 02, ..., 11, 00 | |
2012
- * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |
2013
- * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |
2014
- * | | kk | 24, 01, 02, ..., 23 | |
2015
- * | Minute | m | 0, 1, ..., 59 | |
2016
- * | | mo | 0th, 1st, ..., 59th | 7 |
2017
- * | | mm | 00, 01, ..., 59 | |
2018
- * | Second | s | 0, 1, ..., 59 | |
2019
- * | | so | 0th, 1st, ..., 59th | 7 |
2020
- * | | ss | 00, 01, ..., 59 | |
2021
- * | Fraction of second | S | 0, 1, ..., 9 | |
2022
- * | | SS | 00, 01, ..., 99 | |
2023
- * | | SSS | 000, 001, ..., 999 | |
2024
- * | | SSSS | ... | 3 |
2025
- * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |
2026
- * | | XX | -0800, +0530, Z | |
2027
- * | | XXX | -08:00, +05:30, Z | |
2028
- * | | XXXX | -0800, +0530, Z, +123456 | 2 |
2029
- * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |
2030
- * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |
2031
- * | | xx | -0800, +0530, +0000 | |
2032
- * | | xxx | -08:00, +05:30, +00:00 | 2 |
2033
- * | | xxxx | -0800, +0530, +0000, +123456 | |
2034
- * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |
2035
- * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |
2036
- * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |
2037
- * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |
2038
- * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |
2039
- * | Seconds timestamp | t | 512969520 | 7 |
2040
- * | | tt | ... | 3,7 |
2041
- * | Milliseconds timestamp | T | 512969520900 | 7 |
2042
- * | | TT | ... | 3,7 |
2043
- * | Long localized date | P | 04/29/1453 | 7 |
2044
- * | | PP | Apr 29, 1453 | 7 |
2045
- * | | PPP | April 29th, 1453 | 7 |
2046
- * | | PPPP | Friday, April 29th, 1453 | 2,7 |
2047
- * | Long localized time | p | 12:00 AM | 7 |
2048
- * | | pp | 12:00:00 AM | 7 |
2049
- * | | ppp | 12:00:00 AM GMT+2 | 7 |
2050
- * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |
2051
- * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |
2052
- * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |
2053
- * | | PPPppp | April 29th, 1453 at ... | 7 |
2054
- * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |
2055
- * Notes:
2056
- * 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
2057
- * are the same as "stand-alone" units, but are different in some languages.
2058
- * "Formatting" units are declined according to the rules of the language
2059
- * in the context of a date. "Stand-alone" units are always nominative singular:
2060
- *
2061
- * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`
2062
- *
2063
- * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`
2064
- *
2065
- * 2. Any sequence of the identical letters is a pattern, unless it is escaped by
2066
- * the single quote characters (see below).
2067
- * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)
2068
- * the output will be the same as default pattern for this unit, usually
2069
- * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units
2070
- * are marked with "2" in the last column of the table.
2071
- *
2072
- * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`
2073
- *
2074
- * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`
2075
- *
2076
- * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`
2077
- *
2078
- * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`
2079
- *
2080
- * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`
2081
- *
2082
- * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).
2083
- * The output will be padded with zeros to match the length of the pattern.
2084
- *
2085
- * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`
2086
- *
2087
- * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.
2088
- * These tokens represent the shortest form of the quarter.
2089
- *
2090
- * 5. The main difference between `y` and `u` patterns are B.C. years:
2091
- *
2092
- * | Year | `y` | `u` |
2093
- * |------|-----|-----|
2094
- * | AC 1 | 1 | 1 |
2095
- * | BC 1 | 1 | 0 |
2096
- * | BC 2 | 2 | -1 |
2097
- *
2098
- * Also `yy` always returns the last two digits of a year,
2099
- * while `uu` pads single digit years to 2 characters and returns other years unchanged:
2100
- *
2101
- * | Year | `yy` | `uu` |
2102
- * |------|------|------|
2103
- * | 1 | 01 | 01 |
2104
- * | 14 | 14 | 14 |
2105
- * | 376 | 76 | 376 |
2106
- * | 1453 | 53 | 1453 |
2107
- *
2108
- * The same difference is true for local and ISO week-numbering years (`Y` and `R`),
2109
- * except local week-numbering years are dependent on `options.weekStartsOn`
2110
- * and `options.firstWeekContainsDate` (compare [getISOWeekYear]{@link https://date-fns.org/docs/getISOWeekYear}
2111
- * and [getWeekYear]{@link https://date-fns.org/docs/getWeekYear}).
2112
- *
2113
- * 6. Specific non-location timezones are currently unavailable in `date-fns`,
2114
- * so right now these tokens fall back to GMT timezones.
2115
- *
2116
- * 7. These patterns are not in the Unicode Technical Standard #35:
2117
- * - `i`: ISO day of week
2118
- * - `I`: ISO week of year
2119
- * - `R`: ISO week-numbering year
2120
- * - `t`: seconds timestamp
2121
- * - `T`: milliseconds timestamp
2122
- * - `o`: ordinal number modifier
2123
- * - `P`: long localized date
2124
- * - `p`: long localized time
2125
- *
2126
- * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
2127
- * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2128
- *
2129
- * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.
2130
- * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2131
- *
2132
- * @param {Date|Number} date - the original date
2133
- * @param {String} format - the string of tokens
2134
- * @param {Object} [options] - an object with options.
2135
- * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
2136
- * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)
2137
- * @param {Number} [options.firstWeekContainsDate=1] - the day of January, which is
2138
- * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;
2139
- * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2140
- * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;
2141
- * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2142
- * @returns {String} the formatted date string
2143
- * @throws {TypeError} 2 arguments required
2144
- * @throws {RangeError} `date` must not be Invalid Date
2145
- * @throws {RangeError} `options.locale` must contain `localize` property
2146
- * @throws {RangeError} `options.locale` must contain `formatLong` property
2147
- * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6
2148
- * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7
2149
- * @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
2150
- * @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
2151
- * @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
2152
- * @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
2153
- * @throws {RangeError} format string contains an unescaped latin alphabet character
2154
- *
2155
- * @example
2156
- * // Represent 11 February 2014 in middle-endian format:
2157
- * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')
2158
- * //=> '02/11/2014'
2159
- *
2160
- * @example
2161
- * // Represent 2 July 2014 in Esperanto:
2162
- * import { eoLocale } from 'date-fns/locale/eo'
2163
- * const result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", {
2164
- * locale: eoLocale
2165
- * })
2166
- * //=> '2-a de julio 2014'
2167
- *
2168
- * @example
2169
- * // Escape string by single quote characters:
2170
- * const result = format(new Date(2014, 6, 2, 15), "h 'o''clock'")
2171
- * //=> "3 o'clock"
2172
- */
2173
-
2174
- function format(dirtyDate, dirtyFormatStr, options) {
2175
- 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;
2176
- requiredArgs(2, arguments);
2177
- var formatStr = String(dirtyFormatStr);
2178
- var defaultOptions = getDefaultOptions();
2179
- var locale$1 = (_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 : locale;
2180
- 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);
2181
-
2182
- // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
2183
- if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
2184
- throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
2185
- }
2186
- 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);
2187
-
2188
- // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
2189
- if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
2190
- throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
2191
- }
2192
- if (!locale$1.localize) {
2193
- throw new RangeError('locale must contain localize property');
2194
- }
2195
- if (!locale$1.formatLong) {
2196
- throw new RangeError('locale must contain formatLong property');
2197
- }
2198
- var originalDate = toDate(dirtyDate);
2199
- if (!isValid(originalDate)) {
2200
- throw new RangeError('Invalid time value');
2201
- }
2202
-
2203
- // Convert the date in system timezone to the same date in UTC+00:00 timezone.
2204
- // This ensures that when UTC functions will be implemented, locales will be compatible with them.
2205
- // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376
2206
- var timezoneOffset = getTimezoneOffsetInMilliseconds(originalDate);
2207
- var utcDate = subMilliseconds(originalDate, timezoneOffset);
2208
- var formatterOptions = {
2209
- firstWeekContainsDate: firstWeekContainsDate,
2210
- weekStartsOn: weekStartsOn,
2211
- locale: locale$1,
2212
- _originalDate: originalDate
2213
- };
2214
- var result = formatStr.match(longFormattingTokensRegExp).map(function (substring) {
2215
- var firstCharacter = substring[0];
2216
- if (firstCharacter === 'p' || firstCharacter === 'P') {
2217
- var longFormatter = longFormatters[firstCharacter];
2218
- return longFormatter(substring, locale$1.formatLong);
2219
- }
2220
- return substring;
2221
- }).join('').match(formattingTokensRegExp).map(function (substring) {
2222
- // Replace two single quote characters with one single quote character
2223
- if (substring === "''") {
2224
- return "'";
2225
- }
2226
- var firstCharacter = substring[0];
2227
- if (firstCharacter === "'") {
2228
- return cleanEscapedString(substring);
2229
- }
2230
- var formatter = formatters[firstCharacter];
2231
- if (formatter) {
2232
- if (!(options !== null && options !== void 0 && options.useAdditionalWeekYearTokens) && isProtectedWeekYearToken(substring)) {
2233
- throwProtectedError(substring, dirtyFormatStr, String(dirtyDate));
2234
- }
2235
- if (!(options !== null && options !== void 0 && options.useAdditionalDayOfYearTokens) && isProtectedDayOfYearToken(substring)) {
2236
- throwProtectedError(substring, dirtyFormatStr, String(dirtyDate));
2237
- }
2238
- return formatter(utcDate, substring, locale$1.localize, formatterOptions);
2239
- }
2240
- if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
2241
- throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`');
2242
- }
2243
- return substring;
2244
- }).join('');
2245
- return result;
2246
- }
2247
- function cleanEscapedString(input) {
2248
- var matched = input.match(escapedStringRegExp);
2249
- if (!matched) {
2250
- return input;
2251
- }
2252
- return matched[1].replace(doubleQuoteRegExp, "'");
2253
- }
2254
-
2255
- const getHistoryLoaderTemplate = (lang) => {
2256
- return h("div", { class: "HistoryLoader" },
2257
- h("casino-engagement-suite-progress-bar", { indeterminate: true }),
2258
- h("span", null, translate('loading', lang)));
2259
- };
2260
- const getRewardNameByType = (type, lang) => {
2261
- switch (type) {
2262
- case 0: return translate('freeSpins', lang);
2263
- case 1: return translate('luckyWheel', lang);
2264
- case 2: return translate('leaderboard', lang);
2265
- case 3: return translate('mission', lang);
2266
- }
2267
- };
2268
- const getLevelStatusString = (status, lang) => {
2269
- switch (status) {
2270
- case ChallengeHistoryLevelStatus.Completed: return translate('completed', lang);
2271
- case ChallengeHistoryLevelStatus.Expired: return translate('expired', lang);
2272
- case ChallengeHistoryLevelStatus.Forfeited: return translate('forfeited', lang);
2273
- default: return status;
2274
- }
2275
- };
2276
- const showRewards = (level) => {
2277
- return !!level.Rewards && level.Status === ChallengeHistoryLevelStatus.Completed;
2278
- };
2279
- const getRewardTemplate = (reward, lang) => {
2280
- const isCustom = reward.Type === ChallengeRewardType.Custom;
2281
- const rewardName = isCustom ? reward.RewardDescription : getRewardNameByType(reward.Type, lang);
2282
- const isRewarded = isCustom || reward.IsRewarded;
2283
- return h("div", { class: `HistoryRewardsItem ${isRewarded || isCustom ? 'IsRewarded' : 'IsNotRewarded'}` },
2284
- h("span", { class: "HistoryRewardsItemName" }, rewardName),
2285
- !isCustom && h("div", { class: "HistoryRewardStatusIcon" }));
2286
- };
2287
- const getHistoryLevelRewardsTemplate = (level, lang) => {
2288
- return h("div", { class: "HistoryRewardsList" },
2289
- h("img", { class: "HistoryRewardsIcon", src: "https://static.everymatrix.com/gic/img/engagement-suite/cup-reward-list.svg", alt: "Reward" }),
2290
- Object.values(level.Rewards).map(reward => getRewardTemplate(reward, lang)));
2291
- };
2292
- const getHistoryLevelTemplate = (level, index, lang) => {
2293
- return h("div", { class: "HistoryLevelInfo" },
2294
- h("span", { class: "Level" }, `${translate('level', lang)} ${index + 1}`),
2295
- h("span", { class: "Status" }, getLevelStatusString(level.Status, lang)),
2296
- h("span", { class: "Time" }, format(new Date(level.Time), 'LLL d, yyyy HH:mm:ss')));
2297
- };
2298
- const getChallengesHistoryTemplate = (histories, openedHistoryIds, toggleChallengeHistory, lang) => {
2299
- if (histories.length === 0) {
2300
- return h("p", { class: "HistoryEmptyMessage" }, translate('noHistory', lang));
2301
- }
2302
- return h("div", { class: "HistoryList" }, histories.map((history) => {
2303
- return h("div", { key: history.ProgressId, class: `HistoryListItem ${openedHistoryIds.includes(history.ProgressId) ? 'Opened' : 'Closed'}` },
2304
- h("header", { class: "HistoryListItemHeader", "data-id": history.ProgressId, onClick: toggleChallengeHistory },
2305
- history.Name,
2306
- h("button", { class: "HistoryListItemButton" })),
2307
- h("div", { class: "HistoryListItemBody" },
2308
- h("div", null, history.Levels.map((level, index) => {
2309
- return h("div", { class: "HistoryListItemLevelCard" },
2310
- getHistoryLevelTemplate(level, index, lang),
2311
- showRewards(level) && getHistoryLevelRewardsTemplate(level, lang));
2312
- }))));
2313
- }));
2314
- };
2315
-
2316
- const casinoEngagementSuiteChallengesListCss = ":host{display:block;font-family:inherit}*{box-sizing:border-box;margin:0;padding:0}button{border:none;background:none;cursor:pointer;touch-action:manipulation}button:focus{outline:none}.ChallengesListPopup{display:flex;height:100%;background-color:var(--emw--color-background, #1E1638);border-radius:8px;overflow:hidden;flex-direction:column;position:relative;padding-bottom:20px}.ChallengesListPopupHeader{display:flex;justify-content:space-between;align-items:center;padding:12px 8px 8px}.ChallengesIconButton{width:16px;height:16px;cursor:pointer}.ChallengesIconButton img{width:100%;height:100%}.ChallengesListPopupHeaderName{color:var(--emw--color-gray-100, #BBB9C3);font-size:14px;font-weight:500;line-height:14px}.HistoryList,.ChallengesListWrapper{overflow-y:auto;-ms-overflow-style:none;scrollbar-width:none}.HistoryList::-webkit-scrollbar,.ChallengesListWrapper::-webkit-scrollbar{display:none}.ChallengesList{display:flex;flex-direction:column;row-gap:12px;padding:12px 19px 0}.ChallengeCard{padding:15px 15px 19px;border:1px solid var(--emw--button-border-color, #403956);border-radius:6px;position:relative;cursor:pointer}.ChallengeJoinButton.Joined::before,.ChallengeCard.InProgress::before{content:\"\";position:absolute;inset:0;border-radius:var(--emw--button-border-radius, 4px);padding:1px;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-mask:linear-gradient(#FFF 0 0) content-box, linear-gradient(#FFF 0 0);-webkit-mask-composite:xor;mask-composite:exclude}.ChallengeCardHeader{display:flex;justify-content:space-between;gap:24px;margin-bottom:12px}.ForfeitedChallengeCard{cursor:default}.ChallengeName,.ForfeitedChallengeName{color:var(--emw--color-typography, #FFFFFF);font-family:\"Montserrat\", sans-serif;line-height:22px;font-weight:700;font-size:18px;word-break:break-word}.ForfeitedChallengeName,.ForfeitedChallengeMessage{color:var(--emw--color-primary, #8F8B9C)}.ForfeitedChallengeInfo{margin-top:14px;display:flex;gap:4px}.ForfeitedChallengeMessage{font-family:\"Inter\", sans-serif;font-weight:var(--emw--font-weight-normal, 400);font-size:var(--emw--font-size-x-small, 12px);line-height:15px}.ChallengeJoinButton{transition:all 0.5s ease-out;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);color:var(--emw--color-typography, #1E1638);border-radius:99px;min-width:88px;height:32px;font-size:14px;font-weight:700;position:relative;font-family:\"Montserrat\", sans-serif}.ChallengeJoinButton.Joined{background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}.ChallengeJoinButton.Joined::before{border-radius:99px}.Disabled{opacity:0.5;pointer-events:none;cursor:auto}.ChallengesListEmpty{padding:20px 32px}.ChallengesListEmpty h2{margin:0 0 16px 0;text-align:center;font-weight:600;font-size:20px;line-height:24px;font-family:\"Montserrat\", sans-serif;color:var(--emw--color-typography, #FFFFFF)}.ChallengesListEmpty p{font-size:14px;line-height:17px;color:var(--emw--color-gray-100, #BBB9C3)}.ChallengeCountdown{color:var(--emw--color-gray-100, #BBB9C3);font-size:12px;line-height:12px}.ChallengeLabel{min-width:35px;height:18px;background:linear-gradient(180deg, #FFB801 15.86%, #FEF746 31.36%, #FBFFE0 36.86%, #FFFA60 47.86%, #FF9400 87.36%);border-radius:2px;display:none;position:absolute;top:-11px;right:11px;padding:0 2px;align-items:center;justify-content:center}.ChallengeLabel span{display:inline-block;text-transform:uppercase;font-size:10px;line-height:10px;font-weight:700;font-family:\"Montserrat\", sans-serif;color:var(--emw--color-typography, #1E1638)}.ShowChallengeLabel{display:inline-flex}.ChallengesTooltipBackdrop{padding:48px 30px 0;position:absolute;width:100%;height:100%;inset:0;background-color:rgba(0, 0, 0, 0.5)}.ChallengesTooltipBackdrop .ChallengesTooltip{border:1px solid var(--emw--button-border-color, #403956);background-color:var(--emw--color-background, #1E1638);border-radius:8px;padding:32px;font-size:14px;line-height:17px;color:var(--emw--color-gray-100, #BBB9C3);position:relative}.ChallengesTooltipBackdrop .ChallengesTooltip .ChallengesIconButton{top:12px;right:6px;position:absolute}.Tabs::after,.HistoryCols::after,.HistoryListItem.Opened .HistoryListItemBody::after{content:\"\";position:absolute;bottom:0;left:0;width:100%;height:1px;background-color:var(--emw--color-typography, #FFF);opacity:0.1}.TabsWrapper{padding:0 20px;margin:8px 0}.TabsWrapper .Tabs{display:flex;position:relative}.TabsWrapper .Tabs .Tab{padding:9px 16px 7px;font-weight:500;font-size:12px;line-height:15px;color:var(--emw--color-background, #666178);border-bottom:2px solid transparent;cursor:pointer}.TabsWrapper .Tabs .Tab.Active{color:var(--emw--color-typography, #FFF);border-color:var(--emw--color-typography, #FFF)}.HistoryWrapper{padding:0 20px;display:flex;flex-direction:column;height:100%;overflow:hidden}.HistoryWrapper .HistoryEmptyMessage{margin-top:8px;font-size:var(--emw--font-size-x-small, 14px);color:var(--emw--color-gray-100, #BBB9C3);line-height:30px}.HistoryWrapper .HistoryCols{padding:12px 0;position:relative;display:flex}.HistoryWrapper .HistoryCols .HistoryColName{padding:0 5px;font-size:var(--emw--font-size-x-small, 12px);color:var(--emw--color-gray-100, #BBB9C3)}.HistoryWrapper .HistoryCols .HistoryColName.Level{flex-basis:90px}.HistoryWrapper .HistoryCols .HistoryColName.Status{flex-basis:100px}.HistoryWrapper .HistoryLoader{display:flex;flex-direction:column;justify-content:center;align-items:center;height:inherit;font-size:var(--emw--font-size-x-small, 12px);color:var(--emw--color-primary, #8F8B9C)}.HistoryWrapper .HistoryLoader casino-engagement-suite-progress-bar{margin-bottom:8px;width:100px}.HistoryWrapper .HistoryListItem{margin-top:8px}.HistoryWrapper .HistoryListItem.Opened .HistoryListItemButton{transform:rotate(180deg)}.HistoryWrapper .HistoryListItem.Opened .HistoryListItemBody{padding-bottom:8px;grid-template-rows:1fr}.HistoryWrapper .HistoryListItem .HistoryListItemHeader{padding:16px 0;display:flex;justify-content:space-between;align-items:center;color:var(--emw--color-typography, #FFFFFF);font-size:var(--emw--font-size-small, 14px)}.HistoryWrapper .HistoryListItem .HistoryListItemButton{transition:transform 0.3s ease-out;width:16px;height:16px;background:center/100% url(https://static.everymatrix.com/gic/img/engagement-suite/arrow-down.svg) no-repeat}.HistoryWrapper .HistoryListItem .HistoryListItemBody{position:relative;display:grid;grid-template-rows:0fr;transition:grid-template-rows 0.3s ease-out}.HistoryWrapper .HistoryListItem .HistoryListItemBody>div{overflow:hidden}.HistoryWrapper .HistoryListItem .HistoryListItemLevelCard{padding:12px 5px}.HistoryWrapper .HistoryListItem .HistoryLevelInfo{display:flex;font-size:var(--emw--font-size-x-small, 12px);color:var(--emw--color-gray-100, #BBB9C3)}.HistoryWrapper .HistoryListItem .HistoryLevelInfo .Level{flex-basis:90px}.HistoryWrapper .HistoryListItem .HistoryLevelInfo .Status{flex-basis:100px}.HistoryWrapper .HistoryListItem .HistoryRewardsList{margin-top:8px;display:flex;flex-wrap:wrap;gap:8px;align-items:center;font-size:var(--emw--font-size-x-small, 10px);font-weight:var(--emw--font-weight-bold, 700)}.HistoryWrapper .HistoryListItem .HistoryRewardsList .HistoryRewardStatusIcon,.HistoryWrapper .HistoryListItem .HistoryRewardsList .HistoryRewardsIcon{height:14px;width:14px}.HistoryWrapper .HistoryListItem .HistoryRewardsList .HistoryRewardsItem{display:flex;align-items:center;gap:2px;color:var(--emw--color-typography, #FFF)}.HistoryWrapper .HistoryListItem .HistoryRewardsList .HistoryRewardsItem .HistoryRewardStatusIcon{background:center/100% url(https://static.everymatrix.com/gic/img/engagement-suite/check.svg) no-repeat}.HistoryWrapper .HistoryListItem .HistoryRewardsList .HistoryRewardsItem.IsNotRewarded{color:var(--emw--color-background, #666178)}.HistoryWrapper .HistoryListItem .HistoryRewardsList .HistoryRewardsItem.IsNotRewarded .HistoryRewardStatusIcon{background-image:url(https://static.everymatrix.com/gic/img/engagement-suite/close.svg)}.ChallengesListPopup.Tablet .ChallengesListPopupHeader,.ChallengesListPopup.Desktop .ChallengesListPopupHeader{padding-top:16px}.ChallengesListPopup.Tablet .ChallengesListPopupHeaderName,.ChallengesListPopup.Desktop .ChallengesListPopupHeaderName{font-size:16px;line-height:16px}.ChallengesListPopup.Tablet .ChallengesIconButton,.ChallengesListPopup.Desktop .ChallengesIconButton{width:24px;height:24px}.ChallengesListPopup.Tablet .ChallengesList,.ChallengesListPopup.Desktop .ChallengesList{padding:20px 24px 0;row-gap:20px}.ChallengesListPopup.Tablet .ChallengesListEmpty,.ChallengesListPopup.Desktop .ChallengesListEmpty{padding:40px 65px}.ChallengesListPopup.Tablet .ChallengesListEmpty h2,.ChallengesListPopup.Desktop .ChallengesListEmpty h2{margin-bottom:32px;font-size:var(--emw--size-large, 24px);line-height:29px}.ChallengesListPopup.Tablet .ChallengesListEmpty p,.ChallengesListPopup.Desktop .ChallengesListEmpty p{font-size:var(--emw--font-size-small, 16px);line-height:20px}.ChallengesListPopup.Tablet .ChallengeCardHeader,.ChallengesListPopup.Desktop .ChallengeCardHeader{margin-bottom:16px}.ChallengesListPopup.Tablet .ChallengeName,.ChallengesListPopup.Tablet .ForfeitedChallengeName,.ChallengesListPopup.Desktop .ChallengeName,.ChallengesListPopup.Desktop .ForfeitedChallengeName{line-height:27px;font-size:22px}.ChallengesListPopup.Tablet .ForfeitedChallengeMessage,.ChallengesListPopup.Desktop .ForfeitedChallengeMessage{font-size:var(--emw--font-size-small, 14px);line-height:16px}.ChallengesListPopup.Tablet .ChallengeJoinButton,.ChallengesListPopup.Desktop .ChallengeJoinButton{min-width:100px;height:36px;font-size:16px}.ChallengesListPopup.Tablet .ChallengeCountdown,.ChallengesListPopup.Desktop .ChallengeCountdown{font-size:14px;line-height:14px}.ChallengesListPopup.Tablet .ChallengesTooltipBackdrop,.ChallengesListPopup.Desktop .ChallengesTooltipBackdrop{padding:90px 75px 0}.ChallengesListPopup.Tablet .ChallengesTooltip,.ChallengesListPopup.Desktop .ChallengesTooltip{padding:60px 65px;font-size:16px;line-height:20px}.ChallengesListPopup.Tablet .ChallengesTooltip .ChallengesIconButton,.ChallengesListPopup.Desktop .ChallengesTooltip .ChallengesIconButton{top:24px;right:24px}.ChallengesListPopup.Tablet .TabsWrapper,.ChallengesListPopup.Desktop .TabsWrapper{padding:0 24px;margin:20px 0}.ChallengesListPopup.Tablet .TabsWrapper .Tabs .Tab,.ChallengesListPopup.Desktop .TabsWrapper .Tabs .Tab{font-size:var(--emw--font-size-small, 16px)}.ChallengesListPopup.Tablet .HistoryWrapper,.ChallengesListPopup.Desktop .HistoryWrapper{padding:0 24px}.ChallengesListPopup.Tablet .HistoryWrapper .HistoryEmptyMessage,.ChallengesListPopup.Desktop .HistoryWrapper .HistoryEmptyMessage{margin-top:20px;font-size:var(--emw--font-size-small, 16px);line-height:20px}.ChallengesListPopup.Tablet .HistoryWrapper .HistoryCols .HistoryColName,.ChallengesListPopup.Desktop .HistoryWrapper .HistoryCols .HistoryColName{padding:0 12px;font-size:var(--emw--font-size-small, 16px)}.ChallengesListPopup.Tablet .HistoryWrapper .HistoryCols .HistoryColName.Level,.ChallengesListPopup.Desktop .HistoryWrapper .HistoryCols .HistoryColName.Level{flex-basis:140px}.ChallengesListPopup.Tablet .HistoryWrapper .HistoryCols .HistoryColName.Status,.ChallengesListPopup.Desktop .HistoryWrapper .HistoryCols .HistoryColName.Status{flex-basis:200px}.ChallengesListPopup.Tablet .HistoryWrapper .HistoryLoader,.ChallengesListPopup.Desktop .HistoryWrapper .HistoryLoader{font-size:var(--emw--font-size-small, 16px)}.ChallengesListPopup.Tablet .HistoryWrapper .HistoryLoader casino-engagement-suite-progress-bar,.ChallengesListPopup.Desktop .HistoryWrapper .HistoryLoader casino-engagement-suite-progress-bar{margin-bottom:10px;width:150px}.ChallengesListPopup.Tablet .HistoryWrapper .HistoryListItem,.ChallengesListPopup.Desktop .HistoryWrapper .HistoryListItem{margin-top:20px}.ChallengesListPopup.Tablet .HistoryWrapper .HistoryListItem.Opened .HistoryListItemBody,.ChallengesListPopup.Desktop .HistoryWrapper .HistoryListItem.Opened .HistoryListItemBody{padding-bottom:24px}.ChallengesListPopup.Tablet .HistoryWrapper .HistoryListItem .HistoryListItemHeader,.ChallengesListPopup.Desktop .HistoryWrapper .HistoryListItem .HistoryListItemHeader{cursor:pointer;padding:17px 5px;font-size:var(--emw--font-size-small, 16px)}.ChallengesListPopup.Tablet .HistoryWrapper .HistoryListItem .HistoryListItemButton,.ChallengesListPopup.Desktop .HistoryWrapper .HistoryListItem .HistoryListItemButton{width:24px;height:24px}.ChallengesListPopup.Tablet .HistoryWrapper .HistoryListItem .HistoryListItemLevelCard,.ChallengesListPopup.Desktop .HistoryWrapper .HistoryListItem .HistoryListItemLevelCard{padding:12px}.ChallengesListPopup.Tablet .HistoryWrapper .HistoryListItem .HistoryLevelInfo,.ChallengesListPopup.Desktop .HistoryWrapper .HistoryListItem .HistoryLevelInfo{font-size:var(--emw--font-size-small, 16px)}.ChallengesListPopup.Tablet .HistoryWrapper .HistoryListItem .HistoryLevelInfo .Level,.ChallengesListPopup.Desktop .HistoryWrapper .HistoryListItem .HistoryLevelInfo .Level{flex-basis:140px}.ChallengesListPopup.Tablet .HistoryWrapper .HistoryListItem .HistoryLevelInfo .Status,.ChallengesListPopup.Desktop .HistoryWrapper .HistoryListItem .HistoryLevelInfo .Status{flex-basis:200px}.ChallengesListPopup.Tablet .HistoryWrapper .HistoryListItem .HistoryRewardsList,.ChallengesListPopup.Desktop .HistoryWrapper .HistoryListItem .HistoryRewardsList{margin-top:12px;gap:12px;font-size:var(--emw--font-size-small, 14px);align-items:flex-end}.ChallengesListPopup.Tablet .HistoryWrapper .HistoryListItem .HistoryRewardsList .HistoryRewardsIcon,.ChallengesListPopup.Desktop .HistoryWrapper .HistoryListItem .HistoryRewardsList .HistoryRewardsIcon{height:24px;flex-basis:24px}";
2317
-
2318
- const CasinoEngagementSuiteChallengesList$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
2319
- constructor() {
2320
- super();
2321
- this.__registerHost();
2322
- this.__attachShadow();
2323
- this.close = createEvent(this, "close", 7);
2324
- this.resetNewChallengeLabel = createEvent(this, "resetNewChallengeLabel", 7);
2325
- /**
2326
- * Client custom styling via string
2327
- */
2328
- this.clientStyling = '';
2329
- /**
2330
- * Client custom styling via url
2331
- */
2332
- this.clientStylingUrl = '';
2333
- /**
2334
- * Language of the widget
2335
- */
2336
- this.language = 'en';
2337
- /**
2338
- * User's device type
2339
- */
2340
- this.device = 'Mobile';
2341
- /**
2342
- * List of challenges
2343
- */
2344
- this.challenges = [];
2345
- /**
2346
- *Paused Challenge Ids
2347
- */
2348
- this.pausedChallengeIds = [];
2349
- this.tooltip = false;
2350
- this.timers = {};
2351
- this.limitStylingAppends = false;
2352
- this.activeTab = 1;
2353
- this.historyLoading = false;
2354
- this.openedHistoryIds = [];
2355
- this.setClientStyling = () => {
2356
- let sheet = document.createElement('style');
2357
- sheet.innerHTML = this.clientStyling;
2358
- this.host.prepend(sheet);
2359
- };
2360
- this.setClientStylingURL = () => {
2361
- let url = new URL(this.clientStylingUrl);
2362
- let cssFile = document.createElement('style');
2363
- fetch(url.href)
2364
- .then((res) => res.text())
2365
- .then((data) => {
2366
- cssFile.innerHTML = data;
2367
- setTimeout(() => { this.host.prepend(cssFile); }, 1);
2368
- })
2369
- .catch((err) => {
2370
- console.log('Error ', err);
2371
- });
2372
- };
2373
- this.handleTabChange = (e) => {
2374
- this.activeTab = +(e.target.getAttribute('data-index'));
2375
- if (this.activeTab === 2) {
2376
- this.sendHistoryRequest();
2377
- }
2378
- };
2379
- this.toggleChallengeHistory = (ev) => {
2380
- const id = ev.currentTarget.getAttribute('data-id');
2381
- const index = this.openedHistoryIds.findIndex(historyId => historyId === id);
2382
- if (index > -1) {
2383
- this.openedHistoryIds.splice(index, 1);
2384
- }
2385
- else {
2386
- this.openedHistoryIds.push(id);
2387
- }
2388
- this.openedHistoryIds = [...this.openedHistoryIds];
2389
- };
2390
- this.handleCloseClick = () => {
2391
- this.close.emit();
2392
- this.tooltip = false;
2393
- this.resetNewChallengeLabel.emit('list');
2394
- };
2395
- this.handleChallengeClick = (ev) => {
2396
- const id = ev.currentTarget.getAttribute('data-id');
2397
- window.postMessage({ type: 'ChallengeClick', id });
2398
- };
2399
- this.showTooltip = () => {
2400
- this.tooltip = true;
2401
- };
2402
- this.hideTooltip = () => {
2403
- this.tooltip = false;
2404
- };
2405
- this.changeChallengeStatus = (e) => {
2406
- var _a, _b;
2407
- e.stopPropagation();
2408
- const id = e.currentTarget.getAttribute('data-id');
2409
- if ((_a = this.inProgressChallenges) === null || _a === void 0 ? void 0 : _a.includes(id)) {
2410
- window.postMessage({
2411
- type: 'ShowConfirmationModal',
2412
- ProgressToDeactivate: id,
2413
- });
2414
- return;
2415
- }
2416
- if (((_b = this.inProgressChallenges) === null || _b === void 0 ? void 0 : _b.length) > 0) {
2417
- window.postMessage({
2418
- type: 'ShowConfirmationModal',
2419
- ProgressToActivate: id,
2420
- ProgressToDeactivate: this.inProgressChallenges[0],
2421
- });
2422
- return;
2423
- }
2424
- window.postMessage({
2425
- type: 'ChallengeJoinRequest',
2426
- data: {
2427
- ProgressToActivate: id,
2428
- },
2429
- });
2430
- };
2431
- }
2432
- handleEvent(e) {
2433
- const { type } = e === null || e === void 0 ? void 0 : e.data;
2434
- if (type === 'ChallengesHistoryResponse') {
2435
- this.openedHistoryIds = [];
2436
- this.challengesHistory = e.data.data || [];
2437
- this.historyLoading = false;
2438
- }
2439
- if (type === 'BarChallengesClick') {
2440
- this.activeTab = 1;
2441
- this.openedHistoryIds = [];
2442
- }
2443
- }
2444
- challengesPropHandler(value) {
2445
- if (!this.interval && value.length) {
2446
- this.updateTimers();
2447
- this.startCountdown();
2448
- }
2449
- if (this.interval && !value.length) {
2450
- clearInterval(this.interval);
2451
- }
2452
- }
2453
- componentWillLoad() {
2454
- this.challengesPropHandler(this.challenges);
2455
- }
2456
- componentDidRender() {
2457
- if (!this.limitStylingAppends && this.host) {
2458
- if (this.clientStyling)
2459
- this.setClientStyling();
2460
- if (this.clientStylingUrl)
2461
- this.setClientStylingURL();
2462
- this.limitStylingAppends = true;
2463
- }
2464
- }
2465
- disconnectedCallback() {
2466
- this.interval && clearInterval(this.interval);
2467
- }
2468
- sendHistoryRequest() {
2469
- this.historyLoading = true;
2470
- window.postMessage({
2471
- type: 'ChallengesHistoryRequest'
2472
- });
2473
- }
2474
- startCountdown() {
2475
- this.interval = setInterval(() => {
2476
- this.updateTimers();
2477
- }, 1000);
2478
- }
2479
- updateTimers() {
2480
- const now = new Date().getTime();
2481
- this.timers = this.challenges.filter(challenge => challenge.Status !== ChallengeProgressStatus.Expired).reduce((acc, challenge) => {
2482
- const expirationDate = new Date(challenge.ExpirationTime).getTime();
2483
- const diff = expirationDate - now;
2484
- let countdown = '00h:00m:00s';
2485
- if (diff < 1) {
2486
- this.removeChallenge(challenge.Id);
2487
- }
2488
- else {
2489
- const { days, hours, minutes, seconds } = {
2490
- days: String(Math.floor(diff / (1000 * 60 * 60 * 24))).padStart(2, '0'),
2491
- hours: String(Math.floor((diff % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60))).padStart(2, '0'),
2492
- minutes: String(Math.floor((diff % (1000 * 60 * 60)) / (1000 * 60))).padStart(2, '0'),
2493
- seconds: String(Math.floor((diff % (1000 * 60)) / 1000)).padStart(2, '0')
2494
- };
2495
- countdown = days === '00'
2496
- ? `${hours}h:${minutes}m:${seconds}s`
2497
- : `${days}d:${hours}h:${minutes}m`;
2498
- }
2499
- return Object.assign(Object.assign({}, acc), { [challenge.Id]: countdown });
2500
- }, {});
2501
- }
2502
- removeChallenge(id) {
2503
- const index = this.challenges.findIndex(challenge => challenge.Id === id);
2504
- if (index > -1) {
2505
- this.challenges.splice(index, 1);
2506
- window.postMessage({ type: 'ChallengeHasExpired', id });
2507
- }
2508
- }
2509
- getChallengeClasses(challenge) {
2510
- return {
2511
- ChallengeCard: true,
2512
- InProgress: challenge.Status === ChallengeProgressStatus.InProgress
2513
- && !this.pausedChallengeIds.includes(challenge.ChallengeId),
2514
- Completed: this.isChallengeCompleted(challenge),
2515
- Paused: this.isChallengePaused(challenge)
2516
- };
2517
- }
2518
- isChallengePaused(challenge) {
2519
- return (challenge.Status === ChallengeProgressStatus.Started
2520
- && challenge.LevelProgresses[0].ProgressPercentage > 0)
2521
- || this.pausedChallengeIds.includes(challenge.ChallengeId);
2522
- }
2523
- isChallengeCompleted(challenge) {
2524
- return challenge.Status === ChallengeProgressStatus.Completed
2525
- || (challenge.Status === ChallengeProgressStatus.PendingLevelReward
2526
- && challenge.LevelProgresses.every(progress => progress.ProgressPercentage === 100));
2527
- }
2528
- getChallengeProgress(challenge) {
2529
- if (challenge.Status === ChallengeProgressStatus.Completed) {
2530
- return 100;
2531
- }
2532
- if (this.isChallengePaused(challenge)
2533
- || challenge.Status === ChallengeProgressStatus.PendingLevelReward
2534
- || challenge.Status === ChallengeProgressStatus.InProgress) {
2535
- const activeLevel = challenge.LevelProgresses
2536
- .find(level => level.ProgressStatus === ChallengeLevelProgressStatus.InProgress);
2537
- const completedLevel = challenge.LevelProgresses
2538
- .filter(level => level.ProgressStatus === ChallengeLevelProgressStatus.Fillup ||
2539
- level.ProgressStatus === ChallengeLevelProgressStatus.Completed).slice(-1)[0];
2540
- /**
2541
- * It is possible that Paused/InProgress challenge
2542
- * doesn't have InProgress, Fillup or Completed level
2543
- * because level becomes InProgress after user's bet.
2544
- * In this case should be displayed progress of the next level (0%)
2545
- */
2546
- return activeLevel ? activeLevel.ProgressPercentage
2547
- : (completedLevel ? completedLevel.ProgressPercentage : 0);
2548
- }
2549
- return -1;
2550
- }
2551
- getChallengeHeaderTemplate(challenge) {
2552
- const { Id } = challenge;
2553
- const inProgressChallenge = challenge.Status === ChallengeProgressStatus.InProgress
2554
- || challenge.Status === ChallengeProgressStatus.PendingLevelReward;
2555
- return h("div", { class: "ChallengeCardHeader" }, h("div", { class: "ChallengeName" }, challenge.ChallengePresentation.PresentationName), challenge.Status !== ChallengeProgressStatus.Completed ? (h("button", { class: `${inProgressChallenge ?
2556
- 'ChallengeJoinButton Joined' : 'ChallengeJoinButton'} ${this.isJoiningToChallenge ||
2557
- this.pausedChallengeIds.includes(challenge.ChallengeId) ?
2558
- 'Disabled' : ''}`, onClick: this.changeChallengeStatus, "data-id": Id }, inProgressChallenge
2559
- ? translate('unjoin', this.language)
2560
- : translate('join', this.language))) : null);
2561
- }
2562
- getChallengeTemplate(challenge) {
2563
- const isForfeitedChallenge = challenge.Status === ChallengeProgressStatus.Forfeited;
2564
- const challengeProgress = this.getChallengeProgress(challenge);
2565
- const countdown = this.timers[challenge.Id];
2566
- const progressTemplate = challengeProgress > -1
2567
- ? h("casino-engagement-suite-progress-bar", { class: this.device, value: challengeProgress, disabled: this.isChallengePaused(challenge) }, h("span", { slot: "Title", class: "ChallengeCountdown" }, countdown))
2568
- : h("span", { class: "ChallengeCountdown" }, countdown);
2569
- return isForfeitedChallenge ? (this.getForfeitedChallengeTemplate(challenge)) : (h("div", { class: this.getChallengeClasses(challenge), onClick: this.handleChallengeClick, key: challenge.Id, "data-id": challenge.Id }, this.getChallengeHeaderTemplate(challenge), progressTemplate, h("div", { class: `ChallengeLabel ${challenge.IsNew ? 'ShowChallengeLabel' : ''}` }, h("span", null, translate('new', this.language)))));
2570
- }
2571
- getForfeitedChallengeTemplate(challenge) {
2572
- return h("div", { class: "ChallengeCard ForfeitedChallengeCard" }, h("div", { class: "ForfeitedChallengeName" }, challenge.ChallengePresentation.PresentationName), h("div", { class: "ForfeitedChallengeInfo" }, h("div", null, h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/alert-circle.svg", alt: "Forfeited" })), h("div", { class: "ForfeitedChallengeMessage" }, h("div", null, translate('missionHasBeenForfeited', this.language)), h("div", null, translate('support', this.language)))));
2573
- }
2574
- getHeaderTemplate() {
2575
- return h("header", { class: "ChallengesListPopupHeader" }, h("button", { onClick: this.showTooltip, class: "ChallengesIconButton" }, h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/help.svg", alt: "Show tooltip" })), h("div", { class: "ChallengesListPopupHeaderName" }, translate('missions', this.language)), h("button", { class: "ChallengesIconButton", onClick: this.handleCloseClick }, h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/close.svg", alt: "Close missions list" })));
2576
- }
2577
- getListTabTemplate() {
2578
- if (this.challenges.length) {
2579
- return h("div", { class: "ChallengesListWrapper" }, h("div", { class: "ChallengesList" }, [...this.challenges]
2580
- .sort(challenge => challenge.Status === ChallengeProgressStatus.InProgress ? -1 : 0)
2581
- .map(challenge => this.getChallengeTemplate(challenge))));
2582
- }
2583
- else {
2584
- return h("div", { class: "ChallengesListEmpty" }, h("h2", null, translate('noMissions', this.language)), h("p", null, translate('tryOtherGames', this.language)));
2585
- }
2586
- }
2587
- getTooltipTemplate() {
2588
- return h("div", { class: "ChallengesTooltipBackdrop" }, h("div", { class: "ChallengesTooltip" }, h("button", { class: "ChallengesIconButton", onClick: this.hideTooltip }, h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/close.svg", alt: "Close tooltip" })), translate('tooltip', this.language)));
2589
- }
2590
- getHistoryTabTemplate() {
2591
- return h("div", { class: "HistoryWrapper" }, h("div", { class: "HistoryCols" }, h("div", { class: "HistoryColName Level" }, translate('level', this.language)), h("div", { class: "HistoryColName Status" }, translate('status', this.language)), h("div", { class: "HistoryColName Time" }, translate('time', this.language))), this.historyLoading
2592
- ? getHistoryLoaderTemplate(this.language)
2593
- : getChallengesHistoryTemplate(this.challengesHistory, this.openedHistoryIds, this.toggleChallengeHistory, this.language));
2594
- }
2595
- getTabsTemplate() {
2596
- return h("div", { class: "TabsWrapper" }, h("div", { class: "Tabs" }, h("div", { "data-index": "1", onClick: this.handleTabChange, class: `Tab ${this.activeTab === 1 ? 'Active' : ''}` }, translate('missions', this.language)), h("div", { "data-index": "2", onClick: this.handleTabChange, class: `Tab ${this.activeTab === 2 ? 'Active' : ''}` }, translate('history', this.language))));
2597
- }
2598
- getTabsContentTemplate() {
2599
- return this.activeTab === 1
2600
- ? this.getListTabTemplate()
2601
- : this.getHistoryTabTemplate();
2602
- }
2603
- render() {
2604
- return h("div", { class: `ChallengesListPopup ${this.device}` }, this.getHeaderTemplate(), this.getTabsTemplate(), this.getTabsContentTemplate(), this.tooltip && this.getTooltipTemplate());
2605
- }
2606
- get host() { return this; }
2607
- static get watchers() { return {
2608
- "challenges": ["challengesPropHandler"]
2609
- }; }
2610
- static get style() { return casinoEngagementSuiteChallengesListCss; }
2611
- }, [1, "casino-engagement-suite-challenges-list", {
2612
- "clientStyling": [513, "client-styling"],
2613
- "clientStylingUrl": [513, "client-styling-url"],
2614
- "language": [1],
2615
- "device": [1],
2616
- "challenges": [1040],
2617
- "isJoiningToChallenge": [1028, "is-joining-to-challenge"],
2618
- "inProgressChallenges": [1040],
2619
- "pausedChallengeIds": [1040],
2620
- "tooltip": [32],
2621
- "timers": [32],
2622
- "limitStylingAppends": [32],
2623
- "activeTab": [32],
2624
- "historyLoading": [32],
2625
- "challengesHistory": [32],
2626
- "openedHistoryIds": [32]
2627
- }, [[8, "message", "handleEvent"]]]);
2628
- function defineCustomElement$1() {
2629
- if (typeof customElements === "undefined") {
2630
- return;
2631
- }
2632
- const components = ["casino-engagement-suite-challenges-list", "casino-engagement-suite-progress-bar"];
2633
- components.forEach(tagName => { switch (tagName) {
2634
- case "casino-engagement-suite-challenges-list":
2635
- if (!customElements.get(tagName)) {
2636
- customElements.define(tagName, CasinoEngagementSuiteChallengesList$1);
2637
- }
2638
- break;
2639
- case "casino-engagement-suite-progress-bar":
2640
- if (!customElements.get(tagName)) {
2641
- defineCustomElement$2();
2642
- }
2643
- break;
2644
- } });
2645
- }
2646
-
2647
- const CasinoEngagementSuiteChallengesList = CasinoEngagementSuiteChallengesList$1;
2648
- const defineCustomElement = defineCustomElement$1;
2649
-
2650
- export { CasinoEngagementSuiteChallengesList, defineCustomElement };