@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.
Files changed (68) hide show
  1. package/dist/cjs/helper-accordion.cjs.entry.js +7 -3
  2. package/dist/cjs/helper-filters_2.cjs.entry.js +662 -417
  3. package/dist/cjs/helper-modal.cjs.entry.js +1 -1
  4. package/dist/cjs/helper-pagination.cjs.entry.js +1 -1
  5. package/dist/cjs/helper-tab.cjs.entry.js +11 -8
  6. package/dist/cjs/helper-tabs.cjs.entry.js +2 -2
  7. package/dist/cjs/{index-e5770ba2.js → index-5701a895.js} +6 -0
  8. package/dist/cjs/loader.cjs.js +2 -2
  9. package/dist/cjs/lottery-bullet_2.cjs.entry.js +3 -3
  10. package/dist/cjs/lottery-draw-results-history.cjs.entry.js +64 -27
  11. package/dist/cjs/lottery-game-details.cjs.entry.js +1 -1
  12. package/dist/cjs/lottery-game-page.cjs.entry.js +50 -13
  13. package/dist/cjs/lottery-game-page.cjs.js +2 -2
  14. package/dist/cjs/lottery-ticket-controller.cjs.entry.js +1 -1
  15. package/dist/cjs/lottery-ticket.cjs.entry.js +32 -9
  16. package/dist/collection/components/lottery-game-page/lottery-game-page.css +27 -7
  17. package/dist/collection/components/lottery-game-page/lottery-game-page.js +22 -5
  18. package/dist/collection/utils/locale.utils.js +33 -6
  19. package/dist/components/helper-accordion2.js +7 -2
  20. package/dist/components/helper-filters2.js +597 -361
  21. package/dist/components/helper-tab2.js +12 -8
  22. package/dist/components/helper-tabs2.js +1 -1
  23. package/dist/components/lottery-bullet2.js +1 -1
  24. package/dist/components/lottery-draw-results-history2.js +69 -28
  25. package/dist/components/lottery-draw-results2.js +60 -46
  26. package/dist/components/lottery-game-page.js +52 -13
  27. package/dist/components/lottery-grid2.js +1 -1
  28. package/dist/components/lottery-ticket2.js +35 -10
  29. package/dist/esm/helper-accordion.entry.js +7 -3
  30. package/dist/esm/helper-filters_2.entry.js +662 -417
  31. package/dist/esm/helper-modal.entry.js +1 -1
  32. package/dist/esm/helper-pagination.entry.js +1 -1
  33. package/dist/esm/helper-tab.entry.js +11 -8
  34. package/dist/esm/helper-tabs.entry.js +2 -2
  35. package/dist/esm/{index-8f308493.js → index-ade3d0ab.js} +6 -0
  36. package/dist/esm/loader.js +2 -2
  37. package/dist/esm/lottery-bullet_2.entry.js +3 -3
  38. package/dist/esm/lottery-draw-results-history.entry.js +64 -27
  39. package/dist/esm/lottery-game-details.entry.js +1 -1
  40. package/dist/esm/lottery-game-page.entry.js +50 -13
  41. package/dist/esm/lottery-game-page.js +2 -2
  42. package/dist/esm/lottery-ticket-controller.entry.js +1 -1
  43. package/dist/esm/lottery-ticket.entry.js +32 -9
  44. package/dist/lottery-game-page/lottery-game-page.esm.js +1 -1
  45. package/dist/lottery-game-page/p-07cca45e.entry.js +1 -0
  46. package/dist/lottery-game-page/{p-12251772.entry.js → p-1196396b.entry.js} +1 -1
  47. package/dist/lottery-game-page/{p-43400250.entry.js → p-2197c8ae.entry.js} +1 -1
  48. package/dist/lottery-game-page/p-2a4e9984.entry.js +1 -0
  49. package/dist/lottery-game-page/p-4bfd0112.entry.js +1 -0
  50. package/dist/lottery-game-page/p-5e12dbf9.entry.js +1 -0
  51. package/dist/lottery-game-page/p-a10368b2.entry.js +1 -0
  52. package/dist/lottery-game-page/{p-43f7fac4.entry.js → p-a26ebf45.entry.js} +1 -1
  53. package/dist/lottery-game-page/p-b301a9d4.js +1 -0
  54. package/dist/lottery-game-page/{p-af9a2dde.entry.js → p-d4b6a11a.entry.js} +1 -1
  55. package/dist/lottery-game-page/{p-324c7edd.entry.js → p-d508e7cc.entry.js} +78 -118
  56. package/dist/lottery-game-page/p-dd63fcc6.entry.js +1 -0
  57. package/dist/lottery-game-page/p-f59dc9e1.entry.js +1 -0
  58. package/dist/stencil.config.js +5 -1
  59. package/dist/types/components/lottery-game-page/lottery-game-page.d.ts +3 -0
  60. package/package.json +1 -1
  61. package/dist/lottery-game-page/p-037dd940.js +0 -1
  62. package/dist/lottery-game-page/p-55338096.entry.js +0 -1
  63. package/dist/lottery-game-page/p-581bdfc2.entry.js +0 -1
  64. package/dist/lottery-game-page/p-6977f833.entry.js +0 -1
  65. package/dist/lottery-game-page/p-85f4e95b.entry.js +0 -1
  66. package/dist/lottery-game-page/p-99a61a44.entry.js +0 -1
  67. package/dist/lottery-game-page/p-bf66e969.entry.js +0 -1
  68. package/dist/lottery-game-page/p-d1b9da94.entry.js +0 -1
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-e5770ba2.js');
5
+ const index = require('./index-5701a895.js');
6
6
 
