@everymatrix/lottery-draw-results 0.0.3 → 0.1.1

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.
@@ -1,20 +1,6 @@
1
1
  import { Component, Prop, h, State } from '@stencil/core';
2
2
  import { translate } from '../../utils/locale.utils';
3
3
  import '@everymatrix/lottery-grid';
4
- const DEFAULT_VALUES = {
5
- gamename: 'Chrono',
6
- gamedate: '24/09/2022',
7
- state: 'Processing',
8
- amount: 304444,
9
- ticketid: '6963444',
10
- selection: '[5, 6, 7, 8, 9]',
11
- multiplier: 4.5,
12
- resultstatus: 'Processing',
13
- drawstatus: 'Won',
14
- drawamount: 1022,
15
- drawid: '54545555',
16
- drawdate: '24/09/2032'
17
- };
18
4
  export class LotteryDrawResults {
19
5
  constructor() {
20
6
  /**
@@ -25,9 +11,39 @@ export class LotteryDrawResults {
25
11
  * Shows only the last draw
26
12
  */
27
13
  this.drawMode = false;
14
+ /**
15
+ * The drawID (option)
16
+ */
17
+ this.drawId = '';
18
+ /**
19
+ * The game name
20
+ */
28
21
  this.gameName = '';
29
- this.multiplier = 5.434;
30
- this.ticketData = {};
22
+ /**
23
+ * The ticket submission date
24
+ */
25
+ this.ticketDate = '';
26
+ /**
27
+ * The ticket status
28
+ */
29
+ this.ticketStatus = '';
30
+ /**
31
+ * The ticket id
32
+ */
33
+ this.ticketId = '';
34
+ /**
35
+ * The ticket amount
36
+ */
37
+ this.ticketAmount = '';
38
+ /**
39
+ * The ticket multiplier
40
+ */
41
+ this.ticketMultiplier = false;
42
+ /**
43
+ * The ticket draw count
44
+ */
45
+ this.ticketDrawCount = 0;
46
+ this.multiplier = 3;
31
47
  this.isLoading = true;
32
48
  this.drawResults = [];
33
49
  this.rules = {};
@@ -49,9 +65,6 @@ export class LotteryDrawResults {
49
65
  connectedCallback() {
50
66
  let promises = [];
51
67
  promises.push(this.getGameData());
52
- if (this.playerId) {
53
- promises.push(this.getTicketData());
54
- }
55
68
  if (this.drawId) {
56
69
  promises.push(this.getDrawData());
57
70
  }
@@ -71,9 +84,11 @@ export class LotteryDrawResults {
71
84
  .then((data) => {
72
85
  this.drawData = data;
73
86
  resolve(true);
87
+ this.isLoading = false;
74
88
  })
75
89
  .catch((err) => {
76
90
  reject(err);
91
+ this.isLoading = false;
77
92
  });
78
93
  });
79
94
  }
@@ -90,6 +105,8 @@ export class LotteryDrawResults {
90
105
  totalNumbers: data.rules.boards[0].totalNumbers
91
106
  };
92
107
  resolve(true);
108
+ this.isLoading = false;
109
+ this.hasErrors = false;
93
110
  })
94
111
  .catch((err) => {
95
112
  this.isLoading = false;
@@ -99,26 +116,7 @@ export class LotteryDrawResults {
99
116
  });
100
117
  });
101
118
  }
