@pitvox/partner-react 0.7.3 → 0.7.5
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/README.md +19 -2
- package/dist/index.cjs +1 -1
- package/dist/index.js +824 -768
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import { jsx as n, jsxs as c, Fragment as
|
|
1
|
+
import { jsx as n, jsxs as c, Fragment as U } from "react/jsx-runtime";
|
|
2
2
|
import { createContext as Me, useMemo as L, useContext as De, useState as D, useCallback as H, useRef as Ie, useEffect as Be } from "react";
|
|
3
3
|
import { useQueryClient as _, QueryClient as Pe, QueryClientProvider as Ae, useQuery as R, useMutation as O, useQueries as ie } from "@tanstack/react-query";
|
|
4
4
|
const J = Me(null), Ue = "https://cdn.pitvox.com", Ee = "https://pitvox.com";
|
|
5
5
|
let Q = null;
|
|
6
|
-
function
|
|
6
|
+
function Yn({
|
|
7
7
|
partnerSlug: e = null,
|
|
8
|
-
cdnUrl:
|
|
8
|
+
cdnUrl: t = Ue,
|
|
9
9
|
pitvoxUrl: s = Ee,
|
|
10
|
-
getSteamId:
|
|
10
|
+
getSteamId: r,
|
|
11
11
|
onRegister: a,
|
|
12
12
|
onWithdraw: i,
|
|
13
13
|
onFetchNotifications: o,
|
|
14
14
|
onMarkNotificationRead: d,
|
|
15
|
-
onMarkAllNotificationsRead:
|
|
15
|
+
onMarkAllNotificationsRead: u,
|
|
16
16
|
onFetchServerPassword: l,
|
|
17
|
-
children:
|
|
17
|
+
children: p
|
|
18
18
|
}) {
|
|
19
19
|
const f = L(() => ({
|
|
20
20
|
partnerSlug: e,
|
|
21
|
-
cdnUrl:
|
|
21
|
+
cdnUrl: t.replace(/\/$/, ""),
|
|
22
22
|
pitvoxUrl: s.replace(/\/$/, ""),
|
|
23
|
-
getSteamId:
|
|
23
|
+
getSteamId: r || (() => null),
|
|
24
24
|
onRegister: a || null,
|
|
25
25
|
onWithdraw: i || null,
|
|
26
26
|
onFetchNotifications: o || null,
|
|
27
27
|
onMarkNotificationRead: d || null,
|
|
28
|
-
onMarkAllNotificationsRead:
|
|
28
|
+
onMarkAllNotificationsRead: u || null,
|
|
29
29
|
onFetchServerPassword: l || null
|
|
30
|
-
}), [e,
|
|
30
|
+
}), [e, t, s, r, a, i, o, d, u, l]);
|
|
31
31
|
let g = !1;
|
|
32
32
|
try {
|
|
33
33
|
_(), g = !0;
|
|
34
34
|
} catch {
|
|
35
35
|
g = !1;
|
|
36
36
|
}
|
|
37
|
-
return g ? /* @__PURE__ */ n(J.Provider, { value: f, children:
|
|
37
|
+
return g ? /* @__PURE__ */ n(J.Provider, { value: f, children: p }) : (Q || (Q = new Pe({
|
|
38
38
|
defaultOptions: {
|
|
39
39
|
queries: { staleTime: 6e4 }
|
|
40
40
|
}
|
|
41
|
-
})), /* @__PURE__ */ n(Ae, { client: Q, children: /* @__PURE__ */ n(J.Provider, { value: f, children:
|
|
41
|
+
})), /* @__PURE__ */ n(Ae, { client: Q, children: /* @__PURE__ */ n(J.Provider, { value: f, children: p }) }));
|
|
42
42
|
}
|
|
43
43
|
function k() {
|
|
44
44
|
const e = De(J);
|
|
@@ -46,47 +46,47 @@ function k() {
|
|
|
46
46
|
throw new Error("usePitVox must be used within a <PitVoxPartnerProvider>");
|
|
47
47
|
return e;
|
|
48
48
|
}
|
|
49
|
-
async function S(e,
|
|
50
|
-
const s = await fetch(`${e}/${
|
|
49
|
+
async function S(e, t) {
|
|
50
|
+
const s = await fetch(`${e}/${t}`);
|
|
51
51
|
if (!s.ok) {
|
|
52
52
|
if (s.status === 404 || s.status === 403) return null;
|
|
53
53
|
throw new Error(`CDN fetch failed: ${s.status}`);
|
|
54
54
|
}
|
|
55
55
|
return s.json();
|
|
56
56
|
}
|
|
57
|
-
function Z(e,
|
|
57
|
+
function Z(e, t, s, ...r) {
|
|
58
58
|
const a = ["leaderboards"];
|
|
59
|
-
return e && a.push(`partners/${e}`),
|
|
59
|
+
return e && a.push(`partners/${e}`), t && a.push(t), s && a.push(`v/${s}`), [...a, ...r].join("/");
|
|
60
60
|
}
|
|
61
|
-
function Fe(e,
|
|
62
|
-
const a =
|
|
63
|
-
return e ? `laps/partners/${e}/${
|
|
61
|
+
function Fe(e, t, s, r) {
|
|
62
|
+
const a = r || "default";
|
|
63
|
+
return e ? `laps/partners/${e}/${t}/${s}/${a}.json` : `laps/${t}/${s}/${a}.json`;
|
|
64
64
|
}
|
|
65
|
-
function _e(e,
|
|
66
|
-
return e ? `laps/partners/${e}/${
|
|
65
|
+
function _e(e, t) {
|
|
66
|
+
return e ? `laps/partners/${e}/${t}/index.json` : `laps/${t}/index.json`;
|
|
67
67
|
}
|
|
68
68
|
function qe(e) {
|
|
69
69
|
return e ? `recent-laps/partners/${e}.json` : "recent-laps.json";
|
|
70
70
|
}
|
|
71
71
|
function A(e) {
|
|
72
72
|
if (!e && e !== 0) return "-";
|
|
73
|
-
const
|
|
74
|
-
return `${s}:${String(
|
|
73
|
+
const t = Math.floor(e / 1e3), s = Math.floor(t / 60), r = t % 60, a = e % 1e3;
|
|
74
|
+
return `${s}:${String(r).padStart(2, "0")}.${String(a).padStart(3, "0")}`;
|
|
75
75
|
}
|
|
76
76
|
function B(e) {
|
|
77
77
|
return !e && e !== 0 ? "-" : e >= 6e4 ? A(e) : (e / 1e3).toFixed(3);
|
|
78
78
|
}
|
|
79
79
|
function I(e) {
|
|
80
80
|
if (!e) return "";
|
|
81
|
-
let
|
|
82
|
-
return
|
|
81
|
+
let t = e;
|
|
82
|
+
return t.startsWith("ks_") && (t = t.slice(3)), t.split("_").map((s) => s.charAt(0).toUpperCase() + s.slice(1)).join(" ");
|
|
83
83
|
}
|
|
84
|
-
function q(e,
|
|
84
|
+
function q(e, t, s) {
|
|
85
85
|
if (!e) return "";
|
|
86
|
-
const
|
|
87
|
-
if (!
|
|
88
|
-
const i =
|
|
89
|
-
return `${
|
|
86
|
+
const r = e.split("_").map((o) => o.charAt(0).toUpperCase() + o.slice(1)).join(" "), a = s === "acc" || !s && (t == null ? void 0 : t.toLowerCase()) === "track config";
|
|
87
|
+
if (!t || t === "default" || a) return r;
|
|
88
|
+
const i = t.split("_").map((o) => o.charAt(0).toUpperCase() + o.slice(1)).join(" ");
|
|
89
|
+
return `${r} ${i}`;
|
|
90
90
|
}
|
|
91
91
|
function j(e) {
|
|
92
92
|
if (!e) return "-";
|
|
@@ -102,21 +102,21 @@ function j(e) {
|
|
|
102
102
|
}
|
|
103
103
|
function le(e) {
|
|
104
104
|
if (!e) return "";
|
|
105
|
-
const
|
|
105
|
+
const t = Date.now() - new Date(e).getTime(), s = Math.floor(t / 1e3);
|
|
106
106
|
if (s < 60) return "Just now";
|
|
107
|
-
const
|
|
108
|
-
if (
|
|
109
|
-
const a = Math.floor(
|
|
107
|
+
const r = Math.floor(s / 60);
|
|
108
|
+
if (r < 60) return `${r}m ago`;
|
|
109
|
+
const a = Math.floor(r / 60);
|
|
110
110
|
if (a < 24) return `${a}h ago`;
|
|
111
111
|
const i = Math.floor(a / 24);
|
|
112
112
|
return i < 30 ? `${i}d ago` : j(e);
|
|
113
113
|
}
|
|
114
|
-
function
|
|
114
|
+
function Jn(e) {
|
|
115
115
|
return e == null ? "" : `${e >= 0 ? "+" : "-"}${(Math.abs(e) / 1e3).toFixed(3)}`;
|
|
116
116
|
}
|
|
117
|
-
function je(e,
|
|
118
|
-
const { type: s, title:
|
|
119
|
-
return s === "RECORD_BEATEN" && g ? `${l != null && l.beatenBySteamId &&
|
|
117
|
+
function je(e, t) {
|
|
118
|
+
const { type: s, title: r, trackId: a, trackLayout: i, carId: o, game: d, data: u } = e, l = typeof u == "string" ? JSON.parse(u) : u, p = a ? q(a, i, d) : null, f = o ? I(o) : null, g = [p, f].filter(Boolean).join(" — ");
|
|
119
|
+
return s === "RECORD_BEATEN" && g ? `${l != null && l.beatenBySteamId && t ? t(l.beatenBySteamId).displayName : "Someone"} beat your record on ${g}` : s === "RECORD_SET" && g ? `You set a new record on ${g}` : r || "New notification";
|
|
120
120
|
}
|
|
121
121
|
function de(e) {
|
|
122
122
|
return e ? {
|
|
@@ -134,235 +134,244 @@ function de(e) {
|
|
|
134
134
|
}
|
|
135
135
|
function pe(e) {
|
|
136
136
|
if (!e) return "-";
|
|
137
|
-
const
|
|
138
|
-
return isNaN(
|
|
137
|
+
const t = Number(e);
|
|
138
|
+
return isNaN(t) ? "-" : t % 1 ? `${t.toFixed(1)}L` : `${t}L`;
|
|
139
139
|
}
|
|
140
|
-
function
|
|
141
|
-
var
|
|
142
|
-
const { cdnUrl:
|
|
140
|
+
function Zn(e = {}) {
|
|
141
|
+
var u, l, p, f, g, m;
|
|
142
|
+
const { cdnUrl: t, partnerSlug: s } = k(), { game: r, gameVersion: a } = e, i = Z(s, null, null, "index.json"), o = R({
|
|
143
143
|
queryKey: ["pitvox", "leaderboards", s, "index"],
|
|
144
|
-
queryFn: () => S(
|
|
144
|
+
queryFn: () => S(t, i),
|
|
145
145
|
staleTime: 3e4,
|
|
146
146
|
refetchInterval: 3e4
|
|
147
147
|
}), d = L(() => {
|
|
148
148
|
var x;
|
|
149
149
|
if (!((x = o.data) != null && x.tracks)) return [];
|
|
150
150
|
let b = o.data.tracks;
|
|
151
|
-
return
|
|
152
|
-
id:
|
|
153
|
-
layout:
|
|
154
|
-
game:
|
|
155
|
-
gameVersion:
|
|
156
|
-
displayName: q(
|
|
157
|
-
driverCount:
|
|
158
|
-
carCount:
|
|
159
|
-
record:
|
|
160
|
-
visibleId:
|
|
161
|
-
carId:
|
|
162
|
-
carDisplayName: I(
|
|
163
|
-
lapTimeMs:
|
|
164
|
-
timestamp:
|
|
151
|
+
return r && (b = b.filter((v) => v.game === r)), a && (b = b.filter((v) => v.gameVersion === a)), b.map((v) => ({
|
|
152
|
+
id: v.trackId,
|
|
153
|
+
layout: v.layout,
|
|
154
|
+
game: v.game,
|
|
155
|
+
gameVersion: v.gameVersion,
|
|
156
|
+
displayName: q(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: I(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
|
+
}, [(u = o.data) == null ? void 0 : u.tracks, r, a]);
|
|
169
169
|
return {
|
|
170
170
|
...o,
|
|
171
171
|
data: d,
|
|
172
172
|
partner: ((l = o.data) == null ? void 0 : l.partner) || null,
|
|
173
|
-
generatedAt: (
|
|
173
|
+
generatedAt: (p = o.data) == null ? void 0 : p.generatedAt,
|
|
174
174
|
totalLaps: ((f = o.data) == null ? void 0 : f.totalLaps) || 0,
|
|
175
175
|
totalUsers: ((g = o.data) == null ? void 0 : g.totalUsers) || 0,
|
|
176
|
-
versions: ((
|
|
176
|
+
versions: ((m = o.data) == null ? void 0 : m.versions) || {}
|
|
177
177
|
};
|
|
178
178
|
}
|
|
179
|
-
function Ve(e,
|
|
180
|
-
const { cdnUrl:
|
|
181
|
-
queryKey: ["pitvox", "leaderboards", a, "track", e,
|
|
182
|
-
queryFn: () => S(
|
|
179
|
+
function Ve(e, t, s = {}) {
|
|
180
|
+
const { cdnUrl: r, partnerSlug: a } = k(), { carId: i, game: o, gameVersion: d } = s, u = t || "default", l = Z(a, o, d, `tracks/${e}/${u}.json`), { data: p, isLoading: f, error: g } = R({
|
|
181
|
+
queryKey: ["pitvox", "leaderboards", a, "track", e, u, o, d],
|
|
182
|
+
queryFn: () => S(r, l),
|
|
183
183
|
enabled: !!e,
|
|
184
184
|
staleTime: 3e4,
|
|
185
185
|
refetchInterval: 3e4
|
|
186
186
|
});
|
|
187
187
|
return { data: L(() => {
|
|
188
|
-
if (!(
|
|
189
|
-
let b =
|
|
188
|
+
if (!(p != null && p.entries)) return [];
|
|
189
|
+
let b = p.entries;
|
|
190
190
|
if (o && (b = b.filter((x) => x.game === o)), !i) {
|
|
191
|
-
const x = /* @__PURE__ */ new Map(),
|
|
191
|
+
const x = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ new Map();
|
|
192
192
|
for (const N of b) {
|
|
193
193
|
const h = N.steamId || N.userId;
|
|
194
|
-
|
|
194
|
+
v.has(N.carId) || v.set(N.carId, /* @__PURE__ */ new Set()), v.get(N.carId).add(h), (!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
197
|
var h;
|
|
198
|
-
return { ...N, driverCount: ((h =
|
|
198
|
+
return { ...N, driverCount: ((h = v.get(N.carId)) == null ? void 0 : h.size) || 0 };
|
|
199
199
|
}).sort((N, h) => N.lapTimeMs - h.lapTimeMs);
|
|
200
200
|
}
|
|
201
|
-
return b.filter((x) => x.carId === i).sort((x,
|
|
202
|
-
}, [
|
|
203
|
-
}
|
|
204
|
-
function Ke(e,
|
|
205
|
-
var x,
|
|
206
|
-
const { cdnUrl: i, partnerSlug: o } = k(), { showInvalid: d = !1, game:
|
|
207
|
-
queryKey: ["pitvox", "laps", o, e,
|
|
208
|
-
queryFn: () => S(i,
|
|
209
|
-
enabled: !!e && !!
|
|
201
|
+
return b.filter((x) => x.carId === i).sort((x, v) => x.lapTimeMs - v.lapTimeMs);
|
|
202
|
+
}, [p == null ? void 0 : p.entries, i, o]), isLoading: f, error: g };
|
|
203
|
+
}
|
|
204
|
+
function Ke(e, t, s, r, a = {}) {
|
|
205
|
+
var x, v;
|
|
206
|
+
const { cdnUrl: i, partnerSlug: o } = k(), { showInvalid: d = !1, game: u, gameVersion: l } = a, p = e && t ? Fe(o, e, t, s) : null, g = R({
|
|
207
|
+
queryKey: ["pitvox", "laps", o, e, t, s || "default"],
|
|
208
|
+
queryFn: () => S(i, p),
|
|
209
|
+
enabled: !!e && !!t,
|
|
210
210
|
staleTime: 3e4,
|
|
211
211
|
refetchInterval: 3e4
|
|
212
|
-
}),
|
|
212
|
+
}), m = L(() => {
|
|
213
213
|
var N;
|
|
214
|
-
return (N = g.data) != null && N.laps ? g.data.laps.filter((h) => !(h.carId !==
|
|
215
|
-
}, [(x = g.data) == null ? void 0 : x.laps,
|
|
216
|
-
const N =
|
|
214
|
+
return (N = g.data) != null && N.laps ? g.data.laps.filter((h) => !(h.carId !== r || u && h.game !== u || l && h.gameVersion !== l || !d && !h.isValid)).sort((h, y) => h.lapTimeMs - y.lapTimeMs) : [];
|
|
215
|
+
}, [(x = g.data) == null ? void 0 : x.laps, r, u, l, d]), b = L(() => {
|
|
216
|
+
const N = m.filter(($) => $.isValid && $.sector1Ms && $.sector2Ms && $.sector3Ms);
|
|
217
217
|
if (N.length < 2) return null;
|
|
218
218
|
const h = Math.min(...N.map(($) => $.sector1Ms)), y = Math.min(...N.map(($) => $.sector2Ms)), C = Math.min(...N.map(($) => $.sector3Ms)), w = h + y + C, T = Math.min(...N.map(($) => $.lapTimeMs));
|
|
219
219
|
return w >= T ? null : { lapTimeMs: w, sector1Ms: h, sector2Ms: y, sector3Ms: C };
|
|
220
|
-
}, [
|
|
220
|
+
}, [m]);
|
|
221
221
|
return {
|
|
222
222
|
...g,
|
|
223
|
-
data:
|
|
224
|
-
driverName: ((
|
|
223
|
+
data: m,
|
|
224
|
+
driverName: ((v = g.data) == null ? void 0 : v.driverName) || "Driver",
|
|
225
225
|
theoreticalBest: b
|
|
226
226
|
};
|
|
227
227
|
}
|
|
228
228
|
function ue() {
|
|
229
|
-
const { cdnUrl: e } = k(), { data:
|
|
229
|
+
const { cdnUrl: e } = k(), { data: t } = R({
|
|
230
230
|
queryKey: ["pitvox", "users", "index"],
|
|
231
231
|
queryFn: () => S(e, "users/index.json"),
|
|
232
232
|
staleTime: 5 * 6e4,
|
|
233
233
|
gcTime: 30 * 6e4
|
|
234
|
-
}), s = (
|
|
235
|
-
return (
|
|
236
|
-
const i = s[
|
|
234
|
+
}), s = (t == null ? void 0 : t.users) || {};
|
|
235
|
+
return (r, a) => {
|
|
236
|
+
const i = s[r];
|
|
237
237
|
return {
|
|
238
|
-
displayName: (i == null ? void 0 : i.displayName) || a ||
|
|
238
|
+
displayName: (i == null ? void 0 : i.displayName) || a || r || "Unknown",
|
|
239
239
|
avatarUrl: (i == null ? void 0 : i.avatarUrl) || null,
|
|
240
240
|
affiliations: (i == null ? void 0 : i.affiliations) || []
|
|
241
241
|
};
|
|
242
242
|
};
|
|
243
243
|
}
|
|
244
|
-
function
|
|
245
|
-
const { cdnUrl: e } = k(), { data:
|
|
244
|
+
function Xn() {
|
|
245
|
+
const { cdnUrl: e } = k(), { data: t } = R({
|
|
246
246
|
queryKey: ["pitvox", "cars", "evo"],
|
|
247
247
|
queryFn: () => S(e, "cars/evo.json"),
|
|
248
248
|
staleTime: 5 * 6e4,
|
|
249
249
|
gcTime: 30 * 6e4
|
|
250
250
|
});
|
|
251
251
|
return {
|
|
252
|
-
tags: (
|
|
253
|
-
cars: (
|
|
252
|
+
tags: (t == null ? void 0 : t.tags) || [],
|
|
253
|
+
cars: (t == null ? void 0 : t.cars) || {}
|
|
254
254
|
};
|
|
255
255
|
}
|
|
256
|
-
function
|
|
256
|
+
function et() {
|
|
257
257
|
var a, i;
|
|
258
|
-
const { cdnUrl: e, partnerSlug:
|
|
259
|
-
queryKey: ["pitvox", "recentLaps",
|
|
258
|
+
const { cdnUrl: e, partnerSlug: t } = k(), s = qe(t), r = R({
|
|
259
|
+
queryKey: ["pitvox", "recentLaps", t],
|
|
260
260
|
queryFn: () => S(e, s),
|
|
261
261
|
staleTime: 3e4,
|
|
262
262
|
refetchInterval: 3e4,
|
|
263
263
|
gcTime: 10 * 6e4
|
|
264
264
|
});
|
|
265
265
|
return {
|
|
266
|
-
groups: ((a =
|
|
267
|
-
generatedAt: ((i =
|
|
268
|
-
isLoading:
|
|
266
|
+
groups: ((a = r.data) == null ? void 0 : a.groups) || [],
|
|
267
|
+
generatedAt: ((i = r.data) == null ? void 0 : i.generatedAt) || null,
|
|
268
|
+
isLoading: r.isLoading
|
|
269
269
|
};
|
|
270
270
|
}
|
|
271
|
-
function
|
|
272
|
-
return Ve(e, null, { carId:
|
|
271
|
+
function nt(e, t) {
|
|
272
|
+
return Ve(e, null, { carId: t });
|
|
273
273
|
}
|
|
274
|
-
function
|
|
275
|
-
const { cdnUrl: e, partnerSlug:
|
|
274
|
+
function tt() {
|
|
275
|
+
const { cdnUrl: e, partnerSlug: t } = k();
|
|
276
276
|
return R({
|
|
277
|
-
queryKey: ["pitvox", "competitions",
|
|
277
|
+
queryKey: ["pitvox", "competitions", t],
|
|
278
278
|
queryFn: async () => {
|
|
279
279
|
const s = await S(e, "competitions/index.json");
|
|
280
|
-
return s != null && s.competitions ?
|
|
280
|
+
return s != null && s.competitions ? t ? s.competitions.filter((r) => r.partnerSlug === t) : s.competitions : [];
|
|
281
281
|
},
|
|
282
282
|
staleTime: 6e4
|
|
283
283
|
});
|
|
284
284
|
}
|
|
285
|
-
function me(e,
|
|
286
|
-
const s = k(),
|
|
285
|
+
function me(e, t = {}) {
|
|
286
|
+
const s = k(), r = t.partnerSlug || s.partnerSlug;
|
|
287
287
|
return R({
|
|
288
|
-
queryKey: ["pitvox", "competition",
|
|
289
|
-
queryFn: () => S(s.cdnUrl, `competitions/${
|
|
290
|
-
enabled: !!
|
|
288
|
+
queryKey: ["pitvox", "competition", r, e, "config"],
|
|
289
|
+
queryFn: () => S(s.cdnUrl, `competitions/${r}/${e}/config.json`),
|
|
290
|
+
enabled: !!r && !!e,
|
|
291
291
|
staleTime: 6e4
|
|
292
292
|
});
|
|
293
293
|
}
|
|
294
|
-
function ve(e,
|
|
295
|
-
const s = k(),
|
|
294
|
+
function ve(e, t = {}) {
|
|
295
|
+
const s = k(), r = t.partnerSlug || s.partnerSlug;
|
|
296
296
|
return R({
|
|
297
|
-
queryKey: ["pitvox", "competition",
|
|
298
|
-
queryFn: () => S(s.cdnUrl, `competitions/${
|
|
299
|
-
enabled: !!
|
|
297
|
+
queryKey: ["pitvox", "competition", r, e, "standings"],
|
|
298
|
+
queryFn: () => S(s.cdnUrl, `competitions/${r}/${e}/standings.json`),
|
|
299
|
+
enabled: !!r && !!e,
|
|
300
300
|
staleTime: 6e4
|
|
301
301
|
});
|
|
302
302
|
}
|
|
303
|
-
function He(e,
|
|
304
|
-
const
|
|
303
|
+
function He(e, t, s = {}) {
|
|
304
|
+
const r = k(), a = s.partnerSlug || r.partnerSlug;
|
|
305
305
|
return R({
|
|
306
|
-
queryKey: ["pitvox", "competition", a, e, "round",
|
|
307
|
-
queryFn: () => S(
|
|
308
|
-
enabled: !!a && !!e &&
|
|
306
|
+
queryKey: ["pitvox", "competition", a, e, "round", t],
|
|
307
|
+
queryFn: () => S(r.cdnUrl, `competitions/${a}/${e}/rounds/${t}.json`),
|
|
308
|
+
enabled: !!a && !!e && t != null,
|
|
309
309
|
staleTime: 6e4
|
|
310
310
|
});
|
|
311
311
|
}
|
|
312
|
-
function Oe(e,
|
|
313
|
-
const
|
|
312
|
+
function Oe(e, t = [], s = {}) {
|
|
313
|
+
const r = k(), a = s.partnerSlug || r.partnerSlug;
|
|
314
314
|
return R({
|
|
315
|
-
queryKey: ["pitvox", "competition", a, e, "allRounds",
|
|
315
|
+
queryKey: ["pitvox", "competition", a, e, "allRounds", t],
|
|
316
316
|
queryFn: async () => (await Promise.all(
|
|
317
|
-
|
|
318
|
-
(o) => S(
|
|
317
|
+
t.map(
|
|
318
|
+
(o) => S(r.cdnUrl, `competitions/${a}/${e}/rounds/${o}.json`).catch(() => null)
|
|
319
319
|
)
|
|
320
320
|
)).filter(Boolean),
|
|
321
|
-
enabled: !!a && !!e &&
|
|
321
|
+
enabled: !!a && !!e && t.length > 0,
|
|
322
322
|
staleTime: 6e4
|
|
323
323
|
});
|
|
324
324
|
}
|
|
325
|
-
function
|
|
326
|
-
const
|
|
325
|
+
function We(e, t, s = {}) {
|
|
326
|
+
const r = k(), a = s.partnerSlug || r.partnerSlug;
|
|
327
327
|
return R({
|
|
328
|
-
queryKey: ["pitvox", "competition",
|
|
329
|
-
queryFn: () => S(
|
|
330
|
-
enabled: !!
|
|
328
|
+
queryKey: ["pitvox", "competition", a, e, "round", t, "laps"],
|
|
329
|
+
queryFn: () => S(r.cdnUrl, `competitions/${a}/${e}/rounds/${t}/laps.json`).catch(() => null),
|
|
330
|
+
enabled: !!a && !!e && t != null,
|
|
331
|
+
staleTime: 6e4
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
function he(e, t = {}) {
|
|
335
|
+
const s = k(), r = t.partnerSlug || s.partnerSlug;
|
|
336
|
+
return R({
|
|
337
|
+
queryKey: ["pitvox", "competition", r, e, "entrylist"],
|
|
338
|
+
queryFn: () => S(s.cdnUrl, `competitions/${r}/${e}/entrylist.json`),
|
|
339
|
+
enabled: !!r && !!e,
|
|
331
340
|
staleTime: 6e4
|
|
332
341
|
});
|
|
333
342
|
}
|
|
334
343
|
function X(e) {
|
|
335
|
-
const { cdnUrl:
|
|
344
|
+
const { cdnUrl: t, partnerSlug: s, getSteamId: r } = k(), a = r();
|
|
336
345
|
return R({
|
|
337
346
|
queryKey: ["pitvox", "registration", s, e, a],
|
|
338
347
|
queryFn: async () => {
|
|
339
|
-
var
|
|
340
|
-
const i = await fetch(`${
|
|
348
|
+
var u;
|
|
349
|
+
const i = await fetch(`${t}/competitions/${s}/${e}/entrylist.json`);
|
|
341
350
|
if (!i.ok) return { isRegistered: !1, entryList: null };
|
|
342
351
|
const o = await i.json();
|
|
343
|
-
return { isRegistered: !!a && ((
|
|
352
|
+
return { isRegistered: !!a && ((u = o.drivers) == null ? void 0 : u.some((l) => l.steamId === a)), entryList: o };
|
|
344
353
|
},
|
|
345
354
|
enabled: !!e,
|
|
346
355
|
staleTime: 6e4
|
|
347
356
|
});
|
|
348
357
|
}
|
|
349
358
|
function xe(e) {
|
|
350
|
-
const { onRegister:
|
|
359
|
+
const { onRegister: t, partnerSlug: s, getSteamId: r } = k(), a = _(), i = ue();
|
|
351
360
|
return O({
|
|
352
361
|
mutationFn: (o) => {
|
|
353
|
-
if (!
|
|
362
|
+
if (!t)
|
|
354
363
|
throw new Error(
|
|
355
364
|
"No onRegister callback provided to PitVoxPartnerProvider. Provide onRegister for in-app registration, or use useRegistrationUrl() to link to pitvox.com."
|
|
356
365
|
);
|
|
357
|
-
return
|
|
366
|
+
return t(e, o);
|
|
358
367
|
},
|
|
359
368
|
onSuccess: () => {
|
|
360
|
-
const o =
|
|
369
|
+
const o = r();
|
|
361
370
|
if (a.setQueriesData(
|
|
362
371
|
{ queryKey: ["pitvox", "registration", s, e] },
|
|
363
372
|
(d) => d ? { ...d, isRegistered: !0 } : { isRegistered: !0, entryList: null }
|
|
364
373
|
), o) {
|
|
365
|
-
const d = i(o),
|
|
374
|
+
const d = i(o), u = {
|
|
366
375
|
steamId: o,
|
|
367
376
|
displayName: d.displayName,
|
|
368
377
|
avatarUrl: d.avatarUrl
|
|
@@ -371,7 +380,7 @@ function xe(e) {
|
|
|
371
380
|
{ queryKey: ["pitvox", "competition", s, e, "entrylist"] },
|
|
372
381
|
(l) => {
|
|
373
382
|
var f;
|
|
374
|
-
return l ? ((f = l.drivers) == null ? void 0 : f.some((g) => g.steamId === o)) ? l : { ...l, drivers: [...l.drivers || [],
|
|
383
|
+
return l ? ((f = l.drivers) == null ? void 0 : f.some((g) => g.steamId === o)) ? l : { ...l, drivers: [...l.drivers || [], u] } : { drivers: [u] };
|
|
375
384
|
}
|
|
376
385
|
);
|
|
377
386
|
}
|
|
@@ -379,19 +388,19 @@ function xe(e) {
|
|
|
379
388
|
});
|
|
380
389
|
}
|
|
381
390
|
function ge(e) {
|
|
382
|
-
const { onWithdraw:
|
|
391
|
+
const { onWithdraw: t, partnerSlug: s, getSteamId: r } = k(), a = _();
|
|
383
392
|
return O({
|
|
384
393
|
mutationFn: (i) => {
|
|
385
|
-
if (!
|
|
394
|
+
if (!t)
|
|
386
395
|
throw new Error(
|
|
387
396
|
"No onWithdraw callback provided to PitVoxPartnerProvider. Provide onWithdraw for in-app withdrawal, or use useRegistrationUrl() to link to pitvox.com."
|
|
388
397
|
);
|
|
389
|
-
const o = i ||
|
|
398
|
+
const o = i || r();
|
|
390
399
|
if (!o) throw new Error("No Steam ID available");
|
|
391
|
-
return
|
|
400
|
+
return t(e, o);
|
|
392
401
|
},
|
|
393
402
|
onSuccess: () => {
|
|
394
|
-
const i =
|
|
403
|
+
const i = r();
|
|
395
404
|
a.setQueriesData(
|
|
396
405
|
{ queryKey: ["pitvox", "registration", s, e] },
|
|
397
406
|
(o) => o ? { ...o, isRegistered: !1 } : { isRegistered: !1, entryList: null }
|
|
@@ -403,14 +412,14 @@ function ge(e) {
|
|
|
403
412
|
});
|
|
404
413
|
}
|
|
405
414
|
function ee() {
|
|
406
|
-
const { onRegister: e, onWithdraw:
|
|
415
|
+
const { onRegister: e, onWithdraw: t } = k(), s = !!(e && t);
|
|
407
416
|
return { isPowerMode: s, isBasicMode: !s };
|
|
408
417
|
}
|
|
409
418
|
function ne(e) {
|
|
410
|
-
const { pitvoxUrl:
|
|
411
|
-
return `${
|
|
419
|
+
const { pitvoxUrl: t, partnerSlug: s } = k();
|
|
420
|
+
return `${t}/p/${s}/competitions/${e}/register`;
|
|
412
421
|
}
|
|
413
|
-
const
|
|
422
|
+
const ze = {
|
|
414
423
|
formula: "Formula",
|
|
415
424
|
gt3: "GT3",
|
|
416
425
|
gt2: "GT2",
|
|
@@ -435,92 +444,92 @@ const We = {
|
|
|
435
444
|
{ id: "tier", tags: ["hypercar", "supercar", "sports_car", "hot_hatch", "lightweight"] },
|
|
436
445
|
{ id: "era", tags: ["1960s", "1970s", "1980s", "1990s", "2000s", "2010s", "2020s"] }
|
|
437
446
|
];
|
|
438
|
-
function
|
|
439
|
-
for (const
|
|
440
|
-
if (
|
|
447
|
+
function Ge(e) {
|
|
448
|
+
for (const t of fe)
|
|
449
|
+
if (t.tags.includes(e)) return t.id;
|
|
441
450
|
return "other";
|
|
442
451
|
}
|
|
443
|
-
function Ne(e,
|
|
444
|
-
if (
|
|
452
|
+
function Ne(e, t) {
|
|
453
|
+
if (t.size === 0) return !0;
|
|
445
454
|
const s = {};
|
|
446
|
-
for (const
|
|
447
|
-
const a =
|
|
448
|
-
s[a] || (s[a] = []), s[a].push(
|
|
455
|
+
for (const r of t) {
|
|
456
|
+
const a = Ge(r);
|
|
457
|
+
s[a] || (s[a] = []), s[a].push(r);
|
|
449
458
|
}
|
|
450
|
-
for (const
|
|
451
|
-
if (!
|
|
459
|
+
for (const r of Object.values(s))
|
|
460
|
+
if (!r.some((a) => e.includes(a))) return !1;
|
|
452
461
|
return !0;
|
|
453
462
|
}
|
|
454
|
-
function be(e,
|
|
455
|
-
const [s,
|
|
463
|
+
function be(e, t) {
|
|
464
|
+
const [s, r] = D(/* @__PURE__ */ new Set()), a = e !== void 0, i = a ? e : s, o = H((u) => {
|
|
456
465
|
const l = new Set(i);
|
|
457
|
-
l.has(
|
|
458
|
-
}, [i, a,
|
|
459
|
-
a &&
|
|
460
|
-
}, [a,
|
|
466
|
+
l.has(u) ? l.delete(u) : l.add(u), a && t ? t(l) : r(l);
|
|
467
|
+
}, [i, a, t]), d = H(() => {
|
|
468
|
+
a && t ? t(/* @__PURE__ */ new Set()) : r(/* @__PURE__ */ new Set());
|
|
469
|
+
}, [a, t]);
|
|
461
470
|
return { activeTags: i, toggle: o, clear: d };
|
|
462
471
|
}
|
|
463
472
|
function W(e) {
|
|
464
|
-
const [
|
|
473
|
+
const [t, s] = D(e), r = H((a) => {
|
|
465
474
|
s(
|
|
466
475
|
(i) => i.key === a ? { key: a, dir: i.dir === "asc" ? "desc" : "asc" } : { key: a, dir: a.includes("timestamp") || a.includes("Date") ? "desc" : "asc" }
|
|
467
476
|
);
|
|
468
477
|
}, []);
|
|
469
|
-
return [
|
|
478
|
+
return [t, r];
|
|
470
479
|
}
|
|
471
|
-
function z(e,
|
|
472
|
-
return [...e].sort((
|
|
473
|
-
const i = s(
|
|
480
|
+
function z(e, t, s) {
|
|
481
|
+
return [...e].sort((r, a) => {
|
|
482
|
+
const i = s(r, t.key), o = s(a, t.key);
|
|
474
483
|
if (i == null && o == null) return 0;
|
|
475
484
|
if (i == null) return 1;
|
|
476
485
|
if (o == null) return -1;
|
|
477
486
|
const d = typeof i == "string" ? i.localeCompare(o) : i - o;
|
|
478
|
-
return
|
|
487
|
+
return t.dir === "desc" ? -d : d;
|
|
479
488
|
});
|
|
480
489
|
}
|
|
481
|
-
function ye(e,
|
|
482
|
-
const s =
|
|
490
|
+
function ye(e, t = !1) {
|
|
491
|
+
const s = t ? e == null ? void 0 : e.filter((r) => r.isValid) : e;
|
|
483
492
|
return s != null && s.length ? {
|
|
484
|
-
s1: Math.min(...s.map((
|
|
485
|
-
s2: Math.min(...s.map((
|
|
486
|
-
s3: Math.min(...s.map((
|
|
493
|
+
s1: Math.min(...s.map((r) => r.sector1Ms).filter(Boolean)),
|
|
494
|
+
s2: Math.min(...s.map((r) => r.sector2Ms).filter(Boolean)),
|
|
495
|
+
s3: Math.min(...s.map((r) => r.sector3Ms).filter(Boolean))
|
|
487
496
|
} : null;
|
|
488
497
|
}
|
|
489
|
-
function
|
|
490
|
-
return e ?
|
|
498
|
+
function Qe({ active: e, dir: t }) {
|
|
499
|
+
return e ? t === "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" }) });
|
|
491
500
|
}
|
|
492
|
-
function M({ label: e, sortKey:
|
|
501
|
+
function M({ label: e, sortKey: t, config: s, onSort: r, className: a = "" }) {
|
|
493
502
|
return /* @__PURE__ */ n(
|
|
494
503
|
"th",
|
|
495
504
|
{
|
|
496
505
|
className: `pvx-th pvx-th--sortable ${a}`,
|
|
497
|
-
onClick: () => t
|
|
506
|
+
onClick: () => r(t),
|
|
498
507
|
children: /* @__PURE__ */ c("span", { className: "pvx-th-inner", children: [
|
|
499
508
|
e,
|
|
500
|
-
/* @__PURE__ */ n(
|
|
509
|
+
/* @__PURE__ */ n(Qe, { active: s.key === t, dir: s.dir })
|
|
501
510
|
] })
|
|
502
511
|
}
|
|
503
512
|
);
|
|
504
513
|
}
|
|
505
|
-
function G({ userId: e, getUserDisplay:
|
|
506
|
-
const { displayName: s, avatarUrl:
|
|
514
|
+
function G({ userId: e, getUserDisplay: t }) {
|
|
515
|
+
const { displayName: s, avatarUrl: r } = t(e);
|
|
507
516
|
return /* @__PURE__ */ c("span", { className: "pvx-driver", children: [
|
|
508
|
-
|
|
517
|
+
r ? /* @__PURE__ */ n("img", { src: r, alt: "", className: "pvx-driver-avatar" }) : /* @__PURE__ */ n("span", { className: "pvx-driver-avatar pvx-driver-avatar--placeholder" }),
|
|
509
518
|
/* @__PURE__ */ n("span", { className: "pvx-driver-name", children: s })
|
|
510
519
|
] });
|
|
511
520
|
}
|
|
512
|
-
function
|
|
513
|
-
return /* @__PURE__ */ n("span", { className:
|
|
521
|
+
function te({ rank: e, podium: t = !1 }) {
|
|
522
|
+
return /* @__PURE__ */ n("span", { className: t ? 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 });
|
|
514
523
|
}
|
|
515
|
-
function ke({ availableTags: e, activeTags:
|
|
524
|
+
function ke({ availableTags: e, activeTags: t, onToggle: s, onClear: r }) {
|
|
516
525
|
if (!e || e.length < 2) return null;
|
|
517
526
|
const a = fe.map((i) => ({ id: i.id, tags: i.tags.filter((o) => e.includes(o)) })).filter((i) => i.tags.length > 0);
|
|
518
527
|
return /* @__PURE__ */ c("div", { className: "pvx-tag-bar", children: [
|
|
519
528
|
/* @__PURE__ */ n(
|
|
520
529
|
"button",
|
|
521
530
|
{
|
|
522
|
-
onClick:
|
|
523
|
-
className: `pvx-tag ${
|
|
531
|
+
onClick: r,
|
|
532
|
+
className: `pvx-tag ${t.size === 0 ? "pvx-tag--active" : ""}`,
|
|
524
533
|
children: "All"
|
|
525
534
|
}
|
|
526
535
|
),
|
|
@@ -530,21 +539,21 @@ function ke({ availableTags: e, activeTags: r, onToggle: s, onClear: t }) {
|
|
|
530
539
|
"button",
|
|
531
540
|
{
|
|
532
541
|
onClick: () => s(d),
|
|
533
|
-
className: `pvx-tag ${
|
|
534
|
-
children:
|
|
542
|
+
className: `pvx-tag ${t.has(d) ? "pvx-tag--active" : ""}`,
|
|
543
|
+
children: ze[d] || d
|
|
535
544
|
},
|
|
536
545
|
d
|
|
537
546
|
))
|
|
538
547
|
] }, i.id))
|
|
539
548
|
] });
|
|
540
549
|
}
|
|
541
|
-
function
|
|
542
|
-
return /* @__PURE__ */ n("nav", { className: "pvx-breadcrumb", "aria-label": "Breadcrumb", children: /* @__PURE__ */ n("ol", { className: "pvx-breadcrumb-list", children: e.map((
|
|
543
|
-
const
|
|
550
|
+
function re({ segments: e }) {
|
|
551
|
+
return /* @__PURE__ */ n("nav", { className: "pvx-breadcrumb", "aria-label": "Breadcrumb", children: /* @__PURE__ */ n("ol", { className: "pvx-breadcrumb-list", children: e.map((t, s) => {
|
|
552
|
+
const r = s === e.length - 1;
|
|
544
553
|
return /* @__PURE__ */ c("li", { className: "pvx-breadcrumb-item", children: [
|
|
545
554
|
s > 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" }) }),
|
|
546
|
-
!
|
|
547
|
-
] },
|
|
555
|
+
!r && t.onClick ? /* @__PURE__ */ n("button", { onClick: t.onClick, className: "pvx-breadcrumb-link", children: t.label }) : /* @__PURE__ */ n("span", { className: "pvx-breadcrumb-current", children: t.label })
|
|
556
|
+
] }, t.key);
|
|
548
557
|
}) }) });
|
|
549
558
|
}
|
|
550
559
|
function V({ message: e }) {
|
|
@@ -556,44 +565,44 @@ function V({ message: e }) {
|
|
|
556
565
|
function K() {
|
|
557
566
|
return /* @__PURE__ */ n("div", { className: "pvx-loading", children: "Loading..." });
|
|
558
567
|
}
|
|
559
|
-
function
|
|
568
|
+
function Ye() {
|
|
560
569
|
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" }) });
|
|
561
570
|
}
|
|
562
|
-
function
|
|
571
|
+
function Je() {
|
|
563
572
|
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" }) });
|
|
564
573
|
}
|
|
565
|
-
function
|
|
566
|
-
const [d,
|
|
567
|
-
var
|
|
568
|
-
if (!((
|
|
574
|
+
function rt({ tracks: e, isLoading: t, carMetadata: s, getUserDisplay: r, onTrackSelect: a, tags: i, onTagChange: o }) {
|
|
575
|
+
const [d, u] = W({ key: "record.timestamp", dir: "desc" }), { activeTags: l, toggle: p, clear: f } = be(i, o), g = L(() => {
|
|
576
|
+
var v;
|
|
577
|
+
if (!((v = s == null ? void 0 : s.tags) != null && v.length)) return [];
|
|
569
578
|
const x = /* @__PURE__ */ new Set();
|
|
570
579
|
for (const N of e || [])
|
|
571
580
|
N.recordByTag && Object.keys(N.recordByTag).forEach((h) => x.add(h));
|
|
572
581
|
return s.tags.filter((N) => x.has(N));
|
|
573
|
-
}, [e, s]),
|
|
582
|
+
}, [e, s]), m = L(() => e ? l.size === 0 ? e : e.map((x) => {
|
|
574
583
|
var h, y;
|
|
575
584
|
if (!x.recordByTag) return null;
|
|
576
|
-
let
|
|
585
|
+
let v = null;
|
|
577
586
|
const N = /* @__PURE__ */ new Set();
|
|
578
587
|
for (const C of Object.values(x.recordByTag)) {
|
|
579
588
|
if (N.has(C.carId)) continue;
|
|
580
589
|
N.add(C.carId);
|
|
581
590
|
const w = ((y = (h = s == null ? void 0 : s.cars) == null ? void 0 : h[C.carId]) == null ? void 0 : y.tags) || ["sports_car"];
|
|
582
|
-
Ne(w, l) && (!
|
|
591
|
+
Ne(w, l) && (!v || C.lapTimeMs < v.lapTimeMs) && (v = C);
|
|
583
592
|
}
|
|
584
|
-
return
|
|
593
|
+
return v ? {
|
|
585
594
|
...x,
|
|
586
595
|
record: {
|
|
587
|
-
visibleId:
|
|
588
|
-
carId:
|
|
589
|
-
carDisplayName: I(
|
|
590
|
-
lapTimeMs:
|
|
591
|
-
timestamp:
|
|
596
|
+
visibleId: v.steamId || v.identifier,
|
|
597
|
+
carId: v.carId,
|
|
598
|
+
carDisplayName: I(v.carId),
|
|
599
|
+
lapTimeMs: v.lapTimeMs,
|
|
600
|
+
timestamp: v.recordedAt
|
|
592
601
|
}
|
|
593
602
|
} : null;
|
|
594
|
-
}).filter(Boolean) : [], [e, l, s]), b = L(() => z(
|
|
603
|
+
}).filter(Boolean) : [], [e, l, s]), b = L(() => z(m, d, (x, v) => {
|
|
595
604
|
var N, h;
|
|
596
|
-
switch (
|
|
605
|
+
switch (v) {
|
|
597
606
|
case "displayName":
|
|
598
607
|
return x.displayName;
|
|
599
608
|
case "record.lapTimeMs":
|
|
@@ -606,22 +615,22 @@ function nr({ tracks: e, isLoading: r, carMetadata: s, getUserDisplay: t, onTrac
|
|
|
606
615
|
default:
|
|
607
616
|
return (h = x.record) != null && h.timestamp ? new Date(x.record.timestamp).getTime() : 0;
|
|
608
617
|
}
|
|
609
|
-
}), [
|
|
610
|
-
return
|
|
618
|
+
}), [m, d]);
|
|
619
|
+
return t ? /* @__PURE__ */ n(K, {}) : e != null && e.length ? /* @__PURE__ */ c("div", { className: "pvx-card", children: [
|
|
611
620
|
/* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ n("h2", { className: "pvx-card-title", children: "Track Records" }) }),
|
|
612
|
-
/* @__PURE__ */ n(ke, { availableTags: g, activeTags: l, onToggle:
|
|
621
|
+
/* @__PURE__ */ n(ke, { availableTags: g, activeTags: l, onToggle: p, onClear: f }),
|
|
613
622
|
/* @__PURE__ */ n("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ c("table", { className: "pvx-table", children: [
|
|
614
623
|
/* @__PURE__ */ n("thead", { children: /* @__PURE__ */ c("tr", { className: "pvx-thead-row", children: [
|
|
615
|
-
/* @__PURE__ */ n(M, { label: "Track", sortKey: "displayName", config: d, onSort:
|
|
624
|
+
/* @__PURE__ */ n(M, { label: "Track", sortKey: "displayName", config: d, onSort: u }),
|
|
616
625
|
/* @__PURE__ */ n("th", { className: "pvx-th", children: "Record Holder" }),
|
|
617
626
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-lg", children: "Car" }),
|
|
618
|
-
/* @__PURE__ */ n(M, { label: "Lap Time", sortKey: "record.lapTimeMs", config: d, onSort:
|
|
619
|
-
/* @__PURE__ */ n(M, { label: "Drivers", sortKey: "driverCount", config: d, onSort:
|
|
620
|
-
/* @__PURE__ */ n(M, { label: "Cars", sortKey: "carCount", config: d, onSort:
|
|
621
|
-
/* @__PURE__ */ n(M, { label: "Date", sortKey: "record.timestamp", config: d, onSort:
|
|
627
|
+
/* @__PURE__ */ n(M, { label: "Lap Time", sortKey: "record.lapTimeMs", config: d, onSort: u }),
|
|
628
|
+
/* @__PURE__ */ n(M, { label: "Drivers", sortKey: "driverCount", config: d, onSort: u, className: "pvx-hidden-below-md" }),
|
|
629
|
+
/* @__PURE__ */ n(M, { label: "Cars", sortKey: "carCount", config: d, onSort: u, className: "pvx-hidden-below-lg" }),
|
|
630
|
+
/* @__PURE__ */ n(M, { label: "Date", sortKey: "record.timestamp", config: d, onSort: u, className: "pvx-hidden-below-xl" })
|
|
622
631
|
] }) }),
|
|
623
632
|
/* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: b.map((x) => {
|
|
624
|
-
var
|
|
633
|
+
var v, N, h;
|
|
625
634
|
return /* @__PURE__ */ c(
|
|
626
635
|
"tr",
|
|
627
636
|
{
|
|
@@ -629,7 +638,7 @@ function nr({ tracks: e, isLoading: r, carMetadata: s, getUserDisplay: t, onTrac
|
|
|
629
638
|
onClick: () => a(x.id, x.layout),
|
|
630
639
|
children: [
|
|
631
640
|
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary", children: x.displayName }),
|
|
632
|
-
/* @__PURE__ */ n("td", { className: "pvx-td", children: (
|
|
641
|
+
/* @__PURE__ */ n("td", { className: "pvx-td", children: (v = x.record) != null && v.visibleId ? /* @__PURE__ */ n(G, { userId: x.record.visibleId, getUserDisplay: r }) : "-" }),
|
|
633
642
|
/* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-lg", children: ((N = x.record) == null ? void 0 : N.carDisplayName) || "-" }),
|
|
634
643
|
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: x.record ? A(x.record.lapTimeMs) : "-" }),
|
|
635
644
|
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-md", children: x.driverCount || "-" }),
|
|
@@ -643,19 +652,19 @@ function nr({ tracks: e, isLoading: r, carMetadata: s, getUserDisplay: t, onTrac
|
|
|
643
652
|
] }) })
|
|
644
653
|
] }) : /* @__PURE__ */ n(V, { message: "No lap times recorded yet." });
|
|
645
654
|
}
|
|
646
|
-
function
|
|
647
|
-
const [l,
|
|
655
|
+
function st({ entries: e, isLoading: t, track: s, carMetadata: r, getUserDisplay: a, onCarSelect: i, onNavigate: o, tags: d, onTagChange: u }) {
|
|
656
|
+
const [l, p] = W({ key: "lapTimeMs", dir: "asc" }), { activeTags: f, toggle: g, clear: m } = be(d, u), b = L(() => {
|
|
648
657
|
var y, C, w;
|
|
649
|
-
if (!e || !((y =
|
|
658
|
+
if (!e || !((y = r == null ? void 0 : r.tags) != null && y.length)) return [];
|
|
650
659
|
const h = /* @__PURE__ */ new Set();
|
|
651
660
|
for (const T of e)
|
|
652
|
-
(((w = (C =
|
|
653
|
-
return
|
|
654
|
-
}, [e,
|
|
661
|
+
(((w = (C = r.cars) == null ? void 0 : C[T.carId]) == null ? void 0 : w.tags) || ["sports_car"]).forEach((F) => h.add(F));
|
|
662
|
+
return r.tags.filter((T) => h.has(T));
|
|
663
|
+
}, [e, r]), x = L(() => e ? f.size === 0 ? e : e.filter((h) => {
|
|
655
664
|
var C, w;
|
|
656
|
-
const y = ((w = (C =
|
|
665
|
+
const y = ((w = (C = r == null ? void 0 : r.cars) == null ? void 0 : C[h.carId]) == null ? void 0 : w.tags) || ["sports_car"];
|
|
657
666
|
return Ne(y, f);
|
|
658
|
-
}) : [], [e, f,
|
|
667
|
+
}) : [], [e, f, r]), v = L(() => z(x, l, (h, y) => {
|
|
659
668
|
switch (y) {
|
|
660
669
|
case "carId":
|
|
661
670
|
return I(h.carId);
|
|
@@ -669,25 +678,25 @@ function rr({ entries: e, isLoading: r, track: s, carMetadata: t, getUserDisplay
|
|
|
669
678
|
{ key: "tracks", label: "Tracks", onClick: () => o("tracks") },
|
|
670
679
|
{ key: "track", label: s.displayName }
|
|
671
680
|
];
|
|
672
|
-
return
|
|
673
|
-
/* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ n(
|
|
674
|
-
/* @__PURE__ */ n(ke, { availableTags: b, activeTags: f, onToggle: g, onClear:
|
|
681
|
+
return t ? /* @__PURE__ */ n(K, {}) : /* @__PURE__ */ c("div", { className: "pvx-card", children: [
|
|
682
|
+
/* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ n(re, { segments: N }) }),
|
|
683
|
+
/* @__PURE__ */ n(ke, { availableTags: b, activeTags: f, onToggle: g, onClear: m }),
|
|
675
684
|
e != null && e.length ? /* @__PURE__ */ n("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ c("table", { className: "pvx-table", children: [
|
|
676
685
|
/* @__PURE__ */ n("thead", { children: /* @__PURE__ */ c("tr", { className: "pvx-thead-row", children: [
|
|
677
686
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-th--narrow", children: "#" }),
|
|
678
|
-
/* @__PURE__ */ n(M, { label: "Car", sortKey: "carId", config: l, onSort:
|
|
687
|
+
/* @__PURE__ */ n(M, { label: "Car", sortKey: "carId", config: l, onSort: p }),
|
|
679
688
|
/* @__PURE__ */ n("th", { className: "pvx-th", children: "Record Holder" }),
|
|
680
|
-
/* @__PURE__ */ n(M, { label: "Lap Time", sortKey: "lapTimeMs", config: l, onSort:
|
|
681
|
-
/* @__PURE__ */ n(M, { label: "Drivers", sortKey: "driverCount", config: l, onSort:
|
|
689
|
+
/* @__PURE__ */ n(M, { label: "Lap Time", sortKey: "lapTimeMs", config: l, onSort: p }),
|
|
690
|
+
/* @__PURE__ */ n(M, { label: "Drivers", sortKey: "driverCount", config: l, onSort: p, className: "pvx-hidden-below-md" }),
|
|
682
691
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-lg", children: "Date" })
|
|
683
692
|
] }) }),
|
|
684
|
-
/* @__PURE__ */ n("tbody", { className: "pvx-tbody", children:
|
|
693
|
+
/* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: v.map((h, y) => /* @__PURE__ */ c(
|
|
685
694
|
"tr",
|
|
686
695
|
{
|
|
687
696
|
className: "pvx-row pvx-row--clickable",
|
|
688
697
|
onClick: () => i(h.carId),
|
|
689
698
|
children: [
|
|
690
|
-
/* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(
|
|
699
|
+
/* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(te, { rank: y + 1, podium: !0 }) }),
|
|
691
700
|
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary", children: I(h.carId) }),
|
|
692
701
|
/* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(G, { userId: h.steamId || h.userId, getUserDisplay: a }) }),
|
|
693
702
|
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: A(h.lapTimeMs) }),
|
|
@@ -700,77 +709,77 @@ function rr({ entries: e, isLoading: r, track: s, carMetadata: t, getUserDisplay
|
|
|
700
709
|
] }) }) : /* @__PURE__ */ n(V, { message: "No lap times for this track yet." })
|
|
701
710
|
] });
|
|
702
711
|
}
|
|
703
|
-
function
|
|
704
|
-
const [
|
|
712
|
+
function at({ entries: e, isLoading: t, track: s, carId: r, getUserDisplay: a, onDriverSelect: i, onNavigate: o, highlightId: d }) {
|
|
713
|
+
const [u, l] = W({ key: "lapTimeMs", dir: "asc" }), p = L(() => ye(e), [e]), f = L(() => z(e || [], u, (m, b) => {
|
|
705
714
|
switch (b) {
|
|
706
715
|
case "userId":
|
|
707
|
-
return a(
|
|
716
|
+
return a(m.steamId || m.userId).displayName;
|
|
708
717
|
case "lapCount":
|
|
709
|
-
return
|
|
718
|
+
return m.lapCount || 0;
|
|
710
719
|
case "lapTimeMs":
|
|
711
720
|
default:
|
|
712
|
-
return
|
|
721
|
+
return m.lapTimeMs;
|
|
713
722
|
}
|
|
714
|
-
}), [e,
|
|
723
|
+
}), [e, u, a]), g = [
|
|
715
724
|
{ key: "tracks", label: "Tracks", onClick: () => o("tracks") },
|
|
716
725
|
{ key: "track", label: s.displayName, onClick: () => o("track") },
|
|
717
|
-
{ key: "car", label: I(
|
|
726
|
+
{ key: "car", label: I(r) }
|
|
718
727
|
];
|
|
719
|
-
return
|
|
720
|
-
/* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ n(
|
|
728
|
+
return t ? /* @__PURE__ */ n(K, {}) : /* @__PURE__ */ c("div", { className: "pvx-card", children: [
|
|
729
|
+
/* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ n(re, { segments: g }) }),
|
|
721
730
|
e != null && e.length ? /* @__PURE__ */ n("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ c("table", { className: "pvx-table", children: [
|
|
722
731
|
/* @__PURE__ */ n("thead", { children: /* @__PURE__ */ c("tr", { className: "pvx-thead-row", children: [
|
|
723
732
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-th--narrow", children: "#" }),
|
|
724
|
-
/* @__PURE__ */ n(M, { label: "Driver", sortKey: "userId", config:
|
|
725
|
-
/* @__PURE__ */ n(M, { label: "Lap Time", sortKey: "lapTimeMs", config:
|
|
733
|
+
/* @__PURE__ */ n(M, { label: "Driver", sortKey: "userId", config: u, onSort: l }),
|
|
734
|
+
/* @__PURE__ */ n(M, { label: "Lap Time", sortKey: "lapTimeMs", config: u, onSort: l }),
|
|
726
735
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "S1" }),
|
|
727
736
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "S2" }),
|
|
728
737
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "S3" }),
|
|
729
738
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-lg", children: "Tyre" }),
|
|
730
739
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-xl", children: "Fuel" }),
|
|
731
|
-
/* @__PURE__ */ n(M, { label: "Laps", sortKey: "lapCount", config:
|
|
740
|
+
/* @__PURE__ */ n(M, { label: "Laps", sortKey: "lapCount", config: u, onSort: l, className: "pvx-hidden-below-lg" }),
|
|
732
741
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-xl", children: "Date" })
|
|
733
742
|
] }) }),
|
|
734
|
-
/* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: f.map((
|
|
735
|
-
const x = b + 1,
|
|
743
|
+
/* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: f.map((m, b) => {
|
|
744
|
+
const x = b + 1, v = m.steamId || m.userId, N = p && m.sector1Ms === p.s1, h = p && m.sector2Ms === p.s2, y = p && m.sector3Ms === p.s3;
|
|
736
745
|
return /* @__PURE__ */ c(
|
|
737
746
|
"tr",
|
|
738
747
|
{
|
|
739
|
-
className: `pvx-row pvx-row--clickable ${d &&
|
|
740
|
-
onClick: () => i(
|
|
748
|
+
className: `pvx-row pvx-row--clickable ${d && v === d ? "pvx-row--highlight" : x <= 3 ? "pvx-row--podium" : ""}`,
|
|
749
|
+
onClick: () => i(v),
|
|
741
750
|
children: [
|
|
742
|
-
/* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(
|
|
743
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary", children: /* @__PURE__ */ n(G, { userId:
|
|
744
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: A(
|
|
745
|
-
/* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${N ? "pvx-td--best-sector" : ""}`, children: B(
|
|
746
|
-
/* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${h ? "pvx-td--best-sector" : ""}`, children: B(
|
|
747
|
-
/* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${y ? "pvx-td--best-sector" : ""}`, children: B(
|
|
748
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", title: de(
|
|
749
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-xl", children: pe(
|
|
750
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children:
|
|
751
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children:
|
|
751
|
+
/* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(te, { rank: x, podium: !0 }) }),
|
|
752
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary", children: /* @__PURE__ */ n(G, { userId: v, getUserDisplay: a }) }),
|
|
753
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: A(m.lapTimeMs) }),
|
|
754
|
+
/* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${N ? "pvx-td--best-sector" : ""}`, children: B(m.sector1Ms) }),
|
|
755
|
+
/* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${h ? "pvx-td--best-sector" : ""}`, children: B(m.sector2Ms) }),
|
|
756
|
+
/* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${y ? "pvx-td--best-sector" : ""}`, children: B(m.sector3Ms) }),
|
|
757
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", title: de(m.tyreCompound), children: m.tyreCompound || "-" }),
|
|
758
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-xl", children: pe(m.startingFuelL) }),
|
|
759
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children: m.lapCount || "-" }),
|
|
760
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: m.recordedAt ? j(m.recordedAt) : "-" })
|
|
752
761
|
]
|
|
753
762
|
},
|
|
754
|
-
|
|
763
|
+
v
|
|
755
764
|
);
|
|
756
765
|
}) })
|
|
757
766
|
] }) }) : /* @__PURE__ */ n(V, { message: "No lap times for this car yet." })
|
|
758
767
|
] });
|
|
759
768
|
}
|
|
760
|
-
function
|
|
761
|
-
const { data: l, driverName:
|
|
769
|
+
function it({ userId: e, track: t, carId: s, game: r, gameVersion: a, showInvalid: i, getUserDisplay: o, onToggleInvalid: d, onNavigate: u }) {
|
|
770
|
+
const { data: l, driverName: p, theoreticalBest: f, isLoading: g } = Ke(e, t.id, t.layout, s, { showInvalid: i, game: r, gameVersion: a }), { displayName: m, avatarUrl: b } = o(e, p), x = L(() => ye(l, !0), [l]), v = L(() => {
|
|
762
771
|
const h = (l == null ? void 0 : l.filter((y) => y.isValid)) || [];
|
|
763
772
|
return h.length ? Math.min(...h.map((y) => y.lapTimeMs)) : null;
|
|
764
773
|
}, [l]), N = [
|
|
765
|
-
{ key: "tracks", label: "Tracks", onClick: () =>
|
|
766
|
-
{ key: "track", label:
|
|
767
|
-
{ key: "car", label: I(s), onClick: () =>
|
|
768
|
-
{ key: "driver", label:
|
|
774
|
+
{ key: "tracks", label: "Tracks", onClick: () => u("tracks") },
|
|
775
|
+
{ key: "track", label: t.displayName, onClick: () => u("track") },
|
|
776
|
+
{ key: "car", label: I(s), onClick: () => u("car") },
|
|
777
|
+
{ key: "driver", label: m }
|
|
769
778
|
];
|
|
770
779
|
return g ? /* @__PURE__ */ n(K, {}) : /* @__PURE__ */ c("div", { className: "pvx-card", children: [
|
|
771
780
|
/* @__PURE__ */ c("div", { className: "pvx-card-header pvx-card-header--split", children: [
|
|
772
781
|
/* @__PURE__ */ c("div", { className: "pvx-card-header-left", children: [
|
|
773
|
-
/* @__PURE__ */ n(
|
|
782
|
+
/* @__PURE__ */ n(re, { segments: N }),
|
|
774
783
|
b ? /* @__PURE__ */ n("img", { src: b, alt: "", className: "pvx-driver-avatar pvx-driver-avatar--lg" }) : /* @__PURE__ */ n("span", { className: "pvx-driver-avatar pvx-driver-avatar--lg pvx-driver-avatar--placeholder" })
|
|
775
784
|
] }),
|
|
776
785
|
/* @__PURE__ */ c("label", { className: "pvx-checkbox-label", children: [
|
|
@@ -813,16 +822,16 @@ function sr({ userId: e, track: r, carId: s, game: t, gameVersion: a, showInvali
|
|
|
813
822
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-xl", children: "Date" })
|
|
814
823
|
] }) }),
|
|
815
824
|
/* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: l.map((h, y) => {
|
|
816
|
-
const C = h.isValid && h.lapTimeMs ===
|
|
817
|
-
let
|
|
818
|
-
return h.isValid || (
|
|
825
|
+
const C = h.isValid && h.lapTimeMs === v, w = x && h.isValid && h.sector1Ms === x.s1, T = x && h.isValid && h.sector2Ms === x.s2, $ = x && h.isValid && h.sector3Ms === x.s3;
|
|
826
|
+
let F = "pvx-row";
|
|
827
|
+
return h.isValid || (F += " pvx-row--invalid"), C && (F += " pvx-row--personal-best"), /* @__PURE__ */ c("tr", { className: F, children: [
|
|
819
828
|
/* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n("span", { className: `pvx-rank ${C ? "pvx-rank--gold" : ""}`, children: y + 1 }) }),
|
|
820
829
|
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-md", children: h.lapNumber || "-" }),
|
|
821
830
|
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: A(h.lapTimeMs) }),
|
|
822
831
|
/* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${w ? "pvx-td--best-sector" : ""}`, children: B(h.sector1Ms) }),
|
|
823
832
|
/* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${T ? "pvx-td--best-sector" : ""}`, children: B(h.sector2Ms) }),
|
|
824
833
|
/* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${$ ? "pvx-td--best-sector" : ""}`, children: B(h.sector3Ms) }),
|
|
825
|
-
/* @__PURE__ */ n("td", { className: "pvx-td", title: h.isValid ? void 0 : h.invalidReason || "Invalid", children: h.isValid ? /* @__PURE__ */ n(
|
|
834
|
+
/* @__PURE__ */ n("td", { className: "pvx-td", title: h.isValid ? void 0 : h.invalidReason || "Invalid", children: h.isValid ? /* @__PURE__ */ n(Ye, {}) : /* @__PURE__ */ n(Je, {}) }),
|
|
826
835
|
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", title: de(h.tyreCompound), children: h.tyreCompound || "-" }),
|
|
827
836
|
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children: pe(h.startingFuelL) }),
|
|
828
837
|
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: j(h.timestamp) })
|
|
@@ -831,9 +840,9 @@ function sr({ userId: e, track: r, carId: s, game: t, gameVersion: a, showInvali
|
|
|
831
840
|
] }) }) : /* @__PURE__ */ n(V, { message: i ? "No laps recorded for this combination." : 'No valid laps. Try enabling "Show invalid laps".' })
|
|
832
841
|
] });
|
|
833
842
|
}
|
|
834
|
-
function
|
|
835
|
-
const [o, d] = W({ key: "rank", dir: "asc" }), [
|
|
836
|
-
switch (
|
|
843
|
+
function ot({ drivers: e, isLoading: t, getUserDisplay: s, game: r, gameVersion: a, onComboSelect: i }) {
|
|
844
|
+
const [o, d] = W({ key: "rank", dir: "asc" }), [u, l] = D(null), p = L(() => e ? z(e, o, (g, m) => {
|
|
845
|
+
switch (m) {
|
|
837
846
|
case "rating":
|
|
838
847
|
return g.rating;
|
|
839
848
|
case "comboCount":
|
|
@@ -845,7 +854,7 @@ function ar({ drivers: e, isLoading: r, getUserDisplay: s, game: t, gameVersion:
|
|
|
845
854
|
return g.rank;
|
|
846
855
|
}
|
|
847
856
|
}) : [], [e, o]);
|
|
848
|
-
if (
|
|
857
|
+
if (t) return /* @__PURE__ */ n(K, {});
|
|
849
858
|
if (!(e != null && e.length))
|
|
850
859
|
return /* @__PURE__ */ n("div", { className: "pvx-card", children: /* @__PURE__ */ n(V, { message: "Not enough data for rankings yet." }) });
|
|
851
860
|
const f = 5;
|
|
@@ -873,17 +882,17 @@ function ar({ drivers: e, isLoading: r, getUserDisplay: s, game: t, gameVersion:
|
|
|
873
882
|
/* @__PURE__ */ n(M, { label: "Cars", sortKey: "distinctCars", config: o, onSort: d, className: "pvx-hidden-below-sm" }),
|
|
874
883
|
/* @__PURE__ */ n(M, { label: "Combos", sortKey: "comboCount", config: o, onSort: d, className: "pvx-hidden-below-sm" })
|
|
875
884
|
] }) }),
|
|
876
|
-
/* @__PURE__ */ n("tbody", { className: "pvx-tbody", children:
|
|
877
|
-
const
|
|
885
|
+
/* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: p.map((g) => {
|
|
886
|
+
const m = u === g.identifier;
|
|
878
887
|
return /* @__PURE__ */ n(
|
|
879
|
-
|
|
888
|
+
Ze,
|
|
880
889
|
{
|
|
881
890
|
driver: g,
|
|
882
891
|
getUserDisplay: s,
|
|
883
|
-
isExpanded:
|
|
884
|
-
onToggle: () => l(
|
|
892
|
+
isExpanded: m,
|
|
893
|
+
onToggle: () => l(m ? null : g.identifier),
|
|
885
894
|
colCount: f,
|
|
886
|
-
game:
|
|
895
|
+
game: r,
|
|
887
896
|
gameVersion: a,
|
|
888
897
|
onComboSelect: i
|
|
889
898
|
},
|
|
@@ -893,17 +902,17 @@ function ar({ drivers: e, isLoading: r, getUserDisplay: s, game: t, gameVersion:
|
|
|
893
902
|
] }) })
|
|
894
903
|
] });
|
|
895
904
|
}
|
|
896
|
-
function
|
|
897
|
-
const
|
|
898
|
-
return /* @__PURE__ */ c(
|
|
905
|
+
function Ze({ driver: e, getUserDisplay: t, isExpanded: s, onToggle: r, colCount: a, game: i, gameVersion: o, onComboSelect: d }) {
|
|
906
|
+
const u = e.identifier;
|
|
907
|
+
return /* @__PURE__ */ c(U, { children: [
|
|
899
908
|
/* @__PURE__ */ c(
|
|
900
909
|
"tr",
|
|
901
910
|
{
|
|
902
911
|
className: `pvx-row pvx-row--clickable ${e.rank <= 3 ? "pvx-row--podium" : ""}`,
|
|
903
|
-
onClick:
|
|
912
|
+
onClick: r,
|
|
904
913
|
children: [
|
|
905
|
-
/* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(
|
|
906
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary", children: /* @__PURE__ */ n(G, { userId:
|
|
914
|
+
/* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(te, { rank: e.rank, podium: !0 }) }),
|
|
915
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary", children: /* @__PURE__ */ n(G, { userId: u, getUserDisplay: t }) }),
|
|
907
916
|
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: e.rating.toFixed(1) }),
|
|
908
917
|
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: e.distinctCars || "-" }),
|
|
909
918
|
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: /* @__PURE__ */ c("span", { className: "pvx-rankings-combo-count", children: [
|
|
@@ -913,8 +922,8 @@ function Je({ driver: e, getUserDisplay: r, isExpanded: s, onToggle: t, colCount
|
|
|
913
922
|
]
|
|
914
923
|
}
|
|
915
924
|
),
|
|
916
|
-
s && 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((l,
|
|
917
|
-
const f = l.layout ? `${l.trackId}|${l.layout}` : l.trackId, g = d ? () => d({ track: f, car: l.carId, highlight:
|
|
925
|
+
s && 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((l, p) => {
|
|
926
|
+
const f = l.layout ? `${l.trackId}|${l.layout}` : l.trackId, g = d ? () => d({ track: f, car: l.carId, highlight: u, game: i, gameVersion: o }) : void 0;
|
|
918
927
|
return /* @__PURE__ */ c(
|
|
919
928
|
"div",
|
|
920
929
|
{
|
|
@@ -942,12 +951,12 @@ function Je({ driver: e, getUserDisplay: r, isExpanded: s, onToggle: t, colCount
|
|
|
942
951
|
] })
|
|
943
952
|
]
|
|
944
953
|
},
|
|
945
|
-
|
|
954
|
+
p
|
|
946
955
|
);
|
|
947
956
|
}) }) }) })
|
|
948
957
|
] });
|
|
949
958
|
}
|
|
950
|
-
const
|
|
959
|
+
const Xe = {
|
|
951
960
|
GBR: "🇬🇧",
|
|
952
961
|
DEU: "🇩🇪",
|
|
953
962
|
NLD: "🇳🇱",
|
|
@@ -978,7 +987,7 @@ const Ze = {
|
|
|
978
987
|
RUS: "🇷🇺",
|
|
979
988
|
TUR: "🇹🇷",
|
|
980
989
|
KOR: "🇰🇷"
|
|
981
|
-
}, se = ["🥇", "🥈", "🥉"],
|
|
990
|
+
}, se = ["🥇", "🥈", "🥉"], en = {
|
|
982
991
|
championship: "Championship",
|
|
983
992
|
series: "Series",
|
|
984
993
|
event: "Event"
|
|
@@ -987,87 +996,87 @@ function we({ position: e }) {
|
|
|
987
996
|
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 });
|
|
988
997
|
}
|
|
989
998
|
function ae({ nation: e }) {
|
|
990
|
-
const
|
|
991
|
-
return
|
|
999
|
+
const t = e && Xe[e];
|
|
1000
|
+
return t ? /* @__PURE__ */ n("span", { className: "pvx-nation-flag", title: e, children: t }) : null;
|
|
992
1001
|
}
|
|
993
|
-
function
|
|
1002
|
+
function nn({ sessions: e, activeSession: t, onSelect: s }) {
|
|
994
1003
|
if (!e || e.length <= 1) return null;
|
|
995
|
-
const
|
|
1004
|
+
const r = [...e].sort(
|
|
996
1005
|
(a, i) => oe.indexOf(a.type) - oe.indexOf(i.type)
|
|
997
1006
|
);
|
|
998
|
-
return /* @__PURE__ */ n("div", { className: "pvx-session-tabs", children:
|
|
1007
|
+
return /* @__PURE__ */ n("div", { className: "pvx-session-tabs", children: r.map((a) => /* @__PURE__ */ n(
|
|
999
1008
|
"button",
|
|
1000
1009
|
{
|
|
1001
1010
|
onClick: () => s(a.type),
|
|
1002
|
-
className: `pvx-session-tab ${
|
|
1011
|
+
className: `pvx-session-tab ${t === a.type ? "pvx-session-tab--active" : ""}`,
|
|
1003
1012
|
children: a.type
|
|
1004
1013
|
},
|
|
1005
1014
|
a.type
|
|
1006
1015
|
)) });
|
|
1007
1016
|
}
|
|
1008
|
-
function
|
|
1009
|
-
return /* @__PURE__ */ n("span", { className: `pvx-comp-badge pvx-comp-badge--${e}`, children:
|
|
1017
|
+
function tn({ type: e }) {
|
|
1018
|
+
return /* @__PURE__ */ n("span", { className: `pvx-comp-badge pvx-comp-badge--${e}`, children: en[e] || e });
|
|
1010
1019
|
}
|
|
1011
|
-
function Y({ children: e, variant:
|
|
1012
|
-
return /* @__PURE__ */ n("span", { className: `pvx-info-pill ${
|
|
1020
|
+
function Y({ children: e, variant: t = "default" }) {
|
|
1021
|
+
return /* @__PURE__ */ n("span", { className: `pvx-info-pill ${t !== "default" ? `pvx-info-pill--${t}` : ""}`, children: e });
|
|
1013
1022
|
}
|
|
1014
1023
|
function rn(e) {
|
|
1015
1024
|
if (!e) return "TBD";
|
|
1016
|
-
const
|
|
1017
|
-
if (isNaN(
|
|
1018
|
-
const s =
|
|
1019
|
-
return `${s} • ${
|
|
1020
|
-
}
|
|
1021
|
-
function
|
|
1022
|
-
return e.reduce((
|
|
1023
|
-
var
|
|
1024
|
-
return (
|
|
1025
|
+
const t = new Date(e);
|
|
1026
|
+
if (isNaN(t)) return "TBD";
|
|
1027
|
+
const s = t.toLocaleDateString("en-GB", { weekday: "short", day: "numeric", month: "short" }), r = t.toLocaleTimeString("en-GB", { hour: "2-digit", minute: "2-digit" });
|
|
1028
|
+
return `${s} • ${r}`;
|
|
1029
|
+
}
|
|
1030
|
+
function sn(e) {
|
|
1031
|
+
return e.reduce((t, s) => {
|
|
1032
|
+
var r;
|
|
1033
|
+
return (r = s.splits) != null && r.length ? t ? t.map((a, i) => {
|
|
1025
1034
|
const o = s.splits[i];
|
|
1026
1035
|
return o && o < a ? o : a;
|
|
1027
|
-
}) : [...s.splits] :
|
|
1036
|
+
}) : [...s.splits] : t;
|
|
1028
1037
|
}, null);
|
|
1029
1038
|
}
|
|
1030
|
-
function
|
|
1039
|
+
function E({ message: e = "Loading..." }) {
|
|
1031
1040
|
return /* @__PURE__ */ n("div", { className: "pvx-loading", children: e });
|
|
1032
1041
|
}
|
|
1033
1042
|
function P({ message: e = "No data available." }) {
|
|
1034
1043
|
return /* @__PURE__ */ n("div", { className: "pvx-empty", children: /* @__PURE__ */ n("p", { children: e }) });
|
|
1035
1044
|
}
|
|
1036
1045
|
const Ce = 3;
|
|
1037
|
-
function sn(e) {
|
|
1038
|
-
const r = e == null ? void 0 : e.rounds;
|
|
1039
|
-
return r != null && r.length ? r.every((s) => s.isFinalized) : !1;
|
|
1040
|
-
}
|
|
1041
1046
|
function an(e) {
|
|
1042
|
-
const
|
|
1043
|
-
|
|
1047
|
+
const t = e == null ? void 0 : e.rounds;
|
|
1048
|
+
return t != null && t.length ? t.every((s) => s.isFinalized) : !1;
|
|
1049
|
+
}
|
|
1050
|
+
function on(e) {
|
|
1051
|
+
const t = e == null ? void 0 : e.rounds;
|
|
1052
|
+
if (!(t != null && t.length)) return null;
|
|
1044
1053
|
let s = null;
|
|
1045
|
-
for (const
|
|
1046
|
-
if (!
|
|
1047
|
-
const a = new Date(
|
|
1054
|
+
for (const r of t) {
|
|
1055
|
+
if (!r.startTime) continue;
|
|
1056
|
+
const a = new Date(r.startTime);
|
|
1048
1057
|
isNaN(a) || (!s || a > s) && (s = a);
|
|
1049
1058
|
}
|
|
1050
1059
|
return s;
|
|
1051
1060
|
}
|
|
1052
|
-
function Le(e,
|
|
1053
|
-
if (!
|
|
1054
|
-
const s =
|
|
1061
|
+
function Le(e, t = Ce) {
|
|
1062
|
+
if (!an(e)) return "active";
|
|
1063
|
+
const s = on(e);
|
|
1055
1064
|
if (!s) return "recently-completed";
|
|
1056
|
-
const
|
|
1057
|
-
return Date.now() - s.getTime() <=
|
|
1065
|
+
const r = t * 24 * 60 * 60 * 1e3;
|
|
1066
|
+
return Date.now() - s.getTime() <= r ? "recently-completed" : "archived";
|
|
1058
1067
|
}
|
|
1059
|
-
function
|
|
1068
|
+
function ct(e, t, s = Ce) {
|
|
1060
1069
|
if (!(e != null && e.length)) return [];
|
|
1061
|
-
const
|
|
1062
|
-
return e.filter((a) =>
|
|
1070
|
+
const r = new Set(Array.isArray(t) ? t : [t]);
|
|
1071
|
+
return e.filter((a) => r.has(Le(a, s)));
|
|
1063
1072
|
}
|
|
1064
|
-
function
|
|
1073
|
+
function cn(e, t = 3) {
|
|
1065
1074
|
const s = e == null ? void 0 : e.standings;
|
|
1066
|
-
return Array.isArray(s) ? [...s].sort((
|
|
1075
|
+
return Array.isArray(s) ? [...s].sort((r, a) => (r.position ?? 999) - (a.position ?? 999)).slice(0, t) : [];
|
|
1067
1076
|
}
|
|
1068
|
-
function
|
|
1069
|
-
const { data: a } = ve(e), i =
|
|
1070
|
-
return /* @__PURE__ */ c("div", { className: `pvx-comp-completed-badge ${
|
|
1077
|
+
function ln({ competitionId: e, topN: t = 3, label: s = "Completed", className: r }) {
|
|
1078
|
+
const { data: a } = ve(e), i = cn(a, t);
|
|
1079
|
+
return /* @__PURE__ */ c("div", { className: `pvx-comp-completed-badge ${r || ""}`, children: [
|
|
1071
1080
|
/* @__PURE__ */ n("span", { className: "pvx-comp-completed-badge-label", children: s }),
|
|
1072
1081
|
i.length > 0 && /* @__PURE__ */ n("ol", { className: "pvx-comp-completed-badge-podium", children: i.map((o, d) => /* @__PURE__ */ c("li", { className: "pvx-comp-completed-badge-driver", children: [
|
|
1073
1082
|
/* @__PURE__ */ n("span", { className: "pvx-comp-completed-badge-medal", "aria-hidden": "true", children: se[d] || "" }),
|
|
@@ -1076,29 +1085,29 @@ function cn({ competitionId: e, topN: r = 3, label: s = "Completed", className:
|
|
|
1076
1085
|
] }, o.driverId || d)) })
|
|
1077
1086
|
] });
|
|
1078
1087
|
}
|
|
1079
|
-
function
|
|
1080
|
-
return
|
|
1088
|
+
function lt({ competitions: e, isLoading: t, onSelect: s, onRegister: r, className: a }) {
|
|
1089
|
+
return t ? /* @__PURE__ */ n(E, { message: "Loading competitions..." }) : e != null && e.length ? /* @__PURE__ */ n("div", { className: `pvx-comp-grid ${a || ""}`, children: e.map((i) => /* @__PURE__ */ n(dn, { comp: i, onSelect: s, onRegister: r || s }, i.id)) }) : /* @__PURE__ */ n(P, { message: "No competitions available." });
|
|
1081
1090
|
}
|
|
1082
|
-
function
|
|
1091
|
+
function dn({ comp: e, onSelect: t, onRegister: s }) {
|
|
1083
1092
|
var h, y, C;
|
|
1084
|
-
const { cdnUrl:
|
|
1093
|
+
const { cdnUrl: r } = k(), a = e.posterCdnPath ? `${r}/${e.posterCdnPath}` : null, i = e.registration, o = (i == null ? void 0 : i.currentCount) || 0, d = i == null ? void 0 : i.maxParticipants, u = d && o >= d, l = (i == null ? void 0 : i.deadline) && new Date(i.deadline) < /* @__PURE__ */ new Date(), p = (i == null ? void 0 : i.isOpen) && !l && !u, f = /* @__PURE__ */ new Date(), g = (h = e.rounds) == null ? void 0 : h.find((w) => w.startTime && new Date(w.startTime) >= f), m = ((y = e.rounds) == null ? void 0 : y.length) || 0, b = ((C = e.rounds) == null ? void 0 : C.filter((w) => w.isFinalized).length) || 0, x = Le(e), v = x === "recently-completed" || x === "archived", N = e.type === "championship";
|
|
1085
1094
|
return /* @__PURE__ */ c(
|
|
1086
1095
|
"div",
|
|
1087
1096
|
{
|
|
1088
1097
|
className: "pvx-comp-card",
|
|
1089
|
-
onClick: () =>
|
|
1098
|
+
onClick: () => t(e.id),
|
|
1090
1099
|
role: "button",
|
|
1091
1100
|
tabIndex: 0,
|
|
1092
1101
|
onKeyDown: (w) => {
|
|
1093
|
-
(w.key === "Enter" || w.key === " ") && (w.preventDefault(),
|
|
1102
|
+
(w.key === "Enter" || w.key === " ") && (w.preventDefault(), t(e.id));
|
|
1094
1103
|
},
|
|
1095
1104
|
children: [
|
|
1096
|
-
/* @__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(
|
|
1105
|
+
/* @__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(un, {}) }) }),
|
|
1097
1106
|
/* @__PURE__ */ c("div", { className: "pvx-comp-card-body", children: [
|
|
1098
1107
|
/* @__PURE__ */ n("h3", { className: "pvx-comp-card-title", children: e.name }),
|
|
1099
1108
|
e.description && /* @__PURE__ */ n("p", { className: "pvx-comp-card-desc", children: e.description }),
|
|
1100
1109
|
/* @__PURE__ */ c("div", { className: "pvx-comp-card-pills", children: [
|
|
1101
|
-
/* @__PURE__ */ n(
|
|
1110
|
+
/* @__PURE__ */ n(tn, { type: e.type }),
|
|
1102
1111
|
e.game && /* @__PURE__ */ n(Y, { children: e.game.toUpperCase() }),
|
|
1103
1112
|
e.formatDescription && e.formatDescription.split(", ").map((w, T) => /* @__PURE__ */ n(Y, { variant: "format", children: w }, T))
|
|
1104
1113
|
] }),
|
|
@@ -1113,25 +1122,25 @@ function ln({ comp: e, onSelect: r, onRegister: s }) {
|
|
|
1113
1122
|
g.track || "TBD",
|
|
1114
1123
|
" — ",
|
|
1115
1124
|
rn(g.startTime)
|
|
1116
|
-
] }) :
|
|
1125
|
+
] }) : m > 0 ? /* @__PURE__ */ c("span", { className: "pvx-comp-card-schedule-next", children: [
|
|
1117
1126
|
b,
|
|
1118
1127
|
"/",
|
|
1119
|
-
|
|
1128
|
+
m,
|
|
1120
1129
|
" rounds completed"
|
|
1121
1130
|
] }) : null,
|
|
1122
|
-
|
|
1123
|
-
|
|
1131
|
+
m > 0 && /* @__PURE__ */ c("span", { className: "pvx-comp-card-round-count", children: [
|
|
1132
|
+
m,
|
|
1124
1133
|
" round",
|
|
1125
|
-
|
|
1134
|
+
m !== 1 ? "s" : ""
|
|
1126
1135
|
] })
|
|
1127
1136
|
] }),
|
|
1128
|
-
|
|
1129
|
-
i && !
|
|
1130
|
-
|
|
1137
|
+
v && N && /* @__PURE__ */ n(ln, { competitionId: e.id }),
|
|
1138
|
+
i && !v && /* @__PURE__ */ n(
|
|
1139
|
+
pn,
|
|
1131
1140
|
{
|
|
1132
1141
|
competitionId: e.id,
|
|
1133
|
-
regOpen:
|
|
1134
|
-
isFull:
|
|
1142
|
+
regOpen: p,
|
|
1143
|
+
isFull: u,
|
|
1135
1144
|
deadlinePassed: l,
|
|
1136
1145
|
regCount: o,
|
|
1137
1146
|
regMax: d,
|
|
@@ -1143,8 +1152,8 @@ function ln({ comp: e, onSelect: r, onRegister: s }) {
|
|
|
1143
1152
|
}
|
|
1144
1153
|
);
|
|
1145
1154
|
}
|
|
1146
|
-
function
|
|
1147
|
-
const { isPowerMode: d } = ee(),
|
|
1155
|
+
function pn({ competitionId: e, regOpen: t, isFull: s, deadlinePassed: r, regCount: a, regMax: i, onRegister: o }) {
|
|
1156
|
+
const { isPowerMode: d } = ee(), u = ne(e), { data: l } = X(e), p = (l == null ? void 0 : l.isRegistered) || !1, f = i ? a / i * 100 : 0, g = f >= 100 ? "full" : f >= 75 ? "warning" : "ok";
|
|
1148
1157
|
return /* @__PURE__ */ c("div", { className: "pvx-comp-card-reg", children: [
|
|
1149
1158
|
/* @__PURE__ */ n("div", { className: "pvx-comp-card-reg-info", children: /* @__PURE__ */ c("span", { className: `pvx-reg-capacity pvx-reg-capacity--${g}`, children: [
|
|
1150
1159
|
a,
|
|
@@ -1152,38 +1161,38 @@ function dn({ competitionId: e, regOpen: r, isFull: s, deadlinePassed: t, regCou
|
|
|
1152
1161
|
i || "∞",
|
|
1153
1162
|
" drivers"
|
|
1154
1163
|
] }) }),
|
|
1155
|
-
/* @__PURE__ */ n("div", { className: "pvx-comp-card-reg-action", children:
|
|
1164
|
+
/* @__PURE__ */ n("div", { className: "pvx-comp-card-reg-action", children: p ? /* @__PURE__ */ n(
|
|
1156
1165
|
"button",
|
|
1157
1166
|
{
|
|
1158
1167
|
className: "pvx-comp-card-reg-btn pvx-comp-card-reg-btn--registered",
|
|
1159
|
-
onClick: (
|
|
1160
|
-
|
|
1168
|
+
onClick: (m) => {
|
|
1169
|
+
m.stopPropagation(), o(e);
|
|
1161
1170
|
},
|
|
1162
1171
|
children: "✓ Registered"
|
|
1163
1172
|
}
|
|
1164
|
-
) :
|
|
1173
|
+
) : t ? d ? /* @__PURE__ */ n(
|
|
1165
1174
|
"button",
|
|
1166
1175
|
{
|
|
1167
1176
|
className: "pvx-comp-card-reg-btn pvx-comp-card-reg-btn--open",
|
|
1168
|
-
onClick: (
|
|
1169
|
-
|
|
1177
|
+
onClick: (m) => {
|
|
1178
|
+
m.stopPropagation(), o(e);
|
|
1170
1179
|
},
|
|
1171
1180
|
children: "Register"
|
|
1172
1181
|
}
|
|
1173
1182
|
) : /* @__PURE__ */ n(
|
|
1174
1183
|
"a",
|
|
1175
1184
|
{
|
|
1176
|
-
href:
|
|
1185
|
+
href: u,
|
|
1177
1186
|
target: "_blank",
|
|
1178
1187
|
rel: "noopener noreferrer",
|
|
1179
1188
|
className: "pvx-comp-card-reg-btn pvx-comp-card-reg-btn--open",
|
|
1180
|
-
onClick: (
|
|
1189
|
+
onClick: (m) => m.stopPropagation(),
|
|
1181
1190
|
children: "Register"
|
|
1182
1191
|
}
|
|
1183
1192
|
) : /* @__PURE__ */ n("span", { className: "pvx-comp-card-reg-btn pvx-comp-card-reg-btn--closed", children: s ? "Full" : "Closed" }) })
|
|
1184
1193
|
] });
|
|
1185
1194
|
}
|
|
1186
|
-
function
|
|
1195
|
+
function un() {
|
|
1187
1196
|
return /* @__PURE__ */ c("svg", { className: "pvx-comp-trophy-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1188
1197
|
/* @__PURE__ */ n("path", { d: "M6 9H4.5a2.5 2.5 0 0 1 0-5H6" }),
|
|
1189
1198
|
/* @__PURE__ */ n("path", { d: "M18 9h1.5a2.5 2.5 0 0 0 0-5H18" }),
|
|
@@ -1193,15 +1202,15 @@ function pn() {
|
|
|
1193
1202
|
/* @__PURE__ */ n("path", { d: "M18 2H6v7a6 6 0 0 0 12 0V2Z" })
|
|
1194
1203
|
] });
|
|
1195
1204
|
}
|
|
1196
|
-
function
|
|
1197
|
-
var d,
|
|
1198
|
-
const { data: s, isLoading:
|
|
1199
|
-
if (
|
|
1200
|
-
return /* @__PURE__ */ n(
|
|
1205
|
+
function mn({ competitionId: e, className: t }) {
|
|
1206
|
+
var d, u;
|
|
1207
|
+
const { data: s, isLoading: r } = ve(e), { data: a, isLoading: i } = me(e);
|
|
1208
|
+
if (r || i)
|
|
1209
|
+
return /* @__PURE__ */ n(E, { message: "Loading standings..." });
|
|
1201
1210
|
if (!((d = s == null ? void 0 : s.standings) != null && d.length))
|
|
1202
1211
|
return /* @__PURE__ */ n(P, { message: "No standings data yet. Results will appear once rounds are finalised." });
|
|
1203
|
-
const o = ((
|
|
1204
|
-
return /* @__PURE__ */ c("div", { className: `pvx-card ${
|
|
1212
|
+
const o = ((u = a == null ? void 0 : a.rounds) == null ? void 0 : u.filter((l) => l.isFinalized)) || [];
|
|
1213
|
+
return /* @__PURE__ */ c("div", { className: `pvx-card ${t || ""}`, children: [
|
|
1205
1214
|
/* @__PURE__ */ n("div", { className: "pvx-card-header--split", children: /* @__PURE__ */ c("div", { className: "pvx-card-header-left", children: [
|
|
1206
1215
|
/* @__PURE__ */ n("h3", { className: "pvx-card-title", children: "Championship Standings" }),
|
|
1207
1216
|
/* @__PURE__ */ c("span", { className: "pvx-standings-subtitle", children: [
|
|
@@ -1233,7 +1242,7 @@ function un({ competitionId: e, className: r }) {
|
|
|
1233
1242
|
))
|
|
1234
1243
|
] }) }),
|
|
1235
1244
|
/* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: s.standings.map((l) => /* @__PURE__ */ n(
|
|
1236
|
-
|
|
1245
|
+
vn,
|
|
1237
1246
|
{
|
|
1238
1247
|
driver: l,
|
|
1239
1248
|
finalizedRounds: o
|
|
@@ -1243,11 +1252,11 @@ function un({ competitionId: e, className: r }) {
|
|
|
1243
1252
|
] }) })
|
|
1244
1253
|
] });
|
|
1245
1254
|
}
|
|
1246
|
-
function
|
|
1247
|
-
var o, d,
|
|
1248
|
-
const s = e.position <= 3,
|
|
1255
|
+
function vn({ driver: e, finalizedRounds: t }) {
|
|
1256
|
+
var o, d, u;
|
|
1257
|
+
const s = e.position <= 3, r = new Map(
|
|
1249
1258
|
((o = e.roundResults) == null ? void 0 : o.map((l) => [l.roundNumber, l])) || []
|
|
1250
|
-
), a = ((d = e.roundResults) == null ? void 0 : d.filter((l) => l.position === 1).length) || 0, i = ((
|
|
1259
|
+
), a = ((d = e.roundResults) == null ? void 0 : d.filter((l) => l.position === 1).length) || 0, i = ((u = e.roundResults) == null ? void 0 : u.filter((l) => l.position <= 3).length) || 0;
|
|
1251
1260
|
return /* @__PURE__ */ c("tr", { className: `pvx-row ${s ? "pvx-row--podium" : ""}`, children: [
|
|
1252
1261
|
/* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(we, { position: e.position }) }),
|
|
1253
1262
|
/* @__PURE__ */ c("td", { className: "pvx-td pvx-td--primary", children: [
|
|
@@ -1257,18 +1266,18 @@ function mn({ driver: e, finalizedRounds: r }) {
|
|
|
1257
1266
|
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: a || "-" }),
|
|
1258
1267
|
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: i || "-" }),
|
|
1259
1268
|
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-standings-total", children: e.totalPoints }),
|
|
1260
|
-
|
|
1261
|
-
const
|
|
1269
|
+
t.map((l) => {
|
|
1270
|
+
const p = r.get(l.roundNumber), f = p == null ? void 0 : p.dropped;
|
|
1262
1271
|
return /* @__PURE__ */ n(
|
|
1263
1272
|
"td",
|
|
1264
1273
|
{
|
|
1265
|
-
className: `pvx-td pvx-td--center pvx-hidden-below-md ${!f && (
|
|
1266
|
-
children:
|
|
1274
|
+
className: `pvx-td pvx-td--center pvx-hidden-below-md ${!f && (p == null ? void 0 : p.position) === 1 ? "pvx-standings-cell--p1" : !f && (p == null ? void 0 : p.position) === 2 ? "pvx-standings-cell--p2" : !f && (p == null ? void 0 : p.position) === 3 ? "pvx-standings-cell--p3" : ""}`,
|
|
1275
|
+
children: p ? /* @__PURE__ */ c("div", { className: `pvx-standings-round-cell ${f ? "pvx-standings-round-cell--dropped" : ""}`, children: [
|
|
1267
1276
|
/* @__PURE__ */ c("span", { className: "pvx-standings-round-pos", children: [
|
|
1268
1277
|
"P",
|
|
1269
|
-
|
|
1278
|
+
p.position
|
|
1270
1279
|
] }),
|
|
1271
|
-
/* @__PURE__ */ n("span", { className: "pvx-standings-round-pts", children:
|
|
1280
|
+
/* @__PURE__ */ n("span", { className: "pvx-standings-round-pts", children: p.points })
|
|
1272
1281
|
] }) : /* @__PURE__ */ n("span", { className: "pvx-td--muted", children: "-" })
|
|
1273
1282
|
},
|
|
1274
1283
|
l.roundNumber
|
|
@@ -1276,23 +1285,23 @@ function mn({ driver: e, finalizedRounds: r }) {
|
|
|
1276
1285
|
})
|
|
1277
1286
|
] });
|
|
1278
1287
|
}
|
|
1279
|
-
function
|
|
1280
|
-
var
|
|
1281
|
-
const { data:
|
|
1288
|
+
function dt({ competitionId: e, roundNumber: t, className: s }) {
|
|
1289
|
+
var u;
|
|
1290
|
+
const { data: r, isLoading: a } = He(e, t);
|
|
1282
1291
|
if (a)
|
|
1283
|
-
return /* @__PURE__ */ n(
|
|
1284
|
-
if (!
|
|
1292
|
+
return /* @__PURE__ */ n(E, { message: "Loading results..." });
|
|
1293
|
+
if (!r)
|
|
1285
1294
|
return /* @__PURE__ */ n(P, { message: "No results for this round." });
|
|
1286
|
-
const o = (
|
|
1295
|
+
const o = (r.sessions || []).find((l) => l.type === "RACE"), d = (u = o == null ? void 0 : o.results) == null ? void 0 : u.filter((l) => l.position <= 3).sort((l, p) => l.position - p.position);
|
|
1287
1296
|
return /* @__PURE__ */ c("div", { className: `pvx-round-results ${s || ""}`, children: [
|
|
1288
1297
|
/* @__PURE__ */ c("div", { className: "pvx-round-results-header", children: [
|
|
1289
1298
|
/* @__PURE__ */ c("div", { children: [
|
|
1290
1299
|
/* @__PURE__ */ c("h4", { className: "pvx-round-results-title", children: [
|
|
1291
1300
|
"Round ",
|
|
1292
|
-
|
|
1293
|
-
|
|
1301
|
+
r.roundNumber,
|
|
1302
|
+
r.track ? `: ${r.track}` : ""
|
|
1294
1303
|
] }),
|
|
1295
|
-
|
|
1304
|
+
r.startTime && /* @__PURE__ */ n("p", { className: "pvx-round-results-date", children: new Date(r.startTime).toLocaleDateString("en-GB", {
|
|
1296
1305
|
day: "numeric",
|
|
1297
1306
|
month: "long",
|
|
1298
1307
|
year: "numeric"
|
|
@@ -1303,101 +1312,147 @@ function cr({ competitionId: e, roundNumber: r, className: s }) {
|
|
|
1303
1312
|
/* @__PURE__ */ n("span", { children: l.driverName })
|
|
1304
1313
|
] }, l.driverId)) })
|
|
1305
1314
|
] }),
|
|
1306
|
-
/* @__PURE__ */ n(Te, { round:
|
|
1315
|
+
/* @__PURE__ */ n(Te, { round: r, competitionId: e })
|
|
1307
1316
|
] });
|
|
1308
1317
|
}
|
|
1309
|
-
function Te({ round: e, className:
|
|
1310
|
-
var
|
|
1311
|
-
const [
|
|
1312
|
-
if (!
|
|
1318
|
+
function Te({ round: e, competitionId: t, className: s }) {
|
|
1319
|
+
var p, f, g, m;
|
|
1320
|
+
const [r, a] = D(null), i = (e == null ? void 0 : e.sessions) || [];
|
|
1321
|
+
if (!i.length)
|
|
1313
1322
|
return /* @__PURE__ */ n(P, { message: "No session data for this round." });
|
|
1314
|
-
const
|
|
1315
|
-
|
|
1323
|
+
const { data: o } = We(
|
|
1324
|
+
t,
|
|
1325
|
+
e == null ? void 0 : e.roundNumber,
|
|
1326
|
+
{}
|
|
1327
|
+
), d = r || ((p = i.find((b) => b.type === "RACE")) == null ? void 0 : p.type) || ((f = i[0]) == null ? void 0 : f.type), u = i.find((b) => b.type === d) || i[0], l = ((m = (g = o == null ? void 0 : o.sessions) == null ? void 0 : g.find((b) => b.type === d)) == null ? void 0 : m.drivers) || null;
|
|
1328
|
+
return /* @__PURE__ */ c("div", { className: s || "", children: [
|
|
1316
1329
|
/* @__PURE__ */ n(
|
|
1317
|
-
|
|
1330
|
+
nn,
|
|
1318
1331
|
{
|
|
1319
|
-
sessions:
|
|
1320
|
-
activeSession:
|
|
1321
|
-
onSelect:
|
|
1332
|
+
sessions: i,
|
|
1333
|
+
activeSession: d,
|
|
1334
|
+
onSelect: a
|
|
1322
1335
|
}
|
|
1323
1336
|
),
|
|
1324
|
-
/* @__PURE__ */ n(
|
|
1337
|
+
/* @__PURE__ */ n(hn, { session: u, sessionLaps: l })
|
|
1325
1338
|
] });
|
|
1326
1339
|
}
|
|
1327
|
-
function
|
|
1328
|
-
var
|
|
1329
|
-
const
|
|
1330
|
-
if (!((
|
|
1340
|
+
function hn({ session: e, sessionLaps: t }) {
|
|
1341
|
+
var d;
|
|
1342
|
+
const s = e.type === "RACE", [r, a] = D(null);
|
|
1343
|
+
if (!((d = e.results) != null && d.length))
|
|
1331
1344
|
return /* @__PURE__ */ n(P, { message: `No results for ${e.type}.` });
|
|
1332
|
-
const
|
|
1345
|
+
const i = sn(e.results), o = s ? 7 : 4;
|
|
1333
1346
|
return /* @__PURE__ */ n("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ c("table", { className: "pvx-table", children: [
|
|
1334
1347
|
/* @__PURE__ */ n("thead", { children: /* @__PURE__ */ c("tr", { className: "pvx-thead-row", children: [
|
|
1335
1348
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-th--narrow", children: "Pos" }),
|
|
1336
1349
|
/* @__PURE__ */ n("th", { className: "pvx-th", children: "Driver" }),
|
|
1337
1350
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "Car" }),
|
|
1338
1351
|
/* @__PURE__ */ n("th", { className: "pvx-th", children: "Best Lap" }),
|
|
1339
|
-
|
|
1352
|
+
s && /* @__PURE__ */ c(U, { children: [
|
|
1340
1353
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "Laps" }),
|
|
1341
1354
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "Time / Gap" }),
|
|
1342
1355
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-th--center", children: "Points" })
|
|
1343
1356
|
] })
|
|
1344
1357
|
] }) }),
|
|
1345
|
-
/* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: e.results.map((
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1358
|
+
/* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: e.results.map((u, l) => {
|
|
1359
|
+
var g;
|
|
1360
|
+
const p = (g = t == null ? void 0 : t[u.driverId]) == null ? void 0 : g.laps, f = r === u.driverId && !!p;
|
|
1361
|
+
return /* @__PURE__ */ n(
|
|
1362
|
+
xn,
|
|
1363
|
+
{
|
|
1364
|
+
result: u,
|
|
1365
|
+
isRace: s,
|
|
1366
|
+
fastestSplits: i,
|
|
1367
|
+
rowIndex: l,
|
|
1368
|
+
hasLapDetail: !!p,
|
|
1369
|
+
isExpanded: f,
|
|
1370
|
+
onToggle: () => a(f ? null : u.driverId),
|
|
1371
|
+
driverLaps: f ? p : null,
|
|
1372
|
+
colCount: o
|
|
1373
|
+
},
|
|
1374
|
+
u.driverId || l
|
|
1375
|
+
);
|
|
1376
|
+
}) })
|
|
1355
1377
|
] }) });
|
|
1356
1378
|
}
|
|
1357
|
-
function
|
|
1358
|
-
const
|
|
1359
|
-
return /* @__PURE__ */ c(
|
|
1360
|
-
/* @__PURE__ */
|
|
1361
|
-
|
|
1362
|
-
/* @__PURE__ */ n(ae, { nation: e.nation }),
|
|
1363
|
-
e.driverName,
|
|
1364
|
-
e.carNumber != null && /* @__PURE__ */ c("span", { className: "pvx-car-number", children: [
|
|
1365
|
-
"#",
|
|
1366
|
-
e.carNumber
|
|
1367
|
-
] }),
|
|
1368
|
-
e.penalty && /* @__PURE__ */ n("span", { className: "pvx-penalty", children: e.penalty })
|
|
1369
|
-
] }),
|
|
1370
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-sm", children: I(e.carId) }),
|
|
1371
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--mono", children: /* @__PURE__ */ n(
|
|
1372
|
-
xn,
|
|
1379
|
+
function xn({ result: e, isRace: t, fastestSplits: s, rowIndex: r, hasLapDetail: a, isExpanded: i, onToggle: o, driverLaps: d, colCount: u }) {
|
|
1380
|
+
const l = e.position <= 3;
|
|
1381
|
+
return /* @__PURE__ */ c(U, { children: [
|
|
1382
|
+
/* @__PURE__ */ c(
|
|
1383
|
+
"tr",
|
|
1373
1384
|
{
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1385
|
+
className: `pvx-row ${l ? "pvx-row--podium" : ""} ${a ? "pvx-row--expandable" : ""}`,
|
|
1386
|
+
onClick: a ? o : void 0,
|
|
1387
|
+
style: a ? { cursor: "pointer" } : void 0,
|
|
1388
|
+
children: [
|
|
1389
|
+
/* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(we, { position: e.position }) }),
|
|
1390
|
+
/* @__PURE__ */ c("td", { className: "pvx-td pvx-td--primary", children: [
|
|
1391
|
+
/* @__PURE__ */ n(ae, { nation: e.nation }),
|
|
1392
|
+
e.driverName,
|
|
1393
|
+
e.carNumber != null && /* @__PURE__ */ c("span", { className: "pvx-car-number", children: [
|
|
1394
|
+
"#",
|
|
1395
|
+
e.carNumber
|
|
1396
|
+
] }),
|
|
1397
|
+
e.penalty && /* @__PURE__ */ n("span", { className: "pvx-penalty", children: e.penalty })
|
|
1398
|
+
] }),
|
|
1399
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-sm", children: I(e.carId) }),
|
|
1400
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--mono", children: /* @__PURE__ */ n(
|
|
1401
|
+
fn,
|
|
1402
|
+
{
|
|
1403
|
+
bestLap: e.bestLapFormatted,
|
|
1404
|
+
hasBestLap: e.hasBestLap,
|
|
1405
|
+
splits: e.splits,
|
|
1406
|
+
fastestSplits: s,
|
|
1407
|
+
showAbove: r <= 1
|
|
1408
|
+
}
|
|
1409
|
+
) }),
|
|
1410
|
+
t && /* @__PURE__ */ c(U, { children: [
|
|
1411
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-sm", children: e.lapsCompleted }),
|
|
1412
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--mono pvx-td--muted pvx-hidden-below-sm", children: e.position === 1 ? e.totalTime || "-" : e.gap || "-" }),
|
|
1413
|
+
/* @__PURE__ */ c("td", { className: "pvx-td pvx-td--center", children: [
|
|
1414
|
+
/* @__PURE__ */ n("span", { className: "pvx-session-points", children: e.points }),
|
|
1415
|
+
e.pointsOverride !== 0 && e.pointsOverride && /* @__PURE__ */ c("span", { className: "pvx-points-override", children: [
|
|
1416
|
+
"(",
|
|
1417
|
+
e.pointsOverride > 0 ? "+" : "",
|
|
1418
|
+
e.pointsOverride,
|
|
1419
|
+
")"
|
|
1420
|
+
] })
|
|
1421
|
+
] })
|
|
1422
|
+
] })
|
|
1423
|
+
]
|
|
1379
1424
|
}
|
|
1380
|
-
)
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
] })
|
|
1425
|
+
),
|
|
1426
|
+
i && d && /* @__PURE__ */ n("tr", { className: "pvx-row pvx-row--lap-detail", children: /* @__PURE__ */ n("td", { colSpan: u, className: "pvx-td pvx-td--lap-detail", children: /* @__PURE__ */ n(gn, { laps: d }) }) })
|
|
1427
|
+
] });
|
|
1428
|
+
}
|
|
1429
|
+
function gn({ laps: e }) {
|
|
1430
|
+
const t = Math.min(...e.filter((s) => s.valid && s.timeMs > 0).map((s) => s.timeMs));
|
|
1431
|
+
return /* @__PURE__ */ c("table", { className: "pvx-table pvx-table--laps", children: [
|
|
1432
|
+
/* @__PURE__ */ n("thead", { children: /* @__PURE__ */ c("tr", { className: "pvx-thead-row", children: [
|
|
1433
|
+
/* @__PURE__ */ n("th", { className: "pvx-th pvx-th--narrow", children: "Lap" }),
|
|
1434
|
+
/* @__PURE__ */ n("th", { className: "pvx-th", children: "Time" }),
|
|
1435
|
+
/* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "S1" }),
|
|
1436
|
+
/* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "S2" }),
|
|
1437
|
+
/* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "S3" })
|
|
1438
|
+
] }) }),
|
|
1439
|
+
/* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: e.map((s) => {
|
|
1440
|
+
var a;
|
|
1441
|
+
const r = s.valid && s.timeMs === t;
|
|
1442
|
+
return /* @__PURE__ */ c("tr", { className: `pvx-row ${s.valid ? "" : "pvx-row--invalid"} ${r ? "pvx-row--fastest" : ""}`, children: [
|
|
1443
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted", children: s.lap }),
|
|
1444
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--mono", children: s.time }),
|
|
1445
|
+
(s.splits || []).map((i, o) => /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--mono pvx-td--muted pvx-hidden-below-sm", children: i }, o)),
|
|
1446
|
+
Array.from({ length: Math.max(0, 3 - (((a = s.splits) == null ? void 0 : a.length) || 0)) }).map((i, o) => /* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-sm" }, `pad-${o}`))
|
|
1447
|
+
] }, s.lap);
|
|
1448
|
+
}) })
|
|
1394
1449
|
] });
|
|
1395
1450
|
}
|
|
1396
|
-
function
|
|
1397
|
-
return e ? /* @__PURE__ */ c("span", { className: `pvx-best-lap-cell ${
|
|
1451
|
+
function fn({ bestLap: e, hasBestLap: t, splits: s, fastestSplits: r, showAbove: a }) {
|
|
1452
|
+
return e ? /* @__PURE__ */ c("span", { className: `pvx-best-lap-cell ${t ? "pvx-best-lap-cell--fastest" : ""}`, children: [
|
|
1398
1453
|
/* @__PURE__ */ n("span", { className: "pvx-best-lap-time", children: e }),
|
|
1399
1454
|
(s == null ? void 0 : s.length) > 0 && /* @__PURE__ */ n("span", { className: "pvx-splits-tooltip-anchor", children: /* @__PURE__ */ n("span", { className: `pvx-splits-tooltip ${a ? "" : "pvx-splits-tooltip--above"}`, children: s.map((i, o) => {
|
|
1400
|
-
const d =
|
|
1455
|
+
const d = r && i === r[o];
|
|
1401
1456
|
return /* @__PURE__ */ c("span", { className: "pvx-splits-tooltip-row", children: [
|
|
1402
1457
|
/* @__PURE__ */ c("span", { className: "pvx-splits-tooltip-label", children: [
|
|
1403
1458
|
"S",
|
|
@@ -1408,15 +1463,15 @@ function xn({ bestLap: e, hasBestLap: r, splits: s, fastestSplits: t, showAbove:
|
|
|
1408
1463
|
}) }) })
|
|
1409
1464
|
] }) : /* @__PURE__ */ n("span", { className: "pvx-td--muted", children: "-" });
|
|
1410
1465
|
}
|
|
1411
|
-
function
|
|
1412
|
-
const { getSteamId: s } = k(), { data:
|
|
1466
|
+
function pt({ competitionId: e, className: t }) {
|
|
1467
|
+
const { getSteamId: s } = k(), { data: r, isLoading: a } = he(e), i = s();
|
|
1413
1468
|
if (a)
|
|
1414
|
-
return /* @__PURE__ */ n(
|
|
1415
|
-
const o = (
|
|
1416
|
-
return o.length ? /* @__PURE__ */ n("div", { className: `pvx-entry-grid ${
|
|
1417
|
-
var l,
|
|
1418
|
-
const
|
|
1419
|
-
return /* @__PURE__ */ c("div", { className: `pvx-entry-card ${
|
|
1469
|
+
return /* @__PURE__ */ n(E, { message: "Loading drivers..." });
|
|
1470
|
+
const o = (r == null ? void 0 : r.drivers) || (r == null ? void 0 : r.entries) || [];
|
|
1471
|
+
return o.length ? /* @__PURE__ */ n("div", { className: `pvx-entry-grid ${t || ""}`, children: o.map((d) => {
|
|
1472
|
+
var l, p;
|
|
1473
|
+
const u = i && d.steamId === i;
|
|
1474
|
+
return /* @__PURE__ */ c("div", { className: `pvx-entry-card ${u ? "pvx-entry-card--you" : ""}`, children: [
|
|
1420
1475
|
d.avatarUrl ? /* @__PURE__ */ n(
|
|
1421
1476
|
"img",
|
|
1422
1477
|
{
|
|
@@ -1424,32 +1479,32 @@ function lr({ competitionId: e, className: r }) {
|
|
|
1424
1479
|
alt: "",
|
|
1425
1480
|
className: "pvx-entry-avatar"
|
|
1426
1481
|
}
|
|
1427
|
-
) : /* @__PURE__ */ n("div", { className: "pvx-entry-avatar pvx-entry-avatar--placeholder", children: ((
|
|
1482
|
+
) : /* @__PURE__ */ n("div", { className: "pvx-entry-avatar pvx-entry-avatar--placeholder", children: ((p = (l = d.displayName) == null ? void 0 : l.charAt(0)) == null ? void 0 : p.toUpperCase()) || "?" }),
|
|
1428
1483
|
/* @__PURE__ */ c("span", { className: "pvx-entry-name", children: [
|
|
1429
1484
|
d.displayName,
|
|
1430
|
-
|
|
1485
|
+
u && /* @__PURE__ */ n("span", { className: "pvx-entry-you", children: " (you)" })
|
|
1431
1486
|
] })
|
|
1432
1487
|
] }, d.steamId || d.driverId);
|
|
1433
1488
|
}) }) : /* @__PURE__ */ n(P, { message: "No drivers registered yet." });
|
|
1434
1489
|
}
|
|
1435
|
-
function
|
|
1490
|
+
function ut({
|
|
1436
1491
|
competitionId: e,
|
|
1437
|
-
driverData:
|
|
1492
|
+
driverData: t,
|
|
1438
1493
|
className: s,
|
|
1439
|
-
children:
|
|
1494
|
+
children: r
|
|
1440
1495
|
}) {
|
|
1441
|
-
const { data: a, isLoading: i } = X(e), { isPowerMode: o } = ee(), d = ne(e),
|
|
1442
|
-
o &&
|
|
1496
|
+
const { data: a, isLoading: i } = X(e), { isPowerMode: o } = ee(), d = ne(e), u = xe(e), l = ge(e), p = (a == null ? void 0 : a.isRegistered) || !1, f = i || u.isPending || l.isPending, g = u.error || l.error || null, m = () => {
|
|
1497
|
+
o && u.mutate(t || {});
|
|
1443
1498
|
}, b = () => {
|
|
1444
1499
|
o && l.mutate();
|
|
1445
1500
|
};
|
|
1446
|
-
return typeof
|
|
1501
|
+
return typeof r == "function" ? r({ isRegistered: p, isLoading: f, register: m, withdraw: b, error: g, isPowerMode: o, registrationUrl: d }) : o ? /* @__PURE__ */ n(
|
|
1447
1502
|
"button",
|
|
1448
1503
|
{
|
|
1449
1504
|
className: `pvx-comp-register-btn ${s || ""}`,
|
|
1450
|
-
onClick:
|
|
1505
|
+
onClick: p ? b : m,
|
|
1451
1506
|
disabled: f,
|
|
1452
|
-
children: f ? "Loading..." :
|
|
1507
|
+
children: f ? "Loading..." : p ? "Withdraw" : "Register"
|
|
1453
1508
|
}
|
|
1454
1509
|
) : /* @__PURE__ */ n(
|
|
1455
1510
|
"a",
|
|
@@ -1458,50 +1513,50 @@ function dr({
|
|
|
1458
1513
|
target: "_blank",
|
|
1459
1514
|
rel: "noopener noreferrer",
|
|
1460
1515
|
className: `pvx-comp-register-link ${s || ""}`,
|
|
1461
|
-
children:
|
|
1516
|
+
children: p ? "View Registration" : "Register on PitVox"
|
|
1462
1517
|
}
|
|
1463
1518
|
);
|
|
1464
1519
|
}
|
|
1465
|
-
function
|
|
1466
|
-
const { getSteamId: a } = k(), { isPowerMode: i } = ee(), o = ne(e), { data: d, isLoading:
|
|
1467
|
-
return
|
|
1468
|
-
|
|
1520
|
+
function mt({ competitionId: e, registration: t, onWithdrawSuccess: s, className: r }) {
|
|
1521
|
+
const { getSteamId: a } = k(), { isPowerMode: i } = ee(), o = ne(e), { data: d, isLoading: u } = X(e), { data: l, isLoading: p } = he(e), f = xe(e), g = ge(e), m = a(), b = (d == null ? void 0 : d.isRegistered) || !1, x = (l == null ? void 0 : l.drivers) || (l == null ? void 0 : l.entries) || [], v = t || {}, N = x.length || v.currentCount || 0, h = v.maxParticipants && N >= v.maxParticipants, y = v.deadline && new Date(v.deadline) < /* @__PURE__ */ new Date(), C = v.isOpen && !y && !h;
|
|
1522
|
+
return u || p ? /* @__PURE__ */ n(E, { message: "Loading registration..." }) : b ? /* @__PURE__ */ n("div", { className: `pvx-reg-panel ${r || ""}`, children: /* @__PURE__ */ n(
|
|
1523
|
+
bn,
|
|
1469
1524
|
{
|
|
1470
1525
|
competitionId: e,
|
|
1471
1526
|
drivers: x,
|
|
1472
|
-
steamId:
|
|
1527
|
+
steamId: m,
|
|
1473
1528
|
isPowerMode: i,
|
|
1474
1529
|
registrationUrl: o,
|
|
1475
1530
|
withdrawMutation: g,
|
|
1476
1531
|
onWithdrawSuccess: s,
|
|
1477
|
-
registration:
|
|
1532
|
+
registration: v
|
|
1478
1533
|
}
|
|
1479
|
-
) }) : C ?
|
|
1480
|
-
|
|
1534
|
+
) }) : C ? m ? i ? /* @__PURE__ */ n("div", { className: `pvx-reg-panel ${r || ""}`, children: /* @__PURE__ */ n(
|
|
1535
|
+
Nn,
|
|
1481
1536
|
{
|
|
1482
1537
|
competitionId: e,
|
|
1483
1538
|
registerMutation: f,
|
|
1484
|
-
registration:
|
|
1539
|
+
registration: v
|
|
1485
1540
|
}
|
|
1486
|
-
) }) : /* @__PURE__ */ n("div", { className: `pvx-reg-panel ${
|
|
1541
|
+
) }) : /* @__PURE__ */ n("div", { className: `pvx-reg-panel ${r || ""}`, 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 ${r || ""}`, 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__ */ c("div", { className: `pvx-reg-panel ${r || ""}`, children: [
|
|
1487
1542
|
/* @__PURE__ */ n("div", { className: "pvx-reg-status-msg", children: h ? "Registration is full." : y ? "Registration deadline has passed." : "Registration is closed." }),
|
|
1488
|
-
x.length > 0 && /* @__PURE__ */ n(Re, { drivers: x, steamId:
|
|
1543
|
+
x.length > 0 && /* @__PURE__ */ n(Re, { drivers: x, steamId: m })
|
|
1489
1544
|
] });
|
|
1490
1545
|
}
|
|
1491
|
-
function
|
|
1492
|
-
const [
|
|
1493
|
-
|
|
1494
|
-
discordUsername:
|
|
1546
|
+
function Nn({ competitionId: e, registerMutation: t, registration: s }) {
|
|
1547
|
+
const [r, a] = D(""), [i, o] = D("intermediate"), [d, u] = D(""), l = (m) => {
|
|
1548
|
+
m.preventDefault(), t.mutate({
|
|
1549
|
+
discordUsername: r || void 0,
|
|
1495
1550
|
experience: i,
|
|
1496
1551
|
comments: d || void 0
|
|
1497
1552
|
});
|
|
1498
|
-
},
|
|
1553
|
+
}, p = s || {}, f = p.currentCount || 0, g = p.maxParticipants;
|
|
1499
1554
|
return /* @__PURE__ */ c("form", { className: "pvx-reg-form", onSubmit: l, children: [
|
|
1500
1555
|
/* @__PURE__ */ c("div", { className: "pvx-reg-form-header", children: [
|
|
1501
1556
|
/* @__PURE__ */ n("h3", { className: "pvx-reg-form-title", children: "Register" }),
|
|
1502
1557
|
g && /* @__PURE__ */ n(Se, { count: f, max: g })
|
|
1503
1558
|
] }),
|
|
1504
|
-
|
|
1559
|
+
t.error && /* @__PURE__ */ n("div", { className: "pvx-reg-error", children: t.error.message || "Registration failed" }),
|
|
1505
1560
|
/* @__PURE__ */ c("div", { className: "pvx-reg-field", children: [
|
|
1506
1561
|
/* @__PURE__ */ c("label", { className: "pvx-reg-label", htmlFor: `pvx-discord-${e}`, children: [
|
|
1507
1562
|
"Discord Username ",
|
|
@@ -1514,8 +1569,8 @@ function gn({ competitionId: e, registerMutation: r, registration: s }) {
|
|
|
1514
1569
|
type: "text",
|
|
1515
1570
|
className: "pvx-reg-input",
|
|
1516
1571
|
placeholder: "e.g. username",
|
|
1517
|
-
value:
|
|
1518
|
-
onChange: (
|
|
1572
|
+
value: r,
|
|
1573
|
+
onChange: (m) => a(m.target.value)
|
|
1519
1574
|
}
|
|
1520
1575
|
)
|
|
1521
1576
|
] }),
|
|
@@ -1527,7 +1582,7 @@ function gn({ competitionId: e, registerMutation: r, registration: s }) {
|
|
|
1527
1582
|
id: `pvx-exp-${e}`,
|
|
1528
1583
|
className: "pvx-reg-select",
|
|
1529
1584
|
value: i,
|
|
1530
|
-
onChange: (
|
|
1585
|
+
onChange: (m) => o(m.target.value),
|
|
1531
1586
|
children: [
|
|
1532
1587
|
/* @__PURE__ */ n("option", { value: "beginner", children: "Beginner" }),
|
|
1533
1588
|
/* @__PURE__ */ n("option", { value: "intermediate", children: "Intermediate" }),
|
|
@@ -1549,7 +1604,7 @@ function gn({ competitionId: e, registerMutation: r, registration: s }) {
|
|
|
1549
1604
|
rows: 3,
|
|
1550
1605
|
placeholder: "Anything the organisers should know?",
|
|
1551
1606
|
value: d,
|
|
1552
|
-
onChange: (
|
|
1607
|
+
onChange: (m) => u(m.target.value)
|
|
1553
1608
|
}
|
|
1554
1609
|
)
|
|
1555
1610
|
] }),
|
|
@@ -1558,28 +1613,28 @@ function gn({ competitionId: e, registerMutation: r, registration: s }) {
|
|
|
1558
1613
|
{
|
|
1559
1614
|
type: "submit",
|
|
1560
1615
|
className: "pvx-comp-register-btn",
|
|
1561
|
-
disabled:
|
|
1562
|
-
children:
|
|
1616
|
+
disabled: t.isPending,
|
|
1617
|
+
children: t.isPending ? "Registering..." : "Register"
|
|
1563
1618
|
}
|
|
1564
1619
|
) })
|
|
1565
1620
|
] });
|
|
1566
1621
|
}
|
|
1567
|
-
function
|
|
1568
|
-
const [
|
|
1622
|
+
function bn({ competitionId: e, drivers: t, steamId: s, isPowerMode: r, registrationUrl: a, withdrawMutation: i, onWithdrawSuccess: o, registration: d }) {
|
|
1623
|
+
const [u, l] = D(!1), p = () => {
|
|
1569
1624
|
i.mutate(void 0, {
|
|
1570
1625
|
onSuccess: () => {
|
|
1571
1626
|
l(!1), o && o();
|
|
1572
1627
|
}
|
|
1573
1628
|
});
|
|
1574
|
-
}, f = d || {}, g =
|
|
1575
|
-
return /* @__PURE__ */ c(
|
|
1629
|
+
}, f = d || {}, g = t.length || f.currentCount || 0, m = f.maxParticipants;
|
|
1630
|
+
return /* @__PURE__ */ c(U, { children: [
|
|
1576
1631
|
/* @__PURE__ */ c("div", { className: "pvx-reg-form-header", children: [
|
|
1577
1632
|
/* @__PURE__ */ n("h3", { className: "pvx-reg-form-title", children: "Registered Drivers" }),
|
|
1578
|
-
|
|
1633
|
+
m && /* @__PURE__ */ n(Se, { count: g, max: m })
|
|
1579
1634
|
] }),
|
|
1580
|
-
/* @__PURE__ */ n(Re, { drivers:
|
|
1635
|
+
/* @__PURE__ */ n(Re, { drivers: t, steamId: s }),
|
|
1581
1636
|
i.error && /* @__PURE__ */ n("div", { className: "pvx-reg-error", children: i.error.message || "Withdrawal failed" }),
|
|
1582
|
-
|
|
1637
|
+
r ? /* @__PURE__ */ n("div", { className: "pvx-reg-actions", children: u ? /* @__PURE__ */ c("div", { className: "pvx-reg-confirm", children: [
|
|
1583
1638
|
/* @__PURE__ */ n("p", { className: "pvx-reg-confirm-text", children: "Are you sure you want to unregister?" }),
|
|
1584
1639
|
/* @__PURE__ */ c("div", { className: "pvx-reg-confirm-actions", children: [
|
|
1585
1640
|
/* @__PURE__ */ n(
|
|
@@ -1596,7 +1651,7 @@ function fn({ competitionId: e, drivers: r, steamId: s, isPowerMode: t, registra
|
|
|
1596
1651
|
{
|
|
1597
1652
|
type: "button",
|
|
1598
1653
|
className: "pvx-reg-danger-btn",
|
|
1599
|
-
onClick:
|
|
1654
|
+
onClick: p,
|
|
1600
1655
|
disabled: i.isPending,
|
|
1601
1656
|
children: i.isPending ? "Unregistering..." : "Yes, Unregister"
|
|
1602
1657
|
}
|
|
@@ -1613,90 +1668,90 @@ function fn({ competitionId: e, drivers: r, steamId: s, isPowerMode: t, registra
|
|
|
1613
1668
|
) }) : /* @__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" }) })
|
|
1614
1669
|
] });
|
|
1615
1670
|
}
|
|
1616
|
-
function Re({ drivers: e, steamId:
|
|
1671
|
+
function Re({ drivers: e, steamId: t }) {
|
|
1617
1672
|
if (!e.length)
|
|
1618
1673
|
return /* @__PURE__ */ n("div", { className: "pvx-reg-no-drivers", children: "No drivers registered yet." });
|
|
1619
|
-
const s = [...e].sort((
|
|
1620
|
-
const i =
|
|
1674
|
+
const s = [...e].sort((r, a) => {
|
|
1675
|
+
const i = t && r.steamId === t ? -1 : 0, o = t && a.steamId === t ? -1 : 0;
|
|
1621
1676
|
return i - o;
|
|
1622
1677
|
});
|
|
1623
|
-
return /* @__PURE__ */ n("div", { className: "pvx-reg-driver-list", children: s.map((
|
|
1678
|
+
return /* @__PURE__ */ n("div", { className: "pvx-reg-driver-list", children: s.map((r) => {
|
|
1624
1679
|
var i, o;
|
|
1625
|
-
const a =
|
|
1680
|
+
const a = t && r.steamId === t;
|
|
1626
1681
|
return /* @__PURE__ */ c(
|
|
1627
1682
|
"div",
|
|
1628
1683
|
{
|
|
1629
1684
|
className: `pvx-reg-driver-row ${a ? "pvx-reg-driver-row--you" : ""}`,
|
|
1630
1685
|
children: [
|
|
1631
|
-
|
|
1686
|
+
r.avatarUrl ? /* @__PURE__ */ n("img", { src: r.avatarUrl, alt: "", className: "pvx-reg-driver-avatar" }) : /* @__PURE__ */ n("div", { className: "pvx-reg-driver-avatar pvx-reg-driver-avatar--placeholder", children: ((o = (i = r.displayName) == null ? void 0 : i.charAt(0)) == null ? void 0 : o.toUpperCase()) || "?" }),
|
|
1632
1687
|
/* @__PURE__ */ c("span", { className: "pvx-reg-driver-name", children: [
|
|
1633
|
-
|
|
1688
|
+
r.displayName,
|
|
1634
1689
|
a && /* @__PURE__ */ n("span", { className: "pvx-entry-you", children: " (you)" })
|
|
1635
1690
|
] })
|
|
1636
1691
|
]
|
|
1637
1692
|
},
|
|
1638
|
-
|
|
1693
|
+
r.steamId || r.driverId
|
|
1639
1694
|
);
|
|
1640
1695
|
}) });
|
|
1641
1696
|
}
|
|
1642
|
-
function Se({ count: e, max:
|
|
1643
|
-
const s =
|
|
1644
|
-
return /* @__PURE__ */ c("span", { className: `pvx-reg-capacity pvx-reg-capacity--${
|
|
1697
|
+
function Se({ count: e, max: t }) {
|
|
1698
|
+
const s = t ? e / t * 100 : 0, r = s >= 100 ? "full" : s >= 75 ? "warning" : "ok";
|
|
1699
|
+
return /* @__PURE__ */ c("span", { className: `pvx-reg-capacity pvx-reg-capacity--${r}`, children: [
|
|
1645
1700
|
e,
|
|
1646
1701
|
"/",
|
|
1647
|
-
|
|
1702
|
+
t,
|
|
1648
1703
|
" drivers"
|
|
1649
1704
|
] });
|
|
1650
1705
|
}
|
|
1651
|
-
function
|
|
1652
|
-
const { data: s, isLoading:
|
|
1706
|
+
function vt({ competitionId: e, className: t }) {
|
|
1707
|
+
const { data: s, isLoading: r } = me(e), a = (s == null ? void 0 : s.type) === "championship", i = L(
|
|
1653
1708
|
() => {
|
|
1654
|
-
var
|
|
1655
|
-
return ((
|
|
1709
|
+
var v;
|
|
1710
|
+
return ((v = s == null ? void 0 : s.rounds) == null ? void 0 : v.filter((N) => N.isFinalized)) || [];
|
|
1656
1711
|
},
|
|
1657
1712
|
[s]
|
|
1658
1713
|
), o = L(
|
|
1659
|
-
() => i.map((
|
|
1714
|
+
() => i.map((v) => v.roundNumber),
|
|
1660
1715
|
[i]
|
|
1661
|
-
), { data: d = [], isLoading:
|
|
1716
|
+
), { data: d = [], isLoading: u } = Oe(
|
|
1662
1717
|
e,
|
|
1663
1718
|
o
|
|
1664
|
-
), l = a ? "standings" : o.length > 0 ? `round-${o[o.length - 1]}` : null, [
|
|
1665
|
-
if (
|
|
1666
|
-
return /* @__PURE__ */ n(
|
|
1719
|
+
), l = a ? "standings" : o.length > 0 ? `round-${o[o.length - 1]}` : null, [p, f] = D(null), g = p || l;
|
|
1720
|
+
if (r || u)
|
|
1721
|
+
return /* @__PURE__ */ n(E, { message: "Loading results..." });
|
|
1667
1722
|
if (!s)
|
|
1668
1723
|
return /* @__PURE__ */ n(P, { message: "Competition not found." });
|
|
1669
1724
|
if (!i.length)
|
|
1670
1725
|
return /* @__PURE__ */ n(P, { message: "No results available yet. Results will appear here once rounds are finalised." });
|
|
1671
|
-
const
|
|
1726
|
+
const m = new Map(d.map((v) => [`round-${v.roundNumber}`, v])), b = [];
|
|
1672
1727
|
a && b.push({ id: "standings", label: "Standings" });
|
|
1673
|
-
for (const
|
|
1728
|
+
for (const v of i)
|
|
1674
1729
|
b.push({
|
|
1675
|
-
id: `round-${
|
|
1676
|
-
label: `R${
|
|
1730
|
+
id: `round-${v.roundNumber}`,
|
|
1731
|
+
label: `R${v.roundNumber}`,
|
|
1677
1732
|
track: null
|
|
1678
1733
|
});
|
|
1679
|
-
const x =
|
|
1680
|
-
return /* @__PURE__ */ c("div", { className:
|
|
1681
|
-
/* @__PURE__ */ n("div", { className: "pvx-results-tabs", children: b.map((
|
|
1734
|
+
const x = m.get(g);
|
|
1735
|
+
return /* @__PURE__ */ c("div", { className: t || "", children: [
|
|
1736
|
+
/* @__PURE__ */ n("div", { className: "pvx-results-tabs", children: b.map((v) => /* @__PURE__ */ c(
|
|
1682
1737
|
"button",
|
|
1683
1738
|
{
|
|
1684
|
-
className: `pvx-results-tab ${g ===
|
|
1685
|
-
onClick: () => f(
|
|
1686
|
-
title:
|
|
1739
|
+
className: `pvx-results-tab ${g === v.id ? "pvx-results-tab--active" : ""}`,
|
|
1740
|
+
onClick: () => f(v.id),
|
|
1741
|
+
title: v.track || void 0,
|
|
1687
1742
|
children: [
|
|
1688
|
-
/* @__PURE__ */ n("span", { className: "pvx-results-tab-label", children:
|
|
1689
|
-
|
|
1743
|
+
/* @__PURE__ */ n("span", { className: "pvx-results-tab-label", children: v.label }),
|
|
1744
|
+
v.track && /* @__PURE__ */ n("span", { className: "pvx-results-tab-track", children: v.track })
|
|
1690
1745
|
]
|
|
1691
1746
|
},
|
|
1692
|
-
|
|
1747
|
+
v.id
|
|
1693
1748
|
)) }),
|
|
1694
|
-
g === "standings" ? /* @__PURE__ */ n(
|
|
1749
|
+
g === "standings" ? /* @__PURE__ */ n(mn, { competitionId: e }) : x ? /* @__PURE__ */ n(yn, { round: x }) : /* @__PURE__ */ n(P, { message: "No results for this round." })
|
|
1695
1750
|
] });
|
|
1696
1751
|
}
|
|
1697
|
-
function
|
|
1752
|
+
function yn({ round: e }) {
|
|
1698
1753
|
var a;
|
|
1699
|
-
const s = (e.sessions || []).find((i) => i.type === "RACE"),
|
|
1754
|
+
const s = (e.sessions || []).find((i) => i.type === "RACE"), r = (a = s == null ? void 0 : s.results) == null ? void 0 : a.filter((i) => i.position <= 3).sort((i, o) => i.position - o.position);
|
|
1700
1755
|
return /* @__PURE__ */ c("div", { className: "pvx-card", children: [
|
|
1701
1756
|
/* @__PURE__ */ c("div", { className: "pvx-card-header--split", children: [
|
|
1702
1757
|
/* @__PURE__ */ c("div", { children: [
|
|
@@ -1711,7 +1766,7 @@ function Nn({ round: e }) {
|
|
|
1711
1766
|
year: "numeric"
|
|
1712
1767
|
}) })
|
|
1713
1768
|
] }),
|
|
1714
|
-
(
|
|
1769
|
+
(r == null ? void 0 : r.length) > 0 && /* @__PURE__ */ n("div", { className: "pvx-round-podium-summary", children: r.map((i) => /* @__PURE__ */ c("span", { className: "pvx-round-podium-item", children: [
|
|
1715
1770
|
/* @__PURE__ */ n("span", { children: se[i.position - 1] }),
|
|
1716
1771
|
/* @__PURE__ */ n("span", { children: i.driverName })
|
|
1717
1772
|
] }, i.driverId)) })
|
|
@@ -1719,96 +1774,96 @@ function Nn({ round: e }) {
|
|
|
1719
1774
|
/* @__PURE__ */ n(Te, { round: e })
|
|
1720
1775
|
] });
|
|
1721
1776
|
}
|
|
1722
|
-
function
|
|
1723
|
-
const { cdnUrl:
|
|
1777
|
+
function kn(e) {
|
|
1778
|
+
const { cdnUrl: t } = k(), s = R({
|
|
1724
1779
|
queryKey: ["pitvox", "laps", "global", e, "index"],
|
|
1725
|
-
queryFn: () => S(
|
|
1780
|
+
queryFn: () => S(t, _e(null, e)),
|
|
1726
1781
|
enabled: !!e,
|
|
1727
1782
|
staleTime: 3e4,
|
|
1728
1783
|
refetchInterval: 3e4
|
|
1729
|
-
}),
|
|
1784
|
+
}), r = s.data;
|
|
1730
1785
|
return {
|
|
1731
1786
|
isLoading: s.isLoading,
|
|
1732
1787
|
error: s.error,
|
|
1733
|
-
data:
|
|
1734
|
-
driverName:
|
|
1735
|
-
lapCount:
|
|
1736
|
-
trackBreakdown:
|
|
1737
|
-
carBreakdown:
|
|
1738
|
-
recordsHeld:
|
|
1739
|
-
currentRecords:
|
|
1740
|
-
bestRanking:
|
|
1741
|
-
bestRankingTrackId:
|
|
1742
|
-
bestRankingLayout:
|
|
1743
|
-
bestRankingCarId:
|
|
1744
|
-
generatedAt:
|
|
1788
|
+
data: r ? {
|
|
1789
|
+
driverName: r.driverName || "Driver",
|
|
1790
|
+
lapCount: r.lapCount || 0,
|
|
1791
|
+
trackBreakdown: r.trackBreakdown || [],
|
|
1792
|
+
carBreakdown: r.carBreakdown || [],
|
|
1793
|
+
recordsHeld: r.recordsHeld || 0,
|
|
1794
|
+
currentRecords: r.currentRecords || [],
|
|
1795
|
+
bestRanking: r.bestRanking ?? null,
|
|
1796
|
+
bestRankingTrackId: r.bestRankingTrackId ?? null,
|
|
1797
|
+
bestRankingLayout: r.bestRankingLayout ?? null,
|
|
1798
|
+
bestRankingCarId: r.bestRankingCarId ?? null,
|
|
1799
|
+
generatedAt: r.generatedAt
|
|
1745
1800
|
} : null
|
|
1746
1801
|
};
|
|
1747
1802
|
}
|
|
1748
1803
|
function $e(e = {}) {
|
|
1749
|
-
const { cdnUrl:
|
|
1804
|
+
const { cdnUrl: t, partnerSlug: s } = k(), { game: r, gameVersion: a, enabled: i = !0 } = e, o = Z(s, r, a, "ratings.json");
|
|
1750
1805
|
return R({
|
|
1751
|
-
queryKey: ["pitvox", "ratings", s,
|
|
1752
|
-
queryFn: () => S(
|
|
1806
|
+
queryKey: ["pitvox", "ratings", s, r || null, a || null],
|
|
1807
|
+
queryFn: () => S(t, o),
|
|
1753
1808
|
staleTime: 3e4,
|
|
1754
1809
|
refetchInterval: 3e4,
|
|
1755
1810
|
enabled: i
|
|
1756
1811
|
});
|
|
1757
1812
|
}
|
|
1758
|
-
function
|
|
1759
|
-
var
|
|
1760
|
-
const
|
|
1813
|
+
function wn(e) {
|
|
1814
|
+
var r;
|
|
1815
|
+
const t = $e(), s = L(() => {
|
|
1761
1816
|
var a;
|
|
1762
|
-
return !((a =
|
|
1817
|
+
return !((a = t.data) != null && a.drivers) || !e ? null : t.data.drivers.find(
|
|
1763
1818
|
(i) => i.identifier === e
|
|
1764
1819
|
) || null;
|
|
1765
|
-
}, [(
|
|
1820
|
+
}, [(r = t.data) == null ? void 0 : r.drivers, e]);
|
|
1766
1821
|
return {
|
|
1767
|
-
isLoading:
|
|
1768
|
-
error:
|
|
1822
|
+
isLoading: t.isLoading,
|
|
1823
|
+
error: t.error,
|
|
1769
1824
|
data: s ? {
|
|
1770
1825
|
rating: s.rating,
|
|
1771
1826
|
rank: s.rank,
|
|
1772
|
-
totalDrivers:
|
|
1827
|
+
totalDrivers: t.data.driverCount || t.data.drivers.length,
|
|
1773
1828
|
comboCount: s.comboCount || 0,
|
|
1774
1829
|
distinctCars: s.distinctCars || 0,
|
|
1775
1830
|
combos: s.combos || []
|
|
1776
1831
|
} : null
|
|
1777
1832
|
};
|
|
1778
1833
|
}
|
|
1779
|
-
function
|
|
1780
|
-
const
|
|
1834
|
+
function ht(e = {}) {
|
|
1835
|
+
const t = $e(e);
|
|
1781
1836
|
return {
|
|
1782
|
-
data:
|
|
1783
|
-
isLoading:
|
|
1784
|
-
error:
|
|
1837
|
+
data: t.data || null,
|
|
1838
|
+
isLoading: t.isLoading,
|
|
1839
|
+
error: t.error
|
|
1785
1840
|
};
|
|
1786
1841
|
}
|
|
1787
|
-
function
|
|
1788
|
-
const { cdnUrl: e, partnerSlug:
|
|
1789
|
-
queryKey: ["pitvox", "competitions",
|
|
1842
|
+
function Cn() {
|
|
1843
|
+
const { cdnUrl: e, partnerSlug: t, getSteamId: s, onFetchServerPassword: r } = k(), a = s(), { data: i, isLoading: o } = R({
|
|
1844
|
+
queryKey: ["pitvox", "competitions", t],
|
|
1790
1845
|
queryFn: async () => {
|
|
1791
|
-
const
|
|
1792
|
-
return
|
|
1846
|
+
const m = await S(e, "competitions/index.json");
|
|
1847
|
+
return m != null && m.competitions ? m.competitions.filter((b) => b.partnerSlug === t) : [];
|
|
1793
1848
|
},
|
|
1794
1849
|
staleTime: 6e4
|
|
1795
|
-
}), d = (i == null ? void 0 : i.map((
|
|
1796
|
-
queries: d.map((
|
|
1797
|
-
queryKey: ["pitvox", "competition",
|
|
1798
|
-
queryFn: () => S(e, `competitions/${
|
|
1850
|
+
}), d = (i == null ? void 0 : i.map((m) => m.id)) || [], u = ie({
|
|
1851
|
+
queries: d.map((m) => ({
|
|
1852
|
+
queryKey: ["pitvox", "competition", t, m, "entrylist"],
|
|
1853
|
+
queryFn: () => S(e, `competitions/${t}/${m}/entrylist.json`),
|
|
1799
1854
|
enabled: !!a && d.length > 0,
|
|
1800
1855
|
staleTime: 6e4
|
|
1801
1856
|
}))
|
|
1802
|
-
}), l =
|
|
1803
|
-
var x,
|
|
1857
|
+
}), l = u.some((m) => m.isLoading), p = L(() => {
|
|
1858
|
+
var x, v;
|
|
1804
1859
|
if (!i || !a || l) return [];
|
|
1805
|
-
const
|
|
1860
|
+
const m = /* @__PURE__ */ new Date(), b = [];
|
|
1806
1861
|
for (let N = 0; N < i.length; N++) {
|
|
1807
|
-
const h = i[N], y = (x =
|
|
1808
|
-
if (!((
|
|
1862
|
+
const h = i[N], y = (x = u[N]) == null ? void 0 : x.data;
|
|
1863
|
+
if (!((v = y == null ? void 0 : y.drivers) == null ? void 0 : v.some((T) => T.steamId === a))) continue;
|
|
1809
1864
|
const w = h.rounds || [];
|
|
1810
1865
|
for (const T of w)
|
|
1811
|
-
T.isFinalized || !T.startTime || new Date(T.startTime) <=
|
|
1866
|
+
T.isFinalized || !T.startTime || new Date(T.startTime) <= m || b.push({
|
|
1812
1867
|
competitionId: h.id,
|
|
1813
1868
|
competitionName: h.name,
|
|
1814
1869
|
roundNumber: T.roundNumber,
|
|
@@ -1817,65 +1872,65 @@ function kn() {
|
|
|
1817
1872
|
});
|
|
1818
1873
|
}
|
|
1819
1874
|
return b.sort((N, h) => new Date(N.startTime) - new Date(h.startTime)), b.length > 0 && (b[0].isNext = !0), b;
|
|
1820
|
-
}, [i, a, l,
|
|
1821
|
-
queries:
|
|
1822
|
-
queryKey: ["pitvox", "serverInfo",
|
|
1823
|
-
queryFn: () =>
|
|
1824
|
-
enabled: !!
|
|
1875
|
+
}, [i, a, l, u]), f = ie({
|
|
1876
|
+
queries: p.map((m) => ({
|
|
1877
|
+
queryKey: ["pitvox", "serverInfo", m.competitionId, m.roundNumber],
|
|
1878
|
+
queryFn: () => r(m.competitionId, m.roundNumber),
|
|
1879
|
+
enabled: !!r && p.length > 0,
|
|
1825
1880
|
staleTime: 5 * 6e4,
|
|
1826
1881
|
// 5 minutes
|
|
1827
1882
|
retry: !1
|
|
1828
1883
|
}))
|
|
1829
1884
|
});
|
|
1830
1885
|
return {
|
|
1831
|
-
data: L(() =>
|
|
1832
|
-
var
|
|
1833
|
-
const x = (
|
|
1886
|
+
data: L(() => p.length ? r ? p.map((m, b) => {
|
|
1887
|
+
var v;
|
|
1888
|
+
const x = (v = f[b]) == null ? void 0 : v.data;
|
|
1834
1889
|
return x != null && x.success ? {
|
|
1835
|
-
...
|
|
1890
|
+
...m,
|
|
1836
1891
|
serverAddress: x.serverAddress || null,
|
|
1837
1892
|
serverPassword: x.serverPassword || null
|
|
1838
|
-
} :
|
|
1839
|
-
}) :
|
|
1893
|
+
} : m;
|
|
1894
|
+
}) : p : [], [p, r, f]),
|
|
1840
1895
|
isLoading: o || !!a && l
|
|
1841
1896
|
};
|
|
1842
1897
|
}
|
|
1843
|
-
function
|
|
1898
|
+
function Ln() {
|
|
1844
1899
|
const { onFetchNotifications: e } = k();
|
|
1845
1900
|
return !!e;
|
|
1846
1901
|
}
|
|
1847
|
-
function
|
|
1848
|
-
const { onFetchNotifications:
|
|
1902
|
+
function Tn(e = {}) {
|
|
1903
|
+
const { onFetchNotifications: t, partnerSlug: s } = k(), { limit: r = 20, unreadOnly: a = !1 } = e;
|
|
1849
1904
|
return R({
|
|
1850
|
-
queryKey: ["pitvox", "notifications", s, { limit:
|
|
1851
|
-
queryFn: () =>
|
|
1852
|
-
enabled: !!
|
|
1905
|
+
queryKey: ["pitvox", "notifications", s, { limit: r, unreadOnly: a }],
|
|
1906
|
+
queryFn: () => t({ limit: r, unreadOnly: a }),
|
|
1907
|
+
enabled: !!t,
|
|
1853
1908
|
staleTime: 3e4,
|
|
1854
1909
|
refetchInterval: 3e4
|
|
1855
1910
|
});
|
|
1856
1911
|
}
|
|
1857
|
-
function
|
|
1858
|
-
const { onFetchNotifications: e, partnerSlug:
|
|
1859
|
-
queryKey: ["pitvox", "notifications",
|
|
1912
|
+
function xt() {
|
|
1913
|
+
const { onFetchNotifications: e, partnerSlug: t } = k(), { data: s, isLoading: r } = R({
|
|
1914
|
+
queryKey: ["pitvox", "notifications", t, { limit: 1, unreadOnly: !1 }],
|
|
1860
1915
|
queryFn: () => e({ limit: 1 }),
|
|
1861
1916
|
enabled: !!e,
|
|
1862
1917
|
staleTime: 3e4,
|
|
1863
1918
|
refetchInterval: 3e4,
|
|
1864
1919
|
select: (a) => (a == null ? void 0 : a.unreadCount) ?? 0
|
|
1865
1920
|
});
|
|
1866
|
-
return { count: s ?? 0, isLoading:
|
|
1921
|
+
return { count: s ?? 0, isLoading: r };
|
|
1867
1922
|
}
|
|
1868
|
-
function
|
|
1869
|
-
const { onMarkNotificationRead: e, partnerSlug:
|
|
1923
|
+
function Rn() {
|
|
1924
|
+
const { onMarkNotificationRead: e, partnerSlug: t } = k(), s = _();
|
|
1870
1925
|
return O({
|
|
1871
|
-
mutationFn: (
|
|
1926
|
+
mutationFn: (r) => {
|
|
1872
1927
|
if (!e)
|
|
1873
1928
|
throw new Error("No onMarkNotificationRead callback provided to PitVoxPartnerProvider.");
|
|
1874
|
-
return e(
|
|
1929
|
+
return e(r);
|
|
1875
1930
|
},
|
|
1876
|
-
onSuccess: (
|
|
1931
|
+
onSuccess: (r, a) => {
|
|
1877
1932
|
s.setQueriesData(
|
|
1878
|
-
{ queryKey: ["pitvox", "notifications",
|
|
1933
|
+
{ queryKey: ["pitvox", "notifications", t] },
|
|
1879
1934
|
(i) => i != null && i.notifications ? {
|
|
1880
1935
|
...i,
|
|
1881
1936
|
unreadCount: Math.max(0, (i.unreadCount || 0) - 1),
|
|
@@ -1887,8 +1942,8 @@ function Ln() {
|
|
|
1887
1942
|
}
|
|
1888
1943
|
});
|
|
1889
1944
|
}
|
|
1890
|
-
function
|
|
1891
|
-
const { onMarkAllNotificationsRead: e, partnerSlug:
|
|
1945
|
+
function Sn() {
|
|
1946
|
+
const { onMarkAllNotificationsRead: e, partnerSlug: t } = k(), s = _();
|
|
1892
1947
|
return O({
|
|
1893
1948
|
mutationFn: () => {
|
|
1894
1949
|
if (!e)
|
|
@@ -1897,24 +1952,24 @@ function Tn() {
|
|
|
1897
1952
|
},
|
|
1898
1953
|
onSuccess: () => {
|
|
1899
1954
|
s.setQueriesData(
|
|
1900
|
-
{ queryKey: ["pitvox", "notifications",
|
|
1901
|
-
(
|
|
1902
|
-
...
|
|
1955
|
+
{ queryKey: ["pitvox", "notifications", t] },
|
|
1956
|
+
(r) => r != null && r.notifications ? {
|
|
1957
|
+
...r,
|
|
1903
1958
|
unreadCount: 0,
|
|
1904
|
-
notifications:
|
|
1959
|
+
notifications: r.notifications.map((a) => ({
|
|
1905
1960
|
...a,
|
|
1906
1961
|
isRead: !0,
|
|
1907
1962
|
readAt: a.readAt || (/* @__PURE__ */ new Date()).toISOString()
|
|
1908
1963
|
}))
|
|
1909
|
-
} :
|
|
1964
|
+
} : r
|
|
1910
1965
|
);
|
|
1911
1966
|
}
|
|
1912
1967
|
});
|
|
1913
1968
|
}
|
|
1914
|
-
function
|
|
1969
|
+
function $n({ driverName: e, avatarUrl: t, memberSince: s, className: r = "" }) {
|
|
1915
1970
|
const a = s ? new Date(s).toLocaleDateString("en-GB", { day: "2-digit", month: "2-digit", year: "numeric" }) : null;
|
|
1916
|
-
return /* @__PURE__ */ c("div", { className: `pvx-card pvx-dash-profile ${
|
|
1917
|
-
|
|
1971
|
+
return /* @__PURE__ */ c("div", { className: `pvx-card pvx-dash-profile ${r}`, children: [
|
|
1972
|
+
t ? /* @__PURE__ */ n("img", { src: t, alt: "", className: "pvx-dash-profile-avatar" }) : /* @__PURE__ */ n("div", { className: "pvx-dash-profile-avatar pvx-dash-profile-avatar--placeholder", children: (e || "?")[0].toUpperCase() }),
|
|
1918
1973
|
/* @__PURE__ */ c("div", { className: "pvx-dash-profile-info", children: [
|
|
1919
1974
|
/* @__PURE__ */ n("h2", { className: "pvx-dash-profile-name", children: e }),
|
|
1920
1975
|
a && /* @__PURE__ */ c("p", { className: "pvx-dash-profile-since", children: [
|
|
@@ -1924,7 +1979,7 @@ function Rn({ driverName: e, avatarUrl: r, memberSince: s, className: t = "" })
|
|
|
1924
1979
|
] })
|
|
1925
1980
|
] });
|
|
1926
1981
|
}
|
|
1927
|
-
function
|
|
1982
|
+
function Mn() {
|
|
1928
1983
|
return /* @__PURE__ */ c("svg", { className: "pvx-dash-stat-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1929
1984
|
/* @__PURE__ */ n("line", { x1: "4", y1: "9", x2: "20", y2: "9" }),
|
|
1930
1985
|
/* @__PURE__ */ n("line", { x1: "4", y1: "15", x2: "20", y2: "15" }),
|
|
@@ -1932,7 +1987,7 @@ function Sn() {
|
|
|
1932
1987
|
/* @__PURE__ */ n("line", { x1: "16", y1: "3", x2: "14", y2: "21" })
|
|
1933
1988
|
] });
|
|
1934
1989
|
}
|
|
1935
|
-
function
|
|
1990
|
+
function Dn() {
|
|
1936
1991
|
return /* @__PURE__ */ c("svg", { className: "pvx-dash-stat-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1937
1992
|
/* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "10" }),
|
|
1938
1993
|
/* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "2" }),
|
|
@@ -1941,42 +1996,42 @@ function $n() {
|
|
|
1941
1996
|
/* @__PURE__ */ n("path", { d: "M13.5 12.5l4 2.5" })
|
|
1942
1997
|
] });
|
|
1943
1998
|
}
|
|
1944
|
-
function
|
|
1999
|
+
function In() {
|
|
1945
2000
|
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" }) });
|
|
1946
2001
|
}
|
|
1947
|
-
function ce({ icon: e, value:
|
|
1948
|
-
const [o, d] = D(!1),
|
|
2002
|
+
function ce({ icon: e, value: t, label: s, items: r, labelKey: a, countKey: i }) {
|
|
2003
|
+
const [o, d] = D(!1), u = Ie(null);
|
|
1949
2004
|
Be(() => {
|
|
1950
2005
|
if (!o) return;
|
|
1951
|
-
function
|
|
1952
|
-
|
|
2006
|
+
function p(f) {
|
|
2007
|
+
u.current && !u.current.contains(f.target) && d(!1);
|
|
1953
2008
|
}
|
|
1954
|
-
return document.addEventListener("mousedown",
|
|
2009
|
+
return document.addEventListener("mousedown", p), () => document.removeEventListener("mousedown", p);
|
|
1955
2010
|
}, [o]);
|
|
1956
|
-
const l =
|
|
2011
|
+
const l = r != null && r.length ? r.slice().sort((p, f) => f[i] - p[i]) : null;
|
|
1957
2012
|
return /* @__PURE__ */ c(
|
|
1958
2013
|
"div",
|
|
1959
2014
|
{
|
|
1960
|
-
ref:
|
|
2015
|
+
ref: u,
|
|
1961
2016
|
className: `pvx-dash-stat-card ${l ? "pvx-dash-stat-card--clickable" : ""}`,
|
|
1962
|
-
onClick: l ? () => d((
|
|
2017
|
+
onClick: l ? () => d((p) => !p) : void 0,
|
|
1963
2018
|
children: [
|
|
1964
2019
|
e,
|
|
1965
2020
|
/* @__PURE__ */ c("div", { className: "pvx-dash-stat-content", children: [
|
|
1966
|
-
/* @__PURE__ */ n("span", { className: "pvx-dash-stat-value", children:
|
|
2021
|
+
/* @__PURE__ */ n("span", { className: "pvx-dash-stat-value", children: t }),
|
|
1967
2022
|
/* @__PURE__ */ n("span", { className: "pvx-dash-stat-label", children: s })
|
|
1968
2023
|
] }),
|
|
1969
|
-
l && /* @__PURE__ */ n("div", { className: `pvx-dash-tooltip pvx-dash-tooltip--scrollable ${o ? "pvx-dash-tooltip--open" : ""}`, children: l.map((
|
|
1970
|
-
/* @__PURE__ */ n("span", { className: "pvx-dash-tooltip-label", children:
|
|
1971
|
-
/* @__PURE__ */ n("span", { className: "pvx-dash-tooltip-value", children:
|
|
2024
|
+
l && /* @__PURE__ */ n("div", { className: `pvx-dash-tooltip pvx-dash-tooltip--scrollable ${o ? "pvx-dash-tooltip--open" : ""}`, children: l.map((p, f) => /* @__PURE__ */ c("div", { className: "pvx-dash-tooltip-row", children: [
|
|
2025
|
+
/* @__PURE__ */ n("span", { className: "pvx-dash-tooltip-label", children: p[a] }),
|
|
2026
|
+
/* @__PURE__ */ n("span", { className: "pvx-dash-tooltip-value", children: p[i] })
|
|
1972
2027
|
] }, f)) })
|
|
1973
2028
|
]
|
|
1974
2029
|
}
|
|
1975
2030
|
);
|
|
1976
2031
|
}
|
|
1977
|
-
function
|
|
2032
|
+
function Bn({ stats: e, rating: t, className: s = "" }) {
|
|
1978
2033
|
if (!e) return null;
|
|
1979
|
-
const
|
|
2034
|
+
const r = e.trackBreakdown.map((i) => ({
|
|
1980
2035
|
name: q(i.trackId, i.layout),
|
|
1981
2036
|
lapCount: i.lapCount
|
|
1982
2037
|
})), a = e.carBreakdown.map((i) => ({
|
|
@@ -1987,10 +2042,10 @@ function Dn({ stats: e, rating: r, className: s = "" }) {
|
|
|
1987
2042
|
/* @__PURE__ */ n(
|
|
1988
2043
|
ce,
|
|
1989
2044
|
{
|
|
1990
|
-
icon: /* @__PURE__ */ n(
|
|
2045
|
+
icon: /* @__PURE__ */ n(Mn, {}),
|
|
1991
2046
|
value: e.lapCount.toLocaleString(),
|
|
1992
2047
|
label: "Total Laps",
|
|
1993
|
-
items:
|
|
2048
|
+
items: r,
|
|
1994
2049
|
labelKey: "name",
|
|
1995
2050
|
countKey: "lapCount"
|
|
1996
2051
|
}
|
|
@@ -1998,7 +2053,7 @@ function Dn({ stats: e, rating: r, className: s = "" }) {
|
|
|
1998
2053
|
/* @__PURE__ */ n(
|
|
1999
2054
|
ce,
|
|
2000
2055
|
{
|
|
2001
|
-
icon: /* @__PURE__ */ n(
|
|
2056
|
+
icon: /* @__PURE__ */ n(Dn, {}),
|
|
2002
2057
|
value: e.carBreakdown.length,
|
|
2003
2058
|
label: "Cars Used",
|
|
2004
2059
|
items: a,
|
|
@@ -2006,27 +2061,27 @@ function Dn({ stats: e, rating: r, className: s = "" }) {
|
|
|
2006
2061
|
countKey: "lapCount"
|
|
2007
2062
|
}
|
|
2008
2063
|
),
|
|
2009
|
-
|
|
2010
|
-
/* @__PURE__ */ n(
|
|
2064
|
+
t && /* @__PURE__ */ c("div", { className: "pvx-dash-stat-card pvx-dash-stat-card--rating", children: [
|
|
2065
|
+
/* @__PURE__ */ n(In, {}),
|
|
2011
2066
|
/* @__PURE__ */ c("div", { className: "pvx-dash-stat-content", children: [
|
|
2012
|
-
/* @__PURE__ */ n("span", { className: "pvx-dash-stat-value", children:
|
|
2067
|
+
/* @__PURE__ */ n("span", { className: "pvx-dash-stat-value", children: t.rating.toFixed(1) }),
|
|
2013
2068
|
/* @__PURE__ */ n("span", { className: "pvx-dash-stat-label", children: "Driver Rating" }),
|
|
2014
2069
|
/* @__PURE__ */ c("span", { className: "pvx-dash-stat-sub", children: [
|
|
2015
2070
|
"#",
|
|
2016
|
-
|
|
2071
|
+
t.rank,
|
|
2017
2072
|
" of ",
|
|
2018
|
-
|
|
2073
|
+
t.totalDrivers
|
|
2019
2074
|
] })
|
|
2020
2075
|
] })
|
|
2021
2076
|
] })
|
|
2022
2077
|
] });
|
|
2023
2078
|
}
|
|
2024
|
-
function
|
|
2025
|
-
const s = L(() => e != null && e.length ? e.slice().sort((
|
|
2026
|
-
const i =
|
|
2079
|
+
function Pn({ records: e, className: t = "" }) {
|
|
2080
|
+
const s = L(() => e != null && e.length ? e.slice().sort((r, a) => {
|
|
2081
|
+
const i = r.recordedAt ? new Date(r.recordedAt).getTime() : 0;
|
|
2027
2082
|
return (a.recordedAt ? new Date(a.recordedAt).getTime() : 0) - i;
|
|
2028
2083
|
}) : [], [e]);
|
|
2029
|
-
return s.length ? /* @__PURE__ */ c("div", { className: `pvx-card ${
|
|
2084
|
+
return s.length ? /* @__PURE__ */ c("div", { className: `pvx-card ${t}`, children: [
|
|
2030
2085
|
/* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ c("h3", { className: "pvx-card-title", children: [
|
|
2031
2086
|
/* @__PURE__ */ n("span", { className: "pvx-dash-records-icon", children: /* @__PURE__ */ c("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2032
2087
|
/* @__PURE__ */ n("path", { d: "M6 9H4.5a2.5 2.5 0 010-5H6" }),
|
|
@@ -2043,30 +2098,30 @@ function In({ records: e, className: r = "" }) {
|
|
|
2043
2098
|
")"
|
|
2044
2099
|
] })
|
|
2045
2100
|
] }) }),
|
|
2046
|
-
/* @__PURE__ */ n("div", { className: "pvx-dash-records-list", children: s.map((
|
|
2101
|
+
/* @__PURE__ */ n("div", { className: "pvx-dash-records-list", children: s.map((r, a) => /* @__PURE__ */ c("div", { className: "pvx-dash-record-row", children: [
|
|
2047
2102
|
/* @__PURE__ */ c("div", { className: "pvx-dash-record-info", children: [
|
|
2048
|
-
/* @__PURE__ */ n("span", { className: "pvx-dash-record-track", children: q(
|
|
2049
|
-
/* @__PURE__ */ n("span", { className: "pvx-dash-record-car", children: I(
|
|
2103
|
+
/* @__PURE__ */ n("span", { className: "pvx-dash-record-track", children: q(r.trackId, r.layout, r.game) }),
|
|
2104
|
+
/* @__PURE__ */ n("span", { className: "pvx-dash-record-car", children: I(r.carId) })
|
|
2050
2105
|
] }),
|
|
2051
2106
|
/* @__PURE__ */ c("div", { className: "pvx-dash-record-time", children: [
|
|
2052
|
-
/* @__PURE__ */ n("span", { className: "pvx-dash-record-lap", children: A(
|
|
2053
|
-
/* @__PURE__ */ c("span", { className: `pvx-dash-game-badge pvx-dash-game-badge--${
|
|
2054
|
-
(
|
|
2055
|
-
|
|
2107
|
+
/* @__PURE__ */ n("span", { className: "pvx-dash-record-lap", children: A(r.lapTimeMs) }),
|
|
2108
|
+
/* @__PURE__ */ c("span", { className: `pvx-dash-game-badge pvx-dash-game-badge--${r.game || "evo"}`, children: [
|
|
2109
|
+
(r.game || "evo").toUpperCase(),
|
|
2110
|
+
r.gameVersion ? ` ${r.gameVersion}` : ""
|
|
2056
2111
|
] })
|
|
2057
2112
|
] })
|
|
2058
2113
|
] }, a)) })
|
|
2059
2114
|
] }) : null;
|
|
2060
2115
|
}
|
|
2061
|
-
function
|
|
2062
|
-
if (
|
|
2116
|
+
function An({ events: e, isLoading: t, className: s, limit: r = 3 }) {
|
|
2117
|
+
if (t)
|
|
2063
2118
|
return /* @__PURE__ */ n("div", { className: "pvx-loading", children: "Loading upcoming events..." });
|
|
2064
2119
|
if (!(e != null && e.length))
|
|
2065
2120
|
return null;
|
|
2066
|
-
const a =
|
|
2121
|
+
const a = r ? e.slice(0, r) : e, i = e.length - a.length;
|
|
2067
2122
|
return /* @__PURE__ */ c("div", { className: `pvx-card ${s || ""}`, children: [
|
|
2068
2123
|
/* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ c("h3", { className: "pvx-card-title", children: [
|
|
2069
|
-
/* @__PURE__ */ n(
|
|
2124
|
+
/* @__PURE__ */ n(Fn, {}),
|
|
2070
2125
|
"Upcoming Events",
|
|
2071
2126
|
/* @__PURE__ */ c("span", { className: "pvx-dash-records-count", children: [
|
|
2072
2127
|
"(",
|
|
@@ -2089,7 +2144,7 @@ function Bn({ events: e, isLoading: r, className: s, limit: t = 3 }) {
|
|
|
2089
2144
|
o.track
|
|
2090
2145
|
] }),
|
|
2091
2146
|
o.serverPassword && /* @__PURE__ */ n(
|
|
2092
|
-
|
|
2147
|
+
Un,
|
|
2093
2148
|
{
|
|
2094
2149
|
password: o.serverPassword,
|
|
2095
2150
|
address: o.serverAddress
|
|
@@ -2102,7 +2157,7 @@ function Bn({ events: e, isLoading: r, className: s, limit: t = 3 }) {
|
|
|
2102
2157
|
month: "short",
|
|
2103
2158
|
year: "numeric"
|
|
2104
2159
|
}) }),
|
|
2105
|
-
/* @__PURE__ */ n("span", { className: "pvx-upcoming-relative", children:
|
|
2160
|
+
/* @__PURE__ */ n("span", { className: "pvx-upcoming-relative", children: En(o.startTime) }),
|
|
2106
2161
|
o.isNext && /* @__PURE__ */ n("span", { className: "pvx-upcoming-badge", children: "Next" })
|
|
2107
2162
|
] })
|
|
2108
2163
|
]
|
|
@@ -2118,11 +2173,11 @@ function Bn({ events: e, isLoading: r, className: s, limit: t = 3 }) {
|
|
|
2118
2173
|
] })
|
|
2119
2174
|
] });
|
|
2120
2175
|
}
|
|
2121
|
-
function
|
|
2122
|
-
const [s,
|
|
2176
|
+
function Un({ password: e, address: t }) {
|
|
2177
|
+
const [s, r] = D(!1), [a, i] = D(!1), o = t ? e ? `join:${t}|${e}` : `join:${t}` : null, d = H(async () => {
|
|
2123
2178
|
if (o)
|
|
2124
2179
|
try {
|
|
2125
|
-
await navigator.clipboard.writeText(o),
|
|
2180
|
+
await navigator.clipboard.writeText(o), r(!0), setTimeout(() => r(!1), 2e3);
|
|
2126
2181
|
} catch {
|
|
2127
2182
|
}
|
|
2128
2183
|
}, [o]);
|
|
@@ -2134,88 +2189,88 @@ function Pn({ password: e, address: r }) {
|
|
|
2134
2189
|
onClick: d,
|
|
2135
2190
|
title: "Copy join string to clipboard",
|
|
2136
2191
|
children: [
|
|
2137
|
-
/* @__PURE__ */ n(
|
|
2192
|
+
/* @__PURE__ */ n(qn, {}),
|
|
2138
2193
|
" ",
|
|
2139
2194
|
s ? "Copied!" : "Join"
|
|
2140
2195
|
]
|
|
2141
2196
|
}
|
|
2142
2197
|
),
|
|
2143
|
-
e && /* @__PURE__ */ c(
|
|
2198
|
+
e && /* @__PURE__ */ c(U, { children: [
|
|
2144
2199
|
/* @__PURE__ */ n(
|
|
2145
2200
|
"span",
|
|
2146
2201
|
{
|
|
2147
2202
|
className: "pvx-server-detail pvx-server-detail--clickable",
|
|
2148
|
-
onClick: () => i((
|
|
2203
|
+
onClick: () => i((u) => !u),
|
|
2149
2204
|
title: a ? "Hide password" : "Reveal password",
|
|
2150
|
-
children: a ? /* @__PURE__ */ n(
|
|
2205
|
+
children: a ? /* @__PURE__ */ n(Vn, {}) : /* @__PURE__ */ n(jn, {})
|
|
2151
2206
|
}
|
|
2152
2207
|
),
|
|
2153
2208
|
a && /* @__PURE__ */ c("span", { className: "pvx-server-detail", children: [
|
|
2154
|
-
/* @__PURE__ */ n(
|
|
2209
|
+
/* @__PURE__ */ n(_n, {}),
|
|
2155
2210
|
" ",
|
|
2156
2211
|
e
|
|
2157
2212
|
] })
|
|
2158
2213
|
] })
|
|
2159
2214
|
] });
|
|
2160
2215
|
}
|
|
2161
|
-
function
|
|
2162
|
-
const
|
|
2163
|
-
if (
|
|
2164
|
-
const s = Math.floor(
|
|
2216
|
+
function En(e) {
|
|
2217
|
+
const t = new Date(e).getTime() - Date.now();
|
|
2218
|
+
if (t <= 0) return "Now";
|
|
2219
|
+
const s = Math.floor(t / (1e3 * 60 * 60));
|
|
2165
2220
|
if (s < 1) return "Less than 1 hour";
|
|
2166
2221
|
if (s < 24) return `in ${s}h`;
|
|
2167
|
-
const
|
|
2168
|
-
if (
|
|
2169
|
-
if (
|
|
2170
|
-
if (
|
|
2171
|
-
const a = Math.floor(
|
|
2222
|
+
const r = Math.floor(s / 24);
|
|
2223
|
+
if (r === 1) return "Tomorrow";
|
|
2224
|
+
if (r < 7) return `in ${r} days`;
|
|
2225
|
+
if (r < 30) {
|
|
2226
|
+
const a = Math.floor(r / 7);
|
|
2172
2227
|
return `in ${a} week${a !== 1 ? "s" : ""}`;
|
|
2173
2228
|
}
|
|
2174
2229
|
return le(e);
|
|
2175
2230
|
}
|
|
2176
|
-
function
|
|
2231
|
+
function Fn() {
|
|
2177
2232
|
return /* @__PURE__ */ c("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: [
|
|
2178
2233
|
/* @__PURE__ */ n("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2" }),
|
|
2179
2234
|
/* @__PURE__ */ n("path", { d: "M16 2v4M8 2v4M3 10h18" })
|
|
2180
2235
|
] });
|
|
2181
2236
|
}
|
|
2182
|
-
function
|
|
2237
|
+
function _n() {
|
|
2183
2238
|
return /* @__PURE__ */ c("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: [
|
|
2184
2239
|
/* @__PURE__ */ n("rect", { x: "3", y: "11", width: "18", height: "11", rx: "2" }),
|
|
2185
2240
|
/* @__PURE__ */ n("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })
|
|
2186
2241
|
] });
|
|
2187
2242
|
}
|
|
2188
|
-
function
|
|
2243
|
+
function qn() {
|
|
2189
2244
|
return /* @__PURE__ */ c("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: [
|
|
2190
2245
|
/* @__PURE__ */ n("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2" }),
|
|
2191
2246
|
/* @__PURE__ */ n("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
|
|
2192
2247
|
] });
|
|
2193
2248
|
}
|
|
2194
|
-
function
|
|
2249
|
+
function jn() {
|
|
2195
2250
|
return /* @__PURE__ */ c("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: [
|
|
2196
2251
|
/* @__PURE__ */ n("path", { d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" }),
|
|
2197
2252
|
/* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "3" })
|
|
2198
2253
|
] });
|
|
2199
2254
|
}
|
|
2200
|
-
function
|
|
2255
|
+
function Vn() {
|
|
2201
2256
|
return /* @__PURE__ */ c("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: [
|
|
2202
2257
|
/* @__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" }),
|
|
2203
2258
|
/* @__PURE__ */ n("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
|
|
2204
2259
|
] });
|
|
2205
2260
|
}
|
|
2206
|
-
function
|
|
2261
|
+
function Kn({ notifications: e, unreadCount: t = 0, onMarkRead: s, onMarkAllRead: r, isLoading: a, className: i }) {
|
|
2207
2262
|
const o = ue();
|
|
2208
2263
|
return a ? /* @__PURE__ */ n("div", { className: "pvx-loading", children: "Loading notifications..." }) : /* @__PURE__ */ c("div", { className: `pvx-card ${i || ""}`, children: [
|
|
2209
2264
|
/* @__PURE__ */ c("div", { className: "pvx-card-header", children: [
|
|
2210
2265
|
/* @__PURE__ */ c("h3", { className: "pvx-card-title", children: [
|
|
2211
|
-
/* @__PURE__ */ n(
|
|
2266
|
+
/* @__PURE__ */ n(Wn, {}),
|
|
2212
2267
|
"Notifications",
|
|
2213
|
-
|
|
2268
|
+
t > 0 && /* @__PURE__ */ n("span", { className: "pvx-notif-badge", children: t > 99 ? "99+" : t })
|
|
2214
2269
|
] }),
|
|
2215
|
-
|
|
2270
|
+
t > 0 && r && /* @__PURE__ */ n("button", { className: "pvx-notif-mark-all", onClick: r, children: "Mark all read" })
|
|
2216
2271
|
] }),
|
|
2217
2272
|
e != null && e.length ? /* @__PURE__ */ n("div", { className: "pvx-notif-list", children: e.map((d) => /* @__PURE__ */ n(
|
|
2218
|
-
|
|
2273
|
+
Hn,
|
|
2219
2274
|
{
|
|
2220
2275
|
notification: d,
|
|
2221
2276
|
getUserDisplay: o,
|
|
@@ -2225,19 +2280,19 @@ function jn({ notifications: e, unreadCount: r = 0, onMarkRead: s, onMarkAllRead
|
|
|
2225
2280
|
)) }) : /* @__PURE__ */ n("div", { className: "pvx-notif-empty", children: "No notifications" })
|
|
2226
2281
|
] });
|
|
2227
2282
|
}
|
|
2228
|
-
function
|
|
2229
|
-
const
|
|
2283
|
+
function Hn({ notification: e, getUserDisplay: t, onMarkRead: s }) {
|
|
2284
|
+
const r = () => {
|
|
2230
2285
|
!e.isRead && s && s(e.id);
|
|
2231
2286
|
};
|
|
2232
2287
|
return /* @__PURE__ */ c(
|
|
2233
2288
|
"button",
|
|
2234
2289
|
{
|
|
2235
2290
|
className: `pvx-notif-item ${e.isRead ? "" : "pvx-notif-item--unread"}`,
|
|
2236
|
-
onClick:
|
|
2291
|
+
onClick: r,
|
|
2237
2292
|
children: [
|
|
2238
|
-
/* @__PURE__ */ n(
|
|
2293
|
+
/* @__PURE__ */ n(On, { type: e.type }),
|
|
2239
2294
|
/* @__PURE__ */ c("div", { className: "pvx-notif-content", children: [
|
|
2240
|
-
/* @__PURE__ */ n("span", { className: "pvx-notif-message", children: je(e,
|
|
2295
|
+
/* @__PURE__ */ n("span", { className: "pvx-notif-message", children: je(e, t) }),
|
|
2241
2296
|
/* @__PURE__ */ n("span", { className: "pvx-notif-time", children: le(e.createdAt) })
|
|
2242
2297
|
] }),
|
|
2243
2298
|
!e.isRead && /* @__PURE__ */ n("span", { className: "pvx-notif-dot" })
|
|
@@ -2245,7 +2300,7 @@ function Vn({ notification: e, getUserDisplay: r, onMarkRead: s }) {
|
|
|
2245
2300
|
}
|
|
2246
2301
|
);
|
|
2247
2302
|
}
|
|
2248
|
-
function
|
|
2303
|
+
function On({ type: e }) {
|
|
2249
2304
|
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__ */ c("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2250
2305
|
/* @__PURE__ */ n("path", { d: "m3 11 18-5v12L3 13v-2z" }),
|
|
2251
2306
|
/* @__PURE__ */ n("path", { d: "M11.6 16.8a3 3 0 1 1-5.8-1.6" })
|
|
@@ -2258,78 +2313,78 @@ function Kn({ type: e }) {
|
|
|
2258
2313
|
/* @__PURE__ */ n("path", { d: "M18 2H6v7a6 6 0 0 0 12 0V2Z" })
|
|
2259
2314
|
] }) });
|
|
2260
2315
|
}
|
|
2261
|
-
function
|
|
2316
|
+
function Wn() {
|
|
2262
2317
|
return /* @__PURE__ */ c("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: [
|
|
2263
2318
|
/* @__PURE__ */ n("path", { d: "M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9" }),
|
|
2264
2319
|
/* @__PURE__ */ n("path", { d: "M10.3 21a1.94 1.94 0 0 0 3.4 0" })
|
|
2265
2320
|
] });
|
|
2266
2321
|
}
|
|
2267
|
-
function
|
|
2268
|
-
const { data: a, isLoading: i, error: o } =
|
|
2269
|
-
return i ||
|
|
2322
|
+
function gt({ steamId: e, avatarUrl: t, memberSince: s, className: r = "" }) {
|
|
2323
|
+
const { data: a, isLoading: i, error: o } = kn(e), { data: d, isLoading: u } = wn(e), { data: l, isLoading: p } = Cn(), f = Ln(), { data: g, isLoading: m } = Tn({ limit: 10 }), b = Rn(), x = Sn();
|
|
2324
|
+
return i || u ? /* @__PURE__ */ n("div", { className: "pvx-loading", children: "Loading dashboard..." }) : o ? /* @__PURE__ */ n("div", { className: "pvx-empty", children: "Failed to load dashboard data." }) : a ? /* @__PURE__ */ c("div", { className: `pvx-dash ${r}`, children: [
|
|
2270
2325
|
/* @__PURE__ */ n(
|
|
2271
|
-
|
|
2326
|
+
$n,
|
|
2272
2327
|
{
|
|
2273
2328
|
driverName: a.driverName,
|
|
2274
|
-
avatarUrl:
|
|
2329
|
+
avatarUrl: t,
|
|
2275
2330
|
memberSince: s
|
|
2276
2331
|
}
|
|
2277
2332
|
),
|
|
2278
|
-
/* @__PURE__ */ n(
|
|
2279
|
-
e && /* @__PURE__ */ n(
|
|
2333
|
+
/* @__PURE__ */ n(Bn, { stats: a, rating: d }),
|
|
2334
|
+
e && /* @__PURE__ */ n(An, { events: l, isLoading: p }),
|
|
2280
2335
|
/* @__PURE__ */ c("div", { className: `pvx-dash-row ${f ? "pvx-dash-row--2col" : ""}`, children: [
|
|
2281
|
-
/* @__PURE__ */ n(
|
|
2336
|
+
/* @__PURE__ */ n(Pn, { records: a.currentRecords }),
|
|
2282
2337
|
f && /* @__PURE__ */ n(
|
|
2283
|
-
|
|
2338
|
+
Kn,
|
|
2284
2339
|
{
|
|
2285
2340
|
notifications: g == null ? void 0 : g.notifications,
|
|
2286
2341
|
unreadCount: (g == null ? void 0 : g.unreadCount) || 0,
|
|
2287
|
-
onMarkRead: (
|
|
2342
|
+
onMarkRead: (v) => b.mutate(v),
|
|
2288
2343
|
onMarkAllRead: () => x.mutate(),
|
|
2289
|
-
isLoading:
|
|
2344
|
+
isLoading: m
|
|
2290
2345
|
}
|
|
2291
2346
|
)
|
|
2292
2347
|
] })
|
|
2293
2348
|
] }) : /* @__PURE__ */ n("div", { className: "pvx-empty", children: "No data available yet. Start driving to see your stats!" });
|
|
2294
2349
|
}
|
|
2295
2350
|
export {
|
|
2296
|
-
|
|
2351
|
+
st as CarsTable,
|
|
2297
2352
|
P as CompEmptyState,
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2353
|
+
E as CompLoadingState,
|
|
2354
|
+
dn as CompetitionCard,
|
|
2355
|
+
lt as CompetitionCards,
|
|
2356
|
+
vt as CompetitionResultsTabs,
|
|
2357
|
+
ln as CompletedBadge,
|
|
2303
2358
|
Ce as DEFAULT_COMPLETION_GRACE_DAYS,
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2359
|
+
gt as DriverDashboard,
|
|
2360
|
+
$n as DriverProfile,
|
|
2361
|
+
at as DriversTable,
|
|
2362
|
+
pt as EntryList,
|
|
2308
2363
|
Y as InfoPill,
|
|
2309
|
-
|
|
2310
|
-
|
|
2364
|
+
it as LapHistoryTable,
|
|
2365
|
+
Kn as NotificationsCard,
|
|
2311
2366
|
se as PODIUM_MEDALS,
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2367
|
+
Yn as PitVoxPartnerProvider,
|
|
2368
|
+
ot as RankingsTable,
|
|
2369
|
+
Pn as RecordsTable,
|
|
2370
|
+
ut as RegisterButton,
|
|
2371
|
+
mt as RegistrationPanel,
|
|
2372
|
+
dt as RoundResults,
|
|
2318
2373
|
Te as RoundSessionResults,
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2374
|
+
mn as StandingsTable,
|
|
2375
|
+
Bn as StatsCards,
|
|
2376
|
+
rt as TracksTable,
|
|
2377
|
+
tn as TypeBadge,
|
|
2378
|
+
An as UpcomingEvents,
|
|
2324
2379
|
_e as buildDriverIndexPath,
|
|
2325
2380
|
Fe as buildLapsPath,
|
|
2326
2381
|
Z as buildLeaderboardPath,
|
|
2327
2382
|
qe as buildRecentLapsPath,
|
|
2328
2383
|
S as fetchCdnJson,
|
|
2329
|
-
|
|
2384
|
+
ct as filterCompetitionsByStatus,
|
|
2330
2385
|
I as formatCarName,
|
|
2331
2386
|
j as formatDate,
|
|
2332
|
-
|
|
2387
|
+
Jn as formatDelta,
|
|
2333
2388
|
pe as formatFuel,
|
|
2334
2389
|
A as formatLapTime,
|
|
2335
2390
|
je as formatNotificationMessage,
|
|
@@ -2337,36 +2392,37 @@ export {
|
|
|
2337
2392
|
B as formatSectorTime,
|
|
2338
2393
|
q as formatTrackName,
|
|
2339
2394
|
de as formatTyreCompound,
|
|
2340
|
-
|
|
2395
|
+
cn as getCompetitionPodium,
|
|
2341
2396
|
Le as getCompetitionStatus,
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2397
|
+
on as getCompletionDate,
|
|
2398
|
+
an as isCompetitionComplete,
|
|
2399
|
+
nt as useCarLeaderboard,
|
|
2400
|
+
Xn as useCarMetadata,
|
|
2346
2401
|
Oe as useCompetitionAllRounds,
|
|
2347
2402
|
me as useCompetitionConfig,
|
|
2348
2403
|
he as useCompetitionEntryList,
|
|
2349
2404
|
He as useCompetitionRound,
|
|
2405
|
+
We as useCompetitionRoundLaps,
|
|
2350
2406
|
ve as useCompetitionStandings,
|
|
2351
|
-
|
|
2407
|
+
tt as useCompetitions,
|
|
2352
2408
|
Ke as useDriverLaps,
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2409
|
+
wn as useDriverRating,
|
|
2410
|
+
ht as useDriverRatings,
|
|
2411
|
+
kn as useDriverStats,
|
|
2412
|
+
Zn as useLeaderboardIndex,
|
|
2413
|
+
Sn as useMarkAllNotificationsRead,
|
|
2414
|
+
Rn as useMarkNotificationRead,
|
|
2415
|
+
Tn as useNotifications,
|
|
2416
|
+
Ln as useNotificationsEnabled,
|
|
2361
2417
|
k as usePitVox,
|
|
2362
|
-
|
|
2418
|
+
et as useRecentLaps,
|
|
2363
2419
|
xe as useRegister,
|
|
2364
2420
|
ee as useRegistrationMode,
|
|
2365
2421
|
X as useRegistrationStatus,
|
|
2366
2422
|
ne as useRegistrationUrl,
|
|
2367
2423
|
Ve as useTrackLeaderboard,
|
|
2368
|
-
|
|
2369
|
-
|
|
2424
|
+
xt as useUnreadCount,
|
|
2425
|
+
Cn as useUpcomingEvents,
|
|
2370
2426
|
ue as useUserLookup,
|
|
2371
2427
|
ge as useWithdraw
|
|
2372
2428
|
};
|