@everymatrix/casino-play-random-game 1.55.0 → 1.56.0

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 (26) hide show
  1. package/dist/casino-play-random-game/casino-play-random-game.esm.js +1 -1
  2. package/dist/casino-play-random-game/p-aafe302e.js +2 -0
  3. package/dist/casino-play-random-game/p-ca888ed9.entry.js +1 -0
  4. package/dist/cjs/casino-play-random-game.cjs.entry.js +119 -40
  5. package/dist/cjs/casino-play-random-game.cjs.js +3 -3
  6. package/dist/cjs/{index-4316ff18.js → index-a0c0d6c2.js} +178 -72
  7. package/dist/cjs/loader.cjs.js +2 -2
  8. package/dist/collection/collection-manifest.json +1 -1
  9. package/dist/collection/components/casino-play-random-game/casino-play-random-game.js +104 -39
  10. package/dist/esm/casino-play-random-game.entry.js +119 -40
  11. package/dist/esm/casino-play-random-game.js +4 -4
  12. package/dist/esm/{index-eac6b960.js → index-29915e18.js} +178 -72
  13. package/dist/esm/loader.js +3 -3
  14. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/casino-play-random-game/.stencil/packages/stencil/casino-play-random-game/stencil.config.d.ts +2 -0
  15. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/casino-play-random-game/.stencil/packages/stencil/casino-play-random-game/stencil.config.dev.d.ts +2 -0
  16. package/dist/types/components/casino-play-random-game/casino-play-random-game.d.ts +9 -3
  17. package/dist/types/components.d.ts +8 -0
  18. package/package.json +1 -1
  19. package/dist/casino-play-random-game/p-a29126ee.entry.js +0 -1
  20. package/dist/casino-play-random-game/p-abcaead5.js +0 -2
  21. package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/casino-play-random-game/.stencil/packages/stencil/casino-play-random-game/stencil.config.d.ts +0 -2
  22. package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/casino-play-random-game/.stencil/packages/stencil/casino-play-random-game/stencil.config.dev.d.ts +0 -2
  23. /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/casino-play-random-game/.stencil/tools/plugins/index.d.ts +0 -0
  24. /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/casino-play-random-game/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +0 -0
  25. /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/casino-play-random-game/.stencil/tools/plugins/vite-chunk-plugin.d.ts +0 -0
  26. /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/casino-play-random-game/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +0 -0
@@ -1,8 +1,46 @@
1
1
  import { h } from "@stencil/core";
2
2
  import { getDevice } from "../../utils/utils";
3
3
  import { getTranslations, translate } from "../../utils/locale.utils";
4
+ import { setClientStyling, setClientStylingURL, setStreamStyling } from "../../../../../../../../libs/common/src/styling/index";
4
5
  export class CasinoPlayRandomGame {
5
6
  constructor() {
7
+ /**
8
+ * Language of the widget
9
+ */
10
+ this.language = 'en';
11
+ /**
12
+ * Configure a specific category for randomising the games.
13
+ */
14
+ this.specificCategory = '';
15
+ /**
16
+ * Icon visible initially
17
+ */
18
+ this.iconVisible = '';
19
+ /**
20
+ * Icon visible while rolling
21
+ */
22
+ this.iconVisibleOnAnim = '';
23
+ /**
24
+ * Open event on the game card.
25
+ */
26
+ this.launchByGameCard = '';
27
+ /**
28
+ * Client custom styling via string
29
+ */
30
+ this.clientStyling = '';
31
+ /**
32
+ * Client custom styling via url
33
+ */
34
+ this.clientStylingUrl = '';
35
+ /**
36
+ * Translations via URL
37
+ */
38
+ this.translationUrl = '';
39
+ this.hasErrors = false;
40
+ this.isLoading = true;
41
+ this.selectedGame = null;
42
+ this.animationDone = false;
43
+ this.animationStarted = false;
6
44
  this.animation = null;
7
45
  this.selectedGameIndex = null;
8
46
  this.selectedGameEl = null;
@@ -17,39 +55,6 @@ export class CasinoPlayRandomGame {
17
55
  }
18
56
  return array;
19
57
  };
20
- this.setClientStyling = () => {
21
- let sheet = document.createElement('style');
22
- sheet.innerHTML = this.clientStyling;
23
- this.host.shadowRoot.prepend(sheet);
24
- };
25
- this.setClientStylingURL = () => {
26
- let url = new URL(this.clientStylingUrl);
27
- let cssFile = document.createElement('style');
28
- fetch(url.href)
29
- .then((res) => res.text())
30
- .then((data) => {
31
- cssFile.innerHTML = data;
32
- this.clientStyling = data;
33
- setTimeout(() => { this.host.shadowRoot.prepend(cssFile); }, 1);
34
- });
35
- };
36
- this.endpoint = undefined;
37
- this.datasource = undefined;
38
- this.language = 'en';
39
- this.specificCategory = '';
40
- this.iconVisible = '';
41
- this.iconVisibleOnAnim = '';
42
- this.launchByGameCard = '';
43
- this.clientStyling = '';
44
- this.clientStylingUrl = '';
45
- this.translationUrl = '';
46
- this.hasErrors = false;
47
- this.limitStylingAppends = false;
48
- this.isLoading = true;
49
- this.gamesToShow = undefined;
50
- this.selectedGame = null;
51
- this.animationDone = false;
52
- this.animationStarted = false;
53
58
  }