102
- getTicketData() {
103
- return new Promise((resolve, reject) => {
104
- let url = new URL(`${this.endpoint}/tickets/player/${this.playerId}`);
105
- fetch(url.href)
106
- .then((response) => {
107
- return response.json();
108
- })
109
- .then((data) => {
110
- this.ticketData = data.length === 0 ? DEFAULT_VALUES : data[1];
111
- this.drawResults = this.ticketData.drawResults.map((item) => item);
112
- this.selection = this.ticketData.selection[0].join(',');
113
- resolve(true);
114
- })
115
- .catch((err) => {
116
- reject(err);
117
- });
118
- });
119
- }
120
119
  render() {
121
- var _a, _b, _c, _d, _e, _f;
122
120
  if (this.isLoading) {
123
121
  return (h("p", null, "Loading, please wait ..."));
124
122
  }
@@ -134,20 +132,24 @@ export class LotteryDrawResults {
134
132
  ": ",
135
133
  h("span", null, this.gameName)),
136
134
  h("div", { class: "TicketDate" },
137
- "Ticket Purchase Date: ",
138
- h("span", null, (_a = this.ticketData) === null || _a === void 0 ? void 0 : _a.createdAt.slice(0, 10))),
135
+ translate('ticketPurchaseDate', this.language),
136
+ ": ",
137
+ h("span", null, this.ticketDate.slice(0, 10))),
139
138
  h("div", { class: "TicketStatus" },
140
- "Status: ",
141
- h("span", null, (_b = this.ticketData) === null || _b === void 0 ? void 0 : _b.state))),
139
+ translate('ticketStatus', this.language),
140
+ ": ",
141
+ h("span", null, this.ticketStatus))),
142
142
  h("div", { class: "DrawResultsBody" },
143
143
  h("div", { class: "TicketIdContainer" },
144
144
  h("p", null,
145
- "Ticket id: ",
146
- h("span", null, (_c = this.ticketData) === null || _c === void 0 ? void 0 : _c.id))),
145
+ translate('ticketId', this.language),
146
+ ": ",
147
+ h("span", null, this.ticketId))),
147
148
  h("div", { class: "TicketAmountContainer" },
148
149
  h("p", null,
149
- "Ticket amount: ",
150
- h("span", null, (_d = this.ticketData) === null || _d === void 0 ? void 0 : _d.amount))),
150
+ translate('ticketAmount', this.language),
151
+ " ",
152
+ h("span", null, this.ticketAmount))),
151
153
  h("div", { class: "DrawNumbersGrid" },
152
154
  h("p", null,
153
155
  translate('drawNumbersGridTicket', this.language),
@@ -156,13 +158,14 @@ export class LotteryDrawResults {
156
158
  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 }))),
157
159
  h("div", { class: "DrawMultipler" },
158
160
  h("label", { class: "Label" },
159
- "Multiplier: ",
160
- h("span", null, JSON.stringify((_e = this.ticketData) === null || _e === void 0 ? void 0 : _e.multiplier)))),
161
+ translate('winUpTo', this.language),
162
+ " ",
163
+ h("span", null, JSON.stringify(this.ticketMultiplier)))),
161
164
  h("div", { class: "NumberOfDrawsContainer" },
162
165
  h("p", null,
163
166
  translate('numberOfDraws', this.language),
164
- ": ", (_f = this.ticketData) === null || _f === void 0 ? void 0 :
165
- _f.drawCount),
167
+ ": ",
168
+ this.ticketDrawCount),
166
169
  h("div", { class: "DrawTicketsContainer" }, this.drawResults.map((item, index) => h("div", { class: "ExpandableBoxes" },
167
170
  h("div", { class: this.toggleDrawer[index] ? 'ExpandableBox ShowBox' : 'ExpandableBox', onClick: () => this.changeBox(index) },
168
171
  h("div", { class: "TicketResultContainer" },
@@ -193,7 +196,8 @@ export class LotteryDrawResults {
193
196
  h("div", { class: "DrawNumbersGrid" }),
194
197
  h("div", { class: "DrawMultipler" },
195
198
  h("label", { class: "Label" },
196
- "Multiplier: ",
199
+ translate('winUpTo', this.language),
200
+ " ",
197
201
  item.multiplier)))))))))
198
202
  :
199
203
  h("div", { class: "DrawResultsArea" }, this.drawData &&
@@ -216,7 +220,8 @@ export class LotteryDrawResults {
216
220
  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 })),
217
221
  h("div", { class: "DrawMultipler" },
218
222
  h("label", { class: "Label" },
219
- "Multiplier: ",
223
+ translate('multiplier', this.language),
224
+ " ",
220
225
  this.multiplier))))))));
221
226
  }
222
227
  }
@@ -328,10 +333,11 @@ export class LotteryDrawResults {
328
333
  "optional": false,
329
334
  "docs": {
330
335
  "tags": [],
331
- "text": "Shows results for a specific drawID (option)"
336
+ "text": "The drawID (option)"
332
337
  },
333
338
  "attribute": "draw-id",
334
- "reflect": false
339
+ "reflect": false,
340
+ "defaultValue": "''"
335
341
  },
