@mjsz-vbr-elements/core 2.41.0 → 2.43.0

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.
@@ -0,0 +1,725 @@
1
+ /**
2
+ * name: @mjsz-vbr-elements/core
3
+ * version: v2.43.0 - 14/03/2026, 12:04:11
4
+ * (c) 2026
5
+ * description: Data visualization for MJSZ VBR
6
+ * author: Ákos Stegner <akos.stegner@gmail.com>
7
+ */
8
+ import { $ as e, A as t, B as n, C as r, D as i, E as a, F as o, G as s, I as c, J as l, K as ee, L as u, M as d, N as f, O as te, P as p, Q as ne, R as m, T as re, U as ie, V as h, W as ae, X as oe, Y as se, Z as ce, at as g, c as _, et as v, i as le, it as y, j as ue, k as de, n as fe, nt as pe, q as me, r as he, rt as ge, tt as b, z as x } from "./datetime-Dr5rQMCL.js";
9
+ import { DEFAULT_EXTERNAL_GAME_URL as _e, DEFAULT_EXTERNAL_PLAYER_URL as ve, DEFAULT_EXTERNAL_STATISTIC_URL as ye, DEFAULT_EXTERNAL_TEAM_URL as be, FLAG_BASE_URL as xe, SORT_STATE_ASCEND as Se } from "./constants.js";
10
+ //#region ../../node_modules/.pnpm/ramda@0.32.0/node_modules/ramda/es/add.js
11
+ var Ce = /* @__PURE__ */ y(function(e, t) {
12
+ return Number(e) + Number(t);
13
+ }), S = /* @__PURE__ */ y(function(e, t) {
14
+ if (e === t) return t;
15
+ function n(e, t) {
16
+ if (e > t != t > e) return t > e ? t : e;
17
+ }
18
+ var r = n(e, t);
19
+ if (r !== void 0) return r;
20
+ var i = n(typeof e, typeof t);
21
+ if (i !== void 0) return i === typeof e ? e : t;
22
+ var a = x(e), o = n(a, x(t));
23
+ return o === void 0 ? t : o === a ? e : t;
24
+ }), C = /* @__PURE__ */ y(function(e, t) {
25
+ return m(p(e), t);
26
+ }), we = /* @__PURE__ */ g(function(t) {
27
+ return e(t) ? !0 : !t || typeof t != "object" || f(t) ? !1 : t.length === 0 ? !0 : t.length > 0 ? t.hasOwnProperty(0) && t.hasOwnProperty(t.length - 1) : !1;
28
+ }), w = typeof Symbol < "u" ? Symbol.iterator : "@@iterator";
29
+ function Te(e, t, n) {
30
+ return function(r, i, a) {
31
+ if (we(a)) return e(r, i, a);
32
+ if (a == null) return i;
33
+ if (typeof a["fantasy-land/reduce"] == "function") return t(r, i, a, "fantasy-land/reduce");
34
+ if (a[w] != null) return n(r, i, a[w]());
35
+ if (typeof a.next == "function") return n(r, i, a);
36
+ if (typeof a.reduce == "function") return t(r, i, a, "reduce");
37
+ throw TypeError("reduce: list must be array or iterable");
38
+ };
39
+ }
40
+ //#endregion
41
+ //#region ../../node_modules/.pnpm/ramda@0.32.0/node_modules/ramda/es/internal/_xArrayReduce.js
42
+ function Ee(e, t, n) {
43
+ for (var r = 0, i = n.length; r < i;) {
44
+ if (t = e["@@transducer/step"](t, n[r]), t && t["@@transducer/reduced"]) {
45
+ t = t["@@transducer/value"];
46
+ break;
47
+ }
48
+ r += 1;
49
+ }
50
+ return e["@@transducer/result"](t);
51
+ }
52
+ //#endregion
53
+ //#region ../../node_modules/.pnpm/ramda@0.32.0/node_modules/ramda/es/bind.js
54
+ var De = /* @__PURE__ */ y(function(e, t) {
55
+ return ge(e.length, function() {
56
+ return e.apply(t, arguments);
57
+ });
58
+ });
59
+ //#endregion
60
+ //#region ../../node_modules/.pnpm/ramda@0.32.0/node_modules/ramda/es/internal/_xReduce.js
61
+ function Oe(e, t, n) {
62
+ for (var r = n.next(); !r.done;) {
63
+ if (t = e["@@transducer/step"](t, r.value), t && t["@@transducer/reduced"]) {
64
+ t = t["@@transducer/value"];
65
+ break;
66
+ }
67
+ r = n.next();
68
+ }
69
+ return e["@@transducer/result"](t);
70
+ }
71
+ function ke(e, t, n, r) {
72
+ return e["@@transducer/result"](n[r](De(e["@@transducer/step"], e), t));
73
+ }
74
+ var T = /* @__PURE__ */ Te(Ee, ke, Oe), Ae = /* @__PURE__ */ function() {
75
+ function e(e) {
76
+ this.f = e;
77
+ }
78
+ return e.prototype["@@transducer/init"] = function() {
79
+ throw Error("init not implemented on XWrap");
80
+ }, e.prototype["@@transducer/result"] = function(e) {
81
+ return e;
82
+ }, e.prototype["@@transducer/step"] = function(e, t) {
83
+ return this.f(e, t);
84
+ }, e;
85
+ }();
86
+ function E(e) {
87
+ return new Ae(e);
88
+ }
89
+ //#endregion
90
+ //#region ../../node_modules/.pnpm/ramda@0.32.0/node_modules/ramda/es/reduce.js
91
+ var D = /* @__PURE__ */ v(function(e, t, n) {
92
+ return T(typeof e == "function" ? E(e) : e, t, n);
93
+ }), je = /* @__PURE__ */ g(function(e) {
94
+ return b(D(S, 0, C("length", e)), function() {
95
+ for (var t = 0, n = e.length; t < n;) {
96
+ if (!e[t].apply(this, arguments)) return !1;
97
+ t += 1;
98
+ }
99
+ return !0;
100
+ });
101
+ }), O = /* @__PURE__ */ g(function(e) {
102
+ return function() {
103
+ return e;
104
+ };
105
+ }), Me = /* @__PURE__ */ g(function(e) {
106
+ return b(D(S, 0, C("length", e)), function() {
107
+ for (var t = 0, n = e.length; t < n;) {
108
+ if (e[t].apply(this, arguments)) return !0;
109
+ t += 1;
110
+ }
111
+ return !1;
112
+ });
113
+ }), k = /* @__PURE__ */ g(function(e) {
114
+ for (var t = me(e), n = t.length, r = [], i = 0; i < n;) r[i] = e[t[i]], i += 1;
115
+ return r;
116
+ }), A = /* @__PURE__ */ v(function(e, t, n) {
117
+ var r = e(t), i = e(n);
118
+ return r < i ? -1 : r > i ? 1 : 0;
119
+ }), j = /* @__PURE__ */ g(function(e) {
120
+ return b(e.length, e);
121
+ });
122
+ //#endregion
123
+ //#region ../../node_modules/.pnpm/ramda@0.32.0/node_modules/ramda/es/internal/_assoc.js
124
+ function Ne(t, n, r) {
125
+ if (u(t) && e(r)) {
126
+ var i = t < 0 ? r.length + t : t, a = [].concat(r);
127
+ return a[i] = n, a;
128
+ }
129
+ var o = {};
130
+ for (var s in r) o[s] = r[s];
131
+ return o[t] = n, o;
132
+ }
133
+ //#endregion
134
+ //#region ../../node_modules/.pnpm/ramda@0.32.0/node_modules/ramda/es/isNil.js
135
+ var Pe = /* @__PURE__ */ g(function(e) {
136
+ return e == null;
137
+ }), Fe = /* @__PURE__ */ v(function e(t, n, r) {
138
+ if (t.length === 0) return n;
139
+ var i = t[0];
140
+ if (t.length > 1) {
141
+ var a = o(i, r);
142
+ (Pe(a) || typeof a != "object") && (a = u(t[1]) ? [] : {}), n = e(Array.prototype.slice.call(t, 1), n, a);
143
+ }
144
+ return Ne(i, n, r);
145
+ }), Ie = /* @__PURE__ */ v(function(e, t, n) {
146
+ return Fe([e], t, n);
147
+ });
148
+ //#endregion
149
+ //#region ../../node_modules/.pnpm/ramda@0.32.0/node_modules/ramda/es/internal/_cloneRegExp.js
150
+ function M(e) {
151
+ return new RegExp(e.source, e.flags ? e.flags : (e.global ? "g" : "") + (e.ignoreCase ? "i" : "") + (e.multiline ? "m" : "") + (e.sticky ? "y" : "") + (e.unicode ? "u" : "") + (e.dotAll ? "s" : ""));
152
+ }
153
+ //#endregion
154
+ //#region ../../node_modules/.pnpm/ramda@0.32.0/node_modules/ramda/es/internal/_clone.js
155
+ function N(e, t, n) {
156
+ if (n ||= new Re(), Le(e)) return e;
157
+ var r = function(r) {
158
+ var i = n.get(e);
159
+ if (i) return i;
160
+ for (var a in n.set(e, r), e) Object.prototype.hasOwnProperty.call(e, a) && (r[a] = t ? N(e[a], !0, n) : e[a]);
161
+ return r;
162
+ };
163
+ switch (ee(e)) {
164
+ case "Object": return r(Object.create(Object.getPrototypeOf(e)));
165
+ case "Array": return r(Array(e.length));
166
+ case "Date": return new Date(e.valueOf());
167
+ case "RegExp": return M(e);
168
+ case "Int8Array":
169
+ case "Uint8Array":
170
+ case "Uint8ClampedArray":
171
+ case "Int16Array":
172
+ case "Uint16Array":
173
+ case "Int32Array":
174
+ case "Uint32Array":
175
+ case "Float32Array":
176
+ case "Float64Array":
177
+ case "BigInt64Array":
178
+ case "BigUint64Array": return e.slice();
179
+ default: return e;
180
+ }
181
+ }
182
+ function Le(e) {
183
+ var t = typeof e;
184
+ return e == null || t != "object" && t != "function";
185
+ }
186
+ var Re = /* @__PURE__ */ function() {
187
+ function e() {
188
+ this.map = {}, this.length = 0;
189
+ }
190
+ return e.prototype.set = function(e, t) {
191
+ var n = this.hash(e), r = this.map[n];
192
+ r || (this.map[n] = r = []), r.push([e, t]), this.length += 1;
193
+ }, e.prototype.hash = function(e) {
194
+ var t = [];
195
+ for (var n in e) t.push(Object.prototype.toString.call(e[n]));
196
+ return t.join();
197
+ }, e.prototype.get = function(e) {
198
+ if (this.length <= 180) {
199
+ for (var t in this.map) for (var n = this.map[t], r = 0; r < n.length; r += 1) {
200
+ var i = n[r];
201
+ if (i[0] === e) return i[1];
202
+ }
203
+ return;
204
+ }
205
+ var a = this.hash(e), n = this.map[a];
206
+ if (n) for (var r = 0; r < n.length; r += 1) {
207
+ var i = n[r];
208
+ if (i[0] === e) return i[1];
209
+ }
210
+ }, e;
211
+ }(), ze = /* @__PURE__ */ g(function(e) {
212
+ return e != null && typeof e.clone == "function" ? e.clone() : N(e, !0);
213
+ });
214
+ //#endregion
215
+ //#region ../../node_modules/.pnpm/ramda@0.32.0/node_modules/ramda/es/internal/_pipe.js
216
+ function Be(e, t) {
217
+ return function() {
218
+ return t.call(this, e.apply(this, arguments));
219
+ };
220
+ }
221
+ //#endregion
222
+ //#region ../../node_modules/.pnpm/ramda@0.32.0/node_modules/ramda/es/internal/_checkForMethod.js
223
+ function P(t, n) {
224
+ return function() {
225
+ var r = arguments.length;
226
+ if (r === 0) return n();
227
+ var i = arguments[r - 1];
228
+ return e(i) || typeof i[t] != "function" ? n.apply(this, arguments) : i[t].apply(i, Array.prototype.slice.call(arguments, 0, r - 1));
229
+ };
230
+ }
231
+ //#endregion
232
+ //#region ../../node_modules/.pnpm/ramda@0.32.0/node_modules/ramda/es/tail.js
233
+ var Ve = /* @__PURE__ */ g(/* @__PURE__ */ P("tail", /* @__PURE__ */ (/* @__PURE__ */ v(/* @__PURE__ */ P("slice", function(e, t, n) {
234
+ return Array.prototype.slice.call(n, e, t);
235
+ })))(1, Infinity)));
236
+ //#endregion
237
+ //#region ../../node_modules/.pnpm/ramda@0.32.0/node_modules/ramda/es/pipe.js
238
+ function F() {
239
+ if (arguments.length === 0) throw Error("pipe requires at least one argument");
240
+ return ge(arguments[0].length, D(Be, arguments[0], Ve(arguments)));
241
+ }
242
+ //#endregion
243
+ //#region ../../node_modules/.pnpm/ramda@0.32.0/node_modules/ramda/es/reverse.js
244
+ var I = /* @__PURE__ */ g(function(e) {
245
+ return f(e) ? e.split("").reverse().join("") : Array.prototype.slice.call(e, 0).reverse();
246
+ });
247
+ //#endregion
248
+ //#region ../../node_modules/.pnpm/ramda@0.32.0/node_modules/ramda/es/compose.js
249
+ function L() {
250
+ if (arguments.length === 0) throw Error("compose requires at least one argument");
251
+ return F.apply(this, I(arguments));
252
+ }
253
+ //#endregion
254
+ //#region ../../node_modules/.pnpm/ramda@0.32.0/node_modules/ramda/es/head.js
255
+ var R = /* @__PURE__ */ g(function(e) {
256
+ return c(0, e);
257
+ }), He = /* @__PURE__ */ function() {
258
+ function e(e, t, n, r) {
259
+ this.valueFn = e, this.valueAcc = t, this.keyFn = n, this.xf = r, this.inputs = {};
260
+ }
261
+ return e.prototype["@@transducer/init"] = oe.init, e.prototype["@@transducer/result"] = function(e) {
262
+ for (var t in this.inputs) if (l(t, this.inputs) && (e = this.xf["@@transducer/step"](e, this.inputs[t]), e["@@transducer/reduced"])) {
263
+ e = e["@@transducer/value"];
264
+ break;
265
+ }
266
+ return this.inputs = null, this.xf["@@transducer/result"](e);
267
+ }, e.prototype["@@transducer/step"] = function(e, t) {
268
+ var n = this.keyFn(t);
269
+ return this.inputs[n] = this.inputs[n] || [n, N(this.valueAcc, !1)], this.inputs[n][1] = this.valueFn(this.inputs[n][1], t), e;
270
+ }, e;
271
+ }();
272
+ function Ue(e, t, n) {
273
+ return function(r) {
274
+ return new He(e, t, n, r);
275
+ };
276
+ }
277
+ //#endregion
278
+ //#region ../../node_modules/.pnpm/ramda@0.32.0/node_modules/ramda/es/reduceBy.js
279
+ var z = /* @__PURE__ */ pe(4, [], /* @__PURE__ */ ne([], Ue, function(e, t, n, r) {
280
+ return T(E(function(r, i) {
281
+ var a = n(i), o = e(l(a, r) ? r[a] : N(t, !1), i);
282
+ return o && o["@@transducer/reduced"] ? ce(r) : (r[a] = o, r);
283
+ }), {}, r);
284
+ })), B = /* @__PURE__ */ v(function(e, t, n) {
285
+ var r = e(t), i = e(n);
286
+ return r > i ? -1 : r < i ? 1 : 0;
287
+ }), We = /* @__PURE__ */ g(function(e) {
288
+ return c(-1, e);
289
+ }), V = /* @__PURE__ */ y(/* @__PURE__ */ P("groupBy", /* @__PURE__ */ z(function(e, t) {
290
+ return e.push(t), e;
291
+ }, []))), Ge = /* @__PURE__ */ v(function(e, t, n) {
292
+ return b(Math.max(e.length, t.length, n.length), function() {
293
+ return e.apply(this, arguments) ? t.apply(this, arguments) : n.apply(this, arguments);
294
+ });
295
+ }), Ke = /* @__PURE__ */ y(ae), qe = /* @__PURE__ */ z(function(e, t) {
296
+ return t;
297
+ }, null), Je = /* @__PURE__ */ v(function(e, t, n) {
298
+ return ie(function(t) {
299
+ return se(e, t, n);
300
+ }, t);
301
+ });
302
+ //#endregion
303
+ //#region ../../node_modules/.pnpm/ramda@0.32.0/node_modules/ramda/es/internal/_objectAssign.js
304
+ function Ye(e) {
305
+ if (e == null) throw TypeError("Cannot convert undefined or null to object");
306
+ for (var t = Object(e), n = 1, r = arguments.length; n < r;) {
307
+ var i = arguments[n];
308
+ if (i != null) for (var a in i) l(a, i) && (t[a] = i[a]);
309
+ n += 1;
310
+ }
311
+ return t;
312
+ }
313
+ var Xe = typeof Object.assign == "function" ? Object.assign : Ye, Ze = /* @__PURE__ */ g(function(e) {
314
+ return !ue(e);
315
+ }), Qe = /* @__PURE__ */ d(1, "join"), $e = /* @__PURE__ */ y(function(e, t) {
316
+ return function(n) {
317
+ return function(r) {
318
+ return m(function(e) {
319
+ return t(e, r);
320
+ }, n(e(r)));
321
+ };
322
+ };
323
+ }), et = /* @__PURE__ */ g(function(e) {
324
+ return $e(p(e), Ie(e));
325
+ }), tt = /* @__PURE__ */ D(Ce, 0), nt = /* @__PURE__ */ y(function(e, t) {
326
+ return Xe({}, t, e);
327
+ }), rt = /* @__PURE__ */ v(function(e, t, n) {
328
+ return de(function(t, n, r) {
329
+ return e(n, r);
330
+ }, t, n);
331
+ }), H = function(e) {
332
+ return {
333
+ value: e,
334
+ map: function(t) {
335
+ return H(t(e));
336
+ }
337
+ };
338
+ }, it = /* @__PURE__ */ v(function(e, t, n) {
339
+ return e(function(e) {
340
+ return H(t(e));
341
+ })(n).value;
342
+ }), at = /* @__PURE__ */ v(function(e, n, r) {
343
+ return s(t(n, r), e);
344
+ }), U = /* @__PURE__ */ y(function(e, t) {
345
+ for (var n = {}, r = 0; r < e.length;) e[r] in t && (n[e[r]] = t[e[r]]), r += 1;
346
+ return n;
347
+ }), W = /* @__PURE__ */ v(function(e, t, n) {
348
+ return s(e, p(t, n));
349
+ }), G = /* @__PURE__ */ v(function(e, t, n) {
350
+ return n.replace(e, t);
351
+ }), K = /* @__PURE__ */ y(function(e, t) {
352
+ return Array.prototype.slice.call(t, 0).sort(e);
353
+ }), q = /* @__PURE__ */ y(function(e, t) {
354
+ return Array.prototype.slice.call(t, 0).sort(function(t, n) {
355
+ var r = e(t), i = e(n);
356
+ return r < i ? -1 : r > i ? 1 : 0;
357
+ });
358
+ }), J = /* @__PURE__ */ y(function(e, t) {
359
+ return Array.prototype.slice.call(t, 0).sort(function(t, n) {
360
+ for (var r = 0, i = 0; r === 0 && i < e.length;) r = e[i](t, n), i += 1;
361
+ return r;
362
+ });
363
+ });
364
+ //#endregion
365
+ //#region ../../node_modules/.pnpm/ramda@0.32.0/node_modules/ramda/es/internal/_isRegExp.js
366
+ function ot(e) {
367
+ return Object.prototype.toString.call(e) === "[object RegExp]";
368
+ }
369
+ //#endregion
370
+ //#region ../../node_modules/.pnpm/ramda@0.32.0/node_modules/ramda/es/test.js
371
+ var st = /* @__PURE__ */ y(function(e, t) {
372
+ if (!ot(e)) throw TypeError("‘test’ requires a value of type RegExp as its first argument; received " + x(e));
373
+ return M(e).test(t);
374
+ }), ct = /* @__PURE__ */ d(0, "toLowerCase"), lt = /* @__PURE__ */ d(0, "toUpperCase"), ut = 0;
375
+ function dt() {
376
+ return ++ut;
377
+ }
378
+ //#endregion
379
+ //#region src/utils/convert.js
380
+ function ft(e = []) {
381
+ return {
382
+ result: [...e],
383
+ filteredRowsLength: 0,
384
+ isFiltered: !1,
385
+ value() {
386
+ return {
387
+ rows: this.result,
388
+ totalItems: this.isFiltered ? this.filteredRowsLength : e.length,
389
+ currentItems: this.currentItems
390
+ };
391
+ },
392
+ filter(e, t = [], n = !1) {
393
+ if (e) {
394
+ let r = t.map((t) => n ? F(i(t), s(e)) : F(p(t), ct, Ke(ct(e)))), a = h(F(j((e) => e.name ? it(et("name"), G(",", ""), e) : e), Me([...r])), this.result);
395
+ this.isFiltered = !0, this.filteredRowsLength = a.length, this.result = a;
396
+ }
397
+ return this;
398
+ },
399
+ sorted(e) {
400
+ if (!e.sortTarget || e.orders[0].direction === "original") return this;
401
+ let t = Ge(s(Se), O(A), O(B));
402
+ return this.result = J(e.orders.map((e) => L(t(e.direction), p)(e.target)))(this.result), this;
403
+ },
404
+ addIndex(e = null) {
405
+ return this.result.reduce((t, n, r) => {
406
+ let i = t.at(-1) || [], a = e && i[e] === n[e];
407
+ return n.index = a ? i.index : r + 1, n.indexClass = a ? "is-duplicated" : null, t.push(n), t;
408
+ }, []), this;
409
+ },
410
+ addContinuousIndex() {
411
+ return this.result = this.result.map((e, t) => ({
412
+ ...e,
413
+ index: t + 1
414
+ })), this;
415
+ },
416
+ pagination(e, t) {
417
+ if (!t) return this;
418
+ e = Number(e), t = Number(t);
419
+ let n = (e - 1) * t, r = n + t;
420
+ return this.result = this.result.slice(n, r), this;
421
+ },
422
+ more(e, t) {
423
+ return this.result = this.result.slice(Number(e), Number(t)), this;
424
+ },
425
+ playerName() {
426
+ return this.result = this.result.map((e) => ({
427
+ ...e,
428
+ name: Nt(e)
429
+ })), this;
430
+ },
431
+ teamName() {
432
+ return this.result = this.result.map((e) => ({
433
+ ...e,
434
+ teamName: e.team.longName
435
+ })), this;
436
+ },
437
+ schedule(e = "", t = "hu") {
438
+ return this.result = this.result.map((n) => ({
439
+ ...n,
440
+ gameResult: `${n.homeTeamScore}-${n.awayTeamScore}`,
441
+ gameDateDate: _(n.gameDate, "L dddd", e, t),
442
+ gameDateTime: _(n.gameDate, "HH:mm", e, t)
443
+ })), this;
444
+ },
445
+ gameDateFilter(e) {
446
+ return e === null || (this.result = this.result.filter((t) => new Date(t.gameDate).getMonth() === e)), this;
447
+ },
448
+ convertTimes(e = []) {
449
+ return this.result = this.result.map((t) => (e.map((e) => t[e] ? t[`${e}Sec`] = he(t[e]) : t), t)), this;
450
+ },
451
+ groupByDays() {
452
+ return this.currentItems = this.result.length, this.result = V((e) => _(e.gameDate, "YYYY-MM-DD"))(this.result), this;
453
+ },
454
+ slice(e = 3) {
455
+ return this.result = this.result.slice(0, e), this;
456
+ },
457
+ reverse(e) {
458
+ return e && (this.result = this.result.toReversed()), this;
459
+ }
460
+ };
461
+ }
462
+ var pt = (e, ...t) => m(L(...t))(e);
463
+ function Y(e) {
464
+ return {
465
+ ...e,
466
+ ...e.lastName && e.firstName && { name: `${e.lastName} ${e.firstName}` },
467
+ ...e.player?.playerId && { name: `${e.player.lastName} ${e.player.firstName}` },
468
+ ...e.player?.id && { name: `${e.player.lastName} ${e.player.firstName}` },
469
+ ...e.player?.nationality && { name: e.player?.nationality.includes("hu") ? `${e.player.lastName} ${e.player.firstName}` : `${e.player.lastName}, ${e.player.firstName}` },
470
+ ...e.nationality && { name: e.nationality.includes("hu") ? `${e.lastName} ${e.firstName}` : `${e.lastName}, ${e.firstName}` }
471
+ };
472
+ }
473
+ function X(e) {
474
+ return {
475
+ ...e,
476
+ ...e?.team?.id && { teamName: e.team.longName }
477
+ };
478
+ }
479
+ function mt(e = "", t = "hu") {
480
+ return (n) => ({
481
+ ...n,
482
+ gameDateDate: _(n.gameDate, "L dddd", e, t),
483
+ gameDateTime: _(n.gameDate, "HH:mm", e, t)
484
+ });
485
+ }
486
+ function ht(e) {
487
+ return (t) => ({
488
+ ...t,
489
+ gameResult: At(t, e)
490
+ });
491
+ }
492
+ function gt(e) {
493
+ return {
494
+ ...e,
495
+ opponent: kt(e)
496
+ };
497
+ }
498
+ function _t(e) {
499
+ return {
500
+ ...e,
501
+ resultType: jt(e)
502
+ };
503
+ }
504
+ var vt = /^\(|\)$/g, yt = /$/, bt = /\(.*?\)/;
505
+ function xt(e) {
506
+ return {
507
+ ...e,
508
+ rowClasses: e.optional ? "is-optional" : ""
509
+ };
510
+ }
511
+ function St(e = []) {
512
+ return (t) => ({
513
+ ...t,
514
+ [e]: t[e]?.toUpperCase()
515
+ });
516
+ }
517
+ function Ct(e = []) {
518
+ return (t) => (e.map((e) => t[e] ? t[`${e}Sec`] = he(t[e]) : t), t);
519
+ }
520
+ function wt(e = []) {
521
+ return (t) => (e.map((e) => t[e] ? t[`${e}Min`] = fe(t[e]) : t), t);
522
+ }
523
+ function Tt(e = []) {
524
+ return (t) => (e.map((e) => t[`${e}Min`] = le(t[e])), t);
525
+ }
526
+ function Et(e) {
527
+ return {
528
+ ...e,
529
+ periodResults: e.result?.match(bt)?.[0] ?? ""
530
+ };
531
+ }
532
+ function Dt(e) {
533
+ let t = [
534
+ e.championshipName,
535
+ ...e.championshipName === e.sectionName ? [] : [e.sectionName],
536
+ e.divisionName
537
+ ];
538
+ return {
539
+ ...e,
540
+ gameNames: t.join(" - ")
541
+ };
542
+ }
543
+ var Ot = J([
544
+ (e, t) => new Date(e.gameDate).getTime() - new Date(t.gameDate).getTime(),
545
+ A(p("id")),
546
+ A(p("gameId"))
547
+ ]), Z = K(((e) => (t, n) => t[e].localeCompare(n[e], "hu"))("name"));
548
+ function kt(e) {
549
+ return [e.isHomeGame ? null : "@", e.opponent?.shortName].join(" ");
550
+ }
551
+ function At(e) {
552
+ let t = e?.homeTeamScore, n = e?.awayTeamScore;
553
+ return e.isHomeGame || (t = e?.awayTeamScore, n = e?.homeTeamScore), [t, n].join(":");
554
+ }
555
+ function jt(e) {
556
+ let t = e.gameResult.split(":"), n = t[0] > t[1], r = t[0] < t[1];
557
+ return n && e.isOvertime ? "OTW" : n && e.isShootout ? "SOW" : n ? "W" : r && e.isOvertime ? "OTL" : r && e.isShootout ? "SOL" : r ? "L" : "D";
558
+ }
559
+ function Mt(e) {
560
+ return e.map((e) => ({
561
+ phaseId: e.phaseId,
562
+ phaseName: Object.values({
563
+ phaseName: e.phaseName,
564
+ ...e.phaseType?.phaseTypeName && e.phaseType.phaseTypeName !== e.phaseName && { phaseTypeName: e.phaseType.phaseTypeName },
565
+ ...e.phaseSubType?.phaseSubTypeName && { phaseSubTypeName: e.phaseSubType.phaseSubTypeName }
566
+ }).join("-")
567
+ }));
568
+ }
569
+ function Nt(e) {
570
+ return e.player ? e.player.nationality.includes("hu") ? `${e.player.lastName} ${e.player.firstName}` : `${e.player.lastName}, ${e.player.firstName}` : `${e.lastName} ${e.firstName}`;
571
+ }
572
+ var Pt = L(K(B(p("seasonName"))), m(U(["championshipId", "seasonName"]))), Ft = (e) => K(A(p("teamName")), e), It = L(q(p("sectionId")), n(L(ue, p("phases")))), Lt = L(p("sectionId"), R), Rt = L(p("phaseName"), R), zt = q(p("phaseId")), Bt = L(q(p("name")), m(L(Y, X))), Vt = L(p("phaseName"), We), Ht = L(lt, G("_", "-")), Ut = L(n(st(/-:-/)), a(",")), Wt = L(m(a(":")), m(re), a(","), G(vt, "")), Gt = J([B(p("startingFive"))]), Kt = L(Qe(", "), m((e) => `${e.lastName} ${e.firstName}`), n((e) => !e)), qt = L(V(p("eventPeriod")), I, n(W("Period", "type"))), Jt = V(p("row")), Yt = (e, t) => h(je([at(t, ["team", "id"]), W("Gól", "type")]), I(e)), Xt = L(m(Y), U(["headCoach", "secondCoach"])), Zt = L(I, m((e) => ({
573
+ ...e,
574
+ eventId: e.eventId ? e.eventId : dt()
575
+ }))), Qt = (e) => q(p("eventTimeSec"), Object.values(e));
576
+ function $t(e, t) {
577
+ return V(p("type"), m((e) => ({
578
+ ...Y(e),
579
+ role: t(`role.${e.role}`)
580
+ }), q((e) => {
581
+ let t = [
582
+ "first_referee",
583
+ "second_referee",
584
+ "first_line_judge",
585
+ "second_line_judge"
586
+ ].indexOf(e.role);
587
+ return t > -1 ? t : 4;
588
+ }, Object.values(e))));
589
+ }
590
+ var en = J([
591
+ B(p("points")),
592
+ A(p("gamesPlayed")),
593
+ B(p("w")),
594
+ B(p("gd")),
595
+ B(p("gf"))
596
+ ]), tn = (e, t) => n(W(e, "championshipId"), t), nn = (e, t) => h(W(e, "championshipId"), t), rn = L(n((e) => ["Rájátszás", "Újrajátszandó"].includes(e.phaseName)), i([0, "phases"])), an = L(V(ln), q((e) => [
597
+ "ld",
598
+ "rd",
599
+ "d"
600
+ ].includes(e.position?.toLowerCase()) ? 1 : [
601
+ "lw",
602
+ "rw",
603
+ "c"
604
+ ].includes(e.position?.toLowerCase()) ? 2 : 0), q(un), m(L(Y, X, St(["position"]))));
605
+ function on({ goalieStats: e, fieldPlayers: t, playersPenalty: r }) {
606
+ let a = m(i(["player", "playerId"]))(e), o = n((e) => a.includes(e.player.playerId), r), s = Je((e, t) => e.player.playerId === t, r, a), c = Q(t, o), l = Q(e, s);
607
+ return {
608
+ fieldPlayers: Z(c),
609
+ goalies: Z(l)
610
+ };
611
+ }
612
+ var sn = j((e, t) => F(h(at(t, ["team", "id"])), m(Y))(e));
613
+ function cn(e) {
614
+ let t = e.city ? it(et("city"), G(yt, ",")) : () => ({});
615
+ return L(Qe(" "), k, t, te(["type"]))(e);
616
+ }
617
+ function ln(e) {
618
+ return ["ld", "rd"].includes(e.position?.toLowerCase()) ? "defenders" : [
619
+ "lw",
620
+ "rw",
621
+ "c"
622
+ ].includes(e.position?.toLowerCase()) ? "forwards" : "goalies";
623
+ }
624
+ function un(e) {
625
+ return Number(e.jerseyNr);
626
+ }
627
+ function Q(e, t) {
628
+ return k(rt(nt, qe(i(["player", "playerId"]), e), qe(i(["player", "playerId"]), t)));
629
+ }
630
+ //#endregion
631
+ //#region src/utils/cookie.js
632
+ var dn = {
633
+ setCookie(e, t, n) {
634
+ let r = /* @__PURE__ */ new Date();
635
+ r.setTime(r.getTime() + n * 60 * 60 * 1e3);
636
+ let i = `expires=${r.toUTCString()}`;
637
+ document.cookie = `${e}=${t};${i};path=/`;
638
+ },
639
+ getCookie(e) {
640
+ let t = `${e}=`, n = document.cookie.split(";");
641
+ for (let e = 0; e < n.length; e++) {
642
+ let r = n[e];
643
+ for (; r.charAt(0) === " ";) r = r.substring(1);
644
+ if (r.indexOf(t) === 0) return r.substring(t.length, r.length);
645
+ }
646
+ return "";
647
+ },
648
+ checkCookie(e) {
649
+ return this.getCookie(e) !== "";
650
+ }
651
+ };
652
+ //#endregion
653
+ //#region src/utils/dom.js
654
+ function fn(e, t = "body") {
655
+ if (e) {
656
+ if (typeof t != "string") {
657
+ t?.append(e);
658
+ return;
659
+ }
660
+ document.querySelector(t)?.append(e);
661
+ }
662
+ }
663
+ function pn(e, t = () => ({})) {
664
+ return e.toSorted((e, n) => {
665
+ let r = t(e), i = t(n);
666
+ if (r === null || i === null) return 0;
667
+ let a = r.compareDocumentPosition(i);
668
+ return a & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : a & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
669
+ });
670
+ }
671
+ //#endregion
672
+ //#region src/utils/errors.js
673
+ var mn = class extends Error {
674
+ constructor(e, t = {}) {
675
+ let { key: n, cause: r } = t;
676
+ super(e), this.name = "WidgetError", this.key = n, this.cause = r;
677
+ }
678
+ }, hn = {
679
+ message: "Undefined Column name Message",
680
+ options: {
681
+ key: "undefined-column",
682
+ cause: {}
683
+ }
684
+ }, gn = {
685
+ message: "Invalid season name",
686
+ options: {
687
+ key: "invalid-season-name",
688
+ cause: {}
689
+ }
690
+ };
691
+ //#endregion
692
+ //#region src/utils/get-websocket-url.js
693
+ function _n(e) {
694
+ return `wss://api.icehockey.hu/socket/vbr${e}`;
695
+ }
696
+ //#endregion
697
+ //#region src/utils/resolvers.js
698
+ var $ = (e = "") => globalThis?.__MJSZ_VBR_WIDGET__?.[e];
699
+ function vn(e, t = {}) {
700
+ if (t.externalGameUrl) return t.externalGameUrl;
701
+ let n = $("gameResolver") || e;
702
+ return typeof n == "function" ? n(t) : n ? encodeURI(r(n, t)) : encodeURI(r(_e, t));
703
+ }
704
+ function yn(e, t = {}) {
705
+ let n = $("teamResolver") || e;
706
+ return typeof n == "function" ? n(t) : n ? encodeURI(r(n, t)) : encodeURI(r(be, t));
707
+ }
708
+ function bn(e, t = {}) {
709
+ let n = $("playerResolver") || e;
710
+ return typeof n == "function" ? n(t) : n ? encodeURI(r(n, t)) : encodeURI(r(ve, t));
711
+ }
712
+ function xn(e, t = {}) {
713
+ return typeof e == "function" ? e(t) : e ? encodeURI(r(e, t)) : encodeURI(r(ye, t));
714
+ }
715
+ var Sn = (e, t = "1x1") => `${xe}/flag:${e}-${t}.svg`;
716
+ function Cn(e) {
717
+ return e || ($("apiKey") ? $("apiKey") : "");
718
+ }
719
+ //#endregion
720
+ //#region src/utils/scroll.js
721
+ function wn() {
722
+ window.scrollTo(0, 0);
723
+ }
724
+ //#endregion
725
+ export { gt as $, It as A, pt as B, Wt as C, Ct as D, Ft as E, Kt as F, Lt as G, rn as H, Z as I, zt as J, Vt as K, on as L, mt as M, ht as N, wt as O, Jt as P, X as Q, Xt as R, Ut as S, Pt as T, xt as U, tn as V, Rt as W, Ot as X, Gt as Y, en as Z, qt as _, ze as _t, yn as a, an as at, Et as b, _n as c, W as ct, mn as d, tt as dt, _t as et, fn as f, Ze as ft, cn as g, F as gt, ft as h, I as ht, xn as i, Bt as it, Yt as j, Tt as k, gn as l, U as lt, dn as m, R as mt, vn as n, Zt as nt, Sn as o, St as ot, pn as p, We as pt, Qt as q, bn as r, sn as rt, Cn as s, q as st, wn as t, nn as tt, hn as u, nt as ut, Dt as v, Mt as w, Ht as x, $t as y, Y as z };