54
59
  watchEndpoint(newValue, oldValue) {
55
60
  if (newValue && newValue != oldValue && this.endpoint) {
@@ -65,6 +70,17 @@ export class CasinoPlayRandomGame {
65
70
  handleIsIconVisible() {
66
71
  this.iconVisibility = this.iconVisible === 'true' ? true : false;
67
72
  }
73
+ handleClientStylingChange(newValue, oldValue) {
74
+ if (newValue != oldValue) {
75
+ setClientStyling(this.stylingContainer, this.clientStyling);
76
+ }
77
+ }
78
+ handleClientStylingChangeURL(newValue, oldValue) {
79
+ if (newValue != oldValue) {
80
+ if (this.clientStylingUrl)
81
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
82
+ }
83
+ }
68
84
  connectedCallback() {
69
85
  this.handleIsIconVisible();
70
86
  }
@@ -77,14 +93,19 @@ export class CasinoPlayRandomGame {
77
93
  }
78
94
  }
79
95
  componentDidLoad() {
80
- if (!this.limitStylingAppends && this.host) {
96
+ if (window.emMessageBus != undefined) {
97
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
98
+ }
99
+ else {
81
100
  if (this.clientStyling)
82
- this.setClientStyling();
101
+ setClientStyling(this.stylingContainer, this.clientStyling);
83
102
  if (this.clientStylingUrl)
84
- this.setClientStylingURL();
85
- this.limitStylingAppends = true;
103
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
86
104
  }
87
105
  }
106
+ disconnectedCallback() {
107
+ this.stylingSubscription && this.stylingSubscription.unsubscribe();
108
+ }
88
109
  fetchGameList() {
89
110
  let url = new URL(`${this.endpoint}/v1/casino/games`);
90
111
  url.searchParams.append('platform', getDevice());
@@ -218,7 +239,7 @@ export class CasinoPlayRandomGame {
218
239
  return (h("div", { class: "RandomGameLoading" }, h("div", { class: "Title" }, translate('randomGameLoading', this.language))));
219
240
  }
220
241
  if (!this.isLoading) {
221
- return h("div", { class: "RandomGameWrapper" }, h("div", { class: 'GameContainerGradient' }), h("div", { class: 'GamesContainer', ref: (el) => this.gameContainer = el }, this.gamesToShow && this.gamesToShow.map((game, index) => (h("div", { class: 'RandomGameCard', key: index, onClick: this.launchByGameCard === 'true' ? () => this.playGame() : null }, h("div", { class: "RandomGameVendor" }, game.vendor.name), h("img", { class: 'RandomGameImage', src: game.thumbnail, alt: game.name, title: game.name }), this.selectedGame && this.selectedGameIndex === index && this.renderGameDetails())))), h("div", { class: `ButtonWrapper ${this.animationDone ? 'HideAnimation' : ''}` }, h("div", { class: "ButtonContainer" }, this.iconVisibility && h("div", { class: `ButtonIcon ${this.animationStarted ? 'Flip' : ''}` }, h("div", { class: "QustionMark" }, "?"), h("div", { class: "HexagonMarkShadow" }), h("div", { class: "HexagonMark" })), !this.animationStarted && h("div", { class: `RandomButton ${this.animationStarted ? 'HideAnimation' : ''}`, onClick: () => this.playRandomGame() }, translate('playRandomGame', this.language)))));
242
+ return h("div", { class: "RandomGameWrapper", ref: el => this.stylingContainer = el }, h("div", { class: 'GameContainerGradient' }), h("div", { class: 'GamesContainer', ref: (el) => this.gameContainer = el }, this.gamesToShow && this.gamesToShow.map((game, index) => (h("div", { class: 'RandomGameCard', key: index, onClick: this.launchByGameCard === 'true' ? () => this.playGame() : null }, h("div", { class: "RandomGameVendor" }, game.vendor.name), h("img", { class: 'RandomGameImage', src: game.thumbnail, alt: game.name, title: game.name }), this.selectedGame && this.selectedGameIndex === index && this.renderGameDetails())))), h("div", { class: `ButtonWrapper ${this.animationDone ? 'HideAnimation' : ''}` }, h("div", { class: "ButtonContainer" }, this.iconVisibility && h("div", { class: `ButtonIcon ${this.animationStarted ? 'Flip' : ''}` }, h("div", { class: "QustionMark" }, "?"), h("div", { class: "HexagonMarkShadow" }), h("div", { class: "HexagonMark" })), !this.animationStarted && h("div", { class: `RandomButton ${this.animationStarted ? 'HideAnimation' : ''}`, onClick: () => this.playRandomGame() }, translate('playRandomGame', this.language)))));
222
243
  }
223
244
  }
224
245
  static get is() { return "casino-play-random-game"; }
@@ -249,6 +270,8 @@ export class CasinoPlayRandomGame {
249
270
  "tags": [],
250
271
  "text": "Endpoint URL for the source of data"
251
272
  },
273
+ "getter": false,
274
+ "setter": false,
252
275
  "attribute": "endpoint",
253
276
  "reflect": true
254
277
  },
@@ -266,6 +289,8 @@ export class CasinoPlayRandomGame {
266
289
  "tags": [],
267
290
  "text": "Name of the datasource, as configured in CE."
268
291
  },
292
+ "getter": false,
293
+ "setter": false,
269
294
  "attribute": "datasource",
270
295
  "reflect": true
271
296
  },
@@ -283,6 +308,8 @@ export class CasinoPlayRandomGame {
283
308
  "tags": [],
284
309
  "text": "Language of the widget"
285
310
  },
311
+ "getter": false,
312
+ "setter": false,
286
313
  "attribute": "language",
287
314
  "reflect": true,
288
315
  "defaultValue": "'en'"
@@ -301,6 +328,8 @@ export class CasinoPlayRandomGame {
301
328
  "tags": [],
302
329
  "text": "Configure a specific category for randomising the games."
303
330
  },
331
+ "getter": false,
332
+ "setter": false,
304
333
  "attribute": "specific-category",
305
334
  "reflect": true,
306
335
  "defaultValue": "''"
@@ -319,6 +348,8 @@ export class CasinoPlayRandomGame {
319
348
  "tags": [],
320
349
  "text": "Icon visible initially"
321
350
  },
351
+ "getter": false,
352
+ "setter": false,
322
353
  "attribute": "icon-visible",
323
354
  "reflect": true,
324
355
  "defaultValue": "''"
@@ -337,6 +368,8 @@ export class CasinoPlayRandomGame {
337
368
  "tags": [],
338
369
  "text": "Icon visible while rolling"
339
370
  },
371
+ "getter": false,
372
+ "setter": false,
340
373
  "attribute": "icon-visible-on-anim",
341
374
  "reflect": true,
342
375
  "defaultValue": "''"
@@ -355,10 +388,31 @@ export class CasinoPlayRandomGame {
355
388
  "tags": [],
356
389
  "text": "Open event on the game card."
357
390
  },
391
+ "getter": false,
392
+ "setter": false,
358
393
  "attribute": "launch-by-game-card",
359
394
  "reflect": true,
360
395
  "defaultValue": "''"
361
396
  },
