@pitvox/partner-react 0.7.6 → 0.7.7

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