336
342
  "gameName": {
337
343
  "type": "string",
@@ -345,16 +351,123 @@ export class LotteryDrawResults {
345
351
  "optional": false,
346
352
  "docs": {
347
353
  "tags": [],
348
- "text": ""
354
+ "text": "The game name"
349
355
  },
350
356
  "attribute": "game-name",
351
357
  "reflect": false,
352
358
  "defaultValue": "''"
359
+ },
360
+ "ticketDate": {
361
+ "type": "string",
362
+ "mutable": false,
363
+ "complexType": {
364
+ "original": "string",
365
+ "resolved": "string",
366
+ "references": {}
367
+ },
368
+ "required": false,
369
+ "optional": false,
370
+ "docs": {
371
+ "tags": [],
372
+ "text": "The ticket submission date"
373
+ },
374
+ "attribute": "ticket-date",
375
+ "reflect": false,
376
+ "defaultValue": "''"
377
+ },
378
+ "ticketStatus": {
379
+ "type": "string",
380
+ "mutable": false,
381
+ "complexType": {
382
+ "original": "string",
383
+ "resolved": "string",
384
+ "references": {}
385
+ },
386
+ "required": false,
387
+ "optional": false,
388
+ "docs": {
389
+ "tags": [],
390
+ "text": "The ticket status"
391
+ },
392
+ "attribute": "ticket-status",
393
+ "reflect": false,
394
+ "defaultValue": "''"
395
+ },
396
+ "ticketId": {
397
+ "type": "string",
398
+ "mutable": false,
399
+ "complexType": {
400
+ "original": "string",
401
+ "resolved": "string",
402
+ "references": {}
403
+ },
404
+ "required": false,
405
+ "optional": false,
406
+ "docs": {
407
+ "tags": [],
408
+ "text": "The ticket id"
409
+ },
410
+ "attribute": "ticket-id",
411
+ "reflect": false,
412
+ "defaultValue": "''"
413
+ },
414
+ "ticketAmount": {
415
+ "type": "string",
416
+ "mutable": false,
417
+ "complexType": {
418
+ "original": "string",
419
+ "resolved": "string",
420
+ "references": {}
421
+ },
422
+ "required": false,
423
+ "optional": false,
424
+ "docs": {
425
+ "tags": [],
426
+ "text": "The ticket amount"
427
+ },
428
+ "attribute": "ticket-amount",
429
+ "reflect": false,
430
+ "defaultValue": "''"
431
+ },
432
+ "ticketMultiplier": {
433
+ "type": "boolean",
434
+ "mutable": false,
435
+ "complexType": {
436
+ "original": "boolean",
437
+ "resolved": "boolean",
438
+ "references": {}
439
+ },
440
+ "required": false,
441
+ "optional": false,
442
+ "docs": {
443
+ "tags": [],
444
+ "text": "The ticket multiplier"
445
+ },
446
+ "attribute": "ticket-multiplier",
447
+ "reflect": false,
448
+ "defaultValue": "false"
449
+ },
450
+ "ticketDrawCount": {
451
+ "type": "number",
452
+ "mutable": false,
453
+ "complexType": {
454
+ "original": "number",
455
+ "resolved": "number",
456
+ "references": {}
457
+ },
458
+ "required": false,
459
+ "optional": false,
460
+ "docs": {
461
+ "tags": [],
462
+ "text": "The ticket draw count"
463
+ },
464
+ "attribute": "ticket-draw-count",
465
+ "reflect": false,
466
+ "defaultValue": "0"
353
467
  }
354
468
  }; }
