@hadoku/watchparty-ui 0.45.104 → 0.45.105
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-DcGc-1vo.js → AdminPanel-C59vWHjn.js} +11 -11
- package/dist/chunks/{AdminPanel-DcGc-1vo.js.map → AdminPanel-C59vWHjn.js.map} +1 -1
- package/dist/chunks/{MediaDrawer-BUvcV9QZ.js → MediaDrawer-BSqgbHWw.js} +4 -4
- package/dist/chunks/{MediaDrawer-BUvcV9QZ.js.map → MediaDrawer-BSqgbHWw.js.map} +1 -1
- package/dist/chunks/{PlaylistPanel-CTgSeMHH.js → PlaylistPanel-Ceu23PeI.js} +13 -13
- package/dist/chunks/{PlaylistPanel-CTgSeMHH.js.map → PlaylistPanel-Ceu23PeI.js.map} +1 -1
- package/dist/chunks/{Room-HSQO8Lrm.js → Room-BqP-6mZY.js} +457 -455
- package/dist/chunks/Room-BqP-6mZY.js.map +1 -0
- package/dist/chunks/{index-DlwQHczp.js → index-Bowaa917.js} +1899 -1850
- package/dist/chunks/index-Bowaa917.js.map +1 -0
- package/dist/chunks/{submissionsApi-C70dUl1g.js → submissionsApi-DIQ4p6jf.js} +10 -10
- package/dist/chunks/{submissionsApi-C70dUl1g.js.map → submissionsApi-DIQ4p6jf.js.map} +1 -1
- package/dist/index.js +1 -1
- package/dist/room-chrome.js +851 -812
- package/dist/room-chrome.js.map +1 -1
- package/package.json +3 -3
- package/dist/chunks/Room-HSQO8Lrm.js.map +0 -1
- package/dist/chunks/index-DlwQHczp.js.map +0 -1
package/dist/room-chrome.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { jsx as l, jsxs as y, Fragment as ee } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { themePrefs as pe, Icon as
|
|
4
|
-
import { createCdnClient as
|
|
5
|
-
import { ensureCosmeticsStyles as
|
|
6
|
-
import { create as
|
|
7
|
-
import { pickAvatar as
|
|
2
|
+
import qe, { useState as E, useRef as z, useMemo as G, useCallback as D, useEffect as A, createContext as ht, useContext as un, useSyncExternalStore as mn, useLayoutEffect as Ot, useId as ya, useEffectEvent as gn } from "react";
|
|
3
|
+
import { themePrefs as pe, Icon as wa, THEMES as va, useHadokuThemeOptional as ka } from "@wolffm/themes";
|
|
4
|
+
import { createCdnClient as _a, kindOfType as xa, MAX_BYTES as Sa, measureImage as Ta, filesFromClipboard as Ca, filesFromDrop as Ia, CdnError as ct } from "@wolffm/cdn-client";
|
|
5
|
+
import { ensureCosmeticsStyles as Ea, cleanWorn as Aa, readPictureColour as Na, onPictureColour as Ra, pictureColour as ja, decorHtml as Pa, messageHtml as pn, nameHtml as hn, finishReveal as Ma } from "@wolffm/prefs-client/cosmetics";
|
|
6
|
+
import { create as Da } from "zustand";
|
|
7
|
+
import { pickAvatar as bn, applyReaction as La, resolveIdentityReassert as Oa } from "@wolffm/rooms-protocol";
|
|
8
8
|
import { z as f } from "zod";
|
|
9
|
-
import { createPrefsClient as
|
|
10
|
-
import { io as
|
|
11
|
-
import { fetchCharacter as
|
|
12
|
-
import { relayIdentityChanges as
|
|
13
|
-
import { createPortal as
|
|
14
|
-
import { useCatalogueSearch as
|
|
15
|
-
const
|
|
16
|
-
function
|
|
17
|
-
return typeof e == "string" &&
|
|
18
|
-
}
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const
|
|
9
|
+
import { createPrefsClient as Ha, getDeviceId as Ua, DEVICE_ID_KEY as Fa } from "@wolffm/prefs-client";
|
|
10
|
+
import { io as dt } from "socket.io-client";
|
|
11
|
+
import { fetchCharacter as $a, characterOf as qa, onAvatarChange as za } from "@wolffm/prefs-client/avatar";
|
|
12
|
+
import { relayIdentityChanges as Ba } from "@wolffm/task-ui-components/identity-relay";
|
|
13
|
+
import { createPortal as yn } from "react-dom";
|
|
14
|
+
import { useCatalogueSearch as Wa } from "@wolffm/cdn-client/react";
|
|
15
|
+
const wn = "https://cdn.hadoku.me", vn = /^[0-9a-f]{64}\.(?:png|jpe?g|gif|webp|avif)$/;
|
|
16
|
+
function bt(e) {
|
|
17
|
+
return typeof e == "string" && vn.test(e);
|
|
18
|
+
}
|
|
19
|
+
const yt = 8080, kn = 5173, Ga = "/watchparty/ws", _n = 500, Va = 1e3, te = 4, xn = typeof process < "u" && process.env ? process.env : {};
|
|
20
|
+
xn.PRODUCTION_UI_URL;
|
|
21
|
+
xn.PRODUCTION_SERVER_URL;
|
|
22
|
+
const Me = f.enum(["S", "A", "B", "C", "D", "F"]), Ht = 2e4, Ka = 300;
|
|
23
23
|
f.object({
|
|
24
24
|
name: f.string().min(1).max(32).optional(),
|
|
25
25
|
sprite: f.string().min(1).max(32).optional(),
|
|
@@ -52,7 +52,7 @@ const _ = {
|
|
|
52
52
|
// 'ready_state' here = playback-readiness gate (distinct from READY_EVENTS.STATE = "ready check" UX feature)
|
|
53
53
|
READY_STATE: "ready_state",
|
|
54
54
|
ERROR: "error"
|
|
55
|
-
},
|
|
55
|
+
}, Ya = f.enum(["play", "pause", "seek", "load", "home"]), Ja = f.object({
|
|
56
56
|
framed: f.boolean(),
|
|
57
57
|
depth: f.number().int().nonnegative().max(10)
|
|
58
58
|
});
|
|
@@ -60,7 +60,7 @@ f.object({
|
|
|
60
60
|
room_key: f.string(),
|
|
61
61
|
name: f.string().min(1).max(32).optional(),
|
|
62
62
|
sprite: f.string().min(1).max(32).optional(),
|
|
63
|
-
embed:
|
|
63
|
+
embed: Ja.optional(),
|
|
64
64
|
/** Which media-delivery path this client resolved to ('range' | 'fragment').
|
|
65
65
|
* Optional so older clients still validate. Reported so a party's logs can be split by
|
|
66
66
|
* arm — without it an A/B rollout is unmeasurable, exactly as entry path was before
|
|
@@ -108,13 +108,13 @@ f.object({
|
|
|
108
108
|
});
|
|
109
109
|
f.object({
|
|
110
110
|
client_seq: f.number().int().positive(),
|
|
111
|
-
kind:
|
|
111
|
+
kind: Ya,
|
|
112
112
|
to_ms: f.number().int().nonnegative().optional(),
|
|
113
113
|
media_id: f.string().optional()
|
|
114
114
|
// leader_id removed - not needed since set_leader control was removed
|
|
115
115
|
});
|
|
116
|
-
const
|
|
117
|
-
key: f.string().regex(
|
|
116
|
+
const Sn = f.object({
|
|
117
|
+
key: f.string().regex(vn, "not a CDN image key"),
|
|
118
118
|
/**
|
|
119
119
|
* Intrinsic pixels, or **0 meaning "unknown"**.
|
|
120
120
|
*
|
|
@@ -127,8 +127,8 @@ const _n = f.object({
|
|
|
127
127
|
* text went with it, with nothing said. Widening is backward compatible —
|
|
128
128
|
* every message already in history carries positive dimensions.
|
|
129
129
|
*/
|
|
130
|
-
w: f.number().int().nonnegative().max(
|
|
131
|
-
h: f.number().int().nonnegative().max(
|
|
130
|
+
w: f.number().int().nonnegative().max(Ht),
|
|
131
|
+
h: f.number().int().nonnegative().max(Ht),
|
|
132
132
|
/**
|
|
133
133
|
* Human-readable description, rendered as the `alt` text.
|
|
134
134
|
*
|
|
@@ -142,16 +142,16 @@ const _n = f.object({
|
|
|
142
142
|
* value only, never as markup. Bounded so one message cannot carry a
|
|
143
143
|
* paragraph; the library's own titles run well under this.
|
|
144
144
|
*/
|
|
145
|
-
title: f.string().max(
|
|
146
|
-
}),
|
|
145
|
+
title: f.string().max(Ka).optional()
|
|
146
|
+
}), Tn = /^[A-Za-z0-9_.:-]{1,64}$/;
|
|
147
147
|
f.object({
|
|
148
|
-
text: f.string().max(
|
|
148
|
+
text: f.string().max(_n),
|
|
149
149
|
style: f.string().max(64).optional(),
|
|
150
|
-
images: f.array(
|
|
150
|
+
images: f.array(Sn).max(te).optional(),
|
|
151
151
|
/** The message this one replies to. Optional: older clients never send it. */
|
|
152
|
-
reply_to: f.string().regex(
|
|
152
|
+
reply_to: f.string().regex(Tn).optional()
|
|
153
153
|
}).refine((e) => e.text.length > 0 || (e.images?.length ?? 0) > 0, { message: "message must carry text or at least one image" });
|
|
154
|
-
const
|
|
154
|
+
const Xa = f.enum(["join", "leave", "media_change", "identity_change", "recap"]);
|
|
155
155
|
f.object({
|
|
156
156
|
id: f.string(),
|
|
157
157
|
client_id: f.string(),
|
|
@@ -164,7 +164,7 @@ f.object({
|
|
|
164
164
|
ts: f.number(),
|
|
165
165
|
// Optional so a client on an older bundle still validates a message that
|
|
166
166
|
// has none, and so system messages (which never carry images) stay unchanged.
|
|
167
|
-
images: f.array(
|
|
167
|
+
images: f.array(Sn).max(te).optional(),
|
|
168
168
|
/** The id of the message this one answers (resolved by the client from
|
|
169
169
|
* what it holds; the original may have rolled out of history). */
|
|
170
170
|
reply_to: f.string().optional(),
|
|
@@ -172,14 +172,14 @@ f.object({
|
|
|
172
172
|
* ids `author` carries). Absent when there are none. */
|
|
173
173
|
reactions: f.array(f.object({ emoji: f.string(), by: f.array(f.string()) })).optional(),
|
|
174
174
|
isSystem: f.boolean().optional(),
|
|
175
|
-
systemType:
|
|
175
|
+
systemType: Xa.optional(),
|
|
176
176
|
/** A system line about a person: its text with `CHAT_NAME_TOKEN` where their
|
|
177
177
|
* name goes. `text` is that template filled when sent; a client fills it
|
|
178
178
|
* again with the person's CURRENT name (found by `author`) while they are
|
|
179
179
|
* here, so a rename reaches lines already on screen. */
|
|
180
180
|
template: f.string().optional()
|
|
181
181
|
});
|
|
182
|
-
const
|
|
182
|
+
const wt = "{name}", Qa = f.object({
|
|
183
183
|
avg_download_rate_bps: f.number().nonnegative(),
|
|
184
184
|
buffered_ahead_ms: f.number().nonnegative(),
|
|
185
185
|
rtt_ms: f.number().nonnegative(),
|
|
@@ -221,7 +221,7 @@ const yt = "{name}", Ya = f.object({
|
|
|
221
221
|
* socket shows here as a growing number while everything else looks fine. */
|
|
222
222
|
pong_age_ms: f.number().int().nonnegative().optional(),
|
|
223
223
|
reported_at: f.number().int().nonnegative()
|
|
224
|
-
}),
|
|
224
|
+
}), Za = Qa.extend({
|
|
225
225
|
client_id: f.string(),
|
|
226
226
|
name: f.string(),
|
|
227
227
|
sprite_id: f.string().nullable(),
|
|
@@ -232,10 +232,10 @@ const yt = "{name}", Ya = f.object({
|
|
|
232
232
|
stale_ms: f.number().int().nonnegative().optional()
|
|
233
233
|
});
|
|
234
234
|
f.object({
|
|
235
|
-
clients: f.array(
|
|
235
|
+
clients: f.array(Za),
|
|
236
236
|
server_ts: f.number().int().nonnegative()
|
|
237
237
|
});
|
|
238
|
-
const
|
|
238
|
+
const er = f.object({
|
|
239
239
|
client_id: f.string(),
|
|
240
240
|
sprite_id: f.string().nullable(),
|
|
241
241
|
name: f.string(),
|
|
@@ -253,13 +253,13 @@ const Xa = f.object({
|
|
|
253
253
|
video_ready_state: f.number().int().default(-1)
|
|
254
254
|
});
|
|
255
255
|
f.object({
|
|
256
|
-
clients: f.array(
|
|
256
|
+
clients: f.array(er),
|
|
257
257
|
server_ts: f.number().int().nonnegative()
|
|
258
258
|
});
|
|
259
259
|
f.object({
|
|
260
260
|
media_id: f.string()
|
|
261
261
|
});
|
|
262
|
-
const
|
|
262
|
+
const vt = f.enum(["super_upvote", "upvote", "mid", "downvote"]), tr = f.object({
|
|
263
263
|
mediaId: f.string(),
|
|
264
264
|
displayName: f.string(),
|
|
265
265
|
// Enrichment fields — present for flat-playlist ingest output, absent for
|
|
@@ -270,11 +270,11 @@ const wt = f.enum(["super_upvote", "upvote", "mid", "downvote"]), Qa = f.object(
|
|
|
270
270
|
durationMs: f.number().optional(),
|
|
271
271
|
uploadDate: f.string().optional()
|
|
272
272
|
// YouTube upload date 'YYYY-MM-DD'; drives playlist order
|
|
273
|
-
}),
|
|
273
|
+
}), nr = f.enum(["basic", "vote"]), Cn = f.object({
|
|
274
274
|
id: f.string(),
|
|
275
275
|
name: f.string(),
|
|
276
|
-
type:
|
|
277
|
-
videos: f.array(
|
|
276
|
+
type: nr.default("vote"),
|
|
277
|
+
videos: f.array(tr),
|
|
278
278
|
cover: f.string().optional()
|
|
279
279
|
// media-relative path to the playlist cover image
|
|
280
280
|
});
|
|
@@ -283,28 +283,28 @@ f.object({ index: f.number().int().min(0) });
|
|
|
283
283
|
f.object({
|
|
284
284
|
playlistId: f.string(),
|
|
285
285
|
mediaId: f.string(),
|
|
286
|
-
vote:
|
|
286
|
+
vote: vt
|
|
287
287
|
});
|
|
288
288
|
f.object({ voterKey: f.string().min(1).max(128) });
|
|
289
289
|
f.object({ playlistId: f.string(), mediaIds: f.array(f.string()) });
|
|
290
290
|
f.object({
|
|
291
|
-
playlist:
|
|
291
|
+
playlist: Cn.nullable(),
|
|
292
292
|
activeIndex: f.number().int().nullable(),
|
|
293
|
-
myVotes: f.record(f.string(),
|
|
293
|
+
myVotes: f.record(f.string(), vt)
|
|
294
294
|
// mediaId -> VoteValue
|
|
295
295
|
});
|
|
296
|
-
const
|
|
296
|
+
const ar = f.object({
|
|
297
297
|
clientId: f.string(),
|
|
298
298
|
name: f.string(),
|
|
299
299
|
votedCount: f.number().int().nonnegative(),
|
|
300
300
|
totalVideos: f.number().int().nonnegative()
|
|
301
301
|
});
|
|
302
302
|
f.object({
|
|
303
|
-
progress: f.array(
|
|
303
|
+
progress: f.array(ar)
|
|
304
304
|
});
|
|
305
305
|
f.object({
|
|
306
|
-
playlist:
|
|
307
|
-
votes: f.record(f.string(), f.record(f.string(),
|
|
306
|
+
playlist: Cn,
|
|
307
|
+
votes: f.record(f.string(), f.record(f.string(), vt)),
|
|
308
308
|
// votes[clientId][mediaId]
|
|
309
309
|
names: f.record(f.string(), f.string()),
|
|
310
310
|
// clientId -> display name
|
|
@@ -323,37 +323,37 @@ f.object({
|
|
|
323
323
|
* reveal is closed ignores it, rather than having the popup reappear. */
|
|
324
324
|
update: f.boolean().optional()
|
|
325
325
|
});
|
|
326
|
-
const
|
|
326
|
+
const Ee = {
|
|
327
327
|
STATE: "playlist_state",
|
|
328
328
|
VOTE_PROGRESS: "playlist_vote_progress",
|
|
329
329
|
RESULTS: "playlist_results",
|
|
330
330
|
/** Server -> the removed voter: forget the ballot you hold in localStorage. */
|
|
331
331
|
VOTES_CLEARED: "playlist_votes_cleared"
|
|
332
|
-
},
|
|
332
|
+
}, In = f.object({
|
|
333
333
|
id: f.string(),
|
|
334
334
|
displayName: f.string(),
|
|
335
335
|
thumbnail: f.string().optional()
|
|
336
336
|
});
|
|
337
337
|
f.object({
|
|
338
|
-
items: f.array(
|
|
338
|
+
items: f.array(In)
|
|
339
339
|
});
|
|
340
|
-
const
|
|
341
|
-
f.object({ board:
|
|
342
|
-
const
|
|
340
|
+
const En = f.partialRecord(Me, f.array(f.string()));
|
|
341
|
+
f.object({ board: En });
|
|
342
|
+
const rr = f.object({
|
|
343
343
|
mediaId: f.string(),
|
|
344
|
-
tier:
|
|
345
|
-
absoluteTier:
|
|
344
|
+
tier: Me,
|
|
345
|
+
absoluteTier: Me,
|
|
346
346
|
/** Tier level + within-row position. Integer part is the tier. */
|
|
347
347
|
score: f.number(),
|
|
348
348
|
/** The consensus mean that decided the tier. Never the displayed number. */
|
|
349
349
|
placementScore: f.number(),
|
|
350
350
|
subRankOffset: f.number(),
|
|
351
|
-
votes: f.record(f.string(),
|
|
351
|
+
votes: f.record(f.string(), Me)
|
|
352
352
|
// opaque voterId -> the letter they gave
|
|
353
353
|
});
|
|
354
354
|
f.object({
|
|
355
|
-
items: f.array(
|
|
356
|
-
placed: f.array(
|
|
355
|
+
items: f.array(In),
|
|
356
|
+
placed: f.array(rr),
|
|
357
357
|
unrated: f.array(f.string()),
|
|
358
358
|
spread: f.number(),
|
|
359
359
|
nudged: f.boolean(),
|
|
@@ -363,9 +363,9 @@ f.object({
|
|
|
363
363
|
* browser on a newer bundle still reads an older server's board. */
|
|
364
364
|
pictures: f.record(f.string(), f.string()).optional(),
|
|
365
365
|
voterCount: f.number().int().nonnegative(),
|
|
366
|
-
myBoard:
|
|
366
|
+
myBoard: En
|
|
367
367
|
});
|
|
368
|
-
const
|
|
368
|
+
const or = {
|
|
369
369
|
/** Broadcast to EVERY connected socket when anyone saves. Carries no board —
|
|
370
370
|
* it is a "re-fetch" ping, because the shared result is identical for all
|
|
371
371
|
* viewers but `myBoard` is not, and one payload cannot serve both. */
|
|
@@ -378,10 +378,10 @@ f.object({
|
|
|
378
378
|
ready: f.array(f.string())
|
|
379
379
|
// clientIds who have flagged ready
|
|
380
380
|
});
|
|
381
|
-
const
|
|
381
|
+
const fr = {
|
|
382
382
|
STATE: "ready_check_state"
|
|
383
383
|
// distinct from buffer-readiness 'ready_state'
|
|
384
|
-
},
|
|
384
|
+
}, An = {
|
|
385
385
|
ACTIVE: "game_active",
|
|
386
386
|
// server -> room (the open game id; null = none)
|
|
387
387
|
SYNC: "game_sync"
|
|
@@ -393,7 +393,7 @@ f.object({
|
|
|
393
393
|
f.object({
|
|
394
394
|
gameId: f.string().nullable()
|
|
395
395
|
});
|
|
396
|
-
const
|
|
396
|
+
const ir = [
|
|
397
397
|
{
|
|
398
398
|
id: "fantasy",
|
|
399
399
|
characters: [
|
|
@@ -437,59 +437,59 @@ const rr = [
|
|
|
437
437
|
{ id: "mentor", color: "#e1e0dc" }
|
|
438
438
|
]
|
|
439
439
|
}
|
|
440
|
-
],
|
|
441
|
-
function
|
|
442
|
-
const t =
|
|
440
|
+
], kt = ir.flatMap((e) => e.characters), Ye = kt.map((e) => e.id), sr = Object.fromEntries(kt.map((e) => [e.id, e.color])), lr = Object.fromEntries(kt.map((e) => [e.id, "rev" in e ? e.rev : 1]));
|
|
441
|
+
function cr(e) {
|
|
442
|
+
const t = lr[e];
|
|
443
443
|
return `/media/sprites/square_${e}.png${t > 1 ? `?v=${t}` : ""}`;
|
|
444
444
|
}
|
|
445
|
-
function
|
|
446
|
-
return !!e &&
|
|
445
|
+
function Je(e) {
|
|
446
|
+
return !!e && Ye.includes(e);
|
|
447
447
|
}
|
|
448
|
-
const
|
|
449
|
-
function
|
|
450
|
-
return typeof e == "string" &&
|
|
448
|
+
const dr = 5e3, Nn = { mode: "off", percent: 0 }, ur = ["off", "on", "ab"];
|
|
449
|
+
function mr(e) {
|
|
450
|
+
return typeof e == "string" && ur.includes(e);
|
|
451
451
|
}
|
|
452
|
-
function
|
|
453
|
-
const t = e && typeof e == "object" ? e : {}, n =
|
|
452
|
+
function gr(e) {
|
|
453
|
+
const t = e && typeof e == "object" ? e : {}, n = mr(t.mode) ? t.mode : Nn.mode, a = Number(t.percent), r = Number.isFinite(a) ? Math.min(100, Math.max(0, Math.round(a))) : 0;
|
|
454
454
|
return { mode: n, percent: r };
|
|
455
455
|
}
|
|
456
|
-
function
|
|
456
|
+
function pr(e) {
|
|
457
457
|
let t = 2166136261;
|
|
458
458
|
for (let n = 0; n < e.length; n++)
|
|
459
459
|
t ^= e.charCodeAt(n), t = Math.imul(t, 16777619) >>> 0;
|
|
460
460
|
return t >>> 0;
|
|
461
461
|
}
|
|
462
|
-
function
|
|
462
|
+
function hr(e, t, n) {
|
|
463
463
|
if (n === !0)
|
|
464
464
|
return "fragment";
|
|
465
465
|
if (n === !1)
|
|
466
466
|
return "range";
|
|
467
|
-
const a =
|
|
468
|
-
return a.mode === "on" ? "fragment" : a.mode === "off" || a.percent <= 0 ? "range" : a.percent >= 100 || t &&
|
|
467
|
+
const a = gr(e);
|
|
468
|
+
return a.mode === "on" ? "fragment" : a.mode === "off" || a.percent <= 0 ? "range" : a.percent >= 100 || t && pr(t) % 100 < a.percent ? "fragment" : "range";
|
|
469
469
|
}
|
|
470
|
-
let
|
|
471
|
-
function
|
|
472
|
-
e.cdnBase && (
|
|
470
|
+
let Ae = null, Rn = wn;
|
|
471
|
+
function br(e) {
|
|
472
|
+
e.cdnBase && (Rn = e.cdnBase);
|
|
473
473
|
}
|
|
474
|
-
function
|
|
475
|
-
return
|
|
474
|
+
function jn() {
|
|
475
|
+
return Rn.replace(/\/+$/, "");
|
|
476
476
|
}
|
|
477
|
-
function
|
|
478
|
-
const e =
|
|
479
|
-
return (!
|
|
477
|
+
function Xe() {
|
|
478
|
+
const e = jn();
|
|
479
|
+
return (!Ae || Ae.base !== e) && (Ae = { base: e, client: _a({ cdnBase: e }) }), Ae.client;
|
|
480
480
|
}
|
|
481
|
-
function
|
|
482
|
-
return !
|
|
481
|
+
function ze(e) {
|
|
482
|
+
return !bt(e) || !jn() ? null : Xe().urlFor(e);
|
|
483
483
|
}
|
|
484
|
-
function
|
|
484
|
+
function yr(e) {
|
|
485
485
|
return e.kind === "file";
|
|
486
486
|
}
|
|
487
|
-
class
|
|
487
|
+
class Pn extends Error {
|
|
488
488
|
constructor(t) {
|
|
489
489
|
super(t), this.name = "ChatImageUploadError";
|
|
490
490
|
}
|
|
491
491
|
}
|
|
492
|
-
function
|
|
492
|
+
function De(e) {
|
|
493
493
|
switch (e) {
|
|
494
494
|
case "unauthenticated":
|
|
495
495
|
return "Sign in to paste images";
|
|
@@ -509,99 +509,99 @@ function Me(e) {
|
|
|
509
509
|
return "Image upload failed";
|
|
510
510
|
}
|
|
511
511
|
}
|
|
512
|
-
function
|
|
513
|
-
return e instanceof
|
|
512
|
+
function wr(e) {
|
|
513
|
+
return e instanceof ct ? De(e.reason) : e instanceof Pn ? e.message : "Image upload failed";
|
|
514
514
|
}
|
|
515
|
-
function
|
|
515
|
+
function vr(e) {
|
|
516
516
|
const t = e.type.toLowerCase().split(";")[0].trim();
|
|
517
|
-
return t &&
|
|
517
|
+
return t && xa(t) !== "image" ? De("unsupported-type") : e.size > Sa.image ? De("too-large") : e.size === 0 ? De("invalid") : null;
|
|
518
518
|
}
|
|
519
|
-
function
|
|
520
|
-
return
|
|
519
|
+
function kr(e) {
|
|
520
|
+
return Ca(e);
|
|
521
521
|
}
|
|
522
|
-
function
|
|
523
|
-
return
|
|
522
|
+
function _r(e) {
|
|
523
|
+
return Ia(e);
|
|
524
524
|
}
|
|
525
|
-
async function
|
|
526
|
-
const t = await
|
|
525
|
+
async function xr(e) {
|
|
526
|
+
const t = await Ta(e);
|
|
527
527
|
return { w: t?.width ?? 0, h: t?.height ?? 0 };
|
|
528
528
|
}
|
|
529
|
-
async function
|
|
530
|
-
const n = await
|
|
531
|
-
if (!
|
|
532
|
-
throw new
|
|
529
|
+
async function Sr(e, t = {}) {
|
|
530
|
+
const n = await Xe().upload(e, { signal: t.signal });
|
|
531
|
+
if (!bt(n.key))
|
|
532
|
+
throw new Pn("Image upload returned an unusable key");
|
|
533
533
|
return { key: n.key, deduplicated: n.deduplicated === !0 };
|
|
534
534
|
}
|
|
535
|
-
async function
|
|
535
|
+
async function Tr(e, t = {}) {
|
|
536
536
|
const n = [];
|
|
537
537
|
for (const a of e) {
|
|
538
538
|
if (a.kind === "remote") {
|
|
539
539
|
n.push({ key: a.key, w: a.w, h: a.h, ...a.title ? { title: a.title } : {} });
|
|
540
540
|
continue;
|
|
541
541
|
}
|
|
542
|
-
const { key: r } = await
|
|
542
|
+
const { key: r } = await Sr(a.file, t);
|
|
543
543
|
n.push({ key: r, w: a.w, h: a.h });
|
|
544
544
|
}
|
|
545
545
|
return n;
|
|
546
546
|
}
|
|
547
|
-
function
|
|
547
|
+
function Cr(e) {
|
|
548
548
|
return {
|
|
549
549
|
error: e instanceof Error ? e.message : String(e),
|
|
550
550
|
name: e instanceof Error ? e.name : typeof e,
|
|
551
|
-
reason: e instanceof
|
|
552
|
-
status: e instanceof
|
|
551
|
+
reason: e instanceof ct ? e.reason : void 0,
|
|
552
|
+
status: e instanceof ct ? e.status : void 0
|
|
553
553
|
};
|
|
554
554
|
}
|
|
555
|
-
function
|
|
555
|
+
function Qe(e) {
|
|
556
556
|
return e.key === "Escape" || e.key === "GoBack" || e.key === "BrowserBack" || e.key === "XF86Back" || e.keyCode === 461 || e.keyCode === 10009;
|
|
557
557
|
}
|
|
558
|
-
function
|
|
558
|
+
function Ir(e) {
|
|
559
559
|
return `/tv?return=${encodeURIComponent(e.pathname + e.search)}`;
|
|
560
560
|
}
|
|
561
|
-
function
|
|
561
|
+
function Er({ className: e }) {
|
|
562
562
|
return /* @__PURE__ */ l(
|
|
563
563
|
"a",
|
|
564
564
|
{
|
|
565
|
-
href:
|
|
565
|
+
href: Ir(window.location),
|
|
566
566
|
className: e,
|
|
567
567
|
"data-testid": "sign-in-with-code",
|
|
568
568
|
children: "Sign in with a code"
|
|
569
569
|
}
|
|
570
570
|
);
|
|
571
571
|
}
|
|
572
|
-
const
|
|
573
|
-
function
|
|
574
|
-
let a = t.left -
|
|
575
|
-
a < fe && (a = t.right + fe), a = Math.min(a, n.width -
|
|
576
|
-
const r =
|
|
572
|
+
const ut = 240, fe = 8, Ar = 28, Mn = 240;
|
|
573
|
+
function Nr(e, t, n) {
|
|
574
|
+
let a = t.left - ut - fe;
|
|
575
|
+
a < fe && (a = t.right + fe), a = Math.min(a, n.width - ut - fe), a = Math.max(fe, a);
|
|
576
|
+
const r = Mn + Ar;
|
|
577
577
|
let o = e.top + e.height / 2 - r / 2;
|
|
578
578
|
return o = Math.min(o, n.height - r - fe), o = Math.max(fe, o), { left: a, top: o };
|
|
579
579
|
}
|
|
580
|
-
const
|
|
581
|
-
function
|
|
582
|
-
const [r, o] = E(""), i = z(null), s = z(null), c =
|
|
580
|
+
const Dn = "/dataplatform/api/memes", Rr = 120;
|
|
581
|
+
function jr({ onClose: e, onPick: t, onUnavailable: n, toggle: a }) {
|
|
582
|
+
const [r, o] = E(""), i = z(null), s = z(null), c = Xe(), { items: b, loading: p, error: I, hasMore: S, loadMore: N } = Wa(
|
|
583
583
|
c,
|
|
584
|
-
|
|
584
|
+
Dn,
|
|
585
585
|
r.trim()
|
|
586
586
|
), M = I?.reason ?? null, h = G(() => {
|
|
587
587
|
const T = /* @__PURE__ */ new Set();
|
|
588
|
-
return b.filter((
|
|
588
|
+
return b.filter((R) => T.has(R.key) ? !1 : (T.add(R.key), !0));
|
|
589
589
|
}, [b]), [d, m] = E(null), w = z(null), v = D(() => {
|
|
590
590
|
w.current !== null && (window.clearTimeout(w.current), w.current = null);
|
|
591
591
|
}, []), C = D(() => {
|
|
592
592
|
v(), m(null);
|
|
593
|
-
}, [v]),
|
|
594
|
-
(T,
|
|
593
|
+
}, [v]), H = typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(hover: hover)").matches, F = D(
|
|
594
|
+
(T, R, j = !1) => {
|
|
595
595
|
const $ = i.current;
|
|
596
596
|
if (!$) return;
|
|
597
|
-
const
|
|
597
|
+
const U = () => m({
|
|
598
598
|
item: T,
|
|
599
|
-
...
|
|
599
|
+
...Nr(R.getBoundingClientRect(), $.getBoundingClientRect(), {
|
|
600
600
|
width: window.innerWidth,
|
|
601
601
|
height: window.innerHeight
|
|
602
602
|
})
|
|
603
603
|
});
|
|
604
|
-
v(),
|
|
604
|
+
v(), j ? U() : w.current = window.setTimeout(U, Rr);
|
|
605
605
|
},
|
|
606
606
|
[v]
|
|
607
607
|
);
|
|
@@ -610,14 +610,14 @@ function Ar({ onClose: e, onPick: t, onUnavailable: n, toggle: a }) {
|
|
|
610
610
|
}, [M, n]), A(() => {
|
|
611
611
|
s.current?.focus();
|
|
612
612
|
}, []), A(() => {
|
|
613
|
-
const T = (
|
|
614
|
-
|
|
615
|
-
},
|
|
616
|
-
const $ =
|
|
613
|
+
const T = (j) => {
|
|
614
|
+
Qe(j) && (j.stopPropagation(), e());
|
|
615
|
+
}, R = (j) => {
|
|
616
|
+
const $ = j.target;
|
|
617
617
|
i.current && !i.current.contains($) && !a?.contains($) && e();
|
|
618
618
|
};
|
|
619
|
-
return document.addEventListener("keydown", T), document.addEventListener("mousedown",
|
|
620
|
-
document.removeEventListener("keydown", T), document.removeEventListener("mousedown",
|
|
619
|
+
return document.addEventListener("keydown", T), document.addEventListener("mousedown", R), () => {
|
|
620
|
+
document.removeEventListener("keydown", T), document.removeEventListener("mousedown", R);
|
|
621
621
|
};
|
|
622
622
|
}, [e, a]);
|
|
623
623
|
const O = D((T) => {
|
|
@@ -660,31 +660,31 @@ function Ar({ onClose: e, onPick: t, onUnavailable: n, toggle: a }) {
|
|
|
660
660
|
"data-reason": M,
|
|
661
661
|
children: M === "unauthenticated" ? /* @__PURE__ */ y(ee, { children: [
|
|
662
662
|
"Sign in to browse memes · ",
|
|
663
|
-
/* @__PURE__ */ l(
|
|
663
|
+
/* @__PURE__ */ l(Er, { className: "underline text-on-danger-bg" })
|
|
664
664
|
] }) : M === "forbidden" ? "Your account can't browse the meme library" : "Meme library is unavailable"
|
|
665
665
|
}
|
|
666
666
|
),
|
|
667
667
|
L && /* @__PURE__ */ l("p", { className: "p-4 text-center text-sm text-text-secondary", children: r.trim() ? `No memes match "${r.trim()}"` : "The meme library is empty" }),
|
|
668
668
|
h.length > 0 && /* @__PURE__ */ l("div", { className: "grid grid-cols-3 gap-1.5 sm:grid-cols-4", children: h.map((T) => {
|
|
669
|
-
const
|
|
670
|
-
return
|
|
669
|
+
const R = ze(T.key);
|
|
670
|
+
return R ? /* @__PURE__ */ l(
|
|
671
671
|
"button",
|
|
672
672
|
{
|
|
673
673
|
type: "button",
|
|
674
674
|
onClick: () => O(T),
|
|
675
675
|
title: T.title,
|
|
676
676
|
"data-testid": "meme-result",
|
|
677
|
-
onMouseEnter: (
|
|
678
|
-
|
|
677
|
+
onMouseEnter: (j) => {
|
|
678
|
+
H && F(T, j.currentTarget);
|
|
679
679
|
},
|
|
680
680
|
onMouseLeave: C,
|
|
681
|
-
onFocus: (
|
|
681
|
+
onFocus: (j) => F(T, j.currentTarget, !0),
|
|
682
682
|
onBlur: C,
|
|
683
683
|
className: "group relative aspect-square overflow-hidden rounded border border-border-light bg-bg-alt focus:outline-none focus:border-primary hover:border-primary",
|
|
684
684
|
children: /* @__PURE__ */ l(
|
|
685
685
|
"img",
|
|
686
686
|
{
|
|
687
|
-
src:
|
|
687
|
+
src: R,
|
|
688
688
|
alt: T.title || "Meme",
|
|
689
689
|
loading: "lazy",
|
|
690
690
|
decoding: "async",
|
|
@@ -717,7 +717,7 @@ function Ar({ onClose: e, onPick: t, onUnavailable: n, toggle: a }) {
|
|
|
717
717
|
style: {
|
|
718
718
|
left: d.left,
|
|
719
719
|
top: d.top,
|
|
720
|
-
width:
|
|
720
|
+
width: ut,
|
|
721
721
|
/* The placement maths reserves exactly PREVIEW_PX of width.
|
|
722
722
|
Without border-box the padding and border sit OUTSIDE that
|
|
723
723
|
number and the box laps over the panel it is meant to sit
|
|
@@ -731,10 +731,10 @@ function Ar({ onClose: e, onPick: t, onUnavailable: n, toggle: a }) {
|
|
|
731
731
|
/* @__PURE__ */ l(
|
|
732
732
|
"img",
|
|
733
733
|
{
|
|
734
|
-
src:
|
|
734
|
+
src: ze(d.item.key) ?? void 0,
|
|
735
735
|
alt: "",
|
|
736
736
|
className: "block w-full rounded bg-bg object-contain",
|
|
737
|
-
style: { height: "auto", maxHeight:
|
|
737
|
+
style: { height: "auto", maxHeight: Mn }
|
|
738
738
|
}
|
|
739
739
|
),
|
|
740
740
|
d.item.title && /* One line. A long title must not change the box height, because
|
|
@@ -747,52 +747,52 @@ function Ar({ onClose: e, onPick: t, onUnavailable: n, toggle: a }) {
|
|
|
747
747
|
}
|
|
748
748
|
);
|
|
749
749
|
}
|
|
750
|
-
function
|
|
751
|
-
return e ? /* @__PURE__ */ l(
|
|
750
|
+
function Pr({ open: e, ...t }) {
|
|
751
|
+
return e ? /* @__PURE__ */ l(jr, { ...t }) : null;
|
|
752
752
|
}
|
|
753
|
-
const
|
|
754
|
-
serverOrigin: `http://localhost:${
|
|
753
|
+
const _t = {
|
|
754
|
+
serverOrigin: `http://localhost:${yt}`,
|
|
755
755
|
defaultRoomKey: "dev-room",
|
|
756
|
-
cdnBase:
|
|
756
|
+
cdnBase: wn
|
|
757
757
|
};
|
|
758
|
-
let
|
|
759
|
-
function
|
|
758
|
+
let Le = { ..._t };
|
|
759
|
+
function Mr(e) {
|
|
760
760
|
const t = Object.fromEntries(
|
|
761
761
|
Object.entries(e).filter(([n, a]) => a !== void 0)
|
|
762
762
|
);
|
|
763
|
-
|
|
763
|
+
Le = { ...Le, ...t }, br({ cdnBase: Le.cdnBase });
|
|
764
764
|
}
|
|
765
|
-
function
|
|
766
|
-
return
|
|
765
|
+
function xe() {
|
|
766
|
+
return Le;
|
|
767
767
|
}
|
|
768
|
-
const
|
|
769
|
-
function
|
|
768
|
+
const Dr = ht(_t);
|
|
769
|
+
function Lr(e) {
|
|
770
770
|
return e.serverOrigin?.replace(/\/$/, "") || "";
|
|
771
771
|
}
|
|
772
|
-
function Mn() {
|
|
773
|
-
return Rr(_e());
|
|
774
|
-
}
|
|
775
|
-
const Dn = pt(null);
|
|
776
772
|
function Ln() {
|
|
777
|
-
return
|
|
773
|
+
return Lr(xe());
|
|
778
774
|
}
|
|
779
|
-
const On =
|
|
775
|
+
const On = ht(null);
|
|
780
776
|
function Hn() {
|
|
781
|
-
|
|
777
|
+
return un(On);
|
|
778
|
+
}
|
|
779
|
+
const Un = ht(!0);
|
|
780
|
+
function Fn() {
|
|
781
|
+
const e = un(Un);
|
|
782
782
|
A(() => {
|
|
783
|
-
e &&
|
|
783
|
+
e && Ea();
|
|
784
784
|
}, [e]);
|
|
785
785
|
}
|
|
786
|
-
function
|
|
786
|
+
function $n(e) {
|
|
787
787
|
return e ? { "--hc-base": e } : {};
|
|
788
788
|
}
|
|
789
|
-
const ye =
|
|
789
|
+
const ye = qe.memo(
|
|
790
790
|
function({ html: t, as: n = "span", className: a, style: r }) {
|
|
791
|
-
return
|
|
791
|
+
return qe.createElement(n, { className: a, style: r, dangerouslySetInnerHTML: { __html: t } });
|
|
792
792
|
},
|
|
793
793
|
(e, t) => e.html === t.html && e.as === t.as && e.className === t.className && JSON.stringify(e.style) === JSON.stringify(t.style)
|
|
794
794
|
);
|
|
795
|
-
function
|
|
795
|
+
function Or(e, t) {
|
|
796
796
|
A(() => {
|
|
797
797
|
const n = e.current;
|
|
798
798
|
if (!n || !t || typeof IntersectionObserver > "u") return;
|
|
@@ -812,7 +812,7 @@ const ae = {
|
|
|
812
812
|
RECENT_EMOJI: "wp:recentEmoji",
|
|
813
813
|
voteKey: (e, t, n) => `watchparty_vote:${e}:${t}:${n}`
|
|
814
814
|
};
|
|
815
|
-
function
|
|
815
|
+
function Ze() {
|
|
816
816
|
try {
|
|
817
817
|
return globalThis.localStorage ?? null;
|
|
818
818
|
} catch {
|
|
@@ -821,22 +821,22 @@ function Qe() {
|
|
|
821
821
|
}
|
|
822
822
|
function B(e) {
|
|
823
823
|
try {
|
|
824
|
-
return
|
|
824
|
+
return Ze()?.getItem(e) ?? null;
|
|
825
825
|
} catch {
|
|
826
826
|
return null;
|
|
827
827
|
}
|
|
828
828
|
}
|
|
829
|
-
function
|
|
829
|
+
function et(e, t) {
|
|
830
830
|
try {
|
|
831
|
-
const n =
|
|
831
|
+
const n = Ze();
|
|
832
832
|
return n ? (n.setItem(e, t), !0) : !1;
|
|
833
833
|
} catch {
|
|
834
834
|
return !1;
|
|
835
835
|
}
|
|
836
836
|
}
|
|
837
|
-
function
|
|
837
|
+
function Hr() {
|
|
838
838
|
try {
|
|
839
|
-
const e =
|
|
839
|
+
const e = Ze();
|
|
840
840
|
if (!e) return [];
|
|
841
841
|
const t = [];
|
|
842
842
|
for (let n = 0; n < e.length; n++) {
|
|
@@ -848,51 +848,51 @@ function Dr() {
|
|
|
848
848
|
return [];
|
|
849
849
|
}
|
|
850
850
|
}
|
|
851
|
-
function
|
|
851
|
+
function Be(e) {
|
|
852
852
|
try {
|
|
853
|
-
|
|
853
|
+
Ze()?.removeItem(e);
|
|
854
854
|
} catch {
|
|
855
855
|
}
|
|
856
856
|
}
|
|
857
|
-
function
|
|
857
|
+
function Ur(e) {
|
|
858
858
|
const t = B(e);
|
|
859
859
|
return t === null ? null : t === "true" ? !0 : t === "false" ? !1 : null;
|
|
860
860
|
}
|
|
861
|
-
const
|
|
862
|
-
let
|
|
863
|
-
function
|
|
864
|
-
|
|
861
|
+
const qn = /* @__PURE__ */ new Map();
|
|
862
|
+
let zn = !1;
|
|
863
|
+
function tt(e, t) {
|
|
864
|
+
qn.set(e, t), zn && Bn(e, t);
|
|
865
865
|
}
|
|
866
|
-
function
|
|
867
|
-
|
|
868
|
-
for (const [e, t] of
|
|
866
|
+
function Fr() {
|
|
867
|
+
zn = !0;
|
|
868
|
+
for (const [e, t] of qn) Bn(e, t);
|
|
869
869
|
}
|
|
870
|
-
function
|
|
870
|
+
function Bn(e, t) {
|
|
871
871
|
typeof window > "u" || (window[e] = t);
|
|
872
872
|
}
|
|
873
|
-
const he = [],
|
|
874
|
-
let
|
|
875
|
-
const
|
|
876
|
-
let
|
|
877
|
-
function
|
|
878
|
-
|
|
873
|
+
const he = [], $r = 500;
|
|
874
|
+
let Oe = [], mt = null;
|
|
875
|
+
const qr = 1e3, zr = 200;
|
|
876
|
+
let gt = null;
|
|
877
|
+
function Wn(e) {
|
|
878
|
+
gt = e;
|
|
879
879
|
}
|
|
880
|
-
function
|
|
880
|
+
function Gn() {
|
|
881
881
|
return B(ae.REPORT_LOGS_FLAG) === "true";
|
|
882
882
|
}
|
|
883
|
-
function
|
|
883
|
+
function Br() {
|
|
884
884
|
if (typeof window > "u") return !1;
|
|
885
885
|
if (window.__WP_DEBUG__ || new URLSearchParams(window.location.search).get("debug") === "true") return !0;
|
|
886
886
|
const t = B(ae.DEBUG_FLAG);
|
|
887
887
|
return t !== null && t !== "false";
|
|
888
888
|
}
|
|
889
|
-
function
|
|
889
|
+
function Wr() {
|
|
890
890
|
const e = B(ae.DEBUG_FLAG);
|
|
891
891
|
if (!e || e === "true") return null;
|
|
892
892
|
const t = e.split(",").map((n) => n.trim().toLowerCase()).filter(Boolean);
|
|
893
893
|
return t.length > 0 ? new Set(t) : null;
|
|
894
894
|
}
|
|
895
|
-
function
|
|
895
|
+
function Gr() {
|
|
896
896
|
return (/* @__PURE__ */ new Date()).toLocaleTimeString("en-US", {
|
|
897
897
|
hour12: !1,
|
|
898
898
|
hour: "2-digit",
|
|
@@ -901,24 +901,24 @@ function zr() {
|
|
|
901
901
|
fractionalSecondDigits: 3
|
|
902
902
|
});
|
|
903
903
|
}
|
|
904
|
-
function
|
|
905
|
-
he.push(e), he.length >
|
|
904
|
+
function Vr(e) {
|
|
905
|
+
he.push(e), he.length > $r && he.shift();
|
|
906
906
|
}
|
|
907
|
-
const
|
|
907
|
+
const at = {
|
|
908
908
|
debug: "color: #64748b; font-weight: normal;",
|
|
909
909
|
warn: "color: #f59e0b; font-weight: bold;",
|
|
910
910
|
error: "color: #ef4444; font-weight: bold;",
|
|
911
911
|
category: "color: #3b82f6; font-weight: bold;",
|
|
912
912
|
time: "color: #6b7280; font-weight: normal;"
|
|
913
913
|
};
|
|
914
|
-
function
|
|
914
|
+
function Kr(e) {
|
|
915
915
|
try {
|
|
916
916
|
return JSON.stringify(e);
|
|
917
917
|
} catch {
|
|
918
918
|
return "[unserializable]";
|
|
919
919
|
}
|
|
920
920
|
}
|
|
921
|
-
function
|
|
921
|
+
function xt(e, t, n, a, r, o, i) {
|
|
922
922
|
const s = {
|
|
923
923
|
level: e,
|
|
924
924
|
category: r,
|
|
@@ -926,47 +926,47 @@ function _t(e, t, n, a, r, o, i) {
|
|
|
926
926
|
data: i,
|
|
927
927
|
timestamp: Date.now()
|
|
928
928
|
};
|
|
929
|
-
if (
|
|
930
|
-
if (
|
|
931
|
-
const p =
|
|
929
|
+
if (Vr(s), (n || Gn()) && Ut(s), !a) {
|
|
930
|
+
if (!Br()) return;
|
|
931
|
+
const p = Wr();
|
|
932
932
|
if (p && !p.has(r.toLowerCase())) return;
|
|
933
933
|
}
|
|
934
|
-
const c =
|
|
934
|
+
const c = Gr(), b = i !== void 0 ? " " + Kr(i) : "";
|
|
935
935
|
t(
|
|
936
936
|
`%c[${c}]%c [${r}]%c ${o}${b}`,
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
937
|
+
at.time,
|
|
938
|
+
at.category,
|
|
939
|
+
at[e]
|
|
940
940
|
);
|
|
941
941
|
}
|
|
942
942
|
function g(e, t, n) {
|
|
943
|
-
|
|
943
|
+
xt("debug", console.log, !1, !1, e, t, n);
|
|
944
944
|
}
|
|
945
|
-
function
|
|
946
|
-
|
|
945
|
+
function P(e, t, n) {
|
|
946
|
+
xt("warn", console.warn, !0, !1, e, t, n);
|
|
947
947
|
}
|
|
948
|
-
function
|
|
949
|
-
|
|
948
|
+
function He(e, t, n) {
|
|
949
|
+
xt("error", console.error, !0, !0, e, t, n);
|
|
950
950
|
}
|
|
951
|
-
function
|
|
951
|
+
function Yr() {
|
|
952
952
|
return [...he];
|
|
953
953
|
}
|
|
954
|
-
function
|
|
954
|
+
function Jr() {
|
|
955
955
|
he.length = 0;
|
|
956
956
|
}
|
|
957
|
-
function
|
|
957
|
+
function Xr(e) {
|
|
958
958
|
const t = e && e.length > 0 ? e.join(",") : "true";
|
|
959
|
-
|
|
959
|
+
et(ae.DEBUG_FLAG, t), console.log("[wp] Debug mode enabled");
|
|
960
960
|
}
|
|
961
|
-
function
|
|
962
|
-
|
|
961
|
+
function Qr() {
|
|
962
|
+
Be(ae.DEBUG_FLAG), console.log("[wp] Debug mode disabled");
|
|
963
963
|
}
|
|
964
|
-
const
|
|
965
|
-
function
|
|
964
|
+
const Zr = 1024, eo = 5e4;
|
|
965
|
+
function to(e) {
|
|
966
966
|
if (e == null) return e;
|
|
967
967
|
try {
|
|
968
968
|
const t = JSON.stringify(e);
|
|
969
|
-
if (t.length <=
|
|
969
|
+
if (t.length <= Zr) return e;
|
|
970
970
|
if (typeof e == "object" && !Array.isArray(e)) {
|
|
971
971
|
const n = {};
|
|
972
972
|
for (const [a, r] of Object.entries(e)) {
|
|
@@ -980,31 +980,31 @@ function Qr(e) {
|
|
|
980
980
|
return "[unserializable]";
|
|
981
981
|
}
|
|
982
982
|
}
|
|
983
|
-
async function
|
|
984
|
-
if (
|
|
985
|
-
const e =
|
|
986
|
-
|
|
983
|
+
async function no() {
|
|
984
|
+
if (Oe.length === 0) return;
|
|
985
|
+
const e = Oe;
|
|
986
|
+
Oe = [], mt = null;
|
|
987
987
|
try {
|
|
988
|
-
let n =
|
|
988
|
+
let n = xe().serverOrigin || "";
|
|
989
989
|
if ((n === "/" || !n) && typeof window < "u") {
|
|
990
990
|
const s = window.location;
|
|
991
|
-
(s.hostname === "localhost" || s.hostname === "127.0.0.1") && s.port === String(
|
|
991
|
+
(s.hostname === "localhost" || s.hostname === "127.0.0.1") && s.port === String(kn) ? n = `${s.protocol}//${s.hostname}:${yt}` : n = s.origin;
|
|
992
992
|
}
|
|
993
993
|
const a = `${n.replace(/\/$/, "")}/api/client-log`, r = e.map((s) => ({
|
|
994
994
|
level: s.level,
|
|
995
995
|
category: s.category,
|
|
996
996
|
message: s.message,
|
|
997
|
-
data:
|
|
997
|
+
data: to(s.data),
|
|
998
998
|
timestamp: s.timestamp,
|
|
999
999
|
url: typeof window < "u" ? window.location.href : void 0,
|
|
1000
1000
|
userAgent: typeof navigator < "u" ? navigator.userAgent : void 0,
|
|
1001
|
-
room_key:
|
|
1002
|
-
client_id:
|
|
1001
|
+
room_key: gt?.room_key,
|
|
1002
|
+
client_id: gt?.client_id
|
|
1003
1003
|
}));
|
|
1004
1004
|
let o = [], i = 0;
|
|
1005
1005
|
for (const s of r) {
|
|
1006
1006
|
const c = JSON.stringify(s).length + 1;
|
|
1007
|
-
i + c >
|
|
1007
|
+
i + c > eo && o.length > 0 && (await fetch(a, {
|
|
1008
1008
|
method: "POST",
|
|
1009
1009
|
headers: { "Content-Type": "application/json" },
|
|
1010
1010
|
body: JSON.stringify({ logs: o })
|
|
@@ -1016,31 +1016,31 @@ async function Zr() {
|
|
|
1016
1016
|
body: JSON.stringify({ logs: o })
|
|
1017
1017
|
});
|
|
1018
1018
|
} catch (t) {
|
|
1019
|
-
console.warn("[wp] log flush failed (client logs may be lost):",
|
|
1019
|
+
console.warn("[wp] log flush failed (client logs may be lost):", Se(t).error);
|
|
1020
1020
|
}
|
|
1021
1021
|
}
|
|
1022
|
-
function
|
|
1023
|
-
if (
|
|
1024
|
-
const t =
|
|
1025
|
-
|
|
1026
|
-
|
|
1022
|
+
function Ut(e) {
|
|
1023
|
+
if (Oe.push(e), !mt) {
|
|
1024
|
+
const t = Gn() ? zr : qr;
|
|
1025
|
+
mt = setTimeout(() => {
|
|
1026
|
+
no();
|
|
1027
1027
|
}, t);
|
|
1028
1028
|
}
|
|
1029
1029
|
}
|
|
1030
|
-
function
|
|
1030
|
+
function Se(e) {
|
|
1031
1031
|
return e instanceof Error ? { error: e.message, name: e.name } : { error: String(e), name: typeof e };
|
|
1032
1032
|
}
|
|
1033
|
-
|
|
1034
|
-
enable:
|
|
1035
|
-
disable:
|
|
1036
|
-
history:
|
|
1037
|
-
clear:
|
|
1033
|
+
tt("__wpDebug", {
|
|
1034
|
+
enable: Xr,
|
|
1035
|
+
disable: Qr,
|
|
1036
|
+
history: Yr,
|
|
1037
|
+
clear: Jr
|
|
1038
1038
|
});
|
|
1039
|
-
const
|
|
1040
|
-
function
|
|
1041
|
-
return e.screenWidth <
|
|
1039
|
+
const ao = 1280;
|
|
1040
|
+
function ro(e) {
|
|
1041
|
+
return e.screenWidth < ao ? !1 : e.noHoverNoPointer || e.anyHoverNone && e.maxTouchPoints === 0;
|
|
1042
1042
|
}
|
|
1043
|
-
function
|
|
1043
|
+
function oo() {
|
|
1044
1044
|
const e = (t) => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia(t).matches;
|
|
1045
1045
|
return {
|
|
1046
1046
|
noHoverNoPointer: e("(hover: none) and (pointer: none)"),
|
|
@@ -1049,57 +1049,57 @@ function no() {
|
|
|
1049
1049
|
screenWidth: typeof screen < "u" ? screen.width : 0
|
|
1050
1050
|
};
|
|
1051
1051
|
}
|
|
1052
|
-
let
|
|
1053
|
-
function
|
|
1054
|
-
return
|
|
1052
|
+
let Ft = null;
|
|
1053
|
+
function fo() {
|
|
1054
|
+
return Ft ??= ro(oo()), Ft;
|
|
1055
1055
|
}
|
|
1056
|
-
function
|
|
1057
|
-
return
|
|
1056
|
+
function $t() {
|
|
1057
|
+
return fo();
|
|
1058
1058
|
}
|
|
1059
1059
|
const ne = {
|
|
1060
1060
|
resolved: !1,
|
|
1061
1061
|
userType: "public",
|
|
1062
1062
|
accountId: null
|
|
1063
1063
|
};
|
|
1064
|
-
function
|
|
1064
|
+
function St() {
|
|
1065
1065
|
return ne.accountId ? ne.accountId : ne.resolved && ne.userType === "public" ? "anon" : null;
|
|
1066
1066
|
}
|
|
1067
|
-
function
|
|
1067
|
+
function io(e) {
|
|
1068
1068
|
ne.resolved = !0, e.userType && (ne.userType = e.userType), e.userId !== void 0 && (ne.accountId = e.userId && e.userId !== "public" ? e.userId : null);
|
|
1069
1069
|
}
|
|
1070
|
-
function
|
|
1070
|
+
function Tt() {
|
|
1071
1071
|
return ne.accountId ?? "public";
|
|
1072
1072
|
}
|
|
1073
|
-
function
|
|
1074
|
-
return
|
|
1073
|
+
function so() {
|
|
1074
|
+
return St() ?? "unscoped";
|
|
1075
1075
|
}
|
|
1076
|
-
function
|
|
1077
|
-
return
|
|
1076
|
+
function Vn(e) {
|
|
1077
|
+
return Je(e) ? sr[e] : "var(--color-neutral-bg)";
|
|
1078
1078
|
}
|
|
1079
|
-
function
|
|
1080
|
-
return
|
|
1079
|
+
function lo(e) {
|
|
1080
|
+
return Je(e) ? `${xe().serverOrigin.replace(/\/$/, "")}${cr(e)}` : void 0;
|
|
1081
1081
|
}
|
|
1082
|
-
let we = null,
|
|
1083
|
-
function
|
|
1084
|
-
return we ? Promise.resolve() :
|
|
1082
|
+
let we = null, Ne = null;
|
|
1083
|
+
function co() {
|
|
1084
|
+
return we ? Promise.resolve() : Ne || (Ne = (async () => {
|
|
1085
1085
|
try {
|
|
1086
|
-
const e =
|
|
1086
|
+
const e = xe().serverOrigin.replace(/\/$/, ""), t = await fetch(`${e}/media/sprites/names.json`, { cache: "no-cache" });
|
|
1087
1087
|
if (!t.ok) return;
|
|
1088
1088
|
const n = await t.json();
|
|
1089
|
-
we = n,
|
|
1089
|
+
we = n, tt("__DISPLAY_NAMES__", n), g("characters", "Loaded display names", n);
|
|
1090
1090
|
} catch (e) {
|
|
1091
|
-
g("characters", "display names fetch failed (degrading to sprite IDs)",
|
|
1091
|
+
g("characters", "display names fetch failed (degrading to sprite IDs)", Se(e));
|
|
1092
1092
|
}
|
|
1093
|
-
})(),
|
|
1093
|
+
})(), Ne);
|
|
1094
1094
|
}
|
|
1095
1095
|
function ve(e) {
|
|
1096
1096
|
return we?.[e] || e.charAt(0).toUpperCase() + e.slice(1);
|
|
1097
1097
|
}
|
|
1098
1098
|
function se(e) {
|
|
1099
1099
|
const t = e.toLowerCase();
|
|
1100
|
-
return
|
|
1100
|
+
return Ye.some((n) => n === t) ? !0 : we ? Object.values(we).some((n) => n.toLowerCase() === t) : !1;
|
|
1101
1101
|
}
|
|
1102
|
-
const
|
|
1102
|
+
const uo = f.object({
|
|
1103
1103
|
// Identity. There is deliberately NO `name`: a person's name is their
|
|
1104
1104
|
// hadoku key-registry name, resolved by the server from whoami and renamed
|
|
1105
1105
|
// through hadoku_site's POST /session/name (operator decision 2026-10-08).
|
|
@@ -1124,19 +1124,19 @@ const so = f.object({
|
|
|
1124
1124
|
preferredAudioLang: f.string().optional(),
|
|
1125
1125
|
subtitlesEnabled: f.boolean().optional(),
|
|
1126
1126
|
subtitleStyle: f.string().optional()
|
|
1127
|
-
}), be =
|
|
1127
|
+
}), be = Ha({
|
|
1128
1128
|
appId: "watchparty",
|
|
1129
|
-
schema:
|
|
1130
|
-
}),
|
|
1131
|
-
function
|
|
1132
|
-
const t =
|
|
1129
|
+
schema: uo
|
|
1130
|
+
}), mo = /* @__PURE__ */ new Set(["theme", "themeMode"]);
|
|
1131
|
+
function We(e) {
|
|
1132
|
+
const t = St();
|
|
1133
1133
|
return t ? `prefs-cache:${t}:${e}` : null;
|
|
1134
1134
|
}
|
|
1135
|
-
function
|
|
1136
|
-
return
|
|
1135
|
+
function go() {
|
|
1136
|
+
return St() === null;
|
|
1137
1137
|
}
|
|
1138
|
-
function
|
|
1139
|
-
const t =
|
|
1138
|
+
function qt(e) {
|
|
1139
|
+
const t = We(e);
|
|
1140
1140
|
if (!t) return {};
|
|
1141
1141
|
const n = B(t);
|
|
1142
1142
|
if (!n) return {};
|
|
@@ -1146,10 +1146,10 @@ function Ft(e) {
|
|
|
1146
1146
|
return {};
|
|
1147
1147
|
}
|
|
1148
1148
|
}
|
|
1149
|
-
function
|
|
1149
|
+
function po() {
|
|
1150
1150
|
let e = 0;
|
|
1151
|
-
for (const t of
|
|
1152
|
-
const n = t.startsWith("prefs-cache:") && t.endsWith(":watchparty"), a = t ===
|
|
1151
|
+
for (const t of Hr()) {
|
|
1152
|
+
const n = t.startsWith("prefs-cache:") && t.endsWith(":watchparty"), a = t === Ge || t.startsWith(`${Ge}:`) && !t.endsWith(":_serverSynced_v1");
|
|
1153
1153
|
if (!n && !a) continue;
|
|
1154
1154
|
const r = B(t);
|
|
1155
1155
|
if (!r) continue;
|
|
@@ -1162,17 +1162,17 @@ function uo() {
|
|
|
1162
1162
|
const i = n ? o?.blob : o;
|
|
1163
1163
|
if (!i || typeof i != "object" || !("name" in i)) continue;
|
|
1164
1164
|
const { name: s, ...c } = i, b = n ? { ...o, blob: c } : c;
|
|
1165
|
-
|
|
1165
|
+
et(t, JSON.stringify(b)) && e++;
|
|
1166
1166
|
}
|
|
1167
1167
|
return e > 0 && g("preferences", "Stripped retired name from cached prefs rows", { rewritten: e }), e;
|
|
1168
1168
|
}
|
|
1169
|
-
let
|
|
1170
|
-
const
|
|
1171
|
-
function
|
|
1172
|
-
if (
|
|
1169
|
+
let Kn = null, Yn = null;
|
|
1170
|
+
const zt = /* @__PURE__ */ new Set();
|
|
1171
|
+
function Ct() {
|
|
1172
|
+
if (go())
|
|
1173
1173
|
return g("preferences", "Boot read deferred — session pending, identity unresolved"), {};
|
|
1174
|
-
const e =
|
|
1175
|
-
if (
|
|
1174
|
+
const e = qt("portfolio"), t = qt("watchparty"), n = Object.keys(e).length > 0 ? e : Kn ?? {}, a = Object.keys(t).length > 0 ? t : Yn ?? {}, r = Tt() || "public";
|
|
1175
|
+
if (zt.has(r))
|
|
1176
1176
|
return g("preferences", "Loaded (sync, SDK-only after first read)", {
|
|
1177
1177
|
uid: r,
|
|
1178
1178
|
sdkThemeKeys: Object.keys(n).length,
|
|
@@ -1182,8 +1182,8 @@ function Tt() {
|
|
|
1182
1182
|
themeSource: Object.keys(e).length > 0 ? "cache" : "mem",
|
|
1183
1183
|
appSource: Object.keys(t).length > 0 ? "cache" : "mem"
|
|
1184
1184
|
}), { ...a, ...n };
|
|
1185
|
-
|
|
1186
|
-
const o =
|
|
1185
|
+
zt.add(r);
|
|
1186
|
+
const o = Xn() ?? {}, i = { ...o, ...a, ...n };
|
|
1187
1187
|
return g("preferences", "Loaded (sync, first read — legacy + SDK)", {
|
|
1188
1188
|
uid: r,
|
|
1189
1189
|
sdkThemeKeys: Object.keys(n).length,
|
|
@@ -1193,60 +1193,60 @@ function Tt() {
|
|
|
1193
1193
|
appSource: Object.keys(t).length > 0 ? "cache" : "mem"
|
|
1194
1194
|
}), i;
|
|
1195
1195
|
}
|
|
1196
|
-
let
|
|
1197
|
-
function
|
|
1198
|
-
const e =
|
|
1196
|
+
let Jn = !1;
|
|
1197
|
+
function ho() {
|
|
1198
|
+
const e = Tt();
|
|
1199
1199
|
return !e || e === "public";
|
|
1200
1200
|
}
|
|
1201
1201
|
function Y(e, t) {
|
|
1202
|
-
|
|
1202
|
+
ho() && (Jn = !0), mo.has(e) ? pe.save({ [e]: t }, { scope: "device" }).catch((n) => P("preferences", "themePrefs.save failed", { key: e, err: n?.message })) : be.save({ [e]: t }).catch((n) => P("preferences", "watchpartyPrefs.save failed", { key: e, err: n?.message })), g("preferences", "Saved (via SDK)", { key: e, value: t });
|
|
1203
1203
|
}
|
|
1204
|
-
let
|
|
1205
|
-
function
|
|
1206
|
-
return
|
|
1204
|
+
let Re = null, Bt = !1;
|
|
1205
|
+
function bo() {
|
|
1206
|
+
return Re || (Re = (async () => {
|
|
1207
1207
|
if (typeof window > "u") return !1;
|
|
1208
1208
|
try {
|
|
1209
|
-
|
|
1210
|
-
|
|
1209
|
+
Bt || (Bt = !0, pe.subscribe((i) => {
|
|
1210
|
+
Kn = i, Vt("portfolio", i), Kt("theme");
|
|
1211
1211
|
}), be.subscribe((i) => {
|
|
1212
|
-
|
|
1212
|
+
Yn = i, Vt("watchparty", i), Kt("watchparty");
|
|
1213
1213
|
}));
|
|
1214
1214
|
const [e, t] = await Promise.all([
|
|
1215
1215
|
pe.read(),
|
|
1216
1216
|
be.read()
|
|
1217
1217
|
]);
|
|
1218
1218
|
try {
|
|
1219
|
-
const { useAppStore: i } = await Promise.resolve().then(() =>
|
|
1219
|
+
const { useAppStore: i } = await Promise.resolve().then(() => ta);
|
|
1220
1220
|
i.getState().rehydrateFromPrefs();
|
|
1221
1221
|
} catch (i) {
|
|
1222
|
-
|
|
1222
|
+
P("preferences", "inline rehydrate after SDK read failed", { err: i?.message });
|
|
1223
1223
|
}
|
|
1224
|
-
const n =
|
|
1224
|
+
const n = We("portfolio"), a = We("watchparty"), r = n ? B(n) : null, o = a ? B(a) : null;
|
|
1225
1225
|
return g("preferences", "sdk.read", {
|
|
1226
1226
|
themeKeys: Object.keys(e ?? {}),
|
|
1227
1227
|
appKeys: Object.keys(t ?? {}),
|
|
1228
1228
|
// Post-fetch cache state: should be non-zero if SDK wrote it.
|
|
1229
1229
|
sdkThemeBytesPost: r?.length ?? 0,
|
|
1230
1230
|
sdkAppBytesPost: o?.length ?? 0
|
|
1231
|
-
}), await
|
|
1231
|
+
}), await yo(e, t), Jn ? (g("preferences", "Promoting this load's pre-auth picks to the signed-in user"), await Promise.all([
|
|
1232
1232
|
pe.promoteAnonPrefsToUser().catch(() => {
|
|
1233
1233
|
}),
|
|
1234
1234
|
be.promoteAnonPrefsToUser().catch(() => {
|
|
1235
1235
|
})
|
|
1236
1236
|
])) : g("preferences", "Skipping anon promotion — no pre-auth writes this load"), g("preferences", "First-load SDK sync complete"), !0;
|
|
1237
1237
|
} catch (e) {
|
|
1238
|
-
return
|
|
1238
|
+
return P("preferences", "First-load SDK sync failed (non-fatal)", { err: e?.message }), !1;
|
|
1239
1239
|
}
|
|
1240
|
-
})(),
|
|
1240
|
+
})(), Re);
|
|
1241
1241
|
}
|
|
1242
|
-
const
|
|
1243
|
-
|
|
1244
|
-
function
|
|
1245
|
-
const e =
|
|
1246
|
-
return !e || e === "public" ?
|
|
1242
|
+
const Ge = "watchparty_preferences";
|
|
1243
|
+
po();
|
|
1244
|
+
function pt() {
|
|
1245
|
+
const e = Tt();
|
|
1246
|
+
return !e || e === "public" ? Ge : `${Ge}:${e}`;
|
|
1247
1247
|
}
|
|
1248
|
-
function
|
|
1249
|
-
const e = B(
|
|
1248
|
+
function Xn() {
|
|
1249
|
+
const e = B(pt());
|
|
1250
1250
|
if (!e) return null;
|
|
1251
1251
|
try {
|
|
1252
1252
|
const t = JSON.parse(e);
|
|
@@ -1255,18 +1255,18 @@ function Yn() {
|
|
|
1255
1255
|
return null;
|
|
1256
1256
|
}
|
|
1257
1257
|
}
|
|
1258
|
-
function
|
|
1259
|
-
|
|
1258
|
+
function Wt() {
|
|
1259
|
+
Be(pt()), Be(`${pt()}:_serverSynced_v1`);
|
|
1260
1260
|
}
|
|
1261
|
-
async function
|
|
1262
|
-
const n =
|
|
1261
|
+
async function yo(e, t) {
|
|
1262
|
+
const n = Xn();
|
|
1263
1263
|
if (!n || Object.keys(n).length === 0) return;
|
|
1264
1264
|
const a = Object.keys(e ?? {}).length > 0, r = Object.keys(t ?? {}).length > 0, o = {}, i = {};
|
|
1265
1265
|
for (const [b, p] of Object.entries(n))
|
|
1266
1266
|
a || (b === "theme" && typeof p == "string" ? o.theme = p : b === "themeMode" && (p === "simple" || p === "advanced") && (o.themeMode = p)), r || (b === "chatCollapsed" && typeof p == "boolean" ? i.chatCollapsed = p : b === "floatingChatEnabled" && typeof p == "boolean" ? i.floatingChatEnabled = p : b === "volume" && typeof p == "number" && p >= 0 && p <= 1 ? i.volume = p : b === "muted" && typeof p == "boolean" ? i.muted = p : b === "preferredAudioLang" && typeof p == "string" ? i.preferredAudioLang = p : b === "subtitlesEnabled" && typeof p == "boolean" ? i.subtitlesEnabled = p : b === "subtitleStyle" && typeof p == "string" && (i.subtitleStyle = p));
|
|
1267
1267
|
const s = Object.keys(o), c = Object.keys(i);
|
|
1268
1268
|
if (s.length === 0 && c.length === 0) {
|
|
1269
|
-
|
|
1269
|
+
Wt();
|
|
1270
1270
|
return;
|
|
1271
1271
|
}
|
|
1272
1272
|
g("preferences", "Migrating legacy localStorage prefs to SDK", {
|
|
@@ -1279,16 +1279,16 @@ async function po(e, t) {
|
|
|
1279
1279
|
await Promise.all([
|
|
1280
1280
|
s.length > 0 ? pe.save(o, { scope: "device" }) : Promise.resolve(),
|
|
1281
1281
|
c.length > 0 ? be.save(i) : Promise.resolve()
|
|
1282
|
-
]),
|
|
1282
|
+
]), Wt(), g("preferences", "Legacy migration complete");
|
|
1283
1283
|
} catch (b) {
|
|
1284
|
-
|
|
1284
|
+
P("preferences", "Legacy migration save failed — will retry next load", {
|
|
1285
1285
|
err: b?.message
|
|
1286
1286
|
});
|
|
1287
1287
|
}
|
|
1288
1288
|
}
|
|
1289
|
-
let
|
|
1290
|
-
function
|
|
1291
|
-
const n =
|
|
1289
|
+
let Gt = !1;
|
|
1290
|
+
function Vt(e, t) {
|
|
1291
|
+
const n = We(e);
|
|
1292
1292
|
if (n)
|
|
1293
1293
|
try {
|
|
1294
1294
|
const a = {
|
|
@@ -1299,53 +1299,53 @@ function Wt(e, t) {
|
|
|
1299
1299
|
};
|
|
1300
1300
|
localStorage.setItem(n, JSON.stringify(a));
|
|
1301
1301
|
} catch (a) {
|
|
1302
|
-
|
|
1302
|
+
Gt || (Gt = !0, P("preferences", "writeThrough localStorage failed (in-memory backstop only)", {
|
|
1303
1303
|
appId: e,
|
|
1304
1304
|
err: a?.message,
|
|
1305
1305
|
name: a?.name
|
|
1306
1306
|
}));
|
|
1307
1307
|
}
|
|
1308
1308
|
}
|
|
1309
|
-
function
|
|
1310
|
-
Promise.resolve().then(() =>
|
|
1309
|
+
function Kt(e) {
|
|
1310
|
+
Promise.resolve().then(() => ta).then(({ useAppStore: t }) => {
|
|
1311
1311
|
try {
|
|
1312
1312
|
t.getState().rehydrateFromPrefs();
|
|
1313
1313
|
} catch (n) {
|
|
1314
|
-
|
|
1314
|
+
P("preferences", "rehydrateFromPrefs threw", { reason: e, err: n?.message });
|
|
1315
1315
|
}
|
|
1316
|
-
}).catch((t) =>
|
|
1316
|
+
}).catch((t) => P("preferences", "store import failed", { reason: e, err: t?.message }));
|
|
1317
1317
|
}
|
|
1318
|
-
const
|
|
1318
|
+
const Qn = 320, Ve = 240, It = 640, wo = 320, vo = 36, Yt = 16;
|
|
1319
1319
|
function Q(e, t) {
|
|
1320
|
-
if (!Number.isFinite(e)) return
|
|
1321
|
-
let n =
|
|
1322
|
-
return t !== void 0 && Number.isFinite(t) && t > 0 && (n = Math.min(n, t -
|
|
1320
|
+
if (!Number.isFinite(e)) return Qn;
|
|
1321
|
+
let n = It;
|
|
1322
|
+
return t !== void 0 && Number.isFinite(t) && t > 0 && (n = Math.min(n, t - wo)), n = Math.max(n, Ve), Math.round(Math.min(n, Math.max(Ve, e)));
|
|
1323
1323
|
}
|
|
1324
|
-
function
|
|
1324
|
+
function Jt(e, t, n, a) {
|
|
1325
1325
|
return Q(e + (t - n), a);
|
|
1326
1326
|
}
|
|
1327
|
-
function
|
|
1327
|
+
function ko(e, t, n) {
|
|
1328
1328
|
switch (t) {
|
|
1329
1329
|
case "ArrowLeft":
|
|
1330
|
-
return Q(e +
|
|
1330
|
+
return Q(e + Yt, n);
|
|
1331
1331
|
case "ArrowRight":
|
|
1332
|
-
return Q(e -
|
|
1332
|
+
return Q(e - Yt, n);
|
|
1333
1333
|
case "Home":
|
|
1334
|
-
return Q(
|
|
1334
|
+
return Q(Ve, n);
|
|
1335
1335
|
case "End":
|
|
1336
|
-
return Q(
|
|
1336
|
+
return Q(It, n);
|
|
1337
1337
|
default:
|
|
1338
1338
|
return null;
|
|
1339
1339
|
}
|
|
1340
1340
|
}
|
|
1341
|
-
function
|
|
1342
|
-
return { collapsed: e, width: e ?
|
|
1341
|
+
function _o(e, t) {
|
|
1342
|
+
return { collapsed: e, width: e ? vo : t };
|
|
1343
1343
|
}
|
|
1344
|
-
function
|
|
1344
|
+
function Zn(e, t) {
|
|
1345
1345
|
const n = new Set(t.map((o) => o.id)), a = t.reduce((o, i) => Math.max(o, i.ts), -1 / 0), r = e.filter((o) => !n.has(o.id) && o.ts > a);
|
|
1346
1346
|
return r.length ? [...t, ...r] : t;
|
|
1347
1347
|
}
|
|
1348
|
-
const
|
|
1348
|
+
const ea = 6e3, J = Ct(), u = Da((e, t) => ({
|
|
1349
1349
|
ready: !1,
|
|
1350
1350
|
name: "",
|
|
1351
1351
|
sprite: null,
|
|
@@ -1358,7 +1358,7 @@ const Qn = 6e3, J = Tt(), u = Ra((e, t) => ({
|
|
|
1358
1358
|
chatJump: null,
|
|
1359
1359
|
chatCollapsed: J.chatCollapsed ?? !1,
|
|
1360
1360
|
chromeChatCollapsed: J.chromeChatCollapsed ?? !1,
|
|
1361
|
-
chromeChatWidth: Q(J.chromeChatWidth ??
|
|
1361
|
+
chromeChatWidth: Q(J.chromeChatWidth ?? Qn),
|
|
1362
1362
|
// Hardcoded on for everyone — the per-user toggle was removed from the
|
|
1363
1363
|
// control bar; FloatingChat + toggleFloatingChat code is kept for future
|
|
1364
1364
|
// re-enablement but the value is no longer user-controllable.
|
|
@@ -1405,12 +1405,12 @@ const Qn = 6e3, J = Tt(), u = Ra((e, t) => ({
|
|
|
1405
1405
|
const o = ve(n.sprite);
|
|
1406
1406
|
return g("store", "Auto-identity: deriving name from the requested sprite", { name: o, sprite: n.sprite }), { name: o };
|
|
1407
1407
|
}
|
|
1408
|
-
const a = Object.values(n.roster).map((o) => o.sprite), r =
|
|
1408
|
+
const a = Object.values(n.roster).map((o) => o.sprite), r = bn(a, void 0, Ye);
|
|
1409
1409
|
if (r) {
|
|
1410
1410
|
const o = ve(r);
|
|
1411
1411
|
return g("store", "Auto-identity assigned", { name: o, sprite: r }), { name: o, sprite: r };
|
|
1412
1412
|
}
|
|
1413
|
-
return
|
|
1413
|
+
return P("store", "All characters taken, leaving identity unset"), {};
|
|
1414
1414
|
}),
|
|
1415
1415
|
ensureMe: (n) => {
|
|
1416
1416
|
g("store", "Client ID set", { clientId: n }), e((a) => ({ me: { ...a.me, clientId: n } }));
|
|
@@ -1460,7 +1460,7 @@ const Qn = 6e3, J = Tt(), u = Ra((e, t) => ({
|
|
|
1460
1460
|
return delete r[n.clientId], { chat: [...a.chat, n].slice(-500), typing: r };
|
|
1461
1461
|
});
|
|
1462
1462
|
},
|
|
1463
|
-
setChat: (n) => e((a) => ({ chat:
|
|
1463
|
+
setChat: (n) => e((a) => ({ chat: Zn(a.chat, n).slice(-500) })),
|
|
1464
1464
|
setReplyingTo: (n) => e(() => ({ replyingTo: n })),
|
|
1465
1465
|
setReactions: (n, a) => e((r) => {
|
|
1466
1466
|
const o = r.chat.findIndex((s) => s.id === n);
|
|
@@ -1471,12 +1471,12 @@ const Qn = 6e3, J = Tt(), u = Ra((e, t) => ({
|
|
|
1471
1471
|
setTyping: (n, a) => e((r) => {
|
|
1472
1472
|
if (!a && !(n in r.typing)) return {};
|
|
1473
1473
|
const o = { ...r.typing };
|
|
1474
|
-
return a ? o[n] = Date.now() +
|
|
1474
|
+
return a ? o[n] = Date.now() + ea : delete o[n], { typing: o };
|
|
1475
1475
|
}),
|
|
1476
1476
|
jumpToMessage: (n) => e(() => ({ chatJump: { id: n, at: Date.now() } })),
|
|
1477
1477
|
toggleChatCollapsed: () => e((n) => {
|
|
1478
1478
|
const a = !n.chatCollapsed;
|
|
1479
|
-
return
|
|
1479
|
+
return $t() || Y("chatCollapsed", a), { chatCollapsed: a };
|
|
1480
1480
|
}),
|
|
1481
1481
|
applyTvDefaults: () => e(() => ({ chatCollapsed: !0 })),
|
|
1482
1482
|
toggleChromeChatCollapsed: () => e((n) => {
|
|
@@ -1581,8 +1581,8 @@ const Qn = 6e3, J = Tt(), u = Ra((e, t) => ({
|
|
|
1581
1581
|
setGameSettings: (n) => e({ gameSettings: n }),
|
|
1582
1582
|
setRoomKeyType: (n) => e({ roomKeyType: n }),
|
|
1583
1583
|
rehydrateFromPrefs: () => e((n) => {
|
|
1584
|
-
const a =
|
|
1585
|
-
if (a.chatCollapsed !== void 0 &&
|
|
1584
|
+
const a = Ct(), r = {};
|
|
1585
|
+
if (a.chatCollapsed !== void 0 && !$t() && (r.chatCollapsed = a.chatCollapsed), a.chromeChatCollapsed !== void 0 && (r.chromeChatCollapsed = a.chromeChatCollapsed), a.chromeChatWidth !== void 0 && (r.chromeChatWidth = Q(a.chromeChatWidth)), ["volume", "muted", "preferredAudioLang", "subtitlesEnabled", "subtitleStyle"].some((s) => a[s] !== void 0)) {
|
|
1586
1586
|
const s = { ...n.mediaPrefs };
|
|
1587
1587
|
a.volume !== void 0 && (s.volume = a.volume), a.muted !== void 0 && (s.muted = a.muted), a.preferredAudioLang !== void 0 && (s.preferredAudioLang = a.preferredAudioLang), a.subtitlesEnabled !== void 0 && (s.subtitlesEnabled = a.subtitlesEnabled), a.subtitleStyle !== void 0 && ["classic", "cinema", "minimal", "contrast"].includes(a.subtitleStyle) && (s.subtitleStyle = a.subtitleStyle), r.mediaPrefs = s;
|
|
1588
1588
|
}
|
|
@@ -1590,55 +1590,92 @@ const Qn = 6e3, J = Tt(), u = Ra((e, t) => ({
|
|
|
1590
1590
|
}),
|
|
1591
1591
|
setSidebarTab: (n) => e((a) => a.sidebarTab === n && n !== "chat" ? { sidebarTab: "chat" } : { sidebarTab: n, chatCollapsed: !1 })
|
|
1592
1592
|
}));
|
|
1593
|
-
|
|
1594
|
-
const
|
|
1593
|
+
tt("__ZUSTAND_STORE__", u);
|
|
1594
|
+
const ta = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1595
1595
|
__proto__: null,
|
|
1596
|
-
TYPING_EXPIRE_MS:
|
|
1597
|
-
mergeHistory:
|
|
1596
|
+
TYPING_EXPIRE_MS: ea,
|
|
1597
|
+
mergeHistory: Zn,
|
|
1598
1598
|
useAppStore: u
|
|
1599
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
1600
|
-
function
|
|
1599
|
+
}, Symbol.toStringTag, { value: "Module" })), xo = 5e3;
|
|
1600
|
+
function So(e, t, n) {
|
|
1601
|
+
return !!e?.some((a) => a.emoji === t && a.by.includes(n));
|
|
1602
|
+
}
|
|
1603
|
+
function To(e, t, n) {
|
|
1604
|
+
let a = e ?? [];
|
|
1605
|
+
for (const [r, o] of t) a = La(a, r, n, o.on) ?? a;
|
|
1606
|
+
return a;
|
|
1607
|
+
}
|
|
1608
|
+
function Co(e, t, n, a) {
|
|
1609
|
+
const r = /* @__PURE__ */ new Map();
|
|
1610
|
+
for (const [o, i] of t)
|
|
1611
|
+
i.expires <= a || So(e, o, n) !== i.on && r.set(o, i);
|
|
1612
|
+
return r;
|
|
1613
|
+
}
|
|
1614
|
+
const ke = /* @__PURE__ */ new Map();
|
|
1615
|
+
function Et(e, t) {
|
|
1616
|
+
if (t.intents = Co(t.confirmed, t.intents, t.handle, Date.now()), u.getState().setReactions(e, To(t.confirmed, t.intents, t.handle)), t.timer && clearTimeout(t.timer), t.timer = null, t.intents.size === 0) {
|
|
1617
|
+
ke.delete(e);
|
|
1618
|
+
return;
|
|
1619
|
+
}
|
|
1620
|
+
const n = Math.min(...[...t.intents.values()].map((a) => a.expires));
|
|
1621
|
+
t.timer = setTimeout(() => {
|
|
1622
|
+
ke.get(e) === t && Et(e, t);
|
|
1623
|
+
}, Math.max(0, n - Date.now()));
|
|
1624
|
+
}
|
|
1625
|
+
function Io(e, t, n, a) {
|
|
1626
|
+
let r = ke.get(e);
|
|
1627
|
+
r || (r = { confirmed: u.getState().chat.find((i) => i.id === e)?.reactions, intents: /* @__PURE__ */ new Map(), handle: a, timer: null }, ke.set(e, r)), r.handle = a, r.intents.delete(t), r.intents.set(t, { on: n, expires: Date.now() + xo }), Et(e, r);
|
|
1628
|
+
}
|
|
1629
|
+
function Eo(e, t) {
|
|
1630
|
+
const n = ke.get(e);
|
|
1631
|
+
if (!n) {
|
|
1632
|
+
u.getState().setReactions(e, t);
|
|
1633
|
+
return;
|
|
1634
|
+
}
|
|
1635
|
+
n.confirmed = t, Et(e, n);
|
|
1636
|
+
}
|
|
1637
|
+
function na(e) {
|
|
1601
1638
|
const t = typeof window < "u" ? window.location.href : "http://localhost/", n = new URL(e, t).pathname;
|
|
1602
1639
|
return `${n.endsWith("/") ? n : `${n}/`}socket.io/`;
|
|
1603
1640
|
}
|
|
1604
|
-
function
|
|
1641
|
+
function Ao(e) {
|
|
1605
1642
|
const t = typeof window < "u" ? window.location.href : "http://localhost/", n = e.namespace ?? "/chat";
|
|
1606
1643
|
return {
|
|
1607
1644
|
url: `${new URL(e.origin, t).origin}${n.startsWith("/") ? n : `/${n}`}`,
|
|
1608
|
-
path: e.path ??
|
|
1645
|
+
path: e.path ?? na(e.origin)
|
|
1609
1646
|
};
|
|
1610
1647
|
}
|
|
1611
|
-
let X = null, K = null,
|
|
1612
|
-
function
|
|
1613
|
-
e && X && e.origin === X.origin && e.path === X.path && e.namespace === X.namespace || !e && !X || (
|
|
1648
|
+
let X = null, K = null, Ue = null;
|
|
1649
|
+
function Xt(e) {
|
|
1650
|
+
e && X && e.origin === X.origin && e.path === X.path && e.namespace === X.namespace || !e && !X || (ra(), X = e);
|
|
1614
1651
|
}
|
|
1615
|
-
function
|
|
1652
|
+
function Te() {
|
|
1616
1653
|
return X !== null;
|
|
1617
1654
|
}
|
|
1618
|
-
function
|
|
1655
|
+
function No(e) {
|
|
1619
1656
|
if (X)
|
|
1620
|
-
if (
|
|
1657
|
+
if (Ue = e, K)
|
|
1621
1658
|
K.connected && K.emit(_.JOIN, e);
|
|
1622
1659
|
else {
|
|
1623
|
-
const { url: t, path: n } =
|
|
1624
|
-
K = a, g("chat", "External chat socket", { url: t, path: n }),
|
|
1660
|
+
const { url: t, path: n } = Ao(X), a = dt(t, { path: n, transports: ["websocket", "polling"] });
|
|
1661
|
+
K = a, g("chat", "External chat socket", { url: t, path: n }), fa(a), a.on(_.ERROR, (r) => {
|
|
1625
1662
|
const o = r?.message || r?.code || "chat error";
|
|
1626
|
-
|
|
1663
|
+
P("chat", `Chat server error: ${o}`, { code: r?.code }), u.getState().pushToast("error", o);
|
|
1627
1664
|
}), a.on("connect", () => {
|
|
1628
|
-
|
|
1629
|
-
}), a.on("connect_error", (r) =>
|
|
1665
|
+
Ue && a.emit(_.JOIN, Ue);
|
|
1666
|
+
}), a.on("connect_error", (r) => P("chat", "Chat connection error", { message: r?.message }));
|
|
1630
1667
|
}
|
|
1631
1668
|
}
|
|
1632
|
-
function
|
|
1669
|
+
function Ro(e) {
|
|
1633
1670
|
K?.emit(_.CHAT_SEND, e);
|
|
1634
1671
|
}
|
|
1635
|
-
function
|
|
1672
|
+
function aa(e, t) {
|
|
1636
1673
|
K?.connected && K.emit(e, t);
|
|
1637
1674
|
}
|
|
1638
|
-
function
|
|
1639
|
-
|
|
1675
|
+
function ra() {
|
|
1676
|
+
Ue = null, K && (K.disconnect(), K = null);
|
|
1640
1677
|
}
|
|
1641
|
-
function
|
|
1678
|
+
function Qt(e, t) {
|
|
1642
1679
|
return {
|
|
1643
1680
|
id: String(e.id ?? e.server_seq ?? t ?? `${Date.now()}-${Math.random().toString(36).slice(2, 8)}`),
|
|
1644
1681
|
clientId: e.client_id,
|
|
@@ -1650,15 +1687,15 @@ function Jt(e, t) {
|
|
|
1650
1687
|
// Attachments arrive from other clients, so the key shape is re-checked
|
|
1651
1688
|
// here at the boundary rather than trusted at render time. A malformed
|
|
1652
1689
|
// entry is dropped, not rendered and not allowed near an <img src>.
|
|
1653
|
-
images: Array.isArray(e.images) ? e.images.filter((n) => !!n &&
|
|
1690
|
+
images: Array.isArray(e.images) ? e.images.filter((n) => !!n && bt(n.key)).slice(0, te) : void 0,
|
|
1654
1691
|
isSystem: e.isSystem || !1,
|
|
1655
1692
|
systemType: e.systemType,
|
|
1656
|
-
template: e.isSystem && typeof e.template == "string" && e.template.includes(
|
|
1657
|
-
replyTo: typeof e.reply_to == "string" &&
|
|
1658
|
-
reactions:
|
|
1693
|
+
template: e.isSystem && typeof e.template == "string" && e.template.includes(wt) ? e.template : void 0,
|
|
1694
|
+
replyTo: typeof e.reply_to == "string" && Tn.test(e.reply_to) ? e.reply_to : void 0,
|
|
1695
|
+
reactions: oa(e.reactions)
|
|
1659
1696
|
};
|
|
1660
1697
|
}
|
|
1661
|
-
function
|
|
1698
|
+
function oa(e) {
|
|
1662
1699
|
if (!Array.isArray(e)) return;
|
|
1663
1700
|
const t = e.filter((n) => {
|
|
1664
1701
|
const a = n;
|
|
@@ -1666,47 +1703,47 @@ function aa(e) {
|
|
|
1666
1703
|
});
|
|
1667
1704
|
return t.length ? t : void 0;
|
|
1668
1705
|
}
|
|
1669
|
-
function
|
|
1706
|
+
function fa(e, t = () => !0) {
|
|
1670
1707
|
e.on(_.CHAT_BROADCAST, (n) => {
|
|
1671
1708
|
if (!t()) return;
|
|
1672
|
-
const a = { ...
|
|
1709
|
+
const a = { ...Qt(n, n.server_seq), live: !0 };
|
|
1673
1710
|
u.getState().appendChat(a), g("chat", "Message received", a);
|
|
1674
1711
|
}), e.on(_.CHAT_HISTORY, (n) => {
|
|
1675
1712
|
if (!t() || !n?.messages || !Array.isArray(n.messages)) return;
|
|
1676
|
-
const a = n.messages.map((r) =>
|
|
1713
|
+
const a = n.messages.map((r) => Qt(r));
|
|
1677
1714
|
u.getState().setChat(a), g("chat", "History loaded", { count: a.length });
|
|
1678
1715
|
}), e.on(_.CHAT_REACTION, (n) => {
|
|
1679
|
-
t() && (!n || typeof n.id != "string" ||
|
|
1716
|
+
t() && (!n || typeof n.id != "string" || Eo(n.id, oa(n.reactions) ?? []));
|
|
1680
1717
|
}), e.on(_.CHAT_TYPING, (n) => {
|
|
1681
1718
|
t() && (!n || typeof n.client_id != "string" || typeof n.typing != "boolean" || u.getState().setTyping(n.client_id, n.typing));
|
|
1682
1719
|
});
|
|
1683
1720
|
}
|
|
1684
|
-
let
|
|
1685
|
-
function
|
|
1686
|
-
|
|
1721
|
+
let ia = null;
|
|
1722
|
+
function jo(e) {
|
|
1723
|
+
ia = e;
|
|
1687
1724
|
}
|
|
1688
|
-
function
|
|
1725
|
+
function Po(e = ia) {
|
|
1689
1726
|
if (!e) return null;
|
|
1690
1727
|
const t = typeof window < "u" ? window.location.href : "http://localhost/", n = e.namespace ?? "/room";
|
|
1691
1728
|
return {
|
|
1692
1729
|
url: `${new URL(e.origin, t).origin}${n.startsWith("/") ? n : `/${n}`}`,
|
|
1693
|
-
path: e.path ??
|
|
1730
|
+
path: e.path ?? na(e.origin)
|
|
1694
1731
|
};
|
|
1695
1732
|
}
|
|
1696
|
-
function
|
|
1697
|
-
return `${
|
|
1733
|
+
function Mo(e) {
|
|
1734
|
+
return `${Ln()}/media/${e}`.replace(/\\/g, "/");
|
|
1698
1735
|
}
|
|
1699
|
-
function
|
|
1700
|
-
return
|
|
1736
|
+
function Do(e, t) {
|
|
1737
|
+
return Mo(t ?? `${e}/poster.jpg`);
|
|
1701
1738
|
}
|
|
1702
|
-
function
|
|
1703
|
-
return `${
|
|
1739
|
+
function Lo(e) {
|
|
1740
|
+
return `${Ln()}${e}`.replace(/\\/g, "/");
|
|
1704
1741
|
}
|
|
1705
|
-
async function
|
|
1742
|
+
async function Oo(e) {
|
|
1706
1743
|
try {
|
|
1707
|
-
const t = await fetch(
|
|
1744
|
+
const t = await fetch(Lo("/api/tierlist"));
|
|
1708
1745
|
if (!t.ok)
|
|
1709
|
-
return
|
|
1746
|
+
return P("tierlist", "Board fetch failed", { status: t.status }), null;
|
|
1710
1747
|
const n = await t.json();
|
|
1711
1748
|
return u.getState().setTierlistSnapshot(n, e), g("tierlist", "Board loaded", {
|
|
1712
1749
|
items: n.items.length,
|
|
@@ -1714,53 +1751,53 @@ async function Eo(e) {
|
|
|
1714
1751
|
placed: n.placed.length
|
|
1715
1752
|
}), n;
|
|
1716
1753
|
} catch (t) {
|
|
1717
|
-
return
|
|
1754
|
+
return P("tierlist", "Board fetch threw", Se(t)), null;
|
|
1718
1755
|
}
|
|
1719
1756
|
}
|
|
1720
|
-
let
|
|
1721
|
-
function
|
|
1722
|
-
if (
|
|
1757
|
+
let Zt = !1;
|
|
1758
|
+
function Ho() {
|
|
1759
|
+
if (Zt || typeof Image > "u") return;
|
|
1723
1760
|
const e = u.getState().tierlist;
|
|
1724
1761
|
if (!(!e || e.items.length === 0)) {
|
|
1725
|
-
|
|
1762
|
+
Zt = !0;
|
|
1726
1763
|
for (const t of e.items) {
|
|
1727
1764
|
const n = new Image();
|
|
1728
|
-
n.decoding = "async", n.src =
|
|
1765
|
+
n.decoding = "async", n.src = Do(t.id, t.thumbnail);
|
|
1729
1766
|
}
|
|
1730
1767
|
g("tierlist", "Warming posters", { count: e.items.length });
|
|
1731
1768
|
}
|
|
1732
1769
|
}
|
|
1733
|
-
function
|
|
1734
|
-
const e = u.getState(), t =
|
|
1770
|
+
function Uo() {
|
|
1771
|
+
const e = u.getState(), t = bn(Object.values(e.roster).map((r) => r.sprite), void 0, Ye);
|
|
1735
1772
|
if (!t)
|
|
1736
|
-
return
|
|
1773
|
+
return P("socket", "sprite_taken: no available sprites to retry with"), null;
|
|
1737
1774
|
const n = !!e.name && !se(e.name), a = n ? e.name : ve(t);
|
|
1738
1775
|
return g("socket", "sprite_taken: retrying with a free character", { from: e.sprite, to: t, name: a, keptCustomName: n }), e.setSessionIdentity(a, t), { name: a, sprite: t };
|
|
1739
1776
|
}
|
|
1740
|
-
function
|
|
1777
|
+
function Fo(e) {
|
|
1741
1778
|
const t = u.getState(), n = e ? t.roster[e] : void 0;
|
|
1742
1779
|
return !n || !!n.sprite && n.sprite === t.sprite;
|
|
1743
1780
|
}
|
|
1744
|
-
const
|
|
1745
|
-
function
|
|
1746
|
-
const t =
|
|
1747
|
-
return
|
|
1781
|
+
const $o = "hadoku:name";
|
|
1782
|
+
function qo(e) {
|
|
1783
|
+
const t = qa(e);
|
|
1784
|
+
return Je(t) ? t : null;
|
|
1748
1785
|
}
|
|
1749
|
-
async function
|
|
1750
|
-
const t = await
|
|
1786
|
+
async function zo(e = {}) {
|
|
1787
|
+
const t = await $a({
|
|
1751
1788
|
...e,
|
|
1752
|
-
onError: (a) =>
|
|
1753
|
-
}), n =
|
|
1789
|
+
onError: (a) => P("avatar", "Avatar settings read failed — keeping the auto-assigned character", Se(a))
|
|
1790
|
+
}), n = Je(t) ? t : null;
|
|
1754
1791
|
return g("avatar", "Requested character from prefs-api", { sprite: n }), n;
|
|
1755
1792
|
}
|
|
1756
|
-
function
|
|
1793
|
+
function en(e) {
|
|
1757
1794
|
if (!e) return !1;
|
|
1758
1795
|
const t = u.getState();
|
|
1759
1796
|
if (t.sprite === e) return !1;
|
|
1760
1797
|
const a = !!(t.me.clientId && t.roster[t.me.clientId]?.registryName) || !t.name || !se(t.name) ? t.name : ve(e);
|
|
1761
1798
|
return t.setSessionIdentity(a, e), !0;
|
|
1762
1799
|
}
|
|
1763
|
-
function
|
|
1800
|
+
function Bo(e, t, n) {
|
|
1764
1801
|
if (!n) return () => {
|
|
1765
1802
|
};
|
|
1766
1803
|
const a = (r) => {
|
|
@@ -1769,26 +1806,26 @@ function Do(e, t, n) {
|
|
|
1769
1806
|
};
|
|
1770
1807
|
return n.addEventListener(e, a), () => n.removeEventListener(e, a);
|
|
1771
1808
|
}
|
|
1772
|
-
const
|
|
1773
|
-
function
|
|
1774
|
-
return
|
|
1809
|
+
const Wo = () => typeof window > "u" ? void 0 : window;
|
|
1810
|
+
function Go(e, t = Wo()) {
|
|
1811
|
+
return Bo($o, (n) => {
|
|
1775
1812
|
typeof n.name == "string" && n.name.trim() && e(n.name);
|
|
1776
1813
|
}, t);
|
|
1777
1814
|
}
|
|
1778
|
-
const
|
|
1779
|
-
function
|
|
1815
|
+
const Vo = 10;
|
|
1816
|
+
function Ko(e = typeof window < "u" ? window : void 0) {
|
|
1780
1817
|
if (!e) return { framed: !1, depth: 0 };
|
|
1781
1818
|
try {
|
|
1782
1819
|
let t = 0, n = e;
|
|
1783
|
-
for (; n !== n.parent && t <
|
|
1820
|
+
for (; n !== n.parent && t < Vo; )
|
|
1784
1821
|
t++, n = n.parent;
|
|
1785
1822
|
return { framed: e.top ? e.top !== e.self : t > 0, depth: t };
|
|
1786
1823
|
} catch {
|
|
1787
1824
|
return { framed: !1, depth: 0 };
|
|
1788
1825
|
}
|
|
1789
1826
|
}
|
|
1790
|
-
const
|
|
1791
|
-
function
|
|
1827
|
+
const Yo = "watchparty_fragment_delivery";
|
|
1828
|
+
function Jo() {
|
|
1792
1829
|
if (typeof window > "u") return null;
|
|
1793
1830
|
try {
|
|
1794
1831
|
const e = new URLSearchParams(window.location.search).get("fragmentDelivery");
|
|
@@ -1796,93 +1833,93 @@ function $o() {
|
|
|
1796
1833
|
if (e === "0" || e === "false") return !1;
|
|
1797
1834
|
} catch {
|
|
1798
1835
|
}
|
|
1799
|
-
return
|
|
1836
|
+
return Ur(Yo);
|
|
1800
1837
|
}
|
|
1801
|
-
let
|
|
1802
|
-
const
|
|
1803
|
-
function
|
|
1804
|
-
const e = B(
|
|
1838
|
+
let Xo = { ...Nn }, rt = null;
|
|
1839
|
+
const tn = "watchparty_delivery_client_id";
|
|
1840
|
+
function Qo() {
|
|
1841
|
+
const e = B(tn);
|
|
1805
1842
|
if (e) return e;
|
|
1806
1843
|
const t = globalThis.crypto?.randomUUID?.() ?? `d${Math.random().toString(36).slice(2)}`;
|
|
1807
|
-
return
|
|
1844
|
+
return et(tn, t) ? t : "";
|
|
1808
1845
|
}
|
|
1809
|
-
function
|
|
1810
|
-
return
|
|
1846
|
+
function Zo() {
|
|
1847
|
+
return rt === null && (rt = hr(Xo, Qo(), Jo())), rt;
|
|
1811
1848
|
}
|
|
1812
|
-
function
|
|
1813
|
-
return
|
|
1849
|
+
function ef() {
|
|
1850
|
+
return Zo();
|
|
1814
1851
|
}
|
|
1815
|
-
let
|
|
1816
|
-
function
|
|
1817
|
-
return B(
|
|
1852
|
+
let Fe;
|
|
1853
|
+
function sa() {
|
|
1854
|
+
return B(Fa) || void 0;
|
|
1818
1855
|
}
|
|
1819
|
-
function
|
|
1820
|
-
if (
|
|
1821
|
-
const e =
|
|
1856
|
+
function tf() {
|
|
1857
|
+
if (Fe) return;
|
|
1858
|
+
const e = sa();
|
|
1822
1859
|
if (e) {
|
|
1823
|
-
|
|
1860
|
+
Fe = e;
|
|
1824
1861
|
return;
|
|
1825
1862
|
}
|
|
1826
|
-
|
|
1827
|
-
t && (
|
|
1863
|
+
Ua().then((t) => {
|
|
1864
|
+
t && (Fe = t);
|
|
1828
1865
|
}).catch(() => {
|
|
1829
1866
|
g("identity", "device id unavailable — joining without one");
|
|
1830
1867
|
});
|
|
1831
1868
|
}
|
|
1832
|
-
function
|
|
1833
|
-
return
|
|
1869
|
+
function nf() {
|
|
1870
|
+
return Fe ??= sa();
|
|
1834
1871
|
}
|
|
1835
|
-
function
|
|
1872
|
+
function af(e, t) {
|
|
1836
1873
|
let n = 0;
|
|
1837
1874
|
for (const a of e.videos) {
|
|
1838
1875
|
const r = ae.voteKey(t, e.id, a.mediaId);
|
|
1839
|
-
globalThis.localStorage?.getItem(r) != null && n++,
|
|
1876
|
+
globalThis.localStorage?.getItem(r) != null && n++, Be(r);
|
|
1840
1877
|
}
|
|
1841
1878
|
return n;
|
|
1842
1879
|
}
|
|
1843
|
-
const
|
|
1844
|
-
function
|
|
1880
|
+
const rf = 2e4, of = 1e4;
|
|
1881
|
+
function ff() {
|
|
1845
1882
|
return { unansweredSince: null, lastPongAt: null, lastTickAt: null };
|
|
1846
1883
|
}
|
|
1847
|
-
function
|
|
1884
|
+
function sf(e, t) {
|
|
1848
1885
|
e.lastPongAt = t, e.unansweredSince = null;
|
|
1849
1886
|
}
|
|
1850
|
-
function
|
|
1851
|
-
const a = e.lastTickAt !== null && t - e.lastTickAt >
|
|
1852
|
-
return e.lastTickAt = t, n ? a || e.unansweredSince === null ? (e.unansweredSince = t, !1) : t - e.unansweredSince >
|
|
1887
|
+
function lf(e, t, n) {
|
|
1888
|
+
const a = e.lastTickAt !== null && t - e.lastTickAt > of;
|
|
1889
|
+
return e.lastTickAt = t, n ? a || e.unansweredSince === null ? (e.unansweredSince = t, !1) : t - e.unansweredSince > rf : (e.unansweredSince = null, !1);
|
|
1853
1890
|
}
|
|
1854
|
-
function
|
|
1891
|
+
function cf(e, t) {
|
|
1855
1892
|
return e.lastPongAt === null ? void 0 : Math.max(0, t - e.lastPongAt);
|
|
1856
1893
|
}
|
|
1857
|
-
let x = null, W = null,
|
|
1858
|
-
const
|
|
1859
|
-
let je = null,
|
|
1860
|
-
function
|
|
1894
|
+
let x = null, W = null, $e = null, V = null, Z = null;
|
|
1895
|
+
const df = gf(), de = ff();
|
|
1896
|
+
let je = null, ot = null, nn = 0, At = null, _e = !1, Nt = !1, ge = !1, la = null;
|
|
1897
|
+
function uf(e) {
|
|
1861
1898
|
const t = re(), n = u.getState();
|
|
1862
1899
|
if (n.me.clientId && n.roster[n.me.clientId])
|
|
1863
1900
|
return (e.name || e.sprite) && (g("socket", "Identity update (already joined)", { name: e.name, sprite: e.sprite }), t.emit(_.IDENTITY_UPDATE, { name: e.name, sprite: e.sprite })), t;
|
|
1864
|
-
const a =
|
|
1865
|
-
return Z = a,
|
|
1901
|
+
const a = mf(e);
|
|
1902
|
+
return Z = a, At = { name: a.name, sprite: a.sprite }, Te() && No(a), t.connected ? (g("socket", "Emitting join", a), t.emit(_.JOIN, a)) : t.once("connect", () => {
|
|
1866
1903
|
g("socket", "Emitting join", a), t.emit(_.JOIN, a);
|
|
1867
1904
|
}), t;
|
|
1868
1905
|
}
|
|
1869
|
-
function
|
|
1906
|
+
function mf(e) {
|
|
1870
1907
|
return {
|
|
1871
1908
|
room_key: e.room_key,
|
|
1872
1909
|
name: e.name,
|
|
1873
1910
|
sprite: e.sprite,
|
|
1874
1911
|
// Entry-path telemetry — see lib/embedContext.ts. Sent on every join AND
|
|
1875
1912
|
// rejoin (lastJoinPayload carries it), so a reconnect keeps the attribution.
|
|
1876
|
-
embed:
|
|
1877
|
-
delivery_arm:
|
|
1913
|
+
embed: Ko(),
|
|
1914
|
+
delivery_arm: ef(),
|
|
1878
1915
|
// Identity tier input — see lib/deviceId.ts. Sent on every join AND rejoin
|
|
1879
1916
|
// (lastJoinPayload carries it) so a reconnect lands on the same
|
|
1880
1917
|
// ParticipantId rather than minting a new person.
|
|
1881
|
-
device_id:
|
|
1882
|
-
tab_id:
|
|
1918
|
+
device_id: nf(),
|
|
1919
|
+
tab_id: df
|
|
1883
1920
|
};
|
|
1884
1921
|
}
|
|
1885
|
-
function
|
|
1922
|
+
function gf() {
|
|
1886
1923
|
const e = globalThis.crypto;
|
|
1887
1924
|
if (e && typeof e.randomUUID == "function") return e.randomUUID();
|
|
1888
1925
|
const t = new Uint8Array(16);
|
|
@@ -1892,81 +1929,81 @@ function rf() {
|
|
|
1892
1929
|
}
|
|
1893
1930
|
function re() {
|
|
1894
1931
|
if (!x) {
|
|
1895
|
-
let t =
|
|
1932
|
+
let t = xe().serverOrigin || "/";
|
|
1896
1933
|
if (t === "/" && typeof window < "u") {
|
|
1897
1934
|
const a = window.location;
|
|
1898
|
-
(a.hostname === "localhost" || a.hostname === "127.0.0.1") && a.port === String(
|
|
1935
|
+
(a.hostname === "localhost" || a.hostname === "127.0.0.1") && a.port === String(kn) && (t = `${a.protocol}//${a.hostname}:${yt}`, g("socket", "Using dev fallback origin", { origin: t }));
|
|
1899
1936
|
}
|
|
1900
|
-
const n =
|
|
1937
|
+
const n = Po();
|
|
1901
1938
|
if (n)
|
|
1902
|
-
x =
|
|
1939
|
+
x = dt(n.url, { path: n.path, transports: ["websocket", "polling"] }), g("socket", "Socket initialized on the room origin", n);
|
|
1903
1940
|
else {
|
|
1904
1941
|
const a = new URL(t.startsWith("http") ? t : `${window.location.origin}${t}`).origin;
|
|
1905
|
-
x =
|
|
1942
|
+
x = dt(a, { path: Ga, transports: ["websocket", "polling"] }), g("socket", "Socket initialized", { origin: t });
|
|
1906
1943
|
}
|
|
1907
|
-
|
|
1908
|
-
if (
|
|
1909
|
-
|
|
1944
|
+
tt("__SOCKET__", x), V && (clearTimeout(V), V = null), W = null, $e = setInterval(() => {
|
|
1945
|
+
if (lf(de, Date.now(), !!x?.connected)) {
|
|
1946
|
+
P("socket", "PONG-WATCHDOG no time_pong for 20s — replacing the connection", {
|
|
1910
1947
|
sid: x?.id,
|
|
1911
|
-
lastPongAgeMs:
|
|
1912
|
-
}),
|
|
1948
|
+
lastPongAgeMs: cf(de, Date.now()) ?? null
|
|
1949
|
+
}), ot = "pong-watchdog", de.unansweredSince = null, x?.io.engine?.close();
|
|
1913
1950
|
return;
|
|
1914
1951
|
}
|
|
1915
|
-
|
|
1916
|
-
},
|
|
1917
|
-
|
|
1952
|
+
If();
|
|
1953
|
+
}, dr), x.on("connect", () => {
|
|
1954
|
+
Nt = !1;
|
|
1918
1955
|
const a = x?.id;
|
|
1919
1956
|
if (g("socket", "Connected", { id: a, isReconnect: ge }), a)
|
|
1920
1957
|
try {
|
|
1921
1958
|
u.getState().ensureMe(a), u.setState((r) => ({ me: { ...r.me, nextClientSeq: 1 } })), g("socket", "Reset client sequence for new connection");
|
|
1922
1959
|
} catch (r) {
|
|
1923
|
-
|
|
1960
|
+
He("socket", "Failed to initialize store on connect", { error: r.message, sid: a });
|
|
1924
1961
|
}
|
|
1925
1962
|
if (ge && Z) {
|
|
1926
1963
|
const r = u.getState();
|
|
1927
|
-
|
|
1964
|
+
nn += 1;
|
|
1928
1965
|
const o = {
|
|
1929
1966
|
...Z,
|
|
1930
1967
|
name: r.name,
|
|
1931
1968
|
sprite: r.sprite,
|
|
1932
1969
|
reconnect: {
|
|
1933
|
-
count:
|
|
1970
|
+
count: nn,
|
|
1934
1971
|
reason: (je?.reason ?? "unknown").slice(0, 64),
|
|
1935
1972
|
offline_ms: je ? Math.max(0, Date.now() - je.at) : 0
|
|
1936
1973
|
}
|
|
1937
|
-
}, i =
|
|
1974
|
+
}, i = la;
|
|
1938
1975
|
if (g("socket", "Re-emitting join after reconnect", { room_key: o.room_key, name: o.name, sprite: o.sprite }), i) {
|
|
1939
1976
|
let s = !1;
|
|
1940
1977
|
const c = () => {
|
|
1941
1978
|
s || (s = !0, x.off(_.SNAPSHOT, c), x.emit(_.CLIENT_READY, { media_id: i }), g("socket", "Re-emitted client_ready after reconnect snapshot", { mediaId: i }));
|
|
1942
1979
|
};
|
|
1943
1980
|
x.on(_.SNAPSHOT, c), setTimeout(() => {
|
|
1944
|
-
s || (s = !0, x.off(_.SNAPSHOT, c),
|
|
1981
|
+
s || (s = !0, x.off(_.SNAPSHOT, c), P("socket", "client_ready re-emit timed out waiting for snapshot", { mediaId: i }));
|
|
1945
1982
|
}, 1e4);
|
|
1946
1983
|
}
|
|
1947
|
-
|
|
1948
|
-
} else ge &&
|
|
1984
|
+
At = { name: o.name, sprite: o.sprite }, x.emit(_.JOIN, o), window.dispatchEvent(new CustomEvent("watchparty:socket-reconnect"));
|
|
1985
|
+
} else ge && P("socket", "Reconnected — no join payload, not re-joining any room");
|
|
1949
1986
|
ge = !0;
|
|
1950
1987
|
}), x.on("disconnect", (a) => {
|
|
1951
|
-
|
|
1952
|
-
}), x.on("connect_error", (a) =>
|
|
1988
|
+
Wn(null), je = { reason: ot ?? a, at: Date.now() }, ot = null, g("socket", "Disconnected", { reason: a });
|
|
1989
|
+
}), x.on("connect_error", (a) => He("socket", "Connection error", { message: a?.message })), x.on("reconnect_attempt", (a) => P("socket", "Reconnect attempt", { attempt: a })), x.on("reconnect_failed", () => He("socket", "Reconnect failed")), xf(x);
|
|
1953
1990
|
}
|
|
1954
1991
|
return x;
|
|
1955
1992
|
}
|
|
1956
|
-
function
|
|
1993
|
+
function ft(e) {
|
|
1957
1994
|
return e.play_state === "playing" || e.playing === !0;
|
|
1958
1995
|
}
|
|
1959
|
-
function
|
|
1996
|
+
function pf(e) {
|
|
1960
1997
|
e.on(_.SNAPSHOT, (t) => {
|
|
1961
|
-
e.emit(
|
|
1998
|
+
e.emit(An.SYNC), u.getState().applySnapshot({
|
|
1962
1999
|
roomId: t.room_id ?? null,
|
|
1963
2000
|
mediaId: t.media_id ?? null,
|
|
1964
2001
|
playheadMs: t.playhead_ms || 0,
|
|
1965
|
-
playing:
|
|
2002
|
+
playing: ft(t),
|
|
1966
2003
|
serverSeq: t.server_seq || 0,
|
|
1967
2004
|
leaderId: t.leader_id || null
|
|
1968
2005
|
}), u.getState().name || g("socket", "Deferring identity to presence event (snapshot carries no roster)");
|
|
1969
|
-
const n = u.getState(), a = x?.id, o = (a ? n.roster[a] : void 0) ??
|
|
2006
|
+
const n = u.getState(), a = x?.id, o = (a ? n.roster[a] : void 0) ?? At, i = Oa(
|
|
1970
2007
|
{ name: n.name, avatarId: n.sprite },
|
|
1971
2008
|
o ? { name: o.name, avatarId: o.sprite ?? null } : void 0,
|
|
1972
2009
|
// A join that carried no name counts as a default one, so a name that
|
|
@@ -1976,18 +2013,18 @@ function of(e) {
|
|
|
1976
2013
|
if (i) {
|
|
1977
2014
|
const s = {
|
|
1978
2015
|
...i.name !== void 0 ? { name: i.name } : {},
|
|
1979
|
-
...i.avatarId !== void 0 && !
|
|
2016
|
+
...i.avatarId !== void 0 && !Nt ? { sprite: i.avatarId } : {}
|
|
1980
2017
|
};
|
|
1981
2018
|
Object.keys(s).length > 0 && (g("socket", "Identity update on snapshot", s), e.emit(_.IDENTITY_UPDATE, s));
|
|
1982
2019
|
}
|
|
1983
2020
|
g("socket", "Received snapshot", {
|
|
1984
2021
|
mediaId: t.media_id ?? null,
|
|
1985
2022
|
playheadMs: t.playhead_ms || 0,
|
|
1986
|
-
playing:
|
|
2023
|
+
playing: ft(t),
|
|
1987
2024
|
leaderId: t.leader_id || null,
|
|
1988
2025
|
serverSeq: t.server_seq || 0,
|
|
1989
2026
|
rosterSize: Object.keys(n.roster).length
|
|
1990
|
-
}), Z?.room_key && x?.id &&
|
|
2027
|
+
}), Z?.room_key && x?.id && Wn({ room_key: Z.room_key, client_id: x.id });
|
|
1991
2028
|
}), e.on(_.CONTROL_BROADCAST, (t) => {
|
|
1992
2029
|
const n = u.getState();
|
|
1993
2030
|
if (Object.prototype.hasOwnProperty.call(t, "media_id")) {
|
|
@@ -1996,7 +2033,7 @@ function of(e) {
|
|
|
1996
2033
|
}
|
|
1997
2034
|
n.updateControlState({
|
|
1998
2035
|
playheadMs: t.playhead_ms,
|
|
1999
|
-
playing:
|
|
2036
|
+
playing: ft(t),
|
|
2000
2037
|
serverSeq: t.server_seq,
|
|
2001
2038
|
leaderId: t.leader_id ?? n.snapshot.leaderId
|
|
2002
2039
|
}), g("socket", "Control broadcast received", {
|
|
@@ -2009,7 +2046,7 @@ function of(e) {
|
|
|
2009
2046
|
}), e.on(_.CONTROL_ACK, (t) => {
|
|
2010
2047
|
typeof t?.client_seq == "number" && typeof t?.server_seq == "number" && g("socket", "Control ack received", t);
|
|
2011
2048
|
}), e.on(_.TIME_PONG, (t) => {
|
|
2012
|
-
if (
|
|
2049
|
+
if (sf(de, Date.now()), W && W.ts) {
|
|
2013
2050
|
const n = Date.now() - W.ts;
|
|
2014
2051
|
u.getState().addRttSample(n, t?.server_ts, W.ts), W = null, V && (clearTimeout(V), V = null), g("socket", "Time sync RTT", { rtt: n, offset: u.getState().drift.offsetMs });
|
|
2015
2052
|
}
|
|
@@ -2019,11 +2056,11 @@ function of(e) {
|
|
|
2019
2056
|
u.getState().setReadiness({ mediaId: n, ready: o, readyCount: a, total: r }), g("socket", "Ready state received", { mediaId: n, readyCount: a, total: r, ready: o });
|
|
2020
2057
|
});
|
|
2021
2058
|
}
|
|
2022
|
-
function
|
|
2023
|
-
const t =
|
|
2059
|
+
function hf(e) {
|
|
2060
|
+
const t = Aa(e);
|
|
2024
2061
|
return t ? { cosmetics: t } : {};
|
|
2025
2062
|
}
|
|
2026
|
-
function
|
|
2063
|
+
function bf(e) {
|
|
2027
2064
|
e.on(_.PRESENCE, (t) => {
|
|
2028
2065
|
if (!t) return;
|
|
2029
2066
|
if (Array.isArray(t.users)) {
|
|
@@ -2037,7 +2074,7 @@ function sf(e) {
|
|
|
2037
2074
|
isLeader: s.is_leader,
|
|
2038
2075
|
...s.registry_name ? { registryName: !0 } : {},
|
|
2039
2076
|
...s.avatar_url ? { avatarUrl: s.avatar_url } : {},
|
|
2040
|
-
...
|
|
2077
|
+
...hf(s.cosmetics)
|
|
2041
2078
|
};
|
|
2042
2079
|
const r = u.getState(), o = x?.id, i = o ? a[o] : void 0;
|
|
2043
2080
|
if (i?.registryName)
|
|
@@ -2059,69 +2096,69 @@ function sf(e) {
|
|
|
2059
2096
|
}
|
|
2060
2097
|
});
|
|
2061
2098
|
}
|
|
2062
|
-
function
|
|
2063
|
-
e.on(
|
|
2099
|
+
function yf(e) {
|
|
2100
|
+
e.on(Ee.STATE, (t) => {
|
|
2064
2101
|
u.getState().applyPlaylistState({
|
|
2065
2102
|
playlist: t?.playlist ?? null,
|
|
2066
2103
|
activeIndex: t?.activeIndex ?? null,
|
|
2067
2104
|
myVotes: t?.myVotes ?? {}
|
|
2068
2105
|
}), g("playlist", "Playlist state received", { playlistId: t?.playlist?.id ?? null, activeIndex: t?.activeIndex, myVoteCount: Object.keys(t?.myVotes || {}).length });
|
|
2069
|
-
}), e.on(
|
|
2106
|
+
}), e.on(Ee.VOTE_PROGRESS, (t) => {
|
|
2070
2107
|
u.getState().setVoteProgress(t?.progress ?? []), g("playlist", "Vote progress", { progressCount: t?.progress?.length });
|
|
2071
|
-
}), e.on(
|
|
2108
|
+
}), e.on(Ee.RESULTS, (t) => {
|
|
2072
2109
|
u.getState().setPlaylistResults(t ?? null), g("playlist", "Results received", { playlistId: t?.playlist?.id, update: t?.update === !0 });
|
|
2073
|
-
}), e.on(
|
|
2110
|
+
}), e.on(Ee.VOTES_CLEARED, (t) => {
|
|
2074
2111
|
if (!t?.playlistId || !Array.isArray(t.mediaIds)) return;
|
|
2075
|
-
const n =
|
|
2112
|
+
const n = af(
|
|
2076
2113
|
{ id: t.playlistId, videos: t.mediaIds.map((r) => ({ mediaId: r })) },
|
|
2077
|
-
|
|
2114
|
+
so()
|
|
2078
2115
|
), a = u.getState();
|
|
2079
2116
|
a.playlist?.id === t.playlistId && a.applyPlaylistState({ playlist: a.playlist, activeIndex: a.activePlaylistIndex, myVotes: {} }), g("playlist", "Votes cleared by leader", { playlistId: t.playlistId, removed: n });
|
|
2080
2117
|
});
|
|
2081
2118
|
}
|
|
2082
|
-
function
|
|
2083
|
-
e.on(
|
|
2084
|
-
g("tierlist", "Someone saved — refreshing the board"),
|
|
2119
|
+
function wf(e) {
|
|
2120
|
+
e.on(or.UPDATED, () => {
|
|
2121
|
+
g("tierlist", "Someone saved — refreshing the board"), Oo(!1);
|
|
2085
2122
|
});
|
|
2086
2123
|
}
|
|
2087
|
-
function
|
|
2088
|
-
e.on(
|
|
2124
|
+
function vf(e) {
|
|
2125
|
+
e.on(fr.STATE, (t) => {
|
|
2089
2126
|
if (!t || typeof t.active != "boolean") return;
|
|
2090
2127
|
const n = Array.isArray(t.ready) ? t.ready.filter((a) => typeof a == "string") : [];
|
|
2091
2128
|
u.getState().setReadyCheckState({ active: t.active, ready: n }), g("ready-check", "State received", { active: t.active, readyCount: n.length });
|
|
2092
2129
|
});
|
|
2093
2130
|
}
|
|
2094
|
-
function
|
|
2095
|
-
e.on(
|
|
2131
|
+
function kf(e) {
|
|
2132
|
+
e.on(An.ACTIVE, (t) => {
|
|
2096
2133
|
const n = typeof t?.gameId == "string" ? t.gameId : null;
|
|
2097
2134
|
u.getState().setActiveGameId(n), g("game", "game_active", { gameId: n });
|
|
2098
2135
|
});
|
|
2099
2136
|
}
|
|
2100
|
-
function
|
|
2137
|
+
function _f(e) {
|
|
2101
2138
|
e.on(_.HEALTH_SNAPSHOT, (t) => {
|
|
2102
2139
|
u.getState().setHealthSnapshot(t);
|
|
2103
2140
|
}), e.on(_.BUFFER_STATUS, (t) => {
|
|
2104
2141
|
u.getState().setBufferStatus(t);
|
|
2105
2142
|
});
|
|
2106
2143
|
}
|
|
2107
|
-
function
|
|
2108
|
-
|
|
2144
|
+
function xf(e) {
|
|
2145
|
+
pf(e), bf(e), fa(e, () => !Te()), _f(e), yf(e), wf(e), vf(e), kf(e), e.on(_.ERROR, (t) => {
|
|
2109
2146
|
const n = t?.code || "error/unknown";
|
|
2110
2147
|
if (n === "conflict" && t?.message === "sprite_held_by_you") {
|
|
2111
|
-
|
|
2148
|
+
Nt = !0, g("socket", "sprite held by this account's other connection: keeping the server-assigned sprite");
|
|
2112
2149
|
return;
|
|
2113
2150
|
}
|
|
2114
2151
|
if (n === "conflict" && t?.message === "sprite_taken") {
|
|
2115
|
-
if (
|
|
2152
|
+
if (Fo(x?.id)) {
|
|
2116
2153
|
g("socket", "sprite_taken: stale, the server already has our sprite");
|
|
2117
2154
|
return;
|
|
2118
2155
|
}
|
|
2119
|
-
|
|
2156
|
+
_e = !0;
|
|
2120
2157
|
let i;
|
|
2121
2158
|
try {
|
|
2122
|
-
i =
|
|
2159
|
+
i = Uo();
|
|
2123
2160
|
} finally {
|
|
2124
|
-
|
|
2161
|
+
_e = !1;
|
|
2125
2162
|
}
|
|
2126
2163
|
i && e.emit(_.IDENTITY_UPDATE, i);
|
|
2127
2164
|
return;
|
|
@@ -2147,55 +2184,55 @@ function gf(e) {
|
|
|
2147
2184
|
g("socket", `recap unavailable: ${r}`, { code: n }), u.getState().pushToast("info", r);
|
|
2148
2185
|
return;
|
|
2149
2186
|
}
|
|
2150
|
-
(n.startsWith("auth/") ?
|
|
2187
|
+
(n.startsWith("auth/") ? P : He)("socket", `Server error: ${r}`, { code: n, raw: t }), u.getState().pushToast("error", r);
|
|
2151
2188
|
});
|
|
2152
2189
|
}
|
|
2153
|
-
function
|
|
2190
|
+
function Sf(e, t, n) {
|
|
2154
2191
|
const a = {
|
|
2155
2192
|
text: e,
|
|
2156
2193
|
...t?.length ? { images: t } : {},
|
|
2157
2194
|
...n ? { reply_to: n } : {}
|
|
2158
2195
|
};
|
|
2159
|
-
|
|
2196
|
+
Te() ? Ro(a) : re().emit(_.CHAT_SEND, a);
|
|
2160
2197
|
}
|
|
2161
|
-
function
|
|
2198
|
+
function Tf(e, t, n) {
|
|
2162
2199
|
const a = { id: e, emoji: t, on: n };
|
|
2163
|
-
|
|
2200
|
+
Te() ? aa(_.CHAT_REACT, a) : re().emit(_.CHAT_REACT, a);
|
|
2164
2201
|
}
|
|
2165
|
-
function
|
|
2202
|
+
function Cf(e) {
|
|
2166
2203
|
const t = { typing: e };
|
|
2167
|
-
|
|
2204
|
+
Te() ? aa(_.CHAT_TYPING, t) : x?.connected && x.emit(_.CHAT_TYPING, t);
|
|
2168
2205
|
}
|
|
2169
|
-
function
|
|
2206
|
+
function If() {
|
|
2170
2207
|
W || (W = { ts: Date.now() }, re().emit(_.TIME_PING, {}), V = setTimeout(() => {
|
|
2171
2208
|
W && (g("socket", "Time ping timed out after 10s, clearing inflight"), W = null), V = null;
|
|
2172
2209
|
}, 1e4));
|
|
2173
2210
|
}
|
|
2174
|
-
function
|
|
2211
|
+
function ca(e) {
|
|
2175
2212
|
const t = u.getState(), n = t.me.clientId;
|
|
2176
2213
|
if (!n || !t.roster[n]) {
|
|
2177
|
-
|
|
2214
|
+
en(e), g("socket", "Avatar change before join: the join will carry it", { sprite: e });
|
|
2178
2215
|
return;
|
|
2179
2216
|
}
|
|
2180
|
-
|
|
2217
|
+
_e = !0;
|
|
2181
2218
|
try {
|
|
2182
|
-
|
|
2219
|
+
en(e);
|
|
2183
2220
|
} finally {
|
|
2184
|
-
|
|
2221
|
+
_e = !1;
|
|
2185
2222
|
}
|
|
2186
2223
|
const a = u.getState(), r = { avatar: !0 };
|
|
2187
2224
|
a.sprite && a.sprite !== t.sprite && (r.sprite = a.sprite), a.name && a.name !== t.name && (r.name = a.name), g("socket", "Sending avatar change", r), re().emit(_.IDENTITY_UPDATE, r);
|
|
2188
2225
|
}
|
|
2189
|
-
function
|
|
2190
|
-
u.getState().me.clientId &&
|
|
2226
|
+
function Ef(e) {
|
|
2227
|
+
u.getState().me.clientId && Af(e);
|
|
2191
2228
|
}
|
|
2192
|
-
function
|
|
2229
|
+
function Af(e, t) {
|
|
2193
2230
|
const n = {};
|
|
2194
2231
|
e && (n.name = e), !(!n.name && !n.sprite) && (g("socket", "Sending identity update", n), re().emit(_.IDENTITY_UPDATE, n));
|
|
2195
2232
|
}
|
|
2196
2233
|
let Pe = { name: "", sprite: "" };
|
|
2197
2234
|
u.subscribe((e, t) => {
|
|
2198
|
-
if (e.name === t.name && e.sprite === t.sprite ||
|
|
2235
|
+
if (e.name === t.name && e.sprite === t.sprite || _e) return;
|
|
2199
2236
|
const n = e.me.clientId;
|
|
2200
2237
|
if (!n) return;
|
|
2201
2238
|
const a = e.roster[n];
|
|
@@ -2205,14 +2242,14 @@ u.subscribe((e, t) => {
|
|
|
2205
2242
|
const i = {};
|
|
2206
2243
|
r && (i.name = e.name, Pe.name = e.name), o && (i.sprite = e.sprite, Pe.sprite = e.sprite), g("socket", "Identity reassert (store change)", i), x?.connected ? x.emit(_.IDENTITY_UPDATE, i) : re().emit(_.IDENTITY_UPDATE, i);
|
|
2207
2244
|
});
|
|
2208
|
-
function
|
|
2209
|
-
|
|
2245
|
+
function Nf() {
|
|
2246
|
+
$e && (clearInterval($e), $e = null), V && (clearTimeout(V), V = null), W = null, de.unansweredSince = null, de.lastTickAt = null;
|
|
2210
2247
|
}
|
|
2211
|
-
function
|
|
2212
|
-
g("socket", "clearJoinState called", { hadPayload: Z !== null, room_key: Z?.room_key }), Z = null, ge = !1,
|
|
2248
|
+
function Rf() {
|
|
2249
|
+
g("socket", "clearJoinState called", { hadPayload: Z !== null, room_key: Z?.room_key }), Z = null, ge = !1, la = null;
|
|
2213
2250
|
}
|
|
2214
|
-
function
|
|
2215
|
-
g("socket", "leaveRoom called", { room_key: Z?.room_key }),
|
|
2251
|
+
function an() {
|
|
2252
|
+
g("socket", "leaveRoom called", { room_key: Z?.room_key }), Rf(), Nf(), ra(), x && (x.disconnect(), x = null), u.setState({
|
|
2216
2253
|
me: { clientId: null, nextClientSeq: 1 },
|
|
2217
2254
|
roster: {},
|
|
2218
2255
|
snapshot: { roomId: null, mediaId: null, playheadMs: 0, playing: !1, serverSeq: 0, leaderId: null },
|
|
@@ -2230,31 +2267,31 @@ function tn() {
|
|
|
2230
2267
|
activeGameId: null
|
|
2231
2268
|
});
|
|
2232
2269
|
}
|
|
2233
|
-
function
|
|
2270
|
+
function jf() {
|
|
2234
2271
|
g("chat", "Emitting recap_request"), re().emit("recap_request");
|
|
2235
2272
|
}
|
|
2236
|
-
function
|
|
2273
|
+
function Pf() {
|
|
2237
2274
|
A(() => {
|
|
2238
|
-
const e =
|
|
2239
|
-
const o =
|
|
2240
|
-
g("avatar", "Avatar changed in the settings popout", { sprite: o, source: r.avatar?.source }),
|
|
2241
|
-
}), n =
|
|
2242
|
-
g("avatar", "Renamed in the settings popout", { name: a }),
|
|
2275
|
+
const e = Ba(), t = za((a, r) => {
|
|
2276
|
+
const o = qo(r);
|
|
2277
|
+
g("avatar", "Avatar changed in the settings popout", { sprite: o, source: r.avatar?.source }), ca(o);
|
|
2278
|
+
}), n = Go((a) => {
|
|
2279
|
+
g("avatar", "Renamed in the settings popout", { name: a }), Ef(a);
|
|
2243
2280
|
});
|
|
2244
2281
|
return () => {
|
|
2245
2282
|
t(), n(), e();
|
|
2246
2283
|
};
|
|
2247
2284
|
}, []);
|
|
2248
2285
|
}
|
|
2249
|
-
function
|
|
2250
|
-
return (t ?
|
|
2286
|
+
function Mf(e, t) {
|
|
2287
|
+
return (t ? ja(t) : null) ?? Vn(e);
|
|
2251
2288
|
}
|
|
2252
|
-
function
|
|
2289
|
+
function Ce(e, t) {
|
|
2253
2290
|
return A(() => {
|
|
2254
|
-
t &&
|
|
2255
|
-
}, [t]),
|
|
2291
|
+
t && Na(t);
|
|
2292
|
+
}, [t]), mn(Ra, () => Mf(e, t), () => Vn(e));
|
|
2256
2293
|
}
|
|
2257
|
-
function
|
|
2294
|
+
function Df(e, t) {
|
|
2258
2295
|
if (t.clientId) {
|
|
2259
2296
|
const n = e[t.clientId];
|
|
2260
2297
|
if (n && (!t.author || !n.author || n.author === t.author)) return n;
|
|
@@ -2263,8 +2300,8 @@ function Cf(e, t) {
|
|
|
2263
2300
|
for (const n of Object.values(e)) if (n.author === t.author) return n;
|
|
2264
2301
|
}
|
|
2265
2302
|
}
|
|
2266
|
-
function
|
|
2267
|
-
const a =
|
|
2303
|
+
function Lf(e, t, n) {
|
|
2304
|
+
const a = Df(e, t);
|
|
2268
2305
|
return a ? {
|
|
2269
2306
|
name: a.name || n.name,
|
|
2270
2307
|
// A connection briefly without a character (a reconnect waiting for one to
|
|
@@ -2275,14 +2312,14 @@ function If(e, t, n) {
|
|
|
2275
2312
|
here: !0
|
|
2276
2313
|
} : { name: n.name, sprite: n.sprite, pictureUrl: n.pictureUrl, here: !1 };
|
|
2277
2314
|
}
|
|
2278
|
-
function
|
|
2279
|
-
return !t || !n.here ? e : t.split(
|
|
2315
|
+
function Of(e, t, n) {
|
|
2316
|
+
return !t || !n.here ? e : t.split(wt).join(n.name);
|
|
2280
2317
|
}
|
|
2281
|
-
function
|
|
2282
|
-
const n = u((a) => JSON.stringify(
|
|
2318
|
+
function nt(e, t) {
|
|
2319
|
+
const n = u((a) => JSON.stringify(Lf(a.roster, e, t)));
|
|
2283
2320
|
return G(() => JSON.parse(n), [n]);
|
|
2284
2321
|
}
|
|
2285
|
-
function
|
|
2322
|
+
function Rt({ sprite: e, url: t, alt: n = "", className: a, style: r, fallback: o }) {
|
|
2286
2323
|
const [i, s] = E(null);
|
|
2287
2324
|
if (t && t !== i)
|
|
2288
2325
|
return /* @__PURE__ */ l(
|
|
@@ -2297,13 +2334,13 @@ function At({ sprite: e, url: t, alt: n = "", className: a, style: r, fallback:
|
|
|
2297
2334
|
onError: () => s(t)
|
|
2298
2335
|
}
|
|
2299
2336
|
);
|
|
2300
|
-
const c =
|
|
2337
|
+
const c = lo(e);
|
|
2301
2338
|
return c ? /* @__PURE__ */ l("img", { src: c, alt: n, crossOrigin: "anonymous", className: a, style: r, draggable: !1 }) : /* @__PURE__ */ l(ee, { children: o });
|
|
2302
2339
|
}
|
|
2303
|
-
function
|
|
2340
|
+
function da({ sprite: e, url: t, alt: n, worn: a }) {
|
|
2304
2341
|
return /* @__PURE__ */ y("span", { className: "hc-av", style: { "--hc-sz": "32px" }, children: [
|
|
2305
2342
|
/* @__PURE__ */ l("span", { className: "hc-pic", children: /* @__PURE__ */ l(
|
|
2306
|
-
|
|
2343
|
+
Rt,
|
|
2307
2344
|
{
|
|
2308
2345
|
sprite: e,
|
|
2309
2346
|
url: t,
|
|
@@ -2312,21 +2349,21 @@ function la({ sprite: e, url: t, alt: n, worn: a }) {
|
|
|
2312
2349
|
fallback: /* @__PURE__ */ l("span", { className: "inline-block w-8 h-8 bg-bg-alt/50 rounded-full flex-shrink-0" })
|
|
2313
2350
|
}
|
|
2314
2351
|
) }),
|
|
2315
|
-
a?.overlay && /* @__PURE__ */ l(ye, { html:
|
|
2352
|
+
a?.overlay && /* @__PURE__ */ l(ye, { html: Pa(a), style: { display: "contents" } })
|
|
2316
2353
|
] });
|
|
2317
2354
|
}
|
|
2318
|
-
function
|
|
2355
|
+
function Hf(e) {
|
|
2319
2356
|
return !(e.button !== 0 || e.ctrlKey || e.metaKey || e.shiftKey || e.altKey);
|
|
2320
2357
|
}
|
|
2321
|
-
function
|
|
2358
|
+
function Uf({ src: e, title: t, onClose: n }) {
|
|
2322
2359
|
A(() => {
|
|
2323
2360
|
const o = (i) => {
|
|
2324
|
-
|
|
2361
|
+
Qe(i) && (i.stopPropagation(), n());
|
|
2325
2362
|
};
|
|
2326
2363
|
return document.addEventListener("keydown", o, !0), () => document.removeEventListener("keydown", o, !0);
|
|
2327
2364
|
}, [n]);
|
|
2328
|
-
const a =
|
|
2329
|
-
return r ?
|
|
2365
|
+
const a = Hn(), r = typeof document > "u" ? null : document.fullscreenElement ?? a ?? document.body;
|
|
2366
|
+
return r ? yn(
|
|
2330
2367
|
/* @__PURE__ */ y(
|
|
2331
2368
|
"div",
|
|
2332
2369
|
{
|
|
@@ -2364,11 +2401,11 @@ function Nf({ src: e, title: t, onClose: n }) {
|
|
|
2364
2401
|
r
|
|
2365
2402
|
) : null;
|
|
2366
2403
|
}
|
|
2367
|
-
const
|
|
2368
|
-
function
|
|
2369
|
-
const [t, n] = E(!1), a =
|
|
2404
|
+
const it = 240, Ff = 320;
|
|
2405
|
+
function $f({ image: e }) {
|
|
2406
|
+
const [t, n] = E(!1), a = ze(e.key);
|
|
2370
2407
|
if (!a) return null;
|
|
2371
|
-
const r = e.w > 0 && e.h > 0, o = r ? Math.min(1,
|
|
2408
|
+
const r = e.w > 0 && e.h > 0, o = r ? Math.min(1, Ff / e.w, it / e.h) : 1;
|
|
2372
2409
|
return /* @__PURE__ */ y(ee, { children: [
|
|
2373
2410
|
/* @__PURE__ */ l(
|
|
2374
2411
|
"a",
|
|
@@ -2379,7 +2416,7 @@ function Pf({ image: e }) {
|
|
|
2379
2416
|
className: "block max-w-full cursor-zoom-in",
|
|
2380
2417
|
"data-testid": "chat-image",
|
|
2381
2418
|
onClick: (i) => {
|
|
2382
|
-
|
|
2419
|
+
Hf(i) && (i.preventDefault(), n(!0));
|
|
2383
2420
|
},
|
|
2384
2421
|
children: /* @__PURE__ */ l(
|
|
2385
2422
|
"img",
|
|
@@ -2391,13 +2428,13 @@ function Pf({ image: e }) {
|
|
|
2391
2428
|
width: r ? Math.round(e.w * o) : void 0,
|
|
2392
2429
|
height: r ? Math.round(e.h * o) : void 0,
|
|
2393
2430
|
className: "rounded border border-border-light object-contain bg-bg-alt/30",
|
|
2394
|
-
style: r ? { aspectRatio: `${e.w} / ${e.h}`, maxWidth: "100%", maxHeight:
|
|
2431
|
+
style: r ? { aspectRatio: `${e.w} / ${e.h}`, maxWidth: "100%", maxHeight: it } : { maxWidth: "100%", maxHeight: it }
|
|
2395
2432
|
}
|
|
2396
2433
|
)
|
|
2397
2434
|
}
|
|
2398
2435
|
),
|
|
2399
2436
|
t && /* @__PURE__ */ l(
|
|
2400
|
-
|
|
2437
|
+
Uf,
|
|
2401
2438
|
{
|
|
2402
2439
|
src: a,
|
|
2403
2440
|
title: e.title,
|
|
@@ -2406,13 +2443,13 @@ function Pf({ image: e }) {
|
|
|
2406
2443
|
)
|
|
2407
2444
|
] });
|
|
2408
2445
|
}
|
|
2409
|
-
function
|
|
2410
|
-
return e?.length ? /* @__PURE__ */ l("div", { className: "flex flex-wrap gap-1 mt-1", "data-testid": "chat-images", children: e.map((t, n) => /* @__PURE__ */ l(
|
|
2446
|
+
function ua({ images: e }) {
|
|
2447
|
+
return e?.length ? /* @__PURE__ */ l("div", { className: "flex flex-wrap gap-1 mt-1", "data-testid": "chat-images", children: e.map((t, n) => /* @__PURE__ */ l($f, { image: t }, `${t.key}-${n}`)) }) : null;
|
|
2411
2448
|
}
|
|
2412
|
-
function
|
|
2449
|
+
function qf(e, t) {
|
|
2413
2450
|
return e.author && t.author ? e.author === t.author : !!t.clientId && e.clientId === t.clientId;
|
|
2414
2451
|
}
|
|
2415
|
-
const
|
|
2452
|
+
const zf = [
|
|
2416
2453
|
{ id: "smileys", label: "Smileys & Emotion", data: "1f600:grinning face|1f603:grinning face with big eyes|1f604:grinning face with smiling eyes|1f601:beaming face with smiling eyes|1f606:grinning squinting face|1f605:grinning face with sweat|1f923:rolling on the floor laughing|1f602:face with tears of joy|1f642:slightly smiling face|1f643:upside-down face|1fae0:melting face|1f609:winking face|1f60a:smiling face with smiling eyes|1f607:smiling face with halo|1f970:smiling face with hearts|1f60d:smiling face with heart-eyes|1f929:star-struck|1f618:face blowing a kiss|1f617:kissing face|263a-fe0f:smiling face|1f61a:kissing face with closed eyes|1f619:kissing face with smiling eyes|1f972:smiling face with tear|1f60b:face savoring food|1f61b:face with tongue|1f61c:winking face with tongue|1f92a:zany face|1f61d:squinting face with tongue|1f911:money-mouth face|1f917:smiling face with open hands|1f92d:face with hand over mouth|1fae2:face with open eyes and hand over mouth|1fae3:face with peeking eye|1f92b:shushing face|1f914:thinking face|1fae1:saluting face|1f910:zipper-mouth face|1f928:face with raised eyebrow|1f610:neutral face|1f611:expressionless face|1f636:face without mouth|1fae5:dotted line face|1f636-200d-1f32b-fe0f:face in clouds|1f60f:smirking face|1f612:unamused face|1f644:face with rolling eyes|1f62c:grimacing face|1f62e-200d-1f4a8:face exhaling|1f925:lying face|1fae8:shaking face|1f60c:relieved face|1f614:pensive face|1f62a:sleepy face|1f924:drooling face|1f634:sleeping face|1f637:face with medical mask|1f912:face with thermometer|1f915:face with head-bandage|1f922:nauseated face|1f92e:face vomiting|1f927:sneezing face|1f975:hot face|1f976:cold face|1f974:woozy face|1f635:face with crossed-out eyes|1f635-200d-1f4ab:face with spiral eyes|1f92f:exploding head|1f920:cowboy hat face|1f973:partying face|1f978:disguised face|1f60e:smiling face with sunglasses|1f913:nerd face|1f9d0:face with monocle|1f615:confused face|1fae4:face with diagonal mouth|1f61f:worried face|1f641:slightly frowning face|2639-fe0f:frowning face|1f62e:face with open mouth|1f62f:hushed face|1f632:astonished face|1f633:flushed face|1f97a:pleading face|1f979:face holding back tears|1f626:frowning face with open mouth|1f627:anguished face|1f628:fearful face|1f630:anxious face with sweat|1f625:sad but relieved face|1f622:crying face|1f62d:loudly crying face|1f631:face screaming in fear|1f616:confounded face|1f623:persevering face|1f61e:disappointed face|1f613:downcast face with sweat|1f629:weary face|1f62b:tired face|1f971:yawning face|1f624:face with steam from nose|1f621:enraged face|1f620:angry face|1f92c:face with symbols on mouth|1f608:smiling face with horns|1f47f:angry face with horns|1f480:skull|2620-fe0f:skull and crossbones|1f4a9:pile of poo|1f921:clown face|1f479:ogre|1f47a:goblin|1f47b:ghost|1f47d:alien|1f47e:alien monster|1f916:robot|1f63a:grinning cat|1f638:grinning cat with smiling eyes|1f639:cat with tears of joy|1f63b:smiling cat with heart-eyes|1f63c:cat with wry smile|1f63d:kissing cat|1f640:weary cat|1f63f:crying cat|1f63e:pouting cat|1f648:see-no-evil monkey|1f649:hear-no-evil monkey|1f64a:speak-no-evil monkey|1f48c:love letter|1f498:heart with arrow|1f49d:heart with ribbon|1f496:sparkling heart|1f497:growing heart|1f493:beating heart|1f49e:revolving hearts|1f495:two hearts|1f49f:heart decoration|2763-fe0f:heart exclamation|1f494:broken heart|2764-fe0f-200d-1f525:heart on fire|2764-fe0f-200d-1fa79:mending heart|2764-fe0f:red heart|1fa77:pink heart|1f9e1:orange heart|1f49b:yellow heart|1f49a:green heart|1f499:blue heart|1fa75:light blue heart|1f49c:purple heart|1f90e:brown heart|1f5a4:black heart|1fa76:grey heart|1f90d:white heart|1f48b:kiss mark|1f4af:hundred points|1f4a2:anger symbol|1f4a5:collision|1f4ab:dizzy|1f4a6:sweat droplets|1f4a8:dashing away|1f573-fe0f:hole|1f4ac:speech balloon|1f441-fe0f-200d-1f5e8-fe0f:eye in speech bubble|1f5e8-fe0f:left speech bubble|1f5ef-fe0f:right anger bubble|1f4ad:thought balloon|1f4a4:zzz" },
|
|
2417
2454
|
{ id: "people", label: "People & Body", data: "1f44b:waving hand|1f91a:raised back of hand|1f590-fe0f:hand with fingers splayed|270b:raised hand|1f596:vulcan salute|1faf1:rightwards hand|1faf2:leftwards hand|1faf3:palm down hand|1faf4:palm up hand|1faf7:leftwards pushing hand|1faf8:rightwards pushing hand|1f44c:ok hand|1f90c:pinched fingers|1f90f:pinching hand|270c-fe0f:victory hand|1f91e:crossed fingers|1faf0:hand with index finger and thumb crossed|1f91f:love-you gesture|1f918:sign of the horns|1f919:call me hand|1f448:backhand index pointing left|1f449:backhand index pointing right|1f446:backhand index pointing up|1f595:middle finger|1f447:backhand index pointing down|261d-fe0f:index pointing up|1faf5:index pointing at the viewer|1f44d:thumbs up|1f44e:thumbs down|270a:raised fist|1f44a:oncoming fist|1f91b:left-facing fist|1f91c:right-facing fist|1f44f:clapping hands|1f64c:raising hands|1faf6:heart hands|1f450:open hands|1f932:palms up together|1f91d:handshake|1f64f:folded hands|270d-fe0f:writing hand|1f485:nail polish|1f933:selfie|1f4aa:flexed biceps|1f9be:mechanical arm|1f9bf:mechanical leg|1f9b5:leg|1f9b6:foot|1f442:ear|1f9bb:ear with hearing aid|1f443:nose|1f9e0:brain|1fac0:anatomical heart|1fac1:lungs|1f9b7:tooth|1f9b4:bone|1f440:eyes|1f441-fe0f:eye|1f445:tongue|1f444:mouth|1fae6:biting lip|1f476:baby|1f9d2:child|1f466:boy|1f467:girl|1f9d1:person|1f471:person blond hair|1f468:man|1f9d4:person beard|1f9d4-200d-2642-fe0f:man beard|1f9d4-200d-2640-fe0f:woman beard|1f468-200d-1f9b0:man red hair|1f468-200d-1f9b1:man curly hair|1f468-200d-1f9b3:man white hair|1f468-200d-1f9b2:man bald|1f469:woman|1f469-200d-1f9b0:woman red hair|1f9d1-200d-1f9b0:person red hair|1f469-200d-1f9b1:woman curly hair|1f9d1-200d-1f9b1:person curly hair|1f469-200d-1f9b3:woman white hair|1f9d1-200d-1f9b3:person white hair|1f469-200d-1f9b2:woman bald|1f9d1-200d-1f9b2:person bald|1f471-200d-2640-fe0f:woman blond hair|1f471-200d-2642-fe0f:man blond hair|1f9d3:older person|1f474:old man|1f475:old woman|1f64d:person frowning|1f64d-200d-2642-fe0f:man frowning|1f64d-200d-2640-fe0f:woman frowning|1f64e:person pouting|1f64e-200d-2642-fe0f:man pouting|1f64e-200d-2640-fe0f:woman pouting|1f645:person gesturing no|1f645-200d-2642-fe0f:man gesturing no|1f645-200d-2640-fe0f:woman gesturing no|1f646:person gesturing ok|1f646-200d-2642-fe0f:man gesturing ok|1f646-200d-2640-fe0f:woman gesturing ok|1f481:person tipping hand|1f481-200d-2642-fe0f:man tipping hand|1f481-200d-2640-fe0f:woman tipping hand|1f64b:person raising hand|1f64b-200d-2642-fe0f:man raising hand|1f64b-200d-2640-fe0f:woman raising hand|1f9cf:deaf person|1f9cf-200d-2642-fe0f:deaf man|1f9cf-200d-2640-fe0f:deaf woman|1f647:person bowing|1f647-200d-2642-fe0f:man bowing|1f647-200d-2640-fe0f:woman bowing|1f926:person facepalming|1f926-200d-2642-fe0f:man facepalming|1f926-200d-2640-fe0f:woman facepalming|1f937:person shrugging|1f937-200d-2642-fe0f:man shrugging|1f937-200d-2640-fe0f:woman shrugging|1f9d1-200d-2695-fe0f:health worker|1f468-200d-2695-fe0f:man health worker|1f469-200d-2695-fe0f:woman health worker|1f9d1-200d-1f393:student|1f468-200d-1f393:man student|1f469-200d-1f393:woman student|1f9d1-200d-1f3eb:teacher|1f468-200d-1f3eb:man teacher|1f469-200d-1f3eb:woman teacher|1f9d1-200d-2696-fe0f:judge|1f468-200d-2696-fe0f:man judge|1f469-200d-2696-fe0f:woman judge|1f9d1-200d-1f33e:farmer|1f468-200d-1f33e:man farmer|1f469-200d-1f33e:woman farmer|1f9d1-200d-1f373:cook|1f468-200d-1f373:man cook|1f469-200d-1f373:woman cook|1f9d1-200d-1f527:mechanic|1f468-200d-1f527:man mechanic|1f469-200d-1f527:woman mechanic|1f9d1-200d-1f3ed:factory worker|1f468-200d-1f3ed:man factory worker|1f469-200d-1f3ed:woman factory worker|1f9d1-200d-1f4bc:office worker|1f468-200d-1f4bc:man office worker|1f469-200d-1f4bc:woman office worker|1f9d1-200d-1f52c:scientist|1f468-200d-1f52c:man scientist|1f469-200d-1f52c:woman scientist|1f9d1-200d-1f4bb:technologist|1f468-200d-1f4bb:man technologist|1f469-200d-1f4bb:woman technologist|1f9d1-200d-1f3a4:singer|1f468-200d-1f3a4:man singer|1f469-200d-1f3a4:woman singer|1f9d1-200d-1f3a8:artist|1f468-200d-1f3a8:man artist|1f469-200d-1f3a8:woman artist|1f9d1-200d-2708-fe0f:pilot|1f468-200d-2708-fe0f:man pilot|1f469-200d-2708-fe0f:woman pilot|1f9d1-200d-1f680:astronaut|1f468-200d-1f680:man astronaut|1f469-200d-1f680:woman astronaut|1f9d1-200d-1f692:firefighter|1f468-200d-1f692:man firefighter|1f469-200d-1f692:woman firefighter|1f46e:police officer|1f46e-200d-2642-fe0f:man police officer|1f46e-200d-2640-fe0f:woman police officer|1f575-fe0f:detective|1f575-fe0f-200d-2642-fe0f:man detective|1f575-fe0f-200d-2640-fe0f:woman detective|1f482:guard|1f482-200d-2642-fe0f:man guard|1f482-200d-2640-fe0f:woman guard|1f977:ninja|1f477:construction worker|1f477-200d-2642-fe0f:man construction worker|1f477-200d-2640-fe0f:woman construction worker|1fac5:person with crown|1f934:prince|1f478:princess|1f473:person wearing turban|1f473-200d-2642-fe0f:man wearing turban|1f473-200d-2640-fe0f:woman wearing turban|1f472:person with skullcap|1f9d5:woman with headscarf|1f935:person in tuxedo|1f935-200d-2642-fe0f:man in tuxedo|1f935-200d-2640-fe0f:woman in tuxedo|1f470:person with veil|1f470-200d-2642-fe0f:man with veil|1f470-200d-2640-fe0f:woman with veil|1f930:pregnant woman|1fac3:pregnant man|1fac4:pregnant person|1f931:breast-feeding|1f469-200d-1f37c:woman feeding baby|1f468-200d-1f37c:man feeding baby|1f9d1-200d-1f37c:person feeding baby|1f47c:baby angel|1f385:santa claus|1f936:mrs. claus|1f9d1-200d-1f384:mx claus|1f9b8:superhero|1f9b8-200d-2642-fe0f:man superhero|1f9b8-200d-2640-fe0f:woman superhero|1f9b9:supervillain|1f9b9-200d-2642-fe0f:man supervillain|1f9b9-200d-2640-fe0f:woman supervillain|1f9d9:mage|1f9d9-200d-2642-fe0f:man mage|1f9d9-200d-2640-fe0f:woman mage|1f9da:fairy|1f9da-200d-2642-fe0f:man fairy|1f9da-200d-2640-fe0f:woman fairy|1f9db:vampire|1f9db-200d-2642-fe0f:man vampire|1f9db-200d-2640-fe0f:woman vampire|1f9dc:merperson|1f9dc-200d-2642-fe0f:merman|1f9dc-200d-2640-fe0f:mermaid|1f9dd:elf|1f9dd-200d-2642-fe0f:man elf|1f9dd-200d-2640-fe0f:woman elf|1f9de:genie|1f9de-200d-2642-fe0f:man genie|1f9de-200d-2640-fe0f:woman genie|1f9df:zombie|1f9df-200d-2642-fe0f:man zombie|1f9df-200d-2640-fe0f:woman zombie|1f9cc:troll|1f486:person getting massage|1f486-200d-2642-fe0f:man getting massage|1f486-200d-2640-fe0f:woman getting massage|1f487:person getting haircut|1f487-200d-2642-fe0f:man getting haircut|1f487-200d-2640-fe0f:woman getting haircut|1f6b6:person walking|1f6b6-200d-2642-fe0f:man walking|1f6b6-200d-2640-fe0f:woman walking|1f9cd:person standing|1f9cd-200d-2642-fe0f:man standing|1f9cd-200d-2640-fe0f:woman standing|1f9ce:person kneeling|1f9ce-200d-2642-fe0f:man kneeling|1f9ce-200d-2640-fe0f:woman kneeling|1f9d1-200d-1f9af:person with white cane|1f468-200d-1f9af:man with white cane|1f469-200d-1f9af:woman with white cane|1f9d1-200d-1f9bc:person in motorized wheelchair|1f468-200d-1f9bc:man in motorized wheelchair|1f469-200d-1f9bc:woman in motorized wheelchair|1f9d1-200d-1f9bd:person in manual wheelchair|1f468-200d-1f9bd:man in manual wheelchair|1f469-200d-1f9bd:woman in manual wheelchair|1f3c3:person running|1f3c3-200d-2642-fe0f:man running|1f3c3-200d-2640-fe0f:woman running|1f483:woman dancing|1f57a:man dancing|1f574-fe0f:person in suit levitating|1f46f:people with bunny ears|1f46f-200d-2642-fe0f:men with bunny ears|1f46f-200d-2640-fe0f:women with bunny ears|1f9d6:person in steamy room|1f9d6-200d-2642-fe0f:man in steamy room|1f9d6-200d-2640-fe0f:woman in steamy room|1f9d7:person climbing|1f9d7-200d-2642-fe0f:man climbing|1f9d7-200d-2640-fe0f:woman climbing|1f93a:person fencing|1f3c7:horse racing|26f7-fe0f:skier|1f3c2:snowboarder|1f3cc-fe0f:person golfing|1f3cc-fe0f-200d-2642-fe0f:man golfing|1f3cc-fe0f-200d-2640-fe0f:woman golfing|1f3c4:person surfing|1f3c4-200d-2642-fe0f:man surfing|1f3c4-200d-2640-fe0f:woman surfing|1f6a3:person rowing boat|1f6a3-200d-2642-fe0f:man rowing boat|1f6a3-200d-2640-fe0f:woman rowing boat|1f3ca:person swimming|1f3ca-200d-2642-fe0f:man swimming|1f3ca-200d-2640-fe0f:woman swimming|26f9-fe0f:person bouncing ball|26f9-fe0f-200d-2642-fe0f:man bouncing ball|26f9-fe0f-200d-2640-fe0f:woman bouncing ball|1f3cb-fe0f:person lifting weights|1f3cb-fe0f-200d-2642-fe0f:man lifting weights|1f3cb-fe0f-200d-2640-fe0f:woman lifting weights|1f6b4:person biking|1f6b4-200d-2642-fe0f:man biking|1f6b4-200d-2640-fe0f:woman biking|1f6b5:person mountain biking|1f6b5-200d-2642-fe0f:man mountain biking|1f6b5-200d-2640-fe0f:woman mountain biking|1f938:person cartwheeling|1f938-200d-2642-fe0f:man cartwheeling|1f938-200d-2640-fe0f:woman cartwheeling|1f93c:people wrestling|1f93c-200d-2642-fe0f:men wrestling|1f93c-200d-2640-fe0f:women wrestling|1f93d:person playing water polo|1f93d-200d-2642-fe0f:man playing water polo|1f93d-200d-2640-fe0f:woman playing water polo|1f93e:person playing handball|1f93e-200d-2642-fe0f:man playing handball|1f93e-200d-2640-fe0f:woman playing handball|1f939:person juggling|1f939-200d-2642-fe0f:man juggling|1f939-200d-2640-fe0f:woman juggling|1f9d8:person in lotus position|1f9d8-200d-2642-fe0f:man in lotus position|1f9d8-200d-2640-fe0f:woman in lotus position|1f6c0:person taking bath|1f6cc:person in bed|1f9d1-200d-1f91d-200d-1f9d1:people holding hands|1f46d:women holding hands|1f46b:woman and man holding hands|1f46c:men holding hands|1f48f:kiss|1f469-200d-2764-fe0f-200d-1f48b-200d-1f468:kiss woman, man|1f468-200d-2764-fe0f-200d-1f48b-200d-1f468:kiss man, man|1f469-200d-2764-fe0f-200d-1f48b-200d-1f469:kiss woman, woman|1f491:couple with heart|1f469-200d-2764-fe0f-200d-1f468:couple with heart woman, man|1f468-200d-2764-fe0f-200d-1f468:couple with heart man, man|1f469-200d-2764-fe0f-200d-1f469:couple with heart woman, woman|1f468-200d-1f469-200d-1f466:family man, woman, boy|1f468-200d-1f469-200d-1f467:family man, woman, girl|1f468-200d-1f469-200d-1f467-200d-1f466:family man, woman, girl, boy|1f468-200d-1f469-200d-1f466-200d-1f466:family man, woman, boy, boy|1f468-200d-1f469-200d-1f467-200d-1f467:family man, woman, girl, girl|1f468-200d-1f468-200d-1f466:family man, man, boy|1f468-200d-1f468-200d-1f467:family man, man, girl|1f468-200d-1f468-200d-1f467-200d-1f466:family man, man, girl, boy|1f468-200d-1f468-200d-1f466-200d-1f466:family man, man, boy, boy|1f468-200d-1f468-200d-1f467-200d-1f467:family man, man, girl, girl|1f469-200d-1f469-200d-1f466:family woman, woman, boy|1f469-200d-1f469-200d-1f467:family woman, woman, girl|1f469-200d-1f469-200d-1f467-200d-1f466:family woman, woman, girl, boy|1f469-200d-1f469-200d-1f466-200d-1f466:family woman, woman, boy, boy|1f469-200d-1f469-200d-1f467-200d-1f467:family woman, woman, girl, girl|1f468-200d-1f466:family man, boy|1f468-200d-1f466-200d-1f466:family man, boy, boy|1f468-200d-1f467:family man, girl|1f468-200d-1f467-200d-1f466:family man, girl, boy|1f468-200d-1f467-200d-1f467:family man, girl, girl|1f469-200d-1f466:family woman, boy|1f469-200d-1f466-200d-1f466:family woman, boy, boy|1f469-200d-1f467:family woman, girl|1f469-200d-1f467-200d-1f466:family woman, girl, boy|1f469-200d-1f467-200d-1f467:family woman, girl, girl|1f5e3-fe0f:speaking head|1f464:bust in silhouette|1f465:busts in silhouette|1fac2:people hugging|1f46a:family|1f463:footprints" },
|
|
2418
2455
|
{ id: "nature", label: "Animals & Nature", data: "1f435:monkey face|1f412:monkey|1f98d:gorilla|1f9a7:orangutan|1f436:dog face|1f415:dog|1f9ae:guide dog|1f415-200d-1f9ba:service dog|1f429:poodle|1f43a:wolf|1f98a:fox|1f99d:raccoon|1f431:cat face|1f408:cat|1f408-200d-2b1b:black cat|1f981:lion|1f42f:tiger face|1f405:tiger|1f406:leopard|1f434:horse face|1face:moose|1facf:donkey|1f40e:horse|1f984:unicorn|1f993:zebra|1f98c:deer|1f9ac:bison|1f42e:cow face|1f402:ox|1f403:water buffalo|1f404:cow|1f437:pig face|1f416:pig|1f417:boar|1f43d:pig nose|1f40f:ram|1f411:ewe|1f410:goat|1f42a:camel|1f42b:two-hump camel|1f999:llama|1f992:giraffe|1f418:elephant|1f9a3:mammoth|1f98f:rhinoceros|1f99b:hippopotamus|1f42d:mouse face|1f401:mouse|1f400:rat|1f439:hamster|1f430:rabbit face|1f407:rabbit|1f43f-fe0f:chipmunk|1f9ab:beaver|1f994:hedgehog|1f987:bat|1f43b:bear|1f43b-200d-2744-fe0f:polar bear|1f428:koala|1f43c:panda|1f9a5:sloth|1f9a6:otter|1f9a8:skunk|1f998:kangaroo|1f9a1:badger|1f43e:paw prints|1f983:turkey|1f414:chicken|1f413:rooster|1f423:hatching chick|1f424:baby chick|1f425:front-facing baby chick|1f426:bird|1f427:penguin|1f54a-fe0f:dove|1f985:eagle|1f986:duck|1f9a2:swan|1f989:owl|1f9a4:dodo|1fab6:feather|1f9a9:flamingo|1f99a:peacock|1f99c:parrot|1fabd:wing|1f426-200d-2b1b:black bird|1fabf:goose|1f438:frog|1f40a:crocodile|1f422:turtle|1f98e:lizard|1f40d:snake|1f432:dragon face|1f409:dragon|1f995:sauropod|1f996:t-rex|1f433:spouting whale|1f40b:whale|1f42c:dolphin|1f9ad:seal|1f41f:fish|1f420:tropical fish|1f421:blowfish|1f988:shark|1f419:octopus|1f41a:spiral shell|1fab8:coral|1fabc:jellyfish|1f980:crab|1f99e:lobster|1f990:shrimp|1f991:squid|1f9aa:oyster|1f40c:snail|1f98b:butterfly|1f41b:bug|1f41c:ant|1f41d:honeybee|1fab2:beetle|1f41e:lady beetle|1f997:cricket|1fab3:cockroach|1f577-fe0f:spider|1f578-fe0f:spider web|1f982:scorpion|1f99f:mosquito|1fab0:fly|1fab1:worm|1f9a0:microbe|1f490:bouquet|1f338:cherry blossom|1f4ae:white flower|1fab7:lotus|1f3f5-fe0f:rosette|1f339:rose|1f940:wilted flower|1f33a:hibiscus|1f33b:sunflower|1f33c:blossom|1f337:tulip|1fabb:hyacinth|1f331:seedling|1fab4:potted plant|1f332:evergreen tree|1f333:deciduous tree|1f334:palm tree|1f335:cactus|1f33e:sheaf of rice|1f33f:herb|2618-fe0f:shamrock|1f340:four leaf clover|1f341:maple leaf|1f342:fallen leaf|1f343:leaf fluttering in wind|1fab9:empty nest|1faba:nest with eggs|1f344:mushroom" },
|
|
@@ -2423,19 +2460,19 @@ const Mf = [
|
|
|
2423
2460
|
{ id: "symbols", label: "Symbols", data: "1f3e7:atm sign|1f6ae:litter in bin sign|1f6b0:potable water|267f:wheelchair symbol|1f6b9:men’s room|1f6ba:women’s room|1f6bb:restroom|1f6bc:baby symbol|1f6be:water closet|1f6c2:passport control|1f6c3:customs|1f6c4:baggage claim|1f6c5:left luggage|26a0-fe0f:warning|1f6b8:children crossing|26d4:no entry|1f6ab:prohibited|1f6b3:no bicycles|1f6ad:no smoking|1f6af:no littering|1f6b1:non-potable water|1f6b7:no pedestrians|1f4f5:no mobile phones|1f51e:no one under eighteen|2622-fe0f:radioactive|2623-fe0f:biohazard|2b06-fe0f:up arrow|2197-fe0f:up-right arrow|27a1-fe0f:right arrow|2198-fe0f:down-right arrow|2b07-fe0f:down arrow|2199-fe0f:down-left arrow|2b05-fe0f:left arrow|2196-fe0f:up-left arrow|2195-fe0f:up-down arrow|2194-fe0f:left-right arrow|21a9-fe0f:right arrow curving left|21aa-fe0f:left arrow curving right|2934-fe0f:right arrow curving up|2935-fe0f:right arrow curving down|1f503:clockwise vertical arrows|1f504:counterclockwise arrows button|1f519:back arrow|1f51a:end arrow|1f51b:on! arrow|1f51c:soon arrow|1f51d:top arrow|1f6d0:place of worship|269b-fe0f:atom symbol|1f549-fe0f:om|2721-fe0f:star of david|2638-fe0f:wheel of dharma|262f-fe0f:yin yang|271d-fe0f:latin cross|2626-fe0f:orthodox cross|262a-fe0f:star and crescent|262e-fe0f:peace symbol|1f54e:menorah|1f52f:dotted six-pointed star|1faaf:khanda|2648:aries|2649:taurus|264a:gemini|264b:cancer|264c:leo|264d:virgo|264e:libra|264f:scorpio|2650:sagittarius|2651:capricorn|2652:aquarius|2653:pisces|26ce:ophiuchus|1f500:shuffle tracks button|1f501:repeat button|1f502:repeat single button|25b6-fe0f:play button|23e9:fast-forward button|23ed-fe0f:next track button|23ef-fe0f:play or pause button|25c0-fe0f:reverse button|23ea:fast reverse button|23ee-fe0f:last track button|1f53c:upwards button|23eb:fast up button|1f53d:downwards button|23ec:fast down button|23f8-fe0f:pause button|23f9-fe0f:stop button|23fa-fe0f:record button|23cf-fe0f:eject button|1f3a6:cinema|1f505:dim button|1f506:bright button|1f4f6:antenna bars|1f6dc:wireless|1f4f3:vibration mode|1f4f4:mobile phone off|2640-fe0f:female sign|2642-fe0f:male sign|26a7-fe0f:transgender symbol|2716-fe0f:multiply|2795:plus|2796:minus|2797:divide|1f7f0:heavy equals sign|267e-fe0f:infinity|203c-fe0f:double exclamation mark|2049-fe0f:exclamation question mark|2753:red question mark|2754:white question mark|2755:white exclamation mark|2757:red exclamation mark|3030-fe0f:wavy dash|1f4b1:currency exchange|1f4b2:heavy dollar sign|2695-fe0f:medical symbol|267b-fe0f:recycling symbol|269c-fe0f:fleur-de-lis|1f531:trident emblem|1f4db:name badge|1f530:japanese symbol for beginner|2b55:hollow red circle|2705:check mark button|2611-fe0f:check box with check|2714-fe0f:check mark|274c:cross mark|274e:cross mark button|27b0:curly loop|27bf:double curly loop|303d-fe0f:part alternation mark|2733-fe0f:eight-spoked asterisk|2734-fe0f:eight-pointed star|2747-fe0f:sparkle|00a9-fe0f:copyright|00ae-fe0f:registered|2122-fe0f:trade mark|0023-fe0f-20e3:keycap #|002a-fe0f-20e3:keycap *|0030-fe0f-20e3:keycap 0|0031-fe0f-20e3:keycap 1|0032-fe0f-20e3:keycap 2|0033-fe0f-20e3:keycap 3|0034-fe0f-20e3:keycap 4|0035-fe0f-20e3:keycap 5|0036-fe0f-20e3:keycap 6|0037-fe0f-20e3:keycap 7|0038-fe0f-20e3:keycap 8|0039-fe0f-20e3:keycap 9|1f51f:keycap 10|1f520:input latin uppercase|1f521:input latin lowercase|1f522:input numbers|1f523:input symbols|1f524:input latin letters|1f170-fe0f:a button (blood type)|1f18e:ab button (blood type)|1f171-fe0f:b button (blood type)|1f191:cl button|1f192:cool button|1f193:free button|2139-fe0f:information|1f194:id button|24c2-fe0f:circled m|1f195:new button|1f196:ng button|1f17e-fe0f:o button (blood type)|1f197:ok button|1f17f-fe0f:p button|1f198:sos button|1f199:up! button|1f19a:vs button|1f201:japanese “here” button|1f202-fe0f:japanese “service charge” button|1f237-fe0f:japanese “monthly amount” button|1f236:japanese “not free of charge” button|1f22f:japanese “reserved” button|1f250:japanese “bargain” button|1f239:japanese “discount” button|1f21a:japanese “free of charge” button|1f232:japanese “prohibited” button|1f251:japanese “acceptable” button|1f238:japanese “application” button|1f234:japanese “passing grade” button|1f233:japanese “vacancy” button|3297-fe0f:japanese “congratulations” button|3299-fe0f:japanese “secret” button|1f23a:japanese “open for business” button|1f235:japanese “no vacancy” button|1f534:red circle|1f7e0:orange circle|1f7e1:yellow circle|1f7e2:green circle|1f535:blue circle|1f7e3:purple circle|1f7e4:brown circle|26ab:black circle|26aa:white circle|1f7e5:red square|1f7e7:orange square|1f7e8:yellow square|1f7e9:green square|1f7e6:blue square|1f7ea:purple square|1f7eb:brown square|2b1b:black large square|2b1c:white large square|25fc-fe0f:black medium square|25fb-fe0f:white medium square|25fe:black medium-small square|25fd:white medium-small square|25aa-fe0f:black small square|25ab-fe0f:white small square|1f536:large orange diamond|1f537:large blue diamond|1f538:small orange diamond|1f539:small blue diamond|1f53a:red triangle pointed up|1f53b:red triangle pointed down|1f4a0:diamond with a dot|1f518:radio button|1f533:white square button|1f532:black square button" },
|
|
2424
2461
|
{ id: "flags", label: "Flags", data: "1f3c1:chequered flag|1f6a9:triangular flag|1f38c:crossed flags|1f3f4:black flag|1f3f3-fe0f:white flag|1f3f3-fe0f-200d-1f308:rainbow flag|1f3f3-fe0f-200d-26a7-fe0f:transgender flag|1f3f4-200d-2620-fe0f:pirate flag|1f1e6-1f1e8:flag ascension island|1f1e6-1f1e9:flag andorra|1f1e6-1f1ea:flag united arab emirates|1f1e6-1f1eb:flag afghanistan|1f1e6-1f1ec:flag antigua & barbuda|1f1e6-1f1ee:flag anguilla|1f1e6-1f1f1:flag albania|1f1e6-1f1f2:flag armenia|1f1e6-1f1f4:flag angola|1f1e6-1f1f6:flag antarctica|1f1e6-1f1f7:flag argentina|1f1e6-1f1f8:flag american samoa|1f1e6-1f1f9:flag austria|1f1e6-1f1fa:flag australia|1f1e6-1f1fc:flag aruba|1f1e6-1f1fd:flag åland islands|1f1e6-1f1ff:flag azerbaijan|1f1e7-1f1e6:flag bosnia & herzegovina|1f1e7-1f1e7:flag barbados|1f1e7-1f1e9:flag bangladesh|1f1e7-1f1ea:flag belgium|1f1e7-1f1eb:flag burkina faso|1f1e7-1f1ec:flag bulgaria|1f1e7-1f1ed:flag bahrain|1f1e7-1f1ee:flag burundi|1f1e7-1f1ef:flag benin|1f1e7-1f1f1:flag st. barthélemy|1f1e7-1f1f2:flag bermuda|1f1e7-1f1f3:flag brunei|1f1e7-1f1f4:flag bolivia|1f1e7-1f1f6:flag caribbean netherlands|1f1e7-1f1f7:flag brazil|1f1e7-1f1f8:flag bahamas|1f1e7-1f1f9:flag bhutan|1f1e7-1f1fb:flag bouvet island|1f1e7-1f1fc:flag botswana|1f1e7-1f1fe:flag belarus|1f1e7-1f1ff:flag belize|1f1e8-1f1e6:flag canada|1f1e8-1f1e8:flag cocos (keeling) islands|1f1e8-1f1e9:flag congo - kinshasa|1f1e8-1f1eb:flag central african republic|1f1e8-1f1ec:flag congo - brazzaville|1f1e8-1f1ed:flag switzerland|1f1e8-1f1ee:flag côte d’ivoire|1f1e8-1f1f0:flag cook islands|1f1e8-1f1f1:flag chile|1f1e8-1f1f2:flag cameroon|1f1e8-1f1f3:flag china|1f1e8-1f1f4:flag colombia|1f1e8-1f1f5:flag clipperton island|1f1e8-1f1f7:flag costa rica|1f1e8-1f1fa:flag cuba|1f1e8-1f1fb:flag cape verde|1f1e8-1f1fc:flag curaçao|1f1e8-1f1fd:flag christmas island|1f1e8-1f1fe:flag cyprus|1f1e8-1f1ff:flag czechia|1f1e9-1f1ea:flag germany|1f1e9-1f1ec:flag diego garcia|1f1e9-1f1ef:flag djibouti|1f1e9-1f1f0:flag denmark|1f1e9-1f1f2:flag dominica|1f1e9-1f1f4:flag dominican republic|1f1e9-1f1ff:flag algeria|1f1ea-1f1e6:flag ceuta & melilla|1f1ea-1f1e8:flag ecuador|1f1ea-1f1ea:flag estonia|1f1ea-1f1ec:flag egypt|1f1ea-1f1ed:flag western sahara|1f1ea-1f1f7:flag eritrea|1f1ea-1f1f8:flag spain|1f1ea-1f1f9:flag ethiopia|1f1ea-1f1fa:flag european union|1f1eb-1f1ee:flag finland|1f1eb-1f1ef:flag fiji|1f1eb-1f1f0:flag falkland islands|1f1eb-1f1f2:flag micronesia|1f1eb-1f1f4:flag faroe islands|1f1eb-1f1f7:flag france|1f1ec-1f1e6:flag gabon|1f1ec-1f1e7:flag united kingdom|1f1ec-1f1e9:flag grenada|1f1ec-1f1ea:flag georgia|1f1ec-1f1eb:flag french guiana|1f1ec-1f1ec:flag guernsey|1f1ec-1f1ed:flag ghana|1f1ec-1f1ee:flag gibraltar|1f1ec-1f1f1:flag greenland|1f1ec-1f1f2:flag gambia|1f1ec-1f1f3:flag guinea|1f1ec-1f1f5:flag guadeloupe|1f1ec-1f1f6:flag equatorial guinea|1f1ec-1f1f7:flag greece|1f1ec-1f1f8:flag south georgia & south sandwich islands|1f1ec-1f1f9:flag guatemala|1f1ec-1f1fa:flag guam|1f1ec-1f1fc:flag guinea-bissau|1f1ec-1f1fe:flag guyana|1f1ed-1f1f0:flag hong kong sar china|1f1ed-1f1f2:flag heard island & mcdonald islands|1f1ed-1f1f3:flag honduras|1f1ed-1f1f7:flag croatia|1f1ed-1f1f9:flag haiti|1f1ed-1f1fa:flag hungary|1f1ee-1f1e8:flag canary islands|1f1ee-1f1e9:flag indonesia|1f1ee-1f1ea:flag ireland|1f1ee-1f1f1:flag israel|1f1ee-1f1f2:flag isle of man|1f1ee-1f1f3:flag india|1f1ee-1f1f4:flag british indian ocean territory|1f1ee-1f1f6:flag iraq|1f1ee-1f1f7:flag iran|1f1ee-1f1f8:flag iceland|1f1ee-1f1f9:flag italy|1f1ef-1f1ea:flag jersey|1f1ef-1f1f2:flag jamaica|1f1ef-1f1f4:flag jordan|1f1ef-1f1f5:flag japan|1f1f0-1f1ea:flag kenya|1f1f0-1f1ec:flag kyrgyzstan|1f1f0-1f1ed:flag cambodia|1f1f0-1f1ee:flag kiribati|1f1f0-1f1f2:flag comoros|1f1f0-1f1f3:flag st. kitts & nevis|1f1f0-1f1f5:flag north korea|1f1f0-1f1f7:flag south korea|1f1f0-1f1fc:flag kuwait|1f1f0-1f1fe:flag cayman islands|1f1f0-1f1ff:flag kazakhstan|1f1f1-1f1e6:flag laos|1f1f1-1f1e7:flag lebanon|1f1f1-1f1e8:flag st. lucia|1f1f1-1f1ee:flag liechtenstein|1f1f1-1f1f0:flag sri lanka|1f1f1-1f1f7:flag liberia|1f1f1-1f1f8:flag lesotho|1f1f1-1f1f9:flag lithuania|1f1f1-1f1fa:flag luxembourg|1f1f1-1f1fb:flag latvia|1f1f1-1f1fe:flag libya|1f1f2-1f1e6:flag morocco|1f1f2-1f1e8:flag monaco|1f1f2-1f1e9:flag moldova|1f1f2-1f1ea:flag montenegro|1f1f2-1f1eb:flag st. martin|1f1f2-1f1ec:flag madagascar|1f1f2-1f1ed:flag marshall islands|1f1f2-1f1f0:flag north macedonia|1f1f2-1f1f1:flag mali|1f1f2-1f1f2:flag myanmar (burma)|1f1f2-1f1f3:flag mongolia|1f1f2-1f1f4:flag macao sar china|1f1f2-1f1f5:flag northern mariana islands|1f1f2-1f1f6:flag martinique|1f1f2-1f1f7:flag mauritania|1f1f2-1f1f8:flag montserrat|1f1f2-1f1f9:flag malta|1f1f2-1f1fa:flag mauritius|1f1f2-1f1fb:flag maldives|1f1f2-1f1fc:flag malawi|1f1f2-1f1fd:flag mexico|1f1f2-1f1fe:flag malaysia|1f1f2-1f1ff:flag mozambique|1f1f3-1f1e6:flag namibia|1f1f3-1f1e8:flag new caledonia|1f1f3-1f1ea:flag niger|1f1f3-1f1eb:flag norfolk island|1f1f3-1f1ec:flag nigeria|1f1f3-1f1ee:flag nicaragua|1f1f3-1f1f1:flag netherlands|1f1f3-1f1f4:flag norway|1f1f3-1f1f5:flag nepal|1f1f3-1f1f7:flag nauru|1f1f3-1f1fa:flag niue|1f1f3-1f1ff:flag new zealand|1f1f4-1f1f2:flag oman|1f1f5-1f1e6:flag panama|1f1f5-1f1ea:flag peru|1f1f5-1f1eb:flag french polynesia|1f1f5-1f1ec:flag papua new guinea|1f1f5-1f1ed:flag philippines|1f1f5-1f1f0:flag pakistan|1f1f5-1f1f1:flag poland|1f1f5-1f1f2:flag st. pierre & miquelon|1f1f5-1f1f3:flag pitcairn islands|1f1f5-1f1f7:flag puerto rico|1f1f5-1f1f8:flag palestinian territories|1f1f5-1f1f9:flag portugal|1f1f5-1f1fc:flag palau|1f1f5-1f1fe:flag paraguay|1f1f6-1f1e6:flag qatar|1f1f7-1f1ea:flag réunion|1f1f7-1f1f4:flag romania|1f1f7-1f1f8:flag serbia|1f1f7-1f1fa:flag russia|1f1f7-1f1fc:flag rwanda|1f1f8-1f1e6:flag saudi arabia|1f1f8-1f1e7:flag solomon islands|1f1f8-1f1e8:flag seychelles|1f1f8-1f1e9:flag sudan|1f1f8-1f1ea:flag sweden|1f1f8-1f1ec:flag singapore|1f1f8-1f1ed:flag st. helena, ascension & tristan da cunha|1f1f8-1f1ee:flag slovenia|1f1f8-1f1ef:flag svalbard & jan mayen|1f1f8-1f1f0:flag slovakia|1f1f8-1f1f1:flag sierra leone|1f1f8-1f1f2:flag san marino|1f1f8-1f1f3:flag senegal|1f1f8-1f1f4:flag somalia|1f1f8-1f1f7:flag suriname|1f1f8-1f1f8:flag south sudan|1f1f8-1f1f9:flag são tomé & príncipe|1f1f8-1f1fb:flag el salvador|1f1f8-1f1fd:flag sint maarten|1f1f8-1f1fe:flag syria|1f1f8-1f1ff:flag eswatini|1f1f9-1f1e6:flag tristan da cunha|1f1f9-1f1e8:flag turks & caicos islands|1f1f9-1f1e9:flag chad|1f1f9-1f1eb:flag french southern and antarctic lands|1f1f9-1f1ec:flag togo|1f1f9-1f1ed:flag thailand|1f1f9-1f1ef:flag tajikistan|1f1f9-1f1f0:flag tokelau|1f1f9-1f1f1:flag timor-leste|1f1f9-1f1f2:flag turkmenistan|1f1f9-1f1f3:flag tunisia|1f1f9-1f1f4:flag tonga|1f1f9-1f1f7:flag türkiye|1f1f9-1f1f9:flag trinidad & tobago|1f1f9-1f1fb:flag tuvalu|1f1f9-1f1fc:flag taiwan|1f1f9-1f1ff:flag tanzania|1f1fa-1f1e6:flag ukraine|1f1fa-1f1ec:flag uganda|1f1fa-1f1f2:flag u.s. outlying islands|1f1fa-1f1f3:flag united nations|1f1fa-1f1f8:flag united states|1f1fa-1f1fe:flag uruguay|1f1fa-1f1ff:flag uzbekistan|1f1fb-1f1e6:flag vatican city|1f1fb-1f1e8:flag st. vincent & grenadines|1f1fb-1f1ea:flag venezuela|1f1fb-1f1ec:flag british virgin islands|1f1fb-1f1ee:flag u.s. virgin islands|1f1fb-1f1f3:flag vietnam|1f1fb-1f1fa:flag vanuatu|1f1fc-1f1eb:flag wallis & futuna|1f1fc-1f1f8:flag samoa|1f1fd-1f1f0:flag kosovo|1f1fe-1f1ea:flag yemen|1f1fe-1f1f9:flag mayotte|1f1ff-1f1e6:flag south africa|1f1ff-1f1f2:flag zambia|1f1ff-1f1fc:flag zimbabwe|1f3f4-e0067-e0062-e0065-e006e-e0067-e007f:flag england|1f3f4-e0067-e0062-e0073-e0063-e0074-e007f:flag scotland|1f3f4-e0067-e0062-e0077-e006c-e0073-e007f:flag wales" }
|
|
2425
2462
|
];
|
|
2426
|
-
function
|
|
2463
|
+
function Bf(e) {
|
|
2427
2464
|
const t = e.indexOf(":"), n = e.slice(0, t);
|
|
2428
2465
|
return { char: String.fromCodePoint(...n.split("-").map((a) => parseInt(a, 16))), name: e.slice(t + 1) };
|
|
2429
2466
|
}
|
|
2430
|
-
let
|
|
2431
|
-
function
|
|
2432
|
-
return
|
|
2467
|
+
let rn = null;
|
|
2468
|
+
function jt() {
|
|
2469
|
+
return rn ??= zf.map((e) => ({ id: e.id, label: e.label, emoji: e.data.split("|").map(Bf) })), rn;
|
|
2433
2470
|
}
|
|
2434
2471
|
let ie = null;
|
|
2435
|
-
function
|
|
2472
|
+
function Ke(e) {
|
|
2436
2473
|
if (!ie) {
|
|
2437
2474
|
ie = /* @__PURE__ */ new Map();
|
|
2438
|
-
for (const t of
|
|
2475
|
+
for (const t of jt().flatMap((n) => n.emoji)) {
|
|
2439
2476
|
ie.set(t.char, t);
|
|
2440
2477
|
const n = t.char.replace(/\ufe0f/g, "");
|
|
2441
2478
|
ie.has(n) || ie.set(n, t);
|
|
@@ -2443,10 +2480,10 @@ function Ve(e) {
|
|
|
2443
2480
|
}
|
|
2444
2481
|
return ie.get(e) ?? ie.get(e.replace(/\ufe0f/g, ""));
|
|
2445
2482
|
}
|
|
2446
|
-
function
|
|
2483
|
+
function Wf(e, t = 120) {
|
|
2447
2484
|
const n = e.toLowerCase().trim().split(/\s+/).filter(Boolean);
|
|
2448
2485
|
if (!n.length) return [];
|
|
2449
|
-
const r =
|
|
2486
|
+
const r = jt().flatMap((s) => s.emoji).filter((s) => {
|
|
2450
2487
|
const c = s.name.split(/[\s-]+/);
|
|
2451
2488
|
return n.every((b) => c.some((p) => p.startsWith(b)));
|
|
2452
2489
|
}), o = n.join(" "), i = (s) => {
|
|
@@ -2456,38 +2493,38 @@ function Lf(e, t = 120) {
|
|
|
2456
2493
|
};
|
|
2457
2494
|
return r.sort((s, c) => i(s) - i(c)), r.slice(0, t);
|
|
2458
2495
|
}
|
|
2459
|
-
const
|
|
2496
|
+
const Gf = [
|
|
2460
2497
|
[128077],
|
|
2461
2498
|
[10084, 65039],
|
|
2462
2499
|
[128514],
|
|
2463
2500
|
[128558],
|
|
2464
2501
|
[128546],
|
|
2465
2502
|
[128293]
|
|
2466
|
-
].map((e) => String.fromCodePoint(...e)),
|
|
2467
|
-
function
|
|
2503
|
+
].map((e) => String.fromCodePoint(...e)), ma = 24;
|
|
2504
|
+
function Pt() {
|
|
2468
2505
|
const e = B(ae.RECENT_EMOJI);
|
|
2469
2506
|
if (!e) return [];
|
|
2470
2507
|
try {
|
|
2471
2508
|
const t = JSON.parse(e);
|
|
2472
|
-
return Array.isArray(t) ? t.filter((n) => typeof n == "string").slice(0,
|
|
2509
|
+
return Array.isArray(t) ? t.filter((n) => typeof n == "string").slice(0, ma) : [];
|
|
2473
2510
|
} catch {
|
|
2474
2511
|
return [];
|
|
2475
2512
|
}
|
|
2476
2513
|
}
|
|
2477
|
-
function
|
|
2478
|
-
const t = [e, ...
|
|
2479
|
-
|
|
2514
|
+
function Vf(e) {
|
|
2515
|
+
const t = [e, ...Pt().filter((n) => n !== e)].slice(0, ma);
|
|
2516
|
+
et(ae.RECENT_EMOJI, JSON.stringify(t));
|
|
2480
2517
|
}
|
|
2481
|
-
function
|
|
2518
|
+
function Kf(e = 3) {
|
|
2482
2519
|
const t = [];
|
|
2483
|
-
for (const n of [...
|
|
2520
|
+
for (const n of [...Pt(), ...Gf])
|
|
2484
2521
|
if (t.includes(n) || t.push(n), t.length === e) break;
|
|
2485
2522
|
return t;
|
|
2486
2523
|
}
|
|
2487
|
-
function
|
|
2524
|
+
function ga(e, t) {
|
|
2488
2525
|
return e.by.some((n) => n === t.author || !!t.clientId && n === t.clientId);
|
|
2489
2526
|
}
|
|
2490
|
-
function
|
|
2527
|
+
function Yf(e, t, n) {
|
|
2491
2528
|
const a = /* @__PURE__ */ new Map();
|
|
2492
2529
|
for (const s of Object.values(t))
|
|
2493
2530
|
s.author && a.set(s.author, s.name), a.set(s.clientId, s.name);
|
|
@@ -2503,18 +2540,18 @@ function Ff(e, t, n) {
|
|
|
2503
2540
|
}
|
|
2504
2541
|
return o && r.unshift("You"), i && r.push(i === 1 ? "1 other" : `${i} others`), r;
|
|
2505
2542
|
}
|
|
2506
|
-
function
|
|
2543
|
+
function Jf(e, t) {
|
|
2507
2544
|
return `${e.length <= 1 ? e[0] ?? "Someone" : `${e.slice(0, -1).join(", ")} and ${e[e.length - 1]}`} reacted with ${t ? `:${t.replace(/\s+/g, "_")}:` : "this"}`;
|
|
2508
2545
|
}
|
|
2509
2546
|
const ce = 8;
|
|
2510
|
-
function
|
|
2547
|
+
function Xf(e) {
|
|
2511
2548
|
return document.addEventListener("fullscreenchange", e), () => document.removeEventListener("fullscreenchange", e);
|
|
2512
2549
|
}
|
|
2513
|
-
function
|
|
2514
|
-
const e =
|
|
2515
|
-
return
|
|
2550
|
+
function Qf() {
|
|
2551
|
+
const e = Hn();
|
|
2552
|
+
return mn(Xf, () => document.fullscreenElement, () => null) ?? e ?? document.body;
|
|
2516
2553
|
}
|
|
2517
|
-
function
|
|
2554
|
+
function Zf({
|
|
2518
2555
|
anchor: e,
|
|
2519
2556
|
onClose: t,
|
|
2520
2557
|
width: n,
|
|
@@ -2527,21 +2564,21 @@ function Bf({
|
|
|
2527
2564
|
testId: b,
|
|
2528
2565
|
children: p
|
|
2529
2566
|
}) {
|
|
2530
|
-
const I =
|
|
2567
|
+
const I = Qf(), S = z(null), [N, M] = E(null), h = D(() => {
|
|
2531
2568
|
const d = S.current;
|
|
2532
2569
|
if (!e || !d) return;
|
|
2533
|
-
const m = e.getBoundingClientRect(), w = window.innerWidth, v = window.innerHeight, C = Math.min(n, w - ce * 2),
|
|
2534
|
-
M((
|
|
2570
|
+
const m = e.getBoundingClientRect(), w = window.innerWidth, v = window.innerHeight, C = Math.min(n, w - ce * 2), H = Math.min(Math.max(ce, r ? m.right - C : m.left), w - C - ce), F = d.offsetHeight, O = m.top - o - ce, L = v - m.bottom - o - ce, T = a === "top" ? F <= O || O >= L : !(F <= L || L >= O), R = Math.max(120, T ? O : L), j = Math.min(F, R), $ = T ? m.top - o - j : m.bottom + o;
|
|
2571
|
+
M((U) => U && U.left === H && U.top === $ && U.maxHeight === R ? U : { left: H, top: $, maxHeight: R });
|
|
2535
2572
|
}, [e, n, r, o, a]);
|
|
2536
|
-
return
|
|
2573
|
+
return Ot(() => {
|
|
2537
2574
|
h();
|
|
2538
2575
|
const d = S.current, m = typeof ResizeObserver > "u" || !d ? null : new ResizeObserver(() => h());
|
|
2539
2576
|
return m && d && m.observe(d), window.addEventListener("resize", h), window.addEventListener("scroll", h, !0), () => {
|
|
2540
2577
|
m?.disconnect(), window.removeEventListener("resize", h), window.removeEventListener("scroll", h, !0);
|
|
2541
2578
|
};
|
|
2542
|
-
}, [h]),
|
|
2579
|
+
}, [h]), Ot(() => {
|
|
2543
2580
|
const d = (w) => {
|
|
2544
|
-
|
|
2581
|
+
Qe(w) && (w.stopPropagation(), t(), e?.focus({ preventScroll: !0 }));
|
|
2545
2582
|
}, m = (w) => {
|
|
2546
2583
|
const v = w.target;
|
|
2547
2584
|
S.current?.contains(v) || e?.contains(v) || t();
|
|
@@ -2549,7 +2586,7 @@ function Bf({
|
|
|
2549
2586
|
return document.addEventListener("keydown", d), document.addEventListener("pointerdown", m, !0), () => {
|
|
2550
2587
|
document.removeEventListener("keydown", d), document.removeEventListener("pointerdown", m, !0);
|
|
2551
2588
|
};
|
|
2552
|
-
}, [t, e]),
|
|
2589
|
+
}, [t, e]), yn(
|
|
2553
2590
|
/* @__PURE__ */ l(
|
|
2554
2591
|
"div",
|
|
2555
2592
|
{
|
|
@@ -2577,12 +2614,12 @@ function Bf({
|
|
|
2577
2614
|
I
|
|
2578
2615
|
);
|
|
2579
2616
|
}
|
|
2580
|
-
const
|
|
2581
|
-
function
|
|
2582
|
-
const [a, r] = E(""), [o, i] = E(null), s = z(null), c = z(null), b = G(() =>
|
|
2583
|
-
() =>
|
|
2617
|
+
const ei = 340;
|
|
2618
|
+
function ti({ anchor: e, onPick: t, onClose: n }) {
|
|
2619
|
+
const [a, r] = E(""), [o, i] = E(null), s = z(null), c = z(null), b = G(() => jt(), []), p = G(
|
|
2620
|
+
() => Pt().map((d) => Ke(d) ?? { char: d, name: "" }).slice(0, 16),
|
|
2584
2621
|
[]
|
|
2585
|
-
), I = G(() =>
|
|
2622
|
+
), I = G(() => Wf(a), [a]), S = a.trim().length > 0;
|
|
2586
2623
|
A(() => {
|
|
2587
2624
|
s.current?.focus({ preventScroll: !0 });
|
|
2588
2625
|
}, []);
|
|
@@ -2605,7 +2642,7 @@ function Gf({ anchor: e, onPick: t, onClose: n }) {
|
|
|
2605
2642
|
},
|
|
2606
2643
|
m
|
|
2607
2644
|
);
|
|
2608
|
-
return /* @__PURE__ */ y(
|
|
2645
|
+
return /* @__PURE__ */ y(Zf, { anchor: e, onClose: n, width: ei, className: "emoji-picker", ariaLabel: "Emoji picker", testId: "emoji-picker", children: [
|
|
2609
2646
|
/* @__PURE__ */ l("div", { className: "emoji-picker-search", children: /* @__PURE__ */ l(
|
|
2610
2647
|
"input",
|
|
2611
2648
|
{
|
|
@@ -2646,22 +2683,22 @@ function Gf({ anchor: e, onPick: t, onClose: n }) {
|
|
|
2646
2683
|
] }) : null })
|
|
2647
2684
|
] });
|
|
2648
2685
|
}
|
|
2649
|
-
function
|
|
2686
|
+
function ni({ className: e = "w-4 h-4" }) {
|
|
2650
2687
|
return /* @__PURE__ */ y("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, children: [
|
|
2651
2688
|
/* @__PURE__ */ l("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 4v16" }),
|
|
2652
2689
|
/* @__PURE__ */ l("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12l-5 4v-8l5 4z" })
|
|
2653
2690
|
] });
|
|
2654
2691
|
}
|
|
2655
|
-
function
|
|
2692
|
+
function ai({ className: e = "w-4 h-4" }) {
|
|
2656
2693
|
return /* @__PURE__ */ y("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, children: [
|
|
2657
2694
|
/* @__PURE__ */ l("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M20 4v16" }),
|
|
2658
2695
|
/* @__PURE__ */ l("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 12l5 4v-8l-5 4z" })
|
|
2659
2696
|
] });
|
|
2660
2697
|
}
|
|
2661
|
-
function
|
|
2698
|
+
function ri({ className: e = "w-5 h-5" }) {
|
|
2662
2699
|
return /* @__PURE__ */ l("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, children: /* @__PURE__ */ l("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 6l12 12M18 6L6 18" }) });
|
|
2663
2700
|
}
|
|
2664
|
-
function
|
|
2701
|
+
function pa({ className: e = "w-4 h-4" }) {
|
|
2665
2702
|
return /* @__PURE__ */ y("svg", { className: e, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [
|
|
2666
2703
|
/* @__PURE__ */ l("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M20.5 12.5A8.5 8.5 0 1111.5 3.5" }),
|
|
2667
2704
|
/* @__PURE__ */ l("path", { strokeLinecap: "round", d: "M8.5 14.5a4 4 0 007 0" }),
|
|
@@ -2669,46 +2706,48 @@ function ma({ className: e = "w-4 h-4" }) {
|
|
|
2669
2706
|
/* @__PURE__ */ l("path", { strokeLinecap: "round", d: "M19 2v6M16 5h6" })
|
|
2670
2707
|
] });
|
|
2671
2708
|
}
|
|
2672
|
-
function
|
|
2709
|
+
function oi({ className: e = "w-4 h-4" }) {
|
|
2673
2710
|
return /* @__PURE__ */ y("svg", { className: e, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [
|
|
2674
2711
|
/* @__PURE__ */ l("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10 7L4 12l6 5" }),
|
|
2675
2712
|
/* @__PURE__ */ l("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 12h9a7 7 0 017 7" })
|
|
2676
2713
|
] });
|
|
2677
2714
|
}
|
|
2678
|
-
function
|
|
2715
|
+
function st(e) {
|
|
2679
2716
|
return new Date(e).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" });
|
|
2680
2717
|
}
|
|
2681
|
-
const
|
|
2682
|
-
const n = u((m) => m.me.clientId), a = u((m) => m.me.clientId ? m.roster[m.me.clientId]?.author : void 0), r =
|
|
2718
|
+
const fi = qe.memo(function({ message: t }) {
|
|
2719
|
+
const n = u((m) => m.me.clientId), a = u((m) => m.me.clientId ? m.roster[m.me.clientId]?.author : void 0), r = qf(t, { clientId: n, author: a }), o = nt(
|
|
2683
2720
|
{ clientId: t.clientId, author: t.author },
|
|
2684
2721
|
{ name: t.name, sprite: t.sprite }
|
|
2685
|
-
), i =
|
|
2686
|
-
|
|
2722
|
+
), i = Ce(o.sprite, o.pictureUrl), s = t.isSystem ? void 0 : o.cosmetics, c = z(null);
|
|
2723
|
+
Or(c, !!s);
|
|
2687
2724
|
const [b] = E(
|
|
2688
|
-
() => t.live && t.text ?
|
|
2725
|
+
() => t.live && t.text ? pn(t.text, s) : null
|
|
2689
2726
|
), [p, I] = E(!1), [S, N] = E(null), M = u((m) => m.setReplyingTo);
|
|
2690
2727
|
if (t.isSystem && t.systemType === "recap")
|
|
2691
2728
|
return /* @__PURE__ */ l("div", { className: "px-2 py-1.5", children: /* @__PURE__ */ y("div", { className: "border-l-2 border-border-light pl-2.5 py-0.5", children: [
|
|
2692
2729
|
/* @__PURE__ */ y("div", { className: "text-[10px] uppercase tracking-wide text-text-muted mb-0.5", children: [
|
|
2693
2730
|
"Recap",
|
|
2694
|
-
/* @__PURE__ */ l("span", { className: "ml-1.5 normal-case tracking-normal opacity-60", children:
|
|
2731
|
+
/* @__PURE__ */ l("span", { className: "ml-1.5 normal-case tracking-normal opacity-60", children: st(t.ts) })
|
|
2695
2732
|
] }),
|
|
2696
2733
|
/* @__PURE__ */ l("p", { className: "text-[13px] text-text-secondary leading-relaxed whitespace-pre-wrap break-words", children: t.text })
|
|
2697
2734
|
] }) });
|
|
2698
2735
|
if (t.isSystem)
|
|
2699
2736
|
return /* @__PURE__ */ y("div", { className: "px-2 py-0.5 text-[11px] text-text-muted italic text-center leading-tight", children: [
|
|
2700
|
-
|
|
2701
|
-
/* @__PURE__ */ l("span", { className: "ml-1 text-[10px] opacity-50", children:
|
|
2737
|
+
Of(t.text, t.template, o),
|
|
2738
|
+
/* @__PURE__ */ l("span", { className: "ml-1 text-[10px] opacity-50", children: st(t.ts) })
|
|
2702
2739
|
] });
|
|
2703
2740
|
const h = { clientId: n, author: a }, d = (m) => {
|
|
2704
|
-
const w = t.reactions?.find((
|
|
2705
|
-
v &&
|
|
2741
|
+
const w = t.reactions?.find((H) => H.emoji === m), v = !(w && ga(w, h));
|
|
2742
|
+
v && Vf(m);
|
|
2743
|
+
const C = a ?? n;
|
|
2744
|
+
C && Io(t.id, m, v, C), Tf(t.id, m, v);
|
|
2706
2745
|
};
|
|
2707
2746
|
return /* @__PURE__ */ y(
|
|
2708
2747
|
"div",
|
|
2709
2748
|
{
|
|
2710
2749
|
ref: c,
|
|
2711
|
-
style:
|
|
2750
|
+
style: $n(i),
|
|
2712
2751
|
"data-msg-id": t.id,
|
|
2713
2752
|
className: `chat-msg px-2 py-1 ${r ? "chat-msg-own" : ""}`,
|
|
2714
2753
|
onMouseEnter: () => I(!0),
|
|
@@ -2719,19 +2758,19 @@ const Xf = $e.memo(function({ message: t }) {
|
|
|
2719
2758
|
},
|
|
2720
2759
|
"data-active": p || S ? "true" : void 0,
|
|
2721
2760
|
children: [
|
|
2722
|
-
t.replyTo && /* @__PURE__ */ l(
|
|
2761
|
+
t.replyTo && /* @__PURE__ */ l(ii, { replyTo: t.replyTo }),
|
|
2723
2762
|
/* @__PURE__ */ y("div", { className: "flex items-start gap-2", children: [
|
|
2724
|
-
/* @__PURE__ */ l(
|
|
2763
|
+
/* @__PURE__ */ l(da, { sprite: o.sprite, url: o.pictureUrl, alt: o.name, worn: s }),
|
|
2725
2764
|
/* @__PURE__ */ y("div", { className: "flex-1 min-w-0 -mt-0.5", children: [
|
|
2726
|
-
s ? /* @__PURE__ */ l(ye, { html:
|
|
2727
|
-
/* @__PURE__ */ l("span", { className: "text-[10px] text-text-muted opacity-60 ml-1.5", children:
|
|
2765
|
+
s ? /* @__PURE__ */ l(ye, { html: hn(o.name, s), className: "text-[13px]", style: { color: i } }) : /* @__PURE__ */ l("span", { className: "font-medium text-[13px]", style: { color: i }, children: o.name }),
|
|
2766
|
+
/* @__PURE__ */ l("span", { className: "text-[10px] text-text-muted opacity-60 ml-1.5", children: st(t.ts) }),
|
|
2728
2767
|
t.text && (b ? /* @__PURE__ */ l(ye, { as: "p", html: b, className: "text-[13px] text-text break-words leading-snug m-0" }) : /* @__PURE__ */ l("p", { className: "text-[13px] text-text break-words leading-snug m-0", children: t.text })),
|
|
2729
|
-
/* @__PURE__ */ l(
|
|
2730
|
-
t.reactions && t.reactions.length > 0 && /* @__PURE__ */ l(
|
|
2768
|
+
/* @__PURE__ */ l(ua, { images: t.images }),
|
|
2769
|
+
t.reactions && t.reactions.length > 0 && /* @__PURE__ */ l(si, { reactions: t.reactions, me: h, onToggle: d, onAdd: N })
|
|
2731
2770
|
] })
|
|
2732
2771
|
] }),
|
|
2733
2772
|
(p || S) && /* @__PURE__ */ y("div", { className: "chat-msg-actions", role: "toolbar", "aria-label": "Message actions", "data-testid": "chat-msg-actions", children: [
|
|
2734
|
-
|
|
2773
|
+
Kf().map((m) => /* @__PURE__ */ l("button", { type: "button", className: "chat-action-btn chat-action-emoji", onClick: () => d(m), "aria-label": `React with ${Ke(m)?.name ?? m}`, title: Ke(m)?.name, children: m }, m)),
|
|
2735
2774
|
/* @__PURE__ */ l(
|
|
2736
2775
|
"button",
|
|
2737
2776
|
{
|
|
@@ -2741,29 +2780,29 @@ const Xf = $e.memo(function({ message: t }) {
|
|
|
2741
2780
|
"aria-label": "Add reaction",
|
|
2742
2781
|
title: "Add reaction",
|
|
2743
2782
|
"aria-expanded": !!S,
|
|
2744
|
-
children: /* @__PURE__ */ l(
|
|
2783
|
+
children: /* @__PURE__ */ l(pa, {})
|
|
2745
2784
|
}
|
|
2746
2785
|
),
|
|
2747
|
-
|
|
2786
|
+
/* @__PURE__ */ l("button", { type: "button", className: "chat-action-btn", onClick: () => M(t.id), "aria-label": "Reply", title: "Reply", children: /* @__PURE__ */ l(oi, {}) })
|
|
2748
2787
|
] }),
|
|
2749
|
-
S && /* @__PURE__ */ l(
|
|
2788
|
+
S && /* @__PURE__ */ l(ti, { anchor: S, onPick: d, onClose: () => {
|
|
2750
2789
|
N(null), I(!1);
|
|
2751
2790
|
} })
|
|
2752
2791
|
]
|
|
2753
2792
|
}
|
|
2754
2793
|
);
|
|
2755
2794
|
});
|
|
2756
|
-
function
|
|
2757
|
-
const t = u((i) => i.chat.find((s) => s.id === e)), n = u((i) => i.jumpToMessage), a =
|
|
2795
|
+
function ii({ replyTo: e }) {
|
|
2796
|
+
const t = u((i) => i.chat.find((s) => s.id === e)), n = u((i) => i.jumpToMessage), a = nt(
|
|
2758
2797
|
{ clientId: t?.clientId ?? "", author: t?.author },
|
|
2759
2798
|
{ name: t?.name ?? "", sprite: t?.sprite ?? null }
|
|
2760
|
-
), r =
|
|
2799
|
+
), r = Ce(a.sprite, a.pictureUrl);
|
|
2761
2800
|
if (!t)
|
|
2762
2801
|
return /* @__PURE__ */ y("div", { className: "chat-reply-quote", "data-testid": "chat-reply-quote", "data-missing": "true", children: [
|
|
2763
2802
|
/* @__PURE__ */ l("span", { className: "chat-reply-spine", "aria-hidden": "true" }),
|
|
2764
2803
|
/* @__PURE__ */ l("span", { className: "chat-reply-text italic", children: "Original message unavailable" })
|
|
2765
2804
|
] });
|
|
2766
|
-
const o = t.isSystem ? (t.template ?? t.text).split(
|
|
2805
|
+
const o = t.isSystem ? (t.template ?? t.text).split(wt).join(a.name) : t.text || (t.images?.length ? "Image" : "");
|
|
2767
2806
|
return /* @__PURE__ */ y(
|
|
2768
2807
|
"button",
|
|
2769
2808
|
{
|
|
@@ -2775,7 +2814,7 @@ function Qf({ replyTo: e }) {
|
|
|
2775
2814
|
children: [
|
|
2776
2815
|
/* @__PURE__ */ l("span", { className: "chat-reply-spine", "aria-hidden": "true" }),
|
|
2777
2816
|
/* @__PURE__ */ l(
|
|
2778
|
-
|
|
2817
|
+
Rt,
|
|
2779
2818
|
{
|
|
2780
2819
|
sprite: a.sprite,
|
|
2781
2820
|
url: a.pictureUrl,
|
|
@@ -2790,11 +2829,11 @@ function Qf({ replyTo: e }) {
|
|
|
2790
2829
|
}
|
|
2791
2830
|
);
|
|
2792
2831
|
}
|
|
2793
|
-
function
|
|
2832
|
+
function si({ reactions: e, me: t, onToggle: n, onAdd: a }) {
|
|
2794
2833
|
const r = u((o) => o.roster);
|
|
2795
2834
|
return /* @__PURE__ */ y("div", { className: "chat-reactions", "data-testid": "chat-reactions", children: [
|
|
2796
2835
|
e.map((o) => {
|
|
2797
|
-
const i =
|
|
2836
|
+
const i = ga(o, t);
|
|
2798
2837
|
return /* @__PURE__ */ y(
|
|
2799
2838
|
"button",
|
|
2800
2839
|
{
|
|
@@ -2803,7 +2842,7 @@ function Zf({ reactions: e, me: t, onToggle: n, onAdd: a }) {
|
|
|
2803
2842
|
"data-mine": i ? "true" : void 0,
|
|
2804
2843
|
"aria-pressed": i,
|
|
2805
2844
|
onClick: () => n(o.emoji),
|
|
2806
|
-
title:
|
|
2845
|
+
title: Jf(Yf(o, r, t), Ke(o.emoji)?.name),
|
|
2807
2846
|
"data-emoji": o.emoji,
|
|
2808
2847
|
children: [
|
|
2809
2848
|
/* @__PURE__ */ l("span", { className: "chat-reaction-emoji", children: o.emoji }),
|
|
@@ -2813,11 +2852,11 @@ function Zf({ reactions: e, me: t, onToggle: n, onAdd: a }) {
|
|
|
2813
2852
|
o.emoji
|
|
2814
2853
|
);
|
|
2815
2854
|
}),
|
|
2816
|
-
/* @__PURE__ */ l("button", { type: "button", className: "chat-reaction chat-reaction-add", onClick: (o) => a(o.currentTarget), "aria-label": "Add reaction", title: "Add reaction", children: /* @__PURE__ */ l(
|
|
2855
|
+
/* @__PURE__ */ l("button", { type: "button", className: "chat-reaction chat-reaction-add", onClick: (o) => a(o.currentTarget), "aria-label": "Add reaction", title: "Add reaction", children: /* @__PURE__ */ l(pa, {}) })
|
|
2817
2856
|
] });
|
|
2818
2857
|
}
|
|
2819
|
-
function
|
|
2820
|
-
|
|
2858
|
+
function li() {
|
|
2859
|
+
Fn();
|
|
2821
2860
|
const e = u((o) => o.chat), t = z(null), n = z(!1), a = D(() => {
|
|
2822
2861
|
const o = t.current;
|
|
2823
2862
|
if (!o) return;
|
|
@@ -2846,19 +2885,19 @@ function ei() {
|
|
|
2846
2885
|
className: "relative flex-1 overflow-y-auto overflow-x-hidden chat-messages pt-3",
|
|
2847
2886
|
children: e.length === 0 ? /* @__PURE__ */ l("div", { className: "p-4 text-xs text-text-muted text-center", children: "No messages yet. Be the first to say something!" }) : /* @__PURE__ */ l(ee, { children: e.map((o, i) => {
|
|
2848
2887
|
const s = i > 0 ? e[i - 1] : null, c = s && o.ts - s.ts > 1440 * 60 * 1e3;
|
|
2849
|
-
return /* @__PURE__ */ y(
|
|
2888
|
+
return /* @__PURE__ */ y(qe.Fragment, { children: [
|
|
2850
2889
|
c && /* @__PURE__ */ y("div", { className: "flex items-center gap-2 px-4 py-2 my-1", children: [
|
|
2851
2890
|
/* @__PURE__ */ l("div", { className: "flex-1 h-px bg-border" }),
|
|
2852
2891
|
/* @__PURE__ */ l("span", { className: "text-[10px] text-text-muted whitespace-nowrap", children: new Date(o.ts).toLocaleDateString([], { weekday: "short", month: "short", day: "numeric" }) }),
|
|
2853
2892
|
/* @__PURE__ */ l("div", { className: "flex-1 h-px bg-border" })
|
|
2854
2893
|
] }),
|
|
2855
|
-
/* @__PURE__ */ l(
|
|
2894
|
+
/* @__PURE__ */ l(fi, { message: o })
|
|
2856
2895
|
] }, o.id);
|
|
2857
2896
|
}) })
|
|
2858
2897
|
}
|
|
2859
2898
|
);
|
|
2860
2899
|
}
|
|
2861
|
-
const
|
|
2900
|
+
const Mt = [
|
|
2862
2901
|
{
|
|
2863
2902
|
name: "recap",
|
|
2864
2903
|
description: "Summarise the previous episode of what is loaded",
|
|
@@ -2879,12 +2918,12 @@ const Pt = [
|
|
|
2879
2918
|
scope: "local"
|
|
2880
2919
|
}
|
|
2881
2920
|
], ue = "/";
|
|
2882
|
-
function
|
|
2921
|
+
function ci(e) {
|
|
2883
2922
|
if (!e.startsWith(ue)) return null;
|
|
2884
2923
|
const t = e.slice(ue.length);
|
|
2885
2924
|
return /\s/.test(t) ? null : t.toLowerCase();
|
|
2886
2925
|
}
|
|
2887
|
-
function
|
|
2926
|
+
function di(e, t = Mt) {
|
|
2888
2927
|
const n = e.toLowerCase();
|
|
2889
2928
|
if (!n) return [...t].sort((r, o) => r.name.localeCompare(o.name));
|
|
2890
2929
|
const a = [];
|
|
@@ -2894,23 +2933,23 @@ function ni(e, t = Pt) {
|
|
|
2894
2933
|
}
|
|
2895
2934
|
return a.sort((r, o) => r.rank - o.rank || r.cmd.name.localeCompare(o.cmd.name)).map((r) => r.cmd);
|
|
2896
2935
|
}
|
|
2897
|
-
function
|
|
2936
|
+
function ui(e) {
|
|
2898
2937
|
return `${ue}${e.name} `;
|
|
2899
2938
|
}
|
|
2900
|
-
function
|
|
2939
|
+
function lt(e, t) {
|
|
2901
2940
|
return t <= 0 ? 0 : (e % t + t) % t;
|
|
2902
2941
|
}
|
|
2903
|
-
function
|
|
2942
|
+
function mi(e, t = Mt) {
|
|
2904
2943
|
const n = e.trim();
|
|
2905
2944
|
if (!n) return null;
|
|
2906
2945
|
if (!n.startsWith(ue)) return { kind: "chat", text: n };
|
|
2907
2946
|
const a = n.slice(ue.length), r = a.search(/\s/), o = (r === -1 ? a : a.slice(0, r)).toLowerCase(), i = r === -1 ? "" : a.slice(r).trim(), s = t.find((c) => c.name.toLowerCase() === o);
|
|
2908
2947
|
return s ? { kind: "command", command: s, args: i } : { kind: "chat", text: n };
|
|
2909
2948
|
}
|
|
2910
|
-
function
|
|
2949
|
+
function gi(e, t) {
|
|
2911
2950
|
return e.requiresMedia && !t.hasMedia ? `${ue}${e.name} needs an episode loaded.` : null;
|
|
2912
2951
|
}
|
|
2913
|
-
function
|
|
2952
|
+
function pi({
|
|
2914
2953
|
commands: e,
|
|
2915
2954
|
activeIndex: t,
|
|
2916
2955
|
hasMedia: n,
|
|
@@ -2952,7 +2991,7 @@ function fi({
|
|
|
2952
2991
|
}
|
|
2953
2992
|
);
|
|
2954
2993
|
}
|
|
2955
|
-
function
|
|
2994
|
+
function hi({
|
|
2956
2995
|
pending: e,
|
|
2957
2996
|
uploading: t,
|
|
2958
2997
|
onRemove: n
|
|
@@ -2979,29 +3018,29 @@ function ii({
|
|
|
2979
3018
|
)
|
|
2980
3019
|
] }, a.id)) }) : null;
|
|
2981
3020
|
}
|
|
2982
|
-
function
|
|
3021
|
+
function bi() {
|
|
2983
3022
|
const [e, t] = E([]), [n, a] = E(!1), r = u((h) => h.pushToast), o = z(/* @__PURE__ */ new Set());
|
|
2984
3023
|
A(() => () => {
|
|
2985
3024
|
for (const h of o.current) URL.revokeObjectURL(h);
|
|
2986
3025
|
o.current.clear();
|
|
2987
3026
|
}, []);
|
|
2988
3027
|
const i = D((h) => {
|
|
2989
|
-
|
|
3028
|
+
yr(h) && (URL.revokeObjectURL(h.previewUrl), o.current.delete(h.previewUrl));
|
|
2990
3029
|
}, []), s = D(async (h) => {
|
|
2991
3030
|
if (!h.length) return;
|
|
2992
3031
|
const d = [];
|
|
2993
3032
|
for (const m of h) {
|
|
2994
|
-
const w =
|
|
3033
|
+
const w = vr(m);
|
|
2995
3034
|
if (w) {
|
|
2996
3035
|
r("error", w);
|
|
2997
3036
|
continue;
|
|
2998
3037
|
}
|
|
2999
|
-
const { w: v, h: C } = await
|
|
3000
|
-
o.current.add(
|
|
3038
|
+
const { w: v, h: C } = await xr(m), H = URL.createObjectURL(m);
|
|
3039
|
+
o.current.add(H), d.push({
|
|
3001
3040
|
kind: "file",
|
|
3002
3041
|
id: `${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,
|
|
3003
3042
|
file: m,
|
|
3004
|
-
previewUrl:
|
|
3043
|
+
previewUrl: H,
|
|
3005
3044
|
w: v,
|
|
3006
3045
|
h: C
|
|
3007
3046
|
});
|
|
@@ -3020,7 +3059,7 @@ function si() {
|
|
|
3020
3059
|
return [...m, ...d.slice(0, w)];
|
|
3021
3060
|
});
|
|
3022
3061
|
}, [r, i]), c = D((h) => {
|
|
3023
|
-
const d =
|
|
3062
|
+
const d = ze(h.key);
|
|
3024
3063
|
d && (t((m) => m.length >= te ? (r("info", `Up to ${te} images per message`), m) : [...m, {
|
|
3025
3064
|
kind: "remote",
|
|
3026
3065
|
id: `${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,
|
|
@@ -3031,7 +3070,7 @@ function si() {
|
|
|
3031
3070
|
w: h.width ?? 0,
|
|
3032
3071
|
h: h.height ?? 0,
|
|
3033
3072
|
title: h.title || void 0
|
|
3034
|
-
}]),
|
|
3073
|
+
}]), Xe().catalogue(Dn).recordUse(h.key));
|
|
3035
3074
|
}, [r]), b = D((h) => {
|
|
3036
3075
|
t((d) => {
|
|
3037
3076
|
const m = d.find((w) => w.id === h);
|
|
@@ -3043,10 +3082,10 @@ function si() {
|
|
|
3043
3082
|
return [];
|
|
3044
3083
|
});
|
|
3045
3084
|
}, [i]), I = D((h) => {
|
|
3046
|
-
const d =
|
|
3085
|
+
const d = kr(h.clipboardData);
|
|
3047
3086
|
d.length && (h.preventDefault(), s(d));
|
|
3048
3087
|
}, [s]), S = D((h) => {
|
|
3049
|
-
const d =
|
|
3088
|
+
const d = _r(h.dataTransfer);
|
|
3050
3089
|
d.length && (h.preventDefault(), s(d));
|
|
3051
3090
|
}, [s]), N = D((h) => {
|
|
3052
3091
|
h.dataTransfer?.types?.includes("Files") && h.preventDefault();
|
|
@@ -3054,9 +3093,9 @@ function si() {
|
|
|
3054
3093
|
if (!e.length) return [];
|
|
3055
3094
|
a(!0);
|
|
3056
3095
|
try {
|
|
3057
|
-
return await
|
|
3096
|
+
return await Tr(e);
|
|
3058
3097
|
} catch (h) {
|
|
3059
|
-
return
|
|
3098
|
+
return P("chat", "Image upload failed", Cr(h)), r("error", wr(h)), null;
|
|
3060
3099
|
} finally {
|
|
3061
3100
|
a(!1);
|
|
3062
3101
|
}
|
|
@@ -3074,8 +3113,8 @@ function si() {
|
|
|
3074
3113
|
onDragOver: N
|
|
3075
3114
|
};
|
|
3076
3115
|
}
|
|
3077
|
-
const
|
|
3078
|
-
class
|
|
3116
|
+
const yi = 2500, wi = 5e3;
|
|
3117
|
+
class vi {
|
|
3079
3118
|
constructor(t, n = Date.now) {
|
|
3080
3119
|
this.send = t, this.now = n;
|
|
3081
3120
|
}
|
|
@@ -3090,33 +3129,33 @@ class di {
|
|
|
3090
3129
|
return;
|
|
3091
3130
|
}
|
|
3092
3131
|
const n = this.now();
|
|
3093
|
-
(!this.typing || n - this.lastSent >=
|
|
3132
|
+
(!this.typing || n - this.lastSent >= yi) && (this.typing = !0, this.lastSent = n, this.send(!0)), this.idle && clearTimeout(this.idle), this.idle = setTimeout(() => this.stop(), wi);
|
|
3094
3133
|
}
|
|
3095
3134
|
stop() {
|
|
3096
3135
|
this.idle && (clearTimeout(this.idle), this.idle = null), this.typing && (this.typing = !1, this.send(!1));
|
|
3097
3136
|
}
|
|
3098
3137
|
}
|
|
3099
|
-
function
|
|
3100
|
-
const [e] = E(() => new
|
|
3138
|
+
function ki() {
|
|
3139
|
+
const [e] = E(() => new vi(Cf));
|
|
3101
3140
|
return A(() => () => e.stop(), [e]), e;
|
|
3102
3141
|
}
|
|
3103
|
-
function
|
|
3142
|
+
function _i(e) {
|
|
3104
3143
|
return e.length === 0 ? null : e.length === 1 ? `${e[0]} is typing…` : e.length === 2 ? `${e[0]} and ${e[1]} are typing…` : e.length === 3 ? `${e[0]}, ${e[1]} and ${e[2]} are typing…` : "Several people are typing…";
|
|
3105
3144
|
}
|
|
3106
|
-
function
|
|
3107
|
-
const n = u((o) => o.chat.find((i) => i.id === e)), a =
|
|
3145
|
+
function xi({ replyTo: e, onCancel: t }) {
|
|
3146
|
+
const n = u((o) => o.chat.find((i) => i.id === e)), a = nt(
|
|
3108
3147
|
{ clientId: n?.clientId ?? "", author: n?.author },
|
|
3109
3148
|
{ name: n?.name ?? "a message", sprite: n?.sprite ?? null }
|
|
3110
|
-
), r =
|
|
3149
|
+
), r = Ce(a.sprite, a.pictureUrl);
|
|
3111
3150
|
return /* @__PURE__ */ y("div", { className: "chat-reply-bar", "data-testid": "chat-reply-bar", children: [
|
|
3112
3151
|
/* @__PURE__ */ y("span", { className: "min-w-0 truncate", children: [
|
|
3113
3152
|
"Replying to ",
|
|
3114
3153
|
/* @__PURE__ */ l("span", { className: "font-semibold", style: { color: r }, children: a.name })
|
|
3115
3154
|
] }),
|
|
3116
|
-
/* @__PURE__ */ l("button", { type: "button", className: "chat-reply-cancel", onClick: t, "aria-label": "Cancel reply", title: "Cancel reply", children: /* @__PURE__ */ l(
|
|
3155
|
+
/* @__PURE__ */ l("button", { type: "button", className: "chat-reply-cancel", onClick: t, "aria-label": "Cancel reply", title: "Cancel reply", children: /* @__PURE__ */ l(ri, { className: "w-3.5 h-3.5" }) })
|
|
3117
3156
|
] });
|
|
3118
3157
|
}
|
|
3119
|
-
function
|
|
3158
|
+
function Si() {
|
|
3120
3159
|
const e = u((i) => i.typing), t = u((i) => i.roster), n = u((i) => i.me.clientId), a = u((i) => i.setTyping);
|
|
3121
3160
|
A(() => {
|
|
3122
3161
|
const i = Object.keys(e);
|
|
@@ -3127,7 +3166,7 @@ function pi() {
|
|
|
3127
3166
|
}, Math.max(0, s - Date.now()) + 50);
|
|
3128
3167
|
return () => clearTimeout(c);
|
|
3129
3168
|
}, [e, a]);
|
|
3130
|
-
const r = Object.keys(e).filter((i) => i !== n && t[i]).map((i) => t[i].name || "Someone").sort((i, s) => i.localeCompare(s)), o =
|
|
3169
|
+
const r = Object.keys(e).filter((i) => i !== n && t[i]).map((i) => t[i].name || "Someone").sort((i, s) => i.localeCompare(s)), o = _i(r);
|
|
3131
3170
|
return /* @__PURE__ */ l("div", { className: "chat-typing", "aria-live": "polite", "data-testid": "chat-typing", children: o && /* @__PURE__ */ y(ee, { children: [
|
|
3132
3171
|
/* @__PURE__ */ y("span", { className: "chat-typing-dots", "aria-hidden": "true", children: [
|
|
3133
3172
|
/* @__PURE__ */ l("i", {}),
|
|
@@ -3137,42 +3176,42 @@ function pi() {
|
|
|
3137
3176
|
/* @__PURE__ */ l("span", { className: "truncate", children: o })
|
|
3138
3177
|
] }) });
|
|
3139
3178
|
}
|
|
3140
|
-
const
|
|
3141
|
-
function
|
|
3142
|
-
const [t, n] = E(""), [a, r] = E(!1), [o, i] = E({ q: null, i: 0 }), [s, c] = E(!1), b = z(null), p =
|
|
3179
|
+
const on = _n, Ti = Va;
|
|
3180
|
+
function Ci({ commands: e = Mt }) {
|
|
3181
|
+
const [t, n] = E(""), [a, r] = E(!1), [o, i] = E({ q: null, i: 0 }), [s, c] = E(!1), b = z(null), p = ya(), [I, S] = E(!1), [N, M] = E(!1), h = bi(), d = ki(), m = u((k) => k.replyingTo), w = u((k) => k.setReplyingTo);
|
|
3143
3182
|
A(() => {
|
|
3144
3183
|
m && !document.hidden && b.current?.focus({ preventScroll: !0 });
|
|
3145
3184
|
}, [m]);
|
|
3146
|
-
const v = u((k) => k.snapshot.mediaId), C = u((k) => k.pushToast),
|
|
3147
|
-
() => O === null ? [] :
|
|
3185
|
+
const v = u((k) => k.snapshot.mediaId), C = u((k) => k.pushToast), H = u((k) => k.setTierlistOpen), F = !!v, O = ci(t), L = G(
|
|
3186
|
+
() => O === null ? [] : di(O, e),
|
|
3148
3187
|
[O, e]
|
|
3149
|
-
), T = O !== null && !s && L.length > 0,
|
|
3188
|
+
), T = O !== null && !s && L.length > 0, R = o.q === O ? lt(o.i, L.length) : 0, j = D(
|
|
3150
3189
|
(k) => i({ q: O, i: k }),
|
|
3151
3190
|
[O]
|
|
3152
3191
|
), $ = D((k, q) => {
|
|
3153
|
-
const me =
|
|
3192
|
+
const me = gi(k, { hasMedia: F });
|
|
3154
3193
|
if (me) {
|
|
3155
3194
|
C("info", me);
|
|
3156
3195
|
return;
|
|
3157
3196
|
}
|
|
3158
3197
|
switch (k.name) {
|
|
3159
3198
|
case "help":
|
|
3160
|
-
C("info", e.map((
|
|
3199
|
+
C("info", e.map((ba) => ba.usage).join(" "));
|
|
3161
3200
|
break;
|
|
3162
3201
|
case "recap":
|
|
3163
|
-
|
|
3202
|
+
jf();
|
|
3164
3203
|
break;
|
|
3165
3204
|
case "tierlist":
|
|
3166
|
-
|
|
3205
|
+
Ho(), H(!0);
|
|
3167
3206
|
break;
|
|
3168
3207
|
default:
|
|
3169
3208
|
C("info", `${k.usage} is not implemented yet.`);
|
|
3170
3209
|
}
|
|
3171
|
-
}, [F, C, e,
|
|
3172
|
-
n(
|
|
3210
|
+
}, [F, C, e, H]), U = D((k) => {
|
|
3211
|
+
n(ui(k)), c(!1), b.current?.focus();
|
|
3173
3212
|
}, []), le = D(async (k) => {
|
|
3174
3213
|
if (k.preventDefault(), a || h.uploading) return;
|
|
3175
|
-
const q =
|
|
3214
|
+
const q = mi(t, e);
|
|
3176
3215
|
if (!q && !h.pending.length) return;
|
|
3177
3216
|
if (q?.kind === "command" && h.pending.length) {
|
|
3178
3217
|
C("info", "Send images on their own, not with a command.");
|
|
@@ -3183,7 +3222,7 @@ function bi({ commands: e = Pt }) {
|
|
|
3183
3222
|
return;
|
|
3184
3223
|
}
|
|
3185
3224
|
const me = await h.uploadPending();
|
|
3186
|
-
me !== null && (
|
|
3225
|
+
me !== null && (Sf(q?.text ?? "", me, m), n(""), d.stop(), w(null), h.clear(), r(!0), setTimeout(() => r(!1), Ti), !document.hidden && document.hasFocus() && b.current?.focus());
|
|
3187
3226
|
}, [t, a, $, h, C, e, m, w, d]), oe = D((k) => {
|
|
3188
3227
|
if (k.key === "Escape" && T) {
|
|
3189
3228
|
k.preventDefault(), c(!0);
|
|
@@ -3195,27 +3234,27 @@ function bi({ commands: e = Pt }) {
|
|
|
3195
3234
|
}
|
|
3196
3235
|
if (T) {
|
|
3197
3236
|
if (k.key === "ArrowDown")
|
|
3198
|
-
k.preventDefault(),
|
|
3237
|
+
k.preventDefault(), j(lt(R + 1, L.length));
|
|
3199
3238
|
else if (k.key === "ArrowUp")
|
|
3200
|
-
k.preventDefault(),
|
|
3239
|
+
k.preventDefault(), j(lt(R - 1, L.length));
|
|
3201
3240
|
else if (k.key === "Tab") {
|
|
3202
3241
|
k.preventDefault();
|
|
3203
|
-
const q = L[
|
|
3204
|
-
q &&
|
|
3242
|
+
const q = L[R];
|
|
3243
|
+
q && U(q);
|
|
3205
3244
|
} else if (k.key === "Enter") {
|
|
3206
3245
|
k.preventDefault();
|
|
3207
|
-
const q = L[
|
|
3208
|
-
q &&
|
|
3246
|
+
const q = L[R];
|
|
3247
|
+
q && U(q);
|
|
3209
3248
|
}
|
|
3210
3249
|
}
|
|
3211
|
-
}, [T, L,
|
|
3250
|
+
}, [T, L, R, U, j, m, w]);
|
|
3212
3251
|
A(() => {
|
|
3213
3252
|
const k = () => {
|
|
3214
3253
|
document.hidden || !document.hasFocus() || (b.current?.focus(), b.current?.scrollIntoView({ block: "nearest" }));
|
|
3215
3254
|
};
|
|
3216
3255
|
return window.addEventListener("watchparty:focus-chat-input", k), () => window.removeEventListener("watchparty:focus-chat-input", k);
|
|
3217
3256
|
}, []);
|
|
3218
|
-
const
|
|
3257
|
+
const Ie = on - t.length, Dt = Ie <= 100, Lt = T ? L[R] : void 0;
|
|
3219
3258
|
return /* @__PURE__ */ y(
|
|
3220
3259
|
"form",
|
|
3221
3260
|
{
|
|
@@ -3227,22 +3266,22 @@ function bi({ commands: e = Pt }) {
|
|
|
3227
3266
|
onDragOver: h.onDragOver,
|
|
3228
3267
|
className: "p-2 border-t border-border",
|
|
3229
3268
|
children: [
|
|
3230
|
-
m && /* @__PURE__ */ l(
|
|
3231
|
-
/* @__PURE__ */ l(
|
|
3269
|
+
m && /* @__PURE__ */ l(xi, { replyTo: m, onCancel: () => w(null) }),
|
|
3270
|
+
/* @__PURE__ */ l(hi, { pending: h.pending, uploading: h.uploading, onRemove: h.remove }),
|
|
3232
3271
|
/* @__PURE__ */ y("div", { className: "relative", children: [
|
|
3233
3272
|
T && /* @__PURE__ */ l(
|
|
3234
|
-
|
|
3273
|
+
pi,
|
|
3235
3274
|
{
|
|
3236
3275
|
commands: L,
|
|
3237
|
-
activeIndex:
|
|
3276
|
+
activeIndex: R,
|
|
3238
3277
|
hasMedia: F,
|
|
3239
|
-
onPick:
|
|
3240
|
-
onHover:
|
|
3278
|
+
onPick: U,
|
|
3279
|
+
onHover: j,
|
|
3241
3280
|
listboxId: p
|
|
3242
3281
|
}
|
|
3243
3282
|
),
|
|
3244
3283
|
/* @__PURE__ */ l(
|
|
3245
|
-
|
|
3284
|
+
Pr,
|
|
3246
3285
|
{
|
|
3247
3286
|
open: I,
|
|
3248
3287
|
onClose: () => S(!1),
|
|
@@ -3264,17 +3303,17 @@ function bi({ commands: e = Pt }) {
|
|
|
3264
3303
|
n(k.target.value), c(!1), k.target.value.startsWith("/") ? d.stop() : d.input(k.target.value);
|
|
3265
3304
|
},
|
|
3266
3305
|
onKeyDown: oe,
|
|
3267
|
-
maxLength:
|
|
3306
|
+
maxLength: on,
|
|
3268
3307
|
placeholder: "Send a message",
|
|
3269
3308
|
role: "combobox",
|
|
3270
3309
|
"aria-expanded": T,
|
|
3271
3310
|
"aria-controls": T ? p : void 0,
|
|
3272
|
-
"aria-activedescendant":
|
|
3311
|
+
"aria-activedescendant": Lt ? `${p}-opt-${Lt.name}` : void 0,
|
|
3273
3312
|
"aria-autocomplete": "list",
|
|
3274
|
-
className: `w-full bg-bg-card border border-border-light rounded px-3 py-1.5 text-sm focus:outline-none focus:border-text-muted ${
|
|
3313
|
+
className: `w-full bg-bg-card border border-border-light rounded px-3 py-1.5 text-sm focus:outline-none focus:border-text-muted ${Dt ? "pr-12" : ""}`
|
|
3275
3314
|
}
|
|
3276
3315
|
),
|
|
3277
|
-
/* @__PURE__ */ l("span", { className: `absolute right-2 top-1/2 -translate-y-1/2 text-[10px] ${
|
|
3316
|
+
/* @__PURE__ */ l("span", { className: `absolute right-2 top-1/2 -translate-y-1/2 text-[10px] ${Ie <= 50 ? Ie <= 0 ? "bg-danger-bg text-on-danger-bg px-1 rounded" : "bg-primary-bg text-on-primary-bg px-1 rounded" : "text-text-muted"}`, children: Dt && Ie })
|
|
3278
3317
|
] }),
|
|
3279
3318
|
!N && /* @__PURE__ */ l(
|
|
3280
3319
|
"button",
|
|
@@ -3286,25 +3325,25 @@ function bi({ commands: e = Pt }) {
|
|
|
3286
3325
|
title: "Add a meme",
|
|
3287
3326
|
"data-testid": "meme-button",
|
|
3288
3327
|
className: `shrink-0 rounded border border-border-light px-2 py-1.5 text-sm hover:border-primary ${I ? "text-text border-primary" : "text-text-secondary"}`,
|
|
3289
|
-
children: /* @__PURE__ */ l(
|
|
3328
|
+
children: /* @__PURE__ */ l(wa, { name: "image" })
|
|
3290
3329
|
}
|
|
3291
3330
|
)
|
|
3292
3331
|
] })
|
|
3293
3332
|
] }),
|
|
3294
|
-
/* @__PURE__ */ l(
|
|
3333
|
+
/* @__PURE__ */ l(Si, {})
|
|
3295
3334
|
]
|
|
3296
3335
|
}
|
|
3297
3336
|
);
|
|
3298
3337
|
}
|
|
3299
|
-
function
|
|
3338
|
+
function Ii() {
|
|
3300
3339
|
const e = u((n) => n.roster), t = Object.values(e);
|
|
3301
|
-
return t.length ? /* @__PURE__ */ l("div", { className: "flex flex-col gap-1", children: t.map((n) => /* @__PURE__ */ l(
|
|
3340
|
+
return t.length ? /* @__PURE__ */ l("div", { className: "flex flex-col gap-1", children: t.map((n) => /* @__PURE__ */ l(Ei, { u: n }, n.clientId)) }) : /* @__PURE__ */ l("div", { className: "text-xs text-text-muted", children: "No users online" });
|
|
3302
3341
|
}
|
|
3303
|
-
function
|
|
3304
|
-
const t =
|
|
3342
|
+
function Ei({ u: e }) {
|
|
3343
|
+
const t = Ce(e.sprite, e.avatarUrl);
|
|
3305
3344
|
return /* @__PURE__ */ y("div", { className: "flex items-center gap-2 py-0.5", children: [
|
|
3306
3345
|
/* @__PURE__ */ l(
|
|
3307
|
-
|
|
3346
|
+
Rt,
|
|
3308
3347
|
{
|
|
3309
3348
|
sprite: e.sprite,
|
|
3310
3349
|
url: e.avatarUrl,
|
|
@@ -3317,7 +3356,7 @@ function wi({ u: e }) {
|
|
|
3317
3356
|
e.isLeader && /* @__PURE__ */ l("span", { className: "ml-auto px-1.5 py-0.5 rounded text-[9px] font-medium bg-success/20 text-success", children: "Leader" })
|
|
3318
3357
|
] });
|
|
3319
3358
|
}
|
|
3320
|
-
function
|
|
3359
|
+
function Ai() {
|
|
3321
3360
|
const e = u((o) => Object.keys(o.roster).length), [t, n] = E(!1), a = z(null), r = z(null);
|
|
3322
3361
|
return A(() => {
|
|
3323
3362
|
if (!t) return;
|
|
@@ -3325,7 +3364,7 @@ function vi() {
|
|
|
3325
3364
|
a.current && !a.current.contains(s.target) && n(!1);
|
|
3326
3365
|
}
|
|
3327
3366
|
function i(s) {
|
|
3328
|
-
|
|
3367
|
+
Qe(s) && (s.stopPropagation(), n(!1), r.current?.focus());
|
|
3329
3368
|
}
|
|
3330
3369
|
return document.addEventListener("mousedown", o), document.addEventListener("keydown", i, !0), () => {
|
|
3331
3370
|
document.removeEventListener("mousedown", o), document.removeEventListener("keydown", i, !0);
|
|
@@ -3353,11 +3392,11 @@ function vi() {
|
|
|
3353
3392
|
e,
|
|
3354
3393
|
" online"
|
|
3355
3394
|
] }),
|
|
3356
|
-
/* @__PURE__ */ l(
|
|
3395
|
+
/* @__PURE__ */ l(Ii, {})
|
|
3357
3396
|
] })
|
|
3358
3397
|
] });
|
|
3359
3398
|
}
|
|
3360
|
-
function
|
|
3399
|
+
function fn({ className: e = "fixed bottom-4 left-1/2 -translate-x-1/2" }) {
|
|
3361
3400
|
const t = u((a) => a.toasts), n = u((a) => a.popToast);
|
|
3362
3401
|
return A(() => {
|
|
3363
3402
|
const a = t.map((r) => setTimeout(() => n(r.id), 4e3));
|
|
@@ -3366,43 +3405,43 @@ function rn({ className: e = "fixed bottom-4 left-1/2 -translate-x-1/2" }) {
|
|
|
3366
3405
|
};
|
|
3367
3406
|
}, [t, n]), /* @__PURE__ */ l("div", { className: `${e} flex flex-col gap-2 z-50`, children: t.map((a) => /* @__PURE__ */ l("div", { className: `px-3 py-2 rounded text-sm shadow font-medium border ${a.kind === "error" ? "bg-danger-bg text-on-danger-bg border-danger" : "bg-bg-card border-border-light text-text"}`, children: a.msg }, a.id)) });
|
|
3368
3407
|
}
|
|
3369
|
-
const
|
|
3408
|
+
const ha = 9e3, sn = 1500, Ni = {
|
|
3370
3409
|
classic: "[text-shadow:_-1px_-1px_0_#000,_1px_-1px_0_#000,_-1px_1px_0_#000,_1px_1px_0_#000,_0_-1px_0_#000,_0_1px_0_#000,_-1px_0_0_#000,_1px_0_0_#000]",
|
|
3371
3410
|
cinema: "drop-shadow-[0_2px_4px_rgba(0,0,0,0.9)]",
|
|
3372
3411
|
minimal: "drop-shadow-[0_2px_4px_rgba(0,0,0,0.9)] drop-shadow-[0_0_8px_rgba(0,0,0,0.7)]",
|
|
3373
3412
|
contrast: "bg-black/70 px-2 py-0.5 rounded"
|
|
3374
|
-
},
|
|
3413
|
+
}, ln = { WebkitTextStroke: "0.5px black", paintOrder: "stroke fill" }, cn = {
|
|
3375
3414
|
textShadow: "none",
|
|
3376
3415
|
filter: "drop-shadow(0 0 1px black) drop-shadow(0 0 1px black)"
|
|
3377
3416
|
};
|
|
3378
|
-
function
|
|
3379
|
-
const a =
|
|
3417
|
+
function Ri({ message: e, age: t, ccStyle: n }) {
|
|
3418
|
+
const a = ha - sn;
|
|
3380
3419
|
let r = 1;
|
|
3381
|
-
t > a && (r = Math.max(0, 1 - (t - a) /
|
|
3382
|
-
const o =
|
|
3420
|
+
t > a && (r = Math.max(0, 1 - (t - a) / sn));
|
|
3421
|
+
const o = Ni[n], i = nt(
|
|
3383
3422
|
{ clientId: e.clientId, author: e.author },
|
|
3384
3423
|
{ name: e.name, sprite: e.sprite }
|
|
3385
|
-
), s =
|
|
3386
|
-
() => e.live && e.text ?
|
|
3424
|
+
), s = Ce(i.sprite, i.pictureUrl), c = i.cosmetics, [b] = E(
|
|
3425
|
+
() => e.live && e.text ? pn(e.text, c) : null
|
|
3387
3426
|
);
|
|
3388
3427
|
return /* @__PURE__ */ y(
|
|
3389
3428
|
"div",
|
|
3390
3429
|
{
|
|
3391
3430
|
className: `flex items-start gap-2 py-1 ${o}`,
|
|
3392
|
-
style: { opacity: r, transition: "opacity 0.15s ease-out",
|
|
3431
|
+
style: { opacity: r, transition: "opacity 0.15s ease-out", ...$n(s) },
|
|
3393
3432
|
children: [
|
|
3394
|
-
/* @__PURE__ */ l(
|
|
3433
|
+
/* @__PURE__ */ l(da, { sprite: i.sprite, url: i.pictureUrl, worn: c }),
|
|
3395
3434
|
/* @__PURE__ */ y("div", { className: "min-w-0 flex-1", children: [
|
|
3396
|
-
c ? /* @__PURE__ */ l(ye, { html:
|
|
3397
|
-
b ? /* @__PURE__ */ l(ye, { html: b, className: "text-sm text-white break-words", style:
|
|
3398
|
-
/* @__PURE__ */ l(
|
|
3435
|
+
c ? /* @__PURE__ */ l(ye, { html: hn(i.name, c), className: "text-sm mr-2", style: { color: s, ...cn } }) : /* @__PURE__ */ l("span", { className: "font-medium text-sm mr-2", style: { color: s, ...ln }, children: i.name }),
|
|
3436
|
+
b ? /* @__PURE__ */ l(ye, { html: b, className: "text-sm text-white break-words", style: cn }) : /* @__PURE__ */ l("span", { className: "text-sm text-white break-words", style: ln, children: e.text }),
|
|
3437
|
+
/* @__PURE__ */ l(ua, { images: e.images })
|
|
3399
3438
|
] })
|
|
3400
3439
|
]
|
|
3401
3440
|
}
|
|
3402
3441
|
);
|
|
3403
3442
|
}
|
|
3404
|
-
function
|
|
3405
|
-
|
|
3443
|
+
function ji({ shown: e, className: t }) {
|
|
3444
|
+
Fn();
|
|
3406
3445
|
const n = u((c) => c.chat), a = u((c) => c.mediaPrefs.subtitleStyle), [r, o] = E(() => Date.now()), i = n.length > 0;
|
|
3407
3446
|
A(() => {
|
|
3408
3447
|
const c = setInterval(() => {
|
|
@@ -3411,7 +3450,7 @@ function xi({ shown: e, className: t }) {
|
|
|
3411
3450
|
return () => clearInterval(c);
|
|
3412
3451
|
}, [i]);
|
|
3413
3452
|
const s = G(() => {
|
|
3414
|
-
const c = r -
|
|
3453
|
+
const c = r - ha;
|
|
3415
3454
|
return n.filter((b) => !b.isSystem && b.ts > c).slice(-12);
|
|
3416
3455
|
}, [n, r]);
|
|
3417
3456
|
return !e || s.length === 0 ? null : /* @__PURE__ */ l(
|
|
@@ -3420,7 +3459,7 @@ function xi({ shown: e, className: t }) {
|
|
|
3420
3459
|
className: `wp-floating-chat pointer-events-none flex flex-col ${t}`,
|
|
3421
3460
|
"data-testid": "floating-chat",
|
|
3422
3461
|
children: s.map((c) => /* @__PURE__ */ l(
|
|
3423
|
-
|
|
3462
|
+
Ri,
|
|
3424
3463
|
{
|
|
3425
3464
|
message: c,
|
|
3426
3465
|
age: r - c.ts,
|
|
@@ -3431,27 +3470,27 @@ function xi({ shown: e, className: t }) {
|
|
|
3431
3470
|
}
|
|
3432
3471
|
);
|
|
3433
3472
|
}
|
|
3434
|
-
const
|
|
3435
|
-
function
|
|
3436
|
-
return e || (
|
|
3473
|
+
const dn = (e) => typeof e == "string" && va.includes(e);
|
|
3474
|
+
function Pi(e, t, n) {
|
|
3475
|
+
return e || (dn(t) ? t : dn(n) ? n : "dark");
|
|
3437
3476
|
}
|
|
3438
|
-
function
|
|
3477
|
+
function Mi(e, t) {
|
|
3439
3478
|
if (t(e.clientWidth), typeof ResizeObserver > "u") return () => {
|
|
3440
3479
|
};
|
|
3441
3480
|
const n = new ResizeObserver(() => t(e.clientWidth));
|
|
3442
3481
|
return n.observe(e), () => n.disconnect();
|
|
3443
3482
|
}
|
|
3444
|
-
function
|
|
3483
|
+
function Di(e) {
|
|
3445
3484
|
const t = e?.trim() ?? "";
|
|
3446
3485
|
return t ? { source: "host", name: t } : { source: "auto" };
|
|
3447
3486
|
}
|
|
3448
|
-
function
|
|
3487
|
+
function Li(e) {
|
|
3449
3488
|
if (e.source !== "host") return;
|
|
3450
3489
|
const { setSessionIdentity: t, sprite: n } = u.getState();
|
|
3451
3490
|
t(e.name, n);
|
|
3452
3491
|
}
|
|
3453
|
-
const
|
|
3454
|
-
function
|
|
3492
|
+
const Oi = 1500;
|
|
3493
|
+
function Zi({
|
|
3455
3494
|
roomKey: e,
|
|
3456
3495
|
serverOrigin: t,
|
|
3457
3496
|
roomOrigin: n,
|
|
@@ -3468,47 +3507,47 @@ function Bi({
|
|
|
3468
3507
|
debug: N,
|
|
3469
3508
|
children: M
|
|
3470
3509
|
}) {
|
|
3471
|
-
const [h, d] = E(null), { setFrame: m, ...w } =
|
|
3472
|
-
() =>
|
|
3473
|
-
[c, O,
|
|
3510
|
+
const [h, d] = E(null), { setFrame: m, ...w } = Hi(I, S), v = u((j) => j.floatingChatEnabled), C = gn(() => b), H = G(() => (io({ userType: i, userId: s ?? null }), Ct().theme), [i, s]), F = ka(), O = F?.theme, L = G(
|
|
3511
|
+
() => Pi(c, O, H),
|
|
3512
|
+
[c, O, H]
|
|
3474
3513
|
);
|
|
3475
3514
|
A(() => {
|
|
3476
3515
|
}, [c, F !== null]);
|
|
3477
|
-
const
|
|
3478
|
-
() => ({ ...
|
|
3516
|
+
const R = G(
|
|
3517
|
+
() => ({ ..._t, serverOrigin: t, defaultRoomKey: e }),
|
|
3479
3518
|
[t, e]
|
|
3480
3519
|
);
|
|
3481
3520
|
return A(() => {
|
|
3482
|
-
N &&
|
|
3483
|
-
}, [N]),
|
|
3484
|
-
|
|
3485
|
-
let
|
|
3486
|
-
const $ =
|
|
3521
|
+
N && Fr();
|
|
3522
|
+
}, [N]), Pf(), A(() => {
|
|
3523
|
+
Mr({ serverOrigin: t, defaultRoomKey: e }), jo(n ? { origin: n, path: a } : null), Xt(r && !n ? { origin: r, path: o } : null), u.getState().rehydrateFromPrefs(), tf();
|
|
3524
|
+
let j = !1;
|
|
3525
|
+
const $ = co();
|
|
3487
3526
|
return (async () => {
|
|
3488
3527
|
try {
|
|
3489
3528
|
await Promise.race([
|
|
3490
3529
|
Promise.all([
|
|
3491
3530
|
$,
|
|
3492
|
-
|
|
3531
|
+
bo().then((oe) => {
|
|
3493
3532
|
oe && u.getState().rehydrateFromPrefs();
|
|
3494
3533
|
}),
|
|
3495
3534
|
// The character chosen in the settings popout (lib/avatar.ts).
|
|
3496
|
-
|
|
3535
|
+
zo().then(ca)
|
|
3497
3536
|
]),
|
|
3498
|
-
new Promise((oe) => setTimeout(oe,
|
|
3537
|
+
new Promise((oe) => setTimeout(oe, Oi))
|
|
3499
3538
|
]);
|
|
3500
3539
|
} catch (oe) {
|
|
3501
|
-
|
|
3540
|
+
P("room-chrome", "pre-join wait threw, proceeding anyway", Se(oe));
|
|
3502
3541
|
}
|
|
3503
|
-
if (
|
|
3504
|
-
const
|
|
3505
|
-
u.getState().ensureAutoIdentity(),
|
|
3542
|
+
if (j) return;
|
|
3543
|
+
const U = Di(C());
|
|
3544
|
+
u.getState().ensureAutoIdentity(), Li(U);
|
|
3506
3545
|
const le = u.getState();
|
|
3507
|
-
g("room-chrome", "Joining room", { roomKey: e, name: le.name, sprite: le.sprite }),
|
|
3546
|
+
g("room-chrome", "Joining room", { roomKey: e, name: le.name, sprite: le.sprite }), uf({ room_key: e, name: le.name || void 0, sprite: le.sprite || void 0 });
|
|
3508
3547
|
})(), () => {
|
|
3509
|
-
|
|
3548
|
+
j = !0, an(), Xt(null);
|
|
3510
3549
|
};
|
|
3511
|
-
}, [e, t, n, a, r, o, i, s]), /* @__PURE__ */ l(
|
|
3550
|
+
}, [e, t, n, a, r, o, i, s]), /* @__PURE__ */ l(Dr.Provider, { value: R, children: /* @__PURE__ */ l(Un.Provider, { value: !1, children: /* @__PURE__ */ l(On.Provider, { value: h, children: /* @__PURE__ */ y("div", { ref: m, className: "wp-room-chrome-frame", children: [
|
|
3512
3551
|
/* @__PURE__ */ l("div", { className: "wp-room-chrome-frame__content", children: M }),
|
|
3513
3552
|
/* @__PURE__ */ l(
|
|
3514
3553
|
"aside",
|
|
@@ -3518,7 +3557,7 @@ function Bi({
|
|
|
3518
3557
|
"data-theme": L,
|
|
3519
3558
|
"data-collapsed": w.collapsed ? "1" : "0",
|
|
3520
3559
|
style: { "--wp-room-chrome-width": `${w.state.width}px` },
|
|
3521
|
-
onAnimationEnd: (
|
|
3560
|
+
onAnimationEnd: (j) => Ma(j.nativeEvent),
|
|
3522
3561
|
children: w.collapsed ? /* @__PURE__ */ y(ee, { children: [
|
|
3523
3562
|
/* @__PURE__ */ l(
|
|
3524
3563
|
"button",
|
|
@@ -3528,11 +3567,11 @@ function Bi({
|
|
|
3528
3567
|
title: "Show chat",
|
|
3529
3568
|
"aria-label": "Show chat",
|
|
3530
3569
|
"aria-expanded": !1,
|
|
3531
|
-
children: /* @__PURE__ */ l(
|
|
3570
|
+
children: /* @__PURE__ */ l(ai, {})
|
|
3532
3571
|
}
|
|
3533
3572
|
),
|
|
3534
|
-
/* @__PURE__ */ l(
|
|
3535
|
-
/* @__PURE__ */ l(
|
|
3573
|
+
/* @__PURE__ */ l(fn, { className: "absolute bottom-2 right-full mr-2 w-72" }),
|
|
3574
|
+
/* @__PURE__ */ l(ji, { shown: v, className: "wp-room-chrome__floating" })
|
|
3536
3575
|
] }) : /* @__PURE__ */ y(ee, { children: [
|
|
3537
3576
|
/* @__PURE__ */ l(
|
|
3538
3577
|
"div",
|
|
@@ -3540,8 +3579,8 @@ function Bi({
|
|
|
3540
3579
|
role: "separator",
|
|
3541
3580
|
"aria-orientation": "vertical",
|
|
3542
3581
|
"aria-label": "Resize chat",
|
|
3543
|
-
"aria-valuemin":
|
|
3544
|
-
"aria-valuemax":
|
|
3582
|
+
"aria-valuemin": Ve,
|
|
3583
|
+
"aria-valuemax": It,
|
|
3545
3584
|
"aria-valuenow": w.state.width,
|
|
3546
3585
|
tabIndex: 0,
|
|
3547
3586
|
className: "wp-room-chrome__resize",
|
|
@@ -3554,13 +3593,13 @@ function Bi({
|
|
|
3554
3593
|
}
|
|
3555
3594
|
),
|
|
3556
3595
|
/* @__PURE__ */ y("div", { className: "flex items-center gap-1 px-2 py-1.5 border-b border-border", children: [
|
|
3557
|
-
/* @__PURE__ */ l(
|
|
3596
|
+
/* @__PURE__ */ l(Ai, {}),
|
|
3558
3597
|
/* @__PURE__ */ l("div", { className: "flex-1" }),
|
|
3559
3598
|
p && /* @__PURE__ */ l(
|
|
3560
3599
|
"button",
|
|
3561
3600
|
{
|
|
3562
3601
|
onClick: () => {
|
|
3563
|
-
|
|
3602
|
+
an(), p();
|
|
3564
3603
|
},
|
|
3565
3604
|
className: "wp-room-chrome__leave",
|
|
3566
3605
|
title: "Leave room",
|
|
@@ -3576,25 +3615,25 @@ function Bi({
|
|
|
3576
3615
|
title: "Hide chat",
|
|
3577
3616
|
"aria-label": "Hide chat",
|
|
3578
3617
|
"aria-expanded": !0,
|
|
3579
|
-
children: /* @__PURE__ */ l(
|
|
3618
|
+
children: /* @__PURE__ */ l(ni, {})
|
|
3580
3619
|
}
|
|
3581
3620
|
)
|
|
3582
3621
|
] }),
|
|
3583
|
-
/* @__PURE__ */ l(
|
|
3584
|
-
/* @__PURE__ */ l(
|
|
3585
|
-
/* @__PURE__ */ l(
|
|
3622
|
+
/* @__PURE__ */ l(li, {}),
|
|
3623
|
+
/* @__PURE__ */ l(Ci, { commands: [] }),
|
|
3624
|
+
/* @__PURE__ */ l(fn, { className: "absolute bottom-14 left-2 right-2" })
|
|
3586
3625
|
] })
|
|
3587
3626
|
}
|
|
3588
3627
|
)
|
|
3589
3628
|
] }) }) }) });
|
|
3590
3629
|
}
|
|
3591
|
-
function
|
|
3630
|
+
function Hi(e, t) {
|
|
3592
3631
|
const n = u((v) => v.chromeChatCollapsed) && t, a = u((v) => v.chromeChatWidth), r = u((v) => v.toggleChromeChatCollapsed), o = u((v) => v.setChromeChatWidth), [i, s] = E(null), [c, b] = E(void 0), [p, I] = E(null);
|
|
3593
3632
|
A(() => {
|
|
3594
3633
|
if (i)
|
|
3595
|
-
return
|
|
3634
|
+
return Mi(i, b);
|
|
3596
3635
|
}, [i]);
|
|
3597
|
-
const S = Q(p?.current ?? a, c), N = G(() =>
|
|
3636
|
+
const S = Q(p?.current ?? a, c), N = G(() => _o(n, S), [n, S]), M = gn((v) => e?.(v));
|
|
3598
3637
|
return A(() => {
|
|
3599
3638
|
M(N);
|
|
3600
3639
|
}, [N]), {
|
|
@@ -3607,20 +3646,20 @@ function Ai(e, t) {
|
|
|
3607
3646
|
v.button === 0 && (v.preventDefault(), v.currentTarget.setPointerCapture(v.pointerId), I({ pointerId: v.pointerId, startX: v.clientX, startWidth: S, current: S }));
|
|
3608
3647
|
},
|
|
3609
3648
|
onPointerMove: (v) => {
|
|
3610
|
-
!p || p.pointerId !== v.pointerId || I({ ...p, current:
|
|
3649
|
+
!p || p.pointerId !== v.pointerId || I({ ...p, current: Jt(p.startWidth, p.startX, v.clientX, c) });
|
|
3611
3650
|
},
|
|
3612
3651
|
onPointerEnd: (v) => {
|
|
3613
3652
|
if (!p || p.pointerId !== v.pointerId) return;
|
|
3614
|
-
const C =
|
|
3653
|
+
const C = Jt(p.startWidth, p.startX, v.clientX, c);
|
|
3615
3654
|
I(null), C !== a && o(C);
|
|
3616
3655
|
},
|
|
3617
3656
|
onKeyDown: (v) => {
|
|
3618
|
-
const C =
|
|
3657
|
+
const C = ko(S, v.key, c);
|
|
3619
3658
|
C !== null && (v.preventDefault(), C !== a && o(C));
|
|
3620
3659
|
}
|
|
3621
3660
|
};
|
|
3622
3661
|
}
|
|
3623
3662
|
export {
|
|
3624
|
-
|
|
3663
|
+
Zi as RoomChrome
|
|
3625
3664
|
};
|
|
3626
3665
|
//# sourceMappingURL=room-chrome.js.map
|