@everymatrix/casino-challenges-overlay 0.3.2 → 0.3.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.
Files changed (31) hide show
  1. package/dist/casino-challenges-overlay/casino-challenges-overlay-e43b403e.js +1 -0
  2. package/dist/casino-challenges-overlay/casino-challenges-overlay.esm.js +1 -1
  3. package/dist/casino-challenges-overlay/casino-challenges-overlay_2.entry.js +1 -0
  4. package/dist/casino-challenges-overlay/index-7fdd1cbf.js +2 -0
  5. package/dist/casino-challenges-overlay/index.esm.js +1 -1
  6. package/dist/cjs/{casino-challenges-overlay-e96b8732.js → casino-challenges-overlay-a75f839f.js} +206 -9
  7. package/dist/cjs/casino-challenges-overlay.cjs.js +2 -2
  8. package/dist/cjs/casino-challenges-overlay_2.cjs.entry.js +121 -0
  9. package/dist/cjs/{index-87f5caf5.js → index-11e96899.js} +107 -6
  10. package/dist/cjs/index.cjs.js +2 -2
  11. package/dist/cjs/loader.cjs.js +2 -2
  12. package/dist/collection/collection-manifest.json +8 -1
  13. package/dist/collection/components/casino-challenges-overlay/casino-challenges-overlay.css +3 -0
  14. package/dist/collection/components/casino-challenges-overlay/casino-challenges-overlay.js +204 -6
  15. package/dist/collection/utils/locale.utils.js +9 -1
  16. package/dist/collection/utils/types.js +32 -0
  17. package/dist/esm/{casino-challenges-overlay-127cb2bd.js → casino-challenges-overlay-e43b403e.js} +204 -10
  18. package/dist/esm/casino-challenges-overlay.js +3 -3
  19. package/dist/esm/casino-challenges-overlay_2.entry.js +117 -0
  20. package/dist/esm/{index-23ccb586.js → index-7fdd1cbf.js} +107 -6
  21. package/dist/esm/index.js +2 -2
  22. package/dist/esm/loader.js +3 -3
  23. package/dist/types/components/casino-challenges-overlay/casino-challenges-overlay.d.ts +21 -0
  24. package/dist/types/components.d.ts +10 -0
  25. package/dist/types/utils/types.d.ts +97 -0
  26. package/package.json +1 -1
  27. package/dist/casino-challenges-overlay/casino-challenges-overlay-127cb2bd.js +0 -1
  28. package/dist/casino-challenges-overlay/casino-challenges-overlay.entry.js +0 -1
  29. package/dist/casino-challenges-overlay/index-23ccb586.js +0 -2
  30. package/dist/cjs/casino-challenges-overlay.cjs.entry.js +0 -10
  31. package/dist/esm/casino-challenges-overlay.entry.js +0 -2
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, h } from './index-23ccb586.js';
1
+ import { r as registerInstance, h } from './index-7fdd1cbf.js';
2
2
 