355
469
  static get states() { return {
356
470
  "multiplier": {},
357
- "ticketData": {},
358
471
  "isLoading": {},
359
472
  "drawResults": {},
360
473
  "rules": {},
@@ -10,7 +10,13 @@ const TRANSLATIONS = {
10
10
  drawNumbersGridTicket: 'Draw numbers Grid B',
11
11
  ticketResult: 'Ticket result',
12
12
  amountWon: 'Amount won',
13
- numberOfDraws: 'Number of draws'
13
+ numberOfDraws: 'Number of draws',
14
+ multiplier: 'Multiplier:',
15
+ ticketPurchaseDate: 'Ticket Purchase Date',
16
+ ticketStatus: 'Ticket Status',
17
+ ticketId: 'Ticket ID',
18
+ ticketAmount: 'Ticket Amount',
19
+ winUpTo: 'Win up to',
14
20
  },
15
21
  ro: {
16
22
  drawResultsHeader: 'Ultimele rezultate extragere',
@@ -21,7 +27,13 @@ const TRANSLATIONS = {
21
27
  drawNumbersGridTicket: 'Numerele extrase Grid B',
22
28
  ticketResult: 'Rezultatul biletului',
23
29
  amountWon: 'Suma castigata',
24
- numberOfDraws: 'Numarul de extrageri'
30
+ numberOfDraws: 'Numarul de extrageri',
31
+ multiplier: 'Multiplicator:',
32
+ ticketPurchaseDate: 'Data achizitionarii biletului',
33
+ ticketStatus: 'Statusul biletului',
34
+ ticketId: 'Id biletul',
35
+ ticketAmount: 'Valoarea biletului',
36
+ winUpTo: 'Poti castiga'
25
37
  },
26
38
  };
27
39
  export const translate = (key, customLang) => {
@@ -1,5 +1,6 @@
1
1
  /* LotteryDrawResults custom elements */
2
- export { LotteryDrawResults as LotteryDrawResults } from '../types/components/lottery-draw-results/lottery-draw-results';
2
+
3
+ import type { Components, JSX } from "../types/components";
3
4
 
4
5
  /**
5
6
  * Used to manually set the base path where assets can be found.
@@ -19,4 +20,7 @@ export interface SetPlatformOptions {
19
20
  rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
20
21
  }
21
22
  export declare const setPlatformOptions: (opts: SetPlatformOptions) => void;
23
+
24
+ export type { Components, JSX };
25
+
22
26
  export * from '../types';
@@ -1,2 +1 @@
1
1
  export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
2
- export { LotteryDrawResults, defineCustomElement as defineCustomElementLotteryDrawResults } from './lottery-draw-results.js';
@@ -13,7 +13,13 @@ const TRANSLATIONS = {
13
13
  drawNumbersGridTicket: 'Draw numbers Grid B',
14
14
  ticketResult: 'Ticket result',
15
15
  amountWon: 'Amount won',
16
- numberOfDraws: 'Number of draws'
16
+ numberOfDraws: 'Number of draws',
17
+ multiplier: 'Multiplier:',
18
+ ticketPurchaseDate: 'Ticket Purchase Date',
19
+ ticketStatus: 'Ticket Status',
20
+ ticketId: 'Ticket ID',
21
+ ticketAmount: 'Ticket Amount',
22
+ winUpTo: 'Win up to',
17
23
  },
18
24
  ro: {
19
25
  drawResultsHeader: 'Ultimele rezultate extragere',
@@ -24,7 +30,13 @@ const TRANSLATIONS = {
24
30
  drawNumbersGridTicket: 'Numerele extrase Grid B',
25
31
  ticketResult: 'Rezultatul biletului',
26
32
  amountWon: 'Suma castigata',
27
- numberOfDraws: 'Numarul de extrageri'
33
+ numberOfDraws: 'Numarul de extrageri',
34
+ multiplier: 'Multiplicator:',
35
+ ticketPurchaseDate: 'Data achizitionarii biletului',
36
+ ticketStatus: 'Statusul biletului',
37
+ ticketId: 'Id biletul',
38
+ ticketAmount: 'Valoarea biletului',
39
+ winUpTo: 'Poti castiga'
28
40
  },
29
41
  };
30
42
  const translate = (key, customLang) => {
@@ -32,22 +44,8 @@ const translate = (key, customLang) => {
32
44
  return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
33
45
  };
34
46
 
35
- 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}";
47
+ const lotteryDrawResultsCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.TicketInfo{display:flex;flex-direction:row;gap:15px;background-color:#009993;color:#fff;padding:12px;font-size:14px}.DrawResultsArea{margin-top:15px}.DrawResultsSection{max-width:600px;margin:0px auto;border-radius:4px}.DrawResultsHeader{display:flex;justify-content:space-between;padding:10px 20px;background-color:#009993;color:#fff;font-size:14px;border-radius:4px 4px 0 0}.DrawResultsHeader h4{text-transform:uppercase;font-weight:400;margin:0;padding-top:15px}.DrawMultipler label{display:block;margin:15px 0}.DrawResultsBody{padding:0px 20px;margin-bottom:5px;border-radius:0 0 4px 4px;border:1px solid #009993}.DrawResultsBody .DrawNumbersGrid{font-size:14px}.DrawResultsBody .NumberOfDrawsContainer{display:table;width:100%}.Toggle{cursor:pointer;display:inline-block}.ToggleSwitch{display:inline-block;background:#ccc;border-radius:16px;width:58px;height:24px;position:relative;vertical-align:middle;transition:background 0.25s}.ToggleSwitch:before,.ToggleSwitch:after{content:\"\"}.ToggleSwitch:before{display:block;background:linear-gradient(to bottom, #fff 0%, #eee 100%);border-radius:50%;box-shadow:0 0 0 1px rgba(0, 0, 0, 0.25);width:16px;height:16px;position:absolute;top:4px;left:4px;transition:left 0.25s}.Toggle:hover .ToggleSwitch:before{background:linear-gradient(to bottom, #fff 0%, #fff 100%);box-shadow:0 0 0 1px rgba(0, 0, 0, 0.5)}.ToggleCheckbox:checked+.ToggleSwitch{background:#56c080}.ToggleCheckbox:checked+.ToggleSwitch:before{left:38px}.ToggleCheckbox{position:absolute;visibility:hidden}.Label{margin-right:5px;position:relative;top:2px}.DrawTicketsContainer{margin:30px auto}.ExpandableBoxes{position:relative}.ExpandableBox{line-height:12px;font-weight:lighter;width:100%;height:100%;max-height:70px;float:left;margin:0 0 20px 0;border:1px solid #f1f1f1;background:#fff;border-radius:4px;padding:10px;-webkit-transition:all 0.6s ease-in-out;-moz-transition:all 0.6s ease-in-out;-o-transition:all 0.6s ease-in-out;-ms-transition:all 0.6s ease-in-out;transition:all 0.6s ease-in-out;overflow:hidden;box-shadow:rgba(99, 99, 99, 0.2) 0px 2px 8px 0px}.ExpandableBox.ShowBox{max-height:400px;margin:0px 0px 20p 0px}.ExpandableBox.HideBox{width:0;height:0;overflow:hidden;border:none;padding:0;margin:0;opacity:0}";
36
48
 
37
- const DEFAULT_VALUES = {
38
- gamename: 'Chrono',
39
- gamedate: '24/09/2022',
40
- state: 'Processing',
41
- amount: 304444,
42
- ticketid: '6963444',
43
- selection: '[5, 6, 7, 8, 9]',
44
- multiplier: 4.5,
45
- resultstatus: 'Processing',
46
- drawstatus: 'Won',
47
- drawamount: 1022,
48
- drawid: '54545555',
49
- drawdate: '24/09/2032'
50
- };
51
49
  const LotteryDrawResults$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
52
50
  constructor() {
53
51
  super();
@@ -61,9 +59,39 @@ const LotteryDrawResults$1 = /*@__PURE__*/ proxyCustomElement(class extends HTML
61
59
  * Shows only the last draw
62
60
  */
63
61
  this.drawMode = false;
62
+ /**
63
+ * The drawID (option)
64
+ */
65
+ this.drawId = '';
66
+ /**
67
+ * The game name
68
+ */
64
69
  this.gameName = '';
65
- this.multiplier = 5.434;
66
- this.ticketData = {};
70
+ /**
71
+ * The ticket submission date
72
+ */
73
+ this.ticketDate = '';
74
+ /**
75
+ * The ticket status
76
+ */
77
+ this.ticketStatus = '';
78
+ /**
79
+ * The ticket id
80
+ */
81
+ this.ticketId = '';
82
+ /**
83
+ * The ticket amount
84
+ */
85
+ this.ticketAmount = '';
86
+ /**
87
+ * The ticket multiplier
88
+ */
89
+ this.ticketMultiplier = false;
90
+ /**
91
+ * The ticket draw count
92
+ */
93
+ this.ticketDrawCount = 0;
94
+ this.multiplier = 3;
67
95
  this.isLoading = true;
68
96
  this.drawResults = [];
69
97
  this.rules = {};
@@ -85,9 +113,6 @@ const LotteryDrawResults$1 = /*@__PURE__*/ proxyCustomElement(class extends HTML
85
113
  connectedCallback() {
86
114
  let promises = [];
87
115
  promises.push(this.getGameData());
88
- if (this.playerId) {
89
- promises.push(this.getTicketData());
90
- }
91
116
  if (this.drawId) {
92
117
  promises.push(this.getDrawData());
93
118
  }
@@ -107,9 +132,11 @@ const LotteryDrawResults$1 = /*@__PURE__*/ proxyCustomElement(class extends HTML
107
132
  .then((data) => {
108
133
  this.drawData = data;
109
134
  resolve(true);
135
+ this.isLoading = false;
110
136
  })
111
137
  .catch((err) => {
112
138
  reject(err);
139
+ this.isLoading = false;
113
140
  });
114
141
  });
115
142
  }
@@ -126,6 +153,8 @@ const LotteryDrawResults$1 = /*@__PURE__*/ proxyCustomElement(class extends HTML
126
153
  totalNumbers: data.rules.boards[0].totalNumbers
127
154
  };
128
155
  resolve(true);
156
+ this.isLoading = false;
157
+ this.hasErrors = false;
129
158
  })
130
159
  .catch((err) => {
131
160
  this.isLoading = false;
@@ -135,26 +164,7 @@ const LotteryDrawResults$1 = /*@__PURE__*/ proxyCustomElement(class extends HTML
135
164
  });
136
165
  });
137
166
  }
