@everymatrix/casino-engagement-suite-challenges-details 1.44.0 → 1.45.2

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 (57) hide show
  1. package/dist/casino-engagement-suite-challenges-details/casino-engagement-suite-challenges-details.esm.js +1 -1
  2. package/dist/casino-engagement-suite-challenges-details/p-11d8b487.js +2 -0
  3. package/dist/casino-engagement-suite-challenges-details/p-8bbfff73.entry.js +1 -0
  4. package/dist/casino-engagement-suite-challenges-details/p-e1255160.js +1 -0
  5. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  6. package/dist/cjs/casino-engagement-suite-challenges-details.cjs.js +17 -11
  7. package/dist/cjs/casino-engagement-suite-challenges-details_2.cjs.entry.js +293 -323
  8. package/dist/cjs/index-a758ba24.js +1249 -0
  9. package/dist/cjs/loader.cjs.js +7 -13
  10. package/dist/collection/collection-manifest.json +3 -3
  11. package/dist/collection/components/casino-engagement-suite-challenges-details/casino-engagement-suite-challenges-details.css +63 -61
  12. package/dist/collection/components/casino-engagement-suite-challenges-details/casino-engagement-suite-challenges-details.js +438 -493
  13. package/dist/collection/components/casino-engagement-suite-challenges-details/index.js +1 -0
  14. package/dist/collection/models/casino-challenges-details.js +10 -10
  15. package/dist/collection/utils/index.js +8 -2
  16. package/dist/collection/utils/locale.utils.js +18 -18
  17. package/dist/collection/utils/utils.js +3 -0
  18. package/dist/esm/app-globals-0f993ce5.js +3 -0
  19. package/dist/esm/casino-engagement-suite-challenges-details.js +14 -11
  20. package/dist/esm/casino-engagement-suite-challenges-details_2.entry.js +293 -323
  21. package/dist/esm/index-c193b756.js +1221 -0
  22. package/dist/esm/loader.js +7 -13
  23. package/dist/stencil.config.dev.js +17 -0
  24. package/dist/stencil.config.js +14 -19
  25. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/casino-engagement-suite-challenges-details/.stencil/packages/stencil/casino-engagement-suite-challenges-details/stencil.config.d.ts +2 -0
  26. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/casino-engagement-suite-challenges-details/.stencil/packages/stencil/casino-engagement-suite-challenges-details/stencil.config.dev.d.ts +2 -0
  27. package/dist/types/components/casino-engagement-suite-challenges-details/casino-engagement-suite-challenges-details.d.ts +70 -70
  28. package/dist/types/components/casino-engagement-suite-challenges-details/index.d.ts +1 -0
  29. package/dist/types/components.d.ts +21 -3
  30. package/dist/types/models/casino-challenges-details.d.ts +46 -46
  31. package/dist/types/stencil-public-runtime.d.ts +142 -33
  32. package/dist/types/utils/index.d.ts +1 -0
  33. package/dist/types/utils/utils.d.ts +1 -0
  34. package/loader/cdn.js +1 -3
  35. package/loader/index.cjs.js +1 -3
  36. package/loader/index.d.ts +13 -1
  37. package/loader/index.es2017.js +1 -3
  38. package/loader/index.js +1 -3
  39. package/loader/package.json +1 -0
  40. package/package.json +12 -2
  41. package/dist/casino-engagement-suite-challenges-details/p-80848cd8.entry.js +0 -1
  42. package/dist/casino-engagement-suite-challenges-details/p-808a7dc5.js +0 -1
  43. package/dist/cjs/index-a0eb9215.js +0 -1279
  44. package/dist/components/casino-engagement-suite-challenges-details.d.ts +0 -11
  45. package/dist/components/casino-engagement-suite-challenges-details.js +0 -318
  46. package/dist/components/casino-engagement-suite-progress-bar.js +0 -6
  47. package/dist/components/casino-engagement-suite-progress-bar2.js +0 -107
  48. package/dist/components/index.d.ts +0 -26
  49. package/dist/components/index.js +0 -1
  50. package/dist/esm/index-c5abae48.js +0 -1252
  51. package/dist/esm/polyfills/core-js.js +0 -11
  52. package/dist/esm/polyfills/css-shim.js +0 -1
  53. package/dist/esm/polyfills/dom.js +0 -79
  54. package/dist/esm/polyfills/es5-html-element.js +0 -1
  55. package/dist/esm/polyfills/index.js +0 -34
  56. package/dist/esm/polyfills/system.js +0 -6
  57. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/casino-engagement-suite-challenges-details/.stencil/packages/casino-engagement-suite-challenges-details/stencil.config.d.ts +0 -2
