@everymatrix/general-preview-social-posts 1.44.0 → 1.45.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/app-globals-3a1e7e63.js +5 -0
  2. package/dist/cjs/general-preview-social-posts.cjs.entry.js +271 -312
  3. package/dist/cjs/general-preview-social-posts.cjs.js +17 -11
  4. package/dist/cjs/index-3a1dd540.js +1200 -0
  5. package/dist/cjs/loader.cjs.js +7 -13
  6. package/dist/collection/collection-manifest.json +3 -3
  7. package/dist/collection/components/general-preview-social-posts/general-preview-social-posts.css +4 -6
  8. package/dist/collection/components/general-preview-social-posts/general-preview-social-posts.js +516 -563
  9. package/dist/collection/components/general-preview-social-posts/index.js +1 -0
  10. package/dist/collection/utils/locale.utils.js +52 -52
  11. package/dist/collection/utils/utils.js +31 -31
  12. package/dist/esm/app-globals-0f993ce5.js +3 -0
  13. package/dist/esm/general-preview-social-posts.entry.js +271 -312
  14. package/dist/esm/general-preview-social-posts.js +14 -11
  15. package/dist/esm/index-16f33f52.js +1173 -0
  16. package/dist/esm/loader.js +7 -13
  17. package/dist/general-preview-social-posts/general-preview-social-posts.esm.js +1 -1
  18. package/dist/general-preview-social-posts/p-1f296318.js +2 -0
  19. package/dist/general-preview-social-posts/{p-6826d836.entry.js → p-2080a6e8.entry.js} +1 -1
  20. package/dist/general-preview-social-posts/p-e1255160.js +1 -0
  21. package/dist/stencil.config.dev.js +17 -0
  22. package/dist/stencil.config.js +14 -19
  23. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/general-preview-social-posts/.stencil/packages/stencil/general-preview-social-posts/stencil.config.d.ts +2 -0
  24. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/general-preview-social-posts/.stencil/packages/stencil/general-preview-social-posts/stencil.config.dev.d.ts +2 -0
  25. package/dist/types/components/general-preview-social-posts/general-preview-social-posts.d.ts +80 -80
  26. package/dist/types/components/general-preview-social-posts/index.d.ts +1 -0
  27. package/dist/types/components.d.ts +20 -3
  28. package/dist/types/stencil-public-runtime.d.ts +142 -33
  29. package/loader/cdn.js +1 -3
  30. package/loader/index.cjs.js +1 -3
  31. package/loader/index.d.ts +13 -1
  32. package/loader/index.es2017.js +1 -3
  33. package/loader/index.js +1 -3
  34. package/loader/package.json +1 -0
  35. package/package.json +8 -1
  36. package/dist/cjs/index-e178764e.js +0 -1223
  37. package/dist/components/general-preview-social-posts.d.ts +0 -11
  38. package/dist/components/general-preview-social-posts.js +0 -392
  39. package/dist/components/index.d.ts +0 -26
  40. package/dist/components/index.js +0 -1
  41. package/dist/esm/index-8a671ab9.js +0 -1197
  42. package/dist/esm/polyfills/core-js.js +0 -11
  43. package/dist/esm/polyfills/css-shim.js +0 -1
  44. package/dist/esm/polyfills/dom.js +0 -79
  45. package/dist/esm/polyfills/es5-html-element.js +0 -1
  46. package/dist/esm/polyfills/index.js +0 -34
  47. package/dist/esm/polyfills/system.js +0 -6
  48. package/dist/general-preview-social-posts/p-c682801c.js +0 -1
  49. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/general-preview-social-posts/.stencil/packages/general-preview-social-posts/stencil.config.d.ts +0 -2
