@everymatrix/lottery-game-page 1.44.0 → 1.45.0

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 (194) hide show
  1. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  2. package/dist/cjs/{helper-filters_2.cjs.entry.js → helper-accordion_13.cjs.entry.js} +3329 -1000
  3. package/dist/cjs/helper-pagination.cjs.entry.js +195 -226
  4. package/dist/cjs/index-f3851683.js +1345 -0
  5. package/dist/cjs/index.cjs.js +0 -2
  6. package/dist/cjs/loader.cjs.js +7 -15
  7. package/dist/cjs/lottery-game-page.cjs.js +16 -12
  8. package/dist/collection/collection-manifest.json +4 -10
  9. package/dist/collection/components/lottery-game-page/index.js +1 -0
  10. package/dist/collection/components/lottery-game-page/lottery-game-page.css +1 -1
  11. package/dist/collection/components/lottery-game-page/lottery-game-page.js +580 -646
  12. package/dist/collection/index.js +0 -1
  13. package/dist/collection/utils/locale.utils.js +117 -118
  14. package/dist/collection/utils/utils.js +4 -5
  15. package/dist/esm/app-globals-0f993ce5.js +3 -0
  16. package/dist/esm/{helper-filters_2.entry.js → helper-accordion_13.entry.js} +3319 -1001
  17. package/dist/esm/helper-pagination.entry.js +195 -226
  18. package/dist/esm/index-8248702b.js +1316 -0
  19. package/dist/esm/index.js +0 -2
  20. package/dist/esm/loader.js +8 -16
  21. package/dist/esm/lottery-game-page.js +14 -13
  22. package/dist/lottery-game-page/index.esm.js +0 -2
  23. package/dist/lottery-game-page/lottery-game-page.esm.js +1 -2
  24. package/dist/lottery-game-page/p-4254ae78.entry.js +3567 -0
  25. package/dist/lottery-game-page/p-89956c67.entry.js +1 -0
  26. package/dist/lottery-game-page/p-8f2c63c7.js +2 -0
  27. package/dist/lottery-game-page/p-e1255160.js +1 -0
  28. package/dist/stencil.config.dev.js +17 -0
  29. package/dist/stencil.config.js +12 -45
  30. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/lottery-game-page/.stencil/packages/stencil/lottery-game-page/stencil.config.d.ts +2 -0
  31. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/lottery-game-page/.stencil/packages/stencil/lottery-game-page/stencil.config.dev.d.ts +2 -0
  32. package/dist/types/components/lottery-game-page/index.d.ts +1 -0
  33. package/dist/types/components/lottery-game-page/lottery-game-page.d.ts +98 -98
  34. package/dist/types/components.d.ts +18 -2
  35. package/dist/types/stencil-public-runtime.d.ts +142 -33
  36. package/loader/cdn.js +1 -3
  37. package/loader/index.cjs.js +1 -3
  38. package/loader/index.d.ts +13 -1
  39. package/loader/index.es2017.js +1 -3
  40. package/loader/index.js +1 -3
  41. package/loader/package.json +1 -0
  42. package/package.json +13 -7
  43. package/dist/assets/chrono_desktop.png +0 -0
  44. package/dist/assets/chrono_lottery_mobile.png +0 -0
  45. package/dist/cjs/helper-accordion.cjs.entry.js +0 -134
  46. package/dist/cjs/helper-accordion.cjs.entry.js.map +0 -1
  47. package/dist/cjs/helper-filters_2.cjs.entry.js.map +0 -1
  48. package/dist/cjs/helper-modal.cjs.entry.js +0 -78
  49. package/dist/cjs/helper-modal.cjs.entry.js.map +0 -1
  50. package/dist/cjs/helper-pagination.cjs.entry.js.map +0 -1
  51. package/dist/cjs/helper-tab.cjs.entry.js +0 -70
  52. package/dist/cjs/helper-tab.cjs.entry.js.map +0 -1
  53. package/dist/cjs/helper-tabs.cjs.entry.js +0 -76
  54. package/dist/cjs/helper-tabs.cjs.entry.js.map +0 -1
  55. package/dist/cjs/index-cd44e726.js +0 -1326
  56. package/dist/cjs/index-cd44e726.js.map +0 -1
  57. package/dist/cjs/index.cjs.js.map +0 -1
  58. package/dist/cjs/loader.cjs.js.map +0 -1
  59. package/dist/cjs/lottery-bullet_2.cjs.entry.js +0 -281
  60. package/dist/cjs/lottery-bullet_2.cjs.entry.js.map +0 -1
  61. package/dist/cjs/lottery-draw-results-history.cjs.entry.js +0 -240
  62. package/dist/cjs/lottery-draw-results-history.cjs.entry.js.map +0 -1
  63. package/dist/cjs/lottery-game-details.cjs.entry.js +0 -53
  64. package/dist/cjs/lottery-game-details.cjs.entry.js.map +0 -1
  65. package/dist/cjs/lottery-game-page.cjs.entry.js +0 -456
  66. package/dist/cjs/lottery-game-page.cjs.entry.js.map +0 -1
  67. package/dist/cjs/lottery-game-page.cjs.js.map +0 -1
  68. package/dist/cjs/lottery-ticket-controller.cjs.entry.js +0 -132
  69. package/dist/cjs/lottery-ticket-controller.cjs.entry.js.map +0 -1
  70. package/dist/cjs/lottery-ticket.cjs.entry.js +0 -233
  71. package/dist/cjs/lottery-ticket.cjs.entry.js.map +0 -1
  72. package/dist/collection/components/lottery-game-page/lottery-game-page.js.map +0 -1
  73. package/dist/collection/index.js.map +0 -1
  74. package/dist/collection/utils/locale.utils.js.map +0 -1
  75. package/dist/collection/utils/utils.js.map +0 -1
  76. package/dist/components/helper-accordion.js +0 -8
  77. package/dist/components/helper-accordion.js.map +0 -1
  78. package/dist/components/helper-accordion2.js +0 -161
  79. package/dist/components/helper-accordion2.js.map +0 -1
  80. package/dist/components/helper-filters.js +0 -8
  81. package/dist/components/helper-filters.js.map +0 -1
  82. package/dist/components/helper-filters2.js +0 -23566
  83. package/dist/components/helper-filters2.js.map +0 -1
  84. package/dist/components/helper-modal.js +0 -8
  85. package/dist/components/helper-modal.js.map +0 -1
  86. package/dist/components/helper-modal2.js +0 -96
  87. package/dist/components/helper-modal2.js.map +0 -1
  88. package/dist/components/helper-pagination.js +0 -293
  89. package/dist/components/helper-pagination.js.map +0 -1
  90. package/dist/components/helper-tab.js +0 -8
  91. package/dist/components/helper-tab.js.map +0 -1
  92. package/dist/components/helper-tab2.js +0 -89
  93. package/dist/components/helper-tab2.js.map +0 -1
  94. package/dist/components/helper-tabs.js +0 -8
  95. package/dist/components/helper-tabs.js.map +0 -1
  96. package/dist/components/helper-tabs2.js +0 -105
  97. package/dist/components/helper-tabs2.js.map +0 -1
  98. package/dist/components/index.d.ts +0 -26
  99. package/dist/components/index.js +0 -3
  100. package/dist/components/index.js.map +0 -1
  101. package/dist/components/lottery-bullet.js +0 -8
  102. package/dist/components/lottery-bullet.js.map +0 -1
  103. package/dist/components/lottery-bullet2.js +0 -94
  104. package/dist/components/lottery-bullet2.js.map +0 -1
  105. package/dist/components/lottery-draw-results-history.js +0 -8
  106. package/dist/components/lottery-draw-results-history.js.map +0 -1
  107. package/dist/components/lottery-draw-results-history2.js +0 -298
  108. package/dist/components/lottery-draw-results-history2.js.map +0 -1
  109. package/dist/components/lottery-draw-results.js +0 -8
  110. package/dist/components/lottery-draw-results.js.map +0 -1
  111. package/dist/components/lottery-draw-results2.js +0 -346
  112. package/dist/components/lottery-draw-results2.js.map +0 -1
  113. package/dist/components/lottery-game-details.js +0 -8
  114. package/dist/components/lottery-game-details.js.map +0 -1
  115. package/dist/components/lottery-game-details2.js +0 -87
  116. package/dist/components/lottery-game-details2.js.map +0 -1
  117. package/dist/components/lottery-game-page.d.ts +0 -11
  118. package/dist/components/lottery-game-page.js +0 -572
  119. package/dist/components/lottery-game-page.js.map +0 -1
  120. package/dist/components/lottery-grid.js +0 -8
  121. package/dist/components/lottery-grid.js.map +0 -1
  122. package/dist/components/lottery-grid2.js +0 -248
  123. package/dist/components/lottery-grid2.js.map +0 -1
  124. package/dist/components/lottery-ticket-controller.js +0 -8
  125. package/dist/components/lottery-ticket-controller.js.map +0 -1
  126. package/dist/components/lottery-ticket-controller2.js +0 -185
  127. package/dist/components/lottery-ticket-controller2.js.map +0 -1
  128. package/dist/components/lottery-ticket.js +0 -8
  129. package/dist/components/lottery-ticket.js.map +0 -1
  130. package/dist/components/lottery-ticket2.js +0 -276
  131. package/dist/components/lottery-ticket2.js.map +0 -1
  132. package/dist/esm/helper-accordion.entry.js +0 -130
  133. package/dist/esm/helper-accordion.entry.js.map +0 -1
  134. package/dist/esm/helper-filters_2.entry.js.map +0 -1
  135. package/dist/esm/helper-modal.entry.js +0 -74
  136. package/dist/esm/helper-modal.entry.js.map +0 -1
  137. package/dist/esm/helper-pagination.entry.js.map +0 -1
  138. package/dist/esm/helper-tab.entry.js +0 -66
  139. package/dist/esm/helper-tab.entry.js.map +0 -1
  140. package/dist/esm/helper-tabs.entry.js +0 -72
  141. package/dist/esm/helper-tabs.entry.js.map +0 -1
  142. package/dist/esm/index-d1baacd4.js +0 -1298
  143. package/dist/esm/index-d1baacd4.js.map +0 -1
  144. package/dist/esm/index.js.map +0 -1
  145. package/dist/esm/loader.js.map +0 -1
  146. package/dist/esm/lottery-bullet_2.entry.js +0 -276
  147. package/dist/esm/lottery-bullet_2.entry.js.map +0 -1
  148. package/dist/esm/lottery-draw-results-history.entry.js +0 -236
  149. package/dist/esm/lottery-draw-results-history.entry.js.map +0 -1
  150. package/dist/esm/lottery-game-details.entry.js +0 -49
  151. package/dist/esm/lottery-game-details.entry.js.map +0 -1
  152. package/dist/esm/lottery-game-page.entry.js +0 -452
  153. package/dist/esm/lottery-game-page.entry.js.map +0 -1
  154. package/dist/esm/lottery-game-page.js.map +0 -1
  155. package/dist/esm/lottery-ticket-controller.entry.js +0 -128
  156. package/dist/esm/lottery-ticket-controller.entry.js.map +0 -1
  157. package/dist/esm/lottery-ticket.entry.js +0 -229
  158. package/dist/esm/lottery-ticket.entry.js.map +0 -1
  159. package/dist/esm/polyfills/core-js.js +0 -11
  160. package/dist/esm/polyfills/css-shim.js +0 -1
  161. package/dist/esm/polyfills/dom.js +0 -79
  162. package/dist/esm/polyfills/es5-html-element.js +0 -1
  163. package/dist/esm/polyfills/index.js +0 -34
  164. package/dist/esm/polyfills/system.js +0 -6
  165. package/dist/lottery-game-page/index.esm.js.map +0 -1
  166. package/dist/lottery-game-page/lottery-game-page.esm.js.map +0 -1
  167. package/dist/lottery-game-page/p-12340c50.entry.js +0 -2921
  168. package/dist/lottery-game-page/p-12340c50.entry.js.map +0 -1
  169. package/dist/lottery-game-page/p-15309f9a.entry.js +0 -2
  170. package/dist/lottery-game-page/p-15309f9a.entry.js.map +0 -1
  171. package/dist/lottery-game-page/p-167c9dbe.entry.js +0 -2
  172. package/dist/lottery-game-page/p-167c9dbe.entry.js.map +0 -1
  173. package/dist/lottery-game-page/p-20e0c81c.entry.js +0 -2
  174. package/dist/lottery-game-page/p-20e0c81c.entry.js.map +0 -1
  175. package/dist/lottery-game-page/p-59a96854.entry.js +0 -2
  176. package/dist/lottery-game-page/p-59a96854.entry.js.map +0 -1
  177. package/dist/lottery-game-page/p-662d9dac.entry.js +0 -2
  178. package/dist/lottery-game-page/p-662d9dac.entry.js.map +0 -1
  179. package/dist/lottery-game-page/p-66729e9c.entry.js +0 -2
  180. package/dist/lottery-game-page/p-66729e9c.entry.js.map +0 -1
  181. package/dist/lottery-game-page/p-721345a7.entry.js +0 -2
  182. package/dist/lottery-game-page/p-721345a7.entry.js.map +0 -1
  183. package/dist/lottery-game-page/p-76c280ec.entry.js +0 -2
  184. package/dist/lottery-game-page/p-76c280ec.entry.js.map +0 -1
  185. package/dist/lottery-game-page/p-cd4aa6a4.entry.js +0 -2
  186. package/dist/lottery-game-page/p-cd4aa6a4.entry.js.map +0 -1
  187. package/dist/lottery-game-page/p-e765c7d9.js +0 -2
  188. package/dist/lottery-game-page/p-e765c7d9.js.map +0 -1
  189. package/dist/lottery-game-page/p-e86e2389.entry.js +0 -2
  190. package/dist/lottery-game-page/p-e86e2389.entry.js.map +0 -1
  191. package/dist/lottery-game-page/p-f399eef1.entry.js +0 -2
  192. package/dist/lottery-game-page/p-f399eef1.entry.js.map +0 -1
  193. package/dist/stencil.config.js.map +0 -1
  194. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/lottery-game-page/.stencil/packages/lottery-game-page/stencil.config.d.ts +0 -2
@@ -1,75 +1,166 @@
1
- import { r as registerInstance, c as createEvent, h as h$2 } from './index-d1baacd4.js';
1
+ import { r as registerInstance, c as createEvent, h as h$2, g as getElement, a as getAssetPath } from './index-8248702b.js';
2
2
 
