chirkle 0.2.0 → 0.3.0

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.
Files changed (64) hide show
  1. package/README.md +4 -1
  2. package/package.json +1 -1
  3. package/pb_hooks/federation/messages.js +48 -2
  4. package/pb_hooks/lib/anonymous.js +10 -6
  5. package/pb_hooks/lib/bulk.js +2 -0
  6. package/pb_hooks/lib/files.js +39 -47
  7. package/pb_hooks/lib/handles.js +337 -0
  8. package/pb_hooks/lib/http.js +35 -23
  9. package/pb_hooks/lib/inbox.js +383 -0
  10. package/pb_hooks/lib/lists.js +8 -2
  11. package/pb_hooks/lib/live.js +137 -0
  12. package/pb_hooks/lib/messages.js +4 -0
  13. package/pb_hooks/lib/reactions.js +2 -0
  14. package/pb_hooks/lib/reads.js +3 -1
  15. package/pb_hooks/lib/site.js +1 -1
  16. package/pb_hooks/lib/stats.js +252 -0
  17. package/pb_hooks/lib/users.js +6 -1
  18. package/pb_hooks/main.pb.js +103 -26
  19. package/pb_hooks/telegram/people.js +4 -0
  20. package/pb_hooks/telegram/reactions.js +67 -11
  21. package/pb_migrations/1760000044_stats.js +70 -0
  22. package/pb_migrations/1760000045_mentions.js +187 -0
  23. package/pb_migrations/1760000046_reserved_handles.js +29 -0
  24. package/pb_public/assets/access-GUDTDXIP.js +2 -0
  25. package/pb_public/assets/access-GUDTDXIP.js.map +7 -0
  26. package/pb_public/assets/app-3WX5JYL2.js +3 -0
  27. package/pb_public/assets/app-3WX5JYL2.js.map +7 -0
  28. package/pb_public/assets/app-WAFKVN2H.css +2 -0
  29. package/pb_public/assets/app-WAFKVN2H.css.map +7 -0
  30. package/pb_public/assets/{emoji-WSTVXAW5.css → emoji-VA2WCEAC.css} +2 -2
  31. package/pb_public/assets/{emoji-WSTVXAW5.css.map → emoji-VA2WCEAC.css.map} +2 -2
  32. package/pb_public/assets/{emoji-picker-QYRX6NYL.js → emoji-picker-65VVVGYW.js} +2 -2
  33. package/pb_public/assets/forward-66PELNWT.js +2 -0
  34. package/pb_public/assets/forward-66PELNWT.js.map +7 -0
  35. package/pb_public/assets/inbox-3FSOPY2T.css +2 -0
  36. package/pb_public/assets/inbox-3FSOPY2T.css.map +7 -0
  37. package/pb_public/assets/inbox-TZJWPRTG.js +2 -0
  38. package/pb_public/assets/inbox-TZJWPRTG.js.map +7 -0
  39. package/pb_public/assets/login-G7Y44CJ7.js +2 -0
  40. package/pb_public/assets/login-G7Y44CJ7.js.map +7 -0
  41. package/pb_public/assets/mention-suggest-R7MXUH6R.js +2 -0
  42. package/pb_public/assets/mention-suggest-R7MXUH6R.js.map +7 -0
  43. package/pb_public/assets/notify-RQ6ZLR46.js +2 -0
  44. package/pb_public/assets/notify-RQ6ZLR46.js.map +7 -0
  45. package/pb_public/assets/profile-2CNVT2KX.js +2 -0
  46. package/pb_public/assets/profile-2CNVT2KX.js.map +7 -0
  47. package/pb_public/assets/stats-A2TBRUI6.css +2 -0
  48. package/pb_public/assets/stats-A2TBRUI6.css.map +7 -0
  49. package/pb_public/assets/stats-JX52AQCO.js +2 -0
  50. package/pb_public/assets/stats-JX52AQCO.js.map +7 -0
  51. package/pb_public/assets/user-search-7GNEIXMN.js +2 -0
  52. package/pb_public/assets/user-search-7GNEIXMN.js.map +7 -0
  53. package/pb_public/index.html +2 -2
  54. package/pb_public/stats.html +25 -0
  55. package/pb_public/sw.js +1 -1
  56. package/pb_public/assets/access-ALBW2MT2.js +0 -2
  57. package/pb_public/assets/access-ALBW2MT2.js.map +0 -7
  58. package/pb_public/assets/app-A3SXD3FF.css +0 -2
  59. package/pb_public/assets/app-A3SXD3FF.css.map +0 -7
  60. package/pb_public/assets/app-NDSIQW4L.js +0 -3
  61. package/pb_public/assets/app-NDSIQW4L.js.map +0 -7
  62. package/pb_public/assets/notify-L6GERFNO.js +0 -2
  63. package/pb_public/assets/notify-L6GERFNO.js.map +0 -7
  64. /package/pb_public/assets/{emoji-picker-QYRX6NYL.js.map → emoji-picker-65VVVGYW.js.map} +0 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../web/src/dom.ts", "../../web/src/theme.ts", "../../web/src/stats/data.ts", "../../web/src/stats/main.ts"],