138
- getTicketData() {
139
- return new Promise((resolve, reject) => {
140
- let url = new URL(`${this.endpoint}/tickets/player/${this.playerId}`);
141
- fetch(url.href)
142
- .then((response) => {
143
- return response.json();
144
- })
145
- .then((data) => {
146
- this.ticketData = data.length === 0 ? DEFAULT_VALUES : data[1];
147
- this.drawResults = this.ticketData.drawResults.map((item) => item);
148
- this.selection = this.ticketData.selection[0].join(',');
149
- resolve(true);
150
- })
151
- .catch((err) => {
152
- reject(err);
153
- });
154
- });
155
- }
156
167
  render() {
157
- var _a, _b, _c, _d, _e, _f;
158
168
  if (this.isLoading) {
159
169
  return (h("p", null, "Loading, please wait ..."));
160
170
  }
@@ -163,12 +173,11 @@ const LotteryDrawResults$1 = /*@__PURE__*/ proxyCustomElement(class extends HTML
163
173
  }
164
174
  else {
165
175
  return (h("section", { class: "DrawResultsSection" }, !this.drawMode ?
166
- 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 :
167
- _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' &&
168
- 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)))))))))
176
+ h("div", { class: "DrawResultsArea" }, h("div", { class: "TicketInfo" }, h("div", { class: "TicketGameName" }, translate('drawName', this.language), ": ", h("span", null, this.gameName)), h("div", { class: "TicketDate" }, translate('ticketPurchaseDate', this.language), ": ", h("span", null, this.ticketDate.slice(0, 10))), h("div", { class: "TicketStatus" }, translate('ticketStatus', this.language), ": ", h("span", null, this.ticketStatus))), h("div", { class: "DrawResultsBody" }, h("div", { class: "TicketIdContainer" }, h("p", null, translate('ticketId', this.language), ": ", h("span", null, this.ticketId))), h("div", { class: "TicketAmountContainer" }, h("p", null, translate('ticketAmount', this.language), " ", h("span", null, this.ticketAmount))), h("div", { class: "DrawNumbersGrid" }, h("p", null, translate('drawNumbersGridTicket', this.language), ":"), h("div", { class: "BulletContainer" }, h("lottery-grid", { "maximum-allowed": this.rules.maximumAllowed, "total-numbers": this.rules.totalNumbers, "selected-numbers": this.selection, selectable: false, "display-selected": true, language: this.language }))), h("div", { class: "DrawMultipler" }, h("label", { class: "Label" }, translate('winUpTo', this.language), " ", h("span", null, JSON.stringify(this.ticketMultiplier)))), h("div", { class: "NumberOfDrawsContainer" }, h("p", null, translate('numberOfDraws', this.language), ": ", this.ticketDrawCount), h("div", { class: "DrawTicketsContainer" }, this.drawResults.map((item, index) => h("div", { class: "ExpandableBoxes" }, h("div", { class: this.toggleDrawer[index] ? 'ExpandableBox ShowBox' : 'ExpandableBox', onClick: () => this.changeBox(index) }, h("div", { class: "TicketResultContainer" }, h("p", null, translate('ticketResult', this.language), ": ", item.status)), item.state == 'won' &&
177
+ h("div", { class: "AmountWonContainer" }, h("p", null, translate('amountWon', this.language), ": ", Number(item.amount).toLocaleString('en'), " ", item.currency)), h("div", { class: "DrawIdContainer" }, h("p", null, translate('drawId', this.language), ": ", item.drawId)), h("div", { class: "DrawDateContainer" }, h("p", null, translate('drawDate', this.language), ": ", item.updatedAt.slice(0, 10), " | ", item.updatedAt.slice(11, 19))), h("div", { class: "DrawNumbersGrid" }), h("div", { class: "DrawMultipler" }, h("label", { class: "Label" }, translate('winUpTo', this.language), " ", item.multiplier)))))))))
169
178
  :
