@everymatrix/lottery-game-page 0.1.20 → 0.1.21

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 (54) hide show
  1. package/dist/cjs/helper-accordion.cjs.entry.js +6 -0
  2. package/dist/cjs/helper-filters_2.cjs.entry.js +60 -0
  3. package/dist/cjs/helper-pagination.cjs.entry.js +12 -0
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/lottery-bullet_2.cjs.entry.js +37 -1
  6. package/dist/cjs/lottery-draw-results-history.cjs.entry.js +75 -12
  7. package/dist/cjs/lottery-game-details.cjs.entry.js +33 -1
  8. package/dist/cjs/lottery-game-page.cjs.entry.js +26 -3
  9. package/dist/cjs/lottery-game-page.cjs.js +1 -1
  10. package/dist/cjs/lottery-ticket-controller.cjs.entry.js +54 -1
  11. package/dist/cjs/lottery-ticket.cjs.entry.js +54 -2
  12. package/dist/collection/utils/locale.utils.js +26 -3
  13. package/dist/components/helper-accordion2.js +6 -0
  14. package/dist/components/helper-filters2.js +26 -0
  15. package/dist/components/helper-pagination.js +12 -0
  16. package/dist/components/lottery-draw-results-history2.js +80 -14
  17. package/dist/components/lottery-draw-results2.js +34 -0
  18. package/dist/components/lottery-game-details2.js +38 -2
  19. package/dist/components/lottery-game-page.js +26 -3
  20. package/dist/components/lottery-grid2.js +42 -2
  21. package/dist/components/lottery-ticket-controller2.js +58 -2
  22. package/dist/components/lottery-ticket2.js +58 -3
  23. package/dist/esm/helper-accordion.entry.js +6 -0
  24. package/dist/esm/helper-filters_2.entry.js +60 -0
  25. package/dist/esm/helper-pagination.entry.js +12 -0
  26. package/dist/esm/loader.js +1 -1
  27. package/dist/esm/lottery-bullet_2.entry.js +37 -1
  28. package/dist/esm/lottery-draw-results-history.entry.js +75 -12
  29. package/dist/esm/lottery-game-details.entry.js +33 -1
  30. package/dist/esm/lottery-game-page.entry.js +26 -3
  31. package/dist/esm/lottery-game-page.js +1 -1
  32. package/dist/esm/lottery-ticket-controller.entry.js +54 -1
  33. package/dist/esm/lottery-ticket.entry.js +54 -2
  34. package/dist/lottery-game-page/lottery-game-page.esm.js +1 -1
  35. package/dist/lottery-game-page/p-01132729.entry.js +1 -0
  36. package/dist/lottery-game-page/p-4098d6d4.entry.js +1 -0
  37. package/dist/lottery-game-page/p-75703176.entry.js +1 -0
  38. package/dist/lottery-game-page/p-807dda48.entry.js +1 -0
  39. package/dist/lottery-game-page/p-97048566.entry.js +1 -0
  40. package/dist/lottery-game-page/p-a21ecd5f.entry.js +1 -0
  41. package/dist/lottery-game-page/p-b44e49d7.entry.js +1 -0
  42. package/dist/lottery-game-page/{p-90003eb8.entry.js → p-d1d09322.entry.js} +50 -50
  43. package/dist/lottery-game-page/p-d91fc066.entry.js +1 -0
  44. package/dist/types/Users/dragos.bodea/Documents/everymatrix-prjs/stencil/widgets-stencil/packages/lottery-game-page/.stencil/packages/lottery-game-page/stencil.config.d.ts +2 -0
  45. package/package.json +1 -1
  46. package/dist/lottery-game-page/p-13d0f256.entry.js +0 -1
  47. package/dist/lottery-game-page/p-63781a10.entry.js +0 -1
  48. package/dist/lottery-game-page/p-87298564.entry.js +0 -1
  49. package/dist/lottery-game-page/p-b49e741d.entry.js +0 -1
  50. package/dist/lottery-game-page/p-bb028d40.entry.js +0 -1
  51. package/dist/lottery-game-page/p-c0e7c864.entry.js +0 -1
  52. package/dist/lottery-game-page/p-d241f927.entry.js +0 -1
  53. package/dist/lottery-game-page/p-f9740035.entry.js +0 -1
  54. package/dist/types/Users/user/workspace/everymatrix/widgets-stencil/packages/lottery-game-page/.stencil/packages/lottery-game-page/stencil.config.d.ts +0 -2
@@ -27,6 +27,26 @@ const TRANSLATIONS = {
27
27
  resetButton: 'Reseteaza',
28
28
  autoButton: 'Ma simt norocos'
29
29
  },
