@everymatrix/lottery-ticket-controller 1.44.0 → 1.45.2

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 (58) hide show
  1. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  2. package/dist/cjs/helper-accordion_5.cjs.entry.js +570 -697
  3. package/dist/cjs/index-2275f129.js +1304 -0
  4. package/dist/cjs/loader.cjs.js +7 -13
  5. package/dist/cjs/lottery-ticket-controller.cjs.js +17 -11
  6. package/dist/collection/collection-manifest.json +3 -3
  7. package/dist/collection/components/lottery-ticket-controller/index.js +1 -0
  8. package/dist/collection/components/lottery-ticket-controller/lottery-ticket-controller.css +1 -1
  9. package/dist/collection/components/lottery-ticket-controller/lottery-ticket-controller.js +371 -399
  10. package/dist/collection/utils/locale.utils.js +17 -17
  11. package/dist/collection/utils/utils.js +1 -1
  12. package/dist/esm/app-globals-0f993ce5.js +3 -0
  13. package/dist/esm/helper-accordion_5.entry.js +570 -697
  14. package/dist/esm/index-cf1a7f99.js +1277 -0
  15. package/dist/esm/loader.js +7 -13
  16. package/dist/esm/lottery-ticket-controller.js +14 -11
  17. package/dist/lottery-ticket-controller/lottery-ticket-controller.esm.js +1 -1
  18. package/dist/lottery-ticket-controller/p-5d5cd019.entry.js +1 -0
  19. package/dist/lottery-ticket-controller/p-e1255160.js +1 -0
  20. package/dist/lottery-ticket-controller/p-ee226061.js +2 -0
  21. package/dist/stencil.config.dev.js +17 -0
  22. package/dist/stencil.config.js +14 -19
  23. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/lottery-ticket-controller/.stencil/packages/stencil/lottery-ticket-controller/stencil.config.d.ts +2 -0
  24. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/lottery-ticket-controller/.stencil/packages/stencil/lottery-ticket-controller/stencil.config.dev.d.ts +2 -0
  25. package/dist/types/components/lottery-ticket-controller/index.d.ts +1 -0
  26. package/dist/types/components/lottery-ticket-controller/lottery-ticket-controller.d.ts +70 -70
  27. package/dist/types/components.d.ts +16 -1
  28. package/dist/types/stencil-public-runtime.d.ts +142 -33
  29. package/loader/cdn.js +1 -3
  30. package/loader/index.cjs.js +1 -3
  31. package/loader/index.d.ts +13 -1
  32. package/loader/index.es2017.js +1 -3
  33. package/loader/index.js +1 -3
  34. package/loader/package.json +1 -0
  35. package/package.json +10 -3
  36. package/dist/cjs/index-797fecd9.js +0 -1286
  37. package/dist/components/helper-accordion.js +0 -6
  38. package/dist/components/helper-accordion2.js +0 -158
  39. package/dist/components/index.d.ts +0 -26
  40. package/dist/components/index.js +0 -1
  41. package/dist/components/lottery-bullet.js +0 -6
  42. package/dist/components/lottery-bullet2.js +0 -91
  43. package/dist/components/lottery-grid.js +0 -6
  44. package/dist/components/lottery-grid2.js +0 -245
  45. package/dist/components/lottery-ticket-controller.d.ts +0 -11
  46. package/dist/components/lottery-ticket-controller.js +0 -185
  47. package/dist/components/lottery-ticket.js +0 -6
  48. package/dist/components/lottery-ticket2.js +0 -273
  49. package/dist/esm/index-c4bda097.js +0 -1260
  50. package/dist/esm/polyfills/core-js.js +0 -11
  51. package/dist/esm/polyfills/css-shim.js +0 -1
  52. package/dist/esm/polyfills/dom.js +0 -79
  53. package/dist/esm/polyfills/es5-html-element.js +0 -1
  54. package/dist/esm/polyfills/index.js +0 -34
  55. package/dist/esm/polyfills/system.js +0 -6
  56. package/dist/lottery-ticket-controller/p-1f81b6df.js +0 -1
  57. package/dist/lottery-ticket-controller/p-2577bcb1.entry.js +0 -1
  58. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/lottery-ticket-controller/.stencil/packages/lottery-ticket-controller/stencil.config.d.ts +0 -2
@@ -1,746 +1,619 @@
1
- import { r as registerInstance, c as createEvent, h } from './index-c4bda097.js';
1
+ import { r as registerInstance, c as createEvent, h } from './index-cf1a7f99.js';
2
2
 
3
3
  const DEFAULT_LANGUAGE$2 = 'en';
4
4
  const TRANSLATIONS$2 = {
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
- }
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
+ }
20
20
  };
21
21
  const translate$2 = (key, customLang) => {
22
- const lang = customLang;
23
- return TRANSLATIONS$2[(lang !== undefined) && (lang in TRANSLATIONS$2) ? lang : DEFAULT_LANGUAGE$2][key];
22
+ const lang = customLang;
23
+ return TRANSLATIONS$2[(lang !== undefined) && (lang in TRANSLATIONS$2) ? lang : DEFAULT_LANGUAGE$2][key];
24
24
  };
25
25
 
26
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;
27
28
 
