@everymatrix/casino-challenges-container 0.17.74 → 0.17.76
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.
|
@@ -514,10 +514,14 @@ const CasinoChallengeCard = class {
|
|
|
514
514
|
.then((res) => {
|
|
515
515
|
if (res.Success) {
|
|
516
516
|
window.postMessage({ type: 'GoToChallengesPage', tabIndex: EChallengesTabs.Active }, window.location.href);
|
|
517
|
-
this.openNotification.emit({
|
|
517
|
+
this.openNotification.emit({
|
|
518
|
+
message: translate$3('grantClaimByButtonSuccessMessage', this.language),
|
|
519
|
+
errored: false,
|
|
520
|
+
tab: EChallengesTabs.Active
|
|
521
|
+
});
|
|
518
522
|
}
|
|
519
523
|
else {
|
|
520
|
-
this.openNotification.emit({ message: res.ErrorMessage, errored: true
|
|
524
|
+
this.openNotification.emit({ message: res.ErrorMessage, errored: true });
|
|
521
525
|
}
|
|
522
526
|
return res;
|
|
523
527
|
})
|
|
@@ -528,44 +532,45 @@ const CasinoChallengeCard = class {
|
|
|
528
532
|
}
|
|
529
533
|
get getCardButton() {
|
|
530
534
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
531
|
-
if (this.
|
|
532
|
-
this.
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
}
|
|
559
|
-
else if (this.isUserAuthorized && !this.isChallengePaused) {
|
|
560
|
-
if (this.challenge.Status === EChallengeProgressStatus.Started) {
|
|
561
|
-
return (index.h("button", { class: "card__button filled", disabled: this.actionLoading, onClick: (e) => (e.stopPropagation(), this.joinUnjoinProgress(true)) }, translate$3('optIn', this.language)));
|
|
562
|
-
}
|
|
563
|
-
if (this.challenge.Status === EChallengeProgressStatus.Paused) {
|
|
564
|
-
return (index.h("button", { class: "card__button grayed", disabled: this.actionLoading, onClick: (e) => (e.stopPropagation(), this.joinUnjoinProgress(true)) }, translate$3('resume', this.language)));
|
|
535
|
+
if (!this.isChallengePaused && this.challenge.Status !== EChallengeProgressStatus.Expired) {
|
|
536
|
+
if (this.activeChallengesTabIndex === EChallengesTabs.Promo) {
|
|
537
|
+
const isDepositTriggerType = (((_b = (_a = this.challenge) === null || _a === void 0 ? void 0 : _a.Triggers) === null || _b === void 0 ? void 0 : _b.includes(EChallengeTriggerType.Deposit)) &&
|
|
538
|
+
((_d = (_c = this.challenge) === null || _c === void 0 ? void 0 : _c.Triggers) === null || _d === void 0 ? void 0 : _d.includes(EChallengeTriggerType.GameLaunch))) ||
|
|
539
|
+
((_f = (_e = this.challenge) === null || _e === void 0 ? void 0 : _e.Triggers) === null || _f === void 0 ? void 0 : _f.includes(EChallengeTriggerType.Deposit));
|
|
540
|
+
const isClaimByButtonTriggerType = !isDepositTriggerType && ((_h = (_g = this.challenge) === null || _g === void 0 ? void 0 : _g.Triggers) === null || _h === void 0 ? void 0 : _h.includes(EChallengeTriggerType.ClaimByButton));
|
|
541
|
+
const isGameLaunchTriggerType = !isDepositTriggerType &&
|
|
542
|
+
!isClaimByButtonTriggerType &&
|
|
543
|
+
((_k = (_j = this.challenge) === null || _j === void 0 ? void 0 : _j.Triggers) === null || _k === void 0 ? void 0 : _k.includes(EChallengeTriggerType.GameLaunch));
|
|
544
|
+
if (isDepositTriggerType) {
|
|
545
|
+
return (index.h("button", { class: "card__button filled", disabled: this.actionLoading, onClick: (e) => {
|
|
546
|
+
e.stopPropagation();
|
|
547
|
+
this.goToDepositPage();
|
|
548
|
+
} }, translate$3('deposit', this.language)));
|
|
549
|
+
}
|
|
550
|
+
else if (isClaimByButtonTriggerType) {
|
|
551
|
+
return (index.h("button", { class: "card__button filled", disabled: this.actionLoading, onClick: (e) => {
|
|
552
|
+
e.stopPropagation();
|
|
553
|
+
this.grantClaimByButton();
|
|
554
|
+
} }, translate$3('claim', this.language)));
|
|
555
|
+
}
|
|
556
|
+
else if (isGameLaunchTriggerType) {
|
|
557
|
+
return (index.h("button", { class: "card__button filled", disabled: this.actionLoading, onClick: (e) => {
|
|
558
|
+
e.stopPropagation();
|
|
559
|
+
this.goToDetailsPage(false, EDetailsTabs.GamesOrEvents)();
|
|
560
|
+
} }, translate$3('launchGame', this.language)));
|
|
561
|
+
}
|
|
565
562
|
}
|
|
566
|
-
if (this.
|
|
567
|
-
this.challenge.Status === EChallengeProgressStatus.
|
|
568
|
-
|
|
563
|
+
else if (this.isUserAuthorized && !this.isChallengePaused) {
|
|
564
|
+
if (this.challenge.Status === EChallengeProgressStatus.Started) {
|
|
565
|
+
return (index.h("button", { class: "card__button filled", disabled: this.actionLoading, onClick: (e) => (e.stopPropagation(), this.joinUnjoinProgress(true)) }, translate$3('optIn', this.language)));
|
|
566
|
+
}
|
|
567
|
+
if (this.challenge.Status === EChallengeProgressStatus.Paused) {
|
|
568
|
+
return (index.h("button", { class: "card__button grayed", disabled: this.actionLoading, onClick: (e) => (e.stopPropagation(), this.joinUnjoinProgress(true)) }, translate$3('resume', this.language)));
|
|
569
|
+
}
|
|
570
|
+
if (this.challenge.Status === EChallengeProgressStatus.InProgress ||
|
|
571
|
+
this.challenge.Status === EChallengeProgressStatus.PendingLevelReward) {
|
|
572
|
+
return (index.h("button", { class: "card__button grayed", disabled: this.actionLoading, onClick: (e) => (e.stopPropagation(), this.joinUnjoinProgress(false)) }, translate$3('pause', this.language)));
|
|
573
|
+
}
|
|
569
574
|
}
|
|
570
575
|
}
|
|
571
576
|
return index.h("button", { class: "card__button" }, translate$3('viewDetails', this.language));
|
|
@@ -615,10 +620,10 @@ const CasinoChallengeCard = class {
|
|
|
615
620
|
}
|
|
616
621
|
render() {
|
|
617
622
|
var _a, _b, _c, _d;
|
|
618
|
-
return (index.h("div", { key: '
|
|
623
|
+
return (index.h("div", { key: 'c073e12394b0deeb498ca524a37fa57e0ba0775f', ref: (el) => (this.stylingContainer = el), style: { height: '100%' } }, index.h("div", { key: 'ffedf90383bf6e3b267a6a4b95f90023da6e4b29', class: "card", onClick: this.goToDetailsPage(true, EDetailsTabs.Rules) }, index.h("img", { key: 'f7ee4488c3569a2310fdd164c32ef7956fb187c6', class: {
|
|
619
624
|
card__image: true,
|
|
620
625
|
grayed: !!this.isChallengeGrayed || this.challenge.Status === EChallengeProgressStatus.Awaiting
|
|
621
|
-
}, src: (_b = (_a = this.challenge) === null || _a === void 0 ? void 0 : _a.ChallengePresentation) === null || _b === void 0 ? void 0 : _b.BannerUrl }), this.getCardBadge, this.challenge.IsNew && this.renderNewLabel(), index.h("div", { key: '
|
|
626
|
+
}, src: (_b = (_a = this.challenge) === null || _a === void 0 ? void 0 : _a.ChallengePresentation) === null || _b === void 0 ? void 0 : _b.BannerUrl }), this.getCardBadge, this.challenge.IsNew && this.renderNewLabel(), index.h("div", { key: 'bf576d8afb45d31c33695da69608462ca84b824b', class: "card__content" }, index.h("h1", { key: 'a2371c8586c1bd9986991ef1d487ed7967ec4749', class: "card__title" }, (_d = (_c = this.challenge) === null || _c === void 0 ? void 0 : _c.ChallengePresentation) === null || _d === void 0 ? void 0 :
|
|
622
627
|
_d.PresentationName, this.renderCardIcon()), this.getChallengeProgress, this.additionalInfo, this.infoItems.map((x, index) => this.renderInfoItem(x, index)), this.getTermsAndConditions()), this.getCardButton)));
|
|
623
628
|
}
|
|
624
629
|
static get watchers() { return {
|
|
@@ -511,10 +511,14 @@ const CasinoChallengeCard = class {
|
|
|
511
511
|
.then((res) => {
|
|
512
512
|
if (res.Success) {
|
|
513
513
|
window.postMessage({ type: 'GoToChallengesPage', tabIndex: EChallengesTabs.Active }, window.location.href);
|
|
514
|
-
this.openNotification.emit({
|
|
514
|
+
this.openNotification.emit({
|
|
515
|
+
message: translate$3('grantClaimByButtonSuccessMessage', this.language),
|
|
516
|
+
errored: false,
|
|
517
|
+
tab: EChallengesTabs.Active
|
|
518
|
+
});
|
|
515
519
|
}
|
|
516
520
|
else {
|
|
517
|
-
this.openNotification.emit({ message: res.ErrorMessage, errored: true
|
|
521
|
+
this.openNotification.emit({ message: res.ErrorMessage, errored: true });
|
|
518
522
|
}
|
|
519
523
|
return res;
|
|
520
524
|
})
|
|
@@ -525,44 +529,45 @@ const CasinoChallengeCard = class {
|
|
|
525
529
|
}
|
|
526
530
|
get getCardButton() {
|
|
527
531
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
528
|
-
if (this.
|
|
529
|
-
this.
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
}
|
|
556
|
-
else if (this.isUserAuthorized && !this.isChallengePaused) {
|
|
557
|
-
if (this.challenge.Status === EChallengeProgressStatus.Started) {
|
|
558
|
-
return (h("button", { class: "card__button filled", disabled: this.actionLoading, onClick: (e) => (e.stopPropagation(), this.joinUnjoinProgress(true)) }, translate$3('optIn', this.language)));
|
|
559
|
-
}
|
|
560
|
-
if (this.challenge.Status === EChallengeProgressStatus.Paused) {
|
|
561
|
-
return (h("button", { class: "card__button grayed", disabled: this.actionLoading, onClick: (e) => (e.stopPropagation(), this.joinUnjoinProgress(true)) }, translate$3('resume', this.language)));
|
|
532
|
+
if (!this.isChallengePaused && this.challenge.Status !== EChallengeProgressStatus.Expired) {
|
|
533
|
+
if (this.activeChallengesTabIndex === EChallengesTabs.Promo) {
|
|
534
|
+
const isDepositTriggerType = (((_b = (_a = this.challenge) === null || _a === void 0 ? void 0 : _a.Triggers) === null || _b === void 0 ? void 0 : _b.includes(EChallengeTriggerType.Deposit)) &&
|
|
535
|
+
((_d = (_c = this.challenge) === null || _c === void 0 ? void 0 : _c.Triggers) === null || _d === void 0 ? void 0 : _d.includes(EChallengeTriggerType.GameLaunch))) ||
|
|
536
|
+
((_f = (_e = this.challenge) === null || _e === void 0 ? void 0 : _e.Triggers) === null || _f === void 0 ? void 0 : _f.includes(EChallengeTriggerType.Deposit));
|
|
537
|
+
const isClaimByButtonTriggerType = !isDepositTriggerType && ((_h = (_g = this.challenge) === null || _g === void 0 ? void 0 : _g.Triggers) === null || _h === void 0 ? void 0 : _h.includes(EChallengeTriggerType.ClaimByButton));
|
|
538
|
+
const isGameLaunchTriggerType = !isDepositTriggerType &&
|
|
539
|
+
!isClaimByButtonTriggerType &&
|
|
540
|
+
((_k = (_j = this.challenge) === null || _j === void 0 ? void 0 : _j.Triggers) === null || _k === void 0 ? void 0 : _k.includes(EChallengeTriggerType.GameLaunch));
|
|
541
|
+
if (isDepositTriggerType) {
|
|
542
|
+
return (h("button", { class: "card__button filled", disabled: this.actionLoading, onClick: (e) => {
|
|
543
|
+
e.stopPropagation();
|
|
544
|
+
this.goToDepositPage();
|
|
545
|
+
} }, translate$3('deposit', this.language)));
|
|
546
|
+
}
|
|
547
|
+
else if (isClaimByButtonTriggerType) {
|
|
548
|
+
return (h("button", { class: "card__button filled", disabled: this.actionLoading, onClick: (e) => {
|
|
549
|
+
e.stopPropagation();
|
|
550
|
+
this.grantClaimByButton();
|
|
551
|
+
} }, translate$3('claim', this.language)));
|
|
552
|
+
}
|
|
553
|
+
else if (isGameLaunchTriggerType) {
|
|
554
|
+
return (h("button", { class: "card__button filled", disabled: this.actionLoading, onClick: (e) => {
|
|
555
|
+
e.stopPropagation();
|
|
556
|
+
this.goToDetailsPage(false, EDetailsTabs.GamesOrEvents)();
|
|
557
|
+
} }, translate$3('launchGame', this.language)));
|
|
558
|
+
}
|
|
562
559
|
}
|
|
563
|
-
if (this.
|
|
564
|
-
this.challenge.Status === EChallengeProgressStatus.
|
|
565
|
-
|
|
560
|
+
else if (this.isUserAuthorized && !this.isChallengePaused) {
|
|
561
|
+
if (this.challenge.Status === EChallengeProgressStatus.Started) {
|
|
562
|
+
return (h("button", { class: "card__button filled", disabled: this.actionLoading, onClick: (e) => (e.stopPropagation(), this.joinUnjoinProgress(true)) }, translate$3('optIn', this.language)));
|
|
563
|
+
}
|
|
564
|
+
if (this.challenge.Status === EChallengeProgressStatus.Paused) {
|
|
565
|
+
return (h("button", { class: "card__button grayed", disabled: this.actionLoading, onClick: (e) => (e.stopPropagation(), this.joinUnjoinProgress(true)) }, translate$3('resume', this.language)));
|
|
566
|
+
}
|
|
567
|
+
if (this.challenge.Status === EChallengeProgressStatus.InProgress ||
|
|
568
|
+
this.challenge.Status === EChallengeProgressStatus.PendingLevelReward) {
|
|
569
|
+
return (h("button", { class: "card__button grayed", disabled: this.actionLoading, onClick: (e) => (e.stopPropagation(), this.joinUnjoinProgress(false)) }, translate$3('pause', this.language)));
|
|
570
|
+
}
|
|
566
571
|
}
|
|
567
572
|
}
|
|
568
573
|
return h("button", { class: "card__button" }, translate$3('viewDetails', this.language));
|
|
@@ -612,10 +617,10 @@ const CasinoChallengeCard = class {
|
|
|
612
617
|
}
|
|
613
618
|
render() {
|
|
614
619
|
var _a, _b, _c, _d;
|
|
615
|
-
return (h("div", { key: '
|
|
620
|
+
return (h("div", { key: 'c073e12394b0deeb498ca524a37fa57e0ba0775f', ref: (el) => (this.stylingContainer = el), style: { height: '100%' } }, h("div", { key: 'ffedf90383bf6e3b267a6a4b95f90023da6e4b29', class: "card", onClick: this.goToDetailsPage(true, EDetailsTabs.Rules) }, h("img", { key: 'f7ee4488c3569a2310fdd164c32ef7956fb187c6', class: {
|
|
616
621
|
card__image: true,
|
|
617
622
|
grayed: !!this.isChallengeGrayed || this.challenge.Status === EChallengeProgressStatus.Awaiting
|
|
618
|
-
}, src: (_b = (_a = this.challenge) === null || _a === void 0 ? void 0 : _a.ChallengePresentation) === null || _b === void 0 ? void 0 : _b.BannerUrl }), this.getCardBadge, this.challenge.IsNew && this.renderNewLabel(), h("div", { key: '
|
|
623
|
+
}, src: (_b = (_a = this.challenge) === null || _a === void 0 ? void 0 : _a.ChallengePresentation) === null || _b === void 0 ? void 0 : _b.BannerUrl }), this.getCardBadge, this.challenge.IsNew && this.renderNewLabel(), h("div", { key: 'bf576d8afb45d31c33695da69608462ca84b824b', class: "card__content" }, h("h1", { key: 'a2371c8586c1bd9986991ef1d487ed7967ec4749', class: "card__title" }, (_d = (_c = this.challenge) === null || _c === void 0 ? void 0 : _c.ChallengePresentation) === null || _d === void 0 ? void 0 :
|
|
619
624
|
_d.PresentationName, this.renderCardIcon()), this.getChallengeProgress, this.additionalInfo, this.infoItems.map((x, index) => this.renderInfoItem(x, index)), this.getTermsAndConditions()), this.getCardButton)));
|
|
620
625
|
}
|
|
621
626
|
static get watchers() { return {
|