@everymatrix/casino-challenge-details 0.6.9 → 0.6.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/casino-challenge-details/casino-challenge-details-9465f599.js +7 -0
- package/dist/casino-challenge-details/casino-challenge-details.esm.js +1 -1
- package/dist/casino-challenge-details/casino-challenge-details_4.entry.js +1 -1
- package/dist/casino-challenge-details/index-30adf0cb.js +2 -0
- package/dist/casino-challenge-details/index.esm.js +1 -1
- package/dist/cjs/{casino-challenge-details-ffaca965.js → casino-challenge-details-774d82cd.js} +1069 -4
- package/dist/cjs/casino-challenge-details.cjs.js +2 -2
- package/dist/cjs/casino-challenge-details_4.cjs.entry.js +4 -4
- package/dist/cjs/{index-1b30d7ac.js → index-2a30d71d.js} +2 -69
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/components/casino-challenge-details/casino-challenge-details.js +23 -13
- package/dist/collection/components/components/casino-challenge-progress-bar.js +2 -2
- package/dist/esm/{casino-challenge-details-004dcf62.js → casino-challenge-details-9465f599.js} +1069 -4
- package/dist/esm/casino-challenge-details.js +3 -3
- package/dist/esm/casino-challenge-details_4.entry.js +5 -5
- package/dist/esm/{index-662208df.js → index-30adf0cb.js} +2 -69
- package/dist/esm/index.js +2 -2
- package/dist/esm/loader.js +3 -3
- package/dist/types/components/casino-challenge-details/casino-challenge-details.d.ts +4 -0
- package/package.json +1 -1
- package/dist/casino-challenge-details/casino-challenge-details-004dcf62.js +0 -1
- package/dist/casino-challenge-details/index-662208df.js +0 -2
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-2a30d71d.js');
|
|
6
6
|
const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
7
7
|
|
|
8
8
|
/*
|
|
@@ -19,7 +19,7 @@ var patchBrowser = () => {
|
|
|
19
19
|
|
|
20
20
|
patchBrowser().then(async (options) => {
|
|
21
21
|
await appGlobals.globalScripts();
|
|
22
|
-
return index.bootstrapLazy([["casino-challenge-details_4.cjs",[[1,"casino-challenge-details",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"endpoint":[513],"domain":[513],"session":[513],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"isUserAuthorized":[516,"is-user-authorized"],"challengeId":[513,"challenge-id"],"activeChallengeTabIndex":[513,"active-challenge-tab-index"],"userId":[513,"user-id"],"redirectIfNotFound":[516,"redirect-if-not-found"],"timeLeft":[32],"activeTabIndex":[32],"actionLoading":[32],"isMobile":[32],"error":[32],"hasError":[32],"games":[32],"gamesAreLoading":[32],"challenge":[32],"loading":[32],"isChallengePaused":[32]
|
|
22
|
+
return index.bootstrapLazy([["casino-challenge-details_4.cjs",[[1,"casino-challenge-details",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"endpoint":[513],"domain":[513],"session":[513],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"isUserAuthorized":[516,"is-user-authorized"],"challengeId":[513,"challenge-id"],"activeChallengeTabIndex":[513,"active-challenge-tab-index"],"userId":[513,"user-id"],"redirectIfNotFound":[516,"redirect-if-not-found"],"timeLeft":[32],"activeTabIndex":[32],"actionLoading":[32],"isMobile":[32],"error":[32],"hasError":[32],"games":[32],"gamesAreLoading":[32],"challenge":[32],"loading":[32],"isChallengePaused":[32],"sseConnection":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"],"challengeId":["handleCombinedChange"],"isUserAuthorized":["handleCombinedChange"],"session":["handleCombinedChange"],"challenge":["onEntityChange"]}],[1,"casino-challenge-expandable-paragraph",{"maxHeight":[2,"max-height"],"active":[4],"expanded":[32],"needsTruncation":[32],"isSmallScreen":[32]}],[1,"casino-challenge-level-progress-bar",{"height":[1],"active":[4],"value":[2]}],[1,"casino-challenge-progress-bar",{"challenge":[16],"isUserAuthorized":[4,"is-user-authorized"],"language":[1]}]]]], options);
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
exports.setNonce = index.setNonce;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const casinoChallengeDetails = require('./casino-challenge-details-
|
|
6
|
-
const index = require('./index-
|
|
5
|
+
const casinoChallengeDetails = require('./casino-challenge-details-774d82cd.js');
|
|
6
|
+
const index = require('./index-2a30d71d.js');
|
|
7
7
|
|
|
8
8
|
const activeChevronSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iOCIgdmlld0JveD0iMCAwIDEyIDgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMC40MTA4MjYgMC45MTEwN0MwLjczNjI2MyAwLjU4NTYzMyAxLjI2MzkgMC41ODU2MzMgMS41ODkzNCAwLjkxMTA3TDYuMDAwMDggNS4zMjE4MUwxMC40MTA4IDAuOTExMDdDMTAuNzM2MyAwLjU4NTYzMyAxMS4yNjM5IDAuNTg1NjMzIDExLjU4OTMgMC45MTEwN0MxMS45MTQ4IDEuMjM2NTEgMTEuOTE0OCAxLjc2NDE0IDExLjU4OTMgMi4wODk1OEw2LjU4OTM0IDcuMDg5NThDNi4yNjM5IDcuNDE1MDIgNS43MzYyNiA3LjQxNTAyIDUuNDEwODMgNy4wODk1OEwwLjQxMDgyNiAyLjA4OTU4QzAuMDg1Mzg4OCAxLjc2NDE0IDAuMDg1Mzg4OCAxLjIzNjUxIDAuNDEwODI2IDAuOTExMDdaIiBmaWxsPSIjMDBCNzRGIi8+Cjwvc3ZnPgo=';
|
|
9
9
|
|
|
@@ -115,7 +115,7 @@ const CasinoChallengeProgressBar = class {
|
|
|
115
115
|
? casinoChallengeDetails.translate('suspended', this.language)
|
|
116
116
|
: Status === casinoChallengeDetails.EChallengeProgressStatus.Completed
|
|
117
117
|
? casinoChallengeDetails.translate('finished', this.language)
|
|
118
|
-
: `${currLevel.ProgressPercentage}%`;
|
|
118
|
+
: `${Math.floor(currLevel.ProgressPercentage)}%`;
|
|
119
119
|
const isLastLevel = !LevelProgresses.some((x) => x.OrderNumber > currLevel.OrderNumber);
|
|
120
120
|
const secondImgSrc = Status === casinoChallengeDetails.EChallengeProgressStatus.Completed ? trophySvg : isLastLevel ? finishSvg : '';
|
|
121
121
|
return (index.h("div", { class: {
|
|
@@ -136,7 +136,7 @@ const CasinoChallengeProgressBar = class {
|
|
|
136
136
|
} }, secondImgSrc ? index.h("img", { class: "progress__icon", src: secondImgSrc }) : currLevel.OrderNumber + 2)));
|
|
137
137
|
}
|
|
138
138
|
render() {
|
|
139
|
-
return index.h(index.Host, { key: '
|
|
139
|
+
return index.h(index.Host, { key: '5d6157620ed12e6502aee399c790c6e3419b7bc7' }, this.challengeProgress);
|
|
140
140
|
}
|
|
141
141
|
};
|
|
142
142
|
CasinoChallengeProgressBar.style = CasinoChallengeProgressBarStyle0;
|
|
@@ -21,7 +21,7 @@ function _interopNamespace(e) {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
const NAMESPACE = 'casino-challenge-details';
|
|
24
|
-
const BUILD = /* casino-challenge-details */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: false, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: true, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: true, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener:
|
|
24
|
+
const BUILD = /* casino-challenge-details */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: false, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: true, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: true, element: false, event: true, 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: true, propMutable: false, propNumber: true, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: true, 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 };
|
|
25
25
|
|
|
26
26
|
/*
|
|
27
27
|
Stencil Client Platform v4.19.2 | MIT Licensed | https://stenciljs.com
|
|
@@ -106,22 +106,6 @@ var plt = {
|
|
|
106
106
|
rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
|
|
107
107
|
ce: (eventName, opts) => new CustomEvent(eventName, opts)
|
|
108
108
|
};
|
|
109
|
-
var supportsListenerOptions = /* @__PURE__ */ (() => {
|
|
110
|
-
let supportsListenerOptions2 = false;
|
|
111
|
-
try {
|
|
112
|
-
doc.addEventListener(
|
|
113
|
-
"e",
|
|
114
|
-
null,
|
|
115
|
-
Object.defineProperty({}, "passive", {
|
|
116
|
-
get() {
|
|
117
|
-
supportsListenerOptions2 = true;
|
|
118
|
-
}
|
|
119
|
-
})
|
|
120
|
-
);
|
|
121
|
-
} catch (e) {
|
|
122
|
-
}
|
|
123
|
-
return supportsListenerOptions2;
|
|
124
|
-
})();
|
|
125
109
|
var promiseResolve = (v) => Promise.resolve(v);
|
|
126
110
|
var supportsConstructableStylesheets = /* @__PURE__ */ (() => {
|
|
127
111
|
try {
|
|
@@ -777,13 +761,6 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
777
761
|
}
|
|
778
762
|
let maybePromise;
|
|
779
763
|
if (isInitialLoad) {
|
|
780
|
-
{
|
|
781
|
-
hostRef.$flags$ |= 256 /* isListenReady */;
|
|
782
|
-
if (hostRef.$queuedListeners$) {
|
|
783
|
-
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
|
|
784
|
-
hostRef.$queuedListeners$ = void 0;
|
|
785
|
-
}
|
|
786
|
-
}
|
|
787
764
|
{
|
|
788
765
|
maybePromise = safeCall(instance, "componentWillLoad");
|
|
789
766
|
}
|
|
@@ -1115,7 +1092,6 @@ var connectedCallback = (elm) => {
|
|
|
1115
1092
|
initializeComponent(elm, hostRef, cmpMeta);
|
|
1116
1093
|
}
|
|
1117
1094
|
} else {
|
|
1118
|
-
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
|
|
1119
1095
|
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
|
1120
1096
|
fireConnectedCallback(hostRef.$lazyInstance$);
|
|
1121
1097
|
} else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
|
|
@@ -1133,12 +1109,6 @@ var disconnectInstance = (instance) => {
|
|
|
1133
1109
|
var disconnectedCallback = async (elm) => {
|
|
1134
1110
|
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1135
1111
|
const hostRef = getHostRef(elm);
|
|
1136
|
-
{
|
|
1137
|
-
if (hostRef.$rmListeners$) {
|
|
1138
|
-
hostRef.$rmListeners$.map((rmListener) => rmListener());
|
|
1139
|
-
hostRef.$rmListeners$ = void 0;
|
|
1140
|
-
}
|
|
1141
|
-
}
|
|
1142
1112
|
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
|
1143
1113
|
disconnectInstance(hostRef.$lazyInstance$);
|
|
1144
1114
|
} else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
|
|
@@ -1178,9 +1148,6 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1178
1148
|
{
|
|
1179
1149
|
cmpMeta.$members$ = compactMeta[2];
|
|
1180
1150
|
}
|
|
1181
|
-
{
|
|
1182
|
-
cmpMeta.$listeners$ = compactMeta[3];
|
|
1183
|
-
}
|
|
1184
1151
|
{
|
|
1185
1152
|
cmpMeta.$attrsToReflect$ = [];
|
|
1186
1153
|
}
|
|
@@ -1212,10 +1179,9 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1212
1179
|
}
|
|
1213
1180
|
}
|
|
1214
1181
|
connectedCallback() {
|
|
1215
|
-
|
|
1182
|
+
getHostRef(this);
|
|
1216
1183
|
if (!this.hasRegisteredEventListeners) {
|
|
1217
1184
|
this.hasRegisteredEventListeners = true;
|
|
1218
|
-
addHostEventListeners(this, hostRef, cmpMeta.$listeners$);
|
|
1219
1185
|
}
|
|
1220
1186
|
if (appLoadFallback) {
|
|
1221
1187
|
clearTimeout(appLoadFallback);
|
|
@@ -1270,39 +1236,6 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1270
1236
|
}
|
|
1271
1237
|
endBootstrap();
|
|
1272
1238
|
};
|
|
1273
|
-
var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
1274
|
-
if (listeners) {
|
|
1275
|
-
listeners.map(([flags, name, method]) => {
|
|
1276
|
-
const target = getHostListenerTarget(elm, flags) ;
|
|
1277
|
-
const handler = hostListenerProxy(hostRef, method);
|
|
1278
|
-
const opts = hostListenerOpts(flags);
|
|
1279
|
-
plt.ael(target, name, handler, opts);
|
|
1280
|
-
(hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
|
|
1281
|
-
});
|
|
1282
|
-
}
|
|
1283
|
-
};
|
|
1284
|
-
var hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
1285
|
-
var _a;
|
|
1286
|
-
try {
|
|
1287
|
-
{
|
|
1288
|
-
if (hostRef.$flags$ & 256 /* isListenReady */) {
|
|
1289
|
-
(_a = hostRef.$lazyInstance$) == null ? void 0 : _a[methodName](ev);
|
|
1290
|
-
} else {
|
|
1291
|
-
(hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
|
|
1292
|
-
}
|
|
1293
|
-
}
|
|
1294
|
-
} catch (e) {
|
|
1295
|
-
consoleError(e);
|
|
1296
|
-
}
|
|
1297
|
-
};
|
|
1298
|
-
var getHostListenerTarget = (elm, flags) => {
|
|
1299
|
-
if (flags & 8 /* TargetWindow */) return win;
|
|
1300
|
-
return elm;
|
|
1301
|
-
};
|
|
1302
|
-
var hostListenerOpts = (flags) => supportsListenerOptions ? {
|
|
1303
|
-
passive: (flags & 1 /* Passive */) !== 0,
|
|
1304
|
-
capture: (flags & 2 /* Capture */) !== 0
|
|
1305
|
-
} : (flags & 2 /* Capture */) !== 0;
|
|
1306
1239
|
|
|
1307
1240
|
// src/runtime/nonce.ts
|
|
1308
1241
|
var setNonce = (nonce) => plt.$nonce$ = nonce;
|
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const casinoChallengeDetails = require('./casino-challenge-details-
|
|
6
|
-
require('./index-
|
|
5
|
+
const casinoChallengeDetails = require('./casino-challenge-details-774d82cd.js');
|
|
6
|
+
require('./index-2a30d71d.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-2a30d71d.js');
|
|
6
6
|
const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
7
7
|
|
|
8
8
|
const defineCustomElements = async (win, options) => {
|
|
9
9
|
if (typeof window === 'undefined') return undefined;
|
|
10
10
|
await appGlobals.globalScripts();
|
|
11
|
-
return index.bootstrapLazy([["casino-challenge-details_4.cjs",[[1,"casino-challenge-details",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"endpoint":[513],"domain":[513],"session":[513],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"isUserAuthorized":[516,"is-user-authorized"],"challengeId":[513,"challenge-id"],"activeChallengeTabIndex":[513,"active-challenge-tab-index"],"userId":[513,"user-id"],"redirectIfNotFound":[516,"redirect-if-not-found"],"timeLeft":[32],"activeTabIndex":[32],"actionLoading":[32],"isMobile":[32],"error":[32],"hasError":[32],"games":[32],"gamesAreLoading":[32],"challenge":[32],"loading":[32],"isChallengePaused":[32]
|
|
11
|
+
return index.bootstrapLazy([["casino-challenge-details_4.cjs",[[1,"casino-challenge-details",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"endpoint":[513],"domain":[513],"session":[513],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"isUserAuthorized":[516,"is-user-authorized"],"challengeId":[513,"challenge-id"],"activeChallengeTabIndex":[513,"active-challenge-tab-index"],"userId":[513,"user-id"],"redirectIfNotFound":[516,"redirect-if-not-found"],"timeLeft":[32],"activeTabIndex":[32],"actionLoading":[32],"isMobile":[32],"error":[32],"hasError":[32],"games":[32],"gamesAreLoading":[32],"challenge":[32],"loading":[32],"isChallengePaused":[32],"sseConnection":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"],"challengeId":["handleCombinedChange"],"isUserAuthorized":["handleCombinedChange"],"session":["handleCombinedChange"],"challenge":["onEntityChange"]}],[1,"casino-challenge-expandable-paragraph",{"maxHeight":[2,"max-height"],"active":[4],"expanded":[32],"needsTruncation":[32],"isSmallScreen":[32]}],[1,"casino-challenge-level-progress-bar",{"height":[1],"active":[4],"value":[2]}],[1,"casino-challenge-progress-bar",{"challenge":[16],"isUserAuthorized":[4,"is-user-authorized"],"language":[1]}]]]], options);
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
exports.setNonce = index.setNonce;
|
|
@@ -11,6 +11,7 @@ import checkIcon from "../../assets/check.svg";
|
|
|
11
11
|
import infoIcon from "../../assets/info-circle.svg";
|
|
12
12
|
import titleIcon from "../../assets/title-icon.svg";
|
|
13
13
|
import notificationIcon from "../../assets/notification.svg";
|
|
14
|
+
import { EventSourcePolyfill } from "event-source-polyfill";
|
|
14
15
|
import { ChallengeStatusDictionary, EChallengeLevelTargetType, EChallengeProgressLevelStatus, EChallengeProgressStatus, EChallengeStatus, EWalletTypes } from "../../utils/types";
|
|
15
16
|
export class CasinoChallengeDetails {
|
|
16
17
|
constructor() {
|
|
@@ -163,6 +164,21 @@ export class CasinoChallengeDetails {
|
|
|
163
164
|
this.challenge = undefined;
|
|
164
165
|
this.loading = false;
|
|
165
166
|
this.isChallengePaused = false;
|
|
167
|
+
this.sseConnection = undefined;
|
|
168
|
+
}
|
|
169
|
+
connectGameToLiveLobby() {
|
|
170
|
+
if (EventSource && !this.sseConnection) {
|
|
171
|
+
const updateUrl = `${this.endpoint}/v1/encoder/challenges/*/update`;
|
|
172
|
+
this.sseConnection = new EventSourcePolyfill(updateUrl);
|
|
173
|
+
this.sseConnection.addEventListener('message', this.handleEvent);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
disconnectGameFromLiveLobby() {
|
|
177
|
+
if (this.sseConnection) {
|
|
178
|
+
this.sseConnection.removeEventListener('message');
|
|
179
|
+
this.sseConnection.close();
|
|
180
|
+
this.sseConnection = undefined;
|
|
181
|
+
}
|
|
166
182
|
}
|
|
167
183
|
handleEvent(e) {
|
|
168
184
|
const { data } = e === null || e === void 0 ? void 0 : e.data;
|
|
@@ -285,6 +301,7 @@ export class CasinoChallengeDetails {
|
|
|
285
301
|
if (this.translationUrl) {
|
|
286
302
|
resolveTranslationUrl(this.translationUrl);
|
|
287
303
|
}
|
|
304
|
+
this.connectGameToLiveLobby();
|
|
288
305
|
this.updateTime();
|
|
289
306
|
}
|
|
290
307
|
componentDidLoad() {
|
|
@@ -308,6 +325,7 @@ export class CasinoChallengeDetails {
|
|
|
308
325
|
this.stylingSubscription.unsubscribe();
|
|
309
326
|
}
|
|
310
327
|
clearInterval(this.timerId);
|
|
328
|
+
this.disconnectGameFromLiveLobby();
|
|
311
329
|
window.removeEventListener('resize', this.checkIsMobile);
|
|
312
330
|
}
|
|
313
331
|
getReward(level) {
|
|
@@ -405,7 +423,7 @@ export class CasinoChallengeDetails {
|
|
|
405
423
|
getLevelStatus(level, active) {
|
|
406
424
|
if (this.isUserAuthorized) {
|
|
407
425
|
if (level.ProgressStatus === EChallengeProgressLevelStatus.InProgress && !active)
|
|
408
|
-
return (h("div", { class: "level__status" }, h("span", null, level.ProgressPercentage, "%"), h("img", { src: lockIcon, alt: "lock-icon", title: "lock-icon" })));
|
|
426
|
+
return (h("div", { class: "level__status" }, h("span", null, Math.floor(level.ProgressPercentage), "%"), h("img", { src: lockIcon, alt: "lock-icon", title: "lock-icon" })));
|
|
409
427
|
else if (level.ProgressStatus === EChallengeProgressLevelStatus.Closed || !active)
|
|
410
428
|
return (h("div", { class: "level__status" }, h("img", { src: lockIcon, alt: "lock-icon", title: "lock-icon" })));
|
|
411
429
|
else if (level.ProgressStatus === EChallengeProgressLevelStatus.Fillup)
|
|
@@ -413,7 +431,7 @@ export class CasinoChallengeDetails {
|
|
|
413
431
|
else if (level.ProgressStatus === EChallengeProgressLevelStatus.Completed)
|
|
414
432
|
return h("span", { class: "completed" }, translate('completed', this.language));
|
|
415
433
|
else if (level.ProgressStatus === EChallengeProgressLevelStatus.InProgress)
|
|
416
|
-
return h("span", { class: "level__status in-progress" }, level.ProgressPercentage, "%");
|
|
434
|
+
return h("span", { class: "level__status in-progress" }, Math.floor(level.ProgressPercentage), "%");
|
|
417
435
|
}
|
|
418
436
|
return null;
|
|
419
437
|
}
|
|
@@ -537,7 +555,7 @@ export class CasinoChallengeDetails {
|
|
|
537
555
|
return (((_a = this.challenge) === null || _a === void 0 ? void 0 : _a.Status) === 4 && (h("div", { class: "notification" }, h("img", { class: "notification__icon", src: infoIcon }), h("span", { class: "notification__message" }, translate('expiredNotification', this.language)))));
|
|
538
556
|
}
|
|
539
557
|
render() {
|
|
540
|
-
return (h("div", { key: '
|
|
558
|
+
return (h("div", { key: '5500fa3f776e2357796ad51523f96c389ccdb810', ref: (el) => (this.stylingContainer = el), class: "container" }, this.pageHeader, this.loading ? (h("div", { class: "lds-dual-ring" })) : (h("div", null, h("button", { class: "back-button", onClick: this.goBack }, h("img", { class: "back-button__icon", src: backIcon }), this.getBackButtonText()), this.forfeitedNofitication, this.completedNotification, this.expiredNotification, h("div", { class: "details" }, this.cardGeneralInfo, h("div", { class: "details__tabs-container" }, this.challengeTabs, this.activeTabIndex === 0 && this.levelsTab, this.activeTabIndex === 1 && this.gamesTab, this.activeTabIndex === 2 && this.rulesTab), this.footer)))));
|
|
541
559
|
}
|
|
542
560
|
static get is() { return "casino-challenge-details"; }
|
|
543
561
|
static get encapsulation() { return "shadow"; }
|
|
@@ -798,7 +816,8 @@ export class CasinoChallengeDetails {
|
|
|
798
816
|
"gamesAreLoading": {},
|
|
799
817
|
"challenge": {},
|
|
800
818
|
"loading": {},
|
|
801
|
-
"isChallengePaused": {}
|
|
819
|
+
"isChallengePaused": {},
|
|
820
|
+
"sseConnection": {}
|
|
802
821
|
};
|
|
803
822
|
}
|
|
804
823
|
static get events() {
|
|
@@ -843,13 +862,4 @@ export class CasinoChallengeDetails {
|
|
|
843
862
|
"methodName": "onEntityChange"
|
|
844
863
|
}];
|
|
845
864
|
}
|
|
846
|
-
static get listeners() {
|
|
847
|
-
return [{
|
|
848
|
-
"name": "message",
|
|
849
|
-
"method": "handleEvent",
|
|
850
|
-
"target": "window",
|
|
851
|
-
"capture": false,
|
|
852
|
-
"passive": false
|
|
853
|
-
}];
|
|
854
|
-
}
|
|
855
865
|
}
|
|
@@ -25,7 +25,7 @@ export class CasinoChallengeProgressBar {
|
|
|
25
25
|
? translate('suspended', this.language)
|
|
26
26
|
: Status === EChallengeProgressStatus.Completed
|
|
27
27
|
? translate('finished', this.language)
|
|
28
|
-
: `${currLevel.ProgressPercentage}%`;
|
|
28
|
+
: `${Math.floor(currLevel.ProgressPercentage)}%`;
|
|
29
29
|
const isLastLevel = !LevelProgresses.some((x) => x.OrderNumber > currLevel.OrderNumber);
|
|
30
30
|
const secondImgSrc = Status === EChallengeProgressStatus.Completed ? trophyIcon : isLastLevel ? finishIcon : '';
|
|
31
31
|
return (h("div", { class: {
|
|
@@ -46,7 +46,7 @@ export class CasinoChallengeProgressBar {
|
|
|
46
46
|
} }, secondImgSrc ? h("img", { class: "progress__icon", src: secondImgSrc }) : currLevel.OrderNumber + 2)));
|
|
47
47
|
}
|
|
48
48
|
render() {
|
|
49
|
-
return h(Host, { key: '
|
|
49
|
+
return h(Host, { key: '5d6157620ed12e6502aee399c790c6e3419b7bc7' }, this.challengeProgress);
|
|
50
50
|
}
|
|
51
51
|
static get is() { return "casino-challenge-progress-bar"; }
|
|
52
52
|
static get encapsulation() { return "shadow"; }
|