28
- const Accordion = class {
29
- constructor(hostRef) {
30
- registerInstance(this, hostRef);
31
- this.accordionEvent = createEvent(this, "helperAccordionAction", 7);
32
- /**
33
- * Flag for ticket history
34
- */
35
- this.ticketHistoryFlag = false;
36
- /**
37
- * Title (top header)
38
- */
39
- this.headerTitle = '';
40
- /**
41
- * SubTitle (top header)
42
- */
43
- this.headerSubtitle = '';
44
- /**
45
- * Description
46
- */
47
- this.description = '';
48
- /**
49
- * Enables footer content
50
- */
51
- this.footer = false;
52
- /**
53
- * Enables footer button for tab deletion
54
- */
55
- this.deleteTab = false;
56
- /**
57
- * Activates postMessages as events for actions from the widget
58
- */
59
- this.postMessage = false;
60
- /**
61
- * Name of the event emitter by the action button
62
- */
63
- this.eventName = 'helperAccordionAction';
64
- /**
65
- * Collapsed
66
- */
67
- this.collapsed = true;
68
- /**
69
- * Language
70
- */
71
- this.language = 'en';
72
- /**
73
- * Client custom styling via string
74
- */
75
- this.clientStyling = '';
76
- /**
77
- * Client custom styling via url content
78
- */
79
- this.clientStylingUrlContent = '';
80
- this.limitStylingAppends = false;
81
- this.setClientStyling = () => {
82
- let sheet = document.createElement('style');
83
- sheet.innerHTML = this.clientStyling;
84
- this.stylingContainer.prepend(sheet);
85
- };
86
- this.setClientStylingURL = () => {
87
- let cssFile = document.createElement('style');
88
- setTimeout(() => {
89
- cssFile.innerHTML = this.clientStylingUrlContent;
90
- this.stylingContainer.prepend(cssFile);
91
- }, 1);
92
- };
93
- }
94
- // @TODO fix the `any` type :)
95
- connectedCallback() {
96
- this.showContent = !this.collapsed;
97
- }
98
- componentDidRender() {
99
- // start custom styling area
100
- if (!this.limitStylingAppends && this.stylingContainer) {
101
- if (this.clientStyling)
102
- this.setClientStyling();
103
- if (this.clientStylingUrlContent)
104
- this.setClientStylingURL();
105
- this.limitStylingAppends = true;
106
- }
107
- // end custom styling area
108
- }
109
- toggleContent() {
110
- this.showContent = !this.showContent;
111
- }
112
- deleteAction() {
113
- if (this.postMessage) {
114
- // @TODO maybe change the name type, this one sucks
115
- window.postMessage({ type: this.eventName }, window.location.href);
116
- }
117
- this.accordionEvent.emit();
118
- }
119
- render() {
120
- return (h("div", { class: "Wrapper", ref: el => this.stylingContainer = el }, h("div", { class: this.ticketHistoryFlag === true ? 'HeaderTicketHistory' : 'Header', onClick: () => this.toggleContent() }, h("p", { class: "Title" }, this.headerTitle), h("p", { class: "Subtitle" }, this.headerSubtitle), h("p", { class: "Subtitle Description" }, this.description), h("span", { class: "Expand" }, this.showContent ? '<' : '>')), this.showContent &&
121
- h("div", null, h("div", { class: "Content" }, h("slot", { name: 'accordionContent' }), this.footer && this.showContent &&
122
- h("div", null, this.deleteTab &&
123
- h("span", { class: "ActionButton", onClick: () => this.deleteAction() }, translate$2('deleteTicket', this.language)))))));
124
- }
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("div", { key: 'ad26faefd6e3dd089171c7e2bff13faa5a26d972', class: "Wrapper", ref: el => this.stylingContainer = el }, h("div", { key: 'bb7045653ec12a2526029589744f7ef014ec6a6a', class: this.ticketHistoryFlag === true ? 'HeaderTicketHistory' : 'Header', onClick: () => this.toggleContent() }, h("p", { key: 'ae30943582063e368e942124d8d5acadc1732629', class: "Title" }, this.headerTitle), h("p", { key: '7c35076cb768de784177988900c61fe40a71594c', class: "Subtitle" }, this.headerSubtitle), h("p", { key: 'daff2b456a427f45b00efc32ba33a68cdc2228f0', class: "Subtitle Description" }, this.description), h("span", { key: '0c4f942642da6e8b1ac3d2aeac46034963965d8f', class: "Expand" }, this.showContent ? '<' : '>')), this.showContent &&
87
+ h("div", { key: 'c688ab7cc629a3974b905a2fdc43063e996a3b90' }, h("div", { key: 'aaa3ad7d9f1503b8e1baaa2c756376a580ffe261', class: "Content" }, h("slot", { key: '8c5c8ff70857da9414c7284b052a3fbc5f503f4a', name: 'accordionContent' }), this.footer && this.showContent &&
88
+ h("div", { key: '917191f55a45647d708a5e3ff5e188c7e565a0c0' }, this.deleteTab &&
89
+ h("span", { key: 'e7fdd5b4f18cacaceda206b36ce9576cc3fc1472', class: "ActionButton", onClick: () => this.deleteAction() }, translate$2('deleteTicket', this.language)))))));
90
+ }
125
91
  };
126
- Accordion.style = helperAccordionCss;
92
+ HelperAccordion.style = HelperAccordionStyle0;
127
93
 
128
- 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, white 0%, white 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, white 0%, #f1f1f1 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}";
94
+ 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}";
95
+ const LotteryBulletStyle0 = lotteryBulletCss;
129
96
 
130
97
  const LotteryBullet = class {
131
- constructor(hostRef) {
132
- registerInstance(this, hostRef);
133
- this.bulletEvent = createEvent(this, "lotteryBulletSelection", 7);
134
- /**
135
- * Value of the bullet
136
- */
137
- this.value = '0';
138
- /**
139
- * Marks if the bullet should be selectable
140
- */
141
- this.selectable = true;
142
- /**
143
- * Marks if the bullet should be selected
144
- */
145
- this.isSelected = false;
146
- /**
147
- * Client custom styling via string
148
- */
149
- this.clientStyling = '';
150
- /**
151
- * Client custom styling via url content
152
- */
153
- this.clientStylingUrlContent = '';
154
- this.limitStylingAppends = false;
155
- this.select = () => {
156
- if (this.selectable) {
157
- this.isSelected = !this.isSelected;
158
- this.bulletEvent.emit({
159
- value: this.value,
160
- selected: this.isSelected
161
- });
162
- }
163
- };
164
- this.setClientStyling = () => {
165
- let sheet = document.createElement('style');
166
- sheet.innerHTML = this.clientStyling;
167
- this.stylingContainer.prepend(sheet);
168
- };
169
- this.setClientStylingURL = () => {
170
- let cssFile = document.createElement('style');
171
- setTimeout(() => {
172
- cssFile.innerHTML = this.clientStylingUrlContent;
173
- this.stylingContainer.prepend(cssFile);
174
- }, 1);
175
- };
176
- }
177
- componentDidRender() {
178
- // start custom styling area
179
- if (!this.limitStylingAppends && this.stylingContainer) {
180
- if (this.clientStyling)
181
- this.setClientStyling();
182
- if (this.clientStylingUrlContent)
183
- this.setClientStylingURL();
184
- this.limitStylingAppends = true;
185
- }
186
- // end custom styling area
187
- }
188
- render() {
189
- return (h("div", { class: 'Circle ' + (this.selectable ? '' : 'Disabled') + (this.isSelected ? 'Selected' : ''), onClick: () => this.select(), ref: el => this.stylingContainer = el }, this.value));
190
- }
98
+ constructor(hostRef) {
99
+ registerInstance(this, hostRef);
100
+ this.bulletEvent = createEvent(this, "lotteryBulletSelection", 7);
101
+ this.select = () => {
102
+ if (this.selectable) {
103
+ this.isSelected = !this.isSelected;
104
+ this.bulletEvent.emit({
105
+ value: this.value,
106
+ selected: this.isSelected
107
+ });
108
+ }
109
+ };
110
+ this.setClientStyling = () => {
111
+ let sheet = document.createElement('style');
112
+ sheet.innerHTML = this.clientStyling;
113
+ this.stylingContainer.prepend(sheet);
114
+ };
115
+ this.setClientStylingURL = () => {
116
+ let cssFile = document.createElement('style');
117
+ setTimeout(() => {
118
+ cssFile.innerHTML = this.clientStylingUrlContent;
119
+ this.stylingContainer.prepend(cssFile);
120
+ }, 1);
121
+ };
122
+ this.value = '0';
123
+ this.selectable = true;
124
+ this.isSelected = false;
125
+ this.clientStyling = '';
126
+ this.clientStylingUrlContent = '';
127
+ this.limitStylingAppends = false;
128
+ }
129
+ componentDidRender() {
130
+ // start custom styling area
131
+ if (!this.limitStylingAppends && this.stylingContainer) {
132
+ if (this.clientStyling)
133
+ this.setClientStyling();
134
+ if (this.clientStylingUrlContent)
135
+ this.setClientStylingURL();
136
+ this.limitStylingAppends = true;
137
+ }
138
+ // end custom styling area
139
+ }
140
+ render() {
141
+ return (h("div", { key: 'af3601684ecf1f39d65fc9461430cba96b9e4b8c', class: 'Circle ' + (this.selectable ? '' : 'Disabled') + (this.isSelected ? 'Selected' : ''), onClick: () => this.select(), ref: el => this.stylingContainer = el }, this.value));
142
+ }
191
143
  };
