@everymatrix/tournament-details-page 0.0.6 → 0.0.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/components/{TournamentDetails-BwBvr-th.cjs → TournamentDetails-C-zS8XGk.cjs} +2 -2
- package/components/{TournamentDetails-DIfQFrc8.js → TournamentDetails-DoBMS_9T.js} +9 -9
- package/components/{TournamentDetails-wSkU01Xy.js → TournamentDetails-qcyLTtSv.js} +9 -9
- package/components/{TournamentDetailsPage-rE5SsAXj.js → TournamentDetailsPage-C2wcS4rg.js} +282 -248
- package/components/{TournamentDetailsPage-9QiBj_5p.js → TournamentDetailsPage-CQFv3xok.js} +269 -235
- package/components/{TournamentDetailsPage-du8_rjJX.cjs → TournamentDetailsPage-CR3ti0az.cjs} +8 -5
- package/components/{TournamentGames-Dxvil6j2.js → TournamentGames-KOJ004rg.js} +108 -104
- package/components/{TournamentGames-EuHRBJf0.js → TournamentGames-xrJB7h-M.js} +85 -81
- package/components/{TournamentGames-o7mTC32n.cjs → TournamentGames-zikPbhES.cjs} +2 -2
- package/components/{TournamentLeaderboard-BgywP9Jb.js → TournamentLeaderboard-BjBItfy9.js} +81 -81
- package/components/{TournamentLeaderboard-m4CZolTW.cjs → TournamentLeaderboard-D9naoaD9.cjs} +4 -4
- package/components/{TournamentLeaderboard-ncHvraaw.js → TournamentLeaderboard-Dc8xv6be.js} +165 -165
- package/es2015/tournament-details-page.cjs +1 -1
- package/es2015/tournament-details-page.js +1 -1
- package/esnext/tournament-details-page.js +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as ot, $ as st, M as it, g as dt, h as Le, u as lt, o as ct, j as W, k as je, z as ve, n as L, q as vt, r as ht, v as Ne, p as ut, l as A, m as p, C as ft, E as R, e as pt, f as gt, w as l, L as Qe, t as q, s as he, F as mt, x as f, I as Xe, y as De, J as Ye, K as tt, N as yt, B as rt } from "./TournamentDetails-
|
|
1
|
+
import { b as ot, $ as st, M as it, g as dt, h as Le, u as lt, o as ct, j as W, k as je, z as ve, n as L, q as vt, r as ht, v as Ne, p as ut, l as A, m as p, C as ft, E as R, e as pt, f as gt, w as l, L as Qe, t as q, s as he, F as mt, x as f, I as Xe, y as De, J as Ye, K as tt, N as yt, B as rt } from "./TournamentDetails-DoBMS_9T.js";
|
|
2
2
|
function bt(se, $) {
|
|
3
3
|
ot(se, $);
|
|
4
4
|
}
|
|
@@ -23,16 +23,16 @@ const nt = {
|
|
|
23
23
|
tr: {
|
|
24
24
|
rank: "Sıralama",
|
|
25
25
|
user: "Kullanıcı",
|
|
26
|
-
points: "
|
|
26
|
+
points: "Puan",
|
|
27
27
|
prize: "Ödül",
|
|
28
28
|
notEnrolledRank: "Şu anda bu turnuvaya kayıtlı değilsiniz",
|
|
29
29
|
myRanking: "Sıralamam",
|
|
30
30
|
showMore: "Daha Fazla Göster",
|
|
31
31
|
showLess: "Daha Az Göster",
|
|
32
|
-
emptyLeaderboard: "
|
|
33
|
-
joinButton: "
|
|
34
|
-
previousButton: "
|
|
35
|
-
nextButton: "
|
|
32
|
+
emptyLeaderboard: "Şu anda bu turnuvaya kayıtlı oyuncu bulunmuyor",
|
|
33
|
+
joinButton: "Katıl",
|
|
34
|
+
previousButton: "Önceki",
|
|
35
|
+
nextButton: "Sonraki"
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
var Ze = { exports: {} };
|
|
@@ -43,11 +43,11 @@ var Ze = { exports: {} };
|
|
|
43
43
|
*/
|
|
44
44
|
(function(se, $) {
|
|
45
45
|
(function(b) {
|
|
46
|
-
var V = b.setTimeout, ie = b.clearTimeout,
|
|
46
|
+
var V = b.setTimeout, ie = b.clearTimeout, k = b.XMLHttpRequest, K = b.XDomainRequest, J = b.ActiveXObject, Q = b.EventSource, F = b.document, qe = b.Promise, M = b.fetch, ue = b.Response, Y = b.TextDecoder, _e = b.TextEncoder, Z = b.AbortController;
|
|
47
47
|
if (typeof window < "u" && typeof F < "u" && !("readyState" in F) && F.body == null && (F.readyState = "loading", window.addEventListener("load", function(e) {
|
|
48
48
|
F.readyState = "complete";
|
|
49
|
-
}, !1)),
|
|
50
|
-
return new
|
|
49
|
+
}, !1)), k == null && J != null && (k = function() {
|
|
50
|
+
return new J("Microsoft.XMLHTTP");
|
|
51
51
|
}), Object.create == null && (Object.create = function(e) {
|
|
52
52
|
function n() {
|
|
53
53
|
}
|
|
@@ -180,7 +180,7 @@ var Ze = { exports: {} };
|
|
|
180
180
|
r("abort", s);
|
|
181
181
|
}), "onprogress" in a && (a.onprogress = i), "onreadystatechange" in a && (a.onreadystatechange = function(s) {
|
|
182
182
|
c(s);
|
|
183
|
-
}), ("contentType" in a || !("ontimeout" in
|
|
183
|
+
}), ("contentType" in a || !("ontimeout" in k.prototype)) && (n += (n.indexOf("?") === -1 ? "?" : "&") + "padding=true"), a.open(e, n, !0), "readyState" in a && (d = V(function() {
|
|
184
184
|
h();
|
|
185
185
|
}, 0));
|
|
186
186
|
}, z.prototype.abort = function() {
|
|
@@ -193,7 +193,7 @@ var Ze = { exports: {} };
|
|
|
193
193
|
}, z.prototype.getAllResponseHeaders = function() {
|
|
194
194
|
return this._xhr.getAllResponseHeaders != null && this._xhr.getAllResponseHeaders() || "";
|
|
195
195
|
}, z.prototype.send = function() {
|
|
196
|
-
if ((!("ontimeout" in
|
|
196
|
+
if ((!("ontimeout" in k.prototype) || !("sendAsBinary" in k.prototype) && !("mozAnon" in k.prototype)) && F != null && F.readyState != null && F.readyState !== "complete") {
|
|
197
197
|
var e = this;
|
|
198
198
|
e._sendTimeout = V(function() {
|
|
199
199
|
e._sendTimeout = 0, e.send();
|
|
@@ -223,7 +223,7 @@ var Ze = { exports: {} };
|
|
|
223
223
|
}
|
|
224
224
|
pe.prototype.get = function(e) {
|
|
225
225
|
return this._map[Fe(e)];
|
|
226
|
-
},
|
|
226
|
+
}, k != null && k.HEADERS_RECEIVED == null && (k.HEADERS_RECEIVED = 2);
|
|
227
227
|
function Oe() {
|
|
228
228
|
}
|
|
229
229
|
Oe.prototype.open = function(e, n, o, a, v, d, t) {
|
|
@@ -239,7 +239,7 @@ var Ze = { exports: {} };
|
|
|
239
239
|
}, e.onabort = function() {
|
|
240
240
|
a(null);
|
|
241
241
|
}, e.onreadystatechange = function() {
|
|
242
|
-
if (e.readyState ===
|
|
242
|
+
if (e.readyState === k.HEADERS_RECEIVED) {
|
|
243
243
|
var c = e.status, h = e.statusText, s = e.getResponseHeader("Content-Type"), u = e.getAllResponseHeaders();
|
|
244
244
|
n(c, h, s, new pe(u));
|
|
245
245
|
}
|
|
@@ -341,7 +341,7 @@ var Ze = { exports: {} };
|
|
|
341
341
|
de.call(this, e), this.error = n.error;
|
|
342
342
|
}
|
|
343
343
|
He.prototype = Object.create(de.prototype);
|
|
344
|
-
var
|
|
344
|
+
var Ee = -1, ee = 0, te = 1, le = 2, Pe = -1, re = 0, be = 1, xe = 2, Me = 3, Re = /^text\/event\-stream(;.*)?$/i, Ge = 1e3, Te = 18e6, Ce = function(e, n) {
|
|
345
345
|
var o = e == null ? n : parseInt(e, 10);
|
|
346
346
|
return o !== o && (o = n), we(o);
|
|
347
347
|
}, we = function(e) {
|
|
@@ -357,44 +357,44 @@ var Ze = { exports: {} };
|
|
|
357
357
|
ge.call(this), n = n || {}, this.onopen = void 0, this.onmessage = void 0, this.onerror = void 0, this.url = void 0, this.readyState = void 0, this.withCredentials = void 0, this.headers = void 0, this._close = void 0, Ve(this, e, n);
|
|
358
358
|
}
|
|
359
359
|
function $e() {
|
|
360
|
-
return
|
|
360
|
+
return k != null && "withCredentials" in k.prototype || K == null ? new k() : new K();
|
|
361
361
|
}
|
|
362
362
|
var Ue = M != null && ue != null && "body" in ue.prototype;
|
|
363
363
|
function Ve(e, n, o) {
|
|
364
364
|
n = String(n);
|
|
365
|
-
var a = !!o.withCredentials, v = o.lastEventIdQueryParameterName || "lastEventId", d = we(1e3), t = Ce(o.heartbeatTimeout, 45e3), i = "", r = d, c = !1, h = 0, s = o.headers || {}, u = o.Transport, j = Ue && u == null ? void 0 : new z(u != null ? new u() : $e()), x = u != null && typeof u != "string" ? new u() : j == null ? new Ie() : new Oe(), g = void 0, y = 0, S =
|
|
365
|
+
var a = !!o.withCredentials, v = o.lastEventIdQueryParameterName || "lastEventId", d = we(1e3), t = Ce(o.heartbeatTimeout, 45e3), i = "", r = d, c = !1, h = 0, s = o.headers || {}, u = o.Transport, j = Ue && u == null ? void 0 : new z(u != null ? new u() : $e()), x = u != null && typeof u != "string" ? new u() : j == null ? new Ie() : new Oe(), g = void 0, y = 0, S = Ee, X = "", w = "", m = "", E = "", _ = re, ae = 0, G = 0, Se = function(T, P, I, H) {
|
|
366
366
|
if (S === ee)
|
|
367
367
|
if (T === 200 && I != null && Re.test(I)) {
|
|
368
368
|
S = te, c = Date.now(), r = d, e.readyState = te;
|
|
369
369
|
var D = new ye("open", {
|
|
370
370
|
status: T,
|
|
371
|
-
statusText:
|
|
371
|
+
statusText: P,
|
|
372
372
|
headers: H
|
|
373
373
|
});
|
|
374
374
|
e.dispatchEvent(D), ce(e, e.onopen, D);
|
|
375
375
|
} else {
|
|
376
376
|
var C = "";
|
|
377
|
-
T !== 200 ? (
|
|
377
|
+
T !== 200 ? (P && (P = P.replace(/\s+/g, " ")), C = "EventSource's response has a status " + T + " " + P + " that is not 200. Aborting the connection.") : C = "EventSource's response has a Content-Type specifying an unsupported type: " + (I == null ? "-" : I.replace(/\s+/g, " ")) + ". Aborting the connection.", Je();
|
|
378
378
|
var D = new ye("error", {
|
|
379
379
|
status: T,
|
|
380
|
-
statusText:
|
|
380
|
+
statusText: P,
|
|
381
381
|
headers: H
|
|
382
382
|
});
|
|
383
383
|
e.dispatchEvent(D), ce(e, e.onerror, D), console.error(C);
|
|
384
384
|
}
|
|
385
|
-
},
|
|
385
|
+
}, Ke = function(T) {
|
|
386
386
|
if (S === te) {
|
|
387
|
-
for (var
|
|
387
|
+
for (var P = -1, I = 0; I < T.length; I += 1) {
|
|
388
388
|
var H = T.charCodeAt(I);
|
|
389
|
-
(H === 10 || H === 13) && (
|
|
389
|
+
(H === 10 || H === 13) && (P = I);
|
|
390
390
|
}
|
|
391
|
-
var D = (
|
|
392
|
-
|
|
391
|
+
var D = (P !== -1 ? E : "") + T.slice(0, P + 1);
|
|
392
|
+
E = (P === -1 ? E : "") + T.slice(P + 1), T !== "" && (c = Date.now(), h += T.length);
|
|
393
393
|
for (var C = 0; C < D.length; C += 1) {
|
|
394
394
|
var H = D.charCodeAt(C);
|
|
395
|
-
if (_ ===
|
|
395
|
+
if (_ === Pe && H === 10)
|
|
396
396
|
_ = re;
|
|
397
|
-
else if (_ ===
|
|
397
|
+
else if (_ === Pe && (_ = re), H === 13 || H === 10) {
|
|
398
398
|
if (_ !== re) {
|
|
399
399
|
_ === be && (G = C + 1);
|
|
400
400
|
var ne = D.slice(ae, G - 1), oe = D.slice(G + (G < C && D.charCodeAt(G) === 32 ? 1 : 0), C);
|
|
@@ -406,32 +406,32 @@ var Ze = { exports: {} };
|
|
|
406
406
|
if (_ === re) {
|
|
407
407
|
if (X !== "") {
|
|
408
408
|
i = w, m === "" && (m = "message");
|
|
409
|
-
var
|
|
409
|
+
var ke = new me(m, {
|
|
410
410
|
data: X.slice(1),
|
|
411
411
|
lastEventId: w
|
|
412
412
|
});
|
|
413
|
-
if (e.dispatchEvent(
|
|
413
|
+
if (e.dispatchEvent(ke), m === "open" ? ce(e, e.onopen, ke) : m === "message" ? ce(e, e.onmessage, ke) : m === "error" && ce(e, e.onerror, ke), S === le)
|
|
414
414
|
return;
|
|
415
415
|
}
|
|
416
416
|
X = "", m = "";
|
|
417
417
|
}
|
|
418
|
-
_ = H === 13 ?
|
|
418
|
+
_ = H === 13 ? Pe : re;
|
|
419
419
|
} else
|
|
420
420
|
_ === re && (ae = C, _ = be), _ === be ? H === 58 && (G = C + 1, _ = xe) : _ === xe && (_ = Me);
|
|
421
421
|
}
|
|
422
422
|
}
|
|
423
423
|
}, et = function(T) {
|
|
424
424
|
if (S === te || S === ee) {
|
|
425
|
-
S =
|
|
425
|
+
S = Ee, y !== 0 && (ie(y), y = 0), y = V(function() {
|
|
426
426
|
Ae();
|
|
427
427
|
}, r), r = we(Math.min(d * 16, r * 2)), e.readyState = ee;
|
|
428
|
-
var
|
|
429
|
-
e.dispatchEvent(
|
|
428
|
+
var P = new He("error", { error: T });
|
|
429
|
+
e.dispatchEvent(P), ce(e, e.onerror, P), T != null && console.error(T);
|
|
430
430
|
}
|
|
431
|
-
},
|
|
431
|
+
}, Je = function() {
|
|
432
432
|
S = le, g != null && (g.abort(), g = void 0), y !== 0 && (ie(y), y = 0), e.readyState = le;
|
|
433
433
|
}, Ae = function() {
|
|
434
|
-
if (y = 0, S !==
|
|
434
|
+
if (y = 0, S !== Ee) {
|
|
435
435
|
if (!c && g != null)
|
|
436
436
|
et(new Error("No activity within " + t + " milliseconds. " + (S === ee ? "No response received." : h + " chars received.") + " Reconnecting.")), g != null && (g.abort(), g = void 0);
|
|
437
437
|
else {
|
|
@@ -444,13 +444,13 @@ var Ze = { exports: {} };
|
|
|
444
444
|
}
|
|
445
445
|
c = !1, h = 0, y = V(function() {
|
|
446
446
|
Ae();
|
|
447
|
-
}, t), S = ee, X = "", m = "", w = i,
|
|
448
|
-
var
|
|
447
|
+
}, t), S = ee, X = "", m = "", w = i, E = "", ae = 0, G = 0, _ = re;
|
|
448
|
+
var P = n;
|
|
449
449
|
if (n.slice(0, 5) !== "data:" && n.slice(0, 5) !== "blob:" && i !== "") {
|
|
450
450
|
var I = n.indexOf("?");
|
|
451
|
-
|
|
452
|
-
return
|
|
453
|
-
}),
|
|
451
|
+
P = I === -1 ? n : n.slice(0, I + 1) + n.slice(I + 1).replace(/(?:^|&)([^=&]*)(?:=[^&]*)?/g, function(oe, ke) {
|
|
452
|
+
return ke === v ? "" : oe;
|
|
453
|
+
}), P += (n.indexOf("?") === -1 ? "?" : "&") + v + "=" + encodeURIComponent(i);
|
|
454
454
|
}
|
|
455
455
|
var H = e.withCredentials, D = {};
|
|
456
456
|
D.Accept = "text/event-stream";
|
|
@@ -459,18 +459,18 @@ var Ze = { exports: {} };
|
|
|
459
459
|
for (var ne in C)
|
|
460
460
|
Object.prototype.hasOwnProperty.call(C, ne) && (D[ne] = C[ne]);
|
|
461
461
|
try {
|
|
462
|
-
g = x.open(j, Se,
|
|
462
|
+
g = x.open(j, Se, Ke, et, P, H, D);
|
|
463
463
|
} catch (oe) {
|
|
464
|
-
throw
|
|
464
|
+
throw Je(), oe;
|
|
465
465
|
}
|
|
466
466
|
};
|
|
467
|
-
e.url = n, e.readyState = ee, e.withCredentials = a, e.headers = s, e._close =
|
|
467
|
+
e.url = n, e.readyState = ee, e.withCredentials = a, e.headers = s, e._close = Je, Ae();
|
|
468
468
|
}
|
|
469
469
|
O.prototype = Object.create(ge.prototype), O.prototype.CONNECTING = ee, O.prototype.OPEN = te, O.prototype.CLOSED = le, O.prototype.close = function() {
|
|
470
470
|
this._close();
|
|
471
471
|
}, O.CONNECTING = ee, O.OPEN = te, O.CLOSED = le, O.prototype.withCredentials = void 0;
|
|
472
472
|
var ze = Q;
|
|
473
|
-
|
|
473
|
+
k != null && (Q == null || !("withCredentials" in Q.prototype)) && (ze = O), function(e) {
|
|
474
474
|
{
|
|
475
475
|
var n = e($);
|
|
476
476
|
n !== void 0 && (se.exports = n);
|
|
@@ -480,7 +480,7 @@ var Ze = { exports: {} };
|
|
|
480
480
|
});
|
|
481
481
|
})(typeof globalThis > "u" ? typeof window < "u" ? window : typeof self < "u" ? self : it : globalThis);
|
|
482
482
|
})(Ze, Ze.exports);
|
|
483
|
-
var wt = Ze.exports, jt = W('<span class="svelte-75jgrh"> </span> <span class="svelte-75jgrh"> </span> <span class="svelte-75jgrh"> </span>', 1), _t = W('<p class="svelte-75jgrh"> </p>'), xt = W('<div class="PlayerRankWrapper svelte-75jgrh"><div class="PlayerRankLabels svelte-75jgrh"><span class="svelte-75jgrh"> </span> <span class="svelte-75jgrh"> </span> <span class="svelte-75jgrh"> </span></div> <div class="PlayerRankData svelte-75jgrh"><!></div></div>'), St = W('<div class="PlayerRankSkeletonWrapper svelte-75jgrh"><div class="PlayerRankSkeleton svelte-75jgrh"><div class="SkeletonShimmer svelte-75jgrh"></div></div> <div class="PlayerRankSkeleton svelte-75jgrh"><div class="SkeletonShimmer svelte-75jgrh"></div></div></div>'),
|
|
483
|
+
var wt = Ze.exports, jt = W('<span class="svelte-75jgrh"> </span> <span class="svelte-75jgrh"> </span> <span class="svelte-75jgrh"> </span>', 1), _t = W('<p class="svelte-75jgrh"> </p>'), xt = W('<div class="PlayerRankWrapper svelte-75jgrh"><div class="PlayerRankLabels svelte-75jgrh"><span class="svelte-75jgrh"> </span> <span class="svelte-75jgrh"> </span> <span class="svelte-75jgrh"> </span></div> <div class="PlayerRankData svelte-75jgrh"><!></div></div>'), St = W('<div class="PlayerRankSkeletonWrapper svelte-75jgrh"><div class="PlayerRankSkeleton svelte-75jgrh"><div class="SkeletonShimmer svelte-75jgrh"></div></div> <div class="PlayerRankSkeleton svelte-75jgrh"><div class="SkeletonShimmer svelte-75jgrh"></div></div></div>'), kt = W('<tr class="SkeletonRow svelte-75jgrh"><td colspan="4" class="SkeletonShimmer svelte-75jgrh"><div class="svelte-75jgrh"></div></td></tr>'), Et = W('<tr><td class="svelte-75jgrh"> </td><td class="svelte-75jgrh"> </td><td class="svelte-75jgrh"> </td><td class="svelte-75jgrh"> </td></tr>'), Pt = W('<tr class="svelte-75jgrh"><td colspan="4" class="svelte-75jgrh"><div class="EmptyLeaderboard svelte-75jgrh"><p class="svelte-75jgrh"> </p></div></td></tr>'), Rt = W('<div class="PaginationSkeleton svelte-75jgrh"><div class="PaginationSkeletonButton svelte-75jgrh"><div class="SkeletonShimmer svelte-75jgrh"></div></div> <div class="PaginationNumberSkeleton svelte-75jgrh"><div class="SkeletonShimmer svelte-75jgrh"></div></div> <div class="PaginationNumberSkeleton svelte-75jgrh"><div class="SkeletonShimmer svelte-75jgrh"></div></div> <div class="PaginationNumberSkeleton svelte-75jgrh"><div class="SkeletonShimmer svelte-75jgrh"></div></div> <div class="PaginationNumberSkeleton svelte-75jgrh"><div class="SkeletonShimmer svelte-75jgrh"></div></div> <div class="PaginationNumberSkeleton svelte-75jgrh"><div class="SkeletonShimmer svelte-75jgrh"></div></div> <div class="PaginationSkeletonButton svelte-75jgrh"><div class="SkeletonShimmer svelte-75jgrh"></div></div></div>'), Tt = W('<span class="PaginationButton Elipsis svelte-75jgrh">...</span>'), Ct = W("<button> </button>"), At = W('<div class="PaginationWrapper svelte-75jgrh"><button class="PaginationButton svelte-75jgrh"> </button> <div class="PageNumberWrapper svelte-75jgrh"></div> <button class="PaginationButton svelte-75jgrh"> </button></div>'), Lt = W('<div class="LeaderboardWrapper svelte-75jgrh"><!> <table class="LeaderboardTable svelte-75jgrh"><thead class="LeaderboardTableHeader svelte-75jgrh"><tr class="svelte-75jgrh"><th class="svelte-75jgrh"> </th><th class="svelte-75jgrh"> </th><th class="svelte-75jgrh"> </th><th class="svelte-75jgrh"> </th></tr></thead><tbody class="LeaderboardTableBody svelte-75jgrh"><!></tbody></table> <!> <!></div>');
|
|
484
484
|
const Nt = {
|
|
485
485
|
hash: "svelte-75jgrh",
|
|
486
486
|
code: `.svelte-75jgrh,
|
|
@@ -510,12 +510,12 @@ const Nt = {
|
|
|
510
510
|
};
|
|
511
511
|
function Dt(se, $) {
|
|
512
512
|
ut($, !0), dt(se, Nt);
|
|
513
|
-
const b = () => ft(mt, "$_", V), [V, ie] = ht(),
|
|
513
|
+
const b = () => ft(mt, "$_", V), [V, ie] = ht(), k = Le($, "endpoint"), K = Le($, "language", 7, "en"), J = Le($, "session"), Q = Le($, "tournamentid"), F = Le($, "platform");
|
|
514
514
|
Object.keys(nt).forEach((t) => {
|
|
515
515
|
bt(t, nt[t]);
|
|
516
|
-
}), at(
|
|
516
|
+
}), at(K());
|
|
517
517
|
const qe = () => {
|
|
518
|
-
at(
|
|
518
|
+
at(K());
|
|
519
519
|
};
|
|
520
520
|
lt(() => {
|
|
521
521
|
qe();
|
|
@@ -525,8 +525,8 @@ function Dt(se, $) {
|
|
|
525
525
|
if (ye.has(l(me)))
|
|
526
526
|
return;
|
|
527
527
|
q(Y, !0);
|
|
528
|
-
const t = new URL(`${
|
|
529
|
-
|
|
528
|
+
const t = new URL(`${k()}/v1/tournaments/${Q()}/leaderboard`), i = new Headers();
|
|
529
|
+
J() && i.append("X-SessionId", J()), t.searchParams.append("language", K()), t.searchParams.append("platform", F()), t.searchParams.append("pagination", `offset=${l(U)},limit=${l(B)}`), fetch(t).then((r) => r.json()).then((r) => {
|
|
530
530
|
q(ue, r?.items, !0), q(fe, r?.pages, !0), q(N, r?.total, !0), ye.set(l(me), l(ue));
|
|
531
531
|
}).catch((r) => console.log(r)).finally(() => q(Y, !1));
|
|
532
532
|
}, Fe = (t) => {
|
|
@@ -534,14 +534,14 @@ function Dt(se, $) {
|
|
|
534
534
|
i && i.messageType === "LeaderBoardUpdate" && q(ue, i?.items, !0);
|
|
535
535
|
}, pe = () => {
|
|
536
536
|
M && (M.close(), M = null);
|
|
537
|
-
const t = new URL(`${
|
|
538
|
-
t.searchParams.append("HeartBeat", "false"), t.searchParams.append("language",
|
|
539
|
-
headers: { accept: "text/event-stream", "X-SessionId":
|
|
537
|
+
const t = new URL(`${k()}/v1/tournaments/${Q()}/leaderboard/updates`);
|
|
538
|
+
t.searchParams.append("HeartBeat", "false"), t.searchParams.append("language", K()), t.searchParams.append("filter", "includeUnqualifiedPlayer=true"), t.searchParams.append("pagination", `offset=${l(U)},limit=${l(B)}`), t.searchParams.append("platform", F()), M = new wt.EventSourcePolyfill(t, {
|
|
539
|
+
headers: { accept: "text/event-stream", "X-SessionId": J() }
|
|
540
540
|
}), M.onmessage = Fe;
|
|
541
541
|
}, Oe = () => {
|
|
542
542
|
q(_e, !0);
|
|
543
|
-
const t = new URL(`${
|
|
544
|
-
t.searchParams.append("language",
|
|
543
|
+
const t = new URL(`${k()}/v1/tournaments/leaderboard/player`), i = new Headers();
|
|
544
|
+
t.searchParams.append("language", K()), t.searchParams.append("platform", F()), t.searchParams.append("filter", "includeUnqualifiedPlayer=false"), J() && i.append("X-SessionId", J()), fetch(t, { method: "GET", headers: i }).then((c) => c.json()).then((c) => {
|
|
545
545
|
const h = c?.items?.find((s) => s?.tournament?.id === Q());
|
|
546
546
|
q(Z, h?.leaderBoard, !0);
|
|
547
547
|
}).catch((c) => {
|
|
@@ -561,7 +561,7 @@ function Dt(se, $) {
|
|
|
561
561
|
return r.push(1), i <= 3 ? (r.push(2, 3), r.push("..."), r.push(t)) : i >= t - 2 ? (r.push("..."), r.push(t - 2, t - 1, t)) : (r.push("..."), r.push(i - 1, i, i + 1), r.push("..."), r.push(t)), r;
|
|
562
562
|
}), me = Qe(() => Math.floor(l(U) / l(B)) + 1);
|
|
563
563
|
let ye = /* @__PURE__ */ new Map(), He = Qe(() => ye.get(l(me)) ?? []);
|
|
564
|
-
const
|
|
564
|
+
const Ee = (t, i) => {
|
|
565
565
|
const r = [];
|
|
566
566
|
return i && r.push("PlayerRow"), t === 1 && r.push("Gold"), t === 2 && r.push("Silver"), t === 3 && r.push("Bronze"), r.join(" ");
|
|
567
567
|
};
|
|
@@ -570,22 +570,22 @@ function Dt(se, $) {
|
|
|
570
570
|
}));
|
|
571
571
|
var ee = {
|
|
572
572
|
get endpoint() {
|
|
573
|
-
return
|
|
573
|
+
return k();
|
|
574
574
|
},
|
|
575
575
|
set endpoint(t) {
|
|
576
|
-
|
|
576
|
+
k(t), Ne();
|
|
577
577
|
},
|
|
578
578
|
get language() {
|
|
579
|
-
return
|
|
579
|
+
return K();
|
|
580
580
|
},
|
|
581
581
|
set language(t = "en") {
|
|
582
|
-
|
|
582
|
+
K(t), Ne();
|
|
583
583
|
},
|
|
584
584
|
get session() {
|
|
585
|
-
return
|
|
585
|
+
return J();
|
|
586
586
|
},
|
|
587
587
|
set session(t) {
|
|
588
|
-
|
|
588
|
+
J(t), Ne();
|
|
589
589
|
},
|
|
590
590
|
get tournamentid() {
|
|
591
591
|
return Q();
|
|
@@ -601,7 +601,7 @@ function Dt(se, $) {
|
|
|
601
601
|
}
|
|
602
602
|
}, te = Lt(), le = p(te);
|
|
603
603
|
{
|
|
604
|
-
var
|
|
604
|
+
var Pe = (t) => {
|
|
605
605
|
var i = xt(), r = p(i), c = p(r), h = p(c, !0);
|
|
606
606
|
f(c);
|
|
607
607
|
var s = A(c, 2), u = p(s, !0);
|
|
@@ -611,25 +611,25 @@ function Dt(se, $) {
|
|
|
611
611
|
var g = A(r, 2), y = p(g);
|
|
612
612
|
{
|
|
613
613
|
var S = (w) => {
|
|
614
|
-
var m = jt(),
|
|
615
|
-
f(
|
|
616
|
-
var ae = A(
|
|
614
|
+
var m = jt(), E = De(m), _ = p(E);
|
|
615
|
+
f(E);
|
|
616
|
+
var ae = A(E, 2), G = p(ae, !0);
|
|
617
617
|
f(ae);
|
|
618
|
-
var Se = A(ae, 2),
|
|
618
|
+
var Se = A(ae, 2), Ke = p(Se, !0);
|
|
619
619
|
f(Se), ve(() => {
|
|
620
|
-
R(_, `${l(Z).rank ?? ""}.`), R(G, l(Z).score), R(
|
|
620
|
+
R(_, `${l(Z).rank ?? ""}.`), R(G, l(Z).score), R(Ke, l(Z).prizeName || "-");
|
|
621
621
|
}), L(w, m);
|
|
622
622
|
}, X = (w) => {
|
|
623
|
-
var m = _t(),
|
|
624
|
-
f(m), ve((_) => R(
|
|
623
|
+
var m = _t(), E = p(m, !0);
|
|
624
|
+
f(m), ve((_) => R(E, _), [() => b()("notEnrolledRank")]), L(w, m);
|
|
625
625
|
};
|
|
626
626
|
je(y, (w) => {
|
|
627
627
|
l(Z) ? w(S) : w(X, !1);
|
|
628
628
|
});
|
|
629
629
|
}
|
|
630
630
|
f(g), f(i), ve(
|
|
631
|
-
(w, m,
|
|
632
|
-
R(h, w), R(u, m), R(x,
|
|
631
|
+
(w, m, E) => {
|
|
632
|
+
R(h, w), R(u, m), R(x, E);
|
|
633
633
|
},
|
|
634
634
|
[
|
|
635
635
|
() => b()("myRanking"),
|
|
@@ -642,7 +642,7 @@ function Dt(se, $) {
|
|
|
642
642
|
L(t, i);
|
|
643
643
|
};
|
|
644
644
|
je(le, (t) => {
|
|
645
|
-
l(_e) ? t(re, !1) : t(
|
|
645
|
+
l(_e) ? t(re, !1) : t(Pe);
|
|
646
646
|
});
|
|
647
647
|
}
|
|
648
648
|
var be = A(le, 2), xe = p(be), Me = p(xe), Re = p(Me), Ge = p(Re, !0);
|
|
@@ -658,7 +658,7 @@ function Dt(se, $) {
|
|
|
658
658
|
var ze = (t) => {
|
|
659
659
|
var i = Xe(), r = De(i);
|
|
660
660
|
Ye(r, 17, () => Array(l(B)), tt, (c, h, s, u) => {
|
|
661
|
-
var j =
|
|
661
|
+
var j = kt();
|
|
662
662
|
L(c, j);
|
|
663
663
|
}), L(t, i);
|
|
664
664
|
}, e = (t) => {
|
|
@@ -667,24 +667,24 @@ function Dt(se, $) {
|
|
|
667
667
|
var c = (s) => {
|
|
668
668
|
var u = Xe(), j = De(u);
|
|
669
669
|
Ye(j, 17, () => l(He), (x) => x.rank, (x, g) => {
|
|
670
|
-
var y =
|
|
670
|
+
var y = Et(), S = p(y), X = p(S);
|
|
671
671
|
f(S);
|
|
672
672
|
var w = A(S), m = p(w, !0);
|
|
673
673
|
f(w);
|
|
674
|
-
var
|
|
675
|
-
f(
|
|
676
|
-
var ae = A(
|
|
674
|
+
var E = A(w), _ = p(E, !0);
|
|
675
|
+
f(E);
|
|
676
|
+
var ae = A(E), G = p(ae, !0);
|
|
677
677
|
f(ae), f(y), ve(
|
|
678
678
|
(Se) => {
|
|
679
679
|
rt(y, 1, Se, "svelte-75jgrh"), R(X, `${l(g).rank ?? ""}.`), R(m, l(g).shortName || "-"), R(_, l(g).score || "-"), R(G, l(g).prizeName || "-");
|
|
680
680
|
},
|
|
681
681
|
[
|
|
682
|
-
() => yt(
|
|
682
|
+
() => yt(Ee(l(g).rank, l(g).rank === l(Z)?.rank))
|
|
683
683
|
]
|
|
684
684
|
), L(x, y);
|
|
685
685
|
}), L(s, u);
|
|
686
686
|
}, h = (s) => {
|
|
687
|
-
var u =
|
|
687
|
+
var u = Pt(), j = p(u), x = p(j), g = p(x), y = p(g, !0);
|
|
688
688
|
f(g), f(x), f(j), f(u), ve((S) => R(y, S), [() => b()("emptyLeaderboard")]), L(s, u);
|
|
689
689
|
};
|
|
690
690
|
je(
|
|
@@ -728,11 +728,11 @@ function Dt(se, $) {
|
|
|
728
728
|
L(w, m);
|
|
729
729
|
}, X = (w) => {
|
|
730
730
|
var m = Ct();
|
|
731
|
-
let
|
|
731
|
+
let E;
|
|
732
732
|
m.__click = () => ge(l(x));
|
|
733
733
|
var _ = p(m, !0);
|
|
734
734
|
f(m), ve(() => {
|
|
735
|
-
|
|
735
|
+
E = rt(m, 1, "PaginationButton Number svelte-75jgrh", null, E, { Active: l(x) === l(me) }), R(_, l(x));
|
|
736
736
|
}), L(w, m);
|
|
737
737
|
};
|
|
738
738
|
je(y, (w) => {
|
package/components/{TournamentLeaderboard-m4CZolTW.cjs → TournamentLeaderboard-D9naoaD9.cjs}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./TournamentDetails-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./TournamentDetails-C-zS8XGk.cjs");function Ue(ee,M){e.addMessages(ee,M)}function He(ee){e.$locale.set(ee)}const Me={en:{rank:"Rank",user:"User",points:"Points",prize:"Prize",notEnrolledRank:"You are currently not enrolled in this torunament",myRanking:"My Ranking",showMore:"Show More",showLess:"Show Less",emptyLeaderboard:"Currently there are no players enrolled in this tournament",joinButton:"Join",previousButton:"Previous",nextButton:"Next"},tr:{rank:"Sıralama",user:"Kullanıcı",points:"Puan",prize:"Ödül",notEnrolledRank:"Şu anda bu turnuvaya kayıtlı değilsiniz",myRanking:"Sıralamam",showMore:"Daha Fazla Göster",showLess:"Daha Az Göster",emptyLeaderboard:"Şu anda bu turnuvaya kayıtlı oyuncu bulunmuyor",joinButton:"Katıl",previousButton:"Önceki",nextButton:"Sonraki"}};var Ie={exports:{}};/** @license
|
|
2
2
|
* eventsource.js
|
|
3
3
|
* Available under MIT License (MIT)
|
|
4
4
|
* https://github.com/Yaffle/EventSource/
|
|
5
5
|
*/(function(ee,M){(function(y){var z=y.setTimeout,te=y.clearTimeout,j=y.XMLHttpRequest,U=y.XDomainRequest,X=y.ActiveXObject,q=y.EventSource,C=y.document,Ne=y.Promise,A=y.fetch,oe=y.Response,W=y.TextDecoder,fe=y.TextEncoder,G=y.AbortController;if(typeof window!="undefined"&&typeof C!="undefined"&&!("readyState"in C)&&C.body==null&&(C.readyState="loading",window.addEventListener("load",function(t){C.readyState="complete"},!1)),j==null&&X!=null&&(j=function(){return new X("Microsoft.XMLHTTP")}),Object.create==null&&(Object.create=function(t){function o(){}return o.prototype=t,new o}),Date.now||(Date.now=function(){return new Date().getTime()}),G==null){var O=A;A=function(t,o){var i=o.signal;return O(t,{headers:o.headers,credentials:o.credentials,cache:o.cache}).then(function(a){var h=a.body.getReader();return i._reader=h,i._aborted&&i._reader.cancel(),{status:a.status,statusText:a.statusText,headers:a.headers,body:{getReader:function(){return h}}}})},G=function(){this.signal={_reader:null,_aborted:!1},this.abort=function(){this.signal._reader!=null&&this.signal._reader.cancel(),this.signal._aborted=!0}}}function N(){this.bitsNeeded=0,this.codePoint=0}N.prototype.decode=function(t){function o(c,f,s){if(s===1)return c>=128>>f&&c<<f<=2047;if(s===2)return c>=2048>>f&&c<<f<=55295||c>=57344>>f&&c<<f<=65535;if(s===3)return c>=65536>>f&&c<<f<=1114111;throw new Error}function i(c,f){if(c===6*1)return f>>6>15?3:f>31?2:1;if(c===6*2)return f>15?3:2;if(c===6*3)return 3;throw new Error}for(var a=65533,h="",d=this.bitsNeeded,r=this.codePoint,l=0;l<t.length;l+=1){var n=t[l];d!==0&&(n<128||n>191||!o(r<<6|n&63,d-6,i(d,r)))&&(d=0,r=a,h+=String.fromCharCode(r)),d===0?(n>=0&&n<=127?(d=0,r=n):n>=192&&n<=223?(d=6*1,r=n&31):n>=224&&n<=239?(d=6*2,r=n&15):n>=240&&n<=247?(d=6*3,r=n&7):(d=0,r=a),d!==0&&!o(r,d,i(d,r))&&(d=0,r=a)):(d-=6,r=r<<6|n&63),d===0&&(r<=65535?h+=String.fromCharCode(r):(h+=String.fromCharCode(55296+(r-65535-1>>10)),h+=String.fromCharCode(56320+(r-65535-1&1023))))}return this.bitsNeeded=d,this.codePoint=r,h};var se=function(){try{return new W().decode(new fe().encode("test"),{stream:!0})==="test"}catch(t){console.debug("TextDecoder does not support streaming option. Using polyfill instead: "+t)}return!1};(W==null||fe==null||!se())&&(W=N);var R=function(){};function B(t){this.withCredentials=!1,this.readyState=0,this.status=0,this.statusText="",this.responseText="",this.onprogress=R,this.onload=R,this.onerror=R,this.onreadystatechange=R,this._contentType="",this._xhr=t,this._sendTimeout=0,this._abort=R}B.prototype.open=function(t,o){this._abort(!0);var i=this,a=this._xhr,h=1,d=0;this._abort=function(s){i._sendTimeout!==0&&(te(i._sendTimeout),i._sendTimeout=0),(h===1||h===2||h===3)&&(h=4,a.onload=R,a.onerror=R,a.onabort=R,a.onprogress=R,a.onreadystatechange=R,a.abort(),d!==0&&(te(d),d=0),s||(i.readyState=4,i.onabort(null),i.onreadystatechange())),h=0};var r=function(){if(h===1){var s=0,v="",m=void 0;if("contentType"in a)s=200,v="OK",m=a.contentType;else try{s=a.status,v=a.statusText,m=a.getResponseHeader("Content-Type")}catch(w){s=0,v="",m=void 0}s!==0&&(h=2,i.readyState=2,i.status=s,i.statusText=v,i._contentType=m,i.onreadystatechange())}},l=function(){if(r(),h===2||h===3){h=3;var s="";try{s=a.responseText}catch(v){}i.readyState=3,i.responseText=s,i.onprogress()}},n=function(s,v){if((v==null||v.preventDefault==null)&&(v={preventDefault:R}),l(),h===1||h===2||h===3){if(h=4,d!==0&&(te(d),d=0),i.readyState=4,s==="load")i.onload(v);else if(s==="error")i.onerror(v);else if(s==="abort")i.onabort(v);else throw new TypeError;i.onreadystatechange()}},c=function(s){a!=null&&(a.readyState===4?(!("onload"in a)||!("onerror"in a)||!("onabort"in a))&&n(a.responseText===""?"error":"load",s):a.readyState===3?"onprogress"in a||l():a.readyState===2&&r())},f=function(){d=z(function(){f()},500),a.readyState===3&&l()};"onload"in a&&(a.onload=function(s){n("load",s)}),"onerror"in a&&(a.onerror=function(s){n("error",s)}),"onabort"in a&&(a.onabort=function(s){n("abort",s)}),"onprogress"in a&&(a.onprogress=l),"onreadystatechange"in a&&(a.onreadystatechange=function(s){c(s)}),("contentType"in a||!("ontimeout"in j.prototype))&&(o+=(o.indexOf("?")===-1?"?":"&")+"padding=true"),a.open(t,o,!0),"readyState"in a&&(d=z(function(){f()},0))},B.prototype.abort=function(){this._abort(!1)},B.prototype.getResponseHeader=function(t){return this._contentType},B.prototype.setRequestHeader=function(t,o){var i=this._xhr;"setRequestHeader"in i&&i.setRequestHeader(t,o)},B.prototype.getAllResponseHeaders=function(){return this._xhr.getAllResponseHeaders!=null&&this._xhr.getAllResponseHeaders()||""},B.prototype.send=function(){if((!("ontimeout"in j.prototype)||!("sendAsBinary"in j.prototype)&&!("mozAnon"in j.prototype))&&C!=null&&C.readyState!=null&&C.readyState!=="complete"){var t=this;t._sendTimeout=z(function(){t._sendTimeout=0,t.send()},4);return}var o=this._xhr;"withCredentials"in o&&(o.withCredentials=this.withCredentials);try{o.send(void 0)}catch(i){throw i}};function Se(t){return t.replace(/[A-Z]/g,function(o){return String.fromCharCode(o.charCodeAt(0)+32)})}function ie(t){for(var o=Object.create(null),i=t.split(`\r
|
|
6
|
-
`),a=0;a<i.length;a+=1){var h=i[a],d=h.split(": "),r=d.shift(),l=d.join(": ");o[Se(r)]=l}this._map=o}ie.prototype.get=function(t){return this._map[Se(t)]},j!=null&&j.HEADERS_RECEIVED==null&&(j.HEADERS_RECEIVED=2);function ke(){}ke.prototype.open=function(t,o,i,a,h,d,r){t.open("GET",h);var l=0;t.onprogress=function(){var c=t.responseText,f=c.slice(l);l+=f.length,i(f)},t.onerror=function(c){c.preventDefault(),a(new Error("NetworkError"))},t.onload=function(){a(null)},t.onabort=function(){a(null)},t.onreadystatechange=function(){if(t.readyState===j.HEADERS_RECEIVED){var c=t.status,f=t.statusText,s=t.getResponseHeader("Content-Type"),v=t.getAllResponseHeaders();o(c,f,s,new ie(v))}},t.withCredentials=d;for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.setRequestHeader(n,r[n]);return t.send(),t};function Ee(t){this._headers=t}Ee.prototype.get=function(t){return this._headers.get(t)};function Pe(){}Pe.prototype.open=function(t,o,i,a,h,d,r){var l=null,n=new G,c=n.signal,f=new W;return A(h,{headers:r,credentials:d?"include":"same-origin",signal:c,cache:"no-store"}).then(function(s){return l=s.body.getReader(),o(s.status,s.statusText,s.headers.get("Content-Type"),new Ee(s.headers)),new Ne(function(v,m){var w=function(){l.read().then(function(u){if(u.done)v(void 0);else{var p=f.decode(u.value,{stream:!0});i(p),w()}}).catch(function(u){m(u)})};w()})}).catch(function(s){if(s.name!=="AbortError")return s}).then(function(s){a(s)}),{abort:function(){l!=null&&l.cancel(),n.abort()}}};function le(){this._listeners=Object.create(null)}function Re(t){z(function(){throw t},0)}le.prototype.dispatchEvent=function(t){t.target=this;var o=this._listeners[t.type];if(o!=null)for(var i=o.length,a=0;a<i;a+=1){var h=o[a];try{typeof h.handleEvent=="function"?h.handleEvent(t):h.call(this,t)}catch(d){Re(d)}}},le.prototype.addEventListener=function(t,o){t=String(t);var i=this._listeners,a=i[t];a==null&&(a=[],i[t]=a);for(var h=!1,d=0;d<a.length;d+=1)a[d]===o&&(h=!0);h||a.push(o)},le.prototype.removeEventListener=function(t,o){t=String(t);var i=this._listeners,a=i[t];if(a!=null){for(var h=[],d=0;d<a.length;d+=1)a[d]!==o&&h.push(a[d]);h.length===0?delete i[t]:i[t]=h}};function re(t){this.type=t,this.target=void 0}function de(t,o){re.call(this,t),this.data=o.data,this.lastEventId=o.lastEventId}de.prototype=Object.create(re.prototype);function ce(t,o){re.call(this,t),this.status=o.status,this.statusText=o.statusText,this.headers=o.headers}ce.prototype=Object.create(re.prototype);function Te(t,o){re.call(this,t),this.error=o.error}Te.prototype=Object.create(re.prototype);var me=-1,$=0,V=1,ne=2,ye=-1,
|
|
7
|
-
`,I+=Z):Y==="id"?b=Z:Y==="event"?g=Z:Y==="retry"?(d=we(Z,d),n=d):Y==="heartbeatTimeout"&&(r=we(Z,r),p!==0&&(te(p),p=z(function(){je()},r)))}if(_===
|
|
6
|
+
`),a=0;a<i.length;a+=1){var h=i[a],d=h.split(": "),r=d.shift(),l=d.join(": ");o[Se(r)]=l}this._map=o}ie.prototype.get=function(t){return this._map[Se(t)]},j!=null&&j.HEADERS_RECEIVED==null&&(j.HEADERS_RECEIVED=2);function ke(){}ke.prototype.open=function(t,o,i,a,h,d,r){t.open("GET",h);var l=0;t.onprogress=function(){var c=t.responseText,f=c.slice(l);l+=f.length,i(f)},t.onerror=function(c){c.preventDefault(),a(new Error("NetworkError"))},t.onload=function(){a(null)},t.onabort=function(){a(null)},t.onreadystatechange=function(){if(t.readyState===j.HEADERS_RECEIVED){var c=t.status,f=t.statusText,s=t.getResponseHeader("Content-Type"),v=t.getAllResponseHeaders();o(c,f,s,new ie(v))}},t.withCredentials=d;for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.setRequestHeader(n,r[n]);return t.send(),t};function Ee(t){this._headers=t}Ee.prototype.get=function(t){return this._headers.get(t)};function Pe(){}Pe.prototype.open=function(t,o,i,a,h,d,r){var l=null,n=new G,c=n.signal,f=new W;return A(h,{headers:r,credentials:d?"include":"same-origin",signal:c,cache:"no-store"}).then(function(s){return l=s.body.getReader(),o(s.status,s.statusText,s.headers.get("Content-Type"),new Ee(s.headers)),new Ne(function(v,m){var w=function(){l.read().then(function(u){if(u.done)v(void 0);else{var p=f.decode(u.value,{stream:!0});i(p),w()}}).catch(function(u){m(u)})};w()})}).catch(function(s){if(s.name!=="AbortError")return s}).then(function(s){a(s)}),{abort:function(){l!=null&&l.cancel(),n.abort()}}};function le(){this._listeners=Object.create(null)}function Re(t){z(function(){throw t},0)}le.prototype.dispatchEvent=function(t){t.target=this;var o=this._listeners[t.type];if(o!=null)for(var i=o.length,a=0;a<i;a+=1){var h=o[a];try{typeof h.handleEvent=="function"?h.handleEvent(t):h.call(this,t)}catch(d){Re(d)}}},le.prototype.addEventListener=function(t,o){t=String(t);var i=this._listeners,a=i[t];a==null&&(a=[],i[t]=a);for(var h=!1,d=0;d<a.length;d+=1)a[d]===o&&(h=!0);h||a.push(o)},le.prototype.removeEventListener=function(t,o){t=String(t);var i=this._listeners,a=i[t];if(a!=null){for(var h=[],d=0;d<a.length;d+=1)a[d]!==o&&h.push(a[d]);h.length===0?delete i[t]:i[t]=h}};function re(t){this.type=t,this.target=void 0}function de(t,o){re.call(this,t),this.data=o.data,this.lastEventId=o.lastEventId}de.prototype=Object.create(re.prototype);function ce(t,o){re.call(this,t),this.status=o.status,this.statusText=o.statusText,this.headers=o.headers}ce.prototype=Object.create(re.prototype);function Te(t,o){re.call(this,t),this.error=o.error}Te.prototype=Object.create(re.prototype);var me=-1,$=0,V=1,ne=2,ye=-1,K=0,he=1,ue=2,Ce=3,be=/^text\/event\-stream(;.*)?$/i,De=1e3,_e=18e6,we=function(t,o){var i=t==null?o:parseInt(t,10);return i!==i&&(i=o),ve(i)},ve=function(t){return Math.min(Math.max(t,De),_e)},ae=function(t,o,i){try{typeof o=="function"&&o.call(t,i)}catch(a){Re(a)}};function L(t,o){le.call(this),o=o||{},this.onopen=void 0,this.onmessage=void 0,this.onerror=void 0,this.url=void 0,this.readyState=void 0,this.withCredentials=void 0,this.headers=void 0,this._close=void 0,Oe(this,t,o)}function Fe(){return j!=null&&"withCredentials"in j.prototype||U==null?new j:new U}var Ae=A!=null&&oe!=null&&"body"in oe.prototype;function Oe(t,o,i){o=String(o);var a=!!i.withCredentials,h=i.lastEventIdQueryParameterName||"lastEventId",d=ve(1e3),r=we(i.heartbeatTimeout,45e3),l="",n=d,c=!1,f=0,s=i.headers||{},v=i.Transport,m=Ae&&v==null?void 0:new B(v!=null?new v:Fe()),w=v!=null&&typeof v!="string"?new v:m==null?new Pe:new ke,u=void 0,p=0,x=me,I="",b="",g="",S="",_=K,J=0,H=0,Q=function(E,k,D,F){if(x===$)if(E===200&&D!=null&&be.test(D)){x=V,c=Date.now(),n=d,t.readyState=V;var T=new ce("open",{status:E,statusText:k,headers:F});t.dispatchEvent(T),ae(t,t.onopen,T)}else{var P="";E!==200?(k&&(k=k.replace(/\s+/g," ")),P="EventSource's response has a status "+E+" "+k+" that is not 200. Aborting the connection."):P="EventSource's response has a Content-Type specifying an unsupported type: "+(D==null?"-":D.replace(/\s+/g," "))+". Aborting the connection.",Be();var T=new ce("error",{status:E,statusText:k,headers:F});t.dispatchEvent(T),ae(t,t.onerror,T),console.error(P)}},pe=function(E){if(x===V){for(var k=-1,D=0;D<E.length;D+=1){var F=E.charCodeAt(D);(F===10||F===13)&&(k=D)}var T=(k!==-1?S:"")+E.slice(0,k+1);S=(k===-1?S:"")+E.slice(k+1),E!==""&&(c=Date.now(),f+=E.length);for(var P=0;P<T.length;P+=1){var F=T.charCodeAt(P);if(_===ye&&F===10)_=K;else if(_===ye&&(_=K),F===13||F===10){if(_!==K){_===he&&(H=P+1);var Y=T.slice(J,H-1),Z=T.slice(H+(H<P&&T.charCodeAt(H)===32?1:0),P);Y==="data"?(I+=`
|
|
7
|
+
`,I+=Z):Y==="id"?b=Z:Y==="event"?g=Z:Y==="retry"?(d=we(Z,d),n=d):Y==="heartbeatTimeout"&&(r=we(Z,r),p!==0&&(te(p),p=z(function(){je()},r)))}if(_===K){if(I!==""){l=b,g===""&&(g="message");var ge=new de(g,{data:I.slice(1),lastEventId:b});if(t.dispatchEvent(ge),g==="open"?ae(t,t.onopen,ge):g==="message"?ae(t,t.onmessage,ge):g==="error"&&ae(t,t.onerror,ge),x===ne)return}I="",g=""}_=F===13?ye:K}else _===K&&(J=P,_=he),_===he?F===58&&(H=P+1,_=ue):_===ue&&(_=Ce)}}},xe=function(E){if(x===V||x===$){x=me,p!==0&&(te(p),p=0),p=z(function(){je()},n),n=ve(Math.min(d*16,n*2)),t.readyState=$;var k=new Te("error",{error:E});t.dispatchEvent(k),ae(t,t.onerror,k),E!=null&&console.error(E)}},Be=function(){x=ne,u!=null&&(u.abort(),u=void 0),p!==0&&(te(p),p=0),t.readyState=ne},je=function(){if(p=0,x!==me){if(!c&&u!=null)xe(new Error("No activity within "+r+" milliseconds. "+(x===$?"No response received.":f+" chars received.")+" Reconnecting.")),u!=null&&(u.abort(),u=void 0);else{var E=Math.max((c||Date.now())+r-Date.now(),1);c=!1,p=z(function(){je()},E)}return}c=!1,f=0,p=z(function(){je()},r),x=$,I="",g="",b=l,S="",J=0,H=0,_=K;var k=o;if(o.slice(0,5)!=="data:"&&o.slice(0,5)!=="blob:"&&l!==""){var D=o.indexOf("?");k=D===-1?o:o.slice(0,D+1)+o.slice(D+1).replace(/(?:^|&)([^=&]*)(?:=[^&]*)?/g,function(Z,ge){return ge===h?"":Z}),k+=(o.indexOf("?")===-1?"?":"&")+h+"="+encodeURIComponent(l)}var F=t.withCredentials,T={};T.Accept="text/event-stream";var P=t.headers;if(P!=null)for(var Y in P)Object.prototype.hasOwnProperty.call(P,Y)&&(T[Y]=P[Y]);try{u=w.open(m,Q,pe,xe,k,F,T)}catch(Z){throw Be(),Z}};t.url=o,t.readyState=$,t.withCredentials=a,t.headers=s,t._close=Be,je()}L.prototype=Object.create(le.prototype),L.prototype.CONNECTING=$,L.prototype.OPEN=V,L.prototype.CLOSED=ne,L.prototype.close=function(){this._close()},L.CONNECTING=$,L.OPEN=V,L.CLOSED=ne,L.prototype.withCredentials=void 0;var Le=q;j!=null&&(q==null||!("withCredentials"in q.prototype))&&(Le=L),function(t){{var o=t(M);o!==void 0&&(ee.exports=o)}}(function(t){t.EventSourcePolyfill=L,t.NativeEventSource=q,t.EventSource=Le})})(typeof globalThis=="undefined"?typeof window!="undefined"?window:typeof self!="undefined"?self:e.commonjsGlobal:globalThis)})(Ie,Ie.exports);var Xe=Ie.exports,qe=e.from_html('<span class="svelte-75jgrh"> </span> <span class="svelte-75jgrh"> </span> <span class="svelte-75jgrh"> </span>',1),We=e.from_html('<p class="svelte-75jgrh"> </p>'),Ge=e.from_html('<div class="PlayerRankWrapper svelte-75jgrh"><div class="PlayerRankLabels svelte-75jgrh"><span class="svelte-75jgrh"> </span> <span class="svelte-75jgrh"> </span> <span class="svelte-75jgrh"> </span></div> <div class="PlayerRankData svelte-75jgrh"><!></div></div>'),$e=e.from_html('<div class="PlayerRankSkeletonWrapper svelte-75jgrh"><div class="PlayerRankSkeleton svelte-75jgrh"><div class="SkeletonShimmer svelte-75jgrh"></div></div> <div class="PlayerRankSkeleton svelte-75jgrh"><div class="SkeletonShimmer svelte-75jgrh"></div></div></div>'),Ve=e.from_html('<tr class="SkeletonRow svelte-75jgrh"><td colspan="4" class="SkeletonShimmer svelte-75jgrh"><div class="svelte-75jgrh"></div></td></tr>'),Ke=e.from_html('<tr><td class="svelte-75jgrh"> </td><td class="svelte-75jgrh"> </td><td class="svelte-75jgrh"> </td><td class="svelte-75jgrh"> </td></tr>'),Je=e.from_html('<tr class="svelte-75jgrh"><td colspan="4" class="svelte-75jgrh"><div class="EmptyLeaderboard svelte-75jgrh"><p class="svelte-75jgrh"> </p></div></td></tr>'),Qe=e.from_html('<div class="PaginationSkeleton svelte-75jgrh"><div class="PaginationSkeletonButton svelte-75jgrh"><div class="SkeletonShimmer svelte-75jgrh"></div></div> <div class="PaginationNumberSkeleton svelte-75jgrh"><div class="SkeletonShimmer svelte-75jgrh"></div></div> <div class="PaginationNumberSkeleton svelte-75jgrh"><div class="SkeletonShimmer svelte-75jgrh"></div></div> <div class="PaginationNumberSkeleton svelte-75jgrh"><div class="SkeletonShimmer svelte-75jgrh"></div></div> <div class="PaginationNumberSkeleton svelte-75jgrh"><div class="SkeletonShimmer svelte-75jgrh"></div></div> <div class="PaginationNumberSkeleton svelte-75jgrh"><div class="SkeletonShimmer svelte-75jgrh"></div></div> <div class="PaginationSkeletonButton svelte-75jgrh"><div class="SkeletonShimmer svelte-75jgrh"></div></div></div>'),Ye=e.from_html('<span class="PaginationButton Elipsis svelte-75jgrh">...</span>'),Ze=e.from_html("<button> </button>"),et=e.from_html('<div class="PaginationWrapper svelte-75jgrh"><button class="PaginationButton svelte-75jgrh"> </button> <div class="PageNumberWrapper svelte-75jgrh"></div> <button class="PaginationButton svelte-75jgrh"> </button></div>'),tt=e.from_html('<div class="LeaderboardWrapper svelte-75jgrh"><!> <table class="LeaderboardTable svelte-75jgrh"><thead class="LeaderboardTableHeader svelte-75jgrh"><tr class="svelte-75jgrh"><th class="svelte-75jgrh"> </th><th class="svelte-75jgrh"> </th><th class="svelte-75jgrh"> </th><th class="svelte-75jgrh"> </th></tr></thead><tbody class="LeaderboardTableBody svelte-75jgrh"><!></tbody></table> <!> <!></div>');const rt={hash:"svelte-75jgrh",code:`.svelte-75jgrh,
|
|
8
8
|
.svelte-75jgrh::before,
|
|
9
9
|
.svelte-75jgrh::after {margin:0;padding:0;list-style:none;text-decoration:none;outline:none;box-sizing:border-box;font-family:inherit;}.LeaderboardWrapper.svelte-75jgrh {background-color:var(--emw-color-bg-secondary, #333232);border-radius:6px;padding:16px;overflow:hidden;}.PlayerRankWrapper.svelte-75jgrh {display:flex;flex-direction:column;gap:5px;margin-top:20px;.PlayerRankLabels:where(.svelte-75jgrh), .PlayerRankData:where(.svelte-75jgrh) {display:grid;grid-template-columns:1fr 1fr 2fr;padding:6px;color:var(--emw-color-typography-secondary, #bdbdbd);font-size:14px;font-weight:400;& > span:where(.svelte-75jgrh):last-child{justify-self:end;}p:where(.svelte-75jgrh) {width:max-content;}}.PlayerRankData:where(.svelte-75jgrh) {background-color:var(--emw-color-bg-section, #434343);color:var(--emw-color-typography, #ffffff);border-radius:6px;padding:12px;}}.PaginationWrapper.svelte-75jgrh {display:flex;justify-content:space-between;.PageNumberWrapper:where(.svelte-75jgrh) {display:flex;gap:6px;}.PaginationButton:where(.svelte-75jgrh) {background-color:var(--emw-color-bg-section, #434343);color:var(--emw-color-typography, #ffffff);border-radius:6px;border:none;outline:none;padding:10px;width:auto;cursor:pointer;&.Number {background-color:transparent;min-width:0;padding:0 10px;}&:hover {background-color:var(--emw-color-bg-elements, #4A4A4A);cursor:pointer;}&:active {transform:scale(0.9);}&:disabled {opacity:60%;pointer-events:none;}&.Active {background-color:var(--emw-color-bg-elements, #4A4A4A);}&.Elipsis {pointer-events:none;background-color:transparent;min-width:0;padding:0;align-self:center;}}}.LeaderboardTable.svelte-75jgrh {border-collapse:separate;border-spacing:0 12px;width:100%;table-layout:fixed;overflow:hidden;.PlayerRow:where(.svelte-75jgrh) {color:#F9C408;}thead:where(.svelte-75jgrh) th:where(.svelte-75jgrh) {background:transparent;padding:6px 16px;text-align:center;font-weight:400;color:var(--emw-color-typography-secondary, #bdbdbd);font-size:14px;}tbody:where(.svelte-75jgrh) tr:where(.svelte-75jgrh) {background-color:var(--emw-color-bg-section, #434343);color:var(--emw-color-typography-secondary, #bdbdbd);font-size:14px;font-weight:500;&:last-child{justify-self:end;}}tbody:where(.svelte-75jgrh) td:where(.svelte-75jgrh) {padding:12px;background-color:inherit;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}tbody:where(.svelte-75jgrh) td:where(.svelte-75jgrh):first-child {border-top-left-radius:8px;border-bottom-left-radius:8px;width:15%;}tbody:where(.svelte-75jgrh) td:where(.svelte-75jgrh):nth-child(2) {width:35%;}tbody:where(.svelte-75jgrh) td:where(.svelte-75jgrh):nth-child(3) {width:20%;}tbody:where(.svelte-75jgrh) td:where(.svelte-75jgrh):last-child {border-top-right-radius:8px;border-bottom-right-radius:8px;width:30%;}th:where(.svelte-75jgrh), td:where(.svelte-75jgrh) {text-align:center;vertical-align:middle;}tbody:where(.svelte-75jgrh) tr.Gold:where(.svelte-75jgrh){background:linear-gradient(to right, #a2851a, color-mix(in srgb, #a2851a 50%, var(--emw-color-bg-secondary, #434343) 50%), var(--emw-color-bg-secondary, #434343));}tbody:where(.svelte-75jgrh) tr.Silver:where(.svelte-75jgrh) {background:linear-gradient(to right, #b0aeae, color-mix(in srgb, #b0aeae, var(--emw-color-bg-secondary, #434343)), var(--emw-color-bg-secondary, #434343));}tbody:where(.svelte-75jgrh) tr.Bronze:where(.svelte-75jgrh) {background:linear-gradient(to right, #ac763c, color-mix(in srgb, #ac763c, var(--emw-color-bg-secondary, #434343)), var(--emw-color-bg-secondary, #434343));}}.EmptyLeaderboard.svelte-75jgrh {background-color:var(--emw-color-bg-secondary, #333232);color:var(--emw-color-typography-secondary, #bdbdbd);width:100%;border-radius:8px;margin:10px 0;text-align:center;padding:10px 0;}.SkeletonRow.svelte-75jgrh {height:41px;overflow:hidden;}.PlayerRankSkeletonWrapper.svelte-75jgrh {display:flex;justify-content:space-between;width:100%;gap:6px;flex-direction:column;.PlayerRankSkeleton:where(.svelte-75jgrh) {width:100%;height:40px;border-radius:6px;background-color:var(--emw-color-bg-secondary, #333232);border-radius:6px;}}.PaginationSkeleton.svelte-75jgrh {display:flex;justify-content:space-between;gap:6px;.PaginationSkeletonButton:where(.svelte-75jgrh) {width:60px;height:40px;border-radius:6px;background-color:var(--emw-color-skeleton, #333232);overflow:hidden;position:relative;}.PaginationNumberSkeleton:where(.svelte-75jgrh) {width:30px;height:40px;border-radius:6px;background-color:var(--emw-color-skeleton, #333232);overflow:hidden;position:relative;}}.SkeletonShimmer.svelte-75jgrh {width:100%;height:100%;background:linear-gradient(
|
|
10
10
|
90deg,
|
|
@@ -27,4 +27,4 @@
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
@media (min-width: 750px) {.PaginationWrapper.svelte-75jgrh, .PaginationSkeleton.svelte-75jgrh {justify-content:end;gap:10px;}.PaginationButton.svelte-75jgrh {min-width:75px;}.PaginationSkeleton.svelte-75jgrh {justify-content:end;gap:10px;.PaginationSkeletonButton:where(.svelte-75jgrh) {width:auto;min-width:55px;}.PaginationNumberSkeleton:where(.svelte-75jgrh) {width:25px;}}
|
|
30
|
-
}`};function ze(ee,M){e.push(M,!0),e.append_styles(ee,rt);const y=()=>e.store_get(e.$format,"$_",z),[z,te]=e.setup_stores(),j=e.prop(M,"endpoint"),U=e.prop(M,"language",7,"en"),X=e.prop(M,"session"),q=e.prop(M,"tournamentid"),C=e.prop(M,"platform");Object.keys(Me).forEach(r=>{Ue(r,Me[r])}),He(U());const Ne=()=>{He(U())};e.user_effect(()=>{Ne()});let A=null,oe=e.state(void 0),W=e.state(!1),fe=e.state(!1),G=e.state(void 0),O=e.state(0),N=e.state(10),se=e.state(void 0),R=e.state(void 0);const B=()=>{if(ce.has(e.get(de)))return;e.set(W,!0);const r=new URL(`${j()}/v1/tournaments/${q()}/leaderboard`),l=new Headers;X()&&l.append("X-SessionId",X()),r.searchParams.append("language",U()),r.searchParams.append("platform",C()),r.searchParams.append("pagination",`offset=${e.get(O)},limit=${e.get(N)}`),fetch(r).then(n=>n.json()).then(n=>{e.set(oe,n==null?void 0:n.items,!0),e.set(se,n==null?void 0:n.pages,!0),e.set(R,n==null?void 0:n.total,!0),ce.set(e.get(de),e.get(oe))}).catch(n=>console.log(n)).finally(()=>e.set(W,!1))},Se=r=>{const l=JSON.parse(r.data);l&&l.messageType==="LeaderBoardUpdate"&&e.set(oe,l==null?void 0:l.items,!0)},ie=()=>{A&&(A.close(),A=null);const r=new URL(`${j()}/v1/tournaments/${q()}/leaderboard/updates`);r.searchParams.append("HeartBeat","false"),r.searchParams.append("language",U()),r.searchParams.append("filter","includeUnqualifiedPlayer=true"),r.searchParams.append("pagination",`offset=${e.get(O)},limit=${e.get(N)}`),r.searchParams.append("platform",C()),A=new Xe.EventSourcePolyfill(r,{headers:{accept:"text/event-stream","X-SessionId":X()}}),A.onmessage=Se},ke=()=>{e.set(fe,!0);const r=new URL(`${j()}/v1/tournaments/leaderboard/player`),l=new Headers;r.searchParams.append("language",U()),r.searchParams.append("platform",C()),r.searchParams.append("filter","includeUnqualifiedPlayer=false"),X()&&l.append("X-SessionId",X()),fetch(r,{method:"GET",headers:l}).then(c=>c.json()).then(c=>{var s;const f=(s=c==null?void 0:c.items)==null?void 0:s.find(v=>{var m;return((m=v==null?void 0:v.tournament)==null?void 0:m.id)===q()});e.set(G,f==null?void 0:f.leaderBoard,!0)}).catch(c=>{console.log(c)}).finally(()=>e.set(fe,!1))},Ee=()=>{var r;(r=e.get(se))!=null&&r.next&&(e.set(O,e.get(O)+e.get(N)),B(),ie())},Pe=()=>{var r;(r=e.get(se))!=null&&r.previous&&e.get(O)!==0&&(e.set(O,e.get(O)-e.get(N)),B(),ie())},le=r=>{e.set(O,(r-1)*e.get(N)),B(),ie()},Re=()=>{const r=Math.ceil(e.get(R)/e.get(N)),l=Math.floor(e.get(O)/e.get(N))+1;if(r<=5)return Array.from({length:r},(c,f)=>f+1);const n=[];return n.push(1),l<=3?(n.push(2,3),n.push("..."),n.push(r)):l>=r-2?(n.push("..."),n.push(r-2,r-1,r)):(n.push("..."),n.push(l-1,l,l+1),n.push("..."),n.push(r)),n},re=e.user_derived(Re),de=e.user_derived(()=>Math.floor(e.get(O)/e.get(N))+1);let ce=new Map,Te=e.user_derived(()=>{var r;return(r=ce.get(e.get(de)))!=null?r:[]});const me=(r,l)=>{const n=[];return l&&n.push("PlayerRow"),r===1&&n.push("Gold"),r===2&&n.push("Silver"),r===3&&n.push("Bronze"),n.join(" ")};e.onMount(()=>(B(),ke(),ie(),()=>{A==null||A.close(),A=null}));var $={get endpoint(){return j()},set endpoint(r){j(r),e.flushSync()},get language(){return U()},set language(r="en"){U(r),e.flushSync()},get session(){return X()},set session(r){X(r),e.flushSync()},get tournamentid(){return q()},set tournamentid(r){q(r),e.flushSync()},get platform(){return C()},set platform(r){C(r),e.flushSync()}},V=tt(),ne=e.child(V);{var ye=r=>{var l=Ge(),n=e.child(l),c=e.child(n),f=e.child(c,!0);e.reset(c);var s=e.sibling(c,2),v=e.child(s,!0);e.reset(s);var m=e.sibling(s,2),w=e.child(m,!0);e.reset(m),e.reset(n);var u=e.sibling(n,2),p=e.child(u);{var x=b=>{var g=qe(),S=e.first_child(g),_=e.child(S);e.reset(S);var
|
|
30
|
+
}`};function ze(ee,M){e.push(M,!0),e.append_styles(ee,rt);const y=()=>e.store_get(e.$format,"$_",z),[z,te]=e.setup_stores(),j=e.prop(M,"endpoint"),U=e.prop(M,"language",7,"en"),X=e.prop(M,"session"),q=e.prop(M,"tournamentid"),C=e.prop(M,"platform");Object.keys(Me).forEach(r=>{Ue(r,Me[r])}),He(U());const Ne=()=>{He(U())};e.user_effect(()=>{Ne()});let A=null,oe=e.state(void 0),W=e.state(!1),fe=e.state(!1),G=e.state(void 0),O=e.state(0),N=e.state(10),se=e.state(void 0),R=e.state(void 0);const B=()=>{if(ce.has(e.get(de)))return;e.set(W,!0);const r=new URL(`${j()}/v1/tournaments/${q()}/leaderboard`),l=new Headers;X()&&l.append("X-SessionId",X()),r.searchParams.append("language",U()),r.searchParams.append("platform",C()),r.searchParams.append("pagination",`offset=${e.get(O)},limit=${e.get(N)}`),fetch(r).then(n=>n.json()).then(n=>{e.set(oe,n==null?void 0:n.items,!0),e.set(se,n==null?void 0:n.pages,!0),e.set(R,n==null?void 0:n.total,!0),ce.set(e.get(de),e.get(oe))}).catch(n=>console.log(n)).finally(()=>e.set(W,!1))},Se=r=>{const l=JSON.parse(r.data);l&&l.messageType==="LeaderBoardUpdate"&&e.set(oe,l==null?void 0:l.items,!0)},ie=()=>{A&&(A.close(),A=null);const r=new URL(`${j()}/v1/tournaments/${q()}/leaderboard/updates`);r.searchParams.append("HeartBeat","false"),r.searchParams.append("language",U()),r.searchParams.append("filter","includeUnqualifiedPlayer=true"),r.searchParams.append("pagination",`offset=${e.get(O)},limit=${e.get(N)}`),r.searchParams.append("platform",C()),A=new Xe.EventSourcePolyfill(r,{headers:{accept:"text/event-stream","X-SessionId":X()}}),A.onmessage=Se},ke=()=>{e.set(fe,!0);const r=new URL(`${j()}/v1/tournaments/leaderboard/player`),l=new Headers;r.searchParams.append("language",U()),r.searchParams.append("platform",C()),r.searchParams.append("filter","includeUnqualifiedPlayer=false"),X()&&l.append("X-SessionId",X()),fetch(r,{method:"GET",headers:l}).then(c=>c.json()).then(c=>{var s;const f=(s=c==null?void 0:c.items)==null?void 0:s.find(v=>{var m;return((m=v==null?void 0:v.tournament)==null?void 0:m.id)===q()});e.set(G,f==null?void 0:f.leaderBoard,!0)}).catch(c=>{console.log(c)}).finally(()=>e.set(fe,!1))},Ee=()=>{var r;(r=e.get(se))!=null&&r.next&&(e.set(O,e.get(O)+e.get(N)),B(),ie())},Pe=()=>{var r;(r=e.get(se))!=null&&r.previous&&e.get(O)!==0&&(e.set(O,e.get(O)-e.get(N)),B(),ie())},le=r=>{e.set(O,(r-1)*e.get(N)),B(),ie()},Re=()=>{const r=Math.ceil(e.get(R)/e.get(N)),l=Math.floor(e.get(O)/e.get(N))+1;if(r<=5)return Array.from({length:r},(c,f)=>f+1);const n=[];return n.push(1),l<=3?(n.push(2,3),n.push("..."),n.push(r)):l>=r-2?(n.push("..."),n.push(r-2,r-1,r)):(n.push("..."),n.push(l-1,l,l+1),n.push("..."),n.push(r)),n},re=e.user_derived(Re),de=e.user_derived(()=>Math.floor(e.get(O)/e.get(N))+1);let ce=new Map,Te=e.user_derived(()=>{var r;return(r=ce.get(e.get(de)))!=null?r:[]});const me=(r,l)=>{const n=[];return l&&n.push("PlayerRow"),r===1&&n.push("Gold"),r===2&&n.push("Silver"),r===3&&n.push("Bronze"),n.join(" ")};e.onMount(()=>(B(),ke(),ie(),()=>{A==null||A.close(),A=null}));var $={get endpoint(){return j()},set endpoint(r){j(r),e.flushSync()},get language(){return U()},set language(r="en"){U(r),e.flushSync()},get session(){return X()},set session(r){X(r),e.flushSync()},get tournamentid(){return q()},set tournamentid(r){q(r),e.flushSync()},get platform(){return C()},set platform(r){C(r),e.flushSync()}},V=tt(),ne=e.child(V);{var ye=r=>{var l=Ge(),n=e.child(l),c=e.child(n),f=e.child(c,!0);e.reset(c);var s=e.sibling(c,2),v=e.child(s,!0);e.reset(s);var m=e.sibling(s,2),w=e.child(m,!0);e.reset(m),e.reset(n);var u=e.sibling(n,2),p=e.child(u);{var x=b=>{var g=qe(),S=e.first_child(g),_=e.child(S);e.reset(S);var J=e.sibling(S,2),H=e.child(J,!0);e.reset(J);var Q=e.sibling(J,2),pe=e.child(Q,!0);e.reset(Q),e.template_effect(()=>{var xe;e.set_text(_,`${(xe=e.get(G).rank)!=null?xe:""}.`),e.set_text(H,e.get(G).score),e.set_text(pe,e.get(G).prizeName||"-")}),e.append(b,g)},I=b=>{var g=We(),S=e.child(g,!0);e.reset(g),e.template_effect(_=>e.set_text(S,_),[()=>y()("notEnrolledRank")]),e.append(b,g)};e.if_block(p,b=>{e.get(G)?b(x):b(I,!1)})}e.reset(u),e.reset(l),e.template_effect((b,g,S)=>{e.set_text(f,b),e.set_text(v,g),e.set_text(w,S)},[()=>y()("myRanking"),()=>y()("points"),()=>y()("prize")]),e.append(r,l)},K=r=>{var l=$e();e.append(r,l)};e.if_block(ne,r=>{e.get(fe)?r(K,!1):r(ye)})}var he=e.sibling(ne,2),ue=e.child(he),Ce=e.child(ue),be=e.child(Ce),De=e.child(be,!0);e.reset(be);var _e=e.sibling(be),we=e.child(_e,!0);e.reset(_e);var ve=e.sibling(_e),ae=e.child(ve,!0);e.reset(ve);var L=e.sibling(ve),Fe=e.child(L,!0);e.reset(L),e.reset(Ce),e.reset(ue);var Ae=e.sibling(ue),Oe=e.child(Ae);{var Le=r=>{var l=e.comment(),n=e.first_child(l);e.each(n,17,()=>Array(e.get(N)),e.index,(c,f,s,v)=>{var m=Ve();e.append(c,m)}),e.append(r,l)},t=r=>{var l=e.comment(),n=e.first_child(l);{var c=s=>{var v=e.comment(),m=e.first_child(v);e.each(m,17,()=>e.get(Te),w=>w.rank,(w,u)=>{var p=Ke(),x=e.child(p),I=e.child(x);e.reset(x);var b=e.sibling(x),g=e.child(b,!0);e.reset(b);var S=e.sibling(b),_=e.child(S,!0);e.reset(S);var J=e.sibling(S),H=e.child(J,!0);e.reset(J),e.reset(p),e.template_effect(Q=>{var pe;e.set_class(p,1,Q,"svelte-75jgrh"),e.set_text(I,`${(pe=e.get(u).rank)!=null?pe:""}.`),e.set_text(g,e.get(u).shortName||"-"),e.set_text(_,e.get(u).score||"-"),e.set_text(H,e.get(u).prizeName||"-")},[()=>{var Q;return e.clsx(me(e.get(u).rank,e.get(u).rank===((Q=e.get(G))==null?void 0:Q.rank)))}]),e.append(w,p)}),e.append(s,v)},f=s=>{var v=Je(),m=e.child(v),w=e.child(m),u=e.child(w),p=e.child(u,!0);e.reset(u),e.reset(w),e.reset(m),e.reset(v),e.template_effect(x=>e.set_text(p,x),[()=>y()("emptyLeaderboard")]),e.append(s,v)};e.if_block(n,s=>{var v;((v=e.get(oe))==null?void 0:v.length)>0?s(c):s(f,!1)},!0)}e.append(r,l)};e.if_block(Oe,r=>{e.get(W)?r(Le):r(t,!1)})}e.reset(Ae),e.reset(he);var o=e.sibling(he,2);{var i=r=>{var l=Qe();e.append(r,l)};e.if_block(o,r=>{e.get(W)&&r(i)})}var a=e.sibling(o,2);{var h=r=>{var l=et(),n=e.child(l);n.__click=Pe;var c=e.child(n,!0);e.reset(n);var f=e.sibling(n,2);e.each(f,21,()=>e.get(re),e.index,(m,w)=>{var u=e.comment(),p=e.first_child(u);{var x=b=>{var g=Ye();e.append(b,g)},I=b=>{var g=Ze();let S;g.__click=()=>le(e.get(w));var _=e.child(g,!0);e.reset(g),e.template_effect(()=>{S=e.set_class(g,1,"PaginationButton Number svelte-75jgrh",null,S,{Active:e.get(w)===e.get(de)}),e.set_text(_,e.get(w))}),e.append(b,g)};e.if_block(p,b=>{typeof e.get(w)!="number"?b(x):b(I,!1)})}e.append(m,u)}),e.reset(f);var s=e.sibling(f,2);s.__click=Ee;var v=e.child(s,!0);e.reset(s),e.reset(l),e.template_effect((m,w)=>{var u,p;n.disabled=!((u=e.get(se))!=null&&u.previous),e.set_text(c,m),s.disabled=!((p=e.get(se))!=null&&p.next),e.set_text(v,w)},[()=>y()("previousButton"),()=>y()("nextButton")]),e.append(r,l)};e.if_block(a,r=>{!e.get(W)&&e.get(R)>e.get(N)&&r(h)})}e.reset(V),e.template_effect((r,l,n,c)=>{e.set_text(De,r),e.set_text(we,l),e.set_text(ae,n),e.set_text(Fe,c)},[()=>y()("rank"),()=>y()("user"),()=>y()("points"),()=>y()("prize")]),e.append(ee,V);var d=e.pop($);return te(),d}e.delegate(["click"]);customElements.define("tournament-leaderboard",e.create_custom_element(ze,{endpoint:{},language:{},session:{},tournamentid:{},platform:{}},[],[],!1));exports.default=ze;
|