7
7
  const DEFAULT_LANGUAGE = 'en';
8
8
  const SUPPORTED_LANGUAGES = ['ro', 'en'];
@@ -33,7 +33,7 @@ const translate = (key, customLang) => {
33
33
  return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
34
34
  };
35
35
 
36
- const lotteryTicketCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.Toggle{cursor:pointer;margin-top:20px;display:inline-block}.ToggleSwitch{display:inline-block;background:#707070;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%, #F1F1F1 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:#00ABA4}.ToggleCheckbox:checked+.ToggleSwitch:before{left:38px}.ToggleCheckbox{position:absolute;visibility:hidden}.Label{margin-right:5px;position:relative;top:2px;font-size:14px;font-weight:lighter;color:#000}input[type=number]{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none}.NumberInput,.WagerInput{margin-top:10px;display:inline-flex;align-items:center}.NumberInput,.NumberInput *{box-sizing:border-box}.NumberInput button{cursor:pointer;outline:none;-webkit-appearance:none;background-color:transparent;border:none;align-items:center;justify-content:center;height:20px;margin:0;position:relative}.NumberInput button:after{display:inline-block;position:absolute;transform:translate(-50%, -50%) rotate(180deg);width:30px;align-items:center;text-align:center}.NumberInput button.Plus:after{transform:translate(-50%, -50%) rotate(0deg);width:30px;display:inline-flex;align-items:center;text-align:center}.NumberInput input[type=number],.WagerInput input[type=number]{max-width:50px;display:inline-flex;align-items:center;padding:4px 10px;text-align:center}.NumberInput input[type=number] .WagerInputTitle,.WagerInput input[type=number] .WagerInputTitle{font-size:14px;color:#000;padding:10px}.InputDefault{background-color:#F1F1F1;border-radius:4px;padding:5px;border:solid 1px #D4D4D4;color:#707070}.AutoButton{cursor:pointer;display:block;border-radius:4px;padding:8px 25px;width:max-content;margin:5px 0;border:1px solid #00958f;background:#FFF;color:#000;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0}.AutoButton:active{background:#00958f;color:#FFF}.ResetButton{cursor:pointer;display:block;border-radius:4px;padding:8px 25px;width:max-content;margin:5px 0;color:#000;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0;background:#FF3D00;border:1px solid #FF3D00;color:#FFF}.ResetButton:hover{background:#FF6536;border:1px solid #FF3D00}.TicketGridBullets{background:#f1f1f1;border-radius:4px;padding:20px;margin-top:5px}.TicketGridBullets .TicketGridTitle{margin-top:0px}";
36
+ const lotteryTicketCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.TicketTitle{font-size:16px;font-weight:bold}.ButtonContainer{display:flex;justify-content:flex-end}.Toggle{cursor:pointer;margin-top:20px;display:inline-block}.ToggleSwitch{display:inline-block;background:#707070;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%, #F1F1F1 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:#00ABA4}.ToggleCheckbox:checked+.ToggleSwitch:before{left:38px}.ToggleCheckbox{position:absolute;visibility:hidden}.Label{margin-right:5px;position:relative;top:2px;font-size:14px;font-weight:lighter;color:#000}input[type=number]{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none}.NumberInput,.WagerInput{margin-top:10px;display:inline-flex;align-items:center}.NumberInput,.NumberInput *{box-sizing:border-box}.NumberInput button{cursor:pointer;outline:none;-webkit-appearance:none;border:none;align-items:center;justify-content:center;height:20px;position:relative}.NumberInput button:after{display:inline-block;position:absolute;transform:translate(-50%, -50%) rotate(180deg);align-items:center;text-align:center}.NumberInput button.Plus:after{transform:translate(-50%, -50%) rotate(0deg);width:30px;display:inline-flex;align-items:center;text-align:center}.NumberInput input[type=number],.WagerInput input[type=number]{max-width:50px;display:inline-flex;align-items:center;padding:4px 10px;text-align:center}.NumberInput input[type=number] .WagerInputTitle,.WagerInput input[type=number] .WagerInputTitle{font-size:14px;color:#000;padding:10px}.InputDefault{background-color:#F1F1F1;border-radius:4px;padding:5px;border:solid 1px #D4D4D4;color:#707070}.AutoButton{cursor:pointer;display:inline-block;border-radius:4px;padding:8px 20px;width:max-content;margin:5px 0;border:1px solid #00958f;background:#FFF;color:#000;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0}.AutoButton:active{background:#00958f;color:#FFF}.ResetButton{cursor:pointer;display:inline-block;border-radius:4px;padding:8px 20px;width:max-content;margin:5px 0;color:#000;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0;background:#FF3D00;border:1px solid #FF3D00;color:#FFF}.ResetButton:hover{background:#FF6536;border:1px solid #FF3D00}.TicketGridBullets{background:#f1f1f1;border-radius:4px;padding:20px;margin-top:5px}.TicketGridBullets .TicketGridTitle{margin-top:0px}.Minus{border-radius:4px;width:30px;height:24px !important;margin-right:10px;color:#FFF;background:#009993}.Plus{border-radius:4px;width:30px;height:24px !important;margin-left:10px;color:#FFF;background:#009993}.SelectWrapper{width:auto;padding:5px;margin:0 auto;border:1px solid #ccc;border-radius:5px;position:relative}.SelectButton,.SelectOptions li{display:flex;align-items:center;cursor:pointer}.SelectButton{display:flex;padding:0 5px;border-radius:7px;align-items:center;justify-content:space-between;font-size:14px}.SelectButton span:first-child{padding-right:10px}.SelectExpand{transition:transform 0.3s linear;font-size:12px}.SelectActive .SelectExpand{transform:rotate(180deg)}.SelectContent{display:none;padding:5px;border-radius:7px}.SelectWrapper.SelectActive .SelectContent{width:100%;display:block;position:absolute;left:0;top:32px;padding:0;border:1px solid #ccc;overflow:hidden;background:#fff}.SelectContent .SelectOptions{max-height:100px;margin:0;overflow-y:auto;padding:0}.SelectContent .SelectOptions .SelectedValue{background-color:#009993;color:#fff}.SelectOptions::-webkit-scrollbar{width:7px}.SelectOptions::-webkit-scrollbar-track{background:#f1f1f1;border-radius:25px}.SelectOptions::-webkit-scrollbar-thumb{background:#ccc;border-radius:25px}.SelectOptions li{height:20px;padding:0 13px;font-size:14px}.SelectOptions li:hover{background:#f2f2f2}";
37
37
 
38
38
  const LotteryTicket = class {
39
39
  constructor(hostRef) {
@@ -68,6 +68,16 @@ const LotteryTicket = class {
68
68
  this.isLoading = true;
69
69
  this.hasErrors = false;
70
70
  this.ticketDone = false;
71
+ this.isCustomSelect = false;
72
+ this.amountInfo = {};
73
+ }
74
+ /**
75
+ * @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
76
+ */
77
+ checkForClickOutside(ev) {
78
+ if (ev.composedPath()[0].getAttribute('data-cluster') !== 'SelectComponent') {
79
+ this.isCustomSelect = false;
80
+ }
71
81
  }
72
82
  connectedCallback() {
73
83
  let url = new URL(`${this.endpoint}/games/${this.gameId}`);
@@ -85,6 +95,7 @@ const LotteryTicket = class {
85
95
  this.isLoading = false;
86
96
  this.gameData = data;
87
97
  this.grids = [...Array(data.rules.boards.length).keys()];
98
+ this.amountInfo = this.gameData.rules.stakes[0]; // initial value for select
88
99
  })
89
100
  .catch((err) => {
90
101
  this.isLoading = false;
@@ -113,12 +124,23 @@ const LotteryTicket = class {
113
124
  this.ticketDone = false;
114
125
  this.resetSelection.emit(this.ticketId);
115
126
  }
116
- changeStake(event) {
127
+ changeStake(ticketid, amount) {
117
128
  this.stakeChange.emit({
118
- ticketId: this.ticketId,
119
- stake: event.target.value
129
+ ticketId: ticketid,
130
+ stake: amount
120
131
  });
121
132
  }
133
+ toggleClass() {
134
+ this.isCustomSelect = !this.isCustomSelect;
135
+ }
136
+ setDropdownItem(item) {
137
+ this.amountInfo = {
138
+ amount: item.amount,
139
+ currency: item.currency
140
+ };
141
+ this.isCustomSelect = false;
142
+ this.changeStake(this.ticketId, item.amount);
143
+ }
122
144
  render() {
123
145
  if (this.isLoading) {
124
146
  return (index.h("div", null, index.h("p", null, translate('loading', this.language))));
@@ -129,11 +151,12 @@ const LotteryTicket = class {
129
151
  }
130
152
  else {
131
153
  const { rules } = this.gameData;
132
- return (index.h("div", { class: "TicketContainer" }, index.h("p", null, this.gameData.name), this.resetButton && this.ticketDone &&
133
- index.h("a", { class: "ResetButton", onClick: () => this.toggleResetSelection() }, translate('resetButton', this.language)), this.autoPick && !this.ticketDone &&
134
- 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 &&
154
+ return (index.h("div", { class: "TicketContainer" }, index.h("p", { class: "TicketTitle" }, this.gameData.name), this.resetButton && this.ticketDone &&
155
+ 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 &&
135
157
  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 &&
136
- 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("label", { class: "Label" }, translate('wagerPerDraw', this.language), ": "), index.h("div", { class: "WagerInput" }, rules.stakes.length > 1 ? index.h("div", null, index.h("select", { class: "InputDefault", onChange: (event) => this.changeStake(event) }, rules.stakes.map((item) => index.h("option", { value: item.amount }, 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)))));
158
+ 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
+ (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)))))));
137
160
  }
138
161
  }
139
162
  }
@@ -36,16 +36,17 @@
36
36
  align-items: center;
37
37
  }
38
38
  .GamePage .TotalWinnings {
39
- color: #00958f;
39
+ color: #000;
40
40
  font-size: 18px;
41
41
  display: flex;
42
- flex-direction: column;
42
+ flex-direction: row;
43
43
  justify-content: center;
44
44
  align-items: center;
45
45
  gap: 10px;
46
+ text-transform: uppercase;
46
47
  }
47
48
  .GamePage .TotalWinnings span {
48
- font-size: 22px;
49
+ font-size: 18px;
49
50
  font-weight: 700;
50
51
  }
51
52
  .GamePage .NextDraw {
@@ -54,7 +55,7 @@
54
55
  font-weight: 600;
55
56
  margin: 0 auto;
56
57
  text-align: center;
57
- text-transform: capitalize;
58
+ text-transform: uppercase;
58
59
  display: flex;
59
60
  justify-content: center;
60
61
  align-items: center;
@@ -63,6 +64,9 @@
63
64
  .GamePage .NextDraw .BannerText {
64
65
  font-weight: 400;
65
66
  font-size: 18px;
67
+ text-transform: uppercase;
68
+ padding: 0;
69
+ margin: 15px 0 0 0;
66
70
  }
67
71
  .GamePage .NextDraw .BannerCountdown {
68
72
  font-size: 22px;
@@ -95,9 +99,21 @@
95
99
  color: #FFF;
96
100
  }
97
101
 
102
+ .LastDrawResultsTitle {
103
+ color: #009993;
104
+ padding: 25px 0 10px 0;
105
+ text-align: center;
106
+ border-radius: 4px;
107
+ text-transform: uppercase;
108
+ font-size: 16px;
109
+ font-weight: 600;
110
+ margin: 0;
111
+ }
112
+
98
113
  .NextDrawWrapper {
99
114
  padding: 10px 15px;
100
- background: #fff;
115
+ background: #F1F1F1;
116
+ background: linear-gradient(0deg, #f1f1f1 0%, rgba(253, 187, 45, 0) 100%);
101
117
  }
102
118
  .NextDrawWrapper .BannerText {
103
119
  font-size: 16px;
@@ -114,7 +130,7 @@
114
130
  }
115
131
 
116
132
  .GamePageContent {
117
- padding: 10px 15px;
133
+ padding: 15px;
118
134
  max-width: 1200px;
119
135
  margin: 0 auto;
120
136
  }
@@ -122,7 +138,6 @@
122
138
  .GameDetails {
123
139
  padding-bottom: 10px;
124
140
  margin-bottom: 20px;
125
- border-bottom: 1px solid #e9e9e9;
126
141
  }
127
142
 
128
143
  .CreateNewTicket {
@@ -221,6 +236,11 @@
221
236
  .ButtonWrapper .Button:hover {
222
237
  background: #00ABA4;
223
238
  }
239
+ .ButtonWrapper .Button.ButtonDisabled {
240
+ pointer-events: none;
241
+ background: #ccc;
242
+ border: 1px solid #ccc;
243
+ }
224
244
 
225
245
  .SubmitModalSuccess {
226
246
  text-align: center;
@@ -28,6 +28,8 @@ export class LotteryGamePage {
28
28
  this.deleteVisible = false;
29
29
  this.latestDraw = {};
30
30
  this.totalWinningsAmount = 0;
31
+ this.isLoggedIn = false;
32
+ this.loginModalVisible = false;
31
33
  this.multiplier = false;
32
34
  this.quickPick = false;
33
35
  }
@@ -35,6 +37,10 @@ export class LotteryGamePage {
35
37
  connectedCallback() {
36
38
  this.getGameDetails();
37
39
  this.getDraws();
40
+ console.log(this.language);
41
+ if (this.sessionId) {
42
+ this.isLoggedIn = true;
43
+ }
38
44
  }
39
45
  countdownLogic(date) {
40
46
  this.interval = setInterval(() => {
@@ -61,7 +67,6 @@ export class LotteryGamePage {
61
67
  this.gameData = data;
62
68
  this.basicStake = this.gameData.rules.stakes[0].amount;
63
69
  let draws = this.gameData.draws.filter((item) => !item.winningNumbers);
64
- console.log('draws', draws);
65
70
  this.nextDraw = draws[0].id;
66
71
  this.createNewTicket();
67
72
  })
@@ -124,6 +129,7 @@ export class LotteryGamePage {
124
129
  }
125
130
  modalCloseEvent() {
126
131
  this.deleteVisible = false;
132
+ this.loginModalVisible = false;
127
133
  }
128
134
  stakeChangeHandler(event) {
129
135
  const { ticketId, stake } = event.detail;
@@ -185,6 +191,9 @@ export class LotteryGamePage {
185
191
  { gameId: this.gameId, ticketId: this.tickets.length + 1, completed: false, amount: 1, stake: this.basicStake, grids: [] }
186
192
  ];
187
193
  }
194
+ showLoginModal() {
195
+ this.loginModalVisible = true;
196
+ }
188
197
  submitTickets() {
189
198
  let url = new URL(`${this.endpoint}/tickets`);
190
199
  // @TODO Body TS type
@@ -192,7 +201,6 @@ export class LotteryGamePage {
192
201
  gameId: this.gameId,
193
202
  tickets: []
194
203
  };
195
- console.log('body', body);
196
204
  this.tickets.forEach((item) => {
197
205
  body.tickets.push({
198
206
  startingDrawId: this.nextDraw,
@@ -236,7 +244,7 @@ export class LotteryGamePage {
236
244
  }
237
245
  return (
238
246
  /* Game details */
239
- h("div", { class: "GamePage" },
247
+ h("div", { class: "GamePage", dir: this.language == 'ar' ? 'rtl' : 'ltr' },
240
248
  h("div", { class: "GridBanner" },
241
249
  h("div", { class: "BannerButtonsWrapper" },
242
250
  h("button", { class: "BannerBackButton" },
@@ -291,9 +299,16 @@ export class LotteryGamePage {
291
299
  " ",
292
300
  this.currency)),
293
301
  h("div", { class: "ButtonWrapper" },
294
- h("span", { class: "Button", onClick: () => this.submitTickets() }, translate('orderSummarySubmit', this.language))))),
302
+ this.isLoggedIn &&
303
+ h("span", { class: "Button", onClick: () => this.submitTickets() }, translate('orderSummarySubmit', this.language)),
304
+ !this.isLoggedIn &&
305
+ h("div", null,
306
+ h("span", { class: "Button", onClick: () => this.showLoginModal() }, translate('orderSummarySubmit', this.language)),
307
+ h("helper-modal", { "title-modal": "Success", visible: this.loginModalVisible },
308
+ h("p", { class: "SubmitModalSuccess" }, translate('modalLogin', this.language))))))),
295
309
  this.tabIndex == 1 &&
296
310
  h("div", null,
311
+ h("h4", { class: "LastDrawResultsTitle" }, translate('lastDrawResultsTitle', this.language)),
297
312
  h("lottery-draw-results", { endpoint: this.endpoint, "game-id": this.gameId, language: this.language, "draw-id": this.lastDrawId, "draw-mode": true }),
298
313
  h("lottery-draw-results-history", { endpoint: this.endpoint, "game-id": this.gameId, language: this.language })),
299
314
  h("helper-modal", { "title-modal": "Success", visible: this.successVisible },
@@ -453,7 +468,9 @@ export class LotteryGamePage {
453
468
  "secondsRemaining": {},
454
469
  "latestDraw": {},
455
470
  "totalWinningsAmount": {},
456
- "nextDate": {}
471
+ "nextDate": {},
472
+ "isLoggedIn": {},
473
+ "loginModalVisible": {}
457
474
  }; }
458
475
  static get elementRef() { return "element"; }
459
476
  static get listeners() { return [{
@@ -1,5 +1,5 @@
1
1
  const DEFAULT_LANGUAGE = 'en';
2
- const SUPPORTED_LANGUAGES = ['ro', 'en'];
2
+ const SUPPORTED_LANGUAGES = ['ro', 'en', 'ar'];
3
3
  const TRANSLATIONS = {
4
4
  en: {
5
5
  error: 'Error',
@@ -12,7 +12,7 @@ const TRANSLATIONS = {
12
12
  buy: 'Buy tickets',
13
13
  viewLatest: 'View latest results',
14
14
  createTicket: 'Create Ticket',
15
- modalSuccess: 'Purchase will be successfull soon!',
15
+ modalSuccess: 'Purchase successfully completed!',
16
16
  deleteTicketModalTitle: 'Delete Ticket',
17
17
  deleteTicketModalText: 'Are you sure you want to delete this ticket?',
18
18
  deleteTicketModalCancel: 'Cancel',
@@ -20,7 +20,9 @@ const TRANSLATIONS = {
20
20
  orderSummaryTitle: 'Order Summary',
21
21
  orderSummaryTickets: 'Ticket',
22
22
  orderSummaryTotal: 'Total',
23
- orderSummarySubmit: 'Submit'
23
+ orderSummarySubmit: 'Submit',
24
+ lastDrawResultsTitle: 'Last Draw Results',
25
+ modalLogin: 'Please login to submit a ticket',
24
26
  },
25
27
  ro: {
26
28
  error: 'Eroare',
@@ -29,11 +31,11 @@ const TRANSLATIONS = {
29
31
  lobbyButton: 'Lobby',
30
32
  prize: 'MARELE JACKPOT OMG',
31
33
  winUpTo: 'Castiga pana la',
32
- nextDraw: 'In cat timp devii milionar daca cumperi acum!!!',
34
+ nextDraw: 'Urmatoarea extragere:',
33
35
  buy: 'Cumpara bilet',
34
36
  viewLatest: 'Ultimile extrageri',
35
37
  createTicket: 'Creeaza bilet',
36
- modalSuccess: 'Achiziția va avea succes în curând!',
38
+ modalSuccess: 'Achizitie efectuata cu succes',
37
39
  deleteTicketModalTitle: 'Sterge biletul',
38
40
  deleteTicketModalText: 'Esti sigur ca vrei sa stergi acest bilet?',
39
41
  deleteTicketModalCancel: 'Anuleaza',
@@ -41,7 +43,32 @@ const TRANSLATIONS = {
41
43
  orderSummaryTitle: 'Rezumat comanda',
42
44
  orderSummaryTickets: 'Bilet',
43
45
  orderSummaryTotal: 'Total',
44
- orderSummarySubmit: 'Trimite'
46
+ orderSummarySubmit: 'Trimite',
47
+ lastDrawResultsTitle: 'Cele mai recente extrageri',
48
+ modalLogin: 'Please login to submit a ticket',
49
+ },
50
+ ar: {
51
+ error: 'خطأ',
52
+ title: 'كرونو',
53
+ backButton: 'خلف',
54
+ lobbyButton: 'ردهة',
55
+ prize: 'جائزة',
56
+ winUpTo: 'الفوز بما يصل الى',
57
+ nextDraw: 'السحب التالي:',
58
+ buy: 'اشتري تذاكر',
59
+ viewLatest: 'عرض أحدث النتائج',
60
+ createTicket: 'إنشاء تذكرة',
61
+ modalSuccess: '!سيتم الشراء بنجاح قريبًا',
62
+ deleteTicketModalTitle: 'حذف التذكرة',
63
+ deleteTicketModalText: 'هل أنت متأكد أنك تريد حذف هذه التذكرة؟',
64
+ deleteTicketModalCancel: 'يلغي',
65
+ deleteTicketModalConfirm: 'حذف',
66
+ orderSummaryTitle: 'ملخص الطلب',
67
+ orderSummaryTickets: 'تذكرة',
68
+ orderSummaryTotal: 'المجموع',
69
+ orderSummarySubmit: 'يُقدِّم',
70
+ lastDrawResultsTitle: 'Cele mai recente extrageri',
71
+ modalLogin: 'الرجاء تسجيل الدخول لتقديم تذكرة'
45
72
  },
46
73
  };
47
74
  export const translate = (key, customLang) => {
@@ -15,7 +15,7 @@ const translate = (key, customLang) => {
15
15
  return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
16
16
  };
17
17
 
18
- const helperAccordionCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.Header{border-radius:4px;margin-bottom:1px;background:#009993;display:flex;gap:30px;border:1px solid #009993;padding:8px 10px;user-select:none}.Header:hover{background:#00ABA4}.Header .Title,.Header .Subtitle,.Header .Description{margin:0;font-size:14px;color:#fff}.Header .Expand{margin-left:auto;color:#FFF;width:17px;height:17px;cursor:pointer;text-align:center;transform:rotate(90deg);font-size:20px;user-select:none}.Content{border-radius:4px;background:#fff;border:1px solid #009993;padding:10px 15px;user-select:none;color:#000;margin-bottom:10px}.ActionButton{border-radius:4px;margin-top:10px;cursor:pointer;text-transform:capitalize;display:block;font-size:12px;text-align:center;padding:8px 20px;width:80px;background:#FF3D00;border:1px solid #FF3D00;color:#FFF}.ActionButton:hover{background:#FF6536;border:1px solid #FF3D00}";
18
+ const helperAccordionCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.Header{border-radius:4px 4px 0 0;background:#009993;display:flex;gap:30px;border:1px solid #009993;padding:8px 10px;user-select:none}.Header:hover{background:#00ABA4}.Header .Title,.Header .Subtitle,.Header .Description{margin:0;font-size:14px;color:#fff}.Header .Expand{margin-left:auto;color:#FFF;width:17px;height:17px;cursor:pointer;text-align:center;transform:rotate(90deg);font-size:20px;user-select:none}.HeaderTicketHistory{border-radius:4px;background:#F1F1F1;display:flex;gap:30px;border:1px solid #009993;padding:8px 10px;user-select:none;margin-bottom:5px}.HeaderTicketHistory:hover{background:#00ABA4}.HeaderTicketHistory .Title,.HeaderTicketHistory .Subtitle,.HeaderTicketHistory .Description{margin:0;font-size:14px;color:#000}.HeaderTicketHistory .Expand{margin-left:auto;color:#FFF;width:17px;height:17px;cursor:pointer;text-align:center;transform:rotate(90deg);font-size:20px;user-select:none}.Content{border-radius:0 0 4px 4px;background:#fff;border:1px solid #009993;padding:10px 15px;user-select:none;color:#000;margin-bottom:10px}.ActionButton{cursor:pointer;display:inline-block;border-radius:4px;margin:20px 0 10px;text-transform:uppercase;font-size:12px;text-align:center;padding:8px 20px;min-width:80px;background:#FF3D00;border:1px solid #FF3D00;color:#FFF}.ActionButton:hover{background:#FF6536;border:1px solid #FF3D00}";
19
19
 
20
20
  const Accordion = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
21
21
  constructor() {
@@ -23,6 +23,10 @@ const Accordion = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
23
23
  this.__registerHost();
24
24
  this.__attachShadow();
25
25
  this.accordionEvent = createEvent(this, "helperAccordionAction", 7);
26
+ /**
27
+ * Flag for ticket history
28
+ */
29
+ this.ticketHistoryFlag = false;
26
30
  /**
27
31
  * Title (top header)
28
32
  */
@@ -75,13 +79,14 @@ const Accordion = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
75
79
  this.accordionEvent.emit();
76
80
  }
77
81
  render() {
78
- return (h("div", { class: "Wrapper" }, h("div", { class: "Header" }, h("p", { class: "Title" }, this.headerTitle), h("p", { class: "Subtitle" }, this.headerSubtitle), h("p", { class: "Subtitle" }, this.description), h("span", { class: "Expand", onClick: () => this.toggleContent() }, this.showContent ? '<' : '>')), this.showContent &&
82
+ return (h("div", { class: "Wrapper" }, h("div", { class: this.ticketHistoryFlag === true ? 'HeaderTicketHistory' : 'Header' }, h("p", { class: "Title" }, this.headerTitle), h("p", { class: "Subtitle" }, this.headerSubtitle), h("p", { class: "Subtitle" }, this.description), h("span", { class: "Expand", onClick: () => this.toggleContent() }, this.showContent ? '<' : '>')), this.showContent &&
79
83
  h("div", null, h("div", { class: "Content" }, h("slot", { name: 'accordionContent' }), this.footer && this.showContent &&
80
84
  h("div", null, this.deleteTab &&
81
85
  h("span", { class: "ActionButton", onClick: () => this.deleteAction() }, translate('deleteTicket', this.language)))))));
82
86
  }
83
87
  static get style() { return helperAccordionCss; }
84
88
  }, [1, "helper-accordion", {
89
+ "ticketHistoryFlag": [4, "ticket-history-flag"],
85
90
  "headerTitle": [1, "header-title"],
86
91
  "headerSubtitle": [1, "header-subtitle"],
87
92
  "description": [1],