@burdenoff/microfe-atheletebridge 2026.1013.1 → 2026.1024.1

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 (35) hide show
  1. package/dist/atheletebridge/components/MatchupRow.d.ts.map +1 -1
  2. package/dist/atheletebridge/components/MatchupRow.js +36 -36
  3. package/dist/atheletebridge/components/MatchupRow.js.map +1 -1
  4. package/dist/atheletebridge/components/Scoreboard.d.ts +71 -2
  5. package/dist/atheletebridge/components/Scoreboard.d.ts.map +1 -1
  6. package/dist/atheletebridge/components/Scoreboard.js +221 -96
  7. package/dist/atheletebridge/components/Scoreboard.js.map +1 -1
  8. package/dist/atheletebridge/hooks/index.d.ts +1 -0
  9. package/dist/atheletebridge/hooks/index.d.ts.map +1 -1
  10. package/dist/atheletebridge/hooks/index.js +1 -0
  11. package/dist/atheletebridge/hooks/useAthleteBridgeApi.d.ts.map +1 -1
  12. package/dist/atheletebridge/hooks/useAthleteBridgeApi.js +93 -82
  13. package/dist/atheletebridge/hooks/useAthleteBridgeApi.js.map +1 -1
  14. package/dist/atheletebridge/hooks/useScheduledTimeGate.d.ts +18 -0
  15. package/dist/atheletebridge/hooks/useScheduledTimeGate.d.ts.map +1 -0
  16. package/dist/atheletebridge/hooks/useScheduledTimeGate.js +24 -0
  17. package/dist/atheletebridge/hooks/useScheduledTimeGate.js.map +1 -0
  18. package/dist/atheletebridge/pages/fixtures/FixtureDetailPage.d.ts.map +1 -1
  19. package/dist/atheletebridge/pages/fixtures/FixtureDetailPage.js +436 -107
  20. package/dist/atheletebridge/pages/fixtures/FixtureDetailPage.js.map +1 -1
  21. package/dist/atheletebridge/pages/sessions/SessionDetailPage.d.ts.map +1 -1
  22. package/dist/atheletebridge/pages/sessions/SessionDetailPage.js +164 -159
  23. package/dist/atheletebridge/pages/sessions/SessionDetailPage.js.map +1 -1
  24. package/dist/atheletebridge/pages/tournaments/TournamentBracketPage.d.ts.map +1 -1
  25. package/dist/atheletebridge/pages/tournaments/TournamentBracketPage.js +104 -103
  26. package/dist/atheletebridge/pages/tournaments/TournamentBracketPage.js.map +1 -1
  27. package/dist/atheletebridge/types/index.d.ts +74 -1
  28. package/dist/atheletebridge/types/index.d.ts.map +1 -1
  29. package/dist/atheletebridge/utils/index.d.ts +2 -0
  30. package/dist/atheletebridge/utils/index.d.ts.map +1 -1
  31. package/dist/atheletebridge/utils/recordResult.d.ts +92 -0
  32. package/dist/atheletebridge/utils/recordResult.d.ts.map +1 -0
  33. package/dist/atheletebridge/utils/recordResult.js +114 -0
  34. package/dist/atheletebridge/utils/recordResult.js.map +1 -0
  35. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"MatchupRow.d.ts","sourceRoot":"","sources":["../../../src/atheletebridge/components/MatchupRow.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAO3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,UAAU,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,KAAK,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAsBD,0EAA0E;AAC1E,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CA4D1C,CAAC"}
