@everymatrix/casino-challenges-container 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/dist/casino-challenges-container/casino-challenge-card_4.entry.js +1 -0
  2. package/dist/casino-challenges-container/casino-challenges-container-b776a245.js +1 -0
  3. package/dist/casino-challenges-container/casino-challenges-container.esm.js +1 -1
  4. package/dist/casino-challenges-container/index-c7b24115.js +2 -0
  5. package/dist/casino-challenges-container/index.esm.js +1 -1
  6. package/dist/cjs/casino-challenge-card_4.cjs.entry.js +570 -0
  7. package/dist/cjs/{casino-challenges-container-54a20dee.js → casino-challenges-container-aa20cd29.js} +70 -5
  8. package/dist/cjs/casino-challenges-container.cjs.js +2 -2
  9. package/dist/cjs/{index-cf89b5da.js → index-2631ee03.js} +39 -5
  10. package/dist/cjs/index.cjs.js +2 -2
  11. package/dist/cjs/loader.cjs.js +2 -2
  12. package/dist/collection/collection-manifest.json +20 -1
  13. package/dist/collection/components/casino-challenges-container/casino-challenges-container.css +15 -2
  14. package/dist/collection/components/casino-challenges-container/casino-challenges-container.js +144 -3
  15. package/dist/collection/utils/locale.utils.js +2 -1
  16. package/dist/collection/utils/types.js +40 -0
  17. package/dist/esm/casino-challenge-card_4.entry.js +564 -0
  18. package/dist/esm/{casino-challenges-container-affc90f5.js → casino-challenges-container-b776a245.js} +68 -6
  19. package/dist/esm/casino-challenges-container.js +3 -3
  20. package/dist/esm/{index-9c823353.js → index-c7b24115.js} +37 -6
  21. package/dist/esm/index.js +2 -2
  22. package/dist/esm/loader.js +3 -3
  23. package/dist/types/components/casino-challenges-container/casino-challenges-container.d.ts +30 -0
  24. package/dist/types/components.d.ts +32 -0
  25. package/dist/types/utils/types.d.ts +130 -0
  26. package/package.json +1 -1
  27. package/dist/casino-challenges-container/casino-challenges-container-affc90f5.js +0 -1
  28. package/dist/casino-challenges-container/casino-challenges-container.entry.js +0 -1
  29. package/dist/casino-challenges-container/index-9c823353.js +0 -2
  30. package/dist/cjs/casino-challenges-container.cjs.entry.js +0 -10
  31. package/dist/esm/casino-challenges-container.entry.js +0 -2
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, h } from './index-9c823353.js';
1
+ import { r as registerInstance, h } from './index-c7b24115.js';
2
2
 
