@pitvox/partner-react 0.7.17 → 0.7.19
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/dist/index.cjs +1 -1
- package/dist/index.js +1201 -1003
- package/dist/styles.css +101 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsx as n, jsxs as l, Fragment as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { useQueryClient as
|
|
4
|
-
const
|
|
5
|
-
let
|
|
6
|
-
function
|
|
1
|
+
import { jsx as n, jsxs as l, Fragment as _ } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as Ee, useMemo as $, useContext as qe, useState as B, useCallback as K, useRef as _e, useEffect as je } from "react";
|
|
3
|
+
import { useQueryClient as H, QueryClient as Ve, QueryClientProvider as Ke, useQuery as T, useMutation as Q, useQueries as me } from "@tanstack/react-query";
|
|
4
|
+
const te = Ee(null), He = "https://cdn.pitvox.com", We = "https://pitvox.com";
|
|
5
|
+
let X = null;
|
|
6
|
+
function ut({
|
|
7
7
|
partnerSlug: e = null,
|
|
8
|
-
cdnUrl:
|
|
9
|
-
pitvoxUrl:
|
|
8
|
+
cdnUrl: r = He,
|
|
9
|
+
pitvoxUrl: t = We,
|
|
10
10
|
getSteamId: s,
|
|
11
11
|
onRegister: a,
|
|
12
12
|
onWithdraw: i,
|
|
@@ -14,12 +14,12 @@ function it({
|
|
|
14
14
|
onMarkNotificationRead: d,
|
|
15
15
|
onMarkAllNotificationsRead: p,
|
|
16
16
|
onFetchServerPassword: c,
|
|
17
|
-
children:
|
|
17
|
+
children: h
|
|
18
18
|
}) {
|
|
19
|
-
const g =
|
|
19
|
+
const g = $(() => ({
|
|
20
20
|
partnerSlug: e,
|
|
21
|
-
cdnUrl:
|
|
22
|
-
pitvoxUrl:
|
|
21
|
+
cdnUrl: r.replace(/\/$/, ""),
|
|
22
|
+
pitvoxUrl: t.replace(/\/$/, ""),
|
|
23
23
|
getSteamId: s || (() => null),
|
|
24
24
|
onRegister: a || null,
|
|
25
25
|
onWithdraw: i || null,
|
|
@@ -27,68 +27,68 @@ function it({
|
|
|
27
27
|
onMarkNotificationRead: d || null,
|
|
28
28
|
onMarkAllNotificationsRead: p || null,
|
|
29
29
|
onFetchServerPassword: c || null
|
|
30
|
-
}), [e,
|
|
30
|
+
}), [e, r, t, s, a, i, o, d, p, c]);
|
|
31
31
|
let f = !1;
|
|
32
32
|
try {
|
|
33
|
-
|
|
33
|
+
H(), f = !0;
|
|
34
34
|
} catch {
|
|
35
35
|
f = !1;
|
|
36
36
|
}
|
|
37
|
-
return f ? /* @__PURE__ */ n(
|
|
37
|
+
return f ? /* @__PURE__ */ n(te.Provider, { value: g, children: h }) : (X || (X = new Ve({
|
|
38
38
|
defaultOptions: {
|
|
39
39
|
queries: { staleTime: 6e4 }
|
|
40
40
|
}
|
|
41
|
-
})), /* @__PURE__ */ n(
|
|
41
|
+
})), /* @__PURE__ */ n(Ke, { client: X, children: /* @__PURE__ */ n(te.Provider, { value: g, children: h }) }));
|
|
42
42
|
}
|
|
43
|
-
function
|
|
44
|
-
const e =
|
|
43
|
+
function L() {
|
|
44
|
+
const e = qe(te);
|
|
45
45
|
if (!e)
|
|
46
46
|
throw new Error("usePitVox must be used within a <PitVoxPartnerProvider>");
|
|
47
47
|
return e;
|
|
48
48
|
}
|
|
49
|
-
async function
|
|
50
|
-
const
|
|
51
|
-
if (!
|
|
52
|
-
if (
|
|
53
|
-
throw new Error(`CDN fetch failed: ${
|
|
49
|
+
async function M(e, r) {
|
|
50
|
+
const t = await fetch(`${e}/${r}`);
|
|
51
|
+
if (!t.ok) {
|
|
52
|
+
if (t.status === 404 || t.status === 403) return null;
|
|
53
|
+
throw new Error(`CDN fetch failed: ${t.status}`);
|
|
54
54
|
}
|
|
55
|
-
return
|
|
55
|
+
return t.json();
|
|
56
56
|
}
|
|
57
|
-
function
|
|
57
|
+
function re(e, r, t, ...s) {
|
|
58
58
|
const a = ["leaderboards"];
|
|
59
|
-
return e && a.push(`partners/${e}`),
|
|
59
|
+
return e && a.push(`partners/${e}`), r && a.push(r), t && a.push(`v/${t}`), [...a, ...s].join("/");
|
|
60
60
|
}
|
|
61
|
-
function
|
|
61
|
+
function Oe(e, r, t, s) {
|
|
62
62
|
const a = s || "default";
|
|
63
|
-
return e ? `laps/partners/${e}/${
|
|
63
|
+
return e ? `laps/partners/${e}/${r}/${t}/${a}.json` : `laps/${r}/${t}/${a}.json`;
|
|
64
64
|
}
|
|
65
|
-
function
|
|
66
|
-
return e ? `laps/partners/${e}/${
|
|
65
|
+
function Ne(e, r) {
|
|
66
|
+
return e ? `laps/partners/${e}/${r}/index.json` : `laps/${r}/index.json`;
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function ze(e) {
|
|
69
69
|
return e ? `recent-laps/partners/${e}.json` : "recent-laps.json";
|
|
70
70
|
}
|
|
71
|
-
function
|
|
71
|
+
function q(e) {
|
|
72
72
|
if (!e && e !== 0) return "-";
|
|
73
|
-
const
|
|
74
|
-
return `${
|
|
73
|
+
const r = Math.floor(e / 1e3), t = Math.floor(r / 60), s = r % 60, a = e % 1e3;
|
|
74
|
+
return `${t}:${String(s).padStart(2, "0")}.${String(a).padStart(3, "0")}`;
|
|
75
75
|
}
|
|
76
|
-
function
|
|
77
|
-
return !e && e !== 0 ? "-" : e >= 6e4 ?
|
|
76
|
+
function E(e) {
|
|
77
|
+
return !e && e !== 0 ? "-" : e >= 6e4 ? q(e) : (e / 1e3).toFixed(3);
|
|
78
78
|
}
|
|
79
|
-
function
|
|
79
|
+
function A(e) {
|
|
80
80
|
if (!e) return "";
|
|
81
|
-
let
|
|
82
|
-
return
|
|
81
|
+
let r = e;
|
|
82
|
+
return r.startsWith("ks_") && (r = r.slice(3)), r.split("_").map((t) => t.charAt(0).toUpperCase() + t.slice(1)).join(" ");
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function j(e, r, t) {
|
|
85
85
|
if (!e) return "";
|
|
86
|
-
const s = e.split("_").map((o) => o.charAt(0).toUpperCase() + o.slice(1)).join(" "), a =
|
|
87
|
-
if (!
|
|
88
|
-
const i =
|
|
86
|
+
const s = e.split("_").map((o) => o.charAt(0).toUpperCase() + o.slice(1)).join(" "), a = t === "acc" || !t && (r == null ? void 0 : r.toLowerCase()) === "track config";
|
|
87
|
+
if (!r || r === "default" || a) return s;
|
|
88
|
+
const i = r.split("_").map((o) => o.charAt(0).toUpperCase() + o.slice(1)).join(" ");
|
|
89
89
|
return `${s} ${i}`;
|
|
90
90
|
}
|
|
91
|
-
function
|
|
91
|
+
function W(e) {
|
|
92
92
|
if (!e) return "-";
|
|
93
93
|
try {
|
|
94
94
|
return new Date(e).toLocaleDateString("en-GB", {
|
|
@@ -100,25 +100,25 @@ function _(e) {
|
|
|
100
100
|
return "-";
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
|
-
function
|
|
103
|
+
function se(e) {
|
|
104
104
|
if (!e) return "";
|
|
105
|
-
const
|
|
106
|
-
if (
|
|
107
|
-
const s = Math.floor(
|
|
105
|
+
const r = Date.now() - new Date(e).getTime(), t = Math.floor(r / 1e3);
|
|
106
|
+
if (t < 60) return "Just now";
|
|
107
|
+
const s = Math.floor(t / 60);
|
|
108
108
|
if (s < 60) return `${s}m ago`;
|
|
109
109
|
const a = Math.floor(s / 60);
|
|
110
110
|
if (a < 24) return `${a}h ago`;
|
|
111
111
|
const i = Math.floor(a / 24);
|
|
112
|
-
return i < 30 ? `${i}d ago` :
|
|
112
|
+
return i < 30 ? `${i}d ago` : W(e);
|
|
113
113
|
}
|
|
114
|
-
function
|
|
114
|
+
function ht(e) {
|
|
115
115
|
return e == null ? "" : `${e >= 0 ? "+" : "-"}${(Math.abs(e) / 1e3).toFixed(3)}`;
|
|
116
116
|
}
|
|
117
|
-
function
|
|
118
|
-
const { type:
|
|
119
|
-
return
|
|
117
|
+
function Qe(e, r) {
|
|
118
|
+
const { type: t, title: s, trackId: a, trackLayout: i, carId: o, game: d, data: p } = e, c = typeof p == "string" ? JSON.parse(p) : p, h = a ? j(a, i, d) : null, g = o ? A(o) : null, f = [h, g].filter(Boolean).join(" — ");
|
|
119
|
+
return t === "RECORD_BEATEN" && f ? `${c != null && c.beatenBySteamId && r ? r(c.beatenBySteamId).displayName : "Someone"} beat your record on ${f}` : t === "RECORD_SET" && f ? `You set a new record on ${f}` : s || "New notification";
|
|
120
120
|
}
|
|
121
|
-
function
|
|
121
|
+
function be(e) {
|
|
122
122
|
return e ? {
|
|
123
123
|
E: "Eco",
|
|
124
124
|
RD: "Road",
|
|
@@ -132,108 +132,108 @@ function xe(e) {
|
|
|
132
132
|
S: "Soft"
|
|
133
133
|
}[e] || e : "Unknown";
|
|
134
134
|
}
|
|
135
|
-
function
|
|
135
|
+
function ye(e) {
|
|
136
136
|
if (!e) return "-";
|
|
137
|
-
const
|
|
138
|
-
return isNaN(
|
|
139
|
-
}
|
|
140
|
-
function
|
|
141
|
-
var p, c,
|
|
142
|
-
const { cdnUrl:
|
|
143
|
-
queryKey: ["pitvox", "leaderboards",
|
|
144
|
-
queryFn: () =>
|
|
137
|
+
const r = Number(e);
|
|
138
|
+
return isNaN(r) ? "-" : r % 1 ? `${r.toFixed(1)}L` : `${r}L`;
|
|
139
|
+
}
|
|
140
|
+
function Ge(e = {}) {
|
|
141
|
+
var p, c, h, g, f, u;
|
|
142
|
+
const { cdnUrl: r, partnerSlug: t } = L(), { game: s, gameVersion: a } = e, i = re(t, null, null, "index.json"), o = T({
|
|
143
|
+
queryKey: ["pitvox", "leaderboards", t, "index"],
|
|
144
|
+
queryFn: () => M(r, i),
|
|
145
145
|
staleTime: 3e4,
|
|
146
146
|
refetchInterval: 3e4
|
|
147
|
-
}), d =
|
|
147
|
+
}), d = $(() => {
|
|
148
148
|
var x;
|
|
149
149
|
if (!((x = o.data) != null && x.tracks)) return [];
|
|
150
|
-
let
|
|
151
|
-
return s && (
|
|
152
|
-
id:
|
|
153
|
-
layout:
|
|
154
|
-
game:
|
|
155
|
-
gameVersion:
|
|
156
|
-
displayName:
|
|
157
|
-
driverCount:
|
|
158
|
-
carCount:
|
|
159
|
-
record:
|
|
160
|
-
visibleId:
|
|
161
|
-
carId:
|
|
162
|
-
carDisplayName:
|
|
163
|
-
lapTimeMs:
|
|
164
|
-
timestamp:
|
|
150
|
+
let y = o.data.tracks;
|
|
151
|
+
return s && (y = y.filter((v) => v.game === s)), a && (y = y.filter((v) => v.gameVersion === a)), y.map((v) => ({
|
|
152
|
+
id: v.trackId,
|
|
153
|
+
layout: v.layout,
|
|
154
|
+
game: v.game,
|
|
155
|
+
gameVersion: v.gameVersion,
|
|
156
|
+
displayName: j(v.trackId, v.layout, v.game),
|
|
157
|
+
driverCount: v.driverCount || 0,
|
|
158
|
+
carCount: v.carCount || 0,
|
|
159
|
+
record: v.recordHolder ? {
|
|
160
|
+
visibleId: v.recordHolder.steamId || v.recordHolder.userId,
|
|
161
|
+
carId: v.recordHolder.carId,
|
|
162
|
+
carDisplayName: A(v.recordHolder.carId),
|
|
163
|
+
lapTimeMs: v.recordHolder.lapTimeMs,
|
|
164
|
+
timestamp: v.recordHolder.recordedAt
|
|
165
165
|
} : null,
|
|
166
|
-
recordByTag:
|
|
166
|
+
recordByTag: v.recordByTag || null
|
|
167
167
|
}));
|
|
168
168
|
}, [(p = o.data) == null ? void 0 : p.tracks, s, a]);
|
|
169
169
|
return {
|
|
170
170
|
...o,
|
|
171
171
|
data: d,
|
|
172
172
|
partner: ((c = o.data) == null ? void 0 : c.partner) || null,
|
|
173
|
-
generatedAt: (
|
|
173
|
+
generatedAt: (h = o.data) == null ? void 0 : h.generatedAt,
|
|
174
174
|
totalLaps: ((g = o.data) == null ? void 0 : g.totalLaps) || 0,
|
|
175
175
|
totalUsers: ((f = o.data) == null ? void 0 : f.totalUsers) || 0,
|
|
176
|
-
versions: ((
|
|
176
|
+
versions: ((u = o.data) == null ? void 0 : u.versions) || {}
|
|
177
177
|
};
|
|
178
178
|
}
|
|
179
|
-
function
|
|
180
|
-
const { cdnUrl: s, partnerSlug: a } =
|
|
179
|
+
function Ye(e, r, t = {}) {
|
|
180
|
+
const { cdnUrl: s, partnerSlug: a } = L(), { carId: i, game: o, gameVersion: d } = t, p = r || "default", c = re(a, o, d, `tracks/${e}/${p}.json`), { data: h, isLoading: g, error: f } = T({
|
|
181
181
|
queryKey: ["pitvox", "leaderboards", a, "track", e, p, o, d],
|
|
182
|
-
queryFn: () =>
|
|
182
|
+
queryFn: () => M(s, c),
|
|
183
183
|
enabled: !!e,
|
|
184
184
|
staleTime: 3e4,
|
|
185
185
|
refetchInterval: 3e4
|
|
186
186
|
});
|
|
187
|
-
return { data:
|
|
188
|
-
if (!(
|
|
189
|
-
let
|
|
190
|
-
if (o && (
|
|
191
|
-
const x = /* @__PURE__ */ new Map(),
|
|
192
|
-
for (const N of
|
|
193
|
-
const
|
|
194
|
-
|
|
187
|
+
return { data: $(() => {
|
|
188
|
+
if (!(h != null && h.entries)) return [];
|
|
189
|
+
let y = h.entries;
|
|
190
|
+
if (o && (y = y.filter((x) => x.game === o)), !i) {
|
|
191
|
+
const x = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ new Map();
|
|
192
|
+
for (const N of y) {
|
|
193
|
+
const m = N.steamId || N.userId;
|
|
194
|
+
v.has(N.carId) || v.set(N.carId, /* @__PURE__ */ new Set()), v.get(N.carId).add(m), (!x.has(N.carId) || N.lapTimeMs < x.get(N.carId).lapTimeMs) && x.set(N.carId, N);
|
|
195
195
|
}
|
|
196
196
|
return Array.from(x.values()).map((N) => {
|
|
197
|
-
var
|
|
198
|
-
return { ...N, driverCount: ((
|
|
199
|
-
}).sort((N,
|
|
197
|
+
var m;
|
|
198
|
+
return { ...N, driverCount: ((m = v.get(N.carId)) == null ? void 0 : m.size) || 0 };
|
|
199
|
+
}).sort((N, m) => N.lapTimeMs - m.lapTimeMs);
|
|
200
200
|
}
|
|
201
|
-
return
|
|
202
|
-
}, [
|
|
203
|
-
}
|
|
204
|
-
function
|
|
205
|
-
var x,
|
|
206
|
-
const { cdnUrl: i, partnerSlug: o } =
|
|
207
|
-
queryKey: ["pitvox", "laps", o, e,
|
|
208
|
-
queryFn: () =>
|
|
209
|
-
enabled: !!e && !!
|
|
201
|
+
return y.filter((x) => x.carId === i).sort((x, v) => x.lapTimeMs - v.lapTimeMs);
|
|
202
|
+
}, [h == null ? void 0 : h.entries, i, o]), isLoading: g, error: f };
|
|
203
|
+
}
|
|
204
|
+
function Je(e, r, t, s, a = {}) {
|
|
205
|
+
var x, v;
|
|
206
|
+
const { cdnUrl: i, partnerSlug: o } = L(), { showInvalid: d = !1, game: p, gameVersion: c } = a, h = e && r ? Oe(o, e, r, t) : null, f = T({
|
|
207
|
+
queryKey: ["pitvox", "laps", o, e, r, t || "default"],
|
|
208
|
+
queryFn: () => M(i, h),
|
|
209
|
+
enabled: !!e && !!r,
|
|
210
210
|
staleTime: 3e4,
|
|
211
211
|
refetchInterval: 3e4
|
|
212
|
-
}),
|
|
212
|
+
}), u = $(() => {
|
|
213
213
|
var N;
|
|
214
|
-
return (N = f.data) != null && N.laps ? f.data.laps.filter((
|
|
215
|
-
}, [(x = f.data) == null ? void 0 : x.laps, s, p, c, d]),
|
|
216
|
-
const N =
|
|
214
|
+
return (N = f.data) != null && N.laps ? f.data.laps.filter((m) => !(m.carId !== s || p && m.game !== p || c && m.gameVersion !== c || !d && !m.isValid)).sort((m, k) => m.lapTimeMs - k.lapTimeMs) : [];
|
|
215
|
+
}, [(x = f.data) == null ? void 0 : x.laps, s, p, c, d]), y = $(() => {
|
|
216
|
+
const N = u.filter((b) => b.isValid && b.sector1Ms && b.sector2Ms && b.sector3Ms);
|
|
217
217
|
if (N.length < 2) return null;
|
|
218
|
-
const
|
|
219
|
-
return
|
|
220
|
-
}, [
|
|
218
|
+
const m = Math.min(...N.map((b) => b.sector1Ms)), k = Math.min(...N.map((b) => b.sector2Ms)), w = Math.min(...N.map((b) => b.sector3Ms)), C = m + k + w, D = Math.min(...N.map((b) => b.lapTimeMs));
|
|
219
|
+
return C >= D ? null : { lapTimeMs: C, sector1Ms: m, sector2Ms: k, sector3Ms: w };
|
|
220
|
+
}, [u]);
|
|
221
221
|
return {
|
|
222
222
|
...f,
|
|
223
|
-
data:
|
|
224
|
-
driverName: ((
|
|
225
|
-
theoreticalBest:
|
|
223
|
+
data: u,
|
|
224
|
+
driverName: ((v = f.data) == null ? void 0 : v.driverName) || "Driver",
|
|
225
|
+
theoreticalBest: y
|
|
226
226
|
};
|
|
227
227
|
}
|
|
228
|
-
function
|
|
229
|
-
const { cdnUrl: e } =
|
|
228
|
+
function ke() {
|
|
229
|
+
const { cdnUrl: e } = L(), { data: r } = T({
|
|
230
230
|
queryKey: ["pitvox", "users", "index"],
|
|
231
|
-
queryFn: () =>
|
|
231
|
+
queryFn: () => M(e, "users/index.json"),
|
|
232
232
|
staleTime: 5 * 6e4,
|
|
233
233
|
gcTime: 30 * 6e4
|
|
234
|
-
}),
|
|
234
|
+
}), t = (r == null ? void 0 : r.users) || {};
|
|
235
235
|
return (s, a) => {
|
|
236
|
-
const i =
|
|
236
|
+
const i = t[s];
|
|
237
237
|
return {
|
|
238
238
|
displayName: (i == null ? void 0 : i.displayName) || a || s || "Unknown",
|
|
239
239
|
avatarUrl: (i == null ? void 0 : i.avatarUrl) || null,
|
|
@@ -241,25 +241,25 @@ function fe() {
|
|
|
241
241
|
};
|
|
242
242
|
};
|
|
243
243
|
}
|
|
244
|
-
function
|
|
245
|
-
const { cdnUrl:
|
|
244
|
+
function mt(e = "evo") {
|
|
245
|
+
const { cdnUrl: r } = L(), { data: t } = T({
|
|
246
246
|
queryKey: ["pitvox", "cars", e],
|
|
247
|
-
queryFn: () =>
|
|
247
|
+
queryFn: () => M(r, `cars/${e}.json`),
|
|
248
248
|
staleTime: 5 * 6e4,
|
|
249
249
|
gcTime: 30 * 6e4
|
|
250
250
|
});
|
|
251
251
|
return {
|
|
252
|
-
tags: (
|
|
253
|
-
cars: (
|
|
254
|
-
categories: (
|
|
255
|
-
tagLabels: (
|
|
252
|
+
tags: (t == null ? void 0 : t.tags) || [],
|
|
253
|
+
cars: (t == null ? void 0 : t.cars) || {},
|
|
254
|
+
categories: (t == null ? void 0 : t.categories) || [],
|
|
255
|
+
tagLabels: (t == null ? void 0 : t.tagLabels) || {}
|
|
256
256
|
};
|
|
257
257
|
}
|
|
258
|
-
function
|
|
258
|
+
function vt() {
|
|
259
259
|
var a, i;
|
|
260
|
-
const { cdnUrl: e, partnerSlug:
|
|
261
|
-
queryKey: ["pitvox", "recentLaps",
|
|
262
|
-
queryFn: () =>
|
|
260
|
+
const { cdnUrl: e, partnerSlug: r } = L(), t = ze(r), s = T({
|
|
261
|
+
queryKey: ["pitvox", "recentLaps", r],
|
|
262
|
+
queryFn: () => M(e, t),
|
|
263
263
|
staleTime: 3e4,
|
|
264
264
|
refetchInterval: 3e4,
|
|
265
265
|
gcTime: 10 * 6e4
|
|
@@ -270,94 +270,103 @@ function ct() {
|
|
|
270
270
|
isLoading: s.isLoading
|
|
271
271
|
};
|
|
272
272
|
}
|
|
273
|
-
function
|
|
274
|
-
return
|
|
273
|
+
function xt(e, r) {
|
|
274
|
+
return Ye(e, null, { carId: r });
|
|
275
275
|
}
|
|
276
|
-
function
|
|
277
|
-
const { cdnUrl: e, partnerSlug:
|
|
276
|
+
function gt() {
|
|
277
|
+
const { cdnUrl: e, partnerSlug: r } = L();
|
|
278
278
|
return T({
|
|
279
|
-
queryKey: ["pitvox", "competitions",
|
|
279
|
+
queryKey: ["pitvox", "competitions", r],
|
|
280
280
|
queryFn: async () => {
|
|
281
|
-
const
|
|
282
|
-
return
|
|
281
|
+
const t = await M(e, "competitions/index.json");
|
|
282
|
+
return t != null && t.competitions ? r ? t.competitions.filter((s) => s.partnerSlug === r) : t.competitions : [];
|
|
283
283
|
},
|
|
284
284
|
staleTime: 6e4
|
|
285
285
|
});
|
|
286
286
|
}
|
|
287
|
-
function
|
|
288
|
-
const
|
|
287
|
+
function we(e, r = {}) {
|
|
288
|
+
const t = L(), s = r.partnerSlug || t.partnerSlug;
|
|
289
289
|
return T({
|
|
290
290
|
queryKey: ["pitvox", "competition", s, e, "config"],
|
|
291
|
-
queryFn: () =>
|
|
291
|
+
queryFn: () => M(t.cdnUrl, `competitions/${s}/${e}/config.json`),
|
|
292
292
|
enabled: !!s && !!e,
|
|
293
293
|
staleTime: 6e4
|
|
294
294
|
});
|
|
295
295
|
}
|
|
296
|
-
function
|
|
297
|
-
const
|
|
296
|
+
function Ce(e, r = {}) {
|
|
297
|
+
const t = L(), s = r.partnerSlug || t.partnerSlug;
|
|
298
298
|
return T({
|
|
299
299
|
queryKey: ["pitvox", "competition", s, e, "standings"],
|
|
300
|
-
queryFn: () =>
|
|
300
|
+
queryFn: () => M(t.cdnUrl, `competitions/${s}/${e}/standings.json`),
|
|
301
301
|
enabled: !!s && !!e,
|
|
302
302
|
staleTime: 6e4
|
|
303
303
|
});
|
|
304
304
|
}
|
|
305
|
-
function
|
|
306
|
-
const s =
|
|
305
|
+
function Ze(e, r, t = {}) {
|
|
306
|
+
const s = L(), a = t.partnerSlug || s.partnerSlug;
|
|
307
307
|
return T({
|
|
308
|
-
queryKey: ["pitvox", "competition", a, e, "round",
|
|
309
|
-
queryFn: () =>
|
|
310
|
-
enabled: !!a && !!e &&
|
|
308
|
+
queryKey: ["pitvox", "competition", a, e, "round", r],
|
|
309
|
+
queryFn: () => M(s.cdnUrl, `competitions/${a}/${e}/rounds/${r}.json`),
|
|
310
|
+
enabled: !!a && !!e && r != null,
|
|
311
311
|
staleTime: 6e4
|
|
312
312
|
});
|
|
313
313
|
}
|
|
314
|
-
function
|
|
315
|
-
const s =
|
|
314
|
+
function Xe(e, r = [], t = {}) {
|
|
315
|
+
const s = L(), a = t.partnerSlug || s.partnerSlug;
|
|
316
316
|
return T({
|
|
317
|
-
queryKey: ["pitvox", "competition", a, e, "allRounds",
|
|
317
|
+
queryKey: ["pitvox", "competition", a, e, "allRounds", r],
|
|
318
318
|
queryFn: async () => (await Promise.all(
|
|
319
|
-
|
|
320
|
-
(o) =>
|
|
319
|
+
r.map(
|
|
320
|
+
(o) => M(s.cdnUrl, `competitions/${a}/${e}/rounds/${o}.json`).catch(() => null)
|
|
321
321
|
)
|
|
322
322
|
)).filter(Boolean),
|
|
323
|
-
enabled: !!a && !!e &&
|
|
323
|
+
enabled: !!a && !!e && r.length > 0,
|
|
324
324
|
staleTime: 6e4
|
|
325
325
|
});
|
|
326
326
|
}
|
|
327
|
-
function
|
|
328
|
-
const
|
|
327
|
+
function en(e, r = {}) {
|
|
328
|
+
const t = L(), s = r.partnerSlug || t.partnerSlug;
|
|
329
329
|
return T({
|
|
330
330
|
queryKey: ["pitvox", "competition", s, e, "leaderboard"],
|
|
331
|
-
queryFn: () =>
|
|
331
|
+
queryFn: () => M(t.cdnUrl, `competitions/${s}/${e}/leaderboard.json`).catch(() => null),
|
|
332
332
|
enabled: !!s && !!e,
|
|
333
333
|
staleTime: 6e4
|
|
334
334
|
});
|
|
335
335
|
}
|
|
336
|
-
function
|
|
337
|
-
const s =
|
|
336
|
+
function nn(e, r, t = {}) {
|
|
337
|
+
const s = L(), a = t.partnerSlug || s.partnerSlug;
|
|
338
338
|
return T({
|
|
339
|
-
queryKey: ["pitvox", "competition", a, e, "round",
|
|
340
|
-
queryFn: () =>
|
|
341
|
-
enabled: !!a && !!e &&
|
|
339
|
+
queryKey: ["pitvox", "competition", a, e, "round", r, "laps"],
|
|
340
|
+
queryFn: () => M(s.cdnUrl, `competitions/${a}/${e}/rounds/${r}/laps.json`).catch(() => null),
|
|
341
|
+
enabled: !!a && !!e && r != null,
|
|
342
342
|
staleTime: 6e4
|
|
343
343
|
});
|
|
344
344
|
}
|
|
345
|
-
function
|
|
346
|
-
const
|
|
345
|
+
function tn(e, r, t = {}) {
|
|
346
|
+
const s = L(), a = t.partnerSlug || s.partnerSlug;
|
|
347
|
+
return T({
|
|
348
|
+
queryKey: ["pitvox", "competition", a, e, "round", r, "positions"],
|
|
349
|
+
queryFn: () => M(s.cdnUrl, `competitions/${a}/${e}/rounds/${r}/positions.json`).catch(() => null),
|
|
350
|
+
enabled: (t.enabled ?? !0) && !!a && !!e && r != null,
|
|
351
|
+
staleTime: 6e4
|
|
352
|
+
});
|
|
353
|
+
}
|
|
354
|
+
function Le(e, r = {}) {
|
|
355
|
+
const t = L(), s = r.partnerSlug || t.partnerSlug;
|
|
347
356
|
return T({
|
|
348
357
|
queryKey: ["pitvox", "competition", s, e, "entrylist"],
|
|
349
|
-
queryFn: () =>
|
|
358
|
+
queryFn: () => M(t.cdnUrl, `competitions/${s}/${e}/entrylist.json`),
|
|
350
359
|
enabled: !!s && !!e,
|
|
351
360
|
staleTime: 6e4
|
|
352
361
|
});
|
|
353
362
|
}
|
|
354
|
-
function
|
|
355
|
-
const { cdnUrl:
|
|
363
|
+
function ae(e) {
|
|
364
|
+
const { cdnUrl: r, partnerSlug: t, getSteamId: s } = L(), a = s();
|
|
356
365
|
return T({
|
|
357
|
-
queryKey: ["pitvox", "registration",
|
|
366
|
+
queryKey: ["pitvox", "registration", t, e, a],
|
|
358
367
|
queryFn: async () => {
|
|
359
368
|
var p;
|
|
360
|
-
const i = await fetch(`${
|
|
369
|
+
const i = await fetch(`${r}/competitions/${t}/${e}/entrylist.json`);
|
|
361
370
|
if (!i.ok) return { isRegistered: !1, entryList: null };
|
|
362
371
|
const o = await i.json();
|
|
363
372
|
return { isRegistered: !!a && ((p = o.drivers) == null ? void 0 : p.some((c) => c.steamId === a)), entryList: o };
|
|
@@ -366,20 +375,20 @@ function te(e) {
|
|
|
366
375
|
staleTime: 6e4
|
|
367
376
|
});
|
|
368
377
|
}
|
|
369
|
-
function
|
|
370
|
-
const { onRegister:
|
|
371
|
-
return
|
|
378
|
+
function Se(e) {
|
|
379
|
+
const { onRegister: r, partnerSlug: t, getSteamId: s } = L(), a = H(), i = ke();
|
|
380
|
+
return Q({
|
|
372
381
|
mutationFn: (o) => {
|
|
373
|
-
if (!
|
|
382
|
+
if (!r)
|
|
374
383
|
throw new Error(
|
|
375
384
|
"No onRegister callback provided to PitVoxPartnerProvider. Provide onRegister for in-app registration, or use useRegistrationUrl() to link to pitvox.com."
|
|
376
385
|
);
|
|
377
|
-
return
|
|
386
|
+
return r(e, o);
|
|
378
387
|
},
|
|
379
388
|
onSuccess: () => {
|
|
380
389
|
const o = s();
|
|
381
390
|
if (a.setQueriesData(
|
|
382
|
-
{ queryKey: ["pitvox", "registration",
|
|
391
|
+
{ queryKey: ["pitvox", "registration", t, e] },
|
|
383
392
|
(d) => d ? { ...d, isRegistered: !0 } : { isRegistered: !0, entryList: null }
|
|
384
393
|
), o) {
|
|
385
394
|
const d = i(o), p = {
|
|
@@ -388,7 +397,7 @@ function ke(e) {
|
|
|
388
397
|
avatarUrl: d.avatarUrl
|
|
389
398
|
};
|
|
390
399
|
a.setQueriesData(
|
|
391
|
-
{ queryKey: ["pitvox", "competition",
|
|
400
|
+
{ queryKey: ["pitvox", "competition", t, e, "entrylist"] },
|
|
392
401
|
(c) => {
|
|
393
402
|
var g;
|
|
394
403
|
return c ? ((g = c.drivers) == null ? void 0 : g.some((f) => f.steamId === o)) ? c : { ...c, drivers: [...c.drivers || [], p] } : { drivers: [p] };
|
|
@@ -398,116 +407,116 @@ function ke(e) {
|
|
|
398
407
|
}
|
|
399
408
|
});
|
|
400
409
|
}
|
|
401
|
-
function
|
|
402
|
-
const { onWithdraw:
|
|
403
|
-
return
|
|
410
|
+
function $e(e) {
|
|
411
|
+
const { onWithdraw: r, partnerSlug: t, getSteamId: s } = L(), a = H();
|
|
412
|
+
return Q({
|
|
404
413
|
mutationFn: (i) => {
|
|
405
|
-
if (!
|
|
414
|
+
if (!r)
|
|
406
415
|
throw new Error(
|
|
407
416
|
"No onWithdraw callback provided to PitVoxPartnerProvider. Provide onWithdraw for in-app withdrawal, or use useRegistrationUrl() to link to pitvox.com."
|
|
408
417
|
);
|
|
409
418
|
const o = i || s();
|
|
410
419
|
if (!o) throw new Error("No Steam ID available");
|
|
411
|
-
return
|
|
420
|
+
return r(e, o);
|
|
412
421
|
},
|
|
413
422
|
onSuccess: () => {
|
|
414
423
|
const i = s();
|
|
415
424
|
a.setQueriesData(
|
|
416
|
-
{ queryKey: ["pitvox", "registration",
|
|
425
|
+
{ queryKey: ["pitvox", "registration", t, e] },
|
|
417
426
|
(o) => o ? { ...o, isRegistered: !1 } : { isRegistered: !1, entryList: null }
|
|
418
427
|
), i && a.setQueriesData(
|
|
419
|
-
{ queryKey: ["pitvox", "competition",
|
|
428
|
+
{ queryKey: ["pitvox", "competition", t, e, "entrylist"] },
|
|
420
429
|
(o) => o != null && o.drivers ? { ...o, drivers: o.drivers.filter((d) => d.steamId !== i) } : o
|
|
421
430
|
);
|
|
422
431
|
}
|
|
423
432
|
});
|
|
424
433
|
}
|
|
425
|
-
function
|
|
426
|
-
const { onRegister: e, onWithdraw:
|
|
427
|
-
return { isPowerMode:
|
|
434
|
+
function ie() {
|
|
435
|
+
const { onRegister: e, onWithdraw: r } = L(), t = !!(e && r);
|
|
436
|
+
return { isPowerMode: t, isBasicMode: !t };
|
|
428
437
|
}
|
|
429
|
-
function
|
|
430
|
-
const { pitvoxUrl:
|
|
431
|
-
return `${
|
|
438
|
+
function oe(e) {
|
|
439
|
+
const { pitvoxUrl: r, partnerSlug: t } = L();
|
|
440
|
+
return `${r}/p/${t}/competitions/${e}/register`;
|
|
432
441
|
}
|
|
433
|
-
function
|
|
434
|
-
for (const
|
|
435
|
-
if (
|
|
442
|
+
function rn(e, r) {
|
|
443
|
+
for (const t of r)
|
|
444
|
+
if (t.tags.includes(e)) return t.id;
|
|
436
445
|
return "other";
|
|
437
446
|
}
|
|
438
|
-
function
|
|
439
|
-
if (
|
|
447
|
+
function Re(e, r, t = []) {
|
|
448
|
+
if (r.size === 0) return !0;
|
|
440
449
|
const s = {};
|
|
441
|
-
for (const a of
|
|
442
|
-
const i =
|
|
450
|
+
for (const a of r) {
|
|
451
|
+
const i = rn(a, t);
|
|
443
452
|
s[i] || (s[i] = []), s[i].push(a);
|
|
444
453
|
}
|
|
445
454
|
for (const a of Object.values(s))
|
|
446
455
|
if (!a.some((i) => e.includes(i))) return !1;
|
|
447
456
|
return !0;
|
|
448
457
|
}
|
|
449
|
-
function
|
|
450
|
-
const [
|
|
458
|
+
function Te(e, r) {
|
|
459
|
+
const [t, s] = B(/* @__PURE__ */ new Set()), a = e !== void 0, i = a ? e : t, o = K((p) => {
|
|
451
460
|
const c = new Set(i);
|
|
452
|
-
c.has(p) ? c.delete(p) : c.add(p), a &&
|
|
453
|
-
}, [i, a,
|
|
454
|
-
a &&
|
|
455
|
-
}, [a,
|
|
461
|
+
c.has(p) ? c.delete(p) : c.add(p), a && r ? r(c) : s(c);
|
|
462
|
+
}, [i, a, r]), d = K(() => {
|
|
463
|
+
a && r ? r(/* @__PURE__ */ new Set()) : s(/* @__PURE__ */ new Set());
|
|
464
|
+
}, [a, r]);
|
|
456
465
|
return { activeTags: i, toggle: o, clear: d };
|
|
457
466
|
}
|
|
458
|
-
function
|
|
459
|
-
const [
|
|
460
|
-
|
|
467
|
+
function G(e) {
|
|
468
|
+
const [r, t] = B(e), s = K((a) => {
|
|
469
|
+
t(
|
|
461
470
|
(i) => i.key === a ? { key: a, dir: i.dir === "asc" ? "desc" : "asc" } : { key: a, dir: a.includes("timestamp") || a.includes("Date") ? "desc" : "asc" }
|
|
462
471
|
);
|
|
463
472
|
}, []);
|
|
464
|
-
return [
|
|
473
|
+
return [r, s];
|
|
465
474
|
}
|
|
466
|
-
function
|
|
475
|
+
function Y(e, r, t) {
|
|
467
476
|
return [...e].sort((s, a) => {
|
|
468
|
-
const i =
|
|
477
|
+
const i = t(s, r.key), o = t(a, r.key);
|
|
469
478
|
if (i == null && o == null) return 0;
|
|
470
479
|
if (i == null) return 1;
|
|
471
480
|
if (o == null) return -1;
|
|
472
481
|
const d = typeof i == "string" ? i.localeCompare(o) : i - o;
|
|
473
|
-
return
|
|
482
|
+
return r.dir === "desc" ? -d : d;
|
|
474
483
|
});
|
|
475
484
|
}
|
|
476
|
-
function
|
|
477
|
-
const
|
|
478
|
-
return
|
|
479
|
-
s1: Math.min(...
|
|
480
|
-
s2: Math.min(...
|
|
481
|
-
s3: Math.min(...
|
|
485
|
+
function Me(e, r = !1) {
|
|
486
|
+
const t = r ? e == null ? void 0 : e.filter((s) => s.isValid) : e;
|
|
487
|
+
return t != null && t.length ? {
|
|
488
|
+
s1: Math.min(...t.map((s) => s.sector1Ms).filter(Boolean)),
|
|
489
|
+
s2: Math.min(...t.map((s) => s.sector2Ms).filter(Boolean)),
|
|
490
|
+
s3: Math.min(...t.map((s) => s.sector3Ms).filter(Boolean))
|
|
482
491
|
} : null;
|
|
483
492
|
}
|
|
484
|
-
function
|
|
485
|
-
return e ?
|
|
493
|
+
function sn({ active: e, dir: r }) {
|
|
494
|
+
return e ? r === "asc" ? /* @__PURE__ */ n("svg", { className: "pvx-sort-icon", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.5 15.75l7.5-7.5 7.5 7.5" }) }) : /* @__PURE__ */ n("svg", { className: "pvx-sort-icon", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19.5 8.25l-7.5 7.5-7.5-7.5" }) }) : /* @__PURE__ */ n("svg", { className: "pvx-sort-icon pvx-sort-icon--inactive", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 9l4-4 4 4M16 15l-4 4-4-4" }) });
|
|
486
495
|
}
|
|
487
|
-
function
|
|
496
|
+
function P({ label: e, sortKey: r, config: t, onSort: s, className: a = "" }) {
|
|
488
497
|
return /* @__PURE__ */ n(
|
|
489
498
|
"th",
|
|
490
499
|
{
|
|
491
500
|
className: `pvx-th pvx-th--sortable ${a}`,
|
|
492
|
-
onClick: () => s(
|
|
501
|
+
onClick: () => s(r),
|
|
493
502
|
children: /* @__PURE__ */ l("span", { className: "pvx-th-inner", children: [
|
|
494
503
|
e,
|
|
495
|
-
/* @__PURE__ */ n(
|
|
504
|
+
/* @__PURE__ */ n(sn, { active: t.key === r, dir: t.dir })
|
|
496
505
|
] })
|
|
497
506
|
}
|
|
498
507
|
);
|
|
499
508
|
}
|
|
500
|
-
function
|
|
501
|
-
const { displayName:
|
|
509
|
+
function J({ userId: e, getUserDisplay: r }) {
|
|
510
|
+
const { displayName: t, avatarUrl: s } = r(e);
|
|
502
511
|
return /* @__PURE__ */ l("span", { className: "pvx-driver", children: [
|
|
503
512
|
s ? /* @__PURE__ */ n("img", { src: s, alt: "", className: "pvx-driver-avatar" }) : /* @__PURE__ */ n("span", { className: "pvx-driver-avatar pvx-driver-avatar--placeholder" }),
|
|
504
|
-
/* @__PURE__ */ n("span", { className: "pvx-driver-name", children:
|
|
513
|
+
/* @__PURE__ */ n("span", { className: "pvx-driver-name", children: t })
|
|
505
514
|
] });
|
|
506
515
|
}
|
|
507
|
-
function
|
|
508
|
-
return /* @__PURE__ */ n("span", { className:
|
|
516
|
+
function le({ rank: e, podium: r = !1 }) {
|
|
517
|
+
return /* @__PURE__ */ n("span", { className: r ? e === 1 ? "pvx-rank pvx-rank--gold" : e === 2 ? "pvx-rank pvx-rank--silver" : e === 3 ? "pvx-rank pvx-rank--bronze" : "pvx-rank" : "pvx-rank", children: e });
|
|
509
518
|
}
|
|
510
|
-
function
|
|
519
|
+
function De({ availableTags: e, activeTags: r, onToggle: t, onClear: s, categories: a = [], tagLabels: i = {} }) {
|
|
511
520
|
if (!e || e.length < 2) return null;
|
|
512
521
|
const o = a.map((d) => ({ id: d.id, tags: d.tags.filter((p) => e.includes(p)) })).filter((d) => d.tags.length > 0);
|
|
513
522
|
return /* @__PURE__ */ l("div", { className: "pvx-tag-bar", children: [
|
|
@@ -515,7 +524,7 @@ function Te({ availableTags: e, activeTags: t, onToggle: r, onClear: s, categori
|
|
|
515
524
|
"button",
|
|
516
525
|
{
|
|
517
526
|
onClick: s,
|
|
518
|
-
className: `pvx-tag ${
|
|
527
|
+
className: `pvx-tag ${r.size === 0 ? "pvx-tag--active" : ""}`,
|
|
519
528
|
children: "All"
|
|
520
529
|
}
|
|
521
530
|
),
|
|
@@ -524,8 +533,8 @@ function Te({ availableTags: e, activeTags: t, onToggle: r, onClear: s, categori
|
|
|
524
533
|
d.tags.map((c) => /* @__PURE__ */ n(
|
|
525
534
|
"button",
|
|
526
535
|
{
|
|
527
|
-
onClick: () =>
|
|
528
|
-
className: `pvx-tag ${
|
|
536
|
+
onClick: () => t(c),
|
|
537
|
+
className: `pvx-tag ${r.has(c) ? "pvx-tag--active" : ""}`,
|
|
529
538
|
children: i[c] || c
|
|
530
539
|
},
|
|
531
540
|
c
|
|
@@ -533,62 +542,62 @@ function Te({ availableTags: e, activeTags: t, onToggle: r, onClear: s, categori
|
|
|
533
542
|
] }, d.id))
|
|
534
543
|
] });
|
|
535
544
|
}
|
|
536
|
-
function
|
|
537
|
-
return /* @__PURE__ */ n("nav", { className: "pvx-breadcrumb", "aria-label": "Breadcrumb", children: /* @__PURE__ */ n("ol", { className: "pvx-breadcrumb-list", children: e.map((
|
|
538
|
-
const s =
|
|
545
|
+
function ce({ segments: e }) {
|
|
546
|
+
return /* @__PURE__ */ n("nav", { className: "pvx-breadcrumb", "aria-label": "Breadcrumb", children: /* @__PURE__ */ n("ol", { className: "pvx-breadcrumb-list", children: e.map((r, t) => {
|
|
547
|
+
const s = t === e.length - 1;
|
|
539
548
|
return /* @__PURE__ */ l("li", { className: "pvx-breadcrumb-item", children: [
|
|
540
|
-
|
|
541
|
-
!s &&
|
|
542
|
-
] },
|
|
549
|
+
t > 0 && /* @__PURE__ */ n("svg", { className: "pvx-breadcrumb-chevron", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8.25 4.5l7.5 7.5-7.5 7.5" }) }),
|
|
550
|
+
!s && r.onClick ? /* @__PURE__ */ n("button", { onClick: r.onClick, className: "pvx-breadcrumb-link", children: r.label }) : /* @__PURE__ */ n("span", { className: "pvx-breadcrumb-current", children: r.label })
|
|
551
|
+
] }, r.key);
|
|
543
552
|
}) }) });
|
|
544
553
|
}
|
|
545
|
-
function
|
|
554
|
+
function O({ message: e }) {
|
|
546
555
|
return /* @__PURE__ */ l("div", { className: "pvx-empty", children: [
|
|
547
556
|
/* @__PURE__ */ n("svg", { className: "pvx-empty-icon", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M16.5 18.75h-9m9 0a3 3 0 013 3h-15a3 3 0 013-3m9 0v-4.5A3.375 3.375 0 0013.125 10.875h-2.25A3.375 3.375 0 007.5 14.25v4.5" }) }),
|
|
548
557
|
/* @__PURE__ */ n("p", { children: e })
|
|
549
558
|
] });
|
|
550
559
|
}
|
|
551
|
-
function
|
|
560
|
+
function z() {
|
|
552
561
|
return /* @__PURE__ */ n("div", { className: "pvx-loading", children: "Loading..." });
|
|
553
562
|
}
|
|
554
|
-
function
|
|
563
|
+
function an() {
|
|
555
564
|
return /* @__PURE__ */ n("svg", { className: "pvx-icon pvx-icon--valid", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.5 12.75l6 6 9-13.5" }) });
|
|
556
565
|
}
|
|
557
|
-
function
|
|
566
|
+
function on() {
|
|
558
567
|
return /* @__PURE__ */ n("svg", { className: "pvx-icon pvx-icon--invalid", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) });
|
|
559
568
|
}
|
|
560
|
-
function
|
|
561
|
-
const [d, p] =
|
|
562
|
-
var
|
|
563
|
-
if (!((
|
|
569
|
+
function ft({ tracks: e, isLoading: r, carMetadata: t, getUserDisplay: s, onTrackSelect: a, tags: i, onTagChange: o }) {
|
|
570
|
+
const [d, p] = G({ key: "record.timestamp", dir: "desc" }), { activeTags: c, toggle: h, clear: g } = Te(i, o), f = $(() => {
|
|
571
|
+
var v;
|
|
572
|
+
if (!((v = t == null ? void 0 : t.tags) != null && v.length)) return [];
|
|
564
573
|
const x = /* @__PURE__ */ new Set();
|
|
565
574
|
for (const N of e || [])
|
|
566
|
-
N.recordByTag && Object.keys(N.recordByTag).forEach((
|
|
567
|
-
return
|
|
568
|
-
}, [e,
|
|
569
|
-
var
|
|
575
|
+
N.recordByTag && Object.keys(N.recordByTag).forEach((m) => x.add(m));
|
|
576
|
+
return t.tags.filter((N) => x.has(N));
|
|
577
|
+
}, [e, t]), u = $(() => e ? c.size === 0 ? e : e.map((x) => {
|
|
578
|
+
var m, k;
|
|
570
579
|
if (!x.recordByTag) return null;
|
|
571
|
-
let
|
|
580
|
+
let v = null;
|
|
572
581
|
const N = /* @__PURE__ */ new Set();
|
|
573
|
-
for (const
|
|
574
|
-
if (N.has(
|
|
575
|
-
N.add(
|
|
576
|
-
const
|
|
577
|
-
|
|
582
|
+
for (const w of Object.values(x.recordByTag)) {
|
|
583
|
+
if (N.has(w.carId)) continue;
|
|
584
|
+
N.add(w.carId);
|
|
585
|
+
const C = ((k = (m = t == null ? void 0 : t.cars) == null ? void 0 : m[w.carId]) == null ? void 0 : k.tags) || [];
|
|
586
|
+
Re(C, c, t == null ? void 0 : t.categories) && (!v || w.lapTimeMs < v.lapTimeMs) && (v = w);
|
|
578
587
|
}
|
|
579
|
-
return
|
|
588
|
+
return v ? {
|
|
580
589
|
...x,
|
|
581
590
|
record: {
|
|
582
|
-
visibleId:
|
|
583
|
-
carId:
|
|
584
|
-
carDisplayName:
|
|
585
|
-
lapTimeMs:
|
|
586
|
-
timestamp:
|
|
591
|
+
visibleId: v.steamId || v.identifier,
|
|
592
|
+
carId: v.carId,
|
|
593
|
+
carDisplayName: A(v.carId),
|
|
594
|
+
lapTimeMs: v.lapTimeMs,
|
|
595
|
+
timestamp: v.recordedAt
|
|
587
596
|
}
|
|
588
597
|
} : null;
|
|
589
|
-
}).filter(Boolean) : [], [e, c,
|
|
590
|
-
var N,
|
|
591
|
-
switch (
|
|
598
|
+
}).filter(Boolean) : [], [e, c, t]), y = $(() => Y(u, d, (x, v) => {
|
|
599
|
+
var N, m;
|
|
600
|
+
switch (v) {
|
|
592
601
|
case "displayName":
|
|
593
602
|
return x.displayName;
|
|
594
603
|
case "record.lapTimeMs":
|
|
@@ -599,34 +608,34 @@ function ut({ tracks: e, isLoading: t, carMetadata: r, getUserDisplay: s, onTrac
|
|
|
599
608
|
return x.carCount || 0;
|
|
600
609
|
case "record.timestamp":
|
|
601
610
|
default:
|
|
602
|
-
return (
|
|
611
|
+
return (m = x.record) != null && m.timestamp ? new Date(x.record.timestamp).getTime() : 0;
|
|
603
612
|
}
|
|
604
|
-
}), [
|
|
605
|
-
return
|
|
613
|
+
}), [u, d]);
|
|
614
|
+
return r ? /* @__PURE__ */ n(z, {}) : e != null && e.length ? /* @__PURE__ */ l("div", { className: "pvx-card", children: [
|
|
606
615
|
/* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ n("h2", { className: "pvx-card-title", children: "Track Records" }) }),
|
|
607
616
|
/* @__PURE__ */ n(
|
|
608
|
-
|
|
617
|
+
De,
|
|
609
618
|
{
|
|
610
619
|
availableTags: f,
|
|
611
620
|
activeTags: c,
|
|
612
|
-
onToggle:
|
|
621
|
+
onToggle: h,
|
|
613
622
|
onClear: g,
|
|
614
|
-
categories:
|
|
615
|
-
tagLabels:
|
|
623
|
+
categories: t == null ? void 0 : t.categories,
|
|
624
|
+
tagLabels: t == null ? void 0 : t.tagLabels
|
|
616
625
|
}
|
|
617
626
|
),
|
|
618
627
|
/* @__PURE__ */ n("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
|
|
619
628
|
/* @__PURE__ */ n("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
|
|
620
|
-
/* @__PURE__ */ n(
|
|
629
|
+
/* @__PURE__ */ n(P, { label: "Track", sortKey: "displayName", config: d, onSort: p }),
|
|
621
630
|
/* @__PURE__ */ n("th", { className: "pvx-th", children: "Record Holder" }),
|
|
622
631
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-lg", children: "Car" }),
|
|
623
|
-
/* @__PURE__ */ n(
|
|
624
|
-
/* @__PURE__ */ n(
|
|
625
|
-
/* @__PURE__ */ n(
|
|
626
|
-
/* @__PURE__ */ n(
|
|
632
|
+
/* @__PURE__ */ n(P, { label: "Lap Time", sortKey: "record.lapTimeMs", config: d, onSort: p }),
|
|
633
|
+
/* @__PURE__ */ n(P, { label: "Drivers", sortKey: "driverCount", config: d, onSort: p, className: "pvx-hidden-below-md" }),
|
|
634
|
+
/* @__PURE__ */ n(P, { label: "Cars", sortKey: "carCount", config: d, onSort: p, className: "pvx-hidden-below-lg" }),
|
|
635
|
+
/* @__PURE__ */ n(P, { label: "Date", sortKey: "record.timestamp", config: d, onSort: p, className: "pvx-hidden-below-xl" })
|
|
627
636
|
] }) }),
|
|
628
|
-
/* @__PURE__ */ n("tbody", { className: "pvx-tbody", children:
|
|
629
|
-
var
|
|
637
|
+
/* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: y.map((x) => {
|
|
638
|
+
var v, N, m;
|
|
630
639
|
return /* @__PURE__ */ l(
|
|
631
640
|
"tr",
|
|
632
641
|
{
|
|
@@ -634,55 +643,55 @@ function ut({ tracks: e, isLoading: t, carMetadata: r, getUserDisplay: s, onTrac
|
|
|
634
643
|
onClick: () => a(x.id, x.layout),
|
|
635
644
|
children: [
|
|
636
645
|
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary", children: x.displayName }),
|
|
637
|
-
/* @__PURE__ */ n("td", { className: "pvx-td", children: (
|
|
646
|
+
/* @__PURE__ */ n("td", { className: "pvx-td", children: (v = x.record) != null && v.visibleId ? /* @__PURE__ */ n(J, { userId: x.record.visibleId, getUserDisplay: s }) : "-" }),
|
|
638
647
|
/* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-lg", children: ((N = x.record) == null ? void 0 : N.carDisplayName) || "-" }),
|
|
639
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: x.record ?
|
|
648
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: x.record ? q(x.record.lapTimeMs) : "-" }),
|
|
640
649
|
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-md", children: x.driverCount || "-" }),
|
|
641
650
|
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children: x.carCount || "-" }),
|
|
642
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: (
|
|
651
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: (m = x.record) != null && m.timestamp ? W(x.record.timestamp) : "-" })
|
|
643
652
|
]
|
|
644
653
|
},
|
|
645
654
|
`${x.id}|${x.layout || ""}`
|
|
646
655
|
);
|
|
647
656
|
}) })
|
|
648
657
|
] }) })
|
|
649
|
-
] }) : /* @__PURE__ */ n(
|
|
658
|
+
] }) : /* @__PURE__ */ n(O, { message: "No lap times recorded yet." });
|
|
650
659
|
}
|
|
651
|
-
function
|
|
652
|
-
const [c,
|
|
653
|
-
var k,
|
|
660
|
+
function Nt({ entries: e, isLoading: r, track: t, carMetadata: s, getUserDisplay: a, onCarSelect: i, onNavigate: o, tags: d, onTagChange: p }) {
|
|
661
|
+
const [c, h] = G({ key: "lapTimeMs", dir: "asc" }), { activeTags: g, toggle: f, clear: u } = Te(d, p), y = $(() => {
|
|
662
|
+
var k, w, C;
|
|
654
663
|
if (!e || !((k = s == null ? void 0 : s.tags) != null && k.length)) return [];
|
|
655
|
-
const
|
|
664
|
+
const m = /* @__PURE__ */ new Set();
|
|
656
665
|
for (const D of e)
|
|
657
|
-
(((
|
|
658
|
-
return s.tags.filter((D) =>
|
|
659
|
-
}, [e, s]), x =
|
|
660
|
-
var
|
|
661
|
-
const k = ((
|
|
662
|
-
return
|
|
663
|
-
}) : [], [e, g, s]),
|
|
666
|
+
(((C = (w = s.cars) == null ? void 0 : w[D.carId]) == null ? void 0 : C.tags) || []).forEach((S) => m.add(S));
|
|
667
|
+
return s.tags.filter((D) => m.has(D));
|
|
668
|
+
}, [e, s]), x = $(() => e ? g.size === 0 ? e : e.filter((m) => {
|
|
669
|
+
var w, C;
|
|
670
|
+
const k = ((C = (w = s == null ? void 0 : s.cars) == null ? void 0 : w[m.carId]) == null ? void 0 : C.tags) || [];
|
|
671
|
+
return Re(k, g, s == null ? void 0 : s.categories);
|
|
672
|
+
}) : [], [e, g, s]), v = $(() => Y(x, c, (m, k) => {
|
|
664
673
|
switch (k) {
|
|
665
674
|
case "carId":
|
|
666
|
-
return
|
|
675
|
+
return A(m.carId);
|
|
667
676
|
case "driverCount":
|
|
668
|
-
return
|
|
677
|
+
return m.driverCount || 0;
|
|
669
678
|
case "lapTimeMs":
|
|
670
679
|
default:
|
|
671
|
-
return
|
|
680
|
+
return m.lapTimeMs;
|
|
672
681
|
}
|
|
673
682
|
}), [x, c]), N = [
|
|
674
683
|
{ key: "tracks", label: "Tracks", onClick: () => o("tracks") },
|
|
675
|
-
{ key: "track", label:
|
|
684
|
+
{ key: "track", label: t.displayName }
|
|
676
685
|
];
|
|
677
|
-
return
|
|
678
|
-
/* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ n(
|
|
686
|
+
return r ? /* @__PURE__ */ n(z, {}) : /* @__PURE__ */ l("div", { className: "pvx-card", children: [
|
|
687
|
+
/* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ n(ce, { segments: N }) }),
|
|
679
688
|
/* @__PURE__ */ n(
|
|
680
|
-
|
|
689
|
+
De,
|
|
681
690
|
{
|
|
682
|
-
availableTags:
|
|
691
|
+
availableTags: y,
|
|
683
692
|
activeTags: g,
|
|
684
693
|
onToggle: f,
|
|
685
|
-
onClear:
|
|
694
|
+
onClear: u,
|
|
686
695
|
categories: s == null ? void 0 : s.categories,
|
|
687
696
|
tagLabels: s == null ? void 0 : s.tagLabels
|
|
688
697
|
}
|
|
@@ -690,103 +699,103 @@ function ht({ entries: e, isLoading: t, track: r, carMetadata: s, getUserDisplay
|
|
|
690
699
|
e != null && e.length ? /* @__PURE__ */ n("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
|
|
691
700
|
/* @__PURE__ */ n("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
|
|
692
701
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-th--narrow", children: "#" }),
|
|
693
|
-
/* @__PURE__ */ n(
|
|
702
|
+
/* @__PURE__ */ n(P, { label: "Car", sortKey: "carId", config: c, onSort: h }),
|
|
694
703
|
/* @__PURE__ */ n("th", { className: "pvx-th", children: "Record Holder" }),
|
|
695
|
-
/* @__PURE__ */ n(
|
|
696
|
-
/* @__PURE__ */ n(
|
|
704
|
+
/* @__PURE__ */ n(P, { label: "Lap Time", sortKey: "lapTimeMs", config: c, onSort: h }),
|
|
705
|
+
/* @__PURE__ */ n(P, { label: "Drivers", sortKey: "driverCount", config: c, onSort: h, className: "pvx-hidden-below-md" }),
|
|
697
706
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-lg", children: "Date" })
|
|
698
707
|
] }) }),
|
|
699
|
-
/* @__PURE__ */ n("tbody", { className: "pvx-tbody", children:
|
|
708
|
+
/* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: v.map((m, k) => /* @__PURE__ */ l(
|
|
700
709
|
"tr",
|
|
701
710
|
{
|
|
702
711
|
className: "pvx-row pvx-row--clickable",
|
|
703
|
-
onClick: () => i(
|
|
712
|
+
onClick: () => i(m.carId),
|
|
704
713
|
children: [
|
|
705
|
-
/* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(
|
|
706
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary", children:
|
|
707
|
-
/* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(
|
|
708
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children:
|
|
709
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-md", children:
|
|
710
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-lg", children:
|
|
714
|
+
/* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(le, { rank: k + 1, podium: !0 }) }),
|
|
715
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary", children: A(m.carId) }),
|
|
716
|
+
/* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(J, { userId: m.steamId || m.userId, getUserDisplay: a }) }),
|
|
717
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: q(m.lapTimeMs) }),
|
|
718
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-md", children: m.driverCount || "-" }),
|
|
719
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-lg", children: m.recordedAt ? W(m.recordedAt) : "-" })
|
|
711
720
|
]
|
|
712
721
|
},
|
|
713
|
-
|
|
722
|
+
m.carId
|
|
714
723
|
)) })
|
|
715
|
-
] }) }) : /* @__PURE__ */ n(
|
|
724
|
+
] }) }) : /* @__PURE__ */ n(O, { message: "No lap times for this track yet." })
|
|
716
725
|
] });
|
|
717
726
|
}
|
|
718
|
-
function
|
|
719
|
-
const [p, c] =
|
|
720
|
-
switch (
|
|
727
|
+
function bt({ entries: e, isLoading: r, track: t, carId: s, getUserDisplay: a, onDriverSelect: i, onNavigate: o, highlightId: d }) {
|
|
728
|
+
const [p, c] = G({ key: "lapTimeMs", dir: "asc" }), h = $(() => Me(e), [e]), g = $(() => Y(e || [], p, (u, y) => {
|
|
729
|
+
switch (y) {
|
|
721
730
|
case "userId":
|
|
722
|
-
return a(
|
|
731
|
+
return a(u.steamId || u.userId).displayName;
|
|
723
732
|
case "lapCount":
|
|
724
|
-
return
|
|
733
|
+
return u.lapCount || 0;
|
|
725
734
|
case "lapTimeMs":
|
|
726
735
|
default:
|
|
727
|
-
return
|
|
736
|
+
return u.lapTimeMs;
|
|
728
737
|
}
|
|
729
738
|
}), [e, p, a]), f = [
|
|
730
739
|
{ key: "tracks", label: "Tracks", onClick: () => o("tracks") },
|
|
731
|
-
{ key: "track", label:
|
|
732
|
-
{ key: "car", label:
|
|
740
|
+
{ key: "track", label: t.displayName, onClick: () => o("track") },
|
|
741
|
+
{ key: "car", label: A(s) }
|
|
733
742
|
];
|
|
734
|
-
return
|
|
735
|
-
/* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ n(
|
|
743
|
+
return r ? /* @__PURE__ */ n(z, {}) : /* @__PURE__ */ l("div", { className: "pvx-card", children: [
|
|
744
|
+
/* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ n(ce, { segments: f }) }),
|
|
736
745
|
e != null && e.length ? /* @__PURE__ */ n("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
|
|
737
746
|
/* @__PURE__ */ n("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
|
|
738
747
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-th--narrow", children: "#" }),
|
|
739
|
-
/* @__PURE__ */ n(
|
|
740
|
-
/* @__PURE__ */ n(
|
|
748
|
+
/* @__PURE__ */ n(P, { label: "Driver", sortKey: "userId", config: p, onSort: c }),
|
|
749
|
+
/* @__PURE__ */ n(P, { label: "Lap Time", sortKey: "lapTimeMs", config: p, onSort: c }),
|
|
741
750
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "S1" }),
|
|
742
751
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "S2" }),
|
|
743
752
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "S3" }),
|
|
744
753
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-lg", children: "Tyre" }),
|
|
745
754
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-xl", children: "Fuel" }),
|
|
746
|
-
/* @__PURE__ */ n(
|
|
755
|
+
/* @__PURE__ */ n(P, { label: "Laps", sortKey: "lapCount", config: p, onSort: c, className: "pvx-hidden-below-lg" }),
|
|
747
756
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-xl", children: "Date" })
|
|
748
757
|
] }) }),
|
|
749
|
-
/* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: g.map((
|
|
750
|
-
const x =
|
|
758
|
+
/* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: g.map((u, y) => {
|
|
759
|
+
const x = y + 1, v = u.steamId || u.userId, N = h && u.sector1Ms === h.s1, m = h && u.sector2Ms === h.s2, k = h && u.sector3Ms === h.s3;
|
|
751
760
|
return /* @__PURE__ */ l(
|
|
752
761
|
"tr",
|
|
753
762
|
{
|
|
754
|
-
className: `pvx-row pvx-row--clickable ${d &&
|
|
755
|
-
onClick: () => i(
|
|
763
|
+
className: `pvx-row pvx-row--clickable ${d && v === d ? "pvx-row--highlight" : x <= 3 ? "pvx-row--podium" : ""}`,
|
|
764
|
+
onClick: () => i(v),
|
|
756
765
|
children: [
|
|
757
|
-
/* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(
|
|
758
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary", children: /* @__PURE__ */ n(
|
|
759
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children:
|
|
760
|
-
/* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${N ? "pvx-td--best-sector" : ""}`, children:
|
|
761
|
-
/* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${
|
|
762
|
-
/* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${k ? "pvx-td--best-sector" : ""}`, children:
|
|
763
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", title:
|
|
764
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-xl", children:
|
|
765
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children:
|
|
766
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children:
|
|
766
|
+
/* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(le, { rank: x, podium: !0 }) }),
|
|
767
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary", children: /* @__PURE__ */ n(J, { userId: v, getUserDisplay: a }) }),
|
|
768
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: q(u.lapTimeMs) }),
|
|
769
|
+
/* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${N ? "pvx-td--best-sector" : ""}`, children: E(u.sector1Ms) }),
|
|
770
|
+
/* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${m ? "pvx-td--best-sector" : ""}`, children: E(u.sector2Ms) }),
|
|
771
|
+
/* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${k ? "pvx-td--best-sector" : ""}`, children: E(u.sector3Ms) }),
|
|
772
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", title: be(u.tyreCompound), children: u.tyreCompound || "-" }),
|
|
773
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-xl", children: ye(u.startingFuelL) }),
|
|
774
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children: u.lapCount || "-" }),
|
|
775
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: u.recordedAt ? W(u.recordedAt) : "-" })
|
|
767
776
|
]
|
|
768
777
|
},
|
|
769
|
-
|
|
778
|
+
v
|
|
770
779
|
);
|
|
771
780
|
}) })
|
|
772
|
-
] }) }) : /* @__PURE__ */ n(
|
|
781
|
+
] }) }) : /* @__PURE__ */ n(O, { message: "No lap times for this car yet." })
|
|
773
782
|
] });
|
|
774
783
|
}
|
|
775
|
-
function
|
|
776
|
-
const { data: c, driverName:
|
|
777
|
-
const
|
|
778
|
-
return
|
|
784
|
+
function yt({ userId: e, track: r, carId: t, game: s, gameVersion: a, showInvalid: i, getUserDisplay: o, onToggleInvalid: d, onNavigate: p }) {
|
|
785
|
+
const { data: c, driverName: h, theoreticalBest: g, isLoading: f } = Je(e, r.id, r.layout, t, { showInvalid: i, game: s, gameVersion: a }), { displayName: u, avatarUrl: y } = o(e, h), x = $(() => Me(c, !0), [c]), v = $(() => {
|
|
786
|
+
const m = (c == null ? void 0 : c.filter((k) => k.isValid)) || [];
|
|
787
|
+
return m.length ? Math.min(...m.map((k) => k.lapTimeMs)) : null;
|
|
779
788
|
}, [c]), N = [
|
|
780
789
|
{ key: "tracks", label: "Tracks", onClick: () => p("tracks") },
|
|
781
|
-
{ key: "track", label:
|
|
782
|
-
{ key: "car", label:
|
|
783
|
-
{ key: "driver", label:
|
|
790
|
+
{ key: "track", label: r.displayName, onClick: () => p("track") },
|
|
791
|
+
{ key: "car", label: A(t), onClick: () => p("car") },
|
|
792
|
+
{ key: "driver", label: u }
|
|
784
793
|
];
|
|
785
|
-
return f ? /* @__PURE__ */ n(
|
|
794
|
+
return f ? /* @__PURE__ */ n(z, {}) : /* @__PURE__ */ l("div", { className: "pvx-card", children: [
|
|
786
795
|
/* @__PURE__ */ l("div", { className: "pvx-card-header pvx-card-header--split", children: [
|
|
787
796
|
/* @__PURE__ */ l("div", { className: "pvx-card-header-left", children: [
|
|
788
|
-
/* @__PURE__ */ n(
|
|
789
|
-
|
|
797
|
+
/* @__PURE__ */ n(ce, { segments: N }),
|
|
798
|
+
y ? /* @__PURE__ */ n("img", { src: y, alt: "", className: "pvx-driver-avatar pvx-driver-avatar--lg" }) : /* @__PURE__ */ n("span", { className: "pvx-driver-avatar pvx-driver-avatar--lg pvx-driver-avatar--placeholder" })
|
|
790
799
|
] }),
|
|
791
800
|
/* @__PURE__ */ l("label", { className: "pvx-checkbox-label", children: [
|
|
792
801
|
/* @__PURE__ */ n(
|
|
@@ -803,14 +812,14 @@ function mt({ userId: e, track: t, carId: r, game: s, gameVersion: a, showInvali
|
|
|
803
812
|
] }),
|
|
804
813
|
g && /* @__PURE__ */ l("div", { className: "pvx-theoretical-best", children: [
|
|
805
814
|
/* @__PURE__ */ n("span", { className: "pvx-theoretical-best-label", children: "Theoretical Best:" }),
|
|
806
|
-
/* @__PURE__ */ n("span", { className: "pvx-theoretical-best-time", children:
|
|
815
|
+
/* @__PURE__ */ n("span", { className: "pvx-theoretical-best-time", children: q(g.lapTimeMs) }),
|
|
807
816
|
/* @__PURE__ */ l("span", { className: "pvx-theoretical-best-sectors", children: [
|
|
808
817
|
"(",
|
|
809
|
-
|
|
818
|
+
E(g.sector1Ms),
|
|
810
819
|
" + ",
|
|
811
|
-
|
|
820
|
+
E(g.sector2Ms),
|
|
812
821
|
" + ",
|
|
813
|
-
|
|
822
|
+
E(g.sector3Ms),
|
|
814
823
|
")"
|
|
815
824
|
] })
|
|
816
825
|
] }),
|
|
@@ -827,28 +836,28 @@ function mt({ userId: e, track: t, carId: r, game: s, gameVersion: a, showInvali
|
|
|
827
836
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-lg", children: "Fuel" }),
|
|
828
837
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-xl", children: "Date" })
|
|
829
838
|
] }) }),
|
|
830
|
-
/* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: c.map((
|
|
831
|
-
const
|
|
832
|
-
let
|
|
833
|
-
return
|
|
834
|
-
/* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n("span", { className: `pvx-rank ${
|
|
835
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-md", children:
|
|
836
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children:
|
|
837
|
-
/* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${
|
|
838
|
-
/* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${D ? "pvx-td--best-sector" : ""}`, children:
|
|
839
|
-
/* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${
|
|
840
|
-
/* @__PURE__ */ n("td", { className: "pvx-td", title:
|
|
841
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", title:
|
|
842
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children:
|
|
843
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children:
|
|
844
|
-
] },
|
|
839
|
+
/* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: c.map((m, k) => {
|
|
840
|
+
const w = m.isValid && m.lapTimeMs === v, C = x && m.isValid && m.sector1Ms === x.s1, D = x && m.isValid && m.sector2Ms === x.s2, b = x && m.isValid && m.sector3Ms === x.s3;
|
|
841
|
+
let S = "pvx-row";
|
|
842
|
+
return m.isValid || (S += " pvx-row--invalid"), w && (S += " pvx-row--personal-best"), /* @__PURE__ */ l("tr", { className: S, children: [
|
|
843
|
+
/* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n("span", { className: `pvx-rank ${w ? "pvx-rank--gold" : ""}`, children: k + 1 }) }),
|
|
844
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-md", children: m.lapNumber || "-" }),
|
|
845
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: q(m.lapTimeMs) }),
|
|
846
|
+
/* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${C ? "pvx-td--best-sector" : ""}`, children: E(m.sector1Ms) }),
|
|
847
|
+
/* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${D ? "pvx-td--best-sector" : ""}`, children: E(m.sector2Ms) }),
|
|
848
|
+
/* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${b ? "pvx-td--best-sector" : ""}`, children: E(m.sector3Ms) }),
|
|
849
|
+
/* @__PURE__ */ n("td", { className: "pvx-td", title: m.isValid ? void 0 : m.invalidReason || "Invalid", children: m.isValid ? /* @__PURE__ */ n(an, {}) : /* @__PURE__ */ n(on, {}) }),
|
|
850
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", title: be(m.tyreCompound), children: m.tyreCompound || "-" }),
|
|
851
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children: ye(m.startingFuelL) }),
|
|
852
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: W(m.timestamp) })
|
|
853
|
+
] }, m.id);
|
|
845
854
|
}) })
|
|
846
|
-
] }) }) : /* @__PURE__ */ n(
|
|
855
|
+
] }) }) : /* @__PURE__ */ n(O, { message: i ? "No laps recorded for this combination." : 'No valid laps. Try enabling "Show invalid laps".' })
|
|
847
856
|
] });
|
|
848
857
|
}
|
|
849
|
-
function
|
|
850
|
-
const [o, d] =
|
|
851
|
-
switch (
|
|
858
|
+
function kt({ drivers: e, isLoading: r, getUserDisplay: t, game: s, gameVersion: a, onComboSelect: i }) {
|
|
859
|
+
const [o, d] = G({ key: "rank", dir: "asc" }), [p, c] = B(null), h = $(() => e ? Y(e, o, (f, u) => {
|
|
860
|
+
switch (u) {
|
|
852
861
|
case "rating":
|
|
853
862
|
return f.rating;
|
|
854
863
|
case "comboCount":
|
|
@@ -860,9 +869,9 @@ function xt({ drivers: e, isLoading: t, getUserDisplay: r, game: s, gameVersion:
|
|
|
860
869
|
return f.rank;
|
|
861
870
|
}
|
|
862
871
|
}) : [], [e, o]);
|
|
863
|
-
if (
|
|
872
|
+
if (r) return /* @__PURE__ */ n(z, {});
|
|
864
873
|
if (!(e != null && e.length))
|
|
865
|
-
return /* @__PURE__ */ n("div", { className: "pvx-card", children: /* @__PURE__ */ n(
|
|
874
|
+
return /* @__PURE__ */ n("div", { className: "pvx-card", children: /* @__PURE__ */ n(O, { message: "Not enough data for rankings yet." }) });
|
|
866
875
|
const g = 5;
|
|
867
876
|
return /* @__PURE__ */ l("div", { className: "pvx-card", children: [
|
|
868
877
|
/* @__PURE__ */ l("div", { className: "pvx-card-header pvx-rankings-header", children: [
|
|
@@ -882,21 +891,21 @@ function xt({ drivers: e, isLoading: t, getUserDisplay: r, game: s, gameVersion:
|
|
|
882
891
|
] }),
|
|
883
892
|
/* @__PURE__ */ n("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
|
|
884
893
|
/* @__PURE__ */ n("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
|
|
885
|
-
/* @__PURE__ */ n(
|
|
894
|
+
/* @__PURE__ */ n(P, { label: "#", sortKey: "rank", config: o, onSort: d, className: "pvx-th--narrow" }),
|
|
886
895
|
/* @__PURE__ */ n("th", { className: "pvx-th", children: "Driver" }),
|
|
887
|
-
/* @__PURE__ */ n(
|
|
888
|
-
/* @__PURE__ */ n(
|
|
889
|
-
/* @__PURE__ */ n(
|
|
896
|
+
/* @__PURE__ */ n(P, { label: "Rating", sortKey: "rating", config: o, onSort: d }),
|
|
897
|
+
/* @__PURE__ */ n(P, { label: "Cars", sortKey: "distinctCars", config: o, onSort: d, className: "pvx-hidden-below-sm" }),
|
|
898
|
+
/* @__PURE__ */ n(P, { label: "Combos", sortKey: "comboCount", config: o, onSort: d, className: "pvx-hidden-below-sm" })
|
|
890
899
|
] }) }),
|
|
891
|
-
/* @__PURE__ */ n("tbody", { className: "pvx-tbody", children:
|
|
892
|
-
const
|
|
900
|
+
/* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: h.map((f) => {
|
|
901
|
+
const u = p === f.identifier;
|
|
893
902
|
return /* @__PURE__ */ n(
|
|
894
|
-
|
|
903
|
+
ln,
|
|
895
904
|
{
|
|
896
905
|
driver: f,
|
|
897
|
-
getUserDisplay:
|
|
898
|
-
isExpanded:
|
|
899
|
-
onToggle: () => c(
|
|
906
|
+
getUserDisplay: t,
|
|
907
|
+
isExpanded: u,
|
|
908
|
+
onToggle: () => c(u ? null : f.identifier),
|
|
900
909
|
colCount: g,
|
|
901
910
|
game: s,
|
|
902
911
|
gameVersion: a,
|
|
@@ -908,27 +917,27 @@ function xt({ drivers: e, isLoading: t, getUserDisplay: r, game: s, gameVersion:
|
|
|
908
917
|
] }) })
|
|
909
918
|
] });
|
|
910
919
|
}
|
|
911
|
-
function
|
|
920
|
+
function ln({ driver: e, getUserDisplay: r, isExpanded: t, onToggle: s, colCount: a, game: i, gameVersion: o, onComboSelect: d }) {
|
|
912
921
|
const p = e.identifier;
|
|
913
|
-
return /* @__PURE__ */ l(
|
|
922
|
+
return /* @__PURE__ */ l(_, { children: [
|
|
914
923
|
/* @__PURE__ */ l(
|
|
915
924
|
"tr",
|
|
916
925
|
{
|
|
917
926
|
className: `pvx-row pvx-row--clickable ${e.rank <= 3 ? "pvx-row--podium" : ""}`,
|
|
918
927
|
onClick: s,
|
|
919
928
|
children: [
|
|
920
|
-
/* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(
|
|
921
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary", children: /* @__PURE__ */ n(
|
|
929
|
+
/* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(le, { rank: e.rank, podium: !0 }) }),
|
|
930
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary", children: /* @__PURE__ */ n(J, { userId: p, getUserDisplay: r }) }),
|
|
922
931
|
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: e.rating.toFixed(1) }),
|
|
923
932
|
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: e.distinctCars || "-" }),
|
|
924
933
|
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: /* @__PURE__ */ l("span", { className: "pvx-rankings-combo-count", children: [
|
|
925
934
|
e.comboCount,
|
|
926
|
-
/* @__PURE__ */ n("svg", { className: `pvx-rankings-chevron ${
|
|
935
|
+
/* @__PURE__ */ n("svg", { className: `pvx-rankings-chevron ${t ? "pvx-rankings-chevron--open" : ""}`, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ n("path", { d: "m6 9 6 6 6-6" }) })
|
|
927
936
|
] }) })
|
|
928
937
|
]
|
|
929
938
|
}
|
|
930
939
|
),
|
|
931
|
-
|
|
940
|
+
t && e.combos && /* @__PURE__ */ n("tr", { children: /* @__PURE__ */ n("td", { colSpan: a, className: "pvx-rankings-combos-cell", children: /* @__PURE__ */ n("div", { className: "pvx-rankings-combos", children: e.combos.map((c, h) => {
|
|
932
941
|
const g = c.layout ? `${c.trackId}|${c.layout}` : c.trackId, f = d ? () => d({ track: g, car: c.carId, highlight: p, game: i, gameVersion: o }) : void 0;
|
|
933
942
|
return /* @__PURE__ */ l(
|
|
934
943
|
"div",
|
|
@@ -938,11 +947,11 @@ function sn({ driver: e, getUserDisplay: t, isExpanded: r, onToggle: s, colCount
|
|
|
938
947
|
role: f ? "button" : void 0,
|
|
939
948
|
children: [
|
|
940
949
|
/* @__PURE__ */ l("div", { className: "pvx-rankings-combo-info", children: [
|
|
941
|
-
/* @__PURE__ */ n("p", { className: "pvx-rankings-combo-track", children:
|
|
942
|
-
/* @__PURE__ */ n("p", { className: "pvx-rankings-combo-car", children:
|
|
950
|
+
/* @__PURE__ */ n("p", { className: "pvx-rankings-combo-track", children: j(c.trackId, c.layout, i) }),
|
|
951
|
+
/* @__PURE__ */ n("p", { className: "pvx-rankings-combo-car", children: A(c.carId) })
|
|
943
952
|
] }),
|
|
944
953
|
/* @__PURE__ */ l("div", { className: "pvx-rankings-combo-stats", children: [
|
|
945
|
-
/* @__PURE__ */ n("p", { className: "pvx-rankings-combo-time", children:
|
|
954
|
+
/* @__PURE__ */ n("p", { className: "pvx-rankings-combo-time", children: q(c.lapTimeMs) }),
|
|
946
955
|
/* @__PURE__ */ l("p", { className: `pvx-rankings-combo-pct ${c.percentile >= 75 ? "pvx-rankings-combo-pct--high" : c.percentile >= 50 ? "pvx-rankings-combo-pct--mid" : c.percentile >= 25 ? "pvx-rankings-combo-pct--low" : "pvx-rankings-combo-pct--bottom"}`, children: [
|
|
947
956
|
c.percentile.toFixed(0),
|
|
948
957
|
"%",
|
|
@@ -957,12 +966,12 @@ function sn({ driver: e, getUserDisplay: t, isExpanded: r, onToggle: s, colCount
|
|
|
957
966
|
] })
|
|
958
967
|
]
|
|
959
968
|
},
|
|
960
|
-
|
|
969
|
+
h
|
|
961
970
|
);
|
|
962
971
|
}) }) }) })
|
|
963
972
|
] });
|
|
964
973
|
}
|
|
965
|
-
const
|
|
974
|
+
const cn = {
|
|
966
975
|
GBR: "🇬🇧",
|
|
967
976
|
DEU: "🇩🇪",
|
|
968
977
|
NLD: "🇳🇱",
|
|
@@ -993,142 +1002,142 @@ const an = {
|
|
|
993
1002
|
RUS: "🇷🇺",
|
|
994
1003
|
TUR: "🇹🇷",
|
|
995
1004
|
KOR: "🇰🇷"
|
|
996
|
-
},
|
|
1005
|
+
}, de = ["🥇", "🥈", "🥉"], dn = {
|
|
997
1006
|
championship: "Championship",
|
|
998
1007
|
series: "Series",
|
|
999
1008
|
event: "Event",
|
|
1000
1009
|
hotlap: "Hotlap"
|
|
1001
|
-
},
|
|
1002
|
-
function
|
|
1003
|
-
const
|
|
1004
|
-
if (
|
|
1005
|
-
const r = e.match(/^PRACTICE_(\d+)$/);
|
|
1006
|
-
return r ? 100 + parseInt(r[1]) : 999;
|
|
1007
|
-
}
|
|
1008
|
-
function le(e) {
|
|
1010
|
+
}, pn = ["PRACTICE", "QUALIFYING", "RACE"];
|
|
1011
|
+
function ve(e) {
|
|
1012
|
+
const r = pn.indexOf(e);
|
|
1013
|
+
if (r >= 0) return r;
|
|
1009
1014
|
const t = e.match(/^PRACTICE_(\d+)$/);
|
|
1010
|
-
return t ?
|
|
1015
|
+
return t ? 100 + parseInt(t[1]) : 999;
|
|
1016
|
+
}
|
|
1017
|
+
function pe(e) {
|
|
1018
|
+
const r = e.match(/^PRACTICE_(\d+)$/);
|
|
1019
|
+
return r ? `P${r[1]}` : e;
|
|
1011
1020
|
}
|
|
1012
|
-
function
|
|
1021
|
+
function ue({ position: e }) {
|
|
1013
1022
|
return /* @__PURE__ */ n("span", { className: e === 1 ? "pvx-rank pvx-rank--gold" : e === 2 ? "pvx-rank pvx-rank--silver" : e === 3 ? "pvx-rank pvx-rank--bronze" : "pvx-rank", children: e });
|
|
1014
1023
|
}
|
|
1015
|
-
function
|
|
1016
|
-
const
|
|
1017
|
-
return
|
|
1024
|
+
function Z({ nation: e }) {
|
|
1025
|
+
const r = e && cn[e];
|
|
1026
|
+
return r ? /* @__PURE__ */ n("span", { className: "pvx-nation-flag", title: e, children: r }) : null;
|
|
1018
1027
|
}
|
|
1019
|
-
function
|
|
1028
|
+
function un({ sessions: e, activeSession: r, onSelect: t }) {
|
|
1020
1029
|
if (!e || e.length <= 1) return null;
|
|
1021
1030
|
const s = [...e].sort(
|
|
1022
|
-
(a, i) =>
|
|
1031
|
+
(a, i) => ve(a.type) - ve(i.type)
|
|
1023
1032
|
);
|
|
1024
1033
|
return /* @__PURE__ */ n("div", { className: "pvx-session-tabs", children: s.map((a) => /* @__PURE__ */ n(
|
|
1025
1034
|
"button",
|
|
1026
1035
|
{
|
|
1027
|
-
onClick: () =>
|
|
1028
|
-
className: `pvx-session-tab ${
|
|
1029
|
-
children:
|
|
1036
|
+
onClick: () => t(a.type),
|
|
1037
|
+
className: `pvx-session-tab ${r === a.type ? "pvx-session-tab--active" : ""}`,
|
|
1038
|
+
children: pe(a.type)
|
|
1030
1039
|
},
|
|
1031
1040
|
a.type
|
|
1032
1041
|
)) });
|
|
1033
1042
|
}
|
|
1034
|
-
function
|
|
1035
|
-
return /* @__PURE__ */ n("span", { className: `pvx-comp-badge pvx-comp-badge--${e}`, children:
|
|
1043
|
+
function hn({ type: e }) {
|
|
1044
|
+
return /* @__PURE__ */ n("span", { className: `pvx-comp-badge pvx-comp-badge--${e}`, children: dn[e] || e });
|
|
1036
1045
|
}
|
|
1037
|
-
function
|
|
1038
|
-
return /* @__PURE__ */ n("span", { className: `pvx-info-pill ${
|
|
1046
|
+
function ee({ children: e, variant: r = "default" }) {
|
|
1047
|
+
return /* @__PURE__ */ n("span", { className: `pvx-info-pill ${r !== "default" ? `pvx-info-pill--${r}` : ""}`, children: e });
|
|
1039
1048
|
}
|
|
1040
|
-
function
|
|
1049
|
+
function mn(e) {
|
|
1041
1050
|
if (!e) return "TBD";
|
|
1042
|
-
const
|
|
1043
|
-
if (isNaN(
|
|
1044
|
-
const
|
|
1045
|
-
return `${
|
|
1051
|
+
const r = new Date(e);
|
|
1052
|
+
if (isNaN(r)) return "TBD";
|
|
1053
|
+
const t = r.toLocaleDateString("en-GB", { weekday: "short", day: "numeric", month: "short" }), s = r.toLocaleTimeString("en-GB", { hour: "2-digit", minute: "2-digit" });
|
|
1054
|
+
return `${t} • ${s}`;
|
|
1046
1055
|
}
|
|
1047
|
-
function
|
|
1048
|
-
return e.reduce((
|
|
1056
|
+
function vn(e) {
|
|
1057
|
+
return e.reduce((r, t) => {
|
|
1049
1058
|
var s;
|
|
1050
|
-
return (s =
|
|
1051
|
-
const o =
|
|
1059
|
+
return (s = t.splits) != null && s.length ? r ? r.map((a, i) => {
|
|
1060
|
+
const o = t.splits[i];
|
|
1052
1061
|
return o && o < a ? o : a;
|
|
1053
|
-
}) : [...
|
|
1062
|
+
}) : [...t.splits] : r;
|
|
1054
1063
|
}, null);
|
|
1055
1064
|
}
|
|
1056
|
-
function
|
|
1065
|
+
function V({ message: e = "Loading..." }) {
|
|
1057
1066
|
return /* @__PURE__ */ n("div", { className: "pvx-loading", children: e });
|
|
1058
1067
|
}
|
|
1059
|
-
function
|
|
1068
|
+
function U({ message: e = "No data available." }) {
|
|
1060
1069
|
return /* @__PURE__ */ n("div", { className: "pvx-empty", children: /* @__PURE__ */ n("p", { children: e }) });
|
|
1061
1070
|
}
|
|
1062
|
-
const
|
|
1063
|
-
function
|
|
1064
|
-
const
|
|
1065
|
-
return
|
|
1071
|
+
const Pe = 3;
|
|
1072
|
+
function xn(e) {
|
|
1073
|
+
const r = e == null ? void 0 : e.rounds;
|
|
1074
|
+
return r != null && r.length ? e.type === "hotlap" ? r.every((t) => t.isFinalized && t.dediStatus === "completed") : r.every((t) => t.isFinalized) : !1;
|
|
1066
1075
|
}
|
|
1067
|
-
function
|
|
1068
|
-
const
|
|
1069
|
-
if (!(
|
|
1070
|
-
let
|
|
1071
|
-
for (const s of
|
|
1076
|
+
function gn(e) {
|
|
1077
|
+
const r = e == null ? void 0 : e.rounds;
|
|
1078
|
+
if (!(r != null && r.length)) return null;
|
|
1079
|
+
let t = null;
|
|
1080
|
+
for (const s of r) {
|
|
1072
1081
|
if (!s.startTime) continue;
|
|
1073
1082
|
const a = new Date(s.startTime);
|
|
1074
|
-
isNaN(a) || (!
|
|
1083
|
+
isNaN(a) || (!t || a > t) && (t = a);
|
|
1075
1084
|
}
|
|
1076
|
-
return
|
|
1085
|
+
return t;
|
|
1077
1086
|
}
|
|
1078
|
-
function
|
|
1079
|
-
if (!
|
|
1080
|
-
const
|
|
1081
|
-
if (!
|
|
1082
|
-
const s =
|
|
1083
|
-
return Date.now() -
|
|
1087
|
+
function Be(e, r = Pe) {
|
|
1088
|
+
if (!xn(e)) return "active";
|
|
1089
|
+
const t = gn(e);
|
|
1090
|
+
if (!t) return "recently-completed";
|
|
1091
|
+
const s = r * 24 * 60 * 60 * 1e3;
|
|
1092
|
+
return Date.now() - t.getTime() <= s ? "recently-completed" : "archived";
|
|
1084
1093
|
}
|
|
1085
|
-
function
|
|
1094
|
+
function wt(e, r, t = Pe) {
|
|
1086
1095
|
if (!(e != null && e.length)) return [];
|
|
1087
|
-
const s = new Set(Array.isArray(
|
|
1088
|
-
return e.filter((a) => s.has(
|
|
1096
|
+
const s = new Set(Array.isArray(r) ? r : [r]);
|
|
1097
|
+
return e.filter((a) => s.has(Be(a, t)));
|
|
1089
1098
|
}
|
|
1090
|
-
function
|
|
1091
|
-
const
|
|
1092
|
-
return Array.isArray(
|
|
1099
|
+
function fn(e, r = 3) {
|
|
1100
|
+
const t = e == null ? void 0 : e.standings;
|
|
1101
|
+
return Array.isArray(t) ? [...t].sort((s, a) => (s.position ?? 999) - (a.position ?? 999)).slice(0, r) : [];
|
|
1093
1102
|
}
|
|
1094
|
-
function
|
|
1095
|
-
const { data: a } =
|
|
1103
|
+
function Nn({ competitionId: e, topN: r = 3, label: t = "Completed", className: s }) {
|
|
1104
|
+
const { data: a } = Ce(e), i = fn(a, r);
|
|
1096
1105
|
return /* @__PURE__ */ l("div", { className: `pvx-comp-completed-badge ${s || ""}`, children: [
|
|
1097
|
-
/* @__PURE__ */ n("span", { className: "pvx-comp-completed-badge-label", children:
|
|
1106
|
+
/* @__PURE__ */ n("span", { className: "pvx-comp-completed-badge-label", children: t }),
|
|
1098
1107
|
i.length > 0 && /* @__PURE__ */ n("ol", { className: "pvx-comp-completed-badge-podium", children: i.map((o, d) => /* @__PURE__ */ l("li", { className: "pvx-comp-completed-badge-driver", children: [
|
|
1099
|
-
/* @__PURE__ */ n("span", { className: "pvx-comp-completed-badge-medal", "aria-hidden": "true", children:
|
|
1100
|
-
/* @__PURE__ */ n(
|
|
1108
|
+
/* @__PURE__ */ n("span", { className: "pvx-comp-completed-badge-medal", "aria-hidden": "true", children: de[d] || "" }),
|
|
1109
|
+
/* @__PURE__ */ n(Z, { nation: o.nation }),
|
|
1101
1110
|
/* @__PURE__ */ n("span", { className: "pvx-comp-completed-badge-name", children: o.driverName })
|
|
1102
1111
|
] }, o.driverId || d)) })
|
|
1103
1112
|
] });
|
|
1104
1113
|
}
|
|
1105
|
-
function
|
|
1106
|
-
return
|
|
1114
|
+
function Ct({ competitions: e, isLoading: r, onSelect: t, onRegister: s, className: a }) {
|
|
1115
|
+
return r ? /* @__PURE__ */ n(V, { message: "Loading competitions..." }) : e != null && e.length ? /* @__PURE__ */ n("div", { className: `pvx-comp-grid ${a || ""}`, children: e.map((i) => /* @__PURE__ */ n(bn, { comp: i, onSelect: t, onRegister: s || t }, i.id)) }) : /* @__PURE__ */ n(U, { message: "No competitions available." });
|
|
1107
1116
|
}
|
|
1108
|
-
function
|
|
1109
|
-
var
|
|
1110
|
-
const { cdnUrl: s } =
|
|
1117
|
+
function bn({ comp: e, onSelect: r, onRegister: t }) {
|
|
1118
|
+
var m, k, w;
|
|
1119
|
+
const { cdnUrl: s } = L(), a = e.posterCdnPath ? `${s}/${e.posterCdnPath}` : null, i = e.registration, o = (i == null ? void 0 : i.currentCount) || 0, d = i == null ? void 0 : i.maxParticipants, p = d && o >= d, c = (i == null ? void 0 : i.deadline) && new Date(i.deadline) < /* @__PURE__ */ new Date(), h = (i == null ? void 0 : i.isOpen) && !c && !p, g = /* @__PURE__ */ new Date(), f = (m = e.rounds) == null ? void 0 : m.find((C) => C.startTime && new Date(C.startTime) >= g), u = ((k = e.rounds) == null ? void 0 : k.length) || 0, y = ((w = e.rounds) == null ? void 0 : w.filter((C) => C.isFinalized).length) || 0, x = Be(e), v = x === "recently-completed" || x === "archived", N = e.type === "championship";
|
|
1111
1120
|
return /* @__PURE__ */ l(
|
|
1112
1121
|
"div",
|
|
1113
1122
|
{
|
|
1114
1123
|
className: "pvx-comp-card",
|
|
1115
|
-
onClick: () =>
|
|
1124
|
+
onClick: () => r(e.id),
|
|
1116
1125
|
role: "button",
|
|
1117
1126
|
tabIndex: 0,
|
|
1118
|
-
onKeyDown: (
|
|
1119
|
-
(
|
|
1127
|
+
onKeyDown: (C) => {
|
|
1128
|
+
(C.key === "Enter" || C.key === " ") && (C.preventDefault(), r(e.id));
|
|
1120
1129
|
},
|
|
1121
1130
|
children: [
|
|
1122
|
-
/* @__PURE__ */ n("div", { className: "pvx-comp-card-poster", children: a ? /* @__PURE__ */ n("img", { src: a, alt: e.name, className: "pvx-comp-card-poster-img" }) : /* @__PURE__ */ n("div", { className: "pvx-comp-card-poster-placeholder", children: /* @__PURE__ */ n(
|
|
1131
|
+
/* @__PURE__ */ n("div", { className: "pvx-comp-card-poster", children: a ? /* @__PURE__ */ n("img", { src: a, alt: e.name, className: "pvx-comp-card-poster-img" }) : /* @__PURE__ */ n("div", { className: "pvx-comp-card-poster-placeholder", children: /* @__PURE__ */ n(kn, {}) }) }),
|
|
1123
1132
|
/* @__PURE__ */ l("div", { className: "pvx-comp-card-body", children: [
|
|
1124
1133
|
/* @__PURE__ */ n("h3", { className: "pvx-comp-card-title", children: e.name }),
|
|
1125
1134
|
e.description && /* @__PURE__ */ n("p", { className: "pvx-comp-card-desc", children: e.description }),
|
|
1126
1135
|
/* @__PURE__ */ l("div", { className: "pvx-comp-card-pills", children: [
|
|
1127
|
-
/* @__PURE__ */ n(
|
|
1128
|
-
e.game && /* @__PURE__ */ n(
|
|
1129
|
-
e.formatDescription && e.formatDescription.split(", ").map((
|
|
1136
|
+
/* @__PURE__ */ n(hn, { type: e.type }),
|
|
1137
|
+
e.game && /* @__PURE__ */ n(ee, { children: e.game.toUpperCase() }),
|
|
1138
|
+
e.formatDescription && e.formatDescription.split(", ").map((C, D) => /* @__PURE__ */ n(ee, { variant: "format", children: C }, D))
|
|
1130
1139
|
] }),
|
|
1131
|
-
e.carsDescription && /* @__PURE__ */ n("div", { className: "pvx-comp-card-pills", children: e.carsDescription.split(", ").map((
|
|
1140
|
+
e.carsDescription && /* @__PURE__ */ n("div", { className: "pvx-comp-card-pills", children: e.carsDescription.split(", ").map((C, D) => /* @__PURE__ */ n(ee, { children: C }, D)) }),
|
|
1132
1141
|
/* @__PURE__ */ l("div", { className: "pvx-comp-card-schedule", children: [
|
|
1133
1142
|
f ? /* @__PURE__ */ l("span", { className: "pvx-comp-card-schedule-next", children: [
|
|
1134
1143
|
/* @__PURE__ */ n("span", { className: "pvx-comp-card-schedule-label", children: "Next:" }),
|
|
@@ -1136,30 +1145,30 @@ function gn({ comp: e, onSelect: t, onRegister: r }) {
|
|
|
1136
1145
|
e.type !== "hotlap" && `R${f.roundNumber} `,
|
|
1137
1146
|
f.track || "TBD",
|
|
1138
1147
|
" · ",
|
|
1139
|
-
|
|
1140
|
-
] }) :
|
|
1141
|
-
|
|
1148
|
+
mn(f.startTime)
|
|
1149
|
+
] }) : u > 0 ? /* @__PURE__ */ l("span", { className: "pvx-comp-card-schedule-next", children: [
|
|
1150
|
+
y,
|
|
1142
1151
|
"/",
|
|
1143
|
-
|
|
1152
|
+
u,
|
|
1144
1153
|
" rounds completed"
|
|
1145
1154
|
] }) : null,
|
|
1146
|
-
|
|
1147
|
-
|
|
1155
|
+
u > 0 && /* @__PURE__ */ l("span", { className: "pvx-comp-card-round-count", children: [
|
|
1156
|
+
u,
|
|
1148
1157
|
" round",
|
|
1149
|
-
|
|
1158
|
+
u !== 1 ? "s" : ""
|
|
1150
1159
|
] })
|
|
1151
1160
|
] }),
|
|
1152
|
-
|
|
1153
|
-
i && !
|
|
1154
|
-
|
|
1161
|
+
v && N && /* @__PURE__ */ n(Nn, { competitionId: e.id }),
|
|
1162
|
+
i && !v && /* @__PURE__ */ n(
|
|
1163
|
+
yn,
|
|
1155
1164
|
{
|
|
1156
1165
|
competitionId: e.id,
|
|
1157
|
-
regOpen:
|
|
1166
|
+
regOpen: h,
|
|
1158
1167
|
isFull: p,
|
|
1159
1168
|
deadlinePassed: c,
|
|
1160
1169
|
regCount: o,
|
|
1161
1170
|
regMax: d,
|
|
1162
|
-
onRegister:
|
|
1171
|
+
onRegister: t
|
|
1163
1172
|
}
|
|
1164
1173
|
)
|
|
1165
1174
|
] })
|
|
@@ -1167,8 +1176,8 @@ function gn({ comp: e, onSelect: t, onRegister: r }) {
|
|
|
1167
1176
|
}
|
|
1168
1177
|
);
|
|
1169
1178
|
}
|
|
1170
|
-
function
|
|
1171
|
-
const { isPowerMode: d } =
|
|
1179
|
+
function yn({ competitionId: e, regOpen: r, isFull: t, deadlinePassed: s, regCount: a, regMax: i, onRegister: o }) {
|
|
1180
|
+
const { isPowerMode: d } = ie(), p = oe(e), { data: c } = ae(e), h = (c == null ? void 0 : c.isRegistered) || !1, g = i ? a / i * 100 : 0, f = g >= 100 ? "full" : g >= 75 ? "warning" : "ok";
|
|
1172
1181
|
return /* @__PURE__ */ l("div", { className: "pvx-comp-card-reg", children: [
|
|
1173
1182
|
/* @__PURE__ */ n("div", { className: "pvx-comp-card-reg-info", children: /* @__PURE__ */ l("span", { className: `pvx-reg-capacity pvx-reg-capacity--${f}`, children: [
|
|
1174
1183
|
a,
|
|
@@ -1176,21 +1185,21 @@ function fn({ competitionId: e, regOpen: t, isFull: r, deadlinePassed: s, regCou
|
|
|
1176
1185
|
i || "∞",
|
|
1177
1186
|
" drivers"
|
|
1178
1187
|
] }) }),
|
|
1179
|
-
/* @__PURE__ */ n("div", { className: "pvx-comp-card-reg-action", children:
|
|
1188
|
+
/* @__PURE__ */ n("div", { className: "pvx-comp-card-reg-action", children: h ? /* @__PURE__ */ n(
|
|
1180
1189
|
"button",
|
|
1181
1190
|
{
|
|
1182
1191
|
className: "pvx-comp-card-reg-btn pvx-comp-card-reg-btn--registered",
|
|
1183
|
-
onClick: (
|
|
1184
|
-
|
|
1192
|
+
onClick: (u) => {
|
|
1193
|
+
u.stopPropagation(), o(e);
|
|
1185
1194
|
},
|
|
1186
1195
|
children: "✓ Registered"
|
|
1187
1196
|
}
|
|
1188
|
-
) :
|
|
1197
|
+
) : r ? d ? /* @__PURE__ */ n(
|
|
1189
1198
|
"button",
|
|
1190
1199
|
{
|
|
1191
1200
|
className: "pvx-comp-card-reg-btn pvx-comp-card-reg-btn--open",
|
|
1192
|
-
onClick: (
|
|
1193
|
-
|
|
1201
|
+
onClick: (u) => {
|
|
1202
|
+
u.stopPropagation(), o(e);
|
|
1194
1203
|
},
|
|
1195
1204
|
children: "Register"
|
|
1196
1205
|
}
|
|
@@ -1201,13 +1210,13 @@ function fn({ competitionId: e, regOpen: t, isFull: r, deadlinePassed: s, regCou
|
|
|
1201
1210
|
target: "_blank",
|
|
1202
1211
|
rel: "noopener noreferrer",
|
|
1203
1212
|
className: "pvx-comp-card-reg-btn pvx-comp-card-reg-btn--open",
|
|
1204
|
-
onClick: (
|
|
1213
|
+
onClick: (u) => u.stopPropagation(),
|
|
1205
1214
|
children: "Register"
|
|
1206
1215
|
}
|
|
1207
|
-
) : /* @__PURE__ */ n("span", { className: "pvx-comp-card-reg-btn pvx-comp-card-reg-btn--closed", children:
|
|
1216
|
+
) : /* @__PURE__ */ n("span", { className: "pvx-comp-card-reg-btn pvx-comp-card-reg-btn--closed", children: t ? "Full" : "Closed" }) })
|
|
1208
1217
|
] });
|
|
1209
1218
|
}
|
|
1210
|
-
function
|
|
1219
|
+
function kn() {
|
|
1211
1220
|
return /* @__PURE__ */ l("svg", { className: "pvx-comp-trophy-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1212
1221
|
/* @__PURE__ */ n("path", { d: "M6 9H4.5a2.5 2.5 0 0 1 0-5H6" }),
|
|
1213
1222
|
/* @__PURE__ */ n("path", { d: "M18 9h1.5a2.5 2.5 0 0 0 0-5H18" }),
|
|
@@ -1217,23 +1226,23 @@ function Nn() {
|
|
|
1217
1226
|
/* @__PURE__ */ n("path", { d: "M18 2H6v7a6 6 0 0 0 12 0V2Z" })
|
|
1218
1227
|
] });
|
|
1219
1228
|
}
|
|
1220
|
-
function
|
|
1229
|
+
function wn({ competitionId: e, className: r }) {
|
|
1221
1230
|
var d, p;
|
|
1222
|
-
const { data:
|
|
1231
|
+
const { data: t, isLoading: s } = Ce(e), { data: a, isLoading: i } = we(e);
|
|
1223
1232
|
if (s || i)
|
|
1224
|
-
return /* @__PURE__ */ n(
|
|
1225
|
-
if (!((d =
|
|
1226
|
-
return /* @__PURE__ */ n(
|
|
1233
|
+
return /* @__PURE__ */ n(V, { message: "Loading standings..." });
|
|
1234
|
+
if (!((d = t == null ? void 0 : t.standings) != null && d.length))
|
|
1235
|
+
return /* @__PURE__ */ n(U, { message: "No standings data yet. Results will appear once rounds are finalised." });
|
|
1227
1236
|
const o = ((p = a == null ? void 0 : a.rounds) == null ? void 0 : p.filter((c) => c.isFinalized)) || [];
|
|
1228
|
-
return /* @__PURE__ */ l("div", { className: `pvx-card ${
|
|
1237
|
+
return /* @__PURE__ */ l("div", { className: `pvx-card ${r || ""}`, children: [
|
|
1229
1238
|
/* @__PURE__ */ n("div", { className: "pvx-card-header--split", children: /* @__PURE__ */ l("div", { className: "pvx-card-header-left", children: [
|
|
1230
1239
|
/* @__PURE__ */ n("h3", { className: "pvx-card-title", children: "Championship Standings" }),
|
|
1231
1240
|
/* @__PURE__ */ l("span", { className: "pvx-standings-subtitle", children: [
|
|
1232
1241
|
"After ",
|
|
1233
|
-
|
|
1242
|
+
t.roundsCompleted,
|
|
1234
1243
|
" round",
|
|
1235
|
-
|
|
1236
|
-
|
|
1244
|
+
t.roundsCompleted !== 1 ? "s" : "",
|
|
1245
|
+
t.countingRounds > 0 && ` (best ${t.countingRounds} count)`
|
|
1237
1246
|
] })
|
|
1238
1247
|
] }) }),
|
|
1239
1248
|
/* @__PURE__ */ n("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
|
|
@@ -1256,8 +1265,8 @@ function bn({ competitionId: e, className: t }) {
|
|
|
1256
1265
|
c.roundNumber
|
|
1257
1266
|
))
|
|
1258
1267
|
] }) }),
|
|
1259
|
-
/* @__PURE__ */ n("tbody", { className: "pvx-tbody", children:
|
|
1260
|
-
|
|
1268
|
+
/* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: t.standings.map((c) => /* @__PURE__ */ n(
|
|
1269
|
+
Cn,
|
|
1261
1270
|
{
|
|
1262
1271
|
driver: c,
|
|
1263
1272
|
finalizedRounds: o
|
|
@@ -1267,32 +1276,32 @@ function bn({ competitionId: e, className: t }) {
|
|
|
1267
1276
|
] }) })
|
|
1268
1277
|
] });
|
|
1269
1278
|
}
|
|
1270
|
-
function
|
|
1279
|
+
function Cn({ driver: e, finalizedRounds: r }) {
|
|
1271
1280
|
var o, d, p;
|
|
1272
|
-
const
|
|
1281
|
+
const t = e.position <= 3, s = new Map(
|
|
1273
1282
|
((o = e.roundResults) == null ? void 0 : o.map((c) => [c.roundNumber, c])) || []
|
|
1274
1283
|
), a = ((d = e.roundResults) == null ? void 0 : d.filter((c) => c.position === 1).length) || 0, i = ((p = e.roundResults) == null ? void 0 : p.filter((c) => c.position <= 3).length) || 0;
|
|
1275
|
-
return /* @__PURE__ */ l("tr", { className: `pvx-row ${
|
|
1276
|
-
/* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(
|
|
1284
|
+
return /* @__PURE__ */ l("tr", { className: `pvx-row ${t ? "pvx-row--podium" : ""}`, children: [
|
|
1285
|
+
/* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(ue, { position: e.position }) }),
|
|
1277
1286
|
/* @__PURE__ */ l("td", { className: "pvx-td pvx-td--primary", children: [
|
|
1278
|
-
/* @__PURE__ */ n(
|
|
1287
|
+
/* @__PURE__ */ n(Z, { nation: e.nation }),
|
|
1279
1288
|
e.driverName
|
|
1280
1289
|
] }),
|
|
1281
1290
|
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: a || "-" }),
|
|
1282
1291
|
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: i || "-" }),
|
|
1283
1292
|
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-standings-total", children: e.totalPoints }),
|
|
1284
|
-
|
|
1285
|
-
const
|
|
1293
|
+
r.map((c) => {
|
|
1294
|
+
const h = s.get(c.roundNumber), g = h == null ? void 0 : h.dropped;
|
|
1286
1295
|
return /* @__PURE__ */ n(
|
|
1287
1296
|
"td",
|
|
1288
1297
|
{
|
|
1289
|
-
className: `pvx-td pvx-td--center pvx-hidden-below-md ${!g && (
|
|
1290
|
-
children:
|
|
1298
|
+
className: `pvx-td pvx-td--center pvx-hidden-below-md ${!g && (h == null ? void 0 : h.position) === 1 ? "pvx-standings-cell--p1" : !g && (h == null ? void 0 : h.position) === 2 ? "pvx-standings-cell--p2" : !g && (h == null ? void 0 : h.position) === 3 ? "pvx-standings-cell--p3" : ""}`,
|
|
1299
|
+
children: h ? /* @__PURE__ */ l("div", { className: `pvx-standings-round-cell ${g ? "pvx-standings-round-cell--dropped" : ""}`, children: [
|
|
1291
1300
|
/* @__PURE__ */ l("span", { className: "pvx-standings-round-pos", children: [
|
|
1292
1301
|
"P",
|
|
1293
|
-
|
|
1302
|
+
h.position
|
|
1294
1303
|
] }),
|
|
1295
|
-
/* @__PURE__ */ n("span", { className: "pvx-standings-round-pts", children:
|
|
1304
|
+
/* @__PURE__ */ n("span", { className: "pvx-standings-round-pts", children: h.points })
|
|
1296
1305
|
] }) : /* @__PURE__ */ n("span", { className: "pvx-td--muted", children: "-" })
|
|
1297
1306
|
},
|
|
1298
1307
|
c.roundNumber
|
|
@@ -1300,15 +1309,185 @@ function yn({ driver: e, finalizedRounds: t }) {
|
|
|
1300
1309
|
})
|
|
1301
1310
|
] });
|
|
1302
1311
|
}
|
|
1303
|
-
|
|
1312
|
+
const xe = [
|
|
1313
|
+
"#f59e0b",
|
|
1314
|
+
"#3b82f6",
|
|
1315
|
+
"#ef4444",
|
|
1316
|
+
"#10b981",
|
|
1317
|
+
"#8b5cf6",
|
|
1318
|
+
"#ec4899",
|
|
1319
|
+
"#06b6d4",
|
|
1320
|
+
"#f97316",
|
|
1321
|
+
"#84cc16",
|
|
1322
|
+
"#6366f1",
|
|
1323
|
+
"#14b8a6",
|
|
1324
|
+
"#e11d48",
|
|
1325
|
+
"#a855f7",
|
|
1326
|
+
"#0ea5e9",
|
|
1327
|
+
"#d946ef",
|
|
1328
|
+
"#eab308",
|
|
1329
|
+
"#22c55e",
|
|
1330
|
+
"#f43f5e",
|
|
1331
|
+
"#2dd4bf",
|
|
1332
|
+
"#fb923c",
|
|
1333
|
+
"#818cf8",
|
|
1334
|
+
"#4ade80",
|
|
1335
|
+
"#f87171",
|
|
1336
|
+
"#38bdf8"
|
|
1337
|
+
];
|
|
1338
|
+
function Ln(e, r) {
|
|
1339
|
+
return e.map((t) => ({
|
|
1340
|
+
driverName: t.driverName,
|
|
1341
|
+
carClass: t.carClass,
|
|
1342
|
+
positions: t.positions.map((s, a) => {
|
|
1343
|
+
const o = e.filter((d) => d.positions[a] != null).sort((d, p) => d.positions[a] - p.positions[a]).findIndex((d) => d.driverName === t.driverName);
|
|
1344
|
+
return o === -1 ? null : o + 1;
|
|
1345
|
+
})
|
|
1346
|
+
}));
|
|
1347
|
+
}
|
|
1348
|
+
function Sn({ title: e, drivers: r, timingPoints: t }) {
|
|
1349
|
+
const [s, a] = B(() => /* @__PURE__ */ new Set()), i = K((b) => {
|
|
1350
|
+
a((S) => {
|
|
1351
|
+
const R = new Set(S);
|
|
1352
|
+
return R.has(b) ? R.delete(b) : R.add(b), R;
|
|
1353
|
+
});
|
|
1354
|
+
}, []), { series: o, maxPos: d } = $(() => {
|
|
1355
|
+
let b = 1;
|
|
1356
|
+
return { series: r.map((R, I) => {
|
|
1357
|
+
for (const F of R.positions) F != null && F > b && (b = F);
|
|
1358
|
+
return { ...R, colour: xe[I % xe.length] };
|
|
1359
|
+
}), maxPos: b };
|
|
1360
|
+
}, [r]);
|
|
1361
|
+
if (!o.length || t.length < 2)
|
|
1362
|
+
return /* @__PURE__ */ l("div", { className: "pvx-positions-empty", children: [
|
|
1363
|
+
"No position data for ",
|
|
1364
|
+
e || "this race",
|
|
1365
|
+
"."
|
|
1366
|
+
] });
|
|
1367
|
+
const p = 800, c = 34, h = 12, g = 12, f = 22, u = 34, y = p - c - h, x = Math.max(f * (d - 1), f), v = g + x + u, N = t.length, m = (b) => c + (N === 1 ? 0 : b / (N - 1) * y), k = (b) => g + (d === 1 ? 0 : (b - 1) / (d - 1) * x), w = (b) => {
|
|
1368
|
+
const S = [];
|
|
1369
|
+
let R = [];
|
|
1370
|
+
return b.forEach((I, F) => {
|
|
1371
|
+
I == null ? R.length && (S.push(R), R = []) : R.push([m(F), k(I)]);
|
|
1372
|
+
}), R.length && S.push(R), S;
|
|
1373
|
+
}, C = s.size > 0, D = Math.ceil(N / 24);
|
|
1374
|
+
return /* @__PURE__ */ l("div", { className: "pvx-positions-chart", children: [
|
|
1375
|
+
e && /* @__PURE__ */ n("div", { className: "pvx-positions-title", children: e }),
|
|
1376
|
+
/* @__PURE__ */ l(
|
|
1377
|
+
"svg",
|
|
1378
|
+
{
|
|
1379
|
+
className: "pvx-positions-svg",
|
|
1380
|
+
viewBox: `0 0 ${p} ${v}`,
|
|
1381
|
+
preserveAspectRatio: "xMidYMid meet",
|
|
1382
|
+
role: "img",
|
|
1383
|
+
"aria-label": `Race position progression${e ? ` — ${e}` : ""}`,
|
|
1384
|
+
children: [
|
|
1385
|
+
Array.from({ length: d }, (b, S) => S + 1).map((b) => /* @__PURE__ */ l("g", { children: [
|
|
1386
|
+
/* @__PURE__ */ n(
|
|
1387
|
+
"line",
|
|
1388
|
+
{
|
|
1389
|
+
className: "pvx-positions-grid",
|
|
1390
|
+
x1: c,
|
|
1391
|
+
y1: k(b),
|
|
1392
|
+
x2: p - h,
|
|
1393
|
+
y2: k(b)
|
|
1394
|
+
}
|
|
1395
|
+
),
|
|
1396
|
+
/* @__PURE__ */ l("text", { className: "pvx-positions-axis", x: c - 6, y: k(b) + 3, textAnchor: "end", children: [
|
|
1397
|
+
"P",
|
|
1398
|
+
b
|
|
1399
|
+
] })
|
|
1400
|
+
] }, `y${b}`)),
|
|
1401
|
+
t.map((b, S) => S % D === 0 && /* @__PURE__ */ n(
|
|
1402
|
+
"text",
|
|
1403
|
+
{
|
|
1404
|
+
className: "pvx-positions-axis",
|
|
1405
|
+
x: m(S),
|
|
1406
|
+
y: v - u + 16,
|
|
1407
|
+
textAnchor: "middle",
|
|
1408
|
+
children: b.label
|
|
1409
|
+
},
|
|
1410
|
+
`x${S}`
|
|
1411
|
+
)),
|
|
1412
|
+
o.map((b) => {
|
|
1413
|
+
const S = C && !s.has(b.driverName);
|
|
1414
|
+
return /* @__PURE__ */ l("g", { opacity: S ? 0.12 : 1, children: [
|
|
1415
|
+
w(b.positions).map((R, I) => /* @__PURE__ */ n(
|
|
1416
|
+
"polyline",
|
|
1417
|
+
{
|
|
1418
|
+
fill: "none",
|
|
1419
|
+
stroke: b.colour,
|
|
1420
|
+
strokeWidth: S ? 1 : 2,
|
|
1421
|
+
points: R.map(([F, Fe]) => `${F},${Fe}`).join(" ")
|
|
1422
|
+
},
|
|
1423
|
+
I
|
|
1424
|
+
)),
|
|
1425
|
+
!S && b.positions.map((R, I) => R != null && /* @__PURE__ */ n("circle", { cx: m(I), cy: k(R), r: 2.4, fill: b.colour, children: /* @__PURE__ */ n("title", { children: `${b.driverName} — ${t[I].label}: P${R}` }) }, I))
|
|
1426
|
+
] }, b.driverName);
|
|
1427
|
+
})
|
|
1428
|
+
]
|
|
1429
|
+
}
|
|
1430
|
+
),
|
|
1431
|
+
/* @__PURE__ */ l("div", { className: "pvx-positions-legend", children: [
|
|
1432
|
+
o.map((b) => {
|
|
1433
|
+
const S = C && !s.has(b.driverName);
|
|
1434
|
+
return /* @__PURE__ */ l(
|
|
1435
|
+
"button",
|
|
1436
|
+
{
|
|
1437
|
+
type: "button",
|
|
1438
|
+
className: "pvx-positions-legend-item",
|
|
1439
|
+
style: { opacity: S ? 0.4 : 1 },
|
|
1440
|
+
onClick: () => i(b.driverName),
|
|
1441
|
+
children: [
|
|
1442
|
+
/* @__PURE__ */ n("span", { className: "pvx-positions-swatch", style: { background: b.colour } }),
|
|
1443
|
+
b.driverName
|
|
1444
|
+
]
|
|
1445
|
+
},
|
|
1446
|
+
b.driverName
|
|
1447
|
+
);
|
|
1448
|
+
}),
|
|
1449
|
+
C && /* @__PURE__ */ n(
|
|
1450
|
+
"button",
|
|
1451
|
+
{
|
|
1452
|
+
type: "button",
|
|
1453
|
+
className: "pvx-positions-legend-clear",
|
|
1454
|
+
onClick: () => a(/* @__PURE__ */ new Set()),
|
|
1455
|
+
children: "Clear"
|
|
1456
|
+
}
|
|
1457
|
+
)
|
|
1458
|
+
] })
|
|
1459
|
+
] });
|
|
1460
|
+
}
|
|
1461
|
+
function $n({ positions: e }) {
|
|
1462
|
+
const r = (e == null ? void 0 : e.timingPoints) || [], t = (e == null ? void 0 : e.drivers) || [], s = $(() => {
|
|
1463
|
+
const a = [...new Set(t.map((i) => i.carClass).filter(Boolean))];
|
|
1464
|
+
return a.length <= 1 ? [{ title: a[0] || null, drivers: t }] : a.sort().map((i) => ({
|
|
1465
|
+
title: i,
|
|
1466
|
+
drivers: Ln(
|
|
1467
|
+
t.filter((o) => o.carClass === i),
|
|
1468
|
+
r.length
|
|
1469
|
+
)
|
|
1470
|
+
}));
|
|
1471
|
+
}, [t, r.length]);
|
|
1472
|
+
return !r.length || !t.length ? /* @__PURE__ */ n("div", { className: "pvx-positions-empty", children: "No position data available for this race." }) : /* @__PURE__ */ n("div", { className: "pvx-positions", children: s.map((a, i) => /* @__PURE__ */ n(
|
|
1473
|
+
Sn,
|
|
1474
|
+
{
|
|
1475
|
+
title: s.length > 1 ? a.title : null,
|
|
1476
|
+
drivers: a.drivers,
|
|
1477
|
+
timingPoints: r
|
|
1478
|
+
},
|
|
1479
|
+
a.title || i
|
|
1480
|
+
)) });
|
|
1481
|
+
}
|
|
1482
|
+
function Lt({ competitionId: e, roundNumber: r, className: t }) {
|
|
1304
1483
|
var p;
|
|
1305
|
-
const { data: s, isLoading: a } =
|
|
1484
|
+
const { data: s, isLoading: a } = Ze(e, r);
|
|
1306
1485
|
if (a)
|
|
1307
|
-
return /* @__PURE__ */ n(
|
|
1486
|
+
return /* @__PURE__ */ n(V, { message: "Loading results..." });
|
|
1308
1487
|
if (!s)
|
|
1309
|
-
return /* @__PURE__ */ n(
|
|
1310
|
-
const o = (s.sessions || []).find((c) => c.type === "RACE"), d = (p = o == null ? void 0 : o.results) == null ? void 0 : p.filter((c) => c.position <= 3).sort((c,
|
|
1311
|
-
return /* @__PURE__ */ l("div", { className: `pvx-round-results ${
|
|
1488
|
+
return /* @__PURE__ */ n(U, { message: "No results for this round." });
|
|
1489
|
+
const o = (s.sessions || []).find((c) => c.type === "RACE"), d = (p = o == null ? void 0 : o.results) == null ? void 0 : p.filter((c) => c.position <= 3).sort((c, h) => c.position - h.position);
|
|
1490
|
+
return /* @__PURE__ */ l("div", { className: `pvx-round-results ${t || ""}`, children: [
|
|
1312
1491
|
/* @__PURE__ */ l("div", { className: "pvx-round-results-header", children: [
|
|
1313
1492
|
/* @__PURE__ */ l("div", { children: [
|
|
1314
1493
|
/* @__PURE__ */ l("h4", { className: "pvx-round-results-title", children: [
|
|
@@ -1323,87 +1502,104 @@ function Nt({ competitionId: e, roundNumber: t, className: r }) {
|
|
|
1323
1502
|
}) })
|
|
1324
1503
|
] }),
|
|
1325
1504
|
(d == null ? void 0 : d.length) > 0 && /* @__PURE__ */ n("div", { className: "pvx-round-podium-summary", children: d.map((c) => /* @__PURE__ */ l("span", { className: "pvx-round-podium-item", children: [
|
|
1326
|
-
/* @__PURE__ */ n("span", { children:
|
|
1505
|
+
/* @__PURE__ */ n("span", { children: de[c.position - 1] }),
|
|
1327
1506
|
/* @__PURE__ */ n("span", { children: c.driverName })
|
|
1328
1507
|
] }, c.driverId)) })
|
|
1329
1508
|
] }),
|
|
1330
|
-
/* @__PURE__ */ n(
|
|
1509
|
+
/* @__PURE__ */ n(he, { round: s, competitionId: e })
|
|
1331
1510
|
] });
|
|
1332
1511
|
}
|
|
1333
|
-
function
|
|
1334
|
-
var u,
|
|
1335
|
-
const [s, a] =
|
|
1512
|
+
function he({ round: e, competitionId: r, className: t }) {
|
|
1513
|
+
var u, y, x, v, N, m;
|
|
1514
|
+
const [s, a] = B(null), i = (e == null ? void 0 : e.sessions) || [];
|
|
1336
1515
|
if (!i.length)
|
|
1337
|
-
return /* @__PURE__ */ n(
|
|
1338
|
-
const { data: o } =
|
|
1339
|
-
|
|
1516
|
+
return /* @__PURE__ */ n(U, { message: "No session data for this round." });
|
|
1517
|
+
const { data: o } = nn(
|
|
1518
|
+
r,
|
|
1340
1519
|
e == null ? void 0 : e.roundNumber,
|
|
1341
1520
|
{}
|
|
1342
|
-
), d =
|
|
1343
|
-
|
|
1521
|
+
), d = i.some((k) => k.type === "RACE"), { data: p } = tn(
|
|
1522
|
+
r,
|
|
1523
|
+
e == null ? void 0 : e.roundNumber,
|
|
1524
|
+
{ enabled: !!r && d }
|
|
1525
|
+
), c = s || ((u = i.find((k) => k.type === "RACE")) == null ? void 0 : u.type) || ((y = i[0]) == null ? void 0 : y.type), h = i.find((k) => k.type === c) || i[0], g = ((v = (x = o == null ? void 0 : o.sessions) == null ? void 0 : x.find((k) => k.type === c)) == null ? void 0 : v.drivers) || null, f = (h == null ? void 0 : h.type) === "RACE" && ((N = p == null ? void 0 : p.timingPoints) == null ? void 0 : N.length) > 0 && ((m = p == null ? void 0 : p.drivers) == null ? void 0 : m.length) > 0;
|
|
1526
|
+
return /* @__PURE__ */ l("div", { className: t || "", children: [
|
|
1344
1527
|
/* @__PURE__ */ n(
|
|
1345
|
-
|
|
1528
|
+
un,
|
|
1346
1529
|
{
|
|
1347
1530
|
sessions: i,
|
|
1348
|
-
activeSession:
|
|
1531
|
+
activeSession: c,
|
|
1349
1532
|
onSelect: a
|
|
1350
1533
|
}
|
|
1351
1534
|
),
|
|
1352
|
-
/* @__PURE__ */ n(
|
|
1535
|
+
/* @__PURE__ */ n(Rn, { session: h, sessionLaps: g }),
|
|
1536
|
+
f && /* @__PURE__ */ l("div", { className: "pvx-positions-section", children: [
|
|
1537
|
+
/* @__PURE__ */ n("div", { className: "pvx-positions-section-title", children: "Race Positions" }),
|
|
1538
|
+
/* @__PURE__ */ n($n, { positions: p })
|
|
1539
|
+
] })
|
|
1353
1540
|
] });
|
|
1354
1541
|
}
|
|
1355
|
-
function
|
|
1356
|
-
var
|
|
1357
|
-
const
|
|
1358
|
-
if (!((
|
|
1359
|
-
return /* @__PURE__ */ n(
|
|
1360
|
-
const i =
|
|
1542
|
+
function Rn({ session: e, sessionLaps: r }) {
|
|
1543
|
+
var h;
|
|
1544
|
+
const t = e.type === "RACE", [s, a] = B(null);
|
|
1545
|
+
if (!((h = e.results) != null && h.length))
|
|
1546
|
+
return /* @__PURE__ */ n(U, { message: `No results for ${e.type}.` });
|
|
1547
|
+
const i = vn(e.results), o = t ? 7 : 4, d = [...new Set(e.results.map((g) => g.carClass).filter(Boolean))], p = d.length > 1, c = (g, f, u) => {
|
|
1548
|
+
var v;
|
|
1549
|
+
const y = (v = r == null ? void 0 : r[g.driverId]) == null ? void 0 : v.laps, x = s === g.driverId && !!y;
|
|
1550
|
+
return /* @__PURE__ */ n(
|
|
1551
|
+
Tn,
|
|
1552
|
+
{
|
|
1553
|
+
result: g,
|
|
1554
|
+
isRace: t,
|
|
1555
|
+
fastestSplits: i,
|
|
1556
|
+
rowIndex: f,
|
|
1557
|
+
displayPosition: u,
|
|
1558
|
+
hasLapDetail: !!y,
|
|
1559
|
+
isExpanded: x,
|
|
1560
|
+
onToggle: () => a(x ? null : g.driverId),
|
|
1561
|
+
driverLaps: x ? y : null,
|
|
1562
|
+
colCount: o
|
|
1563
|
+
},
|
|
1564
|
+
g.driverId || f
|
|
1565
|
+
);
|
|
1566
|
+
};
|
|
1361
1567
|
return /* @__PURE__ */ n("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
|
|
1362
1568
|
/* @__PURE__ */ n("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
|
|
1363
1569
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-th--narrow", children: "Pos" }),
|
|
1364
1570
|
/* @__PURE__ */ n("th", { className: "pvx-th", children: "Driver" }),
|
|
1365
1571
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "Car" }),
|
|
1366
1572
|
/* @__PURE__ */ n("th", { className: "pvx-th", children: "Best Lap" }),
|
|
1367
|
-
|
|
1573
|
+
t && /* @__PURE__ */ l(_, { children: [
|
|
1368
1574
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "Laps" }),
|
|
1369
1575
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "Time / Gap" }),
|
|
1370
1576
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-th--center", children: "Points" })
|
|
1371
1577
|
] })
|
|
1372
1578
|
] }) }),
|
|
1373
|
-
/* @__PURE__ */ n("tbody", { className: "pvx-tbody", children:
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
rowIndex: c,
|
|
1383
|
-
hasLapDetail: !!u,
|
|
1384
|
-
isExpanded: g,
|
|
1385
|
-
onToggle: () => a(g ? null : p.driverId),
|
|
1386
|
-
driverLaps: g ? u : null,
|
|
1387
|
-
colCount: o
|
|
1388
|
-
},
|
|
1389
|
-
p.driverId || c
|
|
1390
|
-
);
|
|
1391
|
-
}) })
|
|
1579
|
+
/* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: p ? d.sort().map((g) => {
|
|
1580
|
+
const f = e.results.filter((u) => u.carClass === g).sort((u, y) => (u.classPosition ?? u.position) - (y.classPosition ?? y.position));
|
|
1581
|
+
return [
|
|
1582
|
+
/* @__PURE__ */ n("tr", { className: "pvx-row pvx-row--class-header", children: /* @__PURE__ */ n("td", { colSpan: o, className: "pvx-td pvx-td--class-header", children: g }) }, `hdr-${g}`),
|
|
1583
|
+
...f.map(
|
|
1584
|
+
(u, y) => c(u, y, u.classPosition ?? u.position)
|
|
1585
|
+
)
|
|
1586
|
+
];
|
|
1587
|
+
}) : e.results.map((g, f) => c(g, f)) })
|
|
1392
1588
|
] }) });
|
|
1393
1589
|
}
|
|
1394
|
-
function
|
|
1395
|
-
const
|
|
1396
|
-
return /* @__PURE__ */ l(
|
|
1590
|
+
function Tn({ result: e, isRace: r, fastestSplits: t, rowIndex: s, displayPosition: a, hasLapDetail: i, isExpanded: o, onToggle: d, driverLaps: p, colCount: c }) {
|
|
1591
|
+
const h = a ?? e.position, g = h <= 3;
|
|
1592
|
+
return /* @__PURE__ */ l(_, { children: [
|
|
1397
1593
|
/* @__PURE__ */ l(
|
|
1398
1594
|
"tr",
|
|
1399
1595
|
{
|
|
1400
|
-
className: `pvx-row ${
|
|
1401
|
-
onClick:
|
|
1402
|
-
style:
|
|
1596
|
+
className: `pvx-row ${g ? "pvx-row--podium" : ""} ${i ? "pvx-row--expandable" : ""}`,
|
|
1597
|
+
onClick: i ? d : void 0,
|
|
1598
|
+
style: i ? { cursor: "pointer" } : void 0,
|
|
1403
1599
|
children: [
|
|
1404
|
-
/* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(
|
|
1600
|
+
/* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(ue, { position: h }) }),
|
|
1405
1601
|
/* @__PURE__ */ l("td", { className: "pvx-td pvx-td--primary", children: [
|
|
1406
|
-
/* @__PURE__ */ n(
|
|
1602
|
+
/* @__PURE__ */ n(Z, { nation: e.nation }),
|
|
1407
1603
|
e.driverName,
|
|
1408
1604
|
e.carNumber != null && /* @__PURE__ */ l("span", { className: "pvx-car-number", children: [
|
|
1409
1605
|
"#",
|
|
@@ -1411,18 +1607,18 @@ function wn({ result: e, isRace: t, fastestSplits: r, rowIndex: s, hasLapDetail:
|
|
|
1411
1607
|
] }),
|
|
1412
1608
|
e.penalty && /* @__PURE__ */ n("span", { className: "pvx-penalty", children: e.penalty })
|
|
1413
1609
|
] }),
|
|
1414
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-sm", children:
|
|
1610
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-sm", children: A(e.carId) }),
|
|
1415
1611
|
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--mono", children: /* @__PURE__ */ n(
|
|
1416
|
-
|
|
1612
|
+
Dn,
|
|
1417
1613
|
{
|
|
1418
1614
|
bestLap: e.bestLapFormatted,
|
|
1419
1615
|
hasBestLap: e.hasBestLap,
|
|
1420
1616
|
splits: e.splits,
|
|
1421
|
-
fastestSplits:
|
|
1617
|
+
fastestSplits: t,
|
|
1422
1618
|
showAbove: s <= 1
|
|
1423
1619
|
}
|
|
1424
1620
|
) }),
|
|
1425
|
-
|
|
1621
|
+
r && /* @__PURE__ */ l(_, { children: [
|
|
1426
1622
|
/* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-sm", children: e.lapsCompleted }),
|
|
1427
1623
|
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--mono pvx-td--muted pvx-hidden-below-sm", children: e.position === 1 ? e.totalTime || "-" : e.gap || "-" }),
|
|
1428
1624
|
/* @__PURE__ */ l("td", { className: "pvx-td pvx-td--center", children: [
|
|
@@ -1438,11 +1634,11 @@ function wn({ result: e, isRace: t, fastestSplits: r, rowIndex: s, hasLapDetail:
|
|
|
1438
1634
|
]
|
|
1439
1635
|
}
|
|
1440
1636
|
),
|
|
1441
|
-
|
|
1637
|
+
o && p && /* @__PURE__ */ n("tr", { className: "pvx-row pvx-row--lap-detail", children: /* @__PURE__ */ n("td", { colSpan: c, className: "pvx-td pvx-td--lap-detail", children: /* @__PURE__ */ n(Mn, { laps: p }) }) })
|
|
1442
1638
|
] });
|
|
1443
1639
|
}
|
|
1444
|
-
function
|
|
1445
|
-
const
|
|
1640
|
+
function Mn({ laps: e }) {
|
|
1641
|
+
const r = Math.min(...e.filter((t) => t.valid && t.timeMs > 0).map((t) => t.timeMs));
|
|
1446
1642
|
return /* @__PURE__ */ l("table", { className: "pvx-table pvx-table--laps", children: [
|
|
1447
1643
|
/* @__PURE__ */ n("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
|
|
1448
1644
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-th--narrow", children: "Lap" }),
|
|
@@ -1451,22 +1647,22 @@ function Cn({ laps: e }) {
|
|
|
1451
1647
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "S2" }),
|
|
1452
1648
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "S3" })
|
|
1453
1649
|
] }) }),
|
|
1454
|
-
/* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: e.map((
|
|
1650
|
+
/* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: e.map((t) => {
|
|
1455
1651
|
var a;
|
|
1456
|
-
const s =
|
|
1457
|
-
return /* @__PURE__ */ l("tr", { className: `pvx-row ${
|
|
1458
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted", children:
|
|
1459
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--mono", children:
|
|
1460
|
-
(
|
|
1461
|
-
Array.from({ length: Math.max(0, 3 - (((a =
|
|
1462
|
-
] },
|
|
1652
|
+
const s = t.valid && t.timeMs === r;
|
|
1653
|
+
return /* @__PURE__ */ l("tr", { className: `pvx-row ${t.valid ? "" : "pvx-row--invalid"} ${s ? "pvx-row--fastest" : ""}`, children: [
|
|
1654
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted", children: t.lap }),
|
|
1655
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--mono", children: t.time }),
|
|
1656
|
+
(t.splits || []).map((i, o) => /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--mono pvx-td--muted pvx-hidden-below-sm", children: i }, o)),
|
|
1657
|
+
Array.from({ length: Math.max(0, 3 - (((a = t.splits) == null ? void 0 : a.length) || 0)) }).map((i, o) => /* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-sm" }, `pad-${o}`))
|
|
1658
|
+
] }, t.lap);
|
|
1463
1659
|
}) })
|
|
1464
1660
|
] });
|
|
1465
1661
|
}
|
|
1466
|
-
function
|
|
1467
|
-
return e ? /* @__PURE__ */ l("span", { className: `pvx-best-lap-cell ${
|
|
1662
|
+
function Dn({ bestLap: e, hasBestLap: r, splits: t, fastestSplits: s, showAbove: a }) {
|
|
1663
|
+
return e ? /* @__PURE__ */ l("span", { className: `pvx-best-lap-cell ${r ? "pvx-best-lap-cell--fastest" : ""}`, children: [
|
|
1468
1664
|
/* @__PURE__ */ n("span", { className: "pvx-best-lap-time", children: e }),
|
|
1469
|
-
(
|
|
1665
|
+
(t == null ? void 0 : t.length) > 0 && /* @__PURE__ */ n("span", { className: "pvx-splits-tooltip-anchor", children: /* @__PURE__ */ n("span", { className: `pvx-splits-tooltip ${a ? "" : "pvx-splits-tooltip--above"}`, children: t.map((i, o) => {
|
|
1470
1666
|
const d = s && i === s[o];
|
|
1471
1667
|
return /* @__PURE__ */ l("span", { className: "pvx-splits-tooltip-row", children: [
|
|
1472
1668
|
/* @__PURE__ */ l("span", { className: "pvx-splits-tooltip-label", children: [
|
|
@@ -1478,13 +1674,13 @@ function Ln({ bestLap: e, hasBestLap: t, splits: r, fastestSplits: s, showAbove:
|
|
|
1478
1674
|
}) }) })
|
|
1479
1675
|
] }) : /* @__PURE__ */ n("span", { className: "pvx-td--muted", children: "-" });
|
|
1480
1676
|
}
|
|
1481
|
-
function
|
|
1482
|
-
const { getSteamId:
|
|
1677
|
+
function St({ competitionId: e, className: r }) {
|
|
1678
|
+
const { getSteamId: t } = L(), { data: s, isLoading: a } = Le(e), i = t();
|
|
1483
1679
|
if (a)
|
|
1484
|
-
return /* @__PURE__ */ n(
|
|
1680
|
+
return /* @__PURE__ */ n(V, { message: "Loading drivers..." });
|
|
1485
1681
|
const o = (s == null ? void 0 : s.drivers) || (s == null ? void 0 : s.entries) || [];
|
|
1486
|
-
return o.length ? /* @__PURE__ */ n("div", { className: `pvx-entry-grid ${
|
|
1487
|
-
var c,
|
|
1682
|
+
return o.length ? /* @__PURE__ */ n("div", { className: `pvx-entry-grid ${r || ""}`, children: o.map((d) => {
|
|
1683
|
+
var c, h;
|
|
1488
1684
|
const p = i && d.steamId === i;
|
|
1489
1685
|
return /* @__PURE__ */ l("div", { className: `pvx-entry-card ${p ? "pvx-entry-card--you" : ""}`, children: [
|
|
1490
1686
|
d.avatarUrl ? /* @__PURE__ */ n(
|
|
@@ -1494,32 +1690,32 @@ function bt({ competitionId: e, className: t }) {
|
|
|
1494
1690
|
alt: "",
|
|
1495
1691
|
className: "pvx-entry-avatar"
|
|
1496
1692
|
}
|
|
1497
|
-
) : /* @__PURE__ */ n("div", { className: "pvx-entry-avatar pvx-entry-avatar--placeholder", children: ((
|
|
1693
|
+
) : /* @__PURE__ */ n("div", { className: "pvx-entry-avatar pvx-entry-avatar--placeholder", children: ((h = (c = d.displayName) == null ? void 0 : c.charAt(0)) == null ? void 0 : h.toUpperCase()) || "?" }),
|
|
1498
1694
|
/* @__PURE__ */ l("span", { className: "pvx-entry-name", children: [
|
|
1499
1695
|
d.displayName,
|
|
1500
1696
|
p && /* @__PURE__ */ n("span", { className: "pvx-entry-you", children: " (you)" })
|
|
1501
1697
|
] })
|
|
1502
1698
|
] }, d.steamId || d.driverId);
|
|
1503
|
-
}) }) : /* @__PURE__ */ n(
|
|
1699
|
+
}) }) : /* @__PURE__ */ n(U, { message: "No drivers registered yet." });
|
|
1504
1700
|
}
|
|
1505
|
-
function
|
|
1701
|
+
function $t({
|
|
1506
1702
|
competitionId: e,
|
|
1507
|
-
driverData:
|
|
1508
|
-
className:
|
|
1703
|
+
driverData: r,
|
|
1704
|
+
className: t,
|
|
1509
1705
|
children: s
|
|
1510
1706
|
}) {
|
|
1511
|
-
const { data: a, isLoading: i } =
|
|
1512
|
-
o && p.mutate(
|
|
1513
|
-
},
|
|
1707
|
+
const { data: a, isLoading: i } = ae(e), { isPowerMode: o } = ie(), d = oe(e), p = Se(e), c = $e(e), h = (a == null ? void 0 : a.isRegistered) || !1, g = i || p.isPending || c.isPending, f = p.error || c.error || null, u = () => {
|
|
1708
|
+
o && p.mutate(r || {});
|
|
1709
|
+
}, y = () => {
|
|
1514
1710
|
o && c.mutate();
|
|
1515
1711
|
};
|
|
1516
|
-
return typeof s == "function" ? s({ isRegistered:
|
|
1712
|
+
return typeof s == "function" ? s({ isRegistered: h, isLoading: g, register: u, withdraw: y, error: f, isPowerMode: o, registrationUrl: d }) : o ? /* @__PURE__ */ n(
|
|
1517
1713
|
"button",
|
|
1518
1714
|
{
|
|
1519
|
-
className: `pvx-comp-register-btn ${
|
|
1520
|
-
onClick:
|
|
1715
|
+
className: `pvx-comp-register-btn ${t || ""}`,
|
|
1716
|
+
onClick: h ? y : u,
|
|
1521
1717
|
disabled: g,
|
|
1522
|
-
children: g ? "Loading..." :
|
|
1718
|
+
children: g ? "Loading..." : h ? "Withdraw" : "Register"
|
|
1523
1719
|
}
|
|
1524
1720
|
) : /* @__PURE__ */ n(
|
|
1525
1721
|
"a",
|
|
@@ -1527,51 +1723,51 @@ function yt({
|
|
|
1527
1723
|
href: d,
|
|
1528
1724
|
target: "_blank",
|
|
1529
1725
|
rel: "noopener noreferrer",
|
|
1530
|
-
className: `pvx-comp-register-link ${
|
|
1531
|
-
children:
|
|
1726
|
+
className: `pvx-comp-register-link ${t || ""}`,
|
|
1727
|
+
children: h ? "View Registration" : "Register on PitVox"
|
|
1532
1728
|
}
|
|
1533
1729
|
);
|
|
1534
1730
|
}
|
|
1535
|
-
function
|
|
1536
|
-
const { getSteamId: a } =
|
|
1537
|
-
return p ||
|
|
1538
|
-
|
|
1731
|
+
function Rt({ competitionId: e, registration: r, onWithdrawSuccess: t, className: s }) {
|
|
1732
|
+
const { getSteamId: a } = L(), { isPowerMode: i } = ie(), o = oe(e), { data: d, isLoading: p } = ae(e), { data: c, isLoading: h } = Le(e), g = Se(e), f = $e(e), u = a(), y = (d == null ? void 0 : d.isRegistered) || !1, x = (c == null ? void 0 : c.drivers) || (c == null ? void 0 : c.entries) || [], v = r || {}, N = x.length || v.currentCount || 0, m = v.maxParticipants && N >= v.maxParticipants, k = v.deadline && new Date(v.deadline) < /* @__PURE__ */ new Date(), w = v.isOpen && !k && !m;
|
|
1733
|
+
return p || h ? /* @__PURE__ */ n(V, { message: "Loading registration..." }) : y ? /* @__PURE__ */ n("div", { className: `pvx-reg-panel ${s || ""}`, children: /* @__PURE__ */ n(
|
|
1734
|
+
Bn,
|
|
1539
1735
|
{
|
|
1540
1736
|
competitionId: e,
|
|
1541
1737
|
drivers: x,
|
|
1542
|
-
steamId:
|
|
1738
|
+
steamId: u,
|
|
1543
1739
|
isPowerMode: i,
|
|
1544
1740
|
registrationUrl: o,
|
|
1545
1741
|
withdrawMutation: f,
|
|
1546
|
-
onWithdrawSuccess:
|
|
1547
|
-
registration:
|
|
1742
|
+
onWithdrawSuccess: t,
|
|
1743
|
+
registration: v
|
|
1548
1744
|
}
|
|
1549
|
-
) }) :
|
|
1550
|
-
|
|
1745
|
+
) }) : w ? u ? i ? /* @__PURE__ */ n("div", { className: `pvx-reg-panel ${s || ""}`, children: /* @__PURE__ */ n(
|
|
1746
|
+
Pn,
|
|
1551
1747
|
{
|
|
1552
1748
|
competitionId: e,
|
|
1553
1749
|
registerMutation: g,
|
|
1554
|
-
registration:
|
|
1750
|
+
registration: v
|
|
1555
1751
|
}
|
|
1556
1752
|
) }) : /* @__PURE__ */ n("div", { className: `pvx-reg-panel ${s || ""}`, children: /* @__PURE__ */ n("a", { href: o, target: "_blank", rel: "noopener noreferrer", className: "pvx-comp-register-link", children: "Register on PitVox" }) }) : /* @__PURE__ */ n("div", { className: `pvx-reg-panel ${s || ""}`, children: i ? /* @__PURE__ */ n("div", { className: "pvx-reg-status-msg", children: "Sign in to register for this competition." }) : /* @__PURE__ */ n("div", { className: "pvx-reg-status-msg", children: /* @__PURE__ */ n("a", { href: o, target: "_blank", rel: "noopener noreferrer", className: "pvx-comp-register-link", children: "Register on PitVox" }) }) }) : /* @__PURE__ */ l("div", { className: `pvx-reg-panel ${s || ""}`, children: [
|
|
1557
|
-
/* @__PURE__ */ n("div", { className: "pvx-reg-status-msg", children:
|
|
1558
|
-
x.length > 0 && /* @__PURE__ */ n(
|
|
1753
|
+
/* @__PURE__ */ n("div", { className: "pvx-reg-status-msg", children: m ? "Registration is full." : k ? "Registration deadline has passed." : "Registration is closed." }),
|
|
1754
|
+
x.length > 0 && /* @__PURE__ */ n(Ae, { drivers: x, steamId: u })
|
|
1559
1755
|
] });
|
|
1560
1756
|
}
|
|
1561
|
-
function
|
|
1562
|
-
const [s, a] =
|
|
1563
|
-
|
|
1757
|
+
function Pn({ competitionId: e, registerMutation: r, registration: t }) {
|
|
1758
|
+
const [s, a] = B(""), [i, o] = B("intermediate"), [d, p] = B(""), c = (u) => {
|
|
1759
|
+
u.preventDefault(), r.mutate({
|
|
1564
1760
|
discordUsername: s || void 0,
|
|
1565
1761
|
experience: i,
|
|
1566
1762
|
comments: d || void 0
|
|
1567
1763
|
});
|
|
1568
|
-
},
|
|
1764
|
+
}, h = t || {}, g = h.currentCount || 0, f = h.maxParticipants;
|
|
1569
1765
|
return /* @__PURE__ */ l("form", { className: "pvx-reg-form", onSubmit: c, children: [
|
|
1570
1766
|
/* @__PURE__ */ l("div", { className: "pvx-reg-form-header", children: [
|
|
1571
1767
|
/* @__PURE__ */ n("h3", { className: "pvx-reg-form-title", children: "Register" }),
|
|
1572
|
-
f && /* @__PURE__ */ n(
|
|
1768
|
+
f && /* @__PURE__ */ n(Ie, { count: g, max: f })
|
|
1573
1769
|
] }),
|
|
1574
|
-
|
|
1770
|
+
r.error && /* @__PURE__ */ n("div", { className: "pvx-reg-error", children: r.error.message || "Registration failed" }),
|
|
1575
1771
|
/* @__PURE__ */ l("div", { className: "pvx-reg-field", children: [
|
|
1576
1772
|
/* @__PURE__ */ l("label", { className: "pvx-reg-label", htmlFor: `pvx-discord-${e}`, children: [
|
|
1577
1773
|
"Discord Username ",
|
|
@@ -1585,7 +1781,7 @@ function Sn({ competitionId: e, registerMutation: t, registration: r }) {
|
|
|
1585
1781
|
className: "pvx-reg-input",
|
|
1586
1782
|
placeholder: "e.g. username",
|
|
1587
1783
|
value: s,
|
|
1588
|
-
onChange: (
|
|
1784
|
+
onChange: (u) => a(u.target.value)
|
|
1589
1785
|
}
|
|
1590
1786
|
)
|
|
1591
1787
|
] }),
|
|
@@ -1597,7 +1793,7 @@ function Sn({ competitionId: e, registerMutation: t, registration: r }) {
|
|
|
1597
1793
|
id: `pvx-exp-${e}`,
|
|
1598
1794
|
className: "pvx-reg-select",
|
|
1599
1795
|
value: i,
|
|
1600
|
-
onChange: (
|
|
1796
|
+
onChange: (u) => o(u.target.value),
|
|
1601
1797
|
children: [
|
|
1602
1798
|
/* @__PURE__ */ n("option", { value: "beginner", children: "Beginner" }),
|
|
1603
1799
|
/* @__PURE__ */ n("option", { value: "intermediate", children: "Intermediate" }),
|
|
@@ -1619,7 +1815,7 @@ function Sn({ competitionId: e, registerMutation: t, registration: r }) {
|
|
|
1619
1815
|
rows: 3,
|
|
1620
1816
|
placeholder: "Anything the organisers should know?",
|
|
1621
1817
|
value: d,
|
|
1622
|
-
onChange: (
|
|
1818
|
+
onChange: (u) => p(u.target.value)
|
|
1623
1819
|
}
|
|
1624
1820
|
)
|
|
1625
1821
|
] }),
|
|
@@ -1628,26 +1824,26 @@ function Sn({ competitionId: e, registerMutation: t, registration: r }) {
|
|
|
1628
1824
|
{
|
|
1629
1825
|
type: "submit",
|
|
1630
1826
|
className: "pvx-comp-register-btn",
|
|
1631
|
-
disabled:
|
|
1632
|
-
children:
|
|
1827
|
+
disabled: r.isPending,
|
|
1828
|
+
children: r.isPending ? "Registering..." : "Register"
|
|
1633
1829
|
}
|
|
1634
1830
|
) })
|
|
1635
1831
|
] });
|
|
1636
1832
|
}
|
|
1637
|
-
function
|
|
1638
|
-
const [p, c] =
|
|
1833
|
+
function Bn({ competitionId: e, drivers: r, steamId: t, isPowerMode: s, registrationUrl: a, withdrawMutation: i, onWithdrawSuccess: o, registration: d }) {
|
|
1834
|
+
const [p, c] = B(!1), h = () => {
|
|
1639
1835
|
i.mutate(void 0, {
|
|
1640
1836
|
onSuccess: () => {
|
|
1641
1837
|
c(!1), o && o();
|
|
1642
1838
|
}
|
|
1643
1839
|
});
|
|
1644
|
-
}, g = d || {}, f =
|
|
1645
|
-
return /* @__PURE__ */ l(
|
|
1840
|
+
}, g = d || {}, f = r.length || g.currentCount || 0, u = g.maxParticipants;
|
|
1841
|
+
return /* @__PURE__ */ l(_, { children: [
|
|
1646
1842
|
/* @__PURE__ */ l("div", { className: "pvx-reg-form-header", children: [
|
|
1647
1843
|
/* @__PURE__ */ n("h3", { className: "pvx-reg-form-title", children: "Registered Drivers" }),
|
|
1648
|
-
|
|
1844
|
+
u && /* @__PURE__ */ n(Ie, { count: f, max: u })
|
|
1649
1845
|
] }),
|
|
1650
|
-
/* @__PURE__ */ n(
|
|
1846
|
+
/* @__PURE__ */ n(Ae, { drivers: r, steamId: t }),
|
|
1651
1847
|
i.error && /* @__PURE__ */ n("div", { className: "pvx-reg-error", children: i.error.message || "Withdrawal failed" }),
|
|
1652
1848
|
s ? /* @__PURE__ */ n("div", { className: "pvx-reg-actions", children: p ? /* @__PURE__ */ l("div", { className: "pvx-reg-confirm", children: [
|
|
1653
1849
|
/* @__PURE__ */ n("p", { className: "pvx-reg-confirm-text", children: "Are you sure you want to unregister?" }),
|
|
@@ -1666,7 +1862,7 @@ function Tn({ competitionId: e, drivers: t, steamId: r, isPowerMode: s, registra
|
|
|
1666
1862
|
{
|
|
1667
1863
|
type: "button",
|
|
1668
1864
|
className: "pvx-reg-danger-btn",
|
|
1669
|
-
onClick:
|
|
1865
|
+
onClick: h,
|
|
1670
1866
|
disabled: i.isPending,
|
|
1671
1867
|
children: i.isPending ? "Unregistering..." : "Yes, Unregister"
|
|
1672
1868
|
}
|
|
@@ -1683,16 +1879,16 @@ function Tn({ competitionId: e, drivers: t, steamId: r, isPowerMode: s, registra
|
|
|
1683
1879
|
) }) : /* @__PURE__ */ n("div", { className: "pvx-reg-actions", children: /* @__PURE__ */ n("a", { href: a, target: "_blank", rel: "noopener noreferrer", className: "pvx-comp-register-link", children: "Manage on PitVox" }) })
|
|
1684
1880
|
] });
|
|
1685
1881
|
}
|
|
1686
|
-
function
|
|
1882
|
+
function Ae({ drivers: e, steamId: r }) {
|
|
1687
1883
|
if (!e.length)
|
|
1688
1884
|
return /* @__PURE__ */ n("div", { className: "pvx-reg-no-drivers", children: "No drivers registered yet." });
|
|
1689
|
-
const
|
|
1690
|
-
const i =
|
|
1885
|
+
const t = [...e].sort((s, a) => {
|
|
1886
|
+
const i = r && s.steamId === r ? -1 : 0, o = r && a.steamId === r ? -1 : 0;
|
|
1691
1887
|
return i - o;
|
|
1692
1888
|
});
|
|
1693
|
-
return /* @__PURE__ */ n("div", { className: "pvx-reg-driver-list", children:
|
|
1889
|
+
return /* @__PURE__ */ n("div", { className: "pvx-reg-driver-list", children: t.map((s) => {
|
|
1694
1890
|
var i, o;
|
|
1695
|
-
const a =
|
|
1891
|
+
const a = r && s.steamId === r;
|
|
1696
1892
|
return /* @__PURE__ */ l(
|
|
1697
1893
|
"div",
|
|
1698
1894
|
{
|
|
@@ -1709,73 +1905,73 @@ function De({ drivers: e, steamId: t }) {
|
|
|
1709
1905
|
);
|
|
1710
1906
|
}) });
|
|
1711
1907
|
}
|
|
1712
|
-
function
|
|
1713
|
-
const
|
|
1908
|
+
function Ie({ count: e, max: r }) {
|
|
1909
|
+
const t = r ? e / r * 100 : 0, s = t >= 100 ? "full" : t >= 75 ? "warning" : "ok";
|
|
1714
1910
|
return /* @__PURE__ */ l("span", { className: `pvx-reg-capacity pvx-reg-capacity--${s}`, children: [
|
|
1715
1911
|
e,
|
|
1716
1912
|
"/",
|
|
1717
|
-
|
|
1913
|
+
r,
|
|
1718
1914
|
" drivers"
|
|
1719
1915
|
] });
|
|
1720
1916
|
}
|
|
1721
|
-
function
|
|
1722
|
-
const { data:
|
|
1917
|
+
function Tt({ competitionId: e, className: r }) {
|
|
1918
|
+
const { data: t, isLoading: s } = we(e), a = (t == null ? void 0 : t.type) === "championship", i = (t == null ? void 0 : t.type) === "hotlap", { data: o } = en(i ? e : null), d = $(
|
|
1723
1919
|
() => {
|
|
1724
|
-
var
|
|
1725
|
-
return ((
|
|
1920
|
+
var w;
|
|
1921
|
+
return ((w = t == null ? void 0 : t.rounds) == null ? void 0 : w.filter((C) => C.isFinalized)) || [];
|
|
1726
1922
|
},
|
|
1727
|
-
[
|
|
1728
|
-
), p =
|
|
1729
|
-
() => d.map((
|
|
1923
|
+
[t]
|
|
1924
|
+
), p = $(
|
|
1925
|
+
() => d.map((w) => w.roundNumber),
|
|
1730
1926
|
[d]
|
|
1731
|
-
), { data: c = [], isLoading:
|
|
1927
|
+
), { data: c = [], isLoading: h } = Xe(
|
|
1732
1928
|
e,
|
|
1733
1929
|
p
|
|
1734
|
-
), g = i && c.length > 0 ? c[0] : null, f = (g == null ? void 0 : g.sessions) || [],
|
|
1735
|
-
if (s ||
|
|
1736
|
-
return /* @__PURE__ */ n(
|
|
1737
|
-
if (!
|
|
1738
|
-
return /* @__PURE__ */ n(
|
|
1930
|
+
), g = i && c.length > 0 ? c[0] : null, f = (g == null ? void 0 : g.sessions) || [], u = i ? "leaderboard" : a ? "standings" : p.length > 0 ? `round-${p[p.length - 1]}` : null, [y, x] = B(null), v = y || u;
|
|
1931
|
+
if (s || h)
|
|
1932
|
+
return /* @__PURE__ */ n(V, { message: "Loading results..." });
|
|
1933
|
+
if (!t)
|
|
1934
|
+
return /* @__PURE__ */ n(U, { message: "Competition not found." });
|
|
1739
1935
|
if (!d.length)
|
|
1740
|
-
return /* @__PURE__ */ n(
|
|
1741
|
-
const N = new Map(c.map((
|
|
1742
|
-
if (a &&
|
|
1743
|
-
|
|
1744
|
-
for (const
|
|
1745
|
-
|
|
1936
|
+
return /* @__PURE__ */ n(U, { message: "No results available yet. Results will appear here once rounds are finalised." });
|
|
1937
|
+
const N = new Map(c.map((w) => [`round-${w.roundNumber}`, w])), m = [];
|
|
1938
|
+
if (a && m.push({ id: "standings", label: "Standings" }), i) {
|
|
1939
|
+
m.push({ id: "leaderboard", label: "Leaderboard" });
|
|
1940
|
+
for (const w of f)
|
|
1941
|
+
m.push({ id: `session-${w.type}`, label: pe(w.type) });
|
|
1746
1942
|
} else
|
|
1747
|
-
for (const
|
|
1748
|
-
|
|
1749
|
-
id: `round-${
|
|
1750
|
-
label: `R${
|
|
1943
|
+
for (const w of d)
|
|
1944
|
+
m.push({
|
|
1945
|
+
id: `round-${w.roundNumber}`,
|
|
1946
|
+
label: `R${w.roundNumber}`,
|
|
1751
1947
|
track: null
|
|
1752
1948
|
});
|
|
1753
|
-
const k = N.get(
|
|
1754
|
-
return /* @__PURE__ */ l("div", { className:
|
|
1755
|
-
/* @__PURE__ */ n("div", { className: "pvx-results-tabs", children:
|
|
1949
|
+
const k = N.get(v);
|
|
1950
|
+
return /* @__PURE__ */ l("div", { className: r || "", children: [
|
|
1951
|
+
/* @__PURE__ */ n("div", { className: "pvx-results-tabs", children: m.map((w) => /* @__PURE__ */ l(
|
|
1756
1952
|
"button",
|
|
1757
1953
|
{
|
|
1758
|
-
className: `pvx-results-tab ${
|
|
1759
|
-
onClick: () => x(
|
|
1760
|
-
title:
|
|
1954
|
+
className: `pvx-results-tab ${v === w.id ? "pvx-results-tab--active" : ""}`,
|
|
1955
|
+
onClick: () => x(w.id),
|
|
1956
|
+
title: w.track || void 0,
|
|
1761
1957
|
children: [
|
|
1762
|
-
/* @__PURE__ */ n("span", { className: "pvx-results-tab-label", children:
|
|
1763
|
-
|
|
1958
|
+
/* @__PURE__ */ n("span", { className: "pvx-results-tab-label", children: w.label }),
|
|
1959
|
+
w.track && /* @__PURE__ */ n("span", { className: "pvx-results-tab-track", children: w.track })
|
|
1764
1960
|
]
|
|
1765
1961
|
},
|
|
1766
|
-
|
|
1962
|
+
w.id
|
|
1767
1963
|
)) }),
|
|
1768
|
-
|
|
1769
|
-
|
|
1964
|
+
v === "standings" ? /* @__PURE__ */ n(wn, { competitionId: e }) : v === "leaderboard" ? /* @__PURE__ */ n(In, { leaderboard: o, config: t }) : v != null && v.startsWith("session-") ? /* @__PURE__ */ n(
|
|
1965
|
+
Un,
|
|
1770
1966
|
{
|
|
1771
|
-
session: f.find((
|
|
1967
|
+
session: f.find((w) => `session-${w.type}` === v),
|
|
1772
1968
|
round: g,
|
|
1773
1969
|
competitionId: e
|
|
1774
1970
|
}
|
|
1775
|
-
) : k ? /* @__PURE__ */ n(
|
|
1971
|
+
) : k ? /* @__PURE__ */ n(An, { round: k, competitionId: e }) : /* @__PURE__ */ n(U, { message: "No results for this round." })
|
|
1776
1972
|
] });
|
|
1777
1973
|
}
|
|
1778
|
-
function
|
|
1974
|
+
function An({ round: e, competitionId: r }) {
|
|
1779
1975
|
var i;
|
|
1780
1976
|
const s = (e.sessions || []).find((o) => o.type === "RACE"), a = (i = s == null ? void 0 : s.results) == null ? void 0 : i.filter((o) => o.position <= 3).sort((o, d) => o.position - d.position);
|
|
1781
1977
|
return /* @__PURE__ */ l("div", { className: "pvx-card", children: [
|
|
@@ -1793,18 +1989,18 @@ function $n({ round: e, competitionId: t }) {
|
|
|
1793
1989
|
}) })
|
|
1794
1990
|
] }),
|
|
1795
1991
|
(a == null ? void 0 : a.length) > 0 && /* @__PURE__ */ n("div", { className: "pvx-round-podium-summary", children: a.map((o) => /* @__PURE__ */ l("span", { className: "pvx-round-podium-item", children: [
|
|
1796
|
-
/* @__PURE__ */ n("span", { children:
|
|
1992
|
+
/* @__PURE__ */ n("span", { children: de[o.position - 1] }),
|
|
1797
1993
|
/* @__PURE__ */ n("span", { children: o.driverName })
|
|
1798
1994
|
] }, o.driverId)) })
|
|
1799
1995
|
] }),
|
|
1800
|
-
/* @__PURE__ */ n(
|
|
1996
|
+
/* @__PURE__ */ n(he, { round: e, competitionId: r })
|
|
1801
1997
|
] });
|
|
1802
1998
|
}
|
|
1803
|
-
function
|
|
1804
|
-
var
|
|
1805
|
-
return (
|
|
1999
|
+
function In({ leaderboard: e, config: r }) {
|
|
2000
|
+
var t;
|
|
2001
|
+
return (t = e == null ? void 0 : e.drivers) != null && t.length ? /* @__PURE__ */ l("div", { className: "pvx-card", children: [
|
|
1806
2002
|
/* @__PURE__ */ n("div", { className: "pvx-card-header--split", children: /* @__PURE__ */ l("div", { children: [
|
|
1807
|
-
/* @__PURE__ */ n("h4", { className: "pvx-card-title", children: e.track || (
|
|
2003
|
+
/* @__PURE__ */ n("h4", { className: "pvx-card-title", children: e.track || (r == null ? void 0 : r.name) || "Hotlap Leaderboard" }),
|
|
1808
2004
|
/* @__PURE__ */ l("span", { className: "pvx-standings-subtitle", children: [
|
|
1809
2005
|
e.sessionsCompleted,
|
|
1810
2006
|
" session",
|
|
@@ -1825,12 +2021,12 @@ function Rn({ leaderboard: e, config: t }) {
|
|
|
1825
2021
|
/* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: e.drivers.map((s) => {
|
|
1826
2022
|
const a = s.position === 1 ? "" : `+${((s.bestLapMs - e.drivers[0].bestLapMs) / 1e3).toFixed(3)}`;
|
|
1827
2023
|
return /* @__PURE__ */ l("tr", { className: `pvx-row ${s.position <= 3 ? "pvx-row--podium" : ""}`, children: [
|
|
1828
|
-
/* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(
|
|
2024
|
+
/* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(ue, { position: s.position }) }),
|
|
1829
2025
|
/* @__PURE__ */ l("td", { className: "pvx-td pvx-td--primary", children: [
|
|
1830
|
-
/* @__PURE__ */ n(
|
|
2026
|
+
/* @__PURE__ */ n(Z, { nation: s.nation }),
|
|
1831
2027
|
s.driverName
|
|
1832
2028
|
] }),
|
|
1833
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-sm", children:
|
|
2029
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-sm", children: A(s.carId) }),
|
|
1834
2030
|
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--mono", children: /* @__PURE__ */ n("span", { className: s.position === 1 ? "pvx-best-lap-cell--fastest" : "", children: s.bestLapFormatted }) }),
|
|
1835
2031
|
/* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-sm", children: s.totalLaps }),
|
|
1836
2032
|
/* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-sm", children: s.sessionsParticipated }),
|
|
@@ -1838,31 +2034,31 @@ function Rn({ leaderboard: e, config: t }) {
|
|
|
1838
2034
|
] }, s.driverId);
|
|
1839
2035
|
}) })
|
|
1840
2036
|
] }) })
|
|
1841
|
-
] }) : /* @__PURE__ */ n(
|
|
2037
|
+
] }) : /* @__PURE__ */ n(U, { message: "No lap times recorded yet." });
|
|
1842
2038
|
}
|
|
1843
|
-
function
|
|
2039
|
+
function Un({ session: e, round: r, competitionId: t }) {
|
|
1844
2040
|
return e ? /* @__PURE__ */ l("div", { className: "pvx-card", children: [
|
|
1845
|
-
/* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ n("h4", { className: "pvx-card-title", children:
|
|
2041
|
+
/* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ n("h4", { className: "pvx-card-title", children: pe(e.type) }) }),
|
|
1846
2042
|
/* @__PURE__ */ n(
|
|
1847
|
-
|
|
2043
|
+
he,
|
|
1848
2044
|
{
|
|
1849
|
-
round: { ...
|
|
1850
|
-
competitionId:
|
|
2045
|
+
round: { ...r, sessions: [e] },
|
|
2046
|
+
competitionId: t
|
|
1851
2047
|
}
|
|
1852
2048
|
)
|
|
1853
|
-
] }) : /* @__PURE__ */ n(
|
|
2049
|
+
] }) : /* @__PURE__ */ n(U, { message: "Session data not available." });
|
|
1854
2050
|
}
|
|
1855
|
-
function
|
|
1856
|
-
const { cdnUrl:
|
|
2051
|
+
function Fn(e) {
|
|
2052
|
+
const { cdnUrl: r } = L(), t = T({
|
|
1857
2053
|
queryKey: ["pitvox", "laps", "global", e, "index"],
|
|
1858
|
-
queryFn: () =>
|
|
2054
|
+
queryFn: () => M(r, Ne(null, e)),
|
|
1859
2055
|
enabled: !!e,
|
|
1860
2056
|
staleTime: 3e4,
|
|
1861
2057
|
refetchInterval: 3e4
|
|
1862
|
-
}), s =
|
|
2058
|
+
}), s = t.data;
|
|
1863
2059
|
return {
|
|
1864
|
-
isLoading:
|
|
1865
|
-
error:
|
|
2060
|
+
isLoading: t.isLoading,
|
|
2061
|
+
error: t.error,
|
|
1866
2062
|
data: s ? {
|
|
1867
2063
|
driverName: s.driverName || "Driver",
|
|
1868
2064
|
lapCount: s.lapCount || 0,
|
|
@@ -1878,14 +2074,14 @@ function Mn(e) {
|
|
|
1878
2074
|
} : null
|
|
1879
2075
|
};
|
|
1880
2076
|
}
|
|
1881
|
-
function
|
|
1882
|
-
const { cdnUrl:
|
|
1883
|
-
queryKey: ["pitvox", "laps",
|
|
1884
|
-
queryFn: () =>
|
|
2077
|
+
function En(e) {
|
|
2078
|
+
const { cdnUrl: r, partnerSlug: t } = L(), s = T({
|
|
2079
|
+
queryKey: ["pitvox", "laps", t || "global", e, "index"],
|
|
2080
|
+
queryFn: () => M(r, Ne(t, e)),
|
|
1885
2081
|
enabled: !!e,
|
|
1886
2082
|
staleTime: 3e4,
|
|
1887
2083
|
refetchInterval: 3e4
|
|
1888
|
-
}), a =
|
|
2084
|
+
}), a = $(() => {
|
|
1889
2085
|
var i;
|
|
1890
2086
|
return ((i = s.data) == null ? void 0 : i.combos) || [];
|
|
1891
2087
|
}, [s.data]);
|
|
@@ -1895,168 +2091,168 @@ function Bn(e) {
|
|
|
1895
2091
|
data: a
|
|
1896
2092
|
};
|
|
1897
2093
|
}
|
|
1898
|
-
function
|
|
1899
|
-
const { cdnUrl:
|
|
2094
|
+
function Ue(e = {}) {
|
|
2095
|
+
const { cdnUrl: r, partnerSlug: t } = L(), { game: s, gameVersion: a, enabled: i = !0 } = e, o = re(t, s, a, "ratings.json");
|
|
1900
2096
|
return T({
|
|
1901
|
-
queryKey: ["pitvox", "ratings",
|
|
1902
|
-
queryFn: () =>
|
|
2097
|
+
queryKey: ["pitvox", "ratings", t, s || null, a || null],
|
|
2098
|
+
queryFn: () => M(r, o),
|
|
1903
2099
|
staleTime: 3e4,
|
|
1904
2100
|
refetchInterval: 3e4,
|
|
1905
2101
|
enabled: i
|
|
1906
2102
|
});
|
|
1907
2103
|
}
|
|
1908
|
-
function
|
|
2104
|
+
function Mt(e) {
|
|
1909
2105
|
var s;
|
|
1910
|
-
const
|
|
2106
|
+
const r = Ue(), t = $(() => {
|
|
1911
2107
|
var a;
|
|
1912
|
-
return !((a =
|
|
2108
|
+
return !((a = r.data) != null && a.drivers) || !e ? null : r.data.drivers.find(
|
|
1913
2109
|
(i) => i.identifier === e
|
|
1914
2110
|
) || null;
|
|
1915
|
-
}, [(s =
|
|
2111
|
+
}, [(s = r.data) == null ? void 0 : s.drivers, e]);
|
|
1916
2112
|
return {
|
|
1917
|
-
isLoading:
|
|
1918
|
-
error:
|
|
1919
|
-
data:
|
|
1920
|
-
rating:
|
|
1921
|
-
rank:
|
|
1922
|
-
totalDrivers:
|
|
1923
|
-
comboCount:
|
|
1924
|
-
distinctCars:
|
|
1925
|
-
combos:
|
|
2113
|
+
isLoading: r.isLoading,
|
|
2114
|
+
error: r.error,
|
|
2115
|
+
data: t ? {
|
|
2116
|
+
rating: t.rating,
|
|
2117
|
+
rank: t.rank,
|
|
2118
|
+
totalDrivers: r.data.driverCount || r.data.drivers.length,
|
|
2119
|
+
comboCount: t.comboCount || 0,
|
|
2120
|
+
distinctCars: t.distinctCars || 0,
|
|
2121
|
+
combos: t.combos || []
|
|
1926
2122
|
} : null
|
|
1927
2123
|
};
|
|
1928
2124
|
}
|
|
1929
|
-
function
|
|
1930
|
-
const
|
|
2125
|
+
function ne(e = {}) {
|
|
2126
|
+
const r = Ue(e);
|
|
1931
2127
|
return {
|
|
1932
|
-
data:
|
|
1933
|
-
isLoading:
|
|
1934
|
-
error:
|
|
2128
|
+
data: r.data || null,
|
|
2129
|
+
isLoading: r.isLoading,
|
|
2130
|
+
error: r.error
|
|
1935
2131
|
};
|
|
1936
2132
|
}
|
|
1937
|
-
function
|
|
2133
|
+
function qn(e) {
|
|
1938
2134
|
var p, c;
|
|
1939
|
-
const { versions:
|
|
2135
|
+
const { versions: r } = Ge(), t = (p = r == null ? void 0 : r.evo) == null ? void 0 : p.default, s = (c = r == null ? void 0 : r.lmu) == null ? void 0 : c.default, a = ne({ game: "evo", gameVersion: t, enabled: !!t }), i = ne({ game: "acc" }), o = ne({ game: "lmu", gameVersion: s, enabled: !!s });
|
|
1940
2136
|
return {
|
|
1941
|
-
data:
|
|
2137
|
+
data: $(() => e ? [
|
|
1942
2138
|
{ data: a.data, game: "evo", label: "EVO" },
|
|
1943
2139
|
{ data: i.data, game: "acc", label: "ACC" },
|
|
1944
2140
|
{ data: o.data, game: "lmu", label: "LMU" }
|
|
1945
|
-
].map(({ data:
|
|
2141
|
+
].map(({ data: h, game: g, label: f }) => {
|
|
1946
2142
|
var x;
|
|
1947
|
-
if (!((x =
|
|
1948
|
-
const
|
|
1949
|
-
return
|
|
2143
|
+
if (!((x = h == null ? void 0 : h.drivers) != null && x.length)) return null;
|
|
2144
|
+
const u = [...h.drivers].sort((v, N) => N.rating - v.rating), y = u.findIndex((v) => v.identifier === e);
|
|
2145
|
+
return y === -1 ? null : {
|
|
1950
2146
|
game: g,
|
|
1951
2147
|
label: f,
|
|
1952
|
-
rating:
|
|
1953
|
-
rank:
|
|
1954
|
-
totalDrivers:
|
|
2148
|
+
rating: u[y].rating,
|
|
2149
|
+
rank: y + 1,
|
|
2150
|
+
totalDrivers: u.length
|
|
1955
2151
|
};
|
|
1956
2152
|
}).filter(Boolean) : [], [e, a.data, i.data, o.data]),
|
|
1957
2153
|
isLoading: a.isLoading || i.isLoading || o.isLoading
|
|
1958
2154
|
};
|
|
1959
2155
|
}
|
|
1960
|
-
function
|
|
1961
|
-
const { cdnUrl: e, partnerSlug:
|
|
1962
|
-
queryKey: ["pitvox", "competitions",
|
|
2156
|
+
function _n() {
|
|
2157
|
+
const { cdnUrl: e, partnerSlug: r, getSteamId: t, onFetchServerPassword: s } = L(), a = t(), { data: i, isLoading: o } = T({
|
|
2158
|
+
queryKey: ["pitvox", "competitions", r],
|
|
1963
2159
|
queryFn: async () => {
|
|
1964
|
-
const
|
|
1965
|
-
return
|
|
2160
|
+
const u = await M(e, "competitions/index.json");
|
|
2161
|
+
return u != null && u.competitions ? u.competitions.filter((y) => y.partnerSlug === r) : [];
|
|
1966
2162
|
},
|
|
1967
2163
|
staleTime: 6e4
|
|
1968
|
-
}), d = (i == null ? void 0 : i.map((
|
|
1969
|
-
queries: d.map((
|
|
1970
|
-
queryKey: ["pitvox", "competition",
|
|
1971
|
-
queryFn: () =>
|
|
2164
|
+
}), d = (i == null ? void 0 : i.map((u) => u.id)) || [], p = me({
|
|
2165
|
+
queries: d.map((u) => ({
|
|
2166
|
+
queryKey: ["pitvox", "competition", r, u, "entrylist"],
|
|
2167
|
+
queryFn: () => M(e, `competitions/${r}/${u}/entrylist.json`),
|
|
1972
2168
|
enabled: !!a && d.length > 0,
|
|
1973
2169
|
staleTime: 6e4
|
|
1974
2170
|
}))
|
|
1975
|
-
}), c = p.some((
|
|
1976
|
-
var x,
|
|
2171
|
+
}), c = p.some((u) => u.isLoading), h = $(() => {
|
|
2172
|
+
var x, v;
|
|
1977
2173
|
if (!i || !a || c) return [];
|
|
1978
|
-
const
|
|
2174
|
+
const u = /* @__PURE__ */ new Date(), y = [];
|
|
1979
2175
|
for (let N = 0; N < i.length; N++) {
|
|
1980
|
-
const
|
|
1981
|
-
if (!((
|
|
1982
|
-
const
|
|
1983
|
-
for (const
|
|
1984
|
-
if (
|
|
1985
|
-
const
|
|
1986
|
-
!
|
|
1987
|
-
competitionId:
|
|
1988
|
-
competitionName:
|
|
1989
|
-
roundNumber:
|
|
1990
|
-
track:
|
|
1991
|
-
startTime:
|
|
1992
|
-
dediStatus:
|
|
1993
|
-
dediServerAddress:
|
|
2176
|
+
const m = i[N], k = (x = p[N]) == null ? void 0 : x.data;
|
|
2177
|
+
if (!((v = k == null ? void 0 : k.drivers) == null ? void 0 : v.some((b) => b.steamId === a))) continue;
|
|
2178
|
+
const C = m.type === "hotlap", D = m.rounds || [];
|
|
2179
|
+
for (const b of D) {
|
|
2180
|
+
if (b.isFinalized && (!C || b.dediStatus === "completed")) continue;
|
|
2181
|
+
const S = b.dediStatus === "running" || b.dediStatus === "provisioning", R = b.dediStatus === "scheduled", I = b.startTime && new Date(b.startTime) > u, F = S || R || b.dediServerAddress;
|
|
2182
|
+
!S && !I && !F || y.push({
|
|
2183
|
+
competitionId: m.id,
|
|
2184
|
+
competitionName: m.name,
|
|
2185
|
+
roundNumber: b.roundNumber,
|
|
2186
|
+
track: b.track || "TBD",
|
|
2187
|
+
startTime: b.startTime,
|
|
2188
|
+
dediStatus: b.dediStatus || null,
|
|
2189
|
+
dediServerAddress: b.dediServerAddress || null
|
|
1994
2190
|
});
|
|
1995
2191
|
}
|
|
1996
2192
|
}
|
|
1997
|
-
return
|
|
1998
|
-
const k = N.dediStatus === "running" || N.dediStatus === "provisioning",
|
|
1999
|
-
return k && !
|
|
2000
|
-
}),
|
|
2001
|
-
}, [i, a, c, p]), g =
|
|
2002
|
-
queries:
|
|
2003
|
-
queryKey: ["pitvox", "serverInfo",
|
|
2004
|
-
queryFn: () => s(
|
|
2005
|
-
enabled: !!s &&
|
|
2193
|
+
return y.sort((N, m) => {
|
|
2194
|
+
const k = N.dediStatus === "running" || N.dediStatus === "provisioning", w = m.dediStatus === "running" || m.dediStatus === "provisioning";
|
|
2195
|
+
return k && !w ? -1 : !k && w ? 1 : new Date(N.startTime) - new Date(m.startTime);
|
|
2196
|
+
}), y.length > 0 && (y[0].isNext = !0), y;
|
|
2197
|
+
}, [i, a, c, p]), g = me({
|
|
2198
|
+
queries: h.map((u) => ({
|
|
2199
|
+
queryKey: ["pitvox", "serverInfo", u.competitionId, u.roundNumber],
|
|
2200
|
+
queryFn: () => s(u.competitionId, u.roundNumber),
|
|
2201
|
+
enabled: !!s && h.length > 0,
|
|
2006
2202
|
staleTime: 5 * 6e4,
|
|
2007
2203
|
// 5 minutes
|
|
2008
2204
|
retry: !1
|
|
2009
2205
|
}))
|
|
2010
2206
|
});
|
|
2011
2207
|
return {
|
|
2012
|
-
data:
|
|
2013
|
-
var
|
|
2014
|
-
const x = (
|
|
2208
|
+
data: $(() => h.length ? s ? h.map((u, y) => {
|
|
2209
|
+
var v;
|
|
2210
|
+
const x = (v = g[y]) == null ? void 0 : v.data;
|
|
2015
2211
|
return x != null && x.success ? {
|
|
2016
|
-
...
|
|
2212
|
+
...u,
|
|
2017
2213
|
serverAddress: x.serverAddress || null,
|
|
2018
2214
|
serverPassword: x.serverPassword || null
|
|
2019
|
-
} :
|
|
2020
|
-
}) :
|
|
2215
|
+
} : u;
|
|
2216
|
+
}) : h : [], [h, s, g]),
|
|
2021
2217
|
isLoading: o || !!a && c
|
|
2022
2218
|
};
|
|
2023
2219
|
}
|
|
2024
|
-
function
|
|
2025
|
-
const { onFetchNotifications: e } =
|
|
2220
|
+
function jn() {
|
|
2221
|
+
const { onFetchNotifications: e } = L();
|
|
2026
2222
|
return !!e;
|
|
2027
2223
|
}
|
|
2028
|
-
function
|
|
2029
|
-
const { onFetchNotifications:
|
|
2224
|
+
function Vn(e = {}) {
|
|
2225
|
+
const { onFetchNotifications: r, partnerSlug: t } = L(), { limit: s = 20, unreadOnly: a = !1 } = e;
|
|
2030
2226
|
return T({
|
|
2031
|
-
queryKey: ["pitvox", "notifications",
|
|
2032
|
-
queryFn: () =>
|
|
2033
|
-
enabled: !!
|
|
2227
|
+
queryKey: ["pitvox", "notifications", t, { limit: s, unreadOnly: a }],
|
|
2228
|
+
queryFn: () => r({ limit: s, unreadOnly: a }),
|
|
2229
|
+
enabled: !!r,
|
|
2034
2230
|
staleTime: 3e4,
|
|
2035
2231
|
refetchInterval: 3e4
|
|
2036
2232
|
});
|
|
2037
2233
|
}
|
|
2038
|
-
function
|
|
2039
|
-
const { onFetchNotifications: e, partnerSlug:
|
|
2040
|
-
queryKey: ["pitvox", "notifications",
|
|
2234
|
+
function Dt() {
|
|
2235
|
+
const { onFetchNotifications: e, partnerSlug: r } = L(), { data: t, isLoading: s } = T({
|
|
2236
|
+
queryKey: ["pitvox", "notifications", r, { limit: 1, unreadOnly: !1 }],
|
|
2041
2237
|
queryFn: () => e({ limit: 1 }),
|
|
2042
2238
|
enabled: !!e,
|
|
2043
2239
|
staleTime: 3e4,
|
|
2044
2240
|
refetchInterval: 3e4,
|
|
2045
2241
|
select: (a) => (a == null ? void 0 : a.unreadCount) ?? 0
|
|
2046
2242
|
});
|
|
2047
|
-
return { count:
|
|
2243
|
+
return { count: t ?? 0, isLoading: s };
|
|
2048
2244
|
}
|
|
2049
|
-
function
|
|
2050
|
-
const { onMarkNotificationRead: e, partnerSlug:
|
|
2051
|
-
return
|
|
2245
|
+
function Kn() {
|
|
2246
|
+
const { onMarkNotificationRead: e, partnerSlug: r } = L(), t = H();
|
|
2247
|
+
return Q({
|
|
2052
2248
|
mutationFn: (s) => {
|
|
2053
2249
|
if (!e)
|
|
2054
2250
|
throw new Error("No onMarkNotificationRead callback provided to PitVoxPartnerProvider.");
|
|
2055
2251
|
return e(s);
|
|
2056
2252
|
},
|
|
2057
2253
|
onSuccess: (s, a) => {
|
|
2058
|
-
|
|
2059
|
-
{ queryKey: ["pitvox", "notifications",
|
|
2254
|
+
t.setQueriesData(
|
|
2255
|
+
{ queryKey: ["pitvox", "notifications", r] },
|
|
2060
2256
|
(i) => i != null && i.notifications ? {
|
|
2061
2257
|
...i,
|
|
2062
2258
|
unreadCount: Math.max(0, (i.unreadCount || 0) - 1),
|
|
@@ -2068,17 +2264,17 @@ function Fn() {
|
|
|
2068
2264
|
}
|
|
2069
2265
|
});
|
|
2070
2266
|
}
|
|
2071
|
-
function
|
|
2072
|
-
const { onMarkAllNotificationsRead: e, partnerSlug:
|
|
2073
|
-
return
|
|
2267
|
+
function Hn() {
|
|
2268
|
+
const { onMarkAllNotificationsRead: e, partnerSlug: r } = L(), t = H();
|
|
2269
|
+
return Q({
|
|
2074
2270
|
mutationFn: () => {
|
|
2075
2271
|
if (!e)
|
|
2076
2272
|
throw new Error("No onMarkAllNotificationsRead callback provided to PitVoxPartnerProvider.");
|
|
2077
2273
|
return e();
|
|
2078
2274
|
},
|
|
2079
2275
|
onSuccess: () => {
|
|
2080
|
-
|
|
2081
|
-
{ queryKey: ["pitvox", "notifications",
|
|
2276
|
+
t.setQueriesData(
|
|
2277
|
+
{ queryKey: ["pitvox", "notifications", r] },
|
|
2082
2278
|
(s) => s != null && s.notifications ? {
|
|
2083
2279
|
...s,
|
|
2084
2280
|
unreadCount: 0,
|
|
@@ -2092,10 +2288,10 @@ function En() {
|
|
|
2092
2288
|
}
|
|
2093
2289
|
});
|
|
2094
2290
|
}
|
|
2095
|
-
function
|
|
2096
|
-
const a =
|
|
2291
|
+
function Wn({ driverName: e, avatarUrl: r, memberSince: t, className: s = "" }) {
|
|
2292
|
+
const a = t ? new Date(t).toLocaleDateString("en-GB", { day: "2-digit", month: "2-digit", year: "numeric" }) : null;
|
|
2097
2293
|
return /* @__PURE__ */ l("div", { className: `pvx-card pvx-dash-profile ${s}`, children: [
|
|
2098
|
-
|
|
2294
|
+
r ? /* @__PURE__ */ n("img", { src: r, alt: "", className: "pvx-dash-profile-avatar" }) : /* @__PURE__ */ n("div", { className: "pvx-dash-profile-avatar pvx-dash-profile-avatar--placeholder", children: (e || "?")[0].toUpperCase() }),
|
|
2099
2295
|
/* @__PURE__ */ l("div", { className: "pvx-dash-profile-info", children: [
|
|
2100
2296
|
/* @__PURE__ */ n("h2", { className: "pvx-dash-profile-name", children: e }),
|
|
2101
2297
|
a && /* @__PURE__ */ l("p", { className: "pvx-dash-profile-since", children: [
|
|
@@ -2105,7 +2301,7 @@ function qn({ driverName: e, avatarUrl: t, memberSince: r, className: s = "" })
|
|
|
2105
2301
|
] })
|
|
2106
2302
|
] });
|
|
2107
2303
|
}
|
|
2108
|
-
function
|
|
2304
|
+
function On() {
|
|
2109
2305
|
return /* @__PURE__ */ l("svg", { className: "pvx-dash-stat-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2110
2306
|
/* @__PURE__ */ n("line", { x1: "4", y1: "9", x2: "20", y2: "9" }),
|
|
2111
2307
|
/* @__PURE__ */ n("line", { x1: "4", y1: "15", x2: "20", y2: "15" }),
|
|
@@ -2113,7 +2309,7 @@ function jn() {
|
|
|
2113
2309
|
/* @__PURE__ */ n("line", { x1: "16", y1: "3", x2: "14", y2: "21" })
|
|
2114
2310
|
] });
|
|
2115
2311
|
}
|
|
2116
|
-
function
|
|
2312
|
+
function zn() {
|
|
2117
2313
|
return /* @__PURE__ */ l("svg", { className: "pvx-dash-stat-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2118
2314
|
/* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "10" }),
|
|
2119
2315
|
/* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "2" }),
|
|
@@ -2122,53 +2318,53 @@ function _n() {
|
|
|
2122
2318
|
/* @__PURE__ */ n("path", { d: "M13.5 12.5l4 2.5" })
|
|
2123
2319
|
] });
|
|
2124
2320
|
}
|
|
2125
|
-
function
|
|
2321
|
+
function ge() {
|
|
2126
2322
|
return /* @__PURE__ */ n("svg", { className: "pvx-dash-stat-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ n("polygon", { points: "12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" }) });
|
|
2127
2323
|
}
|
|
2128
|
-
function
|
|
2129
|
-
const [o, d] =
|
|
2130
|
-
|
|
2324
|
+
function fe({ icon: e, value: r, label: t, items: s, labelKey: a, countKey: i }) {
|
|
2325
|
+
const [o, d] = B(!1), p = _e(null);
|
|
2326
|
+
je(() => {
|
|
2131
2327
|
if (!o) return;
|
|
2132
|
-
function
|
|
2328
|
+
function h(g) {
|
|
2133
2329
|
p.current && !p.current.contains(g.target) && d(!1);
|
|
2134
2330
|
}
|
|
2135
|
-
return document.addEventListener("mousedown",
|
|
2331
|
+
return document.addEventListener("mousedown", h), () => document.removeEventListener("mousedown", h);
|
|
2136
2332
|
}, [o]);
|
|
2137
|
-
const c = s != null && s.length ? s.slice().sort((
|
|
2333
|
+
const c = s != null && s.length ? s.slice().sort((h, g) => g[i] - h[i]) : null;
|
|
2138
2334
|
return /* @__PURE__ */ l(
|
|
2139
2335
|
"div",
|
|
2140
2336
|
{
|
|
2141
2337
|
ref: p,
|
|
2142
2338
|
className: `pvx-dash-stat-card ${c ? "pvx-dash-stat-card--clickable" : ""}`,
|
|
2143
|
-
onClick: c ? () => d((
|
|
2339
|
+
onClick: c ? () => d((h) => !h) : void 0,
|
|
2144
2340
|
children: [
|
|
2145
2341
|
e,
|
|
2146
2342
|
/* @__PURE__ */ l("div", { className: "pvx-dash-stat-content", children: [
|
|
2147
|
-
/* @__PURE__ */ n("span", { className: "pvx-dash-stat-value", children:
|
|
2148
|
-
/* @__PURE__ */ n("span", { className: "pvx-dash-stat-label", children:
|
|
2343
|
+
/* @__PURE__ */ n("span", { className: "pvx-dash-stat-value", children: r }),
|
|
2344
|
+
/* @__PURE__ */ n("span", { className: "pvx-dash-stat-label", children: t })
|
|
2149
2345
|
] }),
|
|
2150
|
-
c && /* @__PURE__ */ n("div", { className: `pvx-dash-tooltip pvx-dash-tooltip--scrollable ${o ? "pvx-dash-tooltip--open" : ""}`, children: c.map((
|
|
2151
|
-
/* @__PURE__ */ n("span", { className: "pvx-dash-tooltip-label", children:
|
|
2152
|
-
/* @__PURE__ */ n("span", { className: "pvx-dash-tooltip-value", children:
|
|
2346
|
+
c && /* @__PURE__ */ n("div", { className: `pvx-dash-tooltip pvx-dash-tooltip--scrollable ${o ? "pvx-dash-tooltip--open" : ""}`, children: c.map((h, g) => /* @__PURE__ */ l("div", { className: "pvx-dash-tooltip-row", children: [
|
|
2347
|
+
/* @__PURE__ */ n("span", { className: "pvx-dash-tooltip-label", children: h[a] }),
|
|
2348
|
+
/* @__PURE__ */ n("span", { className: "pvx-dash-tooltip-value", children: h[i] })
|
|
2153
2349
|
] }, g)) })
|
|
2154
2350
|
]
|
|
2155
2351
|
}
|
|
2156
2352
|
);
|
|
2157
2353
|
}
|
|
2158
|
-
function
|
|
2354
|
+
function Qn({ stats: e, gameRatings: r, onGameRatingSelect: t, rating: s, className: a = "" }) {
|
|
2159
2355
|
if (!e) return null;
|
|
2160
2356
|
const i = e.trackBreakdown.map((p) => ({
|
|
2161
|
-
name:
|
|
2357
|
+
name: j(p.trackId, p.layout),
|
|
2162
2358
|
lapCount: p.lapCount
|
|
2163
2359
|
})), o = e.carBreakdown.map((p) => ({
|
|
2164
|
-
name:
|
|
2360
|
+
name: A(p.carId),
|
|
2165
2361
|
lapCount: p.lapCount
|
|
2166
|
-
})), d = Array.isArray(
|
|
2362
|
+
})), d = Array.isArray(r) && r.length > 0;
|
|
2167
2363
|
return /* @__PURE__ */ l("div", { className: `pvx-dash-stats ${a}`, children: [
|
|
2168
2364
|
/* @__PURE__ */ n(
|
|
2169
|
-
|
|
2365
|
+
fe,
|
|
2170
2366
|
{
|
|
2171
|
-
icon: /* @__PURE__ */ n(
|
|
2367
|
+
icon: /* @__PURE__ */ n(On, {}),
|
|
2172
2368
|
value: e.lapCount.toLocaleString(),
|
|
2173
2369
|
label: "Total Laps",
|
|
2174
2370
|
items: i,
|
|
@@ -2177,9 +2373,9 @@ function Vn({ stats: e, gameRatings: t, onGameRatingSelect: r, rating: s, classN
|
|
|
2177
2373
|
}
|
|
2178
2374
|
),
|
|
2179
2375
|
/* @__PURE__ */ n(
|
|
2180
|
-
|
|
2376
|
+
fe,
|
|
2181
2377
|
{
|
|
2182
|
-
icon: /* @__PURE__ */ n(
|
|
2378
|
+
icon: /* @__PURE__ */ n(zn, {}),
|
|
2183
2379
|
value: e.carBreakdown.length,
|
|
2184
2380
|
label: "Cars Used",
|
|
2185
2381
|
items: o,
|
|
@@ -2188,18 +2384,18 @@ function Vn({ stats: e, gameRatings: t, onGameRatingSelect: r, rating: s, classN
|
|
|
2188
2384
|
}
|
|
2189
2385
|
),
|
|
2190
2386
|
d ? /* @__PURE__ */ l("div", { className: "pvx-dash-stat-card pvx-dash-stat-card--rating-chips", children: [
|
|
2191
|
-
/* @__PURE__ */ n(
|
|
2387
|
+
/* @__PURE__ */ n(ge, {}),
|
|
2192
2388
|
/* @__PURE__ */ l("div", { className: "pvx-dash-stat-content", children: [
|
|
2193
2389
|
/* @__PURE__ */ n("span", { className: "pvx-dash-stat-label", children: "Driver Rating" }),
|
|
2194
|
-
/* @__PURE__ */ n("div", { className: "pvx-dash-rating-chips", children:
|
|
2195
|
-
const c = !!
|
|
2390
|
+
/* @__PURE__ */ n("div", { className: "pvx-dash-rating-chips", children: r.map((p) => {
|
|
2391
|
+
const c = !!t;
|
|
2196
2392
|
return /* @__PURE__ */ l(
|
|
2197
2393
|
"span",
|
|
2198
2394
|
{
|
|
2199
2395
|
className: `pvx-dash-rating-chip${c ? " pvx-dash-rating-chip--clickable" : ""}`,
|
|
2200
|
-
onClick: c ? () =>
|
|
2396
|
+
onClick: c ? () => t(p) : void 0,
|
|
2201
2397
|
onKeyDown: c ? (g) => {
|
|
2202
|
-
c && (g.key === "Enter" || g.key === " ") && (g.preventDefault(),
|
|
2398
|
+
c && (g.key === "Enter" || g.key === " ") && (g.preventDefault(), t(p));
|
|
2203
2399
|
} : void 0,
|
|
2204
2400
|
role: c ? "button" : void 0,
|
|
2205
2401
|
tabIndex: c ? 0 : void 0,
|
|
@@ -2220,7 +2416,7 @@ function Vn({ stats: e, gameRatings: t, onGameRatingSelect: r, rating: s, classN
|
|
|
2220
2416
|
}) })
|
|
2221
2417
|
] })
|
|
2222
2418
|
] }) : s ? /* @__PURE__ */ l("div", { className: "pvx-dash-stat-card pvx-dash-stat-card--rating", children: [
|
|
2223
|
-
/* @__PURE__ */ n(
|
|
2419
|
+
/* @__PURE__ */ n(ge, {}),
|
|
2224
2420
|
/* @__PURE__ */ l("div", { className: "pvx-dash-stat-content", children: [
|
|
2225
2421
|
/* @__PURE__ */ n("span", { className: "pvx-dash-stat-value", children: s.rating.toFixed(1) }),
|
|
2226
2422
|
/* @__PURE__ */ n("span", { className: "pvx-dash-stat-label", children: "Driver Rating" }),
|
|
@@ -2234,8 +2430,8 @@ function Vn({ stats: e, gameRatings: t, onGameRatingSelect: r, rating: s, classN
|
|
|
2234
2430
|
] }) : null
|
|
2235
2431
|
] });
|
|
2236
2432
|
}
|
|
2237
|
-
function
|
|
2238
|
-
return e != null && e.length ? /* @__PURE__ */ l("div", { className: `pvx-card ${
|
|
2433
|
+
function Gn({ combos: e, onComboSelect: r, className: t = "" }) {
|
|
2434
|
+
return e != null && e.length ? /* @__PURE__ */ l("div", { className: `pvx-card ${t}`, children: [
|
|
2239
2435
|
/* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ l("h3", { className: "pvx-card-title", children: [
|
|
2240
2436
|
/* @__PURE__ */ n("span", { className: "pvx-dash-combos-icon", children: /* @__PURE__ */ l("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2241
2437
|
/* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "10" }),
|
|
@@ -2249,36 +2445,36 @@ function Kn({ combos: e, onComboSelect: t, className: r = "" }) {
|
|
|
2249
2445
|
] })
|
|
2250
2446
|
] }) }),
|
|
2251
2447
|
/* @__PURE__ */ n("div", { className: "pvx-dash-combos-list", children: e.map((s) => /* @__PURE__ */ n(
|
|
2252
|
-
|
|
2448
|
+
Yn,
|
|
2253
2449
|
{
|
|
2254
2450
|
combo: s,
|
|
2255
|
-
onClick:
|
|
2451
|
+
onClick: r ? () => r(s) : null
|
|
2256
2452
|
},
|
|
2257
2453
|
`${s.trackId}|${s.trackLayout || ""}|${s.carId}|${s.game || ""}|${s.gameVersion || ""}`
|
|
2258
2454
|
)) })
|
|
2259
2455
|
] }) : null;
|
|
2260
2456
|
}
|
|
2261
|
-
function
|
|
2262
|
-
const
|
|
2457
|
+
function Yn({ combo: e, onClick: r }) {
|
|
2458
|
+
const t = e.game || "evo", s = e.gapToLeaderMs && e.gapToLeaderMs > 0 ? (e.gapToLeaderMs / 1e3).toFixed(3) : null, a = e.rank === 1 && e.totalDrivers > 1;
|
|
2263
2459
|
return /* @__PURE__ */ l(
|
|
2264
2460
|
"div",
|
|
2265
2461
|
{
|
|
2266
|
-
className: `pvx-dash-combo-row${
|
|
2267
|
-
onClick:
|
|
2268
|
-
onKeyDown:
|
|
2269
|
-
|
|
2462
|
+
className: `pvx-dash-combo-row${r ? " pvx-dash-combo-row--clickable" : ""}`,
|
|
2463
|
+
onClick: r || void 0,
|
|
2464
|
+
onKeyDown: r ? (d) => {
|
|
2465
|
+
r && (d.key === "Enter" || d.key === " ") && (d.preventDefault(), r());
|
|
2270
2466
|
} : void 0,
|
|
2271
|
-
role:
|
|
2272
|
-
tabIndex:
|
|
2467
|
+
role: r ? "button" : void 0,
|
|
2468
|
+
tabIndex: r ? 0 : void 0,
|
|
2273
2469
|
children: [
|
|
2274
2470
|
/* @__PURE__ */ l("div", { className: "pvx-dash-combo-info", children: [
|
|
2275
2471
|
/* @__PURE__ */ l("div", { className: "pvx-dash-combo-title", children: [
|
|
2276
|
-
e.game && /* @__PURE__ */ n("span", { className: `pvx-dash-game-badge pvx-dash-game-badge--${
|
|
2277
|
-
/* @__PURE__ */ n("span", { className: "pvx-dash-combo-track", children:
|
|
2472
|
+
e.game && /* @__PURE__ */ n("span", { className: `pvx-dash-game-badge pvx-dash-game-badge--${t}`, children: t.toUpperCase() }),
|
|
2473
|
+
/* @__PURE__ */ n("span", { className: "pvx-dash-combo-track", children: j(e.trackId, e.trackLayout, e.game) })
|
|
2278
2474
|
] }),
|
|
2279
2475
|
/* @__PURE__ */ l("div", { className: "pvx-dash-combo-meta", children: [
|
|
2280
|
-
/* @__PURE__ */ n("span", { className: "pvx-dash-combo-car", children:
|
|
2281
|
-
e.lapCount > 0 && /* @__PURE__ */ l(
|
|
2476
|
+
/* @__PURE__ */ n("span", { className: "pvx-dash-combo-car", children: A(e.carId) }),
|
|
2477
|
+
e.lapCount > 0 && /* @__PURE__ */ l(_, { children: [
|
|
2282
2478
|
/* @__PURE__ */ n("span", { className: "pvx-dash-combo-meta-sep", children: "·" }),
|
|
2283
2479
|
/* @__PURE__ */ l("span", { children: [
|
|
2284
2480
|
e.lapCount,
|
|
@@ -2286,9 +2482,9 @@ function Hn({ combo: e, onClick: t }) {
|
|
|
2286
2482
|
e.lapCount === 1 ? "lap" : "laps"
|
|
2287
2483
|
] })
|
|
2288
2484
|
] }),
|
|
2289
|
-
e.lastDrivenAt && /* @__PURE__ */ l(
|
|
2485
|
+
e.lastDrivenAt && /* @__PURE__ */ l(_, { children: [
|
|
2290
2486
|
/* @__PURE__ */ n("span", { className: "pvx-dash-combo-meta-sep", children: "·" }),
|
|
2291
|
-
/* @__PURE__ */ n("span", { children:
|
|
2487
|
+
/* @__PURE__ */ n("span", { children: se(e.lastDrivenAt) })
|
|
2292
2488
|
] })
|
|
2293
2489
|
] })
|
|
2294
2490
|
] }),
|
|
@@ -2318,21 +2514,21 @@ function Hn({ combo: e, onClick: t }) {
|
|
|
2318
2514
|
"+",
|
|
2319
2515
|
s
|
|
2320
2516
|
] }),
|
|
2321
|
-
e.personalBestMs && /* @__PURE__ */ n("span", { className: "pvx-dash-combo-pb", children:
|
|
2517
|
+
e.personalBestMs && /* @__PURE__ */ n("span", { className: "pvx-dash-combo-pb", children: q(e.personalBestMs) })
|
|
2322
2518
|
] })
|
|
2323
2519
|
]
|
|
2324
2520
|
}
|
|
2325
2521
|
);
|
|
2326
2522
|
}
|
|
2327
|
-
function
|
|
2328
|
-
if (
|
|
2523
|
+
function Jn({ events: e, isLoading: r, className: t, limit: s = 3 }) {
|
|
2524
|
+
if (r)
|
|
2329
2525
|
return /* @__PURE__ */ n("div", { className: "pvx-loading", children: "Loading upcoming events..." });
|
|
2330
2526
|
if (!(e != null && e.length))
|
|
2331
2527
|
return null;
|
|
2332
2528
|
const a = s ? e.slice(0, s) : e, i = e.length - a.length;
|
|
2333
|
-
return /* @__PURE__ */ l("div", { className: `pvx-card ${
|
|
2529
|
+
return /* @__PURE__ */ l("div", { className: `pvx-card ${t || ""}`, children: [
|
|
2334
2530
|
/* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ l("h3", { className: "pvx-card-title", children: [
|
|
2335
|
-
/* @__PURE__ */ n(
|
|
2531
|
+
/* @__PURE__ */ n(et, {}),
|
|
2336
2532
|
"Upcoming Events",
|
|
2337
2533
|
/* @__PURE__ */ l("span", { className: "pvx-dash-records-count", children: [
|
|
2338
2534
|
"(",
|
|
@@ -2355,7 +2551,7 @@ function Wn({ events: e, isLoading: t, className: r, limit: s = 3 }) {
|
|
|
2355
2551
|
o.track
|
|
2356
2552
|
] }),
|
|
2357
2553
|
o.serverPassword && /* @__PURE__ */ n(
|
|
2358
|
-
|
|
2554
|
+
Zn,
|
|
2359
2555
|
{
|
|
2360
2556
|
password: o.serverPassword,
|
|
2361
2557
|
address: o.serverAddress
|
|
@@ -2368,7 +2564,7 @@ function Wn({ events: e, isLoading: t, className: r, limit: s = 3 }) {
|
|
|
2368
2564
|
month: "short",
|
|
2369
2565
|
year: "numeric"
|
|
2370
2566
|
}) }),
|
|
2371
|
-
/* @__PURE__ */ n("span", { className: "pvx-upcoming-relative", children: o.dediStatus === "running" ? "Live now" : o.dediStatus === "provisioning" ? "Starting..." :
|
|
2567
|
+
/* @__PURE__ */ n("span", { className: "pvx-upcoming-relative", children: o.dediStatus === "running" ? "Live now" : o.dediStatus === "provisioning" ? "Starting..." : Xn(o.startTime) }),
|
|
2372
2568
|
o.dediStatus === "running" && /* @__PURE__ */ n("span", { className: "pvx-upcoming-badge pvx-upcoming-badge--live", children: "Live" }),
|
|
2373
2569
|
!o.dediStatus && o.isNext && /* @__PURE__ */ n("span", { className: "pvx-upcoming-badge", children: "Next" })
|
|
2374
2570
|
] })
|
|
@@ -2385,8 +2581,8 @@ function Wn({ events: e, isLoading: t, className: r, limit: s = 3 }) {
|
|
|
2385
2581
|
] })
|
|
2386
2582
|
] });
|
|
2387
2583
|
}
|
|
2388
|
-
function
|
|
2389
|
-
const [
|
|
2584
|
+
function Zn({ password: e, address: r }) {
|
|
2585
|
+
const [t, s] = B(!1), [a, i] = B(!1), o = r ? e ? `join:${r}|${e}` : `join:${r}` : null, d = K(async () => {
|
|
2390
2586
|
if (o)
|
|
2391
2587
|
try {
|
|
2392
2588
|
await navigator.clipboard.writeText(o), s(!0), setTimeout(() => s(!1), 2e3);
|
|
@@ -2401,100 +2597,100 @@ function On({ password: e, address: t }) {
|
|
|
2401
2597
|
onClick: d,
|
|
2402
2598
|
title: "Copy join string to clipboard",
|
|
2403
2599
|
children: [
|
|
2404
|
-
/* @__PURE__ */ n(
|
|
2600
|
+
/* @__PURE__ */ n(tt, {}),
|
|
2405
2601
|
" ",
|
|
2406
|
-
|
|
2602
|
+
t ? "Copied!" : "Join"
|
|
2407
2603
|
]
|
|
2408
2604
|
}
|
|
2409
2605
|
),
|
|
2410
|
-
e && /* @__PURE__ */ l(
|
|
2606
|
+
e && /* @__PURE__ */ l(_, { children: [
|
|
2411
2607
|
/* @__PURE__ */ n(
|
|
2412
2608
|
"span",
|
|
2413
2609
|
{
|
|
2414
2610
|
className: "pvx-server-detail pvx-server-detail--clickable",
|
|
2415
2611
|
onClick: () => i((p) => !p),
|
|
2416
2612
|
title: a ? "Hide password" : "Reveal password",
|
|
2417
|
-
children: a ? /* @__PURE__ */ n(
|
|
2613
|
+
children: a ? /* @__PURE__ */ n(st, {}) : /* @__PURE__ */ n(rt, {})
|
|
2418
2614
|
}
|
|
2419
2615
|
),
|
|
2420
2616
|
a && /* @__PURE__ */ l("span", { className: "pvx-server-detail", children: [
|
|
2421
|
-
/* @__PURE__ */ n(
|
|
2617
|
+
/* @__PURE__ */ n(nt, {}),
|
|
2422
2618
|
" ",
|
|
2423
2619
|
e
|
|
2424
2620
|
] })
|
|
2425
2621
|
] })
|
|
2426
2622
|
] });
|
|
2427
2623
|
}
|
|
2428
|
-
function
|
|
2429
|
-
const
|
|
2430
|
-
if (
|
|
2431
|
-
const
|
|
2432
|
-
if (
|
|
2433
|
-
if (
|
|
2434
|
-
const s = Math.floor(
|
|
2624
|
+
function Xn(e) {
|
|
2625
|
+
const r = new Date(e).getTime() - Date.now();
|
|
2626
|
+
if (r <= 0) return "Now";
|
|
2627
|
+
const t = Math.floor(r / (1e3 * 60 * 60));
|
|
2628
|
+
if (t < 1) return "Less than 1 hour";
|
|
2629
|
+
if (t < 24) return `in ${t}h`;
|
|
2630
|
+
const s = Math.floor(t / 24);
|
|
2435
2631
|
if (s === 1) return "Tomorrow";
|
|
2436
2632
|
if (s < 7) return `in ${s} days`;
|
|
2437
2633
|
if (s < 30) {
|
|
2438
2634
|
const a = Math.floor(s / 7);
|
|
2439
2635
|
return `in ${a} week${a !== 1 ? "s" : ""}`;
|
|
2440
2636
|
}
|
|
2441
|
-
return
|
|
2637
|
+
return se(e);
|
|
2442
2638
|
}
|
|
2443
|
-
function
|
|
2639
|
+
function et() {
|
|
2444
2640
|
return /* @__PURE__ */ l("svg", { className: "pvx-dash-records-icon", width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2445
2641
|
/* @__PURE__ */ n("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2" }),
|
|
2446
2642
|
/* @__PURE__ */ n("path", { d: "M16 2v4M8 2v4M3 10h18" })
|
|
2447
2643
|
] });
|
|
2448
2644
|
}
|
|
2449
|
-
function
|
|
2645
|
+
function nt() {
|
|
2450
2646
|
return /* @__PURE__ */ l("svg", { className: "pvx-server-icon", width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2451
2647
|
/* @__PURE__ */ n("rect", { x: "3", y: "11", width: "18", height: "11", rx: "2" }),
|
|
2452
2648
|
/* @__PURE__ */ n("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })
|
|
2453
2649
|
] });
|
|
2454
2650
|
}
|
|
2455
|
-
function
|
|
2651
|
+
function tt() {
|
|
2456
2652
|
return /* @__PURE__ */ l("svg", { className: "pvx-server-icon pvx-server-icon--action", width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2457
2653
|
/* @__PURE__ */ n("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2" }),
|
|
2458
2654
|
/* @__PURE__ */ n("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
|
|
2459
2655
|
] });
|
|
2460
2656
|
}
|
|
2461
|
-
function
|
|
2657
|
+
function rt() {
|
|
2462
2658
|
return /* @__PURE__ */ l("svg", { className: "pvx-server-icon pvx-server-icon--action", width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2463
2659
|
/* @__PURE__ */ n("path", { d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" }),
|
|
2464
2660
|
/* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "3" })
|
|
2465
2661
|
] });
|
|
2466
2662
|
}
|
|
2467
|
-
function
|
|
2663
|
+
function st() {
|
|
2468
2664
|
return /* @__PURE__ */ l("svg", { className: "pvx-server-icon pvx-server-icon--action", width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2469
2665
|
/* @__PURE__ */ n("path", { d: "M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24" }),
|
|
2470
2666
|
/* @__PURE__ */ n("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
|
|
2471
2667
|
] });
|
|
2472
2668
|
}
|
|
2473
|
-
function
|
|
2474
|
-
const o =
|
|
2669
|
+
function at({ notifications: e, unreadCount: r = 0, onMarkRead: t, onMarkAllRead: s, isLoading: a, className: i }) {
|
|
2670
|
+
const o = ke();
|
|
2475
2671
|
return a ? /* @__PURE__ */ n("div", { className: "pvx-loading", children: "Loading notifications..." }) : /* @__PURE__ */ l("div", { className: `pvx-card ${i || ""}`, children: [
|
|
2476
2672
|
/* @__PURE__ */ l("div", { className: "pvx-card-header", children: [
|
|
2477
2673
|
/* @__PURE__ */ l("h3", { className: "pvx-card-title", children: [
|
|
2478
|
-
/* @__PURE__ */ n(
|
|
2674
|
+
/* @__PURE__ */ n(lt, {}),
|
|
2479
2675
|
"Notifications",
|
|
2480
|
-
|
|
2676
|
+
r > 0 && /* @__PURE__ */ n("span", { className: "pvx-notif-badge", children: r > 99 ? "99+" : r })
|
|
2481
2677
|
] }),
|
|
2482
|
-
|
|
2678
|
+
r > 0 && s && /* @__PURE__ */ n("button", { className: "pvx-notif-mark-all", onClick: s, children: "Mark all read" })
|
|
2483
2679
|
] }),
|
|
2484
2680
|
e != null && e.length ? /* @__PURE__ */ n("div", { className: "pvx-notif-list", children: e.map((d) => /* @__PURE__ */ n(
|
|
2485
|
-
|
|
2681
|
+
it,
|
|
2486
2682
|
{
|
|
2487
2683
|
notification: d,
|
|
2488
2684
|
getUserDisplay: o,
|
|
2489
|
-
onMarkRead:
|
|
2685
|
+
onMarkRead: t
|
|
2490
2686
|
},
|
|
2491
2687
|
d.id
|
|
2492
2688
|
)) }) : /* @__PURE__ */ n("div", { className: "pvx-notif-empty", children: "No notifications" })
|
|
2493
2689
|
] });
|
|
2494
2690
|
}
|
|
2495
|
-
function
|
|
2691
|
+
function it({ notification: e, getUserDisplay: r, onMarkRead: t }) {
|
|
2496
2692
|
const s = () => {
|
|
2497
|
-
!e.isRead &&
|
|
2693
|
+
!e.isRead && t && t(e.id);
|
|
2498
2694
|
};
|
|
2499
2695
|
return /* @__PURE__ */ l(
|
|
2500
2696
|
"button",
|
|
@@ -2502,17 +2698,17 @@ function et({ notification: e, getUserDisplay: t, onMarkRead: r }) {
|
|
|
2502
2698
|
className: `pvx-notif-item ${e.isRead ? "" : "pvx-notif-item--unread"}`,
|
|
2503
2699
|
onClick: s,
|
|
2504
2700
|
children: [
|
|
2505
|
-
/* @__PURE__ */ n(
|
|
2701
|
+
/* @__PURE__ */ n(ot, { type: e.type }),
|
|
2506
2702
|
/* @__PURE__ */ l("div", { className: "pvx-notif-content", children: [
|
|
2507
|
-
/* @__PURE__ */ n("span", { className: "pvx-notif-message", children:
|
|
2508
|
-
/* @__PURE__ */ n("span", { className: "pvx-notif-time", children:
|
|
2703
|
+
/* @__PURE__ */ n("span", { className: "pvx-notif-message", children: Qe(e, r) }),
|
|
2704
|
+
/* @__PURE__ */ n("span", { className: "pvx-notif-time", children: se(e.createdAt) })
|
|
2509
2705
|
] }),
|
|
2510
2706
|
!e.isRead && /* @__PURE__ */ n("span", { className: "pvx-notif-dot" })
|
|
2511
2707
|
]
|
|
2512
2708
|
}
|
|
2513
2709
|
);
|
|
2514
2710
|
}
|
|
2515
|
-
function
|
|
2711
|
+
function ot({ type: e }) {
|
|
2516
2712
|
return e === "RECORD_BEATEN" ? /* @__PURE__ */ n("span", { className: "pvx-notif-icon pvx-notif-icon--beaten", children: /* @__PURE__ */ n("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ n("path", { d: "m7 7 10 10M17 7v10H7" }) }) }) : e === "ADMIN_MESSAGE" ? /* @__PURE__ */ n("span", { className: "pvx-notif-icon pvx-notif-icon--admin", children: /* @__PURE__ */ l("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2517
2713
|
/* @__PURE__ */ n("path", { d: "m3 11 18-5v12L3 13v-2z" }),
|
|
2518
2714
|
/* @__PURE__ */ n("path", { d: "M11.6 16.8a3 3 0 1 1-5.8-1.6" })
|
|
@@ -2525,61 +2721,61 @@ function nt({ type: e }) {
|
|
|
2525
2721
|
/* @__PURE__ */ n("path", { d: "M18 2H6v7a6 6 0 0 0 12 0V2Z" })
|
|
2526
2722
|
] }) });
|
|
2527
2723
|
}
|
|
2528
|
-
function
|
|
2724
|
+
function lt() {
|
|
2529
2725
|
return /* @__PURE__ */ l("svg", { className: "pvx-dash-records-icon", width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2530
2726
|
/* @__PURE__ */ n("path", { d: "M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9" }),
|
|
2531
2727
|
/* @__PURE__ */ n("path", { d: "M10.3 21a1.94 1.94 0 0 0 3.4 0" })
|
|
2532
2728
|
] });
|
|
2533
2729
|
}
|
|
2534
|
-
function
|
|
2730
|
+
function Pt({
|
|
2535
2731
|
steamId: e,
|
|
2536
|
-
avatarUrl:
|
|
2537
|
-
memberSince:
|
|
2732
|
+
avatarUrl: r,
|
|
2733
|
+
memberSince: t,
|
|
2538
2734
|
hideProfile: s = !1,
|
|
2539
2735
|
onComboSelect: a,
|
|
2540
2736
|
onGameRatingSelect: i,
|
|
2541
2737
|
className: o = ""
|
|
2542
2738
|
}) {
|
|
2543
|
-
const { data: d, isLoading: p, error: c } =
|
|
2739
|
+
const { data: d, isLoading: p, error: c } = Fn(e), { data: h } = qn(e), { data: g } = En(e), { data: f, isLoading: u } = _n(), y = jn(), { data: x, isLoading: v } = Vn({ limit: 10 }), N = Kn(), m = Hn();
|
|
2544
2740
|
return p ? /* @__PURE__ */ n("div", { className: "pvx-loading", children: "Loading dashboard..." }) : c ? /* @__PURE__ */ n("div", { className: "pvx-empty", children: "Failed to load dashboard data." }) : d ? /* @__PURE__ */ l("div", { className: `pvx-dash ${o}`, children: [
|
|
2545
2741
|
!s && /* @__PURE__ */ n(
|
|
2546
|
-
|
|
2742
|
+
Wn,
|
|
2547
2743
|
{
|
|
2548
2744
|
driverName: d.driverName,
|
|
2549
|
-
avatarUrl:
|
|
2550
|
-
memberSince:
|
|
2745
|
+
avatarUrl: r,
|
|
2746
|
+
memberSince: t
|
|
2551
2747
|
}
|
|
2552
2748
|
),
|
|
2553
2749
|
/* @__PURE__ */ n(
|
|
2554
|
-
|
|
2750
|
+
Qn,
|
|
2555
2751
|
{
|
|
2556
2752
|
stats: d,
|
|
2557
|
-
gameRatings:
|
|
2753
|
+
gameRatings: h,
|
|
2558
2754
|
onGameRatingSelect: i
|
|
2559
2755
|
}
|
|
2560
2756
|
),
|
|
2561
|
-
e && /* @__PURE__ */ n(
|
|
2562
|
-
/* @__PURE__ */ l("div", { className: `pvx-dash-row ${
|
|
2563
|
-
/* @__PURE__ */ n(
|
|
2564
|
-
|
|
2565
|
-
|
|
2757
|
+
e && /* @__PURE__ */ n(Jn, { events: f, isLoading: u }),
|
|
2758
|
+
/* @__PURE__ */ l("div", { className: `pvx-dash-row ${y ? "pvx-dash-row--2col" : ""}`, children: [
|
|
2759
|
+
/* @__PURE__ */ n(Gn, { combos: g, onComboSelect: a }),
|
|
2760
|
+
y && /* @__PURE__ */ n(
|
|
2761
|
+
at,
|
|
2566
2762
|
{
|
|
2567
2763
|
notifications: x == null ? void 0 : x.notifications,
|
|
2568
2764
|
unreadCount: (x == null ? void 0 : x.unreadCount) || 0,
|
|
2569
2765
|
onMarkRead: (k) => N.mutate(k),
|
|
2570
|
-
onMarkAllRead: () =>
|
|
2571
|
-
isLoading:
|
|
2766
|
+
onMarkAllRead: () => m.mutate(),
|
|
2767
|
+
isLoading: v
|
|
2572
2768
|
}
|
|
2573
2769
|
)
|
|
2574
2770
|
] })
|
|
2575
2771
|
] }) : /* @__PURE__ */ n("div", { className: "pvx-empty", children: "No data available yet. Start driving to see your stats!" });
|
|
2576
2772
|
}
|
|
2577
|
-
function
|
|
2578
|
-
const
|
|
2773
|
+
function Bt({ records: e, className: r = "" }) {
|
|
2774
|
+
const t = $(() => e != null && e.length ? e.slice().sort((s, a) => {
|
|
2579
2775
|
const i = s.recordedAt ? new Date(s.recordedAt).getTime() : 0;
|
|
2580
2776
|
return (a.recordedAt ? new Date(a.recordedAt).getTime() : 0) - i;
|
|
2581
2777
|
}) : [], [e]);
|
|
2582
|
-
return
|
|
2778
|
+
return t.length ? /* @__PURE__ */ l("div", { className: `pvx-card ${r}`, children: [
|
|
2583
2779
|
/* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ l("h3", { className: "pvx-card-title", children: [
|
|
2584
2780
|
/* @__PURE__ */ n("span", { className: "pvx-dash-records-icon", children: /* @__PURE__ */ l("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2585
2781
|
/* @__PURE__ */ n("path", { d: "M6 9H4.5a2.5 2.5 0 010-5H6" }),
|
|
@@ -2592,17 +2788,17 @@ function Tt({ records: e, className: t = "" }) {
|
|
|
2592
2788
|
"Current Records",
|
|
2593
2789
|
/* @__PURE__ */ l("span", { className: "pvx-dash-records-count", children: [
|
|
2594
2790
|
"(",
|
|
2595
|
-
|
|
2791
|
+
t.length,
|
|
2596
2792
|
")"
|
|
2597
2793
|
] })
|
|
2598
2794
|
] }) }),
|
|
2599
|
-
/* @__PURE__ */ n("div", { className: "pvx-dash-records-list", children:
|
|
2795
|
+
/* @__PURE__ */ n("div", { className: "pvx-dash-records-list", children: t.map((s, a) => /* @__PURE__ */ l("div", { className: "pvx-dash-record-row", children: [
|
|
2600
2796
|
/* @__PURE__ */ l("div", { className: "pvx-dash-record-info", children: [
|
|
2601
|
-
/* @__PURE__ */ n("span", { className: "pvx-dash-record-track", children:
|
|
2602
|
-
/* @__PURE__ */ n("span", { className: "pvx-dash-record-car", children:
|
|
2797
|
+
/* @__PURE__ */ n("span", { className: "pvx-dash-record-track", children: j(s.trackId, s.layout, s.game) }),
|
|
2798
|
+
/* @__PURE__ */ n("span", { className: "pvx-dash-record-car", children: A(s.carId) })
|
|
2603
2799
|
] }),
|
|
2604
2800
|
/* @__PURE__ */ l("div", { className: "pvx-dash-record-time", children: [
|
|
2605
|
-
/* @__PURE__ */ n("span", { className: "pvx-dash-record-lap", children:
|
|
2801
|
+
/* @__PURE__ */ n("span", { className: "pvx-dash-record-lap", children: q(s.lapTimeMs) }),
|
|
2606
2802
|
/* @__PURE__ */ l("span", { className: `pvx-dash-game-badge pvx-dash-game-badge--${s.game || "evo"}`, children: [
|
|
2607
2803
|
(s.game || "evo").toUpperCase(),
|
|
2608
2804
|
s.gameVersion ? ` ${s.gameVersion}` : ""
|
|
@@ -2612,86 +2808,88 @@ function Tt({ records: e, className: t = "" }) {
|
|
|
2612
2808
|
] }) : null;
|
|
2613
2809
|
}
|
|
2614
2810
|
export {
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2811
|
+
Nt as CarsTable,
|
|
2812
|
+
U as CompEmptyState,
|
|
2813
|
+
V as CompLoadingState,
|
|
2814
|
+
bn as CompetitionCard,
|
|
2815
|
+
Ct as CompetitionCards,
|
|
2816
|
+
Tt as CompetitionResultsTabs,
|
|
2817
|
+
Nn as CompletedBadge,
|
|
2818
|
+
Pe as DEFAULT_COMPLETION_GRACE_DAYS,
|
|
2819
|
+
Pt as DriverDashboard,
|
|
2820
|
+
Wn as DriverProfile,
|
|
2821
|
+
bt as DriversTable,
|
|
2822
|
+
St as EntryList,
|
|
2823
|
+
ee as InfoPill,
|
|
2824
|
+
yt as LapHistoryTable,
|
|
2825
|
+
at as NotificationsCard,
|
|
2826
|
+
de as PODIUM_MEDALS,
|
|
2827
|
+
ut as PitVoxPartnerProvider,
|
|
2828
|
+
$n as RacePositionsChart,
|
|
2829
|
+
kt as RankingsTable,
|
|
2830
|
+
Gn as RecentCombosCard,
|
|
2831
|
+
Bt as RecordsTable,
|
|
2832
|
+
$t as RegisterButton,
|
|
2833
|
+
Rt as RegistrationPanel,
|
|
2834
|
+
Lt as RoundResults,
|
|
2835
|
+
he as RoundSessionResults,
|
|
2836
|
+
wn as StandingsTable,
|
|
2837
|
+
Qn as StatsCards,
|
|
2838
|
+
ft as TracksTable,
|
|
2839
|
+
hn as TypeBadge,
|
|
2840
|
+
Jn as UpcomingEvents,
|
|
2841
|
+
Ne as buildDriverIndexPath,
|
|
2842
|
+
Oe as buildLapsPath,
|
|
2843
|
+
re as buildLeaderboardPath,
|
|
2844
|
+
ze as buildRecentLapsPath,
|
|
2845
|
+
M as fetchCdnJson,
|
|
2846
|
+
wt as filterCompetitionsByStatus,
|
|
2847
|
+
A as formatCarName,
|
|
2848
|
+
W as formatDate,
|
|
2849
|
+
ht as formatDelta,
|
|
2850
|
+
ye as formatFuel,
|
|
2851
|
+
q as formatLapTime,
|
|
2852
|
+
Qe as formatNotificationMessage,
|
|
2853
|
+
se as formatRelativeTime,
|
|
2854
|
+
E as formatSectorTime,
|
|
2855
|
+
pe as formatSessionLabel,
|
|
2856
|
+
j as formatTrackName,
|
|
2857
|
+
be as formatTyreCompound,
|
|
2858
|
+
fn as getCompetitionPodium,
|
|
2859
|
+
Be as getCompetitionStatus,
|
|
2860
|
+
gn as getCompletionDate,
|
|
2861
|
+
xn as isCompetitionComplete,
|
|
2862
|
+
xt as useCarLeaderboard,
|
|
2863
|
+
mt as useCarMetadata,
|
|
2864
|
+
Xe as useCompetitionAllRounds,
|
|
2865
|
+
we as useCompetitionConfig,
|
|
2866
|
+
Le as useCompetitionEntryList,
|
|
2867
|
+
en as useCompetitionLeaderboard,
|
|
2868
|
+
Ze as useCompetitionRound,
|
|
2869
|
+
nn as useCompetitionRoundLaps,
|
|
2870
|
+
tn as useCompetitionRoundPositions,
|
|
2871
|
+
Ce as useCompetitionStandings,
|
|
2872
|
+
gt as useCompetitions,
|
|
2873
|
+
En as useDriverCombos,
|
|
2874
|
+
Je as useDriverLaps,
|
|
2875
|
+
Mt as useDriverRating,
|
|
2876
|
+
ne as useDriverRatings,
|
|
2877
|
+
qn as useDriverRatingsByGame,
|
|
2878
|
+
Fn as useDriverStats,
|
|
2879
|
+
Ge as useLeaderboardIndex,
|
|
2880
|
+
Hn as useMarkAllNotificationsRead,
|
|
2881
|
+
Kn as useMarkNotificationRead,
|
|
2882
|
+
Vn as useNotifications,
|
|
2883
|
+
jn as useNotificationsEnabled,
|
|
2884
|
+
L as usePitVox,
|
|
2885
|
+
vt as useRecentLaps,
|
|
2886
|
+
Se as useRegister,
|
|
2887
|
+
ie as useRegistrationMode,
|
|
2888
|
+
ae as useRegistrationStatus,
|
|
2889
|
+
oe as useRegistrationUrl,
|
|
2890
|
+
Ye as useTrackLeaderboard,
|
|
2891
|
+
Dt as useUnreadCount,
|
|
2892
|
+
_n as useUpcomingEvents,
|
|
2893
|
+
ke as useUserLookup,
|
|
2894
|
+
$e as useWithdraw
|
|
2697
2895
|
};
|