3
- const DEFAULT_LANGUAGE$1 = 'en';
4
- const SUPPORTED_LANGUAGES$1 = ['ro', 'en', 'hr'];
5
- const TRANSLATIONS$1 = {
6
- en: {
7
- filterOpen: 'Filter',
8
- filterClear: 'Clear',
9
- filterModalTicketTitle: 'Ticket Results',
10
- filterModalDrawTitle: 'Draws Results History',
11
- filterTicketPlaceholder: 'Search for a ticket ID',
12
- filterDrawPlaceholder: 'Search for a draw ID',
13
- filterDateRangePlaceholder: 'Date Range',
14
- filterModalButton: 'Search',
15
- filterFromCalendar: 'From',
16
- filterToCalendar: 'To',
17
- filterOrDate: 'or search by date'
18
- },
19
- ro: {
20
- filterOpen: 'Filtrare',
21
- filterClear: 'Stergere',
22
- filterModalTicketTitle: 'Rezultatele biletelor',
23
- filterModalDrawTitle: 'Rezultatele draw-urilor',
24
- filterTicketPlaceholder: 'Cauta ID bilet',
25
- filterDrawPlaceholder: 'Cauta ID draw',
26
- filterDateRangePlaceholder: 'Perioada',
27
- filterModalButton: 'Cauta',
28
- filterOrDate: 'sau cauta dupa data'
29
- },
30
- fr: {
31
- filterOpen: 'Filter',
32
- filterClear: 'Clear',
33
- filterModalTicketTitle: 'Ticket Results',
34
- filterModalDrawTitle: 'Draws Results History',
35
- filterTicketPlaceholder: 'Search for a ticket ID',
36
- filterDrawPlaceholder: 'Search for a draw ID',
37
- filterDateRangePlaceholder: 'Date Range',
38
- filterModalButton: 'Search',
39
- filterFromCalendar: 'From',
40
- filterToCalendar: 'To',
41
- filterOrDate: 'or search by date'
42
- },
43
- ar: {
44
- filterOpen: 'Filter',
45
- filterClear: 'Clear',
46
- filterModalTicketTitle: 'Ticket Results',
47
- filterModalDrawTitle: 'Draws Results History',
48
- filterTicketPlaceholder: 'Search for a ticket ID',
49
- filterDrawPlaceholder: 'Search for a draw ID',
50
- filterDateRangePlaceholder: 'Date Range',
51
- filterModalButton: 'Search',
52
- filterFromCalendar: 'From',
53
- filterToCalendar: 'To',
54
- filterOrDate: 'or search by date'
55
- },
56
- hr: {
57
- filterOpen: 'Filter',
58
- filterClear: 'Očisti',
59
- filterModalTicketTitle: 'Rezultati listića',
60
- filterModalDrawTitle: 'Povijest rezultata Izvlačenja',
61
- filterTicketPlaceholder: 'Pretraga ID listića',
62
- filterDrawPlaceholder: 'Pretraga ID izvlačenja',
63
- filterDateRangePlaceholder: 'Raspon datuma',
64
- filterModalButton: 'Traži',
65
- filterFromCalendar: 'Od',
66
- filterToCalendar: 'Do',
67
- filterOrDate: 'ili tražite po datumu'
68
- }
3
+ const DEFAULT_LANGUAGE$6 = 'en';
4
+ const TRANSLATIONS$6 = {
5
+ en: {
6
+ deleteTicket: 'Delete ticket'
7
+ },
8
+ ro: {
9
+ deleteTicket: 'Sterge biletul'
10
+ },
11
+ fr: {
12
+ deleteTicket: 'Supprimer le billet'
13
+ },
14
+ ar: {
15
+ deleteTicket: 'حذف التذكرة'
16
+ },
17
+ hr: {
18
+ deleteTicket: 'Izbriši listić'
19
+ }
69
20
  };
70
- const translate$2 = (key, customLang) => {
71
- const lang = customLang;
72
- return TRANSLATIONS$1[lang !== undefined && SUPPORTED_LANGUAGES$1.includes(lang) ? lang : DEFAULT_LANGUAGE$1][key];
21
+ const translate$7 = (key, customLang) => {
22
+ const lang = customLang;
23
+ return TRANSLATIONS$6[(lang !== undefined) && (lang in TRANSLATIONS$6) ? lang : DEFAULT_LANGUAGE$6][key];
24
+ };
25
+
26
+ 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:5px;background:#009993;display:flex;gap:30px;border:1px solid #009993;padding:8px 10px;user-select:none;margin-bottom:1px;cursor:pointer}.Header:hover{background:#00ABA4}.Header .Title,.Header .Subtitle,.Header .Description{margin:0;font-size:14px;color:#fff;text-transform:capitalize}.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;cursor:pointer}.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}";
27
+ const HelperAccordionStyle0 = helperAccordionCss;
28
+
29
+ const HelperAccordion = class {
30
+ constructor(hostRef) {
31
+ registerInstance(this, hostRef);
32
+ this.accordionEvent = createEvent(this, "helperAccordionAction", 7);
33
+ this.setClientStyling = () => {
34
+ let sheet = document.createElement('style');
35
+ sheet.innerHTML = this.clientStyling;
36
+ this.stylingContainer.prepend(sheet);
37
+ };
38
+ this.setClientStylingURL = () => {
39
+ let cssFile = document.createElement('style');
40
+ setTimeout(() => {
41
+ cssFile.innerHTML = this.clientStylingUrlContent;
42
+ this.stylingContainer.prepend(cssFile);
43
+ }, 1);
44
+ };
45
+ this.ticketHistoryFlag = false;
46
+ this.headerTitle = '';
47
+ this.headerSubtitle = '';
48
+ this.description = '';
49
+ this.footer = false;
50
+ this.deleteTab = false;
51
+ this.postMessage = false;
52
+ this.eventName = 'helperAccordionAction';
53
+ this.collapsed = true;
54
+ this.language = 'en';
55
+ this.clientStyling = '';
56
+ this.clientStylingUrlContent = '';
57
+ this.showContent = undefined;
58
+ this.limitStylingAppends = false;
59
+ }
60
+ // @TODO fix the `any` type :)
61
+ connectedCallback() {
62
+ this.showContent = !this.collapsed;
63
+ }
64
+ componentDidRender() {
65
+ // start custom styling area
66
+ if (!this.limitStylingAppends && this.stylingContainer) {
67
+ if (this.clientStyling)
68
+ this.setClientStyling();
69
+ if (this.clientStylingUrlContent)
70
+ this.setClientStylingURL();
71
+ this.limitStylingAppends = true;
72
+ }
73
+ // end custom styling area
74
+ }
75
+ toggleContent() {
76
+ this.showContent = !this.showContent;
77
+ }
78
+ deleteAction() {
79
+ if (this.postMessage) {
80
+ // @TODO maybe change the name type, this one sucks
81
+ window.postMessage({ type: this.eventName }, window.location.href);
82
+ }
83
+ this.accordionEvent.emit();
84
+ }
85
+ render() {
86
+ return (h$2("div", { key: 'ad26faefd6e3dd089171c7e2bff13faa5a26d972', class: "Wrapper", ref: el => this.stylingContainer = el }, h$2("div", { key: 'bb7045653ec12a2526029589744f7ef014ec6a6a', class: this.ticketHistoryFlag === true ? 'HeaderTicketHistory' : 'Header', onClick: () => this.toggleContent() }, h$2("p", { key: 'ae30943582063e368e942124d8d5acadc1732629', class: "Title" }, this.headerTitle), h$2("p", { key: '7c35076cb768de784177988900c61fe40a71594c', class: "Subtitle" }, this.headerSubtitle), h$2("p", { key: 'daff2b456a427f45b00efc32ba33a68cdc2228f0', class: "Subtitle Description" }, this.description), h$2("span", { key: '0c4f942642da6e8b1ac3d2aeac46034963965d8f', class: "Expand" }, this.showContent ? '<' : '>')), this.showContent &&
87
+ h$2("div", { key: 'c688ab7cc629a3974b905a2fdc43063e996a3b90' }, h$2("div", { key: 'aaa3ad7d9f1503b8e1baaa2c756376a580ffe261', class: "Content" }, h$2("slot", { key: '8c5c8ff70857da9414c7284b052a3fbc5f503f4a', name: 'accordionContent' }), this.footer && this.showContent &&
88
+ h$2("div", { key: '917191f55a45647d708a5e3ff5e188c7e565a0c0' }, this.deleteTab &&
89
+ h$2("span", { key: 'e7fdd5b4f18cacaceda206b36ce9576cc3fc1472', class: "ActionButton", onClick: () => this.deleteAction() }, translate$7('deleteTicket', this.language)))))));
90
+ }
91
+ };
92
+ HelperAccordion.style = HelperAccordionStyle0;
93
+
94
+ const DEFAULT_LANGUAGE$5 = 'en';
95
+ const SUPPORTED_LANGUAGES$5 = ['ro', 'en', 'hr'];
96
+ const TRANSLATIONS$5 = {
97
+ en: {
98
+ filterOpen: 'Filter',
99
+ filterClear: 'Clear',
100
+ filterModalTicketTitle: 'Ticket Results',
101
+ filterModalDrawTitle: 'Draws Results History',
102
+ filterTicketPlaceholder: 'Search for a ticket ID',
103
+ filterDrawPlaceholder: 'Search for a draw ID',
104
+ filterDateRangePlaceholder: 'Date Range',
105
+ filterModalButton: 'Search',
106
+ filterFromCalendar: 'From',
107
+ filterToCalendar: 'To',
108
+ filterOrDate: 'or search by date'
109
+ },
110
+ ro: {
111
+ filterOpen: 'Filtrare',
112
+ filterClear: 'Stergere',
113
+ filterModalTicketTitle: 'Rezultatele biletelor',
114
+ filterModalDrawTitle: 'Rezultatele draw-urilor',
115
+ filterTicketPlaceholder: 'Cauta ID bilet',
116
+ filterDrawPlaceholder: 'Cauta ID draw',
117
+ filterDateRangePlaceholder: 'Perioada',
118
+ filterModalButton: 'Cauta',
119
+ filterOrDate: 'sau cauta dupa data'
120
+ },
121
+ fr: {
122
+ filterOpen: 'Filter',
123
+ filterClear: 'Clear',
124
+ filterModalTicketTitle: 'Ticket Results',
125
+ filterModalDrawTitle: 'Draws Results History',
126
+ filterTicketPlaceholder: 'Search for a ticket ID',
127
+ filterDrawPlaceholder: 'Search for a draw ID',
128
+ filterDateRangePlaceholder: 'Date Range',
129
+ filterModalButton: 'Search',
130
+ filterFromCalendar: 'From',
131
+ filterToCalendar: 'To',
132
+ filterOrDate: 'or search by date'
133
+ },
134
+ ar: {
135
+ filterOpen: 'Filter',
136
+ filterClear: 'Clear',
137
+ filterModalTicketTitle: 'Ticket Results',
138
+ filterModalDrawTitle: 'Draws Results History',
139
+ filterTicketPlaceholder: 'Search for a ticket ID',
140
+ filterDrawPlaceholder: 'Search for a draw ID',
141
+ filterDateRangePlaceholder: 'Date Range',
142
+ filterModalButton: 'Search',
143
+ filterFromCalendar: 'From',
144
+ filterToCalendar: 'To',
145
+ filterOrDate: 'or search by date'
146
+ },
147
+ hr: {
148
+ filterOpen: 'Filter',
149
+ filterClear: 'Očisti',
150
+ filterModalTicketTitle: 'Rezultati listića',
151
+ filterModalDrawTitle: 'Povijest rezultata Izvlačenja',
152
+ filterTicketPlaceholder: 'Pretraga ID listića',
153
+ filterDrawPlaceholder: 'Pretraga ID izvlačenja',
154
+ filterDateRangePlaceholder: 'Raspon datuma',
155
+ filterModalButton: 'Traži',
156
+ filterFromCalendar: 'Od',
157
+ filterToCalendar: 'Do',
158
+ filterOrDate: 'ili tražite po datumu'
159
+ }
160
+ };
161
+ const translate$6 = (key, customLang) => {
162
+ const lang = customLang;
163
+ return TRANSLATIONS$5[lang !== undefined && SUPPORTED_LANGUAGES$5.includes(lang) ? lang : DEFAULT_LANGUAGE$5][key];
73
164
  };
74
165
 
75
166
  /**
@@ -106,17 +197,17 @@ function defineCustomElement(CustomElement) {
106
197
  *
107
198
  * @private
108
199
  */
109
- class Lumo extends HTMLElement {
200
+ class Lumo$2 extends HTMLElement {
110
201
  static get is() {
111
202
  return 'vaadin-lumo-styles';
112
203
  }
113
204
 
114
205
  static get version() {
115
- return '24.2.5';
206
+ return '24.2.9';
116
207
  }
117
208
  }
118
209
 
119
- defineCustomElement(Lumo);
210
+ defineCustomElement(Lumo$2);
120
211
 
121
212
  /**
122
213
  * @license
@@ -460,7 +551,7 @@ const addGlobalThemeStyles = (id, ...styles) => {
460
551
  document.head.insertAdjacentElement('afterbegin', styleTag);
461
552
  };
462
553
 
463
- const addLumoGlobalStyles = (id, ...styles) => {
554
+ const addLumoGlobalStyles$2 = (id, ...styles) => {
464
555
  addGlobalThemeStyles(`lumo-${id}`, styles);
465
556
  };
466
557
 
@@ -470,7 +561,7 @@ const addLumoGlobalStyles = (id, ...styles) => {
470
561
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
471
562
  */
472
563
 
473
- const colorBase = i$1`
564
+ const colorBase$2 = i$1`
474
565
  :host {
475
566
  /* Base (background) */
476
567
  --lumo-base-color: #fff;
@@ -557,9 +648,9 @@ const colorBase = i$1`
557
648
  }
558
649
  `;
559
650
 
560
- addLumoGlobalStyles('color-props', colorBase);
651
+ addLumoGlobalStyles$2('color-props', colorBase$2);
561
652
 
562
- const color = i$1`
653
+ const color$2 = i$1`
563
654
  [theme~='dark'] {
564
655
  /* Base (background) */
565
656
  --lumo-base-color: hsl(214, 35%, 21%);
@@ -676,7 +767,7 @@ const color = i$1`
676
767
  }
677
768
  `;
678
769
 
679
- registerStyles('', color, { moduleId: 'lumo-color' });
770
+ registerStyles('', color$2, { moduleId: 'lumo-color' });
680
771
 
681
772
  /**
682
773
  * @license
@@ -684,7 +775,7 @@ registerStyles('', color, { moduleId: 'lumo-color' });
684
775
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
685
776
  */
686
777
 
687
- const sizing = i$1`
778
+ const sizing$2 = i$1`
688
779
  :host {
689
780
  --lumo-size-xs: 1.625rem;
690
781
  --lumo-size-s: 1.875rem;
@@ -701,7 +792,7 @@ const sizing = i$1`
701
792
  }
702
793
  `;
703
794
 
704
- addLumoGlobalStyles('sizing-props', sizing);
795
+ addLumoGlobalStyles$2('sizing-props', sizing$2);
705
796
 
706
797
  /**
707
798
  * @license
@@ -709,7 +800,7 @@ addLumoGlobalStyles('sizing-props', sizing);
709
800
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
710
801
  */
711
802
 
712
- const style = i$1`
803
+ const style$2 = i$1`
713
804
  :host {
714
805
  /* Border radius */
715
806
  --lumo-border-radius-s: 0.25em; /* Checkbox, badge, date-picker year indicator, etc */
@@ -739,7 +830,7 @@ i$1`
739
830
  }
740
831
  `;
741
832
 
742
- addLumoGlobalStyles('style-props', style);
833
+ addLumoGlobalStyles$2('style-props', style$2);
743
834
 
744
835
  /**
745
836
  * @license
@@ -747,7 +838,7 @@ addLumoGlobalStyles('style-props', style);
747
838
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
748
839
  */
749
840
 
750
- const font = i$1`
841
+ const font$2 = i$1`
751
842
  :host {
752
843
  /* prettier-ignore */
753
844
  --lumo-font-family: -apple-system, BlinkMacSystemFont, 'Roboto', 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
@@ -769,7 +860,7 @@ const font = i$1`
769
860
  }
770
861
  `;
771
862
 
772
- const typography = i$1`
863
+ const typography$2 = i$1`
773
864
  body,
774
865
  :host {
775
866
  font-family: var(--lumo-font-family);
@@ -863,8 +954,8 @@ const typography = i$1`
863
954
  }
864
955
  `;
865
956
 
866
- registerStyles('', typography, { moduleId: 'lumo-typography' });
867
- addLumoGlobalStyles('typography-props', font);
957
+ registerStyles('', typography$2, { moduleId: 'lumo-typography' });
958
+ addLumoGlobalStyles$2('typography-props', font$2);
868
959
 
869
960
  registerStyles(
870
961
  'vaadin-input-container',
@@ -1814,7 +1905,7 @@ function isDescendant(base, path) {
1814
1905
  * @param {string} path Path to translate
1815
1906
  * @return {string} Translated string
1816
1907
  */
1817
- function translate$1(base, newBase, path) {
1908
+ function translate$5(base, newBase, path) {
1818
1909
  return newBase + path.slice(base.length);
1819
1910
  }
1820
1911
 
@@ -4015,7 +4106,7 @@ function handleNotification(event, inst, fromProp, toPath, negate) {
4015
4106
  let detail = /** @type {Object} */(event.detail);
4016
4107
  let fromPath = detail && detail.path;
4017
4108
  if (fromPath) {
4018
- toPath = translate$1(fromProp, toPath, fromPath);
4109
+ toPath = translate$5(fromProp, toPath, fromPath);
4019
4110
  value = detail && detail.value;
4020
4111
  } else {
4021
4112
  value = event.currentTarget[fromProp];
@@ -4301,10 +4392,10 @@ function computeLinkedPaths(inst, path, value) {
4301
4392
  for (let a in links) {
4302
4393
  let b = links[a];
4303
4394
  if (isDescendant(a, path)) {
4304
- link = translate$1(a, b, path);
4395
+ link = translate$5(a, b, path);
4305
4396
  inst._setPendingPropertyOrPath(link, value, true, true);
4306
4397
  } else if (isDescendant(b, path)) {
4307
- link = translate$1(b, a, path);
4398
+ link = translate$5(b, a, path);
4308
4399
  inst._setPendingPropertyOrPath(link, value, true, true);
4309
4400
  }
4310
4401
  }
@@ -4416,7 +4507,7 @@ function runBindingEffect(inst, path, props, oldProps, info, hasPaths, nodeList)
4416
4507
  node.__isPropertyEffectsClient &&
4417
4508
  node.__dataHasAccessor && node.__dataHasAccessor[binding.target]) {
4418
4509
  let value = props[path];
4419
- path = translate$1(part.source, binding.target, path);
4510
+ path = translate$5(part.source, binding.target, path);
4420
4511
  if (node._setPendingPropertyOrPath(path, value, false, true)) {
4421
4512
  inst._enqueueClient(node);
4422
4513
  }
@@ -8364,7 +8455,60 @@ defineCustomElement(InputContainer);
8364
8455
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
8365
8456
  */
8366
8457
 
8367
- const spacing = i$1`
8458
+ /**
8459
+ * Dummy custom element used for collecting
8460
+ * development time usage statistics.
8461
+ *
8462
+ * @private
8463
+ */
8464
+ class Lumo$1 extends HTMLElement {
8465
+ static get is() {
8466
+ return 'vaadin-lumo-styles';
8467
+ }
8468
+
8469
+ static get version() {
8470
+ return '24.2.5';
8471
+ }
8472
+ }
8473
+
8474
+ defineCustomElement(Lumo$1);
8475
+
8476
+ const addLumoGlobalStyles$1 = (id, ...styles) => {
8477
+ addGlobalThemeStyles(`lumo-${id}`, styles);
8478
+ };
8479
+
8480
+ /**
8481
+ * @license
8482
+ * Copyright (c) 2017 - 2023 Vaadin Ltd.
8483
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
8484
+ */
8485
+
8486
+ const sizing$1 = i$1`
8487
+ :host {
8488
+ --lumo-size-xs: 1.625rem;
8489
+ --lumo-size-s: 1.875rem;
8490
+ --lumo-size-m: 2.25rem;
8491
+ --lumo-size-l: 2.75rem;
8492
+ --lumo-size-xl: 3.5rem;
8493
+
8494
+ /* Icons */
8495
+ --lumo-icon-size-s: 1.25em;
8496
+ --lumo-icon-size-m: 1.5em;
8497
+ --lumo-icon-size-l: 2.25em;
8498
+ /* For backwards compatibility */
8499
+ --lumo-icon-size: var(--lumo-icon-size-m);
8500
+ }
8501
+ `;
8502
+
8503
+ addLumoGlobalStyles$1('sizing-props', sizing$1);
8504
+
8505
+ /**
8506
+ * @license
8507
+ * Copyright (c) 2017 - 2023 Vaadin Ltd.
8508
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
8509
+ */
8510
+
8511
+ const spacing$1 = i$1`
8368
8512
  :host {
8369
8513
  /* Square */
8370
8514
  --lumo-space-xs: 0.25rem;
@@ -8389,7 +8533,7 @@ const spacing = i$1`
8389
8533
  }
8390
8534
  `;
8391
8535
 
8392
- addLumoGlobalStyles('spacing-props', spacing);
8536
+ addLumoGlobalStyles$1('spacing-props', spacing$1);
8393
8537
 
8394
8538
  /**
8395
8539
  * @license
@@ -8397,72 +8541,37 @@ addLumoGlobalStyles('spacing-props', spacing);
8397
8541
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
8398
8542
  */
8399
8543
 
8400
- const overlay = i$1`
8544
+ const style$1 = i$1`
8401
8545
  :host {
8402
- top: var(--lumo-space-m);
8403
- right: var(--lumo-space-m);
8404
- bottom: var(--lumo-space-m);
8405
- left: var(--lumo-space-m);
8406
- /* Workaround for Edge issue (only on Surface), where an overflowing vaadin-list-box inside vaadin-select-overlay makes the overlay transparent */
8407
- /* stylelint-disable-next-line */
8408
- outline: 0px solid transparent;
8409
- }
8410
-
8411
- [part='overlay'] {
8412
- background-color: var(--lumo-base-color);
8413
- background-image: linear-gradient(var(--lumo-tint-5pct), var(--lumo-tint-5pct));
8414
- border-radius: var(--lumo-border-radius-m);
8415
- box-shadow: 0 0 0 1px var(--lumo-shade-5pct), var(--lumo-box-shadow-m);
8416
- color: var(--lumo-body-text-color);
8417
- font-family: var(--lumo-font-family);
8418
- font-size: var(--lumo-font-size-m);
8419
- font-weight: 400;
8420
- line-height: var(--lumo-line-height-m);
8421
- letter-spacing: 0;
8422
- text-transform: none;
8423
- -webkit-text-size-adjust: 100%;
8424
- -webkit-font-smoothing: antialiased;
8425
- -moz-osx-font-smoothing: grayscale;
8426
- }
8427
-
8428
- [part='content'] {
8429
- padding: var(--lumo-space-xs);
8430
- }
8431
-
8432
- [part='backdrop'] {
8433
- background-color: var(--lumo-shade-20pct);
8434
- animation: 0.2s lumo-overlay-backdrop-enter both;
8435
- will-change: opacity;
8436
- }
8437
-
8438
- @keyframes lumo-overlay-backdrop-enter {
8439
- 0% {
8440
- opacity: 0;
8441
- }
8442
- }
8546
+ /* Border radius */
8547
+ --lumo-border-radius-s: 0.25em; /* Checkbox, badge, date-picker year indicator, etc */
8548
+ --lumo-border-radius-m: var(--lumo-border-radius, 0.25em); /* Button, text field, menu overlay, etc */
8549
+ --lumo-border-radius-l: 0.5em; /* Dialog, notification, etc */
8443
8550
 
8444
- :host([closing]) [part='backdrop'] {
8445
- animation: 0.2s lumo-overlay-backdrop-exit both;
8446
- }
8551
+ /* Shadow */
8552
+ --lumo-box-shadow-xs: 0 1px 4px -1px var(--lumo-shade-50pct);
8553
+ --lumo-box-shadow-s: 0 2px 4px -1px var(--lumo-shade-20pct), 0 3px 12px -1px var(--lumo-shade-30pct);
8554
+ --lumo-box-shadow-m: 0 2px 6px -1px var(--lumo-shade-20pct), 0 8px 24px -4px var(--lumo-shade-40pct);
8555
+ --lumo-box-shadow-l: 0 3px 18px -2px var(--lumo-shade-20pct), 0 12px 48px -6px var(--lumo-shade-40pct);
8556
+ --lumo-box-shadow-xl: 0 4px 24px -3px var(--lumo-shade-20pct), 0 18px 64px -8px var(--lumo-shade-40pct);
8447
8557
 
8448
- @keyframes lumo-overlay-backdrop-exit {
8449
- 100% {
8450
- opacity: 0;
8451
- }
8558
+ /* Clickable element cursor */
8559
+ --lumo-clickable-cursor: default;
8452
8560
  }
8561
+ `;
8453
8562
 
8454
- @keyframes lumo-overlay-dummy-animation {
8455
- 0% {
8456
- opacity: 1;
8457
- }
8458
-
8459
- 100% {
8460
- opacity: 1;
8461
- }
8563
+ /**
8564
+ * Default values for component-specific custom properties.
8565
+ */
8566
+ i$1`
8567
+ html {
8568
+ --vaadin-checkbox-size: calc(var(--lumo-size-m) / 2);
8569
+ --vaadin-radio-button-size: calc(var(--lumo-size-m) / 2);
8570
+ --vaadin-input-field-border-radius: var(--lumo-border-radius-m);
8462
8571
  }
8463
8572
  `;
8464
8573
 
8465
- registerStyles('', overlay, { moduleId: 'lumo-overlay' });
8574
+ addLumoGlobalStyles$1('style-props', style$1);
8466
8575
 
8467
8576
  /**
8468
8577
  * @license
@@ -8470,571 +8579,1446 @@ registerStyles('', overlay, { moduleId: 'lumo-overlay' });
8470
8579
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
8471
8580
  */
8472
8581
 
8473
- const menuOverlayCore = i$1`
8474
- :host([opening]),
8475
- :host([closing]) {
8476
- animation: 0.14s lumo-overlay-dummy-animation;
8477
- }
8478
-
8479
- [part='overlay'] {
8480
- will-change: opacity, transform;
8481
- }
8582
+ const colorBase$1 = i$1`
8583
+ :host {
8584
+ /* Base (background) */
8585
+ --lumo-base-color: #fff;
8482
8586
 
8483
- :host([opening]) [part='overlay'] {
8484
- animation: 0.1s lumo-menu-overlay-enter ease-out both;
8485
- }
8587
+ /* Tint */
8588
+ --lumo-tint-5pct: hsla(0, 0%, 100%, 0.3);
8589
+ --lumo-tint-10pct: hsla(0, 0%, 100%, 0.37);
8590
+ --lumo-tint-20pct: hsla(0, 0%, 100%, 0.44);
8591
+ --lumo-tint-30pct: hsla(0, 0%, 100%, 0.5);
8592
+ --lumo-tint-40pct: hsla(0, 0%, 100%, 0.57);
8593
+ --lumo-tint-50pct: hsla(0, 0%, 100%, 0.64);
8594
+ --lumo-tint-60pct: hsla(0, 0%, 100%, 0.7);
8595
+ --lumo-tint-70pct: hsla(0, 0%, 100%, 0.77);
8596
+ --lumo-tint-80pct: hsla(0, 0%, 100%, 0.84);
8597
+ --lumo-tint-90pct: hsla(0, 0%, 100%, 0.9);
8598
+ --lumo-tint: #fff;
8486
8599
 
8487
- @keyframes lumo-menu-overlay-enter {
8488
- 0% {
8489
- opacity: 0;
8490
- transform: translateY(-4px);
8491
- }
8492
- }
8600
+ /* Shade */
8601
+ --lumo-shade-5pct: hsla(214, 61%, 25%, 0.05);
8602
+ --lumo-shade-10pct: hsla(214, 57%, 24%, 0.1);
8603
+ --lumo-shade-20pct: hsla(214, 53%, 23%, 0.16);
8604
+ --lumo-shade-30pct: hsla(214, 50%, 22%, 0.26);
8605
+ --lumo-shade-40pct: hsla(214, 47%, 21%, 0.38);
8606
+ --lumo-shade-50pct: hsla(214, 45%, 20%, 0.52);
8607
+ --lumo-shade-60pct: hsla(214, 43%, 19%, 0.6);
8608
+ --lumo-shade-70pct: hsla(214, 42%, 18%, 0.69);
8609
+ --lumo-shade-80pct: hsla(214, 41%, 17%, 0.83);
8610
+ --lumo-shade-90pct: hsla(214, 40%, 16%, 0.94);
8611
+ --lumo-shade: hsl(214, 35%, 15%);
8493
8612
 
8494
- :host([closing]) [part='overlay'] {
8495
- animation: 0.1s lumo-menu-overlay-exit both;
8496
- }
8613
+ /* Contrast */
8614
+ --lumo-contrast-5pct: var(--lumo-shade-5pct);
8615
+ --lumo-contrast-10pct: var(--lumo-shade-10pct);
8616
+ --lumo-contrast-20pct: var(--lumo-shade-20pct);
8617
+ --lumo-contrast-30pct: var(--lumo-shade-30pct);
8618
+ --lumo-contrast-40pct: var(--lumo-shade-40pct);
8619
+ --lumo-contrast-50pct: var(--lumo-shade-50pct);
8620
+ --lumo-contrast-60pct: var(--lumo-shade-60pct);
8621
+ --lumo-contrast-70pct: var(--lumo-shade-70pct);
8622
+ --lumo-contrast-80pct: var(--lumo-shade-80pct);
8623
+ --lumo-contrast-90pct: var(--lumo-shade-90pct);
8624
+ --lumo-contrast: var(--lumo-shade);
8497
8625
 
8498
- @keyframes lumo-menu-overlay-exit {
8499
- 100% {
8500
- opacity: 0;
8501
- }
8502
- }
8503
- `;
8626
+ /* Text */
8627
+ --lumo-header-text-color: var(--lumo-contrast);
8628
+ --lumo-body-text-color: var(--lumo-contrast-90pct);
8629
+ --lumo-secondary-text-color: var(--lumo-contrast-70pct);
8630
+ --lumo-tertiary-text-color: var(--lumo-contrast-50pct);
8631
+ --lumo-disabled-text-color: var(--lumo-contrast-30pct);
8504
8632
 
8505
- registerStyles('', menuOverlayCore, { moduleId: 'lumo-menu-overlay-core' });
8633
+ /* Primary */
8634
+ --lumo-primary-color: hsl(214, 100%, 48%);
8635
+ --lumo-primary-color-50pct: hsla(214, 100%, 49%, 0.76);
8636
+ --lumo-primary-color-10pct: hsla(214, 100%, 60%, 0.13);
8637
+ --lumo-primary-text-color: hsl(214, 100%, 43%);
8638
+ --lumo-primary-contrast-color: #fff;
8506
8639
 
8507
- const menuOverlayExt = i$1`
8508
- /* Small viewport (bottom sheet) styles */
8509
- /* Use direct media queries instead of the state attributes ([phone] and [fullscreen]) provided by the elements */
8510
- @media (max-width: 420px), (max-height: 420px) {
8511
- :host {
8512
- top: 0 !important;
8513
- right: 0 !important;
8514
- bottom: var(--vaadin-overlay-viewport-bottom, 0) !important;
8515
- left: 0 !important;
8516
- align-items: stretch !important;
8517
- justify-content: flex-end !important;
8518
- }
8640
+ /* Error */
8641
+ --lumo-error-color: hsl(3, 85%, 48%);
8642
+ --lumo-error-color-50pct: hsla(3, 85%, 49%, 0.5);
8643
+ --lumo-error-color-10pct: hsla(3, 85%, 49%, 0.1);
8644
+ --lumo-error-text-color: hsl(3, 89%, 42%);
8645
+ --lumo-error-contrast-color: #fff;
8519
8646
 
8520
- [part='overlay'] {
8521
- max-height: 50vh;
8522
- width: 100vw;
8523
- border-radius: 0;
8524
- box-shadow: var(--lumo-box-shadow-xl);
8525
- }
8647
+ /* Success */
8648
+ --lumo-success-color: hsl(145, 72%, 30%);
8649
+ --lumo-success-color-50pct: hsla(145, 72%, 31%, 0.5);
8650
+ --lumo-success-color-10pct: hsla(145, 72%, 31%, 0.1);
8651
+ --lumo-success-text-color: hsl(145, 85%, 25%);
8652
+ --lumo-success-contrast-color: #fff;
8526
8653
 
8527
- /* The content part scrolls instead of the overlay part, because of the gradient fade-out */
8528
- [part='content'] {
8529
- padding: 30px var(--lumo-space-m);
8530
- max-height: inherit;
8531
- box-sizing: border-box;
8532
- -webkit-overflow-scrolling: touch;
8533
- overflow: auto;
8534
- -webkit-mask-image: linear-gradient(transparent, #000 40px, #000 calc(100% - 40px), transparent);
8535
- mask-image: linear-gradient(transparent, #000 40px, #000 calc(100% - 40px), transparent);
8536
- }
8654
+ /* Warning */
8655
+ --lumo-warning-color: hsl(48, 100%, 50%);
8656
+ --lumo-warning-color-10pct: hsla(48, 100%, 50%, 0.25);
8657
+ --lumo-warning-text-color: hsl(32, 100%, 30%);
8658
+ --lumo-warning-contrast-color: var(--lumo-shade-90pct);
8659
+ }
8537
8660
 
8538
- [part='backdrop'] {
8539
- display: block;
8661
+ /* forced-colors mode adjustments */
8662
+ @media (forced-colors: active) {
8663
+ html {
8664
+ --lumo-disabled-text-color: GrayText;
8540
8665
  }
8666
+ }
8667
+ `;
8541
8668
 
8542
- /* Animations */
8669
+ addLumoGlobalStyles$1('color-props', colorBase$1);
8543
8670
 
8544
- :host([opening]) [part='overlay'] {
8545
- animation: 0.2s lumo-mobile-menu-overlay-enter cubic-bezier(0.215, 0.61, 0.355, 1) both;
8546
- }
8671
+ const color$1 = i$1`
8672
+ [theme~='dark'] {
8673
+ /* Base (background) */
8674
+ --lumo-base-color: hsl(214, 35%, 21%);
8547
8675
 
8548
- :host([closing]),
8549
- :host([closing]) [part='backdrop'] {
8550
- animation-delay: 0.14s;
8551
- }
8676
+ /* Tint */
8677
+ --lumo-tint-5pct: hsla(214, 65%, 85%, 0.06);
8678
+ --lumo-tint-10pct: hsla(214, 60%, 80%, 0.14);
8679
+ --lumo-tint-20pct: hsla(214, 64%, 82%, 0.23);
8680
+ --lumo-tint-30pct: hsla(214, 69%, 84%, 0.32);
8681
+ --lumo-tint-40pct: hsla(214, 73%, 86%, 0.41);
8682
+ --lumo-tint-50pct: hsla(214, 78%, 88%, 0.5);
8683
+ --lumo-tint-60pct: hsla(214, 82%, 90%, 0.58);
8684
+ --lumo-tint-70pct: hsla(214, 87%, 92%, 0.69);
8685
+ --lumo-tint-80pct: hsla(214, 91%, 94%, 0.8);
8686
+ --lumo-tint-90pct: hsla(214, 96%, 96%, 0.9);
8687
+ --lumo-tint: hsl(214, 100%, 98%);
8552
8688
 
8553
- :host([closing]) [part='overlay'] {
8554
- animation: 0.14s 0.14s lumo-mobile-menu-overlay-exit cubic-bezier(0.55, 0.055, 0.675, 0.19) both;
8555
- }
8556
- }
8689
+ /* Shade */
8690
+ --lumo-shade-5pct: hsla(214, 0%, 0%, 0.07);
8691
+ --lumo-shade-10pct: hsla(214, 4%, 2%, 0.15);
8692
+ --lumo-shade-20pct: hsla(214, 8%, 4%, 0.23);
8693
+ --lumo-shade-30pct: hsla(214, 12%, 6%, 0.32);
8694
+ --lumo-shade-40pct: hsla(214, 16%, 8%, 0.41);
8695
+ --lumo-shade-50pct: hsla(214, 20%, 10%, 0.5);
8696
+ --lumo-shade-60pct: hsla(214, 24%, 12%, 0.6);
8697
+ --lumo-shade-70pct: hsla(214, 28%, 13%, 0.7);
8698
+ --lumo-shade-80pct: hsla(214, 32%, 13%, 0.8);
8699
+ --lumo-shade-90pct: hsla(214, 33%, 13%, 0.9);
8700
+ --lumo-shade: hsl(214, 33%, 13%);
8557
8701
 
8558
- @keyframes lumo-mobile-menu-overlay-enter {
8559
- 0% {
8560
- transform: translateY(150%);
8561
- }
8562
- }
8702
+ /* Contrast */
8703
+ --lumo-contrast-5pct: var(--lumo-tint-5pct);
8704
+ --lumo-contrast-10pct: var(--lumo-tint-10pct);
8705
+ --lumo-contrast-20pct: var(--lumo-tint-20pct);
8706
+ --lumo-contrast-30pct: var(--lumo-tint-30pct);
8707
+ --lumo-contrast-40pct: var(--lumo-tint-40pct);
8708
+ --lumo-contrast-50pct: var(--lumo-tint-50pct);
8709
+ --lumo-contrast-60pct: var(--lumo-tint-60pct);
8710
+ --lumo-contrast-70pct: var(--lumo-tint-70pct);
8711
+ --lumo-contrast-80pct: var(--lumo-tint-80pct);
8712
+ --lumo-contrast-90pct: var(--lumo-tint-90pct);
8713
+ --lumo-contrast: var(--lumo-tint);
8563
8714
 
8564
- @keyframes lumo-mobile-menu-overlay-exit {
8565
- 100% {
8566
- transform: translateY(150%);
8567
- }
8568
- }
8569
- `;
8715
+ /* Text */
8716
+ --lumo-header-text-color: var(--lumo-contrast);
8717
+ --lumo-body-text-color: var(--lumo-contrast-90pct);
8718
+ --lumo-secondary-text-color: var(--lumo-contrast-70pct);
8719
+ --lumo-tertiary-text-color: var(--lumo-contrast-50pct);
8720
+ --lumo-disabled-text-color: var(--lumo-contrast-30pct);
8570
8721
 
8571
- const menuOverlay = [overlay, menuOverlayCore, menuOverlayExt];
8722
+ /* Primary */
8723
+ --lumo-primary-color: hsl(214, 90%, 48%);
8724
+ --lumo-primary-color-50pct: hsla(214, 90%, 70%, 0.69);
8725
+ --lumo-primary-color-10pct: hsla(214, 90%, 55%, 0.13);
8726
+ --lumo-primary-text-color: hsl(214, 90%, 77%);
8727
+ --lumo-primary-contrast-color: #fff;
8572
8728
 
8573
- registerStyles('', menuOverlay, { moduleId: 'lumo-menu-overlay' });
8729
+ /* Error */
8730
+ --lumo-error-color: hsl(3, 79%, 49%);
8731
+ --lumo-error-color-50pct: hsla(3, 75%, 62%, 0.5);
8732
+ --lumo-error-color-10pct: hsla(3, 75%, 62%, 0.14);
8733
+ --lumo-error-text-color: hsl(3, 100%, 80%);
8574
8734
 
8575
- const datePickerOverlay = i$1`
8576
- [part='overlay'] {
8577
- /*
8578
- Width:
8579
- date cell widths
8580
- + month calendar side padding
8581
- + year scroller width
8582
- */
8583
- /* prettier-ignore */
8584
- width:
8585
- calc(
8586
- var(--lumo-size-m) * 7
8587
- + var(--lumo-space-xs) * 2
8588
- + 57px
8589
- );
8590
- height: 100%;
8591
- max-height: calc(var(--lumo-size-m) * 14);
8592
- overflow: hidden;
8593
- -webkit-tap-highlight-color: transparent;
8594
- }
8735
+ /* Success */
8736
+ --lumo-success-color: hsl(145, 72%, 30%);
8737
+ --lumo-success-color-50pct: hsla(145, 92%, 51%, 0.5);
8738
+ --lumo-success-color-10pct: hsla(145, 92%, 51%, 0.1);
8739
+ --lumo-success-text-color: hsl(145, 85%, 46%);
8595
8740
 
8596
- [part='overlay'] {
8597
- flex-direction: column;
8741
+ /* Warning */
8742
+ --lumo-warning-color: hsl(43, 100%, 48%);
8743
+ --lumo-warning-color-10pct: hsla(40, 100%, 50%, 0.2);
8744
+ --lumo-warning-text-color: hsl(45, 100%, 60%);
8745
+ --lumo-warning-contrast-color: var(--lumo-shade-90pct);
8598
8746
  }
8599
8747
 
8600
- [part='content'] {
8601
- padding: 0;
8602
- height: 100%;
8603
- overflow: hidden;
8604
- -webkit-mask-image: none;
8605
- mask-image: none;
8748
+ html {
8749
+ color: var(--lumo-body-text-color);
8750
+ background-color: var(--lumo-base-color);
8751
+ color-scheme: light;
8606
8752
  }
8607
8753
 
8608
- :host([top-aligned]) [part~='overlay'] {
8609
- margin-top: var(--lumo-space-xs);
8754
+ [theme~='dark'] {
8755
+ color: var(--lumo-body-text-color);
8756
+ background-color: var(--lumo-base-color);
8757
+ color-scheme: dark;
8610
8758
  }
8611
8759
 
8612
- :host([bottom-aligned]) [part~='overlay'] {
8613
- margin-bottom: var(--lumo-space-xs);
8760
+ h1,
8761
+ h2,
8762
+ h3,
8763
+ h4,
8764
+ h5,
8765
+ h6 {
8766
+ color: var(--lumo-header-text-color);
8614
8767
  }
8615
8768
 
8616
- @media (max-width: 420px), (max-height: 420px) {
8617
- [part='overlay'] {
8618
- width: 100vw;
8619
- height: 70vh;
8620
- max-height: 70vh;
8621
- }
8769
+ a:where(:any-link) {
8770
+ color: var(--lumo-primary-text-color);
8622
8771
  }
8623
- `;
8624
-
8625
- registerStyles('vaadin-date-picker-overlay', [menuOverlay, datePickerOverlay], {
8626
- moduleId: 'lumo-date-picker-overlay',
8627
- });
8628
8772
 
8629
- const button = i$1`
8630
- :host {
8631
- /* Sizing */
8632
- --lumo-button-size: var(--lumo-size-m);
8633
- min-width: calc(var(--lumo-button-size) * 2);
8634
- height: var(--lumo-button-size);
8635
- padding: 0 calc(var(--lumo-button-size) / 3 + var(--lumo-border-radius-m) / 2);
8636
- margin: var(--lumo-space-xs) 0;
8637
- box-sizing: border-box;
8638
- /* Style */
8639
- font-family: var(--lumo-font-family);
8640
- font-size: var(--lumo-font-size-m);
8641
- font-weight: 500;
8642
- color: var(--_lumo-button-color, var(--lumo-primary-text-color));
8643
- background-color: var(--_lumo-button-background-color, var(--lumo-contrast-5pct));
8644
- border-radius: var(--lumo-border-radius-m);
8645
- cursor: var(--lumo-clickable-cursor);
8646
- -webkit-tap-highlight-color: transparent;
8647
- -webkit-font-smoothing: antialiased;
8648
- -moz-osx-font-smoothing: grayscale;
8649
- flex-shrink: 0;
8773
+ a:not(:any-link) {
8774
+ color: var(--lumo-disabled-text-color);
8650
8775
  }
8651
8776
 
8652
- /* Set only for the internal parts so we don't affect the host vertical alignment */
8653
- [part='label'],
8654
- [part='prefix'],
8655
- [part='suffix'] {
8656
- line-height: var(--lumo-line-height-xs);
8777
+ blockquote {
8778
+ color: var(--lumo-secondary-text-color);
8657
8779
  }
8658
8780
 
8659
- [part='label'] {
8660
- padding: calc(var(--lumo-button-size) / 6) 0;
8781
+ code,
8782
+ pre {
8783
+ background-color: var(--lumo-contrast-10pct);
8784
+ border-radius: var(--lumo-border-radius-m);
8661
8785
  }
8786
+ `;
8662
8787
 
8663
- :host([theme~='small']) {
8664
- font-size: var(--lumo-font-size-s);
8665
- --lumo-button-size: var(--lumo-size-s);
8666
- }
8788
+ registerStyles('', color$1, { moduleId: 'lumo-color' });
8667
8789
 
8668
- :host([theme~='large']) {
8669
- font-size: var(--lumo-font-size-l);
8670
- --lumo-button-size: var(--lumo-size-l);
8671
- }
8790
+ /**
8791
+ * @license
8792
+ * Copyright (c) 2017 - 2023 Vaadin Ltd.
8793
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
8794
+ */
8672
8795
 
8673
- /* For interaction states */
8674
- :host::before,
8675
- :host::after {
8676
- content: '';
8677
- /* We rely on the host always being relative */
8678
- position: absolute;
8679
- z-index: 1;
8680
- inset: 0;
8681
- background-color: currentColor;
8682
- border-radius: inherit;
8683
- opacity: 0;
8684
- pointer-events: none;
8685
- }
8796
+ const font$1 = i$1`
8797
+ :host {
8798
+ /* prettier-ignore */
8799
+ --lumo-font-family: -apple-system, BlinkMacSystemFont, 'Roboto', 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
8686
8800
 
8687
- /* Hover */
8801
+ /* Font sizes */
8802
+ --lumo-font-size-xxs: 0.75rem;
8803
+ --lumo-font-size-xs: 0.8125rem;
8804
+ --lumo-font-size-s: 0.875rem;
8805
+ --lumo-font-size-m: 1rem;
8806
+ --lumo-font-size-l: 1.125rem;
8807
+ --lumo-font-size-xl: 1.375rem;
8808
+ --lumo-font-size-xxl: 1.75rem;
8809
+ --lumo-font-size-xxxl: 2.5rem;
8688
8810
 
8689
- @media (any-hover: hover) {
8690
- :host(:hover)::before {
8691
- opacity: 0.02;
8692
- }
8811
+ /* Line heights */
8812
+ --lumo-line-height-xs: 1.25;
8813
+ --lumo-line-height-s: 1.375;
8814
+ --lumo-line-height-m: 1.625;
8693
8815
  }
8816
+ `;
8694
8817
 
8695
- /* Active */
8696
-
8697
- :host::after {
8698
- transition: opacity 1.4s, transform 0.1s;
8699
- filter: blur(8px);
8818
+ const typography$1 = i$1`
8819
+ body,
8820
+ :host {
8821
+ font-family: var(--lumo-font-family);
8822
+ font-size: var(--lumo-font-size-m);
8823
+ line-height: var(--lumo-line-height-m);
8824
+ -webkit-text-size-adjust: 100%;
8825
+ -webkit-font-smoothing: antialiased;
8826
+ -moz-osx-font-smoothing: grayscale;
8700
8827
  }
8701
8828
 
8702
- :host([active])::before {
8703
- opacity: 0.05;
8704
- transition-duration: 0s;
8829
+ small,
8830
+ [theme~='font-size-s'] {
8831
+ font-size: var(--lumo-font-size-s);
8832
+ line-height: var(--lumo-line-height-s);
8705
8833
  }
8706
8834
 
8707
- :host([active])::after {
8708
- opacity: 0.1;
8709
- transition-duration: 0s, 0s;
8710
- transform: scale(0);
8835
+ [theme~='font-size-xs'] {
8836
+ font-size: var(--lumo-font-size-xs);
8837
+ line-height: var(--lumo-line-height-xs);
8711
8838
  }
8712
8839
 
8713
- /* Keyboard focus */
8840
+ :where(h1, h2, h3, h4, h5, h6) {
8841
+ font-weight: 600;
8842
+ line-height: var(--lumo-line-height-xs);
8843
+ margin-block: 0;
8844
+ }
8714
8845
 
8715
- :host([focus-ring]) {
8716
- box-shadow: 0 0 0 2px var(--lumo-primary-color-50pct);
8846
+ :where(h1) {
8847
+ font-size: var(--lumo-font-size-xxxl);
8717
8848
  }
8718
8849
 
8719
- :host([theme~='primary'][focus-ring]) {
8720
- box-shadow: 0 0 0 1px var(--lumo-base-color), 0 0 0 3px var(--lumo-primary-color-50pct);
8850
+ :where(h2) {
8851
+ font-size: var(--lumo-font-size-xxl);
8721
8852
  }
8722
8853
 
8723
- /* Types (primary, tertiary, tertiary-inline */
8854
+ :where(h3) {
8855
+ font-size: var(--lumo-font-size-xl);
8856
+ }
8724
8857
 
8725
- :host([theme~='tertiary']),
8726
- :host([theme~='tertiary-inline']) {
8727
- background-color: transparent !important;
8728
- min-width: 0;
8858
+ :where(h4) {
8859
+ font-size: var(--lumo-font-size-l);
8729
8860
  }
8730
8861
 
8731
- :host([theme~='tertiary']) {
8732
- padding: 0 calc(var(--lumo-button-size) / 6);
8862
+ :where(h5) {
8863
+ font-size: var(--lumo-font-size-m);
8733
8864
  }
8734
8865
 
8735
- :host([theme~='tertiary-inline'])::before {
8736
- display: none;
8866
+ :where(h6) {
8867
+ font-size: var(--lumo-font-size-xs);
8868
+ text-transform: uppercase;
8869
+ letter-spacing: 0.03em;
8737
8870
  }
8738
8871
 
8739
- :host([theme~='tertiary-inline']) {
8740
- margin: 0;
8741
- height: auto;
8742
- padding: 0;
8743
- line-height: inherit;
8744
- font-size: inherit;
8872
+ p,
8873
+ blockquote {
8874
+ margin-top: 0.5em;
8875
+ margin-bottom: 0.75em;
8745
8876
  }
8746
8877
 
8747
- :host([theme~='tertiary-inline']) [part='label'] {
8748
- padding: 0;
8749
- overflow: visible;
8750
- line-height: inherit;
8878
+ a {
8879
+ text-decoration: none;
8751
8880
  }
8752
8881
 
8753
- :host([theme~='primary']) {
8754
- background-color: var(--_lumo-button-primary-background-color, var(--lumo-primary-color));
8755
- color: var(--_lumo-button-primary-color, var(--lumo-primary-contrast-color));
8756
- font-weight: 600;
8757
- min-width: calc(var(--lumo-button-size) * 2.5);
8882
+ a:where(:any-link):hover {
8883
+ text-decoration: underline;
8758
8884
  }
8759
8885
 
8760
- :host([theme~='primary'])::before {
8761
- background-color: black;
8886
+ hr {
8887
+ display: block;
8888
+ align-self: stretch;
8889
+ height: 1px;
8890
+ border: 0;
8891
+ padding: 0;
8892
+ margin: var(--lumo-space-s) calc(var(--lumo-border-radius-m) / 2);
8893
+ background-color: var(--lumo-contrast-10pct);
8762
8894
  }
8763
8895
 
8764
- @media (any-hover: hover) {
8765
- :host([theme~='primary']:hover)::before {
8766
- opacity: 0.05;
8767
- }
8896
+ blockquote {
8897
+ border-left: 2px solid var(--lumo-contrast-30pct);
8768
8898
  }
8769
8899
 
8770
- :host([theme~='primary'][active])::before {
8771
- opacity: 0.1;
8900
+ b,
8901
+ strong {
8902
+ font-weight: 600;
8772
8903
  }
8773
8904
 
8774
- :host([theme~='primary'][active])::after {
8775
- opacity: 0.2;
8905
+ /* RTL specific styles */
8906
+ blockquote[dir='rtl'] {
8907
+ border-left: none;
8908
+ border-right: 2px solid var(--lumo-contrast-30pct);
8776
8909
  }
8910
+ `;
8777
8911
 
8778
- /* Colors (success, error, contrast) */
8912
+ registerStyles('', typography$1, { moduleId: 'lumo-typography' });
8913
+ addLumoGlobalStyles$1('typography-props', font$1);
8779
8914
 
8780
- :host([theme~='success']) {
8781
- color: var(--lumo-success-text-color);
8782
- }
8915
+ /**
8916
+ * @license
8917
+ * Copyright (c) 2017 - 2023 Vaadin Ltd.
8918
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
8919
+ */
8783
8920
 
8784
- :host([theme~='success'][theme~='primary']) {
8785
- background-color: var(--lumo-success-color);
8786
- color: var(--lumo-success-contrast-color);
8921
+ const overlay = i$1`
8922
+ :host {
8923
+ top: var(--lumo-space-m);
8924
+ right: var(--lumo-space-m);
8925
+ bottom: var(--lumo-space-m);
8926
+ left: var(--lumo-space-m);
8927
+ /* Workaround for Edge issue (only on Surface), where an overflowing vaadin-list-box inside vaadin-select-overlay makes the overlay transparent */
8928
+ /* stylelint-disable-next-line */
8929
+ outline: 0px solid transparent;
8787
8930
  }
8788
8931
 
8789
- :host([theme~='error']) {
8790
- color: var(--lumo-error-text-color);
8932
+ [part='overlay'] {
8933
+ background-color: var(--lumo-base-color);
8934
+ background-image: linear-gradient(var(--lumo-tint-5pct), var(--lumo-tint-5pct));
8935
+ border-radius: var(--lumo-border-radius-m);
8936
+ box-shadow: 0 0 0 1px var(--lumo-shade-5pct), var(--lumo-box-shadow-m);
8937
+ color: var(--lumo-body-text-color);
8938
+ font-family: var(--lumo-font-family);
8939
+ font-size: var(--lumo-font-size-m);
8940
+ font-weight: 400;
8941
+ line-height: var(--lumo-line-height-m);
8942
+ letter-spacing: 0;
8943
+ text-transform: none;
8944
+ -webkit-text-size-adjust: 100%;
8945
+ -webkit-font-smoothing: antialiased;
8946
+ -moz-osx-font-smoothing: grayscale;
8791
8947
  }
8792
8948
 
8793
- :host([theme~='error'][theme~='primary']) {
8794
- background-color: var(--lumo-error-color);
8795
- color: var(--lumo-error-contrast-color);
8949
+ [part='content'] {
8950
+ padding: var(--lumo-space-xs);
8796
8951
  }
8797
8952
 
8798
- :host([theme~='contrast']) {
8799
- color: var(--lumo-contrast);
8953
+ [part='backdrop'] {
8954
+ background-color: var(--lumo-shade-20pct);
8955
+ animation: 0.2s lumo-overlay-backdrop-enter both;
8956
+ will-change: opacity;
8800
8957
  }
8801
8958
 
8802
- :host([theme~='contrast'][theme~='primary']) {
8803
- background-color: var(--lumo-contrast);
8804
- color: var(--lumo-base-color);
8959
+ @keyframes lumo-overlay-backdrop-enter {
8960
+ 0% {
8961
+ opacity: 0;
8962
+ }
8805
8963
  }
8806
8964
 
8807
- /* Disabled state. Keep selectors after other color variants. */
8808
-
8809
- :host([disabled]) {
8810
- pointer-events: none;
8811
- color: var(--lumo-disabled-text-color);
8965
+ :host([closing]) [part='backdrop'] {
8966
+ animation: 0.2s lumo-overlay-backdrop-exit both;
8812
8967
  }
8813
8968
 
8814
- :host([theme~='primary'][disabled]) {
8815
- background-color: var(--lumo-contrast-30pct);
8816
- color: var(--lumo-base-color);
8969
+ @keyframes lumo-overlay-backdrop-exit {
8970
+ 100% {
8971
+ opacity: 0;
8972
+ }
8817
8973
  }
8818
8974
 
8819
- :host([theme~='primary'][disabled]) [part] {
8820
- opacity: 0.7;
8975
+ @keyframes lumo-overlay-dummy-animation {
8976
+ 0% {
8977
+ opacity: 1;
8978
+ }
8979
+
8980
+ 100% {
8981
+ opacity: 1;
8982
+ }
8821
8983
  }
8984
+ `;
8822
8985
 
8823
- /* Icons */
8986
+ registerStyles('', overlay, { moduleId: 'lumo-overlay' });
8824
8987
 
8825
- [part] ::slotted(vaadin-icon) {
8826
- display: inline-block;
8827
- width: var(--lumo-icon-size-m);
8828
- height: var(--lumo-icon-size-m);
8988
+ /**
8989
+ * @license
8990
+ * Copyright (c) 2017 - 2023 Vaadin Ltd.
8991
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
8992
+ */
8993
+
8994
+ const menuOverlayCore = i$1`
8995
+ :host([opening]),
8996
+ :host([closing]) {
8997
+ animation: 0.14s lumo-overlay-dummy-animation;
8829
8998
  }
8830
8999
 
8831
- /* Vaadin icons are based on a 16x16 grid (unlike Lumo and Material icons with 24x24), so they look too big by default */
8832
- [part] ::slotted(vaadin-icon[icon^='vaadin:']) {
8833
- padding: 0.25em;
8834
- box-sizing: border-box !important;
9000
+ [part='overlay'] {
9001
+ will-change: opacity, transform;
8835
9002
  }
8836
9003
 
8837
- [part='prefix'] {
8838
- margin-left: -0.25em;
8839
- margin-right: 0.25em;
9004
+ :host([opening]) [part='overlay'] {
9005
+ animation: 0.1s lumo-menu-overlay-enter ease-out both;
8840
9006
  }
8841
9007
 
8842
- [part='suffix'] {
8843
- margin-left: 0.25em;
8844
- margin-right: -0.25em;
8845
- }
8846
-
8847
- /* Icon-only */
8848
-
8849
- :host([theme~='icon']:not([theme~='tertiary-inline'])) {
8850
- min-width: var(--lumo-button-size);
8851
- padding-left: calc(var(--lumo-button-size) / 4);
8852
- padding-right: calc(var(--lumo-button-size) / 4);
8853
- }
8854
-
8855
- :host([theme~='icon']) [part='prefix'],
8856
- :host([theme~='icon']) [part='suffix'] {
8857
- margin-left: 0;
8858
- margin-right: 0;
8859
- }
8860
-
8861
- /* RTL specific styles */
8862
-
8863
- :host([dir='rtl']) [part='prefix'] {
8864
- margin-left: 0.25em;
8865
- margin-right: -0.25em;
9008
+ @keyframes lumo-menu-overlay-enter {
9009
+ 0% {
9010
+ opacity: 0;
9011
+ transform: translateY(-4px);
9012
+ }
8866
9013
  }
8867
9014
 
8868
- :host([dir='rtl']) [part='suffix'] {
8869
- margin-left: -0.25em;
8870
- margin-right: 0.25em;
9015
+ :host([closing]) [part='overlay'] {
9016
+ animation: 0.1s lumo-menu-overlay-exit both;
8871
9017
  }
8872
9018
 
8873
- :host([dir='rtl'][theme~='icon']) [part='prefix'],
8874
- :host([dir='rtl'][theme~='icon']) [part='suffix'] {
8875
- margin-left: 0;
8876
- margin-right: 0;
9019
+ @keyframes lumo-menu-overlay-exit {
9020
+ 100% {
9021
+ opacity: 0;
9022
+ }
8877
9023
  }
8878
9024
  `;
8879
9025
 
8880
- registerStyles('vaadin-button', button, { moduleId: 'lumo-button' });
8881
-
8882
- /**
8883
- * @license
8884
- * Copyright (c) 2021 - 2023 Vaadin Ltd.
8885
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
8886
- */
8887
-
8888
- /**
8889
- * @typedef ReactiveController
8890
- * @type {import('lit').ReactiveController}
8891
- */
8892
-
8893
- /**
8894
- * A mixin for connecting controllers to the element.
8895
- *
8896
- * @polymerMixin
8897
- */
8898
- const ControllerMixin = dedupingMixin((superClass) => {
8899
- // If the superclass extends from LitElement,
8900
- // use its own controllers implementation.
8901
- if (typeof superClass.prototype.addController === 'function') {
8902
- return superClass;
8903
- }
9026
+ registerStyles('', menuOverlayCore, { moduleId: 'lumo-menu-overlay-core' });
8904
9027
 
8905
- return class ControllerMixinClass extends superClass {
8906
- constructor() {
8907
- super();
9028
+ const menuOverlayExt = i$1`
9029
+ /* Small viewport (bottom sheet) styles */
9030
+ /* Use direct media queries instead of the state attributes ([phone] and [fullscreen]) provided by the elements */
9031
+ @media (max-width: 420px), (max-height: 420px) {
9032
+ :host {
9033
+ top: 0 !important;
9034
+ right: 0 !important;
9035
+ bottom: var(--vaadin-overlay-viewport-bottom, 0) !important;
9036
+ left: 0 !important;
9037
+ align-items: stretch !important;
9038
+ justify-content: flex-end !important;
9039
+ }
8908
9040
 
8909
- /**
8910
- * @type {Set<ReactiveController>}
8911
- */
8912
- this.__controllers = new Set();
9041
+ [part='overlay'] {
9042
+ max-height: 50vh;
9043
+ width: 100vw;
9044
+ border-radius: 0;
9045
+ box-shadow: var(--lumo-box-shadow-xl);
8913
9046
  }
8914
9047
 
8915
- /** @protected */
8916
- connectedCallback() {
8917
- super.connectedCallback();
9048
+ /* The content part scrolls instead of the overlay part, because of the gradient fade-out */
9049
+ [part='content'] {
9050
+ padding: 30px var(--lumo-space-m);
9051
+ max-height: inherit;
9052
+ box-sizing: border-box;
9053
+ -webkit-overflow-scrolling: touch;
9054
+ overflow: auto;
9055
+ -webkit-mask-image: linear-gradient(transparent, #000 40px, #000 calc(100% - 40px), transparent);
9056
+ mask-image: linear-gradient(transparent, #000 40px, #000 calc(100% - 40px), transparent);
9057
+ }
8918
9058
 
8919
- this.__controllers.forEach((c) => {
8920
- if (c.hostConnected) {
8921
- c.hostConnected();
8922
- }
8923
- });
9059
+ [part='backdrop'] {
9060
+ display: block;
8924
9061
  }
8925
9062
 
8926
- /** @protected */
8927
- disconnectedCallback() {
8928
- super.disconnectedCallback();
9063
+ /* Animations */
8929
9064
 
8930
- this.__controllers.forEach((c) => {
8931
- if (c.hostDisconnected) {
8932
- c.hostDisconnected();
8933
- }
8934
- });
9065
+ :host([opening]) [part='overlay'] {
9066
+ animation: 0.2s lumo-mobile-menu-overlay-enter cubic-bezier(0.215, 0.61, 0.355, 1) both;
8935
9067
  }
8936
9068
 
8937
- /**
8938
- * Registers a controller to participate in the element update cycle.
8939
- *
8940
- * @param {ReactiveController} controller
8941
- * @protected
8942
- */
8943
- addController(controller) {
8944
- this.__controllers.add(controller);
8945
- // Call hostConnected if a controller is added after the element is attached.
8946
- if (this.$ !== undefined && this.isConnected && controller.hostConnected) {
8947
- controller.hostConnected();
8948
- }
9069
+ :host([closing]),
9070
+ :host([closing]) [part='backdrop'] {
9071
+ animation-delay: 0.14s;
8949
9072
  }
8950
9073
 
8951
- /**
8952
- * Removes a controller from the element.
8953
- *
8954
- * @param {ReactiveController} controller
8955
- * @protected
8956
- */
8957
- removeController(controller) {
8958
- this.__controllers.delete(controller);
9074
+ :host([closing]) [part='overlay'] {
9075
+ animation: 0.14s 0.14s lumo-mobile-menu-overlay-exit cubic-bezier(0.55, 0.055, 0.675, 0.19) both;
8959
9076
  }
8960
- };
8961
- });
8962
-
8963
- const DEV_MODE_CODE_REGEXP =
8964
- /\/\*[\*!]\s+vaadin-dev-mode:start([\s\S]*)vaadin-dev-mode:end\s+\*\*\//i;
8965
-
8966
- const FlowClients = window.Vaadin && window.Vaadin.Flow && window.Vaadin.Flow.clients;
8967
-
8968
- function isMinified() {
8969
- function test() {
8970
- /** vaadin-dev-mode:start
8971
- return false;
8972
- vaadin-dev-mode:end **/
8973
- return true;
8974
9077
  }
8975
- return uncommentAndRun(test);
8976
- }
8977
9078
 
8978
- function isDevelopmentMode() {
8979
- try {
8980
- if (isForcedDevelopmentMode()) {
8981
- return true;
9079
+ @keyframes lumo-mobile-menu-overlay-enter {
9080
+ 0% {
9081
+ transform: translateY(150%);
8982
9082
  }
9083
+ }
8983
9084
 
8984
- if (!isLocalhost()) {
8985
- return false;
9085
+ @keyframes lumo-mobile-menu-overlay-exit {
9086
+ 100% {
9087
+ transform: translateY(150%);
8986
9088
  }
9089
+ }
9090
+ `;
8987
9091
 
8988
- if (FlowClients) {
8989
- return !isFlowProductionMode();
8990
- }
9092
+ const menuOverlay = [overlay, menuOverlayCore, menuOverlayExt];
8991
9093
 
8992
- return !isMinified();
8993
- } catch (e) {
8994
- // Some error in this code, assume production so no further actions will be taken
8995
- return false;
9094
+ registerStyles('', menuOverlay, { moduleId: 'lumo-menu-overlay' });
9095
+
9096
+ const datePickerOverlay = i$1`
9097
+ [part='overlay'] {
9098
+ /*
9099
+ Width:
9100
+ date cell widths
9101
+ + month calendar side padding
9102
+ + year scroller width
9103
+ */
9104
+ /* prettier-ignore */
9105
+ width:
9106
+ calc(
9107
+ var(--lumo-size-m) * 7
9108
+ + var(--lumo-space-xs) * 2
9109
+ + 57px
9110
+ );
9111
+ height: 100%;
9112
+ max-height: calc(var(--lumo-size-m) * 14);
9113
+ overflow: hidden;
9114
+ -webkit-tap-highlight-color: transparent;
8996
9115
  }
8997
- }
8998
9116
 
8999
- function isForcedDevelopmentMode() {
9000
- return localStorage.getItem("vaadin.developmentmode.force");
9001
- }
9117
+ [part='overlay'] {
9118
+ flex-direction: column;
9119
+ }
9002
9120
 
9003
- function isLocalhost() {
9004
- return (["localhost","127.0.0.1"].indexOf(window.location.hostname) >= 0);
9005
- }
9121
+ [part='content'] {
9122
+ padding: 0;
9123
+ height: 100%;
9124
+ overflow: hidden;
9125
+ -webkit-mask-image: none;
9126
+ mask-image: none;
9127
+ }
9006
9128
 
9007
- function isFlowProductionMode() {
9008
- if (FlowClients) {
9009
- const productionModeApps = Object.keys(FlowClients)
9010
- .map(key => FlowClients[key])
9011
- .filter(client => client.productionMode);
9012
- if (productionModeApps.length > 0) {
9013
- return true;
9014
- }
9129
+ :host([top-aligned]) [part~='overlay'] {
9130
+ margin-top: var(--lumo-space-xs);
9015
9131
  }
9016
- return false;
9017
- }
9018
9132
 
9019
- function uncommentAndRun(callback, args) {
9020
- if (typeof callback !== 'function') {
9021
- return;
9133
+ :host([bottom-aligned]) [part~='overlay'] {
9134
+ margin-bottom: var(--lumo-space-xs);
9022
9135
  }
9023
9136
 
9024
- const match = DEV_MODE_CODE_REGEXP.exec(callback.toString());
9025
- if (match) {
9026
- try {
9027
- // requires CSP: script-src 'unsafe-eval'
9028
- callback = new Function(match[1]);
9029
- } catch (e) {
9030
- // eat the exception
9031
- console.log('vaadin-development-mode-detector: uncommentAndRun() failed', e);
9137
+ @media (max-width: 420px), (max-height: 420px) {
9138
+ [part='overlay'] {
9139
+ width: 100vw;
9140
+ height: 70vh;
9141
+ max-height: 70vh;
9032
9142
  }
9033
9143
  }
9144
+ `;
9145
+
9146
+ registerStyles('vaadin-date-picker-overlay', [menuOverlay, datePickerOverlay], {
9147
+ moduleId: 'lumo-date-picker-overlay',
9148
+ });
9149
+
9150
+ /**
9151
+ * @license
9152
+ * Copyright (c) 2017 - 2023 Vaadin Ltd.
9153
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
9154
+ */
9155
+
9156
+ /**
9157
+ * Dummy custom element used for collecting
9158
+ * development time usage statistics.
9159
+ *
9160
+ * @private
9161
+ */
9162
+ class Lumo extends HTMLElement {
9163
+ static get is() {
9164
+ return 'vaadin-lumo-styles';
9165
+ }
9166
+
9167
+ static get version() {
9168
+ return '24.2.9';
9169
+ }
9170
+ }
9171
+
9172
+ defineCustomElement(Lumo);
9173
+
9174
+ const addLumoGlobalStyles = (id, ...styles) => {
9175
+ addGlobalThemeStyles(`lumo-${id}`, styles);
9176
+ };
9177
+
9178
+ /**
9179
+ * @license
9180
+ * Copyright (c) 2017 - 2023 Vaadin Ltd.
9181
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
9182
+ */
9183
+
9184
+ const colorBase = i$1`
9185
+ :host {
9186
+ /* Base (background) */
9187
+ --lumo-base-color: #fff;
9188
+
9189
+ /* Tint */
9190
+ --lumo-tint-5pct: hsla(0, 0%, 100%, 0.3);
9191
+ --lumo-tint-10pct: hsla(0, 0%, 100%, 0.37);
9192
+ --lumo-tint-20pct: hsla(0, 0%, 100%, 0.44);
9193
+ --lumo-tint-30pct: hsla(0, 0%, 100%, 0.5);
9194
+ --lumo-tint-40pct: hsla(0, 0%, 100%, 0.57);
9195
+ --lumo-tint-50pct: hsla(0, 0%, 100%, 0.64);
9196
+ --lumo-tint-60pct: hsla(0, 0%, 100%, 0.7);
9197
+ --lumo-tint-70pct: hsla(0, 0%, 100%, 0.77);
9198
+ --lumo-tint-80pct: hsla(0, 0%, 100%, 0.84);
9199
+ --lumo-tint-90pct: hsla(0, 0%, 100%, 0.9);
9200
+ --lumo-tint: #fff;
9201
+
9202
+ /* Shade */
9203
+ --lumo-shade-5pct: hsla(214, 61%, 25%, 0.05);
9204
+ --lumo-shade-10pct: hsla(214, 57%, 24%, 0.1);
9205
+ --lumo-shade-20pct: hsla(214, 53%, 23%, 0.16);
9206
+ --lumo-shade-30pct: hsla(214, 50%, 22%, 0.26);
9207
+ --lumo-shade-40pct: hsla(214, 47%, 21%, 0.38);
9208
+ --lumo-shade-50pct: hsla(214, 45%, 20%, 0.52);
9209
+ --lumo-shade-60pct: hsla(214, 43%, 19%, 0.6);
9210
+ --lumo-shade-70pct: hsla(214, 42%, 18%, 0.69);
9211
+ --lumo-shade-80pct: hsla(214, 41%, 17%, 0.83);
9212
+ --lumo-shade-90pct: hsla(214, 40%, 16%, 0.94);
9213
+ --lumo-shade: hsl(214, 35%, 15%);
9214
+
9215
+ /* Contrast */
9216
+ --lumo-contrast-5pct: var(--lumo-shade-5pct);
9217
+ --lumo-contrast-10pct: var(--lumo-shade-10pct);
9218
+ --lumo-contrast-20pct: var(--lumo-shade-20pct);
9219
+ --lumo-contrast-30pct: var(--lumo-shade-30pct);
9220
+ --lumo-contrast-40pct: var(--lumo-shade-40pct);
9221
+ --lumo-contrast-50pct: var(--lumo-shade-50pct);
9222
+ --lumo-contrast-60pct: var(--lumo-shade-60pct);
9223
+ --lumo-contrast-70pct: var(--lumo-shade-70pct);
9224
+ --lumo-contrast-80pct: var(--lumo-shade-80pct);
9225
+ --lumo-contrast-90pct: var(--lumo-shade-90pct);
9226
+ --lumo-contrast: var(--lumo-shade);
9227
+
9228
+ /* Text */
9229
+ --lumo-header-text-color: var(--lumo-contrast);
9230
+ --lumo-body-text-color: var(--lumo-contrast-90pct);
9231
+ --lumo-secondary-text-color: var(--lumo-contrast-70pct);
9232
+ --lumo-tertiary-text-color: var(--lumo-contrast-50pct);
9233
+ --lumo-disabled-text-color: var(--lumo-contrast-30pct);
9234
+
9235
+ /* Primary */
9236
+ --lumo-primary-color: hsl(214, 100%, 48%);
9237
+ --lumo-primary-color-50pct: hsla(214, 100%, 49%, 0.76);
9238
+ --lumo-primary-color-10pct: hsla(214, 100%, 60%, 0.13);
9239
+ --lumo-primary-text-color: hsl(214, 100%, 43%);
9240
+ --lumo-primary-contrast-color: #fff;
9241
+
9242
+ /* Error */
9243
+ --lumo-error-color: hsl(3, 85%, 48%);
9244
+ --lumo-error-color-50pct: hsla(3, 85%, 49%, 0.5);
9245
+ --lumo-error-color-10pct: hsla(3, 85%, 49%, 0.1);
9246
+ --lumo-error-text-color: hsl(3, 89%, 42%);
9247
+ --lumo-error-contrast-color: #fff;
9248
+
9249
+ /* Success */
9250
+ --lumo-success-color: hsl(145, 72%, 30%);
9251
+ --lumo-success-color-50pct: hsla(145, 72%, 31%, 0.5);
9252
+ --lumo-success-color-10pct: hsla(145, 72%, 31%, 0.1);
9253
+ --lumo-success-text-color: hsl(145, 85%, 25%);
9254
+ --lumo-success-contrast-color: #fff;
9255
+
9256
+ /* Warning */
9257
+ --lumo-warning-color: hsl(48, 100%, 50%);
9258
+ --lumo-warning-color-10pct: hsla(48, 100%, 50%, 0.25);
9259
+ --lumo-warning-text-color: hsl(32, 100%, 30%);
9260
+ --lumo-warning-contrast-color: var(--lumo-shade-90pct);
9261
+ }
9262
+
9263
+ /* forced-colors mode adjustments */
9264
+ @media (forced-colors: active) {
9265
+ html {
9266
+ --lumo-disabled-text-color: GrayText;
9267
+ }
9268
+ }
9269
+ `;
9270
+
9271
+ addLumoGlobalStyles('color-props', colorBase);
9272
+
9273
+ const color = i$1`
9274
+ [theme~='dark'] {
9275
+ /* Base (background) */
9276
+ --lumo-base-color: hsl(214, 35%, 21%);
9277
+
9278
+ /* Tint */
9279
+ --lumo-tint-5pct: hsla(214, 65%, 85%, 0.06);
9280
+ --lumo-tint-10pct: hsla(214, 60%, 80%, 0.14);
9281
+ --lumo-tint-20pct: hsla(214, 64%, 82%, 0.23);
9282
+ --lumo-tint-30pct: hsla(214, 69%, 84%, 0.32);
9283
+ --lumo-tint-40pct: hsla(214, 73%, 86%, 0.41);
9284
+ --lumo-tint-50pct: hsla(214, 78%, 88%, 0.5);
9285
+ --lumo-tint-60pct: hsla(214, 82%, 90%, 0.58);
9286
+ --lumo-tint-70pct: hsla(214, 87%, 92%, 0.69);
9287
+ --lumo-tint-80pct: hsla(214, 91%, 94%, 0.8);
9288
+ --lumo-tint-90pct: hsla(214, 96%, 96%, 0.9);
9289
+ --lumo-tint: hsl(214, 100%, 98%);
9290
+
9291
+ /* Shade */
9292
+ --lumo-shade-5pct: hsla(214, 0%, 0%, 0.07);
9293
+ --lumo-shade-10pct: hsla(214, 4%, 2%, 0.15);
9294
+ --lumo-shade-20pct: hsla(214, 8%, 4%, 0.23);
9295
+ --lumo-shade-30pct: hsla(214, 12%, 6%, 0.32);
9296
+ --lumo-shade-40pct: hsla(214, 16%, 8%, 0.41);
9297
+ --lumo-shade-50pct: hsla(214, 20%, 10%, 0.5);
9298
+ --lumo-shade-60pct: hsla(214, 24%, 12%, 0.6);
9299
+ --lumo-shade-70pct: hsla(214, 28%, 13%, 0.7);
9300
+ --lumo-shade-80pct: hsla(214, 32%, 13%, 0.8);
9301
+ --lumo-shade-90pct: hsla(214, 33%, 13%, 0.9);
9302
+ --lumo-shade: hsl(214, 33%, 13%);
9303
+
9304
+ /* Contrast */
9305
+ --lumo-contrast-5pct: var(--lumo-tint-5pct);
9306
+ --lumo-contrast-10pct: var(--lumo-tint-10pct);
9307
+ --lumo-contrast-20pct: var(--lumo-tint-20pct);
9308
+ --lumo-contrast-30pct: var(--lumo-tint-30pct);
9309
+ --lumo-contrast-40pct: var(--lumo-tint-40pct);
9310
+ --lumo-contrast-50pct: var(--lumo-tint-50pct);
9311
+ --lumo-contrast-60pct: var(--lumo-tint-60pct);
9312
+ --lumo-contrast-70pct: var(--lumo-tint-70pct);
9313
+ --lumo-contrast-80pct: var(--lumo-tint-80pct);
9314
+ --lumo-contrast-90pct: var(--lumo-tint-90pct);
9315
+ --lumo-contrast: var(--lumo-tint);
9316
+
9317
+ /* Text */
9318
+ --lumo-header-text-color: var(--lumo-contrast);
9319
+ --lumo-body-text-color: var(--lumo-contrast-90pct);
9320
+ --lumo-secondary-text-color: var(--lumo-contrast-70pct);
9321
+ --lumo-tertiary-text-color: var(--lumo-contrast-50pct);
9322
+ --lumo-disabled-text-color: var(--lumo-contrast-30pct);
9323
+
9324
+ /* Primary */
9325
+ --lumo-primary-color: hsl(214, 90%, 48%);
9326
+ --lumo-primary-color-50pct: hsla(214, 90%, 70%, 0.69);
9327
+ --lumo-primary-color-10pct: hsla(214, 90%, 55%, 0.13);
9328
+ --lumo-primary-text-color: hsl(214, 90%, 77%);
9329
+ --lumo-primary-contrast-color: #fff;
9330
+
9331
+ /* Error */
9332
+ --lumo-error-color: hsl(3, 79%, 49%);
9333
+ --lumo-error-color-50pct: hsla(3, 75%, 62%, 0.5);
9334
+ --lumo-error-color-10pct: hsla(3, 75%, 62%, 0.14);
9335
+ --lumo-error-text-color: hsl(3, 100%, 80%);
9336
+
9337
+ /* Success */
9338
+ --lumo-success-color: hsl(145, 72%, 30%);
9339
+ --lumo-success-color-50pct: hsla(145, 92%, 51%, 0.5);
9340
+ --lumo-success-color-10pct: hsla(145, 92%, 51%, 0.1);
9341
+ --lumo-success-text-color: hsl(145, 85%, 46%);
9342
+
9343
+ /* Warning */
9344
+ --lumo-warning-color: hsl(43, 100%, 48%);
9345
+ --lumo-warning-color-10pct: hsla(40, 100%, 50%, 0.2);
9346
+ --lumo-warning-text-color: hsl(45, 100%, 60%);
9347
+ --lumo-warning-contrast-color: var(--lumo-shade-90pct);
9348
+ }
9349
+
9350
+ html {
9351
+ color: var(--lumo-body-text-color);
9352
+ background-color: var(--lumo-base-color);
9353
+ color-scheme: light;
9354
+ }
9355
+
9356
+ [theme~='dark'] {
9357
+ color: var(--lumo-body-text-color);
9358
+ background-color: var(--lumo-base-color);
9359
+ color-scheme: dark;
9360
+ }
9361
+
9362
+ h1,
9363
+ h2,
9364
+ h3,
9365
+ h4,
9366
+ h5,
9367
+ h6 {
9368
+ color: var(--lumo-header-text-color);
9369
+ }
9370
+
9371
+ a:where(:any-link) {
9372
+ color: var(--lumo-primary-text-color);
9373
+ }
9374
+
9375
+ a:not(:any-link) {
9376
+ color: var(--lumo-disabled-text-color);
9377
+ }
9378
+
9379
+ blockquote {
9380
+ color: var(--lumo-secondary-text-color);
9381
+ }
9382
+
9383
+ code,
9384
+ pre {
9385
+ background-color: var(--lumo-contrast-10pct);
9386
+ border-radius: var(--lumo-border-radius-m);
9387
+ }
9388
+ `;
9389
+
9390
+ registerStyles('', color, { moduleId: 'lumo-color' });
9391
+
9392
+ /**
9393
+ * @license
9394
+ * Copyright (c) 2017 - 2023 Vaadin Ltd.
9395
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
9396
+ */
9397
+
9398
+ const sizing = i$1`
9399
+ :host {
9400
+ --lumo-size-xs: 1.625rem;
9401
+ --lumo-size-s: 1.875rem;
9402
+ --lumo-size-m: 2.25rem;
9403
+ --lumo-size-l: 2.75rem;
9404
+ --lumo-size-xl: 3.5rem;
9405
+
9406
+ /* Icons */
9407
+ --lumo-icon-size-s: 1.25em;
9408
+ --lumo-icon-size-m: 1.5em;
9409
+ --lumo-icon-size-l: 2.25em;
9410
+ /* For backwards compatibility */
9411
+ --lumo-icon-size: var(--lumo-icon-size-m);
9412
+ }
9413
+ `;
9414
+
9415
+ addLumoGlobalStyles('sizing-props', sizing);
9416
+
9417
+ /**
9418
+ * @license
9419
+ * Copyright (c) 2017 - 2023 Vaadin Ltd.
9420
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
9421
+ */
9422
+
9423
+ const spacing = i$1`
9424
+ :host {
9425
+ /* Square */
9426
+ --lumo-space-xs: 0.25rem;
9427
+ --lumo-space-s: 0.5rem;
9428
+ --lumo-space-m: 1rem;
9429
+ --lumo-space-l: 1.5rem;
9430
+ --lumo-space-xl: 2.5rem;
9431
+
9432
+ /* Wide */
9433
+ --lumo-space-wide-xs: calc(var(--lumo-space-xs) / 2) var(--lumo-space-xs);
9434
+ --lumo-space-wide-s: calc(var(--lumo-space-s) / 2) var(--lumo-space-s);
9435
+ --lumo-space-wide-m: calc(var(--lumo-space-m) / 2) var(--lumo-space-m);
9436
+ --lumo-space-wide-l: calc(var(--lumo-space-l) / 2) var(--lumo-space-l);
9437
+ --lumo-space-wide-xl: calc(var(--lumo-space-xl) / 2) var(--lumo-space-xl);
9438
+
9439
+ /* Tall */
9440
+ --lumo-space-tall-xs: var(--lumo-space-xs) calc(var(--lumo-space-xs) / 2);
9441
+ --lumo-space-tall-s: var(--lumo-space-s) calc(var(--lumo-space-s) / 2);
9442
+ --lumo-space-tall-m: var(--lumo-space-m) calc(var(--lumo-space-m) / 2);
9443
+ --lumo-space-tall-l: var(--lumo-space-l) calc(var(--lumo-space-l) / 2);
9444
+ --lumo-space-tall-xl: var(--lumo-space-xl) calc(var(--lumo-space-xl) / 2);
9445
+ }
9446
+ `;
9447
+
9448
+ addLumoGlobalStyles('spacing-props', spacing);
9449
+
9450
+ /**
9451
+ * @license
9452
+ * Copyright (c) 2017 - 2023 Vaadin Ltd.
9453
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
9454
+ */
9455
+
9456
+ const style = i$1`
9457
+ :host {
9458
+ /* Border radius */
9459
+ --lumo-border-radius-s: 0.25em; /* Checkbox, badge, date-picker year indicator, etc */
9460
+ --lumo-border-radius-m: var(--lumo-border-radius, 0.25em); /* Button, text field, menu overlay, etc */
9461
+ --lumo-border-radius-l: 0.5em; /* Dialog, notification, etc */
9462
+
9463
+ /* Shadow */
9464
+ --lumo-box-shadow-xs: 0 1px 4px -1px var(--lumo-shade-50pct);
9465
+ --lumo-box-shadow-s: 0 2px 4px -1px var(--lumo-shade-20pct), 0 3px 12px -1px var(--lumo-shade-30pct);
9466
+ --lumo-box-shadow-m: 0 2px 6px -1px var(--lumo-shade-20pct), 0 8px 24px -4px var(--lumo-shade-40pct);
9467
+ --lumo-box-shadow-l: 0 3px 18px -2px var(--lumo-shade-20pct), 0 12px 48px -6px var(--lumo-shade-40pct);
9468
+ --lumo-box-shadow-xl: 0 4px 24px -3px var(--lumo-shade-20pct), 0 18px 64px -8px var(--lumo-shade-40pct);
9469
+
9470
+ /* Clickable element cursor */
9471
+ --lumo-clickable-cursor: default;
9472
+ }
9473
+ `;
9474
+
9475
+ /**
9476
+ * Default values for component-specific custom properties.
9477
+ */
9478
+ i$1`
9479
+ html {
9480
+ --vaadin-checkbox-size: calc(var(--lumo-size-m) / 2);
9481
+ --vaadin-radio-button-size: calc(var(--lumo-size-m) / 2);
9482
+ --vaadin-input-field-border-radius: var(--lumo-border-radius-m);
9483
+ }
9484
+ `;
9485
+
9486
+ addLumoGlobalStyles('style-props', style);
9487
+
9488
+ /**
9489
+ * @license
9490
+ * Copyright (c) 2017 - 2023 Vaadin Ltd.
9491
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
9492
+ */
9493
+
9494
+ const font = i$1`
9495
+ :host {
9496
+ /* prettier-ignore */
9497
+ --lumo-font-family: -apple-system, BlinkMacSystemFont, 'Roboto', 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
9498
+
9499
+ /* Font sizes */
9500
+ --lumo-font-size-xxs: 0.75rem;
9501
+ --lumo-font-size-xs: 0.8125rem;
9502
+ --lumo-font-size-s: 0.875rem;
9503
+ --lumo-font-size-m: 1rem;
9504
+ --lumo-font-size-l: 1.125rem;
9505
+ --lumo-font-size-xl: 1.375rem;
9506
+ --lumo-font-size-xxl: 1.75rem;
9507
+ --lumo-font-size-xxxl: 2.5rem;
9508
+
9509
+ /* Line heights */
9510
+ --lumo-line-height-xs: 1.25;
9511
+ --lumo-line-height-s: 1.375;
9512
+ --lumo-line-height-m: 1.625;
9513
+ }
9514
+ `;
9515
+
9516
+ const typography = i$1`
9517
+ body,
9518
+ :host {
9519
+ font-family: var(--lumo-font-family);
9520
+ font-size: var(--lumo-font-size-m);
9521
+ line-height: var(--lumo-line-height-m);
9522
+ -webkit-text-size-adjust: 100%;
9523
+ -webkit-font-smoothing: antialiased;
9524
+ -moz-osx-font-smoothing: grayscale;
9525
+ }
9526
+
9527
+ small,
9528
+ [theme~='font-size-s'] {
9529
+ font-size: var(--lumo-font-size-s);
9530
+ line-height: var(--lumo-line-height-s);
9531
+ }
9532
+
9533
+ [theme~='font-size-xs'] {
9534
+ font-size: var(--lumo-font-size-xs);
9535
+ line-height: var(--lumo-line-height-xs);
9536
+ }
9537
+
9538
+ :where(h1, h2, h3, h4, h5, h6) {
9539
+ font-weight: 600;
9540
+ line-height: var(--lumo-line-height-xs);
9541
+ margin-block: 0;
9542
+ }
9543
+
9544
+ :where(h1) {
9545
+ font-size: var(--lumo-font-size-xxxl);
9546
+ }
9547
+
9548
+ :where(h2) {
9549
+ font-size: var(--lumo-font-size-xxl);
9550
+ }
9551
+
9552
+ :where(h3) {
9553
+ font-size: var(--lumo-font-size-xl);
9554
+ }
9555
+
9556
+ :where(h4) {
9557
+ font-size: var(--lumo-font-size-l);
9558
+ }
9559
+
9560
+ :where(h5) {
9561
+ font-size: var(--lumo-font-size-m);
9562
+ }
9563
+
9564
+ :where(h6) {
9565
+ font-size: var(--lumo-font-size-xs);
9566
+ text-transform: uppercase;
9567
+ letter-spacing: 0.03em;
9568
+ }
9569
+
9570
+ p,
9571
+ blockquote {
9572
+ margin-top: 0.5em;
9573
+ margin-bottom: 0.75em;
9574
+ }
9575
+
9576
+ a {
9577
+ text-decoration: none;
9578
+ }
9579
+
9580
+ a:where(:any-link):hover {
9581
+ text-decoration: underline;
9582
+ }
9583
+
9584
+ hr {
9585
+ display: block;
9586
+ align-self: stretch;
9587
+ height: 1px;
9588
+ border: 0;
9589
+ padding: 0;
9590
+ margin: var(--lumo-space-s) calc(var(--lumo-border-radius-m) / 2);
9591
+ background-color: var(--lumo-contrast-10pct);
9592
+ }
9593
+
9594
+ blockquote {
9595
+ border-left: 2px solid var(--lumo-contrast-30pct);
9596
+ }
9597
+
9598
+ b,
9599
+ strong {
9600
+ font-weight: 600;
9601
+ }
9602
+
9603
+ /* RTL specific styles */
9604
+ blockquote[dir='rtl'] {
9605
+ border-left: none;
9606
+ border-right: 2px solid var(--lumo-contrast-30pct);
9607
+ }
9608
+ `;
9609
+
9610
+ registerStyles('', typography, { moduleId: 'lumo-typography' });
9611
+ addLumoGlobalStyles('typography-props', font);
9612
+
9613
+ const button = i$1`
9614
+ :host {
9615
+ /* Sizing */
9616
+ --lumo-button-size: var(--lumo-size-m);
9617
+ min-width: calc(var(--lumo-button-size) * 2);
9618
+ height: var(--lumo-button-size);
9619
+ padding: 0 calc(var(--lumo-button-size) / 3 + var(--lumo-border-radius-m) / 2);
9620
+ margin: var(--lumo-space-xs) 0;
9621
+ box-sizing: border-box;
9622
+ /* Style */
9623
+ font-family: var(--lumo-font-family);
9624
+ font-size: var(--lumo-font-size-m);
9625
+ font-weight: 500;
9626
+ color: var(--_lumo-button-color, var(--lumo-primary-text-color));
9627
+ background-color: var(--_lumo-button-background-color, var(--lumo-contrast-5pct));
9628
+ border-radius: var(--lumo-border-radius-m);
9629
+ cursor: var(--lumo-clickable-cursor);
9630
+ -webkit-tap-highlight-color: transparent;
9631
+ -webkit-font-smoothing: antialiased;
9632
+ -moz-osx-font-smoothing: grayscale;
9633
+ flex-shrink: 0;
9634
+ }
9635
+
9636
+ /* Set only for the internal parts so we don't affect the host vertical alignment */
9637
+ [part='label'],
9638
+ [part='prefix'],
9639
+ [part='suffix'] {
9640
+ line-height: var(--lumo-line-height-xs);
9641
+ }
9642
+
9643
+ [part='label'] {
9644
+ padding: calc(var(--lumo-button-size) / 6) 0;
9645
+ }
9646
+
9647
+ :host([theme~='small']) {
9648
+ font-size: var(--lumo-font-size-s);
9649
+ --lumo-button-size: var(--lumo-size-s);
9650
+ }
9651
+
9652
+ :host([theme~='large']) {
9653
+ font-size: var(--lumo-font-size-l);
9654
+ --lumo-button-size: var(--lumo-size-l);
9655
+ }
9656
+
9657
+ /* For interaction states */
9658
+ :host::before,
9659
+ :host::after {
9660
+ content: '';
9661
+ /* We rely on the host always being relative */
9662
+ position: absolute;
9663
+ z-index: 1;
9664
+ inset: 0;
9665
+ background-color: currentColor;
9666
+ border-radius: inherit;
9667
+ opacity: 0;
9668
+ pointer-events: none;
9669
+ }
9670
+
9671
+ /* Hover */
9672
+
9673
+ @media (any-hover: hover) {
9674
+ :host(:hover)::before {
9675
+ opacity: 0.02;
9676
+ }
9677
+ }
9678
+
9679
+ /* Active */
9680
+
9681
+ :host::after {
9682
+ transition: opacity 1.4s, transform 0.1s;
9683
+ filter: blur(8px);
9684
+ }
9685
+
9686
+ :host([active])::before {
9687
+ opacity: 0.05;
9688
+ transition-duration: 0s;
9689
+ }
9690
+
9691
+ :host([active])::after {
9692
+ opacity: 0.1;
9693
+ transition-duration: 0s, 0s;
9694
+ transform: scale(0);
9695
+ }
9696
+
9697
+ /* Keyboard focus */
9698
+
9699
+ :host([focus-ring]) {
9700
+ box-shadow: 0 0 0 2px var(--lumo-primary-color-50pct);
9701
+ }
9702
+
9703
+ :host([theme~='primary'][focus-ring]) {
9704
+ box-shadow: 0 0 0 1px var(--lumo-base-color), 0 0 0 3px var(--lumo-primary-color-50pct);
9705
+ }
9706
+
9707
+ /* Types (primary, tertiary, tertiary-inline */
9708
+
9709
+ :host([theme~='tertiary']),
9710
+ :host([theme~='tertiary-inline']) {
9711
+ background-color: transparent !important;
9712
+ min-width: 0;
9713
+ }
9714
+
9715
+ :host([theme~='tertiary']) {
9716
+ padding: 0 calc(var(--lumo-button-size) / 6);
9717
+ }
9718
+
9719
+ :host([theme~='tertiary-inline'])::before {
9720
+ display: none;
9721
+ }
9722
+
9723
+ :host([theme~='tertiary-inline']) {
9724
+ margin: 0;
9725
+ height: auto;
9726
+ padding: 0;
9727
+ line-height: inherit;
9728
+ font-size: inherit;
9729
+ }
9730
+
9731
+ :host([theme~='tertiary-inline']) [part='label'] {
9732
+ padding: 0;
9733
+ overflow: visible;
9734
+ line-height: inherit;
9735
+ }
9736
+
9737
+ :host([theme~='primary']) {
9738
+ background-color: var(--_lumo-button-primary-background-color, var(--lumo-primary-color));
9739
+ color: var(--_lumo-button-primary-color, var(--lumo-primary-contrast-color));
9740
+ font-weight: 600;
9741
+ min-width: calc(var(--lumo-button-size) * 2.5);
9742
+ }
9743
+
9744
+ :host([theme~='primary'])::before {
9745
+ background-color: black;
9746
+ }
9747
+
9748
+ @media (any-hover: hover) {
9749
+ :host([theme~='primary']:hover)::before {
9750
+ opacity: 0.05;
9751
+ }
9752
+ }
9753
+
9754
+ :host([theme~='primary'][active])::before {
9755
+ opacity: 0.1;
9756
+ }
9757
+
9758
+ :host([theme~='primary'][active])::after {
9759
+ opacity: 0.2;
9760
+ }
9761
+
9762
+ /* Colors (success, error, contrast) */
9763
+
9764
+ :host([theme~='success']) {
9765
+ color: var(--lumo-success-text-color);
9766
+ }
9767
+
9768
+ :host([theme~='success'][theme~='primary']) {
9769
+ background-color: var(--lumo-success-color);
9770
+ color: var(--lumo-success-contrast-color);
9771
+ }
9772
+
9773
+ :host([theme~='error']) {
9774
+ color: var(--lumo-error-text-color);
9775
+ }
9776
+
9777
+ :host([theme~='error'][theme~='primary']) {
9778
+ background-color: var(--lumo-error-color);
9779
+ color: var(--lumo-error-contrast-color);
9780
+ }
9781
+
9782
+ :host([theme~='contrast']) {
9783
+ color: var(--lumo-contrast);
9784
+ }
9785
+
9786
+ :host([theme~='contrast'][theme~='primary']) {
9787
+ background-color: var(--lumo-contrast);
9788
+ color: var(--lumo-base-color);
9789
+ }
9790
+
9791
+ /* Disabled state. Keep selectors after other color variants. */
9792
+
9793
+ :host([disabled]) {
9794
+ pointer-events: none;
9795
+ color: var(--lumo-disabled-text-color);
9796
+ }
9797
+
9798
+ :host([theme~='primary'][disabled]) {
9799
+ background-color: var(--lumo-contrast-30pct);
9800
+ color: var(--lumo-base-color);
9801
+ }
9802
+
9803
+ :host([theme~='primary'][disabled]) [part] {
9804
+ opacity: 0.7;
9805
+ }
9806
+
9807
+ /* Icons */
9808
+
9809
+ [part] ::slotted(vaadin-icon) {
9810
+ display: inline-block;
9811
+ width: var(--lumo-icon-size-m);
9812
+ height: var(--lumo-icon-size-m);
9813
+ }
9814
+
9815
+ /* Vaadin icons are based on a 16x16 grid (unlike Lumo and Material icons with 24x24), so they look too big by default */
9816
+ [part] ::slotted(vaadin-icon[icon^='vaadin:']) {
9817
+ padding: 0.25em;
9818
+ box-sizing: border-box !important;
9819
+ }
9820
+
9821
+ [part='prefix'] {
9822
+ margin-left: -0.25em;
9823
+ margin-right: 0.25em;
9824
+ }
9825
+
9826
+ [part='suffix'] {
9827
+ margin-left: 0.25em;
9828
+ margin-right: -0.25em;
9829
+ }
9830
+
9831
+ /* Icon-only */
9832
+
9833
+ :host([theme~='icon']:not([theme~='tertiary-inline'])) {
9834
+ min-width: var(--lumo-button-size);
9835
+ padding-left: calc(var(--lumo-button-size) / 4);
9836
+ padding-right: calc(var(--lumo-button-size) / 4);
9837
+ }
9838
+
9839
+ :host([theme~='icon']) [part='prefix'],
9840
+ :host([theme~='icon']) [part='suffix'] {
9841
+ margin-left: 0;
9842
+ margin-right: 0;
9843
+ }
9844
+
9845
+ /* RTL specific styles */
9846
+
9847
+ :host([dir='rtl']) [part='prefix'] {
9848
+ margin-left: 0.25em;
9849
+ margin-right: -0.25em;
9850
+ }
9851
+
9852
+ :host([dir='rtl']) [part='suffix'] {
9853
+ margin-left: -0.25em;
9854
+ margin-right: 0.25em;
9855
+ }
9856
+
9857
+ :host([dir='rtl'][theme~='icon']) [part='prefix'],
9858
+ :host([dir='rtl'][theme~='icon']) [part='suffix'] {
9859
+ margin-left: 0;
9860
+ margin-right: 0;
9861
+ }
9862
+ `;
9863
+
9864
+ registerStyles('vaadin-button', button, { moduleId: 'lumo-button' });
9865
+
9866
+ /**
9867
+ * @license
9868
+ * Copyright (c) 2021 - 2023 Vaadin Ltd.
9869
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
9870
+ */
9871
+
9872
+ /**
9873
+ * @typedef ReactiveController
9874
+ * @type {import('lit').ReactiveController}
9875
+ */
9876
+
9877
+ /**
9878
+ * A mixin for connecting controllers to the element.
9879
+ *
9880
+ * @polymerMixin
9881
+ */
9882
+ const ControllerMixin = dedupingMixin((superClass) => {
9883
+ // If the superclass extends from LitElement,
9884
+ // use its own controllers implementation.
9885
+ if (typeof superClass.prototype.addController === 'function') {
9886
+ return superClass;
9887
+ }
9888
+
9889
+ return class ControllerMixinClass extends superClass {
9890
+ constructor() {
9891
+ super();
9892
+
9893
+ /**
9894
+ * @type {Set<ReactiveController>}
9895
+ */
9896
+ this.__controllers = new Set();
9897
+ }
9898
+
9899
+ /** @protected */
9900
+ connectedCallback() {
9901
+ super.connectedCallback();
9902
+
9903
+ this.__controllers.forEach((c) => {
9904
+ if (c.hostConnected) {
9905
+ c.hostConnected();
9906
+ }
9907
+ });
9908
+ }
9909
+
9910
+ /** @protected */
9911
+ disconnectedCallback() {
9912
+ super.disconnectedCallback();
9913
+
9914
+ this.__controllers.forEach((c) => {
9915
+ if (c.hostDisconnected) {
9916
+ c.hostDisconnected();
9917
+ }
9918
+ });
9919
+ }
9920
+
9921
+ /**
9922
+ * Registers a controller to participate in the element update cycle.
9923
+ *
9924
+ * @param {ReactiveController} controller
9925
+ * @protected
9926
+ */
9927
+ addController(controller) {
9928
+ this.__controllers.add(controller);
9929
+ // Call hostConnected if a controller is added after the element is attached.
9930
+ if (this.$ !== undefined && this.isConnected && controller.hostConnected) {
9931
+ controller.hostConnected();
9932
+ }
9933
+ }
9934
+
9935
+ /**
9936
+ * Removes a controller from the element.
9937
+ *
9938
+ * @param {ReactiveController} controller
9939
+ * @protected
9940
+ */
9941
+ removeController(controller) {
9942
+ this.__controllers.delete(controller);
9943
+ }
9944
+ };
9945
+ });
9946
+
9947
+ const DEV_MODE_CODE_REGEXP =
9948
+ /\/\*[\*!]\s+vaadin-dev-mode:start([\s\S]*)vaadin-dev-mode:end\s+\*\*\//i;
9949
+
9950
+ const FlowClients = window.Vaadin && window.Vaadin.Flow && window.Vaadin.Flow.clients;
9951
+
9952
+ function isMinified() {
9953
+ function test() {
9954
+ /** vaadin-dev-mode:start
9955
+ return false;
9956
+ vaadin-dev-mode:end **/
9957
+ return true;
9958
+ }
9959
+ return uncommentAndRun(test);
9960
+ }
9961
+
9962
+ function isDevelopmentMode() {
9963
+ try {
9964
+ if (isForcedDevelopmentMode()) {
9965
+ return true;
9966
+ }
9967
+
9968
+ if (!isLocalhost()) {
9969
+ return false;
9970
+ }
9971
+
9972
+ if (FlowClients) {
9973
+ return !isFlowProductionMode();
9974
+ }
9975
+
9976
+ return !isMinified();
9977
+ } catch (e) {
9978
+ // Some error in this code, assume production so no further actions will be taken
9979
+ return false;
9980
+ }
9981
+ }
9982
+
9983
+ function isForcedDevelopmentMode() {
9984
+ return localStorage.getItem("vaadin.developmentmode.force");
9985
+ }
9986
+
9987
+ function isLocalhost() {
9988
+ return (["localhost","127.0.0.1"].indexOf(window.location.hostname) >= 0);
9989
+ }
9990
+
9991
+ function isFlowProductionMode() {
9992
+ if (FlowClients) {
9993
+ const productionModeApps = Object.keys(FlowClients)
9994
+ .map(key => FlowClients[key])
9995
+ .filter(client => client.productionMode);
9996
+ if (productionModeApps.length > 0) {
9997
+ return true;
9998
+ }
9999
+ }
10000
+ return false;
10001
+ }
10002
+
10003
+ function uncommentAndRun(callback, args) {
10004
+ if (typeof callback !== 'function') {
10005
+ return;
10006
+ }
10007
+
10008
+ const match = DEV_MODE_CODE_REGEXP.exec(callback.toString());
10009
+ if (match) {
10010
+ try {
10011
+ // requires CSP: script-src 'unsafe-eval'
10012
+ callback = new Function(match[1]);
10013
+ } catch (e) {
10014
+ // eat the exception
10015
+ console.log('vaadin-development-mode-detector: uncommentAndRun() failed', e);
10016
+ }
10017
+ }
10018
+
10019
+ return callback(args);
10020
+ }
9034
10021
 
9035
- return callback(args);
9036
- }
9037
-
9038
10022
  // A guard against polymer-modulizer removing the window.Vaadin
9039
10023
  // initialization above.
9040
10024
  window['Vaadin'] = window['Vaadin'] || {};
@@ -9906,7 +10890,7 @@ const registered = new Set();
9906
10890
  const ElementMixin = (superClass) =>
9907
10891
  class VaadinElementMixin extends DirMixin(superClass) {
9908
10892
  static get version() {
9909
- return '24.2.5';
10893
+ return '24.2.9';
9910
10894
  }
9911
10895
 
9912
10896
  /** @protected */
@@ -11685,6 +12669,8 @@ const KeyboardMixin = dedupingMixin(
11685
12669
  * by the pointer or by releasing the activation key.
11686
12670
  *
11687
12671
  * @polymerMixin
12672
+ * @mixes DisabledMixin
12673
+ * @mixes KeyboardMixin
11688
12674
  */
11689
12675
  const ActiveMixin = (superclass) =>
11690
12676
  class ActiveMixinClass extends DisabledMixin(KeyboardMixin(superclass)) {
@@ -12754,7 +13740,7 @@ const fontIcons = i$1`
12754
13740
  }
12755
13741
  `;
12756
13742
 
12757
- addLumoGlobalStyles('font-icons', fontIcons);
13743
+ addLumoGlobalStyles$1('font-icons', fontIcons);
12758
13744
 
12759
13745
  /**
12760
13746
  * @license
@@ -14075,6 +15061,14 @@ const OverlayMixin = (superClass) =>
14075
15061
  // and <vaadin-context-menu>).
14076
15062
  this.addEventListener('click', () => {});
14077
15063
  this.$.backdrop.addEventListener('click', () => {});
15064
+
15065
+ this.addEventListener('mouseup', () => {
15066
+ // In Chrome, focus moves to body on overlay content mousedown
15067
+ // See https://github.com/vaadin/flow-components/issues/5507
15068
+ if (document.activeElement === document.body && this.$.overlay.getAttribute('tabindex') === '0') {
15069
+ this.$.overlay.focus();
15070
+ }
15071
+ });
14078
15072
  }
14079
15073
 
14080
15074
  /** @protected */
@@ -17183,7 +18177,7 @@ class DomRepeat extends domRepeatBase {
17183
18177
  if (prop == this.as) {
17184
18178
  this.items[idx] = value;
17185
18179
  }
17186
- let path = translate$1(this.as, `${JSCompiler_renameProperty('items', this)}.${idx}`, prop);
18180
+ let path = translate$5(this.as, `${JSCompiler_renameProperty('items', this)}.${idx}`, prop);
17187
18181
  this.notifyPath(path, value);
17188
18182
  }
17189
18183
  }
@@ -23370,443 +24364,1767 @@ class DatePicker extends DatePickerMixin(InputControlMixin(ThemableMixin(Element
23370
24364
  if (e.detail.sourceEvent && e.detail.sourceEvent.composedPath().includes(this)) {
23371
24365
  e.preventDefault();
23372
24366
  }
23373
- }
23374
-
23375
- /** @private */
23376
- _toggle(e) {
23377
- e.stopPropagation();
23378
- if (this.$.overlay.opened) {
23379
- this.close();
23380
- } else {
23381
- this.open();
24367
+ }
24368
+
24369
+ /** @private */
24370
+ _toggle(e) {
24371
+ e.stopPropagation();
24372
+ if (this.$.overlay.opened) {
24373
+ this.close();
24374
+ } else {
24375
+ this.open();
24376
+ }
24377
+ }
24378
+
24379
+ // Workaround https://github.com/vaadin/web-components/issues/2855
24380
+ /** @protected */
24381
+ _openedChanged(opened) {
24382
+ super._openedChanged(opened);
24383
+
24384
+ this.$.overlay.positionTarget = this.shadowRoot.querySelector('[part="input-field"]');
24385
+ this.$.overlay.noVerticalOverlap = true;
24386
+ }
24387
+ }
24388
+
24389
+ defineCustomElement(DatePicker);
24390
+
24391
+ const helperFiltersCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.FilterButtonsWrapper{display:flex;justify-content:flex-end;gap:5px}.FilterButtonsWrapper .FilterOpen{cursor:pointer;border-radius:4px;padding:8px 15px;width:max-content;border:1px solid #00958f;background:#00958f;color:#FFF;font-size:12px;transition:all 0.2s linear;text-align:center;letter-spacing:0}.FilterButtonsWrapper .FilterOpen:hover{background:#00958f;color:#FFF}.FilterButtonsWrapper .FilterClear{cursor:pointer;border-radius:4px;padding:8px 15px;width:max-content;border:1px solid #00958f;background:#FFF;color:#000;font-size:12px;transition:all 0.2s linear;text-align:center;letter-spacing:0}.FilterButtonsWrapper .FilterClear:hover{background:#00958f;color:#FFF}.FilterModalHeader,.FilterModalBody,.FilterModalFooter{display:flex;flex-direction:column;gap:5px;align-items:center;margin:20px 0}.FilterModalHeader .FilterModalTitle,.FilterModalBody .FilterModalTitle,.FilterModalFooter .FilterModalTitle{margin:0;padding:0;font-weight:700;font-size:16px;color:#009993;text-transform:uppercase}.FilterModalHeader .FilterModalSearch,.FilterModalBody .FilterModalSearch,.FilterModalFooter .FilterModalSearch{border-radius:4px;background:#e8ebef;color:#263445;width:100%;height:26px;max-width:280px;padding:5px;font-size:15px;border:none;outline:#009993}.FilterModalHeader .FilterCalendarWrapper,.FilterModalBody .FilterCalendarWrapper,.FilterModalFooter .FilterCalendarWrapper{display:flex;gap:5px}.FilterModalHeader .FilterCalendarWrapper .VaadinDatePicker,.FilterModalBody .FilterCalendarWrapper .VaadinDatePicker,.FilterModalFooter .FilterCalendarWrapper .VaadinDatePicker{width:50%;max-width:143px}.FilterModalHeader .FilterModalButton,.FilterModalBody .FilterModalButton,.FilterModalFooter .FilterModalButton{cursor:pointer;border-radius:4px;padding:8px 60px;width:max-content;margin:5px;border:1px solid #00958f;background:#00958f;color:#FFF;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0}.FilterModalHeader .FilterModalButton:hover,.FilterModalBody .FilterModalButton:hover,.FilterModalFooter .FilterModalButton:hover{background:#00958f;color:#FFF}.FilterModalHeader p,.FilterModalBody p,.FilterModalFooter p{margin:5px 0}";
24392
+ const HelperFiltersStyle0 = helperFiltersCss;
24393
+
24394
+ const HelperFilters = class {
24395
+ constructor(hostRef) {
24396
+ registerInstance(this, hostRef);
24397
+ this.filterDraw = createEvent(this, "filterDraw", 7);
24398
+ this.filterSelection = createEvent(this, "filterSelection", 7);
24399
+ this.filterSelectionReset = createEvent(this, "filterSelectionReset", 7);
24400
+ this.setClientStyling = () => {
24401
+ let sheet = document.createElement('style');
24402
+ sheet.innerHTML = this.clientStyling;
24403
+ this.stylingContainer.prepend(sheet);
24404
+ };
24405
+ this.setClientStylingURL = () => {
24406
+ let cssFile = document.createElement('style');
24407
+ setTimeout(() => {
24408
+ cssFile.innerHTML = this.clientStylingUrlContent;
24409
+ this.stylingContainer.prepend(cssFile);
24410
+ }, 1);
24411
+ };
24412
+ this.showFilterId = true;
24413
+ this.activateTicketSearch = false;
24414
+ this.gameId = '';
24415
+ this.playerId = '';
24416
+ this.session = '';
24417
+ this.postMessage = false;
24418
+ this.language = 'en';
24419
+ this.quickFiltersActive = false;
24420
+ this.clientStyling = '';
24421
+ this.clientStylingUrlContent = '';
24422
+ this.showFilterModal = false;
24423
+ this.showClearButton = false;
24424
+ this.filterData = {};
24425
+ this.filterDataReset = { ticketDrawId: '', filterFromCalendar: '', filterToCalendar: '' };
24426
+ this.limitStylingAppends = false;
24427
+ }
24428
+ // reset field values each time the filter modal opens
24429
+ componentDidRender() {
24430
+ // @TODO: to way binding?
24431
+ if (document.getElementById('#FilterById'))
24432
+ document.getElementById('#FilterById').value = '';
24433
+ // start custom styling area
24434
+ if (!this.limitStylingAppends && this.stylingContainer) {
24435
+ if (this.clientStyling)
24436
+ this.setClientStyling();
24437
+ if (this.clientStylingUrlContent)
24438
+ this.setClientStylingURL();
24439
+ this.limitStylingAppends = true;
24440
+ }
24441
+ // end custom styling area
24442
+ }
24443
+ filterSelectionHandler(event) {
24444
+ if (this.postMessage)
24445
+ window.postMessage({ type: 'filterSelection', event }, window.location.href);
24446
+ if (this.filterData.ticketDrawId || this.filterData.filterFromCalendar || this.filterData.filterToCalendar)
24447
+ this.filterSelection.emit(event);
24448
+ }
24449
+ filterSelectionResetHandler(event) {
24450
+ if (this.postMessage)
24451
+ window.postMessage({ type: 'filterSelectionReset', event }, window.location.href);
24452
+ this.filterSelectionReset.emit(event);
24453
+ }
24454
+ modalCloseEvent() {
24455
+ this.showFilterModal = false;
24456
+ }
24457
+ // Toggle filter modal
24458
+ toggleFilterModal() {
24459
+ this.showFilterModal = true;
24460
+ }
24461
+ // Filter search
24462
+ filterSearch() {
24463
+ this.modalCloseEvent();
24464
+ this.showClearButton = true;
24465
+ this.filterSelectionHandler(this.filterData);
24466
+ console.log(this.showClearButton);
24467
+ }
24468
+ resetSearch() {
24469
+ this.showClearButton = false;
24470
+ this.filterSelectionResetHandler(this.filterDataReset);
24471
+ this.filterData = {};
24472
+ }
24473
+ handleTicketDrawId(event) {
24474
+ this.filterData.ticketDrawId = event.target.value;
24475
+ }
24476
+ handleFilterFrom(event) {
24477
+ this.filterData.filterFromCalendar = new Date(event.target.value).toISOString();
24478
+ }
24479
+ handleFilterTo(event) {
24480
+ this.filterData.filterToCalendar = new Date(event.target.value).toISOString();
24481
+ }
24482
+ render() {
24483
+ return (h$2("div", { key: 'd74774bd58fa3df6b0038fd979fb4aec4262d43d', class: "HelperFilters", ref: el => this.stylingContainer = el }, h$2("div", { key: '0827128924ba350888ae81e67e0306e536b15047', class: "FilterButtonsWrapper" }, h$2("button", { key: '73ae5aff5896195cd895410caf44dccfa1ac5cfc', class: "FilterOpen", onClick: () => this.toggleFilterModal() }, translate$6('filterOpen', this.language)), console.log('in filter Open', this.showClearButton, this.quickFiltersActive), (this.showClearButton || this.quickFiltersActive) ?
24484
+ h$2("button", { class: "FilterClear", onClick: () => this.resetSearch() }, translate$6('filterClear', this.language))
24485
+ :
24486
+ null), h$2("helper-modal", { key: 'add83df2714fdb69e8dfa7a0f5d1eb0d526fc2b4', "title-modal": "Filter Modal", visible: this.showFilterModal, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }, h$2("div", { key: '861b04161876b557184fe49c514867788147e4b9', class: "FilterModalHeader" }, h$2("h3", { key: '7471430912f301ff995c401b08298d9006816216', class: "FilterModalTitle" }, this.activateTicketSearch ? translate$6('filterModalTicketTitle', this.language) : translate$6('filterModalDrawTitle', this.language))), h$2("div", { key: 'af6bd8e253f332c8724e1bb40100ba5e1e59838f', class: "FilterModalBody" }, h$2("input", { key: '9edc7e14b801d40d4861625264f82b2fa213a770', id: "FilterById", type: "text", value: this.filterData.ticketDrawId, onInput: (event) => this.handleTicketDrawId(event), class: "FilterModalSearch", placeholder: this.activateTicketSearch ? translate$6('filterTicketPlaceholder', this.language) : translate$6('filterDrawPlaceholder', this.language) }), h$2("p", { key: '9665b359f9d6da19f120eb9bb315c4b144c80ced' }, translate$6('filterOrDate', this.language)), h$2("div", { key: 'd155c7d73a719aaedc581f51aa97cf21ec3125df', class: "FilterCalendarWrapper" }, h$2("vaadin-date-picker", { key: '586fb38bc5c718a4afa06ebec96bec0fd46949eb', value: this.filterData.filterFromCalendar, onChange: (event) => this.handleFilterFrom(event), placeholder: translate$6('filterFromCalendar', this.language), class: "VaadinDatePicker" }), h$2("vaadin-date-picker", { key: '42e8965b2c740c19c53687c114faf6aa22f11de8', value: this.filterData.filterToCalendar, onChange: (event) => this.handleFilterTo(event), placeholder: translate$6('filterToCalendar', this.language), class: "VaadinDatePicker" }))), h$2("div", { key: '7529eef1b25d130d183a55e45862418444054d3c', class: "FilterModalFooter" }, h$2("button", { key: '7dac7dc7b01c1c66dde7c6670a352f597b3f75fc', class: "FilterModalButton", onClick: () => this.filterSearch() }, translate$6('filterModalButton', this.language))))));
24487
+ }
24488
+ };
24489
+ HelperFilters.style = HelperFiltersStyle0;
24490
+
24491
+ /**
24492
+ * @name isMobile
24493
+ * @description A method that returns if the browser used to access the app is from a mobile device or not
24494
+ * @param {String} userAgent window.navigator.userAgent
24495
+ * @returns {Boolean} true or false
24496
+ */
24497
+ const isMobile$1 = (userAgent) => {
24498
+ return !!(userAgent.toLowerCase().match(/android/i) ||
24499
+ userAgent.toLowerCase().match(/blackberry|bb/i) ||
24500
+ userAgent.toLowerCase().match(/iphone|ipad|ipod/i) ||
24501
+ userAgent.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i));
24502
+ };
24503
+
24504
+ const helperModalCss = ":host{display:block}.HelperModalWrapper{position:fixed;left:0;top:0;width:100%;height:100%;background:rgba(0, 0, 0, 0.7);opacity:0;visibility:hidden;transform:scale(1.1);transition:visibility 0s linear 0.25s, opacity 0.25s 0s, transform 0.25s;z-index:1}.HelperModalVisible{opacity:1;visibility:visible;transform:scale(1);transition:visibility 0s linear 0s, opacity 0.25s 0s, transform 0.25s}.HelperModalContent{position:relative;border:solid 1px #848e97;box-shadow:2px 2px 2px rgba(0, 0, 0, 0.007);font-size:14px;padding:10px 10px 5px 10px;background-color:#fff;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);border-radius:4px;width:600px;max-height:600px;overflow-y:scroll}.HelperModalMobileContent{background:#FFF;top:50%;left:50%;transform:translate(-50%, -50%);border-radius:4px;width:80%;max-height:350px}.HelperModalClose{cursor:pointer;position:absolute;top:15px;right:15px;font-size:20px;color:#000}.HelperModalMobileClose{position:absolute;top:15px;right:15px;font-size:20px;color:#000}";
24505
+ const HelperModalStyle0 = helperModalCss;
24506
+
24507
+ const HelperModal = class {
24508
+ constructor(hostRef) {
24509
+ registerInstance(this, hostRef);
24510
+ this.cancel = createEvent(this, "modalCloseEvent", 7);
24511
+ this.userAgent = window.navigator.userAgent;
24512
+ this.setClientStyling = () => {
24513
+ let sheet = document.createElement('style');
24514
+ sheet.innerHTML = this.clientStyling;
24515
+ this.stylingContainer.prepend(sheet);
24516
+ };
24517
+ this.setClientStylingURL = () => {
24518
+ let cssFile = document.createElement('style');
24519
+ setTimeout(() => {
24520
+ cssFile.innerHTML = this.clientStylingUrlContent;
24521
+ this.stylingContainer.prepend(cssFile);
24522
+ }, 1);
24523
+ };
24524
+ this.titleModal = undefined;
24525
+ this.visible = true;
24526
+ this.clientStyling = '';
24527
+ this.clientStylingUrlContent = '';
24528
+ this.limitStylingAppends = false;
24529
+ }
24530
+ handleHelperModalClose() {
24531
+ this.visible = false;
24532
+ this.cancel.emit();
24533
+ }
24534
+ ;
24535
+ componentDidRender() {
24536
+ // start custom styling area
24537
+ if (!this.limitStylingAppends && this.stylingContainer) {
24538
+ if (this.clientStyling)
24539
+ this.setClientStyling();
24540
+ if (this.clientStylingUrlContent)
24541
+ this.setClientStylingURL();
24542
+ this.limitStylingAppends = true;
24543
+ }
24544
+ // end custom styling area
24545
+ }
24546
+ render() {
24547
+ return ((this.visible &&
24548
+ h$2("div", { key: 'ba2aed789565b37bfdbb34bdf3ccace827231653', class: this.visible ? "HelperModalWrapper HelperModalVisible" : "HelperModalWrapper", ref: el => this.stylingContainer = el }, h$2("div", { key: '151ca4cd80d259ac955b92b10bf6f0df2698a937', class: "HelperModalWrapper HelperModalVisible" }, h$2("div", { key: '804cb1dea73321c4935e4a8ddb1136e98e89a070', class: "HelperModalContent" + (isMobile$1(this.userAgent) ? ' HelperModalMobileContent' : '') }, h$2("span", { key: '30cf7928c1e4baa53f3514fc1930823db76c874c', class: "HelperModalClose" + (isMobile$1(this.userAgent) ? ' HelperModalMobileClose' : ''), onClick: this.handleHelperModalClose.bind(this) }, "X"), h$2("slot", { key: '5c1323a98cdcd09669020a00affe5673856e807e' }))))));
24549
+ }
24550
+ };
24551
+ HelperModal.style = HelperModalStyle0;
24552
+
24553
+ const helperTabCss = ":host{display:block}.TabContent{font-size:14px;color:#000;font-weight:normal}";
24554
+ const HelperTabStyle0 = helperTabCss;
24555
+
24556
+ const HelperTab = class {
24557
+ constructor(hostRef) {
24558
+ registerInstance(this, hostRef);
24559
+ this.setClientStyling = () => {
24560
+ let sheet = document.createElement('style');
24561
+ sheet.innerHTML = this.clientStyling;
24562
+ this.stylingContainer.prepend(sheet);
24563
+ };
24564
+ this.setClientStylingURL = () => {
24565
+ let cssFile = document.createElement('style');
24566
+ setTimeout(() => {
24567
+ cssFile.innerHTML = this.clientStylingUrlContent;
24568
+ this.stylingContainer.prepend(cssFile);
24569
+ }, 1);
24570
+ };
24571
+ this.selectedIndex = 0;
24572
+ this.cmsEndpoint = undefined;
24573
+ this.clientStyling = '';
24574
+ this.clientStylingUrlContent = '';
24575
+ this.tabContent = '';
24576
+ this.limitStylingAppends = false;
24577
+ }
24578
+ connectedCallback() {
24579
+ /**
24580
+ * fetch(cmsEndpoint + / + / + selectedIndex)
24581
+ */
24582
+ }
24583
+ componentDidRender() {
24584
+ // start custom styling area
24585
+ if (!this.limitStylingAppends && this.stylingContainer) {
24586
+ if (this.clientStyling)
24587
+ this.setClientStyling();
24588
+ if (this.clientStylingUrlContent)
24589
+ this.setClientStylingURL();
24590
+ this.limitStylingAppends = true;
24591
+ }
24592
+ // end custom styling area
24593
+ }
24594
+ render() {
24595
+ this.tabContent = h$2("div", { key: 'd69c61827b4fb6d934c72b0b2d37d72fca307575', class: "TabContent", ref: el => this.stylingContainer = el }, "Each play includes one set of numbers from 1 to 21 with a selectable number of 8 and a second, 4-digit set of numbers, with a minimum selection of 1. Draws are held every 5 minutes and the winnings are automatically credited to your account.");
24596
+ if (this.selectedIndex + 1 == 2) {
24597
+ this.tabContent = h$2("div", { key: 'ab912cbb3bc3e88ecf8fe5f8f0e7eb16460100bd', class: "TabContent", ref: el => this.stylingContainer = el }, h$2("ol", { key: '17bed41dffe7d5578452ee13a47b442d10366ce2' }, h$2("li", { key: 'cf0da42f07cf92f5cea9c9f504c8836e528a5708' }, "Register or Login"), h$2("li", { key: '4a0339df365c6b1a37b8a74c5022a56197e870db' }, "Buy tickets. Select 'Buy Tickets' to pick your numbers. Want us to automatically generate random numbers for you? Choose \u201CI feel lucky\u201D."), h$2("li", { key: '3f29a9b17c1059493648247868b83eb71241b8bd' }, "Review and Complete your purchase. Once you've chosen your total number of plays, and confirmed your number of selections, review your ticket details and complete your purchase!")));
24598
+ }
24599
+ else if (this.selectedIndex + 1 == 3) {
24600
+ this.tabContent = h$2("div", { key: 'ceac54698e0e5c55a049600f02e8f413a76a1c33', class: "TabContent", ref: el => this.stylingContainer = el }, h$2("ul", { key: '426d89c86a1d44f6d515bc1a7902e43317127939' }, h$2("li", { key: '457a225564399001dcab48097578174a27231ca7' }, "What are my odds of winning?"), h$2("li", { key: 'd35220f2aca215eff391cab54d719f18ef906c77' }, "How can I find out if I\u2019ve won a draw game?"), h$2("li", { key: 'fcd560ee4b6740c319cf0f98a0b98da8fd9e14a4' }, "How do I claim my prize?")));
24601
+ }
24602
+ return (this.tabContent);
24603
+ }
24604
+ };
24605
+ HelperTab.style = HelperTabStyle0;
24606
+
24607
+ const helperTabsCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.Tabs{display:flex;gap:10px;overflow-x:auto}.TabButton{cursor:pointer;width:auto;border-radius:4px;padding:8px 15px;margin:5px 0 10px;border:1px solid #009993;background:#FFF;color:#000;font-size:12px;transition:all 0.2s linear;text-align:center;letter-spacing:0;white-space:nowrap}.TabButton:hover{background:#F1F1F1}.TabButton.Active{background:#009993;color:#FFF}";
24608
+ const HelperTabsStyle0 = helperTabsCss;
24609
+
24610
+ const HelperTabs = class {
24611
+ constructor(hostRef) {
24612
+ registerInstance(this, hostRef);
24613
+ this.setClientStyling = () => {
24614
+ let sheet = document.createElement('style');
24615
+ sheet.innerHTML = this.clientStyling;
24616
+ this.stylingContainer.prepend(sheet);
24617
+ };
24618
+ this.setClientStylingURL = () => {
24619
+ let cssFile = document.createElement('style');
24620
+ setTimeout(() => {
24621
+ cssFile.innerHTML = this.clientStylingUrlContent;
24622
+ this.stylingContainer.prepend(cssFile);
24623
+ }, 1);
24624
+ };
24625
+ this.disabled = false;
24626
+ this.label = undefined;
24627
+ this.selected = false;
24628
+ this.cmsEndpoint = undefined;
24629
+ this.selectedIndex = 0;
24630
+ this.tabs = [{ label: 'How to Play' }, { label: 'About' }, { label: 'FAQs' }];
24631
+ this.clientStyling = '';
24632
+ this.clientStylingurl = '';
24633
+ this.clientStylingUrlContent = '';
24634
+ this.limitStylingAppends = false;
24635
+ }
24636
+ connectedCallback() {
24637
+ }
24638
+ componentDidRender() {
24639
+ // start custom styling area
24640
+ if (!this.limitStylingAppends && this.stylingContainer) {
24641
+ this.setClientStyling();
24642
+ if (this.clientStylingUrlContent) {
24643
+ this.setClientStylingURL();
24644
+ }
24645
+ this.limitStylingAppends = true;
24646
+ }
24647
+ // end custom styling area
24648
+ }
24649
+ render() {
24650
+ return (h$2("div", { key: '841b2a4b84f2ecdaf692b9cab2eac4b3413186e7', ref: el => this.stylingContainer = el }, h$2("div", { key: '4c5d57e669f9f45d204bff8a85ca89a0574c4627', class: "Tabs" }, this.tabs.map((tab, index) => h$2("button", { class: 'TabButton' + (this.selectedIndex == index ? ' Active' : ''), onClick: () => this.selectedIndex = index }, tab.label))), h$2("div", { key: '7ba983dec3b0355f390b19191d0d823914f09037' }, h$2("helper-tab", { key: 'e6c7739d50948582d8d14d530828508b4cb90d6e', selectedIndex: this.selectedIndex, "client-styling": this.clientStyling, "client-stylingurl": this.clientStylingurl, "client-styling-url-content": this.clientStylingUrlContent }))));
24651
+ }
24652
+ get host() { return getElement(this); }
24653
+ };
24654
+ HelperTabs.style = HelperTabsStyle0;
24655
+
24656
+ const lotteryBulletCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}@-webkit-keyframes Circle{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes Circle{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes hover-rotate{0%{-webkit-transform:scale(1) rotateZ(0);transform:scale(1) rotateZ(0)}50%{-webkit-transform:scale(1.2) rotateZ(180deg);transform:scale(1.22) rotateZ(180deg)}100%{-webkit-transform:scale(1) rotateZ(360deg);transform:scale(1) rotateZ(360deg)}}@keyframes hover-rotate{0%{-webkit-transform:scale(1) rotateZ(0);transform:scale(1) rotateZ(0)}50%{-webkit-transform:scale(1.2) rotateZ(180deg);transform:scale(1.2) rotateZ(180deg)}100%{-webkit-transform:scale(1) rotateZ(360deg);transform:scale(1) rotateZ(360deg)}}@-webkit-keyframes selected-scaleUp{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1.2);transform:scale(1.2)}}@keyframes selected-scaleUp{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}.Circle{-webkit-animation:Circle 0.8s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:Circle 0.8s cubic-bezier(0.39, 0.575, 0.565, 1) both;cursor:pointer;color:#000000;display:block;height:30px;width:30px;margin:0;display:flex;align-items:center;justify-content:center;justify-content:center;align-items:center;border:solid 2px #ffffff;background:radial-gradient(circle at top, rgb(255, 255, 255) 0%, rgb(255, 255, 255) 100%);font-weight:bold;border-radius:50%;box-shadow:0 2px 4px 0 rgba(0, 0, 0, 0.5);user-select:none;font-size:16px;line-height:16px;font-weight:600;position:relative}.Circle:hover{-webkit-animation:hover-rotate 0.4s linear both;animation:hover-rotate 0.4s linear both;background:radial-gradient(circle at top, rgb(255, 255, 255) 0%, rgb(241, 241, 241) 100%)}.Circle.Selected{-webkit-animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;color:#ffffff;background:#9EC258;background:-webkit-radial-gradient(top, #00958f, #004D4A);background:-moz-radial-gradient(top, #00958f, #004D4A);background:radial-gradient(to bottom, #00958f, #004D4A);border:solid 2px #00958f}.Circle.Disabled{-webkit-animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;color:#f1f1f1;background:#D4D4D4;border:solid 2px #D4D4D4;cursor:default}.Circle.DisabledSelected{-webkit-animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;color:#f1f1f1;background:#9EC258;background:-webkit-radial-gradient(top, #00958f, #004D4A);background:-moz-radial-gradient(top, #00958f, #004D4A);background:radial-gradient(to bottom, #00958f, #004D4A);border:solid 2px #D4D4D4;cursor:default}";
24657
+ const LotteryBulletStyle0 = lotteryBulletCss;
24658
+
24659
+ const LotteryBullet = class {
24660
+ constructor(hostRef) {
24661
+ registerInstance(this, hostRef);
24662
+ this.bulletEvent = createEvent(this, "lotteryBulletSelection", 7);
24663
+ this.select = () => {
24664
+ if (this.selectable) {
24665
+ this.isSelected = !this.isSelected;
24666
+ this.bulletEvent.emit({
24667
+ value: this.value,
24668
+ selected: this.isSelected
24669
+ });
24670
+ }
24671
+ };
24672
+ this.setClientStyling = () => {
24673
+ let sheet = document.createElement('style');
24674
+ sheet.innerHTML = this.clientStyling;
24675
+ this.stylingContainer.prepend(sheet);
24676
+ };
24677
+ this.setClientStylingURL = () => {
24678
+ let cssFile = document.createElement('style');
24679
+ setTimeout(() => {
24680
+ cssFile.innerHTML = this.clientStylingUrlContent;
24681
+ this.stylingContainer.prepend(cssFile);
24682
+ }, 1);
24683
+ };
24684
+ this.value = '0';
24685
+ this.selectable = true;
24686
+ this.isSelected = false;
24687
+ this.clientStyling = '';
24688
+ this.clientStylingUrlContent = '';
24689
+ this.limitStylingAppends = false;
24690
+ }
24691
+ componentDidRender() {
24692
+ // start custom styling area
24693
+ if (!this.limitStylingAppends && this.stylingContainer) {
24694
+ if (this.clientStyling)
24695
+ this.setClientStyling();
24696
+ if (this.clientStylingUrlContent)
24697
+ this.setClientStylingURL();
24698
+ this.limitStylingAppends = true;
24699
+ }
24700
+ // end custom styling area
24701
+ }
24702
+ render() {
24703
+ return (h$2("div", { key: 'af3601684ecf1f39d65fc9461430cba96b9e4b8c', class: 'Circle ' + (this.selectable ? '' : 'Disabled') + (this.isSelected ? 'Selected' : ''), onClick: () => this.select(), ref: el => this.stylingContainer = el }, this.value));
24704
+ }
24705
+ };
24706
+ LotteryBullet.style = LotteryBulletStyle0;
24707
+
24708
+ const DEFAULT_LANGUAGE$4 = 'en';
24709
+ const SUPPORTED_LANGUAGES$4 = ['ro', 'en', 'hr'];
24710
+ const TRANSLATIONS$4 = {
24711
+ en: {
24712
+ drawResultsHeader: 'Last draw results',
24713
+ drawId: 'Draw ID',
24714
+ drawName: 'Game name',
24715
+ drawDate: 'Draw Date',
24716
+ drawNumbersGridDraw: 'Draw numbers Grid ',
24717
+ drawNumbersGridTicket: 'Draw numbers Grid ',
24718
+ ticketResult: 'Ticket result',
24719
+ amountWon: 'Amount won',
24720
+ numberOfDraws: 'Number of draws',
24721
+ multiplier: 'Multiplier:',
24722
+ ticketPurchaseDate: 'Ticket Purchase Date',
24723
+ ticketStatus: 'Ticket Status',
24724
+ ticketId: 'Ticket ID',
24725
+ ticketAmount: 'Ticket Amount',
24726
+ winUpTo: 'Win up to',
24727
+ },
24728
+ ro: {
24729
+ drawResultsHeader: 'Ultimele rezultate extragere',
24730
+ drawId: 'Id extragere',
24731
+ drawName: 'Numele jocului',
24732
+ drawDate: 'Data extragerii',
24733
+ drawNumbersGridDraw: 'Numerele extrase Grid',
24734
+ drawNumbersGridTicket: 'Numerele extrase Grid',
24735
+ ticketResult: 'Rezultatul biletului',
24736
+ amountWon: 'Suma castigata',
24737
+ numberOfDraws: 'Numarul de extrageri',
24738
+ multiplier: 'Multiplicator:',
24739
+ ticketPurchaseDate: 'Data achizitionarii biletului',
24740
+ ticketStatus: 'Statusul biletului',
24741
+ ticketId: 'Id biletul',
24742
+ ticketAmount: 'Valoarea biletului',
24743
+ winUpTo: 'Poti castiga'
24744
+ },
24745
+ fr: {
24746
+ drawResultsHeader: 'Résultats du dernier tirage',
24747
+ drawId: 'ID de tirage',
24748
+ drawName: 'Nom du jeu',
24749
+ drawDate: 'Date du tirage',
24750
+ drawNumbersGridDraw: 'Tirage des numéros Grille',
24751
+ drawNumbersGridTicket: 'Tirage des numéros Grille',
24752
+ ticketResult: 'Résultat du ticket',
24753
+ amountWon: 'Montant gagné',
24754
+ numberOfDraws: 'Nombre de tirages',
24755
+ multiplier: 'Multiplicateur',
24756
+ ticketPurchaseDate: 'Date d\'achat du billet',
24757
+ ticketStatus: 'Statut du ticket',
24758
+ ticketId: 'ID de billets',
24759
+ ticketAmount: 'Montant du billet',
24760
+ winUpTo: 'Gagnez jusqu\'à'
24761
+ },
24762
+ ar: {
24763
+ drawResultsHeader: 'نتائج آخر سحب',
24764
+ drawId: 'معرّف السحب',
24765
+ drawName: 'اسم اللعبة',
24766
+ drawDate: 'تاريخ السحب',
24767
+ drawNumbersGridDraw: 'شبكة أرقام السحب',
24768
+ drawNumbersGridTicket: 'شبكة أرقام السحب',
24769
+ ticketResult: 'نتيجة التذكرة',
24770
+ amountWon: 'المبلغ الذي تم ربحه',
24771
+ numberOfDraws: 'عدد السحوبات',
24772
+ multiplier: 'مضاعف',
24773
+ ticketPurchaseDate: 'تاريخ شراء التذكرة',
24774
+ ticketStatus: 'حالة التذكرة',
24775
+ ticketId: 'معرّف التذكرة',
24776
+ ticketAmount: 'مبلغ التذكرة',
24777
+ winUpTo: 'ربح يصل إلى'
24778
+ },
24779
+ hr: {
24780
+ drawResultsHeader: 'Rezultati posljednjeg izvlačenja',
24781
+ drawId: 'ID izvlačenja',
24782
+ drawName: 'Naziv igre',
24783
+ drawDate: 'Datum izvlačenja',
24784
+ drawNumbersGridDraw: 'Tablica izvučenih brojeva',
24785
+ drawNumbersGridTicket: 'Tablica izvučenih brojeva',
24786
+ ticketResult: 'Rezultat listića',
24787
+ amountWon: 'Osvojeni iznos',
24788
+ numberOfDraws: 'Broj izvlačenja',
24789
+ multiplier: 'Multiplikator',
24790
+ ticketPurchaseDate: 'Datum uplate listića',
24791
+ ticketStatus: 'Status listića',
24792
+ ticketId: 'ID listića',
24793
+ ticketAmount: 'Iznos listića',
24794
+ winUpTo: 'Osvoji do'
24795
+ },
24796
+ };
24797
+ const translate$4 = (key, customLang) => {
24798
+ const lang = customLang;
24799
+ return TRANSLATIONS$4[lang !== undefined && SUPPORTED_LANGUAGES$4.includes(lang) ? lang : DEFAULT_LANGUAGE$4][key];
24800
+ };
24801
+
24802
+ 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}.DrawResultsArea.TicketDraws .Content{padding:0;border:0}.DrawResultsArea.TicketDraws .DrawResultsBody{padding:0;margin-bottom:5px;border-radius:0;border:0}.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}.DrawResultsBody{padding:20px;margin-bottom:5px;border-radius:0 0 4px 4px;border:1px solid #009993}.DrawResultsBody>div{margin:10px 0}.DrawResultsBody .NumberOfDrawsContainer{display:table;width:100%}.DrawNumbersGrid{display:flex;flex-direction:column;gap:5px}.DrawNumbersGrid label{display:block;margin-bottom:7px}.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{position:relative}.DrawTicketsContainer{display:flex;flex-direction:column;margin:20px auto 0}.DrawMultipler{margin-top:15px}.ExpandableBoxes{position:relative;display:flex;flex-direction:column;border:1px solid #ccc;border-radius:5px;background-color:white}.ExpandableBox{border-bottom:1px solid #ccc;transition:height 300ms ease-in-out;overflow:hidden;height:80px}.ExpandableBox:last-child{border-bottom:0}.ExpandableBoxHeader{position:relative;list-style:none;outline:0;cursor:pointer;text-transform:uppercase;transition:color 300ms ease-in-out;margin-bottom:24px;margin-left:5px}.ShowBox>.ExpandableBoxHeader{color:#009993}.ExpandableBoxHeader::-webkit-details-marker{display:none}.ExpandableBoxHeader:before,.ExpandableBoxHeader:after{content:\"\";position:absolute}.ExpandableBoxHeader:before{right:21px;top:50%;height:2px;margin-top:-1px;width:16px;background:#009993}.ExpandableBoxHeader:after{right:28px;top:50%;height:16px;margin-top:-8px;width:2px;margin-left:-1px;background:#009993;transition:all 300ms ease-in-out}.ShowBox .ExpandableBoxHeader:after{opacity:0;transform:translateY(25%)}.ExpandableBoxBody{padding-top:0;font-weight:lighter;margin-left:5px}.ExpandableBox.ShowBox{height:300px}";
24803
+ const LotteryDrawResultsStyle0 = lotteryDrawResultsCss;
24804
+
24805
+ const LotteryDrawResults = class {
24806
+ constructor(hostRef) {
24807
+ registerInstance(this, hostRef);
24808
+ this.ticketDrawDetails = [];
24809
+ this.ticketDrawDetailsFlag = true;
24810
+ this.setClientStyling = () => {
24811
+ let sheet = document.createElement('style');
24812
+ sheet.innerHTML = this.clientStyling;
24813
+ this.stylingContainer.prepend(sheet);
24814
+ };
24815
+ this.setClientStylingURL = () => {
24816
+ let cssFile = document.createElement('style');
24817
+ setTimeout(() => {
24818
+ cssFile.innerHTML = this.clientStylingUrlContent;
24819
+ this.stylingContainer.prepend(cssFile);
24820
+ }, 1);
24821
+ };
24822
+ this.endpoint = undefined;
24823
+ this.gameId = undefined;
24824
+ this.language = 'en';
24825
+ this.playerId = undefined;
24826
+ this.drawMode = false;
24827
+ this.drawId = '';
24828
+ this.gameName = '';
24829
+ this.ticketDate = '';
24830
+ this.ticketStatus = '';
24831
+ this.ticketId = '';
24832
+ this.ticketAmount = '';
24833
+ this.ticketMultiplier = false;
24834
+ this.ticketDrawCount = 0;
24835
+ this.ticketNumbers = '';
24836
+ this.sessionId = '';
24837
+ this.clientStyling = '';
24838
+ this.clientStylingUrlContent = '';
24839
+ this.ticketDrawData = '';
24840
+ this.multiplier = 3;
24841
+ this.isLoading = true;
24842
+ this.hasErrors = false;
24843
+ this.errorText = '';
24844
+ this.ticketData = [];
24845
+ this.ticketDataLoaded = false;
24846
+ this.ticketDraws = [];
24847
+ this.toggleDrawer = [false];
24848
+ this.limitStylingAppends = false;
24849
+ this.drawData = undefined;
24850
+ }
24851
+ connectedCallback() {
24852
+ let promises = [];
24853
+ // Split ticket numbers for each grid
24854
+ if (this.ticketNumbers) {
24855
+ this.gridNumbers = JSON.parse(this.ticketNumbers);
24856
+ }
24857
+ if (this.drawId) {
24858
+ promises.push(this.getDrawData());
24859
+ }
24860
+ Promise.all(promises)
24861
+ .then(() => {
24862
+ this.isLoading = false;
24863
+ }).catch((err) => {
24864
+ console.log('error ', err);
24865
+ this.isLoading = false;
24866
+ });
24867
+ }
24868
+ componentWillRender() {
24869
+ if (this.ticketDrawData && this.ticketDrawDetailsFlag) {
24870
+ this.ticketDrawDetails = JSON.parse(this.ticketDrawData);
24871
+ this.ticketDrawDetails.forEach((drawDetail) => {
24872
+ this.getDrawData(drawDetail.drawId).then((drawData) => drawDetail.drawData = drawData);
24873
+ });
24874
+ this.ticketDrawDetailsFlag = false;
24875
+ }
24876
+ }
24877
+ componentDidRender() {
24878
+ // start custom styling area
24879
+ if (!this.limitStylingAppends && this.stylingContainer) {
24880
+ if (this.clientStyling)
24881
+ this.setClientStyling();
24882
+ if (this.clientStylingUrlContent)
24883
+ this.setClientStylingURL();
24884
+ this.limitStylingAppends = true;
24885
+ }
24886
+ // end custom styling area
24887
+ }
24888
+ getDrawData(drawId) {
24889
+ this.isLoading = true;
24890
+ return new Promise((resolve, reject) => {
24891
+ let url = new URL(`${this.endpoint}/games/${this.gameId}/draws/${drawId ? drawId : this.drawId}`);
24892
+ fetch(url.href)
24893
+ .then((response) => {
24894
+ // @TODO EXCEPTIONS
24895
+ return response.json();
24896
+ })
24897
+ .then((data) => {
24898
+ if (drawId) {
24899
+ resolve(data);
24900
+ }
24901
+ else {
24902
+ this.drawData = data;
24903
+ resolve(true);
24904
+ }
24905
+ this.isLoading = false;
24906
+ })
24907
+ .catch((err) => {
24908
+ reject(err);
24909
+ this.isLoading = false;
24910
+ });
24911
+ });
24912
+ }
24913
+ drawerToggle(index) {
24914
+ this.toggleDrawer = this.toggleDrawer.map((item, itemIndex) => {
24915
+ if (itemIndex == index) {
24916
+ return !item;
24917
+ }
24918
+ return item;
24919
+ });
24920
+ if (index >= this.toggleDrawer.length) {
24921
+ this.toggleDrawer.push(true);
24922
+ }
24923
+ }
24924
+ render() {
24925
+ if (this.isLoading) {
24926
+ return (h$2("p", null, "Loading, please wait ..."));
24927
+ }
24928
+ else if (this.hasErrors) {
24929
+ h$2("p", null, this.errorText);
24930
+ }
24931
+ else {
24932
+ return (h$2("section", { class: "DrawResultsSection", ref: el => this.stylingContainer = el }, this.drawMode ?
24933
+ h$2("div", { class: "DrawResultsArea" }, this.drawData &&
24934
+ h$2("div", null, h$2("div", { class: "DrawResultsHeader" }, h$2("span", null, translate$4('drawId', this.language), ": ", this.drawData.id), h$2("span", null, translate$4('drawDate', this.language), ": ", this.drawData.date.slice(0, 10))), h$2("div", { class: "DrawResultsBody" }, h$2("div", { class: "DrawNumbersGrid" }, h$2("p", null, translate$4('drawNumbersGridDraw', this.language), "0:"), h$2("div", { class: "BulletContainer" }, h$2("lottery-grid", { "selected-numbers": this.drawData.winningNumbers.join(','), "display-selected": true, selectable: false, language: this.language, "grid-type": 'ticket', "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent })), h$2("div", { class: "DrawMultipler" }, h$2("label", { class: "Label" }, translate$4('multiplier', this.language), " ", this.multiplier))))))
24935
+ :
24936
+ h$2("div", { class: "DrawResultsArea TicketDraws" }, h$2("div", { class: "DrawResultsBody" }, h$2("div", { class: "TicketIdContainer" }, h$2("label", { class: "Label" }, translate$4('ticketId', this.language), ": ", h$2("span", null, this.ticketId))), h$2("div", { class: "TicketAmountContainer" }, h$2("label", { class: "Label" }, translate$4('ticketAmount', this.language), " ", h$2("span", null, this.ticketAmount))), h$2("div", { class: "DrawNumbersGrid" }, this.gridNumbers.map((grid, index) => h$2("div", null, h$2("label", { class: "Label" }, translate$4('drawNumbersGridTicket', this.language), " ", String.fromCharCode(index + 65), ":"), h$2("div", { class: "BulletContainer" }, h$2("lottery-grid", { "selected-numbers": grid.join(','), selectable: false, "display-selected": true, language: this.language, "grid-type": 'ticket', "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }))))), h$2("div", { class: "DrawMultipler" }, h$2("label", { class: "Label" }, translate$4('multiplier', this.language), " ", JSON.stringify(this.ticketMultiplier))), h$2("div", { class: "NumberOfDrawsContainer" }, h$2("label", { class: "Label" }, translate$4('numberOfDraws', this.language), ": ", this.ticketDrawCount), h$2("div", { class: "DrawTicketsContainer" }, this.ticketDrawDetails && this.ticketDrawDetails.length > 0 &&
24937
+ h$2("div", { class: "ExpandableBoxes" }, this.ticketDrawDetails.map((drawDetail, index) => {
24938
+ var _a, _b, _c, _d, _e;
24939
+ return h$2("div", { class: { 'ExpandableBox': true, 'ShowBox': this.toggleDrawer[index] }, onClick: () => this.drawerToggle(index) }, h$2("div", { class: "ExpandableBoxHeader" }, h$2("div", { class: "TicketResultContainer" }, h$2("p", null, translate$4('ticketResult', this.language), ": ", drawDetail.state)), drawDetail.state == 'won' &&
24940
+ h$2("div", { class: "AmountWonContainer" }, h$2("p", null, translate$4('amountWon', this.language), ": ", Number(drawDetail.amount).toLocaleString('en'), " ", drawDetail.currency)), drawDetail.state == 'lost' &&
24941
+ h$2("div", { class: "DrawIdContainer" }, h$2("p", null, translate$4('drawId', this.language), ": ", drawDetail.drawId))), h$2("div", { class: "ExpandableBoxBody" }, h$2("div", { class: "DrawIdContainer" }, h$2("p", null, translate$4('drawId', this.language), ": ", drawDetail.drawId)), h$2("div", { class: "DrawDateContainer" }, h$2("p", null, translate$4('drawDate', this.language), ": ", (_a = drawDetail.drawData) === null || _a === void 0 ? void 0 :
24942
+ _a.date.slice(0, 10), " | ", (_b = drawDetail.drawData) === null || _b === void 0 ? void 0 :
24943
+ _b.date.slice(11, 19))), h$2("div", { class: "DrawNumbersGrid" }, drawDetail.drawData &&
24944
+ h$2("div", { class: 'BulletContainer' }, h$2("label", { class: "Label" }, translate$4('drawNumbersGridDraw', this.language), " ", String.fromCharCode(index + 10), ":"), h$2("lottery-grid", { "selected-numbers": (_d = (_c = drawDetail.drawData) === null || _c === void 0 ? void 0 : _c.winningNumbers) === null || _d === void 0 ? void 0 : _d.join(','), selectable: false, "display-selected": true, language: this.language, "grid-type": 'ticket', "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }))), h$2("div", { class: "DrawMultipler" }, h$2("label", { class: "Label" }, translate$4('multiplier', this.language), " ", (_e = drawDetail.drawData) === null || _e === void 0 ? void 0 :
24945
+ _e.multiplier))));
24946
+ }))))))));
24947
+ }
24948
+ }
24949
+ };
24950
+ LotteryDrawResults.style = LotteryDrawResultsStyle0;
24951
+
24952
+ const DEFAULT_LANGUAGE$3 = 'en';
24953
+ const SUPPORTED_LANGUAGES$3 = ['ro', 'en', 'fr', 'ar', 'hr'];
24954
+ const TRANSLATIONS$3 = {
24955
+ en: {
24956
+ drawResultsHeader: 'Draw results history',
24957
+ drawId: 'Draw ID',
24958
+ drawDate: 'Draw Date',
24959
+ drawNumbersGridA: 'Draw numbers Grid A',
24960
+ viewAllResults: 'View All',
24961
+ lastFiveDraws: 'Last 5 Draws',
24962
+ lastTenDraws: 'Last 10 Draws',
24963
+ lastFifteenDraws: 'Last 15 Draws',
24964
+ allDrawResultsHistory: 'All Draw Results History',
24965
+ noResults: 'No results',
24966
+ fetchingResults: 'Fetching results'
24967
+ },
24968
+ ro: {
24969
+ drawResultsHeader: 'Istoricul extragerilor',
24970
+ drawId: 'ID-ul extragerii',
24971
+ drawDate: 'Data extragerii',
24972
+ drawNumbersGridA: 'Numerele extrase Grid A',
24973
+ viewAllResults: 'Vezi toate rezultatele',
24974
+ lastFiveDraws: 'Ultimile 5 extrageri',
24975
+ lastTenDraws: 'Ultimile 10 extrageri',
24976
+ lastFifteenDraws: 'Ultimile 15 extrageri',
24977
+ allDrawResultsHistory: 'Istoricul tuturor extragerilor',
24978
+ noResults: 'Niciun rezultat',
24979
+ fetchingResults: 'Se obtin rezultatele'
24980
+ },
24981
+ fr: {
24982
+ drawResultsHeader: 'Dessiner l\'historique des résultats',
24983
+ drawId: 'ID de tirage',
24984
+ drawDate: 'Date du tirage',
24985
+ drawNumbersGridA: 'Tirage des numéros Grille',
24986
+ viewAllResults: 'Voir tout',
24987
+ lastFiveDraws: '5 derniers tirages',
24988
+ lastTenDraws: '10 derniers tirages',
24989
+ lastFifteenDraws: '15 derniers tirages',
24990
+ allDrawResultsHistory: 'Historique des résultats de tous les tirages',
24991
+ noResults: 'Aucun résultat',
24992
+ fetchingResults: 'Récupération des résultats'
24993
+ },
24994
+ ar: {
24995
+ drawResultsHeader: 'سجل نتائج السحب',
24996
+ drawId: 'معرّف السحب',
24997
+ drawDate: 'تاريخ السحب',
24998
+ drawNumbersGridA: 'شبكة أرقام السحب',
24999
+ viewAllResults: 'عرض الكل',
25000
+ lastFiveDraws: 'آخر 5 سحوبات',
25001
+ lastTenDraws: 'آخر 10 سحوبات',
25002
+ lastFifteenDraws: 'آخر 15 سحبًا',
25003
+ allDrawResultsHistory: 'سجل نتائج كل السحوبات',
25004
+ noResults: 'لا توجد نتائج',
25005
+ fetchingResults: 'جلب النتائج'
25006
+ },
25007
+ hr: {
25008
+ drawResultsHeader: 'Povijest rezultata izvlačenja',
25009
+ drawId: 'ID izvlačenja',
25010
+ drawDate: 'Datum izvlačenja',
25011
+ drawNumbersGridA: 'Izvučeni brojevi tablica A',
25012
+ viewAllResults: 'Pogledaj sve',
25013
+ lastFiveDraws: 'Zadnjih 5 izvlačenja',
25014
+ lastTenDraws: 'Zadnjih 10 izvlačenja',
25015
+ lastFifteenDraws: 'Zadnjih 15 izvlačenja',
25016
+ allDrawResultsHistory: 'Povijest svih rezultata izvlačenja',
25017
+ noResults: 'Nema rezultata',
25018
+ fetchingResults: 'Dohvaćanje rezultata'
25019
+ },
25020
+ };
25021
+ const translate$3 = (key, customLang) => {
25022
+ const lang = customLang;
25023
+ return TRANSLATIONS$3[lang !== undefined && SUPPORTED_LANGUAGES$3.includes(lang) ? lang : DEFAULT_LANGUAGE$3][key];
25024
+ };
25025
+
25026
+ const lotteryDrawResultsHistoryCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.GridBanner{background-color:#009993;background-repeat:no-repeat;background-position:center;color:#111;padding:0 20px 30px}.GridBanner .BannerButtonsWrapper{display:flex;justify-content:space-between;padding-top:16px}.GridBanner .BannerButtonsWrapper .BannerBackButton,.GridBanner .BannerButtonsWrapper .BannerLobbyButton{background:#fff;border:1px solid #009993;border-radius:4px;padding:7px 15px;font-size:12px;text-transform:uppercase;width:80px;cursor:pointer}.GridBanner .HistoryGridBannerArea{padding-top:30px}.HistoryGridBannerArea{display:flex;flex-direction:column;align-items:center}.BannerText{font-size:14px;font-weight:300}.BannerCountdown{font-size:22px;display:flex;gap:20px}.DrawResultsSection{max-width:600px;margin:0px auto}.HistoryGrid{border-radius:5px}.DrawResultsHeader{color:#009993;padding:25px 0 10px 0;text-align:center;border-radius:4px 4px 0 0}.DrawResultsHeader h4{text-transform:uppercase;font-size:16px;font-weight:600;margin:0}.DrawNumbersGrid{padding:10px 50px}.DrawNumbersGrid p{margin:0 0 10px 0;font-size:14px}.BulletContainer{margin-bottom:20px}.DrawResultTop{background-color:#009993;padding:10px;text-align:center;color:#fff;padding:0 50px;display:flex;justify-content:center;gap:40px}.ViewAllResults{display:block;padding:10px 40px;margin:40px auto;border:0;border-radius:5px;background-color:#009993;color:#fff;outline:none}.FilterSection{display:flex;justify-content:space-between;padding:25px 15px 10px;gap:10px;margin:0px 15px}.FilterSection .FilterResultsContainer{display:flex;gap:5px;overflow-x:auto}.FilterSection .QuickFilterButton{cursor:pointer;width:max-content;border-radius:4px;border:1px solid #00958f;background:#FFF;color:#000;font-size:12px;transition:all 0.2s linear;text-align:center;letter-spacing:0}.FilterSection .QuickFilterButton:hover{background:#F1F1F1}.FilterSection helper-filters{margin-left:auto}";
25027
+ const LotteryDrawResultsHistoryStyle0 = lotteryDrawResultsHistoryCss;
25028
+
25029
+ const LotteryDrawResultsHistory = class {
25030
+ constructor(hostRef) {
25031
+ registerInstance(this, hostRef);
25032
+ this.getDrawsData = () => {
25033
+ let url = new URL(`${this.endpoint}/games/${this.gameId}/draws`);
25034
+ if (this.dateFiltersFrom)
25035
+ url.searchParams.append('from', this.dateFiltersFrom);
25036
+ if (this.dateFiltersTo)
25037
+ url.searchParams.append('to', this.dateFiltersTo);
25038
+ fetch(url.href)
25039
+ .then((res) => {
25040
+ if (res.status >= 300) {
25041
+ throw new Error('There was an error while fetching the data');
25042
+ }
25043
+ return res.json();
25044
+ })
25045
+ .then((data) => {
25046
+ this.winningDataSetsData = data.items.filter(draw => draw.winningNumbers);
25047
+ this.drawData = this.winningDataSetsData.map((item) => item);
25048
+ })
25049
+ .catch((err) => {
25050
+ console.log('err', err);
25051
+ })
25052
+ .finally(() => {
25053
+ this.isLoading = false;
25054
+ this.noResults = this.drawData.filter(draw => draw.winningNumbers).length == 0 ? true : false;
25055
+ });
25056
+ };
25057
+ this.filterResults = (resultsNumber) => {
25058
+ this.numberOfResults = resultsNumber;
25059
+ this.displayAllDrawsResults = true;
25060
+ };
25061
+ this.getDrawResults = (drawID) => {
25062
+ let url = new URL(`${this.endpoint}/games/${this.gameId}/draws/${drawID}`);
25063
+ let drawOptions = {
25064
+ method: "GET",
25065
+ headers: {
25066
+ 'Content-Type': "application/json",
25067
+ 'Accept': 'application/json',
25068
+ },
25069
+ };
25070
+ fetch(url.href, drawOptions)
25071
+ .then((response) => {
25072
+ if (response.status == 404)
25073
+ this.noResults = true;
25074
+ return response.json();
25075
+ })
25076
+ .then((data) => {
25077
+ this.drawData = [data].map((item) => item);
25078
+ })
25079
+ .catch((err) => {
25080
+ console.log('err', err);
25081
+ })
25082
+ .finally(() => {
25083
+ this.isLoading = false;
25084
+ });
25085
+ };
25086
+ this.viewAllResults = () => {
25087
+ this.numberOfResults = this.drawData.length;
25088
+ this.displayAllDrawsResults = false;
25089
+ window.scrollTo({ top: 0, behavior: 'smooth' });
25090
+ };
25091
+ this.setClientStyling = () => {
25092
+ let sheet = document.createElement('style');
25093
+ sheet.innerHTML = this.clientStyling;
25094
+ this.stylingContainer.prepend(sheet);
25095
+ };
25096
+ this.setClientStylingURL = () => {
25097
+ let cssFile = document.createElement('style');
25098
+ setTimeout(() => {
25099
+ cssFile.innerHTML = this.clientStylingUrlContent;
25100
+ this.stylingContainer.prepend(cssFile);
25101
+ }, 1);
25102
+ };
25103
+ this.endpoint = undefined;
25104
+ this.gameId = undefined;
25105
+ this.numberOfResults = 3;
25106
+ this.language = 'en';
25107
+ this.clientStyling = '';
25108
+ this.clientStylingUrlContent = '';
25109
+ this.drawData = [];
25110
+ this.winningDataSetsData = [''];
25111
+ this.displayAllDrawsResults = true;
25112
+ this.showQuickFilters = true;
25113
+ this.dateFiltersFrom = '';
25114
+ this.dateFiltersTo = '';
25115
+ this.isLoading = false;
25116
+ this.noResults = false;
25117
+ this.limitStylingAppends = false;
25118
+ }
25119
+ // Filters events
25120
+ // @Listen('filterDraw')
25121
+ // filtersDrawHandler(event: CustomEvent<any>):void {
25122
+ // this.isLoading = true;
25123
+ // this.showQuickFilters = false;
25124
+ // }
25125
+ filtersHandler(event) {
25126
+ this.showQuickFilters = false;
25127
+ this.isLoading = true;
25128
+ if (event.detail.ticketDrawId) {
25129
+ this.getDrawResults(event.detail.ticketDrawId);
25130
+ }
25131
+ else {
25132
+ this.dateFiltersFrom = event.detail.filterFromCalendar;
25133
+ this.dateFiltersTo = event.detail.filterToCalendar;
25134
+ this.getDrawsData();
25135
+ }
25136
+ }
25137
+ clearFiltersHandler() {
25138
+ this.showQuickFilters = true;
25139
+ this.dateFiltersFrom = '';
25140
+ this.dateFiltersTo = '';
25141
+ this.drawData = this.winningDataSetsData;
25142
+ this.isLoading = true;
25143
+ this.getDrawsData();
25144
+ }
25145
+ connectedCallback() {
25146
+ if (this.showQuickFilters)
25147
+ this.getDrawsData();
25148
+ }
25149
+ disconnectedCallback() {
25150
+ clearInterval(this.interval);
25151
+ }
25152
+ componentDidRender() {
25153
+ // start custom styling area
25154
+ if (!this.limitStylingAppends && this.stylingContainer) {
25155
+ if (this.clientStyling)
25156
+ this.setClientStyling();
25157
+ if (this.clientStylingUrlContent)
25158
+ this.setClientStylingURL();
25159
+ this.limitStylingAppends = true;
25160
+ }
25161
+ // end custom styling area
25162
+ }
25163
+ render() {
25164
+ let gridHeader = h$2("div", { key: '1583b694983132e116397e73c9552c95897c0353', class: "DrawResultsHeader" }, this.displayAllDrawsResults ? h$2("h4", null, translate$3('drawResultsHeader', this.language)) :
25165
+ [h$2("div", { class: "DrawResultsHeaderContent" }, h$2("h4", null, translate$3('allDrawResultsHistory', this.language)), h$2("div", { class: "FilterSection" }, this.showQuickFilters &&
25166
+ h$2("div", { class: "FilterResultsContainer" }, h$2("button", { class: "QuickFilterButton", onClick: () => this.filterResults(5) }, translate$3('lastFiveDraws', this.language)), h$2("button", { class: "QuickFilterButton", onClick: () => this.filterResults(10) }, translate$3('lastTenDraws', this.language)), h$2("button", { class: "QuickFilterButton", onClick: () => this.filterResults(15) }, translate$3('lastFifteenDraws', this.language))), h$2("helper-filters", { "show-filter-id": "true", "activate-ticket-search": "false", "game-id": this.gameId, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }))),
25167
+ ]);
25168
+ return h$2("section", { key: '4dc417fefb4d2ce1be3eaf7853a2d564ef554c38', class: "GridWrapper", ref: el => this.stylingContainer = el }, h$2("div", { key: '18c68785d3fa790b8e7e923dd986afa2ffc60a54', class: "DrawResultsSection" }, h$2("div", { key: '639d8f0c70aee9bb7d70b5bf6e7ee183aafb3c32', class: "DrawResultsAreaHistory" }, gridHeader, h$2("div", { key: '4e43f9d5acdbfceff15a84a51bd4c26f013f6781', class: "HistoryGridWrapper" }, h$2("div", { key: '344b9d8c9bbf87dde621eadec387c484b457671a', class: "HistoryGrid" }, this.isLoading &&
25169
+ h$2("p", { key: '5c0950a3c07c0e868861fd53a8a919168acca345' }, translate$3('fetchingResults', this.language)), !this.isLoading && !this.noResults && this.drawData.map((item) => h$2("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$2("p", { key: '9b9fccfe879e3b6f3663f1778c4f04dd8779a5c1' }, translate$3('noResults', this.language))))), this.displayAllDrawsResults && h$2("button", { key: '3af21758d6aad9c255d164c6ced7aebfc990fd0d', class: "ViewAllResults", onClick: this.viewAllResults }, translate$3('viewAllResults', this.language)))));
23382
25170
  }
23383
- }
23384
-
23385
- // Workaround https://github.com/vaadin/web-components/issues/2855
23386
- /** @protected */
23387
- _openedChanged(opened) {
23388
- super._openedChanged(opened);
25171
+ };
25172
+ LotteryDrawResultsHistory.style = LotteryDrawResultsHistoryStyle0;
25173
+
25174
+ const lotteryGameDetailsCss = ":host{display:block}";
25175
+ const LotteryGameDetailsStyle0 = lotteryGameDetailsCss;
25176
+
25177
+ const LotteryGameDetails = class {
25178
+ constructor(hostRef) {
25179
+ registerInstance(this, hostRef);
25180
+ this.setClientStyling = () => {
25181
+ let sheet = document.createElement('style');
25182
+ sheet.innerHTML = this.clientStyling;
25183
+ this.stylingContainer.prepend(sheet);
25184
+ };
25185
+ this.setClientStylingURL = () => {
25186
+ let cssFile = document.createElement('style');
25187
+ setTimeout(() => {
25188
+ cssFile.innerHTML = this.clientStylingUrlContent;
25189
+ this.stylingContainer.prepend(cssFile);
25190
+ }, 1);
25191
+ };
25192
+ this.clientStyling = '';
25193
+ this.clientStylingUrlContent = '';
25194
+ this.limitStylingAppends = false;
25195
+ }
25196
+ componentDidRender() {
25197
+ // start custom styling area
25198
+ if (!this.limitStylingAppends && this.stylingContainer) {
25199
+ if (this.clientStyling)
25200
+ this.setClientStyling();
25201
+ if (this.clientStylingUrlContent)
25202
+ this.setClientStylingURL();
25203
+ this.limitStylingAppends = true;
25204
+ }
25205
+ // end custom styling area
25206
+ }
25207
+ render() {
25208
+ return (h$2("div", { key: 'a972ed1a25317b0cdeb82e3b007ec79e30bbb871', class: "GamePageDetailsContainer", ref: el => this.stylingContainer = el }, h$2("helper-accordion", { key: '2c6f8d634241c412103cdae78909972c884b0515', "header-title": "Game Details", collapsed: false, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }, h$2("div", { key: 'f5f80e173d935cb0dabb6a7ef45e54a1312b5dc8', class: "AccordionContainer", slot: "accordionContent" }, h$2("helper-tabs", { key: 'a91396e0a4aa1235cc618dfe336ae8b603bc2a6c', "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent })))));
25209
+ }
25210
+ };
25211
+ LotteryGameDetails.style = LotteryGameDetailsStyle0;
25212
+
25213
+ const DEFAULT_LANGUAGE$2 = 'en';
25214
+ const SUPPORTED_LANGUAGES$2 = ['ro', 'en', 'fr', 'ar', 'hr'];
25215
+ const TRANSLATIONS$2 = {
25216
+ en: {
25217
+ error: 'Error',
25218
+ title: 'Chrono',
25219
+ backButton: 'Back',
25220
+ lobbyButton: 'Lobby',
25221
+ prize: 'Prize',
25222
+ winUpTo: 'Win up to',
25223
+ nextDraw: 'Next draw in: ',
25224
+ buy: 'Buy tickets',
25225
+ viewLatest: 'View latest results',
25226
+ createTicket: 'Create Ticket',
25227
+ modalSuccess: 'Purchase successfully completed!',
25228
+ deleteTicketModalTitle: 'Delete Ticket',
25229
+ deleteTicketModalText: 'Are you sure you want to delete this ticket?',
25230
+ deleteTicketModalCancel: 'Cancel',
25231
+ deleteTicketModalConfirm: 'Delete',
25232
+ orderSummaryTitle: 'Order Summary',
25233
+ orderSummaryTickets: 'Ticket',
25234
+ orderSummaryTotal: 'Total',
25235
+ orderSummarySubmit: 'Submit',
25236
+ lastDrawResultsTitle: 'Last Draw Results',
25237
+ modalLogin: 'Please login to submit a ticket',
25238
+ },
25239
+ ro: {
25240
+ error: 'Eroare',
25241
+ title: 'Loto 6/49',
25242
+ backButton: 'Inapoi',
25243
+ lobbyButton: 'Lobby',
25244
+ prize: 'MARELE JACKPOT OMG',
25245
+ winUpTo: 'Castiga pana la',
25246
+ nextDraw: 'Urmatoarea extragere:',
25247
+ buy: 'Cumpara bilet',
25248
+ viewLatest: 'Ultimile extrageri',
25249
+ createTicket: 'Creeaza bilet',
25250
+ modalSuccess: 'Achizitie efectuata cu succes',
25251
+ deleteTicketModalTitle: 'Sterge biletul',
25252
+ deleteTicketModalText: 'Esti sigur ca vrei sa stergi acest bilet?',
25253
+ deleteTicketModalCancel: 'Anuleaza',
25254
+ deleteTicketModalConfirm: 'Sterge',
25255
+ orderSummaryTitle: 'Rezumat comanda',
25256
+ orderSummaryTickets: 'Bilet',
25257
+ orderSummaryTotal: 'Total',
25258
+ orderSummarySubmit: 'Trimite',
25259
+ lastDrawResultsTitle: 'Cele mai recente extrageri',
25260
+ modalLogin: 'Please login to submit a ticket',
25261
+ },
25262
+ fr: {
25263
+ error: 'Error',
25264
+ title: 'Chrono',
25265
+ backButton: 'Back',
25266
+ lobbyButton: 'Lobby',
25267
+ prize: 'Prize',
25268
+ winUpTo: 'Win up to',
25269
+ nextDraw: 'Next draw in: ',
25270
+ buy: 'Buy tickets',
25271
+ viewLatest: 'View latest results',
25272
+ createTicket: 'Create Ticket',
25273
+ modalSuccess: 'Purchase successfully completed!',
25274
+ deleteTicketModalTitle: 'Delete Ticket',
25275
+ deleteTicketModalText: 'Are you sure you want to delete this ticket?',
25276
+ deleteTicketModalCancel: 'Cancel',
25277
+ deleteTicketModalConfirm: 'Delete',
25278
+ orderSummaryTitle: 'Order Summary',
25279
+ orderSummaryTickets: 'Ticket',
25280
+ orderSummaryTotal: 'Total',
25281
+ orderSummarySubmit: 'Submit',
25282
+ lastDrawResultsTitle: 'Résultats du dernier tirage',
25283
+ modalLogin: 'Please login to submit a ticket',
25284
+ },
25285
+ ar: {
25286
+ error: 'خطأ',
25287
+ title: 'كرونو',
25288
+ backButton: 'خلف',
25289
+ lobbyButton: 'ردهة',
25290
+ prize: 'جائزة',
25291
+ winUpTo: 'الفوز بما يصل الى',
25292
+ nextDraw: 'السحب التالي:',
25293
+ buy: 'اشتري تذاكر',
25294
+ viewLatest: 'عرض أحدث النتائج',
25295
+ createTicket: 'إنشاء تذكرة',
25296
+ modalSuccess: '!سيتم الشراء بنجاح قريبًا',
25297
+ deleteTicketModalTitle: 'حذف التذكرة',
25298
+ deleteTicketModalText: 'هل أنت متأكد أنك تريد حذف هذه التذكرة؟',
25299
+ deleteTicketModalCancel: 'يلغي',
25300
+ deleteTicketModalConfirm: 'حذف',
25301
+ orderSummaryTitle: 'ملخص الطلب',
25302
+ orderSummaryTickets: 'تذكرة',
25303
+ orderSummaryTotal: 'المجموع',
25304
+ orderSummarySubmit: 'يُقدِّم',
25305
+ lastDrawResultsTitle: 'نتائج آخر سحب',
25306
+ modalLogin: 'الرجاء تسجيل الدخول لتقديم تذكرة'
25307
+ },
25308
+ hr: {
25309
+ error: 'Greška',
25310
+ title: 'Krono',
25311
+ backButton: 'Nazad',
25312
+ lobbyButton: 'Lobby',
25313
+ prize: 'Nagrada',
25314
+ winUpTo: 'Osvoji do',
25315
+ nextDraw: 'Sljedeće izvlačenje za: ',
25316
+ buy: 'Uplati listić',
25317
+ viewLatest: 'Pogledajte najnovije rezultate',
25318
+ createTicket: 'Uplati listić',
25319
+ modalSuccess: 'Kupnja uspješno obavljena!',
25320
+ deleteTicketModalTitle: 'Izbriši listić',
25321
+ deleteTicketModalText: 'Are you sure you want to delete this ticket?',
25322
+ deleteTicketModalCancel: 'Otkaži',
25323
+ deleteTicketModalConfirm: 'Izbriši',
25324
+ orderSummaryTitle: 'Sažetak narudžbe',
25325
+ orderSummaryTickets: 'Listić',
25326
+ orderSummaryTotal: 'Ukupno',
25327
+ orderSummarySubmit: 'Podnijeti',
25328
+ lastDrawResultsTitle: 'Rezultati posljednjeg izvlačenja',
25329
+ modalLogin: 'Molimo prijavite se da uplatite listić',
25330
+ }
25331
+ };
25332
+ const translate$2 = (key, customLang) => {
25333
+ const lang = customLang;
25334
+ return TRANSLATIONS$2[lang !== undefined && SUPPORTED_LANGUAGES$2.includes(lang) ? lang : DEFAULT_LANGUAGE$2][key];
25335
+ };
23389
25336
 
23390
- this.$.overlay.positionTarget = this.shadowRoot.querySelector('[part="input-field"]');
23391
- this.$.overlay.noVerticalOverlap = true;
23392
- }
23393
- }
25337
+ /**
25338
+ * @name isMobile
25339
+ * @description A method that returns if the browser used to access the app is from a mobile device or not
25340
+ * @param {String} userAgent window.navigator.userAgent
25341
+ * @returns {Boolean} true or false
25342
+ */
25343
+ const isMobile = (userAgent) => {
25344
+ return !!(userAgent.toLowerCase().match(/android/i) ||
25345
+ userAgent.toLowerCase().match(/blackberry|bb/i) ||
25346
+ userAgent.toLowerCase().match(/iphone|ipad|ipod/i) ||
25347
+ userAgent.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i));
25348
+ };
23394
25349
 
23395
- defineCustomElement(DatePicker);
25350
+ const lotteryGamePageCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.GamePage .GridBanner{background-color:#009993;background-repeat:no-repeat;background-position:center;color:#111;padding:0 20px 10px;height:220px;display:flex;flex-direction:column;justify-content:space-between}.GamePage .GridBanner .BannerButtonsWrapper{display:flex;justify-content:space-between;padding-top:16px}.GamePage .GridBanner .BannerButtonsWrapper .BannerBackButton,.GamePage .GridBanner .BannerButtonsWrapper .BannerLobbyButton{background:#fff;border:1px solid #D4D4D4;border-radius:4px;padding:7px 15px;font-size:12px;text-transform:uppercase;width:80px;cursor:pointer}.GamePage .GridBanner .GridBannerArea{padding-top:30px;display:flex;flex-direction:column;align-items:center}.GamePage .TotalWinnings{color:#000;font-size:18px;display:flex;flex-direction:row;justify-content:center;align-items:center;gap:10px;text-transform:uppercase}.GamePage .TotalWinnings span{font-size:18px;font-weight:700}.GamePage .NextDraw{color:#00958f;font-size:24px;font-weight:600;margin:0 auto;text-align:center;text-transform:uppercase;display:flex;justify-content:center;align-items:center;flex-direction:column;gap:4px}.GamePage .NextDraw .BannerText{font-weight:400;font-size:18px;text-transform:uppercase;padding:0;margin:15px 0 0 0}.GamePage .NextDraw .BannerCountdown{font-size:22px;color:#00958f;display:flex;gap:20px}.GamePage .Tabs{display:flex;justify-content:center;gap:10px}.GamePage .Tabs .TabButton{border-radius:4px;cursor:pointer;padding:8px 0;width:50%;max-width:200px;border:1px solid #00958f;background:#00958f;color:#fff;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0}.GamePage .Tabs .TabButton.Active{color:#00958f;background:#F1F1F1;border:1px solid #F1F1F1}.LastDrawResultsTitle{color:#009993;padding:25px 0 10px 0;text-align:center;border-radius:4px;text-transform:uppercase;font-size:16px;font-weight:600;margin:0}.NextDrawWrapper{padding:10px 15px;background:#F1F1F1;background:linear-gradient(0deg, rgb(241, 241, 241) 0%, rgba(253, 187, 45, 0) 100%)}.NextDrawWrapper .BannerText{font-size:16px;font-weight:700;text-align:center}.NextDrawWrapper .BannerCountdown{font-size:22px;display:flex;gap:8px;color:#009993;font-weight:bolder;justify-content:center}.GamePageContent{padding:15px;max-width:1200px;margin:0 auto}.GameDetails{padding-bottom:10px;margin-bottom:20px}.CreateNewTicket{background:#004D4A;height:100px;width:100%;display:flex;margin-top:10px;flex-direction:column;justify-content:center;align-items:center}.CreateNewTicket button{cursor:pointer;display:inline-block;border-radius:50%;width:40px;height:40px;margin:5px;border:1px solid #FFF;background:#FFF;color:#004D4A;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0}.CreateNewTicket button:hover{background:#F1F1F1}.CreateNewTicket span{display:inline-block;font-size:12px;text-align:center;margin:0 auto;color:#FFF}.OrderSummary{min-width:200px;border-radius:4px;display:flex;flex-direction:column;justify-content:center;margin-top:20px;background:#fff}.OrderSummary .OrderSummaryTitle{font-size:16px;color:#009993;text-transform:uppercase;text-align:center}.OrderSummary .Ticket{display:inline-block;color:#000;font-size:14px;height:50px;line-height:50px;margin-left:15px}.OrderSummary .Ticket span{text-align:right}.OrderSummary hr{border:none;border-top:1px double #D4D4D4;color:#D4D4D4;width:100%}.OrderSummary .Total{display:inline-block;color:#000;font-size:14px;height:50px;line-height:50px;margin-left:15px}.OrderSummary .Total span{text-align:right}.ButtonWrapper{display:flex;align-items:center;justify-content:center}.ButtonWrapper .Button{cursor:pointer;border-radius:4px;padding:8px 60px;width:max-content;margin:5px;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0;background:#009993;border:1px solid #009993;color:#FFF}.ButtonWrapper .Button:hover{background:#00ABA4}.ButtonWrapper .Button.ButtonDisabled{pointer-events:none;background:#ccc;border:1px solid #ccc}.SubmitModalSuccess{text-align:center;font-size:18px;padding:20px}.DeleteTicketModalWrapper{padding:20px;text-align:center}.DeleteTicketModalWrapper .DeleteTicketModalTitle{font-size:16px;color:#00958f;font-weight:400;text-transform:uppercase;margin:20px 0 40px}.DeleteTicketModalWrapper .DeleteTicketModalText{font-size:14px;color:#000;line-height:22px;margin-bottom:40px}.DeleteTicketModalWrapper .DeleteTicketModalButtons{display:flex;gap:10px;justify-content:center}.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalConfirm{cursor:pointer;border-radius:4px;padding:8px 25px;width:max-content;margin:5px;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}.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalConfirm:hover{background:#FF6536;border:1px solid #FF3D00}.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalCancel{cursor:pointer;width:max-content;border-radius:4px;padding:10px 25px;margin:5px;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}.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalCancel:hover{background:#F1F1F1}@media (min-width: 1200px){.GamePageContent .TicketsWrapper{float:left;width:49%}.GamePageContent .GameDetails{float:right;width:49%}.GamePageContent .OrderSummary{float:right;width:49%}}";
25351
+ const LotteryGamePageStyle0 = lotteryGamePageCss;
25352
+
25353
+ const LotteryGamePage = class {
25354
+ constructor(hostRef) {
25355
+ registerInstance(this, hostRef);
25356
+ this.goBackEvent = createEvent(this, "goBackEvent", 7);
25357
+ this.goToLobbyEvent = createEvent(this, "goToLobbyEvent", 7);
25358
+ // @TODO fix any type
25359
+ this.userAgent = window.navigator.userAgent;
25360
+ this.multiplier = false;
25361
+ this.quickPick = false;
25362
+ this.isMobile = isMobile(this.userAgent);
25363
+ this.setClientStyling = () => {
25364
+ let sheet = document.createElement('style');
25365
+ sheet.innerHTML = this.clientStyling;
25366
+ this.stylingContainer.prepend(sheet);
25367
+ };
25368
+ this.setClientStylingURL = () => {
25369
+ let url = new URL(this.clientStylingurl);
25370
+ let cssFile = document.createElement('style');
25371
+ fetch(url.href)
25372
+ .then((res) => res.text())
25373
+ .then((data) => {
25374
+ this.clientStylingUrlContent = data;
25375
+ cssFile.innerHTML = data;
25376
+ setTimeout(() => { this.stylingContainer.prepend(cssFile); }, 1);
25377
+ })
25378
+ .catch((err) => {
25379
+ console.log('error ', err);
25380
+ });
25381
+ };
25382
+ this.endpoint = undefined;
25383
+ this.gameId = undefined;
25384
+ this.playerId = undefined;
25385
+ this.sessionId = undefined;
25386
+ this.language = 'en';
25387
+ this.backgroundUrl = undefined;
25388
+ this.autoPick = false;
25389
+ this.resetButton = false;
25390
+ this.clientStyling = '';
25391
+ this.clientStylingurl = '';
25392
+ this.clientStylingUrlContent = '';
25393
+ this.tickets = [];
25394
+ this.tabIndex = 0;
25395
+ this.hasErrors = false;
25396
+ this.totalAmount = 0;
25397
+ this.successVisible = false;
25398
+ this.deleteVisible = false;
25399
+ this.deleteEventData = undefined;
25400
+ this.daysRemaining = undefined;
25401
+ this.hoursRemaining = undefined;
25402
+ this.minutesRemaining = undefined;
25403
+ this.secondsRemaining = undefined;
25404
+ this.latestDraw = {};
25405
+ this.totalWinningsAmount = 0;
25406
+ this.nextDate = undefined;
25407
+ this.isLoggedIn = false;
25408
+ this.loginModalVisible = false;
25409
+ this.limitStylingAppends = false;
25410
+ }
25411
+ // @TODO fix `any` type later, I'm lazy now
25412
+ connectedCallback() {
25413
+ this.getGameDetails();
25414
+ this.getDraws();
25415
+ if (this.sessionId) {
25416
+ this.isLoggedIn = true;
25417
+ }
25418
+ }
25419
+ componentDidRender() {
25420
+ // start custom styling area
25421
+ if (!this.limitStylingAppends && this.stylingContainer) {
25422
+ if (this.clientStyling)
25423
+ this.setClientStyling();
25424
+ if (this.clientStylingurl)
25425
+ this.setClientStylingURL();
25426
+ this.limitStylingAppends = true;
25427
+ }
25428
+ // end custom styling area
25429
+ }
25430
+ countdownLogic(date) {
25431
+ this.interval = setInterval(() => {
25432
+ this.daysRemaining = Math.floor((Date.parse(date) - new Date().getTime()) / (1000 * 60 * 60 * 24));
25433
+ this.hoursRemaining = Math.floor((Date.parse(date) - new Date().getTime()) / (1000 * 60 * 60) - this.daysRemaining * 24);
25434
+ this.minutesRemaining = Math.floor((Date.parse(date) - new Date().getTime()) / (1000 * 60) - this.daysRemaining * 24 * 60 - this.hoursRemaining * 60);
25435
+ this.secondsRemaining = Math.floor((Date.parse(date) - new Date().getTime()) / 1000 - this.daysRemaining * 24 * 60 * 60 - this.hoursRemaining * 60 * 60 - this.minutesRemaining * 60);
25436
+ }, 1000);
25437
+ }
25438
+ disconnectedCallback() {
25439
+ clearInterval(this.interval);
25440
+ }
25441
+ getGameDetails() {
25442
+ let url = new URL(`${this.endpoint}/games/${this.gameId}`);
25443
+ fetch(url.href)
25444
+ .then((res) => {
25445
+ if (res.status >= 300) {
25446
+ this.hasErrors = true;
25447
+ throw new Error('There was an error while fetching the data');
25448
+ }
25449
+ return res.json();
25450
+ })
25451
+ .then((data) => {
25452
+ this.gameData = data;
25453
+ this.basicStake = this.gameData.type.stakes[0].amount;
25454
+ let draws = this.gameData.draws.filter((item) => !item.winningNumbers);
25455
+ draws.length > 0 && (this.nextDraw = draws[0].id);
25456
+ this.createNewTicket();
25457
+ })
25458
+ .catch((err) => {
25459
+ this.hasErrors = true;
25460
+ console.log('Error', err);
25461
+ });
25462
+ }
25463
+ calculateTotalAmount() {
25464
+ const { currency } = this.gameData.type.stakes[0];
25465
+ this.totalAmount = 0;
25466
+ this.tickets.forEach((item) => {
25467
+ if (item.completed) {
25468
+ this.totalAmount += item.amount * item.stake;
25469
+ }
25470
+ });
25471
+ this.currency = currency;
25472
+ }
25473
+ // @TODO CustomEvent type
25474
+ gridFilledHandler(event) {
25475
+ // @TODO item ts
25476
+ this.tickets = this.tickets.map((item) => {
25477
+ if (item.ticketId == event.detail.id) {
25478
+ let arr = item.selectedNumbers || [];
25479
+ arr[event.detail.index] = event.detail.selectedNumbers.map((item) => parseInt(item, 10));
25480
+ return {
25481
+ gameId: item.gameId,
25482
+ ticketId: item.ticketId,
25483
+ completed: true,
25484
+ amount: event.detail.draws,
25485
+ stake: item.stake,
25486
+ selectedNumbers: arr
25487
+ };
25488
+ }
25489
+ return item;
25490
+ });
25491
+ this.calculateTotalAmount();
25492
+ }
25493
+ // @TODO fix any type
25494
+ gridDirtyHandler(event) {
25495
+ // @TODO item ts
25496
+ this.tickets = this.tickets.map((item) => {
25497
+ if (item.gameId == event.detail.id) {
25498
+ return {
25499
+ gameId: item.gameId,
25500
+ ticketId: item.ticketId,
25501
+ completed: false,
25502
+ amount: item.amount,
25503
+ stake: item.stake,
25504
+ grids: []
25505
+ };
25506
+ }
25507
+ return item;
25508
+ });
25509
+ }
25510
+ // @TODO CustomEvent type
25511
+ deleteTicketHandler(event) {
25512
+ this.deleteVisible = true;
25513
+ this.deleteEventData = event;
25514
+ }
25515
+ modalCloseEvent() {
25516
+ this.deleteVisible = false;
25517
+ this.loginModalVisible = false;
25518
+ }
25519
+ stakeChangeHandler(event) {
25520
+ const { ticketId, stake } = event.detail;
25521
+ this.tickets[ticketId - 1].stake = stake;
25522
+ this.calculateTotalAmount();
25523
+ }
25524
+ multiplierChangeHandler(event) {
25525
+ this.multiplier = event.detail;
25526
+ }
25527
+ getDraws() {
25528
+ // append from query param with the current date value in order to get the next draw
25529
+ let url = new URL(`${this.endpoint}/games/${this.gameId}/draws`);
25530
+ let drawOptions = {
25531
+ method: "GET",
25532
+ headers: {
25533
+ 'Content-Type': "application/json",
25534
+ 'Accept': 'application/json',
25535
+ },
25536
+ };
25537
+ fetch(url.href, drawOptions)
25538
+ .then((response) => {
25539
+ return response.json();
25540
+ })
25541
+ .then((data) => {
25542
+ var _a;
25543
+ let upcoming = data.items.filter((item) => {
25544
+ if (Date.parse(item.date) > new Date().getTime()) {
25545
+ return !item.winningNumbers;
25546
+ }
25547
+ });
25548
+ let past = data.items.filter((item) => item.winningNumbers);
25549
+ if (!upcoming[0])
25550
+ return;
25551
+ this.latestDraw = upcoming[0];
25552
+ this.nextDate = this.latestDraw.date;
25553
+ this.countdownLogic(this.nextDate);
25554
+ this.lastDrawId = past[past.length - 1].id;
25555
+ // calculate total winnings
25556
+ // @TODO fix any type
25557
+ (_a = this.latestDraw) === null || _a === void 0 ? void 0 : _a.prizes.forEach((element) => {
25558
+ this.totalWinningsAmount += JSON.parse(element.amount);
25559
+ });
25560
+ })
25561
+ .catch((err) => {
25562
+ console.log('error ', err);
25563
+ });
25564
+ }
25565
+ ;
25566
+ // @TODO fix any type
25567
+ confirmDeleteTicketHandler(event) {
25568
+ // @TODO fix any type
25569
+ this.tickets = this.tickets.filter((item) => {
25570
+ if (item.ticketId == event.detail.ticketId) {
25571
+ return false;
25572
+ }
25573
+ return true;
25574
+ });
25575
+ this.calculateTotalAmount();
25576
+ this.deleteVisible = false;
25577
+ }
25578
+ createNewTicket() {
25579
+ this.tickets = [
25580
+ ...this.tickets,
25581
+ { gameId: this.gameId, ticketId: this.tickets.length + 1, completed: false, amount: 1, stake: this.basicStake, grids: [] }
25582
+ ];
25583
+ }
25584
+ showLoginModal() {
25585
+ this.loginModalVisible = true;
25586
+ }
25587
+ submitTickets() {
25588
+ let url = new URL(`${this.endpoint}/tickets`);
25589
+ // @TODO Body TS type
25590
+ let body = {
25591
+ gameId: this.gameId,
25592
+ tickets: []
25593
+ };
25594
+ this.tickets.forEach((item) => {
25595
+ body.tickets.push({
25596
+ startingDrawId: this.nextDraw,
25597
+ amount: item.stake,
25598
+ gameId: this.gameId,
25599
+ currency: this.currency,
25600
+ selection: item.selectedNumbers,
25601
+ multiplier: this.multiplier,
25602
+ drawCount: item.amount,
25603
+ quickPick: this.quickPick,
25604
+ });
25605
+ });
25606
+ // @TODO Options TS type
25607
+ let options = {
25608
+ method: 'POST',
25609
+ headers: {
25610
+ 'Content-Type': 'application/json',
25611
+ 'Accept': 'application/json',
25612
+ 'Authorization': `Bearer ${this.sessionId}`
25613
+ },
25614
+ body: JSON.stringify(body)
25615
+ };
25616
+ fetch(url.href, options)
25617
+ .then((res) => {
25618
+ if (res.status > 300) {
25619
+ throw new Error('err');
25620
+ }
25621
+ return res.json();
25622
+ })
25623
+ .then((data) => {
25624
+ // should we treat this res?
25625
+ console.log('data', data);
25626
+ })
25627
+ .catch((err) => {
25628
+ console.log('error ', err);
25629
+ });
25630
+ this.successVisible = true;
25631
+ }
25632
+ goBack() {
25633
+ this.goBackEvent.emit();
25634
+ }
25635
+ goToLobby() {
25636
+ this.goToLobbyEvent.emit();
25637
+ }
25638
+ render() {
25639
+ //Get path for background image
25640
+ const backgroundImagePath = getAssetPath(this.isMobile ? '/assets/chrono_lottery_mobile.png' : '/assets/chrono_desktop.png');
25641
+ if (this.hasErrors) {
25642
+ return (h$2("div", { class: "GamePage" }, h$2("div", { class: "Title" }, translate$2('error', this.language))));
25643
+ }
25644
+ return (
25645
+ /* Game details */
25646
+ h$2("div", { class: "GamePage", dir: this.language == 'ar' ? 'rtl' : 'ltr', ref: el => this.stylingContainer = el }, h$2("div", { class: "GridBanner", style: { 'background': `url(${this.backgroundUrl ? this.backgroundUrl : backgroundImagePath})`, 'background-size': 'contain', 'background-repeat': 'no-repeat', 'background-position': 'center' } }, h$2("div", { class: "BannerButtonsWrapper" }, h$2("button", { class: "BannerBackButton", onClick: this.goBack.bind(this) }, h$2("span", { class: "BannerBackButtonArrow" }, "\u1438 "), translate$2('backButton', this.language)), h$2("button", { class: "BannerLobbyButton", onClick: this.goToLobby.bind(this) }, translate$2('lobbyButton', this.language))), h$2("div", { class: "Tabs" }, h$2("div", { class: 'TabButton' + (this.tabIndex == 0 ? ' Active' : ''), onClick: () => this.tabIndex = 0 }, translate$2('buy', this.language)), h$2("div", { class: 'TabButton' + (this.tabIndex == 1 ? ' Active' : ''), onClick: () => this.tabIndex = 1 }, translate$2('viewLatest', this.language)))), h$2("div", { class: "NextDrawWrapper" }, h$2("div", { class: "TotalWinnings" }, translate$2('winUpTo', this.language), ": ", h$2("span", null, "$", this.totalWinningsAmount.toLocaleString('en-US', { maximumFractionDigits: 2 }))), h$2("div", { class: "NextDraw" }, h$2("p", { class: "BannerText" }, translate$2('nextDraw', this.language)), h$2("div", { class: "BannerCountdown" }, h$2("span", { class: "CountdownDays" }, this.daysRemaining, "D"), h$2("span", { class: "CountdownHours" }, this.hoursRemaining, "H"), h$2("span", { class: "CountdownMinutes" }, this.minutesRemaining, "M"), h$2("span", { class: "CountdownSeconds" }, this.secondsRemaining, "S")))), this.tabIndex == 0 &&
25647
+ h$2("div", { class: "GamePageContent" }, h$2("div", { class: "GameDetails" }, h$2("lottery-game-details", { "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent })), h$2("div", { class: "TicketsWrapper" }, this.tickets.map((item) => h$2("lottery-ticket-controller", { endpoint: this.endpoint, "ticket-id": item.ticketId, "game-id": item.gameId, collapsed: false, last: true, language: this.language, "auto-pick": this.autoPick, "reset-button": this.resetButton, "total-controllers": this.tickets.length, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent })), h$2("div", { class: "CreateNewTicket" }, h$2("button", { onClick: () => this.createNewTicket() }, "+"), h$2("span", null, translate$2('createTicket', this.language)))), h$2("div", { class: "OrderSummary" }, h$2("h3", { class: "OrderSummaryTitle" }, translate$2('orderSummaryTitle', this.language)), h$2("div", { class: "Ticket" }, translate$2('orderSummaryTickets', this.language), ": ", h$2("span", null, this.tickets.length)), h$2("hr", null), h$2("div", { class: "Total" }, translate$2('orderSummaryTotal', this.language), ": ", h$2("span", null, this.totalAmount, " ", this.currency)), h$2("div", { class: "ButtonWrapper" }, this.isLoggedIn &&
25648
+ h$2("span", { class: "Button", onClick: () => this.submitTickets() }, translate$2('orderSummarySubmit', this.language)), !this.isLoggedIn &&
25649
+ h$2("div", null, h$2("span", { class: "Button", onClick: () => this.showLoginModal() }, translate$2('orderSummarySubmit', this.language)), h$2("helper-modal", { "title-modal": "Success", visible: this.loginModalVisible, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }, h$2("p", { class: "SubmitModalSuccess" }, translate$2('modalLogin', this.language))))))), this.tabIndex == 1 &&
25650
+ h$2("div", null, h$2("h4", { class: "LastDrawResultsTitle" }, translate$2('lastDrawResultsTitle', this.language)), h$2("lottery-draw-results", { endpoint: this.endpoint, "game-id": this.gameId, language: this.language, "draw-id": this.lastDrawId, "draw-mode": true, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }), h$2("lottery-draw-results-history", { endpoint: this.endpoint, "game-id": this.gameId, language: this.language, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent })), h$2("helper-modal", { "title-modal": "Success", visible: this.successVisible, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }, h$2("p", { class: "SubmitModalSuccess" }, translate$2('modalSuccess', this.language))), h$2("helper-modal", { "title-modal": "Delete Ticket", visible: this.deleteVisible, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }, h$2("div", { class: "DeleteTicketModalWrapper" }, h$2("h3", { class: "DeleteTicketModalTitle" }, translate$2('deleteTicketModalTitle', this.language)), h$2("p", { class: "DeleteTicketModalText" }, translate$2('deleteTicketModalText', this.language)), h$2("div", { class: "DeleteTicketModalButtons" }, h$2("button", { class: "DeleteTicketModalCancel", onClick: () => this.modalCloseEvent() }, translate$2('deleteTicketModalCancel', this.language)), h$2("button", { class: "DeleteTicketModalConfirm", onClick: () => this.confirmDeleteTicketHandler(this.deleteEventData) }, translate$2('deleteTicketModalConfirm', this.language)))))));
25651
+ }
25652
+ static get assetsDirs() { return ["static"]; }
25653
+ get element() { return getElement(this); }
25654
+ };
25655
+ LotteryGamePage.style = LotteryGamePageStyle0;
25656
+
25657
+ const lotteryGridCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.GridContainer{display:flex;flex-direction:column;max-width:1200px}.Grid{margin-top:10px 0 10px 0;display:flex;flex-direction:row;flex-wrap:wrap;gap:20px}.Grid.TicketGrid{gap:5px}";
25658
+ const LotteryGridStyle0 = lotteryGridCss;
25659
+
25660
+ const LotteryGrid = class {
25661
+ constructor(hostRef) {
25662
+ registerInstance(this, hostRef);
25663
+ this.gridFilledEvent = createEvent(this, "gridFilled", 7);
25664
+ this.gridDirtyEvent = createEvent(this, "gridDirty", 7);
25665
+ this.selectedCounter = 0;
25666
+ this.setClientStyling = () => {
25667
+ let sheet = document.createElement('style');
25668
+ sheet.innerHTML = this.clientStyling;
25669
+ this.stylingContainer.prepend(sheet);
25670
+ };
25671
+ this.setClientStylingURL = () => {
25672
+ let cssFile = document.createElement('style');
25673
+ setTimeout(() => {
25674
+ cssFile.innerHTML = this.clientStylingUrlContent;
25675
+ this.stylingContainer.prepend(cssFile);
25676
+ }, 1);
25677
+ };
25678
+ this.ticketId = undefined;
25679
+ this.totalNumbers = 0;
25680
+ this.gameId = undefined;
25681
+ this.maximumAllowed = 0;
25682
+ this.minimumAllowed = 1;
25683
+ this.selectable = true;
25684
+ this.selectedNumbers = '';
25685
+ this.displaySelected = false;
25686
+ this.language = 'en';
25687
+ this.gridIndex = undefined;
25688
+ this.gridType = '';
25689
+ this.clientStyling = '';
25690
+ this.clientStylingUrlContent = '';
25691
+ this.numbers = [];
25692
+ this.limitStylingAppends = false;
25693
+ }
25694
+ connectedCallback() {
25695
+ let selected = [];
25696
+ if (this.selectedNumbers.length > 0) {
25697
+ selected = this.selectedNumbers.split(',');
25698
+ this.selectedCounter = selected.length;
25699
+ }
25700
+ if (this.displaySelected) {
25701
+ selected.forEach((item) => {
25702
+ this.numbers.push({
25703
+ number: item,
25704
+ selected: true,
25705
+ selectable: this.selectable
25706
+ });
25707
+ });
25708
+ }
25709
+ else {
25710
+ [...Array(this.totalNumbers).keys()]
25711
+ .map(number => (number + 1).toString())
25712
+ .forEach((number) => {
25713
+ this.numbers.push({
25714
+ number,
25715
+ selected: selected.indexOf(number) >= 0 ? true : false,
25716
+ selectable: this.selectedCounter == this.maximumAllowed ? false : this.selectable
25717
+ });
25718
+ });
25719
+ }
25720
+ }
25721
+ componentDidRender() {
25722
+ // start custom styling area
25723
+ if (!this.limitStylingAppends && this.stylingContainer) {
25724
+ if (this.clientStyling)
25725
+ this.setClientStyling();
25726
+ if (this.clientStylingUrlContent)
25727
+ this.setClientStylingURL();
25728
+ this.limitStylingAppends = true;
25729
+ }
25730
+ // end custom styling area
25731
+ }
25732
+ // wrote this because the classic .sort(() => 0.5 - Math.random()) method yielded low entropy shuffles for some reason on certain devices
25733
+ shuffleArray(array) {
25734
+ const result = [];
25735
+ while (array.length > 0) {
25736
+ const randomIndex = Math.floor(Math.random() * (array.length));
25737
+ result.push(array.splice(randomIndex, 1)[0]);
25738
+ }
25739
+ return result;
25740
+ }
25741
+ lotteryBulletSelectionHandler(event) {
25742
+ this.numbers = this.numbers.map((item) => {
25743
+ if (item.number == event.detail.value) {
25744
+ return {
25745
+ number: item.number,
25746
+ selected: event.detail.selected,
25747
+ selectable: item.selectable
25748
+ };
25749
+ }
25750
+ return {
25751
+ number: item.number,
25752
+ selected: item.selected,
25753
+ selectable: item.selectable
25754
+ };
25755
+ });
25756
+ if (event.detail.selected) {
25757
+ this.selectedCounter += 1;
25758
+ if (this.selectedCounter == this.maximumAllowed) {
25759
+ this.numbers = this.numbers.map((item) => {
25760
+ return {
25761
+ number: item.number,
25762
+ selected: item.selected,
25763
+ selectable: item.selected ? true : false
25764
+ };
25765
+ });
25766
+ this.gridFilledEvent.emit({
25767
+ id: this.ticketId,
25768
+ index: this.gridIndex,
25769
+ selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)
25770
+ });
25771
+ }
25772
+ }
25773
+ else {
25774
+ if (this.selectedCounter == this.maximumAllowed) {
25775
+ this.numbers = this.numbers.map((item) => {
25776
+ return {
25777
+ number: item.number,
25778
+ selected: item.selected,
25779
+ selectable: true
25780
+ };
25781
+ });
25782
+ this.gridDirtyEvent.emit({
25783
+ id: this.ticketId,
25784
+ index: this.gridIndex,
25785
+ selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)
25786
+ });
25787
+ }
25788
+ this.selectedCounter -= 1;
25789
+ }
25790
+ }
25791
+ async resetSelectionHandler(event) {
25792
+ if (event.detail && event.detail == this.ticketId) {
25793
+ this.selectedCounter = 0;
25794
+ this.numbers = this.numbers.map((item) => {
25795
+ return {
25796
+ number: item.number,
25797
+ selected: false,
25798
+ selectable: this.selectable
25799
+ };
25800
+ });
25801
+ this.gridDirtyEvent.emit({
25802
+ id: this.ticketId,
25803
+ index: this.gridIndex,
25804
+ selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)
25805
+ });
25806
+ }
25807
+ }
25808
+ async autoSelectionHandler(event) {
25809
+ if (event.detail && event.detail == this.ticketId) {
25810
+ this.resetSelectionHandler(event);
25811
+ let array = [...Array(this.totalNumbers).keys()]
25812
+ .map(number => number + 1);
25813
+ array = this.shuffleArray(array);
25814
+ array = array.slice(0, this.minimumAllowed);
25815
+ this.numbers = this.numbers.map((item) => {
25816
+ return {
25817
+ number: item.number,
25818
+ selected: array.indexOf(parseInt(item.number, 10)) >= 0 ? true : false,
25819
+ selectable: array.indexOf(parseInt(item.number, 10)) >= 0 ? true : false,
25820
+ };
25821
+ });
25822
+ this.gridFilledEvent.emit({
25823
+ id: this.ticketId,
25824
+ index: this.gridIndex,
25825
+ selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)
25826
+ });
25827
+ this.selectedCounter = this.maximumAllowed;
25828
+ }
25829
+ }
25830
+ render() {
25831
+ return (h$2("div", { key: '54b9187146b5d2625fd5ce7f53f38abf091cd943', class: "GridContainer", ref: el => this.stylingContainer = el }, h$2("div", { key: 'e7e8570557ebaa78edf881cdbc1ed720028cdf6e', class: this.gridType === 'ticket' ? 'Grid TicketGrid' : 'Grid' }, this.numbers.map((item) => h$2("div", null, h$2("lottery-bullet", { value: item.number, selectable: item.selectable, "is-selected": item.selected, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }))))));
25832
+ }
25833
+ };
25834
+ LotteryGrid.style = LotteryGridStyle0;
23396
25835
 
23397
- const helperFiltersCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.FilterButtonsWrapper{display:flex;justify-content:flex-end;gap:5px}.FilterButtonsWrapper .FilterOpen{cursor:pointer;border-radius:4px;padding:8px 15px;width:max-content;border:1px solid #00958f;background:#00958f;color:#FFF;font-size:12px;transition:all 0.2s linear;text-align:center;letter-spacing:0}.FilterButtonsWrapper .FilterOpen:hover{background:#00958f;color:#FFF}.FilterButtonsWrapper .FilterClear{cursor:pointer;border-radius:4px;padding:8px 15px;width:max-content;border:1px solid #00958f;background:#FFF;color:#000;font-size:12px;transition:all 0.2s linear;text-align:center;letter-spacing:0}.FilterButtonsWrapper .FilterClear:hover{background:#00958f;color:#FFF}.FilterModalHeader,.FilterModalBody,.FilterModalFooter{display:flex;flex-direction:column;gap:5px;align-items:center;margin:20px 0}.FilterModalHeader .FilterModalTitle,.FilterModalBody .FilterModalTitle,.FilterModalFooter .FilterModalTitle{margin:0;padding:0;font-weight:700;font-size:16px;color:#009993;text-transform:uppercase}.FilterModalHeader .FilterModalSearch,.FilterModalBody .FilterModalSearch,.FilterModalFooter .FilterModalSearch{border-radius:4px;background:#e8ebef;color:#263445;width:100%;height:26px;max-width:280px;padding:5px;font-size:15px;border:none;outline:#009993}.FilterModalHeader .FilterCalendarWrapper,.FilterModalBody .FilterCalendarWrapper,.FilterModalFooter .FilterCalendarWrapper{display:flex;gap:5px}.FilterModalHeader .FilterCalendarWrapper .VaadinDatePicker,.FilterModalBody .FilterCalendarWrapper .VaadinDatePicker,.FilterModalFooter .FilterCalendarWrapper .VaadinDatePicker{width:50%;max-width:143px}.FilterModalHeader .FilterModalButton,.FilterModalBody .FilterModalButton,.FilterModalFooter .FilterModalButton{cursor:pointer;border-radius:4px;padding:8px 60px;width:max-content;margin:5px;border:1px solid #00958f;background:#00958f;color:#FFF;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0}.FilterModalHeader .FilterModalButton:hover,.FilterModalBody .FilterModalButton:hover,.FilterModalFooter .FilterModalButton:hover{background:#00958f;color:#FFF}.FilterModalHeader p,.FilterModalBody p,.FilterModalFooter p{margin:5px 0}";
25836
+ const DEFAULT_LANGUAGE$1 = 'en';
25837
+ const SUPPORTED_LANGUAGES$1 = ['ro', 'en', 'hr'];
25838
+ const TRANSLATIONS$1 = {
25839
+ en: {
25840
+ loading: 'Loading, please wait ...',
25841
+ error: 'It was an error while trying to fetch the data',
25842
+ grid: 'Grid',
25843
+ multiplier: 'Multiplier',
25844
+ numberOfDraws: 'Number of draws',
25845
+ wagerPerDraw: 'Wager per draw',
25846
+ resetButton: 'Reset',
25847
+ autoButton: 'I feel lucky'
25848
+ },
25849
+ ro: {
25850
+ loading: 'Se incarca, va rugam asteptati ...',
25851
+ error: 'A fost o eroare in timp ce asteptam datele',
25852
+ grid: 'Grid',
25853
+ multiplier: 'Multiplicator',
25854
+ numberOfDraws: 'Numarul de extrageri',
25855
+ wagerPerDraw: 'Pariul per extragere',
25856
+ resetButton: 'Reseteaza',
25857
+ autoButton: 'Ma simt norocos'
25858
+ },
25859
+ fr: {
25860
+ loading: 'Loading, please wait ...',
25861
+ error: 'It was an error while trying to fetch the data',
25862
+ grid: 'Grid',
25863
+ multiplier: 'Multiplier',
25864
+ numberOfDraws: 'Number of draws',
25865
+ wagerPerDraw: 'Wager per draw',
25866
+ resetButton: 'Reset',
25867
+ autoButton: 'I feel lucky'
25868
+ },
25869
+ ar: {
25870
+ loading: 'Loading, please wait ...',
25871
+ error: 'It was an error while trying to fetch the data',
25872
+ grid: 'Grid',
25873
+ multiplier: 'Multiplier',
25874
+ numberOfDraws: 'Number of draws',
25875
+ wagerPerDraw: 'Wager per draw',
25876
+ resetButton: 'Reset',
25877
+ autoButton: 'I feel lucky'
25878
+ },
25879
+ hr: {
25880
+ loading: 'Učitavanje, molimo pričekajte ...',
25881
+ error: 'Došlo je do pogreške prilikom pokušaja dohvaćanja podataka',
25882
+ grid: 'Tablica',
25883
+ multiplier: 'Multiplikator',
25884
+ numberOfDraws: 'Broj izvlačenja',
25885
+ wagerPerDraw: 'Ulog po izvlačenju',
25886
+ resetButton: 'Resetiraj',
25887
+ autoButton: 'Osjećam se sretno'
25888
+ }
25889
+ };
25890
+ const translate$1 = (key, customLang) => {
25891
+ const lang = customLang;
25892
+ return TRANSLATIONS$1[lang !== undefined && SUPPORTED_LANGUAGES$1.includes(lang) ? lang : DEFAULT_LANGUAGE$1][key];
25893
+ };
23398
25894
 
23399
- const HelperFilters = class {
23400
- constructor(hostRef) {
23401
- registerInstance(this, hostRef);
23402
- this.filterDraw = createEvent(this, "filterDraw", 7);
23403
- this.filterSelection = createEvent(this, "filterSelection", 7);
23404
- this.filterSelectionReset = createEvent(this, "filterSelectionReset", 7);
23405
- /**
23406
- * Check if show the filter option by id
23407
- */
23408
- this.showFilterId = true;
23409
- /**
23410
- * Choose if filter by draw ID or ticket ID. By default is draw ID.
23411
- */
23412
- this.activateTicketSearch = false;
23413
- /**
23414
- * Game ID
23415
- */
23416
- this.gameId = '';
23417
- /**
23418
- * Player ID
23419
- */
23420
- this.playerId = '';
23421
- /**
23422
- * Session ID
23423
- */
23424
- this.session = '';
23425
- /**
23426
- * Instead of customEvents the widget triggers postMessages
23427
- */
23428
- this.postMessage = false;
23429
- /**
23430
- * Language
23431
- */
23432
- this.language = 'en';
23433
- /**
23434
- * Notifies if the quick filters from tickets are active
23435
- */
23436
- this.quickFiltersActive = false;
23437
- /**
23438
- * Client custom styling via string
23439
- */
23440
- this.clientStyling = '';
25895
+ 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}";
25896
+ const LotteryTicketStyle0 = lotteryTicketCss;
25897
+
25898
+ const LotteryTicket = class {
25899
+ constructor(hostRef) {
25900
+ registerInstance(this, hostRef);
25901
+ this.ticketCompleted = createEvent(this, "ticketCompleted", 7);
25902
+ this.autoSelection = createEvent(this, "autoSelection", 7);
25903
+ this.resetSelection = createEvent(this, "resetSelection", 7);
25904
+ this.stakeChange = createEvent(this, "stakeChange", 7);
25905
+ this.multiplierChange = createEvent(this, "multiplierChange", 7);
25906
+ this.setClientStyling = () => {
25907
+ let sheet = document.createElement('style');
25908
+ sheet.innerHTML = this.clientStyling;
25909
+ this.stylingContainer.prepend(sheet);
25910
+ };
25911
+ this.setClientStylingURL = () => {
25912
+ let cssFile = document.createElement('style');
25913
+ setTimeout(() => {
25914
+ cssFile.innerHTML = this.clientStylingUrlContent;
25915
+ this.stylingContainer.prepend(cssFile);
25916
+ }, 1);
25917
+ };
25918
+ this.endpoint = undefined;
25919
+ this.gameId = undefined;
25920
+ this.numberOfGrids = 1;
25921
+ this.multipleDraws = true;
25922
+ this.ticketId = undefined;
25923
+ this.resetButton = false;
25924
+ this.autoPick = false;
25925
+ this.language = 'en';
25926
+ this.clientStyling = '';
25927
+ this.clientStylingUrlContent = '';
25928
+ this.multiplier = false;
25929
+ this.numberOfDraws = 1;
25930
+ this.isLoading = true;
25931
+ this.hasErrors = false;
25932
+ this.ticketDone = false;
25933
+ this.isCustomSelect = false;
25934
+ this.amountInfo = {};
25935
+ this.limitStylingAppends = false;
25936
+ }
23441
25937
  /**
23442
- * Client custom styling via url content
25938
+ * @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
23443
25939
  */
23444
- this.clientStylingUrlContent = '';
23445
- this.showFilterModal = false;
23446
- this.showClearButton = false;
23447
- this.filterData = {};
23448
- this.filterDataReset = { ticketDrawId: '', filterFromCalendar: '', filterToCalendar: '' };
23449
- this.limitStylingAppends = false;
23450
- this.setClientStyling = () => {
23451
- let sheet = document.createElement('style');
23452
- sheet.innerHTML = this.clientStyling;
23453
- this.stylingContainer.prepend(sheet);
23454
- };
23455
- this.setClientStylingURL = () => {
23456
- let cssFile = document.createElement('style');
23457
- setTimeout(() => {
23458
- cssFile.innerHTML = this.clientStylingUrlContent;
23459
- this.stylingContainer.prepend(cssFile);
23460
- }, 1);
23461
- };
23462
- }
23463
- // reset field values each time the filter modal opens
23464
- componentDidRender() {
23465
- // @TODO: to way binding?
23466
- if (document.getElementById('#FilterById'))
23467
- document.getElementById('#FilterById').value = '';
23468
- // start custom styling area
23469
- if (!this.limitStylingAppends && this.stylingContainer) {
23470
- if (this.clientStyling)
23471
- this.setClientStyling();
23472
- if (this.clientStylingUrlContent)
23473
- this.setClientStylingURL();
23474
- this.limitStylingAppends = true;
23475
- }
23476
- // end custom styling area
23477
- }
23478
- filterSelectionHandler(event) {
23479
- if (this.postMessage)
23480
- window.postMessage({ type: 'filterSelection', event }, window.location.href);
23481
- if (this.filterData.ticketDrawId || this.filterData.filterFromCalendar || this.filterData.filterToCalendar)
23482
- this.filterSelection.emit(event);
23483
- }
23484
- filterSelectionResetHandler(event) {
23485
- if (this.postMessage)
23486
- window.postMessage({ type: 'filterSelectionReset', event }, window.location.href);
23487
- this.filterSelectionReset.emit(event);
23488
- }
23489
- modalCloseEvent() {
23490
- this.showFilterModal = false;
23491
- }
23492
- // Toggle filter modal
23493
- toggleFilterModal() {
23494
- this.showFilterModal = true;
23495
- }
23496
- // Filter search
23497
- filterSearch() {
23498
- this.modalCloseEvent();
23499
- this.showClearButton = true;
23500
- this.filterSelectionHandler(this.filterData);
23501
- console.log(this.showClearButton);
23502
- }
23503
- resetSearch() {
23504
- this.showClearButton = false;
23505
- this.filterSelectionResetHandler(this.filterDataReset);
23506
- this.filterData = {};
23507
- }
23508
- handleTicketDrawId(event) {
23509
- this.filterData.ticketDrawId = event.target.value;
23510
- }
23511
- handleFilterFrom(event) {
23512
- this.filterData.filterFromCalendar = new Date(event.target.value).toISOString();
23513
- }
23514
- handleFilterTo(event) {
23515
- this.filterData.filterToCalendar = new Date(event.target.value).toISOString();
23516
- }
23517
- render() {
23518
- return (h$2("div", { class: "HelperFilters", ref: el => this.stylingContainer = el }, h$2("div", { class: "FilterButtonsWrapper" }, h$2("button", { class: "FilterOpen", onClick: () => this.toggleFilterModal() }, translate$2('filterOpen', this.language)), console.log('in filter Open', this.showClearButton, this.quickFiltersActive), (this.showClearButton || this.quickFiltersActive) ?
23519
- h$2("button", { class: "FilterClear", onClick: () => this.resetSearch() }, translate$2('filterClear', this.language))
23520
- :
23521
- null), h$2("helper-modal", { "title-modal": "Filter Modal", visible: this.showFilterModal, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }, h$2("div", { class: "FilterModalHeader" }, h$2("h3", { class: "FilterModalTitle" }, this.activateTicketSearch ? translate$2('filterModalTicketTitle', this.language) : translate$2('filterModalDrawTitle', this.language))), h$2("div", { class: "FilterModalBody" }, h$2("input", { id: "FilterById", type: "text", value: this.filterData.ticketDrawId, onInput: (event) => this.handleTicketDrawId(event), class: "FilterModalSearch", placeholder: this.activateTicketSearch ? translate$2('filterTicketPlaceholder', this.language) : translate$2('filterDrawPlaceholder', this.language) }), h$2("p", null, translate$2('filterOrDate', this.language)), h$2("div", { class: "FilterCalendarWrapper" }, h$2("vaadin-date-picker", { value: this.filterData.filterFromCalendar, onChange: (event) => this.handleFilterFrom(event), placeholder: translate$2('filterFromCalendar', this.language), class: "VaadinDatePicker" }), h$2("vaadin-date-picker", { value: this.filterData.filterToCalendar, onChange: (event) => this.handleFilterTo(event), placeholder: translate$2('filterToCalendar', this.language), class: "VaadinDatePicker" }))), h$2("div", { class: "FilterModalFooter" }, h$2("button", { class: "FilterModalButton", onClick: () => this.filterSearch() }, translate$2('filterModalButton', this.language))))));
23522
- }
25940
+ checkForClickOutside(ev) {
25941
+ if (ev.composedPath()[0].getAttribute('data-cluster') !== 'SelectComponent') {
25942
+ this.isCustomSelect = false;
25943
+ }
25944
+ }
25945
+ connectedCallback() {
25946
+ let url = new URL(`${this.endpoint}/games/${this.gameId}`);
25947
+ fetch(url.href)
25948
+ .then((response) => {
25949
+ if (response.ok) {
25950
+ return response.json();
25951
+ }
25952
+ else {
25953
+ // Throw error
25954
+ this.hasErrors = true;
25955
+ }
25956
+ })
25957
+ .then((data) => {
25958
+ this.isLoading = false;
25959
+ this.gameData = data;
25960
+ this.grids = [...Array(this.gameData.type.boards.length).keys()];
25961
+ this.amountInfo = this.gameData.type.stakes[0]; // initial value for select
25962
+ })
25963
+ .catch((err) => {
25964
+ this.isLoading = false;
25965
+ this.hasErrors = true;
25966
+ console.error('Error!', err);
25967
+ });
25968
+ }
25969
+ componentDidRender() {
25970
+ // start custom styling area
25971
+ if (!this.limitStylingAppends && this.stylingContainer) {
25972
+ if (this.clientStyling)
25973
+ this.setClientStyling();
25974
+ if (this.clientStylingUrlContent)
25975
+ this.setClientStylingURL();
25976
+ this.limitStylingAppends = true;
25977
+ }
25978
+ // end custom styling area
25979
+ }
25980
+ multiplierChangeHandler(e) {
25981
+ this.multiplier = e.target ? e.target.checked : false;
25982
+ this.multiplierChange.emit(this.multiplier);
25983
+ }
25984
+ drawsChangeHandler(event) {
25985
+ this.ticket = Object.assign(Object.assign({}, this.ticket), { draws: event });
25986
+ this.ticketCompleted.emit(this.ticket);
25987
+ }
25988
+ gridFilledHandler(event) {
25989
+ this.ticket = Object.assign(Object.assign({}, event.detail), { draws: this.numberOfDraws });
25990
+ this.ticketDone = true;
25991
+ this.ticketCompleted.emit(this.ticket);
25992
+ }
25993
+ toggleAutoSelection() {
25994
+ this.ticketDone = true;
25995
+ this.autoSelection.emit(this.ticketId);
25996
+ }
25997
+ toggleResetSelection() {
25998
+ this.ticketDone = false;
25999
+ this.resetSelection.emit(this.ticketId);
26000
+ }
26001
+ changeStake(ticketid, amount) {
26002
+ this.stakeChange.emit({
26003
+ ticketId: ticketid,
26004
+ stake: amount
26005
+ });
26006
+ }
26007
+ toggleClass() {
26008
+ this.isCustomSelect = !this.isCustomSelect;
26009
+ }
26010
+ setDropdownItem(item) {
26011
+ this.amountInfo = {
26012
+ value: item.value,
26013
+ currency: item.currency
26014
+ };
26015
+ this.isCustomSelect = false;
26016
+ this.changeStake(this.ticketId, item.amount);
26017
+ }
26018
+ render() {
26019
+ if (this.isLoading) {
26020
+ return (h$2("div", null, h$2("p", null, translate$1('loading', this.language))));
26021
+ }
26022
+ else {
26023
+ if (this.hasErrors) {
26024
+ return (h$2("div", null, h$2("p", null, translate$1('error', this.language))));
26025
+ }
26026
+ else {
26027
+ const { type } = this.gameData;
26028
+ return (h$2("div", { class: "TicketContainer", ref: el => this.stylingContainer = el }, h$2("p", { class: "TicketTitle" }, this.gameData.name), this.resetButton && this.ticketDone &&
26029
+ h$2("div", { class: "ButtonContainer" }, h$2("a", { class: "ResetButton", onClick: () => this.toggleResetSelection() }, translate$1('resetButton', this.language))), this.autoPick && !this.ticketDone &&
26030
+ h$2("div", { class: "ButtonContainer" }, h$2("a", { class: "AutoButton", onClick: () => this.toggleAutoSelection() }, translate$1('autoButton', this.language))), this.grids.map((_, index) => h$2("div", { class: "TicketGridBullets" }, h$2("p", { class: "TicketGridTitle" }, translate$1('grid', this.language), " ", index + 1), h$2("lottery-grid", { "grid-index": index, "maximum-allowed": type.boards[index].maximumAllowed, "minimum-allowed": type.boards[index].minimumAllowed, "total-numbers": type.boards[index].highNumber - type.boards[index].lowNumber + 1, 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 }))), type.multiplier &&
26031
+ h$2("div", null, h$2("label", { class: "Toggle" }, h$2("label", { class: "Label" }, translate$1('multiplier', this.language), ": "), h$2("input", { class: "ToggleCheckbox", type: "checkbox", onInput: (e) => this.multiplierChangeHandler(e) }), h$2("div", { class: "ToggleSwitch" }))), this.multipleDraws &&
26032
+ h$2("div", { class: "TicketDraws" }, h$2("label", { class: "Label" }, translate$1('numberOfDraws', this.language), ": "), h$2("div", { class: "NumberInput" }, h$2("button", { onClick: () => this.numberOfDraws > 1 ? this.numberOfDraws-- : this.numberOfDraws = 1, class: "Minus" }, "-"), h$2("input", { class: "InputDefault", min: "1", value: this.numberOfDraws, type: "number" }), h$2("button", { onClick: () => this.numberOfDraws++, class: "Plus" }, "+"))), h$2("div", null, h$2("label", { class: "Label" }, translate$1('wagerPerDraw', this.language), ": "), h$2("div", { class: "WagerInput" }, type.stakes.length > 1 ?
26033
+ (h$2("div", { "data-cluster": "SelectComponent", class: this.isCustomSelect ? "SelectWrapper SelectActive" : "SelectWrapper" }, h$2("div", { "data-cluster": "SelectComponent", class: "SelectButton", onClick: () => this.toggleClass() }, h$2("span", { "data-cluster": "SelectComponent" }, this.amountInfo.value, " ", this.amountInfo.currency), h$2("span", { "data-cluster": "SelectComponent", class: "SelectExpand" }, "\u25BC")), h$2("div", { "data-cluster": "SelectComponent", class: "SelectContent" }, h$2("ul", { "data-cluster": "SelectComponent", class: "SelectOptions" }, type.stakes.map((item) => h$2("li", { "data-cluster": "SelectComponent", class: this.amountInfo.value == item.value ? 'SelectedValue' : '', value: item.value, onClick: () => this.setDropdownItem(item) }, item.value, " ", item.currency)))))) : (h$2("div", null, h$2("input", { min: "1", value: type.stakes[0].amount, type: "number", disabled: true }), h$2("p", { class: "WagerInputTitle" }, type.stakes[0].currency)))))));
26034
+ }
26035
+ }
26036
+ }
26037
+ static get watchers() { return {
26038
+ "numberOfDraws": ["drawsChangeHandler"]
26039
+ }; }
23523
26040
  };
23524
- HelperFilters.style = helperFiltersCss;
26041
+ LotteryTicket.style = LotteryTicketStyle0;
23525
26042
 
23526
26043
  const DEFAULT_LANGUAGE = 'en';
23527
- const SUPPORTED_LANGUAGES = ['ro', 'en', 'hr'];
26044
+ const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'ar', 'hr'];
23528
26045
  const TRANSLATIONS = {
23529
- en: {
23530
- drawResultsHeader: 'Last draw results',
23531
- drawId: 'Draw ID',
23532
- drawName: 'Game name',
23533
- drawDate: 'Draw Date',
23534
- drawNumbersGridDraw: 'Draw numbers Grid ',
23535
- drawNumbersGridTicket: 'Draw numbers Grid ',
23536
- ticketResult: 'Ticket result',
23537
- amountWon: 'Amount won',
23538
- numberOfDraws: 'Number of draws',
23539
- multiplier: 'Multiplier:',
23540
- ticketPurchaseDate: 'Ticket Purchase Date',
23541
- ticketStatus: 'Ticket Status',
23542
- ticketId: 'Ticket ID',
23543
- ticketAmount: 'Ticket Amount',
23544
- winUpTo: 'Win up to',
23545
- },
23546
- ro: {
23547
- drawResultsHeader: 'Ultimele rezultate extragere',
23548
- drawId: 'Id extragere',
23549
- drawName: 'Numele jocului',
23550
- drawDate: 'Data extragerii',
23551
- drawNumbersGridDraw: 'Numerele extrase Grid',
23552
- drawNumbersGridTicket: 'Numerele extrase Grid',
23553
- ticketResult: 'Rezultatul biletului',
23554
- amountWon: 'Suma castigata',
23555
- numberOfDraws: 'Numarul de extrageri',
23556
- multiplier: 'Multiplicator:',
23557
- ticketPurchaseDate: 'Data achizitionarii biletului',
23558
- ticketStatus: 'Statusul biletului',
23559
- ticketId: 'Id biletul',
23560
- ticketAmount: 'Valoarea biletului',
23561
- winUpTo: 'Poti castiga'
23562
- },
23563
- fr: {
23564
- drawResultsHeader: 'Résultats du dernier tirage',
23565
- drawId: 'ID de tirage',
23566
- drawName: 'Nom du jeu',
23567
- drawDate: 'Date du tirage',
23568
- drawNumbersGridDraw: 'Tirage des numéros Grille',
23569
- drawNumbersGridTicket: 'Tirage des numéros Grille',
23570
- ticketResult: 'Résultat du ticket',
23571
- amountWon: 'Montant gagné',
23572
- numberOfDraws: 'Nombre de tirages',
23573
- multiplier: 'Multiplicateur',
23574
- ticketPurchaseDate: 'Date d\'achat du billet',
23575
- ticketStatus: 'Statut du ticket',
23576
- ticketId: 'ID de billets',
23577
- ticketAmount: 'Montant du billet',
23578
- winUpTo: 'Gagnez jusqu\'à'
23579
- },
23580
- ar: {
23581
- drawResultsHeader: 'نتائج آخر سحب',
23582
- drawId: 'معرّف السحب',
23583
- drawName: 'اسم اللعبة',
23584
- drawDate: 'تاريخ السحب',
23585
- drawNumbersGridDraw: 'شبكة أرقام السحب',
23586
- drawNumbersGridTicket: 'شبكة أرقام السحب',
23587
- ticketResult: 'نتيجة التذكرة',
23588
- amountWon: 'المبلغ الذي تم ربحه',
23589
- numberOfDraws: 'عدد السحوبات',
23590
- multiplier: 'مضاعف',
23591
- ticketPurchaseDate: 'تاريخ شراء التذكرة',
23592
- ticketStatus: 'حالة التذكرة',
23593
- ticketId: 'معرّف التذكرة',
23594
- ticketAmount: 'مبلغ التذكرة',
23595
- winUpTo: 'ربح يصل إلى'
23596
- },
23597
- hr: {
23598
- drawResultsHeader: 'Rezultati posljednjeg izvlačenja',
23599
- drawId: 'ID izvlačenja',
23600
- drawName: 'Naziv igre',
23601
- drawDate: 'Datum izvlačenja',
23602
- drawNumbersGridDraw: 'Tablica izvučenih brojeva',
23603
- drawNumbersGridTicket: 'Tablica izvučenih brojeva',
23604
- ticketResult: 'Rezultat listića',
23605
- amountWon: 'Osvojeni iznos',
23606
- numberOfDraws: 'Broj izvlačenja',
23607
- multiplier: 'Multiplikator',
23608
- ticketPurchaseDate: 'Datum uplate listića',
23609
- ticketStatus: 'Status listića',
23610
- ticketId: 'ID listića',
23611
- ticketAmount: 'Iznos listića',
23612
- winUpTo: 'Osvoji do'
23613
- },
26046
+ en: {
26047
+ ticket: 'Ticket',
26048
+ },
26049
+ ro: {
26050
+ ticket: 'Bilet',
26051
+ },
26052
+ fr: {
26053
+ ticket: 'Billet'
26054
+ },
26055
+ ar: {
26056
+ ticket: 'تذكرة',
26057
+ },
26058
+ hr: {
26059
+ ticket: 'Listić',
26060
+ }
23614
26061
  };
23615
26062
  const translate = (key, customLang) => {
23616
- const lang = customLang;
23617
- return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
26063
+ const lang = customLang;
26064
+ return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
23618
26065
  };
23619
26066
 
23620
- 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}.DrawResultsArea.TicketDraws .Content{padding:0;border:0}.DrawResultsArea.TicketDraws .DrawResultsBody{padding:0;margin-bottom:5px;border-radius:0;border:0}.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}.DrawResultsBody{padding:20px;margin-bottom:5px;border-radius:0 0 4px 4px;border:1px solid #009993}.DrawResultsBody>div{margin:10px 0}.DrawResultsBody .NumberOfDrawsContainer{display:table;width:100%}.DrawNumbersGrid{display:flex;flex-direction:column;gap:5px}.DrawNumbersGrid label{display:block;margin-bottom:7px}.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{position:relative}.DrawTicketsContainer{display:flex;flex-direction:column;margin:20px auto 0}.DrawMultipler{margin-top:15px}.ExpandableBoxes{position:relative;display:flex;flex-direction:column;border:1px solid #ccc;border-radius:5px;background-color:white}.ExpandableBox{border-bottom:1px solid #ccc;transition:height 300ms ease-in-out;overflow:hidden;height:80px}.ExpandableBox:last-child{border-bottom:0}.ExpandableBoxHeader{position:relative;list-style:none;outline:0;cursor:pointer;text-transform:uppercase;transition:color 300ms ease-in-out;margin-bottom:24px;margin-left:5px}.ShowBox>.ExpandableBoxHeader{color:#009993}.ExpandableBoxHeader::-webkit-details-marker{display:none}.ExpandableBoxHeader:before,.ExpandableBoxHeader:after{content:\"\";position:absolute}.ExpandableBoxHeader:before{right:21px;top:50%;height:2px;margin-top:-1px;width:16px;background:#009993}.ExpandableBoxHeader:after{right:28px;top:50%;height:16px;margin-top:-8px;width:2px;margin-left:-1px;background:#009993;transition:all 300ms ease-in-out}.ShowBox .ExpandableBoxHeader:after{opacity:0;transform:translateY(25%)}.ExpandableBoxBody{padding-top:0;font-weight:lighter;margin-left:5px}.ExpandableBox.ShowBox{height:300px}";
23621
-
23622
- const LotteryDrawResults = class {
23623
- constructor(hostRef) {
23624
- registerInstance(this, hostRef);
23625
- /**
23626
- * Language of the widget
23627
- */
23628
- this.language = 'en';
23629
- /**
23630
- * Shows only the last draw
23631
- */
23632
- this.drawMode = false;
23633
- /**
23634
- * The drawID (option)
23635
- */
23636
- this.drawId = '';
23637
- /**
23638
- * The game name
23639
- */
23640
- this.gameName = '';
23641
- /**
23642
- * The ticket submission date
23643
- */
23644
- this.ticketDate = '';
23645
- /**
23646
- * The ticket status
23647
- */
23648
- this.ticketStatus = '';
23649
- /**
23650
- * The ticket id
23651
- */
23652
- this.ticketId = '';
23653
- /**
23654
- * The ticket amount
23655
- */
23656
- this.ticketAmount = '';
23657
- /**
23658
- * The ticket multiplier
23659
- */
23660
- this.ticketMultiplier = false;
23661
- /**
23662
- * The ticket draw count
23663
- */
23664
- this.ticketDrawCount = 0;
23665
- /**
23666
- * The ticket winning numbers
23667
- */
23668
- this.ticketNumbers = '';
23669
- /**
23670
- * The session id
23671
- */
23672
- this.sessionId = '';
23673
- /**
23674
- * Client custom styling via string
23675
- */
23676
- this.clientStyling = '';
23677
- /**
23678
- * Client custom styling via url content
23679
- */
23680
- this.clientStylingUrlContent = '';
23681
- /**
23682
- * Data showing the ticket's draw results details
23683
- */
23684
- this.ticketDrawData = '';
23685
- this.multiplier = 3;
23686
- this.isLoading = true;
23687
- this.hasErrors = false;
23688
- this.errorText = '';
23689
- this.ticketData = [];
23690
- this.ticketDataLoaded = false;
23691
- this.ticketDraws = [];
23692
- this.toggleDrawer = [false];
23693
- this.limitStylingAppends = false;
23694
- this.ticketDrawDetails = [];
23695
- this.ticketDrawDetailsFlag = true;
23696
- this.setClientStyling = () => {
23697
- let sheet = document.createElement('style');
23698
- sheet.innerHTML = this.clientStyling;
23699
- this.stylingContainer.prepend(sheet);
23700
- };
23701
- this.setClientStylingURL = () => {
23702
- let cssFile = document.createElement('style');
23703
- setTimeout(() => {
23704
- cssFile.innerHTML = this.clientStylingUrlContent;
23705
- this.stylingContainer.prepend(cssFile);
23706
- }, 1);
23707
- };
23708
- }
23709
- connectedCallback() {
23710
- let promises = [];
23711
- // Split ticket numbers for each grid
23712
- if (this.ticketNumbers) {
23713
- this.gridNumbers = JSON.parse(this.ticketNumbers);
23714
- }
23715
- if (this.drawId) {
23716
- promises.push(this.getDrawData());
23717
- }
23718
- Promise.all(promises)
23719
- .then(() => {
23720
- this.isLoading = false;
23721
- }).catch((err) => {
23722
- console.log('error ', err);
23723
- this.isLoading = false;
23724
- });
23725
- }
23726
- componentWillRender() {
23727
- if (this.ticketDrawData && this.ticketDrawDetailsFlag) {
23728
- this.ticketDrawDetails = JSON.parse(this.ticketDrawData);
23729
- this.ticketDrawDetails.forEach((drawDetail) => {
23730
- this.getDrawData(drawDetail.drawId).then((drawData) => drawDetail.drawData = drawData);
23731
- });
23732
- this.ticketDrawDetailsFlag = false;
23733
- }
23734
- }
23735
- componentDidRender() {
23736
- // start custom styling area
23737
- if (!this.limitStylingAppends && this.stylingContainer) {
23738
- if (this.clientStyling)
23739
- this.setClientStyling();
23740
- if (this.clientStylingUrlContent)
23741
- this.setClientStylingURL();
23742
- this.limitStylingAppends = true;
23743
- }
23744
- // end custom styling area
23745
- }
23746
- getDrawData(drawId) {
23747
- this.isLoading = true;
23748
- return new Promise((resolve, reject) => {
23749
- let url = new URL(`${this.endpoint}/games/${this.gameId}/draws/${drawId ? drawId : this.drawId}`);
23750
- fetch(url.href)
23751
- .then((response) => {
23752
- // @TODO EXCEPTIONS
23753
- return response.json();
23754
- })
23755
- .then((data) => {
23756
- if (drawId) {
23757
- resolve(data);
26067
+ const lotteryTicketControllerCss = ":host{font-family:\"Roboto\", system-ui, -apple-system, \"Segoe UI\", Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\";font-size:0.8rem}*,*::before,*::after{margin:0;padding:0;list-style:none;outline:none;box-sizing:border-box}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}.player-account-gaming-limits-popup-2{background:var(--emfe-w-color-black, #000000);color:var(--emfe-w-color-white, #000)}.Title{font-weight:800;font-size:18px}button{display:block;font-size:0.75rem;padding:12px 0;border:0;border-radius:2px;cursor:pointer}button.PrimaryButtonStyle{font-size:14px;color:#fff;background:rgb(122, 195, 23)}button.SecondaryButtonStyle{border:1px solid #999;color:#666;background:#fff}.LinkButton{display:inline;padding:0;color:#3366CC;text-decoration:underline;background-color:rgba(0, 0, 0, 0)}.ResultIconWrapper{display:flex;flex-direction:column;align-items:center;margin:12px 0}.ResultIconWrapper svg{height:auto;width:60px;margin:12px}.ResultIconWrapper p{color:#666}.Overlay{position:absolute;top:0;left:0;width:100vw;height:100vh;background-color:rgba(0, 0, 0, 0.5);display:flex;justify-content:center;align-items:center}.ModalContainer{position:fixed;top:30vh;width:320px;height:auto;padding:18px 14px;background:#fff;border-radius:4px}.InitialWrapper{display:flex;flex-direction:column;gap:12px}.AdditionalInformation{margin:10px 0;font-size:14px}.TermsConditions{font-size:12px}.ExpandButton{font-size:14px;background-color:#fff;border:0;padding:0;margin-top:-10px;color:#999;display:flex;justify-content:center;align-items:center;cursor:pointer}.ExpandButton svg{width:28px;height:auto;margin-left:-4px}.LeftAlign{text-align:left;font-size:16px}.CenterAlign{text-align:center}.SetLimitSection{display:flex;flex-direction:column;gap:6px}.DepositTextSection{display:flex;justify-content:space-between}.DepositInputSection{height:32px;display:flex;gap:4px}.DepositInput{flex-grow:1;padding:0 6px}.SubmitDepositButton{flex-grow:1;font-size:0.75rem;padding:0}.SubmitDepositButton[disabled]{align-items:center;color:#ccc;cursor:not-allowed;background:#fff;border:#ccc 1px solid}.Hidden{display:none}.Extended{transform:rotate(180deg)}";
26068
+ const LotteryTicketControllerStyle0 = lotteryTicketControllerCss;
26069
+
26070
+ const LotteryTicketController = class {
26071
+ constructor(hostRef) {
26072
+ registerInstance(this, hostRef);
26073
+ this.deleteTicketEvent = createEvent(this, "deleteTicket", 7);
26074
+ this.setClientStyling = () => {
26075
+ let sheet = document.createElement('style');
26076
+ sheet.innerHTML = this.clientStyling;
26077
+ this.stylingContainer.prepend(sheet);
26078
+ };
26079
+ this.setClientStylingURL = () => {
26080
+ let cssFile = document.createElement('style');
26081
+ setTimeout(() => {
26082
+ cssFile.innerHTML = this.clientStylingUrlContent;
26083
+ this.stylingContainer.prepend(cssFile);
26084
+ }, 1);
26085
+ };
26086
+ this.endpoint = '';
26087
+ this.ticketId = 1;
26088
+ this.ticketDescription = undefined;
26089
+ this.gameId = undefined;
26090
+ this.postMessage = false;
26091
+ this.eventName = 'deleteTicketAction';
26092
+ this.collapsed = true;
26093
+ this.numberOfGrids = 1;
26094
+ this.last = false;
26095
+ this.language = 'en';
26096
+ this.autoPick = false;
26097
+ this.resetButton = false;
26098
+ this.totalControllers = 1;
26099
+ this.clientStyling = '';
26100
+ this.clientStylingUrlContent = '';
26101
+ this.limitStylingAppends = false;
26102
+ }
26103
+ // @TODO fix the `any` type
26104
+ helperAccordionActionHandler() {
26105
+ if (this.postMessage) {
26106
+ window.postMessage({ type: this.eventName }, window.location.href);
23758
26107
  }
23759
- else {
23760
- this.drawData = data;
23761
- resolve(true);
26108
+ this.deleteTicketEvent.emit({
26109
+ ticketId: this.ticketId
26110
+ });
26111
+ }
26112
+ componentDidRender() {
26113
+ // start custom styling area
26114
+ if (!this.limitStylingAppends && this.stylingContainer) {
26115
+ if (this.clientStyling)
26116
+ this.setClientStyling();
26117
+ if (this.clientStylingUrlContent)
26118
+ this.setClientStylingURL();
26119
+ this.limitStylingAppends = true;
23762
26120
  }
23763
- this.isLoading = false;
23764
- })
23765
- .catch((err) => {
23766
- reject(err);
23767
- this.isLoading = false;
23768
- });
23769
- });
23770
- }
23771
- drawerToggle(index) {
23772
- this.toggleDrawer = this.toggleDrawer.map((item, itemIndex) => {
23773
- if (itemIndex == index) {
23774
- return !item;
23775
- }
23776
- return item;
23777
- });
23778
- if (index >= this.toggleDrawer.length) {
23779
- this.toggleDrawer.push(true);
26121
+ // end custom styling area
23780
26122
  }
23781
- }
23782
- render() {
23783
- if (this.isLoading) {
23784
- return (h$2("p", null, "Loading, please wait ..."));
23785
- }
23786
- else if (this.hasErrors) {
23787
- h$2("p", null, this.errorText);
23788
- }
23789
- else {
23790
- return (h$2("section", { class: "DrawResultsSection", ref: el => this.stylingContainer = el }, this.drawMode ?
23791
- h$2("div", { class: "DrawResultsArea" }, this.drawData &&
23792
- h$2("div", null, h$2("div", { class: "DrawResultsHeader" }, h$2("span", null, translate('drawId', this.language), ": ", this.drawData.id), h$2("span", null, translate('drawDate', this.language), ": ", this.drawData.date.slice(0, 10))), h$2("div", { class: "DrawResultsBody" }, h$2("div", { class: "DrawNumbersGrid" }, h$2("p", null, translate('drawNumbersGridDraw', this.language), "0:"), h$2("div", { class: "BulletContainer" }, h$2("lottery-grid", { "selected-numbers": this.drawData.winningNumbers.join(','), "display-selected": true, selectable: false, language: this.language, "grid-type": 'ticket', "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent })), h$2("div", { class: "DrawMultipler" }, h$2("label", { class: "Label" }, translate('multiplier', this.language), " ", this.multiplier))))))
23793
- :
23794
- h$2("div", { class: "DrawResultsArea TicketDraws" }, h$2("div", { class: "DrawResultsBody" }, h$2("div", { class: "TicketIdContainer" }, h$2("label", { class: "Label" }, translate('ticketId', this.language), ": ", h$2("span", null, this.ticketId))), h$2("div", { class: "TicketAmountContainer" }, h$2("label", { class: "Label" }, translate('ticketAmount', this.language), " ", h$2("span", null, this.ticketAmount))), h$2("div", { class: "DrawNumbersGrid" }, this.gridNumbers.map((grid, index) => h$2("div", null, h$2("label", { class: "Label" }, translate('drawNumbersGridTicket', this.language), " ", String.fromCharCode(index + 65), ":"), h$2("div", { class: "BulletContainer" }, h$2("lottery-grid", { "selected-numbers": grid.join(','), selectable: false, "display-selected": true, language: this.language, "grid-type": 'ticket', "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }))))), h$2("div", { class: "DrawMultipler" }, h$2("label", { class: "Label" }, translate('multiplier', this.language), " ", JSON.stringify(this.ticketMultiplier))), h$2("div", { class: "NumberOfDrawsContainer" }, h$2("label", { class: "Label" }, translate('numberOfDraws', this.language), ": ", this.ticketDrawCount), h$2("div", { class: "DrawTicketsContainer" }, this.ticketDrawDetails && this.ticketDrawDetails.length > 0 &&
23795
- h$2("div", { class: "ExpandableBoxes" }, this.ticketDrawDetails.map((drawDetail, index) => {
23796
- var _a, _b, _c, _d, _e;
23797
- return h$2("div", { class: { 'ExpandableBox': true, 'ShowBox': this.toggleDrawer[index] }, onClick: () => this.drawerToggle(index) }, h$2("div", { class: "ExpandableBoxHeader" }, h$2("div", { class: "TicketResultContainer" }, h$2("p", null, translate('ticketResult', this.language), ": ", drawDetail.state)), drawDetail.state == 'won' &&
23798
- h$2("div", { class: "AmountWonContainer" }, h$2("p", null, translate('amountWon', this.language), ": ", Number(drawDetail.amount).toLocaleString('en'), " ", drawDetail.currency)), drawDetail.state == 'lost' &&
23799
- h$2("div", { class: "DrawIdContainer" }, h$2("p", null, translate('drawId', this.language), ": ", drawDetail.drawId))), h$2("div", { class: "ExpandableBoxBody" }, h$2("div", { class: "DrawIdContainer" }, h$2("p", null, translate('drawId', this.language), ": ", drawDetail.drawId)), h$2("div", { class: "DrawDateContainer" }, h$2("p", null, translate('drawDate', this.language), ": ", (_a = drawDetail.drawData) === null || _a === void 0 ? void 0 :
23800
- _a.date.slice(0, 10), " | ", (_b = drawDetail.drawData) === null || _b === void 0 ? void 0 :
23801
- _b.date.slice(11, 19))), h$2("div", { class: "DrawNumbersGrid" }, drawDetail.drawData &&
23802
- h$2("div", { class: 'BulletContainer' }, h$2("label", { class: "Label" }, translate('drawNumbersGridDraw', this.language), " ", String.fromCharCode(index + 10), ":"), h$2("lottery-grid", { "selected-numbers": (_d = (_c = drawDetail.drawData) === null || _c === void 0 ? void 0 : _c.winningNumbers) === null || _d === void 0 ? void 0 : _d.join(','), selectable: false, "display-selected": true, language: this.language, "grid-type": 'ticket', "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }))), h$2("div", { class: "DrawMultipler" }, h$2("label", { class: "Label" }, translate('multiplier', this.language), " ", (_e = drawDetail.drawData) === null || _e === void 0 ? void 0 :
23803
- _e.multiplier))));
23804
- }))))))));
26123
+ render() {
26124
+ console.log('ticket id:', this.ticketId);
26125
+ return (h$2("div", { key: '203c89c4b240cd7c99eb3d37fa3a4dbc17ed18e3', class: "LotteryTicketControllerContainer", ref: el => this.stylingContainer = el }, h$2("helper-accordion", { key: 'ad9801b15a1718ff7470ab3084c4b569ad23f6e3', "header-title": `${translate('ticket', this.language)} ${this.ticketId}`, "header-subtitle": this.ticketDescription, footer: true, "delete-tab": this.totalControllers !== 1, collapsed: !this.last || this.collapsed, language: this.language, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }, h$2("div", { key: 'b9c618987e848d4b44fee6941f8b5c9696bd44e8', slot: "accordionContent" }, h$2("lottery-ticket", { key: '8acdc3d3cce5b654e7cddd71576c2e993881786f', endpoint: this.endpoint, "game-id": this.gameId, "ticket-id": this.ticketId, "number-of-grids": this.numberOfGrids, language: this.language, "reset-button": this.resetButton, "auto-pick": this.autoPick, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent })))));
23805
26126
  }
23806
- }
23807
26127
  };
23808
- LotteryDrawResults.style = lotteryDrawResultsCss;
23809
-
23810
- export { HelperFilters as helper_filters, LotteryDrawResults as lottery_draw_results };
26128
+ LotteryTicketController.style = LotteryTicketControllerStyle0;
23811
26129
 
23812
- //# sourceMappingURL=helper-filters_2.entry.js.map
26130
+ export { HelperAccordion as helper_accordion, HelperFilters as helper_filters, HelperModal as helper_modal, HelperTab as helper_tab, HelperTabs as helper_tabs, LotteryBullet as lottery_bullet, LotteryDrawResults as lottery_draw_results, LotteryDrawResultsHistory as lottery_draw_results_history, LotteryGameDetails as lottery_game_details, LotteryGamePage as lottery_game_page, LotteryGrid as lottery_grid, LotteryTicket as lottery_ticket, LotteryTicketController as lottery_ticket_controller };