@everymatrix/casino-engagement-suite-modal-container 1.36.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.
- package/dist/casino-engagement-suite-modal-container/casino-engagement-suite-modal-container.esm.js +1 -0
- package/dist/casino-engagement-suite-modal-container/index.esm.js +0 -0
- package/dist/casino-engagement-suite-modal-container/p-0f126ad9.entry.js +1 -0
- package/dist/casino-engagement-suite-modal-container/p-8aa9bb7a.entry.js +1 -0
- package/dist/casino-engagement-suite-modal-container/p-b944b831.js +1 -0
- package/dist/cjs/casino-engagement-suite-modal-container.cjs.entry.js +127 -0
- package/dist/cjs/casino-engagement-suite-modal-container.cjs.js +19 -0
- package/dist/cjs/casino-engagement-suite-modal.cjs.entry.js +68 -0
- package/dist/cjs/index-2394967b.js +1253 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +21 -0
- package/dist/collection/collection-manifest.json +19 -0
- package/dist/collection/components/casino-engagement-suite-modal-container/casino-engagement-suite-modal-container.css +71 -0
- package/dist/collection/components/casino-engagement-suite-modal-container/casino-engagement-suite-modal-container.js +223 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/models/index.js +1 -0
- package/dist/collection/utils/locale.utils.js +26 -0
- package/dist/collection/utils/utils.js +3 -0
- package/dist/components/casino-engagement-suite-modal-container.d.ts +11 -0
- package/dist/components/casino-engagement-suite-modal-container.js +156 -0
- package/dist/components/casino-engagement-suite-modal.js +6 -0
- package/dist/components/casino-engagement-suite-modal2.js +89 -0
- package/dist/components/index.d.ts +26 -0
- package/dist/components/index.js +1 -0
- package/dist/esm/casino-engagement-suite-modal-container.entry.js +123 -0
- package/dist/esm/casino-engagement-suite-modal-container.js +17 -0
- package/dist/esm/casino-engagement-suite-modal.entry.js +64 -0
- package/dist/esm/index-89c6c4a4.js +1226 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +17 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/css-shim.js +1 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/stencil.config.js +22 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/casino-engagement-suite-modal-container/.stencil/packages/casino-engagement-suite-modal-container/stencil.config.d.ts +2 -0
- package/dist/types/components/casino-engagement-suite-modal-container/casino-engagement-suite-modal-container.d.ts +35 -0
- package/dist/types/components.d.ts +64 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/models/index.d.ts +5 -0
- package/dist/types/stencil-public-runtime.d.ts +1565 -0
- package/dist/types/utils/locale.utils.d.ts +1 -0
- package/dist/types/utils/utils.d.ts +1 -0
- package/loader/cdn.js +3 -0
- package/loader/index.cjs.js +3 -0
- package/loader/index.d.ts +12 -0
- package/loader/index.es2017.js +3 -0
- package/loader/index.js +4 -0
- package/loader/package.json +10 -0
- package/package.json +19 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-2394967b.js');
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
Stencil Client Patch Esm v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
9
|
+
*/
|
|
10
|
+
const patchEsm = () => {
|
|
11
|
+
return index.promiseResolve();
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const defineCustomElements = (win, options) => {
|
|
15
|
+
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
|
+
return patchEsm().then(() => {
|
|
17
|
+
return index.bootstrapLazy([["casino-engagement-suite-modal.cjs",[[1,"casino-engagement-suite-modal",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"isOpen":[4,"is-open"],"header":[1],"icon":[1],"contentIcon":[1,"content-icon"],"modalType":[1,"modal-type"],"device":[1],"limitStylingAppends":[32]}]]],["casino-engagement-suite-modal-container.cjs",[[1,"casino-engagement-suite-modal-container",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[1],"device":[1],"limitStylingAppends":[32],"openModals":[32],"rewards":[32],"confirmationData":[32]},[[16,"openModal","openModalHandler"],[16,"closeModal","closeModalHandler"]]]]]], options);
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
exports.defineCustomElements = defineCustomElements;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"entries": [
|
|
3
|
+
"./components/casino-engagement-suite-modal-container/casino-engagement-suite-modal-container.js"
|
|
4
|
+
],
|
|
5
|
+
"compiler": {
|
|
6
|
+
"name": "@stencil/core",
|
|
7
|
+
"version": "2.15.2",
|
|
8
|
+
"typescriptVersion": "4.5.4"
|
|
9
|
+
},
|
|
10
|
+
"collections": [
|
|
11
|
+
{
|
|
12
|
+
"name": "@everymatrix/casino-engagement-suite-modal",
|
|
13
|
+
"tags": [
|
|
14
|
+
"casino-engagement-suite-modal"
|
|
15
|
+
]
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"bundles": []
|
|
19
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.ModalFooterButton, .ModalFooterButtonOutlined {
|
|
6
|
+
transition: all 0.5s ease-out;
|
|
7
|
+
background: linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);
|
|
8
|
+
color: var(--emw--color-typography, #1E1638);
|
|
9
|
+
border-radius: 99px;
|
|
10
|
+
min-width: 140px;
|
|
11
|
+
height: 36px;
|
|
12
|
+
font-size: 14px;
|
|
13
|
+
font-weight: var(--emw--font-weight-bold, 700);
|
|
14
|
+
position: relative;
|
|
15
|
+
font-family: "Montserrat", sans-serif;
|
|
16
|
+
padding: 0 16px;
|
|
17
|
+
box-sizing: border-box;
|
|
18
|
+
margin: auto;
|
|
19
|
+
border: none;
|
|
20
|
+
cursor: pointer;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.ModalFooterButtonOutlined {
|
|
24
|
+
background: linear-gradient(var(--emw--color-background, #1E1638) 0 0) padding-box, linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%) border-box;
|
|
25
|
+
border: 2px solid transparent;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.GradientText {
|
|
29
|
+
background-image: linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);
|
|
30
|
+
color: transparent;
|
|
31
|
+
background-clip: text;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.ManyActions {
|
|
35
|
+
display: flex;
|
|
36
|
+
width: 100%;
|
|
37
|
+
flex-direction: column;
|
|
38
|
+
align-items: stretch;
|
|
39
|
+
}
|
|
40
|
+
.ManyActions .ModalFooterButton, .ManyActions .ModalFooterButtonOutlined {
|
|
41
|
+
width: 280px;
|
|
42
|
+
}
|
|
43
|
+
.ManyActions button:first-child {
|
|
44
|
+
margin-bottom: 16px;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.ModalReward {
|
|
48
|
+
font-weight: var(--emw--font-weight-semibold, 600);
|
|
49
|
+
color: var(--emw--color-typography, #FFFFFF);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.ModalContainer.Mobile .ModalFooterButton,
|
|
53
|
+
.ModalContainer.Mobile .ModalFooterButton {
|
|
54
|
+
min-width: 140px;
|
|
55
|
+
height: 32px;
|
|
56
|
+
}
|
|
57
|
+
.ModalContainer.Mobile .ManyActions .ModalFooterButton, .ModalContainer.Mobile .ManyActions .ModalFooterButtonOutlined,
|
|
58
|
+
.ModalContainer.Mobile .ManyActions .ModalFooterButton,
|
|
59
|
+
.ModalContainer.Mobile .ManyActions .ModalFooterButtonOutlined {
|
|
60
|
+
width: 100%;
|
|
61
|
+
height: 32px;
|
|
62
|
+
}
|
|
63
|
+
.ModalContainer.Mobile .ManyActions button:first-child,
|
|
64
|
+
.ModalContainer.Mobile .ManyActions button:first-child {
|
|
65
|
+
margin-bottom: 8px;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.LeftAlign {
|
|
69
|
+
text-align: left;
|
|
70
|
+
line-height: 1.2;
|
|
71
|
+
}
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import { Component, h, Prop, State, Listen, Element, Event } from '@stencil/core';
|
|
2
|
+
import '@everymatrix/casino-engagement-suite-modal';
|
|
3
|
+
import { translate } from '../../utils/locale.utils';
|
|
4
|
+
export class CasinoEngagementSuiteModalContainer {
|
|
5
|
+
constructor() {
|
|
6
|
+
/**
|
|
7
|
+
* Client custom styling via string
|
|
8
|
+
*/
|
|
9
|
+
this.clientStyling = '';
|
|
10
|
+
/**
|
|
11
|
+
* Client custom styling via url
|
|
12
|
+
*/
|
|
13
|
+
this.clientStylingUrl = '';
|
|
14
|
+
/**
|
|
15
|
+
* Language of the widget
|
|
16
|
+
*/
|
|
17
|
+
this.language = 'en';
|
|
18
|
+
this.device = 'Mobile';
|
|
19
|
+
this.limitStylingAppends = false;
|
|
20
|
+
this.openModals = [];
|
|
21
|
+
this.rewards = [];
|
|
22
|
+
this.confirmationData = null;
|
|
23
|
+
this.handleCloseClick = (e) => {
|
|
24
|
+
const type = +e.currentTarget.getAttribute('data-type');
|
|
25
|
+
this.closeModal.emit(type);
|
|
26
|
+
};
|
|
27
|
+
this.handleChallengeAttendance = () => {
|
|
28
|
+
window.postMessage({
|
|
29
|
+
type: 'ChallengeAttendance',
|
|
30
|
+
confirmationData: this.confirmationData,
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
this.setClientStyling = () => {
|
|
34
|
+
let sheet = document.createElement('style');
|
|
35
|
+
sheet.innerHTML = this.clientStyling;
|
|
36
|
+
this.host.prepend(sheet);
|
|
37
|
+
};
|
|
38
|
+
this.setClientStylingURL = () => {
|
|
39
|
+
let url = new URL(this.clientStylingUrl);
|
|
40
|
+
let cssFile = document.createElement('style');
|
|
41
|
+
fetch(url.href)
|
|
42
|
+
.then((res) => res.text())
|
|
43
|
+
.then((data) => {
|
|
44
|
+
cssFile.innerHTML = data;
|
|
45
|
+
setTimeout(() => { this.host.prepend(cssFile); }, 1);
|
|
46
|
+
})
|
|
47
|
+
.catch((err) => {
|
|
48
|
+
console.log('Error ', err);
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
this.isModalOpen = (type) => {
|
|
52
|
+
return Boolean(this.openModals.find(el => el === type));
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
openModalHandler(event) {
|
|
56
|
+
const { modalType, rewards, confirmationData } = event.detail;
|
|
57
|
+
this.openModals = [...this.openModals, modalType];
|
|
58
|
+
if (rewards === null || rewards === void 0 ? void 0 : rewards.length) {
|
|
59
|
+
this.rewards = [...rewards];
|
|
60
|
+
}
|
|
61
|
+
if (confirmationData) {
|
|
62
|
+
this.confirmationData = confirmationData;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
closeModalHandler(event) {
|
|
66
|
+
this.openModals = this.openModals.filter(el => el !== event.detail);
|
|
67
|
+
}
|
|
68
|
+
componentDidRender() {
|
|
69
|
+
if (!this.limitStylingAppends && this.host) {
|
|
70
|
+
if (this.clientStyling)
|
|
71
|
+
this.setClientStyling();
|
|
72
|
+
if (this.clientStylingUrl)
|
|
73
|
+
this.setClientStylingURL();
|
|
74
|
+
this.limitStylingAppends = true;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
render() {
|
|
78
|
+
const { prevId } = this.confirmationData || {};
|
|
79
|
+
return (h("div", { class: `ModalContainer ${this.device}` },
|
|
80
|
+
h("casino-engagement-suite-modal", { isOpen: this.isModalOpen("REWARD_MODAL"), header: "Congratulations!", icon: "https://static.everymatrix.com/gic/img/engagement-suite/close.svg", contentIcon: "https://static.everymatrix.com/gic/img/engagement-suite/cup-reward.svg", modalType: "REWARD_MODAL", device: this.device },
|
|
81
|
+
h("div", { slot: "body" },
|
|
82
|
+
h("p", null,
|
|
83
|
+
translate('won', this.language),
|
|
84
|
+
" ",
|
|
85
|
+
h("span", { class: 'ModalReward' }, this.rewards))),
|
|
86
|
+
h("div", { slot: "footer" },
|
|
87
|
+
h("button", { class: 'ModalFooterButton', onClick: this.handleCloseClick, "data-type": 'REWARD_MODAL' }, translate('continue', this.language)))),
|
|
88
|
+
h("casino-engagement-suite-modal", { isOpen: this.isModalOpen("TARGET_MODAL"), header: prevId ?
|
|
89
|
+
translate('joinHeader', this.language) :
|
|
90
|
+
translate('unJoinHeader', this.language), icon: "https://static.everymatrix.com/gic/img/engagement-suite/close.svg", modalType: "TARGET_MODAL", device: this.device },
|
|
91
|
+
h("div", { slot: "body" },
|
|
92
|
+
h("p", { class: 'LeftAlign' }, translate('desc', this.language)),
|
|
93
|
+
h("p", { class: 'LeftAlign' }, prevId ?
|
|
94
|
+
translate('joinQuestion', this.language) :
|
|
95
|
+
translate('unJoinQuestion', this.language))),
|
|
96
|
+
h("div", { slot: "footer", class: 'ManyActions' },
|
|
97
|
+
h("button", { class: 'ModalFooterButton', onClick: this.handleChallengeAttendance }, prevId ?
|
|
98
|
+
translate('joinConfirm', this.language) :
|
|
99
|
+
translate('unJoinConfirm', this.language)),
|
|
100
|
+
h("button", { class: 'ModalFooterButtonOutlined', onClick: this.handleCloseClick, "data-type": 'TARGET_MODAL' },
|
|
101
|
+
h("div", { class: 'GradientText' }, prevId ?
|
|
102
|
+
translate('joinReject', this.language) :
|
|
103
|
+
translate('unJoinReject', this.language)))))));
|
|
104
|
+
}
|
|
105
|
+
static get is() { return "casino-engagement-suite-modal-container"; }
|
|
106
|
+
static get encapsulation() { return "shadow"; }
|
|
107
|
+
static get originalStyleUrls() { return {
|
|
108
|
+
"$": ["casino-engagement-suite-modal-container.scss"]
|
|
109
|
+
}; }
|
|
110
|
+
static get styleUrls() { return {
|
|
111
|
+
"$": ["casino-engagement-suite-modal-container.css"]
|
|
112
|
+
}; }
|
|
113
|
+
static get properties() { return {
|
|
114
|
+
"clientStyling": {
|
|
115
|
+
"type": "string",
|
|
116
|
+
"mutable": false,
|
|
117
|
+
"complexType": {
|
|
118
|
+
"original": "string",
|
|
119
|
+
"resolved": "string",
|
|
120
|
+
"references": {}
|
|
121
|
+
},
|
|
122
|
+
"required": false,
|
|
123
|
+
"optional": false,
|
|
124
|
+
"docs": {
|
|
125
|
+
"tags": [],
|
|
126
|
+
"text": "Client custom styling via string"
|
|
127
|
+
},
|
|
128
|
+
"attribute": "client-styling",
|
|
129
|
+
"reflect": true,
|
|
130
|
+
"defaultValue": "''"
|
|
131
|
+
},
|
|
132
|
+
"clientStylingUrl": {
|
|
133
|
+
"type": "string",
|
|
134
|
+
"mutable": false,
|
|
135
|
+
"complexType": {
|
|
136
|
+
"original": "string",
|
|
137
|
+
"resolved": "string",
|
|
138
|
+
"references": {}
|
|
139
|
+
},
|
|
140
|
+
"required": false,
|
|
141
|
+
"optional": false,
|
|
142
|
+
"docs": {
|
|
143
|
+
"tags": [],
|
|
144
|
+
"text": "Client custom styling via url"
|
|
145
|
+
},
|
|
146
|
+
"attribute": "client-styling-url",
|
|
147
|
+
"reflect": true,
|
|
148
|
+
"defaultValue": "''"
|
|
149
|
+
},
|
|
150
|
+
"language": {
|
|
151
|
+
"type": "string",
|
|
152
|
+
"mutable": false,
|
|
153
|
+
"complexType": {
|
|
154
|
+
"original": "string",
|
|
155
|
+
"resolved": "string",
|
|
156
|
+
"references": {}
|
|
157
|
+
},
|
|
158
|
+
"required": false,
|
|
159
|
+
"optional": false,
|
|
160
|
+
"docs": {
|
|
161
|
+
"tags": [],
|
|
162
|
+
"text": "Language of the widget"
|
|
163
|
+
},
|
|
164
|
+
"attribute": "language",
|
|
165
|
+
"reflect": false,
|
|
166
|
+
"defaultValue": "'en'"
|
|
167
|
+
},
|
|
168
|
+
"device": {
|
|
169
|
+
"type": "string",
|
|
170
|
+
"mutable": false,
|
|
171
|
+
"complexType": {
|
|
172
|
+
"original": "\"Mobile\" | \"Tablet\" | \"Desktop\"",
|
|
173
|
+
"resolved": "\"Desktop\" | \"Mobile\" | \"Tablet\"",
|
|
174
|
+
"references": {}
|
|
175
|
+
},
|
|
176
|
+
"required": false,
|
|
177
|
+
"optional": false,
|
|
178
|
+
"docs": {
|
|
179
|
+
"tags": [],
|
|
180
|
+
"text": ""
|
|
181
|
+
},
|
|
182
|
+
"attribute": "device",
|
|
183
|
+
"reflect": false,
|
|
184
|
+
"defaultValue": "'Mobile' as 'Mobile' | 'Tablet' | 'Desktop'"
|
|
185
|
+
}
|
|
186
|
+
}; }
|
|
187
|
+
static get states() { return {
|
|
188
|
+
"limitStylingAppends": {},
|
|
189
|
+
"openModals": {},
|
|
190
|
+
"rewards": {},
|
|
191
|
+
"confirmationData": {}
|
|
192
|
+
}; }
|
|
193
|
+
static get events() { return [{
|
|
194
|
+
"method": "closeModal",
|
|
195
|
+
"name": "closeModal",
|
|
196
|
+
"bubbles": true,
|
|
197
|
+
"cancelable": true,
|
|
198
|
+
"composed": true,
|
|
199
|
+
"docs": {
|
|
200
|
+
"tags": [],
|
|
201
|
+
"text": ""
|
|
202
|
+
},
|
|
203
|
+
"complexType": {
|
|
204
|
+
"original": "any",
|
|
205
|
+
"resolved": "any",
|
|
206
|
+
"references": {}
|
|
207
|
+
}
|
|
208
|
+
}]; }
|
|
209
|
+
static get elementRef() { return "host"; }
|
|
210
|
+
static get listeners() { return [{
|
|
211
|
+
"name": "openModal",
|
|
212
|
+
"method": "openModalHandler",
|
|
213
|
+
"target": "body",
|
|
214
|
+
"capture": false,
|
|
215
|
+
"passive": false
|
|
216
|
+
}, {
|
|
217
|
+
"name": "closeModal",
|
|
218
|
+
"method": "closeModalHandler",
|
|
219
|
+
"target": "body",
|
|
220
|
+
"capture": false,
|
|
221
|
+
"passive": false
|
|
222
|
+
}]; }
|
|
223
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const DEFAULT_LANGUAGE = 'en';
|
|
2
|
+
const SUPPORTED_LANGUAGES = ['en'];
|
|
3
|
+
const TRANSLATIONS = {
|
|
4
|
+
en: {
|
|
5
|
+
joinHeader: 'Choose another challenge?',
|
|
6
|
+
desc: 'Any progress on the current challenge will be kept and you can rejoin the challenge at any time.',
|
|
7
|
+
joinQuestion: 'Would you still like to join another challenge?',
|
|
8
|
+
joinConfirm: 'Yes, join another challenge',
|
|
9
|
+
joinReject: 'No, stay at the current challenge',
|
|
10
|
+
unJoinHeader: 'Quit Challenge?',
|
|
11
|
+
unJoinQuestion: 'Would you still like to quit the challenge?',
|
|
12
|
+
unJoinConfirm: 'Yes, I want to quit challenge',
|
|
13
|
+
unJoinReject: 'No, stay at challenge',
|
|
14
|
+
join: 'Unjoin',
|
|
15
|
+
unJoin: 'Unjoin',
|
|
16
|
+
continue: 'Continue',
|
|
17
|
+
won: 'You won',
|
|
18
|
+
noChallenges: 'No Challenges yet',
|
|
19
|
+
tryOtherGames: 'Try winning Challenges as rewards or launching other booster games',
|
|
20
|
+
tooltip: 'Competition where your real money bets contribute towards the level progress to achieve the level reward'
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
export const translate = (key, customLang) => {
|
|
24
|
+
const lang = customLang;
|
|
25
|
+
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
26
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface CasinoEngagementSuiteModalContainer extends Components.CasinoEngagementSuiteModalContainer, HTMLElement {}
|
|
4
|
+
export const CasinoEngagementSuiteModalContainer: {
|
|
5
|
+
prototype: CasinoEngagementSuiteModalContainer;
|
|
6
|
+
new (): CasinoEngagementSuiteModalContainer;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
+
import { d as defineCustomElement$2 } from './casino-engagement-suite-modal2.js';
|
|
3
|
+
|
|
4
|
+
const DEFAULT_LANGUAGE = 'en';
|
|
5
|
+
const SUPPORTED_LANGUAGES = ['en'];
|
|
6
|
+
const TRANSLATIONS = {
|
|
7
|
+
en: {
|
|
8
|
+
joinHeader: 'Choose another challenge?',
|
|
9
|
+
desc: 'Any progress on the current challenge will be kept and you can rejoin the challenge at any time.',
|
|
10
|
+
joinQuestion: 'Would you still like to join another challenge?',
|
|
11
|
+
joinConfirm: 'Yes, join another challenge',
|
|
12
|
+
joinReject: 'No, stay at the current challenge',
|
|
13
|
+
unJoinHeader: 'Quit Challenge?',
|
|
14
|
+
unJoinQuestion: 'Would you still like to quit the challenge?',
|
|
15
|
+
unJoinConfirm: 'Yes, I want to quit challenge',
|
|
16
|
+
unJoinReject: 'No, stay at challenge',
|
|
17
|
+
join: 'Unjoin',
|
|
18
|
+
unJoin: 'Unjoin',
|
|
19
|
+
continue: 'Continue',
|
|
20
|
+
won: 'You won',
|
|
21
|
+
noChallenges: 'No Challenges yet',
|
|
22
|
+
tryOtherGames: 'Try winning Challenges as rewards or launching other booster games',
|
|
23
|
+
tooltip: 'Competition where your real money bets contribute towards the level progress to achieve the level reward'
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
const translate = (key, customLang) => {
|
|
27
|
+
const lang = customLang;
|
|
28
|
+
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const casinoEngagementSuiteModalContainerCss = ":host{display:block}.ModalFooterButton,.ModalFooterButtonOutlined{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:140px;height:36px;font-size:14px;font-weight:var(--emw--font-weight-bold, 700);position:relative;font-family:\"Montserrat\", sans-serif;padding:0 16px;box-sizing:border-box;margin:auto;border:none;cursor:pointer}.ModalFooterButtonOutlined{background:linear-gradient(var(--emw--color-background, #1E1638) 0 0) padding-box, linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%) border-box;border:2px solid transparent}.GradientText{background-image:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);color:transparent;background-clip:text}.ManyActions{display:flex;width:100%;flex-direction:column;align-items:stretch}.ManyActions .ModalFooterButton,.ManyActions .ModalFooterButtonOutlined{width:280px}.ManyActions button:first-child{margin-bottom:16px}.ModalReward{font-weight:var(--emw--font-weight-semibold, 600);color:var(--emw--color-typography, #FFFFFF)}.ModalContainer.Mobile .ModalFooterButton{min-width:140px;height:32px}.ModalContainer.Mobile .ManyActions .ModalFooterButton,.ModalContainer.Mobile .ManyActions .ModalFooterButtonOutlined{width:100%;height:32px}.ModalContainer.Mobile .ManyActions button:first-child{margin-bottom:8px}.LeftAlign{text-align:left;line-height:1.2}";
|
|
32
|
+
|
|
33
|
+
const CasinoEngagementSuiteModalContainer$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
34
|
+
constructor() {
|
|
35
|
+
super();
|
|
36
|
+
this.__registerHost();
|
|
37
|
+
this.__attachShadow();
|
|
38
|
+
this.closeModal = createEvent(this, "closeModal", 7);
|
|
39
|
+
/**
|
|
40
|
+
* Client custom styling via string
|
|
41
|
+
*/
|
|
42
|
+
this.clientStyling = '';
|
|
43
|
+
/**
|
|
44
|
+
* Client custom styling via url
|
|
45
|
+
*/
|
|
46
|
+
this.clientStylingUrl = '';
|
|
47
|
+
/**
|
|
48
|
+
* Language of the widget
|
|
49
|
+
*/
|
|
50
|
+
this.language = 'en';
|
|
51
|
+
this.device = 'Mobile';
|
|
52
|
+
this.limitStylingAppends = false;
|
|
53
|
+
this.openModals = [];
|
|
54
|
+
this.rewards = [];
|
|
55
|
+
this.confirmationData = null;
|
|
56
|
+
this.handleCloseClick = (e) => {
|
|
57
|
+
const type = +e.currentTarget.getAttribute('data-type');
|
|
58
|
+
this.closeModal.emit(type);
|
|
59
|
+
};
|
|
60
|
+
this.handleChallengeAttendance = () => {
|
|
61
|
+
window.postMessage({
|
|
62
|
+
type: 'ChallengeAttendance',
|
|
63
|
+
confirmationData: this.confirmationData,
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
this.setClientStyling = () => {
|
|
67
|
+
let sheet = document.createElement('style');
|
|
68
|
+
sheet.innerHTML = this.clientStyling;
|
|
69
|
+
this.host.prepend(sheet);
|
|
70
|
+
};
|
|
71
|
+
this.setClientStylingURL = () => {
|
|
72
|
+
let url = new URL(this.clientStylingUrl);
|
|
73
|
+
let cssFile = document.createElement('style');
|
|
74
|
+
fetch(url.href)
|
|
75
|
+
.then((res) => res.text())
|
|
76
|
+
.then((data) => {
|
|
77
|
+
cssFile.innerHTML = data;
|
|
78
|
+
setTimeout(() => { this.host.prepend(cssFile); }, 1);
|
|
79
|
+
})
|
|
80
|
+
.catch((err) => {
|
|
81
|
+
console.log('Error ', err);
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
this.isModalOpen = (type) => {
|
|
85
|
+
return Boolean(this.openModals.find(el => el === type));
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
openModalHandler(event) {
|
|
89
|
+
const { modalType, rewards, confirmationData } = event.detail;
|
|
90
|
+
this.openModals = [...this.openModals, modalType];
|
|
91
|
+
if (rewards === null || rewards === void 0 ? void 0 : rewards.length) {
|
|
92
|
+
this.rewards = [...rewards];
|
|
93
|
+
}
|
|
94
|
+
if (confirmationData) {
|
|
95
|
+
this.confirmationData = confirmationData;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
closeModalHandler(event) {
|
|
99
|
+
this.openModals = this.openModals.filter(el => el !== event.detail);
|
|
100
|
+
}
|
|
101
|
+
componentDidRender() {
|
|
102
|
+
if (!this.limitStylingAppends && this.host) {
|
|
103
|
+
if (this.clientStyling)
|
|
104
|
+
this.setClientStyling();
|
|
105
|
+
if (this.clientStylingUrl)
|
|
106
|
+
this.setClientStylingURL();
|
|
107
|
+
this.limitStylingAppends = true;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
render() {
|
|
111
|
+
const { prevId } = this.confirmationData || {};
|
|
112
|
+
return (h("div", { class: `ModalContainer ${this.device}` }, h("casino-engagement-suite-modal", { isOpen: this.isModalOpen("REWARD_MODAL"), header: "Congratulations!", icon: "https://static.everymatrix.com/gic/img/engagement-suite/close.svg", contentIcon: "https://static.everymatrix.com/gic/img/engagement-suite/cup-reward.svg", modalType: "REWARD_MODAL", device: this.device }, h("div", { slot: "body" }, h("p", null, translate('won', this.language), " ", h("span", { class: 'ModalReward' }, this.rewards))), h("div", { slot: "footer" }, h("button", { class: 'ModalFooterButton', onClick: this.handleCloseClick, "data-type": 'REWARD_MODAL' }, translate('continue', this.language)))), h("casino-engagement-suite-modal", { isOpen: this.isModalOpen("TARGET_MODAL"), header: prevId ?
|
|
113
|
+
translate('joinHeader', this.language) :
|
|
114
|
+
translate('unJoinHeader', this.language), icon: "https://static.everymatrix.com/gic/img/engagement-suite/close.svg", modalType: "TARGET_MODAL", device: this.device }, h("div", { slot: "body" }, h("p", { class: 'LeftAlign' }, translate('desc', this.language)), h("p", { class: 'LeftAlign' }, prevId ?
|
|
115
|
+
translate('joinQuestion', this.language) :
|
|
116
|
+
translate('unJoinQuestion', this.language))), h("div", { slot: "footer", class: 'ManyActions' }, h("button", { class: 'ModalFooterButton', onClick: this.handleChallengeAttendance }, prevId ?
|
|
117
|
+
translate('joinConfirm', this.language) :
|
|
118
|
+
translate('unJoinConfirm', this.language)), h("button", { class: 'ModalFooterButtonOutlined', onClick: this.handleCloseClick, "data-type": 'TARGET_MODAL' }, h("div", { class: 'GradientText' }, prevId ?
|
|
119
|
+
translate('joinReject', this.language) :
|
|
120
|
+
translate('unJoinReject', this.language)))))));
|
|
121
|
+
}
|
|
122
|
+
get host() { return this; }
|
|
123
|
+
static get style() { return casinoEngagementSuiteModalContainerCss; }
|
|
124
|
+
}, [1, "casino-engagement-suite-modal-container", {
|
|
125
|
+
"clientStyling": [513, "client-styling"],
|
|
126
|
+
"clientStylingUrl": [513, "client-styling-url"],
|
|
127
|
+
"language": [1],
|
|
128
|
+
"device": [1],
|
|
129
|
+
"limitStylingAppends": [32],
|
|
130
|
+
"openModals": [32],
|
|
131
|
+
"rewards": [32],
|
|
132
|
+
"confirmationData": [32]
|
|
133
|
+
}, [[16, "openModal", "openModalHandler"], [16, "closeModal", "closeModalHandler"]]]);
|
|
134
|
+
function defineCustomElement$1() {
|
|
135
|
+
if (typeof customElements === "undefined") {
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
const components = ["casino-engagement-suite-modal-container", "casino-engagement-suite-modal"];
|
|
139
|
+
components.forEach(tagName => { switch (tagName) {
|
|
140
|
+
case "casino-engagement-suite-modal-container":
|
|
141
|
+
if (!customElements.get(tagName)) {
|
|
142
|
+
customElements.define(tagName, CasinoEngagementSuiteModalContainer$1);
|
|
143
|
+
}
|
|
144
|
+
break;
|
|
145
|
+
case "casino-engagement-suite-modal":
|
|
146
|
+
if (!customElements.get(tagName)) {
|
|
147
|
+
defineCustomElement$2();
|
|
148
|
+
}
|
|
149
|
+
break;
|
|
150
|
+
} });
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
const CasinoEngagementSuiteModalContainer = CasinoEngagementSuiteModalContainer$1;
|
|
154
|
+
const defineCustomElement = defineCustomElement$1;
|
|
155
|
+
|
|
156
|
+
export { CasinoEngagementSuiteModalContainer, defineCustomElement };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { C as CasinoEngagementSuiteModal$1, d as defineCustomElement$1 } from './casino-engagement-suite-modal2.js';
|
|
2
|
+
|
|
3
|
+
const CasinoEngagementSuiteModal = CasinoEngagementSuiteModal$1;
|
|
4
|
+
const defineCustomElement = defineCustomElement$1;
|
|
5
|
+
|
|
6
|
+
export { CasinoEngagementSuiteModal, defineCustomElement };
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
+
|
|
3
|
+
const MODAL_TYPES = {
|
|
4
|
+
REWARD_MODAL: 'REWARD_MODAL',
|
|
5
|
+
TARGET_MODAL: 'TARGET_MODAL'
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const casinoEngagementSuiteModalCss = ":host{display:block}*{box-sizing:border-box;margin:0;padding:0}button{border:none;background:none;cursor:pointer}button:focus{outline:none}.ModalOverlay{display:none;position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0, 0, 0, 0.5);justify-content:center;align-items:center}.ModalOverlay.Open{display:flex}.IconCloseContainer{width:100%;display:flex;justify-content:end}.ModalContent{display:flex;flex-direction:column;align-items:center;font-family:\"Montserrat\", sans-serif;position:relative;color:var(--emw--color-typography, #FFFFFF);background-color:var(--emw--color-background, #1E1638);padding:12px;border-radius:8px;width:450px;max-width:100%;text-align:center}.GradientBorder::before{content:\"\";position:absolute;top:-1px;left:-1px;right:-1px;bottom:-1px;border-radius:9px;background:linear-gradient(143.2deg, #FF9401 -0.41%, #FFD32D 45.61%, #FF9401 82.77%);z-index:-1}.ModalHeader{font-weight:var(--emw--font-weight-semibold, 600);font-size:20px;margin-top:12px;padding:0 16px}.ModalIcon{width:44px;height:44px;border-radius:50%;background-size:cover;background-position:center;background-image:url(\"https://static.everymatrix.com/gic/img/engagement-suite/bar/leaderboard.svg\");margin-top:12px}.ModalBody{margin-top:20px;font-size:16px;font-family:\"Inter\", sans-serif;font-weight:var(--emw--font-weight-normal, 400);color:var(--emw--color-gray-100, #BBB9C3);padding:0 16px}.ModalFooter{margin-top:40px;margin-bottom:28px;padding:0 16px;width:100%}.ModalOverlay.Mobile .ModalBody{font-size:14px}.ModalOverlay.Mobile .ModalContent{width:318px}.ModalOverlay.Mobile .ModalHeader h1{font-size:20px}";
|
|
9
|
+
|
|
10
|
+
const CasinoEngagementSuiteModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
11
|
+
constructor() {
|
|
12
|
+
super();
|
|
13
|
+
this.__registerHost();
|
|
14
|
+
this.__attachShadow();
|
|
15
|
+
this.closeModal = createEvent(this, "closeModal", 7);
|
|
16
|
+
/**
|
|
17
|
+
* Client custom styling via string
|
|
18
|
+
*/
|
|
19
|
+
this.clientStyling = '';
|
|
20
|
+
/**
|
|
21
|
+
* Client custom styling via url
|
|
22
|
+
*/
|
|
23
|
+
this.clientStylingUrl = '';
|
|
24
|
+
this.device = 'Mobile';
|
|
25
|
+
this.limitStylingAppends = false;
|
|
26
|
+
this.handleCloseClick = () => {
|
|
27
|
+
this.closeModal.emit(this.modalType);
|
|
28
|
+
};
|
|
29
|
+
this.setClientStyling = () => {
|
|
30
|
+
let sheet = document.createElement('style');
|
|
31
|
+
sheet.innerHTML = this.clientStyling;
|
|
32
|
+
this.host.prepend(sheet);
|
|
33
|
+
};
|
|
34
|
+
this.setClientStylingURL = () => {
|
|
35
|
+
let url = new URL(this.clientStylingUrl);
|
|
36
|
+
let cssFile = document.createElement('style');
|
|
37
|
+
fetch(url.href)
|
|
38
|
+
.then((res) => res.text())
|
|
39
|
+
.then((data) => {
|
|
40
|
+
cssFile.innerHTML = data;
|
|
41
|
+
setTimeout(() => { this.host.prepend(cssFile); }, 1);
|
|
42
|
+
})
|
|
43
|
+
.catch((err) => {
|
|
44
|
+
console.log('Error ', err);
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
componentDidRender() {
|
|
49
|
+
if (!this.limitStylingAppends && this.host) {
|
|
50
|
+
if (this.clientStyling)
|
|
51
|
+
this.setClientStyling();
|
|
52
|
+
if (this.clientStylingUrl)
|
|
53
|
+
this.setClientStylingURL();
|
|
54
|
+
this.limitStylingAppends = true;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
render() {
|
|
58
|
+
return (h("div", { class: `ModalOverlay ${this.isOpen && 'Open'} ${this.device}` }, h("div", { class: "ModalContent GradientBorder" }, h("div", { class: 'IconCloseContainer' }, h("button", { class: "IconCloseButton", onClick: this.handleCloseClick }, h("img", { src: this.icon, alt: "\u0421lose modal" }))), this.contentIcon ? (h("div", { class: "ModalIcon", style: {
|
|
59
|
+
background: `url(${this.contentIcon}) no-repeat center, linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%)`
|
|
60
|
+
} })) : this.modalType === MODAL_TYPES.REWARD_MODAL ? (h("div", { class: "ModalIcon" })) : null, h("div", { class: "ModalHeader" }, h("h1", null, this.header)), h("div", { class: "ModalBody" }, h("slot", { name: "body" })), h("div", { class: "ModalFooter" }, h("slot", { name: "footer" })))));
|
|
61
|
+
}
|
|
62
|
+
get host() { return this; }
|
|
63
|
+
static get style() { return casinoEngagementSuiteModalCss; }
|
|
64
|
+
}, [1, "casino-engagement-suite-modal", {
|
|
65
|
+
"clientStyling": [513, "client-styling"],
|
|
66
|
+
"clientStylingUrl": [513, "client-styling-url"],
|
|
67
|
+
"isOpen": [4, "is-open"],
|
|
68
|
+
"header": [1],
|
|
69
|
+
"icon": [1],
|
|
70
|
+
"contentIcon": [1, "content-icon"],
|
|
71
|
+
"modalType": [1, "modal-type"],
|
|
72
|
+
"device": [1],
|
|
73
|
+
"limitStylingAppends": [32]
|
|
74
|
+
}]);
|
|
75
|
+
function defineCustomElement() {
|
|
76
|
+
if (typeof customElements === "undefined") {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
const components = ["casino-engagement-suite-modal"];
|
|
80
|
+
components.forEach(tagName => { switch (tagName) {
|
|
81
|
+
case "casino-engagement-suite-modal":
|
|
82
|
+
if (!customElements.get(tagName)) {
|
|
83
|
+
customElements.define(tagName, CasinoEngagementSuiteModal);
|
|
84
|
+
}
|
|
85
|
+
break;
|
|
86
|
+
} });
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export { CasinoEngagementSuiteModal as C, defineCustomElement as d };
|