3
3
  /**
4
4
  * @name setClientStyling
@@ -60,7 +60,8 @@ function setStreamStyling(stylingContainer, domain, subscription) {
60
60
  const DEFAULT_LANGUAGE = 'en';
61
61
  const TRANSLATIONS = {
62
62
  en: {
63
- title: 'Challenges'
63
+ title: 'Challenges',
64
+ empty: 'No Challenges'
64
65
  },
65
66
  ro: {},
66
67
  fr: {},
@@ -98,24 +99,53 @@ const titleIconSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53
98
99
 
99
100
  const notificationSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNCAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwXzgzOF8zMTApIj4KPHBhdGggZD0iTTcuNTAwNDYgMTIuOTk5OUM4LjQwNTk1IDEyLjk5OTkgOS4xNjM0MSAxMi4zNTQ0IDkuMzM3MzUgMTEuNUg1LjY2MzU3QzUuODM3NiAxMi4zNTQ0IDYuNTk1MDYgMTIuOTk5OSA3LjUwMDQ2IDEyLjk5OTlaIiBmaWxsPSJ1cmwoI3BhaW50MF9saW5lYXJfODM4XzMxMCkiLz4KPHBhdGggZD0iTTExLjAwNTggNi45OTkxN0MxMS4wMDM3IDYuOTk5MTcgMTEuMDAxNyA2Ljk5OTYzIDEwLjk5OTcgNi45OTk2M0M5LjA3MDM2IDYuOTk5NjMgNy40OTk5NyA1LjQyOTcgNy40OTk5NyAzLjQ5OTlDNy40OTk5NyAyLjk2OTM5IDcuNjIyIDIuNDY3ODkgNy44MzQ0OCAyLjAxNjk0QzcuNzI0NDQgMi4wMDY1IDcuNjEyOTMgMiA3LjQ5OTk3IDJDNS41NjcxMyAyIDQuMDAwMjIgMy41NjY4MiA0LjAwMDIyIDUuNDk5NzNWNi44OTM2MkM0LjAwMDIyIDcuODgzMDUgMy41NjY3NCA4LjgxNzAxIDIuODA2MjYgOS40NTk5NEMyLjU1Mjc3IDkuNjc2NDUgMi40NDAyNiAxMC4wMjE0IDIuNTMxMjUgMTAuMzU3OUMyLjYzNzI3IDEwLjc0OTQgMy4wMjQyMyAxMC45OTk0IDMuNDMwMjUgMTAuOTk5NEgxMS41NjcyQzExLjk5MzIgMTAuOTk5NCAxMi4zOTQ3IDEwLjcyMzQgMTIuNDgxMSAxMC4zMDU5QzEyLjU0ODEgOS45ODI5NCAxMi40MzMyIDkuNjYwNDMgMTIuMTgyNyA5LjQ0OTk2QzExLjQ1NTcgOC44NDA1NCAxMS4wMzUyIDcuOTQ1MDMgMTEuMDA1OCA2Ljk5OTE3WiIgZmlsbD0idXJsKCNwYWludDFfbGluZWFyXzgzOF8zMTApIi8+CjxwYXRoIGQ9Ik0xMy41MDA2IDMuNDk5ODZDMTMuNTAwNiA0Ljg4MDQ3IDEyLjM4MTUgNS45OTk2MyAxMS4wMDA4IDUuOTk5NjNDOS42MjAxNCA1Ljk5OTYzIDguNTAwOTggNC44ODA0NyA4LjUwMDk4IDMuNDk5ODZDOC41MDA5OCAyLjExOTI1IDkuNjIwMTQgMSAxMS4wMDA4IDFDMTIuMzgxNSAxIDEzLjUwMDYgMi4xMTkyNSAxMy41MDA2IDMuNDk5ODZaIiBmaWxsPSIjRDY0MjFFIi8+CjwvZz4KPGRlZnM+CjxsaW5lYXJHcmFkaWVudCBpZD0icGFpbnQwX2xpbmVhcl84MzhfMzEwIiB4MT0iNy41MDA0NiIgeTE9IjExLjUiIHgyPSI3LjUwMDQ2IiB5Mj0iMTIuOTk5OSIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPgo8c3RvcCBzdG9wLWNvbG9yPSIjRUE5MDE4Ii8+CjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iI0UwQTg0RSIvPgo8L2xpbmVhckdyYWRpZW50Pgo8bGluZWFyR3JhZGllbnQgaWQ9InBhaW50MV9saW5lYXJfODM4XzMxMCIgeDE9IjcuNDk5OTciIHkxPSIyIiB4Mj0iNy40OTk5NyIgeTI9IjEwLjk5OTQiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj4KPHN0b3Agc3RvcC1jb2xvcj0iI0VBOTAxOCIvPgo8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiNFMEE4NEUiLz4KPC9saW5lYXJHcmFkaWVudD4KPGNsaXBQYXRoIGlkPSJjbGlwMF84MzhfMzEwIj4KPHJlY3Qgd2lkdGg9IjEzIiBoZWlnaHQ9IjE2IiBmaWxsPSJ3aGl0ZSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMC41KSIvPgo8L2NsaXBQYXRoPgo8L2RlZnM+Cjwvc3ZnPgo=';
100
101
 
101
- const casinoChallengesContainerCss = ".challenges {\n container-type: inline-size;\n container-name: challenges-container;\n}\n.challenges__header {\n margin: 0 0 32px;\n display: flex;\n justify-content: space-between;\n}\n.challenges__title {\n margin: 0;\n display: flex;\n gap: 10px;\n align-items: center;\n font-size: var(--emw--font-size-x-large, 24px);\n font-weight: var(--emw--font-weight-bold, 700);\n}\n.challenges__tabs {\n display: flex;\n gap: 12px;\n border-radius: 48px;\n padding: 6px;\n color: var(--emw--color-gray-150, #C8D6CE);\n background-color: var(--emw--color-background-secondary, #272727);\n}\n.challenges__tab {\n padding: 10px 16px;\n border-radius: 40px;\n font-size: var(--emw--font-size-small, 14px);\n font-weight: var(--emw--font-weight-bold, 700);\n cursor: pointer;\n text-align: center;\n width: 95px;\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 4px;\n}\n.challenges__tab.active {\n color: var(--emw--color-white, #FFFFFF);\n background: linear-gradient(90deg, rgb(0, 62, 92) 0%, rgb(17, 59, 33) 100%);\n}\n.challenges__tab:last-child {\n width: inherit;\n padding: 10px 16px;\n}\n@container challenges-container (max-width: 800px) {\n .challenges__header {\n margin: 0 0 16px;\n flex-wrap: wrap;\n row-gap: 12px;\n }\n .challenges__title {\n width: 100%;\n font-size: var(--emw--font-size-large, 20px);\n }\n .challenges__title img {\n height: 32px;\n }\n .challenges__tabs {\n width: 100%;\n gap: 8px;\n }\n .challenges__tab {\n flex: 1;\n padding: 5px 0;\n font-size: var(--emw--font-size-x-small, 12px);\n }\n .challenges__tab:last-child {\n width: inherit;\n padding: 5px 0;\n }\n}";
102
+ const casinoChallengesContainerCss = ".challenges {\n container-type: inline-size;\n container-name: challenges-container;\n background-color: var(--emw--color-background, #000);\n padding: 16px 12px;\n}\n.challenges__header {\n margin: 0 0 32px;\n display: flex;\n justify-content: space-between;\n}\n.challenges__title {\n margin: 0;\n display: flex;\n gap: 10px;\n align-items: center;\n font-size: var(--emw--font-size-x-large, 24px);\n font-weight: var(--emw--font-weight-bold, 700);\n color: var(--emw--color-white, #ffffff);\n}\n.challenges__tabs {\n display: flex;\n gap: 12px;\n border-radius: 48px;\n padding: 6px;\n color: var(--emw--color-gray-150, #c8d6ce);\n background-color: var(--emw--color-background-secondary, #272727);\n}\n.challenges__tab {\n padding: 10px 16px;\n border-radius: 40px;\n font-size: var(--emw--font-size-small, 14px);\n font-weight: var(--emw--font-weight-bold, 700);\n cursor: pointer;\n text-align: center;\n width: 95px;\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 4px;\n}\n.challenges__tab.active {\n color: var(--emw--color-white, #ffffff);\n background: linear-gradient(90deg, rgb(0, 62, 92) 0%, rgb(17, 59, 33) 100%);\n}\n.challenges__tab:last-child {\n width: inherit;\n padding: 10px 16px;\n}\n.challenges__content {\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 300px;\n overflow-y: auto;\n}\n.challenges__empty {\n color: var(--emw--color-white, #ffffff);\n}\n@container challenges-container (max-width: 800px) {\n .challenges__header {\n margin: 0 0 16px;\n flex-wrap: wrap;\n row-gap: 12px;\n }\n .challenges__title {\n width: 100%;\n font-size: var(--emw--font-size-large, 20px);\n }\n .challenges__title img {\n height: 32px;\n }\n .challenges__tabs {\n width: 100%;\n gap: 8px;\n }\n .challenges__tab {\n flex: 1;\n padding: 5px 0;\n font-size: var(--emw--font-size-x-small, 12px);\n }\n .challenges__tab:last-child {\n width: inherit;\n padding: 5px 0;\n }\n}";
102
103
  const CasinoChallengesContainerStyle0 = casinoChallengesContainerCss;
103
104
 
104
105
  const CasinoChallengesContainer = class {
105
106
  constructor(hostRef) {
106
107
  registerInstance(this, hostRef);
107
- // todo: connect with api
108
108
  this.tabs = ['Active', 'Pending', 'Finished', 'Code'];
109
109
  this.showNotification = 1;
110
+ this.checkAttrs = () => {
111
+ if (!this.endpoint) {
112
+ this.error = 'Endpoint is missing! Please provide a valid endpointURL.';
113
+ this.hasError = true;
114
+ console.error(this.error);
115
+ }
116
+ return this.hasError;
117
+ };
118
+ this.onLoadMore = () => {
119
+ this.pageNumber += 1;
120
+ this.getChallenges().then((res) => {
121
+ this.challenges = [...this.challenges, ...res.Data];
122
+ this.total = res.TotalCount;
123
+ });
124
+ };
110
125
  this.handleTabClick = (index) => () => {
111
126
  this.activeTabIndex = index;
127
+ this.challenges = [];
128
+ this.pageNumber = 0;
129
+ this.total = 0;
130
+ this.loadData();
112
131
  };
113
132
  this.mbSource = undefined;
114
133
  this.clientStyling = undefined;
115
134
  this.clientStylingUrl = undefined;
116
135
  this.translationUrl = '';
117
136
  this.language = 'en';
137
+ this.endpoint = '';
138
+ this.domain = '';
139
+ this.session = '';
140
+ this.userId = '';
118
141
  this.activeTabIndex = 0;
142
+ this.error = '';
143
+ this.hasError = false;
144
+ this.challenges = [];
145
+ this.loading = false;
146
+ this.pageNumber = 0;
147
+ this.total = 0;
148
+ this.pageSize = 20;
119
149
  }
120
150
  handleClientStylingChange(newValue, oldValue) {
121
151
  if (newValue != oldValue) {
@@ -132,6 +162,31 @@ const CasinoChallengesContainer = class {
132
162
  setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
133
163
  }
134
164
  }
165
+ async getChallenges() {
166
+ if (!this.checkAttrs()) {
167
+ const path = this.activeTabIndex === 2 ? '/PlayerHistory' : '/GetChallengesInfo';
168
+ const url = `${this.endpoint}/challenge/${path}`;
169
+ const body = Object.assign(Object.assign({ DomainId: this.domain, PlayerLanguage: this.language, PageNumber: this.pageNumber, PageSize: this.pageSize }, (this.session && { PlayerSessionId: this.session })), (this.userId && this.activeTabIndex === 2 && { UserId: this.userId }));
170
+ this.loading = true;
171
+ return fetch(url, {
172
+ method: 'POST',
173
+ headers: {
174
+ 'Content-Type': 'application/json'
175
+ },
176
+ body: JSON.stringify(body)
177
+ })
178
+ .then((res) => res.json())
179
+ .finally(() => (this.loading = false));
180
+ }
181
+ }
182
+ loadData() {
183
+ this.getChallenges().then((res) => {
184
+ if (res === null || res === void 0 ? void 0 : res.Success) {
185
+ this.pageNumber = res.PageNumber;
186
+ this.total = res.TotalCount;
187
+ }
188
+ });
189
+ }
135
190
  componentDidLoad() {
136
191
  if (this.stylingContainer) {
137
192
  if (this.mbSource)
@@ -141,6 +196,7 @@ const CasinoChallengesContainer = class {
141
196
  if (this.clientStylingUrl)
142
197
  setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
143
198
  }
199
+ this.loadData();
144
200
  }
145
201
  disconnectedCallback() {
146
202
  this.stylingSubscription && this.stylingSubscription.unsubscribe();
@@ -150,8 +206,14 @@ const CasinoChallengesContainer = class {
150
206
  resolveTranslationUrl(this.translationUrl);
151
207
  }
152
208
  }
209
+ onTimerExpired(e) {
210
+ setTimeout(() => {
211
+ this.challenges = this.challenges.filter((challenge) => challenge.Id !== e.detail);
212
+ }, 10000);
213
+ }
153
214
  render() {
154
- return (h("div", { key: 'ef5356a1bc2a1635d75938d6b03e6dc48979b573', ref: (el) => (this.stylingContainer = el) }, h("div", { key: 'a1edaaab07df252238186c9e7f0159609b057af3', class: "challenges" }, h("div", { key: '096e945c0b7f27b4fbf05886fc3b5816b4e1fe1c', class: "challenges__header" }, h("h1", { key: '76e80c1468aba0ea370486c9cd3cc68f70fa0a19', class: "challenges__title" }, h("img", { key: '47603b0b6e7f771c91cd06d6338564450022cef7', src: titleIconSvg, alt: "icon" }), translate('title', this.language)), h("div", { key: '43495b2ed368dfb187610bc87d53edbe884c1edb', class: "challenges__tabs" }, this.tabs.map((label, index) => (h("div", { class: `challenges__tab ${index === this.activeTabIndex ? 'active' : ''}`, onClick: this.handleTabClick(index) }, label, this.showNotification === index && h("img", { src: notificationSvg })))))))));
215
+ var _a;
216
+ return (h("div", { key: 'af2e5b13351a5b8694258c628f545d6a127e80dc', ref: (el) => (this.stylingContainer = el) }, h("div", { key: '91cdbc6a152a8b8c884842370c5509e7f6752074', class: "challenges" }, h("div", { key: 'd480a88d50cea5789eabb8dcc30233aea7d18d0f', class: "challenges__header" }, h("h1", { key: '8cd8787debb4f6f9897291f11c131c4ea1ef1d15', class: "challenges__title" }, h("img", { key: '1551482df42aaf36ed5cac7b2834bc276cc5cf52', src: titleIconSvg, alt: "icon" }), translate('title', this.language)), this.session && (h("div", { key: 'b45e42e56d5abc570b72979490f6e7ff4bf4f1bd', class: "challenges__tabs" }, this.tabs.map((label, index) => (h("div", { class: `challenges__tab ${index === this.activeTabIndex ? 'active' : ''}`, onClick: this.handleTabClick(index) }, label, this.showNotification === index && h("img", { src: notificationSvg }))))))), h("div", { key: 'd1a2a52ff5d26f17e401a7a3707f4153bbbc6290', class: "challenges__content" }, this.challenges.length === 0 && !this.loading && (h("div", { key: 'f0ab8469ac8a795b4d25d925bc1065217398e862', class: "empty" }, translate('empty', this.language))), this.activeTabIndex !== 3 && (h("casino-challenges-list", { key: '2f7aaf6e940668be6e15e1cfb81f5d2d063361ef', challenges: this.challenges, onLoadMore: this.onLoadMore, onTimerExpired: this.onTimerExpired, loading: this.loading, hasMore: ((_a = this.challenges) === null || _a === void 0 ? void 0 : _a.length) < this.total, language: this.language }))))));
155
217
  }
156
218
  static get watchers() { return {
157
219
  "clientStyling": ["handleClientStylingChange"],
@@ -161,4 +223,4 @@ const CasinoChallengesContainer = class {
161
223
  };
162
224
  CasinoChallengesContainer.style = CasinoChallengesContainerStyle0;
163
225
 
164
- export { CasinoChallengesContainer as C };
226
+ export { CasinoChallengesContainer as C, setClientStylingURL as a, setStreamStyling as b, setClientStyling as s };
@@ -1,5 +1,5 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-9c823353.js';
2
- export { s as setNonce } from './index-9c823353.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-c7b24115.js';
2
+ export { s as setNonce } from './index-c7b24115.js';
3
3
  import { g as globalScripts } from './app-globals-0f993ce5.js';
4
4
 
5
5
  /*
@@ -16,5 +16,5 @@ var patchBrowser = () => {
16
16
 
17
17
  patchBrowser().then(async (options) => {
18
18
  await globalScripts();
19
- return bootstrapLazy([["casino-challenges-container",[[1,"casino-challenges-container",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"activeTabIndex":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}]]]], options);
19
+ return bootstrapLazy([["casino-challenge-card_4",[[1,"casino-challenges-container",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"endpoint":[513],"domain":[513],"session":[513],"userId":[513,"user-id"],"activeTabIndex":[32],"error":[32],"hasError":[32],"challenges":[32],"loading":[32],"pageNumber":[32],"total":[32],"pageSize":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}],[1,"casino-challenges-list",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[513],"translationUrl":[513,"translation-url"],"challenges":[16],"loading":[516],"hasMore":[516,"has-more"]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}],[1,"casino-challenge-card",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"challenge":[16],"tooltipIndex":[32],"timeLeft":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}],[0,"ui-skeleton",{"structure":[1],"width":[1],"height":[1],"borderRadius":[8,"border-radius"],"marginBottom":[8,"margin-bottom"],"marginTop":[8,"margin-top"],"marginLeft":[8,"margin-left"],"marginRight":[8,"margin-right"],"animation":[4],"rows":[2],"size":[1]},null,{"structure":["handleStructureChange"]}]]]], options);
20
20
  });
@@ -1,5 +1,5 @@
1
1
  const NAMESPACE = 'casino-challenges-container';
2
- const BUILD = /* casino-challenges-container */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: false, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: false, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: true, element: false, event: false, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: false, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: false, propMutable: false, propNumber: false, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: false, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: false, vdomText: true, vdomXlink: false, watchCallback: true };
2
+ const BUILD = /* casino-challenges-container */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: true, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: true, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: false, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: false, propNumber: true, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: false, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: false, vdomText: true, vdomXlink: false, watchCallback: true };
3
3
 
