@everymatrix/casino-challenges-overlay 0.8.3 → 0.8.4
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/casino-challenges-overlay-1cfb642b.js +1 -0
- package/dist/casino-challenges-overlay/casino-challenges-overlay.esm.js +1 -1
- package/dist/casino-challenges-overlay/casino-challenges-overlay_2.entry.js +1 -1
- package/dist/casino-challenges-overlay/{index-2a6b741f.js → index-4cb6ae8e.js} +2 -2
- package/dist/casino-challenges-overlay/index.esm.js +1 -1
- package/dist/cjs/{casino-challenges-overlay-e5c0312c.js → casino-challenges-overlay-0e57b7bc.js} +46 -57
- package/dist/cjs/casino-challenges-overlay.cjs.js +2 -2
- package/dist/cjs/casino-challenges-overlay_2.cjs.entry.js +16 -19
- package/dist/cjs/{index-b8de8a8c.js → index-3b105378.js} +4 -1
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/components/casino-challenges-overlay/casino-challenges-overlay.js +47 -62
- package/dist/esm/{casino-challenges-overlay-31a3a3c8.js → casino-challenges-overlay-1cfb642b.js} +46 -57
- package/dist/esm/casino-challenges-overlay.js +3 -3
- package/dist/esm/casino-challenges-overlay_2.entry.js +17 -20
- package/dist/esm/{index-2a6b741f.js → index-4cb6ae8e.js} +4 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/loader.js +3 -3
- package/dist/types/components/casino-challenges-overlay/casino-challenges-overlay.d.ts +6 -9
- package/package.json +1 -1
- package/dist/casino-challenges-overlay/casino-challenges-overlay-31a3a3c8.js +0 -1
|
@@ -9,6 +9,24 @@ import "../../../../../casino-challenges-overlay-modal/dist/types/index";
|
|
|
9
9
|
export class CasinoChallengesOverlay {
|
|
10
10
|
constructor() {
|
|
11
11
|
this.activeTabIndex = 0;
|
|
12
|
+
this.updateChallengesArray = (challengeId, isEnabled, isExpired) => {
|
|
13
|
+
this.challenges = this.challenges.map((challenge) => {
|
|
14
|
+
if (challenge.ChallengeId !== challengeId) {
|
|
15
|
+
return challenge;
|
|
16
|
+
}
|
|
17
|
+
if (isEnabled === true) {
|
|
18
|
+
return Object.assign(Object.assign({}, challenge), { Status: EChallengeProgressStatus.InProgress });
|
|
19
|
+
}
|
|
20
|
+
return Object.assign(Object.assign({}, challenge), { Status: isExpired ? EChallengeProgressStatus.Expired : EChallengeProgressStatus.Forfeited });
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
this.closeModal = () => {
|
|
24
|
+
this.showModal = false;
|
|
25
|
+
this.modalOrderNumber = 1;
|
|
26
|
+
this.modalErrored = false;
|
|
27
|
+
this.modalReward = '';
|
|
28
|
+
this.modalAddition = false;
|
|
29
|
+
};
|
|
12
30
|
this.goToDetailsPage = () => {
|
|
13
31
|
window.postMessage({
|
|
14
32
|
type: 'GoToDetailsPage',
|
|
@@ -34,14 +52,10 @@ export class CasinoChallengesOverlay {
|
|
|
34
52
|
this.completedLevelId = '';
|
|
35
53
|
this.prevUpdateEvent = undefined;
|
|
36
54
|
this.showModal = false;
|
|
37
|
-
this.
|
|
38
|
-
this.modalSubTitle = '';
|
|
39
|
-
this.modalBtnText = '';
|
|
40
|
-
this.modalShowIcon = true;
|
|
55
|
+
this.modalErrored = false;
|
|
41
56
|
this.modalReward = '';
|
|
42
|
-
this.modalAddition =
|
|
43
|
-
this.
|
|
44
|
-
this.modalAdditionText = '';
|
|
57
|
+
this.modalAddition = false;
|
|
58
|
+
this.modalOrderNumber = 1;
|
|
45
59
|
}
|
|
46
60
|
handleClientStylingChange(newValue, oldValue) {
|
|
47
61
|
if (newValue != oldValue) {
|
|
@@ -61,13 +75,19 @@ export class CasinoChallengesOverlay {
|
|
|
61
75
|
handleChallengesChange(newValue) {
|
|
62
76
|
if (Array.isArray(newValue)) {
|
|
63
77
|
let maxPercentage = 0;
|
|
64
|
-
const
|
|
78
|
+
const now = Date.now();
|
|
79
|
+
const filteredChallenges = (newValue !== null && newValue !== void 0 ? newValue : []).filter((x) => {
|
|
80
|
+
const expirationTime = new Date(x.ExpirationTime).getTime();
|
|
81
|
+
return (expirationTime > now &&
|
|
82
|
+
[EChallengeProgressStatus.InProgress, EChallengeProgressStatus.PendingLevelReward].includes(x.Status));
|
|
83
|
+
});
|
|
65
84
|
for (const challenge of filteredChallenges) {
|
|
66
85
|
for (const level of challenge.LevelProgresses) {
|
|
67
86
|
if (level.ProgressStatus === EChallengeProgressLevelStatus.InProgress) {
|
|
68
87
|
if (level.ProgressPercentage >= maxPercentage) {
|
|
69
88
|
maxPercentage = level.ProgressPercentage;
|
|
70
89
|
this.activeChallenge = challenge.ChallengeId;
|
|
90
|
+
this.isGrayed = false;
|
|
71
91
|
}
|
|
72
92
|
}
|
|
73
93
|
}
|
|
@@ -77,7 +97,7 @@ export class CasinoChallengesOverlay {
|
|
|
77
97
|
}
|
|
78
98
|
}
|
|
79
99
|
handleEvent(e) {
|
|
80
|
-
var _a, _b, _c, _d;
|
|
100
|
+
var _a, _b, _c, _d, _e, _f;
|
|
81
101
|
const { type, data } = e === null || e === void 0 ? void 0 : e.data;
|
|
82
102
|
switch (type) {
|
|
83
103
|
case 'UpdateChallengeProgress': {
|
|
@@ -126,27 +146,17 @@ export class CasinoChallengesOverlay {
|
|
|
126
146
|
case 'ShowChallengeRewardModal': {
|
|
127
147
|
this.showModal = true;
|
|
128
148
|
if (data === null || data === void 0 ? void 0 : data.HasError) {
|
|
129
|
-
this.
|
|
130
|
-
this.modalSubTitle = translate('errorSubTitle', this.language);
|
|
131
|
-
this.modalBtnText = translate('errorBtnText', this.language);
|
|
132
|
-
this.modalShowIcon = false;
|
|
149
|
+
this.modalErrored = true;
|
|
133
150
|
}
|
|
134
151
|
else {
|
|
135
|
-
|
|
152
|
+
this.modalErrored = false;
|
|
153
|
+
const completedLevel = (_d = (_c = (_b = this.challenges) === null || _b === void 0 ? void 0 : _b.find(({ Id }) => Id === (data === null || data === void 0 ? void 0 : data.ChallengeProgressId))) === null || _c === void 0 ? void 0 : _c.LevelProgresses.find(({ LevelId }) => LevelId === (data === null || data === void 0 ? void 0 : data.LevelId))) !== null && _d !== void 0 ? _d : null;
|
|
136
154
|
if (!completedLevel) {
|
|
137
155
|
return this.closeModal();
|
|
138
156
|
}
|
|
139
|
-
this.
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
translate('completed', this.language);
|
|
143
|
-
this.modalReward =
|
|
144
|
-
completedLevel.Rewards.map((reward) => reward.RewardDescription).join(' + ') ||
|
|
145
|
-
completedLevel.CustomRewardMessage;
|
|
146
|
-
if (completedLevel.Rewards.some((x) => x.Type === EChallengeRewardType.Custom)) {
|
|
147
|
-
this.modalAddition = translate('physicalReward', this.language);
|
|
148
|
-
this.modalAdditionText = translate('linkText', this.language);
|
|
149
|
-
}
|
|
157
|
+
this.modalOrderNumber = (completedLevel === null || completedLevel === void 0 ? void 0 : completedLevel.OrderNumber) + 1;
|
|
158
|
+
this.modalReward = completedLevel === null || completedLevel === void 0 ? void 0 : completedLevel.CustomRewardMessage;
|
|
159
|
+
this.modalAddition = (_e = completedLevel === null || completedLevel === void 0 ? void 0 : completedLevel.Rewards) === null || _e === void 0 ? void 0 : _e.some((x) => x.Type === EChallengeRewardType.Custom);
|
|
150
160
|
}
|
|
151
161
|
break;
|
|
152
162
|
}
|
|
@@ -154,7 +164,7 @@ export class CasinoChallengesOverlay {
|
|
|
154
164
|
this.handleStatusEvent(data);
|
|
155
165
|
}
|
|
156
166
|
case 'ChangeChallengeProgressStatus': {
|
|
157
|
-
this.challenges = (
|
|
167
|
+
this.challenges = (_f = this.challenges) === null || _f === void 0 ? void 0 : _f.map((x) => x.Id === (data === null || data === void 0 ? void 0 : data.ChallengeProgressId) ? Object.assign(Object.assign({}, x), { Status: data === null || data === void 0 ? void 0 : data.ChallengeProgressStatus }) : x);
|
|
158
168
|
}
|
|
159
169
|
}
|
|
160
170
|
}
|
|
@@ -176,37 +186,26 @@ export class CasinoChallengesOverlay {
|
|
|
176
186
|
}
|
|
177
187
|
return false;
|
|
178
188
|
}
|
|
179
|
-
handleStatusEvent(data) {
|
|
180
|
-
const newChallenges = [...this.challenges];
|
|
181
|
-
newChallenges.forEach(({ ChallengeId }, i) => {
|
|
182
|
-
if ((data === null || data === void 0 ? void 0 : data.ChallengeId) === ChallengeId) {
|
|
183
|
-
if ((data === null || data === void 0 ? void 0 : data.IsEnabled) === true) {
|
|
184
|
-
newChallenges[i] = Object.assign(Object.assign({}, newChallenges[i]), { Status: EChallengeProgressStatus.InProgress });
|
|
185
|
-
this.challenges = newChallenges;
|
|
186
|
-
return;
|
|
187
|
-
}
|
|
188
|
-
else {
|
|
189
|
-
newChallenges[i] = Object.assign(Object.assign({}, newChallenges[i]), { Status: EChallengeProgressStatus.Forfeited });
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
});
|
|
189
|
+
handleStatusEvent(data, isExpired) {
|
|
193
190
|
if ((data === null || data === void 0 ? void 0 : data.ChallengeId) === this.activeChallenge) {
|
|
194
191
|
this.isNotification = true;
|
|
195
192
|
if (this.inProgressCount === 1) {
|
|
196
193
|
setTimeout(() => {
|
|
197
|
-
this.
|
|
194
|
+
if ((data === null || data === void 0 ? void 0 : data.ChallengeId) === this.activeChallenge) {
|
|
195
|
+
this.isGrayed = true;
|
|
196
|
+
}
|
|
198
197
|
this.isNotification = false;
|
|
199
198
|
}, 10000);
|
|
200
199
|
}
|
|
201
200
|
else if (this.inProgressCount > 1) {
|
|
202
201
|
setTimeout(() => {
|
|
203
|
-
this.
|
|
202
|
+
this.updateChallengesArray(data === null || data === void 0 ? void 0 : data.ChallengeId, data === null || data === void 0 ? void 0 : data.IsEnabled, isExpired);
|
|
204
203
|
this.isNotification = false;
|
|
205
204
|
}, 10000);
|
|
206
205
|
}
|
|
207
206
|
}
|
|
208
207
|
else {
|
|
209
|
-
this.
|
|
208
|
+
this.updateChallengesArray(data === null || data === void 0 ? void 0 : data.ChallengeId, data === null || data === void 0 ? void 0 : data.IsEnabled, isExpired);
|
|
210
209
|
}
|
|
211
210
|
}
|
|
212
211
|
componentWillLoad() {
|
|
@@ -235,7 +234,7 @@ export class CasinoChallengesOverlay {
|
|
|
235
234
|
this.challenges.map((item) => {
|
|
236
235
|
const expirationTime = new Date(item.ExpirationTime).getTime();
|
|
237
236
|
if (item.Status !== EChallengeProgressStatus.Expired && expirationTime <= now) {
|
|
238
|
-
this.handleStatusEvent({ ChallengeId: item.ChallengeId });
|
|
237
|
+
this.handleStatusEvent({ ChallengeId: item.ChallengeId }, true);
|
|
239
238
|
}
|
|
240
239
|
return item;
|
|
241
240
|
});
|
|
@@ -324,16 +323,6 @@ export class CasinoChallengesOverlay {
|
|
|
324
323
|
return h("img", { class: "icon", src: icon });
|
|
325
324
|
return h("div", { class: "gradient-text" }, this.inProgressCount);
|
|
326
325
|
}
|
|
327
|
-
closeModal() {
|
|
328
|
-
this.showModal = false;
|
|
329
|
-
this.modalTitle = '';
|
|
330
|
-
this.modalSubTitle = '';
|
|
331
|
-
this.modalBtnText = '';
|
|
332
|
-
this.modalShowIcon = true;
|
|
333
|
-
this.modalReward = '';
|
|
334
|
-
this.modalAddition = '';
|
|
335
|
-
this.modalAdditionText = '';
|
|
336
|
-
}
|
|
337
326
|
/**
|
|
338
327
|
* Called to initialize widget
|
|
339
328
|
* @param config
|
|
@@ -347,12 +336,12 @@ export class CasinoChallengesOverlay {
|
|
|
347
336
|
}
|
|
348
337
|
const currProgress = this.completedLevelId ? 100 : this.progress;
|
|
349
338
|
const dot = this.getCapsuleDotPosition(currProgress);
|
|
350
|
-
return (h("div", { class: "container", onClick: this.goToDetailsPage }, h("div", { class: `circle ${this.isGrayed ? 'grayed' : ''}`, style: {
|
|
339
|
+
return (h("div", { ref: (el) => (this.stylingContainer = el) }, h("div", { class: "container", onClick: this.goToDetailsPage }, h("div", { class: `circle ${this.isGrayed ? 'grayed' : ''}`, style: {
|
|
351
340
|
'--progress': `${currProgress}%`
|
|
352
341
|
} }, h("img", { class: "circle__img", src: bgIcon }), h("div", { class: "circle__content" }, h("span", null, Math.floor(currProgress), "%")), dot && (h("div", { class: "dot", style: {
|
|
353
342
|
left: `${dot.x}px`,
|
|
354
343
|
top: `${dot.y}px`
|
|
355
|
-
} }))), !this.isGrayed && h("div", { class: `badge ${this.isNew ? 'new' : ''}` }, this.renderBadgeContent()), h("casino-challenges-overlay-modal", { isOpen: this.showModal, handleClick:
|
|
344
|
+
} }))), !this.isGrayed && h("div", { class: `badge ${this.isNew ? 'new' : ''}` }, this.renderBadgeContent())), h("casino-challenges-overlay-modal", { isOpen: this.showModal, handleClick: this.closeModal, reward: this.modalReward, addition: this.modalAddition, errored: this.modalErrored, orderNumber: this.modalOrderNumber })));
|
|
356
345
|
}
|
|
357
346
|
static get is() { return "casino-challenges-overlay"; }
|
|
358
347
|
static get encapsulation() { return "shadow"; }
|
|
@@ -490,14 +479,10 @@ export class CasinoChallengesOverlay {
|
|
|
490
479
|
"completedLevelId": {},
|
|
491
480
|
"prevUpdateEvent": {},
|
|
492
481
|
"showModal": {},
|
|
493
|
-
"
|
|
494
|
-
"modalSubTitle": {},
|
|
495
|
-
"modalBtnText": {},
|
|
496
|
-
"modalShowIcon": {},
|
|
482
|
+
"modalErrored": {},
|
|
497
483
|
"modalReward": {},
|
|
498
484
|
"modalAddition": {},
|
|
499
|
-
"
|
|
500
|
-
"modalAdditionText": {}
|
|
485
|
+
"modalOrderNumber": {}
|
|
501
486
|
};
|
|
502
487
|
}
|
|
503
488
|
static get methods() {
|
package/dist/esm/{casino-challenges-overlay-31a3a3c8.js → casino-challenges-overlay-1cfb642b.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, h } from './index-
|
|
1
|
+
import { r as registerInstance, h } from './index-4cb6ae8e.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @name setClientStyling
|
|
@@ -156,6 +156,24 @@ const CasinoChallengesOverlay = class {
|
|
|
156
156
|
constructor(hostRef) {
|
|
157
157
|
registerInstance(this, hostRef);
|
|
158
158
|
this.activeTabIndex = 0;
|
|
159
|
+
this.updateChallengesArray = (challengeId, isEnabled, isExpired) => {
|
|
160
|
+
this.challenges = this.challenges.map((challenge) => {
|
|
161
|
+
if (challenge.ChallengeId !== challengeId) {
|
|
162
|
+
return challenge;
|
|
163
|
+
}
|
|
164
|
+
if (isEnabled === true) {
|
|
165
|
+
return Object.assign(Object.assign({}, challenge), { Status: EChallengeProgressStatus.InProgress });
|
|
166
|
+
}
|
|
167
|
+
return Object.assign(Object.assign({}, challenge), { Status: isExpired ? EChallengeProgressStatus.Expired : EChallengeProgressStatus.Forfeited });
|
|
168
|
+
});
|
|
169
|
+
};
|
|
170
|
+
this.closeModal = () => {
|
|
171
|
+
this.showModal = false;
|
|
172
|
+
this.modalOrderNumber = 1;
|
|
173
|
+
this.modalErrored = false;
|
|
174
|
+
this.modalReward = '';
|
|
175
|
+
this.modalAddition = false;
|
|
176
|
+
};
|
|
159
177
|
this.goToDetailsPage = () => {
|
|
160
178
|
window.postMessage({
|
|
161
179
|
type: 'GoToDetailsPage',
|
|
@@ -181,14 +199,10 @@ const CasinoChallengesOverlay = class {
|
|
|
181
199
|
this.completedLevelId = '';
|
|
182
200
|
this.prevUpdateEvent = undefined;
|
|
183
201
|
this.showModal = false;
|
|
184
|
-
this.
|
|
185
|
-
this.modalSubTitle = '';
|
|
186
|
-
this.modalBtnText = '';
|
|
187
|
-
this.modalShowIcon = true;
|
|
202
|
+
this.modalErrored = false;
|
|
188
203
|
this.modalReward = '';
|
|
189
|
-
this.modalAddition =
|
|
190
|
-
this.
|
|
191
|
-
this.modalAdditionText = '';
|
|
204
|
+
this.modalAddition = false;
|
|
205
|
+
this.modalOrderNumber = 1;
|
|
192
206
|
}
|
|
193
207
|
handleClientStylingChange(newValue, oldValue) {
|
|
194
208
|
if (newValue != oldValue) {
|
|
@@ -208,13 +222,19 @@ const CasinoChallengesOverlay = class {
|
|
|
208
222
|
handleChallengesChange(newValue) {
|
|
209
223
|
if (Array.isArray(newValue)) {
|
|
210
224
|
let maxPercentage = 0;
|
|
211
|
-
const
|
|
225
|
+
const now = Date.now();
|
|
226
|
+
const filteredChallenges = (newValue !== null && newValue !== void 0 ? newValue : []).filter((x) => {
|
|
227
|
+
const expirationTime = new Date(x.ExpirationTime).getTime();
|
|
228
|
+
return (expirationTime > now &&
|
|
229
|
+
[EChallengeProgressStatus.InProgress, EChallengeProgressStatus.PendingLevelReward].includes(x.Status));
|
|
230
|
+
});
|
|
212
231
|
for (const challenge of filteredChallenges) {
|
|
213
232
|
for (const level of challenge.LevelProgresses) {
|
|
214
233
|
if (level.ProgressStatus === EChallengeProgressLevelStatus.InProgress) {
|
|
215
234
|
if (level.ProgressPercentage >= maxPercentage) {
|
|
216
235
|
maxPercentage = level.ProgressPercentage;
|
|
217
236
|
this.activeChallenge = challenge.ChallengeId;
|
|
237
|
+
this.isGrayed = false;
|
|
218
238
|
}
|
|
219
239
|
}
|
|
220
240
|
}
|
|
@@ -224,7 +244,7 @@ const CasinoChallengesOverlay = class {
|
|
|
224
244
|
}
|
|
225
245
|
}
|
|
226
246
|
handleEvent(e) {
|
|
227
|
-
var _a, _b, _c, _d;
|
|
247
|
+
var _a, _b, _c, _d, _e, _f;
|
|
228
248
|
const { type, data } = e === null || e === void 0 ? void 0 : e.data;
|
|
229
249
|
switch (type) {
|
|
230
250
|
case 'UpdateChallengeProgress': {
|
|
@@ -273,27 +293,17 @@ const CasinoChallengesOverlay = class {
|
|
|
273
293
|
case 'ShowChallengeRewardModal': {
|
|
274
294
|
this.showModal = true;
|
|
275
295
|
if (data === null || data === void 0 ? void 0 : data.HasError) {
|
|
276
|
-
this.
|
|
277
|
-
this.modalSubTitle = translate('errorSubTitle', this.language);
|
|
278
|
-
this.modalBtnText = translate('errorBtnText', this.language);
|
|
279
|
-
this.modalShowIcon = false;
|
|
296
|
+
this.modalErrored = true;
|
|
280
297
|
}
|
|
281
298
|
else {
|
|
282
|
-
|
|
299
|
+
this.modalErrored = false;
|
|
300
|
+
const completedLevel = (_d = (_c = (_b = this.challenges) === null || _b === void 0 ? void 0 : _b.find(({ Id }) => Id === (data === null || data === void 0 ? void 0 : data.ChallengeProgressId))) === null || _c === void 0 ? void 0 : _c.LevelProgresses.find(({ LevelId }) => LevelId === (data === null || data === void 0 ? void 0 : data.LevelId))) !== null && _d !== void 0 ? _d : null;
|
|
283
301
|
if (!completedLevel) {
|
|
284
302
|
return this.closeModal();
|
|
285
303
|
}
|
|
286
|
-
this.
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
translate('completed', this.language);
|
|
290
|
-
this.modalReward =
|
|
291
|
-
completedLevel.Rewards.map((reward) => reward.RewardDescription).join(' + ') ||
|
|
292
|
-
completedLevel.CustomRewardMessage;
|
|
293
|
-
if (completedLevel.Rewards.some((x) => x.Type === EChallengeRewardType.Custom)) {
|
|
294
|
-
this.modalAddition = translate('physicalReward', this.language);
|
|
295
|
-
this.modalAdditionText = translate('linkText', this.language);
|
|
296
|
-
}
|
|
304
|
+
this.modalOrderNumber = (completedLevel === null || completedLevel === void 0 ? void 0 : completedLevel.OrderNumber) + 1;
|
|
305
|
+
this.modalReward = completedLevel === null || completedLevel === void 0 ? void 0 : completedLevel.CustomRewardMessage;
|
|
306
|
+
this.modalAddition = (_e = completedLevel === null || completedLevel === void 0 ? void 0 : completedLevel.Rewards) === null || _e === void 0 ? void 0 : _e.some((x) => x.Type === EChallengeRewardType.Custom);
|
|
297
307
|
}
|
|
298
308
|
break;
|
|
299
309
|
}
|
|
@@ -301,7 +311,7 @@ const CasinoChallengesOverlay = class {
|
|
|
301
311
|
this.handleStatusEvent(data);
|
|
302
312
|
}
|
|
303
313
|
case 'ChangeChallengeProgressStatus': {
|
|
304
|
-
this.challenges = (
|
|
314
|
+
this.challenges = (_f = this.challenges) === null || _f === void 0 ? void 0 : _f.map((x) => x.Id === (data === null || data === void 0 ? void 0 : data.ChallengeProgressId) ? Object.assign(Object.assign({}, x), { Status: data === null || data === void 0 ? void 0 : data.ChallengeProgressStatus }) : x);
|
|
305
315
|
}
|
|
306
316
|
}
|
|
307
317
|
}
|
|
@@ -323,37 +333,26 @@ const CasinoChallengesOverlay = class {
|
|
|
323
333
|
}
|
|
324
334
|
return false;
|
|
325
335
|
}
|
|
326
|
-
handleStatusEvent(data) {
|
|
327
|
-
const newChallenges = [...this.challenges];
|
|
328
|
-
newChallenges.forEach(({ ChallengeId }, i) => {
|
|
329
|
-
if ((data === null || data === void 0 ? void 0 : data.ChallengeId) === ChallengeId) {
|
|
330
|
-
if ((data === null || data === void 0 ? void 0 : data.IsEnabled) === true) {
|
|
331
|
-
newChallenges[i] = Object.assign(Object.assign({}, newChallenges[i]), { Status: EChallengeProgressStatus.InProgress });
|
|
332
|
-
this.challenges = newChallenges;
|
|
333
|
-
return;
|
|
334
|
-
}
|
|
335
|
-
else {
|
|
336
|
-
newChallenges[i] = Object.assign(Object.assign({}, newChallenges[i]), { Status: EChallengeProgressStatus.Forfeited });
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
});
|
|
336
|
+
handleStatusEvent(data, isExpired) {
|
|
340
337
|
if ((data === null || data === void 0 ? void 0 : data.ChallengeId) === this.activeChallenge) {
|
|
341
338
|
this.isNotification = true;
|
|
342
339
|
if (this.inProgressCount === 1) {
|
|
343
340
|
setTimeout(() => {
|
|
344
|
-
this.
|
|
341
|
+
if ((data === null || data === void 0 ? void 0 : data.ChallengeId) === this.activeChallenge) {
|
|
342
|
+
this.isGrayed = true;
|
|
343
|
+
}
|
|
345
344
|
this.isNotification = false;
|
|
346
345
|
}, 10000);
|
|
347
346
|
}
|
|
348
347
|
else if (this.inProgressCount > 1) {
|
|
349
348
|
setTimeout(() => {
|
|
350
|
-
this.
|
|
349
|
+
this.updateChallengesArray(data === null || data === void 0 ? void 0 : data.ChallengeId, data === null || data === void 0 ? void 0 : data.IsEnabled, isExpired);
|
|
351
350
|
this.isNotification = false;
|
|
352
351
|
}, 10000);
|
|
353
352
|
}
|
|
354
353
|
}
|
|
355
354
|
else {
|
|
356
|
-
this.
|
|
355
|
+
this.updateChallengesArray(data === null || data === void 0 ? void 0 : data.ChallengeId, data === null || data === void 0 ? void 0 : data.IsEnabled, isExpired);
|
|
357
356
|
}
|
|
358
357
|
}
|
|
359
358
|
componentWillLoad() {
|
|
@@ -382,7 +381,7 @@ const CasinoChallengesOverlay = class {
|
|
|
382
381
|
this.challenges.map((item) => {
|
|
383
382
|
const expirationTime = new Date(item.ExpirationTime).getTime();
|
|
384
383
|
if (item.Status !== EChallengeProgressStatus.Expired && expirationTime <= now) {
|
|
385
|
-
this.handleStatusEvent({ ChallengeId: item.ChallengeId });
|
|
384
|
+
this.handleStatusEvent({ ChallengeId: item.ChallengeId }, true);
|
|
386
385
|
}
|
|
387
386
|
return item;
|
|
388
387
|
});
|
|
@@ -471,16 +470,6 @@ const CasinoChallengesOverlay = class {
|
|
|
471
470
|
return h("img", { class: "icon", src: icon });
|
|
472
471
|
return h("div", { class: "gradient-text" }, this.inProgressCount);
|
|
473
472
|
}
|
|
474
|
-
closeModal() {
|
|
475
|
-
this.showModal = false;
|
|
476
|
-
this.modalTitle = '';
|
|
477
|
-
this.modalSubTitle = '';
|
|
478
|
-
this.modalBtnText = '';
|
|
479
|
-
this.modalShowIcon = true;
|
|
480
|
-
this.modalReward = '';
|
|
481
|
-
this.modalAddition = '';
|
|
482
|
-
this.modalAdditionText = '';
|
|
483
|
-
}
|
|
484
473
|
/**
|
|
485
474
|
* Called to initialize widget
|
|
486
475
|
* @param config
|
|
@@ -494,12 +483,12 @@ const CasinoChallengesOverlay = class {
|
|
|
494
483
|
}
|
|
495
484
|
const currProgress = this.completedLevelId ? 100 : this.progress;
|
|
496
485
|
const dot = this.getCapsuleDotPosition(currProgress);
|
|
497
|
-
return (h("div", { class: "container", onClick: this.goToDetailsPage }, h("div", { class: `circle ${this.isGrayed ? 'grayed' : ''}`, style: {
|
|
486
|
+
return (h("div", { ref: (el) => (this.stylingContainer = el) }, h("div", { class: "container", onClick: this.goToDetailsPage }, h("div", { class: `circle ${this.isGrayed ? 'grayed' : ''}`, style: {
|
|
498
487
|
'--progress': `${currProgress}%`
|
|
499
488
|
} }, h("img", { class: "circle__img", src: bgIconSvg }), h("div", { class: "circle__content" }, h("span", null, Math.floor(currProgress), "%")), dot && (h("div", { class: "dot", style: {
|
|
500
489
|
left: `${dot.x}px`,
|
|
501
490
|
top: `${dot.y}px`
|
|
502
|
-
} }))), !this.isGrayed && h("div", { class: `badge ${this.isNew ? 'new' : ''}` }, this.renderBadgeContent()), h("casino-challenges-overlay-modal", { isOpen: this.showModal, handleClick:
|
|
491
|
+
} }))), !this.isGrayed && h("div", { class: `badge ${this.isNew ? 'new' : ''}` }, this.renderBadgeContent())), h("casino-challenges-overlay-modal", { isOpen: this.showModal, handleClick: this.closeModal, reward: this.modalReward, addition: this.modalAddition, errored: this.modalErrored, orderNumber: this.modalOrderNumber })));
|
|
503
492
|
}
|
|
504
493
|
static get watchers() { return {
|
|
505
494
|
"clientStyling": ["handleClientStylingChange"],
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
2
|
-
export { s as setNonce } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-4cb6ae8e.js';
|
|
2
|
+
export { s as setNonce } from './index-4cb6ae8e.js';
|
|
3
3
|
import { g as globalScripts } from './app-globals-0f993ce5.js';
|
|
4
4
|
|
|
5
5
|
/*
|
|
@@ -16,5 +16,5 @@ var patchBrowser = () => {
|
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(async (options) => {
|
|
18
18
|
await globalScripts();
|
|
19
|
-
return bootstrapLazy([["casino-challenges-overlay_2",[[1,"casino-challenges-overlay",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"challenges":[16],"progress":[32],"isGrayed":[32],"isNew":[32],"isGift":[32],"isNotification":[32],"inProgressCount":[32],"activeChallenge":[32],"completedLevelId":[32],"prevUpdateEvent":[32],"showModal":[32],"
|
|
19
|
+
return bootstrapLazy([["casino-challenges-overlay_2",[[1,"casino-challenges-overlay",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"challenges":[16],"progress":[32],"isGrayed":[32],"isNew":[32],"isGift":[32],"isNotification":[32],"inProgressCount":[32],"activeChallenge":[32],"completedLevelId":[32],"prevUpdateEvent":[32],"showModal":[32],"modalErrored":[32],"modalReward":[32],"modalAddition":[32],"modalOrderNumber":[32],"init":[64]},[[8,"message","handleEvent"]],{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"],"challenges":["handleChallengesChange"]}],[1,"casino-challenges-overlay-modal",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"isOpen":[516,"is-open"],"reward":[513],"addition":[516],"handleClick":[16],"errored":[516],"orderNumber":[514,"order-number"]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}]]]], options);
|
|
20
20
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { s as setClientStyling, a as setClientStylingURL, b as setStreamStyling } from './casino-challenges-overlay-
|
|
2
|
-
export { C as casino_challenges_overlay } from './casino-challenges-overlay-
|
|
3
|
-
import { r as registerInstance, h } from './index-
|
|
1
|
+
import { s as setClientStyling, a as setClientStylingURL, b as setStreamStyling } from './casino-challenges-overlay-1cfb642b.js';
|
|
2
|
+
export { C as casino_challenges_overlay } from './casino-challenges-overlay-1cfb642b.js';
|
|
3
|
+
import { r as registerInstance, h } from './index-4cb6ae8e.js';
|
|
4
4
|
|
|
5
5
|
const giftboxSvg = 'data:image/svg+xml;base64,PHN2Z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80MzkpIi8+CiAgPGRlZnM+CiAgICA8bGluZWFyR3JhZGllbnQgaWQ9InBhaW50MF9saW5lYXJfMjA1MV80MzkiIHgxPSIwIiB5MT0iMTEuNSIgeDI9IjIyIiB5Mj0iMTEuNSIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPgogICAgICA8c3RvcCBzdG9wLWNvbG9yPSIjMUU2NTRGIi8+CiAgICAgIDxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iIzFDOEQ1NiIvPgogICAgPC9saW5lYXJHcmFkaWVudD4KICA8L2RlZnM+Cjwvc3ZnPgo=';
|
|
6
6
|
|
|
@@ -9,6 +9,14 @@ const TRANSLATIONS = {
|
|
|
9
9
|
en: {
|
|
10
10
|
congrats: 'Congratulations!',
|
|
11
11
|
continue: 'Continue',
|
|
12
|
+
errorBtnText: 'Ok',
|
|
13
|
+
errorTitle: 'Reward failed',
|
|
14
|
+
errorSubTitle: 'Sorry — we couldn’t grant the reward. Please try again.',
|
|
15
|
+
level: 'Level',
|
|
16
|
+
completed: 'has been completed!',
|
|
17
|
+
youWon: 'You have won',
|
|
18
|
+
physicalReward: 'for physical rewards please contact ',
|
|
19
|
+
linkText: 'Customer Support'
|
|
12
20
|
}
|
|
13
21
|
};
|
|
14
22
|
const translate = (key, customLang) => {
|
|
@@ -41,7 +49,7 @@ const resolveTranslationUrl = async (translationUrl) => {
|
|
|
41
49
|
}
|
|
42
50
|
};
|
|
43
51
|
|
|
44
|
-
const casinoChallengesOverlayModalCss = ":host{display:block;font-family:inherit}*{box-sizing:border-box;margin:0;padding:0}button{border:none;background:none;cursor:pointer;touch-action:manipulation}button:focus{outline:none}.ModalOverlay{display:none;position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0, 0, 0, 0);justify-content:center;align-items:center;z-index:1}.ModalOverlay.Open{display:flex}.ModalContent{display:flex;flex-direction:column;align-items:center;position:relative;background:linear-gradient(90deg, var(--emw--color-background, #003E5C) 0.05%, var(--emw--color-background-secondary, #113B21) 87.69%);padding:26px;border-radius:26px;border:2px solid var(--emw--color-primary-variant, #1E654F);width:450px;max-width:90%;text-align:center;max-height:90dvh;min-height:100px}.InnerContainer{border-radius:20px;background:#F9F8F8;padding:25px;width:100%}.ImageWrapper{margin-bottom:6px}.ModalHeader{color:var(--emw--color-typography, #212529);text-align:center;font-family:var(--emw--button-typography, \"PF BeauSans Pro\", sans-serif);
|
|
52
|
+
const casinoChallengesOverlayModalCss = ":host{display:block;font-family:inherit}*{box-sizing:border-box;margin:0;padding:0}button{border:none;background:none;cursor:pointer;touch-action:manipulation}button:focus{outline:none}.ModalOverlay{display:none;position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0, 0, 0, 0);justify-content:center;align-items:center;z-index:1}.ModalOverlay.Open{display:flex}.ModalContent{display:flex;flex-direction:column;align-items:center;position:relative;background:linear-gradient(90deg, var(--emw--color-background, #003E5C) 0.05%, var(--emw--color-background-secondary, #113B21) 87.69%);padding:26px;border-radius:26px;border:2px solid var(--emw--color-primary-variant, #1E654F);width:450px;max-width:90%;text-align:center;max-height:90dvh;min-height:100px;font-family:\"Roboto\", sans-serif}.InnerContainer{border-radius:20px;background:#F9F8F8;padding:25px;width:100%}.ImageWrapper{margin-bottom:6px}.ModalHeader{color:var(--emw--color-typography, #212529);text-align:center;font-family:var(--emw--button-typography, \"PF BeauSans Pro\", sans-serif);font-size:16px;font-style:normal;font-weight:700;line-height:normal;text-transform:uppercase;letter-spacing:1px}.ModalSubtitle{color:var(--emw--color-gray-300, #212529);text-align:center;font-size:var(--emw--font-size-small, 14px);font-style:normal;font-weight:400;margin:16px 0 10px;line-height:22px}.ErrorMessage{font-size:var(--emw--font-size-medium, 16px);line-height:24px;margin:10px 0 10px}.ModalReward{background:linear-gradient(90deg, var(--emw--color-primary, #24AA4D) 0%, var(--emw--color-background-secondary, #113F21) 100%);background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;font-family:var(--emw--button-typography, \"PF BeauSans Pro\", sans-serif);font-size:14px;font-style:normal;font-weight:700;margin-bottom:10px}.ModalAddition{color:var(--emw--color-gray-100, #727672);text-align:center;font-family:var(--emw--button-typography, \"Roboto\", sans-serif);font-size:var(--emw--font-size-x-small, 12px);font-style:normal;font-weight:400;height:39px;align-content:center}.ModalAddition span{background:linear-gradient(90deg, var(--emw--color-primary, #24AA4D) 0%, var(--emw--color-background-secondary, #113F21) 100%);background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;font-size:12px;font-style:normal;font-weight:700;line-height:15px;text-decoration:none;margin-left:8px;position:relative}.ModalAddition span::after{content:\"\";position:absolute;left:0;bottom:0;height:1px;width:100%;background:linear-gradient(90deg, var(--emw--color-primary, #24AA4D) 0%, var(--emw--color-background-secondary, #113F21) 100%)}.ModalAction{border-radius:var(--emw--button-border-radius, 99px);border:2px solid var(--emw--button-border-color, #083B17);background:linear-gradient(90deg, var(--emw--color-primary, #24AA4D) 0%, var(--emw--color-background-secondary, #113F21) 100%);padding:9px 20px;margin-top:10px;text-transform:uppercase;color:var(--emw--button-text-color, #FFF);text-align:center;font-family:var(--emw--button-typography, \"PF BeauSans Pro\", sans-serif);font-size:12px;font-style:normal;font-weight:700;letter-spacing:1px;line-height:1}";
|
|
45
53
|
const CasinoChallengesOverlayModalStyle0 = casinoChallengesOverlayModalCss;
|
|
46
54
|
|
|
47
55
|
const CasinoChallengesOverlayModal = class {
|
|
@@ -50,19 +58,14 @@ const CasinoChallengesOverlayModal = class {
|
|
|
50
58
|
this.mbSource = undefined;
|
|
51
59
|
this.clientStyling = undefined;
|
|
52
60
|
this.clientStylingUrl = undefined;
|
|
61
|
+
this.translationUrl = '';
|
|
53
62
|
this.language = 'en';
|
|
54
63
|
this.isOpen = false;
|
|
55
|
-
this.showIcon = true;
|
|
56
|
-
this.showButton = true;
|
|
57
|
-
this.header = '';
|
|
58
|
-
this.subtitle = '';
|
|
59
64
|
this.reward = '';
|
|
60
|
-
this.addition =
|
|
61
|
-
this.additionLinkUrl = '';
|
|
62
|
-
this.additionLinkText = '';
|
|
63
|
-
this.actionText = '';
|
|
64
|
-
this.translationUrl = '';
|
|
65
|
+
this.addition = false;
|
|
65
66
|
this.handleClick = () => { };
|
|
67
|
+
this.errored = false;
|
|
68
|
+
this.orderNumber = 0;
|
|
66
69
|
}
|
|
67
70
|
handleClientStylingChange(newValue, oldValue) {
|
|
68
71
|
if (newValue != oldValue) {
|
|
@@ -98,13 +101,7 @@ const CasinoChallengesOverlayModal = class {
|
|
|
98
101
|
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
99
102
|
}
|
|
100
103
|
render() {
|
|
101
|
-
return (h("div", { key: '
|
|
102
|
-
h("div", { key: '7cfdec9f66854d92adf8dc7f023d7d17fd53ab25', class: "ImageWrapper" }, h("img", { key: '32e1a43bbfbca465b229fe3fd2a47be5ffae14e1', src: giftboxSvg, alt: "gift-box-icon" })), h("h1", { key: '0236d690962bf8e6ec0722061198eebe22993963', class: "ModalHeader", innerHTML: this.header || translate('congrats', this.language) }), this.subtitle &&
|
|
103
|
-
h("div", { key: 'd76af009535ecf94808bdddc1d39cb5e6eb2ec8f', class: "ModalSubtitle", innerHTML: this.subtitle }), this.reward &&
|
|
104
|
-
h("div", { key: 'cf41803c33862996e57469dedd8e29c9ce1b03b4', class: "ModalReward", innerHTML: this.reward }), this.addition &&
|
|
105
|
-
h("div", { key: 'd6907547a7158d7d4e25b8445ce7da061999fb49', class: "ModalAddition" }, h("div", { key: '6d95e449a0988f8a62546ecc411f57253c34d5d7', innerHTML: this.addition }), this.additionLinkUrl && this.additionLinkText &&
|
|
106
|
-
h("a", { key: '19df109759ff7b92587e8f6a4cd9ec181d2ee694', href: this.additionLinkText }, this.additionLinkText)), this.showButton &&
|
|
107
|
-
h("button", { key: '290969fe58fff0df3b7f59231151c0a8e5d39cc4', class: "ModalAction", onClick: this.handleClick, innerHTML: this.actionText ? this.actionText : translate("continue", this.language) })))));
|
|
104
|
+
return (h("div", { key: '6c704266619b5ad109ec6289d65fd6a26f827951', ref: (el) => (this.stylingContainer = el), class: `ModalOverlay ${this.isOpen && 'Open'}` }, h("div", { key: '65b800fd71f65afa246804ff35116bc0f2a6ff6b', class: "ModalWinAnimation" }), h("div", { key: '51df6e0c7d487762f0da0c874805c1e34a520fc2', class: "ModalContent GradientBorder" }, h("div", { key: 'ac9b44635eb8cb1fda4d1a4549c42c5e7055fc18', class: "InnerContainer" }, !this.errored && (h("div", { key: '7b5e93f30b1cb40af1d8f621f13d1e18bb1a06b6', class: "ImageWrapper" }, h("img", { key: '4e7867d129678e327ffc12d1da93b31bef4bc3b8', src: giftboxSvg, alt: "gift-box-icon" }))), h("h1", { key: '05782d9c5b5f905bd726dfbd8a32b51b7993e6c8', class: "ModalHeader" }, translate(this.errored ? 'errorTitle' : 'congrats', this.language)), this.errored ? (h("div", { class: "ErrorMessage" }, translate('errorSubTitle', this.language))) : (h("div", { class: "ModalSubtitle" }, `${translate('level', this.language)} ${this.orderNumber} ${translate('completed', this.language)}`, h("div", null, translate('youWon', this.language)), h("div", { class: "ModalReward" }, this.reward))), this.addition && (h("div", { key: '0776cef4171e90f027069d2fc2032204698ae47d', class: "ModalAddition" }, h("div", { key: '0ffaceb4bb8df0647f77a1c9ddcf2db9c61aa53b' }, translate('physicalReward', this.language)), h("span", { key: '08aec1fec4c84a97a6543ea9e5424c3ce3af40f8' }, translate('linkText', this.language)))), h("button", { key: '5103a3a04995091612a9126a6052f65d96b5bb5f', class: "ModalAction", onClick: this.handleClick }, this.errored ? translate('errorBtnText', this.language) : translate('continue', this.language))))));
|
|
108
105
|
}
|
|
109
106
|
static get watchers() { return {
|
|
110
107
|
"clientStyling": ["handleClientStylingChange"],
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const NAMESPACE = 'casino-challenges-overlay';
|
|
2
|
-
const BUILD = /* casino-challenges-overlay */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: false, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: true, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: true, element: false, event: false, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: true, hostListenerTarget: true, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: true, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: true, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: false, propNumber:
|
|
2
|
+
const BUILD = /* casino-challenges-overlay */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: false, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: true, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: true, element: false, event: false, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: true, hostListenerTarget: true, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: true, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: true, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: false, propNumber: true, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: false, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: false, watchCallback: true };
|
|
3
3
|
|
|
4
4
|
/*
|
|
5
5
|
Stencil Client Platform v4.19.2 | MIT Licensed | https://stenciljs.com
|
|
@@ -295,6 +295,9 @@ var parsePropertyValue = (propValue, propType) => {
|
|
|
295
295
|
if (propType & 4 /* Boolean */) {
|
|
296
296
|
return propValue === "false" ? false : propValue === "" || !!propValue;
|
|
297
297
|
}
|
|
298
|
+
if (propType & 2 /* Number */) {
|
|
299
|
+
return parseFloat(propValue);
|
|
300
|
+
}
|
|
298
301
|
if (propType & 1 /* String */) {
|
|
299
302
|
return String(propValue);
|
|
300
303
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { C as CasinoChallengesOverlay } from './casino-challenges-overlay-
|
|
2
|
-
import './index-
|
|
1
|
+
export { C as CasinoChallengesOverlay } from './casino-challenges-overlay-1cfb642b.js';
|
|
2
|
+
import './index-4cb6ae8e.js';
|
package/dist/esm/loader.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { b as bootstrapLazy } from './index-
|
|
2
|
-
export { s as setNonce } from './index-
|
|
1
|
+
import { b as bootstrapLazy } from './index-4cb6ae8e.js';
|
|
2
|
+
export { s as setNonce } from './index-4cb6ae8e.js';
|
|
3
3
|
import { g as globalScripts } from './app-globals-0f993ce5.js';
|
|
4
4
|
|
|
5
5
|
const defineCustomElements = async (win, options) => {
|
|
6
6
|
if (typeof window === 'undefined') return undefined;
|
|
7
7
|
await globalScripts();
|
|
8
|
-
return bootstrapLazy([["casino-challenges-overlay_2",[[1,"casino-challenges-overlay",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"challenges":[16],"progress":[32],"isGrayed":[32],"isNew":[32],"isGift":[32],"isNotification":[32],"inProgressCount":[32],"activeChallenge":[32],"completedLevelId":[32],"prevUpdateEvent":[32],"showModal":[32],"
|
|
8
|
+
return bootstrapLazy([["casino-challenges-overlay_2",[[1,"casino-challenges-overlay",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"challenges":[16],"progress":[32],"isGrayed":[32],"isNew":[32],"isGift":[32],"isNotification":[32],"inProgressCount":[32],"activeChallenge":[32],"completedLevelId":[32],"prevUpdateEvent":[32],"showModal":[32],"modalErrored":[32],"modalReward":[32],"modalAddition":[32],"modalOrderNumber":[32],"init":[64]},[[8,"message","handleEvent"]],{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"],"challenges":["handleChallengesChange"]}],[1,"casino-challenges-overlay-modal",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"isOpen":[516,"is-open"],"reward":[513],"addition":[516],"handleClick":[16],"errored":[516],"orderNumber":[514,"order-number"]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}]]]], options);
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export { defineCustomElements };
|