@mjsz-vbr-elements/core 2.31.2 → 2.33.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.
@@ -1,12 +1,12 @@
1
1
  /**
2
2
  * name: @mjsz-vbr-elements/core
3
- * version: v2.31.2 - 28/10/2025, 15:53:30
3
+ * version: v2.33.0 - 25/11/2025, 21:00:09
4
4
  * (c) 2025
5
5
  * description: Data visualization for MJSZ VBR
6
6
  * author: Ákos Stegner <akos.stegner@gmail.com>
7
7
  */
8
8
  import { SORT_STATE_ORIGINAL as de, SORT_STATE_ASCEND as ye } from "./constants.js";
9
- import { E as m, K as $, G as l, x as u, L as h, M as B, N as J, O as z, _ as f, P as A, J as ve, Q as K, R as ge, S as Ne, T as Q, U as Te, V as L, W as Se, X as _e, Y as Ie, Z as be, $ as Oe, a0 as Ae, a1 as G, C as Re, a2 as O, a3 as Ce, z as g, u as Ee, I as j, H as Pe, w as S, F as R, f as N, c as V, b as De, a as $e, v as je } from "./datetime-bWwGbGlR.js";
9
+ import { G as m, L as $, v as l, z as u, M as h, N as B, O as J, P as z, _ as f, Q as A, K as ve, R as K, S as ge, T as Ne, U as Q, V as Te, W as L, X as Se, Y as _e, Z as Ie, $ as be, a0 as Oe, a1 as Ae, a2 as G, E as Re, a3 as O, a4 as Ee, A as g, u as Pe, J as j, I as Ce, x as S, H as R, f as N, c as V, b as De, a as $e, w as je } from "./datetime-B_IKGlWy.js";
10
10
  var Z = /* @__PURE__ */ m(function(e, r) {
11
11
  if (e === r)
12
12
  return r;
@@ -242,13 +242,13 @@ function T() {
242
242
  throw new Error("pipe requires at least one argument");
243
243
  return z(arguments[0].length, M(Ke, arguments[0], Ve(arguments)));
244
244
  }
245
- var C = /* @__PURE__ */ h(function(e) {
245
+ var E = /* @__PURE__ */ h(function(e) {
246
246
  return J(e) ? e.split("").reverse().join("") : Array.prototype.slice.call(e, 0).reverse();
247
247
  });
248
248
  function o() {
249
249
  if (arguments.length === 0)
250
250
  throw new Error("compose requires at least one argument");
251
- return T.apply(this, C(arguments));
251
+ return T.apply(this, E(arguments));
252
252
  }
253
253
  var se = /* @__PURE__ */ h(function(t) {
254
254
  return Q(0, t);
@@ -339,14 +339,14 @@ var ue = /* @__PURE__ */ G(1, "join"), it = /* @__PURE__ */ m(function(e, r) {
339
339
  return ce(r(a));
340
340
  })(n).value;
341
341
  }), fe = /* @__PURE__ */ f(function(e, r, n) {
342
- return O(Ce(r, n), e);
342
+ return O(Ee(r, n), e);
343
343
  }), pe = /* @__PURE__ */ m(function(e, r) {
344
344
  for (var n = {}, a = 0; a < e.length; )
345
345
  e[a] in r && (n[e[a]] = r[e[a]]), a += 1;
346
346
  return n;
347
- }), E = /* @__PURE__ */ f(function(e, r, n) {
348
- return O(e, u(r, n));
349
347
  }), P = /* @__PURE__ */ f(function(e, r, n) {
348
+ return O(e, u(r, n));
349
+ }), C = /* @__PURE__ */ f(function(e, r, n) {
350
350
  return n.replace(e, r);
351
351
  }), W = /* @__PURE__ */ m(function(e, r) {
352
352
  return Array.prototype.slice.call(r, 0).sort(e);
@@ -370,29 +370,11 @@ var lt = /* @__PURE__ */ m(function(e, r) {
370
370
  throw new TypeError("‘test’ requires a value of type RegExp as its first argument; received " + $(e));
371
371
  return ae(e).test(r);
372
372
  }), H = /* @__PURE__ */ G(0, "toLowerCase"), ft = /* @__PURE__ */ G(0, "toUpperCase");
373
- function Ot(t, e = "body") {
374
- if (!t)
375
- return;
376
- if (typeof e != "string") {
377
- e?.append(t);
378
- return;
379
- }
380
- document.querySelector(e)?.append(t);
381
- }
382
- function At(t, e = () => ({})) {
383
- return t.slice().sort((r, n) => {
384
- const a = e(r), s = e(n);
385
- if (a === null || s === null)
386
- return 0;
387
- const i = a.compareDocumentPosition(s);
388
- return i & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : i & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
389
- });
390
- }
391
373
  let pt = 0;
392
374
  function mt() {
393
375
  return ++pt;
394
376
  }
395
- function Rt(t = []) {
377
+ function Ot(t = []) {
396
378
  return {
397
379
  result: [...t],
398
380
  filteredRowsLength: 0,
@@ -408,7 +390,7 @@ function Rt(t = []) {
408
390
  if (e) {
409
391
  const a = r.map(
410
392
  (c) => n ? T(S(c), O(e)) : T(u(c), H, rt(H(e)))
411
- ), s = ne((c) => c.name ? le(oe("name"), P(",", ""), c) : c), i = R(T(s, ke([...a])), this.result);
393
+ ), s = ne((c) => c.name ? le(oe("name"), C(",", ""), c) : c), i = R(T(s, ke([...a])), this.result);
412
394
  this.isFiltered = !0, this.filteredRowsLength = i.length, this.result = i;
413
395
  }
414
396
  return this;
@@ -474,10 +456,13 @@ function Rt(t = []) {
474
456
  },
475
457
  slice(e = 3) {
476
458
  return this.result = this.result.slice(0, e), this;
459
+ },
460
+ reverse(e) {
461
+ return e && (this.result = [...this.result].reverse()), this;
477
462
  }
478
463
  };
479
464
  }
480
- const Ct = (t, ...e) => l(o(...e))(t);
465
+ const At = (t, ...e) => l(o(...e))(t);
481
466
  function b(t) {
482
467
  return {
483
468
  ...t,
@@ -498,32 +483,32 @@ function me(t) {
498
483
  ...t?.team?.id && { teamName: t.team.longName }
499
484
  };
500
485
  }
501
- function Et(t = "", e = "hu") {
486
+ function Rt(t = "", e = "hu") {
502
487
  return (r) => ({
503
488
  ...r,
504
489
  gameDateDate: N(r.gameDate, "L dddd", t, e),
505
490
  gameDateTime: N(r.gameDate, "HH:mm", t, e)
506
491
  });
507
492
  }
508
- function Pt(t) {
493
+ function Et(t) {
509
494
  return (e) => ({
510
495
  ...e,
511
496
  gameResult: gt(e)
512
497
  });
513
498
  }
514
- function Dt(t) {
499
+ function Pt(t) {
515
500
  return {
516
501
  ...t,
517
502
  opponent: vt(t)
518
503
  };
519
504
  }
520
- function $t(t) {
505
+ function Ct(t) {
521
506
  return {
522
507
  ...t,
523
508
  resultType: Nt(t)
524
509
  };
525
510
  }
526
- function jt(t) {
511
+ function Dt(t) {
527
512
  return {
528
513
  ...t,
529
514
  rowClasses: t.optional ? "is-optional" : ""
@@ -535,22 +520,22 @@ function ht(t = []) {
535
520
  [t]: e[t]?.toUpperCase()
536
521
  });
537
522
  }
538
- function Bt(t = []) {
523
+ function $t(t = []) {
539
524
  return (e) => (t.map((r) => e[r] ? e[`${r}Sec`] = V(e[r]) : e), e);
540
525
  }
541
- function Lt(t = []) {
526
+ function jt(t = []) {
542
527
  return (e) => (t.map((r) => e[r] ? e[`${r}Min`] = De(e[r]) : e), e);
543
528
  }
544
- function Gt(t = []) {
529
+ function Bt(t = []) {
545
530
  return (e) => (t.map((r) => e[`${r}Min`] = $e(e[r])), e);
546
531
  }
547
- function Mt(t) {
532
+ function Lt(t) {
548
533
  return {
549
534
  ...t,
550
535
  periodResults: t.result?.match(/\(.*?\)/)?.[0] ?? ""
551
536
  };
552
537
  }
553
- const dt = (t, e) => new Date(t.gameDate).getTime() - new Date(e.gameDate).getTime(), xt = D([dt, _(u("id")), _(u("gameId"))]), yt = (t) => (e, r) => e[t].localeCompare(r[t], "hu"), X = W(yt("name"));
538
+ const dt = (t, e) => new Date(t.gameDate).getTime() - new Date(e.gameDate).getTime(), Gt = D([dt, _(u("id")), _(u("gameId"))]), yt = (t) => (e, r) => e[t].localeCompare(r[t], "hu"), X = W(yt("name"));
554
539
  function vt(t) {
555
540
  return [t.isHomeGame ? null : "@", t.opponent?.shortName].join(" ");
556
541
  }
@@ -562,7 +547,7 @@ function Nt(t) {
562
547
  const e = t.gameResult.split(":"), r = e[0] > e[1], n = e[0] < e[1];
563
548
  return r && t.isOvertime ? "OTW" : r && t.isShootout ? "SOW" : r ? "W" : n && t.isOvertime ? "OTL" : n && t.isShootout ? "SOL" : n ? "L" : "D";
564
549
  }
565
- function Ft(t) {
550
+ function Mt(t) {
566
551
  return t.map((e) => ({
567
552
  phaseId: e.phaseId,
568
553
  phaseName: Object.values({
@@ -577,43 +562,43 @@ function Ft(t) {
577
562
  function Tt(t) {
578
563
  return t.player ? t.player.nationality.includes("hu") ? `${t.player.lastName} ${t.player.firstName}` : `${t.player.lastName}, ${t.player.firstName}` : `${t.lastName} ${t.firstName}`;
579
564
  }
580
- const Wt = o(
565
+ const xt = o(
581
566
  W(y(u("seasonName"))),
582
567
  l(pe(["championshipId", "seasonName"]))
583
- ), Ut = (t) => W(_(u("teamName")), t), kt = o(v(u("sectionId")), g(o(Ee, u("phases")))), qt = o(u("sectionId"), se), Ht = o(u("phaseName"), se), Xt = v(u("phaseId")), Yt = (t) => o(v(u("name")), l(o(b, me)))(t), Jt = o(u("phaseName"), et), zt = o(ft, P("_", "-")), Kt = o(g(lt(/-:-/)), j(",")), Qt = o(l(j(":")), l(Pe), j(","), P(/^\(|\)$/g, "")), Vt = D([y(u("startingFive"))]), Zt = o(
568
+ ), Ft = (t) => W(_(u("teamName")), t), Wt = o(v(u("sectionId")), g(o(Pe, u("phases")))), Ut = o(u("sectionId"), se), kt = o(u("phaseName"), se), qt = v(u("phaseId")), Ht = o(v(u("name")), l(o(b, me))), Xt = o(u("phaseName"), et), Yt = o(ft, C("_", "-")), Jt = o(g(lt(/-:-/)), j(",")), zt = o(l(j(":")), l(Ce), j(","), C(/^\(|\)$/g, "")), Kt = D([y(u("startingFive"))]), Qt = o(
584
569
  ue(", "),
585
570
  l((t) => `${t.lastName} ${t.firstName}`),
586
571
  g((t) => !t)
587
- ), wt = o(I(u("eventPeriod")), C, g(E("Period", "type"))), er = I(u("row")), tr = (t, e) => R(Ue([fe(e, ["team", "id"]), E("Gól", "type")]), C(t)), rr = o(l(b), pe(["headCoach", "secondCoach"])), nr = o(C, l((t) => ({ ...t, eventId: t.eventId ? t.eventId : mt() }))), ar = (t) => v(u("eventTimeSec"), Object.values(t));
588
- function sr(t, e) {
572
+ ), Vt = o(I(u("eventPeriod")), E, g(P("Period", "type"))), Zt = I(u("row")), wt = (t, e) => R(Ue([fe(e, ["team", "id"]), P("Gól", "type")]), E(t)), er = o(l(b), pe(["headCoach", "secondCoach"])), tr = o(E, l((t) => ({ ...t, eventId: t.eventId ? t.eventId : mt() }))), rr = (t) => v(u("eventTimeSec"), Object.values(t));
573
+ function nr(t, e) {
589
574
  const r = (a) => {
590
575
  const s = ["first_referee", "second_referee", "first_line_judge", "second_line_judge"].indexOf(a.role);
591
576
  return s > -1 ? s : 4;
592
577
  }, n = (a) => ({ ...b(a), role: e(`role.${a.role}`) });
593
578
  return I(u("type"), l(n, v(r, Object.values(t))));
594
579
  }
595
- const ir = D([
580
+ const ar = D([
596
581
  y(u("points")),
597
582
  _(u("gamesPlayed")),
598
583
  y(u("w")),
599
584
  y(u("gd")),
600
585
  y(u("gf"))
601
- ]), ur = (t, e) => g(E(t, "championshipId"), e), or = (t, e) => R(E(t, "championshipId"), e), cr = o(g((t) => ["Rájátszás", "Újrajátszandó"].includes(t.phaseName)), S([0, "phases"])), lr = o(
586
+ ]), sr = (t, e) => g(P(t, "championshipId"), e), ir = (t, e) => R(P(t, "championshipId"), e), ur = o(g((t) => ["Rájátszás", "Újrajátszandó"].includes(t.phaseName)), S([0, "phases"])), or = o(
602
587
  I(St),
603
588
  v((t) => ["ld", "rd", "d"].includes(t.position?.toLowerCase()) ? 1 : ["lw", "rw", "c"].includes(t.position?.toLowerCase()) ? 2 : 0),
604
589
  v(_t),
605
590
  l(o(b, me, ht(["position"])))
606
591
  );
607
- function fr({ goalieStats: t, fieldPlayers: e, playersPenalty: r }) {
592
+ function cr({ goalieStats: t, fieldPlayers: e, playersPenalty: r }) {
608
593
  const n = l(S(["player", "playerId"]))(t), s = g((p) => n.includes(p.player.playerId), r), i = nt((p, he) => p.player.playerId === he, r, n), c = Y(e, s), d = Y(t, i);
609
594
  return {
610
595
  fieldPlayers: X(c),
611
596
  goalies: X(d)
612
597
  };
613
598
  }
614
- const pr = ne((t, e) => T(R(fe(e, ["team", "id"])), l(b))(t));
615
- function mr(t) {
616
- const e = t.city ? le(oe("city"), P(/$/, ",")) : () => ({});
599
+ const lr = ne((t, e) => T(R(fe(e, ["team", "id"])), l(b))(t));
600
+ function fr(t) {
601
+ const e = t.city ? le(oe("city"), C(/$/, ",")) : () => ({});
617
602
  return o(ue(" "), re, e, je(["type"]))(t);
618
603
  }
619
604
  function St(t) {
@@ -625,6 +610,24 @@ function _t(t) {
625
610
  function Y(t, e) {
626
611
  return re(ot(ut, q(S(["player", "playerId"]), t), q(S(["player", "playerId"]), e)));
627
612
  }
613
+ function pr(t, e = "body") {
614
+ if (!t)
615
+ return;
616
+ if (typeof e != "string") {
617
+ e?.append(t);
618
+ return;
619
+ }
620
+ document.querySelector(e)?.append(t);
621
+ }
622
+ function mr(t, e = () => ({})) {
623
+ return t.slice().sort((r, n) => {
624
+ const a = e(r), s = e(n);
625
+ if (a === null || s === null)
626
+ return 0;
627
+ const i = a.compareDocumentPosition(s);
628
+ return i & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : i & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
629
+ });
630
+ }
628
631
  class hr extends Error {
629
632
  constructor(e, r = {}) {
630
633
  const { key: n, cause: a } = r;
@@ -646,63 +649,63 @@ const dr = {
646
649
  };
647
650
  export {
648
651
  pe as $,
649
- Kt as A,
650
- Qt as B,
651
- Vt as C,
652
- Zt as D,
653
- wt as E,
654
- er as F,
655
- tr as G,
656
- rr as H,
657
- nr as I,
658
- ar as J,
659
- sr as K,
660
- ir as L,
661
- ur as M,
662
- or as N,
663
- cr as O,
664
- lr as P,
665
- fr as Q,
666
- pr as R,
667
- mr as S,
668
- Ot as T,
669
- At as U,
652
+ Jt as A,
653
+ zt as B,
654
+ Kt as C,
655
+ Qt as D,
656
+ Vt as E,
657
+ Zt as F,
658
+ wt as G,
659
+ er as H,
660
+ tr as I,
661
+ rr as J,
662
+ nr as K,
663
+ ar as L,
664
+ sr as M,
665
+ ir as N,
666
+ ur as O,
667
+ or as P,
668
+ cr as Q,
669
+ lr as R,
670
+ fr as S,
671
+ pr as T,
672
+ mr as U,
670
673
  dr as V,
671
674
  hr as W,
672
675
  yr as X,
673
676
  se as Y,
674
677
  et as Z,
675
678
  ut as _,
676
- Pt as a,
679
+ Et as a,
677
680
  T as a0,
678
- E as a1,
679
- C as a2,
681
+ P as a1,
682
+ E as a2,
680
683
  v as a3,
681
684
  x as a4,
682
685
  M as a5,
683
- Dt as b,
684
- Rt as c,
685
- $t as d,
686
- Bt as e,
687
- Lt as f,
688
- Et as g,
689
- Gt as h,
690
- Mt as i,
691
- xt as j,
692
- Ft as k,
686
+ Pt as b,
687
+ Ot as c,
688
+ Ct as d,
689
+ $t as e,
690
+ jt as f,
691
+ Rt as g,
692
+ Bt as h,
693
+ Lt as i,
694
+ Gt as j,
695
+ Mt as k,
693
696
  X as l,
694
- Wt as m,
695
- Ut as n,
696
- kt as o,
697
+ xt as m,
698
+ Ft as n,
699
+ Wt as o,
697
700
  b as p,
698
- qt as q,
699
- Ct as r,
700
- jt as s,
701
+ Ut as q,
702
+ At as r,
703
+ Dt as s,
701
704
  me as t,
702
705
  ht as u,
703
- Ht as v,
704
- Xt as w,
705
- Yt as x,
706
- Jt as y,
707
- zt as z
706
+ kt as v,
707
+ qt as w,
708
+ Ht as x,
709
+ Xt as y,
710
+ Yt as z
708
711
  };