@@ -1,11 +0,0 @@
1
- import type { Components, JSX } from "../types/components";
2
-
3
- interface CasinoEngagementSuiteChallengesDetails extends Components.CasinoEngagementSuiteChallengesDetails, HTMLElement {}
4
- export const CasinoEngagementSuiteChallengesDetails: {
5
- prototype: CasinoEngagementSuiteChallengesDetails;
6
- new (): CasinoEngagementSuiteChallengesDetails;
7
- };
8
- /**
9
- * Used to define this component and all nested components recursively.
10
- */
11
- export const defineCustomElement: () => void;
@@ -1,318 +0,0 @@
1
- import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
- import { d as defineCustomElement$2 } from './casino-engagement-suite-progress-bar2.js';
3
-
4
- const DEFAULT_LANGUAGE = 'en';
5
- const SUPPORTED_LANGUAGES = ['en'];
6
- const TRANSLATIONS = {
7
- en: {
8
- missions: 'Missions',
9
- join: 'Join',
10
- unjoin: 'Unjoin',
11
- new: 'new',
12
- details: 'Mission Details',
13
- tc: 'Terms & Conditions',
14
- level: 'Level',
15
- place: 'Place',
16
- bet: 'bet',
17
- bets: 'bets',
18
- win: 'Win',
19
- minBet: 'Min Bet',
20
- maxBet: 'Max Bet',
21
- contribution: 'Contribution'
22
- }
23
- };
24
- const translate = (key, customLang) => {
25
- const lang = customLang;
26
- return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
27
- };
28
-
29
- var ChallengeLevelProgressStatus;
30
- (function (ChallengeLevelProgressStatus) {
31
- ChallengeLevelProgressStatus[ChallengeLevelProgressStatus["Closed"] = 0] = "Closed";
32
- ChallengeLevelProgressStatus[ChallengeLevelProgressStatus["InProgress"] = 1] = "InProgress";
33
- ChallengeLevelProgressStatus[ChallengeLevelProgressStatus["Fillup"] = 2] = "Fillup";
34
- ChallengeLevelProgressStatus[ChallengeLevelProgressStatus["Completed"] = 3] = "Completed";
35
- })(ChallengeLevelProgressStatus || (ChallengeLevelProgressStatus = {}));
36
- var ChallengeProgressStatus;
37
- (function (ChallengeProgressStatus) {
38
- ChallengeProgressStatus[ChallengeProgressStatus["Started"] = 0] = "Started";
39
- ChallengeProgressStatus[ChallengeProgressStatus["InProgress"] = 1] = "InProgress";
40
- ChallengeProgressStatus[ChallengeProgressStatus["PendingLevelReward"] = 2] = "PendingLevelReward";
41
- ChallengeProgressStatus[ChallengeProgressStatus["Completed"] = 3] = "Completed";
42
- ChallengeProgressStatus[ChallengeProgressStatus["Expired"] = 4] = "Expired";
43
- ChallengeProgressStatus[ChallengeProgressStatus["Forfeited"] = 5] = "Forfeited";
44
- })(ChallengeProgressStatus || (ChallengeProgressStatus = {}));
45
-
46
- function formatBalance(amount, currency) {
47
- return `${currency}${new Intl.NumberFormat('en', { minimumFractionDigits: 2, maximumFractionDigits: 2 })
48
- .format(amount)}`;
49
- }
50
-
51
- const casinoEngagementSuiteChallengesDetailsCss = "@import url(\"https://fonts.googleapis.com/css2?family=Montserrat:wght@600;700;900&display=swap\"); :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}.ChallengeDetailsPopup{display:flex;height:100%;background-color:var(--emw--color-background, #1E1638);border-radius:8px;overflow:hidden;flex-direction:column;position:relative}.ChallengeActions{display:flex;justify-content:space-between;align-items:center;padding:12px 8px 8px}.ChallengeActions .ChallengeIconButton{width:16px;height:16px;cursor:pointer}.ChallengeActions .ChallengeIconButton img{width:100%;height:100%}.ChallengeLabel{min-width:35px;height:18px;background:linear-gradient(180deg, #FFB801 15.86%, #FEF746 31.36%, #FBFFE0 36.86%, #FFFA60 47.86%, #FF9400 87.36%);border-radius:2px;display:none;position:absolute;top:-23px;right:0px;padding:0 2px;align-items:center;justify-content:center}.ChallengeLabel span{display:inline-block;text-transform:uppercase;font-size:var(--emw--font-size-x-small, 10px);line-height:10px;font-weight:var(--emw--font-weight-bold, 700);font-family:\"Montserrat\", sans-serif;color:var(--emw--color-typography, #1E1638)}.ShowChallengeLabel{display:inline-flex}.ChallengeDetails{padding:0px 19px 10px;overflow-y:auto;-ms-overflow-style:none;scrollbar-width:none}.ChallengeDetails::-webkit-scrollbar{display:none}.ChallengeDetails.IsNewChallenge{padding-top:25px}.ChallengeDetailsHeader{position:relative;display:flex;justify-content:space-between;gap:12px}.ChallengeDetailsHeader .ChallengeName{font-family:\"Montserrat\", sans-serif;font-size:var(--emw--font-size-medium, 18px);font-weight:var(--emw--font-weight-bold, 700);line-height:22px;color:var(--emfe-w-color-white, #FFF);word-break:break-word}.ChallengeJoinButton.Joined::before{content:\"\";position:absolute;inset:0;border-radius:var(--emw--button-border-radius, 4px);padding:1px;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-mask:linear-gradient(#FFF 0 0) content-box, linear-gradient(#FFF 0 0);-webkit-mask-composite:xor;mask-composite:exclude}.ChallengeJoinButton{transition:all 0.5s ease-out;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);color:var(--emw--color-typography, #1E1638);border-radius:99px;min-width:88px;height:32px;font-size:14px;font-weight:700;position:relative;font-family:\"Montserrat\", sans-serif}.ChallengeJoinButton.Joined{background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}.ChallengeJoinButton.Joined::before{border-radius:99px}.Disabled{opacity:0.5;pointer-events:none;cursor:auto}.ChallengeCountdown{font-weight:var(--emw--font-weight-normal, 400);font-size:var(--emw--font-size-x-small, 12px);line-height:12px;margin-top:12px;color:var(--emw--color-gray-150, #BBB9C3)}.ChallengeCountdown.Expired{font-weight:var(--emw--font-weight-normal, 700);color:var(--emfe-w-color-white, #FFF)}.ChallengeCollapseButton{margin:24px 0 14px;display:flex;flex-direction:row;align-items:center;font-size:var(--emw--font-size-x-small, 12px);line-height:12px;color:var(--emw--color-primary-variant, #666178);cursor:pointer}.ChallengeCollapseButton .Toggle{width:16px;height:16px;display:block;margin-right:4px}.ChallengeCollapseButton .Closed{background:url(\"https://static.everymatrix.com/gic/img/engagement-suite/eye-closed.svg\") no-repeat center/contain}.ChallengeCollapseButton .Open{background:url(\"https://static.everymatrix.com/gic/img/engagement-suite/eye-open.svg\") no-repeat center/contain}.CollapseDetails{display:none;font-size:var(--emw--font-size-small, 14px);line-height:17px;font-weight:var(--emw--font-weight-normal, 400)}.CollapseDetails .ChallengeDescription{color:var(--emfe-w-color-white, #FFF);margin:12px 0}.CollapseDetails .TC{margin:12px 0 16px}.CollapseDetails .TC a{color:var(--emw--color-secondary, #59D1FF);text-underline-offset:3px}.CollapseDetails .ChallengeGames{width:100%;overflow-y:auto;display:flex;gap:4px}.CollapseDetails .ChallengeGames::-webkit-scrollbar{height:2px;background:none}.CollapseDetails .ChallengeGames::-webkit-scrollbar-thumb{border-radius:4px;background-color:var(--emw--color-background, #666178)}.CollapseDetails .ChallengeGames .Game img{width:96px;height:50px;border-radius:2px;cursor:pointer}.ShowDetails{display:block}.ChallengeLevels{display:flex;flex-direction:column;gap:16px;margin-top:24px;color:var(--emw--color-primary, #8F8B9C);font-size:var(--emw--font-size-small, 12px);font-weight:var(--emw--font-weight-normal, 400);line-height:12px}.ChallengeLevels .ChallengeLevelCard{border:1px solid var(--emw--button-border-color, #403956);padding:16px;border-radius:8px}.ChallengeLevels .ChallengeLevelCard .ChallengeLevelBetDetails{margin-top:25px;display:flex;flex-wrap:wrap;gap:8px}.ChallengeLevels .ChallengeLevelCard .ChallengeLevelBetDetail:not(:last-of-type){margin-right:8px}.ChallengeLevels .ChallengeLevelCard .ChallengeLevelBetRange,.ChallengeLevels .ChallengeLevelCard .ChallengeLevelBetContribution{font-weight:var(--emw--font-weight-semibold, 600)}.ChallengeLevels .ChallengeLevelCard .ChallengeLevelTitle{margin-bottom:2px}.ChallengeLevels .ChallengeLevelCard .ChallengeRewardMessage{margin-top:10px;line-height:15px;display:flex;flex-direction:row;align-items:center;gap:4px}.ChallengeLevels .ChallengeLevelCard .ChallengeRewardMessage .CustomRewardMessage{font-weight:var(--emw--font-weight-semibold, 600);word-break:break-word}.ChallengeLevels .InProgress{position:relative;border:none}.ChallengeLevels .InProgress .ChallengeLevelTarget,.ChallengeLevels .InProgress .CustomRewardMessage{color:var(--emfe-w-color-white, #FFF)}.ChallengeLevels .InProgress::before{content:\"\";position:absolute;inset:0;border-radius:8px;padding:1px;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-mask:linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);-webkit-mask-composite:xor;mask-composite:exclude}.ChallengeDetailsPopup.Tablet .ChallengeActions,.ChallengeDetailsPopup.Desktop .ChallengeActions{padding-top:16px}.ChallengeDetailsPopup.Tablet .ChallengeIconButton,.ChallengeDetailsPopup.Desktop .ChallengeIconButton{width:24px;height:24px}.ChallengeDetailsPopup.Tablet .ChallengeDetails,.ChallengeDetailsPopup.Desktop .ChallengeDetails{padding:20px 24px}.ChallengeDetailsPopup.Tablet .ChallengeDetails.IsNewChallenge,.ChallengeDetailsPopup.Desktop .ChallengeDetails.IsNewChallenge{padding-top:25px}.ChallengeDetailsPopup.Tablet .ChallengeName,.ChallengeDetailsPopup.Desktop .ChallengeName{line-height:27px;font-size:22px}.ChallengeDetailsPopup.Tablet .ChallengeJoinButton,.ChallengeDetailsPopup.Desktop .ChallengeJoinButton{min-width:100px;height:36px;font-size:16px}.ChallengeDetailsPopup.Tablet .ChallengeCountdown,.ChallengeDetailsPopup.Tablet .ChallengeLevels,.ChallengeDetailsPopup.Desktop .ChallengeCountdown,.ChallengeDetailsPopup.Desktop .ChallengeLevels{font-size:var(--emw--font-size-small, 14px);line-height:14px}.ChallengeDetailsPopup.Tablet .ChallengeCollapseButton,.ChallengeDetailsPopup.Desktop .ChallengeCollapseButton{margin-bottom:12px}.ChallengeDetailsPopup.Tablet .CollapseDetails .ChallengeDescription,.ChallengeDetailsPopup.Desktop .CollapseDetails .ChallengeDescription{font-size:var(--emw--font-size-medium, 16px);line-height:19px}.ChallengeDetailsPopup.Tablet .ChallengeLevels .ChallengeLevelTitle,.ChallengeDetailsPopup.Desktop .ChallengeLevels .ChallengeLevelTitle{margin-bottom:4px}.ChallengeDetailsPopup.Tablet .ChallengeLevels .ChallengeRewardMessage,.ChallengeDetailsPopup.Desktop .ChallengeLevels .ChallengeRewardMessage{margin-top:12px;line-height:17px}";
52
-
53
- const CasinoEngagementSuiteChallengesDetails$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
54
- constructor() {
55
- super();
56
- this.__registerHost();
57
- this.__attachShadow();
58
- this.close = createEvent(this, "close", 7);
59
- this.back = createEvent(this, "back", 7);
60
- this.resetNewChallengeLabel = createEvent(this, "resetNewChallengeLabel", 7);
61
- /**
62
- * Client custom styling via string
63
- */
64
- this.clientStyling = '';
65
- /**
66
- * Client custom styling via url
67
- */
68
- this.clientStylingUrl = '';
69
- /**
70
- * Language of the widget
71
- */
72
- this.language = 'en';
73
- /**
74
- * Current game slug
75
- */
76
- this.gameSlug = '';
77
- /**
78
- * User's device type
79
- */
80
- this.device = 'Mobile';
81
- /**
82
- *Paused Challenge Ids
83
- */
84
- this.pausedChallengeIds = [];
85
- this.limitStylingAppends = false;
86
- this.timer = '';
87
- this.showDetails = false;
88
- this.isExpiredChallenge = false;
89
- this.setClientStyling = () => {
90
- let sheet = document.createElement('style');
91
- sheet.innerHTML = this.clientStyling;
92
- this.host.prepend(sheet);
93
- };
94
- this.setClientStylingURL = () => {
95
- let url = new URL(this.clientStylingUrl);
96
- let cssFile = document.createElement('style');
97
- fetch(url.href)
98
- .then((res) => res.text())
99
- .then((data) => {
100
- cssFile.innerHTML = data;
101
- setTimeout(() => { this.host.prepend(cssFile); }, 1);
102
- })
103
- .catch((err) => {
104
- console.log('Error ', err);
105
- });
106
- };
107
- this.handleCloseClick = () => {
108
- this.resetNewLabel();
109
- this.close.emit();
110
- };
111
- this.handleBackClick = () => {
112
- this.resetNewLabel();
113
- this.back.emit();
114
- };
115
- this.onGameClick = (ev) => {
116
- const slug = ev.currentTarget.getAttribute('data-slug');
117
- if (slug) {
118
- window.postMessage({
119
- type: 'EngagementSuiteGameRedirect',
120
- data: {
121
- Slug: slug
122
- }
123
- });
124
- }
125
- };
126
- this.changeChallengeStatus = (e) => {
127
- var _a, _b;
128
- const id = e.currentTarget.getAttribute('data-id');
129
- if ((_a = this.inProgressChallenges) === null || _a === void 0 ? void 0 : _a.includes(id)) {
130
- window.postMessage({
131
- type: 'ShowConfirmationModal',
132
- ProgressToDeactivate: id,
133
- });
134
- return;
135
- }
136
- if (((_b = this.inProgressChallenges) === null || _b === void 0 ? void 0 : _b.length) > 0) {
137
- window.postMessage({
138
- type: 'ShowConfirmationModal',
139
- ProgressToActivate: id,
140
- ProgressToDeactivate: this.inProgressChallenges[0],
141
- });
142
- return;
143
- }
144
- window.postMessage({
145
- type: 'ChallengeJoinRequest',
146
- data: {
147
- ProgressToActivate: id,
148
- },
149
- });
150
- };
151
- this.toggle = () => {
152
- this.showDetails = !this.showDetails;
153
- };
154
- }
155
- challengePropHandler(value) {
156
- if (!this.interval && value) {
157
- this.updateTimer();
158
- this.startCountdown();
159
- }
160
- if (this.interval && !value) {
161
- clearInterval(this.interval);
162
- }
163
- }
164
- componentWillLoad() {
165
- this.challengePropHandler(this.challenge);
166
- }
167
- componentDidRender() {
168
- if (!this.limitStylingAppends && this.host) {
169
- if (this.clientStyling)
170
- this.setClientStyling();
171
- if (this.clientStylingUrl)
172
- this.setClientStylingURL();
173
- this.limitStylingAppends = true;
174
- }
175
- }
176
- disconnectedCallback() {
177
- this.interval && clearInterval(this.interval);
178
- }
179
- getActionsTemplate() {
180
- return (h("header", { class: "ChallengeActions" }, h("button", { class: "ChallengeIconButton", onClick: this.handleBackClick }, h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/back.svg", alt: "back" })), h("button", { class: "ChallengeIconButton", onClick: this.handleCloseClick }, h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/close.svg", alt: "close" }))));
181
- }
182
- getChallengeHeader() {
183
- const presentationName = this.challenge.ChallengePresentation.PresentationName;
184
- const inProgressChallenge = this.challenge.Status === ChallengeProgressStatus.InProgress
185
- || this.challenge.Status === ChallengeProgressStatus.PendingLevelReward;
186
- const isDisabledButton = this.isExpiredChallenge || this.isJoiningToChallenge ||
187
- this.pausedChallengeIds.includes(this.challenge.ChallengeId);
188
- const showJoinButton = ![ChallengeProgressStatus.Completed, ChallengeProgressStatus.Forfeited]
189
- .includes(this.challenge.Status);
190
- return (h("div", { class: "ChallengeDetailsHeader" }, h("span", { class: "ChallengeName" }, presentationName), showJoinButton ? (h("button", { onClick: this.changeChallengeStatus, class: `ChallengeJoinButton ${inProgressChallenge ? 'Joined' : ''}
191
- ${isDisabledButton ? 'Disabled' : ''}`, "data-id": this.challenge.Id }, inProgressChallenge
192
- ? translate('unjoin', this.language)
193
- : translate('join', this.language))) : null, h("div", { class: `ChallengeLabel ${this.challenge.IsNew ? 'ShowChallengeLabel' : ''}` }, h("span", null, translate('new', this.language)))));
194
- }
195
- getChallengeCountdown() {
196
- const timerMessage = this.isExpiredChallenge ? 'Expired' : this.timer;
197
- const showChallengeCountdown = this.challenge.Status !== ChallengeProgressStatus.Forfeited;
198
- return (showChallengeCountdown ? (h("div", { class: `ChallengeCountdown ${this.isExpiredChallenge ? 'Expired' : ''}` }, timerMessage)) : null);
199
- }
200
- getChallengeDetails() {
201
- const description = this.challenge.ChallengePresentation.Description;
202
- const url = this.challenge.ChallengePresentation.Url;
203
- const games = this.challenge.Games;
204
- return (h("div", { class: `CollapseDetails ${this.showDetails ? 'ShowDetails' : ''}` }, description && h("div", { class: "ChallengeDescription" }, description), url && (h("div", { class: "TC" }, h("a", { href: url, target: "_blank" }, translate('tc', this.language)))), (games === null || games === void 0 ? void 0 : games.length) && (h("div", { class: "ChallengeGames" }, games.map((game) => (h("div", { class: "Game", key: game.CasinoGameId }, h("img", { src: game.GameIcon, alt: game.GameName, onClick: this.onGameClick, class: `${game.GameSlug === this.gameSlug ? 'Disabled' : ''}`, "data-slug": game.GameSlug }))))))));
205
- }
206
- resetNewLabel() {
207
- this.resetNewChallengeLabel.emit(this.challenge.Id);
208
- }
209
- startCountdown() {
210
- this.interval = setInterval(() => {
211
- this.updateTimer();
212
- }, 1000);
213
- }
214
- updateTimer() {
215
- const expirationTime = new Date(this.challenge.ExpirationTime).getTime();
216
- const now = new Date().getTime();
217
- const distance = expirationTime - now;
218
- if (distance < 1) {
219
- clearInterval(this.interval);
220
- this.timer = '';
221
- this.isExpiredChallenge = true;
222
- return;
223
- }
224
- const { days, hours, minutes, seconds } = {
225
- days: String(Math.floor(distance / (1000 * 60 * 60 * 24))).padStart(2, '0'),
226
- hours: String(Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60))).padStart(2, '0'),
227
- minutes: String(Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60))).padStart(2, '0'),
228
- seconds: String(Math.floor((distance % (1000 * 60)) / 1000)).padStart(2, '0')
229
- };
230
- this.timer = days === '00'
231
- ? `${hours}h:${minutes}m:${seconds}s`
232
- : `${days}d:${hours}h:${minutes}m`;
233
- }
234
- getLevelTarget(level) {
235
- const targetTurnover = formatBalance(level.DisplayCurrencyTargetTurnover, this.challenge.CurrencySymbol);
236
- let levelTarget = `${translate('place', this.language)} ${targetTurnover}`;
237
- if (level.LevelTargetType === 1) {
238
- levelTarget += ` ${translate('bet', this.language)}`;
239
- }
240
- else if (level.LevelTargetType === 2) {
241
- levelTarget += ` ${translate('bets', this.language)} X ${level.TargetBetCount}`;
242
- }
243
- return (h("span", { class: "ChallengeLevelTarget" }, levelTarget));
244
- }
245
- getLevelBetRangesDetails(level) {
246
- var _a, _b, _c, _d;
247
- const isAccumulativeLevelType = level.LevelTargetType === 0;
248
- if (isAccumulativeLevelType) {
249
- const formattedMinBet = formatBalance((_a = level.BetRange) === null || _a === void 0 ? void 0 : _a.MinBet, this.challenge.CurrencySymbol);
250
- const formattedMaxBet = formatBalance((_b = level.BetRange) === null || _b === void 0 ? void 0 : _b.MaxBet, this.challenge.CurrencySymbol);
251
- const formattedContributionPercentage = level.LevelContributionPercent + '%';
252
- const showMinBet = !!((_c = level.BetRange) === null || _c === void 0 ? void 0 : _c.MinBet);
253
- const showMaxBet = !!((_d = level.BetRange) === null || _d === void 0 ? void 0 : _d.MaxBet);
254
- const showContributionPercentage = level.LevelContributionPercent !== 100;
255
- if (showMinBet || showMaxBet || showContributionPercentage) {
256
- return (h("div", { class: 'ChallengeLevelBetDetails' }, showMinBet &&
257
- h("div", { class: 'ChallengeLevelBetDetail' }, h("span", null, translate('minBet', this.language), ": "), h("span", { class: 'ChallengeLevelBetRange' }, formattedMinBet)), showMaxBet &&
258
- h("div", { class: 'ChallengeLevelBetDetail' }, h("span", null, translate('maxBet', this.language), ": "), h("span", { class: 'ChallengeLevelBetRange' }, formattedMaxBet)), showContributionPercentage &&
259
- h("div", { class: 'ChallengeLevelBetDetail' }, h("span", null, translate('contribution', this.language), ": "), h("span", { class: 'ChallengeLevelBetContribution' }, formattedContributionPercentage))));
260
- }
261
- }
262
- }
263
- getChallengeLevels() {
264
- const isChallengePaused = this.pausedChallengeIds.includes(this.challenge.ChallengeId);
265
- const InProgressLevel = (level) => {
266
- return level.ProgressStatus === 1 && !this.isExpiredChallenge && !isChallengePaused;
267
- };
268
- return (h("div", { class: "ChallengeLevels" }, this.challenge.LevelProgresses.map((level, index) => (h("div", { class: `ChallengeLevelCard ${InProgressLevel(level) ? 'InProgress' : ''}` }, h("casino-engagement-suite-progress-bar", { class: this.device, value: level.ProgressPercentage, "hide-percent": (level.ProgressPercentage === 0 && !InProgressLevel(level)) || level.ProgressPercentage === 100, disabled: this.isExpiredChallenge || isChallengePaused }, h("span", { slot: "Title", class: "ChallengeLevelTitle" }, h("span", null, "Level ", index + 1, ": "), this.getLevelTarget(level))), h("div", { class: "ChallengeRewardMessage" }, h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/reward.svg", alt: "win" }), h("span", null, translate('win', this.language), ": "), h("span", { class: "CustomRewardMessage" }, level.CustomRewardMessage)), this.getLevelBetRangesDetails(level))))));
269
- }
270
- getToggleButton() {
271
- return (h("div", { class: "ChallengeCollapseButton", onClick: this.toggle }, h("span", { class: `Toggle ${this.showDetails ? 'Closed' : 'Open'}` }), h("span", null, translate('details', this.language))));
272
- }
273
- render() {
274
- return h("div", { class: `ChallengeDetailsPopup ${this.device}` }, this.getActionsTemplate(), h("div", { class: `ChallengeDetails ${this.challenge.IsNew ? 'IsNewChallenge' : ''}` }, this.getChallengeHeader(), this.getChallengeCountdown(), this.getToggleButton(), this.getChallengeDetails(), this.getChallengeLevels()));
275
- }
276
- get host() { return this; }
277
- static get watchers() { return {
278
- "challenge": ["challengePropHandler"]
279
- }; }
280
- static get style() { return casinoEngagementSuiteChallengesDetailsCss; }
281
- }, [1, "casino-engagement-suite-challenges-details", {
282
- "clientStyling": [513, "client-styling"],
283
- "clientStylingUrl": [513, "client-styling-url"],
284
- "challenge": [1040],
285
- "inProgressChallenges": [1040],
286
- "language": [1],
287
- "gameSlug": [1, "game-slug"],
288
- "device": [1],
289
- "isJoiningToChallenge": [1028, "is-joining-to-challenge"],
290
- "pausedChallengeIds": [1040],
291
- "limitStylingAppends": [32],
292
- "timer": [32],
293
- "showDetails": [32],
294
- "isExpiredChallenge": [32]
295
- }]);
296
- function defineCustomElement$1() {
297
- if (typeof customElements === "undefined") {
298
- return;
299
- }
300
- const components = ["casino-engagement-suite-challenges-details", "casino-engagement-suite-progress-bar"];
301
- components.forEach(tagName => { switch (tagName) {
302
- case "casino-engagement-suite-challenges-details":
303
- if (!customElements.get(tagName)) {
304
- customElements.define(tagName, CasinoEngagementSuiteChallengesDetails$1);
305
- }
306
- break;
307
- case "casino-engagement-suite-progress-bar":
308
- if (!customElements.get(tagName)) {
309
- defineCustomElement$2();
310
- }
311
- break;
312
- } });
313
- }
314
-
315
- const CasinoEngagementSuiteChallengesDetails = CasinoEngagementSuiteChallengesDetails$1;
316
- const defineCustomElement = defineCustomElement$1;
317
-
318
- export { CasinoEngagementSuiteChallengesDetails, defineCustomElement };
@@ -1,6 +0,0 @@
1
- import { C as CasinoEngagementSuiteProgressBar$1, d as defineCustomElement$1 } from './casino-engagement-suite-progress-bar2.js';
2
-
3
- const CasinoEngagementSuiteProgressBar = CasinoEngagementSuiteProgressBar$1;
4
- const defineCustomElement = defineCustomElement$1;
5
-
6
- export { CasinoEngagementSuiteProgressBar, defineCustomElement };
@@ -1,107 +0,0 @@
1
- import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
-
3
- const casinoEngagementSuiteProgressBarCss = ":host{display:block;font-family:inherit}:host(.Desktop) .ProgressBarPercent{font-size:14px;line-height:14px}@keyframes indeterminate{0%{left:-200%;right:100%}60%{left:110%;right:-10%}to{left:110%;right:-10%}}.ProgressBarBackground{height:8px;background-color:var(--emw--color-background, #666178);border-radius:4px;position:relative;overflow:hidden}.ProgressBarLine{position:absolute;left:0;top:0;bottom:0;border-radius:4px;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);transition:width ease-out 0.3s}.ProgressBarLine.Indeterminate{animation:indeterminate 1s linear infinite}.ProgressBarInfo{margin-bottom:8px;display:flex;justify-content:space-between;align-items:center}.ProgressBarPercent{font-weight:700;font-size:12px;line-height:12px}.HidePercent .ProgressBarPercent{display:none}.ProgressBar:not(.Disabled) .ProgressBarPercent{background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}.ProgressBar.Disabled .ProgressBarPercent{color:var(--emw--color-background, #666178)}.ProgressBar.Disabled .ProgressBarLine{background:var(--emw--color-background-secondary, #474668)}";
4
-
5
- const CasinoEngagementSuiteProgressBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
6
- constructor() {
7
- super();
8
- this.__registerHost();
9
- this.__attachShadow();
10
- /**
11
- * Value for the widget
12
- */
13
- this.value = 0;
14
- /**
15
- * Shows disabled styles
16
- */
17
- this.disabled = false;
18
- /**
19
- * Hide percent value
20
- */
21
- this.hidePercent = false;
22
- /**
23
- * Constantly animates
24
- */
25
- this.indeterminate = false;
26
- /**
27
- * Client custom styling via string
28
- */
29
- this.clientStyling = '';
30
- /**
31
- * Client custom styling via url
32
- */
33
- this.clientStylingUrl = '';
34
- this.limitStylingAppends = false;
35
- this.setClientStyling = () => {
36
- let sheet = document.createElement('style');
37
- sheet.innerHTML = this.clientStyling;
38
- this.host.prepend(sheet);
39
- };
40
- this.setClientStylingURL = () => {
41
- let url = new URL(this.clientStylingUrl);
42
- let cssFile = document.createElement('style');
43
- fetch(url.href)
44
- .then((res) => res.text())
45
- .then((data) => {
46
- cssFile.innerHTML = data;
47
- setTimeout(() => { this.host.prepend(cssFile); }, 1);
48
- })
49
- .catch((err) => {
50
- console.log('Error ', err);
51
- });
52
- };
53
- }
54
- componentDidRender() {
55
- if (!this.limitStylingAppends && this.host) {
56
- if (this.clientStyling)
57
- this.setClientStyling();
58
- if (this.clientStylingUrl)
59
- this.setClientStylingURL();
60
- this.limitStylingAppends = true;
61
- }
62
- }
63
- getProgressBarClasses() {
64
- return {
65
- ProgressBar: true,
66
- Completed: this.value === 100,
67
- Disabled: this.disabled,
68
- HidePercent: this.hidePercent || this.indeterminate
69
- };
70
- }
71
- getProgressBarLineTemplate() {
72
- if (this.indeterminate) {
73
- return h("div", { class: "ProgressBarLine Indeterminate", part: "ProgressBarLine Indeterminate" });
74
- }
75
- else {
76
- return h("div", { class: "ProgressBarLine", part: "ProgressBarLine", style: { width: this.value + '%' } });
77
- }
78
- }
79
- render() {
80
- return h("div", { class: this.getProgressBarClasses(), part: "ProgressBar" }, h("div", { class: "ProgressBarInfo", part: "ProgressBarInfo" }, h("slot", { name: "Title" }, h("div", null)), h("slot", { name: "Percent" }, h("div", { class: "ProgressBarPercent", part: "ProgressBarPercent" }, this.value, "%"))), h("div", { class: "ProgressBarBackground", part: "ProgressBarBackground" }, this.getProgressBarLineTemplate()));
81
- }
82
- get host() { return this; }
83
- static get style() { return casinoEngagementSuiteProgressBarCss; }
84
- }, [1, "casino-engagement-suite-progress-bar", {
85
- "value": [2],
86
- "disabled": [4],
87
- "hidePercent": [4, "hide-percent"],
88
- "indeterminate": [4],
89
- "clientStyling": [513, "client-styling"],
90
- "clientStylingUrl": [513, "client-styling-url"],
91
- "limitStylingAppends": [32]
92
- }]);
93
- function defineCustomElement() {
94
- if (typeof customElements === "undefined") {
95
- return;
96
- }
97
- const components = ["casino-engagement-suite-progress-bar"];
98
- components.forEach(tagName => { switch (tagName) {
99
- case "casino-engagement-suite-progress-bar":
100
- if (!customElements.get(tagName)) {
101
- customElements.define(tagName, CasinoEngagementSuiteProgressBar);
102
- }
103
- break;
104
- } });
105
- }
106
-
107
- export { CasinoEngagementSuiteProgressBar as C, defineCustomElement as d };
@@ -1,26 +0,0 @@
1
- /* CasinoEngagementSuiteChallengesDetails custom elements */
2
-
3
- import type { Components, JSX } from "../types/components";
4
-
5
- /**
6
- * Used to manually set the base path where assets can be found.
7
- * If the script is used as "module", it's recommended to use "import.meta.url",
8
- * such as "setAssetPath(import.meta.url)". Other options include
9
- * "setAssetPath(document.currentScript.src)", or using a bundler's replace plugin to
10
- * dynamically set the path at build time, such as "setAssetPath(process.env.ASSET_PATH)".
11
- * But do note that this configuration depends on how your script is bundled, or lack of
12
- * bundling, and where your assets can be loaded from. Additionally custom bundling
13
- * will have to ensure the static assets are copied to its build directory.
14
- */
15
- export declare const setAssetPath: (path: string) => void;
16
-
17
- export interface SetPlatformOptions {
18
- raf?: (c: FrameRequestCallback) => number;
19
- ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
20
- rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
21
- }
22
- export declare const setPlatformOptions: (opts: SetPlatformOptions) => void;
23
-
24
- export type { Components, JSX };
25
-
26
- export * from '../types';
@@ -1 +0,0 @@
1
- export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';