@pitvox/partner-react 0.5.8 → 0.5.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.js +370 -369
- package/dist/styles.css +3 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { jsx as e, jsxs as l, Fragment as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { useQueryClient as U, QueryClient as
|
|
4
|
-
const Y =
|
|
1
|
+
import { jsx as e, jsxs as l, Fragment as A } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as ke, useMemo as w, useContext as we, useState as M, useCallback as K, useRef as Ce, useEffect as Le } from "react";
|
|
3
|
+
import { useQueryClient as U, QueryClient as Re, QueryClientProvider as Te, useQuery as L, useMutation as H, useQueries as ne } from "@tanstack/react-query";
|
|
4
|
+
const Y = ke(null), Se = "https://cdn.pitvox.com", $e = "https://pitvox.com";
|
|
5
5
|
let z = null;
|
|
6
6
|
function Br({
|
|
7
7
|
partnerSlug: r,
|
|
8
|
-
cdnUrl: n =
|
|
9
|
-
pitvoxUrl: s =
|
|
8
|
+
cdnUrl: n = Se,
|
|
9
|
+
pitvoxUrl: s = $e,
|
|
10
10
|
getSteamId: t,
|
|
11
11
|
onRegister: i,
|
|
12
12
|
onWithdraw: a,
|
|
13
13
|
onFetchNotifications: o,
|
|
14
14
|
onMarkNotificationRead: d,
|
|
15
|
-
onMarkAllNotificationsRead:
|
|
15
|
+
onMarkAllNotificationsRead: m,
|
|
16
16
|
onFetchServerPassword: c,
|
|
17
|
-
children:
|
|
17
|
+
children: v
|
|
18
18
|
}) {
|
|
19
19
|
const f = w(() => ({
|
|
20
20
|
partnerSlug: r,
|
|
@@ -25,23 +25,23 @@ function Br({
|
|
|
25
25
|
onWithdraw: a || null,
|
|
26
26
|
onFetchNotifications: o || null,
|
|
27
27
|
onMarkNotificationRead: d || null,
|
|
28
|
-
onMarkAllNotificationsRead:
|
|
28
|
+
onMarkAllNotificationsRead: m || null,
|
|
29
29
|
onFetchServerPassword: c || null
|
|
30
|
-
}), [r, n, s, t, i, a, o, d,
|
|
30
|
+
}), [r, n, s, t, i, a, o, d, m, c]);
|
|
31
31
|
let g = !1;
|
|
32
32
|
try {
|
|
33
33
|
U(), g = !0;
|
|
34
34
|
} catch {
|
|
35
35
|
g = !1;
|
|
36
36
|
}
|
|
37
|
-
return g ? /* @__PURE__ */ e(Y.Provider, { value: f, children:
|
|
37
|
+
return g ? /* @__PURE__ */ e(Y.Provider, { value: f, children: v }) : (z || (z = new Re({
|
|
38
38
|
defaultOptions: {
|
|
39
39
|
queries: { staleTime: 6e4 }
|
|
40
40
|
}
|
|
41
|
-
})), /* @__PURE__ */ e(
|
|
41
|
+
})), /* @__PURE__ */ e(Te, { client: z, children: /* @__PURE__ */ e(Y.Provider, { value: f, children: v }) }));
|
|
42
42
|
}
|
|
43
43
|
function k() {
|
|
44
|
-
const r =
|
|
44
|
+
const r = we(Y);
|
|
45
45
|
if (!r)
|
|
46
46
|
throw new Error("usePitVox must be used within a <PitVoxPartnerProvider>");
|
|
47
47
|
return r;
|
|
@@ -62,12 +62,12 @@ function B(r) {
|
|
|
62
62
|
function D(r) {
|
|
63
63
|
return !r && r !== 0 ? "-" : (r / 1e3).toFixed(3);
|
|
64
64
|
}
|
|
65
|
-
function
|
|
65
|
+
function I(r) {
|
|
66
66
|
if (!r) return "";
|
|
67
67
|
let n = r;
|
|
68
68
|
return n.startsWith("ks_") && (n = n.slice(3)), n.split("_").map((s) => s.charAt(0).toUpperCase() + s.slice(1)).join(" ");
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function E(r, n, s) {
|
|
71
71
|
const t = r.split("_").map((o) => o.charAt(0).toUpperCase() + o.slice(1)).join(" "), i = s === "acc" || !s && (n == null ? void 0 : n.toLowerCase()) === "track config";
|
|
72
72
|
if (!n || n === "default" || i) return t;
|
|
73
73
|
const a = n.split("_").map((o) => o.charAt(0).toUpperCase() + o.slice(1)).join(" ");
|
|
@@ -85,7 +85,7 @@ function F(r) {
|
|
|
85
85
|
return "-";
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
function
|
|
88
|
+
function ae(r) {
|
|
89
89
|
if (!r) return "";
|
|
90
90
|
const n = Date.now() - new Date(r).getTime(), s = Math.floor(n / 1e3);
|
|
91
91
|
if (s < 60) return "Just now";
|
|
@@ -99,11 +99,11 @@ function oe(r) {
|
|
|
99
99
|
function Pr(r) {
|
|
100
100
|
return r == null ? "" : `${r >= 0 ? "+" : "-"}${(Math.abs(r) / 1e3).toFixed(3)}`;
|
|
101
101
|
}
|
|
102
|
-
function
|
|
103
|
-
const { type: s, title: t, trackId: i, trackLayout: a, carId: o, game: d, data:
|
|
102
|
+
function Me(r, n) {
|
|
103
|
+
const { type: s, title: t, trackId: i, trackLayout: a, carId: o, game: d, data: m } = r, c = typeof m == "string" ? JSON.parse(m) : m, v = i ? E(i, a, d) : null, f = o ? I(o) : null, g = [v, f].filter(Boolean).join(" — ");
|
|
104
104
|
return s === "RECORD_BEATEN" && g ? `${c != null && c.beatenBySteamId && n ? n(c.beatenBySteamId).displayName : "Someone"} beat your record on ${g}` : s === "RECORD_SET" && g ? `You set a new record on ${g}` : t || "New notification";
|
|
105
105
|
}
|
|
106
|
-
function
|
|
106
|
+
function ie(r) {
|
|
107
107
|
return r ? {
|
|
108
108
|
E: "Eco",
|
|
109
109
|
RD: "Road",
|
|
@@ -117,8 +117,8 @@ function ce(r) {
|
|
|
117
117
|
S: "Soft"
|
|
118
118
|
}[r] || r : "Unknown";
|
|
119
119
|
}
|
|
120
|
-
function
|
|
121
|
-
var d,
|
|
120
|
+
function Ar(r = {}) {
|
|
121
|
+
var d, m, c, v, f, g;
|
|
122
122
|
const { cdnUrl: n, partnerSlug: s } = k(), { game: t, gameVersion: i } = r, a = L({
|
|
123
123
|
queryKey: ["pitvox", "leaderboards", s, "index"],
|
|
124
124
|
queryFn: () => T(n, `leaderboards/partners/${s}/index.json`),
|
|
@@ -133,13 +133,13 @@ function Ur(r = {}) {
|
|
|
133
133
|
layout: u.layout,
|
|
134
134
|
game: u.game,
|
|
135
135
|
gameVersion: u.gameVersion,
|
|
136
|
-
displayName:
|
|
136
|
+
displayName: E(u.trackId, u.layout, u.game),
|
|
137
137
|
driverCount: u.driverCount || 0,
|
|
138
138
|
carCount: u.carCount || 0,
|
|
139
139
|
record: u.recordHolder ? {
|
|
140
140
|
visibleId: u.recordHolder.steamId || u.recordHolder.userId,
|
|
141
141
|
carId: u.recordHolder.carId,
|
|
142
|
-
carDisplayName:
|
|
142
|
+
carDisplayName: I(u.recordHolder.carId),
|
|
143
143
|
lapTimeMs: u.recordHolder.lapTimeMs,
|
|
144
144
|
timestamp: u.recordHolder.recordedAt
|
|
145
145
|
} : null,
|
|
@@ -149,24 +149,24 @@ function Ur(r = {}) {
|
|
|
149
149
|
return {
|
|
150
150
|
...a,
|
|
151
151
|
data: o,
|
|
152
|
-
partner: ((
|
|
152
|
+
partner: ((m = a.data) == null ? void 0 : m.partner) || null,
|
|
153
153
|
generatedAt: (c = a.data) == null ? void 0 : c.generatedAt,
|
|
154
|
-
totalLaps: ((
|
|
154
|
+
totalLaps: ((v = a.data) == null ? void 0 : v.totalLaps) || 0,
|
|
155
155
|
totalUsers: ((f = a.data) == null ? void 0 : f.totalUsers) || 0,
|
|
156
156
|
versions: ((g = a.data) == null ? void 0 : g.versions) || {}
|
|
157
157
|
};
|
|
158
158
|
}
|
|
159
|
-
function
|
|
160
|
-
const { cdnUrl: t, partnerSlug: i } = k(), { carId: a, game: o, gameVersion: d } = s,
|
|
161
|
-
queryKey: ["pitvox", "leaderboards", i, "track", r,
|
|
159
|
+
function Ie(r, n, s = {}) {
|
|
160
|
+
const { cdnUrl: t, partnerSlug: i } = k(), { carId: a, game: o, gameVersion: d } = s, m = n || "default", c = d ? `leaderboards/partners/${i}/v/${d}/tracks/${r}/${m}.json` : `leaderboards/partners/${i}/tracks/${r}/${m}.json`, { data: v, isLoading: f, error: g } = L({
|
|
161
|
+
queryKey: ["pitvox", "leaderboards", i, "track", r, m, d],
|
|
162
162
|
queryFn: () => T(t, c),
|
|
163
163
|
enabled: !!r,
|
|
164
164
|
staleTime: 3e4,
|
|
165
165
|
refetchInterval: 3e4
|
|
166
166
|
});
|
|
167
167
|
return { data: w(() => {
|
|
168
|
-
if (!(
|
|
169
|
-
let b =
|
|
168
|
+
if (!(v != null && v.entries)) return [];
|
|
169
|
+
let b = v.entries;
|
|
170
170
|
if (o && (b = b.filter((u) => u.game === o)), !a) {
|
|
171
171
|
const u = /* @__PURE__ */ new Map(), N = /* @__PURE__ */ new Map();
|
|
172
172
|
for (const h of b) {
|
|
@@ -179,11 +179,11 @@ function Be(r, n, s = {}) {
|
|
|
179
179
|
}).sort((h, x) => h.lapTimeMs - x.lapTimeMs);
|
|
180
180
|
}
|
|
181
181
|
return b.filter((u) => u.carId === a).sort((u, N) => u.lapTimeMs - N.lapTimeMs);
|
|
182
|
-
}, [
|
|
182
|
+
}, [v == null ? void 0 : v.entries, a, o]), isLoading: f, error: g };
|
|
183
183
|
}
|
|
184
|
-
function
|
|
184
|
+
function De(r, n, s, t, i = {}) {
|
|
185
185
|
var g, p;
|
|
186
|
-
const { cdnUrl: a, partnerSlug: o } = k(), { showInvalid: d = !1, game:
|
|
186
|
+
const { cdnUrl: a, partnerSlug: o } = k(), { showInvalid: d = !1, game: m, gameVersion: c } = i, v = L({
|
|
187
187
|
queryKey: ["pitvox", "laps", o, r],
|
|
188
188
|
queryFn: () => T(a, `laps/partners/${o}/${r}.json`),
|
|
189
189
|
enabled: !!r,
|
|
@@ -191,21 +191,21 @@ function Pe(r, n, s, t, i = {}) {
|
|
|
191
191
|
refetchInterval: 3e4
|
|
192
192
|
}), f = w(() => {
|
|
193
193
|
var b;
|
|
194
|
-
return (b =
|
|
194
|
+
return (b = v.data) != null && b.laps ? v.data.laps.filter((u) => {
|
|
195
195
|
if (u.trackId !== n) return !1;
|
|
196
196
|
if (s) {
|
|
197
197
|
if (u.trackLayout !== s) return !1;
|
|
198
198
|
} else if (u.trackLayout && u.trackLayout !== "default") return !1;
|
|
199
|
-
return !(u.carId !== t ||
|
|
199
|
+
return !(u.carId !== t || m && u.game !== m || c && u.gameVersion !== c || !d && !u.isValid);
|
|
200
200
|
}).sort((u, N) => u.lapTimeMs - N.lapTimeMs) : [];
|
|
201
|
-
}, [(g =
|
|
201
|
+
}, [(g = v.data) == null ? void 0 : g.laps, n, s, t, m, c, d]);
|
|
202
202
|
return {
|
|
203
|
-
...
|
|
203
|
+
...v,
|
|
204
204
|
data: f,
|
|
205
|
-
driverName: ((p =
|
|
205
|
+
driverName: ((p = v.data) == null ? void 0 : p.driverName) || "Driver"
|
|
206
206
|
};
|
|
207
207
|
}
|
|
208
|
-
function
|
|
208
|
+
function oe() {
|
|
209
209
|
const { cdnUrl: r } = k(), { data: n } = L({
|
|
210
210
|
queryKey: ["pitvox", "users", "index"],
|
|
211
211
|
queryFn: () => T(r, "users/index.json"),
|
|
@@ -221,7 +221,7 @@ function le() {
|
|
|
221
221
|
};
|
|
222
222
|
};
|
|
223
223
|
}
|
|
224
|
-
function
|
|
224
|
+
function Ur() {
|
|
225
225
|
const { cdnUrl: r } = k(), { data: n } = L({
|
|
226
226
|
queryKey: ["pitvox", "cars", "index"],
|
|
227
227
|
queryFn: () => T(r, "cars/index.json"),
|
|
@@ -233,10 +233,10 @@ function Ar() {
|
|
|
233
233
|
cars: (n == null ? void 0 : n.cars) || {}
|
|
234
234
|
};
|
|
235
235
|
}
|
|
236
|
-
function
|
|
237
|
-
return
|
|
236
|
+
function Er(r, n) {
|
|
237
|
+
return Ie(r, null, { carId: n });
|
|
238
238
|
}
|
|
239
|
-
function
|
|
239
|
+
function Fr() {
|
|
240
240
|
const { cdnUrl: r, partnerSlug: n } = k();
|
|
241
241
|
return L({
|
|
242
242
|
queryKey: ["pitvox", "competitions", n],
|
|
@@ -247,7 +247,7 @@ function Er() {
|
|
|
247
247
|
staleTime: 6e4
|
|
248
248
|
});
|
|
249
249
|
}
|
|
250
|
-
function
|
|
250
|
+
function Be(r) {
|
|
251
251
|
const { cdnUrl: n, partnerSlug: s } = k();
|
|
252
252
|
return L({
|
|
253
253
|
queryKey: ["pitvox", "competition", s, r, "config"],
|
|
@@ -256,7 +256,7 @@ function Ue(r) {
|
|
|
256
256
|
staleTime: 6e4
|
|
257
257
|
});
|
|
258
258
|
}
|
|
259
|
-
function
|
|
259
|
+
function Pe(r) {
|
|
260
260
|
const { cdnUrl: n, partnerSlug: s } = k();
|
|
261
261
|
return L({
|
|
262
262
|
queryKey: ["pitvox", "competition", s, r, "standings"],
|
|
@@ -265,7 +265,7 @@ function Ae(r) {
|
|
|
265
265
|
staleTime: 6e4
|
|
266
266
|
});
|
|
267
267
|
}
|
|
268
|
-
function
|
|
268
|
+
function Ae(r, n) {
|
|
269
269
|
const { cdnUrl: s, partnerSlug: t } = k();
|
|
270
270
|
return L({
|
|
271
271
|
queryKey: ["pitvox", "competition", t, r, "round", n],
|
|
@@ -287,7 +287,7 @@ function _r(r, n = []) {
|
|
|
287
287
|
staleTime: 6e4
|
|
288
288
|
});
|
|
289
289
|
}
|
|
290
|
-
function
|
|
290
|
+
function ce(r) {
|
|
291
291
|
const { cdnUrl: n, partnerSlug: s } = k();
|
|
292
292
|
return L({
|
|
293
293
|
queryKey: ["pitvox", "competition", s, r, "entrylist"],
|
|
@@ -296,23 +296,23 @@ function de(r) {
|
|
|
296
296
|
staleTime: 6e4
|
|
297
297
|
});
|
|
298
298
|
}
|
|
299
|
-
function
|
|
299
|
+
function J(r) {
|
|
300
300
|
const { cdnUrl: n, partnerSlug: s, getSteamId: t } = k(), i = t();
|
|
301
301
|
return L({
|
|
302
302
|
queryKey: ["pitvox", "registration", s, r, i],
|
|
303
303
|
queryFn: async () => {
|
|
304
|
-
var
|
|
304
|
+
var m;
|
|
305
305
|
const a = await fetch(`${n}/competitions/${s}/${r}/entrylist.json`);
|
|
306
306
|
if (!a.ok) return { isRegistered: !1, entryList: null };
|
|
307
307
|
const o = await a.json();
|
|
308
|
-
return { isRegistered: !!i && ((
|
|
308
|
+
return { isRegistered: !!i && ((m = o.drivers) == null ? void 0 : m.some((c) => c.steamId === i)), entryList: o };
|
|
309
309
|
},
|
|
310
310
|
enabled: !!r,
|
|
311
311
|
staleTime: 6e4
|
|
312
312
|
});
|
|
313
313
|
}
|
|
314
|
-
function
|
|
315
|
-
const { onRegister: n, partnerSlug: s, getSteamId: t } = k(), i = U(), a =
|
|
314
|
+
function le(r) {
|
|
315
|
+
const { onRegister: n, partnerSlug: s, getSteamId: t } = k(), i = U(), a = oe();
|
|
316
316
|
return H({
|
|
317
317
|
mutationFn: (o) => {
|
|
318
318
|
if (!n)
|
|
@@ -327,7 +327,7 @@ function pe(r) {
|
|
|
327
327
|
{ queryKey: ["pitvox", "registration", s, r] },
|
|
328
328
|
(d) => d ? { ...d, isRegistered: !0 } : { isRegistered: !0, entryList: null }
|
|
329
329
|
), o) {
|
|
330
|
-
const d = a(o),
|
|
330
|
+
const d = a(o), m = {
|
|
331
331
|
steamId: o,
|
|
332
332
|
displayName: d.displayName,
|
|
333
333
|
avatarUrl: d.avatarUrl
|
|
@@ -336,14 +336,14 @@ function pe(r) {
|
|
|
336
336
|
{ queryKey: ["pitvox", "competition", s, r, "entrylist"] },
|
|
337
337
|
(c) => {
|
|
338
338
|
var f;
|
|
339
|
-
return c ? ((f = c.drivers) == null ? void 0 : f.some((g) => g.steamId === o)) ? c : { ...c, drivers: [...c.drivers || [],
|
|
339
|
+
return c ? ((f = c.drivers) == null ? void 0 : f.some((g) => g.steamId === o)) ? c : { ...c, drivers: [...c.drivers || [], m] } : { drivers: [m] };
|
|
340
340
|
}
|
|
341
341
|
);
|
|
342
342
|
}
|
|
343
343
|
}
|
|
344
344
|
});
|
|
345
345
|
}
|
|
346
|
-
function
|
|
346
|
+
function de(r) {
|
|
347
347
|
const { onWithdraw: n, partnerSlug: s, getSteamId: t } = k(), i = U();
|
|
348
348
|
return H({
|
|
349
349
|
mutationFn: (a) => {
|
|
@@ -367,7 +367,7 @@ function ue(r) {
|
|
|
367
367
|
}
|
|
368
368
|
});
|
|
369
369
|
}
|
|
370
|
-
function
|
|
370
|
+
function Z() {
|
|
371
371
|
const { onRegister: r, onWithdraw: n } = k(), s = !!(r && n);
|
|
372
372
|
return { isPowerMode: s, isBasicMode: !s };
|
|
373
373
|
}
|
|
@@ -375,7 +375,7 @@ function X(r) {
|
|
|
375
375
|
const { pitvoxUrl: n, partnerSlug: s } = k();
|
|
376
376
|
return `${n}/p/${s}/competitions/${r}/register`;
|
|
377
377
|
}
|
|
378
|
-
const
|
|
378
|
+
const Ue = {
|
|
379
379
|
formula: "Formula",
|
|
380
380
|
gt3: "GT3",
|
|
381
381
|
gt2: "GT2",
|
|
@@ -395,38 +395,38 @@ const Ee = {
|
|
|
395
395
|
"2000s": "2000s",
|
|
396
396
|
"2010s": "2010s",
|
|
397
397
|
"2020s": "2020s"
|
|
398
|
-
},
|
|
398
|
+
}, pe = [
|
|
399
399
|
{ id: "class", tags: ["formula", "gt3", "gt2", "gt4", "cup", "prototype", "rally"] },
|
|
400
400
|
{ id: "tier", tags: ["hypercar", "supercar", "sports_car", "hot_hatch", "lightweight"] },
|
|
401
401
|
{ id: "era", tags: ["1960s", "1970s", "1980s", "1990s", "2000s", "2010s", "2020s"] }
|
|
402
402
|
];
|
|
403
|
-
function
|
|
404
|
-
for (const n of
|
|
403
|
+
function Ee(r) {
|
|
404
|
+
for (const n of pe)
|
|
405
405
|
if (n.tags.includes(r)) return n.id;
|
|
406
406
|
return "other";
|
|
407
407
|
}
|
|
408
|
-
function
|
|
408
|
+
function ue(r, n) {
|
|
409
409
|
if (n.size === 0) return !0;
|
|
410
410
|
const s = {};
|
|
411
411
|
for (const t of n) {
|
|
412
|
-
const i =
|
|
412
|
+
const i = Ee(t);
|
|
413
413
|
s[i] || (s[i] = []), s[i].push(t);
|
|
414
414
|
}
|
|
415
415
|
for (const t of Object.values(s))
|
|
416
416
|
if (!t.some((i) => r.includes(i))) return !1;
|
|
417
417
|
return !0;
|
|
418
418
|
}
|
|
419
|
-
function
|
|
420
|
-
const [s, t] =
|
|
419
|
+
function me(r, n) {
|
|
420
|
+
const [s, t] = M(/* @__PURE__ */ new Set()), i = r !== void 0, a = i ? r : s, o = K((m) => {
|
|
421
421
|
const c = new Set(a);
|
|
422
|
-
c.has(
|
|
423
|
-
}, [a, i, n]), d =
|
|
422
|
+
c.has(m) ? c.delete(m) : c.add(m), i && n ? n(c) : t(c);
|
|
423
|
+
}, [a, i, n]), d = K(() => {
|
|
424
424
|
i && n ? n(/* @__PURE__ */ new Set()) : t(/* @__PURE__ */ new Set());
|
|
425
425
|
}, [i, n]);
|
|
426
426
|
return { activeTags: a, toggle: o, clear: d };
|
|
427
427
|
}
|
|
428
428
|
function W(r) {
|
|
429
|
-
const [n, s] =
|
|
429
|
+
const [n, s] = M(r), t = K((i) => {
|
|
430
430
|
s(
|
|
431
431
|
(a) => a.key === i ? { key: i, dir: a.dir === "asc" ? "desc" : "asc" } : { key: i, dir: i.includes("timestamp") || i.includes("Date") ? "desc" : "asc" }
|
|
432
432
|
);
|
|
@@ -443,7 +443,7 @@ function O(r, n, s) {
|
|
|
443
443
|
return n.dir === "desc" ? -d : d;
|
|
444
444
|
});
|
|
445
445
|
}
|
|
446
|
-
function
|
|
446
|
+
function ve(r, n = !1) {
|
|
447
447
|
const s = n ? r == null ? void 0 : r.filter((t) => t.isValid) : r;
|
|
448
448
|
return s != null && s.length ? {
|
|
449
449
|
s1: Math.min(...s.map((t) => t.sector1Ms).filter(Boolean)),
|
|
@@ -451,7 +451,7 @@ function xe(r, n = !1) {
|
|
|
451
451
|
s3: Math.min(...s.map((t) => t.sector3Ms).filter(Boolean))
|
|
452
452
|
} : null;
|
|
453
453
|
}
|
|
454
|
-
function
|
|
454
|
+
function Fe({ active: r, dir: n }) {
|
|
455
455
|
return r ? n === "asc" ? /* @__PURE__ */ e("svg", { className: "pvx-sort-icon", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.5 15.75l7.5-7.5 7.5 7.5" }) }) : /* @__PURE__ */ e("svg", { className: "pvx-sort-icon", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19.5 8.25l-7.5 7.5-7.5-7.5" }) }) : /* @__PURE__ */ e("svg", { className: "pvx-sort-icon pvx-sort-icon--inactive", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 9l4-4 4 4M16 15l-4 4-4-4" }) });
|
|
456
456
|
}
|
|
457
457
|
function R({ label: r, sortKey: n, config: s, onSort: t, className: i = "" }) {
|
|
@@ -462,7 +462,7 @@ function R({ label: r, sortKey: n, config: s, onSort: t, className: i = "" }) {
|
|
|
462
462
|
onClick: () => t(n),
|
|
463
463
|
children: /* @__PURE__ */ l("span", { className: "pvx-th-inner", children: [
|
|
464
464
|
r,
|
|
465
|
-
/* @__PURE__ */ e(
|
|
465
|
+
/* @__PURE__ */ e(Fe, { active: s.key === n, dir: s.dir })
|
|
466
466
|
] })
|
|
467
467
|
}
|
|
468
468
|
);
|
|
@@ -477,9 +477,9 @@ function G({ userId: r, getUserDisplay: n }) {
|
|
|
477
477
|
function ee({ rank: r, podium: n = !1 }) {
|
|
478
478
|
return /* @__PURE__ */ e("span", { className: n ? r === 1 ? "pvx-rank pvx-rank--gold" : r === 2 ? "pvx-rank pvx-rank--silver" : r === 3 ? "pvx-rank pvx-rank--bronze" : "pvx-rank" : "pvx-rank", children: r });
|
|
479
479
|
}
|
|
480
|
-
function
|
|
480
|
+
function he({ availableTags: r, activeTags: n, onToggle: s, onClear: t }) {
|
|
481
481
|
if (!r || r.length < 2) return null;
|
|
482
|
-
const i =
|
|
482
|
+
const i = pe.map((a) => ({ id: a.id, tags: a.tags.filter((o) => r.includes(o)) })).filter((a) => a.tags.length > 0);
|
|
483
483
|
return /* @__PURE__ */ l("div", { className: "pvx-tag-bar", children: [
|
|
484
484
|
/* @__PURE__ */ e(
|
|
485
485
|
"button",
|
|
@@ -496,7 +496,7 @@ function ge({ availableTags: r, activeTags: n, onToggle: s, onClear: t }) {
|
|
|
496
496
|
{
|
|
497
497
|
onClick: () => s(d),
|
|
498
498
|
className: `pvx-tag ${n.has(d) ? "pvx-tag--active" : ""}`,
|
|
499
|
-
children:
|
|
499
|
+
children: Ue[d] || d
|
|
500
500
|
},
|
|
501
501
|
d
|
|
502
502
|
))
|
|
@@ -512,23 +512,23 @@ function re({ segments: r }) {
|
|
|
512
512
|
] }, n.key);
|
|
513
513
|
}) }) });
|
|
514
514
|
}
|
|
515
|
-
function
|
|
515
|
+
function _({ message: r }) {
|
|
516
516
|
return /* @__PURE__ */ l("div", { className: "pvx-empty", children: [
|
|
517
517
|
/* @__PURE__ */ e("svg", { className: "pvx-empty-icon", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M16.5 18.75h-9m9 0a3 3 0 013 3h-15a3 3 0 013-3m9 0v-4.5A3.375 3.375 0 0013.125 10.875h-2.25A3.375 3.375 0 007.5 14.25v4.5" }) }),
|
|
518
518
|
/* @__PURE__ */ e("p", { children: r })
|
|
519
519
|
] });
|
|
520
520
|
}
|
|
521
|
-
function
|
|
521
|
+
function q() {
|
|
522
522
|
return /* @__PURE__ */ e("div", { className: "pvx-loading", children: "Loading..." });
|
|
523
523
|
}
|
|
524
|
-
function
|
|
524
|
+
function _e() {
|
|
525
525
|
return /* @__PURE__ */ e("svg", { className: "pvx-icon pvx-icon--valid", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.5 12.75l6 6 9-13.5" }) });
|
|
526
526
|
}
|
|
527
|
-
function
|
|
527
|
+
function qe() {
|
|
528
528
|
return /* @__PURE__ */ e("svg", { className: "pvx-icon pvx-icon--invalid", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) });
|
|
529
529
|
}
|
|
530
530
|
function qr({ tracks: r, isLoading: n, carMetadata: s, getUserDisplay: t, onTrackSelect: i, tags: a, onTagChange: o }) {
|
|
531
|
-
const [d,
|
|
531
|
+
const [d, m] = W({ key: "record.timestamp", dir: "desc" }), { activeTags: c, toggle: v, clear: f } = me(a, o), g = w(() => {
|
|
532
532
|
var N;
|
|
533
533
|
if (!((N = s == null ? void 0 : s.tags) != null && N.length)) return [];
|
|
534
534
|
const u = /* @__PURE__ */ new Set();
|
|
@@ -544,14 +544,14 @@ function qr({ tracks: r, isLoading: n, carMetadata: s, getUserDisplay: t, onTrac
|
|
|
544
544
|
if (h.has(C.carId)) continue;
|
|
545
545
|
h.add(C.carId);
|
|
546
546
|
const $ = ((y = (x = s == null ? void 0 : s.cars) == null ? void 0 : x[C.carId]) == null ? void 0 : y.tags) || ["sports_car"];
|
|
547
|
-
|
|
547
|
+
ue($, c) && (!N || C.lapTimeMs < N.lapTimeMs) && (N = C);
|
|
548
548
|
}
|
|
549
549
|
return N ? {
|
|
550
550
|
...u,
|
|
551
551
|
record: {
|
|
552
552
|
visibleId: N.steamId || N.identifier,
|
|
553
553
|
carId: N.carId,
|
|
554
|
-
carDisplayName:
|
|
554
|
+
carDisplayName: I(N.carId),
|
|
555
555
|
lapTimeMs: N.lapTimeMs,
|
|
556
556
|
timestamp: N.recordedAt
|
|
557
557
|
}
|
|
@@ -572,18 +572,18 @@ function qr({ tracks: r, isLoading: n, carMetadata: s, getUserDisplay: t, onTrac
|
|
|
572
572
|
return (x = u.record) != null && x.timestamp ? new Date(u.record.timestamp).getTime() : 0;
|
|
573
573
|
}
|
|
574
574
|
}), [p, d]);
|
|
575
|
-
return n ? /* @__PURE__ */ e(
|
|
575
|
+
return n ? /* @__PURE__ */ e(q, {}) : r != null && r.length ? /* @__PURE__ */ l("div", { className: "pvx-card", children: [
|
|
576
576
|
/* @__PURE__ */ e("div", { className: "pvx-card-header", children: /* @__PURE__ */ e("h2", { className: "pvx-card-title", children: "Track Records" }) }),
|
|
577
|
-
/* @__PURE__ */ e(
|
|
577
|
+
/* @__PURE__ */ e(he, { availableTags: g, activeTags: c, onToggle: v, onClear: f }),
|
|
578
578
|
/* @__PURE__ */ e("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
|
|
579
579
|
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
|
|
580
|
-
/* @__PURE__ */ e(R, { label: "Track", sortKey: "displayName", config: d, onSort:
|
|
580
|
+
/* @__PURE__ */ e(R, { label: "Track", sortKey: "displayName", config: d, onSort: m }),
|
|
581
581
|
/* @__PURE__ */ e("th", { className: "pvx-th", children: "Record Holder" }),
|
|
582
582
|
/* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-lg", children: "Car" }),
|
|
583
|
-
/* @__PURE__ */ e(R, { label: "Lap Time", sortKey: "record.lapTimeMs", config: d, onSort:
|
|
584
|
-
/* @__PURE__ */ e(R, { label: "Drivers", sortKey: "driverCount", config: d, onSort:
|
|
585
|
-
/* @__PURE__ */ e(R, { label: "Cars", sortKey: "carCount", config: d, onSort:
|
|
586
|
-
/* @__PURE__ */ e(R, { label: "Date", sortKey: "record.timestamp", config: d, onSort:
|
|
583
|
+
/* @__PURE__ */ e(R, { label: "Lap Time", sortKey: "record.lapTimeMs", config: d, onSort: m }),
|
|
584
|
+
/* @__PURE__ */ e(R, { label: "Drivers", sortKey: "driverCount", config: d, onSort: m, className: "pvx-hidden-below-md" }),
|
|
585
|
+
/* @__PURE__ */ e(R, { label: "Cars", sortKey: "carCount", config: d, onSort: m, className: "pvx-hidden-below-lg" }),
|
|
586
|
+
/* @__PURE__ */ e(R, { label: "Date", sortKey: "record.timestamp", config: d, onSort: m, className: "pvx-hidden-below-xl" })
|
|
587
587
|
] }) }),
|
|
588
588
|
/* @__PURE__ */ e("tbody", { className: "pvx-tbody", children: b.map((u) => {
|
|
589
589
|
var N, h, x;
|
|
@@ -606,24 +606,24 @@ function qr({ tracks: r, isLoading: n, carMetadata: s, getUserDisplay: t, onTrac
|
|
|
606
606
|
);
|
|
607
607
|
}) })
|
|
608
608
|
] }) })
|
|
609
|
-
] }) : /* @__PURE__ */ e(
|
|
609
|
+
] }) : /* @__PURE__ */ e(_, { message: "No lap times recorded yet." });
|
|
610
610
|
}
|
|
611
|
-
function jr({ entries: r, isLoading: n, track: s, carMetadata: t, getUserDisplay: i, onCarSelect: a, onNavigate: o, tags: d, onTagChange:
|
|
612
|
-
const [c,
|
|
611
|
+
function jr({ entries: r, isLoading: n, track: s, carMetadata: t, getUserDisplay: i, onCarSelect: a, onNavigate: o, tags: d, onTagChange: m }) {
|
|
612
|
+
const [c, v] = W({ key: "lapTimeMs", dir: "asc" }), { activeTags: f, toggle: g, clear: p } = me(d, m), b = w(() => {
|
|
613
613
|
var y, C, $;
|
|
614
614
|
if (!r || !((y = t == null ? void 0 : t.tags) != null && y.length)) return [];
|
|
615
615
|
const x = /* @__PURE__ */ new Set();
|
|
616
616
|
for (const S of r)
|
|
617
|
-
((($ = (C = t.cars) == null ? void 0 : C[S.carId]) == null ? void 0 : $.tags) || ["sports_car"]).forEach((
|
|
617
|
+
((($ = (C = t.cars) == null ? void 0 : C[S.carId]) == null ? void 0 : $.tags) || ["sports_car"]).forEach((ye) => x.add(ye));
|
|
618
618
|
return t.tags.filter((S) => x.has(S));
|
|
619
619
|
}, [r, t]), u = w(() => r ? f.size === 0 ? r : r.filter((x) => {
|
|
620
620
|
var C, $;
|
|
621
621
|
const y = (($ = (C = t == null ? void 0 : t.cars) == null ? void 0 : C[x.carId]) == null ? void 0 : $.tags) || ["sports_car"];
|
|
622
|
-
return
|
|
622
|
+
return ue(y, f);
|
|
623
623
|
}) : [], [r, f, t]), N = w(() => O(u, c, (x, y) => {
|
|
624
624
|
switch (y) {
|
|
625
625
|
case "carId":
|
|
626
|
-
return
|
|
626
|
+
return I(x.carId);
|
|
627
627
|
case "driverCount":
|
|
628
628
|
return x.driverCount || 0;
|
|
629
629
|
case "lapTimeMs":
|
|
@@ -634,16 +634,16 @@ function jr({ entries: r, isLoading: n, track: s, carMetadata: t, getUserDisplay
|
|
|
634
634
|
{ key: "tracks", label: "Tracks", onClick: () => o("tracks") },
|
|
635
635
|
{ key: "track", label: s.displayName }
|
|
636
636
|
];
|
|
637
|
-
return n ? /* @__PURE__ */ e(
|
|
637
|
+
return n ? /* @__PURE__ */ e(q, {}) : /* @__PURE__ */ l("div", { className: "pvx-card", children: [
|
|
638
638
|
/* @__PURE__ */ e("div", { className: "pvx-card-header", children: /* @__PURE__ */ e(re, { segments: h }) }),
|
|
639
|
-
/* @__PURE__ */ e(
|
|
639
|
+
/* @__PURE__ */ e(he, { availableTags: b, activeTags: f, onToggle: g, onClear: p }),
|
|
640
640
|
r != null && r.length ? /* @__PURE__ */ e("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
|
|
641
641
|
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
|
|
642
642
|
/* @__PURE__ */ e("th", { className: "pvx-th pvx-th--narrow", children: "#" }),
|
|
643
|
-
/* @__PURE__ */ e(R, { label: "Car", sortKey: "carId", config: c, onSort:
|
|
643
|
+
/* @__PURE__ */ e(R, { label: "Car", sortKey: "carId", config: c, onSort: v }),
|
|
644
644
|
/* @__PURE__ */ e("th", { className: "pvx-th", children: "Record Holder" }),
|
|
645
|
-
/* @__PURE__ */ e(R, { label: "Lap Time", sortKey: "lapTimeMs", config: c, onSort:
|
|
646
|
-
/* @__PURE__ */ e(R, { label: "Drivers", sortKey: "driverCount", config: c, onSort:
|
|
645
|
+
/* @__PURE__ */ e(R, { label: "Lap Time", sortKey: "lapTimeMs", config: c, onSort: v }),
|
|
646
|
+
/* @__PURE__ */ e(R, { label: "Drivers", sortKey: "driverCount", config: c, onSort: v, className: "pvx-hidden-below-md" }),
|
|
647
647
|
/* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-lg", children: "Date" })
|
|
648
648
|
] }) }),
|
|
649
649
|
/* @__PURE__ */ e("tbody", { className: "pvx-tbody", children: N.map((x, y) => /* @__PURE__ */ l(
|
|
@@ -653,7 +653,7 @@ function jr({ entries: r, isLoading: n, track: s, carMetadata: t, getUserDisplay
|
|
|
653
653
|
onClick: () => a(x.carId),
|
|
654
654
|
children: [
|
|
655
655
|
/* @__PURE__ */ e("td", { className: "pvx-td", children: /* @__PURE__ */ e(ee, { rank: y + 1, podium: !0 }) }),
|
|
656
|
-
/* @__PURE__ */ e("td", { className: "pvx-td pvx-td--primary", children:
|
|
656
|
+
/* @__PURE__ */ e("td", { className: "pvx-td pvx-td--primary", children: I(x.carId) }),
|
|
657
657
|
/* @__PURE__ */ e("td", { className: "pvx-td", children: /* @__PURE__ */ e(G, { userId: x.steamId || x.userId, getUserDisplay: i }) }),
|
|
658
658
|
/* @__PURE__ */ e("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: B(x.lapTimeMs) }),
|
|
659
659
|
/* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-md", children: x.driverCount || "-" }),
|
|
@@ -662,11 +662,11 @@ function jr({ entries: r, isLoading: n, track: s, carMetadata: t, getUserDisplay
|
|
|
662
662
|
},
|
|
663
663
|
x.carId
|
|
664
664
|
)) })
|
|
665
|
-
] }) }) : /* @__PURE__ */ e(
|
|
665
|
+
] }) }) : /* @__PURE__ */ e(_, { message: "No lap times for this track yet." })
|
|
666
666
|
] });
|
|
667
667
|
}
|
|
668
668
|
function Vr({ entries: r, isLoading: n, track: s, carId: t, getUserDisplay: i, onDriverSelect: a, onNavigate: o, highlightId: d }) {
|
|
669
|
-
const [
|
|
669
|
+
const [m, c] = W({ key: "lapTimeMs", dir: "asc" }), v = w(() => ve(r), [r]), f = w(() => O(r || [], m, (p, b) => {
|
|
670
670
|
switch (b) {
|
|
671
671
|
case "userId":
|
|
672
672
|
return i(p.steamId || p.userId).displayName;
|
|
@@ -676,28 +676,28 @@ function Vr({ entries: r, isLoading: n, track: s, carId: t, getUserDisplay: i, o
|
|
|
676
676
|
default:
|
|
677
677
|
return p.lapTimeMs;
|
|
678
678
|
}
|
|
679
|
-
}), [r,
|
|
679
|
+
}), [r, m, i]), g = [
|
|
680
680
|
{ key: "tracks", label: "Tracks", onClick: () => o("tracks") },
|
|
681
681
|
{ key: "track", label: s.displayName, onClick: () => o("track") },
|
|
682
|
-
{ key: "car", label:
|
|
682
|
+
{ key: "car", label: I(t) }
|
|
683
683
|
];
|
|
684
|
-
return n ? /* @__PURE__ */ e(
|
|
684
|
+
return n ? /* @__PURE__ */ e(q, {}) : /* @__PURE__ */ l("div", { className: "pvx-card", children: [
|
|
685
685
|
/* @__PURE__ */ e("div", { className: "pvx-card-header", children: /* @__PURE__ */ e(re, { segments: g }) }),
|
|
686
686
|
r != null && r.length ? /* @__PURE__ */ e("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
|
|
687
687
|
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
|
|
688
688
|
/* @__PURE__ */ e("th", { className: "pvx-th pvx-th--narrow", children: "#" }),
|
|
689
|
-
/* @__PURE__ */ e(R, { label: "Driver", sortKey: "userId", config:
|
|
690
|
-
/* @__PURE__ */ e(R, { label: "Lap Time", sortKey: "lapTimeMs", config:
|
|
689
|
+
/* @__PURE__ */ e(R, { label: "Driver", sortKey: "userId", config: m, onSort: c }),
|
|
690
|
+
/* @__PURE__ */ e(R, { label: "Lap Time", sortKey: "lapTimeMs", config: m, onSort: c }),
|
|
691
691
|
/* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-sm", children: "S1" }),
|
|
692
692
|
/* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-sm", children: "S2" }),
|
|
693
693
|
/* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-sm", children: "S3" }),
|
|
694
694
|
/* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-lg", children: "Tyre" }),
|
|
695
695
|
/* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-xl", children: "Fuel" }),
|
|
696
|
-
/* @__PURE__ */ e(R, { label: "Laps", sortKey: "lapCount", config:
|
|
696
|
+
/* @__PURE__ */ e(R, { label: "Laps", sortKey: "lapCount", config: m, onSort: c, className: "pvx-hidden-below-lg" }),
|
|
697
697
|
/* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-xl", children: "Date" })
|
|
698
698
|
] }) }),
|
|
699
699
|
/* @__PURE__ */ e("tbody", { className: "pvx-tbody", children: f.map((p, b) => {
|
|
700
|
-
const u = b + 1, N = p.steamId || p.userId, h =
|
|
700
|
+
const u = b + 1, N = p.steamId || p.userId, h = v && p.sector1Ms === v.s1, x = v && p.sector2Ms === v.s2, y = v && p.sector3Ms === v.s3;
|
|
701
701
|
return /* @__PURE__ */ l(
|
|
702
702
|
"tr",
|
|
703
703
|
{
|
|
@@ -710,7 +710,7 @@ function Vr({ entries: r, isLoading: n, track: s, carId: t, getUserDisplay: i, o
|
|
|
710
710
|
/* @__PURE__ */ e("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${h ? "pvx-td--best-sector" : ""}`, children: D(p.sector1Ms) }),
|
|
711
711
|
/* @__PURE__ */ e("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${x ? "pvx-td--best-sector" : ""}`, children: D(p.sector2Ms) }),
|
|
712
712
|
/* @__PURE__ */ e("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${y ? "pvx-td--best-sector" : ""}`, children: D(p.sector3Ms) }),
|
|
713
|
-
/* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", title:
|
|
713
|
+
/* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", title: ie(p.tyreCompound), children: p.tyreCompound || "-" }),
|
|
714
714
|
/* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-xl", children: p.startingFuelL ? `${p.startingFuelL}L` : "-" }),
|
|
715
715
|
/* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children: p.lapCount || "-" }),
|
|
716
716
|
/* @__PURE__ */ e("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: p.recordedAt ? F(p.recordedAt) : "-" })
|
|
@@ -719,20 +719,20 @@ function Vr({ entries: r, isLoading: n, track: s, carId: t, getUserDisplay: i, o
|
|
|
719
719
|
N
|
|
720
720
|
);
|
|
721
721
|
}) })
|
|
722
|
-
] }) }) : /* @__PURE__ */ e(
|
|
722
|
+
] }) }) : /* @__PURE__ */ e(_, { message: "No lap times for this car yet." })
|
|
723
723
|
] });
|
|
724
724
|
}
|
|
725
|
-
function Kr({ userId: r, track: n, carId: s, game: t, gameVersion: i, showInvalid: a, getUserDisplay: o, onToggleInvalid: d, onNavigate:
|
|
726
|
-
const { data: c, driverName:
|
|
725
|
+
function Kr({ userId: r, track: n, carId: s, game: t, gameVersion: i, showInvalid: a, getUserDisplay: o, onToggleInvalid: d, onNavigate: m }) {
|
|
726
|
+
const { data: c, driverName: v, isLoading: f } = De(r, n.id, n.layout, s, { showInvalid: a, game: t, gameVersion: i }), { displayName: g, avatarUrl: p } = o(r, v), b = w(() => ve(c, !0), [c]), u = w(() => {
|
|
727
727
|
const h = (c == null ? void 0 : c.filter((x) => x.isValid)) || [];
|
|
728
728
|
return h.length ? Math.min(...h.map((x) => x.lapTimeMs)) : null;
|
|
729
729
|
}, [c]), N = [
|
|
730
|
-
{ key: "tracks", label: "Tracks", onClick: () =>
|
|
731
|
-
{ key: "track", label: n.displayName, onClick: () =>
|
|
732
|
-
{ key: "car", label:
|
|
730
|
+
{ key: "tracks", label: "Tracks", onClick: () => m("tracks") },
|
|
731
|
+
{ key: "track", label: n.displayName, onClick: () => m("track") },
|
|
732
|
+
{ key: "car", label: I(s), onClick: () => m("car") },
|
|
733
733
|
{ key: "driver", label: g }
|
|
734
734
|
];
|
|
735
|
-
return f ? /* @__PURE__ */ e(
|
|
735
|
+
return f ? /* @__PURE__ */ e(q, {}) : /* @__PURE__ */ l("div", { className: "pvx-card", children: [
|
|
736
736
|
/* @__PURE__ */ l("div", { className: "pvx-card-header pvx-card-header--split", children: [
|
|
737
737
|
/* @__PURE__ */ l("div", { className: "pvx-card-header-left", children: [
|
|
738
738
|
/* @__PURE__ */ e(re, { segments: N }),
|
|
@@ -766,25 +766,25 @@ function Kr({ userId: r, track: n, carId: s, game: t, gameVersion: i, showInvali
|
|
|
766
766
|
] }) }),
|
|
767
767
|
/* @__PURE__ */ e("tbody", { className: "pvx-tbody", children: c.map((h, x) => {
|
|
768
768
|
const y = h.isValid && h.lapTimeMs === u, C = b && h.isValid && h.sector1Ms === b.s1, $ = b && h.isValid && h.sector2Ms === b.s2, S = b && h.isValid && h.sector3Ms === b.s3;
|
|
769
|
-
let
|
|
770
|
-
return h.isValid || (
|
|
769
|
+
let V = "pvx-row";
|
|
770
|
+
return h.isValid || (V += " pvx-row--invalid"), y && (V += " pvx-row--personal-best"), /* @__PURE__ */ l("tr", { className: V, children: [
|
|
771
771
|
/* @__PURE__ */ e("td", { className: "pvx-td", children: /* @__PURE__ */ e("span", { className: `pvx-rank ${y ? "pvx-rank--gold" : ""}`, children: x + 1 }) }),
|
|
772
772
|
/* @__PURE__ */ e("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-md", children: h.lapNumber || "-" }),
|
|
773
773
|
/* @__PURE__ */ e("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: B(h.lapTimeMs) }),
|
|
774
774
|
/* @__PURE__ */ e("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${C ? "pvx-td--best-sector" : ""}`, children: D(h.sector1Ms) }),
|
|
775
775
|
/* @__PURE__ */ e("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${$ ? "pvx-td--best-sector" : ""}`, children: D(h.sector2Ms) }),
|
|
776
776
|
/* @__PURE__ */ e("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${S ? "pvx-td--best-sector" : ""}`, children: D(h.sector3Ms) }),
|
|
777
|
-
/* @__PURE__ */ e("td", { className: "pvx-td", title: h.isValid ? void 0 : h.invalidReason || "Invalid", children: h.isValid ? /* @__PURE__ */ e(
|
|
778
|
-
/* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", title:
|
|
777
|
+
/* @__PURE__ */ e("td", { className: "pvx-td", title: h.isValid ? void 0 : h.invalidReason || "Invalid", children: h.isValid ? /* @__PURE__ */ e(_e, {}) : /* @__PURE__ */ e(qe, {}) }),
|
|
778
|
+
/* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", title: ie(h.tyreCompound), children: h.tyreCompound || "-" }),
|
|
779
779
|
/* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children: h.startingFuelL ? `${h.startingFuelL}L` : "-" }),
|
|
780
780
|
/* @__PURE__ */ e("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: F(h.timestamp) })
|
|
781
781
|
] }, h.id);
|
|
782
782
|
}) })
|
|
783
|
-
] }) }) : /* @__PURE__ */ e(
|
|
783
|
+
] }) }) : /* @__PURE__ */ e(_, { message: a ? "No laps recorded for this combination." : 'No valid laps. Try enabling "Show invalid laps".' })
|
|
784
784
|
] });
|
|
785
785
|
}
|
|
786
786
|
function Hr({ drivers: r, isLoading: n, getUserDisplay: s, game: t, gameVersion: i, onComboSelect: a }) {
|
|
787
|
-
const [o, d] = W({ key: "rank", dir: "asc" }), [
|
|
787
|
+
const [o, d] = W({ key: "rank", dir: "asc" }), [m, c] = M(null), v = w(() => r ? O(r, o, (g, p) => {
|
|
788
788
|
switch (p) {
|
|
789
789
|
case "rating":
|
|
790
790
|
return g.rating;
|
|
@@ -797,9 +797,9 @@ function Hr({ drivers: r, isLoading: n, getUserDisplay: s, game: t, gameVersion:
|
|
|
797
797
|
return g.rank;
|
|
798
798
|
}
|
|
799
799
|
}) : [], [r, o]);
|
|
800
|
-
if (n) return /* @__PURE__ */ e(
|
|
800
|
+
if (n) return /* @__PURE__ */ e(q, {});
|
|
801
801
|
if (!(r != null && r.length))
|
|
802
|
-
return /* @__PURE__ */ e("div", { className: "pvx-card", children: /* @__PURE__ */ e(
|
|
802
|
+
return /* @__PURE__ */ e("div", { className: "pvx-card", children: /* @__PURE__ */ e(_, { message: "Not enough data for rankings yet." }) });
|
|
803
803
|
const f = 5;
|
|
804
804
|
return /* @__PURE__ */ l("div", { className: "pvx-card", children: [
|
|
805
805
|
/* @__PURE__ */ l("div", { className: "pvx-card-header pvx-rankings-header", children: [
|
|
@@ -825,10 +825,10 @@ function Hr({ drivers: r, isLoading: n, getUserDisplay: s, game: t, gameVersion:
|
|
|
825
825
|
/* @__PURE__ */ e(R, { label: "Cars", sortKey: "distinctCars", config: o, onSort: d, className: "pvx-hidden-below-sm" }),
|
|
826
826
|
/* @__PURE__ */ e(R, { label: "Combos", sortKey: "comboCount", config: o, onSort: d, className: "pvx-hidden-below-sm" })
|
|
827
827
|
] }) }),
|
|
828
|
-
/* @__PURE__ */ e("tbody", { className: "pvx-tbody", children:
|
|
829
|
-
const p =
|
|
828
|
+
/* @__PURE__ */ e("tbody", { className: "pvx-tbody", children: v.map((g) => {
|
|
829
|
+
const p = m === g.identifier;
|
|
830
830
|
return /* @__PURE__ */ e(
|
|
831
|
-
|
|
831
|
+
je,
|
|
832
832
|
{
|
|
833
833
|
driver: g,
|
|
834
834
|
getUserDisplay: s,
|
|
@@ -845,9 +845,9 @@ function Hr({ drivers: r, isLoading: n, getUserDisplay: s, game: t, gameVersion:
|
|
|
845
845
|
] }) })
|
|
846
846
|
] });
|
|
847
847
|
}
|
|
848
|
-
function
|
|
849
|
-
const
|
|
850
|
-
return /* @__PURE__ */ l(
|
|
848
|
+
function je({ driver: r, getUserDisplay: n, isExpanded: s, onToggle: t, colCount: i, game: a, gameVersion: o, onComboSelect: d }) {
|
|
849
|
+
const m = r.identifier;
|
|
850
|
+
return /* @__PURE__ */ l(A, { children: [
|
|
851
851
|
/* @__PURE__ */ l(
|
|
852
852
|
"tr",
|
|
853
853
|
{
|
|
@@ -855,7 +855,7 @@ function Ke({ driver: r, getUserDisplay: n, isExpanded: s, onToggle: t, colCount
|
|
|
855
855
|
onClick: t,
|
|
856
856
|
children: [
|
|
857
857
|
/* @__PURE__ */ e("td", { className: "pvx-td", children: /* @__PURE__ */ e(ee, { rank: r.rank, podium: !0 }) }),
|
|
858
|
-
/* @__PURE__ */ e("td", { className: "pvx-td pvx-td--primary", children: /* @__PURE__ */ e(G, { userId:
|
|
858
|
+
/* @__PURE__ */ e("td", { className: "pvx-td pvx-td--primary", children: /* @__PURE__ */ e(G, { userId: m, getUserDisplay: n }) }),
|
|
859
859
|
/* @__PURE__ */ e("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: r.rating.toFixed(1) }),
|
|
860
860
|
/* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: r.distinctCars || "-" }),
|
|
861
861
|
/* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: /* @__PURE__ */ l("span", { className: "pvx-rankings-combo-count", children: [
|
|
@@ -865,8 +865,8 @@ function Ke({ driver: r, getUserDisplay: n, isExpanded: s, onToggle: t, colCount
|
|
|
865
865
|
]
|
|
866
866
|
}
|
|
867
867
|
),
|
|
868
|
-
s && r.combos && /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan: i, className: "pvx-rankings-combos-cell", children: /* @__PURE__ */ e("div", { className: "pvx-rankings-combos", children: r.combos.map((c,
|
|
869
|
-
const f = c.layout ? `${c.trackId}|${c.layout}` : c.trackId, g = d ? () => d({ track: f, car: c.carId, highlight:
|
|
868
|
+
s && r.combos && /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan: i, className: "pvx-rankings-combos-cell", children: /* @__PURE__ */ e("div", { className: "pvx-rankings-combos", children: r.combos.map((c, v) => {
|
|
869
|
+
const f = c.layout ? `${c.trackId}|${c.layout}` : c.trackId, g = d ? () => d({ track: f, car: c.carId, highlight: m, game: a, gameVersion: o }) : void 0;
|
|
870
870
|
return /* @__PURE__ */ l(
|
|
871
871
|
"div",
|
|
872
872
|
{
|
|
@@ -875,8 +875,8 @@ function Ke({ driver: r, getUserDisplay: n, isExpanded: s, onToggle: t, colCount
|
|
|
875
875
|
role: g ? "button" : void 0,
|
|
876
876
|
children: [
|
|
877
877
|
/* @__PURE__ */ l("div", { className: "pvx-rankings-combo-info", children: [
|
|
878
|
-
/* @__PURE__ */ e("p", { className: "pvx-rankings-combo-track", children:
|
|
879
|
-
/* @__PURE__ */ e("p", { className: "pvx-rankings-combo-car", children:
|
|
878
|
+
/* @__PURE__ */ e("p", { className: "pvx-rankings-combo-track", children: E(c.trackId, c.layout, a) }),
|
|
879
|
+
/* @__PURE__ */ e("p", { className: "pvx-rankings-combo-car", children: I(c.carId) })
|
|
880
880
|
] }),
|
|
881
881
|
/* @__PURE__ */ l("div", { className: "pvx-rankings-combo-stats", children: [
|
|
882
882
|
/* @__PURE__ */ e("p", { className: "pvx-rankings-combo-time", children: B(c.lapTimeMs) }),
|
|
@@ -894,12 +894,12 @@ function Ke({ driver: r, getUserDisplay: n, isExpanded: s, onToggle: t, colCount
|
|
|
894
894
|
] })
|
|
895
895
|
]
|
|
896
896
|
},
|
|
897
|
-
|
|
897
|
+
v
|
|
898
898
|
);
|
|
899
899
|
}) }) }) })
|
|
900
900
|
] });
|
|
901
901
|
}
|
|
902
|
-
const
|
|
902
|
+
const Ve = {
|
|
903
903
|
GBR: "🇬🇧",
|
|
904
904
|
DEU: "🇩🇪",
|
|
905
905
|
NLD: "🇳🇱",
|
|
@@ -930,19 +930,19 @@ const He = {
|
|
|
930
930
|
RUS: "🇷🇺",
|
|
931
931
|
TUR: "🇹🇷",
|
|
932
932
|
KOR: "🇰🇷"
|
|
933
|
-
},
|
|
933
|
+
}, Ke = ["🥇", "🥈", "🥉"], He = {
|
|
934
934
|
championship: "Championship",
|
|
935
935
|
series: "Series",
|
|
936
936
|
event: "Event"
|
|
937
937
|
}, te = ["PRACTICE", "QUALIFYING", "RACE"];
|
|
938
|
-
function
|
|
938
|
+
function xe({ position: r }) {
|
|
939
939
|
return /* @__PURE__ */ e("span", { className: r === 1 ? "pvx-rank pvx-rank--gold" : r === 2 ? "pvx-rank pvx-rank--silver" : r === 3 ? "pvx-rank pvx-rank--bronze" : "pvx-rank", children: r });
|
|
940
940
|
}
|
|
941
|
-
function
|
|
942
|
-
const n = r &&
|
|
941
|
+
function ge({ nation: r }) {
|
|
942
|
+
const n = r && Ve[r];
|
|
943
943
|
return n ? /* @__PURE__ */ e("span", { className: "pvx-nation-flag", title: r, children: n }) : null;
|
|
944
944
|
}
|
|
945
|
-
function
|
|
945
|
+
function We({ sessions: r, activeSession: n, onSelect: s }) {
|
|
946
946
|
if (!r || r.length <= 1) return null;
|
|
947
947
|
const t = [...r].sort(
|
|
948
948
|
(i, a) => te.indexOf(i.type) - te.indexOf(a.type)
|
|
@@ -957,20 +957,20 @@ function Ge({ sessions: r, activeSession: n, onSelect: s }) {
|
|
|
957
957
|
i.type
|
|
958
958
|
)) });
|
|
959
959
|
}
|
|
960
|
-
function
|
|
961
|
-
return /* @__PURE__ */ e("span", { className: `pvx-comp-badge pvx-comp-badge--${r}`, children:
|
|
960
|
+
function Oe({ type: r }) {
|
|
961
|
+
return /* @__PURE__ */ e("span", { className: `pvx-comp-badge pvx-comp-badge--${r}`, children: He[r] || r });
|
|
962
962
|
}
|
|
963
963
|
function Q({ children: r, variant: n = "default" }) {
|
|
964
964
|
return /* @__PURE__ */ e("span", { className: `pvx-info-pill ${n !== "default" ? `pvx-info-pill--${n}` : ""}`, children: r });
|
|
965
965
|
}
|
|
966
|
-
function
|
|
966
|
+
function Ge(r) {
|
|
967
967
|
if (!r) return "TBD";
|
|
968
968
|
const n = new Date(r);
|
|
969
969
|
if (isNaN(n)) return "TBD";
|
|
970
970
|
const s = n.toLocaleDateString("en-GB", { weekday: "short", day: "numeric", month: "short" }), t = n.toLocaleTimeString("en-GB", { hour: "2-digit", minute: "2-digit" });
|
|
971
971
|
return `${s} • ${t}`;
|
|
972
972
|
}
|
|
973
|
-
function
|
|
973
|
+
function ze(r) {
|
|
974
974
|
return r.reduce((n, s) => {
|
|
975
975
|
var t;
|
|
976
976
|
return (t = s.splits) != null && t.length ? n ? n.map((i, a) => {
|
|
@@ -979,18 +979,18 @@ function Ye(r) {
|
|
|
979
979
|
}) : [...s.splits] : n;
|
|
980
980
|
}, null);
|
|
981
981
|
}
|
|
982
|
-
function
|
|
982
|
+
function j({ message: r = "Loading..." }) {
|
|
983
983
|
return /* @__PURE__ */ e("div", { className: "pvx-loading", children: r });
|
|
984
984
|
}
|
|
985
985
|
function P({ message: r = "No data available." }) {
|
|
986
986
|
return /* @__PURE__ */ e("div", { className: "pvx-empty", children: /* @__PURE__ */ e("p", { children: r }) });
|
|
987
987
|
}
|
|
988
988
|
function Wr({ competitions: r, isLoading: n, onSelect: s, onRegister: t, className: i }) {
|
|
989
|
-
return n ? /* @__PURE__ */ e(
|
|
989
|
+
return n ? /* @__PURE__ */ e(j, { message: "Loading competitions..." }) : r != null && r.length ? /* @__PURE__ */ e("div", { className: `pvx-comp-grid ${i || ""}`, children: r.map((a) => /* @__PURE__ */ e(Qe, { comp: a, onSelect: s, onRegister: t || s }, a.id)) }) : /* @__PURE__ */ e(P, { message: "No competitions available." });
|
|
990
990
|
}
|
|
991
|
-
function
|
|
991
|
+
function Qe({ comp: r, onSelect: n, onRegister: s }) {
|
|
992
992
|
var u, N, h;
|
|
993
|
-
const { cdnUrl: t } = k(), i = r.posterCdnPath ? `${t}/${r.posterCdnPath}` : null, a = r.registration, o = (a == null ? void 0 : a.currentCount) || 0, d = a == null ? void 0 : a.maxParticipants,
|
|
993
|
+
const { cdnUrl: t } = k(), i = r.posterCdnPath ? `${t}/${r.posterCdnPath}` : null, a = r.registration, o = (a == null ? void 0 : a.currentCount) || 0, d = a == null ? void 0 : a.maxParticipants, m = d && o >= d, c = (a == null ? void 0 : a.deadline) && new Date(a.deadline) < /* @__PURE__ */ new Date(), v = (a == null ? void 0 : a.isOpen) && !c && !m, f = /* @__PURE__ */ new Date(), g = (u = r.rounds) == null ? void 0 : u.find((x) => x.startTime && new Date(x.startTime) >= f), p = ((N = r.rounds) == null ? void 0 : N.length) || 0, b = ((h = r.rounds) == null ? void 0 : h.filter((x) => x.isFinalized).length) || 0;
|
|
994
994
|
return /* @__PURE__ */ l(
|
|
995
995
|
"div",
|
|
996
996
|
{
|
|
@@ -1002,12 +1002,12 @@ function Ze({ comp: r, onSelect: n, onRegister: s }) {
|
|
|
1002
1002
|
(x.key === "Enter" || x.key === " ") && (x.preventDefault(), n(r.id));
|
|
1003
1003
|
},
|
|
1004
1004
|
children: [
|
|
1005
|
-
/* @__PURE__ */ e("div", { className: "pvx-comp-card-poster", children: i ? /* @__PURE__ */ e("img", { src: i, alt: r.name, className: "pvx-comp-card-poster-img" }) : /* @__PURE__ */ e("div", { className: "pvx-comp-card-poster-placeholder", children: /* @__PURE__ */ e(
|
|
1005
|
+
/* @__PURE__ */ e("div", { className: "pvx-comp-card-poster", children: i ? /* @__PURE__ */ e("img", { src: i, alt: r.name, className: "pvx-comp-card-poster-img" }) : /* @__PURE__ */ e("div", { className: "pvx-comp-card-poster-placeholder", children: /* @__PURE__ */ e(Je, {}) }) }),
|
|
1006
1006
|
/* @__PURE__ */ l("div", { className: "pvx-comp-card-body", children: [
|
|
1007
1007
|
/* @__PURE__ */ e("h3", { className: "pvx-comp-card-title", children: r.name }),
|
|
1008
1008
|
r.description && /* @__PURE__ */ e("p", { className: "pvx-comp-card-desc", children: r.description }),
|
|
1009
1009
|
/* @__PURE__ */ l("div", { className: "pvx-comp-card-pills", children: [
|
|
1010
|
-
/* @__PURE__ */ e(
|
|
1010
|
+
/* @__PURE__ */ e(Oe, { type: r.type }),
|
|
1011
1011
|
r.game && /* @__PURE__ */ e(Q, { children: r.game.toUpperCase() }),
|
|
1012
1012
|
r.formatDescription && r.formatDescription.split(", ").map((x, y) => /* @__PURE__ */ e(Q, { variant: "format", children: x }, y))
|
|
1013
1013
|
] }),
|
|
@@ -1021,7 +1021,7 @@ function Ze({ comp: r, onSelect: n, onRegister: s }) {
|
|
|
1021
1021
|
" ",
|
|
1022
1022
|
g.track || "TBD",
|
|
1023
1023
|
" — ",
|
|
1024
|
-
|
|
1024
|
+
Ge(g.startTime)
|
|
1025
1025
|
] }) : p > 0 ? /* @__PURE__ */ l("span", { className: "pvx-comp-card-schedule-next", children: [
|
|
1026
1026
|
b,
|
|
1027
1027
|
"/",
|
|
@@ -1035,11 +1035,11 @@ function Ze({ comp: r, onSelect: n, onRegister: s }) {
|
|
|
1035
1035
|
] })
|
|
1036
1036
|
] }),
|
|
1037
1037
|
a && /* @__PURE__ */ e(
|
|
1038
|
-
|
|
1038
|
+
Ye,
|
|
1039
1039
|
{
|
|
1040
1040
|
competitionId: r.id,
|
|
1041
|
-
regOpen:
|
|
1042
|
-
isFull:
|
|
1041
|
+
regOpen: v,
|
|
1042
|
+
isFull: m,
|
|
1043
1043
|
deadlinePassed: c,
|
|
1044
1044
|
regCount: o,
|
|
1045
1045
|
regMax: d,
|
|
@@ -1051,8 +1051,8 @@ function Ze({ comp: r, onSelect: n, onRegister: s }) {
|
|
|
1051
1051
|
}
|
|
1052
1052
|
);
|
|
1053
1053
|
}
|
|
1054
|
-
function
|
|
1055
|
-
const { isPowerMode: d } =
|
|
1054
|
+
function Ye({ competitionId: r, regOpen: n, isFull: s, deadlinePassed: t, regCount: i, regMax: a, onRegister: o }) {
|
|
1055
|
+
const { isPowerMode: d } = Z(), m = X(r), { data: c } = J(r), v = (c == null ? void 0 : c.isRegistered) || !1, f = a ? i / a * 100 : 0, g = f >= 100 ? "full" : f >= 75 ? "warning" : "ok";
|
|
1056
1056
|
return /* @__PURE__ */ l("div", { className: "pvx-comp-card-reg", children: [
|
|
1057
1057
|
/* @__PURE__ */ e("div", { className: "pvx-comp-card-reg-info", children: /* @__PURE__ */ l("span", { className: `pvx-reg-capacity pvx-reg-capacity--${g}`, children: [
|
|
1058
1058
|
i,
|
|
@@ -1060,7 +1060,7 @@ function Je({ competitionId: r, regOpen: n, isFull: s, deadlinePassed: t, regCou
|
|
|
1060
1060
|
a || "∞",
|
|
1061
1061
|
" drivers"
|
|
1062
1062
|
] }) }),
|
|
1063
|
-
/* @__PURE__ */ e("div", { className: "pvx-comp-card-reg-action", children:
|
|
1063
|
+
/* @__PURE__ */ e("div", { className: "pvx-comp-card-reg-action", children: v ? /* @__PURE__ */ e(
|
|
1064
1064
|
"button",
|
|
1065
1065
|
{
|
|
1066
1066
|
className: "pvx-comp-card-reg-btn pvx-comp-card-reg-btn--registered",
|
|
@@ -1081,7 +1081,7 @@ function Je({ competitionId: r, regOpen: n, isFull: s, deadlinePassed: t, regCou
|
|
|
1081
1081
|
) : /* @__PURE__ */ e(
|
|
1082
1082
|
"a",
|
|
1083
1083
|
{
|
|
1084
|
-
href:
|
|
1084
|
+
href: m,
|
|
1085
1085
|
target: "_blank",
|
|
1086
1086
|
rel: "noopener noreferrer",
|
|
1087
1087
|
className: "pvx-comp-card-reg-btn pvx-comp-card-reg-btn--open",
|
|
@@ -1091,7 +1091,7 @@ function Je({ competitionId: r, regOpen: n, isFull: s, deadlinePassed: t, regCou
|
|
|
1091
1091
|
) : /* @__PURE__ */ e("span", { className: "pvx-comp-card-reg-btn pvx-comp-card-reg-btn--closed", children: s ? "Full" : "Closed" }) })
|
|
1092
1092
|
] });
|
|
1093
1093
|
}
|
|
1094
|
-
function
|
|
1094
|
+
function Je() {
|
|
1095
1095
|
return /* @__PURE__ */ l("svg", { className: "pvx-comp-trophy-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1096
1096
|
/* @__PURE__ */ e("path", { d: "M6 9H4.5a2.5 2.5 0 0 1 0-5H6" }),
|
|
1097
1097
|
/* @__PURE__ */ e("path", { d: "M18 9h1.5a2.5 2.5 0 0 0 0-5H18" }),
|
|
@@ -1102,13 +1102,13 @@ function Xe() {
|
|
|
1102
1102
|
] });
|
|
1103
1103
|
}
|
|
1104
1104
|
function Or({ competitionId: r, className: n }) {
|
|
1105
|
-
var d,
|
|
1106
|
-
const { data: s, isLoading: t } =
|
|
1105
|
+
var d, m;
|
|
1106
|
+
const { data: s, isLoading: t } = Pe(r), { data: i, isLoading: a } = Be(r);
|
|
1107
1107
|
if (t || a)
|
|
1108
|
-
return /* @__PURE__ */ e(
|
|
1108
|
+
return /* @__PURE__ */ e(j, { message: "Loading standings..." });
|
|
1109
1109
|
if (!((d = s == null ? void 0 : s.standings) != null && d.length))
|
|
1110
1110
|
return /* @__PURE__ */ e(P, { message: "No standings data yet. Results will appear once rounds are finalised." });
|
|
1111
|
-
const o = ((
|
|
1111
|
+
const o = ((m = i == null ? void 0 : i.rounds) == null ? void 0 : m.filter((c) => c.isFinalized)) || [];
|
|
1112
1112
|
return /* @__PURE__ */ l("div", { className: `pvx-card ${n || ""}`, children: [
|
|
1113
1113
|
/* @__PURE__ */ e("div", { className: "pvx-card-header--split", children: /* @__PURE__ */ l("div", { className: "pvx-card-header-left", children: [
|
|
1114
1114
|
/* @__PURE__ */ e("h3", { className: "pvx-card-title", children: "Championship Standings" }),
|
|
@@ -1141,7 +1141,7 @@ function Or({ competitionId: r, className: n }) {
|
|
|
1141
1141
|
))
|
|
1142
1142
|
] }) }),
|
|
1143
1143
|
/* @__PURE__ */ e("tbody", { className: "pvx-tbody", children: s.standings.map((c) => /* @__PURE__ */ e(
|
|
1144
|
-
|
|
1144
|
+
Ze,
|
|
1145
1145
|
{
|
|
1146
1146
|
driver: c,
|
|
1147
1147
|
finalizedRounds: o
|
|
@@ -1151,32 +1151,32 @@ function Or({ competitionId: r, className: n }) {
|
|
|
1151
1151
|
] }) })
|
|
1152
1152
|
] });
|
|
1153
1153
|
}
|
|
1154
|
-
function
|
|
1155
|
-
var o, d,
|
|
1154
|
+
function Ze({ driver: r, finalizedRounds: n }) {
|
|
1155
|
+
var o, d, m;
|
|
1156
1156
|
const s = r.position <= 3, t = new Map(
|
|
1157
1157
|
((o = r.roundResults) == null ? void 0 : o.map((c) => [c.roundNumber, c])) || []
|
|
1158
|
-
), i = ((d = r.roundResults) == null ? void 0 : d.filter((c) => c.position === 1).length) || 0, a = ((
|
|
1158
|
+
), i = ((d = r.roundResults) == null ? void 0 : d.filter((c) => c.position === 1).length) || 0, a = ((m = r.roundResults) == null ? void 0 : m.filter((c) => c.position <= 3).length) || 0;
|
|
1159
1159
|
return /* @__PURE__ */ l("tr", { className: `pvx-row ${s ? "pvx-row--podium" : ""}`, children: [
|
|
1160
|
-
/* @__PURE__ */ e("td", { className: "pvx-td", children: /* @__PURE__ */ e(
|
|
1160
|
+
/* @__PURE__ */ e("td", { className: "pvx-td", children: /* @__PURE__ */ e(xe, { position: r.position }) }),
|
|
1161
1161
|
/* @__PURE__ */ l("td", { className: "pvx-td pvx-td--primary", children: [
|
|
1162
|
-
/* @__PURE__ */ e(
|
|
1162
|
+
/* @__PURE__ */ e(ge, { nation: r.nation }),
|
|
1163
1163
|
r.driverName
|
|
1164
1164
|
] }),
|
|
1165
1165
|
/* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: i || "-" }),
|
|
1166
1166
|
/* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: a || "-" }),
|
|
1167
1167
|
/* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-standings-total", children: r.totalPoints }),
|
|
1168
1168
|
n.map((c) => {
|
|
1169
|
-
const
|
|
1169
|
+
const v = t.get(c.roundNumber), f = v == null ? void 0 : v.dropped;
|
|
1170
1170
|
return /* @__PURE__ */ e(
|
|
1171
1171
|
"td",
|
|
1172
1172
|
{
|
|
1173
|
-
className: `pvx-td pvx-td--center pvx-hidden-below-md ${!f && (
|
|
1174
|
-
children:
|
|
1173
|
+
className: `pvx-td pvx-td--center pvx-hidden-below-md ${!f && (v == null ? void 0 : v.position) <= 3 ? "pvx-standings-cell--podium" : ""}`,
|
|
1174
|
+
children: v ? /* @__PURE__ */ l("div", { className: `pvx-standings-round-cell ${f ? "pvx-standings-round-cell--dropped" : ""}`, children: [
|
|
1175
1175
|
/* @__PURE__ */ l("span", { className: "pvx-standings-round-pos", children: [
|
|
1176
1176
|
"P",
|
|
1177
|
-
|
|
1177
|
+
v.position
|
|
1178
1178
|
] }),
|
|
1179
|
-
/* @__PURE__ */ e("span", { className: "pvx-standings-round-pts", children:
|
|
1179
|
+
/* @__PURE__ */ e("span", { className: "pvx-standings-round-pts", children: v.points })
|
|
1180
1180
|
] }) : /* @__PURE__ */ e("span", { className: "pvx-td--muted", children: "-" })
|
|
1181
1181
|
},
|
|
1182
1182
|
c.roundNumber
|
|
@@ -1185,13 +1185,13 @@ function er({ driver: r, finalizedRounds: n }) {
|
|
|
1185
1185
|
] });
|
|
1186
1186
|
}
|
|
1187
1187
|
function Gr({ competitionId: r, roundNumber: n, className: s }) {
|
|
1188
|
-
var
|
|
1189
|
-
const { data: t, isLoading: i } =
|
|
1188
|
+
var m;
|
|
1189
|
+
const { data: t, isLoading: i } = Ae(r, n);
|
|
1190
1190
|
if (i)
|
|
1191
|
-
return /* @__PURE__ */ e(
|
|
1191
|
+
return /* @__PURE__ */ e(j, { message: "Loading results..." });
|
|
1192
1192
|
if (!t)
|
|
1193
1193
|
return /* @__PURE__ */ e(P, { message: "No results for this round." });
|
|
1194
|
-
const o = (t.sessions || []).find((c) => c.type === "RACE"), d = (
|
|
1194
|
+
const o = (t.sessions || []).find((c) => c.type === "RACE"), d = (m = o == null ? void 0 : o.results) == null ? void 0 : m.filter((c) => c.position <= 3).sort((c, v) => c.position - v.position);
|
|
1195
1195
|
return /* @__PURE__ */ l("div", { className: `pvx-round-results ${s || ""}`, children: [
|
|
1196
1196
|
/* @__PURE__ */ l("div", { className: "pvx-round-results-header", children: [
|
|
1197
1197
|
/* @__PURE__ */ l("div", { children: [
|
|
@@ -1207,51 +1207,51 @@ function Gr({ competitionId: r, roundNumber: n, className: s }) {
|
|
|
1207
1207
|
}) })
|
|
1208
1208
|
] }),
|
|
1209
1209
|
(d == null ? void 0 : d.length) > 0 && /* @__PURE__ */ e("div", { className: "pvx-round-podium-summary", children: d.map((c) => /* @__PURE__ */ l("span", { className: "pvx-round-podium-item", children: [
|
|
1210
|
-
/* @__PURE__ */ e("span", { children:
|
|
1210
|
+
/* @__PURE__ */ e("span", { children: Ke[c.position - 1] }),
|
|
1211
1211
|
/* @__PURE__ */ e("span", { children: c.driverName })
|
|
1212
1212
|
] }, c.driverId)) })
|
|
1213
1213
|
] }),
|
|
1214
|
-
/* @__PURE__ */ e(
|
|
1214
|
+
/* @__PURE__ */ e(Xe, { round: t })
|
|
1215
1215
|
] });
|
|
1216
1216
|
}
|
|
1217
|
-
function
|
|
1218
|
-
var d,
|
|
1219
|
-
const [s, t] =
|
|
1217
|
+
function Xe({ round: r, className: n }) {
|
|
1218
|
+
var d, m;
|
|
1219
|
+
const [s, t] = M(null), i = (r == null ? void 0 : r.sessions) || [];
|
|
1220
1220
|
if (!i.length)
|
|
1221
1221
|
return /* @__PURE__ */ e(P, { message: "No session data for this round." });
|
|
1222
|
-
const a = s || ((d = i.find((c) => c.type === "RACE")) == null ? void 0 : d.type) || ((
|
|
1222
|
+
const a = s || ((d = i.find((c) => c.type === "RACE")) == null ? void 0 : d.type) || ((m = i[0]) == null ? void 0 : m.type), o = i.find((c) => c.type === a) || i[0];
|
|
1223
1223
|
return /* @__PURE__ */ l("div", { className: n || "", children: [
|
|
1224
1224
|
/* @__PURE__ */ e(
|
|
1225
|
-
|
|
1225
|
+
We,
|
|
1226
1226
|
{
|
|
1227
1227
|
sessions: i,
|
|
1228
1228
|
activeSession: a,
|
|
1229
1229
|
onSelect: t
|
|
1230
1230
|
}
|
|
1231
1231
|
),
|
|
1232
|
-
/* @__PURE__ */ e(
|
|
1232
|
+
/* @__PURE__ */ e(er, { session: o })
|
|
1233
1233
|
] });
|
|
1234
1234
|
}
|
|
1235
|
-
function
|
|
1235
|
+
function er({ session: r }) {
|
|
1236
1236
|
var t;
|
|
1237
1237
|
const n = r.type === "RACE";
|
|
1238
1238
|
if (!((t = r.results) != null && t.length))
|
|
1239
1239
|
return /* @__PURE__ */ e(P, { message: `No results for ${r.type}.` });
|
|
1240
|
-
const s =
|
|
1240
|
+
const s = ze(r.results);
|
|
1241
1241
|
return /* @__PURE__ */ e("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
|
|
1242
1242
|
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
|
|
1243
1243
|
/* @__PURE__ */ e("th", { className: "pvx-th pvx-th--narrow", children: "Pos" }),
|
|
1244
1244
|
/* @__PURE__ */ e("th", { className: "pvx-th", children: "Driver" }),
|
|
1245
1245
|
/* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-sm", children: "Car" }),
|
|
1246
1246
|
/* @__PURE__ */ e("th", { className: "pvx-th", children: "Best Lap" }),
|
|
1247
|
-
n && /* @__PURE__ */ l(
|
|
1247
|
+
n && /* @__PURE__ */ l(A, { children: [
|
|
1248
1248
|
/* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-sm", children: "Laps" }),
|
|
1249
1249
|
/* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-sm", children: "Time / Gap" }),
|
|
1250
1250
|
/* @__PURE__ */ e("th", { className: "pvx-th pvx-th--center", children: "Points" })
|
|
1251
1251
|
] })
|
|
1252
1252
|
] }) }),
|
|
1253
1253
|
/* @__PURE__ */ e("tbody", { className: "pvx-tbody", children: r.results.map((i, a) => /* @__PURE__ */ e(
|
|
1254
|
-
|
|
1254
|
+
rr,
|
|
1255
1255
|
{
|
|
1256
1256
|
result: i,
|
|
1257
1257
|
isRace: n,
|
|
@@ -1262,12 +1262,12 @@ function nr({ session: r }) {
|
|
|
1262
1262
|
)) })
|
|
1263
1263
|
] }) });
|
|
1264
1264
|
}
|
|
1265
|
-
function
|
|
1265
|
+
function rr({ result: r, isRace: n, fastestSplits: s, rowIndex: t }) {
|
|
1266
1266
|
const i = r.position <= 3;
|
|
1267
1267
|
return /* @__PURE__ */ l("tr", { className: `pvx-row ${i ? "pvx-row--podium" : ""}`, children: [
|
|
1268
|
-
/* @__PURE__ */ e("td", { className: "pvx-td", children: /* @__PURE__ */ e(
|
|
1268
|
+
/* @__PURE__ */ e("td", { className: "pvx-td", children: /* @__PURE__ */ e(xe, { position: r.position }) }),
|
|
1269
1269
|
/* @__PURE__ */ l("td", { className: "pvx-td pvx-td--primary", children: [
|
|
1270
|
-
/* @__PURE__ */ e(
|
|
1270
|
+
/* @__PURE__ */ e(ge, { nation: r.nation }),
|
|
1271
1271
|
r.driverName,
|
|
1272
1272
|
r.carNumber != null && /* @__PURE__ */ l("span", { className: "pvx-car-number", children: [
|
|
1273
1273
|
"#",
|
|
@@ -1275,9 +1275,9 @@ function tr({ result: r, isRace: n, fastestSplits: s, rowIndex: t }) {
|
|
|
1275
1275
|
] }),
|
|
1276
1276
|
r.penalty && /* @__PURE__ */ e("span", { className: "pvx-penalty", children: r.penalty })
|
|
1277
1277
|
] }),
|
|
1278
|
-
/* @__PURE__ */ e("td", { className: "pvx-td pvx-hidden-below-sm", children:
|
|
1278
|
+
/* @__PURE__ */ e("td", { className: "pvx-td pvx-hidden-below-sm", children: I(r.carId) }),
|
|
1279
1279
|
/* @__PURE__ */ e("td", { className: "pvx-td pvx-td--mono", children: /* @__PURE__ */ e(
|
|
1280
|
-
|
|
1280
|
+
nr,
|
|
1281
1281
|
{
|
|
1282
1282
|
bestLap: r.bestLapFormatted,
|
|
1283
1283
|
hasBestLap: r.hasBestLap,
|
|
@@ -1286,7 +1286,7 @@ function tr({ result: r, isRace: n, fastestSplits: s, rowIndex: t }) {
|
|
|
1286
1286
|
showAbove: t <= 1
|
|
1287
1287
|
}
|
|
1288
1288
|
) }),
|
|
1289
|
-
n && /* @__PURE__ */ l(
|
|
1289
|
+
n && /* @__PURE__ */ l(A, { children: [
|
|
1290
1290
|
/* @__PURE__ */ e("td", { className: "pvx-td pvx-hidden-below-sm", children: r.lapsCompleted }),
|
|
1291
1291
|
/* @__PURE__ */ e("td", { className: "pvx-td pvx-td--mono pvx-td--muted pvx-hidden-below-sm", children: r.position === 1 ? r.totalTime || "-" : r.gap || "-" }),
|
|
1292
1292
|
/* @__PURE__ */ l("td", { className: "pvx-td pvx-td--center", children: [
|
|
@@ -1301,7 +1301,7 @@ function tr({ result: r, isRace: n, fastestSplits: s, rowIndex: t }) {
|
|
|
1301
1301
|
] })
|
|
1302
1302
|
] });
|
|
1303
1303
|
}
|
|
1304
|
-
function
|
|
1304
|
+
function nr({ bestLap: r, hasBestLap: n, splits: s, fastestSplits: t, showAbove: i }) {
|
|
1305
1305
|
return r ? /* @__PURE__ */ l("span", { className: `pvx-best-lap-cell ${n ? "pvx-best-lap-cell--fastest" : ""}`, children: [
|
|
1306
1306
|
/* @__PURE__ */ e("span", { className: "pvx-best-lap-time", children: r }),
|
|
1307
1307
|
(s == null ? void 0 : s.length) > 0 && /* @__PURE__ */ e("span", { className: "pvx-splits-tooltip-anchor", children: /* @__PURE__ */ e("span", { className: `pvx-splits-tooltip ${i ? "" : "pvx-splits-tooltip--above"}`, children: s.map((a, o) => {
|
|
@@ -1317,14 +1317,14 @@ function sr({ bestLap: r, hasBestLap: n, splits: s, fastestSplits: t, showAbove:
|
|
|
1317
1317
|
] }) : /* @__PURE__ */ e("span", { className: "pvx-td--muted", children: "-" });
|
|
1318
1318
|
}
|
|
1319
1319
|
function zr({ competitionId: r, className: n }) {
|
|
1320
|
-
const { getSteamId: s } = k(), { data: t, isLoading: i } =
|
|
1320
|
+
const { getSteamId: s } = k(), { data: t, isLoading: i } = ce(r), a = s();
|
|
1321
1321
|
if (i)
|
|
1322
|
-
return /* @__PURE__ */ e(
|
|
1322
|
+
return /* @__PURE__ */ e(j, { message: "Loading drivers..." });
|
|
1323
1323
|
const o = (t == null ? void 0 : t.drivers) || (t == null ? void 0 : t.entries) || [];
|
|
1324
1324
|
return o.length ? /* @__PURE__ */ e("div", { className: `pvx-entry-grid ${n || ""}`, children: o.map((d) => {
|
|
1325
|
-
var c,
|
|
1326
|
-
const
|
|
1327
|
-
return /* @__PURE__ */ l("div", { className: `pvx-entry-card ${
|
|
1325
|
+
var c, v;
|
|
1326
|
+
const m = a && d.steamId === a;
|
|
1327
|
+
return /* @__PURE__ */ l("div", { className: `pvx-entry-card ${m ? "pvx-entry-card--you" : ""}`, children: [
|
|
1328
1328
|
d.avatarUrl ? /* @__PURE__ */ e(
|
|
1329
1329
|
"img",
|
|
1330
1330
|
{
|
|
@@ -1332,10 +1332,10 @@ function zr({ competitionId: r, className: n }) {
|
|
|
1332
1332
|
alt: "",
|
|
1333
1333
|
className: "pvx-entry-avatar"
|
|
1334
1334
|
}
|
|
1335
|
-
) : /* @__PURE__ */ e("div", { className: "pvx-entry-avatar pvx-entry-avatar--placeholder", children: ((
|
|
1335
|
+
) : /* @__PURE__ */ e("div", { className: "pvx-entry-avatar pvx-entry-avatar--placeholder", children: ((v = (c = d.displayName) == null ? void 0 : c.charAt(0)) == null ? void 0 : v.toUpperCase()) || "?" }),
|
|
1336
1336
|
/* @__PURE__ */ l("span", { className: "pvx-entry-name", children: [
|
|
1337
1337
|
d.displayName,
|
|
1338
|
-
|
|
1338
|
+
m && /* @__PURE__ */ e("span", { className: "pvx-entry-you", children: " (you)" })
|
|
1339
1339
|
] })
|
|
1340
1340
|
] }, d.steamId || d.driverId);
|
|
1341
1341
|
}) }) : /* @__PURE__ */ e(P, { message: "No drivers registered yet." });
|
|
@@ -1346,18 +1346,18 @@ function Qr({
|
|
|
1346
1346
|
className: s,
|
|
1347
1347
|
children: t
|
|
1348
1348
|
}) {
|
|
1349
|
-
const { data: i, isLoading: a } =
|
|
1350
|
-
o &&
|
|
1349
|
+
const { data: i, isLoading: a } = J(r), { isPowerMode: o } = Z(), d = X(r), m = le(r), c = de(r), v = (i == null ? void 0 : i.isRegistered) || !1, f = a || m.isPending || c.isPending, g = m.error || c.error || null, p = () => {
|
|
1350
|
+
o && m.mutate(n || {});
|
|
1351
1351
|
}, b = () => {
|
|
1352
1352
|
o && c.mutate();
|
|
1353
1353
|
};
|
|
1354
|
-
return typeof t == "function" ? t({ isRegistered:
|
|
1354
|
+
return typeof t == "function" ? t({ isRegistered: v, isLoading: f, register: p, withdraw: b, error: g, isPowerMode: o, registrationUrl: d }) : o ? /* @__PURE__ */ e(
|
|
1355
1355
|
"button",
|
|
1356
1356
|
{
|
|
1357
1357
|
className: `pvx-comp-register-btn ${s || ""}`,
|
|
1358
|
-
onClick:
|
|
1358
|
+
onClick: v ? b : p,
|
|
1359
1359
|
disabled: f,
|
|
1360
|
-
children: f ? "Loading..." :
|
|
1360
|
+
children: f ? "Loading..." : v ? "Withdraw" : "Register"
|
|
1361
1361
|
}
|
|
1362
1362
|
) : /* @__PURE__ */ e(
|
|
1363
1363
|
"a",
|
|
@@ -1366,14 +1366,14 @@ function Qr({
|
|
|
1366
1366
|
target: "_blank",
|
|
1367
1367
|
rel: "noopener noreferrer",
|
|
1368
1368
|
className: `pvx-comp-register-link ${s || ""}`,
|
|
1369
|
-
children:
|
|
1369
|
+
children: v ? "View Registration" : "Register on PitVox"
|
|
1370
1370
|
}
|
|
1371
1371
|
);
|
|
1372
1372
|
}
|
|
1373
1373
|
function Yr({ competitionId: r, registration: n, onWithdrawSuccess: s, className: t }) {
|
|
1374
|
-
const { getSteamId: i } = k(), { isPowerMode: a } =
|
|
1375
|
-
return
|
|
1376
|
-
|
|
1374
|
+
const { getSteamId: i } = k(), { isPowerMode: a } = Z(), o = X(r), { data: d, isLoading: m } = J(r), { data: c, isLoading: v } = ce(r), f = le(r), g = de(r), p = i(), b = (d == null ? void 0 : d.isRegistered) || !1, u = (c == null ? void 0 : c.drivers) || (c == null ? void 0 : c.entries) || [], N = n || {}, h = u.length || N.currentCount || 0, x = N.maxParticipants && h >= N.maxParticipants, y = N.deadline && new Date(N.deadline) < /* @__PURE__ */ new Date(), C = N.isOpen && !y && !x;
|
|
1375
|
+
return m || v ? /* @__PURE__ */ e(j, { message: "Loading registration..." }) : b ? /* @__PURE__ */ e("div", { className: `pvx-reg-panel ${t || ""}`, children: /* @__PURE__ */ e(
|
|
1376
|
+
sr,
|
|
1377
1377
|
{
|
|
1378
1378
|
competitionId: r,
|
|
1379
1379
|
drivers: u,
|
|
@@ -1385,7 +1385,7 @@ function Yr({ competitionId: r, registration: n, onWithdrawSuccess: s, className
|
|
|
1385
1385
|
registration: N
|
|
1386
1386
|
}
|
|
1387
1387
|
) }) : C ? p ? a ? /* @__PURE__ */ e("div", { className: `pvx-reg-panel ${t || ""}`, children: /* @__PURE__ */ e(
|
|
1388
|
-
|
|
1388
|
+
tr,
|
|
1389
1389
|
{
|
|
1390
1390
|
competitionId: r,
|
|
1391
1391
|
registerMutation: f,
|
|
@@ -1393,21 +1393,21 @@ function Yr({ competitionId: r, registration: n, onWithdrawSuccess: s, className
|
|
|
1393
1393
|
}
|
|
1394
1394
|
) }) : /* @__PURE__ */ e("div", { className: `pvx-reg-panel ${t || ""}`, children: /* @__PURE__ */ e("a", { href: o, target: "_blank", rel: "noopener noreferrer", className: "pvx-comp-register-link", children: "Register on PitVox" }) }) : /* @__PURE__ */ e("div", { className: `pvx-reg-panel ${t || ""}`, children: a ? /* @__PURE__ */ e("div", { className: "pvx-reg-status-msg", children: "Sign in to register for this competition." }) : /* @__PURE__ */ e("div", { className: "pvx-reg-status-msg", children: /* @__PURE__ */ e("a", { href: o, target: "_blank", rel: "noopener noreferrer", className: "pvx-comp-register-link", children: "Register on PitVox" }) }) }) : /* @__PURE__ */ l("div", { className: `pvx-reg-panel ${t || ""}`, children: [
|
|
1395
1395
|
/* @__PURE__ */ e("div", { className: "pvx-reg-status-msg", children: x ? "Registration is full." : y ? "Registration deadline has passed." : "Registration is closed." }),
|
|
1396
|
-
u.length > 0 && /* @__PURE__ */ e(
|
|
1396
|
+
u.length > 0 && /* @__PURE__ */ e(fe, { drivers: u, steamId: p })
|
|
1397
1397
|
] });
|
|
1398
1398
|
}
|
|
1399
|
-
function
|
|
1400
|
-
const [t, i] =
|
|
1399
|
+
function tr({ competitionId: r, registerMutation: n, registration: s }) {
|
|
1400
|
+
const [t, i] = M(""), [a, o] = M("intermediate"), [d, m] = M(""), c = (p) => {
|
|
1401
1401
|
p.preventDefault(), n.mutate({
|
|
1402
1402
|
discordUsername: t || void 0,
|
|
1403
1403
|
experience: a,
|
|
1404
1404
|
comments: d || void 0
|
|
1405
1405
|
});
|
|
1406
|
-
},
|
|
1406
|
+
}, v = s || {}, f = v.currentCount || 0, g = v.maxParticipants;
|
|
1407
1407
|
return /* @__PURE__ */ l("form", { className: "pvx-reg-form", onSubmit: c, children: [
|
|
1408
1408
|
/* @__PURE__ */ l("div", { className: "pvx-reg-form-header", children: [
|
|
1409
1409
|
/* @__PURE__ */ e("h3", { className: "pvx-reg-form-title", children: "Register" }),
|
|
1410
|
-
g && /* @__PURE__ */ e(
|
|
1410
|
+
g && /* @__PURE__ */ e(Ne, { count: f, max: g })
|
|
1411
1411
|
] }),
|
|
1412
1412
|
n.error && /* @__PURE__ */ e("div", { className: "pvx-reg-error", children: n.error.message || "Registration failed" }),
|
|
1413
1413
|
/* @__PURE__ */ l("div", { className: "pvx-reg-field", children: [
|
|
@@ -1457,7 +1457,7 @@ function ar({ competitionId: r, registerMutation: n, registration: s }) {
|
|
|
1457
1457
|
rows: 3,
|
|
1458
1458
|
placeholder: "Anything the organisers should know?",
|
|
1459
1459
|
value: d,
|
|
1460
|
-
onChange: (p) =>
|
|
1460
|
+
onChange: (p) => m(p.target.value)
|
|
1461
1461
|
}
|
|
1462
1462
|
)
|
|
1463
1463
|
] }),
|
|
@@ -1472,22 +1472,22 @@ function ar({ competitionId: r, registerMutation: n, registration: s }) {
|
|
|
1472
1472
|
) })
|
|
1473
1473
|
] });
|
|
1474
1474
|
}
|
|
1475
|
-
function
|
|
1476
|
-
const [
|
|
1475
|
+
function sr({ competitionId: r, drivers: n, steamId: s, isPowerMode: t, registrationUrl: i, withdrawMutation: a, onWithdrawSuccess: o, registration: d }) {
|
|
1476
|
+
const [m, c] = M(!1), v = () => {
|
|
1477
1477
|
a.mutate(void 0, {
|
|
1478
1478
|
onSuccess: () => {
|
|
1479
1479
|
c(!1), o && o();
|
|
1480
1480
|
}
|
|
1481
1481
|
});
|
|
1482
1482
|
}, f = d || {}, g = n.length || f.currentCount || 0, p = f.maxParticipants;
|
|
1483
|
-
return /* @__PURE__ */ l(
|
|
1483
|
+
return /* @__PURE__ */ l(A, { children: [
|
|
1484
1484
|
/* @__PURE__ */ l("div", { className: "pvx-reg-form-header", children: [
|
|
1485
1485
|
/* @__PURE__ */ e("h3", { className: "pvx-reg-form-title", children: "Registered Drivers" }),
|
|
1486
|
-
p && /* @__PURE__ */ e(
|
|
1486
|
+
p && /* @__PURE__ */ e(Ne, { count: g, max: p })
|
|
1487
1487
|
] }),
|
|
1488
|
-
/* @__PURE__ */ e(
|
|
1488
|
+
/* @__PURE__ */ e(fe, { drivers: n, steamId: s }),
|
|
1489
1489
|
a.error && /* @__PURE__ */ e("div", { className: "pvx-reg-error", children: a.error.message || "Withdrawal failed" }),
|
|
1490
|
-
t ? /* @__PURE__ */ e("div", { className: "pvx-reg-actions", children:
|
|
1490
|
+
t ? /* @__PURE__ */ e("div", { className: "pvx-reg-actions", children: m ? /* @__PURE__ */ l("div", { className: "pvx-reg-confirm", children: [
|
|
1491
1491
|
/* @__PURE__ */ e("p", { className: "pvx-reg-confirm-text", children: "Are you sure you want to unregister?" }),
|
|
1492
1492
|
/* @__PURE__ */ l("div", { className: "pvx-reg-confirm-actions", children: [
|
|
1493
1493
|
/* @__PURE__ */ e(
|
|
@@ -1504,7 +1504,7 @@ function ir({ competitionId: r, drivers: n, steamId: s, isPowerMode: t, registra
|
|
|
1504
1504
|
{
|
|
1505
1505
|
type: "button",
|
|
1506
1506
|
className: "pvx-reg-danger-btn",
|
|
1507
|
-
onClick:
|
|
1507
|
+
onClick: v,
|
|
1508
1508
|
disabled: a.isPending,
|
|
1509
1509
|
children: a.isPending ? "Unregistering..." : "Yes, Unregister"
|
|
1510
1510
|
}
|
|
@@ -1521,7 +1521,7 @@ function ir({ competitionId: r, drivers: n, steamId: s, isPowerMode: t, registra
|
|
|
1521
1521
|
) }) : /* @__PURE__ */ e("div", { className: "pvx-reg-actions", children: /* @__PURE__ */ e("a", { href: i, target: "_blank", rel: "noopener noreferrer", className: "pvx-comp-register-link", children: "Manage on PitVox" }) })
|
|
1522
1522
|
] });
|
|
1523
1523
|
}
|
|
1524
|
-
function
|
|
1524
|
+
function fe({ drivers: r, steamId: n }) {
|
|
1525
1525
|
if (!r.length)
|
|
1526
1526
|
return /* @__PURE__ */ e("div", { className: "pvx-reg-no-drivers", children: "No drivers registered yet." });
|
|
1527
1527
|
const s = [...r].sort((t, i) => {
|
|
@@ -1547,7 +1547,7 @@ function be({ drivers: r, steamId: n }) {
|
|
|
1547
1547
|
);
|
|
1548
1548
|
}) });
|
|
1549
1549
|
}
|
|
1550
|
-
function
|
|
1550
|
+
function Ne({ count: r, max: n }) {
|
|
1551
1551
|
const s = n ? r / n * 100 : 0, t = s >= 100 ? "full" : s >= 75 ? "warning" : "ok";
|
|
1552
1552
|
return /* @__PURE__ */ l("span", { className: `pvx-reg-capacity pvx-reg-capacity--${t}`, children: [
|
|
1553
1553
|
r,
|
|
@@ -1556,7 +1556,7 @@ function ye({ count: r, max: n }) {
|
|
|
1556
1556
|
" drivers"
|
|
1557
1557
|
] });
|
|
1558
1558
|
}
|
|
1559
|
-
function
|
|
1559
|
+
function ar(r) {
|
|
1560
1560
|
const { cdnUrl: n } = k(), s = L({
|
|
1561
1561
|
queryKey: ["pitvox", "laps", "global", r],
|
|
1562
1562
|
queryFn: () => T(n, `laps/${r}.json`),
|
|
@@ -1582,7 +1582,7 @@ function or(r) {
|
|
|
1582
1582
|
} : null
|
|
1583
1583
|
};
|
|
1584
1584
|
}
|
|
1585
|
-
function
|
|
1585
|
+
function be(r = {}) {
|
|
1586
1586
|
const { cdnUrl: n, partnerSlug: s } = k(), { gameVersion: t, enabled: i = !0 } = r, a = t ? `leaderboards/partners/${s}/v/${t}/ratings.json` : `leaderboards/partners/${s}/ratings.json`;
|
|
1587
1587
|
return L({
|
|
1588
1588
|
queryKey: ["pitvox", "ratings", s, t || null],
|
|
@@ -1592,9 +1592,9 @@ function ke(r = {}) {
|
|
|
1592
1592
|
enabled: i
|
|
1593
1593
|
});
|
|
1594
1594
|
}
|
|
1595
|
-
function
|
|
1595
|
+
function ir(r) {
|
|
1596
1596
|
var t;
|
|
1597
|
-
const n =
|
|
1597
|
+
const n = be(), s = w(() => {
|
|
1598
1598
|
var i;
|
|
1599
1599
|
return !((i = n.data) != null && i.drivers) || !r ? null : n.data.drivers.find(
|
|
1600
1600
|
(a) => a.identifier === r
|
|
@@ -1613,15 +1613,15 @@ function cr(r) {
|
|
|
1613
1613
|
} : null
|
|
1614
1614
|
};
|
|
1615
1615
|
}
|
|
1616
|
-
function
|
|
1617
|
-
const n =
|
|
1616
|
+
function Jr(r = {}) {
|
|
1617
|
+
const n = be(r);
|
|
1618
1618
|
return {
|
|
1619
1619
|
data: n.data || null,
|
|
1620
1620
|
isLoading: n.isLoading,
|
|
1621
1621
|
error: n.error
|
|
1622
1622
|
};
|
|
1623
1623
|
}
|
|
1624
|
-
function
|
|
1624
|
+
function or() {
|
|
1625
1625
|
const { cdnUrl: r, partnerSlug: n, getSteamId: s, onFetchServerPassword: t } = k(), i = s(), { data: a, isLoading: o } = L({
|
|
1626
1626
|
queryKey: ["pitvox", "competitions", n],
|
|
1627
1627
|
queryFn: async () => {
|
|
@@ -1629,19 +1629,19 @@ function lr() {
|
|
|
1629
1629
|
return p != null && p.competitions ? p.competitions.filter((b) => b.partnerSlug === n) : [];
|
|
1630
1630
|
},
|
|
1631
1631
|
staleTime: 6e4
|
|
1632
|
-
}), d = (a == null ? void 0 : a.map((p) => p.id)) || [],
|
|
1632
|
+
}), d = (a == null ? void 0 : a.map((p) => p.id)) || [], m = ne({
|
|
1633
1633
|
queries: d.map((p) => ({
|
|
1634
1634
|
queryKey: ["pitvox", "competition", n, p, "entrylist"],
|
|
1635
1635
|
queryFn: () => T(r, `competitions/${n}/${p}/entrylist.json`),
|
|
1636
1636
|
enabled: !!i && d.length > 0,
|
|
1637
1637
|
staleTime: 6e4
|
|
1638
1638
|
}))
|
|
1639
|
-
}), c =
|
|
1639
|
+
}), c = m.some((p) => p.isLoading), v = w(() => {
|
|
1640
1640
|
var u, N;
|
|
1641
1641
|
if (!a || !i || c) return [];
|
|
1642
1642
|
const p = /* @__PURE__ */ new Date(), b = [];
|
|
1643
1643
|
for (let h = 0; h < a.length; h++) {
|
|
1644
|
-
const x = a[h], y = (u =
|
|
1644
|
+
const x = a[h], y = (u = m[h]) == null ? void 0 : u.data;
|
|
1645
1645
|
if (!((N = y == null ? void 0 : y.drivers) == null ? void 0 : N.some((S) => S.steamId === i))) continue;
|
|
1646
1646
|
const $ = x.rounds || [];
|
|
1647
1647
|
for (const S of $)
|
|
@@ -1654,18 +1654,18 @@ function lr() {
|
|
|
1654
1654
|
});
|
|
1655
1655
|
}
|
|
1656
1656
|
return b.sort((h, x) => new Date(h.startTime) - new Date(x.startTime)), b.length > 0 && (b[0].isNext = !0), b;
|
|
1657
|
-
}, [a, i, c,
|
|
1658
|
-
queries:
|
|
1657
|
+
}, [a, i, c, m]), f = ne({
|
|
1658
|
+
queries: v.map((p) => ({
|
|
1659
1659
|
queryKey: ["pitvox", "serverInfo", p.competitionId, p.roundNumber],
|
|
1660
1660
|
queryFn: () => t(p.competitionId, p.roundNumber),
|
|
1661
|
-
enabled: !!t &&
|
|
1661
|
+
enabled: !!t && v.length > 0,
|
|
1662
1662
|
staleTime: 5 * 6e4,
|
|
1663
1663
|
// 5 minutes
|
|
1664
1664
|
retry: !1
|
|
1665
1665
|
}))
|
|
1666
1666
|
});
|
|
1667
1667
|
return {
|
|
1668
|
-
data: w(() =>
|
|
1668
|
+
data: w(() => v.length ? t ? v.map((p, b) => {
|
|
1669
1669
|
var N;
|
|
1670
1670
|
const u = (N = f[b]) == null ? void 0 : N.data;
|
|
1671
1671
|
return u != null && u.success ? {
|
|
@@ -1673,15 +1673,15 @@ function lr() {
|
|
|
1673
1673
|
serverAddress: u.serverAddress || null,
|
|
1674
1674
|
serverPassword: u.serverPassword || null
|
|
1675
1675
|
} : p;
|
|
1676
|
-
}) :
|
|
1676
|
+
}) : v : [], [v, t, f]),
|
|
1677
1677
|
isLoading: o || !!i && c
|
|
1678
1678
|
};
|
|
1679
1679
|
}
|
|
1680
|
-
function
|
|
1680
|
+
function cr() {
|
|
1681
1681
|
const { onFetchNotifications: r } = k();
|
|
1682
1682
|
return !!r;
|
|
1683
1683
|
}
|
|
1684
|
-
function
|
|
1684
|
+
function lr(r = {}) {
|
|
1685
1685
|
const { onFetchNotifications: n, partnerSlug: s } = k(), { limit: t = 20, unreadOnly: i = !1 } = r;
|
|
1686
1686
|
return L({
|
|
1687
1687
|
queryKey: ["pitvox", "notifications", s, { limit: t, unreadOnly: i }],
|
|
@@ -1691,7 +1691,7 @@ function pr(r = {}) {
|
|
|
1691
1691
|
refetchInterval: 3e4
|
|
1692
1692
|
});
|
|
1693
1693
|
}
|
|
1694
|
-
function
|
|
1694
|
+
function Zr() {
|
|
1695
1695
|
const { onFetchNotifications: r, partnerSlug: n } = k(), { data: s, isLoading: t } = L({
|
|
1696
1696
|
queryKey: ["pitvox", "notifications", n, { limit: 1, unreadOnly: !1 }],
|
|
1697
1697
|
queryFn: () => r({ limit: 1 }),
|
|
@@ -1702,7 +1702,7 @@ function Jr() {
|
|
|
1702
1702
|
});
|
|
1703
1703
|
return { count: s ?? 0, isLoading: t };
|
|
1704
1704
|
}
|
|
1705
|
-
function
|
|
1705
|
+
function dr() {
|
|
1706
1706
|
const { onMarkNotificationRead: r, partnerSlug: n } = k(), s = U();
|
|
1707
1707
|
return H({
|
|
1708
1708
|
mutationFn: (t) => {
|
|
@@ -1724,7 +1724,7 @@ function ur() {
|
|
|
1724
1724
|
}
|
|
1725
1725
|
});
|
|
1726
1726
|
}
|
|
1727
|
-
function
|
|
1727
|
+
function pr() {
|
|
1728
1728
|
const { onMarkAllNotificationsRead: r, partnerSlug: n } = k(), s = U();
|
|
1729
1729
|
return H({
|
|
1730
1730
|
mutationFn: () => {
|
|
@@ -1748,7 +1748,7 @@ function mr() {
|
|
|
1748
1748
|
}
|
|
1749
1749
|
});
|
|
1750
1750
|
}
|
|
1751
|
-
function
|
|
1751
|
+
function ur({ driverName: r, avatarUrl: n, memberSince: s, className: t = "" }) {
|
|
1752
1752
|
const i = s ? new Date(s).toLocaleDateString("en-GB", { day: "2-digit", month: "2-digit", year: "numeric" }) : null;
|
|
1753
1753
|
return /* @__PURE__ */ l("div", { className: `pvx-card pvx-dash-profile ${t}`, children: [
|
|
1754
1754
|
n ? /* @__PURE__ */ e("img", { src: n, alt: "", className: "pvx-dash-profile-avatar" }) : /* @__PURE__ */ e("div", { className: "pvx-dash-profile-avatar pvx-dash-profile-avatar--placeholder", children: (r || "?")[0].toUpperCase() }),
|
|
@@ -1761,7 +1761,7 @@ function vr({ driverName: r, avatarUrl: n, memberSince: s, className: t = "" })
|
|
|
1761
1761
|
] })
|
|
1762
1762
|
] });
|
|
1763
1763
|
}
|
|
1764
|
-
function
|
|
1764
|
+
function mr() {
|
|
1765
1765
|
return /* @__PURE__ */ l("svg", { className: "pvx-dash-stat-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1766
1766
|
/* @__PURE__ */ e("line", { x1: "4", y1: "9", x2: "20", y2: "9" }),
|
|
1767
1767
|
/* @__PURE__ */ e("line", { x1: "4", y1: "15", x2: "20", y2: "15" }),
|
|
@@ -1769,7 +1769,7 @@ function hr() {
|
|
|
1769
1769
|
/* @__PURE__ */ e("line", { x1: "16", y1: "3", x2: "14", y2: "21" })
|
|
1770
1770
|
] });
|
|
1771
1771
|
}
|
|
1772
|
-
function
|
|
1772
|
+
function vr() {
|
|
1773
1773
|
return /* @__PURE__ */ l("svg", { className: "pvx-dash-stat-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1774
1774
|
/* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "10" }),
|
|
1775
1775
|
/* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "2" }),
|
|
@@ -1778,53 +1778,53 @@ function xr() {
|
|
|
1778
1778
|
/* @__PURE__ */ e("path", { d: "M13.5 12.5l4 2.5" })
|
|
1779
1779
|
] });
|
|
1780
1780
|
}
|
|
1781
|
-
function
|
|
1781
|
+
function hr() {
|
|
1782
1782
|
return /* @__PURE__ */ e("svg", { className: "pvx-dash-stat-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ e("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" }) });
|
|
1783
1783
|
}
|
|
1784
1784
|
function se({ icon: r, value: n, label: s, items: t, labelKey: i, countKey: a }) {
|
|
1785
|
-
const [o, d] =
|
|
1786
|
-
|
|
1785
|
+
const [o, d] = M(!1), m = Ce(null);
|
|
1786
|
+
Le(() => {
|
|
1787
1787
|
if (!o) return;
|
|
1788
|
-
function
|
|
1789
|
-
|
|
1788
|
+
function v(f) {
|
|
1789
|
+
m.current && !m.current.contains(f.target) && d(!1);
|
|
1790
1790
|
}
|
|
1791
|
-
return document.addEventListener("mousedown",
|
|
1791
|
+
return document.addEventListener("mousedown", v), () => document.removeEventListener("mousedown", v);
|
|
1792
1792
|
}, [o]);
|
|
1793
|
-
const c = t != null && t.length ? t.slice().sort((
|
|
1793
|
+
const c = t != null && t.length ? t.slice().sort((v, f) => f[a] - v[a]) : null;
|
|
1794
1794
|
return /* @__PURE__ */ l(
|
|
1795
1795
|
"div",
|
|
1796
1796
|
{
|
|
1797
|
-
ref:
|
|
1797
|
+
ref: m,
|
|
1798
1798
|
className: `pvx-dash-stat-card ${c ? "pvx-dash-stat-card--clickable" : ""}`,
|
|
1799
|
-
onClick: c ? () => d((
|
|
1799
|
+
onClick: c ? () => d((v) => !v) : void 0,
|
|
1800
1800
|
children: [
|
|
1801
1801
|
r,
|
|
1802
1802
|
/* @__PURE__ */ l("div", { className: "pvx-dash-stat-content", children: [
|
|
1803
1803
|
/* @__PURE__ */ e("span", { className: "pvx-dash-stat-value", children: n }),
|
|
1804
1804
|
/* @__PURE__ */ e("span", { className: "pvx-dash-stat-label", children: s })
|
|
1805
1805
|
] }),
|
|
1806
|
-
c && /* @__PURE__ */ e("div", { className: `pvx-dash-tooltip pvx-dash-tooltip--scrollable ${o ? "pvx-dash-tooltip--open" : ""}`, children: c.map((
|
|
1807
|
-
/* @__PURE__ */ e("span", { className: "pvx-dash-tooltip-label", children:
|
|
1808
|
-
/* @__PURE__ */ e("span", { className: "pvx-dash-tooltip-value", children:
|
|
1806
|
+
c && /* @__PURE__ */ e("div", { className: `pvx-dash-tooltip pvx-dash-tooltip--scrollable ${o ? "pvx-dash-tooltip--open" : ""}`, children: c.map((v, f) => /* @__PURE__ */ l("div", { className: "pvx-dash-tooltip-row", children: [
|
|
1807
|
+
/* @__PURE__ */ e("span", { className: "pvx-dash-tooltip-label", children: v[i] }),
|
|
1808
|
+
/* @__PURE__ */ e("span", { className: "pvx-dash-tooltip-value", children: v[a] })
|
|
1809
1809
|
] }, f)) })
|
|
1810
1810
|
]
|
|
1811
1811
|
}
|
|
1812
1812
|
);
|
|
1813
1813
|
}
|
|
1814
|
-
function
|
|
1814
|
+
function xr({ stats: r, rating: n, className: s = "" }) {
|
|
1815
1815
|
if (!r) return null;
|
|
1816
1816
|
const t = r.trackBreakdown.map((a) => ({
|
|
1817
|
-
name:
|
|
1817
|
+
name: E(a.trackId, a.layout),
|
|
1818
1818
|
lapCount: a.lapCount
|
|
1819
1819
|
})), i = r.carBreakdown.map((a) => ({
|
|
1820
|
-
name:
|
|
1820
|
+
name: I(a.carId),
|
|
1821
1821
|
lapCount: a.lapCount
|
|
1822
1822
|
}));
|
|
1823
1823
|
return /* @__PURE__ */ l("div", { className: `pvx-dash-stats ${s}`, children: [
|
|
1824
1824
|
/* @__PURE__ */ e(
|
|
1825
1825
|
se,
|
|
1826
1826
|
{
|
|
1827
|
-
icon: /* @__PURE__ */ e(
|
|
1827
|
+
icon: /* @__PURE__ */ e(mr, {}),
|
|
1828
1828
|
value: r.lapCount.toLocaleString(),
|
|
1829
1829
|
label: "Total Laps",
|
|
1830
1830
|
items: t,
|
|
@@ -1835,7 +1835,7 @@ function fr({ stats: r, rating: n, className: s = "" }) {
|
|
|
1835
1835
|
/* @__PURE__ */ e(
|
|
1836
1836
|
se,
|
|
1837
1837
|
{
|
|
1838
|
-
icon: /* @__PURE__ */ e(
|
|
1838
|
+
icon: /* @__PURE__ */ e(vr, {}),
|
|
1839
1839
|
value: r.carBreakdown.length,
|
|
1840
1840
|
label: "Cars Used",
|
|
1841
1841
|
items: i,
|
|
@@ -1844,7 +1844,7 @@ function fr({ stats: r, rating: n, className: s = "" }) {
|
|
|
1844
1844
|
}
|
|
1845
1845
|
),
|
|
1846
1846
|
n && /* @__PURE__ */ l("div", { className: "pvx-dash-stat-card pvx-dash-stat-card--rating", children: [
|
|
1847
|
-
/* @__PURE__ */ e(
|
|
1847
|
+
/* @__PURE__ */ e(hr, {}),
|
|
1848
1848
|
/* @__PURE__ */ l("div", { className: "pvx-dash-stat-content", children: [
|
|
1849
1849
|
/* @__PURE__ */ e("span", { className: "pvx-dash-stat-value", children: n.rating.toFixed(1) }),
|
|
1850
1850
|
/* @__PURE__ */ e("span", { className: "pvx-dash-stat-label", children: "Driver Rating" }),
|
|
@@ -1858,7 +1858,7 @@ function fr({ stats: r, rating: n, className: s = "" }) {
|
|
|
1858
1858
|
] })
|
|
1859
1859
|
] });
|
|
1860
1860
|
}
|
|
1861
|
-
function
|
|
1861
|
+
function gr({ records: r, className: n = "" }) {
|
|
1862
1862
|
const s = w(() => r != null && r.length ? r.slice().sort((t, i) => {
|
|
1863
1863
|
const a = t.recordedAt ? new Date(t.recordedAt).getTime() : 0;
|
|
1864
1864
|
return (i.recordedAt ? new Date(i.recordedAt).getTime() : 0) - a;
|
|
@@ -1882,8 +1882,8 @@ function Nr({ records: r, className: n = "" }) {
|
|
|
1882
1882
|
] }) }),
|
|
1883
1883
|
/* @__PURE__ */ e("div", { className: "pvx-dash-records-list", children: s.map((t, i) => /* @__PURE__ */ l("div", { className: "pvx-dash-record-row", children: [
|
|
1884
1884
|
/* @__PURE__ */ l("div", { className: "pvx-dash-record-info", children: [
|
|
1885
|
-
/* @__PURE__ */ e("span", { className: "pvx-dash-record-track", children:
|
|
1886
|
-
/* @__PURE__ */ e("span", { className: "pvx-dash-record-car", children:
|
|
1885
|
+
/* @__PURE__ */ e("span", { className: "pvx-dash-record-track", children: E(t.trackId, t.layout, t.game) }),
|
|
1886
|
+
/* @__PURE__ */ e("span", { className: "pvx-dash-record-car", children: I(t.carId) })
|
|
1887
1887
|
] }),
|
|
1888
1888
|
/* @__PURE__ */ l("div", { className: "pvx-dash-record-time", children: [
|
|
1889
1889
|
/* @__PURE__ */ e("span", { className: "pvx-dash-record-lap", children: B(t.lapTimeMs) }),
|
|
@@ -1895,7 +1895,7 @@ function Nr({ records: r, className: n = "" }) {
|
|
|
1895
1895
|
] }, i)) })
|
|
1896
1896
|
] }) : null;
|
|
1897
1897
|
}
|
|
1898
|
-
function
|
|
1898
|
+
function fr({ events: r, isLoading: n, className: s, limit: t = 3 }) {
|
|
1899
1899
|
if (n)
|
|
1900
1900
|
return /* @__PURE__ */ e("div", { className: "pvx-loading", children: "Loading upcoming events..." });
|
|
1901
1901
|
if (!(r != null && r.length))
|
|
@@ -1903,7 +1903,7 @@ function br({ events: r, isLoading: n, className: s, limit: t = 3 }) {
|
|
|
1903
1903
|
const i = t ? r.slice(0, t) : r, a = r.length - i.length;
|
|
1904
1904
|
return /* @__PURE__ */ l("div", { className: `pvx-card ${s || ""}`, children: [
|
|
1905
1905
|
/* @__PURE__ */ e("div", { className: "pvx-card-header", children: /* @__PURE__ */ l("h3", { className: "pvx-card-title", children: [
|
|
1906
|
-
/* @__PURE__ */ e(
|
|
1906
|
+
/* @__PURE__ */ e(yr, {}),
|
|
1907
1907
|
"Upcoming Events",
|
|
1908
1908
|
/* @__PURE__ */ l("span", { className: "pvx-dash-records-count", children: [
|
|
1909
1909
|
"(",
|
|
@@ -1926,7 +1926,7 @@ function br({ events: r, isLoading: n, className: s, limit: t = 3 }) {
|
|
|
1926
1926
|
o.track
|
|
1927
1927
|
] }),
|
|
1928
1928
|
o.serverPassword && /* @__PURE__ */ e(
|
|
1929
|
-
|
|
1929
|
+
Nr,
|
|
1930
1930
|
{
|
|
1931
1931
|
password: o.serverPassword,
|
|
1932
1932
|
address: o.serverAddress
|
|
@@ -1939,7 +1939,7 @@ function br({ events: r, isLoading: n, className: s, limit: t = 3 }) {
|
|
|
1939
1939
|
month: "short",
|
|
1940
1940
|
year: "numeric"
|
|
1941
1941
|
}) }),
|
|
1942
|
-
/* @__PURE__ */ e("span", { className: "pvx-upcoming-relative", children:
|
|
1942
|
+
/* @__PURE__ */ e("span", { className: "pvx-upcoming-relative", children: br(o.startTime) }),
|
|
1943
1943
|
o.isNext && /* @__PURE__ */ e("span", { className: "pvx-upcoming-badge", children: "Next" })
|
|
1944
1944
|
] })
|
|
1945
1945
|
]
|
|
@@ -1955,47 +1955,47 @@ function br({ events: r, isLoading: n, className: s, limit: t = 3 }) {
|
|
|
1955
1955
|
] })
|
|
1956
1956
|
] });
|
|
1957
1957
|
}
|
|
1958
|
-
function
|
|
1959
|
-
const [s, t] =
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1958
|
+
function Nr({ password: r, address: n }) {
|
|
1959
|
+
const [s, t] = M(!1), [i, a] = M(!1), o = n ? r ? `join:${n}|${r}` : `join:${n}` : null, d = K(async () => {
|
|
1960
|
+
if (o)
|
|
1961
|
+
try {
|
|
1962
|
+
await navigator.clipboard.writeText(o), t(!0), setTimeout(() => t(!1), 2e3);
|
|
1963
|
+
} catch {
|
|
1964
|
+
}
|
|
1965
|
+
}, [o]);
|
|
1965
1966
|
return /* @__PURE__ */ l("div", { className: "pvx-server-info", children: [
|
|
1966
|
-
|
|
1967
|
+
o && /* @__PURE__ */ l(
|
|
1967
1968
|
"span",
|
|
1968
1969
|
{
|
|
1969
1970
|
className: "pvx-server-detail pvx-server-detail--clickable",
|
|
1970
|
-
onClick:
|
|
1971
|
-
title: "
|
|
1971
|
+
onClick: d,
|
|
1972
|
+
title: "Copy join string to clipboard",
|
|
1972
1973
|
children: [
|
|
1973
|
-
/* @__PURE__ */ e(
|
|
1974
|
+
/* @__PURE__ */ e(wr, {}),
|
|
1974
1975
|
" ",
|
|
1975
|
-
|
|
1976
|
-
" ",
|
|
1977
|
-
s === "address" ? /* @__PURE__ */ e(ie, {}) : /* @__PURE__ */ e(ae, {})
|
|
1976
|
+
s ? "Copied!" : "Join"
|
|
1978
1977
|
]
|
|
1979
1978
|
}
|
|
1980
1979
|
),
|
|
1981
|
-
/* @__PURE__ */ l(
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
/* @__PURE__ */ e(Cr, {})
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1980
|
+
r && /* @__PURE__ */ l(A, { children: [
|
|
1981
|
+
/* @__PURE__ */ e(
|
|
1982
|
+
"span",
|
|
1983
|
+
{
|
|
1984
|
+
className: "pvx-server-detail pvx-server-detail--clickable",
|
|
1985
|
+
onClick: () => a((m) => !m),
|
|
1986
|
+
title: i ? "Hide password" : "Reveal password",
|
|
1987
|
+
children: i ? /* @__PURE__ */ e(Lr, {}) : /* @__PURE__ */ e(Cr, {})
|
|
1988
|
+
}
|
|
1989
|
+
),
|
|
1990
|
+
i && /* @__PURE__ */ l("span", { className: "pvx-server-detail", children: [
|
|
1991
|
+
/* @__PURE__ */ e(kr, {}),
|
|
1992
|
+
" ",
|
|
1993
|
+
r
|
|
1994
|
+
] })
|
|
1995
|
+
] })
|
|
1996
1996
|
] });
|
|
1997
1997
|
}
|
|
1998
|
-
function
|
|
1998
|
+
function br(r) {
|
|
1999
1999
|
const n = new Date(r).getTime() - Date.now();
|
|
2000
2000
|
if (n <= 0) return "Now";
|
|
2001
2001
|
const s = Math.floor(n / (1e3 * 60 * 60));
|
|
@@ -2008,39 +2008,40 @@ function kr(r) {
|
|
|
2008
2008
|
const i = Math.floor(t / 7);
|
|
2009
2009
|
return `in ${i} week${i !== 1 ? "s" : ""}`;
|
|
2010
2010
|
}
|
|
2011
|
-
return
|
|
2011
|
+
return ae(r);
|
|
2012
2012
|
}
|
|
2013
|
-
function
|
|
2013
|
+
function yr() {
|
|
2014
2014
|
return /* @__PURE__ */ l("svg", { className: "pvx-dash-records-icon", width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2015
2015
|
/* @__PURE__ */ e("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2" }),
|
|
2016
2016
|
/* @__PURE__ */ e("path", { d: "M16 2v4M8 2v4M3 10h18" })
|
|
2017
2017
|
] });
|
|
2018
2018
|
}
|
|
2019
|
-
function
|
|
2019
|
+
function kr() {
|
|
2020
2020
|
return /* @__PURE__ */ l("svg", { className: "pvx-server-icon", width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2021
2021
|
/* @__PURE__ */ e("rect", { x: "3", y: "11", width: "18", height: "11", rx: "2" }),
|
|
2022
2022
|
/* @__PURE__ */ e("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })
|
|
2023
2023
|
] });
|
|
2024
2024
|
}
|
|
2025
|
-
function
|
|
2026
|
-
return /* @__PURE__ */ l("svg", { className: "pvx-server-icon", width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2027
|
-
/* @__PURE__ */ e("rect", { x: "2", y: "2", width: "20", height: "8", rx: "2" }),
|
|
2028
|
-
/* @__PURE__ */ e("rect", { x: "2", y: "14", width: "20", height: "8", rx: "2" }),
|
|
2029
|
-
/* @__PURE__ */ e("circle", { cx: "6", cy: "6", r: "1" }),
|
|
2030
|
-
/* @__PURE__ */ e("circle", { cx: "6", cy: "18", r: "1" })
|
|
2031
|
-
] });
|
|
2032
|
-
}
|
|
2033
|
-
function ae() {
|
|
2025
|
+
function wr() {
|
|
2034
2026
|
return /* @__PURE__ */ l("svg", { className: "pvx-server-icon pvx-server-icon--action", width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2035
2027
|
/* @__PURE__ */ e("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2" }),
|
|
2036
2028
|
/* @__PURE__ */ e("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
|
|
2037
2029
|
] });
|
|
2038
2030
|
}
|
|
2039
|
-
function
|
|
2040
|
-
return /* @__PURE__ */
|
|
2031
|
+
function Cr() {
|
|
2032
|
+
return /* @__PURE__ */ l("svg", { className: "pvx-server-icon pvx-server-icon--action", width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2033
|
+
/* @__PURE__ */ e("path", { d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" }),
|
|
2034
|
+
/* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "3" })
|
|
2035
|
+
] });
|
|
2036
|
+
}
|
|
2037
|
+
function Lr() {
|
|
2038
|
+
return /* @__PURE__ */ l("svg", { className: "pvx-server-icon pvx-server-icon--action", width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2039
|
+
/* @__PURE__ */ e("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" }),
|
|
2040
|
+
/* @__PURE__ */ e("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
|
|
2041
|
+
] });
|
|
2041
2042
|
}
|
|
2042
2043
|
function Rr({ notifications: r, unreadCount: n = 0, onMarkRead: s, onMarkAllRead: t, isLoading: i, className: a }) {
|
|
2043
|
-
const o =
|
|
2044
|
+
const o = oe();
|
|
2044
2045
|
return i ? /* @__PURE__ */ e("div", { className: "pvx-loading", children: "Loading notifications..." }) : /* @__PURE__ */ l("div", { className: `pvx-card ${a || ""}`, children: [
|
|
2045
2046
|
/* @__PURE__ */ l("div", { className: "pvx-card-header", children: [
|
|
2046
2047
|
/* @__PURE__ */ l("h3", { className: "pvx-card-title", children: [
|
|
@@ -2073,8 +2074,8 @@ function Tr({ notification: r, getUserDisplay: n, onMarkRead: s }) {
|
|
|
2073
2074
|
children: [
|
|
2074
2075
|
/* @__PURE__ */ e(Sr, { type: r.type }),
|
|
2075
2076
|
/* @__PURE__ */ l("div", { className: "pvx-notif-content", children: [
|
|
2076
|
-
/* @__PURE__ */ e("span", { className: "pvx-notif-message", children:
|
|
2077
|
-
/* @__PURE__ */ e("span", { className: "pvx-notif-time", children:
|
|
2077
|
+
/* @__PURE__ */ e("span", { className: "pvx-notif-message", children: Me(r, n) }),
|
|
2078
|
+
/* @__PURE__ */ e("span", { className: "pvx-notif-time", children: ae(r.createdAt) })
|
|
2078
2079
|
] }),
|
|
2079
2080
|
!r.isRead && /* @__PURE__ */ e("span", { className: "pvx-notif-dot" })
|
|
2080
2081
|
]
|
|
@@ -2101,20 +2102,20 @@ function $r() {
|
|
|
2101
2102
|
] });
|
|
2102
2103
|
}
|
|
2103
2104
|
function Xr({ steamId: r, avatarUrl: n, memberSince: s, className: t = "" }) {
|
|
2104
|
-
const { data: i, isLoading: a, error: o } =
|
|
2105
|
-
return a ||
|
|
2105
|
+
const { data: i, isLoading: a, error: o } = ar(r), { data: d, isLoading: m } = ir(r), { data: c, isLoading: v } = or(), f = cr(), { data: g, isLoading: p } = lr({ limit: 10 }), b = dr(), u = pr();
|
|
2106
|
+
return a || m ? /* @__PURE__ */ e("div", { className: "pvx-loading", children: "Loading dashboard..." }) : o ? /* @__PURE__ */ e("div", { className: "pvx-empty", children: "Failed to load dashboard data." }) : i ? /* @__PURE__ */ l("div", { className: `pvx-dash ${t}`, children: [
|
|
2106
2107
|
/* @__PURE__ */ e(
|
|
2107
|
-
|
|
2108
|
+
ur,
|
|
2108
2109
|
{
|
|
2109
2110
|
driverName: i.driverName,
|
|
2110
2111
|
avatarUrl: n,
|
|
2111
2112
|
memberSince: s
|
|
2112
2113
|
}
|
|
2113
2114
|
),
|
|
2114
|
-
/* @__PURE__ */ e(
|
|
2115
|
-
r && /* @__PURE__ */ e(
|
|
2115
|
+
/* @__PURE__ */ e(xr, { stats: i, rating: d }),
|
|
2116
|
+
r && /* @__PURE__ */ e(fr, { events: c, isLoading: v }),
|
|
2116
2117
|
/* @__PURE__ */ l("div", { className: `pvx-dash-row ${f ? "pvx-dash-row--2col" : ""}`, children: [
|
|
2117
|
-
/* @__PURE__ */ e(
|
|
2118
|
+
/* @__PURE__ */ e(gr, { records: i.currentRecords }),
|
|
2118
2119
|
f && /* @__PURE__ */ e(
|
|
2119
2120
|
Rr,
|
|
2120
2121
|
{
|
|
@@ -2131,62 +2132,62 @@ function Xr({ steamId: r, avatarUrl: n, memberSince: s, className: t = "" }) {
|
|
|
2131
2132
|
export {
|
|
2132
2133
|
jr as CarsTable,
|
|
2133
2134
|
P as CompEmptyState,
|
|
2134
|
-
|
|
2135
|
+
j as CompLoadingState,
|
|
2135
2136
|
Wr as CompetitionCards,
|
|
2136
2137
|
Xr as DriverDashboard,
|
|
2137
|
-
|
|
2138
|
+
ur as DriverProfile,
|
|
2138
2139
|
Vr as DriversTable,
|
|
2139
2140
|
zr as EntryList,
|
|
2140
2141
|
Q as InfoPill,
|
|
2141
2142
|
Kr as LapHistoryTable,
|
|
2142
2143
|
Rr as NotificationsCard,
|
|
2143
|
-
|
|
2144
|
+
Ke as PODIUM_MEDALS,
|
|
2144
2145
|
Br as PitVoxPartnerProvider,
|
|
2145
2146
|
Hr as RankingsTable,
|
|
2146
|
-
|
|
2147
|
+
gr as RecordsTable,
|
|
2147
2148
|
Qr as RegisterButton,
|
|
2148
2149
|
Yr as RegistrationPanel,
|
|
2149
2150
|
Gr as RoundResults,
|
|
2150
|
-
|
|
2151
|
+
Xe as RoundSessionResults,
|
|
2151
2152
|
Or as StandingsTable,
|
|
2152
|
-
|
|
2153
|
+
xr as StatsCards,
|
|
2153
2154
|
qr as TracksTable,
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2155
|
+
Oe as TypeBadge,
|
|
2156
|
+
fr as UpcomingEvents,
|
|
2157
|
+
I as formatCarName,
|
|
2157
2158
|
F as formatDate,
|
|
2158
2159
|
Pr as formatDelta,
|
|
2159
2160
|
B as formatLapTime,
|
|
2160
|
-
|
|
2161
|
-
|
|
2161
|
+
Me as formatNotificationMessage,
|
|
2162
|
+
ae as formatRelativeTime,
|
|
2162
2163
|
D as formatSectorTime,
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2164
|
+
E as formatTrackName,
|
|
2165
|
+
ie as formatTyreCompound,
|
|
2166
|
+
Er as useCarLeaderboard,
|
|
2167
|
+
Ur as useCarMetadata,
|
|
2167
2168
|
_r as useCompetitionAllRounds,
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2169
|
+
Be as useCompetitionConfig,
|
|
2170
|
+
ce as useCompetitionEntryList,
|
|
2171
|
+
Ae as useCompetitionRound,
|
|
2172
|
+
Pe as useCompetitionStandings,
|
|
2173
|
+
Fr as useCompetitions,
|
|
2174
|
+
De as useDriverLaps,
|
|
2175
|
+
ir as useDriverRating,
|
|
2176
|
+
Jr as useDriverRatings,
|
|
2177
|
+
ar as useDriverStats,
|
|
2178
|
+
Ar as useLeaderboardIndex,
|
|
2179
|
+
pr as useMarkAllNotificationsRead,
|
|
2180
|
+
dr as useMarkNotificationRead,
|
|
2181
|
+
lr as useNotifications,
|
|
2182
|
+
cr as useNotificationsEnabled,
|
|
2182
2183
|
k as usePitVox,
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2184
|
+
le as useRegister,
|
|
2185
|
+
Z as useRegistrationMode,
|
|
2186
|
+
J as useRegistrationStatus,
|
|
2186
2187
|
X as useRegistrationUrl,
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2188
|
+
Ie as useTrackLeaderboard,
|
|
2189
|
+
Zr as useUnreadCount,
|
|
2190
|
+
or as useUpcomingEvents,
|
|
2191
|
+
oe as useUserLookup,
|
|
2192
|
+
de as useWithdraw
|
|
2192
2193
|
};
|