1
+ {"version":3,"file":"MatchupRow.d.ts","sourceRoot":"","sources":["../../../src/atheletebridge/components/MatchupRow.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAO3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,UAAU,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,KAAK,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAsBD,0EAA0E;AAC1E,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CA6D1C,CAAC"}
@@ -1,74 +1,74 @@
1
1
  import { cn as e } from "../utils/cn.js";
2
2
  import { StatusBadge as t } from "./StatusBadge.js";
3
3
  import { formatDate as n } from "../utils/formatters.js";
4
- import { MatchupSide as r, ScoreCenter as i, resolveMatchup as a } from "./Scoreboard.js";
5
- import { CalendarDays as o, ChevronRight as s, Trophy as c } from "lucide-react";
6
- import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
7
- import { Badge as f } from "@burdenoff/fe-libs/ui";
4
+ import { MatchupSide as r, ScoreCenter as i, resolveMatchup as a, useMatchupLabels as o } from "./Scoreboard.js";
5
+ import { CalendarDays as s, ChevronRight as c, Trophy as l } from "lucide-react";
6
+ import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
7
+ import { Badge as p } from "@burdenoff/fe-libs/ui";
8
8
  //#region src/atheletebridge/components/MatchupRow.tsx
9
- var p = ({ fixture: e }) => /* @__PURE__ */ d("div", {
9
+ var m = ({ fixture: e }) => /* @__PURE__ */ f("div", {
10
10
  className: "flex flex-col items-end gap-1 text-right",
11
- children: [/* @__PURE__ */ d("span", {
11
+ children: [/* @__PURE__ */ f("span", {
12
12
  className: "flex items-center gap-1 text-xs text-text-secondary",
13
- children: [/* @__PURE__ */ u(o, {
13
+ children: [/* @__PURE__ */ d(s, {
14
14
  className: "h-3.5 w-3.5 shrink-0",
15
15
  "aria-hidden": "true"
16
16
  }), n(e.scheduledAt)]
17
- }), /* @__PURE__ */ d("div", {
17
+ }), /* @__PURE__ */ f("div", {
18
18
  className: "flex items-center gap-1.5",
19
- children: [e.competition ? /* @__PURE__ */ d(f, {
19
+ children: [e.competition ? /* @__PURE__ */ f(p, {
20
20
  variant: "secondary",
21
21
  className: "gap-1",
22
- children: [e.type === "CUP" || e.type === "TOURNAMENT" ? /* @__PURE__ */ u(c, {
22
+ children: [e.type === "CUP" || e.type === "TOURNAMENT" ? /* @__PURE__ */ d(l, {
23
23
  className: "h-3 w-3",
24
24
  "aria-hidden": "true"
25
25
  }) : null, e.competition]
26
- }) : null, /* @__PURE__ */ u(t, { status: e.status })]
26
+ }) : null, /* @__PURE__ */ d(t, { status: e.status })]
27
27
  })]
28
- }), m = ({ fixture: t, onClick: o, rail: c, className: f }) => {
29
- let m = a(t), h = !!o, g = c === !1 ? null : c === void 0 ? /* @__PURE__ */ u(p, { fixture: t }) : c, _ = g == null && !m.hasScore ? n(t.scheduledAt) : null, v = /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ d("div", {
28
+ }), h = ({ fixture: t, onClick: s, rail: l, className: p }) => {
29
+ let h = a(t, o()), g = !!s, _ = l === !1 ? null : l === void 0 ? /* @__PURE__ */ d(m, { fixture: t }) : l, v = _ == null && !h.hasScore ? n(t.scheduledAt) : null, y = /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ f("div", {
30
30
  className: "grid flex-1 grid-cols-[1fr_auto_1fr] items-center gap-2 sm:gap-3",
31
31
  children: [
32
- /* @__PURE__ */ u(r, {
33
- name: m.homeName,
34
- sport: m.homeSport,
32
+ /* @__PURE__ */ d(r, {
33
+ name: h.homeName,
34
+ sport: h.homeSport,
35
35
  align: "end",
36
- won: m.homeWon,
37
- dimmed: m.awayWon,
36
+ won: h.homeWon,
37
+ dimmed: h.awayWon,
38
38
  crestSize: 36
39
39
  }),
40
- /* @__PURE__ */ u(i, {
41
- matchup: m,
42
- time: _,
40
+ /* @__PURE__ */ d(i, {
41
+ matchup: h,
42
+ time: v,
43
43
  size: "sm"
44
44
  }),
45
- /* @__PURE__ */ u(r, {
46
- name: m.awayName,
47
- sport: m.awaySport,
45
+ /* @__PURE__ */ d(r, {
46
+ name: h.awayName,
47
+ sport: h.awaySport,
48
48
  align: "start",
49
- won: m.awayWon,
50
- dimmed: m.homeWon,
49
+ won: h.awayWon,
50
+ dimmed: h.homeWon,
51
51
  crestSize: 36
52
52
  })
53
53
  ]
54
- }), g ? /* @__PURE__ */ d("div", {
54
+ }), _ ? /* @__PURE__ */ f("div", {
55
55
  className: "hidden items-center gap-3 border-l border-border-seam pl-3 sm:flex md:pl-4",
56
- children: [g, h ? /* @__PURE__ */ u(s, {
56
+ children: [_, g ? /* @__PURE__ */ d(c, {
57
57
  className: "h-4 w-4 shrink-0 text-text-muted",
58
58
  "aria-hidden": "true"
59
59
  }) : null]
60
60
  }) : null] });
61
- return h ? /* @__PURE__ */ u("button", {
61
+ return g ? /* @__PURE__ */ d("button", {
62
62
  type: "button",
63
- onClick: o,
64
- className: e("flex w-full items-center gap-3 rounded-[var(--radius-card)] px-1 py-3 text-left transition-colors hover:bg-bg-sunken focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] md:gap-4", f),
65
- children: v
66
- }) : /* @__PURE__ */ u("div", {
67
- className: e("flex w-full items-center gap-3 py-3 md:gap-4", f),
68
- children: v
63
+ onClick: s,
64
+ className: e("flex w-full items-center gap-3 rounded-[var(--radius-card)] px-1 py-3 text-left transition-colors hover:bg-bg-sunken focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] md:gap-4", p),
65
+ children: y
66
+ }) : /* @__PURE__ */ d("div", {
67
+ className: e("flex w-full items-center gap-3 py-3 md:gap-4", p),
68
+ children: y
69
69
  });
70
70
  };
71
71
  //#endregion
72
- export { m as MatchupRow };
72
+ export { h as MatchupRow };
73
73
 
74
74
  //# sourceMappingURL=MatchupRow.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MatchupRow.js","names":[],"sources":["../../../src/atheletebridge/components/MatchupRow.tsx"],"sourcesContent":["/**\n * MatchupRow\n * @module atheletebridge/components\n *\n * A compact single-line crest-vs-crest fixture row for the dashboard \"Upcoming\n * fixtures\" feed and team-detail fixture lists. Reuses the Scoreboard building\n * blocks (crest sides + score/vs centerpiece). Semantic tokens only.\n */\n\nimport type { FC, ReactNode } from 'react';\nimport { CalendarDays, ChevronRight, Trophy } from 'lucide-react';\nimport { Badge } from '@burdenoff/fe-libs/ui';\nimport { MatchupSide, ScoreCenter, resolveMatchup } from './Scoreboard';\nimport { StatusBadge } from './StatusBadge';\nimport { formatDate } from '../utils/formatters';\nimport { cn } from '../utils/cn';\nimport type { AthFixture } from '../types';\n\nexport interface MatchupRowProps {\n fixture: AthFixture;\n onClick?: () => void;\n /**\n * Right-hand rail content. Defaults to date + competition + status. Pass\n * `false` to hide the rail entirely, or a node to override it.\n */\n rail?: ReactNode | false;\n className?: string;\n}\n\nconst DefaultRail: FC<{ fixture: AthFixture }> = ({ fixture }) => (\n <div className=\"flex flex-col items-end gap-1 text-right\">\n <span className=\"flex items-center gap-1 text-xs text-text-secondary\">\n <CalendarDays className=\"h-3.5 w-3.5 shrink-0\" aria-hidden=\"true\" />\n {formatDate(fixture.scheduledAt)}\n </span>\n <div className=\"flex items-center gap-1.5\">\n {fixture.competition ? (\n <Badge variant=\"secondary\" className=\"gap-1\">\n {fixture.type === 'CUP' || fixture.type === 'TOURNAMENT' ? (\n <Trophy className=\"h-3 w-3\" aria-hidden=\"true\" />\n ) : null}\n {fixture.competition}\n </Badge>\n ) : null}\n <StatusBadge status={fixture.status} />\n </div>\n </div>\n);\n\n/** Compact crest-vs-crest fixture row (dashboard / team-detail feeds). */\nexport const MatchupRow: FC<MatchupRowProps> = ({ fixture, onClick, rail, className }) => {\n const matchup = resolveMatchup(fixture);\n const clickable = Boolean(onClick);\n\n const railNode =\n rail === false ? null : rail !== undefined ? rail : <DefaultRail fixture={fixture} />;\n\n // When there's no rail to carry the date, surface the kickoff under the \"vs\".\n const timeLabel = railNode == null && !matchup.hasScore ? formatDate(fixture.scheduledAt) : null;\n\n const content = (\n <>\n <div className=\"grid flex-1 grid-cols-[1fr_auto_1fr] items-center gap-2 sm:gap-3\">\n <MatchupSide\n name={matchup.homeName}\n sport={matchup.homeSport}\n align=\"end\"\n won={matchup.homeWon}\n dimmed={matchup.awayWon}\n crestSize={36}\n />\n <ScoreCenter matchup={matchup} time={timeLabel} size=\"sm\" />\n <MatchupSide\n name={matchup.awayName}\n sport={matchup.awaySport}\n align=\"start\"\n won={matchup.awayWon}\n dimmed={matchup.homeWon}\n crestSize={36}\n />\n </div>\n {railNode ? (\n <div className=\"hidden items-center gap-3 border-l border-border-seam pl-3 sm:flex md:pl-4\">\n {railNode}\n {clickable ? (\n <ChevronRight className=\"h-4 w-4 shrink-0 text-text-muted\" aria-hidden=\"true\" />\n ) : null}\n </div>\n ) : null}\n </>\n );\n\n if (clickable) {\n return (\n <button\n type=\"button\"\n onClick={onClick}\n className={cn(\n 'flex w-full items-center gap-3 rounded-[var(--radius-card)] px-1 py-3 text-left transition-colors hover:bg-bg-sunken focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] md:gap-4',\n className\n )}\n >\n {content}\n </button>\n );\n }\n\n return (\n <div className={cn('flex w-full items-center gap-3 py-3 md:gap-4', className)}>{content}</div>\n );\n};\n"],"mappings":";;;;;;;;AA6BA,IAAM,KAA4C,EAAE,iBAClD,kBAAC,OAAD;CAAK,WAAU;WAAf,CACE,kBAAC,QAAD;EAAM,WAAU;YAAhB,CACE,kBAAC,GAAD;GAAc,WAAU;GAAuB,eAAY;EAAQ,CAAA,GAClE,EAAW,EAAQ,WAAW,CAC3B;KACN,kBAAC,OAAD;EAAK,WAAU;YAAf,CACG,EAAQ,cACP,kBAAC,GAAD;GAAO,SAAQ;GAAY,WAAU;aAArC,CACG,EAAQ,SAAS,SAAS,EAAQ,SAAS,eAC1C,kBAAC,GAAD;IAAQ,WAAU;IAAU,eAAY;GAAQ,CAAA,IAC9C,MACH,EAAQ,WACJ;OACL,MACJ,kBAAC,GAAD,EAAa,QAAQ,EAAQ,OAAS,CAAA,CACnC;GACF;IAIM,KAAmC,EAAE,YAAS,YAAS,SAAM,mBAAgB;CACxF,IAAM,IAAU,EAAe,CAAO,GAChC,IAAY,EAAQ,GAEpB,IACJ,MAAS,KAAQ,OAAO,MAAS,KAAA,IAAmB,kBAAC,GAAD,EAAsB,WAAU,CAAA,IAAvC,GAGzC,IAAY,KAAY,QAAQ,CAAC,EAAQ,WAAW,EAAW,EAAQ,WAAW,IAAI,MAEtF,IACJ,kBAAA,GAAA,EAAA,UAAA,CACE,kBAAC,OAAD;EAAK,WAAU;YAAf;GACE,kBAAC,GAAD;IACE,MAAM,EAAQ;IACd,OAAO,EAAQ;IACf,OAAM;IACN,KAAK,EAAQ;IACb,QAAQ,EAAQ;IAChB,WAAW;GACZ,CAAA;GACD,kBAAC,GAAD;IAAsB;IAAS,MAAM;IAAW,MAAK;GAAM,CAAA;GAC3D,kBAAC,GAAD;IACE,MAAM,EAAQ;IACd,OAAO,EAAQ;IACf,OAAM;IACN,KAAK,EAAQ;IACb,QAAQ,EAAQ;IAChB,WAAW;GACZ,CAAA;EACE;KACJ,IACC,kBAAC,OAAD;EAAK,WAAU;YAAf,CACG,GACA,IACC,kBAAC,GAAD;GAAc,WAAU;GAAmC,eAAY;EAAQ,CAAA,IAC7E,IACD;MACH,IACJ,EAAA,CAAA;CAkBJ,OAfI,IAEA,kBAAC,UAAD;EACE,MAAK;EACI;EACT,WAAW,EACT,8NACA,CACF;YAEC;CACK,CAAA,IAKV,kBAAC,OAAD;EAAK,WAAW,EAAG,gDAAgD,CAAS;YAAI;CAAa,CAAA;AAEjG"}
1
+ {"version":3,"file":"MatchupRow.js","names":[],"sources":["../../../src/atheletebridge/components/MatchupRow.tsx"],"sourcesContent":["/**\n * MatchupRow\n * @module atheletebridge/components\n *\n * A compact single-line crest-vs-crest fixture row for the dashboard \"Upcoming\n * fixtures\" feed and team-detail fixture lists. Reuses the Scoreboard building\n * blocks (crest sides + score/vs centerpiece). Semantic tokens only.\n */\n\nimport type { FC, ReactNode } from 'react';\nimport { CalendarDays, ChevronRight, Trophy } from 'lucide-react';\nimport { Badge } from '@burdenoff/fe-libs/ui';\nimport { MatchupSide, ScoreCenter, resolveMatchup, useMatchupLabels } from './Scoreboard';\nimport { StatusBadge } from './StatusBadge';\nimport { formatDate } from '../utils/formatters';\nimport { cn } from '../utils/cn';\nimport type { AthFixture } from '../types';\n\nexport interface MatchupRowProps {\n fixture: AthFixture;\n onClick?: () => void;\n /**\n * Right-hand rail content. Defaults to date + competition + status. Pass\n * `false` to hide the rail entirely, or a node to override it.\n */\n rail?: ReactNode | false;\n className?: string;\n}\n\nconst DefaultRail: FC<{ fixture: AthFixture }> = ({ fixture }) => (\n <div className=\"flex flex-col items-end gap-1 text-right\">\n <span className=\"flex items-center gap-1 text-xs text-text-secondary\">\n <CalendarDays className=\"h-3.5 w-3.5 shrink-0\" aria-hidden=\"true\" />\n {formatDate(fixture.scheduledAt)}\n </span>\n <div className=\"flex items-center gap-1.5\">\n {fixture.competition ? (\n <Badge variant=\"secondary\" className=\"gap-1\">\n {fixture.type === 'CUP' || fixture.type === 'TOURNAMENT' ? (\n <Trophy className=\"h-3 w-3\" aria-hidden=\"true\" />\n ) : null}\n {fixture.competition}\n </Badge>\n ) : null}\n <StatusBadge status={fixture.status} />\n </div>\n </div>\n);\n\n/** Compact crest-vs-crest fixture row (dashboard / team-detail feeds). */\nexport const MatchupRow: FC<MatchupRowProps> = ({ fixture, onClick, rail, className }) => {\n const labels = useMatchupLabels();\n const matchup = resolveMatchup(fixture, labels);\n const clickable = Boolean(onClick);\n\n const railNode =\n rail === false ? null : rail !== undefined ? rail : <DefaultRail fixture={fixture} />;\n\n // When there's no rail to carry the date, surface the kickoff under the \"vs\".\n const timeLabel = railNode == null && !matchup.hasScore ? formatDate(fixture.scheduledAt) : null;\n\n const content = (\n <>\n <div className=\"grid flex-1 grid-cols-[1fr_auto_1fr] items-center gap-2 sm:gap-3\">\n <MatchupSide\n name={matchup.homeName}\n sport={matchup.homeSport}\n align=\"end\"\n won={matchup.homeWon}\n dimmed={matchup.awayWon}\n crestSize={36}\n />\n <ScoreCenter matchup={matchup} time={timeLabel} size=\"sm\" />\n <MatchupSide\n name={matchup.awayName}\n sport={matchup.awaySport}\n align=\"start\"\n won={matchup.awayWon}\n dimmed={matchup.homeWon}\n crestSize={36}\n />\n </div>\n {railNode ? (\n <div className=\"hidden items-center gap-3 border-l border-border-seam pl-3 sm:flex md:pl-4\">\n {railNode}\n {clickable ? (\n <ChevronRight className=\"h-4 w-4 shrink-0 text-text-muted\" aria-hidden=\"true\" />\n ) : null}\n </div>\n ) : null}\n </>\n );\n\n if (clickable) {\n return (\n <button\n type=\"button\"\n onClick={onClick}\n className={cn(\n 'flex w-full items-center gap-3 rounded-[var(--radius-card)] px-1 py-3 text-left transition-colors hover:bg-bg-sunken focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] md:gap-4',\n className\n )}\n >\n {content}\n </button>\n );\n }\n\n return (\n <div className={cn('flex w-full items-center gap-3 py-3 md:gap-4', className)}>{content}</div>\n );\n};\n"],"mappings":";;;;;;;;AA6BA,IAAM,KAA4C,EAAE,iBAClD,kBAAC,OAAD;CAAK,WAAU;WAAf,CACE,kBAAC,QAAD;EAAM,WAAU;YAAhB,CACE,kBAAC,GAAD;GAAc,WAAU;GAAuB,eAAY;EAAQ,CAAA,GAClE,EAAW,EAAQ,WAAW,CAC3B;KACN,kBAAC,OAAD;EAAK,WAAU;YAAf,CACG,EAAQ,cACP,kBAAC,GAAD;GAAO,SAAQ;GAAY,WAAU;aAArC,CACG,EAAQ,SAAS,SAAS,EAAQ,SAAS,eAC1C,kBAAC,GAAD;IAAQ,WAAU;IAAU,eAAY;GAAQ,CAAA,IAC9C,MACH,EAAQ,WACJ;OACL,MACJ,kBAAC,GAAD,EAAa,QAAQ,EAAQ,OAAS,CAAA,CACnC;GACF;IAIM,KAAmC,EAAE,YAAS,YAAS,SAAM,mBAAgB;CAExF,IAAM,IAAU,EAAe,GADhB,EACyB,CAAM,GACxC,IAAY,EAAQ,GAEpB,IACJ,MAAS,KAAQ,OAAO,MAAS,KAAA,IAAmB,kBAAC,GAAD,EAAsB,WAAU,CAAA,IAAvC,GAGzC,IAAY,KAAY,QAAQ,CAAC,EAAQ,WAAW,EAAW,EAAQ,WAAW,IAAI,MAEtF,IACJ,kBAAA,GAAA,EAAA,UAAA,CACE,kBAAC,OAAD;EAAK,WAAU;YAAf;GACE,kBAAC,GAAD;IACE,MAAM,EAAQ;IACd,OAAO,EAAQ;IACf,OAAM;IACN,KAAK,EAAQ;IACb,QAAQ,EAAQ;IAChB,WAAW;GACZ,CAAA;GACD,kBAAC,GAAD;IAAsB;IAAS,MAAM;IAAW,MAAK;GAAM,CAAA;GAC3D,kBAAC,GAAD;IACE,MAAM,EAAQ;IACd,OAAO,EAAQ;IACf,OAAM;IACN,KAAK,EAAQ;IACb,QAAQ,EAAQ;IAChB,WAAW;GACZ,CAAA;EACE;KACJ,IACC,kBAAC,OAAD;EAAK,WAAU;YAAf,CACG,GACA,IACC,kBAAC,GAAD;GAAc,WAAU;GAAmC,eAAY;EAAQ,CAAA,IAC7E,IACD;MACH,IACJ,EAAA,CAAA;CAkBJ,OAfI,IAEA,kBAAC,UAAD;EACE,MAAK;EACI;EACT,WAAW,EACT,8NACA,CACF;YAEC;CACK,CAAA,IAKV,kBAAC,OAAD;EAAK,WAAW,EAAG,gDAAgD,CAAS;YAAI;CAAa,CAAA;AAEjG"}
@@ -1,6 +1,19 @@
1
1
  import { FC, ReactNode } from 'react';
2
2
  import { AthFixture, AthSport } from '../types';
3
3
 
4
+ export type AthFixtureOutcome = 'HOME_WIN' | 'AWAY_WIN' | 'DRAW';
5
+ export type AthFixtureDecidedBy = 'EXTRA_TIME' | 'PENALTY_SHOOTOUT';
6
+ /**
7
+ * Cricket presentation derived from the fixture's scorecard (BOFF-7644).
8
+ * A cricket score is innings runs/wickets with overs — "185/6 (20 ov)" —
9
+ * and the result is a margin, not a score comparison.
10
+ */
11
+ export interface CricketMatchup {
12
+ homeLabel: string;
13
+ awayLabel: string;
14
+ oversLabel: string;
15
+ resultText: string;
16
+ }
4
17
  export interface Matchup {
5
18
  homeName: string;
6
19
  awayName: string;
@@ -11,9 +24,65 @@ export interface Matchup {
11
24
  hasScore: boolean;
12
25
  homeWon: boolean;
13
26
  awayWon: boolean;
27
+ /** Derived final outcome — null until a score exists. */
28
+ outcome: AthFixtureOutcome | null;
29
+ /** How a win was decided — null for draws and for full-time wins. */
30
+ decidedBy: AthFixtureDecidedBy | null;
31
+ /**
32
+ * Chip rendered under the score: the draw word when the tie was level,
33
+ * otherwise the knockout annotation ("AET" / "4–3 pens"). Null before a score
34
+ * exists. Always localised — it comes from `MatchupLabels`, never a literal.
35
+ */
36
+ outcomeNote: string | null;
37
+ /** Winning team name — null on a draw or before a score exists. */
38
+ winnerName: string | null;
39
+ /** Cricket scorecard presentation — only for cricket fixtures with one. */
40
+ cricket: CricketMatchup | null;
41
+ }
42
+ /**
43
+ * Localised copy for the strings `resolveMatchup` cannot know by itself.
44
+ *
45
+ * Passed in rather than pulled from a hook so `resolveMatchup` stays a pure
46
+ * function (it is unit-tested and reused by MatchupRow and the tournament
47
+ * bracket) — and required rather than optional so a new call site cannot
48
+ * quietly reintroduce hardcoded English.
49
+ */
50
+ export interface MatchupLabels {
51
+ /** Shown when the tie was level, e.g. "Draw". */
52
+ draw: string;
53
+ /** Suffix after the winning team, e.g. "won". */
54
+ won: string;
55
+ /** Abbreviation for a win after extra time, e.g. "AET". */
56
+ aet: string;
57
+ /** Builds the shootout annotation from the two penalty scores. */
58
+ pens: (home: number, away: number) => string;
59
+ /** Cricket: the margin phrase, e.g. "won by". */
60
+ wonBy: string;
61
+ /** Cricket: the unit a margin is measured in. */
62
+ marginUnits: {
63
+ runs: string;
64
+ wickets: string;
65
+ };
66
+ /** Cricket: parenthetical qualifiers on a decided result. */
67
+ cricketModifiers: {
68
+ superOver: string;
69
+ dls: string;
70
+ };
14
71
  }
15
- /** Derive the display matchup (names, scores, winner) from a fixture. */
16
- export declare function resolveMatchup(fixture: AthFixture): Matchup;
72
+ /**
73
+ * Localised labels for the matchup annotations.
74
+ *
75
+ * `tr` takes a key plus a literal English fallback (the i18n extractor in
76
+ * `atheletebridge-app` scans `tr(key, fallback)` call sites for exactly that
77
+ * shape), so there is no interpolation parameter to thread through. Only the
78
+ * word is translated and the two scores are appended around it — the digits
79
+ * and the dash are locale-neutral, and the word order is forced to the English
80
+ * one, which is the same compromise every other score-adjacent string in this
81
+ * package makes.
82
+ */
83
+ export declare function useMatchupLabels(): MatchupLabels;
84
+ /** Derive the display matchup (names, scores, outcome) from a fixture. */
85
+ export declare function resolveMatchup(fixture: AthFixture, labels: MatchupLabels): Matchup;
17
86
  export interface MatchupSideProps {
18
87
  name: string;
19
88
  sport?: AthSport;
@@ -1 +1 @@
1
- {"version":3,"file":"Scoreboard.d.ts","sourceRoot":"","sources":["../../../src/atheletebridge/components/Scoreboard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAQ3C,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAIrD,MAAM,WAAW,OAAO;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,QAAQ,CAAC;IACrB,SAAS,CAAC,EAAE,QAAQ,CAAC;IACrB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,yEAAyE;AACzE,wBAAgB,cAAc,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAmB3D;AAID,MAAM,WAAW,gBAAgB;IAC/B,IA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IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,iEAAiE;AACjE,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CAsH1C,CAAC"}
@@ -1,156 +1,281 @@
1
- import { cn as e } from "../utils/cn.js";
2
- import { StatusBadge as t } from "./StatusBadge.js";
3
- import { FIXTURE_TYPE_LABELS as n, SPORT_ICONS as r } from "./domain.js";
4
- import { Crest as i } from "./Crest.js";
5
- import { formatDate as a } from "../utils/formatters.js";
6
- import { CalendarClock as o, MapPin as s, Trophy as c } from "lucide-react";
7
- import { jsx as l, jsxs as u } from "react/jsx-runtime";
8
- import { GlassCard as d } from "@burdenoff/fe-libs/ui";
1
+ import { useAbTranslate as e } from "../i18n.js";
2
+ import { cn as t } from "../utils/cn.js";
3
+ import { StatusBadge as n } from "./StatusBadge.js";
4
+ import { FIXTURE_TYPE_LABELS as r, SPORT_ICONS as i } from "./domain.js";
5
+ import { Crest as a } from "./Crest.js";
6
+ import { formatDate as o } from "../utils/formatters.js";
7
+ import { useMemo as s } from "react";
8
+ import { CalendarClock as c, Handshake as l, MapPin as u, Trophy as d } from "lucide-react";
9
+ import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
10
+ import { GlassCard as h } from "@burdenoff/fe-libs/ui";
9
11
  //#region src/atheletebridge/components/Scoreboard.tsx
10
- function f(e) {
11
- let t = e.homeTeam?.name ?? "Home", n = e.awayTeam?.name ?? (e.awayTeamId ? "Away" : "TBD"), r = e.homeScore !== null && e.awayScore !== null, i = e.homeScore, a = e.awayScore, o = r && (i ?? 0) > (a ?? 0), s = r && (a ?? 0) > (i ?? 0);
12
+ var g = (e) => `${e.runs}/${e.wickets}`, _ = (e) => e.balls > 0 ? `${e.overs}.${e.balls}` : `${e.overs}`;
13
+ function v() {
14
+ let t = e();
15
+ return s(() => {
16
+ let e = t("atheletebridge.scoreboard.pens", "pens");
17
+ return {
18
+ draw: t("atheletebridge.scoreboard.draw", "Draw"),
19
+ won: t("atheletebridge.scoreboard.won", "won"),
20
+ aet: t("atheletebridge.scoreboard.aet", "AET"),
21
+ pens: (t, n) => `${t}–${n} ${e}`,
22
+ wonBy: t("atheletebridge.scoreboard.wonBy", "won by"),
23
+ marginUnits: {
24
+ runs: t("atheletebridge.scoreboard.marginRuns", "runs"),
25
+ wickets: t("atheletebridge.scoreboard.marginWickets", "wickets")
26
+ },
27
+ cricketModifiers: {
28
+ superOver: t("atheletebridge.scoreboard.superOver", "Super Over"),
29
+ dls: t("atheletebridge.scoreboard.dls", "DLS")
30
+ }
31
+ };
32
+ }, [t]);
33
+ }
34
+ function y(e, t) {
35
+ let n = e.homeTeam?.name ?? "Home", r = e.awayTeam?.name ?? (e.awayTeamId ? "Away" : "TBD"), i = e.homeScore, a = e.awayScore, o = i !== null && a !== null, s = e.cricketScorecard;
36
+ if (s && e.homeTeam?.sport === "CRICKET") {
37
+ let c = s.winner === "HOME" ? "HOME_WIN" : s.winner === "AWAY" ? "AWAY_WIN" : "DRAW", l = c === "HOME_WIN" ? n : c === "AWAY_WIN" ? r : null, u = s.decidedBy === "RUNS" ? t.marginUnits.runs : t.marginUnits.wickets, d = [s.superOver ? t.cricketModifiers.superOver : null, s.dls ? t.cricketModifiers.dls : null].filter(Boolean).join(", ");
38
+ return {
39
+ homeName: n,
40
+ awayName: r,
41
+ homeSport: e.homeTeam?.sport,
42
+ awaySport: e.awayTeam?.sport,
43
+ homeScore: i,
44
+ awayScore: a,
45
+ hasScore: o,
46
+ homeWon: c === "HOME_WIN",
47
+ awayWon: c === "AWAY_WIN",
48
+ outcome: c,
49
+ decidedBy: null,
50
+ outcomeNote: null,
51
+ winnerName: l,
52
+ cricket: {
53
+ homeLabel: g(s.homeInnings),
54
+ awayLabel: g(s.awayInnings),
55
+ oversLabel: `${_(s.homeInnings)} ov · ${_(s.awayInnings)} ov`,
56
+ resultText: `${l ?? ""} ${t.wonBy} ${s.margin} ${u}${d ? ` (${d})` : ""}`
57
+ }
58
+ };
59
+ }
60
+ let c = null, l = null, u = null;
61
+ if (o) {
62
+ let n = e.penaltyHomeScore, r = e.penaltyAwayScore, o = e.extraTimeHomeScore, s = e.extraTimeAwayScore;
63
+ n !== null && r !== null ? (c = n > r ? "HOME_WIN" : n < r ? "AWAY_WIN" : "DRAW", l = c === "DRAW" ? null : "PENALTY_SHOOTOUT", u = c === "DRAW" ? t.draw : t.pens(n, r)) : o !== null && s !== null ? (c = o > s ? "HOME_WIN" : o < s ? "AWAY_WIN" : "DRAW", l = c === "DRAW" ? null : "EXTRA_TIME", u = c === "DRAW" ? t.draw : t.aet) : i !== null && a !== null && (c = i > a ? "HOME_WIN" : i < a ? "AWAY_WIN" : "DRAW", u = c === "DRAW" ? t.draw : null);
64
+ }
12
65
  return {
13
- homeName: t,
14
- awayName: n,
66
+ homeName: n,
67
+ awayName: r,
15
68
  homeSport: e.homeTeam?.sport,
16
69
  awaySport: e.awayTeam?.sport,
17
70
  homeScore: i,
18
71
  awayScore: a,
19
- hasScore: r,
20
- homeWon: o,
21
- awayWon: s
72
+ hasScore: o,
73
+ homeWon: c === "HOME_WIN",
74
+ awayWon: c === "AWAY_WIN",
75
+ outcome: c,
76
+ decidedBy: l,
77
+ outcomeNote: u,
78
+ winnerName: c === "HOME_WIN" ? n : c === "AWAY_WIN" ? r : null,
79
+ cricket: null
22
80
  };
23
81
  }
24
- var p = ({ name: t, sport: n, align: r = "start", won: a = !1, dimmed: o = !1, crestSize: s = 40, stacked: c = !1, className: d }) => /* @__PURE__ */ u("div", {
25
- className: e("flex min-w-0 items-center gap-3", c ? "flex-col text-center" : r === "end" ? "flex-row-reverse text-right" : "text-left", d),
26
- children: [/* @__PURE__ */ l(i, {
27
- name: t,
82
+ var b = ({ name: e, sport: n, align: r = "start", won: i = !1, dimmed: o = !1, crestSize: s = 40, stacked: c = !1, className: l }) => /* @__PURE__ */ m("div", {
83
+ className: t("flex min-w-0 items-center gap-3", c ? "flex-col text-center" : r === "end" ? "flex-row-reverse text-right" : "text-left", l),
84
+ children: [/* @__PURE__ */ p(a, {
85
+ name: e,
28
86
  sport: n,
29
87
  size: s
30
- }), /* @__PURE__ */ l("span", {
31
- className: e("min-w-0 truncate font-semibold", c ? "max-w-[10rem] text-sm" : "text-sm", a ? "text-status-success-text" : o ? "text-text-muted" : "text-text-primary"),
32
- children: t
88
+ }), /* @__PURE__ */ p("span", {
89
+ className: t("min-w-0 truncate font-semibold", c ? "max-w-[10rem] text-sm" : "text-sm", i ? "text-status-success-text" : o ? "text-text-muted" : "text-text-primary"),
90
+ children: e
33
91
  })]
34
- }), m = {
92
+ }), x = {
35
93
  sm: "text-lg",
36
94
  md: "text-2xl",
37
95
  lg: "text-4xl sm:text-5xl"
38
- }, h = ({ matchup: t, time: n, size: r = "md", className: i }) => t.hasScore ? /* @__PURE__ */ u("div", {
39
- className: e("flex flex-col items-center gap-0.5", i),
40
- children: [/* @__PURE__ */ u("span", {
41
- className: e("flex items-center gap-2 font-bold leading-none tabular-nums", m[r]),
96
+ }, S = ({ matchup: e, time: n, size: r = "md", className: i }) => {
97
+ if (e.cricket) {
98
+ let a = e.cricket;
99
+ return /* @__PURE__ */ m("div", {
100
+ className: t("flex flex-col items-center gap-0.5", i),
101
+ children: [
102
+ /* @__PURE__ */ m("span", {
103
+ className: t("flex items-center gap-2 font-bold leading-none tabular-nums", x[r]),
104
+ children: [
105
+ /* @__PURE__ */ p("span", {
106
+ className: e.homeWon ? "text-status-success-text" : "text-text-primary",
107
+ children: a.homeLabel
108
+ }),
109
+ /* @__PURE__ */ p("span", {
110
+ className: "text-text-muted",
111
+ children: "v"
112
+ }),
113
+ /* @__PURE__ */ p("span", {
114
+ className: e.awayWon ? "text-status-success-text" : "text-text-primary",
115
+ children: a.awayLabel
116
+ })
117
+ ]
118
+ }),
119
+ /* @__PURE__ */ p("span", {
120
+ className: "text-[10px] font-medium uppercase tracking-wide text-text-muted",
121
+ children: a.oversLabel
122
+ }),
123
+ n ? /* @__PURE__ */ p("span", {
124
+ className: "text-xs text-text-secondary",
125
+ children: n
126
+ }) : null
127
+ ]
128
+ });
129
+ }
130
+ return e.hasScore ? /* @__PURE__ */ m("div", {
131
+ className: t("flex flex-col items-center gap-0.5", i),
42
132
  children: [
43
- /* @__PURE__ */ l("span", {
44
- className: t.homeWon ? "text-status-success-text" : "text-text-primary",
45
- children: t.homeScore
46
- }),
47
- /* @__PURE__ */ l("span", {
48
- className: "text-text-muted",
49
- children: "–"
133
+ /* @__PURE__ */ m("span", {
134
+ className: t("flex items-center gap-2 font-bold leading-none tabular-nums", x[r]),
135
+ children: [
136
+ /* @__PURE__ */ p("span", {
137
+ className: e.homeWon ? "text-status-success-text" : "text-text-primary",
138
+ children: e.homeScore
139
+ }),
140
+ /* @__PURE__ */ p("span", {
141
+ className: "text-text-muted",
142
+ children: "–"
143
+ }),
144
+ /* @__PURE__ */ p("span", {
145
+ className: e.awayWon ? "text-status-success-text" : "text-text-primary",
146
+ children: e.awayScore
147
+ })
148
+ ]
50
149
  }),
51
- /* @__PURE__ */ l("span", {
52
- className: t.awayWon ? "text-status-success-text" : "text-text-primary",
53
- children: t.awayScore
54
- })
150
+ e.outcomeNote ? /* @__PURE__ */ p("span", {
151
+ className: "rounded bg-bg-sunken px-1.5 py-0.5 text-[10px] font-bold uppercase tracking-wide text-text-secondary",
152
+ children: e.outcomeNote
153
+ }) : null,
154
+ n ? /* @__PURE__ */ p("span", {
155
+ className: "text-xs text-text-secondary",
156
+ children: n
157
+ }) : null
55
158
  ]
56
- }), n ? /* @__PURE__ */ l("span", {
57
- className: "text-xs text-text-secondary",
58
- children: n
59
- }) : null]
60
- }) : /* @__PURE__ */ u("div", {
61
- className: e("flex flex-col items-center gap-0.5", i),
62
- children: [/* @__PURE__ */ l("span", {
63
- className: "rounded-lg bg-bg-sunken px-3 py-1 text-xs font-bold uppercase tracking-wide text-text-secondary",
64
- children: "vs"
65
- }), n ? /* @__PURE__ */ l("span", {
66
- className: "text-xs text-text-secondary",
67
- children: n
68
- }) : null]
69
- }), g = ({ fixture: t, center: i = !1 }) => {
70
- let a = t.homeTeam?.sport ? r[t.homeTeam.sport] : c, o = [t.competition, t.round].filter(Boolean).join(" · ");
71
- return /* @__PURE__ */ u("span", {
72
- className: e("inline-flex items-center gap-1.5 text-xs font-medium text-text-secondary", i && "justify-center"),
73
- children: [/* @__PURE__ */ l(a, {
159
+ }) : /* @__PURE__ */ m("div", {
160
+ className: t("flex flex-col items-center gap-0.5", i),
161
+ children: [/* @__PURE__ */ p("span", {
162
+ className: "rounded-lg bg-bg-sunken px-3 py-1 text-xs font-bold uppercase tracking-wide text-text-secondary",
163
+ children: "vs"
164
+ }), n ? /* @__PURE__ */ p("span", {
165
+ className: "text-xs text-text-secondary",
166
+ children: n
167
+ }) : null]
168
+ });
169
+ }, C = ({ fixture: e, center: n = !1 }) => {
170
+ let a = e.homeTeam?.sport ? i[e.homeTeam.sport] : d, o = [e.competition, e.round].filter(Boolean).join(" · ");
171
+ return /* @__PURE__ */ m("span", {
172
+ className: t("inline-flex items-center gap-1.5 text-xs font-medium text-text-secondary", n && "justify-center"),
173
+ children: [/* @__PURE__ */ p(a, {
74
174
  className: "h-3.5 w-3.5 shrink-0 text-text-muted",
75
175
  "aria-hidden": "true"
76
- }), /* @__PURE__ */ l("span", {
176
+ }), /* @__PURE__ */ p("span", {
77
177
  className: "truncate",
78
- children: o || n[t.type]
178
+ children: o || r[e.type]
79
179
  })]
80
180
  });
81
- }, _ = ({ fixture: n, onClick: r, variant: i = "card", className: c }) => {
82
- let m = f(n), _ = i === "hero", v = m.hasScore ? null : a(n.scheduledAt), y = !!r;
83
- return /* @__PURE__ */ u(d, {
181
+ }, w = ({ fixture: e, onClick: r, variant: i = "card", className: a }) => {
182
+ let s = v(), g = y(e, s), _ = i === "hero", x = g.hasScore ? null : o(e.scheduledAt), w = !!r;
183
+ return /* @__PURE__ */ m(h, {
84
184
  treatment: _ ? "glass" : "metric",
85
185
  glow: _,
86
- role: y ? "button" : void 0,
87
- tabIndex: y ? 0 : void 0,
186
+ role: w ? "button" : void 0,
187
+ tabIndex: w ? 0 : void 0,
88
188
  onClick: r,
89
- onKeyDown: y ? (e) => {
189
+ onKeyDown: w ? (e) => {
90
190
  (e.key === "Enter" || e.key === " ") && (e.preventDefault(), r?.());
91
191
  } : void 0,
92
- className: e(_ ? "p-6 sm:p-8" : "p-5", y && "cursor-pointer transition-transform duration-200 hover:-translate-y-0.5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]", c),
192
+ className: t(_ ? "p-6 sm:p-8" : "p-5", w && "cursor-pointer transition-transform duration-200 hover:-translate-y-0.5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]", a),
93
193
  children: [
94
- /* @__PURE__ */ u("div", {
95
- className: e("flex items-center justify-between gap-3", _ && "justify-center"),
96
- children: [/* @__PURE__ */ l(g, {
97
- fixture: n,
194
+ /* @__PURE__ */ m("div", {
195
+ className: t("flex items-center justify-between gap-3", _ && "justify-center"),
196
+ children: [/* @__PURE__ */ p(C, {
197
+ fixture: e,
98
198
  center: _
99
- }), _ ? null : /* @__PURE__ */ l(t, { status: n.status })]
199
+ }), _ ? null : /* @__PURE__ */ p(n, { status: e.status })]
100
200
  }),
101
- /* @__PURE__ */ u("div", {
102
- className: e("mt-4 grid items-center gap-3", "grid-cols-[1fr_auto_1fr]", _ && "mt-6 gap-4 sm:gap-8"),
201
+ /* @__PURE__ */ m("div", {
202
+ className: t("mt-4 grid items-center gap-3", "grid-cols-[1fr_auto_1fr]", _ && "mt-6 gap-4 sm:gap-8"),
103
203
  children: [
104
- /* @__PURE__ */ l(p, {
105
- name: m.homeName,
106
- sport: m.homeSport,
204
+ /* @__PURE__ */ p(b, {
205
+ name: g.homeName,
206
+ sport: g.homeSport,
107
207
  align: _ ? void 0 : "end",
108
208
  stacked: _,
109
- won: m.homeWon,
110
- dimmed: m.awayWon,
209
+ won: g.homeWon,
210
+ dimmed: g.awayWon,
111
211
  crestSize: _ ? 72 : 40
112
212
  }),
113
- /* @__PURE__ */ l(h, {
114
- matchup: m,
115
- time: v,
213
+ /* @__PURE__ */ p(S, {
214
+ matchup: g,
215
+ time: x,
116
216
  size: _ ? "lg" : "md"
117
217
  }),
118
- /* @__PURE__ */ l(p, {
119
- name: m.awayName,
120
- sport: m.awaySport,
218
+ /* @__PURE__ */ p(b, {
219
+ name: g.awayName,
220
+ sport: g.awaySport,
121
221
  align: _ ? void 0 : "start",
122
222
  stacked: _,
123
- won: m.awayWon,
124
- dimmed: m.homeWon,
223
+ won: g.awayWon,
224
+ dimmed: g.homeWon,
125
225
  crestSize: _ ? 72 : 40
126
226
  })
127
227
  ]
128
228
  }),
129
- _ ? /* @__PURE__ */ l("div", {
229
+ e.status === "COMPLETED" && g.outcome ? /* @__PURE__ */ p("div", {
230
+ className: t("flex justify-center", _ ? "mt-4" : "mt-3"),
231
+ children: g.outcome === "DRAW" ? /* @__PURE__ */ m("span", {
232
+ className: "inline-flex items-center gap-1.5 rounded-full bg-bg-sunken px-3 py-1 text-xs font-semibold text-text-secondary",
233
+ children: [
234
+ /* @__PURE__ */ p(l, {
235
+ className: "h-3.5 w-3.5",
236
+ "aria-hidden": "true"
237
+ }),
238
+ " ",
239
+ s.draw
240
+ ]
241
+ }) : /* @__PURE__ */ m("span", {
242
+ className: "inline-flex items-center gap-1.5 rounded-full bg-status-success-bg-subtle px-3 py-1 text-xs font-semibold text-status-success-text",
243
+ children: [/* @__PURE__ */ p(d, {
244
+ className: "h-3.5 w-3.5",
245
+ "aria-hidden": "true"
246
+ }), g.cricket ? g.cricket.resultText : /* @__PURE__ */ m(f, { children: [
247
+ g.winnerName,
248
+ " ",
249
+ s.won,
250
+ g.decidedBy && g.outcomeNote ? ` (${g.outcomeNote})` : ""
251
+ ] })]
252
+ })
253
+ }) : null,
254
+ _ ? /* @__PURE__ */ p("div", {
130
255
  className: "mt-5 flex justify-center",
131
- children: /* @__PURE__ */ l(t, { status: n.status })
256
+ children: /* @__PURE__ */ p(n, { status: e.status })
132
257
  }) : null,
133
- /* @__PURE__ */ u("div", {
134
- className: e("mt-4 flex flex-wrap items-center gap-x-4 gap-y-1.5 text-xs text-text-secondary", _ && "mt-6 justify-center"),
135
- children: [/* @__PURE__ */ u("span", {
258
+ /* @__PURE__ */ m("div", {
259
+ className: t("mt-4 flex flex-wrap items-center gap-x-4 gap-y-1.5 text-xs text-text-secondary", _ && "mt-6 justify-center"),
260
+ children: [/* @__PURE__ */ m("span", {
136
261
  className: "flex items-center gap-1",
137
262
  children: [
138
- /* @__PURE__ */ l(o, {
263
+ /* @__PURE__ */ p(c, {
139
264
  className: "h-3.5 w-3.5",
140
265
  "aria-hidden": "true"
141
266
  }),
142
267
  " ",
143
- a(n.scheduledAt)
268
+ o(e.scheduledAt)
144
269
  ]
145
- }), n.venue ? /* @__PURE__ */ u("span", {
270
+ }), e.venue ? /* @__PURE__ */ m("span", {
146
271
  className: "flex items-center gap-1 truncate",
147
272
  children: [
148
- /* @__PURE__ */ l(s, {
273
+ /* @__PURE__ */ p(u, {
149
274
  className: "h-3.5 w-3.5 shrink-0",
150
275
  "aria-hidden": "true"
151
276
  }),
152
277
  " ",
153
- n.venue
278
+ e.venue
154
279
  ]
155
280
  }) : null]
156
281
  })
@@ -158,6 +283,6 @@ var p = ({ name: t, sport: n, align: r = "start", won: a = !1, dimmed: o = !1, c
158
283
  });
159
284
  };
160
285
  //#endregion
161
- export { p as MatchupSide, h as ScoreCenter, _ as Scoreboard, f as resolveMatchup };
286
+ export { b as MatchupSide, S as ScoreCenter, w as Scoreboard, y as resolveMatchup, v as useMatchupLabels };
162
287
 
163
288
  //# sourceMappingURL=Scoreboard.js.map