3
3
  /**
4
4
  * @name setClientStyling
@@ -66,7 +66,15 @@ const giftSvg = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZ
66
66
  const DEFAULT_LANGUAGE = 'en';
67
67
  const TRANSLATIONS = {
68
68
  en: {
69
- new: 'new'
69
+ new: 'new',
70
+ errorBtnText: 'Ok',
71
+ errorTitle: 'Reward failed',
72
+ errorSubTitle: 'Sorry — we couldn’t grant the reward. Please try again.',
73
+ level: 'Level',
74
+ completed: 'has been completed!',
75
+ youWon: 'You have won',
76
+ physicalReward: 'for physical rewards please contact ',
77
+ linkText: 'Customer Support'
70
78
  },
71
79
  ro: {},
72
80
  fr: {},
@@ -100,7 +108,40 @@ const resolveTranslationUrl = async (translationUrl) => {
100
108
  }
101
109
  };
102
110
 
103
- const casinoChallengesOverlayCss = "@import url(\"https://fonts.googleapis.com/css2?family=Cherry+Bomb+One&display=swap\");.container{position:relative;z-index:300}.circle{display:inline-block;box-sizing:border-box;border-radius:24px;position:relative;background:conic-gradient(from 270deg at 50% 50%, transparent 0deg var(--progress), var(--emw--border-color, #a4d3b4) var(--progress) 360deg), linear-gradient(103deg, var(--emw--progress-gradient-color-1, #FF9400) 16.9%, var(--emw--progress-gradient-color-2, #FEF746) 95.33%, var(--emw--progress-gradient-color-3, #FFE24A) 95.96%) no-repeat center/100% 100%;box-shadow:var(--emw--button-box-shadow, 0 4px 4px 0 rgba(0, 0, 0, 0.3019607843));width:55px;height:32px;padding:4px 6px;isolation:isolate}.circle__content{display:flex;align-items:center;justify-content:center;height:100%;pointer-events:none;color:var(--emw--color-white, #FFFFFF);z-index:302;position:relative;padding:0 0 0 12px}.circle__content span{font-family:var(--emw--font-family-secondary, \"Cherry Bomb One\", sans-serif);font-size:var(--emw--font-size-x-smal, 11px);font-weight:var(--emw--font-weight-normal, 400);letter-spacing:-0.22px;text-transform:uppercase}.circle__img{position:absolute;left:0;z-index:304;top:0}.circle.grayed::before{display:block}.circle.grayed .dot{filter:grayscale(100%)}.circle::after{content:\"\";position:absolute;inset:3px;border-radius:24px;background:linear-gradient(90deg, var(--emw--background-gradient-color-1, #24AA4D) 0%, var(--emw--background-gradient-color-2, #113F21) 100%);pointer-events:none}.dot{position:absolute;width:4px;height:4px;background:var(--emw--color-white, #FFFFFF);border-radius:50%;box-sizing:border-box;transform:translate(-50%, -50%);pointer-events:none;z-index:303;box-shadow:var(--emw--secondary-box-shadow, 0 0.33px 1.32px 0.165px rgba(0, 0, 0, 0.1215686275))}.dot::before{content:\"\";position:absolute;inset:0;border-radius:50%;padding:1px;background:linear-gradient(103deg, var(--emw--progress-gradient-color-1, #FF9400) 16.9%, var(--emw--progress-gradient-color-2, #FEF746) 95.33%, var(--emw--progress-gradient-color-3, #FFE24A) 95.96%);-webkit-mask:linear-gradient(var(--emw--color-white, #FFFFFF) 0 0) content-box, linear-gradient(var(--emw--color-white, #FFFFFF) 0 0);-webkit-mask-composite:xor;mask-composite:exclude;pointer-events:none}.dot::after{content:\"\";position:absolute;top:50%;left:50%;width:9px;height:9px;background:url(\"../../assets/indicator.png\") no-repeat center/contain, url(\"../../assets/shining.svg\") no-repeat center/contain;transform:translate(-50%, -50%);pointer-events:none;z-index:304}.circle::before{content:\"\";position:absolute;inset:0;background:var(--emw--color-gray-150, #808080);border-radius:24px;mix-blend-mode:saturation;pointer-events:none;z-index:305;display:none}.badge{border-radius:50%;background:radial-gradient(93.38% 91.12% at 11.11% 0%, var(--emw--badge-gradient-color-1, rgba(35, 176, 78, 0.8)) 0%, var(--emw--badge-gradient-color-2, rgba(188, 252, 177, 0.0784313725)) 100%), var(--emw--color-black, #000000);border:1px solid var(--emw--button-border-color, rgba(29, 249, 139, 0.8));position:absolute;height:18px;min-width:18px;align-content:center;box-sizing:border-box;top:-5px;left:44px;font-size:var(--emw--font-size-2x-smal, 10px);line-height:10px;font-weight:var(--emw--font-weight-normal, 400);font-family:var(--emw--font-family-secondary, \"Cherry Bomb One\", sans-serif);text-align:center}.badge.new{height:14px;border-radius:200px;padding:0 4px;padding-bottom:3px}.badge .icon{height:10px;width:10px}.badge .gradient-text{background:linear-gradient(103deg, var(--emw--progress-gradient-color-1, #FF9400) 16.9%, var(--emw--progress-gradient-color-3, #FFE24A) 70.65%, var(--emw--progress-gradient-color-2, #FEF746) 95.33%);-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text;color:transparent}";
111
+ var EChallengeRewardType;
112
+ (function (EChallengeRewardType) {
113
+ EChallengeRewardType[EChallengeRewardType["FreeSpins"] = 0] = "FreeSpins";
114
+ EChallengeRewardType[EChallengeRewardType["LuckyWheel"] = 1] = "LuckyWheel";
115
+ EChallengeRewardType[EChallengeRewardType["Leaderboard"] = 2] = "Leaderboard";
116
+ EChallengeRewardType[EChallengeRewardType["Challenge"] = 3] = "Challenge";
117
+ EChallengeRewardType[EChallengeRewardType["Custom"] = 4] = "Custom";
118
+ })(EChallengeRewardType || (EChallengeRewardType = {}));
119
+ var EChallengeProgressStatus;
120
+ (function (EChallengeProgressStatus) {
121
+ EChallengeProgressStatus[EChallengeProgressStatus["Closed"] = 0] = "Closed";
122
+ EChallengeProgressStatus[EChallengeProgressStatus["InProgress"] = 1] = "InProgress";
123
+ EChallengeProgressStatus[EChallengeProgressStatus["Fillup"] = 2] = "Fillup";
124
+ EChallengeProgressStatus[EChallengeProgressStatus["Completed"] = 3] = "Completed";
125
+ })(EChallengeProgressStatus || (EChallengeProgressStatus = {}));
126
+ var EChallengeStatus;
127
+ (function (EChallengeStatus) {
128
+ EChallengeStatus[EChallengeStatus["Started"] = 0] = "Started";
129
+ EChallengeStatus[EChallengeStatus["InProgress"] = 1] = "InProgress";
130
+ EChallengeStatus[EChallengeStatus["PendingLevelReward"] = 2] = "PendingLevelReward";
131
+ EChallengeStatus[EChallengeStatus["Completed"] = 3] = "Completed";
132
+ EChallengeStatus[EChallengeStatus["Expired"] = 4] = "Expired";
133
+ EChallengeStatus[EChallengeStatus["Forfeited"] = 5] = "Forfeited";
134
+ EChallengeStatus[EChallengeStatus["Awaiting"] = 6] = "Awaiting";
135
+ EChallengeStatus[EChallengeStatus["Paused"] = 7] = "Paused";
136
+ })(EChallengeStatus || (EChallengeStatus = {}));
137
+ var EChallengeLevelTargetType;
138
+ (function (EChallengeLevelTargetType) {
139
+ EChallengeLevelTargetType[EChallengeLevelTargetType["Accumulative"] = 0] = "Accumulative";
140
+ EChallengeLevelTargetType[EChallengeLevelTargetType["SingleBet"] = 1] = "SingleBet";
141
+ EChallengeLevelTargetType[EChallengeLevelTargetType["MultipleOneBetSize"] = 2] = "MultipleOneBetSize";
142
+ })(EChallengeLevelTargetType || (EChallengeLevelTargetType = {}));
143
+
144
+ const casinoChallengesOverlayCss = "@import url(\"https://fonts.googleapis.com/css2?family=Cherry+Bomb+One&display=swap\");.container{position:relative;z-index:300}.circle{display:inline-block;box-sizing:border-box;border-radius:24px;position:relative;background:conic-gradient(from 270deg at 50% 50%, transparent 0deg var(--progress), var(--emw--border-color, #a4d3b4) var(--progress) 360deg), linear-gradient(103deg, var(--emw--progress-gradient-color-1, #FF9400) 16.9%, var(--emw--progress-gradient-color-2, #FEF746) 95.33%, var(--emw--progress-gradient-color-3, #FFE24A) 95.96%) no-repeat center/100% 100%;box-shadow:var(--emw--button-box-shadow, 0 4px 4px 0 rgba(0, 0, 0, 0.3019607843));width:55px;height:32px;padding:4px 6px;isolation:isolate}.circle__content{display:flex;align-items:center;justify-content:center;height:100%;pointer-events:none;color:var(--emw--color-white, #FFFFFF);z-index:302;position:relative;padding:0 0 0 12px}.circle__content span{font-family:var(--emw--font-family-secondary, \"Cherry Bomb One\", sans-serif);font-size:var(--emw--font-size-x-smal, 11px);font-weight:var(--emw--font-weight-normal, 400);letter-spacing:-0.22px;text-transform:uppercase}.circle__img{position:absolute;left:0;z-index:304;top:0}.circle.grayed{mix-blend-mode:luminosity}.circle.grayed::before{display:block}.circle.grayed .dot{filter:grayscale(100%)}.circle::after{content:\"\";position:absolute;inset:3px;border-radius:24px;background:linear-gradient(90deg, var(--emw--background-gradient-color-1, #24AA4D) 0%, var(--emw--background-gradient-color-2, #113F21) 100%);pointer-events:none}.dot{position:absolute;width:4px;height:4px;background:var(--emw--color-white, #FFFFFF);border-radius:50%;box-sizing:border-box;transform:translate(-50%, -50%);pointer-events:none;z-index:303;box-shadow:var(--emw--secondary-box-shadow, 0 0.33px 1.32px 0.165px rgba(0, 0, 0, 0.1215686275))}.dot::before{content:\"\";position:absolute;inset:0;border-radius:50%;padding:1px;background:linear-gradient(103deg, var(--emw--progress-gradient-color-1, #FF9400) 16.9%, var(--emw--progress-gradient-color-2, #FEF746) 95.33%, var(--emw--progress-gradient-color-3, #FFE24A) 95.96%);-webkit-mask:linear-gradient(var(--emw--color-white, #FFFFFF) 0 0) content-box, linear-gradient(var(--emw--color-white, #FFFFFF) 0 0);-webkit-mask-composite:xor;mask-composite:exclude;pointer-events:none}.dot::after{content:\"\";position:absolute;top:50%;left:50%;width:9px;height:9px;background:url(\"../../assets/indicator.png\") no-repeat center/contain, url(\"../../assets/shining.svg\") no-repeat center/contain;transform:translate(-50%, -50%);pointer-events:none;z-index:304}.circle::before{content:\"\";position:absolute;inset:0;background:var(--emw--color-gray-150, #808080);border-radius:24px;mix-blend-mode:saturation;pointer-events:none;z-index:305;display:none}.badge{border-radius:50%;background:radial-gradient(93.38% 91.12% at 11.11% 0%, var(--emw--badge-gradient-color-1, rgba(35, 176, 78, 0.8)) 0%, var(--emw--badge-gradient-color-2, rgba(188, 252, 177, 0.0784313725)) 100%), var(--emw--color-black, #000000);border:1px solid var(--emw--button-border-color, rgba(29, 249, 139, 0.8));position:absolute;height:18px;min-width:18px;align-content:center;box-sizing:border-box;top:-5px;left:44px;font-size:var(--emw--font-size-2x-smal, 10px);line-height:10px;font-weight:var(--emw--font-weight-normal, 400);font-family:var(--emw--font-family-secondary, \"Cherry Bomb One\", sans-serif);text-align:center}.badge.new{height:14px;border-radius:200px;padding:0 4px;padding-bottom:3px}.badge .icon{height:10px;width:10px}.badge .gradient-text{background:linear-gradient(103deg, var(--emw--progress-gradient-color-1, #FF9400) 16.9%, var(--emw--progress-gradient-color-3, #FFE24A) 70.65%, var(--emw--progress-gradient-color-2, #FEF746) 95.33%);-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text;color:transparent}";
104
145
  const CasinoChallengesOverlayStyle0 = casinoChallengesOverlayCss;
105
146
 
106
147
  const CasinoChallengesOverlay = class {
@@ -111,11 +152,23 @@ const CasinoChallengesOverlay = class {
111
152
  this.clientStylingUrl = undefined;
112
153
  this.translationUrl = '';
113
154
  this.language = 'en';
114
- this.progress = 50;
155
+ this.challenges = undefined;
156
+ this.progress = 0;
115
157
  this.isGrayed = false;
116
158
  this.isNew = false;
117
159
  this.isGift = false;
118
160
  this.isNotification = false;
161
+ this.inProgressCount = 0;
162
+ this.activeChallenge = '';
163
+ this.showModal = false;
164
+ this.modalTitle = '';
165
+ this.modalSubTitle = '';
166
+ this.modalBtnText = '';
167
+ this.modalShowIcon = true;
168
+ this.modalReward = '';
169
+ this.modalAddition = '';
170
+ this.modalAdditionLink = '';
171
+ this.modalAdditionText = '';
119
172
  }
120
173
  handleClientStylingChange(newValue, oldValue) {
121
174
  if (newValue != oldValue) {
@@ -132,7 +185,134 @@ const CasinoChallengesOverlay = class {
132
185
  setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
133
186
  }
134
187
  }
188
+ handleChallengesChange(newValue) {
189
+ let maxPercentage = 0;
190
+ let count = 0;
191
+ for (const challenge of newValue.filter((x) => x.Status === EChallengeStatus.InProgress)) {
192
+ if (challenge.Status === EChallengeStatus.InProgress) {
193
+ count++;
194
+ for (const level of challenge.LevelProgresses) {
195
+ if (level.ProgressStatus === EChallengeProgressStatus.InProgress) {
196
+ if (level.ProgressPercentage > maxPercentage) {
197
+ maxPercentage = level.ProgressPercentage;
198
+ this.activeChallenge = challenge.ChallengeId;
199
+ }
200
+ }
201
+ }
202
+ }
203
+ }
204
+ this.progress = maxPercentage;
205
+ this.inProgressCount = count;
206
+ }
207
+ handleEvent(e) {
208
+ const { type, data } = e === null || e === void 0 ? void 0 : e.data;
209
+ switch (type) {
210
+ case 'UpdateChallengeProgress': {
211
+ const newChallenge = data;
212
+ let completedLevel = '';
213
+ this.isNew = this.isNotification = this.isGift = false;
214
+ const newChallenges = this.challenges.map((challenge) => {
215
+ if (challenge.ChallengeId !== (newChallenge === null || newChallenge === void 0 ? void 0 : newChallenge.ChallengeId))
216
+ return challenge;
217
+ const updatedLevels = challenge.LevelProgresses.map((level) => {
218
+ const newLevelData = newChallenge === null || newChallenge === void 0 ? void 0 : newChallenge.Levels.find((l) => l.LevelId === level.LevelId);
219
+ if (!newLevelData)
220
+ return level;
221
+ if (newLevelData.ProgressPercentage === 100) {
222
+ completedLevel = level.LevelId;
223
+ if (level.Rewards.every((r) => r.Type === EChallengeRewardType.Challenge)) {
224
+ this.isNew = true;
225
+ }
226
+ else {
227
+ this.isGift = true;
228
+ }
229
+ }
230
+ return Object.assign(Object.assign({}, level), newLevelData);
231
+ });
232
+ return Object.assign(Object.assign({}, challenge), { Status: newChallenge.Status, LevelProgresses: updatedLevels });
233
+ });
234
+ this.challenges = newChallenges;
235
+ if (completedLevel) {
236
+ for (const challenge of this.challenges) {
237
+ for (const level of challenge.LevelProgresses) {
238
+ if (level.LevelId === completedLevel) {
239
+ level.ProgressStatus = EChallengeProgressStatus.Completed;
240
+ const nextLevel = challenge.LevelProgresses.find((z) => z.OrderNumber === level.OrderNumber + 1);
241
+ if (nextLevel) {
242
+ nextLevel.ProgressStatus = EChallengeProgressStatus.InProgress;
243
+ }
244
+ break;
245
+ }
246
+ }
247
+ }
248
+ }
249
+ break;
250
+ }
251
+ case 'ChallengeForfeitNotification': {
252
+ this.handleStatusEvent(data);
253
+ break;
254
+ }
255
+ case 'ShowChallengeRewardModal': {
256
+ this.showModal = true;
257
+ if (data === null || data === void 0 ? void 0 : data.HasError) {
258
+ this.modalTitle = translate('errorTitle', this.language);
259
+ this.modalSubTitle = translate('errorSubTitle', this.language);
260
+ this.modalBtnText = translate('errorBtnText', this.language);
261
+ this.modalShowIcon = false;
262
+ }
263
+ else {
264
+ const completedLevel = this.challenges
265
+ .flatMap((x) => x.LevelProgresses || [])
266
+ .find((level) => level.LevelId === (data === null || data === void 0 ? void 0 : data.LevelId));
267
+ this.modalSubTitle = translate('level', this.language) + ' 3 ' + translate('completed', this.language);
268
+ this.modalReward = completedLevel.Rewards.map((reward) => reward.RewardDescription).join(' + ');
269
+ if (completedLevel.Rewards.some((x) => x.Type === EChallengeRewardType.Custom)) {
270
+ this.modalAddition = translate('physicalReward', this.language);
271
+ this.modalAdditionText = translate('linkText', this.language);
272
+ }
273
+ }
274
+ break;
275
+ }
276
+ case 'ChallengeChangeStatusNotification': {
277
+ this.handleStatusEvent(data);
278
+ }
279
+ }
280
+ }
281
+ handleStatusEvent(data) {
282
+ const newChallenges = [...this.challenges];
283
+ newChallenges.forEach(({ ChallengeId }, i) => {
284
+ if ((data === null || data === void 0 ? void 0 : data.ChallengeId) === ChallengeId) {
285
+ if ((data === null || data === void 0 ? void 0 : data.IsEnabled) === true) {
286
+ newChallenges[i] = Object.assign(Object.assign({}, newChallenges[i]), { Status: EChallengeStatus.InProgress });
287
+ this.challenges = newChallenges;
288
+ return;
289
+ }
290
+ else {
291
+ newChallenges[i] = Object.assign(Object.assign({}, newChallenges[i]), { Status: EChallengeStatus.Forfeited });
292
+ }
293
+ }
294
+ });
295
+ if ((data === null || data === void 0 ? void 0 : data.ChallengeId) === this.activeChallenge) {
296
+ this.isNotification = true;
297
+ if (this.inProgressCount === 1) {
298
+ setTimeout(() => {
299
+ this.isGrayed = true;
300
+ this.isNotification = false;
301
+ }, 10000);
302
+ }
303
+ else if (this.inProgressCount > 1) {
304
+ setTimeout(() => {
305
+ this.challenges = newChallenges;
306
+ this.isNotification = false;
307
+ }, 10000);
308
+ }
309
+ }
310
+ else {
311
+ this.challenges = newChallenges;
312
+ }
313
+ }
135
314
  componentWillLoad() {
315
+ this.handleChallengesChange(this.challenges);
136
316
  if (this.translationUrl) {
137
317
  resolveTranslationUrl(this.translationUrl);
138
318
  }
@@ -227,23 +407,37 @@ const CasinoChallengesOverlay = class {
227
407
  const icon = this.isGift ? giftSvg : this.isNotification ? bellSvg : null;
228
408
  if (icon)
229
409
  return h("img", { class: "icon", src: icon });
230
- return h("div", { class: "gradient-text" }, "1");
410
+ return h("div", { class: "gradient-text" }, this.inProgressCount);
411
+ }
412
+ closeModal() {
413
+ this.showModal = false;
414
+ this.modalTitle = '';
415
+ this.modalSubTitle = '';
416
+ this.modalBtnText = '';
417
+ this.modalShowIcon = true;
418
+ this.modalReward = '';
419
+ this.modalAddition = '';
420
+ this.modalAdditionText = '';
231
421
  }
232
422
  render() {
423
+ if (this.inProgressCount < 1) {
424
+ return;
425
+ }
233
426
  const dot = this.getCapsuleDotPosition(this.progress);
234
- return (h("div", { key: '7af8930a4a36a295e68f38f3c30ae7543b8cc12d', class: "container" }, h("div", { key: '27d77b134ecd3a27309f1e5d84b9c1bd2bbf8bcb', class: `circle ${this.isGrayed ? 'grayed' : ''}`, style: {
427
+ return (h("div", { class: "container" }, h("div", { class: `circle ${this.isGrayed ? 'grayed' : ''}`, style: {
235
428
  '--progress': `${this.progress}%`
236
- } }, h("img", { key: '42486b790d0c33022c2a4acb0ef2ad9b618a1fc2', class: "circle__img", src: bgIconSvg }), h("div", { key: 'eba633711d409a63ef91621759029d82b64a96b7', class: "circle__content" }, h("span", { key: 'fe466e281f00b217aae2c44be730131e1349eaa3' }, this.progress, "%")), dot && (h("div", { key: 'b76218c1769e78fd165f9a3b0e311ec16dfc67ed', class: "dot", style: {
429
+ } }, h("img", { class: "circle__img", src: bgIconSvg }), h("div", { class: "circle__content" }, h("span", null, this.progress, "%")), dot && (h("div", { class: "dot", style: {
237
430
  left: `${dot.x}px`,
238
431
  top: `${dot.y}px`
239
- } }))), !this.isGrayed && h("div", { key: '59049b68efc9649973521afb1b05caa11a14a3b4', class: `badge ${this.isNew ? 'new' : ''}` }, this.renderBadgeContent())));
432
+ } }))), !this.isGrayed && h("div", { class: `badge ${this.isNew ? 'new' : ''}` }, this.renderBadgeContent()), h("casino-challenges-overlay-modal", { isOpen: this.showModal, handleClick: () => this.closeModal(), header: this.modalTitle, subtitle: this.modalSubTitle, actionText: this.modalBtnText, showIcon: this.modalShowIcon, reward: this.modalReward, addition: this.modalAddition, additionLinkText: this.modalAdditionText, additionLinkUrl: this.modalAdditionText })));
240
433
  }
241
434
  static get watchers() { return {
242
435
  "clientStyling": ["handleClientStylingChange"],
243
436
  "clientStylingUrl": ["handleClientStylingUrlChange"],
244
- "mbSource": ["handleMbSourceChange"]
437
+ "mbSource": ["handleMbSourceChange"],
438
+ "challenges": ["handleChallengesChange"]
245
439
  }; }
246
440
  };
247
441
  CasinoChallengesOverlay.style = CasinoChallengesOverlayStyle0;
248
442
 
249
- export { CasinoChallengesOverlay as C };
443
+ export { CasinoChallengesOverlay as C, setClientStylingURL as a, setStreamStyling as b, setClientStyling as s };
@@ -1,5 +1,5 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-23ccb586.js';
2
- export { s as setNonce } from './index-23ccb586.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-7fdd1cbf.js';
2
+ export { s as setNonce } from './index-7fdd1cbf.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",[[1,"casino-challenges-overlay",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"progress":[32],"isGrayed":[32],"isNew":[32],"isGift":[32],"isNotification":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}]]]], options);
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],"showModal":[32],"modalTitle":[32],"modalSubTitle":[32],"modalBtnText":[32],"modalShowIcon":[32],"modalReward":[32],"modalAddition":[32],"modalAdditionLink":[32],"modalAdditionText":[32]},[[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"],"language":[1],"isOpen":[4,"is-open"],"showIcon":[4,"show-icon"],"showButton":[4,"show-button"],"header":[1],"subtitle":[1],"reward":[1],"addition":[1],"additionLinkUrl":[1,"addition-link-url"],"additionLinkText":[1,"addition-link-text"],"actionText":[1,"action-text"],"translationUrl":[513,"translation-url"],"handleClick":[16]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}]]]], options);
20
20
  });
@@ -0,0 +1,117 @@
1
+ import { s as setClientStyling, a as setClientStylingURL, b as setStreamStyling } from './casino-challenges-overlay-e43b403e.js';
2
+ export { C as casino_challenges_overlay } from './casino-challenges-overlay-e43b403e.js';
3
+ import { r as registerInstance, h } from './index-7fdd1cbf.js';
4
+
5
+ const giftboxSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMiIgaGVpZ2h0PSIyMyIgdmlld0JveD0iMCAwIDIyIDIzIiBmaWxsPSJub25lIj4KICA8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTcuNDY0MjkgMi41QzcuMjE0NDIgMi41IDYuOTcxMDYgMi42MDA5IDYuNzg4NzggMi43ODY0OUM2LjYwNTkgMi45NzI3IDYuNTAwMDEgMy4yMjkwMyA2LjUwMDAxIDMuNUM2LjUwMDAxIDMuNzcwOTcgNi42MDU5IDQuMDI3MyA2Ljc4ODc4IDQuMjEzNTFDNi45NzEwNiA0LjM5OTEgNy4yMTQ0MiA0LjUgNy40NjQyOSA0LjVIOS42MzQyNUM5LjU2MTg3IDQuMzI4NjUgOS40Nzg1NyA0LjE1MTE2IDkuMzgzNTYgMy45NzUyN0M4Ljg5NzY5IDMuMDc1ODEgOC4yNzM5OCAyLjUgNy40NjQyOSAyLjVaTTEwIDYuNVY5LjVMMi42MDAwMSA5LjVDMi4zMDM0OCA5LjUgMi4xNDEyMiA5LjQ5OTIyIDIuMDI0NjQgOS40ODk3QzIuMDIgOS40ODkzMiAyLjAxNTYgOS40ODg5MyAyLjAxMTQ1IDkuNDg4NTVDMi4wMTEwNyA5LjQ4NDQgMi4wMTA2OSA5LjQ4MDAxIDIuMDEwMzEgOS40NzUzN0MyLjAwMDc4IDkuMzU4NzggMi4wMDAwMSA5LjE5NjUzIDIuMDAwMDEgOC45VjcuMUMyLjAwMDAxIDYuODAzNDcgMi4wMDA3OCA2LjY0MTIyIDIuMDEwMzEgNi41MjQ2M0MyLjAxMDY5IDYuNTE5OTkgMi4wMTEwNyA2LjUxNTYgMi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0IDQuMTUxMTYgMTIuNDM4MSA0LjMyODY1IDEyLjM2NTggNC41SDE0LjUzNTdaIiBmaWxsPSJ1cmwoI3BhaW50MF9saW5lYXJfMjA1MV80MzkpIi8+CiAgPGRlZnM+CiAgICA8bGluZWFyR3JhZGllbnQgaWQ9InBhaW50MF9saW5lYXJfMjA1MV80MzkiIHgxPSIwIiB5MT0iMTEuNSIgeDI9IjIyIiB5Mj0iMTEuNSIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPgogICAgICA8c3RvcCBzdG9wLWNvbG9yPSIjMUU2NTRGIi8+CiAgICAgIDxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iIzFDOEQ1NiIvPgogICAgPC9saW5lYXJHcmFkaWVudD4KICA8L2RlZnM+Cjwvc3ZnPgo=';
6
+
7
+ const DEFAULT_LANGUAGE = 'en';
8
+ const TRANSLATIONS = {
9
+ en: {
10
+ congrats: 'Congratulations!',
11
+ continue: 'Continue',
12
+ }
13
+ };
14
+ const translate = (key, customLang) => {
15
+ const lang = customLang;
16
+ return TRANSLATIONS[lang ? lang : DEFAULT_LANGUAGE][key];
17
+ };
18
+ const getTranslations = (data) => {
19
+ Object.keys(data).forEach((item) => {
20
+ for (let key in data[item]) {
21
+ if (!TRANSLATIONS[item]) {
22
+ TRANSLATIONS[item] = {};
23
+ }
24
+ TRANSLATIONS[item][key] = data[item][key];
25
+ }
26
+ });
27
+ };
28
+ const resolveTranslationUrl = async (translationUrl) => {
29
+ if (translationUrl) {
30
+ try {
31
+ const response = await fetch(translationUrl);
32
+ if (!response.ok) {
33
+ throw new Error(`HTTP error! status: ${response.status}`);
34
+ }
35
+ const translations = await response.json();
36
+ getTranslations(translations);
37
+ }
38
+ catch (error) {
39
+ console.error('Failed to fetch or parse translations from URL:', error);
40
+ }
41
+ }
42
+ };
43
+
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:100%;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);margin:0 0 10px;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-family:\"Roboto\", sans-serif;font-size:14px;font-style:normal;font-weight:400;margin-bottom: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:12px;font-style:normal;font-weight:400;margin-bottom:10px}.ModalAddition a{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}.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:14px 20px;margin-top:20px;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}";
45
+ const CasinoChallengesOverlayModalStyle0 = casinoChallengesOverlayModalCss;
46
+
47
+ const CasinoChallengesOverlayModal = class {
48
+ constructor(hostRef) {
49
+ registerInstance(this, hostRef);
50
+ this.mbSource = undefined;
51
+ this.clientStyling = undefined;
52
+ this.clientStylingUrl = undefined;
53
+ this.language = 'en';
54
+ this.isOpen = false;
55
+ this.showIcon = true;
56
+ this.showButton = true;
57
+ this.header = '';
58
+ this.subtitle = '';
59
+ this.reward = '';
60
+ this.addition = '';
61
+ this.additionLinkUrl = '';
62
+ this.additionLinkText = '';
63
+ this.actionText = '';
64
+ this.translationUrl = '';
65
+ this.handleClick = () => { };
66
+ }
67
+ handleClientStylingChange(newValue, oldValue) {
68
+ if (newValue != oldValue) {
69
+ setClientStyling(this.stylingContainer, this.clientStyling);
70
+ }
71
+ }
72
+ handleClientStylingUrlChange(newValue, oldValue) {
73
+ if (newValue != oldValue) {
74
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
75
+ }
76
+ }
77
+ handleMbSourceChange(newValue, oldValue) {
78
+ if (newValue != oldValue) {
79
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
80
+ }
81
+ }
82
+ componentWillLoad() {
83
+ if (this.translationUrl) {
84
+ resolveTranslationUrl(this.translationUrl);
85
+ }
86
+ }
87
+ componentDidLoad() {
88
+ if (this.stylingContainer) {
89
+ if (this.mbSource)
90
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
91
+ if (this.clientStyling)
92
+ setClientStyling(this.stylingContainer, this.clientStyling);
93
+ if (this.clientStylingUrl)
94
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
95
+ }
96
+ }
97
+ disconnectedCallback() {
98
+ this.stylingSubscription && this.stylingSubscription.unsubscribe();
99
+ }
100
+ render() {
101
+ return (h("div", { key: '2824c43ba2f3d5f9d1f4aca77dcdebce527edcb8', ref: (el) => (this.stylingContainer = el), class: `ModalOverlay ${this.isOpen && 'Open'}` }, h("div", { key: '479ba71d1d2c081b3d3cc93f52bd1848e299279b', class: "ModalWinAnimation" }), h("div", { key: 'c0e45b25e7a66438bca3f24dc8e9fd93e1da8b8f', class: "ModalContent GradientBorder" }, h("div", { key: '5d258e3480b8aeec879a15f5d063a8a4295575e0', class: 'InnerContainer' }, this.showIcon &&
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("span", { key: 'dbf44912dbf402d392d063c2c4db7eec637f782d', 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) })))));
108
+ }
109
+ static get watchers() { return {
110
+ "clientStyling": ["handleClientStylingChange"],
111
+ "clientStylingUrl": ["handleClientStylingUrlChange"],
112
+ "mbSource": ["handleMbSourceChange"]
113
+ }; }
114
+ };
115
+ CasinoChallengesOverlayModal.style = CasinoChallengesOverlayModalStyle0;
116
+
117
+ export { CasinoChallengesOverlayModal as casino_challenges_overlay_modal };
@@ -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: false, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: true, element: false, event: false, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: false, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, 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: false, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: false, propMutable: false, propNumber: false, 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: false, vdomPropOrAttr: true, vdomRef: false, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: false, watchCallback: true };
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: false, 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: false, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: false, propNumber: false, 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
@@ -49,10 +49,10 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
49
49
  }
50
50
  switch(bundleId) {
51
51
 
52
- case 'casino-challenges-overlay':
52
+ case 'casino-challenges-overlay_2':
53
53
  return import(
54
54
  /* webpackMode: "lazy" */
