fansunited-frontend-components 0.0.63 → 0.0.64
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.
- package/ClassicQuizPlay.js +6 -6
- package/CollectLead.js +1 -1
- package/Discussion.js +1 -1
- package/EitherOrPlay.js +4 -4
- package/EventGamePlay.js +9 -9
- package/Leaderboard.js +4 -4
- package/MatchQuizPlay.js +10 -10
- package/PersonalityQuizPlay.js +6 -6
- package/PickThePair.js +1 -1
- package/PollVote.js +6 -6
- package/Predictor.js +8 -8
- package/Standings.js +263 -248
- package/TopX.js +7 -7
- package/chunks/{AlertMessage-AyMEW3JL.js → AlertMessage-D11oEBM7.js} +1 -1
- package/chunks/{Avatar-CBP4sabd.js → Avatar-DovSR8Yq.js} +1 -1
- package/chunks/{ChanceGameEmbedVariant-kBcjiKzu.js → ChanceGameEmbedVariant-B5vuzENl.js} +2 -2
- package/chunks/{createSvgIcon-C-cmTwJ_.js → CheckCircle-CL08EagS.js} +49 -42
- package/chunks/{Close-CS-wfAnO.js → Close-DEpdBZ1j.js} +1 -1
- package/chunks/{CollectLeadForm-DevgGzsO.js → CollectLeadForm-Bk9FHufQ.js} +21 -22
- package/chunks/{Divider-D6QU-XQ5.js → Divider-Chf8z_B5.js} +1 -1
- package/chunks/{Edit-B2N_Ry9g.js → Edit-BgKFqtbe.js} +1 -1
- package/chunks/{FormControl-D32DP14w.js → FormControl-bP5fF1j7.js} +2 -3
- package/chunks/{FormLabel-BYtvETHS.js → FormLabel-DpEd-_f0.js} +1 -1
- package/chunks/{Input-D81KBU9B.js → Input-ChSZLHkV.js} +1 -1
- package/chunks/{Notification-wXJmjBSg.js → Notification-6XYzwwD_.js} +1 -1
- package/chunks/{OverlayApiErrorSkeleton-DwV9wIov.js → OverlayApiErrorSkeleton-Dzn-4QeZ.js} +1 -1
- package/chunks/{Select-B_VR6iKu.js → Select-B3KaBu0K.js} +1 -2
- package/chunks/{SplitLeadAfterCollection-CowadlL1.js → SplitLeadAfterCollection-B37WSS2g.js} +1 -1
- package/chunks/{Textarea-DDJ2mdR3.js → Textarea-G02jGLI9.js} +1 -1
- package/chunks/index-6_qOtrSn.js +4 -0
- package/chunks/{main-C8ApxGVj.js → main-F7VbtZQQ.js} +7 -7
- package/chunks/{useForwardedInput-D2NH4BlT.js → useForwardedInput-Umu4U7f1.js} +1 -1
- package/index.js +88 -87
- package/package.json +2 -2
- package/chunks/CheckCircle-ByRrHC2p.js +0 -12
- package/chunks/index-8rxXfewU.js +0 -4
package/index.js
CHANGED
|
@@ -12,15 +12,15 @@ import { EitherOrPlay as Gt } from "./EitherOrPlay.js";
|
|
|
12
12
|
import { Leaderboard as jt } from "./Leaderboard.js";
|
|
13
13
|
import { Predictor as Bt } from "./Predictor.js";
|
|
14
14
|
import { TopX as Yt } from "./TopX.js";
|
|
15
|
-
import { Betslip as
|
|
16
|
-
import { Standings as
|
|
15
|
+
import { Betslip as Qt } from "./Betslip.js";
|
|
16
|
+
import { Standings as qt } from "./Standings.js";
|
|
17
17
|
import { jsx as s, jsxs as h, Fragment as z } from "react/jsx-runtime";
|
|
18
|
-
import k, { useState as O, useCallback as ge, useEffect as
|
|
18
|
+
import k, { useState as O, useCallback as ge, useEffect as X, useRef as pe } from "react";
|
|
19
19
|
import { G as xe, _ as ye, d as Se, T as be, u as M, a as we, b as Ce, c as Ee, e as Ie, B as d, i as Ne, f as Le, C as Te, g as _e, E as Ae, h as Re } from "./chunks/PrizeCard-CjZXXFx3.js";
|
|
20
20
|
import { S as De } from "./chunks/Spinner-htM_pA9-.js";
|
|
21
21
|
import { createPortal as ke } from "react-dom";
|
|
22
22
|
import { h as H } from "./chunks/helpers-B7-TtMzO.js";
|
|
23
|
-
import { E as
|
|
23
|
+
import { E as q } from "./chunks/EmojiEvents-E7Oqv7rk.js";
|
|
24
24
|
import { T as E } from "./chunks/Typography-DjxaMiey.js";
|
|
25
25
|
import { S as G } from "./chunks/Table-OBls_6ml.js";
|
|
26
26
|
import { K as Fe } from "./chunks/KeyboardArrowDown-CvGmYfHu.js";
|
|
@@ -79,8 +79,8 @@ const ze = "https://sports.fansunitedapi.com/v1", We = "https://search.fansunite
|
|
|
79
79
|
{ signal: t }
|
|
80
80
|
);
|
|
81
81
|
if (!l.ok) return a;
|
|
82
|
-
((await l.json()).data ?? []).forEach((
|
|
83
|
-
|
|
82
|
+
((await l.json()).data ?? []).forEach((u) => {
|
|
83
|
+
u != null && u.id && a.set(u.id, u);
|
|
84
84
|
});
|
|
85
85
|
} catch {
|
|
86
86
|
return a;
|
|
@@ -107,8 +107,9 @@ const ze = "https://sports.fansunitedapi.com/v1", We = "https://search.fansunite
|
|
|
107
107
|
}
|
|
108
108
|
)) == null ? void 0 : o.short_name) ?? e.short_name ?? null;
|
|
109
109
|
}, He = (e) => {
|
|
110
|
-
var
|
|
111
|
-
|
|
110
|
+
var t, a;
|
|
111
|
+
const n = e == null ? void 0 : e.assets;
|
|
112
|
+
return n ? ((t = n.find((r) => r.key === "LOGO")) == null ? void 0 : t.value) ?? ((a = n.find((r) => r.key === "HEADSHOT")) == null ? void 0 : a.value) ?? null : null;
|
|
112
113
|
}, Ge = (e) => (e == null ? void 0 : e.three_letter_code) ?? null, N = (e, ...n) => {
|
|
113
114
|
if (e)
|
|
114
115
|
for (const t of n) {
|
|
@@ -137,7 +138,7 @@ const ze = "https://sports.fansunitedapi.com/v1", We = "https://search.fansunite
|
|
|
137
138
|
}, Ye = (e, n, t, a) => {
|
|
138
139
|
const r = (n ?? "").toUpperCase();
|
|
139
140
|
return e === "LIVE" ? a.live : e === "FINISHED" ? r.includes("PEN") ? a.pen : r.includes("AET") || r.includes("EXTRA") ? a.aet : t === "tennis" ? a.finished : a.ft : e === "CANCELLED" ? r.includes("POSTPON") || r.includes("DELAYED") ? a.postponed : r.includes("ABANDON") || r.includes("INTERRUPT") ? a.abandoned : r.includes("SUSPEND") ? a.suspended : a.cancelled : null;
|
|
140
|
-
},
|
|
141
|
+
}, ve = (e) => {
|
|
141
142
|
const n = /* @__PURE__ */ new Map(), t = N(e, "score", "scores", "results");
|
|
142
143
|
return (Array.isArray(t) ? t : []).forEach((a) => {
|
|
143
144
|
const r = String(N(a, "key", "type", "name") ?? "").toLowerCase();
|
|
@@ -153,30 +154,30 @@ const ze = "https://sports.fansunitedapi.com/v1", We = "https://search.fansunite
|
|
|
153
154
|
}, Z = (e, n) => {
|
|
154
155
|
const t = e.get("result") ?? e.get("full_time") ?? e.get("current") ?? e.get("ft");
|
|
155
156
|
return t ? t[n] : null;
|
|
156
|
-
},
|
|
157
|
+
}, Qe = /^(?:set|period)[_\s-]?(\d+)$/, ee = (e, n) => {
|
|
157
158
|
const t = n === "one" ? "two" : "one", a = [];
|
|
158
159
|
return e.forEach((r, o) => {
|
|
159
|
-
const i = o.match(
|
|
160
|
+
const i = o.match(Qe);
|
|
160
161
|
if (!i) return;
|
|
161
|
-
const l = Number(i[1]), c = r[n] ?? "",
|
|
162
|
+
const l = Number(i[1]), c = r[n] ?? "", u = e.get(`set_${l}_tiebreak`) ?? e.get(`tie_break_${l}`) ?? e.get(`tiebreak_${l}`) ?? e.get(`set${l}_tiebreak`), g = Number(r[n]), f = Number(r[t]);
|
|
162
163
|
a.push({
|
|
163
164
|
n: l,
|
|
164
165
|
cell: {
|
|
165
166
|
games: c,
|
|
166
|
-
tiebreak:
|
|
167
|
+
tiebreak: u ? u[n] : null,
|
|
167
168
|
won: !Number.isNaN(g) && !Number.isNaN(f) && g > f
|
|
168
169
|
}
|
|
169
170
|
});
|
|
170
171
|
}), a.sort((r, o) => r.n - o.n).map((r) => r.cell);
|
|
171
172
|
}, te = (e, n, t, a, r, o) => {
|
|
172
|
-
const i = e ? t.get(e) : void 0, l = ie(i, a) ?? r, c = Ge(i) ?? Oe(i, a) ?? le(l === r ? null : l),
|
|
173
|
-
return { id: e, name: l, abbr: c, logoUrl:
|
|
174
|
-
},
|
|
175
|
-
var
|
|
173
|
+
const i = e ? t.get(e) : void 0, l = ie(i, a) ?? r, c = Ge(i) ?? Oe(i, a) ?? le(l === r ? null : l), u = He(i), g = i != null && i.type ? i.type.toUpperCase() === "ATHLETE" : o;
|
|
174
|
+
return { id: e, name: l, abbr: c, logoUrl: u, isAthlete: g, score: n };
|
|
175
|
+
}, Xe = (e) => e.includes("tennis"), ne = (e) => String(e.filter((n) => n.won).length), qe = (e, n, t, a, r, o) => {
|
|
176
|
+
var v, Q;
|
|
176
177
|
if (!e) return null;
|
|
177
178
|
const i = _(N(e, "id", "event_id", "match_id"));
|
|
178
179
|
if (!i) return null;
|
|
179
|
-
const l = String(N(e, "sport", "sport_type") ?? "").toLowerCase(), c =
|
|
180
|
+
const l = String(N(e, "sport", "sport_type") ?? "").toLowerCase(), c = Xe(l), u = _(
|
|
180
181
|
N(
|
|
181
182
|
e,
|
|
182
183
|
"started_at",
|
|
@@ -190,7 +191,7 @@ const ze = "https://sports.fansunitedapi.com/v1", We = "https://search.fansunite
|
|
|
190
191
|
)
|
|
191
192
|
), g = _(
|
|
192
193
|
N(e, "status", "status_type", "state", "match_status")
|
|
193
|
-
), f = Ke(g,
|
|
194
|
+
), f = Ke(g, u), m = Ye(f, g, l, o), C = ve(e), I = _(
|
|
194
195
|
N(e, "competitor_one", "competitorOne", "home_competitor")
|
|
195
196
|
) ?? "", p = _(
|
|
196
197
|
N(e, "competitor_two", "competitorTwo", "away_competitor")
|
|
@@ -218,14 +219,14 @@ const ze = "https://sports.fansunitedapi.com/v1", We = "https://search.fansunite
|
|
|
218
219
|
}
|
|
219
220
|
const L = _(
|
|
220
221
|
N(e, "competition_id", "competitionId")
|
|
221
|
-
), x = (t == null ? void 0 : t.season) ?? null, D = _(N(e, "stage_id", "stageId")), T = D ? ((x == null ? void 0 : x.stages) ?? []).find(($) => $.id === D) ?? null : null, F = (t == null ? void 0 : t.name) ?? (t == null ? void 0 : t.shortName) ?? _(N(e, "competition_name", "competition")), Y = (x == null ? void 0 : x.year) || (x == null ? void 0 : x.name) || null, V = (((
|
|
222
|
+
), x = (t == null ? void 0 : t.season) ?? null, D = _(N(e, "stage_id", "stageId")), T = D ? ((x == null ? void 0 : x.stages) ?? []).find(($) => $.id === D) ?? null : null, F = (t == null ? void 0 : t.name) ?? (t == null ? void 0 : t.shortName) ?? _(N(e, "competition_name", "competition")), Y = (x == null ? void 0 : x.year) || (x == null ? void 0 : x.name) || null, V = (((v = x == null ? void 0 : x.stages) == null ? void 0 : v.length) ?? 0) <= 1, P = ((Q = T == null ? void 0 : T.stageNameModel) == null ? void 0 : Q.name) ?? null, U = V ? a ?? P : P;
|
|
222
223
|
return {
|
|
223
224
|
id: i,
|
|
224
225
|
sport: l,
|
|
225
226
|
isTennis: c,
|
|
226
227
|
status: f,
|
|
227
|
-
statusLabel:
|
|
228
|
-
startsAt:
|
|
228
|
+
statusLabel: m,
|
|
229
|
+
startsAt: u,
|
|
229
230
|
competition: {
|
|
230
231
|
id: L,
|
|
231
232
|
name: F,
|
|
@@ -248,7 +249,7 @@ const ze = "https://sports.fansunitedapi.com/v1", We = "https://search.fansunite
|
|
|
248
249
|
};
|
|
249
250
|
return t(N(e, "competitor_one", "competitorOne", "home_competitor")), t(N(e, "competitor_two", "competitorTwo", "away_competitor")), n;
|
|
250
251
|
}, Je = (e) => e ? _(N(e, "competition_id", "competitionId")) : null, Ze = (e) => e ? _(N(e, "season_id", "seasonId")) : null, et = (e, n, t, a, r) => {
|
|
251
|
-
const { t: o } = M("common"), [i, l] = O(null), [c,
|
|
252
|
+
const { t: o } = M("common"), [i, l] = O(null), [c, u] = O(!0), [g, f] = O(!1), m = ge(
|
|
252
253
|
async (p, y) => {
|
|
253
254
|
var S, w, R, L;
|
|
254
255
|
const b = {
|
|
@@ -264,7 +265,7 @@ const ze = "https://sports.fansunitedapi.com/v1", We = "https://search.fansunite
|
|
|
264
265
|
suspended: o("eventCard.status.suspended"),
|
|
265
266
|
unknownCompetitor: o("eventCard.unknownCompetitor")
|
|
266
267
|
};
|
|
267
|
-
y || (
|
|
268
|
+
y || (u(!0), f(!1));
|
|
268
269
|
try {
|
|
269
270
|
const x = await Ue(e, n, p), [D, T] = await Promise.all([
|
|
270
271
|
J(e, re(x), p),
|
|
@@ -281,7 +282,7 @@ const ze = "https://sports.fansunitedapi.com/v1", We = "https://search.fansunite
|
|
|
281
282
|
}
|
|
282
283
|
}
|
|
283
284
|
l(
|
|
284
|
-
|
|
285
|
+
qe(
|
|
285
286
|
x,
|
|
286
287
|
D,
|
|
287
288
|
T,
|
|
@@ -294,30 +295,30 @@ const ze = "https://sports.fansunitedapi.com/v1", We = "https://search.fansunite
|
|
|
294
295
|
if (p.aborted || (x == null ? void 0 : x.name) === "AbortError") return;
|
|
295
296
|
y || f(!0);
|
|
296
297
|
} finally {
|
|
297
|
-
!p.aborted && !y &&
|
|
298
|
+
!p.aborted && !y && u(!1);
|
|
298
299
|
}
|
|
299
300
|
},
|
|
300
301
|
[e, n, t, o]
|
|
301
302
|
);
|
|
302
|
-
|
|
303
|
+
X(() => {
|
|
303
304
|
if (!e || !n) {
|
|
304
|
-
|
|
305
|
+
u(!1);
|
|
305
306
|
return;
|
|
306
307
|
}
|
|
307
308
|
const p = new AbortController();
|
|
308
|
-
return
|
|
309
|
-
}, [e, n,
|
|
309
|
+
return m(p.signal, !1), () => p.abort();
|
|
310
|
+
}, [e, n, m]);
|
|
310
311
|
const C = (i == null ? void 0 : i.status) === "LIVE", I = pe(null);
|
|
311
|
-
return
|
|
312
|
+
return X(() => {
|
|
312
313
|
if (!C || !a || r <= 0) return;
|
|
313
314
|
const p = new AbortController();
|
|
314
315
|
return I.current = setInterval(
|
|
315
|
-
() =>
|
|
316
|
+
() => m(p.signal, !0),
|
|
316
317
|
r
|
|
317
318
|
), () => {
|
|
318
319
|
p.abort(), I.current && clearInterval(I.current);
|
|
319
320
|
};
|
|
320
|
-
}, [a, C, r,
|
|
321
|
+
}, [a, C, r, m]), console.log("data", i), { data: i, loading: c, error: g };
|
|
321
322
|
}, A = () => {
|
|
322
323
|
const e = we(), n = Ce(), t = Ee(), a = Ie(), r = `rgba(${H(e.textSecondary)}, 0.62)`;
|
|
323
324
|
return {
|
|
@@ -353,7 +354,7 @@ const ze = "https://sports.fansunitedapi.com/v1", We = "https://search.fansunite
|
|
|
353
354
|
fallbackIcon: i,
|
|
354
355
|
plainLogo: l = !1,
|
|
355
356
|
avatar: c = !1,
|
|
356
|
-
alt:
|
|
357
|
+
alt: u
|
|
357
358
|
}) => {
|
|
358
359
|
const { colors: g } = A(), f = l && !!e && !c;
|
|
359
360
|
return /* @__PURE__ */ s(
|
|
@@ -376,7 +377,7 @@ const ze = "https://sports.fansunitedapi.com/v1", We = "https://search.fansunite
|
|
|
376
377
|
{
|
|
377
378
|
component: "img",
|
|
378
379
|
src: e,
|
|
379
|
-
alt:
|
|
380
|
+
alt: u ?? n ?? "",
|
|
380
381
|
sx: {
|
|
381
382
|
width: c || f ? "100%" : "80%",
|
|
382
383
|
height: c || f ? "100%" : "80%",
|
|
@@ -428,7 +429,7 @@ const ze = "https://sports.fansunitedapi.com/v1", We = "https://search.fansunite
|
|
|
428
429
|
shape: "rounded",
|
|
429
430
|
bg: t.chip,
|
|
430
431
|
labelFontEm: 0.5625,
|
|
431
|
-
fallbackIcon: /* @__PURE__ */ s(
|
|
432
|
+
fallbackIcon: /* @__PURE__ */ s(q, { sx: { fontSize: "0.9em", color: t.dim } }),
|
|
432
433
|
plainLogo: !0,
|
|
433
434
|
alt: e.name ?? void 0
|
|
434
435
|
}
|
|
@@ -467,7 +468,7 @@ const ze = "https://sports.fansunitedapi.com/v1", We = "https://search.fansunite
|
|
|
467
468
|
shape: "rounded",
|
|
468
469
|
bg: t.chip,
|
|
469
470
|
labelFontEm: 0.6875,
|
|
470
|
-
fallbackIcon: /* @__PURE__ */ s(
|
|
471
|
+
fallbackIcon: /* @__PURE__ */ s(q, { sx: { fontSize: "1.25em", color: t.dim } }),
|
|
471
472
|
plainLogo: !0,
|
|
472
473
|
alt: e.name ?? void 0
|
|
473
474
|
}
|
|
@@ -575,7 +576,7 @@ const ze = "https://sports.fansunitedapi.com/v1", We = "https://search.fansunite
|
|
|
575
576
|
}
|
|
576
577
|
}
|
|
577
578
|
);
|
|
578
|
-
},
|
|
579
|
+
}, ue = () => {
|
|
579
580
|
const { colors: e, fonts: n } = A(), { t } = M("common");
|
|
580
581
|
return /* @__PURE__ */ h(
|
|
581
582
|
d,
|
|
@@ -607,7 +608,7 @@ const ze = "https://sports.fansunitedapi.com/v1", We = "https://search.fansunite
|
|
|
607
608
|
labels: a,
|
|
608
609
|
header: r
|
|
609
610
|
}) => {
|
|
610
|
-
const { colors: o, fonts: i, spacing: l, radius: c } = A(),
|
|
611
|
+
const { colors: o, fonts: i, spacing: l, radius: c } = A(), u = B(e.startsAt, t), g = K(e.startsAt, t, a.today, a.tomorrow), f = e.status === "LIVE" || e.status === "FINISHED", m = (y, b) => {
|
|
611
612
|
const S = Number(y), w = Number(b);
|
|
612
613
|
return Number.isNaN(S) || Number.isNaN(w) || S === w || S > w ? o.text : o.dim;
|
|
613
614
|
}, C = /* @__PURE__ */ s(
|
|
@@ -623,7 +624,7 @@ const ze = "https://sports.fansunitedapi.com/v1", We = "https://search.fansunite
|
|
|
623
624
|
flexShrink: 0
|
|
624
625
|
},
|
|
625
626
|
children: e.status === "UPCOMING" ? /* @__PURE__ */ h(z, { children: [
|
|
626
|
-
|
|
627
|
+
u && /* @__PURE__ */ s(
|
|
627
628
|
E,
|
|
628
629
|
{
|
|
629
630
|
sx: {
|
|
@@ -633,7 +634,7 @@ const ze = "https://sports.fansunitedapi.com/v1", We = "https://search.fansunite
|
|
|
633
634
|
color: o.text,
|
|
634
635
|
lineHeight: 1.1
|
|
635
636
|
},
|
|
636
|
-
children:
|
|
637
|
+
children: u
|
|
637
638
|
}
|
|
638
639
|
),
|
|
639
640
|
g && /* @__PURE__ */ s(
|
|
@@ -669,7 +670,7 @@ const ze = "https://sports.fansunitedapi.com/v1", We = "https://search.fansunite
|
|
|
669
670
|
lineHeight: 1,
|
|
670
671
|
minWidth: "1em",
|
|
671
672
|
textAlign: "right",
|
|
672
|
-
color:
|
|
673
|
+
color: m(y.score, b.score)
|
|
673
674
|
},
|
|
674
675
|
children: y.score
|
|
675
676
|
}
|
|
@@ -760,7 +761,7 @@ const ze = "https://sports.fansunitedapi.com/v1", We = "https://search.fansunite
|
|
|
760
761
|
]
|
|
761
762
|
}
|
|
762
763
|
);
|
|
763
|
-
},
|
|
764
|
+
}, me = ({
|
|
764
765
|
homeSets: e,
|
|
765
766
|
awaySets: n,
|
|
766
767
|
expanded: t,
|
|
@@ -771,7 +772,7 @@ const ze = "https://sports.fansunitedapi.com/v1", We = "https://search.fansunite
|
|
|
771
772
|
if (i === 0) return null;
|
|
772
773
|
const l = (c) => {
|
|
773
774
|
var g, f;
|
|
774
|
-
const
|
|
775
|
+
const u = (g = e[c]) != null && g.won ? "home" : (f = n[c]) != null && f.won ? "away" : null;
|
|
775
776
|
return /* @__PURE__ */ s(
|
|
776
777
|
d,
|
|
777
778
|
{
|
|
@@ -783,7 +784,7 @@ const ze = "https://sports.fansunitedapi.com/v1", We = "https://search.fansunite
|
|
|
783
784
|
position: "relative",
|
|
784
785
|
overflow: "hidden"
|
|
785
786
|
},
|
|
786
|
-
children:
|
|
787
|
+
children: u && /* @__PURE__ */ s(
|
|
787
788
|
d,
|
|
788
789
|
{
|
|
789
790
|
sx: {
|
|
@@ -791,8 +792,8 @@ const ze = "https://sports.fansunitedapi.com/v1", We = "https://search.fansunite
|
|
|
791
792
|
top: 0,
|
|
792
793
|
bottom: 0,
|
|
793
794
|
width: "50%",
|
|
794
|
-
left:
|
|
795
|
-
right:
|
|
795
|
+
left: u === "home" ? 0 : "auto",
|
|
796
|
+
right: u === "away" ? 0 : "auto",
|
|
796
797
|
backgroundColor: o.primary
|
|
797
798
|
}
|
|
798
799
|
}
|
|
@@ -827,7 +828,7 @@ const ze = "https://sports.fansunitedapi.com/v1", We = "https://search.fansunite
|
|
|
827
828
|
}
|
|
828
829
|
},
|
|
829
830
|
children: [
|
|
830
|
-
/* @__PURE__ */ s(d, { sx: { display: "flex", gap: "0.2em" }, children: Array.from({ length: i }).map((c,
|
|
831
|
+
/* @__PURE__ */ s(d, { sx: { display: "flex", gap: "0.2em" }, children: Array.from({ length: i }).map((c, u) => l(u)) }),
|
|
831
832
|
/* @__PURE__ */ s(
|
|
832
833
|
Fe,
|
|
833
834
|
{
|
|
@@ -848,7 +849,7 @@ const ze = "https://sports.fansunitedapi.com/v1", We = "https://search.fansunite
|
|
|
848
849
|
awaySets: a,
|
|
849
850
|
expanded: r
|
|
850
851
|
}) => {
|
|
851
|
-
const { colors: o, fonts: i, spacing: l } = A(), c = Math.max(t.length, a.length),
|
|
852
|
+
const { colors: o, fonts: i, spacing: l } = A(), c = Math.max(t.length, a.length), u = `rgba(${H(o.text)}, 0.08)`, g = (m, C) => /* @__PURE__ */ h(
|
|
852
853
|
d,
|
|
853
854
|
{
|
|
854
855
|
sx: {
|
|
@@ -863,12 +864,12 @@ const ze = "https://sports.fansunitedapi.com/v1", We = "https://search.fansunite
|
|
|
863
864
|
fontSize: "1em",
|
|
864
865
|
fontWeight: 700,
|
|
865
866
|
lineHeight: 1,
|
|
866
|
-
color:
|
|
867
|
-
backgroundColor:
|
|
867
|
+
color: m != null && m.won ? o.text : o.dim,
|
|
868
|
+
backgroundColor: m != null && m.won ? u : "transparent"
|
|
868
869
|
},
|
|
869
870
|
children: [
|
|
870
|
-
(
|
|
871
|
-
(
|
|
871
|
+
(m == null ? void 0 : m.games) ?? "-",
|
|
872
|
+
(m == null ? void 0 : m.tiebreak) != null && /* @__PURE__ */ s(
|
|
872
873
|
d,
|
|
873
874
|
{
|
|
874
875
|
component: "sup",
|
|
@@ -880,13 +881,13 @@ const ze = "https://sports.fansunitedapi.com/v1", We = "https://search.fansunite
|
|
|
880
881
|
alignSelf: "flex-start",
|
|
881
882
|
marginTop: "0.2em"
|
|
882
883
|
},
|
|
883
|
-
children:
|
|
884
|
+
children: m.tiebreak
|
|
884
885
|
}
|
|
885
886
|
)
|
|
886
887
|
]
|
|
887
888
|
},
|
|
888
889
|
C
|
|
889
|
-
), f = (
|
|
890
|
+
), f = (m, C) => /* @__PURE__ */ h(d, { sx: { display: "flex", alignItems: "center", gap: l.sm }, children: [
|
|
890
891
|
/* @__PURE__ */ h(
|
|
891
892
|
d,
|
|
892
893
|
{
|
|
@@ -901,15 +902,15 @@ const ze = "https://sports.fansunitedapi.com/v1", We = "https://search.fansunite
|
|
|
901
902
|
/* @__PURE__ */ s(
|
|
902
903
|
W,
|
|
903
904
|
{
|
|
904
|
-
logoUrl:
|
|
905
|
-
label:
|
|
905
|
+
logoUrl: m.logoUrl,
|
|
906
|
+
label: m.abbr,
|
|
906
907
|
sizeEm: 1.375,
|
|
907
908
|
shape: "circle",
|
|
908
909
|
bg: o.inner,
|
|
909
910
|
labelFontEm: 0.5625,
|
|
910
911
|
plainLogo: !0,
|
|
911
|
-
avatar:
|
|
912
|
-
alt:
|
|
912
|
+
avatar: m.isAthlete,
|
|
913
|
+
alt: m.name
|
|
913
914
|
}
|
|
914
915
|
),
|
|
915
916
|
/* @__PURE__ */ s(
|
|
@@ -924,7 +925,7 @@ const ze = "https://sports.fansunitedapi.com/v1", We = "https://search.fansunite
|
|
|
924
925
|
overflow: "hidden",
|
|
925
926
|
textOverflow: "ellipsis"
|
|
926
927
|
},
|
|
927
|
-
children:
|
|
928
|
+
children: m.name
|
|
928
929
|
}
|
|
929
930
|
)
|
|
930
931
|
]
|
|
@@ -969,7 +970,7 @@ const ze = "https://sports.fansunitedapi.com/v1", We = "https://search.fansunite
|
|
|
969
970
|
labels: t,
|
|
970
971
|
header: a
|
|
971
972
|
}) => {
|
|
972
|
-
const { colors: r, fonts: o, spacing: i, radius: l } = A(), [c,
|
|
973
|
+
const { colors: r, fonts: o, spacing: i, radius: l } = A(), [c, u] = O(!1), g = e.isTennis && Math.max(e.homeSets.length, e.awaySets.length) > 0, f = B(e.startsAt, n), m = K(
|
|
973
974
|
e.startsAt,
|
|
974
975
|
n,
|
|
975
976
|
t.today,
|
|
@@ -1055,7 +1056,7 @@ const ze = "https://sports.fansunitedapi.com/v1", We = "https://search.fansunite
|
|
|
1055
1056
|
},
|
|
1056
1057
|
children: f
|
|
1057
1058
|
}
|
|
1058
|
-
) : null, S = e.status === "LIVE" ? /* @__PURE__ */ s(
|
|
1059
|
+
) : null, S = e.status === "LIVE" ? /* @__PURE__ */ s(ue, {}) : e.status === "UPCOMING" ? null : e.statusLabel ? /* @__PURE__ */ s(
|
|
1059
1060
|
E,
|
|
1060
1061
|
{
|
|
1061
1062
|
sx: {
|
|
@@ -1066,11 +1067,11 @@ const ze = "https://sports.fansunitedapi.com/v1", We = "https://search.fansunite
|
|
|
1066
1067
|
},
|
|
1067
1068
|
children: e.statusLabel
|
|
1068
1069
|
}
|
|
1069
|
-
) : null, w =
|
|
1070
|
+
) : null, w = m ? /* @__PURE__ */ s(
|
|
1070
1071
|
E,
|
|
1071
1072
|
{
|
|
1072
1073
|
sx: { fontFamily: o.secondary, fontSize: "0.8125em", color: r.dim },
|
|
1073
|
-
children:
|
|
1074
|
+
children: m
|
|
1074
1075
|
}
|
|
1075
1076
|
) : null, R = p ? y : e.status === "UPCOMING" ? /* @__PURE__ */ h(d, { sx: { display: "flex", flexDirection: "column", alignItems: "center", gap: "0.0625em" }, children: [
|
|
1076
1077
|
b,
|
|
@@ -1124,12 +1125,12 @@ const ze = "https://sports.fansunitedapi.com/v1", We = "https://search.fansunite
|
|
|
1124
1125
|
}
|
|
1125
1126
|
),
|
|
1126
1127
|
g && /* @__PURE__ */ s(d, { sx: { display: "flex", justifyContent: "center", marginTop: "0.375em" }, children: /* @__PURE__ */ s(
|
|
1127
|
-
|
|
1128
|
+
me,
|
|
1128
1129
|
{
|
|
1129
1130
|
homeSets: e.homeSets,
|
|
1130
1131
|
awaySets: e.awaySets,
|
|
1131
1132
|
expanded: c,
|
|
1132
|
-
onToggle: () =>
|
|
1133
|
+
onToggle: () => u((x) => !x),
|
|
1133
1134
|
label: t.sets
|
|
1134
1135
|
}
|
|
1135
1136
|
) }),
|
|
@@ -1153,7 +1154,7 @@ const ze = "https://sports.fansunitedapi.com/v1", We = "https://search.fansunite
|
|
|
1153
1154
|
labels: t,
|
|
1154
1155
|
header: a
|
|
1155
1156
|
}) => {
|
|
1156
|
-
const { colors: r, fonts: o, spacing: i, radius: l } = A(), [c,
|
|
1157
|
+
const { colors: r, fonts: o, spacing: i, radius: l } = A(), [c, u] = O(!1), g = e.isTennis && Math.max(e.homeSets.length, e.awaySets.length) > 0, f = B(e.startsAt, n), m = K(e.startsAt, n, t.today, t.tomorrow), C = (e.status === "LIVE" || e.status === "FINISHED") && e.home.score !== null && e.away.score !== null, I = 3.75, p = 0.5, y = 1.125, b = (L) => /* @__PURE__ */ h(
|
|
1157
1158
|
d,
|
|
1158
1159
|
{
|
|
1159
1160
|
sx: {
|
|
@@ -1195,7 +1196,7 @@ const ze = "https://sports.fansunitedapi.com/v1", We = "https://search.fansunite
|
|
|
1195
1196
|
)
|
|
1196
1197
|
]
|
|
1197
1198
|
}
|
|
1198
|
-
), S =
|
|
1199
|
+
), S = m ? /* @__PURE__ */ s(E, { sx: { fontFamily: o.secondary, fontSize: "0.75em", color: r.dim }, children: m }) : null, w = C ? /* @__PURE__ */ h(
|
|
1199
1200
|
d,
|
|
1200
1201
|
{
|
|
1201
1202
|
sx: {
|
|
@@ -1229,7 +1230,7 @@ const ze = "https://sports.fansunitedapi.com/v1", We = "https://search.fansunite
|
|
|
1229
1230
|
}
|
|
1230
1231
|
),
|
|
1231
1232
|
S
|
|
1232
|
-
] }) : null, R = e.status === "LIVE" ? /* @__PURE__ */ s(
|
|
1233
|
+
] }) : null, R = e.status === "LIVE" ? /* @__PURE__ */ s(ue, {}) : e.status === "UPCOMING" ? null : e.statusLabel ? /* @__PURE__ */ s(
|
|
1233
1234
|
E,
|
|
1234
1235
|
{
|
|
1235
1236
|
sx: {
|
|
@@ -1331,12 +1332,12 @@ const ze = "https://sports.fansunitedapi.com/v1", We = "https://search.fansunite
|
|
|
1331
1332
|
justifyContent: "center"
|
|
1332
1333
|
},
|
|
1333
1334
|
children: /* @__PURE__ */ s(
|
|
1334
|
-
|
|
1335
|
+
me,
|
|
1335
1336
|
{
|
|
1336
1337
|
homeSets: e.homeSets,
|
|
1337
1338
|
awaySets: e.awaySets,
|
|
1338
1339
|
expanded: c,
|
|
1339
|
-
onToggle: () =>
|
|
1340
|
+
onToggle: () => u((L) => !L),
|
|
1340
1341
|
label: t.sets
|
|
1341
1342
|
}
|
|
1342
1343
|
)
|
|
@@ -1391,7 +1392,7 @@ const ze = "https://sports.fansunitedapi.com/v1", We = "https://search.fansunite
|
|
|
1391
1392
|
liveRefresh: o = !0,
|
|
1392
1393
|
refreshInterval: i = 3e4
|
|
1393
1394
|
}) => {
|
|
1394
|
-
const { t: l } = M("common"), { colors: c, fonts:
|
|
1395
|
+
const { t: l } = M("common"), { colors: c, fonts: u, spacing: g, radius: f } = A(), { data: m, loading: C, error: I } = et(
|
|
1395
1396
|
n,
|
|
1396
1397
|
e,
|
|
1397
1398
|
t,
|
|
@@ -1405,7 +1406,7 @@ const ze = "https://sports.fansunitedapi.com/v1", We = "https://search.fansunite
|
|
|
1405
1406
|
variant: "outlined",
|
|
1406
1407
|
sx: {
|
|
1407
1408
|
fontSize: "1em",
|
|
1408
|
-
fontFamily:
|
|
1409
|
+
fontFamily: u.primary,
|
|
1409
1410
|
borderRadius: f.md,
|
|
1410
1411
|
backgroundColor: c.surface,
|
|
1411
1412
|
borderColor: c.border
|
|
@@ -1419,7 +1420,7 @@ const ze = "https://sports.fansunitedapi.com/v1", We = "https://search.fansunite
|
|
|
1419
1420
|
E,
|
|
1420
1421
|
{
|
|
1421
1422
|
sx: {
|
|
1422
|
-
fontFamily:
|
|
1423
|
+
fontFamily: u.secondary,
|
|
1423
1424
|
fontSize: "1em",
|
|
1424
1425
|
color: c.dim,
|
|
1425
1426
|
textAlign: "center",
|
|
@@ -1429,8 +1430,8 @@ const ze = "https://sports.fansunitedapi.com/v1", We = "https://search.fansunite
|
|
|
1429
1430
|
}
|
|
1430
1431
|
) });
|
|
1431
1432
|
if (I) return y(l("eventCard.loadFailed"));
|
|
1432
|
-
if (!
|
|
1433
|
-
const b = r ? /* @__PURE__ */ s(tt, { competition:
|
|
1433
|
+
if (!m) return y(l("eventCard.notAvailable"));
|
|
1434
|
+
const b = r ? /* @__PURE__ */ s(tt, { competition: m.competition, template: a }) : null, S = {
|
|
1434
1435
|
today: l("eventCard.today"),
|
|
1435
1436
|
tomorrow: l("eventCard.tomorrow"),
|
|
1436
1437
|
sets: l("eventCard.sets")
|
|
@@ -1438,7 +1439,7 @@ const ze = "https://sports.fansunitedapi.com/v1", We = "https://search.fansunite
|
|
|
1438
1439
|
return a === "standard" ? /* @__PURE__ */ s(
|
|
1439
1440
|
ot,
|
|
1440
1441
|
{
|
|
1441
|
-
event:
|
|
1442
|
+
event: m,
|
|
1442
1443
|
language: t,
|
|
1443
1444
|
labels: S,
|
|
1444
1445
|
header: b
|
|
@@ -1446,7 +1447,7 @@ const ze = "https://sports.fansunitedapi.com/v1", We = "https://search.fansunite
|
|
|
1446
1447
|
) : a === "hero" ? /* @__PURE__ */ s(
|
|
1447
1448
|
st,
|
|
1448
1449
|
{
|
|
1449
|
-
event:
|
|
1450
|
+
event: m,
|
|
1450
1451
|
language: t,
|
|
1451
1452
|
labels: S,
|
|
1452
1453
|
header: b
|
|
@@ -1454,7 +1455,7 @@ const ze = "https://sports.fansunitedapi.com/v1", We = "https://search.fansunite
|
|
|
1454
1455
|
) : /* @__PURE__ */ s(
|
|
1455
1456
|
rt,
|
|
1456
1457
|
{
|
|
1457
|
-
event:
|
|
1458
|
+
event: m,
|
|
1458
1459
|
showHeaderBorder: r,
|
|
1459
1460
|
language: t,
|
|
1460
1461
|
labels: S,
|
|
@@ -1464,14 +1465,14 @@ const ze = "https://sports.fansunitedapi.com/v1", We = "https://search.fansunite
|
|
|
1464
1465
|
}, it = (e) => {
|
|
1465
1466
|
const [n, t] = k.useState(!1), [a, r] = k.useState(!1), o = k.useRef(
|
|
1466
1467
|
`$event-card-shadow-root-${Math.random().toString(36).substring(2, 11)}`
|
|
1467
|
-
), i = k.useRef(null), l = k.useRef(null), c = k.useRef(null),
|
|
1468
|
+
), i = k.useRef(null), l = k.useRef(null), c = k.useRef(null), u = k.useRef(null);
|
|
1468
1469
|
k.useEffect(() => {
|
|
1469
1470
|
Ne(e.language || "en").finally(() => r(!0));
|
|
1470
1471
|
}, [e.language]), k.useEffect(() => {
|
|
1471
1472
|
if (i.current)
|
|
1472
1473
|
return i.current.shadowRoot ? (l.current = i.current.shadowRoot, c.current = l.current.getElementById(
|
|
1473
1474
|
o.current
|
|
1474
|
-
), c.current || (c.current = document.createElement("div"), c.current.id = o.current, c.current.style.height = "100%", l.current.appendChild(c.current))) : (l.current = i.current.attachShadow({ mode: "open" }), c.current = document.createElement("div"), c.current.id = o.current, c.current.style.height = "100%", l.current.appendChild(c.current)),
|
|
1475
|
+
), c.current || (c.current = document.createElement("div"), c.current.id = o.current, c.current.style.height = "100%", l.current.appendChild(c.current))) : (l.current = i.current.attachShadow({ mode: "open" }), c.current = document.createElement("div"), c.current.id = o.current, c.current.style.height = "100%", l.current.appendChild(c.current)), u.current || (u.current = Le({
|
|
1475
1476
|
key: "event-card-css",
|
|
1476
1477
|
prepend: !0,
|
|
1477
1478
|
container: l.current
|
|
@@ -1479,8 +1480,8 @@ const ze = "https://sports.fansunitedapi.com/v1", We = "https://search.fansunite
|
|
|
1479
1480
|
t(!1);
|
|
1480
1481
|
};
|
|
1481
1482
|
}, []);
|
|
1482
|
-
const g = e.themeOptions, f = /* @__PURE__ */ s(d, { ref: i, sx: { height: "100%", display: "block" } }),
|
|
1483
|
-
/* @__PURE__ */ s(Te, { value:
|
|
1483
|
+
const g = e.themeOptions, f = /* @__PURE__ */ s(d, { ref: i, sx: { height: "100%", display: "block" } }), m = n && a && c.current && u.current ? ke(
|
|
1484
|
+
/* @__PURE__ */ s(Te, { value: u.current, children: /* @__PURE__ */ s(_e, { containerRef: i, children: /* @__PURE__ */ s(
|
|
1484
1485
|
Ae,
|
|
1485
1486
|
{
|
|
1486
1487
|
customTheme: g,
|
|
@@ -1515,15 +1516,15 @@ const ze = "https://sports.fansunitedapi.com/v1", We = "https://search.fansunite
|
|
|
1515
1516
|
) : null;
|
|
1516
1517
|
return /* @__PURE__ */ h(z, { children: [
|
|
1517
1518
|
f,
|
|
1518
|
-
|
|
1519
|
+
m
|
|
1519
1520
|
] });
|
|
1520
1521
|
}, lt = (e) => /* @__PURE__ */ s(it, { ...e, children: /* @__PURE__ */ s(at, { ...e }) }), bt = lt;
|
|
1521
1522
|
typeof window < "u" && (window.fansUnitedComponentsVersions = {
|
|
1522
|
-
components: "0.0.
|
|
1523
|
+
components: "0.0.64",
|
|
1523
1524
|
core: he
|
|
1524
1525
|
});
|
|
1525
1526
|
export {
|
|
1526
|
-
|
|
1527
|
+
Qt as Betslip,
|
|
1527
1528
|
Ut as ChanceGame,
|
|
1528
1529
|
Et as ClassicQuizPlay,
|
|
1529
1530
|
Tt as CollectLead,
|
|
@@ -1537,7 +1538,7 @@ export {
|
|
|
1537
1538
|
zt as PickThePair,
|
|
1538
1539
|
Nt as PollVote,
|
|
1539
1540
|
Bt as Predictor,
|
|
1540
|
-
|
|
1541
|
+
qt as Standings,
|
|
1541
1542
|
Yt as TopX,
|
|
1542
1543
|
Zt as betslipApi
|
|
1543
1544
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fansunited-frontend-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.64",
|
|
4
4
|
"description": "Various user centric components for Fans United features",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
}
|
|
73
73
|
},
|
|
74
74
|
"dependencies": {
|
|
75
|
-
"fansunited-frontend-core": "0.0.
|
|
75
|
+
"fansunited-frontend-core": "0.0.64",
|
|
76
76
|
"react": ">=16.8.0",
|
|
77
77
|
"react-dom": ">=16.8.0"
|
|
78
78
|
},
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as o from "react";
|
|
2
|
-
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
-
import { r as e } from "./PrizeCard-CjZXXFx3.js";
|
|
4
|
-
const r = /* @__PURE__ */ o.createContext(void 0);
|
|
5
|
-
process.env.NODE_ENV !== "production" && (r.displayName = "FormControlContext");
|
|
6
|
-
const s = e(/* @__PURE__ */ t("path", {
|
|
7
|
-
d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8z"
|
|
8
|
-
}), "CheckCircle");
|
|
9
|
-
export {
|
|
10
|
-
s as C,
|
|
11
|
-
r as F
|
|
12
|
-
};
|
package/chunks/index-8rxXfewU.js
DELETED