@everymatrix/lottery-oddsbom-entrance 0.7.21 → 0.7.22

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 (23) hide show
  1. package/dist/cjs/{lottery-oddsbom-bomb_2.cjs.entry.js → helper-date-navigator_8.cjs.entry.js} +1887 -27
  2. package/dist/cjs/{index-b0be9007.js → index-4e91c0c2.js} +36 -3
  3. package/dist/cjs/index.cjs.js +2 -3
  4. package/dist/cjs/loader.cjs.js +2 -2
  5. package/dist/cjs/{lottery-oddsbom-entrance-5723d41e.js → lottery-oddsbom-entrance-492c9f11.js} +1 -2
  6. package/dist/cjs/lottery-oddsbom-entrance.cjs.js +2 -2
  7. package/dist/collection/collection-manifest.json +36 -0
  8. package/dist/collection/components/lottery-oddsbom-entrance/lottery-oddsbom-entrance.js +1 -1
  9. package/dist/esm/{lottery-oddsbom-bomb_2.entry.js → helper-date-navigator_8.entry.js} +1883 -29
  10. package/dist/esm/{index-275ec96c.js → index-068e610e.js} +36 -4
  11. package/dist/esm/index.js +2 -3
  12. package/dist/esm/loader.js +3 -3
  13. package/dist/esm/{lottery-oddsbom-entrance-267e1b22.js → lottery-oddsbom-entrance-e1fe7c9f.js} +1 -2
  14. package/dist/esm/lottery-oddsbom-entrance.js +3 -3
  15. package/dist/lottery-oddsbom-entrance/helper-date-navigator_8.entry.js +1 -0
  16. package/dist/lottery-oddsbom-entrance/index-068e610e.js +2 -0
  17. package/dist/lottery-oddsbom-entrance/index.esm.js +1 -1
  18. package/dist/lottery-oddsbom-entrance/{lottery-oddsbom-entrance-267e1b22.js → lottery-oddsbom-entrance-e1fe7c9f.js} +1 -1
  19. package/dist/lottery-oddsbom-entrance/lottery-oddsbom-entrance.esm.js +1 -1
  20. package/dist/types/components/lottery-oddsbom-entrance/lottery-oddsbom-entrance.d.ts +1 -1
  21. package/package.json +1 -1
  22. package/dist/lottery-oddsbom-entrance/index-275ec96c.js +0 -2
  23. package/dist/lottery-oddsbom-entrance/lottery-oddsbom-bomb_2.entry.js +0 -1
@@ -1,7 +1,356 @@
1
- import { h, r as registerInstance, c as createEvent, g as getAssetPath } from './index-275ec96c.js';
2
- import { s as setClientStyling, a as setClientStylingURL, b as setStreamStyling } from './lottery-oddsbom-entrance-267e1b22.js';
3
- export { L as lottery_oddsbom_entrance } from './lottery-oddsbom-entrance-267e1b22.js';
4
- import '@everymatrix/lottery-oddsbom-latest-result-group';
1
+ import { r as registerInstance, c as createEvent, h, g as getAssetPath, H as Host } from './index-068e610e.js';
2
+ import { s as setClientStyling, a as setClientStylingURL, b as setStreamStyling } from './lottery-oddsbom-entrance-e1fe7c9f.js';
3
+ export { L as lottery_oddsbom_entrance } from './lottery-oddsbom-entrance-e1fe7c9f.js';
4
+
5
+ // This icon file is generated automatically.
6
+ var CalendarOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M880 184H712v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H384v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H144c-17.7 0-32 14.3-32 32v664c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V216c0-17.7-14.3-32-32-32zm-40 656H184V460h656v380zM184 392V256h128v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h256v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h128v136H184z" } }] }, "name": "calendar", "theme": "outlined" };
7
+ const CalendarOutlined$1 = CalendarOutlined;
8
+
9
+ // This icon file is generated automatically.
10
+ var DeleteFilled = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M864 256H736v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zm-200 0H360v-72h304v72z" } }] }, "name": "delete", "theme": "filled" };
11
+ const DeleteFilled$1 = DeleteFilled;
12
+
13
+ // This icon file is generated automatically.
14
+ var LeftOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z" } }] }, "name": "left", "theme": "outlined" };
15
+ const LeftOutlined$1 = LeftOutlined;
16
+
17
+ // This icon file is generated automatically.
18
+ var RightOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z" } }] }, "name": "right", "theme": "outlined" };
19
+ const RightOutlined$1 = RightOutlined;
20
+
21
+ var __assign = (undefined && undefined.__assign) || function () {
22
+ __assign = Object.assign || function(t) {
23
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
24
+ s = arguments[i];
25
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
26
+ t[p] = s[p];
27
+ }
28
+ return t;
29
+ };
30
+ return __assign.apply(this, arguments);
31
+ };
32
+ var defaultColors = {
33
+ primaryColor: '#333',
34
+ secondaryColor: '#E6E6E6'
35
+ };
36
+ function renderIconDefinitionToSVGElement(icond, options) {
37
+ if (options === void 0) { options = {}; }
38
+ if (typeof icond.icon === 'function') {
39
+ // two-tone
40
+ var placeholders = options.placeholders || defaultColors;
41
+ return renderAbstractNodeToSVGElement(icond.icon(placeholders.primaryColor, placeholders.secondaryColor), options);
42
+ }
43
+ // fill, outline
44
+ return renderAbstractNodeToSVGElement(icond.icon, options);
45
+ }
46
+ function renderAbstractNodeToSVGElement(node, options) {
47
+ var targetAttrs = node.tag === 'svg'
48
+ ? __assign(__assign({}, node.attrs), (options.extraSVGAttrs || {})) : node.attrs;
49
+ var attrs = Object.keys(targetAttrs).reduce(function (acc, nextKey) {
50
+ var key = nextKey;
51
+ var value = targetAttrs[key];
52
+ var token = "".concat(key, "=\"").concat(value, "\"");
53
+ acc.push(token);
54
+ return acc;
55
+ }, []);
56
+ var attrsToken = attrs.length ? ' ' + attrs.join(' ') : '';
57
+ var children = (node.children || [])
58
+ .map(function (child) { return renderAbstractNodeToSVGElement(child, options); })
59
+ .join('');
60
+ if (children && children.length) {
61
+ return "<".concat(node.tag).concat(attrsToken, ">").concat(children, "</").concat(node.tag, ">");
62
+ }
63
+ return "<".concat(node.tag).concat(attrsToken, " />");
64
+ }
65
+
66
+ const DEFAULT_LANGUAGE$3 = 'en';
67
+ const SUPPORTED_LANGUAGES$3 = ['ro', 'en', 'fr', 'ar', 'hr'];
68
+ const TRANSLATIONS$3 = {
69
+ en: {
70
+ weeks: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
71
+ },
72
+ };
73
+ const translate$3 = (key, customLang, replacements) => {
74
+ const lang = customLang;
75
+ let translation = TRANSLATIONS$3[lang !== undefined && SUPPORTED_LANGUAGES$3.includes(lang) ? lang : DEFAULT_LANGUAGE$3][key];
76
+ if (replacements) {
77
+ Object.keys(replacements).forEach((placeholder) => {
78
+ translation = translation.replace(`{${placeholder}}`, replacements[placeholder]);
79
+ });
80
+ }
81
+ return translation;
82
+ };
83
+ const getTranslations$2 = (data) => {
84
+ Object.keys(data).forEach((item) => {
85
+ for (let key in data[item]) {
86
+ TRANSLATIONS$3[item][key] = data[item][key];
87
+ }
88
+ });
89
+ };
90
+ const resolveTranslationUrl$2 = async (translationUrl) => {
91
+ if (translationUrl) {
92
+ try {
93
+ const response = await fetch(translationUrl);
94
+ if (!response.ok) {
95
+ throw new Error(`HTTP error! status: ${response.status}`);
96
+ }
97
+ const translations = await response.json();
98
+ getTranslations$2(translations);
99
+ }
100
+ catch (error) {
101
+ console.error('Failed to fetch or parse translations from URL:', error);
102
+ }
103
+ }
104
+ };
105
+
106
+ const helperDateNavigatorCss = ".lottery-tipping-calendar{position:relative;display:inline-block}.calendar-visible{opacity:1;visibility:visible}.calendar-leave{opacity:0;visibility:hidden}.calendar{position:absolute;top:40px;left:-50%;background:var(--emw--color-background, #fff);color:var(--emw--color-typography-secondary, #6f6f6f);padding:16px;width:fit-content;border:var(--emw--button-border, 1px solid rgba(221, 221, 221, 0.8666666667));border-radius:var(--emw--border-radius-small, 4px);box-shadow:2px 3px 5px rgba(0, 0, 0, 0.1);cursor:pointer;transition:opacity 0.2s ease, visibility 0.2s ease;z-index:99}.calendar-header{display:flex;align-items:center}.calendar-header .date-picker{display:flex;margin:0 18px;align-items:center}.calendar-header .date-picker-delimiter{font-size:16px;margin:auto 4px}.calendar-header .month-plus,.calendar-header .month-minus,.calendar-header .year-plus,.calendar-header .year-minus{cursor:pointer;font-size:14px}.calendar-header .month-plus:hover,.calendar-header .month-minus:hover,.calendar-header .year-plus:hover,.calendar-header .year-minus:hover{color:var(--emw-pool-game-acition-active, #005fdb);transition:color 0.2s}.calendar-header .year-minus,.calendar-header .month-plus{margin-right:6px}.calendar-content{padding:3px;width:fit-content}.calendar-content .day-item{text-align:center;line-height:40px;cursor:not-allowed;position:relative;pointer-events:none}.calendar-content .day-item:hover{background-color:var(--emw--color-background-secondary, #f5f5f5)}.calendar-content .day-item.isCurDay{border-radius:4px;background:var(--emw--color-secondary, #fff3b9);background-size:50%;color:var(--emw--color-typography-secondary, #6f6f6f);font-weight:600;box-shadow:2px 2px 2px var(--emw-calender-curday-box-shadow, rgba(0, 0, 0, 0.09));cursor:pointer;pointer-events:all}.calendar-content .day-item.isHighLight{cursor:pointer;pointer-events:all}.calendar-content .day-item.isHighLight::after{content:\"\";position:absolute;left:calc(50% - 4px);bottom:0;width:6px;height:6px;border-radius:50%;background-color:var(--emw--color-error, red)}.calendar-content-week{display:grid;grid-template-columns:repeat(7, 40px);grid-template-rows:repeat(1, 36px);justify-items:center;align-items:center;border-bottom:var(--emw--button-border, 1px solid rgba(221, 221, 221, 0.8666666667));color:var(--emw--color-typography-secondary, #6f6f6f)}.calendar-content-day{margin-top:4px;display:grid;grid-template-rows:repeat(6, 40px);grid-template-columns:repeat(7, 40px)}.calling-input{height:36px;width:160px;display:flex;align-items:center;justify-content:space-between;padding:0px 4px;background-color:var(--emw--color-background, #f5f5f5);border-radius:var(--emw--border-radius-small, 4px);border:var(--emw--button-border, 1px solid rgba(221, 221, 221, 0.8666666667));cursor:pointer}.calling-input .input{color:var(--emw--color-typography, #000)}.calling-input-text{color:var(--emw--color-typography, #000)}.date-selection{display:flex;align-items:center;justify-content:center;gap:24px}.date-selection-leftIcon,.date-selection-rightIcon{cursor:pointer;color:var(--emw--color-typography, #000)}";
107
+ const HelperDateNavigatorStyle0 = helperDateNavigatorCss;
108
+
109
+ const leftArrowIcon = renderIconDefinitionToSVGElement(LeftOutlined$1, {
110
+ extraSVGAttrs: { width: '16px', height: '16px', fill: 'currentColor' }
111
+ });
112
+ const rightArrowIcon = renderIconDefinitionToSVGElement(RightOutlined$1, {
113
+ extraSVGAttrs: { width: '16px', height: '16px', fill: 'currentColor' }
114
+ });
115
+ const calendarIcon = renderIconDefinitionToSVGElement(CalendarOutlined$1, {
116
+ extraSVGAttrs: { width: '18px', height: '18px', fill: 'var(--emw--color-primary-variant, #1367e7)' }
117
+ });
118
+ const HelperDateNavigator = class {
119
+ constructor(hostRef) {
120
+ registerInstance(this, hostRef);
121
+ this.changeDate = createEvent(this, "changeDate", 7);
122
+ this.handleNext = createEvent(this, "next", 7);
123
+ this.handlePrev = createEvent(this, "prev", 7);
124
+ this.handleOutsideClick = (event) => {
125
+ if (!this.showCalendar)
126
+ return;
127
+ const path = event.composedPath ? event.composedPath() : [];
128
+ // check if clicked on calendar
129
+ const isCalendarClick = path.includes(this.calendarRef);
130
+ // check if click select option
131
+ const isSelectOption = path.some((el) => {
132
+ var _a, _b;
133
+ return el instanceof HTMLElement &&
134
+ (((_a = el.getAttribute('part')) === null || _a === void 0 ? void 0 : _a.includes('item')) || ((_b = el.getAttribute('part')) === null || _b === void 0 ? void 0 : _b.includes('overlay')));
135
+ });
136
+ if (!isCalendarClick && !isSelectOption) {
137
+ this.showCalendar = false;
138
+ }
139
+ };
140
+ this.onYearMinus = () => {
141
+ const years = this.yearOptions.map((item) => Number(item.value));
142
+ if (this.alterDate.year - 1 < Math.min(...years))
143
+ return;
144
+ this.alterDate.year--;
145
+ this.loadRecords();
146
+ };
147
+ this.onYearPlus = () => {
148
+ const years = this.yearOptions.map((item) => Number(item.value));
149
+ if (this.alterDate.year + 1 > Math.max(...years))
150
+ return;
151
+ this.alterDate.year++;
152
+ this.loadRecords();
153
+ };
154
+ this.onMonthMinus = () => {
155
+ if (this.alterDate.month === 0) {
156
+ this.onYearMinus();
157
+ this.alterDate.month = 11;
158
+ }
159
+ else {
160
+ this.alterDate.month--;
161
+ this.loadRecords();
162
+ }
163
+ };
164
+ this.onMonthPlus = () => {
165
+ if (this.alterDate.month === 11) {
166
+ this.onYearPlus();
167
+ this.alterDate.month = 0;
168
+ }
169
+ else {
170
+ this.alterDate.month++;
171
+ this.loadRecords();
172
+ }
173
+ };
174
+ this.onYearChange = (e) => {
175
+ this.alterDate.year = parseInt(e.detail.value);
176
+ this.loadRecords();
177
+ };
178
+ this.onMonthChange = (e) => {
179
+ this.alterDate.month = parseInt(e.detail.value) - 1;
180
+ this.loadRecords();
181
+ };
182
+ this.mbSource = undefined;
183
+ this.clientStyling = undefined;
184
+ this.clientStylingUrl = undefined;
185
+ this.translationUrl = '';
186
+ this.language = 'en';
187
+ this.date = '';
188
+ this.defaultHighlightDates = undefined;
189
+ this.highlightDates = [];
190
+ this.weeks = undefined;
191
+ this.days = [];
192
+ this.alterDate = { year: 0, month: 0, day: 0 };
193
+ this.curDate = { year: 0, month: 0, day: 0 };
194
+ this.recordInfo = [];
195
+ this.showCalendar = false;
196
+ }
197
+ handleClientStylingChange(newValue, oldValue) {
198
+ if (newValue != oldValue) {
199
+ setClientStyling(this.stylingContainer, this.clientStyling);
200
+ }
201
+ }
202
+ handleClientStylingUrlChange(newValue, oldValue) {
203
+ if (newValue != oldValue) {
204
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
205
+ }
206
+ }
207
+ handleMbSourceChange(newValue, oldValue) {
208
+ if (newValue != oldValue) {
209
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
210
+ }
211
+ }
212
+ handleGameIdStringChange(newValue, oldValue) {
213
+ if (newValue != oldValue) {
214
+ this.setHighlightDates();
215
+ }
216
+ }
217
+ componentWillLoad() {
218
+ resolveTranslationUrl$2(this.translationUrl);
219
+ this.weeks = translate$3('weeks', this.language);
220
+ const d = this.date ? new Date(this.date) : new Date();
221
+ this.alterDate = { year: d.getFullYear(), month: d.getMonth(), day: d.getDate() };
222
+ this.curDate = Object.assign({}, this.alterDate);
223
+ this.loadRecords();
224
+ }
225
+ handleDateChange() {
226
+ const d = this.date ? new Date(this.date) : new Date();
227
+ this.alterDate = { year: d.getFullYear(), month: d.getMonth(), day: d.getDate() };
228
+ this.curDate = Object.assign({}, this.alterDate);
229
+ this.loadRecords();
230
+ }
231
+ setHighlightDates() {
232
+ if (this.defaultHighlightDates) {
233
+ try {
234
+ this.highlightDates = JSON.parse(this.defaultHighlightDates);
235
+ }
236
+ catch (_a) {
237
+ this.highlightDates = [];
238
+ }
239
+ }
240
+ }
241
+ componentDidLoad() {
242
+ if (this.stylingContainer) {
243
+ if (this.mbSource)
244
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
245
+ if (this.clientStyling)
246
+ setClientStyling(this.stylingContainer, this.clientStyling);
247
+ if (this.clientStylingUrl)
248
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
249
+ }
250
+ this.setHighlightDates();
251
+ document.addEventListener('click', this.handleOutsideClick);
252
+ }
253
+ disconnectedCallback() {
254
+ this.stylingSubscription && this.stylingSubscription.unsubscribe();
255
+ document.removeEventListener('click', this.handleOutsideClick);
256
+ }
257
+ get yearOptions() {
258
+ const years = Array.from({ length: 101 }, (_, i) => this.alterDate.year - 50 + i);
259
+ return years.map((item) => {
260
+ return {
261
+ label: String(item),
262
+ value: String(item)
263
+ };
264
+ });
265
+ }
266
+ get monthOptions() {
267
+ const months = Array.from({ length: 12 }, (_, i) => i + 1);
268
+ return months.map((item) => {
269
+ return {
270
+ label: String(item),
271
+ value: String(item)
272
+ };
273
+ });
274
+ }
275
+ loadRecords() {
276
+ const { year, month } = this.alterDate;
277
+ this.setDays(year, month);
278
+ }
279
+ setDays(year, month) {
280
+ this.days = [];
281
+ const firstDayOfMonth = new Date(year, month, 1);
282
+ const firstDayWeek = firstDayOfMonth.getDay();
283
+ const startDate = new Date(year, month, 1 - firstDayWeek);
284
+ for (let i = 0; i < 42; i++) {
285
+ const temp = new Date(startDate);
286
+ temp.setDate(startDate.getDate() + i);
287
+ const day = {
288
+ date: temp.getDate(),
289
+ month: temp.getMonth(),
290
+ year: temp.getFullYear()
291
+ };
292
+ this.days.push(day);
293
+ }
294
+ }
295
+ getFullDayOfMonth(year, month) {
296
+ return new Date(year, month, 0).getDate();
297
+ }
298
+ showFormatedDate(date) {
299
+ return `${date.day}/${date.month + 1}/${date.year}`;
300
+ }
301
+ handleSelectDate(curDay, curMonth, curYear) {
302
+ this.alterDate.day = curDay;
303
+ this.curDate = Object.assign({}, this.alterDate);
304
+ this.showCalendar = false;
305
+ const formattedHighLightArr = this.highlightDates.map((date) => {
306
+ const d = new Date(date);
307
+ return { year: d.getFullYear(), month: d.getMonth(), day: d.getDate() };
308
+ });
309
+ const idx = formattedHighLightArr.findIndex((obj) => {
310
+ const { year, month, day } = obj;
311
+ return curMonth === month && curYear === year && curDay === day;
312
+ });
313
+ if (idx > -1) {
314
+ this.changeDate.emit(idx);
315
+ }
316
+ }
317
+ tellIsCurDay(curDay, curMonth, curYear) {
318
+ return this.curDate.day === curDay && this.curDate.month === curMonth && this.curDate.year === curYear;
319
+ }
320
+ tellIsHighLight(curDay, curMonth, curYear) {
321
+ if (!this.highlightDates || !this.highlightDates.length)
322
+ return false;
323
+ const formattedHighLightArr = this.highlightDates.map((date) => {
324
+ const d = new Date(date);
325
+ return { year: d.getFullYear(), month: d.getMonth(), day: d.getDate() };
326
+ });
327
+ return formattedHighLightArr.some((obj) => {
328
+ const { year, month, day } = obj;
329
+ return curMonth === month && curYear === year && curDay === day;
330
+ });
331
+ }
332
+ renderInner() {
333
+ const calendarClass = ['calendar', this.showCalendar ? 'calendar-visible' : 'calendar-leave'];
334
+ return (h("div", { class: "lottery-tipping-calendar", ref: (el) => (this.calendarRef = el) }, h("div", { class: "calling-input", onClick: () => {
335
+ this.showCalendar = true;
336
+ } }, h("div", { class: "calling-input-text" }, this.showFormatedDate(this.curDate)), h("div", { class: "calling-input-icon", innerHTML: calendarIcon })), h("div", { class: calendarClass.join(' ') }, h("div", { class: "calendar-header" }, h("div", { class: "date-controller year-minus", onClick: this.onYearMinus }, "<"), h("div", { class: "date-controller month-minus", onClick: this.onMonthMinus }, "<"), h("div", { class: "date-picker" }, h("div", { class: "date-picker-year" }, h("vaadin-select", { items: this.yearOptions, value: this.alterDate.year, style: { '--vaadin-field-default-width': '90px' }, "on-value-changed": this.onYearChange.bind(this) })), h("div", { class: "date-picker-delimiter" }, "-"), h("div", { class: "date-picker-month" }, h("vaadin-select", { items: this.monthOptions, value: this.alterDate.month + 1, style: { '--vaadin-field-default-width': '64px' }, "on-value-changed": this.onMonthChange.bind(this) })), h("div", { class: "date-picker-delimiter" }, "-"), h("div", { class: "date-picker-day" }, this.alterDate.day)), h("div", { class: "date-controller month-plus", onClick: this.onMonthPlus }, ">"), h("div", { class: "date-controller year-plus", onClick: this.onYearPlus }, ">")), h("div", { class: "calendar-content" }, h("div", { class: "calendar-content-week" }, this.weeks.map((week) => (h("div", { class: "week-item" }, week)))), h("div", { class: "calendar-content-day" }, this.days.map((item) => (h("div", { class: {
337
+ 'day-item': true,
338
+ isCurDay: this.tellIsCurDay(item.date, item.month, item.year),
339
+ isHighLight: this.tellIsHighLight(item.date, item.month, item.year)
340
+ }, onClick: () => this.handleSelectDate(item.date, item.month, item.year) }, item.date))))))));
341
+ }
342
+ render() {
343
+ return (h("div", { key: 'da34c4c86cac49411fb15ab8bceda89e379befc6', class: "date-selection" }, h("div", { key: '29f06ef7a5df466018ae6561b54fcbdfbab9f23b', class: "date-selection-leftIcon", innerHTML: leftArrowIcon, onClick: () => this.handlePrev.emit() }), h("div", { key: 'c6d75d873c2683752c37d4083c57761c4f7e523b', class: "date-selection-calendar" }, this.renderInner()), h("div", { key: '8b16b3e0761dd4c877f169aea84d028aaf193b69', class: "date-selection-rightIcon", innerHTML: rightArrowIcon, onClick: () => this.handleNext.emit() })));
344
+ }
345
+ static get watchers() { return {
346
+ "clientStyling": ["handleClientStylingChange"],
347
+ "clientStylingUrl": ["handleClientStylingUrlChange"],
348
+ "mbSource": ["handleMbSourceChange"],
349
+ "defaultHighlightDates": ["handleGameIdStringChange"],
350
+ "date": ["handleDateChange"]
351
+ }; }
352
+ };
353
+ HelperDateNavigator.style = HelperDateNavigatorStyle0;
5
354
 