4
4
  /*
5
5
  Stencil Client Platform v4.19.2 | MIT Licensed | https://stenciljs.com
@@ -49,10 +49,10 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
49
49
  }
50
50
  switch(bundleId) {
51
51
 
52
- case 'casino-challenges-container':
52
+ case 'casino-challenge-card_4':
53
53
  return import(
54
54
  /* webpackMode: "lazy" */
55
- './casino-challenges-container.entry.js').then(processMod, consoleError);
55
+ './casino-challenge-card_4.entry.js').then(processMod, consoleError);
56
56
  }
57
57
  }
58
58
  return import(
@@ -273,6 +273,12 @@ var Host = {};
273
273
  var isHost = (node) => node && node.$tag$ === Host;
274
274
  var parsePropertyValue = (propValue, propType) => {
275
275
  if (propValue != null && !isComplexType(propValue)) {
276
+ if (propType & 4 /* Boolean */) {
277
+ return propValue === "false" ? false : propValue === "" || !!propValue;
278
+ }
279
+ if (propType & 2 /* Number */) {
280
+ return parseFloat(propValue);
281
+ }
276
282
  if (propType & 1 /* String */) {
277
283
  return String(propValue);
278
284
  }
@@ -280,6 +286,22 @@ var parsePropertyValue = (propValue, propType) => {
280
286
  }
281
287
  return propValue;
282
288
  };
289
+ var getElement = (ref) => getHostRef(ref).$hostElement$ ;
290
+
291
+ // src/runtime/event-emitter.ts
292
+ var createEvent = (ref, name, flags) => {
293
+ const elm = getElement(ref);
294
+ return {
295
+ emit: (detail) => {
296
+ return emitEvent(elm, name, {
297
+ bubbles: !!(flags & 4 /* Bubbles */),
298
+ composed: !!(flags & 2 /* Composed */),
299
+ cancelable: !!(flags & 1 /* Cancellable */),
300
+ detail
301
+ });
302
+ }
303
+ };
304
+ };
283
305
  var emitEvent = (elm, name, opts) => {
284
306
  const ev = plt.ce(name, opts);
285
307
  elm.dispatchEvent(ev);
@@ -764,6 +786,9 @@ var postUpdateComponent = (hostRef) => {
764
786
  const endPostUpdate = createTime("postUpdate", tagName);
765
787
  const instance = hostRef.$lazyInstance$ ;
766
788
  const ancestorComponent = hostRef.$ancestorComponent$;
789
+ {
790
+ safeCall(instance, "componentDidRender");
791
+ }
767
792
  if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
768
793
  hostRef.$flags$ |= 64 /* hasLoadedComponent */;
769
794
  {
@@ -963,6 +988,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
963
988
  hostRef.$flags$ |= 128 /* isWatchReady */;
964
989
  }
965
990
  endNewInstance();
991
+ fireConnectedCallback(hostRef.$lazyInstance$);
966
992
  } else {
967
993
  Cstr = elm.constructor;
968
994
  const cmpTag = elm.localName;
@@ -990,6 +1016,9 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
990
1016
  }
991
1017
  };
992
1018
  var fireConnectedCallback = (instance) => {
1019
+ {
1020
+ safeCall(instance, "connectedCallback");
1021
+ }
993
1022
  };
994
1023
 
995
1024
  // src/runtime/connected-callback.ts
@@ -1022,8 +1051,10 @@ var connectedCallback = (elm) => {
1022
1051
  initializeComponent(elm, hostRef, cmpMeta);
1023
1052
  }
1024
1053
  } else {
1025
- if (hostRef == null ? void 0 : hostRef.$lazyInstance$) ; else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
1026
- hostRef.$onReadyPromise$.then(() => fireConnectedCallback());
1054
+ if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
1055
+ fireConnectedCallback(hostRef.$lazyInstance$);
1056
+ } else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
1057
+ hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$));
1027
1058
  }