55
- './casino-challenges-overlay.entry.js').then(processMod, consoleError);
55
+ './casino-challenges-overlay_2.entry.js').then(processMod, consoleError);
56
56
  }
57
57
  }
58
58
  return import(
@@ -84,6 +84,22 @@ var plt = {
84
84
  rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
85
85
  ce: (eventName, opts) => new CustomEvent(eventName, opts)
86
86
  };
87
+ var supportsListenerOptions = /* @__PURE__ */ (() => {
88
+ let supportsListenerOptions2 = false;
89
+ try {
90
+ doc.addEventListener(
91
+ "e",
92
+ null,
93
+ Object.defineProperty({}, "passive", {
94
+ get() {
95
+ supportsListenerOptions2 = true;
96
+ }
97
+ })
98
+ );
99
+ } catch (e) {
100
+ }
101
+ return supportsListenerOptions2;
102
+ })();
87
103
  var promiseResolve = (v) => Promise.resolve(v);
88
104
  var supportsConstructableStylesheets = /* @__PURE__ */ (() => {
89
105
  try {
@@ -273,6 +289,9 @@ var Host = {};
273
289
  var isHost = (node) => node && node.$tag$ === Host;
274
290
  var parsePropertyValue = (propValue, propType) => {
275
291
  if (propValue != null && !isComplexType(propValue)) {
292
+ if (propType & 4 /* Boolean */) {
293
+ return propValue === "false" ? false : propValue === "" || !!propValue;
294
+ }
276
295
  if (propType & 1 /* String */) {
277
296
  return String(propValue);
278
297
  }
@@ -354,7 +373,7 @@ var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
354
373
  var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
355
374
  if (oldValue !== newValue) {
356
375
  let isProp = isMemberInElement(elm, memberName);
357
- memberName.toLowerCase();
376
+ let ln = memberName.toLowerCase();
358
377
  if (memberName === "class") {
359
378
  const classList = elm.classList;
360
379
  const oldClasses = parseClassList(oldValue);
@@ -382,7 +401,29 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
382
401
  }
383
402
  }
384
403
  }
385
- } else if (memberName === "key") ; else {
404
+ } else if (memberName === "key") ; else if (memberName === "ref") {
405
+ if (newValue) {
406
+ newValue(elm);
407
+ }
408
+ } else if ((!isProp ) && memberName[0] === "o" && memberName[1] === "n") {
409
+ if (memberName[2] === "-") {
410
+ memberName = memberName.slice(3);
411
+ } else if (isMemberInElement(win, ln)) {
412
+ memberName = ln.slice(2);
413
+ } else {
414
+ memberName = ln[2] + memberName.slice(3);
415
+ }
416
+ if (oldValue || newValue) {
417
+ const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
418
+ memberName = memberName.replace(CAPTURE_EVENT_REGEX, "");
419
+ if (oldValue) {
420
+ plt.rel(elm, memberName, oldValue, capture);
421
+ }
422
+ if (newValue) {
423
+ plt.ael(elm, memberName, newValue, capture);
424
+ }
425
+ }
426
+ } else {
386
427
  const isComplex = isComplexType(newValue);
387
428
  if ((isProp || isComplex && newValue !== null) && !isSvg) {
388
429
  try {
@@ -416,6 +457,8 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
416
457
  };
417
458
  var parseClassListRegex = /\s/;
418
459
  var parseClassList = (value) => !value ? [] : value.split(parseClassListRegex);
460
+ var CAPTURE_EVENT_SUFFIX = "Capture";
461
+ var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
419
462
 
420
463
  // src/runtime/vdom/update-element.ts
421
464
  var updateElement = (oldVnode, newVnode, isSvgMode2) => {
@@ -498,6 +541,7 @@ var removeVnodes = (vnodes, startIdx, endIdx) => {
498
541
  const vnode = vnodes[index];
499
542
  if (vnode) {
500
543
  const elm = vnode.$elm$;
544
+ nullifyVNodeRefs(vnode);
501
545
  if (elm) {
502
546
  elm.remove();
503
547
  }
@@ -622,6 +666,12 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
622
666
  elm.data = text;
623
667
  }
624
668
  };
669
+ var nullifyVNodeRefs = (vNode) => {
670
+ {
671
+ vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
672
+ vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
673
+ }
674
+ };
625
675
  var insertBefore = (parent, newNode, reference) => {
626
676
  const inserted = parent == null ? void 0 : parent.insertBefore(newNode, reference);
627
677
  return inserted;
@@ -685,6 +735,13 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
685
735
  }
686
736
  let maybePromise;
687
737
  if (isInitialLoad) {
738
+ {
739
+ hostRef.$flags$ |= 256 /* isListenReady */;
740
+ if (hostRef.$queuedListeners$) {
741
+ hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
742
+ hostRef.$queuedListeners$ = void 0;
743
+ }
744
+ }
688
745
  {
689
746
  maybePromise = safeCall(instance, "componentWillLoad");
690
747
  }
@@ -1012,6 +1069,7 @@ var connectedCallback = (elm) => {
1012
1069
  initializeComponent(elm, hostRef, cmpMeta);
1013
1070
  }
1014
1071
  } else {
1072
+ addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
1015
1073
  if (hostRef == null ? void 0 : hostRef.$lazyInstance$) ; else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
1016
1074
  hostRef.$onReadyPromise$.then(() => fireConnectedCallback());
1017
1075
  }
@@ -1027,6 +1085,12 @@ var disconnectInstance = (instance) => {
1027
1085
  var disconnectedCallback = async (elm) => {
1028
1086
  if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
1029
1087
  const hostRef = getHostRef(elm);
1088
+ {
1089
+ if (hostRef.$rmListeners$) {
1090
+ hostRef.$rmListeners$.map((rmListener) => rmListener());
1091
+ hostRef.$rmListeners$ = void 0;
1092
+ }
1093
+ }
1030
1094
  if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
1031
1095
  disconnectInstance(hostRef.$lazyInstance$);
1032
1096
  } else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
@@ -1066,6 +1130,9 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
1066
1130
  {
1067
1131
  cmpMeta.$members$ = compactMeta[2];
1068
1132
  }
1133
+ {
1134
+ cmpMeta.$listeners$ = compactMeta[3];
1135
+ }
1069
1136
  {
1070
1137
  cmpMeta.$attrsToReflect$ = [];
1071
1138
  }
@@ -1097,9 +1164,10 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
1097
1164
  }
1098
1165
  }
1099
1166
  connectedCallback() {
1100
- getHostRef(this);
1167
+ const hostRef = getHostRef(this);
1101
1168
  if (!this.hasRegisteredEventListeners) {
1102
1169
  this.hasRegisteredEventListeners = true;
1170
+ addHostEventListeners(this, hostRef, cmpMeta.$listeners$);
1103
1171
  }
1104
1172
  if (appLoadFallback) {
1105
1173
  clearTimeout(appLoadFallback);
@@ -1154,6 +1222,39 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
1154
1222
  }
1155
1223
  endBootstrap();
1156
1224
  };
1225
+ var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
1226
+ if (listeners) {
1227
+ listeners.map(([flags, name, method]) => {
1228
+ const target = getHostListenerTarget(elm, flags) ;
1229
+ const handler = hostListenerProxy(hostRef, method);
1230
+ const opts = hostListenerOpts(flags);
1231
+ plt.ael(target, name, handler, opts);
1232
+ (hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
1233
+ });
1234
+ }
1235
+ };
1236
+ var hostListenerProxy = (hostRef, methodName) => (ev) => {
1237
+ var _a;
1238
+ try {
1239
+ {
1240
+ if (hostRef.$flags$ & 256 /* isListenReady */) {
1241
+ (_a = hostRef.$lazyInstance$) == null ? void 0 : _a[methodName](ev);
1242
+ } else {
1243
+ (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
1244
+ }
1245
+ }
1246
+ } catch (e) {
1247
+ consoleError(e);
1248
+ }
1249
+ };
1250
+ var getHostListenerTarget = (elm, flags) => {
1251
+ if (flags & 8 /* TargetWindow */) return win;
1252
+ return elm;
1253
+ };
1254
+ var hostListenerOpts = (flags) => supportsListenerOptions ? {
1255
+ passive: (flags & 1 /* Passive */) !== 0,
1256
+ capture: (flags & 2 /* Capture */) !== 0
1257
+ } : (flags & 2 /* Capture */) !== 0;
1157
1258
 
1158
1259
  // src/runtime/nonce.ts
1159
1260
  var setNonce = (nonce) => plt.$nonce$ = nonce;
package/dist/esm/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { C as CasinoChallengesOverlay } from './casino-challenges-overlay-127cb2bd.js';
2
- import './index-23ccb586.js';
1
+ export { C as CasinoChallengesOverlay } from './casino-challenges-overlay-e43b403e.js';
2
+ import './index-7fdd1cbf.js';