397
+ "mbSource": {
398
+ "type": "string",
399
+ "mutable": false,
400
+ "complexType": {
401
+ "original": "string",
402
+ "resolved": "string",
403
+ "references": {}
404
+ },
405
+ "required": false,
406
+ "optional": false,
407
+ "docs": {
408
+ "tags": [],
409
+ "text": "Client custom styling via streamStyling"
410
+ },
411
+ "getter": false,
412
+ "setter": false,
413
+ "attribute": "mb-source",
414
+ "reflect": true
415
+ },
362
416
  "clientStyling": {
363
417
  "type": "string",
364
418
  "mutable": false,
@@ -373,6 +427,8 @@ export class CasinoPlayRandomGame {
373
427
  "tags": [],
374
428
  "text": "Client custom styling via string"
375
429
  },
430
+ "getter": false,
431
+ "setter": false,
376
432
  "attribute": "client-styling",
377
433
  "reflect": true,
378
434
  "defaultValue": "''"
@@ -391,6 +447,8 @@ export class CasinoPlayRandomGame {
391
447
  "tags": [],
392
448
  "text": "Client custom styling via url"
393
449
  },
450
+ "getter": false,
451
+ "setter": false,
394
452
  "attribute": "client-styling-url",
395
453
  "reflect": true,
396
454
  "defaultValue": "''"
@@ -409,6 +467,8 @@ export class CasinoPlayRandomGame {
409
467
  "tags": [],
410
468
  "text": "Translations via URL"
411
469
  },
470
+ "getter": false,
471
+ "setter": false,
412
472
  "attribute": "translation-url",
413
473
  "reflect": true,
414
474
  "defaultValue": "''"
@@ -418,7 +478,6 @@ export class CasinoPlayRandomGame {
418
478
  static get states() {
419
479
  return {
420
480
  "hasErrors": {},
421
- "limitStylingAppends": {},
422
481
  "isLoading": {},
423
482
  "gamesToShow": {},
424
483
  "selectedGame": {},
@@ -443,6 +502,12 @@ export class CasinoPlayRandomGame {
443
502
  }, {
444
503
  "propName": "iconVisible",
445
504
  "methodName": "handleIsIconVisible"
505
+ }, {
506
+ "propName": "clientStyling",
507
+ "methodName": "handleClientStylingChange"
508
+ }, {
509
+ "propName": "clientStylingUrl",
510
+ "methodName": "handleClientStylingChangeURL"
446
511
  }];
447
512
  }
448
513
  }
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, h, g as getElement } from './index-eac6b960.js';
1
+ import { r as registerInstance, h, g as getElement } from './index-29915e18.js';
2
2
 
