@hadoku/watchparty-ui 0.45.113 → 0.45.115

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.
@@ -1,25 +1,25 @@
1
1
  import { jsx as l, jsxs as _, Fragment as te } from "react/jsx-runtime";
2
- import Ge, { useState as N, useRef as $, useMemo as F, useCallback as M, useEffect as P, createContext as vt, useContext as ba, useSyncExternalStore as ya, useLayoutEffect as $t, useId as Ft, useEffectEvent as _a } from "react";
3
- import { themePrefs as pe, Icon as Nn, THEMES as jn, useHadokuThemeOptional as Rn } from "@wolffm/themes";
4
- import { createCdnClient as Pn, kindOfType as Mn, MAX_BYTES as Dn, measureImage as Ln, filesFromClipboard as On, filesFromDrop as qn, CdnError as gt } from "@wolffm/cdn-client";
5
- import { ensureCosmeticsStyles as Hn, cleanWorn as Un, readPictureColour as $n, onPictureColour as Fn, pictureColour as zn, decorHtml as Wn, messageHtml as wa, nameHtml as va, finishReveal as Bn } from "@wolffm/prefs-client/cosmetics";
2
+ import Ge, { useState as N, useRef as $, useMemo as F, useCallback as M, useEffect as R, createContext as kt, useContext as pa, useSyncExternalStore as ba, useLayoutEffect as Ut, useId as $t, useEffectEvent as ya } from "react";
3
+ import { themePrefs as pe, Icon as Nn, THEMES as jn, useHadokuThemeOptional as Pn } from "@wolffm/themes";
4
+ import { createCdnClient as Rn, kindOfType as Mn, MAX_BYTES as Dn, measureImage as Ln, filesFromClipboard as On, filesFromDrop as qn, CdnError as gt } from "@wolffm/cdn-client";
5
+ import { ensureCosmeticsStyles as Hn, cleanWorn as Un, readPictureColour as $n, onPictureColour as Fn, pictureColour as zn, decorHtml as Wn, messageHtml as _a, nameHtml as wa, finishReveal as Bn } from "@wolffm/prefs-client/cosmetics";
6
6
  import { create as Gn } from "zustand";
7
- import { pickAvatar as ka, applyReaction as Kn, resolveIdentityReassert as Vn } from "@wolffm/rooms-protocol";
7
+ import { avatarPortraitPath as Kn, pickAvatar as ka, applyReaction as Vn, mintTabId as Yn, resolveIdentityReassert as Jn } from "@wolffm/rooms-protocol";
8
8
  import { z as i } from "zod";
9
- import { createPrefsClient as Yn, getDeviceId as Jn, DEVICE_ID_KEY as Xn } from "@wolffm/prefs-client";
9
+ import { createPrefsClient as Xn, getDeviceId as Qn, DEVICE_ID_KEY as Zn } from "@wolffm/prefs-client";
10
10
  import { io as ht } from "socket.io-client";