192
- LotteryBullet.style = lotteryBulletCss;
144
+ LotteryBullet.style = LotteryBulletStyle0;
193
145
 
194
146
  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}";
147
+ const LotteryGridStyle0 = lotteryGridCss;
195
148
 
196
149
  const LotteryGrid = class {
197
- constructor(hostRef) {
198
- registerInstance(this, hostRef);
199
- this.gridFilledEvent = createEvent(this, "gridFilled", 7);
200
- this.gridDirtyEvent = createEvent(this, "gridDirty", 7);
201
- /**
202
- * Number of bullets of grid
203
- */
204
- this.totalNumbers = 0;
205
- /**
206
- * Number of maximum bullets that can be selected
207
- */
208
- this.maximumAllowed = 0;
209
- /**
210
- * Minimum allowed of bullets
211
- */
212
- this.minimumAllowed = 1;
213
- /**
214
- * Allows the user to select numbers on the grid
215
- */
216
- this.selectable = true;
217
- /**
218
- * Numbers that should be showed as selected on the grid (as a string of those numbers e.g. '1,2,3,4,5,6')
219
- */
220
- this.selectedNumbers = '';
221
- /**
222
- * Show only selected numbers
223
- */
224
- this.displaySelected = false;
225
- /**
226
- * Language
227
- */
228
- this.language = 'en';
229
- /**
230
- * Personalize grid for ticket
231
- */
232
- this.gridType = '';
233
- /**
234
- * Client custom styling via string
235
- */
236
- this.clientStyling = '';
237
- /**
238
- * Client custom styling via url content
239
- */
240
- this.clientStylingUrlContent = '';
241
- this.numbers = [];
242
- this.limitStylingAppends = false;
243
- this.selectedCounter = 0;
244
- this.setClientStyling = () => {
245
- let sheet = document.createElement('style');
246
- sheet.innerHTML = this.clientStyling;
247
- this.stylingContainer.prepend(sheet);
248
- };
249
- this.setClientStylingURL = () => {
250
- let cssFile = document.createElement('style');
251
- setTimeout(() => {
252
- cssFile.innerHTML = this.clientStylingUrlContent;
253
- this.stylingContainer.prepend(cssFile);
254
- }, 1);
255
- };
256
- }
257
- connectedCallback() {
258
- let selected = [];
259
- if (this.selectedNumbers.length > 0) {
260
- selected = this.selectedNumbers.split(',');
261
- this.selectedCounter = selected.length;
262
- }
263
- if (this.displaySelected) {
264
- selected.forEach((item) => {
265
- this.numbers.push({
266
- number: item,
267
- selected: true,
268
- selectable: this.selectable
269
- });
270
- });
271
- }
272
- else {
273
- [...Array(this.totalNumbers).keys()]
274
- .map(number => (number + 1).toString())
275
- .forEach((number) => {
276
- this.numbers.push({
277
- number,
278
- selected: selected.indexOf(number) >= 0 ? true : false,
279
- selectable: this.selectedCounter == this.maximumAllowed ? false : this.selectable
280
- });
281
- });
282
- }
283
- }
284
- componentDidRender() {
285
- // start custom styling area
286
- if (!this.limitStylingAppends && this.stylingContainer) {
287
- if (this.clientStyling)
288
- this.setClientStyling();
289
- if (this.clientStylingUrlContent)
290
- this.setClientStylingURL();
291
- this.limitStylingAppends = true;
292
- }
293
- // end custom styling area
294
- }
295
- // wrote this because the classic .sort(() => 0.5 - Math.random()) method yielded low entropy shuffles for some reason on certain devices
296
- shuffleArray(array) {
297
- const result = [];
298
- while (array.length > 0) {
299
- const randomIndex = Math.floor(Math.random() * (array.length));
300
- result.push(array.splice(randomIndex, 1)[0]);
301
- }
302
- return result;
303
- }
304
- lotteryBulletSelectionHandler(event) {
305
- this.numbers = this.numbers.map((item) => {
306
- if (item.number == event.detail.value) {
307
- return {
308
- number: item.number,
309
- selected: event.detail.selected,
310
- selectable: item.selectable
150
+ constructor(hostRef) {
151
+ registerInstance(this, hostRef);
152
+ this.gridFilledEvent = createEvent(this, "gridFilled", 7);
153
+ this.gridDirtyEvent = createEvent(this, "gridDirty", 7);
154
+ this.selectedCounter = 0;
155
+ this.setClientStyling = () => {
156
+ let sheet = document.createElement('style');
157
+ sheet.innerHTML = this.clientStyling;
158
+ this.stylingContainer.prepend(sheet);
311
159
  };
312
- }
313
- return {
314
- number: item.number,
315
- selected: item.selected,
316
- selectable: item.selectable
317
- };
318
- });
319
- if (event.detail.selected) {
320
- this.selectedCounter += 1;
321
- if (this.selectedCounter == this.maximumAllowed) {
322
- this.numbers = this.numbers.map((item) => {
323
- return {
324
- number: item.number,
325
- selected: item.selected,
326
- selectable: item.selected ? true : false
327
- };
328
- });
329
- this.gridFilledEvent.emit({
330
- id: this.ticketId,
331
- index: this.gridIndex,
332
- selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)
333
- });
334
- }
160
+ this.setClientStylingURL = () => {
161
+ let cssFile = document.createElement('style');
162
+ setTimeout(() => {
163
+ cssFile.innerHTML = this.clientStylingUrlContent;
164
+ this.stylingContainer.prepend(cssFile);
165
+ }, 1);
166
+ };
167
+ this.ticketId = undefined;
168
+ this.totalNumbers = 0;
169
+ this.gameId = undefined;
170
+ this.maximumAllowed = 0;
171
+ this.minimumAllowed = 1;
172
+ this.selectable = true;
173
+ this.selectedNumbers = '';
174
+ this.displaySelected = false;
175
+ this.language = 'en';
176
+ this.gridIndex = undefined;
177
+ this.gridType = '';
178
+ this.clientStyling = '';
179
+ this.clientStylingUrlContent = '';
180
+ this.numbers = [];
181
+ this.limitStylingAppends = false;
335
182
  }
336
- else {
337
- if (this.selectedCounter == this.maximumAllowed) {
183
+ connectedCallback() {
184
+ let selected = [];
185
+ if (this.selectedNumbers.length > 0) {
186
+ selected = this.selectedNumbers.split(',');
187
+ this.selectedCounter = selected.length;
188
+ }
189
+ if (this.displaySelected) {
190
+ selected.forEach((item) => {
191
+ this.numbers.push({
192
+ number: item,
193
+ selected: true,
194
+ selectable: this.selectable
195
+ });
196
+ });
197
+ }
198
+ else {
199
+ [...Array(this.totalNumbers).keys()]
200
+ .map(number => (number + 1).toString())
201
+ .forEach((number) => {
202
+ this.numbers.push({
203
+ number,
204
+ selected: selected.indexOf(number) >= 0 ? true : false,
205
+ selectable: this.selectedCounter == this.maximumAllowed ? false : this.selectable
206
+ });
207
+ });
208
+ }
209
+ }
210
+ componentDidRender() {
211
+ // start custom styling area
212
+ if (!this.limitStylingAppends && this.stylingContainer) {
213
+ if (this.clientStyling)
214
+ this.setClientStyling();
215
+ if (this.clientStylingUrlContent)
216
+ this.setClientStylingURL();
217
+ this.limitStylingAppends = true;
218
+ }
219
+ // end custom styling area
220
+ }
221
+ // wrote this because the classic .sort(() => 0.5 - Math.random()) method yielded low entropy shuffles for some reason on certain devices
222
+ shuffleArray(array) {
223
+ const result = [];
224
+ while (array.length > 0) {
225
+ const randomIndex = Math.floor(Math.random() * (array.length));
226
+ result.push(array.splice(randomIndex, 1)[0]);
227
+ }
228
+ return result;
229
+ }
230
+ lotteryBulletSelectionHandler(event) {
338
231
  this.numbers = this.numbers.map((item) => {
339
- return {
340
- number: item.number,
341
- selected: item.selected,
342
- selectable: true
343
- };
232
+ if (item.number == event.detail.value) {
233
+ return {
234
+ number: item.number,
235
+ selected: event.detail.selected,
236
+ selectable: item.selectable
237
+ };
238
+ }
239
+ return {
240
+ number: item.number,
241
+ selected: item.selected,
242
+ selectable: item.selectable
243
+ };
344
244
  });
345
- this.gridDirtyEvent.emit({
346
- id: this.ticketId,
347
- index: this.gridIndex,
348
- selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)
349
- });
350
- }
351
- this.selectedCounter -= 1;
352
- }
353
- }
354
- async resetSelectionHandler(event) {
355
- if (event.detail && event.detail == this.ticketId) {
356
- this.selectedCounter = 0;
357
- this.numbers = this.numbers.map((item) => {
358
- return {
359
- number: item.number,
360
- selected: false,
361
- selectable: this.selectable
362
- };
363
- });
364
- this.gridDirtyEvent.emit({
365
- id: this.ticketId,
366
- index: this.gridIndex,
367
- selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)
368
- });
369
- }
370
- }
371
- async autoSelectionHandler(event) {
372
- if (event.detail && event.detail == this.ticketId) {
373
- this.resetSelectionHandler(event);
374
- let array = [...Array(this.totalNumbers).keys()]
375
- .map(number => number + 1);
376
- array = this.shuffleArray(array);
377
- array = array.slice(0, this.minimumAllowed);
378
- this.numbers = this.numbers.map((item) => {
379
- return {
380
- number: item.number,
381
- selected: array.indexOf(parseInt(item.number, 10)) >= 0 ? true : false,
382
- selectable: array.indexOf(parseInt(item.number, 10)) >= 0 ? true : false,
383
- };
384
- });
385
- this.gridFilledEvent.emit({
386
- id: this.ticketId,
387
- index: this.gridIndex,
388
- selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)
389
- });
390
- this.selectedCounter = this.maximumAllowed;
391
- }
392
- }
393
- render() {
394
- return (h("div", { class: "GridContainer", ref: el => this.stylingContainer = el }, h("div", { class: this.gridType === 'ticket' ? 'Grid TicketGrid' : 'Grid' }, this.numbers.map((item) => h("div", null, h("lottery-bullet", { value: item.number, selectable: item.selectable, "is-selected": item.selected, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }))))));
395
- }
245
+ if (event.detail.selected) {
246
+ this.selectedCounter += 1;
247
+ if (this.selectedCounter == this.maximumAllowed) {
248
+ this.numbers = this.numbers.map((item) => {
249
+ return {
250
+ number: item.number,
251
+ selected: item.selected,
252
+ selectable: item.selected ? true : false
253
+ };
254
+ });
255
+ this.gridFilledEvent.emit({
256
+ id: this.ticketId,
257
+ index: this.gridIndex,
258
+ selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)
259
+ });
260
+ }
261
+ }
262
+ else {
263
+ if (this.selectedCounter == this.maximumAllowed) {
264
+ this.numbers = this.numbers.map((item) => {
265
+ return {
266
+ number: item.number,
267
+ selected: item.selected,
268
+ selectable: true
269
+ };
270
+ });
271
+ this.gridDirtyEvent.emit({
272
+ id: this.ticketId,
273
+ index: this.gridIndex,
274
+ selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)
275
+ });
276
+ }
277
+ this.selectedCounter -= 1;
278
+ }
279
+ }
280
+ async resetSelectionHandler(event) {
281
+ if (event.detail && event.detail == this.ticketId) {
282
+ this.selectedCounter = 0;
283
+ this.numbers = this.numbers.map((item) => {
284
+ return {
285
+ number: item.number,
286
+ selected: false,
287
+ selectable: this.selectable
288
+ };
289
+ });
290
+ this.gridDirtyEvent.emit({
291
+ id: this.ticketId,
292
+ index: this.gridIndex,
293
+ selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)
294
+ });
295
+ }
296
+ }
297
+ async autoSelectionHandler(event) {
298
+ if (event.detail && event.detail == this.ticketId) {
299
+ this.resetSelectionHandler(event);
300
+ let array = [...Array(this.totalNumbers).keys()]
301
+ .map(number => number + 1);
302
+ array = this.shuffleArray(array);
303
+ array = array.slice(0, this.minimumAllowed);
304
+ this.numbers = this.numbers.map((item) => {
305
+ return {
306
+ number: item.number,
307
+ selected: array.indexOf(parseInt(item.number, 10)) >= 0 ? true : false,
308
+ selectable: array.indexOf(parseInt(item.number, 10)) >= 0 ? true : false,
309
+ };
310
+ });
311
+ this.gridFilledEvent.emit({
312
+ id: this.ticketId,
313
+ index: this.gridIndex,
314
+ selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)
315
+ });
316
+ this.selectedCounter = this.maximumAllowed;
317
+ }
318
+ }
319
+ render() {
320
+ return (h("div", { key: '54b9187146b5d2625fd5ce7f53f38abf091cd943', class: "GridContainer", ref: el => this.stylingContainer = el }, h("div", { key: 'e7e8570557ebaa78edf881cdbc1ed720028cdf6e', class: this.gridType === 'ticket' ? 'Grid TicketGrid' : 'Grid' }, this.numbers.map((item) => h("div", null, h("lottery-bullet", { value: item.number, selectable: item.selectable, "is-selected": item.selected, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }))))));
321
+ }
396
322
  };
