@everymatrix/lottery-ticket-controller 0.1.23 → 1.0.69

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