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