397
- LotteryGrid.style = lotteryGridCss;
323
+ LotteryGrid.style = LotteryGridStyle0;
398
324
 
399
325
  const DEFAULT_LANGUAGE$1 = 'en';
400
326
  const SUPPORTED_LANGUAGES$1 = ['ro', 'en', 'hr'];
401
327
  const TRANSLATIONS$1 = {
402
- en: {
403
- loading: 'Loading, please wait ...',
404
- error: 'It was an error while trying to fetch the data',
405
- grid: 'Grid',
406
- multiplier: 'Multiplier',
407
- numberOfDraws: 'Number of draws',
408
- wagerPerDraw: 'Wager per draw',
409
- resetButton: 'Reset',
410
- autoButton: 'I feel lucky'
411
- },
412
- ro: {
413
- loading: 'Se incarca, va rugam asteptati ...',
414
- error: 'A fost o eroare in timp ce asteptam datele',
415
- grid: 'Grid',
416
- multiplier: 'Multiplicator',
417
- numberOfDraws: 'Numarul de extrageri',
418
- wagerPerDraw: 'Pariul per extragere',
419
- resetButton: 'Reseteaza',
420
- autoButton: 'Ma simt norocos'
421
- },
422
- fr: {
423
- loading: 'Loading, please wait ...',
424
- error: 'It was an error while trying to fetch the data',
425
- grid: 'Grid',
426
- multiplier: 'Multiplier',
427
- numberOfDraws: 'Number of draws',
428
- wagerPerDraw: 'Wager per draw',
429
- resetButton: 'Reset',
430
- autoButton: 'I feel lucky'
431
- },
432
- ar: {
433
- loading: 'Loading, please wait ...',
434
- error: 'It was an error while trying to fetch the data',
435
- grid: 'Grid',
436
- multiplier: 'Multiplier',
437
- numberOfDraws: 'Number of draws',
438
- wagerPerDraw: 'Wager per draw',
439
- resetButton: 'Reset',
440
- autoButton: 'I feel lucky'
441
- },
442
- hr: {
443
- loading: 'Učitavanje, molimo pričekajte ...',
444
- error: 'Došlo je do pogreške prilikom pokušaja dohvaćanja podataka',
445
- grid: 'Tablica',
446
- multiplier: 'Multiplikator',
447
- numberOfDraws: 'Broj izvlačenja',
448
- wagerPerDraw: 'Ulog po izvlačenju',
449
- resetButton: 'Resetiraj',
450
- autoButton: 'Osjećam se sretno'
451
- }
328
+ en: {
329
+ loading: 'Loading, please wait ...',
330
+ error: 'It was an error while trying to fetch the data',
331
+ grid: 'Grid',
332
+ multiplier: 'Multiplier',
333
+ numberOfDraws: 'Number of draws',
334
+ wagerPerDraw: 'Wager per draw',
335
+ resetButton: 'Reset',
336
+ autoButton: 'I feel lucky'
337
+ },
338
+ ro: {
339
+ loading: 'Se incarca, va rugam asteptati ...',
340
+ error: 'A fost o eroare in timp ce asteptam datele',
341
+ grid: 'Grid',
342
+ multiplier: 'Multiplicator',
343
+ numberOfDraws: 'Numarul de extrageri',
344
+ wagerPerDraw: 'Pariul per extragere',
345
+ resetButton: 'Reseteaza',
346
+ autoButton: 'Ma simt norocos'
347
+ },
348
+ fr: {
349
+ loading: 'Loading, please wait ...',
350
+ error: 'It was an error while trying to fetch the data',
351
+ grid: 'Grid',
352
+ multiplier: 'Multiplier',
353
+ numberOfDraws: 'Number of draws',
354
+ wagerPerDraw: 'Wager per draw',
355
+ resetButton: 'Reset',
356
+ autoButton: 'I feel lucky'
357
+ },
358
+ ar: {
359
+ loading: 'Loading, please wait ...',
360
+ error: 'It was an error while trying to fetch the data',
361
+ grid: 'Grid',
362
+ multiplier: 'Multiplier',
363
+ numberOfDraws: 'Number of draws',
364
+ wagerPerDraw: 'Wager per draw',
365
+ resetButton: 'Reset',
366
+ autoButton: 'I feel lucky'
367
+ },
368
+ hr: {
369
+ loading: 'Učitavanje, molimo pričekajte ...',
370
+ error: 'Došlo je do pogreške prilikom pokušaja dohvaćanja podataka',
371
+ grid: 'Tablica',
372
+ multiplier: 'Multiplikator',
373
+ numberOfDraws: 'Broj izvlačenja',
374
+ wagerPerDraw: 'Ulog po izvlačenju',
375
+ resetButton: 'Resetiraj',
376
+ autoButton: 'Osjećam se sretno'
377
+ }
452
378
  };