30
+ fr: {
31
+ loading: 'Loading, please wait ...',
32
+ error: 'It was an error while trying to fetch the data',
33
+ grid: 'Grid',
34
+ multiplier: 'Multiplier',
35
+ numberOfDraws: 'Number of draws',
36
+ wagerPerDraw: 'Wager per draw',
37
+ resetButton: 'Reset',
38
+ autoButton: 'I feel lucky'
39
+ },
40
+ ar: {
41
+ loading: 'Loading, please wait ...',
42
+ error: 'It was an error while trying to fetch the data',
43
+ grid: 'Grid',
44
+ multiplier: 'Multiplier',
45
+ numberOfDraws: 'Number of draws',
46
+ wagerPerDraw: 'Wager per draw',
47
+ resetButton: 'Reset',
48
+ autoButton: 'I feel lucky'
49
+ }
30
50
  };
31
51
  const translate = (key, customLang) => {
32
52
  const lang = customLang;
@@ -63,6 +83,14 @@ const LotteryTicket = class {
63
83
  * Language
64
84
  */
65
85
  this.language = 'en';
86
+ /**
87
+ * Client custom styling via string
88
+ */
89
+ this.clientStyling = '';
90
+ /**
91
+ * Client custom styling via url content
92
+ */
93
+ this.clientStylingUrlContent = '';
66
94
  this.multiplier = false;
67
95
  this.numberOfDraws = 1;
68
96
  this.isLoading = true;
@@ -70,6 +98,19 @@ const LotteryTicket = class {
70
98
  this.ticketDone = false;
71
99
  this.isCustomSelect = false;
72
100
  this.amountInfo = {};
101
+ this.limitStylingAppends = false;
102
+ this.setClientStyling = () => {
103
+ let sheet = document.createElement('style');
104
+ sheet.innerHTML = this.clientStyling;
105
+ this.stylingContainer.prepend(sheet);
106
+ };
107
+ this.setClientStylingURL = () => {
108
+ let cssFile = document.createElement('style');
109
+ setTimeout(() => {
110
+ cssFile.innerHTML = this.clientStylingUrlContent;
111
+ this.stylingContainer.prepend(cssFile);
112
+ }, 1);
113
+ };
73
114
  }
74
115
  /**
75
116
  * @TODO find a better way to implement click outside the custom select, so that we don't have to use the 'data-cluster' attribute on each element
@@ -103,6 +144,17 @@ const LotteryTicket = class {
103
144
  console.error('Error!', err);
104
145
  });
105
146
  }
147
+ componentDidRender() {
148
+ // start custom styling area
149
+ if (!this.limitStylingAppends && this.stylingContainer) {
150
+ if (this.clientStyling)
151
+ this.setClientStyling();
152
+ if (this.clientStylingUrlContent)
153
+ this.setClientStylingURL();
154
+ this.limitStylingAppends = true;
155
+ }
156
+ // end custom styling area
157
+ }
106
158
  multiplierChangeHandler(e) {
107
159
  this.multiplier = e.target ? e.target.checked : false;
108
160
  this.multiplierChange.emit(this.multiplier);
@@ -151,9 +203,9 @@ const LotteryTicket = class {
151
203
  }
152
204
  else {
153
205
  const { rules } = this.gameData;
154
- return (index.h("div", { class: "TicketContainer" }, index.h("p", { class: "TicketTitle" }, this.gameData.name), this.resetButton && this.ticketDone &&
206
+ return (index.h("div", { class: "TicketContainer", ref: el => this.stylingContainer = el }, index.h("p", { class: "TicketTitle" }, this.gameData.name), this.resetButton && this.ticketDone &&
155
207
  index.h("div", { class: "ButtonContainer" }, index.h("a", { class: "ResetButton", onClick: () => this.toggleResetSelection() }, translate('resetButton', this.language))), this.autoPick && !this.ticketDone &&
156
- index.h("div", { class: "ButtonContainer" }, index.h("a", { class: "AutoButton", onClick: () => this.toggleAutoSelection() }, translate('autoButton', this.language))), this.grids.map((item, index$1) => index.h("div", { class: "TicketGridBullets" }, index.h("p", { class: "TicketGridTitle" }, translate('grid', this.language), " ", item), index.h("lottery-grid", { "grid-index": index$1, "maximum-allowed": rules.boards[index$1].maximumAllowed, "minimum-allowed": rules.boards[index$1].minimumAllowed, "total-numbers": rules.boards[index$1].totalNumbers, selectable: true, "reset-button": true, "auto-pick": true, "game-id": this.gameId, "ticket-id": this.ticketId, language: this.language }))), rules.multiplier &&
208
+ index.h("div", { class: "ButtonContainer" }, index.h("a", { class: "AutoButton", onClick: () => this.toggleAutoSelection() }, translate('autoButton', this.language))), this.grids.map((item, index$1) => index.h("div", { class: "TicketGridBullets" }, index.h("p", { class: "TicketGridTitle" }, translate('grid', this.language), " ", item), index.h("lottery-grid", { "grid-index": index$1, "maximum-allowed": rules.boards[index$1].maximumAllowed, "minimum-allowed": rules.boards[index$1].minimumAllowed, "total-numbers": rules.boards[index$1].totalNumbers, selectable: true, "reset-button": true, "auto-pick": true, "game-id": this.gameId, "ticket-id": this.ticketId, language: this.language, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }))), rules.multiplier &&
157
209
  index.h("div", null, index.h("label", { class: "Toggle" }, index.h("label", { class: "Label" }, translate('multiplier', this.language), ": "), index.h("input", { class: "ToggleCheckbox", type: "checkbox", onInput: (e) => this.multiplierChangeHandler(e) }), index.h("div", { class: "ToggleSwitch" }))), this.multipleDraws &&
158
210
  index.h("div", { class: "TicketDraws" }, index.h("label", { class: "Label" }, translate('numberOfDraws', this.language), ": "), index.h("div", { class: "NumberInput" }, index.h("button", { onClick: () => this.numberOfDraws > 1 ? this.numberOfDraws-- : this.numberOfDraws = 1, class: "Minus" }, "-"), index.h("input", { class: "InputDefault", min: "1", value: this.numberOfDraws, type: "number" }), index.h("button", { onClick: () => this.numberOfDraws++, class: "Plus" }, "+"))), index.h("div", null, index.h("label", { class: "Label" }, translate('wagerPerDraw', this.language), ": "), index.h("div", { class: "WagerInput" }, rules.stakes.length > 1 ?
159
211
  (index.h("div", { "data-cluster": "SelectComponent", class: this.isCustomSelect ? "SelectWrapper SelectActive" : "SelectWrapper" }, index.h("div", { "data-cluster": "SelectComponent", class: "SelectButton", onClick: () => this.toggleClass() }, index.h("span", { "data-cluster": "SelectComponent" }, this.amountInfo.amount, " ", this.amountInfo.currency), index.h("span", { "data-cluster": "SelectComponent", class: "SelectExpand" }, "\u25BC")), index.h("div", { "data-cluster": "SelectComponent", class: "SelectContent" }, index.h("ul", { "data-cluster": "SelectComponent", class: "SelectOptions" }, rules.stakes.map((item) => index.h("li", { "data-cluster": "SelectComponent", class: this.amountInfo.amount == item.amount ? 'SelectedValue' : '', value: item.amount, onClick: () => this.setDropdownItem(item) }, item.amount, " ", item.currency)))))) : (index.h("div", null, index.h("input", { min: "1", value: rules.stakes[0].amount, type: "number", disabled: true }), index.h("p", { class: "WagerInputTitle" }, rules.stakes[0].currency)))))));
@@ -1,5 +1,5 @@
1
1
  const DEFAULT_LANGUAGE = 'en';
2
- const SUPPORTED_LANGUAGES = ['ro', 'en', 'ar'];
2
+ const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'ar'];
3
3
  const TRANSLATIONS = {
4
4
  en: {
5
5
  error: 'Error',
@@ -47,6 +47,29 @@ const TRANSLATIONS = {
47
47
  lastDrawResultsTitle: 'Cele mai recente extrageri',
48
48
  modalLogin: 'Please login to submit a ticket',
49
49
  },
50
+ fr: {
51
+ error: 'Error',
52
+ title: 'Chrono',
53
+ backButton: 'Back',
54
+ lobbyButton: 'Lobby',
55
+ prize: 'Prize',
56
+ winUpTo: 'Win up to',
57
+ nextDraw: 'Next draw in: ',
58
+ buy: 'Buy tickets',
59
+ viewLatest: 'View latest results',
60
+ createTicket: 'Create Ticket',
61
+ modalSuccess: 'Purchase successfully completed!',
62
+ deleteTicketModalTitle: 'Delete Ticket',
63
+ deleteTicketModalText: 'Are you sure you want to delete this ticket?',
64
+ deleteTicketModalCancel: 'Cancel',
65
+ deleteTicketModalConfirm: 'Delete',
66
+ orderSummaryTitle: 'Order Summary',
67
+ orderSummaryTickets: 'Ticket',
68
+ orderSummaryTotal: 'Total',
69
+ orderSummarySubmit: 'Submit',
70
+ lastDrawResultsTitle: 'Résultats du dernier tirage',
71
+ modalLogin: 'Please login to submit a ticket',
72
+ },
50
73
  ar: {
51
74
  error: 'خطأ',
52
75
  title: 'كرونو',
@@ -67,9 +90,9 @@ const TRANSLATIONS = {
67
90
  orderSummaryTickets: 'تذكرة',
68
91
  orderSummaryTotal: 'المجموع',
69
92
  orderSummarySubmit: 'يُقدِّم',
70
- lastDrawResultsTitle: 'Cele mai recente extrageri',
93
+ lastDrawResultsTitle: 'نتائج آخر سحب',
71
94
  modalLogin: 'الرجاء تسجيل الدخول لتقديم تذكرة'
72
- },
95
+ }
73
96
  };
74
97
  export const translate = (key, customLang) => {
75
98
  const lang = customLang;
@@ -9,6 +9,12 @@ const TRANSLATIONS = {
9
9
  ro: {
10
10
  deleteTicket: 'Sterge biletul'
11
11
  },
12
+ fr: {
13
+ deleteTicket: 'Supprimer le billet'
14
+ },
15
+ ar: {
16
+ deleteTicket: 'حذف التذكرة'
17
+ }
12
18
  };
13
19
  const translate = (key, customLang) => {
14
20
  const lang = customLang;
@@ -28,6 +28,32 @@ const TRANSLATIONS = {
28
28
  filterModalButton: 'Cauta',
29
29
  filterOrDate: 'sau cauta dupa data'
30
30
  },
31
+ fr: {
32
+ filterOpen: 'Filter',
33
+ filterClear: 'Clear',
34
+ filterModalTicketTitle: 'Ticket Results',
35
+ filterModalDrawTitle: 'Draws Results History',
36
+ filterTicketPlaceholder: 'Search for a ticket ID',
37
+ filterDrawPlaceholder: 'Search for a draw ID',
38
+ filterDateRangePlaceholder: 'Date Range',
39
+ filterModalButton: 'Search',
40
+ filterFromCalendar: 'From',
41
+ filterToCalendar: 'To',
42
+ filterOrDate: 'or search by date'
43
+ },
44
+ ar: {
45
+ filterOpen: 'Filter',
46
+ filterClear: 'Clear',
47
+ filterModalTicketTitle: 'Ticket Results',
48
+ filterModalDrawTitle: 'Draws Results History',
49
+ filterTicketPlaceholder: 'Search for a ticket ID',
50
+ filterDrawPlaceholder: 'Search for a draw ID',
51
+ filterDateRangePlaceholder: 'Date Range',
52
+ filterModalButton: 'Search',
53
+ filterFromCalendar: 'From',
54
+ filterToCalendar: 'To',
55
+ filterOrDate: 'or search by date'
56
+ }
31
57
  };
32
58
  const translate$1 = (key, customLang) => {
33
59
  const lang = customLang;
@@ -28,6 +28,18 @@ const TRANSLATIONS = {
28
28
  nextPage: 'Urmatoarea',
29
29
  lastPage: 'Ultima'
30
30
  },
31
+ fr: {
32
+ firstPage: 'First',
33
+ previousPage: 'Previous',
34
+ nextPage: 'Next',
35
+ lastPage: 'Last'
36
+ },
37
+ ar: {
38
+ firstPage: 'First',
39
+ previousPage: 'Previous',
40
+ nextPage: 'Next',
41
+ lastPage: 'Last'
42
+ }
31
43
  };
32
44
  const translate = (key, customLang) => {
33
45
  const lang = customLang;
@@ -6,7 +6,7 @@ import { d as defineCustomElement$2 } from './lottery-draw-results2.js';
6
6
  import { d as defineCustomElement$1 } from './lottery-grid2.js';
7
7
 
8
8
  const DEFAULT_LANGUAGE = 'en';
9
- const SUPPORTED_LANGUAGES = ['ro', 'en'];
9
+ const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'ar'];
10
10
  const TRANSLATIONS = {
11
11
  en: {
12
12
  drawResultsHeader: 'Draw results history',
@@ -34,6 +34,32 @@ const TRANSLATIONS = {
34
34
  noResults: 'Niciun rezultat',
35
35
  fetchingResults: 'Se obtin rezultatele'
36
36
  },
37
+ fr: {
38
+ drawResultsHeader: 'Dessiner l\'historique des résultats',
39
+ drawId: 'ID de tirage',
40
+ drawDate: 'Date du tirage',
41
+ drawNumbersGridA: 'Tirage des numéros Grille',
42
+ viewAllResults: 'Voir tout',
43
+ lastFiveDraws: '5 derniers tirages',
44
+ lastTenDraws: '10 derniers tirages',
45
+ lastFifteenDraws: '15 derniers tirages',
46
+ allDrawResultsHistory: 'Historique des résultats de tous les tirages',
47
+ noResults: 'Aucun résultat',
48
+ fetchingResults: 'Récupération des résultats'
49
+ },
50
+ ar: {
51
+ drawResultsHeader: 'سجل نتائج السحب',
52
+ drawId: 'معرّف السحب',
53
+ drawDate: 'تاريخ السحب',
54
+ drawNumbersGridA: 'شبكة أرقام السحب',
55
+ viewAllResults: 'عرض الكل',
56
+ lastFiveDraws: 'آخر 5 سحوبات',
57
+ lastTenDraws: 'آخر 10 سحوبات',
58
+ lastFifteenDraws: 'آخر 15 سحبًا',
59
+ allDrawResultsHistory: 'سجل نتائج كل السحوبات',
60
+ noResults: 'لا توجد نتائج',
61
+ fetchingResults: 'جلب النتائج'
62
+ }
37
63
  };
38
64
  const translate = (key, customLang) => {
39
65
  const lang = customLang;
@@ -55,6 +81,14 @@ const LotteryDrawResultsHistory = /*@__PURE__*/ proxyCustomElement(class extends
55
81
  *Language
56
82
  */
57
83
  this.language = 'en';
84
+ /**
85
+ * Client custom styling via string
86
+ */
87
+ this.clientStyling = '';
88
+ /**
89
+ * Client custom styling via url content
90
+ */
91
+ this.clientStylingUrlContent = '';
58
92
  this.drawData = [];
59
93
  this.displayAllDrawsResults = true;
60
94
  this.showQuickFilters = true;
@@ -63,6 +97,7 @@ const LotteryDrawResultsHistory = /*@__PURE__*/ proxyCustomElement(class extends
63
97
  this.dateFiltersTo = '';
64
98
  this.isLoading = false;
65
99
  this.noResults = false;
100
+ this.limitStylingAppends = false;
66
101
  this.getDrawsData = (filterbydate = false) => {
67
102
  let url = filterbydate ? new URL(`${this.endpoint}/games/${this.gameId}/draws`) : new URL(`${this.endpoint}/games/${this.gameId}`);
68
103
  if (this.dateFiltersFrom)
@@ -121,19 +156,36 @@ const LotteryDrawResultsHistory = /*@__PURE__*/ proxyCustomElement(class extends
121
156
  this.displayAllDrawsResults = false;
122
157
  window.scrollTo({ top: 0, behavior: 'smooth' });
123
158
  };
159
+ this.setClientStyling = () => {
160
+ let sheet = document.createElement('style');
161
+ sheet.innerHTML = this.clientStyling;
162
+ this.stylingContainer.prepend(sheet);
163
+ };
164
+ this.setClientStylingURL = () => {
165
+ let cssFile = document.createElement('style');
166
+ setTimeout(() => {
167
+ cssFile.innerHTML = this.clientStylingUrlContent;
168
+ this.stylingContainer.prepend(cssFile);
169
+ }, 1);
170
+ };
124
171
  }
125
172
  // Filters events
126
- filtersDrawHandler(event) {
127
- this.isLoading = true;
128
- this.showQuickFilters = false;
129
- this.getDrawResults(event.detail.ticketDrawId);
130
- }
173
+ // @Listen('filterDraw')
174
+ // filtersDrawHandler(event: CustomEvent<any>):void {
175
+ // this.isLoading = true;
176
+ // this.showQuickFilters = false;
177
+ // }
131
178
  filtersHandler(event) {
132
179
  this.showQuickFilters = false;
133
- this.dateFiltersFrom = event.detail.filterFromCalendar;
134
- this.dateFiltersTo = event.detail.filterToCalendar;
135
180
  this.isLoading = true;
136
- this.getDrawsData(true);
181
+ if (event.detail.ticketDrawId) {
182
+ this.getDrawResults(event.detail.ticketDrawId);
183
+ }
184
+ else {
185
+ this.dateFiltersFrom = event.detail.filterFromCalendar;
186
+ this.dateFiltersTo = event.detail.filterToCalendar;
187
+ this.getDrawsData(true);
188
+ }
137
189
  }
138
190
  clearFiltersHandler() {
139
191
  this.drawData = this.winningDataSetsData;
@@ -150,13 +202,24 @@ const LotteryDrawResultsHistory = /*@__PURE__*/ proxyCustomElement(class extends
150
202
  disconnectedCallback() {
151
203
  clearInterval(this.interval);
152
204
  }
205
+ componentDidRender() {
206
+ // start custom styling area
207
+ if (!this.limitStylingAppends && this.stylingContainer) {
208
+ if (this.clientStyling)
209
+ this.setClientStyling();
210
+ if (this.clientStylingUrlContent)
211
+ this.setClientStylingURL();
212
+ this.limitStylingAppends = true;
213
+ }
214
+ // end custom styling area
215
+ }
153
216
  render() {
154
217
  let gridHeader = h("div", { class: "DrawResultsHeader" }, this.displayAllDrawsResults ? h("h4", null, translate('drawResultsHeader', this.language)) :
155
218
  [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 }))),
219
+ 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, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }))),
157
220
  ]);
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)))));
221
+ return h("section", { class: "GridWrapper", ref: el => this.stylingContainer = el }, h("div", { class: "DrawResultsSection" }, h("div", { class: "DrawResultsAreaHistory" }, gridHeader, h("div", { class: "HistoryGridWrapper" }, h("div", { class: "HistoryGrid" }, this.isLoading &&
222
+ 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, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent })).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)))));
160
223
  }