170
179
  h("div", { class: "DrawResultsArea" }, this.drawData &&
171
- 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))))))));
180
+ h("div", null, h("div", { class: "DrawResultsHeader" }, h("span", null, translate('drawId', this.language), ": ", this.drawData.id), h("span", null, translate('drawDate', this.language), ": ", this.drawData.date.slice(0, 10))), h("div", { class: "DrawResultsBody" }, h("div", { class: "DrawNumbersGrid" }, h("p", null, translate('drawNumbersGridDraw', this.language), ":"), h("div", { class: "BulletContainer" }, h("lottery-grid", { "maximum-allowed": this.rules.maximumAllowed, "total-numbers": this.rules.totalNumbers, selectedNumbers: this.drawData.winningNumbers.join(','), "display-selected": true, selectable: false, language: this.language })), h("div", { class: "DrawMultipler" }, h("label", { class: "Label" }, translate('multiplier', this.language), " ", this.multiplier))))))));
172
181
  }
173
182
  }
174
183
  static get style() { return lotteryDrawResultsCss; }
@@ -180,8 +189,13 @@ const LotteryDrawResults$1 = /*@__PURE__*/ proxyCustomElement(class extends HTML
180
189
  "drawMode": [4, "draw-mode"],
181
190
  "drawId": [1, "draw-id"],
182
191
  "gameName": [1, "game-name"],
192
+ "ticketDate": [1, "ticket-date"],
193
+ "ticketStatus": [1, "ticket-status"],
194
+ "ticketId": [1, "ticket-id"],
195
+ "ticketAmount": [1, "ticket-amount"],
196
+ "ticketMultiplier": [4, "ticket-multiplier"],
197
+ "ticketDrawCount": [2, "ticket-draw-count"],
183
198
  "multiplier": [32],
184
- "ticketData": [32],
185
199
  "isLoading": [32],
186
200
  "drawResults": [32],
187
201
  "rules": [32],
@@ -54,7 +54,7 @@ const registerStyle = (scopeId, cssText, allowCS) => {
54
54
  };
55
55
  const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
56
56
  let scopeId = getScopeId(cmpMeta);
57
- const style = styles.get(scopeId);
57
+ let style = styles.get(scopeId);
58
58
  // if an element is NOT connected then getRootNode() will return the wrong root node
59
59
  // so the fallback is to always use the document for the root node in those cases
60
60
  styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
@@ -134,7 +134,7 @@ const h = (nodeName, vnodeData, ...children) => {
134
134
  let child = null;
135
135
  let simple = false;
136
136
  let lastSimple = false;
137
- const vNodeChildren = [];
137
+ let vNodeChildren = [];
138
138
  const walk = (c) => {
139
139
  for (let i = 0; i < c.length; i++) {
140
140
  child = c[i];
@@ -257,7 +257,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
257
257
  if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
258
258
  try {
259
259
  if (!elm.tagName.includes('-')) {
260
- const n = newValue == null ? '' : newValue;
260
+ let n = newValue == null ? '' : newValue;
261
261
  // Workaround for Safari, moving the <input> caret when re-assigning the same valued
262
262
  if (memberName === 'list') {
263
263
  isProp = false;
@@ -314,7 +314,7 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
314
314
  };
315
315
  const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
316
316
  // tslint:disable-next-line: prefer-const
317
- const newVNode = newParentVNode.$children$[childIndex];
317
+ let newVNode = newParentVNode.$children$[childIndex];
318
318
  let i = 0;
319
319
  let elm;
320
320
  let childNode;
@@ -693,6 +693,10 @@ const parsePropertyValue = (propValue, propType) => {
693
693
  // but we'll cheat here and say that the string "false" is the boolean false
694
694
  return propValue === 'false' ? false : propValue === '' || !!propValue;
695
695
  }
696
+ if (propType & 2 /* Number */) {
697
+ // force it to be a number
698
+ return parseFloat(propValue);
699
+ }
696
700
  if (propType & 1 /* String */) {
697
701
  // could have been passed as a number or boolean
698
702
  // but we still want it as a string
@@ -1062,9 +1066,7 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
1062
1066
  if (module) {
1063
1067
  return module[exportName];
1064
1068
  }
1065
- /*!__STENCIL_STATIC_IMPORT_SWITCH__*/
1066
1069
  return import(
1067
- /* @vite-ignore */
1068
1070
  /* webpackInclude: /\.entry\.js$/ */
1069
1071
  /* webpackExclude: /\.system\.entry\.js$/ */
1070
1072
  /* webpackMode: "lazy" */
@@ -1,7 +1,7 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-17920f23.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-c6e6b7f8.js';
2
2
 
3
3
  /*
4
- Stencil Client Patch Esm v2.17.0 | MIT Licensed | https://stenciljs.com
4
+ Stencil Client Patch Esm v2.15.2 | MIT Licensed | https://stenciljs.com
5
5
  */
6
6
  const patchEsm = () => {
7
7
  return promiseResolve();
@@ -10,7 +10,7 @@ const patchEsm = () => {
10
10
  const defineCustomElements = (win, options) => {
11
11
  if (typeof window === 'undefined') return Promise.resolve();
12
12
  return patchEsm().then(() => {
13
- return bootstrapLazy([["lottery-draw-results",[[1,"lottery-draw-results",{"endpoint":[1],"gameId":[1,"game-id"],"language":[1],"playerId":[1,"player-id"],"drawMode":[4,"draw-mode"],"drawId":[1,"draw-id"],"gameName":[1,"game-name"],"multiplier":[32],"ticketData":[32],"isLoading":[32],"drawResults":[32],"rules":[32],"toggleDrawer":[32],"hasErrors":[32],"errorText":[32]}]]]], options);
13
+ return bootstrapLazy([["lottery-draw-results",[[1,"lottery-draw-results",{"endpoint":[1],"gameId":[1,"game-id"],"language":[1],"playerId":[1,"player-id"],"drawMode":[4,"draw-mode"],"drawId":[1,"draw-id"],"gameName":[1,"game-name"],"ticketDate":[1,"ticket-date"],"ticketStatus":[1,"ticket-status"],"ticketId":[1,"ticket-id"],"ticketAmount":[1,"ticket-amount"],"ticketMultiplier":[4,"ticket-multiplier"],"ticketDrawCount":[2,"ticket-draw-count"],"multiplier":[32],"isLoading":[32],"drawResults":[32],"rules":[32],"toggleDrawer":[32],"hasErrors":[32],"errorText":[32]}]]]], options);
14
14
  });
15
15
  };
16
16