@everymatrix/general-about-us 1.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/dist/cjs/general-about-us.cjs.entry.js +244 -0
  2. package/dist/cjs/general-about-us.cjs.js +19 -0
  3. package/dist/cjs/index-f09c74e2.js +1223 -0
  4. package/dist/cjs/index.cjs.js +2 -0
  5. package/dist/cjs/loader.cjs.js +21 -0
  6. package/dist/collection/collection-manifest.json +12 -0
  7. package/dist/collection/components/about-us/general-about-us.css +137 -0
  8. package/dist/collection/components/about-us/general-about-us.js +282 -0
  9. package/dist/collection/components/about-us/general-about-us.types.js +2 -0
  10. package/dist/collection/index.js +1 -0
  11. package/dist/collection/utils/locale.utils.js +32 -0
  12. package/dist/collection/utils/utils.js +56 -0
  13. package/dist/components/general-about-us.d.ts +11 -0
  14. package/dist/components/general-about-us.js +269 -0
  15. package/dist/components/index.d.ts +26 -0
  16. package/dist/components/index.js +1 -0
  17. package/dist/esm/general-about-us.entry.js +240 -0
  18. package/dist/esm/general-about-us.js +17 -0
  19. package/dist/esm/index-b262ca21.js +1198 -0
  20. package/dist/esm/index.js +1 -0
  21. package/dist/esm/loader.js +17 -0
  22. package/dist/esm/polyfills/core-js.js +11 -0
  23. package/dist/esm/polyfills/css-shim.js +1 -0
  24. package/dist/esm/polyfills/dom.js +79 -0
  25. package/dist/esm/polyfills/es5-html-element.js +1 -0
  26. package/dist/esm/polyfills/index.js +34 -0
  27. package/dist/esm/polyfills/system.js +6 -0
  28. package/dist/general-about-us/general-about-us.esm.js +1 -0
  29. package/dist/general-about-us/index.esm.js +0 -0
  30. package/dist/general-about-us/p-0c90e5ab.js +1 -0
  31. package/dist/general-about-us/p-4f27291f.entry.js +1 -0
  32. package/dist/index.cjs.js +1 -0
  33. package/dist/index.js +1 -0
  34. package/dist/stencil.config.js +22 -0
  35. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/general-about-us/.stencil/packages/general-about-us/stencil.config.d.ts +2 -0
  36. package/dist/types/components/about-us/general-about-us.d.ts +43 -0
  37. package/dist/types/components/about-us/general-about-us.types.d.ts +17 -0
  38. package/dist/types/components.d.ts +85 -0
  39. package/dist/types/index.d.ts +1 -0
  40. package/dist/types/stencil-public-runtime.d.ts +1565 -0
  41. package/dist/types/utils/locale.utils.d.ts +1 -0
  42. package/dist/types/utils/utils.d.ts +3 -0
  43. package/loader/cdn.js +3 -0
  44. package/loader/index.cjs.js +3 -0
  45. package/loader/index.d.ts +12 -0
  46. package/loader/index.es2017.js +3 -0
  47. package/loader/index.js +4 -0
  48. package/loader/package.json +10 -0
  49. package/package.json +19 -0
