fansunited-frontend-components 0.0.98 → 0.0.99
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/Betslip.js +2 -2
- package/ChanceGame.js +958 -1464
- package/ClassicQuizPlay.js +2 -2
- package/CollectLead.js +1 -1
- package/CompetitionStatistics.js +2042 -2215
- package/CompetitorCard.js +4225 -5079
- package/Discussion.js +2 -2
- package/EitherOrPlay.js +2 -2
- package/EventCard.js +6010 -7547
- package/EventGamePlay.js +2 -2
- package/Leaderboard.js +546 -849
- package/List.js +227 -218
- package/MatchQuizPlay.js +2 -2
- package/Odds.js +50 -42
- package/PersonalityQuizPlay.js +2 -2
- package/PickThePair.js +2 -2
- package/PlayerOfTheMatch.js +285 -269
- package/PollVote.js +2 -2
- package/Predictor.js +80 -127
- package/README.md +1 -1
- package/Standings.js +991 -1324
- package/TopX.js +1120 -1167
- package/chunks/{ChanceGameEmbedVariant-CVys-3Zh.js → ChanceGameEmbedVariant-DM9eLG5s.js} +2 -2
- package/chunks/CheckCircle-I1FktW5Y.js +13 -0
- package/chunks/OddsSkeleton-DP5Yfqpr.js +522 -0
- package/chunks/Person-CXRqyF4E.js +11 -0
- package/chunks/PickOneOfX-DET4ZhjV.js +3117 -0
- package/chunks/Search-CIXthh0D.js +17 -0
- package/chunks/TimerOutlined-D-WA_vpE.js +8 -0
- package/chunks/WorkspacePremiumOutlined-DUXVgJlF.js +136 -0
- package/chunks/{chevrons-right-CXSpQt9w.js → chevrons-right-HWKW2c4I.js} +24 -4
- package/chunks/index-BENM3N_w.js +4 -0
- package/chunks/index-BRxAV693.js +4 -0
- package/chunks/index-BXYTsvIX.js +4 -0
- package/chunks/index-C0ilols1.js +4 -0
- package/chunks/index-D7VhczXH.js +4 -0
- package/chunks/index-DKwvdw9t.js +4 -0
- package/chunks/index-DZN-AITW.js +4 -0
- package/chunks/main-B2sDRFF4.js +2184 -0
- package/chunks/main-CzfWaEQP.js +4869 -0
- package/chunks/main-DFNl3g_U.js +4910 -0
- package/chunks/{main-65WcUqAl.js → main-DLwnvntz.js} +600 -593
- package/chunks/main-DiBlJBNb.js +1956 -0
- package/chunks/main-DxvBjXsd.js +1775 -0
- package/chunks/main-S8_NDSiY.js +3209 -0
- package/chunks/main-lBgr8Liq.js +6571 -0
- package/chunks/{withVersionStamp-T8seRk9h.js → withVersionStamp-BsLyhvNA.js} +1 -1
- package/package.json +2 -2
- package/chunks/OddsSkeleton-ClJE2xhR.js +0 -26
- package/chunks/OddsStrip-BnSp5TXa.js +0 -383
- package/chunks/PickOneOfX-DaJtkbCw.js +0 -4206
- package/chunks/chevron-left-CxfCSZcr.js +0 -13
- package/chunks/chevron-right-BEQMacFn.js +0 -13
- package/chunks/index-Aq5MbUB9.js +0 -4
- package/chunks/index-BBQm_8LD.js +0 -4
- package/chunks/index-BC_sWWgc.js +0 -4
- package/chunks/index-DXKDJ1Vp.js +0 -4
- package/chunks/index-DjT5NrbA.js +0 -4
- package/chunks/index-DvLRehH6.js +0 -4
- package/chunks/index-aIMaxR-p.js +0 -4
- package/chunks/main-52Wff7qC.js +0 -11441
- package/chunks/main-B58mi9jx.js +0 -5622
- package/chunks/main-BIdXUTZS.js +0 -7308
- package/chunks/main-DD-NEzC7.js +0 -8241
- package/chunks/main-DUnfJPzY.js +0 -3608
- package/chunks/main-DpCBqqg_.js +0 -1950
- package/chunks/main-Drznt1ak.js +0 -1790
- package/chunks/users-wbJRbqW8.js +0 -16
- package/chunks/x-CK4GYo7T.js +0 -14
package/Leaderboard.js
CHANGED
|
@@ -1,1010 +1,707 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import { useTranslation as
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
plainActiveBg: s.colorSchemes.light.palette.neutral.plainActiveBg,
|
|
28
|
-
plainHoverBg: s.colorSchemes.light.palette.neutral.plainHoverBg,
|
|
29
|
-
plainHoverColor: s.colorSchemes.light.palette.neutral.plainHoverColor
|
|
30
|
-
}
|
|
31
|
-
}, x = {
|
|
1
|
+
import { jsxs as T, jsx as i } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { useMemo as Q, useState as z, useEffect as F, useCallback as me } from "react";
|
|
3
|
+
import { css as v } from "@emotion/react";
|
|
4
|
+
import { useTranslation as Y } from "react-i18next";
|
|
5
|
+
import { Select as ge, Spinner as ye, DataTable as be, Avatar as J, Button as S, AlertMessage as K, WidgetPortal as ve } from "fansunited-frontend-core/ui/emotion";
|
|
6
|
+
import { useInternalTheme as ce, useColors as xe, isExtraSmall as Ce, hexToRgb as ee, stripHtmlTags as Te, DirectionalIcon as B, useDisableCache as Pe } from "fansunited-frontend-core";
|
|
7
|
+
import { PersonIcon as Ae } from "fansunited-frontend-core/ui/icons";
|
|
8
|
+
import { ChevronsLeft as Le, ChevronLeft as Ee, ChevronRight as we, ChevronsRight as Ie } from "fansunited-frontend-core/ui/icons/lucide";
|
|
9
|
+
import { w as Me } from "./chunks/withVersionStamp-BsLyhvNA.js";
|
|
10
|
+
const Oe = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()).join(" "), R = {
|
|
11
|
+
root: v({
|
|
12
|
+
display: "flex",
|
|
13
|
+
flexDirection: "column",
|
|
14
|
+
gap: "var(--fu-ucrc-space-2xs)",
|
|
15
|
+
fontFamily: "var(--fu-ucrc-font-primary)"
|
|
16
|
+
}),
|
|
17
|
+
label: v({ display: "flex", color: "var(--fu-ucrc-text-color)", fontSize: "0.875em" }),
|
|
18
|
+
labelText: v({ margin: 0, lineHeight: 1.5, fontSize: "0.875em", color: "var(--fu-ucrc-text-color)" }),
|
|
19
|
+
option: v({
|
|
20
|
+
display: "flex",
|
|
21
|
+
alignItems: "center",
|
|
22
|
+
justifyContent: "space-between",
|
|
23
|
+
width: "100%",
|
|
24
|
+
gap: "var(--fu-ucrc-space-sm)"
|
|
25
|
+
}),
|
|
26
|
+
chip: v({
|
|
32
27
|
flexShrink: 0,
|
|
33
|
-
fontFamily: m,
|
|
34
28
|
fontSize: "0.65em",
|
|
35
29
|
fontWeight: 600,
|
|
36
30
|
letterSpacing: "0.05em",
|
|
37
31
|
textTransform: "uppercase",
|
|
38
|
-
color:
|
|
39
|
-
|
|
40
|
-
border:
|
|
41
|
-
borderRadius:
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
"
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
border: `1px solid ${f.neutral.outlinedBorder}`,
|
|
77
|
-
borderRadius: g.sm,
|
|
78
|
-
boxShadow: "0 4px 6px -1px rgb(0 0 0 / 0.1)"
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}, h = {
|
|
82
|
-
fontFamily: m,
|
|
83
|
-
color: `${f.neutral.outlinedColor} !important`,
|
|
84
|
-
bgcolor: "transparent",
|
|
85
|
-
"&:hover": {
|
|
86
|
-
bgcolor: `${f.neutral.plainHoverBg} !important`,
|
|
87
|
-
color: `${f.neutral.plainHoverColor} !important`
|
|
88
|
-
},
|
|
89
|
-
"&.Mui-selected": {
|
|
90
|
-
bgcolor: `${f.neutral.plainActiveBg} !important`,
|
|
91
|
-
color: `${f.neutral.outlinedColor} !important`
|
|
92
|
-
},
|
|
93
|
-
"&.Mui-selected:hover": {
|
|
94
|
-
bgcolor: `${f.neutral.plainActiveBg} !important`,
|
|
95
|
-
color: `${f.neutral.outlinedColor} !important`
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
return /* @__PURE__ */ S(I, { sx: { display: "flex", flexDirection: "column", gap: u["2xs"] }, children: [
|
|
99
|
-
/* @__PURE__ */ n(
|
|
100
|
-
fe,
|
|
101
|
-
{
|
|
102
|
-
sx: {
|
|
103
|
-
color: `${C} !important`,
|
|
104
|
-
fontFamily: m,
|
|
105
|
-
fontSize: "0.875em"
|
|
106
|
-
},
|
|
107
|
-
children: /* @__PURE__ */ n(
|
|
108
|
-
L,
|
|
109
|
-
{
|
|
110
|
-
sx: {
|
|
111
|
-
fontFamily: m,
|
|
112
|
-
fontSize: "0.875em",
|
|
113
|
-
color: C
|
|
114
|
-
},
|
|
115
|
-
children: c("leaderboard.selectLabel")
|
|
116
|
-
}
|
|
117
|
-
)
|
|
118
|
-
}
|
|
119
|
-
),
|
|
120
|
-
/* @__PURE__ */ n(
|
|
32
|
+
color: "var(--fu-ucrc-neutral-outlined-color)",
|
|
33
|
+
backgroundColor: "var(--fu-ucrc-neutral-plain-hover-bg)",
|
|
34
|
+
border: "1px solid var(--fu-ucrc-neutral-outlined-border)",
|
|
35
|
+
borderRadius: "var(--fu-ucrc-radius-sm)",
|
|
36
|
+
paddingInline: "var(--fu-ucrc-space-2xs)",
|
|
37
|
+
paddingBlock: "var(--fu-ucrc-space-3xs)"
|
|
38
|
+
})
|
|
39
|
+
}, Ue = {
|
|
40
|
+
"--fu-ucrc-bg-surface": ["background", "surface"],
|
|
41
|
+
"--fu-ucrc-bg-popup": ["background", "popup"],
|
|
42
|
+
"--fu-ucrc-neutral-outlined-border": ["neutral", "outlinedBorder"],
|
|
43
|
+
"--fu-ucrc-neutral-outlined-color": ["neutral", "outlinedColor"],
|
|
44
|
+
"--fu-ucrc-neutral-outlined-hover-bg": ["neutral", "outlinedHoverBg"],
|
|
45
|
+
"--fu-ucrc-neutral-plain-active-bg": ["neutral", "plainActiveBg"],
|
|
46
|
+
"--fu-ucrc-neutral-plain-hover-bg": ["neutral", "plainHoverBg"],
|
|
47
|
+
"--fu-ucrc-neutral-plain-hover-color": ["neutral", "plainHoverColor"]
|
|
48
|
+
}, _e = ({ options: e, selectedId: t, onChange: n }) => {
|
|
49
|
+
const { t: o } = Y(), r = ce(), l = Q(() => {
|
|
50
|
+
const c = r.colorSchemes.light.palette || {};
|
|
51
|
+
return Object.fromEntries(
|
|
52
|
+
Object.entries(Ue).map(([p, [y, E]]) => {
|
|
53
|
+
var P;
|
|
54
|
+
return [p, (P = c[y]) == null ? void 0 : P[E]];
|
|
55
|
+
})
|
|
56
|
+
);
|
|
57
|
+
}, [r]), u = Q(
|
|
58
|
+
() => e.map((c) => ({
|
|
59
|
+
value: c.id,
|
|
60
|
+
label: /* @__PURE__ */ T("span", { css: R.option, children: [
|
|
61
|
+
/* @__PURE__ */ i("span", { children: c.label }),
|
|
62
|
+
c.type && /* @__PURE__ */ i("span", { css: R.chip, children: Oe(c.type) })
|
|
63
|
+
] })
|
|
64
|
+
})),
|
|
65
|
+
[e]
|
|
66
|
+
);
|
|
67
|
+
return /* @__PURE__ */ T("div", { css: R.root, style: l, children: [
|
|
68
|
+
/* @__PURE__ */ i("label", { css: R.label, children: /* @__PURE__ */ i("p", { css: R.labelText, children: o("leaderboard.selectLabel") }) }),
|
|
69
|
+
/* @__PURE__ */ i(
|
|
121
70
|
ge,
|
|
122
71
|
{
|
|
72
|
+
"aria-label": o("leaderboard.selectLabel"),
|
|
73
|
+
options: u,
|
|
123
74
|
value: t,
|
|
124
|
-
onChange:
|
|
125
|
-
slotProps: T,
|
|
126
|
-
renderValue: (d) => {
|
|
127
|
-
if (!d) return null;
|
|
128
|
-
const w = e.find((A) => A.id === d.value);
|
|
129
|
-
return w ? R(w) : d.label;
|
|
130
|
-
},
|
|
131
|
-
children: e.map((d) => /* @__PURE__ */ n(be, { value: d.id, sx: h, children: R(d) }, d.id))
|
|
75
|
+
onChange: n
|
|
132
76
|
}
|
|
133
77
|
)
|
|
134
78
|
] });
|
|
135
|
-
},
|
|
79
|
+
}, ze = "calc(6em / 10.5) calc(8em / 10.5)", X = "0.5em calc(8em / 12)", Qe = "var(--fu-ucrc-lb-primary)", G = "var(--fu-ucrc-lb-text)", de = "var(--fu-ucrc-lb-on-primary)", Se = "var(--fu-ucrc-lb-head-bg)", j = "var(--fu-ucrc-font-primary)", te = "var(--fu-ucrc-font-secondary)", ue = "var(--fu-ucrc-outline-enabled-border)", $ = { margin: 0, lineHeight: 1.5 }, Z = { ...$, fontFamily: j, fontSize: "0.875em", color: G }, x = {
|
|
80
|
+
container: v({ display: "flex", flexDirection: "column", gap: "var(--fu-ucrc-space-md)" }),
|
|
81
|
+
heading: v({ display: "flex", flexDirection: "column", alignItems: "center", textAlign: "center" }),
|
|
82
|
+
overline: v({
|
|
83
|
+
...$,
|
|
84
|
+
fontWeight: 500,
|
|
85
|
+
lineHeight: "166%",
|
|
86
|
+
letterSpacing: "1px",
|
|
87
|
+
textTransform: "uppercase",
|
|
88
|
+
fontSize: "0.75em",
|
|
89
|
+
color: "var(--fu-ucrc-text-color)",
|
|
90
|
+
opacity: "60%",
|
|
91
|
+
fontFamily: te
|
|
92
|
+
}),
|
|
93
|
+
titles: v({ display: "flex", flexDirection: "column", gap: "var(--fu-ucrc-space-3xs)" }),
|
|
94
|
+
title: v({
|
|
95
|
+
...$,
|
|
96
|
+
fontFamily: j,
|
|
97
|
+
fontWeight: 700,
|
|
98
|
+
lineHeight: "133%",
|
|
99
|
+
letterSpacing: "0px",
|
|
100
|
+
fontSize: "1.5em",
|
|
101
|
+
color: G,
|
|
102
|
+
textAlign: "center"
|
|
103
|
+
}),
|
|
104
|
+
description: v({
|
|
105
|
+
...$,
|
|
106
|
+
fontWeight: 400,
|
|
107
|
+
lineHeight: "140%",
|
|
108
|
+
letterSpacing: "0.15px",
|
|
109
|
+
fontSize: "1.25em",
|
|
110
|
+
color: "var(--fu-ucrc-text-color)",
|
|
111
|
+
opacity: "60%",
|
|
112
|
+
fontFamily: j
|
|
113
|
+
}),
|
|
114
|
+
tableContainer: v({
|
|
115
|
+
backgroundColor: "var(--fu-ucrc-bg-surface)",
|
|
116
|
+
overflowX: "auto",
|
|
117
|
+
borderRadius: "var(--fu-ucrc-radius-md)",
|
|
118
|
+
border: `1px solid ${ue}`
|
|
119
|
+
}),
|
|
120
|
+
nameCell: v({ display: "flex", alignItems: "center", gap: "var(--fu-ucrc-space-sm)" }),
|
|
121
|
+
avatar: v({
|
|
122
|
+
width: "32px",
|
|
123
|
+
height: "32px",
|
|
124
|
+
fontSize: "0.875em",
|
|
125
|
+
fontWeight: 600,
|
|
126
|
+
backgroundColor: Qe,
|
|
127
|
+
color: de
|
|
128
|
+
}),
|
|
129
|
+
position: v({ ...Z, fontWeight: 600 }),
|
|
130
|
+
name: v({ ...Z, fontWeight: 500, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }),
|
|
131
|
+
points: v({ ...Z, fontWeight: 600 }),
|
|
132
|
+
empty: v({
|
|
133
|
+
...$,
|
|
134
|
+
fontFamily: te,
|
|
135
|
+
fontSize: "1.25em",
|
|
136
|
+
color: G,
|
|
137
|
+
textAlign: "center",
|
|
138
|
+
marginBlock: "var(--fu-ucrc-space-md)"
|
|
139
|
+
})
|
|
140
|
+
}, N = {
|
|
141
|
+
backgroundColor: Se,
|
|
142
|
+
color: G,
|
|
143
|
+
fontFamily: j,
|
|
144
|
+
fontWeight: 600,
|
|
145
|
+
fontSize: "0.875em",
|
|
146
|
+
textAlign: "center",
|
|
147
|
+
padding: ze,
|
|
148
|
+
borderBottomColor: ue
|
|
149
|
+
}, U = {
|
|
150
|
+
headPosition: { ...N, width: "10%" },
|
|
151
|
+
headName: { ...N, textAlign: "start", width: "80%" },
|
|
152
|
+
headPoints: { ...N, width: "10%" },
|
|
153
|
+
position: { padding: X, width: "10%", textAlign: "center" },
|
|
154
|
+
name: { padding: X, width: "80%" },
|
|
155
|
+
points: { padding: X, width: "10%", textAlign: "center" }
|
|
156
|
+
}, De = { backgroundColor: "var(--fu-ucrc-surface-variant)", cursor: "default" }, re = /* @__PURE__ */ i(Ae, { size: "1em", color: de }), Re = ({
|
|
136
157
|
leaderboard: e,
|
|
137
158
|
userRank: t,
|
|
138
|
-
showHeading:
|
|
139
|
-
title:
|
|
159
|
+
showHeading: n,
|
|
160
|
+
title: o,
|
|
140
161
|
description: r,
|
|
141
|
-
isSplitVariant:
|
|
142
|
-
brandingColors:
|
|
143
|
-
rankStyles:
|
|
162
|
+
isSplitVariant: l,
|
|
163
|
+
brandingColors: u,
|
|
164
|
+
rankStyles: c
|
|
144
165
|
}) => {
|
|
145
|
-
const { t:
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
lineHeight: "133%",
|
|
155
|
-
letterSpacing: "0px",
|
|
156
|
-
fontSize: "1.5em",
|
|
157
|
-
color: x,
|
|
158
|
-
textAlign: "center"
|
|
159
|
-
},
|
|
160
|
-
tableContainer: {
|
|
161
|
-
overflowX: "auto",
|
|
162
|
-
borderRadius: d.md,
|
|
163
|
-
border: `1px solid ${i}`
|
|
164
|
-
},
|
|
165
|
-
table: {
|
|
166
|
-
backgroundColor: l,
|
|
167
|
-
"--TableCell-paddingX": "0.5rem",
|
|
168
|
-
"--TableCell-paddingY": "0.375rem",
|
|
169
|
-
cursor: "default",
|
|
170
|
-
"& > tbody > tr:hover": {
|
|
171
|
-
backgroundColor: "transparent"
|
|
172
|
-
},
|
|
173
|
-
"& > thead > tr > th": {
|
|
174
|
-
backgroundColor: `rgba(${U(l)}, 0.8)`,
|
|
175
|
-
color: x,
|
|
176
|
-
fontFamily: T,
|
|
177
|
-
fontWeight: 600,
|
|
178
|
-
fontSize: "0.875em",
|
|
179
|
-
textAlign: "center",
|
|
180
|
-
borderBottom: `1px solid ${i}`
|
|
181
|
-
}
|
|
182
|
-
},
|
|
183
|
-
headerCellPosition: {
|
|
184
|
-
backgroundColor: `rgba(${U(l)}, 0.8)`,
|
|
185
|
-
color: x,
|
|
186
|
-
fontFamily: T,
|
|
187
|
-
fontWeight: 600,
|
|
188
|
-
fontSize: "0.875em",
|
|
189
|
-
textAlign: "center",
|
|
190
|
-
padding: "0.375rem 0.5rem",
|
|
191
|
-
width: "10%"
|
|
192
|
-
},
|
|
193
|
-
headerCellName: {
|
|
194
|
-
backgroundColor: `rgba(${U(l)}, 0.8)`,
|
|
195
|
-
color: x,
|
|
196
|
-
fontFamily: T,
|
|
197
|
-
fontWeight: 600,
|
|
198
|
-
fontSize: "0.875em",
|
|
199
|
-
textAlign: "left",
|
|
200
|
-
padding: "0.375rem 0.5rem",
|
|
201
|
-
width: "80%"
|
|
202
|
-
},
|
|
203
|
-
headerCellPoints: {
|
|
204
|
-
backgroundColor: `rgba(${U(l)}, 0.8)`,
|
|
205
|
-
color: x,
|
|
206
|
-
fontFamily: T,
|
|
207
|
-
fontWeight: 600,
|
|
208
|
-
fontSize: "0.875em",
|
|
209
|
-
textAlign: "center",
|
|
210
|
-
padding: "0.375rem 0.5rem",
|
|
211
|
-
width: "10%"
|
|
212
|
-
},
|
|
213
|
-
tableCellPosition: {
|
|
214
|
-
padding: "0.375rem 0.5rem",
|
|
215
|
-
width: "10%",
|
|
216
|
-
textAlign: "center"
|
|
217
|
-
},
|
|
218
|
-
tableCellName: {
|
|
219
|
-
padding: "0.375rem 0.5rem",
|
|
220
|
-
width: "80%"
|
|
221
|
-
},
|
|
222
|
-
tableCellPoints: {
|
|
223
|
-
padding: "0.375rem 0.5rem",
|
|
224
|
-
width: "10%",
|
|
225
|
-
textAlign: "center"
|
|
226
|
-
},
|
|
227
|
-
userRow: {
|
|
228
|
-
backgroundColor: `rgba(${U(f)}, 0.1)`
|
|
229
|
-
},
|
|
230
|
-
nameCell: {
|
|
231
|
-
display: "flex",
|
|
232
|
-
alignItems: "center",
|
|
233
|
-
gap: w.sm
|
|
234
|
-
},
|
|
235
|
-
leaderboardAvatar: {
|
|
236
|
-
width: "32px",
|
|
237
|
-
height: "32px",
|
|
238
|
-
fontSize: "0.875em",
|
|
239
|
-
fontWeight: 600,
|
|
240
|
-
backgroundColor: f,
|
|
241
|
-
color: p
|
|
242
|
-
},
|
|
243
|
-
nameText: {
|
|
244
|
-
fontFamily: T,
|
|
245
|
-
fontWeight: 500,
|
|
246
|
-
fontSize: "0.875em",
|
|
247
|
-
color: x,
|
|
248
|
-
overflow: "hidden",
|
|
249
|
-
textOverflow: "ellipsis",
|
|
250
|
-
whiteSpace: "nowrap"
|
|
251
|
-
},
|
|
252
|
-
positionText: {
|
|
253
|
-
fontFamily: T,
|
|
254
|
-
fontWeight: 600,
|
|
255
|
-
fontSize: "0.875em",
|
|
256
|
-
color: x
|
|
257
|
-
},
|
|
258
|
-
pointsText: {
|
|
259
|
-
fontFamily: T,
|
|
260
|
-
fontWeight: 600,
|
|
261
|
-
fontSize: "0.875em",
|
|
262
|
-
color: x
|
|
263
|
-
},
|
|
264
|
-
avatarIcon: {
|
|
265
|
-
fontSize: "1em",
|
|
266
|
-
color: p
|
|
267
|
-
},
|
|
268
|
-
noLeaderboardText: {
|
|
269
|
-
fontFamily: h,
|
|
270
|
-
fontSize: "1.25em",
|
|
271
|
-
color: x,
|
|
272
|
-
textAlign: "center",
|
|
273
|
-
marginY: w.md
|
|
274
|
-
}
|
|
275
|
-
};
|
|
166
|
+
const { t: p } = Y(), y = ce(), E = xe(), P = Ce(), A = (u == null ? void 0 : u.primaryColor) || E.palette.primary.plainColor, f = Q(
|
|
167
|
+
() => ({
|
|
168
|
+
"--fu-ucrc-lb-primary": A,
|
|
169
|
+
"--fu-ucrc-lb-text": (u == null ? void 0 : u.contentColor) || E.textColor,
|
|
170
|
+
"--fu-ucrc-lb-on-primary": y.colorSchemes.light.palette.primary.onPrimary,
|
|
171
|
+
"--fu-ucrc-lb-head-bg": `rgba(${ee(E.surfaceVariant)}, 0.8)`
|
|
172
|
+
}),
|
|
173
|
+
[A, u == null ? void 0 : u.contentColor, E, y]
|
|
174
|
+
), h = Q(() => ({ backgroundColor: `rgba(${ee(A)}, 0.1)` }), [A]);
|
|
276
175
|
if (!e)
|
|
277
|
-
return /* @__PURE__ */
|
|
176
|
+
return /* @__PURE__ */ i(ye, { marginBlock: "5em" });
|
|
278
177
|
if (e.length === 0)
|
|
279
|
-
return /* @__PURE__ */
|
|
280
|
-
const
|
|
281
|
-
return /* @__PURE__ */
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
{
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
children:
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
textTransform: "uppercase",
|
|
301
|
-
fontSize: "0.75em",
|
|
302
|
-
color: R,
|
|
303
|
-
opacity: "60%",
|
|
304
|
-
fontFamily: h
|
|
305
|
-
},
|
|
306
|
-
children: m("leaderboard.heading")
|
|
307
|
-
}
|
|
308
|
-
),
|
|
309
|
-
/* @__PURE__ */ S(
|
|
310
|
-
I,
|
|
311
|
-
{
|
|
312
|
-
sx: {
|
|
313
|
-
display: "flex",
|
|
314
|
-
flexDirection: "column",
|
|
315
|
-
gap: w["3xs"]
|
|
316
|
-
},
|
|
317
|
-
children: [
|
|
318
|
-
c && /* @__PURE__ */ n(L, { level: "h4", sx: a.leaderboardTitle, children: c }),
|
|
319
|
-
r && /* @__PURE__ */ n(
|
|
320
|
-
L,
|
|
321
|
-
{
|
|
322
|
-
sx: {
|
|
323
|
-
fontWeight: 400,
|
|
324
|
-
lineHeight: "140%",
|
|
325
|
-
letterSpacing: "0.15px",
|
|
326
|
-
fontSize: "1.25em",
|
|
327
|
-
color: R,
|
|
328
|
-
opacity: "60%",
|
|
329
|
-
fontFamily: T
|
|
330
|
-
},
|
|
331
|
-
children: we(r)
|
|
332
|
-
}
|
|
333
|
-
)
|
|
334
|
-
]
|
|
335
|
-
}
|
|
336
|
-
)
|
|
337
|
-
]
|
|
338
|
-
}
|
|
339
|
-
),
|
|
340
|
-
/* @__PURE__ */ n(ye, { sx: a.tableContainer, children: /* @__PURE__ */ S(
|
|
341
|
-
xe,
|
|
342
|
-
{
|
|
343
|
-
variant: "outlined",
|
|
344
|
-
hoverRow: !1,
|
|
345
|
-
borderAxis: "bothBetween",
|
|
346
|
-
size: "sm",
|
|
347
|
-
sx: a.table,
|
|
348
|
-
children: [
|
|
349
|
-
/* @__PURE__ */ n("thead", { children: /* @__PURE__ */ S("tr", { children: [
|
|
350
|
-
/* @__PURE__ */ n("th", { style: a.headerCellPosition, children: A || s ? "" : m("leaderboard.position") }),
|
|
351
|
-
/* @__PURE__ */ n("th", { style: a.headerCellName, children: m("leaderboard.name") }),
|
|
352
|
-
/* @__PURE__ */ n("th", { style: a.headerCellPoints, children: A || s ? "🎯" : m("leaderboard.points") })
|
|
178
|
+
return /* @__PURE__ */ i("p", { css: x.empty, style: f, children: p("leaderboard.noLeaderboardAvailable") });
|
|
179
|
+
const C = t == null ? void 0 : t.profileId, s = C && e.some((g) => g.profileId === C);
|
|
180
|
+
return /* @__PURE__ */ T("div", { css: x.container, style: f, children: [
|
|
181
|
+
n && /* @__PURE__ */ T("div", { css: x.heading, children: [
|
|
182
|
+
/* @__PURE__ */ i("p", { css: x.overline, children: p("leaderboard.heading") }),
|
|
183
|
+
/* @__PURE__ */ T("div", { css: x.titles, children: [
|
|
184
|
+
o && /* @__PURE__ */ i("h4", { css: x.title, children: o }),
|
|
185
|
+
r && /* @__PURE__ */ i("p", { css: x.description, children: Te(r) })
|
|
186
|
+
] })
|
|
187
|
+
] }),
|
|
188
|
+
/* @__PURE__ */ i("div", { css: x.tableContainer, children: /* @__PURE__ */ T(be, { style: De, children: [
|
|
189
|
+
/* @__PURE__ */ i("thead", { children: /* @__PURE__ */ T("tr", { children: [
|
|
190
|
+
/* @__PURE__ */ i("th", { style: U.headPosition, children: P || l ? "" : p("leaderboard.position") }),
|
|
191
|
+
/* @__PURE__ */ i("th", { style: U.headName, children: p("leaderboard.name") }),
|
|
192
|
+
/* @__PURE__ */ i("th", { style: U.headPoints, children: P || l ? "🎯" : p("leaderboard.points") })
|
|
193
|
+
] }) }),
|
|
194
|
+
/* @__PURE__ */ T("tbody", { children: [
|
|
195
|
+
t && !s && /* @__PURE__ */ T("tr", { style: h, children: [
|
|
196
|
+
/* @__PURE__ */ i("td", { style: U.position, children: /* @__PURE__ */ T("p", { css: x.position, children: [
|
|
197
|
+
"#",
|
|
198
|
+
t.position
|
|
353
199
|
] }) }),
|
|
354
|
-
/* @__PURE__ */
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
{
|
|
378
|
-
src: ((Y = E.profileModel) == null ? void 0 : Y.avatar) || void 0,
|
|
379
|
-
sx: a.leaderboardAvatar,
|
|
380
|
-
children: (K = E.profileModel) != null && K.avatar ? /* @__PURE__ */ n(de, {}) : /* @__PURE__ */ n(oe, { sx: a.avatarIcon })
|
|
381
|
-
}
|
|
382
|
-
),
|
|
383
|
-
/* @__PURE__ */ n(L, { sx: a.nameText, children: M ? m("leaderboard.you") : ((q = E.profileModel) == null ? void 0 : q.nickname) || ((J = E.profileModel) == null ? void 0 : J.name) || m("leaderboard.anonymous") })
|
|
384
|
-
] }) }),
|
|
385
|
-
/* @__PURE__ */ n("td", { style: a.tableCellPoints, children: /* @__PURE__ */ n(L, { sx: a.pointsText, children: E.points }) })
|
|
386
|
-
] }, E.profileId);
|
|
387
|
-
})
|
|
388
|
-
] })
|
|
389
|
-
]
|
|
390
|
-
}
|
|
391
|
-
) })
|
|
200
|
+
/* @__PURE__ */ i("td", { style: U.name, children: /* @__PURE__ */ T("div", { css: x.nameCell, children: [
|
|
201
|
+
/* @__PURE__ */ i(J, { css: x.avatar, children: re }),
|
|
202
|
+
/* @__PURE__ */ i("p", { css: x.name, children: p("leaderboard.you") })
|
|
203
|
+
] }) }),
|
|
204
|
+
/* @__PURE__ */ i("td", { style: U.points, children: /* @__PURE__ */ i("p", { css: x.points, children: t.points }) })
|
|
205
|
+
] }),
|
|
206
|
+
e.map((g, w) => {
|
|
207
|
+
var a, m, I, O;
|
|
208
|
+
const d = C === g.profileId, b = d ? h : c == null ? void 0 : c[w + 1];
|
|
209
|
+
return /* @__PURE__ */ T("tr", { style: b, children: [
|
|
210
|
+
/* @__PURE__ */ i("td", { style: U.position, children: /* @__PURE__ */ T("p", { css: x.position, children: [
|
|
211
|
+
"#",
|
|
212
|
+
g.position
|
|
213
|
+
] }) }),
|
|
214
|
+
/* @__PURE__ */ i("td", { style: U.name, children: /* @__PURE__ */ T("div", { css: x.nameCell, children: [
|
|
215
|
+
/* @__PURE__ */ i(J, { src: ((a = g.profileModel) == null ? void 0 : a.avatar) || void 0, css: x.avatar, children: (m = g.profileModel) != null && m.avatar ? null : re }),
|
|
216
|
+
/* @__PURE__ */ i("p", { css: x.name, children: d ? p("leaderboard.you") : ((I = g.profileModel) == null ? void 0 : I.nickname) || ((O = g.profileModel) == null ? void 0 : O.name) || p("leaderboard.anonymous") })
|
|
217
|
+
] }) }),
|
|
218
|
+
/* @__PURE__ */ i("td", { style: U.points, children: /* @__PURE__ */ i("p", { css: x.points, children: g.points }) })
|
|
219
|
+
] }, g.profileId);
|
|
220
|
+
})
|
|
221
|
+
] })
|
|
222
|
+
] }) })
|
|
392
223
|
] });
|
|
393
|
-
},
|
|
224
|
+
}, He = v({
|
|
225
|
+
display: "flex",
|
|
226
|
+
gap: "4px",
|
|
227
|
+
alignItems: "center",
|
|
228
|
+
flexWrap: "wrap",
|
|
229
|
+
fontFamily: "var(--fu-ucrc-font-primary)"
|
|
230
|
+
}), D = { borderRadius: "8px", minWidth: "32px", minHeight: "32px" }, pe = { ...D, fontWeight: 400 }, Fe = { ...D, fontWeight: 600 }, $e = { ...pe, cursor: "default", color: "var(--fu-ucrc-joy-text-secondary)" }, Be = ({
|
|
394
231
|
count: e = 10,
|
|
395
232
|
page: t = 1,
|
|
396
|
-
onChange:
|
|
397
|
-
siblingCount:
|
|
233
|
+
onChange: n,
|
|
234
|
+
siblingCount: o = 1,
|
|
398
235
|
boundaryCount: r = 1,
|
|
399
|
-
showFirstButton:
|
|
400
|
-
showLastButton:
|
|
401
|
-
size:
|
|
402
|
-
disabled:
|
|
403
|
-
isOverlayVariant: u = !1
|
|
236
|
+
showFirstButton: l = !0,
|
|
237
|
+
showLastButton: u = !0,
|
|
238
|
+
size: c = "md",
|
|
239
|
+
disabled: p = !1
|
|
404
240
|
}) => {
|
|
405
|
-
const
|
|
406
|
-
|
|
407
|
-
},
|
|
408
|
-
const
|
|
409
|
-
for (let
|
|
410
|
-
return
|
|
411
|
-
},
|
|
241
|
+
const y = (h) => {
|
|
242
|
+
n && h >= 1 && h <= e && n(h);
|
|
243
|
+
}, E = (h, C) => {
|
|
244
|
+
const s = [];
|
|
245
|
+
for (let g = h; g <= C; g++) s.push(g);
|
|
246
|
+
return s;
|
|
247
|
+
}, A = (() => {
|
|
412
248
|
if (e <= 0) return [];
|
|
413
|
-
const
|
|
249
|
+
const h = E(1, Math.min(r, e)), C = E(
|
|
414
250
|
Math.max(e - r + 1, r + 1),
|
|
415
251
|
e
|
|
416
|
-
),
|
|
417
|
-
if (
|
|
418
|
-
for (let
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
for (const
|
|
422
|
-
|
|
423
|
-
return
|
|
424
|
-
})(),
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
minWidth: "32px",
|
|
436
|
-
minHeight: "32px",
|
|
437
|
-
fontWeight: l ? 600 : 400,
|
|
438
|
-
backgroundColor: l ? p.palette.neutral.solidBg : "transparent",
|
|
439
|
-
color: l ? p.palette.neutral.solidColor : p.textColor,
|
|
440
|
-
border: "none",
|
|
441
|
-
"&:hover": {
|
|
442
|
-
backgroundColor: p.palette.neutral.solidBg,
|
|
443
|
-
color: l ? p.palette.neutral.solidColor : p.textColor
|
|
444
|
-
},
|
|
445
|
-
"&:active": {
|
|
446
|
-
backgroundColor: p.palette.neutral.plainActiveBg
|
|
447
|
-
},
|
|
448
|
-
"&.Mui-disabled": {
|
|
449
|
-
backgroundColor: "transparent",
|
|
450
|
-
color: p.textDisabled,
|
|
451
|
-
opacity: 0.5
|
|
252
|
+
), s = Math.max(r + 1, t - o), g = Math.min(e - r, t + o), w = [...h];
|
|
253
|
+
if (s > r + 1 && w.push("ellipsis-start"), s <= g)
|
|
254
|
+
for (let d = s; d <= g; d++)
|
|
255
|
+
w.push(d);
|
|
256
|
+
g < e - r && w.push("ellipsis-end");
|
|
257
|
+
for (const d of C)
|
|
258
|
+
w.includes(d) || w.push(d);
|
|
259
|
+
return w;
|
|
260
|
+
})(), f = c === "sm" ? 16 : c === "lg" ? 24 : 20;
|
|
261
|
+
return /* @__PURE__ */ T("div", { css: He, children: [
|
|
262
|
+
l && /* @__PURE__ */ i(
|
|
263
|
+
S,
|
|
264
|
+
{
|
|
265
|
+
icon: !0,
|
|
266
|
+
variant: "plain",
|
|
267
|
+
onClick: () => y(1),
|
|
268
|
+
disabled: p || t === 1,
|
|
269
|
+
style: D,
|
|
270
|
+
children: /* @__PURE__ */ i(B, { children: /* @__PURE__ */ i(Le, { size: f }) })
|
|
452
271
|
}
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
borderRadius: "8px",
|
|
464
|
-
minWidth: "32px",
|
|
465
|
-
minHeight: "32px",
|
|
466
|
-
backgroundColor: "transparent",
|
|
467
|
-
color: l.textColor,
|
|
468
|
-
border: "none",
|
|
469
|
-
"&:hover": {
|
|
470
|
-
backgroundColor: l.palette.neutral.solidBg,
|
|
471
|
-
color: l.textColor
|
|
472
|
-
},
|
|
473
|
-
"&:active": {
|
|
474
|
-
backgroundColor: l.palette.neutral.plainActiveBg
|
|
475
|
-
},
|
|
476
|
-
"&.Mui-disabled": {
|
|
477
|
-
backgroundColor: "transparent",
|
|
478
|
-
color: l.textDisabled,
|
|
479
|
-
opacity: 0.5
|
|
272
|
+
),
|
|
273
|
+
/* @__PURE__ */ i(
|
|
274
|
+
S,
|
|
275
|
+
{
|
|
276
|
+
icon: !0,
|
|
277
|
+
variant: "plain",
|
|
278
|
+
onClick: () => y(t - 1),
|
|
279
|
+
disabled: p || t === 1,
|
|
280
|
+
style: D,
|
|
281
|
+
children: /* @__PURE__ */ i(B, { children: /* @__PURE__ */ i(Ee, { size: f }) })
|
|
480
282
|
}
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
sx: {
|
|
487
|
-
display: "flex",
|
|
488
|
-
gap: 0.5,
|
|
489
|
-
alignItems: "center",
|
|
490
|
-
flexWrap: "wrap"
|
|
491
|
-
},
|
|
492
|
-
children: [
|
|
493
|
-
s && /* @__PURE__ */ n(
|
|
494
|
-
H,
|
|
495
|
-
{
|
|
496
|
-
size: h,
|
|
497
|
-
variant: "plain",
|
|
498
|
-
color: "neutral",
|
|
499
|
-
onClick: () => f(1),
|
|
500
|
-
disabled: m || t === 1,
|
|
501
|
-
sx: A(),
|
|
502
|
-
children: /* @__PURE__ */ n(k, { children: /* @__PURE__ */ n(Fe, { size: d }) })
|
|
503
|
-
}
|
|
504
|
-
),
|
|
505
|
-
/* @__PURE__ */ n(
|
|
506
|
-
H,
|
|
507
|
-
{
|
|
508
|
-
size: h,
|
|
509
|
-
variant: "plain",
|
|
510
|
-
color: "neutral",
|
|
511
|
-
onClick: () => f(t - 1),
|
|
512
|
-
disabled: m || t === 1,
|
|
513
|
-
sx: A(),
|
|
514
|
-
children: /* @__PURE__ */ n(k, { children: /* @__PURE__ */ n($e, { size: d }) })
|
|
515
|
-
}
|
|
516
|
-
),
|
|
517
|
-
T.map((l, p) => {
|
|
518
|
-
if (typeof l == "string" && l.startsWith("ellipsis"))
|
|
519
|
-
return /* @__PURE__ */ n(
|
|
520
|
-
te,
|
|
521
|
-
{
|
|
522
|
-
size: h,
|
|
523
|
-
variant: "plain",
|
|
524
|
-
color: "neutral",
|
|
525
|
-
disabled: !0,
|
|
526
|
-
sx: {
|
|
527
|
-
...w(!1),
|
|
528
|
-
cursor: "default",
|
|
529
|
-
"&.Mui-disabled": u ? {
|
|
530
|
-
backgroundColor: "transparent",
|
|
531
|
-
color: C.colorSchemes.dark.textDisabled,
|
|
532
|
-
opacity: 0.5
|
|
533
|
-
} : {
|
|
534
|
-
opacity: 1,
|
|
535
|
-
color: "text.secondary"
|
|
536
|
-
}
|
|
537
|
-
},
|
|
538
|
-
children: "..."
|
|
539
|
-
},
|
|
540
|
-
`${l}-${p}`
|
|
541
|
-
);
|
|
542
|
-
const i = l === t;
|
|
543
|
-
return /* @__PURE__ */ n(
|
|
544
|
-
te,
|
|
545
|
-
{
|
|
546
|
-
size: h,
|
|
547
|
-
variant: i ? "solid" : "plain",
|
|
548
|
-
color: "neutral",
|
|
549
|
-
onClick: () => f(l),
|
|
550
|
-
disabled: m,
|
|
551
|
-
sx: w(i),
|
|
552
|
-
children: l
|
|
553
|
-
},
|
|
554
|
-
l
|
|
555
|
-
);
|
|
556
|
-
}),
|
|
557
|
-
/* @__PURE__ */ n(
|
|
558
|
-
H,
|
|
559
|
-
{
|
|
560
|
-
size: h,
|
|
561
|
-
variant: "plain",
|
|
562
|
-
color: "neutral",
|
|
563
|
-
onClick: () => f(t + 1),
|
|
564
|
-
disabled: m || t === e,
|
|
565
|
-
sx: A(),
|
|
566
|
-
children: /* @__PURE__ */ n(k, { children: /* @__PURE__ */ n(Qe, { size: d }) })
|
|
567
|
-
}
|
|
568
|
-
),
|
|
569
|
-
b && /* @__PURE__ */ n(
|
|
570
|
-
H,
|
|
283
|
+
),
|
|
284
|
+
A.map((h, C) => {
|
|
285
|
+
if (typeof h == "string" && h.startsWith("ellipsis"))
|
|
286
|
+
return /* @__PURE__ */ i(
|
|
287
|
+
S,
|
|
571
288
|
{
|
|
572
|
-
size: h,
|
|
573
289
|
variant: "plain",
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
290
|
+
disabled: !0,
|
|
291
|
+
style: $e,
|
|
292
|
+
children: "..."
|
|
293
|
+
},
|
|
294
|
+
`${h}-${C}`
|
|
295
|
+
);
|
|
296
|
+
const s = h === t;
|
|
297
|
+
return /* @__PURE__ */ i(
|
|
298
|
+
S,
|
|
299
|
+
{
|
|
300
|
+
variant: s ? "solid" : "plain",
|
|
301
|
+
onClick: () => y(h),
|
|
302
|
+
disabled: p,
|
|
303
|
+
style: s ? Fe : pe,
|
|
304
|
+
children: h
|
|
305
|
+
},
|
|
306
|
+
h
|
|
307
|
+
);
|
|
308
|
+
}),
|
|
309
|
+
/* @__PURE__ */ i(
|
|
310
|
+
S,
|
|
311
|
+
{
|
|
312
|
+
icon: !0,
|
|
313
|
+
variant: "plain",
|
|
314
|
+
onClick: () => y(t + 1),
|
|
315
|
+
disabled: p || t === e,
|
|
316
|
+
style: D,
|
|
317
|
+
children: /* @__PURE__ */ i(B, { children: /* @__PURE__ */ i(we, { size: f }) })
|
|
318
|
+
}
|
|
319
|
+
),
|
|
320
|
+
u && /* @__PURE__ */ i(
|
|
321
|
+
S,
|
|
322
|
+
{
|
|
323
|
+
icon: !0,
|
|
324
|
+
variant: "plain",
|
|
325
|
+
onClick: () => y(e),
|
|
326
|
+
disabled: p || t === e,
|
|
327
|
+
style: D,
|
|
328
|
+
children: /* @__PURE__ */ i(B, { children: /* @__PURE__ */ i(Ie, { size: f }) })
|
|
329
|
+
}
|
|
330
|
+
)
|
|
331
|
+
] });
|
|
332
|
+
}, H = "ALL", k = (e) => ({
|
|
585
333
|
currentPage: e.currentPage,
|
|
586
334
|
totalPages: e.numberOfPages,
|
|
587
335
|
totalItems: e.totalItems,
|
|
588
336
|
itemsPerPage: e.itemsPerPage
|
|
589
|
-
}),
|
|
337
|
+
}), q = (e) => e.map((t) => ({
|
|
590
338
|
position: t.position,
|
|
591
339
|
profileId: t.profileId,
|
|
592
340
|
profileModel: t.profileModel,
|
|
593
341
|
points: t.points
|
|
594
|
-
})),
|
|
342
|
+
})), We = async (e) => {
|
|
595
343
|
try {
|
|
596
344
|
return await e.profile.getOwn().getInfo();
|
|
597
345
|
} catch {
|
|
598
346
|
return null;
|
|
599
347
|
}
|
|
600
|
-
}, ne = async (e, t,
|
|
601
|
-
var
|
|
348
|
+
}, ne = async (e, t, n) => e.length === 0 ? [] : (await t.topX.getGames({ gameIds: e }, n)).data.map((r) => {
|
|
349
|
+
var l;
|
|
602
350
|
return {
|
|
603
351
|
id: r.id,
|
|
604
352
|
title: r.title,
|
|
605
353
|
description: r.description || null,
|
|
606
|
-
branding: ((
|
|
354
|
+
branding: ((l = r.branding) == null ? void 0 : l.colors) || null
|
|
607
355
|
};
|
|
608
|
-
}),
|
|
609
|
-
var
|
|
356
|
+
}), ie = async (e, t, n) => e.length === 0 ? [] : (await t.matchQuiz.getGames({ gameIds: e }, n)).data.map((r) => {
|
|
357
|
+
var l;
|
|
610
358
|
return {
|
|
611
359
|
id: r.id,
|
|
612
360
|
title: r.title,
|
|
613
361
|
description: r.description || null,
|
|
614
|
-
branding: ((
|
|
362
|
+
branding: ((l = r.branding) == null ? void 0 : l.colors) || null
|
|
615
363
|
};
|
|
616
|
-
}),
|
|
617
|
-
var
|
|
364
|
+
}), oe = async (e, t, n) => e.length === 0 ? [] : (await t.loyalty.getTemplates(void 0, n)).data.filter((r) => e.includes(r.id)).map((r) => {
|
|
365
|
+
var l;
|
|
618
366
|
return {
|
|
619
367
|
id: r.id,
|
|
620
368
|
title: r.title || r.name,
|
|
621
369
|
description: r.description || null,
|
|
622
|
-
branding: ((
|
|
370
|
+
branding: ((l = r.branding) == null ? void 0 : l.colors) || null
|
|
623
371
|
};
|
|
624
|
-
}),
|
|
372
|
+
}), ae = async (e, t, n) => e.length === 0 ? [] : (await t.miniGames.getClassicQuizzes(
|
|
625
373
|
{ classicQuizIds: e, limit: e.length },
|
|
626
374
|
void 0,
|
|
627
|
-
|
|
375
|
+
n
|
|
628
376
|
)).data.map((r) => {
|
|
629
|
-
var
|
|
377
|
+
var l;
|
|
630
378
|
return {
|
|
631
379
|
id: r.id,
|
|
632
380
|
title: r.title || r.name,
|
|
633
381
|
description: r.description || null,
|
|
634
|
-
branding: ((
|
|
382
|
+
branding: ((l = r.branding) == null ? void 0 : l.colors) || null
|
|
635
383
|
};
|
|
636
|
-
}),
|
|
637
|
-
const
|
|
384
|
+
}), Ge = async (e, t, n, o, r) => {
|
|
385
|
+
const l = await t.loyalty.getLeaderboardForGame(e, { page: n, limit: o }, r);
|
|
638
386
|
return {
|
|
639
|
-
leaderboard:
|
|
640
|
-
pagination:
|
|
387
|
+
leaderboard: q(l.data),
|
|
388
|
+
pagination: k(l.meta.pagination)
|
|
641
389
|
};
|
|
642
|
-
},
|
|
643
|
-
const
|
|
390
|
+
}, je = async (e, t, n, o, r) => {
|
|
391
|
+
const l = await t.loyalty.getLeaderboard(
|
|
644
392
|
e,
|
|
645
|
-
{ page:
|
|
393
|
+
{ page: n, limit: o },
|
|
646
394
|
r
|
|
647
395
|
);
|
|
648
396
|
return {
|
|
649
|
-
leaderboard:
|
|
650
|
-
pagination:
|
|
397
|
+
leaderboard: q(l.data),
|
|
398
|
+
pagination: k(l.meta.pagination)
|
|
651
399
|
};
|
|
652
|
-
},
|
|
653
|
-
const
|
|
654
|
-
{ classicQuizIds: e, page:
|
|
400
|
+
}, V = async (e, t, n, o, r) => {
|
|
401
|
+
const l = await t.miniGames.getLeaderboardForClassicQuizzes(
|
|
402
|
+
{ classicQuizIds: e, page: n, limit: o },
|
|
655
403
|
r
|
|
656
404
|
);
|
|
657
405
|
return {
|
|
658
|
-
leaderboard:
|
|
659
|
-
pagination:
|
|
406
|
+
leaderboard: q(l.data),
|
|
407
|
+
pagination: k(l.meta.pagination)
|
|
660
408
|
};
|
|
661
|
-
},
|
|
662
|
-
const
|
|
663
|
-
return
|
|
409
|
+
}, le = (e, t, n, o, r) => {
|
|
410
|
+
const l = e.type.toUpperCase();
|
|
411
|
+
return l === "TOP_X" || l === "MATCH_QUIZ" ? Ge(e.id, t, n, o, r) : l === "TEMPLATE" ? je(e.id, t, n, o, r) : V(
|
|
664
412
|
[e.id],
|
|
665
413
|
t,
|
|
414
|
+
n,
|
|
666
415
|
o,
|
|
667
|
-
c,
|
|
668
416
|
r
|
|
669
417
|
);
|
|
670
|
-
},
|
|
671
|
-
const
|
|
672
|
-
return
|
|
673
|
-
position:
|
|
674
|
-
profileId:
|
|
418
|
+
}, Xe = async (e, t, n, o, r) => {
|
|
419
|
+
const u = n.toUpperCase() === "TEMPLATE" ? { rankType: "TEMPLATE", leaderboardIds: [e] } : { rankType: "GAME", gameType: n.toUpperCase(), leaderboardIds: [e] }, y = (await t.loyalty.getOwnRankings(u, r)).data[0] ?? null;
|
|
420
|
+
return y ? {
|
|
421
|
+
position: y.position,
|
|
422
|
+
profileId: o,
|
|
675
423
|
profileModel: null,
|
|
676
|
-
points:
|
|
424
|
+
points: y.points
|
|
677
425
|
} : null;
|
|
678
|
-
},
|
|
679
|
-
const
|
|
680
|
-
|
|
426
|
+
}, Ze = async (e, t, n, o) => {
|
|
427
|
+
const u = (await t.miniGames.getClassicQuizzesUserRanking(
|
|
428
|
+
n,
|
|
681
429
|
void 0,
|
|
682
|
-
|
|
683
|
-
)).data.find((
|
|
684
|
-
return
|
|
685
|
-
position:
|
|
686
|
-
profileId:
|
|
430
|
+
o
|
|
431
|
+
)).data.find((c) => c.classicQuizId === e) ?? null;
|
|
432
|
+
return u ? {
|
|
433
|
+
position: u.position,
|
|
434
|
+
profileId: n,
|
|
687
435
|
profileModel: null,
|
|
688
|
-
points:
|
|
436
|
+
points: u.points
|
|
689
437
|
} : null;
|
|
690
|
-
},
|
|
438
|
+
}, Ne = (e, t, n, o) => {
|
|
691
439
|
const r = e.type.toUpperCase();
|
|
692
|
-
return r === "TOP_X" || r === "MATCH_QUIZ" || r === "TEMPLATE" ?
|
|
440
|
+
return r === "TOP_X" || r === "MATCH_QUIZ" || r === "TEMPLATE" ? Xe(
|
|
693
441
|
e.id,
|
|
694
442
|
t,
|
|
695
443
|
e.type,
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
) :
|
|
699
|
-
},
|
|
700
|
-
const [r,
|
|
444
|
+
n,
|
|
445
|
+
o
|
|
446
|
+
) : Ze(e.id, t, n, o);
|
|
447
|
+
}, Ve = (e, t, n, o = 10) => {
|
|
448
|
+
const [r, l] = z({}), [u, c] = z(null), [p, y] = z(!1), [E, P] = z(!1), [A, f] = z(
|
|
701
449
|
null
|
|
702
|
-
), [
|
|
703
|
-
|
|
704
|
-
const
|
|
705
|
-
topX: e.filter((
|
|
706
|
-
matchQuiz: e.filter((
|
|
707
|
-
template: e.filter((
|
|
708
|
-
classicQuiz: e.filter((
|
|
709
|
-
},
|
|
450
|
+
), [h, C] = z(null), s = Pe();
|
|
451
|
+
F(() => {
|
|
452
|
+
const d = {
|
|
453
|
+
topX: e.filter((a) => a.type.toUpperCase() === "TOP_X").map((a) => a.id),
|
|
454
|
+
matchQuiz: e.filter((a) => a.type.toUpperCase() === "MATCH_QUIZ").map((a) => a.id),
|
|
455
|
+
template: e.filter((a) => a.type.toUpperCase() === "TEMPLATE").map((a) => a.id),
|
|
456
|
+
classicQuiz: e.filter((a) => a.type.toUpperCase() === "CLASSIC_QUIZ").map((a) => a.id)
|
|
457
|
+
}, b = (a) => a.catch(() => []);
|
|
710
458
|
Promise.all([
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
]).then((
|
|
716
|
-
const
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
}),
|
|
459
|
+
b(ne(d.topX, t, s)),
|
|
460
|
+
b(ie(d.matchQuiz, t, s)),
|
|
461
|
+
b(oe(d.template, t, s)),
|
|
462
|
+
b(ae(d.classicQuiz, t, s))
|
|
463
|
+
]).then((a) => {
|
|
464
|
+
const m = {};
|
|
465
|
+
a.flat().forEach((I) => {
|
|
466
|
+
m[I.id] = I;
|
|
467
|
+
}), l(m);
|
|
720
468
|
});
|
|
721
|
-
}, [e, t,
|
|
722
|
-
|
|
723
|
-
}, [t]),
|
|
724
|
-
if (!
|
|
725
|
-
|
|
469
|
+
}, [e, t, s]), F(() => {
|
|
470
|
+
We(t).then(f);
|
|
471
|
+
}, [t]), F(() => {
|
|
472
|
+
if (!n || !A) {
|
|
473
|
+
C(null);
|
|
726
474
|
return;
|
|
727
475
|
}
|
|
728
|
-
let
|
|
729
|
-
if (
|
|
730
|
-
const
|
|
731
|
-
|
|
732
|
-
const
|
|
733
|
-
return
|
|
734
|
-
position:
|
|
735
|
-
profileId:
|
|
476
|
+
let d = !1, b;
|
|
477
|
+
if (n === H) {
|
|
478
|
+
const a = e.map((m) => m.id);
|
|
479
|
+
b = t.miniGames.getClassicQuizzesUserRanking(A.id, void 0, s).then((m) => {
|
|
480
|
+
const O = m.data.find((M) => a.includes(M.classicQuizId)) ?? null;
|
|
481
|
+
return O ? {
|
|
482
|
+
position: O.position,
|
|
483
|
+
profileId: A.id,
|
|
736
484
|
profileModel: null,
|
|
737
|
-
points:
|
|
485
|
+
points: O.points
|
|
738
486
|
} : null;
|
|
739
487
|
});
|
|
740
488
|
} else {
|
|
741
|
-
const
|
|
742
|
-
if (!
|
|
743
|
-
|
|
744
|
-
|
|
489
|
+
const a = e.find((m) => m.id === n);
|
|
490
|
+
if (!a) return;
|
|
491
|
+
b = Ne(
|
|
492
|
+
a,
|
|
745
493
|
t,
|
|
746
|
-
|
|
747
|
-
|
|
494
|
+
A.id,
|
|
495
|
+
s
|
|
748
496
|
);
|
|
749
497
|
}
|
|
750
|
-
return
|
|
751
|
-
|
|
498
|
+
return b.then((a) => {
|
|
499
|
+
d || C(a);
|
|
752
500
|
}).catch(() => {
|
|
753
|
-
|
|
501
|
+
d || C(null);
|
|
754
502
|
}), () => {
|
|
755
|
-
|
|
503
|
+
d = !0;
|
|
756
504
|
};
|
|
757
|
-
}, [
|
|
758
|
-
if (!
|
|
759
|
-
let
|
|
760
|
-
return
|
|
505
|
+
}, [n, e, t, A, s]), F(() => {
|
|
506
|
+
if (!n) return;
|
|
507
|
+
let d = !1;
|
|
508
|
+
return y(!0), P(!1), c(null), (async () => {
|
|
761
509
|
try {
|
|
762
|
-
const
|
|
763
|
-
if (
|
|
764
|
-
const
|
|
765
|
-
|
|
510
|
+
const a = e.length > 1 && e.every((L) => L.type.toUpperCase() === "CLASSIC_QUIZ");
|
|
511
|
+
if (n === H && a) {
|
|
512
|
+
const L = e.map((he) => he.id), fe = await V(
|
|
513
|
+
L,
|
|
766
514
|
t,
|
|
767
515
|
1,
|
|
768
|
-
|
|
769
|
-
|
|
516
|
+
o,
|
|
517
|
+
s
|
|
770
518
|
);
|
|
771
|
-
|
|
772
|
-
id:
|
|
773
|
-
title:
|
|
519
|
+
d || c({
|
|
520
|
+
id: H,
|
|
521
|
+
title: H,
|
|
774
522
|
description: null,
|
|
775
523
|
branding: null,
|
|
776
|
-
...
|
|
524
|
+
...fe
|
|
777
525
|
});
|
|
778
526
|
return;
|
|
779
527
|
}
|
|
780
|
-
const
|
|
781
|
-
if (!
|
|
782
|
-
const
|
|
783
|
-
|
|
784
|
-
|
|
528
|
+
const m = e.find((L) => L.id === n);
|
|
529
|
+
if (!m) return;
|
|
530
|
+
const I = m.type.toUpperCase(), O = I === "TOP_X" ? ne([n], t, s) : I === "MATCH_QUIZ" ? ie([n], t, s) : I === "TEMPLATE" ? oe([n], t, s) : ae([n], t, s), [M, _] = await Promise.all([
|
|
531
|
+
le(m, t, 1, o, s),
|
|
532
|
+
O.catch(() => [])
|
|
785
533
|
]);
|
|
786
|
-
if (!
|
|
787
|
-
const
|
|
788
|
-
|
|
789
|
-
id:
|
|
790
|
-
title: (
|
|
791
|
-
description: (
|
|
792
|
-
branding: (
|
|
793
|
-
...
|
|
534
|
+
if (!d) {
|
|
535
|
+
const L = _[0];
|
|
536
|
+
c({
|
|
537
|
+
id: n,
|
|
538
|
+
title: (L == null ? void 0 : L.title) || n,
|
|
539
|
+
description: (L == null ? void 0 : L.description) || null,
|
|
540
|
+
branding: (L == null ? void 0 : L.branding) || null,
|
|
541
|
+
...M
|
|
794
542
|
});
|
|
795
543
|
}
|
|
796
|
-
} catch (
|
|
797
|
-
console.error("Failed to fetch leaderboard:",
|
|
544
|
+
} catch (a) {
|
|
545
|
+
console.error("Failed to fetch leaderboard:", a), d || P(!0);
|
|
798
546
|
} finally {
|
|
799
|
-
|
|
547
|
+
d || y(!1);
|
|
800
548
|
}
|
|
801
549
|
})(), () => {
|
|
802
|
-
|
|
550
|
+
d = !0;
|
|
803
551
|
};
|
|
804
|
-
}, [
|
|
805
|
-
const
|
|
806
|
-
async (
|
|
807
|
-
if (
|
|
808
|
-
|
|
552
|
+
}, [n, e, t, o, s]);
|
|
553
|
+
const g = me(
|
|
554
|
+
async (d) => {
|
|
555
|
+
if (n) {
|
|
556
|
+
y(!0);
|
|
809
557
|
try {
|
|
810
|
-
let
|
|
811
|
-
if (
|
|
812
|
-
const
|
|
813
|
-
|
|
814
|
-
|
|
558
|
+
let b;
|
|
559
|
+
if (n === H) {
|
|
560
|
+
const a = e.map((m) => m.id);
|
|
561
|
+
b = await V(
|
|
562
|
+
a,
|
|
815
563
|
t,
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
564
|
+
d,
|
|
565
|
+
o,
|
|
566
|
+
s
|
|
819
567
|
);
|
|
820
568
|
} else {
|
|
821
|
-
const
|
|
822
|
-
if (!
|
|
823
|
-
|
|
824
|
-
|
|
569
|
+
const a = e.find((m) => m.id === n);
|
|
570
|
+
if (!a) return;
|
|
571
|
+
b = await le(
|
|
572
|
+
a,
|
|
825
573
|
t,
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
574
|
+
d,
|
|
575
|
+
o,
|
|
576
|
+
s
|
|
829
577
|
);
|
|
830
578
|
}
|
|
831
|
-
|
|
832
|
-
} catch (
|
|
833
|
-
console.error("Failed to fetch page:",
|
|
579
|
+
c((a) => a ? { ...a, ...b } : null);
|
|
580
|
+
} catch (b) {
|
|
581
|
+
console.error("Failed to fetch page:", b);
|
|
834
582
|
} finally {
|
|
835
|
-
|
|
583
|
+
y(!1);
|
|
836
584
|
}
|
|
837
585
|
}
|
|
838
586
|
},
|
|
839
|
-
[
|
|
840
|
-
),
|
|
841
|
-
Object.entries(r).map(([
|
|
587
|
+
[n, e, t, o, s]
|
|
588
|
+
), w = Object.fromEntries(
|
|
589
|
+
Object.entries(r).map(([d, b]) => [d, b.title])
|
|
842
590
|
);
|
|
843
|
-
return { data:
|
|
844
|
-
},
|
|
591
|
+
return { data: u, entityTitles: w, loading: p, error: E, setPage: g, userRank: h };
|
|
592
|
+
}, W = "ALL", Ye = v({
|
|
593
|
+
display: "flex",
|
|
594
|
+
flexDirection: "column",
|
|
595
|
+
gap: "var(--fu-ucrc-space-md)",
|
|
596
|
+
backgroundColor: "var(--fu-ucrc-surface)",
|
|
597
|
+
padding: "var(--fu-ucrc-space-md)"
|
|
598
|
+
}), se = ["TOP_X", "MATCH_QUIZ", "TEMPLATE", "CLASSIC_QUIZ"], ke = (e, t) => {
|
|
845
599
|
if (!Array.isArray(e) || e.length === 0)
|
|
846
600
|
return "The 'entities' setting is required and must be a non-empty array.";
|
|
847
|
-
const
|
|
848
|
-
for (let
|
|
849
|
-
const r = e[
|
|
601
|
+
const n = /* @__PURE__ */ new Set();
|
|
602
|
+
for (let o = 0; o < e.length; o++) {
|
|
603
|
+
const r = e[o];
|
|
850
604
|
if (!r || typeof r != "object")
|
|
851
|
-
return `Entity at index ${
|
|
605
|
+
return `Entity at index ${o} must be an object with 'id' and 'type' fields.`;
|
|
852
606
|
if (!r.id || typeof r.id != "string")
|
|
853
|
-
return `Entity at index ${
|
|
854
|
-
if (
|
|
855
|
-
return `Duplicate entity id '${r.id}' found at index ${
|
|
856
|
-
if (
|
|
857
|
-
return `Entity at index ${
|
|
858
|
-
if (!
|
|
859
|
-
return `Entity at index ${
|
|
607
|
+
return `Entity at index ${o} is missing a required 'id' string field.`;
|
|
608
|
+
if (n.has(r.id))
|
|
609
|
+
return `Duplicate entity id '${r.id}' found at index ${o}. Each entity must have a unique id.`;
|
|
610
|
+
if (n.add(r.id), !r.type || typeof r.type != "string")
|
|
611
|
+
return `Entity at index ${o} is missing a required 'type' string field.`;
|
|
612
|
+
if (!se.includes(r.type.toUpperCase()))
|
|
613
|
+
return `Entity at index ${o} has an invalid type '${r.type}'. Valid values are: ${se.join(", ")} (case-insensitive).`;
|
|
860
614
|
}
|
|
861
615
|
return t !== void 0 && (typeof t != "number" || !Number.isInteger(t) || t < 1 || t > 50) ? "The 'pageSize' setting must be an integer between 1 and 50." : null;
|
|
862
|
-
},
|
|
616
|
+
}, qe = ({
|
|
863
617
|
entities: e,
|
|
864
618
|
sdk: t,
|
|
865
|
-
pageSize:
|
|
866
|
-
rankStyles:
|
|
619
|
+
pageSize: n,
|
|
620
|
+
rankStyles: o,
|
|
867
621
|
showOverallOnly: r = !1,
|
|
868
|
-
showHeading:
|
|
622
|
+
showHeading: l = !0
|
|
869
623
|
}) => {
|
|
870
|
-
var
|
|
871
|
-
const { t:
|
|
872
|
-
() =>
|
|
873
|
-
[e,
|
|
874
|
-
),
|
|
875
|
-
() => !
|
|
876
|
-
[e,
|
|
877
|
-
),
|
|
878
|
-
|
|
879
|
-
|
|
624
|
+
var O;
|
|
625
|
+
const { t: u } = Y(), c = Q(
|
|
626
|
+
() => ke(e, n),
|
|
627
|
+
[e, n]
|
|
628
|
+
), p = Q(
|
|
629
|
+
() => !c && e.length > 1 && e.every((M) => M.type.toUpperCase() === "CLASSIC_QUIZ"),
|
|
630
|
+
[e, c]
|
|
631
|
+
), y = r && p, E = p ? W : ((O = e[0]) == null ? void 0 : O.id) || "", [P, A] = z(E);
|
|
632
|
+
F(() => {
|
|
633
|
+
P === W || e.some((_) => _.id === P) || A(E);
|
|
880
634
|
}, [e]);
|
|
881
|
-
const { data:
|
|
882
|
-
|
|
635
|
+
const { data: f, entityTitles: h, loading: C, error: s, setPage: g, userRank: w } = Ve(
|
|
636
|
+
c ? [] : e,
|
|
883
637
|
t,
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
),
|
|
887
|
-
if (
|
|
888
|
-
const
|
|
889
|
-
return
|
|
890
|
-
|
|
891
|
-
id:
|
|
892
|
-
label:
|
|
893
|
-
type:
|
|
638
|
+
c ? "" : P,
|
|
639
|
+
n
|
|
640
|
+
), d = Q(() => {
|
|
641
|
+
if (c) return [];
|
|
642
|
+
const M = [];
|
|
643
|
+
return p && M.push({ id: W, label: u("leaderboard.overall") }), e.forEach((_) => {
|
|
644
|
+
M.push({
|
|
645
|
+
id: _.id,
|
|
646
|
+
label: h[_.id] ?? "",
|
|
647
|
+
type: _.type.toUpperCase()
|
|
894
648
|
});
|
|
895
|
-
}),
|
|
896
|
-
}, [e,
|
|
897
|
-
return
|
|
898
|
-
|
|
649
|
+
}), M;
|
|
650
|
+
}, [e, p, u, h, c]), b = e.every((M) => h[M.id] !== void 0), a = !c && !y && (e.length > 1 || p) && b, m = (f == null ? void 0 : f.pagination) || null, I = P === W ? u("leaderboard.overall") : (f == null ? void 0 : f.title) || null;
|
|
651
|
+
return c ? /* @__PURE__ */ i(
|
|
652
|
+
K,
|
|
899
653
|
{
|
|
900
654
|
variant: "error",
|
|
901
655
|
title: "Configuration Error",
|
|
902
|
-
message:
|
|
656
|
+
message: c
|
|
903
657
|
}
|
|
904
|
-
) :
|
|
905
|
-
|
|
658
|
+
) : s ? /* @__PURE__ */ i(
|
|
659
|
+
K,
|
|
906
660
|
{
|
|
907
661
|
variant: "error",
|
|
908
662
|
title: "Failed to Load Leaderboard",
|
|
909
663
|
message: "One or more entity IDs could not be found. Please verify the provided IDs and try again."
|
|
910
664
|
}
|
|
911
|
-
) : /* @__PURE__ */
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
sx: {
|
|
915
|
-
display: "flex",
|
|
916
|
-
flexDirection: "column",
|
|
917
|
-
gap: g.md,
|
|
918
|
-
backgroundColor: m,
|
|
919
|
-
padding: g.md
|
|
920
|
-
},
|
|
921
|
-
children: [
|
|
922
|
-
v && /* @__PURE__ */ n(
|
|
923
|
-
We,
|
|
924
|
-
{
|
|
925
|
-
options: i,
|
|
926
|
-
selectedId: R,
|
|
927
|
-
onChange: T
|
|
928
|
-
}
|
|
929
|
-
),
|
|
930
|
-
/* @__PURE__ */ n(
|
|
931
|
-
_e,
|
|
932
|
-
{
|
|
933
|
-
leaderboard: w ? null : (h == null ? void 0 : h.leaderboard) || null,
|
|
934
|
-
userRank: w ? null : p,
|
|
935
|
-
showHeading: s && !v,
|
|
936
|
-
title: B,
|
|
937
|
-
description: (h == null ? void 0 : h.description) || null,
|
|
938
|
-
brandingColors: (h == null ? void 0 : h.branding) || null,
|
|
939
|
-
rankStyles: c
|
|
940
|
-
}
|
|
941
|
-
),
|
|
942
|
-
!w && P && P.totalPages > 1 && /* @__PURE__ */ n(
|
|
943
|
-
Xe,
|
|
944
|
-
{
|
|
945
|
-
count: P.totalPages,
|
|
946
|
-
page: P.currentPage,
|
|
947
|
-
onChange: l
|
|
948
|
-
}
|
|
949
|
-
)
|
|
950
|
-
]
|
|
951
|
-
}
|
|
952
|
-
);
|
|
953
|
-
}, et = (e) => {
|
|
954
|
-
var T;
|
|
955
|
-
const [t, o] = z.useState(!1), [c, r] = z.useState(!1), s = Re(e.language), b = z.useRef(
|
|
956
|
-
`leaderboard-shadow-root-${Math.random().toString(36).substring(2, 11)}`
|
|
957
|
-
), g = z.useRef(null), m = z.useRef(null), u = z.useRef(null), [C, f] = z.useState(null);
|
|
958
|
-
z.useEffect(() => {
|
|
959
|
-
Ee(e.language || "en").finally(() => r(!0));
|
|
960
|
-
}, [e.language]), z.useEffect(() => {
|
|
961
|
-
if (!g.current) return;
|
|
962
|
-
g.current.shadowRoot ? (m.current = g.current.shadowRoot, u.current = m.current.getElementById(
|
|
963
|
-
b.current
|
|
964
|
-
), u.current || (u.current = document.createElement("div"), u.current.id = b.current, m.current.appendChild(u.current))) : (m.current = g.current.attachShadow({ mode: "open" }), u.current = document.createElement("div"), u.current.id = b.current, m.current.appendChild(u.current)), Ae(u.current, s);
|
|
965
|
-
const h = Le("leaderboard", s);
|
|
966
|
-
return f(
|
|
967
|
-
(d) => (d == null ? void 0 : d.key) === h ? d : Ie(
|
|
968
|
-
"leaderboard",
|
|
969
|
-
m.current,
|
|
970
|
-
s
|
|
971
|
-
)
|
|
972
|
-
), o(!0), () => {
|
|
973
|
-
o(!1);
|
|
974
|
-
};
|
|
975
|
-
}, [s]);
|
|
976
|
-
const x = /* @__PURE__ */ n(I, { ref: g, lang: e.language || "en" }), R = t && c && u.current && C ? ke(
|
|
977
|
-
// Keyed on the cache, not on `direction`: it must change in the same
|
|
978
|
-
// render that adopts the new cache, or CssVarsProvider writes its CSS
|
|
979
|
-
// variables into the outgoing cache and never repeats.
|
|
980
|
-
/* @__PURE__ */ n(He, { value: C, children: /* @__PURE__ */ n(Me, { containerRef: g, children: /* @__PURE__ */ n(
|
|
981
|
-
ze,
|
|
665
|
+
) : /* @__PURE__ */ T("div", { css: Ye, children: [
|
|
666
|
+
a && /* @__PURE__ */ i(
|
|
667
|
+
_e,
|
|
982
668
|
{
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
direction: s,
|
|
987
|
-
children: /* @__PURE__ */ n(
|
|
988
|
-
Be,
|
|
989
|
-
{
|
|
990
|
-
shadowRootElement: u.current,
|
|
991
|
-
leadPhoneCountryCode: null,
|
|
992
|
-
language: e.language,
|
|
993
|
-
optionsLayout: null,
|
|
994
|
-
direction: s,
|
|
995
|
-
disableCache: e.disableCache ?? !1,
|
|
996
|
-
children: e.children
|
|
997
|
-
}
|
|
998
|
-
)
|
|
669
|
+
options: d,
|
|
670
|
+
selectedId: P,
|
|
671
|
+
onChange: A
|
|
999
672
|
}
|
|
1000
|
-
)
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
673
|
+
),
|
|
674
|
+
/* @__PURE__ */ i(
|
|
675
|
+
Re,
|
|
676
|
+
{
|
|
677
|
+
leaderboard: C ? null : (f == null ? void 0 : f.leaderboard) || null,
|
|
678
|
+
userRank: C ? null : w,
|
|
679
|
+
showHeading: l && !a,
|
|
680
|
+
title: I,
|
|
681
|
+
description: (f == null ? void 0 : f.description) || null,
|
|
682
|
+
brandingColors: (f == null ? void 0 : f.branding) || null,
|
|
683
|
+
rankStyles: o
|
|
684
|
+
}
|
|
685
|
+
),
|
|
686
|
+
!C && m && m.totalPages > 1 && /* @__PURE__ */ i(
|
|
687
|
+
Be,
|
|
688
|
+
{
|
|
689
|
+
count: m.totalPages,
|
|
690
|
+
page: m.currentPage,
|
|
691
|
+
onChange: g
|
|
692
|
+
}
|
|
693
|
+
)
|
|
1006
694
|
] });
|
|
1007
|
-
},
|
|
695
|
+
}, Je = (e) => /* @__PURE__ */ i(
|
|
696
|
+
ve,
|
|
697
|
+
{
|
|
698
|
+
packageName: "leaderboard",
|
|
699
|
+
language: e.language,
|
|
700
|
+
themeOptions: e.themeOptions,
|
|
701
|
+
disableCache: e.disableCache,
|
|
702
|
+
children: /* @__PURE__ */ i(qe, { ...e })
|
|
703
|
+
}
|
|
704
|
+
), st = Me(Je);
|
|
1008
705
|
export {
|
|
1009
|
-
|
|
706
|
+
st as Leaderboard
|
|
1010
707
|
};
|