1028
1059
  }
1029
1060
  endConnected();
@@ -1168,4 +1199,4 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
1168
1199
  // src/runtime/nonce.ts
1169
1200
  var setNonce = (nonce) => plt.$nonce$ = nonce;
1170
1201
 
1171
- export { bootstrapLazy as b, h, promiseResolve as p, registerInstance as r, setNonce as s };
1202
+ export { Host as H, bootstrapLazy as b, createEvent as c, getElement as g, h, promiseResolve as p, registerInstance as r, setNonce as s };
package/dist/esm/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { C as CasinoChallengesContainer } from './casino-challenges-container-affc90f5.js';
2
- import './index-9c823353.js';
1
+ export { C as CasinoChallengesContainer } from './casino-challenges-container-b776a245.js';
2
+ import './index-c7b24115.js';
@@ -1,11 +1,11 @@
1
- import { b as bootstrapLazy } from './index-9c823353.js';
2
- export { s as setNonce } from './index-9c823353.js';
1
+ import { b as bootstrapLazy } from './index-c7b24115.js';
2
+ export { s as setNonce } from './index-c7b24115.js';
3
3
  import { g as globalScripts } from './app-globals-0f993ce5.js';
4
4
 
5
5
  const defineCustomElements = async (win, options) => {
6
6
  if (typeof window === 'undefined') return undefined;
7
7
  await globalScripts();
8
- return bootstrapLazy([["casino-challenges-container",[[1,"casino-challenges-container",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"activeTabIndex":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}]]]], options);
8
+ return bootstrapLazy([["casino-challenge-card_4",[[1,"casino-challenges-container",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"endpoint":[513],"domain":[513],"session":[513],"userId":[513,"user-id"],"activeTabIndex":[32],"error":[32],"hasError":[32],"challenges":[32],"loading":[32],"pageNumber":[32],"total":[32],"pageSize":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}],[1,"casino-challenges-list",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[513],"translationUrl":[513,"translation-url"],"challenges":[16],"loading":[516],"hasMore":[516,"has-more"]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}],[1,"casino-challenge-card",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"challenge":[16],"tooltipIndex":[32],"timeLeft":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}],[0,"ui-skeleton",{"structure":[1],"width":[1],"height":[1],"borderRadius":[8,"border-radius"],"marginBottom":[8,"margin-bottom"],"marginTop":[8,"margin-top"],"marginLeft":[8,"margin-left"],"marginRight":[8,"margin-right"],"animation":[4],"rows":[2],"size":[1]},null,{"structure":["handleStructureChange"]}]]]], options);
9
9
  };