6
355
  var Bomb;
7
356
  (function (Bomb) {
@@ -345,6 +694,33 @@ function isValid(dirtyDate) {
345
694
  return !isNaN(Number(date));
346
695
  }
347
696
 
697
+ /**
698
+ * @name differenceInMilliseconds
699
+ * @category Millisecond Helpers
700
+ * @summary Get the number of milliseconds between the given dates.
701
+ *
702
+ * @description
703
+ * Get the number of milliseconds between the given dates.
704
+ *
705
+ * @param {Date|Number} dateLeft - the later date
706
+ * @param {Date|Number} dateRight - the earlier date
707
+ * @returns {Number} the number of milliseconds
708
+ * @throws {TypeError} 2 arguments required
709
+ *
710
+ * @example
711
+ * // How many milliseconds are between
712
+ * // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?
713
+ * const result = differenceInMilliseconds(
714
+ * new Date(2014, 6, 2, 12, 30, 21, 700),
715
+ * new Date(2014, 6, 2, 12, 30, 20, 600)
716
+ * )
717
+ * //=> 1100
718
+ */
719
+ function differenceInMilliseconds(dateLeft, dateRight) {
720
+ requiredArgs(2, arguments);
721
+ return toDate(dateLeft).getTime() - toDate(dateRight).getTime();
722
+ }
723
+
348
724
  /**
349
725
  * @name subMilliseconds
350
726
  * @category Millisecond Helpers
@@ -2617,7 +2993,7 @@ function validateTimezone(_hours, minutes) {
2617
2993
  return minutes >= 0 && minutes <= 59;
2618
2994
  }
2619
2995
 
2620
- function fetchRequest(url, method = 'GET', body = null, headers = {}) {
2996
+ function fetchRequest$3(url, method = 'GET', body = null, headers = {}) {
2621
2997
  return new Promise((resolve, reject) => {
2622
2998
  const headersOrigin = Object.assign({ 'Content-Type': 'application/json' }, headers);
2623
2999
  const options = {
@@ -2673,7 +3049,7 @@ function formattedTime(date) {
2673
3049
  const weekday = format(parsedDate, 'EEEE');
2674
3050
  return `${weekday} at ${hhmm}`;
2675
3051
  }
2676
- function toQueryParams(params) {
3052
+ function toQueryParams$2(params) {
2677
3053
  const finalParams = {};
2678
3054
  Object.entries(params).forEach(([key, value]) => {
2679
3055
  if (!isEmptyValue(value, true)) {
@@ -2741,7 +3117,7 @@ function isEmptyValueOfObject(obj) {
2741
3117
  return false;
2742
3118
  }
2743
3119
  const DEFAULT_ALL_BOMB = { name: 'All', code: 'All' };
2744
- function thousandSeparator(value) {
3120
+ function thousandSeparator$1(value) {
2745
3121
  if (value === 0) {
2746
3122
  return '0';
2747
3123
  }
@@ -2756,7 +3132,7 @@ function thousandSeparator(value) {
2756
3132
 
2757
3133
  async function fetchLiveDrawsByGroupId({ endpoint, groupId, params = {} }) {
2758
3134
  try {
2759
- const res = await fetchRequest(`${endpoint}/groups/${groupId}/liveDraws${toQueryParams(params)}`);
3135
+ const res = await fetchRequest$3(`${endpoint}/groups/${groupId}/liveDraws${toQueryParams$2(params)}`);
2760
3136
  return res;
2761
3137
  }
2762
3138
  catch (error) {
@@ -2764,16 +3140,16 @@ async function fetchLiveDrawsByGroupId({ endpoint, groupId, params = {} }) {
2764
3140
  return {};
2765
3141
  }
2766
3142
  }
2767
- async function fetchSaleStatistics({ endpoint, gameId, drawId }) {
3143
+ async function fetchSaleStatistics$1({ endpoint, gameId, drawId }) {
2768
3144
  try {
2769
- const res = await fetchRequest(`${endpoint}/games/${gameId}/draws/${drawId}/saleStatistics`);
3145
+ const res = await fetchRequest$3(`${endpoint}/games/${gameId}/draws/${drawId}/saleStatistics`);
2770
3146
  return res;
2771
3147
  }
2772
3148
  catch (error) {
2773
3149
  return Promise.reject(error);
2774
3150
  }
2775
3151
  }
2776
- async function fetchData({ endpoint, groupId, params }) {
3152
+ async function fetchData$1({ endpoint, groupId, params }) {
2777
3153
  try {
2778
3154
  const { sportTags = [], liveDraws = [] } = await fetchLiveDrawsByGroupId({
2779
3155
  endpoint,
@@ -2805,7 +3181,7 @@ async function getTurnoverForAll({ endpoint, configs }) {
2805
3181
  const fallback = { turnover: formattedTurnover(null) };
2806
3182
  const promises = configs.map(async ({ gameId, drawId }) => {
2807
3183
  var _a;
2808
- const res = await fetchSaleStatistics({
3184
+ const res = await fetchSaleStatistics$1({
2809
3185
  endpoint: endpoint,
2810
3186
  gameId,
2811
3187
  drawId
@@ -2815,9 +3191,9 @@ async function getTurnoverForAll({ endpoint, configs }) {
2815
3191
  const results = await Promise.allSettled(promises);
2816
3192
  return results.map((r) => (r.status === 'fulfilled' ? r.value : fallback));
2817
3193
  }
2818
- async function fetchGameInfo(endpoint, gameId) {
3194
+ async function fetchGameInfo$1(endpoint, gameId) {
2819
3195
  try {
2820
- const response = await fetchRequest(`${endpoint}/games/${gameId}`, 'GET', {});
3196
+ const response = await fetchRequest$3(`${endpoint}/games/${gameId}`, 'GET', {});
2821
3197
  return response;
2822
3198
  }
2823
3199
  catch (error) {
@@ -2825,9 +3201,9 @@ async function fetchGameInfo(endpoint, gameId) {
2825
3201
  throw new Error('The game is currently not available. Please try again later.');
2826
3202
  }
2827
3203
  }
2828
- async function fetchTicketMatch({ endpoint, gameId, drawId }) {
3204
+ async function fetchTicketMatch$1({ endpoint, gameId, drawId }) {
2829
3205
  try {
2830
- const res = await fetchRequest(`${endpoint}/poolgames/${gameId}/draws/${drawId}/matchConfig`);
3206
+ const res = await fetchRequest$3(`${endpoint}/poolgames/${gameId}/draws/${drawId}/matchConfig`);
2831
3207
  return res || [];
2832
3208
  }
2833
3209
  catch (e) {
@@ -2838,12 +3214,12 @@ async function fetchTicketMatch({ endpoint, gameId, drawId }) {
2838
3214
  function formattedTurnover(turnover, unit = '€') {
2839
3215
  if (turnover === null)
2840
3216
  return '';
2841
- return `${unit}${turnover ? thousandSeparator(turnover) : 0}`;
3217
+ return `${unit}${turnover ? thousandSeparator$1(turnover) : 0}`;
2842
3218
  }
2843
3219
 
2844
- const DEFAULT_LANGUAGE = 'en';
2845
- const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'ar', 'hr'];
2846
- const TRANSLATIONS = {
3220
+ const DEFAULT_LANGUAGE$2 = 'en';
3221
+ const SUPPORTED_LANGUAGES$2 = ['ro', 'en', 'fr', 'ar', 'hr'];
3222
+ const TRANSLATIONS$2 = {
2847
3223
  en: {
2848
3224
  logout: 'Log out',
2849
3225
  draws: 'DRAWS',
@@ -2896,15 +3272,15 @@ const TRANSLATIONS = {
2896
3272
  instructionContent: 'Sadržaj uputa ide ovdje.'
2897
3273
  }
2898
3274
  };
2899
- const translate = (key, customLang) => {
3275
+ const translate$2 = (key, customLang) => {
2900
3276
  const lang = customLang;
2901
- return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
3277
+ return TRANSLATIONS$2[lang !== undefined && SUPPORTED_LANGUAGES$2.includes(lang) ? lang : DEFAULT_LANGUAGE$2][key];
2902
3278
  };
2903
3279
 
2904
3280
  const lotteryOddsbomBombCss = "/* --- Component: Bomb Card Grid --- */\n.lottery-oddsbom-bomb-wrapper {\n background: var(--emw--color-background, #fff);\n color: var(--emw--color-typography, #000);\n height: 100%;\n}\n\n.bomb-grid-container {\n margin-top: 20px;\n width: 100%;\n display: flex;\n justify-content: center;\n container-type: inline-size;\n container-name: bomb-grid;\n background: var(--emw--color-background, #fff);\n color: var(--emw--color-typography, #000);\n /* --- Component: Bomb Card --- */\n}\n.bomb-grid-container .bomb-grid {\n display: grid;\n grid-template-columns: repeat(2, minmax(0, 1fr));\n gap: 0.75rem;\n place-items: center;\n}\n.bomb-grid-container .bomb-card-wrapper {\n width: 100%;\n max-width: 30rem;\n height: 100%;\n box-sizing: border-box;\n border-radius: 8px;\n padding: 1rem;\n border: 1px solid var(--emw--color-gray-100, #e6e6e6);\n}\n.bomb-grid-container .bomb-card {\n height: 100%;\n min-width: 24rem;\n transition: transform 0.3s;\n}\n.bomb-grid-container .bomb-card:hover {\n transform: scale(1.02);\n cursor: pointer;\n}\n.bomb-grid-container .card-header {\n display: flex;\n align-items: center;\n gap: 1rem;\n margin-bottom: 0.8rem;\n}\n.bomb-grid-container .card-icon {\n width: 48px;\n height: 48px;\n border-radius: 50%;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.bomb-grid-container .card-icon svg {\n width: 28px;\n height: 28px;\n}\n.bomb-grid-container .card-title {\n flex-grow: 1;\n word-break: break-all;\n}\n.bomb-grid-container .card-title h2 {\n margin: 0;\n font-size: 1.25rem;\n font-weight: 700;\n word-wrap: break-word;\n}\n.bomb-grid-container .card-title p {\n margin: 0;\n color: var(--emw--color-typography-secondary, #333);\n font-size: 0.9rem;\n word-wrap: break-word;\n}\n.bomb-grid-container .card-info {\n display: flex;\n gap: 0.75rem;\n margin-bottom: 0.8rem;\n flex-wrap: wrap;\n}\n.bomb-grid-container .card-tag {\n background-color: var(--emw--color-tertiary, #e3f2fd);\n padding: 0.3rem 0.75rem;\n border-radius: 4px;\n font-size: 0.85rem;\n font-weight: 500;\n max-width: 120px;\n}\n.bomb-grid-container .card-matches {\n max-height: 6.8rem;\n overflow-y: auto;\n}\n.bomb-grid-container .card-matches ol {\n margin: 0;\n padding-left: 1.25rem;\n font-size: 0.85rem;\n line-height: 1.6;\n}\n.bomb-grid-container .card-matches li {\n padding-left: 0.2rem;\n word-wrap: break-word;\n}\n\n/* --- CONTAINER QUERIES FOR RESPONSIVENESS --- */\n@container bomb-grid (max-width: 768px) {\n .bomb-grid-container .bomb-grid {\n /* On smaller containers, switch to a single column */\n grid-template-columns: 1fr;\n }\n .bomb-card-wrapper .bomb-card {\n min-width: 200px;\n }\n}\n/* --- Component: Filter Controls --- */\n.OddsbomEntranceController__section {\n margin-top: 1.5rem;\n display: flex;\n gap: 12px;\n color: var(--emw--color-typography, #000);\n container-type: inline-size;\n container-name: controller;\n justify-content: center;\n}\n.OddsbomEntranceController__label {\n font-weight: 500;\n white-space: nowrap;\n width: 6rem;\n line-height: 2.2rem;\n}\n.OddsbomEntranceController__segmented-control {\n display: inline-flex;\n gap: 1rem;\n flex-wrap: wrap;\n}\n.OddsbomEntranceController__segment {\n height: 2.2rem;\n border: none;\n padding: 0.3rem 0.8rem;\n cursor: pointer;\n font-weight: 500;\n border-radius: 2rem;\n outline: none;\n white-space: nowrap;\n background-color: var(--emw--color-background, #ffffff);\n color: var(--emw--color-typography, #000);\n}\n.OddsbomEntranceController__segment--active {\n background-color: var(--emw--color-primary-variant, #1367e7);\n color: var(--emw--color-typography-reverse, #fff);\n font-weight: 600;\n}\n.OddsbomEntranceController__segment--disabled:hover {\n cursor: not-allowed !important;\n}\n.OddsbomEntranceController__segment:not(.OddsbomEntranceController__segment--active):hover {\n background-color: var(--emw--color-background-tertiary, #ccc);\n}\n\n.skeleton-content {\n display: flex;\n flex-direction: column;\n gap: 29px;\n align-items: center;\n}\n\n.skeleton-item {\n background: var(--emw--color-background-secondary, #f5f5f5);\n border-radius: 4px;\n height: 40px;\n width: 200px;\n}\n\n.skeleton-animated {\n animation: skeleton-shimmer 1.5s infinite linear;\n background: linear-gradient(90deg, var(--emw--color-background-secondary, #f5f5f5) 25%, var(--emw--color-background-tertiary, #ccc) 37%, var(--emw--color-background-secondary, #f5f5f5) 63%);\n background-size: 200% 100%;\n}\n\n@keyframes skeleton-shimmer {\n to {\n background-position: 100% 0;\n }\n}\n.loading-icon.scale {\n animation: scale 1s infinite ease-in-out;\n}\n\n@keyframes scale {\n 0%, 100% {\n transform: scale(1);\n }\n 50% {\n transform: scale(1.2);\n }\n}\n@container controller (max-width: 500px) {\n .OddsbomEntranceController__segmented-control {\n gap: 0rem;\n }\n .OddsbomEntranceController__segment {\n padding: 0.2rem 0.6rem;\n }\n .OddsbomEntranceController__label,\n .OddsbomEntranceController____segment {\n line-height: 1.8rem;\n }\n}\n.loading-wrap {\n margin: 20px 0;\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 100px;\n}\n.loading-wrap .dots-container {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n}\n.loading-wrap .dot {\n height: 14px;\n width: 14px;\n margin-right: 14px;\n border-radius: 14px;\n background-color: var(--emw--color-gray-300, #333);\n animation: pulse 1.5s infinite ease-in-out;\n}\n.loading-wrap .dot:last-child {\n margin-right: 0;\n}\n.loading-wrap .dot:nth-child(1) {\n animation-delay: -0.3s;\n}\n.loading-wrap .dot:nth-child(2) {\n animation-delay: -0.1s;\n}\n.loading-wrap .dot:nth-child(3) {\n animation-delay: 0.1s;\n}\n@keyframes pulse {\n 0% {\n transform: scale(0.8);\n background-color: var(--emw--color-gray-300, #333);\n }\n 50% {\n transform: scale(1.2);\n background-color: var(--emw--color-gray-100, #e6e6e6);\n }\n 100% {\n transform: scale(0.8);\n background-color: var(--emw--color-gray-150, #6f6f6f);\n }\n}\n\n.empty-draw-wrap {\n padding-top: 100px;\n}\n.empty-draw-wrap .empty-draw {\n width: 240px;\n height: 160px;\n padding: 18px 12px 12px 12px;\n background: var(--emw--color-secondary-variant, #e3f2fd);\n position: relative;\n margin: 0 auto;\n display: flex;\n justify-content: center;\n align-items: center;\n text-align: center;\n border-radius: 12px;\n}\n.empty-draw-wrap .empty-draw img {\n position: absolute;\n top: -64%;\n left: 50%;\n transform: translateX(-50%);\n width: 200px;\n}\n.empty-draw-wrap .empty-draw-content {\n display: flex;\n gap: 4px;\n}\n.empty-draw-wrap .empty-draw-text {\n font-size: 14px;\n font-weight: bold;\n line-height: 20px;\n}";
2905
3281
  const LotteryOddsbomBombStyle0 = lotteryOddsbomBombCss;
2906
3282
 
2907
- const BombIcons = {
3283
+ const BombIcons$1 = {
2908
3284
  [Bomb.Football]: (h("svg", { height: "18px", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", class: "text-sm" }, h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M19.063 19.072l-.81-.97-.117.083.385-2.43.136-.211 2.23-3.464.037-.057h1.075a9.964 9.964 0 01-2.936 7.049zM4.769 5.112l2.8.877-.072 3.246-2.427 2.95-1.561-.153L2.39 9.26a9.977 9.977 0 012.378-4.148zm7.745-3.086l-.72 1.645-3.798 1.404-2.395-.75A9.953 9.953 0 0112 2c.174 0 .343.017.514.026zm7.346 3.812l-1.128 1.29-3.402-.755-.033-.008-2.446-2.241.057.016.862-1.973a9.996 9.996 0 016.09 3.67zm-1.87 8.894l-3.385-.493-1.358-4.067 2.173-2.755 3.144.698 1.347 3.634-1.921 2.983zm-4.64 5.787l4.304-1.486.62.742a9.945 9.945 0 01-5.878 2.205l.954-1.461zm-6.314-2.84l3.91.873-.001.003 1.509 1.507-1.24 1.898a9.946 9.946 0 01-5.908-2.553l1.73-1.728zm1.16-7.72l4.168.725 1.302 3.9-2.552 2.98-3.97-.885-1.412-3.724L8.196 9.96zM2 12c0-.31.019-.615.047-.92l.485 1.203-.454.907A9.934 9.934 0 012 11.999zM12 1C5.934 1 1 5.935 1 12c0 6.067 4.935 11 11 11 6.066 0 11-4.933 11-11 0-6.065-4.934-11-11-11z", fill: "currentColor" })))
2909
3285
  };
2910
3286
  const LotteryOddsbomBomb = class {
@@ -2980,7 +3356,7 @@ const LotteryOddsbomBomb = class {
2980
3356
  async fetchSingleGameData() {
2981
3357
  var _a, _b, _c;
2982
3358
  const { endpoint, gameId } = this;
2983
- const gameInfo = await fetchGameInfo(endpoint, gameId);
3359
+ const gameInfo = await fetchGameInfo$1(endpoint, gameId);
2984
3360
  const wagerCloseTime = (_a = gameInfo === null || gameInfo === void 0 ? void 0 : gameInfo.currentDraw) === null || _a === void 0 ? void 0 : _a.wagerCloseTime;
2985
3361
  const drawId = (_b = gameInfo === null || gameInfo === void 0 ? void 0 : gameInfo.currentDraw) === null || _b === void 0 ? void 0 : _b.id;
2986
3362
  if (!wagerCloseTime || new Date() >= new Date(wagerCloseTime)) {
@@ -2989,7 +3365,7 @@ const LotteryOddsbomBomb = class {
2989
3365
  }
2990
3366
  else {
2991
3367
  this.isGameAvailable = true;
2992
- const matchInfo = await fetchTicketMatch({ endpoint, gameId: gameInfo.type, drawId });
3368
+ const matchInfo = await fetchTicketMatch$1({ endpoint, gameId: gameInfo.type, drawId });
2993
3369
  this.gameList = [
2994
3370
  {
2995
3371
  drawId,
@@ -3006,7 +3382,7 @@ const LotteryOddsbomBomb = class {
3006
3382
  this.bombList = [];
3007
3383
  }
3008
3384
  async fetchGroupData(params) {
3009
- this.liveDrawsInfoByGroupId = await fetchData({
3385
+ this.liveDrawsInfoByGroupId = await fetchData$1({
3010
3386
  endpoint: this.endpoint,
3011
3387
  groupId: this.groupId,
3012
3388
  params
@@ -3038,7 +3414,7 @@ const LotteryOddsbomBomb = class {
3038
3414
  }
3039
3415
  renderEmpty() {
3040
3416
  const infoImagePath = getAssetPath('../static/empty-info.svg');
3041
- const message = translate('gameNotAvailable', this.language);
3417
+ const message = translate$2('gameNotAvailable', this.language);
3042
3418
  return (h("div", { class: "empty-draw-wrap" }, h("div", { class: "empty-draw" }, h("img", { src: infoImagePath, class: "empty-draw-logo" }), h("div", { class: "empty-draw-content" }, h("div", { class: "empty-draw-text" }, "\u24D8 ", message)))));
3043
3419
  }
3044
3420
  renderFilter() {
@@ -3054,7 +3430,7 @@ const LotteryOddsbomBomb = class {
3054
3430
  return this.renderEmpty();
3055
3431
  return (h("div", { class: "bomb-grid" }, this.gameList.map(({ title, subTitle, icon, date, turnover, matchList, drawId, gameId }) => (h("div", { class: "bomb-card-wrapper" }, h("div", { class: "bomb-card", onClick: () => {
3056
3432
  this.handleBombItemClick.emit({ drawId, gameId });
3057
- } }, h("div", { class: "card-header" }, BombIcons[icon] && h("div", { class: "card-icon football" }, BombIcons[icon]), h("div", { class: "card-title" }, h("h2", null, title), h("p", null, subTitle)), h("div", { class: "card-jackpot" })), h("div", { class: "card-info" }, h("span", { class: "card-tag" }, date), h("span", { class: "card-tag" }, translate('turnover', this.language) + turnover)), h("div", { class: "card-matches" }, h("ol", null, matchList.map((item) => (h("li", null, item)))))))))));
3433
+ } }, h("div", { class: "card-header" }, BombIcons$1[icon] && h("div", { class: "card-icon football" }, BombIcons$1[icon]), h("div", { class: "card-title" }, h("h2", null, title), h("p", null, subTitle)), h("div", { class: "card-jackpot" })), h("div", { class: "card-info" }, h("span", { class: "card-tag" }, date), h("span", { class: "card-tag" }, translate$2('turnover', this.language) + turnover)), h("div", { class: "card-matches" }, h("ol", null, matchList.map((item) => (h("li", null, item)))))))))));
3058
3434
  }
3059
3435
  render() {
3060
3436
  return (h("div", { key: '4a2641a511f0837649cfedeb4807069ce4051731', ref: (el) => (this.stylingContainer = el), class: "lottery-oddsbom-bomb-wrapper" }, this.renderFilter(), h("div", { key: '15f8dbeace39a87f87e4639b8082719023d6bed5', class: "bomb-grid-container" }, this.isLoading ? this.renderLoading() : this.renderMain())));
@@ -3068,4 +3444,1482 @@ const LotteryOddsbomBomb = class {
3068
3444
  };
3069
3445
  LotteryOddsbomBomb.style = LotteryOddsbomBombStyle0;
3070
3446
 
3071
- export { LotteryOddsbomBomb as lottery_oddsbom_bomb };
3447
+ const lotteryOddsbomBulletCss = ".OddsbomBullet .OddsbomBulletBtn__normal{width:32px;height:32px;display:flex;align-items:center;justify-content:center;background:var(--emw--color-background, #fff);border:2px solid var(--emw--color-primary, #0d196e);border-radius:var(--emw--border-radius-medium, 8px);color:var(--emw--color-typography, #000);font-weight:bold;cursor:pointer;transition:transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.2s ease, background-color 0.3s;user-select:none;position:relative}.OddsbomBullet .OddsbomBulletBtn__normal:hover{transform:scale(1.15) rotate(-5deg);box-shadow:var(--emw--button-box-shadow-color-secondary, rgba(0, 0, 0, 0.15)) 7px 6px 6px}.OddsbomBullet .OddsbomBulletBtn__normal .OddsbomBullet--deleteIcon{display:none}.OddsbomBullet .OddsbomBulletBtn__normal.isDeleteByIcon:hover{background-color:var(--emw--color-background, #fff)}.OddsbomBullet .OddsbomBulletBtn__normal.isDeleteByIcon:hover .OddsbomBullet--text{display:none}.OddsbomBullet .OddsbomBulletBtn__normal.isDeleteByIcon:hover .OddsbomBullet--deleteIcon{display:inline;fill:var(--emw--color-typography, #000)}.OddsbomBullet .OddsbomBulletBtn__normal.isCallDialogBtn:hover{transform:none;box-shadow:none}.OddsbomBullet .OddsbomBulletBtn__normal.OddsbomBulletBtn__selected{background-color:var(--emw--color-primary, #0d196e);color:var(--emw--color-typography-inverse, #fff);transform:scale(1.05);box-shadow:0 5px 10px var(--emw--button-box-shadow-color-secondary, rgba(0, 0, 0, 0.15))}.OddsbomBullet .OddsbomBulletBtn__normal.OddsbomBulletBtn__disabled{background-color:var(--emw--color-gray-50, #f5f5f5);border-color:var(--emw--color-gray-100, #e6e6e6);color:var(--emw--color-gray-150, #6f6f6f);cursor:not-allowed;transform:none;box-shadow:none}.OddsbomBullet .OddsbomBulletBtn__normal.OddsbomBulletBtn__disabled:hover{transform:none;box-shadow:none}";
3448
+ const LotteryOddsbomBulletStyle0 = lotteryOddsbomBulletCss;
3449
+
3450
+ const DeleteFilledIcon = renderIconDefinitionToSVGElement(DeleteFilled$1, {
3451
+ extraSVGAttrs: { width: '18px', height: '18px', fill: '' }
3452
+ });
3453
+ const LotteryOddsbomBullet = class {
3454
+ constructor(hostRef) {
3455
+ registerInstance(this, hostRef);
3456
+ this.oddsbomBulletToggleEvent = createEvent(this, "oddsbomBulletToggle", 7);
3457
+ this.oddsbomBulletDeleteEvent = createEvent(this, "oddsbomBulletDelete", 7);
3458
+ this.oddsbomBulletAddedByMoreBtnDeleteEvent = createEvent(this, "oddsbomBulletAddedByMoreBtnDelete", 7);
3459
+ this.oddsbomBulletCallDialogEvent = createEvent(this, "oddsbomBulletCallDialog", 7);
3460
+ this.isSelected = undefined;
3461
+ this.disabled = undefined;
3462
+ this.text = undefined;
3463
+ this.idx = undefined;
3464
+ this.isReading = undefined;
3465
+ this.isDeleteByIcon = undefined;
3466
+ this.isCallDialogBtn = undefined;
3467
+ this.isAddedByMoreBtn = undefined;
3468
+ this.mbSource = undefined;
3469
+ this.clientStyling = undefined;
3470
+ this.clientStylingUrl = undefined;
3471
+ }
3472
+ handleClientStylingChange(newValue, oldValue) {
3473
+ if (newValue != oldValue) {
3474
+ setClientStyling(this.stylingContainer, this.clientStyling);
3475
+ }
3476
+ }
3477
+ handleClientStylingUrlChange(newValue, oldValue) {
3478
+ if (newValue != oldValue) {
3479
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
3480
+ }
3481
+ }
3482
+ handleMbSourceChange(newValue, oldValue) {
3483
+ if (newValue != oldValue) {
3484
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
3485
+ }
3486
+ }
3487
+ componentDidLoad() {
3488
+ if (this.stylingContainer) {
3489
+ if (this.mbSource)
3490
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
3491
+ if (this.clientStyling)
3492
+ setClientStyling(this.stylingContainer, this.clientStyling);
3493
+ if (this.clientStylingUrl)
3494
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
3495
+ }
3496
+ }
3497
+ disconnectedCallback() {
3498
+ this.stylingSubscription && this.stylingSubscription.unsubscribe();
3499
+ }
3500
+ handleClick() {
3501
+ if (this.isCallDialogBtn) {
3502
+ this.oddsbomBulletCallDialogEvent.emit();
3503
+ return;
3504
+ }
3505
+ if (this.isDeleteByIcon) {
3506
+ if (this.isAddedByMoreBtn) {
3507
+ this.oddsbomBulletAddedByMoreBtnDeleteEvent.emit(this.text);
3508
+ }
3509
+ else {
3510
+ this.oddsbomBulletDeleteEvent.emit(this.idx);
3511
+ }
3512
+ return;
3513
+ }
3514
+ if (!this.disabled) {
3515
+ this.oddsbomBulletToggleEvent.emit(this.idx);
3516
+ }
3517
+ }
3518
+ render() {
3519
+ return (h("div", { key: 'e21cf46108e35dcbf7d65e8c6a5f12f5d5ae49cb', class: "OddsbomBullet", ref: (el) => (this.stylingContainer = el) }, h("button", { key: '4edf5cd481d8283bd71f6806b6f93949e1308095', class: {
3520
+ OddsbomBulletBtn__normal: true,
3521
+ OddsbomBulletBtn__selected: this.isSelected,
3522
+ OddsbomBulletBtn__disabled: this.disabled,
3523
+ isDeleteByIcon: this.isDeleteByIcon,
3524
+ isCallDialogBtn: this.isCallDialogBtn || this.isReading
3525
+ }, onClick: this.handleClick.bind(this), disabled: this.disabled }, h("span", { key: 'fa1aed0293dc004808e6992c069d6992317b0788', class: "OddsbomBullet--deleteIcon", innerHTML: DeleteFilledIcon }), h("span", { key: '53ed96f2c2b833d21488049f987b6131718d563e', class: "OddsbomBullet--text" }, this.text))));
3526
+ }
3527
+ static get watchers() { return {
3528
+ "clientStyling": ["handleClientStylingChange"],
3529
+ "clientStylingUrl": ["handleClientStylingUrlChange"],
3530
+ "mbSource": ["handleMbSourceChange"]
3531
+ }; }
3532
+ };
3533
+ LotteryOddsbomBullet.style = LotteryOddsbomBulletStyle0;
3534
+
3535
+ const generateUUID$1 = () => {
3536
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
3537
+ var r = (Math.random() * 16) | 0, v = c == 'x' ? r : (r & 0x3) | 0x8;
3538
+ return v.toString(16);
3539
+ });
3540
+ };
3541
+ function fetchRequest$2(url, method = 'GET', body = null, headers = {}) {
3542
+ return new Promise((resolve, reject) => {
3543
+ const uuid = generateUUID$1();
3544
+ const headersOrigin = Object.assign({ 'Content-Type': 'application/json' }, headers);
3545
+ if (method !== 'GET' && method !== 'HEAD') {
3546
+ headersOrigin['X-Idempotency-Key'] = uuid;
3547
+ }
3548
+ const options = {
3549
+ method,
3550
+ headers: headersOrigin,
3551
+ body: null
3552
+ };
3553
+ if (body && method !== 'GET' && method !== 'HEAD') {
3554
+ options.body = JSON.stringify(body);
3555
+ }
3556
+ else {
3557
+ delete options.body;
3558
+ }
3559
+ fetch(url, options)
3560
+ .then((response) => {
3561
+ if (!response.ok) {
3562
+ reject(`HTTP error! Status: ${response.status}`);
3563
+ throw new Error(`HTTP error! Status: ${response.status}`);
3564
+ }
3565
+ return response.json();
3566
+ })
3567
+ .then((data) => resolve(data))
3568
+ .catch((error) => reject(error));
3569
+ });
3570
+ }
3571
+ function toQueryParams$1(params) {
3572
+ function isEmptyValueOfArray(arr) {
3573
+ if (arr.length === 0) {
3574
+ return true;
3575
+ }
3576
+ const len = arr.length;
3577
+ let count = 0;
3578
+ for (let i = 0; i < len; i++) {
3579
+ if (isEmptyValue(arr[i])) {
3580
+ count++;
3581
+ }
3582
+ else {
3583
+ return false;
3584
+ }
3585
+ }
3586
+ if (count === len) {
3587
+ return true;
3588
+ }
3589
+ return false;
3590
+ }
3591
+ function isEmptyValueOfObject(obj) {
3592
+ if (Object.keys(obj).length === 0) {
3593
+ return true;
3594
+ }
3595
+ const len = Object.keys(obj).length;
3596
+ let count = 0;
3597
+ for (const val of Object.values(obj)) {
3598
+ if (isEmptyValue(val)) {
3599
+ count++;
3600
+ }
3601
+ else {
3602
+ return false;
3603
+ }
3604
+ }
3605
+ if (count === len) {
3606
+ return true;
3607
+ }
3608
+ return false;
3609
+ }
3610
+ function isEmptyValue(value, allowZero) {
3611
+ if (value === null || value === undefined || value === '') {
3612
+ return true;
3613
+ }
3614
+ else if (value === 0 && allowZero) {
3615
+ return false;
3616
+ }
3617
+ else if (Array.isArray(value)) {
3618
+ return isEmptyValueOfArray(value);
3619
+ }
3620
+ else if (Object.prototype.toString.call(value) === '[object Object]') {
3621
+ return isEmptyValueOfObject(value);
3622
+ }
3623
+ else {
3624
+ return !value;
3625
+ }
3626
+ }
3627
+ const finalParams = {};
3628
+ Object.entries(params).forEach(([key, value]) => {
3629
+ if (!isEmptyValue(value, true)) {
3630
+ finalParams[key] = value;
3631
+ }
3632
+ });
3633
+ const queryString = Object.entries(finalParams)
3634
+ .map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`)
3635
+ .join('&');
3636
+ return queryString ? `?${queryString}` : '';
3637
+ }
3638
+ function transformResults(results) {
3639
+ if (results && results.length > 0) {
3640
+ return results.map((i) => i === null || i === void 0 ? void 0 : i[0]);
3641
+ }
3642
+ return [[]];
3643
+ }
3644
+ function thousandSeparator(value) {
3645
+ if (value === 0) {
3646
+ return '0';
3647
+ }
3648
+ if (!value) {
3649
+ return '';
3650
+ }
3651
+ value = value.toString();
3652
+ const parts = value.split('.');
3653
+ parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',');
3654
+ return parts.join('.');
3655
+ }
3656
+ function changeCurDrawItemByDate(date, drawList) {
3657
+ var _a, _b, _c;
3658
+ const curDrawItem = drawList.find((i) => i.date === date);
3659
+ if (!curDrawItem) {
3660
+ // NO DATA
3661
+ return Promise.reject();
3662
+ }
3663
+ const curDrawSelectionBettingType = curDrawItem.winningNumbers[0].winningScope;
3664
+ const curDrawSelectionMap = {};
3665
+ curDrawItem.winningNumbers.forEach((item) => {
3666
+ curDrawSelectionMap[item.winningScope] = transformResults(item.poolGameOutcomes);
3667
+ });
3668
+ const results = curDrawSelectionMap[curDrawSelectionBettingType];
3669
+ const curPrizeMap = {};
3670
+ curDrawItem.prizes.forEach((prize) => {
3671
+ const winningScope = prize.winningScope;
3672
+ if (!curPrizeMap[winningScope]) {
3673
+ curPrizeMap[winningScope] = [prize];
3674
+ }
3675
+ else {
3676
+ curPrizeMap[winningScope].push(prize);
3677
+ curPrizeMap[winningScope].sort((a, b) => { var _a; return ((_a = b.totalAmount) === null || _a === void 0 ? void 0 : _a.value) - (a === null || a === void 0 ? void 0 : a.totalAmount.value); });
3678
+ }
3679
+ });
3680
+ const prizes = (((_a = Object.values(curPrizeMap)) === null || _a === void 0 ? void 0 : _a[0]) || []);
3681
+ const currency = ((_c = (_b = prizes[0]) === null || _b === void 0 ? void 0 : _b.totalAmount) === null || _c === void 0 ? void 0 : _c.currency) || '';
3682
+ const { turnOver, winNumber, winTurnOver } = prizes.reduce((pre, cur) => {
3683
+ var _a;
3684
+ const { turnOver: _turnOver, winNumber: _winNumber, winTurnOver: _winTurnOver } = pre;
3685
+ // FIXME: no turnover
3686
+ const turnOver = 0;
3687
+ const winNumber = _winNumber + Number(cur === null || cur === void 0 ? void 0 : cur.players);
3688
+ const winTurnOver = _turnOver + Number((_a = cur === null || cur === void 0 ? void 0 : cur.totalAmount) === null || _a === void 0 ? void 0 : _a.value);
3689
+ return {
3690
+ turnOver,
3691
+ winNumber,
3692
+ winTurnOver
3693
+ };
3694
+ }, {
3695
+ turnOver: 0,
3696
+ winNumber: 0,
3697
+ winTurnOver: 0
3698
+ });
3699
+ return Promise.resolve({
3700
+ date,
3701
+ formattedTurnOver: currency + ' ' + thousandSeparator(turnOver),
3702
+ winNumber,
3703
+ formattedWinTurnOver: currency + ' ' + thousandSeparator(winTurnOver),
3704
+ drawId: curDrawItem.id,
3705
+ results
3706
+ });
3707
+ }
3708
+ function findLatestDateIdx$1(dateArr) {
3709
+ const currentDate = new Date();
3710
+ let closestIndex = 0;
3711
+ let minDiff = Infinity;
3712
+ dateArr.forEach((dateStr, index) => {
3713
+ const date = new Date(dateStr);
3714
+ const diff = Math.abs(differenceInMilliseconds(currentDate, date));
3715
+ if (diff < minDiff) {
3716
+ minDiff = diff;
3717
+ closestIndex = index;
3718
+ }
3719
+ });
3720
+ return closestIndex;
3721
+ }
3722
+
3723
+ async function fetchGameInfo({ endpoint, gameId }) {
3724
+ if (!(endpoint && gameId))
3725
+ return;
3726
+ const gameInfo = await fetchRequest$2(`${endpoint}/games/${gameId}`, 'GET', {});
3727
+ return {
3728
+ vendorGameId: gameInfo === null || gameInfo === void 0 ? void 0 : gameInfo.type,
3729
+ gameName: gameInfo.name
3730
+ };
3731
+ }
3732
+ async function fetchDrawsInfo$1({ endpoint, gameId }) {
3733
+ if (!(endpoint && gameId))
3734
+ return;
3735
+ const GAME_DRAW_LIMIT = 9999;
3736
+ const filterData = { status: 'CLOSED', limit: GAME_DRAW_LIMIT };
3737
+ const { items: drawList } = await fetchRequest$2(`${endpoint}/games/${gameId}/draws${toQueryParams$1(filterData)}`);
3738
+ if (!drawList || drawList.length === 0)
3739
+ return {};
3740
+ const settledDrawList = drawList
3741
+ .filter((item) => item.winningNumbers.length > 0)
3742
+ .sort((a, b) => a === null || a === void 0 ? void 0 : a.date.localeCompare(b === null || b === void 0 ? void 0 : b.date));
3743
+ const drawDatesOptions = settledDrawList.map((item) => item.date);
3744
+ return {
3745
+ drawDatesOptions,
3746
+ drawResultsList: settledDrawList
3747
+ };
3748
+ }
3749
+ async function fetchSaleStatistics({ endpoint, gameId, drawId }) {
3750
+ try {
3751
+ const res = await fetchRequest$2(`${endpoint}/games/${gameId}/draws/${drawId}/saleStatistics`);
3752
+ return res;
3753
+ }
3754
+ catch (error) {
3755
+ return Promise.reject(error);
3756
+ }
3757
+ }
3758
+
3759
+ const DEFAULT_LANGUAGE$1 = 'en';
3760
+ const SUPPORTED_LANGUAGES$1 = ['ro', 'en', 'fr', 'ar', 'hr'];
3761
+ const TRANSLATIONS$1 = {
3762
+ en: {
3763
+ weeks: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
3764
+ bettingType: 'Betting Type:',
3765
+ prizeAllocation: 'Prize Allocation (Turnover: €{turnover})',
3766
+ prizes: 'Prizes',
3767
+ numberOfWinners: 'Number of Winners',
3768
+ prizeMoney: 'Prize Money',
3769
+ noLatestResult: 'No latest result.',
3770
+ loading: 'Loading....',
3771
+ turnover: 'Turnover:',
3772
+ winners: 'winners,',
3773
+ prize: 'Prize:',
3774
+ },
3775
+ };
3776
+ const translate$1 = (key, customLang, replacements) => {
3777
+ const lang = customLang;
3778
+ let translation = TRANSLATIONS$1[lang !== undefined && SUPPORTED_LANGUAGES$1.includes(lang) ? lang : DEFAULT_LANGUAGE$1][key];
3779
+ if (replacements) {
3780
+ Object.keys(replacements).forEach((placeholder) => {
3781
+ translation = translation.replace(`{${placeholder}}`, replacements[placeholder]);
3782
+ });
3783
+ }
3784
+ return translation;
3785
+ };
3786
+ const getTranslations$1 = (data) => {
3787
+ Object.keys(data).forEach((item) => {
3788
+ for (let key in data[item]) {
3789
+ TRANSLATIONS$1[item][key] = data[item][key];
3790
+ }
3791
+ });
3792
+ };
3793
+ const resolveTranslationUrl$1 = async (translationUrl) => {
3794
+ if (translationUrl) {
3795
+ try {
3796
+ const response = await fetch(translationUrl);
3797
+ if (!response.ok) {
3798
+ throw new Error(`HTTP error! status: ${response.status}`);
3799
+ }
3800
+ const translations = await response.json();
3801
+ getTranslations$1(translations);
3802
+ }
3803
+ catch (error) {
3804
+ console.error('Failed to fetch or parse translations from URL:', error);
3805
+ }
3806
+ }
3807
+ };
3808
+
3809
+ const lotteryOddsbomLatestResultCss = ".lottery-tipping-latest-result{container-type:inline-size;background:var(--emw--color-background, #fff);color:var(--emw--color-typography, #000)}.lottery-tipping-latest-result .header-section{display:flex;justify-content:center;align-items:center}.lottery-tipping-latest-result .match-info-section{justify-content:space-between;padding:15px 0px;height:18px}.lottery-tipping-latest-result .match-details,.lottery-tipping-latest-result .prize-details{font-weight:600;display:flex;align-items:center}.lottery-tipping-latest-result .match-details .title-icon{margin-right:8px;display:flex}.lottery-tipping-latest-result .match-details .title-text__extra{margin-left:5px}.lottery-tipping-latest-result .prize-details .winners-count{margin-right:5px}.loading-wrap{margin:20px 0;display:flex;align-items:center;justify-content:center;min-height:100px}.loading-wrap .dots-container{display:flex;align-items:center;justify-content:center;height:100%;width:100%}.loading-wrap .dot{height:14px;width:14px;margin-right:14px;border-radius:14px;background-color:var(--emw--color-gray-300, #333);animation:pulse 1.5s infinite ease-in-out}.loading-wrap .dot:last-child{margin-right:0}.loading-wrap .dot:nth-child(1){animation-delay:-0.3s}.loading-wrap .dot:nth-child(2){animation-delay:-0.1s}.loading-wrap .dot:nth-child(3){animation-delay:0.1s}@keyframes pulse{0%{transform:scale(0.8);background-color:var(--emw--color-gray-300, #333)}50%{transform:scale(1.2);background-color:var(--emw--color-gray-100, #e6e6e6)}100%{transform:scale(0.8);background-color:var(--emw--color-gray-150, #6f6f6f)}}.latest-result-wrapper{background:var(--emw--color-background, #fff)}.latest-result-wrapper.game-wrapper{border:1px solid var(--emw--color-background-tertiary, #ccc);border-radius:8px;box-shadow:0 2px 4px var(--emw--color-background-tertiary, #ccc);overflow-x:auto;transition:box-shadow 0.3s ease;padding:20px}.latest-result-wrapper.game-wrapper:hover{box-shadow:0 4px 12px var(--emw--color-background-tertiary, #ccc)}.loading-turnOver{display:inline-flex;align-items:center}";
3810
+ const LotteryOddsbomLatestResultStyle0 = lotteryOddsbomLatestResultCss;
3811
+
3812
+ const BombIcons = {
3813
+ ['Football']: (h("svg", { height: "18px", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", class: "text-sm" }, h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M19.063 19.072l-.81-.97-.117.083.385-2.43.136-.211 2.23-3.464.037-.057h1.075a9.964 9.964 0 01-2.936 7.049zM4.769 5.112l2.8.877-.072 3.246-2.427 2.95-1.561-.153L2.39 9.26a9.977 9.977 0 012.378-4.148zm7.745-3.086l-.72 1.645-3.798 1.404-2.395-.75A9.953 9.953 0 0112 2c.174 0 .343.017.514.026zm7.346 3.812l-1.128 1.29-3.402-.755-.033-.008-2.446-2.241.057.016.862-1.973a9.996 9.996 0 016.09 3.67zm-1.87 8.894l-3.385-.493-1.358-4.067 2.173-2.755 3.144.698 1.347 3.634-1.921 2.983zm-4.64 5.787l4.304-1.486.62.742a9.945 9.945 0 01-5.878 2.205l.954-1.461zm-6.314-2.84l3.91.873-.001.003 1.509 1.507-1.24 1.898a9.946 9.946 0 01-5.908-2.553l1.73-1.728zm1.16-7.72l4.168.725 1.302 3.9-2.552 2.98-3.97-.885-1.412-3.724L8.196 9.96zM2 12c0-.31.019-.615.047-.92l.485 1.203-.454.907A9.934 9.934 0 012 11.999zM12 1C5.934 1 1 5.935 1 12c0 6.067 4.935 11 11 11 6.066 0 11-4.933 11-11 0-6.065-4.934-11-11-11z", fill: "currentColor" })))
3814
+ };
3815
+ const LotteryOddsbomLatestResult = class {
3816
+ constructor(hostRef) {
3817
+ registerInstance(this, hostRef);
3818
+ this.getGameDrawInfoEvent = createEvent(this, "getGameDrawInfo", 7);
3819
+ this.mbSource = undefined;
3820
+ this.clientStyling = undefined;
3821
+ this.clientStylingUrl = undefined;
3822
+ this.translationUrl = '';
3823
+ this.language = 'en';
3824
+ this.endpoint = undefined;
3825
+ this.gameId = undefined;
3826
+ this.curDate = undefined;
3827
+ this.showLoading = true;
3828
+ this.hideWrapperEmpty = false;
3829
+ this.isPassingData = false;
3830
+ this.drawResults = '';
3831
+ this.isEmpty = true;
3832
+ this._curDate = undefined;
3833
+ this.drawResultsList = [];
3834
+ this.curDrawItem = {};
3835
+ this.curTurnOver = 0;
3836
+ this.isLoadingTurnover = false;
3837
+ this.vendorGameId = undefined;
3838
+ this.gameName = undefined;
3839
+ this.isLoading = false;
3840
+ }
3841
+ handleClientStylingChange(newValue, oldValue) {
3842
+ if (newValue != oldValue) {
3843
+ setClientStyling(this.stylingContainer, this.clientStyling);
3844
+ }
3845
+ }
3846
+ handleClientStylingUrlChange(newValue, oldValue) {
3847
+ if (newValue != oldValue) {
3848
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
3849
+ }
3850
+ }
3851
+ handleMbSourceChange(newValue, oldValue) {
3852
+ if (newValue != oldValue) {
3853
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
3854
+ }
3855
+ }
3856
+ async handleDateChange(n, o) {
3857
+ if (n !== o) {
3858
+ await this.setCurItem(n);
3859
+ if (this.curDrawItem && this.curDrawItem.drawId) {
3860
+ this.getTurnOver();
3861
+ }
3862
+ }
3863
+ }
3864
+ async handleDrawResultsChange(n, o) {
3865
+ if (n !== o) {
3866
+ await this.setDrawResults();
3867
+ }
3868
+ }
3869
+ async getTurnOver() {
3870
+ var _a, _b;
3871
+ try {
3872
+ this.isLoadingTurnover = true;
3873
+ const res = await fetchSaleStatistics({
3874
+ endpoint: this.endpoint,
3875
+ gameId: this.vendorGameId,
3876
+ drawId: this.curDrawItem.drawId
3877
+ });
3878
+ this.curTurnOver = (_b = (_a = res === null || res === void 0 ? void 0 : res.wagerSegment) === null || _a === void 0 ? void 0 : _a.totalSalesCrossDraw) !== null && _b !== void 0 ? _b : 0;
3879
+ }
3880
+ catch (e) {
3881
+ console.error(e);
3882
+ }
3883
+ finally {
3884
+ this.isLoadingTurnover = false;
3885
+ }
3886
+ }
3887
+ get formattedTurnover() {
3888
+ const turnover = this.curTurnOver;
3889
+ const unit = '€';
3890
+ if (turnover === null || turnover === undefined)
3891
+ return '';
3892
+ return `${unit}${turnover ? thousandSeparator(turnover) : 0}`;
3893
+ }
3894
+ async setCurItem(curDate) {
3895
+ var _a;
3896
+ try {
3897
+ if (curDate && ((_a = this.drawResultsList) === null || _a === void 0 ? void 0 : _a.length)) {
3898
+ this.curDrawItem = await changeCurDrawItemByDate(curDate, this.drawResultsList);
3899
+ this.isEmpty = false;
3900
+ }
3901
+ else {
3902
+ this.isEmpty = true;
3903
+ }
3904
+ }
3905
+ catch (_b) {
3906
+ this.isEmpty = true;
3907
+ }
3908
+ }
3909
+ async setDrawResults() {
3910
+ try {
3911
+ if (this.drawResults) {
3912
+ this.drawResultsList = JSON.parse(this.drawResults);
3913
+ await this.setCurItem(this.curDate);
3914
+ }
3915
+ }
3916
+ catch (err) {
3917
+ console.error(err);
3918
+ }
3919
+ }
3920
+ componentDidLoad() {
3921
+ if (this.stylingContainer) {
3922
+ if (this.mbSource)
3923
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
3924
+ if (this.clientStyling)
3925
+ setClientStyling(this.stylingContainer, this.clientStyling);
3926
+ if (this.clientStylingUrl)
3927
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
3928
+ }
3929
+ }
3930
+ disconnectedCallback() {
3931
+ this.stylingSubscription && this.stylingSubscription.unsubscribe();
3932
+ }
3933
+ async getDrawData() {
3934
+ if (this.isPassingData) {
3935
+ this.setDrawResults();
3936
+ }
3937
+ else {
3938
+ this.fetchData();
3939
+ }
3940
+ }
3941
+ async getGameInfo() {
3942
+ return fetchGameInfo({ endpoint: this.endpoint, gameId: this.gameId }).then(({ vendorGameId, gameName }) => {
3943
+ this.vendorGameId = vendorGameId;
3944
+ this.gameName = gameName;
3945
+ });
3946
+ }
3947
+ async componentWillLoad() {
3948
+ resolveTranslationUrl$1(this.translationUrl);
3949
+ await Promise.all([this.getDrawData(), this.getGameInfo()]);
3950
+ if (this.curDrawItem && this.curDrawItem.drawId) {
3951
+ this.getTurnOver();
3952
+ }
3953
+ }
3954
+ async fetchData() {
3955
+ this.isLoading = true;
3956
+ try {
3957
+ const res = await fetchDrawsInfo$1({ endpoint: this.endpoint, gameId: this.gameId });
3958
+ this.getGameDrawInfoEvent.emit({
3959
+ drawDatesOptions: res.drawDatesOptions,
3960
+ gameId: this.gameId
3961
+ });
3962
+ this.drawResultsList = res.drawResultsList;
3963
+ this._curDate = res.drawDatesOptions[findLatestDateIdx$1(res.drawDatesOptions)];
3964
+ await this.setCurItem(this._curDate);
3965
+ }
3966
+ catch (error) {
3967
+ this.getGameDrawInfoEvent.emit({
3968
+ drawDatesOptions: [],
3969
+ gameId: this.gameId
3970
+ });
3971
+ }
3972
+ finally {
3973
+ this.isLoading = false;
3974
+ }
3975
+ }
3976
+ renderLoading() {
3977
+ return (h("div", { class: "loading-wrap" }, h("section", { class: "dots-container" }, h("div", { class: "dot" }), h("div", { class: "dot" }), h("div", { class: "dot" }), h("div", { class: "dot" }), h("div", { class: "dot" }))));
3978
+ }
3979
+ renderEmpty() {
3980
+ return null;
3981
+ }
3982
+ renderMainContent() {
3983
+ var _a, _b, _c, _d, _e, _f;
3984
+ if (!(this.curDate || this._curDate) || this.isEmpty) {
3985
+ return this.renderEmpty();
3986
+ }
3987
+ return (h("div", { class: "lottery-tipping-latest-result" }, h("div", { class: "header-section match-info-section" }, h("div", { class: "match-details" }, h("span", { class: "title-icon" }, BombIcons.Football), h("span", { class: "title-text" }, this.gameName, ' ', this.isLoadingTurnover ? (h("div", { class: "loading-turnOver" }, h("ui-skeleton", { structure: "rectangle", width: "100px", height: "16px" }))) : (h("span", { class: "title-text__extra" }, "(", translate$1('turnover', this.language) + ' ' + this.formattedTurnover || 0, ")")))), h("div", { class: "prize-details" }, h("span", { class: "winners-count" }, (((_a = this.curDrawItem) === null || _a === void 0 ? void 0 : _a.winNumber) || 0) + ' ' + translate$1('winners', this.language)), h("span", { class: "prize-amount" }, translate$1('prize', this.language) + ' ' + (((_b = this.curDrawItem) === null || _b === void 0 ? void 0 : _b.formattedWinTurnOver) || 0)))), !!(((_c = this.curDrawItem) === null || _c === void 0 ? void 0 : _c.drawId) || (((_d = this.curDrawItem) === null || _d === void 0 ? void 0 : _d.results) || []).length) && (h("lottery-oddsbom-ticket-result", { language: this.language, "mb-source": this.mbSource, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "translation-url": this.translationUrl, endpoint: this.endpoint, "game-id": this.vendorGameId, "draw-id": (_e = this.curDrawItem) === null || _e === void 0 ? void 0 : _e.drawId, "default-results": JSON.stringify(((_f = this.curDrawItem) === null || _f === void 0 ? void 0 : _f.results) || []), "split-view": false }))));
3988
+ }
3989
+ render() {
3990
+ return (h("div", { key: '08c7308433c4d55f4cec1540002a03596155fe98', ref: (el) => (this.stylingContainer = el), class: {
3991
+ 'latest-result-wrapper': true,
3992
+ 'game-wrapper': !(this.hideWrapperEmpty && this.isEmpty)
3993
+ } }, this.isLoading && this.showLoading ? this.renderLoading() : this.renderMainContent()));
3994
+ }
3995
+ static get watchers() { return {
3996
+ "clientStyling": ["handleClientStylingChange"],
3997
+ "clientStylingUrl": ["handleClientStylingUrlChange"],
3998
+ "mbSource": ["handleMbSourceChange"],
3999
+ "curDate": ["handleDateChange"],
4000
+ "drawResults": ["handleDrawResultsChange"]
4001
+ }; }
4002
+ };
4003
+ LotteryOddsbomLatestResult.style = LotteryOddsbomLatestResultStyle0;
4004
+
4005
+ var DrawStatusEnum;
4006
+ (function (DrawStatusEnum) {
4007
+ DrawStatusEnum["UPCOMING"] = "UPCOMING";
4008
+ DrawStatusEnum["OPEN"] = "OPEN";
4009
+ DrawStatusEnum["PENDING"] = "PENDING";
4010
+ DrawStatusEnum["ACTIVE"] = "ACTIVE";
4011
+ DrawStatusEnum["DRAWN"] = "DRAWN";
4012
+ DrawStatusEnum["SETTLED"] = "SETTLED";
4013
+ DrawStatusEnum["CLOSED"] = "CLOSED";
4014
+ DrawStatusEnum["PAYABLE"] = "PAYABLE";
4015
+ DrawStatusEnum["CANCELED"] = "CANCELED";
4016
+ })(DrawStatusEnum || (DrawStatusEnum = {}));
4017
+
4018
+ const generateUUID = () => {
4019
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
4020
+ var r = (Math.random() * 16) | 0, v = c == 'x' ? r : (r & 0x3) | 0x8;
4021
+ return v.toString(16);
4022
+ });
4023
+ };
4024
+ function fetchRequest$1(url, method = 'GET', body = null, headers = {}) {
4025
+ return new Promise((resolve, reject) => {
4026
+ const uuid = generateUUID();
4027
+ const headersOrigin = Object.assign({ 'Content-Type': 'application/json' }, headers);
4028
+ if (method !== 'GET' && method !== 'HEAD') {
4029
+ headersOrigin['X-Idempotency-Key'] = uuid;
4030
+ }
4031
+ const options = {
4032
+ method,
4033
+ headers: headersOrigin,
4034
+ body: null
4035
+ };
4036
+ if (body && method !== 'GET' && method !== 'HEAD') {
4037
+ options.body = JSON.stringify(body);
4038
+ }
4039
+ else {
4040
+ delete options.body;
4041
+ }
4042
+ fetch(url, options)
4043
+ .then((response) => {
4044
+ if (!response.ok) {
4045
+ reject(`HTTP error! Status: ${response.status}`);
4046
+ throw new Error(`HTTP error! Status: ${response.status}`);
4047
+ }
4048
+ return response.json();
4049
+ })
4050
+ .then((data) => resolve(data))
4051
+ .catch((error) => reject(error));
4052
+ });
4053
+ }
4054
+ function toQueryParams(params) {
4055
+ function isEmptyValueOfArray(arr) {
4056
+ if (arr.length === 0) {
4057
+ return true;
4058
+ }
4059
+ const len = arr.length;
4060
+ let count = 0;
4061
+ for (let i = 0; i < len; i++) {
4062
+ if (isEmptyValue(arr[i])) {
4063
+ count++;
4064
+ }
4065
+ else {
4066
+ return false;
4067
+ }
4068
+ }
4069
+ if (count === len) {
4070
+ return true;
4071
+ }
4072
+ return false;
4073
+ }
4074
+ function isEmptyValueOfObject(obj) {
4075
+ if (Object.keys(obj).length === 0) {
4076
+ return true;
4077
+ }
4078
+ const len = Object.keys(obj).length;
4079
+ let count = 0;
4080
+ for (const val of Object.values(obj)) {
4081
+ if (isEmptyValue(val)) {
4082
+ count++;
4083
+ }
4084
+ else {
4085
+ return false;
4086
+ }
4087
+ }
4088
+ if (count === len) {
4089
+ return true;
4090
+ }
4091
+ return false;
4092
+ }
4093
+ function isEmptyValue(value, allowZero) {
4094
+ if (value === null || value === undefined || value === '') {
4095
+ return true;
4096
+ }
4097
+ else if (value === 0 && allowZero) {
4098
+ return false;
4099
+ }
4100
+ else if (Array.isArray(value)) {
4101
+ return isEmptyValueOfArray(value);
4102
+ }
4103
+ else if (Object.prototype.toString.call(value) === '[object Object]') {
4104
+ return isEmptyValueOfObject(value);
4105
+ }
4106
+ else {
4107
+ return !value;
4108
+ }
4109
+ }
4110
+ const finalParams = {};
4111
+ Object.entries(params).forEach(([key, value]) => {
4112
+ if (!isEmptyValue(value, true)) {
4113
+ finalParams[key] = value;
4114
+ }
4115
+ });
4116
+ const queryString = Object.entries(finalParams)
4117
+ .map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`)
4118
+ .join('&');
4119
+ return queryString ? `?${queryString}` : '';
4120
+ }
4121
+ function findLatestDateIdx(dateArr) {
4122
+ const currentDate = new Date();
4123
+ let closestIndex = 0;
4124
+ let minDiff = Infinity;
4125
+ dateArr.forEach((dateStr, index) => {
4126
+ const date = new Date(dateStr);
4127
+ const diff = Math.abs(differenceInMilliseconds(currentDate, date));
4128
+ if (diff < minDiff) {
4129
+ minDiff = diff;
4130
+ closestIndex = index;
4131
+ }
4132
+ });
4133
+ return closestIndex;
4134
+ }
4135
+ function getUniqueDatesOptions(preDates = [], dates = []) {
4136
+ const dateSet = new Set();
4137
+ dates.forEach((date) => {
4138
+ if (!dateSet.has(date)) {
4139
+ dateSet.add(date);
4140
+ preDates.push(date);
4141
+ }
4142
+ });
4143
+ return preDates.length ? [...sortDates(preDates)] : [];
4144
+ }
4145
+ function sortDates(dateArray) {
4146
+ return dateArray.slice().sort((a, b) => a.localeCompare(b));
4147
+ }
4148
+
4149
+ async function fetchDrawsInfo({ endpoint, gameId }) {
4150
+ if (!(endpoint && gameId))
4151
+ return;
4152
+ const GAME_DRAW_LIMIT = 9999;
4153
+ const filterData = { status: [DrawStatusEnum.PAYABLE, DrawStatusEnum.CLOSED], limit: GAME_DRAW_LIMIT };
4154
+ const { items: drawList } = await fetchRequest$1(`${endpoint}/games/${gameId}/draws${toQueryParams(filterData)}`);
4155
+ if (!drawList || drawList.length === 0)
4156
+ return {};
4157
+ const settledDrawList = drawList.sort((a, b) => a === null || a === void 0 ? void 0 : a.date.localeCompare(b === null || b === void 0 ? void 0 : b.date));
4158
+ const drawDatesOptions = settledDrawList.map((item) => item.date);
4159
+ return {
4160
+ drawDatesOptions,
4161
+ drawResultsList: settledDrawList
4162
+ };
4163
+ }
4164
+ function fetchData({ endpoint, gameIds }) {
4165
+ if (!(endpoint && gameIds))
4166
+ return;
4167
+ return Promise.allSettled(gameIds.map((gameId) => fetchDrawsInfo({ endpoint, gameId })
4168
+ .then((res) => {
4169
+ return { gameId, drawResultsList: res.drawResultsList, drawDatesOptions: res.drawDatesOptions };
4170
+ })
4171
+ .catch((error) => {
4172
+ console.error(`Failed to fetch data for gameId: ${gameId}`, error);
4173
+ return { gameId, drawResultsList: [], drawDatesOptions: [] };
4174
+ }))).then((results) => {
4175
+ return results.reduce((pre, cur) => {
4176
+ if (cur.status === 'fulfilled') {
4177
+ const { gameId, drawResultsList, drawDatesOptions } = cur.value;
4178
+ pre[gameId] = {
4179
+ drawResultsList,
4180
+ drawDatesOptions
4181
+ };
4182
+ return pre;
4183
+ }
4184
+ }, {});
4185
+ });
4186
+ }
4187
+
4188
+ const lotteryOddsbomLatestResultGroupCss = ".lottery-tipping-latest-result-group{container-type:inline-size;padding:16px;background-color:var(--emw--color-background, #fff);height:100%}.games-container{display:flex;flex-direction:column;gap:24px;max-width:800px;margin:0 auto;margin-top:24px}.loading-wrap{margin:20px 0;display:flex;align-items:center;justify-content:center;min-height:100px}.loading-wrap .dots-container{display:flex;align-items:center;justify-content:center;height:100%;width:100%}.loading-wrap .dot{height:14px;width:14px;margin-right:14px;border-radius:14px;background-color:var(--emw--color-gray-300, #333);animation:pulse 1.5s infinite ease-in-out}.loading-wrap .dot:last-child{margin-right:0}.loading-wrap .dot:nth-child(1){animation-delay:-0.3s}.loading-wrap .dot:nth-child(2){animation-delay:-0.1s}.loading-wrap .dot:nth-child(3){animation-delay:0.1s}@keyframes pulse{0%{transform:scale(0.8);background-color:var(--emw--color-gray-300, #333)}50%{transform:scale(1.2);background-color:var(--emw--color-gray-100, #e6e6e6)}100%{transform:scale(0.8);background-color:var(--emw--color-gray-150, #6f6f6f)}}";
4189
+ const LotteryOddsbomLatestResultGroupStyle0 = lotteryOddsbomLatestResultGroupCss;
4190
+
4191
+ const LotteryOddsbomLatestResultGroup = class {
4192
+ constructor(hostRef) {
4193
+ registerInstance(this, hostRef);
4194
+ this.mbSource = undefined;
4195
+ this.clientStyling = undefined;
4196
+ this.clientStylingUrl = undefined;
4197
+ this.translationUrl = '';
4198
+ this.language = 'en';
4199
+ this.endpoint = undefined;
4200
+ this.sessionId = undefined;
4201
+ this.playerId = '';
4202
+ this.gameIds = undefined;
4203
+ this.gameIdArr = [];
4204
+ this.drawDatesOptions = [];
4205
+ this.curDate = undefined;
4206
+ this.isLoading = false;
4207
+ this.drawResultsObj = {};
4208
+ }
4209
+ handleClientStylingChange(newValue, oldValue) {
4210
+ if (newValue != oldValue) {
4211
+ setClientStyling(this.stylingContainer, this.clientStyling);
4212
+ }
4213
+ }
4214
+ handleClientStylingUrlChange(newValue, oldValue) {
4215
+ if (newValue != oldValue) {
4216
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
4217
+ }
4218
+ }
4219
+ handleMbSourceChange(newValue, oldValue) {
4220
+ if (newValue != oldValue) {
4221
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
4222
+ }
4223
+ }
4224
+ handleGameIdStringChange(newValue, oldValue) {
4225
+ var _a;
4226
+ if (newValue != oldValue) {
4227
+ this.gameIdArr = ((_a = this.gameIds) === null || _a === void 0 ? void 0 : _a.split(',')) || [];
4228
+ this.getData();
4229
+ }
4230
+ }
4231
+ componentDidLoad() {
4232
+ var _a;
4233
+ this.gameIdArr = ((_a = this.gameIds) === null || _a === void 0 ? void 0 : _a.split(',')) || [];
4234
+ this.getData();
4235
+ if (this.stylingContainer) {
4236
+ if (this.mbSource)
4237
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
4238
+ if (this.clientStyling)
4239
+ setClientStyling(this.stylingContainer, this.clientStyling);
4240
+ if (this.clientStylingUrl)
4241
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
4242
+ }
4243
+ }
4244
+ disconnectedCallback() {
4245
+ this.stylingSubscription && this.stylingSubscription.unsubscribe();
4246
+ }
4247
+ getData() {
4248
+ this.isLoading = true;
4249
+ fetchData({ endpoint: this.endpoint, gameIds: this.gameIdArr })
4250
+ .then((res) => {
4251
+ this.drawResultsObj = res;
4252
+ const dates = Object.values(res)
4253
+ .map((i) => i.drawDatesOptions)
4254
+ .filter(Boolean)
4255
+ .flat();
4256
+ this.drawDatesOptions = getUniqueDatesOptions([], dates);
4257
+ this.curDate = this.drawDatesOptions[findLatestDateIdx(this.drawDatesOptions)];
4258
+ })
4259
+ .finally(() => {
4260
+ this.isLoading = false;
4261
+ });
4262
+ }
4263
+ handleChange(e) {
4264
+ const idx = e.detail;
4265
+ this.curDate = this.drawDatesOptions[idx];
4266
+ }
4267
+ handleNext() {
4268
+ if (this.curDate) {
4269
+ const idx = this.drawDatesOptions.findIndex((v) => v === this.curDate);
4270
+ if (idx < this.drawDatesOptions.length - 1) {
4271
+ this.curDate = this.drawDatesOptions[idx + 1];
4272
+ }
4273
+ }
4274
+ }
4275
+ handlePrev() {
4276
+ if (this.curDate) {
4277
+ const idx = this.drawDatesOptions.findIndex((v) => v === this.curDate);
4278
+ if (idx > 0) {
4279
+ this.curDate = this.drawDatesOptions[idx - 1];
4280
+ }
4281
+ }
4282
+ }
4283
+ renderLoading() {
4284
+ return (h("div", { class: "loading-wrap" }, h("section", { class: "dots-container" }, h("div", { class: "dot" }), h("div", { class: "dot" }), h("div", { class: "dot" }), h("div", { class: "dot" }), h("div", { class: "dot" }))));
4285
+ }
4286
+ renderMainContent() {
4287
+ return (h("div", null, this.curDate && (h("helper-date-navigator", { language: this.language, "mb-source": this.mbSource, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "translation-url": this.translationUrl, date: this.curDate, "default-highlight-dates": JSON.stringify(this.drawDatesOptions || []), onNext: this.handleNext.bind(this), onPrev: this.handlePrev.bind(this), onChangeDate: this.handleChange.bind(this) })), h("div", { class: "games-container" }, this.gameIdArr.map((gameId) => {
4288
+ var _a, _b;
4289
+ return (h("lottery-oddsbom-latest-result", { endpoint: this.endpoint, "game-id": gameId, "cur-date": this.curDate, drawResults: JSON.stringify((_b = (_a = this.drawResultsObj) === null || _a === void 0 ? void 0 : _a[gameId]) === null || _b === void 0 ? void 0 : _b.drawResultsList), "is-passing-data": true, "show-loading": false, "hide-wrapper-empty": true, language: this.language, "translation-url": this.translationUrl, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "mb-source": this.mbSource, "session-id": this.sessionId, "player-id": this.playerId }));
4290
+ }))));
4291
+ }
4292
+ render() {
4293
+ return (h("div", { key: 'e576645b260f4a713cce833aae814ce7edad137e', ref: (el) => (this.stylingContainer = el), class: "lottery-tipping-latest-result-group" }, this.isLoading ? this.renderLoading() : this.renderMainContent()));
4294
+ }
4295
+ static get watchers() { return {
4296
+ "clientStyling": ["handleClientStylingChange"],
4297
+ "clientStylingUrl": ["handleClientStylingUrlChange"],
4298
+ "mbSource": ["handleMbSourceChange"],
4299
+ "gameIds": ["handleGameIdStringChange"]
4300
+ }; }
4301
+ };
4302
+ LotteryOddsbomLatestResultGroup.style = LotteryOddsbomLatestResultGroupStyle0;
4303
+
4304
+ const formatDate = ({ date, type = 'date', format: format$1 }) => {
4305
+ try {
4306
+ const parsedDate = parseISO(date);
4307
+ if (isNaN(parsedDate.getTime())) {
4308
+ throw new Error(`Invalid date: ${date}`);
4309
+ }
4310
+ if (format$1)
4311
+ return format(parsedDate, format$1);
4312
+ let formatStr = 'dd/MM/yyyy';
4313
+ if (type === 'time') {
4314
+ formatStr = 'dd/MM/yyyy HH:mm:ss';
4315
+ }
4316
+ else if (type === 'week') {
4317
+ formatStr = 'ccc dd/MM/yyyy HH:mm:ss';
4318
+ }
4319
+ return format(parsedDate, formatStr);
4320
+ }
4321
+ catch (error) {
4322
+ console.error('Error formatting date:', error.message);
4323
+ return '';
4324
+ }
4325
+ };
4326
+ function fetchRequest(url, method = 'GET', body = null, headers = {}) {
4327
+ return new Promise((resolve, reject) => {
4328
+ const headersOrigin = Object.assign({ 'Content-Type': 'application/json' }, headers);
4329
+ const options = {
4330
+ method,
4331
+ headers: headersOrigin,
4332
+ body: null
4333
+ };
4334
+ if (body && method !== 'GET' && method !== 'HEAD') {
4335
+ options.body = JSON.stringify(body);
4336
+ }
4337
+ else {
4338
+ delete options.body;
4339
+ }
4340
+ fetch(url, options)
4341
+ .then((response) => {
4342
+ if (!response.ok) {
4343
+ return response.json().then((errorData) => {
4344
+ const error = {
4345
+ status: response.status,
4346
+ statusText: response.statusText,
4347
+ code: errorData.code || 'UNKNOWN_ERROR',
4348
+ message: errorData.message || 'An unknown error occurred',
4349
+ data: errorData.data || null
4350
+ };
4351
+ reject(error);
4352
+ }, () => reject({
4353
+ status: response.status,
4354
+ statusText: response.statusText,
4355
+ code: 'PARSE_ERROR',
4356
+ message: 'Failed to parse error response'
4357
+ }));
4358
+ }
4359
+ else {
4360
+ return response.json();
4361
+ }
4362
+ })
4363
+ .then((data) => resolve(data), (error) => reject(error));
4364
+ });
4365
+ }
4366
+
4367
+ async function fetchTicketMatch({ endpoint, gameId, drawId }) {
4368
+ try {
4369
+ const res = await fetchRequest(`${endpoint}/poolgames/${gameId}/draws/${drawId}/matchConfig`);
4370
+ return res || [];
4371
+ }
4372
+ catch (e) {
4373
+ console.log(e);
4374
+ }
4375
+ }
4376
+ function getTeamsFromEventName(eventName) {
4377
+ if (!eventName)
4378
+ return '';
4379
+ return eventName.split('vs').map((i) => i.trim());
4380
+ }
4381
+ function resolveSelections(resInMatch) {
4382
+ const mySet1 = new Set();
4383
+ const mySet2 = new Set();
4384
+ for (const resInLine of resInMatch) {
4385
+ const [team1Score, team2Score] = resInLine.split(':');
4386
+ if (!mySet1.has(team1Score))
4387
+ mySet1.add(team1Score);
4388
+ if (!mySet2.has(team2Score))
4389
+ mySet2.add(team2Score);
4390
+ }
4391
+ return [Array.from(mySet1), Array.from(mySet2)];
4392
+ }
4393
+ async function buildTicketBetDataSource({ endpoint, gameId, drawId, results, splitView = false }) {
4394
+ const res = await fetchTicketMatch({ endpoint, gameId, drawId });
4395
+ if (splitView) {
4396
+ return (res.reduce((pre, item, index) => {
4397
+ const [team1Name, team2Name] = getTeamsFromEventName(item.eventName);
4398
+ const [team1Res, team2Res] = resolveSelections(results[index] || []);
4399
+ pre === null || pre === void 0 ? void 0 : pre.push({
4400
+ index: index + 1,
4401
+ teamName: team1Name,
4402
+ startTime: item.startTime,
4403
+ results: team1Res
4404
+ });
4405
+ pre === null || pre === void 0 ? void 0 : pre.push({
4406
+ index: index + 1,
4407
+ teamName: team2Name,
4408
+ startTime: item.startTime,
4409
+ results: team2Res
4410
+ });
4411
+ return pre;
4412
+ }, []) || []);
4413
+ }
4414
+ return res.map((item, index) => ({
4415
+ index: index + 1,
4416
+ eventName: item.eventName,
4417
+ startTime: item.startTime,
4418
+ results: results[index] || []
4419
+ }));
4420
+ }
4421
+
4422
+ const DEFAULT_LANGUAGE = 'en';
4423
+ const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'ar', 'hr'];
4424
+ const TRANSLATIONS = {
4425
+ en: {
4426
+ filter: 'Filter',
4427
+ clear: 'Clear',
4428
+ searchByTicketId: 'Search by Ticket ID',
4429
+ enterTicketId: 'Enter Ticket ID',
4430
+ searchByTicketType: 'Search by Ticket Type',
4431
+ selectTicketType: 'Select Ticket Type',
4432
+ searchByDate: 'Search by Date',
4433
+ from: 'From',
4434
+ to: 'To',
4435
+ normal: 'Normal',
4436
+ subscription: 'Subscription',
4437
+ ticketsHistory: 'Tickets History',
4438
+ settled: 'Settled',
4439
+ purchased: 'Purchased',
4440
+ canceled: 'Canceled',
4441
+ noData: 'No data Avaliable.',
4442
+ ticketId: 'Ticket ID:',
4443
+ ticketType: 'Ticket Type:',
4444
+ ticketAmount: 'Ticket Amount:',
4445
+ lineDetail: 'Line Detail:',
4446
+ seeDetails: 'See Details',
4447
+ numberOfDraw: 'Number of Draw:',
4448
+ ticketResult: 'Ticket Result:',
4449
+ drawId: 'Draw ID:',
4450
+ drawDate: 'Draw Date:',
4451
+ result: 'Result:',
4452
+ prize: 'Prize:',
4453
+ bettingType: 'Betting Type:'
4454
+ },
4455
+ ro: {
4456
+ ticketsHistory: 'Istoric bilete',
4457
+ settled: 'Decontat',
4458
+ purchased: 'Achiziționat',
4459
+ canceled: 'Anulat',
4460
+ noData: 'Nu sunt date disponibile.',
4461
+ ticketId: 'ID bilet:',
4462
+ ticketType: 'Tip bilet:',
4463
+ ticketAmount: 'Suma biletului:',
4464
+ lineDetail: 'Detaliu linie:',
4465
+ seeDetails: 'Vezi detalii',
4466
+ numberOfDraw: 'Număr de extrageri:',
4467
+ ticketResult: 'Rezultat bilet:',
4468
+ drawId: 'ID extragere:',
4469
+ drawDate: 'Data extragerii:',
4470
+ result: 'Rezultat:',
4471
+ prize: 'Premiu:',
4472
+ bettingType: 'Tip de pariu:'
4473
+ },
4474
+ fr: {
4475
+ ticketsHistory: 'Historique des billets',
4476
+ settled: 'Réglé',
4477
+ purchased: 'Acheté',
4478
+ canceled: 'Annulé',
4479
+ noData: 'Aucune donnée disponible.',
4480
+ ticketId: 'ID du billet:',
4481
+ ticketType: 'Type de billet:',
4482
+ ticketAmount: 'Montant du billet:',
4483
+ lineDetail: 'Détail de la ligne:',
4484
+ seeDetails: 'Voir les détails',
4485
+ numberOfDraw: 'Nombre de tirages:',
4486
+ ticketResult: 'Résultat du billet:',
4487
+ drawId: 'ID du tirage:',
4488
+ drawDate: 'Date du tirage:',
4489
+ result: 'Résultat:',
4490
+ prize: 'Prix:',
4491
+ bettingType: 'Type de pari:'
4492
+ },
4493
+ ar: {
4494
+ ticketsHistory: 'سجل التذاكر',
4495
+ settled: 'تمت التسوية',
4496
+ purchased: 'تم شراؤها',
4497
+ canceled: 'تم الإلغاء',
4498
+ noData: 'لا توجد بيانات متاحة.',
4499
+ ticketId: 'معرف التذكرة:',
4500
+ ticketType: 'نوع التذكرة:',
4501
+ ticketAmount: 'مبلغ التذكرة:',
4502
+ lineDetail: 'تفاصيل الخط:',
4503
+ seeDetails: 'انظر التفاصيل',
4504
+ numberOfDraw: 'عدد السحوبات:',
4505
+ ticketResult: 'نتيجة التذكرة:',
4506
+ drawId: 'معرف السحب:',
4507
+ drawDate: 'تاريخ السحب:',
4508
+ result: 'النتيجة:',
4509
+ prize: 'الجائزة:',
4510
+ bettingType: 'نوع الرهان:'
4511
+ },
4512
+ hr: {
4513
+ ticketsHistory: 'Povijest listića',
4514
+ settled: 'Riješeno',
4515
+ purchased: 'Kupljeno',
4516
+ canceled: 'Otkazano',
4517
+ noData: 'Nema dostupnih podataka.',
4518
+ ticketId: 'ID listića:',
4519
+ ticketType: 'Vrsta listića:',
4520
+ ticketAmount: 'Iznos listića:',
4521
+ lineDetail: 'Detalji linije:',
4522
+ seeDetails: 'Vidi detalje',
4523
+ numberOfDraw: 'Broj izvlačenja:',
4524
+ ticketResult: 'Rezultat listića:',
4525
+ drawId: 'ID izvlačenja:',
4526
+ drawDate: 'Datum izvlačenja:',
4527
+ result: 'Rezultat:',
4528
+ prize: 'Nagrada:',
4529
+ bettingType: 'Vrsta oklade:'
4530
+ }
4531
+ };
4532
+ const translate = (key, customLang, replacements) => {
4533
+ const lang = customLang;
4534
+ let translation = TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
4535
+ if (replacements) {
4536
+ Object.keys(replacements).forEach((placeholder) => {
4537
+ translation = translation === null || translation === void 0 ? void 0 : translation.replace(`{${placeholder}}`, replacements[placeholder]);
4538
+ });
4539
+ }
4540
+ return translation;
4541
+ };
4542
+ const getTranslations = (data) => {
4543
+ Object.keys(data).forEach((item) => {
4544
+ for (let key in data[item]) {
4545
+ TRANSLATIONS[item][key] = data[item][key];
4546
+ }
4547
+ });
4548
+ };
4549
+ const resolveTranslationUrl = async (translationUrl) => {
4550
+ if (translationUrl) {
4551
+ try {
4552
+ const response = await fetch(translationUrl);
4553
+ if (!response.ok) {
4554
+ throw new Error(`HTTP error! status: ${response.status}`);
4555
+ }
4556
+ const translations = await response.json();
4557
+ getTranslations(translations);
4558
+ }
4559
+ catch (error) {
4560
+ console.error('Failed to fetch or parse translations from URL:', error);
4561
+ }
4562
+ }
4563
+ };
4564
+
4565
+ const lotteryOddsbomTicketResultCss = ".LotteryTippingTicketBet__container {\n display: block; /* Or inline-block, depending on desired layout flow */\n font-size: 14px;\n line-height: 1.5715;\n color: var(--emw--color-typography, #000);\n background: var(--emw--color-background, #fff);\n overflow: hidden;\n min-width: 300px;\n container-type: inline-size;\n}\n@container (max-width: 375px) {\n .LotteryTippingTicketBet__container {\n font-size: 12px;\n }\n}\n\n.my-table-component {\n width: 100%;\n border-collapse: collapse; /* Important for borders */\n text-align: left;\n border-radius: 0.1rem; /* Ant Design like subtle rounding */\n border-spacing: 0;\n}\n\n/* Header */\n.my-table-component th {\n background: var(--emw--color-background-secondary, #f5f5f5);\n color: var(--emw--color-typography, #000);\n font-weight: 600;\n padding: 0.4rem 0.5rem;\n transition: background 0.3s ease;\n}\n\n/* Cells */\n.my-table-component td {\n padding: 0.4rem 0.5rem;\n color: var(--emw--color-typography, #000);\n background: var(--emw--color-background, #fff);\n transition: background 0.3s;\n}\n@container (max-width: 400px) {\n .my-table-component td {\n padding: 0.3rem 0.3rem;\n }\n}\n\n.my-table-component.bordered th,\n.my-table-component.bordered td {\n border-bottom: 1px solid var(--emw--color-gray-100, #e6e6e6);\n}\n\n/* Bordered style */\n.my-table-component.grid th,\n.my-table-component.grid td {\n border: 1px solid var(--emw--color-gray-100, #e6e6e6);\n}\n\n.my-table-component.grid th {\n border-bottom-width: 1px; /* Ensure bottom border is consistent */\n}\n\n.my-table-component.grid {\n border: 1px solid var(--emw--color-gray-100, #e6e6e6); /* Outer border */\n border-right-width: 0;\n border-bottom-width: 0;\n}\n\n.my-table-component.grid th:last-child,\n.my-table-component.grid td:last-child {\n border-right: 1px solid var(--emw--color-gray-100, #e6e6e6);\n}\n\n.my-table-component.grid tr:last-child td {\n border-bottom: 1px solid var(--emw--color-gray-100, #e6e6e6);\n}\n\n/* Striped style */\n.my-table-component.striped tbody tr:nth-child(even) td {\n background-color: var(--emw--color-background-secondary, #f5f5f5);\n}\n\n/* Hover (optional, but nice) */\n.my-table-component tbody tr:hover td {\n background-color: var(--emw--color-background-secondary, #f5f5f5);\n}\n\n.flex {\n display: flex;\n}\n\n.justify-end {\n justify-content: flex-end;\n}\n\n.gap-1 {\n gap: 4px;\n}\n\n.justify-between {\n justify-content: space-between;\n}\n\n.align-center {\n align-items: center;\n}\n\n.gap-1 {\n gap: 0.5rem;\n}\n\n.match-info-item {\n display: flex;\n}\n\n.match-info-item-label {\n margin-right: 6px;\n}\n\n.info-icon:hover {\n cursor: pointer;\n}\n\n.LotteryTippingTicketBet__empty p {\n text-align: center;\n color: var(--emw--color-typography, #000);\n}\n\n.no-wrap {\n white-space: nowrap;\n overflow: hidden;\n}\n\n.eventNameContainer__item {\n line-height: 1rem;\n}\n.eventNameContainer__item--title {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 300px;\n}\n@container (max-width: 600px) {\n .eventNameContainer__item--title {\n max-width: 180px;\n }\n}\n@container (max-width: 500px) {\n .eventNameContainer__item--title {\n max-width: 150px;\n }\n}\n@container (max-width: 400px) {\n .eventNameContainer__item--title {\n max-width: 100px;\n }\n}\n@container (max-width: 330px) {\n .eventNameContainer__item--title {\n max-width: 70px;\n }\n}\n\n.LotteryTippingTicketBet__main {\n perspective: 800px;\n will-change: transform, opacity;\n backface-visibility: hidden;\n}\n\n@container (max-width: 520px) {\n .LotteryTippingTicketBet__main {\n flex-wrap: wrap;\n justify-content: center;\n }\n}\n.loading-wrap {\n margin: 20px 0;\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 100px;\n}\n.loading-wrap .dots-container {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n}\n.loading-wrap .dot {\n height: 14px;\n width: 14px;\n margin-right: 14px;\n border-radius: 14px;\n background-color: var(--emw--color-gray-300, #333);\n animation: pulse 1.5s infinite ease-in-out;\n}\n.loading-wrap .dot:last-child {\n margin-right: 0;\n}\n.loading-wrap .dot:nth-child(1) {\n animation-delay: -0.3s;\n}\n.loading-wrap .dot:nth-child(2) {\n animation-delay: -0.1s;\n}\n.loading-wrap .dot:nth-child(3) {\n animation-delay: 0.1s;\n}\n@keyframes pulse {\n 0% {\n transform: scale(0.8);\n background-color: var(--emw--color-gray-300, #333);\n }\n 50% {\n transform: scale(1.2);\n background-color: var(--emw--color-gray-100, #e6e6e6);\n }\n 100% {\n transform: scale(0.8);\n background-color: var(--emw--color-gray-150, #6f6f6f);\n }\n}";
4566
+ const LotteryOddsbomTicketResultStyle0 = lotteryOddsbomTicketResultCss;
4567
+
4568
+ const LotteryOddsbomTicketResult = class {
4569
+ constructor(hostRef) {
4570
+ registerInstance(this, hostRef);
4571
+ this.latestRequestId = 0;
4572
+ this.mbSource = undefined;
4573
+ this.clientStyling = undefined;
4574
+ this.clientStylingUrl = undefined;
4575
+ this.translationUrl = '';
4576
+ this.language = 'en';
4577
+ this.sessionId = undefined;
4578
+ this.endpoint = '';
4579
+ this.gameId = undefined;
4580
+ this.drawId = undefined;
4581
+ this.defaultResults = undefined;
4582
+ this.splitView = false;
4583
+ this.allResults = undefined;
4584
+ this.ticketBetDataSource = [];
4585
+ this.isLoading = false;
4586
+ }
4587
+ handleClientStylingChange(newValue, oldValue) {
4588
+ if (newValue !== oldValue) {
4589
+ setClientStyling(this.stylingContainer, this.clientStyling);
4590
+ }
4591
+ }
4592
+ handleClientStylingUrlChange(newValue, oldValue) {
4593
+ if (newValue !== oldValue) {
4594
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
4595
+ }
4596
+ }
4597
+ handleMbSourceChange(newValue, oldValue) {
4598
+ if (newValue !== oldValue) {
4599
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
4600
+ }
4601
+ }
4602
+ componentDidLoad() {
4603
+ if (this.stylingContainer) {
4604
+ if (this.mbSource)
4605
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
4606
+ if (this.clientStyling)
4607
+ setClientStyling(this.stylingContainer, this.clientStyling);
4608
+ if (this.clientStylingUrl)
4609
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
4610
+ }
4611
+ }
4612
+ disconnectedCallback() {
4613
+ this.stylingSubscription && this.stylingSubscription.unsubscribe();
4614
+ }
4615
+ componentWillLoad() {
4616
+ resolveTranslationUrl(this.translationUrl);
4617
+ this.fetchMatchData();
4618
+ }
4619
+ async fetchMatchData() {
4620
+ const currentId = ++this.latestRequestId;
4621
+ if (!this.gameId || !this.drawId) {
4622
+ return;
4623
+ }
4624
+ try {
4625
+ if (this.defaultResults)
4626
+ this.allResults = JSON.parse(this.defaultResults);
4627
+ this.isLoading = true;
4628
+ const res = await buildTicketBetDataSource({
4629
+ endpoint: this.endpoint,
4630
+ gameId: this.gameId,
4631
+ drawId: this.drawId,
4632
+ results: this.allResults || [[]],
4633
+ splitView: this.splitView
4634
+ });
4635
+ if (currentId === this.latestRequestId) {
4636
+ this.ticketBetDataSource = res;
4637
+ }
4638
+ }
4639
+ finally {
4640
+ if (currentId === this.latestRequestId) {
4641
+ this.isLoading = false;
4642
+ }
4643
+ }
4644
+ }
4645
+ get columns() {
4646
+ const dateRender = (_, value) => formatDate({ date: value, format: 'ccc dd/MM HH:mm' });
4647
+ if (this.splitView) {
4648
+ return [
4649
+ {
4650
+ title: 'No.',
4651
+ value: 'index',
4652
+ width: 5,
4653
+ rowSpan: 2
4654
+ },
4655
+ {
4656
+ title: 'Date',
4657
+ value: 'startTime',
4658
+ width: 25,
4659
+ rowSpan: 2,
4660
+ nowrap: true,
4661
+ render: dateRender
4662
+ },
4663
+ {
4664
+ title: 'Team',
4665
+ value: 'teamName',
4666
+ width: 30
4667
+ },
4668
+ {
4669
+ title: 'Scores',
4670
+ value: 'results',
4671
+ width: 45,
4672
+ render: (_, value) => (h("div", { class: "flex gap-1" }, value.map((i) => (h("lottery-oddsbom-bullet", { text: i, "is-reading": true, "is-selected": true })))))
4673
+ }
4674
+ ];
4675
+ }
4676
+ const eventNameRender = (_, value) => (h("div", { class: "flex gap-1 eventNameContainer__item" }, h("span", { class: "eventNameContainer__item--title" }, value)));
4677
+ return [
4678
+ {
4679
+ title: 'Match',
4680
+ value: 'eventName',
4681
+ width: 50,
4682
+ render: eventNameRender
4683
+ },
4684
+ {
4685
+ title: 'Date',
4686
+ value: 'startTime',
4687
+ width: 25,
4688
+ nowrap: true,
4689
+ render: dateRender
4690
+ },
4691
+ {
4692
+ title: 'Match Result',
4693
+ value: 'results',
4694
+ width: 25,
4695
+ render: (_, value) => h("div", null, value === null || value === void 0 ? void 0 : value[0])
4696
+ }
4697
+ ];
4698
+ }
4699
+ renderLoading() {
4700
+ return (h("div", { class: "loading-wrap" }, h("section", { class: "dots-container" }, h("div", { class: "dot" }), h("div", { class: "dot" }), h("div", { class: "dot" }), h("div", { class: "dot" }), h("div", { class: "dot" }))));
4701
+ }
4702
+ renderEmpty() {
4703
+ return (h("div", { class: "LotteryTippingTicketBet__empty" }, h("p", null, translate('noData', this.language))));
4704
+ }
4705
+ renderTable({ columns, dataSource, hideHead = false, grid = true, bordered = true }) {
4706
+ const skipMap = {};
4707
+ return (h("table", { class: { bordered: bordered, grid: grid, 'my-table-component': true } }, !hideHead && (h("thead", null, h("tr", null, columns.map((column) => {
4708
+ var _a;
4709
+ return (h("th", { key: column.value, style: { width: column.width + '%', textAlign: column.align } }, typeof column.title === 'string' ? column.title : (_a = column.title) === null || _a === void 0 ? void 0 : _a.call(column)));
4710
+ })))), h("tbody", null, dataSource.map((row, index) => (h("tr", { key: index }, columns.map((column) => {
4711
+ if (skipMap[column.value] && skipMap[column.value] > 0) {
4712
+ skipMap[column.value]--;
4713
+ return null;
4714
+ }
4715
+ const span = column.rowSpan;
4716
+ if (span && span > 1) {
4717
+ skipMap[column.value] = span - 1;
4718
+ }
4719
+ return (h("td", { key: column.value, rowSpan: span, style: { width: column.width + '%', textAlign: column.align }, class: { 'no-wrap': column.nowrap } }, column.render ? column.render(row, row[column.value], index) : row[column.value]));
4720
+ })))))));
4721
+ }
4722
+ renderContent() {
4723
+ if (this.isLoading) {
4724
+ return this.renderLoading();
4725
+ }
4726
+ if (!this.ticketBetDataSource || this.ticketBetDataSource.length === 0) {
4727
+ return this.renderEmpty();
4728
+ }
4729
+ return (h("div", { class: "flex align-center LotteryTippingTicketBet__main" }, this.renderTable({
4730
+ columns: this.columns,
4731
+ dataSource: this.ticketBetDataSource || [],
4732
+ hideHead: false,
4733
+ grid: false,
4734
+ bordered: false
4735
+ })));
4736
+ }
4737
+ render() {
4738
+ return (h("div", { key: '9932926b2958b13636d617cc20a0c77a76a36ebe', ref: (el) => (this.stylingContainer = el), class: "LotteryTippingTicketBet__container" }, this.renderContent()));
4739
+ }
4740
+ static get watchers() { return {
4741
+ "clientStyling": ["handleClientStylingChange"],
4742
+ "clientStylingUrl": ["handleClientStylingUrlChange"],
4743
+ "mbSource": ["handleMbSourceChange"],
4744
+ "gameId": ["fetchMatchData"],
4745
+ "drawId": ["fetchMatchData"],
4746
+ "defaultResults": ["fetchMatchData"]
4747
+ }; }
4748
+ };
4749
+ LotteryOddsbomTicketResult.style = LotteryOddsbomTicketResultStyle0;
4750
+
4751
+ const uiSkeletonCss = ":host{display:block}.Skeleton{animation:skeleton-loading 1s linear infinite alternate}.SkeletonRectangle{background-color:var(--emw-skeleton-rectangle-background, #c2c2c2);width:var(--emw-skeleton-rectangle-width, 400px);height:var(--emw-skeleton-rectangle-height, 200px);border-radius:var(--emw-skeleton-rectangle-border-radius, 10px)}.SkeletonCircle{background-color:var(--emw-skeleton-circle-background, #c2c2c2);width:var(--emw-skeleton-circle-size, 400px);height:var(--emw-skeleton-circle-size, 400px);border-radius:50%}.SkeletonText{background-color:var(--emw-skeleton-text-background, #c2c2c2);width:var(--emw-skeleton-text-width, 500px);height:var(--emw-skeleton-text-height, 20px);border-radius:var(--emw-skeleton-text-border-radius, 10px);margin-bottom:var(--emw-skeleton-text-margin-bottom, 5px)}.SkeletonText:last-child{width:calc(var(--emw-skeleton-text-width, 400px) - 100px)}.SkeletonTitle{background-color:var(--emw-skeleton-title-background, #c2c2c2);width:var(--emw-skeleton-title-width, 300px);height:var(--emw-skeleton-title-height, 30px);border-radius:var(--emw-skeleton-title-border-radius, 10px);margin-bottom:var(--emw-skeleton-title-margin-bottom, 5px)}.SkeletonImage{background-color:var(--emw-skeleton-image-background, #c2c2c2);width:var(--emw-skeleton-image-width, 100%);height:var(--emw-skeleton-image-height, 100%);border-radius:var(--emw-skeleton-image-border-radius, unset)}.SkeletonLogo{background-color:var(--emw-skeleton-logo-background, #c2c2c2);width:var(--emw-skeleton-logo-width, 120px);height:var(--emw-skeleton-logo-height, 75px);border-radius:var(--emw-skeleton-logo-border-radius, 10px)}@keyframes skeleton-loading{0%{background-color:var(--emw-skeleton-primary-color, #e0e0e0)}100%{background-color:var(--emw-skeleton-secondary-color, #f0f0f0)}}";
4752
+ const UiSkeletonStyle0 = uiSkeletonCss;
4753
+
4754
+ const UiSkeleton = class {
4755
+ constructor(hostRef) {
4756
+ registerInstance(this, hostRef);
4757
+ this.stylingValue = {
4758
+ width: this.handleStylingProps(this.width),
4759
+ height: this.handleStylingProps(this.height),
4760
+ borderRadius: this.handleStylingProps(this.borderRadius),
4761
+ marginBottom: this.handleStylingProps(this.marginBottom),
4762
+ marginTop: this.handleStylingProps(this.marginTop),
4763
+ marginLeft: this.handleStylingProps(this.marginLeft),
4764
+ marginRight: this.handleStylingProps(this.marginRight),
4765
+ size: this.handleStylingProps(this.size),
4766
+ };
4767
+ this.structure = undefined;
4768
+ this.width = 'unset';
4769
+ this.height = 'unset';
4770
+ this.borderRadius = 'unset';
4771
+ this.marginBottom = 'unset';
4772
+ this.marginTop = 'unset';
4773
+ this.marginLeft = 'unset';
4774
+ this.marginRight = 'unset';
4775
+ this.animation = true;
4776
+ this.rows = 0;
4777
+ this.size = '100%';
4778
+ }
4779
+ handleStructureChange(newValue, oldValue) {
4780
+ if (oldValue !== newValue) {
4781
+ this.handleStructure(newValue);
4782
+ }
4783
+ }
4784
+ handleStylingProps(value) {
4785
+ switch (typeof value) {
4786
+ case 'number':
4787
+ return value === 0 ? 0 : `${value}px`;
4788
+ case 'undefined':
4789
+ return 'unset';
4790
+ case 'string':
4791
+ if (['auto', 'unset', 'none', 'inherit', 'initial'].includes(value) ||
4792
+ value.endsWith('px') ||
4793
+ value.endsWith('%')) {
4794
+ return value;
4795
+ }
4796
+ else {
4797
+ return 'unset';
4798
+ }
4799
+ default:
4800
+ return 'unset';
4801
+ }
4802
+ }
4803
+ handleStructure(structure) {
4804
+ switch (structure) {
4805
+ case 'logo':
4806
+ return this.renderLogo();
4807
+ case 'image':
4808
+ return this.renderImage();
4809
+ case 'title':
4810
+ return this.renderTitle();
4811
+ case 'text':
4812
+ return this.renderText();
4813
+ case 'rectangle':
4814
+ return this.renderRectangle();
4815
+ case 'circle':
4816
+ return this.renderCircle();
4817
+ default:
4818
+ return null;
4819
+ }
4820
+ }
4821
+ renderLogo() {
4822
+ return (h("div", { class: "SkeletonContainer" }, h("div", { class: 'SkeletonLogo ' + (this.animation ? 'Skeleton' : '') })));
4823
+ }
4824
+ renderImage() {
4825
+ return h("div", { class: 'SkeletonImage ' + (this.animation ? 'Skeleton' : '') });
4826
+ }
4827
+ renderTitle() {
4828
+ return (h("div", { class: "SkeletonContainer" }, h("div", { class: 'SkeletonTitle ' + (this.animation ? 'Skeleton' : '') })));
4829
+ }
4830
+ renderText() {
4831
+ return (h("div", { class: "SkeletonContainer" }, Array.from({ length: this.rows > 0 ? this.rows : 1 }).map((_, index) => (h("div", { key: index, class: 'SkeletonText ' + (this.animation ? 'Skeleton' : '') })))));
4832
+ }
4833
+ renderRectangle() {
4834
+ return (h("div", { class: "SkeletonContainer" }, h("div", { class: 'SkeletonRectangle ' + (this.animation ? 'Skeleton' : '') })));
4835
+ }
4836
+ renderCircle() {
4837
+ return (h("div", { class: "SkeletonContainer" }, h("div", { class: 'SkeletonCircle ' + (this.animation ? 'Skeleton' : '') })));
4838
+ }
4839
+ render() {
4840
+ let styleBlock = '';
4841
+ switch (this.structure) {
4842
+ case 'logo':
4843
+ styleBlock = `
4844
+ :host {
4845
+ --emw-skeleton-logo-width: ${this.stylingValue.width};
4846
+ --emw-skeleton-logo-height: ${this.stylingValue.height};
4847
+ --emw-skeleton-logo-border-radius: ${this.stylingValue.borderRadius};
4848
+ --emw-skeleton-logo-margin-bottom: ${this.stylingValue.marginBottom};
4849
+ --emw-skeleton-logo-margin-top: ${this.stylingValue.marginTop};
4850
+ --emw-skeleton-logo-margin-left: ${this.stylingValue.marginLeft};
4851
+ --emw-skeleton-logo-margin-right: ${this.stylingValue.marginRight};
4852
+ }
4853
+ `;
4854
+ break;
4855
+ case 'image':
4856
+ styleBlock = `
4857
+ :host {
4858
+ --emw-skeleton-image-width: ${this.stylingValue.width};
4859
+ --emw-skeleton-image-height: ${this.stylingValue.height};
4860
+ --emw-skeleton-image-border-radius: ${this.stylingValue.borderRadius};
4861
+ --emw-skeleton-image-margin-bottom: ${this.stylingValue.marginBottom};
4862
+ --emw-skeleton-image-margin-top: ${this.stylingValue.marginTop};
4863
+ --emw-skeleton-image-margin-left: ${this.stylingValue.marginLeft};
4864
+ --emw-skeleton-image-margin-right: ${this.stylingValue.marginRight};
4865
+ }
4866
+ `;
4867
+ break;
4868
+ case 'title':
4869
+ styleBlock = `
4870
+ :host {
4871
+ --emw-skeleton-title-width: ${this.stylingValue.width};
4872
+ --emw-skeleton-title-height: ${this.stylingValue.height};
4873
+ --emw-skeleton-title-border-radius: ${this.stylingValue.borderRadius};
4874
+ --emw-skeleton-title-margin-bottom: ${this.stylingValue.marginBottom};
4875
+ --emw-skeleton-title-margin-top: ${this.stylingValue.marginTop};
4876
+ --emw-skeleton-title-margin-left: ${this.stylingValue.marginLeft};
4877
+ --emw-skeleton-title-margin-right: ${this.stylingValue.marginRight};
4878
+ }
4879
+ `;
4880
+ break;
4881
+ case 'text':
4882
+ styleBlock = `
4883
+ :host {
4884
+ --emw-skeleton-text-width: ${this.stylingValue.width};
4885
+ --emw-skeleton-text-height: ${this.stylingValue.height};
4886
+ --emw-skeleton-text-border-radius: ${this.stylingValue.borderRadius};
4887
+ --emw-skeleton-text-margin-bottom: ${this.stylingValue.marginBottom};
4888
+ --emw-skeleton-text-margin-top: ${this.stylingValue.marginTop};
4889
+ --emw-skeleton-text-margin-left: ${this.stylingValue.marginLeft};
4890
+ --emw-skeleton-text-margin-right: ${this.stylingValue.marginRight};
4891
+ }
4892
+ `;
4893
+ break;
4894
+ case 'rectangle':
4895
+ styleBlock = `
4896
+ :host {
4897
+ --emw-skeleton-rectangle-width: ${this.stylingValue.width};
4898
+ --emw-skeleton-rectangle-height: ${this.stylingValue.height};
4899
+ --emw-skeleton-rectangle-border-radius: ${this.stylingValue.borderRadius};
4900
+ --emw-skeleton-rectangle-margin-bottom: ${this.stylingValue.marginBottom};
4901
+ --emw-skeleton-rectangle-margin-top: ${this.stylingValue.marginTop};
4902
+ --emw-skeleton-rectangle-margin-left: ${this.stylingValue.marginLeft};
4903
+ --emw-skeleton-rectangle-margin-right: ${this.stylingValue.marginRight};
4904
+ }
4905
+ `;
4906
+ break;
4907
+ case 'circle':
4908
+ styleBlock = `
4909
+ :host {
4910
+ --emw-skeleton-circle-size: ${this.stylingValue.size};
4911
+ }
4912
+ `;
4913
+ break;
4914
+ default:
4915
+ styleBlock = '';
4916
+ }
4917
+ return (h(Host, { key: 'c2a2650acd416962a2bc4e1a7ee18bc6d8e2def8' }, h("style", { key: '9bd7fc1f9e9ed9f17735a7b72fce6f09696f5e19' }, styleBlock), this.handleStructure(this.structure)));
4918
+ }
4919
+ static get watchers() { return {
4920
+ "structure": ["handleStructureChange"]
4921
+ }; }
4922
+ };
4923
+ UiSkeleton.style = UiSkeletonStyle0;
4924
+
4925
+ export { HelperDateNavigator as helper_date_navigator, LotteryOddsbomBomb as lottery_oddsbom_bomb, LotteryOddsbomBullet as lottery_oddsbom_bullet, LotteryOddsbomLatestResult as lottery_oddsbom_latest_result, LotteryOddsbomLatestResultGroup as lottery_oddsbom_latest_result_group, LotteryOddsbomTicketResult as lottery_oddsbom_ticket_result, UiSkeleton as ui_skeleton };