4
+ "sourcesContent": ["// Minimal DOM helpers (\u00A77.3). Strings always become text nodes: there is no HTML parsing anywhere.\n\nexport type Child = Node | string | number | null | undefined | false;\n\ntype Listeners = { [K in keyof HTMLElementEventMap]?: (ev: HTMLElementEventMap[K]) => void };\n\nexport interface Attrs {\n class?: string;\n dataset?: Record<string, string>;\n on?: Listeners;\n /** Removes every `on` listener when aborted. */\n signal?: AbortSignal;\n value?: string;\n checked?: boolean;\n [attr: string]: unknown;\n}\n\nconst PROPS = new Set([\"value\", \"checked\"]);\n\nexport function h<K extends keyof HTMLElementTagNameMap>(tag: K, attrs: Attrs = {}, children?: Child | Child[]): HTMLElementTagNameMap[K] {\n const el = document.createElement(tag);\n const { class: cls, dataset, on: listeners, signal, ...rest } = attrs;\n if (cls) el.className = cls;\n if (dataset) Object.assign(el.dataset, dataset);\n for (const [name, v] of Object.entries(rest)) {\n if (v === undefined || v === null || v === false) continue;\n if (PROPS.has(name)) (el as unknown as Record<string, unknown>)[name] = v;\n else el.setAttribute(name, v === true ? \"\" : String(v));\n }\n if (listeners) {\n for (const [type, fn] of Object.entries(listeners)) {\n el.addEventListener(type, fn as EventListener, signal ? { signal } : undefined);\n }\n }\n append(el, children);\n return el;\n}\n\nexport function append(el: Node, children: Child | Child[]): void {\n for (const c of Array.isArray(children) ? children : [children]) {\n if (c === null || c === undefined || c === false) continue;\n el.appendChild(typeof c === \"object\" ? c : document.createTextNode(String(c)));\n }\n}\n\nlet idSeq = 0;\n\n/** A document-unique id for label/aria wiring, e.g. uniqueId(\"room\") \u2192 \"room-3\". */\nexport function uniqueId(prefix: string): string {\n return `${prefix}-${++idSeq}`;\n}\n\nexport function clear(el: Element): void {\n el.replaceChildren();\n}\n\n/**\n * Make `parent`'s children exactly `nodes`, in order, moving only what differs (\u00A77.5: the message list is\n * never fully re-rendered). Nodes already in place keep their identity, focus and scroll anchoring.\n */\nexport function reconcile(parent: Element, nodes: readonly Node[]): void {\n // Drop what goes first: a replaced node left in place would push every node after it down one, and each of them\n // would then be moved (re-inserted, restyled) instead of left alone.\n const keep = new Set(nodes);\n for (const c of [...parent.childNodes]) if (!keep.has(c)) c.remove();\n nodes.forEach((node, i) => {\n const at = parent.childNodes[i];\n if (at !== node) parent.insertBefore(node, at ?? null);\n });\n}\n\n/**\n * Keep what is typed while a lazy chunk loads (a search field that isn't there yet), for the field once it shows:\n * printable keys and Backspace, not shortcuts. `take()` stops holding and says what was typed (QA BUG-243, BUG-252).\n */\nexport function holdKeys(signal: AbortSignal): { take(): string } {\n let early = \"\";\n const hold = (e: KeyboardEvent) => {\n if (e.ctrlKey || e.metaKey || e.altKey || e.isComposing || (e.key.length !== 1 && e.key !== \"Backspace\")) return;\n early = e.key === \"Backspace\" ? early.slice(0, -1) : early + e.key;\n e.preventDefault();\n };\n document.addEventListener(\"keydown\", hold, { capture: true, signal });\n return {\n take() {\n document.removeEventListener(\"keydown\", hold, true);\n return early;\n },\n };\n}\n\n/** Put `text` held by holdKeys() in `input`, as if typed there. */\nexport function typeInto(input: HTMLInputElement | null | undefined, text: string): void {\n if (!text || !input) return;\n input.value += text;\n input.dispatchEvent(new Event(\"input\", { bubbles: true }));\n}\n", "// Light, dark or the system's (auto) theme (\u00A77.8): this device's choice, kept in localStorage. index.html's inline\n// script sets <html data-theme> before the first paint; this keeps it, and the browser's bar color, up to date.\n\nexport const THEMES = [\"auto\", \"light\", \"dark\"] as const;\nexport type Theme = (typeof THEMES)[number];\n\n/** Must match index.html's inline script. */\nexport const THEME_KEY = \"chat.theme\";\n\n/** --surface of each theme (tokens.css), for <meta name=\"theme-color\">. */\nconst BAR = { light: \"#f1eefc\", dark: \"#111214\" } as const;\n\nfunction safeLocalStorage(): Storage | null {\n try {\n return globalThis.localStorage ?? null;\n } catch {\n return null;\n }\n}\n\nexport function savedTheme(storage: Storage | null = safeLocalStorage()): Theme {\n try {\n const v = storage?.getItem(THEME_KEY);\n return v === \"light\" || v === \"dark\" ? v : \"auto\";\n } catch {\n return \"auto\";\n }\n}\n\n/** Show `theme` here: the stylesheet goes by <html data-theme>, the browser's bar by the theme-color metas. */\nexport function applyTheme(theme: Theme, doc: Document = document): void {\n const html = doc.documentElement;\n if (theme === \"auto\") delete html.dataset.theme;\n else html.dataset.theme = theme;\n for (const meta of doc.querySelectorAll<HTMLMetaElement>('meta[name=\"theme-color\"]')) {\n // Each meta's own media query says which theme it is for; a chosen theme gives both its color.\n const forTheme = meta.media.includes(\"dark\") ? \"dark\" : \"light\";\n meta.content = BAR[theme === \"auto\" ? forTheme : theme];\n }\n}\n\n/** Save and show `theme`. Storage can throw (private window, quota): the theme still changes for this page. */\nexport function setTheme(theme: Theme, storage: Storage | null = safeLocalStorage()): void {\n try {\n if (theme === \"auto\") storage?.removeItem(THEME_KEY);\n else storage?.setItem(THEME_KEY, theme);\n } catch {}\n applyTheme(theme);\n}\n\n/** Apply the saved theme and follow another tab's changes. Returns a function that stops following. */\nexport function startTheme(storage: Storage | null = safeLocalStorage()): () => void {\n applyTheme(savedTheme(storage));\n const ac = new AbortController();\n addEventListener(\n \"storage\",\n (e) => {\n if (e.key === THEME_KEY || e.key === null) applyTheme(savedTheme(storage));\n },\n { signal: ac.signal },\n );\n return () => ac.abort();\n}\n", "// Usage statistics (DESIGN.md \u00A740): what GET /api/chat/stats answers, and the figures the page works out from it.\n// Pure, so tests/unit can check them.\n\n/** A sample: [time (epoch ms), people online, guests, people on the web, people on Android]. */\nexport type Sample = [number, number, number, number, number];\n\nexport interface Stats {\n at: number;\n /** Recording (samples, activity) is on: site.no_stats isn't ticked. */\n history: boolean;\n sample_minutes: number;\n now: { online: number; guests: number; web: number; android: number };\n /** Accounts online in the last 24 hours, 7 days and 30 days. */\n active: { day: number; week: number; month: number };\n accounts: { total: number; new_week: number; moderators: number; banned: number };\n messages: {\n /** The viewer's days (YYYY-MM-DD) with any messages, the last 30. */\n days: { day: string; messages: number; people: number }[];\n people_week: number;\n people_month: number;\n dms_month: number;\n files_month: number;\n reactions_month: number;\n };\n /** The last 7 days', oldest first. */\n samples: Sample[];\n}\n\nexport const DAY_MS = 86_400_000;\n\n/** `t`'s day in this browser's time zone, as YYYY-MM-DD. */\nexport function dayKey(t: number): string {\n const d = new Date(t);\n return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, \"0\")}-${String(d.getDate()).padStart(2, \"0\")}`;\n}\n\n/** Midnight today in this browser's time zone, `back` days before it. */\nexport function midnight(now: number, back = 0): number {\n const d = new Date(now);\n d.setHours(0, 0, 0, 0);\n d.setDate(d.getDate() - back);\n return d.getTime();\n}\n\n/** The last `n` days, oldest first, each with its messages and posters (none for a day without). */\nexport function lastDays(days: Stats[\"messages\"][\"days\"], now: number, n = 30): { day: string; messages: number; people: number }[] {\n const by = new Map(days.map((d) => [d.day, d]));\n const out = [];\n for (let i = n - 1; i >= 0; i--) {\n const day = dayKey(midnight(now, i) + 12 * 3_600_000); // noon: safe across a DST change\n const d = by.get(day);\n out.push({ day, messages: d?.messages ?? 0, people: d?.people ?? 0 });\n }\n return out;\n}\n\n/** Person-hours online since `from`: each sample stands for its interval. */\nexport function personHours(samples: readonly Sample[], from: number, minutes: number): number {\n let sum = 0;\n for (const s of samples) if (s[0] >= from) sum += s[1];\n return (sum * minutes) / 60;\n}\n\n/** The most people online at once since `from`, and when (the first time it was reached); null without samples. */\nexport function peak(samples: readonly Sample[], from: number): { online: number; at: number } | null {\n let best: { online: number; at: number } | null = null;\n for (const s of samples) if (s[0] >= from && (!best || s[1] > best.online)) best = { online: s[1], at: s[0] };\n return best;\n}\n\n/**\n * The samples since `from` as runs of a line: a gap longer than two intervals (the server was down, or recording was\n * off) ends a run, so the chart doesn't draw a line across it.\n */\nexport function runs(samples: readonly Sample[], from: number, minutes: number): Sample[][] {\n const out: Sample[][] = [];\n let run: Sample[] = [];\n let last = -Infinity;\n for (const s of samples) {\n if (s[0] < from) continue;\n if (s[0] - last > 2 * minutes * 60_000 && run.length) {\n out.push(run);\n run = [];\n }\n run.push(s);\n last = s[0];\n }\n if (run.length) out.push(run);\n return out;\n}\n\n/** A tidy top for an axis from 0: 1, 2 or 5 times a power of ten, at least `max` (and at least `min`). */\nexport function niceMax(max: number, min = 4): number {\n const v = Math.max(max, min);\n const p = 10 ** Math.floor(Math.log10(v));\n for (const m of [1, 2, 5, 10]) if (m * p >= v) return m * p;\n return 10 * p;\n}\n\n/** \"1.5 h\", \"40 min\", \"12 h\": person-time for a tile. */\nexport function formatHours(h: number): string {\n if (h < 1) return `${Math.round(h * 60)} min`;\n if (h < 10) return `${(Math.round(h * 10) / 10).toLocaleString()} h`;\n return `${Math.round(h).toLocaleString()} h`;\n}\n\n/** `part` of `whole` as a whole percent (\"\u2013\" with nothing to divide). */\nexport function percent(part: number, whole: number): string {\n return whole > 0 ? `${Math.round((part / whole) * 100)}%` : \"\u2013\";\n}\n", "// The usage statistics page (DESIGN.md \u00A740), /stats: a page of its own (stats.html), not the app's. It asks\n// GET /api/chat/stats with the session this browser has: the app's (a moderator), else the admin UI's (a superuser,\n// signed in at /_/ on this server). Anyone else is told there is no such page. Counts only; refreshed every 30 s\n// while the tab is visible.\n\nimport { type Child, clear, h } from \"../dom.ts\";\nimport { applyTheme, savedTheme } from \"../theme.ts\";\nimport { DAY_MS, formatHours, lastDays, midnight, niceMax, peak, percent, personHours, runs, type Sample, type Stats } from \"./data.ts\";\n\nconst REFRESH_MS = 30_000;\n/** The app's session (web/src/pb.ts), and PocketBase's admin UI's (0.40: \"__pb_superusers__\" + its base path). */\nconst SESSIONS = [\"pocketbase_auth\", \"__pb_superusers__/_\"];\nconst SVG = \"http://www.w3.org/2000/svg\";\n\nconst root = document.getElementById(\"stats\") as HTMLElement;\nconst updated = document.getElementById(\"stats-updated\") as HTMLElement;\nconst num = new Intl.NumberFormat();\nconst time = new Intl.DateTimeFormat(undefined, { hour: \"2-digit\", minute: \"2-digit\" });\nconst dayTime = new Intl.DateTimeFormat(undefined, { weekday: \"short\", hour: \"2-digit\", minute: \"2-digit\" });\nconst dayName = new Intl.DateTimeFormat(undefined, { weekday: \"short\", day: \"numeric\", month: \"short\" });\nconst shortDay = new Intl.DateTimeFormat(undefined, { day: \"numeric\", month: \"short\" });\n\nlet range: \"day\" | \"week\" = \"day\";\nlet last: Stats | null = null;\nlet refocus = false;\n\nfunction tokens(): string[] {\n const out: string[] = [];\n for (const key of SESSIONS) {\n try {\n const token = JSON.parse(localStorage.getItem(key) || \"{}\")?.token;\n if (typeof token === \"string\" && token) out.push(token);\n } catch {}\n }\n return out;\n}\n\n/** The statistics, with the first session that may see them; \"denied\" when none may; null when it failed. */\nasync function load(): Promise<Stats | \"denied\" | null> {\n const tz = -new Date().getTimezoneOffset();\n for (const token of tokens()) {\n try {\n const res = await fetch(`/api/chat/stats?tz=${tz}`, { headers: { Authorization: token } });\n if (res.ok) return (await res.json()) as Stats;\n if (res.status !== 401 && res.status !== 403) return null;\n } catch {\n return null;\n }\n }\n return \"denied\";\n}\n\n// ---- pieces ----\n\nfunction tile(label: string, value: string, note?: string, big = false): HTMLElement {\n return h(\"div\", { class: big ? \"tile big\" : \"tile\" }, [\n h(\"div\", { class: \"tile-label\" }, label),\n h(\"div\", { class: \"tile-value\" }, value),\n note ? h(\"div\", { class: \"tile-note\" }, note) : null,\n ]);\n}\n\nfunction section(title: string, children: Child[], hint?: string): HTMLElement {\n return h(\"section\", { class: \"card\" }, [h(\"h2\", {}, title), hint ? h(\"p\", { class: \"hint\" }, hint) : null, ...children]);\n}\n\nfunction svg<K extends keyof SVGElementTagNameMap>(tag: K, attrs: Record<string, string | number> = {}): SVGElementTagNameMap[K] {\n const el = document.createElementNS(SVG, tag);\n for (const [k, v] of Object.entries(attrs)) el.setAttribute(k, String(v));\n return el;\n}\n\n/** A table of the chart's numbers, folded away: the values without hovering. */\nfunction table(caption: string, head: string[], rows: (string | number)[][]): HTMLElement {\n return h(\"details\", { class: \"chart-table\" }, [\n h(\"summary\", {}, \"Show as a table\"),\n h(\"table\", {}, [\n h(\"caption\", {}, caption),\n h(\n \"thead\",\n {},\n h(\n \"tr\",\n {},\n head.map((c) => h(\"th\", { scope: \"col\" }, c)),\n ),\n ),\n h(\n \"tbody\",\n {},\n rows.map((r) =>\n h(\n \"tr\",\n {},\n r.map((c, i) => (i ? h(\"td\", {}, typeof c === \"number\" ? num.format(c) : c) : h(\"th\", { scope: \"row\" }, String(c)))),\n ),\n ),\n ),\n ]),\n ]);\n}\n\n// The charts are drawn at their box's own width (set by render), so their text stays its size on a phone.\nlet W = 720;\nlet H = 220;\n/** Narrow: fewer labels along the bottom. */\nconst narrow = () => W < 520;\nconst PAD = { top: 12, right: 12, bottom: 26, left: 36 };\n\n/** Gridlines and y labels at 0, half (when a whole number) and the top. */\nfunction yAxis(g: SVGGElement, top: number) {\n for (const v of [0, top / 2, top].filter(Number.isInteger)) {\n const y = PAD.top + (H - PAD.top - PAD.bottom) * (1 - v / top);\n g.append(svg(\"line\", { x1: PAD.left, x2: W - PAD.right, y1: y, y2: y, class: \"grid\" }));\n const t = svg(\"text\", { x: PAD.left - 6, y: y + 4, \"text-anchor\": \"end\", class: \"axis\" });\n t.textContent = num.format(v);\n g.append(t);\n }\n}\n\n/** A label along the bottom at `x`; near an edge it is anchored inward, so it isn't cut off. */\nfunction xLabel(g: SVGGElement, x: number, text: string) {\n const anchor = x > W - PAD.right - 32 ? \"end\" : x < PAD.left + 32 ? \"start\" : \"middle\";\n const t = svg(\"text\", { x: anchor === \"end\" ? Math.min(x + 6, W - 2) : x, y: H - 8, \"text-anchor\": anchor, class: \"axis\" });\n t.textContent = text;\n g.append(t);\n}\n\n/** The tooltip of a chart, placed over its box at `x` (0..1 of the width). */\nfunction tooltip(box: HTMLElement) {\n const tip = h(\"div\", { class: \"tip\", role: \"status\", hidden: true });\n box.append(tip);\n return {\n show(x: number, lines: [string, string][], title: string) {\n clear(tip);\n tip.append(h(\"div\", { class: \"tip-title\" }, title));\n for (const [value, label] of lines) tip.append(h(\"div\", {}, [h(\"strong\", {}, value), ` ${label}`]));\n tip.hidden = false;\n const left = Math.min(Math.max(x * box.clientWidth, tip.offsetWidth / 2 + 4), box.clientWidth - tip.offsetWidth / 2 - 4);\n tip.style.left = `${left}px`;\n },\n hide() {\n tip.hidden = true;\n },\n };\n}\n\n/** People online over the last 24 hours or 7 days: a line with a light area under it, and a crosshair. */\nfunction onlineChart(s: Stats): HTMLElement {\n const now = s.at;\n const from = now - (range === \"day\" ? DAY_MS : 7 * DAY_MS);\n const parts = runs(s.samples, from, s.sample_minutes);\n const shown = parts.flat();\n const top = niceMax(Math.max(0, ...shown.map((x) => x[1])));\n const plotW = W - PAD.left - PAD.right;\n const plotH = H - PAD.top - PAD.bottom;\n const xOf = (t: number) => PAD.left + ((t - from) / (now - from)) * plotW;\n const yOf = (v: number) => PAD.top + plotH * (1 - v / top);\n\n const chart = svg(\"svg\", { viewBox: `0 0 ${W} ${H}`, class: \"chart\", role: \"img\" });\n chart.setAttribute(\"aria-label\", `People online over the last ${range === \"day\" ? \"24 hours\" : \"7 days\"}`);\n const g = svg(\"g\");\n chart.append(g);\n yAxis(g, top);\n // x labels: every 6 hours, or each day at midnight.\n const ticks: number[] = [];\n if (range === \"day\") {\n const first = Math.ceil(from / (6 * 3_600_000)) * 6 * 3_600_000;\n for (let t = first; t <= now; t += 6 * 3_600_000) ticks.push(t);\n } else {\n for (let i = 6; i >= 0; i--) if (!narrow() || i % 2 === 0) ticks.push(midnight(now, i));\n }\n for (const t of ticks) {\n // A tick at either edge goes unlabeled: its label would run off or into the next.\n if (t < from || xOf(t) > W - PAD.right - 28) continue;\n xLabel(g, xOf(t), range === \"day\" ? time.format(t) : shortDay.format(t));\n }\n const base = yOf(0);\n for (const run of parts) {\n const pts = run.map((x) => `${xOf(x[0]).toFixed(1)},${yOf(x[1]).toFixed(1)}`);\n if (run.length === 1) {\n g.append(svg(\"circle\", { cx: xOf(run[0]![0]), cy: yOf(run[0]![1]), r: 3, class: \"dot\" }));\n continue;\n }\n g.append(svg(\"polygon\", { points: `${xOf(run[0]![0])},${base} ${pts.join(\" \")} ${xOf(run.at(-1)![0])},${base}`, class: \"area\" }));\n g.append(svg(\"polyline\", { points: pts.join(\" \"), class: \"line\" }));\n }\n const cross = svg(\"line\", { y1: PAD.top, y2: base, class: \"cross\", visibility: \"hidden\" });\n const mark = svg(\"circle\", { r: 4.5, class: \"mark\", visibility: \"hidden\" });\n g.append(cross, mark);\n\n const box = h(\"div\", { class: \"chart-box\" }, [chart]);\n if (!shown.length) box.append(h(\"p\", { class: \"empty\" }, s.history ? \"No samples yet: one is taken every 5 minutes.\" : \"Not recorded.\"));\n const tip = tooltip(box);\n const nearest = (clientX: number): Sample | null => {\n const r = chart.getBoundingClientRect();\n const t = from + ((((clientX - r.left) / r.width) * W - PAD.left) / plotW) * (now - from);\n let best: Sample | null = null;\n for (const x of shown) if (!best || Math.abs(x[0] - t) < Math.abs(best[0] - t)) best = x;\n return best;\n };\n const show = (x: Sample | null) => {\n if (!x) return;\n const cx = xOf(x[0]);\n for (const el of [cross, mark]) el.setAttribute(\"visibility\", \"visible\");\n cross.setAttribute(\"x1\", String(cx));\n cross.setAttribute(\"x2\", String(cx));\n mark.setAttribute(\"cx\", String(cx));\n mark.setAttribute(\"cy\", String(yOf(x[1])));\n tip.show(\n cx / W,\n [\n [num.format(x[1]), \"people online\"],\n [num.format(x[3]), \"on the web\"],\n [num.format(x[4]), \"on Android\"],\n [num.format(x[2]), \"guests\"],\n ],\n (range === \"day\" ? time : dayTime).format(x[0]),\n );\n };\n const hide = () => {\n for (const el of [cross, mark]) el.setAttribute(\"visibility\", \"hidden\");\n tip.hide();\n };\n chart.addEventListener(\"pointermove\", (e) => show(nearest(e.clientX)));\n chart.addEventListener(\"pointerleave\", hide);\n // Keys: the chart takes focus, and \u2190 \u2192 step through the samples.\n let at = shown.length - 1;\n chart.setAttribute(\"tabindex\", \"0\");\n chart.addEventListener(\"focus\", () => show(shown[at] ?? null));\n chart.addEventListener(\"blur\", hide);\n chart.addEventListener(\"keydown\", (e) => {\n if (e.key !== \"ArrowLeft\" && e.key !== \"ArrowRight\") return;\n e.preventDefault();\n at = Math.max(0, Math.min(shown.length - 1, at + (e.key === \"ArrowLeft\" ? -1 : 1)));\n show(shown[at] ?? null);\n });\n\n // The table: hourly in the last 24 hours, else daily peaks.\n const rows: (string | number)[][] = [];\n if (range === \"day\") {\n for (let t = Math.floor(from / 3_600_000) * 3_600_000; t <= now; t += 3_600_000) {\n const p = peak(\n shown.filter((x) => x[0] < t + 3_600_000),\n t,\n );\n if (p) rows.push([time.format(t), p.online]);\n }\n } else {\n for (let i = 6; i >= 0; i--) {\n const start = midnight(now, i);\n const p = peak(\n shown.filter((x) => x[0] < start + DAY_MS),\n start,\n );\n if (p) rows.push([dayName.format(start), p.online]);\n }\n }\n\n const picker = h(\"div\", { class: \"seg\", role: \"group\", \"aria-label\": \"Range\" }, [\n rangeButton(\"day\", \"24 hours\"),\n rangeButton(\"week\", \"7 days\"),\n ]);\n return h(\"div\", {}, [\n picker,\n box,\n table(\n range === \"day\" ? \"Most people online, by hour\" : \"Most people online, by day\",\n [range === \"day\" ? \"Hour\" : \"Day\", \"People\"],\n rows,\n ),\n ]);\n}\n\nfunction rangeButton(value: typeof range, label: string): HTMLElement {\n return h(\n \"button\",\n {\n type: \"button\",\n \"aria-pressed\": String(range === value),\n on: {\n click: () => {\n range = value;\n refocus = true;\n if (last) render(last);\n },\n },\n },\n label,\n );\n}\n\n/** Messages per day, the last 30 days: columns, each with its tooltip. */\nfunction messagesChart(s: Stats): HTMLElement {\n const days = lastDays(s.messages.days, s.at);\n const top = niceMax(Math.max(0, ...days.map((d) => d.messages)));\n const plotW = W - PAD.left - PAD.right;\n const plotH = H - PAD.top - PAD.bottom;\n const slot = plotW / days.length;\n const bw = Math.min(16, slot - 2);\n const chart = svg(\"svg\", { viewBox: `0 0 ${W} ${H}`, class: \"chart\", role: \"img\" });\n chart.setAttribute(\"aria-label\", \"Messages per day, the last 30 days\");\n const g = svg(\"g\");\n chart.append(g);\n yAxis(g, top);\n const box = h(\"div\", { class: \"chart-box\" }, [chart]);\n const tip = tooltip(box);\n days.forEach((d, i) => {\n const x = PAD.left + i * slot + (slot - bw) / 2;\n const bh = (d.messages / top) * plotH;\n const y = PAD.top + plotH - bh;\n const r = Math.min(4, bw / 2, bh);\n // A column, rounded at the top, square at the baseline.\n if (bh > 0) {\n g.append(\n svg(\"path\", {\n d: `M${x},${y + bh}V${y + r}Q${x},${y} ${x + r},${y}H${x + bw - r}Q${x + bw},${y} ${x + bw},${y + r}V${y + bh}Z`,\n class: \"bar\",\n }),\n );\n }\n const date = new Date(`${d.day}T12:00:00`);\n const every = narrow() ? 10 : 5;\n if (i % every === every - 1 || i === days.length - 1) {\n xLabel(g, x + bw / 2, i === days.length - 1 ? \"Today\" : shortDay.format(date));\n }\n // The hit target: the whole slot, top to bottom.\n const hit = svg(\"rect\", { x: PAD.left + i * slot, y: PAD.top, width: slot, height: plotH, class: \"hit\" });\n const show = () =>\n tip.show(\n (x + bw / 2) / W,\n [\n [num.format(d.messages), d.messages === 1 ? \"message\" : \"messages\"],\n [num.format(d.people), d.people === 1 ? \"person posted\" : \"people posted\"],\n ],\n dayName.format(date),\n );\n hit.addEventListener(\"pointerenter\", show);\n hit.addEventListener(\"pointerleave\", () => tip.hide());\n g.append(hit);\n });\n return h(\"div\", {}, [\n box,\n table(\n \"Messages per day\",\n [\"Day\", \"Messages\", \"People who posted\"],\n days.map((d) => [dayName.format(new Date(`${d.day}T12:00:00`)), d.messages, d.people]),\n ),\n ]);\n}\n\n// ---- the page ----\n\nfunction render(s: Stats) {\n last = s;\n // The card's inner width: the page's, less its padding and the card's.\n W = Math.round(Math.min(928, Math.max(280, root.clientWidth - 66)));\n H = narrow() ? 180 : 220;\n const now = s.at;\n const today = midnight(now);\n const days = lastDays(s.messages.days, now);\n const sum = (n: number) => days.slice(-n).reduce((a, d) => a + d.messages, 0);\n const month = sum(30);\n const peakToday = peak(s.samples, today);\n const peakWeek = peak(s.samples, now - 7 * DAY_MS);\n const hoursToday = personHours(s.samples, today, s.sample_minutes);\n const hoursWeek = personHours(s.samples, now - 7 * DAY_MS, s.sample_minutes);\n const recorded = (v: string) => (s.history || s.samples.length ? v : \"\u2013\");\n\n const sections = [\n !s.history\n ? h(\n \"p\",\n { class: \"notice\", role: \"note\" },\n \"Recording is off (site settings: no_stats). Live numbers and messages are still shown; what was recorded before is dropped as it ages.\",\n )\n : null,\n section(\"Now\", [\n h(\"div\", { class: \"tiles\" }, [\n tile(\"People online\", num.format(s.now.online), undefined, true),\n tile(\"On the web\", num.format(s.now.web)),\n tile(\"On Android\", num.format(s.now.android)),\n tile(\"Guests\", num.format(s.now.guests), \"open tabs, not signed in\"),\n tile(\n \"Peak today\",\n recorded(peakToday ? num.format(peakToday.online) : \"\u2013\"),\n peakToday ? `at ${time.format(peakToday.at)}` : undefined,\n ),\n tile(\"Peak, 7 days\", recorded(peakWeek ? num.format(peakWeek.online) : \"\u2013\"), peakWeek ? dayTime.format(peakWeek.at) : undefined),\n ]),\n ]),\n section(\n \"Usage\",\n [\n h(\"div\", { class: \"tiles\" }, [\n tile(\"Active, 24 hours\", num.format(s.active.day), `${percent(s.active.day, s.accounts.total)} of accounts`),\n tile(\"Active, 7 days\", num.format(s.active.week), `${percent(s.active.week, s.accounts.total)} of accounts`),\n tile(\"Active, 30 days\", num.format(s.active.month), `${percent(s.active.month, s.accounts.total)} of accounts`),\n tile(\"Time online today\", recorded(formatHours(hoursToday)), \"all people together\"),\n tile(\"Time online, 7 days\", recorded(formatHours(hoursWeek)), \"all people together\"),\n tile(\"Per active person\", recorded(s.active.week ? formatHours(hoursWeek / s.active.week) : \"\u2013\"), \"a week, on average\"),\n ]),\n h(\"h3\", {}, \"People online\"),\n onlineChart(s),\n ],\n \"Active: online at least once. Time online is counted every 5 minutes.\",\n ),\n section(\"Messages\", [\n h(\"div\", { class: \"tiles\" }, [\n tile(\"Today\", num.format(days.at(-1)?.messages ?? 0)),\n tile(\"7 days\", num.format(sum(7)), `${num.format(s.messages.people_week)} people posted`),\n tile(\"30 days\", num.format(month), `${num.format(s.messages.people_month)} people posted`),\n tile(\"In DMs\", percent(s.messages.dms_month, month), \"of the 30 days'\"),\n tile(\"Files sent\", num.format(s.messages.files_month), \"30 days\"),\n tile(\"Reactions\", num.format(s.messages.reactions_month), \"on the 30 days' messages\"),\n ]),\n h(\"h3\", {}, \"Messages per day\"),\n messagesChart(s),\n ]),\n section(\"Accounts\", [\n h(\"div\", { class: \"tiles\" }, [\n tile(\"Accounts\", num.format(s.accounts.total)),\n tile(\"New, 7 days\", num.format(s.accounts.new_week)),\n tile(\"Moderators\", num.format(s.accounts.moderators)),\n tile(\"Banned\", num.format(s.accounts.banned)),\n ]),\n ]),\n ];\n // Keep the open tables open across a refresh.\n const open = [...root.querySelectorAll(\"details\")].map((d) => d.open);\n clear(root);\n for (const el of sections) if (el) root.append(el);\n root.querySelectorAll(\"details\").forEach((d, i) => {\n d.open = !!open[i];\n });\n // A range button was pressed: it is a new one now, focused as the old one was.\n if (refocus) root.querySelector<HTMLElement>(\".seg [aria-pressed='true']\")?.focus();\n refocus = false;\n updated.textContent = `Updated ${new Date(now).toLocaleTimeString()}`;\n}\n\nfunction denied() {\n document.title = \"Page not found\";\n clear(root);\n root.append(\n h(\"section\", { class: \"card missing\" }, [\n h(\"h2\", {}, \"Page not found\"),\n h(\"p\", {}, \"There is no such page, or you can't see it.\"),\n h(\"a\", { href: \"/\" }, \"Back to the app\"),\n ]),\n );\n updated.textContent = \"\";\n}\n\nlet timer = 0;\nasync function refresh() {\n clearTimeout(timer);\n const got = await load();\n if (got === \"denied\") return denied();\n if (got) render(got);\n else updated.textContent = last ? `Couldn't refresh: showing ${new Date(last.at).toLocaleTimeString()}` : \"Couldn't load. Retrying\u2026\";\n if (!document.hidden) timer = window.setTimeout(refresh, REFRESH_MS);\n}\n\napplyTheme(savedTheme());\nlet drawnFor = root.clientWidth;\nlet resizing = 0;\naddEventListener(\"resize\", () => {\n clearTimeout(resizing);\n resizing = window.setTimeout(() => {\n if (!last || Math.abs(root.clientWidth - drawnFor) < 8) return;\n drawnFor = root.clientWidth;\n render(last);\n }, 150);\n});\ndocument.addEventListener(\"visibilitychange\", () => {\n if (!document.hidden) void refresh();\n else clearTimeout(timer);\n});\nvoid refresh();\n"],
5
+ "mappings": "AAiBA,IAAMA,GAAQ,IAAI,IAAI,CAAC,QAAS,SAAS,CAAC,EAEnC,SAASC,EAAyCC,EAAQC,EAAe,CAAC,EAAGC,EAAsD,CACxI,IAAMC,EAAK,SAAS,cAAcH,CAAG,EAC/B,CAAE,MAAOI,EAAK,QAAAC,EAAS,GAAIC,EAAW,OAAAC,EAAQ,GAAGC,CAAK,EAAIP,EAC5DG,IAAKD,EAAG,UAAYC,GACpBC,GAAS,OAAO,OAAOF,EAAG,QAASE,CAAO,EAC9C,OAAW,CAACI,EAAMC,CAAC,IAAK,OAAO,QAAQF,CAAI,EAClBE,GAAM,MAAQA,IAAM,KACvCZ,GAAM,IAAIW,CAAI,EAAIN,EAA0CM,CAAI,EAAIC,EACnEP,EAAG,aAAaM,EAAMC,IAAM,GAAO,GAAK,OAAOA,CAAC,CAAC,GAExD,GAAIJ,EACF,OAAW,CAACK,EAAMC,CAAE,IAAK,OAAO,QAAQN,CAAS,EAC/CH,EAAG,iBAAiBQ,EAAMC,EAAqBL,EAAS,CAAE,OAAAA,CAAO,EAAI,MAAS,EAGlF,OAAAM,GAAOV,EAAID,CAAQ,EACZC,CACT,CAEO,SAASU,GAAOV,EAAUD,EAAiC,CAChE,QAAWY,KAAK,MAAM,QAAQZ,CAAQ,EAAIA,EAAW,CAACA,CAAQ,EACxDY,GAAM,MAA2BA,IAAM,IAC3CX,EAAG,YAAY,OAAOW,GAAM,SAAWA,EAAI,SAAS,eAAe,OAAOA,CAAC,CAAC,CAAC,CAEjF,CASO,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AW,CAAE,MAAO,cAAe,EAAG,CACtCA,EAAE,KAAM,CAAC,EAAG,gBAAgB,EAC5BA,EAAE,IAAK,CAAC,EAAG,6CAA6C,EACxDA,EAAE,IAAK,CAAE,KAAM,GAAI,EAAG,iBAAiB,CACzC,CAAC,CACH,EACArB,EAAQ,YAAc,EACxB,CAEA,IAAIuH,EAAQ,EACZ,eAAeC,IAAU,CACvB,aAAaD,CAAK,EAClB,IAAME,EAAM,MAAM5G,GAAK,EACvB,GAAI4G,IAAQ,SAAU,OAAOH,GAAO,EAChCG,EAAK7B,EAAO6B,CAAG,EACdzH,EAAQ,YAAcO,EAAO,6BAA6B,IAAI,KAAKA,EAAK,EAAE,EAAE,mBAAmB,CAAC,GAAK,gCACrG,SAAS,SAAQgH,EAAQ,OAAO,WAAWC,GAAS5H,EAAU,EACrE,CAEA8H,GAAWC,GAAW,CAAC,EACvB,IAAIC,GAAW7H,EAAK,YAChB8H,GAAW,EACf,iBAAiB,SAAU,IAAM,CAC/B,aAAaA,EAAQ,EACrBA,GAAW,OAAO,WAAW,IAAM,CAC7B,CAACtH,GAAQ,KAAK,IAAIR,EAAK,YAAc6H,EAAQ,EAAI,IACrDA,GAAW7H,EAAK,YAChB6F,EAAOrF,CAAI,EACb,EAAG,GAAG,CACR,CAAC,EACD,SAAS,iBAAiB,mBAAoB,IAAM,CAC7C,SAAS,OACT,aAAagH,CAAK,EADIC,GAAQ,CAErC,CAAC,EACIA,GAAQ",
6
+ "names": ["PROPS", "h", "tag", "attrs", "children", "el", "cls", "dataset", "listeners", "signal", "rest", "name", "v", "type", "fn", "append", "c", "clear", "el", "THEME_KEY", "BAR", "safeLocalStorage", "savedTheme", "storage", "v", "applyTheme", "theme", "doc", "html", "meta", "forTheme", "dayKey", "t", "d", "midnight", "now", "back", "lastDays", "days", "by", "out", "day", "personHours", "samples", "from", "minutes", "sum", "s", "peak", "best", "runs", "run", "last", "niceMax", "max", "min", "v", "p", "m", "formatHours", "h", "percent", "part", "whole", "REFRESH_MS", "SESSIONS", "SVG", "root", "updated", "num", "time", "dayTime", "dayName", "shortDay", "range", "last", "refocus", "tokens", "out", "key", "token", "load", "tz", "res", "tile", "label", "value", "note", "big", "h", "section", "title", "children", "hint", "svg", "tag", "attrs", "el", "k", "v", "table", "caption", "head", "rows", "c", "r", "W", "H", "narrow", "PAD", "yAxis", "g", "top", "y", "t", "xLabel", "x", "text", "anchor", "tooltip", "box", "tip", "lines", "clear", "left", "onlineChart", "s", "now", "from", "parts", "runs", "shown", "niceMax", "plotW", "plotH", "xOf", "yOf", "chart", "ticks", "first", "i", "midnight", "base", "run", "pts", "cross", "mark", "nearest", "clientX", "best", "show", "cx", "hide", "e", "at", "p", "peak", "start", "picker", "rangeButton", "render", "messagesChart", "days", "lastDays", "d", "slot", "bw", "bh", "date", "every", "hit", "today", "sum", "n", "a", "month", "peakToday", "peakWeek", "hoursToday", "personHours", "hoursWeek", "recorded", "sections", "percent", "formatHours", "open", "denied", "timer", "refresh", "got", "applyTheme", "savedTheme", "drawnFor", "resizing"]
7
+ }
@@ -0,0 +1,2 @@
1
+ var m=class extends Error{};function k(n){let{signal:o}=n,{h:a,uniqueId:p,avatar:y,SEARCH_DEBOUNCE_MS:v}=n.kit,s=p("user-search"),i=a("input",{id:s,type:"search",autocomplete:"off",placeholder:"Find someone\u2026","aria-controls":`${s}-results`,"aria-describedby":`${s}-status`}),l=a("p",{id:`${s}-status`,class:"search-status",role:"status"},"Type a name."),c=a("ul",{id:`${s}-results`,class:"search-results","aria-label":"People"}),f,u=null,d=[],b=()=>[...c.querySelectorAll("button")];function g(t){l.textContent=t.length?`${t.length===20?"20+":t.length} found`:"No one found.",d=t.map(e=>[e,a("button",{type:"button",class:"person",title:e.instance?`On ${e.instance}`:void 0,on:{click:()=>n.onPick(e)},signal:o},[y(e,24,n.avatarUrl),a("span",{},e.name)])]),c.replaceChildren(...d.map(([,e])=>a("li",{},e))),h()}function h(){if(n.isPicked)for(let[t,e]of d)e.setAttribute("aria-pressed",String(n.isPicked(t)))}async function C(t){if(u?.abort(),!t){l.textContent="Type a name.",d=[],c.replaceChildren();return}let e=new AbortController;u=e,l.textContent="Searching\u2026";try{let r=await n.search(t,e.signal);u===e&&!o.aborted&&g(r)}catch(r){if(u!==e||o.aborted)return;l.textContent=r instanceof m?r.message:"Couldn't search. Check your connection.",d=[],c.replaceChildren()}}i.addEventListener("input",()=>{clearTimeout(f),f=setTimeout(()=>{C(i.value.trim())},v)},{signal:o});let U=a("div",{class:"user-search",on:{keydown:t=>{let e=b(),r=e.indexOf(document.activeElement);t.key==="Escape"?(t.preventDefault(),n.onClose()):t.key==="ArrowDown"&&e.length?(t.preventDefault(),e[Math.min(r+1,e.length-1)].focus()):t.key==="ArrowUp"&&r>=0&&(t.preventDefault(),r===0?i.focus():e[r-1].focus())}},signal:o},[a("label",{for:s,class:"visually-hidden"},"Find someone to message"),i,l,c]);return o.addEventListener("abort",()=>{clearTimeout(f),u?.abort()},{once:!0}),{el:U,focus:()=>i.focus(),mark:h}}export{m as SearchError,k as createUserSearch};
2
+ //# sourceMappingURL=user-search-7GNEIXMN.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../web/src/ui/user-search.ts"],
4
+ "sourcesContent": ["// \"New message\" user search (\u00A716.5): type a name, pick a person. Debounced, cancels stale requests.\n// Keyboard: \u2193 from the input moves into the results, \u2191/\u2193 between them, Escape closes.\n//\n// A lazy chunk (the sidebar's New message and the room access dialog load it): it imports types only, and gets what it\n// uses of app.js in `kit` (lazy.ts SEARCH_KIT).\n\nimport type { h, uniqueId } from \"../dom.ts\";\nimport type { User } from \"../lib/types.ts\";\nimport type { AvatarUrl, avatar } from \"./avatar.ts\";\n\nexport interface SearchKit {\n h: typeof h;\n uniqueId: typeof uniqueId;\n avatar: typeof avatar;\n /** How long typing pauses before people are searched. */\n SEARCH_DEBOUNCE_MS: number;\n}\n\n/** A search that failed for a reason to show as it is (\"There's nobody called ann on b.example.\"). */\nexport class SearchError extends Error {}\n\nexport interface UserSearch {\n readonly el: HTMLElement;\n focus(): void;\n /** Show again who is picked, after a pick changed it. */\n mark(): void;\n}\n\nexport function createUserSearch(opts: {\n kit: SearchKit;\n search: (query: string, signal: AbortSignal) => Promise<User[]>;\n avatarUrl: AvatarUrl;\n onPick: (user: User) => void;\n /** When given, each result is a toggle, pressed for someone already picked. */\n isPicked?: (user: User) => boolean;\n onClose: () => void;\n signal: AbortSignal;\n}): UserSearch {\n const { signal } = opts;\n const { h, uniqueId, avatar, SEARCH_DEBOUNCE_MS } = opts.kit;\n const id = uniqueId(\"user-search\");\n const input = h(\"input\", {\n id,\n type: \"search\",\n autocomplete: \"off\",\n placeholder: \"Find someone\u2026\",\n \"aria-controls\": `${id}-results`,\n \"aria-describedby\": `${id}-status`,\n });\n const status = h(\"p\", { id: `${id}-status`, class: \"search-status\", role: \"status\" }, \"Type a name.\");\n const results = h(\"ul\", { id: `${id}-results`, class: \"search-results\", \"aria-label\": \"People\" });\n let timer: ReturnType<typeof setTimeout> | undefined;\n let inflight: AbortController | null = null;\n let shown: [User, HTMLButtonElement][] = [];\n\n const buttons = () => [...results.querySelectorAll<HTMLButtonElement>(\"button\")];\n\n function show(users: User[]) {\n status.textContent = users.length ? `${users.length === 20 ? \"20+\" : users.length} found` : \"No one found.\";\n shown = users.map((u) => [\n u,\n h(\n \"button\",\n {\n type: \"button\",\n class: \"person\",\n title: u.instance ? `On ${u.instance}` : undefined,\n on: { click: () => opts.onPick(u) },\n signal,\n },\n [avatar(u, 24, opts.avatarUrl), h(\"span\", {}, u.name)],\n ),\n ]);\n results.replaceChildren(...shown.map(([, b]) => h(\"li\", {}, b)));\n mark();\n }\n\n function mark() {\n if (opts.isPicked) for (const [u, b] of shown) b.setAttribute(\"aria-pressed\", String(opts.isPicked(u)));\n }\n\n async function run(query: string) {\n inflight?.abort();\n if (!query) {\n status.textContent = \"Type a name.\";\n shown = [];\n results.replaceChildren();\n return;\n }\n const ac = new AbortController();\n inflight = ac;\n status.textContent = \"Searching\u2026\";\n try {\n const users = await opts.search(query, ac.signal);\n if (inflight === ac && !signal.aborted) show(users);\n } catch (e) {\n if (inflight !== ac || signal.aborted) return;\n status.textContent = e instanceof SearchError ? e.message : \"Couldn't search. Check your connection.\";\n shown = [];\n results.replaceChildren();\n }\n }\n\n input.addEventListener(\n \"input\",\n () => {\n clearTimeout(timer);\n timer = setTimeout(() => void run(input.value.trim()), SEARCH_DEBOUNCE_MS);\n },\n { signal },\n );\n\n const el = h(\n \"div\",\n {\n class: \"user-search\",\n on: {\n keydown: (e) => {\n const list = buttons();\n const at = list.indexOf(document.activeElement as HTMLButtonElement);\n if (e.key === \"Escape\") {\n e.preventDefault();\n opts.onClose();\n } else if (e.key === \"ArrowDown\" && list.length) {\n e.preventDefault();\n list[Math.min(at + 1, list.length - 1)]!.focus();\n } else if (e.key === \"ArrowUp\" && at >= 0) {\n e.preventDefault();\n if (at === 0) input.focus();\n else list[at - 1]!.focus();\n }\n },\n },\n signal,\n },\n [h(\"label\", { for: id, class: \"visually-hidden\" }, \"Find someone to message\"), input, status, results],\n );\n signal.addEventListener(\n \"abort\",\n () => {\n clearTimeout(timer);\n inflight?.abort();\n },\n { once: true },\n );\n\n return { el, focus: () => input.focus(), mark };\n}\n"],
5
+ "mappings": "AAmBO,IAAMA,EAAN,cAA0B,KAAM,CAAC,EASjC,SAASC,EAAiBC,EASlB,CACb,GAAM,CAAE,OAAAC,CAAO,EAAID,EACb,CAAE,EAAAE,EAAG,SAAAC,EAAU,OAAAC,EAAQ,mBAAAC,CAAmB,EAAIL,EAAK,IACnDM,EAAKH,EAAS,aAAa,EAC3BI,EAAQL,EAAE,QAAS,CACvB,GAAAI,EACA,KAAM,SACN,aAAc,MACd,YAAa,qBACb,gBAAiB,GAAGA,CAAE,WACtB,mBAAoB,GAAGA,CAAE,SAC3B,CAAC,EACKE,EAASN,EAAE,IAAK,CAAE,GAAI,GAAGI,CAAE,UAAW,MAAO,gBAAiB,KAAM,QAAS,E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SAASa,EAAKC,CAAK,CACpD,OAASO,EAAG,CACV,GAAIX,IAAaU,GAAMpB,EAAO,QAAS,OACvCO,EAAO,YAAcc,aAAaxB,EAAcwB,EAAE,QAAU,0CAC5DV,EAAQ,CAAC,EACTH,EAAQ,gBAAgB,CAC1B,CACF,CAEAF,EAAM,iBACJ,QACA,IAAM,CACJ,aAAaG,CAAK,EAClBA,EAAQ,WAAW,IAAG,CAAQS,EAAIZ,EAAM,MAAM,KAAK,CAAC,GAAGF,CAAkB,CAC3E,EACA,CAAE,OAAAJ,CAAO,CACX,EAEA,IAAMsB,EAAKrB,EACT,MACA,CACE,MAAO,cACP,GAAI,CACF,QAAUoB,GAAM,CACd,IAAME,EAAOX,EAAQ,EACfY,EAAKD,EAAK,QAAQ,SAAS,aAAkC,EAC/DF,EAAE,MAAQ,UACZA,EAAE,eAAe,EACjBtB,EAAK,QAAQ,GACJsB,EAAE,MAAQ,aAAeE,EAAK,QACvCF,EAAE,eAAe,EACjBE,EAAK,KAAK,IAAIC,EAAK,EAAGD,EAAK,OAAS,CAAC,CAAC,EAAG,MAAM,GACtCF,EAAE,MAAQ,WAAaG,GAAM,IACtCH,EAAE,eAAe,EACbG,IAAO,EAAGlB,EAAM,MAAM,EACrBiB,EAAKC,EAAK,CAAC,EAAG,MAAM,EAE7B,CACF,EACA,OAAAxB,CACF,EACA,CAACC,EAAE,QAAS,CAAE,IAAKI,EAAI,MAAO,iBAAkB,EAAG,yBAAyB,EAAGC,EAAOC,EAAQC,CAAO,CACvG,EACA,OAAAR,EAAO,iBACL,QACA,IAAM,CACJ,aAAaS,CAAK,EAClBC,GAAU,MAAM,CAClB,EACA,CAAE,KAAM,EAAK,CACf,EAEO,CAAE,GAAAY,EAAI,MAAO,IAAMhB,EAAM,MAAM,EAAG,KAAAW,CAAK,CAChD",
6
+ "names": ["SearchError", "createUserSearch", "opts", "signal", "h", "uniqueId", "avatar", "SEARCH_DEBOUNCE_MS", "id", "input", "status", "results", "timer", "inflight", "shown", "buttons", "show", "users", "u", "b", "mark", "run", "query", "ac", "e", "el", "list", "at"]
7
+ }
@@ -12,10 +12,10 @@
12
12
  <link rel="apple-touch-icon" href="/icons/apple-touch-icon.png">
