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