@everymatrix/casino-challenge-details 0.8.8 → 0.8.9
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.
- package/dist/casino-challenge-details/casino-challenge-details-9f39552b.js +7 -0
- package/dist/casino-challenge-details/casino-challenge-details_4.entry.js +1 -1
- package/dist/casino-challenge-details/index.esm.js +1 -1
- package/dist/cjs/{casino-challenge-details-2457b8fe.js → casino-challenge-details-ec73864c.js} +50 -31
- package/dist/cjs/casino-challenge-details_4.cjs.entry.js +1 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/collection/components/casino-challenge-details/casino-challenge-details.js +50 -31
- package/dist/esm/{casino-challenge-details-358af028.js → casino-challenge-details-9f39552b.js} +50 -31
- package/dist/esm/casino-challenge-details_4.entry.js +2 -2
- package/dist/esm/index.js +1 -1
- package/dist/types/components/casino-challenge-details/casino-challenge-details.d.ts +3 -3
- package/package.json +1 -1
- package/dist/casino-challenge-details/casino-challenge-details-358af028.js +0 -7
|
@@ -59,12 +59,20 @@ export class CasinoChallengeDetails {
|
|
|
59
59
|
case EChallengeProgressStatus.Paused:
|
|
60
60
|
return translate('suspended', this.language);
|
|
61
61
|
default:
|
|
62
|
-
return [translate('endsIn', this.language), ' - ', h("span", null, this.timeLeft
|
|
62
|
+
return !this.timeLeft ? null : [translate('endsIn', this.language), ' - ', h("span", null, this.timeLeft)];
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
else
|
|
66
66
|
return null;
|
|
67
67
|
};
|
|
68
|
+
this.getCardBadge = () => {
|
|
69
|
+
var _a;
|
|
70
|
+
const content = this.getBadgeContent();
|
|
71
|
+
if (!content) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
return (h("div", { class: `details__general-info-timer-badge ${this.isChallengePaused ? 'expired' : ChallengeStatusDictionary[(_a = this.challenge) === null || _a === void 0 ? void 0 : _a.Status]}` }, content));
|
|
75
|
+
};
|
|
68
76
|
this.checkAttrs = () => {
|
|
69
77
|
if (!this.endpoint) {
|
|
70
78
|
this.error = 'Endpoint is missing! Please provide a valid endpointURL.';
|
|
@@ -96,6 +104,16 @@ export class CasinoChallengeDetails {
|
|
|
96
104
|
body: JSON.stringify(body)
|
|
97
105
|
})
|
|
98
106
|
.then((res) => res.json())
|
|
107
|
+
.then((res) => {
|
|
108
|
+
if (res.Success) {
|
|
109
|
+
if (join) {
|
|
110
|
+
this.challenge.Status = EChallengeProgressStatus.InProgress;
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
this.challenge.Status = EChallengeProgressStatus.Paused;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
})
|
|
99
117
|
.finally(() => (this.actionLoading = false));
|
|
100
118
|
}
|
|
101
119
|
};
|
|
@@ -137,6 +155,17 @@ export class CasinoChallengeDetails {
|
|
|
137
155
|
}
|
|
138
156
|
return '';
|
|
139
157
|
};
|
|
158
|
+
this.footer = () => {
|
|
159
|
+
var _a, _b, _c, _d;
|
|
160
|
+
return (h("div", { class: "button__container" }, h("button", { class: {
|
|
161
|
+
'footer-action-button': true,
|
|
162
|
+
filled: ((_a = this.challenge) === null || _a === void 0 ? void 0 : _a.Status) === EChallengeProgressStatus.Started || !this.isUserAuthorized,
|
|
163
|
+
grayed: this.isUserAuthorized &&
|
|
164
|
+
(((_b = this.challenge) === null || _b === void 0 ? void 0 : _b.Status) === EChallengeProgressStatus.Paused ||
|
|
165
|
+
((_c = this.challenge) === null || _c === void 0 ? void 0 : _c.Status) === EChallengeProgressStatus.InProgress ||
|
|
166
|
+
((_d = this.challenge) === null || _d === void 0 ? void 0 : _d.Status) === EChallengeProgressStatus.PendingLevelReward)
|
|
167
|
+
}, onClick: this.joinUnjoinProgress, disabled: this.actionLoading }, translate(this.actionButtonText, this.language))));
|
|
168
|
+
};
|
|
140
169
|
this.goBack = () => {
|
|
141
170
|
window.history.back();
|
|
142
171
|
};
|
|
@@ -198,8 +227,10 @@ export class CasinoChallengeDetails {
|
|
|
198
227
|
break;
|
|
199
228
|
}
|
|
200
229
|
case 'forfeitedChallengeProgressNotification': {
|
|
201
|
-
if (this.
|
|
202
|
-
this.challenge
|
|
230
|
+
if (this.session) {
|
|
231
|
+
if (this.challenge.Id === (data === null || data === void 0 ? void 0 : data.challengeProgressId)) {
|
|
232
|
+
this.challenge = Object.assign(Object.assign({}, this.challenge), { Status: EChallengeProgressStatus.Forfeited });
|
|
233
|
+
}
|
|
203
234
|
}
|
|
204
235
|
break;
|
|
205
236
|
}
|
|
@@ -236,6 +267,7 @@ export class CasinoChallengeDetails {
|
|
|
236
267
|
}
|
|
237
268
|
onEntityChange(newChallenge, previousChallenge) {
|
|
238
269
|
var _a, _b, _c, _d;
|
|
270
|
+
this.isChallengePaused = (newChallenge === null || newChallenge === void 0 ? void 0 : newChallenge.ChallengeStatus) === EChallengeStatus.Paused;
|
|
239
271
|
const newActiveProgressId = (_b = (_a = newChallenge === null || newChallenge === void 0 ? void 0 : newChallenge.LevelProgresses) === null || _a === void 0 ? void 0 : _a.find((level) => level.ProgressStatus === EChallengeProgressLevelStatus.InProgress)) === null || _b === void 0 ? void 0 : _b.LevelId;
|
|
240
272
|
const prevActiveProgressId = (_d = (_c = previousChallenge === null || previousChallenge === void 0 ? void 0 : previousChallenge.LevelProgresses) === null || _c === void 0 ? void 0 : _c.find((level) => level.ProgressStatus === EChallengeProgressLevelStatus.InProgress)) === null || _d === void 0 ? void 0 : _d.LevelId;
|
|
241
273
|
if (newActiveProgressId == prevActiveProgressId) {
|
|
@@ -372,17 +404,11 @@ export class CasinoChallengeDetails {
|
|
|
372
404
|
this.timeLeft = getTimeLeft((_a = this.challenge) === null || _a === void 0 ? void 0 : _a.ExpirationTime);
|
|
373
405
|
if (!this.timeLeft && this.timerExpired) {
|
|
374
406
|
clearInterval(this.timerId);
|
|
407
|
+
this.challenge = Object.assign(Object.assign({}, this.challenge), { Status: EChallengeProgressStatus.Expired });
|
|
375
408
|
this.timerExpired.emit((_b = this.challenge) === null || _b === void 0 ? void 0 : _b.Id);
|
|
376
409
|
}
|
|
377
410
|
}
|
|
378
411
|
}
|
|
379
|
-
get getCardBadge() {
|
|
380
|
-
var _a;
|
|
381
|
-
if (this.timeLeft) {
|
|
382
|
-
return (h("div", { class: `details__general-info-timer-badge ${ChallengeStatusDictionary[(_a = this.challenge) === null || _a === void 0 ? void 0 : _a.Status]}` }, this.getBadgeContent()));
|
|
383
|
-
}
|
|
384
|
-
return null;
|
|
385
|
-
}
|
|
386
412
|
get actionButtonText() {
|
|
387
413
|
var _a;
|
|
388
414
|
if (this.isUserAuthorized) {
|
|
@@ -469,21 +495,25 @@ export class CasinoChallengeDetails {
|
|
|
469
495
|
return (h("div", { class: "challenges-header" }, h("h1", { class: "challenges-title" }, h("img", { src: titleIcon, alt: "icon" }), translate('title', this.language)), this.isUserAuthorized && (h("div", { class: "challenges-tabs" }, this.challengesTabs.map((label, index) => (h("div", { class: `challenges-tab ${index === +this.activeChallengeTabIndex ? 'active' : ''}`, onClick: this.handleChallengesTabClick(index) }, label, this.showNotification === index && h("img", { src: notificationIcon }))))))));
|
|
470
496
|
}
|
|
471
497
|
get cardGeneralInfo() {
|
|
472
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
498
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
499
|
+
const showButton = !(((_a = this.challenge) === null || _a === void 0 ? void 0 : _a.ChallengeStatus) === EChallengeStatus.Paused ||
|
|
500
|
+
((_b = this.challenge) === null || _b === void 0 ? void 0 : _b.Status) === EChallengeProgressStatus.Forfeited ||
|
|
501
|
+
((_c = this.challenge) === null || _c === void 0 ? void 0 : _c.Status) === EChallengeProgressStatus.Completed ||
|
|
502
|
+
((_d = this.challenge) === null || _d === void 0 ? void 0 : _d.Status) === EChallengeProgressStatus.Expired);
|
|
473
503
|
return (h("div", { class: "details__general-info" }, h("div", { class: "details__general-info-image-container" }, h("img", { class: {
|
|
474
504
|
'details__general-info-image': true,
|
|
475
505
|
grayed: [
|
|
476
506
|
EChallengeProgressStatus.Expired,
|
|
477
507
|
EChallengeProgressStatus.Forfeited,
|
|
478
508
|
EChallengeProgressStatus.Completed
|
|
479
|
-
].includes((
|
|
480
|
-
}, src: (
|
|
509
|
+
].includes((_e = this.challenge) === null || _e === void 0 ? void 0 : _e.Status)
|
|
510
|
+
}, src: (_g = (_f = this.challenge) === null || _f === void 0 ? void 0 : _f.ChallengePresentation) === null || _g === void 0 ? void 0 : _g.BannerUrl, alt: "banner-image", title: "banner-image" }), this.getCardBadge()), h("div", { class: "details__general-info-content" }, h("h1", { class: "details__general-info-title" }, (_j = (_h = this.challenge) === null || _h === void 0 ? void 0 : _h.ChallengePresentation) === null || _j === void 0 ? void 0 : _j.PresentationName), h("h3", { class: "details__general-info-end-date_label" }, translate('endDate', this.language), " -", ' ', h("span", { class: "details__general-info-end-date_value" }, this.challenge ? formatDate((_k = this.challenge) === null || _k === void 0 ? void 0 : _k.ExpirationTime) : '-')), h("casino-challenge-progress-bar", { challenge: this.challenge, isUserAuthorized: this.isUserAuthorized, language: this.language }), showButton && (h("button", { class: {
|
|
481
511
|
'details__general-info-action-button': true,
|
|
482
|
-
filled: ((
|
|
483
|
-
grayed: ((
|
|
484
|
-
((
|
|
485
|
-
((
|
|
486
|
-
}, disabled: this.actionLoading, onClick: this.joinUnjoinProgress }, translate(this.actionButtonText, this.language)))));
|
|
512
|
+
filled: ((_l = this.challenge) === null || _l === void 0 ? void 0 : _l.Status) === EChallengeProgressStatus.Started,
|
|
513
|
+
grayed: ((_m = this.challenge) === null || _m === void 0 ? void 0 : _m.Status) === EChallengeProgressStatus.Paused ||
|
|
514
|
+
((_o = this.challenge) === null || _o === void 0 ? void 0 : _o.Status) === EChallengeProgressStatus.InProgress ||
|
|
515
|
+
((_p = this.challenge) === null || _p === void 0 ? void 0 : _p.Status) === EChallengeProgressStatus.PendingLevelReward
|
|
516
|
+
}, disabled: this.actionLoading, onClick: this.joinUnjoinProgress }, translate(this.actionButtonText, this.language))))));
|
|
487
517
|
}
|
|
488
518
|
get challengeTabs() {
|
|
489
519
|
return (h("div", { class: "details__tabs" }, this.tabs.map((label, index) => (h("div", { class: {
|
|
@@ -495,7 +525,7 @@ export class CasinoChallengeDetails {
|
|
|
495
525
|
var _a, _b;
|
|
496
526
|
return (h("div", { class: "levels__tab", ref: (el) => (this.scrollContainerRef = el) }, (_b = (_a = this.challenge) === null || _a === void 0 ? void 0 : _a.LevelProgresses) === null || _b === void 0 ? void 0 : _b.map((level, index) => {
|
|
497
527
|
var _a;
|
|
498
|
-
const activeChallenge = [0, 1, 2, 3].includes((_a = this === null || this === void 0 ? void 0 : this.challenge) === null || _a === void 0 ? void 0 : _a.Status);
|
|
528
|
+
const activeChallenge = [0, 1, 2, 3].includes((_a = this === null || this === void 0 ? void 0 : this.challenge) === null || _a === void 0 ? void 0 : _a.Status) && !this.isChallengePaused;
|
|
499
529
|
const isGrayed = (this.isUserAuthorized && level.ProgressStatus !== EChallengeProgressLevelStatus.InProgress) ||
|
|
500
530
|
!activeChallenge;
|
|
501
531
|
const isActiveMatch = level.ProgressStatus === EChallengeProgressLevelStatus.InProgress;
|
|
@@ -561,17 +591,6 @@ export class CasinoChallengeDetails {
|
|
|
561
591
|
const contributionRule = this.getContributionRule((_b = this.challenge) === null || _b === void 0 ? void 0 : _b.IsContributeToOne);
|
|
562
592
|
return (h("div", { class: "rules__tab" }, ((_d = (_c = this.challenge) === null || _c === void 0 ? void 0 : _c.ChallengePresentation) === null || _d === void 0 ? void 0 : _d.Description) && (h("div", { class: "rule" }, (_f = (_e = this.challenge) === null || _e === void 0 ? void 0 : _e.ChallengePresentation) === null || _f === void 0 ? void 0 : _f.Description)), contributionType && (h("div", { class: "contributionType" }, h("span", { class: "contribution__label contribution__type__label" }, '\u{1F4B0}', " ", translate('contributionType', this.language), ":"), h("span", { class: "contribution__value" }, contributionType))), contributionRule && (h("div", { class: "contributionRule" }, h("span", { class: "contribution__label" }, '\u{1F4C4}', " ", translate('contributionRule', this.language), ":"))), contributionRule && h("span", { class: "contribution__value contribution__rule__value" }, contributionRule), ((_h = (_g = this.challenge) === null || _g === void 0 ? void 0 : _g.ChallengePresentation) === null || _h === void 0 ? void 0 : _h.Url) && (h("a", { class: "link", href: (_k = (_j = this.challenge) === null || _j === void 0 ? void 0 : _j.ChallengePresentation) === null || _k === void 0 ? void 0 : _k.Url, target: "_blank" }, translate('terms', this.language)))));
|
|
563
593
|
}
|
|
564
|
-
get footer() {
|
|
565
|
-
var _a, _b, _c, _d;
|
|
566
|
-
return (h("div", { class: "button__container" }, h("button", { class: {
|
|
567
|
-
'footer-action-button': true,
|
|
568
|
-
filled: ((_a = this.challenge) === null || _a === void 0 ? void 0 : _a.Status) === EChallengeProgressStatus.Started || !this.isUserAuthorized,
|
|
569
|
-
grayed: this.isUserAuthorized &&
|
|
570
|
-
(((_b = this.challenge) === null || _b === void 0 ? void 0 : _b.Status) === EChallengeProgressStatus.Paused ||
|
|
571
|
-
((_c = this.challenge) === null || _c === void 0 ? void 0 : _c.Status) === EChallengeProgressStatus.InProgress ||
|
|
572
|
-
((_d = this.challenge) === null || _d === void 0 ? void 0 : _d.Status) === EChallengeProgressStatus.PendingLevelReward)
|
|
573
|
-
}, onClick: this.joinUnjoinProgress, disabled: this.actionLoading }, translate(this.actionButtonText, this.language))));
|
|
574
|
-
}
|
|
575
594
|
get forfeitedNofitication() {
|
|
576
595
|
var _a;
|
|
577
596
|
return (((_a = this.challenge) === null || _a === void 0 ? void 0 : _a.Status) === 5 && (h("div", { class: "notification" }, h("img", { class: "notification__icon", src: alertIcon }), h("span", { class: "notification__message" }, translate('forfeitNotification', this.language)))));
|
|
@@ -585,7 +604,7 @@ export class CasinoChallengeDetails {
|
|
|
585
604
|
return (((_a = this.challenge) === null || _a === void 0 ? void 0 : _a.Status) === 4 && (h("div", { class: "notification" }, h("img", { class: "notification__icon", src: infoIcon }), h("span", { class: "notification__message" }, translate('expiredNotification', this.language)))));
|
|
586
605
|
}
|
|
587
606
|
render() {
|
|
588
|
-
return (h("div", { key: '
|
|
607
|
+
return (h("div", { key: '3b40178d61dd13dbbfbc90958d0c8a60da819da9', ref: (el) => (this.stylingContainer = el), class: "container" }, this.pageHeader, this.loading ? (h("div", { class: "lds-dual-ring" })) : (h("div", null, h("button", { class: "back-button", onClick: this.goBack }, h("img", { class: "back-button__icon", src: backIcon }), this.getBackButtonText()), this.forfeitedNofitication, this.completedNotification, this.expiredNotification, h("div", { class: "details" }, this.cardGeneralInfo, h("div", { class: "details__tabs-container" }, this.challengeTabs, this.activeTabIndex === 0 && this.levelsTab, this.activeTabIndex === 1 && this.gamesTab, this.activeTabIndex === 2 && this.rulesTab), this.footer())))));
|
|
589
608
|
}
|
|
590
609
|
static get is() { return "casino-challenge-details"; }
|
|
591
610
|
static get encapsulation() { return "shadow"; }
|
package/dist/esm/{casino-challenge-details-358af028.js → casino-challenge-details-9f39552b.js}
RENAMED
|
@@ -1483,12 +1483,20 @@ const CasinoChallengeDetails = class {
|
|
|
1483
1483
|
case EChallengeProgressStatus.Paused:
|
|
1484
1484
|
return translate('suspended', this.language);
|
|
1485
1485
|
default:
|
|
1486
|
-
return [translate('endsIn', this.language), ' - ', h("span", null, this.timeLeft
|
|
1486
|
+
return !this.timeLeft ? null : [translate('endsIn', this.language), ' - ', h("span", null, this.timeLeft)];
|
|
1487
1487
|
}
|
|
1488
1488
|
}
|
|
1489
1489
|
else
|
|
1490
1490
|
return null;
|
|
1491
1491
|
};
|
|
1492
|
+
this.getCardBadge = () => {
|
|
1493
|
+
var _a;
|
|
1494
|
+
const content = this.getBadgeContent();
|
|
1495
|
+
if (!content) {
|
|
1496
|
+
return;
|
|
1497
|
+
}
|
|
1498
|
+
return (h("div", { class: `details__general-info-timer-badge ${this.isChallengePaused ? 'expired' : ChallengeStatusDictionary[(_a = this.challenge) === null || _a === void 0 ? void 0 : _a.Status]}` }, content));
|
|
1499
|
+
};
|
|
1492
1500
|
this.checkAttrs = () => {
|
|
1493
1501
|
if (!this.endpoint) {
|
|
1494
1502
|
this.error = 'Endpoint is missing! Please provide a valid endpointURL.';
|
|
@@ -1520,6 +1528,16 @@ const CasinoChallengeDetails = class {
|
|
|
1520
1528
|
body: JSON.stringify(body)
|
|
1521
1529
|
})
|
|
1522
1530
|
.then((res) => res.json())
|
|
1531
|
+
.then((res) => {
|
|
1532
|
+
if (res.Success) {
|
|
1533
|
+
if (join) {
|
|
1534
|
+
this.challenge.Status = EChallengeProgressStatus.InProgress;
|
|
1535
|
+
}
|
|
1536
|
+
else {
|
|
1537
|
+
this.challenge.Status = EChallengeProgressStatus.Paused;
|
|
1538
|
+
}
|
|
1539
|
+
}
|
|
1540
|
+
})
|
|
1523
1541
|
.finally(() => (this.actionLoading = false));
|
|
1524
1542
|
}
|
|
1525
1543
|
};
|
|
@@ -1559,6 +1577,17 @@ const CasinoChallengeDetails = class {
|
|
|
1559
1577
|
}
|
|
1560
1578
|
return '';
|
|
1561
1579
|
};
|
|
1580
|
+
this.footer = () => {
|
|
1581
|
+
var _a, _b, _c, _d;
|
|
1582
|
+
return (h("div", { class: "button__container" }, h("button", { class: {
|
|
1583
|
+
'footer-action-button': true,
|
|
1584
|
+
filled: ((_a = this.challenge) === null || _a === void 0 ? void 0 : _a.Status) === EChallengeProgressStatus.Started || !this.isUserAuthorized,
|
|
1585
|
+
grayed: this.isUserAuthorized &&
|
|
1586
|
+
(((_b = this.challenge) === null || _b === void 0 ? void 0 : _b.Status) === EChallengeProgressStatus.Paused ||
|
|
1587
|
+
((_c = this.challenge) === null || _c === void 0 ? void 0 : _c.Status) === EChallengeProgressStatus.InProgress ||
|
|
1588
|
+
((_d = this.challenge) === null || _d === void 0 ? void 0 : _d.Status) === EChallengeProgressStatus.PendingLevelReward)
|
|
1589
|
+
}, onClick: this.joinUnjoinProgress, disabled: this.actionLoading }, translate(this.actionButtonText, this.language))));
|
|
1590
|
+
};
|
|
1562
1591
|
this.goBack = () => {
|
|
1563
1592
|
window.history.back();
|
|
1564
1593
|
};
|
|
@@ -1620,8 +1649,10 @@ const CasinoChallengeDetails = class {
|
|
|
1620
1649
|
break;
|
|
1621
1650
|
}
|
|
1622
1651
|
case 'forfeitedChallengeProgressNotification': {
|
|
1623
|
-
if (this.
|
|
1624
|
-
this.challenge
|
|
1652
|
+
if (this.session) {
|
|
1653
|
+
if (this.challenge.Id === (data === null || data === void 0 ? void 0 : data.challengeProgressId)) {
|
|
1654
|
+
this.challenge = Object.assign(Object.assign({}, this.challenge), { Status: EChallengeProgressStatus.Forfeited });
|
|
1655
|
+
}
|
|
1625
1656
|
}
|
|
1626
1657
|
break;
|
|
1627
1658
|
}
|
|
@@ -1658,6 +1689,7 @@ const CasinoChallengeDetails = class {
|
|
|
1658
1689
|
}
|
|
1659
1690
|
onEntityChange(newChallenge, previousChallenge) {
|
|
1660
1691
|
var _a, _b, _c, _d;
|
|
1692
|
+
this.isChallengePaused = (newChallenge === null || newChallenge === void 0 ? void 0 : newChallenge.ChallengeStatus) === EChallengeStatus.Paused;
|
|
1661
1693
|
const newActiveProgressId = (_b = (_a = newChallenge === null || newChallenge === void 0 ? void 0 : newChallenge.LevelProgresses) === null || _a === void 0 ? void 0 : _a.find((level) => level.ProgressStatus === EChallengeProgressLevelStatus.InProgress)) === null || _b === void 0 ? void 0 : _b.LevelId;
|
|
1662
1694
|
const prevActiveProgressId = (_d = (_c = previousChallenge === null || previousChallenge === void 0 ? void 0 : previousChallenge.LevelProgresses) === null || _c === void 0 ? void 0 : _c.find((level) => level.ProgressStatus === EChallengeProgressLevelStatus.InProgress)) === null || _d === void 0 ? void 0 : _d.LevelId;
|
|
1663
1695
|
if (newActiveProgressId == prevActiveProgressId) {
|
|
@@ -1794,17 +1826,11 @@ const CasinoChallengeDetails = class {
|
|
|
1794
1826
|
this.timeLeft = getTimeLeft((_a = this.challenge) === null || _a === void 0 ? void 0 : _a.ExpirationTime);
|
|
1795
1827
|
if (!this.timeLeft && this.timerExpired) {
|
|
1796
1828
|
clearInterval(this.timerId);
|
|
1829
|
+
this.challenge = Object.assign(Object.assign({}, this.challenge), { Status: EChallengeProgressStatus.Expired });
|
|
1797
1830
|
this.timerExpired.emit((_b = this.challenge) === null || _b === void 0 ? void 0 : _b.Id);
|
|
1798
1831
|
}
|
|
1799
1832
|
}
|
|
1800
1833
|
}
|
|
1801
|
-
get getCardBadge() {
|
|
1802
|
-
var _a;
|
|
1803
|
-
if (this.timeLeft) {
|
|
1804
|
-
return (h("div", { class: `details__general-info-timer-badge ${ChallengeStatusDictionary[(_a = this.challenge) === null || _a === void 0 ? void 0 : _a.Status]}` }, this.getBadgeContent()));
|
|
1805
|
-
}
|
|
1806
|
-
return null;
|
|
1807
|
-
}
|
|
1808
1834
|
get actionButtonText() {
|
|
1809
1835
|
var _a;
|
|
1810
1836
|
if (this.isUserAuthorized) {
|
|
@@ -1891,21 +1917,25 @@ const CasinoChallengeDetails = class {
|
|
|
1891
1917
|
return (h("div", { class: "challenges-header" }, h("h1", { class: "challenges-title" }, h("img", { src: titleIconSvg, alt: "icon" }), translate('title', this.language)), this.isUserAuthorized && (h("div", { class: "challenges-tabs" }, this.challengesTabs.map((label, index) => (h("div", { class: `challenges-tab ${index === +this.activeChallengeTabIndex ? 'active' : ''}`, onClick: this.handleChallengesTabClick(index) }, label, this.showNotification === index && h("img", { src: notificationSvg }))))))));
|
|
1892
1918
|
}
|
|
1893
1919
|
get cardGeneralInfo() {
|
|
1894
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
1920
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
1921
|
+
const showButton = !(((_a = this.challenge) === null || _a === void 0 ? void 0 : _a.ChallengeStatus) === EChallengeStatus.Paused ||
|
|
1922
|
+
((_b = this.challenge) === null || _b === void 0 ? void 0 : _b.Status) === EChallengeProgressStatus.Forfeited ||
|
|
1923
|
+
((_c = this.challenge) === null || _c === void 0 ? void 0 : _c.Status) === EChallengeProgressStatus.Completed ||
|
|
1924
|
+
((_d = this.challenge) === null || _d === void 0 ? void 0 : _d.Status) === EChallengeProgressStatus.Expired);
|
|
1895
1925
|
return (h("div", { class: "details__general-info" }, h("div", { class: "details__general-info-image-container" }, h("img", { class: {
|
|
1896
1926
|
'details__general-info-image': true,
|
|
1897
1927
|
grayed: [
|
|
1898
1928
|
EChallengeProgressStatus.Expired,
|
|
1899
1929
|
EChallengeProgressStatus.Forfeited,
|
|
1900
1930
|
EChallengeProgressStatus.Completed
|
|
1901
|
-
].includes((
|
|
1902
|
-
}, src: (
|
|
1931
|
+
].includes((_e = this.challenge) === null || _e === void 0 ? void 0 : _e.Status)
|
|
1932
|
+
}, src: (_g = (_f = this.challenge) === null || _f === void 0 ? void 0 : _f.ChallengePresentation) === null || _g === void 0 ? void 0 : _g.BannerUrl, alt: "banner-image", title: "banner-image" }), this.getCardBadge()), h("div", { class: "details__general-info-content" }, h("h1", { class: "details__general-info-title" }, (_j = (_h = this.challenge) === null || _h === void 0 ? void 0 : _h.ChallengePresentation) === null || _j === void 0 ? void 0 : _j.PresentationName), h("h3", { class: "details__general-info-end-date_label" }, translate('endDate', this.language), " -", ' ', h("span", { class: "details__general-info-end-date_value" }, this.challenge ? formatDate((_k = this.challenge) === null || _k === void 0 ? void 0 : _k.ExpirationTime) : '-')), h("casino-challenge-progress-bar", { challenge: this.challenge, isUserAuthorized: this.isUserAuthorized, language: this.language }), showButton && (h("button", { class: {
|
|
1903
1933
|
'details__general-info-action-button': true,
|
|
1904
|
-
filled: ((
|
|
1905
|
-
grayed: ((
|
|
1906
|
-
((
|
|
1907
|
-
((
|
|
1908
|
-
}, disabled: this.actionLoading, onClick: this.joinUnjoinProgress }, translate(this.actionButtonText, this.language)))));
|
|
1934
|
+
filled: ((_l = this.challenge) === null || _l === void 0 ? void 0 : _l.Status) === EChallengeProgressStatus.Started,
|
|
1935
|
+
grayed: ((_m = this.challenge) === null || _m === void 0 ? void 0 : _m.Status) === EChallengeProgressStatus.Paused ||
|
|
1936
|
+
((_o = this.challenge) === null || _o === void 0 ? void 0 : _o.Status) === EChallengeProgressStatus.InProgress ||
|
|
1937
|
+
((_p = this.challenge) === null || _p === void 0 ? void 0 : _p.Status) === EChallengeProgressStatus.PendingLevelReward
|
|
1938
|
+
}, disabled: this.actionLoading, onClick: this.joinUnjoinProgress }, translate(this.actionButtonText, this.language))))));
|
|
1909
1939
|
}
|
|
1910
1940
|
get challengeTabs() {
|
|
1911
1941
|
return (h("div", { class: "details__tabs" }, this.tabs.map((label, index) => (h("div", { class: {
|
|
@@ -1917,7 +1947,7 @@ const CasinoChallengeDetails = class {
|
|
|
1917
1947
|
var _a, _b;
|
|
1918
1948
|
return (h("div", { class: "levels__tab", ref: (el) => (this.scrollContainerRef = el) }, (_b = (_a = this.challenge) === null || _a === void 0 ? void 0 : _a.LevelProgresses) === null || _b === void 0 ? void 0 : _b.map((level, index) => {
|
|
1919
1949
|
var _a;
|
|
1920
|
-
const activeChallenge = [0, 1, 2, 3].includes((_a = this === null || this === void 0 ? void 0 : this.challenge) === null || _a === void 0 ? void 0 : _a.Status);
|
|
1950
|
+
const activeChallenge = [0, 1, 2, 3].includes((_a = this === null || this === void 0 ? void 0 : this.challenge) === null || _a === void 0 ? void 0 : _a.Status) && !this.isChallengePaused;
|
|
1921
1951
|
const isGrayed = (this.isUserAuthorized && level.ProgressStatus !== EChallengeProgressLevelStatus.InProgress) ||
|
|
1922
1952
|
!activeChallenge;
|
|
1923
1953
|
const isActiveMatch = level.ProgressStatus === EChallengeProgressLevelStatus.InProgress;
|
|
@@ -1983,17 +2013,6 @@ const CasinoChallengeDetails = class {
|
|
|
1983
2013
|
const contributionRule = this.getContributionRule((_b = this.challenge) === null || _b === void 0 ? void 0 : _b.IsContributeToOne);
|
|
1984
2014
|
return (h("div", { class: "rules__tab" }, ((_d = (_c = this.challenge) === null || _c === void 0 ? void 0 : _c.ChallengePresentation) === null || _d === void 0 ? void 0 : _d.Description) && (h("div", { class: "rule" }, (_f = (_e = this.challenge) === null || _e === void 0 ? void 0 : _e.ChallengePresentation) === null || _f === void 0 ? void 0 : _f.Description)), contributionType && (h("div", { class: "contributionType" }, h("span", { class: "contribution__label contribution__type__label" }, '\u{1F4B0}', " ", translate('contributionType', this.language), ":"), h("span", { class: "contribution__value" }, contributionType))), contributionRule && (h("div", { class: "contributionRule" }, h("span", { class: "contribution__label" }, '\u{1F4C4}', " ", translate('contributionRule', this.language), ":"))), contributionRule && h("span", { class: "contribution__value contribution__rule__value" }, contributionRule), ((_h = (_g = this.challenge) === null || _g === void 0 ? void 0 : _g.ChallengePresentation) === null || _h === void 0 ? void 0 : _h.Url) && (h("a", { class: "link", href: (_k = (_j = this.challenge) === null || _j === void 0 ? void 0 : _j.ChallengePresentation) === null || _k === void 0 ? void 0 : _k.Url, target: "_blank" }, translate('terms', this.language)))));
|
|
1985
2015
|
}
|
|
1986
|
-
get footer() {
|
|
1987
|
-
var _a, _b, _c, _d;
|
|
1988
|
-
return (h("div", { class: "button__container" }, h("button", { class: {
|
|
1989
|
-
'footer-action-button': true,
|
|
1990
|
-
filled: ((_a = this.challenge) === null || _a === void 0 ? void 0 : _a.Status) === EChallengeProgressStatus.Started || !this.isUserAuthorized,
|
|
1991
|
-
grayed: this.isUserAuthorized &&
|
|
1992
|
-
(((_b = this.challenge) === null || _b === void 0 ? void 0 : _b.Status) === EChallengeProgressStatus.Paused ||
|
|
1993
|
-
((_c = this.challenge) === null || _c === void 0 ? void 0 : _c.Status) === EChallengeProgressStatus.InProgress ||
|
|
1994
|
-
((_d = this.challenge) === null || _d === void 0 ? void 0 : _d.Status) === EChallengeProgressStatus.PendingLevelReward)
|
|
1995
|
-
}, onClick: this.joinUnjoinProgress, disabled: this.actionLoading }, translate(this.actionButtonText, this.language))));
|
|
1996
|
-
}
|
|
1997
2016
|
get forfeitedNofitication() {
|
|
1998
2017
|
var _a;
|
|
1999
2018
|
return (((_a = this.challenge) === null || _a === void 0 ? void 0 : _a.Status) === 5 && (h("div", { class: "notification" }, h("img", { class: "notification__icon", src: alertSvg }), h("span", { class: "notification__message" }, translate('forfeitNotification', this.language)))));
|
|
@@ -2007,7 +2026,7 @@ const CasinoChallengeDetails = class {
|
|
|
2007
2026
|
return (((_a = this.challenge) === null || _a === void 0 ? void 0 : _a.Status) === 4 && (h("div", { class: "notification" }, h("img", { class: "notification__icon", src: infoCircleSvg }), h("span", { class: "notification__message" }, translate('expiredNotification', this.language)))));
|
|
2008
2027
|
}
|
|
2009
2028
|
render() {
|
|
2010
|
-
return (h("div", { key: '
|
|
2029
|
+
return (h("div", { key: '3b40178d61dd13dbbfbc90958d0c8a60da819da9', ref: (el) => (this.stylingContainer = el), class: "container" }, this.pageHeader, this.loading ? (h("div", { class: "lds-dual-ring" })) : (h("div", null, h("button", { class: "back-button", onClick: this.goBack }, h("img", { class: "back-button__icon", src: backArrowSvg }), this.getBackButtonText()), this.forfeitedNofitication, this.completedNotification, this.expiredNotification, h("div", { class: "details" }, this.cardGeneralInfo, h("div", { class: "details__tabs-container" }, this.challengeTabs, this.activeTabIndex === 0 && this.levelsTab, this.activeTabIndex === 1 && this.gamesTab, this.activeTabIndex === 2 && this.rulesTab), this.footer())))));
|
|
2011
2030
|
}
|
|
2012
2031
|
static get watchers() { return {
|
|
2013
2032
|
"clientStyling": ["handleClientStylingChange"],
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as EChallengeProgressLevelStatus, a as EChallengeStatus, b as EChallengeProgressStatus, t as translate } from './casino-challenge-details-
|
|
2
|
-
export { C as casino_challenge_details } from './casino-challenge-details-
|
|
1
|
+
import { E as EChallengeProgressLevelStatus, a as EChallengeStatus, b as EChallengeProgressStatus, t as translate } from './casino-challenge-details-9f39552b.js';
|
|
2
|
+
export { C as casino_challenge_details } from './casino-challenge-details-9f39552b.js';
|
|
3
3
|
import { r as registerInstance, h, g as getElement, H as Host } from './index-30adf0cb.js';
|
|
4
4
|
|
|
5
5
|
const activeChevronSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iOCIgdmlld0JveD0iMCAwIDEyIDgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMC40MTA4MjYgMC45MTEwN0MwLjczNjI2MyAwLjU4NTYzMyAxLjI2MzkgMC41ODU2MzMgMS41ODkzNCAwLjkxMTA3TDYuMDAwMDggNS4zMjE4MUwxMC40MTA4IDAuOTExMDdDMTAuNzM2MyAwLjU4NTYzMyAxMS4yNjM5IDAuNTg1NjMzIDExLjU4OTMgMC45MTEwN0MxMS45MTQ4IDEuMjM2NTEgMTEuOTE0OCAxLjc2NDE0IDExLjU4OTMgMi4wODk1OEw2LjU4OTM0IDcuMDg5NThDNi4yNjM5IDcuNDE1MDIgNS43MzYyNiA3LjQxNTAyIDUuNDEwODMgNy4wODk1OEwwLjQxMDgyNiAyLjA4OTU4QzAuMDg1Mzg4OCAxLjc2NDE0IDAuMDg1Mzg4OCAxLjIzNjUxIDAuNDEwODI2IDAuOTExMDdaIiBmaWxsPSIjMDBCNzRGIi8+Cjwvc3ZnPgo=';
|
package/dist/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { C as CasinoChallengeDetails } from './casino-challenge-details-
|
|
1
|
+
export { C as CasinoChallengeDetails } from './casino-challenge-details-9f39552b.js';
|
|
2
2
|
import './index-30adf0cb.js';
|
|
@@ -99,11 +99,11 @@ export declare class CasinoChallengeDetails {
|
|
|
99
99
|
private calculateTargetValue;
|
|
100
100
|
private updateTime;
|
|
101
101
|
private getBadgeContent;
|
|
102
|
-
private
|
|
102
|
+
private getCardBadge;
|
|
103
103
|
private get actionButtonText();
|
|
104
104
|
checkAttrs: () => boolean;
|
|
105
105
|
openLoginRegisterModal(): void;
|
|
106
|
-
joinUnjoinProgress: () => Promise<
|
|
106
|
+
joinUnjoinProgress: () => Promise<void>;
|
|
107
107
|
private currentFetchGamesId;
|
|
108
108
|
fetchGames(): Promise<void>;
|
|
109
109
|
private handleTabClick;
|
|
@@ -119,7 +119,7 @@ export declare class CasinoChallengeDetails {
|
|
|
119
119
|
private getContributionRule;
|
|
120
120
|
private getContributionType;
|
|
121
121
|
private get rulesTab();
|
|
122
|
-
private
|
|
122
|
+
private footer;
|
|
123
123
|
private get forfeitedNofitication();
|
|
124
124
|
private get completedNotification();
|
|
125
125
|
private get expiredNotification();
|