@everymatrix/lottery-game-page 0.0.6 → 0.0.9

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 (78) hide show
  1. package/dist/cjs/helper-accordion_13.cjs.entry.js +23492 -0
  2. package/dist/cjs/helper-pagination.cjs.entry.js +188 -0
  3. package/dist/cjs/index-81cb3b3b.js +1277 -0
  4. package/dist/cjs/index.cjs.js +2 -0
  5. package/dist/cjs/loader.cjs.js +21 -0
  6. package/dist/cjs/lottery-game-page.cjs.js +19 -0
  7. package/dist/collection/collection-manifest.json +86 -0
  8. package/dist/collection/components/lottery-game-page/lottery-game-page.css +305 -0
  9. package/dist/collection/components/lottery-game-page/lottery-game-page.js +496 -0
  10. package/dist/collection/index.js +1 -0
  11. package/dist/collection/utils/locale.utils.js +50 -0
  12. package/dist/collection/utils/utils.js +12 -0
  13. package/dist/components/assets/chrono_desktop.png +0 -0
  14. package/dist/components/assets/chrono_lottery_mobile.png +0 -0
  15. package/dist/components/helper-accordion.js +6 -0
  16. package/dist/components/helper-accordion2.js +110 -0
  17. package/dist/components/helper-filters.js +6 -0
  18. package/dist/components/helper-filters2.js +22347 -0
  19. package/dist/components/helper-modal.js +6 -0
  20. package/dist/components/helper-modal2.js +58 -0
  21. package/dist/components/helper-pagination.js +215 -0
  22. package/dist/components/helper-tab.js +6 -0
  23. package/dist/components/helper-tab2.js +47 -0
  24. package/dist/components/helper-tabs.js +6 -0
  25. package/dist/components/helper-tabs2.js +62 -0
  26. package/dist/components/index.d.ts +22 -0
  27. package/dist/components/index.js +15 -0
  28. package/dist/components/lottery-bullet.js +6 -0
  29. package/dist/components/lottery-bullet2.js +56 -0
  30. package/dist/components/lottery-draw-results-history.js +6 -0
  31. package/dist/components/lottery-draw-results-history2.js +174 -0
  32. package/dist/components/lottery-draw-results.js +6 -0
  33. package/dist/components/lottery-draw-results2.js +217 -0
  34. package/dist/components/lottery-game-details.js +6 -0
  35. package/dist/components/lottery-game-details2.js +48 -0
  36. package/dist/components/lottery-game-page.d.ts +11 -0
  37. package/dist/components/lottery-game-page.js +407 -0
  38. package/dist/components/lottery-grid.js +6 -0
  39. package/dist/components/lottery-grid2.js +196 -0
  40. package/dist/components/lottery-ticket-controller.js +6 -0
  41. package/dist/components/lottery-ticket-controller2.js +117 -0
  42. package/dist/components/lottery-ticket.js +6 -0
  43. package/dist/components/lottery-ticket2.js +183 -0
  44. package/dist/esm/helper-accordion_13.entry.js +23476 -0
  45. package/dist/esm/helper-pagination.entry.js +184 -0
  46. package/dist/esm/index-be84da79.js +1250 -0
  47. package/dist/esm/index.js +1 -0
  48. package/dist/esm/loader.js +17 -0
  49. package/dist/esm/lottery-game-page.js +17 -0
  50. package/dist/esm/polyfills/core-js.js +11 -0
  51. package/dist/esm/polyfills/css-shim.js +1 -0
  52. package/dist/esm/polyfills/dom.js +79 -0
  53. package/dist/esm/polyfills/es5-html-element.js +1 -0
  54. package/dist/esm/polyfills/index.js +34 -0
  55. package/dist/esm/polyfills/system.js +6 -0
  56. package/dist/index.cjs.js +1 -0
  57. package/dist/index.js +1 -0
  58. package/dist/lottery-game-page/index.esm.js +0 -0
  59. package/dist/lottery-game-page/lottery-game-page.esm.js +1 -0
  60. package/dist/lottery-game-page/p-08581ede.entry.js +1 -0
  61. package/dist/lottery-game-page/p-49bd2864.entry.js +2849 -0
  62. package/dist/lottery-game-page/p-91420518.js +2 -0
  63. package/dist/stencil.config.js +29 -0
  64. package/dist/types/Users/user/workspace/everymatrix/widgets-stencil/packages/lottery-game-page/.stencil/packages/lottery-game-page/stencil.config.d.ts +2 -0
  65. package/dist/types/components/lottery-game-page/lottery-game-page.d.ts +74 -0
  66. package/dist/types/components.d.ts +93 -0
  67. package/dist/types/index.d.ts +1 -0
  68. package/dist/types/stencil-public-runtime.d.ts +1565 -0
  69. package/dist/types/utils/locale.utils.d.ts +1 -0
  70. package/dist/types/utils/utils.d.ts +7 -0
  71. package/loader/cdn.js +3 -0
  72. package/loader/index.cjs.js +3 -0
  73. package/loader/index.d.ts +12 -0
  74. package/loader/index.es2017.js +3 -0
  75. package/loader/index.js +4 -0
  76. package/loader/package.json +10 -0
  77. package/package.json +1 -1
  78. package/LICENSE +0 -21
