@everymatrix/lottery-oddsbom-entrance 0.0.12 → 0.0.13

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} +1867 -20
  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-95c48b1c.js → lottery-oddsbom-entrance-e6f8db63.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} +1863 -22
  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-89457e53.js → lottery-oddsbom-entrance-93563752.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-89457e53.js → lottery-oddsbom-entrance-93563752.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
@@ -2,9 +2,358 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-b0be9007.js');
6
- const lotteryOddsbomEntrance = require('./lottery-oddsbom-entrance-95c48b1c.js');
7
- require('@everymatrix/lottery-oddsbom-latest-result-group');
5
+ const index = require('./index-4e91c0c2.js');
6
+ const lotteryOddsbomEntrance = require('./lottery-oddsbom-entrance-e6f8db63.js');
7
+
8
+ // This icon file is generated automatically.
9
+ 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" };
10
+ const CalendarOutlined$1 = CalendarOutlined;
11
+
12
+ // This icon file is generated automatically.
13
+ 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" };
14
+ const DeleteFilled$1 = DeleteFilled;
15
+
16
+ // This icon file is generated automatically.
17
+ 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" };
18
+ const LeftOutlined$1 = LeftOutlined;
19
+
20
+ // This icon file is generated automatically.
21
+ 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" };
22
+ const RightOutlined$1 = RightOutlined;
23
+
24
+ var __assign = (undefined && undefined.__assign) || function () {
25
+ __assign = Object.assign || function(t) {
26
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
27
+ s = arguments[i];
28
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
29
+ t[p] = s[p];
30
+ }
31
+ return t;
32
+ };
33
+ return __assign.apply(this, arguments);
34
+ };
35
+ var defaultColors = {
36
+ primaryColor: '#333',
37
+ secondaryColor: '#E6E6E6'
38
+ };
39
+ function renderIconDefinitionToSVGElement(icond, options) {
40
+ if (options === void 0) { options = {}; }
41
+ if (typeof icond.icon === 'function') {
42
+ // two-tone
43
+ var placeholders = options.placeholders || defaultColors;
44
+ return renderAbstractNodeToSVGElement(icond.icon(placeholders.primaryColor, placeholders.secondaryColor), options);
45
+ }
46
+ // fill, outline
47
+ return renderAbstractNodeToSVGElement(icond.icon, options);
48
+ }
49
+ function renderAbstractNodeToSVGElement(node, options) {
50
+ var targetAttrs = node.tag === 'svg'
51
+ ? __assign(__assign({}, node.attrs), (options.extraSVGAttrs || {})) : node.attrs;
52
+ var attrs = Object.keys(targetAttrs).reduce(function (acc, nextKey) {
53
+ var key = nextKey;
54
+ var value = targetAttrs[key];
55
+ var token = "".concat(key, "=\"").concat(value, "\"");
56
+ acc.push(token);
57
+ return acc;
58
+ }, []);
59
+ var attrsToken = attrs.length ? ' ' + attrs.join(' ') : '';
60
+ var children = (node.children || [])
61
+ .map(function (child) { return renderAbstractNodeToSVGElement(child, options); })
62
+ .join('');
63
+ if (children && children.length) {
64
+ return "<".concat(node.tag).concat(attrsToken, ">").concat(children, "</").concat(node.tag, ">");
65
+ }
66
+ return "<".concat(node.tag).concat(attrsToken, " />");
67
+ }
68
+
69
+ const DEFAULT_LANGUAGE$3 = 'en';
70
+ const SUPPORTED_LANGUAGES$3 = ['ro', 'en', 'fr', 'ar', 'hr'];
71
+ const TRANSLATIONS$3 = {
72
+ en: {
73
+ weeks: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
74
+ },
75
+ };
76
+ const translate$3 = (key, customLang, replacements) => {
77
+ const lang = customLang;
78
+ let translation = TRANSLATIONS$3[lang !== undefined && SUPPORTED_LANGUAGES$3.includes(lang) ? lang : DEFAULT_LANGUAGE$3][key];
79
+ if (replacements) {
80
+ Object.keys(replacements).forEach((placeholder) => {
81
+ translation = translation.replace(`{${placeholder}}`, replacements[placeholder]);
82
+ });
83
+ }
84
+ return translation;
85
+ };
86
+ const getTranslations$2 = (data) => {
87
+ Object.keys(data).forEach((item) => {
88
+ for (let key in data[item]) {
89
+ TRANSLATIONS$3[item][key] = data[item][key];
90
+ }
91
+ });
92
+ };
93
+ const resolveTranslationUrl$2 = async (translationUrl) => {
94
+ if (translationUrl) {
95
+ try {
96
+ const response = await fetch(translationUrl);
97
+ if (!response.ok) {
98
+ throw new Error(`HTTP error! status: ${response.status}`);
99
+ }
100
+ const translations = await response.json();
101
+ getTranslations$2(translations);
102
+ }
103
+ catch (error) {
104
+ console.error('Failed to fetch or parse translations from URL:', error);
105
+ }
106
+ }
107
+ };
108
+
109
+ 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)}";
110
+ const HelperDateNavigatorStyle0 = helperDateNavigatorCss;
111
+
112
+ const leftArrowIcon = renderIconDefinitionToSVGElement(LeftOutlined$1, {
113
+ extraSVGAttrs: { width: '16px', height: '16px', fill: 'currentColor' }
114
+ });
115
+ const rightArrowIcon = renderIconDefinitionToSVGElement(RightOutlined$1, {
116
+ extraSVGAttrs: { width: '16px', height: '16px', fill: 'currentColor' }
117
+ });
118
+ const calendarIcon = renderIconDefinitionToSVGElement(CalendarOutlined$1, {
119
+ extraSVGAttrs: { width: '18px', height: '18px', fill: 'var(--emw--color-primary-variant, #1367e7)' }
120
+ });
121
+ const HelperDateNavigator = class {
122
+ constructor(hostRef) {
123
+ index.registerInstance(this, hostRef);
124
+ this.changeDate = index.createEvent(this, "changeDate", 7);
125
+ this.handleNext = index.createEvent(this, "next", 7);
126
+ this.handlePrev = index.createEvent(this, "prev", 7);
127
+ this.handleOutsideClick = (event) => {
128
+ if (!this.showCalendar)
129
+ return;
130
+ const path = event.composedPath ? event.composedPath() : [];
131
+ // check if clicked on calendar
132
+ const isCalendarClick = path.includes(this.calendarRef);
133
+ // check if click select option
134
+ const isSelectOption = path.some((el) => {
135
+ var _a, _b;
136
+ return el instanceof HTMLElement &&
137
+ (((_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')));
138
+ });
139
+ if (!isCalendarClick && !isSelectOption) {
140
+ this.showCalendar = false;
141
+ }
142
+ };
143
+ this.onYearMinus = () => {
144
+ const years = this.yearOptions.map((item) => Number(item.value));
145
+ if (this.alterDate.year - 1 < Math.min(...years))
146
+ return;
147
+ this.alterDate.year--;
148
+ this.loadRecords();
149
+ };
150
+ this.onYearPlus = () => {
151
+ const years = this.yearOptions.map((item) => Number(item.value));
152
+ if (this.alterDate.year + 1 > Math.max(...years))
153
+ return;
154
+ this.alterDate.year++;
155
+ this.loadRecords();
156
+ };
157
+ this.onMonthMinus = () => {
158
+ if (this.alterDate.month === 0) {
159
+ this.onYearMinus();
160
+ this.alterDate.month = 11;
161
+ }
162
+ else {
163
+ this.alterDate.month--;
164
+ this.loadRecords();
165
+ }
166
+ };
167
+ this.onMonthPlus = () => {
168
+ if (this.alterDate.month === 11) {
169
+ this.onYearPlus();
170
+ this.alterDate.month = 0;
171
+ }
172
+ else {
173
+ this.alterDate.month++;
174
+ this.loadRecords();
175
+ }
176
+ };
177
+ this.onYearChange = (e) => {
178
+ this.alterDate.year = parseInt(e.detail.value);
179
+ this.loadRecords();
180
+ };
181
+ this.onMonthChange = (e) => {
182
+ this.alterDate.month = parseInt(e.detail.value) - 1;
183
+ this.loadRecords();
184
+ };
185
+ this.mbSource = undefined;
186
+ this.clientStyling = undefined;
187
+ this.clientStylingUrl = undefined;
188
+ this.translationUrl = '';
189
+ this.language = 'en';
190
+ this.date = '';
191
+ this.defaultHighlightDates = undefined;
192
+ this.highlightDates = [];
193
+ this.weeks = undefined;
194
+ this.days = [];
195
+ this.alterDate = { year: 0, month: 0, day: 0 };
196
+ this.curDate = { year: 0, month: 0, day: 0 };
197
+ this.recordInfo = [];
198
+ this.showCalendar = false;
199
+ }
200
+ handleClientStylingChange(newValue, oldValue) {
201
+ if (newValue != oldValue) {
202
+ lotteryOddsbomEntrance.setClientStyling(this.stylingContainer, this.clientStyling);
203
+ }
204
+ }
205
+ handleClientStylingUrlChange(newValue, oldValue) {
206
+ if (newValue != oldValue) {
207
+ lotteryOddsbomEntrance.setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
208
+ }
209
+ }
210
+ handleMbSourceChange(newValue, oldValue) {
211
+ if (newValue != oldValue) {
212
+ lotteryOddsbomEntrance.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
213
+ }
214
+ }
215
+ handleGameIdStringChange(newValue, oldValue) {
216
+ if (newValue != oldValue) {
217
+ this.setHighlightDates();
218
+ }
219
+ }
220
+ componentWillLoad() {
221
+ resolveTranslationUrl$2(this.translationUrl);
222
+ this.weeks = translate$3('weeks', this.language);
223
+ const d = this.date ? new Date(this.date) : new Date();
224
+ this.alterDate = { year: d.getFullYear(), month: d.getMonth(), day: d.getDate() };
225
+ this.curDate = Object.assign({}, this.alterDate);
226
+ this.loadRecords();
227
+ }
228
+ handleDateChange() {
229
+ const d = this.date ? new Date(this.date) : new Date();
230
+ this.alterDate = { year: d.getFullYear(), month: d.getMonth(), day: d.getDate() };
231
+ this.curDate = Object.assign({}, this.alterDate);
232
+ this.loadRecords();
233
+ }
234
+ setHighlightDates() {
235
+ if (this.defaultHighlightDates) {
236
+ try {
237
+ this.highlightDates = JSON.parse(this.defaultHighlightDates);
238
+ }
239
+ catch (_a) {
240
+ this.highlightDates = [];
241
+ }
242
+ }
243
+ }
244
+ componentDidLoad() {
245
+ if (this.stylingContainer) {
246
+ if (this.mbSource)
247
+ lotteryOddsbomEntrance.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
248
+ if (this.clientStyling)
249
+ lotteryOddsbomEntrance.setClientStyling(this.stylingContainer, this.clientStyling);
250
+ if (this.clientStylingUrl)
251
+ lotteryOddsbomEntrance.setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
252
+ }
253
+ this.setHighlightDates();
254
+ document.addEventListener('click', this.handleOutsideClick);
255
+ }
256
+ disconnectedCallback() {
257
+ this.stylingSubscription && this.stylingSubscription.unsubscribe();
258
+ document.removeEventListener('click', this.handleOutsideClick);
259
+ }
260
+ get yearOptions() {
261
+ const years = Array.from({ length: 101 }, (_, i) => this.alterDate.year - 50 + i);
262
+ return years.map((item) => {
263
+ return {
264
+ label: String(item),
265
+ value: String(item)
266
+ };
267
+ });
268
+ }
269
+ get monthOptions() {
270
+ const months = Array.from({ length: 12 }, (_, i) => i + 1);
271
+ return months.map((item) => {
272
+ return {
273
+ label: String(item),
274
+ value: String(item)
275
+ };
276
+ });
277
+ }
278
+ loadRecords() {
279
+ const { year, month } = this.alterDate;
280
+ this.setDays(year, month);
281
+ }
282
+ setDays(year, month) {
283
+ this.days = [];
284
+ const firstDayOfMonth = new Date(year, month, 1);
285
+ const firstDayWeek = firstDayOfMonth.getDay();
286
+ const startDate = new Date(year, month, 1 - firstDayWeek);
287
+ for (let i = 0; i < 42; i++) {
288
+ const temp = new Date(startDate);
289
+ temp.setDate(startDate.getDate() + i);
290
+ const day = {
291
+ date: temp.getDate(),
292
+ month: temp.getMonth(),
293
+ year: temp.getFullYear()
294
+ };
295
+ this.days.push(day);
296
+ }
297
+ }
298
+ getFullDayOfMonth(year, month) {
299
+ return new Date(year, month, 0).getDate();
300
+ }
301
+ showFormatedDate(date) {
302
+ return `${date.day}/${date.month + 1}/${date.year}`;
303
+ }
304
+ handleSelectDate(curDay, curMonth, curYear) {
305
+ this.alterDate.day = curDay;
306
+ this.curDate = Object.assign({}, this.alterDate);
307
+ this.showCalendar = false;
308
+ const formattedHighLightArr = this.highlightDates.map((date) => {
309
+ const d = new Date(date);
310
+ return { year: d.getFullYear(), month: d.getMonth(), day: d.getDate() };
311
+ });
312
+ const idx = formattedHighLightArr.findIndex((obj) => {
313
+ const { year, month, day } = obj;
314
+ return curMonth === month && curYear === year && curDay === day;
315
+ });
316
+ if (idx > -1) {
317
+ this.changeDate.emit(idx);
318
+ }
319
+ }
320
+ tellIsCurDay(curDay, curMonth, curYear) {
321
+ return this.curDate.day === curDay && this.curDate.month === curMonth && this.curDate.year === curYear;
322
+ }
323
+ tellIsHighLight(curDay, curMonth, curYear) {
324
+ if (!this.highlightDates || !this.highlightDates.length)
325
+ return false;
326
+ const formattedHighLightArr = this.highlightDates.map((date) => {
327
+ const d = new Date(date);
328
+ return { year: d.getFullYear(), month: d.getMonth(), day: d.getDate() };
329
+ });
330
+ return formattedHighLightArr.some((obj) => {
331
+ const { year, month, day } = obj;
332
+ return curMonth === month && curYear === year && curDay === day;
333
+ });
334
+ }
335
+ renderInner() {
336
+ const calendarClass = ['calendar', this.showCalendar ? 'calendar-visible' : 'calendar-leave'];
337
+ return (index.h("div", { class: "lottery-tipping-calendar", ref: (el) => (this.calendarRef = el) }, index.h("div", { class: "calling-input", onClick: () => {
338
+ this.showCalendar = true;
339
+ } }, index.h("div", { class: "calling-input-text" }, this.showFormatedDate(this.curDate)), index.h("div", { class: "calling-input-icon", innerHTML: calendarIcon })), index.h("div", { class: calendarClass.join(' ') }, index.h("div", { class: "calendar-header" }, index.h("div", { class: "date-controller year-minus", onClick: this.onYearMinus }, "<"), index.h("div", { class: "date-controller month-minus", onClick: this.onMonthMinus }, "<"), index.h("div", { class: "date-picker" }, index.h("div", { class: "date-picker-year" }, index.h("vaadin-select", { items: this.yearOptions, value: this.alterDate.year, style: { '--vaadin-field-default-width': '90px' }, "on-value-changed": this.onYearChange.bind(this) })), index.h("div", { class: "date-picker-delimiter" }, "-"), index.h("div", { class: "date-picker-month" }, index.h("vaadin-select", { items: this.monthOptions, value: this.alterDate.month + 1, style: { '--vaadin-field-default-width': '64px' }, "on-value-changed": this.onMonthChange.bind(this) })), index.h("div", { class: "date-picker-delimiter" }, "-"), index.h("div", { class: "date-picker-day" }, this.alterDate.day)), index.h("div", { class: "date-controller month-plus", onClick: this.onMonthPlus }, ">"), index.h("div", { class: "date-controller year-plus", onClick: this.onYearPlus }, ">")), index.h("div", { class: "calendar-content" }, index.h("div", { class: "calendar-content-week" }, this.weeks.map((week) => (index.h("div", { class: "week-item" }, week)))), index.h("div", { class: "calendar-content-day" }, this.days.map((item) => (index.h("div", { class: {
340
+ 'day-item': true,
341
+ isCurDay: this.tellIsCurDay(item.date, item.month, item.year),
342
+ isHighLight: this.tellIsHighLight(item.date, item.month, item.year)
343
+ }, onClick: () => this.handleSelectDate(item.date, item.month, item.year) }, item.date))))))));
344
+ }
345
+ render() {
346
+ return (index.h("div", { key: 'da34c4c86cac49411fb15ab8bceda89e379befc6', class: "date-selection" }, index.h("div", { key: '29f06ef7a5df466018ae6561b54fcbdfbab9f23b', class: "date-selection-leftIcon", innerHTML: leftArrowIcon, onClick: () => this.handlePrev.emit() }), index.h("div", { key: 'c6d75d873c2683752c37d4083c57761c4f7e523b', class: "date-selection-calendar" }, this.renderInner()), index.h("div", { key: '8b16b3e0761dd4c877f169aea84d028aaf193b69', class: "date-selection-rightIcon", innerHTML: rightArrowIcon, onClick: () => this.handleNext.emit() })));
347
+ }
348
+ static get watchers() { return {
349
+ "clientStyling": ["handleClientStylingChange"],
350
+ "clientStylingUrl": ["handleClientStylingUrlChange"],
351
+ "mbSource": ["handleMbSourceChange"],
352
+ "defaultHighlightDates": ["handleGameIdStringChange"],
353
+ "date": ["handleDateChange"]
354
+ }; }
355
+ };
356
+ HelperDateNavigator.style = HelperDateNavigatorStyle0;
8
357
 
9
358
  var Bomb;
10
359
  (function (Bomb) {
@@ -337,6 +686,33 @@ function isValid(dirtyDate) {
337
686
  return !isNaN(Number(date));
338
687
  }
339
688
 
689
+ /**
690
+ * @name differenceInMilliseconds
691
+ * @category Millisecond Helpers
692
+ * @summary Get the number of milliseconds between the given dates.
693
+ *
694
+ * @description
695
+ * Get the number of milliseconds between the given dates.
696
+ *
697
+ * @param {Date|Number} dateLeft - the later date
698
+ * @param {Date|Number} dateRight - the earlier date
699
+ * @returns {Number} the number of milliseconds
700
+ * @throws {TypeError} 2 arguments required
701
+ *
702
+ * @example
703
+ * // How many milliseconds are between
704
+ * // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?
705
+ * const result = differenceInMilliseconds(
706
+ * new Date(2014, 6, 2, 12, 30, 21, 700),
707
+ * new Date(2014, 6, 2, 12, 30, 20, 600)
708
+ * )
709
+ * //=> 1100
710
+ */
711
+ function differenceInMilliseconds(dateLeft, dateRight) {
712
+ requiredArgs(2, arguments);
713
+ return toDate(dateLeft).getTime() - toDate(dateRight).getTime();
714
+ }
715
+
340
716
  /**
341
717
  * @name subMilliseconds
342
718
  * @category Millisecond Helpers
@@ -2609,7 +2985,7 @@ function validateTimezone(_hours, minutes) {
2609
2985
  return minutes >= 0 && minutes <= 59;
2610
2986
  }
2611
2987
 
2612
- function fetchRequest(url, method = 'GET', body = null, headers = {}) {
2988
+ function fetchRequest$3(url, method = 'GET', body = null, headers = {}) {
2613
2989
  return new Promise((resolve, reject) => {
2614
2990
  const headersOrigin = Object.assign({ 'Content-Type': 'application/json' }, headers);
2615
2991
  const options = {
@@ -2665,7 +3041,7 @@ function formattedTime(date) {
2665
3041
  const weekday = format(parsedDate, 'EEEE');
2666
3042
  return `${weekday} at ${hhmm}`;
2667
3043
  }
2668
- function toQueryParams(params) {
3044
+ function toQueryParams$2(params) {
2669
3045
  const finalParams = {};
2670
3046
  Object.entries(params).forEach(([key, value]) => {
2671
3047
  if (!isEmptyValue(value, true)) {
@@ -2733,7 +3109,7 @@ function isEmptyValueOfObject(obj) {
2733
3109
  return false;
2734
3110
  }
2735
3111
  const DEFAULT_ALL_BOMB = { name: 'All', code: 'All' };
2736
- function thousandSeparator(value) {
3112
+ function thousandSeparator$1(value) {
2737
3113
  if (value === 0) {
2738
3114
  return '0';
2739
3115
  }
@@ -2748,7 +3124,7 @@ function thousandSeparator(value) {
2748
3124
 
2749
3125
  async function fetchLiveDrawsByGroupId({ endpoint, groupId, params = {} }) {
2750
3126
  try {
2751
- const res = await fetchRequest(`${endpoint}/groups/${groupId}/liveDraws${toQueryParams(params)}`);
3127
+ const res = await fetchRequest$3(`${endpoint}/groups/${groupId}/liveDraws${toQueryParams$2(params)}`);
2752
3128
  return res;
2753
3129
  }
2754
3130
  catch (error) {
@@ -2756,16 +3132,16 @@ async function fetchLiveDrawsByGroupId({ endpoint, groupId, params = {} }) {
2756
3132
  return {};
2757
3133
  }
2758
3134
  }
2759
- async function fetchSaleStatistics({ endpoint, gameId, drawId }) {
3135
+ async function fetchSaleStatistics$1({ endpoint, gameId, drawId }) {
2760
3136
  try {
2761
- const res = await fetchRequest(`${endpoint}/games/${gameId}/draws/${drawId}/saleStatistics`);
3137
+ const res = await fetchRequest$3(`${endpoint}/games/${gameId}/draws/${drawId}/saleStatistics`);
2762
3138
  return res;
2763
3139
  }
2764
3140
  catch (error) {
2765
3141
  return Promise.reject(error);
2766
3142
  }
2767
3143
  }
2768
- async function fetchData({ endpoint, groupId, params }) {
3144
+ async function fetchData$1({ endpoint, groupId, params }) {
2769
3145
  try {
2770
3146
  const { sportTags = [], liveDraws = [] } = await fetchLiveDrawsByGroupId({
2771
3147
  endpoint,
@@ -2797,7 +3173,7 @@ async function getTurnoverForAll({ endpoint, configs }) {
2797
3173
  const fallback = { turnover: formattedTurnover(null) };
2798
3174
  const promises = configs.map(async ({ gameId, drawId }) => {
2799
3175
  var _a;
2800
- const res = await fetchSaleStatistics({
3176
+ const res = await fetchSaleStatistics$1({
2801
3177
  endpoint: endpoint,
2802
3178
  gameId,
2803
3179
  drawId
@@ -2811,12 +3187,12 @@ function formattedTurnover(turnover) {
2811
3187
  if (turnover === null)
2812
3188
  return '';
2813
3189
  const unit = '€';
2814
- return `${unit}${turnover ? thousandSeparator(turnover) : 0}`;
3190
+ return `${unit}${turnover ? thousandSeparator$1(turnover) : 0}`;
2815
3191
  }
2816
3192
 
2817
- const DEFAULT_LANGUAGE = 'en';
2818
- const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'ar', 'hr'];
2819
- const TRANSLATIONS = {
3193
+ const DEFAULT_LANGUAGE$2 = 'en';
3194
+ const SUPPORTED_LANGUAGES$2 = ['ro', 'en', 'fr', 'ar', 'hr'];
3195
+ const TRANSLATIONS$2 = {
2820
3196
  en: {
2821
3197
  logout: 'Log out',
2822
3198
  draws: 'DRAWS',
@@ -2869,15 +3245,15 @@ const TRANSLATIONS = {
2869
3245
  instructionContent: 'Sadržaj uputa ide ovdje.'
2870
3246
  }
2871
3247
  };
2872
- const translate = (key, customLang) => {
3248
+ const translate$2 = (key, customLang) => {
2873
3249
  const lang = customLang;
2874
- return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
3250
+ return TRANSLATIONS$2[lang !== undefined && SUPPORTED_LANGUAGES$2.includes(lang) ? lang : DEFAULT_LANGUAGE$2][key];
2875
3251
  };
2876
3252
 
2877
3253
  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 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: 1.5rem 0;\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}";
2878
3254
  const LotteryOddsbomBombStyle0 = lotteryOddsbomBombCss;
2879
3255
 
2880
- const BombIcons = {
3256
+ const BombIcons$1 = {
2881
3257
  [Bomb.Football]: (index.h("svg", { height: "18px", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", class: "text-sm" }, index.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" })))
2882
3258
  };
2883
3259
  const LotteryOddsbomBomb = class {
@@ -2931,7 +3307,7 @@ const LotteryOddsbomBomb = class {
2931
3307
  async doFetchData(params = {}) {
2932
3308
  try {
2933
3309
  this.isLoading = true;
2934
- this.liveDrawsInfoByGroupId = await fetchData({
3310
+ this.liveDrawsInfoByGroupId = await fetchData$1({
2935
3311
  endpoint: this.endpoint,
2936
3312
  groupId: this.groupId,
2937
3313
  params
@@ -2982,7 +3358,7 @@ const LotteryOddsbomBomb = class {
2982
3358
  return this.renderEmpty();
2983
3359
  return (index.h("div", { class: "bomb-grid" }, this.gameList.map(({ title, subTitle, icon, date, turnover, matchList, drawId, gameId }) => (index.h("div", { class: "bomb-card-wrapper" }, index.h("div", { class: "bomb-card", onClick: () => {
2984
3360
  this.handleBombItemClick.emit({ drawId, gameId });
2985
- } }, index.h("div", { class: "card-header" }, BombIcons[icon] && index.h("div", { class: "card-icon football" }, BombIcons[icon]), index.h("div", { class: "card-title" }, index.h("h2", null, title), index.h("p", null, subTitle)), index.h("div", { class: "card-jackpot" })), index.h("div", { class: "card-info" }, index.h("span", { class: "card-tag" }, date), index.h("span", { class: "card-tag" }, translate('turnover', this.language) + turnover)), index.h("div", { class: "card-matches" }, index.h("ol", null, matchList.map((item) => (index.h("li", null, item)))))))))));
3361
+ } }, index.h("div", { class: "card-header" }, BombIcons$1[icon] && index.h("div", { class: "card-icon football" }, BombIcons$1[icon]), index.h("div", { class: "card-title" }, index.h("h2", null, title), index.h("p", null, subTitle)), index.h("div", { class: "card-jackpot" })), index.h("div", { class: "card-info" }, index.h("span", { class: "card-tag" }, date), index.h("span", { class: "card-tag" }, translate$2('turnover', this.language) + turnover)), index.h("div", { class: "card-matches" }, index.h("ol", null, matchList.map((item) => (index.h("li", null, item)))))))))));
2986
3362
  }
2987
3363
  render() {
2988
3364
  return (index.h("div", { key: 'ae8252d8cb1374af9bb8189bcd9edac313c7bc6a', ref: (el) => (this.stylingContainer = el), class: "lottery-oddsbom-bomb-wrapper" }, this.renderFilter(), index.h("div", { key: '3f673f335248057370e7e57076cc387a86dc4099', class: "bomb-grid-container" }, this.isLoading ? this.renderLoading() : this.renderMain())));
@@ -2996,5 +3372,1476 @@ const LotteryOddsbomBomb = class {
2996
3372
  };
2997
3373
  LotteryOddsbomBomb.style = LotteryOddsbomBombStyle0;
2998
3374
 
3375
+ 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}";
3376
+ const LotteryOddsbomBulletStyle0 = lotteryOddsbomBulletCss;
3377
+
3378
+ const DeleteFilledIcon = renderIconDefinitionToSVGElement(DeleteFilled$1, {
3379
+ extraSVGAttrs: { width: '18px', height: '18px', fill: '' }
3380
+ });
3381
+ const LotteryOddsbomBullet = class {
3382
+ constructor(hostRef) {
3383
+ index.registerInstance(this, hostRef);
3384
+ this.oddsbomBulletToggleEvent = index.createEvent(this, "oddsbomBulletToggle", 7);
3385
+ this.oddsbomBulletDeleteEvent = index.createEvent(this, "oddsbomBulletDelete", 7);
3386
+ this.oddsbomBulletAddedByMoreBtnDeleteEvent = index.createEvent(this, "oddsbomBulletAddedByMoreBtnDelete", 7);
3387
+ this.oddsbomBulletCallDialogEvent = index.createEvent(this, "oddsbomBulletCallDialog", 7);
3388
+ this.isSelected = undefined;
3389
+ this.disabled = undefined;
3390
+ this.text = undefined;
3391
+ this.idx = undefined;
3392
+ this.isReading = undefined;
3393
+ this.isDeleteByIcon = undefined;
3394
+ this.isCallDialogBtn = undefined;
3395
+ this.isAddedByMoreBtn = undefined;
3396
+ this.mbSource = undefined;
3397
+ this.clientStyling = undefined;
3398
+ this.clientStylingUrl = undefined;
3399
+ }
3400
+ handleClientStylingChange(newValue, oldValue) {
3401
+ if (newValue != oldValue) {
3402
+ lotteryOddsbomEntrance.setClientStyling(this.stylingContainer, this.clientStyling);
3403
+ }
3404
+ }
3405
+ handleClientStylingUrlChange(newValue, oldValue) {
3406
+ if (newValue != oldValue) {
3407
+ lotteryOddsbomEntrance.setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
3408
+ }
3409
+ }
3410
+ handleMbSourceChange(newValue, oldValue) {
3411
+ if (newValue != oldValue) {
3412
+ lotteryOddsbomEntrance.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
3413
+ }
3414
+ }
3415
+ componentDidLoad() {
3416
+ if (this.stylingContainer) {
3417
+ if (this.mbSource)
3418
+ lotteryOddsbomEntrance.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
3419
+ if (this.clientStyling)
3420
+ lotteryOddsbomEntrance.setClientStyling(this.stylingContainer, this.clientStyling);
3421
+ if (this.clientStylingUrl)
3422
+ lotteryOddsbomEntrance.setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
3423
+ }
3424
+ }
3425
+ disconnectedCallback() {
3426
+ this.stylingSubscription && this.stylingSubscription.unsubscribe();
3427
+ }
3428
+ handleClick() {
3429
+ if (this.isCallDialogBtn) {
3430
+ this.oddsbomBulletCallDialogEvent.emit();
3431
+ return;
3432
+ }
3433
+ if (this.isDeleteByIcon) {
3434
+ if (this.isAddedByMoreBtn) {
3435
+ this.oddsbomBulletAddedByMoreBtnDeleteEvent.emit(this.text);
3436
+ }
3437
+ else {
3438
+ this.oddsbomBulletDeleteEvent.emit(this.idx);
3439
+ }
3440
+ return;
3441
+ }
3442
+ if (!this.disabled) {
3443
+ this.oddsbomBulletToggleEvent.emit(this.idx);
3444
+ }
3445
+ }
3446
+ render() {
3447
+ return (index.h("div", { key: 'e21cf46108e35dcbf7d65e8c6a5f12f5d5ae49cb', class: "OddsbomBullet", ref: (el) => (this.stylingContainer = el) }, index.h("button", { key: '4edf5cd481d8283bd71f6806b6f93949e1308095', class: {
3448
+ OddsbomBulletBtn__normal: true,
3449
+ OddsbomBulletBtn__selected: this.isSelected,
3450
+ OddsbomBulletBtn__disabled: this.disabled,
3451
+ isDeleteByIcon: this.isDeleteByIcon,
3452
+ isCallDialogBtn: this.isCallDialogBtn || this.isReading
3453
+ }, onClick: this.handleClick.bind(this), disabled: this.disabled }, index.h("span", { key: 'fa1aed0293dc004808e6992c069d6992317b0788', class: "OddsbomBullet--deleteIcon", innerHTML: DeleteFilledIcon }), index.h("span", { key: '53ed96f2c2b833d21488049f987b6131718d563e', class: "OddsbomBullet--text" }, this.text))));
3454
+ }
3455
+ static get watchers() { return {
3456
+ "clientStyling": ["handleClientStylingChange"],
3457
+ "clientStylingUrl": ["handleClientStylingUrlChange"],
3458
+ "mbSource": ["handleMbSourceChange"]
3459
+ }; }
3460
+ };
3461
+ LotteryOddsbomBullet.style = LotteryOddsbomBulletStyle0;
3462
+
3463
+ const generateUUID$1 = () => {
3464
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
3465
+ var r = (Math.random() * 16) | 0, v = c == 'x' ? r : (r & 0x3) | 0x8;
3466
+ return v.toString(16);
3467
+ });
3468
+ };
3469
+ function fetchRequest$2(url, method = 'GET', body = null, headers = {}) {
3470
+ return new Promise((resolve, reject) => {
3471
+ const uuid = generateUUID$1();
3472
+ const headersOrigin = Object.assign({ 'Content-Type': 'application/json' }, headers);
3473
+ if (method !== 'GET' && method !== 'HEAD') {
3474
+ headersOrigin['X-Idempotency-Key'] = uuid;
3475
+ }
3476
+ const options = {
3477
+ method,
3478
+ headers: headersOrigin,
3479
+ body: null
3480
+ };
3481
+ if (body && method !== 'GET' && method !== 'HEAD') {
3482
+ options.body = JSON.stringify(body);
3483
+ }
3484
+ else {
3485
+ delete options.body;
3486
+ }
3487
+ fetch(url, options)
3488
+ .then((response) => {
3489
+ if (!response.ok) {
3490
+ reject(`HTTP error! Status: ${response.status}`);
3491
+ throw new Error(`HTTP error! Status: ${response.status}`);
3492
+ }
3493
+ return response.json();
3494
+ })
3495
+ .then((data) => resolve(data))
3496
+ .catch((error) => reject(error));
3497
+ });
3498
+ }
3499
+ function toQueryParams$1(params) {
3500
+ function isEmptyValueOfArray(arr) {
3501
+ if (arr.length === 0) {
3502
+ return true;
3503
+ }
3504
+ const len = arr.length;
3505
+ let count = 0;
3506
+ for (let i = 0; i < len; i++) {
3507
+ if (isEmptyValue(arr[i])) {
3508
+ count++;
3509
+ }
3510
+ else {
3511
+ return false;
3512
+ }
3513
+ }
3514
+ if (count === len) {
3515
+ return true;
3516
+ }
3517
+ return false;
3518
+ }
3519
+ function isEmptyValueOfObject(obj) {
3520
+ if (Object.keys(obj).length === 0) {
3521
+ return true;
3522
+ }
3523
+ const len = Object.keys(obj).length;
3524
+ let count = 0;
3525
+ for (const val of Object.values(obj)) {
3526
+ if (isEmptyValue(val)) {
3527
+ count++;
3528
+ }
3529
+ else {
3530
+ return false;
3531
+ }
3532
+ }
3533
+ if (count === len) {
3534
+ return true;
3535
+ }
3536
+ return false;
3537
+ }
3538
+ function isEmptyValue(value, allowZero) {
3539
+ if (value === null || value === undefined || value === '') {
3540
+ return true;
3541
+ }
3542
+ else if (value === 0 && allowZero) {
3543
+ return false;
3544
+ }
3545
+ else if (Array.isArray(value)) {
3546
+ return isEmptyValueOfArray(value);
3547
+ }
3548
+ else if (Object.prototype.toString.call(value) === '[object Object]') {
3549
+ return isEmptyValueOfObject(value);
3550
+ }
3551
+ else {
3552
+ return !value;
3553
+ }
3554
+ }
3555
+ const finalParams = {};
3556
+ Object.entries(params).forEach(([key, value]) => {
3557
+ if (!isEmptyValue(value, true)) {
3558
+ finalParams[key] = value;
3559
+ }
3560
+ });
3561
+ const queryString = Object.entries(finalParams)
3562
+ .map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`)
3563
+ .join('&');
3564
+ return queryString ? `?${queryString}` : '';
3565
+ }
3566
+ function transformResults(results) {
3567
+ if (results && results.length > 0) {
3568
+ return results.map((i) => i === null || i === void 0 ? void 0 : i[0]);
3569
+ }
3570
+ return [[]];
3571
+ }
3572
+ function thousandSeparator(value) {
3573
+ if (value === 0) {
3574
+ return '0';
3575
+ }
3576
+ if (!value) {
3577
+ return '';
3578
+ }
3579
+ value = value.toString();
3580
+ const parts = value.split('.');
3581
+ parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',');
3582
+ return parts.join('.');
3583
+ }
3584
+ function changeCurDrawItemByDate(date, drawList) {
3585
+ var _a, _b, _c;
3586
+ const curDrawItem = drawList.find((i) => i.date === date);
3587
+ if (!curDrawItem) {
3588
+ // NO DATA
3589
+ return Promise.reject();
3590
+ }
3591
+ const curDrawSelectionBettingType = curDrawItem.winningNumbers[0].winning_type;
3592
+ const curDrawSelectionMap = {};
3593
+ curDrawItem.winningNumbers.forEach((item) => {
3594
+ curDrawSelectionMap[item.winning_type] = transformResults(item.poolGameOutcomes);
3595
+ });
3596
+ const results = curDrawSelectionMap[curDrawSelectionBettingType];
3597
+ const curPrizeMap = {};
3598
+ curDrawItem.prizes.forEach((prize) => {
3599
+ const winningType = prize.winningType;
3600
+ if (!curPrizeMap[winningType]) {
3601
+ curPrizeMap[winningType] = [prize];
3602
+ }
3603
+ else {
3604
+ curPrizeMap[winningType].push(prize);
3605
+ curPrizeMap[winningType].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); });
3606
+ }
3607
+ });
3608
+ const prizes = (((_a = Object.values(curPrizeMap)) === null || _a === void 0 ? void 0 : _a[0]) || []);
3609
+ const currency = ((_c = (_b = prizes[0]) === null || _b === void 0 ? void 0 : _b.totalAmount) === null || _c === void 0 ? void 0 : _c.currency) || '';
3610
+ const { turnOver, winNumber, winTurnOver } = prizes.reduce((pre, cur) => {
3611
+ var _a;
3612
+ const { turnOver: _turnOver, winNumber: _winNumber, winTurnOver: _winTurnOver } = pre;
3613
+ // FIXME: no turnover
3614
+ const turnOver = 0;
3615
+ const winNumber = _winNumber + Number(cur === null || cur === void 0 ? void 0 : cur.players);
3616
+ const winTurnOver = _turnOver + Number((_a = cur === null || cur === void 0 ? void 0 : cur.totalAmount) === null || _a === void 0 ? void 0 : _a.value);
3617
+ return {
3618
+ turnOver,
3619
+ winNumber,
3620
+ winTurnOver
3621
+ };
3622
+ }, {
3623
+ turnOver: 0,
3624
+ winNumber: 0,
3625
+ winTurnOver: 0
3626
+ });
3627
+ return Promise.resolve({
3628
+ date,
3629
+ formattedTurnOver: currency + ' ' + thousandSeparator(turnOver),
3630
+ winNumber,
3631
+ formattedWinTurnOver: currency + ' ' + thousandSeparator(winTurnOver),
3632
+ drawId: curDrawItem.id,
3633
+ results
3634
+ });
3635
+ }
3636
+ function findLatestDateIdx$1(dateArr) {
3637
+ const currentDate = new Date();
3638
+ let closestIndex = 0;
3639
+ let minDiff = Infinity;
3640
+ dateArr.forEach((dateStr, index) => {
3641
+ const date = new Date(dateStr);
3642
+ const diff = Math.abs(differenceInMilliseconds(currentDate, date));
3643
+ if (diff < minDiff) {
3644
+ minDiff = diff;
3645
+ closestIndex = index;
3646
+ }
3647
+ });
3648
+ return closestIndex;
3649
+ }
3650
+
3651
+ async function fetchGameInfo({ endpoint, gameId }) {
3652
+ if (!(endpoint && gameId))
3653
+ return;
3654
+ const gameInfo = await fetchRequest$2(`${endpoint}/games/${gameId}`, 'GET', {});
3655
+ return {
3656
+ vendorGameId: gameInfo === null || gameInfo === void 0 ? void 0 : gameInfo.type,
3657
+ gameName: gameInfo.name
3658
+ };
3659
+ }
3660
+ async function fetchDrawsInfo$1({ endpoint, gameId }) {
3661
+ if (!(endpoint && gameId))
3662
+ return;
3663
+ const GAME_DRAW_LIMIT = 9999;
3664
+ const filterData = { status: 'PAYABLE', limit: GAME_DRAW_LIMIT };
3665
+ const { items: drawList } = await fetchRequest$2(`${endpoint}/games/${gameId}/draws${toQueryParams$1(filterData)}`);
3666
+ if (!drawList || drawList.length === 0)
3667
+ return {};
3668
+ const settledDrawList = drawList
3669
+ .filter((item) => item.winningNumbers.length > 0)
3670
+ .sort((a, b) => a === null || a === void 0 ? void 0 : a.date.localeCompare(b === null || b === void 0 ? void 0 : b.date));
3671
+ const drawDatesOptions = settledDrawList.map((item) => item.date);
3672
+ return {
3673
+ drawDatesOptions,
3674
+ drawResultsList: settledDrawList
3675
+ };
3676
+ }
3677
+ async function fetchSaleStatistics({ endpoint, gameId, drawId }) {
3678
+ try {
3679
+ const res = await fetchRequest$2(`${endpoint}/games/${gameId}/draws/${drawId}/saleStatistics`);
3680
+ return res;
3681
+ }
3682
+ catch (error) {
3683
+ return Promise.reject(error);
3684
+ }
3685
+ }
3686
+
3687
+ const DEFAULT_LANGUAGE$1 = 'en';
3688
+ const SUPPORTED_LANGUAGES$1 = ['ro', 'en', 'fr', 'ar', 'hr'];
3689
+ const TRANSLATIONS$1 = {
3690
+ en: {
3691
+ weeks: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
3692
+ bettingType: 'Betting Type:',
3693
+ prizeAllocation: 'Prize Allocation (Turnover: €{turnover})',
3694
+ prizes: 'Prizes',
3695
+ numberOfWinners: 'Number of Winners',
3696
+ prizeMoney: 'Prize Money',
3697
+ noLatestResult: 'No latest result.',
3698
+ loading: 'Loading....',
3699
+ turnover: 'Turnover:',
3700
+ winners: 'winners,',
3701
+ prize: 'Prize:',
3702
+ },
3703
+ };
3704
+ const translate$1 = (key, customLang, replacements) => {
3705
+ const lang = customLang;
3706
+ let translation = TRANSLATIONS$1[lang !== undefined && SUPPORTED_LANGUAGES$1.includes(lang) ? lang : DEFAULT_LANGUAGE$1][key];
3707
+ if (replacements) {
3708
+ Object.keys(replacements).forEach((placeholder) => {
3709
+ translation = translation.replace(`{${placeholder}}`, replacements[placeholder]);
3710
+ });
3711
+ }
3712
+ return translation;
3713
+ };
3714
+ const getTranslations$1 = (data) => {
3715
+ Object.keys(data).forEach((item) => {
3716
+ for (let key in data[item]) {
3717
+ TRANSLATIONS$1[item][key] = data[item][key];
3718
+ }
3719
+ });
3720
+ };
3721
+ const resolveTranslationUrl$1 = async (translationUrl) => {
3722
+ if (translationUrl) {
3723
+ try {
3724
+ const response = await fetch(translationUrl);
3725
+ if (!response.ok) {
3726
+ throw new Error(`HTTP error! status: ${response.status}`);
3727
+ }
3728
+ const translations = await response.json();
3729
+ getTranslations$1(translations);
3730
+ }
3731
+ catch (error) {
3732
+ console.error('Failed to fetch or parse translations from URL:', error);
3733
+ }
3734
+ }
3735
+ };
3736
+
3737
+ 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}";
3738
+ const LotteryOddsbomLatestResultStyle0 = lotteryOddsbomLatestResultCss;
3739
+
3740
+ const BombIcons = {
3741
+ ['Football']: (index.h("svg", { height: "18px", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", class: "text-sm" }, index.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" })))
3742
+ };
3743
+ const LotteryOddsbomLatestResult = class {
3744
+ constructor(hostRef) {
3745
+ index.registerInstance(this, hostRef);
3746
+ this.getGameDrawInfoEvent = index.createEvent(this, "getGameDrawInfo", 7);
3747
+ this.mbSource = undefined;
3748
+ this.clientStyling = undefined;
3749
+ this.clientStylingUrl = undefined;
3750
+ this.translationUrl = '';
3751
+ this.language = 'en';
3752
+ this.endpoint = undefined;
3753
+ this.gameId = undefined;
3754
+ this.curDate = undefined;
3755
+ this.showLoading = true;
3756
+ this.hideWrapperEmpty = false;
3757
+ this.isPassingData = false;
3758
+ this.drawResults = '';
3759
+ this.isEmpty = true;
3760
+ this._curDate = undefined;
3761
+ this.drawResultsList = [];
3762
+ this.curDrawItem = {};
3763
+ this.curTurnOver = 0;
3764
+ this.isLoadingTurnover = false;
3765
+ this.vendorGameId = undefined;
3766
+ this.gameName = undefined;
3767
+ this.isLoading = false;
3768
+ }
3769
+ handleClientStylingChange(newValue, oldValue) {
3770
+ if (newValue != oldValue) {
3771
+ lotteryOddsbomEntrance.setClientStyling(this.stylingContainer, this.clientStyling);
3772
+ }
3773
+ }
3774
+ handleClientStylingUrlChange(newValue, oldValue) {
3775
+ if (newValue != oldValue) {
3776
+ lotteryOddsbomEntrance.setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
3777
+ }
3778
+ }
3779
+ handleMbSourceChange(newValue, oldValue) {
3780
+ if (newValue != oldValue) {
3781
+ lotteryOddsbomEntrance.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
3782
+ }
3783
+ }
3784
+ async handleDateChange(n, o) {
3785
+ if (n !== o) {
3786
+ await this.setCurItem(n);
3787
+ if (this.curDrawItem && this.curDrawItem.drawId) {
3788
+ this.getTurnOver();
3789
+ }
3790
+ }
3791
+ }
3792
+ async handleDrawResultsChange(n, o) {
3793
+ if (n !== o) {
3794
+ await this.setDrawResults();
3795
+ }
3796
+ }
3797
+ async getTurnOver() {
3798
+ var _a, _b;
3799
+ try {
3800
+ this.isLoadingTurnover = true;
3801
+ const res = await fetchSaleStatistics({
3802
+ endpoint: this.endpoint,
3803
+ gameId: this.vendorGameId,
3804
+ drawId: this.curDrawItem.drawId
3805
+ });
3806
+ 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;
3807
+ }
3808
+ catch (e) {
3809
+ console.error(e);
3810
+ }
3811
+ finally {
3812
+ this.isLoadingTurnover = false;
3813
+ }
3814
+ }
3815
+ get formattedTurnover() {
3816
+ const turnover = this.curTurnOver;
3817
+ const unit = '€';
3818
+ if (turnover === null || turnover === undefined)
3819
+ return '';
3820
+ return `${unit}${turnover ? thousandSeparator(turnover) : 0}`;
3821
+ }
3822
+ async setCurItem(curDate) {
3823
+ var _a;
3824
+ try {
3825
+ if (curDate && ((_a = this.drawResultsList) === null || _a === void 0 ? void 0 : _a.length)) {
3826
+ this.curDrawItem = await changeCurDrawItemByDate(curDate, this.drawResultsList);
3827
+ this.isEmpty = false;
3828
+ }
3829
+ else {
3830
+ this.isEmpty = true;
3831
+ }
3832
+ }
3833
+ catch (_b) {
3834
+ this.isEmpty = true;
3835
+ }
3836
+ }
3837
+ async setDrawResults() {
3838
+ try {
3839
+ if (this.drawResults) {
3840
+ this.drawResultsList = JSON.parse(this.drawResults);
3841
+ await this.setCurItem(this.curDate);
3842
+ }
3843
+ }
3844
+ catch (err) {
3845
+ console.error(err);
3846
+ }
3847
+ }
3848
+ componentDidLoad() {
3849
+ if (this.stylingContainer) {
3850
+ if (this.mbSource)
3851
+ lotteryOddsbomEntrance.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
3852
+ if (this.clientStyling)
3853
+ lotteryOddsbomEntrance.setClientStyling(this.stylingContainer, this.clientStyling);
3854
+ if (this.clientStylingUrl)
3855
+ lotteryOddsbomEntrance.setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
3856
+ }
3857
+ }
3858
+ disconnectedCallback() {
3859
+ this.stylingSubscription && this.stylingSubscription.unsubscribe();
3860
+ }
3861
+ async getDrawData() {
3862
+ if (this.isPassingData) {
3863
+ this.setDrawResults();
3864
+ }
3865
+ else {
3866
+ this.fetchData();
3867
+ }
3868
+ }
3869
+ async getGameInfo() {
3870
+ return fetchGameInfo({ endpoint: this.endpoint, gameId: this.gameId }).then(({ vendorGameId, gameName }) => {
3871
+ this.vendorGameId = vendorGameId;
3872
+ this.gameName = gameName;
3873
+ });
3874
+ }
3875
+ async componentWillLoad() {
3876
+ resolveTranslationUrl$1(this.translationUrl);
3877
+ await Promise.all([this.getDrawData(), this.getGameInfo()]);
3878
+ if (this.curDrawItem && this.curDrawItem.drawId) {
3879
+ this.getTurnOver();
3880
+ }
3881
+ }
3882
+ async fetchData() {
3883
+ this.isLoading = true;
3884
+ try {
3885
+ const res = await fetchDrawsInfo$1({ endpoint: this.endpoint, gameId: this.gameId });
3886
+ this.getGameDrawInfoEvent.emit({
3887
+ drawDatesOptions: res.drawDatesOptions,
3888
+ gameId: this.gameId
3889
+ });
3890
+ this.drawResultsList = res.drawResultsList;
3891
+ this._curDate = res.drawDatesOptions[findLatestDateIdx$1(res.drawDatesOptions)];
3892
+ await this.setCurItem(this._curDate);
3893
+ }
3894
+ catch (error) {
3895
+ this.getGameDrawInfoEvent.emit({
3896
+ drawDatesOptions: [],
3897
+ gameId: this.gameId
3898
+ });
3899
+ }
3900
+ finally {
3901
+ this.isLoading = false;
3902
+ }
3903
+ }
3904
+ renderLoading() {
3905
+ return (index.h("div", { class: "loading-wrap" }, index.h("section", { class: "dots-container" }, index.h("div", { class: "dot" }), index.h("div", { class: "dot" }), index.h("div", { class: "dot" }), index.h("div", { class: "dot" }), index.h("div", { class: "dot" }))));
3906
+ }
3907
+ renderEmpty() {
3908
+ return null;
3909
+ }
3910
+ renderMainContent() {
3911
+ var _a, _b, _c, _d, _e, _f;
3912
+ if (!(this.curDate || this._curDate) || this.isEmpty) {
3913
+ return this.renderEmpty();
3914
+ }
3915
+ return (index.h("div", { class: "lottery-tipping-latest-result" }, index.h("div", { class: "header-section match-info-section" }, index.h("div", { class: "match-details" }, index.h("span", { class: "title-icon" }, BombIcons.Football), index.h("span", { class: "title-text" }, this.gameName, ' ', this.isLoadingTurnover ? (index.h("div", { class: "loading-turnOver" }, index.h("ui-skeleton", { structure: "rectangle", width: "100px", height: "16px" }))) : (index.h("span", { class: "title-text__extra" }, "(", translate$1('turnover', this.language) + ' ' + this.formattedTurnover || 0, ")")))), index.h("div", { class: "prize-details" }, index.h("span", { class: "winners-count" }, (((_a = this.curDrawItem) === null || _a === void 0 ? void 0 : _a.winNumber) || 0) + ' ' + translate$1('winners', this.language)), index.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) && (index.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 }))));
3916
+ }
3917
+ render() {
3918
+ return (index.h("div", { key: '08c7308433c4d55f4cec1540002a03596155fe98', ref: (el) => (this.stylingContainer = el), class: {
3919
+ 'latest-result-wrapper': true,
3920
+ 'game-wrapper': !(this.hideWrapperEmpty && this.isEmpty)
3921
+ } }, this.isLoading && this.showLoading ? this.renderLoading() : this.renderMainContent()));
3922
+ }
3923
+ static get watchers() { return {
3924
+ "clientStyling": ["handleClientStylingChange"],
3925
+ "clientStylingUrl": ["handleClientStylingUrlChange"],
3926
+ "mbSource": ["handleMbSourceChange"],
3927
+ "curDate": ["handleDateChange"],
3928
+ "drawResults": ["handleDrawResultsChange"]
3929
+ }; }
3930
+ };
3931
+ LotteryOddsbomLatestResult.style = LotteryOddsbomLatestResultStyle0;
3932
+
3933
+ const generateUUID = () => {
3934
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
3935
+ var r = (Math.random() * 16) | 0, v = c == 'x' ? r : (r & 0x3) | 0x8;
3936
+ return v.toString(16);
3937
+ });
3938
+ };
3939
+ function fetchRequest$1(url, method = 'GET', body = null, headers = {}) {
3940
+ return new Promise((resolve, reject) => {
3941
+ const uuid = generateUUID();
3942
+ const headersOrigin = Object.assign({ 'Content-Type': 'application/json' }, headers);
3943
+ if (method !== 'GET' && method !== 'HEAD') {
3944
+ headersOrigin['X-Idempotency-Key'] = uuid;
3945
+ }
3946
+ const options = {
3947
+ method,
3948
+ headers: headersOrigin,
3949
+ body: null
3950
+ };
3951
+ if (body && method !== 'GET' && method !== 'HEAD') {
3952
+ options.body = JSON.stringify(body);
3953
+ }
3954
+ else {
3955
+ delete options.body;
3956
+ }
3957
+ fetch(url, options)
3958
+ .then((response) => {
3959
+ if (!response.ok) {
3960
+ reject(`HTTP error! Status: ${response.status}`);
3961
+ throw new Error(`HTTP error! Status: ${response.status}`);
3962
+ }
3963
+ return response.json();
3964
+ })
3965
+ .then((data) => resolve(data))
3966
+ .catch((error) => reject(error));
3967
+ });
3968
+ }
3969
+ function toQueryParams(params) {
3970
+ function isEmptyValueOfArray(arr) {
3971
+ if (arr.length === 0) {
3972
+ return true;
3973
+ }
3974
+ const len = arr.length;
3975
+ let count = 0;
3976
+ for (let i = 0; i < len; i++) {
3977
+ if (isEmptyValue(arr[i])) {
3978
+ count++;
3979
+ }
3980
+ else {
3981
+ return false;
3982
+ }
3983
+ }
3984
+ if (count === len) {
3985
+ return true;
3986
+ }
3987
+ return false;
3988
+ }
3989
+ function isEmptyValueOfObject(obj) {
3990
+ if (Object.keys(obj).length === 0) {
3991
+ return true;
3992
+ }
3993
+ const len = Object.keys(obj).length;
3994
+ let count = 0;
3995
+ for (const val of Object.values(obj)) {
3996
+ if (isEmptyValue(val)) {
3997
+ count++;
3998
+ }
3999
+ else {
4000
+ return false;
4001
+ }
4002
+ }
4003
+ if (count === len) {
4004
+ return true;
4005
+ }
4006
+ return false;
4007
+ }
4008
+ function isEmptyValue(value, allowZero) {
4009
+ if (value === null || value === undefined || value === '') {
4010
+ return true;
4011
+ }
4012
+ else if (value === 0 && allowZero) {
4013
+ return false;
4014
+ }
4015
+ else if (Array.isArray(value)) {
4016
+ return isEmptyValueOfArray(value);
4017
+ }
4018
+ else if (Object.prototype.toString.call(value) === '[object Object]') {
4019
+ return isEmptyValueOfObject(value);
4020
+ }
4021
+ else {
4022
+ return !value;
4023
+ }
4024
+ }
4025
+ const finalParams = {};
4026
+ Object.entries(params).forEach(([key, value]) => {
4027
+ if (!isEmptyValue(value, true)) {
4028
+ finalParams[key] = value;
4029
+ }
4030
+ });
4031
+ const queryString = Object.entries(finalParams)
4032
+ .map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`)
4033
+ .join('&');
4034
+ return queryString ? `?${queryString}` : '';
4035
+ }
4036
+ function findLatestDateIdx(dateArr) {
4037
+ const currentDate = new Date();
4038
+ let closestIndex = 0;
4039
+ let minDiff = Infinity;
4040
+ dateArr.forEach((dateStr, index) => {
4041
+ const date = new Date(dateStr);
4042
+ const diff = Math.abs(differenceInMilliseconds(currentDate, date));
4043
+ if (diff < minDiff) {
4044
+ minDiff = diff;
4045
+ closestIndex = index;
4046
+ }
4047
+ });
4048
+ return closestIndex;
4049
+ }
4050
+ function getUniqueDatesOptions(preDates = [], dates = []) {
4051
+ const dateSet = new Set();
4052
+ dates.forEach((date) => {
4053
+ if (!dateSet.has(date)) {
4054
+ dateSet.add(date);
4055
+ preDates.push(date);
4056
+ }
4057
+ });
4058
+ return preDates.length ? [...sortDates(preDates)] : [];
4059
+ }
4060
+ function sortDates(dateArray) {
4061
+ return dateArray.slice().sort((a, b) => a.localeCompare(b));
4062
+ }
4063
+
4064
+ async function fetchDrawsInfo({ endpoint, gameId }) {
4065
+ if (!(endpoint && gameId))
4066
+ return;
4067
+ const GAME_DRAW_LIMIT = 9999;
4068
+ const filterData = { status: 'PAYABLE', limit: GAME_DRAW_LIMIT };
4069
+ const { items: drawList } = await fetchRequest$1(`${endpoint}/games/${gameId}/draws${toQueryParams(filterData)}`);
4070
+ if (!drawList || drawList.length === 0)
4071
+ return {};
4072
+ 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));
4073
+ const drawDatesOptions = settledDrawList.map((item) => item.date);
4074
+ return {
4075
+ drawDatesOptions,
4076
+ drawResultsList: settledDrawList
4077
+ };
4078
+ }
4079
+ function fetchData({ endpoint, gameIds }) {
4080
+ if (!(endpoint && gameIds))
4081
+ return;
4082
+ return Promise.allSettled(gameIds.map((gameId) => fetchDrawsInfo({ endpoint, gameId })
4083
+ .then((res) => {
4084
+ return { gameId, drawResultsList: res.drawResultsList, drawDatesOptions: res.drawDatesOptions };
4085
+ })
4086
+ .catch((error) => {
4087
+ console.error(`Failed to fetch data for gameId: ${gameId}`, error);
4088
+ return { gameId, drawResultsList: [], drawDatesOptions: [] };
4089
+ }))).then((results) => {
4090
+ return results.reduce((pre, cur) => {
4091
+ if (cur.status === 'fulfilled') {
4092
+ const { gameId, drawResultsList, drawDatesOptions } = cur.value;
4093
+ pre[gameId] = {
4094
+ drawResultsList,
4095
+ drawDatesOptions
4096
+ };
4097
+ return pre;
4098
+ }
4099
+ }, {});
4100
+ });
4101
+ }
4102
+
4103
+ 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)}}";
4104
+ const LotteryOddsbomLatestResultGroupStyle0 = lotteryOddsbomLatestResultGroupCss;
4105
+
4106
+ const LotteryOddsbomLatestResultGroup = class {
4107
+ constructor(hostRef) {
4108
+ index.registerInstance(this, hostRef);
4109
+ this.mbSource = undefined;
4110
+ this.clientStyling = undefined;
4111
+ this.clientStylingUrl = undefined;
4112
+ this.translationUrl = '';
4113
+ this.language = 'en';
4114
+ this.endpoint = undefined;
4115
+ this.sessionId = undefined;
4116
+ this.playerId = '';
4117
+ this.gameIds = undefined;
4118
+ this.gameIdArr = [];
4119
+ this.drawDatesOptions = [];
4120
+ this.curDate = undefined;
4121
+ this.isLoading = false;
4122
+ this.drawResultsObj = {};
4123
+ }
4124
+ handleClientStylingChange(newValue, oldValue) {
4125
+ if (newValue != oldValue) {
4126
+ lotteryOddsbomEntrance.setClientStyling(this.stylingContainer, this.clientStyling);
4127
+ }
4128
+ }
4129
+ handleClientStylingUrlChange(newValue, oldValue) {
4130
+ if (newValue != oldValue) {
4131
+ lotteryOddsbomEntrance.setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
4132
+ }
4133
+ }
4134
+ handleMbSourceChange(newValue, oldValue) {
4135
+ if (newValue != oldValue) {
4136
+ lotteryOddsbomEntrance.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
4137
+ }
4138
+ }
4139
+ handleGameIdStringChange(newValue, oldValue) {
4140
+ var _a;
4141
+ if (newValue != oldValue) {
4142
+ this.gameIdArr = ((_a = this.gameIds) === null || _a === void 0 ? void 0 : _a.split(',')) || [];
4143
+ this.getData();
4144
+ }
4145
+ }
4146
+ componentDidLoad() {
4147
+ var _a;
4148
+ this.gameIdArr = ((_a = this.gameIds) === null || _a === void 0 ? void 0 : _a.split(',')) || [];
4149
+ this.getData();
4150
+ if (this.stylingContainer) {
4151
+ if (this.mbSource)
4152
+ lotteryOddsbomEntrance.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
4153
+ if (this.clientStyling)
4154
+ lotteryOddsbomEntrance.setClientStyling(this.stylingContainer, this.clientStyling);
4155
+ if (this.clientStylingUrl)
4156
+ lotteryOddsbomEntrance.setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
4157
+ }
4158
+ }
4159
+ disconnectedCallback() {
4160
+ this.stylingSubscription && this.stylingSubscription.unsubscribe();
4161
+ }
4162
+ getData() {
4163
+ this.isLoading = true;
4164
+ fetchData({ endpoint: this.endpoint, gameIds: this.gameIdArr })
4165
+ .then((res) => {
4166
+ this.drawResultsObj = res;
4167
+ const dates = Object.values(res)
4168
+ .map((i) => i.drawDatesOptions)
4169
+ .filter(Boolean)
4170
+ .flat();
4171
+ this.drawDatesOptions = getUniqueDatesOptions([], dates);
4172
+ this.curDate = this.drawDatesOptions[findLatestDateIdx(this.drawDatesOptions)];
4173
+ })
4174
+ .finally(() => {
4175
+ this.isLoading = false;
4176
+ });
4177
+ }
4178
+ handleChange(e) {
4179
+ const idx = e.detail;
4180
+ this.curDate = this.drawDatesOptions[idx];
4181
+ }
4182
+ handleNext() {
4183
+ if (this.curDate) {
4184
+ const idx = this.drawDatesOptions.findIndex((v) => v === this.curDate);
4185
+ if (idx < this.drawDatesOptions.length - 1) {
4186
+ this.curDate = this.drawDatesOptions[idx + 1];
4187
+ }
4188
+ }
4189
+ }
4190
+ handlePrev() {
4191
+ if (this.curDate) {
4192
+ const idx = this.drawDatesOptions.findIndex((v) => v === this.curDate);
4193
+ if (idx > 0) {
4194
+ this.curDate = this.drawDatesOptions[idx - 1];
4195
+ }
4196
+ }
4197
+ }
4198
+ renderLoading() {
4199
+ return (index.h("div", { class: "loading-wrap" }, index.h("section", { class: "dots-container" }, index.h("div", { class: "dot" }), index.h("div", { class: "dot" }), index.h("div", { class: "dot" }), index.h("div", { class: "dot" }), index.h("div", { class: "dot" }))));
4200
+ }
4201
+ renderMainContent() {
4202
+ return (index.h("div", null, this.curDate && (index.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) })), index.h("div", { class: "games-container" }, this.gameIdArr.map((gameId) => {
4203
+ var _a, _b;
4204
+ return (index.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 }));
4205
+ }))));
4206
+ }
4207
+ render() {
4208
+ return (index.h("div", { key: 'e576645b260f4a713cce833aae814ce7edad137e', ref: (el) => (this.stylingContainer = el), class: "lottery-tipping-latest-result-group" }, this.isLoading ? this.renderLoading() : this.renderMainContent()));
4209
+ }
4210
+ static get watchers() { return {
4211
+ "clientStyling": ["handleClientStylingChange"],
4212
+ "clientStylingUrl": ["handleClientStylingUrlChange"],
4213
+ "mbSource": ["handleMbSourceChange"],
4214
+ "gameIds": ["handleGameIdStringChange"]
4215
+ }; }
4216
+ };
4217
+ LotteryOddsbomLatestResultGroup.style = LotteryOddsbomLatestResultGroupStyle0;
4218
+
4219
+ const formatDate = ({ date, type = 'date', format: format$1 }) => {
4220
+ try {
4221
+ const parsedDate = parseISO(date);
4222
+ if (isNaN(parsedDate.getTime())) {
4223
+ throw new Error(`Invalid date: ${date}`);
4224
+ }
4225
+ if (format$1)
4226
+ return format(parsedDate, format$1);
4227
+ let formatStr = 'dd/MM/yyyy';
4228
+ if (type === 'time') {
4229
+ formatStr = 'dd/MM/yyyy HH:mm:ss';
4230
+ }
4231
+ else if (type === 'week') {
4232
+ formatStr = 'ccc dd/MM/yyyy HH:mm:ss';
4233
+ }
4234
+ return format(parsedDate, formatStr);
4235
+ }
4236
+ catch (error) {
4237
+ console.error('Error formatting date:', error.message);
4238
+ return '';
4239
+ }
4240
+ };
4241
+ function fetchRequest(url, method = 'GET', body = null, headers = {}) {
4242
+ return new Promise((resolve, reject) => {
4243
+ const headersOrigin = Object.assign({ 'Content-Type': 'application/json' }, headers);
4244
+ const options = {
4245
+ method,
4246
+ headers: headersOrigin,
4247
+ body: null
4248
+ };
4249
+ if (body && method !== 'GET' && method !== 'HEAD') {
4250
+ options.body = JSON.stringify(body);
4251
+ }
4252
+ else {
4253
+ delete options.body;
4254
+ }
4255
+ fetch(url, options)
4256
+ .then((response) => {
4257
+ if (!response.ok) {
4258
+ return response.json().then((errorData) => {
4259
+ const error = {
4260
+ status: response.status,
4261
+ statusText: response.statusText,
4262
+ code: errorData.code || 'UNKNOWN_ERROR',
4263
+ message: errorData.message || 'An unknown error occurred',
4264
+ data: errorData.data || null
4265
+ };
4266
+ reject(error);
4267
+ }, () => reject({
4268
+ status: response.status,
4269
+ statusText: response.statusText,
4270
+ code: 'PARSE_ERROR',
4271
+ message: 'Failed to parse error response'
4272
+ }));
4273
+ }
4274
+ else {
4275
+ return response.json();
4276
+ }
4277
+ })
4278
+ .then((data) => resolve(data), (error) => reject(error));
4279
+ });
4280
+ }
4281
+
4282
+ async function fetchTicketMatch({ endpoint, gameId, drawId }) {
4283
+ try {
4284
+ const res = await fetchRequest(`${endpoint}/poolgames/${gameId}/draws/${drawId}/matchConfig`);
4285
+ return res || [];
4286
+ }
4287
+ catch (e) {
4288
+ console.log(e);
4289
+ }
4290
+ }
4291
+ function getTeamsFromEventName(eventName) {
4292
+ if (!eventName)
4293
+ return '';
4294
+ return eventName.split('vs').map((i) => i.trim());
4295
+ }
4296
+ function resolveSelections(resInMatch) {
4297
+ const mySet1 = new Set();
4298
+ const mySet2 = new Set();
4299
+ for (const resInLine of resInMatch) {
4300
+ const [team1Score, team2Score] = resInLine.split(':');
4301
+ if (!mySet1.has(team1Score))
4302
+ mySet1.add(team1Score);
4303
+ if (!mySet2.has(team1Score))
4304
+ mySet2.add(team2Score);
4305
+ }
4306
+ return [Array.from(mySet1), Array.from(mySet2)];
4307
+ }
4308
+ async function buildTicketBetDataSource({ endpoint, gameId, drawId, results, splitView = false }) {
4309
+ const res = await fetchTicketMatch({ endpoint, gameId, drawId });
4310
+ if (splitView) {
4311
+ return (res.reduce((pre, item, index) => {
4312
+ const [team1Name, team2Name] = getTeamsFromEventName(item.eventName);
4313
+ const [team1Res, team2Res] = resolveSelections(results[index] || []);
4314
+ pre === null || pre === void 0 ? void 0 : pre.push({
4315
+ index: index + 1,
4316
+ teamName: team1Name,
4317
+ startTime: item.startTime,
4318
+ results: team1Res
4319
+ });
4320
+ pre === null || pre === void 0 ? void 0 : pre.push({
4321
+ index: index + 1,
4322
+ teamName: team2Name,
4323
+ startTime: item.startTime,
4324
+ results: team2Res
4325
+ });
4326
+ return pre;
4327
+ }, []) || []);
4328
+ }
4329
+ return res.map((item, index) => ({
4330
+ index: index + 1,
4331
+ eventName: item.eventName,
4332
+ startTime: item.startTime,
4333
+ results: results[index] || []
4334
+ }));
4335
+ }
4336
+
4337
+ const DEFAULT_LANGUAGE = 'en';
4338
+ const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'ar', 'hr'];
4339
+ const TRANSLATIONS = {
4340
+ en: {
4341
+ filter: 'Filter',
4342
+ clear: 'Clear',
4343
+ searchByTicketId: 'Search by Ticket ID',
4344
+ enterTicketId: 'Enter Ticket ID',
4345
+ searchByTicketType: 'Search by Ticket Type',
4346
+ selectTicketType: 'Select Ticket Type',
4347
+ searchByDate: 'Search by Date',
4348
+ from: 'From',
4349
+ to: 'To',
4350
+ normal: 'Normal',
4351
+ subscription: 'Subscription',
4352
+ ticketsHistory: 'Tickets History',
4353
+ settled: 'Settled',
4354
+ purchased: 'Purchased',
4355
+ canceled: 'Canceled',
4356
+ noData: 'No data Avaliable.',
4357
+ ticketId: 'Ticket ID:',
4358
+ ticketType: 'Ticket Type:',
4359
+ ticketAmount: 'Ticket Amount:',
4360
+ lineDetail: 'Line Detail:',
4361
+ seeDetails: 'See Details',
4362
+ numberOfDraw: 'Number of Draw:',
4363
+ ticketResult: 'Ticket Result:',
4364
+ drawId: 'Draw ID:',
4365
+ drawDate: 'Draw Date:',
4366
+ result: 'Result:',
4367
+ prize: 'Prize:',
4368
+ bettingType: 'Betting Type:'
4369
+ },
4370
+ ro: {
4371
+ ticketsHistory: 'Istoric bilete',
4372
+ settled: 'Decontat',
4373
+ purchased: 'Achiziționat',
4374
+ canceled: 'Anulat',
4375
+ noData: 'Nu sunt date disponibile.',
4376
+ ticketId: 'ID bilet:',
4377
+ ticketType: 'Tip bilet:',
4378
+ ticketAmount: 'Suma biletului:',
4379
+ lineDetail: 'Detaliu linie:',
4380
+ seeDetails: 'Vezi detalii',
4381
+ numberOfDraw: 'Număr de extrageri:',
4382
+ ticketResult: 'Rezultat bilet:',
4383
+ drawId: 'ID extragere:',
4384
+ drawDate: 'Data extragerii:',
4385
+ result: 'Rezultat:',
4386
+ prize: 'Premiu:',
4387
+ bettingType: 'Tip de pariu:'
4388
+ },
4389
+ fr: {
4390
+ ticketsHistory: 'Historique des billets',
4391
+ settled: 'Réglé',
4392
+ purchased: 'Acheté',
4393
+ canceled: 'Annulé',
4394
+ noData: 'Aucune donnée disponible.',
4395
+ ticketId: 'ID du billet:',
4396
+ ticketType: 'Type de billet:',
4397
+ ticketAmount: 'Montant du billet:',
4398
+ lineDetail: 'Détail de la ligne:',
4399
+ seeDetails: 'Voir les détails',
4400
+ numberOfDraw: 'Nombre de tirages:',
4401
+ ticketResult: 'Résultat du billet:',
4402
+ drawId: 'ID du tirage:',
4403
+ drawDate: 'Date du tirage:',
4404
+ result: 'Résultat:',
4405
+ prize: 'Prix:',
4406
+ bettingType: 'Type de pari:'
4407
+ },
4408
+ ar: {
4409
+ ticketsHistory: 'سجل التذاكر',
4410
+ settled: 'تمت التسوية',
4411
+ purchased: 'تم شراؤها',
4412
+ canceled: 'تم الإلغاء',
4413
+ noData: 'لا توجد بيانات متاحة.',
4414
+ ticketId: 'معرف التذكرة:',
4415
+ ticketType: 'نوع التذكرة:',
4416
+ ticketAmount: 'مبلغ التذكرة:',
4417
+ lineDetail: 'تفاصيل الخط:',
4418
+ seeDetails: 'انظر التفاصيل',
4419
+ numberOfDraw: 'عدد السحوبات:',
4420
+ ticketResult: 'نتيجة التذكرة:',
4421
+ drawId: 'معرف السحب:',
4422
+ drawDate: 'تاريخ السحب:',
4423
+ result: 'النتيجة:',
4424
+ prize: 'الجائزة:',
4425
+ bettingType: 'نوع الرهان:'
4426
+ },
4427
+ hr: {
4428
+ ticketsHistory: 'Povijest listića',
4429
+ settled: 'Riješeno',
4430
+ purchased: 'Kupljeno',
4431
+ canceled: 'Otkazano',
4432
+ noData: 'Nema dostupnih podataka.',
4433
+ ticketId: 'ID listića:',
4434
+ ticketType: 'Vrsta listića:',
4435
+ ticketAmount: 'Iznos listića:',
4436
+ lineDetail: 'Detalji linije:',
4437
+ seeDetails: 'Vidi detalje',
4438
+ numberOfDraw: 'Broj izvlačenja:',
4439
+ ticketResult: 'Rezultat listića:',
4440
+ drawId: 'ID izvlačenja:',
4441
+ drawDate: 'Datum izvlačenja:',
4442
+ result: 'Rezultat:',
4443
+ prize: 'Nagrada:',
4444
+ bettingType: 'Vrsta oklade:'
4445
+ }
4446
+ };
4447
+ const translate = (key, customLang, replacements) => {
4448
+ const lang = customLang;
4449
+ let translation = TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
4450
+ if (replacements) {
4451
+ Object.keys(replacements).forEach((placeholder) => {
4452
+ translation = translation === null || translation === void 0 ? void 0 : translation.replace(`{${placeholder}}`, replacements[placeholder]);
4453
+ });
4454
+ }
4455
+ return translation;
4456
+ };
4457
+ const getTranslations = (data) => {
4458
+ Object.keys(data).forEach((item) => {
4459
+ for (let key in data[item]) {
4460
+ TRANSLATIONS[item][key] = data[item][key];
4461
+ }
4462
+ });
4463
+ };
4464
+ const resolveTranslationUrl = async (translationUrl) => {
4465
+ if (translationUrl) {
4466
+ try {
4467
+ const response = await fetch(translationUrl);
4468
+ if (!response.ok) {
4469
+ throw new Error(`HTTP error! status: ${response.status}`);
4470
+ }
4471
+ const translations = await response.json();
4472
+ getTranslations(translations);
4473
+ }
4474
+ catch (error) {
4475
+ console.error('Failed to fetch or parse translations from URL:', error);
4476
+ }
4477
+ }
4478
+ };
4479
+
4480
+ 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}";
4481
+ const LotteryOddsbomTicketResultStyle0 = lotteryOddsbomTicketResultCss;
4482
+
4483
+ const LotteryOddsbomTicketResult = class {
4484
+ constructor(hostRef) {
4485
+ index.registerInstance(this, hostRef);
4486
+ this.latestRequestId = 0;
4487
+ this.mbSource = undefined;
4488
+ this.clientStyling = undefined;
4489
+ this.clientStylingUrl = undefined;
4490
+ this.translationUrl = '';
4491
+ this.language = 'en';
4492
+ this.sessionId = undefined;
4493
+ this.endpoint = '';
4494
+ this.gameId = undefined;
4495
+ this.drawId = undefined;
4496
+ this.defaultResults = undefined;
4497
+ this.splitView = false;
4498
+ this.allResults = undefined;
4499
+ this.ticketBetDataSource = [];
4500
+ this.isLoading = false;
4501
+ }
4502
+ handleClientStylingChange(newValue, oldValue) {
4503
+ if (newValue !== oldValue) {
4504
+ lotteryOddsbomEntrance.setClientStyling(this.stylingContainer, this.clientStyling);
4505
+ }
4506
+ }
4507
+ handleClientStylingUrlChange(newValue, oldValue) {
4508
+ if (newValue !== oldValue) {
4509
+ lotteryOddsbomEntrance.setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
4510
+ }
4511
+ }
4512
+ handleMbSourceChange(newValue, oldValue) {
4513
+ if (newValue !== oldValue) {
4514
+ lotteryOddsbomEntrance.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
4515
+ }
4516
+ }
4517
+ componentDidLoad() {
4518
+ if (this.stylingContainer) {
4519
+ if (this.mbSource)
4520
+ lotteryOddsbomEntrance.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
4521
+ if (this.clientStyling)
4522
+ lotteryOddsbomEntrance.setClientStyling(this.stylingContainer, this.clientStyling);
4523
+ if (this.clientStylingUrl)
4524
+ lotteryOddsbomEntrance.setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
4525
+ }
4526
+ }
4527
+ disconnectedCallback() {
4528
+ this.stylingSubscription && this.stylingSubscription.unsubscribe();
4529
+ }
4530
+ componentWillLoad() {
4531
+ resolveTranslationUrl(this.translationUrl);
4532
+ this.fetchMatchData();
4533
+ }
4534
+ async fetchMatchData() {
4535
+ const currentId = ++this.latestRequestId;
4536
+ if (!this.gameId || !this.drawId) {
4537
+ return;
4538
+ }
4539
+ try {
4540
+ if (this.defaultResults)
4541
+ this.allResults = JSON.parse(this.defaultResults);
4542
+ this.isLoading = true;
4543
+ const res = await buildTicketBetDataSource({
4544
+ endpoint: this.endpoint,
4545
+ gameId: this.gameId,
4546
+ drawId: this.drawId,
4547
+ results: this.allResults || [[]],
4548
+ splitView: this.splitView
4549
+ });
4550
+ if (currentId === this.latestRequestId) {
4551
+ this.ticketBetDataSource = res;
4552
+ }
4553
+ }
4554
+ finally {
4555
+ if (currentId === this.latestRequestId) {
4556
+ this.isLoading = false;
4557
+ }
4558
+ }
4559
+ }
4560
+ get columns() {
4561
+ const dateRender = (_, value) => formatDate({ date: value, format: 'ccc dd/MM HH:mm' });
4562
+ if (this.splitView) {
4563
+ return [
4564
+ {
4565
+ title: 'No.',
4566
+ value: 'index',
4567
+ width: 5,
4568
+ rowSpan: 2
4569
+ },
4570
+ {
4571
+ title: 'Date',
4572
+ value: 'startTime',
4573
+ width: 25,
4574
+ rowSpan: 2,
4575
+ nowrap: true,
4576
+ render: dateRender
4577
+ },
4578
+ {
4579
+ title: 'Team',
4580
+ value: 'teamName',
4581
+ width: 30
4582
+ },
4583
+ {
4584
+ title: 'Scores',
4585
+ value: 'results',
4586
+ width: 45,
4587
+ render: (_, value) => (index.h("div", { class: "flex gap-1" }, value.map((i) => (index.h("lottery-oddsbom-bullet", { text: i, "is-reading": true, "is-selected": true })))))
4588
+ }
4589
+ ];
4590
+ }
4591
+ const eventNameRender = (_, value) => (index.h("div", { class: "flex gap-1 eventNameContainer__item" }, index.h("span", { class: "eventNameContainer__item--title" }, value)));
4592
+ return [
4593
+ {
4594
+ title: 'Match',
4595
+ value: 'eventName',
4596
+ width: 50,
4597
+ render: eventNameRender
4598
+ },
4599
+ {
4600
+ title: 'Date',
4601
+ value: 'startTime',
4602
+ width: 25,
4603
+ nowrap: true,
4604
+ render: dateRender
4605
+ },
4606
+ {
4607
+ title: 'Match Result',
4608
+ value: 'results',
4609
+ width: 25,
4610
+ render: (_, value) => index.h("div", null, value === null || value === void 0 ? void 0 : value[0])
4611
+ }
4612
+ ];
4613
+ }
4614
+ renderLoading() {
4615
+ return (index.h("div", { class: "loading-wrap" }, index.h("section", { class: "dots-container" }, index.h("div", { class: "dot" }), index.h("div", { class: "dot" }), index.h("div", { class: "dot" }), index.h("div", { class: "dot" }), index.h("div", { class: "dot" }))));
4616
+ }
4617
+ renderEmpty() {
4618
+ return (index.h("div", { class: "LotteryTippingTicketBet__empty" }, index.h("p", null, translate('noData', this.language))));
4619
+ }
4620
+ renderTable({ columns, dataSource, hideHead = false, grid = true, bordered = true }) {
4621
+ const skipMap = {};
4622
+ return (index.h("table", { class: { bordered: bordered, grid: grid, 'my-table-component': true } }, !hideHead && (index.h("thead", null, index.h("tr", null, columns.map((column) => {
4623
+ var _a;
4624
+ return (index.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)));
4625
+ })))), index.h("tbody", null, dataSource.map((row, index$1) => (index.h("tr", { key: index$1 }, columns.map((column) => {
4626
+ if (skipMap[column.value] && skipMap[column.value] > 0) {
4627
+ skipMap[column.value]--;
4628
+ return null;
4629
+ }
4630
+ const span = column.rowSpan;
4631
+ if (span && span > 1) {
4632
+ skipMap[column.value] = span - 1;
4633
+ }
4634
+ return (index.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$1) : row[column.value]));
4635
+ })))))));
4636
+ }
4637
+ renderContent() {
4638
+ if (this.isLoading) {
4639
+ return this.renderLoading();
4640
+ }
4641
+ if (!this.ticketBetDataSource || this.ticketBetDataSource.length === 0) {
4642
+ return this.renderEmpty();
4643
+ }
4644
+ return (index.h("div", { class: "flex align-center LotteryTippingTicketBet__main" }, this.renderTable({
4645
+ columns: this.columns,
4646
+ dataSource: this.ticketBetDataSource || [],
4647
+ hideHead: false,
4648
+ grid: false,
4649
+ bordered: false
4650
+ })));
4651
+ }
4652
+ render() {
4653
+ return (index.h("div", { key: '9932926b2958b13636d617cc20a0c77a76a36ebe', ref: (el) => (this.stylingContainer = el), class: "LotteryTippingTicketBet__container" }, this.renderContent()));
4654
+ }
4655
+ static get watchers() { return {
4656
+ "clientStyling": ["handleClientStylingChange"],
4657
+ "clientStylingUrl": ["handleClientStylingUrlChange"],
4658
+ "mbSource": ["handleMbSourceChange"],
4659
+ "gameId": ["fetchMatchData"],
4660
+ "drawId": ["fetchMatchData"],
4661
+ "defaultResults": ["fetchMatchData"]
4662
+ }; }
4663
+ };
4664
+ LotteryOddsbomTicketResult.style = LotteryOddsbomTicketResultStyle0;
4665
+
4666
+ 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)}}";
4667
+ const UiSkeletonStyle0 = uiSkeletonCss;
4668
+
4669
+ const UiSkeleton = class {
4670
+ constructor(hostRef) {
4671
+ index.registerInstance(this, hostRef);
4672
+ this.stylingValue = {
4673
+ width: this.handleStylingProps(this.width),
4674
+ height: this.handleStylingProps(this.height),
4675
+ borderRadius: this.handleStylingProps(this.borderRadius),
4676
+ marginBottom: this.handleStylingProps(this.marginBottom),
4677
+ marginTop: this.handleStylingProps(this.marginTop),
4678
+ marginLeft: this.handleStylingProps(this.marginLeft),
4679
+ marginRight: this.handleStylingProps(this.marginRight),
4680
+ size: this.handleStylingProps(this.size),
4681
+ };
4682
+ this.structure = undefined;
4683
+ this.width = 'unset';
4684
+ this.height = 'unset';
4685
+ this.borderRadius = 'unset';
4686
+ this.marginBottom = 'unset';
4687
+ this.marginTop = 'unset';
4688
+ this.marginLeft = 'unset';
4689
+ this.marginRight = 'unset';
4690
+ this.animation = true;
4691
+ this.rows = 0;
4692
+ this.size = '100%';
4693
+ }
4694
+ handleStructureChange(newValue, oldValue) {
4695
+ if (oldValue !== newValue) {
4696
+ this.handleStructure(newValue);
4697
+ }
4698
+ }
4699
+ handleStylingProps(value) {
4700
+ switch (typeof value) {
4701
+ case 'number':
4702
+ return value === 0 ? 0 : `${value}px`;
4703
+ case 'undefined':
4704
+ return 'unset';
4705
+ case 'string':
4706
+ if (['auto', 'unset', 'none', 'inherit', 'initial'].includes(value) ||
4707
+ value.endsWith('px') ||
4708
+ value.endsWith('%')) {
4709
+ return value;
4710
+ }
4711
+ else {
4712
+ return 'unset';
4713
+ }
4714
+ default:
4715
+ return 'unset';
4716
+ }
4717
+ }
4718
+ handleStructure(structure) {
4719
+ switch (structure) {
4720
+ case 'logo':
4721
+ return this.renderLogo();
4722
+ case 'image':
4723
+ return this.renderImage();
4724
+ case 'title':
4725
+ return this.renderTitle();
4726
+ case 'text':
4727
+ return this.renderText();
4728
+ case 'rectangle':
4729
+ return this.renderRectangle();
4730
+ case 'circle':
4731
+ return this.renderCircle();
4732
+ default:
4733
+ return null;
4734
+ }
4735
+ }
4736
+ renderLogo() {
4737
+ return (index.h("div", { class: "SkeletonContainer" }, index.h("div", { class: 'SkeletonLogo ' + (this.animation ? 'Skeleton' : '') })));
4738
+ }
4739
+ renderImage() {
4740
+ return index.h("div", { class: 'SkeletonImage ' + (this.animation ? 'Skeleton' : '') });
4741
+ }
4742
+ renderTitle() {
4743
+ return (index.h("div", { class: "SkeletonContainer" }, index.h("div", { class: 'SkeletonTitle ' + (this.animation ? 'Skeleton' : '') })));
4744
+ }
4745
+ renderText() {
4746
+ return (index.h("div", { class: "SkeletonContainer" }, Array.from({ length: this.rows > 0 ? this.rows : 1 }).map((_, index$1) => (index.h("div", { key: index$1, class: 'SkeletonText ' + (this.animation ? 'Skeleton' : '') })))));
4747
+ }
4748
+ renderRectangle() {
4749
+ return (index.h("div", { class: "SkeletonContainer" }, index.h("div", { class: 'SkeletonRectangle ' + (this.animation ? 'Skeleton' : '') })));
4750
+ }
4751
+ renderCircle() {
4752
+ return (index.h("div", { class: "SkeletonContainer" }, index.h("div", { class: 'SkeletonCircle ' + (this.animation ? 'Skeleton' : '') })));
4753
+ }
4754
+ render() {
4755
+ let styleBlock = '';
4756
+ switch (this.structure) {
4757
+ case 'logo':
4758
+ styleBlock = `
4759
+ :host {
4760
+ --emw-skeleton-logo-width: ${this.stylingValue.width};
4761
+ --emw-skeleton-logo-height: ${this.stylingValue.height};
4762
+ --emw-skeleton-logo-border-radius: ${this.stylingValue.borderRadius};
4763
+ --emw-skeleton-logo-margin-bottom: ${this.stylingValue.marginBottom};
4764
+ --emw-skeleton-logo-margin-top: ${this.stylingValue.marginTop};
4765
+ --emw-skeleton-logo-margin-left: ${this.stylingValue.marginLeft};
4766
+ --emw-skeleton-logo-margin-right: ${this.stylingValue.marginRight};
4767
+ }
4768
+ `;
4769
+ break;
4770
+ case 'image':
4771
+ styleBlock = `
4772
+ :host {
4773
+ --emw-skeleton-image-width: ${this.stylingValue.width};
4774
+ --emw-skeleton-image-height: ${this.stylingValue.height};
4775
+ --emw-skeleton-image-border-radius: ${this.stylingValue.borderRadius};
4776
+ --emw-skeleton-image-margin-bottom: ${this.stylingValue.marginBottom};
4777
+ --emw-skeleton-image-margin-top: ${this.stylingValue.marginTop};
4778
+ --emw-skeleton-image-margin-left: ${this.stylingValue.marginLeft};
4779
+ --emw-skeleton-image-margin-right: ${this.stylingValue.marginRight};
4780
+ }
4781
+ `;
4782
+ break;
4783
+ case 'title':
4784
+ styleBlock = `
4785
+ :host {
4786
+ --emw-skeleton-title-width: ${this.stylingValue.width};
4787
+ --emw-skeleton-title-height: ${this.stylingValue.height};
4788
+ --emw-skeleton-title-border-radius: ${this.stylingValue.borderRadius};
4789
+ --emw-skeleton-title-margin-bottom: ${this.stylingValue.marginBottom};
4790
+ --emw-skeleton-title-margin-top: ${this.stylingValue.marginTop};
4791
+ --emw-skeleton-title-margin-left: ${this.stylingValue.marginLeft};
4792
+ --emw-skeleton-title-margin-right: ${this.stylingValue.marginRight};
4793
+ }
4794
+ `;
4795
+ break;
4796
+ case 'text':
4797
+ styleBlock = `
4798
+ :host {
4799
+ --emw-skeleton-text-width: ${this.stylingValue.width};
4800
+ --emw-skeleton-text-height: ${this.stylingValue.height};
4801
+ --emw-skeleton-text-border-radius: ${this.stylingValue.borderRadius};
4802
+ --emw-skeleton-text-margin-bottom: ${this.stylingValue.marginBottom};
4803
+ --emw-skeleton-text-margin-top: ${this.stylingValue.marginTop};
4804
+ --emw-skeleton-text-margin-left: ${this.stylingValue.marginLeft};
4805
+ --emw-skeleton-text-margin-right: ${this.stylingValue.marginRight};
4806
+ }
4807
+ `;
4808
+ break;
4809
+ case 'rectangle':
4810
+ styleBlock = `
4811
+ :host {
4812
+ --emw-skeleton-rectangle-width: ${this.stylingValue.width};
4813
+ --emw-skeleton-rectangle-height: ${this.stylingValue.height};
4814
+ --emw-skeleton-rectangle-border-radius: ${this.stylingValue.borderRadius};
4815
+ --emw-skeleton-rectangle-margin-bottom: ${this.stylingValue.marginBottom};
4816
+ --emw-skeleton-rectangle-margin-top: ${this.stylingValue.marginTop};
4817
+ --emw-skeleton-rectangle-margin-left: ${this.stylingValue.marginLeft};
4818
+ --emw-skeleton-rectangle-margin-right: ${this.stylingValue.marginRight};
4819
+ }
4820
+ `;
4821
+ break;
4822
+ case 'circle':
4823
+ styleBlock = `
4824
+ :host {
4825
+ --emw-skeleton-circle-size: ${this.stylingValue.size};
4826
+ }
4827
+ `;
4828
+ break;
4829
+ default:
4830
+ styleBlock = '';
4831
+ }
4832
+ return (index.h(index.Host, { key: 'c2a2650acd416962a2bc4e1a7ee18bc6d8e2def8' }, index.h("style", { key: '9bd7fc1f9e9ed9f17735a7b72fce6f09696f5e19' }, styleBlock), this.handleStructure(this.structure)));
4833
+ }
4834
+ static get watchers() { return {
4835
+ "structure": ["handleStructureChange"]
4836
+ }; }
4837
+ };
4838
+ UiSkeleton.style = UiSkeletonStyle0;
4839
+
2999
4840
  exports.lottery_oddsbom_entrance = lotteryOddsbomEntrance.LotteryOddsbomEntrance;
4841
+ exports.helper_date_navigator = HelperDateNavigator;
3000
4842
  exports.lottery_oddsbom_bomb = LotteryOddsbomBomb;
4843
+ exports.lottery_oddsbom_bullet = LotteryOddsbomBullet;
4844
+ exports.lottery_oddsbom_latest_result = LotteryOddsbomLatestResult;
4845
+ exports.lottery_oddsbom_latest_result_group = LotteryOddsbomLatestResultGroup;
4846
+ exports.lottery_oddsbom_ticket_result = LotteryOddsbomTicketResult;
4847
+ exports.ui_skeleton = UiSkeleton;