@@ -0,0 +1,269 @@
1
+ import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
+
3
+ const DEFAULT_LANGUAGE = 'en';
4
+ const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'ar', 'hu', 'hr'];
5
+ const TRANSLATIONS = {
6
+ en: {
7
+ error: 'Error',
8
+ noResults: 'Loading, please wait ...',
9
+ },
10
+ hu: {
11
+ error: 'Error',
12
+ noResults: 'Loading, please wait ...',
13
+ },
14
+ ro: {
15
+ error: 'Eroare',
16
+ noResults: 'Loading, please wait ...',
17
+ },
18
+ fr: {
19
+ error: 'Error',
20
+ noResults: 'Loading, please wait ...',
21
+ },
22
+ ar: {
23
+ error: 'خطأ',
24
+ noResults: 'Loading, please wait ...',
25
+ },
26
+ hr: {
27
+ error: 'Greška',
28
+ noResults: 'Učitavanje, molimo pričekajte ...',
29
+ }
30
+ };
31
+ const translate = (key, customLang) => {
32
+ const lang = customLang;
33
+ return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
34
+ };
35
+
36
+ function checkDeviceType() {
37
+ const userAgent = navigator.userAgent.toLowerCase();
38
+ const width = screen.availWidth;
39
+ const height = screen.availHeight;
40
+ if (userAgent.includes('iphone')) {
41
+ return 'mobile';
42
+ }
43
+ if (userAgent.includes('android')) {
44
+ if (height > width && width < 800) {
45
+ return 'mobile';
46
+ }
47
+ if (width > height && height < 800) {
48
+ return 'tablet';
49
+ }
50
+ }
51
+ return 'desktop';
52
+ }
53
+ function checkCustomDeviceWidth() {
54
+ const width = screen.availWidth;
55
+ if (width < 600) {
56
+ return 'mobile';
57
+ }
58
+ else if (width >= 600 && width < 1100) {
59
+ return 'tablet';
60
+ }
61
+ }
62
+ function getDeviceCustom() {
63
+ const userAgent = navigator.userAgent.toLowerCase();
64
+ let source = '';
65
+ source = (userAgent.includes('android') || userAgent.includes('iphone') || userAgent.includes('ipad')) ? checkCustomDeviceWidth() : 'desktop';
66
+ return source;
67
+ }
68
+ const getDevice = () => {
69
+ let userAgent = window.navigator.userAgent.toLocaleLowerCase();
70
+ if (userAgent.includes('android/i'))
71
+ return 'android';
72
+ if (userAgent.includes('iphone/i'))
73
+ return 'iPhone';
74
+ if (userAgent.includes('ipad/i') || userAgent.includes('ipod/i'))
75
+ return 'iPad';
76
+ return 'PC';
77
+ };
78
+ const getDevicePlatform = () => {
79
+ const device = getDevice();
80
+ if (device) {
81
+ if (device === 'PC') {
82
+ return 'dk';
83
+ }
84
+ else if (device === 'iPad' || device === 'iPhone') {
85
+ return 'mtWeb';
86
+ }
87
+ else {
88
+ return 'mtWeb';
89
+ }
90
+ }
91
+ };
92
+
93
+ const generalAboutUsCss = ":host {\n display: block;\n font-family: inherit;\n}\n\np {\n margin: 0;\n padding: 0;\n font-family: inherit;\n}\n\nbutton {\n font-family: inherit;\n}\n\n.AboutUsError .ErrorInfo {\n color: var(--emfe-w-color-error, var(--emfe-w-color-red, #ed0909));\n}\n\n.AboutUsWrapper {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n width: 100%;\n background-color: var(--emfe-w-casino-color-bg, var(--emfe-w-color-background, #07072A));\n animation: fadeInAnimation ease 1.5s;\n animation-iteration-count: 1;\n animation-fill-mode: forwards;\n}\n\n@keyframes fadeInAnimation {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n.ItemImage {\n flex: auto;\n max-width: 50%;\n height: 300px;\n border-radius: 5px;\n}\n\n.ItemDetails {\n flex: 1 1 0;\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n border-radius: 5px;\n margin: 0 20px;\n}\n\n.Title {\n font-size: 24px;\n font-weight: 700;\n -webkit-text-fill-color: transparent;\n color: var(--emfe-w-casino-typography, var(--emfe-w-color-contrast, #FFFFFF));\n background: linear-gradient(to top, var(--emfe-w-categories-color-secondary, var(--emfe-w-color-secondary, #FD2839)), var(--emfe-w-categories-color-primary, var(--emfe-w-color-primary, #D0046C)));\n -webkit-background-clip: text;\n -webkit-text-fill-color: transparent;\n}\n\n.Description {\n font-size: 16px;\n color: var(--emfe-w-casino-typography, var(--emfe-w-color-contrast, #FFFFFF));\n}\n\nbutton {\n width: 160px;\n padding: 10px 15px;\n background: linear-gradient(to top, var(--emfe-w-categories-color-secondary, var(--emfe-w-color-secondary, #FD2839)), var(--emfe-w-categories-color-primary, var(--emfe-w-color-primary, #D0046C)));\n color: var(--emfe-w-button-typography, var(--emfe-w-color-white, #FFFFFF));\n font-size: 16px;\n border: 2px solid var(--emfe-w-casino-color-primary, var(--emfe-w-color-primary, #D0046C));\n border-radius: 5px;\n line-height: 24px;\n transition: all 1s;\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n}\nbutton:hover {\n background: linear-gradient(to bottom, var(--emfe-w-categories-color-secondary, var(--emfe-w-color-secondary, #FD2839)), var(--emfe-w-categories-color-primary, var(--emfe-w-color-primary, #D0046C)));\n color: var(--emfe-w-button-typography, var(--emfe-w-color-white, #FFFFFF));\n transition: all 0.5s;\n transform: translateY(-10px);\n}\nbutton button::after {\n content: \"\";\n display: block;\n background-color: var(--emfe-w-button-typography, var(--emfe-w-color-white, #FFFFFF));\n mask-image: url(\"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0yMS44ODMgMTJsLTcuNTI3IDYuMjM1LjY0NC43NjUgOS03LjUyMS05LTcuNDc5LS42NDUuNzY0IDcuNTI5IDYuMjM2aC0yMS44ODR2MWgyMS44ODN6Ii8+PC9zdmc+\");\n width: 24px;\n height: 24px;\n margin: 0 10px;\n}\n\n@container (max-width: 475px) {\n .AboutUsWrapper {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n flex-wrap: wrap;\n width: 100%;\n gap: 20px;\n padding-bottom: 20px;\n background-color: var(--emfe-w-casino-color-bg, var(--emfe-w-color-background, #07072A));\n animation: fadeInAnimation ease 1.5s;\n animation-iteration-count: 1;\n animation-fill-mode: forwards;\n }\n\n .ItemImage {\n flex: auto;\n width: 100%;\n max-width: unset;\n flex-grow: 1;\n }\n\n .ItemDetails {\n flex: 1 1 0;\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n align-items: center;\n border-radius: 5px;\n gap: 20px;\n margin: 0 20px;\n }\n\n .Description {\n text-align: center;\n }\n}";
94
+
95
+ const GeneralAboutUs$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
96
+ constructor() {
97
+ super();
98
+ this.__registerHost();
99
+ this.__attachShadow();
100
+ /**
101
+ * Language of the widget
102
+ */
103
+ this.language = 'en';
104
+ /**
105
+ * User roles
106
+ */
107
+ this.userRoles = 'everyone';
108
+ /**
109
+ * CMS Endpoint stage
110
+ */
111
+ this.cmsEnv = 'stage';
112
+ /**
113
+ * Client custom styling via inline style
114
+ */
115
+ this.clientStyling = '';
116
+ /**
117
+ * Client custom styling via url
118
+ */
119
+ this.clientStylingUrl = '';
120
+ this.hasErrors = false;
121
+ this.isLoading = true;
122
+ this.limitStylingAppends = false;
123
+ this.device = '';
124
+ this.handleClick = (url, target, location, isExternal) => {
125
+ window.postMessage({ type: 'AboutUsClicked', buttonUrl: url, targetType: target, locations: location, externalLink: isExternal || false }, window.location.href);
126
+ // @ts-ignore Analytics event
127
+ if (typeof gtag == 'function') {
128
+ // @ts-ignore
129
+ gtag('event', 'GeneralAboutUs', {
130
+ 'context': 'AboutUsContent'
131
+ });
132
+ }
133
+ };
134
+ this.setImage = (image) => {
135
+ let source = '';
136
+ this.device = checkDeviceType();
137
+ switch (this.device) {
138
+ case 'mobile':
139
+ source = image.imageMobile;
140
+ break;
141
+ case 'tablet':
142
+ source = image.imageTablet;
143
+ break;
144
+ case 'desktop':
145
+ source = image.imageDesktop;
146
+ break;
147
+ }
148
+ return source;
149
+ };
150
+ this.setClientStyling = () => {
151
+ let sheet = document.createElement('style');
152
+ sheet.innerHTML = this.clientStyling;
153
+ this.stylingContainer.prepend(sheet);
154
+ };
155
+ this.setClientStylingURL = () => {
156
+ let url = new URL(this.clientStylingUrl);
157
+ let cssFile = document.createElement('style');
158
+ fetch(url.href)
159
+ .then((res) => res.text())
160
+ .then((data) => {
161
+ cssFile.innerHTML = data;
162
+ setTimeout(() => { this.stylingContainer.prepend(cssFile); }, 1);
163
+ })
164
+ .catch((err) => {
165
+ console.log('error ', err);
166
+ });
167
+ };
168
+ }
169
+ watchEndpoint(newValue, oldValue) {
170
+ if (newValue && newValue != oldValue && this.cmsEndpoint) {
171
+ this.getAboutUs();
172
+ }
173
+ }
174
+ componentWillLoad() {
175
+ if (this.cmsEndpoint && this.language) {
176
+ return this.getAboutUs();
177
+ }
178
+ }
179
+ componentDidLoad() {
180
+ this.device = getDeviceCustom();
181
+ }
182
+ getAboutUs() {
183
+ let url = new URL(`${this.cmsEndpoint}/${this.language}/homepage`);
184
+ url.searchParams.append('env', this.cmsEnv);
185
+ url.searchParams.append('userRoles', this.userRoles);
186
+ url.searchParams.append('device', getDevicePlatform());
187
+ return new Promise((resolve, reject) => {
188
+ this.isLoading = true;
189
+ fetch(url.href)
190
+ .then((res) => res.json())
191
+ .then((aboutUsContent) => {
192
+ const keysToKeep = ['title', 'description', 'images', 'button', 'externalLink', 'targetType', 'locations'];
193
+ const aboutUsArrContent = Object.entries(aboutUsContent)
194
+ .filter(([key]) => keysToKeep.includes(key))
195
+ .reduce((acc, [key, value]) => {
196
+ acc[key] = value;
197
+ return acc;
198
+ }, {});
199
+ this.aboutUsData = aboutUsArrContent;
200
+ resolve(aboutUsArrContent);
201
+ }).catch((err) => {
202
+ console.error(err);
203
+ this.hasErrors = true;
204
+ reject(err);
205
+ }).finally(() => {
206
+ this.isLoading = false;
207
+ });
208
+ });
209
+ }
210
+ componentDidRender() {
211
+ // start custom styling area
212
+ if (!this.limitStylingAppends && this.stylingContainer) {
213
+ if (this.clientStyling)
214
+ this.setClientStyling();
215
+ if (this.clientStylingUrl)
216
+ this.setClientStylingURL();
217
+ this.limitStylingAppends = true;
218
+ }
219
+ }
220
+ // end custom styling area
221
+ render() {
222
+ var _a, _b, _c, _d;
223
+ if (this.hasErrors) {
224
+ return (h("div", { class: "AboutUsError" }, h("div", { class: "ErrorInfo" }, translate('error', this.language))));
225
+ }
226
+ if (!this.isLoading) {
227
+ return (h("div", { ref: el => this.stylingContainer = el }, h("div", { class: "AboutUsWrapper" }, h("div", { class: "ItemImage", style: { background: `url(${this.setImage(this.aboutUsData.images)}) no-repeat center center / cover` } }), h("div", { class: "ItemDetails" }, h("div", { class: "Title", innerHTML: (_a = this.aboutUsData) === null || _a === void 0 ? void 0 : _a.title }), h("div", { class: "Description", innerHTML: (_b = this.aboutUsData) === null || _b === void 0 ? void 0 : _b.description }), h("button", { class: "Button", onClick: () => {
228
+ var _a, _b, _c, _d, _e;
229
+ return this.handleClick((_b = (_a = this.aboutUsData) === null || _a === void 0 ? void 0 : _a.button) === null || _b === void 0 ? void 0 : _b.buttonUrl, (_c = this.aboutUsData) === null || _c === void 0 ? void 0 : _c.targetType, (_d = this.aboutUsData) === null || _d === void 0 ? void 0 : _d.locations, (_e = this.aboutUsData) === null || _e === void 0 ? void 0 : _e.externalLink);
230
+ } }, (_d = (_c = this.aboutUsData) === null || _c === void 0 ? void 0 : _c.button) === null || _d === void 0 ? void 0 : _d.buttonText)))));
231
+ }
232
+ }
233
+ static get watchers() { return {
234
+ "cmsEndpoint": ["watchEndpoint"],
235
+ "language": ["watchEndpoint"],
236
+ "userRoles": ["watchEndpoint"],
237
+ "device": ["watchEndpoint"]
238
+ }; }
239
+ static get style() { return generalAboutUsCss; }
240
+ }, [1, "general-about-us", {
241
+ "cmsEndpoint": [513, "cms-endpoint"],
242
+ "language": [513],
243
+ "userRoles": [513, "user-roles"],
244
+ "cmsEnv": [513, "cms-env"],
245
+ "clientStyling": [513, "client-styling"],
246
+ "clientStylingUrl": [513, "client-styling-url"],
247
+ "hasErrors": [32],
248
+ "isLoading": [32],
249
+ "limitStylingAppends": [32],
250
+ "device": [32]
251
+ }]);
252
+ function defineCustomElement$1() {
253
+ if (typeof customElements === "undefined") {
254
+ return;
255
+ }
256
+ const components = ["general-about-us"];
257
+ components.forEach(tagName => { switch (tagName) {
258
+ case "general-about-us":
259
+ if (!customElements.get(tagName)) {
260
+ customElements.define(tagName, GeneralAboutUs$1);
261
+ }
262
+ break;
263
+ } });
264
+ }
265
+
266
+ const GeneralAboutUs = GeneralAboutUs$1;
267
+ const defineCustomElement = defineCustomElement$1;
268
+
269
+ export { GeneralAboutUs, defineCustomElement };
@@ -0,0 +1,26 @@
1
+ /* GeneralAboutUs 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';
@@ -0,0 +1 @@
1
+ export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
@@ -0,0 +1,240 @@
1
+ import { r as registerInstance, h } from './index-b262ca21.js';
2
+
3
+ const DEFAULT_LANGUAGE = 'en';
4
+ const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'ar', 'hu', 'hr'];
5
+ const TRANSLATIONS = {
6
+ en: {
7
+ error: 'Error',
8
+ noResults: 'Loading, please wait ...',
9
+ },
10
+ hu: {
11
+ error: 'Error',
12
+ noResults: 'Loading, please wait ...',
13
+ },
14
+ ro: {
15
+ error: 'Eroare',
16
+ noResults: 'Loading, please wait ...',
17
+ },
18
+ fr: {
19
+ error: 'Error',
20
+ noResults: 'Loading, please wait ...',
21
+ },
22
+ ar: {
23
+ error: 'خطأ',
24
+ noResults: 'Loading, please wait ...',
25
+ },
26
+ hr: {
27
+ error: 'Greška',
28
+ noResults: 'Učitavanje, molimo pričekajte ...',
29
+ }
30
+ };
31
+ const translate = (key, customLang) => {
32
+ const lang = customLang;
33
+ return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
34
+ };
35
+
36
+ function checkDeviceType() {
37
+ const userAgent = navigator.userAgent.toLowerCase();
38
+ const width = screen.availWidth;
39
+ const height = screen.availHeight;
40
+ if (userAgent.includes('iphone')) {
41
+ return 'mobile';
42
+ }
43
+ if (userAgent.includes('android')) {
44
+ if (height > width && width < 800) {
45
+ return 'mobile';
46
+ }
47
+ if (width > height && height < 800) {
48
+ return 'tablet';
49
+ }
50
+ }
51
+ return 'desktop';
52
+ }
53
+ function checkCustomDeviceWidth() {
54
+ const width = screen.availWidth;
55
+ if (width < 600) {
56
+ return 'mobile';
57
+ }
58
+ else if (width >= 600 && width < 1100) {
59
+ return 'tablet';
60
+ }
61
+ }
62
+ function getDeviceCustom() {
63
+ const userAgent = navigator.userAgent.toLowerCase();
64
+ let source = '';
65
+ source = (userAgent.includes('android') || userAgent.includes('iphone') || userAgent.includes('ipad')) ? checkCustomDeviceWidth() : 'desktop';
66
+ return source;
67
+ }
68
+ const getDevice = () => {
69
+ let userAgent = window.navigator.userAgent.toLocaleLowerCase();
70
+ if (userAgent.includes('android/i'))
71
+ return 'android';
72
+ if (userAgent.includes('iphone/i'))
73
+ return 'iPhone';
74
+ if (userAgent.includes('ipad/i') || userAgent.includes('ipod/i'))
75
+ return 'iPad';
76
+ return 'PC';
77
+ };
78
+ const getDevicePlatform = () => {
79
+ const device = getDevice();
80
+ if (device) {
81
+ if (device === 'PC') {
82
+ return 'dk';
83
+ }
84
+ else if (device === 'iPad' || device === 'iPhone') {
85
+ return 'mtWeb';
86
+ }
87
+ else {
88
+ return 'mtWeb';
89
+ }
90
+ }
91
+ };
92
+
93
+ const generalAboutUsCss = ":host {\n display: block;\n font-family: inherit;\n}\n\np {\n margin: 0;\n padding: 0;\n font-family: inherit;\n}\n\nbutton {\n font-family: inherit;\n}\n\n.AboutUsError .ErrorInfo {\n color: var(--emfe-w-color-error, var(--emfe-w-color-red, #ed0909));\n}\n\n.AboutUsWrapper {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n width: 100%;\n background-color: var(--emfe-w-casino-color-bg, var(--emfe-w-color-background, #07072A));\n animation: fadeInAnimation ease 1.5s;\n animation-iteration-count: 1;\n animation-fill-mode: forwards;\n}\n\n@keyframes fadeInAnimation {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n.ItemImage {\n flex: auto;\n max-width: 50%;\n height: 300px;\n border-radius: 5px;\n}\n\n.ItemDetails {\n flex: 1 1 0;\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n border-radius: 5px;\n margin: 0 20px;\n}\n\n.Title {\n font-size: 24px;\n font-weight: 700;\n -webkit-text-fill-color: transparent;\n color: var(--emfe-w-casino-typography, var(--emfe-w-color-contrast, #FFFFFF));\n background: linear-gradient(to top, var(--emfe-w-categories-color-secondary, var(--emfe-w-color-secondary, #FD2839)), var(--emfe-w-categories-color-primary, var(--emfe-w-color-primary, #D0046C)));\n -webkit-background-clip: text;\n -webkit-text-fill-color: transparent;\n}\n\n.Description {\n font-size: 16px;\n color: var(--emfe-w-casino-typography, var(--emfe-w-color-contrast, #FFFFFF));\n}\n\nbutton {\n width: 160px;\n padding: 10px 15px;\n background: linear-gradient(to top, var(--emfe-w-categories-color-secondary, var(--emfe-w-color-secondary, #FD2839)), var(--emfe-w-categories-color-primary, var(--emfe-w-color-primary, #D0046C)));\n color: var(--emfe-w-button-typography, var(--emfe-w-color-white, #FFFFFF));\n font-size: 16px;\n border: 2px solid var(--emfe-w-casino-color-primary, var(--emfe-w-color-primary, #D0046C));\n border-radius: 5px;\n line-height: 24px;\n transition: all 1s;\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n}\nbutton:hover {\n background: linear-gradient(to bottom, var(--emfe-w-categories-color-secondary, var(--emfe-w-color-secondary, #FD2839)), var(--emfe-w-categories-color-primary, var(--emfe-w-color-primary, #D0046C)));\n color: var(--emfe-w-button-typography, var(--emfe-w-color-white, #FFFFFF));\n transition: all 0.5s;\n transform: translateY(-10px);\n}\nbutton button::after {\n content: \"\";\n display: block;\n background-color: var(--emfe-w-button-typography, var(--emfe-w-color-white, #FFFFFF));\n mask-image: url(\"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0yMS44ODMgMTJsLTcuNTI3IDYuMjM1LjY0NC43NjUgOS03LjUyMS05LTcuNDc5LS42NDUuNzY0IDcuNTI5IDYuMjM2aC0yMS44ODR2MWgyMS44ODN6Ii8+PC9zdmc+\");\n width: 24px;\n height: 24px;\n margin: 0 10px;\n}\n\n@container (max-width: 475px) {\n .AboutUsWrapper {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n flex-wrap: wrap;\n width: 100%;\n gap: 20px;\n padding-bottom: 20px;\n background-color: var(--emfe-w-casino-color-bg, var(--emfe-w-color-background, #07072A));\n animation: fadeInAnimation ease 1.5s;\n animation-iteration-count: 1;\n animation-fill-mode: forwards;\n }\n\n .ItemImage {\n flex: auto;\n width: 100%;\n max-width: unset;\n flex-grow: 1;\n }\n\n .ItemDetails {\n flex: 1 1 0;\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n align-items: center;\n border-radius: 5px;\n gap: 20px;\n margin: 0 20px;\n }\n\n .Description {\n text-align: center;\n }\n}";
94
+
95
+ const GeneralAboutUs = class {
96
+ constructor(hostRef) {
97
+ registerInstance(this, hostRef);
98
+ /**
99
+ * Language of the widget
100
+ */
101
+ this.language = 'en';
102
+ /**
103
+ * User roles
104
+ */
105
+ this.userRoles = 'everyone';
106
+ /**
107
+ * CMS Endpoint stage
108
+ */
109
+ this.cmsEnv = 'stage';
110
+ /**
111
+ * Client custom styling via inline style
112
+ */
113
+ this.clientStyling = '';
114
+ /**
115
+ * Client custom styling via url
116
+ */
117
+ this.clientStylingUrl = '';
118
+ this.hasErrors = false;
119
+ this.isLoading = true;
120
+ this.limitStylingAppends = false;
121
+ this.device = '';
122
+ this.handleClick = (url, target, location, isExternal) => {
123
+ window.postMessage({ type: 'AboutUsClicked', buttonUrl: url, targetType: target, locations: location, externalLink: isExternal || false }, window.location.href);
124
+ // @ts-ignore Analytics event
125
+ if (typeof gtag == 'function') {
126
+ // @ts-ignore
127
+ gtag('event', 'GeneralAboutUs', {
128
+ 'context': 'AboutUsContent'
129
+ });
130
+ }
131
+ };
132
+ this.setImage = (image) => {
133
+ let source = '';
134
+ this.device = checkDeviceType();
135
+ switch (this.device) {
136
+ case 'mobile':
137
+ source = image.imageMobile;
138
+ break;
139
+ case 'tablet':
140
+ source = image.imageTablet;
141
+ break;
142
+ case 'desktop':
143
+ source = image.imageDesktop;
144
+ break;
145
+ }
146
+ return source;
147
+ };
148
+ this.setClientStyling = () => {
149
+ let sheet = document.createElement('style');
150
+ sheet.innerHTML = this.clientStyling;
151
+ this.stylingContainer.prepend(sheet);
152
+ };
153
+ this.setClientStylingURL = () => {
154
+ let url = new URL(this.clientStylingUrl);
155
+ let cssFile = document.createElement('style');
156
+ fetch(url.href)
157
+ .then((res) => res.text())
158
+ .then((data) => {
159
+ cssFile.innerHTML = data;
160
+ setTimeout(() => { this.stylingContainer.prepend(cssFile); }, 1);
161
+ })
162
+ .catch((err) => {
163
+ console.log('error ', err);
164
+ });
165
+ };
166
+ }
167
+ watchEndpoint(newValue, oldValue) {
168
+ if (newValue && newValue != oldValue && this.cmsEndpoint) {
169
+ this.getAboutUs();
170
+ }
171
+ }
172
+ componentWillLoad() {
173
+ if (this.cmsEndpoint && this.language) {
174
+ return this.getAboutUs();
175
+ }
176
+ }
177
+ componentDidLoad() {
178
+ this.device = getDeviceCustom();
179
+ }
180
+ getAboutUs() {
181
+ let url = new URL(`${this.cmsEndpoint}/${this.language}/homepage`);
182
+ url.searchParams.append('env', this.cmsEnv);
183
+ url.searchParams.append('userRoles', this.userRoles);
184
+ url.searchParams.append('device', getDevicePlatform());
185
+ return new Promise((resolve, reject) => {
186
+ this.isLoading = true;
187
+ fetch(url.href)
188
+ .then((res) => res.json())
189
+ .then((aboutUsContent) => {
190
+ const keysToKeep = ['title', 'description', 'images', 'button', 'externalLink', 'targetType', 'locations'];
191
+ const aboutUsArrContent = Object.entries(aboutUsContent)
192
+ .filter(([key]) => keysToKeep.includes(key))
193
+ .reduce((acc, [key, value]) => {
194
+ acc[key] = value;
195
+ return acc;
196
+ }, {});
197
+ this.aboutUsData = aboutUsArrContent;
198
+ resolve(aboutUsArrContent);
199
+ }).catch((err) => {
200
+ console.error(err);
201
+ this.hasErrors = true;
202
+ reject(err);
203
+ }).finally(() => {
204
+ this.isLoading = false;
205
+ });
206
+ });
207
+ }
208
+ componentDidRender() {
209
+ // start custom styling area
210
+ if (!this.limitStylingAppends && this.stylingContainer) {
211
+ if (this.clientStyling)
212
+ this.setClientStyling();
213
+ if (this.clientStylingUrl)
214
+ this.setClientStylingURL();
215
+ this.limitStylingAppends = true;
216
+ }
217
+ }
218
+ // end custom styling area
219
+ render() {
220
+ var _a, _b, _c, _d;
221
+ if (this.hasErrors) {
222
+ return (h("div", { class: "AboutUsError" }, h("div", { class: "ErrorInfo" }, translate('error', this.language))));
223
+ }
224
+ if (!this.isLoading) {
225
+ return (h("div", { ref: el => this.stylingContainer = el }, h("div", { class: "AboutUsWrapper" }, h("div", { class: "ItemImage", style: { background: `url(${this.setImage(this.aboutUsData.images)}) no-repeat center center / cover` } }), h("div", { class: "ItemDetails" }, h("div", { class: "Title", innerHTML: (_a = this.aboutUsData) === null || _a === void 0 ? void 0 : _a.title }), h("div", { class: "Description", innerHTML: (_b = this.aboutUsData) === null || _b === void 0 ? void 0 : _b.description }), h("button", { class: "Button", onClick: () => {
226
+ var _a, _b, _c, _d, _e;
227
+ return this.handleClick((_b = (_a = this.aboutUsData) === null || _a === void 0 ? void 0 : _a.button) === null || _b === void 0 ? void 0 : _b.buttonUrl, (_c = this.aboutUsData) === null || _c === void 0 ? void 0 : _c.targetType, (_d = this.aboutUsData) === null || _d === void 0 ? void 0 : _d.locations, (_e = this.aboutUsData) === null || _e === void 0 ? void 0 : _e.externalLink);
228
+ } }, (_d = (_c = this.aboutUsData) === null || _c === void 0 ? void 0 : _c.button) === null || _d === void 0 ? void 0 : _d.buttonText)))));
229
+ }
230
+ }
231
+ static get watchers() { return {
232
+ "cmsEndpoint": ["watchEndpoint"],
233
+ "language": ["watchEndpoint"],
234
+ "userRoles": ["watchEndpoint"],
235
+ "device": ["watchEndpoint"]
236
+ }; }
237
+ };
238
+ GeneralAboutUs.style = generalAboutUsCss;
239
+
240
+ export { GeneralAboutUs as general_about_us };
@@ -0,0 +1,17 @@
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-b262ca21.js';
2
+
3
+ /*
4
+ Stencil Client Patch Browser v2.15.2 | MIT Licensed | https://stenciljs.com
5
+ */
6
+ const patchBrowser = () => {
7
+ const importMeta = import.meta.url;
8
+ const opts = {};
9
+ if (importMeta !== '') {
10
+ opts.resourcesUrl = new URL('.', importMeta).href;
11
+ }
12
+ return promiseResolve(opts);
13
+ };
14
+
15
+ patchBrowser().then(options => {
16
+ return bootstrapLazy([["general-about-us",[[1,"general-about-us",{"cmsEndpoint":[513,"cms-endpoint"],"language":[513],"userRoles":[513,"user-roles"],"cmsEnv":[513,"cms-env"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"hasErrors":[32],"isLoading":[32],"limitStylingAppends":[32],"device":[32]}]]]], options);
17
+ });