@everymatrix/casino-challenges-overlay-drawer 0.0.1
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-challenges-overlay-drawer/app-globals-0f993ce5.js +1 -0
- package/dist/casino-challenges-overlay-drawer/casino-challenge-details-events_21.entry.js +1 -0
- package/dist/casino-challenges-overlay-drawer/casino-challenges-overlay-drawer-b6d3a238.js +1 -0
- package/dist/casino-challenges-overlay-drawer/casino-challenges-overlay-drawer.esm.js +1 -0
- package/dist/casino-challenges-overlay-drawer/index-25fd45d2.js +2 -0
- package/dist/casino-challenges-overlay-drawer/index.esm.js +1 -0
- package/dist/cjs/app-globals-3a1e7e63.js +5 -0
- package/dist/cjs/casino-challenge-details-events_21.cjs.entry.js +4459 -0
- package/dist/cjs/casino-challenges-overlay-drawer-ee68086b.js +1002 -0
- package/dist/cjs/casino-challenges-overlay-drawer.cjs.js +25 -0
- package/dist/cjs/index-d2288c94.js +1592 -0
- package/dist/cjs/index.cjs.js +10 -0
- package/dist/cjs/loader.cjs.js +15 -0
- package/dist/collection/assets/arrow-down.svg +3 -0
- package/dist/collection/assets/arrow-up.svg +3 -0
- package/dist/collection/assets/check.svg +3 -0
- package/dist/collection/assets/chevron-up.svg +3 -0
- package/dist/collection/assets/chevron.svg +4 -0
- package/dist/collection/assets/cross.svg +4 -0
- package/dist/collection/assets/crown.svg +12 -0
- package/dist/collection/assets/error.svg +3 -0
- package/dist/collection/assets/gift.svg +24 -0
- package/dist/collection/assets/link.svg +3 -0
- package/dist/collection/assets/lock.svg +3 -0
- package/dist/collection/assets/notification.svg +20 -0
- package/dist/collection/assets/opt-out.svg +3 -0
- package/dist/collection/assets/revert-icon.svg +4 -0
- package/dist/collection/assets/reward-gift.svg +123 -0
- package/dist/collection/assets/slot.svg +59 -0
- package/dist/collection/assets/sport.svg +34 -0
- package/dist/collection/assets/swipe.svg +3 -0
- package/dist/collection/assets/target.svg +16 -0
- package/dist/collection/assets/term-and-condition.svg +3 -0
- package/dist/collection/collection-manifest.json +48 -0
- package/dist/collection/components/casino-challenges-overlay-drawer/casino-challenges-overlay-drawer.css +260 -0
- package/dist/collection/components/casino-challenges-overlay-drawer/casino-challenges-overlay-drawer.js +793 -0
- package/dist/collection/components/casino-challenges-overlay-drawer/index.js +1 -0
- package/dist/collection/components/components/casino-challenge-opt-out-modal/casino-challenge-opt-out-modal.css +141 -0
- package/dist/collection/components/components/casino-challenge-opt-out-modal/casino-challenge-opt-out-modal.js +124 -0
- package/dist/collection/components/components/casino-challenge-overlay-background/casino-challenge-overlay-background.css +89 -0
- package/dist/collection/components/components/casino-challenge-overlay-background/casino-challenge-overlay-background.js +44 -0
- package/dist/collection/components/components/casino-challenges-claim-code/casino-challenges-claim-code.css +143 -0
- package/dist/collection/components/components/casino-challenges-claim-code/casino-challenges-claim-code.js +260 -0
- package/dist/collection/components/components/casino-challenges-empty-state/casino-challenges-empty-state.css +35 -0
- package/dist/collection/components/components/casino-challenges-empty-state/casino-challenges-empty-state.js +80 -0
- package/dist/collection/components/components/casino-challenges-overlay-drawer-history/casino-challenges-overlay-drawer-history.css +37 -0
- package/dist/collection/components/components/casino-challenges-overlay-drawer-history/casino-challenges-overlay-drawer-history.js +335 -0
- package/dist/collection/components/components/casino-challenges-overlay-drawer-history/components/casino-challenge-drawer-history-item/casino-challenge-drawer-history-item.css +170 -0
- package/dist/collection/components/components/casino-challenges-overlay-drawer-history/components/casino-challenge-drawer-history-item/casino-challenge-drawer-history-item.js +173 -0
- package/dist/collection/components/components/casino-challenges-overlay-loader/casino-challenges-overlay-loader.css +83 -0
- package/dist/collection/components/components/casino-challenges-overlay-loader/casino-challenges-overlay-loader.js +63 -0
- package/dist/collection/components/components/casino-challenges-overlay-tabs/casino-challenges-overlay-tabs.css +116 -0
- package/dist/collection/components/components/casino-challenges-overlay-tabs/casino-challenges-overlay-tabs.js +171 -0
- package/dist/collection/components/components/swipe-up/swipe-up.css +61 -0
- package/dist/collection/components/components/swipe-up/swipe-up.js +155 -0
- package/dist/collection/consts.js +3829 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/utils/general-info-utils.js +105 -0
- package/dist/collection/utils/levels-utils.js +55 -0
- package/dist/collection/utils/locale.utils.js +146 -0
- package/dist/collection/utils/types.js +160 -0
- package/dist/collection/utils/utils.js +54 -0
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/casino-challenge-details-events_21.entry.js +4436 -0
- package/dist/esm/casino-challenges-overlay-drawer-b6d3a238.js +994 -0
- package/dist/esm/casino-challenges-overlay-drawer.js +20 -0
- package/dist/esm/index-25fd45d2.js +1563 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/loader.js +11 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/stencil.config.dev.js +19 -0
- package/dist/stencil.config.js +19 -0
- package/dist/storybook/main.js +43 -0
- package/dist/storybook/preview.js +9 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenges-overlay-drawer/.stencil/libs/common/src/storybook/storybook-utils.d.ts +39 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenges-overlay-drawer/.stencil/packages/stencil/casino-challenges-overlay-drawer/stencil.config.d.ts +2 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenges-overlay-drawer/.stencil/packages/stencil/casino-challenges-overlay-drawer/stencil.config.dev.d.ts +2 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenges-overlay-drawer/.stencil/packages/stencil/casino-challenges-overlay-drawer/storybook/main.d.ts +3 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenges-overlay-drawer/.stencil/packages/stencil/casino-challenges-overlay-drawer/storybook/preview.d.ts +70 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenges-overlay-drawer/.stencil/tools/plugins/index.d.ts +4 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenges-overlay-drawer/.stencil/tools/plugins/lazy-load-chunk-plugin.d.ts +12 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenges-overlay-drawer/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +5 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenges-overlay-drawer/.stencil/tools/plugins/vite-chunk-plugin.d.ts +6 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/casino-challenges-overlay-drawer/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +4 -0
- package/dist/types/components/casino-challenges-overlay-drawer/casino-challenges-overlay-drawer.d.ts +77 -0
- package/dist/types/components/casino-challenges-overlay-drawer/index.d.ts +1 -0
- package/dist/types/components/components/casino-challenge-opt-out-modal/casino-challenge-opt-out-modal.d.ts +12 -0
- package/dist/types/components/components/casino-challenge-overlay-background/casino-challenge-overlay-background.d.ts +6 -0
- package/dist/types/components/components/casino-challenges-claim-code/casino-challenges-claim-code.d.ts +49 -0
- package/dist/types/components/components/casino-challenges-empty-state/casino-challenges-empty-state.d.ts +6 -0
- package/dist/types/components/components/casino-challenges-overlay-drawer-history/casino-challenges-overlay-drawer-history.d.ts +33 -0
- package/dist/types/components/components/casino-challenges-overlay-drawer-history/components/casino-challenge-drawer-history-item/casino-challenge-drawer-history-item.d.ts +12 -0
- package/dist/types/components/components/casino-challenges-overlay-loader/casino-challenges-overlay-loader.d.ts +5 -0
- package/dist/types/components/components/casino-challenges-overlay-tabs/casino-challenges-overlay-tabs.d.ts +16 -0
- package/dist/types/components/components/swipe-up/swipe-up.d.ts +20 -0
- package/dist/types/components.d.ts +362 -0
- package/dist/types/consts.d.ts +585 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +1674 -0
- package/dist/types/utils/general-info-utils.d.ts +10 -0
- package/dist/types/utils/levels-utils.d.ts +5 -0
- package/dist/types/utils/locale.utils.d.ts +12 -0
- package/dist/types/utils/types.d.ts +327 -0
- package/dist/types/utils/utils.d.ts +7 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/loader/package.json +11 -0
- package/package.json +27 -0
|
@@ -0,0 +1,1002 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const index = require('./index-d2288c94.js');
|
|
4
|
+
|
|
5
|
+
const StyleCacheKey = '__WIDGET_GLOBAL_STYLE_CACHE__';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @name setClientStyling
|
|
9
|
+
* @description Method used to create and append to the passed element of the widget a style element with the content received
|
|
10
|
+
* @param {HTMLElement} stylingContainer The reference element of the widget
|
|
11
|
+
* @param {string} clientStyling The style content
|
|
12
|
+
*/
|
|
13
|
+
function setClientStyling(stylingContainer, clientStyling) {
|
|
14
|
+
if (stylingContainer) {
|
|
15
|
+
const sheet = document.createElement('style');
|
|
16
|
+
sheet.innerHTML = clientStyling;
|
|
17
|
+
stylingContainer.appendChild(sheet);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @name setClientStylingURL
|
|
23
|
+
* @description Method used to create and append to the passed element of the widget a style element with the content fetched from a given URL
|
|
24
|
+
* @param {HTMLElement} stylingContainer The reference element of the widget
|
|
25
|
+
* @param {string} clientStylingUrl The URL of the style content
|
|
26
|
+
*/
|
|
27
|
+
function setClientStylingURL(stylingContainer, clientStylingUrl) {
|
|
28
|
+
if (!stylingContainer || !clientStylingUrl) return;
|
|
29
|
+
|
|
30
|
+
const url = new URL(clientStylingUrl);
|
|
31
|
+
|
|
32
|
+
fetch(url.href)
|
|
33
|
+
.then((res) => res.text())
|
|
34
|
+
.then((data) => {
|
|
35
|
+
const cssFile = document.createElement('style');
|
|
36
|
+
cssFile.innerHTML = data;
|
|
37
|
+
if (stylingContainer) {
|
|
38
|
+
stylingContainer.appendChild(cssFile);
|
|
39
|
+
}
|
|
40
|
+
})
|
|
41
|
+
.catch((err) => {
|
|
42
|
+
console.error('There was an error while trying to load client styling from URL', err);
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* @name setStreamLibrary
|
|
48
|
+
* @description Method used to create and append to the passed element of the widget a style element with content fetched from the MessageBus
|
|
49
|
+
* @param {HTMLElement} stylingContainer The highest element of the widget
|
|
50
|
+
* @param {string} domain The domain from where the content should be fetched (e.g. 'Casino.Style', 'App.Style', 'casino-footer.style', etc.)
|
|
51
|
+
* @param {ref} subscription A reference to a variable where the subscription should be saved for unsubscribing when no longer needed
|
|
52
|
+
* @param {boolean} useAdoptedStyleSheets A flag to gradually enable testing of adoptedStyleSheets
|
|
53
|
+
*/
|
|
54
|
+
function setStreamStyling(stylingContainer, domain, subscription, useAdoptedStyleSheets = false) {
|
|
55
|
+
if (!window.emMessageBus) return;
|
|
56
|
+
|
|
57
|
+
const supportAdoptStyle = 'adoptedStyleSheets' in Document.prototype;
|
|
58
|
+
|
|
59
|
+
if (!supportAdoptStyle || !useAdoptedStyleSheets) {
|
|
60
|
+
subscription = getStyleTagSubscription(stylingContainer, domain);
|
|
61
|
+
|
|
62
|
+
return subscription;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (!window[StyleCacheKey]) {
|
|
66
|
+
window[StyleCacheKey] = {};
|
|
67
|
+
}
|
|
68
|
+
subscription = getAdoptStyleSubscription(stylingContainer, domain);
|
|
69
|
+
|
|
70
|
+
const originalUnsubscribe = subscription.unsubscribe.bind(subscription);
|
|
71
|
+
const wrappedUnsubscribe = () => {
|
|
72
|
+
if (window[StyleCacheKey][domain]) {
|
|
73
|
+
const cachedObject = window[StyleCacheKey][domain];
|
|
74
|
+
cachedObject.refCount > 1
|
|
75
|
+
? (cachedObject.refCount = cachedObject.refCount - 1)
|
|
76
|
+
: delete window[StyleCacheKey][domain];
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
originalUnsubscribe();
|
|
80
|
+
};
|
|
81
|
+
subscription.unsubscribe = wrappedUnsubscribe;
|
|
82
|
+
|
|
83
|
+
return subscription;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function getStyleTagSubscription(stylingContainer, domain) {
|
|
87
|
+
const sheet = document.createElement('style');
|
|
88
|
+
|
|
89
|
+
return window.emMessageBus.subscribe(domain, (data) => {
|
|
90
|
+
if (stylingContainer) {
|
|
91
|
+
sheet.innerHTML = data;
|
|
92
|
+
stylingContainer.appendChild(sheet);
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function getAdoptStyleSubscription(stylingContainer, domain) {
|
|
98
|
+
return window.emMessageBus.subscribe(domain, (data) => {
|
|
99
|
+
if (!stylingContainer) return;
|
|
100
|
+
|
|
101
|
+
const shadowRoot = stylingContainer.getRootNode();
|
|
102
|
+
const cacheStyleObject = window[StyleCacheKey];
|
|
103
|
+
let cachedStyle = cacheStyleObject[domain] && cacheStyleObject[domain].sheet;
|
|
104
|
+
|
|
105
|
+
if (!cachedStyle) {
|
|
106
|
+
cachedStyle = new CSSStyleSheet();
|
|
107
|
+
cachedStyle.replaceSync(data);
|
|
108
|
+
cacheStyleObject[domain] = {
|
|
109
|
+
sheet: cachedStyle,
|
|
110
|
+
refCount: 1
|
|
111
|
+
};
|
|
112
|
+
} else {
|
|
113
|
+
cacheStyleObject[domain].refCount = cacheStyleObject[domain].refCount + 1;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
const currentSheets = shadowRoot.adoptedStyleSheets || [];
|
|
117
|
+
if (!currentSheets.includes(cachedStyle)) {
|
|
118
|
+
shadowRoot.adoptedStyleSheets = [...currentSheets, cachedStyle];
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
const isMobile = () => {
|
|
124
|
+
let userAgent = window.navigator.userAgent;
|
|
125
|
+
return !!(userAgent.toLowerCase().match(/android/i) ||
|
|
126
|
+
userAgent.toLowerCase().match(/blackberry|bb/i) ||
|
|
127
|
+
userAgent.toLowerCase().match(/iphone|ipad|ipod/i) ||
|
|
128
|
+
userAgent.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i));
|
|
129
|
+
};
|
|
130
|
+
const hasUpdateDataChanged = (prev, next) => {
|
|
131
|
+
if (!prev)
|
|
132
|
+
return true;
|
|
133
|
+
if (prev.ProgressId !== next.ProgressId)
|
|
134
|
+
return true;
|
|
135
|
+
if (prev.Levels.length !== next.Levels.length)
|
|
136
|
+
return true;
|
|
137
|
+
for (let i = 0; i < next.Levels.length; i++) {
|
|
138
|
+
const a = prev.Levels[i];
|
|
139
|
+
const b = next.Levels[i];
|
|
140
|
+
if (a.LevelId !== b.LevelId ||
|
|
141
|
+
a.ProgressStatus !== b.ProgressStatus ||
|
|
142
|
+
a.ProgressPercentage !== b.ProgressPercentage) {
|
|
143
|
+
return true;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
return false;
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
const DEFAULT_LANGUAGE = 'en';
|
|
150
|
+
const TRANSLATIONS = {
|
|
151
|
+
en: {
|
|
152
|
+
title: 'Challenges',
|
|
153
|
+
promo: 'Promo',
|
|
154
|
+
active: 'Active',
|
|
155
|
+
pendingTab: 'Pending',
|
|
156
|
+
finishedTab: 'Finished',
|
|
157
|
+
levels: 'Levels',
|
|
158
|
+
level: 'Level',
|
|
159
|
+
seeAll: 'See All',
|
|
160
|
+
games: 'Games',
|
|
161
|
+
rules: 'Rules',
|
|
162
|
+
events: 'Events',
|
|
163
|
+
codeTab: 'Code',
|
|
164
|
+
endsIn: 'Ends In',
|
|
165
|
+
expired: 'Expired',
|
|
166
|
+
placeBetsOf: 'Place bets of',
|
|
167
|
+
place: 'Place',
|
|
168
|
+
bet: 'bet',
|
|
169
|
+
bets: 'bets',
|
|
170
|
+
minBet: 'min bet',
|
|
171
|
+
forfeited: 'Forfeited',
|
|
172
|
+
finished: 'Finished',
|
|
173
|
+
suspended: 'Suspended',
|
|
174
|
+
completed: 'Completed',
|
|
175
|
+
unavailable: 'Unavailable',
|
|
176
|
+
optIn: 'Opt In',
|
|
177
|
+
optOutLeavingText: 'Leaving the challenge will cancel your progress and disqualify from future participation',
|
|
178
|
+
optOutLeavingActionText: 'Opt out of Challenge',
|
|
179
|
+
optOutModalTitle: 'Opt out of challenge?',
|
|
180
|
+
optOudModalDescription: 'Current progress will be lost, but you will keep earned rewards. You will not be able to opt in for this challenge again.',
|
|
181
|
+
optOutModalConfirm: 'Opt Out',
|
|
182
|
+
optOutModalCancel: 'Cancel',
|
|
183
|
+
optOutSuccessMessage: 'You’ve opted out of the challenge.',
|
|
184
|
+
resume: 'Resume',
|
|
185
|
+
pause: 'Pause',
|
|
186
|
+
join: 'Join to Start',
|
|
187
|
+
deposit: 'Deposit',
|
|
188
|
+
launchGame: 'Launch Game',
|
|
189
|
+
launchDescription: 'Launch any game from the Games tab to unlock the Challenge',
|
|
190
|
+
depositAmountDescription: 'to unlock the Challenge',
|
|
191
|
+
noDepositAmountDescription: 'Deposit any amount to unlock the Challenge',
|
|
192
|
+
claimByButton: 'Claim',
|
|
193
|
+
claimDescription: 'Click Claim button to unlock the Challenge',
|
|
194
|
+
resumeDescription: 'Your progress is saved while Challenge is suspended',
|
|
195
|
+
optInDescription: 'You are ready to opt-in!',
|
|
196
|
+
pausedDescription: 'Your progress is saved while Challenge is paused',
|
|
197
|
+
congrats: 'Congratulations!',
|
|
198
|
+
forfeitNotification: 'Unfortunately, your progress has been forfeited, and you are no longer eligible to continue this challenge. Check out other available challenges!',
|
|
199
|
+
optedOutNotification: 'You’ve left this challenge. Your progress has been lost, and rejoining is no longer possible. Discover other available challenges.',
|
|
200
|
+
completedNofitication: "You've successfully completed this challenge! Explore the next one and keep playing to earn more rewards!",
|
|
201
|
+
expiredNotification: 'Unfortunately, this challenge has expired and is no longer available to complete. Try another one that’s still active!',
|
|
202
|
+
pendingDescription: "You can join this challenge once you've finished the previous progress in the Active tab",
|
|
203
|
+
terms: 'Terms & Conditions',
|
|
204
|
+
readFullTerms: 'Read full Terms & Conditions',
|
|
205
|
+
contribution: 'contribution',
|
|
206
|
+
endDate: 'End Date',
|
|
207
|
+
back: 'Back',
|
|
208
|
+
all: 'All Challenges',
|
|
209
|
+
sports: 'Sports',
|
|
210
|
+
casino: 'Casino',
|
|
211
|
+
contributionType: 'Contribution Type',
|
|
212
|
+
contributionRule: 'Contribution Rule',
|
|
213
|
+
isContributeToOne: 'Bets contribute only to the earliest started challenge (if there are multiple started challenges)',
|
|
214
|
+
isNotContributeToOne: 'Bets contribute to all started challenges',
|
|
215
|
+
bonusMoney: 'Bonus Money',
|
|
216
|
+
realMoney: 'Real Money',
|
|
217
|
+
mixedMoney: 'Real and Bonus Money contribution',
|
|
218
|
+
defaultRule: 'All events - ',
|
|
219
|
+
fundsUsed: 'Funds Used',
|
|
220
|
+
sportsbookRealMoney: 'Only Real Money bets can contribute',
|
|
221
|
+
sportsbookBonusMoney: 'Only Bonus bets can contribute',
|
|
222
|
+
sportsbookMixMoney: 'Both Real Money and Bonus bets can contribute',
|
|
223
|
+
eligibleMatchTypes: 'Eligible Match Types',
|
|
224
|
+
preLiveMatchType: 'Only Pre-Match bets can contribute',
|
|
225
|
+
liveMatchType: 'Only Live bets can contribute',
|
|
226
|
+
mixMatchType: 'Both Pre-Match and Live bets can contribute',
|
|
227
|
+
eligibleBetTypes: 'Eligible Bet Types',
|
|
228
|
+
single: 'Single',
|
|
229
|
+
multi: 'Multi/Combi',
|
|
230
|
+
betBuilder: 'Only Bet Builder Bets',
|
|
231
|
+
nonBetBuilder: 'Only Non-Bet Builder Bets',
|
|
232
|
+
mixBetBuilder: 'Bet Builder & Non-Bet Builder Bets',
|
|
233
|
+
system: 'System',
|
|
234
|
+
banker: 'Only Banker Bets',
|
|
235
|
+
nonBanker: 'Only Non-Banker Bets',
|
|
236
|
+
mixBanker: 'Banker & Non-Banker Bets',
|
|
237
|
+
oddsPerSection: 'Odds per Selection',
|
|
238
|
+
totalOdds: 'Total Odds',
|
|
239
|
+
totalLevels: 'Total Levels',
|
|
240
|
+
selections: 'Selections',
|
|
241
|
+
time: 'time',
|
|
242
|
+
times: 'times',
|
|
243
|
+
winStakeRatio: 'Win/Stake Ratio',
|
|
244
|
+
promoTabEmptyHeader: 'Nothing here - yet!',
|
|
245
|
+
promoTabEmptyDescription: 'No challenges at the moment. Try exploring events or keep playing to unlock new ones.',
|
|
246
|
+
activeTabEmptyHeader: 'No active challenges yet',
|
|
247
|
+
activeTabEmptyDescription: 'Check Promo tab to find available offers',
|
|
248
|
+
pendingTabEmptyHeader: 'No pending challenges yet',
|
|
249
|
+
pendingTabEmptyDescription: 'Check Promo tab to find available offers',
|
|
250
|
+
finishedTabEmptyHeader: 'No finished challenges yet',
|
|
251
|
+
finishedTabEmptyDescription: 'Check Promo tab to find available offers',
|
|
252
|
+
yourProgress: 'Your Progress',
|
|
253
|
+
claimCodeTitle: 'Enter the secret code to unlock hidden quests and rewards.',
|
|
254
|
+
claimCodeSuccessMessage: 'The code was successfully applied.',
|
|
255
|
+
claimCodeInputLabel: '3–30 characters, no spaces',
|
|
256
|
+
claimCodeBtnText: 'Apply Code',
|
|
257
|
+
claimCodeError: 'Invalid format. Use Latin letters, numbers, or symbols.',
|
|
258
|
+
claimCodeDescription: 'Enter code to unlock the challenge',
|
|
259
|
+
status: 'Status',
|
|
260
|
+
grantClaimByButtonSuccessMessage: 'Challenge has been triggered successfully and is now available on the Active tab'
|
|
261
|
+
},
|
|
262
|
+
da: {
|
|
263
|
+
title: ''
|
|
264
|
+
}
|
|
265
|
+
};
|
|
266
|
+
const translate = (key, customLang) => {
|
|
267
|
+
const lang = customLang;
|
|
268
|
+
return TRANSLATIONS[lang !== undefined && lang in TRANSLATIONS ? lang : DEFAULT_LANGUAGE][key];
|
|
269
|
+
};
|
|
270
|
+
const getTranslations = (data) => {
|
|
271
|
+
Object.keys(data).forEach((item) => {
|
|
272
|
+
if (!TRANSLATIONS[item]) {
|
|
273
|
+
TRANSLATIONS[item] = {};
|
|
274
|
+
}
|
|
275
|
+
for (let key in data[item]) {
|
|
276
|
+
TRANSLATIONS[item][key] = data[item][key];
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
};
|
|
280
|
+
const resolveTranslationUrl = async (translationUrl) => {
|
|
281
|
+
if (translationUrl) {
|
|
282
|
+
try {
|
|
283
|
+
const response = await fetch(translationUrl);
|
|
284
|
+
if (!response.ok) {
|
|
285
|
+
throw new Error(`HTTP error! status: ${response.status}`);
|
|
286
|
+
}
|
|
287
|
+
const translations = await response.json();
|
|
288
|
+
getTranslations(translations);
|
|
289
|
+
}
|
|
290
|
+
catch (error) {
|
|
291
|
+
console.error('Failed to fetch or parse translations from URL:', error);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
};
|
|
295
|
+
|
|
296
|
+
var EChallengeLevelTargetType;
|
|
297
|
+
(function (EChallengeLevelTargetType) {
|
|
298
|
+
EChallengeLevelTargetType[EChallengeLevelTargetType["Accumulative"] = 0] = "Accumulative";
|
|
299
|
+
EChallengeLevelTargetType[EChallengeLevelTargetType["SingleBet"] = 1] = "SingleBet";
|
|
300
|
+
EChallengeLevelTargetType[EChallengeLevelTargetType["MultipleOneBetSize"] = 2] = "MultipleOneBetSize";
|
|
301
|
+
EChallengeLevelTargetType[EChallengeLevelTargetType["BetMultiplier"] = 3] = "BetMultiplier";
|
|
302
|
+
})(EChallengeLevelTargetType || (EChallengeLevelTargetType = {}));
|
|
303
|
+
var EChallengeRecurrenceType;
|
|
304
|
+
(function (EChallengeRecurrenceType) {
|
|
305
|
+
EChallengeRecurrenceType[EChallengeRecurrenceType["Single"] = 0] = "Single";
|
|
306
|
+
EChallengeRecurrenceType[EChallengeRecurrenceType["Daily"] = 1] = "Daily";
|
|
307
|
+
EChallengeRecurrenceType[EChallengeRecurrenceType["Weekly"] = 2] = "Weekly";
|
|
308
|
+
EChallengeRecurrenceType[EChallengeRecurrenceType["Monthly"] = 3] = "Monthly";
|
|
309
|
+
})(EChallengeRecurrenceType || (EChallengeRecurrenceType = {}));
|
|
310
|
+
var EChallengeRewardType;
|
|
311
|
+
(function (EChallengeRewardType) {
|
|
312
|
+
EChallengeRewardType[EChallengeRewardType["FreeSpins"] = 0] = "FreeSpins";
|
|
313
|
+
EChallengeRewardType[EChallengeRewardType["LuckyWheel"] = 1] = "LuckyWheel";
|
|
314
|
+
EChallengeRewardType[EChallengeRewardType["Leaderboard"] = 2] = "Leaderboard";
|
|
315
|
+
EChallengeRewardType[EChallengeRewardType["Challenge"] = 3] = "Challenge";
|
|
316
|
+
EChallengeRewardType[EChallengeRewardType["Custom"] = 4] = "Custom";
|
|
317
|
+
})(EChallengeRewardType || (EChallengeRewardType = {}));
|
|
318
|
+
var EChallengeProgressLevelStatus;
|
|
319
|
+
(function (EChallengeProgressLevelStatus) {
|
|
320
|
+
EChallengeProgressLevelStatus[EChallengeProgressLevelStatus["Closed"] = 0] = "Closed";
|
|
321
|
+
EChallengeProgressLevelStatus[EChallengeProgressLevelStatus["InProgress"] = 1] = "InProgress";
|
|
322
|
+
EChallengeProgressLevelStatus[EChallengeProgressLevelStatus["Fillup"] = 2] = "Fillup";
|
|
323
|
+
EChallengeProgressLevelStatus[EChallengeProgressLevelStatus["Completed"] = 3] = "Completed";
|
|
324
|
+
})(EChallengeProgressLevelStatus || (EChallengeProgressLevelStatus = {}));
|
|
325
|
+
var EChallengeProgressStatus;
|
|
326
|
+
(function (EChallengeProgressStatus) {
|
|
327
|
+
EChallengeProgressStatus[EChallengeProgressStatus["Started"] = 0] = "Started";
|
|
328
|
+
EChallengeProgressStatus[EChallengeProgressStatus["InProgress"] = 1] = "InProgress";
|
|
329
|
+
EChallengeProgressStatus[EChallengeProgressStatus["PendingLevelReward"] = 2] = "PendingLevelReward";
|
|
330
|
+
EChallengeProgressStatus[EChallengeProgressStatus["Completed"] = 3] = "Completed";
|
|
331
|
+
EChallengeProgressStatus[EChallengeProgressStatus["Expired"] = 4] = "Expired";
|
|
332
|
+
EChallengeProgressStatus[EChallengeProgressStatus["Forfeited"] = 5] = "Forfeited";
|
|
333
|
+
EChallengeProgressStatus[EChallengeProgressStatus["Awaiting"] = 6] = "Awaiting";
|
|
334
|
+
EChallengeProgressStatus[EChallengeProgressStatus["Paused"] = 7] = "Paused";
|
|
335
|
+
})(EChallengeProgressStatus || (EChallengeProgressStatus = {}));
|
|
336
|
+
var EChallengeStatus;
|
|
337
|
+
(function (EChallengeStatus) {
|
|
338
|
+
EChallengeStatus[EChallengeStatus["Draft"] = 0] = "Draft";
|
|
339
|
+
EChallengeStatus[EChallengeStatus["Enabled"] = 1] = "Enabled";
|
|
340
|
+
EChallengeStatus[EChallengeStatus["Paused"] = 2] = "Paused";
|
|
341
|
+
EChallengeStatus[EChallengeStatus["Closed"] = 3] = "Closed";
|
|
342
|
+
EChallengeStatus[EChallengeStatus["Deleted"] = 4] = "Deleted";
|
|
343
|
+
})(EChallengeStatus || (EChallengeStatus = {}));
|
|
344
|
+
var EChallengeTriggerType;
|
|
345
|
+
(function (EChallengeTriggerType) {
|
|
346
|
+
EChallengeTriggerType[EChallengeTriggerType["GameLaunch"] = 0] = "GameLaunch";
|
|
347
|
+
EChallengeTriggerType[EChallengeTriggerType["Reward"] = 1] = "Reward";
|
|
348
|
+
EChallengeTriggerType[EChallengeTriggerType["Manual"] = 2] = "Manual";
|
|
349
|
+
EChallengeTriggerType[EChallengeTriggerType["Claim"] = 3] = "Claim";
|
|
350
|
+
EChallengeTriggerType[EChallengeTriggerType["Event"] = 4] = "Event";
|
|
351
|
+
EChallengeTriggerType[EChallengeTriggerType["Deposit"] = 5] = "Deposit";
|
|
352
|
+
EChallengeTriggerType[EChallengeTriggerType["ClaimByButton"] = 6] = "ClaimByButton";
|
|
353
|
+
})(EChallengeTriggerType || (EChallengeTriggerType = {}));
|
|
354
|
+
var EChallengeValidityType;
|
|
355
|
+
(function (EChallengeValidityType) {
|
|
356
|
+
EChallengeValidityType[EChallengeValidityType["Period"] = 0] = "Period";
|
|
357
|
+
EChallengeValidityType[EChallengeValidityType["Date"] = 1] = "Date";
|
|
358
|
+
})(EChallengeValidityType || (EChallengeValidityType = {}));
|
|
359
|
+
var EContributedFrom;
|
|
360
|
+
(function (EContributedFrom) {
|
|
361
|
+
EContributedFrom[EContributedFrom["Casino"] = 0] = "Casino";
|
|
362
|
+
EContributedFrom[EContributedFrom["Any"] = 1] = "Any";
|
|
363
|
+
EContributedFrom[EContributedFrom["Sportsbook"] = 2] = "Sportsbook";
|
|
364
|
+
})(EContributedFrom || (EContributedFrom = {}));
|
|
365
|
+
var EMatchType;
|
|
366
|
+
(function (EMatchType) {
|
|
367
|
+
EMatchType[EMatchType["Any"] = 0] = "Any";
|
|
368
|
+
EMatchType[EMatchType["Live"] = 1] = "Live";
|
|
369
|
+
EMatchType[EMatchType["PreLive"] = 2] = "PreLive";
|
|
370
|
+
})(EMatchType || (EMatchType = {}));
|
|
371
|
+
var EBetType;
|
|
372
|
+
(function (EBetType) {
|
|
373
|
+
EBetType[EBetType["Single"] = 0] = "Single";
|
|
374
|
+
EBetType[EBetType["Multiple"] = 1] = "Multiple";
|
|
375
|
+
EBetType[EBetType["System"] = 2] = "System";
|
|
376
|
+
})(EBetType || (EBetType = {}));
|
|
377
|
+
var EBanker;
|
|
378
|
+
(function (EBanker) {
|
|
379
|
+
EBanker[EBanker["Any"] = 0] = "Any";
|
|
380
|
+
EBanker[EBanker["BankerOnly"] = 1] = "BankerOnly";
|
|
381
|
+
EBanker[EBanker["NotBankerOnly"] = 2] = "NotBankerOnly";
|
|
382
|
+
})(EBanker || (EBanker = {}));
|
|
383
|
+
var EBetBuilder;
|
|
384
|
+
(function (EBetBuilder) {
|
|
385
|
+
EBetBuilder[EBetBuilder["Any"] = 0] = "Any";
|
|
386
|
+
EBetBuilder[EBetBuilder["BetBuilderOnly"] = 1] = "BetBuilderOnly";
|
|
387
|
+
EBetBuilder[EBetBuilder["NotBetBuilderOnly"] = 2] = "NotBetBuilderOnly";
|
|
388
|
+
})(EBetBuilder || (EBetBuilder = {}));
|
|
389
|
+
var EWalletTypes;
|
|
390
|
+
(function (EWalletTypes) {
|
|
391
|
+
EWalletTypes[EWalletTypes["RealCash"] = 0] = "RealCash";
|
|
392
|
+
EWalletTypes[EWalletTypes["BonusMoney"] = 1] = "BonusMoney";
|
|
393
|
+
EWalletTypes[EWalletTypes["Mixed"] = 2] = "Mixed";
|
|
394
|
+
})(EWalletTypes || (EWalletTypes = {}));
|
|
395
|
+
exports.EChallengesTabs = void 0;
|
|
396
|
+
(function (EChallengesTabs) {
|
|
397
|
+
EChallengesTabs[EChallengesTabs["Promo"] = 0] = "Promo";
|
|
398
|
+
EChallengesTabs[EChallengesTabs["Active"] = 1] = "Active";
|
|
399
|
+
EChallengesTabs[EChallengesTabs["Pending"] = 2] = "Pending";
|
|
400
|
+
EChallengesTabs[EChallengesTabs["Finished"] = 3] = "Finished";
|
|
401
|
+
EChallengesTabs[EChallengesTabs["Code"] = 4] = "Code";
|
|
402
|
+
})(exports.EChallengesTabs || (exports.EChallengesTabs = {}));
|
|
403
|
+
var EChallengeDetailsTabs;
|
|
404
|
+
(function (EChallengeDetailsTabs) {
|
|
405
|
+
EChallengeDetailsTabs[EChallengeDetailsTabs["Levels"] = 0] = "Levels";
|
|
406
|
+
EChallengeDetailsTabs[EChallengeDetailsTabs["Games"] = 1] = "Games";
|
|
407
|
+
EChallengeDetailsTabs[EChallengeDetailsTabs["Events"] = 2] = "Events";
|
|
408
|
+
EChallengeDetailsTabs[EChallengeDetailsTabs["Rules"] = 3] = "Rules";
|
|
409
|
+
})(EChallengeDetailsTabs || (EChallengeDetailsTabs = {}));
|
|
410
|
+
const HistoryItemLevelStatusDictionary = ['Completed', 'Expired', 'Forfeited'];
|
|
411
|
+
exports.EHistoryItemLevelStatus = void 0;
|
|
412
|
+
(function (EHistoryItemLevelStatus) {
|
|
413
|
+
EHistoryItemLevelStatus[EHistoryItemLevelStatus["Completed"] = 0] = "Completed";
|
|
414
|
+
EHistoryItemLevelStatus[EHistoryItemLevelStatus["Expired"] = 1] = "Expired";
|
|
415
|
+
EHistoryItemLevelStatus[EHistoryItemLevelStatus["Forfeited"] = 2] = "Forfeited";
|
|
416
|
+
})(exports.EHistoryItemLevelStatus || (exports.EHistoryItemLevelStatus = {}));
|
|
417
|
+
exports.EPostMessageRequestType = void 0;
|
|
418
|
+
(function (EPostMessageRequestType) {
|
|
419
|
+
EPostMessageRequestType["ChallengesHistory"] = "ChallengesHistoryRequest";
|
|
420
|
+
EPostMessageRequestType["ChallengePromoTab"] = "ChallengePromoTabRequest";
|
|
421
|
+
EPostMessageRequestType["ClaimChallengeByCode"] = "ClaimChallengeByCodeRequest";
|
|
422
|
+
EPostMessageRequestType["ChallengeJoin"] = "ChallengeJoinRequest";
|
|
423
|
+
EPostMessageRequestType["RedirectToDepositPage"] = "RedirectToDepositPage";
|
|
424
|
+
EPostMessageRequestType["ClaimChallengeByButton"] = "ClaimChallengeByButtonRequest";
|
|
425
|
+
EPostMessageRequestType["GetChallengeGames"] = "GetChallengeGamesRequest";
|
|
426
|
+
EPostMessageRequestType["ChallengeIsNew"] = "ChallengeIsNewRequest";
|
|
427
|
+
EPostMessageRequestType["ChallengeInGameRedirect"] = "ChallengeInGameRedirect";
|
|
428
|
+
EPostMessageRequestType["ForfeitChallenge"] = "ForfeitChallengeRequest";
|
|
429
|
+
})(exports.EPostMessageRequestType || (exports.EPostMessageRequestType = {}));
|
|
430
|
+
var EPostMessageResponseType;
|
|
431
|
+
(function (EPostMessageResponseType) {
|
|
432
|
+
EPostMessageResponseType["ChallengesHistory"] = "ChallengesHistoryResponse";
|
|
433
|
+
EPostMessageResponseType["ChallengePromoTab"] = "ChallengePromoTabResponse";
|
|
434
|
+
EPostMessageResponseType["ClaimChallengeByCode"] = "ClaimChallengeByCodeResponse";
|
|
435
|
+
EPostMessageResponseType["ChallengeJoin"] = "ChallengeJoinResponse";
|
|
436
|
+
EPostMessageResponseType["ClaimChallengeByButton"] = "ClaimChallengeByButtonResponse";
|
|
437
|
+
EPostMessageResponseType["GetChallengeGames"] = "GetChallengeGamesResponse";
|
|
438
|
+
EPostMessageResponseType["ChallengeIsNew"] = "ChallengeIsNewResponse";
|
|
439
|
+
EPostMessageResponseType["ForfeitChallenge"] = "ForfeitChallengeResponse";
|
|
440
|
+
EPostMessageResponseType["ChangeChallengeProgressStatus"] = "ChangeChallengeProgressStatus";
|
|
441
|
+
EPostMessageResponseType["ChallengeChangeStatusNotification"] = "ChallengeChangeStatusNotification";
|
|
442
|
+
EPostMessageResponseType["ChallengeForfeitNotification"] = "ChallengeForfeitNotification";
|
|
443
|
+
EPostMessageResponseType["UpdateChallengeProgress"] = "UpdateChallengeProgress";
|
|
444
|
+
EPostMessageResponseType["NewChallengeProgressGranted"] = "NewChallengeProgressGranted";
|
|
445
|
+
})(EPostMessageResponseType || (EPostMessageResponseType = {}));
|
|
446
|
+
|
|
447
|
+
const crossSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTIuNSAxNy41TDE3LjUgMi41IiBzdHJva2U9IndoaXRlIiBzdHJva2Utd2lkdGg9IjEuMDA0NTkiIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+CjxwYXRoIGQ9Ik0yLjUgMi41TDE3LjUgMTcuNSIgc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLXdpZHRoPSIxLjAwNDU5IiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8L3N2Zz4K';
|
|
448
|
+
|
|
449
|
+
const errorSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTUiIGhlaWdodD0iMTUiIHZpZXdCb3g9IjAgMCAxNSAxNSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03LjMzMzMzIDEuMzMzMzNDNC4wMTk2MiAxLjMzMzMzIDEuMzMzMzMgNC4wMTk2MiAxLjMzMzMzIDcuMzMzMzNDMS4zMzMzMyAxMC42NDcgNC4wMTk2MiAxMy4zMzMzIDcuMzMzMzMgMTMuMzMzM0MxMC42NDcgMTMuMzMzMyAxMy4zMzMzIDEwLjY0NyAxMy4zMzMzIDcuMzMzMzNDMTMuMzMzMyA0LjAxOTYyIDEwLjY0NyAxLjMzMzMzIDcuMzMzMzMgMS4zMzMzM1pNMCA3LjMzMzMzQzAgMy4yODMyNSAzLjI4MzI1IDAgNy4zMzMzMyAwQzExLjM4MzQgMCAxNC42NjY3IDMuMjgzMjUgMTQuNjY2NyA3LjMzMzMzQzE0LjY2NjcgMTEuMzgzNCAxMS4zODM0IDE0LjY2NjcgNy4zMzMzMyAxNC42NjY3QzMuMjgzMjUgMTQuNjY2NyAwIDExLjM4MzQgMCA3LjMzMzMzWk03LjMzMzMzIDRDNy43MDE1MiA0IDggNC4yOTg0OCA4IDQuNjY2NjdWNy4zMzMzM0M4IDcuNzAxNTIgNy43MDE1MiA4IDcuMzMzMzMgOEM2Ljk2NTE0IDggNi42NjY2NyA3LjcwMTUyIDYuNjY2NjcgNy4zMzMzM1Y0LjY2NjY3QzYuNjY2NjcgNC4yOTg0OCA2Ljk2NTE0IDQgNy4zMzMzMyA0Wk02LjY2NjY3IDEwQzYuNjY2NjcgOS42MzE4MSA2Ljk2NTE0IDkuMzMzMzMgNy4zMzMzMyA5LjMzMzMzSDcuMzRDNy43MDgxOSA5LjMzMzMzIDguMDA2NjcgOS42MzE4MSA4LjAwNjY3IDEwQzguMDA2NjcgMTAuMzY4MiA3LjcwODE5IDEwLjY2NjcgNy4zNCAxMC42NjY3SDcuMzMzMzNDNi45NjUxNCAxMC42NjY3IDYuNjY2NjcgMTAuMzY4MiA2LjY2NjY3IDEwWiIgZmlsbD0iI0ZGNEQ0RiIvPgo8L3N2Zz4K';
|
|
450
|
+
|
|
451
|
+
const checkSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTUiIGhlaWdodD0iMTUiIHZpZXdCb3g9IjAgMCAxNSAxNSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03LjMzMzMzIDEuMzMzMzNDNC4wMTk2MiAxLjMzMzMzIDEuMzMzMzMgNC4wMTk2MiAxLjMzMzMzIDcuMzMzMzNDMS4zMzMzMyAxMC42NDcgNC4wMTk2MiAxMy4zMzMzIDcuMzMzMzMgMTMuMzMzM0MxMC42NDcgMTMuMzMzMyAxMy4zMzMzIDEwLjY0NyAxMy4zMzMzIDcuMzMzMzNDMTMuMzMzMyA0LjAxOTYyIDEwLjY0NyAxLjMzMzMzIDcuMzMzMzMgMS4zMzMzM1pNMCA3LjMzMzMzQzAgMy4yODMyNSAzLjI4MzI1IDAgNy4zMzMzMyAwQzExLjM4MzQgMCAxNC42NjY3IDMuMjgzMjUgMTQuNjY2NyA3LjMzMzMzQzE0LjY2NjcgMTEuMzgzNCAxMS4zODM0IDE0LjY2NjcgNy4zMzMzMyAxNC42NjY3QzMuMjgzMjUgMTQuNjY2NyAwIDExLjM4MzQgMCA3LjMzMzMzWk0xMC44MDQ3IDQuODYxOTNDMTEuMDY1MSA1LjEyMjI4IDExLjA2NTEgNS41NDQzOSAxMC44MDQ3IDUuODA0NzRMNi44MDQ3NCA5LjgwNDc0QzYuNTQ0MzkgMTAuMDY1MSA2LjEyMjI4IDEwLjA2NTEgNS44NjE5MyA5LjgwNDc0TDMuODYxOTMgNy44MDQ3NEMzLjYwMTU4IDcuNTQ0MzkgMy42MDE1OCA3LjEyMjI4IDMuODYxOTMgNi44NjE5M0M0LjEyMjI4IDYuNjAxNTggNC41NDQzOSA2LjYwMTU4IDQuODA0NzQgNi44NjE5M0w2LjMzMzMzIDguMzkwNTJMOS44NjE5MyA0Ljg2MTkzQzEwLjEyMjMgNC42MDE1OCAxMC41NDQ0IDQuNjAxNTggMTAuODA0NyA0Ljg2MTkzWiIgZmlsbD0iIzAwRkE1QSIvPgo8L3N2Zz4K';
|
|
452
|
+
|
|
453
|
+
const casinoChallengesOverlayDrawerCss = "@import url(\"https://fonts.googleapis.com/css2?family=Teachers:ital,wght@0,400..800;1,400..800&display=swap\");\n.container {\n z-index: 301;\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n container-name: challenges-game-page;\n container-type: size;\n}\n\n.mobile .challenges__drawer {\n width: 100%;\n height: 100%;\n left: 0;\n bottom: 0;\n border-radius: 0;\n backdrop-filter: blur(16px);\n border: none;\n max-width: none;\n min-width: initial;\n}\n.mobile .challenges__drawer .content-spacer {\n margin-bottom: 32px;\n}\n.mobile .challenges__drawer .content-spacer.one-slide {\n margin-bottom: 38px;\n}\n.mobile .challenges__drawer__content {\n padding: 16px 0 0;\n}\n.mobile .challenges__drawer__content .content-details {\n height: calc(100% - 30px);\n}\n.mobile .challenges__drawer__title {\n height: 26px;\n font-size: var(--emw--font-size-large, 18px);\n}\n.mobile .challenges__drawer__close {\n right: 16px;\n width: 26px;\n height: 26px;\n}\n.mobile .challenges__drawer__close img {\n width: 14px;\n}\n.mobile .challenges__backdrop {\n display: none;\n}\n.mobile .notification {\n padding: 8px 16px;\n gap: 8px;\n}\n.mobile .notification .row {\n margin: 15px 0 14px 0;\n}\n.mobile .notification__icon {\n width: 16px;\n height: 16px;\n}\n.mobile .notification__message {\n font-size: var(--emw--font-size-small, 14px);\n}\n\n.challenges__drawer {\n z-index: 302;\n position: fixed;\n left: 62px;\n bottom: 76px;\n border: 1px solid var(--emw--color-container-border, rgba(255, 255, 255, 0.0705882353));\n background: var(--emw--color-Overlay-Background, rgba(9, 9, 9, 0.8));\n backdrop-filter: blur(11px);\n box-sizing: border-box;\n width: 35%;\n min-width: 400px;\n max-width: 600px;\n height: calc(100% - 20px - 76px);\n border-radius: 30px;\n opacity: 1;\n font-family: var(--emw--font-family-primary, \"Teachers\"), sans-serif;\n container-name: challenges-drawer;\n container-type: size;\n}\n.challenges__drawer__title {\n height: 36px;\n color: var(--emw--color-title, #edeff2);\n text-align: center;\n font-size: var(--emw--font-size-large-xl, 22px);\n font-weight: var(--emw--font-weight-semibold, 600);\n margin: 0;\n position: relative;\n z-index: 1;\n align-content: center;\n}\n.challenges__drawer__close {\n outline: none;\n background: transparent;\n border-radius: 20px;\n border: 1.5px solid var(--emw--color-container-border, rgba(255, 255, 255, 0.0705882353));\n background: var(--emw--color-container-background, rgba(9, 9, 9, 0.5019607843));\n backdrop-filter: blur(6.882352829px);\n cursor: pointer;\n width: 36px;\n height: 36px;\n min-width: 36px;\n min-height: 36px;\n display: flex;\n align-items: center;\n justify-content: center;\n position: absolute;\n top: 0;\n right: 24px;\n}\n.challenges__drawer__content {\n height: 100%;\n position: relative;\n z-index: 2;\n padding: 24px 0 0;\n box-sizing: border-box;\n}\n.challenges__drawer__content .content-header {\n width: 100%;\n flex-shrink: 0;\n}\n.challenges__drawer__content .content-details {\n flex: 1;\n min-height: 0;\n overflow-y: auto;\n}\n.challenges__drawer__content .content-sub-page {\n display: flex;\n height: 100%;\n}\n.challenges__drawer .content-spacer {\n margin-bottom: 24px;\n}\n.challenges__drawer, .challenges__drawer * {\n scrollbar-width: thin;\n scrollbar-color: var(--emw--color-gray-250, rgba(255, 255, 255, 0.3)) transparent;\n}\n.challenges__drawer::-webkit-scrollbar, .challenges__drawer *::-webkit-scrollbar {\n width: 3px;\n}\n.challenges__drawer::-webkit-scrollbar-track, .challenges__drawer *::-webkit-scrollbar-track {\n background: transparent;\n}\n.challenges__drawer::-webkit-scrollbar-thumb, .challenges__drawer *::-webkit-scrollbar-thumb {\n background: var(--emw--color-gray-250, rgba(255, 255, 255, 0.3));\n opacity: 0.3;\n border-radius: 999px;\n transition: none;\n width: 3px;\n}\n.challenges__drawer::-webkit-scrollbar-thumb:hover, .challenges__drawer *::-webkit-scrollbar-thumb:hover {\n background: var(--emw--color-gray-250, rgba(255, 255, 255, 0.3));\n opacity: 0.3;\n width: 3px;\n}\n.challenges__drawer::-webkit-scrollbar-button, .challenges__drawer *::-webkit-scrollbar-button {\n display: none;\n}\n.challenges__backdrop {\n border: none;\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: var(--emw--color-gray-backdrop, rgba(0, 0, 0, 0.6));\n z-index: 301;\n opacity: 1;\n}\n\n.notification {\n display: flex;\n position: fixed;\n z-index: 400;\n align-items: center;\n bottom: 76px;\n right: 0;\n padding: 24px;\n gap: 12px;\n max-width: 445px;\n box-sizing: border-box;\n border-radius: 20px 0 0 20px;\n border-top: 1px solid var(--emw--status-badge-success-color, #d6fff0);\n border-bottom: 1px solid var(--emw--status-badge-success-color, #d6fff0);\n border-left: 1px solid var(--emw--status-badge-success-color, #d6fff0);\n background: var(--emw--background-success-notification, linear-gradient(112deg, rgba(74, 255, 135, 0.2) 0%, rgba(74, 255, 135, 0) 100%));\n backdrop-filter: blur(16px);\n color: var(--emw--color-white, #ffffff);\n font-family: var(--emw--font-family-primary, \"Teachers\"), sans-serif;\n}\n.notification.errored {\n border-top: 1px solid var(--emw--status-badge-red-bg, #d63d1e);\n border-bottom: 1px solid var(--emw--status-badge-red-bg, #d63d1e);\n border-left: 1px solid var(--emw--status-badge-red-bg, #d63d1e);\n background: var(--emw--background-error-notification, rgba(9, 9, 9, 0.4));\n}\n.notification .row {\n display: flex;\n align-items: flex-start;\n}\n.notification__icon {\n width: 18px;\n height: 18px;\n margin-right: 12px;\n}\n.notification__message {\n margin: 0;\n font-size: var(--emw--font-size-medium, 16px);\n font-weight: var(--emw--font-weight-medium, 500);\n}\n.notification__message .active-tab {\n color: var(--emw--border-success-color, #00b74f);\n text-decoration-line: underline;\n cursor: pointer;\n}\n\ncasino-challenges-overlay-drawer-details {\n flex: 1;\n}\n\n@container challenges-game-page (width <= 1430px) {\n .challenges__drawer {\n width: 40%;\n left: 45px;\n }\n}\n@container challenges-game-page (width <= 1250px) {\n .challenges__drawer {\n width: 45%;\n }\n}\n@container challenges-game-page (width <= 1000px) {\n .challenges__drawer {\n width: 50%;\n left: 25px;\n }\n}\n@container challenges-game-page (width <= 800px) {\n .challenges__drawer__content {\n padding: 20px 0 0;\n }\n}\n@container challenges-game-page (height <= 850px) {\n .challenges__drawer {\n bottom: 36px;\n height: calc(100% - 20px - 36px);\n }\n .challenges__drawer .content-spacer {\n margin-bottom: 18px;\n }\n}\n@container challenges-drawer (height <= 760px) {\n .challenges__drawer .content-spacer {\n margin-bottom: 12px;\n }\n}";
|
|
454
|
+
const CasinoChallengesOverlayDrawerStyle0 = casinoChallengesOverlayDrawerCss;
|
|
455
|
+
|
|
456
|
+
const CasinoChallengesOverlayDrawer = class {
|
|
457
|
+
constructor(hostRef) {
|
|
458
|
+
index.registerInstance(this, hostRef);
|
|
459
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
460
|
+
this.EMPTY_STATE_PAGE_DESCRIPTION_MAP = {
|
|
461
|
+
[exports.EChallengesTabs.Promo]: {
|
|
462
|
+
header: (_a = TRANSLATIONS[this.language]) === null || _a === void 0 ? void 0 : _a.promoTabEmptyHeader,
|
|
463
|
+
description: (_b = TRANSLATIONS[this.language]) === null || _b === void 0 ? void 0 : _b.promoTabEmptyDescription
|
|
464
|
+
},
|
|
465
|
+
[exports.EChallengesTabs.Active]: {
|
|
466
|
+
header: (_c = TRANSLATIONS[this.language]) === null || _c === void 0 ? void 0 : _c.activeTabEmptyHeader,
|
|
467
|
+
description: (_d = TRANSLATIONS[this.language]) === null || _d === void 0 ? void 0 : _d.activeTabEmptyDescription
|
|
468
|
+
},
|
|
469
|
+
[exports.EChallengesTabs.Pending]: {
|
|
470
|
+
header: (_e = TRANSLATIONS[this.language]) === null || _e === void 0 ? void 0 : _e.pendingTabEmptyHeader,
|
|
471
|
+
description: (_f = TRANSLATIONS[this.language]) === null || _f === void 0 ? void 0 : _f.pendingTabEmptyDescription
|
|
472
|
+
},
|
|
473
|
+
[exports.EChallengesTabs.Finished]: {
|
|
474
|
+
header: (_g = TRANSLATIONS[this.language]) === null || _g === void 0 ? void 0 : _g.finishedTabEmptyHeader,
|
|
475
|
+
description: (_h = TRANSLATIONS[this.language]) === null || _h === void 0 ? void 0 : _h.finishedTabEmptyDescription
|
|
476
|
+
}
|
|
477
|
+
};
|
|
478
|
+
this.onActiveChallengeChange = (e) => {
|
|
479
|
+
var _a, _b, _c;
|
|
480
|
+
if (!(e === null || e === void 0 ? void 0 : e.detail)) {
|
|
481
|
+
return;
|
|
482
|
+
}
|
|
483
|
+
this.removeOptedOutChallenge();
|
|
484
|
+
if (this.activeTabIndex === exports.EChallengesTabs.Active) {
|
|
485
|
+
this.updateActiveChallenge((_a = this.activeChallenges) === null || _a === void 0 ? void 0 : _a.find((challenge) => (challenge === null || challenge === void 0 ? void 0 : challenge.Id) === e.detail));
|
|
486
|
+
}
|
|
487
|
+
else if (this.activeTabIndex === exports.EChallengesTabs.Pending) {
|
|
488
|
+
this.updateActiveChallenge((_b = this.pendingChallenges) === null || _b === void 0 ? void 0 : _b.find((challenge) => (challenge === null || challenge === void 0 ? void 0 : challenge.Id) === e.detail));
|
|
489
|
+
}
|
|
490
|
+
else {
|
|
491
|
+
this.updateActiveChallenge((_c = this.promoChallenges) === null || _c === void 0 ? void 0 : _c.find((challenge) => (challenge === null || challenge === void 0 ? void 0 : challenge.Id) === e.detail));
|
|
492
|
+
}
|
|
493
|
+
};
|
|
494
|
+
this.onSeeMoreClick = (e) => {
|
|
495
|
+
this.detailsSubPageInfo = { open: e.detail.open, tab: e.detail.tab };
|
|
496
|
+
};
|
|
497
|
+
this.onLoadMorePlayerHistory = (e) => {
|
|
498
|
+
window.postMessage({
|
|
499
|
+
type: exports.EPostMessageRequestType.ChallengesHistory,
|
|
500
|
+
data: e.detail
|
|
501
|
+
});
|
|
502
|
+
};
|
|
503
|
+
this.isInactiveChallenge = (challenge) => [
|
|
504
|
+
EChallengeProgressStatus.Awaiting,
|
|
505
|
+
EChallengeProgressStatus.Forfeited,
|
|
506
|
+
EChallengeProgressStatus.Completed,
|
|
507
|
+
EChallengeProgressStatus.Expired
|
|
508
|
+
].includes(challenge.Status) || challenge.ChallengeStatus === EChallengeStatus.Paused;
|
|
509
|
+
this.updateActiveChallenge = (challenge) => {
|
|
510
|
+
var _a;
|
|
511
|
+
this.activeChallenge = challenge;
|
|
512
|
+
this.activeProgressId = (_a = this.activeChallenge) === null || _a === void 0 ? void 0 : _a.Id;
|
|
513
|
+
};
|
|
514
|
+
this.removeOptedOutChallenge = () => {
|
|
515
|
+
var _a;
|
|
516
|
+
if (this.isOptedOut) {
|
|
517
|
+
this.isOptedOut = false;
|
|
518
|
+
this.activeChallenges = (_a = this.activeChallenges) === null || _a === void 0 ? void 0 : _a.filter((activeChallenge) => { var _a; return (activeChallenge === null || activeChallenge === void 0 ? void 0 : activeChallenge.Id) !== ((_a = this.activeChallenge) === null || _a === void 0 ? void 0 : _a.Id); });
|
|
519
|
+
this.activeChallenge = null;
|
|
520
|
+
}
|
|
521
|
+
};
|
|
522
|
+
this.handleTabClick = (event) => {
|
|
523
|
+
if (event.detail !== this.activeTabIndex) {
|
|
524
|
+
this.removeOptedOutChallenge();
|
|
525
|
+
this.activeTabIndex = event.detail;
|
|
526
|
+
if (this.activeTabIndex === exports.EChallengesTabs.Promo) {
|
|
527
|
+
window.postMessage({
|
|
528
|
+
type: exports.EPostMessageRequestType.ChallengePromoTab,
|
|
529
|
+
data: {}
|
|
530
|
+
});
|
|
531
|
+
}
|
|
532
|
+
if (this.activeTabIndex === exports.EChallengesTabs.Active) {
|
|
533
|
+
this.updateActiveChallenge(this.activeChallenges[0]);
|
|
534
|
+
}
|
|
535
|
+
if (this.activeTabIndex === exports.EChallengesTabs.Pending) {
|
|
536
|
+
this.updateActiveChallenge(this.pendingChallenges[0]);
|
|
537
|
+
}
|
|
538
|
+
if (this.activeTabIndex === exports.EChallengesTabs.Finished) {
|
|
539
|
+
window.postMessage({
|
|
540
|
+
type: exports.EPostMessageRequestType.ChallengesHistory,
|
|
541
|
+
data: {
|
|
542
|
+
PageSize: 20,
|
|
543
|
+
PageNumber: 0
|
|
544
|
+
}
|
|
545
|
+
});
|
|
546
|
+
}
|
|
547
|
+
if (event.detail !== exports.EChallengesTabs.Code)
|
|
548
|
+
this.emptyState = this.EMPTY_STATE_PAGE_DESCRIPTION_MAP[event.detail];
|
|
549
|
+
}
|
|
550
|
+
};
|
|
551
|
+
this.openNotification = (notification) => {
|
|
552
|
+
this.notification = notification;
|
|
553
|
+
setTimeout(() => (this.notification = null), 10000);
|
|
554
|
+
};
|
|
555
|
+
this.renderNotification = () => {
|
|
556
|
+
var _a, _b, _c;
|
|
557
|
+
return (index.h("div", { class: `notification ${((_a = this.notification) === null || _a === void 0 ? void 0 : _a.errored) ? 'errored' : ''}` }, index.h("div", { class: "row" }, index.h("img", { src: ((_b = this.notification) === null || _b === void 0 ? void 0 : _b.errored) ? errorSvg : checkSvg, class: "notification__icon", alt: "" }), index.h("p", { class: "notification__message" }, (_c = this.notification) === null || _c === void 0 ? void 0 : _c.message))));
|
|
558
|
+
};
|
|
559
|
+
this.renderHeader = (isMobile) => {
|
|
560
|
+
return (index.h("div", null, index.h("h1", { class: "challenges__drawer__title" }, index.h("span", null, translate('title', this.language)), index.h("button", { class: "challenges__drawer__close", onClick: this.onCloseClick }, index.h("img", { src: crossSvg, alt: "" }))), index.h("casino-challenges-overlay-tabs", { onTabClick: this.handleTabClick, activeTabIndex: this.activeTabIndex, activeTabHasNotification: false, pendingTabHasNotification: false, language: this.language, "is-mobile": isMobile })));
|
|
561
|
+
};
|
|
562
|
+
this.isEmptyState = () => {
|
|
563
|
+
if (!this.loading && this.activeTabIndex !== exports.EChallengesTabs.Code) {
|
|
564
|
+
if (this.activeTabIndex === exports.EChallengesTabs.Active && !this.activeChallenges.length) {
|
|
565
|
+
return true;
|
|
566
|
+
}
|
|
567
|
+
else if (this.activeTabIndex === exports.EChallengesTabs.Pending && !this.pendingChallenges.length) {
|
|
568
|
+
return true;
|
|
569
|
+
}
|
|
570
|
+
else if (this.activeTabIndex === exports.EChallengesTabs.Promo && !this.promoChallenges.length) {
|
|
571
|
+
return true;
|
|
572
|
+
}
|
|
573
|
+
else if (this.activeTabIndex === exports.EChallengesTabs.Finished && !this.playerHistory.length) {
|
|
574
|
+
return true;
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
return false;
|
|
578
|
+
};
|
|
579
|
+
this.renderEmptyState = (isMobile) => {
|
|
580
|
+
var _a, _b;
|
|
581
|
+
return (index.h("div", null, this.renderHeader(isMobile), index.h("casino-challenges-empty-state", { header: (_a = this.emptyState) === null || _a === void 0 ? void 0 : _a.header, description: (_b = this.emptyState) === null || _b === void 0 ? void 0 : _b.description, "is-mobile": isMobile })));
|
|
582
|
+
};
|
|
583
|
+
this.renderFinishedTab = (isMobile) => {
|
|
584
|
+
return (index.h("div", null, this.renderHeader(isMobile), index.h("casino-challenges-overlay-drawer-history", { mbSource: this.mbSource, clientStyling: this.clientStyling, clientStylingUrl: this.clientStylingUrl, translationUrl: this.translationUrl, language: this.language, isMobile: isMobile, historyItems: this.playerHistory, hasMore: this.hasMorePlayerHistory, onLoadMore: this.onLoadMorePlayerHistory, loading: this.loading })));
|
|
585
|
+
};
|
|
586
|
+
this.renderCodeTab = (isMobile) => {
|
|
587
|
+
return (index.h("div", null, this.renderHeader(isMobile), index.h("casino-challenges-claim-code", { "is-mobile": isMobile })));
|
|
588
|
+
};
|
|
589
|
+
this.renderChallengeDetails = (isMobile, isUnique = false) => {
|
|
590
|
+
return (index.h("casino-challenges-overlay-drawer-details", { challenge: this.activeChallenge, swipped: this.swipped, progress: this.progress, "is-mobile": isMobile, "is-unique": isUnique, "is-opted-out": this.isOptedOut, "active-challenges-tab-index": this.activeTabIndex, onSeeMoreClick: this.onSeeMoreClick, detailsSubPageInfo: this.detailsSubPageInfo, challengeGames: this.challengeGames, onCloseClick: this.onCloseClick }));
|
|
591
|
+
};
|
|
592
|
+
this.renderChallengesTabs = (isMobile) => {
|
|
593
|
+
const challenges = this.activeTabIndex === exports.EChallengesTabs.Active
|
|
594
|
+
? this.activeChallenges
|
|
595
|
+
: this.activeTabIndex === exports.EChallengesTabs.Pending
|
|
596
|
+
? this.pendingChallenges
|
|
597
|
+
: this.promoChallenges;
|
|
598
|
+
const isUnique = challenges.length === 1;
|
|
599
|
+
return (index.h("swipe-up", { onSwippedUp: (e) => {
|
|
600
|
+
this.swipped = e.detail.swipped;
|
|
601
|
+
this.progress = e.detail.progress;
|
|
602
|
+
}, isMobile: isMobile, isOneSlider: isUnique }, index.h("div", { class: "content-header", slot: "header" }, this.renderHeader(isMobile), index.h("div", { class: { 'content-spacer': this.swipped || !isMobile, 'one-slide': isUnique && this.swipped } }, index.h("casino-challenges-overlay-slider", { mbSource: this.mbSource, clientStyling: this.clientStyling, clientStylingUrl: this.clientStylingUrl, translationUrl: this.translationUrl, language: this.language, challenges: challenges, isMobile: isMobile, onActiveChallengeChange: this.onActiveChallengeChange, initialProgressId: this.activeProgressId, activeTabIndex: this.activeTabIndex }))), index.h("div", { class: "content-details", slot: "details" }, this.renderChallengeDetails(isMobile, isUnique))));
|
|
603
|
+
};
|
|
604
|
+
this.onCloseClick = () => {
|
|
605
|
+
var _a, _b;
|
|
606
|
+
this.pendingChallenges = (_a = this.pendingChallenges) === null || _a === void 0 ? void 0 : _a.filter((c) => c.Status === EChallengeProgressStatus.Awaiting);
|
|
607
|
+
this.activeChallenges = (_b = this.activeChallenges) === null || _b === void 0 ? void 0 : _b.filter((challenge) => !this.isInactiveChallenge(challenge));
|
|
608
|
+
this.detailsSubPageInfo = { open: false, tab: null };
|
|
609
|
+
this.loading = false;
|
|
610
|
+
this.isOptedOut = false;
|
|
611
|
+
this.handleClose();
|
|
612
|
+
};
|
|
613
|
+
this.mbSource = undefined;
|
|
614
|
+
this.clientStyling = undefined;
|
|
615
|
+
this.clientStylingUrl = undefined;
|
|
616
|
+
this.translationUrl = '';
|
|
617
|
+
this.language = 'en';
|
|
618
|
+
this.isOpen = false;
|
|
619
|
+
this.handleClose = () => { };
|
|
620
|
+
this.challenges = [];
|
|
621
|
+
this.initialProgressId = '';
|
|
622
|
+
this.activeChallenge = null;
|
|
623
|
+
this.activeProgressId = '';
|
|
624
|
+
this.activeTabIndex = exports.EChallengesTabs.Active;
|
|
625
|
+
this.error = '';
|
|
626
|
+
this.hasError = false;
|
|
627
|
+
this.swipped = false;
|
|
628
|
+
this.detailsSubPageInfo = undefined;
|
|
629
|
+
this.progress = 0;
|
|
630
|
+
this.loading = false;
|
|
631
|
+
this.notification = null;
|
|
632
|
+
this.optOutModaIsOpen = false;
|
|
633
|
+
this.isOptedOut = false;
|
|
634
|
+
this.prevUpdateEvent = undefined;
|
|
635
|
+
this.challengeGames = [];
|
|
636
|
+
this.activeChallenges = [];
|
|
637
|
+
this.pendingChallenges = [];
|
|
638
|
+
this.promoChallenges = [];
|
|
639
|
+
this.playerHistory = [];
|
|
640
|
+
this.hasMorePlayerHistory = false;
|
|
641
|
+
this.emptyState = {
|
|
642
|
+
header: (_j = TRANSLATIONS[this.language]) === null || _j === void 0 ? void 0 : _j.activeTabEmptyHeader,
|
|
643
|
+
description: (_k = TRANSLATIONS[this.language]) === null || _k === void 0 ? void 0 : _k.activeTabEmptyDescription
|
|
644
|
+
};
|
|
645
|
+
}
|
|
646
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
647
|
+
if (newValue != oldValue) {
|
|
648
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
handleClientStylingUrlChange(newValue, oldValue) {
|
|
652
|
+
if (newValue != oldValue) {
|
|
653
|
+
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
handleMbSourceChange(newValue, oldValue) {
|
|
657
|
+
if (newValue != oldValue) {
|
|
658
|
+
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
handleIsOpenChange(newValue) {
|
|
662
|
+
var _a;
|
|
663
|
+
if (newValue) {
|
|
664
|
+
if (this.initialProgressId && this.challenges.length) {
|
|
665
|
+
this.activeTabIndex = exports.EChallengesTabs.Active;
|
|
666
|
+
this.activeProgressId = this.initialProgressId;
|
|
667
|
+
const currentChallenge = ((_a = this.activeChallenges) === null || _a === void 0 ? void 0 : _a.find((x) => x.Id === this.activeProgressId)) || this.activeChallenges[0];
|
|
668
|
+
this.updateActiveChallenge(currentChallenge || null);
|
|
669
|
+
}
|
|
670
|
+
else {
|
|
671
|
+
this.activeTabIndex = exports.EChallengesTabs.Promo;
|
|
672
|
+
window.postMessage({
|
|
673
|
+
type: exports.EPostMessageRequestType.ChallengePromoTab,
|
|
674
|
+
data: {}
|
|
675
|
+
});
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
onActiveChallengeChanged() {
|
|
680
|
+
this.challengeGames = [];
|
|
681
|
+
}
|
|
682
|
+
onOpenOptOut() {
|
|
683
|
+
this.optOutModaIsOpen = true;
|
|
684
|
+
}
|
|
685
|
+
onCloseOptOut() {
|
|
686
|
+
this.optOutModaIsOpen = false;
|
|
687
|
+
}
|
|
688
|
+
onConfirmOptOut() {
|
|
689
|
+
window.postMessage({
|
|
690
|
+
type: exports.EPostMessageRequestType.ForfeitChallenge,
|
|
691
|
+
data: {
|
|
692
|
+
ChallengeId: this.activeChallenge.ChallengeId
|
|
693
|
+
}
|
|
694
|
+
});
|
|
695
|
+
}
|
|
696
|
+
onChallengeExpired(event) {
|
|
697
|
+
if (!(event === null || event === void 0 ? void 0 : event.detail)) {
|
|
698
|
+
return;
|
|
699
|
+
}
|
|
700
|
+
switch (this.activeTabIndex) {
|
|
701
|
+
case exports.EChallengesTabs.Active:
|
|
702
|
+
this.activeChallenges = this.updateChallenge(this.activeChallenges, event.detail, {
|
|
703
|
+
Status: EChallengeProgressStatus.Expired
|
|
704
|
+
});
|
|
705
|
+
break;
|
|
706
|
+
case exports.EChallengesTabs.Pending:
|
|
707
|
+
this.pendingChallenges = this.updateChallenge(this.pendingChallenges, event.detail, {
|
|
708
|
+
Status: EChallengeProgressStatus.Expired
|
|
709
|
+
});
|
|
710
|
+
break;
|
|
711
|
+
case exports.EChallengesTabs.Promo:
|
|
712
|
+
this.promoChallenges = this.updateChallenge(this.promoChallenges, event.detail, {
|
|
713
|
+
Status: EChallengeProgressStatus.Expired
|
|
714
|
+
});
|
|
715
|
+
break;
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
handleEvent(e) {
|
|
719
|
+
var _a, _b, _c, _d;
|
|
720
|
+
const { type, data, success, errorMessage } = e === null || e === void 0 ? void 0 : e.data;
|
|
721
|
+
console.log('\nReceived event: ', e === null || e === void 0 ? void 0 : e.data.type);
|
|
722
|
+
console.log(e); // left here temporarily for debugging in the developer environment
|
|
723
|
+
switch (type) {
|
|
724
|
+
case EPostMessageResponseType.ChallengePromoTab: {
|
|
725
|
+
if (success) {
|
|
726
|
+
this.promoChallenges = data || [];
|
|
727
|
+
this.updateActiveChallenge(this.promoChallenges[0]);
|
|
728
|
+
}
|
|
729
|
+
else {
|
|
730
|
+
this.promoChallenges = [];
|
|
731
|
+
this.updateActiveChallenge(null);
|
|
732
|
+
this.openNotification({ message: errorMessage, errored: true });
|
|
733
|
+
}
|
|
734
|
+
this.loading = false;
|
|
735
|
+
break;
|
|
736
|
+
}
|
|
737
|
+
case EPostMessageResponseType.ChallengesHistory: {
|
|
738
|
+
if (success) {
|
|
739
|
+
if (this.playerHistory.length < ((_a = e === null || e === void 0 ? void 0 : e.data) === null || _a === void 0 ? void 0 : _a.totalItem)) {
|
|
740
|
+
this.playerHistory = [...this.playerHistory, ...data];
|
|
741
|
+
}
|
|
742
|
+
else {
|
|
743
|
+
this.playerHistory = data;
|
|
744
|
+
}
|
|
745
|
+
this.hasMorePlayerHistory = ((_b = e === null || e === void 0 ? void 0 : e.data) === null || _b === void 0 ? void 0 : _b.totalItem) > this.playerHistory.length;
|
|
746
|
+
}
|
|
747
|
+
else {
|
|
748
|
+
this.openNotification({ message: errorMessage, errored: true });
|
|
749
|
+
}
|
|
750
|
+
this.loading = false;
|
|
751
|
+
break;
|
|
752
|
+
}
|
|
753
|
+
case EPostMessageResponseType.ClaimChallengeByCode: {
|
|
754
|
+
if (success) {
|
|
755
|
+
this.openNotification({ message: translate('claimCodeSuccessMessage', this.language) });
|
|
756
|
+
this.activeChallenges = [...this.activeChallenges, data];
|
|
757
|
+
}
|
|
758
|
+
else {
|
|
759
|
+
this.openNotification({ message: errorMessage, errored: true });
|
|
760
|
+
}
|
|
761
|
+
this.loading = false;
|
|
762
|
+
break;
|
|
763
|
+
}
|
|
764
|
+
case EPostMessageResponseType.ChallengeJoin: {
|
|
765
|
+
if (success) {
|
|
766
|
+
const isJoining = [EChallengeProgressStatus.Paused, EChallengeProgressStatus.Started].includes((_c = this.activeChallenge) === null || _c === void 0 ? void 0 : _c.Status);
|
|
767
|
+
const id = isJoining ? data === null || data === void 0 ? void 0 : data.joinId : data === null || data === void 0 ? void 0 : data.unjoinId;
|
|
768
|
+
const status = isJoining ? EChallengeProgressStatus.InProgress : EChallengeProgressStatus.Paused;
|
|
769
|
+
this.activeChallenges = this.updateChallenge(this.activeChallenges, id, {
|
|
770
|
+
Status: status
|
|
771
|
+
});
|
|
772
|
+
}
|
|
773
|
+
else {
|
|
774
|
+
this.openNotification({ message: errorMessage, errored: true });
|
|
775
|
+
}
|
|
776
|
+
this.loading = false;
|
|
777
|
+
break;
|
|
778
|
+
}
|
|
779
|
+
case EPostMessageResponseType.ChallengeIsNew: {
|
|
780
|
+
if (success) {
|
|
781
|
+
this.updateChallengeByProgressId(data === null || data === void 0 ? void 0 : data.challengeProgressId, { IsNew: false });
|
|
782
|
+
}
|
|
783
|
+
else {
|
|
784
|
+
this.openNotification({ message: errorMessage, errored: true });
|
|
785
|
+
}
|
|
786
|
+
break;
|
|
787
|
+
}
|
|
788
|
+
case EPostMessageResponseType.GetChallengeGames: {
|
|
789
|
+
if (success) {
|
|
790
|
+
this.challengeGames = data;
|
|
791
|
+
}
|
|
792
|
+
else {
|
|
793
|
+
this.openNotification({ message: errorMessage, errored: true });
|
|
794
|
+
}
|
|
795
|
+
this.loading = false;
|
|
796
|
+
break;
|
|
797
|
+
}
|
|
798
|
+
case EPostMessageResponseType.ClaimChallengeByButton: {
|
|
799
|
+
if (success) {
|
|
800
|
+
const challenge = Array.isArray(data) ? data[0] : data;
|
|
801
|
+
if (challenge) {
|
|
802
|
+
challenge.IsNew = false;
|
|
803
|
+
this.activeChallenges = [...this.activeChallenges, challenge];
|
|
804
|
+
this.updateActiveChallenge(challenge);
|
|
805
|
+
this.activeTabIndex = exports.EChallengesTabs.Active;
|
|
806
|
+
this.openNotification({ message: translate('grantClaimByButtonSuccessMessage', this.language) });
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
else {
|
|
810
|
+
this.openNotification({ message: errorMessage, errored: true });
|
|
811
|
+
}
|
|
812
|
+
this.loading = false;
|
|
813
|
+
break;
|
|
814
|
+
}
|
|
815
|
+
case EPostMessageResponseType.ForfeitChallenge: {
|
|
816
|
+
this.optOutModaIsOpen = false;
|
|
817
|
+
if (success) {
|
|
818
|
+
this.openNotification({ message: translate('optOutSuccessMessage', this.language) });
|
|
819
|
+
this.detailsSubPageInfo = { open: false, tab: null };
|
|
820
|
+
this.isOptedOut = true;
|
|
821
|
+
}
|
|
822
|
+
else {
|
|
823
|
+
this.openNotification({ message: errorMessage, errored: true });
|
|
824
|
+
}
|
|
825
|
+
this.loading = false;
|
|
826
|
+
break;
|
|
827
|
+
}
|
|
828
|
+
//
|
|
829
|
+
case EPostMessageResponseType.ChangeChallengeProgressStatus: {
|
|
830
|
+
this.updateChallengeByProgressId(data === null || data === void 0 ? void 0 : data.ChallengeProgressId, { Status: data === null || data === void 0 ? void 0 : data.ChallengeProgressStatus });
|
|
831
|
+
break;
|
|
832
|
+
}
|
|
833
|
+
case EPostMessageResponseType.ChallengeChangeStatusNotification: {
|
|
834
|
+
this.updateChallengeById(data === null || data === void 0 ? void 0 : data.ChallengeId, {
|
|
835
|
+
ChallengeStatus: (data === null || data === void 0 ? void 0 : data.IsEnabled) ? EChallengeStatus.Enabled : EChallengeStatus.Paused
|
|
836
|
+
});
|
|
837
|
+
break;
|
|
838
|
+
}
|
|
839
|
+
case EPostMessageResponseType.ChallengeForfeitNotification: {
|
|
840
|
+
this.updateChallengeById(data === null || data === void 0 ? void 0 : data.ChallengeId, { Status: EChallengeProgressStatus.Forfeited });
|
|
841
|
+
break;
|
|
842
|
+
}
|
|
843
|
+
case EPostMessageResponseType.UpdateChallengeProgress: {
|
|
844
|
+
const newChallenge = data;
|
|
845
|
+
if (!hasUpdateDataChanged(this.prevUpdateEvent, newChallenge)) {
|
|
846
|
+
return;
|
|
847
|
+
}
|
|
848
|
+
this.prevUpdateEvent = newChallenge;
|
|
849
|
+
this.activeChallenges = (_d = this.activeChallenges) === null || _d === void 0 ? void 0 : _d.map((challenge) => {
|
|
850
|
+
if (challenge.Id !== (newChallenge === null || newChallenge === void 0 ? void 0 : newChallenge.ProgressId))
|
|
851
|
+
return challenge;
|
|
852
|
+
const updatedLevels = challenge.LevelProgresses.map((level) => {
|
|
853
|
+
const newLevelData = newChallenge === null || newChallenge === void 0 ? void 0 : newChallenge.Levels.find((l) => l.LevelId === level.LevelId);
|
|
854
|
+
if (!newLevelData)
|
|
855
|
+
return level;
|
|
856
|
+
return Object.assign(Object.assign({}, level), { ProgressStatus: newLevelData.ProgressStatus, ProgressPercentage: newLevelData.ProgressPercentage });
|
|
857
|
+
});
|
|
858
|
+
return Object.assign(Object.assign({}, challenge), { Status: newChallenge === null || newChallenge === void 0 ? void 0 : newChallenge.Status, LevelProgresses: updatedLevels });
|
|
859
|
+
});
|
|
860
|
+
break;
|
|
861
|
+
}
|
|
862
|
+
case EPostMessageResponseType.NewChallengeProgressGranted:
|
|
863
|
+
const isPending = (data === null || data === void 0 ? void 0 : data.Status) === EChallengeProgressStatus.Awaiting;
|
|
864
|
+
const challenges = isPending ? this.pendingChallenges : this.activeChallenges;
|
|
865
|
+
if (challenges === null || challenges === void 0 ? void 0 : challenges.some((x) => x.Id === (data === null || data === void 0 ? void 0 : data.Id)))
|
|
866
|
+
break;
|
|
867
|
+
if (isPending) {
|
|
868
|
+
this.pendingChallenges = [...challenges, data];
|
|
869
|
+
}
|
|
870
|
+
else {
|
|
871
|
+
this.activeChallenges = [...challenges, data];
|
|
872
|
+
}
|
|
873
|
+
break;
|
|
874
|
+
// component loading state processing for requests
|
|
875
|
+
case exports.EPostMessageRequestType.ChallengeJoin:
|
|
876
|
+
case exports.EPostMessageRequestType.GetChallengeGames:
|
|
877
|
+
case exports.EPostMessageRequestType.ClaimChallengeByButton:
|
|
878
|
+
case exports.EPostMessageRequestType.RedirectToDepositPage:
|
|
879
|
+
case exports.EPostMessageRequestType.ChallengeInGameRedirect:
|
|
880
|
+
case exports.EPostMessageRequestType.ChallengesHistory:
|
|
881
|
+
case exports.EPostMessageRequestType.ChallengePromoTab:
|
|
882
|
+
case exports.EPostMessageRequestType.ClaimChallengeByCode:
|
|
883
|
+
case exports.EPostMessageRequestType.ForfeitChallenge:
|
|
884
|
+
this.loading = true;
|
|
885
|
+
break;
|
|
886
|
+
}
|
|
887
|
+
}
|
|
888
|
+
componentWillLoad() {
|
|
889
|
+
var _a;
|
|
890
|
+
if (this.translationUrl) {
|
|
891
|
+
resolveTranslationUrl(this.translationUrl);
|
|
892
|
+
}
|
|
893
|
+
if ((_a = this.challenges) === null || _a === void 0 ? void 0 : _a.length) {
|
|
894
|
+
const challenges = [...this.challenges];
|
|
895
|
+
this.pendingChallenges = challenges.filter((c) => c.Status === EChallengeProgressStatus.Awaiting);
|
|
896
|
+
this.activeChallenges = challenges.filter((challenge) => !this.isInactiveChallenge(challenge));
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
componentDidLoad() {
|
|
900
|
+
if (this.stylingContainer) {
|
|
901
|
+
if (this.mbSource)
|
|
902
|
+
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
903
|
+
if (this.clientStyling)
|
|
904
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
905
|
+
if (this.clientStylingUrl)
|
|
906
|
+
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
disconnectedCallback() {
|
|
910
|
+
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
911
|
+
}
|
|
912
|
+
updateChallenge(challenges, progressId, updates) {
|
|
913
|
+
var _a;
|
|
914
|
+
if (((_a = this.activeChallenge) === null || _a === void 0 ? void 0 : _a.Id) === progressId) {
|
|
915
|
+
this.activeChallenge = Object.assign(Object.assign({}, this.activeChallenge), updates);
|
|
916
|
+
}
|
|
917
|
+
return challenges.map((challenge) => (challenge.Id === progressId ? Object.assign(Object.assign({}, challenge), updates) : challenge));
|
|
918
|
+
}
|
|
919
|
+
updateChallengeList(list, challengeId, updates) {
|
|
920
|
+
let changed = false;
|
|
921
|
+
const updated = list.map((challenge) => {
|
|
922
|
+
if (challenge.ChallengeId === challengeId) {
|
|
923
|
+
changed = true;
|
|
924
|
+
return Object.assign(Object.assign({}, challenge), updates);
|
|
925
|
+
}
|
|
926
|
+
return challenge;
|
|
927
|
+
});
|
|
928
|
+
return changed ? updated : list;
|
|
929
|
+
}
|
|
930
|
+
updateChallengeById(challengeId, updates) {
|
|
931
|
+
var _a;
|
|
932
|
+
if (((_a = this.activeChallenge) === null || _a === void 0 ? void 0 : _a.ChallengeId) === challengeId) {
|
|
933
|
+
this.activeChallenge = Object.assign(Object.assign({}, this.activeChallenge), updates);
|
|
934
|
+
}
|
|
935
|
+
this.activeChallenges = this.updateChallengeList(this.activeChallenges, challengeId, updates);
|
|
936
|
+
this.pendingChallenges = this.updateChallengeList(this.pendingChallenges, challengeId, updates);
|
|
937
|
+
this.promoChallenges = this.updateChallengeList(this.promoChallenges, challengeId, updates);
|
|
938
|
+
}
|
|
939
|
+
updateChallengeByProgressId(progressId, updates) {
|
|
940
|
+
var _a;
|
|
941
|
+
if (((_a = this.activeChallenge) === null || _a === void 0 ? void 0 : _a.Id) === progressId) {
|
|
942
|
+
this.activeChallenge = Object.assign(Object.assign({}, this.activeChallenge), updates);
|
|
943
|
+
}
|
|
944
|
+
if (this.activeChallenges.find((x) => x.Id === progressId)) {
|
|
945
|
+
this.activeChallenges = this.activeChallenges.map((challenge) => challenge.Id === progressId ? Object.assign(Object.assign({}, challenge), updates) : challenge);
|
|
946
|
+
}
|
|
947
|
+
else if (this.pendingChallenges.find((x) => x.Id === progressId)) {
|
|
948
|
+
this.pendingChallenges = this.pendingChallenges.map((challenge) => challenge.Id === progressId ? Object.assign(Object.assign({}, challenge), updates) : challenge);
|
|
949
|
+
}
|
|
950
|
+
else {
|
|
951
|
+
this.promoChallenges = this.promoChallenges.map((challenge) => challenge.Id === progressId ? Object.assign(Object.assign({}, challenge), updates) : challenge);
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
renderContent(isMobile, showEmptyState) {
|
|
955
|
+
var _a;
|
|
956
|
+
if (showEmptyState) {
|
|
957
|
+
return this.renderEmptyState(isMobile);
|
|
958
|
+
}
|
|
959
|
+
if ((_a = this.detailsSubPageInfo) === null || _a === void 0 ? void 0 : _a.open) {
|
|
960
|
+
return (index.h("div", { class: "content-sub-page", slot: "details" }, this.renderChallengeDetails(isMobile)));
|
|
961
|
+
}
|
|
962
|
+
switch (this.activeTabIndex) {
|
|
963
|
+
case exports.EChallengesTabs.Promo:
|
|
964
|
+
case exports.EChallengesTabs.Active:
|
|
965
|
+
case exports.EChallengesTabs.Pending:
|
|
966
|
+
return this.renderChallengesTabs(isMobile);
|
|
967
|
+
case exports.EChallengesTabs.Code:
|
|
968
|
+
return this.renderCodeTab(isMobile);
|
|
969
|
+
case exports.EChallengesTabs.Finished:
|
|
970
|
+
return this.renderFinishedTab(isMobile);
|
|
971
|
+
default:
|
|
972
|
+
return;
|
|
973
|
+
}
|
|
974
|
+
}
|
|
975
|
+
render() {
|
|
976
|
+
if (!this.isOpen) {
|
|
977
|
+
return;
|
|
978
|
+
}
|
|
979
|
+
const isMobile$1 = isMobile() || window.innerWidth <= 768;
|
|
980
|
+
const showEmptyState = this.isEmptyState();
|
|
981
|
+
return (index.h("div", { ref: (el) => (this.stylingContainer = el), class: {
|
|
982
|
+
container: true,
|
|
983
|
+
mobile: isMobile$1
|
|
984
|
+
} }, index.h("div", { class: "challenges__backdrop", onClick: this.onCloseClick }), index.h("div", { class: "challenges__drawer" }, index.h("casino-challenge-overlay-background", { empty: showEmptyState }), index.h("div", { class: "challenges__drawer__content" }, this.renderContent(isMobile$1, showEmptyState)), this.loading && index.h("casino-challenges-overlay-loader", { "full-size": true, "is-mobile": isMobile$1 }), index.h("casino-challenge-opt-out-modal", { open: this.optOutModaIsOpen, "is-mobile": isMobile$1, language: this.language })), this.notification && this.renderNotification()));
|
|
985
|
+
}
|
|
986
|
+
static get watchers() { return {
|
|
987
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
988
|
+
"clientStylingUrl": ["handleClientStylingUrlChange"],
|
|
989
|
+
"mbSource": ["handleMbSourceChange"],
|
|
990
|
+
"isOpen": ["handleIsOpenChange"],
|
|
991
|
+
"activeChallenge": ["onActiveChallengeChanged"]
|
|
992
|
+
}; }
|
|
993
|
+
};
|
|
994
|
+
CasinoChallengesOverlayDrawer.style = CasinoChallengesOverlayDrawerStyle0;
|
|
995
|
+
|
|
996
|
+
exports.CasinoChallengesOverlayDrawer = CasinoChallengesOverlayDrawer;
|
|
997
|
+
exports.HistoryItemLevelStatusDictionary = HistoryItemLevelStatusDictionary;
|
|
998
|
+
exports.resolveTranslationUrl = resolveTranslationUrl;
|
|
999
|
+
exports.setClientStyling = setClientStyling;
|
|
1000
|
+
exports.setClientStylingURL = setClientStylingURL;
|
|
1001
|
+
exports.setStreamStyling = setStreamStyling;
|
|
1002
|
+
exports.translate = translate;
|