@hadoku/watchparty-ui 0.45.81 → 0.45.82
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/chunks/{AdminPanel-D2kMQb6o.js → AdminPanel-rpVTvC5k.js} +4 -4
- package/dist/chunks/{AdminPanel-D2kMQb6o.js.map → AdminPanel-rpVTvC5k.js.map} +1 -1
- package/dist/chunks/{MediaDrawer-C8HncoC9.js → MediaDrawer-uvZch1sP.js} +4 -4
- package/dist/chunks/{MediaDrawer-C8HncoC9.js.map → MediaDrawer-uvZch1sP.js.map} +1 -1
- package/dist/chunks/{PlaylistPanel-CZOP3b1v.js → PlaylistPanel-B2JA2RPM.js} +3 -3
- package/dist/chunks/{PlaylistPanel-CZOP3b1v.js.map → PlaylistPanel-B2JA2RPM.js.map} +1 -1
- package/dist/chunks/{Room-CqOgWJsa.js → Room-DYGrZm4g.js} +4 -4
- package/dist/chunks/{Room-CqOgWJsa.js.map → Room-DYGrZm4g.js.map} +1 -1
- package/dist/chunks/{index-C1isVbwB.js → index-BhTEvojV.js} +968 -941
- package/dist/chunks/index-BhTEvojV.js.map +1 -0
- package/dist/chunks/{submissionsApi-D-JuFvB7.js → submissionsApi-Bq1zLwi8.js} +2 -2
- package/dist/chunks/{submissionsApi-D-JuFvB7.js.map → submissionsApi-Bq1zLwi8.js.map} +1 -1
- package/dist/index.js +1 -1
- package/dist/room-chrome.js +485 -490
- package/dist/room-chrome.js.map +1 -1
- package/package.json +3 -3
- package/dist/chunks/index-C1isVbwB.js.map +0 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { jsx as N, Fragment as mo, jsxs as $e } from "react/jsx-runtime";
|
|
2
2
|
import * as w from "react";
|
|
3
|
-
import ut, { createContext as
|
|
4
|
-
import { createRoot as
|
|
5
|
-
import * as
|
|
6
|
-
import { themePrefs as Zt, HadokuThemeRoot as
|
|
3
|
+
import ut, { createContext as pl, useContext as ml, useSyncExternalStore as ln, useEffect as nt, useRef as _t, useState as go, useMemo as gl } from "react";
|
|
4
|
+
import { createRoot as yl } from "react-dom/client";
|
|
5
|
+
import * as vl from "react-dom";
|
|
6
|
+
import { themePrefs as Zt, HadokuThemeRoot as bl, THEMES as wl, saveTheme as _l } from "@wolffm/themes";
|
|
7
7
|
import { z as u } from "zod";
|
|
8
|
-
import { createPrefsClient as
|
|
8
|
+
import { createPrefsClient as El, getDeviceId as Sl, DEVICE_ID_KEY as Rl } from "@wolffm/prefs-client";
|
|
9
9
|
var yo = (e) => {
|
|
10
10
|
throw TypeError(e);
|
|
11
|
-
},
|
|
12
|
-
function
|
|
11
|
+
}, Tl = (e, t, r) => t.has(e) || yo("Cannot " + r), Cn = (e, t, r) => (Tl(e, t, "read from private field"), r ? r.call(e) : t.get(e)), xl = (e, t, r) => t.has(e) ? yo("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, r), Qa = "popstate";
|
|
12
|
+
function Cl(e = {}) {
|
|
13
13
|
function t(n, a) {
|
|
14
14
|
let { pathname: i, search: o, hash: s } = n.location;
|
|
15
15
|
return or(
|
|
@@ -23,7 +23,7 @@ function xl(e = {}) {
|
|
|
23
23
|
function r(n, a) {
|
|
24
24
|
return typeof a == "string" ? a : We(a);
|
|
25
25
|
}
|
|
26
|
-
return
|
|
26
|
+
return Al(
|
|
27
27
|
t,
|
|
28
28
|
r,
|
|
29
29
|
null,
|
|
@@ -43,7 +43,7 @@ function ue(e, t) {
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function kl() {
|
|
47
47
|
return Math.random().toString(36).substring(2, 10);
|
|
48
48
|
}
|
|
49
49
|
function Za(e, t) {
|
|
@@ -64,7 +64,7 @@ function or(e, t, r = null, n) {
|
|
|
64
64
|
// full Locations now and avoid the need to run through this flow at all
|
|
65
65
|
// But that's a pretty big refactor to the current test suite so going to
|
|
66
66
|
// keep as is for the time being and just let any incoming keys take precedence
|
|
67
|
-
key: t && t.key || n ||
|
|
67
|
+
key: t && t.key || n || kl()
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
70
|
function We({
|
|
@@ -84,7 +84,7 @@ function ht(e) {
|
|
|
84
84
|
}
|
|
85
85
|
return t;
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function Al(e, t, r, n = {}) {
|
|
88
88
|
let { window: a = document.defaultView, v5Compat: i = !1 } = n, o = a.history, s = "POP", l = null, c = d();
|
|
89
89
|
c == null && (c = 0, o.replaceState({ ...o.state, idx: c }, ""));
|
|
90
90
|
function d() {
|
|
@@ -165,7 +165,7 @@ var Yt, ei = class {
|
|
|
165
165
|
* @param init An optional initial context map to populate the provider with
|
|
166
166
|
*/
|
|
167
167
|
constructor(e) {
|
|
168
|
-
if (
|
|
168
|
+
if (xl(this, Yt, /* @__PURE__ */ new Map()), e)
|
|
169
169
|
for (let [t, r] of e)
|
|
170
170
|
this.set(t, r);
|
|
171
171
|
}
|
|
@@ -197,7 +197,7 @@ var Yt, ei = class {
|
|
|
197
197
|
}
|
|
198
198
|
};
|
|
199
199
|
Yt = /* @__PURE__ */ new WeakMap();
|
|
200
|
-
var
|
|
200
|
+
var Pl = /* @__PURE__ */ new Set([
|
|
201
201
|
"lazy",
|
|
202
202
|
"caseSensitive",
|
|
203
203
|
"path",
|
|
@@ -205,12 +205,12 @@ var Al = /* @__PURE__ */ new Set([
|
|
|
205
205
|
"index",
|
|
206
206
|
"children"
|
|
207
207
|
]);
|
|
208
|
-
function
|
|
209
|
-
return
|
|
208
|
+
function Ml(e) {
|
|
209
|
+
return Pl.has(
|
|
210
210
|
e
|
|
211
211
|
);
|
|
212
212
|
}
|
|
213
|
-
var
|
|
213
|
+
var Il = /* @__PURE__ */ new Set([
|
|
214
214
|
"lazy",
|
|
215
215
|
"caseSensitive",
|
|
216
216
|
"path",
|
|
@@ -219,12 +219,12 @@ var Ml = /* @__PURE__ */ new Set([
|
|
|
219
219
|
"middleware",
|
|
220
220
|
"children"
|
|
221
221
|
]);
|
|
222
|
-
function
|
|
223
|
-
return
|
|
222
|
+
function Ll(e) {
|
|
223
|
+
return Il.has(
|
|
224
224
|
e
|
|
225
225
|
);
|
|
226
226
|
}
|
|
227
|
-
function
|
|
227
|
+
function Ol(e) {
|
|
228
228
|
return e.index === !0;
|
|
229
229
|
}
|
|
230
230
|
function sr(e, t, r = [], n = {}, a = !1) {
|
|
@@ -236,7 +236,7 @@ function sr(e, t, r = [], n = {}, a = !1) {
|
|
|
236
236
|
), Y(
|
|
237
237
|
a || !n[l],
|
|
238
238
|
`Found a route id collision on id "${l}". Route id's must be globally unique within Data Router usages`
|
|
239
|
-
),
|
|
239
|
+
), Ol(i)) {
|
|
240
240
|
let c = {
|
|
241
241
|
...i,
|
|
242
242
|
id: l
|
|
@@ -283,11 +283,11 @@ function Xt(e, t, r, n) {
|
|
|
283
283
|
if (i == null)
|
|
284
284
|
return null;
|
|
285
285
|
let o = bo(e);
|
|
286
|
-
|
|
286
|
+
Nl(o);
|
|
287
287
|
let s = null;
|
|
288
288
|
for (let l = 0; s == null && l < o.length; ++l) {
|
|
289
|
-
let c =
|
|
290
|
-
s =
|
|
289
|
+
let c = Kl(i);
|
|
290
|
+
s = ql(
|
|
291
291
|
o[l],
|
|
292
292
|
c,
|
|
293
293
|
n
|
|
@@ -295,7 +295,7 @@ function Xt(e, t, r, n) {
|
|
|
295
295
|
}
|
|
296
296
|
return s;
|
|
297
297
|
}
|
|
298
|
-
function
|
|
298
|
+
function Dl(e, t) {
|
|
299
299
|
let { route: r, pathname: n, params: a } = e;
|
|
300
300
|
return {
|
|
301
301
|
id: r.id,
|
|
@@ -336,7 +336,7 @@ function bo(e, t = [], r = [], n = "", a = !1) {
|
|
|
336
336
|
l
|
|
337
337
|
)), !(o.path == null && !o.index) && t.push({
|
|
338
338
|
path: h,
|
|
339
|
-
score:
|
|
339
|
+
score: Hl(h, o.index),
|
|
340
340
|
routesMeta: y
|
|
341
341
|
});
|
|
342
342
|
};
|
|
@@ -363,23 +363,23 @@ function wo(e) {
|
|
|
363
363
|
(l) => e.startsWith("/") && l === "" ? "/" : l
|
|
364
364
|
);
|
|
365
365
|
}
|
|
366
|
-
function
|
|
366
|
+
function Nl(e) {
|
|
367
367
|
e.sort(
|
|
368
|
-
(t, r) => t.score !== r.score ? r.score - t.score :
|
|
368
|
+
(t, r) => t.score !== r.score ? r.score - t.score : Vl(
|
|
369
369
|
t.routesMeta.map((n) => n.childrenIndex),
|
|
370
370
|
r.routesMeta.map((n) => n.childrenIndex)
|
|
371
371
|
)
|
|
372
372
|
);
|
|
373
373
|
}
|
|
374
|
-
var
|
|
375
|
-
function
|
|
374
|
+
var $l = /^:[\w-]+$/, Fl = 3, Ul = 2, Bl = 1, jl = 10, zl = -2, ri = (e) => e === "*";
|
|
375
|
+
function Hl(e, t) {
|
|
376
376
|
let r = e.split("/"), n = r.length;
|
|
377
|
-
return r.some(ri) && (n +=
|
|
378
|
-
(a, i) => a + (
|
|
377
|
+
return r.some(ri) && (n += zl), t && (n += Ul), r.filter((a) => !ri(a)).reduce(
|
|
378
|
+
(a, i) => a + ($l.test(i) ? Fl : i === "" ? Bl : jl),
|
|
379
379
|
n
|
|
380
380
|
);
|
|
381
381
|
}
|
|
382
|
-
function
|
|
382
|
+
function Vl(e, t) {
|
|
383
383
|
return e.length === t.length && e.slice(0, -1).every((n, a) => n === t[a]) ? (
|
|
384
384
|
// If two routes are siblings, we should try to match the earlier sibling
|
|
385
385
|
// first. This allows people to have fine-grained control over the matching
|
|
@@ -392,7 +392,7 @@ function Hl(e, t) {
|
|
|
392
392
|
0
|
|
393
393
|
);
|
|
394
394
|
}
|
|
395
|
-
function
|
|
395
|
+
function ql(e, t, r = !1) {
|
|
396
396
|
let { routesMeta: n } = e, a = {}, i = "/", o = [];
|
|
397
397
|
for (let s = 0; s < n.length; ++s) {
|
|
398
398
|
let l = n[s], c = s === n.length - 1, d = i === "/" ? t : t.slice(i.length) || "/", h = rn(
|
|
@@ -412,7 +412,7 @@ function Vl(e, t, r = !1) {
|
|
|
412
412
|
// TODO: Can this as be avoided?
|
|
413
413
|
params: a,
|
|
414
414
|
pathname: qe([i, h.pathname]),
|
|
415
|
-
pathnameBase:
|
|
415
|
+
pathnameBase: Xl(
|
|
416
416
|
qe([i, h.pathnameBase])
|
|
417
417
|
),
|
|
418
418
|
route: y
|
|
@@ -422,7 +422,7 @@ function Vl(e, t, r = !1) {
|
|
|
422
422
|
}
|
|
423
423
|
function rn(e, t) {
|
|
424
424
|
typeof e == "string" && (e = { path: e, caseSensitive: !1, end: !0 });
|
|
425
|
-
let [r, n] =
|
|
425
|
+
let [r, n] = Wl(
|
|
426
426
|
e.path,
|
|
427
427
|
e.caseSensitive,
|
|
428
428
|
e.end
|
|
@@ -446,7 +446,7 @@ function rn(e, t) {
|
|
|
446
446
|
pattern: e
|
|
447
447
|
};
|
|
448
448
|
}
|
|
449
|
-
function
|
|
449
|
+
function Wl(e, t = !1, r = !0) {
|
|
450
450
|
ue(
|
|
451
451
|
e === "*" || !e.endsWith("*") || e.endsWith("/*"),
|
|
452
452
|
`Route path "${e}" will be treated as if it were "${e.replace(/\*$/, "/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/, "/*")}".`
|
|
@@ -457,7 +457,7 @@ function ql(e, t = !1, r = !0) {
|
|
|
457
457
|
).replace(/\/([\w-]+)\?(\/|$)/g, "(/$1)?$2");
|
|
458
458
|
return e.endsWith("*") ? (n.push({ paramName: "*" }), a += e === "*" || e === "/*" ? "(.*)$" : "(?:\\/(.+)|\\/*)$") : r ? a += "\\/*$" : e !== "" && e !== "/" && (a += "(?:(?=\\/|$))"), [new RegExp(a, t ? void 0 : "i"), n];
|
|
459
459
|
}
|
|
460
|
-
function
|
|
460
|
+
function Kl(e) {
|
|
461
461
|
try {
|
|
462
462
|
return e.split("/").map((t) => decodeURIComponent(t).replace(/\//g, "%2F")).join("/");
|
|
463
463
|
} catch (t) {
|
|
@@ -474,14 +474,14 @@ function Oe(e, t) {
|
|
|
474
474
|
let r = t.endsWith("/") ? t.length - 1 : t.length, n = e.charAt(r);
|
|
475
475
|
return n && n !== "/" ? null : e.slice(r) || "/";
|
|
476
476
|
}
|
|
477
|
-
function
|
|
477
|
+
function Gl({
|
|
478
478
|
basename: e,
|
|
479
479
|
pathname: t
|
|
480
480
|
}) {
|
|
481
481
|
return t === "/" ? e : qe([e, t]);
|
|
482
482
|
}
|
|
483
483
|
var _o = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, cn = (e) => _o.test(e);
|
|
484
|
-
function
|
|
484
|
+
function Yl(e, t = "/") {
|
|
485
485
|
let {
|
|
486
486
|
pathname: r,
|
|
487
487
|
search: n = "",
|
|
@@ -504,8 +504,8 @@ function Gl(e, t = "/") {
|
|
|
504
504
|
i = t;
|
|
505
505
|
return {
|
|
506
506
|
pathname: i,
|
|
507
|
-
search:
|
|
508
|
-
hash:
|
|
507
|
+
search: Jl(n),
|
|
508
|
+
hash: Ql(a)
|
|
509
509
|
};
|
|
510
510
|
}
|
|
511
511
|
function ni(e, t) {
|
|
@@ -555,10 +555,10 @@ function la(e, t, r, n = !1) {
|
|
|
555
555
|
}
|
|
556
556
|
s = h >= 0 ? t[h] : "/";
|
|
557
557
|
}
|
|
558
|
-
let l =
|
|
558
|
+
let l = Yl(a, s), c = o && o !== "/" && o.endsWith("/"), d = (i || o === ".") && r.endsWith("/");
|
|
559
559
|
return !l.pathname.endsWith("/") && (c || d) && (l.pathname += "/"), l;
|
|
560
560
|
}
|
|
561
|
-
var qe = (e) => e.join("/").replace(/\/\/+/g, "/"),
|
|
561
|
+
var qe = (e) => e.join("/").replace(/\/\/+/g, "/"), Xl = (e) => e.replace(/\/+$/, "").replace(/^\/*/, "/"), Jl = (e) => !e || e === "?" ? "" : e.startsWith("?") ? e : "?" + e, Ql = (e) => !e || e === "#" ? "" : e.startsWith("#") ? e : "#" + e, pr = class {
|
|
562
562
|
constructor(e, t, r, n = !1) {
|
|
563
563
|
this.status = e, this.statusText = t || "", this.internal = n, r instanceof Error ? (this.data = r.toString(), this.error = r) : this.data = r;
|
|
564
564
|
}
|
|
@@ -596,7 +596,7 @@ function Ro(e, t) {
|
|
|
596
596
|
};
|
|
597
597
|
}
|
|
598
598
|
var dt = /* @__PURE__ */ Symbol("Uninstrumented");
|
|
599
|
-
function
|
|
599
|
+
function Zl(e, t) {
|
|
600
600
|
let r = {
|
|
601
601
|
lazy: [],
|
|
602
602
|
"lazy.loader": [],
|
|
@@ -656,7 +656,7 @@ function Ql(e, t) {
|
|
|
656
656
|
return o ? (o[dt] = i, o) : a;
|
|
657
657
|
})), n;
|
|
658
658
|
}
|
|
659
|
-
function
|
|
659
|
+
function ec(e, t) {
|
|
660
660
|
let r = {
|
|
661
661
|
navigate: [],
|
|
662
662
|
fetch: []
|
|
@@ -733,10 +733,10 @@ async function To(e, t, r, n) {
|
|
|
733
733
|
function ai(e) {
|
|
734
734
|
let { request: t, context: r, params: n, unstable_pattern: a } = e;
|
|
735
735
|
return {
|
|
736
|
-
request:
|
|
736
|
+
request: tc(t),
|
|
737
737
|
params: { ...n },
|
|
738
738
|
unstable_pattern: a,
|
|
739
|
-
context:
|
|
739
|
+
context: rc(r)
|
|
740
740
|
};
|
|
741
741
|
}
|
|
742
742
|
function ii(e, t) {
|
|
@@ -748,7 +748,7 @@ function ii(e, t) {
|
|
|
748
748
|
..."body" in t ? { body: t.body } : {}
|
|
749
749
|
};
|
|
750
750
|
}
|
|
751
|
-
function
|
|
751
|
+
function tc(e) {
|
|
752
752
|
return {
|
|
753
753
|
method: e.method,
|
|
754
754
|
url: e.url,
|
|
@@ -757,8 +757,8 @@ function ec(e) {
|
|
|
757
757
|
}
|
|
758
758
|
};
|
|
759
759
|
}
|
|
760
|
-
function
|
|
761
|
-
if (
|
|
760
|
+
function rc(e) {
|
|
761
|
+
if (ac(e)) {
|
|
762
762
|
let t = { ...e };
|
|
763
763
|
return Object.freeze(t), t;
|
|
764
764
|
} else
|
|
@@ -766,24 +766,24 @@ function tc(e) {
|
|
|
766
766
|
get: (t) => e.get(t)
|
|
767
767
|
};
|
|
768
768
|
}
|
|
769
|
-
var
|
|
770
|
-
function
|
|
769
|
+
var nc = Object.getOwnPropertyNames(Object.prototype).sort().join("\0");
|
|
770
|
+
function ac(e) {
|
|
771
771
|
if (e === null || typeof e != "object")
|
|
772
772
|
return !1;
|
|
773
773
|
const t = Object.getPrototypeOf(e);
|
|
774
|
-
return t === Object.prototype || t === null || Object.getOwnPropertyNames(t).sort().join("\0") ===
|
|
774
|
+
return t === Object.prototype || t === null || Object.getOwnPropertyNames(t).sort().join("\0") === nc;
|
|
775
775
|
}
|
|
776
776
|
var xo = [
|
|
777
777
|
"POST",
|
|
778
778
|
"PUT",
|
|
779
779
|
"PATCH",
|
|
780
780
|
"DELETE"
|
|
781
|
-
],
|
|
781
|
+
], ic = new Set(
|
|
782
782
|
xo
|
|
783
|
-
),
|
|
783
|
+
), oc = [
|
|
784
784
|
"GET",
|
|
785
785
|
...xo
|
|
786
|
-
],
|
|
786
|
+
], sc = new Set(oc), Co = /* @__PURE__ */ new Set([301, 302, 303, 307, 308]), lc = /* @__PURE__ */ new Set([307, 308]), An = {
|
|
787
787
|
state: "idle",
|
|
788
788
|
location: void 0,
|
|
789
789
|
formMethod: void 0,
|
|
@@ -792,7 +792,7 @@ var xo = [
|
|
|
792
792
|
formData: void 0,
|
|
793
793
|
json: void 0,
|
|
794
794
|
text: void 0
|
|
795
|
-
},
|
|
795
|
+
}, cc = {
|
|
796
796
|
state: "idle",
|
|
797
797
|
data: void 0,
|
|
798
798
|
formMethod: void 0,
|
|
@@ -806,21 +806,21 @@ var xo = [
|
|
|
806
806
|
proceed: void 0,
|
|
807
807
|
reset: void 0,
|
|
808
808
|
location: void 0
|
|
809
|
-
},
|
|
809
|
+
}, uc = (e) => ({
|
|
810
810
|
hasErrorBoundary: !!e.hasErrorBoundary
|
|
811
811
|
}), ko = "remix-router-transitions", Ao = /* @__PURE__ */ Symbol("ResetLoaderData");
|
|
812
|
-
function
|
|
812
|
+
function dc(e) {
|
|
813
813
|
const t = e.window ? e.window : typeof window < "u" ? window : void 0, r = typeof t < "u" && typeof t.document < "u" && typeof t.document.createElement < "u";
|
|
814
814
|
Y(
|
|
815
815
|
e.routes.length > 0,
|
|
816
816
|
"You must provide a non-empty routes array to createRouter"
|
|
817
817
|
);
|
|
818
|
-
let n = e.hydrationRouteProperties || [], a = e.mapRouteProperties ||
|
|
818
|
+
let n = e.hydrationRouteProperties || [], a = e.mapRouteProperties || uc, i = a;
|
|
819
819
|
if (e.unstable_instrumentations) {
|
|
820
820
|
let f = e.unstable_instrumentations;
|
|
821
821
|
i = (p) => ({
|
|
822
822
|
...a(p),
|
|
823
|
-
...
|
|
823
|
+
...Zl(
|
|
824
824
|
f.map((v) => v.route).filter(Boolean),
|
|
825
825
|
p
|
|
826
826
|
)
|
|
@@ -833,7 +833,7 @@ function uc(e) {
|
|
|
833
833
|
o
|
|
834
834
|
), l, c = e.basename || "/";
|
|
835
835
|
c.startsWith("/") || (c = `/${c}`);
|
|
836
|
-
let d = e.dataStrategy ||
|
|
836
|
+
let d = e.dataStrategy || gc, h = {
|
|
837
837
|
...e.future
|
|
838
838
|
}, y = null, g = /* @__PURE__ */ new Set(), _ = null, R = null, b = null, C = e.hydrationData != null, E = lt(s, e.history.location, c), A = !1, j = null, S;
|
|
839
839
|
if (E == null && !e.patchRoutesOnNavigation) {
|
|
@@ -930,8 +930,8 @@ function uc(e) {
|
|
|
930
930
|
return He(f, p);
|
|
931
931
|
}
|
|
932
932
|
), r) {
|
|
933
|
-
|
|
934
|
-
let f = () =>
|
|
933
|
+
Oc(t, oe);
|
|
934
|
+
let f = () => Dc(t, oe);
|
|
935
935
|
t.addEventListener("pagehide", f), W = () => t.removeEventListener("pagehide", f);
|
|
936
936
|
}
|
|
937
937
|
return m.initialized || He("POP", m.location, {
|
|
@@ -1095,12 +1095,12 @@ function uc(e) {
|
|
|
1095
1095
|
), f);
|
|
1096
1096
|
}
|
|
1097
1097
|
async function He(f, p, v) {
|
|
1098
|
-
F && F.abort(), F = null, P = f, H = (v && v.startUninterruptedRevalidation) === !0,
|
|
1098
|
+
F && F.abort(), F = null, P = f, H = (v && v.startUninterruptedRevalidation) === !0, ul(m.location, m.matches), B = (v && v.preventScrollReset) === !0, Z = (v && v.enableViewTransition) === !0;
|
|
1099
1099
|
let T = l || s, k = v && v.overrideNavigation, L = v?.initialHydration && m.matches && m.matches.length > 0 && !A ? (
|
|
1100
1100
|
// `matchRoutes()` has already been called if we're in here via `router.initialize()`
|
|
1101
1101
|
m.matches
|
|
1102
1102
|
) : lt(T, p, c), M = (v && v.flushSync) === !0;
|
|
1103
|
-
if (L && m.initialized && !ae &&
|
|
1103
|
+
if (L && m.initialized && !ae && Rc(m.location, p) && !(v && v.submission && Ee(v.submission.formMethod))) {
|
|
1104
1104
|
Ye(p, { matches: L }, { flushSync: M });
|
|
1105
1105
|
return;
|
|
1106
1106
|
}
|
|
@@ -1195,7 +1195,7 @@ function uc(e) {
|
|
|
1195
1195
|
}
|
|
1196
1196
|
async function _r(f, p, v, T, k, L, M, I = {}) {
|
|
1197
1197
|
Sn();
|
|
1198
|
-
let O =
|
|
1198
|
+
let O = Ic(p, v);
|
|
1199
1199
|
if (me({ navigation: O }, { flushSync: I.flushSync === !0 }), L) {
|
|
1200
1200
|
let D = await xr(
|
|
1201
1201
|
T,
|
|
@@ -1508,7 +1508,7 @@ function uc(e) {
|
|
|
1508
1508
|
}
|
|
1509
1509
|
let ee = e.getContext ? await e.getContext() : new ei(), te = (T && T.preventScrollReset) === !0;
|
|
1510
1510
|
if (V && Ee(V.formMethod)) {
|
|
1511
|
-
await
|
|
1511
|
+
await al(
|
|
1512
1512
|
f,
|
|
1513
1513
|
p,
|
|
1514
1514
|
$,
|
|
@@ -1522,7 +1522,7 @@ function uc(e) {
|
|
|
1522
1522
|
);
|
|
1523
1523
|
return;
|
|
1524
1524
|
}
|
|
1525
|
-
Se.set(f, { routeId: p, path: $ }), await
|
|
1525
|
+
Se.set(f, { routeId: p, path: $ }), await il(
|
|
1526
1526
|
f,
|
|
1527
1527
|
p,
|
|
1528
1528
|
$,
|
|
@@ -1534,10 +1534,10 @@ function uc(e) {
|
|
|
1534
1534
|
V
|
|
1535
1535
|
);
|
|
1536
1536
|
}
|
|
1537
|
-
async function
|
|
1537
|
+
async function al(f, p, v, T, k, L, M, I, O, $) {
|
|
1538
1538
|
Sn(), Se.delete(f);
|
|
1539
1539
|
let V = m.fetchers.get(f);
|
|
1540
|
-
Xe(f,
|
|
1540
|
+
Xe(f, Lc(O, V), {
|
|
1541
1541
|
flushSync: M
|
|
1542
1542
|
});
|
|
1543
1543
|
let D = new AbortController(), ee = At(
|
|
@@ -1660,11 +1660,11 @@ function uc(e) {
|
|
|
1660
1660
|
$
|
|
1661
1661
|
);
|
|
1662
1662
|
vt.filter((le) => le.key !== f).forEach((le) => {
|
|
1663
|
-
let Ar = le.key, Ja = m.fetchers.get(Ar),
|
|
1663
|
+
let Ar = le.key, Ja = m.fetchers.get(Ar), hl = qt(
|
|
1664
1664
|
void 0,
|
|
1665
1665
|
Ja ? Ja.data : void 0
|
|
1666
1666
|
);
|
|
1667
|
-
m.fetchers.set(Ar,
|
|
1667
|
+
m.fetchers.set(Ar, hl), Qe(Ar), le.controller && K.set(Ar, le.controller);
|
|
1668
1668
|
}), me({ fetchers: new Map(m.fetchers) });
|
|
1669
1669
|
let Cr = () => vt.forEach((le) => Qe(le.key));
|
|
1670
1670
|
D.signal.addEventListener(
|
|
@@ -1725,7 +1725,7 @@ function uc(e) {
|
|
|
1725
1725
|
fetchers: new Map(m.fetchers)
|
|
1726
1726
|
}), ae = !1);
|
|
1727
1727
|
}
|
|
1728
|
-
async function
|
|
1728
|
+
async function il(f, p, v, T, k, L, M, I, O) {
|
|
1729
1729
|
let $ = m.fetchers.get(f);
|
|
1730
1730
|
Xe(
|
|
1731
1731
|
f,
|
|
@@ -1838,7 +1838,7 @@ function uc(e) {
|
|
|
1838
1838
|
let $ = M === !0 || p.response.headers.has("X-Remix-Replace") ? "REPLACE" : "PUSH", { formMethod: V, formAction: D, formEncType: ee } = m.navigation;
|
|
1839
1839
|
!T && !k && V && D && ee && (T = vi(m.navigation));
|
|
1840
1840
|
let te = T || k;
|
|
1841
|
-
if (
|
|
1841
|
+
if (lc.has(p.response.status) && te && Ee(te.formMethod))
|
|
1842
1842
|
await He($, O, {
|
|
1843
1843
|
submission: {
|
|
1844
1844
|
...te,
|
|
@@ -1866,7 +1866,7 @@ function uc(e) {
|
|
|
1866
1866
|
async function jt(f, p, v, T) {
|
|
1867
1867
|
let k, L = {};
|
|
1868
1868
|
try {
|
|
1869
|
-
k = await
|
|
1869
|
+
k = await vc(
|
|
1870
1870
|
d,
|
|
1871
1871
|
f,
|
|
1872
1872
|
p,
|
|
@@ -1896,11 +1896,11 @@ function uc(e) {
|
|
|
1896
1896
|
});
|
|
1897
1897
|
}
|
|
1898
1898
|
for (let [M, I] of Object.entries(k))
|
|
1899
|
-
if (
|
|
1899
|
+
if (kc(I)) {
|
|
1900
1900
|
let O = I.result;
|
|
1901
1901
|
L[M] = {
|
|
1902
1902
|
type: "redirect",
|
|
1903
|
-
response:
|
|
1903
|
+
response: Ec(
|
|
1904
1904
|
O,
|
|
1905
1905
|
f,
|
|
1906
1906
|
M,
|
|
@@ -1909,7 +1909,7 @@ function uc(e) {
|
|
|
1909
1909
|
)
|
|
1910
1910
|
};
|
|
1911
1911
|
} else
|
|
1912
|
-
L[M] = await
|
|
1912
|
+
L[M] = await _c(I);
|
|
1913
1913
|
return L;
|
|
1914
1914
|
}
|
|
1915
1915
|
async function ja(f, p, v, T) {
|
|
@@ -1971,16 +1971,16 @@ function uc(e) {
|
|
|
1971
1971
|
);
|
|
1972
1972
|
}
|
|
1973
1973
|
function za(f) {
|
|
1974
|
-
return Te.set(f, (Te.get(f) || 0) + 1), fe.has(f) && fe.delete(f), m.fetchers.get(f) ||
|
|
1974
|
+
return Te.set(f, (Te.get(f) || 0) + 1), fe.has(f) && fe.delete(f), m.fetchers.get(f) || cc;
|
|
1975
1975
|
}
|
|
1976
|
-
function
|
|
1976
|
+
function ol(f, p) {
|
|
1977
1977
|
Qe(f, p?.reason), Xe(f, tt(null));
|
|
1978
1978
|
}
|
|
1979
1979
|
function Rn(f) {
|
|
1980
1980
|
let p = m.fetchers.get(f);
|
|
1981
1981
|
K.has(f) && !(p && p.state === "loading" && Ce.has(f)) && Qe(f), Se.delete(f), Ce.delete(f), pe.delete(f), fe.delete(f), ve.delete(f), m.fetchers.delete(f);
|
|
1982
1982
|
}
|
|
1983
|
-
function
|
|
1983
|
+
function sl(f) {
|
|
1984
1984
|
let p = (Te.get(f) || 0) - 1;
|
|
1985
1985
|
p <= 0 ? (Te.delete(f), fe.add(f)) : Te.set(f, p), me({ fetchers: new Map(m.fetchers) });
|
|
1986
1986
|
}
|
|
@@ -2011,7 +2011,7 @@ function uc(e) {
|
|
|
2011
2011
|
}
|
|
2012
2012
|
return Ha(p), p.length > 0;
|
|
2013
2013
|
}
|
|
2014
|
-
function
|
|
2014
|
+
function ll(f, p) {
|
|
2015
2015
|
let v = m.blockers.get(f) || Vt;
|
|
2016
2016
|
return ze.get(f) !== p && ze.set(f, p), v;
|
|
2017
2017
|
}
|
|
@@ -2043,7 +2043,7 @@ function uc(e) {
|
|
|
2043
2043
|
let p = Me(404, { pathname: f }), v = l || s, { matches: T, route: k } = Pr(v);
|
|
2044
2044
|
return { notFoundMatches: T, route: k, error: p };
|
|
2045
2045
|
}
|
|
2046
|
-
function
|
|
2046
|
+
function cl(f, p, v) {
|
|
2047
2047
|
if (_ = f, b = p, R = v || null, !C && m.navigation === An) {
|
|
2048
2048
|
C = !0;
|
|
2049
2049
|
let T = Ya(m.location, m.matches);
|
|
@@ -2056,10 +2056,10 @@ function uc(e) {
|
|
|
2056
2056
|
function Ga(f, p) {
|
|
2057
2057
|
return R && R(
|
|
2058
2058
|
f,
|
|
2059
|
-
p.map((T) =>
|
|
2059
|
+
p.map((T) => Dl(T, m.loaderData))
|
|
2060
2060
|
) || f.key;
|
|
2061
2061
|
}
|
|
2062
|
-
function
|
|
2062
|
+
function ul(f, p) {
|
|
2063
2063
|
if (_ && b) {
|
|
2064
2064
|
let v = Ga(f, p);
|
|
2065
2065
|
_[v] = b();
|
|
@@ -2150,7 +2150,7 @@ function uc(e) {
|
|
|
2150
2150
|
function Xa(f, p) {
|
|
2151
2151
|
return f.length === p.length && f.every((v, T) => v.route.id === p[T].route.id);
|
|
2152
2152
|
}
|
|
2153
|
-
function
|
|
2153
|
+
function dl(f) {
|
|
2154
2154
|
o = {}, l = sr(
|
|
2155
2155
|
f,
|
|
2156
2156
|
i,
|
|
@@ -2158,7 +2158,7 @@ function uc(e) {
|
|
|
2158
2158
|
o
|
|
2159
2159
|
);
|
|
2160
2160
|
}
|
|
2161
|
-
function
|
|
2161
|
+
function fl(f, p, v = !1) {
|
|
2162
2162
|
let T = l == null;
|
|
2163
2163
|
li(
|
|
2164
2164
|
f,
|
|
@@ -2187,7 +2187,7 @@ function uc(e) {
|
|
|
2187
2187
|
},
|
|
2188
2188
|
initialize: Ba,
|
|
2189
2189
|
subscribe: Bt,
|
|
2190
|
-
enableScrollRestoration:
|
|
2190
|
+
enableScrollRestoration: cl,
|
|
2191
2191
|
navigate: ot,
|
|
2192
2192
|
fetch: En,
|
|
2193
2193
|
revalidate: wn,
|
|
@@ -2196,25 +2196,25 @@ function uc(e) {
|
|
|
2196
2196
|
createHref: (f) => e.history.createHref(f),
|
|
2197
2197
|
encodeLocation: (f) => e.history.encodeLocation(f),
|
|
2198
2198
|
getFetcher: za,
|
|
2199
|
-
resetFetcher:
|
|
2200
|
-
deleteFetcher:
|
|
2199
|
+
resetFetcher: ol,
|
|
2200
|
+
deleteFetcher: sl,
|
|
2201
2201
|
dispose: wr,
|
|
2202
|
-
getBlocker:
|
|
2202
|
+
getBlocker: ll,
|
|
2203
2203
|
deleteBlocker: Wa,
|
|
2204
|
-
patchRoutes:
|
|
2204
|
+
patchRoutes: fl,
|
|
2205
2205
|
_internalFetchControllers: K,
|
|
2206
2206
|
// TODO: Remove setRoutes, it's temporary to avoid dealing with
|
|
2207
2207
|
// updating the tree while validating the update algorithm.
|
|
2208
|
-
_internalSetRoutes:
|
|
2208
|
+
_internalSetRoutes: dl,
|
|
2209
2209
|
_internalSetStateDoNotUseOrYouWillBreakYourApp(f) {
|
|
2210
2210
|
me(f);
|
|
2211
2211
|
}
|
|
2212
|
-
}, e.unstable_instrumentations && (q =
|
|
2212
|
+
}, e.unstable_instrumentations && (q = ec(
|
|
2213
2213
|
q,
|
|
2214
2214
|
e.unstable_instrumentations.map((f) => f.router).filter(Boolean)
|
|
2215
2215
|
)), q;
|
|
2216
2216
|
}
|
|
2217
|
-
function
|
|
2217
|
+
function fc(e) {
|
|
2218
2218
|
return e != null && ("formData" in e && e.formData != null || "body" in e && e.body !== void 0);
|
|
2219
2219
|
}
|
|
2220
2220
|
function Hn(e, t, r, n, a, i) {
|
|
@@ -2245,12 +2245,12 @@ function Hn(e, t, r, n, a, i) {
|
|
|
2245
2245
|
l.search = y ? `?${y}` : "";
|
|
2246
2246
|
}
|
|
2247
2247
|
}
|
|
2248
|
-
return r !== "/" && (l.pathname =
|
|
2248
|
+
return r !== "/" && (l.pathname = Gl({ basename: r, pathname: l.pathname })), We(l);
|
|
2249
2249
|
}
|
|
2250
2250
|
function oi(e, t, r) {
|
|
2251
|
-
if (!r || !
|
|
2251
|
+
if (!r || !fc(r))
|
|
2252
2252
|
return { path: t };
|
|
2253
|
-
if (r.formMethod && !
|
|
2253
|
+
if (r.formMethod && !Mc(r.formMethod))
|
|
2254
2254
|
return {
|
|
2255
2255
|
path: t,
|
|
2256
2256
|
error: Me(405, { method: r.formMethod })
|
|
@@ -2358,7 +2358,7 @@ function si(e, t, r, n, a, i, o, s, l, c, d, h, y, g, _, R, b, C, E, A, j) {
|
|
|
2358
2358
|
ve,
|
|
2359
2359
|
i.loaderData,
|
|
2360
2360
|
i.errors
|
|
2361
|
-
) :
|
|
2361
|
+
) : hc(i.loaderData, i.matches[ae], H) && (K = !0) : K = !1, K !== null)
|
|
2362
2362
|
return qn(
|
|
2363
2363
|
r,
|
|
2364
2364
|
n,
|
|
@@ -2370,7 +2370,7 @@ function si(e, t, r, n, a, i, o, s, l, c, d, h, y, g, _, R, b, C, E, A, j) {
|
|
|
2370
2370
|
K
|
|
2371
2371
|
);
|
|
2372
2372
|
let se = !1;
|
|
2373
|
-
typeof j == "boolean" ? se = j : B ? se = !1 : (h || q.pathname + q.search === m.pathname + m.search || q.search !== m.search ||
|
|
2373
|
+
typeof j == "boolean" ? se = j : B ? se = !1 : (h || q.pathname + q.search === m.pathname + m.search || q.search !== m.search || pc(i.matches[ae], H)) && (se = !0);
|
|
2374
2374
|
let ce = {
|
|
2375
2375
|
...F,
|
|
2376
2376
|
defaultShouldRevalidate: se
|
|
@@ -2473,7 +2473,7 @@ function Vn(e, t, r) {
|
|
|
2473
2473
|
let n = t != null && e.id in t, a = r != null && r[e.id] !== void 0;
|
|
2474
2474
|
return !n && a ? !1 : typeof e.loader == "function" && e.loader.hydrate === !0 ? !0 : !n && !a;
|
|
2475
2475
|
}
|
|
2476
|
-
function
|
|
2476
|
+
function hc(e, t, r) {
|
|
2477
2477
|
let n = (
|
|
2478
2478
|
// [a] -> [a, b]
|
|
2479
2479
|
!t || // [a, b] -> [a, c]
|
|
@@ -2481,7 +2481,7 @@ function fc(e, t, r) {
|
|
|
2481
2481
|
), a = !e.hasOwnProperty(r.route.id);
|
|
2482
2482
|
return n || a;
|
|
2483
2483
|
}
|
|
2484
|
-
function
|
|
2484
|
+
function pc(e, t) {
|
|
2485
2485
|
let r = e.route.path;
|
|
2486
2486
|
return (
|
|
2487
2487
|
// param change for this match, /users/123 -> /users/456
|
|
@@ -2564,7 +2564,7 @@ var ci = /* @__PURE__ */ new WeakMap(), Mo = ({
|
|
|
2564
2564
|
if (s)
|
|
2565
2565
|
return s;
|
|
2566
2566
|
let l = (async () => {
|
|
2567
|
-
let c =
|
|
2567
|
+
let c = Ml(e), h = a[e] !== void 0 && e !== "hasErrorBoundary";
|
|
2568
2568
|
if (c)
|
|
2569
2569
|
ue(
|
|
2570
2570
|
!c,
|
|
@@ -2583,7 +2583,7 @@ var ci = /* @__PURE__ */ new WeakMap(), Mo = ({
|
|
|
2583
2583
|
})();
|
|
2584
2584
|
return o[e] = l, l;
|
|
2585
2585
|
}, ui = /* @__PURE__ */ new WeakMap();
|
|
2586
|
-
function
|
|
2586
|
+
function mc(e, t, r, n, a) {
|
|
2587
2587
|
let i = r[e.id];
|
|
2588
2588
|
if (Y(i, "No route found in manifest"), !e.lazy)
|
|
2589
2589
|
return {
|
|
@@ -2607,7 +2607,7 @@ function pc(e, t, r, n, a) {
|
|
|
2607
2607
|
let R = y[_];
|
|
2608
2608
|
if (R === void 0)
|
|
2609
2609
|
continue;
|
|
2610
|
-
let b =
|
|
2610
|
+
let b = Ll(_), E = i[_] !== void 0 && // This property isn't static since it should always be updated based
|
|
2611
2611
|
// on the route updates
|
|
2612
2612
|
_ !== "hasErrorBoundary";
|
|
2613
2613
|
b ? ue(
|
|
@@ -2659,19 +2659,19 @@ async function di(e) {
|
|
|
2659
2659
|
r[t[i].route.id] = a;
|
|
2660
2660
|
}), r;
|
|
2661
2661
|
}
|
|
2662
|
-
async function
|
|
2662
|
+
async function gc(e) {
|
|
2663
2663
|
return e.matches.some((t) => t.route.middleware) ? Io(e, () => di(e)) : di(e);
|
|
2664
2664
|
}
|
|
2665
2665
|
function Io(e, t) {
|
|
2666
|
-
return
|
|
2666
|
+
return yc(
|
|
2667
2667
|
e,
|
|
2668
2668
|
t,
|
|
2669
2669
|
(n) => {
|
|
2670
|
-
if (
|
|
2670
|
+
if (Pc(n))
|
|
2671
2671
|
throw n;
|
|
2672
2672
|
return n;
|
|
2673
2673
|
},
|
|
2674
|
-
|
|
2674
|
+
xc,
|
|
2675
2675
|
r
|
|
2676
2676
|
);
|
|
2677
2677
|
function r(n, a, i) {
|
|
@@ -2703,7 +2703,7 @@ function Io(e, t) {
|
|
|
2703
2703
|
}
|
|
2704
2704
|
}
|
|
2705
2705
|
}
|
|
2706
|
-
async function
|
|
2706
|
+
async function yc(e, t, r, n, a) {
|
|
2707
2707
|
let { matches: i, request: o, params: s, context: l, unstable_pattern: c } = e, d = i.flatMap(
|
|
2708
2708
|
(y) => y.route.middleware ? y.route.middleware.map((g) => [y.route.id, g]) : []
|
|
2709
2709
|
);
|
|
@@ -2758,7 +2758,7 @@ function Oo(e, t, r, n, a) {
|
|
|
2758
2758
|
route: n.route,
|
|
2759
2759
|
manifest: t,
|
|
2760
2760
|
mapRouteProperties: e
|
|
2761
|
-
}), o =
|
|
2761
|
+
}), o = mc(
|
|
2762
2762
|
n.route,
|
|
2763
2763
|
Ee(r.method) ? "action" : "loader",
|
|
2764
2764
|
t,
|
|
@@ -2795,7 +2795,7 @@ function qn(e, t, r, n, a, i, o, s, l = null, c) {
|
|
|
2795
2795
|
},
|
|
2796
2796
|
resolve(y) {
|
|
2797
2797
|
let { lazy: g, loader: _, middleware: R } = a.route, b = d || s || y && !Ee(r.method) && (g || _), C = R && R.length > 0 && !_ && !g;
|
|
2798
|
-
return b && (Ee(r.method) || !C) ?
|
|
2798
|
+
return b && (Ee(r.method) || !C) ? bc({
|
|
2799
2799
|
request: r,
|
|
2800
2800
|
unstable_pattern: n,
|
|
2801
2801
|
match: a,
|
|
@@ -2833,7 +2833,7 @@ function Mt(e, t, r, n, a, i, o, s = null) {
|
|
|
2833
2833
|
s
|
|
2834
2834
|
));
|
|
2835
2835
|
}
|
|
2836
|
-
async function
|
|
2836
|
+
async function vc(e, t, r, n, a, i) {
|
|
2837
2837
|
r.some((c) => c._lazyPromises?.middleware) && await Promise.all(r.map((c) => c._lazyPromises?.middleware));
|
|
2838
2838
|
let o = {
|
|
2839
2839
|
request: t,
|
|
@@ -2868,7 +2868,7 @@ async function yc(e, t, r, n, a, i) {
|
|
|
2868
2868
|
}
|
|
2869
2869
|
return l;
|
|
2870
2870
|
}
|
|
2871
|
-
async function
|
|
2871
|
+
async function bc({
|
|
2872
2872
|
request: e,
|
|
2873
2873
|
unstable_pattern: t,
|
|
2874
2874
|
match: r,
|
|
@@ -2949,16 +2949,16 @@ async function vc({
|
|
|
2949
2949
|
}
|
|
2950
2950
|
return s;
|
|
2951
2951
|
}
|
|
2952
|
-
async function
|
|
2952
|
+
async function wc(e) {
|
|
2953
2953
|
let t = e.headers.get("Content-Type");
|
|
2954
2954
|
return t && /\bapplication\/json\b/.test(t) ? e.body == null ? null : e.json() : e.text();
|
|
2955
2955
|
}
|
|
2956
|
-
async function
|
|
2956
|
+
async function _c(e) {
|
|
2957
2957
|
let { result: t, type: r } = e;
|
|
2958
2958
|
if (ua(t)) {
|
|
2959
2959
|
let n;
|
|
2960
2960
|
try {
|
|
2961
|
-
n = await
|
|
2961
|
+
n = await wc(t);
|
|
2962
2962
|
} catch (a) {
|
|
2963
2963
|
return { type: "error", error: a };
|
|
2964
2964
|
}
|
|
@@ -2981,7 +2981,7 @@ async function wc(e) {
|
|
|
2981
2981
|
headers: t.init?.headers ? new Headers(t.init.headers) : void 0
|
|
2982
2982
|
} : {
|
|
2983
2983
|
type: "error",
|
|
2984
|
-
error:
|
|
2984
|
+
error: Tc(t),
|
|
2985
2985
|
statusCode: lr(t) ? t.status : void 0,
|
|
2986
2986
|
headers: t.init?.headers ? new Headers(t.init.headers) : void 0
|
|
2987
2987
|
} : {
|
|
@@ -2995,7 +2995,7 @@ async function wc(e) {
|
|
|
2995
2995
|
headers: t.init?.headers ? new Headers(t.init.headers) : void 0
|
|
2996
2996
|
} : { type: "data", data: t };
|
|
2997
2997
|
}
|
|
2998
|
-
function
|
|
2998
|
+
function Ec(e, t, r, n, a) {
|
|
2999
2999
|
let i = e.headers.get("Location");
|
|
3000
3000
|
if (Y(
|
|
3001
3001
|
i,
|
|
@@ -3064,7 +3064,7 @@ function hi(e) {
|
|
|
3064
3064
|
t.append(r, n);
|
|
3065
3065
|
return t;
|
|
3066
3066
|
}
|
|
3067
|
-
function
|
|
3067
|
+
function Sc(e, t, r, n = !1, a = !1) {
|
|
3068
3068
|
let i = {}, o = null, s, l = !1, c = {}, d = r && ke(r[1]) ? r[1].error : void 0;
|
|
3069
3069
|
return e.forEach((h) => {
|
|
3070
3070
|
if (!(h.route.id in t))
|
|
@@ -3092,7 +3092,7 @@ function Ec(e, t, r, n = !1, a = !1) {
|
|
|
3092
3092
|
};
|
|
3093
3093
|
}
|
|
3094
3094
|
function pi(e, t, r, n, a, i) {
|
|
3095
|
-
let { loaderData: o, errors: s } =
|
|
3095
|
+
let { loaderData: o, errors: s } = Sc(
|
|
3096
3096
|
t,
|
|
3097
3097
|
r,
|
|
3098
3098
|
n
|
|
@@ -3181,25 +3181,25 @@ function Do(e) {
|
|
|
3181
3181
|
let t = typeof e == "string" ? ht(e) : e;
|
|
3182
3182
|
return We({ ...t, hash: "" });
|
|
3183
3183
|
}
|
|
3184
|
-
function
|
|
3184
|
+
function Rc(e, t) {
|
|
3185
3185
|
return e.pathname !== t.pathname || e.search !== t.search ? !1 : e.hash === "" ? t.hash !== "" : e.hash === t.hash ? !0 : t.hash !== "";
|
|
3186
3186
|
}
|
|
3187
|
-
function
|
|
3187
|
+
function Tc(e) {
|
|
3188
3188
|
return new pr(
|
|
3189
3189
|
e.init?.status ?? 500,
|
|
3190
3190
|
e.init?.statusText ?? "Internal Server Error",
|
|
3191
3191
|
e.data
|
|
3192
3192
|
);
|
|
3193
3193
|
}
|
|
3194
|
-
function
|
|
3194
|
+
function xc(e) {
|
|
3195
3195
|
return e != null && typeof e == "object" && Object.entries(e).every(
|
|
3196
|
-
([t, r]) => typeof t == "string" &&
|
|
3196
|
+
([t, r]) => typeof t == "string" && Cc(r)
|
|
3197
3197
|
);
|
|
3198
3198
|
}
|
|
3199
|
-
function
|
|
3199
|
+
function Cc(e) {
|
|
3200
3200
|
return e != null && typeof e == "object" && "type" in e && "result" in e && (e.type === "data" || e.type === "error");
|
|
3201
3201
|
}
|
|
3202
|
-
function
|
|
3202
|
+
function kc(e) {
|
|
3203
3203
|
return ua(e.result) && Co.has(e.result.status);
|
|
3204
3204
|
}
|
|
3205
3205
|
function ke(e) {
|
|
@@ -3214,17 +3214,17 @@ function yi(e) {
|
|
|
3214
3214
|
function ua(e) {
|
|
3215
3215
|
return e != null && typeof e.status == "number" && typeof e.statusText == "string" && typeof e.headers == "object" && typeof e.body < "u";
|
|
3216
3216
|
}
|
|
3217
|
-
function kc(e) {
|
|
3218
|
-
return Co.has(e);
|
|
3219
|
-
}
|
|
3220
3217
|
function Ac(e) {
|
|
3221
|
-
return
|
|
3218
|
+
return Co.has(e);
|
|
3222
3219
|
}
|
|
3223
3220
|
function Pc(e) {
|
|
3224
|
-
return
|
|
3221
|
+
return ua(e) && Ac(e.status) && e.headers.has("Location");
|
|
3222
|
+
}
|
|
3223
|
+
function Mc(e) {
|
|
3224
|
+
return sc.has(e.toUpperCase());
|
|
3225
3225
|
}
|
|
3226
3226
|
function Ee(e) {
|
|
3227
|
-
return
|
|
3227
|
+
return ic.has(e.toUpperCase());
|
|
3228
3228
|
}
|
|
3229
3229
|
function da(e) {
|
|
3230
3230
|
return new URLSearchParams(e).getAll("index").some((t) => t === "");
|
|
@@ -3289,7 +3289,7 @@ function Pn(e, t) {
|
|
|
3289
3289
|
text: void 0
|
|
3290
3290
|
};
|
|
3291
3291
|
}
|
|
3292
|
-
function
|
|
3292
|
+
function Ic(e, t) {
|
|
3293
3293
|
return {
|
|
3294
3294
|
state: "submitting",
|
|
3295
3295
|
location: e,
|
|
@@ -3322,7 +3322,7 @@ function qt(e, t) {
|
|
|
3322
3322
|
data: t
|
|
3323
3323
|
};
|
|
3324
3324
|
}
|
|
3325
|
-
function
|
|
3325
|
+
function Lc(e, t) {
|
|
3326
3326
|
return {
|
|
3327
3327
|
state: "submitting",
|
|
3328
3328
|
formMethod: e.formMethod,
|
|
@@ -3346,7 +3346,7 @@ function tt(e) {
|
|
|
3346
3346
|
data: e
|
|
3347
3347
|
};
|
|
3348
3348
|
}
|
|
3349
|
-
function
|
|
3349
|
+
function Oc(e, t) {
|
|
3350
3350
|
try {
|
|
3351
3351
|
let r = e.sessionStorage.getItem(
|
|
3352
3352
|
ko
|
|
@@ -3359,7 +3359,7 @@ function Lc(e, t) {
|
|
|
3359
3359
|
} catch {
|
|
3360
3360
|
}
|
|
3361
3361
|
}
|
|
3362
|
-
function
|
|
3362
|
+
function Dc(e, t) {
|
|
3363
3363
|
if (t.size > 0) {
|
|
3364
3364
|
let r = {};
|
|
3365
3365
|
for (let [n, a] of t)
|
|
@@ -3406,7 +3406,7 @@ Rt.displayName = "DataRouter";
|
|
|
3406
3406
|
var gr = w.createContext(null);
|
|
3407
3407
|
gr.displayName = "DataRouterState";
|
|
3408
3408
|
var No = w.createContext(!1);
|
|
3409
|
-
function
|
|
3409
|
+
function Nc() {
|
|
3410
3410
|
return w.useContext(No);
|
|
3411
3411
|
}
|
|
3412
3412
|
var fa = w.createContext({
|
|
@@ -3417,8 +3417,8 @@ var $o = w.createContext(
|
|
|
3417
3417
|
/* @__PURE__ */ new Map()
|
|
3418
3418
|
);
|
|
3419
3419
|
$o.displayName = "Fetchers";
|
|
3420
|
-
var
|
|
3421
|
-
|
|
3420
|
+
var $c = w.createContext(null);
|
|
3421
|
+
$c.displayName = "Await";
|
|
3422
3422
|
var De = w.createContext(
|
|
3423
3423
|
null
|
|
3424
3424
|
);
|
|
@@ -3435,9 +3435,9 @@ var Ge = w.createContext({
|
|
|
3435
3435
|
Ge.displayName = "Route";
|
|
3436
3436
|
var ha = w.createContext(null);
|
|
3437
3437
|
ha.displayName = "RouteError";
|
|
3438
|
-
var Fo = "REACT_ROUTER_ERROR",
|
|
3439
|
-
function
|
|
3440
|
-
if (e.startsWith(`${Fo}:${
|
|
3438
|
+
var Fo = "REACT_ROUTER_ERROR", Fc = "REDIRECT", Uc = "ROUTE_ERROR_RESPONSE";
|
|
3439
|
+
function Bc(e) {
|
|
3440
|
+
if (e.startsWith(`${Fo}:${Fc}:{`))
|
|
3441
3441
|
try {
|
|
3442
3442
|
let t = JSON.parse(e.slice(28));
|
|
3443
3443
|
if (typeof t == "object" && t && typeof t.status == "number" && typeof t.statusText == "string" && typeof t.location == "string" && typeof t.reloadDocument == "boolean" && typeof t.replace == "boolean")
|
|
@@ -3445,9 +3445,9 @@ function Uc(e) {
|
|
|
3445
3445
|
} catch {
|
|
3446
3446
|
}
|
|
3447
3447
|
}
|
|
3448
|
-
function
|
|
3448
|
+
function jc(e) {
|
|
3449
3449
|
if (e.startsWith(
|
|
3450
|
-
`${Fo}:${
|
|
3450
|
+
`${Fo}:${Uc}:{`
|
|
3451
3451
|
))
|
|
3452
3452
|
try {
|
|
3453
3453
|
let t = JSON.parse(e.slice(40));
|
|
@@ -3460,7 +3460,7 @@ function Bc(e) {
|
|
|
3460
3460
|
} catch {
|
|
3461
3461
|
}
|
|
3462
3462
|
}
|
|
3463
|
-
function
|
|
3463
|
+
function zc(e, { relative: t } = {}) {
|
|
3464
3464
|
Y(
|
|
3465
3465
|
yr(),
|
|
3466
3466
|
// TODO: This error is probably because they somehow have 2 versions of the
|
|
@@ -3485,11 +3485,11 @@ var Uo = "You should call navigate() in a React.useEffect(), not when your compo
|
|
|
3485
3485
|
function Bo(e) {
|
|
3486
3486
|
w.useContext(De).static || w.useLayoutEffect(e);
|
|
3487
3487
|
}
|
|
3488
|
-
function
|
|
3488
|
+
function Hc() {
|
|
3489
3489
|
let { isDataRoute: e } = w.useContext(Ge);
|
|
3490
|
-
return e ?
|
|
3490
|
+
return e ? nu() : Vc();
|
|
3491
3491
|
}
|
|
3492
|
-
function
|
|
3492
|
+
function Vc() {
|
|
3493
3493
|
Y(
|
|
3494
3494
|
yr(),
|
|
3495
3495
|
// TODO: This error is probably because they somehow have 2 versions of the
|
|
@@ -3528,7 +3528,7 @@ function Hc() {
|
|
|
3528
3528
|
);
|
|
3529
3529
|
}
|
|
3530
3530
|
w.createContext(null);
|
|
3531
|
-
function
|
|
3531
|
+
function qc() {
|
|
3532
3532
|
let { matches: e } = w.useContext(Ge), t = e[e.length - 1];
|
|
3533
3533
|
return t ? t.params : {};
|
|
3534
3534
|
}
|
|
@@ -3544,7 +3544,7 @@ function vr(e, { relative: t } = {}) {
|
|
|
3544
3544
|
[e, a, n, t]
|
|
3545
3545
|
);
|
|
3546
3546
|
}
|
|
3547
|
-
function
|
|
3547
|
+
function Wc(e, t, r, n, a) {
|
|
3548
3548
|
Y(
|
|
3549
3549
|
yr(),
|
|
3550
3550
|
// TODO: This error is probably because they somehow have 2 versions of the
|
|
@@ -3576,7 +3576,7 @@ Please change the parent <Route path="${E}"> to <Route path="${E === "/" ? "*" :
|
|
|
3576
3576
|
), ue(
|
|
3577
3577
|
b == null || b[b.length - 1].route.element !== void 0 || b[b.length - 1].route.Component !== void 0 || b[b.length - 1].route.lazy !== void 0,
|
|
3578
3578
|
`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`
|
|
3579
|
-
),
|
|
3579
|
+
), Jc(
|
|
3580
3580
|
b && b.map(
|
|
3581
3581
|
(E) => Object.assign({}, E, {
|
|
3582
3582
|
params: Object.assign({}, l, E.params),
|
|
@@ -3608,14 +3608,14 @@ Please change the parent <Route path="${E}"> to <Route path="${E === "/" ? "*" :
|
|
|
3608
3608
|
a
|
|
3609
3609
|
);
|
|
3610
3610
|
}
|
|
3611
|
-
function
|
|
3612
|
-
let e =
|
|
3611
|
+
function Kc() {
|
|
3612
|
+
let e = ru(), t = lr(e) ? `${e.status} ${e.statusText}` : e instanceof Error ? e.message : JSON.stringify(e), r = e instanceof Error ? e.stack : null, n = "rgba(200,200,200, 0.5)", a = { padding: "0.5rem", backgroundColor: n }, i = { padding: "2px 4px", backgroundColor: n }, o = null;
|
|
3613
3613
|
return console.error(
|
|
3614
3614
|
"Error handled by React Router default ErrorBoundary:",
|
|
3615
3615
|
e
|
|
3616
3616
|
), o = /* @__PURE__ */ w.createElement(w.Fragment, null, /* @__PURE__ */ w.createElement("p", null, "💿 Hey developer 👋"), /* @__PURE__ */ w.createElement("p", null, "You can provide a way better UX than this when your app throws errors by providing your own ", /* @__PURE__ */ w.createElement("code", { style: i }, "ErrorBoundary"), " or", " ", /* @__PURE__ */ w.createElement("code", { style: i }, "errorElement"), " prop on your route.")), /* @__PURE__ */ w.createElement(w.Fragment, null, /* @__PURE__ */ w.createElement("h2", null, "Unexpected Application Error!"), /* @__PURE__ */ w.createElement("h3", { style: { fontStyle: "italic" } }, t), r ? /* @__PURE__ */ w.createElement("pre", { style: a }, r) : null, o);
|
|
3617
3617
|
}
|
|
3618
|
-
var
|
|
3618
|
+
var Gc = /* @__PURE__ */ w.createElement(Kc, null), jo = class extends w.Component {
|
|
3619
3619
|
constructor(e) {
|
|
3620
3620
|
super(e), this.state = {
|
|
3621
3621
|
location: e.location,
|
|
@@ -3646,7 +3646,7 @@ var Kc = /* @__PURE__ */ w.createElement(Wc, null), jo = class extends w.Compone
|
|
|
3646
3646
|
render() {
|
|
3647
3647
|
let e = this.state.error;
|
|
3648
3648
|
if (this.context && typeof e == "object" && e && "digest" in e && typeof e.digest == "string") {
|
|
3649
|
-
const r =
|
|
3649
|
+
const r = jc(e.digest);
|
|
3650
3650
|
r && (e = r);
|
|
3651
3651
|
}
|
|
3652
3652
|
let t = e !== void 0 ? /* @__PURE__ */ w.createElement(Ge.Provider, { value: this.props.routeContext }, /* @__PURE__ */ w.createElement(
|
|
@@ -3656,18 +3656,18 @@ var Kc = /* @__PURE__ */ w.createElement(Wc, null), jo = class extends w.Compone
|
|
|
3656
3656
|
children: this.props.component
|
|
3657
3657
|
}
|
|
3658
3658
|
)) : this.props.children;
|
|
3659
|
-
return this.context ? /* @__PURE__ */ w.createElement(
|
|
3659
|
+
return this.context ? /* @__PURE__ */ w.createElement(Yc, { error: e }, t) : t;
|
|
3660
3660
|
}
|
|
3661
3661
|
};
|
|
3662
3662
|
jo.contextType = No;
|
|
3663
3663
|
var Mn = /* @__PURE__ */ new WeakMap();
|
|
3664
|
-
function
|
|
3664
|
+
function Yc({
|
|
3665
3665
|
children: e,
|
|
3666
3666
|
error: t
|
|
3667
3667
|
}) {
|
|
3668
3668
|
let { basename: r } = w.useContext(De);
|
|
3669
3669
|
if (typeof t == "object" && t && "digest" in t && typeof t.digest == "string") {
|
|
3670
|
-
let n =
|
|
3670
|
+
let n = Bc(t.digest);
|
|
3671
3671
|
if (n) {
|
|
3672
3672
|
let a = Mn.get(t);
|
|
3673
3673
|
if (a) throw a;
|
|
@@ -3694,11 +3694,11 @@ function Gc({
|
|
|
3694
3694
|
}
|
|
3695
3695
|
return e;
|
|
3696
3696
|
}
|
|
3697
|
-
function
|
|
3697
|
+
function Xc({ routeContext: e, match: t, children: r }) {
|
|
3698
3698
|
let n = w.useContext(Rt);
|
|
3699
3699
|
return n && n.static && n.staticContext && (t.route.errorElement || t.route.ErrorBoundary) && (n.staticContext._deepestRenderedBoundaryId = t.route.id), /* @__PURE__ */ w.createElement(Ge.Provider, { value: e }, r);
|
|
3700
3700
|
}
|
|
3701
|
-
function
|
|
3701
|
+
function Jc(e, t = [], r = null, n = null, a = null) {
|
|
3702
3702
|
if (e == null) {
|
|
3703
3703
|
if (!r)
|
|
3704
3704
|
return null;
|
|
@@ -3747,7 +3747,7 @@ function Xc(e, t = [], r = null, n = null, a = null) {
|
|
|
3747
3747
|
return i.reduceRight(
|
|
3748
3748
|
(d, h, y) => {
|
|
3749
3749
|
let g, _ = !1, R = null, b = null;
|
|
3750
|
-
r && (g = o && h.route.id ? o[h.route.id] : void 0, R = h.route.errorElement ||
|
|
3750
|
+
r && (g = o && h.route.id ? o[h.route.id] : void 0, R = h.route.errorElement || Gc, s && (l < 0 && y === 0 ? (zo(
|
|
3751
3751
|
"route-fallback",
|
|
3752
3752
|
!1,
|
|
3753
3753
|
"No `HydrateFallback` element provided to render during initial hydration"
|
|
@@ -3755,7 +3755,7 @@ function Xc(e, t = [], r = null, n = null, a = null) {
|
|
|
3755
3755
|
let C = t.concat(i.slice(0, y + 1)), E = () => {
|
|
3756
3756
|
let A;
|
|
3757
3757
|
return g ? A = R : _ ? A = b : h.route.Component ? A = /* @__PURE__ */ w.createElement(h.route.Component, null) : h.route.element ? A = h.route.element : A = d, /* @__PURE__ */ w.createElement(
|
|
3758
|
-
|
|
3758
|
+
Xc,
|
|
3759
3759
|
{
|
|
3760
3760
|
match: h,
|
|
3761
3761
|
routeContext: {
|
|
@@ -3786,33 +3786,33 @@ function Xc(e, t = [], r = null, n = null, a = null) {
|
|
|
3786
3786
|
function pa(e) {
|
|
3787
3787
|
return `${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
|
|
3788
3788
|
}
|
|
3789
|
-
function
|
|
3789
|
+
function Qc(e) {
|
|
3790
3790
|
let t = w.useContext(Rt);
|
|
3791
3791
|
return Y(t, pa(e)), t;
|
|
3792
3792
|
}
|
|
3793
|
-
function
|
|
3793
|
+
function Zc(e) {
|
|
3794
3794
|
let t = w.useContext(gr);
|
|
3795
3795
|
return Y(t, pa(e)), t;
|
|
3796
3796
|
}
|
|
3797
|
-
function
|
|
3797
|
+
function eu(e) {
|
|
3798
3798
|
let t = w.useContext(Ge);
|
|
3799
3799
|
return Y(t, pa(e)), t;
|
|
3800
3800
|
}
|
|
3801
3801
|
function ma(e) {
|
|
3802
|
-
let t =
|
|
3802
|
+
let t = eu(e), r = t.matches[t.matches.length - 1];
|
|
3803
3803
|
return Y(
|
|
3804
3804
|
r.route.id,
|
|
3805
3805
|
`${e} can only be used on routes that contain a unique "id"`
|
|
3806
3806
|
), r.route.id;
|
|
3807
3807
|
}
|
|
3808
|
-
function
|
|
3808
|
+
function tu() {
|
|
3809
3809
|
return ma(
|
|
3810
3810
|
"useRouteId"
|
|
3811
3811
|
/* UseRouteId */
|
|
3812
3812
|
);
|
|
3813
3813
|
}
|
|
3814
|
-
function
|
|
3815
|
-
let e = w.useContext(ha), t =
|
|
3814
|
+
function ru() {
|
|
3815
|
+
let e = w.useContext(ha), t = Zc(
|
|
3816
3816
|
"useRouteError"
|
|
3817
3817
|
/* UseRouteError */
|
|
3818
3818
|
), r = ma(
|
|
@@ -3821,8 +3821,8 @@ function tu() {
|
|
|
3821
3821
|
);
|
|
3822
3822
|
return e !== void 0 ? e : t.errors?.[r];
|
|
3823
3823
|
}
|
|
3824
|
-
function
|
|
3825
|
-
let { router: e } =
|
|
3824
|
+
function nu() {
|
|
3825
|
+
let { router: e } = Qc(
|
|
3826
3826
|
"useNavigate"
|
|
3827
3827
|
/* UseNavigateStable */
|
|
3828
3828
|
), t = ma(
|
|
@@ -3846,12 +3846,12 @@ var _i = {};
|
|
|
3846
3846
|
function Ei(e, t) {
|
|
3847
3847
|
!e && !_i[t] && (_i[t] = !0, console.warn(t));
|
|
3848
3848
|
}
|
|
3849
|
-
var
|
|
3849
|
+
var au = "useOptimistic", Si = w[au], iu = () => {
|
|
3850
3850
|
};
|
|
3851
|
-
function iu(e) {
|
|
3852
|
-
return Si ? Si(e) : [e, au];
|
|
3853
|
-
}
|
|
3854
3851
|
function ou(e) {
|
|
3852
|
+
return Si ? Si(e) : [e, iu];
|
|
3853
|
+
}
|
|
3854
|
+
function su(e) {
|
|
3855
3855
|
let t = {
|
|
3856
3856
|
// Note: this check also occurs in createRoutesFromChildren so update
|
|
3857
3857
|
// there if you change this -- please and thank you!
|
|
@@ -3877,10 +3877,10 @@ function ou(e) {
|
|
|
3877
3877
|
ErrorBoundary: void 0
|
|
3878
3878
|
})), t;
|
|
3879
3879
|
}
|
|
3880
|
-
var
|
|
3880
|
+
var lu = [
|
|
3881
3881
|
"HydrateFallback",
|
|
3882
3882
|
"hydrateFallbackElement"
|
|
3883
|
-
],
|
|
3883
|
+
], cu = class {
|
|
3884
3884
|
constructor() {
|
|
3885
3885
|
this.status = "pending", this.promise = new Promise((e, t) => {
|
|
3886
3886
|
this.resolve = (r) => {
|
|
@@ -3891,14 +3891,14 @@ var su = [
|
|
|
3891
3891
|
});
|
|
3892
3892
|
}
|
|
3893
3893
|
};
|
|
3894
|
-
function
|
|
3894
|
+
function uu({
|
|
3895
3895
|
router: e,
|
|
3896
3896
|
flushSync: t,
|
|
3897
3897
|
onError: r,
|
|
3898
3898
|
unstable_useTransitions: n
|
|
3899
3899
|
}) {
|
|
3900
|
-
n =
|
|
3901
|
-
let [i, o] = w.useState(e.state), [s, l] =
|
|
3900
|
+
n = Nc() || n;
|
|
3901
|
+
let [i, o] = w.useState(e.state), [s, l] = ou(i), [c, d] = w.useState(), [h, y] = w.useState({
|
|
3902
3902
|
isTransitioning: !1
|
|
3903
3903
|
}), [g, _] = w.useState(), [R, b] = w.useState(), [C, E] = w.useState(), A = w.useRef(/* @__PURE__ */ new Map()), j = w.useCallback(
|
|
3904
3904
|
(P, { deletedFetchers: z, newErrors: B, flushSync: F, viewTransitionOpts: Z }) => {
|
|
@@ -3965,7 +3965,7 @@ function cu({
|
|
|
3965
3965
|
]
|
|
3966
3966
|
);
|
|
3967
3967
|
w.useLayoutEffect(() => e.subscribe(j), [e, j]), w.useEffect(() => {
|
|
3968
|
-
h.isTransitioning && !h.flushSync && _(new
|
|
3968
|
+
h.isTransitioning && !h.flushSync && _(new cu());
|
|
3969
3969
|
}, [h]), w.useEffect(() => {
|
|
3970
3970
|
if (g && c && e.window) {
|
|
3971
3971
|
let P = c, z = g.promise, B = e.window.document.startViewTransition(async () => {
|
|
@@ -4017,7 +4017,7 @@ function cu({
|
|
|
4017
4017
|
[e, S, q, r]
|
|
4018
4018
|
);
|
|
4019
4019
|
return /* @__PURE__ */ w.createElement(w.Fragment, null, /* @__PURE__ */ w.createElement(Rt.Provider, { value: m }, /* @__PURE__ */ w.createElement(gr.Provider, { value: s }, /* @__PURE__ */ w.createElement($o.Provider, { value: A.current }, /* @__PURE__ */ w.createElement(fa.Provider, { value: h }, /* @__PURE__ */ w.createElement(
|
|
4020
|
-
|
|
4020
|
+
hu,
|
|
4021
4021
|
{
|
|
4022
4022
|
basename: q,
|
|
4023
4023
|
location: s.location,
|
|
@@ -4026,7 +4026,7 @@ function cu({
|
|
|
4026
4026
|
unstable_useTransitions: n
|
|
4027
4027
|
},
|
|
4028
4028
|
/* @__PURE__ */ w.createElement(
|
|
4029
|
-
|
|
4029
|
+
du,
|
|
4030
4030
|
{
|
|
4031
4031
|
routes: e.routes,
|
|
4032
4032
|
future: e.future,
|
|
@@ -4050,16 +4050,16 @@ function Ri(e, t) {
|
|
|
4050
4050
|
fetchers: t.fetchers
|
|
4051
4051
|
};
|
|
4052
4052
|
}
|
|
4053
|
-
var
|
|
4054
|
-
function
|
|
4053
|
+
var du = w.memo(fu);
|
|
4054
|
+
function fu({
|
|
4055
4055
|
routes: e,
|
|
4056
4056
|
future: t,
|
|
4057
4057
|
state: r,
|
|
4058
4058
|
onError: n
|
|
4059
4059
|
}) {
|
|
4060
|
-
return
|
|
4060
|
+
return Wc(e, void 0, r, n, t);
|
|
4061
4061
|
}
|
|
4062
|
-
function
|
|
4062
|
+
function hu({
|
|
4063
4063
|
basename: e = "/",
|
|
4064
4064
|
children: t = null,
|
|
4065
4065
|
location: r,
|
|
@@ -4111,25 +4111,25 @@ var Hr = "get", Vr = "application/x-www-form-urlencoded";
|
|
|
4111
4111
|
function dn(e) {
|
|
4112
4112
|
return typeof HTMLElement < "u" && e instanceof HTMLElement;
|
|
4113
4113
|
}
|
|
4114
|
-
function
|
|
4114
|
+
function pu(e) {
|
|
4115
4115
|
return dn(e) && e.tagName.toLowerCase() === "button";
|
|
4116
4116
|
}
|
|
4117
|
-
function
|
|
4117
|
+
function mu(e) {
|
|
4118
4118
|
return dn(e) && e.tagName.toLowerCase() === "form";
|
|
4119
4119
|
}
|
|
4120
|
-
function
|
|
4120
|
+
function gu(e) {
|
|
4121
4121
|
return dn(e) && e.tagName.toLowerCase() === "input";
|
|
4122
4122
|
}
|
|
4123
|
-
function
|
|
4123
|
+
function yu(e) {
|
|
4124
4124
|
return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey);
|
|
4125
4125
|
}
|
|
4126
|
-
function
|
|
4126
|
+
function vu(e, t) {
|
|
4127
4127
|
return e.button === 0 && // Ignore everything but left clicks
|
|
4128
4128
|
(!t || t === "_self") && // Let browser handle "target=_blank" etc.
|
|
4129
|
-
!
|
|
4129
|
+
!yu(e);
|
|
4130
4130
|
}
|
|
4131
4131
|
var Ir = null;
|
|
4132
|
-
function
|
|
4132
|
+
function bu() {
|
|
4133
4133
|
if (Ir === null)
|
|
4134
4134
|
try {
|
|
4135
4135
|
new FormData(
|
|
@@ -4142,30 +4142,30 @@ function vu() {
|
|
|
4142
4142
|
}
|
|
4143
4143
|
return Ir;
|
|
4144
4144
|
}
|
|
4145
|
-
var
|
|
4145
|
+
var wu = /* @__PURE__ */ new Set([
|
|
4146
4146
|
"application/x-www-form-urlencoded",
|
|
4147
4147
|
"multipart/form-data",
|
|
4148
4148
|
"text/plain"
|
|
4149
4149
|
]);
|
|
4150
4150
|
function In(e) {
|
|
4151
|
-
return e != null && !
|
|
4151
|
+
return e != null && !wu.has(e) ? (ue(
|
|
4152
4152
|
!1,
|
|
4153
4153
|
`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Vr}"`
|
|
4154
4154
|
), null) : e;
|
|
4155
4155
|
}
|
|
4156
|
-
function
|
|
4156
|
+
function _u(e, t) {
|
|
4157
4157
|
let r, n, a, i, o;
|
|
4158
|
-
if (
|
|
4158
|
+
if (mu(e)) {
|
|
4159
4159
|
let s = e.getAttribute("action");
|
|
4160
4160
|
n = s ? Oe(s, t) : null, r = e.getAttribute("method") || Hr, a = In(e.getAttribute("enctype")) || Vr, i = new FormData(e);
|
|
4161
|
-
} else if (
|
|
4161
|
+
} else if (pu(e) || gu(e) && (e.type === "submit" || e.type === "image")) {
|
|
4162
4162
|
let s = e.form;
|
|
4163
4163
|
if (s == null)
|
|
4164
4164
|
throw new Error(
|
|
4165
4165
|
'Cannot submit a <button> or <input type="submit"> without a <form>'
|
|
4166
4166
|
);
|
|
4167
4167
|
let l = e.getAttribute("formaction") || s.getAttribute("action");
|
|
4168
|
-
if (n = l ? Oe(l, t) : null, r = e.getAttribute("formmethod") || s.getAttribute("method") || Hr, a = In(e.getAttribute("formenctype")) || In(s.getAttribute("enctype")) || Vr, i = new FormData(s, e), !
|
|
4168
|
+
if (n = l ? Oe(l, t) : null, r = e.getAttribute("formmethod") || s.getAttribute("method") || Hr, a = In(e.getAttribute("formenctype")) || In(s.getAttribute("enctype")) || Vr, i = new FormData(s, e), !bu()) {
|
|
4169
4169
|
let { name: c, type: d, value: h } = e;
|
|
4170
4170
|
if (d === "image") {
|
|
4171
4171
|
let y = c ? `${c}.` : "";
|
|
@@ -4186,7 +4186,7 @@ function ga(e, t) {
|
|
|
4186
4186
|
if (e === !1 || e === null || typeof e > "u")
|
|
4187
4187
|
throw new Error(t);
|
|
4188
4188
|
}
|
|
4189
|
-
function
|
|
4189
|
+
function Eu(e, t, r, n) {
|
|
4190
4190
|
let a = typeof e == "string" ? new URL(
|
|
4191
4191
|
e,
|
|
4192
4192
|
// This can be called during the SSR flow via PrefetchPageLinksImpl so
|
|
@@ -4195,7 +4195,7 @@ function _u(e, t, r, n) {
|
|
|
4195
4195
|
) : e;
|
|
4196
4196
|
return r ? a.pathname.endsWith("/") ? a.pathname = `${a.pathname}_.${n}` : a.pathname = `${a.pathname}.${n}` : a.pathname === "/" ? a.pathname = `_root.${n}` : t && Oe(a.pathname, t) === "/" ? a.pathname = `${t.replace(/\/$/, "")}/_root.${n}` : a.pathname = `${a.pathname.replace(/\/$/, "")}.${n}`, a;
|
|
4197
4197
|
}
|
|
4198
|
-
async function
|
|
4198
|
+
async function Su(e, t) {
|
|
4199
4199
|
if (e.id in t)
|
|
4200
4200
|
return t[e.id];
|
|
4201
4201
|
try {
|
|
@@ -4212,22 +4212,22 @@ async function Eu(e, t) {
|
|
|
4212
4212
|
});
|
|
4213
4213
|
}
|
|
4214
4214
|
}
|
|
4215
|
-
function
|
|
4215
|
+
function Ru(e) {
|
|
4216
4216
|
return e == null ? !1 : e.href == null ? e.rel === "preload" && typeof e.imageSrcSet == "string" && typeof e.imageSizes == "string" : typeof e.rel == "string" && typeof e.href == "string";
|
|
4217
4217
|
}
|
|
4218
|
-
async function
|
|
4218
|
+
async function Tu(e, t, r) {
|
|
4219
4219
|
let n = await Promise.all(
|
|
4220
4220
|
e.map(async (a) => {
|
|
4221
4221
|
let i = t.routes[a.route.id];
|
|
4222
4222
|
if (i) {
|
|
4223
|
-
let o = await
|
|
4223
|
+
let o = await Su(i, r);
|
|
4224
4224
|
return o.links ? o.links() : [];
|
|
4225
4225
|
}
|
|
4226
4226
|
return [];
|
|
4227
4227
|
})
|
|
4228
4228
|
);
|
|
4229
|
-
return
|
|
4230
|
-
n.flat(1).filter(
|
|
4229
|
+
return Au(
|
|
4230
|
+
n.flat(1).filter(Ru).filter((a) => a.rel === "stylesheet" || a.rel === "preload").map(
|
|
4231
4231
|
(a) => a.rel === "stylesheet" ? { ...a, rel: "prefetch", as: "style" } : { ...a, rel: "prefetch" }
|
|
4232
4232
|
)
|
|
4233
4233
|
);
|
|
@@ -4264,8 +4264,8 @@ function Ti(e, t, r, n, a, i) {
|
|
|
4264
4264
|
return !0;
|
|
4265
4265
|
}) : [];
|
|
4266
4266
|
}
|
|
4267
|
-
function
|
|
4268
|
-
return
|
|
4267
|
+
function xu(e, t, { includeHydrateFallback: r } = {}) {
|
|
4268
|
+
return Cu(
|
|
4269
4269
|
e.map((n) => {
|
|
4270
4270
|
let a = t.routes[n.route.id];
|
|
4271
4271
|
if (!a) return [];
|
|
@@ -4274,19 +4274,19 @@ function Tu(e, t, { includeHydrateFallback: r } = {}) {
|
|
|
4274
4274
|
}).flat(1)
|
|
4275
4275
|
);
|
|
4276
4276
|
}
|
|
4277
|
-
function
|
|
4277
|
+
function Cu(e) {
|
|
4278
4278
|
return [...new Set(e)];
|
|
4279
4279
|
}
|
|
4280
|
-
function
|
|
4280
|
+
function ku(e) {
|
|
4281
4281
|
let t = {}, r = Object.keys(e).sort();
|
|
4282
4282
|
for (let n of r)
|
|
4283
4283
|
t[n] = e[n];
|
|
4284
4284
|
return t;
|
|
4285
4285
|
}
|
|
4286
|
-
function
|
|
4286
|
+
function Au(e, t) {
|
|
4287
4287
|
let r = /* @__PURE__ */ new Set();
|
|
4288
4288
|
return new Set(t), e.reduce((n, a) => {
|
|
4289
|
-
let i = JSON.stringify(
|
|
4289
|
+
let i = JSON.stringify(ku(a));
|
|
4290
4290
|
return r.has(i) || (r.add(i), n.push({ key: i, link: a })), n;
|
|
4291
4291
|
}, []);
|
|
4292
4292
|
}
|
|
@@ -4297,7 +4297,7 @@ function Ho() {
|
|
|
4297
4297
|
"You must render this element inside a <DataRouterContext.Provider> element"
|
|
4298
4298
|
), e;
|
|
4299
4299
|
}
|
|
4300
|
-
function
|
|
4300
|
+
function Pu() {
|
|
4301
4301
|
let e = w.useContext(gr);
|
|
4302
4302
|
return ga(
|
|
4303
4303
|
e,
|
|
@@ -4313,7 +4313,7 @@ function Vo() {
|
|
|
4313
4313
|
"You must render this element inside a <HydratedRouter> element"
|
|
4314
4314
|
), e;
|
|
4315
4315
|
}
|
|
4316
|
-
function
|
|
4316
|
+
function Mu(e, t) {
|
|
4317
4317
|
let r = w.useContext(ya), [n, a] = w.useState(!1), [i, o] = w.useState(!1), { onFocus: s, onBlur: l, onMouseEnter: c, onMouseLeave: d, onTouchStart: h } = t, y = w.useRef(null);
|
|
4318
4318
|
w.useEffect(() => {
|
|
4319
4319
|
if (e === "render" && o(!0), e === "viewport") {
|
|
@@ -4358,18 +4358,18 @@ function Wt(e, t) {
|
|
|
4358
4358
|
e && e(r), r.defaultPrevented || t(r);
|
|
4359
4359
|
};
|
|
4360
4360
|
}
|
|
4361
|
-
function
|
|
4361
|
+
function Iu({ page: e, ...t }) {
|
|
4362
4362
|
let { router: r } = Ho(), n = w.useMemo(
|
|
4363
4363
|
() => lt(r.routes, e, r.basename),
|
|
4364
4364
|
[r.routes, e, r.basename]
|
|
4365
4365
|
);
|
|
4366
|
-
return n ? /* @__PURE__ */ w.createElement(
|
|
4366
|
+
return n ? /* @__PURE__ */ w.createElement(Ou, { page: e, matches: n, ...t }) : null;
|
|
4367
4367
|
}
|
|
4368
|
-
function
|
|
4368
|
+
function Lu(e) {
|
|
4369
4369
|
let { manifest: t, routeModules: r } = Vo(), [n, a] = w.useState([]);
|
|
4370
4370
|
return w.useEffect(() => {
|
|
4371
4371
|
let i = !1;
|
|
4372
|
-
return
|
|
4372
|
+
return Tu(e, t, r).then(
|
|
4373
4373
|
(o) => {
|
|
4374
4374
|
i || a(o);
|
|
4375
4375
|
}
|
|
@@ -4378,12 +4378,12 @@ function Iu(e) {
|
|
|
4378
4378
|
};
|
|
4379
4379
|
}, [e, t, r]), n;
|
|
4380
4380
|
}
|
|
4381
|
-
function
|
|
4381
|
+
function Ou({
|
|
4382
4382
|
page: e,
|
|
4383
4383
|
matches: t,
|
|
4384
4384
|
...r
|
|
4385
4385
|
}) {
|
|
4386
|
-
let n = pt(), { future: a, manifest: i, routeModules: o } = Vo(), { basename: s } = Ho(), { loaderData: l, matches: c } =
|
|
4386
|
+
let n = pt(), { future: a, manifest: i, routeModules: o } = Vo(), { basename: s } = Ho(), { loaderData: l, matches: c } = Pu(), d = w.useMemo(
|
|
4387
4387
|
() => Ti(
|
|
4388
4388
|
e,
|
|
4389
4389
|
t,
|
|
@@ -4412,7 +4412,7 @@ function Lu({
|
|
|
4412
4412
|
!A || !A.hasLoader || (!d.some((j) => j.route.id === E.route.id) && E.route.id in l && o[E.route.id]?.shouldRevalidate || A.hasClientLoader ? b = !0 : R.add(E.route.id));
|
|
4413
4413
|
}), R.size === 0)
|
|
4414
4414
|
return [];
|
|
4415
|
-
let C =
|
|
4415
|
+
let C = Eu(
|
|
4416
4416
|
e,
|
|
4417
4417
|
s,
|
|
4418
4418
|
a.unstable_trailingSlashAwareDataRequests,
|
|
@@ -4433,52 +4433,52 @@ function Lu({
|
|
|
4433
4433
|
e,
|
|
4434
4434
|
o
|
|
4435
4435
|
]), g = w.useMemo(
|
|
4436
|
-
() =>
|
|
4436
|
+
() => xu(h, i),
|
|
4437
4437
|
[h, i]
|
|
4438
|
-
), _ =
|
|
4438
|
+
), _ = Lu(h);
|
|
4439
4439
|
return /* @__PURE__ */ w.createElement(w.Fragment, null, y.map((R) => /* @__PURE__ */ w.createElement("link", { key: R, rel: "prefetch", as: "fetch", href: R, ...r })), g.map((R) => /* @__PURE__ */ w.createElement("link", { key: R, rel: "modulepreload", href: R, ...r })), _.map(({ key: R, link: b }) => (
|
|
4440
4440
|
// these don't spread `linkProps` because they are full link descriptors
|
|
4441
4441
|
// already with their own props
|
|
4442
4442
|
/* @__PURE__ */ w.createElement("link", { key: R, nonce: r.nonce, ...b })
|
|
4443
4443
|
)));
|
|
4444
4444
|
}
|
|
4445
|
-
function
|
|
4445
|
+
function Du(...e) {
|
|
4446
4446
|
return (t) => {
|
|
4447
4447
|
e.forEach((r) => {
|
|
4448
4448
|
typeof r == "function" ? r(t) : r != null && (r.current = t);
|
|
4449
4449
|
});
|
|
4450
4450
|
};
|
|
4451
4451
|
}
|
|
4452
|
-
var
|
|
4452
|
+
var Nu = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u";
|
|
4453
4453
|
try {
|
|
4454
|
-
|
|
4454
|
+
Nu && (window.__reactRouterVersion = // @ts-expect-error
|
|
4455
4455
|
"7.12.0");
|
|
4456
4456
|
} catch {
|
|
4457
4457
|
}
|
|
4458
|
-
function
|
|
4459
|
-
return
|
|
4458
|
+
function $u(e, t) {
|
|
4459
|
+
return dc({
|
|
4460
4460
|
basename: t?.basename,
|
|
4461
4461
|
getContext: t?.getContext,
|
|
4462
4462
|
future: t?.future,
|
|
4463
|
-
history:
|
|
4464
|
-
hydrationData: t?.hydrationData ||
|
|
4463
|
+
history: Cl({ window: t?.window }),
|
|
4464
|
+
hydrationData: t?.hydrationData || Fu(),
|
|
4465
4465
|
routes: e,
|
|
4466
|
-
mapRouteProperties:
|
|
4467
|
-
hydrationRouteProperties:
|
|
4466
|
+
mapRouteProperties: su,
|
|
4467
|
+
hydrationRouteProperties: lu,
|
|
4468
4468
|
dataStrategy: t?.dataStrategy,
|
|
4469
4469
|
patchRoutesOnNavigation: t?.patchRoutesOnNavigation,
|
|
4470
4470
|
window: t?.window,
|
|
4471
4471
|
unstable_instrumentations: t?.unstable_instrumentations
|
|
4472
4472
|
}).initialize();
|
|
4473
4473
|
}
|
|
4474
|
-
function
|
|
4474
|
+
function Fu() {
|
|
4475
4475
|
let e = window?.__staticRouterHydrationData;
|
|
4476
4476
|
return e && e.errors && (e = {
|
|
4477
4477
|
...e,
|
|
4478
|
-
errors:
|
|
4478
|
+
errors: Uu(e.errors)
|
|
4479
4479
|
}), e;
|
|
4480
4480
|
}
|
|
4481
|
-
function
|
|
4481
|
+
function Uu(e) {
|
|
4482
4482
|
if (!e) return null;
|
|
4483
4483
|
let t = Object.entries(e), r = {};
|
|
4484
4484
|
for (let [n, a] of t)
|
|
@@ -4525,10 +4525,10 @@ var qo = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, nn = w.forwardRef(
|
|
|
4525
4525
|
}, _) {
|
|
4526
4526
|
let { basename: R, unstable_useTransitions: b } = w.useContext(De), C = typeof c == "string" && qo.test(c), E = Ro(c, R);
|
|
4527
4527
|
c = E.to;
|
|
4528
|
-
let A =
|
|
4528
|
+
let A = zc(c, { relative: a }), [j, S, q] = Mu(
|
|
4529
4529
|
n,
|
|
4530
4530
|
g
|
|
4531
|
-
), m =
|
|
4531
|
+
), m = Hu(c, {
|
|
4532
4532
|
replace: o,
|
|
4533
4533
|
state: s,
|
|
4534
4534
|
target: l,
|
|
@@ -4550,17 +4550,17 @@ var qo = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, nn = w.forwardRef(
|
|
|
4550
4550
|
...q,
|
|
4551
4551
|
href: E.absoluteURL || A,
|
|
4552
4552
|
onClick: E.isExternal || i ? t : P,
|
|
4553
|
-
ref:
|
|
4553
|
+
ref: Du(_, S),
|
|
4554
4554
|
target: l,
|
|
4555
4555
|
"data-discover": !C && r === "render" ? "true" : void 0
|
|
4556
4556
|
}
|
|
4557
4557
|
)
|
|
4558
4558
|
);
|
|
4559
|
-
return j && !C ? /* @__PURE__ */ w.createElement(w.Fragment, null, z, /* @__PURE__ */ w.createElement(
|
|
4559
|
+
return j && !C ? /* @__PURE__ */ w.createElement(w.Fragment, null, z, /* @__PURE__ */ w.createElement(Iu, { page: A })) : z;
|
|
4560
4560
|
}
|
|
4561
4561
|
);
|
|
4562
4562
|
nn.displayName = "Link";
|
|
4563
|
-
var
|
|
4563
|
+
var Bu = w.forwardRef(
|
|
4564
4564
|
function({
|
|
4565
4565
|
"aria-current": t = "page",
|
|
4566
4566
|
caseSensitive: r = !1,
|
|
@@ -4574,7 +4574,7 @@ var Uu = w.forwardRef(
|
|
|
4574
4574
|
}, d) {
|
|
4575
4575
|
let h = vr(o, { relative: c.relative }), y = pt(), g = w.useContext(gr), { navigator: _, basename: R } = w.useContext(De), b = g != null && // Conditional usage is OK here because the usage of a data router is static
|
|
4576
4576
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
4577
|
-
|
|
4577
|
+
Gu(h) && s === !0, C = _.encodeLocation ? _.encodeLocation(h).pathname : h.pathname, E = y.pathname, A = g && g.navigation && g.navigation.location ? g.navigation.location.pathname : null;
|
|
4578
4578
|
r || (E = E.toLowerCase(), A = A ? A.toLowerCase() : null, C = C.toLowerCase()), A && R && (A = Oe(A, R) || A);
|
|
4579
4579
|
const j = C !== "/" && C.endsWith("/") ? C.length - 1 : C.length;
|
|
4580
4580
|
let S = E === C || !a && E.startsWith(C) && E.charAt(j) === "/", q = A != null && (A === C || !a && A.startsWith(C) && A.charAt(C.length) === "/"), m = {
|
|
@@ -4604,8 +4604,8 @@ var Uu = w.forwardRef(
|
|
|
4604
4604
|
);
|
|
4605
4605
|
}
|
|
4606
4606
|
);
|
|
4607
|
-
|
|
4608
|
-
var
|
|
4607
|
+
Bu.displayName = "NavLink";
|
|
4608
|
+
var ju = w.forwardRef(
|
|
4609
4609
|
({
|
|
4610
4610
|
discover: e = "render",
|
|
4611
4611
|
fetcherKey: t,
|
|
@@ -4622,7 +4622,7 @@ var Bu = w.forwardRef(
|
|
|
4622
4622
|
unstable_defaultShouldRevalidate: y,
|
|
4623
4623
|
...g
|
|
4624
4624
|
}, _) => {
|
|
4625
|
-
let { unstable_useTransitions: R } = w.useContext(De), b =
|
|
4625
|
+
let { unstable_useTransitions: R } = w.useContext(De), b = Wu(), C = Ku(s, { relative: c }), E = o.toLowerCase() === "get" ? "get" : "post", A = typeof s == "string" && qo.test(s), j = (S) => {
|
|
4626
4626
|
if (l && l(S), S.defaultPrevented) return;
|
|
4627
4627
|
S.preventDefault();
|
|
4628
4628
|
let q = S.nativeEvent.submitter, m = q?.getAttribute("formmethod") || o, P = () => b(q || S.currentTarget, {
|
|
@@ -4651,15 +4651,15 @@ var Bu = w.forwardRef(
|
|
|
4651
4651
|
);
|
|
4652
4652
|
}
|
|
4653
4653
|
);
|
|
4654
|
-
|
|
4655
|
-
function
|
|
4654
|
+
ju.displayName = "Form";
|
|
4655
|
+
function zu(e) {
|
|
4656
4656
|
return `${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
|
|
4657
4657
|
}
|
|
4658
4658
|
function Wo(e) {
|
|
4659
4659
|
let t = w.useContext(Rt);
|
|
4660
|
-
return Y(t,
|
|
4660
|
+
return Y(t, zu(e)), t;
|
|
4661
4661
|
}
|
|
4662
|
-
function
|
|
4662
|
+
function Hu(e, {
|
|
4663
4663
|
target: t,
|
|
4664
4664
|
replace: r,
|
|
4665
4665
|
state: n,
|
|
@@ -4669,10 +4669,10 @@ function zu(e, {
|
|
|
4669
4669
|
unstable_defaultShouldRevalidate: s,
|
|
4670
4670
|
unstable_useTransitions: l
|
|
4671
4671
|
} = {}) {
|
|
4672
|
-
let c =
|
|
4672
|
+
let c = Hc(), d = pt(), h = vr(e, { relative: i });
|
|
4673
4673
|
return w.useCallback(
|
|
4674
4674
|
(y) => {
|
|
4675
|
-
if (
|
|
4675
|
+
if (vu(y, t)) {
|
|
4676
4676
|
y.preventDefault();
|
|
4677
4677
|
let g = r !== void 0 ? r : We(d) === We(h), _ = () => c(e, {
|
|
4678
4678
|
replace: g,
|
|
@@ -4701,20 +4701,20 @@ function zu(e, {
|
|
|
4701
4701
|
]
|
|
4702
4702
|
);
|
|
4703
4703
|
}
|
|
4704
|
-
var
|
|
4705
|
-
function
|
|
4704
|
+
var Vu = 0, qu = () => `__${String(++Vu)}__`;
|
|
4705
|
+
function Wu() {
|
|
4706
4706
|
let { router: e } = Wo(
|
|
4707
4707
|
"useSubmit"
|
|
4708
4708
|
/* UseSubmit */
|
|
4709
|
-
), { basename: t } = w.useContext(De), r =
|
|
4709
|
+
), { basename: t } = w.useContext(De), r = tu(), n = e.fetch, a = e.navigate;
|
|
4710
4710
|
return w.useCallback(
|
|
4711
4711
|
async (i, o = {}) => {
|
|
4712
|
-
let { action: s, method: l, encType: c, formData: d, body: h } =
|
|
4712
|
+
let { action: s, method: l, encType: c, formData: d, body: h } = _u(
|
|
4713
4713
|
i,
|
|
4714
4714
|
t
|
|
4715
4715
|
);
|
|
4716
4716
|
if (o.navigate === !1) {
|
|
4717
|
-
let y = o.fetcherKey ||
|
|
4717
|
+
let y = o.fetcherKey || qu();
|
|
4718
4718
|
await n(y, r, o.action || s, {
|
|
4719
4719
|
unstable_defaultShouldRevalidate: o.unstable_defaultShouldRevalidate,
|
|
4720
4720
|
preventScrollReset: o.preventScrollReset,
|
|
@@ -4742,7 +4742,7 @@ function qu() {
|
|
|
4742
4742
|
[n, a, t, r]
|
|
4743
4743
|
);
|
|
4744
4744
|
}
|
|
4745
|
-
function
|
|
4745
|
+
function Ku(e, { relative: t } = {}) {
|
|
4746
4746
|
let { basename: r } = w.useContext(De), n = w.useContext(Ge);
|
|
4747
4747
|
Y(n, "useFormAction must be used inside a RouteContext");
|
|
4748
4748
|
let [a] = n.matches.slice(-1), i = { ...vr(e || ".", { relative: t }) }, o = pt();
|
|
@@ -4757,7 +4757,7 @@ function Wu(e, { relative: t } = {}) {
|
|
|
4757
4757
|
}
|
|
4758
4758
|
return (!e || e === ".") && a.route.index && (i.search = i.search ? i.search.replace(/^\?/, "?index&") : "?index"), r !== "/" && (i.pathname = i.pathname === "/" ? r : qe([r, i.pathname])), We(i);
|
|
4759
4759
|
}
|
|
4760
|
-
function
|
|
4760
|
+
function Gu(e, { relative: t } = {}) {
|
|
4761
4761
|
let r = w.useContext(fa);
|
|
4762
4762
|
Y(
|
|
4763
4763
|
r != null,
|
|
@@ -4772,8 +4772,8 @@ function Ku(e, { relative: t } = {}) {
|
|
|
4772
4772
|
let i = Oe(r.currentLocation.pathname, n) || r.currentLocation.pathname, o = Oe(r.nextLocation.pathname, n) || r.nextLocation.pathname;
|
|
4773
4773
|
return rn(a.pathname, o) != null || rn(a.pathname, i) != null;
|
|
4774
4774
|
}
|
|
4775
|
-
function
|
|
4776
|
-
return /* @__PURE__ */ w.createElement(
|
|
4775
|
+
function Yu(e) {
|
|
4776
|
+
return /* @__PURE__ */ w.createElement(uu, { flushSync: vl.flushSync, ...e });
|
|
4777
4777
|
}
|
|
4778
4778
|
const xi = (e) => {
|
|
4779
4779
|
let t;
|
|
@@ -4785,8 +4785,8 @@ const xi = (e) => {
|
|
|
4785
4785
|
}
|
|
4786
4786
|
}, a = () => t, s = { setState: n, getState: a, getInitialState: () => l, subscribe: (c) => (r.add(c), () => r.delete(c)) }, l = t = e(n, a, s);
|
|
4787
4787
|
return s;
|
|
4788
|
-
},
|
|
4789
|
-
function
|
|
4788
|
+
}, Xu = ((e) => e ? xi(e) : xi), Ju = (e) => e;
|
|
4789
|
+
function Qu(e, t = Ju) {
|
|
4790
4790
|
const r = ut.useSyncExternalStore(
|
|
4791
4791
|
e.subscribe,
|
|
4792
4792
|
ut.useCallback(() => t(e.getState()), [e, t]),
|
|
@@ -4795,16 +4795,16 @@ function Ju(e, t = Xu) {
|
|
|
4795
4795
|
return ut.useDebugValue(r), r;
|
|
4796
4796
|
}
|
|
4797
4797
|
const Ci = (e) => {
|
|
4798
|
-
const t =
|
|
4798
|
+
const t = Xu(e), r = (n) => Qu(t, n);
|
|
4799
4799
|
return Object.assign(r, t), r;
|
|
4800
|
-
},
|
|
4800
|
+
}, Zu = ((e) => e ? Ci(e) : Ci), Ko = "https://cdn.hadoku.me", Go = /^[0-9a-f]{64}\.(?:png|jpe?g|gif|webp|avif)$/;
|
|
4801
4801
|
function Yo(e) {
|
|
4802
4802
|
return typeof e == "string" && Go.test(e);
|
|
4803
4803
|
}
|
|
4804
|
-
const br = 8080, fn = 5173,
|
|
4804
|
+
const br = 8080, fn = 5173, Wm = 80, Xo = "/watchparty/ws", ed = 500, Km = 1e3, va = 4, Gm = 3e3, Jo = typeof process < "u" && process.env ? process.env : {};
|
|
4805
4805
|
Jo.PRODUCTION_UI_URL;
|
|
4806
4806
|
Jo.PRODUCTION_SERVER_URL;
|
|
4807
|
-
const qr = u.enum(["S", "A", "B", "C", "D", "F"]),
|
|
4807
|
+
const qr = u.enum(["S", "A", "B", "C", "D", "F"]), Ym = ["S", "A", "B", "C", "D", "F"], ki = 2e4, td = 300;
|
|
4808
4808
|
u.object({
|
|
4809
4809
|
name: u.string().min(1).max(32).optional(),
|
|
4810
4810
|
sprite: u.string().min(1).max(32).optional(),
|
|
@@ -4833,7 +4833,7 @@ const re = {
|
|
|
4833
4833
|
// 'ready_state' here = playback-readiness gate (distinct from READY_EVENTS.STATE = "ready check" UX feature)
|
|
4834
4834
|
READY_STATE: "ready_state",
|
|
4835
4835
|
ERROR: "error"
|
|
4836
|
-
},
|
|
4836
|
+
}, rd = u.enum(["play", "pause", "seek", "load", "home"]), nd = u.object({
|
|
4837
4837
|
framed: u.boolean(),
|
|
4838
4838
|
depth: u.number().int().nonnegative().max(10)
|
|
4839
4839
|
});
|
|
@@ -4841,7 +4841,7 @@ u.object({
|
|
|
4841
4841
|
room_key: u.string(),
|
|
4842
4842
|
name: u.string().min(1).max(32).optional(),
|
|
4843
4843
|
sprite: u.string().min(1).max(32).optional(),
|
|
4844
|
-
embed:
|
|
4844
|
+
embed: nd.optional(),
|
|
4845
4845
|
/** Which media-delivery path this client resolved to ('range' | 'fragment').
|
|
4846
4846
|
* Optional so older clients still validate. Reported so a party's logs can be split by
|
|
4847
4847
|
* arm — without it an A/B rollout is unmeasurable, exactly as entry path was before
|
|
@@ -4889,7 +4889,7 @@ u.object({
|
|
|
4889
4889
|
});
|
|
4890
4890
|
u.object({
|
|
4891
4891
|
client_seq: u.number().int().positive(),
|
|
4892
|
-
kind:
|
|
4892
|
+
kind: rd,
|
|
4893
4893
|
to_ms: u.number().int().nonnegative().optional(),
|
|
4894
4894
|
media_id: u.string().optional()
|
|
4895
4895
|
// leader_id removed - not needed since set_leader control was removed
|
|
@@ -4923,14 +4923,14 @@ const Qo = u.object({
|
|
|
4923
4923
|
* value only, never as markup. Bounded so one message cannot carry a
|
|
4924
4924
|
* paragraph; the library's own titles run well under this.
|
|
4925
4925
|
*/
|
|
4926
|
-
title: u.string().max(
|
|
4926
|
+
title: u.string().max(td).optional()
|
|
4927
4927
|
});
|
|
4928
4928
|
u.object({
|
|
4929
|
-
text: u.string().max(
|
|
4929
|
+
text: u.string().max(ed),
|
|
4930
4930
|
style: u.string().max(64).optional(),
|
|
4931
4931
|
images: u.array(Qo).max(va).optional()
|
|
4932
4932
|
}).refine((e) => e.text.length > 0 || (e.images?.length ?? 0) > 0, { message: "message must carry text or at least one image" });
|
|
4933
|
-
const
|
|
4933
|
+
const ad = u.enum(["join", "leave", "media_change", "identity_change", "recap"]);
|
|
4934
4934
|
u.object({
|
|
4935
4935
|
id: u.string(),
|
|
4936
4936
|
client_id: u.string(),
|
|
@@ -4945,14 +4945,14 @@ u.object({
|
|
|
4945
4945
|
// has none, and so system messages (which never carry images) stay unchanged.
|
|
4946
4946
|
images: u.array(Qo).max(va).optional(),
|
|
4947
4947
|
isSystem: u.boolean().optional(),
|
|
4948
|
-
systemType:
|
|
4948
|
+
systemType: ad.optional(),
|
|
4949
4949
|
/** A system line about a person: its text with `CHAT_NAME_TOKEN` where their
|
|
4950
4950
|
* name goes. `text` is that template filled when sent; a client fills it
|
|
4951
4951
|
* again with the person's CURRENT name (found by `author`) while they are
|
|
4952
4952
|
* here, so a rename reaches lines already on screen. */
|
|
4953
4953
|
template: u.string().optional()
|
|
4954
4954
|
});
|
|
4955
|
-
const
|
|
4955
|
+
const id = "{name}", od = u.object({
|
|
4956
4956
|
avg_download_rate_bps: u.number().nonnegative(),
|
|
4957
4957
|
buffered_ahead_ms: u.number().nonnegative(),
|
|
4958
4958
|
rtt_ms: u.number().nonnegative(),
|
|
@@ -4994,7 +4994,7 @@ const ad = "{name}", id = u.object({
|
|
|
4994
4994
|
* socket shows here as a growing number while everything else looks fine. */
|
|
4995
4995
|
pong_age_ms: u.number().int().nonnegative().optional(),
|
|
4996
4996
|
reported_at: u.number().int().nonnegative()
|
|
4997
|
-
}),
|
|
4997
|
+
}), sd = od.extend({
|
|
4998
4998
|
client_id: u.string(),
|
|
4999
4999
|
name: u.string(),
|
|
5000
5000
|
sprite_id: u.string().nullable(),
|
|
@@ -5005,10 +5005,10 @@ const ad = "{name}", id = u.object({
|
|
|
5005
5005
|
stale_ms: u.number().int().nonnegative().optional()
|
|
5006
5006
|
});
|
|
5007
5007
|
u.object({
|
|
5008
|
-
clients: u.array(
|
|
5008
|
+
clients: u.array(sd),
|
|
5009
5009
|
server_ts: u.number().int().nonnegative()
|
|
5010
5010
|
});
|
|
5011
|
-
const
|
|
5011
|
+
const ld = u.object({
|
|
5012
5012
|
client_id: u.string(),
|
|
5013
5013
|
sprite_id: u.string().nullable(),
|
|
5014
5014
|
name: u.string(),
|
|
@@ -5026,13 +5026,13 @@ const sd = u.object({
|
|
|
5026
5026
|
video_ready_state: u.number().int().default(-1)
|
|
5027
5027
|
});
|
|
5028
5028
|
u.object({
|
|
5029
|
-
clients: u.array(
|
|
5029
|
+
clients: u.array(ld),
|
|
5030
5030
|
server_ts: u.number().int().nonnegative()
|
|
5031
5031
|
});
|
|
5032
5032
|
u.object({
|
|
5033
5033
|
media_id: u.string()
|
|
5034
5034
|
});
|
|
5035
|
-
const ba = u.enum(["super_upvote", "upvote", "mid", "downvote"]),
|
|
5035
|
+
const ba = u.enum(["super_upvote", "upvote", "mid", "downvote"]), cd = u.object({
|
|
5036
5036
|
mediaId: u.string(),
|
|
5037
5037
|
displayName: u.string(),
|
|
5038
5038
|
// Enrichment fields — present for flat-playlist ingest output, absent for
|
|
@@ -5043,11 +5043,11 @@ const ba = u.enum(["super_upvote", "upvote", "mid", "downvote"]), ld = u.object(
|
|
|
5043
5043
|
durationMs: u.number().optional(),
|
|
5044
5044
|
uploadDate: u.string().optional()
|
|
5045
5045
|
// YouTube upload date 'YYYY-MM-DD'; drives playlist order
|
|
5046
|
-
}),
|
|
5046
|
+
}), ud = u.enum(["basic", "vote"]), Zo = u.object({
|
|
5047
5047
|
id: u.string(),
|
|
5048
5048
|
name: u.string(),
|
|
5049
|
-
type:
|
|
5050
|
-
videos: u.array(
|
|
5049
|
+
type: ud.default("vote"),
|
|
5050
|
+
videos: u.array(cd),
|
|
5051
5051
|
cover: u.string().optional()
|
|
5052
5052
|
// media-relative path to the playlist cover image
|
|
5053
5053
|
});
|
|
@@ -5066,14 +5066,14 @@ u.object({
|
|
|
5066
5066
|
myVotes: u.record(u.string(), ba)
|
|
5067
5067
|
// mediaId -> VoteValue
|
|
5068
5068
|
});
|
|
5069
|
-
const
|
|
5069
|
+
const dd = u.object({
|
|
5070
5070
|
clientId: u.string(),
|
|
5071
5071
|
name: u.string(),
|
|
5072
5072
|
votedCount: u.number().int().nonnegative(),
|
|
5073
5073
|
totalVideos: u.number().int().nonnegative()
|
|
5074
5074
|
});
|
|
5075
5075
|
u.object({
|
|
5076
|
-
progress: u.array(
|
|
5076
|
+
progress: u.array(dd)
|
|
5077
5077
|
});
|
|
5078
5078
|
u.object({
|
|
5079
5079
|
playlist: Zo,
|
|
@@ -5118,7 +5118,7 @@ u.object({
|
|
|
5118
5118
|
});
|
|
5119
5119
|
const ts = u.partialRecord(qr, u.array(u.string()));
|
|
5120
5120
|
u.object({ board: ts });
|
|
5121
|
-
const
|
|
5121
|
+
const fd = u.object({
|
|
5122
5122
|
mediaId: u.string(),
|
|
5123
5123
|
tier: qr,
|
|
5124
5124
|
absoluteTier: qr,
|
|
@@ -5132,7 +5132,7 @@ const dd = u.object({
|
|
|
5132
5132
|
});
|
|
5133
5133
|
u.object({
|
|
5134
5134
|
items: u.array(es),
|
|
5135
|
-
placed: u.array(
|
|
5135
|
+
placed: u.array(fd),
|
|
5136
5136
|
unrated: u.array(u.string()),
|
|
5137
5137
|
spread: u.number(),
|
|
5138
5138
|
nudged: u.boolean(),
|
|
@@ -5144,7 +5144,7 @@ u.object({
|
|
|
5144
5144
|
voterCount: u.number().int().nonnegative(),
|
|
5145
5145
|
myBoard: ts
|
|
5146
5146
|
});
|
|
5147
|
-
const
|
|
5147
|
+
const hd = {
|
|
5148
5148
|
/** Broadcast to EVERY connected socket when anyone saves. Carries no board —
|
|
5149
5149
|
* it is a "re-fetch" ping, because the shared result is identical for all
|
|
5150
5150
|
* viewers but `myBoard` is not, and one payload cannot serve both. */
|
|
@@ -5176,7 +5176,7 @@ u.object({
|
|
|
5176
5176
|
u.object({
|
|
5177
5177
|
gameId: u.string().nullable()
|
|
5178
5178
|
});
|
|
5179
|
-
const
|
|
5179
|
+
const pd = [
|
|
5180
5180
|
{
|
|
5181
5181
|
id: "fantasy",
|
|
5182
5182
|
characters: [
|
|
@@ -5220,37 +5220,37 @@ const hd = [
|
|
|
5220
5220
|
{ id: "mentor", color: "#e1e0dc" }
|
|
5221
5221
|
]
|
|
5222
5222
|
}
|
|
5223
|
-
], Ea =
|
|
5224
|
-
function
|
|
5225
|
-
const t =
|
|
5223
|
+
], Ea = pd.flatMap((e) => e.characters), Nt = Ea.map((e) => e.id), md = Object.fromEntries(Ea.map((e) => [e.id, e.color])), gd = Object.fromEntries(Ea.map((e) => [e.id, "rev" in e ? e.rev : 1]));
|
|
5224
|
+
function yd(e) {
|
|
5225
|
+
const t = gd[e];
|
|
5226
5226
|
return `/media/sprites/square_${e}.png${t > 1 ? `?v=${t}` : ""}`;
|
|
5227
5227
|
}
|
|
5228
5228
|
function Sa(e) {
|
|
5229
5229
|
return !!e && Nt.includes(e);
|
|
5230
5230
|
}
|
|
5231
|
-
const
|
|
5232
|
-
function
|
|
5233
|
-
return typeof e == "string" &&
|
|
5231
|
+
const Xm = 4, Jm = 3e4, Qm = 5e3, Zm = 2e3, eg = 5e3, tg = 2e3, rg = 5e3, ng = 2e3, ag = 1e4, ig = 10, og = 2e3, sg = 3, lg = 50, cg = 3, ug = 3e4, dg = 2e4, fg = 99999, vd = 5e3, bd = "output_frag.mp4", Ai = "/healthz", rs = { mode: "off", percent: 0 }, wd = ["off", "on", "ab"];
|
|
5232
|
+
function _d(e) {
|
|
5233
|
+
return typeof e == "string" && wd.includes(e);
|
|
5234
5234
|
}
|
|
5235
5235
|
function ns(e) {
|
|
5236
|
-
const t = e && typeof e == "object" ? e : {}, r =
|
|
5236
|
+
const t = e && typeof e == "object" ? e : {}, r = _d(t.mode) ? t.mode : rs.mode, n = Number(t.percent), a = Number.isFinite(n) ? Math.min(100, Math.max(0, Math.round(n))) : 0;
|
|
5237
5237
|
return { mode: r, percent: a };
|
|
5238
5238
|
}
|
|
5239
|
-
function
|
|
5239
|
+
function Ed(e) {
|
|
5240
5240
|
let t = 2166136261;
|
|
5241
5241
|
for (let r = 0; r < e.length; r++)
|
|
5242
5242
|
t ^= e.charCodeAt(r), t = Math.imul(t, 16777619) >>> 0;
|
|
5243
5243
|
return t >>> 0;
|
|
5244
5244
|
}
|
|
5245
|
-
function
|
|
5245
|
+
function Sd(e, t, r) {
|
|
5246
5246
|
if (r === !0)
|
|
5247
5247
|
return "fragment";
|
|
5248
5248
|
if (r === !1)
|
|
5249
5249
|
return "range";
|
|
5250
5250
|
const n = ns(e);
|
|
5251
|
-
return n.mode === "on" ? "fragment" : n.mode === "off" || n.percent <= 0 ? "range" : n.percent >= 100 || t &&
|
|
5251
|
+
return n.mode === "on" ? "fragment" : n.mode === "off" || n.percent <= 0 ? "range" : n.percent >= 100 || t && Ed(t) % 100 < n.percent ? "fragment" : "range";
|
|
5252
5252
|
}
|
|
5253
|
-
const as = u.enum(["url", "magnet", "upload"]),
|
|
5253
|
+
const as = u.enum(["url", "magnet", "upload"]), Rd = u.enum([
|
|
5254
5254
|
"pending",
|
|
5255
5255
|
"approved",
|
|
5256
5256
|
"fetching",
|
|
@@ -5268,7 +5268,7 @@ const as = u.enum(["url", "magnet", "upload"]), Sd = u.enum([
|
|
|
5268
5268
|
failed: ["approved"]
|
|
5269
5269
|
};
|
|
5270
5270
|
Object.keys(Pi).filter((e) => Pi[e].length === 0);
|
|
5271
|
-
const
|
|
5271
|
+
const Td = u.object({
|
|
5272
5272
|
id: u.string().min(1),
|
|
5273
5273
|
/** Stable userId from whoami. Never the raw `X-User-Key`. */
|
|
5274
5274
|
ownerUserId: u.string().min(1),
|
|
@@ -5287,7 +5287,7 @@ const Rd = u.object({
|
|
|
5287
5287
|
* misroute the copy.
|
|
5288
5288
|
*/
|
|
5289
5289
|
series: u.string().optional(),
|
|
5290
|
-
state:
|
|
5290
|
+
state: Rd,
|
|
5291
5291
|
createdAt: u.number().int().nonnegative(),
|
|
5292
5292
|
updatedAt: u.number().int().nonnegative(),
|
|
5293
5293
|
/** Why it failed, or why an operator rejected it. */
|
|
@@ -5295,19 +5295,19 @@ const Rd = u.object({
|
|
|
5295
5295
|
/** Size once known. 0 means "known to be empty"; absent means "not yet known" —
|
|
5296
5296
|
* the same distinction `chatImages` draws for image dimensions. */
|
|
5297
5297
|
bytes: u.number().int().nonnegative().optional()
|
|
5298
|
-
}),
|
|
5298
|
+
}), xd = 4096, is = 300, Cd = 100;
|
|
5299
5299
|
u.object({
|
|
5300
5300
|
kind: as,
|
|
5301
|
-
source: u.string().min(1).max(
|
|
5301
|
+
source: u.string().min(1).max(xd),
|
|
5302
5302
|
title: u.string().min(1).max(is).optional(),
|
|
5303
5303
|
/** Required for `kind: 'magnet'` by `checkSource`; ignored for `url`/`upload`. */
|
|
5304
|
-
series: u.string().min(1).max(
|
|
5304
|
+
series: u.string().min(1).max(Cd).optional()
|
|
5305
5305
|
});
|
|
5306
5306
|
u.object({
|
|
5307
5307
|
reason: u.string().min(1).max(is).optional()
|
|
5308
5308
|
});
|
|
5309
5309
|
u.object({
|
|
5310
|
-
submissions: u.array(
|
|
5310
|
+
submissions: u.array(Td)
|
|
5311
5311
|
});
|
|
5312
5312
|
u.object({
|
|
5313
5313
|
error: u.literal("submissions/quota_exceeded"),
|
|
@@ -5316,8 +5316,8 @@ u.object({
|
|
|
5316
5316
|
/** The cap that was applied, from the server's config. */
|
|
5317
5317
|
capBytes: u.number().int().nonnegative()
|
|
5318
5318
|
});
|
|
5319
|
-
const
|
|
5320
|
-
function
|
|
5319
|
+
const kd = /^[a-z0-9][a-z0-9-]{0,31}$/, Mi = "https://game-catalog.invalid";
|
|
5320
|
+
function Ad(e) {
|
|
5321
5321
|
if (!e.startsWith("/") || e.startsWith("//") || /[\\\s]/.test(e) || [...e].some((t) => t.charCodeAt(0) < 32 || t.charCodeAt(0) === 127))
|
|
5322
5322
|
return !1;
|
|
5323
5323
|
try {
|
|
@@ -5326,15 +5326,15 @@ function kd(e) {
|
|
|
5326
5326
|
return !1;
|
|
5327
5327
|
}
|
|
5328
5328
|
}
|
|
5329
|
-
const os = u.string().min(2).max(512).refine(
|
|
5329
|
+
const os = u.string().min(2).max(512).refine(Ad, {
|
|
5330
5330
|
message: "must be a root-relative path on the page origin (e.g. /cardtable/embed/x.js)"
|
|
5331
|
-
}),
|
|
5332
|
-
id: u.string().regex(
|
|
5331
|
+
}), Pd = {
|
|
5332
|
+
id: u.string().regex(kd),
|
|
5333
5333
|
name: u.string().min(1).max(64),
|
|
5334
5334
|
cover: os.optional()
|
|
5335
|
-
},
|
|
5335
|
+
}, Md = u.object({ ...Pd, kind: u.literal("module"), url: os }).strict(), Id = u.array(Md).max(32).refine((e) => new Set(e.map((t) => t.id)).size === e.length, { message: "game ids must be unique" }), Ld = [
|
|
5336
5336
|
{ id: "bomberman", name: "Bomberman", kind: "module", url: "/bomberman/embed/bomberman-embed.js" }
|
|
5337
|
-
], Ra = u.enum(["anilist", "tmdb"]),
|
|
5337
|
+
], Ra = u.enum(["anilist", "tmdb"]), Od = u.object({
|
|
5338
5338
|
source: Ra,
|
|
5339
5339
|
/** The provider's own id, as a string (AniList and TMDB both use integers). */
|
|
5340
5340
|
id: u.string(),
|
|
@@ -5356,11 +5356,11 @@ const os = u.string().min(2).max(512).refine(kd, {
|
|
|
5356
5356
|
addable: u.boolean()
|
|
5357
5357
|
});
|
|
5358
5358
|
u.object({
|
|
5359
|
-
results: u.array(
|
|
5359
|
+
results: u.array(Od),
|
|
5360
5360
|
/** Providers that answered. TMDB is absent when no token is configured. */
|
|
5361
5361
|
sources: u.array(Ra)
|
|
5362
5362
|
});
|
|
5363
|
-
const
|
|
5363
|
+
const Dd = u.object({
|
|
5364
5364
|
id: u.string(),
|
|
5365
5365
|
url: u.string(),
|
|
5366
5366
|
title: u.string(),
|
|
@@ -5368,13 +5368,13 @@ const Od = u.object({
|
|
|
5368
5368
|
durationS: u.number().nullable(),
|
|
5369
5369
|
thumb: u.string().nullable()
|
|
5370
5370
|
});
|
|
5371
|
-
u.object({ results: u.array(
|
|
5371
|
+
u.object({ results: u.array(Dd) });
|
|
5372
5372
|
u.object({
|
|
5373
5373
|
source: Ra,
|
|
5374
5374
|
id: u.string().regex(/^\d{1,12}$/)
|
|
5375
5375
|
});
|
|
5376
5376
|
u.object({ series: u.string(), title: u.string() });
|
|
5377
|
-
const
|
|
5377
|
+
const hg = 2, pg = 100;
|
|
5378
5378
|
var Ln = {
|
|
5379
5379
|
image: 10 * 1024 * 1024,
|
|
5380
5380
|
audio: 50 * 1024 * 1024
|
|
@@ -5385,7 +5385,7 @@ function we(e, t, r) {
|
|
|
5385
5385
|
function xe(e) {
|
|
5386
5386
|
return [...e].map((t) => t.charCodeAt(0));
|
|
5387
5387
|
}
|
|
5388
|
-
function
|
|
5388
|
+
function Nd(e) {
|
|
5389
5389
|
if (e.length < 3 || e[0] !== 255) return !1;
|
|
5390
5390
|
const t = e[1] ?? 0, r = e[2] ?? 0, n = (t & 224) === 224, a = t >> 3 & 3, i = t >> 1 & 3, o = r >> 4, s = r >> 2 & 3;
|
|
5391
5391
|
return n && a !== 1 && i === 1 && o !== 0 && o !== 15 && s !== 3;
|
|
@@ -5436,7 +5436,7 @@ var ss = [
|
|
|
5436
5436
|
kind: "audio",
|
|
5437
5437
|
// Either an ID3v2 tag ("ID3" + a major version of 2–4 + a minor that is
|
|
5438
5438
|
// never 0xFF) or a bare Layer III frame. Most real mp3s carry the tag.
|
|
5439
|
-
matches: (e) => we(e, 0, xe("ID3")) && (e[3] ?? 0) >= 2 && (e[3] ?? 0) <= 4 && e[4] !== 255 ||
|
|
5439
|
+
matches: (e) => we(e, 0, xe("ID3")) && (e[3] ?? 0) >= 2 && (e[3] ?? 0) <= 4 && e[4] !== 255 || Nd(e)
|
|
5440
5440
|
},
|
|
5441
5441
|
{
|
|
5442
5442
|
contentType: "audio/flac",
|
|
@@ -5482,7 +5482,7 @@ function ls(e) {
|
|
|
5482
5482
|
);
|
|
5483
5483
|
}
|
|
5484
5484
|
ss.map((e) => e.contentType).join(", ");
|
|
5485
|
-
var
|
|
5485
|
+
var $d = ls("image"), Fd = ls("audio"), Ud = {
|
|
5486
5486
|
"audio/mp3": "audio/mpeg",
|
|
5487
5487
|
"audio/x-mp3": "audio/mpeg",
|
|
5488
5488
|
"audio/x-mpeg": "audio/mpeg",
|
|
@@ -5496,9 +5496,9 @@ var Nd = ls("image"), $d = ls("audio"), Fd = {
|
|
|
5496
5496
|
};
|
|
5497
5497
|
function cs(e) {
|
|
5498
5498
|
const t = e.toLowerCase();
|
|
5499
|
-
return
|
|
5499
|
+
return $d.includes(t) ? "image" : Fd.includes(t) || t in Ud ? "audio" : null;
|
|
5500
5500
|
}
|
|
5501
|
-
var
|
|
5501
|
+
var Bd = 24, mg = 250, tr = class extends Error {
|
|
5502
5502
|
reason;
|
|
5503
5503
|
/** HTTP status, when there was a response. */
|
|
5504
5504
|
status;
|
|
@@ -5515,7 +5515,7 @@ var Ud = 24, hg = 250, tr = class extends Error {
|
|
|
5515
5515
|
super(t), this.name = "CdnError", this.reason = e, this.status = r, this.retryAfterSeconds = n;
|
|
5516
5516
|
}
|
|
5517
5517
|
};
|
|
5518
|
-
function
|
|
5518
|
+
function jd(e, t = Date.now()) {
|
|
5519
5519
|
if (!e) return null;
|
|
5520
5520
|
const r = e.trim();
|
|
5521
5521
|
if (!r) return null;
|
|
@@ -5524,7 +5524,7 @@ function Bd(e, t = Date.now()) {
|
|
|
5524
5524
|
const a = Date.parse(r);
|
|
5525
5525
|
return Number.isNaN(a) ? null : Math.max(0, Math.ceil((a - t) / 1e3));
|
|
5526
5526
|
}
|
|
5527
|
-
function
|
|
5527
|
+
function zd(e) {
|
|
5528
5528
|
switch (e) {
|
|
5529
5529
|
case 401:
|
|
5530
5530
|
return "unauthenticated";
|
|
@@ -5547,8 +5547,8 @@ function jd(e) {
|
|
|
5547
5547
|
return "unknown";
|
|
5548
5548
|
}
|
|
5549
5549
|
}
|
|
5550
|
-
async function
|
|
5551
|
-
const t =
|
|
5550
|
+
async function Hd(e) {
|
|
5551
|
+
const t = zd(e.status);
|
|
5552
5552
|
let r = `CDN request failed (${e.status})`;
|
|
5553
5553
|
try {
|
|
5554
5554
|
const n = await e.json();
|
|
@@ -5559,11 +5559,11 @@ async function zd(e) {
|
|
|
5559
5559
|
t,
|
|
5560
5560
|
r,
|
|
5561
5561
|
e.status,
|
|
5562
|
-
t === "rate-limited" ?
|
|
5562
|
+
t === "rate-limited" ? jd(e.headers.get("Retry-After")) : null
|
|
5563
5563
|
);
|
|
5564
5564
|
}
|
|
5565
|
-
var
|
|
5566
|
-
function
|
|
5565
|
+
var Vd = "/cdn/api/upload", qd = /^[0-9a-f]{64}\.[a-z0-9]{1,8}$/;
|
|
5566
|
+
function Wd(e) {
|
|
5567
5567
|
if (e.size === 0)
|
|
5568
5568
|
throw new tr("invalid", "File is empty");
|
|
5569
5569
|
const t = e.type ? cs(e.type) : null;
|
|
@@ -5573,7 +5573,7 @@ function qd(e) {
|
|
|
5573
5573
|
if (e.size > r)
|
|
5574
5574
|
throw new tr("too-large", `File is ${e.size} bytes; the maximum is ${r}`);
|
|
5575
5575
|
}
|
|
5576
|
-
function
|
|
5576
|
+
function Kd(e) {
|
|
5577
5577
|
if (typeof e != "object" || e === null) return null;
|
|
5578
5578
|
const t = e;
|
|
5579
5579
|
return typeof t.key != "string" || !t.key ? null : {
|
|
@@ -5585,8 +5585,8 @@ function Wd(e) {
|
|
|
5585
5585
|
contentType: typeof t.contentType == "string" ? t.contentType : "image/*"
|
|
5586
5586
|
};
|
|
5587
5587
|
}
|
|
5588
|
-
function
|
|
5589
|
-
const t = e.cdnBase.replace(/\/+$/, ""), r = e.uploadPath ??
|
|
5588
|
+
function Gd(e) {
|
|
5589
|
+
const t = e.cdnBase.replace(/\/+$/, ""), r = e.uploadPath ?? Vd, n = e.fetch ?? globalThis.fetch.bind(globalThis);
|
|
5590
5590
|
async function a(i, o) {
|
|
5591
5591
|
let s;
|
|
5592
5592
|
try {
|
|
@@ -5594,14 +5594,14 @@ function Kd(e) {
|
|
|
5594
5594
|
} catch (l) {
|
|
5595
5595
|
throw l instanceof Error && l.name === "AbortError" ? l : new tr("network", l instanceof Error ? l.message : "Request failed");
|
|
5596
5596
|
}
|
|
5597
|
-
if (!s.ok) throw await
|
|
5597
|
+
if (!s.ok) throw await Hd(s);
|
|
5598
5598
|
return s;
|
|
5599
5599
|
}
|
|
5600
5600
|
return {
|
|
5601
5601
|
cdnBase: t,
|
|
5602
5602
|
uploadPath: r,
|
|
5603
5603
|
async upload(i, o) {
|
|
5604
|
-
return
|
|
5604
|
+
return Wd(i), await (await a(r, {
|
|
5605
5605
|
method: "POST",
|
|
5606
5606
|
body: i,
|
|
5607
5607
|
signal: o?.signal,
|
|
@@ -5614,21 +5614,21 @@ function Kd(e) {
|
|
|
5614
5614
|
return `${t}/${i.replace(/^\/+/, "")}`;
|
|
5615
5615
|
},
|
|
5616
5616
|
isKey(i) {
|
|
5617
|
-
return
|
|
5617
|
+
return qd.test(i);
|
|
5618
5618
|
},
|
|
5619
5619
|
catalogue(i, o) {
|
|
5620
5620
|
const s = i.replace(/\/+$/, ""), l = o?.surface;
|
|
5621
5621
|
return {
|
|
5622
5622
|
async search(c = {}) {
|
|
5623
5623
|
const d = new URLSearchParams(), h = c.query?.trim();
|
|
5624
|
-
h && d.set("q", h), d.set("limit", String(c.limit ??
|
|
5624
|
+
h && d.set("q", h), d.set("limit", String(c.limit ?? Bd)), c.cursor && d.set("cursor", c.cursor);
|
|
5625
5625
|
const g = await (await a(`${s}?${d.toString()}`, {
|
|
5626
5626
|
method: "GET",
|
|
5627
5627
|
signal: c.signal,
|
|
5628
5628
|
credentials: "same-origin"
|
|
5629
5629
|
})).json();
|
|
5630
5630
|
return {
|
|
5631
|
-
results: (Array.isArray(g.results) ? g.results : []).map(
|
|
5631
|
+
results: (Array.isArray(g.results) ? g.results : []).map(Kd).filter((R) => R !== null),
|
|
5632
5632
|
next: typeof g.next == "string" && g.next ? g.next : null
|
|
5633
5633
|
};
|
|
5634
5634
|
},
|
|
@@ -5644,12 +5644,12 @@ function Kd(e) {
|
|
|
5644
5644
|
}
|
|
5645
5645
|
};
|
|
5646
5646
|
}
|
|
5647
|
-
function
|
|
5647
|
+
function gg(e, t = ["image"]) {
|
|
5648
5648
|
if (!e) return [];
|
|
5649
5649
|
const r = (i) => us(i, t), n = e.files ? Array.from(e.files) : [];
|
|
5650
5650
|
return n.length > 0 ? n.filter(r) : (e.items ? Array.from(e.items) : []).filter((i) => i.kind === "file").map((i) => i.getAsFile()).filter((i) => i !== null).filter(r);
|
|
5651
5651
|
}
|
|
5652
|
-
function
|
|
5652
|
+
function yg(e, t = ["image"]) {
|
|
5653
5653
|
return e?.files ? Array.from(e.files).filter((r) => us(r, t)) : [];
|
|
5654
5654
|
}
|
|
5655
5655
|
function us(e, t) {
|
|
@@ -5657,7 +5657,7 @@ function us(e, t) {
|
|
|
5657
5657
|
const r = cs(e.type);
|
|
5658
5658
|
return r !== null && t.includes(r);
|
|
5659
5659
|
}
|
|
5660
|
-
async function
|
|
5660
|
+
async function vg(e) {
|
|
5661
5661
|
const t = globalThis.createImageBitmap;
|
|
5662
5662
|
if (typeof t != "function") return null;
|
|
5663
5663
|
try {
|
|
@@ -5668,27 +5668,27 @@ async function gg(e) {
|
|
|
5668
5668
|
}
|
|
5669
5669
|
}
|
|
5670
5670
|
let Lr = null, ds = Ko;
|
|
5671
|
-
function
|
|
5671
|
+
function Yd(e) {
|
|
5672
5672
|
e.cdnBase && (ds = e.cdnBase);
|
|
5673
5673
|
}
|
|
5674
5674
|
function fs() {
|
|
5675
5675
|
return ds.replace(/\/+$/, "");
|
|
5676
5676
|
}
|
|
5677
|
-
function
|
|
5677
|
+
function Xd() {
|
|
5678
5678
|
const e = fs();
|
|
5679
|
-
return (!Lr || Lr.base !== e) && (Lr = { base: e, client:
|
|
5679
|
+
return (!Lr || Lr.base !== e) && (Lr = { base: e, client: Gd({ cdnBase: e }) }), Lr.client;
|
|
5680
5680
|
}
|
|
5681
|
-
function
|
|
5682
|
-
return !Yo(e) || !fs() ? null :
|
|
5681
|
+
function bg(e) {
|
|
5682
|
+
return !Yo(e) || !fs() ? null : Xd().urlFor(e);
|
|
5683
5683
|
}
|
|
5684
|
-
function
|
|
5684
|
+
function Jd(e) {
|
|
5685
5685
|
return `/tv?return=${encodeURIComponent(e.pathname + e.search)}`;
|
|
5686
5686
|
}
|
|
5687
|
-
function
|
|
5687
|
+
function Qd({ className: e }) {
|
|
5688
5688
|
return /* @__PURE__ */ N(
|
|
5689
5689
|
"a",
|
|
5690
5690
|
{
|
|
5691
|
-
href:
|
|
5691
|
+
href: Jd(window.location),
|
|
5692
5692
|
className: e,
|
|
5693
5693
|
"data-testid": "sign-in-with-code",
|
|
5694
5694
|
children: "Sign in with a code"
|
|
@@ -5701,18 +5701,18 @@ const rr = {
|
|
|
5701
5701
|
cdnBase: Ko
|
|
5702
5702
|
};
|
|
5703
5703
|
let Wr = { ...rr };
|
|
5704
|
-
function
|
|
5704
|
+
function Zd(e) {
|
|
5705
5705
|
const t = Object.fromEntries(
|
|
5706
5706
|
Object.entries(e).filter(([r, n]) => n !== void 0)
|
|
5707
5707
|
);
|
|
5708
|
-
Wr = { ...Wr, ...t },
|
|
5708
|
+
Wr = { ...Wr, ...t }, Yd({ cdnBase: Wr.cdnBase });
|
|
5709
5709
|
}
|
|
5710
5710
|
function Tt() {
|
|
5711
5711
|
return Wr;
|
|
5712
5712
|
}
|
|
5713
|
-
const hs =
|
|
5714
|
-
function
|
|
5715
|
-
return
|
|
5713
|
+
const hs = pl(rr);
|
|
5714
|
+
function ef() {
|
|
5715
|
+
return ml(hs);
|
|
5716
5716
|
}
|
|
5717
5717
|
function ps(e) {
|
|
5718
5718
|
return e.serverOrigin?.replace(/\/$/, "") || "";
|
|
@@ -5748,7 +5748,7 @@ function Ta(e, t) {
|
|
|
5748
5748
|
return !1;
|
|
5749
5749
|
}
|
|
5750
5750
|
}
|
|
5751
|
-
function
|
|
5751
|
+
function tf() {
|
|
5752
5752
|
try {
|
|
5753
5753
|
const e = pn();
|
|
5754
5754
|
if (!e) return [];
|
|
@@ -5768,7 +5768,7 @@ function an(e) {
|
|
|
5768
5768
|
} catch {
|
|
5769
5769
|
}
|
|
5770
5770
|
}
|
|
5771
|
-
function
|
|
5771
|
+
function rf(e) {
|
|
5772
5772
|
const t = je(e);
|
|
5773
5773
|
return t === null ? null : t === "true" ? !0 : t === "false" ? !1 : null;
|
|
5774
5774
|
}
|
|
@@ -5777,16 +5777,16 @@ let gs = !1;
|
|
|
5777
5777
|
function mn(e, t) {
|
|
5778
5778
|
ms.set(e, t), gs && ys(e, t);
|
|
5779
5779
|
}
|
|
5780
|
-
function
|
|
5780
|
+
function nf() {
|
|
5781
5781
|
gs = !0;
|
|
5782
5782
|
for (const [e, t] of ms) ys(e, t);
|
|
5783
5783
|
}
|
|
5784
5784
|
function ys(e, t) {
|
|
5785
5785
|
typeof window > "u" || (window[e] = t);
|
|
5786
5786
|
}
|
|
5787
|
-
const nr = [],
|
|
5787
|
+
const nr = [], af = 500;
|
|
5788
5788
|
let Kr = [], Kn = null;
|
|
5789
|
-
const
|
|
5789
|
+
const of = 1e3, sf = 200;
|
|
5790
5790
|
let cr = null;
|
|
5791
5791
|
function vs(e) {
|
|
5792
5792
|
cr = e;
|
|
@@ -5800,13 +5800,13 @@ function ws() {
|
|
|
5800
5800
|
const t = je(Ft.DEBUG_FLAG);
|
|
5801
5801
|
return t !== null && t !== "false";
|
|
5802
5802
|
}
|
|
5803
|
-
function
|
|
5803
|
+
function lf() {
|
|
5804
5804
|
const e = je(Ft.DEBUG_FLAG);
|
|
5805
5805
|
if (!e || e === "true") return null;
|
|
5806
5806
|
const t = e.split(",").map((r) => r.trim().toLowerCase()).filter(Boolean);
|
|
5807
5807
|
return t.length > 0 ? new Set(t) : null;
|
|
5808
5808
|
}
|
|
5809
|
-
function
|
|
5809
|
+
function cf() {
|
|
5810
5810
|
return (/* @__PURE__ */ new Date()).toLocaleTimeString("en-US", {
|
|
5811
5811
|
hour12: !1,
|
|
5812
5812
|
hour: "2-digit",
|
|
@@ -5815,8 +5815,8 @@ function lf() {
|
|
|
5815
5815
|
fractionalSecondDigits: 3
|
|
5816
5816
|
});
|
|
5817
5817
|
}
|
|
5818
|
-
function
|
|
5819
|
-
nr.push(e), nr.length >
|
|
5818
|
+
function uf(e) {
|
|
5819
|
+
nr.push(e), nr.length > af && nr.shift();
|
|
5820
5820
|
}
|
|
5821
5821
|
const On = {
|
|
5822
5822
|
debug: "color: #64748b; font-weight: normal;",
|
|
@@ -5825,7 +5825,7 @@ const On = {
|
|
|
5825
5825
|
category: "color: #3b82f6; font-weight: bold;",
|
|
5826
5826
|
time: "color: #6b7280; font-weight: normal;"
|
|
5827
5827
|
};
|
|
5828
|
-
function
|
|
5828
|
+
function df(e) {
|
|
5829
5829
|
try {
|
|
5830
5830
|
return JSON.stringify(e);
|
|
5831
5831
|
} catch {
|
|
@@ -5840,12 +5840,12 @@ function xa(e, t, r, n, a, i, o) {
|
|
|
5840
5840
|
data: o,
|
|
5841
5841
|
timestamp: Date.now()
|
|
5842
5842
|
};
|
|
5843
|
-
if (
|
|
5843
|
+
if (uf(s), (r || bs()) && Ii(s), !n) {
|
|
5844
5844
|
if (!ws()) return;
|
|
5845
|
-
const d =
|
|
5845
|
+
const d = lf();
|
|
5846
5846
|
if (d && !d.has(a.toLowerCase())) return;
|
|
5847
5847
|
}
|
|
5848
|
-
const l =
|
|
5848
|
+
const l = cf(), c = o !== void 0 ? " " + df(o) : "";
|
|
5849
5849
|
t(
|
|
5850
5850
|
`%c[${l}]%c [${a}]%c ${i}${c}`,
|
|
5851
5851
|
On.time,
|
|
@@ -5862,25 +5862,25 @@ function ne(e, t, r) {
|
|
|
5862
5862
|
function at(e, t, r) {
|
|
5863
5863
|
xa("error", console.error, !0, !0, e, t, r);
|
|
5864
5864
|
}
|
|
5865
|
-
function
|
|
5865
|
+
function ff() {
|
|
5866
5866
|
return [...nr];
|
|
5867
5867
|
}
|
|
5868
|
-
function
|
|
5868
|
+
function hf() {
|
|
5869
5869
|
nr.length = 0;
|
|
5870
5870
|
}
|
|
5871
|
-
function
|
|
5871
|
+
function pf(e) {
|
|
5872
5872
|
const t = e && e.length > 0 ? e.join(",") : "true";
|
|
5873
5873
|
Ta(Ft.DEBUG_FLAG, t), console.log("[wp] Debug mode enabled");
|
|
5874
5874
|
}
|
|
5875
|
-
function
|
|
5875
|
+
function mf() {
|
|
5876
5876
|
an(Ft.DEBUG_FLAG), console.log("[wp] Debug mode disabled");
|
|
5877
5877
|
}
|
|
5878
|
-
const
|
|
5878
|
+
const gf = 1024, yf = 5e4;
|
|
5879
5879
|
function _s(e) {
|
|
5880
5880
|
if (e == null) return e;
|
|
5881
5881
|
try {
|
|
5882
5882
|
const t = JSON.stringify(e);
|
|
5883
|
-
if (t.length <=
|
|
5883
|
+
if (t.length <= gf) return e;
|
|
5884
5884
|
if (typeof e == "object" && !Array.isArray(e)) {
|
|
5885
5885
|
const r = {};
|
|
5886
5886
|
for (const [n, a] of Object.entries(e)) {
|
|
@@ -5894,7 +5894,7 @@ function _s(e) {
|
|
|
5894
5894
|
return "[unserializable]";
|
|
5895
5895
|
}
|
|
5896
5896
|
}
|
|
5897
|
-
function
|
|
5897
|
+
function wg(e, t, r, n) {
|
|
5898
5898
|
try {
|
|
5899
5899
|
console.warn(`[${t}] ${r}`, n ?? "");
|
|
5900
5900
|
} catch {
|
|
@@ -5921,7 +5921,7 @@ function vg(e, t, r, n) {
|
|
|
5921
5921
|
} catch {
|
|
5922
5922
|
}
|
|
5923
5923
|
}
|
|
5924
|
-
async function
|
|
5924
|
+
async function vf() {
|
|
5925
5925
|
if (Kr.length === 0) return;
|
|
5926
5926
|
const e = Kr;
|
|
5927
5927
|
Kr = [], Kn = null;
|
|
@@ -5945,7 +5945,7 @@ async function yf() {
|
|
|
5945
5945
|
let i = [], o = 0;
|
|
5946
5946
|
for (const s of a) {
|
|
5947
5947
|
const l = JSON.stringify(s).length + 1;
|
|
5948
|
-
o + l >
|
|
5948
|
+
o + l > yf && i.length > 0 && (await fetch(n, {
|
|
5949
5949
|
method: "POST",
|
|
5950
5950
|
headers: { "Content-Type": "application/json" },
|
|
5951
5951
|
body: JSON.stringify({ logs: i })
|
|
@@ -5962,9 +5962,9 @@ async function yf() {
|
|
|
5962
5962
|
}
|
|
5963
5963
|
function Ii(e) {
|
|
5964
5964
|
if (Kr.push(e), !Kn) {
|
|
5965
|
-
const t = bs() ?
|
|
5965
|
+
const t = bs() ? sf : of;
|
|
5966
5966
|
Kn = setTimeout(() => {
|
|
5967
|
-
|
|
5967
|
+
vf();
|
|
5968
5968
|
}, t);
|
|
5969
5969
|
}
|
|
5970
5970
|
}
|
|
@@ -5972,19 +5972,19 @@ function Ue(e) {
|
|
|
5972
5972
|
return e instanceof Error ? { error: e.message, name: e.name } : { error: String(e), name: typeof e };
|
|
5973
5973
|
}
|
|
5974
5974
|
mn("__wpDebug", {
|
|
5975
|
-
enable:
|
|
5976
|
-
disable:
|
|
5977
|
-
history:
|
|
5978
|
-
clear:
|
|
5975
|
+
enable: pf,
|
|
5976
|
+
disable: mf,
|
|
5977
|
+
history: ff,
|
|
5978
|
+
clear: hf
|
|
5979
5979
|
});
|
|
5980
5980
|
function Es(e) {
|
|
5981
|
-
return Sa(e) ?
|
|
5981
|
+
return Sa(e) ? md[e] : "var(--color-neutral-bg)";
|
|
5982
5982
|
}
|
|
5983
5983
|
function Ss(e) {
|
|
5984
|
-
return Sa(e) ? `${Tt().serverOrigin.replace(/\/$/, "")}${
|
|
5984
|
+
return Sa(e) ? `${Tt().serverOrigin.replace(/\/$/, "")}${yd(e)}` : void 0;
|
|
5985
5985
|
}
|
|
5986
5986
|
let ur = null, Or = null;
|
|
5987
|
-
function
|
|
5987
|
+
function bf() {
|
|
5988
5988
|
return ur ? Promise.resolve() : Or || (Or = (async () => {
|
|
5989
5989
|
try {
|
|
5990
5990
|
const e = Tt().serverOrigin.replace(/\/$/, ""), t = await fetch(`${e}/media/sprites/names.json`, { cache: "no-cache" });
|
|
@@ -6003,11 +6003,70 @@ function St(e) {
|
|
|
6003
6003
|
const t = e.toLowerCase();
|
|
6004
6004
|
return Nt.some((r) => r === t) ? !0 : ur ? Object.values(ur).some((r) => r.toLowerCase() === t) : !1;
|
|
6005
6005
|
}
|
|
6006
|
-
|
|
6007
|
-
|
|
6008
|
-
|
|
6006
|
+
function wf(e, t, r) {
|
|
6007
|
+
const n = !!e.name && !r(e.name) && (!t || r(t.name || "")), a = !!e.avatarId && (!t || t.avatarId !== e.avatarId);
|
|
6008
|
+
if (!n && !a)
|
|
6009
|
+
return null;
|
|
6010
|
+
const i = {};
|
|
6011
|
+
return n && (i.name = e.name), a && (i.avatarId = e.avatarId), i;
|
|
6009
6012
|
}
|
|
6010
|
-
|
|
6013
|
+
const _f = [
|
|
6014
|
+
"sage",
|
|
6015
|
+
"herald",
|
|
6016
|
+
"cleric",
|
|
6017
|
+
"knight",
|
|
6018
|
+
"mage",
|
|
6019
|
+
"brawler",
|
|
6020
|
+
"wanderer",
|
|
6021
|
+
"rogue",
|
|
6022
|
+
"gunner",
|
|
6023
|
+
"chief",
|
|
6024
|
+
"walker",
|
|
6025
|
+
"operative",
|
|
6026
|
+
"idol",
|
|
6027
|
+
"recluse",
|
|
6028
|
+
"phantom",
|
|
6029
|
+
"harlequin",
|
|
6030
|
+
"doll",
|
|
6031
|
+
"imp",
|
|
6032
|
+
"apprentice",
|
|
6033
|
+
"prodigy",
|
|
6034
|
+
"dreamer",
|
|
6035
|
+
"sunny",
|
|
6036
|
+
"mentor"
|
|
6037
|
+
];
|
|
6038
|
+
function Rs(e, t, r = _f, n = Math.random) {
|
|
6039
|
+
const a = /* @__PURE__ */ new Set();
|
|
6040
|
+
for (const o of e)
|
|
6041
|
+
o && a.add(o);
|
|
6042
|
+
const i = r.filter((o) => !a.has(o));
|
|
6043
|
+
return i.length ? i[Math.floor(n() * i.length)] : void 0;
|
|
6044
|
+
}
|
|
6045
|
+
const Ef = {
|
|
6046
|
+
/** client → server, with an ack. Payload: `RoomWatch`. */
|
|
6047
|
+
watch: "room-feed:watch",
|
|
6048
|
+
/** server → client. Payload: `RoomChanged`. */
|
|
6049
|
+
changed: "room-feed:changed"
|
|
6050
|
+
};
|
|
6051
|
+
function Sf(e) {
|
|
6052
|
+
if (typeof e != "object" || e === null || Array.isArray(e))
|
|
6053
|
+
return null;
|
|
6054
|
+
const t = e;
|
|
6055
|
+
if ("room" in t) {
|
|
6056
|
+
const { room: r, ...n } = t;
|
|
6057
|
+
return Object.keys(n).length > 0 ? null : typeof r == "string" && r.length > 0 ? { room: r } : null;
|
|
6058
|
+
}
|
|
6059
|
+
if ("list" in t) {
|
|
6060
|
+
const { list: r, ...n } = t;
|
|
6061
|
+
return Object.keys(n).length > 0 ? null : r === !0 ? { list: !0 } : null;
|
|
6062
|
+
}
|
|
6063
|
+
return null;
|
|
6064
|
+
}
|
|
6065
|
+
const Rf = 1280;
|
|
6066
|
+
function Tf(e) {
|
|
6067
|
+
return e.screenWidth < Rf ? !1 : e.noHoverNoPointer || e.anyHoverNone && e.maxTouchPoints === 0;
|
|
6068
|
+
}
|
|
6069
|
+
function xf() {
|
|
6011
6070
|
const e = (t) => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia(t).matches;
|
|
6012
6071
|
return {
|
|
6013
6072
|
noHoverNoPointer: e("(hover: none) and (pointer: none)"),
|
|
@@ -6018,25 +6077,25 @@ function _f() {
|
|
|
6018
6077
|
}
|
|
6019
6078
|
let Gn = !1, Li = null;
|
|
6020
6079
|
const Yn = /* @__PURE__ */ new Set();
|
|
6021
|
-
function
|
|
6022
|
-
return Li ??=
|
|
6080
|
+
function Cf() {
|
|
6081
|
+
return Li ??= Tf(xf()), Li;
|
|
6023
6082
|
}
|
|
6024
6083
|
function $t() {
|
|
6025
|
-
return Gn ||
|
|
6084
|
+
return Gn || Cf();
|
|
6026
6085
|
}
|
|
6027
|
-
function
|
|
6086
|
+
function kf(e) {
|
|
6028
6087
|
const t = e === !0;
|
|
6029
6088
|
if (t === Gn) return;
|
|
6030
6089
|
const r = $t();
|
|
6031
6090
|
if (Gn = t, $t() !== r) for (const n of Yn) n();
|
|
6032
6091
|
}
|
|
6033
|
-
function
|
|
6092
|
+
function Ts(e) {
|
|
6034
6093
|
return Yn.add(e), () => {
|
|
6035
6094
|
Yn.delete(e);
|
|
6036
6095
|
};
|
|
6037
6096
|
}
|
|
6038
|
-
function
|
|
6039
|
-
return ln(
|
|
6097
|
+
function xs() {
|
|
6098
|
+
return ln(Ts, $t, () => !1);
|
|
6040
6099
|
}
|
|
6041
6100
|
const ye = {
|
|
6042
6101
|
resolved: !1,
|
|
@@ -6047,13 +6106,13 @@ const ye = {
|
|
|
6047
6106
|
function gn() {
|
|
6048
6107
|
return ye.accountId ? ye.accountId : ye.resolved && ye.userType === "public" ? "anon" : null;
|
|
6049
6108
|
}
|
|
6050
|
-
function
|
|
6109
|
+
function Af(e) {
|
|
6051
6110
|
ye.resolved = !0, e.userType && (ye.userType = e.userType), e.userId !== void 0 && (ye.accountId = e.userId && e.userId !== "public" ? e.userId : null);
|
|
6052
6111
|
}
|
|
6053
6112
|
function Oi() {
|
|
6054
6113
|
return ye.userType;
|
|
6055
6114
|
}
|
|
6056
|
-
function
|
|
6115
|
+
function Pf() {
|
|
6057
6116
|
return ye.resolved && ye.userType === "public";
|
|
6058
6117
|
}
|
|
6059
6118
|
const Di = {
|
|
@@ -6064,19 +6123,19 @@ const Di = {
|
|
|
6064
6123
|
wife: 4,
|
|
6065
6124
|
admin: 5
|
|
6066
6125
|
};
|
|
6067
|
-
function
|
|
6126
|
+
function Mf(e, t) {
|
|
6068
6127
|
return (Di[e] ?? -1) >= Di[t];
|
|
6069
6128
|
}
|
|
6070
|
-
function
|
|
6071
|
-
return
|
|
6129
|
+
function _g() {
|
|
6130
|
+
return Mf(ye.userType, "service");
|
|
6072
6131
|
}
|
|
6073
6132
|
function yn() {
|
|
6074
6133
|
return ye.accountId ?? "public";
|
|
6075
6134
|
}
|
|
6076
|
-
function
|
|
6135
|
+
function If() {
|
|
6077
6136
|
return gn() ?? "unscoped";
|
|
6078
6137
|
}
|
|
6079
|
-
async function
|
|
6138
|
+
async function Lf() {
|
|
6080
6139
|
if (ye.name) return ye.name;
|
|
6081
6140
|
try {
|
|
6082
6141
|
const e = await fetch("/session/whoami", {
|
|
@@ -6086,7 +6145,7 @@ async function kf() {
|
|
|
6086
6145
|
if (!e.ok || !(e.headers.get("content-type") ?? "").includes("json"))
|
|
6087
6146
|
return x("auth", "whoami unavailable", { status: e.status }), null;
|
|
6088
6147
|
const t = await e.json();
|
|
6089
|
-
if (
|
|
6148
|
+
if (kf(t.tv), ye.userType === "public") return null;
|
|
6090
6149
|
if (t.valid && (ye.accountId = typeof t.userId == "string" && t.userId ? t.userId : null), t.valid && typeof t.name == "string")
|
|
6091
6150
|
return ye.name = t.name, t.name;
|
|
6092
6151
|
} catch (e) {
|
|
@@ -6094,7 +6153,7 @@ async function kf() {
|
|
|
6094
6153
|
}
|
|
6095
6154
|
return null;
|
|
6096
6155
|
}
|
|
6097
|
-
const
|
|
6156
|
+
const Of = u.object({
|
|
6098
6157
|
// Identity. There is deliberately NO `name`: a person's name is their
|
|
6099
6158
|
// hadoku key-registry name, resolved by the server from whoami and renamed
|
|
6100
6159
|
// through hadoku_site's POST /session/name (operator decision 2026-10-08).
|
|
@@ -6119,15 +6178,15 @@ const Af = u.object({
|
|
|
6119
6178
|
preferredAudioLang: u.string().optional(),
|
|
6120
6179
|
subtitlesEnabled: u.boolean().optional(),
|
|
6121
6180
|
subtitleStyle: u.string().optional()
|
|
6122
|
-
}), ar =
|
|
6181
|
+
}), ar = El({
|
|
6123
6182
|
appId: "watchparty",
|
|
6124
|
-
schema:
|
|
6125
|
-
}),
|
|
6183
|
+
schema: Of
|
|
6184
|
+
}), Df = /* @__PURE__ */ new Set(["theme", "themeMode"]);
|
|
6126
6185
|
function on(e) {
|
|
6127
6186
|
const t = gn();
|
|
6128
6187
|
return t ? `prefs-cache:${t}:${e}` : null;
|
|
6129
6188
|
}
|
|
6130
|
-
function
|
|
6189
|
+
function Nf() {
|
|
6131
6190
|
return gn() === null;
|
|
6132
6191
|
}
|
|
6133
6192
|
function Ni(e) {
|
|
@@ -6141,9 +6200,9 @@ function Ni(e) {
|
|
|
6141
6200
|
return {};
|
|
6142
6201
|
}
|
|
6143
6202
|
}
|
|
6144
|
-
function
|
|
6203
|
+
function $f() {
|
|
6145
6204
|
let e = 0;
|
|
6146
|
-
for (const t of
|
|
6205
|
+
for (const t of tf()) {
|
|
6147
6206
|
const r = t.startsWith("prefs-cache:") && t.endsWith(":watchparty"), n = t === sn || t.startsWith(`${sn}:`) && !t.endsWith(":_serverSynced_v1");
|
|
6148
6207
|
if (!r && !n) continue;
|
|
6149
6208
|
const a = je(t);
|
|
@@ -6161,12 +6220,12 @@ function If() {
|
|
|
6161
6220
|
}
|
|
6162
6221
|
return e > 0 && x("preferences", "Stripped retired name from cached prefs rows", { rewritten: e }), e;
|
|
6163
6222
|
}
|
|
6164
|
-
let
|
|
6223
|
+
let Cs = null, ks = null;
|
|
6165
6224
|
const $i = /* @__PURE__ */ new Set();
|
|
6166
6225
|
function Ca() {
|
|
6167
|
-
if (
|
|
6226
|
+
if (Nf())
|
|
6168
6227
|
return x("preferences", "Boot read deferred — session pending, identity unresolved"), {};
|
|
6169
|
-
const e = Ni("portfolio"), t = Ni("watchparty"), r = Object.keys(e).length > 0 ? e :
|
|
6228
|
+
const e = Ni("portfolio"), t = Ni("watchparty"), r = Object.keys(e).length > 0 ? e : Cs ?? {}, n = Object.keys(t).length > 0 ? t : ks ?? {}, a = yn() || "public";
|
|
6170
6229
|
if ($i.has(a))
|
|
6171
6230
|
return x("preferences", "Loaded (sync, SDK-only after first read)", {
|
|
6172
6231
|
uid: a,
|
|
@@ -6178,7 +6237,7 @@ function Ca() {
|
|
|
6178
6237
|
appSource: Object.keys(t).length > 0 ? "cache" : "mem"
|
|
6179
6238
|
}), { ...n, ...r };
|
|
6180
6239
|
$i.add(a);
|
|
6181
|
-
const i =
|
|
6240
|
+
const i = Ps() ?? {}, o = { ...i, ...n, ...r };
|
|
6182
6241
|
return x("preferences", "Loaded (sync, first read — legacy + SDK)", {
|
|
6183
6242
|
uid: a,
|
|
6184
6243
|
sdkThemeKeys: Object.keys(r).length,
|
|
@@ -6188,30 +6247,30 @@ function Ca() {
|
|
|
6188
6247
|
appSource: Object.keys(t).length > 0 ? "cache" : "mem"
|
|
6189
6248
|
}), o;
|
|
6190
6249
|
}
|
|
6191
|
-
let
|
|
6192
|
-
function
|
|
6250
|
+
let As = !1;
|
|
6251
|
+
function Ff() {
|
|
6193
6252
|
const e = yn();
|
|
6194
6253
|
return !e || e === "public";
|
|
6195
6254
|
}
|
|
6196
6255
|
function Ze(e, t) {
|
|
6197
|
-
|
|
6256
|
+
Ff() && (As = !0), Df.has(e) ? Zt.save({ [e]: t }, { scope: "device" }).catch((r) => ne("preferences", "themePrefs.save failed", { key: e, err: r?.message })) : ar.save({ [e]: t }).catch((r) => ne("preferences", "watchpartyPrefs.save failed", { key: e, err: r?.message })), x("preferences", "Saved (via SDK)", { key: e, value: t });
|
|
6198
6257
|
}
|
|
6199
6258
|
let Dr = null, Fi = !1;
|
|
6200
|
-
function
|
|
6259
|
+
function Uf() {
|
|
6201
6260
|
return Dr || (Dr = (async () => {
|
|
6202
6261
|
if (typeof window > "u") return !1;
|
|
6203
6262
|
try {
|
|
6204
6263
|
Fi || (Fi = !0, Zt.subscribe((o) => {
|
|
6205
|
-
|
|
6264
|
+
Cs = o, ji("portfolio", o), zi("theme");
|
|
6206
6265
|
}), ar.subscribe((o) => {
|
|
6207
|
-
|
|
6266
|
+
ks = o, ji("watchparty", o), zi("watchparty");
|
|
6208
6267
|
}));
|
|
6209
6268
|
const [e, t] = await Promise.all([
|
|
6210
6269
|
Zt.read(),
|
|
6211
6270
|
ar.read()
|
|
6212
6271
|
]);
|
|
6213
6272
|
try {
|
|
6214
|
-
const { useAppStore: o } = await Promise.resolve().then(() =>
|
|
6273
|
+
const { useAppStore: o } = await Promise.resolve().then(() => Ls);
|
|
6215
6274
|
o.getState().rehydrateFromPrefs();
|
|
6216
6275
|
} catch (o) {
|
|
6217
6276
|
ne("preferences", "inline rehydrate after SDK read failed", { err: o?.message });
|
|
@@ -6223,7 +6282,7 @@ function Of() {
|
|
|
6223
6282
|
// Post-fetch cache state: should be non-zero if SDK wrote it.
|
|
6224
6283
|
sdkThemeBytesPost: a?.length ?? 0,
|
|
6225
6284
|
sdkAppBytesPost: i?.length ?? 0
|
|
6226
|
-
}), await
|
|
6285
|
+
}), await Bf(e, t), As ? (x("preferences", "Promoting this load's pre-auth picks to the signed-in user"), await Promise.all([
|
|
6227
6286
|
Zt.promoteAnonPrefsToUser().catch(() => {
|
|
6228
6287
|
}),
|
|
6229
6288
|
ar.promoteAnonPrefsToUser().catch(() => {
|
|
@@ -6235,12 +6294,12 @@ function Of() {
|
|
|
6235
6294
|
})(), Dr);
|
|
6236
6295
|
}
|
|
6237
6296
|
const sn = "watchparty_preferences";
|
|
6238
|
-
|
|
6297
|
+
$f();
|
|
6239
6298
|
function Xn() {
|
|
6240
6299
|
const e = yn();
|
|
6241
6300
|
return !e || e === "public" ? sn : `${sn}:${e}`;
|
|
6242
6301
|
}
|
|
6243
|
-
function
|
|
6302
|
+
function Ps() {
|
|
6244
6303
|
const e = je(Xn());
|
|
6245
6304
|
if (!e) return null;
|
|
6246
6305
|
try {
|
|
@@ -6253,8 +6312,8 @@ function As() {
|
|
|
6253
6312
|
function Ui() {
|
|
6254
6313
|
an(Xn()), an(`${Xn()}:_serverSynced_v1`);
|
|
6255
6314
|
}
|
|
6256
|
-
async function
|
|
6257
|
-
const r =
|
|
6315
|
+
async function Bf(e, t) {
|
|
6316
|
+
const r = Ps();
|
|
6258
6317
|
if (!r || Object.keys(r).length === 0) return;
|
|
6259
6318
|
const n = Object.keys(e ?? {}).length > 0, a = Object.keys(t ?? {}).length > 0, i = {}, o = {};
|
|
6260
6319
|
for (const [c, d] of Object.entries(r))
|
|
@@ -6302,7 +6361,7 @@ function ji(e, t) {
|
|
|
6302
6361
|
}
|
|
6303
6362
|
}
|
|
6304
6363
|
function zi(e) {
|
|
6305
|
-
Promise.resolve().then(() =>
|
|
6364
|
+
Promise.resolve().then(() => Ls).then(({ useAppStore: t }) => {
|
|
6306
6365
|
try {
|
|
6307
6366
|
t.getState().rehydrateFromPrefs();
|
|
6308
6367
|
} catch (r) {
|
|
@@ -6310,17 +6369,17 @@ function zi(e) {
|
|
|
6310
6369
|
}
|
|
6311
6370
|
}).catch((t) => ne("preferences", "store import failed", { reason: e, err: t?.message }));
|
|
6312
6371
|
}
|
|
6313
|
-
const
|
|
6372
|
+
const Ms = 320, Hi = 240, jf = 640;
|
|
6314
6373
|
function Dn(e, t) {
|
|
6315
|
-
if (!Number.isFinite(e)) return
|
|
6316
|
-
let r =
|
|
6374
|
+
if (!Number.isFinite(e)) return Ms;
|
|
6375
|
+
let r = jf;
|
|
6317
6376
|
return r = Math.max(r, Hi), Math.round(Math.min(r, Math.max(Hi, e)));
|
|
6318
6377
|
}
|
|
6319
|
-
function
|
|
6378
|
+
function Is(e, t) {
|
|
6320
6379
|
const r = new Set(t.map((i) => i.id)), n = t.reduce((i, o) => Math.max(i, o.ts), -1 / 0), a = e.filter((i) => !r.has(i.id) && i.ts > n);
|
|
6321
6380
|
return a.length ? [...t, ...a] : t;
|
|
6322
6381
|
}
|
|
6323
|
-
const et = Ca(), U =
|
|
6382
|
+
const et = Ca(), U = Zu((e, t) => ({
|
|
6324
6383
|
ready: !1,
|
|
6325
6384
|
name: "",
|
|
6326
6385
|
sprite: null,
|
|
@@ -6330,7 +6389,7 @@ const et = Ca(), U = Qu((e, t) => ({
|
|
|
6330
6389
|
chat: [],
|
|
6331
6390
|
chatCollapsed: et.chatCollapsed ?? !1,
|
|
6332
6391
|
chromeChatCollapsed: et.chromeChatCollapsed ?? !1,
|
|
6333
|
-
chromeChatWidth: Dn(et.chromeChatWidth ??
|
|
6392
|
+
chromeChatWidth: Dn(et.chromeChatWidth ?? Ms),
|
|
6334
6393
|
// Hardcoded on for everyone — the per-user toggle was removed from the
|
|
6335
6394
|
// control bar; FloatingChat + toggleFloatingChat code is kept for future
|
|
6336
6395
|
// re-enablement but the value is no longer user-controllable.
|
|
@@ -6374,19 +6433,14 @@ const et = Ca(), U = Qu((e, t) => ({
|
|
|
6374
6433
|
ensureAutoIdentity: () => e((r) => {
|
|
6375
6434
|
if (r.name) return {};
|
|
6376
6435
|
if (r.sprite) {
|
|
6377
|
-
const
|
|
6378
|
-
return x("store", "Auto-identity: deriving name from the requested sprite", { name:
|
|
6436
|
+
const i = dr(r.sprite);
|
|
6437
|
+
return x("store", "Auto-identity: deriving name from the requested sprite", { name: i, sprite: r.sprite }), { name: i };
|
|
6438
|
+
}
|
|
6439
|
+
const n = Object.values(r.roster).map((i) => i.sprite), a = Rs(n, void 0, Nt);
|
|
6440
|
+
if (a) {
|
|
6441
|
+
const i = dr(a);
|
|
6442
|
+
return x("store", "Auto-identity assigned", { name: i, sprite: a }), { name: i, sprite: a };
|
|
6379
6443
|
}
|
|
6380
|
-
const n = new Set(Object.values(r.roster).map((a) => a.sprite).filter(Boolean));
|
|
6381
|
-
x("store", "ensureAutoIdentity checking", {
|
|
6382
|
-
rosterSize: Object.keys(r.roster).length,
|
|
6383
|
-
usedSprites: Array.from(n)
|
|
6384
|
-
});
|
|
6385
|
-
for (const a of Nt)
|
|
6386
|
-
if (!n.has(a)) {
|
|
6387
|
-
const i = dr(a);
|
|
6388
|
-
return x("store", "Auto-identity assigned", { name: i, sprite: a }), { name: i, sprite: a };
|
|
6389
|
-
}
|
|
6390
6444
|
return ne("store", "All characters taken, leaving identity unset"), {};
|
|
6391
6445
|
}),
|
|
6392
6446
|
ensureMe: (r) => {
|
|
@@ -6433,7 +6487,7 @@ const et = Ca(), U = Qu((e, t) => ({
|
|
|
6433
6487
|
appendChat: (r) => {
|
|
6434
6488
|
x("chat", "Message appended", { id: r.id, from: r.name, isSystem: r.isSystem }), e((n) => ({ chat: [...n.chat, r].slice(-500) }));
|
|
6435
6489
|
},
|
|
6436
|
-
setChat: (r) => e((n) => ({ chat:
|
|
6490
|
+
setChat: (r) => e((n) => ({ chat: Is(n.chat, r).slice(-500) })),
|
|
6437
6491
|
toggleChatCollapsed: () => e((r) => {
|
|
6438
6492
|
const n = !r.chatCollapsed;
|
|
6439
6493
|
return $t() || Ze("chatCollapsed", n), { chatCollapsed: n };
|
|
@@ -6551,12 +6605,12 @@ const et = Ca(), U = Qu((e, t) => ({
|
|
|
6551
6605
|
setSidebarTab: (r) => e((n) => n.sidebarTab === r && r !== "chat" ? { sidebarTab: "chat" } : { sidebarTab: r, chatCollapsed: !1 })
|
|
6552
6606
|
}));
|
|
6553
6607
|
mn("__ZUSTAND_STORE__", U);
|
|
6554
|
-
const
|
|
6608
|
+
const Ls = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
6555
6609
|
__proto__: null,
|
|
6556
|
-
mergeHistory:
|
|
6610
|
+
mergeHistory: Is,
|
|
6557
6611
|
useAppStore: U
|
|
6558
6612
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
6559
|
-
function
|
|
6613
|
+
function zf({ className: e = "fixed bottom-4 left-1/2 -translate-x-1/2" }) {
|
|
6560
6614
|
const t = U((n) => n.toasts), r = U((n) => n.popToast);
|
|
6561
6615
|
return nt(() => {
|
|
6562
6616
|
const n = t.map((a) => setTimeout(() => r(a.id), 4e3));
|
|
@@ -6565,14 +6619,14 @@ function $f({ className: e = "fixed bottom-4 left-1/2 -translate-x-1/2" }) {
|
|
|
6565
6619
|
};
|
|
6566
6620
|
}, [t, r]), /* @__PURE__ */ N("div", { className: `${e} flex flex-col gap-2 z-50`, children: t.map((n) => /* @__PURE__ */ N("div", { className: `px-3 py-2 rounded text-sm shadow font-medium border ${n.kind === "error" ? "bg-danger-bg text-on-danger-bg border-danger" : "bg-bg-card border-border-light text-text"}`, children: n.msg }, n.id)) });
|
|
6567
6621
|
}
|
|
6568
|
-
function
|
|
6622
|
+
function Hf() {
|
|
6569
6623
|
try {
|
|
6570
6624
|
return typeof document > "u" ? !0 : !document.hidden;
|
|
6571
6625
|
} catch {
|
|
6572
6626
|
return !0;
|
|
6573
6627
|
}
|
|
6574
6628
|
}
|
|
6575
|
-
function
|
|
6629
|
+
function Vf(e) {
|
|
6576
6630
|
if (typeof document > "u" || typeof document.addEventListener != "function")
|
|
6577
6631
|
return () => {
|
|
6578
6632
|
};
|
|
@@ -6581,9 +6635,9 @@ function Uf(e) {
|
|
|
6581
6635
|
};
|
|
6582
6636
|
return document.addEventListener("visibilitychange", t), () => document.removeEventListener("visibilitychange", t);
|
|
6583
6637
|
}
|
|
6584
|
-
const
|
|
6585
|
-
function
|
|
6586
|
-
const r = t.isVisible ??
|
|
6638
|
+
const qf = 3e4;
|
|
6639
|
+
function Wf(e, t) {
|
|
6640
|
+
const r = t.isVisible ?? Hf, n = t.setInterval ?? ((_, R) => setInterval(_, R)), a = t.clearInterval ?? ((_) => clearInterval(_));
|
|
6587
6641
|
let i = { list: null, loading: !0, error: null };
|
|
6588
6642
|
const o = /* @__PURE__ */ new Set();
|
|
6589
6643
|
let s = null, l = !1;
|
|
@@ -6608,9 +6662,9 @@ function jf(e, t) {
|
|
|
6608
6662
|
d();
|
|
6609
6663
|
const h = t.pings.subscribe(e, () => {
|
|
6610
6664
|
r() && d();
|
|
6611
|
-
}), y = (t.onVisible ??
|
|
6665
|
+
}), y = (t.onVisible ?? Vf)(() => d()), g = n(() => {
|
|
6612
6666
|
r() && d();
|
|
6613
|
-
}, t.fallbackMs ??
|
|
6667
|
+
}, t.fallbackMs ?? qf);
|
|
6614
6668
|
return {
|
|
6615
6669
|
getState() {
|
|
6616
6670
|
return i;
|
|
@@ -6624,21 +6678,21 @@ function jf(e, t) {
|
|
|
6624
6678
|
}
|
|
6625
6679
|
};
|
|
6626
6680
|
}
|
|
6627
|
-
function
|
|
6681
|
+
function Kf(e) {
|
|
6628
6682
|
return "list";
|
|
6629
6683
|
}
|
|
6630
|
-
const
|
|
6631
|
-
function
|
|
6684
|
+
const Gf = { list: null, loading: !0, error: null };
|
|
6685
|
+
function Yf() {
|
|
6632
6686
|
return () => {
|
|
6633
6687
|
};
|
|
6634
6688
|
}
|
|
6635
|
-
function
|
|
6636
|
-
const r =
|
|
6689
|
+
function Xf(e, t) {
|
|
6690
|
+
const r = Kf(), n = _t(t);
|
|
6637
6691
|
n.current = t;
|
|
6638
6692
|
const a = _t(null);
|
|
6639
6693
|
(a.current === null || a.current.key !== r) && (a.current?.client.close(), a.current = {
|
|
6640
6694
|
key: r,
|
|
6641
|
-
client:
|
|
6695
|
+
client: Wf(e, {
|
|
6642
6696
|
pings: n.current.pings,
|
|
6643
6697
|
fetchList: (l) => n.current.fetchList(l),
|
|
6644
6698
|
fallbackMs: n.current.fallbackMs,
|
|
@@ -6653,10 +6707,10 @@ function qf(e, t) {
|
|
|
6653
6707
|
o.current = setTimeout(() => {
|
|
6654
6708
|
o.current = null, a.current?.client === i && i.close();
|
|
6655
6709
|
}, 0);
|
|
6656
|
-
}), [i]), { ...ln(i ? i.subscribe :
|
|
6710
|
+
}), [i]), { ...ln(i ? i.subscribe : Yf, () => i ? i.getState() : Gf), refresh: () => i.refresh() };
|
|
6657
6711
|
}
|
|
6658
|
-
const
|
|
6659
|
-
function
|
|
6712
|
+
const Jf = 400;
|
|
6713
|
+
function Os() {
|
|
6660
6714
|
const e = _t(null), t = _t([]);
|
|
6661
6715
|
return nt(() => {
|
|
6662
6716
|
const r = e.current;
|
|
@@ -6738,7 +6792,7 @@ function Ls() {
|
|
|
6738
6792
|
};
|
|
6739
6793
|
}
|
|
6740
6794
|
if (!t.current.length)
|
|
6741
|
-
for (let b = 0; b <
|
|
6795
|
+
for (let b = 0; b < Jf; b++) t.current.push(l(void 0, void 0, !0, b));
|
|
6742
6796
|
let c, d = performance.now();
|
|
6743
6797
|
const h = 50;
|
|
6744
6798
|
function y(b, C, E, A) {
|
|
@@ -6868,7 +6922,7 @@ const Gr = /* @__PURE__ */ Object.create(null);
|
|
|
6868
6922
|
Object.keys(Ke).forEach((e) => {
|
|
6869
6923
|
Gr[Ke[e]] = e;
|
|
6870
6924
|
});
|
|
6871
|
-
const Jn = { type: "error", data: "parser error" },
|
|
6925
|
+
const Jn = { type: "error", data: "parser error" }, Ds = typeof Blob == "function" || typeof Blob < "u" && Object.prototype.toString.call(Blob) === "[object BlobConstructor]", Ns = typeof ArrayBuffer == "function", $s = (e) => typeof ArrayBuffer.isView == "function" ? ArrayBuffer.isView(e) : e && e.buffer instanceof ArrayBuffer, ka = ({ type: e, data: t }, r, n) => Ds && t instanceof Blob ? r ? n(t) : Vi(t, n) : Ns && (t instanceof ArrayBuffer || $s(t)) ? r ? n(t) : Vi(new Blob([t]), n) : n(Ke[e] + (t || "")), Vi = (e, t) => {
|
|
6872
6926
|
const r = new FileReader();
|
|
6873
6927
|
return r.onload = function() {
|
|
6874
6928
|
const n = r.result.split(",")[1];
|
|
@@ -6879,10 +6933,10 @@ function qi(e) {
|
|
|
6879
6933
|
return e instanceof Uint8Array ? e : e instanceof ArrayBuffer ? new Uint8Array(e) : new Uint8Array(e.buffer, e.byteOffset, e.byteLength);
|
|
6880
6934
|
}
|
|
6881
6935
|
let Nn;
|
|
6882
|
-
function
|
|
6883
|
-
if (
|
|
6936
|
+
function Qf(e, t) {
|
|
6937
|
+
if (Ds && e.data instanceof Blob)
|
|
6884
6938
|
return e.data.arrayBuffer().then(qi).then(t);
|
|
6885
|
-
if (
|
|
6939
|
+
if (Ns && (e.data instanceof ArrayBuffer || $s(e.data)))
|
|
6886
6940
|
return t(qi(e.data));
|
|
6887
6941
|
ka(e, !1, (r) => {
|
|
6888
6942
|
Nn || (Nn = new TextEncoder()), t(Nn.encode(r));
|
|
@@ -6891,45 +6945,45 @@ function Kf(e, t) {
|
|
|
6891
6945
|
const Wi = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", Jt = typeof Uint8Array > "u" ? [] : new Uint8Array(256);
|
|
6892
6946
|
for (let e = 0; e < Wi.length; e++)
|
|
6893
6947
|
Jt[Wi.charCodeAt(e)] = e;
|
|
6894
|
-
const
|
|
6948
|
+
const Zf = (e) => {
|
|
6895
6949
|
let t = e.length * 0.75, r = e.length, n, a = 0, i, o, s, l;
|
|
6896
6950
|
e[e.length - 1] === "=" && (t--, e[e.length - 2] === "=" && t--);
|
|
6897
6951
|
const c = new ArrayBuffer(t), d = new Uint8Array(c);
|
|
6898
6952
|
for (n = 0; n < r; n += 4)
|
|
6899
6953
|
i = Jt[e.charCodeAt(n)], o = Jt[e.charCodeAt(n + 1)], s = Jt[e.charCodeAt(n + 2)], l = Jt[e.charCodeAt(n + 3)], d[a++] = i << 2 | o >> 4, d[a++] = (o & 15) << 4 | s >> 2, d[a++] = (s & 3) << 6 | l & 63;
|
|
6900
6954
|
return c;
|
|
6901
|
-
},
|
|
6955
|
+
}, eh = typeof ArrayBuffer == "function", Aa = (e, t) => {
|
|
6902
6956
|
if (typeof e != "string")
|
|
6903
6957
|
return {
|
|
6904
6958
|
type: "message",
|
|
6905
|
-
data:
|
|
6959
|
+
data: Fs(e, t)
|
|
6906
6960
|
};
|
|
6907
6961
|
const r = e.charAt(0);
|
|
6908
6962
|
return r === "b" ? {
|
|
6909
6963
|
type: "message",
|
|
6910
|
-
data:
|
|
6964
|
+
data: th(e.substring(1), t)
|
|
6911
6965
|
} : Gr[r] ? e.length > 1 ? {
|
|
6912
6966
|
type: Gr[r],
|
|
6913
6967
|
data: e.substring(1)
|
|
6914
6968
|
} : {
|
|
6915
6969
|
type: Gr[r]
|
|
6916
6970
|
} : Jn;
|
|
6917
|
-
},
|
|
6918
|
-
if (
|
|
6919
|
-
const r =
|
|
6920
|
-
return
|
|
6971
|
+
}, th = (e, t) => {
|
|
6972
|
+
if (eh) {
|
|
6973
|
+
const r = Zf(e);
|
|
6974
|
+
return Fs(r, t);
|
|
6921
6975
|
} else
|
|
6922
6976
|
return { base64: !0, data: e };
|
|
6923
|
-
},
|
|
6977
|
+
}, Fs = (e, t) => t === "blob" ? e instanceof Blob ? e : new Blob([e]) : e instanceof ArrayBuffer ? e : e.buffer, Us = "", rh = (e, t) => {
|
|
6924
6978
|
const r = e.length, n = new Array(r);
|
|
6925
6979
|
let a = 0;
|
|
6926
6980
|
e.forEach((i, o) => {
|
|
6927
6981
|
ka(i, !1, (s) => {
|
|
6928
|
-
n[o] = s, ++a === r && t(n.join(
|
|
6982
|
+
n[o] = s, ++a === r && t(n.join(Us));
|
|
6929
6983
|
});
|
|
6930
6984
|
});
|
|
6931
|
-
},
|
|
6932
|
-
const r = e.split(
|
|
6985
|
+
}, nh = (e, t) => {
|
|
6986
|
+
const r = e.split(Us), n = [];
|
|
6933
6987
|
for (let a = 0; a < r.length; a++) {
|
|
6934
6988
|
const i = Aa(r[a], t);
|
|
6935
6989
|
if (n.push(i), i.type === "error")
|
|
@@ -6937,10 +6991,10 @@ const Gf = (e) => {
|
|
|
6937
6991
|
}
|
|
6938
6992
|
return n;
|
|
6939
6993
|
};
|
|
6940
|
-
function
|
|
6994
|
+
function ah() {
|
|
6941
6995
|
return new TransformStream({
|
|
6942
6996
|
transform(e, t) {
|
|
6943
|
-
|
|
6997
|
+
Qf(e, (r) => {
|
|
6944
6998
|
const n = r.length;
|
|
6945
6999
|
let a;
|
|
6946
7000
|
if (n < 126)
|
|
@@ -6972,7 +7026,7 @@ function $r(e, t) {
|
|
|
6972
7026
|
r[a] = e[0][n++], n === e[0].length && (e.shift(), n = 0);
|
|
6973
7027
|
return e.length && n < e[0].length && (e[0] = e[0].slice(n)), r;
|
|
6974
7028
|
}
|
|
6975
|
-
function
|
|
7029
|
+
function ih(e, t) {
|
|
6976
7030
|
$n || ($n = new TextDecoder());
|
|
6977
7031
|
const r = [];
|
|
6978
7032
|
let n = 0, a = -1, i = !1;
|
|
@@ -7012,11 +7066,11 @@ function eh(e, t) {
|
|
|
7012
7066
|
}
|
|
7013
7067
|
});
|
|
7014
7068
|
}
|
|
7015
|
-
const
|
|
7069
|
+
const Bs = 4;
|
|
7016
7070
|
function de(e) {
|
|
7017
|
-
if (e) return
|
|
7071
|
+
if (e) return oh(e);
|
|
7018
7072
|
}
|
|
7019
|
-
function
|
|
7073
|
+
function oh(e) {
|
|
7020
7074
|
for (var t in de.prototype)
|
|
7021
7075
|
e[t] = de.prototype[t];
|
|
7022
7076
|
return e;
|
|
@@ -7062,34 +7116,34 @@ de.prototype.listeners = function(e) {
|
|
|
7062
7116
|
de.prototype.hasListeners = function(e) {
|
|
7063
7117
|
return !!this.listeners(e).length;
|
|
7064
7118
|
};
|
|
7065
|
-
const vn = typeof Promise == "function" && typeof Promise.resolve == "function" ? (t) => Promise.resolve().then(t) : (t, r) => r(t, 0), Le = typeof self < "u" ? self : typeof window < "u" ? window : Function("return this")(),
|
|
7066
|
-
function
|
|
7119
|
+
const vn = typeof Promise == "function" && typeof Promise.resolve == "function" ? (t) => Promise.resolve().then(t) : (t, r) => r(t, 0), Le = typeof self < "u" ? self : typeof window < "u" ? window : Function("return this")(), sh = "arraybuffer";
|
|
7120
|
+
function js(e, ...t) {
|
|
7067
7121
|
return t.reduce((r, n) => (e.hasOwnProperty(n) && (r[n] = e[n]), r), {});
|
|
7068
7122
|
}
|
|
7069
|
-
const
|
|
7123
|
+
const lh = Le.setTimeout, ch = Le.clearTimeout;
|
|
7070
7124
|
function bn(e, t) {
|
|
7071
|
-
t.useNativeTimers ? (e.setTimeoutFn =
|
|
7125
|
+
t.useNativeTimers ? (e.setTimeoutFn = lh.bind(Le), e.clearTimeoutFn = ch.bind(Le)) : (e.setTimeoutFn = Le.setTimeout.bind(Le), e.clearTimeoutFn = Le.clearTimeout.bind(Le));
|
|
7072
7126
|
}
|
|
7073
|
-
const
|
|
7074
|
-
function
|
|
7075
|
-
return typeof e == "string" ?
|
|
7127
|
+
const uh = 1.33;
|
|
7128
|
+
function dh(e) {
|
|
7129
|
+
return typeof e == "string" ? fh(e) : Math.ceil((e.byteLength || e.size) * uh);
|
|
7076
7130
|
}
|
|
7077
|
-
function
|
|
7131
|
+
function fh(e) {
|
|
7078
7132
|
let t = 0, r = 0;
|
|
7079
7133
|
for (let n = 0, a = e.length; n < a; n++)
|
|
7080
7134
|
t = e.charCodeAt(n), t < 128 ? r += 1 : t < 2048 ? r += 2 : t < 55296 || t >= 57344 ? r += 3 : (n++, r += 4);
|
|
7081
7135
|
return r;
|
|
7082
7136
|
}
|
|
7083
|
-
function
|
|
7137
|
+
function zs() {
|
|
7084
7138
|
return Date.now().toString(36).substring(3) + Math.random().toString(36).substring(2, 5);
|
|
7085
7139
|
}
|
|
7086
|
-
function
|
|
7140
|
+
function hh(e) {
|
|
7087
7141
|
let t = "";
|
|
7088
7142
|
for (let r in e)
|
|
7089
7143
|
e.hasOwnProperty(r) && (t.length && (t += "&"), t += encodeURIComponent(r) + "=" + encodeURIComponent(e[r]));
|
|
7090
7144
|
return t;
|
|
7091
7145
|
}
|
|
7092
|
-
function
|
|
7146
|
+
function ph(e) {
|
|
7093
7147
|
let t = {}, r = e.split("&");
|
|
7094
7148
|
for (let n = 0, a = r.length; n < a; n++) {
|
|
7095
7149
|
let i = r[n].split("=");
|
|
@@ -7097,7 +7151,7 @@ function ch(e) {
|
|
|
7097
7151
|
}
|
|
7098
7152
|
return t;
|
|
7099
7153
|
}
|
|
7100
|
-
class
|
|
7154
|
+
class mh extends Error {
|
|
7101
7155
|
constructor(t, r, n) {
|
|
7102
7156
|
super(t), this.description = r, this.context = n, this.type = "TransportError";
|
|
7103
7157
|
}
|
|
@@ -7122,7 +7176,7 @@ class Pa extends de {
|
|
|
7122
7176
|
* @protected
|
|
7123
7177
|
*/
|
|
7124
7178
|
onError(t, r, n) {
|
|
7125
|
-
return super.emitReserved("error", new
|
|
7179
|
+
return super.emitReserved("error", new mh(t, r, n)), this;
|
|
7126
7180
|
}
|
|
7127
7181
|
/**
|
|
7128
7182
|
* Opens the transport.
|
|
@@ -7196,11 +7250,11 @@ class Pa extends de {
|
|
|
7196
7250
|
return this.opts.port && (this.opts.secure && +(this.opts.port !== 443) || !this.opts.secure && Number(this.opts.port) !== 80) ? ":" + this.opts.port : "";
|
|
7197
7251
|
}
|
|
7198
7252
|
_query(t) {
|
|
7199
|
-
const r =
|
|
7253
|
+
const r = hh(t);
|
|
7200
7254
|
return r.length ? "?" + r : "";
|
|
7201
7255
|
}
|
|
7202
7256
|
}
|
|
7203
|
-
class
|
|
7257
|
+
class gh extends Pa {
|
|
7204
7258
|
constructor() {
|
|
7205
7259
|
super(...arguments), this._polling = !1;
|
|
7206
7260
|
}
|
|
@@ -7256,7 +7310,7 @@ class dh extends Pa {
|
|
|
7256
7310
|
return this.onClose({ description: "transport closed by the server" }), !1;
|
|
7257
7311
|
this.onPacket(n);
|
|
7258
7312
|
};
|
|
7259
|
-
|
|
7313
|
+
nh(t, this.socket.binaryType).forEach(r), this.readyState !== "closed" && (this._polling = !1, this.emitReserved("pollComplete"), this.readyState === "open" && this._poll());
|
|
7260
7314
|
}
|
|
7261
7315
|
/**
|
|
7262
7316
|
* For polling, send a close packet.
|
|
@@ -7276,7 +7330,7 @@ class dh extends Pa {
|
|
|
7276
7330
|
* @protected
|
|
7277
7331
|
*/
|
|
7278
7332
|
write(t) {
|
|
7279
|
-
this.writable = !1,
|
|
7333
|
+
this.writable = !1, rh(t, (r) => {
|
|
7280
7334
|
this.doWrite(r, () => {
|
|
7281
7335
|
this.writable = !0, this.emitReserved("drain");
|
|
7282
7336
|
});
|
|
@@ -7289,18 +7343,18 @@ class dh extends Pa {
|
|
|
7289
7343
|
*/
|
|
7290
7344
|
uri() {
|
|
7291
7345
|
const t = this.opts.secure ? "https" : "http", r = this.query || {};
|
|
7292
|
-
return this.opts.timestampRequests !== !1 && (r[this.opts.timestampParam] =
|
|
7346
|
+
return this.opts.timestampRequests !== !1 && (r[this.opts.timestampParam] = zs()), !this.supportsBinary && !r.sid && (r.b64 = 1), this.createUri(t, r);
|
|
7293
7347
|
}
|
|
7294
7348
|
}
|
|
7295
|
-
let
|
|
7349
|
+
let Hs = !1;
|
|
7296
7350
|
try {
|
|
7297
|
-
|
|
7351
|
+
Hs = typeof XMLHttpRequest < "u" && "withCredentials" in new XMLHttpRequest();
|
|
7298
7352
|
} catch {
|
|
7299
7353
|
}
|
|
7300
|
-
const
|
|
7301
|
-
function
|
|
7354
|
+
const yh = Hs;
|
|
7355
|
+
function vh() {
|
|
7302
7356
|
}
|
|
7303
|
-
class
|
|
7357
|
+
class bh extends gh {
|
|
7304
7358
|
/**
|
|
7305
7359
|
* XHR Polling constructor.
|
|
7306
7360
|
*
|
|
@@ -7359,7 +7413,7 @@ let It = class Yr extends de {
|
|
|
7359
7413
|
*/
|
|
7360
7414
|
_create() {
|
|
7361
7415
|
var t;
|
|
7362
|
-
const r =
|
|
7416
|
+
const r = js(this._opts, "agent", "pfx", "key", "passphrase", "cert", "ca", "ciphers", "rejectUnauthorized", "autoUnref");
|
|
7363
7417
|
r.xdomain = !!this._opts.xd;
|
|
7364
7418
|
const n = this._xhr = this.createRequest(r);
|
|
7365
7419
|
try {
|
|
@@ -7413,7 +7467,7 @@ let It = class Yr extends de {
|
|
|
7413
7467
|
*/
|
|
7414
7468
|
_cleanup(t) {
|
|
7415
7469
|
if (!(typeof this._xhr > "u" || this._xhr === null)) {
|
|
7416
|
-
if (this._xhr.onreadystatechange =
|
|
7470
|
+
if (this._xhr.onreadystatechange = vh, t)
|
|
7417
7471
|
try {
|
|
7418
7472
|
this._xhr.abort();
|
|
7419
7473
|
} catch {
|
|
@@ -7453,26 +7507,26 @@ function Ki() {
|
|
|
7453
7507
|
for (let e in It.requests)
|
|
7454
7508
|
It.requests.hasOwnProperty(e) && It.requests[e].abort();
|
|
7455
7509
|
}
|
|
7456
|
-
const
|
|
7457
|
-
const e =
|
|
7510
|
+
const wh = (function() {
|
|
7511
|
+
const e = Vs({
|
|
7458
7512
|
xdomain: !1
|
|
7459
7513
|
});
|
|
7460
7514
|
return e && e.responseType !== null;
|
|
7461
7515
|
})();
|
|
7462
|
-
class
|
|
7516
|
+
class _h extends bh {
|
|
7463
7517
|
constructor(t) {
|
|
7464
7518
|
super(t);
|
|
7465
7519
|
const r = t && t.forceBase64;
|
|
7466
|
-
this.supportsBinary =
|
|
7520
|
+
this.supportsBinary = wh && !r;
|
|
7467
7521
|
}
|
|
7468
7522
|
request(t = {}) {
|
|
7469
|
-
return Object.assign(t, { xd: this.xd }, this.opts), new It(
|
|
7523
|
+
return Object.assign(t, { xd: this.xd }, this.opts), new It(Vs, this.uri(), t);
|
|
7470
7524
|
}
|
|
7471
7525
|
}
|
|
7472
|
-
function
|
|
7526
|
+
function Vs(e) {
|
|
7473
7527
|
const t = e.xdomain;
|
|
7474
7528
|
try {
|
|
7475
|
-
if (typeof XMLHttpRequest < "u" && (!t ||
|
|
7529
|
+
if (typeof XMLHttpRequest < "u" && (!t || yh))
|
|
7476
7530
|
return new XMLHttpRequest();
|
|
7477
7531
|
} catch {
|
|
7478
7532
|
}
|
|
@@ -7482,13 +7536,13 @@ function Hs(e) {
|
|
|
7482
7536
|
} catch {
|
|
7483
7537
|
}
|
|
7484
7538
|
}
|
|
7485
|
-
const
|
|
7486
|
-
class
|
|
7539
|
+
const qs = typeof navigator < "u" && typeof navigator.product == "string" && navigator.product.toLowerCase() === "reactnative";
|
|
7540
|
+
class Eh extends Pa {
|
|
7487
7541
|
get name() {
|
|
7488
7542
|
return "websocket";
|
|
7489
7543
|
}
|
|
7490
7544
|
doOpen() {
|
|
7491
|
-
const t = this.uri(), r = this.opts.protocols, n =
|
|
7545
|
+
const t = this.uri(), r = this.opts.protocols, n = qs ? {} : js(this.opts, "agent", "perMessageDeflate", "pfx", "key", "passphrase", "cert", "ca", "ciphers", "rejectUnauthorized", "localAddress", "protocolVersion", "origin", "maxPayload", "family", "checkServerIdentity");
|
|
7492
7546
|
this.opts.extraHeaders && (n.headers = this.opts.extraHeaders);
|
|
7493
7547
|
try {
|
|
7494
7548
|
this.ws = this.createSocket(t, r, n);
|
|
@@ -7536,19 +7590,19 @@ class yh extends Pa {
|
|
|
7536
7590
|
*/
|
|
7537
7591
|
uri() {
|
|
7538
7592
|
const t = this.opts.secure ? "wss" : "ws", r = this.query || {};
|
|
7539
|
-
return this.opts.timestampRequests && (r[this.opts.timestampParam] =
|
|
7593
|
+
return this.opts.timestampRequests && (r[this.opts.timestampParam] = zs()), this.supportsBinary || (r.b64 = 1), this.createUri(t, r);
|
|
7540
7594
|
}
|
|
7541
7595
|
}
|
|
7542
7596
|
const Fn = Le.WebSocket || Le.MozWebSocket;
|
|
7543
|
-
class
|
|
7597
|
+
class Sh extends Eh {
|
|
7544
7598
|
createSocket(t, r, n) {
|
|
7545
|
-
return
|
|
7599
|
+
return qs ? new Fn(t, r, n) : r ? new Fn(t, r) : new Fn(t);
|
|
7546
7600
|
}
|
|
7547
7601
|
doWrite(t, r) {
|
|
7548
7602
|
this.ws.send(r);
|
|
7549
7603
|
}
|
|
7550
7604
|
}
|
|
7551
|
-
class
|
|
7605
|
+
class Rh extends Pa {
|
|
7552
7606
|
get name() {
|
|
7553
7607
|
return "webtransport";
|
|
7554
7608
|
}
|
|
@@ -7564,7 +7618,7 @@ class bh extends Pa {
|
|
|
7564
7618
|
this.onError("webtransport error", t);
|
|
7565
7619
|
}), this._transport.ready.then(() => {
|
|
7566
7620
|
this._transport.createBidirectionalStream().then((t) => {
|
|
7567
|
-
const r =
|
|
7621
|
+
const r = ih(Number.MAX_SAFE_INTEGER, this.socket.binaryType), n = t.readable.pipeThrough(r).getReader(), a = ah();
|
|
7568
7622
|
a.readable.pipeTo(t.writable), this._writer = a.writable.getWriter();
|
|
7569
7623
|
const i = () => {
|
|
7570
7624
|
n.read().then(({ done: s, value: l }) => {
|
|
@@ -7594,11 +7648,11 @@ class bh extends Pa {
|
|
|
7594
7648
|
(t = this._transport) === null || t === void 0 || t.close();
|
|
7595
7649
|
}
|
|
7596
7650
|
}
|
|
7597
|
-
const
|
|
7598
|
-
websocket:
|
|
7599
|
-
webtransport:
|
|
7600
|
-
polling:
|
|
7601
|
-
},
|
|
7651
|
+
const Th = {
|
|
7652
|
+
websocket: Sh,
|
|
7653
|
+
webtransport: Rh,
|
|
7654
|
+
polling: _h
|
|
7655
|
+
}, xh = /^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/, Ch = [
|
|
7602
7656
|
"source",
|
|
7603
7657
|
"protocol",
|
|
7604
7658
|
"authority",
|
|
@@ -7619,16 +7673,16 @@ function Qn(e) {
|
|
|
7619
7673
|
throw "URI too long";
|
|
7620
7674
|
const t = e, r = e.indexOf("["), n = e.indexOf("]");
|
|
7621
7675
|
r != -1 && n != -1 && (e = e.substring(0, r) + e.substring(r, n).replace(/:/g, ";") + e.substring(n, e.length));
|
|
7622
|
-
let a =
|
|
7676
|
+
let a = xh.exec(e || ""), i = {}, o = 14;
|
|
7623
7677
|
for (; o--; )
|
|
7624
|
-
i[
|
|
7625
|
-
return r != -1 && n != -1 && (i.source = t, i.host = i.host.substring(1, i.host.length - 1).replace(/;/g, ":"), i.authority = i.authority.replace("[", "").replace("]", "").replace(/;/g, ":"), i.ipv6uri = !0), i.pathNames =
|
|
7678
|
+
i[Ch[o]] = a[o] || "";
|
|
7679
|
+
return r != -1 && n != -1 && (i.source = t, i.host = i.host.substring(1, i.host.length - 1).replace(/;/g, ":"), i.authority = i.authority.replace("[", "").replace("]", "").replace(/;/g, ":"), i.ipv6uri = !0), i.pathNames = kh(i, i.path), i.queryKey = Ah(i, i.query), i;
|
|
7626
7680
|
}
|
|
7627
|
-
function
|
|
7681
|
+
function kh(e, t) {
|
|
7628
7682
|
const r = /\/{2,9}/g, n = t.replace(r, "/").split("/");
|
|
7629
7683
|
return (t.slice(0, 1) == "/" || t.length === 0) && n.splice(0, 1), t.slice(-1) == "/" && n.splice(n.length - 1, 1), n;
|
|
7630
7684
|
}
|
|
7631
|
-
function
|
|
7685
|
+
function Ah(e, t) {
|
|
7632
7686
|
const r = {};
|
|
7633
7687
|
return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g, function(n, a, i) {
|
|
7634
7688
|
a && (r[a] = i);
|
|
@@ -7646,7 +7700,7 @@ class ft extends de {
|
|
|
7646
7700
|
* @param {Object} opts - options
|
|
7647
7701
|
*/
|
|
7648
7702
|
constructor(t, r) {
|
|
7649
|
-
if (super(), this.binaryType =
|
|
7703
|
+
if (super(), this.binaryType = sh, this.writeBuffer = [], this._prevBufferLen = 0, this._pingInterval = -1, this._pingTimeout = -1, this._maxPayload = -1, this._pingTimeoutTime = 1 / 0, t && typeof t == "object" && (r = t, t = null), t) {
|
|
7650
7704
|
const n = Qn(t);
|
|
7651
7705
|
r.hostname = n.host, r.secure = n.protocol === "https" || n.protocol === "wss", r.port = n.port, n.query && (r.query = n.query);
|
|
7652
7706
|
} else r.host && (r.hostname = Qn(r.host).host);
|
|
@@ -7667,7 +7721,7 @@ class ft extends de {
|
|
|
7667
7721
|
},
|
|
7668
7722
|
transportOptions: {},
|
|
7669
7723
|
closeOnBeforeunload: !1
|
|
7670
|
-
}, r), this.opts.path = this.opts.path.replace(/\/$/, "") + (this.opts.addTrailingSlash ? "/" : ""), typeof this.opts.query == "string" && (this.opts.query =
|
|
7724
|
+
}, r), this.opts.path = this.opts.path.replace(/\/$/, "") + (this.opts.addTrailingSlash ? "/" : ""), typeof this.opts.query == "string" && (this.opts.query = ph(this.opts.query)), Zn && (this.opts.closeOnBeforeunload && (this._beforeunloadEventListener = () => {
|
|
7671
7725
|
this.transport && (this.transport.removeAllListeners(), this.transport.close());
|
|
7672
7726
|
}, addEventListener("beforeunload", this._beforeunloadEventListener, !1)), this.hostname !== "localhost" && (this._offlineEventListener = () => {
|
|
7673
7727
|
this._onClose("transport close", {
|
|
@@ -7684,7 +7738,7 @@ class ft extends de {
|
|
|
7684
7738
|
*/
|
|
7685
7739
|
createTransport(t) {
|
|
7686
7740
|
const r = Object.assign({}, this.opts.query);
|
|
7687
|
-
r.EIO =
|
|
7741
|
+
r.EIO = Bs, r.transport = t, this.id && (r.sid = this.id);
|
|
7688
7742
|
const n = Object.assign({}, this.opts, {
|
|
7689
7743
|
query: r,
|
|
7690
7744
|
socket: this,
|
|
@@ -7802,7 +7856,7 @@ class ft extends de {
|
|
|
7802
7856
|
let r = 1;
|
|
7803
7857
|
for (let n = 0; n < this.writeBuffer.length; n++) {
|
|
7804
7858
|
const a = this.writeBuffer[n].data;
|
|
7805
|
-
if (a && (r +=
|
|
7859
|
+
if (a && (r += dh(a)), n > 0 && r > this._maxPayload)
|
|
7806
7860
|
return this.writeBuffer.slice(0, n);
|
|
7807
7861
|
r += 2;
|
|
7808
7862
|
}
|
|
@@ -7908,8 +7962,8 @@ class ft extends de {
|
|
|
7908
7962
|
}
|
|
7909
7963
|
}
|
|
7910
7964
|
}
|
|
7911
|
-
ft.protocol =
|
|
7912
|
-
class
|
|
7965
|
+
ft.protocol = Bs;
|
|
7966
|
+
class Ph extends ft {
|
|
7913
7967
|
constructor() {
|
|
7914
7968
|
super(...arguments), this._upgrades = [];
|
|
7915
7969
|
}
|
|
@@ -7981,21 +8035,21 @@ class Th extends ft {
|
|
|
7981
8035
|
return r;
|
|
7982
8036
|
}
|
|
7983
8037
|
}
|
|
7984
|
-
let
|
|
8038
|
+
let Mh = class extends Ph {
|
|
7985
8039
|
constructor(t, r = {}) {
|
|
7986
8040
|
const n = typeof t == "object" ? t : r;
|
|
7987
|
-
(!n.transports || n.transports && typeof n.transports[0] == "string") && (n.transports = (n.transports || ["polling", "websocket", "webtransport"]).map((a) =>
|
|
8041
|
+
(!n.transports || n.transports && typeof n.transports[0] == "string") && (n.transports = (n.transports || ["polling", "websocket", "webtransport"]).map((a) => Th[a]).filter((a) => !!a)), super(t, n);
|
|
7988
8042
|
}
|
|
7989
8043
|
};
|
|
7990
|
-
function
|
|
8044
|
+
function Ih(e, t = "", r) {
|
|
7991
8045
|
let n = e;
|
|
7992
8046
|
r = r || typeof location < "u" && location, e == null && (e = r.protocol + "//" + r.host), typeof e == "string" && (e.charAt(0) === "/" && (e.charAt(1) === "/" ? e = r.protocol + e : e = r.host + e), /^(https?|wss?):\/\//.test(e) || (typeof r < "u" ? e = r.protocol + "//" + e : e = "https://" + e), n = Qn(e)), n.port || (/^(http|ws)$/.test(n.protocol) ? n.port = "80" : /^(http|ws)s$/.test(n.protocol) && (n.port = "443")), n.path = n.path || "/";
|
|
7993
8047
|
const i = n.host.indexOf(":") !== -1 ? "[" + n.host + "]" : n.host;
|
|
7994
8048
|
return n.id = n.protocol + "://" + i + ":" + n.port + t, n.href = n.protocol + "://" + i + (r && r.port === n.port ? "" : ":" + n.port), n;
|
|
7995
8049
|
}
|
|
7996
|
-
const
|
|
8050
|
+
const Lh = typeof ArrayBuffer == "function", Oh = (e) => typeof ArrayBuffer.isView == "function" ? ArrayBuffer.isView(e) : e.buffer instanceof ArrayBuffer, Ws = Object.prototype.toString, Dh = typeof Blob == "function" || typeof Blob < "u" && Ws.call(Blob) === "[object BlobConstructor]", Nh = typeof File == "function" || typeof File < "u" && Ws.call(File) === "[object FileConstructor]";
|
|
7997
8051
|
function Ma(e) {
|
|
7998
|
-
return
|
|
8052
|
+
return Lh && (e instanceof ArrayBuffer || Oh(e)) || Dh && e instanceof Blob || Nh && e instanceof File;
|
|
7999
8053
|
}
|
|
8000
8054
|
function Jr(e, t) {
|
|
8001
8055
|
if (!e || typeof e != "object")
|
|
@@ -8015,7 +8069,7 @@ function Jr(e, t) {
|
|
|
8015
8069
|
return !0;
|
|
8016
8070
|
return !1;
|
|
8017
8071
|
}
|
|
8018
|
-
function
|
|
8072
|
+
function $h(e) {
|
|
8019
8073
|
const t = [], r = e.data, n = e;
|
|
8020
8074
|
return n.data = ea(r, t), n.attachments = t.length, { packet: n, buffers: t };
|
|
8021
8075
|
}
|
|
@@ -8038,7 +8092,7 @@ function ea(e, t) {
|
|
|
8038
8092
|
}
|
|
8039
8093
|
return e;
|
|
8040
8094
|
}
|
|
8041
|
-
function
|
|
8095
|
+
function Fh(e, t) {
|
|
8042
8096
|
return e.data = ta(e.data, t), delete e.attachments, e;
|
|
8043
8097
|
}
|
|
8044
8098
|
function ta(e, t) {
|
|
@@ -8056,7 +8110,7 @@ function ta(e, t) {
|
|
|
8056
8110
|
Object.prototype.hasOwnProperty.call(e, r) && (e[r] = ta(e[r], t));
|
|
8057
8111
|
return e;
|
|
8058
8112
|
}
|
|
8059
|
-
const
|
|
8113
|
+
const Uh = [
|
|
8060
8114
|
"connect",
|
|
8061
8115
|
"connect_error",
|
|
8062
8116
|
"disconnect",
|
|
@@ -8064,12 +8118,12 @@ const Oh = [
|
|
|
8064
8118
|
"newListener",
|
|
8065
8119
|
"removeListener"
|
|
8066
8120
|
// used by the Node.js EventEmitter
|
|
8067
|
-
],
|
|
8121
|
+
], Bh = 5;
|
|
8068
8122
|
var X;
|
|
8069
8123
|
(function(e) {
|
|
8070
8124
|
e[e.CONNECT = 0] = "CONNECT", e[e.DISCONNECT = 1] = "DISCONNECT", e[e.EVENT = 2] = "EVENT", e[e.ACK = 3] = "ACK", e[e.CONNECT_ERROR = 4] = "CONNECT_ERROR", e[e.BINARY_EVENT = 5] = "BINARY_EVENT", e[e.BINARY_ACK = 6] = "BINARY_ACK";
|
|
8071
8125
|
})(X || (X = {}));
|
|
8072
|
-
class
|
|
8126
|
+
class jh {
|
|
8073
8127
|
/**
|
|
8074
8128
|
* Encoder constructor
|
|
8075
8129
|
*
|
|
@@ -8105,7 +8159,7 @@ class Nh {
|
|
|
8105
8159
|
* a list of buffers.
|
|
8106
8160
|
*/
|
|
8107
8161
|
encodeAsBinary(t) {
|
|
8108
|
-
const r =
|
|
8162
|
+
const r = $h(t), n = this.encodeAsString(r.packet), a = r.buffers;
|
|
8109
8163
|
return a.unshift(n), a;
|
|
8110
8164
|
}
|
|
8111
8165
|
}
|
|
@@ -8133,7 +8187,7 @@ class Ia extends de {
|
|
|
8133
8187
|
throw new Error("got plaintext data when reconstructing a packet");
|
|
8134
8188
|
r = this.decodeString(t);
|
|
8135
8189
|
const n = r.type === X.BINARY_EVENT;
|
|
8136
|
-
n || r.type === X.BINARY_ACK ? (r.type = n ? X.EVENT : X.ACK, this.reconstructor = new
|
|
8190
|
+
n || r.type === X.BINARY_ACK ? (r.type = n ? X.EVENT : X.ACK, this.reconstructor = new zh(r), r.attachments === 0 && super.emitReserved("decoded", r)) : super.emitReserved("decoded", r);
|
|
8137
8191
|
} else if (Ma(t) || t.base64)
|
|
8138
8192
|
if (this.reconstructor)
|
|
8139
8193
|
r = this.reconstructor.takeBinaryData(t), r && (this.reconstructor = null, super.emitReserved("decoded", r));
|
|
@@ -8211,7 +8265,7 @@ class Ia extends de {
|
|
|
8211
8265
|
return typeof r == "string" || Gi(r);
|
|
8212
8266
|
case X.EVENT:
|
|
8213
8267
|
case X.BINARY_EVENT:
|
|
8214
|
-
return Array.isArray(r) && (typeof r[0] == "number" || typeof r[0] == "string" &&
|
|
8268
|
+
return Array.isArray(r) && (typeof r[0] == "number" || typeof r[0] == "string" && Uh.indexOf(r[0]) === -1);
|
|
8215
8269
|
case X.ACK:
|
|
8216
8270
|
case X.BINARY_ACK:
|
|
8217
8271
|
return Array.isArray(r);
|
|
@@ -8224,7 +8278,7 @@ class Ia extends de {
|
|
|
8224
8278
|
this.reconstructor && (this.reconstructor.finishedReconstruction(), this.reconstructor = null);
|
|
8225
8279
|
}
|
|
8226
8280
|
}
|
|
8227
|
-
class
|
|
8281
|
+
class zh {
|
|
8228
8282
|
constructor(t) {
|
|
8229
8283
|
this.packet = t, this.buffers = [], this.reconPack = t;
|
|
8230
8284
|
}
|
|
@@ -8238,7 +8292,7 @@ class $h {
|
|
|
8238
8292
|
*/
|
|
8239
8293
|
takeBinaryData(t) {
|
|
8240
8294
|
if (this.buffers.push(t), this.buffers.length === this.reconPack.attachments) {
|
|
8241
|
-
const r =
|
|
8295
|
+
const r = Fh(this.reconPack, this.buffers);
|
|
8242
8296
|
return this.finishedReconstruction(), r;
|
|
8243
8297
|
}
|
|
8244
8298
|
return null;
|
|
@@ -8250,21 +8304,21 @@ class $h {
|
|
|
8250
8304
|
this.reconPack = null, this.buffers = [];
|
|
8251
8305
|
}
|
|
8252
8306
|
}
|
|
8253
|
-
const
|
|
8307
|
+
const Hh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
8254
8308
|
__proto__: null,
|
|
8255
8309
|
Decoder: Ia,
|
|
8256
|
-
Encoder:
|
|
8310
|
+
Encoder: jh,
|
|
8257
8311
|
get PacketType() {
|
|
8258
8312
|
return X;
|
|
8259
8313
|
},
|
|
8260
|
-
protocol:
|
|
8314
|
+
protocol: Bh
|
|
8261
8315
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
8262
8316
|
function Ne(e, t, r) {
|
|
8263
8317
|
return e.on(t, r), function() {
|
|
8264
8318
|
e.off(t, r);
|
|
8265
8319
|
};
|
|
8266
8320
|
}
|
|
8267
|
-
const
|
|
8321
|
+
const Vh = Object.freeze({
|
|
8268
8322
|
connect: 1,
|
|
8269
8323
|
connect_error: 1,
|
|
8270
8324
|
disconnect: 1,
|
|
@@ -8273,7 +8327,7 @@ const Uh = Object.freeze({
|
|
|
8273
8327
|
newListener: 1,
|
|
8274
8328
|
removeListener: 1
|
|
8275
8329
|
});
|
|
8276
|
-
class
|
|
8330
|
+
class Ks extends de {
|
|
8277
8331
|
/**
|
|
8278
8332
|
* `Socket` constructor.
|
|
8279
8333
|
*/
|
|
@@ -8389,7 +8443,7 @@ class Ws extends de {
|
|
|
8389
8443
|
*/
|
|
8390
8444
|
emit(t, ...r) {
|
|
8391
8445
|
var n, a, i;
|
|
8392
|
-
if (
|
|
8446
|
+
if (Vh.hasOwnProperty(t))
|
|
8393
8447
|
throw new Error('"' + t.toString() + '" is a reserved event name');
|
|
8394
8448
|
if (r.unshift(t), this._opts.retries && !this.flags.fromQueue && !this.flags.volatile)
|
|
8395
8449
|
return this._addToQueue(r), this;
|
|
@@ -8896,7 +8950,7 @@ class ra extends de {
|
|
|
8896
8950
|
max: this.reconnectionDelayMax(),
|
|
8897
8951
|
jitter: this.randomizationFactor()
|
|
8898
8952
|
}), this.timeout(r.timeout == null ? 2e4 : r.timeout), this._readyState = "closed", this.uri = t;
|
|
8899
|
-
const a = r.parser ||
|
|
8953
|
+
const a = r.parser || Hh;
|
|
8900
8954
|
this.encoder = new a.Encoder(), this.decoder = new a.Decoder(), this._autoConnect = r.autoConnect !== !1, this._autoConnect && this.open();
|
|
8901
8955
|
}
|
|
8902
8956
|
reconnection(t) {
|
|
@@ -8939,7 +8993,7 @@ class ra extends de {
|
|
|
8939
8993
|
open(t) {
|
|
8940
8994
|
if (~this._readyState.indexOf("open"))
|
|
8941
8995
|
return this;
|
|
8942
|
-
this.engine = new
|
|
8996
|
+
this.engine = new Mh(this.uri, this.opts);
|
|
8943
8997
|
const r = this.engine, n = this;
|
|
8944
8998
|
this._readyState = "opening", this.skipReconnect = !1;
|
|
8945
8999
|
const a = Ne(r, "open", function() {
|
|
@@ -9029,7 +9083,7 @@ class ra extends de {
|
|
|
9029
9083
|
*/
|
|
9030
9084
|
socket(t, r) {
|
|
9031
9085
|
let n = this.nsps[t];
|
|
9032
|
-
return n ? this._autoConnect && !n.active && n.connect() : (n = new
|
|
9086
|
+
return n ? this._autoConnect && !n.active && n.connect() : (n = new Ks(this, t, r), this.nsps[t] = n), n;
|
|
9033
9087
|
}
|
|
9034
9088
|
/**
|
|
9035
9089
|
* Called upon a socket close.
|
|
@@ -9129,44 +9183,17 @@ class ra extends de {
|
|
|
9129
9183
|
const Kt = {};
|
|
9130
9184
|
function Lt(e, t) {
|
|
9131
9185
|
typeof e == "object" && (t = e, e = void 0), t = t || {};
|
|
9132
|
-
const r =
|
|
9186
|
+
const r = Ih(e, t.path || "/socket.io"), n = r.source, a = r.id, i = r.path, o = Kt[a] && i in Kt[a].nsps, s = t.forceNew || t["force new connection"] || t.multiplex === !1 || o;
|
|
9133
9187
|
let l;
|
|
9134
9188
|
return s ? l = new ra(n, t) : (Kt[a] || (Kt[a] = new ra(n, t)), l = Kt[a]), r.query && !t.query && (t.query = r.queryKey), l.socket(r.path, t);
|
|
9135
9189
|
}
|
|
9136
9190
|
Object.assign(Lt, {
|
|
9137
9191
|
Manager: ra,
|
|
9138
|
-
Socket:
|
|
9192
|
+
Socket: Ks,
|
|
9139
9193
|
io: Lt,
|
|
9140
9194
|
connect: Lt
|
|
9141
9195
|
});
|
|
9142
|
-
function
|
|
9143
|
-
const n = !!e.name && !r(e.name) && (!t || r(t.name || "")), a = !!e.avatarId && (!t || t.avatarId !== e.avatarId);
|
|
9144
|
-
if (!n && !a)
|
|
9145
|
-
return null;
|
|
9146
|
-
const i = {};
|
|
9147
|
-
return n && (i.name = e.name), a && (i.avatarId = e.avatarId), i;
|
|
9148
|
-
}
|
|
9149
|
-
const jh = {
|
|
9150
|
-
/** client → server, with an ack. Payload: `RoomWatch`. */
|
|
9151
|
-
watch: "room-feed:watch",
|
|
9152
|
-
/** server → client. Payload: `RoomChanged`. */
|
|
9153
|
-
changed: "room-feed:changed"
|
|
9154
|
-
};
|
|
9155
|
-
function zh(e) {
|
|
9156
|
-
if (typeof e != "object" || e === null || Array.isArray(e))
|
|
9157
|
-
return null;
|
|
9158
|
-
const t = e;
|
|
9159
|
-
if ("room" in t) {
|
|
9160
|
-
const { room: r, ...n } = t;
|
|
9161
|
-
return Object.keys(n).length > 0 ? null : typeof r == "string" && r.length > 0 ? { room: r } : null;
|
|
9162
|
-
}
|
|
9163
|
-
if ("list" in t) {
|
|
9164
|
-
const { list: r, ...n } = t;
|
|
9165
|
-
return Object.keys(n).length > 0 ? null : r === !0 ? { list: !0 } : null;
|
|
9166
|
-
}
|
|
9167
|
-
return null;
|
|
9168
|
-
}
|
|
9169
|
-
function Hh(e) {
|
|
9196
|
+
function qh(e) {
|
|
9170
9197
|
const t = /* @__PURE__ */ new Map();
|
|
9171
9198
|
let r = 0, n = null;
|
|
9172
9199
|
const a = () => {
|
|
@@ -9223,16 +9250,16 @@ function Yi() {
|
|
|
9223
9250
|
return new URL(t.startsWith("http") ? t : `${window.location.origin}${t}`).origin;
|
|
9224
9251
|
}
|
|
9225
9252
|
let Xi;
|
|
9226
|
-
function
|
|
9227
|
-
return Xi ??=
|
|
9228
|
-
wire: { channel:
|
|
9253
|
+
function Wh() {
|
|
9254
|
+
return Xi ??= qh({
|
|
9255
|
+
wire: { channel: Ef, parseChanged: Sf },
|
|
9229
9256
|
connect: () => {
|
|
9230
9257
|
const e = Lt(Yi(), { path: Xo, transports: ["websocket", "polling"] });
|
|
9231
9258
|
return x("room-feed", "feed socket opened", { origin: Yi() }), e;
|
|
9232
9259
|
}
|
|
9233
9260
|
}), Xi;
|
|
9234
9261
|
}
|
|
9235
|
-
var
|
|
9262
|
+
var Kh = ["effect", "gradient", "font", "overlay", "message"], G = (e, t, r, n = {}) => ({ id: `${e}.${t}`, slot: e, label: r, ...n }), _e = { hidden: !0 }, La = [
|
|
9236
9263
|
G("effect", "glint", "Glint"),
|
|
9237
9264
|
G("effect", "aura", "Aura"),
|
|
9238
9265
|
G("effect", "hop", "Hop", _e),
|
|
@@ -9316,7 +9343,7 @@ var qh = ["effect", "gradient", "font", "overlay", "message"], G = (e, t, r, n =
|
|
|
9316
9343
|
La.filter(
|
|
9317
9344
|
(e) => e.earn !== void 0 && !e.hidden
|
|
9318
9345
|
);
|
|
9319
|
-
var
|
|
9346
|
+
var Gs = { x: 0, y: 0, r: 0, s: 100, flip: !1, back: !1 }, Gt = {
|
|
9320
9347
|
x: [-60, 60],
|
|
9321
9348
|
y: [-60, 100],
|
|
9322
9349
|
r: [-45, 45],
|
|
@@ -9340,13 +9367,13 @@ function aa(e, t) {
|
|
|
9340
9367
|
bottom: Math.max(...A)
|
|
9341
9368
|
};
|
|
9342
9369
|
}
|
|
9343
|
-
var
|
|
9370
|
+
var Gh = La.filter((e) => !!e.art), Yh = {
|
|
9344
9371
|
left: -25,
|
|
9345
|
-
top: Math.floor(Math.min(...
|
|
9372
|
+
top: Math.floor(Math.min(...Gh.map((e) => aa(e.art, Gs).top))),
|
|
9346
9373
|
right: 125,
|
|
9347
9374
|
bottom: 110
|
|
9348
9375
|
}, Fr = (e, [t, r]) => Math.min(r, Math.max(t, e));
|
|
9349
|
-
function
|
|
9376
|
+
function Xh(e, t) {
|
|
9350
9377
|
const r = (s, l) => typeof s == "number" && Number.isFinite(s) ? s : l, n = {
|
|
9351
9378
|
x: Math.round(Fr(r(t.x, 0), Gt.x)),
|
|
9352
9379
|
y: Math.round(Fr(r(t.y, 0), Gt.y)),
|
|
@@ -9354,7 +9381,7 @@ function Gh(e, t) {
|
|
|
9354
9381
|
s: Math.round(Fr(r(t.s, 100), Gt.s)),
|
|
9355
9382
|
flip: t.flip === !0,
|
|
9356
9383
|
back: t.back === !0
|
|
9357
|
-
}, a =
|
|
9384
|
+
}, a = Yh;
|
|
9358
9385
|
let i = aa(e, n);
|
|
9359
9386
|
const o = Math.min(
|
|
9360
9387
|
(a.right - a.left - 2) / (i.right - i.left),
|
|
@@ -9362,62 +9389,62 @@ function Gh(e, t) {
|
|
|
9362
9389
|
);
|
|
9363
9390
|
return o < 1 && (n.s = Math.max(Gt.s[0], Math.floor(n.s * o)), i = aa(e, n)), n.x += Math.ceil(Math.max(0, a.left - i.left)) - Math.ceil(Math.max(0, i.right - a.right)), n.y += Math.ceil(Math.max(0, a.top - i.top)) - Math.ceil(Math.max(0, i.bottom - a.bottom)), n;
|
|
9364
9391
|
}
|
|
9365
|
-
function
|
|
9392
|
+
function Jh(e) {
|
|
9366
9393
|
if (!e || typeof e != "object") return;
|
|
9367
9394
|
const t = e, r = {};
|
|
9368
|
-
for (const a of
|
|
9395
|
+
for (const a of Kh) {
|
|
9369
9396
|
const i = t[a], o = typeof i == "string" ? na.get(i) : void 0;
|
|
9370
9397
|
o && !o.hidden && o.slot === a && (r[a] = o.id);
|
|
9371
9398
|
}
|
|
9372
9399
|
const n = r.overlay ? na.get(r.overlay)?.art : void 0;
|
|
9373
|
-
return n && t.placement && typeof t.placement == "object" && (r.placement =
|
|
9400
|
+
return n && t.placement && typeof t.placement == "object" && (r.placement = Xh(n, t.placement)), Object.keys(r).length ? r : void 0;
|
|
9374
9401
|
}
|
|
9375
|
-
var
|
|
9376
|
-
function
|
|
9402
|
+
var Qh = 0.3, Zh = 0.82, kt = 24, ep = 32;
|
|
9403
|
+
function tp(e) {
|
|
9377
9404
|
let t = 0, r = 0, n = 0, a = 0;
|
|
9378
9405
|
for (let i = 0; i + 3 < e.length; i += 4) {
|
|
9379
9406
|
const o = e[i + 3];
|
|
9380
|
-
o <
|
|
9407
|
+
o < ep || (t += e[i] * o, r += e[i + 1] * o, n += e[i + 2] * o, a += o);
|
|
9381
9408
|
}
|
|
9382
|
-
return a === 0 ? null :
|
|
9409
|
+
return a === 0 ? null : rp(t / a, r / a, n / a);
|
|
9383
9410
|
}
|
|
9384
|
-
function
|
|
9385
|
-
const [n, a, i] =
|
|
9411
|
+
function rp(e, t, r) {
|
|
9412
|
+
const [n, a, i] = np(e / 255, t / 255, r / 255), o = Math.min(Zh, Math.max(Qh, i)), [s, l, c] = ap(n, a, o), d = (h) => Math.round(h * 255).toString(16).padStart(2, "0");
|
|
9386
9413
|
return `#${d(s)}${d(l)}${d(c)}`;
|
|
9387
9414
|
}
|
|
9388
|
-
function
|
|
9415
|
+
function np(e, t, r) {
|
|
9389
9416
|
const n = Math.max(e, t, r), a = Math.min(e, t, r), i = (n + a) / 2;
|
|
9390
9417
|
if (n === a) return [0, 0, i];
|
|
9391
9418
|
const o = n - a, s = i > 0.5 ? o / (2 - n - a) : o / (n + a);
|
|
9392
9419
|
let l;
|
|
9393
9420
|
return n === e ? l = (t - r) / o + (t < r ? 6 : 0) : n === t ? l = (r - e) / o + 2 : l = (e - t) / o + 4, [l / 6, s, i];
|
|
9394
9421
|
}
|
|
9395
|
-
function
|
|
9422
|
+
function ap(e, t, r) {
|
|
9396
9423
|
if (t === 0) return [r, r, r];
|
|
9397
9424
|
const n = r < 0.5 ? r * (1 + t) : r + t - r * t, a = 2 * r - n, i = (o) => (o < 0 && (o += 1), o > 1 && (o -= 1), o < 1 / 6 ? a + (n - a) * 6 * o : o < 1 / 2 ? n : o < 2 / 3 ? a + (n - a) * (2 / 3 - o) * 6 : a);
|
|
9398
9425
|
return [i(e + 1 / 3), i(e), i(e - 1 / 3)];
|
|
9399
9426
|
}
|
|
9400
9427
|
var Qr = /* @__PURE__ */ new Map(), Un = /* @__PURE__ */ new Map(), ia = /* @__PURE__ */ new Set();
|
|
9401
|
-
function
|
|
9428
|
+
function ip(e) {
|
|
9402
9429
|
return Qr.get(e);
|
|
9403
9430
|
}
|
|
9404
|
-
function
|
|
9431
|
+
function op(e) {
|
|
9405
9432
|
return ia.add(e), () => {
|
|
9406
9433
|
ia.delete(e);
|
|
9407
9434
|
};
|
|
9408
9435
|
}
|
|
9409
|
-
function
|
|
9436
|
+
function sp(e) {
|
|
9410
9437
|
if (Qr.has(e)) return Promise.resolve(Qr.get(e) ?? null);
|
|
9411
9438
|
const t = Un.get(e);
|
|
9412
9439
|
if (t) return t;
|
|
9413
|
-
const r =
|
|
9440
|
+
const r = lp(e).then((n) => {
|
|
9414
9441
|
Un.delete(e), Qr.set(e, n);
|
|
9415
9442
|
for (const a of ia) a();
|
|
9416
9443
|
return n;
|
|
9417
9444
|
});
|
|
9418
9445
|
return Un.set(e, r), r;
|
|
9419
9446
|
}
|
|
9420
|
-
function
|
|
9447
|
+
function lp(e) {
|
|
9421
9448
|
return typeof Image > "u" || typeof document > "u" ? Promise.resolve(null) : new Promise((t) => {
|
|
9422
9449
|
const r = new Image();
|
|
9423
9450
|
r.crossOrigin = "anonymous", r.referrerPolicy = "no-referrer", r.onload = () => {
|
|
@@ -9430,7 +9457,7 @@ function op(e) {
|
|
|
9430
9457
|
}
|
|
9431
9458
|
a.drawImage(r, 0, 0, kt, kt);
|
|
9432
9459
|
try {
|
|
9433
|
-
t(
|
|
9460
|
+
t(tp(a.getImageData(0, 0, kt, kt).data));
|
|
9434
9461
|
} catch (i) {
|
|
9435
9462
|
console.debug("[prefs-client] picture colour unreadable", e, i), t(null);
|
|
9436
9463
|
}
|
|
@@ -9441,13 +9468,13 @@ var Oa = "/cosmetics", Ji = "hadoku-cosmetics", Ie = (e) => e.replace(
|
|
|
9441
9468
|
/[&<>"']/g,
|
|
9442
9469
|
(t) => ({ "&": "&", "<": "<", ">": ">", '"': """, "'": "'" })[t]
|
|
9443
9470
|
), ir = (e) => e ? e.slice(e.indexOf(".") + 1) : "none";
|
|
9444
|
-
function
|
|
9471
|
+
function cp(e) {
|
|
9445
9472
|
const t = e.s / 100 * (e.flip ? -1 : 1);
|
|
9446
9473
|
return `translate(calc(var(--hc-sz) * ${(e.x / 100).toFixed(3)}),calc(var(--hc-sz) * ${(e.y / 100).toFixed(3)})) rotate(${e.r}deg) scale(${t.toFixed(3)},${(e.s / 100).toFixed(3)})`;
|
|
9447
9474
|
}
|
|
9448
|
-
var
|
|
9449
|
-
function
|
|
9450
|
-
const n = ir(t?.effect), a = ir(t?.gradient), i = ir(t?.font), o = Ie(e), s =
|
|
9475
|
+
var up = /* @__PURE__ */ new Set(["hop"]);
|
|
9476
|
+
function Sg(e, t, r = {}) {
|
|
9477
|
+
const n = ir(t?.effect), a = ir(t?.gradient), i = ir(t?.font), o = Ie(e), s = up.has(n), l = s ? `<span class="hc-tx">${[...e].map(
|
|
9451
9478
|
(g, _) => `<span class="hc-ch" style="--hc-i:${_}"><span class="hc-c">${g === " " ? " " : Ie(g)}</span></span>`
|
|
9452
9479
|
).join("")}</span>` : `<span class="hc-tx">${o}</span>`, c = (g) => `<span class="hc-lyr${g}" aria-hidden="true">${o}</span>`;
|
|
9453
9480
|
let d = "", h = "";
|
|
@@ -9459,23 +9486,23 @@ function _g(e, t, r = {}) {
|
|
|
9459
9486
|
([g, _, R]) => `<i class="hc-tw" aria-hidden="true" style="left:${g}%;top:${_}%;animation-delay:${R}s"></i>`
|
|
9460
9487
|
).join("")), `<span class="${`hc-name hc-fx-${n} hc-gr-${a} hc-font-${i}${s ? " hc-split" : ""}${r.large ? " hc-large" : ""}`}">${d}${l}${h}</span>`;
|
|
9461
9488
|
}
|
|
9462
|
-
var
|
|
9489
|
+
var dp = (() => {
|
|
9463
9490
|
let e = "";
|
|
9464
9491
|
for (let t = 0; t < 12; t++)
|
|
9465
9492
|
e += `<g transform="rotate(${t * 30} 50 50)"><path d="M50 3 l2.5 4 -2.5 4 -2.5 -4z" fill="currentColor" opacity="${t % 3 ? 0.55 : 1}"/></g>`;
|
|
9466
9493
|
return `<svg viewBox="0 0 100 100" aria-hidden="true"><circle cx="50" cy="50" r="44" fill="none" stroke="currentColor" stroke-width="1" stroke-dasharray="3 5" opacity=".7"/>${e}</svg>`;
|
|
9467
9494
|
})();
|
|
9468
|
-
function
|
|
9495
|
+
function Rg(e, t = Oa) {
|
|
9469
9496
|
const r = e?.overlay;
|
|
9470
9497
|
if (!r) return "";
|
|
9471
9498
|
const n = na.get(r)?.art;
|
|
9472
9499
|
if (n) {
|
|
9473
|
-
const a = e?.placement ??
|
|
9474
|
-
return `<span class="hc-ol hc-art${n.pixel ? " hc-px" : ""}" data-hc-art="${Ie(r)}" style="left:${50 - n.width / 2}%;top:${n.top}%;width:${n.width}%;z-index:${a.back ? 0 : 3}"><span class="hc-adj" style="transform:${
|
|
9500
|
+
const a = e?.placement ?? Gs;
|
|
9501
|
+
return `<span class="hc-ol hc-art${n.pixel ? " hc-px" : ""}" data-hc-art="${Ie(r)}" style="left:${50 - n.width / 2}%;top:${n.top}%;width:${n.width}%;z-index:${a.back ? 0 : 3}"><span class="hc-adj" style="transform:${cp(a)}"><img alt="" draggable="false" style="--hc-tilt:${n.tilt}deg" src="${Ie(`${t}/art/${n.file}`)}"></span></span>`;
|
|
9475
9502
|
}
|
|
9476
9503
|
switch (ir(r)) {
|
|
9477
9504
|
case "runes":
|
|
9478
|
-
return `<span class="hc-ol hc-runes">${
|
|
9505
|
+
return `<span class="hc-ol hc-runes">${dp}</span>`;
|
|
9479
9506
|
case "comet":
|
|
9480
9507
|
return '<span class="hc-ol hc-comet"></span>';
|
|
9481
9508
|
case "shine":
|
|
@@ -9490,12 +9517,12 @@ function Eg(e, t = Oa) {
|
|
|
9490
9517
|
return "";
|
|
9491
9518
|
}
|
|
9492
9519
|
}
|
|
9493
|
-
var Qi = "!<>-_/[]{}=+*^?#%&01", Zi = /* @__PURE__ */ new Set(["type", "decode", "cascade"]), eo = 1400,
|
|
9494
|
-
function
|
|
9520
|
+
var Qi = "!<>-_/[]{}=+*^?#%&01", Zi = /* @__PURE__ */ new Set(["type", "decode", "cascade"]), eo = 1400, fp = 160;
|
|
9521
|
+
function Tg(e, t, r = {}) {
|
|
9495
9522
|
let n = ir(t?.message);
|
|
9496
9523
|
if (n === "none") return `<span class="hc-msg">${Ie(e)}</span>`;
|
|
9497
9524
|
const a = e.split(/\s+/).filter(Boolean);
|
|
9498
|
-
Zi.has(n) && e.length >
|
|
9525
|
+
Zi.has(n) && e.length > fp && (n = "words");
|
|
9499
9526
|
const i = r.keep ? " data-hc-keep" : "";
|
|
9500
9527
|
let o, s;
|
|
9501
9528
|
if (Zi.has(n)) {
|
|
@@ -9516,7 +9543,7 @@ function Sg(e, t, r = {}) {
|
|
|
9516
9543
|
).join(" ");
|
|
9517
9544
|
return `<span class="hc-msg hc-mt-${n}" style="--hc-step:${s.toFixed(1)}ms" data-text="${Ie(e)}"${i}><span class="hc-sr">${Ie(e)}</span><span aria-hidden="true">${o}</span></span>`;
|
|
9518
9545
|
}
|
|
9519
|
-
function
|
|
9546
|
+
function hp(e) {
|
|
9520
9547
|
const t = e.target;
|
|
9521
9548
|
if (e.pseudoElement || !t?.hasAttribute?.("data-hc-last")) return;
|
|
9522
9549
|
const r = t.closest(".hc-msg");
|
|
@@ -9586,7 +9613,7 @@ var to = {
|
|
|
9586
9613
|
css: "font-weight:400;font-size:.62em;line-height:1.6"
|
|
9587
9614
|
}
|
|
9588
9615
|
};
|
|
9589
|
-
function
|
|
9616
|
+
function pp(e = Oa) {
|
|
9590
9617
|
const t = Object.entries(to).map(
|
|
9591
9618
|
([n, a]) => `@font-face{font-family:"hc-${n}";src:url("${e}/fonts/${a.file}.woff2") format("woff2");font-display:swap}`
|
|
9592
9619
|
).join(`
|
|
@@ -9681,20 +9708,20 @@ ${r}
|
|
|
9681
9708
|
@media (prefers-reduced-motion:reduce){.hc-name *,.hc-av *,.hc-av *::after,.hc-msg *,.hc-msg *::before,.hc-msg *::after{animation:none!important}}
|
|
9682
9709
|
`;
|
|
9683
9710
|
}
|
|
9684
|
-
function
|
|
9711
|
+
function xg(e = document, t = Oa) {
|
|
9685
9712
|
if (e.getElementById(Ji)) return;
|
|
9686
9713
|
const r = e.createElement("style");
|
|
9687
|
-
r.id = Ji, r.textContent =
|
|
9714
|
+
r.id = Ji, r.textContent = pp(t), e.head.appendChild(r), e.addEventListener("animationend", hp);
|
|
9688
9715
|
}
|
|
9689
|
-
function
|
|
9690
|
-
return (t ?
|
|
9716
|
+
function mp(e, t) {
|
|
9717
|
+
return (t ? ip(t) : null) ?? Es(e);
|
|
9691
9718
|
}
|
|
9692
|
-
function
|
|
9719
|
+
function gp(e, t) {
|
|
9693
9720
|
return nt(() => {
|
|
9694
|
-
t &&
|
|
9695
|
-
}, [t]), ln(
|
|
9721
|
+
t && sp(t);
|
|
9722
|
+
}, [t]), ln(op, () => mp(e, t), () => Es(e));
|
|
9696
9723
|
}
|
|
9697
|
-
function
|
|
9724
|
+
function yp({ sprite: e, url: t, alt: r = "", className: n, style: a, fallback: i }) {
|
|
9698
9725
|
const [o, s] = go(null);
|
|
9699
9726
|
if (t && t !== o)
|
|
9700
9727
|
return /* @__PURE__ */ N(
|
|
@@ -9712,36 +9739,36 @@ function mp({ sprite: e, url: t, alt: r = "", className: n, style: a, fallback:
|
|
|
9712
9739
|
const l = Ss(e);
|
|
9713
9740
|
return l ? /* @__PURE__ */ N("img", { src: l, alt: r, crossOrigin: "anonymous", className: n, style: a, draggable: !1 }) : /* @__PURE__ */ N(mo, { children: i });
|
|
9714
9741
|
}
|
|
9715
|
-
const
|
|
9716
|
-
function
|
|
9742
|
+
const vp = "hadoku://library";
|
|
9743
|
+
function bp(e = typeof navigator < "u" ? navigator.userAgent : void 0) {
|
|
9717
9744
|
return e !== void 0 && /(^|\s)HadokuApp\/\S/.test(e);
|
|
9718
9745
|
}
|
|
9719
|
-
function
|
|
9746
|
+
function wp(e) {
|
|
9720
9747
|
return e.slice().sort(
|
|
9721
9748
|
(t, r) => (r.users?.length ?? 0) - (t.users?.length ?? 0) || t.room_id.localeCompare(r.room_id)
|
|
9722
9749
|
);
|
|
9723
9750
|
}
|
|
9724
|
-
async function
|
|
9751
|
+
async function Ys(e, t = 1) {
|
|
9725
9752
|
const r = hn(), n = Date.now();
|
|
9726
9753
|
x("home", "rooms-fetch: start", { attempt: t });
|
|
9727
9754
|
try {
|
|
9728
9755
|
const a = await fetch(`${r}/api/rooms${ws() ? "?debug=1" : ""}`, { cache: "no-store", signal: e });
|
|
9729
9756
|
if (!a.ok) throw new Error(`HTTP ${a.status}`);
|
|
9730
9757
|
const i = await a.json();
|
|
9731
|
-
return x("home", "rooms-fetch: success", { attempt: t, elapsedMs: Date.now() - n, roomCount: (i.rooms ?? []).length }),
|
|
9758
|
+
return x("home", "rooms-fetch: success", { attempt: t, elapsedMs: Date.now() - n, roomCount: (i.rooms ?? []).length }), wp(i.rooms || []);
|
|
9732
9759
|
} catch (a) {
|
|
9733
9760
|
if (a instanceof Error && a.name === "AbortError") throw a;
|
|
9734
9761
|
const i = a instanceof Error ? a.message : void 0;
|
|
9735
9762
|
if (t === 1)
|
|
9736
|
-
return ne("home", "rooms-fetch: error, retrying once", { elapsedMs: Date.now() - n, error: i }), await new Promise((o) => setTimeout(o, 500)),
|
|
9763
|
+
return ne("home", "rooms-fetch: error, retrying once", { elapsedMs: Date.now() - n, error: i }), await new Promise((o) => setTimeout(o, 500)), Ys(e, 2);
|
|
9737
9764
|
throw at("app", "Failed to load rooms list", { elapsedMs: Date.now() - n, error: i }), a;
|
|
9738
9765
|
}
|
|
9739
9766
|
}
|
|
9740
|
-
function
|
|
9767
|
+
function _p(e) {
|
|
9741
9768
|
return e.room_id.split("-").map((t) => t.charAt(0).toUpperCase() + t.slice(1)).join(" ");
|
|
9742
9769
|
}
|
|
9743
|
-
function
|
|
9744
|
-
const t =
|
|
9770
|
+
function Ep({ user: e }) {
|
|
9771
|
+
const t = gp(e.sprite_id, e.avatar_url);
|
|
9745
9772
|
return /* @__PURE__ */ $e("span", { className: "relative -ml-2 first:ml-0 group/av", children: [
|
|
9746
9773
|
/* @__PURE__ */ N(
|
|
9747
9774
|
"span",
|
|
@@ -9749,7 +9776,7 @@ function wp({ user: e }) {
|
|
|
9749
9776
|
className: "block h-10 w-10 rounded-full border-2 overflow-hidden bg-bg-card transition-transform duration-150 group-hover/av:scale-110 group-hover/av:z-10 shadow-md",
|
|
9750
9777
|
style: { borderColor: t },
|
|
9751
9778
|
children: /* @__PURE__ */ N(
|
|
9752
|
-
|
|
9779
|
+
yp,
|
|
9753
9780
|
{
|
|
9754
9781
|
sprite: e.sprite_id,
|
|
9755
9782
|
url: e.avatar_url,
|
|
@@ -9770,7 +9797,7 @@ function wp({ user: e }) {
|
|
|
9770
9797
|
)
|
|
9771
9798
|
] });
|
|
9772
9799
|
}
|
|
9773
|
-
function
|
|
9800
|
+
function Sp({ room: e }) {
|
|
9774
9801
|
const t = e.users ?? [], r = t.length;
|
|
9775
9802
|
return /* @__PURE__ */ $e("li", { className: "flex items-stretch gap-2", children: [
|
|
9776
9803
|
/* @__PURE__ */ N(
|
|
@@ -9779,8 +9806,8 @@ function _p({ room: e }) {
|
|
|
9779
9806
|
to: `/room/${encodeURIComponent(e.viewer_key)}`,
|
|
9780
9807
|
className: "flex-1 block no-underline rounded-lg border border-border bg-bg-card/40 backdrop-blur-sm px-5 py-4 transition-all duration-150 hover:border-border-light hover:-translate-y-px hover:bg-bg-card/55 focus:outline-none focus-visible:border-primary focus-visible:ring-2 focus-visible:ring-primary/40",
|
|
9781
9808
|
children: /* @__PURE__ */ $e("div", { className: "flex items-center justify-between gap-4", children: [
|
|
9782
|
-
/* @__PURE__ */ N("div", { className: "text-xl font-medium tracking-wide text-text no-underline", children:
|
|
9783
|
-
r > 0 && /* @__PURE__ */ N("div", { className: "flex shrink-0", children: t.map((n, a) => /* @__PURE__ */ N(
|
|
9809
|
+
/* @__PURE__ */ N("div", { className: "text-xl font-medium tracking-wide text-text no-underline", children: _p(e) }),
|
|
9810
|
+
r > 0 && /* @__PURE__ */ N("div", { className: "flex shrink-0", children: t.map((n, a) => /* @__PURE__ */ N(Ep, { user: n }, `${n.name}-${a}`)) })
|
|
9784
9811
|
] })
|
|
9785
9812
|
}
|
|
9786
9813
|
),
|
|
@@ -9795,11 +9822,11 @@ function _p({ room: e }) {
|
|
|
9795
9822
|
)
|
|
9796
9823
|
] });
|
|
9797
9824
|
}
|
|
9798
|
-
function
|
|
9799
|
-
const e =
|
|
9800
|
-
pings:
|
|
9801
|
-
fetchList: (h) =>
|
|
9802
|
-
}), i =
|
|
9825
|
+
function Rp() {
|
|
9826
|
+
const e = ef(), { list: t, loading: r, error: n, refresh: a } = Xf("list", {
|
|
9827
|
+
pings: Wh(),
|
|
9828
|
+
fetchList: (h) => Ys(h)
|
|
9829
|
+
}), i = gl(() => t ?? [], [t]), o = t === null ? n : null, s = xs(), l = _t(null);
|
|
9803
9830
|
nt(() => {
|
|
9804
9831
|
if (!s || r) return;
|
|
9805
9832
|
const h = document.activeElement;
|
|
@@ -9809,7 +9836,7 @@ function Ep() {
|
|
|
9809
9836
|
return nt(() => {
|
|
9810
9837
|
c.current !== e.serverOrigin && (c.current = e.serverOrigin, a());
|
|
9811
9838
|
}, [e.serverOrigin, a]), /* @__PURE__ */ $e("div", { className: "wp-lobby relative h-full w-full flex flex-col items-center justify-start gap-12 py-24", children: [
|
|
9812
|
-
/* @__PURE__ */ N(
|
|
9839
|
+
/* @__PURE__ */ N(Os, {}),
|
|
9813
9840
|
/* @__PURE__ */ N("h1", { className: "text-5xl font-bold tracking-[0.08em] text-text z-10", children: "Watch Party" }),
|
|
9814
9841
|
/* @__PURE__ */ $e("div", { className: "w-full max-w-md z-10", children: [
|
|
9815
9842
|
/* @__PURE__ */ N("h2", { className: "text-xs uppercase tracking-[0.2em] text-text-muted/70 mb-3 px-1", children: "Rooms" }),
|
|
@@ -9826,15 +9853,15 @@ function Ep() {
|
|
|
9826
9853
|
children: "Retry"
|
|
9827
9854
|
}
|
|
9828
9855
|
)
|
|
9829
|
-
] }) : i.length === 0 ? /* @__PURE__ */ N("div", { className: "text-text-secondary text-sm px-1 py-3", children: "No rooms available." }) : /* @__PURE__ */ N(mo, { children: /* @__PURE__ */ N("ul", { ref: l, className: "list-none p-0 m-0 space-y-2", children: i.map((h) => /* @__PURE__ */ N(
|
|
9856
|
+
] }) : i.length === 0 ? /* @__PURE__ */ N("div", { className: "text-text-secondary text-sm px-1 py-3", children: "No rooms available." }) : /* @__PURE__ */ N(mo, { children: /* @__PURE__ */ N("ul", { ref: l, className: "list-none p-0 m-0 space-y-2", children: i.map((h) => /* @__PURE__ */ N(Sp, { room: h }, h.viewer_key)) }) })
|
|
9830
9857
|
] }),
|
|
9831
|
-
|
|
9832
|
-
|
|
9858
|
+
Pf() && /* @__PURE__ */ N("div", { className: "w-full max-w-md z-10", children: /* @__PURE__ */ N(Qd, { className: "block no-underline rounded-lg border border-border bg-bg-card/40 backdrop-blur-sm px-5 py-4 text-xl font-medium tracking-wide text-text transition-all duration-150 hover:border-border-light hover:-translate-y-px hover:bg-bg-card/55 focus:outline-none focus-visible:border-primary focus-visible:ring-2 focus-visible:ring-primary/40" }) }),
|
|
9859
|
+
bp() && /* @__PURE__ */ $e("div", { className: "w-full max-w-md z-10", children: [
|
|
9833
9860
|
/* @__PURE__ */ N("h2", { className: "text-xs uppercase tracking-[0.2em] text-text-muted/70 mb-3 px-1", children: "On this phone" }),
|
|
9834
9861
|
/* @__PURE__ */ $e(
|
|
9835
9862
|
"a",
|
|
9836
9863
|
{
|
|
9837
|
-
href:
|
|
9864
|
+
href: vp,
|
|
9838
9865
|
className: "block no-underline rounded-lg border border-border bg-bg-card/40 backdrop-blur-sm px-5 py-4 transition-all duration-150 hover:border-border-light hover:-translate-y-px hover:bg-bg-card/55 focus:outline-none focus-visible:border-primary focus-visible:ring-2 focus-visible:ring-primary/40",
|
|
9839
9866
|
children: [
|
|
9840
9867
|
/* @__PURE__ */ N("div", { className: "text-xl font-medium tracking-wide text-text", children: "Library" }),
|
|
@@ -9845,18 +9872,18 @@ function Ep() {
|
|
|
9845
9872
|
] })
|
|
9846
9873
|
] });
|
|
9847
9874
|
}
|
|
9848
|
-
function
|
|
9875
|
+
function Tp() {
|
|
9849
9876
|
return /* @__PURE__ */ $e("div", { className: "fixed inset-0 bg-black", children: [
|
|
9850
|
-
/* @__PURE__ */ N(
|
|
9877
|
+
/* @__PURE__ */ N(Os, {}),
|
|
9851
9878
|
/* @__PURE__ */ N("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ N("div", { className: "text-center", children: /* @__PURE__ */ N("h1", { className: "text-4xl font-bold text-white mb-4", children: "API is sleeping..." }) }) })
|
|
9852
9879
|
] });
|
|
9853
9880
|
}
|
|
9854
|
-
const
|
|
9855
|
-
function
|
|
9856
|
-
return !(!e || !e.baseUrl || e.baseUrl.endsWith("/") || !
|
|
9881
|
+
const xp = "watchparty_fragment_delivery", Cp = /^[0-9a-f]{64}$/, kp = /^[A-Za-z0-9_.-]+$/;
|
|
9882
|
+
function Ap(e) {
|
|
9883
|
+
return !(!e || !e.baseUrl || e.baseUrl.endsWith("/") || !Cp.test(e.token) || e.trackId !== void 0 && !kp.test(e.trackId));
|
|
9857
9884
|
}
|
|
9858
|
-
function
|
|
9859
|
-
if (!
|
|
9885
|
+
function Cg(e, t) {
|
|
9886
|
+
if (!Ap(e)) return null;
|
|
9860
9887
|
let r;
|
|
9861
9888
|
if (t === "init")
|
|
9862
9889
|
r = "init";
|
|
@@ -9867,7 +9894,7 @@ function Tg(e, t) {
|
|
|
9867
9894
|
const n = e.trackId ? `audio/${e.trackId}/` : "";
|
|
9868
9895
|
return `${e.baseUrl}/v/${e.token}/${n}${r}`;
|
|
9869
9896
|
}
|
|
9870
|
-
function
|
|
9897
|
+
function Pp() {
|
|
9871
9898
|
if (typeof window > "u") return null;
|
|
9872
9899
|
try {
|
|
9873
9900
|
const e = new URLSearchParams(window.location.search).get("fragmentDelivery");
|
|
@@ -9875,27 +9902,27 @@ function kp() {
|
|
|
9875
9902
|
if (e === "0" || e === "false") return !1;
|
|
9876
9903
|
} catch {
|
|
9877
9904
|
}
|
|
9878
|
-
return
|
|
9905
|
+
return rf(xp);
|
|
9879
9906
|
}
|
|
9880
|
-
let Da = { ...rs }, Zr = null,
|
|
9907
|
+
let Da = { ...rs }, Zr = null, Xs = !1;
|
|
9881
9908
|
const ro = "watchparty_delivery_client_id";
|
|
9882
|
-
function
|
|
9909
|
+
function Mp() {
|
|
9883
9910
|
const e = je(ro);
|
|
9884
9911
|
if (e) return e;
|
|
9885
9912
|
const t = globalThis.crypto?.randomUUID?.() ?? `d${Math.random().toString(36).slice(2)}`;
|
|
9886
9913
|
return Ta(ro, t) ? t : "";
|
|
9887
9914
|
}
|
|
9888
|
-
function
|
|
9889
|
-
Da = ns(e),
|
|
9915
|
+
function Ip(e) {
|
|
9916
|
+
Da = ns(e), Xs || (Zr = null);
|
|
9890
9917
|
}
|
|
9891
|
-
function
|
|
9918
|
+
function Lp() {
|
|
9892
9919
|
return { ...Da };
|
|
9893
9920
|
}
|
|
9894
|
-
function
|
|
9895
|
-
return Zr === null && (Zr =
|
|
9921
|
+
function Js() {
|
|
9922
|
+
return Zr === null && (Zr = Sd(Da, Mp(), Pp())), Zr;
|
|
9896
9923
|
}
|
|
9897
9924
|
let no = !1;
|
|
9898
|
-
async function
|
|
9925
|
+
async function Op(e) {
|
|
9899
9926
|
if (!no) {
|
|
9900
9927
|
no = !0;
|
|
9901
9928
|
for (let t = 0; t < 2; t++) {
|
|
@@ -9903,7 +9930,7 @@ async function Ip(e) {
|
|
|
9903
9930
|
const r = await fetch(`${e}/api/flags`, { cache: "no-store" });
|
|
9904
9931
|
if (r.ok) {
|
|
9905
9932
|
const n = await r.json();
|
|
9906
|
-
|
|
9933
|
+
Ip(n?.fragment_delivery), x("app", "Delivery flag loaded", { ...Lp(), attempt: t });
|
|
9907
9934
|
return;
|
|
9908
9935
|
}
|
|
9909
9936
|
} catch {
|
|
@@ -9913,28 +9940,28 @@ async function Ip(e) {
|
|
|
9913
9940
|
ne("app", "Delivery flag fetch failed; staying on the default delivery path");
|
|
9914
9941
|
}
|
|
9915
9942
|
}
|
|
9916
|
-
function
|
|
9917
|
-
return
|
|
9943
|
+
function Dp() {
|
|
9944
|
+
return Js();
|
|
9918
9945
|
}
|
|
9919
|
-
function
|
|
9920
|
-
const e =
|
|
9921
|
-
return
|
|
9946
|
+
function kg() {
|
|
9947
|
+
const e = Js();
|
|
9948
|
+
return Xs = !0, e === "fragment";
|
|
9922
9949
|
}
|
|
9923
|
-
let Na =
|
|
9950
|
+
let Na = Ld;
|
|
9924
9951
|
const oa = /* @__PURE__ */ new Set();
|
|
9925
|
-
function
|
|
9952
|
+
function Np(e) {
|
|
9926
9953
|
Na = e;
|
|
9927
9954
|
for (const t of oa) t();
|
|
9928
9955
|
}
|
|
9929
|
-
function
|
|
9930
|
-
const t =
|
|
9956
|
+
function $p(e) {
|
|
9957
|
+
const t = Id.safeParse(e?.games);
|
|
9931
9958
|
if (!t.success)
|
|
9932
9959
|
return ne("game", "Game catalog rejected; keeping the current list", { issues: t.error.issues.length }), !1;
|
|
9933
9960
|
const r = t.data;
|
|
9934
|
-
return
|
|
9961
|
+
return Np(r), !0;
|
|
9935
9962
|
}
|
|
9936
9963
|
let ao = !1;
|
|
9937
|
-
async function
|
|
9964
|
+
async function Fp(e) {
|
|
9938
9965
|
if (!ao) {
|
|
9939
9966
|
ao = !0;
|
|
9940
9967
|
try {
|
|
@@ -9943,24 +9970,24 @@ async function Np(e) {
|
|
|
9943
9970
|
ne("game", "Game catalog fetch failed; using the default list", { status: t.status });
|
|
9944
9971
|
return;
|
|
9945
9972
|
}
|
|
9946
|
-
|
|
9973
|
+
$p(await t.json()) && x("game", "Game catalog loaded", { games: Na.map((r) => r.id) });
|
|
9947
9974
|
} catch (t) {
|
|
9948
9975
|
ne("game", "Game catalog fetch failed; using the default list", Ue(t));
|
|
9949
9976
|
}
|
|
9950
9977
|
}
|
|
9951
9978
|
}
|
|
9952
|
-
function
|
|
9979
|
+
function Up() {
|
|
9953
9980
|
return Na;
|
|
9954
9981
|
}
|
|
9955
|
-
function
|
|
9982
|
+
function Bp(e) {
|
|
9956
9983
|
return oa.add(e), () => {
|
|
9957
9984
|
oa.delete(e);
|
|
9958
9985
|
};
|
|
9959
9986
|
}
|
|
9960
|
-
function
|
|
9961
|
-
return ln(
|
|
9987
|
+
function Ag() {
|
|
9988
|
+
return ln(Bp, Up);
|
|
9962
9989
|
}
|
|
9963
|
-
function
|
|
9990
|
+
function jp(e) {
|
|
9964
9991
|
return ut.lazy(async () => {
|
|
9965
9992
|
try {
|
|
9966
9993
|
return await e();
|
|
@@ -9974,36 +10001,36 @@ function Up(e) {
|
|
|
9974
10001
|
}
|
|
9975
10002
|
});
|
|
9976
10003
|
}
|
|
9977
|
-
const
|
|
9978
|
-
function
|
|
9979
|
-
return e ?
|
|
10004
|
+
const zp = ["demo-room"];
|
|
10005
|
+
function Hp(e) {
|
|
10006
|
+
return e ? zp.some((t) => e === t || e.startsWith(t + "-")) : !1;
|
|
9980
10007
|
}
|
|
9981
|
-
function
|
|
10008
|
+
function Vp(e) {
|
|
9982
10009
|
if (!(e.hostname === "hadoku.me")) return null;
|
|
9983
10010
|
if (e.requireAuth) {
|
|
9984
10011
|
if (Oi() !== "public") return null;
|
|
9985
10012
|
const n = e.pathname + (e.search || "");
|
|
9986
10013
|
return `/auth?return=${encodeURIComponent(n)}`;
|
|
9987
10014
|
}
|
|
9988
|
-
if (!e.roomKey ||
|
|
10015
|
+
if (!e.roomKey || Hp(e.roomKey) || Oi() !== "public") return null;
|
|
9989
10016
|
const r = e.pathname + (e.search || "");
|
|
9990
10017
|
return `/auth?return=${encodeURIComponent(r)}`;
|
|
9991
10018
|
}
|
|
9992
|
-
const io =
|
|
10019
|
+
const io = jp(() => import("./Room-DYGrZm4g.js").then((e) => e.R));
|
|
9993
10020
|
function oo() {
|
|
9994
10021
|
return /* @__PURE__ */ N("div", { className: "flex-1 flex items-center justify-center bg-black", children: /* @__PURE__ */ N("div", { className: "text-text-secondary text-sm", children: "Loading room..." }) });
|
|
9995
10022
|
}
|
|
9996
|
-
function
|
|
9997
|
-
const e = pt(), t =
|
|
10023
|
+
function qp() {
|
|
10024
|
+
const e = pt(), t = qc(), r = Vp({
|
|
9998
10025
|
roomKey: t.roomKey,
|
|
9999
10026
|
hostname: window.location.hostname,
|
|
10000
10027
|
pathname: window.location.pathname,
|
|
10001
10028
|
search: window.location.search
|
|
10002
10029
|
});
|
|
10003
|
-
return r ? (window.location.replace(r), null) : t.roomKey ? /* @__PURE__ */ N(ut.Suspense, { fallback: /* @__PURE__ */ N(oo, {}), children: /* @__PURE__ */ N(io, {}) }) : e.pathname === "/" || e.pathname === "" ? /* @__PURE__ */ N(
|
|
10030
|
+
return r ? (window.location.replace(r), null) : t.roomKey ? /* @__PURE__ */ N(ut.Suspense, { fallback: /* @__PURE__ */ N(oo, {}), children: /* @__PURE__ */ N(io, {}) }) : e.pathname === "/" || e.pathname === "" ? /* @__PURE__ */ N(Rp, {}) : e.pathname.startsWith("/room") ? /* @__PURE__ */ N(ut.Suspense, { fallback: /* @__PURE__ */ N(oo, {}), children: /* @__PURE__ */ N(io, {}) }) : /* @__PURE__ */ N("div", { className: "p-6", children: "Not Found" });
|
|
10004
10031
|
}
|
|
10005
10032
|
function Bn(e) {
|
|
10006
|
-
const [t, r] = go(!1), n =
|
|
10033
|
+
const [t, r] = go(!1), n = xs(), a = {
|
|
10007
10034
|
serverOrigin: e.serverOrigin || rr.serverOrigin,
|
|
10008
10035
|
defaultRoomKey: e.defaultRoomKey || rr.defaultRoomKey,
|
|
10009
10036
|
cdnBase: e.cdnBase || rr.cdnBase
|
|
@@ -10019,7 +10046,7 @@ function Bn(e) {
|
|
|
10019
10046
|
signal: o.signal
|
|
10020
10047
|
});
|
|
10021
10048
|
if (o.signal.aborted) return;
|
|
10022
|
-
c.ok ? (x("app", "API health check passed"),
|
|
10049
|
+
c.ok ? (x("app", "API health check passed"), Op(i), Fp(i)) : (at("app", "API health check failed", { status: c.status }), r(!0));
|
|
10023
10050
|
} catch (c) {
|
|
10024
10051
|
if (c?.name === "AbortError") return;
|
|
10025
10052
|
at("app", "API unreachable", { url: l, error: c }), r(!0);
|
|
@@ -10057,47 +10084,47 @@ function Bn(e) {
|
|
|
10057
10084
|
"requestIdleCallback" in window ? window.requestIdleCallback(o, { timeout: 2e3 }) : setTimeout(o, 600);
|
|
10058
10085
|
}
|
|
10059
10086
|
document.readyState === "complete" ? s() : window.addEventListener("load", s, { once: !0 });
|
|
10060
|
-
}, []), t ? /* @__PURE__ */ N(
|
|
10087
|
+
}, []), t ? /* @__PURE__ */ N(Tp, {}) : (
|
|
10061
10088
|
// HadokuThemeRoot must sit above everything that reads the theme —
|
|
10062
10089
|
// <HadokuThemePicker> in ChatPanel throws without it, by design, so a
|
|
10063
10090
|
// missing provider is a mount-time error rather than a silently wrong
|
|
10064
10091
|
// theme. It also applies data-theme, which this app previously did through
|
|
10065
10092
|
// its own useTheme() call.
|
|
10066
|
-
/* @__PURE__ */ N(
|
|
10067
|
-
/* @__PURE__ */ N("main", { className: "flex-1 w-full overflow-hidden min-h-0 flex flex-col", children: /* @__PURE__ */ N(
|
|
10068
|
-
/* @__PURE__ */ N(
|
|
10093
|
+
/* @__PURE__ */ N(bl, { children: /* @__PURE__ */ N(hs.Provider, { value: a, children: /* @__PURE__ */ $e("div", { className: "h-screen flex flex-col bg-bg", "data-tv": n ? "" : void 0, children: [
|
|
10094
|
+
/* @__PURE__ */ N("main", { className: "flex-1 w-full overflow-hidden min-h-0 flex flex-col", children: /* @__PURE__ */ N(qp, {}) }),
|
|
10095
|
+
/* @__PURE__ */ N(zf, {})
|
|
10069
10096
|
] }) }) })
|
|
10070
10097
|
);
|
|
10071
10098
|
}
|
|
10072
|
-
function
|
|
10099
|
+
function Wp({ basename: e = "/watchparty", appProps: t } = {}) {
|
|
10073
10100
|
const r = t ?? {}, n = [
|
|
10074
10101
|
{ path: "/", element: /* @__PURE__ */ N(Bn, { ...r }) },
|
|
10075
10102
|
{ path: "/room/:roomKey", element: /* @__PURE__ */ N(Bn, { ...r }) },
|
|
10076
10103
|
{ path: "/:roomKey", element: /* @__PURE__ */ N(Bn, { ...r }) }
|
|
10077
10104
|
];
|
|
10078
|
-
return
|
|
10105
|
+
return $u(n, { basename: e });
|
|
10079
10106
|
}
|
|
10080
10107
|
let en;
|
|
10081
|
-
function
|
|
10082
|
-
return je(
|
|
10108
|
+
function Qs() {
|
|
10109
|
+
return je(Rl) || void 0;
|
|
10083
10110
|
}
|
|
10084
|
-
function
|
|
10111
|
+
function Kp() {
|
|
10085
10112
|
if (en) return;
|
|
10086
|
-
const e =
|
|
10113
|
+
const e = Qs();
|
|
10087
10114
|
if (e) {
|
|
10088
10115
|
en = e;
|
|
10089
10116
|
return;
|
|
10090
10117
|
}
|
|
10091
|
-
|
|
10118
|
+
Sl().then((t) => {
|
|
10092
10119
|
t && (en = t);
|
|
10093
10120
|
}).catch(() => {
|
|
10094
10121
|
x("identity", "device id unavailable — joining without one");
|
|
10095
10122
|
});
|
|
10096
10123
|
}
|
|
10097
|
-
function
|
|
10098
|
-
return en ??=
|
|
10124
|
+
function Gp() {
|
|
10125
|
+
return en ??= Qs();
|
|
10099
10126
|
}
|
|
10100
|
-
function
|
|
10127
|
+
function Yp(e) {
|
|
10101
10128
|
const t = typeof window < "u" ? window.location.href : "http://localhost/", r = new URL(e, t).pathname;
|
|
10102
10129
|
return `${r.endsWith("/") ? r : `${r}/`}socket.io/`;
|
|
10103
10130
|
}
|
|
@@ -10116,10 +10143,10 @@ function so(e, t) {
|
|
|
10116
10143
|
images: Array.isArray(e.images) ? e.images.filter((r) => !!r && Yo(r.key)).slice(0, va) : void 0,
|
|
10117
10144
|
isSystem: e.isSystem || !1,
|
|
10118
10145
|
systemType: e.systemType,
|
|
10119
|
-
template: e.isSystem && typeof e.template == "string" && e.template.includes(
|
|
10146
|
+
template: e.isSystem && typeof e.template == "string" && e.template.includes(id) ? e.template : void 0
|
|
10120
10147
|
};
|
|
10121
10148
|
}
|
|
10122
|
-
function
|
|
10149
|
+
function Xp(e, t = () => !0) {
|
|
10123
10150
|
e.on(re.CHAT_BROADCAST, (r) => {
|
|
10124
10151
|
if (!t()) return;
|
|
10125
10152
|
const n = { ...so(r, r.server_seq), live: !0 };
|
|
@@ -10130,31 +10157,31 @@ function Gp(e, t = () => !0) {
|
|
|
10130
10157
|
U.getState().setChat(n), x("chat", "History loaded", { count: n.length });
|
|
10131
10158
|
});
|
|
10132
10159
|
}
|
|
10133
|
-
let
|
|
10134
|
-
function
|
|
10160
|
+
let Jp = null;
|
|
10161
|
+
function Qp(e = Jp) {
|
|
10135
10162
|
if (!e) return null;
|
|
10136
10163
|
const t = typeof window < "u" ? window.location.href : "http://localhost/", r = e.namespace ?? "/room";
|
|
10137
10164
|
return {
|
|
10138
10165
|
url: `${new URL(e.origin, t).origin}${r.startsWith("/") ? r : `/${r}`}`,
|
|
10139
|
-
path: e.path ??
|
|
10166
|
+
path: e.path ?? Yp(e.origin)
|
|
10140
10167
|
};
|
|
10141
10168
|
}
|
|
10142
|
-
function
|
|
10169
|
+
function Pg(e) {
|
|
10143
10170
|
const r = `${hn()}/media/${e}`.replace(/\\/g, "/");
|
|
10144
|
-
return { mediaUrl: `${r}/${
|
|
10171
|
+
return { mediaUrl: `${r}/${bd}`, indexUrl: `${r}/index.json` };
|
|
10145
10172
|
}
|
|
10146
|
-
function
|
|
10173
|
+
function Zp(e) {
|
|
10147
10174
|
return `${hn()}/media/${e}`.replace(/\\/g, "/");
|
|
10148
10175
|
}
|
|
10149
|
-
function
|
|
10150
|
-
return
|
|
10176
|
+
function em(e, t) {
|
|
10177
|
+
return Zp(t ?? `${e}/poster.jpg`);
|
|
10151
10178
|
}
|
|
10152
|
-
function
|
|
10179
|
+
function Zs(e) {
|
|
10153
10180
|
return `${hn()}${e}`.replace(/\\/g, "/");
|
|
10154
10181
|
}
|
|
10155
|
-
async function
|
|
10182
|
+
async function tm(e) {
|
|
10156
10183
|
try {
|
|
10157
|
-
const t = await fetch(
|
|
10184
|
+
const t = await fetch(Zs("/api/tierlist"));
|
|
10158
10185
|
if (!t.ok)
|
|
10159
10186
|
return ne("tierlist", "Board fetch failed", { status: t.status }), null;
|
|
10160
10187
|
const r = await t.json();
|
|
@@ -10168,22 +10195,22 @@ async function Zp(e) {
|
|
|
10168
10195
|
}
|
|
10169
10196
|
}
|
|
10170
10197
|
let lo = !1;
|
|
10171
|
-
function
|
|
10198
|
+
function Mg() {
|
|
10172
10199
|
if (lo || typeof Image > "u") return;
|
|
10173
10200
|
const e = U.getState().tierlist;
|
|
10174
10201
|
if (!(!e || e.items.length === 0)) {
|
|
10175
10202
|
lo = !0;
|
|
10176
10203
|
for (const t of e.items) {
|
|
10177
10204
|
const r = new Image();
|
|
10178
|
-
r.decoding = "async", r.src =
|
|
10205
|
+
r.decoding = "async", r.src = em(t.id, t.thumbnail);
|
|
10179
10206
|
}
|
|
10180
10207
|
x("tierlist", "Warming posters", { count: e.items.length });
|
|
10181
10208
|
}
|
|
10182
10209
|
}
|
|
10183
|
-
async function
|
|
10210
|
+
async function Ig(e) {
|
|
10184
10211
|
U.getState().setTierlistSaving(!0);
|
|
10185
10212
|
try {
|
|
10186
|
-
const r = await fetch(
|
|
10213
|
+
const r = await fetch(Zs("/api/tierlist/me"), {
|
|
10187
10214
|
method: "PUT",
|
|
10188
10215
|
headers: { "Content-Type": "application/json" },
|
|
10189
10216
|
body: JSON.stringify({ board: e })
|
|
@@ -10198,18 +10225,18 @@ async function Pg(e) {
|
|
|
10198
10225
|
U.getState().setTierlistSaving(!1);
|
|
10199
10226
|
}
|
|
10200
10227
|
}
|
|
10201
|
-
function
|
|
10202
|
-
const e = U.getState(), t =
|
|
10203
|
-
if (!
|
|
10228
|
+
function rm() {
|
|
10229
|
+
const e = U.getState(), t = Rs(Object.values(e.roster).map((a) => a.sprite), void 0, Nt);
|
|
10230
|
+
if (!t)
|
|
10204
10231
|
return ne("socket", "sprite_taken: no available sprites to retry with"), null;
|
|
10205
|
-
const
|
|
10206
|
-
return x("socket", "sprite_taken: retrying with
|
|
10232
|
+
const r = !!e.name && !St(e.name), n = r ? e.name : dr(t);
|
|
10233
|
+
return x("socket", "sprite_taken: retrying with a free character", { from: e.sprite, to: t, name: n, keptCustomName: r }), e.setSessionIdentity(n, t), { name: n, sprite: t };
|
|
10207
10234
|
}
|
|
10208
|
-
function
|
|
10235
|
+
function nm(e) {
|
|
10209
10236
|
const t = U.getState(), r = e ? t.roster[e] : void 0;
|
|
10210
10237
|
return !r || !!r.sprite && r.sprite === t.sprite;
|
|
10211
10238
|
}
|
|
10212
|
-
var
|
|
10239
|
+
var am = "https://hadoku.me/prefs", co = "hadoku-avatar-link", im = "hadoku-avatar-link", uo = "hadoku-avatar-link-popup";
|
|
10213
10240
|
function fo(e) {
|
|
10214
10241
|
try {
|
|
10215
10242
|
e ? sessionStorage.setItem(uo, "1") : sessionStorage.removeItem(uo);
|
|
@@ -10222,21 +10249,21 @@ var fr = class extends Error {
|
|
|
10222
10249
|
}
|
|
10223
10250
|
status;
|
|
10224
10251
|
};
|
|
10225
|
-
async function
|
|
10252
|
+
async function om(e) {
|
|
10226
10253
|
if (!e.ok) {
|
|
10227
10254
|
const t = await e.json().catch(() => null);
|
|
10228
10255
|
throw new fr(e.status, t?.message ?? `HTTP ${e.status}`);
|
|
10229
10256
|
}
|
|
10230
10257
|
return await e.json();
|
|
10231
10258
|
}
|
|
10232
|
-
function
|
|
10233
|
-
const t = `${e.baseUrl ??
|
|
10259
|
+
function sm(e = {}) {
|
|
10260
|
+
const t = `${e.baseUrl ?? am}/api/v1/_avatar`, r = e.fetch ?? fetch, n = (s, l = {}) => r(`${t}${s}`, { credentials: "include", ...l }).then(om), a = (s, l, c) => n(s, {
|
|
10234
10261
|
method: l,
|
|
10235
10262
|
...c === void 0 ? {} : { headers: { "Content-Type": "application/json" }, body: JSON.stringify(c) }
|
|
10236
10263
|
}), i = () => n("");
|
|
10237
10264
|
async function o(s) {
|
|
10238
10265
|
fo(!0);
|
|
10239
|
-
const l = window.open("about:blank",
|
|
10266
|
+
const l = window.open("about:blank", im, "popup,width=520,height=760");
|
|
10240
10267
|
if (fo(!1), !l)
|
|
10241
10268
|
throw new fr(0, "The sign-in window was blocked: allow pop-ups for hadoku.me");
|
|
10242
10269
|
let c;
|
|
@@ -10297,16 +10324,16 @@ function im(e = {}) {
|
|
|
10297
10324
|
setCosmetics: (s) => a("/cosmetics", "PUT", s)
|
|
10298
10325
|
};
|
|
10299
10326
|
}
|
|
10300
|
-
const
|
|
10301
|
-
function
|
|
10327
|
+
const lm = "hadoku:avatar", cm = "hadoku:name";
|
|
10328
|
+
function um(e) {
|
|
10302
10329
|
const t = e?.sprite ?? e?.avatar?.sprite ?? null;
|
|
10303
10330
|
return Sa(t) ? t : null;
|
|
10304
10331
|
}
|
|
10305
|
-
async function
|
|
10332
|
+
async function Lg(e = {}) {
|
|
10306
10333
|
const t = e.fetch ?? (typeof fetch > "u" ? void 0 : fetch), r = typeof window > "u" ? void 0 : window.location?.origin, n = e.baseUrl ?? (r ? `${r}/prefs` : void 0);
|
|
10307
10334
|
if (!t || !n) return null;
|
|
10308
10335
|
try {
|
|
10309
|
-
const a = await
|
|
10336
|
+
const a = await sm({ baseUrl: n, fetch: t }).get(), i = um(a);
|
|
10310
10337
|
return x("avatar", "Requested character from prefs-api", { sprite: i }), i;
|
|
10311
10338
|
} catch (a) {
|
|
10312
10339
|
return a instanceof fr && (a.status === 401 || a.status === 403 || a.status === 404) ? x("avatar", "No avatar settings here (signed out, or no prefs-api on this origin)", { status: a.status }) : ne("avatar", "Avatar settings read failed — keeping the auto-assigned character", {
|
|
@@ -10322,7 +10349,7 @@ function ho(e) {
|
|
|
10322
10349
|
const n = !!(t.me.clientId && t.roster[t.me.clientId]?.registryName) || !t.name || !St(t.name) ? t.name : dr(e);
|
|
10323
10350
|
return t.setSessionIdentity(n, e), !0;
|
|
10324
10351
|
}
|
|
10325
|
-
function
|
|
10352
|
+
function el(e, t, r) {
|
|
10326
10353
|
if (!r) return () => {
|
|
10327
10354
|
};
|
|
10328
10355
|
const n = (a) => {
|
|
@@ -10331,28 +10358,28 @@ function Zs(e, t, r) {
|
|
|
10331
10358
|
};
|
|
10332
10359
|
return r.addEventListener(e, n), () => r.removeEventListener(e, n);
|
|
10333
10360
|
}
|
|
10334
|
-
const
|
|
10335
|
-
function
|
|
10336
|
-
return
|
|
10361
|
+
const tl = () => typeof window > "u" ? void 0 : window;
|
|
10362
|
+
function Og(e, t = tl()) {
|
|
10363
|
+
return el(lm, e, t);
|
|
10337
10364
|
}
|
|
10338
|
-
function
|
|
10339
|
-
return
|
|
10365
|
+
function Dg(e, t = tl()) {
|
|
10366
|
+
return el(cm, (r) => {
|
|
10340
10367
|
typeof r.name == "string" && r.name.trim() && e(r.name);
|
|
10341
10368
|
}, t);
|
|
10342
10369
|
}
|
|
10343
|
-
const
|
|
10344
|
-
function
|
|
10370
|
+
const dm = 10;
|
|
10371
|
+
function fm(e = typeof window < "u" ? window : void 0) {
|
|
10345
10372
|
if (!e) return { framed: !1, depth: 0 };
|
|
10346
10373
|
try {
|
|
10347
10374
|
let t = 0, r = e;
|
|
10348
|
-
for (; r !== r.parent && t <
|
|
10375
|
+
for (; r !== r.parent && t < dm; )
|
|
10349
10376
|
t++, r = r.parent;
|
|
10350
10377
|
return { framed: e.top ? e.top !== e.self : t > 0, depth: t };
|
|
10351
10378
|
} catch {
|
|
10352
10379
|
return { framed: !1, depth: 0 };
|
|
10353
10380
|
}
|
|
10354
10381
|
}
|
|
10355
|
-
function
|
|
10382
|
+
function hm(e, t) {
|
|
10356
10383
|
let r = 0;
|
|
10357
10384
|
for (const n of e.videos) {
|
|
10358
10385
|
const a = Ft.voteKey(t, e.id, n.mediaId);
|
|
@@ -10360,49 +10387,49 @@ function dm(e, t) {
|
|
|
10360
10387
|
}
|
|
10361
10388
|
return r;
|
|
10362
10389
|
}
|
|
10363
|
-
const
|
|
10364
|
-
function
|
|
10390
|
+
const pm = 2e4, mm = 1e4;
|
|
10391
|
+
function gm() {
|
|
10365
10392
|
return { unansweredSince: null, lastPongAt: null, lastTickAt: null };
|
|
10366
10393
|
}
|
|
10367
|
-
function
|
|
10394
|
+
function ym(e, t) {
|
|
10368
10395
|
e.lastPongAt = t, e.unansweredSince = null;
|
|
10369
10396
|
}
|
|
10370
|
-
function
|
|
10371
|
-
const n = e.lastTickAt !== null && t - e.lastTickAt >
|
|
10372
|
-
return e.lastTickAt = t, r ? n || e.unansweredSince === null ? (e.unansweredSince = t, !1) : t - e.unansweredSince >
|
|
10397
|
+
function vm(e, t, r) {
|
|
10398
|
+
const n = e.lastTickAt !== null && t - e.lastTickAt > mm;
|
|
10399
|
+
return e.lastTickAt = t, r ? n || e.unansweredSince === null ? (e.unansweredSince = t, !1) : t - e.unansweredSince > pm : (e.unansweredSince = null, !1);
|
|
10373
10400
|
}
|
|
10374
|
-
function
|
|
10401
|
+
function rl(e, t) {
|
|
10375
10402
|
return e.lastPongAt === null ? void 0 : Math.max(0, t - e.lastPongAt);
|
|
10376
10403
|
}
|
|
10377
10404
|
let Q = null, Fe = null, tn = null, Be = null, it = null;
|
|
10378
|
-
const
|
|
10405
|
+
const bm = _m(), Et = gm();
|
|
10379
10406
|
let Ur = null, jn = null, po = 0, $a = null, hr = !1, Fa = !1, Qt = !1, Ua = null;
|
|
10380
|
-
function
|
|
10407
|
+
function Ng(e) {
|
|
10381
10408
|
const t = Ae(), r = U.getState();
|
|
10382
10409
|
if (r.me.clientId && r.roster[r.me.clientId])
|
|
10383
10410
|
return (e.name || e.sprite) && (x("socket", "Identity update (already joined)", { name: e.name, sprite: e.sprite }), t.emit(re.IDENTITY_UPDATE, { name: e.name, sprite: e.sprite })), t;
|
|
10384
|
-
const n =
|
|
10411
|
+
const n = wm(e);
|
|
10385
10412
|
return it = n, $a = { name: n.name, sprite: n.sprite }, t.connected ? (x("socket", "Emitting join", n), t.emit(re.JOIN, n)) : t.once("connect", () => {
|
|
10386
10413
|
x("socket", "Emitting join", n), t.emit(re.JOIN, n);
|
|
10387
10414
|
}), t;
|
|
10388
10415
|
}
|
|
10389
|
-
function
|
|
10416
|
+
function wm(e) {
|
|
10390
10417
|
return {
|
|
10391
10418
|
room_key: e.room_key,
|
|
10392
10419
|
name: e.name,
|
|
10393
10420
|
sprite: e.sprite,
|
|
10394
10421
|
// Entry-path telemetry — see lib/embedContext.ts. Sent on every join AND
|
|
10395
10422
|
// rejoin (lastJoinPayload carries it), so a reconnect keeps the attribution.
|
|
10396
|
-
embed:
|
|
10397
|
-
delivery_arm:
|
|
10423
|
+
embed: fm(),
|
|
10424
|
+
delivery_arm: Dp(),
|
|
10398
10425
|
// Identity tier input — see lib/deviceId.ts. Sent on every join AND rejoin
|
|
10399
10426
|
// (lastJoinPayload carries it) so a reconnect lands on the same
|
|
10400
10427
|
// ParticipantId rather than minting a new person.
|
|
10401
|
-
device_id:
|
|
10402
|
-
tab_id:
|
|
10428
|
+
device_id: Gp(),
|
|
10429
|
+
tab_id: bm
|
|
10403
10430
|
};
|
|
10404
10431
|
}
|
|
10405
|
-
function
|
|
10432
|
+
function _m() {
|
|
10406
10433
|
const e = globalThis.crypto;
|
|
10407
10434
|
if (e && typeof e.randomUUID == "function") return e.randomUUID();
|
|
10408
10435
|
const t = new Uint8Array(16);
|
|
@@ -10410,8 +10437,8 @@ function bm() {
|
|
|
10410
10437
|
else for (let r = 0; r < t.length; r++) t[r] = Math.floor(Math.random() * 256);
|
|
10411
10438
|
return Array.from(t, (r) => r.toString(16).padStart(2, "0")).join("");
|
|
10412
10439
|
}
|
|
10413
|
-
function
|
|
10414
|
-
return
|
|
10440
|
+
function $g() {
|
|
10441
|
+
return rl(Et, Date.now());
|
|
10415
10442
|
}
|
|
10416
10443
|
function Ae() {
|
|
10417
10444
|
if (!Q) {
|
|
@@ -10420,7 +10447,7 @@ function Ae() {
|
|
|
10420
10447
|
const n = window.location;
|
|
10421
10448
|
(n.hostname === "localhost" || n.hostname === "127.0.0.1") && n.port === String(fn) && (t = `${n.protocol}//${n.hostname}:${br}`, x("socket", "Using dev fallback origin", { origin: t }));
|
|
10422
10449
|
}
|
|
10423
|
-
const r =
|
|
10450
|
+
const r = Qp();
|
|
10424
10451
|
if (r)
|
|
10425
10452
|
Q = Lt(r.url, { path: r.path, transports: ["websocket", "polling"] }), x("socket", "Socket initialized on the room origin", r);
|
|
10426
10453
|
else {
|
|
@@ -10428,15 +10455,15 @@ function Ae() {
|
|
|
10428
10455
|
Q = Lt(n, { path: Xo, transports: ["websocket", "polling"] }), x("socket", "Socket initialized", { origin: t });
|
|
10429
10456
|
}
|
|
10430
10457
|
mn("__SOCKET__", Q), Be && (clearTimeout(Be), Be = null), Fe = null, tn = setInterval(() => {
|
|
10431
|
-
if (
|
|
10458
|
+
if (vm(Et, Date.now(), !!Q?.connected)) {
|
|
10432
10459
|
ne("socket", "PONG-WATCHDOG no time_pong for 20s — replacing the connection", {
|
|
10433
10460
|
sid: Q?.id,
|
|
10434
|
-
lastPongAgeMs:
|
|
10461
|
+
lastPongAgeMs: rl(Et, Date.now()) ?? null
|
|
10435
10462
|
}), jn = "pong-watchdog", Et.unansweredSince = null, Q?.io.engine?.close();
|
|
10436
10463
|
return;
|
|
10437
10464
|
}
|
|
10438
|
-
|
|
10439
|
-
},
|
|
10465
|
+
Mm();
|
|
10466
|
+
}, vd), Q.on("connect", () => {
|
|
10440
10467
|
Fa = !1;
|
|
10441
10468
|
const n = Q?.id;
|
|
10442
10469
|
if (x("socket", "Connected", { id: n, isReconnect: Qt }), n)
|
|
@@ -10472,14 +10499,14 @@ function Ae() {
|
|
|
10472
10499
|
Qt = !0;
|
|
10473
10500
|
}), Q.on("disconnect", (n) => {
|
|
10474
10501
|
vs(null), Ur = { reason: jn ?? n, at: Date.now() }, jn = null, x("socket", "Disconnected", { reason: n });
|
|
10475
|
-
}), Q.on("connect_error", (n) => at("socket", "Connection error", { message: n?.message })), Q.on("reconnect_attempt", (n) => ne("socket", "Reconnect attempt", { attempt: n })), Q.on("reconnect_failed", () => at("socket", "Reconnect failed")),
|
|
10502
|
+
}), Q.on("connect_error", (n) => at("socket", "Connection error", { message: n?.message })), Q.on("reconnect_attempt", (n) => ne("socket", "Reconnect attempt", { attempt: n })), Q.on("reconnect_failed", () => at("socket", "Reconnect failed")), Pm(Q);
|
|
10476
10503
|
}
|
|
10477
10504
|
return Q;
|
|
10478
10505
|
}
|
|
10479
10506
|
function zn(e) {
|
|
10480
10507
|
return e.play_state === "playing" || e.playing === !0;
|
|
10481
10508
|
}
|
|
10482
|
-
function
|
|
10509
|
+
function Em(e) {
|
|
10483
10510
|
e.on(re.SNAPSHOT, (t) => {
|
|
10484
10511
|
e.emit(_a.SYNC), U.getState().applySnapshot({
|
|
10485
10512
|
roomId: t.room_id ?? null,
|
|
@@ -10489,7 +10516,7 @@ function wm(e) {
|
|
|
10489
10516
|
serverSeq: t.server_seq || 0,
|
|
10490
10517
|
leaderId: t.leader_id || null
|
|
10491
10518
|
}), U.getState().name || x("socket", "Deferring identity to presence event (snapshot carries no roster)");
|
|
10492
|
-
const r = U.getState(), n = Q?.id, i = (n ? r.roster[n] : void 0) ?? $a, o =
|
|
10519
|
+
const r = U.getState(), n = Q?.id, i = (n ? r.roster[n] : void 0) ?? $a, o = wf(
|
|
10493
10520
|
{ name: r.name, avatarId: r.sprite },
|
|
10494
10521
|
i ? { name: i.name, avatarId: i.sprite ?? null } : void 0,
|
|
10495
10522
|
// A join that carried no name counts as a default one, so a name that
|
|
@@ -10532,7 +10559,7 @@ function wm(e) {
|
|
|
10532
10559
|
}), e.on(re.CONTROL_ACK, (t) => {
|
|
10533
10560
|
typeof t?.client_seq == "number" && typeof t?.server_seq == "number" && x("socket", "Control ack received", t);
|
|
10534
10561
|
}), e.on(re.TIME_PONG, (t) => {
|
|
10535
|
-
if (
|
|
10562
|
+
if (ym(Et, Date.now()), Fe && Fe.ts) {
|
|
10536
10563
|
const r = Date.now() - Fe.ts;
|
|
10537
10564
|
U.getState().addRttSample(r, t?.server_ts, Fe.ts), Fe = null, Be && (clearTimeout(Be), Be = null), x("socket", "Time sync RTT", { rtt: r, offset: U.getState().drift.offsetMs });
|
|
10538
10565
|
}
|
|
@@ -10542,11 +10569,11 @@ function wm(e) {
|
|
|
10542
10569
|
U.getState().setReadiness({ mediaId: r, ready: i, readyCount: n, total: a }), x("socket", "Ready state received", { mediaId: r, readyCount: n, total: a, ready: i });
|
|
10543
10570
|
});
|
|
10544
10571
|
}
|
|
10545
|
-
function
|
|
10546
|
-
const t =
|
|
10572
|
+
function Sm(e) {
|
|
10573
|
+
const t = Jh(e);
|
|
10547
10574
|
return t ? { cosmetics: t } : {};
|
|
10548
10575
|
}
|
|
10549
|
-
function
|
|
10576
|
+
function Rm(e) {
|
|
10550
10577
|
e.on(re.PRESENCE, (t) => {
|
|
10551
10578
|
if (!t) return;
|
|
10552
10579
|
if (Array.isArray(t.users)) {
|
|
@@ -10560,7 +10587,7 @@ function Em(e) {
|
|
|
10560
10587
|
isLeader: s.is_leader,
|
|
10561
10588
|
...s.registry_name ? { registryName: !0 } : {},
|
|
10562
10589
|
...s.avatar_url ? { avatarUrl: s.avatar_url } : {},
|
|
10563
|
-
...
|
|
10590
|
+
...Sm(s.cosmetics)
|
|
10564
10591
|
};
|
|
10565
10592
|
const a = U.getState(), i = Q?.id, o = i ? n[i] : void 0;
|
|
10566
10593
|
if (o?.registryName)
|
|
@@ -10582,7 +10609,7 @@ function Em(e) {
|
|
|
10582
10609
|
}
|
|
10583
10610
|
});
|
|
10584
10611
|
}
|
|
10585
|
-
function
|
|
10612
|
+
function Tm(e) {
|
|
10586
10613
|
e.on(rt.STATE, (t) => {
|
|
10587
10614
|
U.getState().applyPlaylistState({
|
|
10588
10615
|
playlist: t?.playlist ?? null,
|
|
@@ -10595,63 +10622,63 @@ function Sm(e) {
|
|
|
10595
10622
|
U.getState().setPlaylistResults(t ?? null), x("playlist", "Results received", { playlistId: t?.playlist?.id, update: t?.update === !0 });
|
|
10596
10623
|
}), e.on(rt.VOTES_CLEARED, (t) => {
|
|
10597
10624
|
if (!t?.playlistId || !Array.isArray(t.mediaIds)) return;
|
|
10598
|
-
const r =
|
|
10625
|
+
const r = hm(
|
|
10599
10626
|
{ id: t.playlistId, videos: t.mediaIds.map((a) => ({ mediaId: a })) },
|
|
10600
|
-
|
|
10627
|
+
If()
|
|
10601
10628
|
), n = U.getState();
|
|
10602
10629
|
n.playlist?.id === t.playlistId && n.applyPlaylistState({ playlist: n.playlist, activeIndex: n.activePlaylistIndex, myVotes: {} }), x("playlist", "Votes cleared by leader", { playlistId: t.playlistId, removed: r });
|
|
10603
10630
|
});
|
|
10604
10631
|
}
|
|
10605
|
-
function
|
|
10606
|
-
e.on(
|
|
10607
|
-
x("tierlist", "Someone saved — refreshing the board"),
|
|
10632
|
+
function xm(e) {
|
|
10633
|
+
e.on(hd.UPDATED, () => {
|
|
10634
|
+
x("tierlist", "Someone saved — refreshing the board"), tm(!1);
|
|
10608
10635
|
});
|
|
10609
10636
|
}
|
|
10610
|
-
function
|
|
10637
|
+
function Cm(e) {
|
|
10611
10638
|
e.on(wa.STATE, (t) => {
|
|
10612
10639
|
if (!t || typeof t.active != "boolean") return;
|
|
10613
10640
|
const r = Array.isArray(t.ready) ? t.ready.filter((n) => typeof n == "string") : [];
|
|
10614
10641
|
U.getState().setReadyCheckState({ active: t.active, ready: r }), x("ready-check", "State received", { active: t.active, readyCount: r.length });
|
|
10615
10642
|
});
|
|
10616
10643
|
}
|
|
10617
|
-
function
|
|
10644
|
+
function Fg() {
|
|
10618
10645
|
Q?.emit(wa.START, {});
|
|
10619
10646
|
}
|
|
10620
|
-
function
|
|
10647
|
+
function Ug(e) {
|
|
10621
10648
|
Q?.emit(wa.TOGGLE, { ready: e });
|
|
10622
10649
|
}
|
|
10623
|
-
function
|
|
10650
|
+
function km(e) {
|
|
10624
10651
|
e.on(_a.ACTIVE, (t) => {
|
|
10625
10652
|
const r = typeof t?.gameId == "string" ? t.gameId : null;
|
|
10626
10653
|
U.getState().setActiveGameId(r), x("game", "game_active", { gameId: r });
|
|
10627
10654
|
});
|
|
10628
10655
|
}
|
|
10629
|
-
function
|
|
10656
|
+
function Bg(e) {
|
|
10630
10657
|
Q?.emit(_a.SELECT, { gameId: e });
|
|
10631
10658
|
}
|
|
10632
|
-
function
|
|
10659
|
+
function Am(e) {
|
|
10633
10660
|
e.on(re.HEALTH_SNAPSHOT, (t) => {
|
|
10634
10661
|
U.getState().setHealthSnapshot(t);
|
|
10635
10662
|
}), e.on(re.BUFFER_STATUS, (t) => {
|
|
10636
10663
|
U.getState().setBufferStatus(t);
|
|
10637
10664
|
});
|
|
10638
10665
|
}
|
|
10639
|
-
function
|
|
10640
|
-
|
|
10666
|
+
function Pm(e) {
|
|
10667
|
+
Em(e), Rm(e), Xp(e, () => !0), Am(e), Tm(e), xm(e), Cm(e), km(e), e.on(re.ERROR, (t) => {
|
|
10641
10668
|
const r = t?.code || "error/unknown";
|
|
10642
10669
|
if (r === "conflict" && t?.message === "sprite_held_by_you") {
|
|
10643
10670
|
Fa = !0, x("socket", "sprite held by this account's other connection: keeping the server-assigned sprite");
|
|
10644
10671
|
return;
|
|
10645
10672
|
}
|
|
10646
10673
|
if (r === "conflict" && t?.message === "sprite_taken") {
|
|
10647
|
-
if (
|
|
10674
|
+
if (nm(Q?.id)) {
|
|
10648
10675
|
x("socket", "sprite_taken: stale, the server already has our sprite");
|
|
10649
10676
|
return;
|
|
10650
10677
|
}
|
|
10651
10678
|
hr = !0;
|
|
10652
10679
|
let o;
|
|
10653
10680
|
try {
|
|
10654
|
-
o =
|
|
10681
|
+
o = rm();
|
|
10655
10682
|
} finally {
|
|
10656
10683
|
hr = !1;
|
|
10657
10684
|
}
|
|
@@ -10682,16 +10709,16 @@ function km(e) {
|
|
|
10682
10709
|
(r.startsWith("auth/") ? ne : at)("socket", `Server error: ${a}`, { code: r, raw: t }), U.getState().pushToast("error", a);
|
|
10683
10710
|
});
|
|
10684
10711
|
}
|
|
10685
|
-
function
|
|
10712
|
+
function jg(e, t) {
|
|
10686
10713
|
const r = t?.length ? { text: e, images: t } : { text: e };
|
|
10687
10714
|
Ae().emit(re.CHAT_SEND, r);
|
|
10688
10715
|
}
|
|
10689
|
-
function
|
|
10716
|
+
function Mm() {
|
|
10690
10717
|
Fe || (Fe = { ts: Date.now() }, Ae().emit(re.TIME_PING, {}), Be = setTimeout(() => {
|
|
10691
10718
|
Fe && (x("socket", "Time ping timed out after 10s, clearing inflight"), Fe = null), Be = null;
|
|
10692
10719
|
}, 1e4));
|
|
10693
10720
|
}
|
|
10694
|
-
function
|
|
10721
|
+
function zg(e) {
|
|
10695
10722
|
const t = U.getState(), r = t.me.clientId;
|
|
10696
10723
|
if (!r || !t.roster[r]) {
|
|
10697
10724
|
ho(e), x("socket", "Avatar change before join: the join will carry it", { sprite: e });
|
|
@@ -10706,10 +10733,10 @@ function Bg(e) {
|
|
|
10706
10733
|
const n = U.getState(), a = { avatar: !0 };
|
|
10707
10734
|
n.sprite && n.sprite !== t.sprite && (a.sprite = n.sprite), n.name && n.name !== t.name && (a.name = n.name), x("socket", "Sending avatar change", a), Ae().emit(re.IDENTITY_UPDATE, a);
|
|
10708
10735
|
}
|
|
10709
|
-
function
|
|
10710
|
-
U.getState().me.clientId &&
|
|
10736
|
+
function Hg(e) {
|
|
10737
|
+
U.getState().me.clientId && Im(e);
|
|
10711
10738
|
}
|
|
10712
|
-
function
|
|
10739
|
+
function Im(e, t) {
|
|
10713
10740
|
const r = {};
|
|
10714
10741
|
e && (r.name = e), !(!r.name && !r.sprite) && (x("socket", "Sending identity update", r), Ae().emit(re.IDENTITY_UPDATE, r));
|
|
10715
10742
|
}
|
|
@@ -10725,14 +10752,14 @@ U.subscribe((e, t) => {
|
|
|
10725
10752
|
const o = {};
|
|
10726
10753
|
a && (o.name = e.name, Br.name = e.name), i && (o.sprite = e.sprite, Br.sprite = e.sprite), x("socket", "Identity reassert (store change)", o), Q?.connected ? Q.emit(re.IDENTITY_UPDATE, o) : Ae().emit(re.IDENTITY_UPDATE, o);
|
|
10727
10754
|
});
|
|
10728
|
-
function
|
|
10755
|
+
function Lm() {
|
|
10729
10756
|
tn && (clearInterval(tn), tn = null), Be && (clearTimeout(Be), Be = null), Fe = null, Et.unansweredSince = null, Et.lastTickAt = null;
|
|
10730
10757
|
}
|
|
10731
|
-
function
|
|
10758
|
+
function Om() {
|
|
10732
10759
|
x("socket", "clearJoinState called", { hadPayload: it !== null, room_key: it?.room_key }), it = null, Qt = !1, Ua = null;
|
|
10733
10760
|
}
|
|
10734
|
-
function
|
|
10735
|
-
x("socket", "leaveRoom called", { room_key: it?.room_key }),
|
|
10761
|
+
function Dm() {
|
|
10762
|
+
x("socket", "leaveRoom called", { room_key: it?.room_key }), Om(), Lm(), Q && (Q.disconnect(), Q = null), U.setState({
|
|
10736
10763
|
me: { clientId: null, nextClientSeq: 1 },
|
|
10737
10764
|
roster: {},
|
|
10738
10765
|
snapshot: { roomId: null, mediaId: null, playheadMs: 0, playing: !1, serverSeq: 0, leaderId: null },
|
|
@@ -10747,62 +10774,62 @@ function Lm() {
|
|
|
10747
10774
|
activeGameId: null
|
|
10748
10775
|
});
|
|
10749
10776
|
}
|
|
10750
|
-
function
|
|
10777
|
+
function Vg(e) {
|
|
10751
10778
|
x("playlist", "Emitting playlist_load", { playlistId: e }), Ae().emit(rt.LOAD, { playlistId: e });
|
|
10752
10779
|
}
|
|
10753
|
-
function
|
|
10780
|
+
function qg(e) {
|
|
10754
10781
|
x("playlist", "Emitting playlist_select", { index: e }), Ae().emit(rt.SELECT, { index: e });
|
|
10755
10782
|
}
|
|
10756
|
-
function
|
|
10783
|
+
function Wg(e, t, r) {
|
|
10757
10784
|
x("playlist", "Emitting playlist_vote_update", { playlistId: e, mediaId: t, vote: r }), Ae().emit(rt.VOTE_UPDATE, { playlistId: e, mediaId: t, vote: r });
|
|
10758
10785
|
}
|
|
10759
|
-
function
|
|
10786
|
+
function Kg() {
|
|
10760
10787
|
x("chat", "Emitting recap_request"), Ae().emit("recap_request");
|
|
10761
10788
|
}
|
|
10762
|
-
function
|
|
10789
|
+
function Gg() {
|
|
10763
10790
|
x("playlist", "Emitting playlist_reveal_request"), Ae().emit(rt.REVEAL_REQUEST, {});
|
|
10764
10791
|
}
|
|
10765
|
-
function
|
|
10792
|
+
function Yg(e) {
|
|
10766
10793
|
x("playlist", "Emitting playlist_vote_remove", { voterKey: e }), Ae().emit(rt.VOTE_REMOVE, { voterKey: e });
|
|
10767
10794
|
}
|
|
10768
|
-
function
|
|
10795
|
+
function Xg(e) {
|
|
10769
10796
|
Ua = e, Ae().emit(re.CLIENT_READY, { media_id: e }), x("socket", "client_ready emitted", { mediaId: e });
|
|
10770
10797
|
}
|
|
10771
|
-
function
|
|
10798
|
+
function Nm(e) {
|
|
10772
10799
|
if (!e || e === "/" || document.querySelector(`link[rel="preconnect"][href="${e}"]`)) return;
|
|
10773
10800
|
const t = document.createElement("link");
|
|
10774
10801
|
t.rel = "preconnect", t.href = e, t.crossOrigin = "anonymous", document.head.appendChild(t);
|
|
10775
10802
|
}
|
|
10776
|
-
function
|
|
10777
|
-
const n =
|
|
10803
|
+
function $m(e, t, r) {
|
|
10804
|
+
const n = yl(e), a = r ? /* @__PURE__ */ N(ut.StrictMode, { children: t }) : t;
|
|
10778
10805
|
return n.render(a), n;
|
|
10779
10806
|
}
|
|
10780
10807
|
let Ot = null, Dt = null;
|
|
10781
|
-
const
|
|
10808
|
+
const nl = import.meta.url.replace(/[^/]*$/, "");
|
|
10782
10809
|
let jr = !1;
|
|
10783
|
-
function
|
|
10810
|
+
function Fm() {
|
|
10784
10811
|
const e = () => {
|
|
10785
10812
|
jr || !$t() || (jr = !0, x("boot", "tv mode: starting with chat collapsed"), U.getState().applyTvDefaults());
|
|
10786
10813
|
};
|
|
10787
10814
|
if (e(), !jr) {
|
|
10788
|
-
const t =
|
|
10815
|
+
const t = Ts(() => {
|
|
10789
10816
|
e(), jr && t();
|
|
10790
10817
|
});
|
|
10791
10818
|
}
|
|
10792
10819
|
}
|
|
10793
|
-
function
|
|
10794
|
-
return !e.filename || !e.filename.startsWith(
|
|
10820
|
+
function Um(e) {
|
|
10821
|
+
return !e.filename || !e.filename.startsWith(nl) ? !1 : !/^ResizeObserver loop/.test(e.message ?? "");
|
|
10795
10822
|
}
|
|
10796
|
-
function
|
|
10823
|
+
function Jg(e, t = {}) {
|
|
10797
10824
|
const { basename: r, strictMode: n = !1, ...a } = t;
|
|
10798
|
-
|
|
10825
|
+
nf(), Zd({
|
|
10799
10826
|
serverOrigin: a.serverOrigin,
|
|
10800
10827
|
defaultRoomKey: a.defaultRoomKey,
|
|
10801
10828
|
cdnBase: a.cdnBase
|
|
10802
|
-
}),
|
|
10829
|
+
}), Kp(), Af({
|
|
10803
10830
|
userType: a.userType,
|
|
10804
10831
|
userId: a.userId
|
|
10805
|
-
}), U.getState().rehydrateFromPrefs(),
|
|
10832
|
+
}), U.getState().rehydrateFromPrefs(), Fm();
|
|
10806
10833
|
try {
|
|
10807
10834
|
const c = yn() || "public", d = gn(), h = typeof localStorage < "u" ? localStorage : null, y = h?.getItem("watchparty_preferences"), g = h && c !== "public" ? h.getItem(`watchparty_preferences:${c}`) : null, _ = d ? h?.getItem(`prefs-cache:${d}:portfolio`) : null, R = d ? h?.getItem(`prefs-cache:${d}:watchparty`) : null, b = U.getState();
|
|
10808
10835
|
x("boot", "prefs.beacon", {
|
|
@@ -10818,138 +10845,138 @@ function Yg(e, t = {}) {
|
|
|
10818
10845
|
} catch (c) {
|
|
10819
10846
|
ne("boot", "prefs.beacon.threw", { err: c?.message });
|
|
10820
10847
|
}
|
|
10821
|
-
|
|
10848
|
+
Lf().catch((c) => ne("boot", "whoami threw", Ue(c))), Uf().then((c) => {
|
|
10822
10849
|
c && U.getState().rehydrateFromPrefs();
|
|
10823
10850
|
}).catch((c) => ne("boot", "prefs sync threw", Ue(c))), Ot || (Ot = (c) => {
|
|
10824
10851
|
at("app", "Unhandled promise rejection", { reason: String(c.reason) });
|
|
10825
10852
|
}, window.addEventListener("unhandledrejection", Ot)), Dt || (Dt = (c) => {
|
|
10826
|
-
|
|
10853
|
+
Um(c) && at("app", "Uncaught error", {
|
|
10827
10854
|
message: c.message,
|
|
10828
|
-
source: `${c.filename.slice(
|
|
10855
|
+
source: `${c.filename.slice(nl.length)}:${c.lineno}:${c.colno}`,
|
|
10829
10856
|
stack: c.error instanceof Error ? c.error.stack?.slice(0, 1500) : void 0
|
|
10830
10857
|
});
|
|
10831
|
-
}, window.addEventListener("error", Dt)), a.serverOrigin &&
|
|
10858
|
+
}, window.addEventListener("error", Dt)), a.serverOrigin && Nm(a.serverOrigin);
|
|
10832
10859
|
const i = Ca().theme;
|
|
10833
|
-
i &&
|
|
10834
|
-
const o =
|
|
10860
|
+
i && wl.includes(i) && _l(i), bf().catch((c) => ne("boot", "display names load threw", Ue(c))), e.__watchparty?.root.unmount();
|
|
10861
|
+
const o = Wp({
|
|
10835
10862
|
basename: r,
|
|
10836
10863
|
appProps: a
|
|
10837
|
-
}), l = { root:
|
|
10864
|
+
}), l = { root: $m(e, /* @__PURE__ */ N(Yu, { router: o }), n) };
|
|
10838
10865
|
return e.__watchparty = l, o;
|
|
10839
10866
|
}
|
|
10840
|
-
function
|
|
10867
|
+
function Qg(e) {
|
|
10841
10868
|
const t = e.__watchparty;
|
|
10842
|
-
t && (t.root.unmount(), delete e.__watchparty,
|
|
10869
|
+
t && (t.root.unmount(), delete e.__watchparty, Dm(), Ot && (window.removeEventListener("unhandledrejection", Ot), Ot = null), Dt && (window.removeEventListener("error", Dt), Dt = null));
|
|
10843
10870
|
}
|
|
10844
10871
|
export {
|
|
10845
10872
|
Ae as $,
|
|
10846
|
-
|
|
10873
|
+
yp as A,
|
|
10847
10874
|
Ca as B,
|
|
10848
10875
|
tr as C,
|
|
10849
10876
|
va as D,
|
|
10850
10877
|
Oi as E,
|
|
10851
10878
|
yn as F,
|
|
10852
|
-
|
|
10853
|
-
|
|
10854
|
-
|
|
10879
|
+
Bg as G,
|
|
10880
|
+
eg as H,
|
|
10881
|
+
Zm as I,
|
|
10855
10882
|
mn as J,
|
|
10856
|
-
|
|
10883
|
+
Ug as K,
|
|
10857
10884
|
nn as L,
|
|
10858
10885
|
Ln as M,
|
|
10859
|
-
|
|
10860
|
-
|
|
10861
|
-
|
|
10862
|
-
|
|
10863
|
-
|
|
10864
|
-
|
|
10865
|
-
|
|
10866
|
-
|
|
10867
|
-
|
|
10868
|
-
|
|
10869
|
-
|
|
10870
|
-
|
|
10886
|
+
Fg as N,
|
|
10887
|
+
Qm as O,
|
|
10888
|
+
tm as P,
|
|
10889
|
+
Ig as Q,
|
|
10890
|
+
em as R,
|
|
10891
|
+
mg as S,
|
|
10892
|
+
Ym as T,
|
|
10893
|
+
Og as U,
|
|
10894
|
+
Dg as V,
|
|
10895
|
+
um as W,
|
|
10896
|
+
zg as X,
|
|
10897
|
+
Hg as Y,
|
|
10871
10898
|
Ue as Z,
|
|
10872
10899
|
hn as _,
|
|
10873
|
-
|
|
10900
|
+
yg as a,
|
|
10874
10901
|
re as a0,
|
|
10875
|
-
|
|
10876
|
-
|
|
10877
|
-
|
|
10878
|
-
|
|
10879
|
-
|
|
10880
|
-
|
|
10881
|
-
|
|
10882
|
-
|
|
10883
|
-
|
|
10884
|
-
|
|
10902
|
+
Jm as a1,
|
|
10903
|
+
ig as a2,
|
|
10904
|
+
kg as a3,
|
|
10905
|
+
Cg as a4,
|
|
10906
|
+
sg as a5,
|
|
10907
|
+
og as a6,
|
|
10908
|
+
rg as a7,
|
|
10909
|
+
Xm as a8,
|
|
10910
|
+
dg as a9,
|
|
10911
|
+
Ng as aA,
|
|
10885
10912
|
ws as aB,
|
|
10886
|
-
|
|
10887
|
-
|
|
10888
|
-
|
|
10889
|
-
|
|
10890
|
-
|
|
10913
|
+
hg as aC,
|
|
10914
|
+
pg as aD,
|
|
10915
|
+
Mf as aE,
|
|
10916
|
+
Vg as aF,
|
|
10917
|
+
_g as aG,
|
|
10891
10918
|
Sa as aH,
|
|
10892
|
-
|
|
10919
|
+
Yg as aI,
|
|
10893
10920
|
Ft as aJ,
|
|
10894
|
-
|
|
10921
|
+
If as aK,
|
|
10895
10922
|
je as aL,
|
|
10896
|
-
|
|
10897
|
-
|
|
10898
|
-
|
|
10923
|
+
Wg as aM,
|
|
10924
|
+
Gg as aN,
|
|
10925
|
+
qg as aO,
|
|
10899
10926
|
Ta as aP,
|
|
10900
|
-
|
|
10901
|
-
|
|
10902
|
-
|
|
10903
|
-
|
|
10904
|
-
|
|
10905
|
-
|
|
10906
|
-
|
|
10907
|
-
|
|
10908
|
-
|
|
10909
|
-
|
|
10910
|
-
|
|
10927
|
+
Jg as aQ,
|
|
10928
|
+
Qg as aR,
|
|
10929
|
+
Wp as aS,
|
|
10930
|
+
cg as aa,
|
|
10931
|
+
ug as ab,
|
|
10932
|
+
lg as ac,
|
|
10933
|
+
wg as ad,
|
|
10934
|
+
Gm as ae,
|
|
10935
|
+
$g as af,
|
|
10936
|
+
Dp as ag,
|
|
10937
|
+
ef as ah,
|
|
10911
10938
|
ps as ai,
|
|
10912
|
-
|
|
10913
|
-
|
|
10914
|
-
|
|
10915
|
-
|
|
10916
|
-
|
|
10917
|
-
|
|
10918
|
-
|
|
10919
|
-
|
|
10920
|
-
|
|
10921
|
-
|
|
10939
|
+
tg as aj,
|
|
10940
|
+
ng as ak,
|
|
10941
|
+
Wm as al,
|
|
10942
|
+
Pg as am,
|
|
10943
|
+
fg as an,
|
|
10944
|
+
Zp as ao,
|
|
10945
|
+
bd as ap,
|
|
10946
|
+
xs as aq,
|
|
10947
|
+
ag as ar,
|
|
10948
|
+
Xg as as,
|
|
10922
10949
|
hs as at,
|
|
10923
10950
|
Tt as au,
|
|
10924
|
-
|
|
10925
|
-
|
|
10926
|
-
|
|
10927
|
-
|
|
10928
|
-
|
|
10929
|
-
|
|
10930
|
-
|
|
10951
|
+
Os as av,
|
|
10952
|
+
qc as aw,
|
|
10953
|
+
bf as ax,
|
|
10954
|
+
Uf as ay,
|
|
10955
|
+
Lg as az,
|
|
10956
|
+
Qd as b,
|
|
10957
|
+
id as c,
|
|
10931
10958
|
x as d,
|
|
10932
10959
|
at as e,
|
|
10933
|
-
|
|
10934
|
-
|
|
10935
|
-
|
|
10960
|
+
gg as f,
|
|
10961
|
+
Xd as g,
|
|
10962
|
+
xg as h,
|
|
10936
10963
|
Yo as i,
|
|
10937
|
-
|
|
10964
|
+
Rg as j,
|
|
10938
10965
|
cs as k,
|
|
10939
|
-
|
|
10940
|
-
|
|
10941
|
-
|
|
10942
|
-
|
|
10943
|
-
|
|
10944
|
-
|
|
10945
|
-
|
|
10946
|
-
|
|
10947
|
-
|
|
10966
|
+
gp as l,
|
|
10967
|
+
vg as m,
|
|
10968
|
+
Tg as n,
|
|
10969
|
+
Sg as o,
|
|
10970
|
+
Mg as p,
|
|
10971
|
+
Kg as q,
|
|
10972
|
+
bg as r,
|
|
10973
|
+
jg as s,
|
|
10974
|
+
Km as t,
|
|
10948
10975
|
U as u,
|
|
10949
|
-
|
|
10976
|
+
ed as v,
|
|
10950
10977
|
ne as w,
|
|
10951
|
-
|
|
10952
|
-
|
|
10953
|
-
|
|
10978
|
+
Ag as x,
|
|
10979
|
+
Dm as y,
|
|
10980
|
+
jp as z
|
|
10954
10981
|
};
|
|
10955
|
-
//# sourceMappingURL=index-
|
|
10982
|
+
//# sourceMappingURL=index-BhTEvojV.js.map
|