@@ -0,0 +1,174 @@
1
+ import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
+ import { d as defineCustomElement$5 } from './helper-filters2.js';
3
+ import { d as defineCustomElement$4 } from './helper-modal2.js';
4
+ import { d as defineCustomElement$3 } from './lottery-bullet2.js';
5
+ import { d as defineCustomElement$2 } from './lottery-draw-results2.js';
6
+ import { d as defineCustomElement$1 } from './lottery-grid2.js';
7
+
8
+ const DEFAULT_LANGUAGE = 'en';
9
+ const SUPPORTED_LANGUAGES = ['ro', 'en'];
10
+ const TRANSLATIONS = {
11
+ en: {
12
+ drawResultsHeader: 'Draw results history',
13
+ drawId: 'Draw ID',
14
+ drawDate: 'Draw Date',
15
+ drawNumbersGridA: 'Draw numbers Grid A',
16
+ viewAllResults: 'View All',
17
+ lastFiveDraws: 'Last 5 Draws',
18
+ lastTenDraws: 'Last 10 Draws',
19
+ lastFifteenDraws: 'Last 15 Draws'
20
+ },
21
+ ro: {
22
+ drawResultsHeader: 'Draw results history',
23
+ drawId: 'Draw ID',
24
+ drawDate: 'Draw Date',
25
+ drawNumbersGridA: 'Draw numbers Grid A',
26
+ viewAllResults: 'View All',
27
+ lastFiveDraws: 'Last 5 Draws',
28
+ lastTenDraws: 'Last 10 Draws',
29
+ lastFifteenDraws: 'Last 15 Draws'
30
+ },
31
+ };
32
+ const translate = (key, customLang) => {
33
+ const lang = customLang;
34
+ return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
35
+ };
36
+
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:500px;margin:0 auto}.HistoryGridWrapper{padding:0 15px}.HistoryGrid{border:1px solid #009993;border-radius:5px}.DrawResultsHeader{color:#009993;padding:15px;text-align:center}.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:10px 0 25px}.FilterSection .FilterResultsContainer{display:flex;gap:5px}.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
+
39
+ const LotteryDrawResultsHistory = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
40
+ constructor() {
41
+ super();
42
+ this.__registerHost();
43
+ this.__attachShadow();
44
+ /**
45
+ * The number of results to be displayed
46
+ */
47
+ this.numberOfResults = 3;
48
+ /**
49
+ *Language
50
+ */
51
+ this.language = 'en';
52
+ this.drawData = [];
53
+ this.displayAllDrawsResults = true;
54
+ this.showQuickFilters = true;
55
+ this.winningDataSetsData = [''];
56
+ this.getDrawsData = () => {
57
+ let url = new URL(`${this.endpoint}/games/${this.gameId}`);
58
+ fetch(url.href)
59
+ .then((res) => {
60
+ if (res.status >= 300) {
61
+ throw new Error('There was an error while fetching the data');
62
+ }
63
+ return res.json();
64
+ })
65
+ .then((data) => {
66
+ console.log("getDrawsData ", data);
67
+ // filter out incomplete data sets for draws
68
+ this.winningDataSetsData = data.draws.filter(draw => draw.winningNumbers);
69
+ this.drawData = this.winningDataSetsData;
70
+ console.log('this.drawData', this.drawData);
71
+ });
72
+ };
73
+ this.filterResults = (resultsNumber) => {
74
+ this.numberOfResults = resultsNumber;
75
+ this.displayAllDrawsResults = true;
76
+ };
77
+ this.getDrawResults = (drawID) => {
78
+ let url = new URL(`${this.endpoint}/games/${this.gameId}/draws/${drawID}`);
79
+ let drawOptions = {
80
+ method: "GET",
81
+ headers: {
82
+ 'Content-Type': "application/json",
83
+ 'Accept': 'application/json',
84
+ },
85
+ };
86
+ fetch(url.href, drawOptions)
87
+ .then((response) => {
88
+ return response.json();
89
+ })
90
+ .then((data) => {
91
+ console.log("getDrawResults ", data);
92
+ this.drawData = [data];
93
+ });
94
+ };
95
+ this.viewAllResults = () => {
96
+ this.numberOfResults = this.drawData.length;
97
+ this.displayAllDrawsResults = false;
98
+ window.scrollTo({ top: 0, behavior: 'smooth' });
99
+ };
100
+ }
101
+ // Filters events
102
+ filtersHandler(event) {
103
+ var _a;
104
+ this.getDrawResults((_a = event.detail) === null || _a === void 0 ? void 0 : _a.drawTicketId);
105
+ this.showQuickFilters = false;
106
+ }
107
+ clearFiltersHandler() {
108
+ this.drawData = this.winningDataSetsData;
109
+ this.showQuickFilters = true;
110
+ }
111
+ connectedCallback() {
112
+ this.getDrawsData();
113
+ }
114
+ disconnectedCallback() {
115
+ clearInterval(this.interval);
116
+ }
117
+ render() {
118
+ 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
+ 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": "3797", "player-id": "2323" })), h("h4", null, "All draws results history")));
121
+ let gridContent = h("div", { class: "HistoryGridWrapper" }, h("div", { class: "HistoryGrid" }, 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)));
122
+ return h("section", { class: "GridWrapper" }, h("div", { class: "DrawResultsSection" }, h("div", { class: "DrawResultsArea" }, gridHeader, gridContent, this.displayAllDrawsResults && h("button", { class: "ViewAllResults", onClick: this.viewAllResults }, "View All"))));
123
+ }
124
+ static get style() { return lotteryDrawResultsHistoryCss; }
125
+ }, [1, "lottery-draw-results-history", {
126
+ "endpoint": [1],
127
+ "gameId": [1, "game-id"],
128
+ "numberOfResults": [2, "number-of-results"],
129
+ "language": [1],
130
+ "drawData": [32],
131
+ "displayAllDrawsResults": [32],
132
+ "showQuickFilters": [32],
133
+ "winningDataSetsData": [32]
134
+ }, [[0, "filterSelection", "filtersHandler"], [0, "filterSelectionReset", "clearFiltersHandler"]]]);
135
+ function defineCustomElement() {
136
+ if (typeof customElements === "undefined") {
137
+ return;
138
+ }
139
+ const components = ["lottery-draw-results-history", "helper-filters", "helper-modal", "lottery-bullet", "lottery-draw-results", "lottery-grid"];
140
+ components.forEach(tagName => { switch (tagName) {
141
+ case "lottery-draw-results-history":
142
+ if (!customElements.get(tagName)) {
143
+ customElements.define(tagName, LotteryDrawResultsHistory);
144
+ }
145
+ break;
146
+ case "helper-filters":
147
+ if (!customElements.get(tagName)) {
148
+ defineCustomElement$5();
149
+ }
150
+ break;
151
+ case "helper-modal":
152
+ if (!customElements.get(tagName)) {
153
+ defineCustomElement$4();
154
+ }
155
+ break;
156
+ case "lottery-bullet":
157
+ if (!customElements.get(tagName)) {
158
+ defineCustomElement$3();
159
+ }
160
+ break;
161
+ case "lottery-draw-results":
162
+ if (!customElements.get(tagName)) {
163
+ defineCustomElement$2();
164
+ }
165
+ break;
166
+ case "lottery-grid":
167
+ if (!customElements.get(tagName)) {
168
+ defineCustomElement$1();
169
+ }
170
+ break;
171
+ } });
172
+ }
173
+
174
+ export { LotteryDrawResultsHistory as L, defineCustomElement as d };
@@ -0,0 +1,6 @@
1
+ import { L as LotteryDrawResults$1, d as defineCustomElement$1 } from './lottery-draw-results2.js';
2
+
3
+ const LotteryDrawResults = LotteryDrawResults$1;
4
+ const defineCustomElement = defineCustomElement$1;
5
+
6
+ export { LotteryDrawResults, defineCustomElement };
@@ -0,0 +1,217 @@
1
+ import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
+ import { d as defineCustomElement$2 } from './lottery-bullet2.js';
3
+ import { d as defineCustomElement$1 } from './lottery-grid2.js';
4
+
5
+ const DEFAULT_LANGUAGE = 'en';
6
+ const SUPPORTED_LANGUAGES = ['ro', 'en'];
7
+ const TRANSLATIONS = {
8
+ en: {
9
+ drawResultsHeader: 'Last draw results',
10
+ drawId: 'Draw ID',
11
+ drawName: 'Game name',
12
+ drawDate: 'Draw Date',
13
+ drawNumbersGridDraw: 'Draw numbers Grid A',
14
+ drawNumbersGridTicket: 'Draw numbers Grid B',
15
+ ticketResult: 'Ticket result',
16
+ amountWon: 'Amount won',
17
+ numberOfDraws: 'Number of draws'
18
+ },
19
+ ro: {
20
+ drawResultsHeader: 'Ultimele rezultate extragere',
21
+ drawId: 'Id extragere',
22
+ drawName: 'Numele jocului',
23
+ drawDate: 'Data extragerii',
24
+ drawNumbersGridDraw: 'Numerele extrase Grid A',
25
+ drawNumbersGridTicket: 'Numerele extrase Grid B',
26
+ ticketResult: 'Rezultatul biletului',
27
+ amountWon: 'Suma castigata',
28
+ numberOfDraws: 'Numarul de extrageri'
29
+ },
30
+ };
31
+ const translate = (key, customLang) => {
32
+ const lang = customLang;
33
+ return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
34
+ };
35
+
36
+ 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:500px;margin:0 auto;margin:0px auto 10px;border-radius:4px}.DrawResultsHeader{display:flex;justify-content:space-between;padding:10px 20px;background-color:#009993;color:#fff;font-size:14px}.DrawResultsHeader h4{text-transform:uppercase;font-weight:400;margin:0}.DrawMultipler label{display:block;margin:15px 0}.DrawResultsBody{padding:0 20px}.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{width:100%;height:100%;max-height:100px;float:left;margin:0 0 20px 0;border:1px solid #009993;border-radius:4px;padding:10px;box-sizing:border-box;-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}.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
+
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
+ const LotteryDrawResults = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
53
+ constructor() {
54
+ super();
55
+ this.__registerHost();
56
+ this.__attachShadow();
57
+ /**
58
+ * Language of the widget
59
+ */
60
+ this.language = 'en';
61
+ /**
62
+ * Shows only the last draw
63
+ */
64
+ this.drawMode = false;
65
+ this.gameName = '';
66
+ this.multiplier = 5.434;
67
+ this.ticketData = {};
68
+ this.isLoading = true;
69
+ this.drawResults = [];
70
+ this.rules = {};
71
+ this.toggleDrawer = [false];
72
+ this.hasErrors = false;
73
+ this.errorText = '';
74
+ this.changeBox = (index) => {
75
+ this.toggleDrawer = this.toggleDrawer.map((item, itemIndex) => {
76
+ if (itemIndex == index) {
77
+ return !item;
78
+ }
79
+ return item;
80
+ });
81
+ if (index >= this.toggleDrawer.length) {
82
+ this.toggleDrawer.push(true);
83
+ }
84
+ };
85
+ }
86
+ connectedCallback() {
87
+ let promises = [];
88
+ promises.push(this.getGameData());
89
+ if (this.playerId) {
90
+ promises.push(this.getTicketData());
91
+ }
92
+ if (this.drawId) {
93
+ promises.push(this.getDrawData());
94
+ }
95
+ Promise.all(promises)
96
+ .then(() => {
97
+ this.isLoading = false;
98
+ });
99
+ }
100
+ getDrawData() {
101
+ return new Promise((resolve, reject) => {
102
+ let url = new URL(`${this.endpoint}/games/${this.gameId}/draws/${this.drawId}`);
103
+ fetch(url.href)
104
+ .then((response) => {
105
+ // @TODO EXCEPTIONS
106
+ return response.json();
107
+ })
108
+ .then((data) => {
109
+ this.drawData = data;
110
+ resolve(true);
111
+ })
112
+ .catch((err) => {
113
+ reject(err);
114
+ });
115
+ });
116
+ }
117
+ getGameData() {
118
+ return new Promise((resolve, reject) => {
119
+ let url = new URL(`${this.endpoint}/games/${this.gameId}`);
120
+ fetch(url.href)
121
+ .then((response) => {
122
+ return response.json();
123
+ })
124
+ .then((data) => {
125
+ this.rules = {
126
+ maximumAllowed: data.rules.boards[0].maximumAllowed,
127
+ totalNumbers: data.rules.boards[0].totalNumbers
128
+ };
129
+ resolve(true);
130
+ })
131
+ .catch((err) => {
132
+ this.isLoading = false;
133
+ this.hasErrors = true;
134
+ this.errorText = err;
135
+ reject(err);
136
+ });
137
+ });
138
+ }
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
+ render() {
158
+ var _a, _b, _c, _d, _e, _f;
159
+ if (this.isLoading) {
160
+ return (h("p", null, "Loading, please wait ..."));
161
+ }
162
+ else if (this.hasErrors) {
163
+ h("p", null, this.errorText);
164
+ }
165
+ else {
166
+ 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" }, "Ticket Purchase Date: ", h("span", null, (_a = this.ticketData) === null || _a === void 0 ? void 0 : _a.createdAt.slice(0, 10))), h("div", { class: "TicketStatus" }, "Status: ", h("span", null, (_b = this.ticketData) === null || _b === void 0 ? void 0 : _b.state))), h("div", { class: "DrawResultsBody" }, h("div", { class: "TicketIdContainer" }, h("p", null, "Ticket id: ", h("span", null, (_c = this.ticketData) === null || _c === void 0 ? void 0 : _c.id))), h("div", { class: "TicketAmountContainer" }, h("p", null, "Ticket amount: ", h("span", null, (_d = this.ticketData) === null || _d === void 0 ? void 0 : _d.amount))), 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" }, "Multiplier: ", h("span", null, JSON.stringify((_e = this.ticketData) === null || _e === void 0 ? void 0 : _e.multiplier)))), h("div", { class: "NumberOfDrawsContainer" }, h("p", null, translate('numberOfDraws', this.language), ": ", (_f = this.ticketData) === null || _f === void 0 ? void 0 :
168
+ _f.drawCount), 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' &&
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)))))))))
170
+ :
171
+ 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" }, "Multiplier: ", this.multiplier))))))));
173
+ }
174
+ }
175
+ static get style() { return lotteryDrawResultsCss; }
176
+ }, [1, "lottery-draw-results", {
177
+ "endpoint": [1],
178
+ "gameId": [1, "game-id"],
179
+ "language": [1],
180
+ "playerId": [1, "player-id"],
181
+ "drawMode": [4, "draw-mode"],
182
+ "drawId": [1, "draw-id"],
183
+ "gameName": [1, "game-name"],
184
+ "multiplier": [32],
185
+ "ticketData": [32],
186
+ "isLoading": [32],
187
+ "drawResults": [32],
188
+ "rules": [32],
189
+ "toggleDrawer": [32],
190
+ "hasErrors": [32],
191
+ "errorText": [32]
192
+ }]);
193
+ function defineCustomElement() {
194
+ if (typeof customElements === "undefined") {
195
+ return;
196
+ }
197
+ const components = ["lottery-draw-results", "lottery-bullet", "lottery-grid"];
198
+ components.forEach(tagName => { switch (tagName) {
199
+ case "lottery-draw-results":
200
+ if (!customElements.get(tagName)) {
201
+ customElements.define(tagName, LotteryDrawResults);
202
+ }
203
+ break;
204
+ case "lottery-bullet":
205
+ if (!customElements.get(tagName)) {
206
+ defineCustomElement$2();
207
+ }
208
+ break;
209
+ case "lottery-grid":
210
+ if (!customElements.get(tagName)) {
211
+ defineCustomElement$1();
212
+ }
213
+ break;
214
+ } });
215
+ }
216
+
217
+ export { LotteryDrawResults as L, defineCustomElement as d };
@@ -0,0 +1,6 @@
1
+ import { L as LotteryGameDetails$1, d as defineCustomElement$1 } from './lottery-game-details2.js';
2
+
3
+ const LotteryGameDetails = LotteryGameDetails$1;
4
+ const defineCustomElement = defineCustomElement$1;
5
+
6
+ export { LotteryGameDetails, defineCustomElement };
@@ -0,0 +1,48 @@
1
+ import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
+ import { d as defineCustomElement$3 } from './helper-accordion2.js';
3
+ import { d as defineCustomElement$2 } from './helper-tab2.js';
4
+ import { d as defineCustomElement$1 } from './helper-tabs2.js';
5
+
6
+ const lotteryGameDetailsCss = ":host{display:block}";
7
+
8
+ const LotteryGameDetails = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
9
+ constructor() {
10
+ super();
11
+ this.__registerHost();
12
+ this.__attachShadow();
13
+ }
14
+ render() {
15
+ return (h("div", null, h("helper-accordion", { "header-title": "Game Details", collapsed: false }, h("div", { slot: "accordionContent" }, h("helper-tabs", null)))));
16
+ }
17
+ static get style() { return lotteryGameDetailsCss; }
18
+ }, [1, "lottery-game-details"]);
19
+ function defineCustomElement() {
20
+ if (typeof customElements === "undefined") {
21
+ return;
22
+ }
23
+ const components = ["lottery-game-details", "helper-accordion", "helper-tab", "helper-tabs"];
24
+ components.forEach(tagName => { switch (tagName) {
25
+ case "lottery-game-details":
26
+ if (!customElements.get(tagName)) {
27
+ customElements.define(tagName, LotteryGameDetails);
28
+ }
29
+ break;
30
+ case "helper-accordion":
31
+ if (!customElements.get(tagName)) {
32
+ defineCustomElement$3();
33
+ }
34
+ break;
35
+ case "helper-tab":
36
+ if (!customElements.get(tagName)) {
37
+ defineCustomElement$2();
38
+ }
39
+ break;
40
+ case "helper-tabs":
41
+ if (!customElements.get(tagName)) {
42
+ defineCustomElement$1();
43
+ }
44
+ break;
45
+ } });
46
+ }
47
+
48
+ export { LotteryGameDetails as L, defineCustomElement as d };
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface LotteryGamePage extends Components.LotteryGamePage, HTMLElement {}
4
+ export const LotteryGamePage: {
5
+ prototype: LotteryGamePage;
6
+ new (): LotteryGamePage;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;