@hadoku/watchparty-ui 0.44.8 → 0.44.9
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-Bwn6LIOC.js → AdminPanel-CfOBoGAb.js} +4 -4
- package/dist/chunks/{AdminPanel-Bwn6LIOC.js.map → AdminPanel-CfOBoGAb.js.map} +1 -1
- package/dist/chunks/{CharacterModal-BHb04Fee.js → CharacterModal-B6cG2NmX.js} +2 -2
- package/dist/chunks/{CharacterModal-BHb04Fee.js.map → CharacterModal-B6cG2NmX.js.map} +1 -1
- package/dist/chunks/{GameModule-D2TSoCac.js → GameModule-CrRHc04o.js} +4 -4
- package/dist/chunks/{GameModule-D2TSoCac.js.map → GameModule-CrRHc04o.js.map} +1 -1
- package/dist/chunks/{MapEditor-Dd3OijeD.js → MapEditor-Bvr-tvKQ.js} +2 -2
- package/dist/chunks/{MapEditor-Dd3OijeD.js.map → MapEditor-Bvr-tvKQ.js.map} +1 -1
- package/dist/chunks/{MediaDrawer-Bq4rhXGa.js → MediaDrawer-CY__KXu5.js} +4 -4
- package/dist/chunks/{MediaDrawer-Bq4rhXGa.js.map → MediaDrawer-CY__KXu5.js.map} +1 -1
- package/dist/chunks/{PlaylistPanel-BOU78K3d.js → PlaylistPanel-hV9B8oQl.js} +3 -3
- package/dist/chunks/{PlaylistPanel-BOU78K3d.js.map → PlaylistPanel-hV9B8oQl.js.map} +1 -1
- package/dist/chunks/{Room-DXyTphDD.js → Room-B6ODdfkE.js} +4 -4
- package/dist/chunks/{Room-DXyTphDD.js.map → Room-B6ODdfkE.js.map} +1 -1
- package/dist/chunks/{index-D8nwgvG0.js → index-CFH_9amZ.js} +423 -421
- package/dist/chunks/index-CFH_9amZ.js.map +1 -0
- package/dist/chunks/{submissionsApi-BHPcbZrP.js → submissionsApi-BsiozhpM.js} +2 -2
- package/dist/chunks/{submissionsApi-BHPcbZrP.js.map → submissionsApi-BsiozhpM.js.map} +1 -1
- package/dist/index.js +1 -1
- package/dist/room-chrome.js +258 -256
- package/dist/room-chrome.js.map +1 -1
- package/package.json +2 -2
- package/dist/chunks/index-D8nwgvG0.js.map +0 -1
|
@@ -4801,10 +4801,10 @@ const so = (e) => {
|
|
|
4801
4801
|
function va(e) {
|
|
4802
4802
|
return typeof e == "string" && ya.test(e);
|
|
4803
4803
|
}
|
|
4804
|
-
const Jr = 8080, ei = 5173,
|
|
4804
|
+
const Jr = 8080, ei = 5173, em = 80, hu = "/watchparty/ws", tm = 10, mu = 500, rm = 1e3, ti = 4, nm = 3e3, ba = typeof process < "u" && process.env ? process.env : {};
|
|
4805
4805
|
ba.PRODUCTION_UI_URL;
|
|
4806
4806
|
ba.PRODUCTION_SERVER_URL;
|
|
4807
|
-
const Pr = l.enum(["S", "A", "B", "C", "D", "F"]),
|
|
4807
|
+
const Pr = l.enum(["S", "A", "B", "C", "D", "F"]), im = ["S", "A", "B", "C", "D", "F"], lo = 2e4, pu = 300;
|
|
4808
4808
|
l.object({
|
|
4809
4809
|
name: l.string().min(1).max(32).optional(),
|
|
4810
4810
|
sprite: l.string().min(1).max(32).optional()
|
|
@@ -5303,10 +5303,14 @@ const Ra = [
|
|
|
5303
5303
|
]
|
|
5304
5304
|
}
|
|
5305
5305
|
], co = 8, ii = Ra.flatMap((e) => e.characters), Ae = ii.map((e) => e.id), ku = Object.fromEntries(ii.map((e) => [e.id, e.color])), Pu = Object.fromEntries(ii.map((e) => [e.id, "rev" in e ? e.rev : 1]));
|
|
5306
|
+
function Ou(e) {
|
|
5307
|
+
const t = Pu[e];
|
|
5308
|
+
return `/media/sprites/square_${e}.png${t > 1 ? `?v=${t}` : ""}`;
|
|
5309
|
+
}
|
|
5306
5310
|
function Ta(e) {
|
|
5307
5311
|
return !!e && Ae.includes(e);
|
|
5308
5312
|
}
|
|
5309
|
-
function
|
|
5313
|
+
function om(e) {
|
|
5310
5314
|
const t = new Set(e);
|
|
5311
5315
|
let r = 0;
|
|
5312
5316
|
return () => {
|
|
@@ -5321,29 +5325,29 @@ function im(e) {
|
|
|
5321
5325
|
return n || (n = Ae[r], r = (r + 1) % Ae.length), t.add(n), n;
|
|
5322
5326
|
};
|
|
5323
5327
|
}
|
|
5324
|
-
const
|
|
5325
|
-
function
|
|
5326
|
-
return typeof e == "string" &&
|
|
5328
|
+
const am = 4, sm = 3e4, lm = 5e3, cm = 2e3, um = 5e3, dm = 2e3, fm = 5e3, hm = 2e3, mm = 1e4, pm = 10, gm = 2e3, ym = 3, vm = 50, bm = 3, wm = 3e4, _m = 2e4, Em = 99999, Iu = 5e3, Lu = "output_frag.mp4", uo = "/healthz", Ca = { mode: "off", percent: 0 }, Mu = ["off", "on", "ab"];
|
|
5329
|
+
function Du(e) {
|
|
5330
|
+
return typeof e == "string" && Mu.includes(e);
|
|
5327
5331
|
}
|
|
5328
5332
|
function Aa(e) {
|
|
5329
|
-
const t = e && typeof e == "object" ? e : {}, r =
|
|
5333
|
+
const t = e && typeof e == "object" ? e : {}, r = Du(t.mode) ? t.mode : Ca.mode, n = Number(t.percent), i = Number.isFinite(n) ? Math.min(100, Math.max(0, Math.round(n))) : 0;
|
|
5330
5334
|
return { mode: r, percent: i };
|
|
5331
5335
|
}
|
|
5332
|
-
function
|
|
5336
|
+
function Nu(e) {
|
|
5333
5337
|
let t = 2166136261;
|
|
5334
5338
|
for (let r = 0; r < e.length; r++)
|
|
5335
5339
|
t ^= e.charCodeAt(r), t = Math.imul(t, 16777619) >>> 0;
|
|
5336
5340
|
return t >>> 0;
|
|
5337
5341
|
}
|
|
5338
|
-
function
|
|
5342
|
+
function Fu(e, t, r) {
|
|
5339
5343
|
if (r === !0)
|
|
5340
5344
|
return "fragment";
|
|
5341
5345
|
if (r === !1)
|
|
5342
5346
|
return "range";
|
|
5343
5347
|
const n = Aa(e);
|
|
5344
|
-
return n.mode === "on" ? "fragment" : n.mode === "off" || n.percent <= 0 ? "range" : n.percent >= 100 || t &&
|
|
5348
|
+
return n.mode === "on" ? "fragment" : n.mode === "off" || n.percent <= 0 ? "range" : n.percent >= 100 || t && Nu(t) % 100 < n.percent ? "fragment" : "range";
|
|
5345
5349
|
}
|
|
5346
|
-
const xa = l.enum(["url", "magnet", "upload"]),
|
|
5350
|
+
const xa = l.enum(["url", "magnet", "upload"]), Uu = l.enum([
|
|
5347
5351
|
"pending",
|
|
5348
5352
|
"approved",
|
|
5349
5353
|
"fetching",
|
|
@@ -5361,7 +5365,7 @@ const xa = l.enum(["url", "magnet", "upload"]), Fu = l.enum([
|
|
|
5361
5365
|
failed: ["approved"]
|
|
5362
5366
|
};
|
|
5363
5367
|
Object.keys(fo).filter((e) => fo[e].length === 0);
|
|
5364
|
-
const
|
|
5368
|
+
const Bu = l.object({
|
|
5365
5369
|
id: l.string().min(1),
|
|
5366
5370
|
/** Stable userId from whoami. Never the raw `X-User-Key`. */
|
|
5367
5371
|
ownerUserId: l.string().min(1),
|
|
@@ -5380,7 +5384,7 @@ const Uu = l.object({
|
|
|
5380
5384
|
* misroute the copy.
|
|
5381
5385
|
*/
|
|
5382
5386
|
series: l.string().optional(),
|
|
5383
|
-
state:
|
|
5387
|
+
state: Uu,
|
|
5384
5388
|
createdAt: l.number().int().nonnegative(),
|
|
5385
5389
|
updatedAt: l.number().int().nonnegative(),
|
|
5386
5390
|
/** Why it failed, or why an operator rejected it. */
|
|
@@ -5388,19 +5392,19 @@ const Uu = l.object({
|
|
|
5388
5392
|
/** Size once known. 0 means "known to be empty"; absent means "not yet known" —
|
|
5389
5393
|
* the same distinction `chatImages` draws for image dimensions. */
|
|
5390
5394
|
bytes: l.number().int().nonnegative().optional()
|
|
5391
|
-
}),
|
|
5395
|
+
}), ju = 4096, ka = 300, $u = 100;
|
|
5392
5396
|
l.object({
|
|
5393
5397
|
kind: xa,
|
|
5394
|
-
source: l.string().min(1).max(
|
|
5398
|
+
source: l.string().min(1).max(ju),
|
|
5395
5399
|
title: l.string().min(1).max(ka).optional(),
|
|
5396
5400
|
/** Required for `kind: 'magnet'` by `checkSource`; ignored for `url`/`upload`. */
|
|
5397
|
-
series: l.string().min(1).max(
|
|
5401
|
+
series: l.string().min(1).max($u).optional()
|
|
5398
5402
|
});
|
|
5399
5403
|
l.object({
|
|
5400
5404
|
reason: l.string().min(1).max(ka).optional()
|
|
5401
5405
|
});
|
|
5402
5406
|
l.object({
|
|
5403
|
-
submissions: l.array(
|
|
5407
|
+
submissions: l.array(Bu)
|
|
5404
5408
|
});
|
|
5405
5409
|
l.object({
|
|
5406
5410
|
error: l.literal("submissions/quota_exceeded"),
|
|
@@ -5409,8 +5413,8 @@ l.object({
|
|
|
5409
5413
|
/** The cap that was applied, from the server's config. */
|
|
5410
5414
|
capBytes: l.number().int().nonnegative()
|
|
5411
5415
|
});
|
|
5412
|
-
const
|
|
5413
|
-
function
|
|
5416
|
+
const Hu = /^[a-z0-9][a-z0-9-]{0,31}$/, ho = "https://game-catalog.invalid";
|
|
5417
|
+
function zu(e) {
|
|
5414
5418
|
if (!e.startsWith("/") || e.startsWith("//") || /[\\\s]/.test(e) || [...e].some((t) => t.charCodeAt(0) < 32 || t.charCodeAt(0) === 127))
|
|
5415
5419
|
return !1;
|
|
5416
5420
|
try {
|
|
@@ -5419,18 +5423,18 @@ function Hu(e) {
|
|
|
5419
5423
|
return !1;
|
|
5420
5424
|
}
|
|
5421
5425
|
}
|
|
5422
|
-
const Pa = l.string().min(2).max(512).refine(
|
|
5426
|
+
const Pa = l.string().min(2).max(512).refine(zu, {
|
|
5423
5427
|
message: "must be a root-relative path on the page origin (e.g. /cardtable/embed/x.js)"
|
|
5424
5428
|
}), mo = {
|
|
5425
|
-
id: l.string().regex(
|
|
5429
|
+
id: l.string().regex(Hu),
|
|
5426
5430
|
name: l.string().min(1).max(64),
|
|
5427
5431
|
cover: Pa.optional()
|
|
5428
|
-
},
|
|
5432
|
+
}, Vu = l.discriminatedUnion("kind", [
|
|
5429
5433
|
l.object({ ...mo, kind: l.literal("iframe") }).strict(),
|
|
5430
5434
|
l.object({ ...mo, kind: l.literal("module"), url: Pa }).strict()
|
|
5431
|
-
]),
|
|
5435
|
+
]), qu = l.array(Vu).max(32).refine((e) => new Set(e.map((t) => t.id)).size === e.length, { message: "game ids must be unique" }), Wu = [
|
|
5432
5436
|
{ id: "bomberman", name: "Bomberman", kind: "iframe" }
|
|
5433
|
-
], oi = l.enum(["anilist", "tmdb"]),
|
|
5437
|
+
], oi = l.enum(["anilist", "tmdb"]), Ku = l.object({
|
|
5434
5438
|
source: oi,
|
|
5435
5439
|
/** The provider's own id, as a string (AniList and TMDB both use integers). */
|
|
5436
5440
|
id: l.string(),
|
|
@@ -5452,11 +5456,11 @@ const Pa = l.string().min(2).max(512).refine(Hu, {
|
|
|
5452
5456
|
addable: l.boolean()
|
|
5453
5457
|
});
|
|
5454
5458
|
l.object({
|
|
5455
|
-
results: l.array(
|
|
5459
|
+
results: l.array(Ku),
|
|
5456
5460
|
/** Providers that answered. TMDB is absent when no token is configured. */
|
|
5457
5461
|
sources: l.array(oi)
|
|
5458
5462
|
});
|
|
5459
|
-
const
|
|
5463
|
+
const Gu = l.object({
|
|
5460
5464
|
id: l.string(),
|
|
5461
5465
|
url: l.string(),
|
|
5462
5466
|
title: l.string(),
|
|
@@ -5464,29 +5468,29 @@ const Ku = l.object({
|
|
|
5464
5468
|
durationS: l.number().nullable(),
|
|
5465
5469
|
thumb: l.string().nullable()
|
|
5466
5470
|
});
|
|
5467
|
-
l.object({ results: l.array(
|
|
5471
|
+
l.object({ results: l.array(Gu) });
|
|
5468
5472
|
l.object({
|
|
5469
5473
|
source: oi,
|
|
5470
5474
|
id: l.string().regex(/^\d{1,12}$/)
|
|
5471
5475
|
});
|
|
5472
5476
|
l.object({ series: l.string(), title: l.string() });
|
|
5473
|
-
const
|
|
5477
|
+
const Sm = 2, Rm = 100;
|
|
5474
5478
|
var vn = {
|
|
5475
5479
|
image: 10 * 1024 * 1024,
|
|
5476
5480
|
audio: 50 * 1024 * 1024
|
|
5477
|
-
},
|
|
5481
|
+
}, Yu = [
|
|
5478
5482
|
"image/png",
|
|
5479
5483
|
"image/jpeg",
|
|
5480
5484
|
"image/gif",
|
|
5481
5485
|
"image/webp",
|
|
5482
5486
|
"image/avif"
|
|
5483
|
-
],
|
|
5487
|
+
], Ju = [
|
|
5484
5488
|
"audio/mpeg",
|
|
5485
5489
|
"audio/flac",
|
|
5486
5490
|
"audio/ogg",
|
|
5487
5491
|
"audio/mp4",
|
|
5488
5492
|
"audio/wav"
|
|
5489
|
-
],
|
|
5493
|
+
], Xu = {
|
|
5490
5494
|
"audio/mp3": "audio/mpeg",
|
|
5491
5495
|
"audio/x-mp3": "audio/mpeg",
|
|
5492
5496
|
"audio/x-mpeg": "audio/mpeg",
|
|
@@ -5500,9 +5504,9 @@ var vn = {
|
|
|
5500
5504
|
};
|
|
5501
5505
|
function Oa(e) {
|
|
5502
5506
|
const t = e.toLowerCase();
|
|
5503
|
-
return
|
|
5507
|
+
return Yu.includes(t) ? "image" : Ju.includes(t) || t in Xu ? "audio" : null;
|
|
5504
5508
|
}
|
|
5505
|
-
var
|
|
5509
|
+
var Qu = 24, Tm = 250, Kt = class extends Error {
|
|
5506
5510
|
reason;
|
|
5507
5511
|
/** HTTP status, when there was a response. */
|
|
5508
5512
|
status;
|
|
@@ -5519,7 +5523,7 @@ var Xu = 24, Rm = 250, Kt = class extends Error {
|
|
|
5519
5523
|
super(t), this.name = "CdnError", this.reason = e, this.status = r, this.retryAfterSeconds = n;
|
|
5520
5524
|
}
|
|
5521
5525
|
};
|
|
5522
|
-
function
|
|
5526
|
+
function Zu(e, t = Date.now()) {
|
|
5523
5527
|
if (!e) return null;
|
|
5524
5528
|
const r = e.trim();
|
|
5525
5529
|
if (!r) return null;
|
|
@@ -5528,7 +5532,7 @@ function Qu(e, t = Date.now()) {
|
|
|
5528
5532
|
const i = Date.parse(r);
|
|
5529
5533
|
return Number.isNaN(i) ? null : Math.max(0, Math.ceil((i - t) / 1e3));
|
|
5530
5534
|
}
|
|
5531
|
-
function
|
|
5535
|
+
function ed(e) {
|
|
5532
5536
|
switch (e) {
|
|
5533
5537
|
case 401:
|
|
5534
5538
|
return "unauthenticated";
|
|
@@ -5551,8 +5555,8 @@ function Zu(e) {
|
|
|
5551
5555
|
return "unknown";
|
|
5552
5556
|
}
|
|
5553
5557
|
}
|
|
5554
|
-
async function
|
|
5555
|
-
const t =
|
|
5558
|
+
async function td(e) {
|
|
5559
|
+
const t = ed(e.status);
|
|
5556
5560
|
let r = `CDN request failed (${e.status})`;
|
|
5557
5561
|
try {
|
|
5558
5562
|
const n = await e.json();
|
|
@@ -5563,11 +5567,11 @@ async function ed(e) {
|
|
|
5563
5567
|
t,
|
|
5564
5568
|
r,
|
|
5565
5569
|
e.status,
|
|
5566
|
-
t === "rate-limited" ?
|
|
5570
|
+
t === "rate-limited" ? Zu(e.headers.get("Retry-After")) : null
|
|
5567
5571
|
);
|
|
5568
5572
|
}
|
|
5569
|
-
var
|
|
5570
|
-
function
|
|
5573
|
+
var rd = "/cdn/api/upload", nd = /^[0-9a-f]{64}\.[a-z0-9]{1,8}$/;
|
|
5574
|
+
function id(e) {
|
|
5571
5575
|
if (e.size === 0)
|
|
5572
5576
|
throw new Kt("invalid", "File is empty");
|
|
5573
5577
|
const t = e.type ? Oa(e.type) : null;
|
|
@@ -5577,7 +5581,7 @@ function nd(e) {
|
|
|
5577
5581
|
if (e.size > r)
|
|
5578
5582
|
throw new Kt("too-large", `File is ${e.size} bytes; the maximum is ${r}`);
|
|
5579
5583
|
}
|
|
5580
|
-
function
|
|
5584
|
+
function od(e) {
|
|
5581
5585
|
if (typeof e != "object" || e === null) return null;
|
|
5582
5586
|
const t = e;
|
|
5583
5587
|
return typeof t.key != "string" || !t.key ? null : {
|
|
@@ -5589,8 +5593,8 @@ function id(e) {
|
|
|
5589
5593
|
contentType: typeof t.contentType == "string" ? t.contentType : "image/*"
|
|
5590
5594
|
};
|
|
5591
5595
|
}
|
|
5592
|
-
function
|
|
5593
|
-
const t = e.cdnBase.replace(/\/+$/, ""), r = e.uploadPath ??
|
|
5596
|
+
function ad(e) {
|
|
5597
|
+
const t = e.cdnBase.replace(/\/+$/, ""), r = e.uploadPath ?? rd, n = e.fetch ?? globalThis.fetch.bind(globalThis);
|
|
5594
5598
|
async function i(o, a) {
|
|
5595
5599
|
let s;
|
|
5596
5600
|
try {
|
|
@@ -5598,14 +5602,14 @@ function od(e) {
|
|
|
5598
5602
|
} catch (c) {
|
|
5599
5603
|
throw c instanceof Error && c.name === "AbortError" ? c : new Kt("network", c instanceof Error ? c.message : "Request failed");
|
|
5600
5604
|
}
|
|
5601
|
-
if (!s.ok) throw await
|
|
5605
|
+
if (!s.ok) throw await td(s);
|
|
5602
5606
|
return s;
|
|
5603
5607
|
}
|
|
5604
5608
|
return {
|
|
5605
5609
|
cdnBase: t,
|
|
5606
5610
|
uploadPath: r,
|
|
5607
5611
|
async upload(o, a) {
|
|
5608
|
-
return
|
|
5612
|
+
return id(o), await (await i(r, {
|
|
5609
5613
|
method: "POST",
|
|
5610
5614
|
body: o,
|
|
5611
5615
|
signal: a?.signal,
|
|
@@ -5618,21 +5622,21 @@ function od(e) {
|
|
|
5618
5622
|
return `${t}/${o.replace(/^\/+/, "")}`;
|
|
5619
5623
|
},
|
|
5620
5624
|
isKey(o) {
|
|
5621
|
-
return
|
|
5625
|
+
return nd.test(o);
|
|
5622
5626
|
},
|
|
5623
5627
|
catalogue(o, a) {
|
|
5624
5628
|
const s = o.replace(/\/+$/, ""), c = a?.surface;
|
|
5625
5629
|
return {
|
|
5626
5630
|
async search(u = {}) {
|
|
5627
5631
|
const f = new URLSearchParams(), h = u.query?.trim();
|
|
5628
|
-
h && f.set("q", h), f.set("limit", String(u.limit ??
|
|
5632
|
+
h && f.set("q", h), f.set("limit", String(u.limit ?? Qu)), u.cursor && f.set("cursor", u.cursor);
|
|
5629
5633
|
const v = await (await i(`${s}?${f.toString()}`, {
|
|
5630
5634
|
method: "GET",
|
|
5631
5635
|
signal: u.signal,
|
|
5632
5636
|
credentials: "same-origin"
|
|
5633
5637
|
})).json();
|
|
5634
5638
|
return {
|
|
5635
|
-
results: (Array.isArray(v.results) ? v.results : []).map(
|
|
5639
|
+
results: (Array.isArray(v.results) ? v.results : []).map(od).filter((C) => C !== null),
|
|
5636
5640
|
next: typeof v.next == "string" && v.next ? v.next : null
|
|
5637
5641
|
};
|
|
5638
5642
|
},
|
|
@@ -5648,12 +5652,12 @@ function od(e) {
|
|
|
5648
5652
|
}
|
|
5649
5653
|
};
|
|
5650
5654
|
}
|
|
5651
|
-
function
|
|
5655
|
+
function Cm(e, t = ["image"]) {
|
|
5652
5656
|
if (!e) return [];
|
|
5653
5657
|
const r = (o) => Ia(o, t), n = e.files ? Array.from(e.files) : [];
|
|
5654
5658
|
return n.length > 0 ? n.filter(r) : (e.items ? Array.from(e.items) : []).filter((o) => o.kind === "file").map((o) => o.getAsFile()).filter((o) => o !== null).filter(r);
|
|
5655
5659
|
}
|
|
5656
|
-
function
|
|
5660
|
+
function Am(e, t = ["image"]) {
|
|
5657
5661
|
return e?.files ? Array.from(e.files).filter((r) => Ia(r, t)) : [];
|
|
5658
5662
|
}
|
|
5659
5663
|
function Ia(e, t) {
|
|
@@ -5661,7 +5665,7 @@ function Ia(e, t) {
|
|
|
5661
5665
|
const r = Oa(e.type);
|
|
5662
5666
|
return r !== null && t.includes(r);
|
|
5663
5667
|
}
|
|
5664
|
-
async function
|
|
5668
|
+
async function xm(e) {
|
|
5665
5669
|
const t = globalThis.createImageBitmap;
|
|
5666
5670
|
if (typeof t != "function") return null;
|
|
5667
5671
|
try {
|
|
@@ -5672,18 +5676,18 @@ async function Am(e) {
|
|
|
5672
5676
|
}
|
|
5673
5677
|
}
|
|
5674
5678
|
let wr = null, La = ga;
|
|
5675
|
-
function
|
|
5679
|
+
function sd(e) {
|
|
5676
5680
|
e.cdnBase && (La = e.cdnBase);
|
|
5677
5681
|
}
|
|
5678
5682
|
function Ma() {
|
|
5679
5683
|
return La.replace(/\/+$/, "");
|
|
5680
5684
|
}
|
|
5681
|
-
function
|
|
5685
|
+
function ld() {
|
|
5682
5686
|
const e = Ma();
|
|
5683
|
-
return (!wr || wr.base !== e) && (wr = { base: e, client:
|
|
5687
|
+
return (!wr || wr.base !== e) && (wr = { base: e, client: ad({ cdnBase: e }) }), wr.client;
|
|
5684
5688
|
}
|
|
5685
|
-
function
|
|
5686
|
-
return !va(e) || !Ma() ? null :
|
|
5689
|
+
function km(e) {
|
|
5690
|
+
return !va(e) || !Ma() ? null : ld().urlFor(e);
|
|
5687
5691
|
}
|
|
5688
5692
|
const Gt = {
|
|
5689
5693
|
serverOrigin: `http://localhost:${Jr}`,
|
|
@@ -5691,17 +5695,17 @@ const Gt = {
|
|
|
5691
5695
|
cdnBase: ga
|
|
5692
5696
|
};
|
|
5693
5697
|
let Or = { ...Gt };
|
|
5694
|
-
function
|
|
5698
|
+
function cd(e) {
|
|
5695
5699
|
const t = Object.fromEntries(
|
|
5696
5700
|
Object.entries(e).filter(([r, n]) => n !== void 0)
|
|
5697
5701
|
);
|
|
5698
|
-
Or = { ...Or, ...t },
|
|
5702
|
+
Or = { ...Or, ...t }, sd({ cdnBase: Or.cdnBase });
|
|
5699
5703
|
}
|
|
5700
5704
|
function kt() {
|
|
5701
5705
|
return Or;
|
|
5702
5706
|
}
|
|
5703
5707
|
const Da = As(Gt);
|
|
5704
|
-
function
|
|
5708
|
+
function ud() {
|
|
5705
5709
|
return xs(Da);
|
|
5706
5710
|
}
|
|
5707
5711
|
function On(e) {
|
|
@@ -5738,7 +5742,7 @@ function ai(e, t) {
|
|
|
5738
5742
|
return !1;
|
|
5739
5743
|
}
|
|
5740
5744
|
}
|
|
5741
|
-
function
|
|
5745
|
+
function dd() {
|
|
5742
5746
|
try {
|
|
5743
5747
|
const e = Qr();
|
|
5744
5748
|
if (!e) return [];
|
|
@@ -5758,7 +5762,7 @@ function zr(e) {
|
|
|
5758
5762
|
} catch {
|
|
5759
5763
|
}
|
|
5760
5764
|
}
|
|
5761
|
-
function
|
|
5765
|
+
function fd(e) {
|
|
5762
5766
|
const t = Ne(e);
|
|
5763
5767
|
return t === null ? null : t === "true" ? !0 : t === "false" ? !1 : null;
|
|
5764
5768
|
}
|
|
@@ -5767,16 +5771,16 @@ let Fa = !1;
|
|
|
5767
5771
|
function Zr(e, t) {
|
|
5768
5772
|
Na.set(e, t), Fa && Ua(e, t);
|
|
5769
5773
|
}
|
|
5770
|
-
function
|
|
5774
|
+
function hd() {
|
|
5771
5775
|
Fa = !0;
|
|
5772
5776
|
for (const [e, t] of Na) Ua(e, t);
|
|
5773
5777
|
}
|
|
5774
5778
|
function Ua(e, t) {
|
|
5775
5779
|
typeof window > "u" || (window[e] = t);
|
|
5776
5780
|
}
|
|
5777
|
-
const Yt = [],
|
|
5781
|
+
const Yt = [], md = 500;
|
|
5778
5782
|
let Ir = [], In = null;
|
|
5779
|
-
const
|
|
5783
|
+
const pd = 1e3, gd = 200;
|
|
5780
5784
|
let er = null;
|
|
5781
5785
|
function Ba(e) {
|
|
5782
5786
|
er = e;
|
|
@@ -5790,13 +5794,13 @@ function Ln() {
|
|
|
5790
5794
|
const t = Ne(Pt.DEBUG_FLAG);
|
|
5791
5795
|
return t !== null && t !== "false";
|
|
5792
5796
|
}
|
|
5793
|
-
function
|
|
5797
|
+
function yd() {
|
|
5794
5798
|
const e = Ne(Pt.DEBUG_FLAG);
|
|
5795
5799
|
if (!e || e === "true") return null;
|
|
5796
5800
|
const t = e.split(",").map((r) => r.trim().toLowerCase()).filter(Boolean);
|
|
5797
5801
|
return t.length > 0 ? new Set(t) : null;
|
|
5798
5802
|
}
|
|
5799
|
-
function
|
|
5803
|
+
function vd() {
|
|
5800
5804
|
return (/* @__PURE__ */ new Date()).toLocaleTimeString("en-US", {
|
|
5801
5805
|
hour12: !1,
|
|
5802
5806
|
hour: "2-digit",
|
|
@@ -5805,8 +5809,8 @@ function yd() {
|
|
|
5805
5809
|
fractionalSecondDigits: 3
|
|
5806
5810
|
});
|
|
5807
5811
|
}
|
|
5808
|
-
function
|
|
5809
|
-
Yt.push(e), Yt.length >
|
|
5812
|
+
function bd(e) {
|
|
5813
|
+
Yt.push(e), Yt.length > md && Yt.shift();
|
|
5810
5814
|
}
|
|
5811
5815
|
const bn = {
|
|
5812
5816
|
debug: "color: #64748b; font-weight: normal;",
|
|
@@ -5815,7 +5819,7 @@ const bn = {
|
|
|
5815
5819
|
category: "color: #3b82f6; font-weight: bold;",
|
|
5816
5820
|
time: "color: #6b7280; font-weight: normal;"
|
|
5817
5821
|
};
|
|
5818
|
-
function
|
|
5822
|
+
function wd(e) {
|
|
5819
5823
|
try {
|
|
5820
5824
|
return JSON.stringify(e);
|
|
5821
5825
|
} catch {
|
|
@@ -5830,12 +5834,12 @@ function si(e, t, r, n, i, o, a) {
|
|
|
5830
5834
|
data: a,
|
|
5831
5835
|
timestamp: Date.now()
|
|
5832
5836
|
};
|
|
5833
|
-
if (
|
|
5837
|
+
if (bd(s), (r || ja()) && po(s), !n) {
|
|
5834
5838
|
if (!Ln()) return;
|
|
5835
|
-
const f =
|
|
5839
|
+
const f = yd();
|
|
5836
5840
|
if (f && !f.has(i.toLowerCase())) return;
|
|
5837
5841
|
}
|
|
5838
|
-
const c =
|
|
5842
|
+
const c = vd(), u = a !== void 0 ? " " + wd(a) : "";
|
|
5839
5843
|
t(
|
|
5840
5844
|
`%c[${c}]%c [${i}]%c ${o}${u}`,
|
|
5841
5845
|
bn.time,
|
|
@@ -5852,25 +5856,25 @@ function ie(e, t, r) {
|
|
|
5852
5856
|
function Ze(e, t, r) {
|
|
5853
5857
|
si("error", console.error, !0, !0, e, t, r);
|
|
5854
5858
|
}
|
|
5855
|
-
function
|
|
5859
|
+
function _d() {
|
|
5856
5860
|
return [...Yt];
|
|
5857
5861
|
}
|
|
5858
|
-
function
|
|
5862
|
+
function Ed() {
|
|
5859
5863
|
Yt.length = 0;
|
|
5860
5864
|
}
|
|
5861
|
-
function
|
|
5865
|
+
function Sd(e) {
|
|
5862
5866
|
const t = e && e.length > 0 ? e.join(",") : "true";
|
|
5863
5867
|
ai(Pt.DEBUG_FLAG, t), console.log("[wp] Debug mode enabled");
|
|
5864
5868
|
}
|
|
5865
|
-
function
|
|
5869
|
+
function Rd() {
|
|
5866
5870
|
zr(Pt.DEBUG_FLAG), console.log("[wp] Debug mode disabled");
|
|
5867
5871
|
}
|
|
5868
|
-
const
|
|
5872
|
+
const Td = 1024, Cd = 5e4;
|
|
5869
5873
|
function $a(e) {
|
|
5870
5874
|
if (e == null) return e;
|
|
5871
5875
|
try {
|
|
5872
5876
|
const t = JSON.stringify(e);
|
|
5873
|
-
if (t.length <=
|
|
5877
|
+
if (t.length <= Td) return e;
|
|
5874
5878
|
if (typeof e == "object" && !Array.isArray(e)) {
|
|
5875
5879
|
const r = {};
|
|
5876
5880
|
for (const [n, i] of Object.entries(e)) {
|
|
@@ -5884,7 +5888,7 @@ function $a(e) {
|
|
|
5884
5888
|
return "[unserializable]";
|
|
5885
5889
|
}
|
|
5886
5890
|
}
|
|
5887
|
-
function
|
|
5891
|
+
function Pm(e, t, r, n) {
|
|
5888
5892
|
try {
|
|
5889
5893
|
console.warn(`[${t}] ${r}`, n ?? "");
|
|
5890
5894
|
} catch {
|
|
@@ -5911,7 +5915,7 @@ function km(e, t, r, n) {
|
|
|
5911
5915
|
} catch {
|
|
5912
5916
|
}
|
|
5913
5917
|
}
|
|
5914
|
-
async function
|
|
5918
|
+
async function Ad() {
|
|
5915
5919
|
if (Ir.length === 0) return;
|
|
5916
5920
|
const e = Ir;
|
|
5917
5921
|
Ir = [], In = null;
|
|
@@ -5935,7 +5939,7 @@ async function Cd() {
|
|
|
5935
5939
|
let o = [], a = 0;
|
|
5936
5940
|
for (const s of i) {
|
|
5937
5941
|
const c = JSON.stringify(s).length + 1;
|
|
5938
|
-
a + c >
|
|
5942
|
+
a + c > Cd && o.length > 0 && (await fetch(n, {
|
|
5939
5943
|
method: "POST",
|
|
5940
5944
|
headers: { "Content-Type": "application/json" },
|
|
5941
5945
|
body: JSON.stringify({ logs: o })
|
|
@@ -5952,20 +5956,20 @@ async function Cd() {
|
|
|
5952
5956
|
}
|
|
5953
5957
|
function po(e) {
|
|
5954
5958
|
if (Ir.push(e), !In) {
|
|
5955
|
-
const t = ja() ?
|
|
5956
|
-
In = setTimeout(
|
|
5959
|
+
const t = ja() ? gd : pd;
|
|
5960
|
+
In = setTimeout(Ad, t);
|
|
5957
5961
|
}
|
|
5958
5962
|
}
|
|
5959
5963
|
function vt(e) {
|
|
5960
5964
|
return e instanceof Error ? { error: e.message, name: e.name } : { error: String(e), name: typeof e };
|
|
5961
5965
|
}
|
|
5962
5966
|
Zr("__wpDebug", {
|
|
5963
|
-
enable:
|
|
5964
|
-
disable:
|
|
5965
|
-
history:
|
|
5966
|
-
clear:
|
|
5967
|
+
enable: Sd,
|
|
5968
|
+
disable: Rd,
|
|
5969
|
+
history: _d,
|
|
5970
|
+
clear: Ed
|
|
5967
5971
|
});
|
|
5968
|
-
function
|
|
5972
|
+
function Om() {
|
|
5969
5973
|
return Ra.flatMap((e) => {
|
|
5970
5974
|
const t = e.characters.map((n) => n.id), r = [];
|
|
5971
5975
|
for (let n = 0; n < t.length; n += co)
|
|
@@ -5973,20 +5977,18 @@ function Pm() {
|
|
|
5973
5977
|
return r;
|
|
5974
5978
|
});
|
|
5975
5979
|
}
|
|
5976
|
-
function
|
|
5980
|
+
function Im(e, t) {
|
|
5977
5981
|
const r = e.findIndex((n) => n.some((i) => i === t));
|
|
5978
5982
|
return r < 0 ? 0 : r;
|
|
5979
5983
|
}
|
|
5980
|
-
function
|
|
5984
|
+
function xd(e) {
|
|
5981
5985
|
return Ta(e) ? ku[e] : "var(--color-neutral-bg)";
|
|
5982
5986
|
}
|
|
5983
5987
|
function Ha(e) {
|
|
5984
|
-
|
|
5985
|
-
const t = kt().serverOrigin.replace(/\/$/, ""), r = Pu[e];
|
|
5986
|
-
return `${t}/media/sprites/square_${e}.png${r > 1 ? `?v=${r}` : ""}`;
|
|
5988
|
+
return Ta(e) ? `${kt().serverOrigin.replace(/\/$/, "")}${Ou(e)}` : void 0;
|
|
5987
5989
|
}
|
|
5988
5990
|
let tr = null, _r = null;
|
|
5989
|
-
function
|
|
5991
|
+
function kd() {
|
|
5990
5992
|
return tr ? Promise.resolve() : _r || (_r = (async () => {
|
|
5991
5993
|
try {
|
|
5992
5994
|
const e = kt().serverOrigin.replace(/\/$/, ""), t = await fetch(`${e}/media/sprites/names.json`, { cache: "no-cache" });
|
|
@@ -6014,7 +6016,7 @@ const _e = {
|
|
|
6014
6016
|
function en() {
|
|
6015
6017
|
return _e.accountId ? _e.accountId : _e.resolved && _e.userType === "public" ? "anon" : null;
|
|
6016
6018
|
}
|
|
6017
|
-
function
|
|
6019
|
+
function Pd(e) {
|
|
6018
6020
|
_e.resolved = !0, e.userType && (_e.userType = e.userType), e.userId !== void 0 && (_e.accountId = e.userId && e.userId !== "public" ? e.userId : null);
|
|
6019
6021
|
}
|
|
6020
6022
|
function go() {
|
|
@@ -6027,19 +6029,19 @@ const yo = {
|
|
|
6027
6029
|
wife: 3,
|
|
6028
6030
|
admin: 4
|
|
6029
6031
|
};
|
|
6030
|
-
function
|
|
6032
|
+
function Od(e, t) {
|
|
6031
6033
|
return (yo[e] ?? -1) >= yo[t];
|
|
6032
6034
|
}
|
|
6033
|
-
function
|
|
6034
|
-
return
|
|
6035
|
+
function Lm() {
|
|
6036
|
+
return Od(_e.userType, "service");
|
|
6035
6037
|
}
|
|
6036
6038
|
function tn() {
|
|
6037
6039
|
return _e.accountId ?? "public";
|
|
6038
6040
|
}
|
|
6039
|
-
function
|
|
6041
|
+
function Id() {
|
|
6040
6042
|
return en() ?? "unscoped";
|
|
6041
6043
|
}
|
|
6042
|
-
async function
|
|
6044
|
+
async function Ld() {
|
|
6043
6045
|
if (_e.userType === "public") return null;
|
|
6044
6046
|
if (_e.name) return _e.name;
|
|
6045
6047
|
try {
|
|
@@ -6056,7 +6058,7 @@ async function Id() {
|
|
|
6056
6058
|
}
|
|
6057
6059
|
return null;
|
|
6058
6060
|
}
|
|
6059
|
-
const
|
|
6061
|
+
const Md = l.object({
|
|
6060
6062
|
// Identity. There is deliberately NO `name`: a person's name is their
|
|
6061
6063
|
// hadoku key-registry name, resolved by the server from whoami and renamed
|
|
6062
6064
|
// through hadoku_site's POST /session/name (operator decision 2026-10-08).
|
|
@@ -6077,13 +6079,13 @@ const Ld = l.object({
|
|
|
6077
6079
|
subtitleStyle: l.string().optional()
|
|
6078
6080
|
}), Jt = Ds({
|
|
6079
6081
|
appId: "watchparty",
|
|
6080
|
-
schema:
|
|
6081
|
-
}),
|
|
6082
|
+
schema: Md
|
|
6083
|
+
}), Dd = /* @__PURE__ */ new Set(["theme", "themeMode"]);
|
|
6082
6084
|
function qr(e) {
|
|
6083
6085
|
const t = en();
|
|
6084
6086
|
return t ? `prefs-cache:${t}:${e}` : null;
|
|
6085
6087
|
}
|
|
6086
|
-
function
|
|
6088
|
+
function Nd() {
|
|
6087
6089
|
return en() === null;
|
|
6088
6090
|
}
|
|
6089
6091
|
function vo(e) {
|
|
@@ -6097,9 +6099,9 @@ function vo(e) {
|
|
|
6097
6099
|
return {};
|
|
6098
6100
|
}
|
|
6099
6101
|
}
|
|
6100
|
-
function
|
|
6102
|
+
function Fd() {
|
|
6101
6103
|
let e = 0;
|
|
6102
|
-
for (const t of
|
|
6104
|
+
for (const t of dd()) {
|
|
6103
6105
|
const r = t.startsWith("prefs-cache:") && t.endsWith(":watchparty"), n = t === Wr || t.startsWith(`${Wr}:`) && !t.endsWith(":_serverSynced_v1");
|
|
6104
6106
|
if (!r && !n) continue;
|
|
6105
6107
|
const i = Ne(t);
|
|
@@ -6120,7 +6122,7 @@ function Nd() {
|
|
|
6120
6122
|
let za = null, Va = null;
|
|
6121
6123
|
const bo = /* @__PURE__ */ new Set();
|
|
6122
6124
|
function li() {
|
|
6123
|
-
if (
|
|
6125
|
+
if (Nd())
|
|
6124
6126
|
return T("preferences", "Boot read deferred — session pending, identity unresolved"), {};
|
|
6125
6127
|
const e = vo("portfolio"), t = vo("watchparty"), r = Object.keys(e).length > 0 ? e : za ?? {}, n = Object.keys(t).length > 0 ? t : Va ?? {}, i = tn() || "public";
|
|
6126
6128
|
if (bo.has(i))
|
|
@@ -6145,15 +6147,15 @@ function li() {
|
|
|
6145
6147
|
}), a;
|
|
6146
6148
|
}
|
|
6147
6149
|
let qa = !1;
|
|
6148
|
-
function
|
|
6150
|
+
function Ud() {
|
|
6149
6151
|
const e = tn();
|
|
6150
6152
|
return !e || e === "public";
|
|
6151
6153
|
}
|
|
6152
6154
|
function je(e, t) {
|
|
6153
|
-
|
|
6155
|
+
Ud() && (qa = !0), Dd.has(e) ? qt.save({ [e]: t }, { scope: "device" }).catch((r) => ie("preferences", "themePrefs.save failed", { key: e, err: r?.message })) : Jt.save({ [e]: t }).catch((r) => ie("preferences", "watchpartyPrefs.save failed", { key: e, err: r?.message })), T("preferences", "Saved (via SDK)", { key: e, value: t });
|
|
6154
6156
|
}
|
|
6155
6157
|
let Er = null, wo = !1;
|
|
6156
|
-
function
|
|
6158
|
+
function Bd() {
|
|
6157
6159
|
return Er || (Er = (async () => {
|
|
6158
6160
|
if (typeof window > "u") return !1;
|
|
6159
6161
|
try {
|
|
@@ -6181,7 +6183,7 @@ function Ud() {
|
|
|
6181
6183
|
// Post-fetch cache state: should be non-zero if SDK wrote it.
|
|
6182
6184
|
sdkThemeBytesPost: i?.length ?? 0,
|
|
6183
6185
|
sdkAppBytesPost: o?.length ?? 0
|
|
6184
|
-
}), await
|
|
6186
|
+
}), await jd(e, t), qa ? (T("preferences", "Promoting this load's pre-auth picks to the signed-in user"), await Promise.all([
|
|
6185
6187
|
qt.promoteAnonPrefsToUser().catch(() => {
|
|
6186
6188
|
}),
|
|
6187
6189
|
Jt.promoteAnonPrefsToUser().catch(() => {
|
|
@@ -6193,7 +6195,7 @@ function Ud() {
|
|
|
6193
6195
|
})(), Er);
|
|
6194
6196
|
}
|
|
6195
6197
|
const Wr = "watchparty_preferences";
|
|
6196
|
-
|
|
6198
|
+
Fd();
|
|
6197
6199
|
function Mn() {
|
|
6198
6200
|
const e = tn();
|
|
6199
6201
|
return !e || e === "public" ? Wr : `${Wr}:${e}`;
|
|
@@ -6211,7 +6213,7 @@ function Wa() {
|
|
|
6211
6213
|
function _o() {
|
|
6212
6214
|
zr(Mn()), zr(`${Mn()}:_serverSynced_v1`);
|
|
6213
6215
|
}
|
|
6214
|
-
async function
|
|
6216
|
+
async function jd(e, t) {
|
|
6215
6217
|
const r = Wa();
|
|
6216
6218
|
if (!r || Object.keys(r).length === 0) return;
|
|
6217
6219
|
const n = Object.keys(e ?? {}).length > 0, i = Object.keys(t ?? {}).length > 0, o = {}, a = {};
|
|
@@ -6268,10 +6270,10 @@ function Ro(e) {
|
|
|
6268
6270
|
}
|
|
6269
6271
|
}).catch((t) => ie("preferences", "store import failed", { reason: e, err: t?.message }));
|
|
6270
6272
|
}
|
|
6271
|
-
const Ka = 320, To = 240,
|
|
6273
|
+
const Ka = 320, To = 240, $d = 640;
|
|
6272
6274
|
function wn(e, t) {
|
|
6273
6275
|
if (!Number.isFinite(e)) return Ka;
|
|
6274
|
-
let r =
|
|
6276
|
+
let r = $d;
|
|
6275
6277
|
return r = Math.max(r, To), Math.round(Math.min(r, Math.max(To, e)));
|
|
6276
6278
|
}
|
|
6277
6279
|
const $e = li(), B = fu((e, t) => ({
|
|
@@ -6517,7 +6519,7 @@ const Ga = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
6517
6519
|
__proto__: null,
|
|
6518
6520
|
useAppStore: B
|
|
6519
6521
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
6520
|
-
function
|
|
6522
|
+
function Hd({ className: e = "fixed bottom-4 left-1/2 -translate-x-1/2" }) {
|
|
6521
6523
|
const t = B((n) => n.toasts), r = B((n) => n.popToast);
|
|
6522
6524
|
return St(() => {
|
|
6523
6525
|
const n = t.map((i) => setTimeout(() => r(i.id), 4e3));
|
|
@@ -6526,7 +6528,7 @@ function $d({ className: e = "fixed bottom-4 left-1/2 -translate-x-1/2" }) {
|
|
|
6526
6528
|
};
|
|
6527
6529
|
}, [t, r]), /* @__PURE__ */ U("div", { className: `${e} flex flex-col gap-2 z-50`, children: t.map((n) => /* @__PURE__ */ U("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)) });
|
|
6528
6530
|
}
|
|
6529
|
-
const
|
|
6531
|
+
const zd = 400;
|
|
6530
6532
|
function Ya() {
|
|
6531
6533
|
const e = Oi(null), t = Oi([]);
|
|
6532
6534
|
return St(() => {
|
|
@@ -6609,7 +6611,7 @@ function Ya() {
|
|
|
6609
6611
|
};
|
|
6610
6612
|
}
|
|
6611
6613
|
if (!t.current.length)
|
|
6612
|
-
for (let w = 0; w <
|
|
6614
|
+
for (let w = 0; w < zd; w++) t.current.push(c(void 0, void 0, !0, w));
|
|
6613
6615
|
let u, f = performance.now();
|
|
6614
6616
|
const h = 50;
|
|
6615
6617
|
function y(w, A, _, k) {
|
|
@@ -6727,21 +6729,21 @@ function Ya() {
|
|
|
6727
6729
|
}
|
|
6728
6730
|
);
|
|
6729
6731
|
}
|
|
6730
|
-
const
|
|
6731
|
-
function
|
|
6732
|
+
const Vd = "hadoku://library";
|
|
6733
|
+
function qd(e = typeof navigator < "u" ? navigator.userAgent : void 0) {
|
|
6732
6734
|
return e !== void 0 && /(^|\s)HadokuApp\/\S/.test(e);
|
|
6733
6735
|
}
|
|
6734
|
-
const
|
|
6736
|
+
const Wd = 5e3;
|
|
6735
6737
|
function Co(e) {
|
|
6736
6738
|
return e.slice().sort(
|
|
6737
6739
|
(t, r) => (r.users?.length ?? 0) - (t.users?.length ?? 0) || t.room_id.localeCompare(r.room_id)
|
|
6738
6740
|
);
|
|
6739
6741
|
}
|
|
6740
|
-
function
|
|
6742
|
+
function Kd(e) {
|
|
6741
6743
|
return e.room_id.split("-").map((t) => t.charAt(0).toUpperCase() + t.slice(1)).join(" ");
|
|
6742
6744
|
}
|
|
6743
|
-
function
|
|
6744
|
-
const t =
|
|
6745
|
+
function Gd({ user: e }) {
|
|
6746
|
+
const t = xd(e.sprite_id), r = Ha(e.sprite_id);
|
|
6745
6747
|
return /* @__PURE__ */ Le("span", { className: "relative -ml-2 first:ml-0 group/av", children: [
|
|
6746
6748
|
/* @__PURE__ */ U(
|
|
6747
6749
|
"span",
|
|
@@ -6769,7 +6771,7 @@ function Kd({ user: e }) {
|
|
|
6769
6771
|
)
|
|
6770
6772
|
] });
|
|
6771
6773
|
}
|
|
6772
|
-
function
|
|
6774
|
+
function Yd({ room: e }) {
|
|
6773
6775
|
const t = e.users ?? [], r = t.length;
|
|
6774
6776
|
return /* @__PURE__ */ Le("li", { className: "flex items-stretch gap-2", children: [
|
|
6775
6777
|
/* @__PURE__ */ U(
|
|
@@ -6778,8 +6780,8 @@ function Gd({ room: e }) {
|
|
|
6778
6780
|
to: `/room/${encodeURIComponent(e.viewer_key)}`,
|
|
6779
6781
|
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",
|
|
6780
6782
|
children: /* @__PURE__ */ Le("div", { className: "flex items-center justify-between gap-4", children: [
|
|
6781
|
-
/* @__PURE__ */ U("div", { className: "text-xl font-medium tracking-wide text-text no-underline", children:
|
|
6782
|
-
r > 0 && /* @__PURE__ */ U("div", { className: "flex shrink-0", children: t.map((n, i) => /* @__PURE__ */ U(
|
|
6783
|
+
/* @__PURE__ */ U("div", { className: "text-xl font-medium tracking-wide text-text no-underline", children: Kd(e) }),
|
|
6784
|
+
r > 0 && /* @__PURE__ */ U("div", { className: "flex shrink-0", children: t.map((n, i) => /* @__PURE__ */ U(Gd, { user: n }, `${n.name}-${i}`)) })
|
|
6783
6785
|
] })
|
|
6784
6786
|
}
|
|
6785
6787
|
),
|
|
@@ -6794,8 +6796,8 @@ function Gd({ room: e }) {
|
|
|
6794
6796
|
)
|
|
6795
6797
|
] });
|
|
6796
6798
|
}
|
|
6797
|
-
function
|
|
6798
|
-
const e =
|
|
6799
|
+
function Jd() {
|
|
6800
|
+
const e = ud(), [t, r] = jt([]), [n, i] = jt(!0), [o, a] = jt(null), [s, c] = jt(0);
|
|
6799
6801
|
return St(() => {
|
|
6800
6802
|
const u = Math.random().toString(36).slice(2, 8), f = new AbortController(), h = Xr();
|
|
6801
6803
|
let y = !1, v = null, R = !1;
|
|
@@ -6855,7 +6857,7 @@ function Yd() {
|
|
|
6855
6857
|
_ && r(Co(_.rooms || []));
|
|
6856
6858
|
}).catch(() => {
|
|
6857
6859
|
});
|
|
6858
|
-
},
|
|
6860
|
+
}, Wd);
|
|
6859
6861
|
return () => {
|
|
6860
6862
|
T("home", "rooms-effect: cleanup", {
|
|
6861
6863
|
effectId: u,
|
|
@@ -6882,14 +6884,14 @@ function Yd() {
|
|
|
6882
6884
|
children: "Retry"
|
|
6883
6885
|
}
|
|
6884
6886
|
)
|
|
6885
|
-
] }) : t.length === 0 ? /* @__PURE__ */ U("div", { className: "text-text-secondary text-sm px-1 py-3", children: "No rooms available." }) : /* @__PURE__ */ U("ul", { className: "list-none p-0 m-0 space-y-2", children: t.map((u) => /* @__PURE__ */ U(
|
|
6887
|
+
] }) : t.length === 0 ? /* @__PURE__ */ U("div", { className: "text-text-secondary text-sm px-1 py-3", children: "No rooms available." }) : /* @__PURE__ */ U("ul", { className: "list-none p-0 m-0 space-y-2", children: t.map((u) => /* @__PURE__ */ U(Yd, { room: u }, u.viewer_key)) })
|
|
6886
6888
|
] }),
|
|
6887
|
-
|
|
6889
|
+
qd() && /* @__PURE__ */ Le("div", { className: "w-full max-w-md z-10", children: [
|
|
6888
6890
|
/* @__PURE__ */ U("h2", { className: "text-xs uppercase tracking-[0.2em] text-text-muted/70 mb-3 px-1", children: "On this phone" }),
|
|
6889
6891
|
/* @__PURE__ */ Le(
|
|
6890
6892
|
"a",
|
|
6891
6893
|
{
|
|
6892
|
-
href:
|
|
6894
|
+
href: Vd,
|
|
6893
6895
|
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",
|
|
6894
6896
|
children: [
|
|
6895
6897
|
/* @__PURE__ */ U("div", { className: "text-xl font-medium tracking-wide text-text", children: "Library" }),
|
|
@@ -6900,18 +6902,18 @@ function Yd() {
|
|
|
6900
6902
|
] })
|
|
6901
6903
|
] });
|
|
6902
6904
|
}
|
|
6903
|
-
function
|
|
6905
|
+
function Xd() {
|
|
6904
6906
|
return /* @__PURE__ */ Le("div", { className: "fixed inset-0 bg-black", children: [
|
|
6905
6907
|
/* @__PURE__ */ U(Ya, {}),
|
|
6906
6908
|
/* @__PURE__ */ U("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ U("div", { className: "text-center", children: /* @__PURE__ */ U("h1", { className: "text-4xl font-bold text-white mb-4", children: "API is sleeping..." }) }) })
|
|
6907
6909
|
] });
|
|
6908
6910
|
}
|
|
6909
|
-
const
|
|
6910
|
-
function
|
|
6911
|
-
return !(!e || !e.baseUrl || e.baseUrl.endsWith("/") || !
|
|
6911
|
+
const Qd = "watchparty_fragment_delivery", Zd = /^[0-9a-f]{64}$/, ef = /^[A-Za-z0-9_.-]+$/;
|
|
6912
|
+
function tf(e) {
|
|
6913
|
+
return !(!e || !e.baseUrl || e.baseUrl.endsWith("/") || !Zd.test(e.token) || e.trackId !== void 0 && !ef.test(e.trackId));
|
|
6912
6914
|
}
|
|
6913
|
-
function
|
|
6914
|
-
if (!
|
|
6915
|
+
function Mm(e, t) {
|
|
6916
|
+
if (!tf(e)) return null;
|
|
6915
6917
|
let r;
|
|
6916
6918
|
if (t === "init")
|
|
6917
6919
|
r = "init";
|
|
@@ -6922,7 +6924,7 @@ function Lm(e, t) {
|
|
|
6922
6924
|
const n = e.trackId ? `audio/${e.trackId}/` : "";
|
|
6923
6925
|
return `${e.baseUrl}/v/${e.token}/${n}${r}`;
|
|
6924
6926
|
}
|
|
6925
|
-
function
|
|
6927
|
+
function rf() {
|
|
6926
6928
|
if (typeof window > "u") return null;
|
|
6927
6929
|
try {
|
|
6928
6930
|
const e = new URLSearchParams(window.location.search).get("fragmentDelivery");
|
|
@@ -6930,27 +6932,27 @@ function tf() {
|
|
|
6930
6932
|
if (e === "0" || e === "false") return !1;
|
|
6931
6933
|
} catch {
|
|
6932
6934
|
}
|
|
6933
|
-
return
|
|
6935
|
+
return fd(Qd);
|
|
6934
6936
|
}
|
|
6935
6937
|
let ci = { ...Ca }, Lr = null, Ja = !1;
|
|
6936
6938
|
const Ao = "watchparty_delivery_client_id";
|
|
6937
|
-
function
|
|
6939
|
+
function nf() {
|
|
6938
6940
|
const e = Ne(Ao);
|
|
6939
6941
|
if (e) return e;
|
|
6940
6942
|
const t = globalThis.crypto?.randomUUID?.() ?? `d${Math.random().toString(36).slice(2)}`;
|
|
6941
6943
|
return ai(Ao, t) ? t : "";
|
|
6942
6944
|
}
|
|
6943
|
-
function
|
|
6945
|
+
function of(e) {
|
|
6944
6946
|
ci = Aa(e), Ja || (Lr = null);
|
|
6945
6947
|
}
|
|
6946
|
-
function
|
|
6948
|
+
function af() {
|
|
6947
6949
|
return { ...ci };
|
|
6948
6950
|
}
|
|
6949
6951
|
function Xa() {
|
|
6950
|
-
return Lr === null && (Lr =
|
|
6952
|
+
return Lr === null && (Lr = Fu(ci, nf(), rf())), Lr;
|
|
6951
6953
|
}
|
|
6952
6954
|
let xo = !1;
|
|
6953
|
-
async function
|
|
6955
|
+
async function sf(e) {
|
|
6954
6956
|
if (!xo) {
|
|
6955
6957
|
xo = !0;
|
|
6956
6958
|
for (let t = 0; t < 2; t++) {
|
|
@@ -6958,7 +6960,7 @@ async function af(e) {
|
|
|
6958
6960
|
const r = await fetch(`${e}/api/flags`, { cache: "no-store" });
|
|
6959
6961
|
if (r.ok) {
|
|
6960
6962
|
const n = await r.json();
|
|
6961
|
-
|
|
6963
|
+
of(n?.fragment_delivery), T("app", "Delivery flag loaded", { ...af(), attempt: t });
|
|
6962
6964
|
return;
|
|
6963
6965
|
}
|
|
6964
6966
|
} catch {
|
|
@@ -6968,28 +6970,28 @@ async function af(e) {
|
|
|
6968
6970
|
ie("app", "Delivery flag fetch failed; staying on the default delivery path");
|
|
6969
6971
|
}
|
|
6970
6972
|
}
|
|
6971
|
-
function
|
|
6973
|
+
function lf() {
|
|
6972
6974
|
return Xa();
|
|
6973
6975
|
}
|
|
6974
|
-
function
|
|
6976
|
+
function Dm() {
|
|
6975
6977
|
const e = Xa();
|
|
6976
6978
|
return Ja = !0, e === "fragment";
|
|
6977
6979
|
}
|
|
6978
|
-
let ui =
|
|
6980
|
+
let ui = Wu;
|
|
6979
6981
|
const Dn = /* @__PURE__ */ new Set();
|
|
6980
|
-
function
|
|
6982
|
+
function cf(e) {
|
|
6981
6983
|
ui = e;
|
|
6982
6984
|
for (const t of Dn) t();
|
|
6983
6985
|
}
|
|
6984
|
-
function
|
|
6985
|
-
const t =
|
|
6986
|
+
function uf(e) {
|
|
6987
|
+
const t = qu.safeParse(e?.games);
|
|
6986
6988
|
if (!t.success)
|
|
6987
6989
|
return ie("game", "Game catalog rejected; keeping the current list", { issues: t.error.issues.length }), !1;
|
|
6988
6990
|
const r = t.data;
|
|
6989
|
-
return
|
|
6991
|
+
return cf(r), !0;
|
|
6990
6992
|
}
|
|
6991
6993
|
let ko = !1;
|
|
6992
|
-
async function
|
|
6994
|
+
async function df(e) {
|
|
6993
6995
|
if (!ko) {
|
|
6994
6996
|
ko = !0;
|
|
6995
6997
|
try {
|
|
@@ -6998,22 +7000,22 @@ async function uf(e) {
|
|
|
6998
7000
|
ie("game", "Game catalog fetch failed; using the default list", { status: t.status });
|
|
6999
7001
|
return;
|
|
7000
7002
|
}
|
|
7001
|
-
|
|
7003
|
+
uf(await t.json()) && T("game", "Game catalog loaded", { games: ui.map((r) => r.id) });
|
|
7002
7004
|
} catch (t) {
|
|
7003
7005
|
ie("game", "Game catalog fetch failed; using the default list", vt(t));
|
|
7004
7006
|
}
|
|
7005
7007
|
}
|
|
7006
7008
|
}
|
|
7007
|
-
function
|
|
7009
|
+
function ff() {
|
|
7008
7010
|
return ui;
|
|
7009
7011
|
}
|
|
7010
|
-
function
|
|
7012
|
+
function hf(e) {
|
|
7011
7013
|
return Dn.add(e), () => {
|
|
7012
7014
|
Dn.delete(e);
|
|
7013
7015
|
};
|
|
7014
7016
|
}
|
|
7015
|
-
function
|
|
7016
|
-
return ks(
|
|
7017
|
+
function Nm() {
|
|
7018
|
+
return ks(hf, ff);
|
|
7017
7019
|
}
|
|
7018
7020
|
function Qa(e) {
|
|
7019
7021
|
return Xe.lazy(async () => {
|
|
@@ -7029,9 +7031,9 @@ function Qa(e) {
|
|
|
7029
7031
|
}
|
|
7030
7032
|
});
|
|
7031
7033
|
}
|
|
7032
|
-
const
|
|
7033
|
-
function
|
|
7034
|
-
return e ?
|
|
7034
|
+
const mf = ["demo-room"];
|
|
7035
|
+
function pf(e) {
|
|
7036
|
+
return e ? mf.some((t) => e === t || e.startsWith(t + "-")) : !1;
|
|
7035
7037
|
}
|
|
7036
7038
|
function Za(e) {
|
|
7037
7039
|
if (!(e.hostname === "hadoku.me")) return null;
|
|
@@ -7040,22 +7042,22 @@ function Za(e) {
|
|
|
7040
7042
|
const n = e.pathname + (e.search || "");
|
|
7041
7043
|
return `/auth?return=${encodeURIComponent(n)}`;
|
|
7042
7044
|
}
|
|
7043
|
-
if (!e.roomKey ||
|
|
7045
|
+
if (!e.roomKey || pf(e.roomKey) || go() !== "public") return null;
|
|
7044
7046
|
const r = e.pathname + (e.search || "");
|
|
7045
7047
|
return `/auth?return=${encodeURIComponent(r)}`;
|
|
7046
7048
|
}
|
|
7047
|
-
const Po = Qa(() => import("./Room-
|
|
7049
|
+
const Po = Qa(() => import("./Room-B6ODdfkE.js").then((e) => e.R));
|
|
7048
7050
|
function Oo() {
|
|
7049
7051
|
return /* @__PURE__ */ U("div", { className: "flex-1 flex items-center justify-center bg-black", children: /* @__PURE__ */ U("div", { className: "text-text-secondary text-sm", children: "Loading room..." }) });
|
|
7050
7052
|
}
|
|
7051
|
-
function
|
|
7053
|
+
function gf() {
|
|
7052
7054
|
const e = lt(), t = ic(), r = Za({
|
|
7053
7055
|
roomKey: t.roomKey,
|
|
7054
7056
|
hostname: window.location.hostname,
|
|
7055
7057
|
pathname: window.location.pathname,
|
|
7056
7058
|
search: window.location.search
|
|
7057
7059
|
});
|
|
7058
|
-
return r ? (window.location.replace(r), null) : t.roomKey ? /* @__PURE__ */ U(Xe.Suspense, { fallback: /* @__PURE__ */ U(Oo, {}), children: /* @__PURE__ */ U(Po, {}) }) : e.pathname === "/" || e.pathname === "" ? /* @__PURE__ */ U(
|
|
7060
|
+
return r ? (window.location.replace(r), null) : t.roomKey ? /* @__PURE__ */ U(Xe.Suspense, { fallback: /* @__PURE__ */ U(Oo, {}), children: /* @__PURE__ */ U(Po, {}) }) : e.pathname === "/" || e.pathname === "" ? /* @__PURE__ */ U(Jd, {}) : e.pathname.startsWith("/room") ? /* @__PURE__ */ U(Xe.Suspense, { fallback: /* @__PURE__ */ U(Oo, {}), children: /* @__PURE__ */ U(Po, {}) }) : /* @__PURE__ */ U("div", { className: "p-6", children: "Not Found" });
|
|
7059
7061
|
}
|
|
7060
7062
|
function _n(e) {
|
|
7061
7063
|
const [t, r] = jt(!1), n = {
|
|
@@ -7074,7 +7076,7 @@ function _n(e) {
|
|
|
7074
7076
|
signal: i.signal
|
|
7075
7077
|
});
|
|
7076
7078
|
if (i.signal.aborted) return;
|
|
7077
|
-
c.ok ? (T("app", "API health check passed"),
|
|
7079
|
+
c.ok ? (T("app", "API health check passed"), sf(a), df(a)) : (Ze("app", "API health check failed", { status: c.status }), r(!0));
|
|
7078
7080
|
} catch (c) {
|
|
7079
7081
|
if (c?.name === "AbortError") return;
|
|
7080
7082
|
Ze("app", "API unreachable", { url: s, error: c }), r(!0);
|
|
@@ -7109,34 +7111,34 @@ function _n(e) {
|
|
|
7109
7111
|
"requestIdleCallback" in window ? window.requestIdleCallback(i, { timeout: 2e3 }) : setTimeout(i, 600);
|
|
7110
7112
|
}
|
|
7111
7113
|
document.readyState === "complete" ? o() : window.addEventListener("load", o, { once: !0 });
|
|
7112
|
-
}, []), t ? /* @__PURE__ */ U(
|
|
7114
|
+
}, []), t ? /* @__PURE__ */ U(Xd, {}) : (
|
|
7113
7115
|
// HadokuThemeRoot must sit above everything that reads the theme —
|
|
7114
7116
|
// <HadokuThemePicker> in ChatPanel throws without it, by design, so a
|
|
7115
7117
|
// missing provider is a mount-time error rather than a silently wrong
|
|
7116
7118
|
// theme. It also applies data-theme, which this app previously did through
|
|
7117
7119
|
// its own useTheme() call.
|
|
7118
7120
|
/* @__PURE__ */ U(Is, { children: /* @__PURE__ */ U(Da.Provider, { value: n, children: /* @__PURE__ */ Le("div", { className: "h-screen flex flex-col bg-bg", children: [
|
|
7119
|
-
/* @__PURE__ */ U("main", { className: "flex-1 w-full overflow-hidden min-h-0 flex flex-col", children: /* @__PURE__ */ U(
|
|
7120
|
-
/* @__PURE__ */ U(
|
|
7121
|
+
/* @__PURE__ */ U("main", { className: "flex-1 w-full overflow-hidden min-h-0 flex flex-col", children: /* @__PURE__ */ U(gf, {}) }),
|
|
7122
|
+
/* @__PURE__ */ U(Hd, {})
|
|
7121
7123
|
] }) }) })
|
|
7122
7124
|
);
|
|
7123
7125
|
}
|
|
7124
|
-
const
|
|
7125
|
-
function
|
|
7126
|
+
const yf = Qa(() => import("./MapEditor-Bvr-tvKQ.js"));
|
|
7127
|
+
function vf() {
|
|
7126
7128
|
const e = Za({
|
|
7127
7129
|
hostname: window.location.hostname,
|
|
7128
7130
|
pathname: window.location.pathname,
|
|
7129
7131
|
search: window.location.search,
|
|
7130
7132
|
requireAuth: !0
|
|
7131
7133
|
});
|
|
7132
|
-
return e ? (window.location.replace(e), null) : /* @__PURE__ */ U(
|
|
7134
|
+
return e ? (window.location.replace(e), null) : /* @__PURE__ */ U(yf, {});
|
|
7133
7135
|
}
|
|
7134
|
-
function
|
|
7136
|
+
function bf({ basename: e = "/watchparty", appProps: t } = {}) {
|
|
7135
7137
|
const r = t ?? {}, n = [
|
|
7136
7138
|
{ path: "/", element: /* @__PURE__ */ U(_n, { ...r }) },
|
|
7137
7139
|
{
|
|
7138
7140
|
path: "/editor",
|
|
7139
|
-
element: /* @__PURE__ */ U(Xe.Suspense, { fallback: /* @__PURE__ */ U("div", { className: "w-screen h-screen flex items-center justify-center bg-bg text-text-secondary", children: "Loading editor…" }), children: /* @__PURE__ */ U(
|
|
7141
|
+
element: /* @__PURE__ */ U(Xe.Suspense, { fallback: /* @__PURE__ */ U("div", { className: "w-screen h-screen flex items-center justify-center bg-bg text-text-secondary", children: "Loading editor…" }), children: /* @__PURE__ */ U(vf, {}) })
|
|
7140
7142
|
},
|
|
7141
7143
|
{ path: "/room/:roomKey", element: /* @__PURE__ */ U(_n, { ...r }) },
|
|
7142
7144
|
{ path: "/:roomKey", element: /* @__PURE__ */ U(_n, { ...r }) }
|
|
@@ -7147,7 +7149,7 @@ let Mr;
|
|
|
7147
7149
|
function es() {
|
|
7148
7150
|
return Ne(Fs) || void 0;
|
|
7149
7151
|
}
|
|
7150
|
-
function
|
|
7152
|
+
function wf() {
|
|
7151
7153
|
if (Mr) return;
|
|
7152
7154
|
const e = es();
|
|
7153
7155
|
if (e) {
|
|
@@ -7160,7 +7162,7 @@ function bf() {
|
|
|
7160
7162
|
T("identity", "device id unavailable — joining without one");
|
|
7161
7163
|
});
|
|
7162
7164
|
}
|
|
7163
|
-
function
|
|
7165
|
+
function _f() {
|
|
7164
7166
|
return Mr ??= es();
|
|
7165
7167
|
}
|
|
7166
7168
|
const Ve = /* @__PURE__ */ Object.create(null);
|
|
@@ -7186,7 +7188,7 @@ function Lo(e) {
|
|
|
7186
7188
|
return e instanceof Uint8Array ? e : e instanceof ArrayBuffer ? new Uint8Array(e) : new Uint8Array(e.buffer, e.byteOffset, e.byteLength);
|
|
7187
7189
|
}
|
|
7188
7190
|
let En;
|
|
7189
|
-
function
|
|
7191
|
+
function Ef(e, t) {
|
|
7190
7192
|
if (ts && e.data instanceof Blob)
|
|
7191
7193
|
return e.data.arrayBuffer().then(Lo).then(t);
|
|
7192
7194
|
if (rs && (e.data instanceof ArrayBuffer || ns(e.data)))
|
|
@@ -7198,14 +7200,14 @@ function _f(e, t) {
|
|
|
7198
7200
|
const Mo = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", zt = typeof Uint8Array > "u" ? [] : new Uint8Array(256);
|
|
7199
7201
|
for (let e = 0; e < Mo.length; e++)
|
|
7200
7202
|
zt[Mo.charCodeAt(e)] = e;
|
|
7201
|
-
const
|
|
7203
|
+
const Sf = (e) => {
|
|
7202
7204
|
let t = e.length * 0.75, r = e.length, n, i = 0, o, a, s, c;
|
|
7203
7205
|
e[e.length - 1] === "=" && (t--, e[e.length - 2] === "=" && t--);
|
|
7204
7206
|
const u = new ArrayBuffer(t), f = new Uint8Array(u);
|
|
7205
7207
|
for (n = 0; n < r; n += 4)
|
|
7206
7208
|
o = zt[e.charCodeAt(n)], a = zt[e.charCodeAt(n + 1)], s = zt[e.charCodeAt(n + 2)], c = zt[e.charCodeAt(n + 3)], f[i++] = o << 2 | a >> 4, f[i++] = (a & 15) << 4 | s >> 2, f[i++] = (s & 3) << 6 | c & 63;
|
|
7207
7209
|
return u;
|
|
7208
|
-
},
|
|
7210
|
+
}, Rf = typeof ArrayBuffer == "function", fi = (e, t) => {
|
|
7209
7211
|
if (typeof e != "string")
|
|
7210
7212
|
return {
|
|
7211
7213
|
type: "message",
|
|
@@ -7214,20 +7216,20 @@ const Ef = (e) => {
|
|
|
7214
7216
|
const r = e.charAt(0);
|
|
7215
7217
|
return r === "b" ? {
|
|
7216
7218
|
type: "message",
|
|
7217
|
-
data:
|
|
7219
|
+
data: Tf(e.substring(1), t)
|
|
7218
7220
|
} : Dr[r] ? e.length > 1 ? {
|
|
7219
7221
|
type: Dr[r],
|
|
7220
7222
|
data: e.substring(1)
|
|
7221
7223
|
} : {
|
|
7222
7224
|
type: Dr[r]
|
|
7223
7225
|
} : Nn;
|
|
7224
|
-
},
|
|
7225
|
-
if (
|
|
7226
|
-
const r =
|
|
7226
|
+
}, Tf = (e, t) => {
|
|
7227
|
+
if (Rf) {
|
|
7228
|
+
const r = Sf(e);
|
|
7227
7229
|
return is(r, t);
|
|
7228
7230
|
} else
|
|
7229
7231
|
return { base64: !0, data: e };
|
|
7230
|
-
}, is = (e, t) => t === "blob" ? e instanceof Blob ? e : new Blob([e]) : e instanceof ArrayBuffer ? e : e.buffer, os = "",
|
|
7232
|
+
}, is = (e, t) => t === "blob" ? e instanceof Blob ? e : new Blob([e]) : e instanceof ArrayBuffer ? e : e.buffer, os = "", Cf = (e, t) => {
|
|
7231
7233
|
const r = e.length, n = new Array(r);
|
|
7232
7234
|
let i = 0;
|
|
7233
7235
|
e.forEach((o, a) => {
|
|
@@ -7235,7 +7237,7 @@ const Ef = (e) => {
|
|
|
7235
7237
|
n[a] = s, ++i === r && t(n.join(os));
|
|
7236
7238
|
});
|
|
7237
7239
|
});
|
|
7238
|
-
},
|
|
7240
|
+
}, Af = (e, t) => {
|
|
7239
7241
|
const r = e.split(os), n = [];
|
|
7240
7242
|
for (let i = 0; i < r.length; i++) {
|
|
7241
7243
|
const o = fi(r[i], t);
|
|
@@ -7244,10 +7246,10 @@ const Ef = (e) => {
|
|
|
7244
7246
|
}
|
|
7245
7247
|
return n;
|
|
7246
7248
|
};
|
|
7247
|
-
function
|
|
7249
|
+
function xf() {
|
|
7248
7250
|
return new TransformStream({
|
|
7249
7251
|
transform(e, t) {
|
|
7250
|
-
|
|
7252
|
+
Ef(e, (r) => {
|
|
7251
7253
|
const n = r.length;
|
|
7252
7254
|
let i;
|
|
7253
7255
|
if (n < 126)
|
|
@@ -7279,7 +7281,7 @@ function Rr(e, t) {
|
|
|
7279
7281
|
r[i] = e[0][n++], n === e[0].length && (e.shift(), n = 0);
|
|
7280
7282
|
return e.length && n < e[0].length && (e[0] = e[0].slice(n)), r;
|
|
7281
7283
|
}
|
|
7282
|
-
function
|
|
7284
|
+
function kf(e, t) {
|
|
7283
7285
|
Sn || (Sn = new TextDecoder());
|
|
7284
7286
|
const r = [];
|
|
7285
7287
|
let n = 0, i = -1, o = !1;
|
|
@@ -7321,9 +7323,9 @@ function xf(e, t) {
|
|
|
7321
7323
|
}
|
|
7322
7324
|
const as = 4;
|
|
7323
7325
|
function ue(e) {
|
|
7324
|
-
if (e) return
|
|
7326
|
+
if (e) return Pf(e);
|
|
7325
7327
|
}
|
|
7326
|
-
function
|
|
7328
|
+
function Pf(e) {
|
|
7327
7329
|
for (var t in ue.prototype)
|
|
7328
7330
|
e[t] = ue.prototype[t];
|
|
7329
7331
|
return e;
|
|
@@ -7369,19 +7371,19 @@ ue.prototype.listeners = function(e) {
|
|
|
7369
7371
|
ue.prototype.hasListeners = function(e) {
|
|
7370
7372
|
return !!this.listeners(e).length;
|
|
7371
7373
|
};
|
|
7372
|
-
const rn = typeof Promise == "function" && typeof Promise.resolve == "function" ? (t) => Promise.resolve().then(t) : (t, r) => r(t, 0), xe = typeof self < "u" ? self : typeof window < "u" ? window : Function("return this")(),
|
|
7374
|
+
const rn = typeof Promise == "function" && typeof Promise.resolve == "function" ? (t) => Promise.resolve().then(t) : (t, r) => r(t, 0), xe = typeof self < "u" ? self : typeof window < "u" ? window : Function("return this")(), Of = "arraybuffer";
|
|
7373
7375
|
function ss(e, ...t) {
|
|
7374
7376
|
return t.reduce((r, n) => (e.hasOwnProperty(n) && (r[n] = e[n]), r), {});
|
|
7375
7377
|
}
|
|
7376
|
-
const
|
|
7378
|
+
const If = xe.setTimeout, Lf = xe.clearTimeout;
|
|
7377
7379
|
function nn(e, t) {
|
|
7378
|
-
t.useNativeTimers ? (e.setTimeoutFn =
|
|
7379
|
-
}
|
|
7380
|
-
const Lf = 1.33;
|
|
7381
|
-
function Mf(e) {
|
|
7382
|
-
return typeof e == "string" ? Df(e) : Math.ceil((e.byteLength || e.size) * Lf);
|
|
7380
|
+
t.useNativeTimers ? (e.setTimeoutFn = If.bind(xe), e.clearTimeoutFn = Lf.bind(xe)) : (e.setTimeoutFn = xe.setTimeout.bind(xe), e.clearTimeoutFn = xe.clearTimeout.bind(xe));
|
|
7383
7381
|
}
|
|
7382
|
+
const Mf = 1.33;
|
|
7384
7383
|
function Df(e) {
|
|
7384
|
+
return typeof e == "string" ? Nf(e) : Math.ceil((e.byteLength || e.size) * Mf);
|
|
7385
|
+
}
|
|
7386
|
+
function Nf(e) {
|
|
7385
7387
|
let t = 0, r = 0;
|
|
7386
7388
|
for (let n = 0, i = e.length; n < i; n++)
|
|
7387
7389
|
t = e.charCodeAt(n), t < 128 ? r += 1 : t < 2048 ? r += 2 : t < 55296 || t >= 57344 ? r += 3 : (n++, r += 4);
|
|
@@ -7390,13 +7392,13 @@ function Df(e) {
|
|
|
7390
7392
|
function ls() {
|
|
7391
7393
|
return Date.now().toString(36).substring(3) + Math.random().toString(36).substring(2, 5);
|
|
7392
7394
|
}
|
|
7393
|
-
function
|
|
7395
|
+
function Ff(e) {
|
|
7394
7396
|
let t = "";
|
|
7395
7397
|
for (let r in e)
|
|
7396
7398
|
e.hasOwnProperty(r) && (t.length && (t += "&"), t += encodeURIComponent(r) + "=" + encodeURIComponent(e[r]));
|
|
7397
7399
|
return t;
|
|
7398
7400
|
}
|
|
7399
|
-
function
|
|
7401
|
+
function Uf(e) {
|
|
7400
7402
|
let t = {}, r = e.split("&");
|
|
7401
7403
|
for (let n = 0, i = r.length; n < i; n++) {
|
|
7402
7404
|
let o = r[n].split("=");
|
|
@@ -7404,7 +7406,7 @@ function Ff(e) {
|
|
|
7404
7406
|
}
|
|
7405
7407
|
return t;
|
|
7406
7408
|
}
|
|
7407
|
-
class
|
|
7409
|
+
class Bf extends Error {
|
|
7408
7410
|
constructor(t, r, n) {
|
|
7409
7411
|
super(t), this.description = r, this.context = n, this.type = "TransportError";
|
|
7410
7412
|
}
|
|
@@ -7429,7 +7431,7 @@ class hi extends ue {
|
|
|
7429
7431
|
* @protected
|
|
7430
7432
|
*/
|
|
7431
7433
|
onError(t, r, n) {
|
|
7432
|
-
return super.emitReserved("error", new
|
|
7434
|
+
return super.emitReserved("error", new Bf(t, r, n)), this;
|
|
7433
7435
|
}
|
|
7434
7436
|
/**
|
|
7435
7437
|
* Opens the transport.
|
|
@@ -7503,11 +7505,11 @@ class hi extends ue {
|
|
|
7503
7505
|
return this.opts.port && (this.opts.secure && +(this.opts.port !== 443) || !this.opts.secure && Number(this.opts.port) !== 80) ? ":" + this.opts.port : "";
|
|
7504
7506
|
}
|
|
7505
7507
|
_query(t) {
|
|
7506
|
-
const r =
|
|
7508
|
+
const r = Ff(t);
|
|
7507
7509
|
return r.length ? "?" + r : "";
|
|
7508
7510
|
}
|
|
7509
7511
|
}
|
|
7510
|
-
class
|
|
7512
|
+
class jf extends hi {
|
|
7511
7513
|
constructor() {
|
|
7512
7514
|
super(...arguments), this._polling = !1;
|
|
7513
7515
|
}
|
|
@@ -7563,7 +7565,7 @@ class Bf extends hi {
|
|
|
7563
7565
|
return this.onClose({ description: "transport closed by the server" }), !1;
|
|
7564
7566
|
this.onPacket(n);
|
|
7565
7567
|
};
|
|
7566
|
-
|
|
7568
|
+
Af(t, this.socket.binaryType).forEach(r), this.readyState !== "closed" && (this._polling = !1, this.emitReserved("pollComplete"), this.readyState === "open" && this._poll());
|
|
7567
7569
|
}
|
|
7568
7570
|
/**
|
|
7569
7571
|
* For polling, send a close packet.
|
|
@@ -7583,7 +7585,7 @@ class Bf extends hi {
|
|
|
7583
7585
|
* @protected
|
|
7584
7586
|
*/
|
|
7585
7587
|
write(t) {
|
|
7586
|
-
this.writable = !1,
|
|
7588
|
+
this.writable = !1, Cf(t, (r) => {
|
|
7587
7589
|
this.doWrite(r, () => {
|
|
7588
7590
|
this.writable = !0, this.emitReserved("drain");
|
|
7589
7591
|
});
|
|
@@ -7604,10 +7606,10 @@ try {
|
|
|
7604
7606
|
cs = typeof XMLHttpRequest < "u" && "withCredentials" in new XMLHttpRequest();
|
|
7605
7607
|
} catch {
|
|
7606
7608
|
}
|
|
7607
|
-
const
|
|
7608
|
-
function
|
|
7609
|
+
const $f = cs;
|
|
7610
|
+
function Hf() {
|
|
7609
7611
|
}
|
|
7610
|
-
class
|
|
7612
|
+
class zf extends jf {
|
|
7611
7613
|
/**
|
|
7612
7614
|
* XHR Polling constructor.
|
|
7613
7615
|
*
|
|
@@ -7720,7 +7722,7 @@ let Tt = class Nr extends ue {
|
|
|
7720
7722
|
*/
|
|
7721
7723
|
_cleanup(t) {
|
|
7722
7724
|
if (!(typeof this._xhr > "u" || this._xhr === null)) {
|
|
7723
|
-
if (this._xhr.onreadystatechange =
|
|
7725
|
+
if (this._xhr.onreadystatechange = Hf, t)
|
|
7724
7726
|
try {
|
|
7725
7727
|
this._xhr.abort();
|
|
7726
7728
|
} catch {
|
|
@@ -7760,17 +7762,17 @@ function Do() {
|
|
|
7760
7762
|
for (let e in Tt.requests)
|
|
7761
7763
|
Tt.requests.hasOwnProperty(e) && Tt.requests[e].abort();
|
|
7762
7764
|
}
|
|
7763
|
-
const
|
|
7765
|
+
const Vf = (function() {
|
|
7764
7766
|
const e = us({
|
|
7765
7767
|
xdomain: !1
|
|
7766
7768
|
});
|
|
7767
7769
|
return e && e.responseType !== null;
|
|
7768
7770
|
})();
|
|
7769
|
-
class
|
|
7771
|
+
class qf extends zf {
|
|
7770
7772
|
constructor(t) {
|
|
7771
7773
|
super(t);
|
|
7772
7774
|
const r = t && t.forceBase64;
|
|
7773
|
-
this.supportsBinary =
|
|
7775
|
+
this.supportsBinary = Vf && !r;
|
|
7774
7776
|
}
|
|
7775
7777
|
request(t = {}) {
|
|
7776
7778
|
return Object.assign(t, { xd: this.xd }, this.opts), new Tt(us, this.uri(), t);
|
|
@@ -7779,7 +7781,7 @@ class Vf extends Hf {
|
|
|
7779
7781
|
function us(e) {
|
|
7780
7782
|
const t = e.xdomain;
|
|
7781
7783
|
try {
|
|
7782
|
-
if (typeof XMLHttpRequest < "u" && (!t ||
|
|
7784
|
+
if (typeof XMLHttpRequest < "u" && (!t || $f))
|
|
7783
7785
|
return new XMLHttpRequest();
|
|
7784
7786
|
} catch {
|
|
7785
7787
|
}
|
|
@@ -7790,7 +7792,7 @@ function us(e) {
|
|
|
7790
7792
|
}
|
|
7791
7793
|
}
|
|
7792
7794
|
const ds = typeof navigator < "u" && typeof navigator.product == "string" && navigator.product.toLowerCase() === "reactnative";
|
|
7793
|
-
class
|
|
7795
|
+
class Wf extends hi {
|
|
7794
7796
|
get name() {
|
|
7795
7797
|
return "websocket";
|
|
7796
7798
|
}
|
|
@@ -7847,7 +7849,7 @@ class qf extends hi {
|
|
|
7847
7849
|
}
|
|
7848
7850
|
}
|
|
7849
7851
|
const Rn = xe.WebSocket || xe.MozWebSocket;
|
|
7850
|
-
class
|
|
7852
|
+
class Kf extends Wf {
|
|
7851
7853
|
createSocket(t, r, n) {
|
|
7852
7854
|
return ds ? new Rn(t, r, n) : r ? new Rn(t, r) : new Rn(t);
|
|
7853
7855
|
}
|
|
@@ -7855,7 +7857,7 @@ class Wf extends qf {
|
|
|
7855
7857
|
this.ws.send(r);
|
|
7856
7858
|
}
|
|
7857
7859
|
}
|
|
7858
|
-
class
|
|
7860
|
+
class Gf extends hi {
|
|
7859
7861
|
get name() {
|
|
7860
7862
|
return "webtransport";
|
|
7861
7863
|
}
|
|
@@ -7871,7 +7873,7 @@ class Kf extends hi {
|
|
|
7871
7873
|
this.onError("webtransport error", t);
|
|
7872
7874
|
}), this._transport.ready.then(() => {
|
|
7873
7875
|
this._transport.createBidirectionalStream().then((t) => {
|
|
7874
|
-
const r =
|
|
7876
|
+
const r = kf(Number.MAX_SAFE_INTEGER, this.socket.binaryType), n = t.readable.pipeThrough(r).getReader(), i = xf();
|
|
7875
7877
|
i.readable.pipeTo(t.writable), this._writer = i.writable.getWriter();
|
|
7876
7878
|
const o = () => {
|
|
7877
7879
|
n.read().then(({ done: s, value: c }) => {
|
|
@@ -7901,11 +7903,11 @@ class Kf extends hi {
|
|
|
7901
7903
|
(t = this._transport) === null || t === void 0 || t.close();
|
|
7902
7904
|
}
|
|
7903
7905
|
}
|
|
7904
|
-
const
|
|
7905
|
-
websocket:
|
|
7906
|
-
webtransport:
|
|
7907
|
-
polling:
|
|
7908
|
-
},
|
|
7906
|
+
const Yf = {
|
|
7907
|
+
websocket: Kf,
|
|
7908
|
+
webtransport: Gf,
|
|
7909
|
+
polling: qf
|
|
7910
|
+
}, Jf = /^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/, Xf = [
|
|
7909
7911
|
"source",
|
|
7910
7912
|
"protocol",
|
|
7911
7913
|
"authority",
|
|
@@ -7926,16 +7928,16 @@ function Fn(e) {
|
|
|
7926
7928
|
throw "URI too long";
|
|
7927
7929
|
const t = e, r = e.indexOf("["), n = e.indexOf("]");
|
|
7928
7930
|
r != -1 && n != -1 && (e = e.substring(0, r) + e.substring(r, n).replace(/:/g, ";") + e.substring(n, e.length));
|
|
7929
|
-
let i =
|
|
7931
|
+
let i = Jf.exec(e || ""), o = {}, a = 14;
|
|
7930
7932
|
for (; a--; )
|
|
7931
|
-
o[
|
|
7932
|
-
return r != -1 && n != -1 && (o.source = t, o.host = o.host.substring(1, o.host.length - 1).replace(/;/g, ":"), o.authority = o.authority.replace("[", "").replace("]", "").replace(/;/g, ":"), o.ipv6uri = !0), o.pathNames =
|
|
7933
|
+
o[Xf[a]] = i[a] || "";
|
|
7934
|
+
return r != -1 && n != -1 && (o.source = t, o.host = o.host.substring(1, o.host.length - 1).replace(/;/g, ":"), o.authority = o.authority.replace("[", "").replace("]", "").replace(/;/g, ":"), o.ipv6uri = !0), o.pathNames = Qf(o, o.path), o.queryKey = Zf(o, o.query), o;
|
|
7933
7935
|
}
|
|
7934
|
-
function
|
|
7936
|
+
function Qf(e, t) {
|
|
7935
7937
|
const r = /\/{2,9}/g, n = t.replace(r, "/").split("/");
|
|
7936
7938
|
return (t.slice(0, 1) == "/" || t.length === 0) && n.splice(0, 1), t.slice(-1) == "/" && n.splice(n.length - 1, 1), n;
|
|
7937
7939
|
}
|
|
7938
|
-
function
|
|
7940
|
+
function Zf(e, t) {
|
|
7939
7941
|
const r = {};
|
|
7940
7942
|
return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g, function(n, i, o) {
|
|
7941
7943
|
i && (r[i] = o);
|
|
@@ -7953,7 +7955,7 @@ class at extends ue {
|
|
|
7953
7955
|
* @param {Object} opts - options
|
|
7954
7956
|
*/
|
|
7955
7957
|
constructor(t, r) {
|
|
7956
|
-
if (super(), this.binaryType =
|
|
7958
|
+
if (super(), this.binaryType = Of, 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) {
|
|
7957
7959
|
const n = Fn(t);
|
|
7958
7960
|
r.hostname = n.host, r.secure = n.protocol === "https" || n.protocol === "wss", r.port = n.port, n.query && (r.query = n.query);
|
|
7959
7961
|
} else r.host && (r.hostname = Fn(r.host).host);
|
|
@@ -7974,7 +7976,7 @@ class at extends ue {
|
|
|
7974
7976
|
},
|
|
7975
7977
|
transportOptions: {},
|
|
7976
7978
|
closeOnBeforeunload: !1
|
|
7977
|
-
}, r), this.opts.path = this.opts.path.replace(/\/$/, "") + (this.opts.addTrailingSlash ? "/" : ""), typeof this.opts.query == "string" && (this.opts.query =
|
|
7979
|
+
}, r), this.opts.path = this.opts.path.replace(/\/$/, "") + (this.opts.addTrailingSlash ? "/" : ""), typeof this.opts.query == "string" && (this.opts.query = Uf(this.opts.query)), Un && (this.opts.closeOnBeforeunload && (this._beforeunloadEventListener = () => {
|
|
7978
7980
|
this.transport && (this.transport.removeAllListeners(), this.transport.close());
|
|
7979
7981
|
}, addEventListener("beforeunload", this._beforeunloadEventListener, !1)), this.hostname !== "localhost" && (this._offlineEventListener = () => {
|
|
7980
7982
|
this._onClose("transport close", {
|
|
@@ -8109,7 +8111,7 @@ class at extends ue {
|
|
|
8109
8111
|
let r = 1;
|
|
8110
8112
|
for (let n = 0; n < this.writeBuffer.length; n++) {
|
|
8111
8113
|
const i = this.writeBuffer[n].data;
|
|
8112
|
-
if (i && (r +=
|
|
8114
|
+
if (i && (r += Df(i)), n > 0 && r > this._maxPayload)
|
|
8113
8115
|
return this.writeBuffer.slice(0, n);
|
|
8114
8116
|
r += 2;
|
|
8115
8117
|
}
|
|
@@ -8216,7 +8218,7 @@ class at extends ue {
|
|
|
8216
8218
|
}
|
|
8217
8219
|
}
|
|
8218
8220
|
at.protocol = as;
|
|
8219
|
-
class
|
|
8221
|
+
class eh extends at {
|
|
8220
8222
|
constructor() {
|
|
8221
8223
|
super(...arguments), this._upgrades = [];
|
|
8222
8224
|
}
|
|
@@ -8288,21 +8290,21 @@ class Zf extends at {
|
|
|
8288
8290
|
return r;
|
|
8289
8291
|
}
|
|
8290
8292
|
}
|
|
8291
|
-
let
|
|
8293
|
+
let th = class extends eh {
|
|
8292
8294
|
constructor(t, r = {}) {
|
|
8293
8295
|
const n = typeof t == "object" ? t : r;
|
|
8294
|
-
(!n.transports || n.transports && typeof n.transports[0] == "string") && (n.transports = (n.transports || ["polling", "websocket", "webtransport"]).map((i) =>
|
|
8296
|
+
(!n.transports || n.transports && typeof n.transports[0] == "string") && (n.transports = (n.transports || ["polling", "websocket", "webtransport"]).map((i) => Yf[i]).filter((i) => !!i)), super(t, n);
|
|
8295
8297
|
}
|
|
8296
8298
|
};
|
|
8297
|
-
function
|
|
8299
|
+
function rh(e, t = "", r) {
|
|
8298
8300
|
let n = e;
|
|
8299
8301
|
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 = Fn(e)), n.port || (/^(http|ws)$/.test(n.protocol) ? n.port = "80" : /^(http|ws)s$/.test(n.protocol) && (n.port = "443")), n.path = n.path || "/";
|
|
8300
8302
|
const o = n.host.indexOf(":") !== -1 ? "[" + n.host + "]" : n.host;
|
|
8301
8303
|
return n.id = n.protocol + "://" + o + ":" + n.port + t, n.href = n.protocol + "://" + o + (r && r.port === n.port ? "" : ":" + n.port), n;
|
|
8302
8304
|
}
|
|
8303
|
-
const
|
|
8305
|
+
const nh = typeof ArrayBuffer == "function", ih = (e) => typeof ArrayBuffer.isView == "function" ? ArrayBuffer.isView(e) : e.buffer instanceof ArrayBuffer, fs = Object.prototype.toString, oh = typeof Blob == "function" || typeof Blob < "u" && fs.call(Blob) === "[object BlobConstructor]", ah = typeof File == "function" || typeof File < "u" && fs.call(File) === "[object FileConstructor]";
|
|
8304
8306
|
function mi(e) {
|
|
8305
|
-
return
|
|
8307
|
+
return nh && (e instanceof ArrayBuffer || ih(e)) || oh && e instanceof Blob || ah && e instanceof File;
|
|
8306
8308
|
}
|
|
8307
8309
|
function Ur(e, t) {
|
|
8308
8310
|
if (!e || typeof e != "object")
|
|
@@ -8322,7 +8324,7 @@ function Ur(e, t) {
|
|
|
8322
8324
|
return !0;
|
|
8323
8325
|
return !1;
|
|
8324
8326
|
}
|
|
8325
|
-
function
|
|
8327
|
+
function sh(e) {
|
|
8326
8328
|
const t = [], r = e.data, n = e;
|
|
8327
8329
|
return n.data = Bn(r, t), n.attachments = t.length, { packet: n, buffers: t };
|
|
8328
8330
|
}
|
|
@@ -8345,7 +8347,7 @@ function Bn(e, t) {
|
|
|
8345
8347
|
}
|
|
8346
8348
|
return e;
|
|
8347
8349
|
}
|
|
8348
|
-
function
|
|
8350
|
+
function lh(e, t) {
|
|
8349
8351
|
return e.data = jn(e.data, t), delete e.attachments, e;
|
|
8350
8352
|
}
|
|
8351
8353
|
function jn(e, t) {
|
|
@@ -8363,7 +8365,7 @@ function jn(e, t) {
|
|
|
8363
8365
|
Object.prototype.hasOwnProperty.call(e, r) && (e[r] = jn(e[r], t));
|
|
8364
8366
|
return e;
|
|
8365
8367
|
}
|
|
8366
|
-
const
|
|
8368
|
+
const ch = [
|
|
8367
8369
|
"connect",
|
|
8368
8370
|
"connect_error",
|
|
8369
8371
|
"disconnect",
|
|
@@ -8371,12 +8373,12 @@ const lh = [
|
|
|
8371
8373
|
"newListener",
|
|
8372
8374
|
"removeListener"
|
|
8373
8375
|
// used by the Node.js EventEmitter
|
|
8374
|
-
],
|
|
8376
|
+
], uh = 5;
|
|
8375
8377
|
var J;
|
|
8376
8378
|
(function(e) {
|
|
8377
8379
|
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";
|
|
8378
8380
|
})(J || (J = {}));
|
|
8379
|
-
class
|
|
8381
|
+
class dh {
|
|
8380
8382
|
/**
|
|
8381
8383
|
* Encoder constructor
|
|
8382
8384
|
*
|
|
@@ -8412,7 +8414,7 @@ class uh {
|
|
|
8412
8414
|
* a list of buffers.
|
|
8413
8415
|
*/
|
|
8414
8416
|
encodeAsBinary(t) {
|
|
8415
|
-
const r =
|
|
8417
|
+
const r = sh(t), n = this.encodeAsString(r.packet), i = r.buffers;
|
|
8416
8418
|
return i.unshift(n), i;
|
|
8417
8419
|
}
|
|
8418
8420
|
}
|
|
@@ -8440,7 +8442,7 @@ class pi extends ue {
|
|
|
8440
8442
|
throw new Error("got plaintext data when reconstructing a packet");
|
|
8441
8443
|
r = this.decodeString(t);
|
|
8442
8444
|
const n = r.type === J.BINARY_EVENT;
|
|
8443
|
-
n || r.type === J.BINARY_ACK ? (r.type = n ? J.EVENT : J.ACK, this.reconstructor = new
|
|
8445
|
+
n || r.type === J.BINARY_ACK ? (r.type = n ? J.EVENT : J.ACK, this.reconstructor = new fh(r), r.attachments === 0 && super.emitReserved("decoded", r)) : super.emitReserved("decoded", r);
|
|
8444
8446
|
} else if (mi(t) || t.base64)
|
|
8445
8447
|
if (this.reconstructor)
|
|
8446
8448
|
r = this.reconstructor.takeBinaryData(t), r && (this.reconstructor = null, super.emitReserved("decoded", r));
|
|
@@ -8518,7 +8520,7 @@ class pi extends ue {
|
|
|
8518
8520
|
return typeof r == "string" || No(r);
|
|
8519
8521
|
case J.EVENT:
|
|
8520
8522
|
case J.BINARY_EVENT:
|
|
8521
|
-
return Array.isArray(r) && (typeof r[0] == "number" || typeof r[0] == "string" &&
|
|
8523
|
+
return Array.isArray(r) && (typeof r[0] == "number" || typeof r[0] == "string" && ch.indexOf(r[0]) === -1);
|
|
8522
8524
|
case J.ACK:
|
|
8523
8525
|
case J.BINARY_ACK:
|
|
8524
8526
|
return Array.isArray(r);
|
|
@@ -8531,7 +8533,7 @@ class pi extends ue {
|
|
|
8531
8533
|
this.reconstructor && (this.reconstructor.finishedReconstruction(), this.reconstructor = null);
|
|
8532
8534
|
}
|
|
8533
8535
|
}
|
|
8534
|
-
class
|
|
8536
|
+
class fh {
|
|
8535
8537
|
constructor(t) {
|
|
8536
8538
|
this.packet = t, this.buffers = [], this.reconPack = t;
|
|
8537
8539
|
}
|
|
@@ -8545,7 +8547,7 @@ class dh {
|
|
|
8545
8547
|
*/
|
|
8546
8548
|
takeBinaryData(t) {
|
|
8547
8549
|
if (this.buffers.push(t), this.buffers.length === this.reconPack.attachments) {
|
|
8548
|
-
const r =
|
|
8550
|
+
const r = lh(this.reconPack, this.buffers);
|
|
8549
8551
|
return this.finishedReconstruction(), r;
|
|
8550
8552
|
}
|
|
8551
8553
|
return null;
|
|
@@ -8557,21 +8559,21 @@ class dh {
|
|
|
8557
8559
|
this.reconPack = null, this.buffers = [];
|
|
8558
8560
|
}
|
|
8559
8561
|
}
|
|
8560
|
-
const
|
|
8562
|
+
const hh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
8561
8563
|
__proto__: null,
|
|
8562
8564
|
Decoder: pi,
|
|
8563
|
-
Encoder:
|
|
8565
|
+
Encoder: dh,
|
|
8564
8566
|
get PacketType() {
|
|
8565
8567
|
return J;
|
|
8566
8568
|
},
|
|
8567
|
-
protocol:
|
|
8569
|
+
protocol: uh
|
|
8568
8570
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
8569
8571
|
function Ie(e, t, r) {
|
|
8570
8572
|
return e.on(t, r), function() {
|
|
8571
8573
|
e.off(t, r);
|
|
8572
8574
|
};
|
|
8573
8575
|
}
|
|
8574
|
-
const
|
|
8576
|
+
const mh = Object.freeze({
|
|
8575
8577
|
connect: 1,
|
|
8576
8578
|
connect_error: 1,
|
|
8577
8579
|
disconnect: 1,
|
|
@@ -8696,7 +8698,7 @@ class hs extends ue {
|
|
|
8696
8698
|
*/
|
|
8697
8699
|
emit(t, ...r) {
|
|
8698
8700
|
var n, i, o;
|
|
8699
|
-
if (
|
|
8701
|
+
if (mh.hasOwnProperty(t))
|
|
8700
8702
|
throw new Error('"' + t.toString() + '" is a reserved event name');
|
|
8701
8703
|
if (r.unshift(t), this._opts.retries && !this.flags.fromQueue && !this.flags.volatile)
|
|
8702
8704
|
return this._addToQueue(r), this;
|
|
@@ -9203,7 +9205,7 @@ class $n extends ue {
|
|
|
9203
9205
|
max: this.reconnectionDelayMax(),
|
|
9204
9206
|
jitter: this.randomizationFactor()
|
|
9205
9207
|
}), this.timeout(r.timeout == null ? 2e4 : r.timeout), this._readyState = "closed", this.uri = t;
|
|
9206
|
-
const i = r.parser ||
|
|
9208
|
+
const i = r.parser || hh;
|
|
9207
9209
|
this.encoder = new i.Encoder(), this.decoder = new i.Decoder(), this._autoConnect = r.autoConnect !== !1, this._autoConnect && this.open();
|
|
9208
9210
|
}
|
|
9209
9211
|
reconnection(t) {
|
|
@@ -9246,7 +9248,7 @@ class $n extends ue {
|
|
|
9246
9248
|
open(t) {
|
|
9247
9249
|
if (~this._readyState.indexOf("open"))
|
|
9248
9250
|
return this;
|
|
9249
|
-
this.engine = new
|
|
9251
|
+
this.engine = new th(this.uri, this.opts);
|
|
9250
9252
|
const r = this.engine, n = this;
|
|
9251
9253
|
this._readyState = "opening", this.skipReconnect = !1;
|
|
9252
9254
|
const i = Ie(r, "open", function() {
|
|
@@ -9436,7 +9438,7 @@ class $n extends ue {
|
|
|
9436
9438
|
const Bt = {};
|
|
9437
9439
|
function Br(e, t) {
|
|
9438
9440
|
typeof e == "object" && (t = e, e = void 0), t = t || {};
|
|
9439
|
-
const r =
|
|
9441
|
+
const r = rh(e, t.path || "/socket.io"), n = r.source, i = r.id, o = r.path, a = Bt[i] && o in Bt[i].nsps, s = t.forceNew || t["force new connection"] || t.multiplex === !1 || a;
|
|
9440
9442
|
let c;
|
|
9441
9443
|
return s ? c = new $n(n, t) : (Bt[i] || (Bt[i] = new $n(n, t)), c = Bt[i]), r.query && !t.query && (t.query = r.queryKey), c.socket(r.path, t);
|
|
9442
9444
|
}
|
|
@@ -9446,20 +9448,20 @@ Object.assign(Br, {
|
|
|
9446
9448
|
io: Br,
|
|
9447
9449
|
connect: Br
|
|
9448
9450
|
});
|
|
9449
|
-
function
|
|
9451
|
+
function Um(e) {
|
|
9450
9452
|
const r = `${Xr()}/media/${e}`.replace(/\\/g, "/");
|
|
9451
|
-
return { mediaUrl: `${r}/${
|
|
9453
|
+
return { mediaUrl: `${r}/${Lu}`, indexUrl: `${r}/index.json` };
|
|
9452
9454
|
}
|
|
9453
|
-
function
|
|
9455
|
+
function ph(e) {
|
|
9454
9456
|
return `${Xr()}/media/${e}`.replace(/\\/g, "/");
|
|
9455
9457
|
}
|
|
9456
|
-
function
|
|
9457
|
-
return
|
|
9458
|
+
function gh(e, t) {
|
|
9459
|
+
return ph(t ?? `${e}/poster.jpg`);
|
|
9458
9460
|
}
|
|
9459
9461
|
function ms(e) {
|
|
9460
9462
|
return `${Xr()}${e}`.replace(/\\/g, "/");
|
|
9461
9463
|
}
|
|
9462
|
-
async function
|
|
9464
|
+
async function yh(e) {
|
|
9463
9465
|
try {
|
|
9464
9466
|
const t = await fetch(ms("/api/tierlist"));
|
|
9465
9467
|
if (!t.ok)
|
|
@@ -9475,19 +9477,19 @@ async function gh(e) {
|
|
|
9475
9477
|
}
|
|
9476
9478
|
}
|
|
9477
9479
|
let Fo = !1;
|
|
9478
|
-
function
|
|
9480
|
+
function Bm() {
|
|
9479
9481
|
if (Fo || typeof Image > "u") return;
|
|
9480
9482
|
const e = B.getState().tierlist;
|
|
9481
9483
|
if (!(!e || e.items.length === 0)) {
|
|
9482
9484
|
Fo = !0;
|
|
9483
9485
|
for (const t of e.items) {
|
|
9484
9486
|
const r = new Image();
|
|
9485
|
-
r.decoding = "async", r.src =
|
|
9487
|
+
r.decoding = "async", r.src = gh(t.id, t.thumbnail);
|
|
9486
9488
|
}
|
|
9487
9489
|
T("tierlist", "Warming posters", { count: e.items.length });
|
|
9488
9490
|
}
|
|
9489
9491
|
}
|
|
9490
|
-
async function
|
|
9492
|
+
async function jm(e) {
|
|
9491
9493
|
const t = B.getState();
|
|
9492
9494
|
t.setTierlistSaving(!0);
|
|
9493
9495
|
try {
|
|
@@ -9506,37 +9508,37 @@ async function Bm(e) {
|
|
|
9506
9508
|
B.getState().setTierlistSaving(!1);
|
|
9507
9509
|
}
|
|
9508
9510
|
}
|
|
9509
|
-
function
|
|
9511
|
+
function vh() {
|
|
9510
9512
|
const e = B.getState(), t = new Set(Object.values(e.roster).map((o) => o.sprite).filter(Boolean)), r = Ae.find((o) => !t.has(o));
|
|
9511
9513
|
if (!r)
|
|
9512
9514
|
return ie("socket", "sprite_taken: no available sprites to retry with"), null;
|
|
9513
9515
|
const n = !!e.name && !xt(e.name), i = n ? e.name : Vr(r);
|
|
9514
9516
|
return T("socket", "sprite_taken: retrying with next available", { from: e.sprite, to: r, name: i, keptCustomName: n }), e.setSessionIdentity(i, r), { name: i, sprite: r };
|
|
9515
9517
|
}
|
|
9516
|
-
function
|
|
9518
|
+
function bh(e) {
|
|
9517
9519
|
const t = B.getState(), r = e ? t.roster[e] : void 0;
|
|
9518
9520
|
return !r || !!r.sprite && r.sprite === t.sprite;
|
|
9519
9521
|
}
|
|
9520
|
-
const
|
|
9521
|
-
function
|
|
9522
|
+
const wh = 10;
|
|
9523
|
+
function _h(e = typeof window < "u" ? window : void 0) {
|
|
9522
9524
|
if (!e) return { framed: !1, depth: 0 };
|
|
9523
9525
|
try {
|
|
9524
9526
|
let t = 0, r = e;
|
|
9525
|
-
for (; r !== r.parent && t <
|
|
9527
|
+
for (; r !== r.parent && t < wh; )
|
|
9526
9528
|
t++, r = r.parent;
|
|
9527
9529
|
return { framed: e.top ? e.top !== e.self : t > 0, depth: t };
|
|
9528
9530
|
} catch {
|
|
9529
9531
|
return { framed: !1, depth: 0 };
|
|
9530
9532
|
}
|
|
9531
9533
|
}
|
|
9532
|
-
function
|
|
9534
|
+
function Eh(e, t, r) {
|
|
9533
9535
|
const n = !!e.name && !r(e.name) && (!t || r(t.name || "")), i = !!e.avatarId && (!t || t.avatarId !== e.avatarId);
|
|
9534
9536
|
if (!n && !i)
|
|
9535
9537
|
return null;
|
|
9536
9538
|
const o = {};
|
|
9537
9539
|
return n && (o.name = e.name), i && (o.avatarId = e.avatarId), o;
|
|
9538
9540
|
}
|
|
9539
|
-
function
|
|
9541
|
+
function Sh(e, t) {
|
|
9540
9542
|
let r = 0;
|
|
9541
9543
|
for (const n of e.videos) {
|
|
9542
9544
|
const i = Pt.voteKey(t, e.id, n.mediaId);
|
|
@@ -9544,49 +9546,49 @@ function Eh(e, t) {
|
|
|
9544
9546
|
}
|
|
9545
9547
|
return r;
|
|
9546
9548
|
}
|
|
9547
|
-
const
|
|
9548
|
-
function
|
|
9549
|
+
const Rh = 2e4, Th = 1e4;
|
|
9550
|
+
function Ch() {
|
|
9549
9551
|
return { unansweredSince: null, lastPongAt: null, lastTickAt: null };
|
|
9550
9552
|
}
|
|
9551
|
-
function
|
|
9553
|
+
function Ah(e, t) {
|
|
9552
9554
|
e.lastPongAt = t, e.unansweredSince = null;
|
|
9553
9555
|
}
|
|
9554
|
-
function
|
|
9555
|
-
const n = e.lastTickAt !== null && t - e.lastTickAt >
|
|
9556
|
-
return e.lastTickAt = t, r ? n || e.unansweredSince === null ? (e.unansweredSince = t, !1) : t - e.unansweredSince >
|
|
9556
|
+
function xh(e, t, r) {
|
|
9557
|
+
const n = e.lastTickAt !== null && t - e.lastTickAt > Th;
|
|
9558
|
+
return e.lastTickAt = t, r ? n || e.unansweredSince === null ? (e.unansweredSince = t, !1) : t - e.unansweredSince > Rh : (e.unansweredSince = null, !1);
|
|
9557
9559
|
}
|
|
9558
9560
|
function ps(e, t) {
|
|
9559
9561
|
return e.lastPongAt === null ? void 0 : Math.max(0, t - e.lastPongAt);
|
|
9560
9562
|
}
|
|
9561
9563
|
let Y = null, Me = null, jr = null, De = null, et = null;
|
|
9562
|
-
const
|
|
9564
|
+
const kh = Oh(), gt = Ch();
|
|
9563
9565
|
let Tr = null, Tn = null, Uo = 0, gi = null, Hn = !1, yi = !1, Vt = !1, vi = null;
|
|
9564
|
-
function
|
|
9566
|
+
function $m(e) {
|
|
9565
9567
|
const t = Oe(), r = B.getState();
|
|
9566
9568
|
if (r.me.clientId && r.roster[r.me.clientId])
|
|
9567
9569
|
return (e.name || e.sprite) && (T("socket", "Identity update (already joined)", { name: e.name, sprite: e.sprite }), t.emit(te.IDENTITY_UPDATE, { name: e.name, sprite: e.sprite })), t;
|
|
9568
|
-
const n =
|
|
9570
|
+
const n = Ph(e);
|
|
9569
9571
|
return et = n, gi = { name: n.name, sprite: n.sprite }, t.connected ? (T("socket", "Emitting join", n), t.emit(te.JOIN, n)) : t.once("connect", () => {
|
|
9570
9572
|
T("socket", "Emitting join", n), t.emit(te.JOIN, n);
|
|
9571
9573
|
}), t;
|
|
9572
9574
|
}
|
|
9573
|
-
function
|
|
9575
|
+
function Ph(e) {
|
|
9574
9576
|
return {
|
|
9575
9577
|
room_key: e.room_key,
|
|
9576
9578
|
name: e.name,
|
|
9577
9579
|
sprite: e.sprite,
|
|
9578
9580
|
// Entry-path telemetry — see lib/embedContext.ts. Sent on every join AND
|
|
9579
9581
|
// rejoin (lastJoinPayload carries it), so a reconnect keeps the attribution.
|
|
9580
|
-
embed:
|
|
9581
|
-
delivery_arm:
|
|
9582
|
+
embed: _h(),
|
|
9583
|
+
delivery_arm: lf(),
|
|
9582
9584
|
// Identity tier input — see lib/deviceId.ts. Sent on every join AND rejoin
|
|
9583
9585
|
// (lastJoinPayload carries it) so a reconnect lands on the same
|
|
9584
9586
|
// ParticipantId rather than minting a new person.
|
|
9585
|
-
device_id:
|
|
9586
|
-
tab_id:
|
|
9587
|
+
device_id: _f(),
|
|
9588
|
+
tab_id: kh
|
|
9587
9589
|
};
|
|
9588
9590
|
}
|
|
9589
|
-
function
|
|
9591
|
+
function Oh() {
|
|
9590
9592
|
const e = globalThis.crypto;
|
|
9591
9593
|
if (e && typeof e.randomUUID == "function") return e.randomUUID();
|
|
9592
9594
|
const t = new Uint8Array(16);
|
|
@@ -9594,7 +9596,7 @@ function Ph() {
|
|
|
9594
9596
|
else for (let r = 0; r < t.length; r++) t[r] = Math.floor(Math.random() * 256);
|
|
9595
9597
|
return Array.from(t, (r) => r.toString(16).padStart(2, "0")).join("");
|
|
9596
9598
|
}
|
|
9597
|
-
function
|
|
9599
|
+
function Hm() {
|
|
9598
9600
|
return ps(gt, Date.now());
|
|
9599
9601
|
}
|
|
9600
9602
|
function Oe() {
|
|
@@ -9606,15 +9608,15 @@ function Oe() {
|
|
|
9606
9608
|
}
|
|
9607
9609
|
const r = new URL(t.startsWith("http") ? t : `${window.location.origin}${t}`).origin;
|
|
9608
9610
|
Y = Br(r, { path: hu, transports: ["websocket", "polling"] }), T("socket", "Socket initialized", { origin: t }), Zr("__SOCKET__", Y), De && (clearTimeout(De), De = null), Me = null, jr = setInterval(() => {
|
|
9609
|
-
if (
|
|
9611
|
+
if (xh(gt, Date.now(), !!Y?.connected)) {
|
|
9610
9612
|
ie("socket", "PONG-WATCHDOG no time_pong for 20s — replacing the connection", {
|
|
9611
9613
|
sid: Y?.id,
|
|
9612
9614
|
lastPongAgeMs: ps(gt, Date.now()) ?? null
|
|
9613
9615
|
}), Tn = "pong-watchdog", gt.unansweredSince = null, Y?.io.engine?.close();
|
|
9614
9616
|
return;
|
|
9615
9617
|
}
|
|
9616
|
-
|
|
9617
|
-
},
|
|
9618
|
+
$h();
|
|
9619
|
+
}, Iu), Y.on("connect", () => {
|
|
9618
9620
|
yi = !1;
|
|
9619
9621
|
const n = Y?.id;
|
|
9620
9622
|
if (T("socket", "Connected", { id: n, isReconnect: Vt }), n)
|
|
@@ -9650,7 +9652,7 @@ function Oe() {
|
|
|
9650
9652
|
Vt = !0;
|
|
9651
9653
|
}), Y.on("disconnect", (n) => {
|
|
9652
9654
|
Ba(null), Tr = { reason: Tn ?? n, at: Date.now() }, Tn = null, T("socket", "Disconnected", { reason: n });
|
|
9653
|
-
}), Y.on("connect_error", (n) => Ze("socket", "Connection error", { message: n?.message })), Y.on("reconnect_attempt", (n) => ie("socket", "Reconnect attempt", { attempt: n })), Y.on("reconnect_failed", () => Ze("socket", "Reconnect failed")),
|
|
9655
|
+
}), Y.on("connect_error", (n) => Ze("socket", "Connection error", { message: n?.message })), Y.on("reconnect_attempt", (n) => ie("socket", "Reconnect attempt", { attempt: n })), Y.on("reconnect_failed", () => Ze("socket", "Reconnect failed")), jh(Y);
|
|
9654
9656
|
}
|
|
9655
9657
|
return Y;
|
|
9656
9658
|
}
|
|
@@ -9674,7 +9676,7 @@ function Bo(e, t) {
|
|
|
9674
9676
|
systemType: e.systemType
|
|
9675
9677
|
};
|
|
9676
9678
|
}
|
|
9677
|
-
function
|
|
9679
|
+
function Ih(e) {
|
|
9678
9680
|
e.on(te.SNAPSHOT, (t) => {
|
|
9679
9681
|
e.emit(ct.SYNC), B.getState().applySnapshot({
|
|
9680
9682
|
roomId: t.room_id ?? null,
|
|
@@ -9684,7 +9686,7 @@ function Oh(e) {
|
|
|
9684
9686
|
serverSeq: t.server_seq || 0,
|
|
9685
9687
|
leaderId: t.leader_id || null
|
|
9686
9688
|
}), B.getState().name || T("socket", "Deferring identity to presence event (snapshot carries no roster)");
|
|
9687
|
-
const r = B.getState(), n = Y?.id, o = (n ? r.roster[n] : void 0) ?? gi, a =
|
|
9689
|
+
const r = B.getState(), n = Y?.id, o = (n ? r.roster[n] : void 0) ?? gi, a = Eh(
|
|
9688
9690
|
{ name: r.name, avatarId: r.sprite },
|
|
9689
9691
|
o ? { name: o.name, avatarId: o.sprite ?? null } : void 0,
|
|
9690
9692
|
// A join that carried no name counts as a default one, so a name that
|
|
@@ -9727,7 +9729,7 @@ function Oh(e) {
|
|
|
9727
9729
|
}), e.on(te.CONTROL_ACK, (t) => {
|
|
9728
9730
|
typeof t?.client_seq == "number" && typeof t?.server_seq == "number" && T("socket", "Control ack received", t);
|
|
9729
9731
|
}), e.on(te.TIME_PONG, (t) => {
|
|
9730
|
-
if (
|
|
9732
|
+
if (Ah(gt, Date.now()), Me && Me.ts) {
|
|
9731
9733
|
const r = Date.now() - Me.ts;
|
|
9732
9734
|
B.getState().addRttSample(r, t?.server_ts, Me.ts), Me = null, De && (clearTimeout(De), De = null), T("socket", "Time sync RTT", { rtt: r, offset: B.getState().drift.offsetMs });
|
|
9733
9735
|
}
|
|
@@ -9737,7 +9739,7 @@ function Oh(e) {
|
|
|
9737
9739
|
B.getState().setReadiness({ mediaId: r, ready: o, readyCount: n, total: i }), T("socket", "Ready state received", { mediaId: r, readyCount: n, total: i, ready: o });
|
|
9738
9740
|
});
|
|
9739
9741
|
}
|
|
9740
|
-
function
|
|
9742
|
+
function Lh(e) {
|
|
9741
9743
|
e.on(te.PRESENCE, (t) => {
|
|
9742
9744
|
if (!t) return;
|
|
9743
9745
|
if (Array.isArray(t.users)) {
|
|
@@ -9771,7 +9773,7 @@ function Ih(e) {
|
|
|
9771
9773
|
}
|
|
9772
9774
|
});
|
|
9773
9775
|
}
|
|
9774
|
-
function
|
|
9776
|
+
function Mh(e) {
|
|
9775
9777
|
e.on(te.CHAT_BROADCAST, (t) => {
|
|
9776
9778
|
const r = Bo(t, t.server_seq);
|
|
9777
9779
|
B.getState().appendChat(r), T("chat", "Message received", r);
|
|
@@ -9781,7 +9783,7 @@ function Lh(e) {
|
|
|
9781
9783
|
B.getState().setChat(r), T("chat", "History loaded", { count: r.length });
|
|
9782
9784
|
});
|
|
9783
9785
|
}
|
|
9784
|
-
function
|
|
9786
|
+
function Dh(e) {
|
|
9785
9787
|
e.on(Qe.STATE, (t) => {
|
|
9786
9788
|
B.getState().applyPlaylistState({
|
|
9787
9789
|
playlist: t?.playlist ?? null,
|
|
@@ -9794,78 +9796,78 @@ function Mh(e) {
|
|
|
9794
9796
|
B.getState().setPlaylistResults(t ?? null), T("playlist", "Results received", { playlistId: t?.playlist?.id, update: t?.update === !0 });
|
|
9795
9797
|
}), e.on(Qe.VOTES_CLEARED, (t) => {
|
|
9796
9798
|
if (!t?.playlistId || !Array.isArray(t.mediaIds)) return;
|
|
9797
|
-
const r =
|
|
9799
|
+
const r = Sh(
|
|
9798
9800
|
{ id: t.playlistId, videos: t.mediaIds.map((i) => ({ mediaId: i })) },
|
|
9799
|
-
|
|
9801
|
+
Id()
|
|
9800
9802
|
), n = B.getState();
|
|
9801
9803
|
n.playlist?.id === t.playlistId && n.applyPlaylistState({ playlist: n.playlist, activeIndex: n.activePlaylistIndex, myVotes: {} }), T("playlist", "Votes cleared by leader", { playlistId: t.playlistId, removed: r });
|
|
9802
9804
|
});
|
|
9803
9805
|
}
|
|
9804
|
-
function
|
|
9806
|
+
function Nh(e) {
|
|
9805
9807
|
e.on(Cu.UPDATED, () => {
|
|
9806
|
-
T("tierlist", "Someone saved — refreshing the board"),
|
|
9808
|
+
T("tierlist", "Someone saved — refreshing the board"), yh(!1);
|
|
9807
9809
|
});
|
|
9808
9810
|
}
|
|
9809
|
-
function
|
|
9811
|
+
function Fh(e) {
|
|
9810
9812
|
e.on(ni.STATE, (t) => {
|
|
9811
9813
|
if (!t || typeof t.active != "boolean") return;
|
|
9812
9814
|
const r = Array.isArray(t.ready) ? t.ready.filter((n) => typeof n == "string") : [];
|
|
9813
9815
|
B.getState().setReadyCheckState({ active: t.active, ready: r }), T("ready-check", "State received", { active: t.active, readyCount: r.length });
|
|
9814
9816
|
});
|
|
9815
9817
|
}
|
|
9816
|
-
function
|
|
9818
|
+
function zm() {
|
|
9817
9819
|
Y?.emit(ni.START, {});
|
|
9818
9820
|
}
|
|
9819
|
-
function
|
|
9821
|
+
function Vm(e) {
|
|
9820
9822
|
Y?.emit(ni.TOGGLE, { ready: e });
|
|
9821
9823
|
}
|
|
9822
|
-
function
|
|
9824
|
+
function Uh(e) {
|
|
9823
9825
|
e.on(ct.ACTIVE, (t) => {
|
|
9824
9826
|
const r = typeof t?.gameId == "string" ? t.gameId : null;
|
|
9825
9827
|
B.getState().setActiveGameId(r), t?.sessionWins && typeof t.sessionWins == "object" ? B.getState().setGameSessionWins(t.sessionWins) : r === null && B.getState().setGameSessionWins({}), typeof t?.botCount == "number" ? B.getState().setGameBotCount(t.botCount) : r === null && B.getState().setGameBotCount(0), T("game", "game_active", { gameId: r, sessionWins: t?.sessionWins, botCount: t?.botCount });
|
|
9826
9828
|
});
|
|
9827
9829
|
}
|
|
9828
|
-
function
|
|
9830
|
+
function qm(e) {
|
|
9829
9831
|
Y?.emit(ct.SELECT, { gameId: e });
|
|
9830
9832
|
}
|
|
9831
|
-
function
|
|
9833
|
+
function Wm(e) {
|
|
9832
9834
|
Y?.emit(ct.START_REQUEST, { gameId: e });
|
|
9833
9835
|
}
|
|
9834
|
-
function
|
|
9836
|
+
function Km() {
|
|
9835
9837
|
Y?.emit(ct.COUNTDOWN_REQUEST);
|
|
9836
9838
|
}
|
|
9837
|
-
function
|
|
9839
|
+
function Gm() {
|
|
9838
9840
|
Y?.emit(ct.SYNC);
|
|
9839
9841
|
}
|
|
9840
|
-
function
|
|
9842
|
+
function Ym(e) {
|
|
9841
9843
|
Y?.emit(ct.SET_BOTS, { count: e });
|
|
9842
9844
|
}
|
|
9843
|
-
function
|
|
9845
|
+
function Jm() {
|
|
9844
9846
|
Y?.emit(ct.SESSION_RESET);
|
|
9845
9847
|
}
|
|
9846
|
-
function
|
|
9848
|
+
function Bh(e) {
|
|
9847
9849
|
e.on(te.HEALTH_SNAPSHOT, (t) => {
|
|
9848
9850
|
B.getState().setHealthSnapshot(t);
|
|
9849
9851
|
}), e.on(te.BUFFER_STATUS, (t) => {
|
|
9850
9852
|
B.getState().setBufferStatus(t);
|
|
9851
9853
|
});
|
|
9852
9854
|
}
|
|
9853
|
-
function
|
|
9854
|
-
|
|
9855
|
+
function jh(e) {
|
|
9856
|
+
Ih(e), Lh(e), Mh(e), Bh(e), Dh(e), Nh(e), Fh(e), Uh(e), e.on(te.ERROR, (t) => {
|
|
9855
9857
|
const r = t?.code || "error/unknown";
|
|
9856
9858
|
if (r === "conflict" && t?.message === "sprite_held_by_you") {
|
|
9857
9859
|
yi = !0, T("socket", "sprite held by this account's other connection: keeping the server-assigned sprite");
|
|
9858
9860
|
return;
|
|
9859
9861
|
}
|
|
9860
9862
|
if (r === "conflict" && t?.message === "sprite_taken") {
|
|
9861
|
-
if (
|
|
9863
|
+
if (bh(Y?.id)) {
|
|
9862
9864
|
T("socket", "sprite_taken: stale, the server already has our sprite");
|
|
9863
9865
|
return;
|
|
9864
9866
|
}
|
|
9865
9867
|
Hn = !0;
|
|
9866
9868
|
let a;
|
|
9867
9869
|
try {
|
|
9868
|
-
a =
|
|
9870
|
+
a = vh();
|
|
9869
9871
|
} finally {
|
|
9870
9872
|
Hn = !1;
|
|
9871
9873
|
}
|
|
@@ -9896,15 +9898,15 @@ function Bh(e) {
|
|
|
9896
9898
|
(r.startsWith("auth/") ? ie : Ze)("socket", `Server error: ${i}`, { code: r, raw: t }), B.getState().pushToast("error", i);
|
|
9897
9899
|
});
|
|
9898
9900
|
}
|
|
9899
|
-
function
|
|
9901
|
+
function Xm(e, t) {
|
|
9900
9902
|
Oe().emit(te.CHAT_SEND, t?.length ? { text: e, images: t } : { text: e });
|
|
9901
9903
|
}
|
|
9902
|
-
function
|
|
9904
|
+
function $h() {
|
|
9903
9905
|
Me || (Me = { ts: Date.now() }, Oe().emit(te.TIME_PING, {}), De = setTimeout(() => {
|
|
9904
9906
|
Me && (T("socket", "Time ping timed out after 10s, clearing inflight"), Me = null), De = null;
|
|
9905
9907
|
}, 1e4));
|
|
9906
9908
|
}
|
|
9907
|
-
function
|
|
9909
|
+
function Qm(e, t) {
|
|
9908
9910
|
const r = {};
|
|
9909
9911
|
e && (r.name = e), t && (r.sprite = t), !(!r.name && !r.sprite) && (T("socket", "Sending identity update", r), Oe().emit(te.IDENTITY_UPDATE, r));
|
|
9910
9912
|
}
|
|
@@ -9920,14 +9922,14 @@ B.subscribe((e, t) => {
|
|
|
9920
9922
|
const a = {};
|
|
9921
9923
|
i && (a.name = e.name, Cr.name = e.name), o && (a.sprite = e.sprite, Cr.sprite = e.sprite), T("socket", "Identity reassert (store change)", a), Y?.connected ? Y.emit(te.IDENTITY_UPDATE, a) : Oe().emit(te.IDENTITY_UPDATE, a);
|
|
9922
9924
|
});
|
|
9923
|
-
function
|
|
9925
|
+
function Hh() {
|
|
9924
9926
|
jr && (clearInterval(jr), jr = null), De && (clearTimeout(De), De = null), Me = null, gt.unansweredSince = null, gt.lastTickAt = null;
|
|
9925
9927
|
}
|
|
9926
|
-
function
|
|
9928
|
+
function zh() {
|
|
9927
9929
|
T("socket", "clearJoinState called", { hadPayload: et !== null, room_key: et?.room_key }), et = null, Vt = !1, vi = null;
|
|
9928
9930
|
}
|
|
9929
|
-
function
|
|
9930
|
-
T("socket", "leaveRoom called", { room_key: et?.room_key }),
|
|
9931
|
+
function Vh() {
|
|
9932
|
+
T("socket", "leaveRoom called", { room_key: et?.room_key }), zh(), Hh(), Y && (Y.disconnect(), Y = null), B.setState({
|
|
9931
9933
|
me: { clientId: null, nextClientSeq: 1 },
|
|
9932
9934
|
roster: {},
|
|
9933
9935
|
snapshot: { roomId: null, mediaId: null, playheadMs: 0, playing: !1, serverSeq: 0, leaderId: null },
|
|
@@ -9943,48 +9945,48 @@ function zh() {
|
|
|
9943
9945
|
gameSessionWins: {}
|
|
9944
9946
|
});
|
|
9945
9947
|
}
|
|
9946
|
-
function
|
|
9948
|
+
function Zm(e) {
|
|
9947
9949
|
T("playlist", "Emitting playlist_load", { playlistId: e }), Oe().emit(Qe.LOAD, { playlistId: e });
|
|
9948
9950
|
}
|
|
9949
|
-
function
|
|
9951
|
+
function ep(e) {
|
|
9950
9952
|
T("playlist", "Emitting playlist_select", { index: e }), Oe().emit(Qe.SELECT, { index: e });
|
|
9951
9953
|
}
|
|
9952
|
-
function
|
|
9954
|
+
function tp(e, t, r) {
|
|
9953
9955
|
T("playlist", "Emitting playlist_vote_update", { playlistId: e, mediaId: t, vote: r }), Oe().emit(Qe.VOTE_UPDATE, { playlistId: e, mediaId: t, vote: r });
|
|
9954
9956
|
}
|
|
9955
|
-
function
|
|
9957
|
+
function rp() {
|
|
9956
9958
|
T("chat", "Emitting recap_request"), Oe().emit("recap_request");
|
|
9957
9959
|
}
|
|
9958
|
-
function
|
|
9960
|
+
function np() {
|
|
9959
9961
|
T("playlist", "Emitting playlist_reveal_request"), Oe().emit(Qe.REVEAL_REQUEST, {});
|
|
9960
9962
|
}
|
|
9961
|
-
function
|
|
9963
|
+
function ip(e) {
|
|
9962
9964
|
T("playlist", "Emitting playlist_vote_remove", { voterKey: e }), Oe().emit(Qe.VOTE_REMOVE, { voterKey: e });
|
|
9963
9965
|
}
|
|
9964
|
-
function
|
|
9966
|
+
function op(e) {
|
|
9965
9967
|
vi = e, Oe().emit(te.CLIENT_READY, { media_id: e }), T("socket", "client_ready emitted", { mediaId: e });
|
|
9966
9968
|
}
|
|
9967
|
-
function
|
|
9969
|
+
function qh(e) {
|
|
9968
9970
|
if (!e || e === "/" || document.querySelector(`link[rel="preconnect"][href="${e}"]`)) return;
|
|
9969
9971
|
const t = document.createElement("link");
|
|
9970
9972
|
t.rel = "preconnect", t.href = e, t.crossOrigin = "anonymous", document.head.appendChild(t);
|
|
9971
9973
|
}
|
|
9972
|
-
function
|
|
9974
|
+
function Wh(e, t, r) {
|
|
9973
9975
|
const n = Ps(e), i = r ? /* @__PURE__ */ U(Xe.StrictMode, { children: t }) : t;
|
|
9974
9976
|
return n.render(i), n;
|
|
9975
9977
|
}
|
|
9976
9978
|
let Ct = null, At = null;
|
|
9977
9979
|
const gs = import.meta.url.replace(/[^/]*$/, "");
|
|
9978
|
-
function
|
|
9980
|
+
function Kh(e) {
|
|
9979
9981
|
return !e.filename || !e.filename.startsWith(gs) ? !1 : !/^ResizeObserver loop/.test(e.message ?? "");
|
|
9980
9982
|
}
|
|
9981
|
-
function
|
|
9983
|
+
function ap(e, t = {}) {
|
|
9982
9984
|
const { basename: r, strictMode: n = !1, ...i } = t;
|
|
9983
|
-
|
|
9985
|
+
hd(), cd({
|
|
9984
9986
|
serverOrigin: i.serverOrigin,
|
|
9985
9987
|
defaultRoomKey: i.defaultRoomKey,
|
|
9986
9988
|
cdnBase: i.cdnBase
|
|
9987
|
-
}),
|
|
9989
|
+
}), wf(), Pd({
|
|
9988
9990
|
userType: i.userType,
|
|
9989
9991
|
userId: i.userId
|
|
9990
9992
|
}), B.getState().rehydrateFromPrefs();
|
|
@@ -10003,139 +10005,139 @@ function op(e, t = {}) {
|
|
|
10003
10005
|
} catch (f) {
|
|
10004
10006
|
ie("boot", "prefs.beacon.threw", { err: f?.message });
|
|
10005
10007
|
}
|
|
10006
|
-
|
|
10008
|
+
Ld(), Bd().then((f) => {
|
|
10007
10009
|
f && B.getState().rehydrateFromPrefs();
|
|
10008
10010
|
}), Ct || (Ct = (f) => {
|
|
10009
10011
|
Ze("app", "Unhandled promise rejection", { reason: String(f.reason) });
|
|
10010
10012
|
}, window.addEventListener("unhandledrejection", Ct)), At || (At = (f) => {
|
|
10011
|
-
|
|
10013
|
+
Kh(f) && Ze("app", "Uncaught error", {
|
|
10012
10014
|
message: f.message,
|
|
10013
10015
|
source: `${f.filename.slice(gs.length)}:${f.lineno}:${f.colno}`,
|
|
10014
10016
|
stack: f.error instanceof Error ? f.error.stack?.slice(0, 1500) : void 0
|
|
10015
10017
|
});
|
|
10016
|
-
}, window.addEventListener("error", At)), i.serverOrigin &&
|
|
10018
|
+
}, window.addEventListener("error", At)), i.serverOrigin && qh(i.serverOrigin);
|
|
10017
10019
|
const o = li().theme;
|
|
10018
|
-
o && Ls.includes(o) && Ms(o),
|
|
10019
|
-
const s =
|
|
10020
|
+
o && Ls.includes(o) && Ms(o), kd(), e.__watchparty?.root.unmount();
|
|
10021
|
+
const s = bf({
|
|
10020
10022
|
basename: r,
|
|
10021
10023
|
appProps: i
|
|
10022
|
-
}), u = { root:
|
|
10024
|
+
}), u = { root: Wh(e, /* @__PURE__ */ U(lu, { router: s }), n) };
|
|
10023
10025
|
return e.__watchparty = u, s;
|
|
10024
10026
|
}
|
|
10025
|
-
function
|
|
10027
|
+
function sp(e) {
|
|
10026
10028
|
const t = e.__watchparty;
|
|
10027
|
-
t && (t.root.unmount(), delete e.__watchparty,
|
|
10029
|
+
t && (t.root.unmount(), delete e.__watchparty, Vh(), Ct && (window.removeEventListener("unhandledrejection", Ct), Ct = null), At && (window.removeEventListener("error", At), At = null));
|
|
10028
10030
|
}
|
|
10029
10031
|
export {
|
|
10030
|
-
|
|
10031
|
-
|
|
10032
|
+
ym as $,
|
|
10033
|
+
zu as A,
|
|
10032
10034
|
li as B,
|
|
10033
10035
|
Ae as C,
|
|
10034
10036
|
ti as D,
|
|
10035
10037
|
go as E,
|
|
10036
10038
|
tn as F,
|
|
10037
|
-
|
|
10038
|
-
|
|
10039
|
-
|
|
10039
|
+
qm as G,
|
|
10040
|
+
um as H,
|
|
10041
|
+
cm as I,
|
|
10040
10042
|
Zr as J,
|
|
10041
|
-
|
|
10043
|
+
Vm as K,
|
|
10042
10044
|
Hr as L,
|
|
10043
10045
|
vn as M,
|
|
10044
|
-
|
|
10045
|
-
|
|
10046
|
-
|
|
10047
|
-
|
|
10048
|
-
|
|
10049
|
-
|
|
10050
|
-
|
|
10046
|
+
zm as N,
|
|
10047
|
+
lm as O,
|
|
10048
|
+
yh as P,
|
|
10049
|
+
jm as Q,
|
|
10050
|
+
gh as R,
|
|
10051
|
+
Tm as S,
|
|
10052
|
+
im as T,
|
|
10051
10053
|
vt as U,
|
|
10052
10054
|
Oe as V,
|
|
10053
10055
|
te as W,
|
|
10054
|
-
|
|
10055
|
-
|
|
10056
|
-
|
|
10057
|
-
|
|
10058
|
-
|
|
10059
|
-
|
|
10060
|
-
|
|
10061
|
-
|
|
10062
|
-
|
|
10063
|
-
|
|
10064
|
-
|
|
10065
|
-
|
|
10066
|
-
|
|
10067
|
-
|
|
10068
|
-
|
|
10069
|
-
|
|
10056
|
+
sm as X,
|
|
10057
|
+
pm as Y,
|
|
10058
|
+
Dm as Z,
|
|
10059
|
+
Mm as _,
|
|
10060
|
+
Am as a,
|
|
10061
|
+
gm as a0,
|
|
10062
|
+
fm as a1,
|
|
10063
|
+
am as a2,
|
|
10064
|
+
_m as a3,
|
|
10065
|
+
bm as a4,
|
|
10066
|
+
wm as a5,
|
|
10067
|
+
vm as a6,
|
|
10068
|
+
Pm as a7,
|
|
10069
|
+
nm as a8,
|
|
10070
|
+
Hm as a9,
|
|
10071
|
+
om as aA,
|
|
10070
10072
|
ai as aB,
|
|
10071
10073
|
ct as aC,
|
|
10072
|
-
|
|
10073
|
-
|
|
10074
|
-
|
|
10075
|
-
|
|
10076
|
-
|
|
10077
|
-
|
|
10074
|
+
Ym as aD,
|
|
10075
|
+
tm as aE,
|
|
10076
|
+
Km as aF,
|
|
10077
|
+
Wm as aG,
|
|
10078
|
+
Gm as aH,
|
|
10079
|
+
Jm as aI,
|
|
10078
10080
|
Ne as aJ,
|
|
10079
|
-
|
|
10080
|
-
|
|
10081
|
+
Lm as aK,
|
|
10082
|
+
ip as aL,
|
|
10081
10083
|
Pt as aM,
|
|
10082
|
-
|
|
10083
|
-
|
|
10084
|
-
|
|
10085
|
-
|
|
10086
|
-
|
|
10087
|
-
|
|
10088
|
-
|
|
10089
|
-
|
|
10090
|
-
|
|
10084
|
+
Id as aN,
|
|
10085
|
+
tp as aO,
|
|
10086
|
+
np as aP,
|
|
10087
|
+
ep as aQ,
|
|
10088
|
+
ap as aR,
|
|
10089
|
+
sp as aS,
|
|
10090
|
+
bf as aT,
|
|
10091
|
+
lf as aa,
|
|
10092
|
+
ud as ab,
|
|
10091
10093
|
On as ac,
|
|
10092
|
-
|
|
10093
|
-
|
|
10094
|
-
|
|
10095
|
-
|
|
10096
|
-
|
|
10097
|
-
|
|
10098
|
-
|
|
10099
|
-
|
|
10100
|
-
|
|
10094
|
+
dm as ad,
|
|
10095
|
+
hm as ae,
|
|
10096
|
+
em as af,
|
|
10097
|
+
Um as ag,
|
|
10098
|
+
Em as ah,
|
|
10099
|
+
ph as ai,
|
|
10100
|
+
Lu as aj,
|
|
10101
|
+
mm as ak,
|
|
10102
|
+
op as al,
|
|
10101
10103
|
Da as am,
|
|
10102
10104
|
kt as an,
|
|
10103
10105
|
Ya as ao,
|
|
10104
10106
|
ic as ap,
|
|
10105
|
-
|
|
10106
|
-
|
|
10107
|
-
|
|
10107
|
+
kd as aq,
|
|
10108
|
+
Bd as ar,
|
|
10109
|
+
$m as as,
|
|
10108
10110
|
Ln as at,
|
|
10109
|
-
|
|
10110
|
-
|
|
10111
|
-
|
|
10112
|
-
|
|
10113
|
-
|
|
10111
|
+
Sm as au,
|
|
10112
|
+
Rm as av,
|
|
10113
|
+
Zm as aw,
|
|
10114
|
+
Im as ax,
|
|
10115
|
+
Om as ay,
|
|
10114
10116
|
Vr as az,
|
|
10115
10117
|
Kt as b,
|
|
10116
|
-
|
|
10118
|
+
ld as c,
|
|
10117
10119
|
T as d,
|
|
10118
10120
|
Ze as e,
|
|
10119
|
-
|
|
10121
|
+
Cm as f,
|
|
10120
10122
|
Xr as g,
|
|
10121
10123
|
B as h,
|
|
10122
10124
|
va as i,
|
|
10123
|
-
|
|
10125
|
+
xd as j,
|
|
10124
10126
|
Oa as k,
|
|
10125
10127
|
Ta as l,
|
|
10126
|
-
|
|
10127
|
-
|
|
10128
|
-
|
|
10129
|
-
|
|
10130
|
-
|
|
10131
|
-
|
|
10128
|
+
xm as m,
|
|
10129
|
+
Bm as n,
|
|
10130
|
+
rp as o,
|
|
10131
|
+
Xm as p,
|
|
10132
|
+
rm as q,
|
|
10133
|
+
km as r,
|
|
10132
10134
|
Ha as s,
|
|
10133
10135
|
mu as t,
|
|
10134
10136
|
rc as u,
|
|
10135
|
-
|
|
10137
|
+
Nm as v,
|
|
10136
10138
|
ie as w,
|
|
10137
|
-
|
|
10138
|
-
|
|
10139
|
+
Vh as x,
|
|
10140
|
+
Qm as y,
|
|
10139
10141
|
Qa as z
|
|
10140
10142
|
};
|
|
10141
|
-
//# sourceMappingURL=index-
|
|
10143
|
+
//# sourceMappingURL=index-CFH_9amZ.js.map
|