453
379
  const translate$1 = (key, customLang) => {
454
- const lang = customLang;
455
- return TRANSLATIONS$1[lang !== undefined && SUPPORTED_LANGUAGES$1.includes(lang) ? lang : DEFAULT_LANGUAGE$1][key];
380
+ const lang = customLang;
381
+ return TRANSLATIONS$1[lang !== undefined && SUPPORTED_LANGUAGES$1.includes(lang) ? lang : DEFAULT_LANGUAGE$1][key];
456
382
  };
457
383
 
458
384
  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}";
385
+ const LotteryTicketStyle0 = lotteryTicketCss;
459
386
 
460
387
  const LotteryTicket = class {
461
- constructor(hostRef) {
462
- registerInstance(this, hostRef);
463
- this.ticketCompleted = createEvent(this, "ticketCompleted", 7);
464
- this.autoSelection = createEvent(this, "autoSelection", 7);
465
- this.resetSelection = createEvent(this, "resetSelection", 7);
466
- this.stakeChange = createEvent(this, "stakeChange", 7);
467
- this.multiplierChange = createEvent(this, "multiplierChange", 7);
468
- /**
469
- * Number of grids of a ticket
470
- */
471
- this.numberOfGrids = 1;
472
- /**
473
- * Option to have the ticket registered for multiple draws
474
- */
475
- this.multipleDraws = true;
476
- /**
477
- * Shows the reset button
478
- */
479
- this.resetButton = false;
480
- /**
481
- * Shows the auto-pick button
482
- */
483
- this.autoPick = false;
484
- /**
485
- * Language
486
- */
487
- this.language = 'en';
488
- /**
489
- * Client custom styling via string
490
- */
491
- this.clientStyling = '';
388
+ constructor(hostRef) {
389
+ registerInstance(this, hostRef);
390
+ this.ticketCompleted = createEvent(this, "ticketCompleted", 7);
391
+ this.autoSelection = createEvent(this, "autoSelection", 7);
392
+ this.resetSelection = createEvent(this, "resetSelection", 7);
393
+ this.stakeChange = createEvent(this, "stakeChange", 7);
394
+ this.multiplierChange = createEvent(this, "multiplierChange", 7);
395
+ this.setClientStyling = () => {
396
+ let sheet = document.createElement('style');
397
+ sheet.innerHTML = this.clientStyling;
398
+ this.stylingContainer.prepend(sheet);
399
+ };
400
+ this.setClientStylingURL = () => {
401
+ let cssFile = document.createElement('style');
402
+ setTimeout(() => {
403
+ cssFile.innerHTML = this.clientStylingUrlContent;
404
+ this.stylingContainer.prepend(cssFile);
405
+ }, 1);
406
+ };
407
+ this.endpoint = undefined;
408
+ this.gameId = undefined;
409
+ this.numberOfGrids = 1;
410
+ this.multipleDraws = true;
411
+ this.ticketId = undefined;
412
+ this.resetButton = false;
413
+ this.autoPick = false;
414
+ this.language = 'en';
415
+ this.clientStyling = '';
416
+ this.clientStylingUrlContent = '';
417
+ this.multiplier = false;
418
+ this.numberOfDraws = 1;
419
+ this.isLoading = true;
420
+ this.hasErrors = false;
421
+ this.ticketDone = false;
422
+ this.isCustomSelect = false;
423
+ this.amountInfo = {};
424
+ this.limitStylingAppends = false;
425
+ }
492
426
  /**
493
- * Client custom styling via url content
427
+ * @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
494
428
  */
495
- this.clientStylingUrlContent = '';
496
- this.multiplier = false;
497
- this.numberOfDraws = 1;
498
- this.isLoading = true;
499
- this.hasErrors = false;
500
- this.ticketDone = false;
501
- this.isCustomSelect = false;
502
- this.amountInfo = {};
503
- this.limitStylingAppends = false;
504
- this.setClientStyling = () => {
505
- let sheet = document.createElement('style');
506
- sheet.innerHTML = this.clientStyling;
507
- this.stylingContainer.prepend(sheet);
508
- };
509
- this.setClientStylingURL = () => {
510
- let cssFile = document.createElement('style');
511
- setTimeout(() => {
512
- cssFile.innerHTML = this.clientStylingUrlContent;
513
- this.stylingContainer.prepend(cssFile);
514
- }, 1);
515
- };
516
- }
517
- /**
518
- * @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
519
- */
520
- checkForClickOutside(ev) {
521
- if (ev.composedPath()[0].getAttribute('data-cluster') !== 'SelectComponent') {
522
- this.isCustomSelect = false;
523
- }
524
- }
525
- connectedCallback() {
526
- let url = new URL(`${this.endpoint}/games/${this.gameId}`);
527
- fetch(url.href)
528
- .then((response) => {
529
- if (response.ok) {
530
- return response.json();
531
- }
532
- else {
533
- // Throw error
534
- this.hasErrors = true;
535
- }
536
- })
537
- .then((data) => {
538
- this.isLoading = false;
539
- this.gameData = data;
540
- this.grids = [...Array(this.gameData.type.boards.length).keys()];
541
- this.amountInfo = this.gameData.type.stakes[0]; // initial value for select
542
- })
543
- .catch((err) => {
544
- this.isLoading = false;
545
- this.hasErrors = true;
546
- console.error('Error!', err);
547
- });
548
- }
549
- componentDidRender() {
550
- // start custom styling area
551
- if (!this.limitStylingAppends && this.stylingContainer) {
552
- if (this.clientStyling)
553
- this.setClientStyling();
554
- if (this.clientStylingUrlContent)
555
- this.setClientStylingURL();
556
- this.limitStylingAppends = true;
557
- }
558
- // end custom styling area
559
- }
560
- multiplierChangeHandler(e) {
561
- this.multiplier = e.target ? e.target.checked : false;
562
- this.multiplierChange.emit(this.multiplier);
563
- }
564
- drawsChangeHandler(event) {
565
- this.ticket = Object.assign(Object.assign({}, this.ticket), { draws: event });
566
- this.ticketCompleted.emit(this.ticket);
567
- }
568
- gridFilledHandler(event) {
569
- this.ticket = Object.assign(Object.assign({}, event.detail), { draws: this.numberOfDraws });
570
- this.ticketDone = true;
571
- this.ticketCompleted.emit(this.ticket);
572
- }
573
- toggleAutoSelection() {
574
- this.ticketDone = true;
575
- this.autoSelection.emit(this.ticketId);
576
- }
577
- toggleResetSelection() {
578
- this.ticketDone = false;
579
- this.resetSelection.emit(this.ticketId);
580
- }
581
- changeStake(ticketid, amount) {
582
- this.stakeChange.emit({
583
- ticketId: ticketid,
584
- stake: amount
585
- });
586
- }
587
- toggleClass() {
588
- this.isCustomSelect = !this.isCustomSelect;
589
- }
590
- setDropdownItem(item) {
591
- this.amountInfo = {
592
- value: item.value,
593
- currency: item.currency
594
- };
595
- this.isCustomSelect = false;
596
- this.changeStake(this.ticketId, item.amount);
597
- }
598
- render() {
599
- if (this.isLoading) {
600
- return (h("div", null, h("p", null, translate$1('loading', this.language))));
601
- }
602
- else {
603
- if (this.hasErrors) {
604
- return (h("div", null, h("p", null, translate$1('error', this.language))));
605
- }
606
- else {
607
- const { type } = this.gameData;
608
- return (h("div", { class: "TicketContainer", ref: el => this.stylingContainer = el }, h("p", { class: "TicketTitle" }, this.gameData.name), this.resetButton && this.ticketDone &&
609
- h("div", { class: "ButtonContainer" }, h("a", { class: "ResetButton", onClick: () => this.toggleResetSelection() }, translate$1('resetButton', this.language))), this.autoPick && !this.ticketDone &&
610
- h("div", { class: "ButtonContainer" }, h("a", { class: "AutoButton", onClick: () => this.toggleAutoSelection() }, translate$1('autoButton', this.language))), this.grids.map((_, index) => h("div", { class: "TicketGridBullets" }, h("p", { class: "TicketGridTitle" }, translate$1('grid', this.language), " ", index + 1), h("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 &&
611
- h("div", null, h("label", { class: "Toggle" }, h("label", { class: "Label" }, translate$1('multiplier', this.language), ": "), h("input", { class: "ToggleCheckbox", type: "checkbox", onInput: (e) => this.multiplierChangeHandler(e) }), h("div", { class: "ToggleSwitch" }))), this.multipleDraws &&
612
- h("div", { class: "TicketDraws" }, h("label", { class: "Label" }, translate$1('numberOfDraws', this.language), ": "), h("div", { class: "NumberInput" }, h("button", { onClick: () => this.numberOfDraws > 1 ? this.numberOfDraws-- : this.numberOfDraws = 1, class: "Minus" }, "-"), h("input", { class: "InputDefault", min: "1", value: this.numberOfDraws, type: "number" }), h("button", { onClick: () => this.numberOfDraws++, class: "Plus" }, "+"))), h("div", null, h("label", { class: "Label" }, translate$1('wagerPerDraw', this.language), ": "), h("div", { class: "WagerInput" }, type.stakes.length > 1 ?
613
- (h("div", { "data-cluster": "SelectComponent", class: this.isCustomSelect ? "SelectWrapper SelectActive" : "SelectWrapper" }, h("div", { "data-cluster": "SelectComponent", class: "SelectButton", onClick: () => this.toggleClass() }, h("span", { "data-cluster": "SelectComponent" }, this.amountInfo.value, " ", this.amountInfo.currency), h("span", { "data-cluster": "SelectComponent", class: "SelectExpand" }, "\u25BC")), h("div", { "data-cluster": "SelectComponent", class: "SelectContent" }, h("ul", { "data-cluster": "SelectComponent", class: "SelectOptions" }, type.stakes.map((item) => h("li", { "data-cluster": "SelectComponent", class: this.amountInfo.value == item.value ? 'SelectedValue' : '', value: item.value, onClick: () => this.setDropdownItem(item) }, item.value, " ", item.currency)))))) : (h("div", null, h("input", { min: "1", value: type.stakes[0].amount, type: "number", disabled: true }), h("p", { class: "WagerInputTitle" }, type.stakes[0].currency)))))));
614
- }
615
- }
616
- }
617
- static get watchers() { return {
618
- "numberOfDraws": ["drawsChangeHandler"]
619
- }; }
429
+ checkForClickOutside(ev) {
430
+ if (ev.composedPath()[0].getAttribute('data-cluster') !== 'SelectComponent') {
431
+ this.isCustomSelect = false;
432
+ }
433
+ }
434
+ connectedCallback() {
435
+ let url = new URL(`${this.endpoint}/games/${this.gameId}`);
436
+ fetch(url.href)
437
+ .then((response) => {
438
+ if (response.ok) {
439
+ return response.json();
440
+ }
441
+ else {
442
+ // Throw error
443
+ this.hasErrors = true;
444
+ }
445
+ })
446
+ .then((data) => {
447
+ this.isLoading = false;
448
+ this.gameData = data;
449
+ this.grids = [...Array(this.gameData.type.boards.length).keys()];
450
+ this.amountInfo = this.gameData.type.stakes[0]; // initial value for select
451
+ })
452
+ .catch((err) => {
453
+ this.isLoading = false;
454
+ this.hasErrors = true;
455
+ console.error('Error!', err);
456
+ });
457
+ }
458
+ componentDidRender() {
459
+ // start custom styling area
460
+ if (!this.limitStylingAppends && this.stylingContainer) {
461
+ if (this.clientStyling)
462
+ this.setClientStyling();
463
+ if (this.clientStylingUrlContent)
464
+ this.setClientStylingURL();
465
+ this.limitStylingAppends = true;
466
+ }
467
+ // end custom styling area
468
+ }
469
+ multiplierChangeHandler(e) {
470
+ this.multiplier = e.target ? e.target.checked : false;
471
+ this.multiplierChange.emit(this.multiplier);
472
+ }
473
+ drawsChangeHandler(event) {
474
+ this.ticket = Object.assign(Object.assign({}, this.ticket), { draws: event });
475
+ this.ticketCompleted.emit(this.ticket);
476
+ }
477
+ gridFilledHandler(event) {
478
+ this.ticket = Object.assign(Object.assign({}, event.detail), { draws: this.numberOfDraws });
479
+ this.ticketDone = true;
480
+ this.ticketCompleted.emit(this.ticket);
481
+ }
482
+ toggleAutoSelection() {
483
+ this.ticketDone = true;
484
+ this.autoSelection.emit(this.ticketId);
485
+ }
486
+ toggleResetSelection() {
487
+ this.ticketDone = false;
488
+ this.resetSelection.emit(this.ticketId);
489
+ }
490
+ changeStake(ticketid, amount) {
491
+ this.stakeChange.emit({
492
+ ticketId: ticketid,
493
+ stake: amount
494
+ });
495
+ }
496
+ toggleClass() {
497
+ this.isCustomSelect = !this.isCustomSelect;
498
+ }
499
+ setDropdownItem(item) {
500
+ this.amountInfo = {
501
+ value: item.value,
502
+ currency: item.currency
503
+ };
504
+ this.isCustomSelect = false;
505
+ this.changeStake(this.ticketId, item.amount);
506
+ }
507
+ render() {
508
+ if (this.isLoading) {
509
+ return (h("div", null, h("p", null, translate$1('loading', this.language))));
510
+ }
511
+ else {
512
+ if (this.hasErrors) {
513
+ return (h("div", null, h("p", null, translate$1('error', this.language))));
514
+ }
515
+ else {
516
+ const { type } = this.gameData;
517
+ return (h("div", { class: "TicketContainer", ref: el => this.stylingContainer = el }, h("p", { class: "TicketTitle" }, this.gameData.name), this.resetButton && this.ticketDone &&
518
+ h("div", { class: "ButtonContainer" }, h("a", { class: "ResetButton", onClick: () => this.toggleResetSelection() }, translate$1('resetButton', this.language))), this.autoPick && !this.ticketDone &&
519
+ h("div", { class: "ButtonContainer" }, h("a", { class: "AutoButton", onClick: () => this.toggleAutoSelection() }, translate$1('autoButton', this.language))), this.grids.map((_, index) => h("div", { class: "TicketGridBullets" }, h("p", { class: "TicketGridTitle" }, translate$1('grid', this.language), " ", index + 1), h("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 &&
520
+ h("div", null, h("label", { class: "Toggle" }, h("label", { class: "Label" }, translate$1('multiplier', this.language), ": "), h("input", { class: "ToggleCheckbox", type: "checkbox", onInput: (e) => this.multiplierChangeHandler(e) }), h("div", { class: "ToggleSwitch" }))), this.multipleDraws &&
521
+ h("div", { class: "TicketDraws" }, h("label", { class: "Label" }, translate$1('numberOfDraws', this.language), ": "), h("div", { class: "NumberInput" }, h("button", { onClick: () => this.numberOfDraws > 1 ? this.numberOfDraws-- : this.numberOfDraws = 1, class: "Minus" }, "-"), h("input", { class: "InputDefault", min: "1", value: this.numberOfDraws, type: "number" }), h("button", { onClick: () => this.numberOfDraws++, class: "Plus" }, "+"))), h("div", null, h("label", { class: "Label" }, translate$1('wagerPerDraw', this.language), ": "), h("div", { class: "WagerInput" }, type.stakes.length > 1 ?
522
+ (h("div", { "data-cluster": "SelectComponent", class: this.isCustomSelect ? "SelectWrapper SelectActive" : "SelectWrapper" }, h("div", { "data-cluster": "SelectComponent", class: "SelectButton", onClick: () => this.toggleClass() }, h("span", { "data-cluster": "SelectComponent" }, this.amountInfo.value, " ", this.amountInfo.currency), h("span", { "data-cluster": "SelectComponent", class: "SelectExpand" }, "\u25BC")), h("div", { "data-cluster": "SelectComponent", class: "SelectContent" }, h("ul", { "data-cluster": "SelectComponent", class: "SelectOptions" }, type.stakes.map((item) => h("li", { "data-cluster": "SelectComponent", class: this.amountInfo.value == item.value ? 'SelectedValue' : '', value: item.value, onClick: () => this.setDropdownItem(item) }, item.value, " ", item.currency)))))) : (h("div", null, h("input", { min: "1", value: type.stakes[0].amount, type: "number", disabled: true }), h("p", { class: "WagerInputTitle" }, type.stakes[0].currency)))))));
523
+ }
524
+ }
525
+ }
526
+ static get watchers() { return {
527
+ "numberOfDraws": ["drawsChangeHandler"]
528
+ }; }
620
529
  };
621
- LotteryTicket.style = lotteryTicketCss;
530
+ LotteryTicket.style = LotteryTicketStyle0;
622
531
 
623
532
  const DEFAULT_LANGUAGE = 'en';
624
533
  const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'ar', 'hr'];
625
534
  const TRANSLATIONS = {
626
- en: {
627
- ticket: 'Ticket',
628
- },
629
- ro: {
630
- ticket: 'Bilet',
631
- },
632
- fr: {
633
- ticket: 'Billet'
634
- },
635
- ar: {
636
- ticket: 'تذكرة',
637
- },
638
- hr: {
639
- ticket: 'Listić',
640
- }
535
+ en: {
536
+ ticket: 'Ticket',
537
+ },
538
+ ro: {
539
+ ticket: 'Bilet',
540
+ },
541
+ fr: {
542
+ ticket: 'Billet'
543
+ },
544
+ ar: {
545
+ ticket: 'تذكرة',
546
+ },
547
+ hr: {
548
+ ticket: 'Listić',
549
+ }
641
550
  };
642
551
  const translate = (key, customLang) => {
643
- const lang = customLang;
644
- return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
552
+ const lang = customLang;
553
+ return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
645
554
  };
646
555
 
647
- 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:#7ac317}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)}";
556
+ 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)}";
557
+ const LotteryTicketControllerStyle0 = lotteryTicketControllerCss;
648
558
 
649
559
  const LotteryTicketController = class {
650
- constructor(hostRef) {
651
- registerInstance(this, hostRef);
652
- this.deleteTicketEvent = createEvent(this, "deleteTicket", 7);
653
- /**
654
- * Endpoint URL for the source of data (NorWAy standard)
655
- */
656
- this.endpoint = '';
657
- /**
658
- * Ticket number
659
- */
660
- this.ticketId = 1;
661
- /**
662
- * Activates postMessages as events for actions from the widget
663
- */
664
- this.postMessage = false;
665
- /**
666
- * Name of the event emitter by the action button
667
- */
668
- this.eventName = 'deleteTicketAction';
669
- /**
670
- * Collapsed
671
- */
672
- this.collapsed = true;
673
- /**
674
- * Number of grids?
675
- */
676
- this.numberOfGrids = 1;
677
- /**
678
- * This toggles if the last ticket added should be expanded or not
679
- */
680
- this.last = false;
681
- /**
682
- * Language
683
- */
684
- this.language = 'en';
685
- /**
686
- * Shows the auto-pick button
687
- */
688
- this.autoPick = false;
689
- /**
690
- * Shows the reset button
691
- */
692
- this.resetButton = false;
693
- /**
694
- * Number of ticket controllers
695
- */
696
- this.totalControllers = 1;
697
- /**
698
- * Client custom styling via string
699
- */
700
- this.clientStyling = '';
701
- /**
702
- * Client custom styling via url content
703
- */
704
- this.clientStylingUrlContent = '';
705
- this.limitStylingAppends = false;
706
- this.setClientStyling = () => {
707
- let sheet = document.createElement('style');
708
- sheet.innerHTML = this.clientStyling;
709
- this.stylingContainer.prepend(sheet);
710
- };
711
- this.setClientStylingURL = () => {
712
- let cssFile = document.createElement('style');
713
- setTimeout(() => {
714
- cssFile.innerHTML = this.clientStylingUrlContent;
715
- this.stylingContainer.prepend(cssFile);
716
- }, 1);
717
- };
718
- }
719
- // @TODO fix the `any` type
720
- helperAccordionActionHandler() {
721
- if (this.postMessage) {
722
- window.postMessage({ type: this.eventName }, window.location.href);
723
- }
724
- this.deleteTicketEvent.emit({
725
- ticketId: this.ticketId
726
- });
727
- }
728
- componentDidRender() {
729
- // start custom styling area
730
- if (!this.limitStylingAppends && this.stylingContainer) {
731
- if (this.clientStyling)
732
- this.setClientStyling();
733
- if (this.clientStylingUrlContent)
734
- this.setClientStylingURL();
735
- this.limitStylingAppends = true;
736
- }
737
- // end custom styling area
738
- }
739
- render() {
740
- console.log('ticket id:', this.ticketId);
741
- return (h("div", { class: "LotteryTicketControllerContainer", ref: el => this.stylingContainer = el }, h("helper-accordion", { "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("div", { slot: "accordionContent" }, h("lottery-ticket", { 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 })))));
742
- }
560
+ constructor(hostRef) {
561
+ registerInstance(this, hostRef);
562
+ this.deleteTicketEvent = createEvent(this, "deleteTicket", 7);
563
+ this.setClientStyling = () => {
564
+ let sheet = document.createElement('style');
565
+ sheet.innerHTML = this.clientStyling;
566
+ this.stylingContainer.prepend(sheet);
567
+ };
568
+ this.setClientStylingURL = () => {
569
+ let cssFile = document.createElement('style');
570
+ setTimeout(() => {
571
+ cssFile.innerHTML = this.clientStylingUrlContent;
572
+ this.stylingContainer.prepend(cssFile);
573
+ }, 1);
574
+ };
575
+ this.endpoint = '';
576
+ this.ticketId = 1;
577
+ this.ticketDescription = undefined;
578
+ this.gameId = undefined;
579
+ this.postMessage = false;
580
+ this.eventName = 'deleteTicketAction';
581
+ this.collapsed = true;
582
+ this.numberOfGrids = 1;
583
+ this.last = false;
584
+ this.language = 'en';
585
+ this.autoPick = false;
586
+ this.resetButton = false;
587
+ this.totalControllers = 1;
588
+ this.clientStyling = '';
589
+ this.clientStylingUrlContent = '';
590
+ this.limitStylingAppends = false;
591
+ }
592
+ // @TODO fix the `any` type
593
+ helperAccordionActionHandler() {
594
+ if (this.postMessage) {
595
+ window.postMessage({ type: this.eventName }, window.location.href);
596
+ }
597
+ this.deleteTicketEvent.emit({
598
+ ticketId: this.ticketId
599
+ });
600
+ }
601
+ componentDidRender() {
602
+ // start custom styling area
603
+ if (!this.limitStylingAppends && this.stylingContainer) {
604
+ if (this.clientStyling)
605
+ this.setClientStyling();
606
+ if (this.clientStylingUrlContent)
607
+ this.setClientStylingURL();
608
+ this.limitStylingAppends = true;
609
+ }
610
+ // end custom styling area
611
+ }
612
+ render() {
613
+ console.log('ticket id:', this.ticketId);
614
+ return (h("div", { key: '203c89c4b240cd7c99eb3d37fa3a4dbc17ed18e3', class: "LotteryTicketControllerContainer", ref: el => this.stylingContainer = el }, h("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("div", { key: 'b9c618987e848d4b44fee6941f8b5c9696bd44e8', slot: "accordionContent" }, h("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 })))));
615
+ }
743
616
  };
744
- LotteryTicketController.style = lotteryTicketControllerCss;
617
+ LotteryTicketController.style = LotteryTicketControllerStyle0;
745
618
 
746
- export { Accordion as helper_accordion, LotteryBullet as lottery_bullet, LotteryGrid as lottery_grid, LotteryTicket as lottery_ticket, LotteryTicketController as lottery_ticket_controller };
619
+ export { HelperAccordion as helper_accordion, LotteryBullet as lottery_bullet, LotteryGrid as lottery_grid, LotteryTicket as lottery_ticket, LotteryTicketController as lottery_ticket_controller };