11
- import { fetchCharacter as Qn, characterOf as Zn, onAvatarChange as eo } from "@wolffm/prefs-client/avatar";
12
- import { relayIdentityChanges as to } from "@wolffm/task-ui-components/identity-relay";
13
- import { createPortal as xa } from "react-dom";
14
- import { useCatalogueSearch as ao } from "@wolffm/cdn-client/react";
15
- const Sa = "https://cdn.hadoku.me", Ta = /^[0-9a-f]{64}\.(?:png|jpe?g|gif|webp|avif)$/;
16
- function kt(e) {
17
- return typeof e == "string" && Ta.test(e);
18
- }
19
- const xt = 8080, Ca = 5173, no = "/watchparty/ws", Ia = 500, oo = 1e3, ae = 4, Ea = typeof process < "u" && process.env ? process.env : {};
20
- Ea.PRODUCTION_UI_URL;
21
- Ea.PRODUCTION_SERVER_URL;
22
- const qe = i.enum(["S", "A", "B", "C", "D", "F"]), zt = 2e4, ro = 300;
11
+ import { fetchCharacter as eo, characterOf as to, onAvatarChange as ao } from "@wolffm/prefs-client/avatar";
12
+ import { relayIdentityChanges as no } from "@wolffm/task-ui-components/identity-relay";
13
+ import { createPortal as va } from "react-dom";
14
+ import { useCatalogueSearch as oo } from "@wolffm/cdn-client/react";
15
+ const xa = "https://cdn.hadoku.me", Sa = /^[0-9a-f]{64}\.(?:png|jpe?g|gif|webp|avif)$/;
16
+ function vt(e) {
17
+ return typeof e == "string" && Sa.test(e);
18
+ }
19
+ const xt = 8080, Ta = 5173, ro = "/watchparty/ws", Ca = 500, io = 1e3, ae = 4, Ia = typeof process < "u" && process.env ? process.env : {};
20
+ Ia.PRODUCTION_UI_URL;
21
+ Ia.PRODUCTION_SERVER_URL;
22
+ const qe = i.enum(["S", "A", "B", "C", "D", "F"]), Ft = 2e4, fo = 300;
23
23
  i.object({
24
24
  name: i.string().min(1).max(32).optional(),
25
25
  sprite: i.string().min(1).max(32).optional(),
@@ -52,7 +52,7 @@ const S = {
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
- }, io = i.enum(["play", "pause", "seek", "load", "home"]), fo = i.object({
55
+ }, so = i.enum(["play", "pause", "seek", "load", "home"]), lo = i.object({
56
56
  framed: i.boolean(),
57
57
  depth: i.number().int().nonnegative().max(10)
58
58
  });
@@ -60,7 +60,7 @@ i.object({
60
60
  room_key: i.string(),
61
61
  name: i.string().min(1).max(32).optional(),
62
62
  sprite: i.string().min(1).max(32).optional(),
63
- embed: fo.optional(),
63
+ embed: lo.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 @@ i.object({
108
108
  });
109
109
  i.object({
110
110
  client_seq: i.number().int().positive(),
111
- kind: io,
111
+ kind: so,
112
112
  to_ms: i.number().int().nonnegative().optional(),
113
113
  media_id: i.string().optional()
114
114
  // leader_id removed - not needed since set_leader control was removed
115
115
  });
116
- const Aa = i.object({
117
- key: i.string().regex(Ta, "not a CDN image key"),
116
+ const Ea = i.object({
117
+ key: i.string().regex(Sa, "not a CDN image key"),
118
118
  /**
119
119
  * Intrinsic pixels, or **0 meaning "unknown"**.
120
120
  *
@@ -127,8 +127,8 @@ const Aa = i.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: i.number().int().nonnegative().max(zt),
131
- h: i.number().int().nonnegative().max(zt),
130
+ w: i.number().int().nonnegative().max(Ft),
131
+ h: i.number().int().nonnegative().max(Ft),
132
132
  /**
133
133
  * Human-readable description, rendered as the `alt` text.
134
134
  *
@@ -142,16 +142,16 @@ const Aa = i.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: i.string().max(ro).optional()
146
- }), Na = /^[A-Za-z0-9_.:-]{1,64}$/;
145
+ title: i.string().max(fo).optional()
146
+ }), Aa = /^[A-Za-z0-9_.:-]{1,64}$/;
147
147
  i.object({
148
- text: i.string().max(Ia),
148
+ text: i.string().max(Ca),
149
149
  style: i.string().max(64).optional(),
150
- images: i.array(Aa).max(ae).optional(),
150
+ images: i.array(Ea).max(ae).optional(),
151
151
  /** The message this one replies to. Optional: older clients never send it. */
152
- reply_to: i.string().regex(Na).optional()
152
+ reply_to: i.string().regex(Aa).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 so = i.enum(["join", "leave", "media_change", "identity_change", "recap"]);
154
+ const co = i.enum(["join", "leave", "media_change", "identity_change", "recap"]);
155
155
  i.object({
156
156
  id: i.string(),
157
157
  client_id: i.string(),
@@ -164,7 +164,7 @@ i.object({
164
164
  ts: i.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: i.array(Aa).max(ae).optional(),
167
+ images: i.array(Ea).max(ae).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: i.string().optional(),
@@ -172,14 +172,14 @@ i.object({
172
172
  * ids `author` carries). Absent when there are none. */
173
173
  reactions: i.array(i.object({ emoji: i.string(), by: i.array(i.string()) })).optional(),
174
174
  isSystem: i.boolean().optional(),
175
- systemType: so.optional(),
175
+ systemType: co.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: i.string().optional()
181
181
  });
182
- const St = "{name}", lo = i.object({
182
+ const St = "{name}", uo = i.object({
183
183
  avg_download_rate_bps: i.number().nonnegative(),
184
184
  buffered_ahead_ms: i.number().nonnegative(),
185
185
  rtt_ms: i.number().nonnegative(),
@@ -221,7 +221,7 @@ const St = "{name}", lo = i.object({
221
221
  * socket shows here as a growing number while everything else looks fine. */
222
222
  pong_age_ms: i.number().int().nonnegative().optional(),
223
223
  reported_at: i.number().int().nonnegative()
224
- }), co = lo.extend({
224
+ }), mo = uo.extend({
225
225
  client_id: i.string(),
226
226
  name: i.string(),
227
227
  sprite_id: i.string().nullable(),
@@ -232,10 +232,10 @@ const St = "{name}", lo = i.object({
232
232
  stale_ms: i.number().int().nonnegative().optional()
233
233
  });
234
234
  i.object({
235
- clients: i.array(co),
235
+ clients: i.array(mo),
236
236
  server_ts: i.number().int().nonnegative()
237
237
  });
238
- const uo = i.object({
238
+ const go = i.object({
239
239
  client_id: i.string(),
240
240
  sprite_id: i.string().nullable(),
241
241
  name: i.string(),
@@ -253,13 +253,13 @@ const uo = i.object({
253
253
  video_ready_state: i.number().int().default(-1)
254
254
  });
255
255
  i.object({
256
- clients: i.array(uo),
256
+ clients: i.array(go),
257
257
  server_ts: i.number().int().nonnegative()
258
258
  });
259
259
  i.object({
260
260
  media_id: i.string()
261
261
  });
262
- const Tt = i.enum(["super_upvote", "upvote", "mid", "downvote"]), mo = i.object({
262
+ const Tt = i.enum(["super_upvote", "upvote", "mid", "downvote"]), ho = i.object({
263
263
  mediaId: i.string(),
264
264
  displayName: i.string(),
265
265
  // Enrichment fields — present for flat-playlist ingest output, absent for
@@ -270,11 +270,11 @@ const Tt = i.enum(["super_upvote", "upvote", "mid", "downvote"]), mo = i.object(
270
270
  durationMs: i.number().optional(),
271
271
  uploadDate: i.string().optional()
272
272
  // YouTube upload date 'YYYY-MM-DD'; drives playlist order
273
- }), go = i.enum(["basic", "vote"]), ja = i.object({
273
+ }), po = i.enum(["basic", "vote"]), Na = i.object({
274
274
  id: i.string(),
275
275
  name: i.string(),
276
- type: go.default("vote"),
277
- videos: i.array(mo),
276
+ type: po.default("vote"),
277
+ videos: i.array(ho),
278
278
  cover: i.string().optional()
279
279
  // media-relative path to the playlist cover image
280
280
  });
@@ -288,22 +288,22 @@ i.object({
288
288
  i.object({ voterKey: i.string().min(1).max(128) });
289
289
  i.object({ playlistId: i.string(), mediaIds: i.array(i.string()) });
290
290
  i.object({
291
- playlist: ja.nullable(),
291
+ playlist: Na.nullable(),
292
292
  activeIndex: i.number().int().nullable(),
293
293
  myVotes: i.record(i.string(), Tt)
294
294
  // mediaId -> VoteValue
295
295
  });
296
- const ho = i.object({
296
+ const bo = i.object({
297
297
  clientId: i.string(),
298
298
  name: i.string(),
299
299
  votedCount: i.number().int().nonnegative(),
300
300
  totalVideos: i.number().int().nonnegative()
301
301
  });
302
302
  i.object({
303
- progress: i.array(ho)
303
+ progress: i.array(bo)
304
304
  });
305
305
  i.object({
306
- playlist: ja,
306
+ playlist: Na,
307
307
  votes: i.record(i.string(), i.record(i.string(), Tt)),
308
308
  // votes[clientId][mediaId]
309
309
  names: i.record(i.string(), i.string()),
@@ -323,23 +323,23 @@ i.object({
323
323
  * reveal is closed ignores it, rather than having the popup reappear. */
324
324
  update: i.boolean().optional()
325
325
  });
326
- const Re = {
326
+ const Pe = {
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
- }, Ra = i.object({
332
+ }, ja = i.object({
333
333
  id: i.string(),
334
334
  displayName: i.string(),
335
335
  thumbnail: i.string().optional()
336
336
  });
337
337
  i.object({
338
- items: i.array(Ra)
338
+ items: i.array(ja)
339
339
  });
340
340
  const Pa = i.partialRecord(qe, i.array(i.string()));
341
341
  i.object({ board: Pa });
342
- const po = i.object({
342
+ const yo = i.object({
343
343
  mediaId: i.string(),
344
344
  tier: qe,
345
345
  absoluteTier: qe,
@@ -352,8 +352,8 @@ const po = i.object({
352
352
  // opaque voterId -> the letter they gave
353
353
  });
354
354
  i.object({
355
- items: i.array(Ra),
356
- placed: i.array(po),
355
+ items: i.array(ja),
356
+ placed: i.array(yo),
357
357
  unrated: i.array(i.string()),
358
358
  spread: i.number(),
359
359
  nudged: i.boolean(),
@@ -365,7 +365,7 @@ i.object({
365
365
  voterCount: i.number().int().nonnegative(),
366
366
  myBoard: Pa
367
367
  });
368
- const bo = {
368
+ const _o = {
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 @@ i.object({
378
378
  ready: i.array(i.string())
379
379
  // clientIds who have flagged ready
380
380
  });
381
- const yo = {
381
+ const wo = {
382
382
  STATE: "ready_check_state"
383
383
  // distinct from buffer-readiness 'ready_state'
384
- }, Ma = {
384
+ }, Ra = {
385
385
  ACTIVE: "game_active",
386
386
  // server -> room (the open game id; null = none)
387
387
  SYNC: "game_sync"
@@ -393,7 +393,7 @@ i.object({
393
393
  i.object({
394
394
  gameId: i.string().nullable()
395
395
  });
396
- const _o = [
396
+ const ko = [
397
397
  {
398
398
  id: "fantasy",
399
399
  characters: [
@@ -412,7 +412,7 @@ const _o = [
412
412
  characters: [
413
413
  { id: "gunner", color: "#b6a472" },
414
414
  { id: "chief", color: "#a47e4d" },
415
- { id: "walker", color: "#e0443a", rev: 2 },
415
+ { id: "walker", color: "#e0443a" },
416
416
  { id: "operative", color: "#347cae" }
417
417
  ]
418
418
  },
@@ -423,7 +423,7 @@ const _o = [
423
423
  { id: "recluse", color: "#6d6880" },
424
424
  { id: "phantom", color: "#a4a3ae" },
425
425
  { id: "harlequin", color: "#e5d5c5" },
426
- { id: "doll", color: "#a02633", rev: 2 },
426
+ { id: "doll", color: "#a02633" },
427
427
  { id: "imp", color: "#b398cb" }
428
428
  ]
429
429
  },
@@ -437,11 +437,7 @@ const _o = [
437
437
  { id: "mentor", color: "#e1e0dc" }
438
438
  ]
439
439
  }
440
- ], Ct = _o.flatMap((e) => e.characters), Ze = Ct.map((e) => e.id), wo = Object.fromEntries(Ct.map((e) => [e.id, e.color])), vo = Object.fromEntries(Ct.map((e) => [e.id, "rev" in e ? e.rev : 1]));
441
- function ko(e) {
442
- const t = vo[e];
443
- return `/media/sprites/square_${e}.png${t > 1 ? `?v=${t}` : ""}`;
444
- }
440
+ ], Ma = ko.flatMap((e) => e.characters), Ze = Ma.map((e) => e.id), vo = Object.fromEntries(Ma.map((e) => [e.id, e.color]));
445
441
  function et(e) {
446
442
  return !!e && Ze.includes(e);
447
443
  }
@@ -467,7 +463,7 @@ function Eo(e, t, a) {
467
463
  const n = Co(e);
468
464
  return n.mode === "on" ? "fragment" : n.mode === "off" || n.percent <= 0 ? "range" : n.percent >= 100 || t && Io(t) % 100 < n.percent ? "fragment" : "range";
469
465
  }
470
- let Pe = null, La = Sa;
466
+ let Re = null, La = xa;
471
467
  function Ao(e) {
472
468
  e.cdnBase && (La = e.cdnBase);
473
469
  }
@@ -476,10 +472,10 @@ function Oa() {
476
472
  }
477
473
  function tt() {
478
474
  const e = Oa();
479
- return (!Pe || Pe.base !== e) && (Pe = { base: e, client: Pn({ cdnBase: e }) }), Pe.client;
475
+ return (!Re || Re.base !== e) && (Re = { base: e, client: Rn({ cdnBase: e }) }), Re.client;
480
476
  }
481
477
  function Ke(e) {
482
- return !kt(e) || !Oa() ? null : tt().urlFor(e);
478
+ return !vt(e) || !Oa() ? null : tt().urlFor(e);
483
479
  }
484
480
  function No(e) {
485
481
  return e.kind === "file";
@@ -512,11 +508,11 @@ function He(e) {
512
508
  function jo(e) {
513
509
  return e instanceof gt ? He(e.reason) : e instanceof qa ? e.message : "Image upload failed";
514
510
  }
515
- function Ro(e) {
511
+ function Po(e) {
516
512
  const t = e.type.toLowerCase().split(";")[0].trim();
517
513
  return t && Mn(t) !== "image" ? He("unsupported-type") : e.size > Dn.image ? He("too-large") : e.size === 0 ? He("invalid") : null;
518
514
  }
519
- function Po(e) {
515
+ function Ro(e) {
520
516
  return On(e);
521
517
  }
522
518
  function Mo(e) {
@@ -528,7 +524,7 @@ async function Do(e) {
528
524
  }
529
525
  async function Lo(e, t = {}) {
530
526
  const a = await tt().upload(e, { signal: t.signal });
531
- if (!kt(a.key))
527
+ if (!vt(a.key))
532
528
  throw new qa("Image upload returned an unusable key");
533
529
  return { key: a.key, deduplicated: a.deduplicated === !0 };
534
530
  }
@@ -579,11 +575,11 @@ function Fo(e, t, a) {
579
575
  }
580
576
  const Ua = "/dataplatform/api/memes", zo = 120;
581
577
  function Wo({ onClose: e, onPick: t, onUnavailable: a, toggle: n }) {
582
- const [o, r] = N(""), f = $(null), s = $(null), c = tt(), { items: g, loading: m, error: k, hasMore: x, loadMore: E } = ao(
578
+ const [o, r] = N(""), f = $(null), s = $(null), c = tt(), { items: g, loading: m, error: v, hasMore: x, loadMore: E } = oo(
583
579
  c,
584
580
  Ua,
585
581
  o.trim()
586
- ), R = k?.reason ?? null, y = F(() => {
582
+ ), P = v?.reason ?? null, y = F(() => {
587
583
  const I = /* @__PURE__ */ new Set();
588
584
  return g.filter((j) => I.has(j.key) ? !1 : (I.add(j.key), !0));
589
585
  }, [g]), [d, u] = N(null), w = $(null), p = M(() => {
@@ -605,11 +601,11 @@ function Wo({ onClose: e, onPick: t, onUnavailable: a, toggle: n }) {
605
601
  },
606
602
  [p]
607
603
  );
608
- P(() => () => p(), [p]), P(() => {
609
- R === "unavailable" && a?.();
610
- }, [R, a]), P(() => {
604
+ R(() => () => p(), [p]), R(() => {
605
+ P === "unavailable" && a?.();
606
+ }, [P, a]), R(() => {
611
607
  s.current?.focus();
612
- }, []), P(() => {
608
+ }, []), R(() => {
613
609
  const I = (A) => {
614
610
  at(A) && (A.stopPropagation(), e());
615
611
  }, j = (A) => {
@@ -622,7 +618,7 @@ function Wo({ onClose: e, onPick: t, onUnavailable: a, toggle: n }) {
622
618
  }, [e, n]);
623
619
  const z = M((I) => {
624
620
  t(I), e();
625
- }, [t, e]), W = !m && !k && y.length === 0;
621
+ }, [t, e]), W = !m && !v && y.length === 0;
626
622
  return /* @__PURE__ */ _(
627
623
  "div",
628
624
  {
@@ -652,16 +648,16 @@ function Wo({ onClose: e, onPick: t, onUnavailable: a, toggle: n }) {
652
648
  onScroll: T,
653
649
  onMouseLeave: T,
654
650
  children: [
655
- k && /* @__PURE__ */ l(
651
+ v && /* @__PURE__ */ l(
656
652
  "p",
657
653
  {
658
654
  className: "m-2 p-2 text-center text-sm bg-danger-bg text-on-danger-bg rounded",
659
655
  role: "alert",
660
- "data-reason": R,
661
- children: R === "unauthenticated" ? /* @__PURE__ */ _(te, { children: [
656
+ "data-reason": P,
657
+ children: P === "unauthenticated" ? /* @__PURE__ */ _(te, { children: [
662
658
  "Sign in to browse memes · ",
663
659
  /* @__PURE__ */ l(Uo, { className: "underline text-on-danger-bg" })
664
- ] }) : R === "forbidden" ? "Your account can't browse the meme library" : "Meme library is unavailable"
660
+ ] }) : P === "forbidden" ? "Your account can't browse the meme library" : "Meme library is unavailable"
665
661
  }
666
662
  ),
667
663
  W && /* @__PURE__ */ l("p", { className: "p-4 text-center text-sm text-text-secondary", children: o.trim() ? `No memes match "${o.trim()}"` : "The meme library is empty" }),
@@ -750,12 +746,12 @@ function Wo({ onClose: e, onPick: t, onUnavailable: a, toggle: n }) {
750
746
  function Bo({ open: e, ...t }) {
751
747
  return e ? /* @__PURE__ */ l(Wo, { ...t }) : null;
752
748
  }
753
- const It = {
749
+ const Ct = {
754
750
  serverOrigin: `http://localhost:${xt}`,
755
751
  defaultRoomKey: "dev-room",
756
- cdnBase: Sa
752
+ cdnBase: xa
757
753
  };
758
- let Ue = { ...It };
754
+ let Ue = { ...Ct };
759
755
  function Go(e) {
760
756
  const t = Object.fromEntries(
761
757
  Object.entries(e).filter(([a, n]) => n !== void 0)
@@ -765,21 +761,21 @@ function Go(e) {
765
761
  function Te() {
766
762
  return Ue;
767
763
  }
768
- const Ko = vt(It);
764
+ const Ko = kt(Ct);
769
765
  function Vo(e) {
770
766
  return e.serverOrigin?.replace(/\/$/, "") || "";
771
767
  }
772
768
  function $a() {
773
769
  return Vo(Te());
774
770
  }
775
- const Fa = vt(null);
771
+ const Fa = kt(null);
776
772
  function za() {
777
- return ba(Fa);
773
+ return pa(Fa);
778
774
  }
779
- const Wa = vt(!0);
775
+ const Wa = kt(!0);
780
776
  function Ba() {
781
- const e = ba(Wa);
782
- P(() => {
777
+ const e = pa(Wa);
778
+ R(() => {
783
779
  e && Hn();
784
780
  }, [e]);
785
781
  }
@@ -793,7 +789,7 @@ const we = Ge.memo(
793
789
  (e, t) => e.html === t.html && e.as === t.as && e.className === t.className && JSON.stringify(e.style) === JSON.stringify(t.style)
794
790
  );
795
791
  function Yo(e, t) {
796
- P(() => {
792
+ R(() => {
797
793
  const a = e.current;
798
794
  if (!a || !t || typeof IntersectionObserver > "u") return;
799
795
  const n = new IntersectionObserver(([o]) => {
@@ -918,7 +914,7 @@ function ir(e) {
918
914
  return "[unserializable]";
919
915
  }
920
916
  }
921
- function Et(e, t, a, n, o, r, f) {
917
+ function It(e, t, a, n, o, r, f) {
922
918
  const s = {
923
919
  level: e,
924
920
  category: o,
@@ -926,7 +922,7 @@ function Et(e, t, a, n, o, r, f) {
926
922
  data: f,
927
923
  timestamp: Date.now()
928
924
  };
929
- if (rr(s), (a || Xa()) && Wt(s), !n) {
925
+ if (rr(s), (a || Xa()) && zt(s), !n) {
930
926
  if (!ar()) return;
931
927
  const m = nr();
932
928
  if (m && !m.has(o.toLowerCase())) return;
@@ -940,13 +936,13 @@ function Et(e, t, a, n, o, r, f) {
940
936
  );
941
937
  }
942
938
  function b(e, t, a) {
943
- Et("debug", console.log, !1, !1, e, t, a);
939
+ It("debug", console.log, !1, !1, e, t, a);
944
940
  }
945
941
  function D(e, t, a) {
946
- Et("warn", console.warn, !0, !1, e, t, a);
942
+ It("warn", console.warn, !0, !1, e, t, a);
947
943
  }
948
944
  function Fe(e, t, a) {
949
- Et("error", console.error, !0, !0, e, t, a);
945
+ It("error", console.error, !0, !0, e, t, a);
950
946
  }
951
947
  function fr() {
952
948
  return [...be];
@@ -988,7 +984,7 @@ async function gr() {
988
984
  let a = Te().serverOrigin || "";
989
985
  if ((a === "/" || !a) && typeof window < "u") {
990
986
  const s = window.location;
991
- (s.hostname === "localhost" || s.hostname === "127.0.0.1") && s.port === String(Ca) ? a = `${s.protocol}//${s.hostname}:${xt}` : a = s.origin;
987
+ (s.hostname === "localhost" || s.hostname === "127.0.0.1") && s.port === String(Ta) ? a = `${s.protocol}//${s.hostname}:${xt}` : a = s.origin;
992
988
  }
993
989
  const n = `${a.replace(/\/$/, "")}/api/client-log`, o = e.map((s) => ({
994
990
  level: s.level,
@@ -1019,7 +1015,7 @@ async function gr() {
1019
1015
  console.warn("[wp] log flush failed (client logs may be lost):", Ce(t).error);
1020
1016
  }
1021
1017
  }
1022
- function Wt(e) {
1018
+ function zt(e) {
1023
1019
  if ($e.push(e), !bt) {
1024
1020
  const t = Xa() ? tr : er;
1025
1021
  bt = setTimeout(() => {
@@ -1049,11 +1045,11 @@ function br() {
1049
1045
  screenWidth: typeof screen < "u" ? screen.width : 0
1050
1046
  };
1051
1047
  }
1052
- let Bt = null;
1048
+ let Wt = null;
1053
1049
  function yr() {
1054
- return Bt ??= pr(br()), Bt;
1050
+ return Wt ??= pr(br()), Wt;
1055
1051
  }
1056
- function Gt() {
1052
+ function Bt() {
1057
1053
  return yr();
1058
1054
  }
1059
1055
  const ne = {
@@ -1061,43 +1057,43 @@ const ne = {
1061
1057
  userType: "public",
1062
1058
  accountId: null
1063
1059
  };
1064
- function At() {
1060
+ function Et() {
1065
1061
  return ne.accountId ? ne.accountId : ne.resolved && ne.userType === "public" ? "anon" : null;
1066
1062
  }
1067
1063
  function _r(e) {
1068
1064
  ne.resolved = !0, e.userType && (ne.userType = e.userType), e.userId !== void 0 && (ne.accountId = e.userId && e.userId !== "public" ? e.userId : null);
1069
1065
  }
1070
- function Nt() {
1066
+ function At() {
1071
1067
  return ne.accountId ?? "public";
1072
1068
  }
1073
1069
  function wr() {
1074
- return At() ?? "unscoped";
1070
+ return Et() ?? "unscoped";
1075
1071
  }
1076
1072
  function Qa(e) {
1077
- return et(e) ? wo[e] : "var(--color-neutral-bg)";
1073
+ return et(e) ? vo[e] : "var(--color-neutral-bg)";
1078
1074
  }
1079
- function vr(e) {
1080
- return et(e) ? `${Te().serverOrigin.replace(/\/$/, "")}${ko(e)}` : void 0;
1075
+ function kr(e) {
1076
+ return et(e) ? `${Te().serverOrigin.replace(/\/$/, "")}${Kn(e)}` : void 0;
1081
1077
  }
1082
- let ve = null, Me = null;
1083
- function kr() {
1084
- return ve ? Promise.resolve() : Me || (Me = (async () => {
1078
+ let ke = null, Me = null;
1079
+ function vr() {
1080
+ return ke ? Promise.resolve() : Me || (Me = (async () => {
1085
1081
  try {
1086
1082
  const e = Te().serverOrigin.replace(/\/$/, ""), t = await fetch(`${e}/media/sprites/names.json`, { cache: "no-cache" });
1087
1083
  if (!t.ok) return;
1088
1084
  const a = await t.json();
1089
- ve = a, rt("__DISPLAY_NAMES__", a), b("characters", "Loaded display names", a);
1085
+ ke = a, rt("__DISPLAY_NAMES__", a), b("characters", "Loaded display names", a);
1090
1086
  } catch (e) {
1091
1087
  b("characters", "display names fetch failed (degrading to sprite IDs)", Ce(e));
1092
1088
  }
1093
1089
  })(), Me);
1094
1090
  }
1095
- function ke(e) {
1096
- return ve?.[e] || e.charAt(0).toUpperCase() + e.slice(1);
1091
+ function ve(e) {
1092
+ return ke?.[e] || e.charAt(0).toUpperCase() + e.slice(1);
1097
1093
  }
1098
1094
  function le(e) {
1099
1095
  const t = e.toLowerCase();
1100
- return Ze.some((a) => a === t) ? !0 : ve ? Object.values(ve).some((a) => a.toLowerCase() === t) : !1;
1096
+ return Ze.some((a) => a === t) ? !0 : ke ? Object.values(ke).some((a) => a.toLowerCase() === t) : !1;
1101
1097
  }
1102
1098
  const xr = i.object({
1103
1099
  // Identity. There is deliberately NO `name`: a person's name is their
@@ -1124,18 +1120,18 @@ const xr = i.object({
1124
1120
  preferredAudioLang: i.string().optional(),
1125
1121
  subtitlesEnabled: i.boolean().optional(),
1126
1122
  subtitleStyle: i.string().optional()
1127
- }), ye = Yn({
1123
+ }), ye = Xn({
1128
1124
  appId: "watchparty",
1129
1125
  schema: xr
1130
1126
  }), Sr = /* @__PURE__ */ new Set(["theme", "themeMode"]);
1131
1127
  function Ye(e) {
1132
- const t = At();
1128
+ const t = Et();
1133
1129
  return t ? `prefs-cache:${t}:${e}` : null;
1134
1130
  }
1135
1131
  function Tr() {
1136
- return At() === null;
1132
+ return Et() === null;
1137
1133
  }
1138
- function Kt(e) {
1134
+ function Gt(e) {
1139
1135
  const t = Ye(e);
1140
1136
  if (!t) return {};
1141
1137
  const a = B(t);
@@ -1167,12 +1163,12 @@ function Cr() {
1167
1163
  return e > 0 && b("preferences", "Stripped retired name from cached prefs rows", { rewritten: e }), e;
1168
1164
  }
1169
1165
  let Za = null, en = null;
1170
- const Vt = /* @__PURE__ */ new Set();
1171
- function jt() {
1166
+ const Kt = /* @__PURE__ */ new Set();
1167
+ function Nt() {
1172
1168
  if (Tr())
1173
1169
  return b("preferences", "Boot read deferred — session pending, identity unresolved"), {};
1174
- const e = Kt("portfolio"), t = Kt("watchparty"), a = Object.keys(e).length > 0 ? e : Za ?? {}, n = Object.keys(t).length > 0 ? t : en ?? {}, o = Nt() || "public";
1175
- if (Vt.has(o))
1170
+ const e = Gt("portfolio"), t = Gt("watchparty"), a = Object.keys(e).length > 0 ? e : Za ?? {}, n = Object.keys(t).length > 0 ? t : en ?? {}, o = At() || "public";
1171
+ if (Kt.has(o))
1176
1172
  return b("preferences", "Loaded (sync, SDK-only after first read)", {
1177
1173
  uid: o,
1178
1174
  sdkThemeKeys: Object.keys(a).length,
@@ -1182,7 +1178,7 @@ function jt() {
1182
1178
  themeSource: Object.keys(e).length > 0 ? "cache" : "mem",
1183
1179
  appSource: Object.keys(t).length > 0 ? "cache" : "mem"
1184
1180
  }), { ...n, ...a };
1185
- Vt.add(o);
1181
+ Kt.add(o);
1186
1182
  const r = an() ?? {}, f = { ...r, ...n, ...a };
1187
1183
  return b("preferences", "Loaded (sync, first read — legacy + SDK)", {
1188
1184
  uid: o,
@@ -1195,21 +1191,21 @@ function jt() {
1195
1191
  }
1196
1192
  let tn = !1;
1197
1193
  function Ir() {
1198
- const e = Nt();
1194
+ const e = At();
1199
1195
  return !e || e === "public";
1200
1196
  }
1201
1197
  function J(e, t) {
1202
1198
  Ir() && (tn = !0), Sr.has(e) ? pe.save({ [e]: t }, { scope: "device" }).catch((a) => D("preferences", "themePrefs.save failed", { key: e, err: a?.message })) : ye.save({ [e]: t }).catch((a) => D("preferences", "watchpartyPrefs.save failed", { key: e, err: a?.message })), b("preferences", "Saved (via SDK)", { key: e, value: t });
1203
1199
  }
1204
- let De = null, Yt = !1;
1200
+ let De = null, Vt = !1;
1205
1201
  function Er() {
1206
1202
  return De || (De = (async () => {
1207
1203
  if (typeof window > "u") return !1;
1208
1204
  try {
1209
- Yt || (Yt = !0, pe.subscribe((f) => {
1210
- Za = f, Qt("portfolio", f), Zt("theme");
1205
+ Vt || (Vt = !0, pe.subscribe((f) => {
1206
+ Za = f, Xt("portfolio", f), Qt("theme");
1211
1207
  }), ye.subscribe((f) => {
1212
- en = f, Qt("watchparty", f), Zt("watchparty");
1208
+ en = f, Xt("watchparty", f), Qt("watchparty");
1213
1209
  }));
1214
1210
  const [e, t] = await Promise.all([
1215
1211
  pe.read(),
@@ -1242,7 +1238,7 @@ function Er() {
1242
1238
  const Je = "watchparty_preferences";
1243
1239
  Cr();
1244
1240
  function _t() {
1245
- const e = Nt();
1241
+ const e = At();
1246
1242
  return !e || e === "public" ? Je : `${Je}:${e}`;
1247
1243
  }
1248
1244
  function an() {
@@ -1255,7 +1251,7 @@ function an() {
1255
1251
  return null;
1256
1252
  }
1257
1253
  }
1258
- function Jt() {
1254
+ function Yt() {
1259
1255
  Ve(_t()), Ve(`${_t()}:_serverSynced_v1`);
1260
1256
  }
1261
1257
  async function Ar(e, t) {
@@ -1266,7 +1262,7 @@ async function Ar(e, t) {
1266
1262
  n || (g === "theme" && typeof m == "string" ? r.theme = m : g === "themeMode" && (m === "simple" || m === "advanced") && (r.themeMode = m)), o || (g === "chatCollapsed" && typeof m == "boolean" ? f.chatCollapsed = m : g === "floatingChatEnabled" && typeof m == "boolean" ? f.floatingChatEnabled = m : g === "volume" && typeof m == "number" && m >= 0 && m <= 1 ? f.volume = m : g === "muted" && typeof m == "boolean" ? f.muted = m : g === "preferredAudioLang" && typeof m == "string" ? f.preferredAudioLang = m : g === "subtitlesEnabled" && typeof m == "boolean" ? f.subtitlesEnabled = m : g === "subtitleStyle" && typeof m == "string" && (f.subtitleStyle = m));
1267
1263
  const s = Object.keys(r), c = Object.keys(f);
1268
1264
  if (s.length === 0 && c.length === 0) {
1269
- Jt();
1265
+ Yt();
1270
1266
  return;
1271
1267
  }
1272
1268
  b("preferences", "Migrating legacy localStorage prefs to SDK", {
@@ -1279,15 +1275,15 @@ async function Ar(e, t) {
1279
1275
  await Promise.all([
1280
1276
  s.length > 0 ? pe.save(r, { scope: "device" }) : Promise.resolve(),
1281
1277
  c.length > 0 ? ye.save(f) : Promise.resolve()
1282
- ]), Jt(), b("preferences", "Legacy migration complete");
1278
+ ]), Yt(), b("preferences", "Legacy migration complete");
1283
1279
  } catch (g) {
1284
1280
  D("preferences", "Legacy migration save failed — will retry next load", {
1285
1281
  err: g?.message
1286
1282
  });
1287
1283
  }
1288
1284
  }
1289
- let Xt = !1;
1290
- function Qt(e, t) {
1285
+ let Jt = !1;
1286
+ function Xt(e, t) {
1291
1287
  const a = Ye(e);
1292
1288
  if (a)
1293
1289
  try {
@@ -1299,14 +1295,14 @@ function Qt(e, t) {
1299
1295
  };
1300
1296
  localStorage.setItem(a, JSON.stringify(n));
1301
1297
  } catch (n) {
1302
- Xt || (Xt = !0, D("preferences", "writeThrough localStorage failed (in-memory backstop only)", {
1298
+ Jt || (Jt = !0, D("preferences", "writeThrough localStorage failed (in-memory backstop only)", {
1303
1299
  appId: e,
1304
1300
  err: n?.message,
1305
1301
  name: n?.name
1306
1302
  }));
1307
1303
  }
1308
1304
  }
1309
- function Zt(e) {
1305
+ function Qt(e) {
1310
1306
  Promise.resolve().then(() => fn).then(({ useAppStore: t }) => {
1311
1307
  try {
1312
1308
  t.getState().rehydrateFromPrefs();
@@ -1315,37 +1311,37 @@ function Zt(e) {
1315
1311
  }
1316
1312
  }).catch((t) => D("preferences", "store import failed", { reason: e, err: t?.message }));
1317
1313
  }
1318
- const nn = 320, Xe = 240, Rt = 640, Nr = 320, jr = 36, ea = 16;
1314
+ const nn = 320, Xe = 240, jt = 640, Nr = 320, jr = 36, Zt = 16;
1319
1315
  function Z(e, t) {
1320
1316
  if (!Number.isFinite(e)) return nn;
1321
- let a = Rt;
1317
+ let a = jt;
1322
1318
  return t !== void 0 && Number.isFinite(t) && t > 0 && (a = Math.min(a, t - Nr)), a = Math.max(a, Xe), Math.round(Math.min(a, Math.max(Xe, e)));
1323
1319
  }
1324
- function ta(e, t, a, n) {
1320
+ function ea(e, t, a, n) {
1325
1321
  return Z(e + (t - a), n);
1326
1322
  }
1327
- function Rr(e, t, a) {
1323
+ function Pr(e, t, a) {
1328
1324
  switch (t) {
1329
1325
  case "ArrowLeft":
1330
- return Z(e + ea, a);
1326
+ return Z(e + Zt, a);
1331
1327
  case "ArrowRight":
1332
- return Z(e - ea, a);
1328
+ return Z(e - Zt, a);
1333
1329
  case "Home":
1334
1330
  return Z(Xe, a);
1335
1331
  case "End":
1336
- return Z(Rt, a);
1332
+ return Z(jt, a);
1337
1333
  default:
1338
1334
  return null;
1339
1335
  }
1340
1336
  }
1341
- function Pr(e, t) {
1337
+ function Rr(e, t) {
1342
1338
  return { collapsed: e, width: e ? jr : t };
1343
1339
  }
1344
1340
  function on(e, t) {
1345
1341
  const a = new Set(t.map((r) => r.id)), n = t.reduce((r, f) => Math.max(r, f.ts), -1 / 0), o = e.filter((r) => !a.has(r.id) && r.ts > n);
1346
1342
  return o.length ? [...t, ...o] : t;
1347
1343
  }
1348
- const rn = 6e3, X = jt(), h = Gn((e, t) => ({
1344
+ const rn = 6e3, X = Nt(), h = Gn((e, t) => ({
1349
1345
  ready: !1,
1350
1346
  name: "",
1351
1347
  sprite: null,
@@ -1402,12 +1398,12 @@ const rn = 6e3, X = jt(), h = Gn((e, t) => ({
1402
1398
  ensureAutoIdentity: () => e((a) => {
1403
1399
  if (a.name) return {};
1404
1400
  if (a.sprite) {
1405
- const r = ke(a.sprite);
1401
+ const r = ve(a.sprite);
1406
1402
  return b("store", "Auto-identity: deriving name from the requested sprite", { name: r, sprite: a.sprite }), { name: r };
1407
1403
  }
1408
1404
  const n = Object.values(a.roster).map((r) => r.sprite), o = ka(n, void 0, Ze);
1409
1405
  if (o) {
1410
- const r = ke(o);
1406
+ const r = ve(o);
1411
1407
  return b("store", "Auto-identity assigned", { name: r, sprite: o }), { name: r, sprite: o };
1412
1408
  }
1413
1409
  return D("store", "All characters taken, leaving identity unset"), {};
@@ -1476,7 +1472,7 @@ const rn = 6e3, X = jt(), h = Gn((e, t) => ({
1476
1472
  jumpToMessage: (a) => e(() => ({ chatJump: { id: a, at: Date.now() } })),
1477
1473
  toggleChatCollapsed: () => e((a) => {
1478
1474
  const n = !a.chatCollapsed;
1479
- return Gt() || J("chatCollapsed", n), { chatCollapsed: n };
1475
+ return Bt() || J("chatCollapsed", n), { chatCollapsed: n };
1480
1476
  }),
1481
1477
  applyTvDefaults: () => e(() => ({ chatCollapsed: !0 })),
1482
1478
  toggleChromeChatCollapsed: () => e((a) => {
@@ -1581,8 +1577,8 @@ const rn = 6e3, X = jt(), h = Gn((e, t) => ({
1581
1577
  setGameSettings: (a) => e({ gameSettings: a }),
1582
1578
  setRoomKeyType: (a) => e({ roomKeyType: a }),
1583
1579
  rehydrateFromPrefs: () => e((a) => {
1584
- const n = jt(), o = {};
1585
- if (n.chatCollapsed !== void 0 && !Gt() && (o.chatCollapsed = n.chatCollapsed), n.chromeChatCollapsed !== void 0 && (o.chromeChatCollapsed = n.chromeChatCollapsed), n.chromeChatWidth !== void 0 && (o.chromeChatWidth = Z(n.chromeChatWidth)), ["volume", "muted", "preferredAudioLang", "subtitlesEnabled", "subtitleStyle"].some((s) => n[s] !== void 0)) {
1580
+ const n = Nt(), o = {};
1581
+ if (n.chatCollapsed !== void 0 && !Bt() && (o.chatCollapsed = n.chatCollapsed), n.chromeChatCollapsed !== void 0 && (o.chromeChatCollapsed = n.chromeChatCollapsed), n.chromeChatWidth !== void 0 && (o.chromeChatWidth = Z(n.chromeChatWidth)), ["volume", "muted", "preferredAudioLang", "subtitlesEnabled", "subtitleStyle"].some((s) => n[s] !== void 0)) {
1586
1582
  const s = { ...a.mediaPrefs };
1587
1583
  n.volume !== void 0 && (s.volume = n.volume), n.muted !== void 0 && (s.muted = n.muted), n.preferredAudioLang !== void 0 && (s.preferredAudioLang = n.preferredAudioLang), n.subtitlesEnabled !== void 0 && (s.subtitlesEnabled = n.subtitlesEnabled), n.subtitleStyle !== void 0 && ["classic", "cinema", "minimal", "contrast"].includes(n.subtitleStyle) && (s.subtitleStyle = n.subtitleStyle), o.mediaPrefs = s;
1588
1584
  }
@@ -1602,7 +1598,7 @@ function Dr(e, t, a) {
1602
1598
  }
1603
1599
  function Lr(e, t, a) {
1604
1600
  let n = e ?? [];
1605
- for (const [o, r] of t) n = Kn(n, o, a, r.on) ?? n;
1601
+ for (const [o, r] of t) n = Vn(n, o, a, r.on) ?? n;
1606
1602
  return n;
1607
1603
  }
1608
1604
  function Or(e, t, a, n) {
@@ -1646,7 +1642,7 @@ function Ur(e) {
1646
1642
  };
1647
1643
  }
1648
1644
  let Q = null, Y = null, ze = null;
1649
- function aa(e) {
1645
+ function ta(e) {
1650
1646
  e && Q && e.origin === Q.origin && e.path === Q.path && e.namespace === Q.namespace || !e && !Q || (cn(), Q = e);
1651
1647
  }
1652
1648
  function Ie() {
@@ -1675,7 +1671,7 @@ function ln(e, t) {
1675
1671
  function cn() {
1676
1672
  ze = null, Y && (Y.disconnect(), Y = null);
1677
1673
  }
1678
- function na(e, t) {
1674
+ function aa(e, t) {
1679
1675
  return {
1680
1676
  id: String(e.id ?? e.server_seq ?? t ?? `${Date.now()}-${Math.random().toString(36).slice(2, 8)}`),
1681
1677
  clientId: e.client_id,
@@ -1687,11 +1683,11 @@ function na(e, t) {
1687
1683
  // Attachments arrive from other clients, so the key shape is re-checked
1688
1684
  // here at the boundary rather than trusted at render time. A malformed
1689
1685
  // entry is dropped, not rendered and not allowed near an <img src>.
1690
- images: Array.isArray(e.images) ? e.images.filter((a) => !!a && kt(a.key)).slice(0, ae) : void 0,
1686
+ images: Array.isArray(e.images) ? e.images.filter((a) => !!a && vt(a.key)).slice(0, ae) : void 0,
1691
1687
  isSystem: e.isSystem || !1,
1692
1688
  systemType: e.systemType,
1693
1689
  template: e.isSystem && typeof e.template == "string" && e.template.includes(St) ? e.template : void 0,
1694
- replyTo: typeof e.reply_to == "string" && Na.test(e.reply_to) ? e.reply_to : void 0,
1690
+ replyTo: typeof e.reply_to == "string" && Aa.test(e.reply_to) ? e.reply_to : void 0,
1695
1691
  reactions: dn(e.reactions)
1696
1692
  };
1697
1693
  }
@@ -1706,11 +1702,11 @@ function dn(e) {
1706
1702
  function un(e, t = () => !0) {
1707
1703
  e.on(S.CHAT_BROADCAST, (a) => {
1708
1704
  if (!t()) return;
1709
- const n = { ...na(a, a.server_seq), live: !0 };
1705
+ const n = { ...aa(a, a.server_seq), live: !0 };
1710
1706
  h.getState().appendChat(n), b("chat", "Message received", n);
1711
1707
  }), e.on(S.CHAT_HISTORY, (a) => {
1712
1708
  if (!t() || !a?.messages || !Array.isArray(a.messages)) return;
1713
- const n = a.messages.map((o) => na(o));
1709
+ const n = a.messages.map((o) => aa(o));
1714
1710
  h.getState().setChat(n), b("chat", "History loaded", { count: n.length });
1715
1711
  }), e.on(S.CHAT_REACTION, (a) => {
1716
1712
  t() && (!a || typeof a.id != "string" || Hr(a.id, dn(a.reactions) ?? []));
@@ -1754,12 +1750,12 @@ async function Vr(e) {
1754
1750
  return D("tierlist", "Board fetch threw", Ce(t)), null;
1755
1751
  }
1756
1752
  }
1757
- let oa = !1;
1753
+ let na = !1;
1758
1754
  function Yr() {
1759
- if (oa || typeof Image > "u") return;
1755
+ if (na || typeof Image > "u") return;
1760
1756
  const e = h.getState().tierlist;
1761
1757
  if (!(!e || e.items.length === 0)) {
1762
- oa = !0;
1758
+ na = !0;
1763
1759
  for (const t of e.items) {
1764
1760
  const a = new Image();
1765
1761
  a.decoding = "async", a.src = Gr(t.id, t.thumbnail);
@@ -1771,7 +1767,7 @@ function Jr() {
1771
1767
  const e = h.getState(), t = ka(Object.values(e.roster).map((o) => o.sprite), void 0, Ze);
1772
1768
  if (!t)
1773
1769
  return D("socket", "sprite_taken: no available sprites to retry with"), null;
1774
- const a = !!e.name && !le(e.name), n = a ? e.name : ke(t);
1770
+ const a = !!e.name && !le(e.name), n = a ? e.name : ve(t);
1775
1771
  return b("socket", "sprite_taken: retrying with a free character", { from: e.sprite, to: t, name: n, keptCustomName: a }), e.setSessionIdentity(n, t), { name: n, sprite: t };
1776
1772
  }
1777
1773
  function Xr(e) {
@@ -1780,21 +1776,21 @@ function Xr(e) {
1780
1776
  }
1781
1777
  const Qr = "hadoku:name";
1782
1778
  function Zr(e) {
1783
- const t = Zn(e);
1779
+ const t = to(e);
1784
1780
  return et(t) ? t : null;
1785
1781
  }
1786
1782
  async function ei(e = {}) {
1787
- const t = await Qn({
1783
+ const t = await eo({
1788
1784
  ...e,
1789
1785
  onError: (n) => D("avatar", "Avatar settings read failed — keeping the auto-assigned character", Ce(n))
1790
1786
  }), a = et(t) ? t : null;
1791
1787
  return b("avatar", "Requested character from prefs-api", { sprite: a }), a;
1792
1788
  }
1793
- function ra(e) {
1789
+ function oa(e) {
1794
1790
  if (!e) return !1;
1795
1791
  const t = h.getState();
1796
1792
  if (t.sprite === e) return !1;
1797
- const n = !!(t.me.clientId && t.roster[t.me.clientId]?.registryName) || !t.name || !le(t.name) ? t.name : ke(e);
1793
+ const n = !!(t.me.clientId && t.roster[t.me.clientId]?.registryName) || !t.name || !le(t.name) ? t.name : ve(e);
1798
1794
  return t.setSessionIdentity(n, e), !0;
1799
1795
  }
1800
1796
  function ti(e, t, a) {
@@ -1836,12 +1832,12 @@ function fi() {
1836
1832
  return Xo(ii);
1837
1833
  }
1838
1834
  let si = { ...Da }, lt = null;
1839
- const ia = "watchparty_delivery_client_id";
1835
+ const ra = "watchparty_delivery_client_id";
1840
1836
  function li() {
1841
- const e = B(ia);
1837
+ const e = B(ra);
1842
1838
  if (e) return e;
1843
1839
  const t = globalThis.crypto?.randomUUID?.() ?? `d${Math.random().toString(36).slice(2)}`;
1844
- return ot(ia, t) ? t : "";
1840
+ return ot(ra, t) ? t : "";
1845
1841
  }
1846
1842
  function ci() {
1847
1843
  return lt === null && (lt = Eo(si, li(), fi())), lt;
@@ -1851,7 +1847,7 @@ function di() {
1851
1847
  }
1852
1848
  let We;
1853
1849
  function gn() {
1854
- return B(Xn) || void 0;
1850
+ return B(Zn) || void 0;
1855
1851
  }
1856
1852
  function ui() {
1857
1853
  if (We) return;
@@ -1860,7 +1856,7 @@ function ui() {
1860
1856
  We = e;
1861
1857
  return;
1862
1858
  }
1863
- Jn().then((t) => {
1859
+ Qn().then((t) => {
1864
1860
  t && (We = t);
1865
1861
  }).catch(() => {
1866
1862
  b("identity", "device id unavailable — joining without one");
@@ -1892,14 +1888,14 @@ function wi(e, t) {
1892
1888
  return e.lastPongAt === null ? void 0 : Math.max(0, t - e.lastPongAt);
1893
1889
  }
1894
1890
  let C = null, G = null, Be = null, K = null, ee = null;
1895
- const vi = Si(), de = bi();
1896
- let Le = null, ct = null, fa = 0, Mt = null, Se = !1, Dt = !1, he = !1, hn = null;
1897
- function ki(e) {
1891
+ const ki = Yn(), de = bi();
1892
+ let Le = null, ct = null, ia = 0, Rt = null, Se = !1, Mt = !1, he = !1, hn = null;
1893
+ function vi(e) {
1898
1894
  const t = re(), a = h.getState();
1899
1895
  if (a.me.clientId && a.roster[a.me.clientId])
1900
1896
  return (e.name || e.sprite) && (b("socket", "Identity update (already joined)", { name: e.name, sprite: e.sprite }), t.emit(S.IDENTITY_UPDATE, { name: e.name, sprite: e.sprite })), t;
1901
1897
  const n = xi(e);
1902
- return ee = n, Mt = { name: n.name, sprite: n.sprite }, Ie() && $r(n), t.connected ? (b("socket", "Emitting join", n), t.emit(S.JOIN, n)) : t.once("connect", () => {
1898
+ return ee = n, Rt = { name: n.name, sprite: n.sprite }, Ie() && $r(n), t.connected ? (b("socket", "Emitting join", n), t.emit(S.JOIN, n)) : t.once("connect", () => {
1903
1899
  b("socket", "Emitting join", n), t.emit(S.JOIN, n);
1904
1900
  }), t;
1905
1901
  }
@@ -1916,30 +1912,22 @@ function xi(e) {
1916
1912
  // (lastJoinPayload carries it) so a reconnect lands on the same
1917
1913
  // ParticipantId rather than minting a new person.
1918
1914
  device_id: mi(),
1919
- tab_id: vi
1915
+ tab_id: ki
1920
1916
  };
1921
1917
  }
1922
- function Si() {
1923
- const e = globalThis.crypto;
1924
- if (e && typeof e.randomUUID == "function") return e.randomUUID();
1925
- const t = new Uint8Array(16);
1926
- if (e && typeof e.getRandomValues == "function") e.getRandomValues(t);
1927
- else for (let a = 0; a < t.length; a++) t[a] = Math.floor(Math.random() * 256);
1928
- return Array.from(t, (a) => a.toString(16).padStart(2, "0")).join("");
1929
- }
1930
1918
  function re() {
1931
1919
  if (!C) {
1932
1920
  let t = Te().serverOrigin || "/";
1933
1921
  if (t === "/" && typeof window < "u") {
1934
1922
  const n = window.location;
1935
- (n.hostname === "localhost" || n.hostname === "127.0.0.1") && n.port === String(Ca) && (t = `${n.protocol}//${n.hostname}:${xt}`, b("socket", "Using dev fallback origin", { origin: t }));
1923
+ (n.hostname === "localhost" || n.hostname === "127.0.0.1") && n.port === String(Ta) && (t = `${n.protocol}//${n.hostname}:${xt}`, b("socket", "Using dev fallback origin", { origin: t }));
1936
1924
  }
1937
1925
  const a = Wr();
1938
1926
  if (a)
1939
1927
  C = ht(a.url, { path: a.path, transports: ["websocket", "polling"] }), b("socket", "Socket initialized on the room origin", a);
1940
1928
  else {
1941
1929
  const n = new URL(t.startsWith("http") ? t : `${window.location.origin}${t}`).origin;
1942
- C = ht(n, { path: no, transports: ["websocket", "polling"] }), b("socket", "Socket initialized", { origin: t });
1930
+ C = ht(n, { path: ro, transports: ["websocket", "polling"] }), b("socket", "Socket initialized", { origin: t });
1943
1931
  }
1944
1932
  rt("__SOCKET__", C), K && (clearTimeout(K), K = null), G = null, Be = setInterval(() => {
1945
1933
  if (_i(de, Date.now(), !!C?.connected)) {
@@ -1949,9 +1937,9 @@ function re() {
1949
1937
  }), ct = "pong-watchdog", de.unansweredSince = null, C?.io.engine?.close();
1950
1938
  return;
1951
1939
  }
1952
- Oi();
1940
+ Li();
1953
1941
  }, xo), C.on("connect", () => {
1954
- Dt = !1;
1942
+ Mt = !1;
1955
1943
  const n = C?.id;
1956
1944
  if (b("socket", "Connected", { id: n, isReconnect: he }), n)
1957
1945
  try {
@@ -1961,13 +1949,13 @@ function re() {
1961
1949
  }
1962
1950
  if (he && ee) {
1963
1951
  const o = h.getState();
1964
- fa += 1;
1952
+ ia += 1;
1965
1953
  const r = {
1966
1954
  ...ee,
1967
1955
  name: o.name,
1968
1956
  sprite: o.sprite,
1969
1957
  reconnect: {
1970
- count: fa,
1958
+ count: ia,
1971
1959
  reason: (Le?.reason ?? "unknown").slice(0, 64),
1972
1960
  offline_ms: Le ? Math.max(0, Date.now() - Le.at) : 0
1973
1961
  }
@@ -1981,7 +1969,7 @@ function re() {
1981
1969
  s || (s = !0, C.off(S.SNAPSHOT, c), D("socket", "client_ready re-emit timed out waiting for snapshot", { mediaId: f }));
1982
1970
  }, 1e4);
1983
1971
  }
1984
- Mt = { name: r.name, sprite: r.sprite }, C.emit(S.JOIN, r), window.dispatchEvent(new CustomEvent("watchparty:socket-reconnect"));
1972
+ Rt = { name: r.name, sprite: r.sprite }, C.emit(S.JOIN, r), window.dispatchEvent(new CustomEvent("watchparty:socket-reconnect"));
1985
1973
  } else he && D("socket", "Reconnected — no join payload, not re-joining any room");
1986
1974
  he = !0;
1987
1975
  }), C.on("disconnect", (n) => {
@@ -1993,9 +1981,9 @@ function re() {
1993
1981
  function dt(e) {
1994
1982
  return e.play_state === "playing" || e.playing === !0;
1995
1983
  }
1996
- function Ti(e) {
1984
+ function Si(e) {
1997
1985
  e.on(S.SNAPSHOT, (t) => {
1998
- e.emit(Ma.SYNC), h.getState().applySnapshot({
1986
+ e.emit(Ra.SYNC), h.getState().applySnapshot({
1999
1987
  roomId: t.room_id ?? null,
2000
1988
  mediaId: t.media_id ?? null,
2001
1989
  playheadMs: t.playhead_ms || 0,
@@ -2003,7 +1991,7 @@ function Ti(e) {
2003
1991
  serverSeq: t.server_seq || 0,
2004
1992
  leaderId: t.leader_id || null
2005
1993
  }), h.getState().name || b("socket", "Deferring identity to presence event (snapshot carries no roster)");
2006
- const a = h.getState(), n = C?.id, r = (n ? a.roster[n] : void 0) ?? Mt, f = Vn(
1994
+ const a = h.getState(), n = C?.id, r = (n ? a.roster[n] : void 0) ?? Rt, f = Jn(
2007
1995
  { name: a.name, avatarId: a.sprite },
2008
1996
  r ? { name: r.name, avatarId: r.sprite ?? null } : void 0,
2009
1997
  // A join that carried no name counts as a default one, so a name that
@@ -2013,7 +2001,7 @@ function Ti(e) {
2013
2001
  if (f) {
2014
2002
  const s = {
2015
2003
  ...f.name !== void 0 ? { name: f.name } : {},
2016
- ...f.avatarId !== void 0 && !Dt ? { sprite: f.avatarId } : {}
2004
+ ...f.avatarId !== void 0 && !Mt ? { sprite: f.avatarId } : {}
2017
2005
  };
2018
2006
  Object.keys(s).length > 0 && (b("socket", "Identity update on snapshot", s), e.emit(S.IDENTITY_UPDATE, s));
2019
2007
  }
@@ -2056,11 +2044,11 @@ function Ti(e) {
2056
2044
  h.getState().setReadiness({ mediaId: a, ready: r, readyCount: n, total: o }), b("socket", "Ready state received", { mediaId: a, readyCount: n, total: o, ready: r });
2057
2045
  });
2058
2046
  }
2059
- function Ci(e) {
2047
+ function Ti(e) {
2060
2048
  const t = Un(e);
2061
2049
  return t ? { cosmetics: t } : {};
2062
2050
  }
2063
- function Ii(e) {
2051
+ function Ci(e) {
2064
2052
  e.on(S.PRESENCE, (t) => {
2065
2053
  if (!t) return;
2066
2054
  if (Array.isArray(t.users)) {
@@ -2074,7 +2062,7 @@ function Ii(e) {
2074
2062
  isLeader: s.is_leader,
2075
2063
  ...s.registry_name ? { registryName: !0 } : {},
2076
2064
  ...s.avatar_url ? { avatarUrl: s.avatar_url } : {},
2077
- ...Ci(s.cosmetics)
2065
+ ...Ti(s.cosmetics)
2078
2066
  };
2079
2067
  const o = h.getState(), r = C?.id, f = r ? n[r] : void 0;
2080
2068
  if (f?.registryName)
@@ -2082,7 +2070,7 @@ function Ii(e) {
2082
2070
  else if (r && n[r]) {
2083
2071
  const s = n[r].name, c = n[r].sprite;
2084
2072
  if (o.name && !le(o.name) && (n[r].name = o.name), h.setState({ roster: n }), c && c !== o.sprite) {
2085
- const g = o.name && !le(o.name), m = g ? o.name : ke(c);
2073
+ const g = o.name && !le(o.name), m = g ? o.name : ve(c);
2086
2074
  b("socket", "Server reassigned sprite", { from: o.sprite, to: c, newName: m, preservingCustomName: g }), h.getState().setSessionIdentity(m, c), m !== s && e.emit(S.IDENTITY_UPDATE, { name: m });
2087
2075
  }
2088
2076
  }
@@ -2096,18 +2084,18 @@ function Ii(e) {
2096
2084
  }
2097
2085
  });
2098
2086
  }
2099
- function Ei(e) {
2100
- e.on(Re.STATE, (t) => {
2087
+ function Ii(e) {
2088
+ e.on(Pe.STATE, (t) => {
2101
2089
  h.getState().applyPlaylistState({
2102
2090
  playlist: t?.playlist ?? null,
2103
2091
  activeIndex: t?.activeIndex ?? null,
2104
2092
  myVotes: t?.myVotes ?? {}
2105
2093
  }), b("playlist", "Playlist state received", { playlistId: t?.playlist?.id ?? null, activeIndex: t?.activeIndex, myVoteCount: Object.keys(t?.myVotes || {}).length });
2106
- }), e.on(Re.VOTE_PROGRESS, (t) => {
2094
+ }), e.on(Pe.VOTE_PROGRESS, (t) => {
2107
2095
  h.getState().setVoteProgress(t?.progress ?? []), b("playlist", "Vote progress", { progressCount: t?.progress?.length });
2108
- }), e.on(Re.RESULTS, (t) => {
2096
+ }), e.on(Pe.RESULTS, (t) => {
2109
2097
  h.getState().setPlaylistResults(t ?? null), b("playlist", "Results received", { playlistId: t?.playlist?.id, update: t?.update === !0 });
2110
- }), e.on(Re.VOTES_CLEARED, (t) => {
2098
+ }), e.on(Pe.VOTES_CLEARED, (t) => {
2111
2099
  if (!t?.playlistId || !Array.isArray(t.mediaIds)) return;
2112
2100
  const a = gi(
2113
2101
  { id: t.playlistId, videos: t.mediaIds.map((o) => ({ mediaId: o })) },
@@ -2116,25 +2104,25 @@ function Ei(e) {
2116
2104
  n.playlist?.id === t.playlistId && n.applyPlaylistState({ playlist: n.playlist, activeIndex: n.activePlaylistIndex, myVotes: {} }), b("playlist", "Votes cleared by leader", { playlistId: t.playlistId, removed: a });
2117
2105
  });
2118
2106
  }
2119
- function Ai(e) {
2120
- e.on(bo.UPDATED, () => {
2107
+ function Ei(e) {
2108
+ e.on(_o.UPDATED, () => {
2121
2109
  b("tierlist", "Someone saved — refreshing the board"), Vr(!1);
2122
2110
  });
2123
2111
  }
2124
- function Ni(e) {
2125
- e.on(yo.STATE, (t) => {
2112
+ function Ai(e) {
2113
+ e.on(wo.STATE, (t) => {
2126
2114
  if (!t || typeof t.active != "boolean") return;
2127
2115
  const a = Array.isArray(t.ready) ? t.ready.filter((n) => typeof n == "string") : [];
2128
2116
  h.getState().setReadyCheckState({ active: t.active, ready: a }), b("ready-check", "State received", { active: t.active, readyCount: a.length });
2129
2117
  });
2130
2118
  }
2131
- function ji(e) {
2132
- e.on(Ma.ACTIVE, (t) => {
2119
+ function Ni(e) {
2120
+ e.on(Ra.ACTIVE, (t) => {
2133
2121
  const a = typeof t?.gameId == "string" ? t.gameId : null;
2134
2122
  h.getState().setActiveGameId(a), b("game", "game_active", { gameId: a });
2135
2123
  });
2136
2124
  }
2137
- function Ri(e) {
2125
+ function ji(e) {
2138
2126
  e.on(S.HEALTH_SNAPSHOT, (t) => {
2139
2127
  h.getState().setHealthSnapshot(t);
2140
2128
  }), e.on(S.BUFFER_STATUS, (t) => {
@@ -2142,10 +2130,10 @@ function Ri(e) {
2142
2130
  });
2143
2131
  }
2144
2132
  function Pi(e) {
2145
- Ti(e), Ii(e), un(e, () => !Ie()), Ri(e), Ei(e), Ai(e), Ni(e), ji(e), e.on(S.ERROR, (t) => {
2133
+ Si(e), Ci(e), un(e, () => !Ie()), ji(e), Ii(e), Ei(e), Ai(e), Ni(e), e.on(S.ERROR, (t) => {
2146
2134
  const a = t?.code || "error/unknown";
2147
2135
  if (a === "conflict" && t?.message === "sprite_held_by_you") {
2148
- Dt = !0, b("socket", "sprite held by this account's other connection: keeping the server-assigned sprite");
2136
+ Mt = !0, b("socket", "sprite held by this account's other connection: keeping the server-assigned sprite");
2149
2137
  return;
2150
2138
  }
2151
2139
  if (a === "conflict" && t?.message === "sprite_taken") {
@@ -2187,7 +2175,7 @@ function Pi(e) {
2187
2175
  (a.startsWith("auth/") ? D : Fe)("socket", `Server error: ${o}`, { code: a, raw: t }), h.getState().pushToast("error", o);
2188
2176
  });
2189
2177
  }
2190
- function Mi(e, t, a) {
2178
+ function Ri(e, t, a) {
2191
2179
  const n = {
2192
2180
  text: e,
2193
2181
  ...t?.length ? { images: t } : {},
@@ -2195,15 +2183,15 @@ function Mi(e, t, a) {
2195
2183
  };
2196
2184
  Ie() ? Fr(n) : re().emit(S.CHAT_SEND, n);
2197
2185
  }
2198
- function Di(e, t, a) {
2186
+ function Mi(e, t, a) {
2199
2187
  const n = { id: e, emoji: t, on: a };
2200
2188
  Ie() ? ln(S.CHAT_REACT, n) : re().emit(S.CHAT_REACT, n);
2201
2189
  }
2202
- function Li(e) {
2190
+ function Di(e) {
2203
2191
  const t = { typing: e };
2204
2192
  Ie() ? ln(S.CHAT_TYPING, t) : C?.connected && C.emit(S.CHAT_TYPING, t);
2205
2193
  }
2206
- function Oi() {
2194
+ function Li() {
2207
2195
  G || (G = { ts: Date.now() }, re().emit(S.TIME_PING, {}), K = setTimeout(() => {
2208
2196
  G && (b("socket", "Time ping timed out after 10s, clearing inflight"), G = null), K = null;
2209
2197
  }, 1e4));
@@ -2211,22 +2199,22 @@ function Oi() {
2211
2199
  function pn(e) {
2212
2200
  const t = h.getState(), a = t.me.clientId;
2213
2201
  if (!a || !t.roster[a]) {
2214
- ra(e), b("socket", "Avatar change before join: the join will carry it", { sprite: e });
2202
+ oa(e), b("socket", "Avatar change before join: the join will carry it", { sprite: e });
2215
2203
  return;
2216
2204
  }
2217
2205
  Se = !0;
2218
2206
  try {
2219
- ra(e);
2207
+ oa(e);
2220
2208
  } finally {
2221
2209
  Se = !1;
2222
2210
  }
2223
2211
  const n = h.getState(), o = { avatar: !0 };
2224
2212
  n.sprite && n.sprite !== t.sprite && (o.sprite = n.sprite), n.name && n.name !== t.name && (o.name = n.name), b("socket", "Sending avatar change", o), re().emit(S.IDENTITY_UPDATE, o);
2225
2213
  }
2226
- function qi(e) {
2227
- h.getState().me.clientId && Hi(e);
2214
+ function Oi(e) {
2215
+ h.getState().me.clientId && qi(e);
2228
2216
  }
2229
- function Hi(e, t) {
2217
+ function qi(e, t) {
2230
2218
  const a = {};
2231
2219
  e && (a.name = e), !(!a.name && !a.sprite) && (b("socket", "Sending identity update", a), re().emit(S.IDENTITY_UPDATE, a));
2232
2220
  }
@@ -2242,14 +2230,14 @@ h.subscribe((e, t) => {
2242
2230
  const f = {};
2243
2231
  o && (f.name = e.name, Oe.name = e.name), r && (f.sprite = e.sprite, Oe.sprite = e.sprite), b("socket", "Identity reassert (store change)", f), C?.connected ? C.emit(S.IDENTITY_UPDATE, f) : re().emit(S.IDENTITY_UPDATE, f);
2244
2232
  });
2245
- function Ui() {
2233
+ function Hi() {
2246
2234
  Be && (clearInterval(Be), Be = null), K && (clearTimeout(K), K = null), G = null, de.unansweredSince = null, de.lastTickAt = null;
2247
2235
  }
2248
- function $i() {
2236
+ function Ui() {
2249
2237
  b("socket", "clearJoinState called", { hadPayload: ee !== null, room_key: ee?.room_key }), ee = null, he = !1, hn = null;
2250
2238
  }
2251
- function sa() {
2252
- b("socket", "leaveRoom called", { room_key: ee?.room_key }), $i(), Ui(), cn(), C && (C.disconnect(), C = null), h.setState({
2239
+ function fa() {
2240
+ b("socket", "leaveRoom called", { room_key: ee?.room_key }), Ui(), Hi(), cn(), C && (C.disconnect(), C = null), h.setState({
2253
2241
  me: { clientId: null, nextClientSeq: 1 },
2254
2242
  roster: {},
2255
2243
  snapshot: { roomId: null, mediaId: null, playheadMs: 0, playing: !1, serverSeq: 0, leaderId: null },
@@ -2267,31 +2255,31 @@ function sa() {
2267
2255
  activeGameId: null
2268
2256
  });
2269
2257
  }
2270
- function Fi() {
2258
+ function $i() {
2271
2259
  b("chat", "Emitting recap_request"), re().emit("recap_request");
2272
2260
  }
2273
- function zi() {
2274
- P(() => {
2275
- const e = to(), t = eo((n, o) => {
2261
+ function Fi() {
2262
+ R(() => {
2263
+ const e = no(), t = ao((n, o) => {
2276
2264
  const r = Zr(o);
2277
2265
  b("avatar", "Avatar changed in the settings popout", { sprite: r, source: o.avatar?.source }), pn(r);
2278
2266
  }), a = ni((n) => {
2279
- b("avatar", "Renamed in the settings popout", { name: n }), qi(n);
2267
+ b("avatar", "Renamed in the settings popout", { name: n }), Oi(n);
2280
2268
  });
2281
2269
  return () => {
2282
2270
  t(), a(), e();
2283
2271
  };
2284
2272
  }, []);
2285
2273
  }
2286
- function Wi(e, t) {
2274
+ function zi(e, t) {
2287
2275
  return (t ? zn(t) : null) ?? Qa(e);
2288
2276
  }
2289
2277
  function Ee(e, t) {
2290
- return P(() => {
2278
+ return R(() => {
2291
2279
  t && $n(t);
2292
- }, [t]), ya(Fn, () => Wi(e, t), () => Qa(e));
2280
+ }, [t]), ba(Fn, () => zi(e, t), () => Qa(e));
2293
2281
  }
2294
- function Bi(e, t) {
2282
+ function Wi(e, t) {
2295
2283
  if (t.clientId) {
2296
2284
  const a = e[t.clientId];
2297
2285
  if (a && (!t.author || !a.author || a.author === t.author)) return a;
@@ -2300,8 +2288,8 @@ function Bi(e, t) {
2300
2288
  for (const a of Object.values(e)) if (a.author === t.author) return a;
2301
2289
  }
2302
2290
  }
2303
- function Gi(e, t, a) {
2304
- const n = Bi(e, t);
2291
+ function Bi(e, t, a) {
2292
+ const n = Wi(e, t);
2305
2293
  return n ? {
2306
2294
  name: n.name || a.name,
2307
2295
  // A connection briefly without a character (a reconnect waiting for one to
@@ -2312,14 +2300,14 @@ function Gi(e, t, a) {
2312
2300
  here: !0
2313
2301
  } : { name: a.name, sprite: a.sprite, pictureUrl: a.pictureUrl, here: !1 };
2314
2302
  }
2315
- function Ki(e, t, a) {
2303
+ function Gi(e, t, a) {
2316
2304
  return !t || !a.here ? e : t.split(St).join(a.name);
2317
2305
  }
2318
2306
  function it(e, t) {
2319
- const a = h((n) => JSON.stringify(Gi(n.roster, e, t)));
2307
+ const a = h((n) => JSON.stringify(Bi(n.roster, e, t)));
2320
2308
  return F(() => JSON.parse(a), [a]);
2321
2309
  }
2322
- function Lt({ sprite: e, url: t, alt: a = "", className: n, style: o, fallback: r }) {
2310
+ function Dt({ sprite: e, url: t, alt: a = "", className: n, style: o, fallback: r }) {
2323
2311
  const [f, s] = N(null);
2324
2312
  if (t && t !== f)
2325
2313
  return /* @__PURE__ */ l(
@@ -2334,13 +2322,13 @@ function Lt({ sprite: e, url: t, alt: a = "", className: n, style: o, fallback:
2334
2322
  onError: () => s(t)
2335
2323
  }
2336
2324
  );
2337
- const c = vr(e);
2325
+ const c = kr(e);
2338
2326
  return c ? /* @__PURE__ */ l("img", { src: c, alt: a, crossOrigin: "anonymous", className: n, style: o, draggable: !1 }) : /* @__PURE__ */ l(te, { children: r });
2339
2327
  }
2340
2328
  function bn({ sprite: e, url: t, alt: a, worn: n }) {
2341
2329
  return /* @__PURE__ */ _("span", { className: "hc-av", style: { "--hc-sz": "32px" }, children: [
2342
2330
  /* @__PURE__ */ l("span", { className: "hc-pic", children: /* @__PURE__ */ l(
2343
- Lt,
2331
+ Dt,
2344
2332
  {
2345
2333
  sprite: e,
2346
2334
  url: t,
@@ -2352,18 +2340,18 @@ function bn({ sprite: e, url: t, alt: a, worn: n }) {
2352
2340
  n?.overlay && /* @__PURE__ */ l(we, { html: Wn(n), style: { display: "contents" } })
2353
2341
  ] });
2354
2342
  }
2355
- function Vi(e) {
2343
+ function Ki(e) {
2356
2344
  return !(e.button !== 0 || e.ctrlKey || e.metaKey || e.shiftKey || e.altKey);
2357
2345
  }
2358
- function Yi({ src: e, title: t, onClose: a }) {
2359
- P(() => {
2346
+ function Vi({ src: e, title: t, onClose: a }) {
2347
+ R(() => {
2360
2348
  const r = (f) => {
2361
2349
  at(f) && (f.stopPropagation(), a());
2362
2350
  };
2363
2351
  return document.addEventListener("keydown", r, !0), () => document.removeEventListener("keydown", r, !0);
2364
2352
  }, [a]);
2365
2353
  const n = za(), o = typeof document > "u" ? null : document.fullscreenElement ?? n ?? document.body;
2366
- return o ? xa(
2354
+ return o ? va(
2367
2355
  /* @__PURE__ */ _(
2368
2356
  "div",
2369
2357
  {
@@ -2401,11 +2389,11 @@ function Yi({ src: e, title: t, onClose: a }) {
2401
2389
  o
2402
2390
  ) : null;
2403
2391
  }
2404
- const ut = 240, Ji = 320;
2405
- function Xi({ image: e }) {
2392
+ const ut = 240, Yi = 320;
2393
+ function Ji({ image: e }) {
2406
2394
  const [t, a] = N(!1), n = Ke(e.key);
2407
2395
  if (!n) return null;
2408
- const o = e.w > 0 && e.h > 0, r = o ? Math.min(1, Ji / e.w, ut / e.h) : 1;
2396
+ const o = e.w > 0 && e.h > 0, r = o ? Math.min(1, Yi / e.w, ut / e.h) : 1;
2409
2397
  return /* @__PURE__ */ _(te, { children: [
2410
2398
  /* @__PURE__ */ l(
2411
2399
  "a",
@@ -2416,7 +2404,7 @@ function Xi({ image: e }) {
2416
2404
  className: "block max-w-full cursor-zoom-in",
2417
2405
  "data-testid": "chat-image",
2418
2406
  onClick: (f) => {
2419
- Vi(f) && (f.preventDefault(), a(!0));
2407
+ Ki(f) && (f.preventDefault(), a(!0));
2420
2408
  },
2421
2409
  children: /* @__PURE__ */ l(
2422
2410
  "img",
@@ -2434,7 +2422,7 @@ function Xi({ image: e }) {
2434
2422
  }
2435
2423
  ),
2436
2424
  t && /* @__PURE__ */ l(
2437
- Yi,
2425
+ Vi,
2438
2426
  {
2439
2427
  src: n,
2440
2428
  title: e.title,
@@ -2444,12 +2432,12 @@ function Xi({ image: e }) {
2444
2432
  ] });
2445
2433
  }
2446
2434
  function yn({ 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, a) => /* @__PURE__ */ l(Xi, { image: t }, `${t.key}-${a}`)) }) : null;
2435
+ return e?.length ? /* @__PURE__ */ l("div", { className: "flex flex-wrap gap-1 mt-1", "data-testid": "chat-images", children: e.map((t, a) => /* @__PURE__ */ l(Ji, { image: t }, `${t.key}-${a}`)) }) : null;
2448
2436
  }
2449
- function Qi(e, t) {
2437
+ function Xi(e, t) {
2450
2438
  return e.author && t.author ? e.author === t.author : !!t.clientId && e.clientId === t.clientId;
2451
2439
  }
2452
- const Zi = [
2440
+ const Qi = [
2453
2441
  { id: "smileys", label: "Smileys & Emotion", data: "1f600:grinning face:grinning|1f603:grinning face with big eyes:smiley|1f604:grinning face with smiling eyes:smile|1f601:beaming face with smiling eyes:grin|1f606:grinning squinting face:laughing,satisfied|1f605:grinning face with sweat:sweat_smile|1f923:rolling on the floor laughing:rofl|1f602:face with tears of joy:joy|1f642:slightly smiling face:slight_smile|1f643:upside-down face:upside_down|1fae0:melting face|1f609:winking face:wink|1f60a:smiling face with smiling eyes:blush|1f607:smiling face with halo:innocent|1f970:smiling face with hearts:smiling_face_with_3_hearts|1f60d:smiling face with heart-eyes:heart_eyes|1f929:star-struck|1f618:face blowing a kiss:kissing_heart|1f617:kissing face:kissing|263a-fe0f:smiling face:relaxed|1f61a:kissing face with closed eyes:kissing_closed_eyes|1f619:kissing face with smiling eyes:kissing_smiling_eyes|1f972:smiling face with tear|1f60b:face savoring food:yum|1f61b:face with tongue:stuck_out_tongue|1f61c:winking face with tongue:stuck_out_tongue_winking_eye|1f92a:zany face|1f61d:squinting face with tongue:stuck_out_tongue_closed_eyes|1f911:money-mouth face:money_mouth|1f917:smiling face with open hands:hugging,hugging_face|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:thinking|1fae1:saluting face|1f910:zipper-mouth face:zipper_mouth|1f928:face with raised eyebrow|1f610:neutral face|1f611:expressionless face:expressionless|1f636:face without mouth:no_mouth|1fae5:dotted line face|1f636-200d-1f32b-fe0f:face in clouds|1f60f:smirking face:smirk|1f612:unamused face:unamused|1f644:face with rolling eyes:rolling_eyes|1f62c:grimacing face:grimacing|1f62e-200d-1f4a8:face exhaling|1f925:lying face:liar|1fae8:shaking face|1f60c:relieved face:relieved|1f614:pensive face:pensive|1f62a:sleepy face:sleepy|1f924:drooling face:drool|1f634:sleeping face:sleeping|1f637:face with medical mask:mask|1f912:face with thermometer:thermometer_face|1f915:face with head-bandage:head_bandage|1f922:nauseated face:sick|1f92e:face vomiting|1f927:sneezing face:sneeze|1f975:hot face|1f976:cold face|1f974:woozy face|1f635:face with crossed-out eyes:dizzy_face|1f635-200d-1f4ab:face with spiral eyes|1f92f:exploding head|1f920:cowboy hat face:cowboy,face_with_cowboy_hat|1f973:partying face|1f978:disguised face|1f60e:smiling face with sunglasses:sunglasses|1f913:nerd face:nerd|1f9d0:face with monocle|1f615:confused face:confused|1fae4:face with diagonal mouth|1f61f:worried face:worried|1f641:slightly frowning face:slight_frown|2639-fe0f:frowning face:frowning2,white_frowning_face|1f62e:face with open mouth:open_mouth|1f62f:hushed face:hushed|1f632:astonished face:astonished|1f633:flushed face:flushed|1f97a:pleading face|1f979:face holding back tears|1f626:frowning face with open mouth:frowning|1f627:anguished face:anguished|1f628:fearful face:fearful|1f630:anxious face with sweat:cold_sweat|1f625:sad but relieved face:disappointed_relieved|1f622:crying face:cry|1f62d:loudly crying face:sob|1f631:face screaming in fear:scream|1f616:confounded face:confounded|1f623:persevering face:persevere|1f61e:disappointed face:disappointed|1f613:downcast face with sweat:sweat|1f629:weary face:weary|1f62b:tired face|1f971:yawning face|1f624:face with steam from nose:triumph|1f621:enraged face:rage,pouting_face|1f620:angry face:angry|1f92c:face with symbols on mouth:face_with_symbols_over_mouth|1f608:smiling face with horns:smiling_imp|1f47f:angry face with horns:imp|1f480:skull:skeleton|2620-fe0f:skull and crossbones:skull_crossbones|1f4a9:pile of poo:poop,shit,hankey,poo|1f921:clown face:clown|1f479:ogre:japanese_ogre|1f47a:goblin:japanese_goblin|1f47b:ghost|1f47d:alien|1f47e:alien monster:space_invader|1f916:robot:robot_face|1f63a:grinning cat:smiley_cat|1f638:grinning cat with smiling eyes:smile_cat|1f639:cat with tears of joy:joy_cat|1f63b:smiling cat with heart-eyes:heart_eyes_cat|1f63c:cat with wry smile:smirk_cat|1f63d:kissing cat|1f640:weary cat:scream_cat|1f63f:crying cat:crying_cat_face|1f63e:pouting cat|1f648:see-no-evil monkey:see_no_evil|1f649:hear-no-evil monkey:hear_no_evil|1f64a:speak-no-evil monkey:speak_no_evil|1f48c:love letter|1f498:heart with arrow:cupid|1f49d:heart with ribbon:gift_heart|1f496:sparkling heart|1f497:growing heart:heartpulse|1f493:beating heart:heartbeat|1f49e:revolving hearts|1f495:two hearts|1f49f:heart decoration|2763-fe0f:heart exclamation:heavy_heart_exclamation_mark_ornament|1f494:broken heart|2764-fe0f-200d-1f525:heart on fire|2764-fe0f-200d-1fa79:mending heart|2764-fe0f:red heart: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:kiss|1f4af:hundred points:100|1f4a2:anger symbol:anger|1f4a5:collision:boom|1f4ab:dizzy|1f4a6:sweat droplets:sweat_drops|1f4a8:dashing away:dash|1f573-fe0f:hole|1f4ac:speech balloon|1f441-fe0f-200d-1f5e8-fe0f:eye in speech bubble|1f5e8-fe0f:left speech bubble:speech_left|1f5ef-fe0f:right anger bubble:anger_right|1f4ad:thought balloon|1f4a4:zzz" },
2454
2442
  { id: "people", label: "People & Body", data: "1f44b:waving hand:wave|1f91a:raised back of hand:back_of_hand|1f590-fe0f:hand with fingers splayed:hand_splayed,raised_hand_with_fingers_splayed|270b:raised hand|1f596:vulcan salute:vulcan,raised_hand_with_part_between_middle_and_ring_fingers|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:v|1f91e:crossed fingers:fingers_crossed,hand_with_index_and_middle_finger_crossed|1faf0:hand with index finger and thumb crossed|1f91f:love-you gesture|1f918:sign of the horns:metal|1f919:call me hand:call_me|1f448:backhand index pointing left:point_left|1f449:backhand index pointing right:point_right|1f446:backhand index pointing up:point_up_2|1f595:middle finger:reversed_hand_with_middle_finger_extended|1f447:backhand index pointing down:point_down|261d-fe0f:index pointing up:point_up|1faf5:index pointing at the viewer|1f44d:thumbs up:thumbsup,+1,thumbup|1f44e:thumbs down:thumbsdown,-1,thumbdown|270a:raised fist:fist|1f44a:oncoming fist:punch|1f91b:left-facing fist:left_fist|1f91c:right-facing fist:right_fist|1f44f:clapping hands:clap|1f64c:raising hands:raised_hands|1faf6:heart hands|1f450:open hands|1f932:palms up together|1f91d:handshake:shaking_hands|1f64f:folded hands:pray|270d-fe0f:writing hand|1f485:nail polish:nail_care|1f933:selfie|1f4aa:flexed biceps:muscle|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:lips|1fae6:biting lip|1f476:baby|1f9d2:child|1f466:boy|1f467:girl|1f9d1:person:adult|1f471:person blond hair:blond_haired_person,person_with_blond_hair|1f468:man|1f9d4:person beard:bearded_person|1f9d4-200d-2642-fe0f:man beard|1f9d4-200d-2640-fe0f:woman beard|1f468-200d-1f9b0:man red hair:man_red_haired|1f468-200d-1f9b1:man curly hair:man_curly_haired|1f468-200d-1f9b3:man white hair:man_white_haired|1f468-200d-1f9b2:man bald|1f469:woman|1f469-200d-1f9b0:woman red hair:woman_red_haired|1f9d1-200d-1f9b0:person red hair|1f469-200d-1f9b1:woman curly hair:woman_curly_haired|1f9d1-200d-1f9b1:person curly hair|1f469-200d-1f9b3:woman white hair:woman_white_haired|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:older_adult|1f474:old man:older_man|1f475:old woman:older_woman,grandma|1f64d:person frowning|1f64d-200d-2642-fe0f:man frowning|1f64d-200d-2640-fe0f:woman frowning|1f64e:person pouting:person_with_pouting_face|1f64e-200d-2642-fe0f:man pouting|1f64e-200d-2640-fe0f:woman pouting|1f645:person gesturing no:no_good|1f645-200d-2642-fe0f:man gesturing no|1f645-200d-2640-fe0f:woman gesturing no|1f646:person gesturing ok:ok_woman|1f646-200d-2642-fe0f:man gesturing ok|1f646-200d-2640-fe0f:woman gesturing ok|1f481:person tipping hand:information_desk_person|1f481-200d-2642-fe0f:man tipping hand|1f481-200d-2640-fe0f:woman tipping hand|1f64b:person raising hand: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:bow|1f647-200d-2642-fe0f:man bowing|1f647-200d-2640-fe0f:woman bowing|1f926:person facepalming:face_palm,facepalm|1f926-200d-2642-fe0f:man facepalming|1f926-200d-2640-fe0f:woman facepalming|1f937:person shrugging:shrug|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:cop|1f46e-200d-2642-fe0f:man police officer|1f46e-200d-2640-fe0f:woman police officer|1f575-fe0f:detective:spy,sleuth_or_spy|1f575-fe0f-200d-2642-fe0f:man detective|1f575-fe0f-200d-2640-fe0f:woman detective|1f482:guard:guardsman|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:man_with_turban|1f473-200d-2642-fe0f:man wearing turban|1f473-200d-2640-fe0f:woman wearing turban|1f472:person with skullcap:man_with_chinese_cap,man_with_gua_pi_mao|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:expecting_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:angel|1f385:santa claus:santa|1f936:mrs. claus:mother_christmas|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:massage|1f486-200d-2642-fe0f:man getting massage|1f486-200d-2640-fe0f:woman getting massage|1f487:person getting haircut:haircut|1f487-200d-2642-fe0f:man getting haircut|1f487-200d-2640-fe0f:woman getting haircut|1f6b6:person walking: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:person_with_probing_cane|1f468-200d-1f9af:man with white cane:man_with_probing_cane|1f469-200d-1f9af:woman with white cane:woman_with_probing_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:runner|1f3c3-200d-2642-fe0f:man running|1f3c3-200d-2640-fe0f:woman running|1f483:woman dancing:dancer|1f57a:man dancing:male_dancer|1f574-fe0f:person in suit levitating:levitate,man_in_business_suit_levitating|1f46f:people with bunny ears:people_with_bunny_ears_partying,dancers|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:fencer,fencing|1f3c7:horse racing|26f7-fe0f:skier|1f3c2:snowboarder|1f3cc-fe0f:person golfing:golfer|1f3cc-fe0f-200d-2642-fe0f:man golfing|1f3cc-fe0f-200d-2640-fe0f:woman golfing|1f3c4:person surfing:surfer|1f3c4-200d-2642-fe0f:man surfing|1f3c4-200d-2640-fe0f:woman surfing|1f6a3:person rowing boat:rowboat|1f6a3-200d-2642-fe0f:man rowing boat|1f6a3-200d-2640-fe0f:woman rowing boat|1f3ca:person swimming:swimmer|1f3ca-200d-2642-fe0f:man swimming|1f3ca-200d-2640-fe0f:woman swimming|26f9-fe0f:person bouncing ball:basketball_player,person_with_ball|26f9-fe0f-200d-2642-fe0f:man bouncing ball|26f9-fe0f-200d-2640-fe0f:woman bouncing ball|1f3cb-fe0f:person lifting weights:lifter,weight_lifter|1f3cb-fe0f-200d-2642-fe0f:man lifting weights|1f3cb-fe0f-200d-2640-fe0f:woman lifting weights|1f6b4:person biking:bicyclist|1f6b4-200d-2642-fe0f:man biking|1f6b4-200d-2640-fe0f:woman biking|1f6b5:person mountain biking:mountain_bicyclist|1f6b5-200d-2642-fe0f:man mountain biking|1f6b5-200d-2640-fe0f:woman mountain biking|1f938:person cartwheeling:person_doing_cartwheel,cartwheel|1f938-200d-2642-fe0f:man cartwheeling|1f938-200d-2640-fe0f:woman cartwheeling|1f93c:people wrestling:wrestlers,wrestling|1f93c-200d-2642-fe0f:men wrestling|1f93c-200d-2640-fe0f:women wrestling|1f93d:person playing water polo:water_polo|1f93d-200d-2642-fe0f:man playing water polo|1f93d-200d-2640-fe0f:woman playing water polo|1f93e:person playing handball:handball|1f93e-200d-2642-fe0f:man playing handball|1f93e-200d-2640-fe0f:woman playing handball|1f939:person juggling:juggling,juggler|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:bath|1f6cc:person in bed:sleeping_accommodation|1f9d1-200d-1f91d-200d-1f9d1:people holding hands|1f46d:women holding hands:two_women_holding_hands|1f46b:woman and man holding hands:couple|1f46c:men holding hands:two_men_holding_hands|1f48f:kiss:couplekiss|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:family_mwg|1f468-200d-1f469-200d-1f467-200d-1f466:family man, woman, girl, boy:family_mwgb|1f468-200d-1f469-200d-1f466-200d-1f466:family man, woman, boy, boy:family_mwbb|1f468-200d-1f469-200d-1f467-200d-1f467:family man, woman, girl, girl:family_mwgg|1f468-200d-1f468-200d-1f466:family man, man, boy:family_mmb|1f468-200d-1f468-200d-1f467:family man, man, girl:family_mmg|1f468-200d-1f468-200d-1f467-200d-1f466:family man, man, girl, boy:family_mmgb|1f468-200d-1f468-200d-1f466-200d-1f466:family man, man, boy, boy:family_mmbb|1f468-200d-1f468-200d-1f467-200d-1f467:family man, man, girl, girl:family_mmgg|1f469-200d-1f469-200d-1f466:family woman, woman, boy:family_wwb|1f469-200d-1f469-200d-1f467:family woman, woman, girl:family_wwg|1f469-200d-1f469-200d-1f467-200d-1f466:family woman, woman, girl, boy:family_wwgb|1f469-200d-1f469-200d-1f466-200d-1f466:family woman, woman, boy, boy:family_wwbb|1f469-200d-1f469-200d-1f467-200d-1f467:family woman, woman, girl, girl:family_wwgg|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:speaking_head_in_silhouette|1f464:bust in silhouette|1f465:busts in silhouette|1fac2:people hugging|1f46a:family|1f463:footprints" },
2455
2443
  { id: "nature", label: "Animals & Nature", data: "1f435:monkey face|1f412:monkey|1f98d:gorilla|1f9a7:orangutan|1f436:dog face:dog|1f415:dog:dog2|1f9ae:guide dog|1f415-200d-1f9ba:service dog|1f429:poodle|1f43a:wolf|1f98a:fox:fox_face|1f99d:raccoon|1f431:cat face:cat|1f408:cat:cat2|1f408-200d-2b1b:black cat|1f981:lion:lion_face|1f42f:tiger face:tiger|1f405:tiger:tiger2|1f406:leopard|1f434:horse face:horse|1face:moose|1facf:donkey|1f40e:horse:racehorse|1f984:unicorn:unicorn_face|1f993:zebra|1f98c:deer|1f9ac:bison|1f42e:cow face:cow|1f402:ox|1f403:water buffalo|1f404:cow:cow2|1f437:pig face:pig|1f416:pig:pig2|1f417:boar|1f43d:pig nose|1f40f:ram|1f411:ewe:sheep|1f410:goat|1f42a:camel:dromedary_camel|1f42b:two-hump camel:camel|1f999:llama|1f992:giraffe|1f418:elephant|1f9a3:mammoth|1f98f:rhinoceros:rhino|1f99b:hippopotamus|1f42d:mouse face:mouse|1f401:mouse:mouse2|1f400:rat|1f439:hamster|1f430:rabbit face:rabbit|1f407:rabbit:rabbit2|1f43f-fe0f:chipmunk|1f9ab:beaver|1f994:hedgehog|1f987:bat|1f43b:bear|1f43b-200d-2744-fe0f:polar bear|1f428:koala|1f43c:panda:panda_face|1f9a5:sloth|1f9a6:otter|1f9a8:skunk|1f998:kangaroo|1f9a1:badger|1f43e:paw prints:feet|1f983:turkey|1f414:chicken|1f413:rooster|1f423:hatching chick|1f424:baby chick|1f425:front-facing baby chick:hatched_chick|1f426:bird|1f427:penguin|1f54a-fe0f:dove:dove_of_peace|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:whale|1f40b:whale:whale2|1f42c:dolphin|1f9ad:seal|1f41f:fish|1f420:tropical fish|1f421:blowfish|1f988:shark|1f419:octopus|1f41a:spiral shell: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:bee|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:wilted_rose|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:ear_of_rice|1f33f:herb|2618-fe0f:shamrock|1f340:four leaf clover|1f341:maple leaf|1f342:fallen leaf|1f343:leaf fluttering in wind:leaves|1fab9:empty nest|1faba:nest with eggs|1f344:mushroom" },
@@ -2460,16 +2448,16 @@ const Zi = [
2460
2448
  { id: "symbols", label: "Symbols", data: "1f3e7:atm sign:atm|1f6ae:litter in bin sign:put_litter_in_its_place|1f6b0:potable water|267f:wheelchair symbol:wheelchair|1f6b9:men’s room:mens,mens_room|1f6ba:women’s room:womens,womens_room|1f6bb:restroom|1f6bc:baby symbol|1f6be:water closet:wc|1f6c2:passport control|1f6c3:customs|1f6c4:baggage claim|1f6c5:left luggage|26a0-fe0f:warning|1f6b8:children crossing|26d4:no entry|1f6ab:prohibited:no_entry_sign|1f6b3:no bicycles|1f6ad:no smoking|1f6af:no littering:do_not_litter|1f6b1:non-potable water:non-potable_water|1f6b7:no pedestrians|1f4f5:no mobile phones|1f51e:no one under eighteen:underage|2622-fe0f:radioactive:radioactive_sign|2623-fe0f:biohazard:biohazard_sign|2b06-fe0f:up arrow:arrow_up|2197-fe0f:up-right arrow:arrow_upper_right|27a1-fe0f:right arrow:arrow_right|2198-fe0f:down-right arrow:arrow_lower_right|2b07-fe0f:down arrow:arrow_down|2199-fe0f:down-left arrow:arrow_lower_left|2b05-fe0f:left arrow:arrow_left|2196-fe0f:up-left arrow:arrow_upper_left|2195-fe0f:up-down arrow:arrow_up_down|2194-fe0f:left-right arrow|21a9-fe0f:right arrow curving left:leftwards_arrow_with_hook|21aa-fe0f:left arrow curving right:arrow_right_hook|2934-fe0f:right arrow curving up:arrow_heading_up|2935-fe0f:right arrow curving down:arrow_heading_down|1f503:clockwise vertical arrows:arrows_clockwise|1f504:counterclockwise arrows button:arrows_counterclockwise|1f519:back arrow:back|1f51a:end arrow:end|1f51b:on! arrow:on|1f51c:soon arrow:soon|1f51d:top arrow:top|1f6d0:place of worship:worship_symbol|269b-fe0f:atom symbol:atom|1f549-fe0f:om:om_symbol|2721-fe0f:star of david|2638-fe0f:wheel of dharma|262f-fe0f:yin yang|271d-fe0f:latin cross:cross|2626-fe0f:orthodox cross|262a-fe0f:star and crescent|262e-fe0f:peace symbol:peace|1f54e:menorah|1f52f:dotted six-pointed star:six_pointed_star|1faaf:khanda|2648:aries|2649:taurus|264a:gemini|264b:cancer|264c:leo|264d:virgo|264e:libra|264f:scorpio:scorpius|2650:sagittarius|2651:capricorn|2652:aquarius|2653:pisces|26ce:ophiuchus|1f500:shuffle tracks button:twisted_rightwards_arrows|1f501:repeat button:repeat|1f502:repeat single button:repeat_one|25b6-fe0f:play button:arrow_forward|23e9:fast-forward button:fast_forward|23ed-fe0f:next track button:track_next,next_track|23ef-fe0f:play or pause button:play_pause|25c0-fe0f:reverse button:arrow_backward|23ea:fast reverse button:rewind|23ee-fe0f:last track button:track_previous,previous_track|1f53c:upwards button:arrow_up_small|23eb:fast up button:arrow_double_up|1f53d:downwards button:arrow_down_small|23ec:fast down button:arrow_double_down|23f8-fe0f:pause button:double_vertical_bar|23f9-fe0f:stop button|23fa-fe0f:record button|23cf-fe0f:eject button:eject,eject_symbol|1f3a6:cinema|1f505:dim button:low_brightness|1f506:bright button:high_brightness|1f4f6:antenna bars:signal_strength|1f6dc:wireless|1f4f3:vibration mode|1f4f4:mobile phone off|2640-fe0f:female sign|2642-fe0f:male sign|26a7-fe0f:transgender symbol|2716-fe0f:multiply:heavy_multiplication_x|2795:plus:heavy_plus_sign|2796:minus:heavy_minus_sign|2797:divide:heavy_division_sign|1f7f0:heavy equals sign|267e-fe0f:infinity|203c-fe0f:double exclamation mark:bangbang|2049-fe0f:exclamation question mark:interrobang|2753:red question mark:question,question_mark|2754:white question mark:grey_question|2755:white exclamation mark:grey_exclamation|2757:red exclamation mark:exclamation|3030-fe0f:wavy dash|1f4b1:currency exchange|1f4b2:heavy dollar sign|2695-fe0f:medical symbol|267b-fe0f:recycling symbol:recycle|269c-fe0f:fleur-de-lis:fleur-de-lis|1f531:trident emblem:trident|1f4db:name badge|1f530:japanese symbol for beginner:beginner|2b55:hollow red circle:o|2705:check mark button:white_check_mark|2611-fe0f:check box with check:ballot_box_with_check|2714-fe0f:check mark:heavy_check_mark|274c:cross mark:x|274e:cross mark button:negative_squared_cross_mark|27b0:curly loop|27bf:double curly loop:loop|303d-fe0f:part alternation mark|2733-fe0f:eight-spoked asterisk|2734-fe0f:eight-pointed star:eight_pointed_black_star|2747-fe0f:sparkle|00a9-fe0f:copyright|00ae-fe0f:registered|2122-fe0f:trade mark:tm|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:keycap_ten|1f520:input latin uppercase:capital_abcd|1f521:input latin lowercase:abcd|1f522:input numbers:1234|1f523:input symbols:symbols|1f524:input latin letters:abc|1f170-fe0f:a button (blood type):a|1f18e:ab button (blood type):ab|1f171-fe0f:b button (blood type):b|1f191:cl button:cl|1f192:cool button:cool|1f193:free button:free|2139-fe0f:information:information_source|1f194:id button:id|24c2-fe0f:circled m:m|1f195:new button:new|1f196:ng button:ng|1f17e-fe0f:o button (blood type):o2|1f197:ok button:ok|1f17f-fe0f:p button:parking|1f198:sos button:sos|1f199:up! button:up|1f19a:vs button:vs|1f201:japanese “here” button:koko|1f202-fe0f:japanese “service charge” button:sa|1f237-fe0f:japanese “monthly amount” button:u6708|1f236:japanese “not free of charge” button:u6709|1f22f:japanese “reserved” button:u6307|1f250:japanese “bargain” button:ideograph_advantage|1f239:japanese “discount” button:u5272|1f21a:japanese “free of charge” button:u7121|1f232:japanese “prohibited” button:u7981|1f251:japanese “acceptable” button:accept|1f238:japanese “application” button:u7533|1f234:japanese “passing grade” button:u5408|1f233:japanese “vacancy” button:u7a7a|3297-fe0f:japanese “congratulations” button:congratulations|3299-fe0f:japanese “secret” button:secret|1f23a:japanese “open for business” button:u55b6|1f235:japanese “no vacancy” button:u6e80|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:small_red_triangle|1f53b:red triangle pointed down:small_red_triangle_down|1f4a0:diamond with a dot:diamond_shape_with_a_dot_inside|1f518:radio button|1f533:white square button|1f532:black square button" },
2461
2449
  { id: "flags", label: "Flags", data: "1f3c1:chequered flag:checkered_flag|1f6a9:triangular flag:triangular_flag_on_post|1f38c:crossed flags|1f3f4:black flag:flag_black,waving_black_flag|1f3f3-fe0f:white flag:flag_white,waving_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:flag_ac|1f1e6-1f1e9:flag andorra:flag_ad|1f1e6-1f1ea:flag united arab emirates:flag_ae|1f1e6-1f1eb:flag afghanistan:flag_af|1f1e6-1f1ec:flag antigua & barbuda:flag_ag|1f1e6-1f1ee:flag anguilla:flag_ai|1f1e6-1f1f1:flag albania:flag_al|1f1e6-1f1f2:flag armenia:flag_am|1f1e6-1f1f4:flag angola:flag_ao|1f1e6-1f1f6:flag antarctica:flag_aq|1f1e6-1f1f7:flag argentina:flag_ar|1f1e6-1f1f8:flag american samoa:flag_as|1f1e6-1f1f9:flag austria:flag_at|1f1e6-1f1fa:flag australia:flag_au|1f1e6-1f1fc:flag aruba:flag_aw|1f1e6-1f1fd:flag åland islands:flag_ax|1f1e6-1f1ff:flag azerbaijan:flag_az|1f1e7-1f1e6:flag bosnia & herzegovina:flag_ba|1f1e7-1f1e7:flag barbados:flag_bb|1f1e7-1f1e9:flag bangladesh:flag_bd|1f1e7-1f1ea:flag belgium:flag_be|1f1e7-1f1eb:flag burkina faso:flag_bf|1f1e7-1f1ec:flag bulgaria:flag_bg|1f1e7-1f1ed:flag bahrain:flag_bh|1f1e7-1f1ee:flag burundi:flag_bi|1f1e7-1f1ef:flag benin:flag_bj|1f1e7-1f1f1:flag st. barthélemy:flag_bl|1f1e7-1f1f2:flag bermuda:flag_bm|1f1e7-1f1f3:flag brunei:flag_bn|1f1e7-1f1f4:flag bolivia:flag_bo|1f1e7-1f1f6:flag caribbean netherlands:flag_bq|1f1e7-1f1f7:flag brazil:flag_br|1f1e7-1f1f8:flag bahamas:flag_bs|1f1e7-1f1f9:flag bhutan:flag_bt|1f1e7-1f1fb:flag bouvet island:flag_bv|1f1e7-1f1fc:flag botswana:flag_bw|1f1e7-1f1fe:flag belarus:flag_by|1f1e7-1f1ff:flag belize:flag_bz|1f1e8-1f1e6:flag canada:flag_ca|1f1e8-1f1e8:flag cocos (keeling) islands:flag_cc|1f1e8-1f1e9:flag congo - kinshasa:flag_cd,congo|1f1e8-1f1eb:flag central african republic:flag_cf|1f1e8-1f1ec:flag congo - brazzaville:flag_cg|1f1e8-1f1ed:flag switzerland:flag_ch|1f1e8-1f1ee:flag côte d’ivoire:flag_ci|1f1e8-1f1f0:flag cook islands:flag_ck|1f1e8-1f1f1:flag chile:flag_cl,chile|1f1e8-1f1f2:flag cameroon:flag_cm|1f1e8-1f1f3:flag china:flag_cn|1f1e8-1f1f4:flag colombia:flag_co|1f1e8-1f1f5:flag clipperton island:flag_cp|1f1e8-1f1f7:flag costa rica:flag_cr|1f1e8-1f1fa:flag cuba:flag_cu|1f1e8-1f1fb:flag cape verde:flag_cv|1f1e8-1f1fc:flag curaçao:flag_cw|1f1e8-1f1fd:flag christmas island:flag_cx|1f1e8-1f1fe:flag cyprus:flag_cy|1f1e8-1f1ff:flag czechia:flag_cz|1f1e9-1f1ea:flag germany:flag_de|1f1e9-1f1ec:flag diego garcia:flag_dg|1f1e9-1f1ef:flag djibouti:flag_dj|1f1e9-1f1f0:flag denmark:flag_dk|1f1e9-1f1f2:flag dominica:flag_dm|1f1e9-1f1f4:flag dominican republic:flag_do|1f1e9-1f1ff:flag algeria:flag_dz|1f1ea-1f1e6:flag ceuta & melilla:flag_ea|1f1ea-1f1e8:flag ecuador:flag_ec|1f1ea-1f1ea:flag estonia:flag_ee|1f1ea-1f1ec:flag egypt:flag_eg|1f1ea-1f1ed:flag western sahara:flag_eh|1f1ea-1f1f7:flag eritrea:flag_er|1f1ea-1f1f8:flag spain:flag_es|1f1ea-1f1f9:flag ethiopia:flag_et|1f1ea-1f1fa:flag european union:flag_eu|1f1eb-1f1ee:flag finland:flag_fi|1f1eb-1f1ef:flag fiji:flag_fj|1f1eb-1f1f0:flag falkland islands:flag_fk|1f1eb-1f1f2:flag micronesia:flag_fm|1f1eb-1f1f4:flag faroe islands:flag_fo|1f1eb-1f1f7:flag france:flag_fr|1f1ec-1f1e6:flag gabon:flag_ga|1f1ec-1f1e7:flag united kingdom:flag_gb|1f1ec-1f1e9:flag grenada:flag_gd|1f1ec-1f1ea:flag georgia:flag_ge|1f1ec-1f1eb:flag french guiana:flag_gf|1f1ec-1f1ec:flag guernsey:flag_gg|1f1ec-1f1ed:flag ghana:flag_gh|1f1ec-1f1ee:flag gibraltar:flag_gi|1f1ec-1f1f1:flag greenland:flag_gl|1f1ec-1f1f2:flag gambia:flag_gm|1f1ec-1f1f3:flag guinea:flag_gn|1f1ec-1f1f5:flag guadeloupe:flag_gp|1f1ec-1f1f6:flag equatorial guinea:flag_gq|1f1ec-1f1f7:flag greece:flag_gr|1f1ec-1f1f8:flag south georgia & south sandwich islands:flag_gs|1f1ec-1f1f9:flag guatemala:flag_gt|1f1ec-1f1fa:flag guam:flag_gu|1f1ec-1f1fc:flag guinea-bissau:flag_gw|1f1ec-1f1fe:flag guyana:flag_gy|1f1ed-1f1f0:flag hong kong sar china:flag_hk|1f1ed-1f1f2:flag heard island & mcdonald islands:flag_hm|1f1ed-1f1f3:flag honduras:flag_hn|1f1ed-1f1f7:flag croatia:flag_hr|1f1ed-1f1f9:flag haiti:flag_ht|1f1ed-1f1fa:flag hungary:flag_hu|1f1ee-1f1e8:flag canary islands:flag_ic|1f1ee-1f1e9:flag indonesia:flag_id,indonesia|1f1ee-1f1ea:flag ireland:flag_ie|1f1ee-1f1f1:flag israel:flag_il|1f1ee-1f1f2:flag isle of man:flag_im|1f1ee-1f1f3:flag india:flag_in|1f1ee-1f1f4:flag british indian ocean territory:flag_io|1f1ee-1f1f6:flag iraq:flag_iq|1f1ee-1f1f7:flag iran:flag_ir|1f1ee-1f1f8:flag iceland:flag_is|1f1ee-1f1f9:flag italy:flag_it|1f1ef-1f1ea:flag jersey:flag_je|1f1ef-1f1f2:flag jamaica:flag_jm|1f1ef-1f1f4:flag jordan:flag_jo|1f1ef-1f1f5:flag japan:flag_jp|1f1f0-1f1ea:flag kenya:flag_ke|1f1f0-1f1ec:flag kyrgyzstan:flag_kg|1f1f0-1f1ed:flag cambodia:flag_kh|1f1f0-1f1ee:flag kiribati:flag_ki|1f1f0-1f1f2:flag comoros:flag_km|1f1f0-1f1f3:flag st. kitts & nevis:flag_kn|1f1f0-1f1f5:flag north korea:flag_kp|1f1f0-1f1f7:flag south korea:flag_kr|1f1f0-1f1fc:flag kuwait:flag_kw|1f1f0-1f1fe:flag cayman islands:flag_ky|1f1f0-1f1ff:flag kazakhstan:flag_kz|1f1f1-1f1e6:flag laos:flag_la|1f1f1-1f1e7:flag lebanon:flag_lb|1f1f1-1f1e8:flag st. lucia:flag_lc|1f1f1-1f1ee:flag liechtenstein:flag_li|1f1f1-1f1f0:flag sri lanka:flag_lk|1f1f1-1f1f7:flag liberia:flag_lr|1f1f1-1f1f8:flag lesotho:flag_ls|1f1f1-1f1f9:flag lithuania:flag_lt|1f1f1-1f1fa:flag luxembourg:flag_lu|1f1f1-1f1fb:flag latvia:flag_lv|1f1f1-1f1fe:flag libya:flag_ly|1f1f2-1f1e6:flag morocco:flag_ma|1f1f2-1f1e8:flag monaco:flag_mc|1f1f2-1f1e9:flag moldova:flag_md|1f1f2-1f1ea:flag montenegro:flag_me|1f1f2-1f1eb:flag st. martin:flag_mf|1f1f2-1f1ec:flag madagascar:flag_mg|1f1f2-1f1ed:flag marshall islands:flag_mh|1f1f2-1f1f0:flag north macedonia:flag_mk|1f1f2-1f1f1:flag mali:flag_ml|1f1f2-1f1f2:flag myanmar (burma):flag_mm|1f1f2-1f1f3:flag mongolia:flag_mn|1f1f2-1f1f4:flag macao sar china:flag_mo|1f1f2-1f1f5:flag northern mariana islands:flag_mp|1f1f2-1f1f6:flag martinique:flag_mq|1f1f2-1f1f7:flag mauritania:flag_mr|1f1f2-1f1f8:flag montserrat:flag_ms|1f1f2-1f1f9:flag malta:flag_mt|1f1f2-1f1fa:flag mauritius:flag_mu|1f1f2-1f1fb:flag maldives:flag_mv|1f1f2-1f1fc:flag malawi:flag_mw|1f1f2-1f1fd:flag mexico:flag_mx|1f1f2-1f1fe:flag malaysia:flag_my|1f1f2-1f1ff:flag mozambique:flag_mz|1f1f3-1f1e6:flag namibia:flag_na|1f1f3-1f1e8:flag new caledonia:flag_nc|1f1f3-1f1ea:flag niger:flag_ne|1f1f3-1f1eb:flag norfolk island:flag_nf|1f1f3-1f1ec:flag nigeria:flag_ng,nigeria|1f1f3-1f1ee:flag nicaragua:flag_ni|1f1f3-1f1f1:flag netherlands:flag_nl|1f1f3-1f1f4:flag norway:flag_no|1f1f3-1f1f5:flag nepal:flag_np|1f1f3-1f1f7:flag nauru:flag_nr|1f1f3-1f1fa:flag niue:flag_nu|1f1f3-1f1ff:flag new zealand:flag_nz|1f1f4-1f1f2:flag oman:flag_om|1f1f5-1f1e6:flag panama:flag_pa|1f1f5-1f1ea:flag peru:flag_pe|1f1f5-1f1eb:flag french polynesia:flag_pf|1f1f5-1f1ec:flag papua new guinea:flag_pg|1f1f5-1f1ed:flag philippines:flag_ph|1f1f5-1f1f0:flag pakistan:flag_pk|1f1f5-1f1f1:flag poland:flag_pl|1f1f5-1f1f2:flag st. pierre & miquelon:flag_pm|1f1f5-1f1f3:flag pitcairn islands:flag_pn|1f1f5-1f1f7:flag puerto rico:flag_pr|1f1f5-1f1f8:flag palestinian territories:flag_ps|1f1f5-1f1f9:flag portugal:flag_pt|1f1f5-1f1fc:flag palau:flag_pw|1f1f5-1f1fe:flag paraguay:flag_py|1f1f6-1f1e6:flag qatar:flag_qa|1f1f7-1f1ea:flag réunion:flag_re|1f1f7-1f1f4:flag romania:flag_ro|1f1f7-1f1f8:flag serbia:flag_rs|1f1f7-1f1fa:flag russia:flag_ru|1f1f7-1f1fc:flag rwanda:flag_rw|1f1f8-1f1e6:flag saudi arabia:flag_sa,saudiarabia,saudi|1f1f8-1f1e7:flag solomon islands:flag_sb|1f1f8-1f1e8:flag seychelles:flag_sc|1f1f8-1f1e9:flag sudan:flag_sd|1f1f8-1f1ea:flag sweden:flag_se|1f1f8-1f1ec:flag singapore:flag_sg|1f1f8-1f1ed:flag st. helena, ascension & tristan da cunha:flag_sh|1f1f8-1f1ee:flag slovenia:flag_si|1f1f8-1f1ef:flag svalbard & jan mayen:flag_sj|1f1f8-1f1f0:flag slovakia:flag_sk|1f1f8-1f1f1:flag sierra leone:flag_sl|1f1f8-1f1f2:flag san marino:flag_sm|1f1f8-1f1f3:flag senegal:flag_sn|1f1f8-1f1f4:flag somalia:flag_so|1f1f8-1f1f7:flag suriname:flag_sr|1f1f8-1f1f8:flag south sudan:flag_ss|1f1f8-1f1f9:flag são tomé & príncipe:flag_st|1f1f8-1f1fb:flag el salvador:flag_sv|1f1f8-1f1fd:flag sint maarten:flag_sx|1f1f8-1f1fe:flag syria:flag_sy|1f1f8-1f1ff:flag eswatini:flag_sz|1f1f9-1f1e6:flag tristan da cunha:flag_ta|1f1f9-1f1e8:flag turks & caicos islands:flag_tc|1f1f9-1f1e9:flag chad:flag_td|1f1f9-1f1eb:flag french southern and antarctic lands:flag_tf|1f1f9-1f1ec:flag togo:flag_tg|1f1f9-1f1ed:flag thailand:flag_th|1f1f9-1f1ef:flag tajikistan:flag_tj|1f1f9-1f1f0:flag tokelau:flag_tk|1f1f9-1f1f1:flag timor-leste:flag_tl|1f1f9-1f1f2:flag turkmenistan:flag_tm,turkmenistan|1f1f9-1f1f3:flag tunisia:flag_tn|1f1f9-1f1f4:flag tonga:flag_to|1f1f9-1f1f7:flag türkiye:flag_tr|1f1f9-1f1f9:flag trinidad & tobago:flag_tt|1f1f9-1f1fb:flag tuvalu:flag_tv,tuvalu|1f1f9-1f1fc:flag taiwan:flag_tw|1f1f9-1f1ff:flag tanzania:flag_tz|1f1fa-1f1e6:flag ukraine:flag_ua|1f1fa-1f1ec:flag uganda:flag_ug|1f1fa-1f1f2:flag u.s. outlying islands:flag_um|1f1fa-1f1f3:flag united nations:united_nations|1f1fa-1f1f8:flag united states:flag_us|1f1fa-1f1fe:flag uruguay:flag_uy|1f1fa-1f1ff:flag uzbekistan:flag_uz|1f1fb-1f1e6:flag vatican city:flag_va|1f1fb-1f1e8:flag st. vincent & grenadines:flag_vc|1f1fb-1f1ea:flag venezuela:flag_ve|1f1fb-1f1ec:flag british virgin islands:flag_vg|1f1fb-1f1ee:flag u.s. virgin islands:flag_vi|1f1fb-1f1f3:flag vietnam:flag_vn|1f1fb-1f1fa:flag vanuatu:flag_vu|1f1fc-1f1eb:flag wallis & futuna:flag_wf|1f1fc-1f1f8:flag samoa:flag_ws|1f1fd-1f1f0:flag kosovo:flag_xk|1f1fe-1f1ea:flag yemen:flag_ye|1f1fe-1f1f9:flag mayotte:flag_yt|1f1ff-1f1e6:flag south africa:flag_za|1f1ff-1f1f2:flag zambia:flag_zm|1f1ff-1f1fc:flag zimbabwe:flag_zw|1f3f4-e0067-e0062-e0065-e006e-e0067-e007f:flag england:england|1f3f4-e0067-e0062-e0073-e0063-e0074-e007f:flag scotland:scotland|1f3f4-e0067-e0062-e0077-e006c-e0073-e007f:flag wales:wales" }
2462
2450
  ];
2463
- function ef(e) {
2451
+ function Zi(e) {
2464
2452
  return e.replace(/[^a-z0-9+]+/g, "_").replace(/^_|_$/g, "");
2465
2453
  }
2466
- function tf(e) {
2467
- const [t = "", a = "", n = ""] = e.split(":"), o = ef(a), r = n ? n.split(",") : [];
2454
+ function ef(e) {
2455
+ const [t = "", a = "", n = ""] = e.split(":"), o = Zi(a), r = n ? n.split(",") : [];
2468
2456
  return o && !r.includes(o) && r.push(o), { char: String.fromCodePoint(...t.split("-").map((f) => parseInt(f, 16))), name: a, shortcodes: r };
2469
2457
  }
2470
- let la = null;
2458
+ let sa = null;
2471
2459
  function Ae() {
2472
- return la ??= Zi.map((e) => ({ id: e.id, label: e.label, emoji: e.data.split("|").map(tf) })), la;
2460
+ return sa ??= Qi.map((e) => ({ id: e.id, label: e.label, emoji: e.data.split("|").map(ef) })), sa;
2473
2461
  }
2474
2462
  let se = null;
2475
2463
  function Qe(e) {
@@ -2483,7 +2471,7 @@ function Qe(e) {
2483
2471
  }
2484
2472
  return se.get(e) ?? se.get(e.replace(/\ufe0f/g, ""));
2485
2473
  }
2486
- const af = [
2474
+ const tf = [
2487
2475
  "joy",
2488
2476
  "heart",
2489
2477
  "thumbsup",
@@ -2520,9 +2508,9 @@ const af = [
2520
2508
  "x",
2521
2509
  "pensive"
2522
2510
  ];
2523
- let ca = null;
2524
- function nf() {
2525
- return ca ??= af.flatMap((e) => _n(e)?.char ?? []), ca;
2511
+ let la = null;
2512
+ function af() {
2513
+ return la ??= tf.flatMap((e) => _n(e)?.char ?? []), la;
2526
2514
  }
2527
2515
  let ge = null;
2528
2516
  function _n(e) {
@@ -2533,30 +2521,30 @@ function _n(e) {
2533
2521
  }
2534
2522
  return ge.get(e.toLowerCase());
2535
2523
  }
2536
- function of(e, t = 8) {
2524
+ function nf(e, t = 8) {
2537
2525
  const a = e.toLowerCase();
2538
2526
  if (!a) return [];
2539
2527
  const n = /* @__PURE__ */ new Map();
2540
- for (const s of [...ft(), ...nf()]) n.has(s) || n.set(s, n.size);
2528
+ for (const s of [...ft(), ...af()]) n.has(s) || n.set(s, n.size);
2541
2529
  const o = (s) => n.get(s.char) ?? n.size, r = [];
2542
2530
  let f = 0;
2543
2531
  for (const s of Ae().flatMap((c) => c.emoji)) {
2544
2532
  f += 1;
2545
2533
  let c = null;
2546
2534
  for (const g of s.shortcodes) {
2547
- const m = g === a ? 0 : g.startsWith(a) ? 1 : g.split("_").some((k) => k.startsWith(a)) ? 2 : g.includes(a) ? 3 : -1;
2535
+ const m = g === a ? 0 : g.startsWith(a) ? 1 : g.split("_").some((v) => v.startsWith(a)) ? 2 : g.includes(a) ? 3 : -1;
2548
2536
  m < 0 || (!c || m < c.rank) && (c = { code: g, rank: m });
2549
2537
  }
2550
2538
  c && r.push({ emoji: s, code: c.code, rank: c.rank, order: o(s) * 1e4 + f });
2551
2539
  }
2552
2540
  return r.sort((s, c) => s.rank - c.rank || s.order - c.order), r.slice(0, t).map(({ emoji: s, code: c }) => ({ emoji: s, code: c }));
2553
2541
  }
2554
- function rf(e, t = 120) {
2542
+ function of(e, t = 120) {
2555
2543
  const a = e.toLowerCase().trim().split(/\s+/).filter(Boolean);
2556
2544
  if (!a.length) return [];
2557
2545
  const n = Ae().flatMap((c) => c.emoji), o = a.join("_").replace(/^:|:$/g, ""), r = n.filter((c) => {
2558
2546
  const g = c.name.split(/[\s-]+/);
2559
- return a.every((m) => g.some((k) => k.startsWith(m))) || c.shortcodes.some((m) => m.startsWith(o));
2547
+ return a.every((m) => g.some((v) => v.startsWith(m))) || c.shortcodes.some((m) => m.startsWith(o));
2560
2548
  }), f = a.join(" "), s = (c) => {
2561
2549
  if (c.name === f || c.shortcodes.includes(o)) return 0;
2562
2550
  const g = c.name.split(/[\s-]+/);
@@ -2564,7 +2552,7 @@ function rf(e, t = 120) {
2564
2552
  };
2565
2553
  return r.sort((c, g) => s(c) - s(g)), r.slice(0, t);
2566
2554
  }
2567
- const ff = [
2555
+ const rf = [
2568
2556
  [128077],
2569
2557
  [10084, 65039],
2570
2558
  [128514],
@@ -2582,20 +2570,20 @@ function ft() {
2582
2570
  return [];
2583
2571
  }
2584
2572
  }
2585
- function vn(e) {
2573
+ function kn(e) {
2586
2574
  const t = [e, ...ft().filter((a) => a !== e)].slice(0, wn);
2587
2575
  ot(oe.RECENT_EMOJI, JSON.stringify(t));
2588
2576
  }
2589
- function sf(e = 3) {
2577
+ function ff(e = 3) {
2590
2578
  const t = [];
2591
- for (const a of [...ft(), ...ff])
2579
+ for (const a of [...ft(), ...rf])
2592
2580
  if (t.includes(a) || t.push(a), t.length === e) break;
2593
2581
  return t;
2594
2582
  }
2595
- function kn(e, t) {
2583
+ function vn(e, t) {
2596
2584
  return e.by.some((a) => a === t.author || !!t.clientId && a === t.clientId);
2597
2585
  }
2598
- function lf(e, t, a) {
2586
+ function sf(e, t, a) {
2599
2587
  const n = /* @__PURE__ */ new Map();
2600
2588
  for (const s of Object.values(t))
2601
2589
  s.author && n.set(s.author, s.name), n.set(s.clientId, s.name);
@@ -2611,18 +2599,18 @@ function lf(e, t, a) {
2611
2599
  }
2612
2600
  return r && o.unshift("You"), f && o.push(f === 1 ? "1 other" : `${f} others`), o;
2613
2601
  }
2614
- function cf(e, t) {
2602
+ function lf(e, t) {
2615
2603
  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"}`;
2616
2604
  }
2617
2605
  const ce = 8;
2618
- function df(e) {
2606
+ function cf(e) {
2619
2607
  return document.addEventListener("fullscreenchange", e), () => document.removeEventListener("fullscreenchange", e);
2620
2608
  }
2621
- function uf() {
2609
+ function df() {
2622
2610
  const e = za();
2623
- return ya(df, () => document.fullscreenElement, () => null) ?? e ?? document.body;
2611
+ return ba(cf, () => document.fullscreenElement, () => null) ?? e ?? document.body;
2624
2612
  }
2625
- function mf({
2613
+ function uf({
2626
2614
  anchor: e,
2627
2615
  onClose: t,
2628
2616
  width: a,
@@ -2635,19 +2623,19 @@ function mf({
2635
2623
  testId: g,
2636
2624
  children: m
2637
2625
  }) {
2638
- const k = uf(), x = $(null), [E, R] = N(null), y = M(() => {
2626
+ const v = df(), x = $(null), [E, P] = N(null), y = M(() => {
2639
2627
  const d = x.current;
2640
2628
  if (!e || !d) return;
2641
2629
  const u = e.getBoundingClientRect(), w = window.innerWidth, p = window.innerHeight, T = Math.min(a, w - ce * 2), L = Math.min(Math.max(ce, o ? u.right - T : u.left), w - T - ce), q = d.offsetHeight, z = u.top - r - ce, W = p - u.bottom - r - ce, I = n === "top" ? q <= z || z >= W : !(q <= W || W >= z), j = Math.max(120, I ? z : W), A = Math.min(q, j), O = I ? u.top - r - A : u.bottom + r;
2642
- R((H) => H && H.left === L && H.top === O && H.maxHeight === j ? H : { left: L, top: O, maxHeight: j });
2630
+ P((H) => H && H.left === L && H.top === O && H.maxHeight === j ? H : { left: L, top: O, maxHeight: j });
2643
2631
  }, [e, a, o, r, n]);
2644
- return $t(() => {
2632
+ return Ut(() => {
2645
2633
  y();
2646
2634
  const d = x.current, u = typeof ResizeObserver > "u" || !d ? null : new ResizeObserver(() => y());
2647
2635
  return u && d && u.observe(d), window.addEventListener("resize", y), window.addEventListener("scroll", y, !0), () => {
2648
2636
  u?.disconnect(), window.removeEventListener("resize", y), window.removeEventListener("scroll", y, !0);
2649
2637
  };
2650
- }, [y]), $t(() => {
2638
+ }, [y]), Ut(() => {
2651
2639
  const d = (w) => {
2652
2640
  at(w) && (w.stopPropagation(), t(), e?.focus({ preventScroll: !0 }));
2653
2641
  }, u = (w) => {
@@ -2657,7 +2645,7 @@ function mf({
2657
2645
  return document.addEventListener("keydown", d), document.addEventListener("pointerdown", u, !0), () => {
2658
2646
  document.removeEventListener("keydown", d), document.removeEventListener("pointerdown", u, !0);
2659
2647
  };
2660
- }, [t, e]), xa(
2648
+ }, [t, e]), va(
2661
2649
  /* @__PURE__ */ l(
2662
2650
  "div",
2663
2651
  {
@@ -2682,21 +2670,21 @@ function mf({
2682
2670
  children: m
2683
2671
  }
2684
2672
  ),
2685
- k
2673
+ v
2686
2674
  );
2687
2675
  }
2688
- const gf = 340;
2689
- function hf({ anchor: e, onPick: t, onClose: a }) {
2676
+ const mf = 340;
2677
+ function gf({ anchor: e, onPick: t, onClose: a }) {
2690
2678
  const [n, o] = N(""), [r, f] = N(null), s = $(null), c = $(null), g = F(() => Ae(), []), m = F(
2691
2679
  () => ft().map((d) => Qe(d) ?? { char: d, name: "", shortcodes: [] }).slice(0, 16),
2692
2680
  []
2693
- ), k = F(() => rf(n), [n]), x = n.trim().length > 0;
2694
- P(() => {
2681
+ ), v = F(() => of(n), [n]), x = n.trim().length > 0;
2682
+ R(() => {
2695
2683
  s.current?.focus({ preventScroll: !0 });
2696
2684
  }, []);
2697
2685
  const E = (d, u) => {
2698
2686
  t(u.char), d.shiftKey || a();
2699
- }, R = (d) => {
2687
+ }, P = (d) => {
2700
2688
  const u = c.current, w = u?.querySelector(`[data-emoji-group="${d}"]`);
2701
2689
  u && w && (u.scrollTop = w.offsetTop - u.offsetTop);
2702
2690
  }, y = (d, u) => /* @__PURE__ */ l(
@@ -2713,7 +2701,7 @@ function hf({ anchor: e, onPick: t, onClose: a }) {
2713
2701
  },
2714
2702
  u
2715
2703
  );
2716
- return /* @__PURE__ */ _(mf, { anchor: e, onClose: a, width: gf, className: "emoji-picker", ariaLabel: "Emoji picker", testId: "emoji-picker", children: [
2704
+ return /* @__PURE__ */ _(uf, { anchor: e, onClose: a, width: mf, className: "emoji-picker", ariaLabel: "Emoji picker", testId: "emoji-picker", children: [
2717
2705
  /* @__PURE__ */ l("div", { className: "emoji-picker-search", children: /* @__PURE__ */ l(
2718
2706
  "input",
2719
2707
  {
@@ -2727,10 +2715,10 @@ function hf({ anchor: e, onPick: t, onClose: a }) {
2727
2715
  }
2728
2716
  ) }),
2729
2717
  !x && /* @__PURE__ */ _("div", { className: "emoji-picker-tabs", role: "tablist", "aria-label": "Emoji categories", children: [
2730
- m.length > 0 && /* @__PURE__ */ l("button", { type: "button", className: "emoji-tab", onClick: () => R("recent"), title: "Frequently used", "aria-label": "Frequently used", children: m[0].char }),
2731
- g.map((d) => /* @__PURE__ */ l("button", { type: "button", className: "emoji-tab", onClick: () => R(d.id), title: d.label, "aria-label": d.label, children: d.emoji[0].char }, d.id))
2718
+ m.length > 0 && /* @__PURE__ */ l("button", { type: "button", className: "emoji-tab", onClick: () => P("recent"), title: "Frequently used", "aria-label": "Frequently used", children: m[0].char }),
2719
+ g.map((d) => /* @__PURE__ */ l("button", { type: "button", className: "emoji-tab", onClick: () => P(d.id), title: d.label, "aria-label": d.label, children: d.emoji[0].char }, d.id))
2732
2720
  ] }),
2733
- /* @__PURE__ */ l("div", { ref: c, className: "emoji-picker-body", onMouseLeave: () => f(null), children: x ? k.length ? /* @__PURE__ */ l("div", { className: "emoji-grid", children: k.map((d) => y(d, d.char)) }) : /* @__PURE__ */ _("p", { className: "emoji-picker-empty", children: [
2721
+ /* @__PURE__ */ l("div", { ref: c, className: "emoji-picker-body", onMouseLeave: () => f(null), children: x ? v.length ? /* @__PURE__ */ l("div", { className: "emoji-grid", children: v.map((d) => y(d, d.char)) }) : /* @__PURE__ */ _("p", { className: "emoji-picker-empty", children: [
2734
2722
  "No emoji match “",
2735
2723
  n.trim(),
2736
2724
  "”"
@@ -2754,19 +2742,19 @@ function hf({ anchor: e, onPick: t, onClose: a }) {
2754
2742
  ] }) : null })
2755
2743
  ] });
2756
2744
  }
2757
- function pf({ className: e = "w-4 h-4" }) {
2745
+ function hf({ className: e = "w-4 h-4" }) {
2758
2746
  return /* @__PURE__ */ _("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, children: [
2759
2747
  /* @__PURE__ */ l("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 4v16" }),
2760
2748
  /* @__PURE__ */ l("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12l-5 4v-8l5 4z" })
2761
2749
  ] });
2762
2750
  }
2763
- function bf({ className: e = "w-4 h-4" }) {
2751
+ function pf({ className: e = "w-4 h-4" }) {
2764
2752
  return /* @__PURE__ */ _("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, children: [
2765
2753
  /* @__PURE__ */ l("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M20 4v16" }),
2766
2754
  /* @__PURE__ */ l("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 12l5 4v-8l-5 4z" })
2767
2755
  ] });
2768
2756
  }
2769
- function yf({ className: e = "w-5 h-5" }) {
2757
+ function bf({ className: e = "w-5 h-5" }) {
2770
2758
  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" }) });
2771
2759
  }
2772
2760
  function xn({ className: e = "w-4 h-4" }) {
@@ -2777,7 +2765,7 @@ function xn({ className: e = "w-4 h-4" }) {
2777
2765
  /* @__PURE__ */ l("path", { strokeLinecap: "round", d: "M19 2v6M16 5h6" })
2778
2766
  ] });
2779
2767
  }
2780
- function _f({ className: e = "w-4 h-4" }) {
2768
+ function yf({ className: e = "w-4 h-4" }) {
2781
2769
  return /* @__PURE__ */ _("svg", { className: e, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [
2782
2770
  /* @__PURE__ */ l("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10 7L4 12l6 5" }),
2783
2771
  /* @__PURE__ */ l("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 12h9a7 7 0 017 7" })
@@ -2786,15 +2774,15 @@ function _f({ className: e = "w-4 h-4" }) {
2786
2774
  function mt(e) {
2787
2775
  return new Date(e).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" });
2788
2776
  }
2789
- const wf = Ge.memo(function({ message: t }) {
2790
- const a = h((u) => u.me.clientId), n = h((u) => u.me.clientId ? u.roster[u.me.clientId]?.author : void 0), o = Qi(t, { clientId: a, author: n }), r = it(
2777
+ const _f = Ge.memo(function({ message: t }) {
2778
+ const a = h((u) => u.me.clientId), n = h((u) => u.me.clientId ? u.roster[u.me.clientId]?.author : void 0), o = Xi(t, { clientId: a, author: n }), r = it(
2791
2779
  { clientId: t.clientId, author: t.author },
2792
2780
  { name: t.name, sprite: t.sprite }
2793
2781
  ), f = Ee(r.sprite, r.pictureUrl), s = t.isSystem ? void 0 : r.cosmetics, c = $(null);
2794
2782
  Yo(c, !!s);
2795
2783
  const [g] = N(
2796
- () => t.live && t.text ? wa(t.text, s) : null
2797
- ), [m, k] = N(!1), [x, E] = N(null), R = h((u) => u.setReplyingTo);
2784
+ () => t.live && t.text ? _a(t.text, s) : null
2785
+ ), [m, v] = N(!1), [x, E] = N(null), P = h((u) => u.setReplyingTo);
2798
2786
  if (t.isSystem && t.systemType === "recap")
2799
2787
  return /* @__PURE__ */ l("div", { className: "px-2 py-1.5", children: /* @__PURE__ */ _("div", { className: "border-l-2 border-border-light pl-2.5 py-0.5", children: [
2800
2788
  /* @__PURE__ */ _("div", { className: "text-[10px] uppercase tracking-wide text-text-muted mb-0.5", children: [
@@ -2805,14 +2793,14 @@ const wf = Ge.memo(function({ message: t }) {
2805
2793
  ] }) });
2806
2794
  if (t.isSystem)
2807
2795
  return /* @__PURE__ */ _("div", { className: "px-2 py-0.5 text-[11px] text-text-muted italic text-center leading-tight", children: [
2808
- Ki(t.text, t.template, r),
2796
+ Gi(t.text, t.template, r),
2809
2797
  /* @__PURE__ */ l("span", { className: "ml-1 text-[10px] opacity-50", children: mt(t.ts) })
2810
2798
  ] });
2811
2799
  const y = { clientId: a, author: n }, d = (u) => {
2812
- const w = t.reactions?.find((L) => L.emoji === u), p = !(w && kn(w, y));
2813
- p && vn(u);
2800
+ const w = t.reactions?.find((L) => L.emoji === u), p = !(w && vn(w, y));
2801
+ p && kn(u);
2814
2802
  const T = n ?? a;
2815
- T && qr(t.id, u, p, T), Di(t.id, u, p);
2803
+ T && qr(t.id, u, p, T), Mi(t.id, u, p);
2816
2804
  };
2817
2805
  return /* @__PURE__ */ _(
2818
2806
  "div",
@@ -2821,19 +2809,19 @@ const wf = Ge.memo(function({ message: t }) {
2821
2809
  style: Ga(f),
2822
2810
  "data-msg-id": t.id,
2823
2811
  className: `chat-msg px-2 py-1 ${o ? "chat-msg-own" : ""}`,
2824
- onMouseEnter: () => k(!0),
2825
- onMouseLeave: () => k(!1),
2826
- onFocus: () => k(!0),
2812
+ onMouseEnter: () => v(!0),
2813
+ onMouseLeave: () => v(!1),
2814
+ onFocus: () => v(!0),
2827
2815
  onBlur: (u) => {
2828
- u.currentTarget.contains(u.relatedTarget) || k(!1);
2816
+ u.currentTarget.contains(u.relatedTarget) || v(!1);
2829
2817
  },
2830
2818
  "data-active": m || x ? "true" : void 0,
2831
2819
  children: [
2832
- t.replyTo && /* @__PURE__ */ l(vf, { replyTo: t.replyTo }),
2820
+ t.replyTo && /* @__PURE__ */ l(wf, { replyTo: t.replyTo }),
2833
2821
  /* @__PURE__ */ _("div", { className: "flex items-start gap-2", children: [
2834
2822
  /* @__PURE__ */ l(bn, { sprite: r.sprite, url: r.pictureUrl, alt: r.name, worn: s }),
2835
2823
  /* @__PURE__ */ _("div", { className: "flex-1 min-w-0 -mt-0.5", children: [
2836
- s ? /* @__PURE__ */ l(we, { html: va(r.name, s), className: "text-[13px]", style: { color: f } }) : /* @__PURE__ */ l("span", { className: "font-medium text-[13px]", style: { color: f }, children: r.name }),
2824
+ s ? /* @__PURE__ */ l(we, { html: wa(r.name, s), className: "text-[13px]", style: { color: f } }) : /* @__PURE__ */ l("span", { className: "font-medium text-[13px]", style: { color: f }, children: r.name }),
2837
2825
  /* @__PURE__ */ l("span", { className: "text-[10px] text-text-muted opacity-60 ml-1.5", children: mt(t.ts) }),
2838
2826
  t.text && (g ? /* @__PURE__ */ l(we, { as: "p", html: g, 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 })),
2839
2827
  /* @__PURE__ */ l(yn, { images: t.images }),
@@ -2841,7 +2829,7 @@ const wf = Ge.memo(function({ message: t }) {
2841
2829
  ] })
2842
2830
  ] }),
2843
2831
  (m || x) && /* @__PURE__ */ _("div", { className: "chat-msg-actions", role: "toolbar", "aria-label": "Message actions", "data-testid": "chat-msg-actions", children: [
2844
- sf().map((u) => /* @__PURE__ */ l("button", { type: "button", className: "chat-action-btn chat-action-emoji", onClick: () => d(u), "aria-label": `React with ${Qe(u)?.name ?? u}`, title: Qe(u)?.name, children: u }, u)),
2832
+ ff().map((u) => /* @__PURE__ */ l("button", { type: "button", className: "chat-action-btn chat-action-emoji", onClick: () => d(u), "aria-label": `React with ${Qe(u)?.name ?? u}`, title: Qe(u)?.name, children: u }, u)),
2845
2833
  /* @__PURE__ */ l(
2846
2834
  "button",
2847
2835
  {
@@ -2854,16 +2842,16 @@ const wf = Ge.memo(function({ message: t }) {
2854
2842
  children: /* @__PURE__ */ l(xn, {})
2855
2843
  }
2856
2844
  ),
2857
- /* @__PURE__ */ l("button", { type: "button", className: "chat-action-btn", onClick: () => R(t.id), "aria-label": "Reply", title: "Reply", children: /* @__PURE__ */ l(_f, {}) })
2845
+ /* @__PURE__ */ l("button", { type: "button", className: "chat-action-btn", onClick: () => P(t.id), "aria-label": "Reply", title: "Reply", children: /* @__PURE__ */ l(yf, {}) })
2858
2846
  ] }),
2859
- x && /* @__PURE__ */ l(hf, { anchor: x, onPick: d, onClose: () => {
2860
- E(null), k(!1);
2847
+ x && /* @__PURE__ */ l(gf, { anchor: x, onPick: d, onClose: () => {
2848
+ E(null), v(!1);
2861
2849
  } })
2862
2850
  ]
2863
2851
  }
2864
2852
  );
2865
2853
  });
2866
- function vf({ replyTo: e }) {
2854
+ function wf({ replyTo: e }) {
2867
2855
  const t = h((f) => f.chat.find((s) => s.id === e)), a = h((f) => f.jumpToMessage), n = it(
2868
2856
  { clientId: t?.clientId ?? "", author: t?.author },
2869
2857
  { name: t?.name ?? "", sprite: t?.sprite ?? null }
@@ -2885,7 +2873,7 @@ function vf({ replyTo: e }) {
2885
2873
  children: [
2886
2874
  /* @__PURE__ */ l("span", { className: "chat-reply-spine", "aria-hidden": "true" }),
2887
2875
  /* @__PURE__ */ l(
2888
- Lt,
2876
+ Dt,
2889
2877
  {
2890
2878
  sprite: n.sprite,
2891
2879
  url: n.pictureUrl,
@@ -2904,7 +2892,7 @@ function kf({ reactions: e, me: t, onToggle: a, onAdd: n }) {
2904
2892
  const o = h((r) => r.roster);
2905
2893
  return /* @__PURE__ */ _("div", { className: "chat-reactions", "data-testid": "chat-reactions", children: [
2906
2894
  e.map((r) => {
2907
- const f = kn(r, t);
2895
+ const f = vn(r, t);
2908
2896
  return /* @__PURE__ */ _(
2909
2897
  "button",
2910
2898
  {
@@ -2913,7 +2901,7 @@ function kf({ reactions: e, me: t, onToggle: a, onAdd: n }) {
2913
2901
  "data-mine": f ? "true" : void 0,
2914
2902
  "aria-pressed": f,
2915
2903
  onClick: () => a(r.emoji),
2916
- title: cf(lf(r, o, t), Qe(r.emoji)?.name),
2904
+ title: lf(sf(r, o, t), Qe(r.emoji)?.name),
2917
2905
  "data-emoji": r.emoji,
2918
2906
  children: [
2919
2907
  /* @__PURE__ */ l("span", { className: "chat-reaction-emoji", children: r.emoji }),
@@ -2926,7 +2914,7 @@ function kf({ reactions: e, me: t, onToggle: a, onAdd: n }) {
2926
2914
  /* @__PURE__ */ l("button", { type: "button", className: "chat-reaction chat-reaction-add", onClick: (r) => n(r.currentTarget), "aria-label": "Add reaction", title: "Add reaction", children: /* @__PURE__ */ l(xn, {}) })
2927
2915
  ] });
2928
2916
  }
2929
- function xf() {
2917
+ function vf() {
2930
2918
  Ba();
2931
2919
  const e = h((r) => r.chat), t = $(null), a = $(!1), n = M(() => {
2932
2920
  const r = t.current;
@@ -2934,12 +2922,12 @@ function xf() {
2934
2922
  const { scrollHeight: f, scrollTop: s, clientHeight: c } = r, g = f - s - c;
2935
2923
  a.current = g > 40;
2936
2924
  }, []);
2937
- P(() => {
2925
+ R(() => {
2938
2926
  const r = t.current;
2939
2927
  !r || a.current || (typeof r.scrollTo == "function" ? r.scrollTo({ top: r.scrollHeight, behavior: "smooth" }) : r.scrollTop = r.scrollHeight);
2940
2928
  }, [e.length]);
2941
2929
  const o = h((r) => r.chatJump);
2942
- return P(() => {
2930
+ return R(() => {
2943
2931
  const r = t.current;
2944
2932
  if (!o || !r) return;
2945
2933
  const f = r.querySelector(`[data-msg-id="${o.id}"]`);
@@ -2962,13 +2950,13 @@ function xf() {
2962
2950
  /* @__PURE__ */ l("span", { className: "text-[10px] text-text-muted whitespace-nowrap", children: new Date(r.ts).toLocaleDateString([], { weekday: "short", month: "short", day: "numeric" }) }),
2963
2951
  /* @__PURE__ */ l("div", { className: "flex-1 h-px bg-border" })
2964
2952
  ] }),
2965
- /* @__PURE__ */ l(wf, { message: r })
2953
+ /* @__PURE__ */ l(_f, { message: r })
2966
2954
  ] }, r.id);
2967
2955
  }) })
2968
2956
  }
2969
2957
  );
2970
2958
  }
2971
- const Ot = [
2959
+ const Lt = [
2972
2960
  {
2973
2961
  name: "recap",
2974
2962
  description: "Summarise the previous episode of what is loaded",
@@ -2989,12 +2977,12 @@ const Ot = [
2989
2977
  scope: "local"
2990
2978
  }
2991
2979
  ], ue = "/";
2992
- function Sf(e) {
2980
+ function xf(e) {
2993
2981
  if (!e.startsWith(ue)) return null;
2994
2982
  const t = e.slice(ue.length);
2995
2983
  return /\s/.test(t) ? null : t.toLowerCase();
2996
2984
  }
2997
- function Tf(e, t = Ot) {
2985
+ function Sf(e, t = Lt) {
2998
2986
  const a = e.toLowerCase();
2999
2987
  if (!a) return [...t].sort((o, r) => o.name.localeCompare(r.name));
3000
2988
  const n = [];
@@ -3004,23 +2992,23 @@ function Tf(e, t = Ot) {
3004
2992
  }
3005
2993
  return n.sort((o, r) => o.rank - r.rank || o.cmd.name.localeCompare(r.cmd.name)).map((o) => o.cmd);
3006
2994
  }
3007
- function Cf(e) {
2995
+ function Tf(e) {
3008
2996
  return `${ue}${e.name} `;
3009
2997
  }
3010
2998
  function _e(e, t) {
3011
2999
  return t <= 0 ? 0 : (e % t + t) % t;
3012
3000
  }
3013
- function If(e, t = Ot) {
3001
+ function Cf(e, t = Lt) {
3014
3002
  const a = e.trim();
3015
3003
  if (!a) return null;
3016
3004
  if (!a.startsWith(ue)) return { kind: "chat", text: a };
3017
3005
  const n = a.slice(ue.length), o = n.search(/\s/), r = (o === -1 ? n : n.slice(0, o)).toLowerCase(), f = o === -1 ? "" : n.slice(o).trim(), s = t.find((c) => c.name.toLowerCase() === r);
3018
3006
  return s ? { kind: "command", command: s, args: f } : { kind: "chat", text: a };
3019
3007
  }
3020
- function Ef(e, t) {
3008
+ function If(e, t) {
3021
3009
  return e.requiresMedia && !t.hasMedia ? `${ue}${e.name} needs an episode loaded.` : null;
3022
3010
  }
3023
- function Af({
3011
+ function Ef({
3024
3012
  commands: e,
3025
3013
  activeIndex: t,
3026
3014
  hasMedia: a,
@@ -3063,7 +3051,7 @@ function Af({
3063
3051
  );
3064
3052
  }
3065
3053
  const Sn = (e, t) => `${e}-emoji-${t.code}`;
3066
- function Nf({ matches: e, activeIndex: t, onPick: a, onHover: n, listboxId: o }) {
3054
+ function Af({ matches: e, activeIndex: t, onPick: a, onHover: n, listboxId: o }) {
3067
3055
  return e.length === 0 ? null : /* @__PURE__ */ l(
3068
3056
  "ul",
3069
3057
  {
@@ -3099,20 +3087,20 @@ function Nf({ matches: e, activeIndex: t, onPick: a, onHover: n, listboxId: o })
3099
3087
  }
3100
3088
  );
3101
3089
  }
3102
- const jf = 2, Rf = /^[a-z0-9_+-]*$/i;
3090
+ const Nf = 2, jf = /^[a-z0-9_+-]*$/i;
3103
3091
  function Pf(e, t) {
3104
3092
  const a = e.slice(0, t), n = a.lastIndexOf(":");
3105
3093
  if (n < 0) return null;
3106
3094
  const o = n === 0 ? "" : a[n - 1];
3107
3095
  if (o && !/[\s([{]/.test(o)) return null;
3108
3096
  const r = a.slice(n + 1);
3109
- return r.length < jf || !Rf.test(r) ? null : { query: r.toLowerCase(), start: n };
3097
+ return r.length < Nf || !jf.test(r) ? null : { query: r.toLowerCase(), start: n };
3110
3098
  }
3111
- function Mf(e, t, a, n) {
3099
+ function Rf(e, t, a, n) {
3112
3100
  const o = e.slice(a), r = o.startsWith(" ") ? n : `${n} `;
3113
3101
  return { text: e.slice(0, t) + r + o, caret: t + r.length };
3114
3102
  }
3115
- function Df(e) {
3103
+ function Mf(e) {
3116
3104
  let t = -1;
3117
3105
  return e.replace(/:([a-z0-9_+-]+):/gi, (a, n, o) => {
3118
3106
  const r = o === 0 ? "" : e[o - 1];
@@ -3121,27 +3109,27 @@ function Df(e) {
3121
3109
  return f ? (t = o + a.length, f.char) : a;
3122
3110
  });
3123
3111
  }
3124
- function Lf(e, t, a) {
3125
- const [n, o] = N(0), [r, f] = N({ q: null, i: 0 }), [s, c] = N(null), g = Pf(e, Math.min(n, e.length)), m = g?.query ?? null, k = F(() => m ? of(m) : [], [m]), x = g ? `${g.start}:${m}` : null, E = k.length > 0 && s !== x, R = r.q === x ? _e(r.i, k.length) : 0, y = M((p) => f({ q: x, i: p }), [x]), d = M((p) => o(p.selectionStart ?? p.value.length), []), u = M((p) => {
3112
+ function Df(e, t, a) {
3113
+ const [n, o] = N(0), [r, f] = N({ q: null, i: 0 }), [s, c] = N(null), g = Pf(e, Math.min(n, e.length)), m = g?.query ?? null, v = F(() => m ? nf(m) : [], [m]), x = g ? `${g.start}:${m}` : null, E = v.length > 0 && s !== x, P = r.q === x ? _e(r.i, v.length) : 0, y = M((p) => f({ q: x, i: p }), [x]), d = M((p) => o(p.selectionStart ?? p.value.length), []), u = M((p) => {
3126
3114
  if (!g) return;
3127
- const T = Mf(e, g.start, Math.min(n, e.length), p.emoji.char);
3128
- t(T.text), o(T.caret), vn(p.emoji.char);
3115
+ const T = Rf(e, g.start, Math.min(n, e.length), p.emoji.char);
3116
+ t(T.text), o(T.caret), kn(p.emoji.char);
3129
3117
  const L = a.current;
3130
3118
  L && (L.focus(), requestAnimationFrame(() => L.setSelectionRange(T.caret, T.caret)));
3131
3119
  }, [g, e, n, t, a]), w = M((p) => {
3132
3120
  if (!E) return !1;
3133
3121
  if (p.key === "ArrowDown" || p.key === "ArrowUp")
3134
- return p.preventDefault(), y(_e(R + (p.key === "ArrowDown" ? 1 : -1), k.length)), !0;
3122
+ return p.preventDefault(), y(_e(P + (p.key === "ArrowDown" ? 1 : -1), v.length)), !0;
3135
3123
  if (p.key === "Tab" || p.key === "Enter") {
3136
3124
  p.preventDefault();
3137
- const T = k[R];
3125
+ const T = v[P];
3138
3126
  return T && u(T), !0;
3139
3127
  }
3140
3128
  return p.key === "Escape" ? (p.preventDefault(), c(x), !0) : !1;
3141
- }, [E, k, R, u, y, x]);
3142
- return { open: E, matches: k, activeIndex: R, setActiveIndex: y, pick: u, onKeyDown: w, trackCaret: d };
3129
+ }, [E, v, P, u, y, x]);
3130
+ return { open: E, matches: v, activeIndex: P, setActiveIndex: y, pick: u, onKeyDown: w, trackCaret: d };
3143
3131
  }
3144
- function Of({
3132
+ function Lf({
3145
3133
  pending: e,
3146
3134
  uploading: t,
3147
3135
  onRemove: a
@@ -3168,9 +3156,9 @@ function Of({
3168
3156
  )
3169
3157
  ] }, n.id)) }) : null;
3170
3158
  }
3171
- function qf() {
3159
+ function Of() {
3172
3160
  const [e, t] = N([]), [a, n] = N(!1), o = h((y) => y.pushToast), r = $(/* @__PURE__ */ new Set());
3173
- P(() => () => {
3161
+ R(() => () => {
3174
3162
  for (const y of r.current) URL.revokeObjectURL(y);
3175
3163
  r.current.clear();
3176
3164
  }, []);
@@ -3180,7 +3168,7 @@ function qf() {
3180
3168
  if (!y.length) return;
3181
3169
  const d = [];
3182
3170
  for (const u of y) {
3183
- const w = Ro(u);
3171
+ const w = Po(u);
3184
3172
  if (w) {
3185
3173
  o("error", w);
3186
3174
  continue;
@@ -3231,15 +3219,15 @@ function qf() {
3231
3219
  for (const d of y) f(d);
3232
3220
  return [];
3233
3221
  });
3234
- }, [f]), k = M((y) => {
3235
- const d = Po(y.clipboardData);
3222
+ }, [f]), v = M((y) => {
3223
+ const d = Ro(y.clipboardData);
3236
3224
  d.length && (y.preventDefault(), s(d));
3237
3225
  }, [s]), x = M((y) => {
3238
3226
  const d = Mo(y.dataTransfer);
3239
3227
  d.length && (y.preventDefault(), s(d));
3240
3228
  }, [s]), E = M((y) => {
3241
3229
  y.dataTransfer?.types?.includes("Files") && y.preventDefault();
3242
- }, []), R = M(async () => {
3230
+ }, []), P = M(async () => {
3243
3231
  if (!e.length) return [];
3244
3232
  n(!0);
3245
3233
  try {
@@ -3257,14 +3245,14 @@ function qf() {
3257
3245
  addMeme: c,
3258
3246
  remove: g,
3259
3247
  clear: m,
3260
- uploadPending: R,
3261
- onPaste: k,
3248
+ uploadPending: P,
3249
+ onPaste: v,
3262
3250
  onDrop: x,
3263
3251
  onDragOver: E
3264
3252
  };
3265
3253
  }
3266
- const Hf = 2500, Uf = 5e3;
3267
- class $f {
3254
+ const qf = 2500, Hf = 5e3;
3255
+ class Uf {
3268
3256
  constructor(t, a = Date.now) {
3269
3257
  this.send = t, this.now = a;
3270
3258
  }
@@ -3279,20 +3267,20 @@ class $f {
3279
3267
  return;
3280
3268
  }
3281
3269
  const a = this.now();
3282
- (!this.typing || a - this.lastSent >= Hf) && (this.typing = !0, this.lastSent = a, this.send(!0)), this.idle && clearTimeout(this.idle), this.idle = setTimeout(() => this.stop(), Uf);
3270
+ (!this.typing || a - this.lastSent >= qf) && (this.typing = !0, this.lastSent = a, this.send(!0)), this.idle && clearTimeout(this.idle), this.idle = setTimeout(() => this.stop(), Hf);
3283
3271
  }
3284
3272
  stop() {
3285
3273
  this.idle && (clearTimeout(this.idle), this.idle = null), this.typing && (this.typing = !1, this.send(!1));
3286
3274
  }
3287
3275
  }
3288
- function Ff() {
3289
- const [e] = N(() => new $f(Li));
3290
- return P(() => () => e.stop(), [e]), e;
3276
+ function $f() {
3277
+ const [e] = N(() => new Uf(Di));
3278
+ return R(() => () => e.stop(), [e]), e;
3291
3279
  }
3292
- function zf(e) {
3280
+ function Ff(e) {
3293
3281
  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…";
3294
3282
  }
3295
- function Wf({ replyTo: e, onCancel: t }) {
3283
+ function zf({ replyTo: e, onCancel: t }) {
3296
3284
  const a = h((r) => r.chat.find((f) => f.id === e)), n = it(
3297
3285
  { clientId: a?.clientId ?? "", author: a?.author },
3298
3286
  { name: a?.name ?? "a message", sprite: a?.sprite ?? null }
@@ -3302,7 +3290,7 @@ function Wf({ replyTo: e, onCancel: t }) {
3302
3290
  "Replying to ",
3303
3291
  /* @__PURE__ */ l("span", { className: "font-semibold", style: { color: o }, children: n.name })
3304
3292
  ] }),
3305
- /* @__PURE__ */ l("button", { type: "button", className: "chat-reply-cancel", onClick: t, "aria-label": "Cancel reply", title: "Cancel reply", children: /* @__PURE__ */ l(yf, { className: "w-3.5 h-3.5" }) })
3293
+ /* @__PURE__ */ l("button", { type: "button", className: "chat-reply-cancel", onClick: t, "aria-label": "Cancel reply", title: "Cancel reply", children: /* @__PURE__ */ l(bf, { className: "w-3.5 h-3.5" }) })
3306
3294
  ] });
3307
3295
  }
3308
3296
  function Tn(e, t) {
@@ -3321,14 +3309,14 @@ function Tn(e, t) {
3321
3309
  function wt(e) {
3322
3310
  return e.author ? `author:${e.author}` : `client:${e.clientId}`;
3323
3311
  }
3324
- function Bf() {
3312
+ function Wf() {
3325
3313
  const e = h((c) => c.typing), t = h((c) => c.roster), a = h((c) => c.me.clientId), n = h((c) => c.setTyping);
3326
- P(() => {
3314
+ R(() => {
3327
3315
  const c = Object.keys(e);
3328
3316
  if (c.length === 0) return;
3329
- const g = Math.min(...c.map((k) => e[k])), m = setTimeout(() => {
3330
- const k = Date.now();
3331
- for (const x of c) e[x] <= k && n(x, !1);
3317
+ const g = Math.min(...c.map((v) => e[v])), m = setTimeout(() => {
3318
+ const v = Date.now();
3319
+ for (const x of c) e[x] <= v && n(x, !1);
3332
3320
  }, Math.max(0, g - Date.now()) + 50);
3333
3321
  return () => clearTimeout(m);
3334
3322
  }, [e, n]);
@@ -3339,7 +3327,7 @@ function Bf() {
3339
3327
  const m = wt(g);
3340
3328
  m !== o && !r.has(m) && r.set(m, g.name || "Someone");
3341
3329
  }
3342
- const f = [...r.values()].sort((c, g) => c.localeCompare(g)), s = zf(f);
3330
+ const f = [...r.values()].sort((c, g) => c.localeCompare(g)), s = Ff(f);
3343
3331
  return /* @__PURE__ */ l("div", { className: "chat-typing", "aria-live": "polite", "data-testid": "chat-typing", children: s && /* @__PURE__ */ _(te, { children: [
3344
3332
  /* @__PURE__ */ _("span", { className: "chat-typing-dots", "aria-hidden": "true", children: [
3345
3333
  /* @__PURE__ */ l("i", {}),
@@ -3349,42 +3337,42 @@ function Bf() {
3349
3337
  /* @__PURE__ */ l("span", { className: "truncate", children: s })
3350
3338
  ] }) });
3351
3339
  }
3352
- const da = Ia, Gf = oo;
3353
- function Kf({ commands: e = Ot }) {
3354
- const [t, a] = N(""), [n, o] = N(!1), [r, f] = N({ q: null, i: 0 }), [s, c] = N(!1), g = $(null), m = Ft(), k = Ft(), [x, E] = N(!1), [R, y] = N(!1), d = Lf(t, a, g), u = qf(), w = Ff(), p = h((v) => v.replyingTo), T = h((v) => v.setReplyingTo);
3355
- P(() => {
3340
+ const ca = Ca, Bf = io;
3341
+ function Gf({ commands: e = Lt }) {
3342
+ const [t, a] = N(""), [n, o] = N(!1), [r, f] = N({ q: null, i: 0 }), [s, c] = N(!1), g = $(null), m = $t(), v = $t(), [x, E] = N(!1), [P, y] = N(!1), d = Df(t, a, g), u = Of(), w = $f(), p = h((k) => k.replyingTo), T = h((k) => k.setReplyingTo);
3343
+ R(() => {
3356
3344
  p && !document.hidden && g.current?.focus({ preventScroll: !0 });
3357
3345
  }, [p]);
3358
- const L = h((v) => v.snapshot.mediaId), q = h((v) => v.pushToast), z = h((v) => v.setTierlistOpen), W = !!L, I = Sf(t), j = F(
3359
- () => I === null ? [] : Tf(I, e),
3346
+ const L = h((k) => k.snapshot.mediaId), q = h((k) => k.pushToast), z = h((k) => k.setTierlistOpen), W = !!L, I = xf(t), j = F(
3347
+ () => I === null ? [] : Sf(I, e),
3360
3348
  [I, e]
3361
3349
  ), A = I !== null && !s && j.length > 0, O = r.q === I ? _e(r.i, j.length) : 0, H = M(
3362
- (v) => f({ q: I, i: v }),
3350
+ (k) => f({ q: I, i: k }),
3363
3351
  [I]
3364
- ), ie = M((v, U) => {
3365
- const me = Ef(v, { hasMedia: W });
3352
+ ), ie = M((k, U) => {
3353
+ const me = If(k, { hasMedia: W });
3366
3354
  if (me) {
3367
3355
  q("info", me);
3368
3356
  return;
3369
3357
  }
3370
- switch (v.name) {
3358
+ switch (k.name) {
3371
3359
  case "help":
3372
3360
  q("info", e.map((An) => An.usage).join(" "));
3373
3361
  break;
3374
3362
  case "recap":
3375
- Fi();
3363
+ $i();
3376
3364
  break;
3377
3365
  case "tierlist":
3378
3366
  Yr(), z(!0);
3379
3367
  break;
3380
3368
  default:
3381
- q("info", `${v.usage} is not implemented yet.`);
3369
+ q("info", `${k.usage} is not implemented yet.`);
3382
3370
  }
3383
- }, [W, q, e, z]), V = M((v) => {
3384
- a(Cf(v)), c(!1), g.current?.focus();
3385
- }, []), In = M(async (v) => {
3386
- if (v.preventDefault(), n || u.uploading) return;
3387
- const U = If(t, e);
3371
+ }, [W, q, e, z]), V = M((k) => {
3372
+ a(Tf(k)), c(!1), g.current?.focus();
3373
+ }, []), In = M(async (k) => {
3374
+ if (k.preventDefault(), n || u.uploading) return;
3375
+ const U = Cf(t, e);
3388
3376
  if (!U && !u.pending.length) return;
3389
3377
  if (U?.kind === "command" && u.pending.length) {
3390
3378
  q("info", "Send images on their own, not with a command.");
@@ -3395,57 +3383,57 @@ function Kf({ commands: e = Ot }) {
3395
3383
  return;
3396
3384
  }
3397
3385
  const me = await u.uploadPending();
3398
- me !== null && (Mi(Df(U?.text ?? ""), me, p), a(""), w.stop(), T(null), u.clear(), o(!0), setTimeout(() => o(!1), Gf), !document.hidden && document.hasFocus() && g.current?.focus());
3399
- }, [t, n, ie, u, q, e, p, T, w]), En = M((v) => {
3400
- if (!(!A && d.onKeyDown(v))) {
3401
- if (v.key === "Escape" && A) {
3402
- v.preventDefault(), c(!0);
3386
+ me !== null && (Ri(Mf(U?.text ?? ""), me, p), a(""), w.stop(), T(null), u.clear(), o(!0), setTimeout(() => o(!1), Bf), !document.hidden && document.hasFocus() && g.current?.focus());
3387
+ }, [t, n, ie, u, q, e, p, T, w]), En = M((k) => {
3388
+ if (!(!A && d.onKeyDown(k))) {
3389
+ if (k.key === "Escape" && A) {
3390
+ k.preventDefault(), c(!0);
3403
3391
  return;
3404
3392
  }
3405
- if (v.key === "Escape" && p) {
3406
- v.preventDefault(), T(null);
3393
+ if (k.key === "Escape" && p) {
3394
+ k.preventDefault(), T(null);
3407
3395
  return;
3408
3396
  }
3409
3397
  if (A) {
3410
- if (v.key === "ArrowDown")
3411
- v.preventDefault(), H(_e(O + 1, j.length));
3412
- else if (v.key === "ArrowUp")
3413
- v.preventDefault(), H(_e(O - 1, j.length));
3414
- else if (v.key === "Tab") {
3415
- v.preventDefault();
3398
+ if (k.key === "ArrowDown")
3399
+ k.preventDefault(), H(_e(O + 1, j.length));
3400
+ else if (k.key === "ArrowUp")
3401
+ k.preventDefault(), H(_e(O - 1, j.length));
3402
+ else if (k.key === "Tab") {
3403
+ k.preventDefault();
3416
3404
  const U = j[O];
3417
3405
  U && V(U);
3418
- } else if (v.key === "Enter") {
3419
- v.preventDefault();
3406
+ } else if (k.key === "Enter") {
3407
+ k.preventDefault();
3420
3408
  const U = j[O];
3421
3409
  U && V(U);
3422
3410
  }
3423
3411
  }
3424
3412
  }
3425
3413
  }, [A, j, O, V, H, p, T, d]);
3426
- P(() => {
3427
- const v = () => {
3414
+ R(() => {
3415
+ const k = () => {
3428
3416
  document.hidden || !document.hasFocus() || (g.current?.focus(), g.current?.scrollIntoView({ block: "nearest" }));
3429
3417
  };
3430
- return window.addEventListener("watchparty:focus-chat-input", v), () => window.removeEventListener("watchparty:focus-chat-input", v);
3418
+ return window.addEventListener("watchparty:focus-chat-input", k), () => window.removeEventListener("watchparty:focus-chat-input", k);
3431
3419
  }, []);
3432
- const Ne = da - t.length, qt = Ne <= 100, Ht = A ? j[O] : void 0, je = !A && d.open, Ut = je ? d.matches[d.activeIndex] : void 0;
3420
+ const Ne = ca - t.length, Ot = Ne <= 100, qt = A ? j[O] : void 0, je = !A && d.open, Ht = je ? d.matches[d.activeIndex] : void 0;
3433
3421
  return /* @__PURE__ */ _(
3434
3422
  "form",
3435
3423
  {
3436
- onSubmit: (v) => {
3437
- In(v);
3424
+ onSubmit: (k) => {
3425
+ In(k);
3438
3426
  },
3439
3427
  onPaste: u.onPaste,
3440
3428
  onDrop: u.onDrop,
3441
3429
  onDragOver: u.onDragOver,
3442
3430
  className: "p-2 border-t border-border",
3443
3431
  children: [
3444
- p && /* @__PURE__ */ l(Wf, { replyTo: p, onCancel: () => T(null) }),
3445
- /* @__PURE__ */ l(Of, { pending: u.pending, uploading: u.uploading, onRemove: u.remove }),
3432
+ p && /* @__PURE__ */ l(zf, { replyTo: p, onCancel: () => T(null) }),
3433
+ /* @__PURE__ */ l(Lf, { pending: u.pending, uploading: u.uploading, onRemove: u.remove }),
3446
3434
  /* @__PURE__ */ _("div", { className: "relative", children: [
3447
3435
  A && /* @__PURE__ */ l(
3448
- Af,
3436
+ Ef,
3449
3437
  {
3450
3438
  commands: j,
3451
3439
  activeIndex: O,
@@ -3456,13 +3444,13 @@ function Kf({ commands: e = Ot }) {
3456
3444
  }
3457
3445
  ),
3458
3446
  je && /* @__PURE__ */ l(
3459
- Nf,
3447
+ Af,
3460
3448
  {
3461
3449
  matches: d.matches,
3462
3450
  activeIndex: d.activeIndex,
3463
3451
  onPick: d.pick,
3464
3452
  onHover: d.setActiveIndex,
3465
- listboxId: k
3453
+ listboxId: v
3466
3454
  }
3467
3455
  ),
3468
3456
  /* @__PURE__ */ l(
@@ -3484,28 +3472,28 @@ function Kf({ commands: e = Ot }) {
3484
3472
  ref: g,
3485
3473
  type: "text",
3486
3474
  value: t,
3487
- onChange: (v) => {
3488
- a(v.target.value), d.trackCaret(v.target), c(!1), v.target.value.startsWith("/") ? w.stop() : w.input(v.target.value);
3475
+ onChange: (k) => {
3476
+ a(k.target.value), d.trackCaret(k.target), c(!1), k.target.value.startsWith("/") ? w.stop() : w.input(k.target.value);
3489
3477
  },
3490
3478
  onKeyDown: En,
3491
- onSelect: (v) => d.trackCaret(v.currentTarget),
3492
- maxLength: da,
3479
+ onSelect: (k) => d.trackCaret(k.currentTarget),
3480
+ maxLength: ca,
3493
3481
  placeholder: "Send a message",
3494
3482
  role: "combobox",
3495
3483
  "aria-expanded": A || je,
3496
- "aria-controls": A ? m : je ? k : void 0,
3497
- "aria-activedescendant": Ht ? `${m}-opt-${Ht.name}` : Ut ? Sn(k, Ut) : void 0,
3484
+ "aria-controls": A ? m : je ? v : void 0,
3485
+ "aria-activedescendant": qt ? `${m}-opt-${qt.name}` : Ht ? Sn(v, Ht) : void 0,
3498
3486
  "aria-autocomplete": "list",
3499
- 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 ${qt ? "pr-12" : ""}`
3487
+ 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 ${Ot ? "pr-12" : ""}`
3500
3488
  }
3501
3489
  ),
3502
- /* @__PURE__ */ l("span", { className: `absolute right-2 top-1/2 -translate-y-1/2 text-[10px] ${Ne <= 50 ? Ne <= 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: qt && Ne })
3490
+ /* @__PURE__ */ l("span", { className: `absolute right-2 top-1/2 -translate-y-1/2 text-[10px] ${Ne <= 50 ? Ne <= 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: Ot && Ne })
3503
3491
  ] }),
3504
- !R && /* @__PURE__ */ l(
3492
+ !P && /* @__PURE__ */ l(
3505
3493
  "button",
3506
3494
  {
3507
3495
  type: "button",
3508
- onClick: () => E((v) => !v),
3496
+ onClick: () => E((k) => !k),
3509
3497
  "aria-label": "Add a meme",
3510
3498
  "aria-expanded": x,
3511
3499
  title: "Add a meme",
@@ -3516,20 +3504,20 @@ function Kf({ commands: e = Ot }) {
3516
3504
  )
3517
3505
  ] })
3518
3506
  ] }),
3519
- /* @__PURE__ */ l(Bf, {})
3507
+ /* @__PURE__ */ l(Wf, {})
3520
3508
  ]
3521
3509
  }
3522
3510
  );
3523
3511
  }
3524
- function Vf() {
3512
+ function Kf() {
3525
3513
  const e = h((n) => n.roster), t = h((n) => n.me.clientId), a = F(() => Tn(e, t), [e, t]);
3526
- return a.length ? /* @__PURE__ */ l("div", { className: "flex flex-col gap-1", children: a.map((n) => /* @__PURE__ */ l(Yf, { u: n }, n.clientId)) }) : /* @__PURE__ */ l("div", { className: "text-xs text-text-muted", children: "No users online" });
3514
+ return a.length ? /* @__PURE__ */ l("div", { className: "flex flex-col gap-1", children: a.map((n) => /* @__PURE__ */ l(Vf, { u: n }, n.clientId)) }) : /* @__PURE__ */ l("div", { className: "text-xs text-text-muted", children: "No users online" });
3527
3515
  }
3528
- function Yf({ u: e }) {
3516
+ function Vf({ u: e }) {
3529
3517
  const t = Ee(e.sprite, e.avatarUrl);
3530
3518
  return /* @__PURE__ */ _("div", { className: "flex items-center gap-2 py-0.5", children: [
3531
3519
  /* @__PURE__ */ l(
3532
- Lt,
3520
+ Dt,
3533
3521
  {
3534
3522
  sprite: e.sprite,
3535
3523
  url: e.avatarUrl,
@@ -3542,9 +3530,9 @@ function Yf({ u: e }) {
3542
3530
  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" })
3543
3531
  ] });
3544
3532
  }
3545
- function Jf() {
3533
+ function Yf() {
3546
3534
  const e = h((r) => Tn(r.roster).length), [t, a] = N(!1), n = $(null), o = $(null);
3547
- return P(() => {
3535
+ return R(() => {
3548
3536
  if (!t) return;
3549
3537
  function r(s) {
3550
3538
  n.current && !n.current.contains(s.target) && a(!1);
@@ -3578,37 +3566,37 @@ function Jf() {
3578
3566
  e,
3579
3567
  " online"
3580
3568
  ] }),
3581
- /* @__PURE__ */ l(Vf, {})
3569
+ /* @__PURE__ */ l(Kf, {})
3582
3570
  ] })
3583
3571
  ] });
3584
3572
  }
3585
- function ua({ className: e = "fixed bottom-4 left-1/2 -translate-x-1/2" }) {
3573
+ function da({ className: e = "fixed bottom-4 left-1/2 -translate-x-1/2" }) {
3586
3574
  const t = h((n) => n.toasts), a = h((n) => n.popToast);
3587
- return P(() => {
3575
+ return R(() => {
3588
3576
  const n = t.map((o) => setTimeout(() => a(o.id), 4e3));
3589
3577
  return () => {
3590
3578
  n.forEach(clearTimeout);
3591
3579
  };
3592
3580
  }, [t, a]), /* @__PURE__ */ l("div", { className: `${e} flex flex-col gap-2 z-50`, children: t.map((n) => /* @__PURE__ */ l("div", { className: `px-3 py-2 rounded text-sm shadow font-medium border ${n.kind === "error" ? "bg-danger-bg text-on-danger-bg border-danger" : "bg-bg-card border-border-light text-text"}`, children: n.msg }, n.id)) });
3593
3581
  }
3594
- const Cn = 9e3, ma = 1500, Xf = {
3582
+ const Cn = 9e3, ua = 1500, Jf = {
3595
3583
  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]",
3596
3584
  cinema: "drop-shadow-[0_2px_4px_rgba(0,0,0,0.9)]",
3597
3585
  minimal: "drop-shadow-[0_2px_4px_rgba(0,0,0,0.9)] drop-shadow-[0_0_8px_rgba(0,0,0,0.7)]",
3598
3586
  contrast: "bg-black/70 px-2 py-0.5 rounded"
3599
- }, ga = { WebkitTextStroke: "0.5px black", paintOrder: "stroke fill" }, ha = {
3587
+ }, ma = { WebkitTextStroke: "0.5px black", paintOrder: "stroke fill" }, ga = {
3600
3588
  textShadow: "none",
3601
3589
  filter: "drop-shadow(0 0 1px black) drop-shadow(0 0 1px black)"
3602
3590
  };
3603
- function Qf({ message: e, age: t, ccStyle: a }) {
3604
- const n = Cn - ma;
3591
+ function Xf({ message: e, age: t, ccStyle: a }) {
3592
+ const n = Cn - ua;
3605
3593
  let o = 1;
3606
- t > n && (o = Math.max(0, 1 - (t - n) / ma));
3607
- const r = Xf[a], f = it(
3594
+ t > n && (o = Math.max(0, 1 - (t - n) / ua));
3595
+ const r = Jf[a], f = it(
3608
3596
  { clientId: e.clientId, author: e.author },
3609
3597
  { name: e.name, sprite: e.sprite }
3610
3598
  ), s = Ee(f.sprite, f.pictureUrl), c = f.cosmetics, [g] = N(
3611
- () => e.live && e.text ? wa(e.text, c) : null
3599
+ () => e.live && e.text ? _a(e.text, c) : null
3612
3600
  );
3613
3601
  return /* @__PURE__ */ _(
3614
3602
  "div",
@@ -3618,18 +3606,18 @@ function Qf({ message: e, age: t, ccStyle: a }) {
3618
3606
  children: [
3619
3607
  /* @__PURE__ */ l(bn, { sprite: f.sprite, url: f.pictureUrl, worn: c }),
3620
3608
  /* @__PURE__ */ _("div", { className: "min-w-0 flex-1", children: [
3621
- c ? /* @__PURE__ */ l(we, { html: va(f.name, c), className: "text-sm mr-2", style: { color: s, ...ha } }) : /* @__PURE__ */ l("span", { className: "font-medium text-sm mr-2", style: { color: s, ...ga }, children: f.name }),
3622
- g ? /* @__PURE__ */ l(we, { html: g, className: "text-sm text-white break-words", style: ha }) : /* @__PURE__ */ l("span", { className: "text-sm text-white break-words", style: ga, children: e.text }),
3609
+ c ? /* @__PURE__ */ l(we, { html: wa(f.name, c), className: "text-sm mr-2", style: { color: s, ...ga } }) : /* @__PURE__ */ l("span", { className: "font-medium text-sm mr-2", style: { color: s, ...ma }, children: f.name }),
3610
+ g ? /* @__PURE__ */ l(we, { html: g, className: "text-sm text-white break-words", style: ga }) : /* @__PURE__ */ l("span", { className: "text-sm text-white break-words", style: ma, children: e.text }),
3623
3611
  /* @__PURE__ */ l(yn, { images: e.images })
3624
3612
  ] })
3625
3613
  ]
3626
3614
  }
3627
3615
  );
3628
3616
  }
3629
- function Zf({ shown: e, className: t }) {
3617
+ function Qf({ shown: e, className: t }) {
3630
3618
  Ba();
3631
3619
  const a = h((c) => c.chat), n = h((c) => c.mediaPrefs.subtitleStyle), [o, r] = N(() => Date.now()), f = a.length > 0;
3632
- P(() => {
3620
+ R(() => {
3633
3621
  const c = setInterval(() => {
3634
3622
  f && r(Date.now());
3635
3623
  }, 200);
@@ -3645,7 +3633,7 @@ function Zf({ shown: e, className: t }) {
3645
3633
  className: `wp-floating-chat pointer-events-none flex flex-col ${t}`,
3646
3634
  "data-testid": "floating-chat",
3647
3635
  children: s.map((c) => /* @__PURE__ */ l(
3648
- Qf,
3636
+ Xf,
3649
3637
  {
3650
3638
  message: c,
3651
3639
  age: o - c.ts,
@@ -3656,27 +3644,27 @@ function Zf({ shown: e, className: t }) {
3656
3644
  }
3657
3645
  );
3658
3646
  }
3659
- const pa = (e) => typeof e == "string" && jn.includes(e);
3660
- function es(e, t, a) {
3661
- return e || (pa(t) ? t : pa(a) ? a : "dark");
3647
+ const ha = (e) => typeof e == "string" && jn.includes(e);
3648
+ function Zf(e, t, a) {
3649
+ return e || (ha(t) ? t : ha(a) ? a : "dark");
3662
3650
  }
3663
- function ts(e, t) {
3651
+ function es(e, t) {
3664
3652
  if (t(e.clientWidth), typeof ResizeObserver > "u") return () => {
3665
3653
  };
3666
3654
  const a = new ResizeObserver(() => t(e.clientWidth));
3667
3655
  return a.observe(e), () => a.disconnect();
3668
3656
  }
3669
- function as(e) {
3657
+ function ts(e) {
3670
3658
  const t = e?.trim() ?? "";
3671
3659
  return t ? { source: "host", name: t } : { source: "auto" };
3672
3660
  }
3673
- function ns(e) {
3661
+ function as(e) {
3674
3662
  if (e.source !== "host") return;
3675
3663
  const { setSessionIdentity: t, sprite: a } = h.getState();
3676
3664
  t(e.name, a);
3677
3665
  }
3678
- const os = 1500;
3679
- function ws({
3666
+ const ns = 1500;
3667
+ function _s({
3680
3668
  roomKey: e,
3681
3669
  serverOrigin: t,
3682
3670
  roomOrigin: a,
@@ -3688,27 +3676,27 @@ function ws({
3688
3676
  theme: c,
3689
3677
  name: g,
3690
3678
  onLeave: m,
3691
- onLayoutChange: k,
3679
+ onLayoutChange: v,
3692
3680
  collapsible: x = !0,
3693
3681
  debug: E,
3694
- children: R
3682
+ children: P
3695
3683
  }) {
3696
- const [y, d] = N(null), { setFrame: u, ...w } = rs(k, x), p = h((A) => A.floatingChatEnabled), T = _a(() => g), L = F(() => (_r({ userType: f, userId: s ?? null }), jt().theme), [f, s]), q = Rn(), z = q?.theme, W = F(
3697
- () => es(c, z, L),
3684
+ const [y, d] = N(null), { setFrame: u, ...w } = os(v, x), p = h((A) => A.floatingChatEnabled), T = ya(() => g), L = F(() => (_r({ userType: f, userId: s ?? null }), Nt().theme), [f, s]), q = Pn(), z = q?.theme, W = F(
3685
+ () => Zf(c, z, L),
3698
3686
  [c, z, L]
3699
3687
  );
3700
- P(() => {
3688
+ R(() => {
3701
3689
  }, [c, q !== null]);
3702
3690
  const j = F(
3703
- () => ({ ...It, serverOrigin: t, defaultRoomKey: e }),
3691
+ () => ({ ...Ct, serverOrigin: t, defaultRoomKey: e }),
3704
3692
  [t, e]
3705
3693
  );
3706
- return P(() => {
3694
+ return R(() => {
3707
3695
  E && Qo();
3708
- }, [E]), zi(), P(() => {
3709
- Go({ serverOrigin: t, defaultRoomKey: e }), zr(a ? { origin: a, path: n } : null), aa(o && !a ? { origin: o, path: r } : null), h.getState().rehydrateFromPrefs(), ui();
3696
+ }, [E]), Fi(), R(() => {
3697
+ Go({ serverOrigin: t, defaultRoomKey: e }), zr(a ? { origin: a, path: n } : null), ta(o && !a ? { origin: o, path: r } : null), h.getState().rehydrateFromPrefs(), ui();
3710
3698
  let A = !1;
3711
- const O = kr();
3699
+ const O = vr();
3712
3700
  return (async () => {
3713
3701
  try {
3714
3702
  await Promise.race([
@@ -3720,21 +3708,21 @@ function ws({
3720
3708
  // The character chosen in the settings popout (lib/avatar.ts).
3721
3709
  ei().then(pn)
3722
3710
  ]),
3723
- new Promise((V) => setTimeout(V, os))
3711
+ new Promise((V) => setTimeout(V, ns))
3724
3712
  ]);
3725
3713
  } catch (V) {
3726
3714
  D("room-chrome", "pre-join wait threw, proceeding anyway", Ce(V));
3727
3715
  }
3728
3716
  if (A) return;
3729
- const H = as(T());
3730
- h.getState().ensureAutoIdentity(), ns(H);
3717
+ const H = ts(T());
3718
+ h.getState().ensureAutoIdentity(), as(H);
3731
3719
  const ie = h.getState();
3732
- b("room-chrome", "Joining room", { roomKey: e, name: ie.name, sprite: ie.sprite }), ki({ room_key: e, name: ie.name || void 0, sprite: ie.sprite || void 0 });
3720
+ b("room-chrome", "Joining room", { roomKey: e, name: ie.name, sprite: ie.sprite }), vi({ room_key: e, name: ie.name || void 0, sprite: ie.sprite || void 0 });
3733
3721
  })(), () => {
3734
- A = !0, sa(), aa(null);
3722
+ A = !0, fa(), ta(null);
3735
3723
  };
3736
3724
  }, [e, t, a, n, o, r, f, s]), /* @__PURE__ */ l(Ko.Provider, { value: j, children: /* @__PURE__ */ l(Wa.Provider, { value: !1, children: /* @__PURE__ */ l(Fa.Provider, { value: y, children: /* @__PURE__ */ _("div", { ref: u, className: "wp-room-chrome-frame", children: [
3737
- /* @__PURE__ */ l("div", { className: "wp-room-chrome-frame__content", children: R }),
3725
+ /* @__PURE__ */ l("div", { className: "wp-room-chrome-frame__content", children: P }),
3738
3726
  /* @__PURE__ */ l(
3739
3727
  "aside",
3740
3728
  {
@@ -3753,11 +3741,11 @@ function ws({
3753
3741
  title: "Show chat",
3754
3742
  "aria-label": "Show chat",
3755
3743
  "aria-expanded": !1,
3756
- children: /* @__PURE__ */ l(bf, {})
3744
+ children: /* @__PURE__ */ l(pf, {})
3757
3745
  }
3758
3746
  ),
3759
- /* @__PURE__ */ l(ua, { className: "absolute bottom-2 right-full mr-2 w-72" }),
3760
- /* @__PURE__ */ l(Zf, { shown: p, className: "wp-room-chrome__floating" })
3747
+ /* @__PURE__ */ l(da, { className: "absolute bottom-2 right-full mr-2 w-72" }),
3748
+ /* @__PURE__ */ l(Qf, { shown: p, className: "wp-room-chrome__floating" })
3761
3749
  ] }) : /* @__PURE__ */ _(te, { children: [
3762
3750
  /* @__PURE__ */ l(
3763
3751
  "div",
@@ -3766,7 +3754,7 @@ function ws({
3766
3754
  "aria-orientation": "vertical",
3767
3755
  "aria-label": "Resize chat",
3768
3756
  "aria-valuemin": Xe,
3769
- "aria-valuemax": Rt,
3757
+ "aria-valuemax": jt,
3770
3758
  "aria-valuenow": w.state.width,
3771
3759
  tabIndex: 0,
3772
3760
  className: "wp-room-chrome__resize",
@@ -3779,13 +3767,13 @@ function ws({
3779
3767
  }
3780
3768
  ),
3781
3769
  /* @__PURE__ */ _("div", { className: "flex items-center gap-1 px-2 py-1.5 border-b border-border", children: [
3782
- /* @__PURE__ */ l(Jf, {}),
3770
+ /* @__PURE__ */ l(Yf, {}),
3783
3771
  /* @__PURE__ */ l("div", { className: "flex-1" }),
3784
3772
  m && /* @__PURE__ */ l(
3785
3773
  "button",
3786
3774
  {
3787
3775
  onClick: () => {
3788
- sa(), m();
3776
+ fa(), m();
3789
3777
  },
3790
3778
  className: "wp-room-chrome__leave",
3791
3779
  title: "Leave room",
@@ -3801,27 +3789,27 @@ function ws({
3801
3789
  title: "Hide chat",
3802
3790
  "aria-label": "Hide chat",
3803
3791
  "aria-expanded": !0,
3804
- children: /* @__PURE__ */ l(pf, {})
3792
+ children: /* @__PURE__ */ l(hf, {})
3805
3793
  }
3806
3794
  )
3807
3795
  ] }),
3808
- /* @__PURE__ */ l(xf, {}),
3809
- /* @__PURE__ */ l(Kf, { commands: [] }),
3810
- /* @__PURE__ */ l(ua, { className: "absolute bottom-14 left-2 right-2" })
3796
+ /* @__PURE__ */ l(vf, {}),
3797
+ /* @__PURE__ */ l(Gf, { commands: [] }),
3798
+ /* @__PURE__ */ l(da, { className: "absolute bottom-14 left-2 right-2" })
3811
3799
  ] })
3812
3800
  }
3813
3801
  )
3814
3802
  ] }) }) }) });
3815
3803
  }
3816
- function rs(e, t) {
3817
- const a = h((p) => p.chromeChatCollapsed) && t, n = h((p) => p.chromeChatWidth), o = h((p) => p.toggleChromeChatCollapsed), r = h((p) => p.setChromeChatWidth), [f, s] = N(null), [c, g] = N(void 0), [m, k] = N(null);
3818
- P(() => {
3804
+ function os(e, t) {
3805
+ const a = h((p) => p.chromeChatCollapsed) && t, n = h((p) => p.chromeChatWidth), o = h((p) => p.toggleChromeChatCollapsed), r = h((p) => p.setChromeChatWidth), [f, s] = N(null), [c, g] = N(void 0), [m, v] = N(null);
3806
+ R(() => {
3819
3807
  if (f)
3820
- return ts(f, g);
3808
+ return es(f, g);
3821
3809
  }, [f]);
3822
- const x = Z(m?.current ?? n, c), E = F(() => Pr(a, x), [a, x]), R = _a((p) => e?.(p));
3823
- return P(() => {
3824
- R(E);
3810
+ const x = Z(m?.current ?? n, c), E = F(() => Rr(a, x), [a, x]), P = ya((p) => e?.(p));
3811
+ return R(() => {
3812
+ P(E);
3825
3813
  }, [E]), {
3826
3814
  setFrame: s,
3827
3815
  collapsed: a,
@@ -3829,23 +3817,23 @@ function rs(e, t) {
3829
3817
  dragging: m !== null,
3830
3818
  toggleCollapsed: o,
3831
3819
  onPointerDown: (p) => {
3832
- p.button === 0 && (p.preventDefault(), p.currentTarget.setPointerCapture(p.pointerId), k({ pointerId: p.pointerId, startX: p.clientX, startWidth: x, current: x }));
3820
+ p.button === 0 && (p.preventDefault(), p.currentTarget.setPointerCapture(p.pointerId), v({ pointerId: p.pointerId, startX: p.clientX, startWidth: x, current: x }));
3833
3821
  },
3834
3822
  onPointerMove: (p) => {
3835
- !m || m.pointerId !== p.pointerId || k({ ...m, current: ta(m.startWidth, m.startX, p.clientX, c) });
3823
+ !m || m.pointerId !== p.pointerId || v({ ...m, current: ea(m.startWidth, m.startX, p.clientX, c) });
3836
3824
  },
3837
3825
  onPointerEnd: (p) => {
3838
3826
  if (!m || m.pointerId !== p.pointerId) return;
3839
- const T = ta(m.startWidth, m.startX, p.clientX, c);
3840
- k(null), T !== n && r(T);
3827
+ const T = ea(m.startWidth, m.startX, p.clientX, c);
3828
+ v(null), T !== n && r(T);
3841
3829
  },
3842
3830
  onKeyDown: (p) => {
3843
- const T = Rr(x, p.key, c);
3831
+ const T = Pr(x, p.key, c);
3844
3832
  T !== null && (p.preventDefault(), T !== n && r(T));
3845
3833
  }
3846
3834
  };
3847
3835
  }
3848
3836
  export {
3849
- ws as RoomChrome
3837
+ _s as RoomChrome
3850
3838
  };
3851
3839
  //# sourceMappingURL=room-chrome.js.map