courthive-components 3.8.0 → 3.8.2

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.
@@ -367,7 +367,7 @@ var Se = /* @__PURE__ */ P((/* @__PURE__ */ j(((e, t) => {
367
367
  autoFirst: !1,
368
368
  data: e.DATA,
369
369
  filter: e.FILTER_CONTAINS,
370
- sort: n.sort === !1 ? !1 : e.SORT_BYLENGTH,
370
+ sort: n.sort !== !1 && e.SORT_BYLENGTH,
371
371
  container: e.CONTAINER,
372
372
  item: e.ITEM,
373
373
  replace: e.REPLACE,
@@ -7679,7 +7679,7 @@ function Qs(e, t, n) {
7679
7679
  }
7680
7680
  function $s(e, t, n) {
7681
7681
  let r = Math.ceil(t / 2), i = e.filter((e) => e.winningSide === 1).length, a = e.filter((e) => e.winningSide === 2).length;
7682
- return i >= r || a >= r ? n ? e.filter((e) => e.side1Score !== void 0 && e.side2Score !== void 0).length >= n : !0 : !1;
7682
+ return i >= r || a >= r ? !n || e.filter((e) => e.side1Score !== void 0 && e.side2Score !== void 0).length >= n : !1;
7683
7683
  }
7684
7684
  function ec(e, t, n) {
7685
7685
  if (!$s(e, t, n)) return;
@@ -8926,7 +8926,7 @@ function xl(e, t) {
8926
8926
  Hl(a);
8927
8927
  let o = a.sets, s;
8928
8928
  a.irregularEnding && (s = a.irregularEnding, (a.irregularEnding === Uc || a.irregularEnding === Kc || a.irregularEnding === Jc) && (o = []));
8929
- let c = a.irregularEnding ? !1 : Ul(a), l = Wl(a);
8929
+ let c = !a.irregularEnding && Ul(a), l = Wl(a);
8930
8930
  return {
8931
8931
  valid: a.isValid && a.errors.length === 0,
8932
8932
  formattedScore: l,
@@ -9755,10 +9755,10 @@ var wu = [
9755
9755
  }) : ju(e, t.includeContainer, Ju.bind(null, t));
9756
9756
  }, ed = function(e, t) {
9757
9757
  if (t ||= {}, !e) throw Error("No node provided");
9758
- return Du.call(e, Tu) === !1 ? !1 : Yu(t, e);
9758
+ return Du.call(e, Tu) !== !1 && Yu(t, e);
9759
9759
  }, td = /* #__PURE__ */ wu.concat("iframe:not([inert]):not([inert] *)").join(","), nd = function(e, t) {
9760
9760
  if (t ||= {}, !e) throw Error("No node provided");
9761
- return Du.call(e, td) === !1 ? !1 : Ju(t, e);
9761
+ return Du.call(e, td) !== !1 && Ju(t, e);
9762
9762
  };
9763
9763
  //#endregion
9764
9764
  //#region node_modules/.pnpm/focus-trap@8.2.2/node_modules/focus-trap/dist/focus-trap.esm.js
@@ -9942,7 +9942,7 @@ var hd = {
9942
9942
  });
9943
9943
  });
9944
9944
  }, l = function(e) {
9945
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = t.hasFallback, a = r === void 0 ? !1 : r, o = t.params, s = o === void 0 ? [] : o, c = i[e];
9945
+ var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = t.hasFallback, a = r !== void 0 && r, o = t.params, s = o === void 0 ? [] : o, c = i[e];
9946
9946
  if (typeof c == "function" && (c = c.apply(void 0, dd(s))), c === !0 && (c = void 0), !c) {
9947
9947
  if (c === void 0 || c === !1) return c;
9948
9948
  throw Error(`\`${e}\` was specified but was not a node, or did not return a node`);
@@ -10016,9 +10016,9 @@ var hd = {
10016
10016
  }
10017
10017
  }, m = function(e) {
10018
10018
  var t = l("setReturnFocus", { params: [e] });
10019
- return t || (t === !1 ? !1 : e);
10019
+ return t || t !== !1 && e;
10020
10020
  }, h = function(e) {
10021
- var t = e.target, n = e.event, r = e.isBackward, o = r === void 0 ? !1 : r;
10021
+ var t = e.target, n = e.event, r = e.isBackward, o = r !== void 0 && r;
10022
10022
  t ||= Cd(n), f();
10023
10023
  var s = null;
10024
10024
  if (a.tabbableGroups.length > 0) {
@@ -10080,7 +10080,7 @@ var hd = {
10080
10080
  }
10081
10081
  a.recentNavEvent = void 0;
10082
10082
  }, v = function(e) {
10083
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
10083
+ var t = arguments.length > 1 && arguments[1] !== void 0 && arguments[1];
10084
10084
  a.recentNavEvent = e;
10085
10085
  var n = h({
10086
10086
  event: e,
@@ -10693,7 +10693,7 @@ function Nf(e) {
10693
10693
  return Object.assign({}, D, (t = {}, t[b] = v ? h + "px" : "", t[y] = _ ? p + "px" : "", t.transform = "", t));
10694
10694
  }
10695
10695
  function Pf(e) {
10696
- var t = e.state, n = e.options, r = n.gpuAcceleration, i = r === void 0 ? !0 : r, a = n.adaptive, o = a === void 0 ? !0 : a, s = n.roundOffsets, c = s === void 0 ? !0 : s, l = {
10696
+ var t = e.state, n = e.options, r = n.gpuAcceleration, i = r === void 0 || r, a = n.adaptive, o = a === void 0 || a, s = n.roundOffsets, c = s === void 0 || s, l = {
10697
10697
  placement: rf(t.placement),
10698
10698
  variation: Af(t.placement),
10699
10699
  popper: t.elements.popper,
@@ -10721,7 +10721,7 @@ var Ff = {
10721
10721
  data: {}
10722
10722
  }, If = { passive: !0 };
10723
10723
  function Lf(e) {
10724
- var t = e.state, n = e.instance, r = e.options, i = r.scroll, a = i === void 0 ? !0 : i, o = r.resize, s = o === void 0 ? !0 : o, c = Xd(t.elements.popper), l = [].concat(t.scrollParents.reference, t.scrollParents.popper);
10724
+ var t = e.state, n = e.instance, r = e.options, i = r.scroll, a = i === void 0 || i, o = r.resize, s = o === void 0 || o, c = Xd(t.elements.popper), l = [].concat(t.scrollParents.reference, t.scrollParents.popper);
10725
10725
  return a && l.forEach(function(e) {
10726
10726
  e.addEventListener("scroll", n.update, If);
10727
10727
  }), s && c.addEventListener("resize", n.update, If), function() {
@@ -10907,7 +10907,7 @@ function tp(e) {
10907
10907
  //#region node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/utils/detectOverflow.js
10908
10908
  function np(e, t) {
10909
10909
  t === void 0 && (t = {});
10910
- var n = t, r = n.placement, i = r === void 0 ? e.placement : r, a = n.strategy, o = a === void 0 ? e.strategy : a, s = n.boundary, c = s === void 0 ? Hd : s, l = n.rootBoundary, u = l === void 0 ? Ud : l, d = n.elementContext, f = d === void 0 ? Wd : d, p = n.altBoundary, m = p === void 0 ? !1 : p, h = n.padding, g = h === void 0 ? 0 : h, _ = wf(typeof g == "number" ? Tf(g, Bd) : g), v = f === "popper" ? Gd : Wd, y = e.rects.popper, b = e.elements[m ? v : f], x = ep(Zd(b) ? b : b.contextElement || hf(e.elements.popper), c, u, o), S = uf(e.elements.reference), C = tp({
10910
+ var n = t, r = n.placement, i = r === void 0 ? e.placement : r, a = n.strategy, o = a === void 0 ? e.strategy : a, s = n.boundary, c = s === void 0 ? Hd : s, l = n.rootBoundary, u = l === void 0 ? Ud : l, d = n.elementContext, f = d === void 0 ? Wd : d, p = n.altBoundary, m = p !== void 0 && p, h = n.padding, g = h === void 0 ? 0 : h, _ = wf(typeof g == "number" ? Tf(g, Bd) : g), v = f === "popper" ? Gd : Wd, y = e.rects.popper, b = e.elements[m ? v : f], x = ep(Zd(b) ? b : b.contextElement || hf(e.elements.popper), c, u, o), S = uf(e.elements.reference), C = tp({
10911
10911
  reference: S,
10912
10912
  element: y,
10913
10913
  strategy: "absolute",
@@ -10963,7 +10963,7 @@ function ip(e) {
10963
10963
  function ap(e) {
10964
10964
  var t = e.state, n = e.options, r = e.name;
10965
10965
  if (!t.modifiersData[r]._skip) {
10966
- for (var i = n.mainAxis, a = i === void 0 ? !0 : i, o = n.altAxis, s = o === void 0 ? !0 : o, c = n.fallbackPlacements, l = n.padding, u = n.boundary, d = n.rootBoundary, f = n.altBoundary, p = n.flipVariations, m = p === void 0 ? !0 : p, h = n.allowedAutoPlacements, g = t.options.placement, _ = rf(g) === g, v = c || (_ || !m ? [Bf(g)] : ip(g)), y = [g].concat(v).reduce(function(e, n) {
10966
+ for (var i = n.mainAxis, a = i === void 0 || i, o = n.altAxis, s = o === void 0 || o, c = n.fallbackPlacements, l = n.padding, u = n.boundary, d = n.rootBoundary, f = n.altBoundary, p = n.flipVariations, m = p === void 0 || p, h = n.allowedAutoPlacements, g = t.options.placement, _ = rf(g) === g, v = c || (_ || !m ? [Bf(g)] : ip(g)), y = [g].concat(v).reduce(function(e, n) {
10967
10967
  return e.concat(rf(n) === "auto" ? rp(t, {
10968
10968
  placement: n,
10969
10969
  boundary: u,
@@ -11103,7 +11103,7 @@ function gp(e) {
11103
11103
  //#endregion
11104
11104
  //#region node_modules/.pnpm/@popperjs+core@2.11.8/node_modules/@popperjs/core/lib/modifiers/preventOverflow.js
11105
11105
  function _p(e) {
11106
- var t = e.state, n = e.options, r = e.name, i = n.mainAxis, a = i === void 0 ? !0 : i, o = n.altAxis, s = o === void 0 ? !1 : o, c = n.boundary, l = n.rootBoundary, u = n.altBoundary, d = n.padding, f = n.tether, p = f === void 0 ? !0 : f, m = n.tetherOffset, h = m === void 0 ? 0 : m, g = np(t, {
11106
+ var t = e.state, n = e.options, r = e.name, i = n.mainAxis, a = i === void 0 || i, o = n.altAxis, s = o !== void 0 && o, c = n.boundary, l = n.rootBoundary, u = n.altBoundary, d = n.padding, f = n.tether, p = f === void 0 || f, m = n.tetherOffset, h = m === void 0 ? 0 : m, g = np(t, {
11107
11107
  boundary: c,
11108
11108
  rootBoundary: l,
11109
11109
  padding: d,
@@ -11473,7 +11473,7 @@ function pm() {
11473
11473
  function mm() {
11474
11474
  document.addEventListener("touchstart", dm, Ip), window.addEventListener("blur", pm);
11475
11475
  }
11476
- var hm = typeof window < "u" && typeof document < "u" ? !!window.msCrypto : !1;
11476
+ var hm = typeof window < "u" && typeof document < "u" && !!window.msCrypto;
11477
11477
  function gm(e) {
11478
11478
  var t = e === "destroy" ? "n already-" : " ";
11479
11479
  return [e + "() was called on a" + t + "destroyed instance. This is a no-op but", "indicates a potential memory leak."].join(" ");
@@ -12160,7 +12160,7 @@ function eh(e) {
12160
12160
  }
12161
12161
  return n.addEventListener("change", () => {
12162
12162
  let t = parseInt(n.value, 10);
12163
- e.onHeading?.(t === 0 ? !1 : t);
12163
+ e.onHeading?.(t !== 0 && t);
12164
12164
  }), t.appendChild(n), t;
12165
12165
  }
12166
12166
  function th(e) {
@@ -12933,7 +12933,7 @@ function Jh(e, t) {
12933
12933
  return n?.url ?? n?.identifier;
12934
12934
  }
12935
12935
  function Yh(e, t) {
12936
- if (Array.isArray(e)) return e.find((e) => e?.resourceSubType === "COURT_SVG" && (t ? e?.name === t : !0))?.identifier;
12936
+ if (Array.isArray(e)) return e.find((e) => e?.resourceSubType === "COURT_SVG" && (!t || e?.name === t))?.identifier;
12937
12937
  }
12938
12938
  //#endregion
12939
12939
  //#region src/helpers/cards/buildCardSkeleton.ts
@@ -14408,7 +14408,7 @@ function dx(e) {
14408
14408
  return e.some((e) => e?.automated?.seedsOnly === !0 || ux(e));
14409
14409
  }
14410
14410
  function fx(e) {
14411
- return e.length === 0 ? !1 : e.every((e) => e?.drawStatus === "CANCELLED");
14411
+ return e.length !== 0 && e.every((e) => e?.drawStatus === "CANCELLED");
14412
14412
  }
14413
14413
  var px = /* @__PURE__ */ new Set([
14414
14414
  "DIRECT_ACCEPTANCE",
@@ -14732,8 +14732,8 @@ function Yx(e) {
14732
14732
  }
14733
14733
  var Xx = {
14734
14734
  name: "courthive-components",
14735
- packageManager: "pnpm@11.10.0",
14736
- version: "3.8.0",
14735
+ packageManager: "pnpm@11.11.0",
14736
+ version: "3.8.2",
14737
14737
  engines: { node: ">=22" },
14738
14738
  description: "Components for competitions projects",
14739
14739
  files: ["dist"],
@@ -14795,7 +14795,7 @@ var Xx = {
14795
14795
  },
14796
14796
  devDependencies: {
14797
14797
  "@chromatic-com/storybook": "^5.0.0",
14798
- "@commitlint/cli": "21.2.0",
14798
+ "@commitlint/cli": "21.2.1",
14799
14799
  "@commitlint/config-conventional": "21.2.0",
14800
14800
  "@eslint/js": "^10.0.1",
14801
14801
  "@fortawesome/fontawesome-free": "^7.2.0",
@@ -14804,8 +14804,8 @@ var Xx = {
14804
14804
  "@storybook/test-runner": "^0.24.0",
14805
14805
  "@types/d3": "^7.4.3",
14806
14806
  "@types/vanillajs-datepicker": "^1.3.5",
14807
- "@typescript-eslint/eslint-plugin": "8.62.1",
14808
- "@typescript-eslint/parser": "8.62.1",
14807
+ "@typescript-eslint/eslint-plugin": "8.63.0",
14808
+ "@typescript-eslint/parser": "8.63.0",
14809
14809
  "@vitest/browser-playwright": "^4.0.16",
14810
14810
  "@vitest/coverage-v8": "^4.0.16",
14811
14811
  "@vitest/ui": "^4.0.16",
@@ -14823,7 +14823,7 @@ var Xx = {
14823
14823
  storybook: "^10.2.17",
14824
14824
  "tabulator-tables": "6.5.2",
14825
14825
  typescript: "^6.0.2",
14826
- vite: "8.1.3",
14826
+ vite: "8.1.4",
14827
14827
  "vite-plugin-dts": "^5.0.0",
14828
14828
  vitest: "^4.0.16"
14829
14829
  },
@@ -14843,7 +14843,7 @@ var Xx = {
14843
14843
  "focus-trap": "^8.0.0",
14844
14844
  "timepicker-ui": "^4.1.2",
14845
14845
  "tippy.js": "6.3.7",
14846
- "tods-competition-factory": "6.5.0",
14846
+ "tods-competition-factory": "6.7.0",
14847
14847
  "vanillajs-datepicker": "1.3.4"
14848
14848
  }
14849
14849
  };
@@ -19096,7 +19096,13 @@ function iN(e, t, n, r, i, a, o) {
19096
19096
  n && (i ? (t.flagsGroup.selectAll("text").remove(), t.winningFlagsGroup.selectAll("text").remove(), t.losingFlagsGroup.selectAll("text").remove()) : e.selectAll("text").remove(), e.append("text").attr("font-size", `${o}px`).attr(BM, "middle").attr(VM, "middle").attr("transform", `translate(0, ${r * a})`).text(cN(n)));
19097
19097
  }
19098
19098
  function aN(e, t, n, r = {}) {
19099
- let i = r.width || 800, a = r.height || 800, o = Math.min(i, a) / 800 * (r.textScaleFactor ?? 1), s = 28 * o, l = 24 * o, u = 30 * o, d = n || r.title || "Tournament", f = Object.assign({}, ...c.countries.filter((e) => e.label).map((e) => ({ [e.ioc]: e.label }))), p = YM(t), m = ZO(p, (e) => e.children).sum((e) => e.value || 0), h = Math.min(i, a) / 2, g = h / 2, _ = (e) => e * h / 200;
19099
+ let i = r.width || 800, a = r.height || 800, o = Math.min(i, a) / 800 * (r.textScaleFactor ?? 1), s = 28 * o, l = 24 * o, u = 30 * o, d = n || r.title || "Tournament", f = Object.assign({}, ...c.countries.filter((e) => e.label).map((e) => ({ [e.ioc]: e.label })));
19100
+ if (!Object.keys(t?.roundMatchUps ?? {}).length) return {
19101
+ highlightPlayer: () => 0,
19102
+ hide: () => void 0,
19103
+ setColorMode: () => void 0
19104
+ };
19105
+ let p = YM(t), m = ZO(p, (e) => e.children).sum((e) => e.value || 0), h = Math.min(i, a) / 2, g = h / 2, _ = (e) => e * h / 200;
19100
19106
  ok().size([2 * Math.PI, h - g])(m), XM(p, Ek().domain([0, t.drawSize || 128]).range([0, 1])), ZM(p, r.competitivenessColors);
19101
19107
  let v = r.colorMode ?? "default", y = (e) => v === "competitiveness" ? e.competitivenessColor || "#cfd8dc" : e.color || "#ccc", b = m.descendants(), x = fM().startAngle((e) => e.x0).endAngle((e) => e.x1).innerRadius((e) => e.y0 + g).outerRadius((e) => e.y1 + g), { svg: S, g: C, flagsGroup: w, winningFlagsGroup: T, losingFlagsGroup: E } = nN(e, i, a), D = /* @__PURE__ */ new Set(), O = (e) => {
19102
19108
  e.nationalityCode && D.add(e.nationalityCode), e.children && e.children.forEach(O);
@@ -20018,7 +20024,7 @@ function PF(e) {
20018
20024
  }
20019
20025
  function FF(e, t, n, r = "dim") {
20020
20026
  let i = t.toLowerCase().trim();
20021
- return e.filter((e) => r === "hide" && n.has(OF(e)) ? !1 : i ? `${e.eventName} ${e.drawName ?? ""} ${e.roundName ?? ""} ${e.drawId}`.toLowerCase().includes(i) : !0).map((e) => ({
20027
+ return e.filter((e) => r === "hide" && n.has(OF(e)) ? !1 : !i || `${e.eventName} ${e.drawName ?? ""} ${e.roundName ?? ""} ${e.drawId}`.toLowerCase().includes(i)).map((e) => ({
20022
20028
  ...e,
20023
20029
  isPlanned: n.has(OF(e))
20024
20030
  }));
@@ -21337,8 +21343,8 @@ function GI(e) {
21337
21343
  var KI, qI, JI, YI = !1;
21338
21344
  async function XI() {
21339
21345
  if (!KI) {
21340
- let e = await import("./dist-CBuPz6zx.mjs");
21341
- KI = e.TimepickerUI, qI = e.PluginRegistry, JI = (await import("./range-CX4__ojz.mjs")).RangePlugin, !YI && qI && JI && (qI.register(JI), YI = !0);
21346
+ let e = await import("./dist-D4FEwQGm.mjs");
21347
+ KI = e.TimepickerUI, qI = e.PluginRegistry, JI = (await import("./range-CUjpzZYl.mjs")).RangePlugin, !YI && qI && JI && (qI.register(JI), YI = !0);
21342
21348
  }
21343
21349
  }
21344
21350
  var ZI = class {
@@ -22935,8 +22941,8 @@ function EL(e) {
22935
22941
  var DL, OL, kL, AL = !1;
22936
22942
  async function jL() {
22937
22943
  if (!DL) {
22938
- let e = await import("./dist-CBuPz6zx.mjs");
22939
- DL = e.TimepickerUI, OL = e.PluginRegistry, kL = (await import("./range-CX4__ojz.mjs")).RangePlugin, !AL && OL && kL && (OL.register(kL), AL = !0);
22944
+ let e = await import("./dist-D4FEwQGm.mjs");
22945
+ DL = e.TimepickerUI, OL = e.PluginRegistry, kL = (await import("./range-CUjpzZYl.mjs")).RangePlugin, !AL && OL && kL && (OL.register(kL), AL = !0);
22940
22946
  }
22941
22947
  }
22942
22948
  var ML = 0;
@@ -25954,7 +25960,7 @@ function QV(e) {
25954
25960
  }
25955
25961
  function $V(e, t, n = "dim", r, i = !1) {
25956
25962
  let a = t.toLowerCase().trim();
25957
- return e.filter((e) => n === "hide" && e.isScheduled || !i && QV(e.matchUpStatus) || r && (r.eventType && e.matchUpType !== r.eventType || r.eventName && e.eventName !== r.eventName || r.drawName && (e.drawName ?? e.drawId) !== r.drawName || r.gender && e.gender !== r.gender || r.roundName && e.roundName !== r.roundName) ? !1 : a ? JV(e).includes(a) : !0);
25963
+ return e.filter((e) => n === "hide" && e.isScheduled || !i && QV(e.matchUpStatus) || r && (r.eventType && e.matchUpType !== r.eventType || r.eventName && e.eventName !== r.eventName || r.drawName && (e.drawName ?? e.drawId) !== r.drawName || r.gender && e.gender !== r.gender || r.roundName && e.roundName !== r.roundName) ? !1 : !a || JV(e).includes(a));
25958
25964
  }
25959
25965
  function eH(e) {
25960
25966
  let t = /* @__PURE__ */ new Map();