@@ -1,580 +1,533 @@
1
- import { Component, h, Prop, State, Event, Watch } from '@stencil/core';
2
- import { getTranslations, translate } from '../../utils/locale.utils';
3
- import { getDevicePlatform } from '../../utils/utils';
4
- export class SocialSlider {
5
- constructor() {
6
- /**
7
- * The userId
8
- */
9
- this.userId = '';
10
- /**
11
- * The session
12
- */
13
- this.session = '';
14
- /**
15
- * The Posts Title
16
- */
17
- this.postsTitle = '';
18
- /**
19
- * The max cards displayed
20
- */
21
- this.maxCards = '';
22
- /**
23
- * The language
24
- */
25
- this.language = 'en';
26
- /**
27
- * The datasource
28
- */
29
- this.datasource = '';
30
- /**
31
- * The NorWAy endpoint
32
- */
33
- this.endpoint = '';
34
- /**
35
- * The NorWAy endpoint
36
- */
37
- this.cmsEndpoint = '';
38
- /**
39
- * The userRoles
40
- */
41
- this.userRoles = '';
42
- /**
43
- * The translationurl
44
- */
45
- this.translationUrl = '';
46
- /**
47
- * Client custom styling via string
48
- */
49
- this.clientStyling = '';
50
- /**
51
- * Client custom styling via url content
52
- */
53
- this.clientStylingUrl = '';
54
- /**
55
- * CMS Endpoint stage
56
- */
57
- this.cmsEnv = 'stage';
58
- /**
59
- * The page parameter for the cms call
60
- */
61
- this.pageName = 'casino';
62
- this.posts = []; // State to store fetched posts
63
- this.stylingAppends = false;
64
- this.isLoading = false;
65
- this.isLoggedIn = false;
66
- this.dataImages = []; // State to store fetched images
67
- this.gameIds = ''; // State to store fetched images
68
- this.platform = getDevicePlatform();
69
- this.setClientStyling = () => {
70
- let sheet = document.createElement('style');
71
- sheet.innerHTML = this.clientStyling;
72
- this.stylingContainer.prepend(sheet);
73
- };
74
- this.setClientStylingURL = () => {
75
- let url = new URL(this.clientStylingUrl);
76
- let cssFile = document.createElement('style');
77
- fetch(url.href)
78
- .then((res) => res.text())
79
- .then((data) => {
80
- cssFile.innerHTML = data;
81
- setTimeout(() => { this.stylingContainer.prepend(cssFile); }, 1);
82
- })
83
- .catch((err) => {
84
- console.log('error ', err);
85
- });
86
- };
87
- }
88
- handleNewTranslations() {
89
- this.isLoading = true;
90
- getTranslations(this.translationUrl).then(() => {
91
- this.isLoading = false;
92
- });
93
- }
94
- async componentWillLoad() {
95
- if (this.translationUrl.length > 2) {
96
- await getTranslations(this.translationUrl);
1
+ import { h } from "@stencil/core";
2
+ import { getTranslations, translate } from "../../utils/locale.utils";
3
+ import { getDevicePlatform } from "../../utils/utils";
4
+ export class GeneralPreviewSocialPosts {
5
+ constructor() {
6
+ this.platform = getDevicePlatform();
7
+ this.setClientStyling = () => {
8
+ let sheet = document.createElement('style');
9
+ sheet.innerHTML = this.clientStyling;
10
+ this.stylingContainer.prepend(sheet);
11
+ };
12
+ this.setClientStylingURL = () => {
13
+ let url = new URL(this.clientStylingUrl);
14
+ let cssFile = document.createElement('style');
15
+ fetch(url.href)
16
+ .then((res) => res.text())
17
+ .then((data) => {
18
+ cssFile.innerHTML = data;
19
+ setTimeout(() => { this.stylingContainer.prepend(cssFile); }, 1);
20
+ })
21
+ .catch((err) => {
22
+ console.log('error ', err);
23
+ });
24
+ };
25
+ this.userId = '';
26
+ this.session = '';
27
+ this.postsTitle = '';
28
+ this.maxCards = '';
29
+ this.language = 'en';
30
+ this.datasource = '';
31
+ this.endpoint = '';
32
+ this.cmsEndpoint = '';
33
+ this.userRoles = '';
34
+ this.translationUrl = '';
35
+ this.clientStyling = '';
36
+ this.clientStylingUrl = '';
37
+ this.cmsEnv = 'stage';
38
+ this.pageName = 'casino';
39
+ this.posts = [];
40
+ this.stylingAppends = false;
41
+ this.isLoading = false;
42
+ this.isLoggedIn = false;
43
+ this.dataImages = [];
44
+ this.gameIds = '';
97
45
  }
98
- }
99
- watchSession(newValue, oldValue) {
100
- if (newValue !== oldValue) {
101
- this.isLoggedIn = newValue !== '';
46
+ handleNewTranslations() {
47
+ this.isLoading = true;
48
+ getTranslations(this.translationUrl).then(() => {
49
+ this.isLoading = false;
50
+ });
102
51
  }
103
- }
104
- connectedCallback() {
105
- if (this.session) {
106
- this.isLoggedIn = true;
52
+ async componentWillLoad() {
53
+ if (this.translationUrl.length > 2) {
54
+ await getTranslations(this.translationUrl);
55
+ }
107
56
  }
108
- }
109
- componentDidRender() {
110
- // start custom styling area
111
- if (!this.stylingAppends && this.stylingContainer) {
112
- if (this.clientStyling)
113
- this.setClientStyling();
114
- if (this.clientStylingUrl)
115
- this.setClientStylingURL();
116
- this.stylingAppends = true;
57
+ watchSession(newValue, oldValue) {
58
+ if (newValue !== oldValue) {
59
+ this.isLoggedIn = newValue !== '';
60
+ }
117
61
  }
118
- // end custom styling area
119
- }
120
- getDataImage(ids) {
121
- try {
122
- let url = new URL(`${this.endpoint}/v2/casino/groups/${this.datasource}`);
123
- url.searchParams.append("language", this.language);
124
- url.searchParams.append("expand", 'games');
125
- url.searchParams.append("fields", 'games(id,thumbnail,launchUrl)');
126
- url.searchParams.append("filter", ids);
127
- url.searchParams.append('device', this.platform);
128
- const options = {
129
- 'method': 'GET',
130
- 'Content-Type': 'application/json'
131
- };
132
- fetch(url.href, options)
133
- .then((res) => {
134
- if (res.status === 200) {
135
- return res.json();
62
+ connectedCallback() {
63
+ if (this.session) {
64
+ this.isLoggedIn = true;
136
65
  }
137
- else {
138
- throw new Error("HTTP status " + res.status);
66
+ }
67
+ componentDidRender() {
68
+ // start custom styling area
69
+ if (!this.stylingAppends && this.stylingContainer) {
70
+ if (this.clientStyling)
71
+ this.setClientStyling();
72
+ if (this.clientStylingUrl)
73
+ this.setClientStylingURL();
74
+ this.stylingAppends = true;
139
75
  }
140
- })
141
- .then((data) => {
142
- data.items.forEach((item) => {
143
- item.games.items.forEach(element => {
144
- let { id, launchUrl, thumbnail } = element;
145
- this.dataImages = [{ id, launchUrl, thumbnail }];
146
- let index = this.posts.findIndex(post => post.gameId === id);
147
- if (index !== -1) {
148
- this.posts[index].images = this.dataImages;
149
- }
150
- });
151
- });
152
- })
153
- .catch((err) => {
154
- // Handle any errors
155
- console.error(err);
156
- });
76
+ // end custom styling area
157
77
  }
158
- catch (error) {
159
- console.error('Error fetching verification types:', error);
78
+ getDataImage(ids) {
79
+ try {
80
+ let url = new URL(`${this.endpoint}/v2/casino/groups/${this.datasource}`);
81
+ url.searchParams.append("language", this.language);
82
+ url.searchParams.append("expand", 'games');
83
+ url.searchParams.append("fields", 'games(id,thumbnail,launchUrl)');
84
+ url.searchParams.append("filter", ids);
85
+ url.searchParams.append('device', this.platform);
86
+ const options = {
87
+ 'method': 'GET',
88
+ 'Content-Type': 'application/json'
89
+ };
90
+ fetch(url.href, options)
91
+ .then((res) => {
92
+ if (res.status === 200) {
93
+ return res.json();
94
+ }
95
+ else {
96
+ throw new Error("HTTP status " + res.status);
97
+ }
98
+ })
99
+ .then((data) => {
100
+ data.items.forEach((item) => {
101
+ item.games.items.forEach(element => {
102
+ let { id, launchUrl, thumbnail } = element;
103
+ this.dataImages = [{ id, launchUrl, thumbnail }];
104
+ let index = this.posts.findIndex(post => post.gameId === id);
105
+ if (index !== -1) {
106
+ this.posts[index].images = this.dataImages;
107
+ }
108
+ });
109
+ });
110
+ })
111
+ .catch((err) => {
112
+ // Handle any errors
113
+ console.error(err);
114
+ });
115
+ }
116
+ catch (error) {
117
+ console.error('Error fetching verification types:', error);
118
+ }
160
119
  }
161
- }
162
- async componentDidLoad() {
163
- try {
164
- let url = new URL(`${this.cmsEndpoint}/${this.language}/content/social-posts`);
165
- url.searchParams.append("device", this.platform);
166
- url.searchParams.append("page", this.pageName);
167
- url.searchParams.append("language", this.language);
168
- url.searchParams.append("userRoles", this.userRoles);
169
- url.searchParams.append('env', this.cmsEnv);
170
- const options = {
171
- 'method': 'GET',
172
- 'Content-Type': 'application/json'
173
- };
174
- fetch(url.href, options)
175
- .then((res) => {
176
- if (res.status === 200) {
177
- return res.json();
120
+ async componentDidLoad() {
121
+ try {
122
+ let url = new URL(`${this.cmsEndpoint}/${this.language}/content/social-posts`);
123
+ url.searchParams.append("device", this.platform);
124
+ url.searchParams.append("page", this.pageName);
125
+ url.searchParams.append("language", this.language);
126
+ url.searchParams.append("userRoles", this.userRoles);
127
+ url.searchParams.append('env', this.cmsEnv);
128
+ const options = {
129
+ 'method': 'GET',
130
+ 'Content-Type': 'application/json'
131
+ };
132
+ fetch(url.href, options)
133
+ .then((res) => {
134
+ if (res.status === 200) {
135
+ return res.json();
136
+ }
137
+ else {
138
+ throw new Error("HTTP status " + res.status);
139
+ }
140
+ })
141
+ .then((data) => {
142
+ data.forEach(element => {
143
+ var _a;
144
+ const slug = element.slug;
145
+ const postId = element.id;
146
+ const { gameId, title, description, subtitle } = (_a = element.previewCard) !== null && _a !== void 0 ? _a : {};
147
+ if (gameId) {
148
+ this.gameIds += `games(id=${gameId}),`;
149
+ }
150
+ this.posts.push({ postId, gameId, title, description, subtitle, slug });
151
+ });
152
+ if (this.gameIds.length > 0) {
153
+ this.gameIds = this.gameIds.slice(0, -1); // Removes the last comma
154
+ this.gameIds = '$or(' + this.gameIds + ')';
155
+ }
156
+ this.getDataImage(this.gameIds);
157
+ })
158
+ .catch((err) => {
159
+ // Handle any errors
160
+ console.error(err);
161
+ });
178
162
  }
179
- else {
180
- throw new Error("HTTP status " + res.status);
163
+ catch (error) {
164
+ console.error('Error fetching verification types:', error);
181
165
  }
182
- })
183
- .then((data) => {
184
- data.forEach(element => {
185
- var _a;
186
- const slug = element.slug;
187
- const postId = element.id;
188
- const { gameId, title, description, subtitle } = (_a = element.previewCard) !== null && _a !== void 0 ? _a : {};
189
- if (gameId) {
190
- this.gameIds += `games(id=${gameId}),`;
191
- }
192
- this.posts.push({ postId, gameId, title, description, subtitle, slug });
193
- });
194
- if (this.gameIds.length > 0) {
195
- this.gameIds = this.gameIds.slice(0, -1); // Removes the last comma
196
- this.gameIds = '$or(' + this.gameIds + ')';
166
+ }
167
+ hasUndefinedValues(obj) {
168
+ return Object.values(obj).some((value) => value === undefined);
169
+ }
170
+ render() {
171
+ if (this.isLoading) {
172
+ return (h("div", null, h("p", null, translate('loading', this.language))));
197
173
  }
198
- this.getDataImage(this.gameIds);
199
- })
200
- .catch((err) => {
201
- // Handle any errors
202
- console.error(err);
203
- });
174
+ else {
175
+ return (h("div", { class: "ModalContainer", ref: el => this.stylingContainer = el }, h("div", { class: "sliderWidget" }, h("div", { class: "headerHontainer" }, this.postsTitle && h("h2", null, this.postsTitle), h("div", { class: "viewAllButton", onClick: () => this.onViewAllClick() }, translate('viewAll', this.language))), h("div", { class: "postSlider" }, this.posts
176
+ .filter((post) => !this.hasUndefinedValues(post)) // Filter out posts with undefined values
177
+ .slice(0, +(this.maxCards || this.posts.length))
178
+ .map((post) => {
179
+ var _a, _b, _c, _d;
180
+ return (h("div", { class: "postCard" }, h("div", { class: "imageTitle" }, (post === null || post === void 0 ? void 0 : post.images) ? (h("a", { href: ((_b = (_a = post.images) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.launchUrl) || '', target: "_blank", rel: "noopener noreferrer" }, h("img", { src: ((_d = (_c = post.images) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.thumbnail) || '', alt: "Game Image" })))
181
+ : null, h("div", { class: "titleSubtitle" }, post.title && h("h3", null, post.title), post.subtitle && h("p", { innerHTML: post.subtitle }))), post.description &&
182
+ h("div", { class: "Description" }, h("p", { innerHTML: post.description })), h("div", { class: "buttons" }, h("button", { class: "moreInfoButton", onClick: () => this.onMoreInfoClick(post.gameId, post.postId, post.title, post.slug) }, translate('moreInfo', this.language)), this.isLoggedIn && post.gameId && h("button", { class: "playNowButton", onClick: () => this.onPlayNowClick(post.gameId) }, translate('playNow', this.language)))));
183
+ })))));
184
+ }
185
+ }
186
+ onViewAllClick() {
187
+ this.viewAll.emit();
188
+ window.postMessage({ type: 'viewAllSocialPosts' }, window.location.href);
204
189
  }
205
- catch (error) {
206
- console.error('Error fetching verification types:', error);
190
+ onMoreInfoClick(gameId, postId, postTitle, slug) {
191
+ this.moreInfo.emit();
192
+ window.postMessage({ type: 'moreInfoSocialPost', gameId, postId, postTitle, slug }, window.location.href);
193
+ }
194
+ onPlayNowClick(gameId) {
195
+ this.playNow.emit(gameId);
196
+ window.postMessage({ type: 'playNowSocialPost', gameId: gameId }, window.location.href);
197
+ }
198
+ static get is() { return "general-preview-social-posts"; }
199
+ static get encapsulation() { return "shadow"; }
200
+ static get originalStyleUrls() {
201
+ return {
202
+ "$": ["general-preview-social-posts.scss"]
203
+ };
204
+ }
205
+ static get styleUrls() {
206
+ return {
207
+ "$": ["general-preview-social-posts.css"]
208
+ };
209
+ }
210
+ static get properties() {
211
+ return {
212
+ "userId": {
213
+ "type": "string",
214
+ "mutable": false,
215
+ "complexType": {
216
+ "original": "string",
217
+ "resolved": "string",
218
+ "references": {}
219
+ },
220
+ "required": false,
221
+ "optional": false,
222
+ "docs": {
223
+ "tags": [],
224
+ "text": "The userId"
225
+ },
226
+ "attribute": "user-id",
227
+ "reflect": true,
228
+ "defaultValue": "''"
229
+ },
230
+ "session": {
231
+ "type": "string",
232
+ "mutable": false,
233
+ "complexType": {
234
+ "original": "string",
235
+ "resolved": "string",
236
+ "references": {}
237
+ },
238
+ "required": false,
239
+ "optional": false,
240
+ "docs": {
241
+ "tags": [],
242
+ "text": "The session"
243
+ },
244
+ "attribute": "session",
245
+ "reflect": true,
246
+ "defaultValue": "''"
247
+ },
248
+ "postsTitle": {
249
+ "type": "string",
250
+ "mutable": false,
251
+ "complexType": {
252
+ "original": "string",
253
+ "resolved": "string",
254
+ "references": {}
255
+ },
256
+ "required": false,
257
+ "optional": false,
258
+ "docs": {
259
+ "tags": [],
260
+ "text": "The Posts Title"
261
+ },
262
+ "attribute": "posts-title",
263
+ "reflect": true,
264
+ "defaultValue": "''"
265
+ },
266
+ "maxCards": {
267
+ "type": "string",
268
+ "mutable": false,
269
+ "complexType": {
270
+ "original": "string",
271
+ "resolved": "string",
272
+ "references": {}
273
+ },
274
+ "required": false,
275
+ "optional": false,
276
+ "docs": {
277
+ "tags": [],
278
+ "text": "The max cards displayed"
279
+ },
280
+ "attribute": "max-cards",
281
+ "reflect": true,
282
+ "defaultValue": "''"
283
+ },
284
+ "language": {
285
+ "type": "string",
286
+ "mutable": false,
287
+ "complexType": {
288
+ "original": "string",
289
+ "resolved": "string",
290
+ "references": {}
291
+ },
292
+ "required": false,
293
+ "optional": false,
294
+ "docs": {
295
+ "tags": [],
296
+ "text": "The language"
297
+ },
298
+ "attribute": "language",
299
+ "reflect": true,
300
+ "defaultValue": "'en'"
301
+ },
302
+ "datasource": {
303
+ "type": "string",
304
+ "mutable": false,
305
+ "complexType": {
306
+ "original": "string",
307
+ "resolved": "string",
308
+ "references": {}
309
+ },
310
+ "required": false,
311
+ "optional": false,
312
+ "docs": {
313
+ "tags": [],
314
+ "text": "The datasource"
315
+ },
316
+ "attribute": "datasource",
317
+ "reflect": true,
318
+ "defaultValue": "''"
319
+ },
320
+ "endpoint": {
321
+ "type": "string",
322
+ "mutable": false,
323
+ "complexType": {
324
+ "original": "string",
325
+ "resolved": "string",
326
+ "references": {}
327
+ },
328
+ "required": false,
329
+ "optional": false,
330
+ "docs": {
331
+ "tags": [],
332
+ "text": "The NorWAy endpoint"
333
+ },
334
+ "attribute": "endpoint",
335
+ "reflect": true,
336
+ "defaultValue": "''"
337
+ },
338
+ "cmsEndpoint": {
339
+ "type": "string",
340
+ "mutable": false,
341
+ "complexType": {
342
+ "original": "string",
343
+ "resolved": "string",
344
+ "references": {}
345
+ },
346
+ "required": false,
347
+ "optional": false,
348
+ "docs": {
349
+ "tags": [],
350
+ "text": "The NorWAy endpoint"
351
+ },
352
+ "attribute": "cms-endpoint",
353
+ "reflect": true,
354
+ "defaultValue": "''"
355
+ },
356
+ "userRoles": {
357
+ "type": "string",
358
+ "mutable": false,
359
+ "complexType": {
360
+ "original": "string",
361
+ "resolved": "string",
362
+ "references": {}
363
+ },
364
+ "required": false,
365
+ "optional": false,
366
+ "docs": {
367
+ "tags": [],
368
+ "text": "The userRoles"
369
+ },
370
+ "attribute": "user-roles",
371
+ "reflect": true,
372
+ "defaultValue": "''"
373
+ },
374
+ "translationUrl": {
375
+ "type": "string",
376
+ "mutable": false,
377
+ "complexType": {
378
+ "original": "string",
379
+ "resolved": "string",
380
+ "references": {}
381
+ },
382
+ "required": false,
383
+ "optional": false,
384
+ "docs": {
385
+ "tags": [],
386
+ "text": "The translationurl"
387
+ },
388
+ "attribute": "translation-url",
389
+ "reflect": true,
390
+ "defaultValue": "''"
391
+ },
392
+ "clientStyling": {
393
+ "type": "string",
394
+ "mutable": false,
395
+ "complexType": {
396
+ "original": "string",
397
+ "resolved": "string",
398
+ "references": {}
399
+ },
400
+ "required": false,
401
+ "optional": false,
402
+ "docs": {
403
+ "tags": [],
404
+ "text": "Client custom styling via string"
405
+ },
406
+ "attribute": "client-styling",
407
+ "reflect": true,
408
+ "defaultValue": "''"
409
+ },
410
+ "clientStylingUrl": {
411
+ "type": "string",
412
+ "mutable": false,
413
+ "complexType": {
414
+ "original": "string",
415
+ "resolved": "string",
416
+ "references": {}
417
+ },
418
+ "required": false,
419
+ "optional": false,
420
+ "docs": {
421
+ "tags": [],
422
+ "text": "Client custom styling via url content"
423
+ },
424
+ "attribute": "client-styling-url",
425
+ "reflect": true,
426
+ "defaultValue": "''"
427
+ },
428
+ "cmsEnv": {
429
+ "type": "string",
430
+ "mutable": false,
431
+ "complexType": {
432
+ "original": "string",
433
+ "resolved": "string",
434
+ "references": {}
435
+ },
436
+ "required": false,
437
+ "optional": false,
438
+ "docs": {
439
+ "tags": [],
440
+ "text": "CMS Endpoint stage"
441
+ },
442
+ "attribute": "cms-env",
443
+ "reflect": true,
444
+ "defaultValue": "'stage'"
445
+ },
446
+ "pageName": {
447
+ "type": "string",
448
+ "mutable": false,
449
+ "complexType": {
450
+ "original": "string",
451
+ "resolved": "string",
452
+ "references": {}
453
+ },
454
+ "required": false,
455
+ "optional": false,
456
+ "docs": {
457
+ "tags": [],
458
+ "text": "The page parameter for the cms call"
459
+ },
460
+ "attribute": "page-name",
461
+ "reflect": true,
462
+ "defaultValue": "'casino'"
463
+ }
464
+ };
207
465
  }
208
- }
209
- hasUndefinedValues(obj) {
210
- return Object.values(obj).some((value) => value === undefined);
211
- }
212
- render() {
213
- if (this.isLoading) {
214
- return (h("div", null,
215
- h("p", null, translate('loading', this.language))));
466
+ static get states() {
467
+ return {
468
+ "posts": {},
469
+ "stylingAppends": {},
470
+ "isLoading": {},
471
+ "isLoggedIn": {},
472
+ "dataImages": {},
473
+ "gameIds": {}
474
+ };
216
475
  }
217
- else {
218
- return (h("div", { class: "ModalContainer", ref: el => this.stylingContainer = el },
219
- h("div", { class: "sliderWidget" },
220
- h("div", { class: "headerHontainer" },
221
- this.postsTitle && h("h2", null, this.postsTitle),
222
- h("div", { class: "viewAllButton", onClick: () => this.onViewAllClick() }, translate('viewAll', this.language))),
223
- h("div", { class: "postSlider" }, this.posts
224
- .filter((post) => !this.hasUndefinedValues(post)) // Filter out posts with undefined values
225
- .slice(0, +(this.maxCards || this.posts.length))
226
- .map((post) => {
227
- var _a, _b, _c, _d;
228
- return (h("div", { class: "postCard" },
229
- h("div", { class: "imageTitle" },
230
- (post === null || post === void 0 ? void 0 : post.images) ? (h("a", { href: ((_b = (_a = post.images) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.launchUrl) || '', target: "_blank", rel: "noopener noreferrer" },
231
- h("img", { src: ((_d = (_c = post.images) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.thumbnail) || '', alt: "Game Image" })))
232
- : null,
233
- h("div", { class: "titleSubtitle" },
234
- post.title && h("h3", null, post.title),
235
- post.subtitle && h("p", { innerHTML: post.subtitle }))),
236
- post.description &&
237
- h("div", { class: "Description" },
238
- h("p", { innerHTML: post.description })),
239
- h("div", { class: "buttons" },
240
- h("button", { class: "moreInfoButton", onClick: () => this.onMoreInfoClick(post.gameId, post.postId, post.title, post.slug) }, translate('moreInfo', this.language)),
241
- this.isLoggedIn && post.gameId && h("button", { class: "playNowButton", onClick: () => this.onPlayNowClick(post.gameId) }, translate('playNow', this.language)))));
242
- })))));
476
+ static get events() {
477
+ return [{
478
+ "method": "moreInfo",
479
+ "name": "moreInfo",
480
+ "bubbles": true,
481
+ "cancelable": true,
482
+ "composed": true,
483
+ "docs": {
484
+ "tags": [],
485
+ "text": ""
486
+ },
487
+ "complexType": {
488
+ "original": "any",
489
+ "resolved": "any",
490
+ "references": {}
491
+ }
492
+ }, {
493
+ "method": "playNow",
494
+ "name": "playNow",
495
+ "bubbles": true,
496
+ "cancelable": true,
497
+ "composed": true,
498
+ "docs": {
499
+ "tags": [],
500
+ "text": ""
501
+ },
502
+ "complexType": {
503
+ "original": "any",
504
+ "resolved": "any",
505
+ "references": {}
506
+ }
507
+ }, {
508
+ "method": "viewAll",
509
+ "name": "viewAll",
510
+ "bubbles": true,
511
+ "cancelable": true,
512
+ "composed": true,
513
+ "docs": {
514
+ "tags": [],
515
+ "text": ""
516
+ },
517
+ "complexType": {
518
+ "original": "any",
519
+ "resolved": "any",
520
+ "references": {}
521
+ }
522
+ }];
243
523
  }
244
- }
245
- onViewAllClick() {
246
- this.viewAll.emit();
247
- window.postMessage({ type: 'viewAllSocialPosts' }, window.location.href);
248
- }
249
- onMoreInfoClick(gameId, postId, postTitle, slug) {
250
- this.moreInfo.emit();
251
- window.postMessage({ type: 'moreInfoSocialPost', gameId, postId, postTitle, slug }, window.location.href);
252
- }
253
- onPlayNowClick(gameId) {
254
- this.playNow.emit(gameId);
255
- window.postMessage({ type: 'playNowSocialPost', gameId: gameId }, window.location.href);
256
- }
257
- static get is() { return "general-preview-social-posts"; }
258
- static get encapsulation() { return "shadow"; }
259
- static get originalStyleUrls() { return {
260
- "$": ["general-preview-social-posts.scss"]
261
- }; }
262
- static get styleUrls() { return {
263
- "$": ["general-preview-social-posts.css"]
264
- }; }
265
- static get properties() { return {
266
- "userId": {
267
- "type": "string",
268
- "mutable": false,
269
- "complexType": {
270
- "original": "string",
271
- "resolved": "string",
272
- "references": {}
273
- },
274
- "required": false,
275
- "optional": false,
276
- "docs": {
277
- "tags": [],
278
- "text": "The userId"
279
- },
280
- "attribute": "user-id",
281
- "reflect": true,
282
- "defaultValue": "''"
283
- },
284
- "session": {
285
- "type": "string",
286
- "mutable": false,
287
- "complexType": {
288
- "original": "string",
289
- "resolved": "string",
290
- "references": {}
291
- },
292
- "required": false,
293
- "optional": false,
294
- "docs": {
295
- "tags": [],
296
- "text": "The session"
297
- },
298
- "attribute": "session",
299
- "reflect": true,
300
- "defaultValue": "''"
301
- },
302
- "postsTitle": {
303
- "type": "string",
304
- "mutable": false,
305
- "complexType": {
306
- "original": "string",
307
- "resolved": "string",
308
- "references": {}
309
- },
310
- "required": false,
311
- "optional": false,
312
- "docs": {
313
- "tags": [],
314
- "text": "The Posts Title"
315
- },
316
- "attribute": "posts-title",
317
- "reflect": true,
318
- "defaultValue": "''"
319
- },
320
- "maxCards": {
321
- "type": "string",
322
- "mutable": false,
323
- "complexType": {
324
- "original": "string",
325
- "resolved": "string",
326
- "references": {}
327
- },
328
- "required": false,
329
- "optional": false,
330
- "docs": {
331
- "tags": [],
332
- "text": "The max cards displayed"
333
- },
334
- "attribute": "max-cards",
335
- "reflect": true,
336
- "defaultValue": "''"
337
- },
338
- "language": {
339
- "type": "string",
340
- "mutable": false,
341
- "complexType": {
342
- "original": "string",
343
- "resolved": "string",
344
- "references": {}
345
- },
346
- "required": false,
347
- "optional": false,
348
- "docs": {
349
- "tags": [],
350
- "text": "The language"
351
- },
352
- "attribute": "language",
353
- "reflect": true,
354
- "defaultValue": "'en'"
355
- },
356
- "datasource": {
357
- "type": "string",
358
- "mutable": false,
359
- "complexType": {
360
- "original": "string",
361
- "resolved": "string",
362
- "references": {}
363
- },
364
- "required": false,
365
- "optional": false,
366
- "docs": {
367
- "tags": [],
368
- "text": "The datasource"
369
- },
370
- "attribute": "datasource",
371
- "reflect": true,
372
- "defaultValue": "''"
373
- },
374
- "endpoint": {
375
- "type": "string",
376
- "mutable": false,
377
- "complexType": {
378
- "original": "string",
379
- "resolved": "string",
380
- "references": {}
381
- },
382
- "required": false,
383
- "optional": false,
384
- "docs": {
385
- "tags": [],
386
- "text": "The NorWAy endpoint"
387
- },
388
- "attribute": "endpoint",
389
- "reflect": true,
390
- "defaultValue": "''"
391
- },
392
- "cmsEndpoint": {
393
- "type": "string",
394
- "mutable": false,
395
- "complexType": {
396
- "original": "string",
397
- "resolved": "string",
398
- "references": {}
399
- },
400
- "required": false,
401
- "optional": false,
402
- "docs": {
403
- "tags": [],
404
- "text": "The NorWAy endpoint"
405
- },
406
- "attribute": "cms-endpoint",
407
- "reflect": true,
408
- "defaultValue": "''"
409
- },
410
- "userRoles": {
411
- "type": "string",
412
- "mutable": false,
413
- "complexType": {
414
- "original": "string",
415
- "resolved": "string",
416
- "references": {}
417
- },
418
- "required": false,
419
- "optional": false,
420
- "docs": {
421
- "tags": [],
422
- "text": "The userRoles"
423
- },
424
- "attribute": "user-roles",
425
- "reflect": true,
426
- "defaultValue": "''"
427
- },
428
- "translationUrl": {
429
- "type": "string",
430
- "mutable": false,
431
- "complexType": {
432
- "original": "string",
433
- "resolved": "string",
434
- "references": {}
435
- },
436
- "required": false,
437
- "optional": false,
438
- "docs": {
439
- "tags": [],
440
- "text": "The translationurl"
441
- },
442
- "attribute": "translation-url",
443
- "reflect": true,
444
- "defaultValue": "''"
445
- },
446
- "clientStyling": {
447
- "type": "string",
448
- "mutable": false,
449
- "complexType": {
450
- "original": "string",
451
- "resolved": "string",
452
- "references": {}
453
- },
454
- "required": false,
455
- "optional": false,
456
- "docs": {
457
- "tags": [],
458
- "text": "Client custom styling via string"
459
- },
460
- "attribute": "client-styling",
461
- "reflect": true,
462
- "defaultValue": "''"
463
- },
464
- "clientStylingUrl": {
465
- "type": "string",
466
- "mutable": false,
467
- "complexType": {
468
- "original": "string",
469
- "resolved": "string",
470
- "references": {}
471
- },
472
- "required": false,
473
- "optional": false,
474
- "docs": {
475
- "tags": [],
476
- "text": "Client custom styling via url content"
477
- },
478
- "attribute": "client-styling-url",
479
- "reflect": true,
480
- "defaultValue": "''"
481
- },
482
- "cmsEnv": {
483
- "type": "string",
484
- "mutable": false,
485
- "complexType": {
486
- "original": "string",
487
- "resolved": "string",
488
- "references": {}
489
- },
490
- "required": false,
491
- "optional": false,
492
- "docs": {
493
- "tags": [],
494
- "text": "CMS Endpoint stage"
495
- },
496
- "attribute": "cms-env",
497
- "reflect": true,
498
- "defaultValue": "'stage'"
499
- },
500
- "pageName": {
501
- "type": "string",
502
- "mutable": false,
503
- "complexType": {
504
- "original": "string",
505
- "resolved": "string",
506
- "references": {}
507
- },
508
- "required": false,
509
- "optional": false,
510
- "docs": {
511
- "tags": [],
512
- "text": "The page parameter for the cms call"
513
- },
514
- "attribute": "page-name",
515
- "reflect": true,
516
- "defaultValue": "'casino'"
524
+ static get watchers() {
525
+ return [{
526
+ "propName": "translationUrl",
527
+ "methodName": "handleNewTranslations"
528
+ }, {
529
+ "propName": "session",
530
+ "methodName": "watchSession"
531
+ }];
517
532
  }
518
- }; }
519
- static get states() { return {
520
- "posts": {},
521
- "stylingAppends": {},
522
- "isLoading": {},
523
- "isLoggedIn": {},
524
- "dataImages": {},
525
- "gameIds": {}
526
- }; }
527
- static get events() { return [{
528
- "method": "moreInfo",
529
- "name": "moreInfo",
530
- "bubbles": true,
531
- "cancelable": true,
532
- "composed": true,
533
- "docs": {
534
- "tags": [],
535
- "text": ""
536
- },
537
- "complexType": {
538
- "original": "any",
539
- "resolved": "any",
540
- "references": {}
541
- }
542
- }, {
543
- "method": "playNow",
544
- "name": "playNow",
545
- "bubbles": true,
546
- "cancelable": true,
547
- "composed": true,
548
- "docs": {
549
- "tags": [],
550
- "text": ""
551
- },
552
- "complexType": {
553
- "original": "any",
554
- "resolved": "any",
555
- "references": {}
556
- }
557
- }, {
558
- "method": "viewAll",
559
- "name": "viewAll",
560
- "bubbles": true,
561
- "cancelable": true,
562
- "composed": true,
563
- "docs": {
564
- "tags": [],
565
- "text": ""
566
- },
567
- "complexType": {
568
- "original": "any",
569
- "resolved": "any",
570
- "references": {}
571
- }
572
- }]; }
573
- static get watchers() { return [{
574
- "propName": "translationUrl",
575
- "methodName": "handleNewTranslations"
576
- }, {
577
- "propName": "session",
578
- "methodName": "watchSession"
579
- }]; }
580
533
  }