161
224
  static get style() { return lotteryDrawResultsHistoryCss; }
162
225
  }, [1, "lottery-draw-results-history", {
@@ -164,6 +227,8 @@ const LotteryDrawResultsHistory = /*@__PURE__*/ proxyCustomElement(class extends
164
227
  "gameId": [1, "game-id"],
165
228
  "numberOfResults": [2, "number-of-results"],
166
229
  "language": [1],
230
+ "clientStyling": [1, "client-styling"],
231
+ "clientStylingUrlContent": [1, "client-styling-url-content"],
167
232
  "drawData": [32],
168
233
  "displayAllDrawsResults": [32],
169
234
  "showQuickFilters": [32],
@@ -171,8 +236,9 @@ const LotteryDrawResultsHistory = /*@__PURE__*/ proxyCustomElement(class extends
171
236
  "dateFiltersFrom": [32],
172
237
  "dateFiltersTo": [32],
173
238
  "isLoading": [32],
174
- "noResults": [32]
175
- }, [[0, "filterDraw", "filtersDrawHandler"], [0, "filterSelection", "filtersHandler"], [0, "filterSelectionReset", "clearFiltersHandler"]]]);
239
+ "noResults": [32],
240
+ "limitStylingAppends": [32]
241
+ }, [[0, "filterSelection", "filtersHandler"], [0, "filterSelectionReset", "clearFiltersHandler"]]]);
176
242
  function defineCustomElement() {
177
243
  if (typeof customElements === "undefined") {
178
244
  return;
@@ -39,6 +39,40 @@ const TRANSLATIONS = {
39
39
  ticketAmount: 'Valoarea biletului',
40
40
  winUpTo: 'Poti castiga'
41
41
  },
42
+ fr: {
43
+ drawResultsHeader: 'Résultats du dernier tirage',
44
+ drawId: 'ID de tirage',
45
+ drawName: 'Nom du jeu',
46
+ drawDate: 'Date du tirage',
47
+ drawNumbersGridDraw: 'Tirage des numéros Grille',
48
+ drawNumbersGridTicket: 'Tirage des numéros Grille',
49
+ ticketResult: 'Résultat du ticket',
50
+ amountWon: 'Montant gagné',
51
+ numberOfDraws: 'Nombre de tirages',
52
+ multiplier: 'Multiplicateur',
53
+ ticketPurchaseDate: 'Date d\'achat du billet',
54
+ ticketStatus: 'Statut du ticket',
55
+ ticketId: 'ID de billets',
56
+ ticketAmount: 'Montant du billet',
57
+ winUpTo: 'Gagnez jusqu\'à'
58
+ },
59
+ ar: {
60
+ drawResultsHeader: 'نتائج آخر سحب',
61
+ drawId: 'معرّف السحب',
62
+ drawName: 'اسم اللعبة',
63
+ drawDate: 'تاريخ السحب',
64
+ drawNumbersGridDraw: 'شبكة أرقام السحب',
65
+ drawNumbersGridTicket: 'شبكة أرقام السحب',
66
+ ticketResult: 'نتيجة التذكرة',
67
+ amountWon: 'المبلغ الذي تم ربحه',
68
+ numberOfDraws: 'عدد السحوبات',
69
+ multiplier: 'مضاعف',
70
+ ticketPurchaseDate: 'تاريخ شراء التذكرة',
71
+ ticketStatus: 'حالة التذكرة',
72
+ ticketId: 'معرّف التذكرة',
73
+ ticketAmount: 'مبلغ التذكرة',
74
+ winUpTo: 'ربح يصل إلى'
75
+ }
42
76
  };
43
77
  const translate = (key, customLang) => {
44
78
  const lang = customLang;
@@ -10,12 +10,48 @@ const LotteryGameDetails = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
10
10
  super();
11
11
  this.__registerHost();
12
12
  this.__attachShadow();
13
+ /**
14
+ * Client custom styling via string
15
+ */
16
+ this.clientStyling = '';
17
+ /**
18
+ * Client custom styling via url content
19
+ */
20
+ this.clientStylingUrlContent = '';
21
+ this.limitStylingAppends = false;
22
+ this.setClientStyling = () => {
23
+ let sheet = document.createElement('style');
24
+ sheet.innerHTML = this.clientStyling;
25
+ this.stylingContainer.prepend(sheet);
26
+ };
27
+ this.setClientStylingURL = () => {
28
+ let cssFile = document.createElement('style');
29
+ setTimeout(() => {
30
+ cssFile.innerHTML = this.clientStylingUrlContent;
31
+ this.stylingContainer.prepend(cssFile);
32
+ }, 1);
33
+ };
34
+ }
35
+ componentDidRender() {
36
+ // start custom styling area
37
+ if (!this.limitStylingAppends && this.stylingContainer) {
38
+ if (this.clientStyling)
39
+ this.setClientStyling();
40
+ if (this.clientStylingUrlContent)
41
+ this.setClientStylingURL();
42
+ this.limitStylingAppends = true;
43
+ }
44
+ // end custom styling area
13
45
  }
14
46
  render() {
15
- return (h("div", null, h("helper-accordion", { "header-title": "Game Details", collapsed: false }, h("div", { slot: "accordionContent" }, h("helper-tabs", null)))));
47
+ return (h("div", { class: "GamePageDetailsContainer", ref: el => this.stylingContainer = el }, h("helper-accordion", { "header-title": "Game Details", collapsed: false, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }, h("div", { class: "AccordionContainer", slot: "accordionContent" }, h("helper-tabs", { "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent })))));
16
48
  }
17
49
  static get style() { return lotteryGameDetailsCss; }
18
- }, [1, "lottery-game-details"]);
50
+ }, [1, "lottery-game-details", {
51
+ "clientStyling": [1, "client-styling"],
52
+ "clientStylingUrlContent": [1, "client-styling-url-content"],
53
+ "limitStylingAppends": [32]
54
+ }]);
19
55
  function defineCustomElement() {
20
56
  if (typeof customElements === "undefined") {
21
57
  return;
@@ -13,7 +13,7 @@ import { d as defineCustomElement$3 } from './lottery-ticket2.js';
13
13
  import { d as defineCustomElement$2 } from './lottery-ticket-controller2.js';
14
14
 
15
15
  const DEFAULT_LANGUAGE = 'en';
16
- const SUPPORTED_LANGUAGES = ['ro', 'en', 'ar'];
16
+ const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'ar'];
17
17
  const TRANSLATIONS = {
18
18
  en: {
19
19
  error: 'Error',
@@ -61,6 +61,29 @@ const TRANSLATIONS = {
61
61
  lastDrawResultsTitle: 'Cele mai recente extrageri',
62
62
  modalLogin: 'Please login to submit a ticket',
63
63
  },
64
+ fr: {
65
+ error: 'Error',
66
+ title: 'Chrono',
67
+ backButton: 'Back',
68
+ lobbyButton: 'Lobby',
69
+ prize: 'Prize',
70
+ winUpTo: 'Win up to',
71
+ nextDraw: 'Next draw in: ',
72
+ buy: 'Buy tickets',
73
+ viewLatest: 'View latest results',
74
+ createTicket: 'Create Ticket',
75
+ modalSuccess: 'Purchase successfully completed!',
76
+ deleteTicketModalTitle: 'Delete Ticket',
77
+ deleteTicketModalText: 'Are you sure you want to delete this ticket?',
78
+ deleteTicketModalCancel: 'Cancel',
79
+ deleteTicketModalConfirm: 'Delete',
80
+ orderSummaryTitle: 'Order Summary',
81
+ orderSummaryTickets: 'Ticket',
82
+ orderSummaryTotal: 'Total',
83
+ orderSummarySubmit: 'Submit',
84
+ lastDrawResultsTitle: 'Résultats du dernier tirage',
85
+ modalLogin: 'Please login to submit a ticket',
86
+ },
64
87
  ar: {
65
88
  error: 'خطأ',
66
89
  title: 'كرونو',
@@ -81,9 +104,9 @@ const TRANSLATIONS = {
81
104
  orderSummaryTickets: 'تذكرة',
82
105
  orderSummaryTotal: 'المجموع',
83
106
  orderSummarySubmit: 'يُقدِّم',
84
- lastDrawResultsTitle: 'Cele mai recente extrageri',
107
+ lastDrawResultsTitle: 'نتائج آخر سحب',
85
108
  modalLogin: 'الرجاء تسجيل الدخول لتقديم تذكرة'
86
- },
109
+ }
87
110
  };
88
111
  const translate = (key, customLang) => {
89
112
  const lang = customLang;
@@ -38,8 +38,33 @@ const LotteryGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
38
38
  * Language
39
39
  */
40
40
  this.language = 'en';
41
+ /**
42
+ * Personalize grid for ticket
43
+ */
44
+ this.gridType = '';
45
+ /**
46
+ * Client custom styling via string
47
+ */
48
+ this.clientStyling = '';
49
+ /**
50
+ * Client custom styling via url content
51
+ */
52
+ this.clientStylingUrlContent = '';
41
53
  this.numbers = [];
54
+ this.limitStylingAppends = false;
42
55
  this.selectedCounter = 0;
56
+ this.setClientStyling = () => {
57
+ let sheet = document.createElement('style');
58
+ sheet.innerHTML = this.clientStyling;
59
+ this.stylingContainer.prepend(sheet);
60
+ };
61
+ this.setClientStylingURL = () => {
62
+ let cssFile = document.createElement('style');
63
+ setTimeout(() => {
64
+ cssFile.innerHTML = this.clientStylingUrlContent;
65
+ this.stylingContainer.prepend(cssFile);
66
+ }, 1);
67
+ };
43
68
  }
44
69
  connectedCallback() {
45
70
  let selected = [];
@@ -68,6 +93,17 @@ const LotteryGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
68
93
  });
69
94
  }
70
95
  }
96
+ componentDidRender() {
97
+ // start custom styling area
98
+ if (!this.limitStylingAppends && this.stylingContainer) {
99
+ if (this.clientStyling)
100
+ this.setClientStyling();
101
+ if (this.clientStylingUrlContent)
102
+ this.setClientStylingURL();
103
+ this.limitStylingAppends = true;
104
+ }
105
+ // end custom styling area
106
+ }
71
107
  lotteryBulletSelectionHandler(event) {
72
108
  this.numbers = this.numbers.map((item) => {
73
109
  if (item.number == event.detail.value) {
@@ -158,7 +194,7 @@ const LotteryGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
158
194
  }
159
195
  }
160
196
  render() {
161
- return (h("div", { class: "GridContainer" }, h("div", { class: "Grid" }, this.numbers.map((item) => h("div", null, h("lottery-bullet", { value: item.number, selectable: item.selectable, "is-selected": item.selected }))))));
197
+ return (h("div", { class: "GridContainer", ref: el => this.stylingContainer = el }, h("div", { class: this.gridType === 'ticket' ? 'Grid TicketGrid' : 'Grid' }, this.numbers.map((item) => h("div", null, h("lottery-bullet", { value: item.number, selectable: item.selectable, "is-selected": item.selected, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }))))));
162
198
  }
163
199
  static get style() { return lotteryGridCss; }
164
200
  }, [1, "lottery-grid", {
@@ -172,7 +208,11 @@ const LotteryGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
172
208
  "displaySelected": [4, "display-selected"],
173
209
  "language": [1],
174
210
  "gridIndex": [2, "grid-index"],
175
- "numbers": [32]
211
+ "gridType": [1, "grid-type"],
212
+ "clientStyling": [1, "client-styling"],
213
+ "clientStylingUrlContent": [1, "client-styling-url-content"],
214
+ "numbers": [32],
215
+ "limitStylingAppends": [32]
176
216
  }, [[0, "lotteryBulletSelection", "lotteryBulletSelectionHandler"], [4, "resetSelection", "resetSelectionHandler"], [4, "autoSelection", "autoSelectionHandler"]]]);
177
217
  function defineCustomElement() {
178
218
  if (typeof customElements === "undefined") {