13
13
  <link rel="icon" type="image/svg+xml" href="/icons/icon.svg">
14
14
  <link rel="preload" href="/assets/inter-latin-NRMW37G5.woff2" as="font" type="font/woff2" crossorigin>
15
- <link rel="stylesheet" href="/assets/app-A3SXD3FF.css">
15
+ <link rel="stylesheet" href="/assets/app-WAFKVN2H.css">
16
16
  </head>
17
17
  <body>
18
18
  <div id="app"><header class="app-bar"><span class="brand">Chirkle</span></header><main class="app-main"></main></div>
19
- <script type="module" src="/assets/app-NDSIQW4L.js"></script>
19
+ <script type="module" src="/assets/app-3WX5JYL2.js"></script>
20
20
  </body>
21
21
  </html>
@@ -0,0 +1,25 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
6
+ <meta name="color-scheme" content="light dark">
7
+ <meta name="theme-color" content="#f1eefc" media="(prefers-color-scheme: light)">
8
+ <meta name="theme-color" content="#111214" media="(prefers-color-scheme: dark)">
9
+ <meta name="robots" content="noindex">
10
+ <title>Usage statistics</title>
11
+ <script>try{const t=localStorage.getItem("chat.theme");if(t==="light"||t==="dark")document.documentElement.dataset.theme=t}catch{}</script>
12
+ <link rel="icon" type="image/svg+xml" href="/icons/icon.svg">
13
+ <link rel="preload" href="/assets/inter-latin-NRMW37G5.woff2" as="font" type="font/woff2" crossorigin>
14
+ <link rel="stylesheet" href="/assets/stats-A2TBRUI6.css">
15
+ </head>
16
+ <body>
17
+ <header class="stats-bar">
18
+ <a class="brand" href="/">Chirkle</a>
19
+ <h1>Usage statistics</h1>
20
+ <span id="stats-updated" class="stats-updated" aria-live="polite"></span>
21
+ </header>
22
+ <main id="stats" class="stats"><p class="loading">Loading…</p></main>
23
+ <script type="module" src="/assets/stats-JX52AQCO.js"></script>
24
+ </body>
25
+ </html>
package/pb_public/sw.js CHANGED
@@ -1 +1 @@
1
- "use strict";(()=>{var s=self,c="chat-shell",o="/",r=/^\/assets\/.+-[A-Z0-9]{8}\.(js|css|woff2)$/,l="chat-files",d=/^\/api\/files\/messages\/[a-z0-9]+\/[^/]+$/,f=/^\/api\/chat\/posters\/[a-z0-9]+\/[^/]+$/,h=1e3,u=0,p=50;s.addEventListener("install",t=>t.waitUntil(s.skipWaiting()));s.addEventListener("activate",t=>t.waitUntil(s.clients.claim()));s.addEventListener("notificationclick",t=>{t.notification.close();let e=t.notification.data?.url;typeof e=="string"&&/^\/(?![/\\])/.test(e)&&t.waitUntil(w(e))});async function w(t){let e=await s.clients.matchAll({type:"window",includeUncontrolled:!0}),n=e.find(i=>i.focused)??e.find(i=>i.visibilityState==="visible")??e[0];if(!n)return s.clients.openWindow(t);await n.focus().catch(()=>{}),n.postMessage({open:t})}s.addEventListener("fetch",t=>{let e=t.request,n=new URL(e.url);if(e.method!=="GET"||n.origin!==location.origin)return;let i=d.test(n.pathname)&&n.searchParams.get("thumb");if(i||f.test(n.pathname)){t.respondWith(y(t,`${n.origin}${n.pathname}${i?`?thumb=${encodeURIComponent(i)}`:""}`));return}n.pathname.startsWith("/api/")||n.pathname.startsWith("/_/")||(e.mode==="navigate"?t.respondWith(m(t)):r.test(n.pathname)&&t.respondWith(E(e)))});async function m(t){try{let e=await fetch(t.request);return e.ok&&e.headers.get("content-type")?.startsWith("text/html")&&t.waitUntil(v(e.clone())),e}catch(e){let n=await caches.match(o,{cacheName:c});if(n)return n;throw e}}async function v(t){let e=await caches.open(c),n=await t.clone().text();await e.put(o,t);for(let i of await e.keys()){let a=new URL(i.url).pathname;a!==o&&!n.includes(a)&&await e.delete(i)}}async function E(t){let e=await caches.open(c),n=await e.match(t);if(n)return n;let i=await fetch(t);return i.ok&&await e.put(t,i.clone()),i}async function y(t,e){let n=await caches.open(l),i=await n.match(e);if(i)return i;let a=await fetch(t.request);return a.ok&&t.waitUntil(g(n,e,a.clone())),a}async function g(t,e,n){if(await t.put(e,n),u++%p)return;let i=await t.keys();for(let a of i.slice(0,Math.max(0,i.length-h)))await t.delete(a)}})();
1
+ "use strict";(()=>{var s=self,c="chat-shell",o="/",r=/^\/assets\/.+-[A-Z0-9]{8}\.(js|css|woff2)$/,l="chat-files",d=/^\/api\/files\/messages\/[a-z0-9]+\/[^/]+$/,f=/^\/api\/chat\/posters\/[a-z0-9]+\/[^/]+$/,h=1e3,p=0,u=50;s.addEventListener("install",t=>t.waitUntil(s.skipWaiting()));s.addEventListener("activate",t=>t.waitUntil(s.clients.claim()));s.addEventListener("notificationclick",t=>{t.notification.close();let e=t.notification.data?.url;typeof e=="string"&&/^\/(?![/\\])/.test(e)&&t.waitUntil(w(e))});async function w(t){let e=await s.clients.matchAll({type:"window",includeUncontrolled:!0}),n=e.find(i=>i.focused)??e.find(i=>i.visibilityState==="visible")??e[0];if(!n)return s.clients.openWindow(t);await n.focus().catch(()=>{}),n.postMessage({open:t})}s.addEventListener("fetch",t=>{let e=t.request,n=new URL(e.url);if(e.method!=="GET"||n.origin!==location.origin)return;let i=d.test(n.pathname)&&n.searchParams.get("thumb");if(i||f.test(n.pathname)){t.respondWith(y(t,`${n.origin}${n.pathname}${i?`?thumb=${encodeURIComponent(i)}`:""}`));return}n.pathname.startsWith("/api/")||n.pathname.startsWith("/_/")||n.pathname==="/stats"||(e.mode==="navigate"?t.respondWith(m(t)):r.test(n.pathname)&&t.respondWith(E(e)))});async function m(t){try{let e=await fetch(t.request);return e.ok&&e.headers.get("content-type")?.startsWith("text/html")&&t.waitUntil(v(e.clone())),e}catch(e){let n=await caches.match(o,{cacheName:c});if(n)return n;throw e}}async function v(t){let e=await caches.open(c),n=await t.clone().text();await e.put(o,t);for(let i of await e.keys()){let a=new URL(i.url).pathname;a!==o&&!n.includes(a)&&await e.delete(i)}}async function E(t){let e=await caches.open(c),n=await e.match(t);if(n)return n;let i=await fetch(t);return i.ok&&await e.put(t,i.clone()),i}async function y(t,e){let n=await caches.open(l),i=await n.match(e);if(i)return i;let a=await fetch(t.request);return a.ok&&t.waitUntil(g(n,e,a.clone())),a}async function g(t,e,n){if(await t.put(e,n),p++%u)return;let i=await t.keys();for(let a of i.slice(0,Math.max(0,i.length-h)))await t.delete(a)}})();
@@ -1,2 +0,0 @@
1
- var H=null;function ue(a){return H??=new Promise(l=>{let E=a("link",{rel:"stylesheet",href:"/assets/access-PB77EH4F.css",on:{load:()=>l(),error:()=>{E.remove(),H=null,l()}}});document.head.append(E)}),H}var me=["private","public","open"],Q={private:"ic i-lock",open:"ic i-globe",everyone:"ic i-users",selected:"ic i-check"},he={everyone:{label:"Everyone who can see it",icon:"",hint:"Guests of an Open Air room only read."},selected:{label:"Only people you choose",icon:"",hint:"Everyone else reads and reacts, but can't post."}};function be(a,l,t){return a===l?"":l==="open"?"Everything ever written here, and everything to come, becomes readable by anyone on the web.":a==="private"?"Everyone with an account will be able to read the whole history.":l==="private"?`Only ${t?"you and the people you add":"its creator and the people added"} will see this room. Everyone else loses it from their list.`:"People without an account won't see this room any more."}function pe(a){let{signal:l}=a,{h:t,uniqueId:E,avatar:X,createUserSearch:Z,SearchError:ee,reasonOf:te,isAddress:ne,postingOf:se,visibilityOf:_,VISIBILITY:ie}=a.kit,A={roomMembers:a.kit.maxMembers},w=E("access"),B=t("h2",{id:`${w}-title`}),D=t("p",{class:"dialog-sub"});function q(e,n,s){let o=t("legend",{}),c=new Map;return{el:t("fieldset",{class:"vis-choices"},[o,...e.map(i=>{let v=t("input",{type:"radio",name:`${w}-${e[0]}`,value:i,"aria-labelledby":`${w}-${i}-label`,"aria-describedby":`${w}-${i}-hint`,on:{change:()=>s(i)},signal:l});return c.set(i,v),t("label",{class:`vis-choice vis-${i}`},[v,t("span",{class:`vis-icon ${Q[i]??""}`,"aria-hidden":"true"},Q[i]?"":n[i].icon),t("span",{class:"vis-text"},[t("span",{id:`${w}-${i}-label`,class:"vis-label"},n[i].label),t("span",{id:`${w}-${i}-hint`,class:"vis-hint"},n[i].hint)])])})]),legend:o,radios:c}}let I=q(me,ie,e=>{p=e,K()});I.legend.textContent="Who can see it";let P=q(["everyone","selected"],he,e=>{$=e,K()});P.legend.textContent="Who can post";function N(e,n,s){let o=t("h3",{}),c=t("ul",{class:"member-list","aria-label":e}),r=t("button",{type:"button",class:"add-member ic i-plus",on:{click:()=>C(U)},signal:l},"Add people"),i=t("div",{class:"member-search"}),v=t("section",{class:n},[t("div",{class:"people-head"},[o,r]),i,c]),U={el:v,addBtn:r,slot:i,pickable:s,list:[],render(){let z=v.hidden?[]:U.list.filter(W);o.textContent=`${e} \xB7 ${z.length}`;let F=U.list.length>=A.roomMembers;r.hidden=!m||f?.p===U,r.disabled=F,r.title=F?`A room can have up to ${A.roomMembers} ${e.toLowerCase()}.`:"",c.replaceChildren(...z.map(y=>{let J=y.id===d?.created_by;return t("li",{class:"member",dataset:{userId:y.id}},[X(y,32,a.avatarUrl),t("span",{class:"member-name"},[y.name,y.id===T?t("span",{}," (you)"):null]),J?t("span",{class:"member-role"},"Creator"):null,y.instance?t("span",{class:"member-role"},y.instance):null,m&&!J?t("button",{type:"button",class:"remove-member","aria-label":`Remove ${y.name}`,on:{click:()=>ae(U,y.id)},signal:l},"Remove"):null])}))}};return U}let h=N("Members","members",()=>!0),u=N("Who can post","writers",e=>p!=="private"||O(h,e)),Y=t("p",{class:"access-warning",role:"status"}),V=t("p",{class:"access-shared"}),g=t("p",{class:"field-error",role:"alert"}),x=t("button",{type:"button",class:"cancel",on:{click:()=>k()},signal:l},"Cancel"),M=t("button",{type:"button",class:"primary save",on:{click:()=>{de()}},signal:l},"Save"),oe=t("div",{class:"dialog-actions"},[x,M]),R=t("button",{type:"button",class:"icon-button ic i-x",tabindex:"-1","aria-hidden":"true",on:{click:()=>k()},signal:l}),re=t("div",{class:"dialog-head"},[t("div",{},[B,D]),R]),le=t("div",{class:"access-body"},[V,I.el,h.el,P.el,u.el,Y,g]),b=t("dialog",{class:"access","aria-labelledby":B.id},[re,le,oe]),d=null,T,m=!1,p="public",$="everyone",O=(e,n)=>e.list.some(s=>s.id===n.id),W=e=>!e.no_dms||!!e.instance,G=()=>d?.shared?.with??[],f=null,L=!1;function K(){g.textContent="",p==="private"&&(u.list=u.list.filter(e=>O(h,e))),S()}function S(){if(!d)return;for(let[n,s]of I.radios)s.checked=n===p;for(let[n,s]of P.radios)s.checked=n===$;I.el.hidden=P.el.hidden=!m,h.el.hidden=p!=="private",u.el.hidden=$!=="selected",h.render(),u.render(),Y.textContent=m?be(_(d),p,d.created_by===T):"";let e=G();V.hidden=!e.length,V.textContent=e.length?d.shared?.home?`This room's home is ${d.shared.home}: who is in it is decided there.`:`Shared with ${e.join(", ")}: its messages are kept there too.${m?` Add people there by their address, like ann@${e[0]}.`:""}`:"",M.hidden=!m,x.textContent=m?"Cancel":"Close"}function ae(e,n){let s=e.el.querySelector("ul"),o=[...s.children].findIndex(r=>r.dataset.userId===n);e.list=e.list.filter(r=>r.id!==n),e===h&&(u.list=u.list.filter(r=>r.id!==n)),S();let c=[...s.querySelectorAll("button.remove-member")];(c[Math.min(o-1,c.length-1)]??e.addBtn).focus()}function ce(e,n){if(O(e,n))e.list=e.list.filter(s=>s.id!==n.id),e===h&&(u.list=u.list.filter(s=>s.id!==n.id));else if(e.list.length>=A.roomMembers){g.textContent=`A room can have up to ${A.roomMembers} ${e===h?"members":"people who post"}.`;return}else e.list=[...e.list,n];g.textContent="",S(),f?.ui.mark()}function C(e){if(e!==(f?.p??null))if(f?.ac.abort(),f?.p.slot.replaceChildren(),f=null,e){let n=new AbortController;l.addEventListener("abort",()=>n.abort(),{once:!0});let s=Z({search:async(o,c)=>{if(!ne(o)||!d||!G().length||!a.remoteUser)return(await a.searchUsers(o,c)).filter(r=>W(r)&&e.pickable(r));try{let r=await a.remoteUser(o,d.id);return e.pickable(r)?[r]:[]}catch(r){throw new ee(te(r))}},avatarUrl:a.avatarUrl,onPick:o=>ce(e,o),isPicked:o=>O(e,o),onClose:()=>{C(null),e.addBtn.focus()},signal:n.signal});f={ac:n,ui:s,p:e},e.slot.replaceChildren(s.el),S(),s.focus(),e.el.firstElementChild?.scrollIntoView?.({block:"start"})}else S()}async function de(){if(L||!d||!m)return;L=!0,M.disabled=x.disabled=R.disabled=!0,g.textContent="";let e=s=>s.list.map(o=>o.id),n=await a.onSave(p,e(h),$,e(u));if(L=!1,M.disabled=x.disabled=R.disabled=!1,!l.aborted){if(n===null)return k();g.textContent=n,b.open||b.showModal()}}function k(){C(null),b.open&&b.close()}b.addEventListener("cancel",e=>{if(L)e.preventDefault();else if(f){e.preventDefault();let n=f.p;C(null),n.addBtn.focus()}},{signal:l}),b.addEventListener("close",()=>C(null),{signal:l}),l.addEventListener("abort",k,{once:!0});function j(e,n,s,o){let c=new Map([...e.expand?.members??[],...s??[]].map(i=>[i.id,i]));return o&&!c.has(o.id)&&c.set(o.id,o),[...new Set(n.length?n:[e.created_by,T||e.created_by])].map(i=>c.get(i)??{id:i,name:"Unknown"}).sort((i,v)=>+(v.id===e.created_by)-+(i.id===e.created_by))}return{el:b,open(e,n,s){d=e,T=s?.id,m=n,p=_(e),$=se(e),h.list=j(e,e.members??[],void 0,s),u.list=j(e,e.writers??[],e.expand?.writers,s),B.textContent=m?"Room access":"Members",D.textContent=`#${e.name}`,g.textContent="",C(null),S(),ue(t).then(()=>{l.aborted||d!==e||(b.open||b.showModal(),(m?I.radios.get(p):x)?.focus())})},close:k}}export{pe as createAccessDialog};
2
- //# sourceMappingURL=access-ALBW2MT2.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../web/src/views/room/access.ts"],
4
- "sourcesContent": ["// Room access dialog (\u00A723.2, \u00A723.6): the creator (or a moderator, \u00A736) chooses who can see the room (Private, Public or Open Air) and, for a\n// private room, who its members are; then who can post: everyone who can see it, or only the people they choose.\n// Anyone else in a private room gets the same dialog to see who is in it (and who can post), read-only.\n// Telegram stand-ins (no_dms, \u00A726.3) are left out of it: the bridge adds them itself, so adding or removing one does\n// nothing. They stay members (and writers) when it is saved. People on linked instances (\u00A733) are listed with their\n// instance; in a room shared with theirs, the creator adds them by address (\"ann@b.example\"), and the dialog says\n// where else the room's messages are kept (\u00A733.9).\n// A modal <dialog>: it keeps focus inside, Escape closes it, and focus goes back to where it was.\n//\n// A lazy chunk, like search (\u00A729): the room view import()s it when the dialog is first opened, and it links its own\n// stylesheet (web/styles/access.css) before showing. It imports types only; what it needs from app.js comes in its\n// options (`kit`).\n\nimport type { reasonOf } from \"../../api.ts\";\nimport type { h, uniqueId } from \"../../dom.ts\";\nimport type { isAddress, postingOf, VISIBILITY, visibilityOf } from \"../../lib/rooms.ts\";\nimport type { Posting, Room, User, Visibility } from \"../../lib/types.ts\";\nimport type { AvatarUrl, avatar } from \"../../ui/avatar.ts\";\nimport type { createUserSearch, SearchError, UserSearch } from \"../../ui/user-search.ts\";\n\n/** What the dialog uses of app.js. */\nexport interface AccessKit {\n h: typeof h;\n uniqueId: typeof uniqueId;\n avatar: typeof avatar;\n createUserSearch: typeof createUserSearch;\n SearchError: typeof SearchError;\n reasonOf: typeof reasonOf;\n isAddress: typeof isAddress;\n postingOf: typeof postingOf;\n visibilityOf: typeof visibilityOf;\n VISIBILITY: typeof VISIBILITY;\n /** Most members (and writers) a room has (LIMITS.roomMembers). */\n maxMembers: number;\n}\n\nexport interface AccessDialog {\n readonly el: HTMLDialogElement;\n /** Open it for `room`: to change its access when `editable`, else to see its members. `me` names you in the list. */\n open(room: Room, editable: boolean, me: User | null): void;\n close(): void;\n}\n\ndeclare const ACCESS_CSS: string;\n\nlet stylesheet: Promise<void> | null = null;\n/** The dialog's stylesheet, linked once, like the media grid's: a failed load is tried again next time, and it opens anyway. */\nfunction loadStylesheet(h: typeof import(\"../../dom.ts\")[\"h\"]): Promise<void> {\n stylesheet ??= new Promise((resolve) => {\n const failed = () => {\n link.remove();\n stylesheet = null;\n resolve();\n };\n const link = h(\"link\", { rel: \"stylesheet\", href: ACCESS_CSS, on: { load: () => resolve(), error: failed } });\n document.head.append(link);\n });\n return stylesheet;\n}\n\nconst CHOICES: readonly Visibility[] = [\"private\", \"public\", \"open\"];\n\n/** Who can post (\u00A723.6), shown like the visibilities. */\n/** The choices' icons (.i-* in icons.css); Public keeps its \"#\". */\nconst ICONS: Record<string, string> = { private: \"ic i-lock\", open: \"ic i-globe\", everyone: \"ic i-users\", selected: \"ic i-check\" };\n\nconst POSTING: Record<Posting, { label: string; icon: string; hint: string }> = {\n everyone: { label: \"Everyone who can see it\", icon: \"\", hint: \"Guests of an Open Air room only read.\" },\n selected: { label: \"Only people you choose\", icon: \"\", hint: \"Everyone else reads and reacts, but can't post.\" },\n};\n\n/** What a change of visibility does that may not be obvious, or \"\". */\nfunction warning(from: Visibility, to: Visibility, mine: boolean): string {\n if (from === to) return \"\";\n if (to === \"open\") return \"Everything ever written here, and everything to come, becomes readable by anyone on the web.\";\n if (from === \"private\") return \"Everyone with an account will be able to read the whole history.\";\n if (to === \"private\")\n return `Only ${mine ? \"you and the people you add\" : \"its creator and the people added\"} will see this room. Everyone else loses it from their list.`;\n return \"People without an account won't see this room any more.\";\n}\n\n/** A list of people with Add and Remove: the members, or who can post. */\ninterface People {\n readonly el: HTMLElement;\n readonly addBtn: HTMLButtonElement;\n /** Where its search goes. */\n readonly slot: HTMLElement;\n /** Who its search offers. */\n pickable(u: User): boolean;\n list: User[];\n render(): void;\n}\n\nexport function createAccessDialog(opts: {\n kit: AccessKit;\n searchUsers: (query: string, signal: AbortSignal) => Promise<User[]>;\n /** Someone on a linked instance by address, to add to this shared room (\u00A733.5). */\n remoteUser?: (address: string, room: string) => Promise<User>;\n avatarUrl: AvatarUrl;\n /** Save. Resolves to what went wrong, or null once it is saved (the dialog then closes). */\n onSave: (visibility: Visibility, members: string[], posting: Posting, writers: string[]) => Promise<string | null>;\n signal: AbortSignal;\n}): AccessDialog {\n const { signal } = opts;\n const { h, uniqueId, avatar, createUserSearch, SearchError, reasonOf, isAddress, postingOf, visibilityOf, VISIBILITY } = opts.kit;\n const LIMITS = { roomMembers: opts.kit.maxMembers };\n const id = uniqueId(\"access\");\n const title = h(\"h2\", { id: `${id}-title` });\n const sub = h(\"p\", { class: \"dialog-sub\" });\n\n /** Radio cards: one fieldset of `values`, each with its icon, label and hint. */\n function cards<T extends string>(\n values: readonly T[],\n info: Record<T, { label: string; icon: string; hint: string }>,\n set: (v: T) => void,\n ) {\n const legend = h(\"legend\", {});\n const radios = new Map<T, HTMLInputElement>();\n const el = h(\"fieldset\", { class: \"vis-choices\" }, [\n legend,\n ...values.map((v) => {\n const input = h(\"input\", {\n type: \"radio\",\n name: `${id}-${values[0]}`,\n value: v,\n \"aria-labelledby\": `${id}-${v}-label`,\n \"aria-describedby\": `${id}-${v}-hint`,\n on: { change: () => set(v) },\n signal,\n });\n radios.set(v, input);\n return h(\"label\", { class: `vis-choice vis-${v}` }, [\n input,\n h(\"span\", { class: `vis-icon ${ICONS[v] ?? \"\"}`, \"aria-hidden\": \"true\" }, ICONS[v] ? \"\" : info[v].icon),\n h(\"span\", { class: \"vis-text\" }, [\n h(\"span\", { id: `${id}-${v}-label`, class: \"vis-label\" }, info[v].label),\n h(\"span\", { id: `${id}-${v}-hint`, class: \"vis-hint\" }, info[v].hint),\n ]),\n ]);\n }),\n ]);\n return { el, legend, radios };\n }\n\n const choices = cards(CHOICES, VISIBILITY, (v) => {\n visibility = v;\n changed();\n });\n choices.legend.textContent = \"Who can see it\";\n const postingChoices = cards([\"everyone\", \"selected\"] as const, POSTING, (p) => {\n posting = p;\n changed();\n });\n postingChoices.legend.textContent = \"Who can post\";\n\n /**\n * One list of people. `pickable` says who its search offers: the members are anyone; who can post, in a private\n * room, only its members.\n */\n function people(label: string, cls: string, pickable: (u: User) => boolean): People {\n const head = h(\"h3\", {});\n const ul = h(\"ul\", { class: \"member-list\", \"aria-label\": label });\n const addBtn = h(\n \"button\",\n { type: \"button\", class: \"add-member ic i-plus\", on: { click: () => toggleSearch(p) }, signal },\n \"Add people\",\n );\n const slot = h(\"div\", { class: \"member-search\" });\n // Search above the list, so it stays in reach however many people there are.\n const el = h(\"section\", { class: cls }, [h(\"div\", { class: \"people-head\" }, [head, addBtn]), slot, ul]);\n const p: People = {\n el,\n addBtn,\n slot,\n pickable,\n list: [],\n render() {\n // Hidden, it lists nobody: only the lists in use are in the page.\n const shown = el.hidden ? [] : p.list.filter(listed);\n head.textContent = `${label} \u00B7 ${shown.length}`;\n const full = p.list.length >= LIMITS.roomMembers;\n addBtn.hidden = !editable || search?.p === p;\n addBtn.disabled = full;\n addBtn.title = full ? `A room can have up to ${LIMITS.roomMembers} ${label.toLowerCase()}.` : \"\";\n ul.replaceChildren(\n ...shown.map((u) => {\n const owner = u.id === room?.created_by;\n return h(\"li\", { class: \"member\", dataset: { userId: u.id } }, [\n avatar(u, 32, opts.avatarUrl),\n h(\"span\", { class: \"member-name\" }, [u.name, u.id === myId ? h(\"span\", {}, \" (you)\") : null]),\n owner ? h(\"span\", { class: \"member-role\" }, \"Creator\") : null,\n u.instance ? h(\"span\", { class: \"member-role\" }, u.instance) : null,\n editable && !owner\n ? h(\n \"button\",\n {\n type: \"button\",\n class: \"remove-member\",\n \"aria-label\": `Remove ${u.name}`,\n on: { click: () => remove(p, u.id) },\n signal,\n },\n \"Remove\",\n )\n : null,\n ]);\n }),\n );\n },\n };\n return p;\n }\n\n const members = people(\"Members\", \"members\", () => true);\n const writers = people(\"Who can post\", \"writers\", (u) => visibility !== \"private\" || has(members, u));\n const warn = h(\"p\", { class: \"access-warning\", role: \"status\" });\n const sharedEl = h(\"p\", { class: \"access-shared\" });\n const error = h(\"p\", { class: \"field-error\", role: \"alert\" });\n const cancel = h(\"button\", { type: \"button\", class: \"cancel\", on: { click: () => close() }, signal }, \"Cancel\");\n const save = h(\"button\", { type: \"button\", class: \"primary save\", on: { click: () => void submit() }, signal }, \"Save\");\n const buttons = h(\"div\", { class: \"dialog-actions\" }, [cancel, save]);\n // For the pointer only: the footer's Cancel/Close and Escape do the same, so it isn't a second \"Close\" to tab to or hear.\n const x = h(\"button\", {\n type: \"button\",\n class: \"icon-button ic i-x\",\n tabindex: \"-1\",\n \"aria-hidden\": \"true\",\n on: { click: () => close() },\n signal,\n });\n const head = h(\"div\", { class: \"dialog-head\" }, [h(\"div\", {}, [title, sub]), x]);\n // The body scrolls; the title and the buttons stay put.\n const body = h(\"div\", { class: \"access-body\" }, [sharedEl, choices.el, members.el, postingChoices.el, writers.el, warn, error]);\n const el = h(\"dialog\", { class: \"access\", \"aria-labelledby\": title.id }, [head, body, buttons]);\n\n let room: Room | null = null;\n let myId: string | undefined;\n let editable = false;\n let visibility: Visibility = \"public\";\n let posting: Posting = \"everyone\";\n const has = (p: People, u: User) => p.list.some((x) => x.id === u.id);\n /** Who the lists show: not Telegram's stand-ins, but people on linked instances (\u00A733.4) even without DMs. */\n const listed = (u: User) => !u.no_dms || !!u.instance;\n const sharedHosts = () => room?.shared?.with ?? [];\n let search: { ac: AbortController; ui: UserSearch; p: People } | null = null;\n let busy = false;\n\n function changed() {\n error.textContent = \"\";\n // Made private: only members can post.\n if (visibility === \"private\") writers.list = writers.list.filter((u) => has(members, u));\n render();\n }\n\n function render() {\n if (!room) return;\n for (const [v, input] of choices.radios) input.checked = v === visibility;\n for (const [v, input] of postingChoices.radios) input.checked = v === posting;\n choices.el.hidden = postingChoices.el.hidden = !editable;\n members.el.hidden = visibility !== \"private\";\n writers.el.hidden = posting !== \"selected\";\n members.render();\n writers.render();\n warn.textContent = editable ? warning(visibilityOf(room), visibility, room.created_by === myId) : \"\";\n const hosts = sharedHosts();\n sharedEl.hidden = !hosts.length;\n sharedEl.textContent = !hosts.length\n ? \"\"\n : room.shared?.home\n ? `This room's home is ${room.shared.home}: who is in it is decided there.`\n : `Shared with ${hosts.join(\", \")}: its messages are kept there too.${editable ? ` Add people there by their address, like ann@${hosts[0]}.` : \"\"}`;\n save.hidden = !editable;\n cancel.textContent = editable ? \"Cancel\" : \"Close\";\n }\n\n function remove(p: People, userId: string) {\n const ul = p.el.querySelector(\"ul\")!;\n const at = [...ul.children].findIndex((li) => (li as HTMLElement).dataset.userId === userId);\n p.list = p.list.filter((u) => u.id !== userId);\n // A member taken out can't post either.\n if (p === members) writers.list = writers.list.filter((u) => u.id !== userId);\n render();\n // Focus stays in the list: on the next person's Remove, else the previous one's, else Add people.\n const buttons = [...ul.querySelectorAll<HTMLButtonElement>(\"button.remove-member\")];\n (buttons[Math.min(at - 1, buttons.length - 1)] ?? p.addBtn).focus();\n }\n\n /** A search result picked: add them, or take them out again when they are in. */\n function toggle(p: People, u: User) {\n if (has(p, u)) {\n p.list = p.list.filter((x) => x.id !== u.id);\n if (p === members) writers.list = writers.list.filter((x) => x.id !== u.id);\n } else if (p.list.length >= LIMITS.roomMembers) {\n error.textContent = `A room can have up to ${LIMITS.roomMembers} ${p === members ? \"members\" : \"people who post\"}.`;\n return;\n } else p.list = [...p.list, u];\n error.textContent = \"\";\n render();\n search?.ui.mark();\n }\n\n /** Open the people search under `p`'s Add button (closing any other), or close it (null). */\n function toggleSearch(p: People | null) {\n if (p === (search?.p ?? null)) return;\n search?.ac.abort();\n search?.p.slot.replaceChildren();\n search = null;\n if (p) {\n const ac = new AbortController();\n signal.addEventListener(\"abort\", () => ac.abort(), { once: true });\n const ui = createUserSearch({\n search: async (q, sig) => {\n if (!isAddress(q) || !room || !sharedHosts().length || !opts.remoteUser) {\n return (await opts.searchUsers(q, sig)).filter((u) => listed(u) && p.pickable(u));\n }\n try {\n const u = await opts.remoteUser(q, room.id);\n return p.pickable(u) ? [u] : [];\n } catch (e) {\n throw new SearchError(reasonOf(e));\n }\n },\n avatarUrl: opts.avatarUrl,\n onPick: (u) => toggle(p, u),\n isPicked: (u) => has(p, u),\n onClose: () => {\n toggleSearch(null);\n p.addBtn.focus();\n },\n signal: ac.signal,\n });\n search = { ac, ui, p };\n p.slot.replaceChildren(ui.el);\n render();\n ui.focus();\n // Room for the results under it, on a small screen too.\n p.el.firstElementChild?.scrollIntoView?.({ block: \"start\" });\n } else render();\n }\n\n async function submit() {\n if (busy || !room || !editable) return;\n busy = true;\n save.disabled = cancel.disabled = x.disabled = true;\n error.textContent = \"\";\n const ids = (p: People) => p.list.map((u) => u.id);\n const problem = await opts.onSave(visibility, ids(members), posting, ids(writers));\n busy = false;\n save.disabled = cancel.disabled = x.disabled = false;\n if (signal.aborted) return;\n if (problem === null) return close();\n error.textContent = problem;\n if (!el.open) el.showModal();\n }\n\n function close() {\n toggleSearch(null);\n if (el.open) el.close();\n }\n\n // Escape in the people search closes the search, not the dialog; while saving, nothing closes it.\n el.addEventListener(\n \"cancel\",\n (e) => {\n if (busy) e.preventDefault();\n else if (search) {\n e.preventDefault();\n const p = search.p;\n toggleSearch(null);\n p.addBtn.focus();\n }\n },\n { signal },\n );\n el.addEventListener(\"close\", () => toggleSearch(null), { signal });\n signal.addEventListener(\"abort\", close, { once: true });\n\n /** The people `ids` names, as expanded, the creator first (as the server keeps them). */\n function users(r: Room, ids: string[], expanded: User[] | undefined, me: User | null) {\n const known = new Map([...(r.expand?.members ?? []), ...(expanded ?? [])].map((u) => [u.id, u]));\n // A room made private (or posting chosen) starts with its creator, who isn't expanded yet, and a moderator making\n // it so with themselves (\u00A736), who would otherwise lose it.\n if (me && !known.has(me.id)) known.set(me.id, me);\n const list = [...new Set(ids.length ? ids : [r.created_by, myId || r.created_by])].map(\n (uid) => known.get(uid) ?? { id: uid, name: \"Unknown\" },\n );\n return list.sort((a, b) => Number(b.id === r.created_by) - Number(a.id === r.created_by));\n }\n\n return {\n el,\n open(r, canEdit, me) {\n room = r;\n myId = me?.id;\n editable = canEdit;\n visibility = visibilityOf(r);\n posting = postingOf(r);\n members.list = users(r, r.members ?? [], undefined, me);\n writers.list = users(r, r.writers ?? [], r.expand?.writers, me);\n title.textContent = editable ? \"Room access\" : \"Members\";\n sub.textContent = `#${r.name}`;\n error.textContent = \"\";\n toggleSearch(null);\n render();\n void loadStylesheet(h).then(() => {\n if (signal.aborted || room !== r) return;\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ylesheet", "h", "resolve", "link", "CHOICES", "ICONS", "POSTING", "warning", "from", "to", "mine", "createAccessDialog", "opts", "signal", "uniqueId", "avatar", "createUserSearch", "SearchError", "reasonOf", "isAddress", "postingOf", "visibilityOf", "VISIBILITY", "LIMITS", "id", "title", "sub", "cards", "values", "info", "set", "legend", "radios", "v", "input", "choices", "visibility", "changed", "postingChoices", "p", "posting", "people", "label", "cls", "pickable", "head", "ul", "addBtn", "toggleSearch", "slot", "el", "shown", "listed", "full", "editable", "search", "u", "owner", "room", "myId", "remove", "members", "writers", "has", "warn", "sharedEl", "error", "cancel", "close", "save", "submit", "buttons", "x", "body", "sharedHosts", "busy", "render", "hosts", "userId", "at", "li", "toggle", "ac", "ui", "q", "sig", "e", "ids", "problem", "users", "r", "expanded", "me", "known", "uid", "a", "b", "canEdit"]
7
- }
@@ -1,2 +0,0 @@
1
- @font-face{font-family:Inter;font-style:normal;font-weight:100 900;font-display:swap;src:url("./inter-cyrillic-ext-IYF56FF6.woff2") format("woff2");unicode-range:U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Inter;font-style:normal;font-weight:100 900;font-display:swap;src:url("./inter-cyrillic-JEOLYBOO.woff2") format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Inter;font-style:normal;font-weight:100 900;font-display:swap;src:url("./inter-greek-IRE366VL.woff2") format("woff2");unicode-range:U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF}@font-face{font-family:Inter;font-style:normal;font-weight:100 900;font-display:swap;src:url("./inter-latin-ext-HA22NDSG.woff2") format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Inter;font-style:normal;font-weight:100 900;font-display:swap;src:url("./inter-latin-NRMW37G5.woff2") format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}:root{color-scheme:light dark;--bg: #fbfaff;--surface: #f1eefc;--raised: #fff;--fg: #1d1530;--text: #1d1530;--muted: #5e5874;--dim: #645e7c;--border: #e3ddf5;--line: #e3ddf5;--hover: #e9e4fb;--accent: #5b3df5;--fill: #5b3df5;--on-fill: #fff;--accent-2: #c42a7c;--grad: linear-gradient(135deg, #6a4bff, #c42a7c);--tint: color-mix(in srgb, var(--accent) 14%, transparent);--danger: #c41d36;--new: #b0175f;--highlight: #fff1b8;--shadow: 0 6px 24px rgb(60 30 140 / 14%);--radius: 10px;--pill: 999px;--ease: cubic-bezier(.34, 1.56, .64, 1);font:16px/1.5 Inter,system-ui,-apple-system,Segoe UI,Roboto,sans-serif;font-feature-settings:"calt" 0}@media(prefers-color-scheme:dark){:root:not([data-theme=light]){--bg: #1a1b1e;--surface: #111214;--raised: #232428;--fg: #ecece8;--text: #e0e0db;--muted: #b0b4ba;--dim: #9ea2a9;--border: #3a3d42;--line: #2a2c30;--hover: #2a2c30;--accent: #a58bff;--fill: #a58bff;--on-fill: #16181a;--danger: #ff7a8f;--new: #f9a8d4;--highlight: #3d3314;--shadow: 0 12px 32px rgb(0 0 0 / 45%)}}:root[data-theme=light]{color-scheme:light}:root[data-theme=dark]{color-scheme:dark;--bg: #1a1b1e;--surface: #111214;--raised: #232428;--fg: #ecece8;--text: #e0e0db;--muted: #b0b4ba;--dim: #9ea2a9;--border: #3a3d42;--line: #2a2c30;--hover: #2a2c30;--accent: #a58bff;--fill: #a58bff;--on-fill: #16181a;--danger: #ff7a8f;--new: #f9a8d4;--highlight: #3d3314;--shadow: 0 12px 32px rgb(0 0 0 / 45%)}*,*:before,*:after{box-sizing:border-box}[hidden]{display:none!important}body{margin:0;background:var(--bg);color:var(--fg);font-size:.875rem}@media(max-width:720px){body{font-size:.9375rem}body input,body textarea,body select{font-size:1rem}}::selection{background:color-mix(in srgb,var(--accent) 35%,transparent)}*{scrollbar-width:thin;scrollbar-color:var(--border) transparent}a{color:var(--accent)}h1,h2{margin:0;line-height:1.2;font-weight:700;letter-spacing:-.01em}button,input,textarea{margin:0;font:inherit;color:inherit}button,label.button{padding:.45rem .9rem;border:1px solid var(--border);border-radius:var(--radius);background:var(--raised);font-weight:600;cursor:pointer;transition:transform .15s var(--ease),background-color .15s}@media(hover:hover){button:hover:not(:disabled){background:var(--hover)}}button:active:not(:disabled){transform:scale(.95)}button:disabled{opacity:.5;cursor:default}button.primary,.auth-form button[type=submit],.composer button[type=submit],.new-room button[type=submit]{border-color:transparent;background:var(--fill);color:var(--on-fill)}@media(hover:hover){button.primary:hover:not(:disabled),.auth-form button[type=submit]:hover:not(:disabled),.composer button[type=submit]:hover:not(:disabled),.new-room button[type=submit]:hover:not(:disabled){background:var(--fill);filter:brightness(1.12)}}button.danger{color:var(--danger);border-color:currentcolor}button.link{border:0;background:none;color:var(--accent);padding:.25rem}input,textarea{width:100%;padding:.55rem .75rem;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface);transition:border-color .15s}input:focus,textarea:focus{border-color:var(--accent)}:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.i,.ic:before{content:"";display:inline-block;flex:none;width:18px;height:18px;background:currentcolor;mask:var(--i) center / contain no-repeat}.icon-button{display:inline-flex;flex:none;align-items:center;justify-content:center;width:36px;height:36px;padding:0;border:0;border-radius:8px;background:none;color:var(--muted)}input:focus-visible,textarea:focus-visible{outline:3px solid var(--tint);outline-offset:0}[aria-invalid=true]{border-color:var(--danger)}.field-error,.form-error,.list-error,.room-error,.send-error,.msg-error{color:var(--danger);font-size:.85rem;margin:.25rem 0}.field-error:empty,.form-error:empty,.list-error:empty,.room-error:empty{display:none}.visually-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.i-search{--i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E")}.i-lock{--i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='11' width='16' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3C/svg%3E")}.i-globe{--i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18'/%3E%3C/svg%3E")}.i-chev{--i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")}.i-back{--i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 18-6-6 6-6'/%3E%3C/svg%3E")}.i-plus{--i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E")}.i-gear{--i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1.1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1.1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9a1.7 1.7 0 0 0 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1Z'/%3E%3C/svg%3E")}.i-dots{--i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='5' cy='12' r='1'/%3E%3Ccircle cx='12' cy='12' r='1'/%3E%3Ccircle cx='19' cy='12' r='1'/%3E%3C/svg%3E")}.i-media{--i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='3'/%3E%3Ccircle cx='9' cy='9' r='2'/%3E%3Cpath d='m21 15-5-5L5 21'/%3E%3C/svg%3E")}.i-clip{--i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.4 11.1-9.2 9.2a6 6 0 0 1-8.5-8.5l9.2-9.2a4 4 0 0 1 5.7 5.7l-9.2 9.2a2 2 0 0 1-2.8-2.8l8.5-8.5'/%3E%3C/svg%3E")}.i-smile{--i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M8 14s1.5 2 4 2 4-2 4-2M9 9h.01M15 9h.01'/%3E%3C/svg%3E")}.i-send{--i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E")}.i-react{--i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12a9 9 0 1 1-6-8.5M8 14s1.5 2 4 2 4-2 4-2M9 9h.01M15 9h.01M19 2v6M16 5h6'/%3E%3C/svg%3E")}.i-reply{--i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 17 4 12l5-5M20 18v-2a4 4 0 0 0-4-4H4'/%3E%3C/svg%3E")}.i-fwd{--i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 17 5-5-5-5M4 18v-2a4 4 0 0 1 4-4h12'/%3E%3C/svg%3E")}.i-check{--i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='4'/%3E%3Cpath d='m8 12 3 3 5-6'/%3E%3C/svg%3E")}.i-edit{--i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z'/%3E%3C/svg%3E")}.i-trash{--i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6'/%3E%3C/svg%3E")}.i-x{--i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E")}.i-upload{--i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M17 8l-5-5-5 5M12 3v12'/%3E%3C/svg%3E")}.i-down{--i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v14M19 12l-7 7-7-7'/%3E%3C/svg%3E")}.i-top{--i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 3h14M12 21V8M6 13l6-6 6 6'/%3E%3C/svg%3E")}.i-eyeoff{--i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.9 4.2A10 10 0 0 1 12 4c6.5 0 10 8 10 8a17 17 0 0 1-2.2 3.2M6.6 6.6A17 17 0 0 0 2 12s3.5 8 10 8a10 10 0 0 0 5.4-1.6M3 3l18 18M10 10a3 3 0 0 0 4 4'/%3E%3C/svg%3E")}.i-archive{--i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='5' rx='1'/%3E%3Cpath d='M5 9v9a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V9M10 13h4'/%3E%3C/svg%3E")}.i-bell{--i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9M10.3 21a1.9 1.9 0 0 0 3.4 0'/%3E%3C/svg%3E")}.i-users{--i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8' r='4'/%3E%3Cpath d='M2 21v-1a6 6 0 0 1 6-6h2a6 6 0 0 1 6 6v1M16 4a4 4 0 0 1 0 8M22 21v-1a6 6 0 0 0-4-5.6'/%3E%3C/svg%3E")}.i-file{--i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9Z'/%3E%3Cpath d='M14 3v6h6'/%3E%3C/svg%3E")}html,body,#app{height:100%}html{touch-action:manipulation}#app{display:flex;flex-direction:column;height:100dvh}.app-bar{display:flex;gap:.75rem;align-items:center;min-height:60px;padding:0 .5rem 0 1rem;border-bottom:1px solid var(--line);background:var(--surface)}#app:has(.auth-form) .guest-links{display:none}@media(min-width:721px){#app:has(.layout)>.app-bar{display:none}}.brand{display:flex;flex:0 1 auto;min-width:0;gap:.6rem;align-items:center;font-size:1rem;font-weight:700;letter-spacing:-.01em}.brand:before{content:"";flex:none;width:30px;height:30px;background:url(/icons/icon.svg) center / contain no-repeat}.brand.has-logo:before{content:none}.brand-logo{flex:none;height:1.75rem;max-width:6rem;object-fit:contain}.brand-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.brand-name{display:grid;min-width:0}div.brand{position:relative}div.brand .brand-title:after{content:"";position:absolute;inset:0}.brand-by{font-size:.75rem;font-weight:400;color:var(--muted)}.brand-by a{position:relative;color:inherit}.bar-end{display:flex;gap:.25rem;align-items:center;min-width:0;margin-left:auto}.me-link{display:flex;flex:1;gap:.6rem;align-items:center;min-width:0;padding:.4rem;border-radius:var(--radius);color:var(--fg);font-weight:600;text-decoration:none}.who{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.app-bar .me-link{padding:6px}.app-bar .who{display:none}@media(hover:hover){.me-link:hover,.icon-button:hover{background:var(--hover)}}.me-link[aria-current=page]{background:var(--tint)}.app-bar .icon-button{width:44px;height:44px}.update-bar{padding:6px 16px;text-align:center;background:var(--tint);font-size:.875rem}.app-main{flex:1;min-height:0;overflow-y:auto}.layout{display:flex;height:100%;background:var(--surface)}.sidebar{display:flex;flex:0 0 280px;flex-direction:column;min-width:0;min-height:0;border-right:1px solid var(--line);background:var(--surface)}.sidebar .rooms{display:flex;flex:1;flex-direction:column;min-height:0;max-width:none;margin:0;padding:0}.sidebar nav{flex:1;padding:0 12px 12px;overflow-y:auto}.side-top{display:flex;flex-direction:column;gap:12px;padding:14px 14px 17px;background:linear-gradient(var(--line),var(--line)) bottom / calc(100% - 32px) 1px no-repeat}.side-top .brand{height:44px;padding:0 8px;color:var(--fg)}.jump-button{display:flex;gap:10px;align-items:center;height:38px;padding:0 8px 0 12px;border-color:var(--border);background:var(--bg);color:var(--dim);font-weight:400;text-align:left}.jump-button:before{width:16px;height:16px}.jump-button span{flex:1}.jump-button:active:not(:disabled){transform:none}.side-foot{display:flex;flex:none;flex-wrap:wrap;gap:4px;align-items:center;min-height:68px;padding:8px 12px 8px 10px;border-top:1px solid var(--line)}.side-foot .me-link{gap:10px;height:48px;padding:0 8px}.side-foot .avatar{width:34px;height:34px}.side-foot .icon-button:before{width:17px;height:17px}.side-foot p{flex-basis:100%;margin:4px 4px 6px;color:var(--muted);font-size:.8125rem}.side-foot .button{flex:1}a.button,.guest-link{display:inline-flex;align-items:center;justify-content:center;height:40px;padding:0 1rem;border:1px solid var(--border);border-radius:var(--radius);color:var(--fg);font-weight:600;text-decoration:none}a.button.primary,.guest-link.primary{border-color:transparent;background:var(--fill);color:var(--on-fill)}.pane{flex:1;min-width:0;overflow-y:auto;background:var(--bg)}.welcome{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;padding:2rem 1rem;text-align:center}.welcome:before{content:"\1f44b";margin-bottom:.75rem;font-size:3.5rem;animation:wave 2s ease-in-out infinite}.welcome h1{margin:0 0 .5rem;font-size:1.75rem}.welcome p{margin:0;color:var(--muted)}.avatar{display:inline-flex;flex:none;align-items:center;justify-content:center;border-radius:50%;object-fit:cover;overflow:hidden;font-weight:700;line-height:1;color:#fff;user-select:none}.avatar.s24{width:24px;height:24px;font-size:.6rem}.avatar.s32{width:32px;height:32px;font-size:.75rem}.msg>.avatar.s32{width:36px;height:36px}.avatar.s96{width:96px;height:96px;font-size:2rem;box-shadow:0 0 0 4px var(--bg),0 0 0 7px var(--accent)}.avatar.c0{background:#c4213b}.avatar.c1{background:#b04a00}.avatar.c2{background:#7a6000}.avatar.c3{background:#22803a}.avatar.c4{background:#00796b}.avatar.c5{background:#1d63d8}.avatar.c6{background:#7b3fe4}.avatar.c7{background:#c01a6e}.profile-body{display:flex;flex-direction:column;gap:20px;max-width:736px;padding:28px 28px 48px}.card,.profile-notify{display:flex;flex-direction:column;gap:14px;margin:0;padding:18px 20px 20px;border:1px solid var(--line);border-radius:16px;background:color-mix(in srgb,var(--fg) 3%,var(--bg))}.profile-body h2,.card legend,.profile-notify legend{margin:0;padding:0;font-size:.9375rem;font-weight:600;line-height:1.3;letter-spacing:0}.card legend,.profile-notify legend{float:left;width:100%}.profile-avatar{display:flex;gap:16px;align-items:center}.profile-avatar h2{margin-bottom:8px}.profile-picture.busy{opacity:.6}.profile-avatar-actions{display:flex;flex-wrap:wrap;gap:8px}.profile-avatar-actions>.button,.profile-avatar-actions>button{display:inline-flex;align-items:center;height:34px;padding:0 14px;border-color:transparent;border-radius:9px;font-size:.8125rem}label.button{background:var(--hover)}.profile-avatar-actions button{padding:0 12px;background:none;color:var(--muted)}label.button:focus-within,.profile-avatar-actions input:focus-visible+label.button{outline:2px solid var(--accent);outline-offset:2px}label.button.disabled{opacity:.5;pointer-events:none}.profile-theme:not(.profile-notify){display:grid;grid-template-columns:1fr auto;align-items:center;column-gap:16px;row-gap:3px}.profile-theme legend{grid-column:1}.field-status{margin:.25rem 0;font-size:.8125rem;color:var(--muted)}.profile-theme .field-status{grid-column:1;margin:0;line-height:1.3}.profile-theme{padding-bottom:18px}.segmented{display:inline-flex;gap:2px;padding:3px;border-radius:10px;background:var(--surface)}.profile-theme .segmented{grid-column:2;grid-row:1 / span 2}.segmented label{position:relative;padding:0 14px;border-radius:8px;color:var(--muted);font-size:.8125rem;font-weight:600;line-height:32px;cursor:pointer}.segmented label:has(input:checked){background:var(--hover);color:var(--fg)}.segmented label:has(input:focus-visible){outline:2px solid var(--accent);outline-offset:2px}.segmented input{position:absolute;opacity:0;pointer-events:none}.profile-password{display:grid;grid-template-columns:1fr 1fr;gap:12px}.profile-password>:not(.field:nth-of-type(n+2)){grid-column:1 / -1}.profile-password button{justify-self:start}.profile-name label,.field label{display:block;margin-bottom:6px;color:var(--muted);font-size:.8125rem;font-weight:600}.profile-name .row{display:flex;gap:8px}.profile-name input{flex:1;min-width:0}.field-status.error{color:var(--danger)}.profile-password .field-status,.profile-password .field-error{margin:0}.profile-session{flex-direction:row;align-items:center;justify-content:space-between}.profile-session .field-status{margin:3px 0 0}.profile-notify{gap:0;padding-bottom:0}.profile-notify legend{order:-2;margin-bottom:3px}.profile-notify>.field-status{order:-1;margin:0 0 10px}.profile-notify>.field-status:empty{margin:0}.profile-avatar .avatar{width:72px;height:72px;font-size:1.5rem;box-shadow:0 0 0 3px var(--bg),0 0 0 5px var(--accent)}.notify-choice{display:flex;flex-direction:row-reverse;justify-content:space-between;align-items:center;min-height:52px;margin:0 -20px;padding:0 20px;border-top:1px solid var(--line);cursor:pointer}.notify-choice input,input.switch{appearance:none;flex:none;width:36px;height:22px;margin:0;padding:0;border:0;border-radius:11px;background:radial-gradient(circle 9px at 11px 50%,#fff 98%,transparent) var(--border);cursor:pointer;transition:background-position .15s}.notify-choice input:checked,input.switch:checked{background-color:var(--fill);background-position:14px 0}@media(max-width:720px){.profile-body{padding:20px 16px 40px}.profile-password{grid-template-columns:1fr}}@media(max-width:480px){.profile-theme:not(.profile-notify){grid-template-columns:1fr}.profile-theme .segmented{grid-column:1;grid-row:auto;justify-self:start;margin-top:10px}}.app-main:has(>.auth){display:flex;background:var(--page, var(--bg))}.auth{display:flex;flex-direction:column;gap:24px;width:100%;max-width:420px;margin:auto;padding:2rem 1rem}.auth h1{display:flex;flex-direction:column;gap:14px;align-items:center;font-size:1.625rem;text-align:center}.auth h1:not(.has-logo):before{content:"";width:56px;height:56px;background:url(/icons/icon.svg) center / contain no-repeat}.auth .brand-by{margin:-18px 0 0;text-align:center}.auth h1 .brand-logo{display:block;height:4rem;max-width:12rem}.auth-card{display:flex;flex-direction:column;gap:18px;padding:24px;border:1px solid var(--border);border-radius:16px;background:var(--raised);animation:pop .4s var(--ease)}.tabs{display:grid;grid-template-columns:1fr 1fr;gap:2px;padding:3px;border-radius:10px;background:var(--surface)}[role=tab]{height:36px;border:0;border-radius:8px;background:none;color:var(--muted)}[role=tab][aria-selected=true]{background:var(--hover);color:var(--fg)}.field{margin-bottom:14px}.field input{height:42px}.auth-form button[type=submit]{width:100%;height:44px;margin-top:4px;font-size:.9375rem}.rooms{max-width:40rem;margin:0 auto;padding:1rem}.section-head{display:flex;align-items:center;justify-content:space-between;padding:16px 6px 6px 4px}.room-section h2{font-size:inherit}.fold,.room-section>summary{display:flex;gap:6px;align-items:center;height:28px;padding:0 8px 0 4px;border:0;border-radius:6px;background:none;color:var(--dim);font-size:.75rem;font-weight:600;letter-spacing:0;list-style:none;cursor:pointer}.room-section .section-title{display:flex;align-items:center;height:28px;padding:0 8px;color:var(--dim);font-size:.75rem;font-weight:600}.room-section>summary::-webkit-details-marker{display:none}.fold:before,.room-section>summary:before{width:12px;height:12px;transition:transform .15s}.fold[aria-expanded=false]:before,.room-section:not([open])>summary:before{transform:rotate(-90deg)}.section-head .icon-button{width:26px;height:26px;color:var(--dim)}.section-head .icon-button:before{width:15px;height:15px}.section-head .icon-button[aria-expanded=true]{background:var(--tint);color:var(--accent)}.room-section ul{margin:0;padding:0;list-style:none}.room-section li{position:relative;display:flex;align-items:center;margin:2px 0;border-radius:8px}@media(hover:hover){.room-section li:hover{background:var(--hover)}}.room-section li a{display:flex;flex:1;gap:10px;align-items:center;min-width:0;height:34px;padding:0 10px;color:var(--muted);font-weight:500;text-decoration:none}.room-section li a:before{content:"#";width:16px;color:var(--dim);font-weight:600;text-align:center}.more-body li a{height:32px;color:var(--dim)}.room-section li.dm a,.room-section[data-section=collections] li a{height:36px}.room-section li.dm a:before{content:none}.room-section li.dm .avatar{width:22px;height:22px;font-size:10px}.room-section li a>span:not(.avatar,.badge,.vis,.owner,.ci,.n){flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.room-section li a.unread,.room-section li a[aria-current=page]{color:var(--fg);font-weight:600}.room-section li a[aria-current=page]:before{color:var(--accent)}.room-section li:has(a[aria-current=page]){background:var(--tint)}.room-section li a>.vis{color:var(--dim)}.room-section li a>.vis:before{width:14px;height:14px}.badge{flex:none;min-width:20px;margin-left:auto;padding:0 6px;border-radius:10px;background:var(--fill);color:var(--on-fill);font-size:.6875rem;font-weight:700;line-height:20px;text-align:center}@media(hover:hover){.room-section li>.row-action{position:absolute;right:0;opacity:0}.room-section li:hover>.row-action,.room-section li:focus-within>.row-action{position:static;opacity:1}}.row-action{flex:none;margin-right:4px;height:26px;padding:0 9px;border:0;border-radius:6px;background:var(--hover);font-size:.75rem}.room-section[data-section=more]>summary{justify-content:flex-start;margin:18px 6px 0 4px}.room-section[data-section=more] .count{margin-left:auto}.more-body{margin:2px 0 4px;padding:2px 0 6px;border-radius:10px;background:var(--hover)}.more-part h3{display:flex;gap:8px;align-items:center;margin:0;padding:8px 10px 4px;color:var(--dim);font-size:.6875rem;font-weight:600}.more-part h3:before{width:13px;height:13px}.empty{color:var(--muted)}.more-body .empty{margin:0;padding:8px 10px}.new-room{display:flex;flex-direction:column;gap:8px;margin:2px 2px 8px;padding:10px;border:1px solid var(--border);border-radius:12px;background:var(--raised);animation:pop .25s var(--ease)}.name-field{display:flex;gap:6px;align-items:center;height:36px;padding:0 10px;border:1px solid var(--accent);border-radius:8px;background:var(--surface);color:var(--dim);font-weight:600}.name-field input{padding:0;border:0;background:none;outline:none;color:var(--fg);font-weight:400}.seg{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:2px;margin:0;padding:2px;border:0;border-radius:8px;background:var(--surface)}.seg label{display:flex;gap:5px;align-items:center;justify-content:center;height:30px;border-radius:6px;color:var(--muted);font-size:.75rem;font-weight:600;cursor:pointer}.seg label:before{width:12px;height:12px}.seg label:has(:checked){background:var(--hover);color:var(--fg)}.seg label:has(:focus-visible){outline:2px solid var(--accent)}.new-room .hint{margin:0 2px;color:var(--muted);font-size:.75rem}.form-buttons{display:flex;gap:6px;justify-content:flex-end}.form-buttons button{height:32px;padding:0 12px;font-size:.8125rem}.form-buttons .cancel{border-color:transparent;background:none}.user-search{margin:.25rem 0 .5rem}.search-status{margin:.25rem 0;font-size:.8rem;color:var(--muted)}.search-results{margin:0;padding:0;list-style:none}.search-results .person{display:flex;gap:.5rem;align-items:center;width:100%;border:0;border-radius:var(--radius);background:none;text-align:left}.search-results .person>span:last-child,.switcher .name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.menu{position:relative}.menu>summary{list-style:none;cursor:pointer}.menu>summary::-webkit-details-marker{display:none}.menu>summary.ic{display:flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:8px;color:var(--muted)}.room-section .menu>summary.i-dots{width:26px;height:26px;border-radius:6px}.menu>summary:hover,.menu[open]>summary{background:var(--hover);color:var(--fg)}.menu-items{position:absolute;top:calc(100% + 4px);right:0;z-index:10;display:flex;flex-direction:column;gap:2px;min-width:17.5rem;max-width:20rem;padding:6px;border:1px solid var(--border);border-radius:12px;background:var(--raised);box-shadow:var(--shadow);animation:pop .2s var(--ease);transform-origin:top right}.menu-items button{display:flex;gap:12px;align-items:center;min-height:38px;padding:0 10px;border:0;border-radius:8px;background:none;font-weight:400;text-align:left}.menu-items button:hover{background:var(--hover)}.menu-items button:before{width:16px;height:16px;color:var(--muted)}.menu-items .tile:before{width:16px;height:16px;color:var(--muted)}.menu-items small{display:block;color:var(--muted);font-size:.6875rem;line-height:1.35}.menu-items .value{margin-left:auto;color:var(--muted);font-size:.75rem}.menu-items button:has(small){padding:6px 10px}.attach+.menu-items .tile{--hue: #a78bfa;display:flex;flex:none;align-items:center;justify-content:center;width:32px;height:32px;border-radius:8px;background:color-mix(in srgb,var(--hue) 16%,transparent)}.attach+.menu-items button+button .tile{--hue: #38bdf8}.attach+.menu-items .tile:before{color:color-mix(in srgb,var(--hue) 70%,var(--fg))}.attach+.menu-items button{padding:8px 10px;font-weight:600}.attach+.menu-items small{margin-top:2px;font-size:.75rem;font-weight:400}.menu-items .sep{margin-top:11px;box-shadow:0 -7px 0 -6px var(--border)}.menu-items [aria-checked]{justify-content:flex-start}.menu-items [aria-checked]:after{content:"";width:36px;height:22px;margin-left:auto;border-radius:11px;background:radial-gradient(circle 9px at 11px 50%,#fff 98%,transparent) var(--border);transition:background-position .15s}.menu-items [aria-checked=true]:after{background-color:var(--fill);background-position:14px 0}.menu-items p{margin:.25rem .5rem;font-size:.9rem}.room{display:flex;flex-direction:column;height:100%}.room-header{display:flex;flex-wrap:wrap;gap:4px 12px;align-items:center;min-height:64px;padding:0 20px 0 28px;border-bottom:1px solid var(--line)}.room-header h1{display:flex;flex:1;gap:10px;align-items:center;min-width:0;font-size:1.125rem}.day span{padding:3px 10px;border:1px solid var(--border);border-radius:10px}.previews span{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.room-header h1 .name,.room-header h1.dm-title span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.room-header .hash{width:auto;margin-right:2px;color:var(--dim);font-weight:600}.vis-badge{display:inline-flex;flex:none;gap:5px;align-items:center;height:24px;padding:0 9px;border-radius:12px;background:var(--hover);color:var(--muted);font-size:.75rem;font-weight:600;letter-spacing:0}.vis-badge:before{width:12px;height:12px}.room-members{position:relative;display:flex;gap:8px;align-items:center;height:36px;margin-right:13px;padding:0 10px 0 6px;border:0;border-radius:18px;background:none;color:var(--muted);font-size:.8125rem}.room-members:after{content:"";position:absolute;right:-13px;width:1px;height:20px;background:var(--border)}.faces{display:flex}.faces .avatar{border:2px solid var(--bg);box-sizing:content-box}.msg>.avatar{position:absolute;top:8px;left:28px}.faces .avatar+.avatar{margin-left:-8px}.room-header .room-error{flex-basis:100%}.room-header .room-shared{flex-basis:100%;margin:0;color:var(--muted);font-size:.8rem}.back{display:flex;align-items:center;justify-content:center;width:44px;height:44px;margin-left:-16px;border-radius:12px;color:var(--muted)}.back:before{width:22px;height:22px}.room-body{position:relative;flex:1;min-height:0;display:flex;flex-direction:column}.messages{flex:1;min-height:0;overflow-y:auto;overflow-anchor:auto;margin:0;padding:12px 0 8px;list-style:none}.sentinel{height:1px}.beginning,.load-error,.service{padding:1.5rem 0 1rem;color:var(--muted);text-align:center;overflow-wrap:anywhere}.beginning:before{content:"\2728";display:block;font-size:2rem}.day{display:flex;gap:12px;align-items:center;margin:8px 28px 4px;color:var(--muted);font-size:.75rem;font-weight:600}.day:before,.day:after{content:"";flex:1;border-top:1px solid var(--line)}.service{padding:.5rem;font-size:.8rem}.msg{position:relative;padding:2px 28px 2px 78px;color:var(--text);line-height:1.55;transition:background-color .1s}.msg.group-start>.reply-quote~.avatar{top:30px}.msg.group-start{min-height:50px;padding-top:6px;margin-top:6px}@media(hover:hover){.messages:not(.by-touch) .msg:hover{background:color-mix(in srgb,var(--fill) 7%,transparent)}}.meta{display:flex;gap:8px;align-items:baseline;min-width:0;line-height:1.5}.author{min-width:0;overflow:hidden;color:var(--fg);font-weight:600;text-overflow:ellipsis;white-space:nowrap}.meta time,.permalink{flex:none}.permalink:not(:hover){text-decoration:none}.author-menu{min-width:0}.author-menu>summary.author{display:block;padding:0;color:inherit}.author-menu>summary.author:hover,.author-menu[open]>summary.author{background:none;text-decoration:underline}.author-menu .menu-items{right:auto;left:0;min-width:8rem;transform-origin:top left}.author-menu.up .menu-items{top:auto;bottom:calc(100% + 4px);transform-origin:bottom left}.meta time,.permalink,.edited,.hint,.counter{font-size:.75rem;color:var(--dim)}.body{white-space:pre-wrap;overflow-wrap:anywhere}.edited{margin-left:.35rem}.msg .body,.msg .edited{display:inline}.placeholder{font-style:italic;color:var(--muted)}.previews{display:flex;flex-direction:column;align-items:flex-start;gap:6px;margin:6px 0 2px;padding:0;list-style:none;font-size:.8125rem;font-weight:600}.previews li{max-width:100%}.previews a{display:flex;gap:8px;align-items:center;height:32px;padding:0 12px 0 8px;border:1px solid var(--border);border-radius:8px;background:color-mix(in srgb,var(--fg) 4%,transparent);text-decoration:none}.search-toggle[aria-expanded=true]{background:var(--tint);color:var(--fg)}.room-search{display:grid;grid-template-columns:minmax(0,1fr) auto auto;column-gap:10px;align-items:center;padding:10px 20px 10px 28px;border-bottom:1px solid var(--line);background:var(--raised);box-shadow:0 12px 24px #0003}.search-bar{display:contents}.room-search:before{z-index:1;grid-area:1 / 1;width:16px;height:16px;margin-left:14px;color:var(--dim);pointer-events:none}.search-bar input{grid-area:1 / 1;height:42px;padding-left:40px}.search-bar button{grid-area:1 / 3}.room-search .search-status{grid-area:1 / 2;margin:0;color:var(--muted);font-size:.8125rem}.room-search .search-results{grid-column:1 / -1;max-height:45vh;overflow-y:auto;margin:6px -12px 0 -16px;padding:0;list-style:none}.room-search .search-results .link{display:block;height:34px;margin:6px auto 4px;padding:0 14px;border:1px solid var(--border);border-radius:10px;color:var(--fg);font-size:.8125rem;text-decoration:none}.search-result{display:grid;grid-template-columns:26px minmax(0,1fr);column-gap:12px;width:100%;padding:7px 12px;border:0;border-radius:10px;background:none;text-align:left;font-weight:400}.search-result .avatar{grid-row:1 / 3;width:26px;height:26px;margin-top:2px;font-size:.625rem}.search-result .body{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2;white-space:normal}.search-result mark{background:var(--highlight);color:inherit}.reply-quote{display:flex;gap:6px;align-items:center;max-width:calc(100% + 32px);margin:0 0 2px -32px;padding:0 4px 0 0;border:0;border-radius:6px;background:none;color:var(--dim);font-size:.75rem;font-weight:400;line-height:1.5;text-align:left}.reply-quote:before{content:"";flex:none;align-self:flex-end;width:26px;height:10px;margin-bottom:-4px;border:solid var(--border);border-width:2px 0 0 2px;border-top-left-radius:6px}.msg:not(.group-start)>.reply-quote{margin-left:0}.msg:not(.group-start)>.reply-quote:before{content:none}.reply-quote:active:not(:disabled){transform:none}@media(hover:hover){.reply-quote:hover{color:var(--fg)}}.reply-author{flex:0 .15 auto;min-width:0;max-width:20em;overflow:hidden;color:var(--muted);font-weight:600;text-overflow:ellipsis;white-space:nowrap}.reply-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.reply-quote.deleted .reply-text{padding-right:.15em;font-style:italic}.replying{display:flex;gap:10px;align-items:center;min-height:40px;padding:0 14px 0 22px;border-top:1px solid var(--line);color:var(--muted);font-size:.8125rem}.replying-label{flex:1;min-width:0;overflow:hidden;color:var(--muted);text-overflow:ellipsis;white-space:nowrap}.replying-label strong{color:var(--fg);font-weight:600}.replying-text:before{content:" \b7 "}.replying .remove{width:28px;height:28px}.attachments{margin:.3rem 0 .15rem}.att-images{--att-h: 120px;--att-max-w: 240px;display:flex;flex-wrap:wrap;gap:4px}.att-images.one{--att-h: 240px;--att-max-w: 400px}.att-tile{position:relative;display:block;min-width:calc(var(--att-h) / 2);max-width:min(100%,var(--att-max-w));height:var(--att-h);overflow:hidden;border-radius:var(--radius);background:var(--surface)}.att-tile img,.att-tile video{display:block;width:auto;max-width:100%;height:100%;margin-inline:auto;object-fit:scale-down;transition:transform .25s}.att-tile video{pointer-events:none}.att-tile:hover img,.att-tile:hover video{transform:scale(1.05)}.att-play{position:absolute;inset:50% auto auto 50%;translate:-50% -50%;display:grid;place-items:center;width:min(2.75rem,40%);aspect-ratio:1;border-radius:50%;background:#0d0b1499;pointer-events:none}.att-play:before{content:"";width:55%;height:55%;background:#fff;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E") center / contain no-repeat}.att-broken{display:flex;flex-wrap:wrap;gap:.25rem;align-items:center;justify-content:center;padding:.5rem;border:2px dashed var(--border);color:var(--muted);font-size:.8rem;text-align:center}.att-broken button{padding:.1rem .5rem;font-size:.8rem}.att-files{display:flex;flex-wrap:wrap;gap:.4rem;margin:.3rem 0 0;padding:0;list-style:none}.att-file{display:inline-block;max-width:18rem;padding:0 12px;overflow:hidden;border:1px solid var(--border);border-radius:10px;background:color-mix(in srgb,var(--fg) 5%,transparent);color:var(--fg);font-size:.8125rem;font-weight:600;line-height:40px;text-decoration:none;text-overflow:ellipsis;white-space:nowrap}.att-file:before{content:"";display:inline-block;width:16px;height:16px;margin-right:8px;background:var(--accent);vertical-align:-3px;mask:var(--i) center / contain no-repeat}.att-files audio{max-width:100%;height:2.2rem;vertical-align:top}.att-more{position:absolute;inset:0;display:grid;place-items:center;background:#0d0b148c;color:#fff;font-size:1.5rem;font-weight:700;pointer-events:none}.att-progress{display:block;width:min(100%,16rem);height:4px;margin-top:.35rem;overflow:hidden;border:0;border-radius:2px;background:var(--border);accent-color:var(--accent);appearance:none}.att-progress::-webkit-progress-bar{background:var(--border)}.att-progress::-webkit-progress-value{background:var(--accent);transition:width .2s}.att-progress::-moz-progress-bar{background:var(--accent)}.ci{display:inline-block;flex:none;width:1.15em;height:1.15em;background:currentcolor;vertical-align:-.2em;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 3h12a2 2 0 0 1 2 2v12'/%3E%3Crect x='3' y='7' width='14' height='14' rx='2'/%3E%3Cpath d='m3 19 5-5 4 4 2-2 3 3'/%3E%3Ccircle cx='12.5' cy='11.5' r='1'/%3E%3C/svg%3E") center / contain no-repeat}@media(hover:hover){.icon-button:hover:not(:disabled){background:var(--hover);color:var(--fg)}}.att-cell{position:relative;display:block;max-width:min(100%,var(--att-max-w))}.att-src,.att-save{position:absolute;z-index:1;border-radius:var(--pill);background:#0d0b14a6;color:#fff;font-size:.7rem;font-weight:700;line-height:1.6}.att-src{bottom:4px;left:4px;display:flex;gap:.2rem;align-items:center;max-width:calc(100% - 8px);padding:0 .45rem;overflow:hidden;text-decoration:none;text-overflow:ellipsis;white-space:nowrap}.att-src>.i-lock:before{width:12px;height:12px}a.att-src:hover{background:var(--accent)}.att-save{top:4px;right:4px;width:1.9rem;height:1.9rem;padding:0;border:0;font-size:.95rem;opacity:0}.att-cell:hover .att-save,.att-save:focus-visible,.att-save[aria-expanded=true]{opacity:1}@media(hover:none){.att-save{opacity:.85}}.room-section[data-section=collections] li a:before{content:"";width:22px;height:22px;border-radius:6px;background:color-mix(in srgb,var(--hue) 16%,transparent)}.room-section[data-section=collections] li a>.ci{width:13px;height:13px;margin:0 4.5px 0 -27.5px;color:color-mix(in srgb,var(--hue) 70%,var(--fg))}.t0{--hue: #a78bfa}.t1{--hue: #38bdf8}.t2{--hue: #fb923c}.t3{--hue: #4ade80}.room-section li a>.n{min-width:18px;color:var(--dim);font-size:.75rem;text-align:right}.room-section li .owner{color:var(--muted);font-size:.8rem}.tray-item .ci{width:40px;color:var(--muted)}.msg.pending{opacity:.6;animation:pop .3s var(--ease)}.msg.failed .body,.msg.failed .attachments{opacity:.7}.msg.to-me{margin-right:16px;margin-left:16px;padding-right:12px;padding-left:62px;border-radius:10px;background:color-mix(in srgb,var(--fill) 10%,transparent)}.msg.to-me>.avatar{left:12px}.msg.target{background:var(--highlight);animation:target-fade 3s ease-in forwards}@keyframes target-fade{0%,60%{background:var(--highlight)}to{background:transparent}}.actions{position:absolute;top:-14px;right:28px;z-index:1;display:flex;flex-wrap:wrap;justify-content:flex-end;gap:2px;max-width:calc(100% - 56px);padding:3px;border:1px solid var(--border);border-radius:10px;background:var(--raised);box-shadow:var(--shadow);opacity:0;pointer-events:none}.actions button{display:flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;border:0;border-radius:7px;background:none;color:var(--muted)}.actions button:before{width:16px;height:16px}.actions button.delete{color:var(--danger)}@media(hover:hover){.messages:not(.by-touch) .msg:hover .actions{opacity:1;pointer-events:auto}}.msg.touched{background:color-mix(in srgb,var(--fill) 7%,transparent)}.msg.touched .actions,.msg:has(:focus-visible) .actions{opacity:1;pointer-events:auto}@media(hover:none){.actions{width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}.msg.touched .actions,.msg:has(:focus-visible) .actions{position:static;justify-content:flex-start;width:fit-content;height:auto;overflow:visible;clip-path:none;margin-top:.15rem;box-shadow:none}}.new-line{height:0;margin:0 28px;border-top:1px solid color-mix(in srgb,var(--new) 60%,transparent);font-size:.6875rem;font-weight:700;letter-spacing:.04em;line-height:0;color:var(--new);text-align:right;text-transform:uppercase;animation:fade-out 1s 4s forwards}.new-line span{padding-left:10px;background:var(--bg)}@keyframes fade-out{to{opacity:0}}.reactions{display:flex;flex-wrap:wrap;gap:6px;margin:4px 0 2px}.reaction,.add-reaction{display:inline-flex;gap:6px;align-items:center;height:28px;padding:0 10px;border:1px solid var(--border);border-radius:14px;background:color-mix(in srgb,var(--fg) 4%,transparent);color:var(--muted);font-size:.8125rem;font-weight:600}.reaction.mine{border-color:color-mix(in srgb,var(--fill) 55%,transparent);background:var(--tint);color:var(--fg)}.add-reaction{width:32px;justify-content:center;padding:0;border-style:dashed;background:none;color:var(--dim)}.add-reaction:before{width:15px;height:15px}.confirm,.send-error,.msg-error{display:flex;flex-wrap:wrap;gap:.4rem;align-items:center;margin:.25rem 0;font-size:.85rem}.bar-actions{display:flex;gap:inherit;align-items:center}.confirm button,.send-error button,.msg-error button{height:26px;padding:0 10px;border:0;border-radius:6px;background:var(--hover);font-size:.75rem}.confirm .danger{background:var(--danger);color:var(--bg)}.edit-input{display:block;margin-top:.15rem;resize:vertical}.hint{margin:.15rem 0 0}.hint.error{color:var(--danger)}.room-notice{margin:0;padding:.4rem 1rem;background:var(--tint);font-size:.85rem;color:var(--muted)}.room-notice:empty{display:none}.new-messages{position:absolute;bottom:16px;left:50%;display:flex;gap:8px;align-items:center;height:36px;padding:0 14px 0 12px;border-radius:18px;background:var(--raised);box-shadow:var(--shadow);font-size:.8125rem;transform:translate(-50%);animation:pop .3s var(--ease)}.new-messages:before{width:14px;height:14px}.new-messages:active:not(:disabled){transform:translate(-50%) scale(.95)}.composer{border-top:1px solid var(--line);padding-bottom:env(safe-area-inset-bottom)}.composer-row{display:flex;gap:4px;align-items:flex-end;min-height:67px;padding:13px 14px 14px 12px}.composer-row>button,.composer-row>.menu>summary{width:40px;height:40px;border-radius:10px}.composer textarea{flex:1;align-self:center;min-width:0;min-height:40px;max-height:10rem;overflow-x:hidden;padding:calc((40px - 1lh)/2) 6px;border:0;background:none;outline:none;resize:none}.composer .menu[open]>summary{background:var(--tint);color:var(--accent)}.composer .menu-items{top:auto;right:auto;bottom:calc(100% + 8px);left:0;transform-origin:bottom left}.composer .send{display:flex;flex:none;align-items:center;justify-content:center;padding:0}.composer .send:before{width:17px;height:17px}.composer .send:disabled{opacity:1;background:color-mix(in srgb,var(--fill) 25%,transparent);color:color-mix(in srgb,#fff 55%,transparent)}.composer .counter{align-self:center}.tray{display:flex;flex-wrap:wrap;gap:.4rem;max-height:9.5rem;margin:0;padding:12px 14px 0 22px;overflow-y:auto;list-style:none}.tray-item{display:flex;gap:.4rem;align-items:center;max-width:16rem;padding:.25rem .25rem .25rem .4rem;border:1px solid var(--border);border-radius:var(--radius);background:var(--raised);font-size:.85rem;animation:pop .25s var(--ease)}.tray-thumb{flex:none;border-radius:8px;object-fit:cover}.tray-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tray-size{flex:none;color:var(--muted)}.tray-item .remove{flex:none;padding:0 .45rem;border:0}.tray-error{margin:0 0 .4rem;color:var(--danger);font-size:.85rem}.tray-error:empty{display:none}.composer textarea::placeholder{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.counter{align-self:center}.counter:empty{display:none}.forwarded{color:var(--muted);font-size:.75rem;font-style:italic}.messages.selecting .msg{padding-left:110px;cursor:pointer;user-select:none}.messages.selecting .msg>.avatar{left:60px}.msg>.select{position:absolute;top:17px;left:28px;width:18px;height:18px;padding:0;accent-color:var(--fill)}.msg:not(.group-start)>.select{top:6px}.messages.selecting .msg.to-me{padding-left:94px}.msg.to-me>.select{left:12px}.messages.selecting .msg.to-me>.avatar{left:44px}.msg.selected{background:var(--tint)}.selection-bar{display:flex;flex-wrap:wrap;gap:8px;align-items:center;min-height:68px;padding:8px 16px calc(8px + env(safe-area-inset-bottom)) 24px;border-top:1px solid var(--line);background:var(--raised)}.selection-bar>span{flex:1;font-weight:600}.selection-bar .ic:not([hidden]){display:inline-flex;align-items:center;gap:8px}.selection-bar .ic:before{width:16px;height:16px}.selection-bar button{height:38px}.selection-bar button:not(.primary,.danger){border-color:transparent;background:none}@media(max-width:400px){.selection-bar{padding-left:16px}.selection-bar .ic:before{display:none}}dialog.forward,dialog.access{width:min(30rem,calc(100% - 2rem));max-height:min(36rem,85vh);padding:20px 24px;border:1px solid var(--border);border-radius:16px;background:color-mix(in srgb,var(--raised),var(--bg));color:var(--fg);box-shadow:var(--shadow)}dialog.forward[open]{display:flex;flex-direction:column;gap:10px}dialog.forward::backdrop,dialog.access::backdrop{background:#08060ea8}.forward-list{min-height:0;overflow-y:auto}.switcher>.search-status{margin:8px 20px}.switcher .forward-list{padding:8px}dialog.forward.busy .forward-list{opacity:.6;pointer-events:none}dialog.switcher{width:min(35rem,calc(100% - 2rem));max-height:min(36rem,calc(100dvh - 140px - 1rem));margin-top:140px;padding:0;overflow:hidden}dialog.switcher[open]{gap:0}.jump-field{display:flex;flex:none;gap:12px;align-items:center;height:60px;padding:0 20px;border-bottom:1px solid var(--border);color:var(--muted)}.jump-field:before{width:18px;height:18px}.jump-field input{flex:1;min-width:0;height:100%;padding:0;border:0;background:none;outline:none;font-size:1.0625rem}.switcher kbd,.jump-button kbd{padding:1px 6px;border:1px solid var(--border);border-radius:5px;color:var(--muted);font:600 .6875rem / 1.5 inherit}.jump-keys{display:flex;flex:none;gap:16px;margin:0;padding:10px 20px;border-top:1px solid var(--border);color:var(--muted);font-size:.75rem}@media(hover:none){.jump-keys,.jump-field kbd{display:none}}.switcher>.search-status:empty{display:none}.switcher .person{gap:12px;height:46px;padding:0 12px;border-radius:10px;font-weight:500;cursor:pointer}.switcher .person:hover{background:var(--hover)}.switcher [aria-selected=true]{background:color-mix(in srgb,var(--fill) 20%,transparent);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--accent) 35%,transparent)}.switcher .tile,.switcher .avatar{width:28px;height:28px}.switcher .tile{display:flex;flex:none;align-items:center;justify-content:center;border-radius:8px;background:var(--hover);color:var(--dim);font-weight:700}.switcher .tile:before{width:14px;height:14px}.switcher small{margin-left:4px;color:var(--dim);font-size:.75rem;font-weight:400}.switcher [aria-selected=true] small{color:var(--muted)}.switcher .unread{font-weight:700}dialog.forward .cancel{align-self:flex-end;border-color:transparent;background:none}dialog.forward h2{margin:0;font-size:1.0625rem}dialog.forward>.search-status:empty{display:none}dialog:not(.switcher) .forward-list .person{gap:12px;height:44px;padding:0 10px;border-radius:10px}dialog:not(.switcher) .forward-list .avatar,dialog.forward .hash{width:30px;height:30px}dialog.forward .hash{display:flex;align-items:center;justify-content:center;border-radius:8px;background:var(--hover)}.hash{flex:none;width:24px;color:var(--dim);font-weight:600;text-align:center}.not-found{padding:2rem 1rem;text-align:center}.not-found h1{margin:0 0 .25rem;font-size:1rem}a.brand,.brand-title{color:var(--fg);text-decoration:none}.guest-links{display:flex;flex:none;gap:.5rem;margin-left:auto}@media(hover:hover){.guest-link:not(.primary):hover{background:var(--hover)}}.auth-skip{margin:1rem 0 0;text-align:center}.guest-banner,.archived-banner{display:flex;gap:12px;align-items:center;min-height:68px;margin:0;padding:12px 16px calc(12px + env(safe-area-inset-bottom)) 28px;border-top:1px solid var(--line);background:color-mix(in srgb,var(--raised),var(--bg));color:var(--text)}.guest-banner:before,.archived-banner:before{color:var(--muted)}@keyframes pop{0%{opacity:0;transform:scale(.92) translateY(4px)}}@keyframes wave{0%,60%,to{transform:rotate(0)}20%{transform:rotate(18deg)}40%{transform:rotate(-10deg)}}@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important}}@media(max-width:720px){.sidebar{display:none}#app:has(.layout:not(.home))>.app-bar,.side-top,.side-foot{display:none}.layout.home .sidebar{display:flex;flex:1;border:0}.layout.home .pane{position:absolute;clip-path:inset(50%)}.layout.home .welcome p{display:none}.sidebar nav{padding:0 10px 24px}.room-section li a,.room-section li.dm a,.room-section[data-section=collections] li a{gap:12px;height:48px;padding:0 12px;font-size:.9375rem}.room-section .badge{min-width:22px;padding:0 7px;font-size:.75rem;line-height:22px}.room-section li.dm .avatar,.room-section[data-section=collections] li a:before{width:28px;height:28px;font-size:.6875rem}.room-section[data-section=collections] li a:before{border-radius:8px}.room-section[data-section=collections] li a>.ci{width:14px;height:14px;margin:0 7px 0 -33px}.section-head .icon-button,.fold,.room-section>summary{height:44px}.section-head{padding:10px 0 0}.section-head .icon-button{width:44px}.room-header{gap:2px;min-height:60px;padding:0 6px}.room-header .back{margin-left:0}.room-header .icon-button,.room-header .menu>summary{width:44px;height:44px}.room-members{display:none}.msg{padding-right:16px;padding-left:58px}.msg>.avatar{left:16px;width:32px;height:32px}.msg.to-me{margin:0 8px;padding-left:50px}.msg.to-me>.avatar{left:8px}.messages.selecting .msg.to-me{padding-left:102px}.msg.to-me>.select{left:20px}.messages.selecting .msg.to-me>.avatar{left:52px}.msg.group-start>.reply-quote{max-width:calc(100% + 26px);margin-left:-26px}.reply-quote:before{width:20px}.day,.new-line{margin-inline:16px}.actions{right:16px}.composer-row{min-height:64px;padding:10px 8px 10px 6px}.composer-row>button,.composer-row>.menu>summary{width:44px;height:44px}}@media(min-width:721px){.back{display:none}}
2
- /*# sourceMappingURL=app-A3SXD3FF.css.map */