3
3
  const getDevice = () => {
4
4
  let userAgent = window.navigator.userAgent;
@@ -81,12 +81,106 @@ const translate = (key, customLang) => {
81
81
  return TRANSLATIONS[(lang !== undefined) && (lang in TRANSLATIONS) ? lang : DEFAULT_LANGUAGE][key];
82
82
  };
83
83
 
84
+ /**
85
+ * @name setClientStyling
86
+ * @description Method used to create and append to the passed element of the widget a style element with the content received
87
+ * @param {HTMLElement} stylingContainer The reference element of the widget
88
+ * @param {string} clientStyling The style content
89
+ */
90
+ function setClientStyling(stylingContainer, clientStyling) {
91
+ if (stylingContainer) {
92
+ const sheet = document.createElement('style');
93
+ sheet.innerHTML = clientStyling;
94
+ stylingContainer.appendChild(sheet);
95
+ }
96
+ }
97
+
98
+ /**
99
+ * @name setClientStylingURL
100
+ * @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
101
+ * @param {HTMLElement} stylingContainer The reference element of the widget
102
+ * @param {string} clientStylingUrl The URL of the style content
103
+ */
104
+ function setClientStylingURL(stylingContainer, clientStylingUrl) {
105
+ const url = new URL(clientStylingUrl);
106
+
107
+ fetch(url.href)
108
+ .then((res) => res.text())
109
+ .then((data) => {
110
+ const cssFile = document.createElement('style');
111
+ cssFile.innerHTML = data;
112
+ if (stylingContainer) {
113
+ stylingContainer.appendChild(cssFile);
114
+ }
115
+ })
116
+ .catch((err) => {
117
+ console.error('There was an error while trying to load client styling from URL', err);
118
+ });
119
+ }
120
+
121
+ /**
122
+ * @name setStreamLibrary
123
+ * @description Method used to create and append to the passed element of the widget a style element with content fetched from the MessageBus
124
+ * @param {HTMLElement} stylingContainer The highest element of the widget
125
+ * @param {string} domain The domain from where the content should be fetched (e.g. 'Casino.Style', 'App.Style', 'casino-footer.style', etc.)
126
+ * @param {ref} subscription A reference to a variable where the subscription should be saved for unsubscribing when no longer needed
127
+ */
128
+ function setStreamStyling(stylingContainer, domain, subscription) {
129
+ if (window.emMessageBus) {
130
+ const sheet = document.createElement('style');
131
+
132
+ window.emMessageBus.subscribe(domain, (data) => {
133
+ sheet.innerHTML = data;
134
+ if (stylingContainer) {
135
+ stylingContainer.appendChild(sheet);
136
+ }
137
+ });
138
+ }
139
+ }
140
+
84
141
  const casinoPlayRandomGameCss = ":host {\n display: block;\n font-family: inherit;\n -webkit-transform: translate3d(0, 0, 0);\n transform: translate3d(0, 0, 0);\n}\n\n:host * {\n -webkit-transform: translate3d(0, 0, 0);\n transform: translate3d(0, 0, 0);\n}\n\n.RandomGameWrapper {\n width: 100%;\n height: var(--emw--size-4x-medium, 700px);\n background: transparent;\n position: relative;\n overflow: hidden;\n}\n\n.GameContainerGradient {\n position: absolute;\n top: 10%;\n left: -5px;\n width: 100vw;\n height: 80%;\n background: linear-gradient(90deg, var(--emw--color-background, rgba(0, 0, 0, 0.9)) 0%, rgba(14, 21, 17, 0.5) 25%, rgba(14, 21, 17, 0) 50%, rgba(14, 21, 16, 0.5) 75%, var(--emw--color-background, rgba(10, 0, 0, 0.9)) 100%);\n pointer-events: none;\n z-index: 1;\n filter: blur(10px);\n}\n\n.GamesContainer {\n display: flex;\n height: var(--emw--size-4x-medium, 600px);\n flex-direction: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n align-content: flex-start;\n gap: var(--emw--spacing-large, 20px);\n}\n\n.RandomGameCard {\n position: relative;\n width: var(--emw--size-3x-medium, 300px);\n height: var(--emw--size-4x-medium, 420px);\n border-radius: var(--emw--border-radius-large, 20px);\n top: 8%;\n filter: blur(5px);\n}\n.RandomGameCard .RandomGameVendor {\n position: absolute;\n font-size: var(--emw--font-size-x-small, 12px);\n bottom: var(--emw--spacing-small-minus, 10px);\n left: var(--emw--spacing-small-minus, 10px);\n color: var(--emw--color-typography, #FFFFFF);\n}\n\n.TheRandomGame {\n animation-name: ZoomFadeIn;\n animation-duration: 0.5s;\n animation-fill-mode: forwards;\n -webkit-animation-name: ZoomFadeIn;\n -webkit-animation-duration: 0.5s;\n -webkit-animation-fill-mode: forwards;\n opacity: 1;\n cursor: pointer;\n filter: blur(0);\n}\n\n.RandomGameImage {\n width: inherit;\n height: inherit;\n object-fit: cover;\n border-radius: var(--emw--border-radius-large, 20px);\n}\n\n.RandomGameDetails {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n color: var(--emw--color-typography, #FFFFFF);\n font-size: var(--emw--font-size-small, 14px);\n width: 100%;\n}\n.RandomGameDetails .RandomGameTitle {\n line-height: 18px;\n}\n.RandomGameDetails .RandomGameInfo {\n border-radius: 50%;\n width: var(--emw--spacing-medium, 16px);\n height: var(--emw--spacing-medium, 16px);\n font-size: var(--emw--font-size-x-small, 12px);\n font-weight: var(--emw--font-weight-normal, 400);\n border: solid 1px var(--emw--color-typography, #FFFFFF);\n text-align: center;\n margin: var(--emw--spacing-2x-small, 4px) 0;\n line-height: 14px;\n cursor: pointer;\n}\n.RandomGameDetails .RandomGamePlay {\n background: var(--emw--color-primary, #4bd004);\n color: var(--emw--color-typography, #FFFFFF);\n border: none;\n border-radius: var(--emw--border-radius-medium, 5px);\n width: 200px;\n height: 40px;\n font-size: var(--emw--font-size-small, 14px);\n cursor: pointer;\n}\n\n.ButtonWrapper {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 20;\n}\n\n.ButtonContainer {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n gap: 10px;\n width: 100%;\n position: relative;\n}\n\n.ButtonIcon {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n gap: var(--emw--spacing-2x-small, 5px);\n}\n\n.QustionMark {\n position: absolute;\n font-family: sans-serif;\n font-size: 120px;\n font-weight: 900;\n color: color-mix(in srgb, var(--emw--color-primary, #22B04E) 80%, black 10%);\n text-shadow: 0px 12px 0px color-mix(in srgb, var(--emw--casino-color-secondary, var(--emw--color-secondary, #eeac4a)), black 50%);\n left: 50%;\n top: -20%;\n transform: translateX(-50%);\n z-index: 10;\n}\n\n.HexagonMarkShadow {\n width: 100px;\n height: 115px;\n display: flex;\n justify-content: center;\n align-items: center;\n background: color-mix(in srgb, var(--emw--casino-color-secondary, var(--emw--color-secondary, #eeac4a)), black 70%);\n clip-path: polygon(50% 0, 100% 30%, 100% 70%, 50% 100%, 0% 70%, 0% 30%);\n}\n\n.HexagonMark {\n position: absolute;\n width: var(--emw--size-medium, 90px);\n height: 105px;\n background: linear-gradient(to bottom, color-mix(in srgb, var(--emw--casino-color-secondary, var(--emw--color-secondary, #eeac4a)), black 20%) 0%, var(--emw--categories-color-secondary, var(--emw--color-secondary, #eeac4a)) 100%);\n clip-path: polygon(50% 0, 100% 30%, 100% 70%, 50% 100%, 0% 70%, 0% 30%);\n}\n\n.RandomButtons {\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n gap: var(--emw--spacing-2x-small, 5px);\n width: 100%;\n position: relative;\n z-index: 10;\n}\n\n.RandomButton {\n font-size: var(--emw--font-size-large, 20px);\n text-transform: uppercase;\n width: max-content;\n border-radius: var(--emw--button-border-radius, 50px);\n padding: var(--emw--spacing-large, 20px) var(--emw--spacing-2x-large, 40px);\n border: solid 3px var(--emw--button-border-color, #063B17);\n color: var(--emw--button-text-color, #FFFFFF);\n opacity: 1;\n animation: ButtonEffect 3s linear infinite;\n background-image: linear-gradient(to right, var(--emw--color-primary, #22B04E), color-mix(in srgb, var(--emw--color-primary, #22B04E), black 30%), var(--emw--color-primary, #22B04E));\n background-size: 300% 100%;\n cursor: pointer;\n position: relative;\n z-index: 10;\n}\n.RandomButton:hover {\n opacity: 0.8;\n}\n\n.HideAnimation {\n filter: blur(5px);\n animation: AnimateButton 0.2s forwards;\n}\n\n.Flip {\n animation-name: Flip, Blur;\n animation-duration: 0.75s, 3s;\n animation-iteration-count: infinite, 1;\n -webkit-animation-name: Flip, Blur;\n -webkit-animation-duration: 0.75s, 3s;\n -webkit-animation-iteration-count: infinite, 1;\n}\n\n@keyframes ButtonEffect {\n 0% {\n background-position: 0% 50%;\n }\n 33% {\n background-position: 100% 50%;\n }\n 66% {\n background-position: 200% 50%;\n }\n 100% {\n background-position: 300% 50%;\n }\n}\n@keyframes ZoomFadeIn {\n 0% {\n transform: scale(0.2) translateY(0);\n filter: blur(5px);\n opacity: 0.3;\n }\n 50% {\n transform: scale(1.1) translateY(-30px);\n filter: blur(2px);\n opacity: 0.7;\n }\n 100% {\n transform: scale(1) translateY(-30px);\n filter: blur(0px);\n opacity: 1;\n }\n}\n@keyframes AnimateButton {\n 0% {\n opacity: 0.7;\n }\n 50% {\n opacity: 0.4;\n }\n 100% {\n opacity: 0;\n display: none;\n }\n}\n@keyframes Flip {\n 0% {\n transform: rotateY(0deg);\n }\n 50% {\n transform: rotateY(180deg);\n }\n 100% {\n transform: rotateY(360deg);\n }\n}\n@keyframes Blur {\n 0% {\n filter: blur(0);\n }\n 50% {\n filter: blur(1px);\n }\n 100% {\n filter: blur(3px);\n }\n}\n@container (max-width: 475px) {\n .GamesContainer {\n height: inherit;\n gap: var(--emw--spacing-2x-small, 5px);\n }\n .RandomGameWrapper {\n width: 100%;\n height: 300px;\n overflow: hidden;\n background: transparent;\n position: relative;\n }\n .GameContainerGradient {\n position: absolute;\n top: 10%;\n left: -5px;\n width: 100vw;\n height: 80%;\n background: linear-gradient(90deg, var(--emw--color-background, rgba(0, 0, 0, 0.9)) 0%, rgba(14, 21, 17, 0.2) 25%, rgba(14, 21, 17, 0) 50%, rgba(14, 21, 16, 0.2) 75%, var(--emw--color-background, rgba(10, 0, 0, 0.9)) 100%);\n pointer-events: none;\n z-index: 1;\n filter: blur(5px);\n }\n .RandomGameCard {\n width: 100px;\n height: 150px;\n top: 0%;\n border-radius: var(--emw--border-radius-medium, 4px);\n filter: blur(5px);\n }\n .RandomGameImage {\n width: 102px;\n height: inherit;\n top: 0%;\n }\n .RandomGameDetails {\n font-size: 14px;\n width: 100%;\n }\n .RandomGameDetails .RandomGameTitle {\n line-height: 18px;\n width: 75%;\n }\n .RandomGameDetails .RandomGameInfo {\n border-radius: 50%;\n width: 16px;\n height: 16px;\n font-size: var(--emw--font-size-x-small, 12px);\n line-height: 14px;\n }\n .RandomGameDetails .RandomGamePlay {\n background: var(--emw--color-primary, #52d004);\n color: var(--emw--color-typography, #FFFFFF);\n border: none;\n border-radius: 5px;\n width: 200px;\n height: 40px;\n font-size: 14px;\n cursor: pointer;\n }\n .RandomGameCard .RandomGameVendor {\n font-size: var(--emw--font-size-x-small, 12px);\n bottom: 5px;\n right: 5px;\n }\n .RandomButtons {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n gap: 5px;\n width: 100%;\n }\n .RandomButton {\n font-size: var(--emw--font-size-x-small, 12px);\n padding: 10px 15px;\n border: solid 1px var(--emw--button-border-color, #063B17);\n }\n .QustionMark {\n font-size: 100px;\n font-weight: 700;\n }\n .HexagonMarkShadow {\n width: 80px;\n height: 95px;\n }\n .HexagonMark {\n width: 70px;\n height: 85px;\n }\n}";
85
142
  const CasinoPlayRandomGameStyle0 = casinoPlayRandomGameCss;
86
143
 
87
144
  const CasinoPlayRandomGame = class {
88
145
  constructor(hostRef) {
89
146
  registerInstance(this, hostRef);
147
+ /**
148
+ * Language of the widget
149
+ */
150
+ this.language = 'en';
151
+ /**
152
+ * Configure a specific category for randomising the games.
153
+ */
154
+ this.specificCategory = '';
155
+ /**
156
+ * Icon visible initially
157
+ */
158
+ this.iconVisible = '';
159
+ /**
160
+ * Icon visible while rolling
161
+ */
162
+ this.iconVisibleOnAnim = '';
163
+ /**
164
+ * Open event on the game card.
165
+ */
166
+ this.launchByGameCard = '';
167
+ /**
168
+ * Client custom styling via string
169
+ */
170
+ this.clientStyling = '';
171
+ /**
172
+ * Client custom styling via url
173
+ */
174
+ this.clientStylingUrl = '';
175
+ /**
176
+ * Translations via URL
177
+ */
178
+ this.translationUrl = '';
179
+ this.hasErrors = false;
180
+ this.isLoading = true;
181
+ this.selectedGame = null;
182
+ this.animationDone = false;
183
+ this.animationStarted = false;
90
184
  this.animation = null;
91
185
  this.selectedGameIndex = null;
92
186
  this.selectedGameEl = null;
@@ -101,39 +195,6 @@ const CasinoPlayRandomGame = class {
101
195
  }
102
196
  return array;
103
197
  };
104
- this.setClientStyling = () => {
105
- let sheet = document.createElement('style');
106
- sheet.innerHTML = this.clientStyling;
107
- this.host.shadowRoot.prepend(sheet);
108
- };
109
- this.setClientStylingURL = () => {
110
- let url = new URL(this.clientStylingUrl);
111
- let cssFile = document.createElement('style');
112
- fetch(url.href)
113
- .then((res) => res.text())
114
- .then((data) => {
115
- cssFile.innerHTML = data;
116
- this.clientStyling = data;
117
- setTimeout(() => { this.host.shadowRoot.prepend(cssFile); }, 1);
118
- });
119
- };
120
- this.endpoint = undefined;
121
- this.datasource = undefined;
122
- this.language = 'en';
123
- this.specificCategory = '';
124
- this.iconVisible = '';
125
- this.iconVisibleOnAnim = '';
126
- this.launchByGameCard = '';
127
- this.clientStyling = '';
128
- this.clientStylingUrl = '';
129
- this.translationUrl = '';
130
- this.hasErrors = false;
131
- this.limitStylingAppends = false;
132
- this.isLoading = true;
133
- this.gamesToShow = undefined;
134
- this.selectedGame = null;
135
- this.animationDone = false;
136
- this.animationStarted = false;
137
198
  }
138
199
  watchEndpoint(newValue, oldValue) {
139
200
  if (newValue && newValue != oldValue && this.endpoint) {
@@ -149,6 +210,17 @@ const CasinoPlayRandomGame = class {
149
210
  handleIsIconVisible() {
150
211
  this.iconVisibility = this.iconVisible === 'true' ? true : false;
151
212
  }
213
+ handleClientStylingChange(newValue, oldValue) {
214
+ if (newValue != oldValue) {
215
+ setClientStyling(this.stylingContainer, this.clientStyling);
216
+ }
217
+ }
218
+ handleClientStylingChangeURL(newValue, oldValue) {
219
+ if (newValue != oldValue) {
220
+ if (this.clientStylingUrl)
221
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
222
+ }
223
+ }
152
224
  connectedCallback() {
153
225
  this.handleIsIconVisible();
154
226
  }
@@ -161,14 +233,19 @@ const CasinoPlayRandomGame = class {
161
233
  }
162
234
  }
163
235
  componentDidLoad() {
164
- if (!this.limitStylingAppends && this.host) {
236
+ if (window.emMessageBus != undefined) {
237
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
238
+ }
239
+ else {
165
240
  if (this.clientStyling)
166
- this.setClientStyling();
241
+ setClientStyling(this.stylingContainer, this.clientStyling);
167
242
  if (this.clientStylingUrl)
168
- this.setClientStylingURL();
169
- this.limitStylingAppends = true;
243
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
170
244
  }
171
245
  }
246
+ disconnectedCallback() {
247
+ this.stylingSubscription && this.stylingSubscription.unsubscribe();
248
+ }
172
249
  fetchGameList() {
173
250
  let url = new URL(`${this.endpoint}/v1/casino/games`);
174
251
  url.searchParams.append('platform', getDevice());
@@ -302,7 +379,7 @@ const CasinoPlayRandomGame = class {
302
379
  return (h("div", { class: "RandomGameLoading" }, h("div", { class: "Title" }, translate('randomGameLoading', this.language))));
303
380
  }
304
381
  if (!this.isLoading) {
305
- return h("div", { class: "RandomGameWrapper" }, h("div", { class: 'GameContainerGradient' }), h("div", { class: 'GamesContainer', ref: (el) => this.gameContainer = el }, this.gamesToShow && this.gamesToShow.map((game, index) => (h("div", { class: 'RandomGameCard', key: index, onClick: this.launchByGameCard === 'true' ? () => this.playGame() : null }, h("div", { class: "RandomGameVendor" }, game.vendor.name), h("img", { class: 'RandomGameImage', src: game.thumbnail, alt: game.name, title: game.name }), this.selectedGame && this.selectedGameIndex === index && this.renderGameDetails())))), h("div", { class: `ButtonWrapper ${this.animationDone ? 'HideAnimation' : ''}` }, h("div", { class: "ButtonContainer" }, this.iconVisibility && h("div", { class: `ButtonIcon ${this.animationStarted ? 'Flip' : ''}` }, h("div", { class: "QustionMark" }, "?"), h("div", { class: "HexagonMarkShadow" }), h("div", { class: "HexagonMark" })), !this.animationStarted && h("div", { class: `RandomButton ${this.animationStarted ? 'HideAnimation' : ''}`, onClick: () => this.playRandomGame() }, translate('playRandomGame', this.language)))));
382
+ return h("div", { class: "RandomGameWrapper", ref: el => this.stylingContainer = el }, h("div", { class: 'GameContainerGradient' }), h("div", { class: 'GamesContainer', ref: (el) => this.gameContainer = el }, this.gamesToShow && this.gamesToShow.map((game, index) => (h("div", { class: 'RandomGameCard', key: index, onClick: this.launchByGameCard === 'true' ? () => this.playGame() : null }, h("div", { class: "RandomGameVendor" }, game.vendor.name), h("img", { class: 'RandomGameImage', src: game.thumbnail, alt: game.name, title: game.name }), this.selectedGame && this.selectedGameIndex === index && this.renderGameDetails())))), h("div", { class: `ButtonWrapper ${this.animationDone ? 'HideAnimation' : ''}` }, h("div", { class: "ButtonContainer" }, this.iconVisibility && h("div", { class: `ButtonIcon ${this.animationStarted ? 'Flip' : ''}` }, h("div", { class: "QustionMark" }, "?"), h("div", { class: "HexagonMarkShadow" }), h("div", { class: "HexagonMark" })), !this.animationStarted && h("div", { class: `RandomButton ${this.animationStarted ? 'HideAnimation' : ''}`, onClick: () => this.playRandomGame() }, translate('playRandomGame', this.language)))));
306
383
  }
307
384
  }
308
385
  get host() { return getElement(this); }
@@ -311,7 +388,9 @@ const CasinoPlayRandomGame = class {
311
388
  "datasource": ["watchEndpoint"],
312
389
  "language": ["watchEndpoint"],
313
390
  "translationUrl": ["handleNewTranslations"],
314
- "iconVisible": ["handleIsIconVisible"]
391
+ "iconVisible": ["handleIsIconVisible"],
392
+ "clientStyling": ["handleClientStylingChange"],
393
+ "clientStylingUrl": ["handleClientStylingChangeURL"]
315
394
  }; }
316
395
  };
317
396
  CasinoPlayRandomGame.style = CasinoPlayRandomGameStyle0;
@@ -1,9 +1,9 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-eac6b960.js';
2
- export { s as setNonce } from './index-eac6b960.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-29915e18.js';
2
+ export { s as setNonce } from './index-29915e18.js';
3
3
  import { g as globalScripts } from './app-globals-0f993ce5.js';
4
4
 
5
5
  /*
6
- Stencil Client Patch Browser v4.22.3 | MIT Licensed | https://stenciljs.com
6
+ Stencil Client Patch Browser v4.26.0 | MIT Licensed | https://stenciljs.com
7
7
  */
8
8
  var patchBrowser = () => {
9
9
  const importMeta = import.meta.url;
@@ -16,5 +16,5 @@ var patchBrowser = () => {
16
16
 
17
17
  patchBrowser().then(async (options) => {
18
18
  await globalScripts();
19
- return bootstrapLazy([["casino-play-random-game",[[1,"casino-play-random-game",{"endpoint":[513],"datasource":[513],"language":[513],"specificCategory":[513,"specific-category"],"iconVisible":[513,"icon-visible"],"iconVisibleOnAnim":[513,"icon-visible-on-anim"],"launchByGameCard":[513,"launch-by-game-card"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"hasErrors":[32],"limitStylingAppends":[32],"isLoading":[32],"gamesToShow":[32],"selectedGame":[32],"animationDone":[32],"animationStarted":[32]},null,{"endpoint":["watchEndpoint"],"datasource":["watchEndpoint"],"language":["watchEndpoint"],"translationUrl":["handleNewTranslations"],"iconVisible":["handleIsIconVisible"]}]]]], options);
19
+ return bootstrapLazy([["casino-play-random-game",[[1,"casino-play-random-game",{"endpoint":[513],"datasource":[513],"language":[513],"specificCategory":[513,"specific-category"],"iconVisible":[513,"icon-visible"],"iconVisibleOnAnim":[513,"icon-visible-on-anim"],"launchByGameCard":[513,"launch-by-game-card"],"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"hasErrors":[32],"isLoading":[32],"gamesToShow":[32],"selectedGame":[32],"animationDone":[32],"animationStarted":[32]},null,{"endpoint":["watchEndpoint"],"datasource":["watchEndpoint"],"language":["watchEndpoint"],"translationUrl":["handleNewTranslations"],"iconVisible":["handleIsIconVisible"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"]}]]]], options);
20
20
  });