10
10
 
11
11
  export { defineCustomElements };
@@ -1,3 +1,5 @@
1
+ import { IChallenge } from '../../utils/types';
2
+ import "../../../../../../dist/packages/stencil/casino-challenges-list/dist/types/index";
1
3
  export declare class CasinoChallengesContainer {
2
4
  /**
3
5
  * Client custom styling via message bus
@@ -19,7 +21,30 @@ export declare class CasinoChallengesContainer {
19
21
  * Client custom language for translation
20
22
  */
21
23
  language: string;
24
+ /**
25
+ * Client endpoint to fetch data
26
+ */
27
+ endpoint: string;
28
+ /**
29
+ * Client endpoint to fetch data
30
+ */
31
+ domain: string;
32
+ /**
33
+ * session
34
+ */
35
+ session: string;
36
+ /**
37
+ * userId
38
+ */
39
+ userId: string;
22
40
  activeTabIndex: number;
41
+ error: string;
42
+ hasError: boolean;
43
+ challenges: IChallenge[];
44
+ loading: boolean;
45
+ pageNumber: number;
46
+ total: number;
47
+ pageSize: number;
23
48
  private stylingContainer;
24
49
  private stylingSubscription;
25
50
  private readonly tabs;
@@ -27,9 +52,14 @@ export declare class CasinoChallengesContainer {
27
52
  handleClientStylingChange(newValue: any, oldValue: any): void;
28
53
  handleClientStylingUrlChange(newValue: any, oldValue: any): void;
29
54
  handleMbSourceChange(newValue: any, oldValue: any): void;
55
+ checkAttrs: () => boolean;
56
+ getChallenges(): Promise<any>;
57
+ loadData(): void;
58
+ onLoadMore: () => void;
30
59
  componentDidLoad(): void;
31
60
  disconnectedCallback(): void;
32
61
  componentWillLoad(): void;
33
62
  private handleTabClick;
63
+ onTimerExpired(e: CustomEvent): void;
34
64
  render(): any;
35
65
  }
@@ -15,6 +15,14 @@ export namespace Components {
15
15
  * Client custom styling via css file url
16
16
  */
17
17
  "clientStylingUrl": string;
18
+ /**
19
+ * Client endpoint to fetch data
20
+ */
21
+ "domain": string;
22
+ /**
23
+ * Client endpoint to fetch data
24
+ */
25
+ "endpoint": string;
18
26
  /**
19
27
  * Client custom language for translation
20
28
  */
@@ -23,10 +31,18 @@ export namespace Components {
23
31
  * Client custom styling via message bus
24
32
  */
25
33
  "mbSource": string;
34
+ /**
35
+ * session
36
+ */
37
+ "session": string;
26
38
  /**
27
39
  * Client custom translation via json file url
28
40
  */
29
41
  "translationUrl": string;
42
+ /**
43
+ * userId
44
+ */
45
+ "userId": string;
30
46
  }
31
47
  }
32
48
  declare global {
@@ -50,6 +66,14 @@ declare namespace LocalJSX {
50
66
  * Client custom styling via css file url
51
67
  */
52
68
  "clientStylingUrl"?: string;
69
+ /**
70
+ * Client endpoint to fetch data
71
+ */
72
+ "domain"?: string;
73
+ /**
74
+ * Client endpoint to fetch data
75
+ */
76
+ "endpoint"?: string;
53
77
  /**
54
78
  * Client custom language for translation
55
79
  */
@@ -58,10 +82,18 @@ declare namespace LocalJSX {
58
82
  * Client custom styling via message bus
59
83
  */
60
84
  "mbSource"?: string;
85
+ /**
86
+ * session
87
+ */
88
+ "session"?: string;
61
89
  /**
62
90
  * Client custom translation via json file url
63
91
  */
64
92
  "translationUrl"?: string;
93
+ /**
94
+ * userId
95
+ */
96
+ "userId"?: string;
65
97
  }
66
98
  interface IntrinsicElements {
67
99
  "casino-challenges-container": CasinoChallengesContainer;
@@ -0,0 +1,130 @@
1
+ export interface IInfoItem {
2
+ lable: string;
3
+ value: string | number;
4
+ }
5
+ export declare enum EChallengeLevelTargetType {
6
+ Accumulative = 0,
7
+ SingleBet = 1,
8
+ MultipleOneBetSize = 2
9
+ }
10
+ export declare enum EChallengeRecurrenceType {
11
+ Single = 0,
12
+ Daily = 1,
13
+ Weekly = 2,
14
+ Monthly = 3
15
+ }
16
+ export declare enum EChallengeRewardType {
17
+ FreeSpins = 0,
18
+ LuckyWheel = 1,
19
+ Leaderboard = 2,
20
+ Challenge = 3,
21
+ Custom = 4
22
+ }
23
+ export declare enum EChallengeStatus {
24
+ Setup = 0,
25
+ Active = 1,
26
+ Paused = 2,
27
+ Closed = 3,
28
+ Deleted = 4
29
+ }
30
+ export declare enum EChallengeTriggerType {
31
+ GameLaunch = 0,
32
+ Reward = 1,
33
+ Manual = 2
34
+ }
35
+ export declare enum EChallengeValidityType {
36
+ Period = 0,
37
+ Date = 1
38
+ }
39
+ export type ChallengeRecurrenceTypeName = 'Single' | 'Daily' | 'Weekly' | 'Monthly';
40
+ export type ChallengeStatusName = 'Draft' | 'Enabled' | 'Paused' | 'Closed' | 'Deleted';
41
+ export type ChallengeTriggerName = 'GameLaunch' | 'Reward';
42
+ export interface IChallengeLevel {
43
+ Name: string;
44
+ Id?: number;
45
+ OrderNumber: number;
46
+ Target: IChallengeLevelTarget;
47
+ CustomRewardMessage: Record<string, string>;
48
+ Rewards: Array<IChallengeLevelReward>;
49
+ Targets?: string | null;
50
+ }
51
+ export interface IChallengeLevelReward {
52
+ Type: EChallengeRewardType;
53
+ RewardId: number;
54
+ RewardDescription?: string;
55
+ BonusCode?: string | null;
56
+ }
57
+ export interface IChallengeLevelTarget {
58
+ TargetType: number;
59
+ Turnover: number;
60
+ BetCount: number;
61
+ LevelContributionPercent: number;
62
+ BetRange?: Record<string, IChallengeBetRange>;
63
+ }
64
+ export interface IChallengePresentation {
65
+ PresentationName: string;
66
+ Description?: string;
67
+ Url?: string;
68
+ TriggerPopupMessage?: string;
69
+ TooltipMessage?: string;
70
+ }
71
+ export interface ITriggerPeriods {
72
+ DayOfWeek: number;
73
+ StartTime: string;
74
+ EndTime: string;
75
+ }
76
+ export interface IChallengeRecurrence {
77
+ Type: EChallengeRecurrenceType;
78
+ RecurrenceTypeName: ChallengeRecurrenceTypeName;
79
+ MaxParticipationPerPlayer: number;
80
+ TriggerPeriods: ITriggerPeriods[] | null;
81
+ }
82
+ export interface IChallengeValidity {
83
+ Type: number;
84
+ Days: number | null;
85
+ Hours: number;
86
+ Minutes: number;
87
+ ExpirationTime: string;
88
+ }
89
+ export interface IChallengeBetRange {
90
+ MinBet: number;
91
+ MaxBet: number;
92
+ MaxContributionAmount: number;
93
+ }
94
+ export interface IChallenge {
95
+ Status: EChallengeStatus;
96
+ StatusName: ChallengeStatusName;
97
+ Name: string;
98
+ ChallengePresentations?: IChallengePresentation;
99
+ Ins: string;
100
+ Upd: string;
101
+ StartTime: string;
102
+ ExpirationTime: string;
103
+ Validity: IChallengeValidity;
104
+ Recurrence: IChallengeRecurrence;
105
+ SystemCurrency: string;
106
+ AllowedCurrencies: string[] | null;
107
+ Trigger: EChallengeTriggerType;
108
+ TriggerName: ChallengeTriggerName;
109
+ ChallengeLevels: Array<IChallengeLevel>;
110
+ GameCodes: Array<string>;
111
+ IncludedUserIds?: Array<string>;
112
+ ExcludedUserIds?: Array<string>;
113
+ AllowedCountries?: Array<string>;
114
+ DeniedCountries?: Array<string>;
115
+ IncludedUserIdRange?: Array<Record<string, number>>;
116
+ ExcludedUserIdRange?: Array<Record<string, number>>;
117
+ IsPendingTrigger: boolean;
118
+ Id: number;
119
+ DomainId: number;
120
+ Removed: boolean;
121
+ TotalGrantLimit: number;
122
+ IncludedUserRoles?: string[] | null;
123
+ ExcludedUserRoles?: string[] | null;
124
+ }
125
+ export interface IChallengesListData {
126
+ Success: boolean;
127
+ Data: IChallenge[];
128
+ PageNumber: number;
129
+ TotalCount: number;
130
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/casino-challenges-container",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.js",
6
6
  "es2015": "./dist/esm/index.mjs",