@everymatrix/lottery-game-page 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/helper-accordion.cjs.entry.js +7 -3
- package/dist/cjs/helper-filters_2.cjs.entry.js +662 -417
- package/dist/cjs/helper-modal.cjs.entry.js +1 -1
- package/dist/cjs/helper-pagination.cjs.entry.js +1 -1
- package/dist/cjs/helper-tab.cjs.entry.js +11 -8
- package/dist/cjs/helper-tabs.cjs.entry.js +2 -2
- package/dist/cjs/{index-e5770ba2.js → index-5701a895.js} +6 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/lottery-bullet_2.cjs.entry.js +3 -3
- package/dist/cjs/lottery-draw-results-history.cjs.entry.js +64 -27
- package/dist/cjs/lottery-game-details.cjs.entry.js +1 -1
- package/dist/cjs/lottery-game-page.cjs.entry.js +50 -13
- package/dist/cjs/lottery-game-page.cjs.js +2 -2
- package/dist/cjs/lottery-ticket-controller.cjs.entry.js +1 -1
- package/dist/cjs/lottery-ticket.cjs.entry.js +32 -9
- package/dist/collection/components/lottery-game-page/lottery-game-page.css +27 -7
- package/dist/collection/components/lottery-game-page/lottery-game-page.js +22 -5
- package/dist/collection/utils/locale.utils.js +33 -6
- package/dist/components/helper-accordion2.js +7 -2
- package/dist/components/helper-filters2.js +597 -361
- package/dist/components/helper-tab2.js +12 -8
- package/dist/components/helper-tabs2.js +1 -1
- package/dist/components/lottery-bullet2.js +1 -1
- package/dist/components/lottery-draw-results-history2.js +69 -28
- package/dist/components/lottery-draw-results2.js +60 -46
- package/dist/components/lottery-game-page.js +52 -13
- package/dist/components/lottery-grid2.js +1 -1
- package/dist/components/lottery-ticket2.js +35 -10
- package/dist/esm/helper-accordion.entry.js +7 -3
- package/dist/esm/helper-filters_2.entry.js +662 -417
- package/dist/esm/helper-modal.entry.js +1 -1
- package/dist/esm/helper-pagination.entry.js +1 -1
- package/dist/esm/helper-tab.entry.js +11 -8
- package/dist/esm/helper-tabs.entry.js +2 -2
- package/dist/esm/{index-8f308493.js → index-ade3d0ab.js} +6 -0
- package/dist/esm/loader.js +2 -2
- package/dist/esm/lottery-bullet_2.entry.js +3 -3
- package/dist/esm/lottery-draw-results-history.entry.js +64 -27
- package/dist/esm/lottery-game-details.entry.js +1 -1
- package/dist/esm/lottery-game-page.entry.js +50 -13
- package/dist/esm/lottery-game-page.js +2 -2
- package/dist/esm/lottery-ticket-controller.entry.js +1 -1
- package/dist/esm/lottery-ticket.entry.js +32 -9
- package/dist/lottery-game-page/lottery-game-page.esm.js +1 -1
- package/dist/lottery-game-page/p-07cca45e.entry.js +1 -0
- package/dist/lottery-game-page/{p-12251772.entry.js → p-1196396b.entry.js} +1 -1
- package/dist/lottery-game-page/{p-43400250.entry.js → p-2197c8ae.entry.js} +1 -1
- package/dist/lottery-game-page/p-2a4e9984.entry.js +1 -0
- package/dist/lottery-game-page/p-4bfd0112.entry.js +1 -0
- package/dist/lottery-game-page/p-5e12dbf9.entry.js +1 -0
- package/dist/lottery-game-page/p-a10368b2.entry.js +1 -0
- package/dist/lottery-game-page/{p-43f7fac4.entry.js → p-a26ebf45.entry.js} +1 -1
- package/dist/lottery-game-page/p-b301a9d4.js +1 -0
- package/dist/lottery-game-page/{p-af9a2dde.entry.js → p-d4b6a11a.entry.js} +1 -1
- package/dist/lottery-game-page/{p-324c7edd.entry.js → p-d508e7cc.entry.js} +78 -118
- package/dist/lottery-game-page/p-dd63fcc6.entry.js +1 -0
- package/dist/lottery-game-page/p-f59dc9e1.entry.js +1 -0
- package/dist/stencil.config.js +5 -1
- package/dist/types/components/lottery-game-page/lottery-game-page.d.ts +3 -0
- package/package.json +1 -1
- package/dist/lottery-game-page/p-037dd940.js +0 -1
- package/dist/lottery-game-page/p-55338096.entry.js +0 -1
- package/dist/lottery-game-page/p-581bdfc2.entry.js +0 -1
- package/dist/lottery-game-page/p-6977f833.entry.js +0 -1
- package/dist/lottery-game-page/p-85f4e95b.entry.js +0 -1
- package/dist/lottery-game-page/p-99a61a44.entry.js +0 -1
- package/dist/lottery-game-page/p-bf66e969.entry.js +0 -1
- package/dist/lottery-game-page/p-d1b9da94.entry.js +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
2
|
|
|
3
|
-
const helperTabCss = ":host{display:block}";
|
|
3
|
+
const helperTabCss = ":host{display:block}.TabContent{font-size:14px;color:#000;font-weight:normal}";
|
|
4
4
|
|
|
5
5
|
const HelperTab = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
6
6
|
constructor() {
|
|
@@ -11,24 +11,28 @@ const HelperTab = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
11
11
|
* Selected index
|
|
12
12
|
*/
|
|
13
13
|
this.selectedIndex = 0;
|
|
14
|
+
this.tabContent = '';
|
|
14
15
|
}
|
|
15
|
-
/**
|
|
16
|
-
* Endpoing for CMS
|
|
17
|
-
*/
|
|
18
16
|
connectedCallback() {
|
|
19
17
|
/**
|
|
20
18
|
* fetch(cmsEndpoint + / + / + selectedIndex)
|
|
21
19
|
*/
|
|
22
20
|
}
|
|
23
21
|
render() {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
this.tabContent = h("div", { class: "TabContent" }, "Each play includes one set of numbers from 1 to 21 with a selectable number of 8 and a second, 4-digit set of numbers, with a minimum selection of 1. Draws are held every 5 minutes and the winnings are automatically credited to your account.");
|
|
23
|
+
if (this.selectedIndex + 1 == 2) {
|
|
24
|
+
this.tabContent = h("div", { class: "TabContent" }, h("ol", null, h("li", null, "Register or Login"), h("li", null, "Buy tickets. Select 'Buy Tickets' to pick your numbers. Want us to automatically generate random numbers for you? Choose \u201CI feel lucky\u201D."), h("li", null, "Review and Complete your purchase. Once you've chosen your total number of plays, and confirmed your number of selections, review your ticket details and complete your purchase!")));
|
|
25
|
+
}
|
|
26
|
+
else if (this.selectedIndex + 1 == 3) {
|
|
27
|
+
this.tabContent = h("div", { class: "TabContent" }, h("ul", null, h("li", null, "What are my odds of winning?"), h("li", null, "How can I find out if I\u2019ve won a draw game?"), h("li", null, "How do I claim my prize?")));
|
|
28
|
+
}
|
|
29
|
+
return (this.tabContent);
|
|
27
30
|
}
|
|
28
31
|
static get style() { return helperTabCss; }
|
|
29
32
|
}, [1, "helper-tab", {
|
|
30
33
|
"selectedIndex": [2, "selected-index"],
|
|
31
|
-
"cmsEndpoint": [1, "cms-endpoint"]
|
|
34
|
+
"cmsEndpoint": [1, "cms-endpoint"],
|
|
35
|
+
"tabContent": [32]
|
|
32
36
|
}]);
|
|
33
37
|
function defineCustomElement() {
|
|
34
38
|
if (typeof customElements === "undefined") {
|
|
@@ -23,7 +23,7 @@ const HelperTabs = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
23
23
|
/**
|
|
24
24
|
* Tabs details
|
|
25
25
|
*/
|
|
26
|
-
this.tabs = [{ label: '
|
|
26
|
+
this.tabs = [{ label: 'How to Play' }, { label: 'About' }, { label: 'FAQs' }];
|
|
27
27
|
}
|
|
28
28
|
connectedCallback() {
|
|
29
29
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
2
|
|
|
3
|
-
const lotteryBulletCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.Circle{cursor:pointer;color:#000000;display:block;
|
|
3
|
+
const lotteryBulletCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}@-webkit-keyframes Circle{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes Circle{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes hover-rotate{0%{-webkit-transform:scale(1) rotateZ(0);transform:scale(1) rotateZ(0)}50%{-webkit-transform:scale(1.2) rotateZ(180deg);transform:scale(1.22) rotateZ(180deg)}100%{-webkit-transform:scale(1) rotateZ(360deg);transform:scale(1) rotateZ(360deg)}}@keyframes hover-rotate{0%{-webkit-transform:scale(1) rotateZ(0);transform:scale(1) rotateZ(0)}50%{-webkit-transform:scale(1.2) rotateZ(180deg);transform:scale(1.2) rotateZ(180deg)}100%{-webkit-transform:scale(1) rotateZ(360deg);transform:scale(1) rotateZ(360deg)}}@-webkit-keyframes selected-scaleUp{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1.2);transform:scale(1.2)}}@keyframes selected-scaleUp{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}.Circle{-webkit-animation:Circle 0.8s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:Circle 0.8s cubic-bezier(0.39, 0.575, 0.565, 1) both;cursor:pointer;color:#000000;display:block;height:30px;width:30px;margin:0;display:flex;align-items:center;justify-content:center;justify-content:center;align-items:center;border:solid 2px #ffffff;background:radial-gradient(circle at top, white 0%, white 100%);font-weight:bold;border-radius:50%;box-shadow:0 2px 4px 0 rgba(0, 0, 0, 0.5);user-select:none;font-size:16px;line-height:16px;font-weight:600;position:relative}.Circle:hover{-webkit-animation:hover-rotate 0.4s linear both;animation:hover-rotate 0.4s linear both;background:radial-gradient(circle at top, white 0%, #f1f1f1 100%)}.Circle.Selected{-webkit-animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;color:#ffffff;background:#9EC258;background:-webkit-radial-gradient(top, #00958f, #004D4A);background:-moz-radial-gradient(top, #00958f, #004D4A);background:radial-gradient(to bottom, #00958f, #004D4A);border:solid 2px #00958f}.Circle.Disabled{-webkit-animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;color:#f1f1f1;background:#D4D4D4;border:solid 2px #D4D4D4;cursor:default}.Circle.DisabledSelected{-webkit-animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;color:#f1f1f1;background:#9EC258;background:-webkit-radial-gradient(top, #00958f, #004D4A);background:-moz-radial-gradient(top, #00958f, #004D4A);background:radial-gradient(to bottom, #00958f, #004D4A);border:solid 2px #D4D4D4;cursor:default}";
|
|
4
4
|
|
|
5
5
|
const LotteryBullet = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
6
6
|
constructor() {
|
|
@@ -16,17 +16,23 @@ const TRANSLATIONS = {
|
|
|
16
16
|
viewAllResults: 'View All',
|
|
17
17
|
lastFiveDraws: 'Last 5 Draws',
|
|
18
18
|
lastTenDraws: 'Last 10 Draws',
|
|
19
|
-
lastFifteenDraws: 'Last 15 Draws'
|
|
19
|
+
lastFifteenDraws: 'Last 15 Draws',
|
|
20
|
+
allDrawResultsHistory: 'All Draw Results History',
|
|
21
|
+
noResults: 'No results',
|
|
22
|
+
fetchingResults: 'Fetching results'
|
|
20
23
|
},
|
|
21
24
|
ro: {
|
|
22
|
-
drawResultsHeader: '
|
|
23
|
-
drawId: '
|
|
24
|
-
drawDate: '
|
|
25
|
-
drawNumbersGridA: '
|
|
26
|
-
viewAllResults: '
|
|
27
|
-
lastFiveDraws: '
|
|
28
|
-
lastTenDraws: '
|
|
29
|
-
lastFifteenDraws: '
|
|
25
|
+
drawResultsHeader: 'Istoricul extragerilor',
|
|
26
|
+
drawId: 'ID-ul extragerii',
|
|
27
|
+
drawDate: 'Data extragerii',
|
|
28
|
+
drawNumbersGridA: 'Numerele extrase Grid A',
|
|
29
|
+
viewAllResults: 'Vezi toate rezultatele',
|
|
30
|
+
lastFiveDraws: 'Ultimile 5 extrageri',
|
|
31
|
+
lastTenDraws: 'Ultimile 10 extrageri',
|
|
32
|
+
lastFifteenDraws: 'Ultimile 15 extrageri',
|
|
33
|
+
allDrawResultsHistory: 'Istoricul tuturor extragerilor',
|
|
34
|
+
noResults: 'Niciun rezultat',
|
|
35
|
+
fetchingResults: 'Se obtin rezultatele'
|
|
30
36
|
},
|
|
31
37
|
};
|
|
32
38
|
const translate = (key, customLang) => {
|
|
@@ -34,7 +40,7 @@ const translate = (key, customLang) => {
|
|
|
34
40
|
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
35
41
|
};
|
|
36
42
|
|
|
37
|
-
const lotteryDrawResultsHistoryCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.GridBanner{background-color:#009993;background-repeat:no-repeat;background-position:center;color:#111;padding:0 20px 30px}.GridBanner .BannerButtonsWrapper{display:flex;justify-content:space-between;padding-top:16px}.GridBanner .BannerButtonsWrapper .BannerBackButton,.GridBanner .BannerButtonsWrapper .BannerLobbyButton{background:#fff;border:1px solid #009993;border-radius:4px;padding:7px 15px;font-size:12px;text-transform:uppercase;width:80px}.GridBanner .HistoryGridBannerArea{padding-top:30px}.HistoryGridBannerArea{display:flex;flex-direction:column;align-items:center}.BannerText{font-size:14px;font-weight:300}.BannerCountdown{font-size:22px;display:flex;gap:20px}.DrawResultsSection{max-width:
|
|
43
|
+
const lotteryDrawResultsHistoryCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.GridBanner{background-color:#009993;background-repeat:no-repeat;background-position:center;color:#111;padding:0 20px 30px}.GridBanner .BannerButtonsWrapper{display:flex;justify-content:space-between;padding-top:16px}.GridBanner .BannerButtonsWrapper .BannerBackButton,.GridBanner .BannerButtonsWrapper .BannerLobbyButton{background:#fff;border:1px solid #009993;border-radius:4px;padding:7px 15px;font-size:12px;text-transform:uppercase;width:80px}.GridBanner .HistoryGridBannerArea{padding-top:30px}.HistoryGridBannerArea{display:flex;flex-direction:column;align-items:center}.BannerText{font-size:14px;font-weight:300}.BannerCountdown{font-size:22px;display:flex;gap:20px}.DrawResultsSection{max-width:600px;margin:0px auto}.HistoryGrid{border-radius:5px}.DrawResultsHeader{color:#009993;padding:25px 0 10px 0;text-align:center;border-radius:4px 4px 0 0}.DrawResultsHeader h4{text-transform:uppercase;font-size:16px;font-weight:600;margin:0}.DrawNumbersGrid{padding:10px 50px}.DrawNumbersGrid p{margin:0 0 10px 0;font-size:14px}.BulletContainer{margin-bottom:20px}.DrawResultTop{background-color:#009993;padding:10px;text-align:center;color:#fff;padding:0 50px;display:flex;justify-content:center;gap:40px}.ViewAllResults{display:block;padding:10px 40px;margin:40px auto;border:0;border-radius:5px;background-color:#009993;color:#fff;outline:none}.FilterSection{display:flex;justify-content:space-between;padding:25px 15px 10px;gap:10px;margin:0px 15px}.FilterSection .FilterResultsContainer{display:flex;gap:5px;overflow-x:auto}.FilterSection .QuickFilterButton{cursor:pointer;width:max-content;border-radius:4px;border:1px solid #00958f;background:#FFF;color:#000;font-size:12px;transition:all 0.2s linear;text-align:center;letter-spacing:0}.FilterSection .QuickFilterButton:hover{background:#F1F1F1}.FilterSection helper-filters{margin-left:auto}";
|
|
38
44
|
|
|
39
45
|
const LotteryDrawResultsHistory = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
40
46
|
constructor() {
|
|
@@ -53,8 +59,16 @@ const LotteryDrawResultsHistory = /*@__PURE__*/ proxyCustomElement(class extends
|
|
|
53
59
|
this.displayAllDrawsResults = true;
|
|
54
60
|
this.showQuickFilters = true;
|
|
55
61
|
this.winningDataSetsData = [''];
|
|
56
|
-
this.
|
|
57
|
-
|
|
62
|
+
this.dateFiltersFrom = '';
|
|
63
|
+
this.dateFiltersTo = '';
|
|
64
|
+
this.isLoading = false;
|
|
65
|
+
this.noResults = false;
|
|
66
|
+
this.getDrawsData = (filterbydate = false) => {
|
|
67
|
+
let url = filterbydate ? new URL(`${this.endpoint}/games/${this.gameId}/draws`) : new URL(`${this.endpoint}/games/${this.gameId}`);
|
|
68
|
+
if (this.dateFiltersFrom)
|
|
69
|
+
url.searchParams.append('from', this.dateFiltersFrom);
|
|
70
|
+
if (this.dateFiltersTo)
|
|
71
|
+
url.searchParams.append('to', this.dateFiltersTo);
|
|
58
72
|
fetch(url.href)
|
|
59
73
|
.then((res) => {
|
|
60
74
|
if (res.status >= 300) {
|
|
@@ -63,11 +77,21 @@ const LotteryDrawResultsHistory = /*@__PURE__*/ proxyCustomElement(class extends
|
|
|
63
77
|
return res.json();
|
|
64
78
|
})
|
|
65
79
|
.then((data) => {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
80
|
+
this.isLoading = false;
|
|
81
|
+
if (filterbydate) {
|
|
82
|
+
this.winningDataSetsData = data.items.filter(draw => draw.winningNumbers);
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
this.winningDataSetsData = data.draws.filter(draw => draw.winningNumbers);
|
|
86
|
+
}
|
|
87
|
+
this.drawData = this.winningDataSetsData.map((item) => item);
|
|
88
|
+
})
|
|
89
|
+
.catch((err) => {
|
|
90
|
+
console.log('err', err);
|
|
91
|
+
})
|
|
92
|
+
.finally(() => {
|
|
93
|
+
this.isLoading = false;
|
|
94
|
+
this.noResults = this.drawData.filter(draw => draw.winningNumbers).length == 0 ? true : false;
|
|
71
95
|
});
|
|
72
96
|
};
|
|
73
97
|
this.filterResults = (resultsNumber) => {
|
|
@@ -88,8 +112,8 @@ const LotteryDrawResultsHistory = /*@__PURE__*/ proxyCustomElement(class extends
|
|
|
88
112
|
return response.json();
|
|
89
113
|
})
|
|
90
114
|
.then((data) => {
|
|
91
|
-
|
|
92
|
-
this.
|
|
115
|
+
this.drawData = [data].map((item) => item);
|
|
116
|
+
this.isLoading = false;
|
|
93
117
|
});
|
|
94
118
|
};
|
|
95
119
|
this.viewAllResults = () => {
|
|
@@ -99,27 +123,40 @@ const LotteryDrawResultsHistory = /*@__PURE__*/ proxyCustomElement(class extends
|
|
|
99
123
|
};
|
|
100
124
|
}
|
|
101
125
|
// Filters events
|
|
126
|
+
filtersDrawHandler(event) {
|
|
127
|
+
this.isLoading = true;
|
|
128
|
+
this.showQuickFilters = false;
|
|
129
|
+
this.getDrawResults(event.detail.ticketDrawId);
|
|
130
|
+
}
|
|
102
131
|
filtersHandler(event) {
|
|
103
|
-
var _a;
|
|
104
|
-
this.getDrawResults((_a = event.detail) === null || _a === void 0 ? void 0 : _a.drawTicketId);
|
|
105
132
|
this.showQuickFilters = false;
|
|
133
|
+
this.dateFiltersFrom = event.detail.filterFromCalendar;
|
|
134
|
+
this.dateFiltersTo = event.detail.filterToCalendar;
|
|
135
|
+
this.isLoading = true;
|
|
136
|
+
this.getDrawsData(true);
|
|
106
137
|
}
|
|
107
138
|
clearFiltersHandler() {
|
|
108
139
|
this.drawData = this.winningDataSetsData;
|
|
109
140
|
this.showQuickFilters = true;
|
|
141
|
+
this.dateFiltersFrom = '';
|
|
142
|
+
this.dateFiltersTo = '';
|
|
143
|
+
this.isLoading = true;
|
|
144
|
+
this.getDrawsData(false);
|
|
110
145
|
}
|
|
111
146
|
connectedCallback() {
|
|
112
|
-
this.
|
|
147
|
+
if (this.showQuickFilters)
|
|
148
|
+
this.getDrawsData(false);
|
|
113
149
|
}
|
|
114
150
|
disconnectedCallback() {
|
|
115
151
|
clearInterval(this.interval);
|
|
116
152
|
}
|
|
117
153
|
render() {
|
|
118
154
|
let gridHeader = h("div", { class: "DrawResultsHeader" }, this.displayAllDrawsResults ? h("h4", null, translate('drawResultsHeader', this.language)) :
|
|
119
|
-
h("div", { class: "DrawResultsHeaderContent" }, h("div", { class: "FilterSection" }, this.showQuickFilters &&
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
return h("section", { class: "GridWrapper" }, h("div", { class: "DrawResultsSection" }, h("div", { class: "
|
|
155
|
+
[h("div", { class: "DrawResultsHeaderContent" }, h("h4", null, translate('allDrawResultsHistory', this.language)), h("div", { class: "FilterSection" }, this.showQuickFilters &&
|
|
156
|
+
h("div", { class: "FilterResultsContainer" }, h("button", { class: "QuickFilterButton", onClick: () => this.filterResults(5) }, translate('lastFiveDraws', this.language)), h("button", { class: "QuickFilterButton", onClick: () => this.filterResults(10) }, translate('lastTenDraws', this.language)), h("button", { class: "QuickFilterButton", onClick: () => this.filterResults(15) }, translate('lastFifteenDraws', this.language))), h("helper-filters", { "show-filter-id": "true", "activate-ticket-search": "false", "game-id": this.gameId }))),
|
|
157
|
+
]);
|
|
158
|
+
return h("section", { class: "GridWrapper" }, h("div", { class: "DrawResultsSection" }, h("div", { class: "DrawResultsAreaHistory" }, gridHeader, h("div", { class: "HistoryGridWrapper" }, h("div", { class: "HistoryGrid" }, this.isLoading &&
|
|
159
|
+
h("p", null, translate('fetchingResults', this.language)), !this.isLoading && !this.noResults && this.drawData.map((item) => h("lottery-draw-results", { endpoint: this.endpoint, "game-id": this.gameId, "draw-id": item.id, "draw-mode": true })).reverse().slice(0, this.numberOfResults), !this.isLoading && this.noResults && (h("p", null, translate('noResults', this.language))))), this.displayAllDrawsResults && h("button", { class: "ViewAllResults", onClick: this.viewAllResults }, translate('viewAllResults', this.language)))));
|
|
123
160
|
}
|
|
124
161
|
static get style() { return lotteryDrawResultsHistoryCss; }
|
|
125
162
|
}, [1, "lottery-draw-results-history", {
|
|
@@ -130,8 +167,12 @@ const LotteryDrawResultsHistory = /*@__PURE__*/ proxyCustomElement(class extends
|
|
|
130
167
|
"drawData": [32],
|
|
131
168
|
"displayAllDrawsResults": [32],
|
|
132
169
|
"showQuickFilters": [32],
|
|
133
|
-
"winningDataSetsData": [32]
|
|
134
|
-
|
|
170
|
+
"winningDataSetsData": [32],
|
|
171
|
+
"dateFiltersFrom": [32],
|
|
172
|
+
"dateFiltersTo": [32],
|
|
173
|
+
"isLoading": [32],
|
|
174
|
+
"noResults": [32]
|
|
175
|
+
}, [[0, "filterDraw", "filtersDrawHandler"], [0, "filterSelection", "filtersHandler"], [0, "filterSelectionReset", "clearFiltersHandler"]]]);
|
|
135
176
|
function defineCustomElement() {
|
|
136
177
|
if (typeof customElements === "undefined") {
|
|
137
178
|
return;
|
|
@@ -14,7 +14,13 @@ const TRANSLATIONS = {
|
|
|
14
14
|
drawNumbersGridTicket: 'Draw numbers Grid B',
|
|
15
15
|
ticketResult: 'Ticket result',
|
|
16
16
|
amountWon: 'Amount won',
|
|
17
|
-
numberOfDraws: 'Number of draws'
|
|
17
|
+
numberOfDraws: 'Number of draws',
|
|
18
|
+
multiplier: 'Multiplier:',
|
|
19
|
+
ticketPurchaseDate: 'Ticket Purchase Date',
|
|
20
|
+
ticketStatus: 'Ticket Status',
|
|
21
|
+
ticketId: 'Ticket ID',
|
|
22
|
+
ticketAmount: 'Ticket Amount',
|
|
23
|
+
winUpTo: 'Win up to',
|
|
18
24
|
},
|
|
19
25
|
ro: {
|
|
20
26
|
drawResultsHeader: 'Ultimele rezultate extragere',
|
|
@@ -25,7 +31,13 @@ const TRANSLATIONS = {
|
|
|
25
31
|
drawNumbersGridTicket: 'Numerele extrase Grid B',
|
|
26
32
|
ticketResult: 'Rezultatul biletului',
|
|
27
33
|
amountWon: 'Suma castigata',
|
|
28
|
-
numberOfDraws: 'Numarul de extrageri'
|
|
34
|
+
numberOfDraws: 'Numarul de extrageri',
|
|
35
|
+
multiplier: 'Multiplicator:',
|
|
36
|
+
ticketPurchaseDate: 'Data achizitionarii biletului',
|
|
37
|
+
ticketStatus: 'Statusul biletului',
|
|
38
|
+
ticketId: 'Id biletul',
|
|
39
|
+
ticketAmount: 'Valoarea biletului',
|
|
40
|
+
winUpTo: 'Poti castiga'
|
|
29
41
|
},
|
|
30
42
|
};
|
|
31
43
|
const translate = (key, customLang) => {
|
|
@@ -33,22 +45,8 @@ const translate = (key, customLang) => {
|
|
|
33
45
|
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
34
46
|
};
|
|
35
47
|
|
|
36
|
-
const lotteryDrawResultsCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.TicketInfo{display:flex;flex-direction:row;gap:15px;background-color:#009993;color:#fff;padding:12px;font-size:14px}.DrawResultsSection{max-width:
|
|
48
|
+
const lotteryDrawResultsCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.TicketInfo{display:flex;flex-direction:row;gap:15px;background-color:#009993;color:#fff;padding:12px;font-size:14px}.DrawResultsArea{margin-top:15px}.DrawResultsSection{max-width:600px;margin:0px auto;border-radius:4px}.DrawResultsHeader{display:flex;justify-content:space-between;padding:10px 20px;background-color:#009993;color:#fff;font-size:14px;border-radius:4px 4px 0 0}.DrawResultsHeader h4{text-transform:uppercase;font-weight:400;margin:0;padding-top:15px}.DrawMultipler label{display:block;margin:15px 0}.DrawResultsBody{padding:0px 20px;margin-bottom:5px;border-radius:0 0 4px 4px;border:1px solid #009993}.DrawResultsBody .DrawNumbersGrid{font-size:14px}.DrawResultsBody .NumberOfDrawsContainer{display:table;width:100%}.Toggle{cursor:pointer;display:inline-block}.ToggleSwitch{display:inline-block;background:#ccc;border-radius:16px;width:58px;height:24px;position:relative;vertical-align:middle;transition:background 0.25s}.ToggleSwitch:before,.ToggleSwitch:after{content:\"\"}.ToggleSwitch:before{display:block;background:linear-gradient(to bottom, #fff 0%, #eee 100%);border-radius:50%;box-shadow:0 0 0 1px rgba(0, 0, 0, 0.25);width:16px;height:16px;position:absolute;top:4px;left:4px;transition:left 0.25s}.Toggle:hover .ToggleSwitch:before{background:linear-gradient(to bottom, #fff 0%, #fff 100%);box-shadow:0 0 0 1px rgba(0, 0, 0, 0.5)}.ToggleCheckbox:checked+.ToggleSwitch{background:#56c080}.ToggleCheckbox:checked+.ToggleSwitch:before{left:38px}.ToggleCheckbox{position:absolute;visibility:hidden}.Label{margin-right:5px;position:relative;top:2px}.DrawTicketsContainer{margin:30px auto}.ExpandableBoxes{position:relative}.ExpandableBox{line-height:12px;font-weight:lighter;width:100%;height:100%;max-height:70px;float:left;margin:0 0 20px 0;border:1px solid #f1f1f1;background:#fff;border-radius:4px;padding:10px;-webkit-transition:all 0.6s ease-in-out;-moz-transition:all 0.6s ease-in-out;-o-transition:all 0.6s ease-in-out;-ms-transition:all 0.6s ease-in-out;transition:all 0.6s ease-in-out;overflow:hidden;box-shadow:rgba(99, 99, 99, 0.2) 0px 2px 8px 0px}.ExpandableBox.ShowBox{max-height:400px;margin:0px 0px 20p 0px}.ExpandableBox.HideBox{width:0;height:0;overflow:hidden;border:none;padding:0;margin:0;opacity:0}";
|
|
37
49
|
|
|
38
|
-
const DEFAULT_VALUES = {
|
|
39
|
-
gamename: 'Chrono',
|
|
40
|
-
gamedate: '24/09/2022',
|
|
41
|
-
state: 'Processing',
|
|
42
|
-
amount: 304444,
|
|
43
|
-
ticketid: '6963444',
|
|
44
|
-
selection: '[5, 6, 7, 8, 9]',
|
|
45
|
-
multiplier: 4.5,
|
|
46
|
-
resultstatus: 'Processing',
|
|
47
|
-
drawstatus: 'Won',
|
|
48
|
-
drawamount: 1022,
|
|
49
|
-
drawid: '54545555',
|
|
50
|
-
drawdate: '24/09/2032'
|
|
51
|
-
};
|
|
52
50
|
const LotteryDrawResults = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
53
51
|
constructor() {
|
|
54
52
|
super();
|
|
@@ -62,9 +60,39 @@ const LotteryDrawResults = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
|
|
|
62
60
|
* Shows only the last draw
|
|
63
61
|
*/
|
|
64
62
|
this.drawMode = false;
|
|
63
|
+
/**
|
|
64
|
+
* The drawID (option)
|
|
65
|
+
*/
|
|
66
|
+
this.drawId = '';
|
|
67
|
+
/**
|
|
68
|
+
* The game name
|
|
69
|
+
*/
|
|
65
70
|
this.gameName = '';
|
|
66
|
-
|
|
67
|
-
|
|
71
|
+
/**
|
|
72
|
+
* The ticket submission date
|
|
73
|
+
*/
|
|
74
|
+
this.ticketDate = '';
|
|
75
|
+
/**
|
|
76
|
+
* The ticket status
|
|
77
|
+
*/
|
|
78
|
+
this.ticketStatus = '';
|
|
79
|
+
/**
|
|
80
|
+
* The ticket id
|
|
81
|
+
*/
|
|
82
|
+
this.ticketId = '';
|
|
83
|
+
/**
|
|
84
|
+
* The ticket amount
|
|
85
|
+
*/
|
|
86
|
+
this.ticketAmount = '';
|
|
87
|
+
/**
|
|
88
|
+
* The ticket multiplier
|
|
89
|
+
*/
|
|
90
|
+
this.ticketMultiplier = false;
|
|
91
|
+
/**
|
|
92
|
+
* The ticket draw count
|
|
93
|
+
*/
|
|
94
|
+
this.ticketDrawCount = 0;
|
|
95
|
+
this.multiplier = 3;
|
|
68
96
|
this.isLoading = true;
|
|
69
97
|
this.drawResults = [];
|
|
70
98
|
this.rules = {};
|
|
@@ -86,9 +114,6 @@ const LotteryDrawResults = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
|
|
|
86
114
|
connectedCallback() {
|
|
87
115
|
let promises = [];
|
|
88
116
|
promises.push(this.getGameData());
|
|
89
|
-
if (this.playerId) {
|
|
90
|
-
promises.push(this.getTicketData());
|
|
91
|
-
}
|
|
92
117
|
if (this.drawId) {
|
|
93
118
|
promises.push(this.getDrawData());
|
|
94
119
|
}
|
|
@@ -108,9 +133,11 @@ const LotteryDrawResults = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
|
|
|
108
133
|
.then((data) => {
|
|
109
134
|
this.drawData = data;
|
|
110
135
|
resolve(true);
|
|
136
|
+
this.isLoading = false;
|
|
111
137
|
})
|
|
112
138
|
.catch((err) => {
|
|
113
139
|
reject(err);
|
|
140
|
+
this.isLoading = false;
|
|
114
141
|
});
|
|
115
142
|
});
|
|
116
143
|
}
|
|
@@ -127,6 +154,8 @@ const LotteryDrawResults = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
|
|
|
127
154
|
totalNumbers: data.rules.boards[0].totalNumbers
|
|
128
155
|
};
|
|
129
156
|
resolve(true);
|
|
157
|
+
this.isLoading = false;
|
|
158
|
+
this.hasErrors = false;
|
|
130
159
|
})
|
|
131
160
|
.catch((err) => {
|
|
132
161
|
this.isLoading = false;
|
|
@@ -136,26 +165,7 @@ const LotteryDrawResults = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
|
|
|
136
165
|
});
|
|
137
166
|
});
|
|
138
167
|
}
|
|
139
|
-
getTicketData() {
|
|
140
|
-
return new Promise((resolve, reject) => {
|
|
141
|
-
let url = new URL(`${this.endpoint}/tickets/player/${this.playerId}`);
|
|
142
|
-
fetch(url.href)
|
|
143
|
-
.then((response) => {
|
|
144
|
-
return response.json();
|
|
145
|
-
})
|
|
146
|
-
.then((data) => {
|
|
147
|
-
this.ticketData = data.length === 0 ? DEFAULT_VALUES : data[1];
|
|
148
|
-
this.drawResults = this.ticketData.drawResults.map((item) => item);
|
|
149
|
-
this.selection = this.ticketData.selection[0].join(',');
|
|
150
|
-
resolve(true);
|
|
151
|
-
})
|
|
152
|
-
.catch((err) => {
|
|
153
|
-
reject(err);
|
|
154
|
-
});
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
168
|
render() {
|
|
158
|
-
var _a, _b, _c, _d, _e, _f;
|
|
159
169
|
if (this.isLoading) {
|
|
160
170
|
return (h("p", null, "Loading, please wait ..."));
|
|
161
171
|
}
|
|
@@ -164,12 +174,11 @@ const LotteryDrawResults = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
|
|
|
164
174
|
}
|
|
165
175
|
else {
|
|
166
176
|
return (h("section", { class: "DrawResultsSection" }, !this.drawMode ?
|
|
167
|
-
h("div", { class: "DrawResultsArea" }, h("div", { class: "TicketInfo" }, h("div", { class: "TicketGameName" }, translate('drawName', this.language), ": ", h("span", null, this.gameName)), h("div", { class: "TicketDate" },
|
|
168
|
-
|
|
169
|
-
h("div", { class: "AmountWonContainer" }, h("p", null, translate('amountWon', this.language), ": ", Number(item.amount).toLocaleString('en'), " ", item.currency)), h("div", { class: "DrawIdContainer" }, h("p", null, translate('drawId', this.language), ": ", item.drawId)), h("div", { class: "DrawDateContainer" }, h("p", null, translate('drawDate', this.language), ": ", item.updatedAt.slice(0, 10), " | ", item.updatedAt.slice(11, 19))), h("div", { class: "DrawNumbersGrid" }), h("div", { class: "DrawMultipler" }, h("label", { class: "Label" }, "Multiplier: ", item.multiplier)))))))))
|
|
177
|
+
h("div", { class: "DrawResultsArea" }, h("div", { class: "TicketInfo" }, h("div", { class: "TicketGameName" }, translate('drawName', this.language), ": ", h("span", null, this.gameName)), h("div", { class: "TicketDate" }, translate('ticketPurchaseDate', this.language), ": ", h("span", null, this.ticketDate.slice(0, 10))), h("div", { class: "TicketStatus" }, translate('ticketStatus', this.language), ": ", h("span", null, this.ticketStatus))), h("div", { class: "DrawResultsBody" }, h("div", { class: "TicketIdContainer" }, h("p", null, translate('ticketId', this.language), ": ", h("span", null, this.ticketId))), h("div", { class: "TicketAmountContainer" }, h("p", null, translate('ticketAmount', this.language), " ", h("span", null, this.ticketAmount))), h("div", { class: "DrawNumbersGrid" }, h("p", null, translate('drawNumbersGridTicket', this.language), ":"), h("div", { class: "BulletContainer" }, h("lottery-grid", { "maximum-allowed": this.rules.maximumAllowed, "total-numbers": this.rules.totalNumbers, "selected-numbers": this.selection, selectable: false, "display-selected": true, language: this.language }))), h("div", { class: "DrawMultipler" }, h("label", { class: "Label" }, translate('winUpTo', this.language), " ", h("span", null, JSON.stringify(this.ticketMultiplier)))), h("div", { class: "NumberOfDrawsContainer" }, h("p", null, translate('numberOfDraws', this.language), ": ", this.ticketDrawCount), h("div", { class: "DrawTicketsContainer" }, this.drawResults.map((item, index) => h("div", { class: "ExpandableBoxes" }, h("div", { class: this.toggleDrawer[index] ? 'ExpandableBox ShowBox' : 'ExpandableBox', onClick: () => this.changeBox(index) }, h("div", { class: "TicketResultContainer" }, h("p", null, translate('ticketResult', this.language), ": ", item.status)), item.state == 'won' &&
|
|
178
|
+
h("div", { class: "AmountWonContainer" }, h("p", null, translate('amountWon', this.language), ": ", Number(item.amount).toLocaleString('en'), " ", item.currency)), h("div", { class: "DrawIdContainer" }, h("p", null, translate('drawId', this.language), ": ", item.drawId)), h("div", { class: "DrawDateContainer" }, h("p", null, translate('drawDate', this.language), ": ", item.updatedAt.slice(0, 10), " | ", item.updatedAt.slice(11, 19))), h("div", { class: "DrawNumbersGrid" }), h("div", { class: "DrawMultipler" }, h("label", { class: "Label" }, translate('winUpTo', this.language), " ", item.multiplier)))))))))
|
|
170
179
|
:
|
|
171
180
|
h("div", { class: "DrawResultsArea" }, this.drawData &&
|
|
172
|
-
h("div", null, h("div", { class: "DrawResultsHeader" }, h("span", null, translate('drawId', this.language), ": ", this.drawData.id), h("span", null, translate('drawDate', this.language), ": ", this.drawData.date.slice(0, 10))), h("div", { class: "DrawResultsBody" }, h("div", { class: "DrawNumbersGrid" }, h("p", null, translate('drawNumbersGridDraw', this.language), ":"), h("div", { class: "BulletContainer" }, h("lottery-grid", { "maximum-allowed": this.rules.maximumAllowed, "total-numbers": this.rules.totalNumbers, selectedNumbers: this.drawData.winningNumbers.join(','), "display-selected": true, selectable: false, language: this.language })), h("div", { class: "DrawMultipler" }, h("label", { class: "Label" }, "
|
|
181
|
+
h("div", null, h("div", { class: "DrawResultsHeader" }, h("span", null, translate('drawId', this.language), ": ", this.drawData.id), h("span", null, translate('drawDate', this.language), ": ", this.drawData.date.slice(0, 10))), h("div", { class: "DrawResultsBody" }, h("div", { class: "DrawNumbersGrid" }, h("p", null, translate('drawNumbersGridDraw', this.language), ":"), h("div", { class: "BulletContainer" }, h("lottery-grid", { "maximum-allowed": this.rules.maximumAllowed, "total-numbers": this.rules.totalNumbers, selectedNumbers: this.drawData.winningNumbers.join(','), "display-selected": true, selectable: false, language: this.language })), h("div", { class: "DrawMultipler" }, h("label", { class: "Label" }, translate('multiplier', this.language), " ", this.multiplier))))))));
|
|
173
182
|
}
|
|
174
183
|
}
|
|
175
184
|
static get style() { return lotteryDrawResultsCss; }
|
|
@@ -181,8 +190,13 @@ const LotteryDrawResults = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
|
|
|
181
190
|
"drawMode": [4, "draw-mode"],
|
|
182
191
|
"drawId": [1, "draw-id"],
|
|
183
192
|
"gameName": [1, "game-name"],
|
|
193
|
+
"ticketDate": [1, "ticket-date"],
|
|
194
|
+
"ticketStatus": [1, "ticket-status"],
|
|
195
|
+
"ticketId": [1, "ticket-id"],
|
|
196
|
+
"ticketAmount": [1, "ticket-amount"],
|
|
197
|
+
"ticketMultiplier": [4, "ticket-multiplier"],
|
|
198
|
+
"ticketDrawCount": [2, "ticket-draw-count"],
|
|
184
199
|
"multiplier": [32],
|
|
185
|
-
"ticketData": [32],
|
|
186
200
|
"isLoading": [32],
|
|
187
201
|
"drawResults": [32],
|
|
188
202
|
"rules": [32],
|