@everymatrix/lottery-oddsbom-entrance 0.0.5 → 0.0.6

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