diff --git a/CHANGELOG.md b/CHANGELOG.md index 24c2a4a0c..7ac02fe7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,58 @@ What's new in ps5upload, written for humans. ## Unreleased +**Storage** +- **Files shows the right free space (#944).** Files kept its own copy of the drives, and Refresh didn't read it again, so a chip could show 98 GiB when the drive had 163 GiB. Every screen that shows drives now reads the same list: on Refresh, when a screen comes back, and when a job on that console ends. +- **The numbers say what they are.** Free space is in GiB everywhere, only space you can copy into is counted, and the Volumes and Hardware screens say that the PS5 holds space back for itself, so its own Storage screen can show less. + +**Collection** +- **A package that is cut short or still being copied is no longer treated as whole.** Organize leaves it alone and Check says it is cut short. +- Check reads every part of a split package. +- Organize never files anything inside a folder that is itself a game. +- When the undo log can't be saved after a move, Organize says what moved and that Undo may be incomplete. + +**Save Data** +- A save is never written while its game is running, and a console that can't say what is running is treated as busy, not idle. +- A restore is only accepted into the PS5's own save folders and the emulator save places the app supports. + +**Upload & Install** +- **A package can't be renamed while an install of it is unfinished**, however long ago the PS5 last read it. The message says how to free it. +- "Name on the PS5" shows how many bytes are left before it sends. +- Covers show for game folders whose `SCE_SYS` folder is in capitals. +- A stopped job in the queue shows as stopped, not failed, and no longer holds the queue. + +**Updates** +- **Opening the app while an update is installing no longer says the update failed.** It shows "Finishing the update…" and starts the new version. + +**Play Together and phones** +- A link that was replaced or has lapsed no longer reaches the host's "wants to play" prompt, and an invite after a lapsed one gets its internet link again. +- A phone allowed to watch can't come back as a controller. A kicked phone can't get back in (the link's key changes; other phones carry on). +- A guest's PS button stays blocked through a lost connection, and a kicked guest's input can't reach the next guest. +- One guest can no longer cut the host off the internet hub, and idle guests can't hold seats. +- Phone input is paced so a flood can't swamp the host; normal play is untouched. + +**Mesh Drive** +- With three or more consoles, links no longer undo each other's changes. +- A folder whose first entries were hidden files could be sent to the trash with files still in it; the whole folder is now read first. +- A newer file here is never overwritten by an older copy during failover; both are kept. +- A folder whose console is gone can be left. + +**Sharing and transfers** +- Long file lists are no longer dropped, received settings are checked, and a retail game is refused whatever it is sent as. +- A finished folder download no longer fails on retry. "Download to a saved server" can't write outside the chosen folder. +- Transfers between devices: a use-after-free in the PS5 helper's receiver, a job being ended by another device, an upload that couldn't resume after a disk error, and memory a peer could make grow are fixed. + +**Look and wording** +- On a phone, Upload & Install's buttons are one row, sideways Files shows more rows, payload rows are compact, and the Files menu's look-alike items are renamed and grouped. +- Arabic and Persian keep names like "ShadowMount+", paths and versions in their order. + +**Fixes found in audits** +- FTP folder checks can't be fooled by servers that treat names as patterns. +- Crafted disk images and archives are refused instead of grinding or filling memory. +- Guest IPs and names are no longer written to the log. + +## 12.6.31 + **Upload & Install** - **Change a fake package's name before installing it (#937).** Pick one package and edit "Name on the PS5". The name is changed inside the package, in place, without rebuilding it, and checked afterwards. Packages signed by Sony, split packages and packages on a server are refused. - **Stream & install no longer sits at 0% in silence (#942).** Before it starts, the app checks that the PS5 can reach this computer. If it can't, or the PS5 never fetches any of the package, the install stops with the likely cause (most often this computer's firewall) and offers Retry via upload. diff --git a/Makefile b/Makefile index 0cc089cb1..58854106a 100644 --- a/Makefile +++ b/Makefile @@ -1285,6 +1285,12 @@ test-payload: payload $(PAYLOAD_DIR)/tests/json_escape_selftest.c @$(RUN_LIMITED) $(SELFTEST_DIR)/ps5upload-json-escape-selftest @echo "✓ a quote, a backslash or a control byte in a string cannot break a reply" + @echo "Running UTF-8 cut self-test (host build)..." + @cc -O2 -Wall -Wextra -Werror -I$(PAYLOAD_DIR)/include \ + -o $(SELFTEST_DIR)/ps5upload-utf8-cut-selftest \ + $(PAYLOAD_DIR)/tests/utf8_cut_selftest.c + @$(RUN_LIMITED) $(SELFTEST_DIR)/ps5upload-utf8-cut-selftest + @echo "✓ a path cut short on a status line keeps whole characters" @echo "Running user delete gate self-test (host build)..." @cc -O2 -Wall -Wextra -Werror -I$(PAYLOAD_DIR)/include \ -o $(SELFTEST_DIR)/ps5upload-user-guard-selftest \ diff --git a/VERSION b/VERSION index 5d5c5a86b..846141b52 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -12.6.30 +12.6.31 diff --git a/client/e2e/files-drives-refresh.spec.ts b/client/e2e/files-drives-refresh.spec.ts new file mode 100644 index 000000000..37e2b5371 --- /dev/null +++ b/client/e2e/files-drives-refresh.spec.ts @@ -0,0 +1,170 @@ +import { expect, test, type Page, type Route } from "@playwright/test"; + +// The free space on Files' drive chips is the console's free space of now (#944): Refresh reads +// it again, a finished upload reads it again, and Files and Volumes show the same reading. Files +// used to keep the figure read when it opened, whatever happened after. The engine here is a fake. + +const HOST = "192.168.0.5"; +const GIB = 1024 ** 3; +const PC_DIR = "/home/me/games"; +const PC_FILE = `${PC_DIR}/big.exfat`; +const TOTAL = 10_000_000_000; + +/** What the fake console reports, changed by the tests as if space was used or freed. */ +interface Fake { + freeBytes: number; + volumeReads: number; + jobFinished: boolean; +} + +async function fakeEngine(page: Page, fake: Fake) { + await page.addInitScript((host) => { + window.localStorage.setItem("ps5upload.host", host); + }, HOST); + const json = (route: Route, body: unknown) => + route.fulfill({ status: 200, contentType: "application/json", body: JSON.stringify(body) }); + // Only the engine's routes: the dev server also serves the app's own /src/api/ modules. + await page.route( + (u) => u.pathname.startsWith("/api/"), + async (route) => { + const req = route.request(); + const url = new URL(req.url()); + const p = url.pathname; + if (p === "/api/version") return json(route, { caps: { rar: true }, version: "6.5.2" }); + if (p === "/api/ps5/status") + return json(route, { + command_count: 1, + instance_id: 1, + max_transfer_streams: 8, + prior_instance: "clean", + ps5_kernel: "r229358/releases/13.60 Jul 17 2026 02:16:29", + started_at_unix: 1791360198, + ucred_elevated: true, + version: "6.5.2", + }); + if (p === "/api/ps5/volumes") { + fake.volumeReads += 1; + return json(route, { + volumes: [ + { + path: "/data", + mount_from: "/user/data", + fs_type: "nullfs", + total_bytes: 670 * GIB, + free_bytes: fake.freeBytes, + writable: true, + is_placeholder: false, + source_image: "", + safety_reserve_bytes: GIB, + allocatable_bytes: Math.max(0, fake.freeBytes - GIB), + }, + ], + }); + } + if (p === "/api/ps5/list-dir") + return json(route, { + path: url.searchParams.get("path") ?? "/data", + entries: [{ name: "homebrew", kind: "dir", size: 0, mtime: 1791360199 }], + truncated: false, + total_scanned: 1, + returned: 1, + }); + if (p === "/api/local/storage-roots") return json(route, [PC_DIR]); + if (p === "/api/local/list-dir") + return json(route, [{ name: "big.exfat", path: PC_FILE, is_dir: false, size: TOTAL }]); + if (p === "/api/local/path-kind") return json(route, { kind: "file" }); + if (p === "/api/transfer/file" && req.method() === "POST") return json(route, { job_id: "job-1" }); + if (p === "/api/jobs/job-1") + return json( + route, + fake.jobFinished + ? { status: "done", bytes_sent: TOTAL, total_bytes: TOTAL, dest: "/data/big.exfat" } + : { status: "running", bytes_sent: 2_500_000_000, total_bytes: TOTAL }, + ); + if (p === "/api/jobs") return json(route, []); + // Anything else the screens poll: an empty answer is enough here. + return json(route, {}); + }, + ); +} + +/** The /data chip in Files' drive bar. */ +const dataChip = (page: Page) => page.getByRole("main").locator("button.chip", { hasText: "/data" }); + +test("Refresh in Files reads the drives' free space again, and Volumes shows the same", async ({ page }) => { + // 98.1 GiB, then 163 GiB: the figures of the report. + const fake: Fake = { freeBytes: Math.round(98.1 * GIB), volumeReads: 0, jobFinished: false }; + await fakeEngine(page, fake); + + await page.goto("/files?path=/data", { waitUntil: "domcontentloaded" }); + const main = page.getByRole("main"); + await expect(dataChip(page)).toContainText("98.1 GiB", { timeout: 30_000 }); + await expect(dataChip(page)).toHaveAttribute("title", "/data · 98.1 GiB free"); + + // Space was freed on the console. Nothing on screen has asked again yet. + fake.freeBytes = 175_467_069_440; + await main.getByRole("button", { name: "Refresh", exact: true }).click(); + await expect(dataChip(page)).toContainText("163 GiB"); + await expect(dataChip(page)).toHaveAttribute("title", "/data · 163 GiB free"); + + // Volumes shows that reading, and its own Refresh a newer one. + const primary = page.getByRole("navigation", { name: "Primary" }); + await primary.getByRole("link", { name: "Volumes", exact: true }).click(); + await expect(page.getByRole("heading", { name: "Volumes" })).toBeVisible(); + await expect(main.getByText("163 GiB free of 670 GiB")).toBeVisible(); + fake.freeBytes = 150 * GIB; + await main.getByRole("button", { name: "Refresh", exact: true }).click(); + await expect(main.getByText("150 GiB free of 670 GiB")).toBeVisible(); + + // Back on Files: what Volumes just read, not what Files last showed. + await primary.getByRole("link", { name: "Files", exact: true }).click(); + await expect(dataChip(page)).toContainText("150 GiB"); + await expect(dataChip(page)).not.toContainText("163"); + + // And a screen that comes back into view asks again by itself. + await primary.getByRole("link", { name: "Volumes", exact: true }).click(); + await expect(main.getByText("150 GiB free of 670 GiB")).toBeVisible(); + fake.freeBytes = 140 * GIB; + await primary.getByRole("link", { name: "Files", exact: true }).click(); + await expect(dataChip(page)).toContainText("140 GiB"); +}); + +test("an upload that finishes updates the free space on the drive chip", async ({ page }) => { + const fake: Fake = { freeBytes: 163 * GIB, volumeReads: 0, jobFinished: false }; + await fakeEngine(page, fake); + + await page.goto("/files?path=/data", { waitUntil: "domcontentloaded" }); + const main = page.getByRole("main"); + await expect(dataChip(page)).toContainText("163 GiB", { timeout: 30_000 }); + + await main.getByRole("button", { name: "Add files" }).click(); + // The browser build picks from the engine's machine: choose the file there. + await page.getByText("big.exfat").first().click(); + await page.getByRole("button", { name: "Add 1" }).click(); + const progress = page.getByTestId("fs-upload-progress"); + await expect(progress).toBeVisible({ timeout: 15_000 }); + + // The copy lands and the drive has less room. No Refresh is pressed. + fake.freeBytes = 153 * GIB; + fake.jobFinished = true; + await expect(dataChip(page)).toContainText("153 GiB", { timeout: 20_000 }); +}); + +test("opening folders does not read the drives each time", async ({ page }) => { + const fake: Fake = { freeBytes: 163 * GIB, volumeReads: 0, jobFinished: false }; + await fakeEngine(page, fake); + + await page.goto("/files?path=/data", { waitUntil: "domcontentloaded" }); + await expect(dataChip(page)).toContainText("163 GiB", { timeout: 30_000 }); + const before = fake.volumeReads; + const homebrew = page.locator('[data-fs-name="homebrew"]'); + for (let i = 0; i < 3; i++) { + await homebrew.locator("button[data-fs-open]").click(); + await expect(page.getByRole("button", { name: "homebrew", exact: true }).first()).toBeVisible(); + await page.locator("body").click({ position: { x: 1, y: 1 } }); + await page.keyboard.press("Backspace"); + await expect(homebrew).toHaveAttribute("data-fs-revealed", "", { timeout: 10_000 }); + } + // A reading of a moment ago is kept while browsing. + expect(fake.volumeReads).toBe(before); +}); diff --git a/client/e2e/files-phone-header.spec.ts b/client/e2e/files-phone-header.spec.ts index 18b0ec906..e4f3d17b4 100644 --- a/client/e2e/files-phone-header.spec.ts +++ b/client/e2e/files-phone-header.spec.ts @@ -151,15 +151,28 @@ for (const phone of PHONES) { // No boxes until selecting. await expect(row(page, "file-01.pkg").getByRole("checkbox")).toBeHidden(); // One bar at the top: no Back and Forward arrows (the phone's Back goes back), and one - // bell. Where the app's own top bar would show (below 768 px) the bell is in this header - // and that bar is gone; wider, it stays in the row beside the sidebar. + // bell, in this header. Below 768 px the app's own top bar gives way; held sideways, the + // row beside the sidebar does (its search, reload and theme buttons go too): with both + // rows there, about two files were left in view. await expect(page.getByRole("navigation", { name: "View history" }).locator("visible=true")).toHaveCount(0); const bell = page.getByRole("button", { name: "Open notifications" }).locator("visible=true"); await expect(bell).toHaveCount(1); - if (phone.viewport.width < 768) { + { await expect(header.getByRole("button", { name: "Open notifications" })).toBeVisible(); await expect(page.locator("[data-top-bar]").getByText("PS5Upload")).toBeHidden(); - expect((await header.boundingBox())!.y).toBeLessThan(24); + await expect(page.getByRole("button", { name: "Reload page" }).locator("visible=true")).toHaveCount(0); + await expect(page.getByRole("button", { name: "Search screens and commands" }).locator("visible=true")).toHaveCount(0); + // At the top (held sideways, under the page's own top margin only: it was under a row + // of buttons, at about 88 px). + expect((await header.boundingBox())!.y).toBeLessThan(phone.viewport.width < 768 ? 24 : 40); + // Rows of files in view under the header (two, before). + const shown = await main(page) + .locator("li[data-fs-name]") + .evaluateAll((rows) => rows.filter((r) => { + const b = r.getBoundingClientRect(); + return b.top >= 0 && b.bottom <= window.innerHeight; + }).length); + expect(shown).toBeGreaterThanOrEqual(3); // Its panel hangs under the header, inside the window. await bell.tap(); const panel = page.getByTestId("notifications-panel").locator("visible=true"); @@ -173,8 +186,6 @@ for (const phone of PHONES) { await shot(page, `bell-${phone.viewport.width}x${phone.viewport.height}`); expect(await back(page)).toBe(true); await expect(panel).toHaveCount(0); - } else { - await expect(header.getByRole("button", { name: "Open notifications" })).toHaveCount(0); } await shot(page, `header-${phone.viewport.width}x${phone.viewport.height}`); @@ -306,7 +317,7 @@ for (const phone of PHONES) { await openFiles(page); const header = main(page).getByTestId("fs-header"); await header.getByRole("button", { name: "More" }).tap(); - for (const name of ["Add files", "Add folder", "New folder", "Refresh", "Select", "Snapshots"]) + for (const name of ["Add files", "Add folder", "New folder", "Refresh", "Select", "See snapshots"]) await expect(menu(page).getByRole("menuitem", { name, exact: true })).toBeVisible(); await shot(page, `more-menu-${phone.viewport.width}x${phone.viewport.height}`); // Select: selection mode with nothing ticked yet, for a keyboard or a D-pad. @@ -332,6 +343,64 @@ for (const phone of PHONES) { }); } +// The ⋮ menu's pairs read as twins before: "What takes space here?" beside "What takes space?", +// "Snapshot this folder" beside "Snapshots". Now each says what it is about (this folder, this +// drive) and what it does (make a snapshot, see them), in groups with a line between them. In a +// wide font (Linux CI's), every item is one line and the menu is whole on screen. +for (const viewport of [ + { width: 360, height: 800 }, + { width: 844, height: 390 }, +]) { + test.describe(`the ⋮ menu's groups, ${viewport.width}x${viewport.height}`, () => { + test.use({ viewport, hasTouch: true, isMobile: true }); + + test("each folder and drive item says which it is, in groups", async ({ page }) => { + await openFiles(page); + await page.addStyleTag({ content: "*{font-family:Verdana,'DejaVu Sans',sans-serif!important}" }); + await main(page).getByTestId("fs-header").getByRole("button", { name: "More" }).tap(); + const items = menu(page).getByRole("menuitem"); + const labels = (await items.allTextContents()).map((t) => t.trim()); + expect(labels).toEqual([ + "Add files", + "Add folder", + "New folder", + "Refresh", + "Select", + "What takes space in this folder?", + "Make a snapshot of this folder", + "Download from a link", + "What takes space on this drive?", + "See snapshots", + "Search all drives", + "Search this folder", + ]); + // Groups: the page's actions, this folder, a link, the drive. + const separators = menu(page).getByRole("separator"); + await expect(separators).toHaveCount(3); + const order = await menu(page).evaluate((m) => + Array.from(m.querySelectorAll('[role="menuitem"], [role="separator"]')).map((e) => + e.getAttribute("role") === "separator" ? "|" : (e.textContent ?? "").trim(), + ), + ); + expect(order.indexOf("|")).toBe(order.indexOf("What takes space in this folder?") - 1); + expect(order.lastIndexOf("|")).toBe(order.indexOf("What takes space on this drive?") - 1); + // One line each (as tall as "Refresh", which is one line), and the menu whole on screen. + const line = (await items.filter({ hasText: /^Refresh$/ }).boundingBox())!.height; + for (const item of await items.all()) { + const h = (await item.boundingBox())!.height; + expect(h, await item.textContent()).toBeLessThanOrEqual(line + 1); + } + const box = (await menu(page).boundingBox())!; + expect(box.x).toBeGreaterThanOrEqual(0); + expect(box.x + box.width).toBeLessThanOrEqual(viewport.width + 0.5); + await shot(page, `more-menu-groups-${viewport.width}x${viewport.height}`); + // Each opens what it says. + await menu(page).getByRole("menuitem", { name: "See snapshots", exact: true }).click(); + await expect(page).toHaveURL(/view=snapshots/); + }); + }); +} + test.describe("phone browser (the web UI)", () => { test.use({ viewport: { width: 360, height: 800 }, @@ -377,6 +446,7 @@ test.describe("desktop width", () => { await expect(arrows.getByRole("button", { name: "Forward" })).toBeVisible(); await expect(page.getByRole("button", { name: "Open notifications" }).locator("visible=true")).toHaveCount(1); await expect(main(page).getByTestId("fs-header").getByRole("button", { name: "Open notifications" })).toHaveCount(0); + await expect(page.getByRole("button", { name: "Reload page" })).toBeVisible(); await shot(page, "desktop-1280x800"); }); }); diff --git a/client/e2e/package-name.spec.ts b/client/e2e/package-name.spec.ts index 8e4689df7..743e3a457 100644 --- a/client/e2e/package-name.spec.ts +++ b/client/e2e/package-name.spec.ts @@ -11,6 +11,8 @@ interface Fake { /** The name the package holds now. */ name: string; refusal: { code: string; reason: string } | null; + /** The package's own room for a name, in bytes (absent: the engine's overall limit). */ + room?: { default_name: number; all_languages: number }; /** Every POST /api/pkg/name body, in order. */ renames: unknown[]; /** How many times the package's header was read. */ @@ -47,6 +49,7 @@ async function fakeEngine(page: Page, fake: Fake) { other_names: 1, refusal: fake.refusal, max_bytes: 127, + ...(fake.room ? { room: fake.room } : {}), }; } if (path === "/api/pkg/name" && req.method() === "POST") { @@ -111,6 +114,47 @@ test("a picked package's name is changed before it is installed", async ({ page }); +// A name longer than the package has room for (in bytes, as the engine counts) is said in the +// field itself, in the app's language, and never sent. +test("a name too long for the package is refused in the field, before anything is sent", async ({ page }) => { + const fake: Fake = { + name: MARKED, + refusal: null, + renames: [], + headerReads: 0, + room: { default_name: 30, all_languages: 30 }, + }; + await fakeEngine(page, fake); + await pickPackage(page); + const card = page.getByTestId("pkg-name-card"); + await expect(card).toBeVisible({ timeout: 20_000 }); + const input = card.getByTestId("pkg-name-input"); + const save = card.getByTestId("pkg-name-save"); + await expect(input).toHaveValue(MARKED); + await expect(card.getByTestId("pkg-name-room")).toHaveCount(0); + + await input.fill("A Game"); + await expect(card.getByTestId("pkg-name-room")).toHaveText("Bytes left for the name: 24"); + await expect(save).toBeEnabled(); + + // Eleven Japanese letters: 33 bytes, three more than fit. + await input.fill("テ".repeat(11)); + const tooLong = card.getByTestId("pkg-name-too-long"); + await expect(tooLong).toContainText("This name is too long for this package. Bytes that fit: 30. Bytes over: 3."); + await expect(save).toBeDisabled(); + await input.press("Enter"); + await page.waitForTimeout(200); + expect(fake.renames).toEqual([]); + await card.screenshot({ path: process.env.PKG_NAME_LONG_SHOT ?? "/dev/null" }).catch(() => {}); + + // Ten fit exactly. + await input.fill("テ".repeat(10)); + await expect(card.getByTestId("pkg-name-room")).toHaveText("Bytes left for the name: 0"); + await expect(save).toBeEnabled(); + await save.click(); + await expect.poll(() => fake.renames.length).toBe(1); +}); + test("an official package shows its name and why it can't be changed", async ({ page }) => { const fake: Fake = { name: "An Official Game", diff --git a/client/e2e/payloads-many-saved.spec.ts b/client/e2e/payloads-many-saved.spec.ts index 552149468..685ed8b0f 100644 --- a/client/e2e/payloads-many-saved.spec.ts +++ b/client/e2e/payloads-many-saved.spec.ts @@ -11,6 +11,8 @@ import { routeEngine, seedConsole } from "./fixtures/engine"; // Arabic). const SHOTS = process.env.PS5UPLOAD_SHOTS; +// A wide font, as Linux CI has (the label specs do the same). +const WIDE_FONT = "*{font-family:Verdana,'DejaVu Sans',sans-serif!important}"; const proc = (pid: number, comm: string, extra: Record = {}) => ({ pid, @@ -212,6 +214,32 @@ test.describe("desktop", () => { if (SHOTS) await page.screenshot({ path: `${SHOTS}/many-1280-dark.png`, fullPage: false }); }); + // A row that runs and is in the boot list has more buttons: its name and path still get the + // width every other row's get (they share one column for their actions), so its path is cut at + // the same place. + test("every row's text column is as wide as the others, the running one too", async ({ page }) => { + const root = await open(page); + await page.addStyleTag({ content: WIDE_FONT }); + const saved = root.getByTestId("pm-saved-list"); + const widths = await saved.getByTestId("pm-row-text").evaluateAll((els) => + els.map((e) => Math.round(e.getBoundingClientRect().width)), + ); + expect(widths).toHaveLength(20); + expect(Math.max(...widths) - Math.min(...widths)).toBeLessThanOrEqual(1); + // The actions end at the same place in every row. + const ends = await saved.getByTestId("pm-row-actions").evaluateAll((els) => + els.map((e) => Math.round(e.getBoundingClientRect().right)), + ); + expect(Math.max(...ends) - Math.min(...ends)).toBeLessThanOrEqual(1); + // The running row keeps every button. + const first = saved.locator("li").first(); + for (const name of ["Launch", "Don't load at boot", "Stop", "Delete"]) { + await expect(first.getByRole("button", { name, exact: true })).toBeVisible(); + } + await expectNoOverflow(page, root, "1280 wide font"); + if (SHOTS) await page.screenshot({ path: `${SHOTS}/many-1280-aligned.png` }); + }); + test("the filter box narrows a long list, by keyboard too", async ({ page }) => { const root = await open(page); const saved = root.getByTestId("pm-saved-list"); @@ -299,6 +327,46 @@ test.describe("phone", () => { if (SHOTS) await page.screenshot({ path: `${SHOTS}/many-390-filter.png` }); }); + // A compact row: the name and its state on one line, the main action as one button, the rest + // behind ⋯. Before, each row's buttons took two or three lines. + test("a saved payload is one compact row: name, state, one button, ⋯", async ({ page }) => { + const root = await open(page); + await page.addStyleTag({ content: WIDE_FONT }); + const saved = root.getByTestId("pm-saved-list"); + const rows = saved.locator("li"); + await expect(rows.first()).toHaveAttribute("data-compact", ""); + // The running one, first at boot: its state, Stop, and ⋯ with the rest. + const first = rows.first(); + await expect(first).toContainText("kstuff-1.13-fpkg.elf"); + await expect(first).toContainText("Running"); + await expect(first).toContainText("boot #1"); + await expect(first.getByRole("button", { name: "Stop", exact: true })).toBeVisible(); + await expect(first.getByRole("button", { name: "Launch", exact: true })).toHaveCount(0); + await expect(first.getByRole("button", { name: "Delete", exact: true })).toHaveCount(0); + // A plain one: Launch. + await expect(rows.nth(1).getByRole("button", { name: "Launch", exact: true })).toBeVisible(); + // As tall as the 44 px button and the row's padding: a name that wraps to two lines fits + // beside it (before, a row was about 170 px). + const heights = await rows.evaluateAll((els) => + els.slice(0, 19).map((e) => Math.round(e.getBoundingClientRect().height)), + ); + expect(Math.max(...heights)).toBeLessThanOrEqual(64); + // ⋯ holds the rest. + await first.getByRole("button", { name: "More for kstuff-1.13-fpkg.elf" }).click(); + const menu = page.getByRole("menu"); + for (const name of ["Don't load at boot", "Load earlier", "Load later", "Launch", "Delete"]) { + await expect(menu.getByRole("menuitem", { name, exact: true })).toBeVisible(); + } + await expect(menu.getByRole("menuitem", { name: "Load earlier", exact: true })).toBeDisabled(); + const m = (await menu.boundingBox())!; + expect(m.x).toBeGreaterThanOrEqual(0); + expect(m.x + m.width).toBeLessThanOrEqual(390.5); + if (SHOTS) await page.screenshot({ path: `${SHOTS}/many-390-compact-menu.png` }); + await page.keyboard.press("Escape"); + await expectNoOverflow(page, root, "phone wide font"); + if (SHOTS) await page.screenshot({ path: `${SHOTS}/many-390-compact.png` }); + }); + test("German, Russian and Arabic fit on a phone", async ({ page }) => { for (const lang of ["de", "ru", "ar"]) { const root = await open(page, { lang }); diff --git a/client/e2e/upload-phone-actions.spec.ts b/client/e2e/upload-phone-actions.spec.ts new file mode 100644 index 000000000..ca5a91d82 --- /dev/null +++ b/client/e2e/upload-phone-actions.spec.ts @@ -0,0 +1,153 @@ +import { expect, test, type Page } from "@playwright/test"; +import { routeEngine } from "./fixtures/engine"; + +// Upload & Install on a phone: the actions are one row (the main action, the rest behind ⋯) +// that sticks above the tab bar and the activity pill, not behind them, and nothing of the +// "Name on the PS5" card is left under that row: its hint and its "Name changed." line can be +// read. Until 12.6.32 three stacked buttons and the pill covered about a third of the screen. +// Tablets and computers keep their row of buttons. +// +// UPLOAD_PHONE_SHOTS= saves screenshots. + +const SHOTS = process.env.UPLOAD_PHONE_SHOTS; +// A wide font, as Linux CI has (the label specs do the same). +const WIDE_FONT = "*{font-family:Verdana,'DejaVu Sans',sans-serif!important}"; + +async function open(page: Page) { + await page.addInitScript(() => window.localStorage.setItem("ps5upload.host", "192.168.1.100")); + let name = "A Game-example.invalid"; + await routeEngine(page, (path, req) => { + if (path === "/api/version") return { version: "12.6.31", caps: {} }; + if (path === "/api/ps5/status") return { ok: true }; + if (path === "/api/ps5/volumes") return { volumes: [] }; + if (path === "/api/files/upload") return { upload_id: "up-a", path: "/tmp/staged/GameA.pkg", size: 5, filename: "GameA.pkg" }; + if (path === "/api/pkg/parse-split") + return { + head: { content_id: "UP0000-PPSA01234_00-TESTGAME00000000", title: name, category: "gd", platform: "ps5" }, + parts: [], + total_size: 1 << 30, + }; + if (path === "/api/pkg/name" && req.method() === "GET") + return { + platform: "ps5", + content_id: "UP0000-PPSA01234_00-TESTGAME00000000", + name, + entries: [{ key: "en-US", name }], + other_names: 0, + refusal: null, + max_bytes: 127, + room: { default_name: 60, all_languages: 60 }, + }; + if (path === "/api/pkg/name" && req.method() === "POST") { + const previous = name; + name = (req.postDataJSON() as { name: string }).name; + return { platform: "ps5", previous, name, changed: 1, written_bytes: 2000 }; + } + return {}; + }); + await page.goto("/send", { waitUntil: "domcontentloaded" }); + await page.addStyleTag({ content: WIDE_FONT }); + const chooser = page.waitForEvent("filechooser"); + await page.getByRole("button", { name: "From this device…", exact: true }).click(); + await (await chooser).setFiles([{ name: "GameA.pkg", mimeType: "application/octet-stream", buffer: Buffer.from("GameA") }]); + await expect(page.getByTestId("pkg-name-card")).toBeVisible({ timeout: 20_000 }); +} + +/** The top of whatever floats over the page's bottom: the tab bar, and the activity pill. */ +const floatTop = (page: Page) => + page.evaluate(() => { + let top = window.innerHeight; + for (const sel of ["[data-bottom-nav]", '[data-testid="activity-pill"]']) { + const el = document.querySelector(sel); + const b = el?.getBoundingClientRect(); + if (b && b.height > 0) top = Math.min(top, b.top); + } + return top; + }); + +for (const viewport of [ + { width: 390, height: 844 }, + { width: 360, height: 740 }, + { width: 412, height: 915 }, +]) { + test.describe(`phone ${viewport.width}x${viewport.height}`, () => { + test.use({ viewport, hasTouch: true, isMobile: true }); + + test("one row of actions above the tab bar, and the name card is never under it", async ({ page }) => { + await open(page); + const bar = page.getByTestId("upload-actions"); + await expect(bar).toHaveAttribute("data-compact", ""); + // The main action and ⋯, in one row. + const main = bar.getByTestId("upload-stream-install"); + await expect(main).toBeVisible(); + await expect(bar.getByRole("button", { name: "More actions" })).toBeVisible(); + await expect(bar.getByRole("button", { name: "Change source" })).toHaveCount(0); + const box = (await bar.boundingBox())!; + // One row (two would be about 100px). + expect(box.height).toBeLessThan(72); + // Not behind the tab bar or the pill. + expect(box.y + box.height).toBeLessThanOrEqual((await floatTop(page)) + 0.5); + // The label fits its button. + expect(await main.evaluate((el) => el.scrollWidth <= el.clientWidth + 1)).toBe(true); + + // Change the name: its "Name changed." line and the hint are in view, clear of the row. + const card = page.getByTestId("pkg-name-card"); + await card.getByTestId("pkg-name-input").fill("A Game"); + await card.getByTestId("pkg-name-save").click(); + const saved = card.getByTestId("pkg-name-saved"); + await expect(saved).toHaveText("Name changed."); + await page.waitForTimeout(300); + const barTop = (await bar.boundingBox())!.y; + const savedBox = (await saved.boundingBox())!; + expect(savedBox.y + savedBox.height).toBeLessThanOrEqual(barTop + 0.5); + if (SHOTS) await page.screenshot({ path: `${SHOTS}/upload-${viewport.width}x${viewport.height}.png` }); + + // Scrolled to the end, nothing at all is under the row or the tab bar. + const hidden = await page.evaluate(() => { + const root = document.querySelector("[data-scroll-root]")!; + root.scrollTop = root.scrollHeight; + const bar = document.querySelector('[data-testid="upload-actions"]')!.getBoundingClientRect(); + const nav = document.querySelector("[data-bottom-nav]")!.getBoundingClientRect(); + const cut: string[] = []; + for (const el of Array.from(root.querySelectorAll("p, label, h2, h3, button, input"))) { + if (el.closest('[data-testid="upload-actions"]')) continue; + const b = el.getBoundingClientRect(); + if (!b.height || !b.width) continue; + const under = (r: DOMRect) => b.bottom > r.top + 1 && b.top < r.bottom - 1; + if (under(bar) || under(nav)) cut.push(el.textContent?.trim().slice(0, 40) ?? el.tagName); + } + return cut; + }); + expect(hidden).toEqual([]); + + // The rest is behind ⋯. + await bar.getByRole("button", { name: "More actions" }).click(); + const menu = page.getByRole("menu"); + for (const item of ["Upload & install", "Add to queue", "Change source"]) { + await expect(menu.getByRole("menuitem", { name: new RegExp(`^${item.replace("&", "\\&")}`) })).toBeVisible(); + } + // The menu sits whole on screen. + const m = (await menu.boundingBox())!; + expect(m.x).toBeGreaterThanOrEqual(0); + expect(m.x + m.width).toBeLessThanOrEqual(viewport.width + 0.5); + if (SHOTS) await page.screenshot({ path: `${SHOTS}/upload-${viewport.width}x${viewport.height}-menu.png` }); + await menu.getByRole("menuitem", { name: /^Change source/ }).click(); + await expect(page.getByTestId("pkg-name-card")).toHaveCount(0); + }); + }); +} + +for (const viewport of [ + { width: 820, height: 1180 }, + { width: 1280, height: 800 }, +]) { + test(`${viewport.width}px keeps its row of buttons`, async ({ page }) => { + await page.setViewportSize(viewport); + await open(page); + const bar = page.getByTestId("upload-actions"); + await expect(bar).not.toHaveAttribute("data-compact", ""); + for (const name of ["Change source", "Add to queue", "Upload & install", "Stream & install"]) { + await expect(bar.getByRole("button", { name, exact: true })).toBeVisible(); + } + }); +} diff --git a/client/package-lock.json b/client/package-lock.json index 8c47ef659..66f4ccf98 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -1,12 +1,12 @@ { "name": "ps5upload-client", - "version": "12.6.30", + "version": "12.6.31", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "ps5upload-client", - "version": "12.6.30", + "version": "12.6.31", "dependencies": { "@tauri-apps/api": "^2.12.5", "@tauri-apps/plugin-dialog": "^2.8.4", diff --git a/client/package.json b/client/package.json index f74096e47..a337b5f1a 100644 --- a/client/package.json +++ b/client/package.json @@ -2,7 +2,7 @@ "name": "ps5upload-client", "private": true, "type": "module", - "version": "12.6.30", + "version": "12.6.31", "description": "The all-in-one PS5 companion app.", "homepage": "https://github.com/phantomptr/ps5upload", "author": "PhantomPtr ", diff --git a/client/site-shots/shotsVersion.ts b/client/site-shots/shotsVersion.ts new file mode 100644 index 000000000..ae944e677 --- /dev/null +++ b/client/site-shots/shotsVersion.ts @@ -0,0 +1,22 @@ +// The version the website's screenshots show (the sidebar's "v…", and what the made-up console and +// devices report). The pictures are taken before a release bumps the version, so the repo's own +// version is the one before the release they are for: by default they show the next patch +// release. SHOTS_VERSION=12.7.0 shows another (a minor or major release). + +/** `version` one patch level up: 12.6.31 → 12.6.32. A pre-release or build suffix is dropped. */ +export function nextPatch(version: string): string { + const m = /^\s*v?(\d+)\.(\d+)\.(\d+)/.exec(version); + if (!m) throw new Error(`not a version: ${JSON.stringify(version)}`); + return `${m[1]}.${m[2]}.${Number(m[3]) + 1}`; +} + +/** What the pictures show: `fromEnv` (SHOTS_VERSION) when set, else the repo's VERSION file's + * version plus one patch level. */ +export function shotsVersion(fromEnv: string | undefined, versionFile: string): string { + const asked = fromEnv?.trim().replace(/^v/, ""); + if (asked) { + if (!/^\d+\.\d+\.\d+$/.test(asked)) throw new Error(`SHOTS_VERSION is not a version: ${JSON.stringify(fromEnv)}`); + return asked; + } + return nextPatch(versionFile); +} diff --git a/client/site-shots/site-shots.spec.ts b/client/site-shots/site-shots.spec.ts index 8dfc87f8e..c81fe795e 100644 --- a/client/site-shots/site-shots.spec.ts +++ b/client/site-shots/site-shots.spec.ts @@ -1,5 +1,6 @@ import { readFileSync } from "node:fs"; import { expect, test, type Locator, type Page } from "@playwright/test"; +import { shotsVersion } from "./shotsVersion"; // The website's screenshots (site/assets/shots), taken from the real app against a made-up // console: fictional games with drawn covers (make-art.py), a drawn game picture for the stream, @@ -17,6 +18,8 @@ import { expect, test, type Locator, type Page } from "@playwright/test"; // Every language the app has gets its own set, from the app running in that language: English // in out/, the others in out//. SHOT_LANGS=de,fr takes only those; SHOTS_PORT=14620 uses // a dev server of its own instead of one already on 1420. +// The sidebar shows the version of the release the pictures are for: the repo's VERSION plus one +// patch level, or SHOTS_VERSION=12.7.0 for another. // // cd client && npx playwright test -c site-shots.config.ts && node site-shots/to-webp.mjs @@ -24,8 +27,10 @@ const HOST = "192.168.1.50"; const OUT = process.env.SHOTS_DIR ?? "site-shots/out"; const LANGS = (process.env.SHOT_LANGS ?? "en,zh-CN,zh-TW,hi,es,ar,bn,pl,pt-BR,ru,ja,de,fr,ko,tr,vi,id,it,th,hu,fa").split(","); const art = (name: string) => readFileSync(new URL(`./art/${name}.png`, import.meta.url)); -/** The app's own version, so the pictures never show an old one. */ -const VERSION = (JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8")) as { version: string }).version; +/** The version the pictures show (shotsVersion.ts): SHOTS_VERSION, else the repo's VERSION plus one + * patch level. They are taken before the release bumps it, and showed the version before. The + * sidebar reads it from the engine's /api/version, which is stubbed with it below. */ +const VERSION = shotsVersion(process.env.SHOTS_VERSION, readFileSync(new URL("../../VERSION", import.meta.url), "utf8")); const FIRMWARE = "10.01"; const ROOT = "/Volumes/Games"; diff --git a/client/src-tauri/Cargo.lock b/client/src-tauri/Cargo.lock index 1544c9edd..81ca9682f 100644 --- a/client/src-tauri/Cargo.lock +++ b/client/src-tauri/Cargo.lock @@ -4743,7 +4743,7 @@ dependencies = [ [[package]] name = "ps5-dump-forge-exfat" -version = "12.6.30" +version = "12.6.31" dependencies = [ "ps5-dump-forge-patch", "ps5upload-fpkg", @@ -4752,14 +4752,14 @@ dependencies = [ [[package]] name = "ps5-dump-forge-patch" -version = "12.6.30" +version = "12.6.31" dependencies = [ "crc32fast", ] [[package]] name = "ps5-dump-forge-pfs" -version = "12.6.30" +version = "12.6.31" dependencies = [ "flate2", "ps5-dump-forge-patch", @@ -4768,7 +4768,7 @@ dependencies = [ [[package]] name = "ps5-dump-forge-ufs2" -version = "12.6.30" +version = "12.6.31" dependencies = [ "ps5-dump-forge-patch", "ps5upload-fpkg", @@ -4777,7 +4777,7 @@ dependencies = [ [[package]] name = "ps5-dump-forge-zstd" -version = "12.6.30" +version = "12.6.31" dependencies = [ "crc32fast", "getrandom 0.4.3", @@ -4788,7 +4788,7 @@ dependencies = [ [[package]] name = "ps5upload-archive" -version = "12.6.30" +version = "12.6.31" dependencies = [ "anyhow", "crc32fast", @@ -4798,7 +4798,7 @@ dependencies = [ [[package]] name = "ps5upload-ava1" -version = "12.6.30" +version = "12.6.31" dependencies = [ "anyhow", "ava1", @@ -4817,7 +4817,7 @@ dependencies = [ [[package]] name = "ps5upload-convert-core" -version = "12.6.30" +version = "12.6.31" dependencies = [ "blake3", "libc", @@ -4834,7 +4834,7 @@ dependencies = [ [[package]] name = "ps5upload-core" -version = "12.6.30" +version = "12.6.31" dependencies = [ "aes 0.9.2", "aes-gcm 0.11.0", @@ -4868,7 +4868,7 @@ dependencies = [ [[package]] name = "ps5upload-desktop" -version = "12.6.30" +version = "12.6.31" dependencies = [ "anyhow", "ava1", @@ -4910,7 +4910,7 @@ dependencies = [ [[package]] name = "ps5upload-engine" -version = "12.6.30" +version = "12.6.31" dependencies = [ "aes 0.9.2", "aes-gcm 0.11.0", @@ -4974,7 +4974,7 @@ dependencies = [ [[package]] name = "ps5upload-fpkg" -version = "12.6.30" +version = "12.6.31" dependencies = [ "aes 0.9.2", "crc32fast", @@ -4997,7 +4997,7 @@ dependencies = [ [[package]] name = "ps5upload-hub" -version = "12.6.30" +version = "12.6.31" dependencies = [ "axum", "base64 0.23.1", @@ -5011,7 +5011,7 @@ dependencies = [ [[package]] name = "ps5upload-pkg" -version = "12.6.30" +version = "12.6.31" dependencies = [ "aes 0.9.2", "blake3", @@ -5023,7 +5023,7 @@ dependencies = [ [[package]] name = "ps5upload-tailnet" -version = "12.6.30" +version = "12.6.31" dependencies = [ "cc", ] diff --git a/client/src-tauri/Cargo.toml b/client/src-tauri/Cargo.toml index add3d7682..f0e15ac6a 100644 --- a/client/src-tauri/Cargo.toml +++ b/client/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ps5upload-desktop" -version = "12.6.30" +version = "12.6.31" description = "The all-in-one PS5 companion app." license = "GPL-3.0-or-later" edition = "2021" diff --git a/client/src-tauri/src/commands/self_install.rs b/client/src-tauri/src/commands/self_install.rs index 3770f80fa..3e3e81f62 100644 --- a/client/src-tauri/src/commands/self_install.rs +++ b/client/src-tauri/src/commands/self_install.rs @@ -115,6 +115,12 @@ impl Plan { pub fn needs_password(&self) -> bool { matches!(self, Plan::LinuxPackage { .. }) } + + /// A script replaces the app after it has quit, and keeps the `installing` marker while + /// it does. + pub fn replaces_the_app_after_quit(&self) -> bool { + matches!(self, Plan::MacDmg { .. } | Plan::LinuxAppImage { .. }) + } } /// The plan for a packaged Linux install: `kind` is the package format that owns the running @@ -210,6 +216,21 @@ say() {{ echo "$(date +%s) $*" >> "$log" 2>/dev/null; }}"#, ) } +/// The lines after the prelude of a script that replaces the app: it keeps the `installing` +/// marker (`update_files`: its PID and start time) beside the log while it works and removes +/// it when it ends, however it ends. A launch in between waits for it instead of judging an +/// install that is still under way (`update_wait_for_install`). +fn sh_marker_prelude(log: &Path) -> String { + let dir = log.parent().unwrap_or_else(|| Path::new("")); + format!( + r#"marker={} +echo "$$ $(date +%s)" > "$marker" 2>/dev/null +trap 'rm -f "$marker"' EXIT +trap 'exit 1' HUP INT TERM"#, + sh_quote(&super::update_files::marker_path(dir).to_string_lossy()) + ) +} + /// The script that carries `plan` out once process `pid` has quit, logging its steps to `log`. /// With `relaunch`, every path ends by starting the app, new or old; without it (an install on /// quit) nothing is started. None for the Windows plans: the setup is started directly and the @@ -219,6 +240,7 @@ say() {{ echo "$(date +%s) $*" >> "$log" 2>/dev/null; }}"#, /// ran pkexec first): the script only waits for the old process and starts the new one. pub fn script_for(plan: &Plan, pid: u32, relaunch: bool, log: &Path) -> Option { let prelude = sh_log_prelude(log); + let marking = sh_marker_prelude(log); Some(match plan { Plan::MacDmg { dmg, bundle } => { let dmg = sh_quote(&dmg.to_string_lossy()); @@ -228,6 +250,7 @@ pub fn script_for(plan: &Plan, pid: u32, relaunch: bool, log: &Path) -> Option/dev/null xattr -dr com.apple.quarantine "$app" 2>/dev/null +# Done before the app starts: the new version must not find an install still marked as running. +rm -f "$marker" {start} "# ) @@ -288,6 +313,7 @@ fi"# r#"#!/bin/sh # PS5Upload update: replace the AppImage (and its launcher) with the zip's, then start it. {prelude} +{marking} pid={pid} zip={zip} target={target} @@ -316,6 +342,8 @@ else say "could not unpack the zip (no unzip or python3?)" fi rm -rf "$dir" +# Done before the app starts: the new version must not find an install still marked as running. +rm -f "$marker" {start} "# ) @@ -713,7 +741,8 @@ pub(crate) fn without_appimage_env(cmd: &mut std::process::Command, appimage: bo } /// Start `script` (a shell script) detached from this process, so it outlives the app. -fn spawn_detached(script: &str) -> Result<(), String> { +/// Returns its PID. +fn spawn_detached(script: &str) -> Result { let path = std::env::temp_dir().join(format!("ps5upload-update-{}.sh", std::process::id())); std::fs::write(&path, script).map_err(|e| format!("write {}: {e}", path.display()))?; let mut cmd = std::process::Command::new("/bin/sh"); @@ -729,12 +758,12 @@ fn spawn_detached(script: &str) -> Result<(), String> { .stdout(std::process::Stdio::null()) .stderr(std::process::Stdio::null()) .spawn() - .map(|_| ()) + .map(|child| child.id()) .map_err(|e| format!("start the update: {e}")) } -/// Start the Windows setup on its own, detached, so it outlives the app. -fn spawn_setup(installer: &Path, relaunch: bool) -> Result<(), String> { +/// Start the Windows setup on its own, detached, so it outlives the app. Returns its PID. +fn spawn_setup(installer: &Path, relaunch: bool) -> Result { let mut cmd = std::process::Command::new(installer); cmd.args(windows_setup_args(relaunch)); #[cfg(windows)] @@ -748,7 +777,7 @@ fn spawn_setup(installer: &Path, relaunch: bool) -> Result<(), String> { .stdout(std::process::Stdio::null()) .stderr(std::process::Stdio::null()) .spawn() - .map(|_| ()) + .map(|child| child.id()) .map_err(|e| format!("start the update setup {}: {e}", installer.display())) } @@ -826,16 +855,320 @@ fn start(plan: &Plan, relaunch: bool, dir: &Path) -> Result<(), String> { return Ok(()); } let log = super::update_files::log_path(dir); + // The installer's marker, written here as well as by the script (its first lines), so no + // launch can fall between this app's end and the script's start. The Windows setup cannot + // write one: this is its only marker, and its process ending is what ends it. + let mark = |pid: u32| { + super::update_files::write_marker( + dir, + super::update_files::Marker { + pid, + started: super::update_files::now_secs(), + }, + ); + }; match script_for(plan, std::process::id(), relaunch, &log) { - Some(script) => spawn_detached(&script), + Some(script) => { + let pid = spawn_detached(&script)?; + if plan.replaces_the_app_after_quit() { + mark(pid); + } + Ok(()) + } None => match plan { - Plan::WindowsSetup { installer, .. } => spawn_setup(installer, relaunch), + Plan::WindowsSetup { installer, .. } => spawn_setup(installer, relaunch).map(mark), Plan::LinuxPackage { .. } => Ok(()), _ => Err("no way to install this update".into()), }, } } +/// Whether process `pid` is running now. +#[cfg(unix)] +pub(crate) fn pid_alive(pid: u32) -> bool { + let Ok(pid) = i32::try_from(pid) else { + return false; + }; + if pid <= 0 { + return false; + } + // SAFETY: signal 0 only checks that the process exists. EPERM: it does, as another user. + let r = unsafe { libc::kill(pid, 0) }; + r == 0 || std::io::Error::last_os_error().raw_os_error() == Some(libc::EPERM) +} + +#[cfg(windows)] +pub(crate) fn pid_alive(pid: u32) -> bool { + use std::ffi::c_void; + #[allow(non_snake_case)] + extern "system" { + fn OpenProcess(access: u32, inherit: i32, pid: u32) -> *mut c_void; + fn WaitForSingleObject(handle: *mut c_void, ms: u32) -> u32; + fn CloseHandle(handle: *mut c_void) -> i32; + } + const SYNCHRONIZE: u32 = 0x0010_0000; + const WAIT_TIMEOUT: u32 = 0x0000_0102; + // SAFETY: plain kernel32 calls on a handle this function owns and closes. + unsafe { + let h = OpenProcess(SYNCHRONIZE, 0, pid); + if h.is_null() { + return false; + } + let running = WaitForSingleObject(h, 0) == WAIT_TIMEOUT; + CloseHandle(h); + running + } +} + +#[cfg(not(any(unix, windows)))] +pub(crate) fn pid_alive(_pid: u32) -> bool { + false +} + +/// How long a launch waits for a running installer before it carries on in the old version +/// without saying anything (the next launch judges). An install is the app's own quit (30 s +/// at most) and a copy of the app. +const INSTALL_WAIT_LIMIT: std::time::Duration = std::time::Duration::from_secs(150); + +/// How a wait for the installer ended. +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum WaitEnd { + /// It removed its marker: it is done, whatever it did. + Finished, + /// Its process is gone and the marker is still there. + Stale, + /// Still working after the limit. + TimedOut, +} + +/// Wait for the installer the marker in `dir` names, at most `limit`, looking every `poll`. +/// A stale marker is left for `settle_unless_installing` to clear and explain. +pub fn wait_for_installer( + dir: &Path, + limit: std::time::Duration, + poll: std::time::Duration, + alive: &dyn Fn(u32) -> bool, +) -> WaitEnd { + use super::update_files::{marker_state_in, now_secs, MarkerState}; + let until = std::time::Instant::now() + limit; + loop { + match marker_state_in(dir, now_secs(), alive) { + MarkerState::None => return WaitEnd::Finished, + MarkerState::Stale(_) => return WaitEnd::Stale, + MarkerState::Live(_) => {} + } + if std::time::Instant::now() >= until { + return WaitEnd::TimedOut; + } + std::thread::sleep(poll); + } +} + +/// What the app does once the wait is over. +#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize)] +#[serde(rename_all = "kebab-case")] +pub enum AfterInstall { + /// The program on disk is not the one running: start it and quit. + Relaunch, + /// The installer ended and the program is the same: judge the install now + /// (`update_last_install`), which says what really happened. + Report, + /// The installer is still working: carry on, say nothing. + KeepRunning, +} + +/// The decision: start again only into a program that really changed, report only an install +/// that ended. +pub fn after_install(end: WaitEnd, program_changed: bool) -> AfterInstall { + match end { + WaitEnd::TimedOut => AfterInstall::KeepRunning, + _ if program_changed => AfterInstall::Relaunch, + _ => AfterInstall::Report, + } +} + +/// What tells one copy of the program file from another at the same path. +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct ProgramStamp { + len: u64, + modified: Option, + /// The inode (Unix): a replaced file is a new one even with the same size and time. + id: u64, +} + +pub fn program_stamp(path: &Path) -> Option { + let meta = std::fs::metadata(path).ok()?; + #[cfg(unix)] + let id = std::os::unix::fs::MetadataExt::ino(&meta); + #[cfg(not(unix))] + let id = 0; + Some(ProgramStamp { + len: meta.len(), + modified: meta.modified().ok(), + id, + }) +} + +/// Whether the program at the path this process started from was replaced since: both stamps +/// known and different. A program that is missing now (a swap that stopped halfway) is not +/// something to start. +pub fn program_changed(before: Option<&ProgramStamp>, after: Option<&ProgramStamp>) -> bool { + matches!((before, after), (Some(b), Some(a)) if a != b) +} + +/// The file an update replaces for this copy: the AppImage it runs as, else the program. +fn program_path() -> Option { + std::env::var_os("APPIMAGE") + .map(PathBuf::from) + .or_else(|| std::env::current_exe().ok()) +} + +static STARTED_AS: std::sync::OnceLock> = + std::sync::OnceLock::new(); + +/// Remember the program file this process started from. Called first thing in `run()`. +pub fn note_program() { + STARTED_AS.get_or_init(|| { + let path = program_path()?; + let stamp = program_stamp(&path)?; + Some((path, stamp)) + }); +} + +fn program_changed_since_start() -> bool { + match STARTED_AS.get().and_then(Option::as_ref) { + Some((path, before)) => program_changed(Some(before), program_stamp(path).as_ref()), + None => false, + } +} + +/// What starts this copy again. +#[derive(Debug, Clone, PartialEq, Eq)] +pub enum Restart { + /// `open` the `.app` bundle. + MacBundle(PathBuf), + /// The AppImage, through the launcher beside it when it has one. + AppImage(PathBuf), + /// The program itself. + Exe(PathBuf), +} + +/// How this copy is started again: as the install scripts start it. +pub fn restart_for(os: &str, exe: &Path, appimage: Option<&Path>) -> Restart { + if os == "linux" { + if let Some(a) = appimage { + return Restart::AppImage(a.to_path_buf()); + } + } + if os == "macos" { + // …/PS5Upload.app/Contents/MacOS/PS5Upload + let bundle = exe.parent().and_then(Path::parent).and_then(Path::parent); + if let Some(b) = bundle.filter(|b| b.extension().is_some_and(|e| e == "app")) { + return Restart::MacBundle(b.to_path_buf()); + } + } + Restart::Exe(exe.to_path_buf()) +} + +/// The script that starts the app again once process `pid` (this one) has quit. +pub fn restart_script(restart: &Restart, pid: u32, log: &Path) -> String { + let prelude = sh_log_prelude(log); + let (target, start) = match restart { + Restart::MacBundle(app) => (app, r#"open "$target""#), + Restart::AppImage(appimage) => ( + appimage, + r#"launcher="$(dirname "$target")/PS5Upload.sh" +if [ "$(basename "$target")" = PS5Upload.AppImage ] && [ -x "$launcher" ]; then + nohup "$launcher" >/dev/null 2>&1 & +else + nohup "$target" >/dev/null 2>&1 & +fi"#, + ), + Restart::Exe(exe) => (exe, r#"nohup "$target" >/dev/null 2>&1 &"#), + }; + let target = sh_quote(&target.to_string_lossy()); + format!( + r#"#!/bin/sh +# PS5Upload update: the update finished while the app was open; start the new version once +# this one has quit. +{prelude} +pid={pid} +target={target} +n=0 +while kill -0 "$pid" 2>/dev/null && [ "$n" -lt 60 ]; do sleep 0.5; n=$((n+1)); done +# Still running after 30 s: it hung on the way out. +if kill -0 "$pid" 2>/dev/null; then say "the app did not quit in 30 s: ended it"; kill -9 "$pid"; sleep 1; fi +{start} +"# + ) +} + +/// Start this copy again once it has quit. +fn relaunch(dir: &Path) -> Result<(), String> { + let exe = std::env::current_exe().map_err(|e| format!("find the app to start again: {e}"))?; + let appimage = std::env::var_os("APPIMAGE").map(PathBuf::from); + let restart = restart_for(std::env::consts::OS, &exe, appimage.as_deref()); + if cfg!(windows) { + return spawn_new_exe(&exe); + } + let log = super::update_files::log_path(dir); + spawn_detached(&restart_script(&restart, std::process::id(), &log)).map(|_| ()) +} + +/// An installer is working (`update_last_install` said `pending`): wait for it, bounded, then +/// either start again into the program it put in place (the app quits; this never returns to +/// a live window), or tell the renderer to ask for the outcome (`report`), or to carry on +/// (`keep-running`: it is still working after the limit). +#[tauri::command] +pub async fn update_wait_for_install(app: AppHandle) -> Result { + use super::update_files as files; + let dir = files::updates_dir(&app)?; + let waited = dir.clone(); + let end = tauri::async_runtime::spawn_blocking(move || { + wait_for_installer( + &waited, + INSTALL_WAIT_LIMIT, + std::time::Duration::from_millis(500), + &pid_alive, + ) + }) + .await + .map_err(|e| format!("update_wait_for_install: {e}"))?; + let next = after_install(end, program_changed_since_start()); + if next != AfterInstall::Relaunch { + return Ok(next); + } + files::log( + &dir, + "the update finished while the app was open: starting the new version", + ); + if let Err(e) = relaunch(&dir) { + files::log(&dir, &format!("could not start it: {e}")); + return Ok(AfterInstall::Report); + } + // Nothing armed may start a second install on the way out. + *on_quit_slot() = None; + tokio::time::sleep(std::time::Duration::from_millis(300)).await; + #[cfg(desktop)] + std::thread::spawn(|| { + std::thread::sleep(std::time::Duration::from_secs(15)); + crate::exit_guard::kill_all(); + std::process::exit(0); + }); + app.exit(0); + Ok(next) +} + +/// Whether an installer is at work in `dir` right now: a second install must not start +/// beside it. +fn install_running(dir: &Path) -> bool { + use super::update_files::{marker_state_in, now_secs, MarkerState}; + matches!( + marker_state_in(dir, now_secs(), &pid_alive), + MarkerState::Live(_) + ) +} + /// Record the install (`update_files`), then start it. A failure to start is recorded as the /// reason, so that version is not tried again by itself (`update_last_install`). fn record_and_start( @@ -979,6 +1312,10 @@ pub fn install_armed_on_quit() { let Some(armed) = on_quit_slot().take() else { return; }; + // An earlier quit's install is still working (the app was opened again meanwhile). + if install_running(&armed.dir) { + return; + } // Hashed again: the file waited on disk since it was armed. let result = match ( plan(&armed.download), @@ -1016,6 +1353,9 @@ pub async fn update_install( version: Option, ) -> Result<(), String> { let (download, dir) = downloaded_update(&app, &path)?; + if install_running(&dir) { + return Err("an update is already being installed".into()); + } let probe = download.clone(); // Only a download that matched its release's SHA-256, hashed again now: the file sat in the // updates folder since, and this runs it. @@ -1608,4 +1948,417 @@ mod tests { assert_eq!(windows_setup_args(true), ["/P", "/R", "/UPDATE"]); assert_eq!(windows_setup_args(false), ["/P", "/UPDATE"]); } + + use super::super::update_files as files; + + /// The scripts that replace the app keep the marker while they work and remove it before + /// they start the app; the package script (nothing left to replace) has none. Unix only: + /// these shell scripts only run on macOS and Linux, and Windows joins the paths with `\`. + #[cfg(unix)] + #[test] + fn the_scripts_that_replace_the_app_mark_the_install_as_running() { + let log = Path::new("/home/o'neil/.local/share/PS5Upload/updates/update.log"); + for plan in [ + Plan::MacDmg { + dmg: PathBuf::from("/tmp/PS5Upload.dmg"), + bundle: PathBuf::from("/Applications/PS5Upload.app"), + }, + Plan::LinuxAppImage { + zip: PathBuf::from("/tmp/PS5Upload.zip"), + appimage: PathBuf::from("/home/me/PS5Upload.AppImage"), + }, + ] { + assert!(plan.replaces_the_app_after_quit()); + for relaunch in [true, false] { + let s = script_for(&plan, 42, relaunch, log).unwrap(); + assert!( + s.contains( + "marker='/home/o'\\''neil/.local/share/PS5Upload/updates/installing'" + ), + "{s}" + ); + let write = s.find(r#"echo "$$ $(date +%s)" > "$marker""#).unwrap(); + let trap = s.find(r#"trap 'rm -f "$marker"' EXIT"#).unwrap(); + let wait = s.find("while kill -0").unwrap(); + let done = s.rfind(r#"rm -f "$marker""#).unwrap(); + assert!(write < trap && trap < wait && wait < done, "{s}"); + // A signal ends it through the same trap. + assert!(s.contains("trap 'exit 1' HUP INT TERM")); + if relaunch { + let start = s + .rfind("open \"$app\"") + .or_else(|| s.rfind("nohup")) + .unwrap(); + assert!(done < start, "the marker goes before the app starts: {s}"); + } + } + } + let package = Plan::LinuxPackage { + package: PathBuf::from("/tmp/PS5Upload.deb"), + manager: PackageManager::Apt, + exe: PathBuf::from("/usr/bin/ps5upload"), + }; + assert!(!package.replaces_the_app_after_quit()); + assert!(!script_for(&package, 42, true, log) + .unwrap() + .contains("marker")); + for windows in [ + Plan::WindowsSetup { + installer: PathBuf::from("C:\\u\\setup.exe"), + exe: PathBuf::from("C:\\a\\PS5Upload.exe"), + }, + Plan::WindowsZip { + zip: PathBuf::from("C:\\u\\a.zip"), + exe: PathBuf::from("C:\\a\\PS5Upload.exe"), + }, + ] { + assert!(!windows.replaces_the_app_after_quit()); + } + } + + #[test] + fn the_app_starts_again_only_into_a_program_that_changed() { + use AfterInstall::*; + // The installer finished and the program on disk is new: start it. + assert_eq!(after_install(WaitEnd::Finished, true), Relaunch); + // It finished and nothing changed: it failed, say what the log says. + assert_eq!(after_install(WaitEnd::Finished, false), Report); + // Its process is gone: the same two cases (the Windows setup always ends this way). + assert_eq!(after_install(WaitEnd::Stale, true), Relaunch); + assert_eq!(after_install(WaitEnd::Stale, false), Report); + // Still working after the limit: no restart under it, and no "failed". + assert_eq!(after_install(WaitEnd::TimedOut, true), KeepRunning); + assert_eq!(after_install(WaitEnd::TimedOut, false), KeepRunning); + assert_eq!( + serde_json::to_string(&KeepRunning).unwrap(), + "\"keep-running\"" + ); + assert_eq!(serde_json::to_string(&Relaunch).unwrap(), "\"relaunch\""); + assert_eq!(serde_json::to_string(&Report).unwrap(), "\"report\""); + } + + #[test] + fn a_replaced_program_file_is_seen_and_a_missing_one_is_not_started() { + let dir = scratch("stamp"); + let exe = dir.join("PS5Upload"); + std::fs::write(&exe, b"old version").unwrap(); + let before = program_stamp(&exe); + assert!(before.is_some()); + assert!(!program_changed( + before.as_ref(), + program_stamp(&exe).as_ref() + )); + // Replaced the way every installer does it: a new file renamed into place. + let new = dir.join("PS5Upload.new"); + std::fs::write(&new, b"new version!").unwrap(); + std::fs::rename(&new, &exe).unwrap(); + assert!(program_changed( + before.as_ref(), + program_stamp(&exe).as_ref() + )); + // Halfway through a swap there is no program: nothing to start. + std::fs::remove_file(&exe).unwrap(); + assert_eq!(program_stamp(&exe), None); + assert!(!program_changed(before.as_ref(), None)); + assert!(!program_changed(None, before.as_ref())); + let _ = std::fs::remove_dir_all(&dir); + } + + /// Same size, same second: on Unix the inode still tells a replaced file. + #[cfg(unix)] + #[test] + fn a_replacement_of_the_same_size_is_still_seen() { + let dir = scratch("stamp-same"); + let exe = dir.join("PS5Upload"); + std::fs::write(&exe, b"version A").unwrap(); + let before = program_stamp(&exe); + let new = dir.join("PS5Upload.new"); + std::fs::write(&new, b"version B").unwrap(); + std::fs::rename(&new, &exe).unwrap(); + assert!(program_changed( + before.as_ref(), + program_stamp(&exe).as_ref() + )); + let _ = std::fs::remove_dir_all(&dir); + } + + #[test] + fn each_platform_starts_the_app_again_its_own_way() { + let mac = Path::new("/Applications/PS5Upload.app/Contents/MacOS/PS5Upload"); + assert_eq!( + restart_for("macos", mac, None), + Restart::MacBundle(PathBuf::from("/Applications/PS5Upload.app")) + ); + // A bare binary (a dev build): itself. + let bare = Path::new("/Users/me/target/debug/ps5upload"); + assert_eq!(restart_for("macos", bare, None), Restart::Exe(bare.into())); + let mount = Path::new("/tmp/.mount_PS5abc/usr/bin/ps5upload"); + let appimage = Path::new("/home/me/Apps/PS5Upload.AppImage"); + assert_eq!( + restart_for("linux", mount, Some(appimage)), + Restart::AppImage(appimage.into()) + ); + assert_eq!( + restart_for("linux", Path::new("/usr/bin/ps5upload"), None), + Restart::Exe(PathBuf::from("/usr/bin/ps5upload")) + ); + let win = Path::new("C:\\Program Files\\PS5Upload\\PS5Upload.exe"); + assert_eq!(restart_for("windows", win, None), Restart::Exe(win.into())); + // $APPIMAGE set by something else on another system changes nothing there. + assert_eq!( + restart_for("macos", mac, Some(appimage)), + Restart::MacBundle(PathBuf::from("/Applications/PS5Upload.app")) + ); + } + + #[test] + fn the_restart_scripts_wait_for_this_app_and_start_the_right_thing() { + let log = Path::new("update.log"); + let mac = restart_script( + &Restart::MacBundle(PathBuf::from("/Applications/PS5 Upload.app")), + 77, + log, + ); + assert!(mac.contains("pid=77") && mac.contains("target='/Applications/PS5 Upload.app'")); + assert!(mac.find("while kill -0").unwrap() < mac.find("open \"$target\"").unwrap()); + let appimage = restart_script( + &Restart::AppImage(PathBuf::from("/home/me/PS5Upload.AppImage")), + 77, + log, + ); + assert!( + appimage.contains(r#"nohup "$launcher""#) && appimage.contains(r#"nohup "$target""#) + ); + let exe = restart_script(&Restart::Exe(PathBuf::from("/usr/bin/ps5upload")), 77, log); + assert!(exe.contains(r#"nohup "$target" >/dev/null 2>&1 &"#)); + // None of them is an install: no marker. + for s in [&mac, &appimage, &exe] { + assert!(!s.contains("marker")); + } + } + + #[cfg(unix)] + #[test] + fn the_restart_scripts_parse() { + for r in [ + Restart::MacBundle(PathBuf::from("/Users/o'neil/PS5Upload.app")), + Restart::AppImage(PathBuf::from("/home/o'neil/PS5Upload.AppImage")), + Restart::Exe(PathBuf::from("/usr/bin/ps5 upload")), + ] { + let out = std::process::Command::new("/bin/sh") + .arg("-n") + .arg("-c") + .arg(restart_script(&r, 42, Path::new("update.log"))) + .output() + .unwrap(); + assert!( + out.status.success(), + "{r:?}: {}", + String::from_utf8_lossy(&out.stderr) + ); + } + } + + #[test] + fn waiting_for_the_installer_ends_when_it_does_or_at_the_limit() { + use std::time::Duration; + let dir = scratch("wait"); + let poll = Duration::from_millis(20); + // No marker: nothing to wait for. + assert_eq!( + wait_for_installer(&dir, Duration::from_secs(5), poll, &|_| true), + WaitEnd::Finished + ); + let mark = || { + files::write_marker( + &dir, + files::Marker { + pid: 4242, + started: files::now_secs(), + }, + ) + }; + // The installer removes its marker while we wait. + mark(); + let d = dir.clone(); + let remover = std::thread::spawn(move || { + std::thread::sleep(Duration::from_millis(150)); + files::remove_marker(&d); + }); + let t = std::time::Instant::now(); + assert_eq!( + wait_for_installer(&dir, Duration::from_secs(10), poll, &|_| true), + WaitEnd::Finished + ); + assert!(t.elapsed() >= Duration::from_millis(100) && t.elapsed() < Duration::from_secs(5)); + remover.join().unwrap(); + // Its process is gone: stale at once, and the marker is left to be explained. + mark(); + assert_eq!( + wait_for_installer(&dir, Duration::from_secs(10), poll, &|_| false), + WaitEnd::Stale + ); + assert!(files::marker_path(&dir).is_file()); + // Still working at the limit: bounded. + let t = std::time::Instant::now(); + assert_eq!( + wait_for_installer(&dir, Duration::from_millis(120), poll, &|_| true), + WaitEnd::TimedOut + ); + assert!(t.elapsed() < Duration::from_secs(3)); + let _ = std::fs::remove_dir_all(&dir); + } + + #[cfg(unix)] + #[test] + fn this_process_is_alive_and_an_ended_one_is_not() { + assert!(pid_alive(std::process::id())); + let mut child = std::process::Command::new("/bin/sleep") + .arg("0") + .spawn() + .unwrap(); + let pid = child.id(); + child.wait().unwrap(); + assert!(!pid_alive(pid)); + assert!(!pid_alive(0)); + } + + /// Runs a real install script against a download that is not one, with a stand-in for the + /// quitting app: while it waits for that app the marker names the script and reads as + /// live; when it ends the marker is gone and the log holds the reason. + #[cfg(unix)] + fn run_script_and_watch_its_marker(name: &str, plan: &Plan, reason: &str) { + use std::time::{Duration, Instant}; + let dir = scratch(name); + let log = files::log_path(&dir); + let mut old_app = std::process::Command::new("/bin/sleep") + .arg("30") + .spawn() + .unwrap(); + let script = script_for(plan, old_app.id(), false, &log).unwrap(); + let path = dir.join("update.sh"); + std::fs::write(&path, script).unwrap(); + let mut sh = std::process::Command::new("/bin/sh") + .arg(&path) + .stdout(std::process::Stdio::null()) + .stderr(std::process::Stdio::null()) + .spawn() + .unwrap(); + let until = Instant::now() + Duration::from_secs(10); + let marker = loop { + if let Some(m) = files::read_marker(&dir) { + break m; + } + assert!(Instant::now() < until, "the script wrote no marker"); + std::thread::sleep(Duration::from_millis(20)); + }; + assert_eq!(marker.pid, sh.id(), "the marker names the script itself"); + assert!(marker.started.abs_diff(files::now_secs()) < 60); + assert_eq!( + files::marker_state_in(&dir, files::now_secs(), &pid_alive), + files::MarkerState::Live(marker) + ); + // A launch now is told to wait, not that the update failed. + let record = files::InstallRecord { + from: "10.4.1".into(), + to: "10.5.1".into(), + file: dir.join("PS5Upload-10.5.1-mac-arm64.dmg"), + error: None, + reported: false, + }; + files::write_record(&dir, &record).unwrap(); + let during = + files::settle_unless_installing(&dir, "10.4.1", files::now_secs(), &pid_alive).unwrap(); + assert!(during.pending && !during.new); + // The old app quits; the script goes on, fails on the bad download and ends. + old_app.kill().unwrap(); + old_app.wait().unwrap(); + assert_eq!( + wait_for_installer( + &dir, + Duration::from_secs(60), + Duration::from_millis(50), + &pid_alive + ), + WaitEnd::Finished + ); + sh.wait().unwrap(); + assert!(!files::marker_path(&dir).exists()); + let after = + files::settle_unless_installing(&dir, "10.4.1", files::now_secs(), &pid_alive).unwrap(); + assert!(!after.pending && !after.installed && after.new); + assert!(after.message.starts_with(reason), "{}", after.message); + let _ = std::fs::remove_dir_all(&dir); + } + + #[cfg(target_os = "macos")] + #[test] + fn the_mac_script_keeps_its_marker_while_it_runs() { + let dir = scratch("mac-script-in"); + let dmg = dir.join("not-a-disk-image.dmg"); + std::fs::write(&dmg, b"not a disk image").unwrap(); + run_script_and_watch_its_marker( + "mac-script", + &Plan::MacDmg { + dmg, + bundle: dir.join("PS5Upload.app"), + }, + "could not open the .dmg", + ); + let _ = std::fs::remove_dir_all(&dir); + } + + #[cfg(unix)] + #[test] + fn the_appimage_script_keeps_its_marker_while_it_runs() { + let dir = scratch("appimage-script-in"); + let zip = dir.join("not-a-zip.zip"); + std::fs::write(&zip, b"not a zip").unwrap(); + run_script_and_watch_its_marker( + "appimage-script", + &Plan::LinuxAppImage { + zip, + appimage: dir.join("PS5Upload.AppImage"), + }, + "could not unpack the zip", + ); + let _ = std::fs::remove_dir_all(&dir); + } + + /// A script ended by a signal still removes its marker (the EXIT trap). + #[cfg(unix)] + #[test] + fn a_script_that_is_ended_early_removes_its_marker() { + use std::time::{Duration, Instant}; + let dir = scratch("script-term"); + let log = files::log_path(&dir); + let mut old_app = std::process::Command::new("/bin/sleep") + .arg("30") + .spawn() + .unwrap(); + let plan = Plan::LinuxAppImage { + zip: dir.join("a.zip"), + appimage: dir.join("PS5Upload.AppImage"), + }; + let path = dir.join("update.sh"); + std::fs::write(&path, script_for(&plan, old_app.id(), false, &log).unwrap()).unwrap(); + let mut sh = std::process::Command::new("/bin/sh") + .arg(&path) + .spawn() + .unwrap(); + let until = Instant::now() + Duration::from_secs(10); + while files::read_marker(&dir).is_none() { + assert!(Instant::now() < until, "the script wrote no marker"); + std::thread::sleep(Duration::from_millis(20)); + } + // SAFETY: a signal to a child this test started. + unsafe { + libc::kill(sh.id() as i32, libc::SIGTERM); + } + sh.wait().unwrap(); + assert!(!files::marker_path(&dir).exists()); + old_app.kill().unwrap(); + old_app.wait().unwrap(); + let _ = std::fs::remove_dir_all(&dir); + } } diff --git a/client/src-tauri/src/commands/update_files.rs b/client/src-tauri/src/commands/update_files.rs index 1cb804b07..19cb33b31 100644 --- a/client/src-tauri/src/commands/update_files.rs +++ b/client/src-tauri/src/commands/update_files.rs @@ -11,6 +11,13 @@ //! the download and the log are deleted. Still the old version means it did not: the reason //! (the last line of the log, or the error the app saw) is shown once, and the record stays so //! the automatic install and install-on-quit do not try that version again by themselves. +//! +//! While an install works, the `installing` file beside the record names the installer (its +//! PID and when it started); the installer deletes it when it ends. A launch that finds it and +//! a live installer does not judge yet (`settle_unless_installing`): it waits for the installer +//! and starts again into the new version (`self_install::update_wait_for_install`). A marker +//! whose installer is gone is stale: it is removed, the log says so, and the install is judged +//! as usual. So "update failed" is said only for an install that ended without installing. use std::path::{Path, PathBuf}; @@ -19,6 +26,11 @@ use tauri::{AppHandle, Manager}; const RECORD: &str = "install.json"; const LOG: &str = "update.log"; +/// The file an installer keeps while it works: ` `. +const MARKER: &str = "installing"; +/// A marker older than this is stale whatever its PID says (a PID is used again in time): an +/// install waits at most 30 s for the app to quit and then copies a few hundred megabytes. +pub const MARKER_MAX_AGE_SECS: u64 = 15 * 60; /// `update.log` is cut back to empty past this; one install writes a few hundred bytes. const LOG_MAX_BYTES: u64 = 64 * 1024; @@ -82,11 +94,103 @@ pub(crate) fn log(dir: &Path, line: &str) { .append(true) .open(&path) { - let secs = std::time::SystemTime::now() - .duration_since(std::time::UNIX_EPOCH) - .map(|d| d.as_secs()) - .unwrap_or(0); - let _ = writeln!(f, "{secs} {line}"); + let _ = writeln!(f, "{} {line}", now_secs()); + } +} + +/// The installer at work, as its marker names it. +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub struct Marker { + pub pid: u32, + /// When it started, Unix seconds. + pub started: u64, +} + +/// What a marker says at a launch. +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum MarkerState { + /// No install is running. + None, + /// The installer is still working: wait for it, judge nothing yet. + Live(Marker), + /// The installer is gone (or the marker is too old to believe) but left its marker: it + /// did not finish. + Stale(Marker), +} + +pub(crate) fn marker_path(dir: &Path) -> PathBuf { + dir.join(MARKER) +} + +/// The marker's one line. The scripts write the same with `echo "$$ $(date +%s)"`. +pub fn marker_line(m: Marker) -> String { + format!("{} {}\n", m.pid, m.started) +} + +/// Read a marker's text: exactly a PID and a start time. Anything else is no marker. +pub fn parse_marker(text: &str) -> Option { + let mut parts = text.split_whitespace(); + let pid = parts.next()?.parse::().ok().filter(|p| *p != 0)?; + let started = parts.next()?.parse::().ok()?; + parts.next().is_none().then_some(Marker { pid, started }) +} + +pub(crate) fn read_marker(dir: &Path) -> Option { + parse_marker(&std::fs::read_to_string(marker_path(dir)).ok()?) +} + +pub(crate) fn write_marker(dir: &Path, m: Marker) { + let _ = std::fs::write(marker_path(dir), marker_line(m)); +} + +pub(crate) fn remove_marker(dir: &Path) { + let _ = std::fs::remove_file(marker_path(dir)); +} + +pub(crate) fn now_secs() -> u64 { + std::time::SystemTime::now() + .duration_since(std::time::UNIX_EPOCH) + .map(|d| d.as_secs()) + .unwrap_or(0) +} + +/// Judge a marker: live only while its process runs (`alive`) and it is younger than +/// `MARKER_MAX_AGE_SECS`. A start time in the future (the clock was set back) is not trusted +/// past the same margin. +pub fn marker_state(marker: Option, now: u64, alive: bool) -> MarkerState { + let Some(m) = marker else { + return MarkerState::None; + }; + let age_ok = now.abs_diff(m.started) <= MARKER_MAX_AGE_SECS; + if alive && age_ok { + MarkerState::Live(m) + } else { + MarkerState::Stale(m) + } +} + +/// The marker in `dir` judged now; `alive` tells whether a PID still runs. +pub fn marker_state_in(dir: &Path, now: u64, alive: &dyn Fn(u32) -> bool) -> MarkerState { + let marker = read_marker(dir); + marker_state(marker, now, marker.is_some_and(|m| alive(m.pid))) +} + +/// A stale marker is removed. When the version it was installing is still not the one running +/// and nothing else gave a reason, the log says what happened, so the failure reported next +/// carries the real one. (The Windows setup never removes its marker: gone with the new version +/// running is its normal end, and nothing is logged.) +pub(crate) fn clear_stale_marker(dir: &Path, m: Marker, current: &str) { + remove_marker(dir); + let failed = read_record(dir) + .is_some_and(|r| r.error.is_none() && super::updates::is_newer(current, &r.to)); + if failed { + log( + dir, + &format!( + "the installer (process {}) ended without finishing the update", + m.pid + ), + ); } } @@ -112,6 +216,9 @@ pub struct LastInstall { pub message: String, /// Not shown before: the renderer says so once. pub new: bool, + /// The installer is still working: nothing is judged yet, and the renderer waits for it + /// (`update_wait_for_install`) instead of saying anything. + pub pending: bool, } /// Judge `record` against the version running now. Ok when the install's version (or a newer @@ -127,7 +234,41 @@ pub fn judge(record: &InstallRecord, current: &str, log_tail: Option) -> record.error.clone().or(log_tail).unwrap_or_default() }, new: !record.reported, + pending: false, + } +} + +/// `settle`, unless an installer is still at work (a live marker) and this is not yet the +/// version it installs: then nothing is judged, cleaned or marked as reported, and the answer +/// only says an install is pending. A stale marker is cleared first (`clear_stale_marker`), +/// then the install is judged as usual. Already running the new version while the installer +/// tidies up (or the Windows setup, which starts the app before it ends) is a success now. +pub fn settle_unless_installing( + dir: &Path, + current: &str, + now: u64, + alive: &dyn Fn(u32) -> bool, +) -> Option { + match marker_state_in(dir, now, alive) { + MarkerState::Live(_) => { + let record = read_record(dir); + let arrived = record + .as_ref() + .is_some_and(|r| !super::updates::is_newer(current, &r.to)); + if !arrived { + return Some(LastInstall { + version: record.map(|r| r.to).unwrap_or_default(), + installed: false, + message: String::new(), + new: false, + pending: true, + }); + } + } + MarkerState::Stale(m) => clear_stale_marker(dir, m, current), + MarkerState::None => {} } + settle(dir, current) } /// What the last install came to, once per launch, and the clean-up that goes with it: after a @@ -175,7 +316,7 @@ pub fn clean_dir(dir: &Path, keep: Option<&Path>, current: Option<&str>) { for e in entries.flatten() { let path = e.path(); let name = e.file_name(); - if name == RECORD || name == LOG || Some(path.as_path()) == keep { + if name == RECORD || name == LOG || name == MARKER || Some(path.as_path()) == keep { continue; } let pending = current.is_some_and(|cur| { @@ -285,7 +426,12 @@ pub async fn update_last_install(app: AppHandle) -> Result, off_main_thread(move || { let dir = updates_dir(&app)?; super::self_install::clean_leftovers(); - Ok(settle(&dir, ¤t)) + Ok(settle_unless_installing( + &dir, + ¤t, + now_secs(), + &super::self_install::pid_alive, + )) }) .await } @@ -533,4 +679,203 @@ mod tests { ); let _ = std::fs::remove_dir_all(&dir); } + + #[test] + fn a_marker_is_a_pid_and_a_start_time_and_nothing_else() { + let m = Marker { + pid: 4242, + started: 1_800_000_000, + }; + assert_eq!(parse_marker(&marker_line(m)), Some(m)); + // What the scripts write: `echo "$$ $(date +%s)"`. + assert_eq!(parse_marker("4242 1800000000\n"), Some(m)); + for bad in [ + "", + "4242", + "0 1800000000", + "-1 1800000000", + "abc 1800000000", + "4242 soon", + "4242 1800000000 extra", + ] { + assert_eq!(parse_marker(bad), None, "{bad:?}"); + } + } + + #[test] + fn a_marker_is_live_only_while_its_installer_runs_and_it_is_recent() { + let m = Marker { + pid: 7, + started: 1_000, + }; + assert_eq!(marker_state(None, 1_000, true), MarkerState::None); + assert_eq!(marker_state(Some(m), 1_030, true), MarkerState::Live(m)); + // The installer is gone and left its marker. + assert_eq!(marker_state(Some(m), 1_030, false), MarkerState::Stale(m)); + // Too old to believe: that PID is some other program by now. + assert_eq!( + marker_state(Some(m), 1_000 + MARKER_MAX_AGE_SECS, true), + MarkerState::Live(m) + ); + assert_eq!( + marker_state(Some(m), 1_001 + MARKER_MAX_AGE_SECS, true), + MarkerState::Stale(m) + ); + // The clock was set back: a start far in the future is not trusted either. + assert_eq!(marker_state(Some(m), 900, true), MarkerState::Live(m)); + let future = Marker { + pid: 7, + started: 1_000 + 2 * MARKER_MAX_AGE_SECS, + }; + assert_eq!( + marker_state(Some(future), 1_000, true), + MarkerState::Stale(future) + ); + } + + /// The app opened again while the install from the last quit still works: nothing is + /// judged, reported or cleaned, however often it is asked; once the installer is done the + /// install is judged as usual. + #[test] + fn a_launch_during_an_install_waits_instead_of_reporting_a_failure() { + let dir = tmp("pending"); + let r = record(&dir, "10.5.1"); + std::fs::write(&r.file, b"zip").unwrap(); + write_record(&dir, &r).unwrap(); + log( + &dir, + "installing 10.5.1 over 10.4.1 from PS5Upload-10.5.1-win-x64.zip", + ); + let now = now_secs(); + write_marker( + &dir, + Marker { + pid: 4242, + started: now, + }, + ); + for _ in 0..2 { + let pending = + settle_unless_installing(&dir, "10.4.1", now, &|pid| pid == 4242).unwrap(); + assert!(pending.pending && !pending.installed && !pending.new); + assert_eq!(pending.version, "10.5.1"); + assert_eq!(pending.message, ""); + } + assert!(!read_record(&dir).unwrap().reported, "nothing was reported"); + assert!(r.file.is_file() && marker_path(&dir).is_file()); + // The installer finished and removed its marker; the new version runs. + remove_marker(&dir); + let done = settle_unless_installing(&dir, "10.5.1", now, &|_| false).unwrap(); + assert!(done.installed && !done.pending); + assert_eq!(read_record(&dir), None); + let _ = std::fs::remove_dir_all(&dir); + } + + #[test] + fn an_install_that_really_failed_is_still_reported_with_its_reason() { + let dir = tmp("pending-failed"); + let r = record(&dir, "10.5.1"); + std::fs::write(&r.file, b"zip").unwrap(); + write_record(&dir, &r).unwrap(); + let now = now_secs(); + write_marker( + &dir, + Marker { + pid: 4242, + started: now, + }, + ); + assert!( + settle_unless_installing(&dir, "10.4.1", now, &|_| true) + .unwrap() + .pending + ); + // The script gave its reason and ended (marker removed). + log(&dir, "could not move /Applications/PS5Upload.app aside"); + remove_marker(&dir); + let failed = settle_unless_installing(&dir, "10.4.1", now, &|_| false).unwrap(); + assert!(!failed.installed && !failed.pending && failed.new); + assert_eq!( + failed.message, + "could not move /Applications/PS5Upload.app aside" + ); + let _ = std::fs::remove_dir_all(&dir); + } + + #[test] + fn a_stale_marker_is_cleared_and_says_what_happened() { + let dir = tmp("stale"); + let r = record(&dir, "10.5.1"); + std::fs::write(&r.file, b"zip").unwrap(); + write_record(&dir, &r).unwrap(); + log(&dir, "installing 10.5.1 over 10.4.1"); + let now = now_secs(); + write_marker( + &dir, + Marker { + pid: 4242, + started: now, + }, + ); + // The installer's process is gone (killed, or the computer restarted) mid-way. + let out = settle_unless_installing(&dir, "10.4.1", now, &|_| false).unwrap(); + assert!(!out.installed && !out.pending && out.new); + assert_eq!( + out.message, + "the installer (process 4242) ended without finishing the update" + ); + assert!(!marker_path(&dir).exists()); + let _ = std::fs::remove_dir_all(&dir); + } + + /// The Windows setup cannot remove its marker: its process ending with the new version + /// running is a plain success, and the log does not call it unfinished. The same while it + /// is still closing (it starts the app before it ends). + #[test] + fn the_new_version_running_is_a_success_whatever_the_marker_says() { + for alive in [false, true] { + let dir = tmp(if alive { + "arrived-live" + } else { + "arrived-stale" + }); + let r = record(&dir, "10.5.1"); + std::fs::write(&r.file, b"setup").unwrap(); + write_record(&dir, &r).unwrap(); + let now = now_secs(); + write_marker( + &dir, + Marker { + pid: 4242, + started: now, + }, + ); + let out = settle_unless_installing(&dir, "10.5.1", now, &|_| alive).unwrap(); + assert!(out.installed && !out.pending, "alive={alive}"); + let text = std::fs::read_to_string(log_path(&dir)).unwrap(); + assert!(!text.contains("without finishing"), "{text}"); + assert!(text.contains("the install of 10.5.1 worked"), "{text}"); + // A marker left behind (Windows) is cleared by the next launch, silently. + if alive { + assert!(marker_path(&dir).is_file()); + assert_eq!( + settle_unless_installing(&dir, "10.5.1", now, &|_| false), + None + ); + } + assert!(!marker_path(&dir).exists()); + let _ = std::fs::remove_dir_all(&dir); + } + } + + #[test] + fn cleaning_the_folder_keeps_a_running_installers_marker() { + let dir = tmp("clean-marker"); + write_marker(&dir, Marker { pid: 1, started: 1 }); + std::fs::write(dir.join("stray.tmp"), b"x").unwrap(); + clean_dir(&dir, None, Some("10.4.1")); + assert!(marker_path(&dir).is_file()); + assert!(!dir.join("stray.tmp").exists()); + let _ = std::fs::remove_dir_all(&dir); + } } diff --git a/client/src-tauri/src/lib.rs b/client/src-tauri/src/lib.rs index c5c56c2fe..1e21f9be7 100644 --- a/client/src-tauri/src/lib.rs +++ b/client/src-tauri/src/lib.rs @@ -166,6 +166,10 @@ pub fn run() { // for it before anything else, or its single-instance lock sends this launch away. #[cfg(not(any(target_os = "android", target_os = "ios")))] commands::self_install::wait_for_previous_instance(); + // The program file as it is now: an install still working from the last quit may replace + // it under this launch (`update_wait_for_install` then starts the new one). + #[cfg(not(any(target_os = "android", target_os = "ios")))] + commands::self_install::note_program(); let builder = tauri::Builder::default(); // Single-instance MUST run before any other setup (window creation, @@ -734,6 +738,7 @@ pub fn run() { commands::update_install_on_quit, commands::update_quit_for_manual_install, commands::update_last_install, + commands::update_wait_for_install, commands::update_forget_failure, commands::update_old_downloads, commands::update_remove_old_downloads, @@ -944,6 +949,57 @@ mod asset_scope_tests { let _ = std::fs::remove_dir_all(&scratch); let _ = std::fs::remove_dir_all(&other); } + + /// A game folder's cover in any letter case. Windows and macOS file systems ignore case, + /// so the app finds `sce_sys/icon0.png` in a dump that names it `SCE_SYS/ICON0.PNG`, and + /// Tauri checks the scope against the name as it is on disk. Still only that one file. + #[test] + fn a_cover_is_served_in_any_letter_case_and_nothing_else_is() { + let scope = scope(); + let root = + std::env::temp_dir().join(format!("ps5upload-scope-case-{}", std::process::id())); + let _ = std::fs::remove_dir_all(&root); + for (game, dir, icon) in [ + ("Upper", "SCE_SYS", "ICON0.PNG"), + ("Mixed", "Sce_Sys", "Icon0.png"), + ("LowerDir", "sce_sys", "ICON0.PNG"), + ("UpperDir", "SCE_SYS", "icon0.png"), + ] { + let sys = root.join(game).join(dir); + std::fs::create_dir_all(&sys).unwrap(); + let cover = sys.join(icon); + std::fs::write(&cover, b"png").unwrap(); + assert!(served(&scope, &cover), "{}", cover.display()); + // The path the app asks for is always lower case (`game_meta::inspect_folder`); + // it exists only where the file system ignores case, and there it is served too. + let asked = root.join(game).join("sce_sys").join("icon0.png"); + if asked.is_file() { + assert!(served(&scope, &asked), "{}", asked.display()); + } + // Its neighbours, in any case, are not. + for other in [ + "PARAM.SFO", + "param.json", + "ICON1.PNG", + "ICON0.PNG.BAK", + "PIC0.PNG", + ] { + let f = sys.join(other); + std::fs::write(&f, b"x").unwrap(); + assert!(!served(&scope, &f), "{}", f.display()); + } + } + // The same file name outside an sce_sys folder is not a cover. + let loose = root.join("Upper").join("ICON0.PNG"); + std::fs::write(&loose, b"x").unwrap(); + assert!(!served(&scope, &loose), "{}", loose.display()); + let near = root.join("Upper").join("XSCE_SYS"); + std::fs::create_dir_all(&near).unwrap(); + let near_icon = near.join("ICON0.PNG"); + std::fs::write(&near_icon, b"x").unwrap(); + assert!(!served(&scope, &near_icon), "{}", near_icon.display()); + let _ = std::fs::remove_dir_all(&root); + } } #[cfg(test)] diff --git a/client/src-tauri/tauri.conf.json b/client/src-tauri/tauri.conf.json index 0cd25b803..8ff8db38c 100644 --- a/client/src-tauri/tauri.conf.json +++ b/client/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "PS5Upload", - "version": "12.6.30", + "version": "12.6.31", "identifier": "com.phantomptr.ps5upload", "build": { "beforeDevCommand": "npm run dev:vite", @@ -35,7 +35,7 @@ "enable": true, "scope": [ "$TEMP/ps5upload-save-*/**", - "**/sce_sys/icon0.png" + "**/[sS][cC][eE]_[sS][yY][sS]/[iI][cC][oO][nN]0.[pP][nN][gG]" ] } } diff --git a/client/src/api/collection.ts b/client/src/api/collection.ts index 74597a8da..2cb228686 100644 --- a/client/src/api/collection.ts +++ b/client/src/api/collection.ts @@ -296,6 +296,9 @@ export interface OrganizeResult { dropped: string[]; kept_dirs: string[]; logs: string[]; + /** Folders whose items moved but whose undo log could not be saved afterwards ("folder: why"): + * Undo may not put everything back. Absent when every log was saved. */ + undo_incomplete?: string[]; } export interface OrganizeRun { diff --git a/client/src/api/meshDrive.test.ts b/client/src/api/meshDrive.test.ts new file mode 100644 index 000000000..722197a0d --- /dev/null +++ b/client/src/api/meshDrive.test.ts @@ -0,0 +1,32 @@ +import { afterEach, describe, expect, it, vi } from "vitest"; + +vi.mock("../state/engine", () => ({ getEngineUrl: () => "http://engine.test:19120" })); + +import { driveApi } from "./meshDrive"; + +const reply = (status: number, body: unknown) => new Response(JSON.stringify(body), { status }); + +afterEach(() => vi.unstubAllGlobals()); + +describe("leaving a drive, or deleting it", () => { + it("says when the console did not answer: done here, and there once it is back", async () => { + const f = vi.fn().mockResolvedValue(reply(200, { supported: true, ok: true, later: true, note: "x" })); + vi.stubGlobal("fetch", f); + expect(await driveApi.leave("10.0.0.2", "d1", "m1")).toEqual({ later: true }); + expect(f.mock.calls[0][0]).toBe("http://engine.test:19120/api/drive/leave"); + expect(JSON.parse(f.mock.calls[0][1].body)).toEqual({ addr: "10.0.0.2", drive: "d1", member: "m1" }); + vi.stubGlobal("fetch", vi.fn().mockResolvedValue(reply(200, { supported: true, ok: true, later: true }))); + expect(await driveApi.remove("10.0.0.2", "d1")).toEqual({ later: true }); + }); + + it("is plainly done when the console answered, or by an older engine", async () => { + vi.stubGlobal("fetch", vi.fn().mockImplementation(async () => reply(200, { supported: true, ok: true }))); + expect(await driveApi.leave("10.0.0.2", "d1", "m1")).toEqual({ later: false }); + expect(await driveApi.remove("10.0.0.2", "d1")).toEqual({ later: false }); + }); + + it("still fails when it did not happen", async () => { + vi.stubGlobal("fetch", vi.fn().mockResolvedValue(reply(502, { error: "10.0.0.2 does not answer" }))); + await expect(driveApi.remove("10.0.0.2", "d1")).rejects.toThrow("does not answer"); + }); +}); diff --git a/client/src/api/meshDrive.ts b/client/src/api/meshDrive.ts index 024f9f49b..e9627fcaa 100644 --- a/client/src/api/meshDrive.ts +++ b/client/src/api/meshDrive.ts @@ -226,8 +226,17 @@ export const driveApi = { const b = await call("/api/drive/password")(host, { drive, password, current: current || undefined }); return { pending: Array.isArray(b.pending) ? (b.pending as string[]) : [] }; }, - leave: (host: string, drive: string, member: string) => call("/api/drive/leave")(host, { drive, member }), - remove: (host: string, drive: string) => call("/api/drive/delete")(host, { drive }), + /** `later`: the console did not answer. This device's folder stopped syncing anyway; the + * console is told once it answers (an older engine failed instead). */ + leave: async (host: string, drive: string, member: string) => { + const b = await call("/api/drive/leave")(host, { drive, member }); + return { later: b.later === true }; + }, + /** `later` as for `leave`: the console deletes the drive once it answers. */ + remove: async (host: string, drive: string) => { + const b = await call("/api/drive/delete")(host, { drive }); + return { later: b.later === true }; + }, pause: (host: string, drive: string, member: string, paused: boolean) => call("/api/drive/pause")(host, { drive, member, paused }), sync: (host: string, drive: string) => call("/api/drive/sync")(host, { drive }), diff --git a/client/src/api/pkgName.ts b/client/src/api/pkgName.ts index c56812961..0f0b0609e 100644 --- a/client/src/api/pkgName.ts +++ b/client/src/api/pkgName.ts @@ -25,6 +25,10 @@ export interface PkgNames { refusal?: PkgNameRefusal | null; /** The longest name accepted, in UTF-8 bytes. */ max_bytes: number; + /** How long a name this package has room for, in UTF-8 bytes (a rename moves nothing in the + * package, so the room is its own): for the default name alone, and for every language. + * Absent when the name can't be changed, and from an engine older than 12.6.32. */ + room?: { default_name: number; all_languages: number } | null; } export interface PkgRenamed { diff --git a/client/src/api/ps5.ts b/client/src/api/ps5.ts index f43b94435..4f8a15c49 100644 --- a/client/src/api/ps5.ts +++ b/client/src/api/ps5.ts @@ -1247,9 +1247,9 @@ export interface Volume { fs_type: string; total_bytes: number; free_bytes: number; - /** Space deliberately excluded from large-upload capacity (the internal - * PS5 allocator hides a fixed reserve from statfs; external filesystems keep - * a smaller metadata/activity margin). Present on current payloads. */ + /** A small working margin left out of what an upload may take (room for metadata and for + * other activity on the drive; at most 1 GiB). It is not what the PS5 holds back on internal + * storage: that is already out of `free_bytes`, and its growth is in `likely_fits_bytes`. */ safety_reserve_bytes?: number; /** Bytes a new upload may safely allocate after the reserve above. */ allocatable_bytes?: number; @@ -2203,10 +2203,14 @@ export async function fetchHwPower(transferAddr: string): Promise { return invoke("ps5_hw_power", { addr }); } -/** "Console Storage" aggregate matching what PS5 Settings shows - * (added in 2.2.26). Sums `/user effective + /system_data + /system_ex` - * with reserved-space accounting. Distinct from `fsListVolumes` — - * that returns per-volume detail; this is the single-line summary. */ +/** The internal drive as its filesystem counts it (`statfs` on `/user`, `/system_data` and + * `/system_ex`; added in 2.2.26). NOT the PS5's Settings > Storage figures: that screen can + * show a smaller drive and much less free space (#944: 175 GB here, 71 GB there, on one 2 TB + * console), by a rule not known here. `user_free_bytes` is `/user`'s free space for a writer, with + * `user_reserved_bytes` (what the filesystem holds back) already left out: never subtract it + * again. `total/free/used_bytes` are the three partitions together, so `free_bytes` counts + * system-partition space nothing can be copied into. Distinct from `fetchVolumes`, which + * returns per-volume detail. */ export interface HwStorage { total_bytes: number; free_bytes: number; @@ -5763,6 +5767,9 @@ export interface LastInstall { message: string; /** Not reported before: say so once. */ new: boolean; + /** The installer is still working (the app was opened again while an install from the last + * quit runs): nothing is judged yet. Wait for it with `updateWaitForInstall`. */ + pending?: boolean; } /** The last install's outcome (null when there was none). Also deletes what a finished @@ -5771,6 +5778,14 @@ export async function updateLastInstall(): Promise { return invoke("update_last_install"); } +/** An install is still working (`LastInstall.pending`): wait for it, at most a few minutes. + * "relaunch": the app quits now and starts again as the new version. "report": it ended and + * this copy is unchanged; `updateLastInstall` now says what happened. "keep-running": it is + * still working; carry on and say nothing. */ +export async function updateWaitForInstall(): Promise<"relaunch" | "report" | "keep-running"> { + return invoke<"relaunch" | "report" | "keep-running">("update_wait_for_install"); +} + /** Forget a failed install so that version may be installed by itself again ("Try again"). */ export async function updateForgetFailure(): Promise { return invoke("update_forget_failure"); diff --git a/client/src/components/PackagePanel.tsx b/client/src/components/PackagePanel.tsx index 1b3a4aea9..d454dff1c 100644 --- a/client/src/components/PackagePanel.tsx +++ b/client/src/components/PackagePanel.tsx @@ -24,7 +24,7 @@ import { useTitleInfo } from "../lib/useTitleInfo"; import { firmwareCheck, installedFromPreflight, - largestFreeBytes, + largestRoom, platformFirmwareCheck, spaceCheck, type Verdict, @@ -177,7 +177,9 @@ export function PackagePanelView({ text: checks.space.verdict === "bad" ? tr("viewer_space_bad", { short }, `${short} short on the target drive`) - : tr("viewer_space_ok", undefined, "Fits on the target drive"), + : checks.space.verdict === "warn" + ? tr("fs_move_tight", undefined, "It may not fit: the PS5 holds back more space as it writes.") + : tr("viewer_space_ok", undefined, "Fits on the target drive"), }); } @@ -389,7 +391,7 @@ export function PackagePanel({ const [backdrop, setBackdrop] = useState(null); const [tab, setTab] = useState("overview"); const [installed, setInstalled] = useState(null); - const [free, setFree] = useState(null); + const [free, setFree] = useState<{ room: number; likely: number } | null>(null); // Bumped per load: a reply for an earlier path or console is ignored. const request = useRef(0); const kernel = useConnectionStore((s) => @@ -436,7 +438,7 @@ export function PackagePanel({ .catch(() => {}); } void listVolumes(transferAddr(host)) - .then((vols) => current() && setFree(largestFreeBytes(vols))) + .then((vols) => current() && setFree(largestRoom(vols))) .catch(() => {}); } }) @@ -474,7 +476,7 @@ export function PackagePanel({ parsePS5Firmware(kernel), ), installed, - space: data && host ? spaceCheck(data.inspection.source.size, free) : null, + space: data && host ? spaceCheck(data.inspection.source.size, free?.room ?? null, free?.likely ?? null) : null, }), [data, kernel, installed, free, host], ); diff --git a/client/src/console/files/Files.tsx b/client/src/console/files/Files.tsx index 31d5b20c3..a2f946c88 100644 --- a/client/src/console/files/Files.tsx +++ b/client/src/console/files/Files.tsx @@ -1416,7 +1416,13 @@ export function Files({ ctx }: { ctx: SectionContext }) { }, [revealed]); /** "Show more" had focus when it read the next page: the row count before it. */ const afterMore = useRef(null); - const { refresh } = dir; + // The folder again, and the drives with it: what was just deleted or copied changed the + // free space under the list, which was read when Files opened (#944). + const listAgain = dir.refresh; + const refresh = useCallback(() => { + listAgain(); + setVolumesTick((n) => n + 1); + }, [listAgain]); // Inside a folder, the browser's Back (○) goes up one level. useBackLevel(path != null); diff --git a/client/src/console/locales/ar.json b/client/src/console/locales/ar.json index 1dc3253b9..a7d3da0fd 100644 --- a/client/src/console/locales/ar.json +++ b/client/src/console/locales/ar.json @@ -33,7 +33,7 @@ "cw_cheats_find_more": "البحث عن مزيد من الشفرات", "cw_cheats_find_no_match": "لا شيء للإصدار {v} بعد. هذه لإصدارات أخرى: عادةً لا تفعل شيئًا وقد تتسبب في تعطل اللعبة.", "cw_cheats_find_none": "لم ينشر أحد شفرات لهذه اللعبة بعد.", - "cw_cheats_find_offline": "لا يستطيع جهاز PS5 هذا الوصول إلى GitHub. احصل على الشفرات من تطبيق PS5Upload على حاسوبك، أو اسمح بـ raw.githubusercontent.com في إعدادات DNS.", + "cw_cheats_find_offline": "لا يستطيع جهاز PS5 هذا الوصول إلى GitHub. احصل على الشفرات من تطبيق PS5Upload على حاسوبك، أو اسمح بـ ⁦raw.githubusercontent.com⁩ في إعدادات DNS.", "cw_cheats_find_partial": "تعذّر الوصول إلى بعض مصادر الشفرات، لذا قد تكون القائمة ناقصة.", "cw_cheats_find_replaced": "تم استبدال {name} على الجهاز. شفراته موجودة الآن في القائمة.", "cw_cheats_find_retry": "إعادة المحاولة", @@ -67,7 +67,7 @@ "cw_cleanup_cat_b": "تحديثات ألعاب محذوفة", "cw_cleanup_cat_b_hint": "حُذفت اللعبة لكن بقي تحديثها على القرص.", "cw_cleanup_cat_c": "ملفات حزم متروكة", - "cw_cleanup_cat_c_hint": "ملفات .pkg وُجدت على الأقراص خارج مكتبة الحزم لديك. تُحدَّد عندما يكون الإصدار نفسه أو أحدث مثبّتًا.", + "cw_cleanup_cat_c_hint": "ملفات ⁦.pkg⁩ وُجدت على الأقراص خارج مكتبة الحزم لديك. تُحدَّد عندما يكون الإصدار نفسه أو أحدث مثبّتًا.", "cw_cleanup_cat_d": "ملفات ps5upload المؤقتة", "cw_cleanup_cat_d_hint": "ملفات تركها ps5upload أثناء التثبيت أو الاختبار. يمكنه إنشاؤها من جديد.", "cw_cleanup_cat_e": "تنزيلات وحدة التحكم لألعاب محذوفة", @@ -160,51 +160,51 @@ "cw_cleanup_waiting_sony": "بانتظار أن ينهي PS5 حذف التحديث…", "cw_convert_ampr_no": "لا", "cw_convert_ampr_yes": "نعم (حزم أصول {kind})", - "cw_convert_archive_note": "تُقرأ اللعبة مباشرة من الأرشيف دون فك ضغط أي شيء أولًا. يعمل فك الضغط على أحد معالجات PS5، لذا يكون هذا أبطأ من تحويل مجلد، وخاصة من ملف .7z.", + "cw_convert_archive_note": "تُقرأ اللعبة مباشرة من الأرشيف دون فك ضغط أي شيء أولًا. يعمل فك الضغط على أحد معالجات PS5، لذا يكون هذا أبطأ من تحويل مجلد، وخاصة من ملف ⁦.7z⁩.", "cw_convert_dest": "الحفظ باسم", "cw_convert_dest_change": "تغيير المجلد…", "cw_convert_dest_pick": "مكان الحفظ", "cw_convert_done": "تم: {path}", "cw_convert_err_archive_needs_unpack": "يجب فك ضغط اللعبة أولًا: الأرشيف يحتوي على صورة أو حزمة، أو أن حزم zstd داخل مجلد ستقرأ اللعبة مرتين. فك ضغط الأرشيف في الملفات، ثم حوّل ما يحتويه.", - "cw_convert_err_archive_no_game": "لا توجد لعبة واحدة في هذا الأرشيف: يجب أن يحتوي على مجلد واحد فقط فيه sce_sys/param.json.", + "cw_convert_err_archive_no_game": "لا توجد لعبة واحدة في هذا الأرشيف: يجب أن يحتوي على مجلد واحد فقط فيه ⁦sce_sys/param.json⁩.", "cw_convert_err_archive_password": "هذا الأرشيف محمي بكلمة مرور، ولا تستطيع أداة التحويل فتحه. فك ضغطه في الملفات أولًا.", "cw_convert_err_bad_dest": "لا يمكن الحفظ هناك: اختر مجلدًا ليس داخل اللعبة، وأبقِ امتداد الاسم المناسب للصيغة.", "cw_convert_err_bad_request": "لم يقبل المساعد هذا الطلب. حدّث PS5Upload وأرسل المساعد مجددًا.", - "cw_convert_err_build_failed": "توقفت أداة التحويل بخطأ. سجلها هو /data/ps5upload/convert/convert.log.", + "cw_convert_err_build_failed": "توقفت أداة التحويل بخطأ. سجلها هو ⁦/data/ps5upload/convert/convert.log⁩.", "cw_convert_err_busy": "هناك تحويل آخر أو تثبيت حزمة أو استخراج قيد التشغيل. حاول مرة أخرى عند انتهائه.", "cw_convert_err_dest_read_only": "هذا القرص للقراءة فقط، فلا يمكن حفظ أي شيء عليه. اختر قرصًا آخر.", "cw_convert_err_died": "توقفت أداة التحويل قبل أن تنتهي.", "cw_convert_err_drive_gone": "أُزيل القرص أثناء التحويل. أعد توصيله وابدأ من جديد.", - "cw_convert_err_failed": "فشلت أداة التحويل. سجلها هو /data/ps5upload/convert/convert.log.", + "cw_convert_err_failed": "فشلت أداة التحويل. سجلها هو ⁦/data/ps5upload/convert/convert.log⁩.", "cw_convert_err_loader": "لم يستجب محمّل ELF (المنفذ 9021)، لذا تعذّر تشغيل أداة التحويل. حمّل elfldr مجددًا.", "cw_convert_err_no_memory": "نفدت ذاكرة PS5 اللازمة لأداة التحويل. أغلق اللعبة وحاول مرة أخرى.", "cw_convert_err_no_space": "لا توجد مساحة حرة كافية هناك.", "cw_convert_err_not_built_yet": "التحويل على PS5 لم يكتمل بعد: هذا الإصدار يقرأ اللعبة فقط من أولها إلى آخرها.", "cw_convert_err_not_bundled": "بُني هذا المساعد دون أداة التحويل. حدّث PS5Upload وأرسل المساعد مجددًا.", - "cw_convert_err_not_packable": "لا يمكن وضع هذه اللعبة في حزم zstd: فهي لعبة PS4 أو ليس فيها eboot.bin. أوقف حزم أصول zstd.", + "cw_convert_err_not_packable": "لا يمكن وضع هذه اللعبة في حزم zstd: فهي لعبة PS4 أو ليس فيها ⁦eboot.bin⁩. أوقف حزم أصول zstd.", "cw_convert_err_not_packed": "هذه اللعبة ليست في حزم أصول، فلا يوجد ما يُفك. عطّل «فك حزم الأصول».", "cw_convert_err_not_started": "لم تبدأ أداة التحويل. حاول مرة أخرى.", "cw_convert_err_partial_in_the_way": "يوجد مجلد باسم الناتج وفي آخره ‎.partial‎، ولم يتركه PS5Upload. انقله أو غيّر اسمه ثم ابدأ من جديد.", - "cw_convert_err_rar": "لا يمكن تحويل ملف .rar على PS5: ترخيص مفكك RAR لا يسمح باستخدامه داخل أداة التحويل. فك ضغطه في الملفات أولًا، أو حوّله على حاسوبك.", + "cw_convert_err_rar": "لا يمكن تحويل ملف ⁦.rar⁩ على PS5: ترخيص مفكك RAR لا يسمح باستخدامه داخل أداة التحويل. فك ضغطه في الملفات أولًا، أو حوّله على حاسوبك.", "cw_convert_err_too_big_for_drive": "ستكون الصورة أكبر من 4 GiB، وهو أقصى حجم لملف واحد على ذلك القرص. احفظها على قرص exFAT أو على وحدة التخزين الداخلية، أو أنشئ مجلدًا بدلًا منها.", "cw_convert_err_unreadable": "تعذّرت قراءة جزء من اللعبة. افحص القرص وحاول مرة أخرى.", - "cw_convert_err_unsupported_source": "هذا ليس مجلد لعبة، ولا صورة لعبة (.exfat و.ffpkg و.ffpfs و.ffpfsc)، ولا أرشيف .zip أو .7z.", + "cw_convert_err_unsupported_source": "هذا ليس مجلد لعبة، ولا صورة لعبة (⁦.exfat⁩ و.ffpkg و.ffpfs و.ffpfsc)، ولا أرشيف ⁦.zip⁩ أو ⁦.7z⁩.", "cw_convert_exists": "{name} موجود هناك بالفعل. اختر مجلدًا آخر، أو احتفظ بالاثنين.", "cw_convert_failed": "تعذّر التحويل: {reason}", - "cw_convert_ffpfsc_inner": "الصورة داخل .ffpfsc", + "cw_convert_ffpfsc_inner": "الصورة داخل ⁦.ffpfsc⁩", "cw_convert_ffpfsc_level": "الضغط", "cw_convert_ffpfsc_level_balanced": "متوازن (افتراضي)", "cw_convert_ffpfsc_level_fast": "سريع", "cw_convert_ffpfsc_level_smallest": "الأصغر (بطيء)", "cw_convert_ffpfsc_note": "تُضغط الصورة أثناء كتابتها، على 3 من معالجات PS5. التقدير للعبة بحجم 30 GB: سريع نحو 3-4 دقائق، متوازن نحو 3-6 دقائق، الأصغر نحو 20-40 دقيقة، ثم التحقق. معظم الألعاب لا تصغر إلا قليلًا: كثير من بياناتها مضغوط أصلًا.", - "cw_convert_format_7z": "أرشيف .7z", - "cw_convert_format_exfat": "صورة .exfat", - "cw_convert_format_ffpfs": "صورة .ffpfs", - "cw_convert_format_ffpfsc": ".ffpfsc (صورة مضغوطة)", - "cw_convert_format_ffpkg": "صورة .ffpkg", + "cw_convert_format_7z": "أرشيف ⁦.7z⁩", + "cw_convert_format_exfat": "صورة ⁦.exfat⁩", + "cw_convert_format_ffpfs": "صورة ⁦.ffpfs⁩", + "cw_convert_format_ffpfsc": "⁦.ffpfsc⁩ (صورة مضغوطة)", + "cw_convert_format_ffpkg": "صورة ⁦.ffpkg⁩", "cw_convert_format_folder": "مجلد", - "cw_convert_format_pkg": ".pkg (حزمة تصحيح)", - "cw_convert_format_zip": "أرشيف .zip", + "cw_convert_format_pkg": "⁦.pkg⁩ (حزمة تصحيح)", + "cw_convert_format_zip": "أرشيف ⁦.zip⁩", "cw_convert_info_ampr": "تقرأ ملفاتها عبر AMPR", "cw_convert_info_format": "الصيغة", "cw_convert_info_size": "الحجم", @@ -214,14 +214,14 @@ "cw_convert_inspect_failed": "تعذّرت قراءة هذه اللعبة: {reason}", "cw_convert_intro": "حوّل مجلد لعبة أو صورة على هذا الـ PS5 إلى صيغة أخرى، تُكتب على PS5 نفسه. لا حاجة إلى حاسوب.", "cw_convert_leave_out_emu": "استبعاد محاكي AMPR", - "cw_convert_leave_out_emu_note": "عندها لا تحتوي الحزمة على fakelib/libSceAmpr.sprx، وتقرأ اللعبة ملفاتها عبر مكتبة النظام الخاصة بجهاز PS5. جُرّب هذا مع لعبة واحدة فقط على البرنامج الثابت 5.10. إذا لم تبدأ اللعبة، فأنشئ الحزمة من جديد مع إيقاف هذا الخيار.", + "cw_convert_leave_out_emu_note": "عندها لا تحتوي الحزمة على ⁦fakelib/libSceAmpr.sprx⁩، وتقرأ اللعبة ملفاتها عبر مكتبة النظام الخاصة بجهاز PS5. جُرّب هذا مع لعبة واحدة فقط على البرنامج الثابت 5.10. إذا لم تبدأ اللعبة، فأنشئ الحزمة من جديد مع إيقاف هذا الخيار.", "cw_convert_level_default": "5 (افتراضي)", "cw_convert_level_fast": "1 (الأسرع)", "cw_convert_level_small": "19 (الأصغر، بطيء)", "cw_convert_lost": "انتهى التحويل حين لم تكن هذه الصفحة تتابعه. ابحث عنه في الملفات.", - "cw_convert_no_eboot": "لا يوجد فيها eboot.bin، لذا قد لا تكون لعبة.", + "cw_convert_no_eboot": "لا يوجد فيها ⁦eboot.bin⁩، لذا قد لا تكون لعبة.", "cw_convert_output": "التحويل إلى", - "cw_convert_pick_hint_archives": "افتح مجلد لعبة واضغط «هنا»، أو اختر صورة (.exfat و.ffpkg و.ffpfs و.ffpfsc) أو أرشيفًا (.zip و.7z).", + "cw_convert_pick_hint_archives": "افتح مجلد لعبة واضغط «هنا»، أو اختر صورة (⁦.exfat⁩ و.ffpkg و.ffpfs و.ffpfsc) أو أرشيفًا (⁦.zip⁩ و.7z).", "cw_convert_pick_source": "اختر لعبة…", "cw_convert_pick_title": "اختر لعبة", "cw_convert_pkg_level": "ضغط الحزمة", @@ -253,7 +253,7 @@ "cw_convert_zstd": "حزم أصول zstd", "cw_convert_zstd_level": "مستوى الضغط", "cw_convert_zstd_no_runtime": "حزم zstd تحتاج إلى بيئة التشغيل: افتح PS5Upload على حاسوبك مرة واحدة بينما جهاز PS5 هذا متصل.", - "cw_convert_zstd_note": "يحزم ملفات اللعبة في حزم zstd تقرؤها عبر AMPR: أصغر، وتحتاج اللعبة إلى ampr-emu-ng لتبدأ.", + "cw_convert_zstd_note": "يحزم ملفات اللعبة في حزم zstd تقرؤها عبر AMPR: أصغر، وتحتاج اللعبة إلى ⁦ampr-emu-ng⁩ لتبدأ.", "cw_ctl_gamepad": "تم التعرف على الذراع كذراع ألعاب: {id}", "cw_ctl_last": "آخر زر مضغوط:", "cw_ctl_logging": "ما دامت هذه الشاشة مفتوحة، تُحفظ ضغطات الأزرار في سجل صغير على هذا الجهاز لتحسين دعم وحدة التحكم.", @@ -344,7 +344,7 @@ "cw_files_br_start": "البدء من", "cw_files_br_stopped": "توقف. أُعيدت تسمية {done}؛ ولم تُعَد تسمية {rest}.", "cw_files_br_suffix": "نص يضاف في النهاية", - "cw_files_br_suffix_hint": "يُضاف قبل الامتداد (.png، .exfat، …).", + "cw_files_br_suffix_hint": "يُضاف قبل الامتداد (⁦.png⁩، ⁦.exfat⁩، …).", "cw_files_br_template": "الاسم الجديد", "cw_files_br_template_hint": "يُستبدل {n} بالرقم. اتركه فارغًا للإبقاء على كل اسم وإضافة الرقم. يبقى الامتداد كما هو.", "cw_files_br_title": "إعادة تسمية {n} عناصر", @@ -391,7 +391,7 @@ "cw_files_edit_keep": "متابعة التعديل", "cw_files_edit_label": "نص الملف", "cw_files_edit_no_space": "القرص ممتلئ.", - "cw_files_edit_not_text": "هذا الملف ليس نصًا بترميز UTF-8، لذا لا يمكن تعديله هنا.", + "cw_files_edit_not_text": "هذا الملف ليس نصًا بترميز ⁦UTF-8⁩، لذا لا يمكن تعديله هنا.", "cw_files_edit_save": "حفظ", "cw_files_edit_save_anyway": "احفظ على أي حال", "cw_files_edit_saved": "تم الحفظ.", @@ -567,7 +567,7 @@ "cw_files_search_found": "عُثر على {n}.", "cw_files_search_go": "بحث", "cw_files_search_here": "هذا المجلد", - "cw_files_search_hint": "يبحث عن الملفات بالاسم. تطابق الكلمة أي جزء من الاسم؛ استخدم * و ? للنمط (*.pkg).", + "cw_files_search_hint": "يبحث عن الملفات بالاسم. تطابق الكلمة أي جزء من الاسم؛ استخدم * و ? للنمط (⁦*.pkg⁩).", "cw_files_search_more": "تُعرض أول {n} نتيجة. هناك المزيد: جرّب اسمًا أطول.", "cw_files_search_no_index": "لا يوجد فهرس بعد. أول بحث ينشئ فهرسًا: يقرأ كل مجلد وقد يستغرق بضع دقائق.", "cw_files_search_none": "لا شيء يطابق «{q}».", @@ -617,7 +617,7 @@ "cw_files_smb_err_full": "توجد مشاركات شبكة محفوظة كثيرة جدًا. أزل واحدة أولًا.", "cw_files_smb_err_generic": "حدث خطأ ما في مشاركة الشبكة.", "cw_files_smb_err_loader": "تحتاج مشاركات الشبكة إلى محمّل ELF على المنفذ 9021، وهو لا يعمل.", - "cw_files_smb_err_no_share": "لا توجد مشاركة بهذا الاسم على الخادم. المشاركة هي اسم المجلد الأول فقط (مثل Media في \\\\nas\\Media\\Games)؛ والمجلدات داخلها تُكتب في «المجلد الذي يُفتح».", + "cw_files_smb_err_no_share": "لا توجد مشاركة بهذا الاسم على الخادم. المشاركة هي اسم المجلد الأول فقط (مثل Media في ⁦\\\\nas\\Media\\Games⁩)؛ والمجلدات داخلها تُكتب في «المجلد الذي يُفتح».", "cw_files_smb_err_no_space": "لا توجد مساحة حرة كافية لهذا النسخ.", "cw_files_smb_err_not_supported": "لا يسمح الخادم بذلك على هذه المشاركة.", "cw_files_smb_err_timeout": "استغرق الخادم وقتًا طويلًا للرد.", @@ -673,7 +673,7 @@ "cw_files_unmount_title": "إلغاء تركيب {path}؟", "cw_files_unpack": "فك الضغط", "cw_files_unpack_batch": "جارٍ فك ضغط «{name}»…", - "cw_files_unpack_body": "يكتب «{name}» ({size}) بجانبه. يبقى ملف .ffpfsc.", + "cw_files_unpack_body": "يكتب «{name}» ({size}) بجانبه. يبقى ملف ⁦.ffpfsc⁩.", "cw_files_unpack_busy": "يجري فك ضغط آخر على الجهاز.", "cw_files_unpack_damaged": "الملف تالف.", "cw_files_unpack_done": "فُكّ الضغط: «{name}» بجانب «{source}».", @@ -688,7 +688,7 @@ "cw_files_unpack_needs": "يحتاج", "cw_files_unpack_no_space": "لا توجد مساحة كافية: يحتاج {need} (الصورة مع 1 GiB)، والمتاح {free}.", "cw_files_unpack_no_space_short": "لا توجد مساحة كافية على ذلك المحرك.", - "cw_files_unpack_not_container": "هذا ليس ملف .ffpfsc يستطيع الجهاز قراءته.", + "cw_files_unpack_not_container": "هذا ليس ملف ⁦.ffpfsc⁩ يستطيع الجهاز قراءته.", "cw_files_unpack_not_image": "الصورة الموجودة بداخله ليست صورة exFAT، لذا فهي غير مدعومة.", "cw_files_unpack_stopped": "أُوقف فك الضغط. لم يُحتفظ بشيء.", "cw_files_unpack_title": "فك ضغط «{name}»", @@ -767,7 +767,7 @@ "cw_games_confirm_uninstall_pkg": "يؤدي هذا إلى إزالة اللعبة من PS5. يمكنك تثبيتها مجددًا لاحقًا من حزمتها.", "cw_games_confirm_uninstall_registered": "يؤدي هذا إلى إزالة اللعبة من الشاشة الرئيسية. يبقى مجلدها أو صورة القرص في مكانه.", "cw_games_confirm_uninstall_title": "هل تريد إلغاء تثبيت {name}؟", - "cw_games_err_launch_refused": "رفض الجهاز تشغيلها. ألعاب homebrew وfake-package تحتاج إلى تشغيل kstuff؛ ولعبة صورة القرص تحتاج أيضًا إلى ShadowMount+.", + "cw_games_err_launch_refused": "رفض الجهاز تشغيلها. ألعاب homebrew و⁦fake-package⁩ تحتاج إلى تشغيل kstuff؛ ولعبة صورة القرص تحتاج أيضًا إلى ⁦ShadowMount+⁩.", "cw_games_err_load_next": "اضغط تحديث للمحاولة مرة أخرى.", "cw_games_err_other_running": "هناك لعبة أخرى قيد التشغيل. أغلقها أولًا.", "cw_games_err_running": "أغلق اللعبة قبل إلغاء تثبيتها.", @@ -876,7 +876,7 @@ "cw_home_usb_open": "فتح في الملفات", "cw_home_vol_ext": "تخزين موسّع", "cw_home_vol_internal": "التخزين الداخلي", - "cw_home_vol_m2": "تخزين M.2", + "cw_home_vol_m2": "تخزين ⁦M.2⁩", "cw_home_vol_readonly": "للقراءة فقط", "cw_home_vol_usb": "محرك USB", "cw_home_vol_usb_ext": "تخزين موسّع عبر USB", @@ -910,10 +910,10 @@ "cw_lib_copying": "جارٍ نسخ {name} إلى PS5… {pct}% من {size}", "cw_lib_err_exists": "{path} موجود بالفعل.", "cw_lib_fake": "حزمة fake", - "cw_lib_fmt_exfat": "صورة exFAT (.exfat)", - "cw_lib_fmt_ffpfs": "صورة PFS (.ffpfs)", - "cw_lib_fmt_ffpkg": "صورة (.ffpkg)", - "cw_lib_fmt_pkg": "حزمة (.pkg)", + "cw_lib_fmt_exfat": "صورة exFAT (⁦.exfat⁩)", + "cw_lib_fmt_ffpfs": "صورة PFS (⁦.ffpfs⁩)", + "cw_lib_fmt_ffpkg": "صورة (⁦.ffpkg⁩)", + "cw_lib_fmt_pkg": "حزمة (⁦.pkg⁩)", "cw_lib_fw_newer": "يحتاج إلى برنامج النظام {need}، وهذا الـ PS5 على {have}. قد لا يعمل ما لم يُنقل لإصدار أقدم (backport).", "cw_lib_info_formats": "محفوظ بصيغة", "cw_lib_info_fw": "يتطلب برنامج النظام", @@ -971,7 +971,7 @@ "cw_pkg_done_installed": "ثُبّتت «{name}».", "cw_pkg_err_busy": "هناك تثبيت آخر قيد التشغيل. انتظر حتى ينتهي.", "cw_pkg_err_daemon": "لم يبدأ المثبّت أو توقف عن الاستجابة. أعد المحاولة.", - "cw_pkg_err_image": "تعمل هذه اللعبة من صورة قرص (ShadowMount+). انقل الصورة أو احذفها قبل تثبيت حزمة لها.", + "cw_pkg_err_image": "تعمل هذه اللعبة من صورة قرص (⁦ShadowMount+⁩). انقل الصورة أو احذفها قبل تثبيت حزمة لها.", "cw_pkg_err_installed": "هذه اللعبة مثبّتة بالفعل.", "cw_pkg_err_loader": "لم يستجب محمّل الحمولات في الجهاز (المنفذ 9021). حمّل محمّل ELF من جديد، ثم أعد المحاولة.", "cw_pkg_err_no_space": "لا توجد مساحة حرة كافية في التخزين الداخلي لنسخ الحزمة.", @@ -979,7 +979,7 @@ "cw_pkg_err_refused": "رفض الجهاز الحزمة ({code}).", "cw_pkg_err_stage": "فشل نسخ الحزمة إلى التخزين الداخلي.", "cw_pkg_err_stalled": "توقف الجهاز عن قراءة الحزمة. تحقق من الشاشة الرئيسية: ربما فشل التثبيت.", - "cw_pkg_err_where": "تُثبَّت الحزم من التخزين الداخلي أو M.2 أو محركات USB فقط.", + "cw_pkg_err_where": "تُثبَّت الحزم من التخزين الداخلي أو ⁦M.2⁩ أو محركات USB فقط.", "cw_pkg_failed": "فشل التثبيت: {reason}", "cw_pkg_failed_generic": "ردّ الجهاز بـ «{cause}».", "cw_pkg_fake_note": "حزمة fake (بتوقيع تصحيح): لا تُثبَّت ولا تعمل إلا مع تحميل حمولات homebrew.", diff --git a/client/src/console/locales/fa.json b/client/src/console/locales/fa.json index ca1980cb3..cf0255d88 100644 --- a/client/src/console/locales/fa.json +++ b/client/src/console/locales/fa.json @@ -33,7 +33,7 @@ "cw_cheats_find_more": "یافتن چیت‌های بیشتر", "cw_cheats_find_no_match": "هنوز چیزی برای نسخه {v} نیست. این‌ها برای نسخه‌های دیگرند: معمولاً کاری نمی‌کنند و ممکن است بازی را از کار بیندازند.", "cw_cheats_find_none": "هنوز کسی برای این بازی چیتی منتشر نکرده است.", - "cw_cheats_find_offline": "این PS5 به GitHub دسترسی ندارد. چیت‌ها را از برنامه PS5Upload روی رایانه‌تان بگیرید، یا raw.githubusercontent.com را در تنظیمات DNS مجاز کنید.", + "cw_cheats_find_offline": "این PS5 به GitHub دسترسی ندارد. چیت‌ها را از برنامه PS5Upload روی رایانه‌تان بگیرید، یا ⁦raw.githubusercontent.com⁩ را در تنظیمات DNS مجاز کنید.", "cw_cheats_find_partial": "به برخی منابع چیت دسترسی نبود، پس ممکن است فهرست کامل نباشد.", "cw_cheats_find_replaced": "{name} روی کنسول جایگزین شد. چیت‌هایش اکنون در فهرست هستند.", "cw_cheats_find_retry": "تلاش دوباره", @@ -67,7 +67,7 @@ "cw_cleanup_cat_b": "به‌روزرسانی بازی‌های حذف‌شده", "cw_cleanup_cat_b_hint": "بازی حذف شده اما به‌روزرسانی‌اش روی درایو مانده است.", "cw_cleanup_cat_c": "فایل‌های بسته‌ی بازمانده", - "cw_cleanup_cat_c_hint": "فایل‌های .pkg که روی درایوها و بیرون از کتابخانه‌ی بسته‌ی شما پیدا شد. اگر همان نسخه یا نسخه‌ی جدیدتر نصب باشد انتخاب می‌شود.", + "cw_cleanup_cat_c_hint": "فایل‌های ⁦.pkg⁩ که روی درایوها و بیرون از کتابخانه‌ی بسته‌ی شما پیدا شد. اگر همان نسخه یا نسخه‌ی جدیدتر نصب باشد انتخاب می‌شود.", "cw_cleanup_cat_d": "فایل‌های موقت ps5upload", "cw_cleanup_cat_d_hint": "فایل‌هایی که ps5upload هنگام نصب یا آزمایش بر جا گذاشته است. می‌تواند دوباره بسازدشان.", "cw_cleanup_cat_e": "دانلودهای کنسول برای بازی‌های حذف‌شده", @@ -160,51 +160,51 @@ "cw_cleanup_waiting_sony": "در انتظار پایان حذف به‌روزرسانی توسط PS5…", "cw_convert_ampr_no": "خیر", "cw_convert_ampr_yes": "بله (بسته‌های دارایی {kind})", - "cw_convert_archive_note": "بازی مستقیماً از داخل آرشیو خوانده می‌شود و چیزی از قبل باز نمی‌شود. باز کردن فشرده‌سازی روی یکی از CPUهای PS5 اجرا می‌شود، پس این کار از تبدیل یک پوشه کندتر است، به‌ویژه برای .7z.", + "cw_convert_archive_note": "بازی مستقیماً از داخل آرشیو خوانده می‌شود و چیزی از قبل باز نمی‌شود. باز کردن فشرده‌سازی روی یکی از CPUهای PS5 اجرا می‌شود، پس این کار از تبدیل یک پوشه کندتر است، به‌ویژه برای ⁦.7z⁩.", "cw_convert_dest": "ذخیره به نام", "cw_convert_dest_change": "تغییر پوشه…", "cw_convert_dest_pick": "محل ذخیره", "cw_convert_done": "انجام شد: {path}", "cw_convert_err_archive_needs_unpack": "این بازی باید اول از آرشیو باز شود: آرشیو یک ایمیج یا بسته دارد، یا بسته‌های zstd در یک پوشه بازی را دو بار می‌خوانند. آرشیو را در فایل‌ها باز کنید، سپس محتوای آن را تبدیل کنید.", - "cw_convert_err_archive_no_game": "در این آرشیو دقیقاً یک بازی نیست: باید دقیقاً یک پوشه با sce_sys/param.json داشته باشد.", + "cw_convert_err_archive_no_game": "در این آرشیو دقیقاً یک بازی نیست: باید دقیقاً یک پوشه با ⁦sce_sys/param.json⁩ داشته باشد.", "cw_convert_err_archive_password": "این آرشیو رمز دارد و مبدل نمی‌تواند آن را باز کند. اول آن را در فایل‌ها باز کنید.", "cw_convert_err_bad_dest": "نمی‌توان آنجا ذخیره کرد: پوشه‌ای انتخاب کنید که داخل بازی نباشد، و پسوند نام را مطابق قالب نگه دارید.", "cw_convert_err_bad_request": "کمک‌یار این درخواست را نپذیرفت. PS5Upload را به‌روز کنید و کمک‌یار را دوباره بفرستید.", - "cw_convert_err_build_failed": "مبدل با خطا متوقف شد. گزارش آن /data/ps5upload/convert/convert.log است.", + "cw_convert_err_build_failed": "مبدل با خطا متوقف شد. گزارش آن ⁦/data/ps5upload/convert/convert.log⁩ است.", "cw_convert_err_busy": "تبدیل دیگری، نصب یک بسته یا یک استخراج در حال اجراست. وقتی تمام شد دوباره امتحان کنید.", "cw_convert_err_dest_read_only": "این درایو فقط‌خواندنی است، پس چیزی نمی‌توان آنجا ذخیره کرد. درایو دیگری انتخاب کنید.", "cw_convert_err_died": "مبدل پیش از پایان کار متوقف شد.", "cw_convert_err_drive_gone": "درایو در حین تبدیل جدا شد. دوباره وصلش کنید و از نو شروع کنید.", - "cw_convert_err_failed": "مبدل ناموفق بود. گزارش آن /data/ps5upload/convert/convert.log است.", + "cw_convert_err_failed": "مبدل ناموفق بود. گزارش آن ⁦/data/ps5upload/convert/convert.log⁩ است.", "cw_convert_err_loader": "بارگذار ELF (درگاه 9021) پاسخ نداد، پس مبدل اجرا نشد. elfldr را دوباره بارگذاری کنید.", "cw_convert_err_no_memory": "حافظهٔ PS5 برای مبدل تمام شد. بازی را ببندید و دوباره امتحان کنید.", "cw_convert_err_no_space": "فضای آزاد کافی آنجا نیست.", "cw_convert_err_not_built_yet": "تبدیل روی PS5 هنوز کامل نشده است: این نسخه فقط بازی را سراسر می‌خواند.", "cw_convert_err_not_bundled": "این کمک‌یار بدون مبدل ساخته شده است. PS5Upload را به‌روز کنید و کمک‌یار را دوباره بفرستید.", - "cw_convert_err_not_packable": "این بازی را نمی‌توان در بسته‌های zstd گذاشت: یک بازی PS4 است یا eboot.bin ندارد. بسته‌های دارایی zstd را خاموش کنید.", + "cw_convert_err_not_packable": "این بازی را نمی‌توان در بسته‌های zstd گذاشت: یک بازی PS4 است یا ⁦eboot.bin⁩ ندارد. بسته‌های دارایی zstd را خاموش کنید.", "cw_convert_err_not_packed": "این بازی در بسته‌های دارایی نیست، پس چیزی برای باز کردن وجود ندارد. «باز کردن بسته‌های دارایی» را خاموش کنید.", "cw_convert_err_not_started": "مبدل اجرا نشد. دوباره امتحان کنید.", "cw_convert_err_partial_in_the_way": "پوشه‌ای با نام خروجی و ‎.partial‎ در انتهای آن از قبل وجود دارد و PS5Upload آن را جا نگذاشته است. آن را جابه‌جا کنید یا نامش را تغییر دهید، سپس دوباره شروع کنید.", - "cw_convert_err_rar": "فایل .rar را نمی‌توان روی PS5 تبدیل کرد: مجوز رمزگشای RAR اجازهٔ استفاده از آن را در مبدل نمی‌دهد. اول آن را در فایل‌ها باز کنید، یا روی رایانهٔ خود تبدیل کنید.", + "cw_convert_err_rar": "فایل ⁦.rar⁩ را نمی‌توان روی PS5 تبدیل کرد: مجوز رمزگشای RAR اجازهٔ استفاده از آن را در مبدل نمی‌دهد. اول آن را در فایل‌ها باز کنید، یا روی رایانهٔ خود تبدیل کنید.", "cw_convert_err_too_big_for_drive": "ایمیج از 4 GiB، بیشترین اندازهٔ یک فایل روی آن درایو، بزرگ‌تر می‌شود. آن را روی یک درایو exFAT یا حافظهٔ داخلی ذخیره کنید، یا به جایش یک پوشه بسازید.", "cw_convert_err_unreadable": "بخشی از بازی خوانده نشد. درایو را بررسی کنید و دوباره امتحان کنید.", - "cw_convert_err_unsupported_source": "این نه پوشهٔ بازی است، نه ایمیج بازی (.exfat، .ffpkg، .ffpfs، .ffpfsc) و نه آرشیو .zip یا .7z.", + "cw_convert_err_unsupported_source": "این نه پوشهٔ بازی است، نه ایمیج بازی (⁦.exfat⁩، ⁦.ffpkg⁩، ⁦.ffpfs⁩، ⁦.ffpfsc⁩) و نه آرشیو ⁦.zip⁩ یا ⁦.7z⁩.", "cw_convert_exists": "{name} از قبل آنجا هست. پوشهٔ دیگری انتخاب کنید یا هر دو را نگه دارید.", "cw_convert_failed": "تبدیل ممکن نشد: {reason}", - "cw_convert_ffpfsc_inner": "ایمیج درون .ffpfsc", + "cw_convert_ffpfsc_inner": "ایمیج درون ⁦.ffpfsc⁩", "cw_convert_ffpfsc_level": "فشرده‌سازی", "cw_convert_ffpfsc_level_balanced": "متعادل (پیش‌فرض)", "cw_convert_ffpfsc_level_fast": "سریع", "cw_convert_ffpfsc_level_smallest": "کوچک‌ترین (کند)", "cw_convert_ffpfsc_note": "ایمیج هنگام نوشتن، روی 3 تا از CPUهای PS5 فشرده می‌شود. تخمین برای یک بازی 30 GB: سریع حدود 3-4 دقیقه، متعادل حدود 3-6 دقیقه، کوچک‌ترین حدود 20-40 دقیقه، و سپس بررسی. بیشتر بازی‌ها فقط کمی کوچک می‌شوند: بخش زیادی از داده‌هایشان از قبل فشرده است.", - "cw_convert_format_7z": "آرشیو .7z", - "cw_convert_format_exfat": "ایمیج .exfat", - "cw_convert_format_ffpfs": "ایمیج .ffpfs", - "cw_convert_format_ffpfsc": ".ffpfsc (ایمیج فشرده)", - "cw_convert_format_ffpkg": "ایمیج .ffpkg", + "cw_convert_format_7z": "آرشیو ⁦.7z⁩", + "cw_convert_format_exfat": "ایمیج ⁦.exfat⁩", + "cw_convert_format_ffpfs": "ایمیج ⁦.ffpfs⁩", + "cw_convert_format_ffpfsc": "⁦.ffpfsc⁩ (ایمیج فشرده)", + "cw_convert_format_ffpkg": "ایمیج ⁦.ffpkg⁩", "cw_convert_format_folder": "پوشه", - "cw_convert_format_pkg": ".pkg (بستهٔ دیباگ)", - "cw_convert_format_zip": "آرشیو .zip", + "cw_convert_format_pkg": "⁦.pkg⁩ (بستهٔ دیباگ)", + "cw_convert_format_zip": "آرشیو ⁦.zip⁩", "cw_convert_info_ampr": "فایل‌هایش را از راه AMPR می‌خواند", "cw_convert_info_format": "قالب", "cw_convert_info_size": "اندازه", @@ -214,14 +214,14 @@ "cw_convert_inspect_failed": "خواندن این بازی ممکن نشد: {reason}", "cw_convert_intro": "پوشهٔ بازی یا ایمیجی را که روی این PS5 است به قالب دیگری تبدیل کنید؛ روی خود PS5 نوشته می‌شود. رایانه لازم نیست.", "cw_convert_leave_out_emu": "کنار گذاشتن شبیه‌ساز AMPR", - "cw_convert_leave_out_emu_note": "در این صورت فایل ‎.pkg هیچ fakelib/libSceAmpr.sprx ندارد و بازی فایل‌هایش را با کتابخانهٔ سیستمی خود PS5 می‌خواند. این فقط با یک بازی، روی فریم‌ور 5.10، امتحان شده است. اگر بازی اجرا نشد، ‎.pkg را دوباره با خاموش بودن این گزینه بسازید.", + "cw_convert_leave_out_emu_note": "در این صورت فایل ‎.pkg هیچ ⁦fakelib/libSceAmpr.sprx⁩ ندارد و بازی فایل‌هایش را با کتابخانهٔ سیستمی خود PS5 می‌خواند. این فقط با یک بازی، روی فریم‌ور 5.10، امتحان شده است. اگر بازی اجرا نشد، ‎.pkg را دوباره با خاموش بودن این گزینه بسازید.", "cw_convert_level_default": "5 (پیش‌فرض)", "cw_convert_level_fast": "1 (سریع‌ترین)", "cw_convert_level_small": "19 (کوچک‌ترین، کند)", "cw_convert_lost": "تبدیل وقتی تمام شد که این صفحه آن را دنبال نمی‌کرد. آن را در فایل‌ها پیدا کنید.", - "cw_convert_no_eboot": "eboot.bin در آن نیست، پس شاید بازی نباشد.", + "cw_convert_no_eboot": "⁦eboot.bin⁩ در آن نیست، پس شاید بازی نباشد.", "cw_convert_output": "تبدیل به", - "cw_convert_pick_hint_archives": "پوشهٔ یک بازی را باز کنید و «اینجا» را بزنید، یا یک ایمیج (.exfat، .ffpkg، .ffpfs، .ffpfsc) یا یک آرشیو (.zip، .7z) انتخاب کنید.", + "cw_convert_pick_hint_archives": "پوشهٔ یک بازی را باز کنید و «اینجا» را بزنید، یا یک ایمیج (⁦.exfat⁩، ⁦.ffpkg⁩، ⁦.ffpfs⁩، ⁦.ffpfsc⁩) یا یک آرشیو (⁦.zip⁩، ⁦.7z⁩) انتخاب کنید.", "cw_convert_pick_source": "یک بازی انتخاب کنید…", "cw_convert_pick_title": "یک بازی انتخاب کنید", "cw_convert_pkg_level": "فشرده‌سازی بسته", @@ -253,7 +253,7 @@ "cw_convert_zstd": "بسته‌های دارایی zstd", "cw_convert_zstd_level": "سطح فشرده‌سازی", "cw_convert_zstd_no_runtime": "بسته‌های zstd به محیط اجرا نیاز دارند: یک بار PS5Upload را روی رایانه‌تان باز کنید، در حالی که این PS5 وصل است.", - "cw_convert_zstd_note": "فایل‌های بازی را در بسته‌های zstd می‌گذارد که بازی از راه AMPR می‌خواند: کوچک‌تر، و بازی برای اجرا به ampr-emu-ng نیاز دارد.", + "cw_convert_zstd_note": "فایل‌های بازی را در بسته‌های zstd می‌گذارد که بازی از راه AMPR می‌خواند: کوچک‌تر، و بازی برای اجرا به ⁦ampr-emu-ng⁩ نیاز دارد.", "cw_ctl_gamepad": "دسته به‌عنوان گیم‌پد دیده شد: {id}", "cw_ctl_last": "آخرین دکمه:", "cw_ctl_logging": "تا وقتی این صفحه باز است، فشار دکمه‌ها در یک گزارش کوچک روی این کنسول ذخیره می‌شود تا پشتیبانی از دسته بهتر شود.", @@ -344,7 +344,7 @@ "cw_files_br_start": "شروع از", "cw_files_br_stopped": "متوقف شد. {done} تغییر کرد؛ {rest} تغییر نکرد.", "cw_files_br_suffix": "متن افزودنی در انتها", - "cw_files_br_suffix_hint": "پیش از پسوند فایل (.png، .exfat، …) افزوده می‌شود.", + "cw_files_br_suffix_hint": "پیش از پسوند فایل (⁦.png⁩، ⁦.exfat⁩، …) افزوده می‌شود.", "cw_files_br_template": "نام جدید", "cw_files_br_template_hint": "{n} با شماره جایگزین می‌شود. برای نگه داشتن هر نام و افزودن شماره خالی بگذارید. پسوند فایل حفظ می‌شود.", "cw_files_br_title": "تغییر نام {n} مورد", @@ -391,7 +391,7 @@ "cw_files_edit_keep": "ادامه ویرایش", "cw_files_edit_label": "متن فایل", "cw_files_edit_no_space": "درایو پر است.", - "cw_files_edit_not_text": "این فایل متن UTF-8 نیست، پس نمی‌توان آن را اینجا ویرایش کرد.", + "cw_files_edit_not_text": "این فایل متن ⁦UTF-8⁩ نیست، پس نمی‌توان آن را اینجا ویرایش کرد.", "cw_files_edit_save": "ذخیره", "cw_files_edit_save_anyway": "در هر حال ذخیره شود", "cw_files_edit_saved": "ذخیره شد.", @@ -567,7 +567,7 @@ "cw_files_search_found": "{n} مورد پیدا شد.", "cw_files_search_go": "جستجو", "cw_files_search_here": "همین پوشه", - "cw_files_search_hint": "فایل‌ها را بر اساس نام پیدا می‌کند. یک واژه با هر بخشی از نام جور می‌شود؛ برای الگو از * و ? استفاده کنید (*.pkg).", + "cw_files_search_hint": "فایل‌ها را بر اساس نام پیدا می‌کند. یک واژه با هر بخشی از نام جور می‌شود؛ برای الگو از * و ? استفاده کنید (⁦*.pkg⁩).", "cw_files_search_more": "{n} مورد نخست نمایش داده می‌شود. موارد بیشتری هست: نام بلندتری امتحان کنید.", "cw_files_search_no_index": "هنوز نمایه‌ای نیست. نخستین جستجو آن را می‌سازد: همهٔ پوشه‌ها را می‌خواند و ممکن است چند دقیقه طول بکشد.", "cw_files_search_none": "چیزی با «{q}» جور نیست.", @@ -617,7 +617,7 @@ "cw_files_smb_err_full": "تعداد اشتراک‌های شبکه‌ی ذخیره‌شده بیش از حد است. اول یکی را حذف کنید.", "cw_files_smb_err_generic": "مشکلی در اشتراک شبکه پیش آمد.", "cw_files_smb_err_loader": "اشتراک‌های شبکه به بارگذار ELF روی پورت 9021 نیاز دارند و آن اجرا نمی‌شود.", - "cw_files_smb_err_no_share": "سرور اشتراکی با این نام ندارد. اشتراک فقط نام اولین پوشه است (مثلاً Media در \\\\nas\\Media\\Games)؛ پوشه‌های داخل آن در «پوشه‌ای که باز شود» می‌آیند.", + "cw_files_smb_err_no_share": "سرور اشتراکی با این نام ندارد. اشتراک فقط نام اولین پوشه است (مثلاً Media در ⁦\\\\nas\\Media\\Games⁩)؛ پوشه‌های داخل آن در «پوشه‌ای که باز شود» می‌آیند.", "cw_files_smb_err_no_space": "فضای خالی کافی برای این کپی وجود ندارد.", "cw_files_smb_err_not_supported": "سرور این کار را روی این اشتراک اجازه نمی‌دهد.", "cw_files_smb_err_timeout": "پاسخ سرور بیش از حد طول کشید.", @@ -673,7 +673,7 @@ "cw_files_unmount_title": "{path} پیاده شود؟", "cw_files_unpack": "باز کردن فشرده‌سازی", "cw_files_unpack_batch": "در حال باز کردن «{name}»…", - "cw_files_unpack_body": "«{name}» ({size}) را کنار آن می‌نویسد. فایل .ffpfsc می‌ماند.", + "cw_files_unpack_body": "«{name}» ({size}) را کنار آن می‌نویسد. فایل ⁦.ffpfsc⁩ می‌ماند.", "cw_files_unpack_busy": "باز کردن دیگری روی کنسول در حال اجراست.", "cw_files_unpack_damaged": "فایل آسیب دیده است.", "cw_files_unpack_done": "باز شد: «{name}» کنار «{source}» است.", @@ -688,7 +688,7 @@ "cw_files_unpack_needs": "نیاز", "cw_files_unpack_no_space": "فضای آزاد کافی نیست: {need} لازم است (ایمیج به‌علاوهٔ 1 GiB) و {free} آزاد است.", "cw_files_unpack_no_space_short": "فضای آزاد آن درایو کافی نیست.", - "cw_files_unpack_not_container": "این یک .ffpfsc قابل خواندن برای کنسول نیست.", + "cw_files_unpack_not_container": "این یک ⁦.ffpfsc⁩ قابل خواندن برای کنسول نیست.", "cw_files_unpack_not_image": "ایمیج داخل آن ایمیج exFAT نیست، پس پشتیبانی نمی‌شود.", "cw_files_unpack_stopped": "باز کردن متوقف شد. چیزی نگه داشته نشد.", "cw_files_unpack_title": "باز کردن فشرده‌سازی «{name}»", @@ -767,7 +767,7 @@ "cw_games_confirm_uninstall_pkg": "این کار بازی را از PS5 حذف می‌کند. بعداً می‌توانید آن را از بسته‌اش دوباره نصب کنید.", "cw_games_confirm_uninstall_registered": "این کار بازی را از صفحهٔ اصلی برمی‌دارد. پوشه یا ایمیج دیسک آن سر جایش می‌ماند.", "cw_games_confirm_uninstall_title": "{name} حذف نصب شود؟", - "cw_games_err_launch_refused": "کنسول از اجرای آن خودداری کرد. بازی‌های homebrew و fake-package به kstuff در حال اجرا نیاز دارند؛ بازی ایمیج دیسک به ShadowMount+ هم نیاز دارد.", + "cw_games_err_launch_refused": "کنسول از اجرای آن خودداری کرد. بازی‌های homebrew و ⁦fake-package⁩ به kstuff در حال اجرا نیاز دارند؛ بازی ایمیج دیسک به ⁦ShadowMount+⁩ هم نیاز دارد.", "cw_games_err_load_next": "برای تلاش دوباره «تازه‌سازی» را بزنید.", "cw_games_err_other_running": "بازی دیگری در حال اجراست. ابتدا آن را ببندید.", "cw_games_err_running": "پیش از حذف نصب، بازی را ببندید.", @@ -876,7 +876,7 @@ "cw_home_usb_open": "باز کردن در فایل‌ها", "cw_home_vol_ext": "حافظه توسعه‌یافته", "cw_home_vol_internal": "حافظه داخلی", - "cw_home_vol_m2": "حافظه M.2", + "cw_home_vol_m2": "حافظه ⁦M.2⁩", "cw_home_vol_readonly": "فقط‌خواندنی", "cw_home_vol_usb": "درایو USB", "cw_home_vol_usb_ext": "حافظه توسعه‌یافته USB", @@ -910,10 +910,10 @@ "cw_lib_copying": "در حال کپی {name} در PS5… {pct}٪ از {size}", "cw_lib_err_exists": "{path} از قبل وجود دارد.", "cw_lib_fake": "بسته fake", - "cw_lib_fmt_exfat": "ایمیج exFAT (.exfat)", - "cw_lib_fmt_ffpfs": "ایمیج PFS (.ffpfs)", - "cw_lib_fmt_ffpkg": "ایمیج (.ffpkg)", - "cw_lib_fmt_pkg": "بسته (.pkg)", + "cw_lib_fmt_exfat": "ایمیج exFAT (⁦.exfat⁩)", + "cw_lib_fmt_ffpfs": "ایمیج PFS (⁦.ffpfs⁩)", + "cw_lib_fmt_ffpkg": "ایمیج (⁦.ffpkg⁩)", + "cw_lib_fmt_pkg": "بسته (⁦.pkg⁩)", "cw_lib_fw_newer": "به نرم‌افزار سیستم {need} نیاز دارد؛ این PS5 روی {have} است. ممکن است بدون بک‌پورت اجرا نشود.", "cw_lib_info_formats": "نگه‌داری به‌صورت", "cw_lib_info_fw": "نرم‌افزار سیستم لازم", @@ -971,7 +971,7 @@ "cw_pkg_done_installed": "«{name}» نصب شد.", "cw_pkg_err_busy": "نصب دیگری در جریان است. صبر کنید تا تمام شود.", "cw_pkg_err_daemon": "نصب‌کننده اجرا نشد یا دیگر پاسخ نمی‌دهد. دوباره امتحان کنید.", - "cw_pkg_err_image": "این بازی از یک ایمیج دیسک (ShadowMount+) اجرا می‌شود. پیش از نصب بسته برای آن، ایمیج را جابه‌جا یا حذف کنید.", + "cw_pkg_err_image": "این بازی از یک ایمیج دیسک (⁦ShadowMount+⁩) اجرا می‌شود. پیش از نصب بسته برای آن، ایمیج را جابه‌جا یا حذف کنید.", "cw_pkg_err_installed": "این بازی از قبل نصب است.", "cw_pkg_err_loader": "بارگذار payload کنسول (پورت 9021) پاسخ نداد. بارگذار ELF را دوباره بارگذاری کنید و دوباره امتحان کنید.", "cw_pkg_err_no_space": "فضای خالی کافی در حافظهٔ داخلی برای کپی بسته نیست.", @@ -979,7 +979,7 @@ "cw_pkg_err_refused": "کنسول بسته را رد کرد ({code}).", "cw_pkg_err_stage": "کپی بسته به حافظهٔ داخلی ناموفق بود.", "cw_pkg_err_stalled": "کنسول خواندن بسته را متوقف کرد. صفحهٔ اصلی را بررسی کنید: ممکن است نصب ناموفق بوده باشد.", - "cw_pkg_err_where": "بسته‌ها فقط از حافظهٔ داخلی، M.2 یا درایوهای USB نصب می‌شوند.", + "cw_pkg_err_where": "بسته‌ها فقط از حافظهٔ داخلی، ⁦M.2⁩ یا درایوهای USB نصب می‌شوند.", "cw_pkg_failed": "نصب ناموفق بود: {reason}", "cw_pkg_failed_generic": "پاسخ کنسول «{cause}» بود.", "cw_pkg_fake_note": "بستهٔ fake (با امضای دیباگ): فقط وقتی payloadهای homebrew بارگذاری شده باشند نصب و اجرا می‌شود.", diff --git a/client/src/i18n.ts b/client/src/i18n.ts index c66a39515..610c175c8 100644 --- a/client/src/i18n.ts +++ b/client/src/i18n.ts @@ -19,6 +19,7 @@ import type { Translations } from "./i18n/types"; import enTranslations from "./i18n/locales/en"; +import { isolateLatinAll } from "./i18n/isolateLatin"; export type LanguageCode = | "en" @@ -125,7 +126,9 @@ export function ensureLocale(code: LanguageCode): Promise { const p = (async () => { try { const mod = await importLocale(code); - loaded[code] = mod.default; + // A right-to-left locale: its Latin names and paths are kept whole here, once, for every + // string it has or will have (i18n/isolateLatin.ts). + loaded[code] = RTL_CODES.has(code) ? isolateLatinAll(mod.default) : mod.default; for (const fn of loadListeners) fn(); } finally { delete pending[code]; diff --git a/client/src/i18n/isolateLatin.test.ts b/client/src/i18n/isolateLatin.test.ts new file mode 100644 index 000000000..6e0ae65b6 --- /dev/null +++ b/client/src/i18n/isolateLatin.test.ts @@ -0,0 +1,135 @@ +import { describe, expect, it } from "vitest"; + +// @ts-expect-error plain .mjs script, no type declarations +import { isolateLatin as scriptIsolateUntyped, RTL_LOCALES } from "../../../scripts/rtl-isolate.mjs"; +import { ensureLocale, t } from "../i18n"; +import { bareLatinPieces, isolateLatin } from "./isolateLatin"; +import ar from "./locales/ar"; +import en from "./locales/en"; +import fa from "./locales/fa"; +import consoleAr from "../console/locales/ar.json"; +import consoleFa from "../console/locales/fa.json"; + +const L = "⁦"; +const P = "⁩"; +const RTL = { ar, fa } as Record>; +const scriptIsolate = scriptIsolateUntyped as (s: string) => string; +const unmarked = (s: string) => s.split(L).join("").split(P).join(""); + +describe("Latin names inside a right-to-left sentence", () => { + it("a name ending in a symbol is kept whole", () => { + expect(isolateLatin("سُلّم إلى ShadowMount+")).toBe(`سُلّم إلى ${L}ShadowMount+${P}`); + // In brackets, before a full stop, twice in one sentence. + expect(isolateLatin("صورة قرص (ShadowMount+).")).toBe(`صورة قرص (${L}ShadowMount+${P}).`); + expect(isolateLatin("ShadowMount+ ثم ShadowMount+")).toBe(`${L}ShadowMount+${P} ثم ${L}ShadowMount+${P}`); + // Not only that name: any Latin name with a trailing + or #. + expect(isolateLatin("مكتوب بلغة C# أو C++")).toBe(`مكتوب بلغة ${L}C#${P} أو ${L}C++${P}`); + }); + + it("letters with digits and symbols between them stay in order", () => { + expect(isolateLatin("استخدم 7-Zip هنا")).toBe(`استخدم ${L}7-Zip${P} هنا`); + expect(isolateLatin("الإصدار v1.15 أو kstuff-1.13-fpkg")).toBe(`الإصدار ${L}v1.15${P} أو ${L}kstuff-1.13-fpkg${P}`); + expect(isolateLatin("اضغط Ctrl+Shift+E")).toBe(`اضغط ${L}Ctrl+Shift+E${P}`); + expect(isolateLatin("افتح https://example.com/a?b=c الآن")).toBe(`افتح ${L}https://example.com/a?b=c${P} الآن`); + }); + + it("a path, a pattern and a file extension keep their leading symbol", () => { + expect(isolateLatin("في /data/homebrew أو .ffpkg أو *.pkg")).toBe( + `في ${L}/data/homebrew${P} أو ${L}.ffpkg${P} أو ${L}*.pkg${P}`, + ); + // After a letter the symbol belongs to the sentence, not to the Latin word. + expect(isolateLatin("الصورة/ISO")).toBe("الصورة/ISO"); + expect(isolateLatin("الصورة/game.iso")).toBe(`الصورة/${L}game.iso${P}`); + }); + + it("plain words, numbers and placeholders are left alone", () => { + for (const s of [ + "يحتاج إلى kstuff على PS5", + "من 1.00 إلى 13.60", + "تم نسخ {count} من {total}", + "النسبة 16:9 و50%", + "انتهى.", + "", + ]) { + expect(isolateLatin(s)).toBe(s); + } + // A sentence's own full stop, comma and colon stay outside the name. + expect(isolateLatin("شغّل kstuff. ثم ShadowMount+، ثم elfldr: الآن")).toBe( + `شغّل kstuff. ثم ${L}ShadowMount+${P}، ثم elfldr: الآن`, + ); + }); + + it("a placeholder inside a piece is kept as it is, so it is still filled in", () => { + expect(isolateLatin("الإصدار v{version} في /data/{name}.pkg")).toBe( + `الإصدار ${L}v{version}${P} في ${L}/data/{name}.pkg${P}`, + ); + expect(isolateLatin("{count}×{size}")).toBe("{count}×{size}"); + }); + + it("is safe to apply twice", () => { + for (const s of ["سُلّم إلى ShadowMount+ في /data/x.pkg", "v{version} و C++ و Ctrl+K"]) { + const once = isolateLatin(s); + expect(isolateLatin(once)).toBe(once); + expect(bareLatinPieces(once)).toEqual([]); + } + expect(bareLatinPieces("سُلّم إلى ShadowMount+")).toEqual(["ShadowMount+"]); + }); + + // The check that keeps this from coming back: every string of every right-to-left locale, as + // the app shows it (through the loader, i18n.ts), holds no Latin name or path outside the marks. + // A string added tomorrow is covered without anyone remembering to do anything. + it("no right-to-left string the app shows has a bare Latin name with a symbol", async () => { + expect(RTL_LOCALES).toEqual(Object.keys(RTL)); + for (const [code, dict] of Object.entries(RTL)) { + await ensureLocale(code as "ar" | "fa"); + const bare: string[] = []; + let names = 0; + for (const key of Object.keys(dict)) { + const shown = t(code, key); + for (const piece of bareLatinPieces(shown)) bare.push(`${code} ${key}: ${piece}`); + if (dict[key].includes("ShadowMount+")) { + names += 1; + // Every occurrence, not just the first. + expect(shown.split("ShadowMount+").length, key).toBe(shown.split(`${L}ShadowMount+${P}`).length); + } + // Nothing but the two marks was added, and every placeholder is still there to fill. + expect(unmarked(shown), key).toBe(dict[key]); + } + expect(bare).toEqual([]); + // The strings this was found in (about 80 at the time). + expect(names).toBeGreaterThan(50); + } + }); + + it("placeholders in a right-to-left string are still filled, isolated once", async () => { + await ensureLocale("ar"); + const key = Object.keys(ar).find((k) => /\{version\}/.test(ar[k as keyof typeof ar] as string))!; + const shown = t("ar", key, { version: "12.6.32" }); + expect(shown).toContain("12.6.32"); + expect(shown).not.toContain("{version}"); + }); + + it("the console page's right-to-left strings are written the same way", () => { + for (const [code, page] of Object.entries({ ar: consoleAr, fa: consoleFa } as Record>)) { + for (const [key, value] of Object.entries(page)) { + expect(bareLatinPieces(value), `${code} ${key}`).toEqual([]); + expect(value, `${code} ${key}`).toBe(isolateLatin(RTL[code][key])); + } + } + }); + + it("the build scripts' copy of the function gives the same result on every string", () => { + for (const dict of [...Object.values(RTL), en as Record]) { + for (const value of Object.values(dict)) { + expect(scriptIsolate(value)).toBe(isolateLatin(value)); + } + } + }); + + it("left-to-right languages are not touched", async () => { + await ensureLocale("de"); + const key = Object.keys(en).find((k) => (en as Record)[k].includes("ShadowMount+"))!; + expect(t("en", key)).not.toContain(L); + expect(t("de", key)).not.toContain(L); + }); +}); diff --git a/client/src/i18n/isolateLatin.ts b/client/src/i18n/isolateLatin.ts new file mode 100644 index 000000000..116987b66 --- /dev/null +++ b/client/src/i18n/isolateLatin.ts @@ -0,0 +1,75 @@ +/** + * Names and other Latin text inside a right-to-left sentence. + * + * In Arabic or Persian text a symbol next to a Latin word has no direction of its own and takes + * the sentence's: "ShadowMount+" is drawn "+ShadowMount", ".ffpkg" "ffpkg.", "/data" "data/" and + * "7-Zip" "Zip-7". `tr()` already keeps interpolated values whole (`isolatedForRtl`); this does the + * same for what is written in the translated sentence itself. Every right-to-left locale goes + * through `isolateLatinAll` when it is loaded (i18n.ts), so a string added later needs nothing. + * + * A piece of Latin text that holds a symbol (a name ending in + or #, a path, a file extension, + * a version like v1.15, a key combination, a link) goes between LEFT-TO-RIGHT ISOLATE and POP + * DIRECTIONAL ISOLATE, which draw nothing. A plain word ("kstuff", "PS5") and a plain number need + * none and are left alone, as is anything already between the two marks. + * + * scripts/rtl-isolate.mjs is the same function for the build scripts (the console page's + * strings); isolateLatin.test.ts holds the two to the same result. + */ + +const LRI = "⁦"; +const PDI = "⁩"; + +// One piece: letters, digits and {placeholders}, joined by up to three of . _ - / \ : + & @ ' = ? % # ~ +// (which must sit between two of them: "://" in a link, "+" in Ctrl+K), with a path's, pattern's or +// extension's leading * . / \ ~ and a name's trailing + or #. Also matched, to be skipped: a run +// already isolated. No lookbehind (old WebKit): `split` looks at the character before. +const UNIT = "(?:\\{\\w+\\}|[A-Za-z0-9]+)"; +const PIECE = new RegExp( + `${LRI}[^${PDI}]*${PDI}|[*./\\\\~]*${UNIT}(?:[._\\-/\\\\:+&@'=?%#~]{0,3}${UNIT})*[+#]*`, + "g", +); +/** What may stand before a piece's leading symbols: nothing, a space, an opening bracket or quote. + * After a letter ("عربي/English") the symbol belongs to the sentence and stays outside. */ +const OPENS = /[\s([{"'«“‘]/; + +/** The part of a match to isolate and the leading symbols left outside it; null: nothing to do. */ +function split(m: string, before: string): { lead: string; piece: string } | null { + if (m.startsWith(LRI)) return null; + let lead = ""; + let piece = m; + if (before !== "" && !OPENS.test(before)) { + lead = /^[*./\\~]*/.exec(m)![0]; + piece = m.slice(lead.length); + } + const own = piece.replace(/\{\w+\}/g, ""); + // No Latin letter of its own (a number, a lone placeholder), or a plain word: as it is. + if (!/[A-Za-z]/.test(own) || /^[A-Za-z0-9]+$/.test(piece)) return null; + return { lead, piece }; +} + +/** `s` with every such piece of Latin text isolated. Applying it twice changes nothing. */ +export function isolateLatin(s: string): string { + if (!/[A-Za-z]/.test(s)) return s; + return s.replace(PIECE, (m: string, at: number) => { + const cut = split(m, at > 0 ? s[at - 1] : ""); + return cut ? cut.lead + LRI + cut.piece + PDI : m; + }); +} + +/** A whole locale. */ +export function isolateLatinAll>(dict: T): T { + const out: Record = {}; + for (const [key, value] of Object.entries(dict)) out[key] = isolateLatin(value); + return out as T; +} + +/** Latin text with a symbol that is not isolated in `s`: what would be drawn out of order. + * Empty for anything that went through `isolateLatin`. For tests. */ +export function bareLatinPieces(s: string): string[] { + const out: string[] = []; + for (const m of s.matchAll(PIECE)) { + const cut = split(m[0], m.index > 0 ? s[m.index - 1] : ""); + if (cut) out.push(cut.piece); + } + return out; +} diff --git a/client/src/i18n/locales/ar.ts b/client/src/i18n/locales/ar.ts index 28a3cb5e5..14c26ea48 100644 --- a/client/src/i18n/locales/ar.ts +++ b/client/src/i18n/locales/ar.ts @@ -185,6 +185,8 @@ update_skipped_note: "تخطيت الإصدار v{version}.", update_unskip: "لا تتخطَّ", update_toast_installs_on_quit: "يُثبَّت عند الخروج", update_install_failed_title: "لم يُثبَّت التحديث", +update_finishing_title: "جارٍ إنهاء التحديث…", +update_finishing_body: "سيبدأ PS5Upload من جديد تلقائيًا عند الانتهاء.", update_install_failed_body: "تعذّر تثبيت v{version}، لذلك ما زال PS5Upload على الإصدار القديم.", update_install_failed_reason: "السبب: {message}", update_quit_app: "إنهاء PS5Upload", @@ -1020,8 +1022,9 @@ fs_verify_result: "نتيجة التحقق", fs_verify_tooltip: "تحقق باستخدام BLAKE3 + CRC32 (أبطأ، بقوة تشفيرية)", hardware_storage: "تخزين الجهاز", hw_storage_free: "متاح", -hw_storage_reserved: "محجوز", -hw_storage_reserved_hint: "الجزء الذي يحتفظ به نظام الملفات لا يُحتسب ضمن المساحة الحرة", +hw_storage_held_back: "تحتفظ به PS5", +hw_storage_held_back_hint: "محسوب ضمن المستخدم. ليس مساحة فارغة.", +hw_storage_note: "كما يحسبها نظام ملفات القرص. قد تعرض شاشة التخزين في PS5 مساحة فارغة أقل: فهي تحتفظ بالمزيد للنظام.", hw_storage_total: "الإجمالي", hw_storage_used: "مستخدم", klog_clear: "مسح", @@ -1209,6 +1212,7 @@ pm_autoload_add: "تحميل عند الإقلاع", pm_autoload_earlier: "تحميل أبكر", pm_autoload_later: "تحميل لاحقًا", pm_launch: "تشغيل", +pm_row_more: "المزيد لـ {name}", pm_detected: "Payload Manager {version} على PS5", pm_autoload_title: "تحميل الحمولات عند الإقلاع", pm_autoload_hint: "يبدأ Payload Manager الحمولات المحددة بالترتيب بعد {delay} ثانية من إقلاع PS5. {n} مدرجة. تبقى فترات التوقف بينها كما ضُبطت في Payload Manager.", @@ -1511,6 +1515,7 @@ upload_folder_stats_files: "الملفات", upload_mount_after_title: "التحميل بعد التحميل", upload_mount_readonly_title: "تحميل للقراءة فقط", upload_dest_card_title: "الوجهة", +upload_dest_room: "مساحة لنحو {size}", upload_dest_auto: "(افتراضي — /data)", upload_dest_presets: "الوحدات:", upload_dest_final_path: "المسار النهائي على PS5", @@ -2568,6 +2573,9 @@ upload_pkg_name_save: "تغيير الاسم", upload_pkg_name_all_v2: "استخدم هذا الاسم في كل اللغات (أسماء أخرى في الحزمة: {count})", upload_pkg_name_hint: "يغيّر الاسم داخل ملف الحزمة نفسه قبل تثبيتها. اللعبة المثبتة مسبقاً تحتفظ باسمها حتى تثبّتها من جديد.", upload_pkg_name_saved: "تم تغيير الاسم.", +upload_phone_upload_first: "ينسخها إلى PS5 أولًا، ثم يثبّتها.", +upload_pkg_name_left: "البايتات المتبقية للاسم: {count}", +upload_pkg_name_too_long: "هذا الاسم طويل جدًا لهذه الحزمة. البايتات التي تتسع: {limit}. البايتات الزائدة: {count}. اجعله أقصر: الحروف غير اللاتينية والحروف ذات العلامات تأخذ مساحة أكبر.", upload_pkg_name_retail: "هذه حزمة رسمية، لذلك لا يمكن تغيير اسمها: الاسم مشمول بتوقيع ناشرها.", upload_pkg_name_refused: "لا يمكن تغيير اسم هذه الحزمة: {reason}", upload_pkg_name_failed: "لم يتغير الاسم: {reason}", @@ -2865,6 +2873,9 @@ remote_copy_task_unknown_server: "نسخ {name} من الخادم", upload_split_unsupported_title: "هذا أرشيف مقسّم ({count} مجلدات) لا يستطيع ps5upload فتحه", upload_split_unsupported_body: "رفعه يُرسل المجلد الخام إلى جهاز PS5 وهو لا يستطيع استخدامه. اجمع المجلدات أولاً في أرشيف واحد: افتح المجلد الأول ببرنامج 7-Zip أو WinRAR واستخرجه، ثم ارفع المجلد المستخرج أو أرشيفًا واحدًا منه.", upload_split_unsupported_target: "يُجمَع ليصبح: {name}", +volumes_held_back: "تحتفظ PS5 بـ {kept} لنفسها. هذه ليست مساحة فارغة، وتزداد كلما كُتبت بيانات.", +volumes_likely_fits: "يُرجّح أن يتسع هنا نحو {safe} من البيانات الجديدة.", +volumes_ps5_shows_less: "قد تعرض شاشة التخزين في PS5 مساحة فارغة أقل. عند اختلاف الرقمين، اعتمد على الأصغر.", // Editing a game image in place (ShadowMount+ checkout) @@ -3289,7 +3300,6 @@ library_mount_tooltip_smp: "سلِّم هذه الصورة إلى ShadowMount+ "v5_home_no_notifications_desc": "ستظهر التنبيهات الجديدة هنا.", "v5_home_view_all": "عرض الكل", "task_recheck": "إعادة الفحص", -"volumes_upload_safe_capacity": "{safe} آمنة لعمليات رفع جديدة · {reserve} محجوزة كهامش للنظام/نظام الملفات", "pkg_storage_fallback_title": "استخدام التخزين الداخلي", "pkg_storage_fallback_body": "محرك الحزم الافتراضي ({drive}) غير متاح، لذا ستُحفظ هذه الحزمة في التخزين الداخلي.", "pkglib.meta.drive": "على {drive}", @@ -4297,6 +4307,7 @@ trace_profile_name: "مقيس من {n} جلسات لعب", "collection.org_summary": "{n} عمليات نقل · {size}", "collection.org_title": "تنظيم المجموعة", "collection.org_undo": "تراجع", +"collection.org_undo_incomplete": "نُقلت العناصر، لكن تعذّر حفظ سجل التراجع. قد لا يعيد التراجع كل شيء إلى مكانه.", "collection.org_undo_body": "تعود العناصر المنقولة وعددها {n} إلى أسمائها ومجلداتها الأصلية. تبقى العناصر التي نُقلت أو أُعيدت تسميتها لاحقًا في مكانها.", "collection.org_undo_title": "التراجع عن هذا التشغيل؟", "collection.org_undone": "تم التراجع: استُعيد {n}، وبقي {problems} في مكانها", @@ -4534,6 +4545,7 @@ drive_detail_changed_here: "تغيّر {path} على هذا الجهاز أثن drive_detail_changed_there: "تغيّر {path} على {console} أثناء مزامنته. ستتم مزامنته في المرة القادمة.", drive_detail_too_many_files: "أكثر من {limit} ملف: عدد كبير جدًا على Mesh Drive.", drive_detail_list_unreadable: "لا يستطيع هذا الإصدار قراءة قائمة المحركات على وحدة التحكم. حدّث هذا التطبيق.", +drive_detail_console_list_unreadable: "تعذّر على وحدة التحكم قراءة قائمة المحركات لديها. لن يتغير شيء حتى تتمكن من ذلك.", drive_detail_link_record_damaged: "سجل الرابط على {console} تالف.", drive_detail_too_many_for_console: "عدد كبير جدًا من الملفات لمجلد محرك على وحدة تحكم ثانية.", drive_removed: "لم يعد في هذا المحرك", @@ -4555,6 +4567,8 @@ drive_join: "انضمام", drive_delete_title: "حذف المحرك {name}؟", drive_delete_body: "يتوقف كل جهاز عن مزامنته. لا تُحذف أي ملفات: يحتفظ كل مجلد، ومنها المجلد الموجود على وحدة التحكم، بما لديه.", drive_delete: "حذف المحرك", +drive_left_later: "لم يعد هذا المجلد يُزامَن. لم تستجب {name}: سيُزال من المحرك هناك عندما تعود. تبقى ملفاته في مكانها.", +drive_deleted_later: "لم يعد هذا المحرك محفوظًا على هذا الجهاز. لم تستجب {name}: سيُحذف هناك عندما تعود. لا تُحذف أي ملفات.", drive_create: "محرك Mesh جديد", drive_create_go: "إنشاء", drive_title: "محرك Mesh", @@ -4616,13 +4630,14 @@ fs_search_all_drives: "البحث في كل الأقراص", fs_more: "المزيد", fs_more_actions: "المزيد: ما يشغل المساحة، اللقطات", fs_space_title: "ما الذي يشغل المساحة؟", +fs_space_here_v2: "ما الذي يشغل المساحة في هذا المجلد؟", +fs_snapshot_folder_v2: "إنشاء لقطة لهذا المجلد", +fs_space_drive: "ما الذي يشغل المساحة على هذا القرص؟", +fs_snapshots_see: "عرض اللقطات", fs_space_action: "ما الذي يشغل المساحة؟", -fs_space_here: "ما الذي يشغل المساحة هنا؟", fs_space_open_folder: "افتح هذا المجلد", -fs_snapshot_folder: "لقطة لهذا المجلد", fs_snapshot_action: "لقطة…", fs_snapshot_tooltip: "انسخ إلى لقطة محفوظة على PS5 لإعادتها لاحقًا", -fs_snapshots_open: "اللقطات", fs_snapshot_batch: "{count} عناصر، لقطة لكل عنصر، باسم العنصر وتاريخ اليوم:", fs_snapshot_batch_create: "إنشاء {count} لقطات", fs_snapshot_batch_ok: "تم إنشاء {count} لقطات: {files} ملفات ({bytes})", @@ -5406,7 +5421,6 @@ upload_phase_settling_eta: "تبقّى نحو {time}", upload_phase_settling_rate: "ملف/ث", upload_status_resuming: "جارٍ الاستئناف: {done} من {total} ملف موجودة بالفعل ({have})؛ {send} للإرسال.", upload_resumed_have: "تم الاستئناف: كان {have} موجودًا بالفعل على PS5.", -volumes_kept_by_console: "{kept} يحتفظ بها الجهاز لاستخدامه الخاص", payloads_tab_ps5: "على جهاز PS5", payloads_pm_stored_body_v2: "إنه في مجلد \"{folder}\" الخاص بـ Payload Manager. يشغّله Payload Manager في تبويب «على جهاز PS5» أو يحمّله عند الإقلاع.", hub_checking: "جارٍ التحقق مما على جهاز PS5 هذا…", @@ -9013,6 +9027,8 @@ rp_users_add_hint: "للعب باسم مستخدم آخر أيضًا، سجّل "receive_cheats_none": "يلعب دون تفعيل أي منها.", "receive_stream": "إعدادات البث", "receive_stream_body": "محفوظة مع الأشياء الأخرى التي استلمتها.", +"receive_data_unreadable": "لا يمكن استخدام بعضه", +"receive_data_unreadable_body": "جزء مما أرسله صديقك ليس بصيغة يقرؤها هذا التطبيق، لذلك تم تركه.", "receive_intro_v2": "الصق رابطهم. سترى ما يقدّمونه قبل أن يصل أي شيء.", "receive_pick": "ما الذي تأخذه", "receive_total": "{size} إجمالًا", diff --git a/client/src/i18n/locales/bn.ts b/client/src/i18n/locales/bn.ts index a349a3a0e..ea821eba6 100644 --- a/client/src/i18n/locales/bn.ts +++ b/client/src/i18n/locales/bn.ts @@ -190,6 +190,8 @@ update_skipped_note: "আপনি v{version} বাদ দিয়েছেন update_unskip: "বাদ দেবেন না", update_toast_installs_on_quit: "বন্ধ করলে ইনস্টল হবে", update_install_failed_title: "আপডেট ইনস্টল হয়নি", +update_finishing_title: "আপডেট শেষ হচ্ছে…", +update_finishing_body: "শেষ হলে PS5Upload নিজে থেকেই আবার চালু হবে।", update_install_failed_body: "v{version} ইনস্টল করা যায়নি, তাই PS5Upload এখনও পুরোনো সংস্করণে আছে।", update_install_failed_reason: "কারণ: {message}", update_quit_app: "PS5Upload বন্ধ করুন", @@ -1020,8 +1022,9 @@ fs_verify_result: "যাচাইয়ের ফলাফল", fs_verify_tooltip: "BLAKE3 + CRC32 যাচাই (ধীর, ক্রিপ্টোগ্রাফিক মানের)", hardware_storage: "কনসোলের সংরক্ষণস্থান", hw_storage_free: "মুক্ত", -hw_storage_reserved: "সংরক্ষিত", -hw_storage_reserved_hint: "ফাইল সিস্টেম যে অংশ ধরে রাখে তা ফাঁকা হিসেবে গণ্য হয় না", +hw_storage_held_back: "PS5 আটকে রাখে", +hw_storage_held_back_hint: "ব্যবহৃত-তে ধরা আছে। এটি খালি জায়গা নয়।", +hw_storage_note: "ড্রাইভের ফাইল সিস্টেম যেভাবে গোনে। PS5-এর নিজের Storage স্ক্রিনে খালি জায়গা কম দেখাতে পারে: এটি সিস্টেমের জন্য আরও জায়গা আটকে রাখে।", hw_storage_total: "মোট", hw_storage_used: "ব্যবহৃত", klog_clear: "মুছুন", @@ -1209,6 +1212,7 @@ pm_autoload_add: "বুটে লোড", pm_autoload_earlier: "আগে লোড", pm_autoload_later: "পরে লোড", pm_launch: "চালান", +pm_row_more: "{name}-এর জন্য আরও", pm_detected: "PS5-এ Payload Manager {version}", pm_autoload_title: "বুটে পেলোড লোড করুন", pm_autoload_hint: "Payload Manager চিহ্নিত পেলোডগুলো PS5 বুটের {delay} সেকেন্ড পরে ক্রমানুসারে চালায়। তালিকায় {n}টি। মাঝের বিরতি Payload Manager-এ যেমন সেট আছে তেমনই থাকে।", @@ -1478,6 +1482,7 @@ upload_change_source: "উৎস পরিবর্তন করুন", upload_choose_diff_source: "একটি ভিন্ন উৎস বেছে নিন", upload_dest_auto: "(ডিফল্ট — /data)", upload_dest_card_title: "গন্তব্য", +upload_dest_room: "প্রায় {size} জায়গা আছে", upload_dest_final_path: "PS5-তে চূড়ান্ত পথ", upload_dest_presets: "প্রিসেট:", upload_dest_will_create: "গন্তব্য ফোল্ডারটি যদি এখনও PS5-তে না থাকে, তাহলে আপনি আপলোড শুরু করলে এটি তৈরি হবে।", @@ -2568,6 +2573,9 @@ upload_pkg_name_save: "নাম বদলান", upload_pkg_name_all_v2: "সব ভাষায় এই নাম ব্যবহার করুন (প্যাকেজে অন্য নাম: {count})", upload_pkg_name_hint: "ইনস্টল করার আগে প্যাকেজ ফাইলের ভেতরেই নাম বদলে দেয়। আগে থেকে ইনস্টল করা গেম আবার ইনস্টল না করা পর্যন্ত পুরোনো নামেই থাকে।", upload_pkg_name_saved: "নাম বদলানো হয়েছে।", +upload_phone_upload_first: "আগে এটি PS5-এ কপি করে, তারপর ইনস্টল করে।", +upload_pkg_name_left: "নামের জন্য বাকি বাইট: {count}", +upload_pkg_name_too_long: "এই নামটি এই প্যাকেজের জন্য খুব লম্বা। যত বাইট ধরে: {limit}। অতিরিক্ত বাইট: {count}। নামটি ছোট করুন: চিহ্নযুক্ত অক্ষর ও অ-ল্যাটিন অক্ষর বেশি জায়গা নেয়।", upload_pkg_name_retail: "এটি একটি অফিসিয়াল প্যাকেজ, তাই এর নাম বদলানো যায় না: নামটি প্রকাশকের স্বাক্ষরের আওতায় আছে।", upload_pkg_name_refused: "এই প্যাকেজের নাম বদলানো যায় না: {reason}", upload_pkg_name_failed: "নাম বদলানো হয়নি: {reason}", @@ -2865,6 +2873,9 @@ remote_copy_task_unknown_server: "সার্ভার থেকে {name} ক upload_split_unsupported_title: "এটি একটি বিভক্ত আর্কাইভ ({count}টি ভলিউম) যা ps5upload খুলতে পারে না", upload_split_unsupported_body: "আপলোড করলে কাঁচা ভলিউমটিই আপনার PS5-তে যাবে, যা সেটি ব্যবহার করতে পারবে না। আগে ভলিউমগুলো একটি আর্কাইভে জোড়া লাগান: 7-Zip বা WinRAR দিয়ে প্রথম ভলিউমটি খুলে এক্সট্র্যাক্ট করুন, তারপর এক্সট্র্যাক্ট করা ফোল্ডার বা তার একটিমাত্র আর্কাইভ আপলোড করুন।", upload_split_unsupported_target: "জোড়া লাগলে হয়: {name}", +volumes_held_back: "PS5 নিজের জন্য {kept} আটকে রাখে। এটি খালি জায়গা নয়, আর ডেটা লেখার সঙ্গে বাড়ে।", +volumes_likely_fits: "এখানে প্রায় {safe} নতুন ডেটা আঁটবে বলে মনে হয়।", +volumes_ps5_shows_less: "PS5-এর নিজের Storage স্ক্রিনে খালি জায়গা কম দেখাতে পারে। দুটি আলাদা হলে ছোটটি ধরে চলুন।", // Editing a game image in place (ShadowMount+ checkout) @@ -3289,7 +3300,6 @@ library_mount_tooltip_smp: "এই ইমেজটি ShadowMount+ কে দি "v5_home_no_notifications_desc": "নতুন সতর্কতা এখানে দেখাবে।", "v5_home_view_all": "সব দেখুন", "task_recheck": "আবার পরীক্ষা", -"volumes_upload_safe_capacity": "নতুন আপলোডের জন্য নিরাপদ {safe} · সিস্টেম/ফাইলসিস্টেমের জন্য সংরক্ষিত {reserve}", "pkg_storage_fallback_title": "অভ্যন্তরীণ স্টোরেজ ব্যবহার হচ্ছে", "pkg_storage_fallback_body": "ডিফল্ট প্যাকেজ ড্রাইভ ({drive}) উপলব্ধ নয়, তাই এই প্যাকেজ অভ্যন্তরীণ স্টোরেজে যাবে।", "pkglib.meta.drive": "{drive}-এ", @@ -4297,6 +4307,7 @@ trace_profile_name: "{n}টি খেলার সেশন থেকে মা "collection.org_summary": "{n}টি সরানো · {size}", "collection.org_title": "সংগ্রহ সাজান", "collection.org_undo": "ফেরান", +"collection.org_undo_incomplete": "আইটেমগুলো সরানো হয়েছে, কিন্তু আনডু লগ সংরক্ষণ করা যায়নি। আনডু সবকিছু আগের জায়গায় নাও ফেরাতে পারে।", "collection.org_undo_body": "সরানো {n}টি আইটেম তাদের আগের নাম ও ফোল্ডারে ফেরে। পরে সরানো বা নাম বদলানো আইটেম যেখানে আছে সেখানেই থাকে।", "collection.org_undo_title": "এই রানটি ফেরাবেন?", "collection.org_undone": "ফেরানো হয়েছে: {n}টি পুনরুদ্ধার, {problems}টি যেখানে ছিল সেখানে", @@ -4534,6 +4545,7 @@ drive_detail_changed_here: "সিঙ্ক চলাকালে এই ডি drive_detail_changed_there: "সিঙ্ক চলাকালে {console}-এ {path} বদলে গেছে। পরের বার সিঙ্ক হবে।", drive_detail_too_many_files: "{limit}টির বেশি ফাইল: Mesh Drive-এর জন্য অনেক বেশি।", drive_detail_list_unreadable: "এই সংস্করণ কনসোলের ড্রাইভ তালিকা পড়তে পারে না। এই অ্যাপ আপডেট করুন।", +drive_detail_console_list_unreadable: "কনসোল তার ড্রাইভ তালিকা পড়তে পারেনি। পড়তে না পারা পর্যন্ত কিছুই বদলাবে না।", drive_detail_link_record_damaged: "{console}-এ লিংকের রেকর্ড নষ্ট হয়ে গেছে।", drive_detail_too_many_for_console: "দ্বিতীয় কনসোলের ড্রাইভ ফোল্ডারের জন্য অনেক বেশি ফাইল।", drive_removed: "আর এই ড্রাইভে নেই", @@ -4555,6 +4567,8 @@ drive_join: "যোগ দিন", drive_delete_title: "{name} ড্রাইভটি মুছবেন?", drive_delete_body: "প্রতিটি ডিভাইস এটি সিঙ্কে রাখা বন্ধ করবে। কোনো ফাইল মোছা হবে না: প্রতিটি ফোল্ডার, কনসোলেরটিসহ, যা আছে তা রাখবে।", drive_delete: "ড্রাইভ মুছুন", +drive_left_later: "এই ফোল্ডারটি আর সিঙ্ক হয় না। {name} সাড়া দেয়নি: সেটি ফিরে এলে সেখানে ড্রাইভ থেকে এটি সরানো হবে। এর ফাইলগুলো যেখানে আছে সেখানেই থাকবে।", +drive_deleted_later: "ড্রাইভটি আর এই ডিভাইসে রাখা হয় না। {name} সাড়া দেয়নি: সেটি ফিরে এলে সেখানে এটি মোছা হবে। কোনো ফাইল মোছা হয় না।", drive_create: "নতুন মেশ ড্রাইভ", drive_create_go: "তৈরি করুন", drive_title: "মেশ ড্রাইভ", @@ -4616,13 +4630,14 @@ fs_search_all_drives: "সব ড্রাইভে খুঁজুন", fs_more: "আরও", fs_more_actions: "আরও: কী জায়গা নিচ্ছে, স্ন্যাপশট", fs_space_title: "কী জায়গা নিচ্ছে?", +fs_space_here_v2: "এই ফোল্ডারে কী জায়গা নিচ্ছে?", +fs_snapshot_folder_v2: "এই ফোল্ডারের স্ন্যাপশট নিন", +fs_space_drive: "এই ড্রাইভে কী জায়গা নিচ্ছে?", +fs_snapshots_see: "স্ন্যাপশট দেখুন", fs_space_action: "কী জায়গা নিচ্ছে?", -fs_space_here: "এখানে কী জায়গা নিচ্ছে?", fs_space_open_folder: "এই ফোল্ডার খুলুন", -fs_snapshot_folder: "এই ফোল্ডারের স্ন্যাপশট", fs_snapshot_action: "স্ন্যাপশট…", fs_snapshot_tooltip: "PS5-এ রাখা একটি স্ন্যাপশটে কপি করুন, পরে ফিরিয়ে আনতে", -fs_snapshots_open: "স্ন্যাপশট", fs_snapshot_batch: "{count}টি আইটেম, প্রতিটির একটি স্ন্যাপশট, আইটেমের নাম ও আজকের তারিখে:", fs_snapshot_batch_create: "{count}টি স্ন্যাপশট তৈরি করুন", fs_snapshot_batch_ok: "{count}টি স্ন্যাপশট তৈরি: {files}টি ফাইল ({bytes})", @@ -5406,7 +5421,6 @@ upload_phase_settling_eta: "প্রায় {time} বাকি", upload_phase_settling_rate: "ফাইল/সে", upload_status_resuming: "আবার শুরু হচ্ছে: {total}টির মধ্যে {done}টি ফাইল আগে থেকেই আছে ({have}); {send} পাঠানো বাকি।", upload_resumed_have: "আবার শুরু হয়েছে: {have} আগে থেকেই PS5-এ ছিল।", -volumes_kept_by_console: "{kept} কনসোল নিজের ব্যবহারের জন্য রেখেছে", payloads_tab_ps5: "আপনার PS5-এ", payloads_pm_stored_body_v2: "এটি Payload Manager-এর \"{folder}\" ফোল্ডারে আছে। \"আপনার PS5-এ\" ট্যাবের Payload Manager এটি চালু করে বা বুটের সময় লোড করে।", hub_checking: "এই PS5-এ কী আছে দেখা হচ্ছে…", @@ -9013,6 +9027,8 @@ rp_users_add_hint: "অন্য ব্যবহারকারী হিসে "receive_cheats_none": "তারা কোনোটি চালু না রেখে খেলে।", "receive_stream": "স্ট্রিম সেটিংস", "receive_stream_body": "আপনার পাওয়া অন্য জিনিসগুলোর সাথে রাখা হয়েছে।", +"receive_data_unreadable": "এর কিছু অংশ ব্যবহার করা যাবে না", +"receive_data_unreadable_body": "আপনার বন্ধুর পাঠানো কিছু অংশ এমন আকারে নেই যা এই অ্যাপ পড়তে পারে, তাই সেটি বাদ দেওয়া হয়েছে।", "receive_intro_v2": "তাদের লিংক পেস্ট করুন। কিছু আসার আগেই দেখবেন তারা কী দিচ্ছে।", "receive_pick": "কী নেবেন", "receive_total": "মোট {size}", diff --git a/client/src/i18n/locales/de.ts b/client/src/i18n/locales/de.ts index a7a03f583..7e5ed88f7 100644 --- a/client/src/i18n/locales/de.ts +++ b/client/src/i18n/locales/de.ts @@ -191,6 +191,8 @@ update_skipped_note: "Du hast v{version} übersprungen.", update_unskip: "Nicht überspringen", update_toast_installs_on_quit: "wird beim Beenden installiert", update_install_failed_title: "Update nicht installiert", +update_finishing_title: "Update wird abgeschlossen…", +update_finishing_body: "PS5Upload startet danach von selbst neu.", update_install_failed_body: "v{version} konnte nicht installiert werden, PS5Upload läuft weiter mit der alten Version.", update_install_failed_reason: "Grund: {message}", update_quit_app: "PS5Upload beenden", @@ -1021,8 +1023,9 @@ fs_verify_result: "Verifizierungsergebnis", fs_verify_tooltip: "BLAKE3- + CRC32-Prüfung (langsamer, kryptografisch stark)", hardware_storage: "Konsolenspeicher", hw_storage_free: "Frei", -hw_storage_reserved: "Reserviert", -hw_storage_reserved_hint: "Vom Dateisystem reservierter Bereich zählt nicht als frei", +hw_storage_held_back: "Von der PS5 zurückgehalten", +hw_storage_held_back_hint: "In „Belegt“ enthalten. Kein freier Speicher.", +hw_storage_note: "So, wie das Dateisystem des Laufwerks zählt. Der Speicher-Bildschirm der PS5 kann weniger freien Speicher zeigen: Sie hält mehr für das System zurück.", hw_storage_total: "Gesamt", hw_storage_used: "Belegt", klog_clear: "Leeren", @@ -1210,6 +1213,7 @@ pm_autoload_add: "Beim Hochfahren laden", pm_autoload_earlier: "Früher laden", pm_autoload_later: "Später laden", pm_launch: "Starten", +pm_row_more: "Mehr für {name}", pm_detected: "Payload Manager {version} auf der PS5", pm_autoload_title: "Payloads beim Hochfahren laden", pm_autoload_hint: "Der Payload Manager startet die markierten Payloads der Reihe nach {delay} s nach dem Hochfahren der PS5. {n} aufgeführt. Pausen dazwischen bleiben wie im Payload Manager eingestellt.", @@ -1479,6 +1483,7 @@ upload_change_source: "Quelle ändern", upload_choose_diff_source: "Andere Quelle wählen", upload_dest_auto: "(Standard — /data)", upload_dest_card_title: "Ziel", +upload_dest_room: "Platz für etwa {size}", upload_dest_final_path: "Endgültiger Pfad auf der PS5", upload_dest_presets: "Voreinstellungen:", upload_dest_will_create: "Wenn der Zielordner auf der PS5 noch nicht existiert, wird er beim Start des Uploads erstellt.", @@ -2576,6 +2581,9 @@ upload_pkg_name_save: "Namen ändern", upload_pkg_name_all_v2: "Diesen Namen in allen Sprachen verwenden (andere Namen im Paket: {count})", upload_pkg_name_hint: "Ändert den Namen in der Paketdatei selbst, bevor du sie installierst. Ein bereits installiertes Spiel behält seinen Namen, bis du es erneut installierst.", upload_pkg_name_saved: "Name geändert.", +upload_phone_upload_first: "Kopiert es zuerst auf die PS5 und installiert es dann.", +upload_pkg_name_left: "Verbleibende Bytes für den Namen: {count}", +upload_pkg_name_too_long: "Dieser Name ist zu lang für dieses Paket. Bytes, die passen: {limit}. Bytes zu viel: {count}. Kürze ihn: Buchstaben mit Akzenten und nicht lateinische Buchstaben brauchen mehr Platz.", upload_pkg_name_retail: "Dies ist ein offizielles Paket, daher lässt sich sein Name nicht ändern: Der Name ist durch die Signatur des Herausgebers geschützt.", upload_pkg_name_refused: "Der Name dieses Pakets lässt sich nicht ändern: {reason}", upload_pkg_name_failed: "Der Name wurde nicht geändert: {reason}", @@ -2873,6 +2881,9 @@ remote_copy_task_unknown_server: "{name} vom Server kopieren", upload_split_unsupported_title: "Das ist ein geteiltes Archiv ({count} Bände), das ps5upload nicht öffnen kann", upload_split_unsupported_body: "Beim Hochladen landet der rohe Band auf der PS5, die nichts damit anfangen kann. Füge die Bände zuerst wieder zu einem Archiv zusammen: Öffne den ersten Band mit 7-Zip oder WinRAR und entpacke ihn, lade dann den entpackten Ordner oder ein einzelnes Archiv davon hoch.", upload_split_unsupported_target: "Ergibt zusammengefügt: {name}", +volumes_held_back: "{kept} hält die PS5 für sich zurück. Das ist kein freier Speicher und wächst, je mehr geschrieben wird.", +volumes_likely_fits: "Etwa {safe} neue Daten passen hier voraussichtlich hin.", +volumes_ps5_shows_less: "Der Speicher-Bildschirm der PS5 kann weniger freien Speicher zeigen. Wenn beide abweichen, richte dich nach dem kleineren Wert.", // Editing a game image in place (ShadowMount+ checkout) @@ -3297,7 +3308,6 @@ library_mount_tooltip_smp: "Dieses Abbild an ShadowMount+ übergeben, das es ein "v5_home_no_notifications_desc": "Neue Meldungen erscheinen hier.", "v5_home_view_all": "Alle anzeigen", "task_recheck": "Erneut prüfen", -"volumes_upload_safe_capacity": "{safe} sicher für neue Uploads · {reserve} als System-/Dateisystem-Reserve gehalten", "pkg_storage_fallback_title": "Interner Speicher wird verwendet", "pkg_storage_fallback_body": "Das Standard-Paketlaufwerk ({drive}) ist nicht verfügbar, daher landet dieses Paket im internen Speicher.", "pkglib.meta.drive": "auf {drive}", @@ -4305,6 +4315,7 @@ trace_profile_name: "gemessen aus {n} Spielsitzungen", "collection.org_summary": "{n} Verschiebungen · {size}", "collection.org_title": "Sammlung organisieren", "collection.org_undo": "Rückgängig", +"collection.org_undo_incomplete": "Die Elemente wurden verschoben, aber das Rückgängig-Protokoll konnte nicht gespeichert werden. Rückgängig stellt möglicherweise nicht alles wieder her.", "collection.org_undo_body": "Die {n} verschobenen Elemente erhalten ihre ursprünglichen Namen und Ordner zurück. Seitdem verschobene oder umbenannte Elemente bleiben unverändert.", "collection.org_undo_title": "Diesen Lauf rückgängig machen?", "collection.org_undone": "Rückgängig gemacht: {n} wiederhergestellt, {problems} bleiben, wo sie sind", @@ -4542,6 +4553,7 @@ drive_detail_changed_here: "{path} wurde auf diesem Gerät während der Synchron drive_detail_changed_there: "{path} wurde auf {console} während der Synchronisierung geändert. Es wird beim nächsten Mal synchronisiert.", drive_detail_too_many_files: "Mehr als {limit} Dateien: zu viele für ein Mesh Drive.", drive_detail_list_unreadable: "Diese Version kann die Drive-Liste der Konsole nicht lesen. Aktualisiere diese App.", +drive_detail_console_list_unreadable: "Die Konsole konnte ihre Drive-Liste nicht lesen. Bis sie es kann, ändert sich nichts.", drive_detail_link_record_damaged: "Der Datensatz der Verknüpfung auf {console} ist beschädigt.", drive_detail_too_many_for_console: "Zu viele Dateien für einen Drive-Ordner auf einer zweiten Konsole.", drive_removed: "Nicht mehr in diesem Drive", @@ -4563,6 +4575,8 @@ drive_join: "Beitreten", drive_delete_title: "Den Drive {name} löschen?", drive_delete_body: "Kein Gerät hält ihn mehr synchron. Es werden keine Dateien gelöscht: Jeder Ordner, auch der auf der Konsole, behält, was er hat.", drive_delete: "Drive löschen", +drive_left_later: "Dieser Ordner wird nicht mehr synchronisiert. {name} hat nicht geantwortet: Dort wird er aus dem Drive genommen, sobald sie wieder da ist. Seine Dateien bleiben, wo sie sind.", +drive_deleted_later: "Der Drive wird auf diesem Gerät nicht mehr gehalten. {name} hat nicht geantwortet: Dort wird er gelöscht, sobald sie wieder da ist. Es werden keine Dateien gelöscht.", drive_create: "Neues Mesh-Laufwerk", drive_create_go: "Erstellen", drive_title: "Mesh-Laufwerk", @@ -4624,13 +4638,14 @@ fs_search_all_drives: "Alle Laufwerke durchsuchen", fs_more: "Mehr", fs_more_actions: "Mehr: Was Platz belegt, Schnappschüsse", fs_space_title: "Was belegt Platz?", +fs_space_here_v2: "Was belegt Platz in diesem Ordner?", +fs_snapshot_folder_v2: "Schnappschuss dieses Ordners erstellen", +fs_space_drive: "Was belegt Platz auf diesem Laufwerk?", +fs_snapshots_see: "Schnappschüsse ansehen", fs_space_action: "Was belegt Platz?", -fs_space_here: "Was belegt hier Platz?", fs_space_open_folder: "Diesen Ordner öffnen", -fs_snapshot_folder: "Schnappschuss dieses Ordners", fs_snapshot_action: "Schnappschuss…", fs_snapshot_tooltip: "In einen Schnappschuss auf der PS5 kopieren, um es später zurückzuspielen", -fs_snapshots_open: "Schnappschüsse", fs_snapshot_batch: "{count} Elemente, je ein Schnappschuss, benannt nach dem Element und dem heutigen Datum:", fs_snapshot_batch_create: "{count} Schnappschüsse erstellen", fs_snapshot_batch_ok: "{count} Schnappschüsse erstellt: {files} Dateien ({bytes})", @@ -5414,7 +5429,6 @@ upload_phase_settling_eta: "noch etwa {time}", upload_phase_settling_rate: "Dateien/s", upload_status_resuming: "Wird fortgesetzt: {done} von {total} Dateien bereits vorhanden ({have}); {send} zu senden.", upload_resumed_have: "Fortgesetzt: {have} war bereits auf der PS5.", -volumes_kept_by_console: "{kept} von der Konsole für den eigenen Gebrauch reserviert", payloads_tab_ps5: "Auf deiner PS5", payloads_pm_stored_body_v2: "Er liegt im Ordner „{folder}“ von Payload Manager. Payload Manager im Tab „Auf deiner PS5“ startet ihn oder lädt ihn beim Booten.", hub_checking: "Prüfe, was auf dieser PS5 ist…", @@ -9021,6 +9035,8 @@ rp_users_add_hint: "Um auch als anderer Benutzer zu spielen, melde dich auf der "receive_cheats_none": "Er spielt ohne aktive Cheats.", "receive_stream": "Stream-Einstellungen", "receive_stream_body": "Bei den anderen empfangenen Dingen gespeichert.", +"receive_data_unreadable": "Einiges davon ist nicht nutzbar", +"receive_data_unreadable_body": "Ein Teil dessen, was dein Freund geschickt hat, liegt in keiner Form vor, die diese App liest, und wurde weggelassen.", "receive_intro_v2": "Füge den Link ein. Du siehst, was angeboten wird, bevor etwas ankommt.", "receive_pick": "Was übernehmen", "receive_total": "{size} insgesamt", diff --git a/client/src/i18n/locales/en.ts b/client/src/i18n/locales/en.ts index bfabdce4c..f6ab55595 100644 --- a/client/src/i18n/locales/en.ts +++ b/client/src/i18n/locales/en.ts @@ -427,6 +427,8 @@ update_skipped_note: "You skipped v{version}.", update_unskip: "Don't skip", update_toast_installs_on_quit: "installs when you quit", update_install_failed_title: "Update didn't install", +update_finishing_title: "Finishing the update…", +update_finishing_body: "PS5Upload starts again by itself when it is done.", update_install_failed_body: "v{version} couldn't be installed, so PS5Upload is still on the old version.", update_install_failed_reason: "Reason: {message}", update_quit_app: "Quit PS5Upload", @@ -1599,8 +1601,9 @@ fs_verify_result: "Verify result", fs_verify_tooltip: "BLAKE3 + CRC32 verification (slower, crypto-strength)", hardware_storage: "Console Storage", hw_storage_free: "Free", -hw_storage_reserved: "Reserved", -hw_storage_reserved_hint: "FS-kept slice not counted as free", +hw_storage_held_back: "Held back by the PS5", +hw_storage_held_back_hint: "Counted in Used. Not free space.", +hw_storage_note: "As the drive's filesystem counts it. The PS5's own Storage screen can show less free space: it holds more back for the system.", hw_storage_total: "Total", hw_storage_used: "Used", hw_drives_title: "Drives", @@ -1817,6 +1820,7 @@ pm_autoload_add: "Load at boot", pm_autoload_earlier: "Load earlier", pm_autoload_later: "Load later", pm_launch: "Launch", +pm_row_more: "More for {name}", pm_detected: "Payload Manager {version} on the PS5", pm_autoload_title: "Load payloads at boot", pm_autoload_hint: "Payload Manager starts the marked payloads in order {delay}s after the PS5 boots. {n} listed. Pauses between them are kept as set in Payload Manager.", @@ -2477,6 +2481,9 @@ upload_pkg_name_save: "Change name", upload_pkg_name_all_v2: "Use this name in every language (other names in the package: {count})", upload_pkg_name_hint: "Changes the name in the package file itself, before you install it. A game that is already installed keeps its name until you install it again.", upload_pkg_name_saved: "Name changed.", +upload_phone_upload_first: "Copies it to the PS5 first, then installs it.", +upload_pkg_name_left: "Bytes left for the name: {count}", +upload_pkg_name_too_long: "This name is too long for this package. Bytes that fit: {limit}. Bytes over: {count}. Make it shorter: letters with accents and non-Latin letters take more room.", upload_pkg_name_retail: "This is an official package, so its name can't be changed: the name is covered by its publisher's signature.", upload_pkg_name_refused: "This package's name can't be changed: {reason}", upload_pkg_name_failed: "The name was not changed: {reason}", @@ -2600,6 +2607,7 @@ upload_zip_explainer: upload_mount_after_title: "Mount after upload", upload_mount_readonly_title: "Mount read-only", upload_dest_card_title: "Destination", +upload_dest_room: "room for about {size}", upload_dest_auto: "(default — /data)", upload_dest_presets: "Presets:", upload_dest_final_path: "Final path on PS5", @@ -3754,8 +3762,9 @@ remote_copy_task_unknown_server: "Copy {name} from the server", upload_split_unsupported_title: "This is a split archive ({count} volumes) that ps5upload can't open", upload_split_unsupported_body: "Uploading it sends the raw volume to your PS5, which can't use it. Join the volumes back into one archive first — open the first volume with 7-Zip or WinRAR and extract, then upload the extracted folder or a single archive of it.", upload_split_unsupported_target: "Joins into: {name}", -volumes_upload_safe_capacity: "{safe} safe for new uploads · {reserve} kept as system/filesystem headroom", -volumes_kept_by_console: "{kept} kept by the console for its own use", +volumes_held_back: "{kept} is held back by the PS5 for itself. It is not free space, and it grows as data is written.", +volumes_likely_fits: "About {safe} of new data is likely to fit here.", +volumes_ps5_shows_less: "The PS5's own Storage screen can show less free space. When the two differ, go by the smaller one.", net_fix_private: "Private", net_fix_public: "Public", net_fix_make_private: "Make this network Private", @@ -5065,6 +5074,7 @@ trace_profile_name: "measured from {n} play sessions", "collection.org_summary": "{n} moves · {size}", "collection.org_title": "Organize collection", "collection.org_undo": "Undo", +"collection.org_undo_incomplete": "The items were moved, but the undo log could not be saved. Undo may not put everything back.", "collection.org_undo_body": "The {n} moved items return to their original names and folders. Items moved or renamed since then stay where they are.", "collection.org_undo_title": "Undo this run?", "collection.org_undone": "Undone: {n} restored, {problems} left where they are", @@ -5281,6 +5291,7 @@ drive_detail_changed_here: "{path} changed on this device while it was syncing. drive_detail_changed_there: "{path} changed on {console} while it was syncing. It syncs next time.", drive_detail_too_many_files: "More than {limit} files: too many for a Mesh Drive.", drive_detail_list_unreadable: "This version cannot read the console's drive list. Update this app.", +drive_detail_console_list_unreadable: "The console couldn't read its drive list. Nothing changes until it can.", drive_detail_link_record_damaged: "The link's record on {console} is damaged.", drive_detail_too_many_for_console: "Too many files for a drive folder on a second console.", drive_removed: "No longer in this drive", @@ -5302,6 +5313,8 @@ drive_join: "Join", drive_delete_title: "Delete the drive {name}?", drive_delete_body: "Every device stops keeping it in sync. No files are deleted: each folder, and the one on the console, keeps what it has.", drive_delete: "Delete drive", +drive_left_later: "This folder no longer syncs. {name} didn't answer: it's taken out of the drive there when it's back. Its files stay where they are.", +drive_deleted_later: "The drive is no longer kept on this device. {name} didn't answer: it's deleted there when it's back. No files are deleted.", drive_create: "New Mesh Drive", drive_create_go: "Create", drive_title: "Mesh Drive", @@ -5363,13 +5376,14 @@ fs_search_all_drives: "Search all drives", fs_more: "More", fs_more_actions: "More: what takes space, snapshots", fs_space_title: "What takes space?", +fs_space_here_v2: "What takes space in this folder?", +fs_snapshot_folder_v2: "Make a snapshot of this folder", +fs_space_drive: "What takes space on this drive?", +fs_snapshots_see: "See snapshots", fs_space_action: "What takes space?", -fs_space_here: "What takes space here?", fs_space_open_folder: "Open this folder", -fs_snapshot_folder: "Snapshot this folder", fs_snapshot_action: "Snapshot…", fs_snapshot_tooltip: "Copy into a snapshot kept on the PS5, to put back later", -fs_snapshots_open: "Snapshots", fs_snapshot_batch: "{count} items, one snapshot each, named after the item and today's date:", fs_snapshot_batch_create: "Create {count} snapshots", fs_snapshot_batch_ok: "Made {count} snapshots: {files} files ({bytes})", @@ -9326,6 +9340,8 @@ receive_cheats_on: "They play with: {list}", receive_cheats_none: "They play with none on.", receive_stream: "Stream settings", receive_stream_body: "Kept with the other things you received.", +receive_data_unreadable: "Some of it can't be used", +receive_data_unreadable_body: "Part of what your friend sent isn't in a form this app reads, so it was left out.", receive_intro_v2: "Paste their link. You see what they offer before anything arrives.", receive_pick: "What to take", receive_total: "{size} in all", diff --git a/client/src/i18n/locales/es.ts b/client/src/i18n/locales/es.ts index c3976d3be..da2dbe389 100644 --- a/client/src/i18n/locales/es.ts +++ b/client/src/i18n/locales/es.ts @@ -185,6 +185,8 @@ update_skipped_note: "Omitiste v{version}.", update_unskip: "No omitir", update_toast_installs_on_quit: "se instala al salir", update_install_failed_title: "La actualización no se instaló", +update_finishing_title: "Terminando la actualización…", +update_finishing_body: "PS5Upload se abrirá de nuevo solo cuando termine.", update_install_failed_body: "No se pudo instalar la v{version}, así que PS5Upload sigue en la versión anterior.", update_install_failed_reason: "Motivo: {message}", update_quit_app: "Salir de PS5Upload", @@ -1020,8 +1022,9 @@ fs_verify_result: "Resultado de verificación", fs_verify_tooltip: "Verificación BLAKE3 + CRC32 (más lenta, de fuerza criptográfica)", hardware_storage: "Almacenamiento consola", hw_storage_free: "Libre", -hw_storage_reserved: "Reservado", -hw_storage_reserved_hint: "La porción reservada por el sistema de archivos no cuenta como libre", +hw_storage_held_back: "Reservado por la PS5", +hw_storage_held_back_hint: "Incluido en Usado. No es espacio libre.", +hw_storage_note: "Según cuenta el sistema de archivos de la unidad. La pantalla de Almacenamiento de la PS5 puede mostrar menos espacio libre: reserva más para el sistema.", hw_storage_total: "Total", hw_storage_used: "Usado", klog_clear: "Borrar", @@ -1209,6 +1212,7 @@ pm_autoload_add: "Cargar al arrancar", pm_autoload_earlier: "Cargar antes", pm_autoload_later: "Cargar después", pm_launch: "Lanzar", +pm_row_more: "Más para {name}", pm_detected: "Payload Manager {version} en la PS5", pm_autoload_title: "Cargar payloads al arrancar", pm_autoload_hint: "Payload Manager inicia los payloads marcados en orden {delay} s después de arrancar la PS5. {n} en la lista. Las pausas entre ellos se mantienen como estén en Payload Manager.", @@ -1478,6 +1482,7 @@ upload_change_source: "Cambiar origen", upload_choose_diff_source: "Elegir una fuente diferente", upload_dest_auto: "(predeterminado — /data)", upload_dest_card_title: "Destino", +upload_dest_room: "espacio para unos {size}", upload_dest_final_path: "Ruta final en la PS5", upload_dest_presets: "Preajustes:", upload_dest_will_create: "Si la carpeta de destino aún no existe en la PS5, se creará al iniciar la subida.", @@ -2521,6 +2526,9 @@ upload_pkg_name_save: "Cambiar nombre", upload_pkg_name_all_v2: "Usar este nombre en todos los idiomas (otros nombres en el paquete: {count})", upload_pkg_name_hint: "Cambia el nombre en el propio archivo del paquete, antes de instalarlo. Un juego ya instalado conserva su nombre hasta que lo instales de nuevo.", upload_pkg_name_saved: "Nombre cambiado.", +upload_phone_upload_first: "Primero lo copia a la PS5 y luego lo instala.", +upload_pkg_name_left: "Bytes restantes para el nombre: {count}", +upload_pkg_name_too_long: "Este nombre es demasiado largo para este paquete. Bytes que caben: {limit}. Bytes de más: {count}. Acórtalo: las letras con acento y las no latinas ocupan más espacio.", upload_pkg_name_retail: "Este es un paquete oficial, así que no se puede cambiar su nombre: el nombre está cubierto por la firma de su editor.", upload_pkg_name_refused: "No se puede cambiar el nombre de este paquete: {reason}", upload_pkg_name_failed: "El nombre no se cambió: {reason}", @@ -2818,6 +2826,9 @@ remote_copy_task_unknown_server: "Copiar {name} del servidor", upload_split_unsupported_title: "Este es un archivo dividido ({count} volúmenes) que ps5upload no puede abrir", upload_split_unsupported_body: "Subirlo envía el volumen en bruto a tu PS5, que no puede usarlo. Primero une los volúmenes en un solo archivo: abre el primero con 7-Zip o WinRAR y extrae, luego sube la carpeta extraída o un único archivo con ella.", upload_split_unsupported_target: "Se une en: {name}", +volumes_held_back: "La PS5 reserva {kept} para sí. No es espacio libre y crece a medida que se escriben datos.", +volumes_likely_fits: "Es probable que quepan aquí unos {safe} de datos nuevos.", +volumes_ps5_shows_less: "La pantalla de Almacenamiento de la PS5 puede mostrar menos espacio libre. Si no coinciden, guíate por la cifra menor.", // Editing a game image in place (ShadowMount+ checkout) @@ -3242,7 +3253,6 @@ library_mount_tooltip_smp: "Entregar esta imagen a ShadowMount+, que la monta y "v5_home_no_notifications_desc": "Las nuevas alertas aparecerán aquí.", "v5_home_view_all": "Ver todo", "task_recheck": "Volver a comprobar", -"volumes_upload_safe_capacity": "{safe} seguros para nuevas subidas · {reserve} reservados como margen del sistema/sistema de archivos", "pkg_storage_fallback_title": "Usando el almacenamiento interno", "pkg_storage_fallback_body": "La unidad de paquetes predeterminada ({drive}) no está disponible, así que este paquete va al almacenamiento interno.", "pkglib.meta.drive": "en {drive}", @@ -4250,6 +4260,7 @@ trace_profile_name: "medido en {n} sesiones de juego", "collection.org_summary": "{n} movimientos · {size}", "collection.org_title": "Organizar colección", "collection.org_undo": "Deshacer", +"collection.org_undo_incomplete": "Los elementos se movieron, pero no se pudo guardar el registro para deshacer. Es posible que Deshacer no devuelva todo a su sitio.", "collection.org_undo_body": "Los {n} elementos movidos recuperan sus nombres y carpetas originales. Los movidos o renombrados después permanecen donde están.", "collection.org_undo_title": "¿Deshacer esta ejecución?", "collection.org_undone": "Deshecho: {n} restaurados, {problems} se quedan donde están", @@ -4487,6 +4498,7 @@ drive_detail_changed_here: "{path} cambió en este dispositivo mientras se sincr drive_detail_changed_there: "{path} cambió en {console} mientras se sincronizaba. Se sincronizará la próxima vez.", drive_detail_too_many_files: "Más de {limit} archivos: demasiados para un Mesh Drive.", drive_detail_list_unreadable: "Esta versión no puede leer la lista de drives de la consola. Actualiza esta app.", +drive_detail_console_list_unreadable: "La consola no pudo leer su lista de drives. Nada cambia hasta que pueda.", drive_detail_link_record_damaged: "El registro del enlace en {console} está dañado.", drive_detail_too_many_for_console: "Demasiados archivos para una carpeta de drive en una segunda consola.", drive_removed: "Ya no está en este drive", @@ -4508,6 +4520,8 @@ drive_join: "Unirse", drive_delete_title: "¿Eliminar el drive {name}?", drive_delete_body: "Ningún dispositivo lo seguirá sincronizando. No se borra ningún archivo: cada carpeta, y la de la consola, conserva lo que tiene.", drive_delete: "Eliminar drive", +drive_left_later: "Esta carpeta ya no se sincroniza. {name} no respondió: allí se quitará del drive cuando vuelva. Sus archivos se quedan donde están.", +drive_deleted_later: "El drive ya no se mantiene en este dispositivo. {name} no respondió: allí se borrará cuando vuelva. No se borra ningún archivo.", drive_create: "Nueva unidad Mesh", drive_create_go: "Crear", drive_title: "Unidad Mesh", @@ -4569,13 +4583,14 @@ fs_search_all_drives: "Buscar en todas las unidades", fs_more: "Más", fs_more_actions: "Más: qué ocupa espacio, instantáneas", fs_space_title: "¿Qué ocupa espacio?", +fs_space_here_v2: "¿Qué ocupa espacio en esta carpeta?", +fs_snapshot_folder_v2: "Hacer una instantánea de esta carpeta", +fs_space_drive: "¿Qué ocupa espacio en esta unidad?", +fs_snapshots_see: "Ver instantáneas", fs_space_action: "¿Qué ocupa espacio?", -fs_space_here: "¿Qué ocupa espacio aquí?", fs_space_open_folder: "Abrir esta carpeta", -fs_snapshot_folder: "Instantánea de esta carpeta", fs_snapshot_action: "Instantánea…", fs_snapshot_tooltip: "Copiar en una instantánea guardada en la PS5, para restaurarla después", -fs_snapshots_open: "Instantáneas", fs_snapshot_batch: "{count} elementos, una instantánea cada uno, con el nombre del elemento y la fecha de hoy:", fs_snapshot_batch_create: "Crear {count} instantáneas", fs_snapshot_batch_ok: "{count} instantáneas creadas: {files} archivos ({bytes})", @@ -5359,7 +5374,6 @@ upload_phase_settling_eta: "quedan unos {time}", upload_phase_settling_rate: "archivos/s", upload_status_resuming: "Reanudando: {done} de {total} archivos ya presentes ({have}); {send} por enviar.", upload_resumed_have: "Reanudado: {have} ya estaba en la PS5.", -volumes_kept_by_console: "{kept} reservados por la consola para su propio uso", payloads_tab_ps5: "En tu PS5", payloads_pm_stored_body_v2: "Está en la carpeta \"{folder}\" de Payload Manager. Payload Manager, en la pestaña En tu PS5, lo inicia o lo carga al arrancar.", hub_checking: "Comprobando qué hay en esta PS5…", @@ -8966,6 +8980,8 @@ rp_users_add_hint: "Para jugar también como otro usuario, inicia sesión con es "receive_cheats_none": "Juega sin ninguno activado.", "receive_stream": "Ajustes de transmisión", "receive_stream_body": "Guardados con las demás cosas que recibiste.", +"receive_data_unreadable": "Parte no se puede usar", +"receive_data_unreadable_body": "Parte de lo que envió tu amigo no está en un formato que esta app lea, así que se dejó fuera.", "receive_intro_v2": "Pega su enlace. Verás lo que ofrece antes de que llegue nada.", "receive_pick": "Qué recibir", "receive_total": "{size} en total", diff --git a/client/src/i18n/locales/fa.ts b/client/src/i18n/locales/fa.ts index bf9754376..75802879c 100644 --- a/client/src/i18n/locales/fa.ts +++ b/client/src/i18n/locales/fa.ts @@ -397,6 +397,8 @@ update_skipped_note: "از v{version} گذشتید.", update_unskip: "نگذر", update_toast_installs_on_quit: "هنگام خروج نصب می‌شود", update_install_failed_title: "به‌روزرسانی نصب نشد", +update_finishing_title: "در حال پایان دادن به‌روزرسانی…", +update_finishing_body: "پس از پایان، PS5Upload خودش دوباره باز می‌شود.", update_install_failed_body: "نصب v{version} ممکن نشد، پس PS5Upload هنوز روی نسخهٔ قدیمی است.", update_install_failed_reason: "دلیل: {message}", update_quit_app: "خروج از PS5Upload", @@ -1503,8 +1505,9 @@ fs_verify_result: "نتیجه‌ی تأیید", fs_verify_tooltip: "تأیید BLAKE3 + CRC32 (کندتر، قدرت رمزنگاری)", hardware_storage: "حافظه‌ی کنسول", hw_storage_free: "خالی", -hw_storage_reserved: "رزرو‌شده", -hw_storage_reserved_hint: "بخش حفظ‌شده‌ی FS که به‌عنوان خالی محاسبه نمی‌شود", +hw_storage_held_back: "نگه‌داشته‌شده توسط PS5", +hw_storage_held_back_hint: "جزو استفاده‌شده حساب می‌شود. فضای آزاد نیست.", +hw_storage_note: "آن‌طور که سیستم فایل درایو می‌شمارد. صفحهٔ Storage خود PS5 ممکن است فضای آزاد کمتری نشان دهد: برای سیستم فضای بیشتری نگه می‌دارد.", hw_storage_total: "کل", hw_storage_used: "استفاده‌شده", hw_drives_title: "درایوها", @@ -1712,6 +1715,7 @@ pm_autoload_add: "بارگذاری هنگام بوت", pm_autoload_earlier: "زودتر بارگذاری شود", pm_autoload_later: "دیرتر بارگذاری شود", pm_launch: "اجرا", +pm_row_more: "بیشتر برای {name}", pm_detected: "Payload Manager {version} روی PS5", pm_autoload_title: "بارگذاری پی‌لودها هنگام بوت", pm_autoload_hint: "Payload Manager پی‌لودهای علامت‌خورده را {delay} ثانیه پس از بوت PS5 به ترتیب اجرا می‌کند. {n} در فهرست. مکث‌های بین آن‌ها طبق تنظیم Payload Manager می‌ماند.", @@ -2316,6 +2320,9 @@ upload_pkg_name_save: "تغییر نام", upload_pkg_name_all_v2: "این نام در همه زبان‌ها استفاده شود (نام‌های دیگر در بسته: {count})", upload_pkg_name_hint: "نام را در خود فایل بسته، پیش از نصب، تغییر می‌دهد. بازی‌ای که قبلاً نصب شده تا نصب دوباره همان نام را نگه می‌دارد.", upload_pkg_name_saved: "نام تغییر کرد.", +upload_phone_upload_first: "اول آن را در PS5 کپی می‌کند، سپس نصب می‌کند.", +upload_pkg_name_left: "بایت‌های باقی‌مانده برای نام: {count}", +upload_pkg_name_too_long: "این نام برای این بسته خیلی بلند است. بایت‌هایی که جا می‌شود: {limit}. بایت‌های اضافی: {count}. آن را کوتاه‌تر کنید: حروف غیرلاتین و حروف علامت‌دار جای بیشتری می‌گیرند.", upload_pkg_name_retail: "این یک بسته رسمی است، پس نامش را نمی‌توان تغییر داد: نام زیر امضای ناشر آن است.", upload_pkg_name_refused: "نام این بسته را نمی‌توان تغییر داد: {reason}", upload_pkg_name_failed: "نام تغییر نکرد: {reason}", @@ -2435,6 +2442,7 @@ upload_zip_explainer: upload_mount_after_title: "اتصال پس از بارگذاری", upload_mount_readonly_title: "اتصال فقط‌خواندنی", upload_dest_card_title: "مقصد", +upload_dest_room: "جا برای حدود {size}", upload_dest_auto: "(پیش‌فرض — /data)", upload_dest_presets: "پیش‌تنظیم‌ها:", upload_dest_final_path: "مسیر نهایی روی PS5", @@ -3479,7 +3487,9 @@ remote_copy_task_unknown_server: "کپی {name} از سرور", upload_split_unsupported_title: "این یک آرشیو تقسیم‌شده ({count} جلد) است که ps5upload نمی‌تواند باز کند", upload_split_unsupported_body: "بارگذاری آن جلد خام را به PS5 شما می‌فرستد که نمی‌تواند از آن استفاده کند. ابتدا جلدها را به یک آرشیو واحد بازگردانید — جلد اول را با 7-Zip یا WinRAR باز و استخراج کنید، سپس پوشه‌ی استخراج‌شده یا یک آرشیو واحد از آن را بارگذاری کنید.", upload_split_unsupported_target: "در این ادغام می‌شود: {name}", -volumes_upload_safe_capacity: "{safe} امن برای بارگذاری‌های جدید · {reserve} به‌عنوان فضای تنفس سیستم/فایل‌سیستم نگه‌داشته شد", +volumes_held_back: "PS5 مقدار {kept} را برای خودش نگه می‌دارد. این فضای آزاد نیست و با نوشتن داده بیشتر می‌شود.", +volumes_likely_fits: "احتمالاً حدود {safe} دادهٔ جدید اینجا جا می‌شود.", +volumes_ps5_shows_less: "صفحهٔ Storage خود PS5 ممکن است فضای آزاد کمتری نشان دهد. اگر دو عدد فرق داشتند، عدد کوچک‌تر را ملاک بگیرید.", "pkg_storage_fallback_title": "استفاده از حافظه‌ی داخلی", "pkg_storage_fallback_body": "درایو پیش‌فرض بسته ({drive}) در دسترس نیست، بنابراین این بسته به حافظه‌ی داخلی می‌رود.", "pkglib.meta.drive": "روی {drive}", @@ -4604,6 +4614,7 @@ trace_profile_name: "سنجیده‌شده از {n} جلسهٔ بازی", "collection.org_summary": "{n} جابه‌جایی · {size}", "collection.org_title": "مرتب‌سازی مجموعه", "collection.org_undo": "بازگردانی", +"collection.org_undo_incomplete": "موارد جابه‌جا شدند، اما گزارش واگرد ذخیره نشد. ممکن است واگرد همه‌چیز را برنگرداند.", "collection.org_undo_body": "{n} مورد جابه‌جا شده به نام و پوشهٔ اصلی بازمی‌گردند. مواردی که بعداً جابه‌جا یا تغییر نام داده شده‌اند در جای خود می‌مانند.", "collection.org_undo_title": "این اجرا بازگردانده شود؟", "collection.org_undone": "بازگردانده شد: {n} بازیابی شد، {problems} سر جایش ماند", @@ -4841,6 +4852,7 @@ drive_detail_changed_here: "{path} هنگام همگام‌سازی در این drive_detail_changed_there: "{path} هنگام همگام‌سازی در {console} تغییر کرد. دفعهٔ بعد همگام می‌شود.", drive_detail_too_many_files: "بیش از {limit} فایل: برای یک Mesh Drive بیش از حد است.", drive_detail_list_unreadable: "این نسخه نمی‌تواند فهرست درایوهای کنسول را بخواند. این برنامه را به‌روزرسانی کنید.", +drive_detail_console_list_unreadable: "کنسول نتوانست فهرست درایوهای خود را بخواند. تا وقتی بتواند، چیزی تغییر نمی‌کند.", drive_detail_link_record_damaged: "رکورد پیوند روی {console} خراب است.", drive_detail_too_many_for_console: "فایل‌ها برای پوشهٔ درایو روی کنسول دوم بیش از حد است.", drive_removed: "دیگر در این درایو نیست", @@ -4862,6 +4874,8 @@ drive_join: "پیوستن", drive_delete_title: "درایو {name} حذف شود؟", drive_delete_body: "هیچ دستگاهی دیگر آن را همگام نگه نمی‌دارد. هیچ فایلی حذف نمی‌شود: هر پوشه، از جمله پوشهٔ روی کنسول، آنچه دارد را نگه می‌دارد.", drive_delete: "حذف درایو", +drive_left_later: "این پوشه دیگر همگام نمی‌شود. {name} پاسخ نداد: وقتی برگردد، آنجا از درایو بیرون گذاشته می‌شود. فایل‌هایش همان‌جا می‌مانند.", +drive_deleted_later: "این درایو دیگر روی این دستگاه نگه داشته نمی‌شود. {name} پاسخ نداد: وقتی برگردد، آنجا حذف می‌شود. هیچ فایلی حذف نمی‌شود.", drive_create: "درایو Mesh تازه", drive_create_go: "ایجاد", drive_title: "درایو Mesh", @@ -4923,13 +4937,14 @@ fs_search_all_drives: "جستجو در همه درایوها", fs_more: "بیشتر", fs_more_actions: "بیشتر: چه چیزی فضا گرفته، اسنپ‌شات‌ها", fs_space_title: "چه چیزی فضا گرفته؟", +fs_space_here_v2: "چه چیزی در این پوشه فضا گرفته است؟", +fs_snapshot_folder_v2: "گرفتن اسنپ‌شات از این پوشه", +fs_space_drive: "چه چیزی روی این درایو فضا گرفته است؟", +fs_snapshots_see: "دیدن اسنپ‌شات‌ها", fs_space_action: "چه چیزی فضا گرفته؟", -fs_space_here: "اینجا چه چیزی فضا گرفته؟", fs_space_open_folder: "باز کردن این پوشه", -fs_snapshot_folder: "اسنپ‌شات از این پوشه", fs_snapshot_action: "اسنپ‌شات…", fs_snapshot_tooltip: "کپی در یک اسنپ‌شات روی PS5، برای بازگرداندن بعدی", -fs_snapshots_open: "اسنپ‌شات‌ها", fs_snapshot_batch: "{count} مورد، برای هر کدام یک اسنپ‌شات، به نام مورد و تاریخ امروز:", fs_snapshot_batch_create: "ساخت {count} اسنپ‌شات", fs_snapshot_batch_ok: "{count} اسنپ‌شات ساخته شد: {files} فایل ({bytes})", @@ -5684,7 +5699,6 @@ save_backup_show_all: "نمایش همهٔ {n} مورد", upload_phase_settling_count: "{left} از {total} فایل مانده", upload_phase_settling_eta: "حدود {time} مانده", upload_phase_settling_rate: "فایل/ثانیه", -volumes_kept_by_console: "{kept} را کنسول برای استفاده‌ی خودش نگه داشته", payloads_tab_ps5: "روی PS5 شما", payloads_pm_stored_body_v2: "در پوشهٔ «{folder}» در Payload Manager قرار دارد. Payload Manager در زبانهٔ «روی PS5 شما» آن را اجرا می‌کند یا هنگام راه‌اندازی بارگذاری می‌کند.", hub_checking: "در حال بررسی محتوای این PS5…", @@ -9291,6 +9305,8 @@ rp_users_add_hint: "برای بازی به‌عنوان کاربری دیگر ن "receive_cheats_none": "بدون روشن کردن هیچ‌کدام بازی می‌کند.", "receive_stream": "تنظیمات استریم", "receive_stream_body": "همراه با چیزهای دیگری که دریافت کرده‌اید نگه داشته می‌شود.", +"receive_data_unreadable": "بخشی از آن قابل استفاده نیست", +"receive_data_unreadable_body": "بخشی از آنچه دوستتان فرستاد در قالبی نیست که این برنامه بخواند، برای همین کنار گذاشته شد.", "receive_intro_v2": "پیوندشان را بچسبانید. پیش از رسیدن هر چیزی، می‌بینید چه پیشنهاد می‌دهند.", "receive_pick": "چه چیزی برداریم", "receive_total": "در مجموع {size}", diff --git a/client/src/i18n/locales/fr.ts b/client/src/i18n/locales/fr.ts index c39ef5de5..063dece42 100644 --- a/client/src/i18n/locales/fr.ts +++ b/client/src/i18n/locales/fr.ts @@ -185,6 +185,8 @@ update_skipped_note: "Vous avez ignoré la v{version}.", update_unskip: "Ne plus ignorer", update_toast_installs_on_quit: "s'installe en quittant", update_install_failed_title: "La mise à jour ne s'est pas installée", +update_finishing_title: "Fin de la mise à jour…", +update_finishing_body: "PS5Upload redémarre tout seul une fois terminé.", update_install_failed_body: "La v{version} n'a pas pu être installée : PS5Upload reste sur l'ancienne version.", update_install_failed_reason: "Raison : {message}", update_quit_app: "Quitter PS5Upload", @@ -1020,8 +1022,9 @@ fs_verify_result: "Résultat vérif.", fs_verify_tooltip: "Vérification BLAKE3 + CRC32 (plus lente, de niveau cryptographique)", hardware_storage: "Stockage console", hw_storage_free: "Libre", -hw_storage_reserved: "Réservé", -hw_storage_reserved_hint: "La tranche réservée par le système de fichiers n'est pas comptée comme libre", +hw_storage_held_back: "Retenu par la PS5", +hw_storage_held_back_hint: "Compté dans Utilisé. Ce n'est pas de l'espace libre.", +hw_storage_note: "Tel que le compte le système de fichiers du disque. L'écran Stockage de la PS5 peut afficher moins d'espace libre : elle en retient davantage pour le système.", hw_storage_total: "Total", hw_storage_used: "Utilisé", klog_clear: "Effacer", @@ -1209,6 +1212,7 @@ pm_autoload_add: "Charger au démarrage", pm_autoload_earlier: "Charger plus tôt", pm_autoload_later: "Charger plus tard", pm_launch: "Lancer", +pm_row_more: "Plus pour {name}", pm_detected: "Payload Manager {version} sur la PS5", pm_autoload_title: "Charger des payloads au démarrage", pm_autoload_hint: "Payload Manager démarre les payloads marqués dans l'ordre {delay} s après le démarrage de la PS5. {n} listés. Les pauses entre eux restent telles que réglées dans Payload Manager.", @@ -1478,6 +1482,7 @@ upload_change_source: "Changer de source", upload_choose_diff_source: "Choisir une autre source", upload_dest_auto: "(par défaut — /data)", upload_dest_card_title: "Destination", +upload_dest_room: "de la place pour environ {size}", upload_dest_final_path: "Chemin final sur la PS5", upload_dest_presets: "Préréglages :", upload_dest_will_create: "Si le dossier de destination n'existe pas encore sur la PS5, il sera créé au démarrage de l'envoi.", @@ -2584,6 +2589,9 @@ upload_pkg_name_save: "Changer le nom", upload_pkg_name_all_v2: "Utiliser ce nom dans toutes les langues (autres noms dans le paquet : {count})", upload_pkg_name_hint: "Change le nom dans le fichier du paquet lui-même, avant l'installation. Un jeu déjà installé garde son nom jusqu'à ce que vous l'installiez de nouveau.", upload_pkg_name_saved: "Nom changé.", +upload_phone_upload_first: "Le copie d'abord sur la PS5, puis l'installe.", +upload_pkg_name_left: "Octets restants pour le nom : {count}", +upload_pkg_name_too_long: "Ce nom est trop long pour ce paquet. Octets disponibles : {limit}. Octets en trop : {count}. Raccourcissez-le : les lettres accentuées et non latines prennent plus de place.", upload_pkg_name_retail: "C'est un paquet officiel, son nom ne peut donc pas être changé : le nom est couvert par la signature de son éditeur.", upload_pkg_name_refused: "Le nom de ce paquet ne peut pas être changé : {reason}", upload_pkg_name_failed: "Le nom n'a pas été changé : {reason}", @@ -2891,6 +2899,9 @@ remote_copy_task_unknown_server: "Copier {name} depuis le serveur", upload_split_unsupported_title: "Ceci est une archive fractionnée ({count} volumes) que ps5upload ne peut pas ouvrir", upload_split_unsupported_body: "L'envoyer transmet le volume brut à votre PS5, qui ne peut rien en faire. Réunissez d'abord les volumes en une seule archive : ouvrez le premier volume avec 7-Zip ou WinRAR et extrayez, puis envoyez le dossier extrait ou une archive unique.", upload_split_unsupported_target: "Se réunit en : {name}", +volumes_held_back: "{kept} sont retenus par la PS5 pour elle-même. Ce n'est pas de l'espace libre, et cela augmente à mesure que des données sont écrites.", +volumes_likely_fits: "Environ {safe} de nouvelles données devraient tenir ici.", +volumes_ps5_shows_less: "L'écran Stockage de la PS5 peut afficher moins d'espace libre. Si les deux diffèrent, fiez-vous au plus petit.", // Editing a game image in place (ShadowMount+ checkout) @@ -3315,7 +3326,6 @@ library_mount_tooltip_smp: "Confier cette image à ShadowMount+, qui la monte et "v5_home_no_notifications_desc": "Les nouvelles alertes apparaîtront ici.", "v5_home_view_all": "Tout voir", "task_recheck": "Revérifier", -"volumes_upload_safe_capacity": "{safe} sûrs pour de nouveaux envois · {reserve} gardés comme marge système/système de fichiers", "pkg_storage_fallback_title": "Stockage interne utilisé", "pkg_storage_fallback_body": "Le disque de paquets par défaut ({drive}) n’est pas disponible, ce paquet va donc dans le stockage interne.", "pkglib.meta.drive": "sur {drive}", @@ -4313,6 +4323,7 @@ trace_profile_name: "mesuré sur {n} sessions de jeu", "collection.org_summary": "{n} déplacements · {size}", "collection.org_title": "Organiser la collection", "collection.org_undo": "Annuler", +"collection.org_undo_incomplete": "Les éléments ont été déplacés, mais le journal d’annulation n’a pas pu être enregistré. Annuler peut ne pas tout remettre en place.", "collection.org_undo_body": "Les {n} éléments déplacés retrouvent leurs noms et dossiers d’origine. Ceux déplacés ou renommés depuis restent en place.", "collection.org_undo_title": "Annuler cette exécution ?", "collection.org_undone": "Annulé : {n} restaurés, {problems} laissés où ils sont", @@ -4550,6 +4561,7 @@ drive_detail_changed_here: "{path} a changé sur cet appareil pendant sa synchro drive_detail_changed_there: "{path} a changé sur {console} pendant sa synchronisation. Il sera synchronisé la prochaine fois.", drive_detail_too_many_files: "Plus de {limit} fichiers : trop pour un Mesh Drive.", drive_detail_list_unreadable: "Cette version ne peut pas lire la liste des drives de la console. Mettez cette application à jour.", +drive_detail_console_list_unreadable: "La console n'a pas pu lire sa liste des drives. Rien ne change tant qu'elle n'y arrive pas.", drive_detail_link_record_damaged: "L'enregistrement du lien sur {console} est endommagé.", drive_detail_too_many_for_console: "Trop de fichiers pour un dossier de drive sur une seconde console.", drive_removed: "Ne fait plus partie de ce drive", @@ -4571,6 +4583,8 @@ drive_join: "Rejoindre", drive_delete_title: "Supprimer le drive {name} ?", drive_delete_body: "Tous les appareils arrêtent de le synchroniser. Aucun fichier n’est supprimé : chaque dossier, y compris celui de la console, garde ce qu’il contient.", drive_delete: "Supprimer le drive", +drive_left_later: "Ce dossier n’est plus synchronisé. {name} n’a pas répondu : il sera retiré du drive là-bas à son retour. Ses fichiers restent où ils sont.", +drive_deleted_later: "Le drive n’est plus gardé sur cet appareil. {name} n’a pas répondu : il sera supprimé là-bas à son retour. Aucun fichier n’est supprimé.", drive_create: "Nouveau disque Mesh", drive_create_go: "Créer", drive_title: "Disque Mesh", @@ -4632,13 +4646,14 @@ fs_search_all_drives: "Rechercher sur tous les disques", fs_more: "Plus", fs_more_actions: "Plus : ce qui prend de la place, instantanés", fs_space_title: "Qu'est-ce qui prend de la place ?", +fs_space_here_v2: "Qu'est-ce qui prend de la place dans ce dossier ?", +fs_snapshot_folder_v2: "Faire un instantané de ce dossier", +fs_space_drive: "Qu'est-ce qui prend de la place sur ce disque ?", +fs_snapshots_see: "Voir les instantanés", fs_space_action: "Qu'est-ce qui prend de la place ?", -fs_space_here: "Qu'est-ce qui prend de la place ici ?", fs_space_open_folder: "Ouvrir ce dossier", -fs_snapshot_folder: "Instantané de ce dossier", fs_snapshot_action: "Instantané…", fs_snapshot_tooltip: "Copier dans un instantané gardé sur la PS5, pour le remettre plus tard", -fs_snapshots_open: "Instantanés", fs_snapshot_batch: "{count} éléments, un instantané chacun, nommé d'après l'élément et la date du jour :", fs_snapshot_batch_create: "Créer {count} instantanés", fs_snapshot_batch_ok: "{count} instantanés créés : {files} fichiers ({bytes})", @@ -5422,7 +5437,6 @@ upload_phase_settling_eta: "environ {time} restant", upload_phase_settling_rate: "fichiers/s", upload_status_resuming: "Reprise : {done} fichiers sur {total} déjà présents ({have}) ; {send} à envoyer.", upload_resumed_have: "Reprise : {have} était déjà sur la PS5.", -volumes_kept_by_console: "{kept} réservés par la console pour son propre usage", payloads_tab_ps5: "Sur ta PS5", payloads_pm_stored_body_v2: "Il se trouve dans le dossier « {folder} » de Payload Manager. Payload Manager, dans l'onglet Sur ta PS5, le lance ou le charge au démarrage.", hub_checking: "Vérification de ce qui se trouve sur cette PS5…", @@ -9029,6 +9043,8 @@ rp_users_add_hint: "Pour jouer aussi avec un autre utilisateur, connectez-vous "receive_cheats_none": "Il joue sans aucun code activé.", "receive_stream": "Réglages du flux", "receive_stream_body": "Gardés avec les autres éléments reçus.", +"receive_data_unreadable": "Une partie est inutilisable", +"receive_data_unreadable_body": "Une partie de ce que ton ami a envoyé n'est pas dans un format que cette app lit, elle a donc été laissée de côté.", "receive_intro_v2": "Collez son lien. Vous voyez ce qui est proposé avant que rien n'arrive.", "receive_pick": "Quoi prendre", "receive_total": "{size} au total", diff --git a/client/src/i18n/locales/hi.ts b/client/src/i18n/locales/hi.ts index 100a8ea57..0a49545cd 100644 --- a/client/src/i18n/locales/hi.ts +++ b/client/src/i18n/locales/hi.ts @@ -190,6 +190,8 @@ update_skipped_note: "आपने v{version} छोड़ दिया।", update_unskip: "न छोड़ें", update_toast_installs_on_quit: "बंद करने पर इंस्टॉल होगा", update_install_failed_title: "अपडेट इंस्टॉल नहीं हुआ", +update_finishing_title: "अपडेट पूरा हो रहा है…", +update_finishing_body: "पूरा होने पर PS5Upload अपने आप फिर से शुरू होगा।", update_install_failed_body: "v{version} इंस्टॉल नहीं हो सका, इसलिए PS5Upload अभी पुराने वर्ज़न पर है।", update_install_failed_reason: "कारण: {message}", update_quit_app: "PS5Upload बंद करें", @@ -1021,8 +1023,9 @@ fs_verify_result: "सत्यापन परिणाम", fs_verify_tooltip: "BLAKE3 + CRC32 सत्यापन (धीमा, क्रिप्टोग्राफ़िक मज़बूती वाला)", hardware_storage: "कंसोल स्टोरेज", hw_storage_free: "खाली", -hw_storage_reserved: "आरक्षित", -hw_storage_reserved_hint: "फ़ाइल सिस्टम द्वारा सुरक्षित रखा गया हिस्सा खाली जगह में नहीं गिना जाता", +hw_storage_held_back: "PS5 द्वारा रोका गया", +hw_storage_held_back_hint: "उपयोग में गिना गया। यह खाली जगह नहीं है।", +hw_storage_note: "जैसा ड्राइव का फ़ाइल सिस्टम गिनता है। PS5 की अपनी Storage स्क्रीन कम खाली जगह दिखा सकती है: वह सिस्टम के लिए और जगह रोकता है।", hw_storage_total: "कुल", hw_storage_used: "उपयोग किया", klog_clear: "साफ़ करें", @@ -1210,6 +1213,7 @@ pm_autoload_add: "बूट पर लोड करें", pm_autoload_earlier: "पहले लोड करें", pm_autoload_later: "बाद में लोड करें", pm_launch: "चलाएँ", +pm_row_more: "{name} के लिए और", pm_detected: "PS5 पर Payload Manager {version}", pm_autoload_title: "बूट पर पेलोड लोड करें", pm_autoload_hint: "Payload Manager चिह्नित पेलोड PS5 बूट के {delay} सेकंड बाद क्रम से चलाता है। {n} सूचीबद्ध। बीच के विराम Payload Manager में सेट किए अनुसार रहते हैं।", @@ -1479,6 +1483,7 @@ upload_change_source: "स्रोत बदलें", upload_choose_diff_source: "एक अलग स्रोत चुनें", upload_dest_auto: "(डिफ़ॉल्ट — /data)", upload_dest_card_title: "गंतव्य", +upload_dest_room: "लगभग {size} की जगह", upload_dest_final_path: "PS5 पर अंतिम पथ", upload_dest_presets: "प्रीसेट:", upload_dest_will_create: "यदि गंतव्य फ़ोल्डर अभी PS5 पर मौजूद नहीं है, तो अपलोड शुरू करने पर इसे बनाया जाएगा।", @@ -2582,6 +2587,9 @@ upload_pkg_name_save: "नाम बदलें", upload_pkg_name_all_v2: "हर भाषा में यही नाम रखें (पैकेज में दूसरे नाम: {count})", upload_pkg_name_hint: "इंस्टॉल करने से पहले पैकेज फ़ाइल के अंदर ही नाम बदलता है। पहले से इंस्टॉल गेम का नाम तब तक वही रहता है जब तक आप उसे दोबारा इंस्टॉल नहीं करते।", upload_pkg_name_saved: "नाम बदल गया।", +upload_phone_upload_first: "पहले इसे PS5 पर कॉपी करता है, फिर इंस्टॉल करता है।", +upload_pkg_name_left: "नाम के लिए बचे बाइट: {count}", +upload_pkg_name_too_long: "यह नाम इस पैकेज के लिए बहुत लंबा है। जितने बाइट आ सकते हैं: {limit}। अतिरिक्त बाइट: {count}। इसे छोटा करें: मात्रा वाले और गैर-लैटिन अक्षर ज़्यादा जगह लेते हैं।", upload_pkg_name_retail: "यह एक आधिकारिक पैकेज है, इसलिए इसका नाम नहीं बदला जा सकता: नाम इसके प्रकाशक के हस्ताक्षर के अंतर्गत है।", upload_pkg_name_refused: "इस पैकेज का नाम नहीं बदला जा सकता: {reason}", upload_pkg_name_failed: "नाम नहीं बदला: {reason}", @@ -2889,6 +2897,9 @@ remote_copy_task_unknown_server: "सर्वर से {name} कॉपी क upload_split_unsupported_title: "यह एक विभाजित आर्काइव ({count} वॉल्यूम) है जिसे ps5upload नहीं खोल सकता", upload_split_unsupported_body: "इसे अपलोड करने पर कच्चा वॉल्यूम ही आपके PS5 पर चला जाता है, जिसे वह इस्तेमाल नहीं कर सकता। पहले वॉल्यूम को एक आर्काइव में जोड़ें: 7-Zip या WinRAR से पहला वॉल्यूम खोलकर निकालें, फिर निकाला हुआ फ़ोल्डर या उसका एक ही आर्काइव अपलोड करें।", upload_split_unsupported_target: "जुड़कर बनता है: {name}", +volumes_held_back: "PS5 अपने लिए {kept} रोककर रखता है। यह खाली जगह नहीं है, और डेटा लिखे जाने के साथ बढ़ती है।", +volumes_likely_fits: "यहाँ लगभग {safe} नया डेटा आने की संभावना है।", +volumes_ps5_shows_less: "PS5 की अपनी Storage स्क्रीन कम खाली जगह दिखा सकती है। दोनों में अंतर हो तो छोटे वाले को मानें।", // Editing a game image in place (ShadowMount+ checkout) @@ -3313,7 +3324,6 @@ library_mount_tooltip_smp: "यह इमेज ShadowMount+ को सौंप "v5_home_no_notifications_desc": "नई सूचनाएँ यहाँ दिखेंगी।", "v5_home_view_all": "सभी देखें", "task_recheck": "फिर से जाँचें", -"volumes_upload_safe_capacity": "नए अपलोड के लिए {safe} सुरक्षित · {reserve} सिस्टम/फ़ाइल सिस्टम के लिए आरक्षित", "pkg_storage_fallback_title": "आंतरिक स्टोरेज का उपयोग", "pkg_storage_fallback_body": "डिफ़ॉल्ट पैकेज ड्राइव ({drive}) उपलब्ध नहीं है, इसलिए यह पैकेज आंतरिक स्टोरेज में जाएगा।", "pkglib.meta.drive": "{drive} पर", @@ -4311,6 +4321,7 @@ trace_profile_name: "{n} खेल सत्रों से मापा गय "collection.org_summary": "{n} बदलाव · {size}", "collection.org_title": "संग्रह व्यवस्थित करें", "collection.org_undo": "वापस लें", +"collection.org_undo_incomplete": "आइटम ले जाए गए, लेकिन पूर्ववत लॉग सहेजा नहीं जा सका। पूर्ववत करने पर शायद सब कुछ वापस न आए।", "collection.org_undo_body": "स्थानांतरित {n} आइटम उनके मूल नाम और फ़ोल्डर में लौटते हैं। बाद में स्थानांतरित या नाम बदले गए आइटम वहीं रहते हैं।", "collection.org_undo_title": "यह रन वापस लें?", "collection.org_undone": "वापस लिया गया: {n} बहाल, {problems} वहीं रहे", @@ -4548,6 +4559,7 @@ drive_detail_changed_here: "सिंक के दौरान इस डिव drive_detail_changed_there: "सिंक के दौरान {console} पर {path} बदल गया। यह अगली बार सिंक होगा।", drive_detail_too_many_files: "{limit} से ज़्यादा फ़ाइलें: Mesh Drive के लिए बहुत ज़्यादा।", drive_detail_list_unreadable: "यह संस्करण कंसोल की ड्राइव सूची नहीं पढ़ सकता। इस ऐप को अपडेट करें।", +drive_detail_console_list_unreadable: "कंसोल अपनी ड्राइव सूची नहीं पढ़ सका। जब तक वह पढ़ नहीं पाता, कुछ नहीं बदलेगा।", drive_detail_link_record_damaged: "{console} पर लिंक का रिकॉर्ड ख़राब है।", drive_detail_too_many_for_console: "दूसरे कंसोल पर ड्राइव फ़ोल्डर के लिए बहुत ज़्यादा फ़ाइलें।", drive_removed: "अब इस ड्राइव में नहीं", @@ -4569,6 +4581,8 @@ drive_join: "जुड़ें", drive_delete_title: "ड्राइव {name} मिटाएँ?", drive_delete_body: "हर डिवाइस इसे सिंक करना बंद कर देगा। कोई फ़ाइल नहीं मिटेगी: हर फ़ोल्डर, और कंसोल वाला भी, अपनी फ़ाइलें रखेगा।", drive_delete: "ड्राइव मिटाएँ", +drive_left_later: "यह फ़ोल्डर अब सिंक नहीं होता। {name} ने जवाब नहीं दिया: उसके लौटने पर वहाँ इसे ड्राइव से हटा दिया जाएगा। इसकी फ़ाइलें जहाँ हैं वहीं रहेंगी।", +drive_deleted_later: "यह ड्राइव अब इस डिवाइस पर नहीं रखी जाती। {name} ने जवाब नहीं दिया: उसके लौटने पर वहाँ इसे मिटा दिया जाएगा। कोई फ़ाइल नहीं मिटती।", drive_create: "नई मेश ड्राइव", drive_create_go: "बनाएँ", drive_title: "मेश ड्राइव", @@ -4630,13 +4644,14 @@ fs_search_all_drives: "सभी ड्राइव में खोजें", fs_more: "और", fs_more_actions: "और: क्या जगह ले रहा है, स्नैपशॉट", fs_space_title: "क्या जगह ले रहा है?", +fs_space_here_v2: "इस फ़ोल्डर में क्या जगह ले रहा है?", +fs_snapshot_folder_v2: "इस फ़ोल्डर का स्नैपशॉट बनाएँ", +fs_space_drive: "इस ड्राइव पर क्या जगह ले रहा है?", +fs_snapshots_see: "स्नैपशॉट देखें", fs_space_action: "क्या जगह ले रहा है?", -fs_space_here: "यहाँ क्या जगह ले रहा है?", fs_space_open_folder: "यह फ़ोल्डर खोलें", -fs_snapshot_folder: "इस फ़ोल्डर का स्नैपशॉट", fs_snapshot_action: "स्नैपशॉट…", fs_snapshot_tooltip: "PS5 पर रखे स्नैपशॉट में कॉपी करें, बाद में वापस लाने के लिए", -fs_snapshots_open: "स्नैपशॉट", fs_snapshot_batch: "{count} आइटम, हर एक का एक स्नैपशॉट, आइटम के नाम और आज की तारीख से:", fs_snapshot_batch_create: "{count} स्नैपशॉट बनाएँ", fs_snapshot_batch_ok: "{count} स्नैपशॉट बने: {files} फ़ाइलें ({bytes})", @@ -5420,7 +5435,6 @@ upload_phase_settling_eta: "लगभग {time} बाकी", upload_phase_settling_rate: "फ़ाइलें/से", upload_status_resuming: "फिर से शुरू हो रहा है: {total} में से {done} फ़ाइलें पहले से मौजूद हैं ({have}); {send} भेजना बाकी।", upload_resumed_have: "फिर से शुरू हुआ: {have} पहले से PS5 पर था।", -volumes_kept_by_console: "{kept} कंसोल ने अपने उपयोग के लिए रखा है", payloads_tab_ps5: "आपके PS5 पर", payloads_pm_stored_body_v2: "यह Payload Manager के \"{folder}\" फ़ोल्डर में है। \"आपके PS5 पर\" टैब का Payload Manager इसे चलाता है या बूट पर लोड करता है।", hub_checking: "इस PS5 पर क्या है, जाँचा जा रहा है…", @@ -9027,6 +9041,8 @@ rp_users_add_hint: "किसी दूसरे उपयोगकर्ता "receive_cheats_none": "वे कोई भी चालू किए बिना खेलते हैं।", "receive_stream": "स्ट्रीम सेटिंग्स", "receive_stream_body": "आपको मिली बाकी चीज़ों के साथ रखी गई हैं।", +"receive_data_unreadable": "इसका कुछ हिस्सा इस्तेमाल नहीं हो सकता", +"receive_data_unreadable_body": "आपके दोस्त ने जो भेजा उसका कुछ हिस्सा ऐसे रूप में नहीं है जिसे यह ऐप पढ़ सके, इसलिए उसे छोड़ दिया गया।", "receive_intro_v2": "उनका लिंक पेस्ट करें। कुछ भी आने से पहले आप देख लेंगे कि वे क्या दे रहे हैं।", "receive_pick": "क्या लेना है", "receive_total": "कुल {size}", diff --git a/client/src/i18n/locales/hu.ts b/client/src/i18n/locales/hu.ts index 6fe766f94..1b1e790f1 100644 --- a/client/src/i18n/locales/hu.ts +++ b/client/src/i18n/locales/hu.ts @@ -400,6 +400,8 @@ update_skipped_note: "Kihagytad a v{version} verziót.", update_unskip: "Ne hagyd ki", update_toast_installs_on_quit: "kilépéskor települ", update_install_failed_title: "A frissítés nem települt", +update_finishing_title: "A frissítés befejezése…", +update_finishing_body: "Ha kész, a PS5Upload magától újraindul.", update_install_failed_body: "A v{version} nem települt, ezért a PS5Upload a régi verzión maradt.", update_install_failed_reason: "Ok: {message}", update_quit_app: "Kilépés a PS5Uploadból", @@ -1316,8 +1318,9 @@ fs_verify_result: "Ellenőrzés eredménye", fs_verify_tooltip: "BLAKE3 + CRC32 ellenőrzés (lassabb, kriptográfiai erősségű)", hardware_storage: "Konzol tárhely", hw_storage_free: "Szabad", -hw_storage_reserved: "Fenntartott", -hw_storage_reserved_hint: "Az FS által fenntartott rész, nem számít szabad helynek", +hw_storage_held_back: "A PS5 által visszatartott", +hw_storage_held_back_hint: "A Foglaltban szerepel. Nem szabad hely.", +hw_storage_note: "Ahogy a meghajtó fájlrendszere számolja. A PS5 saját Tárhely képernyője kevesebb szabad helyet mutathat: több helyet tart vissza a rendszernek.", hw_storage_total: "Összesen", hw_storage_used: "Használt", hw_drives_title: "Meghajtók", @@ -1525,6 +1528,7 @@ pm_autoload_add: "Betöltés indításkor", pm_autoload_earlier: "Korábban betölteni", pm_autoload_later: "Később betölteni", pm_launch: "Indítás", +pm_row_more: "Továbbiak: {name}", pm_detected: "Payload Manager {version} a PS5-ön", pm_autoload_title: "Payloadok betöltése indításkor", pm_autoload_hint: "A Payload Manager a megjelölt payloadokat sorrendben indítja {delay} mp-cel a PS5 indulása után. {n} a listán. A köztük lévő szünetek a Payload Managerben beállítottak maradnak.", @@ -2129,6 +2133,9 @@ upload_pkg_name_save: "Név módosítása", upload_pkg_name_all_v2: "Ez a név legyen minden nyelven (más nevek a csomagban: {count})", upload_pkg_name_hint: "A telepítés előtt magában a csomagfájlban módosítja a nevet. A már telepített játék megtartja a nevét, amíg újra nem telepíted.", upload_pkg_name_saved: "A név módosítva.", +upload_phone_upload_first: "Előbb a PS5-re másolja, aztán telepíti.", +upload_pkg_name_left: "A névhez maradt bájtok: {count}", +upload_pkg_name_too_long: "Ez a név túl hosszú ehhez a csomaghoz. Ennyi bájt fér el: {limit}. Többletbájtok: {count}. Rövidítsd le: az ékezetes és a nem latin betűk több helyet foglalnak.", upload_pkg_name_retail: "Ez hivatalos csomag, ezért a neve nem módosítható: a nevet a kiadó aláírása védi.", upload_pkg_name_refused: "Ennek a csomagnak a neve nem módosítható: {reason}", upload_pkg_name_failed: "A név nem módosult: {reason}", @@ -2248,6 +2255,7 @@ upload_zip_explainer: upload_mount_after_title: "Csatolás feltöltés után", upload_mount_readonly_title: "Csatolás írásvédetten", upload_dest_card_title: "Célhely", +upload_dest_room: "kb. {size} fér el", upload_dest_auto: "(alapértelmezett — /data)", upload_dest_presets: "Előbeállítások:", upload_dest_final_path: "Végleges útvonal a PS5-ön", @@ -3294,7 +3302,9 @@ remote_copy_task_unknown_server: "{name} másolása a kiszolgálóról", upload_split_unsupported_title: "Ez egy darabolt archívum ({count} kötet), amelyet a ps5upload nem tud megnyitni", upload_split_unsupported_body: "A feltöltés a nyers kötetet küldi el a PS5-ödnek, amelyet az nem tud használni. Egyesítsd előbb a köteteket egyetlen archívummá — nyisd meg az első kötetet 7-Zip-pel vagy WinRAR-ral és bontsd ki, majd töltsd fel a kibontott mappát vagy annak egyetlen archívumát.", upload_split_unsupported_target: "Egyesítve ebbe: {name}", -volumes_upload_safe_capacity: "{safe} biztonságosan használható új feltöltésekhez · {reserve} rendszer/fájlrendszer tartalékként megtartva", +volumes_held_back: "{kept} helyet a PS5 visszatart magának. Ez nem szabad hely, és az írt adatokkal együtt nő.", +volumes_likely_fits: "Nagyjából {safe} új adat fér el itt valószínűleg.", +volumes_ps5_shows_less: "A PS5 saját Tárhely képernyője kevesebb szabad helyet mutathat. Ha a kettő eltér, a kisebbhez igazodj.", "pkg_storage_fallback_title": "Belső tárhely használata", "pkg_storage_fallback_body": "Az alapértelmezett csomagmeghajtó ({drive}) nem érhető el, ezért ez a csomag a belső tárhelyre kerül.", "pkglib.meta.drive": "itt: {drive}", @@ -4589,6 +4599,7 @@ trace_profile_name: "{n} játékmenetből mérve", "collection.org_summary": "{n} áthelyezés · {size}", "collection.org_title": "Gyűjtemény rendezése", "collection.org_undo": "Visszavonás", +"collection.org_undo_incomplete": "Az elemek át lettek helyezve, de a visszavonási naplót nem sikerült menteni. A visszavonás talán nem állít vissza mindent.", "collection.org_undo_body": "A {n} áthelyezett elem visszakapja eredeti nevét és mappáját. Az azóta áthelyezett vagy átnevezett elemek helyben maradnak.", "collection.org_undo_title": "Visszavonod ezt a futtatást?", "collection.org_undone": "Visszavonva: {n} visszaállítva, {problems} a helyén maradt", @@ -4826,6 +4837,7 @@ drive_detail_changed_here: "A(z) {path} megváltozott ezen az eszközön szinkro drive_detail_changed_there: "A(z) {path} megváltozott itt: {console}, szinkronizálás közben. Legközelebb szinkronizálódik.", drive_detail_too_many_files: "Több mint {limit} fájl: túl sok egy Mesh Drive-hoz.", drive_detail_list_unreadable: "Ez a verzió nem tudja olvasni a konzol meghajtólistáját. Frissítsd az alkalmazást.", +drive_detail_console_list_unreadable: "A konzol nem tudta beolvasni a meghajtólistáját. Amíg nem sikerül, semmi sem változik.", drive_detail_link_record_damaged: "A kapcsolat rekordja itt sérült: {console}.", drive_detail_too_many_for_console: "Túl sok fájl egy második konzolon lévő meghajtómappához.", drive_removed: "Már nincs ebben a meghajtóban", @@ -4847,6 +4859,8 @@ drive_join: "Csatlakozás", drive_delete_title: "Törlöd a(z) {name} meghajtót?", drive_delete_body: "Minden eszköz abbahagyja a szinkronizálását. Egy fájl sem törlődik: minden mappa, a konzolon lévő is, megtartja a tartalmát.", drive_delete: "Meghajtó törlése", +drive_left_later: "Ez a mappa már nem szinkronizálódik. {name} nem válaszolt: ott akkor kerül ki a meghajtóból, amikor újra elérhető. A fájljai a helyükön maradnak.", +drive_deleted_later: "A meghajtót ez az eszköz már nem tartja meg. {name} nem válaszolt: ott akkor törlődik, amikor újra elérhető. Egy fájl sem törlődik.", drive_create: "Új Mesh-meghajtó", drive_create_go: "Létrehozás", drive_title: "Mesh-meghajtó", @@ -4908,13 +4922,14 @@ fs_search_all_drives: "Keresés minden meghajtón", fs_more: "Továbbiak", fs_more_actions: "Továbbiak: mi foglal helyet, pillanatképek", fs_space_title: "Mi foglal helyet?", +fs_space_here_v2: "Mi foglal helyet ebben a mappában?", +fs_snapshot_folder_v2: "Pillanatkép készítése erről a mappáról", +fs_space_drive: "Mi foglal helyet ezen a meghajtón?", +fs_snapshots_see: "Pillanatképek megtekintése", fs_space_action: "Mi foglal helyet?", -fs_space_here: "Mi foglal itt helyet?", fs_space_open_folder: "Mappa megnyitása", -fs_snapshot_folder: "Pillanatkép erről a mappáról", fs_snapshot_action: "Pillanatkép…", fs_snapshot_tooltip: "Másolás egy PS5-ön tárolt pillanatképbe, később visszaállítható", -fs_snapshots_open: "Pillanatképek", fs_snapshot_batch: "{count} elem, mindegyikről egy pillanatkép, az elem nevével és a mai dátummal:", fs_snapshot_batch_create: "{count} pillanatkép létrehozása", fs_snapshot_batch_ok: "{count} pillanatkép kész: {files} fájl ({bytes})", @@ -5698,7 +5713,6 @@ upload_phase_settling_eta: "kb. {time} van hátra", upload_phase_settling_rate: "fájl/s", upload_status_resuming: "Folytatás: {done} / {total} fájl már megvan ({have}); {send} küldendő.", upload_resumed_have: "Folytatva: {have} már a PS5-ön volt.", -volumes_kept_by_console: "{kept} a konzol saját használatára fenntartva", payloads_tab_ps5: "A PS5-ödön", payloads_pm_stored_body_v2: "A Payload Manager „{folder}” mappájában van. A „A PS5-ödön” lapon a Payload Manager elindítja, vagy bekapcsoláskor betölti.", hub_checking: "A PS5 tartalmának ellenőrzése…", @@ -9305,6 +9319,8 @@ rp_users_add_hint: "Ha másik felhasználóként is játszanál, jelentkezz be a "receive_cheats_none": "Csalások nélkül játszik.", "receive_stream": "Stream-beállítások", "receive_stream_body": "A többi kapott dologgal együtt tárolva.", +"receive_data_unreadable": "Egy része nem használható", +"receive_data_unreadable_body": "A barátod által küldöttek egy része nem olyan formában van, amit ez az app olvas, ezért kimaradt.", "receive_intro_v2": "Illeszd be a linkjét. Látod, mit kínál, mielőtt bármi megérkezik.", "receive_pick": "Mit veszel át", "receive_total": "Összesen {size}", diff --git a/client/src/i18n/locales/id.ts b/client/src/i18n/locales/id.ts index 281fe5448..0da21655b 100644 --- a/client/src/i18n/locales/id.ts +++ b/client/src/i18n/locales/id.ts @@ -190,6 +190,8 @@ update_skipped_note: "Anda melewati v{version}.", update_unskip: "Jangan lewati", update_toast_installs_on_quit: "dipasang saat keluar", update_install_failed_title: "Pembaruan tidak terpasang", +update_finishing_title: "Menyelesaikan pembaruan…", +update_finishing_body: "PS5Upload akan terbuka lagi sendiri setelah selesai.", update_install_failed_body: "v{version} tidak bisa dipasang, jadi PS5Upload masih di versi lama.", update_install_failed_reason: "Alasan: {message}", update_quit_app: "Keluar dari PS5Upload", @@ -1020,8 +1022,9 @@ fs_verify_result: "Hasil verifikasi", fs_verify_tooltip: "Verifikasi BLAKE3 + CRC32 (lebih lambat, sekuat kriptografi)", hardware_storage: "Penyimpanan konsol", hw_storage_free: "Bebas", -hw_storage_reserved: "Dicadangkan", -hw_storage_reserved_hint: "Bagian yang dicadangkan sistem berkas tidak dihitung sebagai ruang kosong", +hw_storage_held_back: "Ditahan oleh PS5", +hw_storage_held_back_hint: "Termasuk dalam Terpakai. Bukan ruang kosong.", +hw_storage_note: "Menurut hitungan sistem berkas drive. Layar Penyimpanan PS5 sendiri bisa menampilkan ruang kosong lebih sedikit: PS5 menahan lebih banyak untuk sistem.", hw_storage_total: "Total", hw_storage_used: "Terpakai", klog_clear: "Bersihkan", @@ -1209,6 +1212,7 @@ pm_autoload_add: "Muat saat boot", pm_autoload_earlier: "Muat lebih awal", pm_autoload_later: "Muat lebih akhir", pm_launch: "Jalankan", +pm_row_more: "Lainnya untuk {name}", pm_detected: "Payload Manager {version} di PS5", pm_autoload_title: "Muat payload saat boot", pm_autoload_hint: "Payload Manager menjalankan payload yang ditandai secara berurutan {delay} dtk setelah PS5 menyala. {n} terdaftar. Jeda di antaranya tetap seperti diatur di Payload Manager.", @@ -1478,6 +1482,7 @@ upload_change_source: "Ganti sumber", upload_choose_diff_source: "Pilih sumber yang berbeda", upload_dest_auto: "(bawaan — /data)", upload_dest_card_title: "Tujuan", +upload_dest_room: "muat sekitar {size}", upload_dest_final_path: "Jalur akhir di PS5", upload_dest_presets: "Prasetel:", upload_dest_will_create: "Jika folder tujuan belum ada di PS5, folder akan dibuat saat Anda memulai unggahan.", @@ -2577,6 +2582,9 @@ upload_pkg_name_save: "Ubah nama", upload_pkg_name_all_v2: "Pakai nama ini di semua bahasa (nama lain dalam paket: {count})", upload_pkg_name_hint: "Mengubah nama di dalam file paket itu sendiri, sebelum Anda memasangnya. Game yang sudah terpasang tetap memakai namanya sampai Anda memasangnya lagi.", upload_pkg_name_saved: "Nama diubah.", +upload_phone_upload_first: "Menyalinnya ke PS5 dulu, lalu memasangnya.", +upload_pkg_name_left: "Sisa byte untuk nama: {count}", +upload_pkg_name_too_long: "Nama ini terlalu panjang untuk paket ini. Byte yang muat: {limit}. Byte berlebih: {count}. Pendekkan: huruf beraksen dan huruf non-Latin memakan lebih banyak ruang.", upload_pkg_name_retail: "Ini paket resmi, jadi namanya tidak bisa diubah: nama itu tercakup dalam tanda tangan penerbitnya.", upload_pkg_name_refused: "Nama paket ini tidak bisa diubah: {reason}", upload_pkg_name_failed: "Nama tidak diubah: {reason}", @@ -2884,6 +2892,9 @@ remote_copy_task_unknown_server: "Salin {name} dari server", upload_split_unsupported_title: "Ini arsip terpisah ({count} volume) yang tidak bisa dibuka ps5upload", upload_split_unsupported_body: "Mengunggahnya mengirim volume mentah ke PS5 Anda, yang tidak bisa memakainya. Gabungkan dulu volume-volumenya jadi satu arsip: buka volume pertama dengan 7-Zip atau WinRAR lalu ekstrak, kemudian unggah folder hasil ekstrak atau satu arsip darinya.", upload_split_unsupported_target: "Tergabung jadi: {name}", +volumes_held_back: "{kept} ditahan PS5 untuk dirinya sendiri. Ini bukan ruang kosong, dan bertambah saat data ditulis.", +volumes_likely_fits: "Sekitar {safe} data baru kemungkinan muat di sini.", +volumes_ps5_shows_less: "Layar Penyimpanan PS5 sendiri bisa menampilkan ruang kosong lebih sedikit. Jika keduanya berbeda, pakai yang lebih kecil.", // Editing a game image in place (ShadowMount+ checkout) @@ -3308,7 +3319,6 @@ library_mount_tooltip_smp: "Serahkan image ini ke ShadowMount+, yang memasang da "v5_home_no_notifications_desc": "Peringatan baru akan muncul di sini.", "v5_home_view_all": "Lihat semua", "task_recheck": "Periksa ulang", -"volumes_upload_safe_capacity": "{safe} aman untuk unggahan baru · {reserve} dicadangkan untuk sistem/sistem berkas", "pkg_storage_fallback_title": "Menggunakan penyimpanan internal", "pkg_storage_fallback_body": "Drive paket default ({drive}) tidak tersedia, jadi paket ini masuk ke penyimpanan internal.", "pkglib.meta.drive": "di {drive}", @@ -4306,6 +4316,7 @@ trace_profile_name: "diukur dari {n} sesi bermain", "collection.org_summary": "{n} pemindahan · {size}", "collection.org_title": "Atur koleksi", "collection.org_undo": "Batalkan", +"collection.org_undo_incomplete": "Item sudah dipindahkan, tetapi log urungkan tidak dapat disimpan. Urungkan mungkin tidak mengembalikan semuanya.", "collection.org_undo_body": "Kembalikan {n} item yang dipindahkan ke nama dan folder asal. Item yang dipindahkan atau diganti namanya setelah itu tetap di tempatnya.", "collection.org_undo_title": "Batalkan proses ini?", "collection.org_undone": "Dibatalkan: {n} dipulihkan, {problems} tetap di tempatnya", @@ -4543,6 +4554,7 @@ drive_detail_changed_here: "{path} berubah di perangkat ini saat disinkronkan. A drive_detail_changed_there: "{path} berubah di {console} saat disinkronkan. Akan disinkronkan lain kali.", drive_detail_too_many_files: "Lebih dari {limit} file: terlalu banyak untuk Mesh Drive.", drive_detail_list_unreadable: "Versi ini tidak bisa membaca daftar drive konsol. Perbarui aplikasi ini.", +drive_detail_console_list_unreadable: "Konsol tidak bisa membaca daftar drive-nya. Tidak ada yang berubah sampai bisa.", drive_detail_link_record_damaged: "Catatan tautan di {console} rusak.", drive_detail_too_many_for_console: "Terlalu banyak file untuk folder drive di konsol kedua.", drive_removed: "Tidak lagi di drive ini", @@ -4564,6 +4576,8 @@ drive_join: "Gabung", drive_delete_title: "Hapus drive {name}?", drive_delete_body: "Semua perangkat berhenti menyinkronkannya. Tidak ada file yang dihapus: setiap folder, termasuk yang di konsol, tetap menyimpan isinya.", drive_delete: "Hapus drive", +drive_left_later: "Folder ini tidak lagi disinkronkan. {name} tidak menjawab: di sana folder ini dikeluarkan dari drive saat konsol kembali. File-nya tetap di tempatnya.", +drive_deleted_later: "Drive ini tidak lagi disimpan di perangkat ini. {name} tidak menjawab: di sana drive ini dihapus saat konsol kembali. Tidak ada file yang dihapus.", drive_create: "Drive Mesh baru", drive_create_go: "Buat", drive_title: "Drive Mesh", @@ -4625,13 +4639,14 @@ fs_search_all_drives: "Cari di semua drive", fs_more: "Lainnya", fs_more_actions: "Lainnya: apa yang memakan ruang, snapshot", fs_space_title: "Apa yang memakan ruang?", +fs_space_here_v2: "Apa yang memakan ruang di folder ini?", +fs_snapshot_folder_v2: "Buat snapshot folder ini", +fs_space_drive: "Apa yang memakan ruang di drive ini?", +fs_snapshots_see: "Lihat snapshot", fs_space_action: "Apa yang memakan ruang?", -fs_space_here: "Apa yang memakan ruang di sini?", fs_space_open_folder: "Buka folder ini", -fs_snapshot_folder: "Snapshot folder ini", fs_snapshot_action: "Snapshot…", fs_snapshot_tooltip: "Salin ke snapshot yang disimpan di PS5, untuk dikembalikan nanti", -fs_snapshots_open: "Snapshot", fs_snapshot_batch: "{count} item, satu snapshot per item, dinamai sesuai item dan tanggal hari ini:", fs_snapshot_batch_create: "Buat {count} snapshot", fs_snapshot_batch_ok: "{count} snapshot dibuat: {files} file ({bytes})", @@ -5415,7 +5430,6 @@ upload_phase_settling_eta: "sekitar {time} lagi", upload_phase_settling_rate: "file/dtk", upload_status_resuming: "Melanjutkan: {done} dari {total} file sudah ada ({have}); {send} akan dikirim.", upload_resumed_have: "Dilanjutkan: {have} sudah ada di PS5.", -volumes_kept_by_console: "{kept} disimpan konsol untuk keperluannya sendiri", payloads_tab_ps5: "Di PS5 Anda", payloads_pm_stored_body_v2: "Ada di folder \"{folder}\" milik Payload Manager. Payload Manager di tab Di PS5 Anda menjalankannya atau memuatnya saat boot.", hub_checking: "Memeriksa isi PS5 ini…", @@ -9022,6 +9036,8 @@ rp_users_add_hint: "Untuk bermain juga sebagai pengguna lain, masuk ke pengguna "receive_cheats_none": "Dia bermain tanpa cheat aktif.", "receive_stream": "Pengaturan stream", "receive_stream_body": "Disimpan bersama hal lain yang kamu terima.", +"receive_data_unreadable": "Sebagian tidak bisa dipakai", +"receive_data_unreadable_body": "Sebagian yang dikirim temanmu tidak dalam bentuk yang bisa dibaca aplikasi ini, jadi dilewati.", "receive_intro_v2": "Tempel tautan darinya. Kamu melihat yang ditawarkan sebelum apa pun tiba.", "receive_pick": "Yang diambil", "receive_total": "Total {size}", diff --git a/client/src/i18n/locales/it.ts b/client/src/i18n/locales/it.ts index b51e3320e..2b543feaa 100644 --- a/client/src/i18n/locales/it.ts +++ b/client/src/i18n/locales/it.ts @@ -190,6 +190,8 @@ update_skipped_note: "Hai saltato la v{version}.", update_unskip: "Non saltare", update_toast_installs_on_quit: "si installa all'uscita", update_install_failed_title: "Aggiornamento non installato", +update_finishing_title: "Completamento dell'aggiornamento…", +update_finishing_body: "Al termine PS5Upload si riavvia da solo.", update_install_failed_body: "Impossibile installare la v{version}: PS5Upload resta sulla versione precedente.", update_install_failed_reason: "Motivo: {message}", update_quit_app: "Esci da PS5Upload", @@ -1020,8 +1022,9 @@ fs_verify_result: "Risultato verifica", fs_verify_tooltip: "Verifica BLAKE3 + CRC32 (più lenta, di livello crittografico)", hardware_storage: "Memoria console", hw_storage_free: "Libero", -hw_storage_reserved: "Riservato", -hw_storage_reserved_hint: "La porzione riservata dal file system non è conteggiata come libera", +hw_storage_held_back: "Trattenuto dalla PS5", +hw_storage_held_back_hint: "Incluso in Usato. Non è spazio libero.", +hw_storage_note: "Secondo il conteggio del file system dell'unità. La schermata Archiviazione della PS5 può mostrare meno spazio libero: ne trattiene di più per il sistema.", hw_storage_total: "Totale", hw_storage_used: "Usato", klog_clear: "Pulisci", @@ -1209,6 +1212,7 @@ pm_autoload_add: "Carica all'avvio", pm_autoload_earlier: "Carica prima", pm_autoload_later: "Carica dopo", pm_launch: "Avvia", +pm_row_more: "Altro per {name}", pm_detected: "Payload Manager {version} sulla PS5", pm_autoload_title: "Carica payload all'avvio", pm_autoload_hint: "Payload Manager avvia i payload contrassegnati in ordine {delay} s dopo l'avvio della PS5. {n} in lista. Le pause tra loro restano come impostate in Payload Manager.", @@ -1478,6 +1482,7 @@ upload_change_source: "Cambia origine", upload_choose_diff_source: "Scegli un'altra origine", upload_dest_auto: "(predefinito — /data)", upload_dest_card_title: "Destinazione", +upload_dest_room: "spazio per circa {size}", upload_dest_final_path: "Percorso finale sulla PS5", upload_dest_presets: "Preimpostazioni:", upload_dest_will_create: "Se la cartella di destinazione non esiste ancora sulla PS5, verrà creata all'avvio del caricamento.", @@ -2521,6 +2526,9 @@ upload_pkg_name_save: "Cambia nome", upload_pkg_name_all_v2: "Usa questo nome in tutte le lingue (altri nomi nel pacchetto: {count})", upload_pkg_name_hint: "Cambia il nome nel file del pacchetto stesso, prima di installarlo. Un gioco già installato mantiene il suo nome finché non lo installi di nuovo.", upload_pkg_name_saved: "Nome cambiato.", +upload_phone_upload_first: "Prima lo copia sulla PS5, poi lo installa.", +upload_pkg_name_left: "Byte rimasti per il nome: {count}", +upload_pkg_name_too_long: "Questo nome è troppo lungo per questo pacchetto. Byte disponibili: {limit}. Byte in eccesso: {count}. Accorcialo: le lettere accentate e non latine occupano più spazio.", upload_pkg_name_retail: "Questo è un pacchetto ufficiale, quindi il suo nome non può essere cambiato: il nome è coperto dalla firma dell'editore.", upload_pkg_name_refused: "Il nome di questo pacchetto non può essere cambiato: {reason}", upload_pkg_name_failed: "Il nome non è stato cambiato: {reason}", @@ -2828,6 +2836,9 @@ remote_copy_task_unknown_server: "Copia {name} dal server", upload_split_unsupported_title: "Questo è un archivio diviso ({count} volumi) che ps5upload non può aprire", upload_split_unsupported_body: "Caricandolo invii il volume grezzo alla PS5, che non può usarlo. Unisci prima i volumi in un unico archivio: apri il primo con 7-Zip o WinRAR ed estrai, poi carica la cartella estratta o un singolo archivio.", upload_split_unsupported_target: "Unito diventa: {name}", +volumes_held_back: "{kept} sono trattenuti dalla PS5 per sé. Non è spazio libero e aumenta man mano che si scrivono dati.", +volumes_likely_fits: "Qui dovrebbero entrare circa {safe} di nuovi dati.", +volumes_ps5_shows_less: "La schermata Archiviazione della PS5 può mostrare meno spazio libero. Se i due valori differiscono, fai riferimento al più piccolo.", // Editing a game image in place (ShadowMount+ checkout) @@ -3252,7 +3263,6 @@ library_mount_tooltip_smp: "Affida questa immagine a ShadowMount+, che la monta "v5_home_no_notifications_desc": "I nuovi avvisi appariranno qui.", "v5_home_view_all": "Vedi tutto", "task_recheck": "Ricontrolla", -"volumes_upload_safe_capacity": "{safe} sicuri per nuovi caricamenti · {reserve} tenuti come margine di sistema/file system", "pkg_storage_fallback_title": "Uso della memoria interna", "pkg_storage_fallback_body": "L’unità predefinita per i pacchetti ({drive}) non è disponibile, quindi questo pacchetto va nella memoria interna.", "pkglib.meta.drive": "su {drive}", @@ -4250,6 +4260,7 @@ trace_profile_name: "misurato da {n} sessioni di gioco", "collection.org_summary": "{n} spostamenti · {size}", "collection.org_title": "Organizza raccolta", "collection.org_undo": "Annulla", +"collection.org_undo_incomplete": "Gli elementi sono stati spostati, ma non è stato possibile salvare il registro di annullamento. Annulla potrebbe non rimettere tutto a posto.", "collection.org_undo_body": "I {n} elementi spostati tornano ai nomi e alle cartelle originali. Quelli spostati o rinominati successivamente restano dove sono.", "collection.org_undo_title": "Annullare questa esecuzione?", "collection.org_undone": "Annullato: {n} ripristinati, {problems} restano dove sono", @@ -4487,6 +4498,7 @@ drive_detail_changed_here: "{path} è cambiato su questo dispositivo durante la drive_detail_changed_there: "{path} è cambiato su {console} durante la sincronizzazione. Verrà sincronizzato la prossima volta.", drive_detail_too_many_files: "Più di {limit} file: troppi per un Mesh Drive.", drive_detail_list_unreadable: "Questa versione non può leggere l'elenco dei drive della console. Aggiorna questa app.", +drive_detail_console_list_unreadable: "La console non è riuscita a leggere il suo elenco dei drive. Non cambia nulla finché non ci riesce.", drive_detail_link_record_damaged: "Il record del collegamento su {console} è danneggiato.", drive_detail_too_many_for_console: "Troppi file per una cartella di drive su una seconda console.", drive_removed: "Non fa più parte di questo drive", @@ -4508,6 +4520,8 @@ drive_join: "Unisciti", drive_delete_title: "Eliminare il drive {name}?", drive_delete_body: "Tutti i dispositivi smettono di sincronizzarlo. Nessun file viene eliminato: ogni cartella, compresa quella sulla console, conserva ciò che contiene.", drive_delete: "Elimina drive", +drive_left_later: "Questa cartella non viene più sincronizzata. {name} non ha risposto: lì verrà tolta dal drive quando tornerà. I suoi file restano dove sono.", +drive_deleted_later: "Il drive non è più tenuto su questo dispositivo. {name} non ha risposto: lì verrà eliminato quando tornerà. Nessun file viene eliminato.", drive_create: "Nuova unità Mesh", drive_create_go: "Crea", drive_title: "Unità Mesh", @@ -4569,13 +4583,14 @@ fs_search_all_drives: "Cerca in tutte le unità", fs_more: "Altro", fs_more_actions: "Altro: cosa occupa spazio, snapshot", fs_space_title: "Cosa occupa spazio?", +fs_space_here_v2: "Cosa occupa spazio in questa cartella?", +fs_snapshot_folder_v2: "Crea un'istantanea di questa cartella", +fs_space_drive: "Cosa occupa spazio su questa unità?", +fs_snapshots_see: "Vedi istantanee", fs_space_action: "Cosa occupa spazio?", -fs_space_here: "Cosa occupa spazio qui?", fs_space_open_folder: "Apri questa cartella", -fs_snapshot_folder: "Snapshot di questa cartella", fs_snapshot_action: "Snapshot…", fs_snapshot_tooltip: "Copia in uno snapshot conservato sulla PS5, da ripristinare in seguito", -fs_snapshots_open: "Snapshot", fs_snapshot_batch: "{count} elementi, uno snapshot ciascuno, con il nome dell'elemento e la data di oggi:", fs_snapshot_batch_create: "Crea {count} snapshot", fs_snapshot_batch_ok: "{count} snapshot creati: {files} file ({bytes})", @@ -5359,7 +5374,6 @@ upload_phase_settling_eta: "circa {time} rimanenti", upload_phase_settling_rate: "file/s", upload_status_resuming: "Ripresa: {done} di {total} file già presenti ({have}); {send} da inviare.", upload_resumed_have: "Ripreso: {have} era già sulla PS5.", -volumes_kept_by_console: "{kept} riservati dalla console per uso proprio", payloads_tab_ps5: "Sulla tua PS5", payloads_pm_stored_body_v2: "Si trova nella cartella \"{folder}\" di Payload Manager. Payload Manager, nella scheda Sulla tua PS5, lo avvia o lo carica all'avvio.", hub_checking: "Controllo di cosa c'è su questa PS5…", @@ -8966,6 +8980,8 @@ rp_users_add_hint: "Per giocare anche come un altro utente, accedi con quell’u "receive_cheats_none": "Gioca senza nessuno attivo.", "receive_stream": "Impostazioni dello stream", "receive_stream_body": "Salvate insieme alle altre cose ricevute.", +"receive_data_unreadable": "Una parte non si può usare", +"receive_data_unreadable_body": "Parte di ciò che ha inviato il tuo amico non è in una forma che questa app legge, quindi è stata esclusa.", "receive_intro_v2": "Incolla il suo link. Vedi cosa offre prima che arrivi qualcosa.", "receive_pick": "Cosa prendere", "receive_total": "{size} in tutto", diff --git a/client/src/i18n/locales/ja.ts b/client/src/i18n/locales/ja.ts index 47c105c88..5ca118610 100644 --- a/client/src/i18n/locales/ja.ts +++ b/client/src/i18n/locales/ja.ts @@ -191,6 +191,8 @@ update_skipped_note: "v{version} をスキップしました。", update_unskip: "スキップしない", update_toast_installs_on_quit: "終了時にインストール", update_install_failed_title: "アップデートをインストールできませんでした", +update_finishing_title: "アップデートを仕上げています…", +update_finishing_body: "完了すると PS5Upload が自動で再起動します。", update_install_failed_body: "v{version} をインストールできなかったため、PS5Upload は古いバージョンのままです。", update_install_failed_reason: "理由: {message}", update_quit_app: "PS5Upload を終了", @@ -1021,8 +1023,9 @@ fs_verify_result: "検証結果", fs_verify_tooltip: "BLAKE3 + CRC32 による検証(低速、暗号学的強度)", hardware_storage: "本体ストレージ", hw_storage_free: "空き", -hw_storage_reserved: "予約済み", -hw_storage_reserved_hint: "ファイルシステムが確保している領域は空き容量に含まれません", +hw_storage_held_back: "PS5 が確保", +hw_storage_held_back_hint: "使用済みに含まれます。空き容量ではありません。", +hw_storage_note: "ドライブのファイルシステムが数えた値です。PS5 自身のストレージ画面では空き容量が少なく表示されることがあります。システム用にさらに確保しているためです。", hw_storage_total: "合計", hw_storage_used: "使用済み", klog_clear: "クリア", @@ -1210,6 +1213,7 @@ pm_autoload_add: "起動時に読み込む", pm_autoload_earlier: "先に読み込む", pm_autoload_later: "後に読み込む", pm_launch: "起動", +pm_row_more: "{name} のその他の操作", pm_detected: "PS5 の Payload Manager {version}", pm_autoload_title: "起動時にペイロードを読み込む", pm_autoload_hint: "Payload Manager は PS5 起動の {delay} 秒後に、印を付けたペイロードを順番に起動します。{n} 件登録。間の待ち時間は Payload Manager の設定のままです。", @@ -1479,6 +1483,7 @@ upload_change_source: "ソースを変更", upload_choose_diff_source: "別のソースを選択", upload_dest_auto: "(既定 — /data)", upload_dest_card_title: "保存先", +upload_dest_room: "約 {size} 入ります", upload_dest_final_path: "PS5 上の最終パス", upload_dest_presets: "プリセット:", upload_dest_will_create: "保存先フォルダーが PS5 上にまだ存在しない場合、アップロード開始時に作成されます。", @@ -2587,6 +2592,9 @@ upload_pkg_name_save: "名前を変更", upload_pkg_name_all_v2: "すべての言語でこの名前を使う(パッケージ内の別の名前: {count})", upload_pkg_name_hint: "インストールする前に、パッケージファイル内の名前を書き換えます。インストール済みのゲームは、もう一度インストールするまで元の名前のままです。", upload_pkg_name_saved: "名前を変更しました。", +upload_phone_upload_first: "先に PS5 へコピーしてからインストールします。", +upload_pkg_name_left: "名前に使える残りバイト数: {count}", +upload_pkg_name_too_long: "この名前はこのパッケージには長すぎます。入るバイト数: {limit}。超過バイト数: {count}。短くしてください。アクセント付きの文字やラテン文字以外の文字は、より多くの容量を使います。", upload_pkg_name_retail: "これは公式パッケージのため、名前は変更できません。名前は発行元の署名で保護されています。", upload_pkg_name_refused: "このパッケージの名前は変更できません: {reason}", upload_pkg_name_failed: "名前は変更されませんでした: {reason}", @@ -2894,6 +2902,9 @@ remote_copy_task_unknown_server: "サーバーから {name} をコピー", upload_split_unsupported_title: "これは ps5upload が開けない分割アーカイブです({count} ボリューム)", upload_split_unsupported_body: "アップロードすると生のボリュームが PS5 に送られ、そのままでは利用できません。まずボリュームを 1 つのアーカイブに結合してください。7-Zip か WinRAR で最初のボリュームを開いて展開し、展開後のフォルダーか、それを 1 つにまとめた書庫をアップロードします。", upload_split_unsupported_target: "結合後: {name}", +volumes_held_back: "{kept} は PS5 が自身のために確保しています。空き容量ではなく、データを書き込むほど増えます。", +volumes_likely_fits: "ここには新しいデータが約 {safe} 入る見込みです。", +volumes_ps5_shows_less: "PS5 自身のストレージ画面では空き容量が少なく表示されることがあります。両者が異なるときは小さいほうを目安にしてください。", // Editing a game image in place (ShadowMount+ checkout) @@ -3318,7 +3329,6 @@ library_mount_tooltip_smp: "このイメージを ShadowMount+ に渡します "v5_home_no_notifications_desc": "新しい通知がここに表示されます。", "v5_home_view_all": "すべて表示", "task_recheck": "再確認", -"volumes_upload_safe_capacity": "新規アップロードに安全な容量 {safe} · システム/ファイルシステムの予備として {reserve} を確保", "pkg_storage_fallback_title": "内部ストレージを使用します", "pkg_storage_fallback_body": "既定のパッケージ保存先 ({drive}) が使えないため、このパッケージは内部ストレージに保存されます。", "pkglib.meta.drive": "{drive} 上", @@ -4316,6 +4326,7 @@ trace_profile_name: "{n} 回のプレイセッションから計測", "collection.org_summary": "{n} 件の移動 · {size}", "collection.org_title": "コレクションを整理", "collection.org_undo": "元に戻す", +"collection.org_undo_incomplete": "項目は移動されましたが、元に戻すためのログを保存できませんでした。元に戻しても、すべてが戻らない場合があります。", "collection.org_undo_body": "移動した{n}項目を元の名前と場所に戻します。その後に移動または名前変更された項目はそのままにします。", "collection.org_undo_title": "この実行を元に戻しますか?", "collection.org_undone": "元に戻しました: {n} 個を復元、{problems} 個はそのまま", @@ -4553,6 +4564,7 @@ drive_detail_changed_here: "同期中にこのデバイスで {path} が変更 drive_detail_changed_there: "同期中に {console} で {path} が変更されました。次回同期されます。", drive_detail_too_many_files: "ファイルが {limit} 個を超えています。Mesh Drive には多すぎます。", drive_detail_list_unreadable: "このバージョンでは本体のドライブ一覧を読み取れません。このアプリを更新してください。", +drive_detail_console_list_unreadable: "本体がドライブ一覧を読み取れませんでした。読み取れるまで何も変わりません。", drive_detail_link_record_damaged: "{console} のリンク記録が破損しています。", drive_detail_too_many_for_console: "2 台目の本体のドライブフォルダーにはファイルが多すぎます。", drive_removed: "このドライブから外れました", @@ -4574,6 +4586,8 @@ drive_join: "参加", drive_delete_title: "ドライブ {name} を削除しますか?", drive_delete_body: "すべてのデバイスで同期が停止します。ファイルは削除されません。各フォルダーと本体上のフォルダーは現在の内容を保持します。", drive_delete: "ドライブを削除", +drive_left_later: "このフォルダーは同期されなくなりました。{name} が応答しませんでした。戻ったときに、そちらのドライブからも外されます。ファイルはそのまま残ります。", +drive_deleted_later: "このドライブはこのデバイスで保持されなくなりました。{name} が応答しませんでした。戻ったときに、そちらでも削除されます。ファイルは削除されません。", drive_create: "新しいメッシュドライブ", drive_create_go: "作成", drive_title: "メッシュドライブ", @@ -4635,13 +4649,14 @@ fs_search_all_drives: "すべてのドライブを検索", fs_more: "その他", fs_more_actions: "その他: 容量を使っているもの、スナップショット", fs_space_title: "何が容量を使っている?", +fs_space_here_v2: "このフォルダーで容量を使っているものは?", +fs_snapshot_folder_v2: "このフォルダーのスナップショットを作成", +fs_space_drive: "このドライブで容量を使っているものは?", +fs_snapshots_see: "スナップショットを見る", fs_space_action: "何が容量を使っている?", -fs_space_here: "ここで容量を使っているものは?", fs_space_open_folder: "このフォルダーを開く", -fs_snapshot_folder: "このフォルダーのスナップショット", fs_snapshot_action: "スナップショット…", fs_snapshot_tooltip: "PS5 に保存するスナップショットへコピーし、後で戻せます", -fs_snapshots_open: "スナップショット", fs_snapshot_batch: "{count} 件、それぞれ 1 つのスナップショット。名前は項目名と今日の日付です:", fs_snapshot_batch_create: "{count} 件のスナップショットを作成", fs_snapshot_batch_ok: "{count} 件のスナップショットを作成: {files} ファイル ({bytes})", @@ -5425,7 +5440,6 @@ upload_phase_settling_eta: "残り約 {time}", upload_phase_settling_rate: "ファイル/秒", upload_status_resuming: "再開中: {total} ファイル中 {done} 個はすでにあります({have})。{send} を送信します。", upload_resumed_have: "再開しました: {have} はすでに PS5 にありました。", -volumes_kept_by_console: "{kept} は本体が自身の用途のために確保", payloads_tab_ps5: "PS5 上", payloads_pm_stored_body_v2: "Payload Manager の「{folder}」フォルダーにあります。「PS5 上」タブの Payload Manager から起動するか、起動時に読み込めます。", hub_checking: "この PS5 の内容を確認しています…", @@ -9032,6 +9046,8 @@ rp_users_add_hint: "別のユーザーでもプレイするには、PS5 でそ "receive_cheats_none": "相手は何もオンにしていません。", "receive_stream": "配信の設定", "receive_stream_body": "受け取ったほかのものと一緒に保存されます。", +"receive_data_unreadable": "一部は使えません", +"receive_data_unreadable_body": "友だちが送ったものの一部はこのアプリが読める形式ではないため、除外しました。", "receive_intro_v2": "相手のリンクを貼り付けてください。何かが届く前に、相手が何を送ろうとしているか確認できます。", "receive_pick": "受け取るもの", "receive_total": "合計 {size}", diff --git a/client/src/i18n/locales/ko.ts b/client/src/i18n/locales/ko.ts index 7f33b550b..ac464876e 100644 --- a/client/src/i18n/locales/ko.ts +++ b/client/src/i18n/locales/ko.ts @@ -191,6 +191,8 @@ update_skipped_note: "v{version}을(를) 건너뛰었습니다.", update_unskip: "건너뛰지 않기", update_toast_installs_on_quit: "종료할 때 설치됨", update_install_failed_title: "업데이트가 설치되지 않았습니다", +update_finishing_title: "업데이트를 마무리하는 중…", +update_finishing_body: "끝나면 PS5Upload가 자동으로 다시 시작됩니다.", update_install_failed_body: "v{version}을(를) 설치하지 못해 PS5Upload는 이전 버전 그대로입니다.", update_install_failed_reason: "이유: {message}", update_quit_app: "PS5Upload 종료", @@ -1021,8 +1023,9 @@ fs_verify_result: "검증 결과", fs_verify_tooltip: "BLAKE3 + CRC32 검증(더 느리지만 암호학적 강도)", hardware_storage: "콘솔 저장 공간", hw_storage_free: "여유", -hw_storage_reserved: "예약됨", -hw_storage_reserved_hint: "파일 시스템이 확보한 영역은 여유 공간으로 계산되지 않습니다", +hw_storage_held_back: "PS5가 확보한 공간", +hw_storage_held_back_hint: "사용 중에 포함됩니다. 여유 공간이 아닙니다.", +hw_storage_note: "드라이브 파일 시스템이 계산한 값입니다. PS5 자체 저장 공간 화면에서는 여유 공간이 더 적게 보일 수 있습니다. 시스템용으로 더 많이 확보하기 때문입니다.", hw_storage_total: "총", hw_storage_used: "사용", klog_clear: "지우기", @@ -1210,6 +1213,7 @@ pm_autoload_add: "부팅 시 불러오기", pm_autoload_earlier: "먼저 불러오기", pm_autoload_later: "나중에 불러오기", pm_launch: "실행", +pm_row_more: "{name} 더 보기", pm_detected: "PS5의 Payload Manager {version}", pm_autoload_title: "부팅 시 페이로드 불러오기", pm_autoload_hint: "Payload Manager는 PS5 부팅 {delay}초 후 표시된 페이로드를 순서대로 시작합니다. {n}개 등록됨. 사이의 대기 시간은 Payload Manager 설정대로 유지됩니다.", @@ -1479,6 +1483,7 @@ upload_change_source: "소스 변경", upload_choose_diff_source: "다른 소스 선택", upload_dest_auto: "(기본값 — /data)", upload_dest_card_title: "대상", +upload_dest_room: "약 {size} 들어갈 공간", upload_dest_final_path: "PS5의 최종 경로", upload_dest_presets: "프리셋:", upload_dest_will_create: "대상 폴더가 PS5에 아직 없으면 업로드를 시작할 때 생성됩니다.", @@ -2585,6 +2590,9 @@ upload_pkg_name_save: "이름 변경", upload_pkg_name_all_v2: "모든 언어에 이 이름 사용 (패키지의 다른 이름: {count})", upload_pkg_name_hint: "설치하기 전에 패키지 파일 안의 이름을 바꿉니다. 이미 설치된 게임은 다시 설치할 때까지 원래 이름을 유지합니다.", upload_pkg_name_saved: "이름을 변경했습니다.", +upload_phone_upload_first: "먼저 PS5에 복사한 다음 설치합니다.", +upload_pkg_name_left: "이름에 남은 바이트: {count}", +upload_pkg_name_too_long: "이 이름은 이 패키지에 넣기에는 너무 깁니다. 들어가는 바이트: {limit}. 넘는 바이트: {count}. 더 짧게 줄이세요. 악센트가 있는 글자와 라틴 문자가 아닌 글자는 자리를 더 차지합니다.", upload_pkg_name_retail: "공식 패키지이므로 이름을 바꿀 수 없습니다. 이름이 배급사의 서명으로 보호되어 있습니다.", upload_pkg_name_refused: "이 패키지의 이름은 바꿀 수 없습니다: {reason}", upload_pkg_name_failed: "이름이 변경되지 않았습니다: {reason}", @@ -2892,6 +2900,9 @@ remote_copy_task_unknown_server: "서버에서 {name} 복사", upload_split_unsupported_title: "ps5upload가 열 수 없는 분할 압축 파일입니다({count}개 볼륨)", upload_split_unsupported_body: "업로드하면 원본 볼륨이 그대로 PS5로 전송되어 사용할 수 없습니다. 먼저 볼륨을 하나의 압축 파일로 합치세요. 7-Zip이나 WinRAR로 첫 볼륨을 열어 압축을 푼 뒤, 풀어낸 폴더나 그것을 하나로 묶은 파일을 업로드하면 됩니다.", upload_split_unsupported_target: "합치면: {name}", +volumes_held_back: "{kept}는 PS5가 자체 용도로 확보한 공간입니다. 여유 공간이 아니며 데이터를 쓸수록 늘어납니다.", +volumes_likely_fits: "여기에 새 데이터 약 {safe}가 들어갈 것으로 보입니다.", +volumes_ps5_shows_less: "PS5 자체 저장 공간 화면에서는 여유 공간이 더 적게 보일 수 있습니다. 둘이 다르면 작은 쪽을 기준으로 하세요.", // Editing a game image in place (ShadowMount+ checkout) @@ -3316,7 +3327,6 @@ library_mount_tooltip_smp: "이 이미지를 ShadowMount+에 넘깁니다. 마 "v5_home_no_notifications_desc": "새 알림이 여기에 표시됩니다.", "v5_home_view_all": "모두 보기", "task_recheck": "다시 확인", -"volumes_upload_safe_capacity": "새 업로드에 안전한 용량 {safe} · 시스템/파일 시스템 여유분 {reserve}", "pkg_storage_fallback_title": "내부 저장소 사용", "pkg_storage_fallback_body": "기본 패키지 드라이브({drive})를 사용할 수 없어 이 패키지는 내부 저장소에 보관됩니다.", "pkglib.meta.drive": "{drive}에 있음", @@ -4314,6 +4324,7 @@ trace_profile_name: "플레이 세션 {n}개에서 측정", "collection.org_summary": "이동 {n}건 · {size}", "collection.org_title": "컬렉션 정리", "collection.org_undo": "되돌리기", +"collection.org_undo_incomplete": "항목은 이동했지만 되돌리기 로그를 저장하지 못했습니다. 되돌리기로 모든 항목이 돌아오지 않을 수 있습니다.", "collection.org_undo_body": "이동한 {n}개 항목을 원래 이름과 폴더로 되돌립니다. 이후 이동하거나 이름을 바꾼 항목은 그대로 둡니다.", "collection.org_undo_title": "이 실행을 되돌릴까요?", "collection.org_undone": "되돌림: {n}개 복원, {problems}개는 그대로", @@ -4551,6 +4562,7 @@ drive_detail_changed_here: "동기화 중에 이 기기에서 {path}이(가) 바 drive_detail_changed_there: "동기화 중에 {console}에서 {path}이(가) 바뀌었습니다. 다음에 동기화됩니다.", drive_detail_too_many_files: "파일이 {limit}개를 넘습니다. Mesh Drive에는 너무 많습니다.", drive_detail_list_unreadable: "이 버전은 본체의 드라이브 목록을 읽을 수 없습니다. 이 앱을 업데이트하세요.", +drive_detail_console_list_unreadable: "본체가 드라이브 목록을 읽지 못했습니다. 읽을 수 있을 때까지 아무것도 바뀌지 않습니다.", drive_detail_link_record_damaged: "{console}의 연결 기록이 손상되었습니다.", drive_detail_too_many_for_console: "두 번째 본체의 드라이브 폴더에 넣기에는 파일이 너무 많습니다.", drive_removed: "더 이상 이 드라이브에 없음", @@ -4572,6 +4584,8 @@ drive_join: "참가", drive_delete_title: "드라이브 {name}을(를) 삭제할까요?", drive_delete_body: "모든 기기가 동기화를 중단합니다. 파일은 삭제되지 않으며, 각 폴더와 본체의 폴더는 지금 있는 내용을 유지합니다.", drive_delete: "드라이브 삭제", +drive_left_later: "이 폴더는 더 이상 동기화되지 않습니다. {name}이(가) 응답하지 않았습니다. 다시 연결되면 그쪽 드라이브에서도 빠집니다. 파일은 그대로 남습니다.", +drive_deleted_later: "이 드라이브는 더 이상 이 기기에 유지되지 않습니다. {name}이(가) 응답하지 않았습니다. 다시 연결되면 그쪽에서도 삭제됩니다. 파일은 삭제되지 않습니다.", drive_create: "새 메시 드라이브", drive_create_go: "만들기", drive_title: "메시 드라이브", @@ -4633,13 +4647,14 @@ fs_search_all_drives: "모든 드라이브 검색", fs_more: "더 보기", fs_more_actions: "더 보기: 공간 차지 항목, 스냅샷", fs_space_title: "무엇이 공간을 차지하나요?", +fs_space_here_v2: "이 폴더에서 공간을 차지하는 것은?", +fs_snapshot_folder_v2: "이 폴더의 스냅샷 만들기", +fs_space_drive: "이 드라이브에서 공간을 차지하는 것은?", +fs_snapshots_see: "스냅샷 보기", fs_space_action: "무엇이 공간을 차지하나요?", -fs_space_here: "여기서 무엇이 공간을 차지하나요?", fs_space_open_folder: "이 폴더 열기", -fs_snapshot_folder: "이 폴더 스냅샷", fs_snapshot_action: "스냅샷…", fs_snapshot_tooltip: "나중에 되돌릴 수 있도록 PS5에 보관되는 스냅샷으로 복사", -fs_snapshots_open: "스냅샷", fs_snapshot_batch: "항목 {count}개, 항목마다 스냅샷 하나, 이름은 항목과 오늘 날짜:", fs_snapshot_batch_create: "스냅샷 {count}개 만들기", fs_snapshot_batch_ok: "스냅샷 {count}개 생성: 파일 {files}개 ({bytes})", @@ -5423,7 +5438,6 @@ upload_phase_settling_eta: "약 {time} 남음", upload_phase_settling_rate: "파일/초", upload_status_resuming: "재개 중: 파일 {total}개 중 {done}개가 이미 있습니다({have}). {send} 보낼 예정.", upload_resumed_have: "재개됨: {have}은(는) 이미 PS5에 있었습니다.", -volumes_kept_by_console: "{kept}은(는) 본체가 자체 용도로 사용", payloads_tab_ps5: "내 PS5", payloads_pm_stored_body_v2: "Payload Manager의 \"{folder}\" 폴더에 있습니다. \"내 PS5\" 탭의 Payload Manager에서 실행하거나 부팅 시 로드할 수 있습니다.", hub_checking: "이 PS5에 있는 항목을 확인하는 중…", @@ -9030,6 +9044,8 @@ rp_users_add_hint: "다른 사용자로도 플레이하려면 PS5에서 그 사 "receive_cheats_none": "친구는 아무것도 켜지 않고 플레이합니다.", "receive_stream": "스트림 설정", "receive_stream_body": "받은 다른 항목과 함께 보관됩니다.", +"receive_data_unreadable": "일부는 사용할 수 없습니다", +"receive_data_unreadable_body": "친구가 보낸 것 중 일부는 이 앱이 읽을 수 있는 형식이 아니어서 제외했습니다.", "receive_intro_v2": "상대의 링크를 붙여 넣으세요. 무엇이든 받기 전에 상대가 보내려는 것을 확인할 수 있습니다.", "receive_pick": "받을 항목", "receive_total": "총 {size}", diff --git a/client/src/i18n/locales/pl.ts b/client/src/i18n/locales/pl.ts index 287796e9a..5ee2d055b 100644 --- a/client/src/i18n/locales/pl.ts +++ b/client/src/i18n/locales/pl.ts @@ -391,6 +391,8 @@ update_skipped_note: "Pominięto v{version}.", update_unskip: "Nie pomijaj", update_toast_installs_on_quit: "zainstaluje się przy zamknięciu", update_install_failed_title: "Aktualizacja się nie zainstalowała", +update_finishing_title: "Kończenie aktualizacji…", +update_finishing_body: "Po zakończeniu PS5Upload uruchomi się ponownie sam.", update_install_failed_body: "Nie udało się zainstalować v{version}, więc PS5Upload działa dalej w starej wersji.", update_install_failed_reason: "Powód: {message}", update_quit_app: "Zamknij PS5Upload", @@ -1269,8 +1271,9 @@ fs_verify_result: "Wynik weryfikacji", fs_verify_tooltip: "Weryfikacja BLAKE3 + CRC32 (wolniejsza, kryptograficzna)", hardware_storage: "Pamięć konsoli", hw_storage_free: "Wolne", -hw_storage_reserved: "Zarezerwowane", -hw_storage_reserved_hint: "Wydzielona część FS nie jest liczona jako wolna", +hw_storage_held_back: "Zatrzymane przez PS5", +hw_storage_held_back_hint: "Wliczone w Zajęte. To nie jest wolne miejsce.", +hw_storage_note: "Tak, jak liczy system plików dysku. Ekran Pamięć masowa na PS5 może pokazywać mniej wolnego miejsca: konsola zatrzymuje więcej dla systemu.", hw_storage_total: "Razem", hw_storage_used: "Użyte", hw_drives_title: "Dyski", @@ -1473,6 +1476,7 @@ pm_autoload_add: "Ładuj przy starcie", pm_autoload_earlier: "Ładuj wcześniej", pm_autoload_later: "Ładuj później", pm_launch: "Uruchom", +pm_row_more: "Więcej dla {name}", pm_detected: "Payload Manager {version} na PS5", pm_autoload_title: "Ładuj payloady przy starcie", pm_autoload_hint: "Payload Manager uruchamia oznaczone payloady po kolei {delay} s po starcie PS5. Na liście: {n}. Przerwy między nimi pozostają jak ustawiono w Payload Managerze.", @@ -1853,6 +1857,9 @@ upload_pkg_name_save: "Zmień nazwę", upload_pkg_name_all_v2: "Użyj tej nazwy we wszystkich językach (inne nazwy w pakiecie: {count})", upload_pkg_name_hint: "Zmienia nazwę w samym pliku pakietu, zanim go zainstalujesz. Już zainstalowana gra zachowuje nazwę, dopóki nie zainstalujesz jej ponownie.", upload_pkg_name_saved: "Nazwa zmieniona.", +upload_phone_upload_first: "Najpierw kopiuje go na PS5, potem instaluje.", +upload_pkg_name_left: "Pozostałe bajty na nazwę: {count}", +upload_pkg_name_too_long: "Ta nazwa jest za długa dla tego pakietu. Bajty, które się mieszczą: {limit}. Bajty ponad limit: {count}. Skróć ją: litery ze znakami diakrytycznymi i litery niełacińskie zajmują więcej miejsca.", upload_pkg_name_retail: "To oficjalny pakiet, więc jego nazwy nie można zmienić: nazwę obejmuje podpis wydawcy.", upload_pkg_name_refused: "Nazwy tego pakietu nie można zmienić: {reason}", upload_pkg_name_failed: "Nazwa nie została zmieniona: {reason}", @@ -1971,6 +1978,7 @@ upload_zip_explainer: upload_mount_after_title: "Zamontuj po przesłaniu", upload_mount_readonly_title: "Zamontuj jako tylko do odczytu", upload_dest_card_title: "Miejsce docelowe", +upload_dest_room: "miejsce na około {size}", upload_dest_auto: "(domyślnie — /data)", upload_dest_presets: "Profile:", upload_dest_final_path: "Ostateczna ścieżka na PS5", @@ -3112,6 +3120,9 @@ remote_copy_task_unknown_server: "Kopiuj {name} z serwera", upload_split_unsupported_title: "To podzielone archiwum ({count} woluminów), którego ps5upload nie potrafi otworzyć", upload_split_unsupported_body: "Wysłanie go przenosi surowy wolumin na PS5, która nie potrafi go użyć. Najpierw połącz woluminy w jedno archiwum: otwórz pierwszy w 7-Zip lub WinRAR i wypakuj, a następnie wyślij wypakowany folder albo pojedyncze archiwum.", upload_split_unsupported_target: "Po połączeniu: {name}", +volumes_held_back: "{kept} PS5 zatrzymuje dla siebie. To nie jest wolne miejsce i rośnie w miarę zapisywania danych.", +volumes_likely_fits: "Zmieści się tu prawdopodobnie około {safe} nowych danych.", +volumes_ps5_shows_less: "Ekran Pamięć masowa na PS5 może pokazywać mniej wolnego miejsca. Gdy wartości się różnią, kieruj się mniejszą.", // Editing a game image in place (ShadowMount+ checkout) @@ -3536,7 +3547,6 @@ library_mount_tooltip_smp: "Przekaż ten obraz do ShadowMount+, który zamontuje "v5_home_no_notifications_desc": "Tu pojawią się nowe alerty.", "v5_home_view_all": "Pokaż wszystko", "task_recheck": "Sprawdź ponownie", -"volumes_upload_safe_capacity": "{safe} bezpiecznie na nowe wysyłki · {reserve} zachowane jako zapas systemu/systemu plików", "pkg_storage_fallback_title": "Używana jest pamięć wewnętrzna", "pkg_storage_fallback_body": "Domyślny dysk na pakiety ({drive}) jest niedostępny, więc ten pakiet trafi do pamięci wewnętrznej.", "pkglib.meta.drive": "na {drive}", @@ -4534,6 +4544,7 @@ trace_profile_name: "zmierzono z {n} sesji gry", "collection.org_summary": "Przeniesienia: {n} · {size}", "collection.org_title": "Uporządkuj kolekcję", "collection.org_undo": "Cofnij", +"collection.org_undo_incomplete": "Elementy zostały przeniesione, ale nie udało się zapisać dziennika cofania. Cofnięcie może nie przywrócić wszystkiego.", "collection.org_undo_body": "Przywraca {n} przeniesionym elementom pierwotne nazwy i foldery. Elementy później przeniesione lub przemianowane pozostają na miejscu.", "collection.org_undo_title": "Cofnąć to uruchomienie?", "collection.org_undone": "Cofnięto: przywrócono {n}, na miejscu zostało {problems}", @@ -4771,6 +4782,7 @@ drive_detail_changed_here: "{path} zmienił się na tym urządzeniu podczas sync drive_detail_changed_there: "{path} zmienił się na {console} podczas synchronizacji. Zostanie zsynchronizowany następnym razem.", drive_detail_too_many_files: "Ponad {limit} plików: za dużo dla Mesh Drive.", drive_detail_list_unreadable: "Ta wersja nie może odczytać listy dysków konsoli. Zaktualizuj tę aplikację.", +drive_detail_console_list_unreadable: "Konsola nie mogła odczytać swojej listy dysków. Nic się nie zmieni, dopóki jej się to nie uda.", drive_detail_link_record_damaged: "Zapis połączenia na {console} jest uszkodzony.", drive_detail_too_many_for_console: "Za dużo plików dla folderu dysku na drugiej konsoli.", drive_removed: "Już nie należy do tego dysku", @@ -4792,6 +4804,8 @@ drive_join: "Dołącz", drive_delete_title: "Usunąć dysk {name}?", drive_delete_body: "Żadne urządzenie nie będzie go już synchronizować. Żadne pliki nie zostaną usunięte: każdy folder, również ten na konsoli, zachowa swoją zawartość.", drive_delete: "Usuń dysk", +drive_left_later: "Ten folder nie jest już synchronizowany. {name} nie odpowiedziała: zostanie tam usunięty z dysku, gdy wróci. Jego pliki zostają tam, gdzie są.", +drive_deleted_later: "Dysk nie jest już przechowywany na tym urządzeniu. {name} nie odpowiedziała: zostanie tam usunięty, gdy wróci. Żadne pliki nie zostaną usunięte.", drive_create: "Nowy Dysk Mesh", drive_create_go: "Utwórz", drive_title: "Dysk Mesh", @@ -4853,13 +4867,14 @@ fs_search_all_drives: "Szukaj na wszystkich dyskach", fs_more: "Więcej", fs_more_actions: "Więcej: co zajmuje miejsce, migawki", fs_space_title: "Co zajmuje miejsce?", +fs_space_here_v2: "Co zajmuje miejsce w tym folderze?", +fs_snapshot_folder_v2: "Utwórz migawkę tego folderu", +fs_space_drive: "Co zajmuje miejsce na tym dysku?", +fs_snapshots_see: "Zobacz migawki", fs_space_action: "Co zajmuje miejsce?", -fs_space_here: "Co tu zajmuje miejsce?", fs_space_open_folder: "Otwórz ten folder", -fs_snapshot_folder: "Migawka tego folderu", fs_snapshot_action: "Migawka…", fs_snapshot_tooltip: "Skopiuj do migawki na PS5, by później ją przywrócić", -fs_snapshots_open: "Migawki", fs_snapshot_batch: "Elementy: {count}, po jednej migawce, nazwanej od elementu i dzisiejszej daty:", fs_snapshot_batch_create: "Utwórz migawki: {count}", fs_snapshot_batch_ok: "Utworzono migawki: {count}; pliki: {files} ({bytes})", @@ -5643,7 +5658,6 @@ upload_phase_settling_eta: "pozostało około {time}", upload_phase_settling_rate: "pliki/s", upload_status_resuming: "Wznawianie: {done} z {total} plików już jest ({have}); do wysłania {send}.", upload_resumed_have: "Wznowiono: {have} było już na PS5.", -volumes_kept_by_console: "{kept} zarezerwowane przez konsolę na własny użytek", payloads_tab_ps5: "Na Twojej PS5", payloads_pm_stored_body_v2: "Jest w folderze „{folder}” w Payload Managerze. Payload Manager na karcie Na Twojej PS5 uruchamia go lub ładuje przy starcie.", hub_checking: "Sprawdzanie, co jest na tej PS5…", @@ -9250,6 +9264,8 @@ rp_users_add_hint: "Aby grać także jako inny użytkownik, zaloguj się na nim "receive_cheats_none": "Znajomy gra bez włączonych kodów.", "receive_stream": "Ustawienia strumienia", "receive_stream_body": "Zapisane razem z innymi odebranymi rzeczami.", +"receive_data_unreadable": "Części nie da się użyć", +"receive_data_unreadable_body": "Część tego, co wysłał znajomy, nie jest w formie, którą ta aplikacja odczytuje, więc została pominięta.", "receive_intro_v2": "Wklej link od znajomego. Zobaczysz, co oferuje, zanim cokolwiek dotrze.", "receive_pick": "Co wziąć", "receive_total": "Razem {size}", diff --git a/client/src/i18n/locales/pt-BR.ts b/client/src/i18n/locales/pt-BR.ts index a88bfa764..dd5aabbba 100644 --- a/client/src/i18n/locales/pt-BR.ts +++ b/client/src/i18n/locales/pt-BR.ts @@ -190,6 +190,8 @@ update_skipped_note: "Você pulou a v{version}.", update_unskip: "Não pular", update_toast_installs_on_quit: "instala ao sair", update_install_failed_title: "A atualização não foi instalada", +update_finishing_title: "Concluindo a atualização…", +update_finishing_body: "O PS5Upload abre de novo sozinho quando terminar.", update_install_failed_body: "Não foi possível instalar a v{version}, então o PS5Upload continua na versão anterior.", update_install_failed_reason: "Motivo: {message}", update_quit_app: "Sair do PS5Upload", @@ -1020,8 +1022,9 @@ fs_verify_result: "Resultado da verificação", fs_verify_tooltip: "Verificação BLAKE3 + CRC32 (mais lenta, com força criptográfica)", hardware_storage: "Armazenamento do console", hw_storage_free: "Livre", -hw_storage_reserved: "Reservado", -hw_storage_reserved_hint: "A fatia reservada pelo sistema de arquivos não conta como livre", +hw_storage_held_back: "Retido pelo PS5", +hw_storage_held_back_hint: "Contado em Usado. Não é espaço livre.", +hw_storage_note: "Como o sistema de arquivos da unidade conta. A tela de Armazenamento do próprio PS5 pode mostrar menos espaço livre: ele retém mais para o sistema.", hw_storage_total: "Total", hw_storage_used: "Usado", klog_clear: "Limpar", @@ -1209,6 +1212,7 @@ pm_autoload_add: "Carregar na inicialização", pm_autoload_earlier: "Carregar antes", pm_autoload_later: "Carregar depois", pm_launch: "Iniciar", +pm_row_more: "Mais para {name}", pm_detected: "Payload Manager {version} no PS5", pm_autoload_title: "Carregar payloads na inicialização", pm_autoload_hint: "O Payload Manager inicia os payloads marcados em ordem {delay} s após o PS5 iniciar. {n} na lista. As pausas entre eles ficam como definidas no Payload Manager.", @@ -1478,6 +1482,7 @@ upload_change_source: "Trocar origem", upload_choose_diff_source: "Escolher uma origem diferente", upload_dest_auto: "(padrão — /data)", upload_dest_card_title: "Destino", +upload_dest_room: "espaço para cerca de {size}", upload_dest_final_path: "Caminho final no PS5", upload_dest_presets: "Predefinições:", upload_dest_will_create: "Se a pasta de destino ainda não existir no PS5, ela será criada quando você iniciar o envio.", @@ -2583,6 +2588,9 @@ upload_pkg_name_save: "Alterar nome", upload_pkg_name_all_v2: "Usar este nome em todos os idiomas (outros nomes no pacote: {count})", upload_pkg_name_hint: "Altera o nome no próprio arquivo do pacote, antes de instalar. Um jogo já instalado mantém o nome até você instalá-lo de novo.", upload_pkg_name_saved: "Nome alterado.", +upload_phone_upload_first: "Primeiro copia para o PS5 e depois instala.", +upload_pkg_name_left: "Bytes restantes para o nome: {count}", +upload_pkg_name_too_long: "Este nome é longo demais para este pacote. Bytes que cabem: {limit}. Bytes a mais: {count}. Encurte-o: letras com acento e letras não latinas ocupam mais espaço.", upload_pkg_name_retail: "Este é um pacote oficial, então o nome não pode ser alterado: o nome é coberto pela assinatura da publicadora.", upload_pkg_name_refused: "O nome deste pacote não pode ser alterado: {reason}", upload_pkg_name_failed: "O nome não foi alterado: {reason}", @@ -2890,6 +2898,9 @@ remote_copy_task_unknown_server: "Copiar {name} do servidor", upload_split_unsupported_title: "Este é um arquivo dividido ({count} volumes) que o ps5upload não consegue abrir", upload_split_unsupported_body: "Enviá-lo manda o volume bruto para o seu PS5, que não consegue usá-lo. Junte os volumes em um único arquivo primeiro: abra o primeiro com 7-Zip ou WinRAR e extraia, depois envie a pasta extraída ou um único arquivo dela.", upload_split_unsupported_target: "Resulta em: {name}", +volumes_held_back: "{kept} ficam retidos pelo PS5 para uso próprio. Não é espaço livre, e aumenta conforme dados são gravados.", +volumes_likely_fits: "Cerca de {safe} de dados novos devem caber aqui.", +volumes_ps5_shows_less: "A tela de Armazenamento do próprio PS5 pode mostrar menos espaço livre. Quando os dois forem diferentes, considere o menor.", // Editing a game image in place (ShadowMount+ checkout) @@ -3314,7 +3325,6 @@ library_mount_tooltip_smp: "Entregar esta imagem ao ShadowMount+, que a monta e "v5_home_no_notifications_desc": "Novos alertas aparecerão aqui.", "v5_home_view_all": "Ver tudo", "task_recheck": "Verificar de novo", -"volumes_upload_safe_capacity": "{safe} seguros para novos envios · {reserve} reservados como folga do sistema/sistema de arquivos", "pkg_storage_fallback_title": "Usando o armazenamento interno", "pkg_storage_fallback_body": "A unidade padrão de pacotes ({drive}) não está disponível, então este pacote vai para o armazenamento interno.", "pkglib.meta.drive": "em {drive}", @@ -4312,6 +4322,7 @@ trace_profile_name: "medido em {n} sessões de jogo", "collection.org_summary": "{n} movimentações · {size}", "collection.org_title": "Organizar coleção", "collection.org_undo": "Desfazer", +"collection.org_undo_incomplete": "Os itens foram movidos, mas não foi possível salvar o registro para desfazer. Desfazer pode não devolver tudo ao lugar.", "collection.org_undo_body": "Os {n} itens movidos voltam aos nomes e pastas originais. Os movidos ou renomeados depois permanecem onde estão.", "collection.org_undo_title": "Desfazer esta execução?", "collection.org_undone": "Desfeito: {n} restaurados, {problems} ficaram onde estão", @@ -4549,6 +4560,7 @@ drive_detail_changed_here: "{path} mudou neste dispositivo durante a sincroniza drive_detail_changed_there: "{path} mudou em {console} durante a sincronização. Ele será sincronizado na próxima vez.", drive_detail_too_many_files: "Mais de {limit} arquivos: demais para um Mesh Drive.", drive_detail_list_unreadable: "Esta versão não consegue ler a lista de drives do console. Atualize este app.", +drive_detail_console_list_unreadable: "O console não conseguiu ler a lista de drives dele. Nada muda até que consiga.", drive_detail_link_record_damaged: "O registro do vínculo em {console} está danificado.", drive_detail_too_many_for_console: "Arquivos demais para uma pasta de drive em um segundo console.", drive_removed: "Não está mais neste drive", @@ -4570,6 +4582,8 @@ drive_join: "Entrar", drive_delete_title: "Excluir o drive {name}?", drive_delete_body: "Todos os dispositivos param de sincronizá-lo. Nenhum arquivo é excluído: cada pasta, e a do console, mantém o que tem.", drive_delete: "Excluir drive", +drive_left_later: "Esta pasta não é mais sincronizada. {name} não respondeu: ela será tirada do drive lá quando o console voltar. Os arquivos dela ficam onde estão.", +drive_deleted_later: "O drive não é mais mantido neste dispositivo. {name} não respondeu: ele será excluído lá quando o console voltar. Nenhum arquivo é excluído.", drive_create: "Novo Drive Mesh", drive_create_go: "Criar", drive_title: "Drive Mesh", @@ -4631,13 +4645,14 @@ fs_search_all_drives: "Pesquisar em todas as unidades", fs_more: "Mais", fs_more_actions: "Mais: o que ocupa espaço, snapshots", fs_space_title: "O que ocupa espaço?", +fs_space_here_v2: "O que ocupa espaço nesta pasta?", +fs_snapshot_folder_v2: "Criar um snapshot desta pasta", +fs_space_drive: "O que ocupa espaço nesta unidade?", +fs_snapshots_see: "Ver snapshots", fs_space_action: "O que ocupa espaço?", -fs_space_here: "O que ocupa espaço aqui?", fs_space_open_folder: "Abrir esta pasta", -fs_snapshot_folder: "Snapshot desta pasta", fs_snapshot_action: "Snapshot…", fs_snapshot_tooltip: "Copiar para um snapshot guardado no PS5, para restaurar depois", -fs_snapshots_open: "Snapshots", fs_snapshot_batch: "{count} itens, um snapshot cada, com o nome do item e a data de hoje:", fs_snapshot_batch_create: "Criar {count} snapshots", fs_snapshot_batch_ok: "{count} snapshots criados: {files} arquivos ({bytes})", @@ -5421,7 +5436,6 @@ upload_phase_settling_eta: "cerca de {time} restantes", upload_phase_settling_rate: "arquivos/s", upload_status_resuming: "Retomando: {done} de {total} arquivos já presentes ({have}); {send} a enviar.", upload_resumed_have: "Retomado: {have} já estava no PS5.", -volumes_kept_by_console: "{kept} reservados pelo console para uso próprio", payloads_tab_ps5: "No seu PS5", payloads_pm_stored_body_v2: "Ele está na pasta \"{folder}\" do Payload Manager. O Payload Manager, na aba No seu PS5, o inicia ou carrega na inicialização.", hub_checking: "Verificando o que há neste PS5…", @@ -9028,6 +9042,8 @@ rp_users_add_hint: "Para jogar também como outro usuário, entre com esse usuá "receive_cheats_none": "Joga sem nenhum ativado.", "receive_stream": "Configurações de transmissão", "receive_stream_body": "Guardadas junto com as outras coisas que você recebeu.", +"receive_data_unreadable": "Parte não pode ser usada", +"receive_data_unreadable_body": "Parte do que seu amigo enviou não está em um formato que este app lê, então ficou de fora.", "receive_intro_v2": "Cole o link. Você vê o que é oferecido antes de qualquer coisa chegar.", "receive_pick": "O que receber", "receive_total": "{size} no total", diff --git a/client/src/i18n/locales/ru.ts b/client/src/i18n/locales/ru.ts index 38e639d51..a91c2c06f 100644 --- a/client/src/i18n/locales/ru.ts +++ b/client/src/i18n/locales/ru.ts @@ -190,6 +190,8 @@ update_skipped_note: "Вы пропустили v{version}.", update_unskip: "Не пропускать", update_toast_installs_on_quit: "установится при выходе", update_install_failed_title: "Обновление не установилось", +update_finishing_title: "Завершение обновления…", +update_finishing_body: "Когда всё будет готово, PS5Upload запустится снова сам.", update_install_failed_body: "Не удалось установить v{version}, поэтому PS5Upload остался на старой версии.", update_install_failed_reason: "Причина: {message}", update_quit_app: "Выйти из PS5Upload", @@ -1020,8 +1022,9 @@ fs_verify_result: "Результат проверки", fs_verify_tooltip: "Проверка BLAKE3 + CRC32 (медленнее, криптостойкая)", hardware_storage: "Хранилище консоли", hw_storage_free: "Свободно", -hw_storage_reserved: "Зарезервировано", -hw_storage_reserved_hint: "Область, зарезервированная файловой системой, не считается свободной", +hw_storage_held_back: "Удерживает PS5", +hw_storage_held_back_hint: "Входит в «Занято». Это не свободное место.", +hw_storage_note: "По подсчёту файловой системы диска. Экран «Память» на самой PS5 может показывать меньше свободного места: консоль удерживает больше для системы.", hw_storage_total: "Всего", hw_storage_used: "Использовано", klog_clear: "Очистить", @@ -1209,6 +1212,7 @@ pm_autoload_add: "Загружать при старте", pm_autoload_earlier: "Загружать раньше", pm_autoload_later: "Загружать позже", pm_launch: "Запустить", +pm_row_more: "Ещё для {name}", pm_detected: "Payload Manager {version} на PS5", pm_autoload_title: "Загружать пейлоады при старте", pm_autoload_hint: "Payload Manager запускает отмеченные пейлоады по порядку через {delay} с после старта PS5. В списке: {n}. Паузы между ними остаются как заданы в Payload Manager.", @@ -1478,6 +1482,7 @@ upload_change_source: "Сменить источник", upload_choose_diff_source: "Выбрать другой источник", upload_dest_auto: "(по умолчанию — /data)", upload_dest_card_title: "Назначение", +upload_dest_room: "места примерно на {size}", upload_dest_final_path: "Конечный путь на PS5", upload_dest_presets: "Пресеты:", upload_dest_will_create: "Если папка назначения ещё не существует на PS5, она будет создана при запуске загрузки.", @@ -2521,6 +2526,9 @@ upload_pkg_name_save: "Изменить название", upload_pkg_name_all_v2: "Использовать это название на всех языках (других названий в пакете: {count})", upload_pkg_name_hint: "Меняет название в самом файле пакета до установки. Уже установленная игра сохраняет своё название, пока вы не установите её снова.", upload_pkg_name_saved: "Название изменено.", +upload_phone_upload_first: "Сначала копирует на PS5, затем устанавливает.", +upload_pkg_name_left: "Осталось байтов для названия: {count}", +upload_pkg_name_too_long: "Это название слишком длинное для этого пакета. Помещается байтов: {limit}. Лишних байтов: {count}. Сократите его: буквы с диакритикой и нелатинские буквы занимают больше места.", upload_pkg_name_retail: "Это официальный пакет, поэтому его название изменить нельзя: название защищено подписью издателя.", upload_pkg_name_refused: "Название этого пакета изменить нельзя: {reason}", upload_pkg_name_failed: "Название не изменено: {reason}", @@ -2828,6 +2836,9 @@ remote_copy_task_unknown_server: "Копирование {name} с сервер upload_split_unsupported_title: "Это разделённый архив ({count} томов), который ps5upload не может открыть", upload_split_unsupported_body: "При отправке на PS5 попадёт сырой том, который она не сможет использовать. Сначала объедините тома в один архив: откройте первый том в 7-Zip или WinRAR и распакуйте, затем отправьте распакованную папку или один архив с ней.", upload_split_unsupported_target: "Собирается в: {name}", +volumes_held_back: "{kept} PS5 удерживает для себя. Это не свободное место, и оно растёт по мере записи данных.", +volumes_likely_fits: "Сюда, скорее всего, поместится около {safe} новых данных.", +volumes_ps5_shows_less: "Экран «Память» на самой PS5 может показывать меньше свободного места. Если цифры расходятся, ориентируйтесь на меньшую.", // Editing a game image in place (ShadowMount+ checkout) @@ -3252,7 +3263,6 @@ library_mount_tooltip_smp: "Передать образ ShadowMount+, котор "v5_home_no_notifications_desc": "Здесь появятся новые оповещения.", "v5_home_view_all": "Показать все", "task_recheck": "Проверить снова", -"volumes_upload_safe_capacity": "{safe} безопасно для новых загрузок · {reserve} оставлено как резерв системы/файловой системы", "pkg_storage_fallback_title": "Используется внутренняя память", "pkg_storage_fallback_body": "Диск для пакетов по умолчанию ({drive}) недоступен, поэтому этот пакет будет сохранён во внутреннюю память.", "pkglib.meta.drive": "на {drive}", @@ -4250,6 +4260,7 @@ trace_profile_name: "измерено по {n} игровым сессиям", "collection.org_summary": "Перемещений: {n} · {size}", "collection.org_title": "Упорядочить коллекцию", "collection.org_undo": "Отменить", +"collection.org_undo_incomplete": "Элементы перемещены, но журнал отмены не удалось сохранить. Отмена может вернуть не всё.", "collection.org_undo_body": "Вернуть {n} перемещённых элементов к исходным именам и папкам. Изменённые после этого имена и расположения сохраняются.", "collection.org_undo_title": "Отменить этот запуск?", "collection.org_undone": "Отменено: восстановлено {n}, на месте осталось {problems}", @@ -4487,6 +4498,7 @@ drive_detail_changed_here: "{path} изменился на этом устрой drive_detail_changed_there: "{path} изменился на {console} во время синхронизации. Он синхронизируется в следующий раз.", drive_detail_too_many_files: "Больше {limit} файлов: слишком много для Mesh Drive.", drive_detail_list_unreadable: "Эта версия не может прочитать список дисков консоли. Обновите приложение.", +drive_detail_console_list_unreadable: "Консоль не смогла прочитать свой список дисков. Пока не сможет, ничего не изменится.", drive_detail_link_record_damaged: "Запись связи на {console} повреждена.", drive_detail_too_many_for_console: "Слишком много файлов для папки диска на второй консоли.", drive_removed: "Больше не в этом диске", @@ -4508,6 +4520,8 @@ drive_join: "Присоединиться", drive_delete_title: "Удалить диск {name}?", drive_delete_body: "Все устройства перестанут его синхронизировать. Файлы не удаляются: каждая папка, включая папку на консоли, сохранит своё содержимое.", drive_delete: "Удалить диск", +drive_left_later: "Эта папка больше не синхронизируется. {name} не ответила: там папку уберут из диска, когда консоль вернётся. Её файлы остаются на месте.", +drive_deleted_later: "Этот диск больше не хранится на этом устройстве. {name} не ответила: там его удалят, когда консоль вернётся. Файлы не удаляются.", drive_create: "Новый Mesh-диск", drive_create_go: "Создать", drive_title: "Mesh-диск", @@ -4569,13 +4583,14 @@ fs_search_all_drives: "Поиск по всем дискам", fs_more: "Ещё", fs_more_actions: "Ещё: что занимает место, снимки", fs_space_title: "Что занимает место?", +fs_space_here_v2: "Что занимает место в этой папке?", +fs_snapshot_folder_v2: "Сделать снимок этой папки", +fs_space_drive: "Что занимает место на этом диске?", +fs_snapshots_see: "Посмотреть снимки", fs_space_action: "Что занимает место?", -fs_space_here: "Что занимает место здесь?", fs_space_open_folder: "Открыть эту папку", -fs_snapshot_folder: "Снимок этой папки", fs_snapshot_action: "Снимок…", fs_snapshot_tooltip: "Скопировать в снимок на PS5, чтобы вернуть позже", -fs_snapshots_open: "Снимки", fs_snapshot_batch: "Элементов: {count}, по снимку на каждый, с именем элемента и сегодняшней датой:", fs_snapshot_batch_create: "Создать снимков: {count}", fs_snapshot_batch_ok: "Создано снимков: {count}; файлов: {files} ({bytes})", @@ -5359,7 +5374,6 @@ upload_phase_settling_eta: "осталось около {time}", upload_phase_settling_rate: "файлов/с", upload_status_resuming: "Возобновление: {done} из {total} файлов уже на месте ({have}); осталось отправить {send}.", upload_resumed_have: "Возобновлено: {have} уже было на PS5.", -volumes_kept_by_console: "{kept} зарезервировано консолью для собственных нужд", payloads_tab_ps5: "На вашей PS5", payloads_pm_stored_body_v2: "Он в папке «{folder}» Payload Manager. Payload Manager на вкладке «На вашей PS5» запускает его или загружает при старте.", hub_checking: "Проверка того, что есть на этой PS5…", @@ -8966,6 +8980,8 @@ rp_users_add_hint: "Чтобы играть и за другого пользо "receive_cheats_none": "Друг играет без включённых читов.", "receive_stream": "Настройки потока", "receive_stream_body": "Хранятся вместе с остальным полученным.", +"receive_data_unreadable": "Часть нельзя использовать", +"receive_data_unreadable_body": "Часть того, что прислал друг, не в том виде, который читает это приложение, поэтому её пропустили.", "receive_intro_v2": "Вставьте ссылку друга. Вы увидите, что предлагают, прежде чем что-то придёт.", "receive_pick": "Что взять", "receive_total": "Всего {size}", diff --git a/client/src/i18n/locales/th.ts b/client/src/i18n/locales/th.ts index 6532e503c..4f672e950 100644 --- a/client/src/i18n/locales/th.ts +++ b/client/src/i18n/locales/th.ts @@ -190,6 +190,8 @@ update_skipped_note: "คุณข้าม v{version} แล้ว", update_unskip: "ไม่ข้าม", update_toast_installs_on_quit: "ติดตั้งเมื่อออก", update_install_failed_title: "ติดตั้งอัปเดตไม่สำเร็จ", +update_finishing_title: "กำลังอัปเดตให้เสร็จ…", +update_finishing_body: "เมื่อเสร็จแล้ว PS5Upload จะเปิดขึ้นใหม่เอง", update_install_failed_body: "ติดตั้ง v{version} ไม่ได้ PS5Upload จึงยังเป็นเวอร์ชันเดิม", update_install_failed_reason: "สาเหตุ: {message}", update_quit_app: "ออกจาก PS5Upload", @@ -1020,8 +1022,9 @@ fs_verify_result: "ผลการตรวจสอบ", fs_verify_tooltip: "การตรวจสอบด้วย BLAKE3 + CRC32 (ช้ากว่า แต่แข็งแรงระดับการเข้ารหัส)", hardware_storage: "ที่จัดเก็บของเครื่อง", hw_storage_free: "ว่าง", -hw_storage_reserved: "สงวน", -hw_storage_reserved_hint: "ส่วนที่ระบบไฟล์กันไว้ไม่ถูกนับเป็นพื้นที่ว่าง", +hw_storage_held_back: "PS5 กันไว้", +hw_storage_held_back_hint: "นับรวมในส่วนที่ใช้แล้ว ไม่ใช่พื้นที่ว่าง", +hw_storage_note: "ตามที่ระบบไฟล์ของไดรฟ์นับ หน้าจอ Storage ของ PS5 เองอาจแสดงพื้นที่ว่างน้อยกว่านี้ เพราะกันพื้นที่ไว้ให้ระบบมากกว่า", hw_storage_total: "รวม", hw_storage_used: "ใช้แล้ว", klog_clear: "ล้าง", @@ -1209,6 +1212,7 @@ pm_autoload_add: "โหลดตอนบูต", pm_autoload_earlier: "โหลดก่อน", pm_autoload_later: "โหลดทีหลัง", pm_launch: "เปิด", +pm_row_more: "เพิ่มเติมสำหรับ {name}", pm_detected: "Payload Manager {version} บน PS5", pm_autoload_title: "โหลดเพย์โหลดตอนบูต", pm_autoload_hint: "Payload Manager จะเปิดเพย์โหลดที่ทำเครื่องหมายตามลำดับ {delay} วินาทีหลัง PS5 บูต มี {n} รายการ การหยุดพักระหว่างกันคงไว้ตามที่ตั้งใน Payload Manager", @@ -1478,6 +1482,7 @@ upload_change_source: "เปลี่ยนต้นทาง", upload_choose_diff_source: "เลือกแหล่งที่มาอื่น", upload_dest_auto: "(ค่าเริ่มต้น — /data)", upload_dest_card_title: "ปลายทาง", +upload_dest_room: "มีที่สำหรับประมาณ {size}", upload_dest_final_path: "เส้นทางสุดท้ายบน PS5", upload_dest_presets: "ค่าที่ตั้งไว้:", upload_dest_will_create: "หากโฟลเดอร์ปลายทางยังไม่มีอยู่บน PS5 ระบบจะสร้างให้เมื่อคุณเริ่มอัปโหลด", @@ -2575,6 +2580,9 @@ upload_pkg_name_save: "เปลี่ยนชื่อ", upload_pkg_name_all_v2: "ใช้ชื่อนี้ในทุกภาษา (ชื่ออื่นในแพ็กเกจ: {count})", upload_pkg_name_hint: "เปลี่ยนชื่อในไฟล์แพ็กเกจโดยตรงก่อนที่คุณจะติดตั้ง เกมที่ติดตั้งไว้แล้วจะใช้ชื่อเดิมจนกว่าคุณจะติดตั้งใหม่", upload_pkg_name_saved: "เปลี่ยนชื่อแล้ว", +upload_phone_upload_first: "คัดลอกไปยัง PS5 ก่อน แล้วจึงติดตั้ง", +upload_pkg_name_left: "ไบต์ที่เหลือสำหรับชื่อ: {count}", +upload_pkg_name_too_long: "ชื่อนี้ยาวเกินไปสำหรับแพ็กเกจนี้ ไบต์ที่ใส่ได้: {limit} ไบต์ที่เกิน: {count} โปรดทำให้สั้นลง: ตัวอักษรที่มีเครื่องหมายและตัวอักษรที่ไม่ใช่ละตินใช้พื้นที่มากกว่า", upload_pkg_name_retail: "นี่เป็นแพ็กเกจทางการ จึงเปลี่ยนชื่อไม่ได้ เพราะชื่ออยู่ภายใต้ลายเซ็นของผู้จัดจำหน่าย", upload_pkg_name_refused: "เปลี่ยนชื่อแพ็กเกจนี้ไม่ได้: {reason}", upload_pkg_name_failed: "ไม่ได้เปลี่ยนชื่อ: {reason}", @@ -2882,6 +2890,9 @@ remote_copy_task_unknown_server: "คัดลอก {name} จากเซิ upload_split_unsupported_title: "นี่คือไฟล์บีบอัดแบบแบ่งส่วน ({count} ไฟล์ย่อย) ที่ ps5upload เปิดไม่ได้", upload_split_unsupported_body: "การอัปโหลดจะส่งไฟล์ย่อยดิบไปยัง PS5 ซึ่งใช้งานไม่ได้ กรุณารวมไฟล์ย่อยกลับเป็นไฟล์เดียวก่อน โดยเปิดไฟล์ย่อยแรกด้วย 7-Zip หรือ WinRAR แล้วแตกไฟล์ จากนั้นอัปโหลดโฟลเดอร์ที่แตกได้ หรือไฟล์บีบอัดไฟล์เดียวของโฟลเดอร์นั้น", upload_split_unsupported_target: "รวมแล้วได้: {name}", +volumes_held_back: "PS5 กัน {kept} ไว้ใช้เอง นี่ไม่ใช่พื้นที่ว่าง และจะเพิ่มขึ้นเมื่อมีการเขียนข้อมูล", +volumes_likely_fits: "น่าจะใส่ข้อมูลใหม่ได้ประมาณ {safe} ที่นี่", +volumes_ps5_shows_less: "หน้าจอ Storage ของ PS5 เองอาจแสดงพื้นที่ว่างน้อยกว่านี้ ถ้าตัวเลขไม่ตรงกัน ให้ยึดค่าที่น้อยกว่า", // Editing a game image in place (ShadowMount+ checkout) @@ -3306,7 +3317,6 @@ library_mount_tooltip_smp: "ส่งอิมเมจนี้ให้ Shadow "v5_home_no_notifications_desc": "การแจ้งเตือนใหม่จะแสดงที่นี่", "v5_home_view_all": "ดูทั้งหมด", "task_recheck": "ตรวจสอบอีกครั้ง", -"volumes_upload_safe_capacity": "{safe} ปลอดภัยสำหรับการอัปโหลดใหม่ · {reserve} สำรองไว้สำหรับระบบ/ระบบไฟล์", "pkg_storage_fallback_title": "ใช้ที่จัดเก็บภายใน", "pkg_storage_fallback_body": "ไดรฟ์เก็บแพ็กเกจเริ่มต้น ({drive}) ใช้ไม่ได้ แพ็กเกจนี้จึงเก็บในที่จัดเก็บภายใน", "pkglib.meta.drive": "บน {drive}", @@ -4304,6 +4314,7 @@ trace_profile_name: "วัดจาก {n} เซสชันการเล่ "collection.org_summary": "ย้าย {n} รายการ · {size}", "collection.org_title": "จัดระเบียบคอลเลกชัน", "collection.org_undo": "ย้อนกลับ", +"collection.org_undo_incomplete": "ย้ายรายการแล้ว แต่บันทึกสำหรับเลิกทำบันทึกไม่ได้ การเลิกทำอาจนำกลับมาได้ไม่ครบ", "collection.org_undo_body": "ย้าย {n} รายการกลับไปยังชื่อและโฟลเดอร์เดิม รายการที่ถูกย้ายหรือเปลี่ยนชื่อภายหลังจะอยู่ที่เดิม", "collection.org_undo_title": "ย้อนกลับการทำงานนี้หรือไม่", "collection.org_undone": "ย้อนกลับแล้ว: คืนค่า {n} รายการ {problems} รายการอยู่ที่เดิม", @@ -4541,6 +4552,7 @@ drive_detail_changed_here: "{path} เปลี่ยนไปบนอุปก drive_detail_changed_there: "{path} เปลี่ยนไปบน {console} ระหว่างซิงค์ จะซิงค์ในครั้งถัดไป", drive_detail_too_many_files: "มีไฟล์มากกว่า {limit} ไฟล์: มากเกินไปสำหรับ Mesh Drive", drive_detail_list_unreadable: "เวอร์ชันนี้อ่านรายการไดรฟ์ของคอนโซลไม่ได้ อัปเดตแอปนี้", +drive_detail_console_list_unreadable: "คอนโซลอ่านรายการไดรฟ์ของตัวเองไม่ได้ จะไม่มีอะไรเปลี่ยนจนกว่าจะอ่านได้", drive_detail_link_record_damaged: "บันทึกของลิงก์บน {console} เสียหาย", drive_detail_too_many_for_console: "ไฟล์มากเกินไปสำหรับโฟลเดอร์ไดรฟ์บนคอนโซลเครื่องที่สอง", drive_removed: "ไม่อยู่ในไดรฟ์นี้แล้ว", @@ -4562,6 +4574,8 @@ drive_join: "เข้าร่วม", drive_delete_title: "ลบไดรฟ์ {name} หรือไม่?", drive_delete_body: "ทุกอุปกรณ์จะหยุดซิงค์ไดรฟ์นี้ ไม่มีไฟล์ใดถูกลบ: ทุกโฟลเดอร์ รวมถึงโฟลเดอร์บนคอนโซล จะเก็บสิ่งที่มีอยู่ไว้", drive_delete: "ลบไดรฟ์", +drive_left_later: "โฟลเดอร์นี้ไม่ซิงค์อีกแล้ว {name} ไม่ตอบ: จะถูกนำออกจากไดรฟ์ที่นั่นเมื่อกลับมา ไฟล์ของโฟลเดอร์ยังอยู่ที่เดิม", +drive_deleted_later: "ไดรฟ์นี้ไม่ได้เก็บไว้บนอุปกรณ์นี้อีกแล้ว {name} ไม่ตอบ: จะถูกลบที่นั่นเมื่อกลับมา ไม่มีไฟล์ใดถูกลบ", drive_create: "เมชไดรฟ์ใหม่", drive_create_go: "สร้าง", drive_title: "เมชไดรฟ์", @@ -4623,13 +4637,14 @@ fs_search_all_drives: "ค้นหาทุกไดรฟ์", fs_more: "เพิ่มเติม", fs_more_actions: "เพิ่มเติม: อะไรกินพื้นที่, สแนปช็อต", fs_space_title: "อะไรกินพื้นที่?", +fs_space_here_v2: "อะไรใช้พื้นที่ในโฟลเดอร์นี้?", +fs_snapshot_folder_v2: "สร้างสแนปช็อตของโฟลเดอร์นี้", +fs_space_drive: "อะไรใช้พื้นที่ในไดรฟ์นี้?", +fs_snapshots_see: "ดูสแนปช็อต", fs_space_action: "อะไรกินพื้นที่?", -fs_space_here: "อะไรกินพื้นที่ตรงนี้?", fs_space_open_folder: "เปิดโฟลเดอร์นี้", -fs_snapshot_folder: "สแนปช็อตโฟลเดอร์นี้", fs_snapshot_action: "สแนปช็อต…", fs_snapshot_tooltip: "คัดลอกเป็นสแนปช็อตเก็บไว้บน PS5 เพื่อนำกลับมาภายหลัง", -fs_snapshots_open: "สแนปช็อต", fs_snapshot_batch: "{count} รายการ รายการละหนึ่งสแนปช็อต ตั้งชื่อตามรายการและวันที่วันนี้:", fs_snapshot_batch_create: "สร้าง {count} สแนปช็อต", fs_snapshot_batch_ok: "สร้าง {count} สแนปช็อตแล้ว: {files} ไฟล์ ({bytes})", @@ -5413,7 +5428,6 @@ upload_phase_settling_eta: "เหลืออีกประมาณ {time}", upload_phase_settling_rate: "ไฟล์/วินาที", upload_status_resuming: "กำลังทำต่อ: มีไฟล์อยู่แล้ว {done} จาก {total} ไฟล์ ({have}); ต้องส่ง {send}", upload_resumed_have: "ทำต่อแล้ว: มี {have} อยู่บน PS5 แล้ว", -volumes_kept_by_console: "{kept} ถูกเครื่องเก็บไว้ใช้เอง", payloads_tab_ps5: "บน PS5 ของคุณ", payloads_pm_stored_body_v2: "อยู่ในโฟลเดอร์ \"{folder}\" ของ Payload Manager โดย Payload Manager ในแท็บ บน PS5 ของคุณ จะเปิดหรือโหลดตอนบูต", hub_checking: "กำลังตรวจสอบสิ่งที่อยู่บน PS5 นี้…", @@ -9020,6 +9034,8 @@ rp_users_add_hint: "หากต้องการเล่นในฐานะ "receive_cheats_none": "เพื่อนเล่นโดยไม่เปิดตัวใดเลย", "receive_stream": "การตั้งค่าสตรีม", "receive_stream_body": "เก็บไว้รวมกับสิ่งอื่นที่คุณได้รับ", +"receive_data_unreadable": "บางส่วนใช้ไม่ได้", +"receive_data_unreadable_body": "บางส่วนที่เพื่อนส่งมาไม่อยู่ในรูปแบบที่แอปนี้อ่านได้ จึงถูกข้ามไป", "receive_intro_v2": "วางลิงก์ของเพื่อน คุณจะเห็นสิ่งที่เพื่อนเสนอก่อนที่อะไรจะส่งมา", "receive_pick": "เลือกสิ่งที่จะรับ", "receive_total": "รวม {size}", diff --git a/client/src/i18n/locales/tr.ts b/client/src/i18n/locales/tr.ts index 4eaa0d350..1a18e31a8 100644 --- a/client/src/i18n/locales/tr.ts +++ b/client/src/i18n/locales/tr.ts @@ -190,6 +190,8 @@ update_skipped_note: "v{version} sürümünü atladınız.", update_unskip: "Atlama", update_toast_installs_on_quit: "çıkarken kurulur", update_install_failed_title: "Güncelleme yüklenmedi", +update_finishing_title: "Güncelleme tamamlanıyor…", +update_finishing_body: "Bitince PS5Upload kendiliğinden yeniden başlar.", update_install_failed_body: "v{version} yüklenemedi, bu yüzden PS5Upload eski sürümde kaldı.", update_install_failed_reason: "Neden: {message}", update_quit_app: "PS5Upload'dan çık", @@ -1020,8 +1022,9 @@ fs_verify_result: "Doğrulama sonucu", fs_verify_tooltip: "BLAKE3 + CRC32 doğrulaması (daha yavaş, kriptografik güçte)", hardware_storage: "Konsol depolaması", hw_storage_free: "Boş", -hw_storage_reserved: "Rezerve", -hw_storage_reserved_hint: "Dosya sistemince ayrılan dilim boş alan sayılmaz", +hw_storage_held_back: "PS5'in ayırdığı", +hw_storage_held_back_hint: "Kullanılan içinde sayılır. Boş alan değildir.", +hw_storage_note: "Sürücünün dosya sisteminin saydığı gibi. PS5'in kendi Depolama ekranı daha az boş alan gösterebilir: sistem için daha fazlasını ayırır.", hw_storage_total: "Toplam", hw_storage_used: "Kullanılan", klog_clear: "Temizle", @@ -1209,6 +1212,7 @@ pm_autoload_add: "Açılışta yükle", pm_autoload_earlier: "Daha önce yükle", pm_autoload_later: "Daha sonra yükle", pm_launch: "Başlat", +pm_row_more: "{name} için daha fazlası", pm_detected: "PS5'te Payload Manager {version}", pm_autoload_title: "Açılışta payload yükle", pm_autoload_hint: "Payload Manager, işaretli payload'ları PS5 açıldıktan {delay} sn sonra sırayla başlatır. Listede {n} var. Aralarındaki duraklamalar Payload Manager'da ayarlandığı gibi kalır.", @@ -1478,6 +1482,7 @@ upload_change_source: "Kaynağı değiştir", upload_choose_diff_source: "Farklı bir kaynak seç", upload_dest_auto: "(varsayılan — /data)", upload_dest_card_title: "Hedef", +upload_dest_room: "yaklaşık {size} için yer", upload_dest_final_path: "PS5'teki son yol", upload_dest_presets: "Ön ayarlar:", upload_dest_will_create: "Hedef klasör PS5'te henüz yoksa, yüklemeyi başlattığınızda oluşturulur.", @@ -2575,6 +2580,9 @@ upload_pkg_name_save: "Adı değiştir", upload_pkg_name_all_v2: "Bu adı her dilde kullan (paketteki başka adlar: {count})", upload_pkg_name_hint: "Adı, yüklemeden önce paket dosyasının içinde değiştirir. Zaten yüklü bir oyun, yeniden yükleyene kadar adını korur.", upload_pkg_name_saved: "Ad değiştirildi.", +upload_phone_upload_first: "Önce PS5'e kopyalar, sonra kurar.", +upload_pkg_name_left: "Ad için kalan bayt: {count}", +upload_pkg_name_too_long: "Bu ad bu paket için çok uzun. Sığan bayt: {limit}. Fazla bayt: {count}. Kısaltın: aksanlı harfler ve Latin olmayan harfler daha çok yer kaplar.", upload_pkg_name_retail: "Bu resmî bir paket, bu yüzden adı değiştirilemez: ad, yayıncısının imzası kapsamındadır.", upload_pkg_name_refused: "Bu paketin adı değiştirilemez: {reason}", upload_pkg_name_failed: "Ad değiştirilmedi: {reason}", @@ -2882,6 +2890,9 @@ remote_copy_task_unknown_server: "{name}, sunucudan kopyalanıyor", upload_split_unsupported_title: "Bu, ps5upload'ın açamadığı bölünmüş bir arşiv ({count} birim)", upload_split_unsupported_body: "Yüklemek ham birimi PS5'inize gönderir ve PS5 bunu kullanamaz. Önce birimleri tek bir arşivde birleştirin: ilk birimi 7-Zip veya WinRAR ile açıp çıkarın, sonra çıkarılan klasörü ya da tek bir arşivini yükleyin.", upload_split_unsupported_target: "Birleşince: {name}", +volumes_held_back: "{kept} alanı PS5 kendisi için ayırır. Bu boş alan değildir ve veri yazıldıkça büyür.", +volumes_likely_fits: "Buraya muhtemelen yaklaşık {safe} yeni veri sığar.", +volumes_ps5_shows_less: "PS5'in kendi Depolama ekranı daha az boş alan gösterebilir. İkisi farklıysa küçük olanı esas alın.", // Editing a game image in place (ShadowMount+ checkout) @@ -3306,7 +3317,6 @@ library_mount_tooltip_smp: "Bu imajı ShadowMount+'a devret; onu bağlayıp kayd "v5_home_no_notifications_desc": "Yeni uyarılar burada görünecek.", "v5_home_view_all": "Tümünü gör", "task_recheck": "Yeniden kontrol et", -"volumes_upload_safe_capacity": "Yeni yüklemeler için {safe} güvenli · {reserve} sistem/dosya sistemi payı olarak ayrıldı", "pkg_storage_fallback_title": "Dahili depolama kullanılıyor", "pkg_storage_fallback_body": "Varsayılan paket sürücüsü ({drive}) kullanılamıyor, bu yüzden bu paket dahili depolamaya gidiyor.", "pkglib.meta.drive": "{drive} üzerinde", @@ -4304,6 +4314,7 @@ trace_profile_name: "{n} oyun oturumundan ölçüldü", "collection.org_summary": "{n} taşıma · {size}", "collection.org_title": "Koleksiyonu düzenle", "collection.org_undo": "Geri al", +"collection.org_undo_incomplete": "Öğeler taşındı, ancak geri alma günlüğü kaydedilemedi. Geri al her şeyi yerine koymayabilir.", "collection.org_undo_body": "Taşınan {n} öğe eski adlarına ve klasörlerine döner. Daha sonra taşınan veya yeniden adlandırılan öğeler yerinde kalır.", "collection.org_undo_title": "Bu çalıştırma geri alınsın mı?", "collection.org_undone": "Geri alındı: {n} geri getirildi, {problems} olduğu yerde kaldı", @@ -4541,6 +4552,7 @@ drive_detail_changed_here: "{path} eşitlenirken bu cihazda değişti. Bir sonra drive_detail_changed_there: "{path} eşitlenirken {console} üzerinde değişti. Bir sonraki sefer eşitlenecek.", drive_detail_too_many_files: "{limit} dosyadan fazla: Mesh Drive için çok fazla.", drive_detail_list_unreadable: "Bu sürüm konsolun sürücü listesini okuyamıyor. Bu uygulamayı güncelle.", +drive_detail_console_list_unreadable: "Konsol sürücü listesini okuyamadı. Okuyabilene kadar hiçbir şey değişmez.", drive_detail_link_record_damaged: "{console} üzerindeki bağlantı kaydı bozuk.", drive_detail_too_many_for_console: "İkinci bir konsoldaki sürücü klasörü için çok fazla dosya.", drive_removed: "Artık bu sürücüde değil", @@ -4562,6 +4574,8 @@ drive_join: "Katıl", drive_delete_title: "{name} sürücüsü silinsin mi?", drive_delete_body: "Hiçbir cihaz onu artık eşitlemez. Hiçbir dosya silinmez: her klasör ve konsoldaki klasör elindekini korur.", drive_delete: "Sürücüyü sil", +drive_left_later: "Bu klasör artık eşitlenmiyor. {name} yanıt vermedi: geri geldiğinde oradaki sürücüden çıkarılır. Dosyaları oldukları yerde kalır.", +drive_deleted_later: "Sürücü artık bu cihazda tutulmuyor. {name} yanıt vermedi: geri geldiğinde orada silinir. Hiçbir dosya silinmez.", drive_create: "Yeni Mesh Sürücü", drive_create_go: "Oluştur", drive_title: "Mesh Sürücü", @@ -4623,13 +4637,14 @@ fs_search_all_drives: "Tüm sürücülerde ara", fs_more: "Daha fazla", fs_more_actions: "Daha fazla: yer kaplayanlar, anlık görüntüler", fs_space_title: "Yeri ne kaplıyor?", +fs_space_here_v2: "Bu klasörde yeri ne kaplıyor?", +fs_snapshot_folder_v2: "Bu klasörün anlık görüntüsünü al", +fs_space_drive: "Bu sürücüde yeri ne kaplıyor?", +fs_snapshots_see: "Anlık görüntüleri gör", fs_space_action: "Yeri ne kaplıyor?", -fs_space_here: "Burada yeri ne kaplıyor?", fs_space_open_folder: "Bu klasörü aç", -fs_snapshot_folder: "Bu klasörün anlık görüntüsü", fs_snapshot_action: "Anlık görüntü…", fs_snapshot_tooltip: "Daha sonra geri koymak için PS5'te tutulan bir anlık görüntüye kopyala", -fs_snapshots_open: "Anlık görüntüler", fs_snapshot_batch: "{count} öğe, her biri için bir anlık görüntü, öğenin adı ve bugünün tarihiyle:", fs_snapshot_batch_create: "{count} anlık görüntü oluştur", fs_snapshot_batch_ok: "{count} anlık görüntü oluşturuldu: {files} dosya ({bytes})", @@ -5413,7 +5428,6 @@ upload_phase_settling_eta: "yaklaşık {time} kaldı", upload_phase_settling_rate: "dosya/sn", upload_status_resuming: "Sürdürülüyor: {done}/{total} dosya zaten var ({have}); gönderilecek: {send}.", upload_resumed_have: "Sürdürüldü: {have} zaten PS5'teydi.", -volumes_kept_by_console: "{kept} konsol tarafından kendi kullanımı için ayrıldı", payloads_tab_ps5: "PS5'inizde", payloads_pm_stored_body_v2: "Payload Manager'ın \"{folder}\" klasöründe. PS5'inizde sekmesindeki Payload Manager onu başlatır veya açılışta yükler.", hub_checking: "Bu PS5'te neler olduğu kontrol ediliyor…", @@ -9020,6 +9034,8 @@ rp_users_add_hint: "Başka bir kullanıcıyla da oynamak için PS5'te o kullanı "receive_cheats_none": "Hiç hile açmadan oynuyor.", "receive_stream": "Yayın ayarları", "receive_stream_body": "Aldığın diğer şeylerle birlikte saklanır.", +"receive_data_unreadable": "Bir kısmı kullanılamıyor", +"receive_data_unreadable_body": "Arkadaşının gönderdiklerinin bir kısmı bu uygulamanın okuyabildiği biçimde değil, bu yüzden dışarıda bırakıldı.", "receive_intro_v2": "Bağlantısını yapıştır. Bir şey gelmeden önce ne sunduğunu görürsün.", "receive_pick": "Ne alınacak", "receive_total": "Toplam {size}", diff --git a/client/src/i18n/locales/vi.ts b/client/src/i18n/locales/vi.ts index 332b6f024..e47266c56 100644 --- a/client/src/i18n/locales/vi.ts +++ b/client/src/i18n/locales/vi.ts @@ -191,6 +191,8 @@ update_skipped_note: "Bạn đã bỏ qua v{version}.", update_unskip: "Không bỏ qua", update_toast_installs_on_quit: "sẽ cài khi thoát", update_install_failed_title: "Bản cập nhật chưa được cài", +update_finishing_title: "Đang hoàn tất cập nhật…", +update_finishing_body: "Khi xong, PS5Upload sẽ tự mở lại.", update_install_failed_body: "Không cài được v{version}, nên PS5Upload vẫn ở phiên bản cũ.", update_install_failed_reason: "Lý do: {message}", update_quit_app: "Thoát PS5Upload", @@ -1022,8 +1024,9 @@ fs_verify_result: "Kết quả xác minh", fs_verify_tooltip: "Xác minh BLAKE3 + CRC32 (chậm hơn, đạt độ mạnh mật mã)", hardware_storage: "Bộ nhớ máy chơi game", hw_storage_free: "Trống", -hw_storage_reserved: "Đã dành riêng", -hw_storage_reserved_hint: "Phần do hệ thống tệp giữ lại không được tính là trống", +hw_storage_held_back: "PS5 giữ lại", +hw_storage_held_back_hint: "Đã tính trong Đã dùng. Không phải dung lượng trống.", +hw_storage_note: "Theo cách hệ thống tệp của ổ đĩa đếm. Màn hình Lưu trữ của chính PS5 có thể hiện ít dung lượng trống hơn: máy giữ lại thêm cho hệ thống.", hw_storage_total: "Tổng", hw_storage_used: "Đã dùng", klog_clear: "Xóa", @@ -1211,6 +1214,7 @@ pm_autoload_add: "Nạp khi khởi động", pm_autoload_earlier: "Nạp sớm hơn", pm_autoload_later: "Nạp muộn hơn", pm_launch: "Chạy", +pm_row_more: "Thêm cho {name}", pm_detected: "Payload Manager {version} trên PS5", pm_autoload_title: "Nạp payload khi khởi động", pm_autoload_hint: "Payload Manager chạy các payload đã đánh dấu theo thứ tự {delay} giây sau khi PS5 khởi động. {n} trong danh sách. Các khoảng dừng giữa chúng giữ nguyên như đã đặt trong Payload Manager.", @@ -1480,6 +1484,7 @@ upload_change_source: "Đổi nguồn", upload_choose_diff_source: "Chọn nguồn khác", upload_dest_auto: "(mặc định — /data)", upload_dest_card_title: "Đích đến", +upload_dest_room: "đủ chỗ cho khoảng {size}", upload_dest_final_path: "Đường dẫn cuối cùng trên PS5", upload_dest_presets: "Cài sẵn:", upload_dest_will_create: "Nếu thư mục đích chưa tồn tại trên PS5, nó sẽ được tạo khi bạn bắt đầu tải lên.", @@ -2570,6 +2575,9 @@ upload_pkg_name_save: "Đổi tên", upload_pkg_name_all_v2: "Dùng tên này cho mọi ngôn ngữ (tên khác trong gói: {count})", upload_pkg_name_hint: "Đổi tên ngay trong tệp gói, trước khi bạn cài đặt. Game đã cài vẫn giữ tên cũ cho đến khi bạn cài lại.", upload_pkg_name_saved: "Đã đổi tên.", +upload_phone_upload_first: "Sao chép vào PS5 trước rồi mới cài đặt.", +upload_pkg_name_left: "Số byte còn lại cho tên: {count}", +upload_pkg_name_too_long: "Tên này quá dài đối với gói này. Số byte chứa được: {limit}. Số byte vượt quá: {count}. Hãy rút ngắn: chữ có dấu và chữ không thuộc bảng Latin chiếm nhiều chỗ hơn.", upload_pkg_name_retail: "Đây là gói chính thức nên không thể đổi tên: tên nằm trong phần được chữ ký của nhà phát hành bảo vệ.", upload_pkg_name_refused: "Không thể đổi tên gói này: {reason}", upload_pkg_name_failed: "Chưa đổi tên: {reason}", @@ -2877,6 +2885,9 @@ remote_copy_task_unknown_server: "Sao chép {name} từ máy chủ", upload_split_unsupported_title: "Đây là kho lưu trữ chia nhỏ ({count} tập) mà ps5upload không mở được", upload_split_unsupported_body: "Tải lên sẽ gửi tập thô sang PS5 và máy không dùng được. Hãy ghép các tập lại thành một tệp trước: mở tập đầu tiên bằng 7-Zip hoặc WinRAR rồi giải nén, sau đó tải lên thư mục đã giải nén hoặc một tệp nén duy nhất.", upload_split_unsupported_target: "Ghép lại thành: {name}", +volumes_held_back: "PS5 giữ lại {kept} cho chính nó. Đây không phải dung lượng trống, và sẽ tăng khi ghi thêm dữ liệu.", +volumes_likely_fits: "Có lẽ chứa được khoảng {safe} dữ liệu mới ở đây.", +volumes_ps5_shows_less: "Màn hình Lưu trữ của chính PS5 có thể hiện ít dung lượng trống hơn. Khi hai số khác nhau, hãy theo số nhỏ hơn.", // Editing a game image in place (ShadowMount+ checkout) @@ -3301,7 +3312,6 @@ library_mount_tooltip_smp: "Giao ảnh đĩa này cho ShadowMount+, nó sẽ g "v5_home_no_notifications_desc": "Cảnh báo mới sẽ hiện ở đây.", "v5_home_view_all": "Xem tất cả", "task_recheck": "Kiểm tra lại", -"volumes_upload_safe_capacity": "{safe} an toàn cho tải lên mới · {reserve} giữ lại làm dự phòng cho hệ thống/hệ thống tệp", "pkg_storage_fallback_title": "Đang dùng bộ nhớ trong", "pkg_storage_fallback_body": "Ổ lưu gói mặc định ({drive}) không khả dụng, nên gói này được lưu vào bộ nhớ trong.", "pkglib.meta.drive": "trên {drive}", @@ -4299,6 +4309,7 @@ trace_profile_name: "đo từ {n} phiên chơi", "collection.org_summary": "{n} lượt chuyển · {size}", "collection.org_title": "Sắp xếp bộ sưu tập", "collection.org_undo": "Hoàn tác", +"collection.org_undo_incomplete": "Các mục đã được di chuyển, nhưng không lưu được nhật ký hoàn tác. Hoàn tác có thể không đưa mọi thứ về chỗ cũ.", "collection.org_undo_body": "Đưa {n} mục đã di chuyển về tên và thư mục ban đầu. Các mục đã được di chuyển hoặc đổi tên sau đó sẽ giữ nguyên.", "collection.org_undo_title": "Hoàn tác lần chạy này?", "collection.org_undone": "Đã hoàn tác: khôi phục {n}, {problems} giữ nguyên chỗ", @@ -4536,6 +4547,7 @@ drive_detail_changed_here: "{path} đã thay đổi trên thiết bị này tron drive_detail_changed_there: "{path} đã thay đổi trên {console} trong khi đồng bộ. Nó sẽ được đồng bộ vào lần sau.", drive_detail_too_many_files: "Hơn {limit} tệp: quá nhiều cho một Mesh Drive.", drive_detail_list_unreadable: "Phiên bản này không đọc được danh sách drive của console. Hãy cập nhật ứng dụng này.", +drive_detail_console_list_unreadable: "Console không đọc được danh sách drive của nó. Sẽ không có gì thay đổi cho đến khi đọc được.", drive_detail_link_record_damaged: "Bản ghi liên kết trên {console} bị hỏng.", drive_detail_too_many_for_console: "Quá nhiều tệp cho một thư mục drive trên console thứ hai.", drive_removed: "Không còn trong drive này", @@ -4557,6 +4569,8 @@ drive_join: "Tham gia", drive_delete_title: "Xóa drive {name}?", drive_delete_body: "Mọi thiết bị ngừng đồng bộ nó. Không tệp nào bị xóa: mỗi thư mục, kể cả thư mục trên console, giữ nguyên những gì đang có.", drive_delete: "Xóa drive", +drive_left_later: "Thư mục này không còn được đồng bộ. {name} không phản hồi: thư mục sẽ được gỡ khỏi drive ở đó khi console trở lại. Các tệp của nó vẫn ở nguyên chỗ cũ.", +drive_deleted_later: "Drive này không còn được giữ trên thiết bị này. {name} không phản hồi: drive sẽ bị xóa ở đó khi console trở lại. Không tệp nào bị xóa.", drive_create: "Ổ đồng bộ mới", drive_create_go: "Tạo", drive_title: "Ổ đồng bộ", @@ -4618,13 +4632,14 @@ fs_search_all_drives: "Tìm trên mọi ổ đĩa", fs_more: "Thêm", fs_more_actions: "Thêm: thứ chiếm dung lượng, ảnh chụp nhanh", fs_space_title: "Thứ gì chiếm dung lượng?", +fs_space_here_v2: "Thứ gì chiếm dung lượng trong thư mục này?", +fs_snapshot_folder_v2: "Tạo ảnh chụp nhanh thư mục này", +fs_space_drive: "Thứ gì chiếm dung lượng trên ổ này?", +fs_snapshots_see: "Xem ảnh chụp nhanh", fs_space_action: "Thứ gì chiếm dung lượng?", -fs_space_here: "Thứ gì chiếm dung lượng ở đây?", fs_space_open_folder: "Mở thư mục này", -fs_snapshot_folder: "Chụp nhanh thư mục này", fs_snapshot_action: "Chụp nhanh…", fs_snapshot_tooltip: "Sao chép vào ảnh chụp nhanh lưu trên PS5 để khôi phục sau", -fs_snapshots_open: "Ảnh chụp nhanh", fs_snapshot_batch: "{count} mục, mỗi mục một ảnh chụp nhanh, đặt tên theo mục và ngày hôm nay:", fs_snapshot_batch_create: "Tạo {count} ảnh chụp nhanh", fs_snapshot_batch_ok: "Đã tạo {count} ảnh chụp nhanh: {files} tệp ({bytes})", @@ -5408,7 +5423,6 @@ upload_phase_settling_eta: "còn khoảng {time}", upload_phase_settling_rate: "tệp/s", upload_status_resuming: "Đang tiếp tục: {done} / {total} tệp đã có sẵn ({have}); còn {send} cần gửi.", upload_resumed_have: "Đã tiếp tục: {have} đã có sẵn trên PS5.", -volumes_kept_by_console: "{kept} được máy giữ cho mục đích riêng", payloads_tab_ps5: "Trên PS5 của bạn", payloads_pm_stored_body_v2: "Nó nằm trong thư mục \"{folder}\" của Payload Manager. Payload Manager ở thẻ Trên PS5 của bạn sẽ chạy nó hoặc nạp khi khởi động.", hub_checking: "Đang kiểm tra những gì có trên PS5 này…", @@ -9015,6 +9029,8 @@ rp_users_add_hint: "Để chơi bằng cả người dùng khác, hãy đăng nh "receive_cheats_none": "Họ không bật mã nào.", "receive_stream": "Cài đặt luồng", "receive_stream_body": "Được giữ cùng những thứ khác bạn đã nhận.", +"receive_data_unreadable": "Một phần không dùng được", +"receive_data_unreadable_body": "Một phần bạn của bạn gửi không ở dạng ứng dụng này đọc được nên đã bị bỏ qua.", "receive_intro_v2": "Dán liên kết của họ. Bạn sẽ thấy họ gửi gì trước khi có gì được chuyển tới.", "receive_pick": "Nhận những gì", "receive_total": "Tổng {size}", diff --git a/client/src/i18n/locales/zh-CN.ts b/client/src/i18n/locales/zh-CN.ts index 5e7cd30c7..04c4333bd 100644 --- a/client/src/i18n/locales/zh-CN.ts +++ b/client/src/i18n/locales/zh-CN.ts @@ -192,6 +192,8 @@ update_skipped_note: "你已跳过 v{version}。", update_unskip: "不跳过", update_toast_installs_on_quit: "退出时安装", update_install_failed_title: "更新未安装", +update_finishing_title: "正在完成更新…", +update_finishing_body: "完成后 PS5Upload 会自动重新启动。", update_install_failed_body: "无法安装 v{version},PS5Upload 仍是旧版本。", update_install_failed_reason: "原因:{message}", update_quit_app: "退出 PS5Upload", @@ -1027,8 +1029,9 @@ fs_verify_result: "校验结果", fs_verify_tooltip: "BLAKE3 + CRC32 校验(较慢,具备加密强度)", hardware_storage: "主机存储", hw_storage_free: "可用", -hw_storage_reserved: "保留", -hw_storage_reserved_hint: "文件系统保留的部分不计入可用空间", +hw_storage_held_back: "PS5 预留", +hw_storage_held_back_hint: "已计入已用,不是可用空间。", +hw_storage_note: "按驱动器文件系统的统计。PS5 自己的存储空间画面可能显示更少的可用空间:它为系统预留了更多。", hw_storage_total: "总计", hw_storage_used: "已用", klog_clear: "清空", @@ -1216,6 +1219,7 @@ pm_autoload_add: "开机时加载", pm_autoload_earlier: "提前加载", pm_autoload_later: "延后加载", pm_launch: "启动", +pm_row_more: "{name} 的更多操作", pm_detected: "PS5 上的 Payload Manager {version}", pm_autoload_title: "开机时加载 payload", pm_autoload_hint: "Payload Manager 在 PS5 开机 {delay} 秒后按顺序启动已标记的 payload。列表中有 {n} 个。它们之间的停顿保持 Payload Manager 中的设置。", @@ -1485,6 +1489,7 @@ upload_change_source: "更换来源", upload_choose_diff_source: "选择其他来源", upload_dest_auto: "(默认 — /data)", upload_dest_card_title: "目标位置", +upload_dest_room: "约可容纳 {size}", upload_dest_final_path: "PS5 上的最终路径", upload_dest_presets: "预设:", upload_dest_will_create: "如果目标文件夹在 PS5 上尚不存在,将在你开始上传时创建。", @@ -2527,6 +2532,9 @@ upload_pkg_name_save: "更改名称", upload_pkg_name_all_v2: "所有语言都使用此名称(安装包内其他名称:{count})", upload_pkg_name_hint: "在安装之前,直接修改安装包文件里的名称。已安装的游戏会保留原名称,直到你重新安装。", upload_pkg_name_saved: "名称已更改。", +upload_phone_upload_first: "先复制到 PS5,再安装。", +upload_pkg_name_left: "名称剩余字节数:{count}", +upload_pkg_name_too_long: "这个名称对此安装包来说太长。可容纳字节数:{limit}。超出字节数:{count}。请缩短:带重音的字母和非拉丁字母占用更多空间。", upload_pkg_name_retail: "这是官方安装包,因此无法更改名称:名称受发行商的签名保护。", upload_pkg_name_refused: "无法更改此安装包的名称:{reason}", upload_pkg_name_failed: "名称未更改:{reason}", @@ -2834,6 +2842,9 @@ remote_copy_task_unknown_server: "从服务器复制 {name}", upload_split_unsupported_title: "这是 ps5upload 无法打开的分卷压缩包(共 {count} 个分卷)", upload_split_unsupported_body: "直接上传只会把原始分卷传到 PS5,主机无法使用。请先把分卷合并回一个压缩包:用 7-Zip 或 WinRAR 打开第一个分卷并解压,然后上传解压后的文件夹,或将其重新打包成单个压缩包再上传。", upload_split_unsupported_target: "合并后为:{name}", +volumes_held_back: "PS5 为自身预留了 {kept}。这不是可用空间,并会随着写入数据而增加。", +volumes_likely_fits: "这里大约还能放下 {safe} 的新数据。", +volumes_ps5_shows_less: "PS5 自己的存储空间画面可能显示更少的可用空间。两者不一致时,以较小的为准。", // Editing a game image in place (ShadowMount+ checkout) @@ -3258,7 +3269,6 @@ library_mount_tooltip_smp: "把此镜像交给 ShadowMount+,由它挂载并注 "v5_home_no_notifications_desc": "新的提醒会显示在这里。", "v5_home_view_all": "查看全部", "task_recheck": "重新检查", -"volumes_upload_safe_capacity": "{safe} 可安全用于新上传 · {reserve} 保留给系统/文件系统", "pkg_storage_fallback_title": "使用内部存储", "pkg_storage_fallback_body": "默认安装包磁盘({drive})不可用,此安装包将保存到内部存储。", "pkglib.meta.drive": "位于 {drive}", @@ -4256,6 +4266,7 @@ trace_profile_name: "由 {n} 次游玩会话测得", "collection.org_summary": "{n} 项移动 · {size}", "collection.org_title": "整理收藏库", "collection.org_undo": "撤销", +"collection.org_undo_incomplete": "项目已移动,但撤销日志未能保存。撤销可能无法全部恢复。", "collection.org_undo_body": "将已移动的 {n} 项恢复到原名称和位置。此后已被移动或重命名的项目保持原样。", "collection.org_undo_title": "撤销这次操作?", "collection.org_undone": "已撤销:恢复 {n} 个,{problems} 个保持原处", @@ -4493,6 +4504,7 @@ drive_detail_changed_here: "同步期间 {path} 在此设备上发生了变化 drive_detail_changed_there: "同步期间 {path} 在 {console} 上发生了变化。下次会同步。", drive_detail_too_many_files: "超过 {limit} 个文件:对 Mesh Drive 来说太多了。", drive_detail_list_unreadable: "此版本无法读取主机的盘列表。请更新此应用。", +drive_detail_console_list_unreadable: "主机无法读取它的盘列表。在能读取之前,不会有任何更改。", drive_detail_link_record_damaged: "{console} 上的链接记录已损坏。", drive_detail_too_many_for_console: "文件太多,无法放入第二台主机上的盘文件夹。", drive_removed: "已不在此盘中", @@ -4514,6 +4526,8 @@ drive_join: "加入", drive_delete_title: "删除盘 {name}?", drive_delete_body: "所有设备都会停止同步它。不会删除任何文件:每个文件夹以及主机上的文件夹都保留现有内容。", drive_delete: "删除盘", +drive_left_later: "此文件夹不再同步。{name} 没有响应:等它回来后,会在那边把此文件夹移出该盘。文件夹里的文件保持原样。", +drive_deleted_later: "此设备不再保留该盘。{name} 没有响应:等它回来后,那边也会删除该盘。不会删除任何文件。", drive_create: "新建同步盘", drive_create_go: "创建", drive_title: "同步盘", @@ -4575,13 +4589,14 @@ fs_search_all_drives: "搜索所有驱动器", fs_more: "更多", fs_more_actions: "更多:占用空间的内容、快照", fs_space_title: "什么占用了空间?", +fs_space_here_v2: "这个文件夹里什么占用了空间?", +fs_snapshot_folder_v2: "为这个文件夹创建快照", +fs_space_drive: "这个驱动器上什么占用了空间?", +fs_snapshots_see: "查看快照", fs_space_action: "什么占用了空间?", -fs_space_here: "这里什么占用了空间?", fs_space_open_folder: "打开此文件夹", -fs_snapshot_folder: "为此文件夹创建快照", fs_snapshot_action: "快照…", fs_snapshot_tooltip: "复制到保存在 PS5 上的快照,以便以后恢复", -fs_snapshots_open: "快照", fs_snapshot_batch: "{count} 项,每项一个快照,以项目名和今天的日期命名:", fs_snapshot_batch_create: "创建 {count} 个快照", fs_snapshot_batch_ok: "已创建 {count} 个快照:{files} 个文件({bytes})", @@ -5365,7 +5380,6 @@ upload_phase_settling_eta: "大约还剩 {time}", upload_phase_settling_rate: "文件/秒", upload_status_resuming: "正在继续:{total} 个文件中已有 {done} 个({have});还需发送 {send}。", upload_resumed_have: "已继续:PS5 上已有 {have}。", -volumes_kept_by_console: "{kept} 由主机留作自用", payloads_tab_ps5: "PS5 上", payloads_pm_stored_body_v2: "它位于 Payload Manager 的“{folder}”文件夹中。可在“PS5 上”标签页的 Payload Manager 中启动它或设为开机加载。", hub_checking: "正在检查这台 PS5 上的内容…", @@ -8972,6 +8986,8 @@ rp_users_add_hint: "若也想以其他用户游玩,请在 PS5 上登录该用 "receive_cheats_none": "对方没有开启任何项目。", "receive_stream": "串流设置", "receive_stream_body": "与你收到的其他内容一起保存。", +"receive_data_unreadable": "部分内容无法使用", +"receive_data_unreadable_body": "好友发送的部分内容不是本应用能读取的格式,因此已略过。", "receive_intro_v2": "粘贴对方的链接。在任何内容传过来之前,你都能先看到对方提供了什么。", "receive_pick": "要接收的内容", "receive_total": "共 {size}", diff --git a/client/src/i18n/locales/zh-TW.ts b/client/src/i18n/locales/zh-TW.ts index c63a60bac..237d5692e 100644 --- a/client/src/i18n/locales/zh-TW.ts +++ b/client/src/i18n/locales/zh-TW.ts @@ -186,6 +186,8 @@ update_skipped_note: "你已略過 v{version}。", update_unskip: "不略過", update_toast_installs_on_quit: "結束時安裝", update_install_failed_title: "更新未安裝", +update_finishing_title: "正在完成更新…", +update_finishing_body: "完成後 PS5Upload 會自動重新啟動。", update_install_failed_body: "無法安裝 v{version},PS5Upload 仍是舊版本。", update_install_failed_reason: "原因:{message}", update_quit_app: "結束 PS5Upload", @@ -1021,8 +1023,9 @@ fs_verify_result: "驗證結果", fs_verify_tooltip: "BLAKE3 + CRC32 驗證(較慢,具加密強度)", hardware_storage: "主機儲存空間", hw_storage_free: "可用", -hw_storage_reserved: "保留", -hw_storage_reserved_hint: "檔案系統保留的部分不計入可用空間", +hw_storage_held_back: "PS5 保留", +hw_storage_held_back_hint: "已計入已使用,不是可用空間。", +hw_storage_note: "依磁碟機檔案系統的計算。PS5 自己的儲存空間畫面可能顯示較少的可用空間:它為系統保留了更多。", hw_storage_total: "總計", hw_storage_used: "已使用", klog_clear: "清除", @@ -1210,6 +1213,7 @@ pm_autoload_add: "開機時載入", pm_autoload_earlier: "提前載入", pm_autoload_later: "延後載入", pm_launch: "啟動", +pm_row_more: "{name} 的更多操作", pm_detected: "PS5 上的 Payload Manager {version}", pm_autoload_title: "開機時載入 payload", pm_autoload_hint: "Payload Manager 在 PS5 開機 {delay} 秒後依序啟動已標記的 payload。清單中有 {n} 個。它們之間的停頓保持 Payload Manager 中的設定。", @@ -1479,6 +1483,7 @@ upload_change_source: "更換來源", upload_choose_diff_source: "選擇其他來源", upload_dest_auto: "(預設 — /data)", upload_dest_card_title: "目標位置", +upload_dest_room: "約可容納 {size}", upload_dest_final_path: "PS5 上的最終路徑", upload_dest_presets: "預設:", upload_dest_will_create: "如果目標資料夾在 PS5 上尚不存在,將在你開始上傳時建立。", @@ -2521,6 +2526,9 @@ upload_pkg_name_save: "變更名稱", upload_pkg_name_all_v2: "所有語言都使用此名稱(套件內其他名稱:{count})", upload_pkg_name_hint: "在安裝之前,直接修改套件檔案裡的名稱。已安裝的遊戲會保留原名稱,直到你重新安裝。", upload_pkg_name_saved: "名稱已變更。", +upload_phone_upload_first: "先複製到 PS5,再安裝。", +upload_pkg_name_left: "名稱剩餘位元組數:{count}", +upload_pkg_name_too_long: "這個名稱對此套件來說太長。可容納位元組數:{limit}。超出位元組數:{count}。請縮短:帶重音的字母和非拉丁字母佔用更多空間。", upload_pkg_name_retail: "這是官方套件,因此無法變更名稱:名稱受發行商的簽章保護。", upload_pkg_name_refused: "無法變更此套件的名稱:{reason}", upload_pkg_name_failed: "名稱未變更:{reason}", @@ -2828,6 +2836,9 @@ remote_copy_task_unknown_server: "從伺服器複製 {name}", upload_split_unsupported_title: "這是 ps5upload 無法開啟的分卷壓縮檔(共 {count} 個分卷)", upload_split_unsupported_body: "直接上傳只會把原始分卷傳到 PS5,主機無法使用。請先把分卷合併回一個壓縮檔:用 7-Zip 或 WinRAR 開啟第一個分卷並解壓,然後上傳解壓後的資料夾,或重新打包成單一壓縮檔再上傳。", upload_split_unsupported_target: "合併後為:{name}", +volumes_held_back: "PS5 為自身保留了 {kept}。這不是可用空間,並會隨著寫入資料而增加。", +volumes_likely_fits: "這裡大約還能放下 {safe} 的新資料。", +volumes_ps5_shows_less: "PS5 自己的儲存空間畫面可能顯示較少的可用空間。兩者不一致時,以較小者為準。", // Editing a game image in place (ShadowMount+ checkout) @@ -3252,7 +3263,6 @@ library_mount_tooltip_smp: "把此映像檔交給 ShadowMount+,由它掛載並 "v5_home_no_notifications_desc": "新的提醒會顯示在這裡。", "v5_home_view_all": "檢視全部", "task_recheck": "重新檢查", -"volumes_upload_safe_capacity": "{safe} 可安全用於新上傳 · {reserve} 保留給系統/檔案系統", "pkg_storage_fallback_title": "使用內部儲存空間", "pkg_storage_fallback_body": "預設安裝檔磁碟({drive})無法使用,此安裝檔將存放到內部儲存空間。", "pkglib.meta.drive": "位於 {drive}", @@ -4250,6 +4260,7 @@ trace_profile_name: "由 {n} 次遊玩工作階段測得", "collection.org_summary": "{n} 項移動 · {size}", "collection.org_title": "整理收藏庫", "collection.org_undo": "復原", +"collection.org_undo_incomplete": "項目已移動,但無法儲存復原記錄。復原可能無法全部還原。", "collection.org_undo_body": "將已移動的 {n} 個項目還原至原名稱和位置。之後已被移動或重新命名的項目保持原樣。", "collection.org_undo_title": "復原這次操作?", "collection.org_undone": "已復原:恢復 {n} 個,{problems} 個保持原處", @@ -4487,6 +4498,7 @@ drive_detail_changed_here: "同步期間 {path} 在此裝置上有變動。下 drive_detail_changed_there: "同步期間 {path} 在 {console} 上有變動。下次會同步。", drive_detail_too_many_files: "超過 {limit} 個檔案:對 Mesh Drive 來說太多了。", drive_detail_list_unreadable: "此版本無法讀取主機的磁碟清單。請更新此應用程式。", +drive_detail_console_list_unreadable: "主機無法讀取它的磁碟清單。在能讀取之前,不會有任何變更。", drive_detail_link_record_damaged: "{console} 上的連結記錄已損壞。", drive_detail_too_many_for_console: "檔案太多,無法放入第二台主機上的磁碟資料夾。", drive_removed: "已不在此磁碟中", @@ -4508,6 +4520,8 @@ drive_join: "加入", drive_delete_title: "刪除磁碟 {name}?", drive_delete_body: "所有裝置都會停止同步它。不會刪除任何檔案:每個資料夾以及主機上的資料夾都保留現有內容。", drive_delete: "刪除磁碟", +drive_left_later: "此資料夾不再同步。{name} 沒有回應:等它回來後,會在那邊把此資料夾移出該磁碟。資料夾裡的檔案保持原樣。", +drive_deleted_later: "此裝置不再保留該磁碟。{name} 沒有回應:等它回來後,那邊也會刪除該磁碟。不會刪除任何檔案。", drive_create: "新增同步磁碟", drive_create_go: "建立", drive_title: "同步磁碟", @@ -4569,13 +4583,14 @@ fs_search_all_drives: "搜尋所有磁碟", fs_more: "更多", fs_more_actions: "更多:佔用空間的內容、快照", fs_space_title: "什麼佔用了空間?", +fs_space_here_v2: "這個資料夾裡什麼佔用了空間?", +fs_snapshot_folder_v2: "為這個資料夾建立快照", +fs_space_drive: "這個磁碟上什麼佔用了空間?", +fs_snapshots_see: "查看快照", fs_space_action: "什麼佔用了空間?", -fs_space_here: "這裡什麼佔用了空間?", fs_space_open_folder: "開啟此資料夾", -fs_snapshot_folder: "為此資料夾建立快照", fs_snapshot_action: "快照…", fs_snapshot_tooltip: "複製到保存在 PS5 上的快照,以便日後還原", -fs_snapshots_open: "快照", fs_snapshot_batch: "{count} 個項目,每項一個快照,以項目名稱和今天的日期命名:", fs_snapshot_batch_create: "建立 {count} 個快照", fs_snapshot_batch_ok: "已建立 {count} 個快照:{files} 個檔案({bytes})", @@ -5359,7 +5374,6 @@ upload_phase_settling_eta: "大約還剩 {time}", upload_phase_settling_rate: "檔案/秒", upload_status_resuming: "正在繼續:{total} 個檔案中已有 {done} 個({have});還需傳送 {send}。", upload_resumed_have: "已繼續:PS5 上已有 {have}。", -volumes_kept_by_console: "{kept} 由主機保留自用", payloads_tab_ps5: "PS5 上", payloads_pm_stored_body_v2: "它位於 Payload Manager 的「{folder}」資料夾中。可在「PS5 上」分頁的 Payload Manager 中啟動它或設為開機載入。", hub_checking: "正在檢查這台 PS5 上的內容…", @@ -8966,6 +8980,8 @@ rp_users_add_hint: "若也想以其他使用者遊玩,請在 PS5 上登入該 "receive_cheats_none": "對方沒有開啟任何項目。", "receive_stream": "串流設定", "receive_stream_body": "與你收到的其他內容一起保存。", +"receive_data_unreadable": "部分內容無法使用", +"receive_data_unreadable_body": "好友傳送的部分內容不是本應用程式能讀取的格式,因此已略過。", "receive_intro_v2": "貼上對方的連結。在任何內容傳過來之前,你都能先看到對方提供了什麼。", "receive_pick": "要接收的內容", "receive_total": "共 {size}", diff --git a/client/src/index.css b/client/src/index.css index 33cda1cef..4f898dc94 100644 --- a/client/src/index.css +++ b/client/src/index.css @@ -1187,6 +1187,21 @@ body { --safe-right: max(env(safe-area-inset-right), var(--sys-inset-right, 0px)); } .safe-bottom { padding-bottom: var(--safe-bottom); } +/* What floats over the bottom of the page on a phone: the tab bar and, while it shows, the + activity pill above it (ActivityBar sets `data-activity-pill` and the pill's height). The page + keeps this much room under its content (the shell's scroll area) and a bar that sticks to the + bottom of a screen stays clear of it (Upload's actions): until 12.6.32 such a bar stuck 8px + from the screen's edge, behind the tab bar. 0 where nothing floats (`md` and wider). */ +:root { --float-bottom: 0px; } +@media (max-width: 767.98px) { + :root { --float-bottom: calc(88px + var(--safe-bottom)); } + html[data-activity-pill] { + --float-bottom: calc(5.1rem + var(--safe-bottom) + var(--activity-pill-h, 2.75rem) + 0.375rem); + } + /* What is scrolled into view (a field that takes focus, a line that appears) stops above the + floating bars and one row of sticky actions, not under them. */ + .tab-room { scroll-padding-bottom: calc(var(--float-bottom) + 4.5rem); } +} /* Keyboard up in the Android app (lib/androidInsets.ts): the page has been resized to what is left of the screen, and these fixed bars would take up a good part of it. */ html[data-keyboard] [data-bottom-nav], @@ -1202,6 +1217,16 @@ html[data-keyboard] [data-testid="activity-pill"] { display: none !important; } /* A screen whose own header carries the bell on a phone (Files, #936) takes the top bar's place: only the room the system keeps at the top is left of it. Below `md`, where that bar shows (PHONE_TOP_BAR_QUERY in lib/phoneLayout.ts). */ +/* A phone held sideways (the sidebar's layout, about 390 px tall; PHONE_LANDSCAPE_QUERY): the + row over the page gives way the same way. Its search, reload and theme buttons go, the bell is + in the screen's header, and only the console tabs stay. With the Files header under it, two + rows left room for about two files. */ +@media (min-width: 768px) and (pointer: coarse) and (orientation: landscape) and (max-height: 520px) { + html[data-screen-bar] [data-top-row] { + padding-top: var(--safe-top); + } + html[data-screen-bar] [data-top-row] > :not([data-keep]) { display: none; } +} @media (max-width: 767.98px) { html[data-screen-bar] [data-top-bar] { min-height: 0; @@ -1240,8 +1265,9 @@ html[data-keyboard] [data-testid="activity-pill"] { display: none !important; } html[data-tab-rail] [data-testid="activity-pill"] { bottom: calc(var(--safe-bottom) + 0.6rem); } - html[data-tab-rail] .tab-room { - padding-bottom: calc(1rem + var(--safe-bottom)); + html[data-tab-rail] { --float-bottom: calc(1rem + var(--safe-bottom)); } + html[data-tab-rail][data-activity-pill] { + --float-bottom: calc(0.6rem + var(--safe-bottom) + var(--activity-pill-h, 2.75rem) + 0.375rem); } } .safe-left { padding-left: var(--safe-left); } diff --git a/client/src/layout/ActivityBar.tsx b/client/src/layout/ActivityBar.tsx index 8a35b7438..dc35645a9 100644 --- a/client/src/layout/ActivityBar.tsx +++ b/client/src/layout/ActivityBar.tsx @@ -1,4 +1,4 @@ -import { useEffect, useMemo, useRef, useSyncExternalStore } from "react"; +import { useEffect, useLayoutEffect, useMemo, useRef, useSyncExternalStore } from "react"; import { useNavigate } from "react-router"; import { useActivityPanel } from "../state/activityPanel"; @@ -52,9 +52,39 @@ function MobilePill() { const { summary } = useActivitySummary(); const open = useActivityPanel((s) => s.open); const toggle = useActivityPanel((s) => s.toggle); - if (open || !summaryHasNews(summary)) return null; + const shown = !open && summaryHasNews(summary); + // The page keeps room for the pill while it is there (`--float-bottom`, index.css): its + // content can be scrolled clear of it, and a screen's sticky actions sit above it. + const pill = useRef(null); + useLayoutEffect(() => { + const el = pill.current; + if (!shown || !el) return; + const root = document.documentElement; + const measure = () => { + const h = el.getBoundingClientRect().height; + // Hidden (a wide window, the keyboard up): no room to keep. + if (h > 0) { + root.setAttribute("data-activity-pill", ""); + root.style.setProperty("--activity-pill-h", `${Math.ceil(h)}px`); + } else { + root.removeAttribute("data-activity-pill"); + } + }; + measure(); + const watch = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(measure); + watch?.observe(el); + window.addEventListener("resize", measure); + return () => { + watch?.disconnect(); + window.removeEventListener("resize", measure); + root.removeAttribute("data-activity-pill"); + root.style.removeProperty("--activity-pill-h"); + }; + }, [shown]); + if (!shown) return null; return (
diff --git a/client/src/layout/AppShell.tsx b/client/src/layout/AppShell.tsx index 48298d8e7..b89ee8804 100644 --- a/client/src/layout/AppShell.tsx +++ b/client/src/layout/AppShell.tsx @@ -16,6 +16,7 @@ import ConsoleTabs from "./ConsoleTabs"; import ActivityBar from "./ActivityBar"; import { WhatsNewOnLaunch } from "./UpdateToast"; import UpdateBanner from "./UpdateBanner"; +import UpdateFinishing from "./UpdateFinishing"; import { useWebUpdateStore } from "./WebUpdateToast"; import { Button } from "../components/Button"; import { @@ -1883,7 +1884,12 @@ export default function AppShell() { className="flex min-w-0 flex-1 flex-col overflow-hidden outline-none" > {/* A phone held sideways is short: less room over this row there. */} -
+ {/* On a phone held sideways, a screen with its own header (Files) takes this row's + place: only the console tabs stay (`html[data-screen-bar]`, index.css). */} +
{/* Browser-style history for a desktop app: route and workspace-tab changes are first-class views, so users can retrace a workflow without reopening More or rebuilding a search. */} @@ -1893,7 +1899,7 @@ export default function AppShell() { {/* Console tab strip — one tab per PS5; switches the viewed console while every console's uploads/installs keep running in their own background loops. Hidden for single-console users. */} -
+
@@ -1902,6 +1908,8 @@ export default function AppShell() { that runs a newer helper than this app (lib/updateNotice). A routine update is a dot on Settings and a row there. Pinned above the scroll area. */} + {/* Opened again while an update from the last quit is still replacing the app. */} + {/* The first launch of a new version: its release notes, once. */} {/* Vertical scroll only. overflow-x-hidden is a backstop: the @@ -1915,7 +1923,7 @@ export default function AppShell() { guarantees scroll position resets per screen. Same-path query changes (e.g. /payloads?tab=send) keep the node, so tab switches inside a screen don't re-animate. */} - +
diff --git a/client/src/layout/UpdateFinishing.test.tsx b/client/src/layout/UpdateFinishing.test.tsx new file mode 100644 index 000000000..69154e11c --- /dev/null +++ b/client/src/layout/UpdateFinishing.test.tsx @@ -0,0 +1,25 @@ +import { renderToStaticMarkup } from "react-dom/server"; +import { afterEach, describe, expect, it } from "vitest"; + +import { useUpdateStore } from "../state/update"; +import { UpdateFinishing, UpdateFinishingCard } from "./UpdateFinishing"; + +afterEach(() => { + useUpdateStore.setState({ finishingUpdate: false }); +}); + +describe("UpdateFinishing", () => { + it("shows nothing unless an install is being waited for", () => { + expect(renderToStaticMarkup()).toBe(""); + }); + + it("says the update is finishing while the app waits for the installer", () => { + const html = renderToStaticMarkup(); + expect(html).toContain('data-testid="update-finishing"'); + expect(html).toContain('role="status"'); + expect(html).toContain("Finishing the update…"); + expect(html).toContain("starts again by itself"); + // Not a failure: nothing here says the update did not install. + expect(html).not.toMatch(/fail|didn/i); + }); +}); diff --git a/client/src/layout/UpdateFinishing.tsx b/client/src/layout/UpdateFinishing.tsx new file mode 100644 index 000000000..77650fa81 --- /dev/null +++ b/client/src/layout/UpdateFinishing.tsx @@ -0,0 +1,40 @@ +import { Spinner } from "../components/Spinner"; +import { useTr } from "../state/lang"; +import { useUpdateStore } from "../state/update"; + +/** + * The app was opened again while an update from the last quit is still replacing it. It waits + * for that to end and then starts again as the new version (state/update `finishingUpdate`); + * until then this small card is all there is to do. The wait is bounded: if the install is + * still working after a few minutes the card goes and the app carries on as it is. + */ +export function UpdateFinishing() { + const finishing = useUpdateStore((s) => s.finishingUpdate); + return finishing ? : null; +} + +export function UpdateFinishingCard() { + const tr = useTr(); + return ( +
+
+ +
+
+ {tr("update_finishing_title", undefined, "Finishing the update…")} +
+
+ {tr("update_finishing_body", undefined, "PS5Upload starts again by itself when it is done.")} +
+
+
+
+ ); +} + +export default UpdateFinishing; diff --git a/client/src/lib/browserInvokeCoverage.test.ts b/client/src/lib/browserInvokeCoverage.test.ts index 23649497c..c38483fd0 100644 --- a/client/src/lib/browserInvokeCoverage.test.ts +++ b/client/src/lib/browserInvokeCoverage.test.ts @@ -105,6 +105,7 @@ const NATIVE_ONLY: Record = { update_quit_for_manual_install: "native: desktop self-update", update_download_cancel: "native: desktop self-update", update_last_install: "native: desktop self-update", + update_wait_for_install: "native: desktop self-update", update_forget_failure: "native: desktop self-update", update_old_downloads: "native: desktop self-update", update_remove_old_downloads: "native: desktop self-update", diff --git a/client/src/lib/packageChecks.test.ts b/client/src/lib/packageChecks.test.ts index cbed61b8e..a5041a649 100644 --- a/client/src/lib/packageChecks.test.ts +++ b/client/src/lib/packageChecks.test.ts @@ -25,9 +25,14 @@ describe("package checks", () => { expect(spaceCheck(100, 400).verdict).toBe("ok"); expect(spaceCheck(100, null).verdict).toBe("unknown"); }); + it("space: between what is likely to fit and the room, it may not fit (#944)", () => { + expect(spaceCheck(100, 120, 90)).toEqual({ verdict: "warn", shortBy: 0 }); + expect(spaceCheck(80, 120, 90).verdict).toBe("ok"); + expect(spaceCheck(130, 120, 90)).toEqual({ verdict: "bad", shortBy: 10 }); + }); }); -import { installedFromPreflight, largestFreeBytes, platformFirmwareCheck } from "./packageChecks"; +import { installedFromPreflight, largestRoom, platformFirmwareCheck } from "./packageChecks"; describe("review fixes", () => { it("never compares a PS4 package's firmware with the PS5's", () => { @@ -83,8 +88,27 @@ describe("review fixes", () => { it("space is measured against the roomiest single drive, not the sum", () => { const v = (path: string, free: number, extra: Record = {}) => ({ path, free_bytes: free, total_bytes: free * 2, writable: true, fs_type: "x", ...extra }) as never; - expect(largestFreeBytes([v("/data", 100), v("/mnt/ext0", 300)])).toBe(300); - expect(largestFreeBytes([v("/data", 100), v("/mnt/x", 900, { is_placeholder: true })])).toBe(100); - expect(largestFreeBytes([])).toBeNull(); + expect(largestRoom([v("/data", 100), v("/mnt/ext0", 300)])?.room).toBe(300); + expect(largestRoom([v("/data", 100), v("/mnt/x", 900, { is_placeholder: true })])?.room).toBe(100); + expect(largestRoom([])).toBeNull(); + }); + + it("space on internal storage is what a copy can take, not the raw free space (#944)", () => { + const GIB = 1024 ** 3; + // The 2 TB console of the report: 163 GiB free, of which about 135 GiB is likely to fit. + const data = { + path: "/data", + fs_type: "nullfs", + total_bytes: 1995416338432, + free_bytes: 175467069440, + writable: true, + safety_reserve_bytes: GIB, + allocatable_bytes: 174393327616, + likely_fits_bytes: 144432988160, + }; + const room = largestRoom([data]); + expect(room).toEqual({ room: 174393327616, likely: 144432988160 }); + // A 150 GiB package: it used to read "Fits on the target drive". + expect(spaceCheck(150 * GIB, room!.room, room!.likely).verdict).toBe("warn"); }); }); diff --git a/client/src/lib/packageChecks.ts b/client/src/lib/packageChecks.ts index 075bb1cac..9967ef7c3 100644 --- a/client/src/lib/packageChecks.ts +++ b/client/src/lib/packageChecks.ts @@ -2,6 +2,8 @@ // this package, is it already installed, and does it fit. Pure, so the panel // stays a view and these stay tested. +import { volumeAllocatableBytes, volumeLikelyFitsBytes, type Volume } from "../api/ps5"; + export type Verdict = "ok" | "warn" | "bad" | "unknown"; /** "01.002.000" / "1.2" → [1, 2, 0] for comparison. */ @@ -42,12 +44,14 @@ export function installedCheck(pkgVer: string, installedVer: string | null) { return { verdict: "warn" as Verdict, relation: "same" as const }; } -/** Whether `size` fits in `freeBytes`; unknown when free space can't be read. */ -export function spaceCheck(size: number, freeBytes: number | null) { - if (freeBytes == null) return { verdict: "unknown" as Verdict, shortBy: 0 }; - return size <= freeBytes - ? { verdict: "ok" as Verdict, shortBy: 0 } - : { verdict: "bad" as Verdict, shortBy: size - freeBytes }; +/** Whether `size` fits in `roomBytes`; unknown when free space can't be read. With + * `likelyBytes` (what is likely to fit, less than the room on internal storage, where the PS5 + * holds back more as it writes), a package between the two is "may not fit", not "fits". */ +export function spaceCheck(size: number, roomBytes: number | null, likelyBytes: number | null = null) { + if (roomBytes == null) return { verdict: "unknown" as Verdict, shortBy: 0 }; + if (size > roomBytes) return { verdict: "bad" as Verdict, shortBy: size - roomBytes }; + if (likelyBytes != null && size > likelyBytes) return { verdict: "warn" as Verdict, shortBy: 0 }; + return { verdict: "ok" as Verdict, shortBy: 0 }; } /** Firmware check that only compares like with like: a PS4 package declares a @@ -96,12 +100,18 @@ export function installedFromPreflight( return { ...installedCheck(pkgVer, ver), installedVer: ver }; } -/** Free bytes on the roomiest single drive: a package lands on one drive, so - * the sum across drives would over-promise. Null when nothing is readable. */ -export function largestFreeBytes( - volumes: { free_bytes: number; is_placeholder?: boolean; writable?: boolean }[], -): number | null { +/** The room on the roomiest single drive: a package lands on one drive, so the sum across + * drives would over-promise. `room` is what a copy may take (free less a small working + * margin), `likely` what is likely to fit. Not the raw free space: on internal storage that + * said "Fits" for a package the PS5 would run out of room for (#944). Null when nothing is + * readable. */ +export function largestRoom(volumes: readonly Volume[]): { room: number; likely: number } | null { const real = volumes.filter((v) => !v.is_placeholder && v.writable !== false); if (real.length === 0) return null; - return Math.max(...real.map((v) => v.free_bytes)); + let best: { room: number; likely: number } | null = null; + for (const v of real) { + const room = volumeAllocatableBytes(v); + if (!best || room > best.room) best = { room, likely: volumeLikelyFitsBytes(v) }; + } + return best; } diff --git a/client/src/lib/registerAfterUpload.test.ts b/client/src/lib/registerAfterUpload.test.ts new file mode 100644 index 000000000..a36e880d9 --- /dev/null +++ b/client/src/lib/registerAfterUpload.test.ts @@ -0,0 +1,41 @@ +import { describe, expect, it } from "vitest"; + +import en from "../i18n/locales/en"; +import { libraryRefusesToo, registerAfterUploadWarning } from "./registerAfterUpload"; + +const LIBRARY = "You can still do it from the Library"; + +describe("the warning after an upload that could not be added to the home screen", () => { + it("points to the Library when the Library could still do it", () => { + for (const raw of ["engine HTTP 502: timed out", "0x80990004", "connection reset"]) { + expect(libraryRefusesToo(raw)).toBe(false); + const text = registerAfterUploadWarning(raw); + expect(text).toContain("Couldn't add it to the home screen automatically"); + expect(text).toContain(LIBRARY); + } + }); + + it("a system app's title ID: the reason alone, no Library", () => { + const raw = "payload rejected APP_REGISTER(/data/homebrew/x): register_system_title"; + expect(libraryRefusesToo(raw)).toBe(true); + const text = registerAfterUploadWarning(raw); + expect(text).toBe(en.err_register_system_title); + expect(text).not.toContain(LIBRARY); + }); + + it("a title ID that is not one: the reason alone", () => { + const text = registerAfterUploadWarning("register failed: register_title_id_unsafe"); + expect(text).toBe(en.err_register_title_id_unsafe); + expect(text).not.toContain(LIBRARY); + }); + + it("a game the console installed itself: says where it is, no Library", () => { + const raw = "payload rejected APP_REGISTER(/mnt/usb0/d/PPSA03595): register_title_installed:m2"; + expect(libraryRefusesToo(raw)).toBe(true); + const text = registerAfterUploadWarning(raw, "Astro Bot"); + expect(text).toContain("Astro Bot is already installed on M.2 storage"); + expect(text).not.toContain(LIBRARY); + // An unregister refusal is not this one. + expect(libraryRefusesToo("unregister_title_installed:usb")).toBe(false); + }); +}); diff --git a/client/src/lib/registerAfterUpload.ts b/client/src/lib/registerAfterUpload.ts new file mode 100644 index 000000000..2865c1fbe --- /dev/null +++ b/client/src/lib/registerAfterUpload.ts @@ -0,0 +1,31 @@ +// What an upload's done card says when adding the game folder to the home screen afterwards did +// not work (the queue, uploadQueue.ts, and a single upload, transfer.ts). +// +// "You can still do it from the Library" is said only where that is true. The helper refuses some +// title IDs whoever asks (install_guard.h: one of the PS5's own apps, an ID that is not one, a +// title the console itself installed, #884), and the Library's register asks the same helper: +// for those the reason alone is said. + +import { installRefusal, registerRefusedText } from "./consoleInstall"; +import { humanizePs5Error } from "./humanizeError"; +import { trStatic } from "./trStatic"; + +/** The Library's register would be refused for the same reason: nothing to point to there. */ +export function libraryRefusesToo(raw: string): boolean { + return /register_system_title|register_title_id_unsafe/.test(raw) || installRefusal(raw)?.op === "register"; +} + +/** The warning for a register after an upload that failed with `raw` (the helper's or engine's + * words). `name`: the game's, when known. */ +export function registerAfterUploadWarning(raw: string, name?: string): string { + const installed = installRefusal(raw); + if (installed?.op === "register") return registerRefusedText(installed.where, name); + // A full sentence that says it was not added and why. + if (libraryRefusesToo(raw)) return humanizePs5Error(raw); + return trStatic( + "queue_register_failed", + "Couldn't add it to the home screen automatically: {error}. You can still do it from the Library.", + // The helper's reason in words where it has them. + { error: humanizePs5Error(raw) }, + ); +} diff --git a/client/src/lib/shotsVersion.test.ts b/client/src/lib/shotsVersion.test.ts new file mode 100644 index 000000000..0cfe02ed1 --- /dev/null +++ b/client/src/lib/shotsVersion.test.ts @@ -0,0 +1,28 @@ +import { describe, expect, it } from "vitest"; + +import { nextPatch, shotsVersion } from "../../site-shots/shotsVersion"; +// The file the spec reads (the repo's version). +import repo from "../../../VERSION?raw"; + +// The website's screenshots (site-shots/site-shots.spec.ts) show the release they are taken for. +describe("the version the website's screenshots show", () => { + it("is the repo's version plus one patch level by default", () => { + expect(nextPatch("12.6.31\n")).toBe("12.6.32"); + expect(nextPatch("v9.0.9")).toBe("9.0.10"); + expect(nextPatch("12.7.0-beta.1")).toBe("12.7.1"); + expect(shotsVersion(undefined, "12.6.31\n")).toBe("12.6.32"); + expect(shotsVersion(" ", "12.6.31")).toBe("12.6.32"); + // The repo's own VERSION file. + expect(shotsVersion(undefined, repo)).toBe(nextPatch(repo)); + }); + + it("is SHOTS_VERSION when it is given", () => { + expect(shotsVersion("12.7.0", "12.6.31")).toBe("12.7.0"); + expect(shotsVersion("v13.0.0", "12.6.31")).toBe("13.0.0"); + }); + + it("refuses what is not a version, rather than show it", () => { + expect(() => shotsVersion("next", "12.6.31")).toThrow(/SHOTS_VERSION/); + expect(() => nextPatch("")).toThrow(); + }); +}); diff --git a/client/src/screens/Collection/OrganizeModal.tsx b/client/src/screens/Collection/OrganizeModal.tsx index 5212fc195..c45e803d2 100644 --- a/client/src/screens/Collection/OrganizeModal.tsx +++ b/client/src/screens/Collection/OrganizeModal.tsx @@ -262,6 +262,20 @@ export function OrganizeModal({ )}
)} + {(result.undo_incomplete?.length ?? 0) > 0 && ( +
+ {tr( + "collection.org_undo_incomplete", + undefined, + "The items were moved, but the undo log could not be saved. Undo may not put everything back.", + )} + {result.undo_incomplete?.map((line) => ( +
+ {line} +
+ ))} +
+ )} {result.failed.map((f) => (
void; }) { - return items.map((it) => ( - + return items.map((it, i) => ( + + {it.separator && i > 0 && ( +
+ )} + + )); } diff --git a/client/src/screens/FileSystem/index.tsx b/client/src/screens/FileSystem/index.tsx index 41e2491b3..035cbb800 100644 --- a/client/src/screens/FileSystem/index.tsx +++ b/client/src/screens/FileSystem/index.tsx @@ -137,7 +137,6 @@ import { jobStatus, startTransferDownload, startTransferDownloadZip, - fetchVolumes, generateTxIdHex, pathKind, loadConsolePayload, @@ -201,6 +200,7 @@ import { import { enqueueFsUpload, fsUploadReservations, pauseFsUpload, pauseFsUploadQueue, resumeFsUploadItem, resumeFsUploadQueue, removeFsUploadQueued, sendFsUploadNow, useFsUploadQueue } from "../../state/fsUploadQueue"; import { nameKey, type FsExistingEntry } from "../../state/fsUploadPlan"; import { fsUploadDeps } from "../../state/fsUploadRuntime"; +import { refreshVolumes, refreshVolumesAfterChange, useConsoleVolumes } from "../../state/volumes"; import { useScrollLock } from "../../lib/useScrollLock"; import { runBulkDelete as runBulkDeleteLoop } from "../../lib/bulkDelete"; import { krakenKeptPaths } from "../../lib/krakenGuard"; @@ -278,7 +278,7 @@ import { formatNumber, formatDuration } from "../../lib/formatDate"; import { Modal } from "../../components/Modal"; import { childToReveal, REVEAL_MS } from "../../lib/revealChild"; import { useBackDismiss, useScreenBack } from "../../lib/systemBack"; -import { usePhoneLayout, usePhoneTopBar } from "../../lib/phoneLayout"; +import { usePhoneLayout } from "../../lib/phoneLayout"; import { ltr } from "../../i18n"; import NotificationInbox from "../../layout/NotificationInbox"; import { createLongPress } from "../../lib/longPress"; @@ -423,6 +423,12 @@ export function isSinglePathName(name: string): boolean { ); } +/** How long a reading of the drives counts as recent while folders are browsed. Refresh, and + * anything done here that changes free space, reads them again whatever their age. */ +const DRIVES_FRESH_MS = 30_000; +/** The same for a dialog that says whether something fits on a drive. */ +const DIALOG_FRESH_MS = 5_000; + /** The in-app drag of rows to move them (the row names, as JSON). */ const FS_DRAG_MIME = "application/x-ps5upload-fs-move"; @@ -465,17 +471,21 @@ export default function FileSystemScreen() { // are handled by the effect below. const [searchParams, setSearchParams] = useSearchParams(); const [path, setPath] = useState(() => loadFsLastPath(host)); - // Refetched whenever host or payloadStatus changes. Drives the - // volume picker dropdown — same shape Library's Move modal uses. - // null while loading or before the first probe completes; an empty - // array means the probe ran but the PS5 has no writable volumes - // (rare on stock PS5, but possible after a user mounts and then - // unmounts everything). Errors are swallowed silently — the picker - // just hides itself, which is less noisy than yet another red - // banner for what's a degraded-but-functional state. - const [volumes, setVolumes] = useState(null); - // Bumped after a USB eject so the drive bar lists the drives again. - const [volumesEpoch, setVolumesEpoch] = useState(0); + // The console's drives, for the drive chips, the phone's drive menu and the Move/Extract + // dialogs: the slot every screen shares (state/volumes), so the free space here is the + // free space Volumes shows. null while not read (or with the helper not answering); an + // empty array means the console reports no writable drive. A read that fails says nothing + // here (the last list stays): another red banner would be noise for a state that works. + const drives = useConsoleVolumes(host, payloadStatus === "up"); + const volumes = useMemo( + () => + payloadStatus === "up" && drives.volumes + ? // Writable, real drives only: the chips are for going there, and a placeholder + // ("nothing mounted here yet") would jump to a path that does not exist. + drives.volumes.filter((v) => v.writable && !v.is_placeholder) + : null, + [drives.volumes, payloadStatus], + ); const [entries, setEntries] = useState(null); // The folder on screen is a Mesh Drive's (its marker file is in it, hidden from the list). const [meshHome, setMeshHome] = useState(false); @@ -609,8 +619,8 @@ export default function FileSystemScreen() { // Eject next to each USB drive, as the console's own Files page has (#496). Browsing inside // the drive that went away returns to /data. const { eject: ejectUsb, ejectingPath, dialog: ejectDialogNode } = useUsbEject({ - onEjected: (_host, mountPoint) => { - setVolumesEpoch((n) => n + 1); + onEjected: (ejectedOn, mountPoint) => { + void refreshVolumesAfterChange(ejectedOn); setPath((p) => (p === mountPoint || p.startsWith(`${mountPoint}/`) ? "/data" : p)); }, onError: setError, @@ -626,7 +636,7 @@ export default function FileSystemScreen() { // mid-run is harmless. The runner loops keep going (writing to // the store), the screen re-mount sees the in-flight progress. - const refresh = useCallback(async () => { + const listFolder = useCallback(async () => { if (!host?.trim()) return; // Stale-result guard (2.9.0). The user can navigate (changes // `path`) or switch PS5 (changes `host`) faster than ps5_list_dir @@ -750,46 +760,28 @@ export default function FileSystemScreen() { setLoading(false); } }, [host, path, tr]); + // Refresh, and the listing after anything done here (a delete, a paste, an extract, an + // upload that ended): the folder AND the drives. The drive chips used to keep the free + // space read when the screen opened, whatever was deleted or copied since (#944). + const refresh = useCallback(async () => { + void refreshVolumesAfterChange(host); + await listFolder(); + }, [host, listFolder]); // Layout effects run before the passive ones below, so the listing effect of the same // commit already sees the new place. useLayoutEffect(() => { placeRef.current = { host, path }; - refreshRef.current = refresh; - }, [host, path, refresh]); + refreshRef.current = listFolder; + }, [host, path, listFolder]); + // Opening a folder lists it. The drives are read again only if their reading is not + // recent: a job running from another screen moves free space while folders are browsed, + // but one more console call per folder opened would be waste. useEffect(() => { - if (payloadStatus === "up") refresh(); - }, [payloadStatus, refresh]); - - // Fetch writable volumes whenever the connection becomes healthy or - // the host changes. Same data the Library Move modal uses — listing - // volumes on the FileSystem screen lets users jump between mounts - // (/data → /mnt/ext1 → /mnt/usb0) with one click instead of - // navigating up to / and clicking down. Errors swallow silently; - // the picker just won't render. - useEffect(() => { - if (payloadStatus !== "up" || !host?.trim()) { - setVolumes(null); - return; - } - let cancelled = false; - (async () => { - try { - const vols = await fetchVolumes(consoleAddr(host)); - if (!cancelled) { - // Only show writable, non-placeholder volumes — the picker - // is for navigation, and a placeholder ("disk not yet - // mounted") would jump to a nonexistent path. - setVolumes(vols.filter((v) => v.writable && !v.is_placeholder)); - } - } catch { - if (!cancelled) setVolumes([]); - } - })(); - return () => { - cancelled = true; - }; - }, [host, payloadStatus, volumesEpoch]); + if (payloadStatus !== "up") return; + void refreshVolumes(host, { maxAgeMs: DRIVES_FRESH_MS }); + void listFolder(); + }, [payloadStatus, listFolder, host]); // An "Add files" run ended (here, or while another screen was open): list the folder // again so what landed shows. The count is per console, so a console switch is not a run. @@ -2226,6 +2218,12 @@ export default function FileSystemScreen() { choice: ExtractChoice | null; after?: ExtractAfter; } | null>(null); + // Move to and Extract show each drive's free space and say whether the items fit: they open + // on a reading of now, not one from before a job running elsewhere filled the drive. + const spaceDialogOpen = moveItems !== null || extractAsk !== null; + useEffect(() => { + if (spaceDialogOpen) void refreshVolumes(host, { maxAgeMs: DIALOG_FRESH_MS }); + }, [spaceDialogOpen, host]); const extractNameTaken = (n: string) => !!entries?.some((e) => e.name === n); const runExtract = async ( entry: DirEntry, @@ -3156,12 +3154,11 @@ export default function FileSystemScreen() { return () => root.removeAttribute("data-selection-bar"); }, [phoneSelecting]); // One bar at the top, not two (#936): on a phone the compact header carries the bell, and the - // app's top bar gives it its place (`html[data-screen-bar]`, index.css). Only where that bar - // shows (below `md`: a phone held sideways that wide has the bell in the row beside the - // sidebar), and not over a view, which has no such header. An iPhone keeps the app's bar: its - // arrows are the only way back there. - const phoneTopBar = usePhoneTopBar(); - const ownTopBar = phone && phoneTopBar && view === null && !isIOS(); + // app's top bar gives it its place (`html[data-screen-bar]`, index.css). Held sideways too, + // where the row beside the sidebar gives way and only its console tabs stay: two rows left + // room for about two files. Not over a view, which has no such header. An iPhone keeps the + // app's bar: its arrows are the only way back there. + const ownTopBar = phone && view === null && !isIOS(); useEffect(() => { if (!ownTopBar) return; const root = document.documentElement; @@ -3257,17 +3254,22 @@ export default function FileSystemScreen() { // A const, so the menu items' closures keep the non-null narrowing. const menuEntry = rowMenu?.entry ?? null; - /** The open folder's own view items, in its right-click menu and the page's ⋯ menu. */ - const folderViewItems = () => [ + /** The open folder's own view items, in its right-click menu and the page's ⋯ menu. A group + * of their own, named for this folder; the drive's items further down say "drive", and the + * snapshot pair says which one makes a snapshot and which one shows them (they read as twins: + * "What takes space here?" beside "What takes space?", "Snapshot this folder" beside + * "Snapshots"). */ + const folderViewItems = (): RowMenuItem[] => [ { icon: PieChart, - label: tr("fs_space_here", undefined, "What takes space here?"), + label: tr("fs_space_here_v2", undefined, "What takes space in this folder?"), run: () => openSpace(path), disabled: !host?.trim(), + separator: true, }, { icon: Archive, - label: tr("fs_snapshot_folder", undefined, "Snapshot this folder"), + label: tr("fs_snapshot_folder_v2", undefined, "Make a snapshot of this folder"), run: () => snapshotPaths([path]), disabled: !host?.trim() || path === "/", }, @@ -3280,17 +3282,19 @@ export default function FileSystemScreen() { icon: Link2, label: tr("fs_link_download", undefined, "Download from a link"), run: () => setLinkInto(path), + separator: true, }, // The size map of the drive you are on (Disk usage, a Files view). With the other // whole-drive tools here, not among the drive chips, which only pick a drive. { icon: PieChart, - label: tr("fs_space_title", undefined, "What takes space?"), + label: tr("fs_space_drive", undefined, "What takes space on this drive?"), run: () => openSpace(currentVolumePath ?? path), + separator: true, }, { icon: Archive, - label: tr("fs_snapshots_open", undefined, "Snapshots"), + label: tr("fs_snapshots_see", undefined, "See snapshots"), run: () => openView("snapshots"), }, { diff --git a/client/src/screens/FpkgConvert/ImageDestination.tsx b/client/src/screens/FpkgConvert/ImageDestination.tsx index 5aa075774..e567cf7dc 100644 --- a/client/src/screens/FpkgConvert/ImageDestination.tsx +++ b/client/src/screens/FpkgConvert/ImageDestination.tsx @@ -2,14 +2,12 @@ // upload one, and the real path before anything runs. With no drive picked it is the drive set // under Volumes › Use for packages for that console. -import { useEffect, useId, useState } from "react"; +import { useId } from "react"; import { - fetchVolumes, volumeAllocatableBytes, type Volume, } from "../../api/ps5"; -import { consoleAddr, hostOf } from "../../lib/addr"; import { formatBytes } from "../../lib/format"; import { DEFAULT_IMAGE_SUBPATH, @@ -18,26 +16,12 @@ import { } from "../../lib/imageUpload"; import { usePkgStorageStore } from "../../lib/pkgStorage"; import { resolveUploadDest } from "../../lib/uploadDest"; +import { useConsoleVolumes as useSharedVolumes } from "../../state/volumes"; import { useTr } from "../../state/lang"; -/** The console's drives; null until known or when they cannot be read. */ +/** The console's drives; null until known. The reading every screen shares (state/volumes). */ export function useConsoleVolumes(host: string | null): Volume[] | null { - const [volumes, setVolumes] = useState(null); - const key = host ? hostOf(host) : ""; - useEffect(() => { - setVolumes(null); - if (!key) return; - let live = true; - fetchVolumes(consoleAddr(key)) - .then((v) => { - if (live) setVolumes(v); - }) - .catch(() => {}); - return () => { - live = false; - }; - }, [key]); - return volumes; + return useSharedVolumes(host).volumes; } /** The folder an image lands in: `/`. */ diff --git a/client/src/screens/GameHub/SendToPs5.tsx b/client/src/screens/GameHub/SendToPs5.tsx index 143aa98ec..4095304f0 100644 --- a/client/src/screens/GameHub/SendToPs5.tsx +++ b/client/src/screens/GameHub/SendToPs5.tsx @@ -4,13 +4,11 @@ import { Layers, Upload } from "lucide-react"; import type { CollectionGame, CollectionLocation } from "../../api/collection"; import { - fetchVolumes, volumeAllocatableBytes, volumeLikelyFitsBytes, type Volume, } from "../../api/ps5"; import { Button, Checkbox, Select } from "../../components"; -import { consoleAddr } from "../../lib/addr"; import { DEFAULT_SEND_SUBPATH, addToQueue, @@ -35,6 +33,7 @@ import { destinationVolumeFor } from "../../state/upload"; import { ActivityLine } from "./ActivityLine"; import { useCopyActivity, wholeCopyActivity } from "../../state/copyActivity"; import { useConnectionStore } from "../../state/connection"; +import { useConsoleVolumes } from "../../state/volumes"; import { queueLinkFor } from "../../lib/gamePage"; import { spacePlanLink } from "../../lib/spacePlan"; @@ -71,7 +70,13 @@ export function SendToPs5({ // queue ("Build and send" on a .pkg). const asImage = canImage && how === "image"; const radioName = useId(); - const [volumes, setVolumes] = useState(null); + // The console's drives as every screen reads them (state/volumes). null until read; none + // when they cannot be. + const drives = useConsoleVolumes(host); + const volumes = useMemo( + () => (drives.volumes ? imageDriveChoices(drives.volumes) : drives.error ? [] : null), + [drives.volumes, drives.error], + ); // Picked here or on the Upload screen; none: this console's drive for packages (#673). const [picked, setVolume] = useState(() => destinationVolumeFor(host)); const [subpath, setSubpath] = useState(DEFAULT_SEND_SUBPATH); @@ -90,16 +95,6 @@ export function SendToPs5({ const driveTouched = useRef(false); const folderTouched = useRef(false); - useEffect(() => { - let live = true; - fetchVolumes(consoleAddr(host)) - .then((v) => live && setVolumes(imageDriveChoices(v))) - .catch(() => live && setVolumes([])); - return () => { - live = false; - }; - }, [host]); - const volume = imageDrive(host, picked, volumes).volume; // A package goes where Kraken Mount finds it: its folder on the chosen drive, else its first // folder on a drive this console has. diff --git a/client/src/screens/Hardware/ConsoleStorageCard.test.tsx b/client/src/screens/Hardware/ConsoleStorageCard.test.tsx new file mode 100644 index 000000000..0fe5c77a2 --- /dev/null +++ b/client/src/screens/Hardware/ConsoleStorageCard.test.tsx @@ -0,0 +1,54 @@ +import { renderToStaticMarkup } from "react-dom/server"; +import { describe, expect, it, vi } from "vitest"; + +vi.mock("../../state/lang", () => ({ + useTr: () => + (key: string, vars?: Record, fallback?: string) => { + let s = fallback ?? key; + for (const [k, v] of Object.entries(vars ?? {})) s = s.replace(`{${k}}`, String(v)); + return s; + }, +})); + +import { ConsoleStorageCard } from "./index"; + +describe("the Console Storage card (#944)", () => { + const out = renderToStaticMarkup( + , + ); + + it("shows GiB like the rest of the app, and the free space Volumes shows", () => { + expect(out).toContain("1.81 TiB"); + expect(out).toContain("163 GiB"); + expect(out).not.toMatch(/\d (GB|TB)\b/); + // Not the three partitions' 170 GiB. + expect(out).not.toContain("170 GiB"); + }); + + it("names what is held back and says it is not free space", () => { + expect(out).toContain("Held back by the PS5"); + expect(out).toContain("287 GiB"); + expect(out).toContain("Counted in Used. Not free space."); + }); + + it("does not claim to match the PS5's Storage screen, and says it can show less", () => { + expect(out).toContain("As the drive's filesystem counts it."); + expect(out).toContain("can show less free space"); + // The note sits outside the list of figures. + expect(out).toMatch(/<\/dl>]*data-testid="hw-storage-note"/); + }); +}); diff --git a/client/src/screens/Hardware/consoleStorage.test.ts b/client/src/screens/Hardware/consoleStorage.test.ts new file mode 100644 index 000000000..f4264e435 --- /dev/null +++ b/client/src/screens/Hardware/consoleStorage.test.ts @@ -0,0 +1,69 @@ +import { describe, expect, it } from "vitest"; + +import type { HwStorage } from "../../api/ps5"; +import { formatBytes } from "../../lib/format"; +import { consoleStorageRows } from "./consoleStorage"; + +/** The reading of the 2 TB console in #944. */ +const REPORTED: HwStorage = { + total_bytes: 2005599387648, + free_bytes: 182746480640, + used_bytes: 1822852907008, + reserved_bytes: 307929022464, + user_total_bytes: 1995416338432, + user_free_bytes: 175467462656, + user_reserved_bytes: 307929022464, + system_data_total_bytes: 8572829696, + system_data_free_bytes: 7136804864, + system_ex_total_bytes: 1610219520, + system_ex_free_bytes: 142213120, +}; + +describe("the Console Storage card's figures (#944)", () => { + it("shows the partition files are on, not the system partitions with it", () => { + const rows = consoleStorageRows(REPORTED); + expect(rows.totalBytes).toBe(REPORTED.user_total_bytes); + // Free is what Volumes shows for /data: the same counter, in the same unit. + expect(rows.freeBytes).toBe(REPORTED.user_free_bytes); + expect(formatBytes(rows.freeBytes)).toBe("163 GiB"); + // Not the 182.7 GB that counted the system partitions' free space. + expect(rows.freeBytes).toBeLessThan(REPORTED.free_bytes); + }); + + it("adds up: used and free make the total, and what is held back is part of used", () => { + const rows = consoleStorageRows(REPORTED); + expect(rows.usedBytes + rows.freeBytes).toBe(rows.totalBytes); + expect(rows.heldBackBytes).toBe(307929022464); + expect(rows.heldBackBytes).toBeLessThan(rows.usedBytes); + // Held back is never taken from free a second time. + expect(rows.freeBytes).toBe(175467462656); + }); + + it("a full drive shows no free space, whatever the system partitions have", () => { + const rows = consoleStorageRows({ ...REPORTED, user_free_bytes: 0, free_bytes: 7279017984 }); + expect(rows.freeBytes).toBe(0); + expect(rows.usedBytes).toBe(rows.totalBytes); + }); + + it("falls back to the totals when the helper sends no /user figures", () => { + const rows = consoleStorageRows({ + ...REPORTED, + user_total_bytes: 0, + user_free_bytes: 0, + user_reserved_bytes: 0, + }); + expect(rows.totalBytes).toBe(REPORTED.total_bytes); + expect(rows.freeBytes).toBe(REPORTED.free_bytes); + expect(rows.heldBackBytes).toBe(REPORTED.reserved_bytes); + }); + + it("never shows impossible figures from a bad answer", () => { + const rows = consoleStorageRows({ + ...REPORTED, + user_total_bytes: 100, + user_free_bytes: 500, + user_reserved_bytes: 900, + }); + expect(rows).toEqual({ totalBytes: 100, usedBytes: 0, heldBackBytes: 0, freeBytes: 100 }); + }); +}); diff --git a/client/src/screens/Hardware/consoleStorage.ts b/client/src/screens/Hardware/consoleStorage.ts new file mode 100644 index 000000000..fb67541b6 --- /dev/null +++ b/client/src/screens/Hardware/consoleStorage.ts @@ -0,0 +1,36 @@ +import type { HwStorage } from "../../api/ps5"; + +/** + * The figures of the Console Storage card: the partition games and files are on (`/user`, which + * `/data` is a folder of), as its filesystem counts it. They are the same counters the Volumes + * screen shows for `/data`, so the two screens say the same thing (#944). + * + * The card used to add the two system partitions in. Their free space is not room for anything + * a person copies, so "Free" read some gigabytes high and a full console never showed zero. + * + * These are NOT the PS5's own Settings > Storage figures: that screen can show a smaller drive + * and less free space. Nothing here tries to reproduce it. + */ +export interface ConsoleStorageRows { + totalBytes: number; + /** Everything that is not free: stored data and what the console holds back. */ + usedBytes: number; + /** Free blocks the filesystem does not offer to a writer. Part of `usedBytes`; 0 = not reported. */ + heldBackBytes: number; + /** What the filesystem offers a writer now. `heldBackBytes` is already left out of it. */ + freeBytes: number; +} + +export function consoleStorageRows(s: HwStorage): ConsoleStorageRows { + // A helper that sends no /user figures (none known) still gets its totals shown. + const user = s.user_total_bytes > 0; + const totalBytes = user ? s.user_total_bytes : s.total_bytes; + const freeBytes = Math.min(totalBytes, user ? s.user_free_bytes : s.free_bytes); + const heldBackBytes = user ? s.user_reserved_bytes : s.reserved_bytes; + return { + totalBytes, + usedBytes: Math.max(0, totalBytes - freeBytes), + heldBackBytes: Math.max(0, Math.min(heldBackBytes, totalBytes - freeBytes)), + freeBytes, + }; +} diff --git a/client/src/screens/Hardware/index.tsx b/client/src/screens/Hardware/index.tsx index 56ec845ce..1c3416c83 100644 --- a/client/src/screens/Hardware/index.tsx +++ b/client/src/screens/Hardware/index.tsx @@ -27,6 +27,8 @@ import { Spinner, } from "../../components"; import { useTr } from "../../state/lang"; +import { formatBytes as formatSize } from "../../lib/format"; +import { consoleStorageRows } from "./consoleStorage"; import { useConfirm } from "../../components/ConfirmDialog"; import PowerTelemetryPanel from "./PowerTelemetryPanel"; import GameFpsPanel from "./GameFpsPanel"; @@ -152,17 +154,6 @@ function formatKernelFw(v: number): string { .padStart(2, "0")}.${point.toString(16).padStart(4, "0")}`; } -/** Friendlier "Console Storage" formatter that mirrors the GB units PS5 - * Settings shows. Uses GB (decimal 10^9) deliberately — Sony's UI uses - * GB even though the underlying counts are GiB-sized; keep parity so - * users can compare to what their PS5 reports. */ -function formatStorageGB(n: number): string { - if (n <= 0) return "—"; - const gb = n / 1_000_000_000; - if (gb >= 1000) return `${(gb / 1000).toFixed(2)} TB`; - return `${gb.toFixed(0)} GB`; -} - function formatUptime(sec: number): string { if (sec <= 0) return "—"; const h = Math.floor(sec / 3600); @@ -834,36 +825,7 @@ export default function HardwareScreen() { Prefixed key — see the note on FanThresholdCard below. */} - {storage && ( - } - title={tr("hardware_storage", undefined, "Console Storage")} - > - - - - {storage.reserved_bytes > 0 && ( - - )} - - )} + {storage && } {/* Drive sensors — USB / extended storage temperatures and capacity via SCSI LOG SENSE. Read on demand alongside temps @@ -889,12 +851,12 @@ export default function HardwareScreen() { ? tr("hw_drive_no_temp", undefined, "No temp sensor") : "—" } - hint={d.size_bytes > 0 ? formatStorageGB(d.size_bytes) : undefined} + hint={d.size_bytes > 0 ? formatSize(d.size_bytes) : undefined} /> {d.fs_total_bytes != null && d.fs_total_bytes > 0 && ( )}
@@ -970,14 +932,54 @@ export default function HardwareScreen() { ); } +/** The internal drive as its filesystem counts it, in the units every other screen uses. + * + * It used to be in decimal GB "to compare with the PS5's Settings", next to GiB everywhere + * else in the app: the same free space read 175 GB here and 163 GiB on Volumes. And the + * comparison does not hold (#944): the PS5's Storage screen can show a smaller drive and less + * free. The card says so instead of inviting the comparison. */ +export function ConsoleStorageCard({ storage }: { storage: HwStorage }) { + const tr = useTr(); + const rows = consoleStorageRows(storage); + return ( + } + title={tr("hardware_storage", undefined, "Console Storage")} + footer={ +

+ {tr( + "hw_storage_note", + undefined, + "As the drive's filesystem counts it. The PS5's own Storage screen can show less free space: it holds more back for the system.", + )} +

+ } + > + + + {rows.heldBackBytes > 0 && ( + + )} + +
+ ); +} + function SensorCard({ icon, title, children, + footer, }: { icon: React.ReactNode; title: string; children: React.ReactNode; + /** Under the rows, outside the list (a note on what they mean). */ + footer?: React.ReactNode; }) { return (
@@ -988,6 +990,7 @@ function SensorCard({ {title}
{children}
+ {footer}
); } diff --git a/client/src/screens/Home/LowSpaceCard.tsx b/client/src/screens/Home/LowSpaceCard.tsx index 97a8c223c..cac78dfff 100644 --- a/client/src/screens/Home/LowSpaceCard.tsx +++ b/client/src/screens/Home/LowSpaceCard.tsx @@ -1,11 +1,12 @@ -import { useEffect, useState } from "react"; +import { useMemo } from "react"; import { Link } from "react-router"; import { Eraser } from "lucide-react"; -import { fetchVolumes, type Volume } from "../../api/ps5"; +import type { Volume } from "../../api/ps5"; import { Card } from "../../components"; import { formatBytes } from "../../lib/format"; import { useTr } from "../../state/lang"; +import { useConsoleVolumes } from "../../state/volumes"; /** Below this share of a drive free, or this much, Home suggests Clean up. */ const LOW_SHARE = 0.1; @@ -22,26 +23,13 @@ export function lowDrive(volumes: readonly Volume[]): Volume | null { return worst; } -/** A nudge to Clean up when one of the console's drives is nearly full. Reads the drives once - * per console connection; draws nothing otherwise. */ +/** A nudge to Clean up when one of the console's drives is nearly full. Reads the drives the + * way every screen does (state/volumes), so it goes away once room was made; draws nothing + * otherwise. */ export function LowSpaceCard({ host }: { host: string }) { const tr = useTr(); - const [low, setLow] = useState(null); - - useEffect(() => { - let cancelled = false; - setLow(null); - fetchVolumes(host) - .then((v) => { - if (!cancelled) setLow(lowDrive(v)); - }) - .catch(() => { - // Nothing to say without the drive list. - }); - return () => { - cancelled = true; - }; - }, [host]); + const drives = useConsoleVolumes(host); + const low = useMemo(() => (drives.volumes ? lowDrive(drives.volumes) : null), [drives.volumes]); if (!low) return null; return ( diff --git a/client/src/screens/MeshDrive/AwayFolders.tsx b/client/src/screens/MeshDrive/AwayFolders.tsx index c386a257b..4cbe8bff0 100644 --- a/client/src/screens/MeshDrive/AwayFolders.tsx +++ b/client/src/screens/MeshDrive/AwayFolders.tsx @@ -4,19 +4,41 @@ // it shows while the console cannot be reached at all. import { useHelperReplaceGuard } from "../Connection/useHelperReplaceGuard"; -import { useEffect, useState } from "react"; -import { FolderSync, Power, Send } from "lucide-react"; +import { useCallback, useEffect, useRef, useState } from "react"; +import { FolderSync, Power, Send, X } from "lucide-react"; import { Badge, Button } from "../../components"; -import { fetchLocalFolders, type DriveStatus, type LocalFolder } from "../../api/meshDrive"; +import { useConfirm } from "../../components/ConfirmDialog"; +import { driveApi, fetchLocalFolders, type DriveStatus, type LocalFolder } from "../../api/meshDrive"; import { hostOf } from "../../lib/addr"; +import { humanizeCaught } from "../../lib/humanizeError"; import { useConsoleWake } from "../../lib/useConsoleWake"; import { useTr, type Translator } from "../../state/lang"; import { useRosterStore } from "../../state/roster"; import { sendHelperTo } from "../../state/helperSendRuntime"; +import { useToastStore } from "../../state/toasts"; import { agoText } from "../Devices"; import { driveDetailText } from "./driveDetail"; +/** A leave or a delete the console did not answer: done on this device, and there once it is back. */ +export function sayDoneLater(tr: Translator, name: string, deleted: boolean): void { + useToastStore.getState().push({ + tone: "info", + duration: 10_000, + message: deleted + ? tr( + "drive_deleted_later", + { name }, + `The drive is no longer kept on this device. ${name} didn't answer: it's deleted there when it's back. No files are deleted.`, + ) + : tr( + "drive_left_later", + { name }, + `This folder no longer syncs. ${name} didn't answer: it's taken out of the drive there when it's back. Its files stay where they are.`, + ), + }); +} + export type AwayWhy = "rest" | "unreachable" | "helper"; /** The console's name as this app knows it, or its address. */ @@ -108,9 +130,38 @@ export function AwayActions({ console, why }: { console: string; why: AwayWhy }) ); } -function FolderRow({ f, now }: { f: LocalFolder; now: number }) { +function FolderRow({ f, now, onLeft }: { f: LocalFolder; now: number; onLeft: () => void }) { const tr = useTr(); const name = useConsoleName(f.console); + const { confirm, dialog } = useConfirm(); + const [leaving, setLeaving] = useState(false); + const [error, setError] = useState(null); + // Works with the console away too (gone for good, say): the folder stops syncing here and the + // console is told once it answers. + const leave = async () => { + const ok = await confirm({ + title: tr("drive_leave_title", undefined, "Stop keeping this drive on this device?"), + message: tr( + "drive_leave_body", + { path: f.path }, + `The files in ${f.path} stay where they are; they just stop being kept in sync.`, + ), + confirmLabel: tr("drive_leave", undefined, "Leave"), + destructive: true, + }); + if (!ok) return; + setLeaving(true); + setError(null); + try { + const r = await driveApi.leave(f.console, f.drive, f.member); + if (r.later) sayDoneLater(tr, name, false); + onLeft(); + } catch (e) { + setError(humanizeCaught(e)); + } finally { + setLeaving(false); + } + }; const why = (f.status.away || "") as AwayWhy | ""; const away = why ? awayText(tr, f.status, name, now) : null; const short = @@ -137,9 +188,16 @@ function FolderRow({ f, now }: { f: LocalFolder; now: number }) { {tr("drive_folder_on", { path: f.path, name }, `${f.path} · home on ${name}`)}

{line &&

{line}

} + {error &&

{error}

}
- {why && } +
+ {why && } + +
+ {dialog} ); } @@ -149,21 +207,25 @@ export function AwayFolders() { const tr = useTr(); const [folders, setFolders] = useState(null); const [now, setNow] = useState(() => Date.now()); - useEffect(() => { - let live = true; - const load = () => + const live = useRef(true); + const load = useCallback( + () => void fetchLocalFolders().then((f) => { - if (!live) return; + if (!live.current) return; setFolders(f); setNow(Date.now()); - }); + }), + [], + ); + useEffect(() => { + live.current = true; load(); const id = window.setInterval(load, 5_000); return () => { - live = false; + live.current = false; window.clearInterval(id); }; - }, []); + }, [load]); if (!folders?.length) return null; return (
@@ -177,7 +239,7 @@ export function AwayFolders() {

    {folders.map((f) => ( - + ))}
diff --git a/client/src/screens/MeshDrive/driveDetail.test.ts b/client/src/screens/MeshDrive/driveDetail.test.ts index e0a76ae36..9be23c66a 100644 --- a/client/src/screens/MeshDrive/driveDetail.test.ts +++ b/client/src/screens/MeshDrive/driveDetail.test.ts @@ -40,6 +40,7 @@ describe("driveDetailText", () => { "confirm_deletes", "too_many_files", "list_unreadable", + "console_list_unreadable", "link_record_damaged", "too_many_for_console", ]) { diff --git a/client/src/screens/MeshDrive/driveDetail.ts b/client/src/screens/MeshDrive/driveDetail.ts index e1e0cb361..0f9cc5618 100644 --- a/client/src/screens/MeshDrive/driveDetail.ts +++ b/client/src/screens/MeshDrive/driveDetail.ts @@ -80,6 +80,12 @@ export function driveDetailText( a, "This version cannot read the console's drive list. Update this app.", ); + case "console_list_unreadable": + return tr( + "drive_detail_console_list_unreadable", + a, + "The console couldn't read its drive list. Nothing changes until it can.", + ); case "link_record_damaged": return tr( "drive_detail_link_record_damaged", diff --git a/client/src/screens/MeshDrive/index.tsx b/client/src/screens/MeshDrive/index.tsx index c5fa382dd..25fea2621 100644 --- a/client/src/screens/MeshDrive/index.tsx +++ b/client/src/screens/MeshDrive/index.tsx @@ -49,7 +49,7 @@ import { agoText, KIND_ICONS } from "../Devices"; import { CreateDriveDialog, JoinDriveDialog, PasswordDialog } from "./DriveDialogs"; import { ConflictsDialog, LinkDialog, LinkedConsoles, linkName } from "./LinksAndConflicts"; import { useRosterStore } from "../../state/roster"; -import { AwayActions, AwayFolders, awayText, useConsoleName } from "./AwayFolders"; +import { AwayActions, AwayFolders, awayText, sayDoneLater, useConsoleName } from "./AwayFolders"; import { driveDetailText } from "./driveDetail"; import { humanizeCaught } from "../../lib/humanizeError"; @@ -343,7 +343,10 @@ function DriveCard({ confirmLabel: tr("drive_member_remove", undefined, "Remove"), destructive: true, }); - if (ok) await run(() => driveApi.leave(host, d.id, m.id)); + if (ok) + await run(async () => { + if ((await driveApi.leave(host, d.id, m.id)).later) sayDoneLater(tr, consoleName, false); + }); }; const openHere = async () => { @@ -363,7 +366,11 @@ function DriveCard({ confirmLabel: tr("drive_leave", undefined, "Leave"), destructive: true, }); - if (ok) await run(() => driveApi.leave(host, d.id, mine.member)); + if (ok) + await run(async () => { + // The console stopped answering since the list was read: done here, and there once back. + if ((await driveApi.leave(host, d.id, mine.member)).later) sayDoneLater(tr, consoleName, false); + }); }; const remove = async () => { @@ -377,7 +384,10 @@ function DriveCard({ confirmLabel: tr("drive_delete", undefined, "Delete drive"), destructive: true, }); - if (ok) await run(() => driveApi.remove(host, d.id)); + if (ok) + await run(async () => { + if ((await driveApi.remove(host, d.id)).later) sayDoneLater(tr, consoleName, true); + }); }; const reviewDeletes = async () => { diff --git a/client/src/screens/Payloads/PayloadManagerPanel.tsx b/client/src/screens/Payloads/PayloadManagerPanel.tsx index 10e38d910..b37fe37fe 100644 --- a/client/src/screens/Payloads/PayloadManagerPanel.tsx +++ b/client/src/screens/Payloads/PayloadManagerPanel.tsx @@ -1,7 +1,9 @@ import { useCallback, useEffect, useRef, useState, type ReactNode } from "react"; import { ArrowDown, ArrowUp, ExternalLink, Play, Plus, RefreshCw, Search, Skull, Trash2, Upload } from "lucide-react"; -import { Badge, Button, Callout, ErrorCard, Input, Select, Spinner, Toggle } from "../../components"; +import { Badge, Button, Callout, ErrorCard, Input, OverflowMenu, Select, Spinner, Toggle } from "../../components"; +import type { OverflowMenuItem } from "../../components"; +import { usePhoneLayout } from "../../lib/phoneLayout"; import { useConfirm } from "../../components/ConfirmDialog"; import { autoloadKey, @@ -130,6 +132,18 @@ export function runningOrigin(tr: Translator, ours: boolean, bootN: number | nul * path) marks the ones running now, with their pid and Stop. `onChanged` runs after a * change here (launch, delete, store, boot list), so what runs is read again. `part` picks the * saved list or the settings (boot list, helper at boot, adding a payload). */ +/** The saved list on a computer or tablet: the rows share one column for their actions (as wide + * as the widest row's, up to a limit, its buttons wrapping inside it), so every row's name and + * path get the same width. Before, a row with more buttons (running, and in the boot list) had + * a narrower text column and cut its path earlier than the others. Where the browser has no + * subgrid (old WebKit), each row keeps its own flexible layout. */ +// Written out whole: Tailwind only makes the classes it finds spelled out in the source. +const SAVED_LIST = + "grid gap-1.5 supports-[grid-template-columns:subgrid]:roomy:grid-cols-[minmax(0,1fr)_fit-content(28rem)]"; +const SAVED_ROW = + "supports-[grid-template-columns:subgrid]:roomy:col-span-2 supports-[grid-template-columns:subgrid]:roomy:grid supports-[grid-template-columns:subgrid]:roomy:grid-cols-subgrid"; +const SAVED_ACTIONS = "supports-[grid-template-columns:subgrid]:roomy:justify-end"; + export default function PayloadManagerPanel({ running, onChanged, @@ -138,6 +152,8 @@ export default function PayloadManagerPanel({ const tr = useTr(); const host = useConnectionStore((s) => s.host); const { confirm, dialog } = useConfirm(); + // A phone gets a compact row per saved payload (`row` below). + const phone = usePhoneLayout(); const [view, setView] = useState(null); const [error, setError] = useState(null); const [loading, setLoading] = useState(false); @@ -476,13 +492,145 @@ export default function PayloadManagerPanel({ // out here is the switch turned off, not something the next connection undoes. const isHelper = !!helperCopy && p.path === helperCopy.path; const live = running?.[p.path]; + const toggleBoot = () => { + if (!autoload) return; + void (isHelper + ? setHelperAtBoot(!listed) + : setAutoload( + autoload.enabled, + listed ? autoload.list.filter((e) => !keys.includes(e)) : [...autoload.list, key], + )); + }; + if (phone) { + // A phone: the name and its state on one line, the main action as one button (Stop for + // one that runs, else Launch), the rest behind ⋯. With every button on show, a row took + // two or three lines of buttons, and 20 payloads were a long scroll. + const stop = live?.canStop ? live : null; + const more: OverflowMenuItem[] = [ + ...(live?.webUrl + ? [{ label: tr("hub_open_page", undefined, "Open web page"), onSelect: () => void openExternalUrl(live.webUrl!) }] + : []), + ...(autoload + ? [ + { + label: listed + ? tr("pm_autoload_remove", undefined, "Don't load at boot") + : tr("pm_autoload_add", undefined, "Load at boot"), + onSelect: toggleBoot, + disabled: busy !== null, + }, + ] + : []), + ...(autoload && listed + ? [ + { + label: tr("pm_autoload_earlier", undefined, "Load earlier"), + onSelect: () => void setAutoload(autoload.enabled, moveEntry(autoload.list, key, -1)), + disabled: busy !== null || pos <= 0, + }, + { + label: tr("pm_autoload_later", undefined, "Load later"), + onSelect: () => void setAutoload(autoload.enabled, moveEntry(autoload.list, key, 1)), + disabled: busy !== null || pos >= order.length - 1, + }, + ] + : []), + ...(to && recorded && to.html_url + ? [ + { + label: tr("pu_out_open_page", { version: to.tag }, `${to.tag} is out — open project page`), + onSelect: () => void openExternalUrl(to.html_url), + }, + ] + : []), + ...(stop + ? [ + { + label: tr("pm_launch", undefined, "Launch"), + onSelect: () => void launch(p), + disabled: busy !== null || !!live?.busy, + }, + ] + : []), + ...(p.path.startsWith("/data/pldmgr/") + ? [ + { + label: tr("delete", undefined, "Delete"), + onSelect: () => void remove(p), + disabled: busy !== null || !!live?.busy, + destructive: true, + separator: true, + }, + ] + : []), + ]; + return ( +
  • +
    + {/* A long file name takes the lines it needs, and keeps its own order in a + right-to-left language. */} + + {p.name || p.filename} + + {live && ( + + {tr("hub_state_running", undefined, "Running")} + + )} + {listed && autoload && ( + + {tr("pm_autoload_badge", { n: pos + 1 }, `boot #${pos + 1}`)} + + )} + {to && recorded && ( + + {tr("pm_update_available", { tag: to.tag }, `${to.tag} available`)} + + )} +
    + {stop ? ( + + ) : ( + + )} + +
  • + ); + } return (
  • -
    +
    {/* A long file name takes the lines it needs, and keeps its own order in a right-to-left language. */} @@ -540,7 +688,7 @@ export default function PayloadManagerPanel({
    )}
    -
    +
    {live?.webUrl && (
    + {room && tooLong ? ( + + ) : ( + room && + editing && ( +

    + {tr("upload_pkg_name_left", { count: room.left }, "Bytes left for the name: {count}")} +

    + ) + )} {names.other_names > 0 && ( {state.saved && state.saved.changed > 0 && ( -

    +

    {tr("upload_pkg_name_saved", undefined, "Name changed.")}

    )} diff --git a/client/src/screens/Upload/index.tsx b/client/src/screens/Upload/index.tsx index 56cf78b29..69bf2f421 100644 --- a/client/src/screens/Upload/index.tsx +++ b/client/src/screens/Upload/index.tsx @@ -42,7 +42,6 @@ import { type SourceKind, } from "../../state/upload"; import { - fetchVolumes, pathKind, probeDestination, volumeAllocatableBytes, @@ -77,7 +76,9 @@ import { Select, Toggle, ProgressBar, + OverflowMenu, } from "../../components"; +import { usePhoneLayout } from "../../lib/phoneLayout"; import { SendHelperButton } from "../../components/SendHelperButton"; import { parseArchivePart, @@ -94,6 +95,7 @@ import { convertFirstState } from "../../lib/convertFirst"; import { isRemotePath } from "../../lib/remotePath"; import { useUploadSettingsStore } from "../../state/uploadSettings"; import { useUploadQueueStore } from "../../state/uploadQueue"; +import { useConsoleVolumes } from "../../state/volumes"; import { SendAsImageCard } from "./SendAsImageCard"; import { isImageFolder } from "./imageDirNote"; import { pkgLibraryStore } from "../../state/pkgLibrary"; @@ -459,7 +461,17 @@ export default function UploadScreen({ // hardcoded `/data /mnt/ext0 /mnt/usb0` list which hid every other // mount point (e.g. `/mnt/ext1`, `/mnt/usbN` for N>0, and any // ps5upload-mounted images). - const [availableVolumes, setAvailableVolumes] = useState([]); + // + // The shared reading of the drives (state/volumes), not a copy made when the screen opened: + // the "usable" figure beside each drive, and the will-it-fit check on a batch, used the free + // space of before the last upload until the screen was left and opened again (#944). + const drives = useConsoleVolumes(host); + const availableVolumes = useMemo( + // Only writable, real drives are upload targets. A placeholder is a mount point the + // helper reports even when nothing is mounted there. + () => (drives.volumes ?? []).filter((v) => v.writable && !v.is_placeholder), + [drives.volumes], + ); /** Snapshot the current source + destination + options into a queue * item. Captured at click time, so subsequent edits to the form @@ -617,31 +629,6 @@ export default function UploadScreen({ useEffect(() => { setPreflightError(null); }, [source?.path, source?.kind, destinationVolume, destinationSubpath]); - useEffect(() => { - if (!host?.trim()) { - setAvailableVolumes([]); - return; - } - let cancelled = false; - const addr = consoleAddr(host); - fetchVolumes(addr) - .then((vols) => { - if (cancelled) return; - // Only writable, non-placeholder volumes are valid upload - // targets. Placeholders are mount-points the payload reports - // even when nothing is mounted there. - setAvailableVolumes( - vols.filter((v) => v.writable && !v.is_placeholder), - ); - }) - .catch(() => { - if (!cancelled) setAvailableVolumes([]); - }); - return () => { - cancelled = true; - }; - }, [host]); - // The destination as the user picks it (not a prefill): a prefill never overrides it. const userChoseDest = useRef(false); const chooseDestination = (volume: string | null, subpath?: string) => { @@ -1580,6 +1567,19 @@ function Step2Options(props: { preflightBusy || (!!detectError && !asIs) || archiveUndecided; + const addToQueueDisabled = + detecting || preflightBusy || (!!detectError && !asIs) || archiveUndecided; + const uploadLabel = preflightBusy + ? tr("upload_checking", "Checking…") + : inFlight + ? transferKind === "starting" + ? tr("upload_starting", "Starting…") + : tr("upload_uploading", "Uploading…") + : source.kind === "pkg" + ? tr("install.uploadInstall", "Upload & install") + : tr("upload_now", "Upload"); + // One row of actions on a phone (below): the main one, the rest behind ⋯. + const phone = usePhoneLayout(); // Why Upload / Add to queue are greyed out while an archive waits for its choice. const undecidedHint = tr( "upload_archive_choose_first", @@ -2049,137 +2049,201 @@ function Step2Options(props: { {/* The actions stay in view at the bottom of the window however long the options above - are (a game folder with every fold open is taller than a laptop screen). */} -
    - {/* Which PS5 this upload targets — a chip instead of baking a - (possibly long) console name into the button label. Auto-hides for - single-console users. Pushed to the left; actions stay right. */} - {multiConsole && ( - - {tr("upload_target_label", "Uploading to")} - - - )} - {/* Nothing has started yet, so this is not a Cancel: it clears the source. */} - - {/* A game, folder or image can be made into a package, image or folder first. */} - {convertState && ( + are (a game folder with every fold open is taller than a laptop screen). On a phone + they are one row, above the tab bar: the main action, the rest behind ⋯ (three + stacked buttons covered a third of the screen, and the bar sat behind the tab bar). */} + {phone ? ( +
    + {multiConsole && ( + + + + )} + navigate("/workshop", { state: convertState }), + testId: "convert-first", + }, + ] + : []), + { + label: tr("upload_change_source", undefined, "Change source"), + onSelect: onClear, + separator: true, + testId: "upload-change-source", + }, + ]} + /> + {streamThis ? ( + + ) : ( + + )} +
    + ) : ( +
    + {/* Which PS5 this upload targets — a chip instead of baking a + (possibly long) console name into the button label. Auto-hides for + single-console users. Pushed to the left; actions stay right. */} + {multiConsole && ( + + {tr("upload_target_label", "Uploading to")} + + + )} + {/* Nothing has started yet, so this is not a Cancel: it clears the source. */} + + {/* A game, folder or image can be made into a package, image or folder first. */} + {convertState && ( + + )} + {/* Add-to-queue: capture the current source + options into the + persisted upload queue without starting the transfer. The + Resume variant only makes sense for folders (single files + don't reconcile), so it's hidden for image/file sources. */} - )} - {/* Add-to-queue: capture the current source + options into the - persisted upload queue without starting the transfer. The - Resume variant only makes sense for folders (single files - don't reconcile), so it's hidden for image/file sources. */} - - - {streamThis && ( + } + > + {tr("upload_add_to_queue", "Add to queue")} + - )} -
    + {streamThis && ( + + )} +
    + )} {preflightError && (
    0 ? availableVolumes.map((v) => v.path).sort() : [...FALLBACK_VOLUMES].sort(); - // Build a {path → usable-bytes} map so we can show "/mnt/ext1 (450 GB - // usable)" inline. Only when we actually got the live list back. + // Build a {path → likely-to-fit bytes} map so we can show "/mnt/ext1 (room for + // about 450 GiB)" inline. Only when we actually got the live list back. // - // Deliberately the ALLOCATABLE figure, not raw free_bytes. On internal - // storage the PS5 holds back a large content-allocator reserve that - // statfs never reflects, so free_bytes overstates what an upload can - // actually use — a FW 12.00 report showed /data advertising 143 GB free - // while only ~63 GB was writable, and the 118 GiB upload it green-lit - // died at 53% after 17 minutes. Showing the number that actually governs - // is what lets someone pick a workable destination up front. + // Deliberately what is LIKELY TO FIT, not raw free_bytes. On internal storage + // the PS5 holds back more as data is written, so free_bytes overstates what an + // upload can use: a FW 12.00 report showed /data advertising 143 GB free while + // only ~63 GB was writable, and the 118 GiB upload it green-lit died at 53% + // after 17 minutes. It is an estimate ("about"): the PS5's own Storage screen + // can show less still (#944), and nothing here knows that figure. const usableBytesByPath = new Map(); for (const v of availableVolumes) { // What is likely to fit, which on internal storage is less than what is allocatable. usableBytesByPath.set(v.path, volumeLikelyFitsBytes(v)); } - const formatUsable = (bytes: number) => `${formatBytes(bytes)} usable`; + const formatUsable = (bytes: number) => + tr("upload_dest_room", { size: formatBytes(bytes) }, "room for about {size}"); return (
    diff --git a/client/src/screens/Upload/pkgNameFlow.test.ts b/client/src/screens/Upload/pkgNameFlow.test.ts index 576a46a1d..0dcd0f86f 100644 --- a/client/src/screens/Upload/pkgNameFlow.test.ts +++ b/client/src/screens/Upload/pkgNameFlow.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it, vi } from "vitest"; import type { PkgNames, PkgRenamed } from "../../api/pkgName"; -import { createNameFlow, saveBlocked } from "./pkgNameFlow"; +import { createNameFlow, nameRoom, saveBlocked } from "./pkgNameFlow"; const names = (over: Partial = {}): PkgNames => ({ platform: "ps5", @@ -109,6 +109,63 @@ describe("the Name on the PS5 field", () => { expect(set).not.toHaveBeenCalled(); }); + it("counts the name in bytes against the package's own room, and never sends one that is too long", async () => { + const set = vi.fn(); + const read = vi.fn().mockResolvedValue( + names({ other_names: 2, room: { default_name: 30, all_languages: 12 } }), + ); + const flow = createNameFlow({ read, set }); + await flow.load("/games/a.pkg"); + // The name it has: 22 bytes of the 30 that fit. + expect(nameRoom(flow.get())).toEqual({ limit: 30, used: 22, left: 8 }); + // Thirty letters fit; one more does not. + flow.setValue("x".repeat(30)); + expect(nameRoom(flow.get())?.left).toBe(0); + expect(saveBlocked(flow.get())).toBeNull(); + flow.setValue("x".repeat(31)); + expect(nameRoom(flow.get())?.left).toBe(-1); + expect(saveBlocked(flow.get())).toBe("too_long"); + // Bytes, not letters: eleven Japanese letters are 33 bytes. + flow.setValue("テ".repeat(11)); + expect(nameRoom(flow.get())).toEqual({ limit: 30, used: 33, left: -3 }); + expect(saveBlocked(flow.get())).toBe("too_long"); + await flow.save(); + expect(set).not.toHaveBeenCalled(); + // Spaces around the name are not stored, so they are not counted. + flow.setValue(" " + "x".repeat(30) + " "); + expect(saveBlocked(flow.get())).toBeNull(); + // Every language has less room in this package. + flow.setValue("A longer name"); + expect(saveBlocked(flow.get())).toBeNull(); + flow.setAllLanguages(true); + expect(nameRoom(flow.get())).toEqual({ limit: 12, used: 13, left: -1 }); + expect(saveBlocked(flow.get())).toBe("too_long"); + }); + + it("without a room from the engine, the overall limit is the room", async () => { + const flow = createNameFlow({ read: vi.fn().mockResolvedValue(names()), set: vi.fn() }); + await flow.load("/games/a.pkg"); + flow.setValue("é".repeat(63)); + expect(nameRoom(flow.get())).toEqual({ limit: 127, used: 126, left: 1 }); + expect(saveBlocked(flow.get())).toBeNull(); + flow.setValue("é".repeat(64)); + expect(saveBlocked(flow.get())).toBe("too_long"); + // A room larger than the overall limit does not raise it. + const big = createNameFlow({ + read: vi.fn().mockResolvedValue(names({ room: { default_name: 500, all_languages: 500 } })), + set: vi.fn(), + }); + await big.load("/games/a.pkg"); + expect(nameRoom(big.get())?.limit).toBe(127); + // A package that refuses has no room to show. + const refused = createNameFlow({ + read: vi.fn().mockResolvedValue(names({ refusal: { code: "retail", reason: "official" } })), + set: vi.fn(), + }); + await refused.load("/games/a.pkg"); + expect(nameRoom(refused.get())).toBeNull(); + }); + it("a name that could not be read leaves no field", async () => { const flow = createNameFlow({ read: vi.fn().mockRejectedValue(new Error("this is not a PS4 or PS5 package")), diff --git a/client/src/screens/Upload/pkgNameFlow.ts b/client/src/screens/Upload/pkgNameFlow.ts index 1b1e1f86d..b3aefa387 100644 --- a/client/src/screens/Upload/pkgNameFlow.ts +++ b/client/src/screens/Upload/pkgNameFlow.ts @@ -39,17 +39,36 @@ const EMPTY: NameFlowState = { const reasonOf = (e: unknown) => (e instanceof Error ? e.message : String(e)); +const utf8Bytes = (s: string) => new TextEncoder().encode(s).length; + +/** The room the package has for the name in the field, in UTF-8 bytes: how many fit (`limit`: + * the package's own room for what would change, the default name alone or every language; + * the engine's overall limit when it gives no room), how many the name takes, and how many + * are left (negative: that many too long). null with no package read, or one that refuses. */ +export function nameRoom(s: NameFlowState): { limit: number; used: number; left: number } | null { + if (!s.names || s.names.refusal) return null; + const { room, max_bytes, other_names } = s.names; + const every = s.allLanguages && other_names > 0; + const limit = Math.min(max_bytes, room ? (every ? room.all_languages : room.default_name) : max_bytes); + const used = utf8Bytes(s.value.trim()); + return { limit, used, left: limit - used }; +} + /** Why Change name is not offered for what the field holds: nothing typed, nothing to change - * (the same name, unless every language is asked for and some differ), the package refuses a - * rename, or it is being read or written. null when it can be pressed. A name that is too - * long is the engine's to refuse: it counts bytes, and says how many fit. */ -export function saveBlocked(s: NameFlowState): "empty" | "same" | "refused" | "busy" | null { + * (the same name, unless every language is asked for and some differ), a name longer than the + * package has room for (counted in bytes, as the engine counts: said in the field itself, + * before anything is sent), the package refuses a rename, or it is being read or written. + * null when it can be pressed. */ +export function saveBlocked( + s: NameFlowState, +): "empty" | "same" | "too_long" | "refused" | "busy" | null { if (!s.names || s.loading || s.saving) return "busy"; if (s.names.refusal) return "refused"; const name = s.value.trim(); if (!name) return "empty"; const changesOthers = s.allLanguages && s.names.other_names > 0; if (name === s.names.name && !changesOthers) return "same"; + if ((nameRoom(s)?.left ?? 0) < 0) return "too_long"; return null; } diff --git a/client/src/screens/Upload/stickyActions.ts b/client/src/screens/Upload/stickyActions.ts index f7d194403..6ed0c24ca 100644 --- a/client/src/screens/Upload/stickyActions.ts +++ b/client/src/screens/Upload/stickyActions.ts @@ -1,5 +1,8 @@ /** A row of main actions that sticks to the bottom of the scrolling page while its card is on * screen, so Upload / Stream & install stay in reach however long the options above are. - * Opaque (the cards are glass) so nothing scrolls through it. */ + * Opaque (the cards are glass) so nothing scrolls through it. On a phone it sticks above what + * floats there (the tab bar and the activity pill): the scroll area keeps that much padding + * (`--float-bottom`, index.css), and a sticky box stays inside it. There it holds one row: the + * main action, the rest behind ⋯. */ export const STICKY_ACTIONS = "sticky bottom-2 z-10 flex flex-wrap items-center gap-2 rounded-[var(--radius-panel)] border border-[var(--glass-edge)] bg-[var(--color-float)] p-2 shadow-[var(--shadow-1)]"; diff --git a/client/src/screens/Volumes/StorageCard.test.tsx b/client/src/screens/Volumes/StorageCard.test.tsx index 85d0c6035..804df57f4 100644 --- a/client/src/screens/Volumes/StorageCard.test.tsx +++ b/client/src/screens/Volumes/StorageCard.test.tsx @@ -55,8 +55,45 @@ describe("StorageCard — default package drive", () => { onUseForPackages={() => {}} />, ); - expect(withKept).toContain("61.6 GiB kept by the console for its own use"); - expect(html(vol("/data", { fs_type: "nullfs" }), null)).not.toContain("kept by the console"); + expect(withKept).toContain( + "61.6 GiB is held back by the PS5 for itself. It is not free space, and it grows as data is written.", + ); + expect(html(vol("/data", { fs_type: "nullfs" }), null)).not.toContain("held back by the PS5"); + }); + + // #944: a 2 TB console with 175 GB free and 308 GB held back. Free is shown as it is (the + // held-back space is already out of it), what is likely to fit is said for what it is, and the + // card does not claim to match the PS5's own Storage screen. + it("says which number means room, and that the PS5's own screen can show less", () => { + const internal = vol("/data", { + fs_type: "nullfs", + total_bytes: 1995416338432, + free_bytes: 175467069440, + safety_reserve_bytes: 1073741824, + allocatable_bytes: 174393327616, + likely_fits_bytes: 144432988160, + }); + const out = renderToStaticMarkup( + {}} + />, + ); + expect(out).toContain("163 GiB"); + expect(out).toContain("287 GiB is held back by the PS5 for itself."); + expect(out).toContain("About 135 GiB of new data is likely to fit here."); + expect(out).toContain("The PS5's own Storage screen can show less free space."); + // GiB throughout: no decimal GB beside it. + expect(out).not.toMatch(/\d GB\b/); + // No longer worded as if the gap were all held back by the system. + expect(out).not.toContain("headroom"); + }); + + it("says nothing about the PS5's screen on a drive that is not internal storage", () => { + const out = html(vol("/mnt/ext0", { allocatable_bytes: 300e9, likely_fits_bytes: 300e9 }), null); + expect(out).not.toContain("Storage screen"); }); it("offers nothing on a read-only drive", () => { diff --git a/client/src/screens/Volumes/index.tsx b/client/src/screens/Volumes/index.tsx index e1f51a2c5..7d09be4da 100644 --- a/client/src/screens/Volumes/index.tsx +++ b/client/src/screens/Volumes/index.tsx @@ -6,7 +6,6 @@ import { filesViewLink } from "../FileSystem/filesViews"; import { useConnectionStore } from "../../state/connection"; import { fetchHwStorage, - fetchVolumes, fsUnmount, volumeLikelyFitsBytes, type Volume, @@ -30,6 +29,7 @@ import { useStaleHostGuard } from "../../lib/staleHostGuard"; import { isInternalVolume, usePkgStorageStore } from "../../lib/pkgStorage"; import { saveFsLastPath } from "../../lib/fsLastPath"; import { canEjectUsb, useUsbEject } from "../../lib/useUsbEject"; +import { refreshVolumesAfterChange, useConsoleVolumes } from "../../state/volumes"; import { KeptByApp } from "./KeptByApp"; /** Path prefix for volumes our FS_MOUNT creates. Showing an Unmount @@ -48,14 +48,22 @@ export default function VolumesScreen() { const guard = useStaleHostGuard(); const payloadStatus = useConnectionStore((s) => s.payloadStatus); const navigate = useNavigate(); - const [volumes, setVolumes] = useState(null); - // Counts completed drive-list loads, so what ps5upload keeps is measured again with them. - const [loadedCount, setLoadedCount] = useState(0); + // The drives come from the slot every screen shares (state/volumes): what this screen shows + // as free is what Files and Upload show (#944). Read on open, on coming back into view, + // on Refresh, and when a job on the console ends. + const drives = useConsoleVolumes(host, payloadStatus === "up"); + // A reading that could not be renewed is not shown as the drives' state: the error is. + const volumes = drives.error ? null : drives.volumes; + const loading = drives.loading; // What the console keeps back of its internal storage for its own use (a fact the console // reports; nothing is derived from it). Null = not reported. const [consoleKept, setConsoleKept] = useState(null); - const [loading, setLoading] = useState(false); - const [error, setError] = useState(null); + // An unmount or an eject that failed. A failed read of the drives is the slot's own error. + const [actionError, setActionError] = useState(null); + // Through the shared humanizer, so a transient `fs_list_volumes_getmntinfo_failed` reads + // as something to retry and not as a raw internal string. + const error = actionError ?? (drives.error ? humanizePs5Error(drives.error) : null); + const setError = setActionError; const [unmountingPath, setUnmountingPath] = useState(null); // This console's default drive for install packages (null = internal). const packageDrive = usePkgStorageStore((s) => (host ? s.defaults[hostOf(host)] ?? null : null)); @@ -66,38 +74,28 @@ export default function VolumesScreen() { const refresh = useCallback(async () => { if (!host?.trim()) return; - // Host-stale guard (2.12.0 migrated to canonical useStaleHostGuard). - // fetchVolumes can take seconds on a PS5 with many mounts; an - // OLD list attributed to NEW host could lead to Unmount clicks - // targeting the wrong console. + setActionError(null); + await refreshVolumesAfterChange(host); + }, [host]); + + // Measured with each reading of the drives, so the line under the bar is as old as the bar. + // Best effort: a helper without the storage summary just shows no "kept" line. + const drivesReadAt = drives.loadedAtMs; + useEffect(() => { + if (!host?.trim() || drivesReadAt === null || payloadStatus !== "up") return; const probe = guard.capture(); - setLoading(true); - setError(null); - try { - const list = await fetchVolumes(transferAddr(probe.host)); - if (probe.isStale()) return; - setVolumes(list); - setLoadedCount((n) => n + 1); - // Best effort: a payload without the storage summary just shows no "kept" line. - fetchHwStorage(transferAddr(probe.host)) - .then((hw) => { - if (!probe.isStale()) setConsoleKept(hw.user_reserved_bytes > 0 ? hw.user_reserved_bytes : null); - }) - .catch(() => { - if (!probe.isStale()) setConsoleKept(null); - }); - } catch (e) { - if (probe.isStale()) return; - const raw = e instanceof Error ? e.message : String(e); - // Run through the shared humanizer so transient - // `fs_list_volumes_getmntinfo_failed` payload errors surface - // as a retryable hint instead of a raw internal string. - setError(humanizePs5Error(raw)); - setVolumes(null); - } finally { - setLoading(false); - } - }, [host, guard]); + let live = true; + fetchHwStorage(transferAddr(probe.host)) + .then((hw) => { + if (live && !probe.isStale()) setConsoleKept(hw.user_reserved_bytes > 0 ? hw.user_reserved_bytes : null); + }) + .catch(() => { + if (live && !probe.isStale()) setConsoleKept(null); + }); + return () => { + live = false; + }; + }, [host, drivesReadAt, guard, payloadStatus]); const { eject: handleEject, ejectingPath, dialog: ejectDialogNode } = useUsbEject({ onEjected: () => refresh(), @@ -145,10 +143,6 @@ export default function VolumesScreen() { } }; - useEffect(() => { - if (payloadStatus === "up") refresh(); - }, [payloadStatus, refresh]); - const { storageDrives, mountedImages } = useMemo(() => { const storage: Volume[] = []; const mounted: Volume[] = []; @@ -325,7 +319,7 @@ export default function VolumesScreen() { { // `?path=`: Files reads its saved folder only when it mounts (see EditSessionBanner). @@ -452,7 +446,8 @@ export function StorageCard({ onFreeUp, }: { volume: Volume; - /** The console's own reserved pool on this drive (internal storage only), as it reports it. */ + /** What the console holds back on this drive now (internal storage only): free blocks its + * filesystem does not offer a writer. Already left out of `free_bytes`. */ consoleKeptBytes?: number | null; /** This console's chosen package drive; null = internal storage. */ packageDrive: string | null; @@ -468,7 +463,7 @@ export function StorageCard({ ? isInternalVolume(packageDrive) : packageDrive === v.path.replace(/\/+$/, ""); // What is likely to fit: on internal storage less than free, since the PS5 holds back - // more as data is written. The line under the bar shows it with the difference. + // more as data is written. The line under the bar says it. const uploadSafeBytes = v.allocatable_bytes === undefined ? undefined : volumeLikelyFitsBytes(v); const pct = @@ -516,32 +511,37 @@ export function StorageCard({ {tr("volumes_pct_used_storage", undefined, "% used")}
    + {/* Three figures on internal storage, each said for what it is (#944): what the PS5 + holds back now (already left out of "free": never taken off again), what is + likely to fit, and that the PS5's own screen can show less than any of them. */} {consoleKeptBytes !== null && consoleKeptBytes > 0 && ( -
    +
    {tr( - "volumes_kept_by_console", + "volumes_held_back", { kept: formatBytes(consoleKeptBytes) }, - "{kept} kept by the console for its own use", + "{kept} is held back by the PS5 for itself. It is not free space, and it grows as data is written.", )}
    )} {uploadSafeBytes !== undefined && uploadSafeBytes < v.free_bytes && ( -
    +
    {tr( - "volumes_upload_safe_capacity", - { - safe: formatBytes(uploadSafeBytes), - // Everything between "free" and "likely to fit": the working margin, - // and on internal storage what the PS5 holds back as it writes. - reserve: formatBytes( - Math.max(0, v.free_bytes - uploadSafeBytes), - ), - }, - "{safe} safe for new uploads · {reserve} kept as system/filesystem headroom", + "volumes_likely_fits", + { safe: formatBytes(uploadSafeBytes) }, + "About {safe} of new data is likely to fit here.", )}
    )} + {isInternalVolume(v.path) && ( +
    + {tr( + "volumes_ps5_shows_less", + undefined, + "The PS5's own Storage screen can show less free space. When the two differ, go by the smaller one.", + )} +
    + )} ((set) => { `registered "${uploadName}" as ${res.title_id} after upload`, ); } catch (e) { - registerWarning = `Couldn't add it to the home screen automatically: ${humanizePs5Error( + // The helper's reason in words; the Library pointer only where the Library could. + registerWarning = registerAfterUploadWarning( e instanceof Error ? e.message : String(e), - )}. You can still do it from the Library.`; + uploadName, + ); } // A Stop that landed during the register round-trip: the phase // writes below are gated on isLive(), so state stays honest — diff --git a/client/src/state/update.desktop.test.ts b/client/src/state/update.desktop.test.ts index c4d1f8c9c..7d3a65e3b 100644 --- a/client/src/state/update.desktop.test.ts +++ b/client/src/state/update.desktop.test.ts @@ -11,6 +11,7 @@ vi.mock("../api/ps5", () => ({ updateInstall: vi.fn(), updateInstallOnQuit: vi.fn(async () => true), updateLastInstall: vi.fn(async () => null), + updateWaitForInstall: vi.fn(async () => "keep-running"), updateForgetFailure: vi.fn(async () => {}), updateOldDownloads: vi.fn(async () => ({ count: 0, bytes: 0 })), updateRemoveOldDownloads: vi.fn(async () => 0), @@ -173,6 +174,76 @@ describe("desktop updates", () => { expect(s.lastInstall).toBeNull(); }); + it("opened while the last quit's install still works: waits, says nothing, then the app restarts", async () => { + const api = await import("../api/ps5"); + const notes = await import("./notifications"); + const pending = { version: "10.2.0", installed: false, message: "", new: false, pending: true }; + vi.mocked(api.updateLastInstall).mockResolvedValue(pending); + let finish: (v: "relaunch") => void = () => {}; + vi.mocked(api.updateWaitForInstall).mockReturnValue(new Promise((r) => (finish = r))); + const { useUpdateStore, failedInstall } = await import("./update"); + const loading = useUpdateStore.getState().loadInstallStatus(); + await new Promise((r) => setTimeout(r, 0)); + // While it waits: the card, and no failure anywhere. + expect(useUpdateStore.getState().finishingUpdate).toBe(true); + expect(useUpdateStore.getState().lastInstall).toBeNull(); + expect(failedInstall(useUpdateStore.getState(), "10.2.0")).toBeNull(); + finish("relaunch"); + await loading; + // The app is quitting into the new version: the card stays, nothing was reported. + expect(useUpdateStore.getState().finishingUpdate).toBe(true); + expect(useUpdateStore.getState().lastInstall).toBeNull(); + expect(notes.pushNotification).not.toHaveBeenCalled(); + expect(api.updateLastInstall).toHaveBeenCalledTimes(1); + }); + + it("an install that ended while the app waited is judged then: a real failure is said once", async () => { + const api = await import("../api/ps5"); + const notes = await import("./notifications"); + vi.mocked(api.updateLastInstall) + .mockResolvedValueOnce({ version: "10.2.0", installed: false, message: "", new: false, pending: true }) + .mockResolvedValueOnce({ version: "10.2.0", installed: false, message: "could not open the .dmg", new: true }); + vi.mocked(api.updateWaitForInstall).mockResolvedValue("report"); + const { useUpdateStore, failedInstall } = await import("./update"); + await useUpdateStore.getState().loadInstallStatus(); + const s = useUpdateStore.getState(); + expect(s.finishingUpdate).toBe(false); + expect(s.lastInstall?.message).toBe("could not open the .dmg"); + expect(failedInstall(s, "10.2.0")).not.toBeNull(); + expect(notes.pushNotification).toHaveBeenCalledTimes(1); + }); + + it("an install still working after the wait is not called a failure", async () => { + const api = await import("../api/ps5"); + const notes = await import("./notifications"); + vi.mocked(api.updateLastInstall).mockResolvedValue({ + version: "10.2.0", + installed: false, + message: "", + new: false, + pending: true, + }); + for (const end of ["keep-running", new Error("no such command")] as const) { + vi.resetModules(); + const apiNow = await import("../api/ps5"); + vi.mocked(apiNow.updateLastInstall).mockResolvedValue({ + version: "10.2.0", + installed: false, + message: "", + new: false, + pending: true, + }); + if (typeof end === "string") vi.mocked(apiNow.updateWaitForInstall).mockResolvedValue(end); + else vi.mocked(apiNow.updateWaitForInstall).mockRejectedValue(end); + const { useUpdateStore } = await import("./update"); + await useUpdateStore.getState().loadInstallStatus(); + expect(useUpdateStore.getState().finishingUpdate).toBe(false); + expect(useUpdateStore.getState().lastInstall).toBeNull(); + } + expect(notes.pushNotification).not.toHaveBeenCalled(); + void api; + }); + it("a failed install found at launch is said once and stops the automatic install", async () => { const api = await import("../api/ps5"); const notes = await import("./notifications"); diff --git a/client/src/state/update.ts b/client/src/state/update.ts index 926a23d59..f85224364 100644 --- a/client/src/state/update.ts +++ b/client/src/state/update.ts @@ -10,6 +10,7 @@ import { updateInstall, updateInstallOnQuit, updateLastInstall, + updateWaitForInstall, updateForgetFailure, updateOldDownloads, updateRemoveOldDownloads, @@ -410,6 +411,10 @@ interface UpdateStore { /** What the last install came to (read once at launch), or after a failed install in this * session. A failed version is not installed by itself again (`failedInstall`). */ lastInstall: LastInstall | null; + /** An install from the last quit is still replacing the app (it was opened again too soon): + * the app waits for it and then starts again as the new version. Shown as a small + * "Finishing the update…" card; nothing is reported as failed meanwhile. */ + finishingUpdate: boolean; /** Read the last install's outcome and the old update downloads in Downloads (once). */ loadInstallStatus: () => Promise; /** After a failed install: forget it, download again if needed, and install. */ @@ -624,12 +629,28 @@ export const useUpdateStore = create((set, get) => { installFallback: null, skippedVersion: loadSkipped(), lastInstall: null, + finishingUpdate: false, oldDownloads: 0, loadInstallStatus() { statusLoaded ??= (async () => { try { - const last = await updateLastInstall(); + let last = await updateLastInstall(); + if (last?.pending) { + // The installer is still at work: wait for it rather than call it a failure. + set({ finishingUpdate: true }); + let next: Awaited> = "keep-running"; + try { + next = await updateWaitForInstall(); + } catch { + // Could not wait: carry on; the next launch judges the install. + } + // The app is quitting to start the new version: the card stays until it does. + if (next === "relaunch") return; + last = next === "report" ? await updateLastInstall() : null; + set({ finishingUpdate: false }); + if (last?.pending) last = null; + } if (last) set({ lastInstall: last }); if (last && !last.installed && last.new) { pushNotification( diff --git a/client/src/state/uploadQueue.ts b/client/src/state/uploadQueue.ts index 0e4c0d5ca..2965b4b64 100644 --- a/client/src/state/uploadQueue.ts +++ b/client/src/state/uploadQueue.ts @@ -81,6 +81,7 @@ import { discardUploadLeftovers } from "../lib/uploadLeftovers"; import { clearForReplace, destInFolder, offersConflictActions } from "../lib/destinationConflict"; import { existingCopyOf, materializeRemote, releaseCopy } from "../lib/materialize"; import { staticTranslator as tx } from "../lib/trStatic"; +import { registerAfterUploadWarning } from "../lib/registerAfterUpload"; /** Failed status reads in a row (2 s apart) before a found install counts as lost. */ const FIND_JOB_MAX_UNANSWERED = 150; @@ -137,7 +138,6 @@ import { isTauriEnv } from "../lib/tauriEnv"; import { createQueueLeader } from "../lib/queueLeader"; import { isJobUnknownError } from "../lib/pollRead"; import { krakenGuard } from "../lib/krakenGuard"; -import { humanizePs5Error } from "../lib/humanizeError"; /** The engine job id currently uploading on each console (bare host key). * runOne records it so stopHost/stop can ask the engine to TRULY cancel the @@ -1852,14 +1852,8 @@ export const useUploadQueueStore = create((rawSet, get) => { ? res.title_name : res.title_id; } catch (e) { - mountWarnings.push( - tx( - "queue_register_failed", - // The helper's reason in words where it has them (a system app's title ID, …). - { error: humanizePs5Error(e instanceof Error ? e.message : String(e)) }, - "Couldn't add it to the home screen automatically: {error}. You can still do it from the Library.", - ), - ); + // The helper's reason in words; the Library pointer only where the Library could. + mountWarnings.push(registerAfterUploadWarning(e instanceof Error ? e.message : String(e))); } } // Pkg finisher (the queue merge): once the .pkg lands in the staging diff --git a/client/src/state/volumes.test.ts b/client/src/state/volumes.test.ts new file mode 100644 index 000000000..162171784 --- /dev/null +++ b/client/src/state/volumes.test.ts @@ -0,0 +1,241 @@ +import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; + +import type { Volume } from "../api/ps5"; + +const fetchVolumes = vi.fn<(addr: string) => Promise>(); +vi.mock("../api/ps5", () => ({ fetchVolumes: (addr: string) => fetchVolumes(addr) })); + +import { useTaskStore } from "./tasks"; +import { + refreshVolumes, + refreshVolumesAfterChange, + resetVolumesForTests, + useVolumesStore, + volumesForHost, + VOLUMES_SETTLE_MS, + watchConsoleVolumes, +} from "./volumes"; + +const GIB = 1024 ** 3; +const data = (freeGib: number): Volume => ({ + path: "/data", + fs_type: "ufs", + total_bytes: 800 * GIB, + free_bytes: freeGib * GIB, + writable: true, +}); + +const HOST = "192.168.1.50"; +/** What a screen showing this console's drives would show as free on /data, in GiB. */ +const shown = (host: string = HOST): number | null => { + const v = volumesForHost(useVolumesStore.getState(), host).volumes; + return v ? v[0].free_bytes / GIB : null; +}; +/** Let the reads that were started settle. */ +const settle = () => vi.advanceTimersByTimeAsync(0); + +beforeEach(() => { + fetchVolumes.mockReset(); + resetVolumesForTests(); + useTaskStore.setState({ tasks: [] }); +}); +afterEach(() => { + vi.useRealTimers(); +}); + +describe("the shared reading of a console's drives (#944)", () => { + it("two screens read one slot: one read serves both, and a refresh from either updates both", async () => { + fetchVolumes.mockResolvedValueOnce([data(98)]); + // Files, and Volumes with the address in another shape: the same console. + const leaveFiles = watchConsoleVolumes(HOST); + const leaveVolumes = watchConsoleVolumes(`${HOST}:9113`); + await refreshVolumes(HOST); + // A second caller joins the read in flight. + expect(fetchVolumes).toHaveBeenCalledTimes(1); + expect(shown(HOST)).toBe(98); + expect(shown(`${HOST}:9113`)).toBe(98); + + fetchVolumes.mockResolvedValueOnce([data(163)]); + await refreshVolumes(`${HOST}:9113`); + expect(shown(HOST)).toBe(163); + leaveFiles(); + leaveVolumes(); + }); + + it("keeps each console's drives apart", async () => { + fetchVolumes.mockImplementation(async (addr) => [data(addr.startsWith("10.") ? 5 : 98)]); + await refreshVolumes(HOST); + await refreshVolumes("10.0.0.9"); + expect(shown(HOST)).toBe(98); + expect(shown("10.0.0.9")).toBe(5); + }); + + it("a recent reading is kept only when the caller says how recent is enough", async () => { + fetchVolumes.mockResolvedValue([data(98)]); + await refreshVolumes(HOST); + await refreshVolumes(HOST, { maxAgeMs: 30_000 }); + expect(fetchVolumes).toHaveBeenCalledTimes(1); + // Refresh has no such allowance. + await refreshVolumes(HOST); + expect(fetchVolumes).toHaveBeenCalledTimes(2); + // An old reading is read again. + useVolumesStore.getState().patch(HOST, { loadedAtMs: Date.now() - 31_000 }); + await refreshVolumes(HOST, { maxAgeMs: 30_000 }); + expect(fetchVolumes).toHaveBeenCalledTimes(3); + }); + + it("reads once more after a change that a read in flight may have missed", async () => { + let release: (v: Volume[]) => void = () => {}; + fetchVolumes.mockImplementationOnce(() => new Promise((r) => (release = r))); + const first = refreshVolumes(HOST); + // The delete finished while that read was on its way. + fetchVolumes.mockResolvedValueOnce([data(163)]); + const after = refreshVolumesAfterChange(HOST); + release([data(98)]); + await first; + expect((await after)?.[0].free_bytes).toBe(163 * GIB); + expect(fetchVolumes).toHaveBeenCalledTimes(2); + expect(shown()).toBe(163); + }); + + it("a read that fails keeps the last list and says so", async () => { + fetchVolumes.mockResolvedValueOnce([data(98)]); + await refreshVolumes(HOST); + fetchVolumes.mockRejectedValueOnce(new Error("fs_list_volumes_getmntinfo_failed")); + expect(await refreshVolumes(HOST)).toBeNull(); + const slot = volumesForHost(useVolumesStore.getState(), HOST); + expect(slot.error).toBe("fs_list_volumes_getmntinfo_failed"); + expect(slot.volumes?.[0].free_bytes).toBe(98 * GIB); + expect(slot.loading).toBe(false); + // The next good read clears it. + fetchVolumes.mockResolvedValueOnce([data(97)]); + await refreshVolumes(HOST); + expect(volumesForHost(useVolumesStore.getState(), HOST).error).toBeNull(); + expect(shown()).toBe(97); + }); + + it("a reading that changed nothing keeps the same list, so nothing that follows it runs again", async () => { + fetchVolumes.mockImplementation(async () => [data(98)]); + await refreshVolumes(HOST); + const first = volumesForHost(useVolumesStore.getState(), HOST); + await refreshVolumes(HOST); + const second = volumesForHost(useVolumesStore.getState(), HOST); + expect(second.volumes).toBe(first.volumes); + // It is still a newer reading. + expect(second.loadedAtMs).not.toBeNull(); + fetchVolumes.mockImplementation(async () => [data(97)]); + await refreshVolumes(HOST); + expect(volumesForHost(useVolumesStore.getState(), HOST).volumes).not.toBe(first.volumes); + expect(shown()).toBe(97); + }); + + it("reads nothing without a console", async () => { + watchConsoleVolumes("")(); + watchConsoleVolumes(null)(); + expect(await refreshVolumes(" ")).toBeNull(); + expect(await refreshVolumesAfterChange(undefined)).toBeNull(); + expect(fetchVolumes).not.toHaveBeenCalled(); + }); +}); + +describe("drives are read again when a job on the console ends (#944)", () => { + const start = (kind: "upload-file" | "fs-delete" | "icon-fetch", consoleId = HOST) => + useTaskStore.getState().registerTask({ kind, origin: "test", label: "job", consoleId, status: "running" }); + + it("an upload that finishes updates the free space on the screen showing it", async () => { + vi.useFakeTimers(); + fetchVolumes.mockResolvedValueOnce([data(163)]); + const leave = watchConsoleVolumes(HOST); + await settle(); + expect(shown()).toBe(163); + + const id = start("upload-file"); + // Progress is not an end: nothing is read while it runs. + useTaskStore.getState().updateTask(id, { progress: { current: 1, total: 2, unit: "bytes" } }); + await vi.advanceTimersByTimeAsync(VOLUMES_SETTLE_MS * 2); + expect(fetchVolumes).toHaveBeenCalledTimes(1); + + fetchVolumes.mockResolvedValueOnce([data(120)]); + useTaskStore.getState().finishTask(id, "done"); + await vi.advanceTimersByTimeAsync(VOLUMES_SETTLE_MS + 10); + expect(fetchVolumes).toHaveBeenCalledTimes(2); + expect(shown()).toBe(120); + leave(); + }); + + it("many jobs ending together cost one read", async () => { + vi.useFakeTimers(); + fetchVolumes.mockResolvedValue([data(163)]); + const leave = watchConsoleVolumes(HOST); + await settle(); + const ids = [start("fs-delete"), start("fs-delete"), start("upload-file")]; + for (const id of ids) useTaskStore.getState().finishTask(id, "done"); + await vi.advanceTimersByTimeAsync(VOLUMES_SETTLE_MS + 10); + expect(fetchVolumes).toHaveBeenCalledTimes(2); + leave(); + }); + + it("a failed or stopped job counts too: it may have written before it ended", async () => { + vi.useFakeTimers(); + fetchVolumes.mockResolvedValue([data(163)]); + const leave = watchConsoleVolumes(HOST); + await settle(); + useTaskStore.getState().finishTask(start("upload-file"), "failed"); + await vi.advanceTimersByTimeAsync(VOLUMES_SETTLE_MS + 10); + expect(fetchVolumes).toHaveBeenCalledTimes(2); + useTaskStore.getState().finishTask(start("fs-delete"), "cancelled"); + await vi.advanceTimersByTimeAsync(VOLUMES_SETTLE_MS + 10); + expect(fetchVolumes).toHaveBeenCalledTimes(3); + leave(); + }); + + it("leaves alone a job on another console, and one that writes nothing", async () => { + vi.useFakeTimers(); + fetchVolumes.mockResolvedValue([data(163)]); + const leave = watchConsoleVolumes(HOST); + await settle(); + useTaskStore.getState().finishTask(start("upload-file", "10.0.0.9"), "done"); + useTaskStore.getState().finishTask(start("icon-fetch"), "done"); + await vi.advanceTimersByTimeAsync(VOLUMES_SETTLE_MS * 3); + expect(fetchVolumes).toHaveBeenCalledTimes(1); + leave(); + }); + + it("reads nothing for a console no screen is showing", async () => { + vi.useFakeTimers(); + fetchVolumes.mockResolvedValue([data(163)]); + const leave = watchConsoleVolumes(HOST); + await settle(); + // The screen went away, or was hidden (a hidden screen's effects are torn down). + leave(); + leave(); + useTaskStore.getState().finishTask(start("upload-file"), "done"); + await vi.advanceTimersByTimeAsync(VOLUMES_SETTLE_MS * 3); + expect(fetchVolumes).toHaveBeenCalledTimes(1); + }); + + it("a job that ends just before the screen is left still does not read for nobody", async () => { + vi.useFakeTimers(); + fetchVolumes.mockResolvedValue([data(163)]); + const leave = watchConsoleVolumes(HOST); + await settle(); + useTaskStore.getState().finishTask(start("upload-file"), "done"); + leave(); + await vi.advanceTimersByTimeAsync(VOLUMES_SETTLE_MS * 3); + expect(fetchVolumes).toHaveBeenCalledTimes(1); + }); + + it("coming back to a screen reads the drives again", async () => { + vi.useFakeTimers(); + fetchVolumes.mockResolvedValueOnce([data(98)]); + watchConsoleVolumes(HOST)(); + await settle(); + expect(shown()).toBe(98); + // Shown again after being hidden: the effect runs again. + fetchVolumes.mockResolvedValueOnce([data(163)]); + const leave = watchConsoleVolumes(HOST); + await settle(); + expect(shown()).toBe(163); + leave(); + }); +}); diff --git a/client/src/state/volumes.ts b/client/src/state/volumes.ts new file mode 100644 index 000000000..d50f44650 --- /dev/null +++ b/client/src/state/volumes.ts @@ -0,0 +1,211 @@ +import { useEffect } from "react"; +import { create } from "zustand"; +import { fetchVolumes, type Volume } from "../api/ps5"; +import { consoleAddr, hostOf } from "../lib/addr"; +import { isTerminal, useTaskStore, type TaskKind } from "./tasks"; + +/** + * One console's drives, as last read. Shared (#944): Files kept its own copy, read once per + * connection, so its drive chips went on showing the free space of an hour ago while Volumes + * showed the live figure; Files' own Refresh listed the folder again and left the drives alone. + * Every screen that shows a drive's free space now reads this one slot, so two screens cannot + * disagree, and the slot is read again: + * + * - when a screen showing it opens or comes back (a hidden screen's effects are torn down); + * - on that screen's Refresh; + * - when a job on the console ends (an upload, a delete, a move, an extract, an install): + * anything that can change free space registers a task, on whichever screen it started. + */ +export interface VolumesSlot { + /** Every volume the console reports, unfiltered, as last read. null = never read. */ + volumes: Volume[] | null; + /** When `volumes` was read (unix ms). null = never. */ + loadedAtMs: number | null; + /** A read is in flight. The last list stays on screen meanwhile. */ + loading: boolean; + /** Why the last read failed (raw text, for the screen to word); `volumes` is then the + * reading before it. null = the last read worked. */ + error: string | null; +} + +/** A stable slot for a console with nothing read yet (selectors compare by identity). */ +export const IDLE_VOLUMES: VolumesSlot = { volumes: null, loadedAtMs: null, loading: false, error: null }; + +interface VolumesState { + byHost: Record; + patch: (key: string, patch: Partial) => void; +} + +export const useVolumesStore = create((set) => ({ + byHost: {}, + patch: (key, patch) => + set((s) => ({ byHost: { ...s.byHost, [key]: { ...(s.byHost[key] ?? IDLE_VOLUMES), ...patch } } })), +})); + +const keyOf = (host: string | null | undefined): string => (host?.trim() ? hostOf(host.trim()) : ""); + +/** Read one console's slot from a store snapshot. */ +export function volumesForHost( + s: { byHost: Record }, + host: string | null | undefined, +): VolumesSlot { + return s.byHost[keyOf(host)] ?? IDLE_VOLUMES; +} + +const inflight = new Map>(); + +/** + * Read the console's drives into its slot. One read per console at a time: a second caller + * gets the read in flight. With `maxAgeMs`, a list read that recently is kept (for a refresh + * that is only a courtesy, as on moving between folders). + * + * Resolves with the list, or null when the read failed (the slot then says why). + */ +export function refreshVolumes( + host: string | null | undefined, + opts?: { maxAgeMs?: number }, +): Promise { + const key = keyOf(host); + if (!key) return Promise.resolve(null); + const running = inflight.get(key); + if (running) return running; + const slot = volumesForHost(useVolumesStore.getState(), key); + if ( + opts?.maxAgeMs !== undefined && + slot.volumes !== null && + slot.loadedAtMs !== null && + Date.now() - slot.loadedAtMs < opts.maxAgeMs + ) { + return Promise.resolve(slot.volumes); + } + const { patch } = useVolumesStore.getState(); + patch(key, { loading: true }); + const run = fetchVolumes(consoleAddr(key)) + .then( + (read) => { + // A reading that says what the last one said keeps the last one's array: screens + // whose effects follow the list (a destination picker choosing a default) are not + // run again by a refresh that changed nothing. + const before = volumesForHost(useVolumesStore.getState(), key).volumes; + const volumes = before && JSON.stringify(before) === JSON.stringify(read) ? before : read; + patch(key, { volumes, loadedAtMs: Date.now(), loading: false, error: null }); + return volumes as Volume[] | null; + }, + (e: unknown) => { + // The last list stays: one read lost to a busy console must not empty a destination + // picker mid-queue. `error` says it is no longer a fresh reading; the Volumes screen + // shows that instead of the list. + patch(key, { loading: false, error: e instanceof Error ? e.message : String(e) }); + return null; + }, + ) + .finally(() => { + if (inflight.get(key) === run) inflight.delete(key); + }); + inflight.set(key, run); + return run; +} + +/** A read after something changed on the console. One in flight may have read the drives + * before the change, so one more runs after it. */ +export function refreshVolumesAfterChange(host: string | null | undefined): Promise { + const key = keyOf(host); + if (!key) return Promise.resolve(null); + const running = inflight.get(key); + return running ? running.then(() => refreshVolumes(key)) : refreshVolumes(key); +} + +// ── Read again when a job on the console ends ─────────────────────────────────────────── + +/** How many screens on show are reading each console's drives. A console nobody is looking at + * is not read: the next screen to show it reads it then. */ +const watchers = new Map(); + +/** Jobs that cannot change a drive's free space. Every other kind is taken to. */ +const NO_SPACE_CHANGE: ReadonlySet = new Set([ + "icon-fetch", + "library-launch", + "fakelib-scan", + "helper-send", + "payload-playlist", + "app-update", + "bug-report", +]); + +/** A queue of small jobs ends many times in a moment: one read covers them. */ +export const VOLUMES_SETTLE_MS = 400; +const settling = new Map>(); + +function refreshSoon(key: string): void { + const pending = settling.get(key); + if (pending) clearTimeout(pending); + settling.set( + key, + setTimeout(() => { + settling.delete(key); + if ((watchers.get(key) ?? 0) > 0) void refreshVolumesAfterChange(key); + }, VOLUMES_SETTLE_MS), + ); +} + +let wired = false; +function wireTasks(): void { + if (wired) return; + wired = true; + useTaskStore.subscribe((state, prev) => { + if (state.tasks === prev.tasks || watchers.size === 0) return; + // The few jobs that were running: which of them has just ended? + for (const before of prev.tasks) { + if (isTerminal(before.status) || NO_SPACE_CHANGE.has(before.kind)) continue; + const key = keyOf(before.consoleId); + if (!key || (watchers.get(key) ?? 0) === 0) continue; + const now = state.tasks.find((t) => t.id === before.id); + if (now && isTerminal(now.status)) refreshSoon(key); + } + }); +} + +/** + * A screen on show starts reading a console's drives: read them now, and again whenever a job + * on that console ends, until the returned function is called (the screen left, or was hidden). + */ +export function watchConsoleVolumes(host: string | null | undefined): () => void { + const key = keyOf(host); + if (!key) return () => {}; + wireTasks(); + watchers.set(key, (watchers.get(key) ?? 0) + 1); + void refreshVolumes(key); + let watching = true; + return () => { + if (!watching) return; + watching = false; + const left = (watchers.get(key) ?? 1) - 1; + if (left > 0) watchers.set(key, left); + else watchers.delete(key); + }; +} + +/** + * The console's drives for a screen that shows them: the shared slot, read when the screen + * opens or comes back into view, and again when a job on the console ends while it is on show. + * + * `enabled` false reads nothing (no console, or the helper is not answering). + */ +export function useConsoleVolumes(host: string | null | undefined, enabled = true): VolumesSlot { + const key = keyOf(host); + const slot = useVolumesStore((s) => s.byHost[key] ?? IDLE_VOLUMES); + useEffect(() => { + if (!key || !enabled) return; + return watchConsoleVolumes(key); + }, [key, enabled]); + return slot; +} + +/** Tests only: forget every console's drives and pending reads. */ +export function resetVolumesForTests(): void { + for (const t of settling.values()) clearTimeout(t); + settling.clear(); + inflight.clear(); + watchers.clear(); + useVolumesStore.setState({ byHost: {} }); +} diff --git a/engine/Cargo.lock b/engine/Cargo.lock index 0841a74cc..068e43b2d 100644 --- a/engine/Cargo.lock +++ b/engine/Cargo.lock @@ -2561,7 +2561,7 @@ dependencies = [ [[package]] name = "ps5-dump-forge-exfat" -version = "12.6.30" +version = "12.6.31" dependencies = [ "ps5-dump-forge-patch", "ps5upload-fpkg", @@ -2570,14 +2570,14 @@ dependencies = [ [[package]] name = "ps5-dump-forge-patch" -version = "12.6.30" +version = "12.6.31" dependencies = [ "crc32fast", ] [[package]] name = "ps5-dump-forge-pfs" -version = "12.6.30" +version = "12.6.31" dependencies = [ "flate2", "ps5-dump-forge-patch", @@ -2587,7 +2587,7 @@ dependencies = [ [[package]] name = "ps5-dump-forge-ufs2" -version = "12.6.30" +version = "12.6.31" dependencies = [ "ps5-dump-forge-patch", "ps5upload-fpkg", @@ -2597,7 +2597,7 @@ dependencies = [ [[package]] name = "ps5-dump-forge-zstd" -version = "12.6.30" +version = "12.6.31" dependencies = [ "crc32fast", "getrandom 0.4.3", @@ -2608,7 +2608,7 @@ dependencies = [ [[package]] name = "ps5upload-apidoc" -version = "12.6.30" +version = "12.6.31" dependencies = [ "proc-macro2", "quote", @@ -2618,7 +2618,7 @@ dependencies = [ [[package]] name = "ps5upload-archive" -version = "12.6.30" +version = "12.6.31" dependencies = [ "anyhow", "crc32fast", @@ -2628,7 +2628,7 @@ dependencies = [ [[package]] name = "ps5upload-ava1" -version = "12.6.30" +version = "12.6.31" dependencies = [ "anyhow", "ava1", @@ -2651,7 +2651,7 @@ dependencies = [ [[package]] name = "ps5upload-convert" -version = "12.6.30" +version = "12.6.31" dependencies = [ "libc", "ps5upload-archive", @@ -2666,7 +2666,7 @@ dependencies = [ [[package]] name = "ps5upload-convert-core" -version = "12.6.30" +version = "12.6.31" dependencies = [ "blake3", "flate2", @@ -2686,7 +2686,7 @@ dependencies = [ [[package]] name = "ps5upload-core" -version = "12.6.30" +version = "12.6.31" dependencies = [ "aes 0.9.4", "aes-gcm 0.11.1", @@ -2720,7 +2720,7 @@ dependencies = [ [[package]] name = "ps5upload-ctest" -version = "12.6.30" +version = "12.6.31" dependencies = [ "anyhow", "ava1", @@ -2736,7 +2736,7 @@ dependencies = [ [[package]] name = "ps5upload-engine" -version = "12.6.30" +version = "12.6.31" dependencies = [ "aes 0.9.4", "aes-gcm 0.11.1", @@ -2804,7 +2804,7 @@ dependencies = [ [[package]] name = "ps5upload-fpkg" -version = "12.6.30" +version = "12.6.31" dependencies = [ "aes 0.9.4", "blake3", @@ -2828,7 +2828,7 @@ dependencies = [ [[package]] name = "ps5upload-hub" -version = "12.6.30" +version = "12.6.31" dependencies = [ "axum", "base64 0.23.1", @@ -2843,7 +2843,7 @@ dependencies = [ [[package]] name = "ps5upload-lab" -version = "12.6.30" +version = "12.6.31" dependencies = [ "anyhow", "ava1", @@ -2861,7 +2861,7 @@ dependencies = [ [[package]] name = "ps5upload-pkg" -version = "12.6.30" +version = "12.6.31" dependencies = [ "aes 0.9.4", "blake3", @@ -2873,14 +2873,14 @@ dependencies = [ [[package]] name = "ps5upload-tailnet" -version = "12.6.30" +version = "12.6.31" dependencies = [ "cc", ] [[package]] name = "ps5upload-tests" -version = "12.6.30" +version = "12.6.31" dependencies = [ "anyhow", "ava1", @@ -2898,7 +2898,7 @@ dependencies = [ [[package]] name = "ps5upload-unrar" -version = "12.6.30" +version = "12.6.31" dependencies = [ "serde", "serde_json", diff --git a/engine/Cargo.toml b/engine/Cargo.toml index 0a74b081d..6ca8faf1d 100644 --- a/engine/Cargo.toml +++ b/engine/Cargo.toml @@ -32,7 +32,7 @@ resolver = "2" [workspace.package] edition = "2021" license = "GPL-3.0-or-later" -version = "12.6.30" +version = "12.6.31" [workspace.dependencies] # AVA1 (github.com/phantomptr/ava1): the Rust crate from crates.io; the payload builds the C side diff --git a/engine/crates/ps5upload-ava1/src/download.rs b/engine/crates/ps5upload-ava1/src/download.rs index a75192fa0..d0a8661d6 100644 --- a/engine/crates/ps5upload-ava1/src/download.rs +++ b/engine/crates/ps5upload-ava1/src/download.rs @@ -169,33 +169,7 @@ pub(crate) fn check_shape(m: &Manifest, single: bool) -> io::Result<()> { fn check_shape_with(m: &Manifest, single: bool, escape_names: bool) -> io::Result<()> { let bad = |why: String| io::Error::new(io::ErrorKind::InvalidData, why); for e in &m.entries { - manifest::check_path(&e.path).map_err(|e| bad(e.to_string()))?; - if escape_names { - // Component by component: a '\' is part of a name here, never a separator. - let kept = ps5upload_core::host_names::escape_path(&e.path) - .map_err(|why| bad(format!("{:?}: {why}", e.path)))?; - if kept - .split('/') - .any(|c| c.contains('\\') || host_unsafe_component(c).is_some()) - { - return Err(bad(format!("{:?} cannot be kept on this computer", e.path))); - } - continue; - } - // A backslash is a separator on Windows: `a\..\b` would climb out of the root. - if e.path.contains('\\') { - return Err(bad(format!("{:?} contains a backslash", e.path))); - } - // Peer-supplied names are written on THIS computer, whatever it is. A ':' makes - // `C:/x` a drive path and `C:evil` a drive-relative one on Windows (and an - // alternate data stream on NTFS); the reserved device names and a trailing dot - // or space name something other than the file asked for. Refused everywhere so - // the console's data lands the same way on every host. - for comp in e.path.split('/') { - if let Some(why) = host_unsafe_component(comp) { - return Err(bad(format!("{:?}: {why}", e.path))); - } - } + kept_path(&e.path, escape_names)?; } if single { let files = m @@ -213,6 +187,42 @@ fn check_shape_with(m: &Manifest, single: bool, escape_names: bool) -> io::Resul Ok(()) } +/// The root-relative path a manifest `path` is written under on this computer, after the +/// checks every peer-supplied path passes before anything is written (or removed) under it: +/// itself, or with `escape_names` its reversible form. Err for a path that could climb out of +/// the root or name something else on some host. +fn kept_path(path: &str, escape_names: bool) -> io::Result { + let bad = |why: String| io::Error::new(io::ErrorKind::InvalidData, why); + manifest::check_path(path).map_err(|e| bad(e.to_string()))?; + if escape_names { + // Component by component: a '\' is part of a name here, never a separator. + let kept = ps5upload_core::host_names::escape_path(path) + .map_err(|why| bad(format!("{path:?}: {why}")))?; + if kept + .split('/') + .any(|c| c.contains('\\') || host_unsafe_component(c).is_some()) + { + return Err(bad(format!("{path:?} cannot be kept on this computer"))); + } + return Ok(kept); + } + // A backslash is a separator on Windows: `a\..\b` would climb out of the root. + if path.contains('\\') { + return Err(bad(format!("{path:?} contains a backslash"))); + } + // Peer-supplied names are written on THIS computer, whatever it is. A ':' makes + // `C:/x` a drive path and `C:evil` a drive-relative one on Windows (and an + // alternate data stream on NTFS); the reserved device names and a trailing dot + // or space name something other than the file asked for. Refused everywhere so + // the console's data lands the same way on every host. + for comp in path.split('/') { + if let Some(why) = host_unsafe_component(comp) { + return Err(bad(format!("{path:?}: {why}"))); + } + } + Ok(path.to_owned()) +} + /// `LocalSink` plus the checks above. The landing root is `dest_dir/` for both /// kinds (the manifest's paths are root-relative), and every byte goes through a /// `.ava-part` sibling in the destination's own directory, renamed once at the end. @@ -272,34 +282,70 @@ fn case_twins(m: &Manifest) -> Option<(&str, &str)> { None } -/// Whether the folder `root` is (or will be) made in ignores case in names: its nearest -/// folder that exists, found again under its name in the other case. +/// Whether the folder `root` is (or will be) made in ignores case in names, asked of the +/// nearest folder that exists (`root` itself, or the one it will be made in): the disk that +/// folder is on is the one the files land on. Never of the folder above it: at a disk's root +/// (`/Volumes/USB`, `D:\`) that is another disk, or none, and its answer said nothing about +/// this one. fn ignores_case(root: &Path) -> bool { - let mut at = Some(root); - while let Some(p) = at { - at = p.parent(); - let Some(name) = p.file_name().and_then(|n| n.to_str()) else { - continue; - }; - if !p.exists() { + match root.ancestors().find(|p| p.is_dir()) { + Some(dir) => folder_ignores_case(dir), + None => false, + } +} + +/// `name` with its ASCII letters in the other case. +fn other_case(name: &str) -> String { + name.chars() + .map(|c| { + if c.is_ascii_lowercase() { + c.to_ascii_uppercase() + } else { + c.to_ascii_lowercase() + } + }) + .collect() +} + +/// Whether `dir` finds its own entries under their names in the other case. A name with no +/// letter says nothing, and a folder holding both spellings of one tells them apart; a folder +/// with no name to ask is asked with a probe file of its own, removed at once. +fn folder_ignores_case(dir: &Path) -> bool { + let Ok(it) = std::fs::read_dir(dir) else { + return false; + }; + let names: std::collections::HashSet = + it.filter_map(|e| e.ok().map(|e| e.file_name())).collect(); + for name in names.iter().filter_map(|n| n.to_str()) { + let other = other_case(name); + if other == name { continue; } - let other: String = name - .chars() - .map(|c| { - if c.is_ascii_lowercase() { - c.to_ascii_uppercase() - } else { - c.to_ascii_lowercase() - } - }) - .collect(); - // A name with no letter says nothing: ask the folder above. - if other != name { - return p.with_file_name(other).exists(); + if names.contains(std::ffi::OsStr::new(&other)) { + return false; + } + return std::fs::symlink_metadata(dir.join(other)).is_ok(); + } + static PROBES: AtomicU64 = AtomicU64::new(0); + let probe = dir.join(format!( + ".ps5upload-case-probe-{}-{}", + std::process::id(), + PROBES.fetch_add(1, Ordering::Relaxed) + )); + match std::fs::OpenOptions::new() + .write(true) + .create_new(true) + .open(&probe) + { + Ok(f) => { + drop(f); + let name = probe.file_name().and_then(|n| n.to_str()).unwrap_or(""); + let folded = std::fs::symlink_metadata(dir.join(other_case(name))).is_ok(); + let _ = std::fs::remove_file(&probe); + folded } + Err(_) => false, } - false } /// Err when `m` holds two names that are one name in `root`: both were written to the one @@ -317,6 +363,53 @@ fn refuse_case_twins(m: &Manifest, root: &Path) -> io::Result<()> { } } +/// The in-place part file of the file at `rel` (root-relative), as a merge writes it. +fn part_name(rel: &str) -> String { + format!("{rel}.ava-part") +} + +/// A file of `m` and another entry of `m` at that file's in-place part file (`X` and +/// `X.ava-part`), compared as `fold` (lowercased) or exactly. +fn part_name_clash(m: &Manifest, fold: bool) -> Option<(&str, &str)> { + let key = |p: &str| if fold { p.to_lowercase() } else { p.to_owned() }; + let paths: std::collections::HashMap = m + .entries + .iter() + .map(|e| (key(&e.path), e.path.as_str())) + .collect(); + m.entries + .iter() + .filter(|e| e.kind == gen::ENTRY_FILE) + .find_map(|e| { + paths + .get(&key(&part_name(&e.path))) + .map(|other| (e.path.as_str(), *other)) + }) +} + +/// Err when `m`, downloaded into the folder `root` that already exists, holds both `X` and +/// `X.ava-part`. Such a download writes each large file as `.ava-part` beside its place +/// and renames it at the end, so the one path was two files at once: `X` ended with the other +/// file's bytes, or `X.ava-part` was renamed away as `X`. A folder that does not exist yet is +/// staged whole and writes nothing under a part name, so the same tree downloads fine there. +fn refuse_part_name_clash(m: &Manifest, root: &Path) -> io::Result<()> { + let Some((a, b)) = part_name_clash(m, true) else { + return Ok(()); + }; + if part_name_clash(m, false).is_none() && !ignores_case(root) { + return Ok(()); + } + Err(io::Error::new( + io::ErrorKind::InvalidData, + format!( + "{b:?} is the name this app gives {a:?} while it is written into a folder that already exists; download to a folder that does not have {} yet", + root.file_name() + .map(|n| n.to_string_lossy().into_owned()) + .unwrap_or_else(|| root.display().to_string()) + ), + )) +} + /// `m` with every path in the form it is kept under on this computer /// (`host_names::escape_path`). The entries keep their order, so their file ids. fn kept_manifest(m: &Manifest) -> io::Result { @@ -341,6 +434,11 @@ impl Sink for CheckedSink { if !self.single { refuse_case_twins(m, &self.root)?; } + // Into a folder that already exists (not staged), large files go through in-place + // part files: the decision as the `LocalSink` holds it, a resume's included. + if !self.single && self.inner.resume_key().is_some_and(|(_, staged)| !staged) { + refuse_part_name_clash(m, &self.root)?; + } *self.landed.lock().unwrap() = Some(m.clone()); if self.single && self.root.is_dir() { return Err(io::Error::new( @@ -401,6 +499,16 @@ impl Sink for CheckedSink { fn commit(&self, id: u32) -> io::Result<()> { self.inner.commit(id) } + // Both to the `LocalSink` as well. Left to the trait's no-ops, a committed file's folder was + // not synced before the journal called it done, and a retry of a folder download that had + // already been renamed into place (the session lost before its JobDone) stayed "staged": + // its finish found the folder there and failed as "appeared during the download". + fn sync_committed(&self, ids: &[u32]) -> io::Result<()> { + self.inner.sync_committed(ids) + } + fn resume_staged(&self, journaled: bool, all_done: bool) { + self.inner.resume_staged(journaled, all_done) + } fn finish(&self) -> io::Result<()> { self.inner.finish()?; if let Some(m) = self.landed.lock().unwrap().as_ref() { @@ -1068,21 +1176,33 @@ fn remove_part_files(job_dir: &Path, target: &Path, escape_names: bool) { let Ok(m) = journal::read_manifest(job_dir) else { return; }; - let Ok(m) = (if escape_names { - kept_manifest(&m) - } else { - Ok(m) - }) else { - return; - }; - for e in m.entries.iter().filter(|e| e.kind == gen::ENTRY_FILE) { - let mut p = target.join(&e.path).into_os_string(); - p.push(".ava-part"); + for rel in part_files(&m, escape_names) { // `remove_file` takes a symlink itself, never what it points at. - let _ = std::fs::remove_file(PathBuf::from(p)); + let _ = std::fs::remove_file(target.join(rel)); } } +/// The in-place part files (root-relative, by their kept names with `escape_names`) of the +/// files of `m`, but for a part name that is itself a path of `m` in any case: that file is +/// the tree's own (a real `X.ava-part`, landed or about to be replaced), never `X`'s part file. +/// Only paths that pass the writer's own checks (`kept_path`): the journal saves the manifest +/// before `prepare` checks it, so a refused one is read back here, and on Windows `..\x`, +/// `C:x` or `C:\x` joined onto the folder would name a file outside it. +fn part_files(m: &Manifest, escape_names: bool) -> Vec { + let kept: Vec<(u8, String)> = m + .entries + .iter() + .filter_map(|e| Some((e.kind, kept_path(&e.path, escape_names).ok()?))) + .collect(); + let paths: std::collections::HashSet = + kept.iter().map(|(_, p)| p.to_lowercase()).collect(); + kept.iter() + .filter(|(kind, _)| *kind == gen::ENTRY_FILE) + .map(|(_, p)| part_name(p)) + .filter(|p| !paths.contains(&p.to_lowercase())) + .collect() +} + fn journal_is_empty(dir: &Path) -> bool { match std::fs::read_dir(dir) { Ok(mut it) => it.next().is_none(), @@ -1467,6 +1587,38 @@ mod tests { let _ = std::fs::remove_dir_all(&dir); } + /// The case question is asked of the folder the files land in, never of the one above it: + /// at a disk's root (`/Volumes/USB`, `D:\`) that is another disk, which answered for this + /// one (a case-respecting USB disk under a case-folding `/Volumes` refused good downloads, a + /// folding one under a respecting root let twins overwrite each other). Without a second + /// disk the test makes the folder above lie the same way where it can: on a disk that tells + /// case apart, `vol` and `VOL` both exist above the download, and the old question found + /// `VOL` and said the disk folds case. + #[test] + fn the_case_question_is_asked_inside_the_destination_never_above_it() { + let dir = std::env::temp_dir().join(format!("ps5u-dl-case-at-{}", std::process::id())); + let _ = std::fs::remove_dir_all(&dir); + std::fs::create_dir_all(dir.join("vol")).unwrap(); + let folds = std::fs::create_dir(dir.join("VOL")).is_err(); + // An empty folder (asked with a probe, which is gone afterwards), and the download's + // own folder not made yet. + assert_eq!(ignores_case(&dir.join("vol").join("Game")), folds); + assert_eq!(std::fs::read_dir(dir.join("vol")).unwrap().count(), 0); + // A folder of names without letters is asked with a probe too. + std::fs::write(dir.join("vol").join("123"), b"x").unwrap(); + assert_eq!(ignores_case(&dir.join("vol").join("Game")), folds); + // A folder with a name to ask, and the download's folder itself when it exists. + std::fs::create_dir(dir.join("vol").join("Game")).unwrap(); + std::fs::write(dir.join("vol").join("Game").join("a.bin"), b"x").unwrap(); + assert_eq!(ignores_case(&dir.join("vol").join("Game")), folds); + if !folds { + // Both spellings in the folder: it tells them apart. + std::fs::write(dir.join("vol").join("Game").join("A.BIN"), b"y").unwrap(); + assert!(!ignores_case(&dir.join("vol").join("Game"))); + } + let _ = std::fs::remove_dir_all(&dir); + } + #[test] fn check_shape_refuses_paths_a_host_would_misplace() { for bad in [ @@ -2247,6 +2399,182 @@ mod tests { let _ = std::fs::remove_dir_all(&d); } + /// A folder download renamed into place whose session was lost before the console heard it + /// was done runs again with the same sink: the journal says every file is done, and the + /// finish must take the folder that is there as its own. + #[test] + fn a_retry_after_the_folder_was_renamed_into_place_finishes() { + let d = std::env::temp_dir().join(format!("p5a-landed-{}", std::process::id())); + let _ = std::fs::remove_dir_all(&d); + std::fs::create_dir_all(&d).unwrap(); + let target = d.join("Game"); + let sink = CheckedSink { + inner: LocalSink::new(target.clone(), false), + root: target.clone(), + single: false, + escape_names: false, + landed: Mutex::new(None), + }; + let m = Manifest { + entries: vec![manifest::Entry { + kind: gen::ENTRY_FILE, + mode: 0o644, + size: 3, + mtime: 0, + path: "a.bin".into(), + root: None, + }], + }; + assert_eq!(sink.resume_key().map(|(_, staged)| staged), Some(true)); + sink.prepare(&m).unwrap(); + sink.write_whole(0, b"abc").unwrap(); + sink.sync(&[0]).unwrap(); + sink.commit(0).unwrap(); + sink.sync_committed(&[0]).unwrap(); + sink.finish().unwrap(); + assert_eq!(std::fs::read(target.join("a.bin")).unwrap(), b"abc"); + // The retry: the journal's Open said staged, and every file is done. + sink.resume_staged(true, true); + sink.prepare(&m).unwrap(); + sink.finish().expect("the folder is this job's own"); + assert_eq!(std::fs::read(target.join("a.bin")).unwrap(), b"abc"); + let _ = std::fs::remove_dir_all(&d); + } + + /// A console folder holding both `X` and `X.ava-part`, downloaded into a folder that already + /// exists: `X` is written as `X.ava-part` until it is complete, so the two were one file and + /// one of them ended with the other's bytes. Refused before anything is written, and the + /// failure's clean-up leaves the `X.ava-part` already there alone (it is the tree's, not a + /// part file). Into a new folder (staged whole, no part names) the same tree is fine. + #[test] + fn a_tree_holding_x_and_x_ava_part_is_refused_into_an_existing_folder_only() { + let d = std::env::temp_dir().join(format!("p5a-partname-{}", std::process::id())); + let _ = std::fs::remove_dir_all(&d); + let (job, target) = (d.join("job"), d.join("Game")); + std::fs::create_dir_all(&job).unwrap(); + std::fs::create_dir_all(&target).unwrap(); + let file = |path: &str| manifest::Entry { + kind: gen::ENTRY_FILE, + mode: 0o644, + size: 5 << 20, + mtime: 0, + path: path.into(), + root: None, + }; + let sink = |root: &Path| CheckedSink { + inner: LocalSink::new(root.to_path_buf(), false), + root: root.to_path_buf(), + single: false, + escape_names: false, + landed: Mutex::new(None), + }; + for m in [ + Manifest { + entries: vec![file("a/X"), file("a/X.ava-part")], + }, + Manifest { + entries: vec![file("a/X.ava-part"), file("a/X")], + }, + ] { + let e = sink(&target).prepare(&m).unwrap_err(); + assert_eq!(e.kind(), io::ErrorKind::InvalidData); + assert!(e.to_string().contains("X.ava-part"), "{e}"); + // A new folder is staged: nothing there is written under a part name. + sink(&d.join("New")).prepare(&m).unwrap(); + } + // Different names are no clash. + let fine = Manifest { + entries: vec![file("a/X"), file("a/Y.ava-part"), file("X.ava-part")], + }; + sink(&target).prepare(&fine).unwrap(); + + // The refusal is final: the clean-up runs on the saved manifest, and the tree's own + // `X.ava-part` (here from an earlier download) is not X's part file. + let m = Manifest { + entries: vec![file("a/X"), file("a/X.ava-part"), file("a/Y")], + }; + journal::write_manifest(&job, &m).unwrap(); + std::fs::create_dir_all(target.join("a")).unwrap(); + std::fs::write(target.join("a/X.ava-part"), b"real").unwrap(); + std::fs::write(target.join("a/Y.ava-part"), b"p").unwrap(); + let part = d.join("Game.ava-part"); + let refused = terminal(SendError::Source(invalid("clash"))); + cleanup_after_failure(&refused, &job, &part, &target, false, false); + assert_eq!(std::fs::read(target.join("a/X.ava-part")).unwrap(), b"real"); + assert!( + !target.join("a/Y.ava-part").exists(), + "Y's part file is the job's" + ); + let _ = std::fs::remove_dir_all(&d); + } + + /// The clean-up after a failed download removes part files at the paths of the journal's + /// saved manifest, which is saved before `prepare` checks it: a refused manifest comes back + /// here. Its hostile paths (on Windows `..\x` climbs, `C:x` and `C:\x` name another place, a + /// device name is no file) are skipped by the writer's own checks on every host, so the test + /// means the same on this one. + #[test] + fn the_failure_clean_up_removes_nothing_at_a_path_the_writer_refuses() { + let file = |path: &str| manifest::Entry { + kind: gen::ENTRY_FILE, + mode: 0o644, + size: 5 << 20, + mtime: 0, + path: path.into(), + root: None, + }; + let hostile = [ + "..\\x", + "a\\..\\..\\x", + "C:x", + "C:\\Windows\\x", + "\\\\server\\share\\x", + "\\x", + "/abs/x", + "../x", + "a/../../x", + "CON", + "a/NUL.txt", + "x.", + "a/b:stream", + ]; + let mut entries: Vec<_> = hostile.iter().map(|p| file(p)).collect(); + entries.push(file("ok/y")); + let m = Manifest { entries }; + assert_eq!(part_files(&m, false), vec!["ok/y.ava-part".to_string()]); + // Kept names: whatever the escape makes of them stays one name inside the folder. + for p in part_files(&m, true) { + assert!( + !p.contains('\\') && !p.contains(':') && !p.starts_with('/'), + "{p:?}" + ); + assert!(p.split('/').all(|c| c != ".." && c != "."), "{p:?}"); + } + + // And through the real clean-up: only the safe file's part goes. + let d = std::env::temp_dir().join(format!("p5a-hostile-{}", std::process::id())); + let _ = std::fs::remove_dir_all(&d); + let (job, target) = (d.join("job"), d.join("in").join("Game")); + std::fs::create_dir_all(&job).unwrap(); + std::fs::create_dir_all(target.join("ok")).unwrap(); + journal::write_manifest(&job, &m).unwrap(); + std::fs::write(target.join("ok/y.ava-part"), b"p").unwrap(); + std::fs::write(d.join("x.ava-part"), b"not the job's").unwrap(); + std::fs::write(d.join("in").join("x.ava-part"), b"not the job's").unwrap(); + cleanup_after_failure( + &anyhow!("transfer_cancelled"), + &job, + &d.join("in").join("Game.ava-part"), + &target, + false, + false, + ); + assert!(!target.join("ok/y.ava-part").exists()); + assert!(d.join("x.ava-part").exists()); + assert!(d.join("in").join("x.ava-part").exists()); + let _ = std::fs::remove_dir_all(&d); + } + #[test] fn a_final_failure_into_an_existing_folder_removes_its_in_place_part_files_only() { let d = std::env::temp_dir().join(format!("p5a-inplace-{}", std::process::id())); diff --git a/engine/crates/ps5upload-ava1/src/lib.rs b/engine/crates/ps5upload-ava1/src/lib.rs index f04c8e552..6543179df 100644 --- a/engine/crates/ps5upload-ava1/src/lib.rs +++ b/engine/crates/ps5upload-ava1/src/lib.rs @@ -8,6 +8,14 @@ //! runtime" behaviour — C15). mod archive_time; + +/// The next step through `left` bytes, at most `cap`: never zero while bytes are left. The +/// remainder is a u64 and is capped before it becomes a usize: cast first, a remainder that is a +/// multiple of 4 GiB was 0 on a 32-bit build (Android armv7), and a loop stepping by it never +/// moved (a resume that hung) or read nothing (a zip called corrupt). +pub(crate) fn step(left: u64, cap: usize) -> usize { + left.min(cap as u64) as usize +} /// ps5upload's AVA1 application schema (protocol/ps5upload-ava1/app.toml): the helper's /// management methods and their typed bodies, generated by ava1-gen as an extension. #[rustfmt::skip] @@ -71,3 +79,15 @@ fn fallback_runtime() -> &'static tokio::runtime::Runtime { .expect("building a fallback tokio runtime") }) } + +#[cfg(test)] +mod step_tests { + #[test] + fn a_step_is_never_zero_while_bytes_are_left() { + assert_eq!(super::step(1 << 32, 4096), 4096); + assert_eq!(super::step((1 << 33) + 3, 4096), 4096); + assert_eq!(super::step(u64::MAX, 7), 7); + assert_eq!(super::step(5, 4096), 5); + assert_eq!(super::step(0, 4096), 0); + } +} diff --git a/engine/crates/ps5upload-ava1/src/pool.rs b/engine/crates/ps5upload-ava1/src/pool.rs index 8c62e1524..5a7958154 100644 --- a/engine/crates/ps5upload-ava1/src/pool.rs +++ b/engine/crates/ps5upload-ava1/src/pool.rs @@ -94,6 +94,8 @@ pub struct Pool { power_probe: PowerProbe, /// How long a failure DDP explained (rest mode, or nothing answering) is repeated. probed_ttl: Duration, + /// How long `confirm_pairing` waits for the console to answer the typed code. + pairing_timeout: Duration, } /// The DDP probe a pool uses: host (no port) to the reply's code (`200` awake, `620` rest @@ -147,6 +149,12 @@ pub const PROBED_REFUSAL_TTL: Duration = Duration::from_secs(12); /// How long a `ava1_not_paired` refusal is repeated: it outlasts the client's 10 s status poll. /// A pairing attempt (the dialog opening, a confirm, a dismissal) resets it. pub const NOT_PAIRED_TTL: Duration = Duration::from_secs(30); +/// How long the console has to answer a typed pairing code (two round trips) before the +/// confirm gives up. It runs holding the console's one-at-a-time lock, which every pairing +/// call and every new session to that console waits for: a console that kept the connection +/// alive but never answered held them all for as long as it did. The console itself gives a +/// pending code 60 s. +pub const PAIRING_CONFIRM_TIMEOUT: Duration = Duration::from_secs(30); /// Whether the console answering at a new address is the one paired at an old one /// (`Pool::same_console`). @@ -405,6 +413,7 @@ impl Pool { room_probe: None, power_probe: ddp_power_probe(), probed_ttl: PROBED_REFUSAL_TTL, + pairing_timeout: PAIRING_CONFIRM_TIMEOUT, } } @@ -473,6 +482,7 @@ impl Pool { room_probe: None, power_probe: ddp_power_probe(), probed_ttl: PROBED_REFUSAL_TTL, + pairing_timeout: PAIRING_CONFIRM_TIMEOUT, } } @@ -483,6 +493,12 @@ impl Pool { self } + /// Test seam: how long `confirm_pairing` waits for the console's answer. + pub fn with_pairing_timeout(mut self, t: Duration) -> Pool { + self.pairing_timeout = t; + self + } + /// Test seam: how long a not-paired refusal is remembered. pub fn with_not_paired_ttl(mut self, ttl: Duration) -> Pool { self.not_paired_ttl = ttl; @@ -931,9 +947,12 @@ impl Pool { let Some(mut s) = taken.filter(|s| !s.is_closed()) else { return Err(Ava1Error::NotPaired); }; - if let Err(e) = s.confirm_pairing(typed).await { - // The console refused the code (or could not prove its own): the session is - // used up. A retry is a new handshake with a new code on the console. + let confirmed = tokio::time::timeout(self.pairing_timeout, s.confirm_pairing(typed)) + .await + .unwrap_or(Err(Ava1Error::Timeout)); + if let Err(e) = confirmed { + // The console refused the code, could not prove its own, or never answered: the + // session is used up. A retry is a new handshake with a new code on the console. s.close().await; return Err(e); } diff --git a/engine/crates/ps5upload-ava1/src/zip_source.rs b/engine/crates/ps5upload-ava1/src/zip_source.rs index 297d65dd6..051ef1883 100644 --- a/engine/crates/ps5upload-ava1/src/zip_source.rs +++ b/engine/crates/ps5upload-ava1/src/zip_source.rs @@ -344,7 +344,7 @@ impl ZipEntryReader { let dec = self.inflater.as_mut().expect("started above"); let mut scratch = [0u8; 16 << 10]; while self.pos < off { - let n = ((off - self.pos) as usize).min(scratch.len()); + let n = crate::step(off - self.pos, scratch.len()); let got = dec.read(&mut scratch[..n]).map_err(inflate_error)?; if got == 0 { return Err(corrupt("zip entry ends before its declared size".into())); diff --git a/engine/crates/ps5upload-ava1/src/zip_stored.rs b/engine/crates/ps5upload-ava1/src/zip_stored.rs index 432b5676f..11eaf5e63 100644 --- a/engine/crates/ps5upload-ava1/src/zip_stored.rs +++ b/engine/crates/ps5upload-ava1/src/zip_stored.rs @@ -691,7 +691,7 @@ impl Sink for StoredZipSink { let mut buf = vec![0u8; READBACK]; let mut at = 0u64; while at < s.size { - let n = ((s.size - at) as usize).min(READBACK); + let n = crate::step(s.size - at, READBACK); read_exact_at(&file, &mut buf[..n], s.data_off + at)?; crc.update(&buf[..n]); at += n as u64; @@ -712,7 +712,7 @@ impl Sink for StoredZipSink { let mut buf = vec![0u8; READBACK]; let mut at = 0u64; while at < partial_bytes { - let n = ((partial_bytes - at) as usize).min(READBACK); + let n = crate::step(partial_bytes - at, READBACK); read_exact_at(&file, &mut buf[..n], s.data_off + at)?; crc.update(&buf[..n]); at += n as u64; diff --git a/engine/crates/ps5upload-ava1/tests/adapters.rs b/engine/crates/ps5upload-ava1/tests/adapters.rs index b7c4e0e7d..6bdba8d30 100644 --- a/engine/crates/ps5upload-ava1/tests/adapters.rs +++ b/engine/crates/ps5upload-ava1/tests/adapters.rs @@ -329,6 +329,77 @@ async fn post_commit_failure_is_not_a_resend() { ); } +/// The typed code goes to a console that never answers it (here its owner's approval never +/// comes; the link stays alive). The confirm runs holding the console's one-at-a-time lock, which +/// every pairing call and new session to it waits for: it now gives up in its own time and +/// frees the lock, instead of holding everything for that console until the answer came. +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn a_pairing_confirm_the_console_never_answers_gives_up_and_frees_the_console() { + let d = temp_dir("pair-silent"); + std::fs::create_dir_all(&d).unwrap(); + let code = Arc::new(std::sync::Mutex::new(None::)); + let (release, held) = std::sync::mpsc::channel::<()>(); + let held = std::sync::Mutex::new(held); + let seen = code.clone(); + let ctx = ServerCtx::new( + Identity::generate().unwrap(), + "silent", + PeerStore::in_memory(), + node_info_rpc(), + ) + .with_notify(Box::new(move |req| { + *seen.lock().unwrap() = Some(req.code); + })) + // Waits until the test lets go (or a minute): the answer to the code never comes. + .with_approve(Box::new(move |_| { + let _ = held.lock().unwrap().recv_timeout(Duration::from_secs(60)); + false + })); + let ctx = Arc::new(ctx); + ctx.open_pairing(Duration::from_secs(120)); + // The console in a runtime of its own (as a real one is another machine): its waiting hook + // blocks one of its threads, never this test's timers. + let (tx, rx) = std::sync::mpsc::channel(); + std::thread::spawn(move || { + let rt = tokio::runtime::Builder::new_multi_thread() + .worker_threads(2) + .enable_all() + .build() + .unwrap(); + rt.block_on(async move { + let l = tokio::net::TcpListener::bind("127.0.0.1:0").await.unwrap(); + tx.send(l.local_addr().unwrap().to_string()).unwrap(); + let _ = tokio::time::timeout(Duration::from_secs(90), server::serve(l, ctx)).await; + }); + }); + let addr = rx.recv_timeout(Duration::from_secs(20)).unwrap(); + let pool = Pool::new(d.join("ava")) + .with_addr(addr.clone()) + .with_pairing_timeout(Duration::from_secs(1)); + let status = within(20, pool.pairing_status(&addr)).await.unwrap(); + assert!( + matches!(status, ps5upload_ava1::Pairing::Code { .. }), + "{status:?}" + ); + let typed = within(20, async { + loop { + if let Some(c) = *code.lock().unwrap() { + return c; + } + tokio::time::sleep(Duration::from_millis(20)).await; + } + }) + .await; + let t0 = std::time::Instant::now(); + let r = within(15, pool.confirm_pairing(&addr, typed)).await; + assert!(matches!(r, Err(ava1::Ava1Error::Timeout)), "{r:?}"); + assert!(t0.elapsed() < Duration::from_secs(15)); + // The console's lock is free: the dialog's next call answers. + within(15, pool.cancel_pairing(&addr)).await; + drop(release); + let _ = std::fs::remove_dir_all(&d); +} + #[tokio::test(flavor = "multi_thread")] async fn a_console_that_wants_a_user_code_is_not_paired() { let d = temp_dir("pair"); diff --git a/engine/crates/ps5upload-core/src/health.rs b/engine/crates/ps5upload-core/src/health.rs index a0e3e0cde..e63571d65 100644 --- a/engine/crates/ps5upload-core/src/health.rs +++ b/engine/crates/ps5upload-core/src/health.rs @@ -509,13 +509,16 @@ pub fn run_health_scan(addr: &str, engine_version: &str) -> HealthReport { // ── storage ───────────────────────────────────────────────────── match crate::hw::hw_storage(addr) { Ok(st) => { - let status = classify_free_space(st.free_bytes, st.total_bytes); - let pct = free_pct(st.free_bytes, st.total_bytes); + // The partition content is on, not the three-partition totals: those count the + // system partitions' own free space, so a full console read as having room (#944). + let (free_bytes, total_bytes) = st.content_space(); + let status = classify_free_space(free_bytes, total_bytes); + let pct = free_pct(free_bytes, total_bytes); let detail = match pct { Some(pct) => format!( "{} free of {} ({pct:.1}%).", - human_bytes(st.free_bytes), - human_bytes(st.total_bytes) + human_bytes(free_bytes), + human_bytes(total_bytes) ), None => "The console did not report a storage size.".to_string(), }; @@ -523,8 +526,8 @@ pub fn run_health_scan(addr: &str, engine_version: &str) -> HealthReport { Some(pct) => ( "storage", vec![ - ("free", human_bytes(st.free_bytes)), - ("total", human_bytes(st.total_bytes)), + ("free", human_bytes(free_bytes)), + ("total", human_bytes(total_bytes)), ("pct", format!("{pct:.1}")), ], ), diff --git a/engine/crates/ps5upload-core/src/hw.rs b/engine/crates/ps5upload-core/src/hw.rs index 060ab1558..8133d2f3b 100644 --- a/engine/crates/ps5upload-core/src/hw.rs +++ b/engine/crates/ps5upload-core/src/hw.rs @@ -532,32 +532,74 @@ pub fn hw_power(addr: &str) -> Result { }) } -/// "Console Storage" aggregate that matches what PS5 Settings shows. -/// Sums the three partitions Sony's UI counts (`/user effective + -/// /system_data + /system_ex`) and accounts for the reserved-pool slice -/// the FS keeps for root. Per-partition fields are also surfaced for -/// the diagnostics card. Distinct from `fs_list_volumes`: that returns -/// per-volume detail; this is the single-line summary. +/// The console's internal storage as its filesystem counts it: `statfs` on `/user`, +/// `/system_data` and `/system_ex`, nothing else. +/// +/// **These are not the figures of the PS5's own Settings > Storage screen** (#944). On one +/// 2 TB console this reported 175.5 GB in `user_free_bytes` and a 1.995 TB `/user`, while its +/// Storage screen showed 71.35 GB free of 1.89 TB. How the console arrives at its figures is +/// not known to this API, and nothing here models it. Read these as what the filesystem says, +/// and expect the console's screen to show less. +/// +/// What a copy can count on is `/api/ps5/volumes` (`allocatable_bytes`, `likely_fits_bytes`), +/// which starts from the same `user_free_bytes`. +/// +/// Distinct from `fs_list_volumes`: that returns per-volume detail; this is the summary of the +/// internal drive with its partitions. #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct HwStorage { + /// Size of the three partitions together (`user` + `system_data` + `system_ex`). pub total_bytes: u64, + /// Free on the three partitions together. Includes the system partitions' own free space, + /// which nothing can be copied into: for room on the drive read `user_free_bytes`. pub free_bytes: u64, + /// `total_bytes - free_bytes`. Includes what the filesystem holds back (`reserved_bytes`), + /// not only stored data. pub used_bytes: u64, + /// The same number as `user_reserved_bytes` (the system partitions' are not counted). pub reserved_bytes: u64, + /// Size of `/user`, the partition games and files are on (`/data` is a folder of it). pub user_total_bytes: u64, + /// Free on `/user` for a writer (`f_bavail`); 0 once the drive is written into what it + /// holds back. `user_reserved_bytes` is already left out of it: never subtract it again. pub user_free_bytes: u64, + /// What the filesystem holds back on `/user` (`f_bfree - f_bavail`): free blocks that are + /// not offered to a writer. Not a fixed pool: measured on two consoles it grows by about a + /// fifth of what is written and comes back when data is deleted. pub user_reserved_bytes: u64, + /// Size of `/system_data`. pub system_data_total_bytes: u64, + /// Free on `/system_data` (`f_bavail`). pub system_data_free_bytes: u64, + /// Size of `/system_ex`; 0 when the firmware has no such mount. pub system_ex_total_bytes: u64, + /// Free on `/system_ex` (`f_bavail`). pub system_ex_free_bytes: u64, } +impl HwStorage { + /// The size and free space of the partition content is stored on, for telling a person + /// how full the console is: `/user` alone. The three-partition totals count the system + /// partitions' free space as free, so a full console still showed gigabytes to spare. An + /// answer without the `/user` figures (none known) falls back to the totals. + pub fn content_space(&self) -> (u64, u64) { + if self.user_total_bytes > 0 { + (self.user_free_bytes, self.user_total_bytes) + } else { + (self.free_bytes, self.total_bytes) + } + } +} + pub fn hw_storage(addr: &str) -> Result { - let body = round_trip(addr, m::HW_STORAGE)?; - let get = parse_kv(&body); + Ok(parse_hw_storage(&round_trip(addr, m::HW_STORAGE)?)) +} + +/// The helper's `key=value` answer as it stands: nothing is added to or taken from a counter. +fn parse_hw_storage(body: &[u8]) -> HwStorage { + let get = parse_kv(body); let n = |k: &str| get(k).and_then(|v| v.parse().ok()).unwrap_or(0u64); - Ok(HwStorage { + HwStorage { total_bytes: n("total_bytes"), free_bytes: n("free_bytes"), used_bytes: n("used_bytes"), @@ -569,7 +611,7 @@ pub fn hw_storage(addr: &str) -> Result { system_data_free_bytes: n("system_data_free_bytes"), system_ex_total_bytes: n("system_ex_total_bytes"), system_ex_free_bytes: n("system_ex_free_bytes"), - }) + } } /// Safe bounds for fan-turbo threshold. Mirrored in the payload @@ -822,6 +864,57 @@ mod tests { assert_eq!(get("physmem"), Some("13421772800")); } + /// The answer of the 2 TB console in #944, as the helper sends it. + const STORAGE_944: &[u8] = b"total_bytes=2005599387648\nfree_bytes=182746480640\n\ + used_bytes=1822852907008\nreserved_bytes=307929022464\n\ + user_total_bytes=1995416338432\nuser_free_bytes=175467462656\n\ + user_reserved_bytes=307929022464\nsystem_data_total_bytes=8572829696\n\ + system_data_free_bytes=7136804864\nsystem_ex_total_bytes=1610219520\n\ + system_ex_free_bytes=142213120\n"; + + #[test] + fn storage_counters_pass_through_and_add_up() { + let st = parse_hw_storage(STORAGE_944); + assert_eq!(st.user_free_bytes, 175_467_462_656); + assert_eq!(st.user_reserved_bytes, 307_929_022_464); + // Nothing is counted twice: the totals are the three partitions, and "used" is + // everything that is not free (what is held back included). + assert_eq!( + st.total_bytes, + st.user_total_bytes + st.system_data_total_bytes + st.system_ex_total_bytes + ); + assert_eq!( + st.free_bytes, + st.user_free_bytes + st.system_data_free_bytes + st.system_ex_free_bytes + ); + assert_eq!(st.used_bytes, st.total_bytes - st.free_bytes); + assert_eq!(st.reserved_bytes, st.user_reserved_bytes); + } + + #[test] + fn content_space_is_the_user_partition_not_the_three_together() { + let st = parse_hw_storage(STORAGE_944); + // The totals call 7.3 GB of system partition "free": no file can go there. + assert_eq!(st.free_bytes - st.user_free_bytes, 7_279_017_984); + assert_eq!( + st.content_space(), + (st.user_free_bytes, st.user_total_bytes) + ); + + // A full drive: the system partitions' room must not read as room on the console. + let full = HwStorage { + user_free_bytes: 0, + free_bytes: st.free_bytes - st.user_free_bytes, + ..st.clone() + }; + assert_eq!(full.content_space().0, 0); + + // An answer with no /user figures still says something. + let totals_only = parse_hw_storage(b"total_bytes=1000\nfree_bytes=400\n"); + assert_eq!(totals_only.content_space(), (400, 1000)); + assert_eq!(parse_hw_storage(b"").content_space(), (0, 0)); + } + #[test] fn parse_temps_with_zero_fallbacks() { let body = diff --git a/engine/crates/ps5upload-core/src/save_archive.rs b/engine/crates/ps5upload-core/src/save_archive.rs index bb7dde88f..a0dc6c244 100644 --- a/engine/crates/ps5upload-core/src/save_archive.rs +++ b/engine/crates/ps5upload-core/src/save_archive.rs @@ -565,25 +565,129 @@ fn is_finder_noise(name: &str) -> bool { name.starts_with("__MACOSX/") || name == ".DS_Store" || name.ends_with("/.DS_Store") } +/// How much a save's zip may unpack to. A zip says what its files hold, but a small one can say +/// (or hold) far more than any save: unpacked without a limit it fills the disk. +#[derive(Debug, Clone, Copy)] +pub struct UnzipLimits { + /// All its files together, in bytes. + pub total: u64, + /// One file, in bytes. + pub entry: u64, + /// Entries (files, folders and Finder noise alike). + pub entries: usize, +} + +/// The limits [`unzip_strict`] applies: far above any save a PS5 keeps (a save of several GiB +/// fits; the engine takes a shared-save file of up to 32 GiB, save_copy.rs), so only a zip that +/// unpacks without end is refused. A save is a handful of files; 100 000 is far past any. +pub const UNZIP_LIMITS: UnzipLimits = UnzipLimits { + total: 32 * 1024 * 1024 * 1024, + entry: 16 * 1024 * 1024 * 1024, + entries: 100_000, +}; + +/// The most a save's zip may spend per entry in its list of files (the central directory): a +/// 46-byte header and a name far longer than any save's. At 100 000 entries that is about 64 MiB. +const DIR_BYTES_PER_ENTRY: u64 = 672; + +/// Refuses a zip whose end record says it lists more entries, or a longer list, than a save has, +/// before the zip crate reads that whole list into memory. Every end record in the zip's tail is +/// asked (the crate may fall back from one to another), the zip64 one too. +fn check_zip_directory(f: &mut File, limits: UnzipLimits) -> Result<()> { + use std::io::{Seek, SeekFrom}; + fn read_at(f: &mut File, at: u64, buf: &mut [u8]) -> bool { + f.seek(SeekFrom::Start(at)).is_ok() && f.read_exact(buf).is_ok() + } + let le16 = |b: &[u8]| u64::from(u16::from_le_bytes([b[0], b[1]])); + let le32 = |b: &[u8]| u64::from(u32::from_le_bytes([b[0], b[1], b[2], b[3]])); + let le64 = |b: &[u8]| u64::from_le_bytes(b[..8].try_into().unwrap_or([0; 8])); + + let len = f.metadata().context("read zip size")?.len(); + let tail_len = len.min(22 + 65_535); + let tail_start = len - tail_len; + let mut tail = vec![0u8; tail_len as usize]; + if !read_at(f, tail_start, &mut tail) { + return Err(anyhow!("read zip end")); + } + let max_dir = (limits.entries as u64).saturating_mul(DIR_BYTES_PER_ENTRY); + for at in (0..tail.len().saturating_sub(21)).rev() { + if tail[at..at + 4] != [0x50, 0x4b, 0x05, 0x06] { + continue; + } + let r = &tail[at..at + 22]; + let (mut entries, mut dir) = (le16(&r[10..]), le32(&r[12..])); + let eocd = tail_start + at as u64; + if (entries == 0xFFFF || dir == 0xFFFF_FFFF) && eocd >= 20 { + let mut loc = [0u8; 20]; + let mut rec = [0u8; 56]; + if read_at(f, eocd - 20, &mut loc) + && loc[..4] == [0x50, 0x4b, 0x06, 0x07] + && read_at(f, le64(&loc[8..]), &mut rec) + && rec[..4] == [0x50, 0x4b, 0x06, 0x06] + { + entries = le64(&rec[32..]); + dir = le64(&rec[40..]); + } + } + if entries > limits.entries as u64 { + return Err(anyhow!( + "zip has {entries} entries, more than a save has ({} at most)", + limits.entries + )); + } + if dir > max_dir { + return Err(anyhow!("zip's list of files is longer than a save's")); + } + } + Ok(()) +} + pub fn unzip_strict( zip_path: &Path, dest_dir: &Path, expected_inner: &str, ) -> Result { - let f = File::open(zip_path).with_context(|| format!("open {}", zip_path.display()))?; + unzip_strict_within(zip_path, dest_dir, expected_inner, UNZIP_LIMITS) +} + +/// [`unzip_strict`] with its own limits. What a zip says of its sizes is checked before anything +/// is written, and the bytes really unpacked are counted too (a zip can say less than it holds). +pub fn unzip_strict_within( + zip_path: &Path, + dest_dir: &Path, + expected_inner: &str, + limits: UnzipLimits, +) -> Result { + let mut f = File::open(zip_path).with_context(|| format!("open {}", zip_path.display()))?; + check_zip_directory(&mut f, limits)?; let mut archive = ZipArchive::new(BufReader::new(f)).context("read zip header")?; + if archive.len() > limits.entries { + return Err(anyhow!( + "zip has {} entries, more than a save has ({} at most)", + archive.len(), + limits.entries + )); + } + let too_big = || anyhow!("zip unpacks to more than a save holds"); // Pass 1: validate layout before writing any bytes. Catching a bad // zip here means a malformed restore never half-overwrites the live // save (we also fsDelete first on the PS5 side, so a half-extract // followed by upload would be especially bad). let mut root_dirs: BTreeSet = BTreeSet::new(); + let mut said_total = 0u64; for i in 0..archive.len() { let entry = archive.by_index(i).context("read zip entry")?; let name = entry.name().context("read zip entry name")?.into_owned(); if is_finder_noise(&name) { continue; } + if !entry.is_dir() { + said_total = said_total.saturating_add(entry.size()); + if entry.size() > limits.entry || said_total > limits.total { + return Err(too_big()); + } + } let first = name.split('/').next().unwrap_or(""); if first.is_empty() { continue; @@ -615,6 +719,7 @@ pub fn unzip_strict( // Pass 2: extract. Sanitize each entry against zip-slip. let mut count = 0u32; + let mut written = 0u64; for i in 0..archive.len() { let mut entry = archive.by_index(i).context("read zip entry")?; let name = entry.name().context("read zip entry name")?.into_owned(); @@ -646,8 +751,14 @@ pub fn unzip_strict( } let mut out = File::create(&out_path).with_context(|| format!("create {}", out_path.display()))?; - std::io::copy(&mut entry, &mut out) + // What it really unpacks to, whatever it said: one byte past the room left is refused. + let room = limits.entry.min(limits.total - written); + let n = std::io::copy(&mut (&mut entry).take(room.saturating_add(1)), &mut out) .with_context(|| format!("write {}", out_path.display()))?; + if n > room { + return Err(too_big()); + } + written += n; count += 1; } if count == 0 { @@ -1526,6 +1637,143 @@ mod tests { let _ = std::fs::remove_dir_all(&tmp); } + /// A zip of `CUSA00001/` holding `files` (name, bytes), deflated. + fn deflated_zip(dir: &Path, files: &[(&str, Vec)]) -> PathBuf { + let z = dir.join("save.zip"); + let mut w = ZipWriter::new(BufWriter::new(File::create(&z).unwrap())); + let opts = SimpleFileOptions::default().compression_method(CompressionMethod::Deflated); + w.add_directory("CUSA00001/", opts).unwrap(); + for (name, bytes) in files { + w.start_file(format!("CUSA00001/{name}"), opts).unwrap(); + w.write_all(bytes).unwrap(); + } + w.finish().unwrap(); + z + } + + const SMALL: UnzipLimits = UnzipLimits { + total: 64 * 1024, + entry: 48 * 1024, + entries: 8, + }; + + /// A small zip that unpacks to far more than a save is refused before anything is written. + #[test] + fn a_zip_that_says_it_unpacks_too_big_is_refused_before_anything_is_written() { + let src = fresh_tmp("bomb-said"); + let out = fresh_tmp("bomb-said-out"); + // 1 MiB of zeros is a zip of about a kilobyte. + let z = deflated_zip(&src, &[("save.dat", vec![0u8; 1 << 20])]); + assert!(std::fs::metadata(&z).unwrap().len() < 16 * 1024); + let e = unzip_strict_within(&z, &out, "CUSA00001", SMALL).unwrap_err(); + assert!(e.to_string().contains("more than a save"), "{e}"); + assert!(!out.join("CUSA00001").exists(), "nothing written"); + // Together too: two files each under the one-file limit, over the total. + let z = deflated_zip( + &src, + &[ + ("a.dat", vec![0u8; 40 * 1024]), + ("b.dat", vec![0u8; 40 * 1024]), + ], + ); + assert!(unzip_strict_within(&z, &out, "CUSA00001", SMALL).is_err()); + assert!(!out.join("CUSA00001").exists(), "nothing written"); + // Within the limits it unpacks. + let z = deflated_zip(&src, &[("a.dat", vec![7u8; 40 * 1024])]); + assert_eq!( + unzip_strict_within(&z, &out, "CUSA00001", SMALL) + .unwrap() + .file_count, + 1 + ); + let _ = std::fs::remove_dir_all(&src); + let _ = std::fs::remove_dir_all(&out); + } + + /// A zip that says its file is small but holds more is stopped at the limit, not unpacked to + /// its end. + #[test] + fn a_zip_that_holds_more_than_it_says_is_stopped_at_the_limit() { + let src = fresh_tmp("bomb-lie"); + let out = fresh_tmp("bomb-lie-out"); + let z = deflated_zip(&src, &[("save.dat", vec![0u8; 1 << 20])]); + // Every header's "uncompressed size" of 1 MiB now says 10 bytes. + let mut b = std::fs::read(&z).unwrap(); + let mut patched = 0; + for (sig, at) in [ + ([0x50, 0x4b, 0x03, 0x04], 22), + ([0x50, 0x4b, 0x01, 0x02], 24), + ] { + let mut i = 0; + while i + at + 4 <= b.len() { + if b[i..i + 4] == sig && b[i + at..i + at + 4] == (1u32 << 20).to_le_bytes() { + b[i + at..i + at + 4].copy_from_slice(&10u32.to_le_bytes()); + patched += 1; + } + i += 1; + } + } + assert_eq!(patched, 2); + std::fs::write(&z, &b).unwrap(); + assert!(unzip_strict_within(&z, &out, "CUSA00001", SMALL).is_err()); + let got = std::fs::metadata(out.join("CUSA00001/save.dat")).map_or(0, |m| m.len()); + assert!(got <= SMALL.entry + 1, "{got} bytes written"); + let _ = std::fs::remove_dir_all(&src); + let _ = std::fs::remove_dir_all(&out); + } + + #[test] + fn a_zip_of_more_entries_than_a_save_has_is_refused() { + let src = fresh_tmp("bomb-many"); + let out = fresh_tmp("bomb-many-out"); + let files: Vec<(String, Vec)> = (0..SMALL.entries) + .map(|i| (format!("f{i}"), vec![1u8])) + .collect(); + let refs: Vec<(&str, Vec)> = + files.iter().map(|(n, b)| (n.as_str(), b.clone())).collect(); + let z = deflated_zip(&src, &refs); + let e = unzip_strict_within(&z, &out, "CUSA00001", SMALL).unwrap_err(); + assert!(e.to_string().contains("entries"), "{e}"); + assert!(!out.join("CUSA00001").exists()); + let _ = std::fs::remove_dir_all(&src); + let _ = std::fs::remove_dir_all(&out); + } + + /// The list of files a zip's end record says it has is judged before the zip crate reads it: + /// a forged count, and a list far longer than a save's, are refused by that check. + #[test] + fn a_zip_whose_list_of_files_is_beyond_a_save_is_refused_before_it_is_read() { + let src = fresh_tmp("bomb-dir"); + let out = fresh_tmp("bomb-dir-out"); + let z = deflated_zip(&src, &[("a", vec![1u8])]); + let mut b = std::fs::read(&z).unwrap(); + let at = b + .windows(4) + .rposition(|w| w == [0x50, 0x4b, 0x05, 0x06]) + .unwrap(); + b[at + 8..at + 12].copy_from_slice(&[0x00, 0x10, 0x00, 0x10]); + std::fs::write(&z, &b).unwrap(); + let e = unzip_strict_within(&z, &out, "CUSA00001", SMALL).unwrap_err(); + assert!(e.to_string().contains("4096 entries"), "{e}"); + + let long = "n".repeat(3000); + let z = deflated_zip( + &src, + &[ + (&format!("{long}1"), vec![1]), + (&format!("{long}2"), vec![1]), + ], + ); + let e = unzip_strict_within(&z, &out, "CUSA00001", SMALL).unwrap_err(); + assert!(e.to_string().contains("list of files"), "{e}"); + assert!(!out.join("CUSA00001").exists()); + + let z = deflated_zip(&src, &[("ok", vec![1u8])]); + unzip_strict_within(&z, &out, "CUSA00001", SMALL).unwrap(); + let _ = std::fs::remove_dir_all(&src); + let _ = std::fs::remove_dir_all(&out); + } + /// Regression: zips produced by `zip_folder` must mark directory /// entries with the unix execute bit (0o755), not 0o644. Without /// it, external `unzip(1)` reproduces `drw-r--r--` dirs that the diff --git a/engine/crates/ps5upload-core/src/tar_archive.rs b/engine/crates/ps5upload-core/src/tar_archive.rs index 174357ba9..ca842f56a 100644 --- a/engine/crates/ps5upload-core/src/tar_archive.rs +++ b/engine/crates/ps5upload-core/src/tar_archive.rs @@ -701,6 +701,51 @@ pub struct Opened { base: u64, read: Arc, failure: Arc>>, + /// What the tar reader may still read before it hands over the next entry + /// ([`HeaderBudget`]); `u64::MAX` while no entry is being looked for. + budget: Arc, +} + +/// What one step of the tar reader (`Entries::next`) may read besides the data the entry before +/// it left unread: the 512-byte headers of one member, its GNU long name or link and its PAX +/// header. The tar reader holds a long name and a PAX header whole in memory, as long as the +/// header says they are, so a compressed archive of a few KiB could ask for gigabytes of them +/// while it was listed. A real one is a few hundred bytes (a PAX header with extended +/// attributes some KiB). +pub const MAX_MEMBER_HEADERS: u64 = 16 << 20; + +/// Bounds what the tar reader reads while it looks for the next entry ([`MAX_MEMBER_HEADERS`]). +#[derive(Clone)] +struct HeaderBudget(Arc); + +impl HeaderBudget { + /// From now until [`Self::off`]: `unread` (what the entry before left of its data, which + /// the reader reads past) and one member's headers. + fn on(&self, unread: u64) { + self.0 + .store(unread.saturating_add(MAX_MEMBER_HEADERS), Ordering::Relaxed); + } + + fn off(&self) { + self.0.store(u64::MAX, Ordering::Relaxed); + } +} + +/// What an entry of `kind` leaves of its data for the tar reader to read past: the listing and +/// the walk read every file's data themselves (or seek past it), nothing else's. +fn unread_after(kind: &Kind, size: u64) -> u64 { + match kind { + Kind::File => 0, + _ => size, + } +} + +fn headers_too_big() -> io::Error { + corrupt(format!( + "one entry's headers (its long name or PAX header) are over {} MiB, which no real \ + archive has", + MAX_MEMBER_HEADERS >> 20 + )) } enum Inner { @@ -709,6 +754,10 @@ enum Inner { } impl Opened { + fn header_budget(&self) -> HeaderBudget { + HeaderBudget(self.budget.clone()) + } + /// Compressed bytes read from the file so far. pub fn file_bytes_read(&self) -> u64 { self.read.load(Ordering::Relaxed) @@ -731,10 +780,24 @@ impl Opened { impl Read for Opened { fn read(&mut self, buf: &mut [u8]) -> io::Result { - match &mut self.inner { - Inner::Plain(r) => r.read(buf), - Inner::Decoded(r) => r.read(buf), + let left = self.budget.load(Ordering::Relaxed); + // Never more than the budget and one byte: the byte past it is the refusal. + let want = buf.len().min( + usize::try_from(left) + .unwrap_or(usize::MAX) + .saturating_add(1), + ); + let n = match &mut self.inner { + Inner::Plain(r) => r.read(&mut buf[..want])?, + Inner::Decoded(r) => r.read(&mut buf[..want])?, + }; + if left != u64::MAX { + if n as u64 > left { + return Err(headers_too_big()); + } + self.budget.store(left - n as u64, Ordering::Relaxed); } + Ok(n) } } @@ -816,6 +879,7 @@ pub fn open_decoded(path: &Path, offset: u64) -> io::Result { base: offset, read, failure, + budget: Arc::new(AtomicU64::new(u64::MAX)), }) } Codec::Zstd => Box::new(ZstdReader::new(src)), @@ -833,6 +897,7 @@ pub fn open_decoded(path: &Path, offset: u64) -> io::Result { base: 0, read, failure, + budget: Arc::new(AtomicU64::new(u64::MAX)), }) } @@ -1007,6 +1072,7 @@ fn list(path: &Path, watch: TarWatch<'_>) -> io::Result { l.phase.store(LIVE_PHASE_LISTING, Ordering::Relaxed); } let read = opened.read.clone(); + let budget = opened.header_budget(); let cancelled = || watch.cancel.is_some_and(|c| c.load(Ordering::Relaxed)); let report = |n: u64| { if let Some(l) = watch.live { @@ -1027,16 +1093,21 @@ fn list(path: &Path, watch: TarWatch<'_>) -> io::Result { let mut entries = entries(&mut ar, codec == Codec::None).map_err(classify)?; let mut next_header = 0u64; let mut buf = vec![0u8; 256 << 10]; + let mut unread = 0u64; loop { if cancelled() { return Err(io::Error::other(TAR_LISTING_CANCELLED)); } - let Some(entry) = entries.next() else { break }; + budget.on(unread); + let next = entries.next(); + budget.off(); + let Some(entry) = next else { break }; let mut entry = entry.map_err(classify)?; // An entry's headers start where the one before it ends: its data, padded to 512. let header_offset = next_header; next_header = align512(entry.raw_file_position().saturating_add(entry.size())); - let what = Kind::of(&entry)?; + let what = Kind::of(&mut entry)?; + unread = unread_after(&what, entry.size()); let raw = entry.path_bytes().into_owned(); let name = String::from_utf8(raw) .unwrap_or_else(|e| String::from_utf8_lossy(e.as_bytes()).into_owned()); @@ -1323,11 +1394,29 @@ enum Kind { Skip, } +/// The entry's PAX keys say it is a sparse file (`GNU.sparse.*`, every version of the format). +fn pax_sparse(e: &mut tar::Entry<'_, R>) -> io::Result { + Ok(e.pax_extensions()?.is_some_and(|mut keys| { + keys.any(|k| k.is_ok_and(|k| k.key_bytes().starts_with(b"GNU.sparse."))) + })) +} + impl Kind { - fn of(e: &tar::Entry<'_, R>) -> io::Result { + fn of(e: &mut tar::Entry<'_, R>) -> io::Result { use tar::EntryType as T; let t = e.header().entry_type(); Ok(match t { + // A sparse file in the PAX form (bsdtar, which macOS's tar is, and `tar -S + // --format=posix`) is an ordinary file entry whose data starts with the map of its + // holes, named `GNUSparseFile./`: only its PAX keys say so. Taken as it was, + // it went to the console as the map and the parts, under that name. + T::Regular | T::Continuous if pax_sparse(e)? => { + return Err(fault(TarFault::Unsupported(format!( + "{} is a sparse file, which this app does not unpack; create the archive \ + again without --sparse (-S)", + String::from_utf8_lossy(&e.path_bytes()) + )))) + } T::Regular | T::Continuous => Kind::File, T::Directory => Kind::Dir, T::Symlink | T::Link => Kind::Link, @@ -1437,17 +1526,24 @@ pub fn tar_walk( return r.map_err(|e| Tagged::finish(e, &opened)); } let seq = layout.sequential(); + let budget = opened.header_budget(); let r = (|| -> io::Result<()> { let mut ar = tar::Archive::new(&mut opened); let mut entries = entries(&mut ar, !seq).map_err(Tagged::decode)?; let mut i = start; + let mut unread = 0u64; loop { if cancel.load(Ordering::Relaxed) { return Err(stopped()); } - let Some(entry) = entries.next() else { break }; + budget.on(unread); + let next = entries.next(); + budget.off(); + let Some(entry) = next else { break }; let mut entry = entry.map_err(Tagged::decode)?; - if !matches!(Kind::of(&entry)?, Kind::File) { + let kind = Kind::of(&mut entry)?; + unread = unread_after(&kind, entry.size()); + if !matches!(kind, Kind::File) { continue; } let Some(f) = layout.files.get(i) else { diff --git a/engine/crates/ps5upload-core/src/tar_archive/tests.rs b/engine/crates/ps5upload-core/src/tar_archive/tests.rs index f2f584896..44136c7d7 100644 --- a/engine/crates/ps5upload-core/src/tar_archive/tests.rs +++ b/engine/crates/ps5upload-core/src/tar_archive/tests.rs @@ -338,6 +338,36 @@ fn a_sparse_file_and_case_clashes_are_refused_with_what_to_do() { "{e}" ); + // The PAX form (bsdtar, `tar -S --format=posix`): a PAX header, then a plain file entry. + let mut b = tar::Builder::new(Vec::new()); + let mut pax = Vec::new(); + for (k, v) in [ + ("GNU.sparse.major", "1"), + ("GNU.sparse.minor", "0"), + ("GNU.sparse.name", "hole.bin"), + ("GNU.sparse.realsize", "67112960"), + ] { + let rest = format!(" {k}={v}\n"); + let mut n = rest.len() + 1; + while format!("{n}{rest}").len() != n { + n += 1; + } + pax.extend_from_slice(format!("{n}{rest}").as_bytes()); + } + let mut h = header(tar::EntryType::XHeader, pax.len() as u64); + b.append_data(&mut h, "./PaxHeaders/hole.bin", &pax[..]) + .unwrap(); + let mut h = header(tar::EntryType::Regular, 3); + b.append_data(&mut h, "GNUSparseFile.0/hole.bin", &b"map"[..]) + .unwrap(); + let p = d.join("pax-sparse.tar"); + std::fs::write(&p, b.into_inner().unwrap()).unwrap(); + let e = tar_layout(&p).unwrap_err(); + assert!( + matches!(tar_fault_of(&e), Some(TarFault::Unsupported(m)) if m.contains("--sparse")), + "{e}" + ); + let mut b = tar::Builder::new(Vec::new()); for n in ["G/a.bin", "g/A.bin"] { let mut h = header(tar::EntryType::Regular, 1); @@ -595,6 +625,77 @@ fn a_listing_stops_when_cancelled_and_reports_progress() { assert_eq!(live.phase.load(Ordering::Relaxed), 0); } +/// A tar whose first member carries `meta` bytes of `kind` (a GNU long name, a PAX header, or +/// a FIFO's data), then one small file. Compressed with zstd as it is written, so the test +/// never holds the big part twice. +fn tar_with_big_member(kind: tar::EntryType, meta: usize, path: &Path, codec: Codec) { + // Empty segments are dropped from a name, so this long one is still `game/f.bin`. + let name = format!("game/{}f.bin", "/".repeat(meta)); + let body: Vec = match kind { + tar::EntryType::GNULongName => name.into_bytes(), + tar::EntryType::XHeader => { + // One record, ` path=\n`, its length counting its own digits. + let tail = format!(" path={name}\n"); + let mut len = tail.len(); + while format!("{len}{tail}").len() != len { + len = format!("{len}{tail}").len(); + } + format!("{len}{tail}").into_bytes() + } + _ => vec![b'a'; meta], + }; + let mut raw = Vec::new(); + let mut h = header(kind, body.len() as u64); + let own: &[u8] = match kind { + tar::EntryType::GNULongName => b"././@LongLink", + tar::EntryType::XHeader => b"PaxHeaders/x", + _ => b"fifo", + }; + h.as_old_mut().name[..own.len()].copy_from_slice(own); + h.set_cksum(); + raw.extend_from_slice(h.as_bytes()); + raw.extend_from_slice(&body); + raw.resize(raw.len().div_ceil(512) * 512, 0); + let mut f = header(tar::EntryType::Regular, 2); + f.set_path("game/f.bin").unwrap(); + f.set_cksum(); + raw.extend_from_slice(f.as_bytes()); + raw.extend_from_slice(b"ok"); + raw.resize(raw.len().div_ceil(512) * 512 + 1024, 0); + std::fs::write(path, compress(codec, &raw)).unwrap(); +} + +/// A long name or PAX header is held whole in memory by the tar reader, as long as its header +/// says: a compressed archive of a few KiB could ask for gigabytes of it while it was listed. +/// Over [`MAX_MEMBER_HEADERS`] it is refused as damage; data the reader reads past (a FIFO's, +/// however big) is not headers and still lists, and the walk reads it the same way. +#[test] +fn a_huge_long_name_or_pax_header_is_refused_while_listing() { + let d = temp_dir("bighead"); + let over = (MAX_MEMBER_HEADERS + (1 << 20)) as usize; + for codec in [Codec::Zstd, Codec::None] { + for kind in [tar::EntryType::GNULongName, tar::EntryType::XHeader] { + let p = d.join(format!("h{}-{codec:?}.tar", kind.as_byte())); + tar_with_big_member(kind, over, &p, codec); + let e = tar_layout(&p).unwrap_err(); + assert!( + matches!(tar_fault_of(&e), Some(TarFault::Corrupt(m)) if m.contains("headers")), + "{kind:?} {codec:?}: {e}" + ); + // A real-sized one is fine. + tar_with_big_member(kind, 4096, &p, codec); + assert_eq!(tar_layout(&p).unwrap().files.len(), 1, "{kind:?} {codec:?}"); + } + let p = d.join(format!("fifo-{codec:?}.tar")); + tar_with_big_member(tar::EntryType::Fifo, over, &p, codec); + let l = tar_layout(&p).unwrap(); + assert_eq!(l.files.len(), 1); + let c = walk_all(&p, &l, 0, &[]); + assert_eq!(c.files["game/f.bin"], b"ok"); + } + let _ = std::fs::remove_dir_all(&d); +} + #[test] fn a_walk_over_a_changed_archive_fails_instead_of_misnaming_bytes() { let d = temp_dir("drift"); diff --git a/engine/crates/ps5upload-engine/api/openapi.json b/engine/crates/ps5upload-engine/api/openapi.json index 263519abc..8a77c46f1 100644 --- a/engine/crates/ps5upload-engine/api/openapi.json +++ b/engine/crates/ps5upload-engine/api/openapi.json @@ -6076,49 +6076,60 @@ "type": "object" }, "HwStorage": { - "description": "\"Console Storage\" aggregate that matches what PS5 Settings shows.\nSums the three partitions Sony's UI counts (`/user effective +\n/system_data + /system_ex`) and accounts for the reserved-pool slice\nthe FS keeps for root. Per-partition fields are also surfaced for\nthe diagnostics card. Distinct from `fs_list_volumes`: that returns\nper-volume detail; this is the single-line summary.", + "description": "The console's internal storage as its filesystem counts it: `statfs` on `/user`,\n`/system_data` and `/system_ex`, nothing else.\n\n**These are not the figures of the PS5's own Settings > Storage screen** (#944). On one\n2 TB console this reported 175.5 GB in `user_free_bytes` and a 1.995 TB `/user`, while its\nStorage screen showed 71.35 GB free of 1.89 TB. How the console arrives at its figures is\nnot known to this API, and nothing here models it. Read these as what the filesystem says,\nand expect the console's screen to show less.\n\nWhat a copy can count on is `/api/ps5/volumes` (`allocatable_bytes`, `likely_fits_bytes`),\nwhich starts from the same `user_free_bytes`.\n\nDistinct from `fs_list_volumes`: that returns per-volume detail; this is the summary of the\ninternal drive with its partitions.", "properties": { "free_bytes": { + "description": "Free on the three partitions together. Includes the system partitions' own free space,\nwhich nothing can be copied into: for room on the drive read `user_free_bytes`.", "minimum": 0, "type": "integer" }, "reserved_bytes": { + "description": "The same number as `user_reserved_bytes` (the system partitions' are not counted).", "minimum": 0, "type": "integer" }, "system_data_free_bytes": { + "description": "Free on `/system_data` (`f_bavail`).", "minimum": 0, "type": "integer" }, "system_data_total_bytes": { + "description": "Size of `/system_data`.", "minimum": 0, "type": "integer" }, "system_ex_free_bytes": { + "description": "Free on `/system_ex` (`f_bavail`).", "minimum": 0, "type": "integer" }, "system_ex_total_bytes": { + "description": "Size of `/system_ex`; 0 when the firmware has no such mount.", "minimum": 0, "type": "integer" }, "total_bytes": { + "description": "Size of the three partitions together (`user` + `system_data` + `system_ex`).", "minimum": 0, "type": "integer" }, "used_bytes": { + "description": "`total_bytes - free_bytes`. Includes what the filesystem holds back (`reserved_bytes`),\nnot only stored data.", "minimum": 0, "type": "integer" }, "user_free_bytes": { + "description": "Free on `/user` for a writer (`f_bavail`); 0 once the drive is written into what it\nholds back. `user_reserved_bytes` is already left out of it: never subtract it again.", "minimum": 0, "type": "integer" }, "user_reserved_bytes": { + "description": "What the filesystem holds back on `/user` (`f_bfree - f_bavail`): free blocks that are\nnot offered to a writer. Not a fixed pool: measured on two consoles it grows by about a\nfifth of what is written and comes back when data is deleted.", "minimum": 0, "type": "integer" }, "user_total_bytes": { + "description": "Size of `/user`, the partition games and files are on (`/data` is a folder of it).", "minimum": 0, "type": "integer" } @@ -9411,6 +9422,17 @@ } ], "description": "Why the name can't be changed; `None` when it can." + }, + "room": { + "anyOf": [ + { + "$ref": "#/components/schemas/Room" + }, + { + "type": "null" + } + ], + "description": "How long a new name may be; `None` when it can't be changed." } }, "required": [ @@ -9419,7 +9441,8 @@ "name", "entries", "other_names", - "refusal" + "refusal", + "room" ], "type": "object" }, @@ -10479,6 +10502,14 @@ "minimum": 0, "type": "integer" }, + "declared_size": { + "description": "The least this package's file (every part of a split set together) has to be for its\nown header to be true: see [`declared_size_from`]. A file shorter than this is still\nbeing copied, or was cut short. `None` when the header declares nothing.", + "minimum": 0, + "type": [ + "integer", + "null" + ] + }, "fingerprint": { "description": "Stable, inexpensive identity for this exact package variant. This is a\nBLAKE3 digest over the file size plus bounded samples from the beginning\nand end of the pkg. It deliberately differs for two patches that share\nthe same ContentID/category/APP_VER (for example an optional fix and a\nbackport), without making the UI hash a multi-gigabyte pkg before an\nupload can start.", "type": "string" @@ -12326,6 +12357,26 @@ ], "type": "object" }, + "Room": { + "description": "How long a new name may be in this package, in UTF-8 bytes of plain text. A rename never\nmoves anything in the package, so the room is what the package itself has: the old names'\nown bytes and the whitespace its `param.json` and manifest can give up (PS5), or the fixed\nroom of its `param.sfo` strings (PS4); never more than [`MAX_NAME_BYTES`]. A character that\nhas to be written escaped (`\"` and `\\` in `param.json`; `&`, `<` and `>` in the manifest)\ntakes more than its own bytes, so such a name can still be refused a few bytes earlier.", + "properties": { + "all_languages": { + "description": "Giving every language the name.", + "minimum": 0, + "type": "integer" + }, + "default_name": { + "description": "Changing only the entries that hold the current default name.", + "minimum": 0, + "type": "integer" + } + }, + "required": [ + "default_name", + "all_languages" + ], + "type": "object" + }, "RootEntry": { "properties": { "kind": { @@ -16277,7 +16328,7 @@ "type": "null" } ], - "description": "With `method` `package` and `state` `problems`: what the problems add up to." + "description": "With `state` `problems`, for a package: what the problems add up to. Always there for\n`method` `package`; for `bytes` only when the file is shorter than its header says." }, "error": { "type": [ @@ -19454,7 +19505,7 @@ }, "/api/collection/organize/apply": { "post": { - "description": "POST /api/collection/organize/apply: runs the chosen moves of a preview. It does not plan\nagain: the preview already read every package, and over a network that took minutes. A move\nruns only if its file is as the preview saw it and its new name is still free.", + "description": "POST /api/collection/organize/apply: runs the chosen moves of a preview. It does not plan\nagain: the preview already read every package, and over a network that took minutes. A move\nruns only if its file is as the preview saw it and its new name is still free.\n\nAnswers `{moved, failed, dropped, kept_dirs, logs, undo_incomplete?}`. `moved` is what moved,\nwhatever happened afterwards: when a folder's undo log could not be saved once its moves were\nmade, the folder is listed in `undo_incomplete` (as \"folder: why\") and Undo may not put all of\nit back. `dropped` are moves that were left alone.", "requestBody": { "content": { "application/json": { @@ -19649,7 +19700,7 @@ }, "/api/collection/organize/revert": { "post": { - "description": "POST /api/collection/organize/revert: undoes one run from its log.", + "description": "POST /api/collection/organize/revert: undoes one run from its log. Answers\n`{reverted, problems, note?}`: `reverted` is what went back, also when the run could not be\nmarked as undone afterwards (`note` then says so).", "requestBody": { "content": { "application/json": { @@ -21394,6 +21445,7 @@ }, "/api/drive/delete": { "post": { + "description": "Deletes the drive (its files stay). When the console does not answer and this device keeps a\nfolder of it, that folder stops syncing and the console deletes the drive once it answers:\nthe answer then has `later`, and a `note` saying so.", "requestBody": { "content": { "application/json": { @@ -21554,6 +21606,7 @@ }, "/api/drive/leave": { "post": { + "description": "Takes a folder out of the drive. When the console does not answer, this device's own folder\nstops syncing anyway (its files stay) and the console drops it once it answers: the answer\nthen has `later`, and a `note` saying so.", "requestBody": { "content": { "application/json": { @@ -29100,7 +29153,7 @@ }, "/api/pkg/name": { "get": { - "description": "`GET /api/pkg/name?path=`: the names a package on this computer holds (one per language)\nand whether they can be changed. `refusal` is set when they can't: `code` is `retail` for an\nofficial package, `patch` for a delta update, `no_name`, or `unsupported` with the reason.", + "description": "`GET /api/pkg/name?path=`: the names a package on this computer holds (one per language)\nand whether they can be changed. `room` is how long a new name may be in this package, in\nUTF-8 bytes (`default_name`: changing the default name only; `all_languages`). `refusal` is set when they can't: `code` is `retail` for an\nofficial package, `patch` for a delta update, `no_name`, or `unsupported` with the reason.", "parameters": [ { "description": "The package, on the engine's computer.", @@ -29154,7 +29207,7 @@ } }, "post": { - "description": "`POST /api/pkg/name` `{path, name, all_languages}`: gives a fake package on this computer\nanother name, in place. 409 while the package is in use (an install, an upload or a build\nreads it, or another program has it open); 400 with the reason when it can't be done (an\nofficial package, a name that does not fit). On any failure the file is as it was.", + "description": "`POST /api/pkg/name` `{path, name, all_languages}`: gives a fake package on this computer\nanother name, in place. 409 while the package is in use (an install of it has not finished,\nhowever long ago the PS5 last read from it; an upload or a build reads it, or another program\nhas it open), with what holds it and how to free it; 400 with the reason when it can't be done (an\nofficial package, a name that does not fit). On any failure the file is as it was.", "requestBody": { "content": { "application/json": { @@ -37606,7 +37659,7 @@ }, "/api/ps5/hw/storage": { "get": { - "description": "\"Console Storage\" aggregate. Same shape PS5 Settings shows: total\nacross `/user effective + /system_data + /system_ex`, free across\nthe same set, plus the per-partition breakdown for diagnostics.", + "description": "`statfs` counters for `/user`, `/system_data` and `/system_ex`. These are not the figures of the PS5's Settings > Storage screen, which can show a smaller drive and less free space. `user_free_bytes` already leaves out `user_reserved_bytes`; do not subtract it again. For how much a copy can take, read `allocatable_bytes` and `likely_fits_bytes` in `/api/ps5/volumes`.", "parameters": [ { "in": "query", @@ -37648,7 +37701,7 @@ "description": "Any other failure, in the same shape." } }, - "summary": "The console's internal storage, as PS5 Settings counts it", + "summary": "The console's internal storage, as its filesystem counts it", "tags": [ "hardware" ], @@ -41833,7 +41886,7 @@ }, "/api/ps5/rp/pad-link/kick": { "post": { - "description": "`POST /api/ps5/rp/pad-link/kick {id}`: let a phone go, and keep it out until the link closes\n(the link's key alone would let it back in with one tap).", + "description": "`POST /api/ps5/rp/pad-link/kick {id}`: let a phone go, and keep it out until the link closes\n(the link's key alone would let it back in with one tap). One on the home network: the QR code\ngets a new key, since the phone has the old one and makes up its device id itself (a new one,\nor none, was a way back in). The other phones come back by their device ([`Link::allowed`]).", "requestBody": { "content": { "application/json": { @@ -45903,7 +45956,7 @@ }, "/api/queue/{id}/remove": { "post": { - "description": "POST /api/queue/{id}/remove — drops an item that is not running. A running upload or download\nneeds `cancel: true`: it stops and goes (202). A running install is never removed: the console\ngoes on with it whatever the queue says.", + "description": "POST /api/queue/{id}/remove — drops an item that is not running. A running upload or download\nneeds `cancel: true`: it stops and goes (202). A running install is never removed: the console\ngoes on with it whatever the queue says. An install from a package on this computer that has\nended without its session (one the PS5 may resume) gives that session up as it goes: the\npackage is free to rename, and the PS5, should it come back for it, is told it is over.", "parameters": [ { "in": "path", diff --git a/engine/crates/ps5upload-engine/api/overrides.json b/engine/crates/ps5upload-engine/api/overrides.json index 3d9a8d5d8..2df1696d6 100644 --- a/engine/crates/ps5upload-engine/api/overrides.json +++ b/engine/crates/ps5upload-engine/api/overrides.json @@ -402,7 +402,8 @@ "summary": "Console boot count, uptime and load" }, "GET /api/ps5/hw/storage": { - "summary": "The console's internal storage, as PS5 Settings counts it" + "summary": "The console's internal storage, as its filesystem counts it", + "description": "`statfs` counters for `/user`, `/system_data` and `/system_ex`. These are not the figures of the PS5's Settings > Storage screen, which can show a smaller drive and less free space. `user_free_bytes` already leaves out `user_reserved_bytes`; do not subtract it again. For how much a copy can take, read `allocatable_bytes` and `likely_fits_bytes` in `/api/ps5/volumes`." }, "GET /api/ps5/hw/temps": { "summary": "Console temperatures and clocks" diff --git a/engine/crates/ps5upload-engine/src/builtin_hub.rs b/engine/crates/ps5upload-engine/src/builtin_hub.rs index 5a8c2f6c4..86d3fc629 100644 --- a/engine/crates/ps5upload-engine/src/builtin_hub.rs +++ b/engine/crates/ps5upload-engine/src/builtin_hub.rs @@ -658,6 +658,9 @@ mod tests { loop { let v = room.json("K", None, None); if v["state"] == "hosted" { + // The room id is made from the engine's secret: this hub opens it for that secret + // only (it refuses any other, also after a restart), and it took this one. + assert!(ps5upload_hub::hub::is_bound_room(&room.id()), "{v}"); // The link names the public hub, never the loopback one. assert_eq!(v["hub"], "play.example.test", "{v}"); assert!( diff --git a/engine/crates/ps5upload-engine/src/collection/console.rs b/engine/crates/ps5upload-engine/src/collection/console.rs index 4dfa2256f..bb96609f0 100644 --- a/engine/crates/ps5upload-engine/src/collection/console.rs +++ b/engine/crates/ps5upload-engine/src/collection/console.rs @@ -108,7 +108,7 @@ pub fn state_for(game: &Game, t: &ConsoleTitle) -> GameConsoleState { } let v = l.pkg.as_ref().map(|p| p.version.as_str()).unwrap_or(""); match t.version.as_deref() { - Some(have) if !v.is_empty() => { + Some(have) if !v.is_empty() && !have.trim().is_empty() => { (version_cmp(v, have) == std::cmp::Ordering::Greater).then(|| offer(l, "gp")) } // Without the console's version, offer it only when no update is installed. diff --git a/engine/crates/ps5upload-engine/src/collection/identify.rs b/engine/crates/ps5upload-engine/src/collection/identify.rs index 101a57da8..da2c75a59 100644 --- a/engine/crates/ps5upload-engine/src/collection/identify.rs +++ b/engine/crates/ps5upload-engine/src/collection/identify.rs @@ -18,6 +18,24 @@ pub const READ_FAILED: &str = "could not be read"; /// What the index records for a later part of a split set: not an item, and not a package. pub const SPLIT_PART: &str = "part of a split package"; +/// Why a package whose file is shorter than its own header says is not whole. +pub fn cut_short_reason(have: u64, need: u64) -> String { + format!( + "the file is shorter than the package says it is ({have} of at least {need} bytes): \ + still being copied or downloaded, or cut short" + ) +} + +/// How long the package at `path` has to be by its own header, when the file (every part of a +/// split set: `whole` bytes) is shorter than that. `None` for a whole file, and for one whose +/// header declares nothing or can't be read. +pub fn cut_short(path: &Path, whole: Option) -> Option<(u64, u64)> { + let (mut f, size) = open_any(path)?; + let have = whole.unwrap_or(size); + let need = ps5upload_pkg::declared_size_from(&mut f, size)?; + (have < need).then_some((have, need)) +} + fn failed(why: impl Into) -> PkgInfo { PkgInfo { error: Some(why.into()), @@ -100,12 +118,30 @@ fn package(path: &Path, set_size: Option) -> PkgInfo { Err(e) => failed(e), }; } + // A package shorter than its header declares is still being copied, or was cut short. Its + // header can read perfectly well (a PS4 package's sits at the start), so this is asked of + // the sizes, never of how the parse went. + let whole = set_size.unwrap_or(size); + let short = ps5upload_pkg::declared_size_from(&mut f, size) + .filter(|need| whole < *need) + .map(|need| cut_short_reason(whole, need)); if std::io::Seek::seek(&mut f, std::io::SeekFrom::Start(0)).is_err() { return failed(READ_FAILED); } let head = match ps5upload_pkg::parse_pkg_from(&mut f, size, path) { Ok(h) => h, - Err(e) => return failed(e.to_string()), + // A PS5 package keeps what names it at its end: cut short, it cannot be read at all. + // That is a file not yet whole, not one that is no package. + Err(e) => { + return match short { + Some(why) => PkgInfo { + complete: false, + kind_reason: why, + ..PkgInfo::default() + }, + None => failed(e.to_string()), + } + } }; let mut info = match crate::inspect::inspect_local(path) { Ok(g) => from_inspection(&g), @@ -152,13 +188,9 @@ fn package(path: &Path, set_size: Option) -> PkgInfo { head.title_id.clone() }; } - // A package shorter than its header declares is still being copied, or was cut short. - if head - .warnings - .iter() - .any(|w| w.contains("truncat") || w.contains("shorter")) - { + if let Some(why) = short { info.complete = false; + info.kind_reason = why; } info } @@ -398,4 +430,107 @@ mod tests { assert_eq!((g.copies, g.is_duplicate), (2, true)); assert_eq!(summarize(&games).duplicates_count, 1); } + + /// A scratch folder removed when the test ends. + struct Gone(PathBuf); + impl Drop for Gone { + fn drop(&mut self) { + let _ = std::fs::remove_dir_all(&self.0); + } + } + + /// A PS4 game package whose header declares `total` bytes, in a file of `have`. + fn ps4_pkg_of(dir: &Path, name: &str, total: u64, have: u64) -> PathBuf { + let p = ps4_pkg(dir, name, GAME, 0x1A, 0x0A00_0000, Some("gd")); + let mut bytes = std::fs::read(&p).unwrap(); + assert!(bytes.len() < 0x400 && have >= 0x1000); + bytes.resize(have as usize, 0); + bytes[0x430..0x438].copy_from_slice(&total.to_be_bytes()); + std::fs::write(&p, bytes).unwrap(); + p + } + + /// The audit's case: a PS4 package still being copied. Its header sits at the start and + /// reads perfectly, so only the size it declares says the file is not all there. + #[test] + fn a_package_shorter_than_its_header_says_is_not_whole_and_organize_leaves_it() { + use crate::collection::organize::{plan_cached, SKIP_INCOMPLETE}; + use crate::collection::organize_fs::LocalTree; + let d = Gone(scratch()); + let root = d.0.join("lib"); + std::fs::create_dir_all(&root).unwrap(); + let p = ps4_pkg_of(&root, "copying.pkg", 0x9000, 0x1000); + let info = kind_of(&p); + assert!(!info.complete, "{info:?}"); + assert_eq!(info.error, None); + assert_eq!( + (info.title_id.as_str(), info.kind.as_str()), + ("CUSA12345", "base") + ); + assert!(info.kind_reason.contains("still being copied"), "{info:?}"); + assert_eq!(cut_short(&p, None), Some((0x1000, 0x9000))); + + // Organize leaves it where it is, and says why. + let roots = [(root.clone(), "root".to_string())]; + let plan = plan_cached(&LocalTree, &root, None, &roots); + assert!(plan.moves.is_empty(), "{:?}", plan.moves); + let left = plan + .skipped + .iter() + .find(|s| s.path == "copying.pkg") + .expect("the package is listed as left alone"); + assert_eq!(left.reason, SKIP_INCOMPLETE); + assert!( + left.detail.contains("4096 of at least 36864 bytes"), + "{left:?}" + ); + + // The copy finishes: the same file is whole, and is planned. + let mut bytes = std::fs::read(&p).unwrap(); + bytes.resize(0x9000, 0); + std::fs::write(&p, bytes).unwrap(); + assert!(kind_of(&p).complete); + assert_eq!(cut_short(&p, None), None); + let plan = plan_cached(&LocalTree, &root, None, &roots); + assert_eq!(plan.moves.len(), 1, "{:?}", plan.skipped); + assert_eq!(plan.moves[0].from, "copying.pkg"); + + // A split set is whole by all its parts together, not by its first file. + let lead = ps4_pkg_of(&root, "set_0.pkg", 0x9000, 0x1000); + assert!(identify_set(&lead, 0x9000, false).complete); + let short = identify_set(&lead, 0x8000, false); + assert!(!short.complete); + assert!( + short.kind_reason.contains("32768 of at least 36864"), + "{short:?}" + ); + } + + /// A PS5 package keeps what names it at its end, so one cut short can't be read at all: + /// it is still told apart from a file that is no package. + #[test] + fn a_ps5_package_cut_before_its_container_is_not_whole() { + use crate::collection::organize::{plan_cached, SKIP_INCOMPLETE}; + use crate::collection::organize_fs::LocalTree; + let d = Gone(scratch()); + let root = d.0.join("lib"); + std::fs::create_dir_all(&root).unwrap(); + let block = 0x10000usize; + let mut pkg = vec![0u8; 2 * block]; + pkg[0..4].copy_from_slice(&ps5upload_pkg::PKG_MAGIC_FIH.to_be_bytes()); + pkg[0x06..0x08].copy_from_slice(&3u16.to_le_bytes()); + pkg[0x10..0x18].copy_from_slice(&(block as u64).to_le_bytes()); + pkg[0x18..0x20].copy_from_slice(&(7 * block as u64).to_le_bytes()); + pkg[0x58..0x60].copy_from_slice(&(8 * block as u64).to_le_bytes()); + let p = root.join("PPSA01234.pkg"); + std::fs::write(&p, &pkg).unwrap(); + let info = kind_of(&p); + assert!(!info.complete, "{info:?}"); + assert_eq!(info.error, None); + assert!(info.kind_reason.contains("cut short"), "{info:?}"); + let plan = plan_cached(&LocalTree, &root, None, &[(root.clone(), "root".into())]); + assert!(plan.moves.is_empty()); + assert_eq!(plan.skipped.len(), 1, "{:?}", plan.skipped); + assert_eq!(plan.skipped[0].reason, SKIP_INCOMPLETE); + } } diff --git a/engine/crates/ps5upload-engine/src/collection/mod.rs b/engine/crates/ps5upload-engine/src/collection/mod.rs index 8c11edf27..fe65a7aca 100644 --- a/engine/crates/ps5upload-engine/src/collection/mod.rs +++ b/engine/crates/ps5upload-engine/src/collection/mod.rs @@ -194,7 +194,7 @@ pub struct PkgCacheEntry { } /// Raised whenever identification changes, so cached identities are read again. -pub const IDENTIFY_VERSION: u32 = 6; +pub const IDENTIFY_VERSION: u32 = 7; /// The whole index, written to `/collection/index.json`. #[derive(Debug, Clone, Default, Serialize, Deserialize, PartialEq)] diff --git a/engine/crates/ps5upload-engine/src/collection/organize.rs b/engine/crates/ps5upload-engine/src/collection/organize.rs index 5dc8a469c..f5cda1f53 100644 --- a/engine/crates/ps5upload-engine/src/collection/organize.rs +++ b/engine/crates/ps5upload-engine/src/collection/organize.rs @@ -16,12 +16,13 @@ use std::collections::{BTreeMap, HashMap, HashSet}; use std::path::{Path, PathBuf}; use std::sync::atomic::{AtomicBool, AtomicU64, Ordering}; use std::sync::Mutex; +use std::time::{Duration, Instant}; use serde::{Deserialize, Serialize}; use unicode_normalization::UnicodeNormalization; use super::junk; -use super::organize_fs::{path_string, OpError, PlanTree, Tree}; +use super::organize_fs::{path_string, DirEnt, Meta, OpError, PlanTree, Tree}; use super::scan::MAX_DEPTH; use super::split; use super::PkgInfo; @@ -32,6 +33,14 @@ pub const SKIP_INCOMPLETE: &str = "incomplete"; pub const SKIP_UNREADABLE: &str = "unreadable"; pub const SKIP_NO_ID: &str = "no title id"; pub const SKIP_IN_PLACE: &str = "already correct"; +pub const SKIP_INSIDE_GAME: &str = "its folder is a game"; + +/// How long a preview leaves between its two looks at the files it would move: one still being +/// copied or downloaded is not the same file a moment later. +pub const SETTLE: Duration = Duration::from_secs(1); +/// What a file that changed between the two looks is told. +pub const STILL_CHANGING: &str = + "its size or time changed while it was looked at: still being copied or downloaded"; /// What one package (or split set, read from its first part) says, plus where it is. #[derive(Debug, Clone)] @@ -112,9 +121,20 @@ pub struct PlanWatch { pub total: AtomicU64, pub done: AtomicU64, current: Mutex, + /// The least time between a plan's start and its second look at what it would move + /// ([`SETTLE`] for a real preview; none in a test that is not about it). + pub settle: Duration, } impl PlanWatch { + /// A real preview's watch: its second look comes [`SETTLE`] after it begins. + pub fn for_preview() -> Self { + Self { + settle: SETTLE, + ..Self::default() + } + } + fn stopped(&self) -> bool { self.cancel.load(Ordering::Relaxed) } @@ -412,6 +432,39 @@ fn is_game_folder(tree: &dyn Tree, dir: &Path, entries: &[super::organize_fs::Di }) } +/// Whether the folder at `dir` is an extracted game. Asked of its parent's listing first (which +/// a plan has already), so a folder that is not there costs no listing of its own. +fn is_game_at(tree: &dyn Tree, dir: &Path) -> bool { + let (Some(parent), Some(name)) = (dir.parent(), dir.file_name()) else { + return false; + }; + let name = key(Path::new(name)); + let there = tree.list(parent).is_some_and(|es| { + es.iter() + .any(|e| e.is_dir && key(Path::new(&e.name)) == name) + }); + there + && tree + .list(dir) + .is_some_and(|es| is_game_folder(tree, dir, &es)) +} + +/// The folder a title's items are filed in: `//`, unless that is +/// itself an extracted game. The Collection never looks inside a game, so packages filed in one +/// would vanish from it until the run was undone (and a game cannot be moved into itself): the +/// title then gets ` (2)`, `(3)`… beside it. `None` when the platform folder is a game, +/// which leaves no place under it at all. +fn title_dir(tree: &dyn Tree, container: &Path, platform: &str, folder: &str) -> Option { + let parent = container.join(platform); + if is_game_at(tree, &parent) { + return None; + } + std::iter::once(folder.to_string()) + .chain((2..66).map(|n| format!("{folder} ({n})"))) + .map(|name| parent.join(name)) + .find(|dir| !is_game_at(tree, dir)) +} + /// One candidate per complete game source. Never walk inside an extracted game. #[cfg(test)] fn discover( @@ -763,7 +816,18 @@ fn plan_files_watched( .max_by(|a, b| a.1.cmp(b.1).then(b.0.cmp(a.0))) .map(|(p, _)| p.to_string()) .unwrap_or_default(); - let dest_dir = container.join(&platform).join(&folder); + let Some(dest_dir) = title_dir(tree, container, &platform, &folder) else { + out.skipped.extend(members.iter().map(|f| Skipped { + container: cname.clone(), + path: rel(container, &f.path), + reason: SKIP_INSIDE_GAME.into(), + detail: format!( + "The {platform} folder here is an extracted game: nothing is filed inside a \ + game. Move or rename that game first." + ), + })); + continue; + }; // The same release stored twice is filed beside its twin and marked DUPLICATE. Which // copy is canonical must not depend on the marker, or the two would swap forever. @@ -909,6 +973,74 @@ fn plan_files_watched( out } +/// The second look. A file still being copied or downloaded can read well and say nothing about +/// its length (an image, a folder, a package whose header declares none): what gives it away is +/// that it is not the same file a moment later. Every file a move would take is looked at again, +/// no sooner than `watch.settle` after the plan `began`, through a fresh listing of its folder: +/// the same kind of look as the first, so a server that words a size or time one way in a +/// listing and another way for a single file cannot make a still file look changed. A file that +/// changed, is gone, or could not be looked at again keeps its name, and a split set stays whole. +fn leave_changing_files( + tree: &dyn Tree, + container: &Path, + plan: &mut Plan, + watch: &PlanWatch, + began: Instant, +) { + if plan.moves.is_empty() { + return; + } + while let Some(left) = watch.settle.checked_sub(began.elapsed()) { + if watch.stopped() { + return; + } + std::thread::sleep(left.min(Duration::from_millis(50))); + } + let mut fresh: HashMap>> = HashMap::new(); + // A move alone by its own name; the parts of a set by the set's. + let unit = |mv: &Move| { + if mv.set.is_empty() { + mv.from.clone() + } else { + mv.set.clone() + } + }; + let mut changing: HashSet = HashSet::new(); + for mv in &plan.moves { + let src = container.join(&mv.from); + let (Some(dir), Some(name)) = (src.parent(), src.file_name()) else { + continue; + }; + let name = name.to_string_lossy(); + let now = fresh + .entry(dir.to_path_buf()) + .or_insert_with(|| tree.list_fresh(dir)) + .as_ref() + .and_then(|es| es.iter().find(|e| e.name.as_str() == name)) + .map(|e| Meta { + size: e.size, + mtime: e.mtime, + }); + if now.is_none() || now != tree.meta(&src) { + changing.insert(unit(mv)); + } + } + if changing.is_empty() { + return; + } + let (left, moves): (Vec, Vec) = std::mem::take(&mut plan.moves) + .into_iter() + .partition(|mv| changing.contains(&unit(mv))); + plan.moves = moves; + plan.unsure.retain(|mv| !changing.contains(&unit(mv))); + plan.skipped.extend(left.into_iter().map(|mv| Skipped { + container: mv.container, + path: mv.from, + reason: SKIP_INCOMPLETE.into(), + detail: STILL_CHANGING.into(), + })); +} + /// A plan whose package facts come from the Collection's index where it is current. `roots` /// are (the root as a tree path, the root as the index keys it). #[cfg(test)] @@ -930,6 +1062,7 @@ pub fn plan_watched( roots: &[(PathBuf, String)], watch: &PlanWatch, ) -> Plan { + let began = Instant::now(); let tree = &PlanTree::new(tree); let cached = |p: &Path, size: u64, mtime: i64| -> Option { let lib = lib?; @@ -968,6 +1101,7 @@ pub fn plan_watched( f }; let mut plan = plan_files_watched(tree, container, files, &facts, watch); + leave_changing_files(tree, container, &mut plan, watch, began); plan.skipped.extend(skipped); if let Some(trouble) = tree.trouble() { // A folder the server would not list: its packages are missing from this preview. @@ -1005,6 +1139,11 @@ pub struct UndoLog { /// Set once the run was undone, so it cannot be undone twice. #[serde(default, skip_serializing_if = "Option::is_none")] pub reverted_at: Option, + /// Why this log, as it is here, is not what is on disk: the last write of a run failed. + /// The moves in `completed` happened all the same; the file holds an earlier state of the + /// run, so Undo may not know all of them. Never stored. + #[serde(skip)] + pub unsaved: Option, } /// A server folder's whereabouts, as the saved connection said when the run was made. @@ -1375,7 +1514,9 @@ pub fn apply( removed_dirs: Vec::new(), kept_dirs: Vec::new(), reverted_at: None, + unsaved: None, }; + // Before the first move: a run that cannot be logged does not start, and nothing moved. write_log(log_path, &log)?; let mut started_in = HashSet::new(); let mut made = HashSet::new(); @@ -1418,10 +1559,19 @@ pub fn apply( log.removed_dirs = removed; log.kept_dirs = kept; } - write_log(log_path, &log)?; + // After the last move: the files are where the run put them whatever happens to this write, + // so a failure here is never "the run failed". It is told apart, for the caller to say what + // moved and that Undo may not know all of it (the file holds the last state that was + // written; Undo also looks for moves that happened without being recorded). + log.unsaved = write_log_twice(log_path, &log).err().map(|e| e.to_string()); Ok(log) } +/// [`write_log`], once more when it fails: a full or busy disk can take the second try. +fn write_log_twice(path: &Path, log: &UndoLog) -> std::io::Result<()> { + write_log(path, log).or_else(|_| write_log(path, log)) +} + /// Gives the tree a path is in. pub type OpenTree = dyn Fn(&Path) -> Result, String>; @@ -1534,7 +1684,15 @@ pub fn revert(log_path: &Path, open: &OpenTree) -> std::io::Result // and undo again; the moves already put back are then skipped as "moved file is gone". if out.problems.is_empty() { log.reverted_at = Some(now_iso()); - write_log(log_path, &log)?; + // The files are back whatever happens to this write: failing it must not turn an undo + // that worked into "nothing was undone". + if let Err(e) = write_log_twice(log_path, &log) { + out.note = Some(format!( + "Everything was put back, but this run could not be marked as undone (its log \ + could not be written: {e}). It may still be listed as a run to undo; undoing \ + it again changes nothing." + )); + } } Ok(out) } @@ -2425,6 +2583,7 @@ mod tests { removed_dirs: Vec::new(), kept_dirs: Vec::new(), reverted_at: None, + unsaved: None, }; write_log(&path, &log).unwrap(); let back: UndoLog = serde_json::from_slice(&std::fs::read(&path).unwrap()).unwrap(); @@ -2570,4 +2729,343 @@ mod tests { assert_eq!(title_folder("CUSA1", "CUSA1"), "CUSA1"); assert_eq!(sanitize(&"x".repeat(130)).chars().count(), 120); } + + /// A tree whose second look finds `grown` (a file name) bigger than the first did. + struct Growing(&'static str); + impl Tree for Growing { + fn list(&self, dir: &Path) -> Option> { + LocalTree.list(dir) + } + fn list_fresh(&self, dir: &Path) -> Option> { + let mut es = LocalTree.list(dir)?; + for e in es.iter_mut().filter(|e| e.name == self.0) { + e.size += 4096; + } + Some(es) + } + fn meta(&self, p: &Path) -> Option { + LocalTree.meta(p) + } + fn exists(&self, p: &Path) -> Result { + LocalTree.exists(p) + } + fn create_dir(&self, p: &Path) -> Result<(), OpError> { + LocalTree.create_dir(p) + } + fn rename_new(&self, from: &Path, to: &Path) -> Result<(), OpError> { + LocalTree.rename_new(from, to) + } + fn remove_dir(&self, p: &Path) -> Result<(), OpError> { + LocalTree.remove_dir(p) + } + fn is_removable_junk(&self, p: &Path) -> bool { + LocalTree.is_removable_junk(p) + } + fn remove_junk(&self, p: &Path) { + LocalTree.remove_junk(p); + } + fn head(&self, p: &Path) -> Option<[u8; 4]> { + LocalTree.head(p) + } + } + + /// A game folder (its param.json names it), as the organizer reads one. + fn game_dir(dir: &Path, title_id: &str) { + std::fs::create_dir_all(dir.join("sce_sys")).unwrap(); + std::fs::write( + dir.join("sce_sys/param.json"), + format!( + r#"{{"titleId":"{title_id}","contentVersion":"01.000.000","localizedParameters":{{"defaultLanguage":"en-US","en-US":{{"titleName":"Example"}}}}}}"# + ), + ) + .unwrap(); + } + + /// A file that is not the same at the plan's second look is still being copied: it keeps + /// its name, the preview says so, and what did not change is planned as before. + #[test] + fn a_file_that_changes_between_two_looks_is_left_alone() { + let l = lib("changing"); + let root = l.0.clone(); + game_dir(&root.join("still"), "PPSA01234"); + game_dir(&root.join("copying"), "PPSA05678"); + let roots = [(root.clone(), "root".to_string())]; + // Nothing changes: both are planned. + let plan = plan_cached(&LocalTree, &root, None, &roots); + assert_eq!(plan.moves.len(), 2, "{:?}", plan.skipped); + + let watch = PlanWatch { + settle: Duration::from_millis(120), + ..PlanWatch::default() + }; + let began = Instant::now(); + let plan = plan_watched(&Growing("copying"), &root, None, &roots, &watch); + assert!( + began.elapsed() >= Duration::from_millis(120), + "the second look waits for the files to settle" + ); + assert_eq!(plan.moves.len(), 1, "{:?}", plan.moves); + assert_eq!(plan.moves[0].from, "still"); + let left: Vec<&Skipped> = plan + .skipped + .iter() + .filter(|s| s.reason == SKIP_INCOMPLETE) + .collect(); + assert_eq!(left.len(), 1, "{:?}", plan.skipped); + assert_eq!( + (left[0].path.as_str(), left[0].detail.as_str()), + ("copying", STILL_CHANGING) + ); + } + + /// One part of a split set still growing leaves the whole set where it is. + #[test] + fn a_set_with_one_changing_part_stays_whole() { + let l = lib("changing-set"); + let c = l.0.join("fpkg"); + put(&c, "Game_0.pkg", 30); + put(&c, "Game_1.pkg", 20); + put(&c, "Game_2.pkg", 10); + std::fs::write(c.join("Game_0.pkg"), [0x7F, b'C', b'N', b'T', 0, 0]).unwrap(); + let entries = [( + "Game", + info( + "Game", + "CUSA00001", + "UP0000-CUSA00001_00-GAME", + "base", + "1.00", + ), + )]; + let facts = table(&entries); + let files = scan(&LocalTree, &c); + let mut plan = plan_files(&LocalTree, &c, files, &facts); + assert_eq!(plan.moves.len(), 3, "{:?}", plan.skipped); + leave_changing_files( + &Growing("Game_2.pkg"), + &c, + &mut plan, + &PlanWatch::default(), + Instant::now(), + ); + assert!(plan.moves.is_empty(), "{:?}", plan.moves); + assert_eq!( + plan.skipped + .iter() + .filter(|s| s.detail == STILL_CHANGING) + .count(), + 3 + ); + } + + /// A tree that, at its first rename, puts a folder where the undo log's next write goes: + /// every write of the log after that fails, as on a disk that filled up during the run. + struct LogBreaks(PathBuf); + impl Tree for LogBreaks { + fn list(&self, dir: &Path) -> Option> { + LocalTree.list(dir) + } + fn meta(&self, p: &Path) -> Option { + LocalTree.meta(p) + } + fn exists(&self, p: &Path) -> Result { + LocalTree.exists(p) + } + fn create_dir(&self, p: &Path) -> Result<(), OpError> { + LocalTree.create_dir(p) + } + fn rename_new(&self, from: &Path, to: &Path) -> Result<(), OpError> { + std::fs::create_dir_all(self.0.with_extension("json.tmp")).unwrap(); + LocalTree.rename_new(from, to) + } + fn remove_dir(&self, p: &Path) -> Result<(), OpError> { + LocalTree.remove_dir(p) + } + fn is_removable_junk(&self, p: &Path) -> bool { + LocalTree.is_removable_junk(p) + } + fn remove_junk(&self, p: &Path) { + LocalTree.remove_junk(p); + } + } + + /// The audit's case: the moves were made and the last write of the undo log failed. That was + /// an error, which the caller read as "nothing moved". It is a run that moved its files, told + /// that its log is behind; and Undo still puts back what the log on disk only planned. + #[test] + fn a_failed_last_log_write_does_not_unsay_the_moves() { + let l = lib("log-last-write"); + let c = l.0.join("fpkg"); + put(&c, "a.pkg", 10); + put(&c, "b.pkg", 20); + let entries = [ + ( + "a", + info( + "Alpha", + "CUSA00001", + "UP0000-CUSA00001_00-A", + "base", + "1.00", + ), + ), + ( + "b", + info("Beta", "CUSA00002", "UP0000-CUSA00002_00-B", "base", "1.00"), + ), + ]; + let p = plan_with(&LocalTree, &c, &table(&entries)); + assert_eq!(p.moves.len(), 2); + let log_path = l.0.join("logs/run.json"); + let tree = LogBreaks(log_path.clone()); + let log = apply(&tree, &c, p.moves.clone(), &log_path, "", None).unwrap(); + assert_eq!(log.completed.len(), 2, "the run says what it moved"); + assert!(log.failed.is_empty()); + assert!(log.unsaved.is_some(), "and that its log could not be saved"); + for m in &p.moves { + assert!(c.join(&m.to).is_file() && !c.join(&m.from).exists()); + } + // On disk: the log as it was written before the first move. + let on_disk: UndoLog = serde_json::from_slice(&std::fs::read(&log_path).unwrap()).unwrap(); + assert!(on_disk.completed.is_empty()); + assert_eq!(on_disk.moves.len(), 2); + assert_eq!(on_disk.unsaved, None, "never stored"); + + // Undo, its own last write failing too: the files go back, and that is what it says. + let undone = revert(&log_path, &local).unwrap(); + assert_eq!(undone.reverted.len(), 2, "{:?}", undone.problems); + assert!(undone.problems.is_empty()); + assert!( + undone + .note + .as_deref() + .is_some_and(|n| n.contains("could not be marked as undone")), + "{:?}", + undone.note + ); + for m in &p.moves { + assert!(c.join(&m.from).is_file() && !c.join(&m.to).exists()); + } + // Once the log can be written again, the same Undo marks the run and changes nothing. + std::fs::remove_dir_all(log_path.with_extension("json.tmp")).unwrap(); + let again = revert(&log_path, &local).unwrap(); + assert!( + again.problems.is_empty() && again.note.is_none(), + "{again:?}" + ); + assert!(revert(&log_path, &local).is_err(), "a run is undone once"); + } + + /// The first write comes before the first move: failing it is "nothing moved", and is. + #[test] + fn a_run_that_cannot_write_its_log_first_moves_nothing() { + let l = lib("log-first-write"); + let c = l.0.join("fpkg"); + put(&c, "a.pkg", 10); + let entries = [( + "a", + info( + "Alpha", + "CUSA00001", + "UP0000-CUSA00001_00-A", + "base", + "1.00", + ), + )]; + let p = plan_with(&LocalTree, &c, &table(&entries)); + let log_path = l.0.join("logs/run.json"); + std::fs::create_dir_all(log_path.with_extension("json.tmp")).unwrap(); + assert!(apply(&LocalTree, &c, p.moves, &log_path, "", None).is_err()); + assert!(c.join("a.pkg").is_file()); + } + + /// The audit's case: an extracted game sits exactly where its title's folder would be + /// (`PS5/PPSA01234 - Example`, holding `sce_sys`). Packages of that title were planned into + /// it, and the Collection, which never looks inside a game, lost them until the run was + /// undone. Nothing is filed inside a game: the title gets a folder beside it. + #[test] + fn nothing_is_planned_into_a_folder_that_is_itself_a_game() { + let l = lib("into-game"); + let root = l.0.clone(); + let game = root.join("PS5/PPSA01234 - Example"); + game_dir(&game, "PPSA01234"); + std::fs::write(game.join("eboot.bin"), b"e").unwrap(); + put(&root, "update.pkg", 10); + put(&root, "addon.pkg", 20); + let ps5 = |kind: &str, cid: &str| PkgInfo { + platform: "PS5".into(), + ..info("Example", "PPSA01234", cid, kind, "1.00") + }; + let entries = [ + ( + "update", + ps5("patch", "UP0000-PPSA01234_00-EXAMPLE000000000"), + ), + ("addon", ps5("dlc", "UP0000-PPSA01234_00-ADDON00000000000")), + ( + "PPSA01234", + ps5("base", "UP0000-PPSA01234_00-EXAMPLE000000000"), + ), + ]; + let facts = table(&entries); + let plan = plan_with(&LocalTree, &root, &facts); + let inside = "PS5/PPSA01234 - Example/"; + let beside = "PS5/PPSA01234 - Example (2)/"; + assert_eq!(plan.moves.len(), 3, "{:?}", plan.skipped); + for m in &plan.moves { + assert!(!m.to.starts_with(inside), "planned into the game: {m:?}"); + assert!(m.to.starts_with(beside), "{m:?}"); + } + + // Run it: every package is still something the Collection finds. + let packages: Vec = plan + .moves + .iter() + .filter(|m| m.from.ends_with(".pkg")) + .cloned() + .collect(); + assert_eq!(packages.len(), 2); + let log = apply( + &LocalTree, + &root, + packages, + &l.0.join("logs/run.json"), + "", + None, + ) + .unwrap(); + assert_eq!(log.completed.len(), 2, "{:?}", log.failed); + let found = scan(&LocalTree, &root); + assert_eq!( + found + .iter() + .filter(|p| p.extension().is_some_and(|e| e == "pkg")) + .count(), + 2, + "{found:?}" + ); + assert!(found.contains(&game), "the game is still one item"); + // And they stay there: the next plan does not move them again. + let again = plan_with(&LocalTree, &root, &facts); + assert!( + again.moves.iter().all(|m| !m.from.ends_with(".pkg")), + "{:?}", + again.moves + ); + + // A game where the platform folder would be leaves no place under it: said, not done. + let l = lib("into-game-platform"); + let root = l.0.clone(); + game_dir(&root.join("PS5"), "PPSA09999"); + put(&root, "update.pkg", 10); + let plan = plan_files( + &LocalTree, + &root, + vec![root.join("update.pkg")], + &table(&entries), + ); + assert!(plan.moves.is_empty(), "{:?}", plan.moves); + assert_eq!(plan.skipped.len(), 1); + assert_eq!(plan.skipped[0].reason, SKIP_INSIDE_GAME); + } } diff --git a/engine/crates/ps5upload-engine/src/collection/organize_fs.rs b/engine/crates/ps5upload-engine/src/collection/organize_fs.rs index cb5b8e2b6..fdd16503e 100644 --- a/engine/crates/ps5upload-engine/src/collection/organize_fs.rs +++ b/engine/crates/ps5upload-engine/src/collection/organize_fs.rs @@ -57,6 +57,11 @@ impl std::fmt::Display for OpError { pub trait Tree: Send + Sync { /// The entries of `dir`, or `None` when it cannot be read. fn list(&self, dir: &Path) -> Option>; + /// The entries of `dir` as they are now, never from a listing kept earlier: a second look + /// at files a plan already saw, made the same way as the first. + fn list_fresh(&self, dir: &Path) -> Option> { + self.list(dir) + } /// A file's size and time; may come from the listing of its folder. fn meta(&self, p: &Path) -> Option; /// Whether anything is at `p` now (never from a cached listing). @@ -119,6 +124,10 @@ impl Tree for PlanTree<'_> { v } + fn list_fresh(&self, dir: &Path) -> Option> { + self.inner.list_fresh(dir) + } + fn meta(&self, p: &Path) -> Option { let from_listing = p.parent().zip(p.file_name()).and_then(|(dir, name)| { self.list(dir)? @@ -344,6 +353,16 @@ impl RemoteTree { { return Ok(v.clone()); } + let out = self.fetch_server(dir)?; + self.cache + .lock() + .unwrap_or_else(|e| e.into_inner()) + .insert(dir.to_string(), out.clone()); + Ok(out) + } + + /// `dir` as the server lists it now: nothing kept, nothing remembered. + fn fetch_server(&self, dir: &str) -> Result, RemoteError> { let mut out = Vec::new(); let mut cursor = None; loop { @@ -368,10 +387,6 @@ impl RemoteTree { // one in it could not be told from two names, so it is left out (never touched). out.retain(|e| !e.name.contains('\\')); } - self.cache - .lock() - .unwrap_or_else(|e| e.into_inner()) - .insert(dir.to_string(), out.clone()); Ok(out) } @@ -428,6 +443,10 @@ impl Tree for RemoteTree { } } + fn list_fresh(&self, dir: &Path) -> Option> { + self.fetch_server(&self.server(dir).ok()?).ok() + } + fn meta(&self, p: &Path) -> Option { let s = self.server(p).ok()?; let (dir, name) = s.rsplit_once('/')?; diff --git a/engine/crates/ps5upload-engine/src/collection_check_api.rs b/engine/crates/ps5upload-engine/src/collection_check_api.rs index 1b0380448..7e9e440d3 100644 --- a/engine/crates/ps5upload-engine/src/collection_check_api.rs +++ b/engine/crates/ps5upload-engine/src/collection_check_api.rs @@ -8,8 +8,11 @@ //! - `archive`: every entry of a `.zip` / `.7z` / `.rar` is decoded and its checksum checked. //! - `files`: a game folder or image has every file read back through its filesystem. //! - `bytes`: anything else (a retail or PS4 package, a copy on a server) is read from the first -//! byte to the last, which finds a copy that is cut short or sits on failing storage, but not -//! one whose bytes are wrong yet readable. +//! byte to the last, which finds a copy that sits on failing storage, but not one whose bytes +//! are wrong yet readable. A package is also held against its own header: one shorter than +//! the header says is cut short, and `damage` says so (`truncated`). A split package is one +//! package: every part is read, in order, and a part that is missing is a problem named by +//! that part. //! //! One check reads at a time: two at once on the same drive would only slow both. Only paths //! that are copies in the Collection can be checked. @@ -111,7 +114,8 @@ pub struct CheckStatus { pub files_total: u64, pub problems: Vec, pub problems_total: u64, - /// With `method` `package` and `state` `problems`: what the problems add up to. + /// With `state` `problems`, for a package: what the problems add up to. Always there for + /// `method` `package`; for `bytes` only when the file is shorter than its header says. #[serde(skip_serializing_if = "Option::is_none")] pub damage: Option, pub error: Option, @@ -206,14 +210,19 @@ pub async fn post_check(Json(req): Json) -> Response { }; let mut wanted = Vec::new(); for p in &req.paths { - let kind = lib + // A split package's later parts come from the index with it, never from the request. + let copy = lib .games .values() .flat_map(|g| g.locations.iter()) .find(|l| &l.absolute_path == p) - .map(|l| l.kind.clone()); - match kind { - Some(k) => wanted.push((p.clone(), k)), + .map(|l| (l.kind.clone(), l.parts.clone())); + match copy { + Some((kind, parts)) => wanted.push(Wanted { + path: p.clone(), + kind, + parts, + }), None => { return err( StatusCode::NOT_FOUND, @@ -226,10 +235,18 @@ pub async fn post_check(Json(req): Json) -> Response { get_checks().await } -/// Queues a check of each `(path, kind)` not already being checked. -fn start(wanted: Vec<(String, String)>, handle: tokio::runtime::Handle) { +/// A copy to check: where it is, its Collection type, and its later files when it is a split +/// package. +struct Wanted { + path: String, + kind: String, + parts: Vec, +} + +/// Queues a check of each copy not already being checked. +fn start(wanted: Vec, handle: tokio::runtime::Handle) { let mut map = jobs().lock().unwrap_or_else(|e| e.into_inner()); - for (path, kind) in wanted { + for Wanted { path, kind, parts } in wanted { if map .get(&path) .is_some_and(|j| j.status.lock().unwrap_or_else(|e| e.into_inner()).active()) @@ -259,7 +276,7 @@ fn start(wanted: Vec<(String, String)>, handle: tokio::runtime::Handle) { return; } job.update(|s| s.state = "running".into()); - let outcome = run(&job, Path::new(&path), &kind); + let outcome = run(&job, Path::new(&path), &kind, &parts); job.update(|s| { s.finished_ms = now_ms(); s.state = match outcome { @@ -316,16 +333,18 @@ pub async fn post_check_cancel(Json(req): Json) -> Response { get_checks().await } -/// Checks the copy at `path` (of Collection type `kind`). Problems found are recorded on the -/// job; `Err` is a copy that could not be checked at all. -fn run(job: &Job, path: &Path, kind: &str) -> Result<(), String> { +/// Checks the copy at `path` (of Collection type `kind`; `parts` are a split package's later +/// files, in order). Problems found are recorded on the job; `Err` is a copy that could not be +/// checked at all. +fn run(job: &Job, path: &Path, kind: &str, parts: &[String]) -> Result<(), String> { let remote = ps5upload_fpkg::remote_source::is_remote(path); match kind { + "pkg" if !parts.is_empty() => split_package(job, path, parts), "pkg" => { if !remote && package(job, path)? { return Ok(()); } - package_header(job, path); + package_header(job, path, None); bytes(job, path) } "zip" | "7z" | "rar" if !remote => archive(job, path), @@ -386,30 +405,31 @@ fn package(job: &Job, path: &Path) -> Result { } /// The package header, for a package read byte by byte: one that says it is longer than the -/// file is cut short. -fn package_header(job: &Job, path: &Path) { - let opened = if ps5upload_fpkg::remote_source::is_remote(path) { - ps5upload_fpkg::remote_source::open_file(path).ok() - } else { - std::fs::File::open(path).ok().and_then(|f| { - let n = f.metadata().ok()?.len(); - Some((Box::new(f) as Box, n)) - }) - }; - let Some((mut f, size)) = opened else { +/// file is cut short. That is asked of the sizes the header declares, not of whether the header +/// reads: a PS4 package's header sits at the start and reads perfectly well from a file that +/// stops half way. `whole` is the length of a split package, all its parts together. +fn package_header(job: &Job, path: &Path, whole: Option) { + if let Some((have, need)) = crate::collection::identify::cut_short(path, whole) { + job.problem_of( + "truncated", + "", + format!("the file ends early: {have} bytes, at least {need} needed"), + ); + job.update(|s| { + s.damage = Some(Damage { + kind: "truncated".into(), + bytes_have: have, + bytes_need: need, + ..Damage::default() + }) + }); + return; + } + let Ok((mut f, size)) = open(path) else { return; }; - match ps5upload_pkg::parse_pkg_from(&mut f, size, path) { - Ok(h) => { - for w in h - .warnings - .iter() - .filter(|w| w.contains("truncat") || w.contains("shorter")) - { - job.problem("", w.clone()); - } - } - Err(e) => job.problem("", format!("the package header can't be read: {e}")), + if let Err(e) = ps5upload_pkg::parse_pkg_from(&mut f, size, path) { + job.problem("", format!("the package header can't be read: {e}")); } } @@ -505,18 +525,26 @@ fn files(job: &Job, path: &Path) -> Result<(), String> { Ok(()) } -/// Every byte of a single file, start to end. -fn bytes(job: &Job, path: &Path) -> Result<(), String> { - job.update(|s| s.method = "bytes".into()); - let (mut f, size): (Box, u64) = - if ps5upload_fpkg::remote_source::is_remote(path) { - ps5upload_fpkg::remote_source::open_file(path).map_err(|e| format!("{e}"))? - } else { - let f = std::fs::File::open(path).map_err(|e| format!("{e}"))?; - let n = f.metadata().map_err(|e| format!("{e}"))?.len(); - (Box::new(f), n) - }; - job.update(|s| s.bytes_total = size); +/// A file's bytes and its length: on this computer, or on a saved server. +fn open(path: &Path) -> Result<(Box, u64), String> { + if ps5upload_fpkg::remote_source::is_remote(path) { + return ps5upload_fpkg::remote_source::open_file(path).map_err(|e| format!("{e}")); + } + let f = std::fs::File::open(path).map_err(|e| format!("{e}"))?; + let n = f.metadata().map_err(|e| format!("{e}"))?.len(); + Ok((Box::new(f), n)) +} + +/// Reads `f` (`size` bytes, named `file` in a problem) from its first byte to its last, adding +/// to the job's bytes done after the `before` bytes read ahead of it. `Ok(false)`: it could not +/// be read to its end, and the problem says where. +fn read_through( + job: &Job, + f: &mut dyn Read, + size: u64, + file: &str, + before: u64, +) -> Result { let mut buf = vec![0u8; CHUNK]; let mut done = 0u64; loop { @@ -528,15 +556,136 @@ fn bytes(job: &Job, path: &Path) -> Result<(), String> { Ok(n) => n, Err(e) if e.kind() == std::io::ErrorKind::Interrupted => continue, Err(e) => { - job.problem("", format!("can't be read at byte {done}: {e}")); - return Ok(()); + job.problem(file, format!("can't be read at byte {done}: {e}")); + return Ok(false); } }; done += n as u64; - job.update(|s| s.bytes_done = done); + job.update(|s| s.bytes_done = before + done); } if done < size { - job.problem("", format!("ends early: {done} of {size} bytes")); + job.problem(file, format!("ends early: {done} of {size} bytes")); + return Ok(false); + } + Ok(true) +} + +/// Every byte of a single file, start to end. +fn bytes(job: &Job, path: &Path) -> Result<(), String> { + job.update(|s| s.method = "bytes".into()); + let (mut f, size) = open(path)?; + job.update(|s| s.bytes_total = size); + read_through(job, &mut f, size, "", 0).map(|_| ()) +} + +/// A path's last name, as a problem shows it. +fn name_of(path: &Path) -> String { + path.file_name() + .map(|n| n.to_string_lossy().into_owned()) + .unwrap_or_default() +} + +/// The parts a split set's own numbering says should be there and are not: `Game_0.pkg` and +/// `Game_2.pkg` miss `Game_1.pkg`; `Game.pkg` and `Game.pkg.1` miss `Game.pkg.0`. Parts missing +/// after the last one there leave no gap in the names: the package's declared length finds those. +fn missing_from_run(lead: &Path, parts: &[String]) -> Vec { + use crate::collection::split::{named_part, suffix_part}; + let lead = name_of(lead); + let names: Vec = parts.iter().map(|p| name_of(Path::new(p))).collect(); + let suffixed: Option> = names + .iter() + .map(|n| suffix_part(n).map(|(_, k)| k)) + .collect(); + // The numbers a later part may have (from `first`), the ones there, and how a name is made: + // `{lead}.{k}`, or `{stem}_{k}.pkg`. + let (first, have, stem) = match suffixed { + Some(have) => (0, have, None), + None => { + let Some((stem, _)) = named_part(&lead) else { + return Vec::new(); + }; + let Some(have) = names + .iter() + .map(|n| named_part(n).map(|(_, k)| k)) + .collect::>>() + else { + return Vec::new(); + }; + (1, have, Some(stem.to_string())) + } + }; + let last = have.iter().copied().max().unwrap_or(0); + // A set has dozens of parts at the very most: a name with a wild number is not walked to. + if last.saturating_sub(first) > 4096 { + return Vec::new(); + } + (first..last) + .filter(|k| !have.contains(k)) + .map(|k| match &stem { + Some(stem) => format!("{stem}_{k}.pkg"), + None => format!("{lead}.{k}"), + }) + .collect() +} + +/// A split package: its parts are one package, so every one is read, in order, and the package's +/// own header is held against all of them together. A part that is not there is a problem named +/// by that part; so is one that cannot be opened or read to its end. +fn split_package(job: &Job, lead: &Path, parts: &[String]) -> Result<(), String> { + job.update(|s| s.method = "bytes".into()); + let all: Vec<&Path> = std::iter::once(lead) + .chain(parts.iter().map(Path::new)) + .collect(); + // Each part's length first: the total is what the header is held against and what the + // progress counts to. The first part is the package: without it nothing can be checked. + let mut sizes: Vec> = Vec::with_capacity(all.len()); + for (i, part) in all.iter().enumerate() { + match open(part) { + Ok((_, n)) => sizes.push(Some(n)), + Err(e) if i == 0 => return Err(e), + Err(e) => { + let gone = !ps5upload_fpkg::remote_source::is_remote(part) && !part.exists(); + job.problem( + &name_of(part), + if gone { + "this part of the split package is missing".to_string() + } else { + format!("this part of the split package can't be opened: {e}") + }, + ); + sizes.push(None); + } + } + if job.cancelled() { + return Err("cancelled".into()); + } + } + for name in missing_from_run(lead, parts) { + job.problem(&name, "this part of the split package is missing"); + } + let total: u64 = sizes.iter().flatten().sum(); + job.update(|s| { + s.files_total = all.len() as u64; + s.bytes_total = total; + }); + package_header(job, lead, Some(total)); + let mut before = 0u64; + for (part, size) in all.iter().zip(&sizes) { + let Some(size) = *size else { + continue; + }; + match open(part) { + Ok((mut f, _)) => { + read_through(job, &mut f, size, &name_of(part), before)?; + } + Err(e) => job.problem(&name_of(part), format!("can't be opened: {e}")), + } + // A part given up on still counts as gone through. + before += size; + job.update(|s| { + s.files_done += 1; + s.bytes_done = before; + }); } Ok(()) } @@ -582,7 +731,7 @@ mod tests { let t = Scratch::new("clean"); game_folder(t.path()); let j = job(); - run(&j, t.path(), "folder").unwrap(); + run(&j, t.path(), "folder", &[]).unwrap(); let s = j.status.lock().unwrap(); assert_eq!(s.method, "files"); assert_eq!(s.problems_total, 0, "{:?}", s.problems); @@ -595,7 +744,7 @@ mod tests { let t = Scratch::new("missing"); std::fs::write(t.path().join("data.bin"), b"x").unwrap(); let j = job(); - run(&j, t.path(), "folder").unwrap(); + run(&j, t.path(), "folder", &[]).unwrap(); let s = j.status.lock().unwrap(); assert_eq!(s.problems_total, 2, "{:?}", s.problems); } @@ -617,7 +766,7 @@ mod tests { z.finish().unwrap(); } let j = job(); - run(&j, &good, "zip").unwrap(); + run(&j, &good, "zip", &[]).unwrap(); assert_eq!(j.status.lock().unwrap().problems_total, 0); // Flip a byte of the stored data: the CRC no longer matches. @@ -627,7 +776,7 @@ mod tests { let bad = t.path().join("bad.zip"); std::fs::write(&bad, bytes).unwrap(); let j = job(); - run(&j, &bad, "zip").unwrap(); + run(&j, &bad, "zip", &[]).unwrap(); let s = j.status.lock().unwrap(); assert_eq!(s.method, "archive"); assert_eq!(s.problems_total, 1, "{:?}", s.problems); @@ -673,7 +822,7 @@ mod tests { /// The check of the package at `path`, finished. fn checked(path: &Path) -> CheckStatus { let j = job(); - run(&j, path, "pkg").unwrap(); + run(&j, path, "pkg", &[]).unwrap(); let s = j.status.lock().unwrap().clone(); s } @@ -777,9 +926,136 @@ mod tests { let f = t.path().join("retail.pkg"); std::fs::write(&f, vec![0u8; 70_000]).unwrap(); let j = job(); - run(&j, &f, "pkg").unwrap(); + run(&j, &f, "pkg", &[]).unwrap(); let s = j.status.lock().unwrap(); assert_eq!(s.method, "bytes"); assert_eq!(s.bytes_done, 70_000); } + + /// A PS4 package (`\\x7FCNT`) whose header declares `total` bytes, in a file of `have`. + fn ps4_package(path: &Path, total: u64, have: usize) { + let mut pkg = vec![0u8; have]; + pkg[0..4].copy_from_slice(&ps5upload_pkg::PKG_MAGIC.to_be_bytes()); + pkg[0x74..0x78].copy_from_slice(&0x1Au32.to_be_bytes()); + pkg[0x430..0x438].copy_from_slice(&total.to_be_bytes()); + std::fs::write(path, pkg).unwrap(); + } + + /// The audit's case: a PS4 package cut short reads without an error from its first byte to + /// its last, so only its own header says it is not all there. The check says it is cut + /// short, in the words the screen has for that, and a whole one is fine. + #[test] + fn a_package_shorter_than_its_header_says_is_reported_cut_short() { + let t = Scratch::new("ps4-short"); + let short = t.path().join("short.pkg"); + ps4_package(&short, 0x9000, 0x3000); + let s = checked(&short); + assert_eq!(s.method, "bytes"); + assert_eq!(s.bytes_done, 0x3000, "it is still read to its end"); + assert_eq!(s.problems_total, 1, "{:?}", s.problems); + assert_eq!(s.problems[0].kind, "truncated"); + assert_eq!( + s.damage, + Some(Damage { + kind: "truncated".into(), + bytes_have: 0x3000, + bytes_need: 0x9000, + ..Damage::default() + }) + ); + + let whole = t.path().join("whole.pkg"); + ps4_package(&whole, 0x9000, 0x9000); + let s = checked(&whole); + assert_eq!(s.problems_total, 0, "{:?}", s.problems); + assert_eq!(s.damage, None); + } + + /// The check of a split package: its first file and its later parts. + fn checked_set(lead: &Path, parts: &[&Path]) -> CheckStatus { + let parts: Vec = parts.iter().map(|p| p.display().to_string()).collect(); + let j = job(); + run(&j, lead, "pkg", &parts).unwrap(); + let s = j.status.lock().unwrap().clone(); + s + } + + /// The audit's case: only the first file of a split package was read. Every part is read, + /// in order, as the one package they make; a part that is gone is named. + #[test] + fn every_part_of_a_split_package_is_checked_as_one_package() { + let t = Scratch::new("split"); + let (p0, p1, p2) = ( + t.path().join("Game_0.pkg"), + t.path().join("Game_1.pkg"), + t.path().join("Game_2.pkg"), + ); + // 0x9000 bytes declared, kept as three files of 0x3000. + ps4_package(&p0, 0x9000, 0x3000); + std::fs::write(&p1, vec![1u8; 0x3000]).unwrap(); + std::fs::write(&p2, vec![2u8; 0x3000]).unwrap(); + let s = checked_set(&p0, &[&p1, &p2]); + assert_eq!(s.method, "bytes"); + assert_eq!(s.problems_total, 0, "{:?}", s.problems); + assert_eq!((s.bytes_done, s.bytes_total), (0x9000, 0x9000)); + assert_eq!((s.files_done, s.files_total), (3, 3)); + assert_eq!(s.damage, None); + + // The last part cut short: the first file alone would have read as fine. + std::fs::write(&p2, vec![2u8; 0x1000]).unwrap(); + let s = checked_set(&p0, &[&p1, &p2]); + assert_eq!(s.bytes_done, 0x7000); + let damage = s.damage.expect("the set is shorter than the package says"); + assert_eq!( + (damage.kind.as_str(), damage.bytes_have, damage.bytes_need), + ("truncated", 0x7000, 0x9000) + ); + + // A part the index knows that is not there any more. + std::fs::remove_file(&p1).unwrap(); + let s = checked_set(&p0, &[&p1, &p2]); + let gone: Vec<&Problem> = s + .problems + .iter() + .filter(|p| p.file == "Game_1.pkg") + .collect(); + assert_eq!(gone.len(), 1, "{:?}", s.problems); + assert_eq!(gone[0].error, "this part of the split package is missing"); + assert_eq!((s.files_done, s.files_total), (2, 3)); + assert_eq!( + s.bytes_done, 0x4000, + "the parts that are there are still read" + ); + + // A part missing from the run of names (the index holds parts 0 and 2 only). + let s = checked_set(&p0, &[&p2]); + assert!( + s.problems + .iter() + .any(|p| p.file == "Game_1.pkg" && p.error.contains("is missing")), + "{:?}", + s.problems + ); + } + + #[test] + fn the_numbering_of_a_set_says_which_parts_are_missing() { + let named = |parts: &[&str]| { + let parts: Vec = parts.iter().map(|p| format!("/lib/{p}")).collect(); + missing_from_run(Path::new("/lib/Game_0.pkg"), &parts) + }; + assert!(named(&["Game_1.pkg", "Game_2.pkg"]).is_empty()); + assert_eq!( + named(&["Game_2.pkg", "Game_4.pkg"]), + ["Game_1.pkg", "Game_3.pkg"] + ); + let suffixed = |parts: &[&str]| { + let parts: Vec = parts.iter().map(|p| format!("/lib/{p}")).collect(); + missing_from_run(Path::new("/lib/Game.pkg"), &parts) + }; + assert!(suffixed(&["Game.pkg.0", "Game.pkg.1"]).is_empty()); + assert_eq!(suffixed(&["Game.pkg.1", "Game.pkg.2"]), ["Game.pkg.0"]); + // A name with a wild number is not walked to. + assert!(named(&["Game_4000000000.pkg"]).is_empty()); + } } diff --git a/engine/crates/ps5upload-engine/src/collection_tidy_api.rs b/engine/crates/ps5upload-engine/src/collection_tidy_api.rs index 62810af35..75c6cf739 100644 --- a/engine/crates/ps5upload-engine/src/collection_tidy_api.rs +++ b/engine/crates/ps5upload-engine/src/collection_tidy_api.rs @@ -716,7 +716,7 @@ fn start_plan() -> bool { let Some(turn) = OrganizerTurn::take() else { return false; }; - let watch = Arc::new(organize::PlanWatch::default()); + let watch = Arc::new(organize::PlanWatch::for_preview()); *job.watch.lock().unwrap_or_else(|e| e.into_inner()) = Arc::clone(&watch); *job.status.lock().unwrap_or_else(|e| e.into_inner()) = PlanStatus { running: true, @@ -837,6 +837,28 @@ pub struct OrganizeApplyResult { pub dropped: Vec, pub kept_dirs: Vec, pub logs: Vec, + /// Folders whose moves were made but whose undo log could not be written whole afterwards + /// (each as "folder: why"). What `moved` lists did move; Undo may not put all of it back. + /// Empty when every log was saved. + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub undo_incomplete: Vec, +} + +impl OrganizeApplyResult { + /// Adds what one folder's run did (`at` is the folder as shown, `log_name` its undo log). + /// A run whose log could not be saved afterwards still moved what it moved: that is + /// reported as moved, with the folder listed in `undo_incomplete`. + fn record(&mut self, log: organize::UndoLog, at: &str, log_name: String) { + if let Some(why) = &log.unsaved { + self.undo_incomplete.push(format!("{at}: {why}")); + } + self.moved.extend(log.completed); + self.failed.extend(log.failed); + // Where each is: one name ("old") could be in several containers. + self.kept_dirs + .extend(log.kept_dirs.iter().map(|d| format!("{at}/{d}"))); + self.logs.push(log_name); + } } /// `dir/stem`, or `dir/stem_2`, `_3`, ... when a log by that name exists: two folders with @@ -959,6 +981,11 @@ fn pick_moves( /// POST /api/collection/organize/apply: runs the chosen moves of a preview. It does not plan /// again: the preview already read every package, and over a network that took minutes. A move /// runs only if its file is as the preview saw it and its new name is still free. +/// +/// Answers `{moved, failed, dropped, kept_dirs, logs, undo_incomplete?}`. `moved` is what moved, +/// whatever happened afterwards: when a folder's undo log could not be saved once its moves were +/// made, the folder is listed in `undo_incomplete` (as "folder: why") and Undo may not put all of +/// it back. `dropped` are moves that were left alone. pub async fn post_organize_apply(Json(req): Json) -> Response { let Some(turn) = OrganizerTurn::take() else { return organizer_busy(); @@ -1040,20 +1067,23 @@ pub async fn post_organize_apply(Json(req): Json) -> Response log_path.display() ), ); - out.moved.extend(log.completed); - out.failed.extend(log.failed); - // Where each is: one name ("old") could be in several containers. - let at = label(&c); - out.kept_dirs - .extend(log.kept_dirs.iter().map(|d| format!("{at}/{d}"))); - out.logs.push( - log_path - .file_name() - .unwrap_or_default() - .to_string_lossy() - .into_owned(), - ); + if let Some(why) = &log.unsaved { + crate::engine_log::record( + "warn", + format!( + "collection: the undo log of that run could not be saved \ + afterwards ({why}): Undo may not put everything back" + ), + ); + } + let name = log_path + .file_name() + .unwrap_or_default() + .to_string_lossy() + .into_owned(); + out.record(log, &label(&c), name); } + // The log is written before the first move: nothing in this folder moved. Err(e) => out.dropped.push(format!( "{container}: the undo log could not be written ({e})" )), @@ -1061,8 +1091,22 @@ pub async fn post_organize_apply(Json(req): Json) -> Response } out }) - .await - .unwrap_or_default(); + .await; + let result = match result { + Ok(result) => result, + // The run stopped part way without saying what it did: files may have moved, so the + // Collection is read again and the answer is not "nothing happened". + Err(e) => { + rescan(); + return err( + StatusCode::INTERNAL_SERVER_ERROR, + format!( + "the organizer stopped unexpectedly ({e}); some items may have moved. \ + Check Earlier runs for an Undo" + ), + ); + } + }; if !result.moved.is_empty() { rescan(); } @@ -1206,7 +1250,9 @@ pub struct RevertReq { pub id: String, } -/// POST /api/collection/organize/revert: undoes one run from its log. +/// POST /api/collection/organize/revert: undoes one run from its log. Answers +/// `{reverted, problems, note?}`: `reverted` is what went back, also when the run could not be +/// marked as undone afterwards (`note` then says so). pub async fn post_organize_revert(Json(req): Json) -> Response { // A log name only: never a path. if req.id.contains(['/', '\\']) @@ -1225,7 +1271,11 @@ pub async fn post_organize_revert(Json(req): Json) -> Response { let _turn = turn; let note = same_place(&path).map_err(std::io::Error::other)?; organize::revert(&path, &tree_for).map(|mut r| { - r.note = note; + // Both can be true: where it was undone, and that the log could not be marked. + r.note = match (note, r.note.take()) { + (Some(a), Some(b)) => Some(format!("{a} {b}")), + (a, b) => a.or(b), + }; r }) }) @@ -1976,4 +2026,43 @@ mod tests { assert_eq!(slug(FsPath::new("/x/game fpkgs (old)")), "game-fpkgs--old"); assert_eq!(slug(FsPath::new("/x/★")), "packages"); } + + /// The audit's case: the run moved files and then could not save its undo log. The answer + /// lists what moved (which is what makes the Collection scan again) and says Undo may be + /// incomplete; a run whose log was saved says nothing of the kind. + #[test] + fn a_run_whose_log_could_not_be_saved_still_reports_what_moved() { + let run = |unsaved: Option<&str>| -> organize::UndoLog { + let mut log: organize::UndoLog = serde_json::from_value(serde_json::json!({ + "version": 1, "container_root": "/c", "created_at": "2026-01-01T00:00:00Z", + "moves": [], "kept_dirs": ["old"], + })) + .unwrap(); + log.completed = vec![planned("a.pkg", "x/a.pkg", "")]; + log.unsaved = unsaved.map(str::to_string); + log + }; + let mut out = OrganizeApplyResult::default(); + out.record( + run(Some("No space left on device")), + "/c", + "organize_1_c.json".into(), + ); + assert_eq!(out.moved.len(), 1, "what moved is reported as moved"); + assert!(out.dropped.is_empty(), "not as a move that was left alone"); + assert_eq!(out.undo_incomplete, vec!["/c: No space left on device"]); + assert_eq!(out.kept_dirs, vec!["/c/old"]); + let v = serde_json::to_value(&out).unwrap(); + assert_eq!(v["undo_incomplete"][0], "/c: No space left on device"); + assert_eq!(v["moved"][0]["from"], "a.pkg"); + + let mut saved = OrganizeApplyResult::default(); + saved.record(run(None), "/c", "organize_2_c.json".into()); + assert_eq!(saved.moved.len(), 1); + let v = serde_json::to_value(&saved).unwrap(); + assert!( + v.get("undo_incomplete").is_none(), + "absent when every log was saved" + ); + } } diff --git a/engine/crates/ps5upload-engine/src/download_relay.rs b/engine/crates/ps5upload-engine/src/download_relay.rs index 487908208..665a4b53c 100644 --- a/engine/crates/ps5upload-engine/src/download_relay.rs +++ b/engine/crates/ps5upload-engine/src/download_relay.rs @@ -73,7 +73,10 @@ fn walk_console( continue; } let path = format!("{dir}/{name}"); - let r = format!("{rel}/{name}"); + // One name, as the server takes it: the listing comes from the console, and a + // name holding `/` (or `..` behind a backslash, which a Windows or SMB server + // reads as a separator) would be written outside the folder that was chosen. + let r = remote::path::join(&rel, &name).map_err(remote_err)?; match kind.as_str() { "dir" => stack.push((path, r)), "file" => out.push((path, r, size)), @@ -354,6 +357,33 @@ mod tests { assert_eq!(dirs, ["game", "game/saves", "game/sub"]); } + /// A listing name that would leave the chosen folder fails the walk; an odd but plain one + /// (a backslash inside a name, as some games have) is kept. + #[test] + fn a_listing_name_never_leaves_the_chosen_folder() { + for bad in ["x/../../../../other/f", "..\\..\\f", "a\0b"] { + let r = walk_console("/data/game", |dir, _| { + let page = match dir { + "/data/game" => vec![(bad.to_string(), "file".to_string(), 1)], + _ => Vec::new(), + }; + Ok((page, false)) + }); + assert!(r.is_err(), "{bad:?}: {r:?}"); + } + let (files, _) = walk_console("/data/game", |dir, _| { + let page = match dir { + "/data/game" => { + vec![("options\\gabindings.xml".to_string(), "file".to_string(), 1)] + } + _ => Vec::new(), + }; + Ok((page, false)) + }) + .unwrap(); + assert_eq!(files[0].1, "game/options\\gabindings.xml"); + } + /// A console name Windows cannot hold is staged under another, and an ordinary one as is. #[test] fn a_file_is_staged_under_a_name_this_computer_can_hold() { diff --git a/engine/crates/ps5upload-engine/src/join.rs b/engine/crates/ps5upload-engine/src/join.rs index 7e38a8d36..82c6f7055 100644 --- a/engine/crates/ps5upload-engine/src/join.rs +++ b/engine/crates/ps5upload-engine/src/join.rs @@ -988,6 +988,8 @@ impl Guest { self.seat_note = None; self.playing = true; } + // The pad they had: signed in (or not yet) as it was. + link::OpenResult::Kept => {} other => { self.plays_as = None; self.seat_note = match other { @@ -1328,7 +1330,10 @@ impl Party { g.conn = None; g.away_since = Some(now); if g.slot_open { - fx.push(Effect::Link(link::Cmd::Neutral { slot: g.player })); + fx.push(Effect::Link(link::Cmd::Neutral { + slot: g.player, + token: g.pad_token.clone(), + })); } if g.player == STREAM_SEAT { g.seat_input_at = None; @@ -1365,7 +1370,10 @@ impl Party { } if g.slot_open { g.slot_open = false; - fx.push(Effect::Link(link::Cmd::Close { slot: g.player })); + fx.push(Effect::Link(link::Cmd::Close { + slot: g.player, + token: g.pad_token.clone(), + })); } // (One moving off it already let it go.) if g.player == STREAM_SEAT && g.seat_move == SeatMove::No { @@ -1444,7 +1452,14 @@ impl Party { } /// The bits to take from the guest's input now (None: they are not in). + #[cfg(test)] fn strip_mask(&self, id: u64) -> Option<(u8, u32)> { + self.input_to(id).map(|(slot, strip, _)| (slot, strip)) + } + + /// Where the guest's input goes now: their player, the bits to take from it, and their pad's + /// token (the link takes a state only for the pad that token owns). + fn input_to(&self, id: u64) -> Option<(u8, u32, &str)> { let g = self.guests.iter().find(|g| g.id == id && g.active())?; if g.seat_move != SeatMove::No { return None; // between the stream's controller and their pad: nowhere to go yet @@ -1455,7 +1470,7 @@ impl Party { (true, true) => vpad::button::SYSTEM, (true, false) => vpad::button::CREATE, }; - Some((g.player, strip)) + Some((g.player, strip, &g.pad_token)) } /// A guest's input, before anything is taken from it: while they pick a user, PS then ✕ @@ -1468,11 +1483,13 @@ impl Party { if g.playing { return None; } + // PS first, in an earlier state; ✕ after it picks, whether PS is still down or not. A ✕ + // with PS held used to count as no pick: the guest was signed in with PS never taken. + let had_ps = g.ps_pressed; if buttons & vpad::button::PS != 0 { g.ps_pressed = true; - return None; } - if !(g.ps_pressed && buttons & vpad::button::CROSS != 0) { + if !(had_ps && buttons & vpad::button::CROSS != 0) { return None; } g.playing = true; @@ -1561,7 +1578,10 @@ impl Party { } g.away_since = Some(now); if g.slot_open { - fx.push(Effect::Link(link::Cmd::Neutral { slot: g.player })); + fx.push(Effect::Link(link::Cmd::Neutral { + slot: g.player, + token: g.pad_token.clone(), + })); } } for a in self.pending.drain(..) { @@ -1586,7 +1606,10 @@ impl Party { if gone >= HOST_GRACE { for g in self.guests.iter_mut().filter(|g| g.active() && g.slot_open) { g.slot_open = false; - fx.push(Effect::Link(link::Cmd::Close { slot: g.player })); + fx.push(Effect::Link(link::Cmd::Close { + slot: g.player, + token: g.pad_token.clone(), + })); } } } @@ -1909,7 +1932,13 @@ async fn move_off_seat(console: String, id: u64) -> bool { .is_some(); if !ok { // Out while the pad was made: nobody will close it later. - link::send(&console, link::Cmd::Close { slot: player }); + link::send( + &console, + link::Cmd::Close { + slot: player, + token, + }, + ); return false; } crate::log_at!( @@ -2507,6 +2536,10 @@ enum Admit { New(String, u64), } +/// Guest sockets so far: how the log tells one from another before it is a guest (never by its +/// address or the name it gave: a bug report is posted in public). +static GUEST_SOCKETS: AtomicU64 = AtomicU64::new(1); + pub(crate) async fn guest_session(mut socket: S, ip: IpAddr) { let Some(hello) = read_hello(&mut socket).await else { let _ = socket.send(refused("hello")).await; @@ -2514,11 +2547,17 @@ pub(crate) async fn guest_session(mut socket: S, ip: IpAddr) { }; let name = clean_name(hello.name.as_deref()); let t0 = Instant::now(); + let sock = GUEST_SOCKETS.fetch_add(1, Ordering::Relaxed); // What the guest came with, never the credential itself. crate::log_at!( Debug, "together", - "join: guest {ip} ({name}) says hello: resume={} invite={} code={}", + "join: guest socket {sock} ({}) says hello: resume={} invite={} code={}", + if socket.net().is_some() { + "internet" + } else { + "LAN" + }, hello.resume.as_deref().is_some_and(|t| !t.is_empty()), hello.invite.as_deref().is_some_and(|k| !k.is_empty()), hello.code.as_deref().is_some_and(|c| !c.trim().is_empty()), @@ -2535,11 +2574,18 @@ pub(crate) async fn guest_session(mut socket: S, ip: IpAddr) { admit = None; // their spot is gone, but the invite may still let them in again } } + // Nothing to show is enough only on the home network (the LAN socket, or the engine's own + // signalling): a guest in an internet invite's room got there with a link, and the link's key + // is what a New link or a lapsed invite takes back. Without this an old link still reached + // the host's "wants to play" prompt, under whatever name its holder chose. + let near = socket + .net() + .is_none_or(|n| crate::join_net::local_signal::is_home_room(&n.room)); let entry = match (hello.invite.as_deref(), hello.code.as_deref()) { (Some(k), _) if !k.is_empty() => Some(Entry::Key(k.to_string())), (_, Some(c)) if !c.trim().is_empty() => Some(Entry::Code(normalize_code(c))), // a "Playing nearby" join (the mesh presence): no credential, the host decides - _ if hello.resume.is_none() => Some(Entry::Nearby), + _ if hello.resume.is_none() && near => Some(Entry::Nearby), _ => None, }; let admit = match admit { @@ -2558,7 +2604,7 @@ pub(crate) async fn guest_session(mut socket: S, ip: IpAddr) { crate::log_at!( Debug, "together", - "join: guest {ip} ({name}) refused: {why} after {ms} ms" + "join: guest socket {sock} refused: {why} after {ms} ms" ); let _ = socket.send(refused(why)).await; return; @@ -2567,7 +2613,7 @@ pub(crate) async fn guest_session(mut socket: S, ip: IpAddr) { crate::log_at!( Debug, "together", - "join: guest {ip} ({name}) resumed on {c} after {ms} ms" + "join: guest socket {sock} resumed as guest {id} on {c} after {ms} ms" ); (c, id) } @@ -2575,7 +2621,7 @@ pub(crate) async fn guest_session(mut socket: S, ip: IpAddr) { crate::log_at!( Debug, "together", - "join: guest {ip} ({name}) let in on {c} after {ms} ms" + "join: guest socket {sock} let in as guest {id} on {c} after {ms} ms" ); (c, id) } @@ -2737,7 +2783,13 @@ async fn resume(socket: &mut S, token: &str) -> Option { .flatten() .is_some(); if !ok { - link::send(&console, link::Cmd::Close { slot: player }); + link::send( + &console, + link::Cmd::Close { + slot: player, + token, + }, + ); return Some(Admit::Refused("expired")); } } @@ -2803,7 +2855,7 @@ async fn open_slot( // busy slot is another owner's). link::send( console, - link::Cmd::Abandon { + link::Cmd::Close { slot, token: token.to_string(), }, @@ -2887,8 +2939,11 @@ async fn ask( return Some(Admit::Refused(why)); } // By number in the log: a bug report is posted in public, and names are the host's friends. - crate::log_at!(Info, "together", "join: a guest asks to play on {console}"); - crate::log_at!(Debug, "together", "join: {name} asks to play on {console}"); + crate::log_at!( + Info, + "together", + "join: ask {id}: a guest asks to play on {console}" + ); if socket .send(say(serde_json::json!({"stage": "asking"}))) .await @@ -2908,7 +2963,7 @@ async fn ask( crate::log_at!( Debug, "together", - "join: {name}'s ask on {console}: {} after {} ms", + "join: ask {id} on {console}: {} after {} ms", if gave_up { "the guest gave up".to_string() } else { @@ -2958,12 +3013,7 @@ async fn ask( crate::log_at!( Info, "together", - "join: a guest has the stream's controller on {console}" - ); - crate::log_at!( - Debug, - "together", - "join: {name} has the stream's controller on {console}" + "join: guest {gid} has the stream's controller on {console}" ); return Some(Admit::New(console, gid)); } @@ -2983,18 +3033,19 @@ async fn ask( .flatten() .is_some(); if !ok { - link::send(&console, link::Cmd::Close { slot: player }); + link::send( + &console, + link::Cmd::Close { + slot: player, + token: pad_token, + }, + ); return Some(Admit::Refused("closed")); } crate::log_at!( Info, "together", - "join: a guest is Player {player} on {console}" - ); - crate::log_at!( - Debug, - "together", - "join: {name} is Player {player} on {console}" + "join: guest {gid} is Player {player} on {console}" ); return Some(Admit::New(console, gid)); } @@ -3016,29 +3067,39 @@ async fn ask( /// Holds a guest's pad frames to [`PAD_RATE`] (bursts of [`PAD_BURST`]): one over it waits as the /// latest (a newer one replaces it), so a flooding guest costs the link what a normal one does. -struct PadPacer { +/// A linked phone's input has its own (pad_link.rs). +pub(crate) struct PadPacer { tokens: f64, at: Instant, held: Option, + rate: f64, + burst: f64, } impl PadPacer { fn new(now: Instant) -> Self { + Self::with_rate(PAD_RATE, PAD_BURST, now) + } + + /// `rate` a second on average, bursts of `burst`. + pub(crate) fn with_rate(rate: f64, burst: f64, now: Instant) -> Self { PadPacer { - tokens: PAD_BURST, + tokens: burst, at: now, held: None, + rate, + burst, } } fn refill(&mut self, now: Instant) { let dt = now.saturating_duration_since(self.at).as_secs_f64(); - self.tokens = (self.tokens + dt * PAD_RATE).min(PAD_BURST); + self.tokens = (self.tokens + dt * self.rate).min(self.burst); self.at = now; } /// A frame: back to send now, or None (it is held as the latest). - fn offer(&mut self, now: Instant, v: T) -> Option { + pub(crate) fn offer(&mut self, now: Instant, v: T) -> Option { self.refill(now); if self.held.is_none() && self.tokens >= 1.0 { self.tokens -= 1.0; @@ -3049,14 +3110,14 @@ impl PadPacer { } /// When the held frame may go. - fn due(&self) -> Option { + pub(crate) fn due(&self) -> Option { self.held.as_ref()?; - let wait = ((1.0 - self.tokens).max(0.0) / PAD_RATE).min(1.0); + let wait = ((1.0 - self.tokens).max(0.0) / self.rate).min(1.0); Some(self.at + Duration::from_secs_f64(wait)) } /// The held frame, once it may go. - fn take(&mut self, now: Instant) -> Option { + pub(crate) fn take(&mut self, now: Instant) -> Option { self.refill(now); if self.held.is_some() && self.tokens >= 1.0 { self.tokens -= 1.0; @@ -3123,8 +3184,12 @@ fn forward_pad(key: &str, console: &str, id: u64, gen: u64, mut st: PadState) { if p.is_current(id, gen) { said = p.saw_input(id, st.buttons); } - let m = p.is_current(id, gen).then(|| p.strip_mask(id)).flatten(); - if let Some((STREAM_SEAT, _)) = m { + let m = p + .is_current(id, gen) + .then(|| p.input_to(id)) + .flatten() + .map(|(slot, strip, token)| (slot, strip, token.to_string())); + if let Some((STREAM_SEAT, ..)) = m { if let Some(g) = p.guest_mut(id) { g.seat_input_at = Some(now); } @@ -3134,12 +3199,19 @@ fn forward_pad(key: &str, console: &str, id: u64, gen: u64, mut st: PadState) { if let Some(line) = said { crate::log_at!(Info, "together", "{line}"); } - if let Some((slot, strip)) = mask.flatten() { + if let Some((slot, strip, token)) = mask.flatten() { st.buttons &= !strip; if slot == STREAM_SEAT { crate::rp_stream_api::push_guest_pad(console, Some(controller_state(&st))); } else { - link::send(console, link::Cmd::State { slot, state: st }); + link::send( + console, + link::Cmd::State { + slot, + token, + state: st, + }, + ); } } } @@ -3790,7 +3862,15 @@ pub async fn invite( let key = host_key(&b.addr); match with_party(&key, |p| { let inv = p.invite(b.new, now); - if internet && inv.is_some() && p.internet.as_ref().is_none_or(|r| r.url() != s.hub_url) { + // A room that closed by itself (the invite before this one lapsed with no internet guest + // in) is gone for good: this invite gets a new one. Kept, it left every later invite on + // the home network's link until Play Together was closed and opened again. + if internet + && inv.is_some() + && p.internet + .as_ref() + .is_none_or(|r| r.url() != s.hub_url || r.ended()) + { let k = key.clone(); p.internet = crate::join_net::hub::Room::start( crate::join_net::Kind::Join, @@ -4322,6 +4402,11 @@ pub(crate) mod link { /// The pad is there, but the profile the host chose could not be given to it: the console /// asks who it is, as without a choice. Why: [`Unseated`] notes. Unseated(&'static str), + /// The pad is there, and was already: the helper still had it for this token (a close + /// that never reached it, the helper unreachable then). It is the same pad, with whoever + /// the console signed in on it: the guest's picking stands as it was (a pad treated as new + /// gave a guest signed in on it their PS button back). + Kept, /// Another owner holds the slot. Busy, /// The helper has no Play Together. @@ -4334,14 +4419,17 @@ pub(crate) mod link { pub(crate) fn is_ok(&self) -> bool { matches!( self, - OpenResult::Ok | OpenResult::Seated(_) | OpenResult::Unseated(_) + OpenResult::Ok | OpenResult::Seated(_) | OpenResult::Unseated(_) | OpenResult::Kept ) } /// The guest's refusal for it. pub(crate) fn why(&self) -> &'static str { match self { - OpenResult::Ok | OpenResult::Seated(_) | OpenResult::Unseated(_) => "ok", + OpenResult::Ok + | OpenResult::Seated(_) + | OpenResult::Unseated(_) + | OpenResult::Kept => "ok", OpenResult::Busy => "full", OpenResult::OldHelper => "old_helper", OpenResult::Failed(_) => "unreachable", @@ -4392,14 +4480,18 @@ pub(crate) mod link { bind: Option, reply: oneshot::Sender, }, - /// The guest's latest state. - State { slot: u8, state: PadState }, + /// The guest's latest state. Like every command about a pad, for the pad `token` owns + /// only: a guest let go (kicked) can have one on its way still, and the slot may be the + /// next guest's by then. + State { + slot: u8, + token: String, + state: PadState, + }, /// Let go of everything (the guest's socket closed). - Neutral { slot: u8 }, - /// Remove the pad. - Close { slot: u8 }, - /// Remove the pad if `token` still owns it (an open its guest stopped waiting for). - Abandon { slot: u8, token: String }, + Neutral { slot: u8, token: String }, + /// Remove the pad (its guest left, or an open its guest stopped waiting for). + Close { slot: u8, token: String }, } /// What the link tells join.rs. @@ -4518,6 +4610,9 @@ pub(crate) mod link { note: Option<&'static str>, /// The pad is seated in `want`'s user. seated: bool, + /// Its last open found the pad still there for this token (`resumed`): see + /// [`OpenResult::Kept`]. + kept: bool, /// A seat the helper said is starting is asked again until this. bind_until: Option, /// The next open no sooner than this. @@ -4547,6 +4642,7 @@ pub(crate) mod link { try_bind: want.is_some(), note: None, seated: false, + kept: false, bind_until: None, open_at: now, waiters: Vec::new(), @@ -4566,6 +4662,7 @@ pub(crate) mod link { fn result(&self) -> OpenResult { match (self.want, self.seated, self.note) { (Some(b), true, _) => OpenResult::Seated(b.user), + _ if self.kept => OpenResult::Kept, (Some(_), false, note) => OpenResult::Unseated(note.unwrap_or(unseated::FAILED)), (None, ..) => OpenResult::Ok, } @@ -4652,22 +4749,21 @@ pub(crate) mod link { s.waiters.push(reply); self.slots.insert(slot, s); } - Cmd::State { slot, state } => { - if let Some(s) = self.slots.get_mut(&slot) { + Cmd::State { slot, token, state } => { + if let Some(s) = self.slots.get_mut(&slot).filter(|s| s.token == token) { s.io.push(state); s.last_input = now; s.live = true; } } - Cmd::Neutral { slot } => { - if let Some(s) = self.slots.get_mut(&slot) { + Cmd::Neutral { slot, token } => { + if let Some(s) = self.slots.get_mut(&slot).filter(|s| s.token == token) { s.io.push(PadState::NEUTRAL); s.last_input = now; s.live = false; } } - Cmd::Close { slot } => self.remove(slot), - Cmd::Abandon { slot, token } => { + Cmd::Close { slot, token } => { if self.slots.get(&slot).is_some_and(|s| s.token == token) { self.remove(slot); } @@ -4747,6 +4843,7 @@ pub(crate) mod link { && (o.resumed == Some(false) || (o.resumed.is_none() && s.handle != Some(o.handle))); s.opened = true; + s.kept = o.resumed == Some(true); s.refused_since = None; s.handle = Some(o.handle); s.last_call = now; @@ -5590,8 +5687,8 @@ mod tests { fn links(fx: &[Effect]) -> Vec { fx.iter() .filter_map(|e| match e { - Effect::Link(Cmd::Close { slot }) => Some(format!("close{slot}")), - Effect::Link(Cmd::Neutral { slot }) => Some(format!("neutral{slot}")), + Effect::Link(Cmd::Close { slot, .. }) => Some(format!("close{slot}")), + Effect::Link(Cmd::Neutral { slot, .. }) => Some(format!("neutral{slot}")), Effect::Link(_) => Some("other".into()), _ => None, }) @@ -5794,6 +5891,53 @@ mod tests { assert_eq!(p.strip_mask(id), None); } + /// Their pad found as it was (a close the helper never got): the same pad, still signed in. PS + /// stays off for a guest who picked (a pad taken for a new one gave it back), and one still + /// picking goes on picking. + #[test] + fn a_kept_pad_keeps_the_guests_ps_as_it_was() { + let mut p = party(); + let t = Instant::now(); + let id = admit(&mut p, "A", t); + let (tx, _rx) = conn(); + p.attach(id, 1, tx); + p.guest_mut(id) + .unwrap() + .pad_made(&OpenResult::Kept, Some(None)); + assert_eq!(p.strip_mask(id), Some((2, vpad::button::CREATE))); + assert_eq!(p.saw_input(id, vpad::button::PS), None); + assert!(p.saw_input(id, vpad::button::CROSS).is_some()); + assert_eq!(p.strip_mask(id), Some((2, vpad::button::SYSTEM))); + p.guest_mut(id) + .unwrap() + .pad_made(&OpenResult::Kept, Some(None)); + assert_eq!(p.strip_mask(id), Some((2, vpad::button::SYSTEM))); + assert_eq!(p.saw_input(id, vpad::button::PS), None, "nothing to pick"); + } + + /// A guest who keeps PS down while pressing ✕ on "Who's using this controller?" has picked a + /// user like any other: PS is off for them after it. (It counted as no pick, so they were + /// signed in with a PS button that still worked.) + #[test] + fn a_pick_with_ps_still_held_turns_ps_off_too() { + let mut p = party(); + let t = Instant::now(); + let id = admit(&mut p, "A", t); + let (tx, _rx) = conn(); + p.attach(id, 1, tx); + let ps = vpad::button::PS; + let cross = vpad::button::CROSS; + // Both at once, with no PS before: PS only just went down, the picker is not up yet. + assert_eq!(p.saw_input(id, ps | cross), None); + assert_eq!(p.strip_mask(id), Some((2, vpad::button::CREATE))); + assert_eq!(p.saw_input(id, ps), None); + assert!( + p.saw_input(id, ps | cross).is_some(), + "PS, then ✕ with PS still down" + ); + assert_eq!(p.strip_mask(id), Some((2, vpad::button::SYSTEM))); + } + #[test] fn the_host_stopping_tells_everyone_then_closes_unless_they_play_again() { let mut p = party(); @@ -6160,6 +6304,8 @@ mod tests { log: Mutex>, states: Mutex>, handle: AtomicI64, + /// The slots it has a pad for (a close that reached it removes one). + pads: Mutex>, /// The next open is a new pad (a restarted helper). restarted: AtomicBool, down: AtomicBool, @@ -6252,9 +6398,9 @@ mod tests { })); } *self.not_open.lock().unwrap() = None; - // the first open, or one after a restart, makes a new pad + // the slot's first open, one after its close, or one after a restart makes a new pad let fresh = self.restarted.swap(false, Ordering::Relaxed) - || self.handle.load(Ordering::Relaxed) == 0; + | self.pads.lock().unwrap().insert(slot); if fresh { self.handle.fetch_add(1, Ordering::Relaxed); } @@ -6343,6 +6489,7 @@ mod tests { fn close(&self, _h: &str, slot: u8, _t: &str) -> anyhow::Result> { self.up()?; self.log.lock().unwrap().push(format!("close{slot}")); + self.pads.lock().unwrap().remove(&slot); Ok(Some(Ack { ok: true, ..Default::default() @@ -6413,6 +6560,109 @@ mod tests { rx } + /// A guest let go (kicked) with a state still on its way, and Player 2 the next guest's by + /// the time it arrives: that state, the let-go after it and a second close are the old + /// guest's, not the new one's (they went by the slot alone). + #[test] + fn a_guests_late_commands_never_reach_the_next_guest_on_their_slot() { + let f = Arc::new(FakeHelper::default()); + let (mut st, _ev) = link_with(&f); + let t = Instant::now(); + assert_eq!( + open_slot_t(&mut st, 2, "a", t).try_recv().unwrap(), + OpenResult::Ok + ); + let state = |token: &str, b: u32| Cmd::State { + slot: 2, + token: token.into(), + state: st_(b), + }; + st.on_cmd(state("a", 0x20), t); + st.tick(t); + st.on_cmd( + Cmd::Close { + slot: 2, + token: "a".into(), + }, + t, + ); + assert_eq!( + open_slot_t(&mut st, 2, "b", t).try_recv().unwrap(), + OpenResult::Ok + ); + let sent = f.states().len(); + st.on_cmd(state("a", 0x40), t); + st.on_cmd( + Cmd::Neutral { + slot: 2, + token: "a".into(), + }, + t, + ); + st.on_cmd( + Cmd::Close { + slot: 2, + token: "a".into(), + }, + t, + ); + let t = t + Duration::from_millis(50); + st.tick(t); + assert_eq!(f.states().len(), sent, "nothing of a's reaches b's pad"); + assert_eq!( + f.log().iter().filter(|l| *l == "close2").count(), + 1, + "b's pad stays: {:?}", + f.log() + ); + st.on_cmd(state("b", 0x80), t); + st.tick(t); + let last = f.states().last().cloned().unwrap(); + assert_eq!((last.token.as_str(), last.state.buttons), ("b", 0x80)); + } + + /// The helper unreachable when a pad's close was sent: the close is lost, and the next open + /// with the same token finds the pad still there. Kept (the console has it signed in as it + /// was), not a new pad; after a close that reached it, a new one. + #[test] + fn a_pad_whose_close_was_lost_opens_as_kept_not_new() { + let f = Arc::new(FakeHelper::default()); + let (mut st, ev) = link_with(&f); + let t = Instant::now(); + assert_eq!( + open_slot_t(&mut st, 2, "a", t).try_recv().unwrap(), + OpenResult::Ok + ); + f.down.store(true, Ordering::Relaxed); + st.on_cmd( + Cmd::Close { + slot: 2, + token: "a".into(), + }, + t, + ); + st.tick(t); + f.down.store(false, Ordering::Relaxed); + let t = t + Duration::from_secs(1); + assert_eq!( + open_slot_t(&mut st, 2, "a", t).try_recv().unwrap(), + OpenResult::Kept + ); + assert_eq!(reopens(&ev), 0); + st.on_cmd( + Cmd::Close { + slot: 2, + token: "a".into(), + }, + t, + ); + st.tick(t); + assert_eq!( + open_slot_t(&mut st, 2, "a", t).try_recv().unwrap(), + OpenResult::Ok + ); + } + #[test] fn a_pad_opens_states_go_in_one_call_and_heartbeats_say_whether_the_guest_is_there() { let f = Arc::new(FakeHelper::default()); @@ -6430,6 +6680,7 @@ mod tests { st.on_cmd( Cmd::State { slot: 2, + token: "a".into(), state: st_(0x20), }, t, @@ -6437,6 +6688,7 @@ mod tests { st.on_cmd( Cmd::State { slot: 3, + token: "b".into(), state: st_(0x40), }, t, @@ -6451,11 +6703,18 @@ mod tests { st.on_cmd( Cmd::State { slot: 2, + token: "a".into(), state: st_(0x20), }, t2, ); - st.on_cmd(Cmd::Neutral { slot: 3 }, t2); + st.on_cmd( + Cmd::Neutral { + slot: 3, + token: "b".into(), + }, + t2, + ); st.tick(t2); let log = f.log(); assert!(log.contains(&"hb2live".to_string()), "{log:?}"); @@ -6465,6 +6724,7 @@ mod tests { st.on_cmd( Cmd::State { slot: 2, + token: "a".into(), state: st_(0x20), }, t3, @@ -6490,6 +6750,7 @@ mod tests { st.on_cmd( Cmd::State { slot: 2, + token: "a".into(), state: held.clone(), }, t, @@ -6503,6 +6764,7 @@ mod tests { st.on_cmd( Cmd::State { slot: 2, + token: "a".into(), state: held.clone(), }, t2, @@ -6513,6 +6775,7 @@ mod tests { st.on_cmd( Cmd::State { slot: 2, + token: "a".into(), state: held.clone(), }, t3, @@ -6530,6 +6793,7 @@ mod tests { st.on_cmd( Cmd::State { slot: 2, + token: "a".into(), state: ps(0, 255), }, t, @@ -6552,6 +6816,7 @@ mod tests { st.on_cmd( Cmd::State { slot: 2, + token: "a".into(), state: st_(0x20), }, t, @@ -6559,6 +6824,7 @@ mod tests { st.on_cmd( Cmd::State { slot: 2, + token: "a".into(), state: st_(0), }, t, @@ -6581,6 +6847,7 @@ mod tests { st.on_cmd( Cmd::State { slot: 2, + token: "a".into(), state: st_(0x20), }, t, @@ -6591,6 +6858,7 @@ mod tests { st.on_cmd( Cmd::State { slot: 2, + token: "a".into(), state: st_(0x40), }, t, @@ -6861,6 +7129,7 @@ mod tests { st.on_cmd( Cmd::State { slot: 2, + token: "a".into(), state: st_(0x40), }, t, @@ -6951,6 +7220,7 @@ mod tests { st.on_cmd( Cmd::State { slot: 2, + token: "a".into(), state: st_(0x20), }, t, @@ -6990,6 +7260,7 @@ mod tests { st.on_cmd( Cmd::State { slot: 2, + token: "a".into(), state: st_(0x40), }, t, @@ -7012,6 +7283,7 @@ mod tests { st.on_cmd( Cmd::State { slot: 2, + token: "a".into(), state: st_(0x80), }, now, @@ -7060,7 +7332,13 @@ mod tests { .unwrap(); assert!(!link::try_end(&mut st, &rx, key, 77, t), "a pad to serve"); assert!(link::test_has_link(key), "still reachable for its Close"); - st.on_cmd(Cmd::Close { slot: 2 }, t); + st.on_cmd( + Cmd::Close { + slot: 2, + token: "a".into(), + }, + t, + ); st.tick(t); assert!(st.idle()); assert!(link::try_end(&mut st, &rx, key, 77, t)); @@ -7145,6 +7423,7 @@ mod tests { st.on_cmd( Cmd::State { slot: 2, + token: "a".into(), state: odd, }, t, @@ -7152,6 +7431,7 @@ mod tests { st.on_cmd( Cmd::State { slot: 3, + token: "b".into(), state: st_(0x40), }, t, @@ -7159,6 +7439,7 @@ mod tests { st.on_cmd( Cmd::State { slot: 4, + token: "c".into(), state: st_(0x80), }, t, @@ -7192,6 +7473,7 @@ mod tests { st.on_cmd( Cmd::State { slot: 2, + token: "a".into(), state: odd, }, ti, @@ -7237,7 +7519,7 @@ mod tests { // an abandon only removes the pad its token owns open_slot_t(&mut st, 3, "b", t); st.on_cmd( - Cmd::Abandon { + Cmd::Close { slot: 3, token: "someone-else".into(), }, @@ -7246,7 +7528,7 @@ mod tests { st.tick(t); assert!(!st.idle()); st.on_cmd( - Cmd::Abandon { + Cmd::Close { slot: 3, token: "b".into(), }, @@ -7280,7 +7562,13 @@ mod tests { let (mut st, _ev) = link_with(&f); let t = Instant::now(); open_slot_t(&mut st, 2, "a", t); - st.on_cmd(Cmd::Close { slot: 2 }, t); + st.on_cmd( + Cmd::Close { + slot: 2, + token: "a".into(), + }, + t, + ); st.tick(t); assert!(f.log().contains(&"close2".to_string())); assert!(st.idle()); diff --git a/engine/crates/ps5upload-engine/src/join_net/hub.rs b/engine/crates/ps5upload-engine/src/join_net/hub.rs index 4512d9065..b1c0dfc4e 100644 --- a/engine/crates/ps5upload-engine/src/join_net/hub.rs +++ b/engine/crates/ps5upload-engine/src/join_net/hub.rs @@ -9,6 +9,11 @@ //! ping goes every 20 s. A dropped connection is made again with backoff, with the same room and //! secret (the hub gives the room back). The room closes when the invite does: Play Together //! closed, or the invite expired with nobody from the internet still in. +//! +//! The room id is made from the secret (`ps5upload_hub::hub::room_for_secret`), so a hub opens it +//! for this engine only, also when it has just restarted and has no rooms: before, anyone with the +//! link could open the room first with a secret of their own. A hub from before that takes the id +//! as any other. use std::sync::{Arc, Mutex}; use std::time::Duration; @@ -57,13 +62,16 @@ struct St { } pub(crate) struct Shared { - id: Mutex, - secret: String, + /// The room id and the secret it is made from ([`new_keys`]), changed together. + keys: Mutex<(String, String)>, url: String, kind: Kind, st: Mutex, /// When the room was asked for (how long the hub has had to answer). started: std::time::Instant, + /// The room's task is over (nobody wanted it any more, or there was no network for it): this + /// room never hosts again, and whoever still holds it starts another when one is wanted. + ended: std::sync::atomic::AtomicBool, } /// The hub not hosting the room this long after it was asked for (or a failed connect): the @@ -74,9 +82,23 @@ pub(crate) const OFFLINE_AFTER: Duration = Duration::from_secs(if cfg!(test) { 2 /// Whether the room is still wanted (asked every few seconds and before each connect). pub(crate) type Wanted = Box bool + Send + Sync>; +/// A new secret and the room id made from it: the hub opens a room of that id for that secret +/// only (`ps5upload_hub::hub::room_for_secret`). +fn new_keys() -> Option<(String, String)> { + let secret = super::random_b64(32)?; + Some((ps5upload_hub::hub::room_for_secret(&secret), secret)) +} + impl Shared { fn id(&self) -> String { - self.id.lock().unwrap_or_else(|e| e.into_inner()).clone() + self.keys + .lock() + .unwrap_or_else(|e| e.into_inner()) + .0 + .clone() + } + fn keys(&self) -> (String, String) { + self.keys.lock().unwrap_or_else(|e| e.into_inner()).clone() } fn set(&self, state: &'static str, error: Option) { let mut g = self.st.lock().unwrap_or_else(|e| e.into_inner()); @@ -100,8 +122,7 @@ impl Room { /// Opens a room of `kind` on the hub at `url`, kept while `wanted` says so (and this lives). pub(crate) fn start(kind: Kind, wanted: Wanted, url: String) -> Option { let shared = Arc::new(Shared { - id: Mutex::new(super::random_b64(16)?), - secret: super::random_b64(32)?, + keys: Mutex::new(new_keys()?), url, kind, st: Mutex::new(St { @@ -111,9 +132,14 @@ impl Room { connects: 0, }), started: std::time::Instant::now(), + ended: std::sync::atomic::AtomicBool::new(false), }); let (stop, stop_rx) = watch::channel(()); - tokio::spawn(run(shared.clone(), wanted, stop_rx)); + let task = shared.clone(); + tokio::spawn(async move { + run(task.clone(), wanted, stop_rx).await; + task.ended.store(true, std::sync::atomic::Ordering::Relaxed); + }); Some(Room { shared, _stop: stop, @@ -128,6 +154,12 @@ impl Room { &self.shared.url } + /// The room closed by itself (its invite lapsed with nobody in, or it had no network): it + /// does not come back. An invite made after that needs a new room. + pub(crate) fn ended(&self) -> bool { + self.shared.ended.load(std::sync::atomic::Ordering::Relaxed) + } + /// The hub can't be reached: not hosting the room now, and a connect failed or it has had /// [`OFFLINE_AFTER`] to. The host's page then shares the home network's link (works on the /// Wi-Fi only) until the hub hosts the room again. @@ -282,8 +314,8 @@ async fn session( stop: &mut watch::Receiver<()>, backoff: &mut Duration, ) -> End { - let room = shared.id(); - let hello = serde_json::json!({"v": 1, "t": "host", "room": room, "secret": shared.secret}); + let (room, secret) = shared.keys(); + let hello = serde_json::json!({"v": 1, "t": "host", "room": room, "secret": secret}); if ws.send(frame(hello)).await.is_err() { return End::Again; } @@ -357,10 +389,10 @@ async fn session( crate::log_at!(Debug, "together", "join: the hub says {why}"); let hosted_once = shared.st.lock().unwrap_or_else(|e| e.into_inner()).hosted_once; if why == "room_taken" && !hosted_once { - // Someone else's room by that name: another name, before anyone - // has the link. - if let Some(id) = super::random_b64(16) { - *shared.id.lock().unwrap_or_else(|e| e.into_inner()) = id; + // Someone else's room by that name (on a hub that takes any id + // with any secret): another name, before anyone has the link. + if let Some(keys) = new_keys() { + *shared.keys.lock().unwrap_or_else(|e| e.into_inner()) = keys; return End::Now; } } @@ -426,4 +458,18 @@ mod backoff_tests { assert!(seen.len() > 10, "spread out"); assert!(BACKOFF_MAX <= Duration::from_secs(5)); } + + /// The room id is made from the secret, so the hub opens it for this engine only; still the + /// form every hub takes (22 base64url characters, a 43-character secret). + #[test] + fn a_room_id_is_made_from_its_secret() { + let (room, secret) = new_keys().unwrap(); + assert_eq!((room.len(), secret.len()), (22, 43)); + assert!(room + .chars() + .all(|c| c.is_ascii_alphanumeric() || c == '-' || c == '_')); + assert_eq!(room, ps5upload_hub::hub::room_for_secret(&secret)); + assert!(ps5upload_hub::hub::is_bound_room(&room)); + assert_ne!(new_keys().unwrap(), (room, secret)); + } } diff --git a/engine/crates/ps5upload-engine/src/join_net/join_tests.rs b/engine/crates/ps5upload-engine/src/join_net/join_tests.rs index b468bb7b4..9a9f202a5 100644 --- a/engine/crates/ps5upload-engine/src/join_net/join_tests.rs +++ b/engine/crates/ps5upload-engine/src/join_net/join_tests.rs @@ -409,6 +409,176 @@ async fn an_app_guest_signals_the_internet_invite_to_the_engine_without_the_hub( set_live(console, 0); } +/// The engine's own signalling socket takes a bounded number of signals, as the hub does: it +/// needs no key, and each offer on it is a peer connection the driver builds. One that sends more +/// is told so and closed, long before the socket's own time is up. +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn the_engines_signalling_socket_takes_a_bounded_number_of_signals() { + use futures_util::{SinkExt, StreamExt}; + use tokio_tungstenite::tungstenite::Message as TMsg; + let _turn = PARTY_TESTS.lock().await; + *SETTINGS.lock().unwrap_or_else(|e| e.into_inner()) = Some(Settings { + internet_invites: false, + stun: Vec::new(), + upnp: false, + ..Settings::default() + }); + let console = "10.77.0.52"; + set_helper(console, Arc::new(FakeHelper::default())); + set_live(console, 1); + open_party(console).await; + let signal = serve().await.replace("/api/join/ws", "/api/join/signal"); + let (mut ws, _) = tokio_tungstenite::connect_async(&signal).await.unwrap(); + ws.send(TMsg::Text(r#"{"v":1,"t":"join","lan":true}"#.into())) + .await + .unwrap(); + let max = crate::join_net::local_signal::SIGNALS_MAX; + let candidate = serde_json::json!({ + "v": 1, "t": "signal", "to": "host", + "data": {"type": "candidate", "candidate": "candidate:1 1 udp 1 192.0.2.1 9 typ host"}, + }) + .to_string(); + for _ in 0..max + 1 { + // The socket may close under the last ones. + if ws.send(TMsg::Text(candidate.clone().into())).await.is_err() { + break; + } + } + let mut said = false; + let closed = tokio::time::timeout(Duration::from_secs(5), async { + while let Some(Ok(m)) = ws.next().await { + match m { + TMsg::Text(t) => said |= t.as_str() == r#"{"t":"error","why":"rate_limited"}"#, + TMsg::Close(_) => break, + _ => {} + } + } + }) + .await; + assert!(closed.is_ok(), "the socket stayed open past its signals"); + assert!(said, "told why"); + close_party(console).await; + *SETTINGS.lock().unwrap_or_else(|e| e.into_inner()) = None; + set_live(console, 0); +} + +/// An internet invite's room takes no hello without the invite. A hello with no key and no code +/// asks the host on the home network (a "Playing nearby" join); in a hub room it used to as well, +/// so a link the host had replaced with New link still put its holder in front of the host, +/// under any name. +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn an_internet_room_takes_no_hello_without_the_current_invite() { + let _turn = PARTY_TESTS.lock().await; + let hub = FakeHub::start().await; + *SETTINGS.lock().unwrap_or_else(|e| e.into_inner()) = Some(Settings { + hub_url: hub.url.clone(), + stun: Vec::new(), + upnp: false, + ..Settings::default() + }); + let console = "10.77.0.53"; + set_helper(console, Arc::new(FakeHelper::default())); + set_live(console, 1); + open_party(console).await; + let inv = internet_invite(console).await; + let room = inv["internet"]["room"].as_str().unwrap().to_string(); + let old = inv["key"].as_str().unwrap().to_string(); + until("hosted", || hub.has_host(&room)).await; + + let mut g = connect_guest(&hub.url, &room).await; + g.text(serde_json::json!({"hello": {"name": "Someone"}})); + let v = g.next_with("stage").await; + assert_eq!((&v["stage"], &v["why"]), (&"refused".into(), &"key".into()), "{v}"); + + // New link: the old link's key is no way in either (its room is still the invite's). + let (ci, h) = local(); + let new = body( + invite( + ci, + h, + Json(InviteBody { + addr: console.into(), + new: true, + internet: true, + share: false, + }), + ) + .await, + ) + .await; + assert_ne!(new["key"], old.as_str()); + let mut g = connect_guest(&hub.url, &room).await; + g.text(serde_json::json!({"hello": {"invite": old, "name": "Old link"}})); + let v = g.next_with("stage").await; + assert_eq!((&v["stage"], &v["why"]), (&"refused".into(), &"key".into()), "{v}"); + assert_eq!( + host_state(console).await["pending"], + serde_json::json!([]), + "nobody was put in front of the host" + ); + + // The home network's own join still may ask with nothing: the host decides. + let signal = serve().await.replace("/api/join/ws", "/api/join/signal"); + let mut near = crate::join_net::tests::connect_guest_lan(&signal, false).await; + near.text(serde_json::json!({"hello": {"name": "Near"}})); + assert_eq!(near.next_with("stage").await["stage"], "asking"); + allow_next(console, false).await; + + close_party(console).await; + *SETTINGS.lock().unwrap_or_else(|e| e.into_inner()) = None; + set_live(console, 0); +} + +/// An invite lasts half an hour. When one lapses with no internet guest in, its room on the hub +/// closes; the next invite gets a room again. (It kept the closed one, so every later invite was +/// the home network's link, "offline", until Play Together was closed and opened again.) +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn an_invite_after_a_lapsed_one_gets_a_room_again() { + let _turn = PARTY_TESTS.lock().await; + let hub = FakeHub::start().await; + *SETTINGS.lock().unwrap_or_else(|e| e.into_inner()) = Some(Settings { + hub_url: hub.url.clone(), + stun: Vec::new(), + upnp: false, + ..Settings::default() + }); + let console = "10.77.0.54"; + set_helper(console, Arc::new(FakeHelper::default())); + set_live(console, 1); + open_party(console).await; + let inv = internet_invite(console).await; + let room = inv["internet"]["room"].as_str().unwrap().to_string(); + until("hosted", || hub.has_host(&room)).await; + + // The invite lapses (as after its half hour): nobody is in, so the room closes. + let key = host_key(console); + with_party(&key, |p| { + if let Some(i) = p.invite.as_mut() { + i.until = Instant::now(); + } + }); + until("the room closed", || !hub.has_host(&room)).await; + until("its task over", || { + with_party(&key, |p| p.internet.as_ref().is_some_and(|r| r.ended())).unwrap_or(false) + }) + .await; + + // The host's panel asks for the next invite: a new room, hosted. + let next = internet_invite(console).await; + let room2 = next["internet"]["room"].as_str().unwrap().to_string(); + assert_ne!(room2, room, "{next}"); + until("hosted again", || hub.has_host(&room2)).await; + let s = until_state(console, "the internet link", |s| { + s["invite"]["internet"]["state"] == "hosted" + }) + .await; + assert_eq!(s["invite"]["internet"]["offline"], false, "{s}"); + + close_party(console).await; + *SETTINGS.lock().unwrap_or_else(|e| e.into_inner()) = None; + set_live(console, 0); +} + /// A guest on the home network with the Wi-Fi's own link (no internet invite, no hub at all) /// joins over WebRTC signalled on the engine's socket: the link carries the engine's /// certificate, the answer has it, the invite key goes in the hello on the channel, the picture diff --git a/engine/crates/ps5upload-engine/src/join_net/local_signal.rs b/engine/crates/ps5upload-engine/src/join_net/local_signal.rs index 1715395a8..fe27d7066 100644 --- a/engine/crates/ps5upload-engine/src/join_net/local_signal.rs +++ b/engine/crates/ps5upload-engine/src/join_net/local_signal.rs @@ -28,6 +28,20 @@ pub(crate) const FRAME_MAX: usize = super::hub::FRAME_MAX; const HELLO_WAIT: Duration = Duration::from_secs(10); /// A signalling socket is closed after this long (ICE has long finished or failed by then). pub(crate) const SIGNAL_FOR: Duration = Duration::from_secs(if cfg!(test) { 20 } else { 60 }); +/// The signals one socket may send: an offer and its candidates, several times over. The hub +/// holds a guest to a count like this; with none here, anything on the network could feed the +/// driver offers as fast as it could write them, with no key, and every offer is a new peer +/// connection built on the one task that carries all the guests' pictures. +pub(crate) const SIGNALS_MAX: usize = 64; + +/// How a home-network join's own room is named ([`Join::Lan`]). An internet invite's room is the +/// hub's kind of id, which the engine makes without a `-` this early. +const HOME_ROOM: &str = "lan-"; + +/// `room` is a home-network join's own: the guest reached this engine itself, on its network. +pub(crate) fn is_home_room(room: &str) -> bool { + room.starts_with(HOME_ROOM) +} fn frame(v: serde_json::Value) -> Message { Message::Text(v.to_string().into()) @@ -107,7 +121,7 @@ pub(crate) async fn session( // mapping, no STUN: the peer is on this engine's network). The peer outlives it. let local_room = match join { Join::Lan => match super::random_b64(9) { - Some(r) => Some(format!("lan-{r}")), + Some(r) => Some(format!("{HOME_ROOM}{r}")), None => return, }, Join::Room(_) => None, @@ -139,6 +153,7 @@ pub(crate) async fn session( ); let (sig_tx, mut sig_rx) = mpsc::unbounded_channel::<(String, serde_json::Value)>(); let until = tokio::time::Instant::now() + SIGNAL_FOR; + let mut signals = 0usize; loop { tokio::select! { _ = tokio::time::sleep_until(until) => break, @@ -160,6 +175,14 @@ pub(crate) async fn session( match v.get("t").and_then(|x| x.as_str()).unwrap_or("") { "leave" => break, "signal" => { + signals += 1; + if signals > SIGNALS_MAX { + // As the hub says it, then the socket closes. + let _ = s + .send(frame(serde_json::json!({"t": "error", "why": "rate_limited"}))) + .await; + break; + } let data = v.get("data").cloned().unwrap_or_default(); let field = |k: &str| data.get(k).and_then(|x| x.as_str()).unwrap_or("").to_string(); match field("type").as_str() { diff --git a/engine/crates/ps5upload-engine/src/join_net/pad_tests.rs b/engine/crates/ps5upload-engine/src/join_net/pad_tests.rs index 9efa8f1f1..69a0e0188 100644 --- a/engine/crates/ps5upload-engine/src/join_net/pad_tests.rs +++ b/engine/crates/ps5upload-engine/src/join_net/pad_tests.rs @@ -361,6 +361,14 @@ async fn a_watcher_anywhere_gets_the_picture_never_the_controller_and_four_at_mo assert_eq!(v["stage"], "joined"); more.push(x); } + // The host said yes to a watcher: its token is no way in as a controller (it was, with the + // PS button and the keyboard). Without `w` the phone asks, as one the host never met does. + let mut sly = connect_guest_on(&hub.url, &room, "pad").await; + assert_eq!(hello_rt(&mut sly, &key, false, &rt).await["stage"], "asking"); + let asking = until_pads("the ask to play", |s| s["pending"][0]["watch"] == false).await; + assert_eq!(asking["pending"][0]["via"], "internet"); + answer_next(false).await; + assert_eq!(refused_why(&mut sly).await, "denied"); let mut fifth = connect_guest_on(&hub.url, &room, "pad").await; assert_eq!(hello_rt(&mut fifth, &key, true, &rt).await["why"], "full"); diff --git a/engine/crates/ps5upload-engine/src/join_net/rtc.rs b/engine/crates/ps5upload-engine/src/join_net/rtc.rs index cf1d96615..f859438c6 100644 --- a/engine/crates/ps5upload-engine/src/join_net/rtc.rs +++ b/engine/crates/ps5upload-engine/src/join_net/rtc.rs @@ -1682,6 +1682,11 @@ fn fail(p: &mut Peer, why: &'static str, detail: &str) { p.rtc.disconnect(); } +/// The longest text a data channel takes in one message (str0m's and the browsers' 256 KiB). +/// Text is not split (chunk.rs), so a session keeps its texts under this (Share splits its long +/// ones: share/wire.rs). +pub(crate) const TEXT_DC_MAX: usize = 256 * 1024; + /// A session's message onto the peer's outgoing queue, as data-channel messages. fn queue(p: &mut Peer, m: Message) { let push = |p: &mut Peer, binary: bool, b: Vec| { @@ -1689,6 +1694,21 @@ fn queue(p: &mut Peer, m: Message) { p.out.push_back((binary, b)); }; match m { + // The channel refuses it, and its write error emptied the whole queue unsaid: the guest + // waited for what never came. The connection ends instead, saying why. + Message::Text(t) if t.len() > TEXT_DC_MAX => { + crate::log_at!( + Info, + "together", + "join: a text message of {} bytes is over the data channel's limit; the connection ends", + t.len() + ); + fail( + p, + "protocol", + "a text message over the data channel's limit", + ); + } Message::Text(t) => push(p, false, t.as_bytes().to_vec()), Message::Binary(b) => { for piece in chunk::split(&b) { @@ -1708,6 +1728,24 @@ fn queue(p: &mut Peer, m: Message) { } } +/// The answer to a guest's ping onto the outgoing queue. One waits there at most: a newer ping's +/// takes its place (that round trip is the one that counts). A pong went past the queue's limit, +/// so a guest that pinged without reading what it is sent grew the queue for as long as it liked. +fn queue_pong(out: &mut VecDeque<(bool, Vec)>, out_bytes: &mut usize, ping: [u8; 8]) { + let mut v = vec![chunk::PONG]; + v.extend_from_slice(&ping); + // A binary piece starts with its header byte: only a pong's is PONG. + if let Some(waiting) = out + .iter_mut() + .find(|(binary, d)| *binary && d.first() == Some(&chunk::PONG)) + { + waiting.1 = v; + return; + } + *out_bytes += v.len(); + out.push_back((true, v)); +} + /// Moves what the channel takes from the queue into it, and tells the session how full it is. fn flush(p: &mut Peer) { let Some(cid) = p.cid else { @@ -1916,10 +1954,7 @@ fn on_event(p: &mut Peer, e: Event, cmd: &mpsc::UnboundedSender) { Ok(Piece::Message(b)) => Message::Binary(b.into()), Ok(Piece::Pong(b)) => Message::Pong(b.to_vec().into()), Ok(Piece::Ping(b)) => { - let mut v = vec![chunk::PONG]; - v.extend_from_slice(&b); - p.out_bytes += v.len(); - p.out.push_back((true, v)); + queue_pong(&mut p.out, &mut p.out_bytes, b); flush(p); return; } @@ -2528,6 +2563,29 @@ mod track_bench; mod track_tests { use super::*; + /// A guest that pings and never reads: one pong waits, the latest ping's, behind what was + /// there already. + #[test] + fn pings_from_a_guest_that_does_not_read_queue_one_pong() { + let mut out = VecDeque::new(); + let mut bytes = 0; + out.push_back((true, vec![chunk::LAST, 1, 2])); + bytes += 3; + for i in 0..10_000u64 { + queue_pong(&mut out, &mut bytes, i.to_le_bytes()); + } + assert_eq!(out.len(), 2); + assert_eq!(bytes, 3 + 9); + let mut last = vec![chunk::PONG]; + last.extend_from_slice(&9_999u64.to_le_bytes()); + assert_eq!(out[1], (true, last)); + // Once it went, the next ping gets a pong of its own. + out.pop_back(); + bytes -= 9; + queue_pong(&mut out, &mut bytes, [7; 8]); + assert_eq!((out.len(), bytes), (2, 12)); + } + const HEADER: &[u8] = &[0, 0, 0, 1, 0x67, 0x64, 0, 0x2a, 0xac, 0, 0, 1, 0x68, 0xee]; #[test] diff --git a/engine/crates/ps5upload-engine/src/join_page.html b/engine/crates/ps5upload-engine/src/join_page.html index 8321b59d2..a1377f178 100644 --- a/engine/crates/ps5upload-engine/src/join_page.html +++ b/engine/crates/ps5upload-engine/src/join_page.html @@ -270,7 +270,7 @@ z AÍp\Ž0N˜HJê´ªØ^U I€wu¸öôú!3å6³‹âVq£³¹´RN£%y10º:pŠ#\:J:b9Hµ7h_Ž:¢I9 _¼™µV,þ <`});var E={a:v};this.setModule=t=>{e.setModule(bi,t)},this.getModule=()=>e.getModule(bi),this.instantiate=()=>(this.getModule().then(e=>WebAssembly.instantiate(e,E)).then(e=>{let t=e.exports;y(t),a=t.g,o(),T(t),n()}),this.ready=new Promise(e=>{n=e}).then(()=>{this.HEAP=a.buffer,this.malloc=x,this.free=C,this.opus_frame_decoder_create=b,this.opus_frame_decode_float_deinterleaved=S,this.opus_frame_decoder_destroy=ee}),this)}var xi=o((()=>{}));function Si(e={}){Si.errors||Object.defineProperties(Si,{errors:{value:new Map([[-1,`OPUS_BAD_ARG: One or more invalid/out of range arguments`],[-2,`OPUS_BUFFER_TOO_SMALL: Not enough bytes allocated in the buffer`],[-3,`OPUS_INTERNAL_ERROR: An internal error was detected`],[-4,`OPUS_INVALID_PACKET: The compressed data passed is corrupted`],[-5,`OPUS_UNIMPLEMENTED: Invalid/unsupported request number`],[-6,`OPUS_INVALID_STATE: An encoder or decoder structure is invalid or already freed`],[-7,`OPUS_ALLOC_FAIL: Memory allocation has failed`]])}}),this._init=()=>new this._WASMAudioDecoderCommon(this).instantiate(this._EmscriptenWASM,this._module).then(e=>{this._common=e,this._inputBytes=0,this._outputSamples=0,this._frameNumber=0,this._input=this._common.allocateTypedArray(this._inputSize,Uint8Array),this._output=this._common.allocateTypedArray(this._outputChannels*this._outputChannelSize,Float32Array);let t=this._common.allocateTypedArray(this._channels,Uint8Array);t.buf.set(this._channelMappingTable),this._decoder=this._common.wasm.opus_frame_decoder_create(this._sampleRate,this._channels,this._streamCount,this._coupledStreamCount,t.ptr,this._preSkip,this._forceStereo)}),Object.defineProperty(this,"ready",{enumerable:!0,get:()=>this._ready}),this.reset=()=>(this.free(),this._init()),this.free=()=>{this._common.free(),this._common.wasm.opus_frame_decoder_destroy(this._decoder),this._common.wasm.free(this._decoder)},this._decode=e=>{if(!(e instanceof Uint8Array))throw Error(`Data to decode must be Uint8Array. Instead got `+typeof e);this._input.buf.set(e);let t=this._common.wasm.opus_frame_decode_float_deinterleaved(this._decoder,this._input.ptr,e.length,this._output.ptr),n;return t<0&&(n=`libopus `+t+` `+(Si.errors.get(t)||`Unknown Error`),console.error(n),t=0),{outputBuffer:this._common.getOutputChannels(this._output.buf,this._outputChannels,t),samplesDecoded:t,error:n}},this.decodeFrame=e=>{let t=[],n=this._decode(e);return n.error&&this._common.addError(t,n.error,e.length,this._frameNumber,this._inputBytes,this._outputSamples),this._frameNumber++,this._inputBytes+=e.length,this._outputSamples+=n.samplesDecoded,this._WASMAudioDecoderCommon.getDecodedAudioMultiChannel(t,[n.outputBuffer],this._outputChannels,n.samplesDecoded,this._sampleRate)},this.decodeFrames=e=>{let t=[],n=[],r=0,i=0;for(;itypeof e==`number`,n=e.sampleRate,r=e.channels,i=e.streamCount,a=e.coupledStreamCount,o=e.channelMappingTable,s=e.preSkip,c=+!!e.forceStereo;if(r>2&&(!t(i)||!t(a)||!Array.isArray(o)))throw Error(`Invalid Opus Decoder Options for multichannel decoding.`);return this._sampleRate=[8e3,12e3,16e3,24e3,48e3].includes(n)?n:48e3,this._channels=t(r)?r:2,this._streamCount=t(i)?i:1,this._coupledStreamCount=t(a)?a:this._channels-1,this._channelMappingTable=o||(this._channels===2?[0,1]:[0]),this._preSkip=s||0,this._forceStereo=r<=8&&r!=2?c:0,this._inputSize=3840*this._channels,this._outputChannelSize=5760,this._outputChannels=this._forceStereo?2:this._channels,this._ready=this._init(),this}var Ci=o((()=>{yi(),xi()})),wi,Ti=o((()=>{yi(),xi(),Ci(),wi=class extends hi{constructor(e){super(e,`opus-decoder`,Si,bi)}async decodeFrame(e){return this.postToDecoder(`decodeFrame`,e)}async decodeFrames(e){return this.postToDecoder(`decodeFrames`,e)}}})),Ei=c({OpusDecoder:()=>Si,OpusDecoderWebWorker:()=>wi}),Di=o((()=>{Ci(),Ti(),yi(),_i(Si,`OpusDecoder`),_i(wi,`OpusDecoderWebWorker`)})),Oi=[8e3,12e3,16e3,24e3,48e3],ki=null;function Ai(){return ki??=Xn(()=>Promise.resolve().then(()=>(Di(),Ei)),__VITE_PRELOAD__,import.meta.url).catch(e=>{throw ki=null,e}),ki}function ji(){return typeof WebAssembly==`object`&&typeof WebAssembly.instantiate==`function`}function Mi(e,t,n,r){return{numberOfFrames:t,numberOfChannels:e.length,sampleRate:n,timestamp:r,format:`f32-planar`,duration:Math.round(t/n*1e6),copyTo(n,r){n.set(e[r.planeIndex].subarray(0,t))},close(){}}}var Ni=class{constructor(e,t=Ai){this.init=e,this.load=t,this.state=`unconfigured`,this.dec=null,this.pending=[]}configure(e){if(this.state===`closed`)throw Error(`the decoder is closed`);if(!ji())throw Error(`no WebAssembly here`);let t=e.sampleRate;if(!Oi.includes(t))throw Error(`Opus does not decode at ${t} Hz`);let n=e.numberOfChannels;if(n<1||n>2)throw Error(`${n} channels: only mono and stereo are decoded`);this.state=`configured`,this.load().then(async e=>{if(this.state===`closed`)return;let r=new e.OpusDecoder({channels:n,sampleRate:t});if(await r.ready,this.state!==`configured`){r.free();return}this.dec=r;let i=this.pending;this.pending=[];for(let e of i)this.state===`configured`&&this.run(e)}).catch(e=>this.fail(e))}decode(e){if(this.state!==`configured`)return;let t=e;if(this.dec)return this.run(t);this.pending.push({timestamp:t.timestamp,data:t.data.slice()}),this.pending.length>50&&this.pending.shift()}run(e){let t=this.dec;if(!t)return;let n;try{n=t.decodeFrame(e.data)}catch(e){return this.fail(e)}n.samplesDecoded&&n.channelData.length&&this.init.output(Mi(n.channelData,n.samplesDecoded,n.sampleRate,e.timestamp))}fail(e){if(this.state===`closed`)return;this.close();let t=e instanceof Error?e:Error(String(e));queueMicrotask(()=>this.init.error(t))}close(){this.state=`closed`,this.pending=[];let e=this.dec;this.dec=null;try{e?.free()}catch{}}},Pi={makeDecoder:e=>new Ni(e),makeChunk:e=>({type:e.type,timestamp:e.timestamp,data:e.data instanceof Uint8Array?e.data:new Uint8Array(e.data)})};function Fi(e,t){for(let n=0;n+3>1&63;if(t>=16&&t<=21)return!0;if(t<16)return!1}else{let t=e[n+3]&31;if(t===5)return!0;if(t===1)return!1}}return!1}function Ii(e){for(let t=0;t+6e.toString(16).padStart(2,`0`);return`avc1.${n(e[t+4])}${n(e[t+5])}${n(e[t+6])}`}return`avc1.4d4028`}var Li=[`hev1.1.6.L153.B0`,`hvc1.1.6.L153.B0`,`hev1.2.4.L153.B0`,`hvc1.2.4.L153.B0`,`hev1.1.6.L150.90`];async function Ri(e,t){if(typeof VideoDecoder>`u`)return null;for(let n of Li)try{if((await VideoDecoder.isConfigSupported({codec:n,codedWidth:e,codedHeight:t})).supported)return n}catch{}return null}function zi(e){let t=[];for(let n=0;n+2{let i=r+1n&&e[i-1]===0;)i--;return e.subarray(n,i)}).filter(e=>e.length>0)}var Bi=(e,t)=>t?e[0]>>1&63:e[0]&31;function Vi(e,...t){let n=8+t.reduce((e,t)=>e+t.length,0),r=new Uint8Array(n);new DataView(r.buffer).setUint32(0,n);for(let t=0;t<4;t++)r[4+t]=e.charCodeAt(t);let i=8;for(let e of t)r.set(e,i),i+=e.length;return r}function F(...e){let t=new Uint8Array(e.reduce((e,[,t])=>e+t,0)),n=0;for(let[r,i]of e){for(let e=i-1;e>=0;e--)t[n+i-1-e]=Math.floor(r/2**(8*e))&255;n+=i}return t}var Hi=(e,t,n,...r)=>Vi(e,F([t,1],[n,3]),...r),Ui=F([65536,4],[0,4],[0,4],[0,4],[65536,4],[0,4],[0,4],[0,4],[1073741824,4]);function Wi(e){let t=e.handler===`vide`,n=Vi(`ftyp`,new TextEncoder().encode(`isom`),F([1,4]),new TextEncoder().encode(`isomiso6mp41`)),r=Vi(`moov`,Hi(`mvhd`,0,0,F([0,4],[0,4],[e.timescale,4],[0,4],[65536,4],[256,2],[0,2],[0,4],[0,4]),Ui,new Uint8Array(24),F([2,4])),Vi(`trak`,Hi(`tkhd`,0,3,F([0,4],[0,4],[1,4],[0,4],[0,4],[0,4],[0,4],[0,2],[0,2],[t?0:256,2],[0,2]),Ui,F([(e.width??0)*65536,4],[(e.height??0)*65536,4])),Vi(`mdia`,Hi(`mdhd`,0,0,F([0,4],[0,4],[e.timescale,4],[0,4],[21956,2],[0,2])),Hi(`hdlr`,0,0,F([0,4]),new TextEncoder().encode(e.handler),new Uint8Array(12),F([0,1])),Vi(`minf`,t?Hi(`vmhd`,0,1,new Uint8Array(8)):Hi(`smhd`,0,0,F([0,4])),Vi(`dinf`,Hi(`dref`,0,0,F([1,4]),Hi(`url `,0,1))),Vi(`stbl`,Hi(`stsd`,0,0,F([1,4]),e.sampleEntry),Hi(`stts`,0,0,F([0,4])),Hi(`stsc`,0,0,F([0,4])),Hi(`stsz`,0,0,F([0,4],[0,4])),Hi(`stco`,0,0,F([0,4])))))),Vi(`mvex`,Hi(`trex`,0,0,F([1,4],[1,4],[0,4],[0,4],[0,4])))),i=new Uint8Array(n.length+r.length);return i.set(n,0),i.set(r,n.length),i}function Gi(e,t,n,r,i){let a=i?33554432:16842752,o=e=>Hi(`trun`,0,1793,F([1,4],[e,4],[n,4],[r.length,4],[a,4])),s=e=>Vi(`traf`,Hi(`tfhd`,0,131072,F([1,4])),Hi(`tfdt`,1,0,F([t,8])),o(e)),c=Hi(`mfhd`,0,0,F([e,4])),l=Vi(`moof`,c,s(0)).length,u=Vi(`moof`,c,s(l+8)),d=Vi(`mdat`,r),f=new Uint8Array(u.length+d.length);return f.set(u,0),f.set(d,u.length),f}function Ki(e,t,n=!1){let r=t?[35,...n?[32,33,34]:[]]:[9,...n?[7,8]:[]],i=zi(e).filter(e=>!r.includes(Bi(e,t))),a=new Uint8Array(i.reduce((e,t)=>e+4+t.length,0)),o=new DataView(a.buffer),s=0;for(let e of i)o.setUint32(s,e.length),a.set(e,s+4),s+=4+e.length;return a}var qi=e=>e.toString(16).padStart(2,`0`),Ji=e=>{let t=new Uint8Array(2+e.length);return t[0]=e.length>>8,t[1]=e.length&255,t.set(e,2),t},Yi=e=>{let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),n=0;for(let r of e)t.set(r,n),n+=r.length;return t};function Xi(e){let t=zi(e),n=t.filter(e=>Bi(e,!1)===7),r=t.filter(e=>Bi(e,!1)===8);return!n.length||!r.length||n[0].length<4?null:Yi([F([1,1],[n[0][1],1],[n[0][2],1],[n[0][3],1],[255,1],[224|n.length,1]),...n.map(Ji),F([r.length,1]),...r.map(Ji)])}function Zi(e,t,n){let r=zi(e),i=e=>r.filter(n=>Bi(n,t)===e),a=(e,t)=>Vi(e,new Uint8Array(6),F([1,2],[0,16],[n.w,2],[n.h,2],[4718592,4],[4718592,4],[0,4],[1,2]),new Uint8Array(32),F([24,2],[65535,2]),t);if(!t){let t=i(7),r=Xi(e);return r?{init:Wi({handler:`vide`,timescale:9e4,sampleEntry:a(`avc1`,Vi(`avcC`,r)),width:n.w,height:n.h}),mime:`video/mp4; codecs="avc1.${qi(t[0][1])}${qi(t[0][2])}${qi(t[0][3])}"`}:null}let o=i(32),s=i(33),c=i(34);if(!o.length||!s.length||!c.length)return null;let l=Xr(s[0]);if(l.length<15)return null;let u=l.subarray(3,15),d=u[0]&31,f=d===2?2:0,p=(e,t)=>Yi([F([128|e,1],[t.length,2]),...t.map(Ji)]),m=Vi(`hvcC`,F([1,1]),u,F([61440,2],[252,1],[253,1],[248|f,1],[248|f,1],[0,2],[15,1],[3,1]),p(32,o),p(33,s),p(34,c)),h=[``,`A`,`B`,`C`][u[0]>>6],g=0,_=(u[1]<<24|u[2]<<16|u[3]<<8|u[4])>>>0;for(let e=0;e<32;e++)_&1<>>0).toString(16),`${u[0]&32?`H`:`L`}${u[11]}`,...v.map(e=>e.toString(16))].join(`.`);return{init:Wi({handler:`vide`,timescale:9e4,sampleEntry:a(`hvc1`,m),width:n.w,height:n.h}),mime:`video/mp4; codecs="${y}"`}}function Qi(e,t,n,r,i,a){return Gi(e,t,n,Ki(r,i),a)}function $i(e,t){let n=Vi(`dOps`,F([0,1],[e,1],[312,2],[t,4],[0,2],[0,1]));return Wi({handler:`soun`,timescale:48e3,sampleEntry:Vi(`Opus`,new Uint8Array(6),F([1,2],[0,8],[e,2],[16,2],[0,4],[3145728e3,4]),n)})}function ea(e){if(!e.length)return 960;let t=e[0]>>3,n=t<12?[480,960,1920,2880][t%4]:t<16?[480,960][t%2]:[120,240,480,960][t%4],r=e[0]&3,i=r===0?1:r===3?(e[1]??1)&63:2;return n*Math.max(1,i)}function ta(e,t,n){return Gi(e,t,ea(n),n,!0)}var na={watch:30,player:4},ra={watch:{seek:.5,speed:1/0,target:.05},player:{seek:.15,speed:.06,target:.02}},ia={seek:.8,speed:.25,target:.12};function aa(e,t,n){let r=typeof n==`string`?ra[n]:n;return e>r.seek?{seekTo:t-r.target,rate:1}:e>r.speed?{seekTo:null,rate:1.1}:{seekTo:null,rate:1}}function oa(e,t=`watch`,n){return typeof VideoDecoder<`u`?new ha(e,t,n):new ka(e,t,n)}var sa=class{constructor(e,t=()=>performance.now()){this.ask=e,this.now=t,this.last=-1/0}waiting(){if(!this.ask)return;let e=this.now();e-this.last<1e3||(this.last=e,this.ask())}};function I(e){return e.length<3?null:{index:e[0]<<8|e[1],packet:e.subarray(2)}}var L=class{constructor(){this.last=-1}take(e){if(this.last>=0){let t=e-this.last&65535;if(t===0||t>=32768)return!1}return this.last=e,!0}reset(){this.last=-1}};function ca(e){if(e.length>=10)return e;let t=new Uint8Array(10);t.set(e.subarray(0,6));let n=new DataView(t.buffer);return n.setUint32(6,Math.round(n.getUint32(2)/100)||480),t}function la(e,t){return{snd:e,snd_decoded:t.decoded,snd_concealed:t.concealed,snd_underruns:t.underruns,snd_dropped:t.dropped}}var ua=class{constructor(e,t=.2){this.min=e,this.max=t,this.next=0,this.calmSince=0,this.minLead=1/0,this.windowAt=0,this.underruns=0,this.dropped=0,this.cushion=e}at(e,t){this.next0&&(this.underruns++,this.cushion=Math.min(this.max,this.cushion+.02)),this.calmSince=e,this.next=e+this.cushion,this.minLead=1/0,this.windowAt=e):e-this.calmSince>10&&this.cushion>this.min&&(this.cushion=Math.max(this.min,this.cushion-.01),this.calmSince=e);let n=this.next-e;if(n>this.cushion+.15)return this.dropped++,null;if(this.minLead=Math.min(this.minLead,n),e-this.windowAt>=.25){let t=this.minLead>this.cushion+da;if(this.minLead=1/0,this.windowAt=e,t)return this.dropped++,null}let r=this.next;return this.next+=t,r}reset(){this.next=0}},da=.02;async function fa(e,t){try{return typeof AudioDecoder>`u`?!1:!!(await AudioDecoder.isConfigSupported({codec:`opus`,sampleRate:e,numberOfChannels:t})).supported}catch{return!1}}var pa=class{constructor(e,t=()=>performance.now()){this.decoder=e,this.now=t,this.n={frames:0,dropped:0,late:0,stalls:0,stall_ms:0,worst_stall_ms:0,key_waits:0},this.a=0,this.d=0,this.w=!1,this.q=[],this.sum=0,this.cnt=0,this.codec=``}get frames(){return this.n.frames}arrived(){let e=this.now();this.a&&e-this.a>50&&this.n.late++,this.a=e}drop(){this.n.dropped++,this.w||this.n.key_waits++,this.w=!0}decoding(){this.w=!1,this.q.push(this.now())>64&&this.q.shift()}drawn(e=!1){let t=this.now(),n=e?this.q.shift():void 0;n!==void 0&&(this.sum+=t-n,this.cnt++);let r=this.d?t-this.d:0;r>100&&this.stall(r),this.d=t,this.n.frames++}stall(e){this.n.stalls++,this.n.stall_ms+=e,this.n.worst_stall_ms=Math.max(this.n.worst_stall_ms,e)}snapshot(){let e=this.d?this.now()-this.d:0,t={...this.n,decoder:this.decoder};this.codec&&(t.codec=this.codec),e>100&&(t.stalls=this.n.stalls+1,t.stall_ms=this.n.stall_ms+e,t.worst_stall_ms=Math.max(this.n.worst_stall_ms,e));for(let e of[`stall_ms`,`worst_stall_ms`])t[e]=Math.round(t[e]);return t.decode_ms=this.cnt?Math.round(this.sum/this.cnt*10)/10:0,this.sum=this.cnt=0,t}},ma=[`pointerup`,`touchend`,`click`,`keydown`],ha=class{get element(){if(!this.wrap){let e=document.createElement(`div`);e.className=`h-full w-full`,e.append(this.canvas),this.mse&&e.append(this.mse.element),this.wrap=e}return this.wrap}get stats(){return this.mse?.stats??this.ownStats}soundReport(){return this.soundOn?this.mseSound?this.mseSound.report():la(this.soundWasm?`wasm`:`webcodecs`,this.soundStats):null}constructor(e,t=`watch`,n){this.onProblem=e,this.latency=t,this.onNeedKey=n,this.canvas=document.createElement(`canvas`),this.wrap=null,this.mse=null,this.failsNoPicture=0,this.ctx=this.canvas.getContext(`2d`,{alpha:!1}),this.hevc=!1,this.header=null,this.spsRect=null,this.software=!1,this.video=null,this.opening=!1,this.stopped=!1,this.sawKey=!1,this.ownStats=new pa(`webcodecs`),this.problemShown=!1,this.ts=0,this.pipe=null,this.audioGen=0,this.actx=null,this.soundOn=!1,this.unarm=null,this.mseSound=null,this.audioHeader=null,this.soundWasm=!1,this.onSoundFail=null,this.muted=!1,this.keyAsk=new sa(n),this.clock=new ua(t===`player`?.05:.08),typeof AudioDecoder>`u`&&va()&&(this.mseSound=new ya(t,()=>this.mseSoundFailed())),this.canvas.className=`block h-full w-full object-contain`,this.canvas.dataset.testid=`watch-canvas`}setHevc(e){this.hevc=e,this.header&&(this.spsRect=ni(this.header,e)),this.mse?.setHevc(e)}get onMse(){return!!this.mse}decodeFailed(){if(this.mse||this.ownStats.frames>0||++this.failsNoPicture<3||!xa())return!1;let e=new ka(this.onProblem,this.latency,this.onNeedKey);e.setHevc(this.hevc),e.markProblemShown(),this.mse=e;let t=this.video;this.video=null;try{t?.close()}catch{}return this.canvas.style&&(this.canvas.style.display=`none`),this.wrap?.append(e.element),this.header&&e.onMessage(new Uint8Array([0,...this.header]).buffer),this.onNeedKey?.(),!0}startSound(){this.soundOn=!0,ga(),this.mseSound?this.mseSound.start():this.openContext()}openContext(){try{if(!this.actx){let e=new AudioContext({latencyHint:`interactive`});this.actx=e,e.onstatechange=()=>{this.actx===e&&e.state!==`running`&&e.state!==`closed`&&this.armResume()}}this.actx.resume().catch(()=>{})}catch{this.onSoundFail?.()}}get sound(){return this.soundOn}setMuted(e){this.muted=e,this.mseSound?.setMuted(e)}resumeSound(){if(!this.soundOn)return;if(this.mseSound)return this.mseSound.resume();let e=this.actx;e&&e.state!==`running`&&e.state!==`closed`&&(this.clock.reset(),e.resume().catch(()=>{}),this.armResume())}get soundStats(){return{decoded:this.pipe?.decoded??0,concealed:this.pipe?.concealed??0,underruns:this.clock.underruns,dropped:this.clock.dropped,cushionMs:Math.round(this.clock.cushion*1e3)}}armResume(){if(this.unarm||typeof window>`u`||!window.addEventListener)return;let e=()=>{let e=this.actx;if(!e||e.state===`closed`)return this.unarm?.();this.clock.reset(),e.resume().then(()=>{e.state===`running`&&this.unarm?.()}).catch(()=>{})};for(let t of ma)window.addEventListener(t,e,!0);this.unarm=()=>{for(let t of ma)window.removeEventListener(t,e,!0);this.unarm=null}}onMessage(e){let t=new Uint8Array(e);if(t.length<1||this.stopped)return;let n=t[0],r=t.subarray(1);if(this.mse&&(n===0||n===1))return n===0&&(this.header=r.slice()),this.mse.onMessage(e);n===0?this.openVideo(r.slice()):n===1?this.onVideo(r):n===3?this.openAudio(r.slice()):n===4&&this.onAudio(r)}async openVideo(e){if(this.header=e,this.spsRect=ni(e,this.hevc),!this.opening){this.opening=!0;try{let t=this.hevc?await Aa(e):Ii(e);if(this.mse||this.stopped)return;if(!t){this.problemShown=!0,this.onProblem(`no_hevc`);return}this.ownStats.codec=t;let n=this.hevc?void 0:Xi(e)??void 0;try{this.video?.close()}catch{}let r=new VideoDecoder({output:e=>{let t=this.realVisible(e),n=this.canvas;(n.width!==t.displayWidth||n.height!==t.displayHeight)&&(n.width=t.displayWidth,n.height=t.displayHeight),this.ctx?.drawImage(t,0,0,n.width,n.height),this.ownStats.drawn(!0),t.close(),this.problemShown&&(this.problemShown=!1,this.onProblem(null))},error:()=>{this.video===r&&(this.problemShown=!0,this.onProblem(`decode`),this.decodeFailed()||this.rebuild())}}),i={codec:t,optimizeForLatency:!0};n&&(i.description=n),this.software&&(i.hardwareAcceleration=`prefer-software`),r.configure(i),this.video=r,this.sawKey=!1}catch{this.problemShown=!0,this.onProblem(`decode`),this.decodeFailed()}finally{this.opening=!1}}}realVisible(e){let t=this.spsRect,n=ri(e,t);if(n)try{let t=new VideoFrame(e,{visibleRect:{x:n.x,y:n.y,width:n.w,height:n.h},displayWidth:n.w,displayHeight:n.h});return e.close(),t}catch{return e}let r=e.visibleRect;if(t&&r&&!this.software&&(r.width{if(this.video===e){try{e?.close()}catch{}this.rebuild(),this.onNeedKey?.()}})}return e}rebuild(){this.mse||this.stopped||(this.video=null,this.sawKey=!1,this.header&&this.openVideo(this.header).then(()=>this.keyAsk.waiting()))}onVideo(e){let t=this.video;if(t?.state===`closed`){this.opening||this.rebuild();return}if(!t||t.state!==`configured`)return;let n=Fi(e,this.hevc);if(this.ownStats.arrived(),!this.sawKey&&!n)return this.ownStats.drop(),this.keyAsk.waiting();if(!n&&t.decodeQueueSize>na[this.latency])return this.sawKey=!1,this.ownStats.drop(),this.keyAsk.waiting();this.sawKey=!0;let r=e;this.hevc?n&&this.header&&(r=new Uint8Array(this.header.length+e.length),r.set(this.header,0),r.set(e,this.header.length)):r=Ki(e,!1,!0),this.ts+=16667,this.ownStats.decoding(),t.decode(new EncodedVideoChunk({type:n?`key`:`delta`,timestamp:this.ts,data:r}))}openAudio(e){if(e.length<6)return;let t=++this.audioGen;if(this.pipe?.reset(),this.pipe=null,this.clock.reset(),this.audioHeader=e,this.mseSound)return this.mseSound.setHeader(e);let n=e[0];fa(new DataView(e.buffer,e.byteOffset,e.byteLength).getUint32(2),n).then(n=>{if(t!==this.audioGen)return;if(!n)return va()?this.soundThroughMse(e):this.soundThroughWasm(e);let r=new si((e,t)=>this.play(e,t,r.sampleRate));try{r.header(ca(e)),this.pipe=r}catch{this.soundThroughMse(e)}})}soundThroughMse(e){this.pipe=null,this.mseSound||(this.mseSound=new ya(this.latency,()=>this.mseSoundFailed()),this.soundOn&&this.mseSound.start()),this.mseSound.setHeader(e)}soundThroughWasm(e){this.pipe?.reset(),this.soundWasm=!0;let t=new si((e,n)=>this.play(e,n,t.sampleRate),Pi,()=>{this.pipe===t&&(this.pipe=null),this.onSoundFail?.()});this.pipe=t,t.header(ca(e))}mseSoundFailed(){let e=this.mseSound;e&&(this.mseSound=null,e.stop(),this.soundOn&&(this.openContext(),this.actx&&this.actx.state!==`running`&&this.armResume()),this.audioHeader&&this.soundThroughWasm(this.audioHeader))}onAudio(e){if(this.mseSound)return this.mseSound.frame(e);this.soundOn&&this.pipe&&this.pipe.packet(e)}play(e,t,n){let r=this.actx;if(!r||r.state!==`running`||!e.length)return;let i=e[0].length,a=this.clock.at(r.currentTime,i/n);if(a===null)return;let o=r.createBuffer(e.length,i,n),s=this.muted?0:t;e.forEach((e,t)=>o.copyToChannel(s===1?e:e.map(e=>e*s),t));let c=r.createBufferSource();c.buffer=o,c.connect(r.destination),c.start(a)}stop(){this.stopped=!0;try{this.video?.close()}catch{}this.mse?.stop(),this.audioGen++,this.pipe?.reset(),this.pipe=null,this.unarm?.(),this.actx?.close().catch(()=>{}),this.mseSound?.stop()}};function ga(){try{let e=navigator.audioSession;e&&e.type!==`playback`&&(e.type=`playback`)}catch{}}function _a(e,t){try{return e.isTypeSupported(t)}catch{return!1}}function va(){let e=typeof window>`u`?null:xa();return!!e&&(_a(e,`audio/mp4; codecs="Opus"`)||_a(e,`audio/mp4; codecs="opus"`))}var ya=class{constructor(e,t,n=document.createElement(`audio`)){this.onFail=t,this.header=null,this.time=0,this.on=!1,this.failed=!1,this.order=new L,this.el=n,this.track=new Ta(n,()=>this.fail(),e===`player`?ia:e)}get playing(){return this.on&&!this.failed}report(){return{snd:`mse`,snd_jumps:this.track.seeks}}setHeader(e){this.header=e,this.on&&this.open()}start(){if(!this.on&&(this.on=!0,this.header&&this.open(),!this.failed))try{this.el.play()?.catch?.(()=>{})}catch{}}frame(e){if(!this.on||this.failed||!this.track.ready&&!this.track.backlog)return;let t=I(e);if(!t||!this.order.take(t.index))return;let n=ta(this.track.nextSeq(),this.time,t.packet);this.time+=ea(t.packet),this.track.push(n)}setMuted(e){this.el.muted=e}resume(){if(this.playing&&this.el.paused)try{this.el.play()?.catch?.(()=>{})}catch{}}stop(){this.on=!1,this.track.close()}open(){let e=this.header;if(!e||e.length<6||this.failed)return;let t=e[0],n=$i(t,new DataView(e.buffer,e.byteOffset,e.byteLength).getUint32(2));this.track.open(`audio/mp4; codecs="Opus"`,n)||this.track.open(`audio/mp4; codecs="opus"`,n)?(this.time=0,this.order.reset()):this.fail()}fail(){this.failed||(this.failed=!0,this.onFail())}},ba=class{constructor(e,t,n=Pi){this.onFail=t,this.codecs=n,this.actx=null,this.pipe=null,this.header=null,this.on=!1,this.failed=!1,this.muted=!1,this.unarm=null,this.played=!1,this.clock=new ua(e===`player`?.05:.08)}get playing(){return this.on&&!this.failed}get stats(){return{decoded:this.pipe?.decoded??0,concealed:this.pipe?.concealed??0,underruns:this.clock.underruns,dropped:this.clock.dropped}}start(){if(!this.failed){this.on=!0,ga();try{if(!this.actx){let e=new AudioContext({latencyHint:`interactive`});this.actx=e,e.onstatechange=()=>{this.actx===e&&e.state!==`running`&&e.state!==`closed`&&this.armResume()}}this.actx.resume().catch(()=>{}),this.actx.state!==`running`&&this.armResume()}catch{return this.fail()}this.header&&!this.pipe&&this.open()}}setHeader(e){e.length<6||(this.header=e,this.pipe?.reset(),this.pipe=null,this.clock.reset(),this.on&&this.open())}frame(e){this.on&&!this.failed&&this.pipe?.packet(e)}setMuted(e){this.muted=e}resume(){let e=this.actx;this.playing&&e&&e.state!==`running`&&e.state!==`closed`&&(this.clock.reset(),e.resume().catch(()=>{}),this.armResume())}stop(){this.on=!1,this.pipe?.reset(),this.pipe=null,this.unarm?.(),this.actx?.close().catch(()=>{}),this.actx=null}open(){let e=this.header;if(!e||this.failed)return;let t=new si((e,n)=>this.play(e,n,t.sampleRate),this.codecs,()=>{this.pipe===t&&this.fail()});this.pipe=t,t.header(ca(e))}play(e,t,n){let r=this.actx;if(!r||r.state!==`running`||!e.length)return;let i=e[0].length,a=this.clock.at(r.currentTime,i/n);if(a===null)return;let o=r.createBuffer(e.length,i,n),s=this.muted?0:t;e.forEach((e,t)=>o.copyToChannel(s===1?e:e.map(e=>e*s),t));let c=r.createBufferSource();c.buffer=o,c.connect(r.destination),c.start(a),this.played=!0}armResume(){if(this.unarm||typeof window>`u`||!window.addEventListener)return;let e=()=>{let e=this.actx;if(!e||e.state===`closed`)return this.unarm?.();this.clock.reset(),e.resume().then(()=>{e.state===`running`&&this.unarm?.()}).catch(()=>{})};for(let t of ma)window.addEventListener(t,e,!0);this.unarm=()=>{for(let t of ma)window.removeEventListener(t,e,!0);this.unarm=null}}fail(){this.failed||(this.failed=!0,this.stop(),this.onFail())}};function xa(){let e=window;return e.ManagedMediaSource??e.MediaSource??null}var Sa=10,Ca=3;function wa(e,t,n,r=Ca){let i=null;for(let a of e)a>t&&a<=n-r&&(i=a);return i}var Ta=class{constructor(e,t,n=`watch`,r,i=()=>performance.now()){this.el=e,this.onError=t,this.latency=n,this.onNeedKey=r,this.now=i,this.ms=null,this.sb=null,this.queue=[],this.mime=``,this.seq=1,this.ready=!1,this.dropped=!1,this.keys=null,this.seeks=0,this.maxLagS=0,this.fromZero=0,this.trims=0,this.lastJump=null,this.trimAt=-1,this.trimFrom=-1,this.keyAt=-1,this.attached=null,r&&(this.keys=[])}setEdge(e){this.latency=e}markKey(e){this.keys?.push(e),this.keyAt=this.now()}open(e,t){let n=xa();if(!n||!_a(n,e))return!1;this.close();let r=new n;return this.ms=r,this.mime=e,this.queue=[t],this.seq=1,this.ready=!1,this.keys&&=[],r.addEventListener(`sourceopen`,()=>{if(this.ms===r)try{let e=r.addSourceBuffer(this.mime);e.mode=`segments`,e.addEventListener(`updateend`,()=>this.pump()),e.addEventListener(`error`,()=>this.onError()),this.sb=e,this.ready=!0,this.pump()}catch{this.onError()}}),`ManagedMediaSource`in window&&n===window.ManagedMediaSource&&(this.el.disableRemotePlayback=!0),this.attached=Ea(this.el,r),!0}nextSeq(){return this.seq++}get backlog(){return this.queue.length}push(e){this.queue.push(e),this.pump()}pump(){let e=this.sb;if(!e||e.updating||!this.ready)return;let t=this.el;if(e.buffered.length){let n=e.buffered.end(e.buffered.length-1),r=e.buffered.start(0),i=n-t.currentTime,a=aa(i,n,this.latency);if(a.seekTo!==null){this.seeks++,this.maxLagS=Math.max(this.maxLagS,i);let o=this.now(),s=e=>e<0?-1:Math.round(o-e);t.currentTime<.05&&r>1&&this.fromZero++,this.lastJump={at:t.currentTime,start:r,end:n,ranges:e.buffered.length,readyState:t.readyState,paused:t.paused,seeking:t.seeking,sinceTrimMs:s(this.trimAt),trimFrom:this.trimFrom,sinceKeyMs:s(this.keyAt)},t.currentTime=Math.max(r,a.seekTo)}if(t.playbackRate!==a.rate&&(t.playbackRate=a.rate),t.currentTime-r>Sa&&this.trim(e,r))return}let n=this.queue.shift();if(n){try{e.appendBuffer(n)}catch{this.dropped=!0}t.paused&&t.play().catch(()=>{})}}trim(e,t){let n=this.el.currentTime,r=n-Ca;if(this.keys){if(r=wa(this.keys,t,n),r===null)return(this.keys[this.keys.length-1]??-1/0)<=n-Ca&&this.onNeedKey?.(),!1;let e=r;this.keys=this.keys.filter(t=>t>=e),r-=.001}try{return e.remove(t,r),this.trims++,this.trimAt=this.now(),this.trimFrom=n,!0}catch{return!1}}close(){this.ready=!1,this.sb=null,this.queue=[];let e=this.ms;if(this.ms=null,e&&e.readyState===`open`)try{e.endOfStream()}catch{}if(this.attached===`object`)try{this.el.srcObject=null}catch{}this.attached=null,this.el.src?.startsWith(`blob:`)&&URL.revokeObjectURL(this.el.src),this.el.removeAttribute(`src`)}};function Ea(e,t){if(`srcObject`in e)try{return e.srcObject=t,`object`}catch{}return e.src=URL.createObjectURL(t),`url`}var Da=1e4,Oa=class{constructor(e=3,t=Da,n=()=>performance.now()){this.max=e,this.windowMs=t,this.now=n,this.at=[]}fail(){let e=this.now();return this.at=this.at.filter(t=>e-t=this.max}clear(){this.at=[]}},ka=class{constructor(e,t=`watch`,n,r){this.onProblem=e,this.latency=t,this.wasm=null,this.audioHeader=null,this.muted=!1,this.gaveUp=!1,this.reopening=!1,this.failedWhileOpening=!1,this.wrap=document.createElement(`div`),this.hevc=!1,this.header=null,this.sawKey=!1,this.stats=new pa(`mse`),this.problemShown=!1,this.vTime=0,this.vLast=0,this.soundOn=!1,this.onSoundFail=null,this.onGiveUp=null,this.keyAsk=new sa(n),this.fails=new Oa(3,Da,r);let i=document.createElement(`video`);i.muted=!0,i.autoplay=!0,i.playsInline=!0,i.className=`block h-full w-full object-contain`,i.dataset.testid=`watch-video`,this.audio=new ya(t,()=>this.soundThroughWasm()),this.wrap.className=`h-full w-full`,this.wrap.append(i,this.audio.el),this.video=new Ta(i,()=>this.showProblem(),t,()=>this.keyAsk.waiting()),i.addEventListener(`error`,()=>this.restartVideo()),i.addEventListener(`playing`,()=>{this.fails.clear(),this.problemShown&&(this.problemShown=!1,this.onProblem(null))})}markProblemShown(){this.problemShown=!0}showProblem(){this.problemShown||(this.problemShown=!0,this.onProblem(`decode`))}restartVideo(){if(this.gaveUp)return;if(this.reopening){this.failedWhileOpening=!0;return}if(this.showProblem(),this.fails.fail()){this.gaveUp=!0,this.video.close(),this.onGiveUp?.();return}let e=this.header;if(e){this.header=null,this.reopening=!0,this.failedWhileOpening=!1;try{this.openVideo(e)}finally{this.reopening=!1}this.sawKey=!1,this.keyAsk.waiting(),this.failedWhileOpening&&(this.failedWhileOpening=!1,this.restartVideo())}}get failed(){return this.gaveUp}setVideoEdge(e){this.video.setEdge(e)}get videoSeeks(){return{seeks:this.video.seeks,maxLagMs:Math.round(this.video.maxLagS*1e3),fromZero:this.video.fromZero,trims:this.video.trims,lastJump:this.video.lastJump}}get element(){return this.wrap}resume(){let e=this.video.el;e.paused&&e.play()?.catch?.(()=>{})}setHevc(e){this.hevc=e}startSound(){if(this.soundOn=!0,this.wasm)return this.wasm.start();if(!va())return this.soundThroughWasm();this.audio.start()}soundThroughWasm(){if(this.wasm)return;this.audio.stop();let e=new ba(this.latency,()=>this.onSoundFail?.());this.wasm=e,e.setMuted(this.muted),this.audioHeader&&e.setHeader(this.audioHeader),this.soundOn&&e.start()}resumeSound(){this.soundOn&&(this.wasm?this.wasm.resume():this.audio.resume())}setMuted(e){this.muted=e,this.audio.setMuted(e),this.wasm?.setMuted(e)}soundReport(){return this.soundOn?this.wasm?la(`wasm`,this.wasm.stats):this.audio.report():null}get soundPlaying(){return this.wasm?this.wasm.played:this.audio.playing}get sound(){return this.soundOn}onMessage(e){let t=new Uint8Array(e);if(t.length<1)return;let n=t[0],r=t.subarray(1);n===0?this.openVideo(r.slice()):n===1?this.onVideo(r):n===3?(this.audioHeader=r.slice(),(this.wasm??this.audio).setHeader(this.audioHeader)):n===4&&(this.wasm??this.audio).frame(r)}openVideo(e){let t=!!this.header&&this.header.length===e.length&&this.header.every((t,n)=>t===e[n]);if(t&&this.video.ready)return;if(this.gaveUp){if(t)return;this.gaveUp=!1,this.fails.clear()}this.header=e;let n=ni(e,this.hevc)??{w:1920,h:1080},r=Zi(e,this.hevc,n);r&&(this.stats.codec=/codecs="([^"]+)"/.exec(r.mime)?.[1]??``,this.video.open(r.mime,r.init)?(this.sawKey=!1,this.vTime=0,this.vLast=0):(this.problemShown=!0,this.onProblem(this.hevc?`no_hevc`:`decode`)))}onVideo(e){if(!this.video.ready&&!this.video.backlog)return;let t=Fi(e,this.hevc);if(this.video.dropped&&(this.video.dropped=!1,this.sawKey=!1),this.stats.arrived(),!this.sawKey&&!t)return this.stats.drop(),this.keyAsk.waiting();if(!t&&this.video.backlog>na[this.latency])return this.sawKey=!1,this.stats.drop(),this.keyAsk.waiting();this.sawKey=!0,this.stats.drawn();let n=performance.now(),r=this.vLast?Math.min(9e3,Math.max(750,Math.round((n-this.vLast)*90))):1500;this.vLast=n,t&&this.video.markKey(this.vTime/9e4),this.video.push(Qi(this.video.nextSeq(),this.vTime,r,e,this.hevc,t)),this.vTime+=r}stop(){this.video.close(),this.audio.stop(),this.wasm?.stop()}};async function Aa(e){let t=ii(e);if(t&&typeof VideoDecoder<`u`)try{if((await VideoDecoder.isConfigSupported({codec:t,codedWidth:1920,codedHeight:1080})).supported)return t}catch{}return Ri(1920,1080)}var R={CROSS:1,CIRCLE:2,SQUARE:4,TRIANGLE:8,LEFT:16,RIGHT:32,UP:64,DOWN:128,L1:256,R1:512,L3:1024,R3:2048,OPTIONS:4096,SHARE:8192,TOUCHPAD:16384,PS:32768},ja={buttons:0,l2:0,r2:0,lx:0,ly:0,rx:0,ry:0};function Ma(e,t){let n=e=>Math.max(0,Math.min(1,e));return[Math.round(n(e)*1919),Math.round(n(t)*941)]}var Na={ArrowUp:{button:R.UP},ArrowDown:{button:R.DOWN},ArrowLeft:{button:R.LEFT},ArrowRight:{button:R.RIGHT},Enter:{button:R.CROSS},Space:{button:R.CROSS},Backspace:{button:R.CIRCLE},Escape:{button:R.CIRCLE},KeyQ:{button:R.SQUARE},KeyE:{button:R.TRIANGLE},KeyZ:{button:R.L1},KeyC:{button:R.R1},Digit1:{trigger:`l2`},Digit3:{trigger:`r2`},KeyF:{button:R.L3},KeyG:{button:R.R3},Tab:{button:R.OPTIONS},Backquote:{button:R.SHARE},KeyH:{button:R.PS},KeyT:{button:R.TOUCHPAD},KeyW:{stick:`ly`,dir:-1},KeyS:{stick:`ly`,dir:1},KeyA:{stick:`lx`,dir:-1},KeyD:{stick:`lx`,dir:1},KeyI:{stick:`ry`,dir:-1},KeyK:{stick:`ry`,dir:1},KeyJ:{stick:`rx`,dir:-1},KeyL:{stick:`rx`,dir:1}};R.UP,R.DOWN,R.LEFT,R.RIGHT,R.CROSS,R.CIRCLE,R.SQUARE,R.TRIANGLE,R.L1,R.R1,R.L3,R.R3,R.OPTIONS,R.SHARE,R.PS,R.TOUCHPAD;var Pa=e=>Math.max(-32768,Math.min(32767,Math.round(e)));function Fa(e,t=Na){let n={...ja};for(let r of e){let e=t[r];e&&(`button`in e?n.buttons|=e.button:`stick`in e?n[e.stick]=Pa(n[e.stick]+e.dir*32767):n[e.trigger]=255)}return n}var Ia=[R.CROSS,R.CIRCLE,R.SQUARE,R.TRIANGLE,R.L1,R.R1,0,0,R.SHARE,R.OPTIONS,R.L3,R.R3,R.UP,R.DOWN,R.LEFT,R.RIGHT,R.PS,R.TOUCHPAD];function La(e){return Math.abs(e)<=1.01?Math.round((e+1)*3.5)%8:null}var Ra=[0,1,1,1,0,-1,-1,-1],za=[-1,-1,0,1,1,1,0,-1];function Ba(e,t){let n=e.axes[t.a]??0;if(t.hat){let e=La(n);return e===null?0:(t.hat===`x`?Ra:za)[e]}return t.inv?-n:n}var Va={buttons:Ia.flatMap((e,t)=>e?[[e,{b:t}]]:[]),l2:{b:6},r2:{b:7},lx:{a:0},ly:{a:1},rx:{a:2},ry:{a:3}};function Ha(e,t,n=!1){if(`b`in t){let r=e.buttons[t.b];return r?n&&r.value>0?Math.min(1,r.value):Math.max(+!!r.pressed,r.value):0}if(`h`in t){let n=La(e.axes[t.h]??9);if(n===null)return 0;let r=(n-t.at+8)%8;return+(r===0||r===1||r===7)}let r=e.axes[t.a];if(r===void 0)return 0;let i=t.rest??0;return Math.min(1,Math.max(0,(r-i)/(t.d-i)))}function Ua(e){if(e.mapping===`standard`)return Va;let t=Wa.get(e.id);if(t)return t;let n=e.axes.findIndex(e=>Math.abs(e)>1.05);if(n<0)return Va;let r={...Va,buttons:[...Va.buttons,[R.UP,{h:n,at:0}],[R.RIGHT,{h:n,at:2}],[R.DOWN,{h:n,at:4}],[R.LEFT,{h:n,at:6}]]};return Wa.set(e.id,r),r}var Wa=new Map;function Ga(e,t=Ua){let n={...ja},r=e=>Math.abs(e)<.08?0:Pa(e*32767),i=(e,t)=>Math.abs(t)>Math.abs(e)?t:e,a=(e,t)=>t?r(Ba(e,t)):0;for(let r of e){if(!r||!r.connected)continue;let e=t(r);for(let[t,i]of e.buttons)Ha(r,i)>.5&&(n.buttons|=t);e.l2&&(n.l2=Math.max(n.l2,Math.round(Ha(r,e.l2,!0)*255))),e.r2&&(n.r2=Math.max(n.r2,Math.round(Ha(r,e.r2,!0)*255))),n.lx=i(n.lx,a(r,e.lx)),n.ly=i(n.ly,a(r,e.ly)),n.rx=i(n.rx,a(r,e.rx)),n.ry=i(n.ry,a(r,e.ry))}return n}function Ka(e,t){return{buttons:e.buttons|t.buttons,l2:Math.max(e.l2,t.l2),r2:Math.max(e.r2,t.r2),lx:Pa(e.lx+t.lx),ly:Pa(e.ly+t.ly),rx:Pa(e.rx+t.rx),ry:Pa(e.ry+t.ry),touch:e.touch??t.touch??null,motion:e.motion??t.motion??null}}function qa(e,t,n,r=()=>globalThis.navigator?.getGamepads?.()??[]){let i=e=>e?.vibrationActuator;for(let a of e.some(i)?e:r()){let e=i(a);e&&(t===0&&n===0?e.reset?.():e.playEffect?.(`dual-rumble`,{duration:1e3,strongMagnitude:t/255,weakMagnitude:n/255}))}}var Ja=new Map;function Ya(e,t){return{id:`${e.id} (app)`,index:3+e.slot,connected:!0,mapping:`standard`,timestamp:0,axes:e.axes,buttons:e.buttons.map(e=>({pressed:e>.5,touched:e>0,value:e})),vibrationActuator:t?.vibrationActuator??null,hapticActuators:t?.hapticActuators??[]}}function Xa(e){let t=e?.getGamepads?.()??[];return Ja.size===0||t.some(e=>!!e?.connected)?[...t]:[...Ja.values()].sort((e,t)=>e.slot-t.slot).map(e=>Ya(e))}var Za=`b2,b1,b3,b0,b4,b5,b6,b7,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a3,a4(b1,b2,b0,b3,b6,b4,b7,b5,b8,b9,,,-a1,+a1,-a0,+a0(b1,b2,b0,b3,b4,b5,b6,b7,b8,b9,,,,,,,,,a0,a1(b0,b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a3(b2,b1,b3,b0,b4,b5,,,b8,b9,,,-a1,+a1,-a0,+a0(b1,b2,b0,b3,b4,b5,b6,b7,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a3(b2,b3,b0,b1,b4,b5,b6,b7,b8,b9,,,h0.1,h0.4,h0.8,h0.2,b11,,a0,a1,a2,a3(b1,b2,b0,b3,b4,b5,b6,b7,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,b12,,a0,a1,a2,a3(b1,b2,b0,b3,b4,b5,a3,a4,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,b12,,a0,a1,a2,a5(b0,b1,b3,b4,b6,b7,b8,b9,b10,b11,b13,b14,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a3(b1,b2,b0,b3,b4,b5,b6,b7,b8,b9,,,h0.1,h0.4,h0.8,h0.2,b12,,a0,a1(b1,b0,b2,b3,,b7,a3,a4,,b9,,,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a5,a2(b1,b0,b2,b3,,b7,a3,a4,,b9,,,b12,b14,b15,b13,,,a0,a1,a5,a2(b1,b0,b2,b3,,b7,b4,b5,,b9,,,b12,b14,b15,b13,,,a0,a1,a5~,a2~(b0,b1,b2,b3,b4,b5,a2,a5,b6,b7,b9,b10,h0.1,h0.4,h0.8,h0.2,b8,,a0,a1,a3,a4(b1,b2,,,b7,b5,b4,,,b9,,,b12,b14,b15,b13,,,a0,a1,a5,a2(b0,b1,b3,b4,b6,b5,b7,b2,b8,,,,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a3,a4(b0,b1,b3,b4,b6,b7,b9,b10,b2,b8,,,h0.1,h0.4,h0.8,h0.2,b5,,a0,a1,a3,a4(b1,b2,b0,b3,b4,b5,b6,b7,b8,b9,,,-a1,+a1,-a0,+a0(b0,b1,b3,b4,b6,b5,b7,b2,,b8,,,-a1,+a1,-a0,+a0(b0,b1,b3,b4,b6,b7,a5,a4,b10,b11,b12,b13,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a3(b0,b1,b2,b3,b4,b5,a5,a4,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,b14,,a0,a1,a2,a3(b14,b13,b15,b12,b10,b11,b8,b9,b0,b3,b1,b2,b4,b6,b7,b5,b16,,a0,a1,a2,a3(b0,b1,b3,b2,b4,b5,a2,a5,b8,b9,b11,b12,h0.1,h0.4,h0.8,h0.2,b10,,a0,a1,a3,a4(b1,b2,b0,b3,b4,b5,a3,a4,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,b12,b13,a0,a1,a2,a5(b2,b1,b3,b0,b6,b7,b4,b5,b8,b9,,,-a1,+a1,-a0,+a0(b1,b2,b0,b3,b4,b5,,,b8,b9,,,b12,b13,b15,b14,,,a0,a1,a3,a4(b0,b1,b3,b2,b4,b5,b6,b7,b8,b9,b11,b12,b13,b14,b15,b16,b10,,a0,a1,a2,a3(b0,b1,b3,b2,,b6,a2,a5,,b7,,,b8,b9,b10,b11,,,a0,a1,a3,a4(b0,b1,b3,b2,b4,b5,,,b8,b9,,,b10,b11,b12,b13,,,a0,a1,a2,a3(b0,b1,b2,b3,b4,b5,,,b13,b8,b10,,,,,,,,hx,hy(b0,b1,b2,b3,b4,b5,,,b12,b9,b11,,,,,,,,hx,hy(b0,b1,b3,b2,b5,b6,b7,b8,b9,b10,b12,b13,b14,b15,b16,b17,b11,,a0,a1,a2,a3(b0,b1,b3,b2,b5,b6,b7,b8,b9,b10,b12,b13,h0.1,h0.4,h0.8,h0.2,b11,,a0,a1,a2,a3(b0,b1,b3,b2,b4,b5,b6,b7,b8,b9,,,h0.1,h0.4,h0.8,h0.2(b0,b1,,,,b2,,b4,,b5,,,h0.1,h0.4,h0.8,h0.2,b6(b0,b1,b2,b3,b12,b4,b13,b5,b14,b6,b15,b7,b11,b8,b10,b9,b16,,a0,a1~,a2,a3~(b1,b3,b0,b2,b13,b5,b12,b4,,b6,,,b11,b8,b10,b9,b16,,a0,a1~,a2,a3~(b0,b1,b3,b4,b6,b7,a5,a4,b10,b11,b13,b14,h0.1,h0.4,h0.8,h0.2,b33,,a0,a1,a2,a3(b2,b1,b3,b0,b4,b5,b6,b7,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,b12,,a0,a1,a2,a3(b0,b1,b3,b4,b6,b7,b8,b9,b10,b11,b13,b16,h0.1,h0.4,h0.8,h0.2,b12,,a0,a1,a2,a3(b0,b1,b3,b4,b6,b7,a5,a4,b10,b11,b13,b14,h0.1,h0.4,h0.8,h0.2,b15,,a0,a1,a2,a3(b1,b2,b0,b3,b4,b5,b6,b7,b8,b9,,,h0.1,h0.4,h0.8,h0.2,b12(b0,b1,b2,b3,b4,b5,a2,a5,b6,b7,b9,b10,,,,,b8,,a0,a1,a3,a4(b1,b0,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,b12,,a0,a1,a2,a3(b1,b2,b0,b3,b4,b5,b6,b7,b8,b9,,,h0.1,h0.4,h0.8,h0.2,b12,b13(b1,b2,b0,b3,b4,b5,b6,b7,b8,b9,b10,,h0.1,h0.4,h0.8,h0.2,b12,b13(b0,b1,b2,b3,b4,b5,b6,b7,b8,b9,b11,b12,h0.1,h0.4,h0.8,h0.2,b10,,a0,a1,a2,a3(b0,b1,b2,b3,b4,b5,a2,a5,b6,b7,b9,b10,b12,b13,b14,b15,,,a0,a1,a3,a4(b0,b1,b2,b3,b4,b5,a2,a5,b6,b7,b9,b10,b14,b13,b14,b13,,,a0,a1,a3,a4(b1,b0,b2,b3,,,,,b8,b9,,,h0.1,h0.4,h0.8,h0.2(b2,b3,b1,b0,b4,b5,b6,b7,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,b12,,a0,a1,a2,a3(b0,b1,b2,b3,b4,b5,b6,b7,b8,b9,,,h0.1,h0.4,h0.8,h0.2,b10(b1,b2,b0,b3,b4,b5,a3,a4,b8,b9,,,h0.1,h0.4,h0.8,h0.2,b12,b13,a0,a1,a2,a5(b1,b2,b0,b3,b4,b5,b6,b7,b8,b9,,,h0.1,h0.4,h0.8,h0.2,b12,,a0,a1,a2,a3(b0,b1,b2,b3,b4,b5,+a2,+a5,b6,b7,b9,b10,h0.1,h0.4,h0.8,h0.2,b8,,a0,a1,a3,a4(b1,b2,b0,b3,b4,b5,a3,a4,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,b12,b13(b1,b2,b0,b3,b4,b5,b6,b7,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,b12(b1,b2,b0,b3,b4,b5,b6,b7,b8,b9,,,h0.1,h0.4,h0.8,h0.2(b1,b2,b0,b3,b4,b5,a3,a4,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,b13,,a0,a1,a2,a5(b0,b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,b12,,a0,a1,a2,a3(b1,b0,b3,b2,b4,b5,a2,a5,b6,b7,,,h0.1,h0.4,h0.8,h0.2,b8(b1,b2,,,,,,,b8,b9,,,h0.1,h0.4,h0.8,h0.2(b0,b1,b3,b4,b6,b7,a5,a4,b10,b11,b13,b14,h0.1,h0.4,h0.8,h0.2,b12,,a0,a1,a2,a3(b0,b1,b3,b4,b6,b7,a5,a4,b10,b11,b13,b14,h0.1,h0.4,h0.8,h0.2,b21,,a0,a1,a2,a3(b0,b1,b2,b3,b4,b5,a5,a4,b6,b7,b9,b10,h0.1,h0.4,h0.8,h0.2,b8,,a0,a1,a2,a3(b1,b2,b0,b3,b4,b5,a3,a4,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,b13,b13,a0,a1,a2,a5(b0,b1,b2,b3,b4,b5,a5,a4,,b6,b7,b8,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a3(b0,b1,b2,b3,b4,b5,a2,a5,b7,b6,b9,b10,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a3,a4(b0,b1,b2,b3,b4,b5,a2,a5,b6,b7,b9,b10,h0.1,h0.4,h0.8,h0.2,b7,,a0,a1,a3,a4(b0,b1,b2,b3,b4,b5,a2,a5,b6,b7,b9,b10,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a3,a4(b0,b1,b2,b3,b4,b5,a5,a4,b9,b6,b7,b8,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a3(b0,b1,b3,b4,b6,b7,a5,a4,b10,b11,b13,b14,h0.1,h0.4,h0.8,h0.2,b22,,a0,a1,a2,a3(b0,b1,b2,b3,b4,b5,a2,a3,b6,b7,b9,,b12,b14,b15,b13,b8,,a0,a1(b3,b4,b5,b6,b7,b8,a9,a8,b11,b12,b14,b15,b16,b17,b18,b19,b13,,a0,a1,a2,a3(b0,b1,b3,b4,b8,b6,b9,b7,,b11,,,h0.1,h0.4,h0.8,h0.2,,,a0,a1(b0,b1,b3,b4,b7,b9,b6,b8,b10,b11,,,h0.1,h0.4,h0.8,h0.2(b0,b1,b2,b3,b4,b5,a2,a5,b6,b7,b9,b10,h0.1,h0.4,h0.8,h0.2,,,a0,a1(b1,b0,b4,b3,b6,b7,,,b10,b11,,,-a1,+a1,-a0,+a0(b1,b0,b4,b3,b6,b7,b8,b9,b10,b11,b13,b14,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a3(b0,b1,,,b6,b7,b8,b9,,b11,,,h0.1,h0.4,h0.8,h0.2,b12,,a0,a1,a2,a3(b0,b3,b1,b4,,b10,a5,a4,,b11,b13,b14,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a3(b1,b0,b4,b3,b6,b7,a5,a4,b10,b11,b13,b14,h0.1,h0.4,h0.8,h0.2,b12,,a0,a1,a2,a3(b0,b1,,,b6,b7,b8,b9,b10,b11,b13,,h0.1,h0.4,h0.8,h0.2,b12,,a0,a1,a2,a3(b0,b1,b3,b4,b6,b7,b8,b9,b10,b11,b13,b14,h0.1,h0.4,h0.8,h0.2,b2,,a0,a1,a2,a3(b1,b0,b4,b3,b6,b7,b8,b9,b10,b11,b13,b14,h0.1,h0.4,h0.8,h0.2,b2,,a0,a1,a2,a3(b1,b0,b4,b3,b6,b7,,,b10,b11,,,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a3(b1,b0,b4,b3,b6,b7,a5,a4,b10,b11,b13,b14,h0.1,h0.4,h0.8,h0.2,b2,,a0,a1,a2,a3(b0,b1,b3,b4,b6,b7,b8,b9,b10,b11,,,h0.1,h0.4,h0.8,h0.2,b2,,a0,a1,a2,a3(b0,b1,b3,b4,,b6,,b7,b10,b11,,,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a3(b1,b0,,,,,,,b10,b11,,,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a3(b0,b1,b3,b4,b6,b7,a8,b9,b10,b11,,,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a3(b1,b0,b4,b3,b6,b7,b8,b9,b10,b11,b13,b14,h0.1,h0.4,h0.8,h0.2,b12,,a0,a1,a2,a3(b1,b0,b4,b3,b6,b7,b8,b9,b10,b11,b13,b14,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a3,a4(b1,b0,b4,b3,b6,b7,a5,a4,b10,b11,b13,b14,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a3(b0,b1,b3,b4,b8,b6,b9,b7,,b10,,,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a3(b1,b0,b4,b3,b6,b7,a4,a5,b10,b11,b13,b14,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a3(b1,b0,b4,b3,b6,b7,b8,b9,b10,b11,,,h0.1,h0.4,h0.8,h0.2,b12,,a0,a1,a2,a3(b0,b1,b3,b4,b6,b7,,,b10,b11,b13,b14,h0.1,h0.4,h0.8,h0.2,b12,,a0,a1,a2,a3(b2,b1,b3,b0,b4,b5,b6,b7,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a3(b1,b2,b0,b3,b6,b4,b7,b5,b8,b9,,,-a4,+a4,-a3,+a3(b4,b8,b0,b12,b16,b20,b24,b28,b32,b36,b40,b44,h0.1,h0.4,h0.8,h0.2,,,a0,a4,a8,a12(b8,b12,b0,b4,b16,b20,b24,b28,b32,b36,,,h0.1,h0.4,h0.8,h0.2,b44,,a0,a4,a8,a12(b4,b0,b8,b12,,b28,a12,a16,,b36,,,h0.1,h0.4,h0.8,h0.2,,,a0,a4,a20,a8(b1,b2,b0,b3,,b7,a3,a4,,b9,,,b12,b14,b15,b13,,,a0,a1,a5,a2(b4,b0,b8,b12,,b28,a12,a16,,b36,,,b48,b56,b60,b52,,,a0,a4,a20,a8(b1,b2,,,b7,b5,a3,,,b9,,,b12,b14,b15,b13,,,a0,a1,a5,a2(b0,b1,b2,b3,b4,b5,a2,a5,b9,b8,b6,b7,b11,b12,b13,b14,b10,,a0,a1,a3,a4(b0,b1,b3,b4,b6,b7,,,b5,b8,,,-a1,+a1,-a0,+a0,b2(b0,b1,b2,b3,b4,b5,b6,b15,b8,b9,,,h0.1,h0.4,h0.8,h0.2(b1,b2,b0,b3,b4,b5,b6,b7,b8,b9,b10,b13,h0.1,h0.4,h0.8,h0.2,b12,,a0,a1,a2,a3(b1,b2,b0,b3,b4,b5,b6,b7,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,b12,b13,a0,a1,a2,a3(b1,b2,b0,b3,b4,b5,b6,b7,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,b12,b13(b1,b2,b0,b3,b4,b5,b6,b7,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,b12,,a0,a1,a2,a5(b0,b1,b3,b4,b6,b7,a5,a4,b12,b13,b15,b16,h0.1,h0.4,h0.8,h0.2,b14,,a0,a1,a2,a3(b1,b0,b4,b3,b6,b7,a5,a4,b10,b11,,,-a1,+a1,-a0,+a0,b2(b0,b1,b3,b4,b6,b7,,,b10,b11,,,-a1,+a1,-a0,+a0(b0,b1,b3,b4,b6,b7,b8,a4,b10,b11,b13,b14,h0.1,h0.4,h0.8,h0.2,b12,,a0,a1,a2,a3(b0,b1,b3,b4,b6,b7,b8,b9,b10,b11,b13,b14,h0.1,h0.4,h0.8,h0.2,b12,,a0,a1,a2,a3(b1,b0,b4,b3,b6,b7,,,b10,b11,,,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a31(b0,b1,b3,b4,b8,b6,b9,b7,,b11,,,h0.1,h0.4,h0.8,h0.2,b2,,a0,a1,a2,a3(b0,b1,b3,b4,b6,b7,b8,b9,b10,b11,,,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a3(b0,b1,b3,b4,b6,b7,a5,a4,b10,b11,,,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a3(b1,b0,b4,b3,b6,b7,b8,b9,b10,b11,b13,b14,h0.1,h0.4,h0.8,h0.2,b12,,a0,a1,a3,a4(b1,b0,b4,b3,b6,b7,a4,a5,b10,b11,b13,b14,h0.1,h0.4,h0.8,h0.2,b2,,a0,a1,a2,a3(b1,b0,b4,b3,b6,b7,a5,a4,b10,b11,,,h0.1,h0.4,h0.8,h0.2,b12,,a0,a1,a2,a3(b0,b1,b3,b4,b6,b7,,,b10,b11,,,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a3(b0,b1,b3,b4,b6,b7,,,b10,b11,,,,,,,,,hx,hy(b0,b1,b2,b3,b4,b5,b6,b7,b16,b15,b8,b9,b10,b11,b13,b12,b17,,a0,a1~,a2,a3~(b2,b1,b3,b0,b4,b5,b6,b7,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a4(b2,b1,b3,b0,b4,b5,b6,b7,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a5(b0,b1,b2,b3,b33,b5,,,b6,b7,,,h0.1,h0.4,h0.8,h0.2(b0,b1,b3,b4,b6,b2,,,,b9,,,h0.1,h0.4,h0.8,h0.2(b1,b2,b0,b3,b4,b5,b6,b7,b8,b9,,,h0.1,h0.4,h0.8,h0.2,,,a0,a1(b0,b1,b3,b4,b6,b7,b8,b9,b10,b11,b13,b14,h0.1,h0.4,h0.8,h0.2,b12,,a0,a1,a3,a4(b1,b2,,,b6,,b9,b7,,b8,,,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a3,a2(b2,b1,b3,b0,b4,b5,a3,a4,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a5(b0,b1,b3,b4,,b6,,b2,b7,b9,,,b2,b14,b15,b13(b0,b1,b2,b3,b4,b5,a2,a5,b6,b7,b8,b9,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a3,a4(b0,b1,b3,b4,b6,b5,b7,b2,b10,b8,,,h0.1,h0.4,h0.8,h0.2,,,a0,a1(b0,b1,b3,b4,b6,b7,a5~,a2~,b2,b8,b8,b5,h0.1,h0.4,h0.8,h0.2,,,a0,a1(b0,b1,b4,,b9,b10,b6,b7,b8,,b5,b2,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a3,a4(b0,b1,b2,b3,b4,b5,,,b6,b7,b8,b9,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a3,a4(b0,b1,b2,b3,b5,b4,b10,b11,b7,b6,b8,b9,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a3,a4(b0,b1,b3,b4,b6,b7,b8,b9,b10,b11,b13,b14,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a5(b1,b2,b0,b3,b4,b5,a3,a4,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a5(b0,b1,b3,b2,b6,b7,b4,b5,b8,b9,b11,b12,b13,b14,b15,b16,,,a0,a1,a2,a3(b0,b1,b3,b4,b6,b7,b8,b9,b10,b11,b13,b14,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a3,a4(b16,b19,b17,b18,b6,b7,b8,b9,b10,b11,b13,,h0.1,h0.4,h0.8,h0.2,b12,,a0,a1,a3,a4(b2,b1,b3,b0,b6,b7,b4,b5,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a5,a2(b0,b1,b2,b3,b4,b5,a2,a2,b6,b7,b8,b9,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a3,a4(b0,b1,b2,b3,b4,b5,a2,,b6,b7,b8,b9,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a5(b0,b1,b2,b3,b4,b5,b8,b9,b6,b7,,,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a3,a4(b0,b1,b2,b3,b4,b5,b10,b11,b6,b7,b8,b9,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a3,a4(b0,b1,b2,b3,b4,b5,b10,b11,b7,b6,b8,b9,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a3,a4(b1,b2,b0,b3,b4,b5,b6,b7,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a5(b1,b2,b0,b3,b10,b5,b11,b7,b8,b9,b4,b6,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a3(b1,b2,b0,b3,b5,b7,b4,b6,b8,b9,,,h0.1,h0.4,h0.8,h0.2,b12(b1,b2,b0,b3,b4,b5,a3,a4,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a3(b1,b2,b0,b3,b4,b5,a3,a4,b8,b13,b10,b11,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a5(b1,b2,b0,b3,b4,b5,b6,b7,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,b12,b13,a0,a1,a2,a5(b0,b4,b2,b1,b3,b6,,,b11,b9,,,h0.1,h0.4,h0.8,h0.2(b1,b2,b0,b3,b4,b5,a2,a5,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a3,a4(b0,b1,b2,b3,b9,b10,a4,a5,b4,b6,b7,b8,b11,b12,b13,b14,,,a0,a1,a2,a3(b1,b0,b3,b2,b4,b5,,,b6,b7,b8,b9,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a3,a4(b1,b2,b0,b3,b4,b5,b6,b7,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,,,a0,a1(b0,b1,b2,b3,b4,b5,+a2,-a2,b6,b7,b8,b9,h0.1,h0.4,h0.8,h0.2,,,a0,a1(b1,b0,b3,b2,b4,b5,b6,b7,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,b12,,a0,a1,a2,a3(b0,b1,b3,b4,b6,b7,,,,b11,b13,b14,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a5(b0,b1,b2,b3,b4,b5,+a2,-a2,b6,b7,b8,b9,b11,b14,b12,b13,b10,,a0,a1,a3,a4(b0,b1,b2,b3,b4,b5,,a2,b6,b7,b8,b9,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a3,a4(b0,b1,b3,b4,b6,b7,a4,a3,,,b13,b14,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a5(b0,b1,b2,b3,b4,b5,,,b6,b7,b8,b9,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a5(b6,b7,b9,b10,b12,b13,b14,b15,b16,b17,b19,b20,h0.1,h0.4,h0.8,h0.2,b18,,a0,a1,a3,a4(b0,b1,b2,b3,b4,b5,+a2,-a2,b6,b7,b8,b9,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a3,a4(b0,b1,,,,,,,b7,b6,,,h0.1,h0.4,h0.8,h0.2,,,a0,a1(b0,b1,b3,b4,b6,b7,,,b10,b11,,,h0.1,h0.4,h0.8,h0.2,,,a0,a1(b0,b1,b3,b4,b6,b7,,,b10,b11,,,,,,,,,a0,a1(b1,b0,b4,b3,b6,b7,b8,b9,b10,b11,b13,b14,h0.1,h0.4,h0.8,h0.2,b2,,a0,a1,a2,a5(b1,b0,b4,b3,b6,b7,b8,b9,b10,b11,b13,b14,h0.1,h0.4,h0.8,h0.2,b2,,a0,a1,a3,a4(b1,b0,b4,b3,,b6,,b7,b10,b11,,,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a3,a5`.split(`(`),Qa={l00790006:0,l00790011:1,l00790016:2,l00790122:3,l00790126:4,l00791800:5,l00791803:6,l0079181a:7,l0079181b:8,l0079181c:9,l00791830:10,l00791843:11,l00791844:12,l00791845:11,l00791846:13,l007918d2:7,l007918d4:14,l0079954e:15,l046dc20a:16,l046dc211:17,l046dc216:5,l046dc218:5,l046dc219:5,l046dc21a:18,l046dc21d:14,l046dc21e:14,l046dc21f:14,l046dcad1:5,l046dcad2:5,l04b4010a:19,l04b42411:20,l04b42412:21,l054c0268:22,l054c05c4:23,l054c09cc:24,l054c0ba0:24,l054c0cda:25,l054c0ce6:24,l054c0df2:24,l054c0e5f:24,l054c1337:26,l057e0330:27,l057e0337:28,l057e1337:29,l057e2006:30,l057e2007:31,l057e2008:32,l057e2009:33,l057e2017:34,l057e201e:35,l057e2069:36,l057e2073:37,l05ac022d:38,l05ac055b:39,l05ac057a:40,l05ac061a:41,l0e6f0109:42,l0e6f011e:7,l0e6f011f:14,l0e6f0128:5,l0e6f012f:7,l0e6f0130:7,l0e6f0131:14,l0e6f0139:14,l0e6f0146:43,l0e6f0164:14,l0e6f0180:7,l0e6f0181:7,l0e6f0184:7,l0e6f0185:44,l0e6f0187:7,l0e6f0188:7,l0e6f0203:45,l0e6f0207:46,l0e6f0213:14,l0e6f0214:7,l0e6f02a7:14,l0e6f02a8:47,l0e6f02b2:48,l0e6f02b8:14,l0e6f02c8:14,l0e6f02d7:49,l0e6f02d8:14,l0e6f02da:14,l0e6f02ef:14,l0e6f02f1:14,l0e6f0301:14,l0e6f0315:14,l0e6f0401:14,l0e6f0413:14,l0e6f1112:50,l0e6f1113:51,l0e6ff501:14,l0f0d0009:7,l0f0d0010:42,l0f0d0011:7,l0f0d0016:52,l0f0d0022:42,l0f0d004d:7,l0f0d005e:53,l0f0d005f:54,l0f0d0066:24,l0f0d0067:14,l0f0d006a:8,l0f0d006b:7,l0f0d006d:55,l0f0d006e:7,l0f0d0084:8,l0f0d0085:7,l0f0d0086:47,l0f0d0087:56,l0f0d0088:57,l0f0d0092:58,l0f0d00aa:39,l0f0d00c1:7,l0f0d00ee:59,l0f0d00f6:60,l0f0d00fb:39,l0f0d0137:61,l0f0d0138:62,l0f0d0150:14,l0f0d0185:14,l0f0d0196:63,l0f0d01ab:63,l15320401:24,l15320402:7,l15320705:64,l15320900:65,l15320a03:14,l15320a14:14,l15320a29:14,l15321000:8,l15321008:66,l1532100a:59,l1532100b:24,l15321100:24,l18d19400:65,l20d60dad:67,l20d62002:68,l20d62005:14,l20d6200b:14,l20d6200f:69,l20d62065:14,l20d62802:14,l20d64001:70,l20d64002:70,l20d64005:14,l20d66271:71,l20d6792a:24,l20d689e5:71,l20d6a710:5,l20d6a711:7,l20d6a712:7,l20d6a713:7,l20d6a714:7,l20d6ca6d:7,l24c65300:14,l24c6531a:14,l24c6541a:14,l24c6543a:14,l24c6581a:14,l24c65b02:14,l24c65d04:14,l24c6891a:63,l24c6891b:63,l24c6892a:72,l24c6892b:63,l24c6fafe:14,l27f80bbf:63,l28de1102:73,l28de1105:73,l28de1106:73,l28de1142:73,l28de11fc:43,l28de11ff:14,l28de1201:73,l28de1202:73,l28de1205:74,l2dc80651:75,l2dc81003:76,l2dc81080:76,l2dc82000:14,l2dc82003:14,l2dc8200a:77,l2dc82019:14,l2dc82025:14,l2dc82101:63,l2dc82830:78,l2dc82862:79,l2dc82865:79,l2dc82869:80,l2dc8286a:81,l2dc83010:82,l2dc83011:63,l2dc83012:63,l2dc83013:63,l2dc83015:63,l2dc83016:63,l2dc83017:63,l2dc83019:83,l2dc8301b:63,l2dc8301d:63,l2dc83100:84,l2dc83101:85,l2dc83102:85,l2dc83103:85,l2dc83104:85,l2dc83106:14,l2dc8310a:14,l2dc8310b:14,l2dc83230:86,l2dc83810:79,l2dc83820:87,l2dc85006:88,l2dc85101:89,l2dc85103:86,l2dc85104:90,l2dc85107:91,l2dc85108:91,l2dc85109:90,l2dc85111:92,l2dc85112:82,l2dc86000:92,l2dc86001:93,l2dc86002:92,l2dc86006:82,l2dc86007:94,l2dc86009:82,l2dc86012:63,l2dc86100:87,l2dc86101:93,l2dc86102:92,l2dc86728:95,l2dc89000:96,l2dc89001:96,l2dc89012:93,l2dc89015:79,l2dc89018:78,l2dc89020:97,l2dc89025:98,l2dc8ab21:78,l35371004:14,l35371007:63,l3537100b:14,l35371046:63,l35371058:63,l35371094:63,l35371097:63,l358a0102:63,l358a0202:63,l358a0203:63,l358a0204:63,m00790006:99,m00790011:100,m00791800:101,m00791803:102,m0079181c:41,m00791843:103,m00791844:104,m00791846:105,m007918d2:39,m0079954e:106,m046dc216:5,m046dc218:5,m046dc219:5,m046dc21a:18,m046dc21f:107,m04b4010a:108,m04b42411:20,m04b42412:20,m054c0268:22,m054c05c4:24,m054c09cc:24,m054c0ba0:24,m054c0cda:25,m054c0ce6:24,m054c0df2:24,m054c0e5f:24,m054c1337:26,m057e2006:30,m057e2007:31,m057e2009:60,m057e2017:109,m057e2069:36,m057e2073:37,m05ac061a:41,m0e6f0109:42,m0e6f0184:110,m0e6f0187:5,m0e6f0201:107,m0e6f0203:45,m0e6f0207:46,m0e6f0401:107,m0f0d002d:54,m0f0d004d:7,m0f0d005e:111,m0f0d005f:7,m0f0d0066:24,m0f0d006e:7,m0f0d0084:8,m0f0d0085:7,m0f0d0087:112,m0f0d0088:57,m0f0d0092:58,m0f0d00aa:39,m0f0d00c1:7,m0f0d00ee:113,m0f0d00f6:3,m0f0d0138:62,m0f0d0200:7,m15320401:24,m15320402:7,m15320705:64,m15320900:65,m15320a03:107,m15321000:8,m15321100:24,m18d19400:65,m20d66271:71,m20d6792a:24,m20d6a710:7,m20d6a711:44,m20d6ca6d:7,m24c6543a:107,m24c65d04:107,m24c6891a:114,m24c6891b:63,m24c6892a:64,m24c6892b:63,m24c6fafe:107,m2dc80651:115,m2dc82820:116,m2dc82830:78,m2dc82840:78,m2dc82865:87,m2dc82869:80,m2dc8286a:81,m2dc83011:63,m2dc83012:63,m2dc83013:63,m2dc83015:117,m2dc83016:63,m2dc83017:118,m2dc83019:83,m2dc8301b:63,m2dc8301d:63,m2dc83100:9,m2dc83101:85,m2dc83102:85,m2dc83103:85,m2dc83104:85,m2dc83105:84,m2dc83230:119,m2dc83810:94,m2dc85006:120,m2dc85101:89,m2dc85103:86,m2dc85104:90,m2dc85107:121,m2dc85108:122,m2dc85109:90,m2dc85111:82,m2dc85112:82,m2dc86001:79,m2dc86002:85,m2dc86006:82,m2dc86009:123,m2dc86101:85,m2dc86102:85,m2dc86728:95,m2dc89000:96,m2dc89001:79,m2dc89012:78,m2dc89015:124,m2dc89018:78,m2dc89020:125,m2dc89025:126,m2dc89026:127,m2dc8ab12:116,m35371022:63,m35371041:63,m35371046:63,m35371104:63,m358a0102:63,m358a0201:128,m358a0202:128,m358a0203:128,m358a0204:63,w00790002:129,w00790007:129,w0079000a:129,w00790016:18,w00790122:99,w00790126:130,w00791804:131,w0079181a:7,w0079181b:113,w00791824:132,w00791830:133,w00791845:11,w00791847:12,w0079184f:134,w00791879:135,w0079188f:136,w007918ae:137,w007918d4:138,w046dc209:139,w046dc20a:16,w046dc20b:140,w046dc211:141,w046dc21d:138,w046dc21e:142,w046dc242:142,w046dca84:143,w046dca88:143,w046dcad1:5,w046dcad2:7,w04b42410:144,w04b4c681:130,w054c05c5:145,w057e0330:146,w05ac022d:144,w05ac033d:147,w05ac044d:147,w05ac055b:39,w05ac057a:148,w0e6f0003:149,w0e6f0111:7,w0e6f0114:7,w0e6f0119:7,w0e6f011a:7,w0e6f011e:7,w0e6f011f:150,w0e6f0124:42,w0e6f0128:7,w0e6f012f:7,w0e6f0130:7,w0e6f0132:7,w0e6f0146:138,w0e6f0164:151,w0e6f0180:7,w0e6f0181:7,w0e6f0185:44,w0e6f0188:7,w0e6f0189:7,w0e6f0214:7,w0e6f0301:138,w0e6f1113:51,w0e6f6302:7,w0f0d0009:7,w0f0d000a:152,w0f0d000c:153,w0f0d000d:154,w0f0d0010:155,w0f0d0011:57,w0f0d0013:155,w0f0d001b:152,w0f0d0021:155,w0f0d0022:54,w0f0d0025:42,w0f0d0026:155,w0f0d0027:42,w0f0d0032:155,w0f0d003d:156,w0f0d0040:157,w0f0d0042:155,w0f0d0049:7,w0f0d004b:155,w0f0d0051:155,w0f0d0054:7,w0f0d0055:8,w0f0d005b:113,w0f0d005c:7,w0f0d0064:155,w0f0d0067:70,w0f0d006a:8,w0f0d006b:7,w0f0d006f:158,w0f0d0070:57,w0f0d007b:155,w0f0d008a:8,w0f0d008b:7,w0f0d008c:138,w0f0d009c:8,w0f0d00a0:159,w0f0d00a5:160,w0f0d00a6:111,w0f0d00ad:161,w0f0d00ae:142,w0f0d00af:162,w0f0d00c0:138,w0f0d00c9:5,w0f0d00d8:163,w0f0d00dc:138,w0f0d0101:5,w0f0d0104:142,w0f0d0123:144,w0f0d0137:164,w0f0d0162:165,w0f0d0164:166,w0f0d0196:134,w0f0d0202:167,w0f0d1011:168,w153202a6:169,w15320300:170,w15320707:147,w15320a14:138,w15321004:145,w15321007:145,w15321009:145,w1532100a:5,w18d12c40:171,w20d60060:7,w20d60dad:142,w20d6319f:7,w20d64026:134,w20d64033:134,w20d6571d:7,w20d6576d:7,w20d65795:7,w20d657c7:7,w20d657e5:7,w20d689e5:172,w20d6a712:7,w20d6a713:7,w20d6a714:7,w20d6a720:7,w24c6531a:153,w24c65b02:138,w27f80bbf:173,w28de11fc:70,w28de11ff:174,w2dc802e0:175,w2dc81003:176,w2dc81080:176,w2dc82100:144,w2dc82810:177,w2dc82862:78,w2dc83000:78,w2dc83001:178,w2dc8301c:134,w2dc8310a:134,w2dc83820:179,w2dc85001:180,w2dc86000:79,w2dc86003:123,w2dc86012:134,w2dc86100:85,w2dc86103:123,w2dc8ab11:179,w2dc8ab20:178,w2dc8ab21:78,w35371004:138,w35371007:134,w35371094:134,w35371116:134},$a=e=>e.toLowerCase().padStart(4,`0`);function eo(e){let t=/^(.*?)\s*\((?:[^()]*?\s)?Vendor:\s*([0-9a-f]{1,4})\s+Product:\s*([0-9a-f]{1,4})\s*\)\s*$/i.exec(e);if(t)return{vendor:$a(t[2]),product:$a(t[3]),name:t[1].trim()};let n=/^([0-9a-f]{1,4})-([0-9a-f]{1,4})-(.*)$/i.exec(e.trim());return n?{vendor:$a(n[1]),product:$a(n[2]),name:n[3].trim()}:null}function to(e){return(eo(e)?.name??e.replace(/\s*\((?:XInput\s*)?STANDARD GAMEPAD\)\s*$/i,``)).trim()||e}function no(e=globalThis.navigator){let t=e?.userAgent??``;return/Android|iPhone|iPad|iPod/i.test(t)?null:/Macintosh|Mac OS X/i.test(t)?(e?.maxTouchPoints??0)>1?null:`m`:/Windows/i.test(t)?`w`:/Linux|CrOS|X11/i.test(t)?`l`:null}function ro(e,t){if(!t)return null;let n=t===`l`?[`l`]:[`m`,`w`];for(let t of n){let n=Qa[`${t}${e.vendor}${e.product}`];if(n!==void 0)return Za[n]??null}return null}function io(e){return e.mapping!==`standard`&&eo(e.id)?.vendor===`2dc8`}var ao={6003:`switch`,6006:`switch`,6103:`switch`,3010:`switch`,6001:`startx`,6002:`startx`,6101:`startx`,6102:`startx`,3011:`receiver`,3012:`receiver`,3013:`receiver`,3015:`receiver`,3016:`receiver`,3017:`receiver`,"301b":`receiver`,"301c":`receiver`,"301d":`receiver`,6012:`receiver`,5112:`none`,9020:`none`};function oo(e){let t=eo(e);return t&&ao[t.product]||`manual`}var so={1:0,2:2,4:4,8:6};function co(e){let t=0,n=!1;for(let r of e){let e=/a(\d+)/.exec(r);e&&(t=Math.max(t,Number(e[1])+1)),r.startsWith(`h`)&&(n=!0)}return{n:t,hat:n}}function lo(e,t,n){let{n:r,hat:i}=co(t),a=Ia.length,o=e.axes.findIndex(e=>Math.abs(e)>1.05),s=e=>e;if(i&&o<0)return n===`l`&&e.axes.length>=r+2?{hat:-1,hatXY:r,axis:s}:null;if(!(i?o>r:n!==`l`&&e.axes.length>=r+2))return{hat:o,hatXY:-1,axis:s};if(r<=4)return{hat:o,hatXY:-1,axis:e=>[0,1,2,5][e]??e};let c=t[a+2]?.replace(`~`,``)===`a2`&&t[a+3]?.replace(`~`,``)===`a3`,l=[t[6],t[7]].every(e=>/^a[45]~?$/.test(e??``));return r===6&&c&&l?{hat:o,hatXY:-1,axis:e=>[0,1,2,5,3,4][e]??e}:{hat:o,hatXY:-1,axis:s}}function uo(e,t){let n=/^b(\d+)$/.exec(e);if(n)return{b:Number(n[1])};if(n=/^([+-]?)a(\d+)(~?)$/.exec(e),n){let e=t.axis(Number(n[2]));return n[1]===`+`?{a:e,d:1}:n[1]===`-`?{a:e,d:-1}:n[3]?{a:e,d:-1,rest:1}:{a:e,d:1,rest:-1}}if(n=/^h0\.(\d)$/.exec(e),n){let e=so[n[1]];if(e===void 0)return null;if(t.hat>=0)return{h:t.hat,at:e};if(t.hatXY>=0)return e===0?{a:t.hatXY+1,d:-1}:e===4?{a:t.hatXY+1,d:1}:e===6?{a:t.hatXY,d:-1}:{a:t.hatXY,d:1}}return null}function fo(e,t){let n=/^a(\d+)(~?)$/.exec(e);if(n)return n[2]?{a:t.axis(Number(n[1])),inv:!0}:{a:t.axis(Number(n[1]))};if(e===`hx`||e===`hy`){if(t.hat>=0)return{a:t.hat,hat:e===`hx`?`x`:`y`};if(t.hatXY>=0)return{a:t.hatXY+ +(e===`hy`)}}return null}function po(e,t,n){let r=e.split(`,`),i=lo(t,r,n);if(!i)return null;let a={buttons:[],l2:null,r2:null,lx:null,ly:null,rx:null,ry:null};for(let e=0;eArray.isArray(e)&&e.length===2&&typeof e[0]==`number`&&_o(e[1]))&&[t.l2,t.r2,t.lx,t.ly,t.rx,t.ry].every(_o)}function yo(){try{let e=Lt(go),t=e?JSON.parse(e):null;return!t||typeof t!=`object`||Array.isArray(t)?{}:Object.fromEntries(Object.entries(t).filter(e=>vo(e[1])))}catch{return{}}}function bo(e,t){let n=yo();return t?n[e]=t:delete n[e],It(go,JSON.stringify(n)),xo=n,n}var xo=null;function So(e){return xo??=yo(),xo[e.id]??To(xo,e.id)??ho(e)??Ua(e)}function Co(e){return xo??=yo(),xo[e.id]?`saved`:e.mapping===`standard`?`standard`:ho(e)?`known`:`guess`}function wo(e){return ho(e)??Ua(e)}function To(e,t){if(!t.endsWith(` (app)`))return null;let n=t.slice(0,-6).trim().toLowerCase();if(!n)return null;let r=Object.keys(e).filter(e=>{let t=e.trim().toLowerCase();return t===n||t.includes(n)}),i=r.find(e=>e.trim().toLowerCase()===n)??(r.length===1?r[0]:null);return i?(xo=bo(t,e[i]),e[i]):null}function Eo(e){return{buttons:e.buttons.map(e=>Math.max(+!!e.pressed,e.value)),axes:[...e.axes]}}function Do(e,t){let n=null;if(t.buttons.forEach((t,r)=>{let i=t-(e.buttons[r]??0);t>.5&&i>.5&&(!n||i>n.amount)&&(n={src:{b:r},amount:i})}),n)return n.src;for(let n=0;n1.05?La(t.axes[n]):null;if(r!==null)return{h:n,at:r}}return t.axes.forEach((t,r)=>{let i=e.axes[r]??0,a=t-i;if(!(Math.abs(a)<.6)&&(!n||Math.abs(a)>n.amount)){let e=a>0?1:-1;n={src:Math.abs(i)>.5?{a:r,d:e,rest:i}:{a:r,d:e},amount:Math.abs(a)}}}),n?n.src:null}function Oo(e,t){let n=null;if(t.axes.forEach((t,r)=>{let i=t-(e.axes[r]??0);Math.abs(i)>=.6&&(!n||Math.abs(i)>Math.abs(n.moved))&&(n={a:r,moved:i})}),!n)return null;let r=n;return r.moved>0?{a:r.a}:{a:r.a,inv:!0}}var ko=[{kind:`button`,bit:R.CROSS,name:`✕`},{kind:`button`,bit:R.CIRCLE,name:`○`},{kind:`button`,bit:R.SQUARE,name:`□`},{kind:`button`,bit:R.TRIANGLE,name:`△`},{kind:`button`,bit:R.UP,name:`↑`},{kind:`button`,bit:R.DOWN,name:`↓`},{kind:`button`,bit:R.LEFT,name:`←`},{kind:`button`,bit:R.RIGHT,name:`→`},{kind:`button`,bit:R.L1,name:`L1`},{kind:`button`,bit:R.R1,name:`R1`},{kind:`trigger`,which:`l2`,name:`L2`},{kind:`trigger`,which:`r2`,name:`R2`},{kind:`button`,bit:R.L3,name:`L3`},{kind:`button`,bit:R.R3,name:`R3`},{kind:`button`,bit:R.OPTIONS,name:`Options`},{kind:`button`,bit:R.SHARE,name:`Create`},{kind:`button`,bit:R.PS,name:`PS`},{kind:`button`,bit:R.TOUCHPAD,name:`Touchpad`},{kind:`axis`,which:`lx`,name:`L →`},{kind:`axis`,which:`ly`,name:`L ↓`},{kind:`axis`,which:`rx`,name:`R →`},{kind:`axis`,which:`ry`,name:`R ↓`}];function Ao(){return{buttons:[],l2:null,r2:null,lx:null,ly:null,rx:null,ry:null}}function jo(e,t,n){return t.kind===`button`?{...e,buttons:[...e.buttons.filter(([e])=>e!==t.bit),[t.bit,n]]}:(t.kind,{...e,[t.which]:n})}function Mo(e,t=Va){let n=new Set(e.buttons.map(([e])=>e)),r=e=>`b`in e?`b${e.b}`:`h`in e?`h${e.h}.${e.at}`:`a${e.a}${e.d}`,i=new Set([...e.buttons.map(([,e])=>r(e)),...[e.l2,e.r2].filter(e=>!!e).map(r)]);return{buttons:[...e.buttons,...t.buttons.filter(([e,t])=>!n.has(e)&&!i.has(r(t)))],l2:e.l2??t.l2,r2:e.r2??t.r2,lx:e.lx??t.lx,ly:e.ly??t.ly,rx:e.rx??t.rx,ry:e.ry??t.ry}}var No=ko.filter(e=>e.kind!==`button`||![R.L3,R.R3,R.OPTIONS,R.SHARE,R.PS,R.TOUCHPAD].includes(e.bit));function Po(e,t){return t.buttons.every((t,n)=>Math.abs(t-(e.buttons[n]??0))<.3)&&t.axes.every((t,n)=>Math.abs(t-(e.axes[n]??0))<.3)}var Fo=class{constructor(e=ko){this.steps=e,this.step=0,this.prof=Ao(),this.rest=null,this.waiting=!0}get done(){return this.step>=this.steps.length}get current(){return this.steps[this.step]??null}feed(e){if(this.done)return!1;if(!this.rest)return this.rest=e,this.waiting=!1,!1;if(this.waiting)return Po(this.rest,e)&&(this.waiting=!1),!1;let t=this.steps[this.step],n=t.kind===`axis`?Oo(this.rest,e):Do(this.rest,e);return n?(this.prof=jo(this.prof,t,n),this.go(this.step+1),!0):!1}skip(){this.go(this.step+1)}back(){this.step>0&&this.go(this.step-1)}go(e){this.waiting=!0,this.step=Math.min(e,this.steps.length)}profile(e=Va){return Mo(this.prof,e)}};function Io(e,t){return e.buttons===t.buttons&&e.l2===t.l2&&e.r2===t.r2&&e.lx===t.lx&&e.ly===t.ly&&e.rx===t.rx&&e.ry===t.ry&&(e.touch?.[0]??-1)===(t.touch?.[0]??-1)&&(e.touch?.[1]??-1)===(t.touch?.[1]??-1)&&(e.motion?.t??-1)===(t.motion?.t??-1)}function Lo(){try{return typeof sessionStorage<`u`?sessionStorage:null}catch{return null}}var Ro=e=>`ps5upload.join.token.${e??`app`}`,zo=class{constructor(e){this.o=e,this.ws=null,this.stage={kind:`connecting`},this.token=null,this.player=0,this.last={...ja},this.lastSent=0,this.neutral=!1,this.stopped=!1,this.attempt=0,this.deadline=0,this.raf=0,this.keepalive=null,this.pinger=null,this.retry=null,this.lastHeard=0,this.hostAway=!1,this.pings=0,this.now=e.now??(()=>Date.now()),this.storage=e.storage===void 0?Lo():e.storage,this.WS=e.WebSocketImpl??WebSocket,this.seq=this.now()>>>0;try{this.token=this.storage?.getItem(this.key)??null}catch{this.token=null}}get key(){return Ro(this.o.invite??this.o.code??null)}get current(){return this.stage}get socket(){return this.ws}get resumeToken(){return this.token}setStage(e){this.stage=e,this.o.onStage(e)}start(){if(this.stopped=!1,this.setStage({kind:`connecting`}),this.connect(),this.stopped)return;let e=()=>{this.sendPad(!1),this.raf=(this.o.raf??(e=>window.requestAnimationFrame(e)))(e)};this.raf=(this.o.raf??(e=>window.requestAnimationFrame(e)))(e),this.keepalive=setInterval(()=>this.sendPad(!1),100),this.pinger=setInterval(()=>this.ping(),1e3)}connect(){let e;try{e=new this.WS(this.o.url)}catch{this.dropped();return}this.ws=e,e.binaryType=`arraybuffer`,e.onopen=()=>{if(this.ws!==e)return;this.lastHeard=this.now();let t={name:this.o.name};this.o.invite&&(t.invite=this.o.invite),this.o.code&&(t.code=this.o.code),this.token&&(t.resume=this.token),e.send(JSON.stringify({hello:t}))},e.onmessage=t=>{this.ws===e&&(this.lastHeard=this.now(),typeof t.data==`string`?this.onText(t.data):t.data instanceof ArrayBuffer&&this.stage.kind===`joined`&&this.o.onFrame?.(t.data))},e.onclose=t=>{if(this.ws!==e)return;this.ws=null;let n=Ue(t);n===`mismatch`?(this.forgetToken(),this.finish({kind:`ended`,why:n})):n&&this.stage.kind!==`joined`&&this.stage.kind!==`reconnecting`?this.finish({kind:`ended`,why:n}):this.dropped()},e.onerror=()=>{}}onText(e){let t=Je(e);if(t)switch(t.kind){case`pong`:{let e=this.now()-t.t;e>=0&&e<6e4&&this.o.onRtt?.(e);return}case`asking`:this.stage.kind!==`reconnecting`&&this.setStage({kind:`asking`});return;case`waiting`:this.hostAway||(this.hostAway=!0,this.deadline=this.now()+et),this.attempt=0,this.setStage(this.reconnectingStage());return;case`joined`:this.token=t.token,this.player=t.player,this.attempt=0,this.hostAway=!1;try{this.storage?.setItem(this.key,t.token)}catch{}{let e=t.track&&this.ws?.media||null;this.o.onCodec?.(t.hevc,e,!!e&&t.audio&&!!e.audio)}this.setStage({kind:`joined`,player:t.player,hevc:t.hevc}),this.sendPad(!0);return;case`refused`:this.forgetToken(),this.hostAway&&t.why!==`seat_taken`?this.finish({kind:`ended`,why:`host_stopped`}):this.finish({kind:`refused`,why:t.why});return;case`bye`:if(t.why===`host_stopped`&&this.token){this.hostWait();return}this.forgetToken(),this.finish({kind:`ended`,why:t.why});return;case`status`:this.stage.kind===`joined`&&t.status.player>0&&t.status.player!==this.stage.player&&(this.player=t.status.player,this.setStage({...this.stage,player:t.status.player})),this.o.onStatus?.(t.status);return;case`feedback`:t.rumble&&this.o.onRumble?.(t.rumble[0],t.rumble[1]),t.light&&this.o.onLight?.(t.light);return}}hostWait(){this.hostAway=!0,this.deadline=this.now()+et,this.attempt=0;let e=this.ws;this.ws=null;try{e?.close()}catch{}this.scheduleRetry()}reconnectingStage(){return{kind:`reconnecting`,player:this.player,attempt:this.attempt,deadline:this.deadline,...this.hostAway?{hostStopped:!0}:{}}}giveUp(){this.forgetToken(),this.finish({kind:`ended`,why:this.hostAway?`host_stopped`:`gave_up`})}dropped(){if(this.stopped)return;let e=this.stage;e.kind===`joined`||e.kind===`reconnecting`&&this.token?(e.kind===`joined`&&(this.deadline=this.now()+$e),this.scheduleRetry()):this.finish({kind:`ended`,why:`lost`})}scheduleRetry(){if(this.stopped)return;if(this.now()>=this.deadline){this.giveUp();return}let e=Qe(this.attempt);this.setStage(this.reconnectingStage()),this.attempt+=1,this.retry&&clearTimeout(this.retry),this.retry=setTimeout(()=>{this.retry=null,this.stopped||(this.now()>=this.deadline?this.giveUp():this.connect())},e)}forgetToken(){this.token=null;try{this.storage?.removeItem(this.key)}catch{}}ping(){if(this.hostAway&&!this.stopped&&this.now()>=this.deadline+5e3||!this.stopped&&this.stage.kind===`reconnecting`&&this.now()>=this.deadline+5e3){this.giveUp();return}let e=this.ws;if(e&&e.readyState===this.WS.OPEN){if(this.stage.kind===`joined`&&this.now()-this.lastHeard>3500){this.ws=null;try{e.close()}catch{}this.dropped()}else if(e.send(JSON.stringify({ping:this.now()})),this.stage.kind===`joined`&&this.o.readStats&&++this.pings%2==0){let t=this.o.readStats();t&&e.send(JSON.stringify({stats:t}))}}}setNeutral(e){this.neutral!==e&&(this.neutral=e,this.sendPad(!0))}sendPad(e){let t=this.ws;if(!t||t.readyState!==this.WS.OPEN||this.stage.kind!==`joined`)return;let n=this.neutral?{...ja,touch:null,motion:null}:this.o.readPad(),r=this.now();!e&&Io(n,this.last)&&r-this.lastSent<100||(this.last=n,this.lastSent=r,this.seq=this.seq+1>>>0,t.send(Ze(this.seq,n)))}clearTimers(){(this.o.cancelRaf??(e=>window.cancelAnimationFrame(e)))(this.raf),this.keepalive&&clearInterval(this.keepalive),this.pinger&&clearInterval(this.pinger),this.retry&&clearTimeout(this.retry),this.keepalive=this.pinger=this.retry=null}finish(e){this.stopped=!0,this.clearTimers();let t=this.ws;this.ws=null;try{t?.close()}catch{}this.setStage(e)}askKeyframe(){let e=this.ws;e&&e.readyState===this.WS.OPEN&&this.stage.kind===`joined`&&e.send(JSON.stringify({keyframe:!0}))}leave(){let e=this.ws;e&&e.readyState===this.WS.OPEN&&(this.stage.kind===`joined`&&(this.seq=this.seq+1>>>0,e.send(Ze(this.seq,ja))),e.send(JSON.stringify({leave:1}))),this.forgetToken(),this.finish({kind:`ended`,why:`left`})}stop(){let e=this.ws;e&&e.readyState===this.WS.OPEN&&this.stage.kind===`joined`&&(this.seq=this.seq+1>>>0,e.send(Ze(this.seq,ja))),this.stopped=!0,this.clearTimers(),this.ws=null;try{e?.close()}catch{}}},Bo=s((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),z=s(((e,t)=>{t.exports=Bo()}))(),Vo=`ps5upload.openIn`,Ho=`ps5upload.openIn.tab`;function Uo(){try{return sessionStorage.getItem(Ho)===`browser`}catch{return!1}}function B(){try{sessionStorage.setItem(Ho,`browser`)}catch{}}function V(e){return e===`browser`?`browser`:e===`app`?`opening`:`ask`}function Wo({appLink:e,children:t}){let n=Ie(),[r,i]=(0,D.useState)(()=>Uo()?`browser`:V(Lt(Vo))),[a,o]=(0,D.useState)(!1);if((0,D.useEffect)(()=>{r===`opening`&&Lt(`ps5upload.openIn`)===`app`&&(location.href=e)},[]),r===`browser`)return(0,z.jsx)(z.Fragment,{children:t});let s=()=>{a&&It(Vo,`app`),i(`opening`),location.href=e},c=()=>{r===`ask`&&a?It(Vo,`browser`):r===`opening`&&Lt(`ps5upload.openIn`)===`app`&&Rt(Vo),B(),i(`browser`)};return(0,z.jsx)(`div`,{className:`flex min-h-[100dvh] items-center justify-center bg-black px-6 text-white`,"data-testid":`open-in-gate`,"data-join-ui":``,children:(0,z.jsx)(`div`,{className:`w-full max-w-sm space-y-4 rounded-2xl border border-white/10 bg-neutral-900 p-6`,children:r===`ask`?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`div`,{className:`space-y-1`,children:[(0,z.jsx)(`h1`,{className:`text-lg font-semibold`,children:n(`open_in_title`,void 0,`Open in the PS5Upload app?`)}),(0,z.jsx)(`p`,{className:`text-sm text-white/60`,children:n(`open_in_body`,void 0,`Have the PS5Upload app on this device? Open this there, or carry on in the browser.`)})]}),(0,z.jsx)(`button`,{type:`button`,onClick:s,autoFocus:!0,className:`w-full rounded-full bg-white py-2.5 text-sm font-semibold text-black`,"data-testid":`open-in-app`,children:n(`open_in_app`,void 0,`Open in the app`)}),(0,z.jsx)(`button`,{type:`button`,onClick:c,className:`w-full rounded-full border border-white/20 py-2.5 text-sm font-semibold text-white hover:bg-white/10`,"data-testid":`open-in-browser`,children:n(`open_in_browser`,void 0,`Continue in browser`)}),(0,z.jsxs)(`label`,{className:`flex items-center justify-center gap-2 text-xs text-white/60`,children:[(0,z.jsx)(`input`,{type:`checkbox`,checked:a,onChange:e=>o(e.target.checked),"data-testid":`open-in-remember`}),n(`open_in_remember`,void 0,`Remember my choice on this device`)]})]}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`div`,{className:`space-y-1`,children:[(0,z.jsx)(`h1`,{className:`text-lg font-semibold`,children:n(`open_in_opening`,void 0,`Opening the PS5Upload app…`)}),(0,z.jsx)(`p`,{className:`text-sm text-white/60`,children:n(`open_in_not_opened`,void 0,`Nothing happened? The app may not be on this device.`)})]}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>location.href=e,autoFocus:!0,className:`w-full rounded-full bg-white py-2.5 text-sm font-semibold text-black`,"data-testid":`open-in-again`,children:n(`open_in_again`,void 0,`Try again`)}),(0,z.jsx)(`button`,{type:`button`,onClick:c,className:`w-full rounded-full border border-white/20 py-2.5 text-sm font-semibold text-white hover:bg-white/10`,"data-testid":`open-in-browser`,children:n(`open_in_browser`,void 0,`Continue in browser`)})]})})})}var Go=[`a[href]`,`button:not([disabled])`,`input:not([disabled]):not([type='hidden'])`,`select:not([disabled])`,`textarea:not([disabled])`,`summary`,`[contenteditable='true']`,`[tabindex]`].map(e=>`${e}:not([tabindex='-1'])`).join(`, `),Ko=new Set,qo=[];function Jo(){for(let e of Ko)e()}function Yo(){return qo.length}function Xo(e){return qo.push(e),Jo(),()=>{let t=qo.lastIndexOf(e);t!==-1&&qo.splice(t,1),Jo()}}function Zo(e,t,n){switch(n){case`down`:return t.top-e.bottom;case`up`:return e.top-t.bottom;case`right`:return t.left-e.right;case`left`:return e.left-t.right}}function H(e,t,n){let r=(e.left+e.right)/2,i=(e.top+e.bottom)/2,a=(t.left+t.right)/2,o=(t.top+t.bottom)/2;switch(n){case`down`:return o>i&&t.top>=e.top+1;case`up`:return or&&t.left>=e.left+1;case`left`:return a0?{gap:0,overlap:c}:{gap:-c,overlap:0}}function $o(e,t,n){let r=null,i=1/0,a=!1;for(let o of t){if(!H(e,o.rect,n))continue;let t=Math.max(0,Zo(e,o.rect,n)),s=Qo(e,o.rect,n),c=s.overlap>0;if(a&&!c)continue;let l=c?t-s.overlap/1e6:Math.hypot(t,2*s.gap);(c&&!a||l`u`?void 0:window){try{return!!e?.PS5UploadTv?.isTv()}catch{return!1}}function rs(e=typeof document>`u`?void 0:document){return e?.documentElement.dataset.tv===`1`}function is(e,t){if(!e)return!1;if(e.closest(`[data-own-arrows]`))return!0;let n=e.tagName;if(n===`TEXTAREA`||e.isContentEditable)return!0;let r=t===`left`||t===`right`;if(n===`INPUT`){let t=(e.type||`text`).toLowerCase();if(t===`range`||ts.test(t))return r}return!1}var as=`[aria-modal="true"], [role="dialog"], [role="alertdialog"]`;function os(e){let t=e.activeElement?.closest(as);if(t)return t;if(Yo()>0){let t=e.querySelectorAll(as);if(t.length)return t[t.length-1]}return e}function ss(e){let t=[];return e.querySelectorAll(Go).forEach(e=>{if(e.closest(`[inert], [aria-hidden='true']`)||e.disabled)return;let n=e.getBoundingClientRect();n.width<=0||n.height<=0||t.push({el:e,rect:n})}),t}function cs(e){return(e.find(e=>e.el.getAttribute(`aria-current`)===`page`)??e[0])?.el??null}function ls(e,t=document){let n=es[e.key];if(!n||e.defaultPrevented||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)return!1;let r=t.activeElement;if(is(r,n))return!1;let i=ss(os(t));if(!i.length)return!1;let a=i.find(e=>e.el===r),o=a?$o(a.rect,i.filter(e=>e!==a),n):cs(i);return o?(e.preventDefault(),o.focus(),typeof o.scrollIntoView==`function`&&o.scrollIntoView({block:`nearest`,inline:`nearest`}),!0):!1}var us=!1;function ds(e){us||(us=!0,e.addEventListener(`keydown`,t=>void ls(t,e.document)))}function fs(e=typeof window>`u`?void 0:window){e&&(ns(e)&&(e.document.documentElement.dataset.tv=`1`),ds(e))}function ps({id:e,className:t}){let n=Ie(),r=oo(e);if(r===`none`)return(0,z.jsx)(`span`,{className:t,"data-testid":`pad-8bitdo-hint`,"data-how":r,children:n(`pad_8bitdo_no_xinput`,void 0,`This 8BitDo has no X-input mode. If a button is wrong, check the controller.`)});let i=r===`switch`?n(`pad_8bitdo_how_switch`,void 0,`set the switch on the back to X, then press Start`):r===`startx`?n(`pad_8bitdo_how_startx`,void 0,`turn it off, then hold Start + X to turn it on`):r===`receiver`?n(`pad_8bitdo_how_receiver`,void 0,`use its 2.4G receiver or a USB cable`):n(`pad_8bitdo_how_manual`,void 0,`its manual says how`);return(0,z.jsx)(`span`,{className:t,"data-testid":`pad-8bitdo-hint`,"data-how":r,children:n(`pad_8bitdo_xinput`,{how:i},`For the best result, switch your 8BitDo to X-input mode: ${i}.`)})}var ms=new Set,hs={held:new Set,touch:null,touchPad:ja,mapping:!1,get paused(){return ms.size>0},motion:null},gs={s:.85,m:1,l:1.15},_s=.25;function vs(e){return typeof e!=`number`||!Number.isFinite(e)?1:Math.min(1,Math.max(_s,e))}var ys={overlay:{width:844,height:390},deck:{width:390,height:480}},bs=.7,xs=1.4;function Ss(e,t,n,r){let i=gs[e]??1;if(!(t>0)||!(n>0))return i;let a=r?ys.deck:ys.overlay,o=Math.min(xs,Math.max(bs,Math.min(t/a.width,n/a.height)));return Math.round(o*i*1e3)/1e3}var Cs=34;function ws(e,t){return t>0&&8+Math.max(112*e,90)+156*e+124*e+Math.max(56*e,44)+Cs>t}function Ts(e,t,n){let r=e/32767,i=t/32767,a=Math.hypot(r,i),o=a>1?1/a:1;return{dx:r*o*n,dy:i*o*n}}var Es=`calc(50% + (env(safe-area-inset-left) - env(safe-area-inset-right)) / 2)`,Ds=32767,Os=12;function ks({stream:e,layout:t=`overlay`,opacity:n=1,size:r=`m`,deckTop:i=`0px`,onMenu:a}){let o=Ie(),s=(0,D.useRef)(new Map),c=(0,D.useRef)({...ja}),[l,u]=(0,D.useState)({...ja}),[d,f]=(0,D.useState)({l:!1,r:!1,touchpad:!1}),p=(0,D.useRef)(null),[m,h]=(0,D.useState)({width:0,height:0});(0,D.useEffect)(()=>{let e=p.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect();h(e=>e.width===t.width&&e.height===t.height?e:{width:t.width,height:t.height})};if(t(),typeof ResizeObserver>`u`)return window.addEventListener(`resize`,t),()=>window.removeEventListener(`resize`,t);let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]),(0,D.useEffect)(()=>()=>{hs.touchPad={...ja}},[]);let g=()=>{let t={...ja,touch:null},n={l:!1,r:!1,touchpad:!1};for(let e of s.current.values())e.kind===`stick`&&(n[e.which]=!0),e.kind===`touchpad`&&(n.touchpad=!0),e.kind===`button`&&(t.buttons|=e.bit),e.kind===`trigger`&&(t[e.which]=255),e.kind===`touchpad`&&e.pressed&&(t.buttons|=R.TOUCHPAD);t.lx=c.current.lx,t.ly=c.current.ly,t.rx=c.current.rx,t.ry=c.current.ry,t.touch=c.current.touch??null,hs.touchPad=t,e?.sendPad(),u(t),f(e=>e.l===n.l&&e.r===n.r&&e.touchpad===n.touchpad?e:n)},_=(e,t,n)=>{let r=Math.max(-1,Math.min(1,(t-e.cx)/e.radius)),i=Math.max(-1,Math.min(1,(n-e.cy)/e.radius));c.current[e.which===`l`?`lx`:`rx`]=Math.round(r*Ds),c.current[e.which===`l`?`ly`:`ry`]=Math.round(i*Ds)},v=(e,t)=>{e.preventDefault(),e.stopPropagation();let n=e.currentTarget;try{n.setPointerCapture(e.pointerId)}catch{}let r=t(n);s.current.set(e.pointerId,r),r.kind===`stick`&&_(r,e.clientX,e.clientY),r.kind===`touchpad`&&(c.current.touch=Ma((e.clientX-r.rect.left)/r.rect.width,(e.clientY-r.rect.top)/r.rect.height)),navigator.vibrate?.(8),g()},y=e=>{let t=s.current.get(e.pointerId);if(t){if(e.stopPropagation(),t.kind===`stick`)_(t,e.clientX,e.clientY);else if(t.kind===`touchpad`)c.current.touch=Ma((e.clientX-t.rect.left)/t.rect.width,(e.clientY-t.rect.top)/t.rect.height),t.pressed&&Math.hypot(e.clientX-t.x0,e.clientY-t.y0)>Os&&(t.pressed=!1);else return;g()}},b=e=>{let t=s.current.get(e.pointerId);t&&(e.stopPropagation(),s.current.delete(e.pointerId),t.kind===`stick`&&(c.current[t.which===`l`?`lx`:`rx`]=0,c.current[t.which===`l`?`ly`:`ry`]=0),t.kind===`touchpad`&&(c.current.touch=null),g())},x=e=>e.stopPropagation(),S={onPointerMove:y,onPointerUp:b,onPointerCancel:b,onClick:x,onDoubleClick:x},ee=e=>(l.buttons&e)!==0,C=e=>`border-[1.5px] shadow-[0_0_3px_rgba(0,0,0,0.35)] transition-colors duration-75 ${e?`border-white bg-white/50`:`border-white/70 bg-white/10`}`,w=`text-white [text-shadow:0_1px_2px_rgba(0,0,0,0.6)]`,T={filter:`drop-shadow(0 0 1.5px rgba(0,0,0,0.5))`},E=e=>({stroke:e?`#fff`:`rgba(255,255,255,0.75)`,fill:e?`rgba(255,255,255,0.5)`:`rgba(255,255,255,0.1)`}),te=`pointer-events-auto flex touch-none select-none items-center justify-center bg-transparent p-0`,ne={minHeight:`calc(44px / var(--k))`,minWidth:`calc(44px / var(--k))`},re=(e,t,n,r)=>(0,z.jsx)(`button`,{type:`button`,"aria-label":e,onPointerDown:e=>v(e,()=>({kind:`button`,bit:t})),...S,className:`${te} ${n}`,style:ne,children:r}),ie=(e,t,n,r)=>(0,z.jsx)(`span`,{className:`flex h-[32px] w-[76px] items-center justify-center text-[13px] font-semibold tracking-wide ${w} ${C(t)}`,style:{borderRadius:r?n===`l`?`16px 9px 9px 9px`:`9px 16px 9px 9px`:`9px`},children:e}),ae=(e,t,n,r)=>re(e,t,`h-[44px] w-[84px]`,ie(e,ee(t),n,r)),oe=(e,t,n)=>(0,z.jsx)(`button`,{type:`button`,"aria-label":e,onPointerDown:e=>v(e,()=>({kind:`trigger`,which:t})),...S,className:`${te} h-[44px] w-[84px]`,style:ne,children:ie(e,l[t]>0,n,!0)}),se=(e,t,n)=>re(e,t,`h-[52px] w-[52px]`,(0,z.jsx)(`svg`,{viewBox:`0 0 52 52`,width:`52`,height:`52`,"aria-hidden":!0,style:T,children:(0,z.jsxs)(`g`,{transform:`rotate(${n} 26 26)`,strokeWidth:`1.5`,strokeLinejoin:`round`,...E(ee(t)),children:[(0,z.jsx)(`path`,{d:`M10 9 Q10 3 16 3 L36 3 Q42 3 42 9 L42 30 Q42 34.5 38.5 38 L29.5 47 Q26 50.5 22.5 47 L13.5 38 Q10 34.5 10 30 Z`}),(0,z.jsx)(`path`,{d:`M20.5 23 L26 17 L31.5 23`,fill:`none`,stroke:`#fff`,strokeLinecap:`round`,strokeWidth:`1.8`})]})})),ce=(e,t,n)=>re(e,t,`h-[52px] w-[52px]`,(0,z.jsxs)(`svg`,{viewBox:`0 0 52 52`,width:`52`,height:`52`,"aria-hidden":!0,style:T,children:[(0,z.jsx)(`circle`,{cx:`26`,cy:`26`,r:`22.5`,strokeWidth:`1.5`,...E(ee(t))}),(0,z.jsx)(`g`,{fill:`none`,stroke:`#fff`,strokeWidth:`1.8`,strokeLinejoin:`round`,strokeLinecap:`round`,children:n})]})),le=(e,t)=>re(e,t,`h-[44px] min-w-[64px] px-[4px]`,(0,z.jsx)(`span`,{className:`flex h-[24px] items-center rounded-full px-[10px] text-[10px] font-semibold uppercase tracking-wider ${w} ${C(ee(t))}`,children:e})),ue=(e,t)=>re(e,t,`h-[44px] w-[44px]`,(0,z.jsx)(`span`,{className:`flex h-[36px] w-[36px] items-center justify-center rounded-full text-[11px] font-bold ${w} ${C(ee(t))}`,children:e})),de=e=>{let{dx:t,dy:n}=Ts(e===`l`?l.lx:l.rx,e===`l`?l.ly:l.ry,34),r=d[e];return(0,z.jsx)(`div`,{"aria-label":e===`l`?o(`rp_touch_left_stick`,void 0,`Left stick`):o(`rp_touch_right_stick`,void 0,`Right stick`),onPointerDown:t=>v(t,t=>{let n=t.getBoundingClientRect();return{kind:`stick`,which:e,cx:n.left+n.width/2,cy:n.top+n.height/2,radius:n.width/2}}),...S,className:`pointer-events-auto relative h-[124px] w-[124px] touch-none rounded-full border-[1.5px] shadow-[0_0_3px_rgba(0,0,0,0.3)] transition-colors duration-75 ${r?`border-white/80 bg-white/[0.12]`:`border-white/45 bg-white/[0.05]`}`,children:(0,z.jsx)(`div`,{className:`absolute left-1/2 top-1/2 h-[54px] w-[54px] rounded-full ${C(r)}`,style:{transform:`translate(calc(-50% + ${t}px), calc(-50% + ${n}px))`}})})},O=t===`deck`,fe=Ss(r,m.width,m.height,O),pe=e=>`${e}px * var(--k)`,k=`max(12px, env(safe-area-inset-left))`,me=`max(12px, env(safe-area-inset-right))`,he=`max(12px, env(safe-area-inset-bottom))`,ge=O?`8px`:t===`overlay-bar`?`3.5rem`:`max(10px, env(safe-area-inset-top))`,_e=(e,t,n=0)=>t?n?`calc(${e} + max(${pe(t)}, ${n}px))`:`calc(${e} + ${pe(t)})`:e,ye=(e,t)=>({position:`absolute`,...t,transform:`scale(var(--k))`,transformOrigin:e}),be=O&&ws(fe,m.height),A=O?void 0:`58%`,j=e=>O?{top:_e(ge,be?96:112,be?72:90),[e]:e===`left`?k:me}:{top:A,translate:`0 -50%`,[e]:e===`left`?k:me},xe=e=>({bottom:be?he:_e(he,O?56:0,44),[e]:be?`calc(${e===`left`?k:me} + 8px + max(${pe(80)}, 44px))`:_e(e===`left`?k:me,O?40:168)}),Se=!!a&&!O;return(0,z.jsxs)(`div`,{ref:p,className:`pointer-events-none absolute z-10 select-none [-webkit-touch-callout:none] ${O?`inset-x-0 bottom-0`:`inset-0`}`,style:{top:O?i:void 0,"--k":fe},"data-testid":`rp-touch`,"data-layout":t,"data-scale":fe,onContextMenu:e=>e.preventDefault(),children:[(0,z.jsxs)(`div`,{className:`absolute inset-0`,style:{opacity:vs(n)},children:[(0,z.jsx)(`div`,{style:ye(`top left`,{top:ge,left:k}),children:(0,z.jsxs)(`div`,{className:`ms-[8px] flex flex-col`,style:{rotate:O?void 0:`6deg`,transformOrigin:`top left`},children:[oe(`L2`,`l2`,`l`),ae(`L1`,R.L1,`l`,!1)]})}),(0,z.jsx)(`div`,{style:ye(`top right`,{top:ge,right:me}),children:(0,z.jsxs)(`div`,{className:`me-[8px] flex flex-col items-end`,style:{rotate:O?void 0:`-6deg`,transformOrigin:`top right`},children:[oe(`R2`,`r2`,`r`),ae(`R1`,R.R1,`r`,!1)]})}),(0,z.jsx)(`div`,{"aria-label":o(`rp_touch_touchpad`,void 0,`Touchpad`),onPointerDown:e=>v(e,t=>({kind:`touchpad`,rect:t.getBoundingClientRect(),x0:e.clientX,y0:e.clientY,pressed:!0})),...S,className:`pointer-events-auto absolute touch-none rounded-2xl border-[1.5px] shadow-[0_0_3px_rgba(0,0,0,0.3)] transition-colors duration-75 ${d.touchpad?`border-white/80 bg-white/25`:`border-white/40 bg-white/[0.05]`}`,style:O?{top:_e(ge,6),left:_e(k,104),right:_e(me,104),height:`max(44px, calc(${pe(64)}))`}:{top:ge,left:`50%`,translate:`-50% 0`,width:`min(calc(${pe(250)}), 34vw)`,height:`max(44px, calc(${pe(56)}))`}}),(0,z.jsxs)(`div`,{className:`grid grid-cols-3 grid-rows-3`,style:ye(O?`top left`:`left center`,j(`left`)),children:[(0,z.jsx)(`span`,{}),se(`↑`,R.UP,0),(0,z.jsx)(`span`,{}),se(`←`,R.LEFT,-90),(0,z.jsx)(`span`,{}),se(`→`,R.RIGHT,90),(0,z.jsx)(`span`,{}),se(`↓`,R.DOWN,180),(0,z.jsx)(`span`,{})]}),(0,z.jsxs)(`div`,{className:`grid grid-cols-3 grid-rows-3`,style:ye(O?`top right`:`right center`,j(`right`)),children:[(0,z.jsx)(`span`,{}),ce(`△`,R.TRIANGLE,(0,z.jsx)(`path`,{d:`M26 16.5 L35 32 L17 32 Z`})),(0,z.jsx)(`span`,{}),ce(`□`,R.SQUARE,(0,z.jsx)(`rect`,{x:`18`,y:`18`,width:`16`,height:`16`,rx:`1`})),(0,z.jsx)(`span`,{}),ce(`○`,R.CIRCLE,(0,z.jsx)(`circle`,{cx:`26`,cy:`26`,r:`8.5`})),(0,z.jsx)(`span`,{}),ce(`✕`,R.CROSS,(0,z.jsx)(`path`,{d:`M19 19 L33 33 M33 19 L19 33`})),(0,z.jsx)(`span`,{})]}),(0,z.jsx)(`div`,{style:ye(`bottom left`,xe(`left`)),children:de(`l`)}),(0,z.jsx)(`div`,{style:ye(`bottom right`,xe(`right`)),children:de(`r`)}),(0,z.jsx)(`div`,{style:ye(`bottom left`,{bottom:he,left:k}),children:le(`Create`,R.SHARE)}),(0,z.jsx)(`div`,{style:ye(`bottom right`,{bottom:he,right:me}),children:le(`Options`,R.OPTIONS)}),(0,z.jsx)(`div`,{style:ye(`bottom center`,{bottom:be?_e(he,124,88):_e(he,Se?48:0,48),left:Es,translate:`-50% 0`}),children:ue(`PS`,R.PS)})]}),Se&&(0,z.jsx)(`div`,{style:{...ye(`bottom center`,{bottom:he,left:`calc(50% + (env(safe-area-inset-left) - env(safe-area-inset-right)) / 2)`,translate:`-50% 0`}),opacity:Math.max(.7,vs(n))},children:(0,z.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),a?.()},onDoubleClick:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),"aria-label":o(`rp_menu`,void 0,`Menu`),"aria-haspopup":`dialog`,className:`${te} h-[44px] w-[56px]`,style:ne,"data-testid":`rp-menu-handle`,children:(0,z.jsx)(`span`,{className:`flex h-[26px] w-[44px] items-center justify-center rounded-full ${w} ${C(!1)}`,children:(0,z.jsx)(ve,{size:15,strokeWidth:2,"aria-hidden":!0})})})})]})}var As=`data:video/mp4;base64,AAAAIGZ0eXBpc29tAAACAGlzb21pc28yYXZjMW1wNDEAAAYZbW9vdgAAAGxtdmhkAAAAAAAAAAAAAAAAAAAfQAAAfQAAAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAmt0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAABAAAAAAAAfQAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAABAAAAAQAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAH0AAAAAAAABAAAAAAHjbWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAABAAAABAABVxAAAAAAALWhkbHIAAAAAAAAAAHZpZGUAAAAAAAAAAAAAAABWaWRlb0hhbmRsZXIAAAABjm1pbmYAAAAUdm1oZAAAAAEAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAU5zdGJsAAAAunN0c2QAAAAAAAAAAQAAAKphdmMxAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAABAAEABIAAAASAAAAAAAAAABFExhdmM2My4xLjEwMiBsaWJ4MjY0AAAAAAAAAAAAAAAAGP//AAAAMGF2Y0MBQsAK/+EAF2dCwAqmEXsBEAAAAwAQAAADACDxImEYAQAGaMhCAZSyAAAAEHBhc3AAAAABAAAAAQAAABRidHJ0AAAAAAAABUAAAAAAAAAAGHN0dHMAAAAAAAAAAQAAAAQAAEAAAAAAFHN0c3MAAAAAAAAAAQAAAAEAAAAcc3RzYwAAAAAAAAABAAAAAQAAAAEAAAABAAAAJHN0c3oAAAAAAAAAAAAAAAQAAAKCAAAACgAAAAoAAAAKAAAAIHN0Y28AAAAAAAAABAAABlwAAAj+AAAJKAAACVIAAALZdHJhawAAAFx0a2hkAAAAAwAAAAAAAAAAAAAAAgAAAAAAAH0AAAAAAAAAAAAAAAABAQAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAJGVkdHMAAAAcZWxzdAAAAAAAAAABAAB9AAAABAAAAQAAAAACUW1kaWEAAAAgbWRoZAAAAAAAAAAAAAAAAAAAH0AAAIEAVcQAAAAAAC1oZGxyAAAAAAAAAABzb3VuAAAAAAAAAAAAAAAAU291bmRIYW5kbGVyAAAAAfxtaW5mAAAAEHNtaGQAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAcBzdGJsAAAAfnN0c2QAAAAAAAAAAQAAAG5tcDRhAAAAAAAAAAEAAAAAAAAAAAABABAAAAAAH0AAAAAAADZlc2RzAAAAAAOAgIAlAAIABICAgBdAFQAAAAAAH0AAAAEcBYCAgAUViFblAAaAgIABAgAAABRidHJ0AAAAAAAAH0AAAAEcAAAAIHN0dHMAAAAAAAAAAgAAACAAAAQAAAAAAQAAAQAAAAAoc3RzYwAAAAAAAAACAAAAAQAAAAEAAAABAAAAAgAAAAgAAAABAAAAmHN0c3oAAAAAAAAAAAAAACEAAAATAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAkc3RjbwAAAAAAAAAFAAAGSQAACN4AAAkIAAAJMgAACVwAAAAac2dwZAEAAAByb2xsAAAAAgAAAAH//wAAABxzYmdwAAAAAHJvbGwAAAABAAAAIQAAAAEAAABhdWR0YQAAAFltZXRhAAAAAAAAACFoZGxyAAAAAAAAAABtZGlyYXBwbAAAAAAAAAAAAAAAACxpbHN0AAAAJKl0b28AAAAcZGF0YQAAAAEAAAAATGF2ZjYzLjEuMTAyAAAACGZyZWUAAAM7bWRhdNwATGF2YzYzLjEuMTAyAAIwQA4AAAJvBgX//2vcRem95tlIt5Ys2CDZI+7veDI2NCAtIGNvcmUgMTY1IHIzMjIyIGIzNTYwNWEgLSBILjI2NC9NUEVHLTQgQVZDIGNvZGVjIC0gQ29weWxlZnQgMjAwMy0yMDI1IC0gaHR0cDovL3d3dy52aWRlb2xhbi5vcmcveDI2NC5odG1sIC0gb3B0aW9uczogY2FiYWM9MCByZWY9MTYgZGVibG9jaz0xOjA6MCBhbmFseXNlPTB4MToweDEzMSBtZT11bWggc3VibWU9MTAgcHN5PTEgcHN5X3JkPTEuMDA6MC4wMCBtaXhlZF9yZWY9MSBtZV9yYW5nZT0yNCBjaHJvbWFfbWU9MSB0cmVsbGlzPTIgOHg4ZGN0PTAgY3FtPTAgZGVhZHpvbmU9MjEsMTEgZmFzdF9wc2tpcD0xIGNocm9tYV9xcF9vZmZzZXQ9LTIgdGhyZWFkcz0xIGxvb2thaGVhZF90aHJlYWRzPTEgc2xpY2VkX3RocmVhZHM9MCBucj0wIGRlY2ltYXRlPTEgaW50ZXJsYWNlZD0wIGJsdXJheV9jb21wYXQ9MCBjb25zdHJhaW5lZF9pbnRyYT0wIGJmcmFtZXM9MCB3ZWlnaHRwPTAga2V5aW50PTQga2V5aW50X21pbj0xIHNjZW5lY3V0PTQwIGludHJhX3JlZnJlc2g9MCByY19sb29rYWhlYWQ9NCByYz1jcmYgbWJ0cmVlPTEgY3JmPTUxLjAgcWNvbXA9MC42MCBxcG1pbj0wIHFwbWF4PTY5IHFwc3RlcD00IGlwX3JhdGlvPTEuNDAgYXE9MToxLjAwAIAAAAALZYiCAv5MUAAQv8ABGCAHARggBwEYIAcBGCAHARggBwEYIAcBGCAHARggBwAAAAZBmhwF/UABGCAHARggBwEYIAcBGCAHARggBwEYIAcBGCAHARggBwAAAAZBmioBb1ABGCAHARggBwEYIAcBGCAHARggBwEYIAcBGCAHARggBwAAAAZBmjsBX1ABGCAHARggBwEYIAcBGCAHARggBwEYIAcBGCAHARggBw==`,js=null,Ms=null;function Ns(e){e.play().catch(()=>{if(Ms||js!==e)return;let t=()=>{Ps(),js===e&&e.play().catch(()=>{})};window.addEventListener(`pointerdown`,t,{capture:!0}),Ms=()=>window.removeEventListener(`pointerdown`,t,{capture:!0})})}function Ps(){Ms?.(),Ms=null}function Fs(){if(typeof document<`u`){if(!js){let e=document.createElement(`video`);e.muted=!0,e.loop=!0,e.playsInline=!0,e.setAttribute(`playsinline`,``),e.setAttribute(`aria-hidden`,`true`),e.setAttribute(`data-testid`,`keep-screen-video`),e.style.cssText=`position:fixed;left:0;top:0;width:1px;height:1px;opacity:0;pointer-events:none`,e.src=As,document.body.appendChild(e),js=e}Ns(js)}}function Is(){Ps(),js&&=(js.pause(),js.removeAttribute(`src`),js.remove(),null)}function Ls(){return typeof navigator>`u`?null:navigator.wakeLock??null}function Rs(){return dt()||!Pn()}var zs=new Set,Bs=null,Vs=Promise.resolve(),Hs=!1;async function Us(){if(zs.size===0||Bs&&!Bs.released)return;let e=Ls();if(!e)dt()&&Fs();else try{let t=await e.request(`screen`);t.addEventListener(`release`,()=>{Bs===t&&(Bs=null)}),Bs=t}catch{}}async function Ws(){Is();let e=Bs;if(Bs=null,e&&!e.released)try{await e.release()}catch{}}function Gs(){Hs||typeof document>`u`||(Hs=!0,document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`visible`&&zs.size>0&&(Vs=Vs.then(Us))}))}function Ks(e,t){if(!Rs())return;Gs();let n=zs.size>0;t?zs.add(e):zs.delete(e);let r=zs.size>0;n!==r&&(Vs=Vs.then(r?Us:Ws))}var qs=new Set;function Js(){if(typeof window<`u`)return window.PS5UploadPad}function Ys(e,t){let n=qs.size>0;t?qs.add(e):qs.delete(e);let r=qs.size>0;if(n!==r)try{Js()?.setActive(r)}catch{}}var Xs=class e{constructor(e){this.receiver=e,this.last=null,this.was={}}get frames(){return Number(this.last?.frames??0)}static report(e,t){let n=t=>e[t]??0,r=e=>n(e)-(t[e]??0),i=(e,t)=>r(t)>0?Math.round(r(e)/r(t)*1e4)/10:0;return{frames:n(`framesDecoded`),dropped:n(`framesDropped`),stalls:n(`freezeCount`),stall_ms:Math.round(n(`totalFreezesDuration`)*1e3),decode_ms:i(`totalDecodeTime`,`framesDecoded`),jitter_ms:i(`jitterBufferDelay`,`jitterBufferEmittedCount`),nacks:n(`nackCount`),plis:n(`pliCount`),decoder:`track`}}snapshot(){return this.receiver.getStats().then(t=>{t.forEach(t=>{t.type===`inbound-rtp`&&t.kind===`video`&&(this.last=e.report(t,this.was),this.was={...t})})}).catch(()=>{}),this.last}},Zs=class{constructor(e){this.inner=e,this.video=document.createElement(`video`),this.wrap=document.createElement(`div`),this.media=null,this.trackStats=null,this.audio=!1,this.soundOn=!1,this.muted=!1;let t=this.video;t.muted=t.autoplay=t.playsInline=!0,t.className=`block h-full w-full object-contain`,t.dataset.testid=`track-video`,this.wrap.className=`h-full w-full`,this.wrap.append(t,e.element),this.setTrack(null)}get element(){return this.wrap}get stats(){return this.trackStats??this.inner.stats}setTrack(e,t=!1){this.media=e,this.audio=!!e&&t,this.applySound(),this.trackStats=e?new Xs(e.receiver):null,this.video.style.display=e?``:`none`,this.inner.element.style.display=e?`none`:``,this.video.srcObject!==(e?.stream??null)&&(this.video.srcObject=e?.stream??null),e&&this.play()}play(){try{this.video.play()?.catch?.(()=>{})}catch{}}onMessage(e){let t=new Uint8Array(e)[0];this.media&&t<=1||(!this.audio||t!==3&&t!==4)&&this.inner.onMessage(e)}applySound(){this.video.muted=!(this.audio&&this.soundOn&&!this.muted)}setHevc(e){this.inner.setHevc(e)}set onSoundFail(e){this.inner.onSoundFail=e}soundReport(){return this.inner.soundReport()}startSound(){this.inner.startSound(),this.soundOn=!0,this.applySound(),this.media&&this.play()}setMuted(e){this.inner.setMuted(e),this.muted=e,this.applySound()}resumeSound(){this.inner.resumeSound(),this.media&&this.video.paused&&this.play()}stop(){this.inner.stop(),this.video.srcObject=null}},Qs=`ps5upload.join.muted`,$s=5e3,ec=Object.fromEntries(Object.entries(Na).filter(([e])=>e!==`Escape`)),tc=new Set;function nc(e){if(!(e.code in ec)||e.ctrlKey||e.metaKey||e.altKey)return!1;let t=e.target;if(e.code===`Tab`&&(e.shiftKey||rc(t)))return!1;let n=t?.tagName;return!(n===`INPUT`||n===`TEXTAREA`||n===`SELECT`||t?.isContentEditable||rc(t))}function rc(e){let t=e?.tagName;if(t===`BUTTON`||t===`A`)return!0;let n=e?.getAttribute?.(`role`);return n===`button`||n===`link`||n===`menuitem`||n===`tab`||n===`switch`}var ic=!1;function ac(e){ic=e}function oc(e,t,n=null){if(!e||e.frames===0&&!t)return null;let r=e.snapshot();return r&&{...r,...t?{problem:t}:{},...n??{}}}function sc(){if(ic)return{...ja};let e=Ga(Xa(typeof navigator>`u`?void 0:navigator),So),t=hs.touchPad;return{...Ka(Ka(e,Fa(tc,ec)),t),touch:t.touch??null,motion:hs.motion??null}}var cc=class{constructor(e){this.opts=e,this.player=null,this.listeners=new Set,this.cleanups=[],this.subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e)),this.snap={stage:{kind:`connecting`},status:null,rttMs:null,light:null,problem:null,sound:!1,noSound:!1,host:e.host,muted:uc(),path:null},this.client=new zo({url:e.url,invite:e.invite,code:e.code??null,name:e.name,WebSocketImpl:e.transport,readPad:sc,onStage:e=>{this.set({stage:e}),e.kind===`joined`&&this.readPath(),(e.kind===`refused`||e.kind===`ended`)&&this.teardown()},onStatus:e=>this.set({status:e,host:e.host??this.snap.host}),onRtt:e=>this.set({rttMs:e}),onFrame:e=>this.picture().onMessage(e),readStats:()=>oc(this.player?.stats??null,this.snap.problem,this.player?.soundReport()??null),onCodec:(e,t,n)=>{let r=this.picture();r.setHevc(e),r instanceof Zs&&(r.setTrack(t,!!n),t&&this.snap.problem&&this.set({problem:null}))},onRumble:(e,t)=>{let n=Xa(typeof navigator>`u`?void 0:navigator);qa(n,e,t),n.some(e=>e?.connected)||navigator.vibrate?.(e||t?200:0)},onLight:e=>this.set({light:e})})}picture(){if(!this.player){let e=oa(e=>this.set({problem:e}),`player`,()=>this.client.askKeyframe());this.player=this.opts.transport?new Zs(e):e,this.player.onSoundFail=()=>this.set({noSound:!0}),this.player.setMuted(this.snap.muted)}return this.player}async readPath(){let e=this.client.socket,t=this.opts.path??null;if(e?.netPath)try{t=await e.netPath()??this.opts.path??null}catch{t=null}t!==this.snap.path&&this.set({path:t})}get element(){return this.picture().element}start(){let e=()=>{document.visibilityState===`hidden`?tc.clear():this.player?.resumeSound(),this.client.setNeutral(document.visibilityState===`hidden`)},t=()=>{tc.clear(),this.client.setNeutral(!0)},n=e=>{this.client.current.kind===`joined`&&nc(e)&&(!this.opts.keysLive||this.opts.keysLive())&&(e.preventDefault(),tc.add(e.code))},r=e=>{tc.delete(e.code)&&nc(e)&&e.preventDefault()};window.addEventListener(`keydown`,n),window.addEventListener(`keyup`,r);let i=()=>{this.client.setNeutral(document.visibilityState===`hidden`),document.visibilityState!==`hidden`&&this.player?.resumeSound()};document.addEventListener(`visibilitychange`,e),window.addEventListener(`blur`,t),window.addEventListener(`focus`,i);let a=setInterval(()=>{this.client.current.kind===`joined`&&this.readPath()},$s);this.cleanups.push(()=>{clearInterval(a),document.removeEventListener(`visibilitychange`,e),window.removeEventListener(`blur`,t),window.removeEventListener(`focus`,i),window.removeEventListener(`keydown`,n),window.removeEventListener(`keyup`,r),tc.clear()}),this.client.start()}setMuted(e){this.player?.setMuted(e);try{localStorage.setItem(Qs,e?`1`:`0`)}catch{}this.set({muted:e})}startSound(){this.snap.sound||(this.picture().startSound(),this.set({sound:!0}))}leave(){this.client.leave(),this.teardown()}stop(){this.client.stop(),this.teardown()}teardown(){for(let e of this.cleanups.splice(0))e();hs.touchPad={buttons:0,l2:0,r2:0,lx:0,ly:0,rx:0,ry:0};let e=this.player;this.player=null,e&&(e.stop(),e.element.remove())}sendPad(){this.client.sendPad(!1)}get snapshot(){return this.snap}set(e){this.snap={...this.snap,...e};for(let e of this.listeners)e()}};function lc(e){return(0,D.useSyncExternalStore)(e.subscribe,()=>e.snapshot)}function uc(){try{return typeof localStorage<`u`&&localStorage.getItem(Qs)===`1`}catch{return!1}}function dc(e){let t=()=>{let t=e.snapshot.stage.kind,n=t!==`refused`&&t!==`ended`;Ks(`play-together`,n),Ys(`play-together`,n)};t();let n=e.subscribe(t);return()=>{n(),Ks(`play-together`,!1),Ys(`play-together`,!1)}}var fc=3e3,pc=class{constructor(e,t=fc){this.onChange=e,this.delay=t,this.enabled=!1,this.pinned=!1,this.sticky=!1,this.shown=!0,this.timer=null}get visible(){return!this.enabled||this.pinned||this.shown}set(e,t,n=!1){let r=this.enabled&&!this.pinned,i=this.enabled,a=this.sticky;this.enabled=e,this.pinned=t,this.sticky=n,!e||t?(this.stop(),this.show(!0)):n?(this.stop(),!i||!a?this.show(!1):r||this.show(!0)):(!r||a)&&(this.show(!0),this.arm())}poke(){this.show(!0),this.enabled&&!this.pinned&&!this.sticky&&this.arm()}toggle(){this.visible?this.hide():this.poke()}hide(){this.enabled&&!this.pinned&&(this.stop(),this.show(!1))}dispose(){this.stop()}arm(){this.stop(),this.timer=setTimeout(()=>{this.timer=null,this.show(!1)},this.delay)}stop(){this.timer!==null&&clearTimeout(this.timer),this.timer=null}show(e){this.shown!==e&&(this.shown=e,this.onChange(e))}};function mc(e,t,n=!1){let[r,i]=(0,D.useState)(!0),a=(0,D.useRef)(null);(0,D.useEffect)(()=>{let e=new pc(i);return a.current=e,()=>{e.dispose(),a.current=null}},[]),(0,D.useEffect)(()=>{a.current?.set(e,t,n)},[e,t,n]);let o=(0,D.useCallback)(()=>a.current?.poke(),[]),s=(0,D.useCallback)(()=>a.current?.hide(),[]),c=(0,D.useCallback)(()=>a.current?.toggle(),[]);return{shown:!e||t||r,poke:o,hide:s,toggle:c}}var hc=3e4,gc=class{constructor(e,t=hc){this.onChange=e,this.ms=t,this.picking=!1,this.over=!1,this.timer=null}get shown(){return this.picking&&!this.over}set(e){e!==this.picking&&(this.picking=e,this.over=!1,this.stop(),e&&(this.timer=setTimeout(()=>{this.timer=null,this.over=!0,this.onChange()},this.ms)))}stop(){this.timer&&clearTimeout(this.timer),this.timer=null}reset(){this.stop(),this.picking=!1,this.over=!1}};function _c(e){let[,t]=(0,D.useState)(0),[n]=(0,D.useState)(()=>new gc(()=>t(e=>e+1)));return(0,D.useEffect)(()=>{n.set(e),t(e=>e+1)},[n,e]),(0,D.useEffect)(()=>()=>n.reset(),[n]),n.shown}var vc=()=>Xa(typeof navigator>`u`?void 0:navigator).filter(e=>!!e?.connected);function yc(e,t){if(t.kind===`axis`)return t.which===`lx`?e(`rp_pad_step_lx`,void 0,`Push the left stick right`):t.which===`ly`?e(`rp_pad_step_ly`,void 0,`Push the left stick down`):t.which===`rx`?e(`rp_pad_step_rx`,void 0,`Push the right stick right`):e(`rp_pad_step_ry`,void 0,`Push the right stick down`);if(t.kind===`button`){if(t.bit===R.CROSS)return e(`join_check_bottom`,void 0,`Press the bottom face button (✕)`);if(t.bit===R.CIRCLE)return e(`join_check_right`,void 0,`Press the right face button (○)`);if(t.bit===R.SQUARE)return e(`join_check_left`,void 0,`Press the left face button (□)`);if(t.bit===R.TRIANGLE)return e(`join_check_top`,void 0,`Press the top face button (△)`)}return e(`rp_pad_press`,{name:t.name},`Press ${t.name}`)}function bc(e,t){let n=(0,D.useRef)(t);(0,D.useEffect)(()=>{n.current=t}),(0,D.useEffect)(()=>{if(e===null)return;let t=0,r=()=>{n.current(vc().find(t=>t.index===e)??null),t=window.requestAnimationFrame(r)};return t=window.requestAnimationFrame(r),()=>window.cancelAnimationFrame(t)},[e])}var xc=[[R.CROSS,`✕`],[R.CIRCLE,`○`],[R.SQUARE,`□`],[R.TRIANGLE,`△`],[R.UP,`↑`],[R.DOWN,`↓`],[R.LEFT,`←`],[R.RIGHT,`→`],[R.L1,`L1`],[R.R1,`R1`],[R.L3,`L3`],[R.R3,`R3`],[R.SHARE,`Create`],[R.OPTIONS,`Options`],[R.PS,`PS`],[R.TOUCHPAD,`Touchpad`]];function Sc({pad:e}){let t=e=>`flex h-8 min-w-8 items-center justify-center rounded-md px-1.5 text-xs font-medium ${e?`bg-white text-black`:`bg-white/10 text-white/70`}`,n=(e,t,n)=>(0,z.jsxs)(`span`,{className:`relative flex h-12 w-12 items-center justify-center rounded-full bg-white/10 text-[10px] text-white/50`,children:[n,(0,z.jsx)(`span`,{className:`absolute h-3 w-3 rounded-full bg-white`,style:{left:`calc(50% + ${e/32767*18}px - 6px)`,top:`calc(50% + ${t/32767*18}px - 6px)`}})]});return(0,z.jsxs)(`div`,{className:`space-y-2`,"data-testid":`join-pad-test`,"data-buttons":e.buttons,children:[(0,z.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[xc.map(([n,r])=>(0,z.jsx)(`span`,{className:t((e.buttons&n)!==0),"data-on":(e.buttons&n)===0?`0`:`1`,children:r},n)),(0,z.jsx)(`span`,{className:t(e.l2>30),children:`L2`}),(0,z.jsx)(`span`,{className:t(e.r2>30),children:`R2`})]}),(0,z.jsxs)(`div`,{className:`flex gap-3`,children:[n(e.lx,e.ly,`L`),n(e.rx,e.ry,`R`)]})]})}function Cc({onClose:e}){let t=Ie(),[n,r]=(0,D.useState)(()=>vc().map(e=>({index:e.index,id:e.id}))),[i,a]=(0,D.useState)(()=>vc()[0]?.index??null),[o,s]=(0,D.useState)(ja),[c,l]=(0,D.useState)(null),[u,d]=(0,D.useState)(0),[f,p]=(0,D.useState)(yo),[m,h]=(0,D.useState)(null),[g,_]=(0,D.useState)(null),v=(0,D.useRef)(null);(0,D.useEffect)(()=>(ac(!0),()=>ac(!1)),[]),(0,D.useEffect)(()=>{(v.current?.querySelector(`[data-testid="join-pad-learn-start"]`)??v.current?.querySelector(`[data-testid="join-pad-check-close"]`))?.focus({preventScroll:!0})},[]),(0,D.useEffect)(()=>{let e=document.activeElement;e&&e!==document.body||v.current?.querySelector(`button:not([disabled])`)?.focus({preventScroll:!0})},[c,u]),(0,D.useEffect)(()=>{let e=()=>{let e=vc();r(t=>t.length===e.length&&t.every((t,n)=>t.id===e[n].id&&t.index===e[n].index)?t:e.map(e=>({index:e.index,id:e.id}))),a(t=>t!==null&&e.some(e=>e.index===t)?t:e[0]?.index??null)},t=window.setInterval(e,500);return window.addEventListener(`gamepadconnected`,e),window.addEventListener(`gamepaddisconnected`,e),()=>{window.clearInterval(t),window.removeEventListener(`gamepadconnected`,e),window.removeEventListener(`gamepaddisconnected`,e)}},[]),bc(i,e=>{if(_(t=>t?.id===e?.id?t:e),!e)return;if(c){c.feed(Eo(e))&&y(c,e);return}let t=Ga([e],So);s(e=>e.buttons===t.buttons&&e.l2===t.l2&&e.r2===t.r2&&e.lx===t.lx&&e.ly===t.ly&&e.rx===t.rx&&e.ry===t.ry?e:t)});let y=(e,n)=>{if(!e.done)return d(e.step);let r=n?.id??g?.id;l(null),r&&(p(bo(r,e.profile(n?wo(n):void 0))),h(t(`join_check_saved`,void 0,`Saved for this controller on this device. Try it below.`)))},b=()=>{h(null),d(0),l(new Fo(No))},x=g,S=x?Co(x):null,ee=!!(x&&f[x.id]);return(0,z.jsx)(`div`,{ref:v,role:`dialog`,"aria-modal":`true`,"aria-label":t(`join_check_title`,void 0,`Check your controller`),className:`absolute inset-0 z-40 flex items-center justify-center bg-black/70 p-4 backdrop-blur-sm`,"data-testid":`join-pad-check`,onPointerDown:e=>e.stopPropagation(),children:(0,z.jsxs)(`div`,{className:`w-[min(26rem,100%)] space-y-3 rounded-2xl border border-white/10 bg-neutral-900/95 p-4 text-sm text-white shadow-2xl`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsx)(me,{size:16,className:`text-white/70`}),(0,z.jsx)(`p`,{className:`flex-1 font-semibold`,children:t(`join_check_title`,void 0,`Check your controller`)}),(0,z.jsx)(`button`,{type:`button`,onClick:e,"aria-label":t(`join_done`,void 0,`Done`),className:`flex h-8 w-8 items-center justify-center rounded-full bg-white/10 hover:bg-white/20`,"data-testid":`join-pad-check-close`,children:(0,z.jsx)(De,{size:15})})]}),x?(0,z.jsxs)(z.Fragment,{children:[n.length>1&&(0,z.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:n.map(e=>(0,z.jsx)(`button`,{type:`button`,disabled:!!c,onClick:()=>a(e.index),className:`rounded-full px-2.5 py-1 text-xs ${e.index===i?`bg-white text-black`:`bg-white/10`}`,children:to(e.id)},`${e.index}-${e.id}`))}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`p`,{className:`truncate font-medium`,"data-testid":`join-pad-check-name`,children:to(x.id)}),(0,z.jsx)(`p`,{className:`text-xs text-white/60`,"data-testid":`join-pad-check-kind`,"data-kind":S??``,children:S===`saved`?t(`rp_pad_mapped`,void 0,`Plays with your mapping`):S===`guess`?t(`join_check_unknown`,void 0,`This controller isn't on our list, so its buttons may be mixed up. Setting it up takes a few seconds.`):t(`rp_pad_standard`,void 0,`Recognized`)}),io(x)&&(0,z.jsx)(ps,{id:x.id,className:`mt-1 block text-xs text-amber-200/90`})]}),c?(0,z.jsxs)(`div`,{className:`space-y-3`,"data-testid":`join-pad-learn`,children:[(0,z.jsx)(`p`,{className:`text-xs text-white/60`,children:t(`rp_pad_progress`,{n:u+1,total:c.steps.length},`${u+1} of ${c.steps.length}`)}),(0,z.jsx)(`p`,{className:`text-lg font-semibold`,"data-testid":`join-pad-learn-step`,children:c.current?yc(t,c.current):``}),(0,z.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,z.jsx)(`button`,{type:`button`,onClick:()=>{c.skip(),y(c,x)},className:`rounded-full bg-white/15 px-3 py-1.5 text-xs hover:bg-white/25`,"data-testid":`join-pad-learn-skip`,children:t(`rp_pad_skip`,void 0,`Skip`)}),u>0&&(0,z.jsx)(`button`,{type:`button`,onClick:()=>{c.back(),d(c.step)},className:`rounded-full bg-white/15 px-3 py-1.5 text-xs hover:bg-white/25`,children:t(`rp_pad_back`,void 0,`Back`)}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>l(null),className:`rounded-full px-3 py-1.5 text-xs text-white/70 hover:bg-white/10`,children:t(`rp_pad_cancel`,void 0,`Cancel`)})]})]}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`p`,{className:`text-xs text-white/60`,children:t(`join_check_try`,void 0,`Press buttons and move the sticks: what you press lights up.`)}),(0,z.jsx)(Sc,{pad:o}),m&&(0,z.jsx)(`p`,{className:`text-xs text-emerald-300`,role:`status`,children:m}),(0,z.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,z.jsx)(`button`,{type:`button`,onClick:b,className:`rounded-full bg-white px-3 py-1.5 text-xs font-medium text-black`,"data-testid":`join-pad-learn-start`,children:ee?t(`join_check_redo`,void 0,`Redo`):t(`join_check_map`,void 0,`Set up the buttons`)}),ee&&(0,z.jsx)(`button`,{type:`button`,onClick:()=>{p(bo(x.id,null)),h(null)},className:`rounded-full bg-white/15 px-3 py-1.5 text-xs hover:bg-white/25`,"data-testid":`join-pad-reset`,children:t(`rp_pad_reset`,void 0,`Reset`)}),(0,z.jsx)(`button`,{type:`button`,onClick:e,className:`rounded-full bg-white/15 px-3 py-1.5 text-xs hover:bg-white/25`,"data-testid":`join-pad-check-done`,children:t(`join_done`,void 0,`Done`)})]})]})]}):(0,z.jsx)(`p`,{className:`text-white/70`,children:t(`rp_pads_none`,void 0,`No controller seen yet. Connect one and press any button on it.`)})]})})}function wc(e,t){let[n,r]=(0,D.useState)(!1);return(0,D.useEffect)(()=>{if(!e||!t)return;let n=!0;return Be(e,Le).then(e=>{n&&!e&&r(!0)}),()=>{n=!1}},[e,t]),n}function Tc({href:e}){let t=Ie();return(0,z.jsxs)(`div`,{className:`flex flex-col items-center gap-3 text-center`,"data-testid":`open-on-wifi`,children:[(0,z.jsx)(`p`,{className:`max-w-sm text-sm text-white/60`,children:t(`join_open_lan_body`,void 0,`Can't reach the internet? If you're on the same Wi-Fi as your friend, open the game there.`)}),(0,z.jsx)(`a`,{href:e,rel:`noreferrer`,className:`rounded-full bg-white px-4 py-2 text-sm font-medium text-black`,"data-testid":`open-on-wifi-link`,children:t(`join_open_lan`,void 0,`Open on this Wi-Fi`)})]})}function Ec(e){let t=Math.max(0,Math.ceil(e));return`${Math.floor(t/60)}:${String(t%60).padStart(2,`0`)}`}var Dc=`ps5upload.join.guided`,Oc=1;function kc(e){return e.player!==Oc&&(!e.guided||e.movedOff)&&!e.reconnecting}function Ac(e,t){switch(t){case`lan`:return e(`join_path_lan`,void 0,`Home network`);case`tailscale`:return e(`join_path_tailscale`,void 0,`Tailscale`);default:return e(`join_path_internet`,void 0,`Internet`)}}function jc(e,t){return e(`join_seat_taken`,{host:t},`${t} needed their controller back and no other controller was free on the PS5, so you're out of the game. Ask ${t} to let you in again.`)}function Mc(e,t,n,r=!1){if(t.kind===`refused`)switch(t.why){case`key`:return e(`join_refused_key`,{host:n},`This invite has expired. Ask ${n} for a new link.`);case`expired`:return e(`join_refused_expired`,{host:n},`Your place in the game was lost. Ask ${n} to let you in again.`);case`full`:return e(`join_refused_full`,void 0,`The game is full: four players already.`);case`denied`:return e(`join_refused_denied`,{host:n},`${n} didn't let you in this time.`);case`no_answer`:return e(`join_refused_no_answer`,{host:n},`${n} didn't answer in time. Tell ${n}, then try again.`);case`closed`:return e(`join_refused_closed`,{host:n},`${n} isn't hosting Play Together right now.`);case`old_helper`:return e(`join_refused_old_helper`,{host:n},`${n}'s PS5 needs an updated helper for Play Together.`);case`not_playing`:return e(`join_refused_not_playing`,{host:n},`${n} isn't playing right now. Ask ${n} to start Play first.`);case`unreachable`:return e(`join_refused_unreachable`,{host:n},`${n}'s computer couldn't reach their PS5. Try again in a moment.`);case`slow_down`:return e(`join_refused_slow_down`,void 0,`Too many wrong codes. Wait a minute, then try again.`);case`address`:return e(`join_refused_address`,{host:n},`This link's address is outside your home network, so the app will not use it. Ask ${n} for a link with their computer's IP address.`);case`seat_taken`:return jc(e,n);default:return e(`join_refused_other`,{host:n},`${n} didn't let you in.`)}if(t.kind===`ended`)switch(t.why){case`kicked`:return e(`join_ended_kicked`,{host:n},`${n} took you out of the game.`);case`closed`:return e(`join_ended_closed`,{host:n},`${n} closed Play Together.`);case`host_stopped`:return e(`join_ended_host_stopped`,void 0,`The host stopped playing.`);case`replaced`:return e(`join_ended_replaced`,void 0,`This game was opened in another tab or on another device, so it stopped here.`);case`pad_lost`:return e(`join_ended_pad_lost`,{host:n},`The PS5 lost your controller, so you're out of the game. Ask ${n} to let you in again.`);case`gave_up`:return e(`join_ended_gave_up`,{host:n},`The connection to ${n} didn't come back in time.`);case`lost`:return r?e(`join_net_lost`,{host:n},`The connection to ${n} dropped. Check your internet connection, then ask again.`):e(`join_ended_lost`,{host:n},`Couldn't reach ${n}. Check that you're on the same network.`);case`left`:return e(`join_ended_left`,void 0,`You left the game.`);case`seat_taken`:return jc(e,n);case`mismatch`:return e(`join_net_mismatch`,void 0,`This link doesn't match the host; ask them for a new one.`);case`no_direct`:return e(`join_net_no_direct`,void 0,`A direct connection isn't possible from this network (both sides' routers are strict). Try Wi-Fi instead of mobile data, or ask the host to turn on UPnP.`);case`no_room`:return e(`join_net_no_room`,{host:n},`This invite isn't open any more. Ask ${n} for a new link.`);case`net_full`:return e(`join_net_full`,{host:n},`${n}'s game has no room for another friend right now. Try again in a moment.`);case`no_hub`:return e(`join_net_no_hub`,void 0,`Couldn't reach the PS5Upload invite service. Check your internet connection, then try again.`);case`offer`:return e(`join_net_offer`,{host:n},`${n}'s computer couldn't connect to this browser. Try another browser.`);case`no_webrtc`:return e(`join_net_no_webrtc`,void 0,`This browser can't make direct connections. Try a recent Chrome, Safari or Firefox.`)}return``}function Nc(e){let[t,n]=(0,D.useState)(()=>Date.now());return(0,D.useEffect)(()=>{if(!e)return;n(Date.now());let t=window.setInterval(()=>n(Date.now()),500);return()=>window.clearInterval(t)},[e]),t}function Pc(){let[e,t]=(0,D.useState)({ready:!1,pressed:!1,id:null,kind:null,weak8BitDo:!1});return(0,D.useEffect)(()=>{let e=()=>{let e=Xa(typeof navigator>`u`?void 0:navigator).find(e=>!!e?.connected),n=!!e,r=n?sc():null,i=!!r&&(r.buttons!==0||r.l2>30||r.r2>30),a=e?.id??null,o=e?Co(e):null,s=!!e&&io(e);t(e=>e.ready===n&&e.pressed===i&&e.id===a&&e.kind===o&&e.weak8BitDo===s?e:{ready:n,pressed:i,id:a,kind:o,weak8BitDo:s})};e();let n=window.setInterval(e,120);return window.addEventListener(`gamepadconnected`,e),window.addEventListener(`gamepaddisconnected`,e),()=>{window.clearInterval(n),window.removeEventListener(`gamepadconnected`,e),window.removeEventListener(`gamepaddisconnected`,e)}},[]),e}function Fc(e){return!!e?.closest?.(`[data-testid="rp-touch"]`)}var Ic=14,Lc=()=>typeof window<`u`&&!rs()&&!!window.matchMedia?.(`(pointer: coarse)`).matches;function Rc(e,t,n){return!e||e===t||e.closest?.(`[data-join-game]`)?`game`:n?.contains(e)?`controls`:`page`}function zc(e){return e.checking?`close-check`:e.guide?`close-guide`:e.where===`game`?`show-controls`:e.full?`leave-full`:null}var Bc={good:`var(--color-good,#32d074)`,fair:`var(--color-warn,#ffb340)`,slow:`var(--color-bad,#ff6961)`,none:`rgba(255,255,255,.5)`};function Vc({text:e,body:t,onCancel:n}){let r=Ie();return(0,z.jsxs)(`div`,{className:`flex flex-col items-center gap-5 px-6 py-10 text-center`,"data-testid":`join-waiting`,children:[(0,z.jsxs)(`div`,{className:`relative flex h-24 w-24 items-center justify-center`,"aria-hidden":!0,children:[(0,z.jsx)(`span`,{className:`absolute inset-0 animate-ping rounded-full bg-white/10 [animation-duration:2.4s]`}),(0,z.jsx)(`span`,{className:`absolute inset-3 animate-pulse rounded-full bg-white/10 [animation-duration:2.4s]`}),(0,z.jsx)(`span`,{className:`relative flex h-14 w-14 items-center justify-center rounded-full bg-white/15`,children:(0,z.jsx)(Se,{size:26})})]}),(0,z.jsx)(`p`,{className:`max-w-sm text-base font-medium`,"data-testid":`join-stage`,children:e}),t&&(0,z.jsx)(`p`,{className:`max-w-sm text-sm text-white/60`,children:t}),(0,z.jsx)(`button`,{type:`button`,onClick:n,autoFocus:!0,className:`rounded-full bg-white/15 px-4 py-2 text-sm hover:bg-white/25`,"data-testid":`join-cancel`,children:r(`join_cancel`,void 0,`Cancel`)})]})}function Hc({session:e,inApp:t=!1,onLeave:n,onAgain:r,onFullscreen:i,lanUrl:a=null,hubDown:o=!1}){let s=Ie(),c=lc(e),{stage:l,status:u}=c,d=c.host??s(`join_host_fallback`,void 0,`your friend`),f=(0,D.useRef)(null),p=(0,D.useRef)(null),m=(0,D.useRef)(null),[h,g]=(0,D.useState)(!1),[_,v]=(0,D.useState)(()=>Lt(Dc)===`1`),[y,b]=(0,D.useState)(()=>typeof window<`u`&&window.innerHeight>window.innerWidth),x=Pc(),[S,ee]=(0,D.useState)(!1),C=l.kind===`reconnecting`,w=Nc(C),T=l.kind===`joined`||C,E=u?.state===`picking_user`,te=l.kind===`joined`||l.kind===`reconnecting`?l.player:0,[ne,re]=(0,D.useState)(!1),ie=(0,D.useRef)(te);(0,D.useEffect)(()=>{ie.current===Oc&&te>Oc&&re(!0),te&&(ie.current=te)},[te]);let[ae,oe]=(0,D.useState)(!1),[se,ce]=(0,D.useState)(!1),le=T&&(h||!t),de=Lc(),fe=_c(E),k=mc(le,C||fe&&!de||ae||se,de),{poke:he}=k,_e=(0,D.useRef)(null),ve=()=>{_e.current&&clearTimeout(_e.current.timer),_e.current=null};(0,D.useEffect)(()=>ve,[]);let[ye,A]=(0,D.useState)(!1),xe=(0,D.useRef)(!1);(0,D.useEffect)(()=>{if(!le||!de||k.shown||!_||xe.current)return;xe.current=!0,A(!0);let e=setTimeout(()=>A(!1),6e3);return()=>clearTimeout(e)},[le,de,k.shown,_]),(0,D.useEffect)(()=>{if(!T)return;let t=e.element;return f.current?.appendChild(t),()=>t.remove()},[T,e]),(0,D.useEffect)(()=>{if(!T||c.sound)return;let t=()=>e.startSound(),n=[`pointerup`,`touchend`,`click`,`keydown`];for(let e of n)window.addEventListener(e,t,!0);return()=>{for(let e of n)window.removeEventListener(e,t,!0)}},[T,c.sound,e]),(0,D.useEffect)(()=>{let e=()=>b(window.innerHeight>window.innerWidth);return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),(0,D.useEffect)(()=>{if(h)return()=>void i?.(!1)},[h,i]);let Ce=(0,D.useRef)(h);(0,D.useEffect)(()=>{Ce.current=h},[h]),(0,D.useEffect)(()=>{if(!t||!T||!Lc()||typeof window>`u`||!window.matchMedia)return;let e=window.matchMedia(`(orientation: landscape)`),n=()=>{e.matches&&!Ce.current&&(g(!0),i?.(!0))};return n(),e.addEventListener?.(`change`,n),()=>e.removeEventListener?.(`change`,n)},[t,T,i]),(0,D.useEffect)(()=>{t&&T&&rs()&&!Ce.current&&(g(!0),i?.(!0))},[t,T,i]),(0,D.useEffect)(()=>{if(!T)return;let e=e=>{if(e.key!==`Escape`)return;if(S)return void Le.current();if(he(),h)return g(!1);let t=Rc(document.activeElement,document.body,p.current);t===`game`?Le.current():t===`controls`&&m.current?.focus({preventScroll:!0})};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[T,h,he,S]),(0,D.useEffect)(()=>{if(!h||!Lc())return;window.history.pushState(window.history.state,``);let e=window.location.href,t=!1,n=()=>{t=!0,g(!1)};return window.addEventListener(`popstate`,n),()=>{window.removeEventListener(`popstate`,n),!t&&window.location.href===e&&window.history.back()}},[h]),(0,D.useEffect)(()=>{if(!h||typeof document>`u`)return;let e=()=>{document.fullscreenElement||Lc()||g(!1)};return document.addEventListener(`fullscreenchange`,e),()=>document.removeEventListener(`fullscreenchange`,e)},[h]);let Te=rs(),Ee=T&&kc({player:te,guided:_,movedOff:ne,reconnecting:C})&&!u?.playsAs,De=async e=>{g(e),await i?.(e)},Oe=()=>m.current?.focus({preventScroll:!0}),ke=()=>{It(Dc,`1`),v(!0),re(!1)},Ae=()=>{he();let e=C?`[data-testid="join-reconnecting-leave"]`:`[data-testid="join-bar"] button`;p.current?.querySelector(e)?.focus({preventScroll:!0})},je=()=>{let e=p.current?.querySelector(`[data-testid="join-check-open"]`);e?e.focus({preventScroll:!0}):Oe(),ee(!1)},Me=()=>Rc(document.activeElement,document.body,p.current),[Ne,Pe]=(0,D.useState)(`game`);(0,D.useEffect)(()=>{if(!T)return;let e=()=>Pe(Me()),t=()=>window.setTimeout(e,0);return e(),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t)}},[T]);let Fe=()=>{switch(T?zc({checking:S,guide:Ee,where:Me(),full:h}):null){case`close-check`:return je(),!0;case`close-guide`:return ke(),Oe(),!0;case`show-controls`:return Ae(),!0;case`leave-full`:return De(!1),!0;default:return!1}},Le=(0,D.useRef)(Fe);(0,D.useEffect)(()=>{Le.current=Fe});let Re=t&&!de&&T&&zc({checking:S,guide:Ee,where:Ne,full:h})!==null;(0,D.useEffect)(()=>{if(Re)return Xo(()=>void Le.current())},[Re]);let ze=!t&&T&&!de;(0,D.useEffect)(()=>{if(!ze)return;let e=window.location.href;window.history.pushState(window.history.state,``);let t=!0,n=()=>{if(t=!1,!Le.current())return window.history.back();window.history.pushState(window.history.state,``),t=!0};return window.addEventListener(`popstate`,n),()=>{window.removeEventListener(`popstate`,n),t&&window.location.href===e&&window.history.back()}},[ze]);let Be=l.kind===`joined`;(0,D.useEffect)(()=>{if(!Be)return;let e=document.activeElement;if(e&&e!==document.body)return;let t=Te&&Ee?p.current?.querySelector(`[data-testid="join-guide-ok"]`):null;t?t.focus({preventScroll:!0}):Oe()},[Be]),(0,D.useEffect)(()=>{x.pressed&&T&&!S&&Me()===`controls`&&Oe()},[x.pressed]);let Ve=()=>{e.leave(),n()};if(l.kind===`connecting`||l.kind===`asking`)return(0,z.jsxs)(`div`,{className:t?`rounded-[var(--radius-card)] bg-neutral-900 text-white`:`flex min-h-[100dvh] flex-col items-center justify-center gap-4 bg-black text-white`,"data-join-ui":``,children:[l.kind===`connecting`&&o&&a&&(0,z.jsx)(Tc,{href:a}),(0,z.jsx)(Vc,{text:l.kind===`connecting`?s(`join_connecting`,{host:d},`Connecting to ${d}…`):s(`join_waiting`,{host:d},`Waiting for ${d} to let you in`),body:l.kind===`asking`?s(`join_waiting_body`,{host:d},`${d} sees your name on their screen and taps Allow.`):void 0,onCancel:Ve})]});if(l.kind===`refused`||l.kind===`ended`){let i=l.kind===`refused`||l.why!==`left`&&l.why!==`mismatch`;return(0,z.jsxs)(`div`,{className:t?`flex flex-col items-center gap-4 rounded-[var(--radius-card)] bg-neutral-900 px-6 py-10 text-center text-white`:`flex min-h-[100dvh] flex-col items-center justify-center gap-4 bg-black px-6 text-center text-white`,"data-testid":`join-ended`,"data-why":l.why,"data-join-ui":``,children:[(0,z.jsx)(Se,{size:28,className:`text-white/60`}),(0,z.jsx)(`p`,{className:`max-w-sm text-base`,"data-testid":`join-ended-text`,children:Mc(s,l,d,e.opts.internet??!!e.opts.transport)}),a&&l.why===`no_hub`&&(0,z.jsx)(Tc,{href:a}),(0,z.jsxs)(`div`,{className:`flex flex-wrap justify-center gap-2`,children:[i&&(0,z.jsx)(`button`,{type:`button`,onClick:r,autoFocus:!0,className:`rounded-full bg-white px-4 py-2 text-sm font-medium text-black`,"data-testid":`join-again`,children:l.kind===`refused`&&l.why===`not_playing`?s(`join_retry`,void 0,`Try again`):s(`join_again`,void 0,`Ask to join again`)}),(0,z.jsx)(`button`,{type:`button`,onClick:n,autoFocus:!i,className:`rounded-full bg-white/15 px-4 py-2 text-sm`,"data-testid":`join-done`,children:s(`join_done`,void 0,`Done`)})]})]})}let He=l.player,Ue=c.light??at(He),We=c.rttMs??u?.rttMs??null,Ge=it(We),Ke=Lc(),qe=T&&!C&&!x.ready&&Ke&&(!t||h),Je=kc({player:He,guided:_,movedOff:ne,reconnecting:C}),Ye=He===Oc,Xe=u?.playsAs??null,Ze=C?(l.deadline-w)/1e3:0,Qe=()=>De(!h),$e=t&&!h&&Ke&&T,et=(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`span`,{className:`flex items-center gap-1.5 rounded-full bg-black/60 px-2.5 py-1 font-medium`,"data-testid":`join-player`,children:[(0,z.jsx)(`span`,{className:`inline-block h-2.5 w-2.5 rounded-full`,style:{background:`rgb(${Ue[0]},${Ue[1]},${Ue[2]})`}}),t&&(0,z.jsxs)(`span`,{className:`text-white/80`,children:[s(`join_playing_at`,{host:d},`Playing at ${d}'s`),` · `]}),s(`join_you_are`,{n:He},`You are Player ${He}`)]}),We!=null&&(0,z.jsxs)(`span`,{className:`rounded-full bg-black/60 px-2 py-1 tabular-nums`,style:{color:Bc[Ge]},"data-testid":`join-delay`,"data-tone":Ge,"data-path":c.path??void 0,children:[c.path&&(0,z.jsxs)(`span`,{className:`text-white/80`,children:[Ac(s,c.path),` · `]}),Math.round(We),` ms`]}),Ye&&(0,z.jsx)(`span`,{className:`rounded-full bg-black/60 px-2.5 py-1 text-white/85`,"data-testid":`join-seat-stream`,children:s(`join_seat_stream`,{host:d},`You're playing as ${d}'s PS5 user. No need to pick one.`)}),Xe&&!Ye&&(0,z.jsx)(`span`,{className:`rounded-full bg-black/60 px-2.5 py-1 text-white/85`,"data-testid":`join-plays-as`,children:s(`join_plays_as`,{profile:Xe},`You're playing as ${Xe}. No need to pick one.`)}),E&&!Ye&&u?.seatNote&&(0,z.jsx)(`span`,{className:`rounded-full bg-black/60 px-2.5 py-1 text-white/85`,"data-testid":`join-seat-note`,children:s(`join_seat_tv_asks`,{host:d},`${d} chose a profile for you, but it couldn't be used. The TV will ask who you are.`)}),E&&!Ye&&(0,z.jsx)(`span`,{className:`rounded-full bg-white/90 px-2.5 py-1 font-medium text-black`,"data-testid":`join-picking`,children:s(`join_picking`,void 0,`Press PS, then pick Quick Play on the TV`)})]}),tt=(0,z.jsxs)(z.Fragment,{children:[le&&de&&k.shown&&!C&&(0,z.jsxs)(`button`,{type:`button`,onClick:k.hide,className:`flex items-center gap-1 rounded-full bg-white/15 px-2.5 py-1 font-medium`,"data-testid":`join-hide-controls`,children:[(0,z.jsx)(pe,{size:13}),s(`join_hide_controls`,void 0,`Hide`)]}),!c.sound&&(0,z.jsxs)(`button`,{type:`button`,onClick:()=>e.startSound(),className:`flex items-center gap-1 rounded-full bg-white/90 px-2.5 py-1 font-medium text-black`,"data-testid":`join-sound`,children:[(0,z.jsx)(we,{size:13}),s(`join_sound`,void 0,`Tap for sound`)]}),c.sound&&!c.noSound&&(0,z.jsxs)(`button`,{type:`button`,onClick:()=>e.setMuted(!c.muted),"aria-pressed":c.muted,className:`flex items-center gap-1 rounded-full bg-white/15 px-2.5 py-1 hover:bg-white/25`,"data-testid":`join-mute`,children:[c.muted?(0,z.jsx)(M,{size:13}):(0,z.jsx)(we,{size:13}),c.muted?s(`rp_unmute`,void 0,`Sound on`):s(`rp_mute`,void 0,`Mute`)]}),c.noSound&&(0,z.jsxs)(`span`,{className:`flex items-center gap-1 rounded-full bg-black/60 px-2.5 py-1 text-white/80`,"data-testid":`join-no-sound`,children:[(0,z.jsx)(M,{size:13}),s(`join_no_sound`,void 0,`No sound in this browser`)]}),(t||typeof document<`u`&&!!document.documentElement.requestFullscreen)&&(0,z.jsx)(`button`,{type:`button`,onClick:()=>void Qe(),"aria-label":h?s(`join_exit_fullscreen`,void 0,`Leave full screen`):s(`pad_fill`,void 0,`Full screen`),className:`flex items-center gap-1 rounded-full bg-white/15 px-2.5 py-1 hover:bg-white/25`,"data-testid":`join-full`,children:h?(0,z.jsx)(be,{size:13}):(0,z.jsx)(O,{size:13})}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>ee(!0),"aria-label":s(`join_check_title`,void 0,`Check your controller`),title:s(`join_check_title`,void 0,`Check your controller`),className:`flex items-center gap-1 rounded-full bg-white/15 px-2.5 py-1 hover:bg-white/25`,"data-testid":`join-check-open`,children:(0,z.jsx)(me,{size:13})}),(0,z.jsxs)(`button`,{type:`button`,onClick:Ve,className:`flex items-center gap-1 rounded-full bg-[var(--color-danger,#dc2626)] px-3 py-1 font-medium`,"data-testid":`join-leave`,children:[(0,z.jsx)(ge,{size:13}),s(`join_leave`,void 0,`Leave`)]})]}),nt=k.shown?`opacity-100`:`pointer-events-none opacity-0`,rt={"data-testid":`join-bar`,"data-shown":k.shown?`1`:`0`,onFocus:e=>{(Te||e.target.matches?.(`:focus-visible`))&&ce(!0)},onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||ce(!1)},onPointerEnter:e=>{e.pointerType===`mouse`&&oe(!0)},onPointerLeave:()=>oe(!1)},ot=h||!t?`fixed inset-0 z-[200] bg-black`:`relative mx-auto aspect-video w-full max-w-[max(20rem,calc((100dvh_-_22rem)*16/9))] overflow-hidden rounded-[var(--radius-card)] bg-black shadow-[var(--shadow-2)]`,st=t&&h;return(0,z.jsxs)(`div`,{className:`space-y-2`,ref:p,"data-join-ui":``,children:[(0,z.jsxs)(`div`,{className:`${ot} select-none text-white [-webkit-touch-callout:none]`,style:{touchAction:`none`},role:st?`dialog`:void 0,"aria-modal":st?!0:void 0,"aria-label":st?s(`pad_fill`,void 0,`Full screen`):void 0,onPointerMove:e=>{if(e.pointerType===`mouse`)return he();let t=_e.current;t&&t.id===e.pointerId&&Math.hypot(e.clientX-t.x,e.clientY-t.y)>Ic&&ve()},onPointerDown:e=>{if(Fc(e.target))return;if(e.pointerType===`mouse`||!de)return he();if(e.target.closest?.(`[data-testid="join-bar"], button, a, input, [role="button"]`))return;ve();let{pointerId:t,clientX:n,clientY:r}=e;_e.current={id:t,x:n,y:r,timer:setTimeout(()=>{_e.current=null,navigator.vibrate?.(15),k.toggle()},450)}},onPointerUp:ve,onPointerCancel:ve,onPointerLeave:ve,"data-testid":`join-stage-view`,children:[(0,z.jsx)(`div`,{ref:f,className:`pointer-events-none absolute inset-0 z-0 flex items-center justify-center`,"aria-hidden":!0}),le&&!k.shown&&!C&&We!=null&&(0,z.jsxs)(`span`,{className:`pointer-events-none absolute z-10 rounded-full bg-black/40 px-1.5 py-0.5 text-[10px] leading-none tabular-nums`,style:{color:Bc[Ge],top:`max(0.5rem, env(safe-area-inset-top))`,right:`max(0.5rem, env(safe-area-inset-right))`},"data-testid":`join-delay-corner`,children:[Math.round(We),` ms`]}),qe?(0,z.jsxs)(`div`,{className:`absolute left-1/2 top-1/2 z-20 flex w-max max-w-[min(24rem,calc(100%-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col items-center gap-2 rounded-2xl bg-black/70 p-3 text-xs backdrop-blur-sm transition-opacity duration-300 ${nt}`,...rt,children:[(0,z.jsx)(`div`,{className:`flex flex-wrap items-center justify-center gap-2`,children:et}),(0,z.jsx)(`div`,{className:`flex flex-wrap items-center justify-center gap-2`,children:tt})]}):$e?null:(0,z.jsxs)(`div`,{className:`absolute inset-x-0 top-0 z-20 flex flex-wrap items-center gap-2 bg-gradient-to-b from-black/70 to-transparent px-3 pb-5 pt-[max(8px,env(safe-area-inset-top))] text-xs transition-opacity duration-300 ${nt}`,...rt,children:[et,(0,z.jsx)(`span`,{className:`flex-1`}),tt]}),!k.shown&&!qe&&(0,z.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),he()},"aria-label":s(`join_show_controls`,void 0,`Show controls`),className:`absolute left-1/2 top-[max(6px,env(safe-area-inset-top))] z-20 flex h-7 w-11 -translate-x-1/2 items-center justify-center rounded-full bg-black/40 text-white/70 opacity-60 hover:opacity-100 focus-visible:opacity-100`,"data-testid":`join-show-controls`,children:(0,z.jsx)(ue,{size:16,"aria-hidden":!0})}),ye&&!k.shown&&(0,z.jsx)(`p`,{className:`pointer-events-none absolute left-1/2 top-[max(10px,env(safe-area-inset-top))] z-20 -translate-x-1/2 rounded-full bg-black/60 px-3 py-1 text-xs text-white/85`,"data-testid":`join-hold-hint`,children:s(`join_hold_hint`,void 0,`Press and hold the picture to show the buttons`)}),c.problem&&(0,z.jsx)(`p`,{className:`absolute inset-x-4 top-1/2 z-10 -translate-y-1/2 text-center text-sm text-white/85`,"data-testid":`join-problem`,children:c.problem===`no_hevc`?s(`pad_watch_no_hevc`,void 0,`This device can't play this stream's picture: the computer streams HEVC, and this device plays only H.264.`):s(`pad_watch_decode`,void 0,`The picture could not be played here.`)}),S&&(0,z.jsx)(Cc,{onClose:je}),qe&&(0,z.jsx)(ks,{stream:e,layout:`overlay`,onMenu:()=>k.shown?k.hide():he()}),!qe&&!C&&(0,z.jsxs)(`div`,{className:`absolute bottom-3 left-3 z-20 flex items-center gap-2 rounded-2xl bg-black/70 px-3 py-1.5 text-xs transition-opacity duration-300 ${nt}`,"data-testid":`join-pad`,children:[(0,z.jsx)(me,{size:14,style:{color:x.pressed?`rgb(${Ue[0]},${Ue[1]},${Ue[2]})`:void 0}}),x.ready?(0,z.jsxs)(`span`,{className:`flex flex-col items-start gap-1`,children:[(0,z.jsx)(`span`,{children:s(`join_pad_ready`,void 0,`Your controller is ready`)}),x.weak8BitDo&&x.id&&(0,z.jsx)(ps,{id:x.id,className:`text-amber-200/90`}),x.kind===`guess`&&no()&&(0,z.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2 text-white/75`,"data-testid":`join-pad-unknown`,children:[s(`join_check_unknown_short`,void 0,`Not on our list: buttons may be mixed up.`),(0,z.jsx)(`button`,{type:`button`,onClick:()=>ee(!0),className:`rounded-full bg-white px-2.5 py-0.5 font-medium text-black`,"data-testid":`join-pad-unknown-check`,children:s(`join_check_title`,void 0,`Check your controller`)})]})]}):Ke&&t&&!h?s(`join_full_to_play`,void 0,`Tap full screen to play with the on-screen controller.`):(0,z.jsxs)(`span`,{className:`flex flex-col`,children:[(0,z.jsx)(`span`,{children:s(`join_pad_none`,void 0,`Connect a controller (USB or Bluetooth) and press any button.`)}),(0,z.jsx)(`span`,{className:`text-white/60`,"data-testid":`join-pad-keys`,children:s(`join_pad_keys`,void 0,`Or use the keyboard: WASD move, arrows D-pad, Enter ✕, Backspace ○, Q □, E △, Tab Options.`)})]}),Te&&(0,z.jsx)(`span`,{className:`max-w-[14rem] border-l border-white/20 pl-2 text-white/70`,"data-testid":`join-tv-back`,children:s(`join_tv_back_hint`,void 0,`Press Back on the remote for the buttons.`)})]}),u?.blockSystem&&u.state===`playing`&&!qe&&(0,z.jsx)(`p`,{className:`absolute bottom-3 right-3 z-20 rounded-full bg-black/60 px-3 py-1 text-[11px] text-white/70 transition-opacity duration-300 ${nt}`,"data-testid":`join-blocked`,children:s(`join_block_note`,{host:d},`${d} turned off PS and Create for friends.`)}),fe&&!Ye&&de&&!k.shown&&!C&&(0,z.jsx)(`p`,{className:`pointer-events-none absolute left-1/2 top-2 z-20 -translate-x-1/2 whitespace-nowrap rounded-full bg-white/90 px-2.5 py-1 text-xs font-medium text-black`,"data-testid":`join-picking-note`,children:s(`join_picking`,void 0,`Press PS, then pick Quick Play on the TV`)}),Je&&!Xe&&(0,z.jsxs)(`div`,{className:`absolute bottom-14 left-1/2 z-30 w-[min(22rem,calc(100%-2rem))] -translate-x-1/2 rounded-2xl border border-white/10 bg-neutral-900/90 p-4 text-sm shadow-2xl backdrop-blur-md`,"data-testid":`join-guide`,children:[(0,z.jsx)(`p`,{className:`font-semibold`,children:s(`join_guide_title`,void 0,`One more step on the TV`)}),(0,z.jsx)(`p`,{className:`mt-1 text-white/75`,children:s(`join_guide_body`,void 0,`On your controller, press PS once. The TV asks "Who's using this controller?". Pick Quick Play or your own user. The host doesn't need to do anything.`)}),(0,z.jsx)(`p`,{className:`mt-1 text-white/60`,children:s(`join_guide_menus`,void 0,`On the PS5's home screen only the host controls the menus; your controller plays inside games.`)}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>{ke(),Oe()},className:`mt-3 rounded-full bg-white px-3 py-1 text-xs font-medium text-black`,"data-testid":`join-guide-ok`,children:s(`join_guide_ok`,void 0,`Got it`)})]}),C&&(0,z.jsxs)(`div`,{className:`absolute inset-0 z-30 flex flex-col items-center justify-center gap-3 bg-black/70 px-6 text-center`,"data-testid":`join-reconnecting`,children:[(0,z.jsxs)(`button`,{type:`button`,onClick:Ve,className:`absolute right-3 top-[max(10px,env(safe-area-inset-top))] flex items-center gap-1 rounded-full bg-white/15 px-3 py-1.5 text-sm font-medium hover:bg-white/25`,"data-testid":`join-reconnecting-leave`,children:[(0,z.jsx)(ge,{size:14}),s(`join_leave`,void 0,`Leave`)]}),(0,z.jsx)(`span`,{className:`h-7 w-7 animate-spin rounded-full border-2 border-white/30 border-t-white`,"aria-hidden":!0}),l.hostStopped?(0,z.jsx)(`p`,{className:`max-w-sm text-base font-medium`,"data-testid":`join-host-away`,children:s(`join_host_away`,{time:Ec(Ze)},`The host stopped playing — waiting for them to start again (${Ec(Ze)})`)}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`p`,{className:`text-base font-medium`,children:s(`join_reconnecting`,void 0,`Reconnecting…`)}),(0,z.jsx)(`p`,{className:`text-sm text-white/70`,"data-testid":`join-reconnecting-left`,children:s(`join_reconnecting_left`,{time:Ec(Ze)},`Your place is kept for ${Ec(Ze)}.`)})]})]}),!t&&T&&y&&Ke&&(0,z.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 bottom-16 z-20 flex justify-center`,children:(0,z.jsxs)(`span`,{className:`flex items-center gap-2 rounded-full bg-black/70 px-3 py-1.5 text-xs text-white/85`,children:[(0,z.jsx)(j,{size:14}),s(`pad_turn`,void 0,`Turn the phone sideways`)]})}),(0,z.jsx)(`div`,{ref:m,tabIndex:0,"data-own-arrows":``,"data-join-game":``,"aria-label":s(`join_game_label`,{host:d},`${d}'s game`),className:`pointer-events-none absolute inset-0 outline-none`,"data-testid":`join-game`})]}),$e&&(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 rounded-[var(--radius-card)] bg-neutral-900 px-3 py-2 text-xs text-white`,"data-testid":`join-bar`,"data-shown":`1`,"data-below":`1`,children:[(0,z.jsx)(`div`,{className:`flex w-full min-w-0 flex-wrap items-center gap-2`,children:et}),(0,z.jsxs)(`button`,{type:`button`,onClick:()=>void Qe(),className:`flex h-11 min-w-0 flex-1 items-center justify-center gap-1.5 rounded-full bg-white/15 px-3 text-sm font-medium hover:bg-white/25`,"data-testid":`join-fullscreen-below`,children:[(0,z.jsx)(O,{size:15}),s(`pad_fill`,void 0,`Full screen`)]}),c.sound&&!c.noSound?(0,z.jsx)(`button`,{type:`button`,onClick:()=>e.setMuted(!c.muted),"aria-pressed":c.muted,"aria-label":c.muted?s(`rp_unmute`,void 0,`Sound on`):s(`rp_mute`,void 0,`Mute`),className:`flex h-11 w-11 items-center justify-center rounded-full bg-white/15 hover:bg-white/25`,children:c.muted?(0,z.jsx)(M,{size:16}):(0,z.jsx)(we,{size:16})}):c.sound?null:(0,z.jsxs)(`button`,{type:`button`,onClick:()=>e.startSound(),className:`flex h-11 items-center justify-center gap-1.5 rounded-full bg-white px-3 text-sm font-medium text-black`,children:[(0,z.jsx)(we,{size:15}),s(`join_sound`,void 0,`Tap for sound`)]}),(0,z.jsxs)(`button`,{type:`button`,onClick:Ve,className:`flex h-11 items-center justify-center gap-1.5 rounded-full bg-[var(--color-danger,#dc2626)] px-4 text-sm font-medium`,"data-testid":`join-leave-below`,children:[(0,z.jsx)(ge,{size:15}),s(`join_leave`,void 0,`Leave`)]})]})]})}var Uc=`ps5upload.join.name`;function Wc(e){return/iPhone/.test(e)?`iPhone`:/iPad/.test(e)?`iPad`:/Android/.test(e)?`Android`:``}function Gc(e){return e.trim().slice(0,32)}function Kc(e=``){return Gc(Lt(`ps5upload.join.name`)??``)||e}function qc(e){let t=Gc(e);return t&&It(Uc,t),t}function Jc(e){try{return!!sessionStorage.getItem(Ro(e))}catch{return!1}}async function Yc(e){try{e?(await document.documentElement.requestFullscreen?.({navigationUI:`hide`}),await screen.orientation.lock?.(`landscape`)):document.fullscreenElement&&await document.exitFullscreen()}catch{}}function Xc({url:e,invite:t,host:n,transport:r,lanUrl:i=null,path:a=null,internet:o}){let s=Ie(),c=wc(r&&o!==!1?e:null,i),[l,u]=(0,D.useState)(()=>Kc(Wc(typeof navigator>`u`?``:navigator.userAgent))),[d,f]=(0,D.useState)(null),[p,m]=(0,D.useState)(0),h=(0,D.useCallback)(e=>{if(!e)return;let t=typeof window<`u`&&!!window.matchMedia?.(`(pointer: coarse)`).matches,n=e.querySelector(`[data-testid="join-name"]`)?.value.trim()?`join-go`:t?null:`join-name`;n&&e.querySelector(`[data-testid="${n}"]`)?.focus({preventScroll:!0})},[]),g=i=>{let s=qc(i);if(!s)return;let c=new cc({url:e,invite:t,name:s,host:n,transport:r,path:a,...o===void 0?{}:{internet:o}});f(c),m(e=>e+1),c.start()};if((0,D.useEffect)(()=>{!d&&Jc(t)&&l.trim()&&g(l)},[]),(0,D.useEffect)(()=>d?dc(d):void 0,[d]),(0,D.useEffect)(()=>{if(!d)return;let e=()=>d.stop();return window.addEventListener(`pagehide`,e),()=>window.removeEventListener(`pagehide`,e)},[d]),d)return(0,z.jsx)(Hc,{session:d,lanUrl:i,hubDown:c,onLeave:()=>f(null),onAgain:()=>{d.stop(),g(l)},onFullscreen:Yc},p);let _=n??s(`join_host_fallback`,void 0,`your friend`),v=(0,z.jsx)(`div`,{className:`flex min-h-[100dvh] items-center justify-center bg-black px-6 text-white`,"data-testid":`join-name-step`,"data-join-ui":``,children:(0,z.jsxs)(`form`,{ref:h,className:`w-full max-w-sm space-y-4 rounded-2xl border border-white/10 bg-neutral-900 p-6`,onSubmit:e=>{e.preventDefault(),g(l)},children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,z.jsx)(`span`,{className:`flex h-10 w-10 items-center justify-center rounded-full bg-white/10`,children:(0,z.jsx)(Se,{size:20})}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`h1`,{className:`text-lg font-semibold`,children:s(`join_title`,void 0,`Join a friend's game`)}),(0,z.jsx)(`p`,{className:`text-sm text-white/60`,children:s(`join_title_body`,{host:_},`Play on ${_}'s PS5 as Player 2, 3 or 4.`)})]})]}),(0,z.jsxs)(`label`,{className:`block space-y-1.5`,children:[(0,z.jsx)(`span`,{className:`text-sm font-medium`,children:s(`join_name_label`,void 0,`Your name`)}),(0,z.jsx)(`input`,{value:l,onChange:e=>u(e.target.value),maxLength:32,autoComplete:`nickname`,className:`block w-full rounded-lg border border-white/15 bg-black px-3 py-2 text-base outline-none focus:border-white/50`,"data-testid":`join-name`}),(0,z.jsx)(`span`,{className:`block text-xs text-white/50`,children:s(`join_name_hint`,void 0,`Your friend sees this when you ask to join.`)})]}),(0,z.jsx)(`button`,{type:`submit`,disabled:!l.trim(),className:`w-full rounded-full bg-white py-2.5 text-sm font-semibold text-black disabled:opacity-40`,"data-testid":`join-go`,children:s(`join_button`,void 0,`Join`)}),c&&i&&(0,z.jsx)(Tc,{href:i})]})});return t?(0,z.jsx)(Wo,{appLink:rt(location.href),children:v}):v}function Zc(e){let t=(e??``).trim().replace(/^\[|\]$/g,``).toLowerCase(),n=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/.exec(t);if(n){let e=n.slice(1).map(Number);if(e.some(e=>e>255))return null;let[t,r]=e;return t===10||t===172&&r>=16&&r<32||t===192&&r===168||t===169&&r===254||t===127?0:t===100&&r>=64&&r<128?1:2}if(!t.includes(`:`)||!/^[0-9a-f:.]+$/.test(t))return null;if(t.startsWith(`fd7a:115c:a1e0:`))return 1;let r=parseInt(t.split(`:`)[0]||`0`,16);return(r&65024)==64512||(r&65472)==65152||t===`::1`?0:2}function Qc(e,t){let n=Zc(e),r=Zc(t);return n===1||r===1?`tailscale`:r===0?`lan`:r===2?`internet`:null}function $c(e){let t=(e??``).toLowerCase();if(t.endsWith(`.local`))return`lan`;if(t.endsWith(`.ts.net`))return`tailscale`;let n=Zc(t);return n===0?`lan`:n===1?`tailscale`:null}function el(e){let t=[];if(typeof e.forEach==`function`)e.forEach(e=>t.push(e));else for(let n of e)t.push(n);let n=new Map(t.map(e=>[String(e.id),e])),r=t.filter(e=>e.type===`candidate-pair`),i=t.filter(e=>e.type===`transport`&&typeof e.selectedCandidatePairId==`string`).map(e=>n.get(String(e.selectedCandidatePairId))).find(Boolean)??r.find(e=>e.selected===!0)??r.find(e=>e.nominated===!0&&e.state===`succeeded`);if(!i)return null;let a=e=>{let t=n.get(String(e));if(!t)return null;let r=t.address??t.ip;return typeof r==`string`?r:null};return Qc(a(i.localCandidateId),a(i.remoteCandidateId))}function tl(e){let t=e.replace(/:\d+$/,``).replace(/^\[|\]$/g,``);return`${t===`localhost`||t===`127.0.0.1`||t===`::1`?`ws`:`wss`}://${e}/ws`}function nl(e){let t=new Set;for(let n of e.matchAll(/^a=fingerprint:sha-256[ \t]+([0-9A-Fa-f:]+)[ \t]*\r?$/gim))t.add(n[1].toUpperCase());return/^a=fingerprint:(?!sha-256[ \t])/im.test(e)?null:t.size===1?[...t][0]:null}function rl(e,t){let n=nl(e);return n!==null&&n===t.toUpperCase()}var il=16777216;function al(e){let t=16383,n=Math.max(1,Math.ceil(e.length/t)),r=[];for(let i=0;ithis.max)return this.parts=[],this.size=0,{kind:`error`,why:`too_big`};if(this.parts.push(r.slice()),this.size+=r.length,n===1)return{kind:`partial`};let i=new Uint8Array(this.size),a=0;for(let e of this.parts)i.set(e,a),a+=e.length;return this.parts=[],this.size=0,{kind:`message`,data:i.buffer}}};function sl(e){let t=new Uint8Array(9);return t[0]=3,t.set(e.subarray(0,8),1),t}var cl=[`stun:stun.cloudflare.com:3478`,`stun:stun.l.google.com:19302`],ll=1500,ul=2e4;function dl(e){let t=e?.codecs??[],n=e=>t.filter(t=>t.mimeType.toLowerCase()===e);return[...n(`video/h264`),...n(`video/h265`),...n(`video/rtx`)]}var fl=null;function pl(e){e.onopen=e.onmessage=e.onclose=e.onerror=null;try{e.readyState===1&&e.send(JSON.stringify({t:`leave`})),e.close(1e3)}catch{}}function ml(e,t={}){let n=t.WebSocketImpl??(typeof WebSocket>`u`?void 0:WebSocket);if(!n||fl)return;let r=tl(e.hub),i;try{i=new n(r)}catch{return}let a={url:r,room:e.room,ws:i,msgs:[],timer:null};fl=a;let o=()=>{fl===a&&(fl=null,a.timer&&clearTimeout(a.timer),pl(i))};i.onopen=()=>i.send(JSON.stringify({v:1,t:`join`,room:e.room})),i.onmessage=e=>{if(typeof e.data==`string`)try{a.msgs.push(JSON.parse(e.data))}catch{}},i.onclose=o,i.onerror=()=>{},a.timer=setTimeout(o,t.keepMs??6e4)}function hl(e,t){let n=fl;return n?(fl=null,n.timer&&clearTimeout(n.timer),n.url!==e||n.room!==t||n.ws.readyState>1||n.msgs.some(e=>e.t===`error`||e.t===`closed`)?(pl(n.ws),null):{ws:n.ws,msgs:n.msgs}):null}function gl(e,t={}){var n;let r=t.WebSocketImpl??(typeof WebSocket>`u`?void 0:WebSocket),i=t.PeerConnection??(typeof RTCPeerConnection>`u`?void 0:RTCPeerConnection),a=t.iceTimeoutMs??15e3,o=t.log??(()=>{});class s{constructor(e){this.CONNECTING=0,this.OPEN=1,this.CLOSING=2,this.CLOSED=3,this.readyState=0,this.binaryType=`arraybuffer`,this.onopen=null,this.onmessage=null,this.onclose=null,this.onerror=null,this.hub=null,this.pc=null,this.dc=null,this.timer=null,this.rx=new ol,this.answered=!1,this.early=[],this.hubBackUntil=0,this.offerSdp=null,this.offerSent=!1,this.ownEarly=[],this.media=null,setTimeout(()=>this.begin(),0)}begin(){if(this.readyState!==0)return;if(!i||!r){this.fail(`no_webrtc`);return}let n=t.signalUrl??tl(e.hub),a=t.signalUrl||t.lan?null:hl(n,e.room),s;if(a)s=a.ws,o(`hub: joined early`);else try{s=new r(n)}catch{this.fail(`no_hub`);return}if(this.hub=s,this.prepare(),this.readyState===0){s.onopen=()=>s.send(JSON.stringify(t.lan?{v:1,t:`join`,lan:!0}:{v:1,t:`join`,room:e.room})),s.onmessage=e=>{if(typeof e.data!=`string`)return;let t;try{t=JSON.parse(e.data)}catch{return}this.onHub(t)},s.onclose=e=>{this.hub===s&&(this.hub=null,this.readyState===0&&(this.answered||e?.code===1001&&this.hubRestarting()||this.fail(`no_hub`)))},s.onerror=()=>{};for(let e of a?.msgs??[])this.onHub(e)}}signal(e){let t=this.hub;t&&t.readyState===1&&t.send(JSON.stringify({t:`signal`,to:`host`,data:e}))}onHub(e){if(this.readyState===0)switch(e.t){case`joined`:o(`hub: joined room as ${e.gid??`?`}`),this.sendOffer();return;case`signal`:e.from===`host`&&e.data&&typeof e.data==`object`&&this.onSignal(e.data);return;case`closed`:this.fail(`no_room`);return;case`error`:if(o(`hub: error ${e.why??`?`}`),e.why===`no_room`&&this.hubBackUntil&&this.hubRestarting())return;this.fail(e.why===`no_room`?`no_room`:e.why===`room_full`?`net_full`:`no_hub`);return}}prepare(){if(!i)return;this.offerSent=!1,this.ownEarly=[];let e;try{e=new i({iceServers:[{urls:cl}]})}catch{this.fail(`no_webrtc`);return}this.pc=e;let n=e.createDataChannel(t.label??`join`,{ordered:!0});if(n.binaryType=`arraybuffer`,this.dc=n,n.onopen=()=>this.opened(n),n.onmessage=e=>this.fromChannel(e.data),n.onclose=()=>{this.dc===n&&this.dropped()},t.video&&e.addTransceiver){try{let t=e.addTransceiver(`video`,{direction:`recvonly`}),n=dl(globalThis.RTCRtpReceiver?.getCapabilities?.(`video`));n.length&&t.setCodecPreferences&&t.setCodecPreferences(n)}catch{}try{e.addTransceiver(`audio`,{direction:`recvonly`})}catch{}e.ontrack=t=>{if(this.pc!==e)return;let n=this.media?.stream??t.streams[0]??new MediaStream;n.getTracks().includes(t.track)||n.addTrack(t.track),this.media=t.track.kind===`audio`?{stream:n,receiver:this.media?.receiver??t.receiver,audio:t.receiver}:{stream:n,receiver:t.receiver,...this.media?.audio?{audio:this.media.audio}:{}}}}e.onicecandidate=t=>{if(this.pc!==e)return;let n=t.candidate;if(!n||!n.candidate)return;let r={type:`candidate`,candidate:n.candidate,sdpMid:n.sdpMid??`0`};this.offerSent?this.signal(r):this.ownEarly.push(r)},e.oniceconnectionstatechange=()=>{if(this.pc!==e)return;let t=e.iceConnectionState;o(`ice: ${t}`),t===`failed`&&(this.readyState===0?this.fail(`no_direct`):this.dropped())},this.offerSdp=(async()=>{let t=await e.createOffer();return await e.setLocalDescription(t),e.localDescription?.sdp??t.sdp??``})().catch(()=>(this.pc===e&&this.fail(`no_webrtc`),null))}async sendOffer(){let e=this.pc,t=this.offerSdp;if(!e||!t||this.offerSent)return;this.clearTimer(),this.timer=setTimeout(()=>{this.timer=null,this.readyState===0&&this.fail(`no_direct`)},a);let n=await t;if(this.pc===e&&n!==null&&this.readyState===0){this.signal({type:`offer`,sdp:n}),this.offerSent=!0;for(let e of this.ownEarly.splice(0))this.signal(e)}}async onSignal(t){let n=this.pc;if(t.type===`bye`)this.fail(t.why===`full`?`net_full`:`offer`);else if(n){if(t.type===`answer`){if(this.answered||typeof t.sdp!=`string`)return;if(e.fp?!rl(t.sdp,e.fp):nl(t.sdp)===null){o(`answer: fingerprint does not match the link`),this.fail(`mismatch`);return}this.answered=!0;try{await n.setRemoteDescription({type:`answer`,sdp:t.sdp});for(let e of this.early.splice(0))await n.addIceCandidate(e).catch(()=>{})}catch{this.fail(`offer`)}}else if(t.type===`candidate`&&typeof t.candidate==`string`&&t.candidate){let e={candidate:t.candidate,sdpMid:typeof t.sdpMid==`string`?t.sdpMid:`0`,sdpMLineIndex:typeof t.sdpMLineIndex==`number`?t.sdpMLineIndex:0};this.answered?await n.addIceCandidate(e).catch(()=>{}):this.early.push(e)}}}opened(e){this.dc===e&&this.readyState===0&&(this.clearTimer(),this.readyState=1,o(`channel open`),this.leaveHub(),this.onopen?.(new Event(`open`)))}fromChannel(e){if(this.readyState!==1)return;if(typeof e==`string`){this.onmessage?.(new MessageEvent(`message`,{data:e}));return}if(!(e instanceof ArrayBuffer))return;let t=this.rx.push(e);switch(t.kind){case`ping`:try{this.dc?.send(sl(t.data))}catch{}return;case`message`:this.onmessage?.(new MessageEvent(`message`,{data:t.data}));return;case`error`:o(`channel: bad binary message (${t.why})`),this.dropped();return;default:return}}async netPath(){let e=this.pc;if(!e||this.readyState!==1||typeof e.getStats!=`function`)return null;try{return el(await e.getStats())}catch{return null}}send(e){let t=this.dc;if(this.readyState!==1||!t||t.readyState!==`open`)throw Error(`not open`);if(typeof e==`string`){t.send(e);return}let n=ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e);for(let e of al(n))t.send(e)}close(){this.readyState!==3&&(this.teardown(),this.emitClose(1e3,``,!0))}clearTimer(){this.timer&&clearTimeout(this.timer),this.timer=null}leaveHub(){let e=this.hub;if(this.hub=null,e)try{e.readyState===1&&e.send(JSON.stringify({t:`leave`})),e.close(1e3)}catch{}}hubRestarting(){let e=Date.now();return this.hubBackUntil||=e+ul,e>=this.hubBackUntil?!1:(o(`hub: restarting, trying again`),this.clearTimer(),this.leaveHub(),this.closePeer(),this.answered=!1,this.early=[],this.timer=setTimeout(()=>{this.timer=null,this.begin()},ll),!0)}teardown(){this.readyState=3,this.clearTimer(),this.leaveHub(),this.closePeer()}closePeer(){let e=this.pc,t=this.dc;this.pc=null,this.dc=null,this.media=null,this.offerSdp=null,this.offerSent=!1,this.ownEarly=[];try{t?.close()}catch{}try{e?.close()}catch{}}dropped(){this.readyState!==3&&(this.teardown(),this.emitClose(1006,``,!1))}fail(e){this.readyState!==3&&(o(`failed: ${e}`),this.teardown(),this.emitClose(He,`net:${e}`,!1))}emitClose(e,t,n){let r=this.onclose;if(!r)return;let i=typeof CloseEvent>`u`?{type:`close`,code:e,reason:t,wasClean:n}:new CloseEvent(`close`,{code:e,reason:t,wasClean:n});setTimeout(()=>r(i),0)}}return n=s,n.CONNECTING=0,n.OPEN=1,n.CLOSING=2,n.CLOSED=3,s}var _l=3e3;function vl(e,t){return/^https?:\/\/[^/?#]+(\/[^?#]*)?\/join\/?$/.test(e)?e.replace(/^http/,`ws`).replace(/\/join\/?$/,`/${t}`):null}var U=e=>vl(e,`api/join/signal`);function yl(e){let t=[];if(e.rtc){let n=e.net??{room:``,key:``,fp:e.fp??``,hub:``};for(let[r,i]of[[`lan`,e.lan],[`tailscale`,e.ts]]){let a=i?U(i):null;if(!a)continue;let o=e.rtcMake(n,{signalUrl:e.reach(a),...e.net?{}:{lan:!0}});t.push({via:r,make:()=>new o(``),pinned:!!n.fp})}if(e.net){let n=e.rtcMake(e.net,{});t.push({via:`hub`,make:()=>new n(``),pinned:!0})}}let n=e.lan?vl(e.lan,`api/join/ws`):null;if(n){let r=e.reach(n);t.push({via:`socket`,make:()=>e.socket(r)})}return t}var bl=new Map;function xl(e,t,n=300,r=_l){let i=e.some(e=>e===`lan`||e===`tailscale`),a=e.some(e=>e!==`socket`);return e.map(e=>e===t?0:e===`hub`&&i?n:e===`socket`&&a?r:0)}function Sl(e){let t=e.find(e=>e.via===`hub`),n=e.find(e=>(e.via===`lan`||e.via===`tailscale`)&&[`no_direct`,`net_full`,`offer`].includes(Ue(e.e)??``));return t&&(Ue(t.e)!==`no_hub`||!n)?t.e:n?n.e:t?.e??e[e.length-1]?.e??null}function Cl(e,t){var n;let r=t.log??(()=>{}),i=t.headStartMs??300,a=t.socketAfterMs??3e3;class o{constructor(e){this.CONNECTING=0,this.OPEN=1,this.CLOSING=2,this.CLOSED=3,this.readyState=0,this.binaryType=`arraybuffer`,this.onopen=null,this.onmessage=null,this.onclose=null,this.onerror=null,this.live=[],this.waiting=[],this.pinned=new Set,this.t0=0,this.closes=[],this.winner=null,setTimeout(()=>this.begin(),0)}get via(){return this.winner?.via??null}get media(){return this.winner?.s?.media??null}async netPath(){let e=this.winner?.s;return e?.netPath?e.netPath():null}begin(){if(this.readyState!==0)return;let n=e();if(!n.length){this.end({type:`close`,code:1006,reason:``,wasClean:!1});return}this.t0=Date.now();for(let e of n)e.pinned&&this.pinned.add(e.via);let r=xl(n.map(e=>e.via),bl.get(t.room)??null,i,a);n.forEach((e,t)=>{r[t]===0?this.launch(e.via,e.make):this.waiting.push({via:e.via,make:e.make,timer:setTimeout(()=>this.startWaiting(e.via),r[t])})})}startWaiting(e){let t=this.waiting.findIndex(t=>t.via===e);if(t<0)return;let[n]=this.waiting.splice(t,1);clearTimeout(n.timer),this.launch(n.via,n.make)}launch(e,t){if(this.readyState!==0)return;let n;try{n=t()}catch{this.tryClosed(e,{type:`close`,code:1006,reason:``,wasClean:!1});return}r(`path: trying ${e}`);let i={via:e,s:n};this.live.push(i),n.binaryType=this.binaryType,n.onopen=e=>this.won(i,e),n.onclose=t=>{this.live=this.live.filter(e=>e!==i),this.tryClosed(e,t)},n.onerror=()=>{},n.onmessage=null}tryClosed(e,t){if(this.readyState===0){if(r(`path: ${e} failed after ${Date.now()-this.t0} ms${t?.reason?` (${t.reason})`:``}`),this.closes.push({via:e,e:t}),this.pinned.has(e)&&Ue(t)===`mismatch`){for(let e of this.waiting.filter(e=>e.via===`socket`))clearTimeout(e.timer);this.waiting=this.waiting.filter(e=>e.via!==`socket`)}!this.live.length&&this.waiting.length?this.startWaiting(this.waiting[0].via):!this.live.length&&!this.waiting.length&&this.end(Sl(this.closes))}}won(e,n){if(this.readyState!==0)return;this.winner=e,bl.set(t.room,e.via),r(`path: playing by ${e.via} after ${Date.now()-this.t0} ms`);for(let e of this.waiting.splice(0))clearTimeout(e.timer);for(let t of this.live.splice(0))if(t!==e){t.s.onopen=t.s.onclose=t.s.onmessage=t.s.onerror=null;try{t.s.close()}catch{}}let i=e.s;i.onmessage=e=>this.onmessage?.(e),i.onerror=e=>this.onerror?.(e),i.onclose=e=>{this.readyState!==3&&(this.readyState=3,this.onclose?.(e))},this.readyState=1,t.onWin?.(e.via),this.onopen?.(n)}send(e){if(this.readyState!==1||!this.winner)throw Error(`not open`);this.winner.s.send(e)}close(e,t){if(this.readyState===3)return;let n=this.readyState===1;this.readyState=3;for(let e of this.waiting.splice(0))clearTimeout(e.timer);let r=this.winner?[this.winner,...this.live]:this.live.splice(0);for(let n of r){n.s.onopen=n.s.onclose=n.s.onmessage=n.s.onerror=null;try{n.s.close(e,t)}catch{}}let i=this.onclose;if(i){let r={type:`close`,code:e??1e3,reason:t??``,wasClean:n};setTimeout(()=>i(r),0)}}end(e){if(this.readyState===3)return;this.readyState=3;let t=this.onclose,n=e??{type:`close`,code:1006,reason:``,wasClean:!1};t&&setTimeout(()=>t(n),0)}}return n=o,n.CONNECTING=0,n.OPEN=1,n.CLOSING=2,n.CLOSED=3,o}fs();var wl=new URLSearchParams(location.hash.slice(1)),Tl=wl.get(`n`)?.trim()||null,El=nt(location.hash);El&&ml(El);var Dl=(0,x.createRoot)(document.getElementById(`root`));if(El){let e=gl(El,{video:!0,log:e=>console.info(`[join] ${e}`)}),t=Re(location.hash,`join`);Dl.render((0,z.jsx)(Xc,{url:tl(El.hub),invite:El.key,host:Tl,transport:e,lanUrl:t?ze(t,{key:El.key}):null}))}else{let e=wl.get(`i`)||null,t=location.pathname.replace(/\/join\/?$/,``),n=`${location.protocol===`https:`?`wss`:`ws`}://${location.host}${t}/api/join/ws`,r=e=>console.info(`[join] ${e}`),i=`${location.origin}${t}/join`,a=typeof RTCPeerConnection>`u`?void 0:Cl(()=>yl({net:null,lan:i,ts:null,fp:tt(wl.get(`fp`)),rtc:!0,reach:e=>e,rtcMake:(e,t)=>gl(e,{video:!0,log:r,...t}),socket:e=>new WebSocket(e)}),{room:i,log:r});Dl.render((0,z.jsx)(Xc,{url:n,invite:e,host:Tl,path:$c(location.hostname),transport:a,internet:!1}))} diff --git a/engine/crates/ps5upload-engine/src/lib.rs b/engine/crates/ps5upload-engine/src/lib.rs index c337c8dc9..e18e3d28e 100644 --- a/engine/crates/ps5upload-engine/src/lib.rs +++ b/engine/crates/ps5upload-engine/src/lib.rs @@ -518,6 +518,14 @@ fn job_failed_from_err(started_at_ms: u64, completed_at_ms: u64, err: &anyhow::E }; } let (reason, detail) = extract_payload_error(err); + // A cancel is a state of its own, said as `error_reason: "cancelled"` however the error that + // carried it is worded: a transfer's `transfer_cancelled` wrapped in context ("uploading x: + // transfer_cancelled") ended as a failure, so a paused queue item was held as failed. + let reason = if err.chain().any(|c| c.to_string() == "transfer_cancelled") { + Some(CANCELLED_REASON.to_string()) + } else { + reason + }; // Central choke point for ALL async transfer-job failures (file, dir, // reconcile, download). Logging here means a mid-transfer death — the // "upload failed halfway through" case — shows the engine's full error @@ -1828,6 +1836,18 @@ fn signal_transfer_cancel(job_id: Uuid) -> bool { } } +/// The `error_reason` of a job that was stopped rather than failed: the one way a job's end says +/// "cancelled" ([`stopped_reason`], [`job_failed_from_err`]). Readers (the queue, Tasks) take it, +/// and the older words beside it ([`is_cancelled_end`]). +pub(crate) const CANCELLED_REASON: &str = "cancelled"; + +/// Whether a failed job's snapshot fields say it was stopped: its `error_reason` (the typed +/// answer), or, from a job recorded before that was set, its `error` as the transfer words it. +pub(crate) fn is_cancelled_end(error_reason: Option<&str>, error: Option<&str>) -> bool { + matches!(error_reason, Some(CANCELLED_REASON | "transfer_cancelled")) + || matches!(error, Some("transfer_cancelled" | "cancelled")) +} + /// Jobs a Stop was sent to and that have not ended yet: their failure is a stop, said on the wire /// as `error_reason: "cancelled"` ([`stopped_reason`]). fn stopped_jobs() -> &'static Mutex> { @@ -1849,7 +1869,7 @@ fn stopped_reason(job_id: Uuid, state: &mut JobState) { .remove(&job_id); if let JobState::Failed { error_reason, .. } = state { if stopped && error_reason.is_none() { - *error_reason = Some("cancelled".into()); + *error_reason = Some(CANCELLED_REASON.into()); } } } @@ -4236,9 +4256,9 @@ async fn ps5_smp_meta_stats_route( } } -/// "Console Storage" aggregate. Same shape PS5 Settings shows: total -/// across `/user effective + /system_data + /system_ex`, free across -/// the same set, plus the per-partition breakdown for diagnostics. +/// The internal drive as its filesystem counts it (`statfs` on `/user`, `/system_data` and +/// `/system_ex`), with each partition. Not the PS5's Settings > Storage figures: that screen +/// can show less free space (see `HwStorage`). async fn ps5_hw_storage( State(state): State, Query(q): Query, @@ -16356,6 +16376,36 @@ mod helpers_tests { } } + /// A cancel wrapped in context is still a cancel: typed as `error_reason: "cancelled"`, the + /// raw chain kept. + #[test] + fn a_cancel_however_worded_is_a_cancel() { + let e = anyhow::anyhow!("transfer_cancelled") + .context("uploading Game/eboot.bin") + .context("the upload stopped"); + match job_failed_from_err(0, 1, &e) { + JobState::Failed { + error, + error_reason, + .. + } => { + assert_eq!(error_reason.as_deref(), Some(CANCELLED_REASON)); + assert!(error.ends_with("transfer_cancelled"), "{error}"); + assert!(is_cancelled_end(error_reason.as_deref(), Some(&error))); + } + _ => panic!("expected Failed state"), + } + // A failure that only mentions the word is not one. + let e = anyhow::anyhow!("the server said: transfer_cancelled_by_peer is unknown"); + match job_failed_from_err(0, 1, &e) { + JobState::Failed { error_reason, .. } => assert_eq!(error_reason, None), + _ => panic!("expected Failed state"), + } + assert!(!is_cancelled_end(None, Some("uploading x: failed"))); + assert!(is_cancelled_end(Some("transfer_cancelled"), None)); + assert!(is_cancelled_end(None, Some("cancelled"))); + } + #[test] fn job_failed_from_err_with_plain_error_leaves_structured_fields_none() { let e = anyhow::anyhow!("network blip mid-transfer"); diff --git a/engine/crates/ps5upload-engine/src/mcp/tools/hw.rs b/engine/crates/ps5upload-engine/src/mcp/tools/hw.rs index 839cb8efb..dccf36a27 100644 --- a/engine/crates/ps5upload-engine/src/mcp/tools/hw.rs +++ b/engine/crates/ps5upload-engine/src/mcp/tools/hw.rs @@ -45,9 +45,10 @@ pub(super) fn tools() -> Vec { ToolDef { name: "hw_storage", title: "Console storage", - description: "A console's internal storage as PS5 Settings counts it: total, free and \ - used bytes, with each partition. External drives are listed by the API's \ - /api/ps5/volumes.", + description: "A console's internal storage as its filesystem counts it: total, free, \ + used and held-back bytes, with each partition. The PS5's own Settings > \ + Storage screen can show less free space than user_free_bytes. External \ + drives are listed by the API's /api/ps5/volumes.", kind: Kind::Read, schema: object(json!({ "console": console_optional() }), &[]), run: |ctx, args| Box::pin(storage(ctx, args)), diff --git a/engine/crates/ps5upload-engine/src/mesh_api.rs b/engine/crates/ps5upload-engine/src/mesh_api.rs index 2cf2e136f..b65df5aa9 100644 --- a/engine/crates/ps5upload-engine/src/mesh_api.rs +++ b/engine/crates/ps5upload-engine/src/mesh_api.rs @@ -170,7 +170,26 @@ fn default_name() -> String { } fn name() -> String { - saved_name().unwrap_or_else(default_name) + mesh_name(&saved_name().unwrap_or_else(default_name)) +} + +/// The most a console keeps of a device name, in bytes (the helper's 64-byte field, `mesh.c`). +const NAME_BYTES: usize = 63; + +/// A device name as every console keeps it: a control character is a space, and it is cut to +/// [`NAME_BYTES`] on a character boundary, as the helper cuts it (`clean_field`). A longer one +/// used to be dropped whole by the helper, so the consoles went on showing the old name, while +/// this engine wrote the new one into its drives. +pub(crate) fn mesh_name(s: &str) -> String { + let s: String = s + .chars() + .map(|c| if c < ' ' || c == '\u{7f}' { ' ' } else { c }) + .collect(); + let mut end = s.len().min(NAME_BYTES); + while !s.is_char_boundary(end) { + end -= 1; + } + s[..end].to_string() } /// This device's name, as the consoles list it. @@ -274,7 +293,8 @@ pub struct MeSet { } pub async fn me_set(Json(req): Json) -> Response { - let n: String = req.name.trim().chars().take(60).collect(); + // Kept as the consoles will keep it, so this device shows the name they show. + let n = mesh_name(req.name.trim()); let r = tokio::task::spawn_blocking(move || -> anyhow::Result { let path = me_path().ok_or_else(|| anyhow::anyhow!("no data directory"))?; if n.is_empty() { @@ -360,6 +380,22 @@ struct NotedJob { host: String, kind: &'static str, title: String, + /// When it was noted: the job is not in the job map until its planning is done (a stat of + /// every file for a big list), and is not forgotten for that meanwhile. + at: Instant, +} + +/// How long a noted transfer may take to show up in the job map before it counts as one that +/// never started. +const NOTED_PLANNING: Duration = Duration::from_secs(600); + +/// Whether a noted job stays: running, or not in the map yet and still within its planning time. +fn noted_stays(state: Option<&crate::JobState>, noted_at: Instant, now: Instant) -> bool { + match state { + Some(crate::JobState::Running { .. }) => true, + Some(_) => false, + None => now.saturating_duration_since(noted_at) < NOTED_PLANNING, + } } fn noted_jobs() -> &'static Mutex> { @@ -387,6 +423,7 @@ pub(crate) fn note_job(job: uuid::Uuid, addr: &str, kind: &'static str, dest: &s host: ps5upload_core::events::console_host(addr), kind, title, + at: Instant::now(), }, ); } @@ -413,7 +450,8 @@ fn engine_job_items(addr: &str) -> Vec { let host = ps5upload_core::events::console_host(addr); let jobs = jobs.lock().unwrap_or_else(|e| e.into_inner()); let mut noted = noted_jobs().lock().unwrap_or_else(|e| e.into_inner()); - noted.retain(|id, _| matches!(jobs.get(id), Some(crate::JobState::Running { .. }))); + let now = Instant::now(); + noted.retain(|id, n| noted_stays(jobs.get(id), n.at, now)); noted .iter() .filter(|(_, n)| n.host == host) @@ -643,9 +681,11 @@ pub async fn device(Json(req): Json) -> Response { let Some(addr) = crate::required_console_addr(req.addr) else { return crate::missing_console_addr(); }; + // A new name, cut as the console keeps it. + let name = req.name.as_deref().map(mesh_name); answer(move || { let r = call(&addr, || { - mesh::device(&addr, &req.op, &req.id, req.name.as_deref()) + mesh::device(&addr, &req.op, &req.id, name.as_deref()) })?; Ok(with_supported(r)) }) @@ -788,6 +828,26 @@ mod tests { .contains("\"H\"")); } + /// A transfer is noted before its job is in the map (it plans first: a stat of every file of + /// a big list). A look at the presence meanwhile forgot it for good, so it was never shown. + #[test] + fn a_noted_transfer_still_planning_is_not_forgotten() { + let t = Instant::now(); + assert!(noted_stays(None, t, t + Duration::from_secs(30))); + assert!(!noted_stays(None, t, t + NOTED_PLANNING)); + let failed = crate::JobState::Failed { + started_at_ms: 0, + completed_at_ms: 0, + elapsed_ms: 0, + error: "x".into(), + error_reason: None, + error_detail: None, + error_console: None, + error_space: None, + }; + assert!(!noted_stays(Some(&failed), t, t)); + } + #[test] fn a_noted_transfer_shows_when_no_window_is_left_and_only_then() { let addr = "192.0.2.77"; @@ -859,6 +919,21 @@ mod tests { assert!(!v.as_array().unwrap().is_empty()); } + /// Cut where the helper cuts it (payload/tests/mesh_selftest.c checks the same names there): + /// at most 63 bytes, never inside a character, control characters as spaces. + #[test] + fn a_device_name_is_cut_as_the_console_cuts_it() { + assert_eq!(mesh_name("Gaming PC"), "Gaming PC"); + assert_eq!(mesh_name(&"x".repeat(300)), "x".repeat(63)); + // 35 two-byte letters: 31 fit (62 bytes), the 32nd would be cut in half. + assert_eq!(mesh_name(&"é".repeat(35)), "é".repeat(31)); + // A four-byte character over the edge goes whole. + let s = format!("{}😀", "a".repeat(61)); + assert_eq!(mesh_name(&s), "a".repeat(61)); + assert_eq!(mesh_name("tab\there\u{7f}"), "tab here "); + assert!(mesh_name(&"ü".repeat(100)).len() <= NAME_BYTES); + } + #[test] fn an_older_helper_reads_as_unsupported() { assert_eq!(with_supported(None), json!({"supported": false})); diff --git a/engine/crates/ps5upload-engine/src/mesh_drive.rs b/engine/crates/ps5upload-engine/src/mesh_drive.rs index ff7598fcf..9d58f4400 100644 --- a/engine/crates/ps5upload-engine/src/mesh_drive.rs +++ b/engine/crates/ps5upload-engine/src/mesh_drive.rs @@ -24,6 +24,8 @@ //! * `POST /api/drive/approve` `{addr,drive,member,approve}` (kept for 8.0.0 apps) //! * `POST /api/drive/leave` `{addr,drive,member}` (any member, e.g. a device long gone) //! * `POST /api/drive/delete` `{addr,drive}` (the drive goes; files stay) +//! Both answer `later` (and a `note`) when the console did not answer: this device's own folder +//! stopped syncing anyway, and the console is told once it answers. //! * `POST /api/drive/pause` `{addr,drive,member,paused}` //! * `POST /api/drive/sync` `{addr,drive}` (a pass now) //! * `POST /api/drive/confirm` `{addr,drive,member}` (let a held-back mass delete run) @@ -237,11 +239,58 @@ fn new_id() -> String { b.iter().map(|x| format!("{x:02x}")).collect() } +/// The helper refused with `token` (`{"ok":false,"err":token}`, or the bare token). +fn helper_refused(e: &anyhow::Error, token: &str) -> bool { + e.chain() + .filter_map(|c| c.downcast_ref::()) + .any(|m| { + m.cause == token + || serde_json::from_str::(&m.cause) + .is_ok_and(|v| v.get("err").and_then(Value::as_str) == Some(token)) + }) +} + +/// The console answered, but its drive list could not be read (by the console, or by this +/// version): not "away", and not "no drives". Nothing is written or forgotten from it. +fn list_unreadable(e: &anyhow::Error) -> bool { + matches!( + Said::of(e).code.as_str(), + "list_unreadable" | "console_list_unreadable" + ) +} + /// `{rev, doc}` from the console; None for a helper without documents. fn doc_read(addr: &str) -> Result> { - let Some(v) = crate::mesh_api::call(addr, || mesh::doc_get(addr, "drives"))? else { - return Ok(None); + drive_doc_of(crate::mesh_api::call(addr, || { + mesh::doc_get(addr, "drives") + })) +} + +/// [`doc_read`] from the helper's answer. +fn drive_doc_of(answer: Result>) -> Result> { + let unreadable = || { + said_err( + "console_list_unreadable", + &[], + "the console could not read its drive list; nothing changes until it can", + ) + }; + let v = match answer { + Ok(Some(v)) => v, + Ok(None) => return Ok(None), + // A helper that could not read the file says so (an older one answered `doc: null`, as + // for a console that never had a drive: the two cannot be told apart from here). + Err(e) if helper_refused(&e, "doc_unreadable") => return Err(unreadable()), + Err(e) => return Err(e), }; + // A refusal that reached here as an answer is never a list (it has no `doc`: none). + if v.get("ok").and_then(Value::as_bool) == Some(false) { + let err = v.get("err").and_then(Value::as_str).unwrap_or("refused"); + if err == "doc_unreadable" { + return Err(unreadable()); + } + bail!("the console refused to read its drive list: {err}"); + } let rev = v.get("rev").and_then(Value::as_u64).unwrap_or(0); // A list this version cannot read is never taken as empty: writing it back would drop every // drive in it. @@ -283,6 +332,41 @@ fn doc_update(addr: &str, mut f: impl FnMut(&mut DriveDoc) -> Result) -> R struct LocalConfig { #[serde(default)] members: Vec, + /// What this device did while the console did not answer, done there once it does. + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pending: Vec, +} + +/// A folder of this device that left its drive (`member`), or the drive deleted (no member), +/// while its console did not answer: this device stopped syncing it then; the console is told +/// when it answers again. +#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] +struct Pending { + console: String, + drive: String, + #[serde(default, skip_serializing_if = "Option::is_none")] + member: Option, + #[serde(default)] + since: u64, +} + +/// At most this many are kept (the oldest go first): a console gone for good is never told. +const PENDING_MAX: usize = 200; + +fn add_pending(console: &str, drive: &str, member: Option<&str>) -> Result<()> { + edit_config(|c| { + let p = Pending { + console: console.to_string(), + drive: drive.to_string(), + member: member.map(str::to_string), + since: now_ms(), + }; + c.pending + .retain(|x| !(x.console == p.console && x.drive == p.drive && x.member == p.member)); + c.pending.push(p); + let over = c.pending.len().saturating_sub(PENDING_MAX); + c.pending.drain(..over); + }) } #[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] @@ -304,7 +388,20 @@ struct LocalMember { paused: bool, } +#[cfg(test)] +thread_local! { + /// A test's own folder for this engine's Mesh Drive files (never the user's). + static TEST_STATE_DIR: std::cell::RefCell> = + const { std::cell::RefCell::new(None) }; +} + fn state_dir() -> Option { + #[cfg(test)] + { + if let Some(d) = TEST_STATE_DIR.with(|d| d.borrow().clone()) { + return Some(d); + } + } Some(crate::remote::store::data_dir()?.join("mesh-drive")) } @@ -624,8 +721,8 @@ fn confirm_away(addr: &str, e: &anyhow::Error) -> Option { return Some(w); } match doc_read(addr) { - Err(e2) => Some(away_why(&e2).unwrap_or(AwayWhy::Unreachable)), - Ok(_) => None, + Err(e2) if !list_unreadable(&e2) => Some(away_why(&e2).unwrap_or(AwayWhy::Unreachable)), + _ => None, } } @@ -1220,7 +1317,8 @@ struct Pass<'a> { /// /// A linked console holds what its partner held, so a file of the size agreed on counts as agreed /// on. That is a guess (the two consoles' times cannot be compared), so this first pass deletes -/// nothing and what it replaces there goes to the trash. A file of another size changed there. +/// nothing, what it replaces there goes to the trash, and a file of another size there (changed +/// there, or never given the home console's last edit) is a conflict here: both are kept. fn seed_via_base(home: &Base, via_hub: &Listing) -> Base { home.iter() .filter_map(|(path, agreed)| { @@ -1370,19 +1468,48 @@ fn is_os_clutter(name: &str) -> bool { name == ".DS_Store" || name == "Thumbs.db" || name == "desktop.ini" || name.starts_with("._") } +/// The first name in a folder that is not clutter (so the folder stays), reading it page by page +/// with `list(offset)` (names, whether more follow) to its end. The first page alone is not the +/// folder: the helper lists in disk order, and eight `._` files from a Mac could come before the +/// files of the drive, which then went to the trash with the folder. +fn first_kept_name( + mut list: impl FnMut(u64) -> Result<(Vec, bool)>, +) -> Result> { + let mut offset = 0u64; + loop { + let (names, truncated) = list(offset)?; + let n = names.len() as u64; + if let Some(name) = names + .into_iter() + .find(|n| n != "." && n != ".." && !is_os_clutter(n)) + { + return Ok(Some(name)); + } + if n == 0 || (n < 256 && !truncated) { + return Ok(None); + } + offset += n; + } +} + /// A console folder of the drive that nothing is left in goes to the trash (moved, never /// deleted: anything written into it meanwhile is still there). fn prune_console_dir(addr: &str, root: &str, rel: &str, today: &str) -> bool { let dir = join_hub(root, rel); - let l = match fs_ops::list_dir( - addr, - &dir, - ListDirOptions { - offset: 0, - limit: 8, - }, - ) { - Ok(l) => l, + let kept = first_kept_name(|offset| { + let l = fs_ops::list_dir(addr, &dir, ListDirOptions { offset, limit: 256 })?; + Ok((l.entries.into_iter().map(|e| e.name).collect(), l.truncated)) + }); + match kept { + Ok(None) => {} + Ok(Some(name)) => { + crate::log_at!( + Info, + "mesh", + "mesh drive: kept {dir}: it still holds {name}" + ); + return false; + } Err(e) => { crate::log_at!( Info, @@ -1391,19 +1518,6 @@ fn prune_console_dir(addr: &str, root: &str, rel: &str, today: &str) -> bool { ); return false; } - }; - if let Some(e) = l - .entries - .iter() - .find(|e| e.name != "." && e.name != ".." && !is_os_clutter(&e.name)) - { - crate::log_at!( - Info, - "mesh", - "mesh drive: kept {dir}: it still holds {}", - e.name - ); - return false; } let day = join_hub(&join_hub(root, TRASH), today); let to = join_hub( @@ -1481,11 +1595,17 @@ trait Side { /// other side leaves its files' folders behind here otherwise). False when it holds anything. fn prune(&self, rel: &str, today: &str) -> bool; fn empty_trash(&self, cutoff: &str); - /// What this side and the hub last agreed on. Empty only when there is none yet: a base that - /// cannot be read is an error (a pass against an empty one would hash everything and bring - /// deleted files back). - fn load_base(&self, drive: &str, member: &str) -> Result; + /// What this side and the hub last agreed on, None when there is none yet: a base that cannot + /// be read is an error (a pass against an empty one would hash everything and bring deleted + /// files back). + fn load_base(&self, drive: &str, member: &str) -> Result>; fn save_base(&self, drive: &str, member: &str, base: &Base) -> Result<()>; + /// The record older versions kept here: one per console folder, written by every link whose + /// second end this console is (so with two such links, what either link agreed on). Only + /// read while this member has no base of its own (see [`carried_over`]). + fn legacy_base(&self) -> Result> { + Ok(None) + } /// Whether a just-written file waits a pass (times come from this computer's clock). fn settles(&self) -> bool; /// A name this side cannot hold. @@ -1674,8 +1794,8 @@ impl Side for LocalSide { } } } - fn load_base(&self, drive: &str, member: &str) -> Result { - Ok(load_base(drive, &self.base_key(member))) + fn load_base(&self, drive: &str, member: &str) -> Result> { + Ok(Some(load_base(drive, &self.base_key(member)))) } fn save_base(&self, drive: &str, member: &str, base: &Base) -> Result<()> { save_base(drive, &self.base_key(member), base) @@ -1719,6 +1839,52 @@ impl ConsoleSide { fn path(&self, rel: &str) -> String { join_hub(&self.root, rel) } + + fn parse_record(&self, bytes: &[u8]) -> Result { + serde_json::from_slice(bytes).map_err(|e| { + said_err( + "link_record_damaged", + &[("console", &self.addr)], + format!("the link's record on {} is damaged: {e}", self.addr), + ) + }) + } +} + +/// The file (in the trash folder of the link's second console) that holds what one link agreed +/// on, named after the link (`link_member_id`, which names both its consoles). One path component +/// whatever the addresses hold: every byte but a letter, digit, `.` or `-` is written `_xx`, so +/// two links never share a name; a name too long for a file system is a hash of the link. +fn link_base_name(member: &str) -> String { + let mut s = String::from("link-base-"); + for b in member.bytes() { + if b.is_ascii_alphanumeric() || b == b'.' || b == b'-' { + s.push(b as char); + } else { + s.push_str(&format!("_{b:02x}")); + } + } + if s.len() > 200 { + let h = blake3::hash(member.as_bytes()).to_hex(); + return format!("link-base-{}.json", &h[..32]); + } + s.push_str(".json"); + s +} + +/// What a link starts from the first time it runs on this version, when the second console holds +/// only the shared record of an older one ([`Side::legacy_base`]). That record may be another +/// link's (it names no link), so only what it surely says of this one is kept: a file both +/// consoles have, the link's first console (`hub`) holding it exactly as the record has it (the +/// record's other side is the second console, the same for every link it served). All else +/// starts as never agreed on: a file on one side only is copied to the other (a delete is never +/// taken from it), and one on both that differs is compared (a conflict keeps both). Nothing is +/// lost on the way. +fn carried_over(old: &Base, side: &Listing, hub: &Listing) -> Base { + old.iter() + .filter(|(path, agreed)| side.contains_key(*path) && hub.get(*path) == Some(&agreed.h)) + .map(|(path, agreed)| (path.clone(), *agreed)) + .collect() } thread_local! { @@ -1968,25 +2134,16 @@ impl Side for ConsoleSide { fn empty_trash(&self, cutoff: &str) { empty_console_trash(&self.addr, &self.root, cutoff); } - fn load_base(&self, _drive: &str, _member: &str) -> Result { - let path = join_hub(&join_hub(&self.root, TRASH), LINK_BASE); - let bytes = match read_console_file(&self.addr, &path)? { - Some(b) => b, - // Where 8.1.0 kept it (in the folder itself, which an 8.0 engine syncs as a file). - None => match read_console_file(&self.addr, &self.path(BASE_FILE))? { - Some(b) => b, - None => return Ok(Base::new()), - }, - }; - serde_json::from_slice(&bytes).map_err(|e| { - said_err( - "link_record_damaged", - &[("console", &self.addr)], - format!("the link's record on {} is damaged: {e}", self.addr), - ) - }) + /// The link's own record: one file per link (`link_base_name`), so two links that end on this + /// console never start from what the other agreed on. + fn load_base(&self, _drive: &str, member: &str) -> Result> { + let path = join_hub(&join_hub(&self.root, TRASH), &link_base_name(member)); + match read_console_file(&self.addr, &path)? { + Some(b) => self.parse_record(&b).map(Some), + None => Ok(None), + } } - fn save_base(&self, _drive: &str, _member: &str, base: &Base) -> Result<()> { + fn save_base(&self, _drive: &str, member: &str, base: &Base) -> Result<()> { let body = serde_json::to_vec(base)?; if body.len() > CONSOLE_BASE_MAX { return Err(said_err( @@ -1997,16 +2154,28 @@ impl Side for ConsoleSide { } let dir = join_hub(&self.root, TRASH); fs_ops::fs_mkdir(&self.addr, &dir)?; - // Written whole or not at all (the write commits once). + // Written whole or not at all (the write commits once). The shared record of older + // versions stays: another link ending here may not have read it yet. ps5upload_core::diagnostics::fs_write_bytes_large( &self.addr, - &join_hub(&dir, LINK_BASE), + &join_hub(&dir, &link_base_name(member)), &body, false, )?; - let _ = fs_ops::fs_delete(&self.addr, &self.path(BASE_FILE)); Ok(()) } + fn legacy_base(&self) -> Result> { + let path = join_hub(&join_hub(&self.root, TRASH), LINK_BASE); + let bytes = match read_console_file(&self.addr, &path)? { + Some(b) => b, + // Where 8.1.0 kept it (in the folder itself, which an 8.0 engine syncs as a file). + None => match read_console_file(&self.addr, &self.path(BASE_FILE))? { + Some(b) => b, + None => return Ok(None), + }, + }; + self.parse_record(&bytes).map(Some) + } fn settles(&self) -> bool { false } @@ -2207,7 +2376,14 @@ impl Pass<'_> { }; let mut base = match &self.seed { Some(home) => seed_via_base(home, &hub), - None => self.side.load_base(&self.drive.id, member_id)?, + None => match self.side.load_base(&self.drive.id, member_id)? { + Some(b) => b, + // Read once: the pass saves a base of this member's own. + None => self + .side + .legacy_base()? + .map_or_else(Base::new, |old| carried_over(&old, &member, &hub)), + }, }; let now = now_ms() as i64 / 1000; // Still being written: leave it for the next pass (and do not take its absence as a delete). @@ -2250,9 +2426,20 @@ impl Pass<'_> { }); skipped.extend(unread.iter().cloned()); let mut held = 0; - // The first pass through a linked console deletes nothing there (its base is a guess). + // The first pass through a linked console deletes nothing there (its base is a guess), + // and never puts that console's copy over a file here: which of the two is newer is not + // known (the home console may have had an edit, this folder got it and the linked console + // did not, before it went away), so both are kept, as a conflict. (It used to come over + // with nothing kept, and the older copy then went on to the home console too.) if self.seed.is_some() { ops.retain(|o| !matches!(o, Op::DeleteHub(_))); + for o in ops.iter_mut() { + if let Op::Download(p) = o { + if member.contains_key(p.as_str()) { + *o = Op::Conflict(p.clone()); + } + } + } } let mut held_paths = Vec::new(); // A confirmation covers the deletes it was given for: used up once a pass got through them. @@ -2783,8 +2970,10 @@ fn sync_member(lm: &LocalMember, me: &str) -> Result<()> { // Its own console is away: a linked console holds the same drive (after a second miss // in a row: one dropped read is not "away"). Err(e) => { - let said = Said::of(&e); - if away_why(&e).is_none() && said.code == "list_unreadable" { + // It answered, but its list could not be read: this folder stays as it is (never + // taken as "the drive is gone"), and says why. + if away_why(&e).is_none() && list_unreadable(&e) { + let said = Said::of(&e); set_status(&lm.member, |s| { s.state = "error".into(); s.say(said); @@ -2897,6 +3086,8 @@ fn failover(lm: &LocalMember, running: &RunningPass) -> Result<()> { let doc = match doc_read(b) { Ok(Some((_, doc))) => doc, Ok(None) => continue, + // It answers, but its list cannot be read: not away, and not a way through either. + Err(e) if list_unreadable(&e) => continue, Err(e) => { mark_away(b, away_why(&e).unwrap_or(AwayWhy::Unreachable)); continue; @@ -2995,6 +3186,7 @@ fn sync_links(me: &str) { let doc = match doc_read(&a) { Ok(Some((_, doc))) => doc, Ok(None) => continue, + Err(e) if list_unreadable(&e) => continue, Err(e) => { mark_away(&a, away_why(&e).unwrap_or(AwayWhy::Unreachable)); continue; @@ -3043,13 +3235,17 @@ fn newer_password<'a>( } } -fn link_member_id(drive: &str, hi: &str) -> String { - format!("link:{drive}:{hi}") +/// A link's id, for its base, its status and what the engine remembers of it between passes. It +/// names both consoles: two links ending on the same console are two members (older versions +/// named the second console only, so a third console's link started from what the other link had +/// agreed on and trashed what that link had just brought in, every round). +fn link_member_id(drive: &str, lo: &str, hi: &str) -> String { + format!("link:{drive}:{lo}:{hi}") } /// One pass between the drive's home folders on `lo` and `hi`. fn run_link(id: &str, lo: &str, hi: &str) -> Result<()> { - let member_id = link_member_id(id, hi); + let member_id = link_member_id(id, lo, hi); let running = begin_pass(&member_id); // Either end away: the link waits (its state says so on the end that answers). for (end, other) in [(lo, hi), (hi, lo)] { @@ -3061,6 +3257,11 @@ fn run_link(id: &str, lo: &str, hi: &str) -> Result<()> { let dlo = match doc_read(lo) { Ok(Some((_, d))) => d, Ok(None) => return Ok(()), + // It answers, but its list cannot be read: the link waits, and says why. + Err(e) if list_unreadable(&e) => { + set_link_state(hi, id, lo, "error", &Said::of(&e), false, None); + return Ok(()); + } Err(e) => { mark_away(lo, away_why(&e).unwrap_or(AwayWhy::Unreachable)); set_link_state(hi, id, lo, "offline", &Said::default(), false, None); @@ -3073,6 +3274,10 @@ fn run_link(id: &str, lo: &str, hi: &str) -> Result<()> { let dhi = match doc_read(hi) { Ok(Some((_, d))) => d, Ok(None) => return Ok(()), + Err(e) if list_unreadable(&e) => { + set_link_state(lo, id, hi, "error", &Said::of(&e), false, None); + return Ok(()); + } Err(e) => { mark_away(hi, away_why(&e).unwrap_or(AwayWhy::Unreachable)); set_link_state(lo, id, hi, "offline", &Said::default(), false, None); @@ -3448,8 +3653,12 @@ pub fn tick() { let Some(me) = crate::mesh_api::id_hex() else { return; }; + let config = load_config(); + if !config.pending.is_empty() { + start_worker("pending".into(), finish_pending); + } let mut by_console: BTreeMap> = BTreeMap::new(); - for lm in load_config().members { + for lm in config.members { by_console.entry(lm.console.clone()).or_default().push(lm); } if by_console.is_empty() { @@ -4055,6 +4264,9 @@ fn add_local(addr: &str, drive: &str, member: &str, path: &str, name: &str) -> R } c.members .retain(|m| !(m.drive == drive && (m.member == member || m.path == path))); + // Joined again: a delete of the drive there that the console never heard of is off. + c.pending + .retain(|p| !(p.console == addr && p.drive == drive && p.member.is_none())); c.members.push(LocalMember { console: addr.to_string(), drive: drive.to_string(), @@ -4776,15 +4988,21 @@ pub async fn unlink(Json(req): Json) -> Response { kick(); return Ok(json!({ "supported": true, "ok": true })); } - stop_pass(&link_member_id(&req.drive, link_ends(&addr, &other).1)); + let (lo, hi) = link_ends(&addr, &other); + let member_id = link_member_id(&req.drive, lo, hi); + stop_pass(&member_id); drop_link(&addr, &req.drive, &other); drop_link(&other, &req.drive, &addr); // The link's base lives in the second console's folder (link_ends): it means nothing now. - if let Ok(Some((_, doc))) = doc_read(link_ends(&addr, &other).1) { + if let Ok(Some((_, doc))) = doc_read(hi) { if let Some(d) = doc.drives.iter().find(|d| d.id == req.drive) { - let hi = link_ends(&addr, &other).1; - let _ = fs_ops::fs_delete(hi, &join_hub(&d.hub, BASE_FILE)); - let _ = fs_ops::fs_delete(hi, &join_hub(&join_hub(&d.hub, TRASH), LINK_BASE)); + let trash = join_hub(&d.hub, TRASH); + let _ = fs_ops::fs_delete(hi, &join_hub(&trash, &link_base_name(&member_id))); + // The shared record of older versions, once no other link ends there. + if d.links.is_empty() { + let _ = fs_ops::fs_delete(hi, &join_hub(&d.hub, BASE_FILE)); + let _ = fs_ops::fs_delete(hi, &join_hub(&trash, LINK_BASE)); + } } } Ok(json!({ "supported": true, "ok": true })) @@ -5020,61 +5238,218 @@ pub async fn approve(Json(req): Json) -> Response { .await } +/// Takes a folder out of the drive. When the console does not answer, this device's own folder +/// stops syncing anyway (its files stay) and the console drops it once it answers: the answer +/// then has `later`, and a `note` saying so. pub async fn leave(Json(req): Json) -> Response { answer(move || { - let addr = addr_of(req.addr)?; - let member = req - .member - .clone() - .ok_or_else(|| refuse(StatusCode::BAD_REQUEST, "which member?"))?; - let r = doc_update(&addr, |doc| { - if let Some(d) = doc.drives.iter_mut().find(|d| d.id == req.drive) { - d.members.retain(|m| m.id != member); + Ok(match leave_now(&req)? { + Gone::Done => json!({ "supported": true, "ok": true }), + Gone::Unsupported => unsupported(), + Gone::Later(note) => { + json!({ "supported": true, "ok": true, "later": true, "note": note }) } - Ok(()) - })?; - stop_pass(&member); - remove_local(&req.drive, Some(&member))?; - if r.is_none() { - return Ok(unsupported()); - } - Ok(json!({ "supported": true, "ok": true })) + }) }) .await } +/// How a leave or a delete went. +#[derive(Debug, PartialEq)] +enum Gone { + Done, + /// The helper predates the mesh. + Unsupported, + /// The console did not answer: done on this device, and there once it answers (the note + /// says so). + Later(String), +} + +fn told_later(console: &str, deleted: bool) -> Gone { + Gone::Later(if deleted { + format!( + "The drive is no longer kept on this device. {console} did not answer: the drive is \ + deleted there when it is back. No files are deleted." + ) + } else { + format!( + "This folder no longer syncs. {console} did not answer: the folder is removed from \ + the drive there when it is back. Its files stay where they are." + ) + }) +} + +fn leave_now(req: &MemberReq) -> Result { + let addr = addr_of(req.addr.clone())?; + let member = req + .member + .clone() + .ok_or_else(|| refuse(StatusCode::BAD_REQUEST, "which member?"))?; + let r = doc_update(&addr, |doc| { + if let Some(d) = doc.drives.iter_mut().find(|d| d.id == req.drive) { + d.members.retain(|m| m.id != member); + } + Ok(()) + }); + stop_pass(&member); + let r = match r { + Ok(r) => r, + // The console did not answer (it may never again), or could not read its list: this + // device's own folder stops syncing anyway, its files staying where they are, and the + // console drops it once it answers. (This used to fail, and a folder of a console gone + // for good could never be removed.) Another device's folder only its console can drop. + Err(e) => { + let Some(lm) = load_config() + .members + .into_iter() + .find(|m| m.drive == req.drive && m.member == member && m.console == addr) + else { + return Err(e); + }; + forget_local(&lm)?; + add_pending(&addr, &req.drive, Some(&member))?; + return Ok(told_later(&addr, false)); + } + }; + remove_local(&req.drive, Some(&member))?; + Ok(if r.is_none() { + Gone::Unsupported + } else { + Gone::Done + }) +} + +/// Deletes the drive (its files stay). When the console does not answer and this device keeps a +/// folder of it, that folder stops syncing and the console deletes the drive once it answers: +/// the answer then has `later`, and a `note` saying so. pub async fn delete(Json(req): Json) -> Response { answer(move || { - let addr = addr_of(req.addr)?; - let r = doc_update(&addr, |doc| { - let linked: Vec = doc - .drives - .iter() - .filter(|d| d.id == req.drive) - .flat_map(|d| d.links.iter().map(|l| l.console.clone())) - .collect(); - doc.drives.retain(|d| d.id != req.drive); - Ok(linked) - })?; - // Linked consoles keep their copy as a drive of their own circle; only the link goes. - for c in r.clone().unwrap_or_default() { - stop_pass(&link_member_id(&req.drive, link_ends(&addr, &c).1)); - drop_link(&c, &req.drive, &addr); - } - for m in load_config() - .members + Ok(match delete_now(&req)? { + Gone::Done => json!({ "supported": true, "ok": true }), + Gone::Unsupported => unsupported(), + Gone::Later(note) => { + json!({ "supported": true, "ok": true, "later": true, "note": note }) + } + }) + }) + .await +} + +fn delete_now(req: &MemberReq) -> Result { + let addr = addr_of(req.addr.clone())?; + let r = doc_update(&addr, |doc| { + let linked: Vec = doc + .drives .iter() - .filter(|m| m.drive == req.drive && m.console == addr) - { - stop_pass(&m.member); - } - remove_local_at(&req.drive, &addr)?; - if r.is_none() { - return Ok(unsupported()); + .filter(|d| d.id == req.drive) + .flat_map(|d| d.links.iter().map(|l| l.console.clone())) + .collect(); + doc.drives.retain(|d| d.id != req.drive); + Ok(linked) + }); + let mine: Vec = load_config() + .members + .into_iter() + .filter(|m| m.drive == req.drive && m.console == addr) + .collect(); + let (r, later) = match r { + Ok(r) => (r, false), + // The console did not answer: this device stops keeping the drive (its files stay), the + // consoles linked to it (as last read) drop the link now, and the console deletes the + // drive once it answers. Without a folder of it here there is nothing to do but wait. + Err(e) => { + if mine.is_empty() { + return Err(e); + } + let mut linked: Vec = mine.iter().flat_map(|m| m.links.clone()).collect(); + linked.sort(); + linked.dedup(); + add_pending(&addr, &req.drive, None)?; + (Some(linked), true) } - Ok(json!({ "supported": true, "ok": true })) + }; + // Linked consoles keep their copy as a drive of their own circle; only the link goes. + for c in r.clone().unwrap_or_default() { + let (lo, hi) = link_ends(&addr, &c); + stop_pass(&link_member_id(&req.drive, lo, hi)); + drop_link(&c, &req.drive, &addr); + } + for m in &mine { + stop_pass(&m.member); + } + remove_local_at(&req.drive, &addr)?; + Ok(if later { + told_later(&addr, true) + } else if r.is_none() { + Gone::Unsupported + } else { + Gone::Done }) - .await +} + +/// The console's side of `p`: the folder, or the whole drive, gone from its list. False when +/// there is nothing left to take out. +fn apply_pending(doc: &mut DriveDoc, p: &Pending) -> bool { + match &p.member { + Some(m) => doc + .drives + .iter_mut() + .find(|d| d.id == p.drive) + .is_some_and(|d| { + let before = d.members.len(); + d.members.retain(|x| x.id != *m); + d.members.len() != before + }), + None => { + let before = doc.drives.len(); + doc.drives.retain(|d| d.id != p.drive); + doc.drives.len() != before + } + } +} + +/// What this device did while a console did not answer, done there once it does. Kept for the +/// next round while the console still does not answer. +fn finish_pending() { + for p in load_config().pending { + if !worth_trying(&p.console) { + continue; + } + let done = match doc_read(&p.console) { + // A helper without the drive list: nothing there to take out. + Ok(None) => true, + Err(_) => false, + Ok(Some((_, doc))) => { + let linked: Vec = doc + .drives + .iter() + .filter(|d| d.id == p.drive && p.member.is_none()) + .flat_map(|d| d.links.iter().map(|l| l.console.clone())) + .collect(); + if !apply_pending(&mut doc.clone(), &p) { + true + } else if doc_update(&p.console, |d| Ok(apply_pending(d, &p))).is_ok() { + for c in linked { + let (lo, hi) = link_ends(&p.console, &c); + stop_pass(&link_member_id(&p.drive, lo, hi)); + drop_link(&c, &p.drive, &p.console); + } + true + } else { + false + } + } + }; + if done { + crate::log_at!( + Info, + "mesh", + "mesh drive {}: what this device did while its console was away is done there", + p.drive + ); + let _ = edit_config(|c| c.pending.retain(|x| *x != p)); + } + } } pub async fn pause(Json(req): Json) -> Response { @@ -5237,6 +5612,40 @@ mod tests { std::fs::remove_dir_all(&root).unwrap(); } + /// A console folder is read to its end before it counts as holding nothing: clutter on the + /// first page and a file of the drive on a later one keeps it. + #[test] + fn a_console_folder_is_read_to_its_end_before_it_is_pruned() { + let clutter: Vec = (0..256).map(|i| format!("._{i}")).collect(); + let pages = |offset: u64| -> Result<(Vec, bool)> { + Ok(match offset { + 0 => (clutter.clone(), true), + 256 => (vec![".DS_Store".into(), "save.dat".into()], false), + _ => (Vec::new(), false), + }) + }; + assert_eq!( + super::first_kept_name(pages).unwrap().as_deref(), + Some("save.dat") + ); + // Clutter only (the helper says more follow, then an empty page): nothing kept. + let only = |offset: u64| -> Result<(Vec, bool)> { + Ok(match offset { + 0 => (vec![".".into(), "..".into(), "Thumbs.db".into()], true), + _ => (Vec::new(), false), + }) + }; + assert_eq!(super::first_kept_name(only).unwrap(), None); + // A page that cannot be read keeps the folder (an error, never "empty"). + let broken = |offset: u64| -> Result<(Vec, bool)> { + match offset { + 0 => Ok((clutter.clone(), true)), + _ => Err(anyhow::anyhow!("gone")), + } + }; + assert!(super::first_kept_name(broken).is_err()); + } + #[test] fn an_away_console_is_tried_less_and_less_often() { let secs: Vec = (1..=7).map(|n| away_backoff(n).as_secs()).collect(); @@ -5290,7 +5699,10 @@ mod tests { struct MemStore { files: Mutex)>>, trashed: Mutex>, - base: Mutex>, + /// Each member's base kept here (a console holds one per link that ends on it). + bases: Mutex>, + /// The one shared record older versions kept here. + legacy: Mutex>, /// File times: each write is later than the last. clock: std::sync::atomic::AtomicI64, } @@ -5322,6 +5734,14 @@ mod tests { fn meta(&self, rel: &str) -> Option { self.files.lock().unwrap().get(rel).map(|f| f.0) } + fn files_now(&self) -> Listing { + self.files + .lock() + .unwrap() + .iter() + .map(|(k, v)| (k.clone(), v.0)) + .collect() + } } type AfterSend = Box; @@ -5420,13 +5840,20 @@ mod tests { true } fn empty_trash(&self, _cutoff: &str) {} - fn load_base(&self, _drive: &str, _member: &str) -> Result { - Ok(self.store.base.lock().unwrap().clone().unwrap_or_default()) + fn load_base(&self, _drive: &str, member: &str) -> Result> { + Ok(self.store.bases.lock().unwrap().get(member).cloned()) } - fn save_base(&self, _drive: &str, _member: &str, base: &Base) -> Result<()> { - *self.store.base.lock().unwrap() = Some(base.clone()); + fn save_base(&self, _drive: &str, member: &str, base: &Base) -> Result<()> { + self.store + .bases + .lock() + .unwrap() + .insert(member.to_string(), base.clone()); Ok(()) } + fn legacy_base(&self) -> Result> { + Ok(self.store.legacy.lock().unwrap().clone()) + } fn settles(&self) -> bool { false } @@ -5841,17 +6268,25 @@ mod tests { let (r, home) = rig_failed_over(); r.pass_from(Some(home)).unwrap(); let (side, hub) = (&r.side.store, &r.hub.store); - // Nothing renamed: no conflict copies from a base that was missing. - assert_eq!(r.status().conflicts, 0); - assert!(side.names().iter().all(|n| !n.contains("conflict"))); + // No conflict copies from a base that was missing: one only, for the file of another + // size there (which of the two is newer is not known). + assert_eq!(r.status().conflicts, 1); + let copies: Vec = side + .names() + .into_iter() + .filter(|n| n.contains("conflict")) + .collect(); + assert_eq!(copies.len(), 1, "{copies:?}"); + assert!(copies[0].starts_with("changed-there (conflict from ")); // A file deleted here does not come back, and is not deleted there on a guess. assert!(!side.has("deleted-here.txt")); assert!(hub.has("deleted-here.txt")); // An edit here goes up, and what it replaced there is kept in the trash. assert_eq!(hub.get("edited-here.txt").unwrap(), b"edited, longer"); assert_eq!(*hub.trashed.lock().unwrap(), ["edited-here.txt"]); - // A file of another size changed there: it comes here. + // A file of another size there comes here, and this folder's copy is kept beside it. assert_eq!(side.get("changed-there.txt").unwrap(), b"changed there"); + assert_eq!(side.get(&copies[0]).unwrap(), b"agreed"); // Unchanged stays; new goes up. assert_eq!(hub.get("new-here.txt").unwrap(), b"new"); assert_eq!(side.get("same.txt").unwrap(), b"agreed"); @@ -5875,6 +6310,72 @@ mod tests { assert!(r.hub.store.trashed.lock().unwrap().is_empty()); } + /// The home console had an edit, this folder got it, and the home console went away before + /// the linked console did. The first pass through the linked console keeps the newer file + /// here (a conflict copy) instead of putting the older one over it, and when the home console + /// is back the newer one reaches it too. + #[test] + fn failing_over_never_puts_an_older_copy_over_a_newer_file_here() { + let r = Rig::new(); + let home_hub = Arc::new(MemStore::default()); + home_hub.clock.store(500, Ordering::SeqCst); + home_hub.put("save.dat", b"newer save"); + r.side.store.put("save.dat", b"newer save"); + let home: Base = [( + "save.dat".to_string(), + BaseEntry { + m: r.side.store.meta("save.dat").unwrap(), + h: home_hub.meta("save.dat").unwrap(), + }, + )] + .into(); + r.hub.store.put("save.dat", b"old"); + r.pass_from(Some(home.clone())).unwrap(); + let side = &r.side.store; + let copies: Vec = side + .names() + .into_iter() + .filter(|n| n.contains("conflict")) + .collect(); + assert_eq!(copies.len(), 1, "{:?}", side.names()); + assert_eq!(side.get(&copies[0]).unwrap(), b"newer save"); + assert_eq!(side.get("save.dat").unwrap(), b"old"); + assert!(side.trashed.lock().unwrap().is_empty()); + // The copy reaches the linked console on the next pass. + r.look_again(); + r.pass().unwrap(); + assert_eq!(r.hub.store.get(&copies[0]).unwrap(), b"newer save"); + // The home console is back: the older file goes there as a change made here, and the + // newer one with it, as the copy. + let home_id = format!("{}-home", r.id); + side.bases.lock().unwrap().insert(home_id.clone(), home); + let back = MemSide { + store: side.clone(), + hub: home_hub.clone(), + ..Default::default() + }; + let home_side = MemSide { + store: home_hub.clone(), + ..Default::default() + }; + Pass { + addr: "home", + drive: &r.drive, + member_id: home_id, + side: &back, + hub: &home_side, + device_name: "Here".into(), + side_rev: None, + lost: Arc::default(), + stop: Arc::default(), + wanted: None, + seed: None, + } + .run() + .unwrap(); + assert_eq!(home_hub.get(&copies[0]).unwrap(), b"newer save"); + } + #[test] fn a_seed_only_holds_what_the_linked_console_has() { let m = |size, mtime| Meta { size, mtime }; @@ -5912,6 +6413,232 @@ mod tests { assert_eq!(seed["resized.txt"].h, m(1, 20)); } + // ---- links: three consoles, two links ending on one ---- + + fn three_consoles() -> (Drive, [Arc; 3]) { + let drive = Drive { + id: new_id(), + name: "d".into(), + hub: "/hub".into(), + ..Default::default() + }; + let consoles: [Arc; 3] = Default::default(); + // Each console's own clock. + for (i, s) in consoles.iter().enumerate() { + s.clock.store(1000 * i as i64, Ordering::SeqCst); + } + (drive, consoles) + } + + /// One pass of the link between the drive's home folders on `lo` and `hi`, made as + /// `run_link` makes it: the second console's folder is the member's side, the first's the hub. + /// It looks at both consoles in full (run_link learns of a change there from hub_rev). + fn link_pass(drive: &Drive, lo: (&str, &Arc), hi: (&str, &Arc)) { + let id = link_member_id(&drive.id, lo.0, hi.0); + with_runtime(&id, Runtime::look_again); + let side = MemSide { + store: hi.1.clone(), + hub: lo.1.clone(), + ..Default::default() + }; + let hub = MemSide { + store: lo.1.clone(), + ..Default::default() + }; + Pass { + addr: lo.0, + drive, + member_id: id.clone(), + side: &side, + hub: &hub, + device_name: hi.0.into(), + side_rev: None, + lost: Arc::default(), + stop: Arc::default(), + wanted: None, + seed: None, + } + .run() + .unwrap(); + let st = statuses().lock().unwrap().get(&id).cloned().unwrap(); + assert_eq!(st.state, "idle", "{id}: {}", st.detail); + } + + fn trashed(s: &MemStore) -> Vec { + s.trashed.lock().unwrap().clone() + } + + /// A is linked with B and with C, and sorts last: it is the second end of both links. Every + /// file reaches every console, an edit and a delete go everywhere, and nothing else is ever + /// trashed. (Older versions gave both links one record on A: the link with C started from + /// what the link with B had agreed on, and trashed on A what B had just brought in, every + /// round.) + #[test] + fn two_links_ending_on_one_console_each_keep_their_own_record() { + let (drive, [a, b, c]) = three_consoles(); + let (aa, ba, ca) = ("192.0.2.130", "192.0.2.110", "192.0.2.120"); + assert_eq!(link_ends(aa, ba), (ba, aa)); + assert_eq!(link_ends(ca, aa), (ca, aa)); + assert_ne!( + link_member_id(&drive.id, ba, aa), + link_member_id(&drive.id, ca, aa) + ); + let round = || { + link_pass(&drive, (ba, &b), (aa, &a)); + link_pass(&drive, (ca, &c), (aa, &a)); + }; + a.put("from-a.txt", b"a"); + b.put("from-b.txt", b"bb"); + c.put("from-c.txt", b"ccc"); + for _ in 0..3 { + round(); + } + for s in [&a, &b, &c] { + assert_eq!(s.names(), ["from-a.txt", "from-b.txt", "from-c.txt"]); + assert!(trashed(s).is_empty(), "{:?}", trashed(s)); + } + // An edit on C reaches B through A, with no conflict. + c.put("from-b.txt", b"edited on c"); + for _ in 0..2 { + round(); + } + for s in [&a, &b, &c] { + assert_eq!(s.get("from-b.txt").unwrap(), b"edited on c"); + assert_eq!(s.names().len(), 3, "{:?}", s.names()); + } + // A delete on B reaches C through A: into each console's trash, once. + b.remove("from-c.txt"); + for _ in 0..3 { + round(); + } + for s in [&a, &b, &c] { + assert_eq!(s.names(), ["from-a.txt", "from-b.txt"]); + } + assert_eq!(trashed(&a), ["from-c.txt"]); + assert_eq!(trashed(&c), ["from-c.txt"]); + assert!(trashed(&b).is_empty()); + } + + /// A console left by an older version holds one shared record, here the link with B's. The + /// first passes of both links on this version move nothing to any trash (the link with C, + /// whose record it is not, runs first), every file reaches every console, and each link then + /// keeps its own. + #[test] + fn upgrading_from_the_shared_link_record_moves_nothing_to_the_trash() { + let (drive, [a, b, c]) = three_consoles(); + let (aa, ba, ca) = ("192.0.2.131", "192.0.2.111", "192.0.2.121"); + for s in [&a, &b] { + s.put("shared.txt", b"same"); + s.put("from-b.txt", b"bb"); + } + c.put("shared.txt", b"same"); + c.put("from-c.txt", b"ccc"); + let old: Base = ["shared.txt", "from-b.txt"] + .into_iter() + .map(|n| { + let e = BaseEntry { + m: a.meta(n).unwrap(), + h: b.meta(n).unwrap(), + }; + (n.to_string(), e) + }) + .collect(); + *a.legacy.lock().unwrap() = Some(old.clone()); + // What the link with B agreed on is kept as it was: nothing of it is copied again. + assert_eq!( + carried_over(&old, &a.files_now(), &b.files_now()), + old, + "the record's own link" + ); + for _ in 0..2 { + link_pass(&drive, (ca, &c), (aa, &a)); + link_pass(&drive, (ba, &b), (aa, &a)); + } + for s in [&a, &b, &c] { + assert_eq!(s.names(), ["from-b.txt", "from-c.txt", "shared.txt"]); + assert!(trashed(s).is_empty(), "{:?}", trashed(s)); + } + let bases = a.bases.lock().unwrap(); + for lo in [ba, ca] { + let own = bases.get(&link_member_id(&drive.id, lo, aa)).unwrap(); + assert_eq!(own.len(), 3, "{lo}"); + } + } + + /// A file of the shared record the second console no longer has, or that the first console + /// holds otherwise, starts as never agreed on: copied back or compared, never deleted. + #[test] + fn a_shared_record_is_only_taken_where_it_surely_holds() { + let m = |size, mtime| Meta { size, mtime }; + let e = |a, b| BaseEntry { m: a, h: b }; + let old: Base = [ + ("kept.txt", e(m(1, 10), m(1, 20))), + ("gone-there.txt", e(m(1, 10), m(1, 20))), + ("gone-here.txt", e(m(1, 10), m(1, 20))), + ("other-time.txt", e(m(1, 10), m(1, 20))), + ("edited-here.txt", e(m(1, 10), m(1, 20))), + ] + .into_iter() + .map(|(k, v)| (k.to_string(), v)) + .collect(); + let side: Listing = [ + ("kept.txt", m(1, 10)), + ("gone-there.txt", m(1, 10)), + ("other-time.txt", m(1, 10)), + ("edited-here.txt", m(2, 11)), + ] + .into_iter() + .map(|(k, v)| (k.to_string(), v)) + .collect(); + let hub: Listing = [ + ("kept.txt", m(1, 20)), + ("gone-here.txt", m(1, 20)), + ("other-time.txt", m(1, 21)), + ("edited-here.txt", m(1, 20)), + ] + .into_iter() + .map(|(k, v)| (k.to_string(), v)) + .collect(); + let got = carried_over(&old, &side, &hub); + assert_eq!( + got.keys().collect::>(), + ["edited-here.txt", "kept.txt"] + ); + // Kept as recorded: an edit on the second console since still goes across. + assert_eq!( + plan(&side, &hub, &got) + .into_iter() + .filter(|o| o.path() == "edited-here.txt") + .collect::>(), + [Op::Upload("edited-here.txt".into())] + ); + assert!(plan(&side, &hub, &got).iter().all(|o| !o.is_delete())); + } + + #[test] + fn each_link_keeps_its_record_in_a_file_of_its_own() { + let d = "0123456789abcdef"; + let names = [ + link_base_name(&link_member_id(d, "192.168.1.2", "192.168.1.9")), + link_base_name(&link_member_id(d, "192.168.1.3", "192.168.1.9")), + link_base_name(&link_member_id(d, "[fe80::1]:9120", "192.168.1.9")), + link_base_name(&link_member_id(d, "../..", "/x\\y")), + ]; + for (i, n) in names.iter().enumerate() { + assert!(n.starts_with("link-base-") && n.ends_with(".json"), "{n}"); + assert!( + !n.contains('/') && !n.contains('\\') && !n.contains(':'), + "{n}" + ); + assert_ne!(n, LINK_BASE); + assert!(names[..i].iter().all(|o| o != n), "{n}"); + } + // A `_` is written out too: no two ids ever meet in one name. + assert_ne!(link_base_name("link:a_3ab"), link_base_name("link:a:b")); + let long = link_base_name(&link_member_id(d, &"x".repeat(300), "y")); + assert!(long.len() < 100 && long.ends_with(".json"), "{long}"); + } + #[test] fn two_jobs_of_one_engine_never_hold_a_drive_on_a_console_at_once() { let drive = new_id(); @@ -6157,6 +6884,224 @@ mod tests { assert!(back["drives"][0]["links"][0].get("error_args").is_none()); } + /// A helper that could not read its drive list says so. That is never "no drives" (every + /// folder kept there was forgotten, and the next write replaced the list), and not "away" + /// either: the folder stays and says why. + #[test] + fn a_drive_list_the_console_could_not_read_is_not_an_empty_one() { + let refused = |cause: &str| -> anyhow::Error { + ps5upload_core::mgmt::MgmtError { + label: "MESH_DOC_GET".into(), + status: 7, + cause: cause.into(), + } + .into() + }; + let answers = [ + Err(refused(r#"{"ok":false,"err":"doc_unreadable"}"#)), + Err(refused("doc_unreadable")), + Ok(Some(json!({"ok": false, "err": "doc_unreadable"}))), + ]; + for a in answers { + let e = drive_doc_of(a).unwrap_err(); + assert!(list_unreadable(&e), "{e:#}"); + assert_eq!(Said::of(&e).code, "console_list_unreadable"); + assert_eq!(away_why(&e), None); + } + // Another refusal stays what it was, and is no list either. + let e = drive_doc_of(Err(refused(r#"{"ok":false,"err":"fs_no_space"}"#))).unwrap_err(); + assert!(!list_unreadable(&e)); + assert!(drive_doc_of(Ok(Some(json!({"ok": false, "err": "busy"})))).is_err()); + // One never written is none (an older helper answers the same for one it could not read). + let (rev, doc) = drive_doc_of(Ok(Some(json!({"ok": true, "rev": 0, "doc": null})))) + .unwrap() + .unwrap(); + assert_eq!((rev, doc.drives.len()), (0, 0)); + // One this version cannot read is kept apart from both. + let e = drive_doc_of(Ok(Some( + json!({"ok": true, "rev": 3, "doc": {"drives": 5}}), + ))) + .unwrap_err(); + assert!(list_unreadable(&e)); + } + + // ---- leaving or deleting while the console does not answer ---- + + /// A console for this thread's management calls: its drive list, and whether it answers. + #[derive(Default)] + struct FakeConsole { + doc: Mutex<(u64, Value)>, + away: AtomicBool, + } + + impl ps5upload_core::mgmt::MgmtTransport for FakeConsole { + fn call( + &self, + _addr: &str, + method: ps5upload_core::mgmt::Method, + label: &str, + body: &[u8], + _timeout: Duration, + ) -> Result>> { + use ps5upload_core::mgmt::m; + if self.away.load(Ordering::SeqCst) { + return Err(ps5upload_core::mgmt::console_unusable( + label, + ps5upload_core::mgmt::AVA1_UNREACHABLE, + "nothing answered", + )); + } + let req: Value = serde_json::from_slice(body).unwrap_or(Value::Null); + let mut doc = self.doc.lock().unwrap(); + let reply = if method.id == m::MESH_DOC_GET.id { + json!({"ok": true, "rev": doc.0, "doc": doc.1}) + } else if method.id == m::MESH_DOC_PUT.id { + if req["base"].as_u64() == Some(doc.0) { + *doc = (doc.0 + 1, req["doc"].clone()); + json!({"ok": true, "saved": true, "rev": doc.0}) + } else { + json!({"ok": true, "saved": false, "rev": doc.0, "doc": doc.1}) + } + } else { + json!({"ok": true}) + }; + Ok(Some(serde_json::to_vec(&reply)?)) + } + } + + /// This thread's engine files in a folder of its own, and its calls to a fake console. + struct AwayRig { + dir: PathBuf, + console: Arc, + _calls: ps5upload_core::mgmt::ScopedTransport, + } + + impl AwayRig { + fn new(name: &str) -> Self { + let dir = std::env::temp_dir().join(format!( + "ps5u-mesh-{name}-{}-{}", + std::process::id(), + new_id() + )); + std::fs::create_dir_all(dir.join("folder")).unwrap(); + std::fs::write(dir.join("folder/save.dat"), b"kept").unwrap(); + TEST_STATE_DIR.with(|d| *d.borrow_mut() = Some(dir.join("state"))); + let console = Arc::new(FakeConsole::default()); + let calls = ps5upload_core::mgmt::scoped_transport(console.clone()); + Self { + dir, + console, + _calls: calls, + } + } + + fn folder(&self) -> String { + self.dir.join("folder").to_string_lossy().into_owned() + } + + fn files_kept(&self) -> bool { + std::fs::read(self.dir.join("folder/save.dat")).is_ok_and(|b| b == b"kept") + } + + fn set_doc(&self, drive: &str) { + *self.console.doc.lock().unwrap() = ( + 4, + json!({"drives": [ + {"id": drive, "name": "Saves", "hub": "/data/saves", "members": [ + {"id": "m-here", "device": "d1", "path": "/here"}, + {"id": "m-other", "device": "d2", "path": "/there"}, + ]}, + {"id": "kept", "name": "Other", "hub": "/data/other"}, + ]}), + ); + } + } + + impl Drop for AwayRig { + fn drop(&mut self) { + TEST_STATE_DIR.with(|d| *d.borrow_mut() = None); + let _ = std::fs::remove_dir_all(&self.dir); + } + } + + fn member_req(console: &str, drive: &str, member: Option<&str>) -> MemberReq { + MemberReq { + addr: Some(console.into()), + drive: drive.into(), + member: member.map(str::to_string), + approve: None, + paused: None, + } + } + + /// A console gone for good: its folder here can still leave. It stops syncing, its files stay, + /// the answer says the console drops it when it is back, and once it is, it does. + #[test] + fn a_folder_leaves_while_its_console_is_away_and_is_dropped_there_once_back() { + let rig = AwayRig::new("leave"); + let (console, drive) = ("192.0.2.211", new_id()); + add_local(console, &drive, "m-here", &rig.folder(), "Saves").unwrap(); + rig.set_doc(&drive); + rig.console.away.store(true, Ordering::SeqCst); + // Another device's folder: only its console can drop it. + assert!(leave_now(&member_req(console, &drive, Some("m-other"))).is_err()); + let Gone::Later(note) = leave_now(&member_req(console, &drive, Some("m-here"))).unwrap() + else { + panic!("not later"); + }; + assert!(note.contains("when it is back"), "{note}"); + let c = load_config(); + assert!(c.members.is_empty()); + assert_eq!(c.pending.len(), 1); + assert!(rig.files_kept()); + // Still away: kept for later. + finish_pending(); + assert_eq!(load_config().pending.len(), 1); + rig.console.away.store(false, Ordering::SeqCst); + finish_pending(); + assert!(load_config().pending.is_empty()); + let (rev, doc) = rig.console.doc.lock().unwrap().clone(); + assert_eq!(rev, 5); + assert_eq!(doc["drives"][0]["members"].as_array().unwrap().len(), 1); + assert_eq!(doc["drives"][0]["members"][0]["id"], "m-other"); + // Nothing left to do: nothing more is written. + finish_pending(); + assert_eq!(rig.console.doc.lock().unwrap().0, 5); + } + + #[test] + fn a_drive_deleted_while_its_console_is_away_is_deleted_there_once_back() { + let rig = AwayRig::new("delete"); + let (console, drive) = ("192.0.2.212", new_id()); + add_local(console, &drive, "m-here", &rig.folder(), "Saves").unwrap(); + rig.set_doc(&drive); + rig.console.away.store(true, Ordering::SeqCst); + // A drive this device keeps no folder of waits for its console. + assert!(delete_now(&member_req(console, "kept", None)).is_err()); + let Gone::Later(note) = delete_now(&member_req(console, &drive, None)).unwrap() else { + panic!("not later"); + }; + assert!(note.contains("No files are deleted"), "{note}"); + assert!(load_config().members.is_empty()); + assert!(rig.files_kept()); + // Joined again before the console heard of it: the delete is off. + add_local(console, &drive, "m-again", &rig.folder(), "Saves").unwrap(); + assert!(load_config().pending.is_empty()); + let _ = remove_local(&drive, Some("m-again")); + add_pending(console, &drive, None).unwrap(); + rig.console.away.store(false, Ordering::SeqCst); + finish_pending(); + assert!(load_config().pending.is_empty()); + let doc = rig.console.doc.lock().unwrap().1.clone(); + let ids: Vec<&str> = doc["drives"] + .as_array() + .unwrap() + .iter() + .filter_map(|d| d["id"].as_str()) + .collect(); + assert_eq!(ids, ["kept"]); + } + #[test] fn a_refused_route_says_why_with_its_status() { use axum::http::StatusCode as S; diff --git a/engine/crates/ps5upload-engine/src/pad_link.rs b/engine/crates/ps5upload-engine/src/pad_link.rs index 0ca3b7781..ca85b8235 100644 --- a/engine/crates/ps5upload-engine/src/pad_link.rs +++ b/engine/crates/ps5upload-engine/src/pad_link.rs @@ -7,7 +7,11 @@ //! * **QR code**: the computer's page opens the link (`POST /api/ps5/rp/pad-link {open:true}`) //! and shows `http://:/pad#t=` as a QR code. Any phone camera opens //! the controller page (`GET /pad`), which connects to `GET /api/pad/ws?t=&name=..`. -//! The key is 128 random bits, valid until the link is closed or the engine restarts. +//! The key is 128 random bits, valid until the link is closed, the engine restarts, or the +//! computer disconnects a phone on the home network: a new key then (the QR code shows it), so +//! the old one is no way back in under a new device id or none. The phones still in come back +//! on the old key's address all the same: a device that came in with the key is allowed, as one +//! the computer said yes to. //! * **Ask**: the ps5upload app on a phone sees " is using Remote Play" (mesh presence, //! with this engine's pad address) and connects without a key; the socket waits until the //! computer's page allows it (`POST /api/ps5/rp/pad-link/decide`). The phone app connects @@ -86,6 +90,13 @@ const MAX_PENDING_PER_IP: usize = 2; const NET_WATCH_QUEUE: usize = 6; /// An internet phone must say hello this soon after its channel opens. const NET_HELLO_WAIT: Duration = Duration::from_secs(10); +/// A phone's input reaches the console and the computer's page at most this many a second on +/// average, for each kind (pad states, touchpad & keyboard reports, keyboard & mouse switches), +/// with bursts of [`INPUT_BURST`] (bunched up by the network). A pad sends 250 a second at most and +/// a touchpad no more: they pass untouched. More is folded into the latest, which goes once there +/// is room, so a release is never lost and the phone is never cut off for it. +const INPUT_RATE: f64 = 500.0; +const INPUT_BURST: f64 = 64.0; /// Merge controller states into the one pad the console gets: buttons from all, the deeper /// trigger, and for each stick axis the one pushed furthest (a resting controller never cancels @@ -175,9 +186,11 @@ struct NetLink { room: crate::join_net::hub::Room, key: String, /// Reconnect tokens this engine gave the internet phones it allowed (random, made here: never - /// what a phone says about itself). Only one of these lets a phone back in without asking - /// again; they go with the room, so a New link (or closing the link) voids them all. - tokens: std::collections::HashSet, + /// what a phone says about itself), each with what it was allowed to do (true: to watch). + /// Only one of these lets a phone back in without asking again, and only to do that: the + /// computer said yes to a watcher, not to a controller. They go with the room, so a New link + /// (or closing the link) voids them all. + tokens: std::collections::HashMap, } struct Pending { @@ -206,8 +219,10 @@ struct Link { key: Option, pads: Vec, pending: Vec, - /// Devices the computer allowed: back in without asking on a new socket. - allowed: std::collections::HashSet, + /// Devices the computer allowed, or that came in on the LAN with the key, each with what for + /// (true: to watch): back in without asking on a new socket that asks for the same. One + /// allowed to watch asks again to play. + allowed: std::collections::HashSet<(String, bool)>, /// Devices the computer disconnected: out until the link closes. denied: std::collections::HashSet, /// The internet link, once asked for (until the link closes or a New link replaces it). @@ -692,7 +707,11 @@ pub async fn set_internet(headers: HeaderMap, Json(r): Json) -> Res if l.key.is_none() { l.key = random_key(); } - if r.new || l.net.as_ref().is_none_or(|n| n.room.url() != s.hub_url) { + if r.new + || l.net + .as_ref() + .is_none_or(|n| n.room.url() != s.hub_url || n.room.ended()) + { // The old room goes first: its link stops working, and the internet phones still // waiting for an answer go with it (those allowed keep playing). l.net = None; @@ -772,16 +791,21 @@ pub struct KickReq { } /// `POST /api/ps5/rp/pad-link/kick {id}`: let a phone go, and keep it out until the link closes -/// (the link's key alone would let it back in with one tap). +/// (the link's key alone would let it back in with one tap). One on the home network: the QR code +/// gets a new key, since the phone has the old one and makes up its device id itself (a new one, +/// or none, was a way back in). The other phones come back by their device ([`Link::allowed`]). pub async fn kick(Json(r): Json) -> Json { let gone = with_link(|l| { let i = l.pads.iter().position(|p| p.id == r.id)?; let p = l.pads.remove(i); let_go(&p, "kicked"); if let Some(d) = &p.device { - l.allowed.remove(d); + l.allowed.retain(|(x, _)| x != d); l.denied.insert(d.clone()); } + if p.net.is_none() && l.key.is_some() { + l.key = random_key(); + } // Its way back in over the internet goes too. if let (Some(rt), Some(n)) = (&p.rt, l.net.as_mut()) { n.tokens.remove(rt); @@ -881,14 +905,16 @@ fn clean_device(d: Option<&str>) -> Option { static CONNECTS: crate::join::ConnectLimit = crate::join::ConnectLimit::new(); -/// A socket that has the computer's word already: the link's key, or a device it allowed. Those -/// come back as often as a flaky Wi-Fi drops them; the limit is for everyone else. +/// A socket that has the computer's word already: the link's key, or a device it allowed to do +/// what this socket asks (watch, or play). Those come back as often as a flaky Wi-Fi drops them; +/// the limit is for everyone else. fn is_expected(q: &PadQuery) -> bool { let device = clean_device(q.d.as_deref()); + let watch = q.w == Some(1); with_link(|l| { q.t.as_deref() .is_some_and(|t| l.key.as_deref().is_some_and(|k| same_key(k, t))) - || device.is_some_and(|d| l.allowed.contains(&d)) + || device.is_some_and(|d| l.allowed.contains(&(d, watch))) }) } @@ -973,22 +999,28 @@ pub(crate) async fn rtc_session( pad_session(socket, q, ip).await } -/// `t` when it is a reconnect token the current internet link gave (compared whole). -fn net_token_known(t: &str) -> Option { +/// `t` when it is a reconnect token the current internet link gave (compared whole) to a phone +/// it allowed to do what this one asks (`watch`, or play). A watcher's token is no way in as a +/// controller: the computer never said yes to that. +fn net_token_known(t: &str, watch: bool) -> Option { with_link(|l| { - l.net - .as_ref() - .and_then(|n| n.tokens.iter().find(|k| same_key(k, t)).cloned()) + l.net.as_ref().and_then(|n| { + n.tokens + .iter() + .find(|(k, w)| same_key(k, t) && **w == watch) + .map(|(k, _)| k.clone()) + }) }) } -/// A new reconnect token for an internet phone just allowed, kept with the current internet link. -/// None when the link went meanwhile (the phone then has to ask again after a drop). -fn new_net_token() -> Option { +/// A new reconnect token for an internet phone just allowed (to watch, or to play), kept with the +/// current internet link. None when the link went meanwhile (the phone then has to ask again +/// after a drop). +fn new_net_token(watch: bool) -> Option { let t = random_key()?; with_link(|l| { let n = l.net.as_mut()?; - n.tokens.insert(t.clone()); + n.tokens.insert(t.clone(), watch); Some(t) }) } @@ -1072,6 +1104,11 @@ fn any_playing(pads: &[Pad]) -> bool { pads.iter().any(Pad::plays) } +/// One kind of a phone's input, held to [`INPUT_RATE`]. +fn input_pacer() -> crate::join::PadPacer { + crate::join::PadPacer::with_rate(INPUT_RATE, INPUT_BURST, std::time::Instant::now()) +} + /// A phone's session, on the LAN socket or an internet phone's data channel (whose key /// `rtc_session` checked already). async fn pad_session( @@ -1096,8 +1133,9 @@ async fn pad_session( // lets a phone ask (`rtc_session` checked it): the computer allows it, as it allows an // internet Play Together guest, and one it allowed comes back after a drop with the reconnect // token this engine gave it then. Never by its device id: the phone makes that up itself. + let watch = q.w == Some(1); let mut rt = match &net { - Some(_) => q.rt.as_deref().and_then(net_token_known), + Some(_) => q.rt.as_deref().and_then(|t| net_token_known(t, watch)), None => None, }; let keyed = match &net { @@ -1123,7 +1161,7 @@ async fn pad_session( name: name.clone(), ip, net: net.is_some(), - watch: q.w == Some(1), + watch, answer: tx, }); true @@ -1136,7 +1174,7 @@ async fn pad_session( Info, "together", "pad_link: phone {id} asks to {} ({})", - if q.w == Some(1) { "watch" } else { "play" }, + if watch { "watch" } else { "play" }, if net.is_some() { "internet" } else { "LAN" } ); send_limited(&mut socket, say(serde_json::json!({"stage": "asking"}))).await; @@ -1163,17 +1201,16 @@ async fn pad_session( Some(Answer::Allow) => { if net.is_some() { // Its way back after a drop: a token of ours, kept by the phone for this link. - rt = new_net_token(); + rt = new_net_token(watch); if let Some(t) = &rt { send_limited(&mut socket, say(serde_json::json!({ "rt": t }))).await; } } else if let Some(d) = &device { - with_link(|l| l.allowed.insert(d.clone())); + with_link(|l| l.allowed.insert((d.clone(), watch))); } } } } - let watch = q.w == Some(1); // A watcher gets the stream itself (rp_stream_api's copy for it); none without a session. Over // the internet as a Play Together guest gets it: pictures through a short queue of their own // (`video`) that skips to the next keyframe when the connection can't keep up. @@ -1221,6 +1258,11 @@ async fn pad_session( .duration_since(std::time::UNIX_EPOCH) .map(|d| d.as_millis()) .unwrap_or(0); + // A device in on the LAN, with the key or the computer's yes, comes back by its id: the + // key may be replaced meanwhile (a phone disconnected), and this one was not. + if let (None, Some(d)) = (&net, &device) { + l.allowed.insert((d.clone(), watch)); + } l.pads.push(Pad { id, name: name.clone(), @@ -1241,7 +1283,7 @@ async fn pad_session( send_limited(&mut socket, refuse("full")).await; return; } - // By number at this level: a bug report is posted in public (names under Detailed logs). + // By number: a bug report is posted in public (never a phone's name or address). crate::log_at!( Info, "together", @@ -1249,7 +1291,6 @@ async fn pad_session( if watch { "watcher" } else { "controller" }, if net.is_some() { "internet" } else { "LAN" } ); - crate::log_at!(Debug, "together", "pad_link: phone {id} is {name}"); let mut tick = tokio::time::interval(STATE_EVERY); tick.set_missed_tick_behavior(tokio::time::MissedTickBehavior::Delay); // Rounds since anything came from the phone (counted, not timed: see rp_stream_api's page). @@ -1257,6 +1298,22 @@ async fn pad_session( // When a page that keeps sending is let go of if it hasn't. let mut pad_due: Option = None; let mut key_asked: Option = None; + let mut pads = input_pacer(); + let mut kbms = input_pacer(); + let mut reports = input_pacer(); + // A pad state goes: played (a watcher only while it holds the controller), and a page that + // keeps sending is let go of if it stops. + let pad_in = |(p, ka): (ControllerState, bool), pad_due: &mut Option| { + if plays(id) { + crate::rp_stream_api::push_pad(id, Some(p)); + *pad_due = ka.then(|| tokio::time::Instant::now() + PAD_SILENT_AFTER); + } + }; + let kbm_in = |v: serde_json::Value| { + if plays(id) { + crate::rp_stream_api::push_pad_kbm(v); + } + }; loop { tokio::select! { out = rx.recv() => match out { @@ -1311,6 +1368,24 @@ async fn pad_session( pad_due = None; crate::rp_stream_api::push_pad(id, None); }, + // Input held back by the rate (the latest of each kind), once it may go. + _ = async { + match [pads.due(), kbms.due(), reports.due()].into_iter().flatten().min() { + Some(t) => tokio::time::sleep_until(t.into()).await, + None => std::future::pending().await, + } + } => { + let now = std::time::Instant::now(); + if let Some(p) = pads.take(now) { + pad_in(p, &mut pad_due); + } + if let Some(v) = kbms.take(now) { + kbm_in(v); + } + if let Some(v) = reports.take(now) { + kbm_in(v); + } + }, inc = socket.recv() => { quiet = 0; match inc { Some(Ok(Message::Text(t))) => { #[derive(serde::Deserialize)] @@ -1327,24 +1402,19 @@ async fn pad_session( key_asked = Some(std::time::Instant::now()); crate::rp_stream_api::request_spectator_keyframe(id); } - if let Some(p) = m.pad { - if plays(id) { - crate::rp_stream_api::push_pad(id, Some(p)); - pad_due = m.ka.is_some().then(|| tokio::time::Instant::now() + PAD_SILENT_AFTER); - } + let now = std::time::Instant::now(); + if let Some(p) = m.pad.and_then(|p| pads.offer(now, (p, m.ka.is_some()))) { + pad_in(p, &mut pad_due); } - if let Some(k) = m.kbm { - if plays(id) { - crate::rp_stream_api::push_pad_kbm(kbm_control(id, &k)); - } + if let Some(v) = m.kbm.and_then(|k| kbms.offer(now, kbm_control(id, &k))) { + kbm_in(v); } } } Some(Ok(Message::Binary(b))) => { - if let Some(v) = kbm_report(id, &b) { - if plays(id) { - crate::rp_stream_api::push_pad_kbm(v); - } + let now = std::time::Instant::now(); + if let Some(v) = kbm_report(id, &b).and_then(|v| reports.offer(now, v)) { + kbm_in(v); } } Some(Ok(Message::Close(_))) | None | Some(Err(_)) => break, @@ -1699,6 +1769,20 @@ pub(crate) fn router() -> axum::Router { mod tests { use super::*; + /// A pad at 250 a second and its touchpad as fast, bunched up by the network (eight at once + /// every 32 ms): every one goes at once. + #[test] + fn a_pad_at_250_hz_and_its_touchpad_pass_untouched() { + let mut pads = input_pacer(); + let mut touch = input_pacer(); + let t = std::time::Instant::now(); + for i in 0..2500u32 { + let now = t + Duration::from_millis(32 * u64::from(i / 8)); + assert_eq!(pads.offer(now, i), Some(i)); + assert_eq!(touch.offer(now, i), Some(i)); + } + } + #[test] fn a_ping_carries_eight_bytes() { // An internet phone's channel passes a ping of eight bytes only (join_net/chunk.rs). @@ -2295,6 +2379,10 @@ mod tests { let base = serve().await; let url = format!("{base}?t={key}&name=iphone&d=00112233445566778899aabbccddeeff"); let (mut ws, id) = holding(&url, &live).await; + // Another phone on the same QR code, which stays. + let other = format!("{base}?t={key}&name=android&d=ffeeddccbbaa99887766554433221100"); + let mut ws2 = phone(&other).await; + hear(&mut ws2, joined).await; let r = kick(Json(KickReq { id })).await; assert_eq!(r.0["ok"], true); // The engine itself, not the socket's loop. @@ -2312,13 +2400,31 @@ mod tests { .0["ok"], false ); - // One tap on Try again: out, while the link's key still works for others. + // One tap on Try again: out. let mut again = phone(&url).await; assert_eq!( hear(&mut again, |v| v["stage"] == "refused").await["why"], "kicked" ); - let other = format!("{base}?t={key}&name=android&d=ffeeddccbbaa99887766554433221100"); + // Nor with the old key under a new device id, or none (the page makes it up: cleared + // site data was a way back in). The QR code has a new key now. + for d in ["&d=0123456789abcdef0123456789abcdef", ""] { + let mut sly = phone(&format!("{base}?t={key}&name=iphone{d}")).await; + assert_eq!( + hear(&mut sly, |v| v["stage"] == "refused").await["why"], + "key", + "{d}" + ); + } + let new_key = with_link(|l| l.key.clone()).unwrap(); + assert!(!same_key(&new_key, &key)); + let mut fresh = phone(&format!("{base}?t={new_key}&name=pixel")).await; + hear(&mut fresh, joined).await; + drop(fresh); + // The phone that was not disconnected loses its socket and comes back on the address + // it has, the old key's, without asking. + drop(ws2); + until("gone", || pads() == 0).await; let mut ws2 = phone(&other).await; hear(&mut ws2, joined).await; // The link closed: everyone told why, and the key void; a new link starts afresh. @@ -2448,6 +2554,83 @@ mod tests { hear(&mut other, |v| v["stage"] == "asking").await; } + /// The computer's yes was to a watcher: the device comes back to watch without asking, + /// and asks again to play (it played at once before, PS button and keyboard included). + #[tokio::test(flavor = "multi_thread", worker_threads = 2)] + async fn a_phone_allowed_to_watch_asks_again_to_play() { + let _turn = LIVE_TEST_LOCK.lock().await; + let live = test_live::Session::start("10.0.77.3"); + fresh_link(); + let base = serve().await; + let play = format!("{base}?name=Pixel&d=00112233445566778899aabbccddeeff"); + let watch = format!("{play}&w=1"); + let mut ws = phone(&watch).await; + hear(&mut ws, |v| v["stage"] == "asking").await; + let (ask, asks_to_watch) = with_link(|l| (l.pending[0].id, l.pending[0].watch)); + assert!(asks_to_watch); + assert_eq!( + decide(Json(DecideReq { + id: ask, + allow: true + })) + .await + .0["ok"], + true + ); + hear(&mut ws, joined).await; + drop(ws); + until("gone", || pads() == 0).await; + let mut back = phone(&watch).await; + hear(&mut back, joined).await; + assert!(with_link(|l| l.pads.iter().all(|p| p.watch))); + // The same device, the link without `w`: not in, and nothing it sends is played. + let mut sly = phone(&play).await; + let v = hear(&mut sly, |v| v.get("stage").is_some()).await; + assert_eq!(v["stage"], "asking", "{v}"); + assert!(with_link(|l| !l.pending[0].watch), "asks to play"); + sly.send(TMsg::Text(PRESS.into())).await.unwrap(); + tokio::time::sleep(std::time::Duration::from_millis(200)).await; + assert_eq!(live.merged().buttons, 0); + assert!(!phones_playing()); + } + + /// A phone flooding its pad states: they reach the console at the rate, the latest always + /// (the release after the presses), and the phone stays in. + #[tokio::test(flavor = "multi_thread", worker_threads = 2)] + async fn a_flooding_phone_is_held_to_the_rate_and_stays_in() { + let _turn = LIVE_TEST_LOCK.lock().await; + let live = test_live::Session::start("10.0.77.3"); + let key = fresh_link(); + let base = serve().await; + let (mut ws, id) = holding(&format!("{base}?t={key}"), &live).await; + let t0 = std::time::Instant::now(); + const N: u32 = 3000; + for i in 0..N { + // ✕, then ✕ and ○, and so on; the last lets go of everything. + let b = if i + 1 == N { 0 } else { 1 + (i % 2) * 2 }; + let m = format!( + r#"{{"pad":{{"buttons":{b},"l2":0,"r2":0,"lx":0,"ly":0,"rx":0,"ry":0}}}}"# + ); + ws.send(TMsg::Text(m.into())).await.unwrap(); + } + until("let go", || live.merged().buttons == 0).await; + let secs = t0.elapsed().as_secs_f64(); + let v = crate::rp_diag::controller_json(None, |n| n.to_string()); + let updates = v["sources"] + .as_array() + .unwrap() + .iter() + .find(|s| s["source"].as_str() == Some(id.to_string().as_str())) + .and_then(|s| s["updates"].as_u64()) + .unwrap(); + assert!( + (updates as f64) <= INPUT_RATE * (secs + 0.1) + INPUT_BURST + 1.0, + "{updates} in {secs:.2} s" + ); + hear(&mut ws, joined).await; + assert_eq!(pads(), 1); + } + /// Any device on the LAN reaches this socket: asks and sizes have a limit. #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn the_lan_cannot_flood_the_asks_or_send_huge_messages() { diff --git a/engine/crates/ps5upload-engine/src/pad_page.html b/engine/crates/ps5upload-engine/src/pad_page.html index 429adcc5c..5b9222869 100644 --- a/engine/crates/ps5upload-engine/src/pad_page.html +++ b/engine/crates/ps5upload-engine/src/pad_page.html @@ -270,7 +270,7 @@ z AÍp\Ž0N˜HJê´ªØ^U I€wu¸öôú!3å6³‹âVq£³¹´RN£%y10º:pŠ#\:J:b9Hµ7h_Ž:¢I9 _¼™µV,þ <`});var w={a:v};this.setModule=t=>{e.setModule(fi,t)},this.getModule=()=>e.getModule(fi),this.instantiate=()=>(this.getModule().then(e=>WebAssembly.instantiate(e,w)).then(e=>{let t=e.exports;y(t),a=t.g,o(),ne(t),n()}),this.ready=new Promise(e=>{n=e}).then(()=>{this.HEAP=a.buffer,this.malloc=x,this.free=te,this.opus_frame_decoder_create=b,this.opus_frame_decode_float_deinterleaved=S,this.opus_frame_decoder_destroy=ee}),this)}var pi=o((()=>{}));function mi(e={}){mi.errors||Object.defineProperties(mi,{errors:{value:new Map([[-1,`OPUS_BAD_ARG: One or more invalid/out of range arguments`],[-2,`OPUS_BUFFER_TOO_SMALL: Not enough bytes allocated in the buffer`],[-3,`OPUS_INTERNAL_ERROR: An internal error was detected`],[-4,`OPUS_INVALID_PACKET: The compressed data passed is corrupted`],[-5,`OPUS_UNIMPLEMENTED: Invalid/unsupported request number`],[-6,`OPUS_INVALID_STATE: An encoder or decoder structure is invalid or already freed`],[-7,`OPUS_ALLOC_FAIL: Memory allocation has failed`]])}}),this._init=()=>new this._WASMAudioDecoderCommon(this).instantiate(this._EmscriptenWASM,this._module).then(e=>{this._common=e,this._inputBytes=0,this._outputSamples=0,this._frameNumber=0,this._input=this._common.allocateTypedArray(this._inputSize,Uint8Array),this._output=this._common.allocateTypedArray(this._outputChannels*this._outputChannelSize,Float32Array);let t=this._common.allocateTypedArray(this._channels,Uint8Array);t.buf.set(this._channelMappingTable),this._decoder=this._common.wasm.opus_frame_decoder_create(this._sampleRate,this._channels,this._streamCount,this._coupledStreamCount,t.ptr,this._preSkip,this._forceStereo)}),Object.defineProperty(this,"ready",{enumerable:!0,get:()=>this._ready}),this.reset=()=>(this.free(),this._init()),this.free=()=>{this._common.free(),this._common.wasm.opus_frame_decoder_destroy(this._decoder),this._common.wasm.free(this._decoder)},this._decode=e=>{if(!(e instanceof Uint8Array))throw Error(`Data to decode must be Uint8Array. Instead got `+typeof e);this._input.buf.set(e);let t=this._common.wasm.opus_frame_decode_float_deinterleaved(this._decoder,this._input.ptr,e.length,this._output.ptr),n;return t<0&&(n=`libopus `+t+` `+(mi.errors.get(t)||`Unknown Error`),console.error(n),t=0),{outputBuffer:this._common.getOutputChannels(this._output.buf,this._outputChannels,t),samplesDecoded:t,error:n}},this.decodeFrame=e=>{let t=[],n=this._decode(e);return n.error&&this._common.addError(t,n.error,e.length,this._frameNumber,this._inputBytes,this._outputSamples),this._frameNumber++,this._inputBytes+=e.length,this._outputSamples+=n.samplesDecoded,this._WASMAudioDecoderCommon.getDecodedAudioMultiChannel(t,[n.outputBuffer],this._outputChannels,n.samplesDecoded,this._sampleRate)},this.decodeFrames=e=>{let t=[],n=[],r=0,i=0;for(;itypeof e==`number`,n=e.sampleRate,r=e.channels,i=e.streamCount,a=e.coupledStreamCount,o=e.channelMappingTable,s=e.preSkip,c=+!!e.forceStereo;if(r>2&&(!t(i)||!t(a)||!Array.isArray(o)))throw Error(`Invalid Opus Decoder Options for multichannel decoding.`);return this._sampleRate=[8e3,12e3,16e3,24e3,48e3].includes(n)?n:48e3,this._channels=t(r)?r:2,this._streamCount=t(i)?i:1,this._coupledStreamCount=t(a)?a:this._channels-1,this._channelMappingTable=o||(this._channels===2?[0,1]:[0]),this._preSkip=s||0,this._forceStereo=r<=8&&r!=2?c:0,this._inputSize=3840*this._channels,this._outputChannelSize=5760,this._outputChannels=this._forceStereo?2:this._channels,this._ready=this._init(),this}var hi=o((()=>{di(),pi()})),gi,_i=o((()=>{di(),pi(),hi(),gi=class extends si{constructor(e){super(e,`opus-decoder`,mi,fi)}async decodeFrame(e){return this.postToDecoder(`decodeFrame`,e)}async decodeFrames(e){return this.postToDecoder(`decodeFrames`,e)}}})),vi=c({OpusDecoder:()=>mi,OpusDecoderWebWorker:()=>gi}),yi=o((()=>{hi(),_i(),di(),li(mi,`OpusDecoder`),li(gi,`OpusDecoderWebWorker`)})),bi=[8e3,12e3,16e3,24e3,48e3],xi=null;function Si(){return xi??=Vn(()=>Promise.resolve().then(()=>(yi(),vi)),__VITE_PRELOAD__,import.meta.url).catch(e=>{throw xi=null,e}),xi}function Ci(){return typeof WebAssembly==`object`&&typeof WebAssembly.instantiate==`function`}function wi(e,t,n,r){return{numberOfFrames:t,numberOfChannels:e.length,sampleRate:n,timestamp:r,format:`f32-planar`,duration:Math.round(t/n*1e6),copyTo(n,r){n.set(e[r.planeIndex].subarray(0,t))},close(){}}}var Ti=class{constructor(e,t=Si){this.init=e,this.load=t,this.state=`unconfigured`,this.dec=null,this.pending=[]}configure(e){if(this.state===`closed`)throw Error(`the decoder is closed`);if(!Ci())throw Error(`no WebAssembly here`);let t=e.sampleRate;if(!bi.includes(t))throw Error(`Opus does not decode at ${t} Hz`);let n=e.numberOfChannels;if(n<1||n>2)throw Error(`${n} channels: only mono and stereo are decoded`);this.state=`configured`,this.load().then(async e=>{if(this.state===`closed`)return;let r=new e.OpusDecoder({channels:n,sampleRate:t});if(await r.ready,this.state!==`configured`){r.free();return}this.dec=r;let i=this.pending;this.pending=[];for(let e of i)this.state===`configured`&&this.run(e)}).catch(e=>this.fail(e))}decode(e){if(this.state!==`configured`)return;let t=e;if(this.dec)return this.run(t);this.pending.push({timestamp:t.timestamp,data:t.data.slice()}),this.pending.length>50&&this.pending.shift()}run(e){let t=this.dec;if(!t)return;let n;try{n=t.decodeFrame(e.data)}catch(e){return this.fail(e)}n.samplesDecoded&&n.channelData.length&&this.init.output(wi(n.channelData,n.samplesDecoded,n.sampleRate,e.timestamp))}fail(e){if(this.state===`closed`)return;this.close();let t=e instanceof Error?e:Error(String(e));queueMicrotask(()=>this.init.error(t))}close(){this.state=`closed`,this.pending=[];let e=this.dec;this.dec=null;try{e?.free()}catch{}}},Ei={makeDecoder:e=>new Ti(e),makeChunk:e=>({type:e.type,timestamp:e.timestamp,data:e.data instanceof Uint8Array?e.data:new Uint8Array(e.data)})};function Di(e,t){for(let n=0;n+3>1&63;if(t>=16&&t<=21)return!0;if(t<16)return!1}else{let t=e[n+3]&31;if(t===5)return!0;if(t===1)return!1}}return!1}function Oi(e){for(let t=0;t+6e.toString(16).padStart(2,`0`);return`avc1.${n(e[t+4])}${n(e[t+5])}${n(e[t+6])}`}return`avc1.4d4028`}var ki=[`hev1.1.6.L153.B0`,`hvc1.1.6.L153.B0`,`hev1.2.4.L153.B0`,`hvc1.2.4.L153.B0`,`hev1.1.6.L150.90`];async function Ai(e,t){if(typeof VideoDecoder>`u`)return null;for(let n of ki)try{if((await VideoDecoder.isConfigSupported({codec:n,codedWidth:e,codedHeight:t})).supported)return n}catch{}return null}function ji(e){let t=[];for(let n=0;n+2{let i=r+1n&&e[i-1]===0;)i--;return e.subarray(n,i)}).filter(e=>e.length>0)}var Mi=(e,t)=>t?e[0]>>1&63:e[0]&31;function j(e,...t){let n=8+t.reduce((e,t)=>e+t.length,0),r=new Uint8Array(n);new DataView(r.buffer).setUint32(0,n);for(let t=0;t<4;t++)r[4+t]=e.charCodeAt(t);let i=8;for(let e of t)r.set(e,i),i+=e.length;return r}function M(...e){let t=new Uint8Array(e.reduce((e,[,t])=>e+t,0)),n=0;for(let[r,i]of e){for(let e=i-1;e>=0;e--)t[n+i-1-e]=Math.floor(r/2**(8*e))&255;n+=i}return t}var Ni=(e,t,n,...r)=>j(e,M([t,1],[n,3]),...r),Pi=M([65536,4],[0,4],[0,4],[0,4],[65536,4],[0,4],[0,4],[0,4],[1073741824,4]);function Fi(e){let t=e.handler===`vide`,n=j(`ftyp`,new TextEncoder().encode(`isom`),M([1,4]),new TextEncoder().encode(`isomiso6mp41`)),r=j(`moov`,Ni(`mvhd`,0,0,M([0,4],[0,4],[e.timescale,4],[0,4],[65536,4],[256,2],[0,2],[0,4],[0,4]),Pi,new Uint8Array(24),M([2,4])),j(`trak`,Ni(`tkhd`,0,3,M([0,4],[0,4],[1,4],[0,4],[0,4],[0,4],[0,4],[0,2],[0,2],[t?0:256,2],[0,2]),Pi,M([(e.width??0)*65536,4],[(e.height??0)*65536,4])),j(`mdia`,Ni(`mdhd`,0,0,M([0,4],[0,4],[e.timescale,4],[0,4],[21956,2],[0,2])),Ni(`hdlr`,0,0,M([0,4]),new TextEncoder().encode(e.handler),new Uint8Array(12),M([0,1])),j(`minf`,t?Ni(`vmhd`,0,1,new Uint8Array(8)):Ni(`smhd`,0,0,M([0,4])),j(`dinf`,Ni(`dref`,0,0,M([1,4]),Ni(`url `,0,1))),j(`stbl`,Ni(`stsd`,0,0,M([1,4]),e.sampleEntry),Ni(`stts`,0,0,M([0,4])),Ni(`stsc`,0,0,M([0,4])),Ni(`stsz`,0,0,M([0,4],[0,4])),Ni(`stco`,0,0,M([0,4])))))),j(`mvex`,Ni(`trex`,0,0,M([1,4],[1,4],[0,4],[0,4],[0,4])))),i=new Uint8Array(n.length+r.length);return i.set(n,0),i.set(r,n.length),i}function Ii(e,t,n,r,i){let a=i?33554432:16842752,o=e=>Ni(`trun`,0,1793,M([1,4],[e,4],[n,4],[r.length,4],[a,4])),s=e=>j(`traf`,Ni(`tfhd`,0,131072,M([1,4])),Ni(`tfdt`,1,0,M([t,8])),o(e)),c=Ni(`mfhd`,0,0,M([e,4])),l=j(`moof`,c,s(0)).length,u=j(`moof`,c,s(l+8)),d=j(`mdat`,r),f=new Uint8Array(u.length+d.length);return f.set(u,0),f.set(d,u.length),f}function Li(e,t,n=!1){let r=t?[35,...n?[32,33,34]:[]]:[9,...n?[7,8]:[]],i=ji(e).filter(e=>!r.includes(Mi(e,t))),a=new Uint8Array(i.reduce((e,t)=>e+4+t.length,0)),o=new DataView(a.buffer),s=0;for(let e of i)o.setUint32(s,e.length),a.set(e,s+4),s+=4+e.length;return a}var Ri=e=>e.toString(16).padStart(2,`0`),zi=e=>{let t=new Uint8Array(2+e.length);return t[0]=e.length>>8,t[1]=e.length&255,t.set(e,2),t},Bi=e=>{let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),n=0;for(let r of e)t.set(r,n),n+=r.length;return t};function Vi(e){let t=ji(e),n=t.filter(e=>Mi(e,!1)===7),r=t.filter(e=>Mi(e,!1)===8);return!n.length||!r.length||n[0].length<4?null:Bi([M([1,1],[n[0][1],1],[n[0][2],1],[n[0][3],1],[255,1],[224|n.length,1]),...n.map(zi),M([r.length,1]),...r.map(zi)])}function Hi(e,t,n){let r=ji(e),i=e=>r.filter(n=>Mi(n,t)===e),a=(e,t)=>j(e,new Uint8Array(6),M([1,2],[0,16],[n.w,2],[n.h,2],[4718592,4],[4718592,4],[0,4],[1,2]),new Uint8Array(32),M([24,2],[65535,2]),t);if(!t){let t=i(7),r=Vi(e);return r?{init:Fi({handler:`vide`,timescale:9e4,sampleEntry:a(`avc1`,j(`avcC`,r)),width:n.w,height:n.h}),mime:`video/mp4; codecs="avc1.${Ri(t[0][1])}${Ri(t[0][2])}${Ri(t[0][3])}"`}:null}let o=i(32),s=i(33),c=i(34);if(!o.length||!s.length||!c.length)return null;let l=Vr(s[0]);if(l.length<15)return null;let u=l.subarray(3,15),d=u[0]&31,f=d===2?2:0,p=(e,t)=>Bi([M([128|e,1],[t.length,2]),...t.map(zi)]),m=j(`hvcC`,M([1,1]),u,M([61440,2],[252,1],[253,1],[248|f,1],[248|f,1],[0,2],[15,1],[3,1]),p(32,o),p(33,s),p(34,c)),h=[``,`A`,`B`,`C`][u[0]>>6],g=0,_=(u[1]<<24|u[2]<<16|u[3]<<8|u[4])>>>0;for(let e=0;e<32;e++)_&1<>>0).toString(16),`${u[0]&32?`H`:`L`}${u[11]}`,...v.map(e=>e.toString(16))].join(`.`);return{init:Fi({handler:`vide`,timescale:9e4,sampleEntry:a(`hvc1`,m),width:n.w,height:n.h}),mime:`video/mp4; codecs="${y}"`}}function Ui(e,t,n,r,i,a){return Ii(e,t,n,Li(r,i),a)}function Wi(e,t){let n=j(`dOps`,M([0,1],[e,1],[312,2],[t,4],[0,2],[0,1]));return Fi({handler:`soun`,timescale:48e3,sampleEntry:j(`Opus`,new Uint8Array(6),M([1,2],[0,8],[e,2],[16,2],[0,4],[3145728e3,4]),n)})}function Gi(e){if(!e.length)return 960;let t=e[0]>>3,n=t<12?[480,960,1920,2880][t%4]:t<16?[480,960][t%2]:[120,240,480,960][t%4],r=e[0]&3,i=r===0?1:r===3?(e[1]??1)&63:2;return n*Math.max(1,i)}function Ki(e,t,n){return Ii(e,t,Gi(n),n,!0)}var qi={watch:30,player:4},Ji={watch:{seek:.5,speed:1/0,target:.05},player:{seek:.15,speed:.06,target:.02}},Yi={seek:.8,speed:.25,target:.12};function Xi(e,t,n){let r=typeof n==`string`?Ji[n]:n;return e>r.seek?{seekTo:t-r.target,rate:1}:e>r.speed?{seekTo:null,rate:1.1}:{seekTo:null,rate:1}}function Zi(e,t=`watch`,n){return typeof VideoDecoder<`u`?new ca(e,t,n):new ba(e,t,n)}var Qi=class{constructor(e,t=()=>performance.now()){this.ask=e,this.now=t,this.last=-1/0}waiting(){if(!this.ask)return;let e=this.now();e-this.last<1e3||(this.last=e,this.ask())}};function $i(e){return e.length<3?null:{index:e[0]<<8|e[1],packet:e.subarray(2)}}var ea=class{constructor(){this.last=-1}take(e){if(this.last>=0){let t=e-this.last&65535;if(t===0||t>=32768)return!1}return this.last=e,!0}reset(){this.last=-1}};function ta(e){if(e.length>=10)return e;let t=new Uint8Array(10);t.set(e.subarray(0,6));let n=new DataView(t.buffer);return n.setUint32(6,Math.round(n.getUint32(2)/100)||480),t}function na(e,t){return{snd:e,snd_decoded:t.decoded,snd_concealed:t.concealed,snd_underruns:t.underruns,snd_dropped:t.dropped}}var ra=class{constructor(e,t=.2){this.min=e,this.max=t,this.next=0,this.calmSince=0,this.minLead=1/0,this.windowAt=0,this.underruns=0,this.dropped=0,this.cushion=e}at(e,t){this.next0&&(this.underruns++,this.cushion=Math.min(this.max,this.cushion+.02)),this.calmSince=e,this.next=e+this.cushion,this.minLead=1/0,this.windowAt=e):e-this.calmSince>10&&this.cushion>this.min&&(this.cushion=Math.max(this.min,this.cushion-.01),this.calmSince=e);let n=this.next-e;if(n>this.cushion+.15)return this.dropped++,null;if(this.minLead=Math.min(this.minLead,n),e-this.windowAt>=.25){let t=this.minLead>this.cushion+ia;if(this.minLead=1/0,this.windowAt=e,t)return this.dropped++,null}let r=this.next;return this.next+=t,r}reset(){this.next=0}},ia=.02;async function aa(e,t){try{return typeof AudioDecoder>`u`?!1:!!(await AudioDecoder.isConfigSupported({codec:`opus`,sampleRate:e,numberOfChannels:t})).supported}catch{return!1}}var oa=class{constructor(e,t=()=>performance.now()){this.decoder=e,this.now=t,this.n={frames:0,dropped:0,late:0,stalls:0,stall_ms:0,worst_stall_ms:0,key_waits:0},this.a=0,this.d=0,this.w=!1,this.q=[],this.sum=0,this.cnt=0,this.codec=``}get frames(){return this.n.frames}arrived(){let e=this.now();this.a&&e-this.a>50&&this.n.late++,this.a=e}drop(){this.n.dropped++,this.w||this.n.key_waits++,this.w=!0}decoding(){this.w=!1,this.q.push(this.now())>64&&this.q.shift()}drawn(e=!1){let t=this.now(),n=e?this.q.shift():void 0;n!==void 0&&(this.sum+=t-n,this.cnt++);let r=this.d?t-this.d:0;r>100&&this.stall(r),this.d=t,this.n.frames++}stall(e){this.n.stalls++,this.n.stall_ms+=e,this.n.worst_stall_ms=Math.max(this.n.worst_stall_ms,e)}snapshot(){let e=this.d?this.now()-this.d:0,t={...this.n,decoder:this.decoder};this.codec&&(t.codec=this.codec),e>100&&(t.stalls=this.n.stalls+1,t.stall_ms=this.n.stall_ms+e,t.worst_stall_ms=Math.max(this.n.worst_stall_ms,e));for(let e of[`stall_ms`,`worst_stall_ms`])t[e]=Math.round(t[e]);return t.decode_ms=this.cnt?Math.round(this.sum/this.cnt*10)/10:0,this.sum=this.cnt=0,t}},sa=[`pointerup`,`touchend`,`click`,`keydown`],ca=class{get element(){if(!this.wrap){let e=document.createElement(`div`);e.className=`h-full w-full`,e.append(this.canvas),this.mse&&e.append(this.mse.element),this.wrap=e}return this.wrap}get stats(){return this.mse?.stats??this.ownStats}soundReport(){return this.soundOn?this.mseSound?this.mseSound.report():na(this.soundWasm?`wasm`:`webcodecs`,this.soundStats):null}constructor(e,t=`watch`,n){this.onProblem=e,this.latency=t,this.onNeedKey=n,this.canvas=document.createElement(`canvas`),this.wrap=null,this.mse=null,this.failsNoPicture=0,this.ctx=this.canvas.getContext(`2d`,{alpha:!1}),this.hevc=!1,this.header=null,this.spsRect=null,this.software=!1,this.video=null,this.opening=!1,this.stopped=!1,this.sawKey=!1,this.ownStats=new oa(`webcodecs`),this.problemShown=!1,this.ts=0,this.pipe=null,this.audioGen=0,this.actx=null,this.soundOn=!1,this.unarm=null,this.mseSound=null,this.audioHeader=null,this.soundWasm=!1,this.onSoundFail=null,this.muted=!1,this.keyAsk=new Qi(n),this.clock=new ra(t===`player`?.05:.08),typeof AudioDecoder>`u`&&N()&&(this.mseSound=new P(t,()=>this.mseSoundFailed())),this.canvas.className=`block h-full w-full object-contain`,this.canvas.dataset.testid=`watch-canvas`}setHevc(e){this.hevc=e,this.header&&(this.spsRect=qr(this.header,e)),this.mse?.setHevc(e)}get onMse(){return!!this.mse}decodeFailed(){if(this.mse||this.ownStats.frames>0||++this.failsNoPicture<3||!fa())return!1;let e=new ba(this.onProblem,this.latency,this.onNeedKey);e.setHevc(this.hevc),e.markProblemShown(),this.mse=e;let t=this.video;this.video=null;try{t?.close()}catch{}return this.canvas.style&&(this.canvas.style.display=`none`),this.wrap?.append(e.element),this.header&&e.onMessage(new Uint8Array([0,...this.header]).buffer),this.onNeedKey?.(),!0}startSound(){this.soundOn=!0,la(),this.mseSound?this.mseSound.start():this.openContext()}openContext(){try{if(!this.actx){let e=new AudioContext({latencyHint:`interactive`});this.actx=e,e.onstatechange=()=>{this.actx===e&&e.state!==`running`&&e.state!==`closed`&&this.armResume()}}this.actx.resume().catch(()=>{})}catch{this.onSoundFail?.()}}get sound(){return this.soundOn}setMuted(e){this.muted=e,this.mseSound?.setMuted(e)}resumeSound(){if(!this.soundOn)return;if(this.mseSound)return this.mseSound.resume();let e=this.actx;e&&e.state!==`running`&&e.state!==`closed`&&(this.clock.reset(),e.resume().catch(()=>{}),this.armResume())}get soundStats(){return{decoded:this.pipe?.decoded??0,concealed:this.pipe?.concealed??0,underruns:this.clock.underruns,dropped:this.clock.dropped,cushionMs:Math.round(this.clock.cushion*1e3)}}armResume(){if(this.unarm||typeof window>`u`||!window.addEventListener)return;let e=()=>{let e=this.actx;if(!e||e.state===`closed`)return this.unarm?.();this.clock.reset(),e.resume().then(()=>{e.state===`running`&&this.unarm?.()}).catch(()=>{})};for(let t of sa)window.addEventListener(t,e,!0);this.unarm=()=>{for(let t of sa)window.removeEventListener(t,e,!0);this.unarm=null}}onMessage(e){let t=new Uint8Array(e);if(t.length<1||this.stopped)return;let n=t[0],r=t.subarray(1);if(this.mse&&(n===0||n===1))return n===0&&(this.header=r.slice()),this.mse.onMessage(e);n===0?this.openVideo(r.slice()):n===1?this.onVideo(r):n===3?this.openAudio(r.slice()):n===4&&this.onAudio(r)}async openVideo(e){if(this.header=e,this.spsRect=qr(e,this.hevc),!this.opening){this.opening=!0;try{let t=this.hevc?await xa(e):Oi(e);if(this.mse||this.stopped)return;if(!t){this.problemShown=!0,this.onProblem(`no_hevc`);return}this.ownStats.codec=t;let n=this.hevc?void 0:Vi(e)??void 0;try{this.video?.close()}catch{}let r=new VideoDecoder({output:e=>{let t=this.realVisible(e),n=this.canvas;(n.width!==t.displayWidth||n.height!==t.displayHeight)&&(n.width=t.displayWidth,n.height=t.displayHeight),this.ctx?.drawImage(t,0,0,n.width,n.height),this.ownStats.drawn(!0),t.close(),this.problemShown&&(this.problemShown=!1,this.onProblem(null))},error:()=>{this.video===r&&(this.problemShown=!0,this.onProblem(`decode`),this.decodeFailed()||this.rebuild())}}),i={codec:t,optimizeForLatency:!0};n&&(i.description=n),this.software&&(i.hardwareAcceleration=`prefer-software`),r.configure(i),this.video=r,this.sawKey=!1}catch{this.problemShown=!0,this.onProblem(`decode`),this.decodeFailed()}finally{this.opening=!1}}}realVisible(e){let t=this.spsRect,n=Jr(e,t);if(n)try{let t=new VideoFrame(e,{visibleRect:{x:n.x,y:n.y,width:n.w,height:n.h},displayWidth:n.w,displayHeight:n.h});return e.close(),t}catch{return e}let r=e.visibleRect;if(t&&r&&!this.software&&(r.width{if(this.video===e){try{e?.close()}catch{}this.rebuild(),this.onNeedKey?.()}})}return e}rebuild(){this.mse||this.stopped||(this.video=null,this.sawKey=!1,this.header&&this.openVideo(this.header).then(()=>this.keyAsk.waiting()))}onVideo(e){let t=this.video;if(t?.state===`closed`){this.opening||this.rebuild();return}if(!t||t.state!==`configured`)return;let n=Di(e,this.hevc);if(this.ownStats.arrived(),!this.sawKey&&!n)return this.ownStats.drop(),this.keyAsk.waiting();if(!n&&t.decodeQueueSize>qi[this.latency])return this.sawKey=!1,this.ownStats.drop(),this.keyAsk.waiting();this.sawKey=!0;let r=e;this.hevc?n&&this.header&&(r=new Uint8Array(this.header.length+e.length),r.set(this.header,0),r.set(e,this.header.length)):r=Li(e,!1,!0),this.ts+=16667,this.ownStats.decoding(),t.decode(new EncodedVideoChunk({type:n?`key`:`delta`,timestamp:this.ts,data:r}))}openAudio(e){if(e.length<6)return;let t=++this.audioGen;if(this.pipe?.reset(),this.pipe=null,this.clock.reset(),this.audioHeader=e,this.mseSound)return this.mseSound.setHeader(e);let n=e[0];aa(new DataView(e.buffer,e.byteOffset,e.byteLength).getUint32(2),n).then(n=>{if(t!==this.audioGen)return;if(!n)return N()?this.soundThroughMse(e):this.soundThroughWasm(e);let r=new Qr((e,t)=>this.play(e,t,r.sampleRate));try{r.header(ta(e)),this.pipe=r}catch{this.soundThroughMse(e)}})}soundThroughMse(e){this.pipe=null,this.mseSound||(this.mseSound=new P(this.latency,()=>this.mseSoundFailed()),this.soundOn&&this.mseSound.start()),this.mseSound.setHeader(e)}soundThroughWasm(e){this.pipe?.reset(),this.soundWasm=!0;let t=new Qr((e,n)=>this.play(e,n,t.sampleRate),Ei,()=>{this.pipe===t&&(this.pipe=null),this.onSoundFail?.()});this.pipe=t,t.header(ta(e))}mseSoundFailed(){let e=this.mseSound;e&&(this.mseSound=null,e.stop(),this.soundOn&&(this.openContext(),this.actx&&this.actx.state!==`running`&&this.armResume()),this.audioHeader&&this.soundThroughWasm(this.audioHeader))}onAudio(e){if(this.mseSound)return this.mseSound.frame(e);this.soundOn&&this.pipe&&this.pipe.packet(e)}play(e,t,n){let r=this.actx;if(!r||r.state!==`running`||!e.length)return;let i=e[0].length,a=this.clock.at(r.currentTime,i/n);if(a===null)return;let o=r.createBuffer(e.length,i,n),s=this.muted?0:t;e.forEach((e,t)=>o.copyToChannel(s===1?e:e.map(e=>e*s),t));let c=r.createBufferSource();c.buffer=o,c.connect(r.destination),c.start(a)}stop(){this.stopped=!0;try{this.video?.close()}catch{}this.mse?.stop(),this.audioGen++,this.pipe?.reset(),this.pipe=null,this.unarm?.(),this.actx?.close().catch(()=>{}),this.mseSound?.stop()}};function la(){try{let e=navigator.audioSession;e&&e.type!==`playback`&&(e.type=`playback`)}catch{}}function ua(e,t){try{return e.isTypeSupported(t)}catch{return!1}}function N(){let e=typeof window>`u`?null:fa();return!!e&&(ua(e,`audio/mp4; codecs="Opus"`)||ua(e,`audio/mp4; codecs="opus"`))}var P=class{constructor(e,t,n=document.createElement(`audio`)){this.onFail=t,this.header=null,this.time=0,this.on=!1,this.failed=!1,this.order=new ea,this.el=n,this.track=new ga(n,()=>this.fail(),e===`player`?Yi:e)}get playing(){return this.on&&!this.failed}report(){return{snd:`mse`,snd_jumps:this.track.seeks}}setHeader(e){this.header=e,this.on&&this.open()}start(){if(!this.on&&(this.on=!0,this.header&&this.open(),!this.failed))try{this.el.play()?.catch?.(()=>{})}catch{}}frame(e){if(!this.on||this.failed||!this.track.ready&&!this.track.backlog)return;let t=$i(e);if(!t||!this.order.take(t.index))return;let n=Ki(this.track.nextSeq(),this.time,t.packet);this.time+=Gi(t.packet),this.track.push(n)}setMuted(e){this.el.muted=e}resume(){if(this.playing&&this.el.paused)try{this.el.play()?.catch?.(()=>{})}catch{}}stop(){this.on=!1,this.track.close()}open(){let e=this.header;if(!e||e.length<6||this.failed)return;let t=e[0],n=Wi(t,new DataView(e.buffer,e.byteOffset,e.byteLength).getUint32(2));this.track.open(`audio/mp4; codecs="Opus"`,n)||this.track.open(`audio/mp4; codecs="opus"`,n)?(this.time=0,this.order.reset()):this.fail()}fail(){this.failed||(this.failed=!0,this.onFail())}},da=class{constructor(e,t,n=Ei){this.onFail=t,this.codecs=n,this.actx=null,this.pipe=null,this.header=null,this.on=!1,this.failed=!1,this.muted=!1,this.unarm=null,this.played=!1,this.clock=new ra(e===`player`?.05:.08)}get playing(){return this.on&&!this.failed}get stats(){return{decoded:this.pipe?.decoded??0,concealed:this.pipe?.concealed??0,underruns:this.clock.underruns,dropped:this.clock.dropped}}start(){if(!this.failed){this.on=!0,la();try{if(!this.actx){let e=new AudioContext({latencyHint:`interactive`});this.actx=e,e.onstatechange=()=>{this.actx===e&&e.state!==`running`&&e.state!==`closed`&&this.armResume()}}this.actx.resume().catch(()=>{}),this.actx.state!==`running`&&this.armResume()}catch{return this.fail()}this.header&&!this.pipe&&this.open()}}setHeader(e){e.length<6||(this.header=e,this.pipe?.reset(),this.pipe=null,this.clock.reset(),this.on&&this.open())}frame(e){this.on&&!this.failed&&this.pipe?.packet(e)}setMuted(e){this.muted=e}resume(){let e=this.actx;this.playing&&e&&e.state!==`running`&&e.state!==`closed`&&(this.clock.reset(),e.resume().catch(()=>{}),this.armResume())}stop(){this.on=!1,this.pipe?.reset(),this.pipe=null,this.unarm?.(),this.actx?.close().catch(()=>{}),this.actx=null}open(){let e=this.header;if(!e||this.failed)return;let t=new Qr((e,n)=>this.play(e,n,t.sampleRate),this.codecs,()=>{this.pipe===t&&this.fail()});this.pipe=t,t.header(ta(e))}play(e,t,n){let r=this.actx;if(!r||r.state!==`running`||!e.length)return;let i=e[0].length,a=this.clock.at(r.currentTime,i/n);if(a===null)return;let o=r.createBuffer(e.length,i,n),s=this.muted?0:t;e.forEach((e,t)=>o.copyToChannel(s===1?e:e.map(e=>e*s),t));let c=r.createBufferSource();c.buffer=o,c.connect(r.destination),c.start(a),this.played=!0}armResume(){if(this.unarm||typeof window>`u`||!window.addEventListener)return;let e=()=>{let e=this.actx;if(!e||e.state===`closed`)return this.unarm?.();this.clock.reset(),e.resume().then(()=>{e.state===`running`&&this.unarm?.()}).catch(()=>{})};for(let t of sa)window.addEventListener(t,e,!0);this.unarm=()=>{for(let t of sa)window.removeEventListener(t,e,!0);this.unarm=null}}fail(){this.failed||(this.failed=!0,this.stop(),this.onFail())}};function fa(){let e=window;return e.ManagedMediaSource??e.MediaSource??null}var pa=10,ma=3;function ha(e,t,n,r=ma){let i=null;for(let a of e)a>t&&a<=n-r&&(i=a);return i}var ga=class{constructor(e,t,n=`watch`,r,i=()=>performance.now()){this.el=e,this.onError=t,this.latency=n,this.onNeedKey=r,this.now=i,this.ms=null,this.sb=null,this.queue=[],this.mime=``,this.seq=1,this.ready=!1,this.dropped=!1,this.keys=null,this.seeks=0,this.maxLagS=0,this.fromZero=0,this.trims=0,this.lastJump=null,this.trimAt=-1,this.trimFrom=-1,this.keyAt=-1,this.attached=null,r&&(this.keys=[])}setEdge(e){this.latency=e}markKey(e){this.keys?.push(e),this.keyAt=this.now()}open(e,t){let n=fa();if(!n||!ua(n,e))return!1;this.close();let r=new n;return this.ms=r,this.mime=e,this.queue=[t],this.seq=1,this.ready=!1,this.keys&&=[],r.addEventListener(`sourceopen`,()=>{if(this.ms===r)try{let e=r.addSourceBuffer(this.mime);e.mode=`segments`,e.addEventListener(`updateend`,()=>this.pump()),e.addEventListener(`error`,()=>this.onError()),this.sb=e,this.ready=!0,this.pump()}catch{this.onError()}}),`ManagedMediaSource`in window&&n===window.ManagedMediaSource&&(this.el.disableRemotePlayback=!0),this.attached=_a(this.el,r),!0}nextSeq(){return this.seq++}get backlog(){return this.queue.length}push(e){this.queue.push(e),this.pump()}pump(){let e=this.sb;if(!e||e.updating||!this.ready)return;let t=this.el;if(e.buffered.length){let n=e.buffered.end(e.buffered.length-1),r=e.buffered.start(0),i=n-t.currentTime,a=Xi(i,n,this.latency);if(a.seekTo!==null){this.seeks++,this.maxLagS=Math.max(this.maxLagS,i);let o=this.now(),s=e=>e<0?-1:Math.round(o-e);t.currentTime<.05&&r>1&&this.fromZero++,this.lastJump={at:t.currentTime,start:r,end:n,ranges:e.buffered.length,readyState:t.readyState,paused:t.paused,seeking:t.seeking,sinceTrimMs:s(this.trimAt),trimFrom:this.trimFrom,sinceKeyMs:s(this.keyAt)},t.currentTime=Math.max(r,a.seekTo)}if(t.playbackRate!==a.rate&&(t.playbackRate=a.rate),t.currentTime-r>pa&&this.trim(e,r))return}let n=this.queue.shift();if(n){try{e.appendBuffer(n)}catch{this.dropped=!0}t.paused&&t.play().catch(()=>{})}}trim(e,t){let n=this.el.currentTime,r=n-ma;if(this.keys){if(r=ha(this.keys,t,n),r===null)return(this.keys[this.keys.length-1]??-1/0)<=n-ma&&this.onNeedKey?.(),!1;let e=r;this.keys=this.keys.filter(t=>t>=e),r-=.001}try{return e.remove(t,r),this.trims++,this.trimAt=this.now(),this.trimFrom=n,!0}catch{return!1}}close(){this.ready=!1,this.sb=null,this.queue=[];let e=this.ms;if(this.ms=null,e&&e.readyState===`open`)try{e.endOfStream()}catch{}if(this.attached===`object`)try{this.el.srcObject=null}catch{}this.attached=null,this.el.src?.startsWith(`blob:`)&&URL.revokeObjectURL(this.el.src),this.el.removeAttribute(`src`)}};function _a(e,t){if(`srcObject`in e)try{return e.srcObject=t,`object`}catch{}return e.src=URL.createObjectURL(t),`url`}var va=1e4,ya=class{constructor(e=3,t=va,n=()=>performance.now()){this.max=e,this.windowMs=t,this.now=n,this.at=[]}fail(){let e=this.now();return this.at=this.at.filter(t=>e-t=this.max}clear(){this.at=[]}},ba=class{constructor(e,t=`watch`,n,r){this.onProblem=e,this.latency=t,this.wasm=null,this.audioHeader=null,this.muted=!1,this.gaveUp=!1,this.reopening=!1,this.failedWhileOpening=!1,this.wrap=document.createElement(`div`),this.hevc=!1,this.header=null,this.sawKey=!1,this.stats=new oa(`mse`),this.problemShown=!1,this.vTime=0,this.vLast=0,this.soundOn=!1,this.onSoundFail=null,this.onGiveUp=null,this.keyAsk=new Qi(n),this.fails=new ya(3,va,r);let i=document.createElement(`video`);i.muted=!0,i.autoplay=!0,i.playsInline=!0,i.className=`block h-full w-full object-contain`,i.dataset.testid=`watch-video`,this.audio=new P(t,()=>this.soundThroughWasm()),this.wrap.className=`h-full w-full`,this.wrap.append(i,this.audio.el),this.video=new ga(i,()=>this.showProblem(),t,()=>this.keyAsk.waiting()),i.addEventListener(`error`,()=>this.restartVideo()),i.addEventListener(`playing`,()=>{this.fails.clear(),this.problemShown&&(this.problemShown=!1,this.onProblem(null))})}markProblemShown(){this.problemShown=!0}showProblem(){this.problemShown||(this.problemShown=!0,this.onProblem(`decode`))}restartVideo(){if(this.gaveUp)return;if(this.reopening){this.failedWhileOpening=!0;return}if(this.showProblem(),this.fails.fail()){this.gaveUp=!0,this.video.close(),this.onGiveUp?.();return}let e=this.header;if(e){this.header=null,this.reopening=!0,this.failedWhileOpening=!1;try{this.openVideo(e)}finally{this.reopening=!1}this.sawKey=!1,this.keyAsk.waiting(),this.failedWhileOpening&&(this.failedWhileOpening=!1,this.restartVideo())}}get failed(){return this.gaveUp}setVideoEdge(e){this.video.setEdge(e)}get videoSeeks(){return{seeks:this.video.seeks,maxLagMs:Math.round(this.video.maxLagS*1e3),fromZero:this.video.fromZero,trims:this.video.trims,lastJump:this.video.lastJump}}get element(){return this.wrap}resume(){let e=this.video.el;e.paused&&e.play()?.catch?.(()=>{})}setHevc(e){this.hevc=e}startSound(){if(this.soundOn=!0,this.wasm)return this.wasm.start();if(!N())return this.soundThroughWasm();this.audio.start()}soundThroughWasm(){if(this.wasm)return;this.audio.stop();let e=new da(this.latency,()=>this.onSoundFail?.());this.wasm=e,e.setMuted(this.muted),this.audioHeader&&e.setHeader(this.audioHeader),this.soundOn&&e.start()}resumeSound(){this.soundOn&&(this.wasm?this.wasm.resume():this.audio.resume())}setMuted(e){this.muted=e,this.audio.setMuted(e),this.wasm?.setMuted(e)}soundReport(){return this.soundOn?this.wasm?na(`wasm`,this.wasm.stats):this.audio.report():null}get soundPlaying(){return this.wasm?this.wasm.played:this.audio.playing}get sound(){return this.soundOn}onMessage(e){let t=new Uint8Array(e);if(t.length<1)return;let n=t[0],r=t.subarray(1);n===0?this.openVideo(r.slice()):n===1?this.onVideo(r):n===3?(this.audioHeader=r.slice(),(this.wasm??this.audio).setHeader(this.audioHeader)):n===4&&(this.wasm??this.audio).frame(r)}openVideo(e){let t=!!this.header&&this.header.length===e.length&&this.header.every((t,n)=>t===e[n]);if(t&&this.video.ready)return;if(this.gaveUp){if(t)return;this.gaveUp=!1,this.fails.clear()}this.header=e;let n=qr(e,this.hevc)??{w:1920,h:1080},r=Hi(e,this.hevc,n);r&&(this.stats.codec=/codecs="([^"]+)"/.exec(r.mime)?.[1]??``,this.video.open(r.mime,r.init)?(this.sawKey=!1,this.vTime=0,this.vLast=0):(this.problemShown=!0,this.onProblem(this.hevc?`no_hevc`:`decode`)))}onVideo(e){if(!this.video.ready&&!this.video.backlog)return;let t=Di(e,this.hevc);if(this.video.dropped&&(this.video.dropped=!1,this.sawKey=!1),this.stats.arrived(),!this.sawKey&&!t)return this.stats.drop(),this.keyAsk.waiting();if(!t&&this.video.backlog>qi[this.latency])return this.sawKey=!1,this.stats.drop(),this.keyAsk.waiting();this.sawKey=!0,this.stats.drawn();let n=performance.now(),r=this.vLast?Math.min(9e3,Math.max(750,Math.round((n-this.vLast)*90))):1500;this.vLast=n,t&&this.video.markKey(this.vTime/9e4),this.video.push(Ui(this.video.nextSeq(),this.vTime,r,e,this.hevc,t)),this.vTime+=r}stop(){this.video.close(),this.audio.stop(),this.wasm?.stop()}};async function xa(e){let t=Yr(e);if(t&&typeof VideoDecoder<`u`)try{if((await VideoDecoder.isConfigSupported({codec:t,codedWidth:1920,codedHeight:1080})).supported)return t}catch{}return Ai(1920,1080)}var F={CROSS:1,CIRCLE:2,SQUARE:4,TRIANGLE:8,LEFT:16,RIGHT:32,UP:64,DOWN:128,L1:256,R1:512,L3:1024,R3:2048,OPTIONS:4096,SHARE:8192,TOUCHPAD:16384,PS:32768},Sa={buttons:0,l2:0,r2:0,lx:0,ly:0,rx:0,ry:0};function Ca(e,t){let n=e=>Math.max(0,Math.min(1,e));return[Math.round(n(e)*1919),Math.round(n(t)*941)]}F.UP,F.DOWN,F.LEFT,F.RIGHT,F.CROSS,F.CROSS,F.CIRCLE,F.CIRCLE,F.SQUARE,F.TRIANGLE,F.L1,F.R1,F.L3,F.R3,F.OPTIONS,F.SHARE,F.PS,F.TOUCHPAD,F.UP,F.DOWN,F.LEFT,F.RIGHT,F.CROSS,F.CIRCLE,F.SQUARE,F.TRIANGLE,F.L1,F.R1,F.L3,F.R3,F.OPTIONS,F.SHARE,F.PS,F.TOUCHPAD;var wa=e=>Math.max(-32768,Math.min(32767,Math.round(e))),Ta=[F.CROSS,F.CIRCLE,F.SQUARE,F.TRIANGLE,F.L1,F.R1,0,0,F.SHARE,F.OPTIONS,F.L3,F.R3,F.UP,F.DOWN,F.LEFT,F.RIGHT,F.PS,F.TOUCHPAD];function Ea(e){return Math.abs(e)<=1.01?Math.round((e+1)*3.5)%8:null}var Da=[0,1,1,1,0,-1,-1,-1],Oa=[-1,-1,0,1,1,1,0,-1];function ka(e,t){let n=e.axes[t.a]??0;if(t.hat){let e=Ea(n);return e===null?0:(t.hat===`x`?Da:Oa)[e]}return t.inv?-n:n}var Aa={buttons:Ta.flatMap((e,t)=>e?[[e,{b:t}]]:[]),l2:{b:6},r2:{b:7},lx:{a:0},ly:{a:1},rx:{a:2},ry:{a:3}};function ja(e,t,n=!1){if(`b`in t){let r=e.buttons[t.b];return r?n&&r.value>0?Math.min(1,r.value):Math.max(+!!r.pressed,r.value):0}if(`h`in t){let n=Ea(e.axes[t.h]??9);if(n===null)return 0;let r=(n-t.at+8)%8;return+(r===0||r===1||r===7)}let r=e.axes[t.a];if(r===void 0)return 0;let i=t.rest??0;return Math.min(1,Math.max(0,(r-i)/(t.d-i)))}function Ma(e){if(e.mapping===`standard`)return Aa;let t=Na.get(e.id);if(t)return t;let n=e.axes.findIndex(e=>Math.abs(e)>1.05);if(n<0)return Aa;let r={...Aa,buttons:[...Aa.buttons,[F.UP,{h:n,at:0}],[F.RIGHT,{h:n,at:2}],[F.DOWN,{h:n,at:4}],[F.LEFT,{h:n,at:6}]]};return Na.set(e.id,r),r}var Na=new Map;function Pa(e,t=Ma){let n={...Sa},r=e=>Math.abs(e)<.08?0:wa(e*32767),i=(e,t)=>Math.abs(t)>Math.abs(e)?t:e,a=(e,t)=>t?r(ka(e,t)):0;for(let r of e){if(!r||!r.connected)continue;let e=t(r);for(let[t,i]of e.buttons)ja(r,i)>.5&&(n.buttons|=t);e.l2&&(n.l2=Math.max(n.l2,Math.round(ja(r,e.l2,!0)*255))),e.r2&&(n.r2=Math.max(n.r2,Math.round(ja(r,e.r2,!0)*255))),n.lx=i(n.lx,a(r,e.lx)),n.ly=i(n.ly,a(r,e.ly)),n.rx=i(n.rx,a(r,e.rx)),n.ry=i(n.ry,a(r,e.ry))}return n}function Fa(e,t){return{buttons:e.buttons|t.buttons,l2:Math.max(e.l2,t.l2),r2:Math.max(e.r2,t.r2),lx:wa(e.lx+t.lx),ly:wa(e.ly+t.ly),rx:wa(e.rx+t.rx),ry:wa(e.ry+t.ry),touch:e.touch??t.touch??null,motion:e.motion??t.motion??null}}var I=e=>e.toLowerCase().padStart(4,`0`);function Ia(e){let t=/^(.*?)\s*\((?:[^()]*?\s)?Vendor:\s*([0-9a-f]{1,4})\s+Product:\s*([0-9a-f]{1,4})\s*\)\s*$/i.exec(e);if(t)return{vendor:I(t[2]),product:I(t[3]),name:t[1].trim()};let n=/^([0-9a-f]{1,4})-([0-9a-f]{1,4})-(.*)$/i.exec(e.trim());return n?{vendor:I(n[1]),product:I(n[2]),name:n[3].trim()}:null}function La(e=globalThis.navigator){let t=e?.userAgent??``;return/Android|iPhone|iPad|iPod/i.test(t)?null:/Macintosh|Mac OS X/i.test(t)?(e?.maxTouchPoints??0)>1?null:`m`:/Windows/i.test(t)?`w`:/Linux|CrOS|X11/i.test(t)?`l`:null}function Ra(e,t){if(!t)return null;let n=t===`l`?[`l`]:[`m`,`w`];for(let t of n){let n=Ge[`${t}${e.vendor}${e.product}`];if(n!==void 0)return We[n]??null}return null}var za={1:0,2:2,4:4,8:6};function Ba(e){let t=0,n=!1;for(let r of e){let e=/a(\d+)/.exec(r);e&&(t=Math.max(t,Number(e[1])+1)),r.startsWith(`h`)&&(n=!0)}return{n:t,hat:n}}function Va(e,t,n){let{n:r,hat:i}=Ba(t),a=Ta.length,o=e.axes.findIndex(e=>Math.abs(e)>1.05),s=e=>e;if(i&&o<0)return n===`l`&&e.axes.length>=r+2?{hat:-1,hatXY:r,axis:s}:null;if(!(i?o>r:n!==`l`&&e.axes.length>=r+2))return{hat:o,hatXY:-1,axis:s};if(r<=4)return{hat:o,hatXY:-1,axis:e=>[0,1,2,5][e]??e};let c=t[a+2]?.replace(`~`,``)===`a2`&&t[a+3]?.replace(`~`,``)===`a3`,l=[t[6],t[7]].every(e=>/^a[45]~?$/.test(e??``));return r===6&&c&&l?{hat:o,hatXY:-1,axis:e=>[0,1,2,5,3,4][e]??e}:{hat:o,hatXY:-1,axis:s}}function Ha(e,t){let n=/^b(\d+)$/.exec(e);if(n)return{b:Number(n[1])};if(n=/^([+-]?)a(\d+)(~?)$/.exec(e),n){let e=t.axis(Number(n[2]));return n[1]===`+`?{a:e,d:1}:n[1]===`-`?{a:e,d:-1}:n[3]?{a:e,d:-1,rest:1}:{a:e,d:1,rest:-1}}if(n=/^h0\.(\d)$/.exec(e),n){let e=za[n[1]];if(e===void 0)return null;if(t.hat>=0)return{h:t.hat,at:e};if(t.hatXY>=0)return e===0?{a:t.hatXY+1,d:-1}:e===4?{a:t.hatXY+1,d:1}:e===6?{a:t.hatXY,d:-1}:{a:t.hatXY,d:1}}return null}function Ua(e,t){let n=/^a(\d+)(~?)$/.exec(e);if(n)return n[2]?{a:t.axis(Number(n[1])),inv:!0}:{a:t.axis(Number(n[1]))};if(e===`hx`||e===`hy`){if(t.hat>=0)return{a:t.hat,hat:e===`hx`?`x`:`y`};if(t.hatXY>=0)return{a:t.hatXY+ +(e===`hy`)}}return null}function Wa(e,t,n){let r=e.split(`,`),i=Va(t,r,n);if(!i)return null;let a={buttons:[],l2:null,r2:null,lx:null,ly:null,rx:null,ry:null};for(let e=0;eArray.isArray(e)&&e.length===2&&typeof e[0]==`number`&&Ja(e[1]))&&[t.l2,t.r2,t.lx,t.ly,t.rx,t.ry].every(Ja)}function Xa(){try{let e=yt(qa),t=e?JSON.parse(e):null;return!t||typeof t!=`object`||Array.isArray(t)?{}:Object.fromEntries(Object.entries(t).filter(e=>Ya(e[1])))}catch{return{}}}function Za(e,t){let n=Xa();return t?n[e]=t:delete n[e],vt(qa,JSON.stringify(n)),Qa=n,n}var Qa=null;function $a(e){return Qa??=Xa(),Qa[e.id]??eo(Qa,e.id)??Ka(e)??Ma(e)}function eo(e,t){if(!t.endsWith(` (app)`))return null;let n=t.slice(0,-6).trim().toLowerCase();if(!n)return null;let r=Object.keys(e).filter(e=>{let t=e.trim().toLowerCase();return t===n||t.includes(n)}),i=r.find(e=>e.trim().toLowerCase()===n)??(r.length===1?r[0]:null);return i?(Qa=Za(t,e[i]),e[i]):null}[{kind:`button`,bit:F.CROSS,name:`✕`},{kind:`button`,bit:F.CIRCLE,name:`○`},{kind:`button`,bit:F.SQUARE,name:`□`},{kind:`button`,bit:F.TRIANGLE,name:`△`},{kind:`button`,bit:F.UP,name:`↑`},{kind:`button`,bit:F.DOWN,name:`↓`},{kind:`button`,bit:F.LEFT,name:`←`},{kind:`button`,bit:F.RIGHT,name:`→`},{kind:`button`,bit:F.L1,name:`L1`},{kind:`button`,bit:F.R1,name:`R1`},{kind:`trigger`,which:`l2`,name:`L2`},{kind:`trigger`,which:`r2`,name:`R2`},{kind:`button`,bit:F.L3,name:`L3`},{kind:`button`,bit:F.R3,name:`R3`},{kind:`button`,bit:F.OPTIONS,name:`Options`},{kind:`button`,bit:F.SHARE,name:`Create`},{kind:`button`,bit:F.PS,name:`PS`},{kind:`button`,bit:F.TOUCHPAD,name:`Touchpad`},{kind:`axis`,which:`lx`,name:`L →`},{kind:`axis`,which:`ly`,name:`L ↓`},{kind:`axis`,which:`rx`,name:`R →`},{kind:`axis`,which:`ry`,name:`R ↓`}].filter(e=>e.kind!==`button`||![F.L3,F.R3,F.OPTIONS,F.SHARE,F.PS,F.TOUCHPAD].includes(e.bit));var to=12e4;function no(e){let t;try{t=JSON.parse(e)}catch{return null}return Array.isArray(t.rumble)?{rumble:[Number(t.rumble[0])||0,Number(t.rumble[1])||0]}:Array.isArray(t.light)?{light:t.light}:t.stage===`asking`?{kind:`asking`}:t.stage===`refused`?{kind:`refused`,why:String(t.why??``)}:t.stage===`joined`?{kind:`joined`,host:t.session?.host??null,playing:!!t.session?.playing,passcode:!!t.session?.passcode}:null}function ro(e,t){return e.buttons===t.buttons&&e.l2===t.l2&&e.r2===t.r2&&e.lx===t.lx&&e.ly===t.ly&&e.rx===t.rx&&e.ry===t.ry&&(e.touch?.[0]??-1)===(t.touch?.[0]??-1)&&(e.touch?.[1]??-1)===(t.touch?.[1]??-1)&&(e.motion?.t??-1)===(t.motion?.t??-1)}var io=class{constructor(e){this.o=e,this.ws=null,this.last={...Sa},this.lastSent=0,this.raf=0,this.keepalive=null,this.watchdog=null,this.retry=null,this.done=!1,this.stage={kind:`connecting`},this.wasIn=!1,this.attempt=0,this.deadline=0,this.lastHeard=0,this.control=!1,this.neutral=!1,this.now=e.now??(()=>Date.now()),this.WS=e.WebSocketImpl??WebSocket}get currentStage(){return this.stage}setStage(e){this.stage=e,this.o.onStage(e)}start(){if(this.done=!1,this.setStage({kind:`connecting`}),this.connect(),this.done)return;let e=this.o.raf??(e=>window.requestAnimationFrame(e)),t=()=>{this.send(!1),this.raf=e(t)};this.raf=e(t),this.keepalive=setInterval(()=>this.send(!1),250),this.watchdog=setInterval(()=>this.checkSilence(),1e3)}connect(){let e;this.lastHeard=this.now();try{e=new this.WS(this.o.url)}catch{this.dropped();return}this.ws=e,e.binaryType=`arraybuffer`,this.control=!this.o.watch,this.o.watch&&this.o.watch.onControl(!1),e.onmessage=t=>{this.ws===e&&(this.lastHeard=this.now(),this.onMessage(t.data))},e.onclose=t=>{if(this.ws!==e)return;this.ws=null;let n=Le(t);n&&!this.wasIn?this.finish({kind:`refused`,why:`net:${n}`}):this.dropped()},e.onopen=()=>{this.ws===e&&(this.lastHeard=this.now(),this.o.hello&&e.send(JSON.stringify({hello:this.o.hello})),this.send(!0))}}onMessage(e){if(typeof e!=`string`){e instanceof ArrayBuffer&&this.o.watch?.onFrame(e);return}if(this.o.hello&&e.startsWith(`{"rt":`))try{let t=JSON.parse(e);if(typeof t.rt==`string`&&/^[0-9a-f]{32}$/.test(t.rt)){this.o.hello.rt=t.rt,this.o.onReconnectToken?.(t.rt);return}}catch{}if(e.includes(`"kbm_caps"`))try{let t=JSON.parse(e);if(t.kbm_caps){let e=t.kbm_caps;this.o.onKbmCaps?.({mouse:e.mouse===!0,keyboard:e.keyboard===!0,reason:typeof e.reason==`string`?e.reason:null});return}}catch{}if(this.o.watch)try{let t=JSON.parse(e);if(t.watch&&this.o.watch.onCodec(!!t.watch.hevc),typeof t.control==`boolean`){this.control=t.control,this.o.watch.onControl(t.control),t.control&&this.send(!0);return}}catch{}let t=no(e);if(t){if(`rumble`in t){let[e,n]=t.rumble;navigator.vibrate?.(e||n?250:0)}else if(`light`in t)this.o.onLight?.(t.light);else if(t.kind===`refused`)this.finish(t);else{if(t.kind===`joined`){let e=this.stage.kind!==`joined`;this.wasIn=!0,this.attempt=0,this.setStage(t),e&&this.send(!0);return}this.setStage(t)}}}dropped(){if(this.done)return;if(!this.wasIn||(this.stage.kind!==`reconnecting`&&(this.deadline=this.now()+to),this.now()>=this.deadline)){this.finish({kind:`lost`});return}let e=Re(this.attempt);this.setStage({kind:`reconnecting`,attempt:this.attempt}),this.attempt+=1,this.retry&&clearTimeout(this.retry),this.retry=setTimeout(()=>{this.retry=null,this.done||this.connect()},e)}checkSilence(){let e=this.ws;if(e&&!this.done&&(this.stage.kind===`joined`||this.stage.kind===`reconnecting`)&&!(this.now()-this.lastHeard<=3500)){this.ws=null;try{e.close()}catch{}this.dropped()}}wake(){this.stage.kind===`lost`&&this.wasIn?(this.attempt=0,this.start()):this.stage.kind===`reconnecting`&&(this.deadline=this.now()+to,this.attempt=0,this.retry&&(clearTimeout(this.retry),this.retry=null,this.connect()))}setNeutral(e){this.neutral!==e&&(this.neutral=e,this.send(!0))}current(){let e=Pa(Ue(typeof navigator>`u`?void 0:navigator),$a),t=this.o.touchPad();return{...Fa(e,t),touch:t.touch??null,motion:this.o.motion?.()??null}}send(e){let t=this.ws;if(!t||t.readyState!==this.WS.OPEN||!this.control)return;let n=this.neutral?{...Sa,touch:null,motion:null}:this.current(),r=this.now();!e&&ro(n,this.last)&&r-this.lastSent<250||(this.last=n,this.lastSent=r,t.send(JSON.stringify({pad:{...n,touch:n.touch??null,motion:n.motion??null},ka:1})))}askKeyframe(){let e=this.ws;e&&e.readyState===this.WS.OPEN&&e.send(JSON.stringify({keyframe:!0}))}sendKbm(e){let t=this.ws;return!t||t.readyState!==this.WS.OPEN||!this.control?!1:(t.send(e instanceof Uint8Array?e:JSON.stringify(e)),!0)}sendPad(){this.send(!1)}clearTimers(){(this.o.cancelRaf??(e=>window.cancelAnimationFrame(e)))(this.raf),this.keepalive&&clearInterval(this.keepalive),this.watchdog&&clearInterval(this.watchdog),this.retry&&clearTimeout(this.retry),this.keepalive=this.watchdog=this.retry=null}finish(e){this.done=!0,this.clearTimers();let t=this.ws;this.ws=null;try{t?.close()}catch{}this.setStage(e)}stop(){this.done=!0,this.clearTimers();let e=this.ws;this.ws=null,e&&e.readyState===this.WS.OPEN&&e.send(JSON.stringify({pad:{...Sa,touch:null}})),e?.close()}},ao=`ps5upload.pad.device`;function oo(e,t=e=>crypto.getRandomValues(e)){let n=e.get(ao);if(n&&/^[0-9a-f]{32}$/.test(n))return n;let r=new Uint8Array(16);t(r);let i=Array.from(r,e=>e.toString(16).padStart(2,`0`)).join(``);return e.set(ao,i),i}var so=new Set,co={held:new Set,touch:null,touchPad:Sa,mapping:!1,get paused(){return so.size>0},motion:null},lo={s:.85,m:1,l:1.15},uo=.25;function fo(e){return typeof e!=`number`||!Number.isFinite(e)?1:Math.min(1,Math.max(uo,e))}var po={overlay:{width:844,height:390},deck:{width:390,height:480}},mo=.7,ho=1.4;function go(e,t,n,r){let i=lo[e]??1;if(!(t>0)||!(n>0))return i;let a=r?po.deck:po.overlay,o=Math.min(ho,Math.max(mo,Math.min(t/a.width,n/a.height)));return Math.round(o*i*1e3)/1e3}var _o=34;function vo(e,t){return t>0&&8+Math.max(112*e,90)+156*e+124*e+Math.max(56*e,44)+_o>t}function yo(e,t,n){let r=e/32767,i=t/32767,a=Math.hypot(r,i),o=a>1?1/a:1;return{dx:r*o*n,dy:i*o*n}}var bo=s((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),L=s(((e,t)=>{t.exports=bo()}))(),xo=`calc(50% + (env(safe-area-inset-left) - env(safe-area-inset-right)) / 2)`,So=32767,Co=12;function wo({stream:e,layout:t=`overlay`,opacity:n=1,size:r=`m`,deckTop:i=`0px`,onMenu:a}){let o=Tn(),s=(0,T.useRef)(new Map),c=(0,T.useRef)({...Sa}),[l,u]=(0,T.useState)({...Sa}),[d,f]=(0,T.useState)({l:!1,r:!1,touchpad:!1}),p=(0,T.useRef)(null),[m,h]=(0,T.useState)({width:0,height:0});(0,T.useEffect)(()=>{let e=p.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect();h(e=>e.width===t.width&&e.height===t.height?e:{width:t.width,height:t.height})};if(t(),typeof ResizeObserver>`u`)return window.addEventListener(`resize`,t),()=>window.removeEventListener(`resize`,t);let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]),(0,T.useEffect)(()=>()=>{co.touchPad={...Sa}},[]);let g=()=>{let t={...Sa,touch:null},n={l:!1,r:!1,touchpad:!1};for(let e of s.current.values())e.kind===`stick`&&(n[e.which]=!0),e.kind===`touchpad`&&(n.touchpad=!0),e.kind===`button`&&(t.buttons|=e.bit),e.kind===`trigger`&&(t[e.which]=255),e.kind===`touchpad`&&e.pressed&&(t.buttons|=F.TOUCHPAD);t.lx=c.current.lx,t.ly=c.current.ly,t.rx=c.current.rx,t.ry=c.current.ry,t.touch=c.current.touch??null,co.touchPad=t,e?.sendPad(),u(t),f(e=>e.l===n.l&&e.r===n.r&&e.touchpad===n.touchpad?e:n)},_=(e,t,n)=>{let r=Math.max(-1,Math.min(1,(t-e.cx)/e.radius)),i=Math.max(-1,Math.min(1,(n-e.cy)/e.radius));c.current[e.which===`l`?`lx`:`rx`]=Math.round(r*So),c.current[e.which===`l`?`ly`:`ry`]=Math.round(i*So)},v=(e,t)=>{e.preventDefault(),e.stopPropagation();let n=e.currentTarget;try{n.setPointerCapture(e.pointerId)}catch{}let r=t(n);s.current.set(e.pointerId,r),r.kind===`stick`&&_(r,e.clientX,e.clientY),r.kind===`touchpad`&&(c.current.touch=Ca((e.clientX-r.rect.left)/r.rect.width,(e.clientY-r.rect.top)/r.rect.height)),navigator.vibrate?.(8),g()},y=e=>{let t=s.current.get(e.pointerId);if(t){if(e.stopPropagation(),t.kind===`stick`)_(t,e.clientX,e.clientY);else if(t.kind===`touchpad`)c.current.touch=Ca((e.clientX-t.rect.left)/t.rect.width,(e.clientY-t.rect.top)/t.rect.height),t.pressed&&Math.hypot(e.clientX-t.x0,e.clientY-t.y0)>Co&&(t.pressed=!1);else return;g()}},b=e=>{let t=s.current.get(e.pointerId);t&&(e.stopPropagation(),s.current.delete(e.pointerId),t.kind===`stick`&&(c.current[t.which===`l`?`lx`:`rx`]=0,c.current[t.which===`l`?`ly`:`ry`]=0),t.kind===`touchpad`&&(c.current.touch=null),g())},x=e=>e.stopPropagation(),S={onPointerMove:y,onPointerUp:b,onPointerCancel:b,onClick:x,onDoubleClick:x},ee=e=>(l.buttons&e)!==0,te=e=>`border-[1.5px] shadow-[0_0_3px_rgba(0,0,0,0.35)] transition-colors duration-75 ${e?`border-white bg-white/50`:`border-white/70 bg-white/10`}`,C=`text-white [text-shadow:0_1px_2px_rgba(0,0,0,0.6)]`,ne={filter:`drop-shadow(0 0 1.5px rgba(0,0,0,0.5))`},w=e=>({stroke:e?`#fff`:`rgba(255,255,255,0.75)`,fill:e?`rgba(255,255,255,0.5)`:`rgba(255,255,255,0.1)`}),re=`pointer-events-auto flex touch-none select-none items-center justify-center bg-transparent p-0`,ie={minHeight:`calc(44px / var(--k))`,minWidth:`calc(44px / var(--k))`},ae=(e,t,n,r)=>(0,L.jsx)(`button`,{type:`button`,"aria-label":e,onPointerDown:e=>v(e,()=>({kind:`button`,bit:t})),...S,className:`${re} ${n}`,style:ie,children:r}),oe=(e,t,n,r)=>(0,L.jsx)(`span`,{className:`flex h-[32px] w-[76px] items-center justify-center text-[13px] font-semibold tracking-wide ${C} ${te(t)}`,style:{borderRadius:r?n===`l`?`16px 9px 9px 9px`:`9px 16px 9px 9px`:`9px`},children:e}),se=(e,t,n,r)=>ae(e,t,`h-[44px] w-[84px]`,oe(e,ee(t),n,r)),ce=(e,t,n)=>(0,L.jsx)(`button`,{type:`button`,"aria-label":e,onPointerDown:e=>v(e,()=>({kind:`trigger`,which:t})),...S,className:`${re} h-[44px] w-[84px]`,style:ie,children:oe(e,l[t]>0,n,!0)}),le=(e,t,n)=>ae(e,t,`h-[52px] w-[52px]`,(0,L.jsx)(`svg`,{viewBox:`0 0 52 52`,width:`52`,height:`52`,"aria-hidden":!0,style:ne,children:(0,L.jsxs)(`g`,{transform:`rotate(${n} 26 26)`,strokeWidth:`1.5`,strokeLinejoin:`round`,...w(ee(t)),children:[(0,L.jsx)(`path`,{d:`M10 9 Q10 3 16 3 L36 3 Q42 3 42 9 L42 30 Q42 34.5 38.5 38 L29.5 47 Q26 50.5 22.5 47 L13.5 38 Q10 34.5 10 30 Z`}),(0,L.jsx)(`path`,{d:`M20.5 23 L26 17 L31.5 23`,fill:`none`,stroke:`#fff`,strokeLinecap:`round`,strokeWidth:`1.8`})]})})),ue=(e,t,n)=>ae(e,t,`h-[52px] w-[52px]`,(0,L.jsxs)(`svg`,{viewBox:`0 0 52 52`,width:`52`,height:`52`,"aria-hidden":!0,style:ne,children:[(0,L.jsx)(`circle`,{cx:`26`,cy:`26`,r:`22.5`,strokeWidth:`1.5`,...w(ee(t))}),(0,L.jsx)(`g`,{fill:`none`,stroke:`#fff`,strokeWidth:`1.8`,strokeLinejoin:`round`,strokeLinecap:`round`,children:n})]})),de=(e,t)=>ae(e,t,`h-[44px] min-w-[64px] px-[4px]`,(0,L.jsx)(`span`,{className:`flex h-[24px] items-center rounded-full px-[10px] text-[10px] font-semibold uppercase tracking-wider ${C} ${te(ee(t))}`,children:e})),fe=(e,t)=>ae(e,t,`h-[44px] w-[44px]`,(0,L.jsx)(`span`,{className:`flex h-[36px] w-[36px] items-center justify-center rounded-full text-[11px] font-bold ${C} ${te(ee(t))}`,children:e})),pe=e=>{let{dx:t,dy:n}=yo(e===`l`?l.lx:l.rx,e===`l`?l.ly:l.ry,34),r=d[e];return(0,L.jsx)(`div`,{"aria-label":e===`l`?o(`rp_touch_left_stick`,void 0,`Left stick`):o(`rp_touch_right_stick`,void 0,`Right stick`),onPointerDown:t=>v(t,t=>{let n=t.getBoundingClientRect();return{kind:`stick`,which:e,cx:n.left+n.width/2,cy:n.top+n.height/2,radius:n.width/2}}),...S,className:`pointer-events-auto relative h-[124px] w-[124px] touch-none rounded-full border-[1.5px] shadow-[0_0_3px_rgba(0,0,0,0.3)] transition-colors duration-75 ${r?`border-white/80 bg-white/[0.12]`:`border-white/45 bg-white/[0.05]`}`,children:(0,L.jsx)(`div`,{className:`absolute left-1/2 top-1/2 h-[54px] w-[54px] rounded-full ${te(r)}`,style:{transform:`translate(calc(-50% + ${t}px), calc(-50% + ${n}px))`}})})},E=t===`deck`,me=go(r,m.width,m.height,E),he=e=>`${e}px * var(--k)`,ge=`max(12px, env(safe-area-inset-left))`,ve=`max(12px, env(safe-area-inset-right))`,ye=`max(12px, env(safe-area-inset-bottom))`,be=E?`8px`:t===`overlay-bar`?`3.5rem`:`max(10px, env(safe-area-inset-top))`,xe=(e,t,n=0)=>t?n?`calc(${e} + max(${he(t)}, ${n}px))`:`calc(${e} + ${he(t)})`:e,Se=(e,t)=>({position:`absolute`,...t,transform:`scale(var(--k))`,transformOrigin:e}),Ce=E&&vo(me,m.height),D=E?void 0:`58%`,O=e=>E?{top:xe(be,Ce?96:112,Ce?72:90),[e]:e===`left`?ge:ve}:{top:D,translate:`0 -50%`,[e]:e===`left`?ge:ve},we=e=>({bottom:Ce?ye:xe(ye,E?56:0,44),[e]:Ce?`calc(${e===`left`?ge:ve} + 8px + max(${he(80)}, 44px))`:xe(e===`left`?ge:ve,E?40:168)}),Te=!!a&&!E;return(0,L.jsxs)(`div`,{ref:p,className:`pointer-events-none absolute z-10 select-none [-webkit-touch-callout:none] ${E?`inset-x-0 bottom-0`:`inset-0`}`,style:{top:E?i:void 0,"--k":me},"data-testid":`rp-touch`,"data-layout":t,"data-scale":me,onContextMenu:e=>e.preventDefault(),children:[(0,L.jsxs)(`div`,{className:`absolute inset-0`,style:{opacity:fo(n)},children:[(0,L.jsx)(`div`,{style:Se(`top left`,{top:be,left:ge}),children:(0,L.jsxs)(`div`,{className:`ms-[8px] flex flex-col`,style:{rotate:E?void 0:`6deg`,transformOrigin:`top left`},children:[ce(`L2`,`l2`,`l`),se(`L1`,F.L1,`l`,!1)]})}),(0,L.jsx)(`div`,{style:Se(`top right`,{top:be,right:ve}),children:(0,L.jsxs)(`div`,{className:`me-[8px] flex flex-col items-end`,style:{rotate:E?void 0:`-6deg`,transformOrigin:`top right`},children:[ce(`R2`,`r2`,`r`),se(`R1`,F.R1,`r`,!1)]})}),(0,L.jsx)(`div`,{"aria-label":o(`rp_touch_touchpad`,void 0,`Touchpad`),onPointerDown:e=>v(e,t=>({kind:`touchpad`,rect:t.getBoundingClientRect(),x0:e.clientX,y0:e.clientY,pressed:!0})),...S,className:`pointer-events-auto absolute touch-none rounded-2xl border-[1.5px] shadow-[0_0_3px_rgba(0,0,0,0.3)] transition-colors duration-75 ${d.touchpad?`border-white/80 bg-white/25`:`border-white/40 bg-white/[0.05]`}`,style:E?{top:xe(be,6),left:xe(ge,104),right:xe(ve,104),height:`max(44px, calc(${he(64)}))`}:{top:be,left:`50%`,translate:`-50% 0`,width:`min(calc(${he(250)}), 34vw)`,height:`max(44px, calc(${he(56)}))`}}),(0,L.jsxs)(`div`,{className:`grid grid-cols-3 grid-rows-3`,style:Se(E?`top left`:`left center`,O(`left`)),children:[(0,L.jsx)(`span`,{}),le(`↑`,F.UP,0),(0,L.jsx)(`span`,{}),le(`←`,F.LEFT,-90),(0,L.jsx)(`span`,{}),le(`→`,F.RIGHT,90),(0,L.jsx)(`span`,{}),le(`↓`,F.DOWN,180),(0,L.jsx)(`span`,{})]}),(0,L.jsxs)(`div`,{className:`grid grid-cols-3 grid-rows-3`,style:Se(E?`top right`:`right center`,O(`right`)),children:[(0,L.jsx)(`span`,{}),ue(`△`,F.TRIANGLE,(0,L.jsx)(`path`,{d:`M26 16.5 L35 32 L17 32 Z`})),(0,L.jsx)(`span`,{}),ue(`□`,F.SQUARE,(0,L.jsx)(`rect`,{x:`18`,y:`18`,width:`16`,height:`16`,rx:`1`})),(0,L.jsx)(`span`,{}),ue(`○`,F.CIRCLE,(0,L.jsx)(`circle`,{cx:`26`,cy:`26`,r:`8.5`})),(0,L.jsx)(`span`,{}),ue(`✕`,F.CROSS,(0,L.jsx)(`path`,{d:`M19 19 L33 33 M33 19 L19 33`})),(0,L.jsx)(`span`,{})]}),(0,L.jsx)(`div`,{style:Se(`bottom left`,we(`left`)),children:pe(`l`)}),(0,L.jsx)(`div`,{style:Se(`bottom right`,we(`right`)),children:pe(`r`)}),(0,L.jsx)(`div`,{style:Se(`bottom left`,{bottom:ye,left:ge}),children:de(`Create`,F.SHARE)}),(0,L.jsx)(`div`,{style:Se(`bottom right`,{bottom:ye,right:ve}),children:de(`Options`,F.OPTIONS)}),(0,L.jsx)(`div`,{style:Se(`bottom center`,{bottom:Ce?xe(ye,124,88):xe(ye,Te?48:0,48),left:xo,translate:`-50% 0`}),children:fe(`PS`,F.PS)})]}),Te&&(0,L.jsx)(`div`,{style:{...Se(`bottom center`,{bottom:ye,left:`calc(50% + (env(safe-area-inset-left) - env(safe-area-inset-right)) / 2)`,translate:`-50% 0`}),opacity:Math.max(.7,fo(n))},children:(0,L.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),a?.()},onDoubleClick:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),"aria-label":o(`rp_menu`,void 0,`Menu`),"aria-haspopup":`dialog`,className:`${re} h-[44px] w-[56px]`,style:ie,"data-testid":`rp-menu-handle`,children:(0,L.jsx)(`span`,{className:`flex h-[26px] w-[44px] items-center justify-center rounded-full ${C} ${te(!1)}`,children:(0,L.jsx)(_e,{size:15,strokeWidth:2,"aria-hidden":!0})})})})]})}var To=class{constructor(e,t=()=>1){this.sink=e,this.speed=t,this.fingers=new Map,this.most=0,this.moved=!1,this.gestureT0=0,this.lastTap=null,this.dragging=!1}down(e,t,n,r){if(!this.fingers.size){this.most=0,this.moved=!1,this.gestureT0=r;let e=this.lastTap;e&&r-e.t<=300&&Math.hypot(t-e.x,n-e.y)<=40&&(this.dragging=!0,this.sink.button(0,!0)),this.lastTap=null}this.fingers.set(e,{x:t,y:n,x0:t,y0:n,t0:r}),this.most=Math.max(this.most,this.fingers.size)}move(e,t,n){let r=this.fingers.get(e);if(!r)return;let i=t-r.x,a=n-r.y;if(r.x=t,r.y=n,!this.moved&&Math.hypot(t-r.x0,n-r.y0)>10&&(this.moved=!0),!this.moved)return;if(this.fingers.size>=2){if(this.dragging)return;let e=this.fingers.size;this.sink.scroll(-a/e,-i/e);return}if(this.most>=2)return;let o=this.speed();this.sink.move(i*o,a*o)}up(e,t){let n=this.fingers.get(e);if(!n||(this.fingers.delete(e),this.fingers.size))return;if(this.dragging){this.dragging=!1,this.sink.button(0,!1);return}let r=t-this.gestureT0<=250+(this.most>=2?150:0);if(this.moved||!r)return;let i=this.most>=2?2:0;this.sink.button(i,!0),this.sink.button(i,!1),i===0&&(this.lastTap={t,x:n.x,y:n.y})}cancel(){this.fingers.clear(),this.lastTap=null,this.dragging&&(this.dragging=!1,this.sink.button(0,!1))}},Eo={" ":`Space`,"-":`Minus`,"=":`Equal`,"[":`BracketLeft`,"]":`BracketRight`,"\\":`Backslash`,";":`Semicolon`,"'":`Quote`,"`":`Backquote`,",":`Comma`,".":`Period`,"/":`Slash`,"\n":`Enter`,"\r":`Enter`," ":`Tab`},Do={"!":`Digit1`,"@":`Digit2`,"#":`Digit3`,$:`Digit4`,"%":`Digit5`,"^":`Digit6`,"&":`Digit7`,"*":`Digit8`,"(":`Digit9`,")":`Digit0`,_:`Minus`,"+":`Equal`,"{":`BracketLeft`,"}":`BracketRight`,"|":`Backslash`,":":`Semicolon`,'"':`Quote`,"~":`Backquote`,"<":`Comma`,">":`Period`,"?":`Slash`};function Oo(e){return e.length===1?e>=`a`&&e<=`z`?{code:`Key${e.toUpperCase()}`,shift:!1}:e>=`A`&&e<=`Z`?{code:`Key${e}`,shift:!0}:e>=`0`&&e<=`9`?{code:`Digit${e}`,shift:!1}:Eo[e]?{code:Eo[e],shift:!1}:Do[e]?{code:Do[e],shift:!0}:null:null}var ko={Backspace:`Backspace`,Enter:`Enter`,Tab:`Tab`,Escape:`Escape`,Delete:`Delete`,ArrowUp:`ArrowUp`,ArrowDown:`ArrowDown`,ArrowLeft:`ArrowLeft`,ArrowRight:`ArrowRight`,Home:`Home`,End:`End`,PageUp:`PageUp`,PageDown:`PageDown`};function Ao(e){return ko[e]??null}function jo(e,t){let n=``;for(let r of t){let t=Oo(r);t?Mo(e,t.code,t.shift):n+=r}return n}function Mo(e,t,n=!1){let r=n&&!e.shiftHeld?.();r&&e.key(`ShiftLeft`,!0),e.key(t,!0),e.key(t,!1),r&&e.key(`ShiftLeft`,!1)}function No(e,t){let n=[...e],r=[...t],i=0;for(;i{o.current=e,s.current=t});let c=(0,T.useRef)(null),l=()=>c.current??=new To({move:(e,t)=>o.current?.move(e,t),button:(e,t)=>o.current?.button(e,t),scroll:(e,t)=>o.current?.scroll(e,t)},()=>s.current);(0,T.useEffect)(()=>()=>c.current?.cancel(),[]);let u=e=>e.stopPropagation();return(0,L.jsx)(`div`,{className:`touch-none select-none [-webkit-touch-callout:none] ${n}`,style:r,"data-testid":a,onPointerDown:e=>{u(e);try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}l().down(e.pointerId,e.clientX,e.clientY,e.timeStamp)},onPointerMove:e=>{u(e),l().move(e.pointerId,e.clientX,e.clientY)},onPointerUp:e=>{u(e),l().up(e.pointerId,e.timeStamp)},onPointerCancel:e=>{u(e),l().cancel()},onClick:u,onDoubleClick:u,onContextMenu:e=>{e.preventDefault(),u(e)},children:i})}var R=` `,Fo=40;function Io({sink:e,onUntypeable:t,className:n=``}){let r=Tn(),i=(0,T.useRef)(null),a=(0,T.useRef)(R),o=(0,T.useRef)(!1),[s,c]=(0,T.useState)(!1),[l,u]=(0,T.useState)(!1);(0,T.useEffect)(()=>{if(!l)return;let e=window.setTimeout(()=>u(!1),3e3);return()=>window.clearTimeout(e)},[l]);let d=()=>{let e=i.current;e&&!o.current&&(!e.value.startsWith(R)||e.value.length>Fo)&&(e.value=R,a.current=R)},f=()=>{let n=i.current;if(!n||!e)return;let{deleted:r,inserted:o}=No(a.current,n.value);a.current=n.value;for(let t=0;te.stopPropagation(),onClick:e=>{e.stopPropagation();let t=i.current;t&&(s?t.blur():(t.value=R,a.current=R,t.focus({preventScroll:!0}),t.setSelectionRange(t.value.length,t.value.length)))},className:`flex h-11 w-11 items-center justify-center rounded-full border border-white/25 bg-black/45 text-white backdrop-blur-sm disabled:opacity-40 ${s?`bg-white/30`:``} ${n}`,"data-testid":`rp-tp-keyboard`,children:(0,L.jsx)(he,{size:18,"aria-hidden":!0})}),(0,L.jsx)(`input`,{ref:i,type:`text`,defaultValue:R,autoComplete:`off`,autoCorrect:`off`,autoCapitalize:`off`,spellCheck:!1,enterKeyHint:`send`,"aria-label":r(`rp_tp_keyboard`,void 0,`Keyboard`),className:`pointer-events-none fixed bottom-0 left-1/2 h-px w-px opacity-0`,"data-testid":`rp-tp-keyboard-input`,"data-rp-typing":``,onFocus:()=>c(!0),onBlur:()=>c(!1),onPointerDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation(),onKeyDown:t=>{if(t.stopPropagation(),!e||t.nativeEvent.isComposing)return;let n=Ao(t.key);n&&(t.preventDefault(),Mo(e,n))},onKeyUp:e=>e.stopPropagation(),onCompositionStart:()=>{o.current=!0},onCompositionEnd:()=>{o.current=!1,f()},onInput:f}),l&&(0,L.jsx)(`div`,{className:`pointer-events-none fixed bottom-20 left-1/2 z-[300] w-max max-w-[min(22rem,calc(100%-2rem))] -translate-x-1/2 rounded-full bg-black/80 px-3 py-1.5 text-center text-xs text-white`,"data-testid":`rp-tp-untypeable`,children:r(`rp_tp_untypeable`,void 0,`Only English letters, numbers and symbols can be typed here. Use a text field on the PS5 for others.`)})]})}function Lo({mode:e,onChange:t,blocked:n,style:r,touchpadLabel:i,tight:a=!1,hidden:o=!1}){let s=Tn(),c=(r,i,o)=>{let s=r===`touchpad`&&!!n;return(0,L.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":e===r,"aria-disabled":s||void 0,"aria-label":a&&e!==r?o:void 0,title:s?n:o,onClick:e=>{e.stopPropagation(),s||t(r)},onPointerDown:e=>e.stopPropagation(),onDoubleClick:e=>e.stopPropagation(),className:`flex h-8 items-center gap-1 rounded-full px-2.5 text-xs ${e===r?`bg-white text-black`:`text-white`} ${s?`opacity-40`:``}`,"data-testid":`rp-touch-mode-${r}`,children:[i,(!a||e===r)&&(0,L.jsx)(`span`,{children:o})]})};return(0,L.jsxs)(`div`,{role:`radiogroup`,"aria-label":s(`rp_tp_mode`,void 0,`Touch controls`),"aria-hidden":o||void 0,className:`absolute left-1/2 z-30 flex -translate-x-1/2 gap-0.5 rounded-full border border-white/20 bg-black/50 p-0.5 backdrop-blur-sm transition-opacity duration-200 ${o?`pointer-events-none opacity-0`:`pointer-events-auto opacity-100`}`,style:r,"data-testid":`rp-touch-mode`,children:[c(`controller`,(0,L.jsx)(E,{size:14,"aria-hidden":!0}),s(`rp_kbm_controller`,void 0,`Controller`)),c(`touchpad`,(0,L.jsx)(ye,{size:14,"aria-hidden":!0}),i??s(`rp_tp_touchpad`,void 0,`Touchpad`))]})}var Ro={0:1,2:2,1:4,3:8,4:16},zo={ControlLeft:1,ShiftLeft:2,AltLeft:4,MetaLeft:8,OSLeft:8,ControlRight:16,ShiftRight:32,AltRight:64,MetaRight:128,OSRight:128};function Bo(){let e={};for(let t=0;t<26;t++)e[`Key${String.fromCharCode(65+t)}`]=4+t;for(let t=1;t<=9;t++)e[`Digit${t}`]=30+t-1;e.Digit0=39,Object.assign(e,{Enter:40,Escape:41,Backspace:42,Tab:43,Space:44,Minus:45,Equal:46,BracketLeft:47,BracketRight:48,Backslash:49,IntlHash:50,Semicolon:51,Quote:52,Backquote:53,Comma:54,Period:55,Slash:56,CapsLock:57,PrintScreen:70,ScrollLock:71,Pause:72,Insert:73,Home:74,PageUp:75,Delete:76,End:77,PageDown:78,ArrowRight:79,ArrowLeft:80,ArrowDown:81,ArrowUp:82,NumLock:83,NumpadDivide:84,NumpadMultiply:85,NumpadSubtract:86,NumpadAdd:87,NumpadEnter:88,NumpadDecimal:99,IntlBackslash:100,ContextMenu:101,NumpadEqual:103,IntlRo:135,KanaMode:136,IntlYen:137,Convert:138,NonConvert:139,Lang1:144,Lang2:145});for(let t=1;t<=9;t++)e[`Numpad${t}`]=89+t-1;e.Numpad0=98;for(let t=1;t<=12;t++)e[`F${t}`]=58+t-1;for(let t=13;t<=24;t++)e[`F${t}`]=104+t-13;return e}var Vo=Bo(),Ho=(e,t,n)=>Math.max(t,Math.min(n,Math.trunc(e)));function Uo(e,t=0,n=0,r=0,i=0){let a=new Uint8Array(17),o=new DataView(a.buffer);return a[0]=8,a[1]=e.buttons&255,a[2]=e.mods&255,o.setInt16(3,Ho(t,-32768,32767),!0),o.setInt16(5,Ho(n,-32768,32767),!0),o.setInt8(7,Ho(r,-128,127)),o.setInt8(8,Ho(i,-128,127)),e.keys.slice(0,8).forEach((e,t)=>a[9+t]=e&255),a}function Wo(e){let t={buttons:0,mods:0,keys:[]};for(let n of e){t.buttons|=n.buttons,t.mods|=n.mods;for(let e of n.keys)!t.keys.includes(e)&&t.keys.length<8&&t.keys.push(e)}return t}function z(e,t,n){let r=e+t/(n===1?3:n===2?1:100),i=Math.trunc(r);return{notches:-i,carry:r-i}}var B=class{constructor(e){this.st={buttons:0,mods:0,keys:[]},this.dx=0,this.dy=0,this.wheel=0,this.hwheel=0,this.wheelCarry=0,this.hwheelCarry=0,this.moveTimer=null,this.hb=null,this.want={mouse:!1,keyboard:!1},this.guests=new Map,this.d={setTimer:(e,t)=>window.setTimeout(e,t),clearTimer:e=>window.clearTimeout(e),setRepeat:(e,t)=>window.setInterval(e,t),clearRepeat:e=>window.clearInterval(e),...e}}get state(){return this.st}shiftHeld(){return(this.st.mods&(zo.ShiftLeft|zo.ShiftRight))!==0}get holding(){return this.st.buttons!==0||this.st.mods!==0||this.st.keys.length>0}setWant(e){let t=e.mouse||e.keyboard,n=e.mouse!==this.want.mouse||e.keyboard!==this.want.keyboard;this.want={...e},n&&(this.hb!==null&&this.d.clearRepeat(this.hb),this.hb=null,this.beat(),t&&(this.hb=this.d.setRepeat(()=>this.beat(),500)))}get wanted(){return this.want}beat(){let e=this.want.mouse||this.want.keyboard;this.d.send({kbm:e?{on:!0,mouse:this.want.mouse,keyboard:this.want.keyboard}:{on:!1}})}key(e,t){let n=zo[e];if(n){let e=t?this.st.mods|n:this.st.mods&~n;return e!==this.st.mods&&(this.st={...this.st,mods:e},this.flush()),!0}let r=Vo[e];if(!r)return!1;let i=this.st.keys.includes(r);return t&&!i&&this.st.keys.length<8?(this.st={...this.st,keys:[...this.st.keys,r]},this.flush()):!t&&i&&(this.st={...this.st,keys:this.st.keys.filter(e=>e!==r)},this.flush()),!0}button(e,t){let n=Ro[e];if(!n)return;let r=t?this.st.buttons|n:this.st.buttons&~n;r!==this.st.buttons&&(this.st={...this.st,buttons:r},this.flush())}guest(e,t){if(t)this.guests.set(e,{buttons:t.buttons,mods:t.mods,keys:t.keys.slice(0,8)});else if(!this.guests.delete(e))return;this.flush()}guestMotion(e,t,n,r){this.dx+=e,this.dy+=t,this.wheel+=n,this.hwheel+=r,(e||t||n||r)&&this.later()}get guestIds(){return[...this.guests.keys()]}move(e,t){this.dx+=e,this.dy+=t,this.later()}scroll(e,t,n){let r=z(this.wheelCarry,e,n),i=z(this.hwheelCarry,t,n);this.wheelCarry=r.carry,this.hwheelCarry=i.carry,this.wheel+=r.notches,this.hwheel-=i.notches,(this.wheel||this.hwheel)&&this.later()}later(){this.moveTimer===null&&(this.moveTimer=this.d.setTimer(()=>this.flush(),4))}flush(){this.moveTimer!==null&&this.d.clearTimer(this.moveTimer),this.moveTimer=null;let e=this.guests.size?Wo([this.st,...this.guests.values()]):this.st;do{let t=Ho(this.dx,-32768,32767),n=Ho(this.dy,-32768,32767),r=Ho(this.wheel,-128,127),i=Ho(this.hwheel,-128,127);this.dx-=t,this.dy-=n,this.wheel-=r,this.hwheel-=i,this.d.send(Uo(e,t,n,r,i))}while(Math.abs(this.dx)>=1||Math.abs(this.dy)>=1||this.wheel||this.hwheel)}releaseAll(){this.dx=this.dy=this.wheel=this.hwheel=0,this.wheelCarry=this.hwheelCarry=0;let e=this.holding;this.st={buttons:0,mods:0,keys:[]},this.moveTimer!==null&&this.d.clearTimer(this.moveTimer),this.moveTimer=null,e&&this.d.send(Uo(this.guests.size?Wo(this.guests.values()):this.st))}dispose(){this.guests.clear(),this.releaseAll(),this.setWant({mouse:!1,keyboard:!1})}},Go=`data:video/mp4;base64,AAAAIGZ0eXBpc29tAAACAGlzb21pc28yYXZjMW1wNDEAAAYZbW9vdgAAAGxtdmhkAAAAAAAAAAAAAAAAAAAfQAAAfQAAAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAmt0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAABAAAAAAAAfQAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAABAAAAAQAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAH0AAAAAAAABAAAAAAHjbWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAABAAAABAABVxAAAAAAALWhkbHIAAAAAAAAAAHZpZGUAAAAAAAAAAAAAAABWaWRlb0hhbmRsZXIAAAABjm1pbmYAAAAUdm1oZAAAAAEAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAU5zdGJsAAAAunN0c2QAAAAAAAAAAQAAAKphdmMxAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAABAAEABIAAAASAAAAAAAAAABFExhdmM2My4xLjEwMiBsaWJ4MjY0AAAAAAAAAAAAAAAAGP//AAAAMGF2Y0MBQsAK/+EAF2dCwAqmEXsBEAAAAwAQAAADACDxImEYAQAGaMhCAZSyAAAAEHBhc3AAAAABAAAAAQAAABRidHJ0AAAAAAAABUAAAAAAAAAAGHN0dHMAAAAAAAAAAQAAAAQAAEAAAAAAFHN0c3MAAAAAAAAAAQAAAAEAAAAcc3RzYwAAAAAAAAABAAAAAQAAAAEAAAABAAAAJHN0c3oAAAAAAAAAAAAAAAQAAAKCAAAACgAAAAoAAAAKAAAAIHN0Y28AAAAAAAAABAAABlwAAAj+AAAJKAAACVIAAALZdHJhawAAAFx0a2hkAAAAAwAAAAAAAAAAAAAAAgAAAAAAAH0AAAAAAAAAAAAAAAABAQAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAJGVkdHMAAAAcZWxzdAAAAAAAAAABAAB9AAAABAAAAQAAAAACUW1kaWEAAAAgbWRoZAAAAAAAAAAAAAAAAAAAH0AAAIEAVcQAAAAAAC1oZGxyAAAAAAAAAABzb3VuAAAAAAAAAAAAAAAAU291bmRIYW5kbGVyAAAAAfxtaW5mAAAAEHNtaGQAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAcBzdGJsAAAAfnN0c2QAAAAAAAAAAQAAAG5tcDRhAAAAAAAAAAEAAAAAAAAAAAABABAAAAAAH0AAAAAAADZlc2RzAAAAAAOAgIAlAAIABICAgBdAFQAAAAAAH0AAAAEcBYCAgAUViFblAAaAgIABAgAAABRidHJ0AAAAAAAAH0AAAAEcAAAAIHN0dHMAAAAAAAAAAgAAACAAAAQAAAAAAQAAAQAAAAAoc3RzYwAAAAAAAAACAAAAAQAAAAEAAAABAAAAAgAAAAgAAAABAAAAmHN0c3oAAAAAAAAAAAAAACEAAAATAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAkc3RjbwAAAAAAAAAFAAAGSQAACN4AAAkIAAAJMgAACVwAAAAac2dwZAEAAAByb2xsAAAAAgAAAAH//wAAABxzYmdwAAAAAHJvbGwAAAABAAAAIQAAAAEAAABhdWR0YQAAAFltZXRhAAAAAAAAACFoZGxyAAAAAAAAAABtZGlyYXBwbAAAAAAAAAAAAAAAACxpbHN0AAAAJKl0b28AAAAcZGF0YQAAAAEAAAAATGF2ZjYzLjEuMTAyAAAACGZyZWUAAAM7bWRhdNwATGF2YzYzLjEuMTAyAAIwQA4AAAJvBgX//2vcRem95tlIt5Ys2CDZI+7veDI2NCAtIGNvcmUgMTY1IHIzMjIyIGIzNTYwNWEgLSBILjI2NC9NUEVHLTQgQVZDIGNvZGVjIC0gQ29weWxlZnQgMjAwMy0yMDI1IC0gaHR0cDovL3d3dy52aWRlb2xhbi5vcmcveDI2NC5odG1sIC0gb3B0aW9uczogY2FiYWM9MCByZWY9MTYgZGVibG9jaz0xOjA6MCBhbmFseXNlPTB4MToweDEzMSBtZT11bWggc3VibWU9MTAgcHN5PTEgcHN5X3JkPTEuMDA6MC4wMCBtaXhlZF9yZWY9MSBtZV9yYW5nZT0yNCBjaHJvbWFfbWU9MSB0cmVsbGlzPTIgOHg4ZGN0PTAgY3FtPTAgZGVhZHpvbmU9MjEsMTEgZmFzdF9wc2tpcD0xIGNocm9tYV9xcF9vZmZzZXQ9LTIgdGhyZWFkcz0xIGxvb2thaGVhZF90aHJlYWRzPTEgc2xpY2VkX3RocmVhZHM9MCBucj0wIGRlY2ltYXRlPTEgaW50ZXJsYWNlZD0wIGJsdXJheV9jb21wYXQ9MCBjb25zdHJhaW5lZF9pbnRyYT0wIGJmcmFtZXM9MCB3ZWlnaHRwPTAga2V5aW50PTQga2V5aW50X21pbj0xIHNjZW5lY3V0PTQwIGludHJhX3JlZnJlc2g9MCByY19sb29rYWhlYWQ9NCByYz1jcmYgbWJ0cmVlPTEgY3JmPTUxLjAgcWNvbXA9MC42MCBxcG1pbj0wIHFwbWF4PTY5IHFwc3RlcD00IGlwX3JhdGlvPTEuNDAgYXE9MToxLjAwAIAAAAALZYiCAv5MUAAQv8ABGCAHARggBwEYIAcBGCAHARggBwEYIAcBGCAHARggBwAAAAZBmhwF/UABGCAHARggBwEYIAcBGCAHARggBwEYIAcBGCAHARggBwAAAAZBmioBb1ABGCAHARggBwEYIAcBGCAHARggBwEYIAcBGCAHARggBwAAAAZBmjsBX1ABGCAHARggBwEYIAcBGCAHARggBwEYIAcBGCAHARggBw==`,Ko=null,qo=null;function Jo(e){e.play().catch(()=>{if(qo||Ko!==e)return;let t=()=>{Yo(),Ko===e&&e.play().catch(()=>{})};window.addEventListener(`pointerdown`,t,{capture:!0}),qo=()=>window.removeEventListener(`pointerdown`,t,{capture:!0})})}function Yo(){qo?.(),qo=null}function Xo(){if(typeof document<`u`){if(!Ko){let e=document.createElement(`video`);e.muted=!0,e.loop=!0,e.playsInline=!0,e.setAttribute(`playsinline`,``),e.setAttribute(`aria-hidden`,`true`),e.setAttribute(`data-testid`,`keep-screen-video`),e.style.cssText=`position:fixed;left:0;top:0;width:1px;height:1px;opacity:0;pointer-events:none`,e.src=Go,document.body.appendChild(e),Ko=e}Jo(Ko)}}function Zo(){Yo(),Ko&&=(Ko.pause(),Ko.removeAttribute(`src`),Ko.remove(),null)}function Qo(){return typeof navigator>`u`?null:navigator.wakeLock??null}function V(){return Te()||!gn()}var $o=new Set,es=null,ts=Promise.resolve(),ns=!1;async function rs(){if($o.size===0||es&&!es.released)return;let e=Qo();if(!e)Te()&&Xo();else try{let t=await e.request(`screen`);t.addEventListener(`release`,()=>{es===t&&(es=null)}),es=t}catch{}}async function is(){Zo();let e=es;if(es=null,e&&!e.released)try{await e.release()}catch{}}function as(){ns||typeof document>`u`||(ns=!0,document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`visible`&&$o.size>0&&(ts=ts.then(rs))}))}function os(e,t){if(!V())return;as();let n=$o.size>0;t?$o.add(e):$o.delete(e);let r=$o.size>0;n!==r&&(ts=ts.then(r?rs:is))}var ss=new Set;function cs(){if(typeof window<`u`)return window.PS5UploadPad}function ls(e,t){let n=ss.size>0;t?ss.add(e):ss.delete(e);let r=ss.size>0;if(n!==r)try{cs()?.setActive(r)}catch{}}function us(e,t){let[n,r]=(0,T.useState)(!1);return(0,T.useEffect)(()=>{if(!e||!t)return;let n=!0;return Pe(e,je).then(e=>{n&&!e&&r(!0)}),()=>{n=!1}},[e,t]),n}function ds({href:e}){let t=Tn();return(0,L.jsxs)(`div`,{className:`flex flex-col items-center gap-3 text-center`,"data-testid":`open-on-wifi`,children:[(0,L.jsx)(`p`,{className:`max-w-sm text-sm text-white/60`,children:t(`join_open_lan_body`,void 0,`Can't reach the internet? If you're on the same Wi-Fi as your friend, open the game there.`)}),(0,L.jsx)(`a`,{href:e,rel:`noreferrer`,className:`rounded-full bg-white px-4 py-2 text-sm font-medium text-black`,"data-testid":`open-on-wifi-link`,children:t(`join_open_lan`,void 0,`Open on this Wi-Fi`)})]})}function fs(e,t,n){switch(t.kind){case`connecting`:return e(`pad_connecting`,void 0,`Connecting…`);case`asking`:return e(`pad_asking`,{name:n},`Waiting for ${n} to allow this phone…`);case`joined`:return t.host?t.passcode&&!t.playing?e(`pad_wait_passcode`,{name:n},`Waiting for the passcode on ${n}`):t.playing?e(`pad_playing`,{host:t.host},`Controller for ${t.host}`):e(`pad_starting`,void 0,`Connected. The stream is starting…`):e(`pad_no_session`,void 0,`Connected. Waiting for Remote Play to start on the computer.`);case`refused`:return t.why===`denied`?e(`pad_denied`,void 0,`The computer said no.`):t.why===`no_answer`?e(`pad_no_answer`,void 0,`The computer didn't answer in time. Try again.`):t.why===`kicked`?e(`pad_kicked`,void 0,`The computer took this phone out of the game.`):t.why===`closed`?e(`pad_link_closed`,void 0,`The computer closed the link. Scan the new code to play again.`):t.why===`key`?e(`pad_old_code`,void 0,`This code has expired. Scan the new one on the computer.`):t.why===`full`?e(`pad_full`,void 0,`Four phones are playing already.`):t.why===`no_stream`?e(`pad_watch_no_stream`,void 0,`Nothing is streaming on the computer right now.`):t.why.startsWith(`net:`)?ps(e,t.why.slice(4)):e(`pad_refused`,void 0,`The computer did not let this phone in.`);case`reconnecting`:return e(`pad_reconnecting`,void 0,`Connection lost. Reconnecting…`);case`lost`:return e(`pad_lost`,void 0,`Lost the connection to the computer.`)}}function ps(e,t){switch(t){case`mismatch`:return e(`join_net_mismatch`,void 0,`This link doesn't match the host; ask them for a new one.`);case`no_direct`:return e(`join_net_no_direct`,void 0,`A direct connection isn't possible from this network (both sides' routers are strict). Try Wi-Fi instead of mobile data, or ask the host to turn on UPnP.`);case`no_room`:return e(`pad_old_code`,void 0,`This code has expired. Scan the new one on the computer.`);case`net_full`:return e(`pad_full`,void 0,`Four phones are playing already.`);case`no_hub`:return e(`join_net_no_hub`,void 0,`Couldn't reach the PS5Upload invite service. Check your internet connection, then try again.`);case`offer`:case`no_webrtc`:return e(`join_net_no_webrtc`,void 0,`This browser can't make direct connections. Try a recent Chrome, Safari or Firefox.`);default:return e(`pad_lost`,void 0,`Lost the connection to the computer.`)}}function ms(e){return e.kind!==`refused`||e.why!==`kicked`&&e.why!==`closed`}async function hs(){try{await document.documentElement.requestFullscreen?.({navigationUI:`hide`}),await screen.orientation.lock?.(`landscape`)}catch{}}function gs(e,t){return t?.mouse?null:t?.reason===`vinput_helper_old`||t?.reason===`helper_old`?e(`rp_kbm_helper_old`,void 0,`Update the PS5 helper to use a keyboard and mouse.`):t?.reason===`vinput_needs_loader`?e(`rp_kbm_needs_loader`,void 0,`Needs a payload loader on port 9021`):e(`rp_kbm_unavailable`,void 0,`Native keyboard & mouse isn't available on this console yet.`)}function _s({client:e,caps:t}){let n=Tn(),r=(0,T.useMemo)(()=>new B({send:t=>e.sendKbm(t)}),[e]);(0,T.useEffect)(()=>{r.setWant({mouse:!0,keyboard:t.keyboard})},[r,t.keyboard]),(0,T.useEffect)(()=>()=>r.dispose(),[r]);let i=(0,T.useMemo)(()=>({move:(e,t)=>r.move(e,t),button:(e,t)=>r.button(e,t),scroll:(e,t)=>r.scroll(e,t,0),key:(e,t)=>r.key(e,t),shiftHeld:()=>r.shiftHeld()}),[r]);return(0,L.jsxs)(Po,{sink:i,speed:1.5,className:`absolute inset-0 z-10`,testId:`pad-touchpad`,children:[(0,L.jsx)(`p`,{className:`pointer-events-none absolute inset-x-6 top-1/2 -translate-y-1/2 text-center text-xs leading-5 text-white/50`,children:n(`rp_tp_tips`,void 0,`Drag to move. Tap to click. Two fingers: tap to right-click, drag to scroll. Tap, then touch and drag to select.`)}),(0,L.jsx)(`div`,{className:`absolute`,style:{right:`max(12px, env(safe-area-inset-right))`,bottom:`max(12px, env(safe-area-inset-bottom))`},children:(0,L.jsx)(Io,{sink:t.keyboard?i:null})})]})}function vs({url:e,computer:t,onLeave:n,watch:r=!1,transport:i,hello:a,onReconnectToken:o,lanUrl:s=null}){let c=Tn(),l=us(i?e:null,s),u=t??c(`pad_net_computer`,void 0,`the computer`),[d,f]=(0,T.useState)({kind:`connecting`}),[p,m]=(0,T.useState)(0),[h,g]=(0,T.useState)(()=>typeof window<`u`&&window.innerHeight>window.innerWidth),[_,v]=(0,T.useState)(null),[y,b]=(0,T.useState)(null),[x,S]=(0,T.useState)(!1),ee=(0,T.useRef)(null),te=(0,T.useRef)(null),[C,ne]=(0,T.useState)(!r),[w,re]=(0,T.useState)(null),[ie,ae]=(0,T.useState)(!1),[oe,se]=(0,T.useState)(null),[ce,le]=(0,T.useState)(`controller`);(0,T.useEffect)(()=>(os(`pad-remote`,!0),ls(`pad-remote`,!0),()=>{os(`pad-remote`,!1),ls(`pad-remote`,!1)}),[]),(0,T.useEffect)(()=>{if(!x)return;let e=Ae(e=>{co.motion=e});return()=>{e(),co.motion=null}},[x]),(0,T.useEffect)(()=>{let t=r?Zi(re,`watch`,()=>n.askKeyframe()):null;ee.current=t,t&&te.current?.appendChild(t.element),ne(!r),ae(!1);let n=new io({url:e,WebSocketImpl:i,hello:a,onReconnectToken:o,onStage:f,touchPad:()=>co.touchPad,onLight:v,onKbmCaps:se,motion:()=>co.motion,watch:t?{onFrame:e=>t.onMessage(e),onCodec:e=>t.setHevc(e),onControl:ne}:void 0});b(n),n.start();let s=()=>{let e=document.visibilityState===`hidden`;n.setNeutral(e),e||n.wake()},c=()=>n.setNeutral(!0);return document.addEventListener(`visibilitychange`,s),window.addEventListener(`blur`,c),window.addEventListener(`focus`,s),()=>{document.removeEventListener(`visibilitychange`,s),window.removeEventListener(`blur`,c),window.removeEventListener(`focus`,s),n.stop(),t?.stop(),t?.element.remove()}},[e,p,r]),(0,T.useEffect)(()=>{let e=()=>g(window.innerHeight>window.innerWidth);return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]);let ue=d.kind===`refused`||d.kind===`lost`,de=d.kind===`joined`||d.kind===`reconnecting`,pe=!!s&&!de&&(l||d.kind===`refused`&&d.why===`net:no_hub`);return(0,L.jsxs)(`div`,{className:`fixed inset-0 select-none overflow-hidden bg-black text-white [-webkit-touch-callout:none]`,style:{touchAction:`none`},"data-testid":`pad-app`,children:[(0,L.jsxs)(`div`,{className:`absolute inset-x-0 top-0 z-20 flex items-center justify-center gap-2 px-3 pt-[max(6px,env(safe-area-inset-top))] text-xs text-white/80`,children:[(0,L.jsx)(`span`,{className:`inline-block h-2 w-2 shrink-0 rounded-full`,style:{background:d.kind===`joined`?_?`rgb(${_[0]},${_[1]},${_[2]})`:`var(--color-success,#22c55e)`:ue?`var(--color-bad,#ef4444)`:`#eab308`}}),(0,L.jsx)(`span`,{className:`truncate`,"data-testid":`pad-stage`,children:r&&d.kind===`joined`&&d.host&&(!d.passcode||d.playing)?C?c(`pad_watch_control`,void 0,`Watching, and you have the controller`):c(`pad_watch_watching`,{host:d.host},`Watching ${d.host}`):fs(c,d,u)}),de&&typeof document<`u`&&!!document.documentElement.requestFullscreen&&!document.fullscreenElement&&(0,L.jsxs)(`button`,{type:`button`,onClick:()=>void hs(),className:`flex items-center gap-1 rounded-full bg-white/15 px-2 py-1`,"data-testid":`pad-full`,children:[(0,L.jsx)(fe,{size:12}),c(`pad_fill`,void 0,`Full screen`)]}),de&&k()&&(0,L.jsx)(`button`,{type:`button`,onClick:()=>{x?S(!1):ke().then(S)},"aria-pressed":x,className:`rounded-full px-2 py-1 ${x?`bg-white text-black`:`bg-white/15`}`,"data-testid":`pad-motion`,children:c(`pad_motion`,void 0,`Motion`)}),n&&(0,L.jsx)(`button`,{type:`button`,onClick:n,className:`rounded-full bg-white/15 px-2 py-1`,"data-testid":`pad-leave`,children:c(`pad_leave`,void 0,`Stop being a controller`)})]}),(0,L.jsx)(`div`,{ref:te,className:`absolute inset-0 z-0 flex items-center justify-center`,"aria-hidden":!0}),r&&de&&!ie&&(0,L.jsxs)(`button`,{type:`button`,onClick:()=>{ee.current?.startSound(),ae(!0)},className:`absolute bottom-4 left-1/2 z-20 flex -translate-x-1/2 items-center gap-1.5 rounded-full bg-white/90 px-3 py-1.5 text-xs font-medium text-black`,"data-testid":`watch-sound`,children:[(0,L.jsx)(Ce,{size:14}),c(`pad_watch_sound`,void 0,`Sound`)]}),r&&w&&(0,L.jsx)(`p`,{className:`absolute inset-x-4 top-1/2 z-10 -translate-y-1/2 text-center text-sm text-white/85`,"data-testid":`watch-problem`,children:w===`no_hevc`?c(`pad_watch_no_hevc`,void 0,`This device can't play this stream's picture: the computer streams HEVC, and this device plays only H.264.`):c(`pad_watch_decode`,void 0,`The picture could not be played here.`)}),de&&C&&(ce===`touchpad`&&oe?.mouse&&y?(0,L.jsx)(_s,{client:y,caps:oe}):(0,L.jsx)(wo,{stream:y,layout:`overlay`})),de&&C&&(0,L.jsx)(Lo,{mode:ce===`touchpad`&&oe?.mouse?`touchpad`:`controller`,onChange:le,blocked:gs(c,oe),touchpadLabel:c(`pad_touchpad_tab`,void 0,`Touchpad & keyboard`),style:{top:`calc(max(6px, env(safe-area-inset-top)) + 2rem)`}}),de&&h&&(0,L.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 bottom-6 z-20 flex justify-center`,children:(0,L.jsxs)(`span`,{className:`flex items-center gap-2 rounded-full bg-black/70 px-3 py-1.5 text-xs text-white/85`,children:[(0,L.jsx)(xe,{size:14}),c(`pad_turn`,void 0,`Turn the phone sideways`)]})}),pe&&!ue&&s&&(0,L.jsx)(`div`,{className:`absolute inset-x-0 bottom-8 z-10 flex justify-center px-6`,children:(0,L.jsx)(ds,{href:s})}),ue&&(0,L.jsxs)(`div`,{className:`absolute inset-0 z-10 flex flex-col items-center justify-center gap-3 px-6 text-center text-sm`,children:[(0,L.jsx)(`p`,{className:`max-w-sm text-white/85`,children:fs(c,d,u)}),pe&&s&&(0,L.jsx)(ds,{href:s}),ms(d)&&(0,L.jsx)(`button`,{type:`button`,onClick:()=>m(e=>e+1),className:`rounded-full bg-white px-4 py-2 text-sm font-medium text-black`,"data-testid":`pad-retry`,children:c(`pad_retry`,void 0,`Try again`)})]})]})}var ys=`ps5upload.openIn`,bs=`ps5upload.openIn.tab`;function xs(){try{return sessionStorage.getItem(bs)===`browser`}catch{return!1}}function Ss(){try{sessionStorage.setItem(bs,`browser`)}catch{}}function Cs(e){return e===`browser`?`browser`:e===`app`?`opening`:`ask`}function ws({appLink:e,children:t}){let n=Tn(),[r,i]=(0,T.useState)(()=>xs()?`browser`:Cs(yt(ys))),[a,o]=(0,T.useState)(!1);if((0,T.useEffect)(()=>{r===`opening`&&yt(`ps5upload.openIn`)===`app`&&(location.href=e)},[]),r===`browser`)return(0,L.jsx)(L.Fragment,{children:t});let s=()=>{a&&vt(ys,`app`),i(`opening`),location.href=e},c=()=>{r===`ask`&&a?vt(ys,`browser`):r===`opening`&&yt(`ps5upload.openIn`)===`app`&&bt(ys),Ss(),i(`browser`)};return(0,L.jsx)(`div`,{className:`flex min-h-[100dvh] items-center justify-center bg-black px-6 text-white`,"data-testid":`open-in-gate`,"data-join-ui":``,children:(0,L.jsx)(`div`,{className:`w-full max-w-sm space-y-4 rounded-2xl border border-white/10 bg-neutral-900 p-6`,children:r===`ask`?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`div`,{className:`space-y-1`,children:[(0,L.jsx)(`h1`,{className:`text-lg font-semibold`,children:n(`open_in_title`,void 0,`Open in the PS5Upload app?`)}),(0,L.jsx)(`p`,{className:`text-sm text-white/60`,children:n(`open_in_body`,void 0,`Have the PS5Upload app on this device? Open this there, or carry on in the browser.`)})]}),(0,L.jsx)(`button`,{type:`button`,onClick:s,autoFocus:!0,className:`w-full rounded-full bg-white py-2.5 text-sm font-semibold text-black`,"data-testid":`open-in-app`,children:n(`open_in_app`,void 0,`Open in the app`)}),(0,L.jsx)(`button`,{type:`button`,onClick:c,className:`w-full rounded-full border border-white/20 py-2.5 text-sm font-semibold text-white hover:bg-white/10`,"data-testid":`open-in-browser`,children:n(`open_in_browser`,void 0,`Continue in browser`)}),(0,L.jsxs)(`label`,{className:`flex items-center justify-center gap-2 text-xs text-white/60`,children:[(0,L.jsx)(`input`,{type:`checkbox`,checked:a,onChange:e=>o(e.target.checked),"data-testid":`open-in-remember`}),n(`open_in_remember`,void 0,`Remember my choice on this device`)]})]}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`div`,{className:`space-y-1`,children:[(0,L.jsx)(`h1`,{className:`text-lg font-semibold`,children:n(`open_in_opening`,void 0,`Opening the PS5Upload app…`)}),(0,L.jsx)(`p`,{className:`text-sm text-white/60`,children:n(`open_in_not_opened`,void 0,`Nothing happened? The app may not be on this device.`)})]}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>location.href=e,autoFocus:!0,className:`w-full rounded-full bg-white py-2.5 text-sm font-semibold text-black`,"data-testid":`open-in-again`,children:n(`open_in_again`,void 0,`Try again`)}),(0,L.jsx)(`button`,{type:`button`,onClick:c,className:`w-full rounded-full border border-white/20 py-2.5 text-sm font-semibold text-white hover:bg-white/10`,"data-testid":`open-in-browser`,children:n(`open_in_browser`,void 0,`Continue in browser`)})]})})})}function Ts(e){return`ps5upload://pad?link=${encodeURIComponent(e)}`}function Es(e){let t=(e??``).trim().replace(/^\[|\]$/g,``).toLowerCase(),n=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/.exec(t);if(n){let e=n.slice(1).map(Number);if(e.some(e=>e>255))return null;let[t,r]=e;return t===10||t===172&&r>=16&&r<32||t===192&&r===168||t===169&&r===254||t===127?0:t===100&&r>=64&&r<128?1:2}if(!t.includes(`:`)||!/^[0-9a-f:.]+$/.test(t))return null;if(t.startsWith(`fd7a:115c:a1e0:`))return 1;let r=parseInt(t.split(`:`)[0]||`0`,16);return(r&65024)==64512||(r&65472)==65152||t===`::1`?0:2}function Ds(e,t){let n=Es(e),r=Es(t);return n===1||r===1?`tailscale`:r===0?`lan`:r===2?`internet`:null}function Os(e){let t=[];if(typeof e.forEach==`function`)e.forEach(e=>t.push(e));else for(let n of e)t.push(n);let n=new Map(t.map(e=>[String(e.id),e])),r=t.filter(e=>e.type===`candidate-pair`),i=t.filter(e=>e.type===`transport`&&typeof e.selectedCandidatePairId==`string`).map(e=>n.get(String(e.selectedCandidatePairId))).find(Boolean)??r.find(e=>e.selected===!0)??r.find(e=>e.nominated===!0&&e.state===`succeeded`);if(!i)return null;let a=e=>{let t=n.get(String(e));if(!t)return null;let r=t.address??t.ip;return typeof r==`string`?r:null};return Ds(a(i.localCandidateId),a(i.remoteCandidateId))}function ks(e){let t=e.replace(/:\d+$/,``).replace(/^\[|\]$/g,``);return`${t===`localhost`||t===`127.0.0.1`||t===`::1`?`ws`:`wss`}://${e}/ws`}function As(e){let t=new Set;for(let n of e.matchAll(/^a=fingerprint:sha-256[ \t]+([0-9A-Fa-f:]+)[ \t]*\r?$/gim))t.add(n[1].toUpperCase());return/^a=fingerprint:(?!sha-256[ \t])/im.test(e)?null:t.size===1?[...t][0]:null}function js(e,t){let n=As(e);return n!==null&&n===t.toUpperCase()}var Ms=16777216;function Ns(e){let t=16383,n=Math.max(1,Math.ceil(e.length/t)),r=[];for(let i=0;ithis.max)return this.parts=[],this.size=0,{kind:`error`,why:`too_big`};if(this.parts.push(r.slice()),this.size+=r.length,n===1)return{kind:`partial`};let i=new Uint8Array(this.size),a=0;for(let e of this.parts)i.set(e,a),a+=e.length;return this.parts=[],this.size=0,{kind:`message`,data:i.buffer}}};function Fs(e){let t=new Uint8Array(9);return t[0]=3,t.set(e.subarray(0,8),1),t}var Is=[`stun:stun.cloudflare.com:3478`,`stun:stun.l.google.com:19302`],Ls=1500,Rs=2e4;function zs(e){let t=e?.codecs??[],n=e=>t.filter(t=>t.mimeType.toLowerCase()===e);return[...n(`video/h264`),...n(`video/h265`),...n(`video/rtx`)]}var Bs=null;function Vs(e){e.onopen=e.onmessage=e.onclose=e.onerror=null;try{e.readyState===1&&e.send(JSON.stringify({t:`leave`})),e.close(1e3)}catch{}}function Hs(e,t){let n=Bs;return n?(Bs=null,n.timer&&clearTimeout(n.timer),n.url!==e||n.room!==t||n.ws.readyState>1||n.msgs.some(e=>e.t===`error`||e.t===`closed`)?(Vs(n.ws),null):{ws:n.ws,msgs:n.msgs}):null}function Us(e,t={}){var n;let r=t.WebSocketImpl??(typeof WebSocket>`u`?void 0:WebSocket),i=t.PeerConnection??(typeof RTCPeerConnection>`u`?void 0:RTCPeerConnection),a=t.iceTimeoutMs??15e3,o=t.log??(()=>{});class s{constructor(e){this.CONNECTING=0,this.OPEN=1,this.CLOSING=2,this.CLOSED=3,this.readyState=0,this.binaryType=`arraybuffer`,this.onopen=null,this.onmessage=null,this.onclose=null,this.onerror=null,this.hub=null,this.pc=null,this.dc=null,this.timer=null,this.rx=new Ps,this.answered=!1,this.early=[],this.hubBackUntil=0,this.offerSdp=null,this.offerSent=!1,this.ownEarly=[],this.media=null,setTimeout(()=>this.begin(),0)}begin(){if(this.readyState!==0)return;if(!i||!r){this.fail(`no_webrtc`);return}let n=t.signalUrl??ks(e.hub),a=t.signalUrl||t.lan?null:Hs(n,e.room),s;if(a)s=a.ws,o(`hub: joined early`);else try{s=new r(n)}catch{this.fail(`no_hub`);return}if(this.hub=s,this.prepare(),this.readyState===0){s.onopen=()=>s.send(JSON.stringify(t.lan?{v:1,t:`join`,lan:!0}:{v:1,t:`join`,room:e.room})),s.onmessage=e=>{if(typeof e.data!=`string`)return;let t;try{t=JSON.parse(e.data)}catch{return}this.onHub(t)},s.onclose=e=>{this.hub===s&&(this.hub=null,this.readyState===0&&(this.answered||e?.code===1001&&this.hubRestarting()||this.fail(`no_hub`)))},s.onerror=()=>{};for(let e of a?.msgs??[])this.onHub(e)}}signal(e){let t=this.hub;t&&t.readyState===1&&t.send(JSON.stringify({t:`signal`,to:`host`,data:e}))}onHub(e){if(this.readyState===0)switch(e.t){case`joined`:o(`hub: joined room as ${e.gid??`?`}`),this.sendOffer();return;case`signal`:e.from===`host`&&e.data&&typeof e.data==`object`&&this.onSignal(e.data);return;case`closed`:this.fail(`no_room`);return;case`error`:if(o(`hub: error ${e.why??`?`}`),e.why===`no_room`&&this.hubBackUntil&&this.hubRestarting())return;this.fail(e.why===`no_room`?`no_room`:e.why===`room_full`?`net_full`:`no_hub`);return}}prepare(){if(!i)return;this.offerSent=!1,this.ownEarly=[];let e;try{e=new i({iceServers:[{urls:Is}]})}catch{this.fail(`no_webrtc`);return}this.pc=e;let n=e.createDataChannel(t.label??`join`,{ordered:!0});if(n.binaryType=`arraybuffer`,this.dc=n,n.onopen=()=>this.opened(n),n.onmessage=e=>this.fromChannel(e.data),n.onclose=()=>{this.dc===n&&this.dropped()},t.video&&e.addTransceiver){try{let t=e.addTransceiver(`video`,{direction:`recvonly`}),n=zs(globalThis.RTCRtpReceiver?.getCapabilities?.(`video`));n.length&&t.setCodecPreferences&&t.setCodecPreferences(n)}catch{}try{e.addTransceiver(`audio`,{direction:`recvonly`})}catch{}e.ontrack=t=>{if(this.pc!==e)return;let n=this.media?.stream??t.streams[0]??new MediaStream;n.getTracks().includes(t.track)||n.addTrack(t.track),this.media=t.track.kind===`audio`?{stream:n,receiver:this.media?.receiver??t.receiver,audio:t.receiver}:{stream:n,receiver:t.receiver,...this.media?.audio?{audio:this.media.audio}:{}}}}e.onicecandidate=t=>{if(this.pc!==e)return;let n=t.candidate;if(!n||!n.candidate)return;let r={type:`candidate`,candidate:n.candidate,sdpMid:n.sdpMid??`0`};this.offerSent?this.signal(r):this.ownEarly.push(r)},e.oniceconnectionstatechange=()=>{if(this.pc!==e)return;let t=e.iceConnectionState;o(`ice: ${t}`),t===`failed`&&(this.readyState===0?this.fail(`no_direct`):this.dropped())},this.offerSdp=(async()=>{let t=await e.createOffer();return await e.setLocalDescription(t),e.localDescription?.sdp??t.sdp??``})().catch(()=>(this.pc===e&&this.fail(`no_webrtc`),null))}async sendOffer(){let e=this.pc,t=this.offerSdp;if(!e||!t||this.offerSent)return;this.clearTimer(),this.timer=setTimeout(()=>{this.timer=null,this.readyState===0&&this.fail(`no_direct`)},a);let n=await t;if(this.pc===e&&n!==null&&this.readyState===0){this.signal({type:`offer`,sdp:n}),this.offerSent=!0;for(let e of this.ownEarly.splice(0))this.signal(e)}}async onSignal(t){let n=this.pc;if(t.type===`bye`)this.fail(t.why===`full`?`net_full`:`offer`);else if(n){if(t.type===`answer`){if(this.answered||typeof t.sdp!=`string`)return;if(e.fp?!js(t.sdp,e.fp):As(t.sdp)===null){o(`answer: fingerprint does not match the link`),this.fail(`mismatch`);return}this.answered=!0;try{await n.setRemoteDescription({type:`answer`,sdp:t.sdp});for(let e of this.early.splice(0))await n.addIceCandidate(e).catch(()=>{})}catch{this.fail(`offer`)}}else if(t.type===`candidate`&&typeof t.candidate==`string`&&t.candidate){let e={candidate:t.candidate,sdpMid:typeof t.sdpMid==`string`?t.sdpMid:`0`,sdpMLineIndex:typeof t.sdpMLineIndex==`number`?t.sdpMLineIndex:0};this.answered?await n.addIceCandidate(e).catch(()=>{}):this.early.push(e)}}}opened(e){this.dc===e&&this.readyState===0&&(this.clearTimer(),this.readyState=1,o(`channel open`),this.leaveHub(),this.onopen?.(new Event(`open`)))}fromChannel(e){if(this.readyState!==1)return;if(typeof e==`string`){this.onmessage?.(new MessageEvent(`message`,{data:e}));return}if(!(e instanceof ArrayBuffer))return;let t=this.rx.push(e);switch(t.kind){case`ping`:try{this.dc?.send(Fs(t.data))}catch{}return;case`message`:this.onmessage?.(new MessageEvent(`message`,{data:t.data}));return;case`error`:o(`channel: bad binary message (${t.why})`),this.dropped();return;default:return}}async netPath(){let e=this.pc;if(!e||this.readyState!==1||typeof e.getStats!=`function`)return null;try{return Os(await e.getStats())}catch{return null}}send(e){let t=this.dc;if(this.readyState!==1||!t||t.readyState!==`open`)throw Error(`not open`);if(typeof e==`string`){t.send(e);return}let n=ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e);for(let e of Ns(n))t.send(e)}close(){this.readyState!==3&&(this.teardown(),this.emitClose(1e3,``,!0))}clearTimer(){this.timer&&clearTimeout(this.timer),this.timer=null}leaveHub(){let e=this.hub;if(this.hub=null,e)try{e.readyState===1&&e.send(JSON.stringify({t:`leave`})),e.close(1e3)}catch{}}hubRestarting(){let e=Date.now();return this.hubBackUntil||=e+Rs,e>=this.hubBackUntil?!1:(o(`hub: restarting, trying again`),this.clearTimer(),this.leaveHub(),this.closePeer(),this.answered=!1,this.early=[],this.timer=setTimeout(()=>{this.timer=null,this.begin()},Ls),!0)}teardown(){this.readyState=3,this.clearTimer(),this.leaveHub(),this.closePeer()}closePeer(){let e=this.pc,t=this.dc;this.pc=null,this.dc=null,this.media=null,this.offerSdp=null,this.offerSent=!1,this.ownEarly=[];try{t?.close()}catch{}try{e?.close()}catch{}}dropped(){this.readyState!==3&&(this.teardown(),this.emitClose(1006,``,!1))}fail(e){this.readyState!==3&&(o(`failed: ${e}`),this.teardown(),this.emitClose(Ie,`net:${e}`,!1))}emitClose(e,t,n){let r=this.onclose;if(!r)return;let i=typeof CloseEvent>`u`?{type:`close`,code:e,reason:t,wasClean:n}:new CloseEvent(`close`,{code:e,reason:t,wasClean:n});setTimeout(()=>r(i),0)}}return n=s,n.CONNECTING=0,n.OPEN=1,n.CLOSING=2,n.CLOSED=3,s}function Ws(e,t=0){return/iPad/.test(e)||/Macintosh/.test(e)&&t>1?`ipad`:/iPhone|iPod/.test(e)?`iphone`:/Android/.test(e)?`android`:`phone`}var Gs=new URLSearchParams(location.hash.slice(1)),Ks=Gs.get(`t`)??``,qs=Gs.get(`w`)===`1`,Js=Ws(navigator.userAgent,navigator.maxTouchPoints),Ys=oo({get:yt,set:vt}),Xs=Be(location.hash),Zs=(0,x.createRoot)(document.getElementById(`root`));if(Xs){let e=Us(Xs,{label:`pad`,log:e=>console.info(`[pad] ${e}`)}),t=`ps5upload.pad.rt.${Xs.room}`,n=yt(t),r={t:Xs.key,name:Js,d:Ys,...qs?{w:1}:{},...n?{rt:n}:{}},i=Me(location.hash,`pad`);Zs.render((0,L.jsx)(vs,{url:ks(Xs.hub),computer:null,watch:qs,transport:e,hello:r,onReconnectToken:e=>vt(t,e),lanUrl:i?Ne(i,{watch:qs}):null}))}else{let e=location.pathname.replace(/\/pad\/?$/,``),t=`${location.protocol===`https:`?`wss`:`ws`}://${location.host}${e}/api/pad/ws?t=${encodeURIComponent(Ks)}&name=${Js}&d=${Ys}${qs?`&w=1`:``}`;Zs.render((0,L.jsx)(ws,{appLink:Ts(location.href),children:(0,L.jsx)(vs,{url:t,computer:location.hostname,watch:qs})}))} diff --git a/engine/crates/ps5upload-engine/src/pkg_install.rs b/engine/crates/ps5upload-engine/src/pkg_install.rs index 1c27214d8..8ae050101 100644 --- a/engine/crates/ps5upload-engine/src/pkg_install.rs +++ b/engine/crates/ps5upload-engine/src/pkg_install.rs @@ -3432,6 +3432,7 @@ fn stream_metadata( content_flags: 0, icon_png_base64: None, warnings: vec![], + declared_size: None, } } @@ -4541,35 +4542,72 @@ fn gc_old_sessions(map: &mut HashMap, now: u64, max_age: before - map.len() } -/// Why the package at `path` (a file on this computer) can't be changed now: a console is -/// installing from it, or it is shared as an install link. `None` when no session serves it. -/// "Installing" is what [`is_rival`] means by it: a session that has not ended and that a -/// console fetched from, or the app asked about, within the last `RIVAL_ACTIVE_WINDOW_SEC`. +/// Why the package at `path` (a file on this computer) can't be changed now: an install of it +/// has not finished, or it is shared as an install link. `None` when no session serves it. +/// +/// Not finished means handed to a console and not yet ended, however long ago the console last +/// fetched: a PS5 holds a second install until the first ends, and a download can be paused +/// there, so a console quiet for hours can still come back for the rest. It used to be free 90 +/// seconds after the last fetch, and an install that resumed then read bytes a rename had +/// changed. A session is over once it is released (the install was stopped or removed, or its +/// end is known: delivered whole, refused, never fetched) or once the idle sweep has dropped it +/// ([`gc_old_sessions`]: nothing fetched it for `PKG_SESSION_MAX_AGE_SEC`). The answer names +/// the console and how to free the package now: stop that install, or remove it from the queue +/// ([`release_sessions_of`]). pub(crate) fn serving(state: &PkgInstallState, path: &std::path::Path) -> Option { let real = |p: &std::path::Path| std::fs::canonicalize(p).unwrap_or_else(|_| p.to_path_buf()); let me = real(path); - let now = now_unix(); let sessions = state.sessions.lock().unwrap_or_else(|e| e.into_inner()); sessions .values() .filter(|s| !s.cancelled && s.remote.is_none()) - .filter(|s| { - s.shared_link - || (s.terminal_status.is_none() - && now.saturating_sub(s.last_activity_unix.max(s.created_at_unix)) - < RIVAL_ACTIVE_WINDOW_SEC) - }) + .filter(|s| s.shared_link || s.terminal_status.is_none()) .find(|s| s.parts.iter().any(|p| real(p) == me)) .map(|s| { if s.shared_link { "this package is shared as an install link: stop sharing it first".to_string() } else { - "a PS5 is installing from this package: wait for the install to end, or stop it" - .to_string() + let console = crate::install::console_id(&s.ps5_mgmt_addr); + format!( + "an install of this package on the PS5 at {console} has not finished, and \ + the PS5 may still read from it: stop that install, or remove it from the \ + queue, to free the package (it is also freed by itself {} hours after the \ + PS5 last read from it)", + pkg_session_max_age_sec().div_ceil(3600) + ) } }) } +/// Releases every install session that serves the package at `path` (a file on this computer) +/// to the console `console` (its [`crate::install::console_id`], any case); shared links are +/// stopped on their own. The way out of [`serving`] for an install that ended without its +/// session (a stall the console may resume): the user removes it from the queue, and the console, +/// should it come back, is told the install is over. Returns how many were released. +pub(crate) fn release_sessions_of( + state: &PkgInstallState, + console: &str, + path: &std::path::Path, +) -> usize { + let real = |p: &std::path::Path| std::fs::canonicalize(p).unwrap_or_else(|_| p.to_path_buf()); + let me = real(path); + let mut map = state.sessions.lock().unwrap_or_else(|e| e.into_inner()); + let ids: Vec = map + .iter() + .filter(|(_, s)| !s.cancelled && !s.shared_link && s.remote.is_none()) + .filter(|(_, s)| crate::install::console_id(&s.ps5_mgmt_addr).eq_ignore_ascii_case(console)) + .filter(|(_, s)| s.parts.iter().any(|p| real(p) == me)) + .map(|(id, _)| id.clone()) + .collect(); + for id in &ids { + mark_released(&mut map, id); + } + if !ids.is_empty() { + persist::save(&map); + } + ids.len() +} + /// Whether `other` is a live install of the same package to the same console as `new`. fn is_rival(other: &InstallSession, new: &InstallSession, now: u64) -> bool { !other.cancelled @@ -5366,14 +5404,32 @@ Marvel's%20Spider-Man%202%20-%20PPSA03016%20-%20v1.4.3%20-%20US%20-%20BASE.pkg"; }; assert_eq!(serving(&state, &a), None, "no session at all"); put(&|_| {}); - assert!(serving(&state, &a).unwrap().contains("installing from")); + assert!(serving(&state, &a).unwrap().contains("has not finished")); assert_eq!(serving(&state, &b), None, "another package"); // The same file by another spelling of its path. assert!(serving(&state, &dir.join(".").join("a.pkg")).is_some()); put(&|s| s.cancelled = true); assert_eq!(serving(&state, &a), None, "stopped"); - put(&|s| s.last_activity_unix = now_unix() - RIVAL_ACTIVE_WINDOW_SEC - 1); - assert_eq!(serving(&state, &a), None, "nothing fetched it lately"); + // Quiet for an hour, not ended: a paused or held download can still resume, so it holds. + // (It used to be free 90 seconds after the last fetch.) + put(&|s| { + s.created_at_unix = now_unix() - 3600; + s.last_activity_unix = now_unix() - 3600; + }); + let why = serving(&state, &a).expect("an unfinished install holds the package"); + assert!(why.contains("has not finished"), "{why}"); + assert!(why.contains("remove it from the queue"), "{why}"); + // The idle sweep dropping it frees it. + { + let mut sessions = state.sessions.lock().unwrap(); + gc_old_sessions( + &mut sessions, + now_unix() + pkg_session_max_age_sec(), + pkg_session_max_age_sec(), + ); + assert!(sessions.is_empty()); + } + assert_eq!(serving(&state, &a), None, "swept"); put(&|s| { s.shared_link = true; s.last_activity_unix = 0; @@ -5381,6 +5437,31 @@ Marvel's%20Spider-Man%202%20-%20PPSA03016%20-%20v1.4.3%20-%20US%20-%20BASE.pkg"; assert!(serving(&state, &a) .unwrap() .contains("shared as an install link")); + // A shared link is stopped as a link, never by removing an install. + assert_eq!(release_sessions_of(&state, "1.2.3.4", &a), 0); + assert!(serving(&state, &a).is_some()); + + // Removing the install from the queue releases its session: free, and the console is + // told the install is over. Another console's install of the same package is not touched. + put(&|s| s.ps5_mgmt_addr = "10.0.0.7:9120".into()); + let other = dummy_session(vec![(a.clone(), 1)]); + let other_console = crate::install::console_id(&other.ps5_mgmt_addr); + assert_ne!(other_console, "10.0.0.7"); + state.sessions.lock().unwrap().insert("t".into(), other); + assert_eq!( + release_sessions_of(&state, "10.0.0.7", &b), + 0, + "another package" + ); + assert_eq!(release_sessions_of(&state, "10.0.0.7", &a), 1); + assert!(state.sessions.lock().unwrap()["s"].cancelled); + assert!(!state.sessions.lock().unwrap()["t"].cancelled); + assert!( + serving(&state, &a).is_some(), + "the other console's install still holds it" + ); + assert_eq!(release_sessions_of(&state, &other_console, &a), 1); + assert_eq!(serving(&state, &a), None); std::fs::remove_dir_all(&dir).ok(); } diff --git a/engine/crates/ps5upload-engine/src/pkg_name_api.rs b/engine/crates/ps5upload-engine/src/pkg_name_api.rs index e551a42da..ab1a708fa 100644 --- a/engine/crates/ps5upload-engine/src/pkg_name_api.rs +++ b/engine/crates/ps5upload-engine/src/pkg_name_api.rs @@ -121,7 +121,8 @@ fn whole(path: &Path) -> Result<(), String> { } /// `GET /api/pkg/name?path=`: the names a package on this computer holds (one per language) -/// and whether they can be changed. `refusal` is set when they can't: `code` is `retail` for an +/// and whether they can be changed. `room` is how long a new name may be in this package, in +/// UTF-8 bytes (`default_name`: changing the default name only; `all_languages`). `refusal` is set when they can't: `code` is `retail` for an /// official package, `patch` for a delta update, `no_name`, or `unsupported` with the reason. pub(crate) async fn get_handler(Query(q): Query) -> Response { let read = tokio::task::spawn_blocking(move || -> Result { @@ -149,8 +150,9 @@ pub(crate) async fn get_handler(Query(q): Query) -> Response { } /// `POST /api/pkg/name` `{path, name, all_languages}`: gives a fake package on this computer -/// another name, in place. 409 while the package is in use (an install, an upload or a build -/// reads it, or another program has it open); 400 with the reason when it can't be done (an +/// another name, in place. 409 while the package is in use (an install of it has not finished, +/// however long ago the PS5 last read from it; an upload or a build reads it, or another program +/// has it open), with what holds it and how to free it; 400 with the reason when it can't be done (an /// official package, a name that does not fit). On any failure the file is as it was. pub(crate) async fn set_handler( State(state): State, diff --git a/engine/crates/ps5upload-engine/src/pkg_name_api/tests.rs b/engine/crates/ps5upload-engine/src/pkg_name_api/tests.rs index 46e036783..c62bd7eec 100644 --- a/engine/crates/ps5upload-engine/src/pkg_name_api/tests.rs +++ b/engine/crates/ps5upload-engine/src/pkg_name_api/tests.rs @@ -151,6 +151,10 @@ async fn a_package_is_renamed_through_the_routes() { assert_eq!(names["other_names"], 1); assert_eq!(names["max_bytes"], 127); assert_eq!(names["entries"].as_array().unwrap().len(), 3); + // The package's own room for a new name, for the field to count against before it asks. + let room = |which: &str| names["room"][which].as_u64().expect("the room is a number"); + assert!(room("default_name") >= NAME.len() as u64 && room("default_name") <= 127); + assert!(room("all_languages") >= 1 && room("all_languages") <= room("default_name")); let path = pkg.to_string_lossy().into_owned(); let (status, done) = post(json!({ "path": path, "name": " A Game " })).await; @@ -237,8 +241,24 @@ async fn an_install_served_from_the_package_refuses_the_rename() { state.sessions.lock().unwrap().insert("s1".into(), session); let (code, why) = rename(&state, &request).unwrap_err(); assert_eq!(code, StatusCode::CONFLICT); - assert!(why.contains("installing from this package"), "{why}"); + assert!(why.contains("an install of this package"), "{why}"); no_journal(&pkg); + // Quiet for an hour and not ended (a download the PS5 holds or paused): still refused, so a + // resumed install never reads renamed bytes. It used to be free after 90 seconds. + { + let mut sessions = state.sessions.lock().unwrap(); + let s = sessions.get_mut("s1").unwrap(); + let hour_ago = std::time::SystemTime::now() + .duration_since(std::time::UNIX_EPOCH) + .unwrap() + .as_secs() + - 3600; + s.created_at_unix = hour_ago; + s.last_activity_unix = hour_ago; + } + let (code, why) = rename(&state, &request).unwrap_err(); + assert_eq!(code, StatusCode::CONFLICT); + assert!(why.contains("remove it from the queue"), "{why}"); // Once the install has ended the package is free. state .sessions diff --git a/engine/crates/ps5upload-engine/src/queue_api.rs b/engine/crates/ps5upload-engine/src/queue_api.rs index cf36d7e99..45c60ae08 100644 --- a/engine/crates/ps5upload-engine/src/queue_api.rs +++ b/engine/crates/ps5upload-engine/src/queue_api.rs @@ -1255,8 +1255,11 @@ fn job_end(state: &Value) -> Option { "done" => Some(End::with_status(Status::Done)), "failed" => { let error = field("error").unwrap_or("the job failed"); - // A build's own word for it. - if error == "transfer_cancelled" || error == "cancelled" { + // Stopped, not failed: the job's typed reason says so, however its error is worded + // ("cancelled; nothing was written", "uploading x: transfer_cancelled"). Read from the + // error alone, those were failures: a paused item was held as failed, and a run set + // to stop on a failure stopped. + if crate::is_cancelled_end(field("error_reason"), field("error")) { return Some(End { code: Some("cancelled".to_string()), ..End::with_status(Status::Cancelled) @@ -1641,7 +1644,9 @@ struct RemoveBody { /// POST /api/queue/{id}/remove — drops an item that is not running. A running upload or download /// needs `cancel: true`: it stops and goes (202). A running install is never removed: the console -/// goes on with it whatever the queue says. +/// goes on with it whatever the queue says. An install from a package on this computer that has +/// ended without its session (one the PS5 may resume) gives that session up as it goes: the +/// package is free to rename, and the PS5, should it come back for it, is told it is over. async fn remove_handler( State(queue): State, Path(id): Path, @@ -1693,7 +1698,15 @@ async fn remove_handler( .into_response(); } let view = book.view(&book.items[at]); - book.items.remove(at); + let gone = book.items.remove(at); + drop(book); + // An install that ended without its session (a stall the console may resume) holds its + // package against a rename (`pkg_install::serving`): removing it is the way to free it. + if let (Some((console, path)), Some(installs)) = + (install_package_of(&gone), queue.0.installs.get()) + { + crate::pkg_install::release_sessions_of(installs, &console, &path); + } view }; bus().publish_json("queue", &json!({ "action": "removed", "item": view })); @@ -1701,6 +1714,16 @@ async fn remove_handler( Json(json!({ "removed": true, "id": id })).into_response() } +/// The console and the package on this computer of an install item, whose install sessions go +/// when it is removed; `None` for any other item, or an install from anywhere else. +fn install_package_of(item: &Item) -> Option<(String, PathBuf)> { + if item.kind != ItemKind::Install { + return None; + } + let path = item.request.get("source")?.get("host_file")?.as_str()?; + Some((item.console.clone(), PathBuf::from(path))) +} + #[derive(Deserialize)] struct MoveBody { /// Among the console's waiting items, from 0. Past the end means the end. @@ -1931,6 +1954,53 @@ mod tests { } } + /// Removing an install item frees its package for a rename (`pkg_install::serving`): it names + /// the console and the package on this computer its sessions are released by. Only those. + #[test] + fn a_removed_install_names_the_package_its_sessions_are_released_by() { + let install = test_item( + ItemKind::Install, + json!({ "ps5_addr": "10.0.0.2", "source": { "host_file": "/games/a.pkg" } }), + Secrets::default(), + ); + assert_eq!( + install_package_of(&install), + Some(("10.0.0.2".to_string(), PathBuf::from("/games/a.pkg"))) + ); + let on_console = test_item( + ItemKind::Install, + json!({ "ps5_addr": "10.0.0.2", "source": { "console_path": "/data/a.pkg" } }), + Secrets::default(), + ); + assert_eq!(install_package_of(&on_console), None); + let upload = test_item( + ItemKind::parse("upload_tar").unwrap(), + json!({ "source": { "host_file": "/games/a.pkg" } }), + Secrets::default(), + ); + assert_eq!(install_package_of(&upload), None); + + // And it is what frees the package. + let state = crate::pkg_install::PkgInstallState::default(); + let dir = std::env::temp_dir().join(format!("ps5u-queue-release-{}", std::process::id())); + std::fs::create_dir_all(&dir).unwrap(); + let pkg = dir.join("a.pkg"); + std::fs::write(&pkg, b"a").unwrap(); + let mut s = crate::pkg_install::tests::dummy_session(vec![(pkg.clone(), 1)]); + s.ps5_mgmt_addr = "10.0.0.2:9120".into(); + state.sessions.lock().unwrap().insert("s".into(), s); + assert!(crate::pkg_install::serving(&state, &pkg).is_some()); + let mut item = install.clone(); + item.request["source"]["host_file"] = json!(pkg.to_string_lossy()); + let (console, path) = install_package_of(&item).unwrap(); + assert_eq!( + crate::pkg_install::release_sessions_of(&state, &console, &path), + 1 + ); + assert_eq!(crate::pkg_install::serving(&state, &pkg), None); + std::fs::remove_dir_all(&dir).ok(); + } + #[test] fn ends_read_from_a_job_and_an_install() { assert!(job_end(&json!({ "status": "running" })).is_none()); @@ -1954,6 +2024,19 @@ mod tests { .status, Status::Cancelled ); + // A cancel worded otherwise, typed by its reason (as the engine sets it for a job that + // was stopped, and for a cancel wrapped in context): cancelled, not failed. + for job in [ + json!({ "status": "failed", "error": "cancelled; nothing was written", + "error_reason": "cancelled" }), + json!({ "status": "failed", "error": "uploading x: transfer_cancelled", + "error_reason": "cancelled" }), + json!({ "status": "failed", "error": "raw", "error_reason": "transfer_cancelled" }), + ] { + let end = job_end(&job).unwrap(); + assert_eq!(end.status, Status::Cancelled, "{job}"); + assert_eq!(end.code.as_deref(), Some("cancelled")); + } assert!(install_end(&json!({ "phase": "deliver" })).is_none()); let done = install_end(&json!({ "phase": "done", "verdict": "may_not_launch" })).unwrap(); diff --git a/engine/crates/ps5upload-engine/src/remote/ftp_fs.rs b/engine/crates/ps5upload-engine/src/remote/ftp_fs.rs index c333e0d0c..95dd3ad47 100644 --- a/engine/crates/ps5upload-engine/src/remote/ftp_fs.rs +++ b/engine/crates/ps5upload-engine/src/remote/ftp_fs.rs @@ -667,6 +667,15 @@ impl FtpFs { self.list_on(&mut s, dir).await } + /// Whether the server path `full` is a folder, asked by entering it. CWD names one exact + /// folder: no server reads its argument as a pattern, so a folder that is not there cannot + /// answer as an empty one (which LIST of its path can, on a server that globs). `None` when + /// the answer says neither (no answer, or one other than success and 550). + async fn folder_there(&self, full: &str) -> Option { + let mut s = self.session.lock().await; + cwd_says(&mut s, full).await + } + /// A read session with no transfer open, or a new sign-in. async fn side_session(&self) -> Result { { @@ -694,8 +703,19 @@ impl FtpFs { // folder named "[PS5] Hellblade [RUS text, …]" listed by its path matched nothing // and showed empty (Discord: its .ffpfsc showed over SMB, not FTP). Every // other command here names an absolute path, so the working folder is free to move. - let here = s.cwd(dir).await.is_ok(); - let arg = if here { None } else { Some(dir) }; + // + // A folder the server won't enter is listed by its path, for a server that takes + // CWD badly. But a server that globs answers a missing path with an empty listing + // and success: from that alone a folder that is not there read as there and empty + // (and a failed MKD as made). So once CWD has said 550, only a listing with + // something in it shows the folder is there, and a path that is a pattern (`*`, + // `?`, `[`) is not listed at all: it could match some other name. + let here = cwd_says(s, dir).await; + let not_there = || RemoteError::NotFound(format!("{dir} not found")); + if here == Some(false) && dir.contains(['*', '?', '[']) { + return Err(not_there()); + } + let arg = if here == Some(true) { None } else { Some(dir) }; let listed = if mlsd { s.mlsd(arg).await } else { @@ -704,6 +724,9 @@ impl FtpFs { match listed { Ok(lines) => { let mut entries = parse_listing(&lines, mlsd); + if here == Some(false) && entries.is_empty() { + return Err(not_there()); + } // A link to a file is listed with the file's size, which SIZE gives (it // follows the link). A link to a folder, or a server without SIZE, stays // as listed. @@ -730,6 +753,16 @@ impl FtpFs { } } +/// What CWD into the server path `full` says over `s`: `Some(true)` it is a folder, +/// `Some(false)` the server answered 550 (no such folder, or not one), `None` anything else. +async fn cwd_says(s: &mut Ftp, full: &str) -> Option { + match tokio::time::timeout(STEP, s.cwd(full)).await { + Ok(Ok(())) => Some(true), + Ok(Err(FtpError::UnexpectedResponse(r))) if r.status.code() == 550 => Some(false), + _ => None, + } +} + /// What SIZE and MDTM say about one exact path. #[derive(Debug, Clone, Copy, PartialEq)] pub(crate) enum Probe { @@ -1033,18 +1066,39 @@ impl RemoteFs for FtpFs { }) .await }; + // Whether the folder is there is asked by entering it, never by listing it: a server + // that reads a LIST argument as a pattern lists a folder that is not there as empty, + // which made a failed MKD read as success. match made { - Ok(()) => Ok(()), + // Made, the server says: there, as far as anyone can tell, unless entering it says + // it is not. + Ok(()) => match self.folder_there(&full).await { + Some(false) => Err(RemoteError::Io(format!( + "the server said it made the folder {path}, but it is not there" + ))), + _ => Ok(()), + }, // MKD answers 550 (or 521) for a name already taken; whether that is a folder // (fine) or a file (not) only a look can tell. - Err(e @ (RemoteError::NotFound(_) | RemoteError::Io(_))) => match self.stat(path).await - { - Ok(st) if st.is_dir => Ok(()), - Ok(_) => Err(RemoteError::Exists(format!("{path} is a file"))), - // LIST hides dot-folders on many servers: one that lists is there. - Err(_) if self.entries(path).await.is_ok() => Ok(()), - Err(_) => Err(e), - }, + Err(e @ (RemoteError::NotFound(_) | RemoteError::Io(_))) => { + match self.folder_there(&full).await { + Some(true) => Ok(()), + // Not a folder: a file by that name, or nothing (the MKD failed). + Some(false) => match self.stat(path).await { + Ok(st) if !st.is_dir => { + Err(RemoteError::Exists(format!("{path} is a file"))) + } + _ => Err(e), + }, + // A server that answers CWD neither way: the parent's listing, which shows + // a folder only when it really holds one (a missing one is not in it). + None => match self.stat(path).await { + Ok(st) if st.is_dir => Ok(()), + Ok(_) => Err(RemoteError::Exists(format!("{path} is a file"))), + Err(_) => Err(e), + }, + } + } Err(e) => Err(e), } } @@ -1668,8 +1722,16 @@ mod tests { use tokio::io::{AsyncBufReadExt, AsyncWriteExt, BufReader}; let ctl = tokio::net::TcpListener::bind("127.0.0.1:0").await.unwrap(); let port = ctl.local_addr().unwrap().port(); + // The folders it holds, shared by its sessions. + let folders: Arc>> = + Arc::new(std::sync::Mutex::new( + ["/", GLOB_DIR, "/torrents", "/liar"] + .map(str::to_string) + .into(), + )); tokio::spawn(async move { while let Ok((sock, _)) = ctl.accept().await { + let folders = Arc::clone(&folders); tokio::spawn(async move { let (rd, mut wr) = sock.into_split(); let mut rd = BufReader::new(rd); @@ -1686,11 +1748,30 @@ mod tests { "PASS" => "230 OK".into(), "TYPE" => "200 TYPE is now 8-bit binary".into(), "PWD" => format!("257 \"{cwd}\" is your current location"), - "CWD" if arg == GLOB_DIR || arg == "/" || arg == "/torrents" => { + "CWD" if folders.lock().unwrap().contains(arg) => { cwd = arg.to_string(); "250 OK".into() } "CWD" => "550 No such directory".into(), + // Made only inside a folder that is there; a folder under + // `/liar` is said to be made and is not, as a broken server can. + "MKD" if arg.starts_with("/liar/") => format!("257 \"{arg}\" created"), + "MKD" => { + let parent = arg.rsplit_once('/').map_or("/", |(p, _)| { + if p.is_empty() { + "/" + } else { + p + } + }); + let mut f = folders.lock().unwrap(); + if f.contains(arg) || !f.contains(parent) { + "550 Can't create the directory".into() + } else { + f.insert(arg.to_string()); + format!("257 \"{arg}\" created") + } + } "PASV" => { let l = tokio::net::TcpListener::bind("127.0.0.1:0").await.unwrap(); let p = l.local_addr().unwrap().port(); @@ -1756,8 +1837,12 @@ mod tests { ); let e = fs.stat(&format!("{GLOB_DIR}/{GLOB_FILE}")).await.unwrap(); assert_eq!((e.is_dir, e.size), (false, GLOB_SIZE)); - // A folder the server won't enter falls back to listing by its path. - assert!(fs.list("/nope", None).await.unwrap().entries.is_empty()); + // A folder the server won't enter, listed by its path: this server answers an empty + // listing, which is no folder. It used to list as there and empty. + assert!(matches!( + fs.list("/nope", None).await, + Err(RemoteError::NotFound(_)) + )); } /// An upload holds the session for its whole file; browsing meanwhile is answered over @@ -1913,4 +1998,45 @@ mod tests { let tail = f.read_at(GLOB_SIZE - 4096, 4096).await.unwrap(); assert_eq!(tail.len(), 4096); } + + /// The audit's case: on a server that reads a LIST argument as a pattern, a folder that is + /// not there listed as there and empty, so a MKD the server refused was reported as made. + /// Whether a folder is there is now asked by entering it. + #[tokio::test] + async fn a_folder_that_is_not_there_is_never_made_or_listed_as_empty() { + let port = globbing_server().await; + let mut conn = crate::remote::store::conn("t", crate::remote::store::Protocol::Ftp); + conn.host = "127.0.0.1".into(); + conn.port = port; + conn.user = "t".into(); + let secret = Secret::Password { + password: "t".into(), + }; + let fs = FtpFs::connect(&conn, &secret, false).await.unwrap(); + // Its parent is not there: the MKD fails, and that is what is said. + assert!(fs.create_dir("/missing/new").await.is_err()); + assert!(matches!( + fs.list("/missing", None).await, + Err(RemoteError::NotFound(_)) + )); + assert!(fs.stat("/missing/new").await.is_err()); + // A folder that can be made is, and lists (empty) once it is. + fs.create_dir("/torrents/new").await.unwrap(); + assert!(fs + .list("/torrents/new", None) + .await + .unwrap() + .entries + .is_empty()); + // Made again: already there, which is fine. + fs.create_dir("/torrents/new").await.unwrap(); + // A server that says it made a folder it did not. + let e = fs.create_dir("/liar/new").await.unwrap_err(); + assert!(e.to_string().contains("not there"), "{e}"); + // A missing folder whose name is a pattern is not listed by its path at all. + assert!(matches!( + fs.list("/torrents/[PS5] gone", None).await, + Err(RemoteError::NotFound(_)) + )); + } } diff --git a/engine/crates/ps5upload-engine/src/rp_diag.rs b/engine/crates/ps5upload-engine/src/rp_diag.rs index ba563180d..7fe54f8d1 100644 --- a/engine/crates/ps5upload-engine/src/rp_diag.rs +++ b/engine/crates/ps5upload-engine/src/rp_diag.rs @@ -41,6 +41,10 @@ struct Seen { } const LEVELS_KEPT: usize = 8; +/// Controllers kept per session. Each phone connection is a source of its own (a new id on every +/// reconnect), so a long session, or a phone that keeps connecting, would add one each time: past +/// this many, the one gone the longest (else the one quiet the longest) makes room. +const SOURCES_KEPT: usize = 16; impl Seen { fn new(state: ControllerState) -> Self { @@ -197,6 +201,16 @@ fn pad_seen_in( Some(s) => match g.sources.get_mut(&source) { Some(seen) => seen.take(*s), None => { + if g.sources.len() >= SOURCES_KEPT { + let oldest = g + .sources + .iter() + .min_by_key(|(_, x)| (!x.gone, x.at)) + .map(|(k, _)| *k); + if let Some(k) = oldest { + g.sources.remove(&k); + } + } g.sources.insert(source, Seen::new(*s)); } }, @@ -551,6 +565,28 @@ mod tests { assert_eq!(phone["state"]["r2"], 0); } + /// A phone that keeps connecting is a new source each time: the list stays short, the + /// controllers still there stay in it, and the newest is always in. + #[test] + fn a_phone_that_keeps_connecting_does_not_grow_the_list() { + let mut g = PadDiag::default(); + pad_seen_in(&mut g, 3, "ps5", 0, Some(&st(0, 0)), &st(0, 0)); + for n in 1..=1000u64 { + pad_seen_in(&mut g, 3, "ps5", n, Some(&st(0, 9)), &st(0, 9)); + pad_seen_in(&mut g, 3, "ps5", n, None, &st(0, 0)); + } + assert_eq!(g.sources.len(), SOURCES_KEPT); + assert!(g.sources.contains_key(&0), "the page, still there, stays"); + assert!(g.sources.contains_key(&1000)); + // With none gone, the quietest makes room. + let mut g = PadDiag::default(); + for n in 0..=SOURCES_KEPT as u64 { + pad_seen_in(&mut g, 3, "ps5", n, Some(&st(0, 0)), &st(0, 0)); + } + assert_eq!(g.sources.len(), SOURCES_KEPT); + assert!(!g.sources.contains_key(&0)); + } + #[test] fn nothing_seen_yet_reads_as_no_session() { let v = controller_json_in(&PadDiag::default(), None, label); diff --git a/engine/crates/ps5upload-engine/src/save_backup.rs b/engine/crates/ps5upload-engine/src/save_backup.rs index eb8e81e3a..4720d0301 100644 --- a/engine/crates/ps5upload-engine/src/save_backup.rs +++ b/engine/crates/ps5upload-engine/src/save_backup.rs @@ -1754,11 +1754,35 @@ pub(crate) fn mark_restored(host: &str, save_path: &str) { let _ = save(DONE_FILE, &done); } +/// Whether `save_path` is one of the places this app keeps the saves of `title_id` in: the +/// console's own (`/user/home//savedata_prospero/`, a PS5 game's, or +/// `/user/home/<user>/savedata/<TITLE>`, a PS4 game's; the user is its hex number), a Switch +/// game's in the Switch emulator (`…/<profile>/<TITLE>`, see [`crate::emulator_saves`]), or a +/// PlayStation or PlayStation 2 emulator's cards or saved states, under that emulator's own title +/// (see [`crate::ps2_saves`]). Anything else is no save folder of `title_id`, however it ends. +fn known_save_place(save_path: &str, title_id: &str) -> bool { + let parts: Vec<&str> = save_path.split('/').collect(); + let console = matches!( + parts.as_slice(), + ["", "user", "home", user, "savedata_prospero" | "savedata", title] + if (1..=8).contains(&user.len()) + && user.bytes().all(|b| b.is_ascii_hexdigit()) + && *title == title_id + ); + console + || (crate::emulator_saves::place_of(save_path).is_some() + && save_path.ends_with(&format!("/{title_id}"))) + || crate::ps2_saves::place_of(save_path).is_some_and(|p| p.emulator.app == title_id) +} + /// A restore empties the console folder `save_path` and fills it from a backup, and unpacks the /// backup under `title_id` here: refused unless `title_id` is one plain name ([`plain`]) and /// `save_path` is a plain absolute path, with no `.`, `..` or empty part, no backslash and /// no control character. Otherwise a path such as `/user/home/1/savedata_prospero/../../../x/CUSA1` -/// ends with the title ID and passed, and the folder it reaches was emptied. +/// ends with the title ID and passed, and the folder it reaches was emptied. And it must be one +/// of the app's own save places for that title ([`known_save_place`]): a plain path that merely +/// ends with the title ID (`/data/games/PPSA01234`, say) is some other folder, and is not +/// emptied either. pub(crate) fn save_folder_ok(save_path: &str, title_id: &str) -> Result<(), String> { if !plain(title_id) { return Err(format!("{title_id:?} is not a title ID")); @@ -1770,8 +1794,8 @@ pub(crate) fn save_folder_ok(save_path: &str, title_id: &str) -> Result<(), Stri .split('/') .skip(1) .all(|part| !part.is_empty() && part != "." && part != ".."); - if !plain_path { - return Err(format!("{save_path} is not a save folder")); + if !plain_path || !known_save_place(save_path, title_id) { + return Err(format!("{save_path} is not a save folder of {title_id}")); } Ok(()) } @@ -3729,6 +3753,52 @@ mod tests { assert!(save_folder_ok("/data/PCSX2/*.ps2", "PPSA99203").is_ok()); } + /// The audit's case: any plain path that ended with the title ID passed, so a restore could + /// empty a folder that is no save at all. Only the app's own save places are taken, each + /// for its own title. + #[test] + fn only_the_apps_own_save_places_are_save_folders() { + for (path, title) in [ + ("/user/home/1/savedata_prospero/PPSA01234", "PPSA01234"), + ("/user/home/1de82450/savedata_prospero/PPSA01234", "PPSA01234"), + ("/user/home/1de82450/savedata/CUSA01234", "CUSA01234"), + ( + "/data/prosperoeden/user/nand/user/save/0000000000000000/1F1E1D1C1B1A19181716151413121110/0100F2C0115B6000", + "0100F2C0115B6000", + ), + ("/data/crux2/memcards", "PPSA99249"), + ("/data/PCSX2/savestates", "PPSA99203"), + ("/data/PCSX2/*.p2s", "PPSA99203"), + ] { + assert!(save_folder_ok(path, title).is_ok(), "{path} {title}"); + } + for (path, title) in [ + // Ends with the title, and is some other folder. + ("/data/games/PPSA01234", "PPSA01234"), + ("/user/app/PPSA01234", "PPSA01234"), + ("/mnt/ext1/PPSA01234", "PPSA01234"), + ( + "/user/home/1/savedata_prospero/PPSA01234/sce_sys", + "sce_sys", + ), + ("/user/home/1/other/PPSA01234", "PPSA01234"), + ("/user/home/nothex/savedata_prospero/PPSA01234", "PPSA01234"), + ( + "/user/home/123456789/savedata_prospero/PPSA01234", + "PPSA01234", + ), + // A save place, of another title. + ("/user/home/1/savedata_prospero/PPSA01234", "PPSA09999"), + ("/data/crux2/memcards", "PPSA99203"), + ("/data/PCSX2/memcards", "PPSA99249"), + // The Switch emulator's root, or a game folder named with another ID. + ("/data/prosperoeden/user/nand/user/save", "save"), + ] { + let e = save_folder_ok(path, title).unwrap_err(); + assert!(e.contains("is not a save folder"), "{path} {title}: {e}"); + } + } + #[test] fn a_restore_is_only_into_the_saves_own_folder() { let ps5 = save_writer("/user/home/1/savedata_prospero/PPSA01234", "PPSA01234", 1).unwrap(); diff --git a/engine/crates/ps5upload-engine/src/save_backup_pass.rs b/engine/crates/ps5upload-engine/src/save_backup_pass.rs index 0bd7ea7ac..2cccf76d7 100644 --- a/engine/crates/ps5upload-engine/src/save_backup_pass.rs +++ b/engine/crates/ps5upload-engine/src/save_backup_pass.rs @@ -1013,10 +1013,25 @@ pub(crate) fn add_items( run.add(items).zip(entries).collect() } +/// Why a save is not copied now: its game (or emulator) is running and may be writing it. +pub(crate) fn running_now(app: &str) -> String { + format!("{app} is running on the PS5: its save waits until it is closed") +} + +/// The title of `e`'s writer that is running, if one is: the game, or the emulator whose save it +/// is (either of an emulator's titles). +fn writer_running<'a>(e: &'a SaveEntry, running: &BTreeSet<String>) -> Option<&'a str> { + crate::emulator_saves::titles_of(crate::emulator_saves::app_of(e)) + .into_iter() + .find(|a| running.contains(&a.to_ascii_uppercase())) +} + /// Continue or Retry: the last run's saves again, each in the places it is not verified in yet /// (`only`: these saves only, by id; their failed places too). Saves done carry over as they are, /// so the run still shows the whole. The saves are looked up again on their consoles (one gone -/// from the console is dropped); a console that does not answer leaves its saves waiting. +/// from the console is dropped); a console that does not answer leaves its saves waiting. So +/// does one that can't say what is running on it, and a save whose game is running waits too, as +/// a new pass would leave it: a save being written is never copied. pub(crate) fn carry_over( console: &dyn Console, run: &RunRef<'_>, @@ -1024,6 +1039,7 @@ pub(crate) fn carry_over( only: Option<&BTreeSet<String>>, ) -> Vec<(usize, String, SaveEntry)> { let mut lists: BTreeMap<String, Result<Vec<SaveEntry>, String>> = BTreeMap::new(); + let mut running: BTreeMap<String, Result<BTreeSet<String>, String>> = BTreeMap::new(); let mut todo = Vec::new(); for old in &last.items { let redo = match only { @@ -1068,6 +1084,28 @@ pub(crate) fn carry_over( None } }; + // A console folder (#899) has no game; a save waits while its game runs, and while the + // console can't say whether it does. + let busy = match &entry { + Some(e) if it.kind != "folder" => { + match running + .entry(it.host.clone()) + .or_insert_with(|| console.running(&it.host)) + { + Ok(titles) => writer_running(e, titles).map(running_now), + Err(why) => { + run.unreached(&it.host, why); + Some(format!("could not ask the PS5 what is running: {why}")) + } + } + } + _ => None, + }; + if let Some(why) = busy { + it.error = Some(why); + run.add(vec![it]); + continue; + } match entry { Some(e) => { it.mtime = e.mtime; @@ -1255,8 +1293,12 @@ pub(crate) fn plan_share_host( ) -> Result<Vec<(Item, SaveEntry)>, String> { use crate::save_backup_server::{due_saves, Pick}; let saves = p.console.list_saves(host)?; - // A game running now is still writing its save; one closed is not. - let running = p.console.running(host).unwrap_or_default(); + // A game running now is still writing its save; one closed is not. A console that can't say + // what runs is not taken to run nothing: it is not planned now, as one that does not answer. + let running = p + .console + .running(host) + .map_err(|e| format!("could not ask the PS5 what is running: {e}"))?; let done = p.records.done(Place::Share); let drive_done = p.records.done(Place::Drive); let mut copies = copies; @@ -1548,6 +1590,8 @@ mod tests { pub id: RefCell<Option<String>>, /// What looking at any folder fails with now (None: it works). pub folder_err: RefCell<Option<String>>, + /// The titles running (upper-case), or why that can't be asked. + pub running: RefCell<Result<BTreeSet<String>, String>>, } const GONE: &str = @@ -1596,7 +1640,7 @@ mod tests { Ok(self.saves.clone()) } fn running(&self, _host: &str) -> Result<BTreeSet<String>, String> { - Ok(BTreeSet::new()) + self.running.borrow().clone() } fn read_save(&self, _host: &str, e: &SaveEntry, tmp: &Path) -> Result<(), String> { if self.crashed() { @@ -1714,6 +1758,7 @@ mod tests { folders: RefCell::default(), id: RefCell::new(Some(PS5_ID.into())), folder_err: RefCell::default(), + running: RefCell::new(Ok(BTreeSet::new())), } } @@ -2416,4 +2461,96 @@ mod tests { ); again.finish(None); } + + /// The audit's cases. A share pass took a console that could not say what runs on it as + /// running nothing, and Continue/Retry did not ask at all: either could copy a save its game + /// was writing. Unknown is not "nothing runs"; a save whose game runs waits. + #[test] + fn a_save_is_never_copied_while_its_game_runs_or_that_cannot_be_asked() { + let s = settings(); + let c = console(0, 0); + let game = c.saves[0].title_id.clone(); + // A new pass, the console unable to say what runs: nothing is planned there. + *c.running.borrow_mut() = Err("the helper did not answer".into()); + let rt = tokio::runtime::Runtime::new().unwrap(); + let fs = MemFs::new(&[]); + let server: Arc<dyn RemoteFs> = Arc::new(fs.share()); + let open = || Ok((Arc::clone(&server), "/b".to_string())); + let records = MemRecords::default(); + let after = |_: &str, _: &SaveEntry| {}; + let p = SharePass { + s: &s, + console: &c, + records: &records, + retry: &Retry::instant(), + rt: rt.handle().clone(), + open: &open, + forget: &|| {}, + keep_going: &|| true, + after_share: &after, + }; + assert!(plan_share_host(&p, None, HOST, None, false, false) + .unwrap_err() + .contains("could not ask the PS5 what is running")); + // Saying a game runs: its saves wait, every other one is planned. + *c.running.borrow_mut() = Ok(BTreeSet::from([game.clone()])); + let items = plan_share_host(&p, None, HOST, None, false, false).unwrap(); + assert!(!items.is_empty()); + assert!(items.iter().all(|(_, e)| e.title_id != game)); + + // A run that left everything, continued. + let journal = Journal::open(None); + let run = journal.begin(Which::Share, "manual").unwrap(); + let mut left = Vec::new(); + for e in c.saves.iter().take(2) { + left.push(journal::new_item( + HOST, + e, + done_key(HOST, &e.path), + &[Place::Share], + )); + } + let other = c.saves[1].title_id.clone(); + assert_ne!(other, game); + run.add(left); + run.finish(Some(("console_gone".into(), "gone".into()))); + let last = journal.last(Which::Share).unwrap(); + + // Can't be asked: nothing is copied, everything waits, and says why. + *c.running.borrow_mut() = Err("the helper did not answer".into()); + let again = journal.begin(Which::Share, "continue").unwrap(); + assert!(carry_over(&c, &again, &last, None).is_empty()); + for i in 0..2 { + let it = again.item(i).unwrap(); + assert_eq!(it.outcome(), Outcome::Left); + assert!(it.error.as_deref().unwrap().contains("what is running")); + } + again.finish(None); + + // The game running: its save waits; the other one goes. + *c.running.borrow_mut() = Ok(BTreeSet::from([game.clone()])); + let again = journal.begin(Which::Share, "continue").unwrap(); + let todo = carry_over(&c, &again, &last, None); + assert_eq!(todo.len(), 1); + assert_eq!(todo[0].2.title_id, other); + let waiting = (0..2) + .map(|i| again.item(i).unwrap()) + .find(|it| it.title_id == game) + .unwrap(); + assert_eq!(waiting.outcome(), Outcome::Left); + assert_eq!(waiting.error, Some(running_now(&game))); + again.finish(None); + + // Retry of that save alone, the game still running: still waits. + let ids = BTreeSet::from([waiting.id.clone()]); + let again = journal.begin(Which::Share, "retry").unwrap(); + assert!(carry_over(&c, &again, &last, Some(&ids)).is_empty()); + again.finish(None); + + // The game closed: Continue copies it. + *c.running.borrow_mut() = Ok(BTreeSet::new()); + let again = journal.begin(Which::Share, "continue").unwrap(); + assert_eq!(carry_over(&c, &again, &last, None).len(), 2); + again.finish(None); + } } diff --git a/engine/crates/ps5upload-engine/src/share/machine.rs b/engine/crates/ps5upload-engine/src/share/machine.rs index 8ecfd071f..d68c37fb5 100644 --- a/engine/crates/ps5upload-engine/src/share/machine.rs +++ b/engine/crates/ps5upload-engine/src/share/machine.rs @@ -80,6 +80,10 @@ pub(crate) struct Request { pub token: Option<String>, pub bytes_done: u64, pub bytes_total: u64, + /// Which connection carries the request now: 1 for the one that asked, one more for each + /// resume. What an earlier connection reports after a newer one took over is ignored, so a + /// late "gone" from a dead link cannot stop the transfer the friend resumed. + pub session: u64, pub asked_at: Instant, pub why: Option<String>, } @@ -179,6 +183,7 @@ impl Machine { token: None, bytes_done: 0, bytes_total: 0, + session: 1, asked_at: now, why: None, }); @@ -229,9 +234,10 @@ impl Machine { Ok(ReqState::Allowed) } - /// An allowed friend connects again with their token: their request, to carry on. Refused - /// once the share was cancelled or expired, or the request ended. - pub(crate) fn resume(&mut self, now: Instant, token: &str) -> Result<u64, Refused> { + /// An allowed friend connects again with their token: their request, to carry on, and the + /// new connection's session (the earlier connection's are stale from now on). Refused once + /// the share was cancelled or expired, or the request ended. + pub(crate) fn resume(&mut self, now: Instant, token: &str) -> Result<(u64, u64), Refused> { let state = self.tick(now); if matches!(state, ShareState::Cancelled | ShareState::Expired) { return Err(state.word()); @@ -245,15 +251,24 @@ impl Machine { return Err(r.state.word()); } r.state = ReqState::Allowed; - Ok(r.rid) + r.session += 1; + Ok((r.rid, r.session)) + } + + /// Whether `session` is the connection carrying request `rid` now. + pub(crate) fn current(&self, rid: u64, session: u64) -> bool { + self.request(rid).is_some_and(|r| r.session == session) } /// Files start going to an allowed friend (`total`: the bytes of what they accepted). - pub(crate) fn sending(&mut self, rid: u64, total: u64) -> Result<(), Refused> { + pub(crate) fn sending(&mut self, rid: u64, session: u64, total: u64) -> Result<(), Refused> { if self.state == ShareState::Cancelled { return Err("cancelled"); } let r = self.request_mut(rid).ok_or("no_request")?; + if r.session != session { + return Err("replaced"); + } if !matches!(r.state, ReqState::Allowed | ReqState::Sending) { return Err(r.state.word()); } @@ -262,15 +277,18 @@ impl Machine { Ok(()) } - pub(crate) fn progress(&mut self, rid: u64, done: u64) { - if let Some(r) = self.request_mut(rid) { + pub(crate) fn progress(&mut self, rid: u64, session: u64, done: u64) { + if let Some(r) = self.request_mut(rid).filter(|r| r.session == session) { r.bytes_done = done.min(r.bytes_total.max(done)); } } /// The friend has everything. - pub(crate) fn done(&mut self, rid: u64) -> Result<(), Refused> { + pub(crate) fn done(&mut self, rid: u64, session: u64) -> Result<(), Refused> { let r = self.request_mut(rid).ok_or("no_request")?; + if r.session != session { + return Err("replaced"); + } if r.state != ReqState::Sending { return Err(r.state.word()); } @@ -280,11 +298,15 @@ impl Machine { } /// The friend's connection ended. Asking: they left. Sending or allowed: kept, so they can - /// resume with their token, unless `cancelled` (they said so). - pub(crate) fn gone(&mut self, rid: u64, cancelled: bool, why: Option<&str>) { + /// resume with their token, unless `cancelled` (they said so). From a connection a resume + /// has since replaced (`session` not the current one): nothing, the newer one carries on. + pub(crate) fn gone(&mut self, rid: u64, session: u64, cancelled: bool, why: Option<&str>) { let Some(r) = self.request_mut(rid) else { return; }; + if r.session != session { + return; + } match r.state { ReqState::Asking => { r.state = if cancelled { @@ -357,16 +379,16 @@ mod tests { let rid = s.ask(now, "Alex", &ids(&["a"])).unwrap(); assert_eq!(s.request(rid).unwrap().state, ReqState::Asking); // Nothing goes before the Allow. - assert_eq!(s.sending(rid, 10), Err("asking")); + assert_eq!(s.sending(rid, 1, 10), Err("asking")); assert_eq!( s.decide(now, rid, true, "tok".into()), Ok(ReqState::Allowed) ); assert_eq!(s.state, ShareState::Used); - s.sending(rid, 10).unwrap(); - s.progress(rid, 4); + s.sending(rid, 1, 10).unwrap(); + s.progress(rid, 1, 4); assert_eq!(s.request(rid).unwrap().bytes_done, 4); - s.done(rid).unwrap(); + s.done(rid, 1).unwrap(); assert_eq!(s.request(rid).unwrap().state, ReqState::Done); assert!(s.finished(now)); } @@ -390,7 +412,7 @@ mod tests { ); assert_eq!(s.state, ShareState::Open); assert_eq!(s.decide(now, rid, true, "t".into()), Err("answered")); - assert_eq!(s.sending(rid, 1), Err("declined")); + assert_eq!(s.sending(rid, 1, 1), Err("declined")); assert_eq!(s.hello(now), Ok(()), "someone else may still ask"); } @@ -404,7 +426,7 @@ mod tests { assert_eq!(s.hello(now), Err("used")); assert_eq!(s.ask(now, "C", &ids(&["a"])), Err("used")); // The allowed friend can still carry on. - assert_eq!(s.resume(now, "t1"), Ok(r1)); + assert_eq!(s.resume(now, "t1"), Ok((r1, 2))); assert_eq!(s.resume(now, "nope"), Err("no_request")); assert_eq!(s.resume(now, ""), Err("no_request")); } @@ -446,10 +468,10 @@ mod tests { let (mut s, now) = m(true); let rid = s.ask(now, "A", &ids(&["a"])).unwrap(); s.decide(now, rid, true, "t".into()).unwrap(); - s.sending(rid, 5).unwrap(); + s.sending(rid, 1, 5).unwrap(); let later = now + DAY * 2; assert!(!s.finished(later), "still sending"); - s.done(rid).unwrap(); + s.done(rid, 1).unwrap(); assert!(s.finished(later)); assert_eq!(s.resume(later, "t"), Err("expired")); } @@ -460,13 +482,13 @@ mod tests { let r1 = s.ask(now, "A", &ids(&["a"])).unwrap(); let r2 = s.ask(now, "B", &ids(&["a"])).unwrap(); s.decide(now, r2, true, "t".into()).unwrap(); - s.sending(r2, 9).unwrap(); + s.sending(r2, 1, 9).unwrap(); s.cancel(); assert_eq!(s.state, ShareState::Cancelled); assert_eq!(s.request(r1).unwrap().state, ReqState::Cancelled); assert_eq!(s.request(r2).unwrap().state, ReqState::Cancelled); assert_eq!(s.hello(now), Err("cancelled")); - assert_eq!(s.sending(r2, 9), Err("cancelled")); + assert_eq!(s.sending(r2, 1, 9), Err("cancelled")); assert_eq!(s.resume(now, "t"), Err("cancelled")); assert!(s.finished(now)); } @@ -475,18 +497,18 @@ mod tests { fn the_friend_leaving_or_cancelling() { let (mut s, now) = m(false); let r1 = s.ask(now, "A", &ids(&["a"])).unwrap(); - s.gone(r1, false, None); + s.gone(r1, 1, false, None); assert_eq!(s.request(r1).unwrap().state, ReqState::Left); // An allowed friend whose connection dropped mid-way can resume… let r2 = s.ask(now, "B", &ids(&["a"])).unwrap(); s.decide(now, r2, true, "t2".into()).unwrap(); - s.sending(r2, 9).unwrap(); - s.gone(r2, false, Some("lost")); + s.sending(r2, 1, 9).unwrap(); + s.gone(r2, 1, false, Some("lost")); assert_eq!(s.request(r2).unwrap().state, ReqState::Allowed); - assert_eq!(s.resume(now, "t2"), Ok(r2)); + assert_eq!(s.resume(now, "t2"), Ok((r2, 2))); // …one who cancelled can't. - s.sending(r2, 9).unwrap(); - s.gone(r2, true, None); + s.sending(r2, 2, 9).unwrap(); + s.gone(r2, 2, true, None); assert_eq!(s.request(r2).unwrap().state, ReqState::Cancelled); assert_eq!(s.resume(now, "t2"), Err("cancelled")); } @@ -499,4 +521,34 @@ mod tests { } assert_eq!(s.ask(now, "late", &ids(&["a"])), Err("busy")); } + + #[test] + fn a_late_gone_from_the_old_connection_leaves_the_resumed_transfer_alone() { + let (mut s, now) = m(true); + let rid = s.ask(now, "A", &ids(&["a"])).unwrap(); + s.decide(now, rid, true, "t".into()).unwrap(); + s.sending(rid, 1, 10).unwrap(); + s.progress(rid, 1, 3); + // The friend's first link went quiet; they connect again before the sender noticed. + let (r, sess) = s.resume(now, "t").unwrap(); + assert_eq!((r, sess), (rid, 2)); + assert!(!s.current(rid, 1)); + assert!(s.current(rid, 2)); + s.sending(rid, 2, 10).unwrap(); + // The old connection's timeout lands now: it changes nothing. + s.gone(rid, 1, false, Some("timeout")); + assert_eq!(s.request(rid).unwrap().state, ReqState::Sending); + assert_eq!(s.request(rid).unwrap().why, None); + s.gone(rid, 1, true, Some("receiver")); + assert_eq!(s.request(rid).unwrap().state, ReqState::Sending); + // Nor do its progress, its start or its done. + s.progress(rid, 2, 7); + s.progress(rid, 1, 1); + assert_eq!(s.request(rid).unwrap().bytes_done, 7); + assert_eq!(s.sending(rid, 1, 10), Err("replaced")); + assert_eq!(s.done(rid, 1), Err("replaced")); + // The new one finishes. + s.done(rid, 2).unwrap(); + assert_eq!(s.request(rid).unwrap().state, ReqState::Done); + } } diff --git a/engine/crates/ps5upload-engine/src/share/manifest.rs b/engine/crates/ps5upload-engine/src/share/manifest.rs index f2d9db2df..8a1c17f66 100644 --- a/engine/crates/ps5upload-engine/src/share/manifest.rs +++ b/engine/crates/ps5upload-engine/src/share/manifest.rs @@ -47,6 +47,21 @@ impl ItemKind { ItemKind::Note => "note", } } + + /// The kind a word names, if it is one of this build's. + pub(crate) fn from_word(w: &str) -> Option<ItemKind> { + [ + ItemKind::App, + ItemKind::Save, + ItemKind::Media, + ItemKind::Cheats, + ItemKind::Controls, + ItemKind::Stream, + ItemKind::Note, + ] + .into_iter() + .find(|k| k.word() == w) + } } /// Where one file's bytes come from. diff --git a/engine/crates/ps5upload-engine/src/share/mod.rs b/engine/crates/ps5upload-engine/src/share/mod.rs index 221f2bce1..ee27ebede 100644 --- a/engine/crates/ps5upload-engine/src/share/mod.rs +++ b/engine/crates/ps5upload-engine/src/share/mod.rs @@ -369,18 +369,19 @@ impl wire::Shares for Registry { }) .unwrap_or(Err("no_share")) } - fn ask(&self, id: &str, name: &str, wants: &[String]) -> Result<u64, &'static str> { + fn ask(&self, id: &str, name: &str, wants: &[String]) -> Result<(u64, u64), &'static str> { let r = with_share(id, |e| { let rid = e.m.ask(Instant::now(), name, wants)?; + let session = e.m.request(rid).map_or(0, |r| r.session); e.bump(); let names: Vec<String> = wants .iter() .filter_map(|w| e.items.iter().find(|i| &i.id == w).map(|i| i.name.clone())) .collect(); - Ok((rid, names)) + Ok((rid, session, names)) }) .unwrap_or(Err("no_share")); - if let Ok((rid, names)) = &r { + if let Ok((rid, _, names)) = &r { crate::log_at!( Info, "together", @@ -391,9 +392,9 @@ impl wire::Shares for Registry { json!({"share": id, "event": "asked", "request": rid, "name": name, "wants": names}), ); } - r.map(|x| x.0) + r.map(|x| (x.0, x.1)) } - fn resume(&self, id: &str, token: &str) -> Result<u64, &'static str> { + fn resume(&self, id: &str, token: &str) -> Result<(u64, u64), &'static str> { let r = with_share(id, |e| e.m.resume(Instant::now(), token)).unwrap_or(Err("no_share")); if r.is_ok() { crate::log_at!(Info, "together", "share {id}: a friend carries on"); @@ -407,6 +408,9 @@ impl wire::Shares for Registry { }) .flatten() } + fn current(&self, id: &str, rid: u64, session: u64) -> bool { + with_share(id, |e| e.m.current(rid, session)).unwrap_or(false) + } async fn changed(&self, id: &str) { let rx = with_share(id, |e| e.changed.subscribe()); match rx { @@ -422,9 +426,9 @@ impl wire::Shares for Registry { }) .flatten() } - fn sending(&self, id: &str, rid: u64, total: u64) -> Result<(), &'static str> { + fn sending(&self, id: &str, rid: u64, session: u64, total: u64) -> Result<(), &'static str> { let r = with_share(id, |e| { - e.m.sending(rid, total)?; + e.m.sending(rid, session, total)?; if !e.started.iter().any(|(r, _)| *r == rid) { e.started.push((rid, now_ms())); } @@ -438,12 +442,12 @@ impl wire::Shares for Registry { } r } - fn progress(&self, id: &str, rid: u64, done: u64) { - with_share(id, |e| e.m.progress(rid, done)); + fn progress(&self, id: &str, rid: u64, session: u64, done: u64) { + with_share(id, |e| e.m.progress(rid, session, done)); } - fn done(&self, id: &str, rid: u64) { + fn done(&self, id: &str, rid: u64, session: u64) { let ok = with_share(id, |e| { - let r = e.m.done(rid); + let r = e.m.done(rid, session); e.bump(); r.is_ok() }); @@ -453,11 +457,19 @@ impl wire::Shares for Registry { } settle(id); } - fn gone(&self, id: &str, rid: u64, cancelled: bool, why: &str) { - with_share(id, |e| { - e.m.gone(rid, cancelled, Some(why)); - e.bump(); + fn gone(&self, id: &str, rid: u64, session: u64, cancelled: bool, why: &str) { + // A connection a resume replaced: the newer one carries the request, so this says nothing. + let current = with_share(id, |e| { + let current = e.m.current(rid, session); + if current { + e.m.gone(rid, session, cancelled, Some(why)); + e.bump(); + } + current }); + if current == Some(false) { + return; + } crate::log_at!( Info, "together", @@ -834,10 +846,109 @@ pub(crate) fn build_item( item.files.push(inline("note.txt", t.into_bytes())?); } } + if item.kind != ItemKind::App { + check_carried(&item)?; + } item.name = item.name.chars().take(120).collect(); Ok(item) } +/// A file's first bytes (up to [`retail::HEAD`]); none when they can't be read. +fn head_of(loc: &Loc) -> Vec<u8> { + use std::io::Read; + match loc { + Loc::Local(p) => { + let mut b = Vec::new(); + if let Ok(f) = std::fs::File::open(p) { + let _ = f.take(retail::HEAD as u64).read_to_end(&mut b); + } + b + } + Loc::Console { addr, path } => { + ps5upload_core::fs_ops::fs_read(addr, path, 0, retail::HEAD as u64).unwrap_or_default() + } + Loc::Inline(d) => d[..d.len().min(retail::HEAD)].to_vec(), + } +} + +/// The rule for an item that isn't the app (retail.rs [`retail::carried`]): a save, screenshots +/// or cheats carry no game. A package, a mount image or an app folder among its files is judged +/// as the app would be (homebrew goes; retail, or what can't be read, is refused), and an +/// archive, whose contents can't be checked, is refused. A save is a zip: its entries are looked +/// at instead. +fn check_carried(item: &Item) -> Result<(), ItemRefused> { + use retail::Carried; + let mut judged: Vec<String> = Vec::new(); + for f in &item.files { + let (full, addr) = match &f.loc { + Loc::Local(p) => (p.to_string_lossy().into_owned(), None), + Loc::Console { addr, path } => (path.clone(), Some(addr.as_str())), + // What this engine wrote from the page's data (controls, cheats on, a note). + Loc::Inline(_) => continue, + }; + let Some(c) = retail::carried(&full, &head_of(&f.loc)) else { + continue; + }; + match c { + Carried::Archive if item.kind == ItemKind::Save => match &f.loc { + Loc::Local(p) => save_zip_carries_nothing(p)?, + _ => return Err(retail::Refusal::Unknown.into()), + }, + Carried::Archive => { + return Err("An archive can't be checked, so it can't be shared." + .to_string() + .into()) + } + Carried::Package(format) => { + // A package on a console can't be read here: it can't be shown to be homebrew. + let build = match addr { + Some(_) => retail::Build::default(), + None => local_build(Path::new(&full), format), + }; + check_app(&build)?; + } + Carried::AppFile => { + let dir = retail::app_folder_of(&full).to_string(); + if judged.contains(&dir) { + continue; + } + let build = match addr { + Some(addr) => console_build(addr, &dir), + None => local_build(Path::new(&dir), "folder"), + }; + check_app(&build)?; + judged.push(dir); + } + } + } + Ok(()) +} + +/// A save's zip holds a save: no package, mount image or program in it. (A save keeps its own +/// `sce_sys/param.sfo`, which is not an app's.) +fn save_zip_carries_nothing(zip: &Path) -> Result<(), ItemRefused> { + let archive = std::fs::File::open(zip) + .ok() + .and_then(|f| zip::ZipArchive::new(std::io::BufReader::new(f)).ok()) + .ok_or_else(|| ItemRefused::from("This file is not a shared save.".to_string()))?; + for name in archive.file_names() { + let name = + name.map_err(|_| ItemRefused::from("This file is not a shared save.".to_string()))?; + let program = match retail::carried(&name, &[]) { + Some(retail::Carried::Package(_)) => true, + Some(retail::Carried::AppFile) => { + let n = name.to_ascii_lowercase(); + !(n.ends_with("/param.sfo") || n.ends_with("/param.json")) + } + _ => false, + }; + if program { + return Err(retail::Refusal::Unknown.into()); + } + } + Ok(()) +} + /// `name`, or `name (2)`… when another file has it. fn unique(files: &[FileEntry], name: &str) -> String { let mut n = name.to_string(); diff --git a/engine/crates/ps5upload-engine/src/share/retail.rs b/engine/crates/ps5upload-engine/src/share/retail.rs index b9f4d68f1..a8797a7bc 100644 --- a/engine/crates/ps5upload-engine/src/share/retail.rs +++ b/engine/crates/ps5upload-engine/src/share/retail.rs @@ -33,6 +33,11 @@ //! //! What has no readable PARAM (an archive, an encrypted package, a broken folder) is refused: //! without build information it can't be shown to be homebrew. +//! +//! The rule holds for every item, not only the app: a package, a mount image or an app folder +//! sent as a save, screenshots or cheats is found by its name or its first bytes ([`carried`]) +//! and judged the same way, and an archive there is refused. A save's zip is looked into instead: +//! a package or a program in it is refused. use serde_json::Value; @@ -319,11 +324,145 @@ pub(crate) fn check(b: &Build) -> Result<(), Refusal> { Ok(()) } +/// A file of a share item other than the app that could carry a game: the rule judges it as it +/// does the app (share/mod.rs), so a retail game can't go as a save, screenshots or cheats. +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub(crate) enum Carried { + /// A package or a mount image, in the Collection's format word (`pkg`, `mount.exfat`, …). + Package(&'static str), + /// A file of an app folder (`eboot.bin`, a `sce_sys/param.*`, an executable): the folder it + /// is in (the one holding `sce_sys`) is the app. + AppFile, + /// An archive: what is in it can't be read, so it can't be shown to be homebrew. + Archive, +} + +/// The bytes [`carried`] looks at, from a file's start. +pub(crate) const HEAD: usize = 16; + +/// What `path` (any `/`-separated path) with these first bytes carries, judged by its name and, +/// as a renamed file keeps its contents, by its first bytes. +pub(crate) fn carried(path: &str, head: &[u8]) -> Option<Carried> { + let lower = path.to_ascii_lowercase(); + let name = lower.rsplit('/').next().unwrap_or(""); + for (ext, format) in [ + (".pkg", "pkg"), + (".exfat", "mount.exfat"), + (".ffpkg", "mount.ffpkg"), + (".ffpfsc", "mount.ffpfsc"), + (".ffpfs", "mount.ffpfs"), + ] { + if name.ends_with(ext) { + return Some(Carried::Package(format)); + } + } + let in_sce_sys = lower.rsplit('/').nth(1) == Some("sce_sys"); + if name == "eboot.bin" + || (in_sce_sys && (name == "param.json" || name == "param.sfo")) + || [".self", ".sprx", ".prx", ".elf"] + .iter() + .any(|e| name.ends_with(e)) + { + return Some(Carried::AppFile); + } + let at = |off: usize, magic: &[u8]| head.get(off..off + magic.len()) == Some(magic); + // PS4/PS5 packages (`\x7FCNT`, `\x7FFIH`), PS3's (`\x7FPKG`). + if at(0, b"\x7FCNT") || at(0, b"\x7FFIH") || at(0, b"\x7FPKG") { + return Some(Carried::Package("pkg")); + } + if at(3, b"EXFAT ") { + return Some(Carried::Package("mount.exfat")); + } + // A compressed PFS image, and a PFS image (its magic 0x20130315 at 8). + if at(0, b"PFSC") { + return Some(Carried::Package("mount.ffpfsc")); + } + if at(8, &0x2013_0315u32.to_le_bytes()) { + return Some(Carried::Package("mount.ffpfs")); + } + // ELF, and the console's signed executables (PS4's, PS5's). + if at(0, b"\x7FELF") || at(0, &[0x4F, 0x15, 0x3D, 0x1D]) || at(0, &[0x54, 0x14, 0xF5, 0xEE]) { + return Some(Carried::AppFile); + } + let archive_name = [".zip", ".7z", ".rar", ".tar", ".gz", ".tgz", ".xz", ".zst"] + .iter() + .any(|e| name.ends_with(e)); + if archive_name + || at(0, b"PK\x03\x04") + || at(0, b"7z\xBC\xAF\x27\x1C") + || at(0, b"Rar!") + || at(0, &[0x1F, 0x8B]) + || at(0, &[0xFD, b'7', b'z', b'X', b'Z']) + || at(0, &[0x28, 0xB5, 0x2F, 0xFD]) + { + return Some(Carried::Archive); + } + None +} + +/// The app folder an [`Carried::AppFile`] at `path` belongs to: the folder holding `sce_sys`, or +/// the file's own folder. +pub(crate) fn app_folder_of(path: &str) -> &str { + let path = path.trim_end_matches('/'); + let lower = path.to_ascii_lowercase(); + if let Some(i) = lower.rfind("/sce_sys/") { + return &path[..i]; + } + path.rsplit_once('/').map_or("", |(dir, _)| dir) +} + #[cfg(test)] pub(crate) mod tests { use super::*; use serde_json::json; + #[test] + fn what_could_carry_a_game_is_known_by_its_name_or_its_first_bytes() { + use Carried::*; + let none: &[u8] = &[]; + assert_eq!(carried("a/Game.PKG", none), Some(Package("pkg"))); + assert_eq!( + carried("/mnt/ext0/x.exfat", none), + Some(Package("mount.exfat")) + ); + assert_eq!(carried("x.ffpfsc", none), Some(Package("mount.ffpfsc"))); + assert_eq!(carried("x.ffpfs", none), Some(Package("mount.ffpfs"))); + assert_eq!(carried("PPSA01234/eboot.bin", none), Some(AppFile)); + assert_eq!(carried("PPSA01234/sce_sys/param.json", none), Some(AppFile)); + assert_eq!(carried("lib/libc.prx", none), Some(AppFile)); + assert_eq!(carried("backup.zip", none), Some(Archive)); + // Renamed: the contents say it. + assert_eq!( + carried("shot.jpg", b"\x7FCNT\x80\x00"), + Some(Package("pkg")) + ); + assert_eq!(carried("shot.jpg", b"\x7FFIH"), Some(Package("pkg"))); + assert_eq!( + carried("clip.mp4", b"\xEB\x76\x90EXFAT "), + Some(Package("mount.exfat")) + ); + let mut pfs = [0u8; 16]; + pfs[8..12].copy_from_slice(&0x2013_0315u32.to_le_bytes()); + assert_eq!(carried("a.dat", &pfs), Some(Package("mount.ffpfs"))); + assert_eq!(carried("a.png", b"\x7FELF\x02"), Some(AppFile)); + assert_eq!(carried("a.png", b"PK\x03\x04"), Some(Archive)); + // What screenshots, clips, cheats and saves are: nothing. + assert_eq!(carried("photo/PPSA01234/a.jxr", b"II\xBC\x01"), None); + assert_eq!(carried("a.png", b"\x89PNG\r\n\x1a\n"), None); + assert_eq!(carried("a.mp4", b"\x00\x00\x00\x18ftypmp42"), None); + assert_eq!(carried("PPSA01234.json", b"{\"name\""), None); + assert_eq!( + carried("save/param.json", b"{"), + None, + "a param.json not in sce_sys" + ); + assert_eq!( + app_folder_of("/user/app/PPSA01234/sce_sys/param.json"), + "/user/app/PPSA01234" + ); + assert_eq!(app_folder_of("/g/Game/eboot.bin"), "/g/Game"); + } + /// Homebrew Playden, as its `/user/app/FAKE77031/sce_sys/param.json` says it. pub(crate) fn playden() -> Value { json!({ diff --git a/engine/crates/ps5upload-engine/src/share/tests.rs b/engine/crates/ps5upload-engine/src/share/tests.rs index 6fe3da508..20637378b 100644 --- a/engine/crates/ps5upload-engine/src/share/tests.rs +++ b/engine/crates/ps5upload-engine/src/share/tests.rs @@ -179,8 +179,7 @@ async fn a_retail_app_is_refused_by_the_engine_whatever_the_page_sent() { assert_eq!(v["items"][0]["files"], 3); let _ = cancel(axum::extract::Path(v["id"].as_str().unwrap().to_string())).await; // A save of a retail game is allowed: player data. - let save = tmp("save").join("PPSA01234 save shared.zip"); - std::fs::write(&save, b"PK zip").unwrap(); + let save = save_zip(&[("sdimg_sce_sdmemory/save.dat", b"progress")]); let body: ShareCreateBody = serde_json::from_value(json!({ "title_id": "PPSA01234", "items": [{"kind": "save", "path": save}], @@ -191,6 +190,87 @@ async fn a_retail_app_is_refused_by_the_engine_whatever_the_page_sent() { let _ = cancel(axum::extract::Path(v["id"].as_str().unwrap().to_string())).await; } +/// A shared-save file of PPSA01234 holding these files (below `PPSA01234/`). +fn save_zip(files: &[(&str, &[u8])]) -> PathBuf { + let dir = tmp("savezip"); + let src = dir.join("src"); + for (name, bytes) in files { + let p = src.join("PPSA01234").join(name); + std::fs::create_dir_all(p.parent().unwrap()).unwrap(); + std::fs::write(p, bytes).unwrap(); + } + let zip = dir.join("PPSA01234 save shared.zip"); + ps5upload_core::save_archive::zip_folder(&src, "PPSA01234", &zip).unwrap(); + zip +} + +/// The rule is not only the app's: a retail game sent as a save, screenshots or cheats is refused +/// the same way, as a folder, a package or an image, whatever its name. Homebrew still goes. +#[tokio::test] +async fn a_retail_game_is_refused_whatever_item_it_is_sent_as() { + use super::retail::tests as rt; + let _hub = test_hub("ws://127.0.0.1:9/ws", false).await; + let refused = |v: &Value| v["error"].as_str().unwrap_or("").to_string(); + // A retail game's folder as screenshots. + let game = app_with_param(rt::astro_bot()); + let (s, v) = make(json!([{"kind": "media", "path": game}])).await; + assert_eq!(s, StatusCode::FORBIDDEN, "{v}"); + assert_eq!(v["code"], "retail"); + // A folder of screenshots that holds one. + let shots = tmp("shots"); + std::fs::write(shots.join("a.png"), b"\x89PNG\r\n\x1a\n").unwrap(); + let inside = shots.join("x/Game"); + std::fs::create_dir_all(inside.join("sce_sys")).unwrap(); + std::fs::write( + inside.join("sce_sys/param.json"), + rt::astro_bot().to_string(), + ) + .unwrap(); + let (s, v) = make(json!([{"kind": "media", "path": shots}])).await; + assert_eq!(s, StatusCode::FORBIDDEN, "{v}"); + // A retail package, named as a package and renamed as a picture. + let dir = crate::inspect::test_fixtures::scratch(); + let pkg = + crate::inspect::test_fixtures::write_cnt_pkg_sfo(dir.join("r.pkg"), &rt::ps4_retail()); + let (s, v) = make(json!([{"kind": "media", "path": pkg}])).await; + assert_eq!(s, StatusCode::FORBIDDEN, "{v}"); + let renamed = dir.join("shot.jpg"); + std::fs::copy(&pkg, &renamed).unwrap(); + let (s, v) = make(json!([{"kind": "media", "path": renamed}])).await; + assert_eq!(s, StatusCode::FORBIDDEN, "{v}"); + assert_eq!(v["code"], "retail"); + // As a save: the package itself, or a game inside the save's zip. + let (s, v) = make(json!([{"kind": "save", "path": renamed}])).await; + assert_eq!(s, StatusCode::FORBIDDEN, "{v}"); + let zipped = save_zip(&[("eboot.bin", b"\x7FELF"), ("sce_sys/param.sfo", b"x")]); + let (s, v) = make(json!([{"kind": "save", "path": zipped}])).await; + assert_eq!(s, StatusCode::FORBIDDEN, "{v}"); + assert!(refused(&v).contains("can't confirm"), "{v}"); + // An archive as screenshots can't be checked. + let (s, v) = make(json!([{"kind": "media", "path": zipped}])).await; + assert_eq!(s, StatusCode::BAD_REQUEST, "{v}"); + assert!(refused(&v).contains("archive"), "{v}"); + // A save keeps its own sce_sys/param.sfo; screenshots and a homebrew package go. + let save = save_zip(&[ + ("sdimg_sce_sdmemory/sce_sys/param.sfo", b"PSF"), + ("sdimg_sce_sdmemory/save.dat", b"progress"), + ]); + let hb = + crate::inspect::test_fixtures::write_cnt_pkg_sfo(dir.join("h.pkg"), &rt::ps4_homebrew()); + let only_shots = tmp("only-shots"); + std::fs::write(only_shots.join("a.png"), b"\x89PNG\r\n\x1a\n").unwrap(); + std::fs::write(only_shots.join("b.mp4"), b"\0\0\0\x18ftypmp42").unwrap(); + for item in [ + json!({"kind": "save", "path": save}), + json!({"kind": "media", "path": only_shots}), + json!({"kind": "media", "path": hb}), + ] { + let (s, v) = make(json!([item])).await; + assert_eq!(s, StatusCode::OK, "{item}: {v}"); + let _ = cancel(axum::extract::Path(v["id"].as_str().unwrap().to_string())).await; + } +} + /// Packages and images in the Collection are judged by the PARAM inside them. #[test] fn a_package_is_judged_by_its_param() { @@ -240,6 +320,23 @@ fn the_receiver_checks_the_offered_build() { assert_eq!(items[4].refused, None); } +/// An item of a kind this build does not know (a newer sender's, or none at all) is left out of +/// the offer: the receiving page named it by its kind and stopped with an error. +#[test] +fn an_offered_item_of_an_unknown_kind_is_left_out() { + let items = wire::offered(&json!({"items": [ + {"id": "i1", "kind": "trophy", "name": "A", "size": 1, "files": 1}, + {"id": "i2", "name": "B"}, + {"id": "i3", "kind": "App", "name": "C"}, + {"id": "i4", "kind": "note", "name": "D"}, + ]})); + assert_eq!(items.len(), 1); + assert_eq!( + (items[0].id.as_str(), items[0].kind.as_str()), + ("i4", "note") + ); +} + async fn body_of(r: Response) -> (StatusCode, Value) { body(r).await } @@ -644,6 +741,62 @@ async fn a_dropped_transfer_resumes_with_its_token_and_a_one_use_link_takes_no_o assert!(got > 0); } +/// The friend's first link went quiet and they connected again with their token before the +/// sender noticed: when the old link finally ends, the resumed transfer carries on. +#[tokio::test(flavor = "multi_thread", worker_threads = 2)] +async fn a_late_end_of_the_old_link_does_not_stop_the_resumed_transfer() { + let app = app_folder("PSUP00006", ""); + std::fs::write(app.join("big.bin"), vec![7u8; 400_000]).unwrap(); + let (id, room) = share_of(json!([{"kind": "app", "path": app}]), true).await; + use wire::Link; + async fn allowed(link: &mut wire::MemLink) -> String { + loop { + match link.recv().await { + Some(wire::In::Text(t)) if t.contains("\"allowed\"") => { + let v: Value = serde_json::from_str(&t).unwrap(); + return v["allowed"]["token"].as_str().unwrap().to_string(); + } + Some(_) => {} + None => panic!("closed before the allow"), + } + } + } + let (sock, mut old) = wire::mem_pair(); + let old_sess = tokio::spawn(wire::sender_session(sock, Arc::new(Registry), None)); + old.raw(json!({"hello": {"v": 1, "room": room, "name": "A"}})) + .await; + old.recv().await.unwrap(); + old.raw(json!({"accept": {"items": ["i1"]}})).await; + let rid = until_request(&id, "asking").await; + decide_on(&id, rid, true).await; + let token = allowed(&mut old).await; + // The old link stays open but says nothing; a new one carries on with the token. + let (sock, mut new) = wire::mem_pair(); + tokio::spawn(wire::sender_session(sock, Arc::new(Registry), None)); + new.raw(json!({"hello": {"v": 1, "room": room, "name": "A", "resume": token}})) + .await; + allowed(&mut new).await; + // Now the old link ends. + drop(old); + tokio::time::timeout(Duration::from_secs(5), old_sess) + .await + .unwrap() + .unwrap(); + assert_eq!( + with_share(&id, |e| e.m.request(rid).unwrap().state).unwrap(), + ReqState::Sending + ); + new.raw(json!({"get": {"n": 1, "item": "i1", "path": "big.bin", "offset": 0}})) + .await; + match tokio::time::timeout(Duration::from_secs(5), new.recv()) + .await + .unwrap() + { + Some(wire::In::Binary(b)) => assert_eq!(wire::parse_data(&b).unwrap().0, 1), + other => panic!("the resumed transfer was stopped: {other:?}"), + } +} + /// Two engines' sides over a real WebRTC data channel (loopback, the fake hub introducing them): /// a homebrew folder and a save, from the link to the files on disk, with the history and the /// activity on both sides. @@ -798,6 +951,168 @@ async fn two_engines_share_a_homebrew_folder_and_a_save_over_webrtc() { let _ = cancel(axum::extract::Path(id)).await; } +/// A homebrew app folder of `n` small files with long names: its listing is ~350 bytes a file. +fn many_files_app(title_id: &str, n: usize) -> PathBuf { + let app = app_folder(title_id, ""); + let long = "x".repeat(150); + for d in 0..n.div_ceil(100) { + let dir = app.join(format!("{d:02}{long}")); + std::fs::create_dir_all(&dir).unwrap(); + for f in 0..100.min(n - d * 100) { + std::fs::write(dir.join(format!("{f:03}{long}.dat")), [f as u8]).unwrap(); + } + } + app +} + +/// Over a real data channel, a listing longer than one data-channel message (256 KiB) arrives: +/// in parts, put back together. It was dropped unsaid, and the friend waited for nothing. +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn a_listing_over_a_data_channels_limit_arrives_over_webrtc() { + let hub = crate::join_net::tests::FakeHub::start().await; + let _hub = test_hub(&hub.url, true).await; + let app = many_files_app("LAPY10011", 1000); + let (s, v) = make(json!([{"kind": "app", "path": app}])).await; + assert_eq!(s, StatusCode::OK, "{v}"); + let id = v["id"].as_str().unwrap().to_string(); + let mut url = String::new(); + for _ in 0..200 { + let (_, v) = body(get_one(axum::extract::Path(id.clone())).await).await; + if v["works"] == "anywhere" && v["hub_state"] == "hosted" { + url = v["url"].as_str().unwrap().to_string(); + break; + } + tokio::time::sleep(Duration::from_millis(50)).await; + } + assert!(!url.is_empty()); + let (_, r) = body( + receive_open(Json(ShareOpenBody { + link: url, + name: Some("Alex".into()), + })) + .await, + ) + .await; + let rid_rx = r["id"].as_str().unwrap().to_string(); + let rx_view = || async { + body(receive_get(axum::extract::Path(rid_rx.clone())).await) + .await + .1 + }; + let mut view = Value::Null; + for _ in 0..400 { + view = rx_view().await; + if view["state"] == "offered" { + break; + } + tokio::time::sleep(Duration::from_millis(25)).await; + } + assert_eq!(view["state"], "offered", "{view}"); + let dest = tmp("rtc-many"); + let (s, _) = body( + receive_accept( + axum::extract::Path(rid_rx.clone()), + Json(ShareAcceptBody { + items: vec!["i1".into()], + dest: Some(dest.to_string_lossy().into_owned()), + }), + ) + .await, + ) + .await; + assert_eq!(s, StatusCode::OK); + let req = until_request(&id, "asking").await; + assert_eq!(decide_on(&id, req, true).await, StatusCode::OK); + // The listing came whole: the files are being received. + for _ in 0..800 { + view = rx_view().await; + if matches!( + view["state"].as_str(), + Some("receiving" | "done" | "failed") + ) { + break; + } + tokio::time::sleep(Duration::from_millis(25)).await; + } + assert!( + matches!(view["state"].as_str(), Some("receiving" | "done")), + "{view}" + ); + let _ = receive_cancel(axum::extract::Path(rid_rx)).await; + let _ = cancel(axum::extract::Path(id)).await; +} + +/// The sender's messages to a receiver, as text, until `until` is in one. +async fn texts_until(link: &mut wire::MemLink, until: &str) -> Vec<String> { + use wire::Link; + let mut out = Vec::new(); + loop { + match tokio::time::timeout(Duration::from_secs(10), link.recv()) + .await + .unwrap() + { + Some(wire::In::Text(t)) => { + let end = t.contains(until); + out.push(t); + if end { + return out; + } + } + Some(_) => {} + None => panic!("closed before {until}: {out:?}"), + } + } +} + +/// A listing longer than a message goes in parts to a receiver that reads them; to an older one +/// it goes whole on the home network, as it did. +#[tokio::test(flavor = "multi_thread", worker_threads = 2)] +async fn a_long_listing_goes_in_parts_to_a_receiver_that_reads_them() { + let app = many_files_app("PSUP00007", 400); + let (id, room) = share_of(json!([{"kind": "app", "path": app}]), false).await; + // This build's receiver: it all arrives. + let sh = Arc::new(Mutex::new(RxShared::default())); + let (sock, link) = wire::mem_pair(); + tokio::spawn(wire::sender_session(sock, Arc::new(Registry), None)); + let (tx, mut rx) = mpsc::unbounded_channel(); + let dest = tmp("parts"); + let id2 = id.clone(); + tokio::spawn(async move { + let rid = until_request(&id2, "asking").await; + decide_on(&id2, rid, true).await; + }); + let rx_sh = sh.clone(); + let recv = tokio::spawn(async move { wire::receive(link, &room, "A", rx_sh, &mut rx).await }); + until_rx(&sh, "offered").await; + tx.send(RxCmd::Accept { + items: vec!["i1".into()], + dest: dest.clone(), + }) + .unwrap(); + let end = tokio::time::timeout(Duration::from_secs(60), recv) + .await + .unwrap() + .unwrap(); + assert_eq!(end, RxEnd::Done, "{:?}", sh.lock().unwrap().error); + let got = sh.lock().unwrap().received[0].1.clone(); + same_tree(&app, &got); + // An older receiver (no `parts` in its hello) on the home network: the listing whole. + let room = with_share(&id, |e| e.room_id().to_string()).unwrap(); + let (sock, mut old) = wire::mem_pair(); + tokio::spawn(wire::sender_session(sock, Arc::new(Registry), None)); + old.raw(json!({"hello": {"v": 1, "room": room, "name": "B"}})) + .await; + let offer = texts_until(&mut old, "\"offer\"").await; + assert_eq!(offer.len(), 1); + old.raw(json!({"accept": {"items": ["i1"]}})).await; + let rid = until_request(&id, "asking").await; + decide_on(&id, rid, true).await; + let msgs = texts_until(&mut old, "\"allowed\"").await; + assert!(msgs.iter().all(|t| !t.starts_with("{\"part\"")), "whole"); + assert!(msgs.last().unwrap().len() > 64 * 1024); + let _ = cancel(axum::extract::Path(id)).await; +} + /// The app opening a link the hub can't reach falls back to the home network's socket. #[tokio::test] async fn a_link_with_only_a_home_network_hint_is_read() { @@ -853,7 +1168,7 @@ async fn silent_sender(mut sock: wire::MemSocket, hold: tokio::sync::oneshot::Re } assert!(next(&mut sock).await.get("hello").is_some()); let offer = json!({"offer": {"from": "S", "title": "t", "items": [ - {"id": "i1", "kind": "file", "name": "thing", "size": 10, "files": 1} + {"id": "i1", "kind": "media", "name": "thing", "size": 10, "files": 1} ]}}); sock.send(wire::text(offer)).await.unwrap(); assert!(next(&mut sock).await.get("accept").is_some()); @@ -949,6 +1264,17 @@ fn a_long_name_keeps_its_extension_and_two_alike_stay_two() { assert_eq!(wire::safe_name("con"), "_con"); assert_eq!(wire::safe_name("COM1.bin"), "_COM1.bin"); assert_eq!(wire::safe_name("console.pkg"), "console.pkg"); + // A dot in front is part of the name; a dot or space at the end is not (Windows drops it). + assert_eq!(wire::safe_name(".nomedia"), ".nomedia"); + assert_eq!(wire::safe_name("._eboot.bin"), "._eboot.bin"); + assert_eq!(wire::safe_name("x. ."), "x"); + assert_eq!(wire::safe_name(" a "), "a"); + assert_eq!(wire::safe_name(".."), "item"); + let dir = std::path::Path::new("/r"); + assert_eq!( + wire::target(dir, ".config/.hidden").unwrap(), + std::path::Path::new("/r/.config/.hidden") + ); // Under 200 bytes nothing is cut: names that differ after their 80th character stay apart. let listed = |path: String| wire::Listed { diff --git a/engine/crates/ps5upload-engine/src/share/wire.rs b/engine/crates/ps5upload-engine/src/share/wire.rs index e54ad29f1..b00bea78b 100644 --- a/engine/crates/ps5upload-engine/src/share/wire.rs +++ b/engine/crates/ps5upload-engine/src/share/wire.rs @@ -3,8 +3,9 @@ //! `/api/share/ws`. Text messages are JSON; the file data goes as binary messages. //! //! Receiver → sender: -//! * `{"hello": {"v": 1, "room", "name", "resume"?}}` first. `resume` is the token an earlier -//! Allow gave: the transfer carries on without asking again. +//! * `{"hello": {"v": 1, "room", "name", "resume"?, "parts"?}}` first. `resume` is the token an +//! earlier Allow gave: the transfer carries on without asking again. `parts: true`: it puts a +//! long message back together from its `part`s (below). //! * `{"accept": {"items": [id, …]}}`: what they want of the offer. //! * `{"get": {"n", "item", "path", "offset"}}`: one file of an accepted item, from `offset`. //! * `{"done": {}}` when they have everything; `{"cancel": {}}` to stop. @@ -19,6 +20,11 @@ //! "size"}}`; or `{"error": {"n", "why"}}` (`not_in_manifest`, `unsafe_path`, `symlink`, //! `changed`, `read`). //! * `{"cancelled": {}}` when the sender cancels. +//! +//! A long text message (an offer or a listing of many files: a data channel takes 256 KiB at +//! most) goes, to a receiver whose hello said `parts`, as `{"part": {"i", "of", "t"}}` messages, +//! each a piece of its text in order. To an older receiver it goes whole when the connection +//! takes it, else `{"refused": {"why": "too_big"}}` ends the transfer plainly. use std::collections::HashMap; use std::path::{Path, PathBuf}; @@ -49,11 +55,182 @@ pub(crate) const RX_IDLE_WAIT: Duration = Duration::from_secs(90); pub(crate) const NAME_MAX: usize = 200; /// The receiver's longest text message (a `get` with a long path). pub(crate) const TEXT_MAX: usize = 4096; +/// A text message longer than this goes in `part`s to a receiver that reads them: every data +/// channel takes 64 KiB. +const TEXT_WHOLE: usize = 60 * 1024; +/// The text in one `part`. +const PART_TEXT: usize = 16 * 1024; +/// The longest text an internet connection (a data channel, 256 KiB) carries whole, with room. +const RTC_WHOLE_MAX: usize = crate::join_net::rtc::TEXT_DC_MAX - 16 * 1024; +/// The longest text put back together from parts (a listing of very many files). +const JOINED_MAX: usize = 64 * 1024 * 1024; pub(crate) fn text(v: Value) -> Message { Message::Text(v.to_string().into()) } +/// How a text message of `len` bytes goes. +#[derive(Debug, PartialEq, Eq)] +enum TextPlan { + Whole, + Parts, + /// Longer than the receiver can take: refused, plainly. + TooBig, +} + +/// `parts`: the receiver reads parts. `rtc`: the connection is a data channel (the LAN socket +/// takes a long message whole). +fn plan_text(len: usize, parts: bool, rtc: bool) -> TextPlan { + if len <= TEXT_WHOLE { + TextPlan::Whole + } else if len > JOINED_MAX { + TextPlan::TooBig + } else if parts { + TextPlan::Parts + } else if !rtc || len <= RTC_WHOLE_MAX { + TextPlan::Whole + } else { + TextPlan::TooBig + } +} + +/// `t` as `part` messages, cut between characters. +fn split_text(t: &str) -> Vec<String> { + let mut pieces = Vec::new(); + let mut at = 0; + while at < t.len() { + let mut end = (at + PART_TEXT).min(t.len()); + while !t.is_char_boundary(end) { + end -= 1; + } + pieces.push(&t[at..end]); + at = end; + } + let of = pieces.len(); + pieces + .iter() + .enumerate() + .map(|(i, p)| json!({"part": {"i": i, "of": of, "t": p}}).to_string()) + .collect() +} + +#[derive(Debug, PartialEq, Eq)] +enum Sent { + Ok, + Lost, + TooBig, +} + +/// A text message that may be long (an offer, a listing): whole, in parts, or refused when the +/// receiver can't take it. +async fn send_long<S: GuestSocket>(s: &mut S, t: String, parts: bool) -> Sent { + let sent = |r: Result<(), ()>| if r.is_ok() { Sent::Ok } else { Sent::Lost }; + match plan_text(t.len(), parts, s.net().is_some()) { + TextPlan::Whole => sent(s.send(Message::Text(t.into())).await), + TextPlan::Parts => { + for p in split_text(&t) { + if s.send(Message::Text(p.into())).await.is_err() { + return Sent::Lost; + } + } + Sent::Ok + } + TextPlan::TooBig => { + crate::log_at!( + Info, + "together", + "share: a message of {} bytes is too long for the friend's app over this connection", + t.len() + ); + let _ = s.send(text(json!({"refused": {"why": "too_big"}}))).await; + Sent::TooBig + } + } +} + +/// The receiver's link with long messages put back together from their `part`s. +struct Joined<L> { + link: L, + buf: String, + next: u64, + of: u64, +} + +impl<L> Joined<L> { + fn new(link: L) -> Self { + Joined { + link, + buf: String::new(), + next: 0, + of: 0, + } + } + + /// One part: the whole text once its last part came. Err: parts out of order, or more than + /// [`JOINED_MAX`]. + fn push(&mut self, t: &str) -> Result<Option<String>, ()> { + let v: Value = serde_json::from_str(t).map_err(|_| ())?; + let p = &v["part"]; + let (i, of, piece) = ( + p["i"].as_u64().ok_or(())?, + p["of"].as_u64().ok_or(())?, + p["t"].as_str().ok_or(())?, + ); + if i != self.next || i >= of || (i > 0 && of != self.of) { + return Err(()); + } + if self.buf.len() + piece.len() > JOINED_MAX { + return Err(()); + } + self.of = of; + self.buf.push_str(piece); + self.next += 1; + if self.next < of { + return Ok(None); + } + self.next = 0; + Ok(Some(std::mem::take(&mut self.buf))) + } +} + +impl<L: Link> Link for Joined<L> { + async fn send_text(&mut self, t: String) -> Result<(), ()> { + self.link.send_text(t).await + } + async fn recv(&mut self) -> Option<In> { + loop { + let m = self.link.recv().await?; + let In::Text(t) = &m else { return Some(m) }; + if !t.starts_with("{\"part\":") { + return Some(m); + } + match self.push(t) { + Ok(Some(whole)) => return Some(In::Text(whole)), + Ok(None) => continue, + Err(()) => { + self.buf = String::new(); + self.next = 0; + return Some(In::Text(json!({"refused": {"why": "too_big"}}).to_string())); + } + } + } + } + fn path(&self) -> Option<&'static str> { + self.link.path() + } +} + +/// What the receiver is told when the sender refused (`why`). +fn refused_state(why: Option<&str>) -> (&'static str, Option<String>) { + match why { + Some("too_big") => ( + "failed", + Some("The list of files is too long to send. Share fewer files at once.".into()), + ), + w => ("refused", w.map(str::to_string)), + } +} + fn data_header(n: u32, offset: u64) -> [u8; HEADER] { let mut h = [0u8; HEADER]; h[..4].copy_from_slice(&n.to_le_bytes()); @@ -95,18 +272,23 @@ pub(crate) trait Shares: Send + Sync + 'static { fn find(&self, room: &str) -> Option<String>; /// The offer a hello gets, or why not. fn hello(&self, id: &str) -> Result<Value, &'static str>; - fn ask(&self, id: &str, name: &str, wants: &[String]) -> Result<u64, &'static str>; - fn resume(&self, id: &str, token: &str) -> Result<u64, &'static str>; + /// The new request's id and its first connection's session. + fn ask(&self, id: &str, name: &str, wants: &[String]) -> Result<(u64, u64), &'static str>; + /// The request a token carries on, and this connection's session (a newer one than any + /// earlier connection's: what those report from now on is ignored). + fn resume(&self, id: &str, token: &str) -> Result<(u64, u64), &'static str>; /// The request's state now, and its token. fn state(&self, id: &str, rid: u64) -> Option<(ReqState, Option<String>)>; + /// Whether `session` is still the connection carrying request `rid`. + fn current(&self, id: &str, rid: u64, session: u64) -> bool; /// Waits until something about share `id` changed (or a second passed). fn changed(&self, id: &str) -> impl std::future::Future<Output = ()> + Send; /// The items and what this request accepted. fn items(&self, id: &str, rid: u64) -> Option<(Arc<Vec<Item>>, Vec<String>)>; - fn sending(&self, id: &str, rid: u64, total: u64) -> Result<(), &'static str>; - fn progress(&self, id: &str, rid: u64, done: u64); - fn done(&self, id: &str, rid: u64); - fn gone(&self, id: &str, rid: u64, cancelled: bool, why: &str); + fn sending(&self, id: &str, rid: u64, session: u64, total: u64) -> Result<(), &'static str>; + fn progress(&self, id: &str, rid: u64, session: u64, done: u64); + fn done(&self, id: &str, rid: u64, session: u64); + fn gone(&self, id: &str, rid: u64, session: u64, cancelled: bool, why: &str); /// Where the connection goes (`lan`, `tailscale`, `internet`), for the panel. fn path(&self, id: &str, rid: u64, path: Option<&'static str>); } @@ -146,9 +328,11 @@ pub(crate) async fn sender_session<S: GuestSocket, R: Shares>( name }; let resume = h["resume"].as_str().unwrap_or(""); - let rid = if !resume.is_empty() { + // An older receiver doesn't say it: it takes each message whole. + let parts = h["parts"].as_bool().unwrap_or(false); + let (rid, sess) = if !resume.is_empty() { match reg.resume(&id, resume) { - Ok(rid) => rid, + Ok(x) => x, Err(why) => { let _ = s.send(text(json!({"refused": {"why": why}}))).await; return; @@ -162,7 +346,7 @@ pub(crate) async fn sender_session<S: GuestSocket, R: Shares>( return; } }; - if s.send(text(json!({ "offer": offer }))).await.is_err() { + if send_long(&mut s, json!({ "offer": offer }).to_string(), parts).await != Sent::Ok { return; } // Their choice, or they leave. @@ -202,15 +386,15 @@ pub(crate) async fn sender_session<S: GuestSocket, R: Shares>( .unwrap_or_default(); } }; - let rid = match reg.ask(&id, &name, &wants) { - Ok(rid) => rid, + let (rid, sess) = match reg.ask(&id, &name, &wants) { + Ok(x) => x, Err(why) => { let _ = s.send(text(json!({"refused": {"why": why}}))).await; return; } }; if s.send(text(json!({"asked": {}}))).await.is_err() { - reg.gone(&id, rid, false, "lost"); + reg.gone(&id, rid, sess, false, "lost"); return; } // The answer. Meanwhile the receiver may cancel or go. @@ -237,25 +421,31 @@ pub(crate) async fn sender_session<S: GuestSocket, R: Shares>( m = s.recv() => match m { Some(Ok(Message::Text(t))) => { if t.contains("\"cancel\"") { - reg.gone(&id, rid, true, "receiver"); + reg.gone(&id, rid, sess, true, "receiver"); return; } } Some(Ok(Message::Close(_))) | None | Some(Err(())) => { - reg.gone(&id, rid, false, "left"); + reg.gone(&id, rid, sess, false, "left"); return; } _ => {} } } } - rid + (rid, sess) }; - serve(&mut s, &*reg, &id, rid).await; + serve(&mut s, &*reg, &id, (rid, sess), parts).await; } /// The allowed receiver's files. -async fn serve<S: GuestSocket, R: Shares>(s: &mut S, reg: &R, id: &str, rid: u64) { +async fn serve<S: GuestSocket, R: Shares>( + s: &mut S, + reg: &R, + id: &str, + (rid, sess): (u64, u64), + parts: bool, +) { let Some((items, wants)) = reg.items(id, rid) else { return; }; @@ -277,41 +467,51 @@ async fn serve<S: GuestSocket, R: Shares>(s: &mut S, reg: &R, id: &str, rid: u64 .filter(|i| wants.contains(&i.id)) .map(|i| i.size()) .sum(); - if let Err(why) = reg.sending(id, rid, total) { + let allowed = json!({"allowed": {"token": token, "files": files}}).to_string(); + // A listing this receiver can't take ends the request now, plainly, before anything starts. + if plan_text(allowed.len(), parts, s.net().is_some()) == TextPlan::TooBig { + let _ = send_long(s, allowed, parts).await; + reg.gone(id, rid, sess, true, "too_big"); + return; + } + if let Err(why) = reg.sending(id, rid, sess, total) { let _ = s.send(text(json!({"refused": {"why": why}}))).await; return; } - if s.send(text(json!({"allowed": {"token": token, "files": files}}))) - .await - .is_err() - { - reg.gone(id, rid, false, "lost"); + if send_long(s, allowed, parts).await != Sent::Ok { + reg.gone(id, rid, sess, false, "lost"); return; } // How far each file got, for the progress (a resumed file starts where the receiver was). let mut marks: HashMap<(String, String), u64> = HashMap::new(); - let still = |reg: &R| matches!(reg.state(id, rid), Some((ReqState::Sending, _))); + // Still this connection's to serve: sending, and no resume has since taken the request over + // (an old link whose friend connected again stops quietly; the newer one carries on). + let still = |reg: &R| { + matches!(reg.state(id, rid), Some((ReqState::Sending, _))) && reg.current(id, rid, sess) + }; loop { let v = match next_text(s, IDLE_WAIT).await { Ok(v) => v, Err(why) => { if still(reg) { - reg.gone(id, rid, false, why); + reg.gone(id, rid, sess, false, why); } return; } }; if !still(reg) { - let _ = s.send(text(json!({"cancelled": {}}))).await; + if reg.current(id, rid, sess) { + let _ = s.send(text(json!({"cancelled": {}}))).await; + } return; } if v.get("done").is_some() { - reg.done(id, rid); + reg.done(id, rid, sess); let _ = s.send(text(json!({"bye": {}}))).await; return; } if v.get("cancel").is_some() { - reg.gone(id, rid, true, "receiver"); + reg.gone(id, rid, sess, true, "receiver"); return; } let Some(g) = v.get("get") else { continue }; @@ -332,7 +532,7 @@ async fn serve<S: GuestSocket, R: Shares>(s: &mut S, reg: &R, id: &str, rid: u64 .await .is_err() { - reg.gone(id, rid, false, "lost"); + reg.gone(id, rid, sess, false, "lost"); return; } continue; @@ -365,25 +565,27 @@ async fn serve<S: GuestSocket, R: Shares>(s: &mut S, reg: &R, id: &str, rid: u64 msg.extend_from_slice(&data_header(n, at)); msg.extend_from_slice(&bytes); if s.send(Message::Binary(msg.into())).await.is_err() { - reg.gone(id, rid, false, "lost"); + reg.gone(id, rid, sess, false, "lost"); return; } at += bytes.len() as u64; marks.insert(key.clone(), at); - reg.progress(id, rid, marks.values().sum()); + reg.progress(id, rid, sess, marks.values().sum()); // The receiver's cancel, or the sender's, between pieces. if !still(reg) { - let _ = s.send(text(json!({"cancelled": {}}))).await; + if reg.current(id, rid, sess) { + let _ = s.send(text(json!({"cancelled": {}}))).await; + } return; } if let Some(m) = s.recv().now_or_never() { match m { Some(Ok(Message::Text(t))) if t.contains("\"cancel\"") => { - reg.gone(id, rid, true, "receiver"); + reg.gone(id, rid, sess, true, "receiver"); return; } Some(Ok(Message::Close(_))) | None | Some(Err(())) => { - reg.gone(id, rid, false, "lost"); + reg.gone(id, rid, sess, false, "lost"); return; } _ => {} @@ -392,12 +594,12 @@ async fn serve<S: GuestSocket, R: Shares>(s: &mut S, reg: &R, id: &str, rid: u64 } if at >= f.size { marks.insert(key, f.size); - reg.progress(id, rid, marks.values().sum()); + reg.progress(id, rid, sess, marks.values().sum()); if s.send(text(json!({"eof": {"n": n, "size": f.size}}))) .await .is_err() { - reg.gone(id, rid, false, "lost"); + reg.gone(id, rid, sess, false, "lost"); return; } } @@ -469,6 +671,9 @@ pub(crate) fn offered(v: &Value) -> Vec<Offered> { refused, } }) + // A kind this build has no part for (a newer sender's) is not offered: the + // receiving page names each item by its kind, and an unknown one stopped the app. + .filter(|o| super::manifest::ItemKind::from_word(&o.kind).is_some()) .collect() }) .unwrap_or_default() @@ -523,8 +728,9 @@ fn set(sh: &Mutex<RxShared>, f: impl FnOnce(&mut RxShared)) { f(&mut sh.lock().unwrap_or_else(|e| e.into_inner())); } -/// Characters no file system takes, and control characters, as `_`; trimmed, and no longer than -/// [`NAME_MAX`] bytes. A longer name loses the end of its stem, never its extension: `.pkg` cut +/// Characters no file system takes, and control characters, as `_`; no space in front, no dot or +/// space at the end (Windows drops those), and no longer than [`NAME_MAX`] bytes. A dot in front +/// stays: `.nomedia` or `.config` is a name, and the folder received must be the one sent. A longer name loses the end of its stem, never its extension: `.pkg` cut /// off made the file something else, and two names alike in their first 80 characters became one. pub(crate) fn safe_name(s: &str) -> String { let t: String = s @@ -537,7 +743,9 @@ pub(crate) fn safe_name(s: &str) -> String { } }) .collect(); - let t = t.trim().trim_matches('.').trim(); + let t = t + .trim_start() + .trim_end_matches(|c: char| c == '.' || c.is_whitespace()); let t = if t.len() > NAME_MAX { // The extension: after the last dot, when short enough to be one. let (stem, ext) = match t.rfind('.') { @@ -636,7 +844,8 @@ pub(crate) fn item_dirs( ) -> Vec<(String, PathBuf)> { let mut out: Vec<(String, PathBuf)> = Vec::new(); for i in items.iter().filter(|i| accepted.contains(&i.id)) { - let base = safe_name(&i.name); + // A folder of its own for the item: shown, never hidden (no dot in front). + let base = safe_name(i.name.trim().trim_start_matches('.')); let mut name = base.clone(); let mut k = 2; while out @@ -681,7 +890,7 @@ pub(crate) async fn receive<L: Link>( /// [`receive`], giving up on a sender silent for `idle`. pub(crate) async fn receive_with<L: Link>( - mut link: L, + link: L, room: &str, name: &str, sh: Arc<Mutex<RxShared>>, @@ -689,7 +898,9 @@ pub(crate) async fn receive_with<L: Link>( idle: Duration, ) -> RxEnd { let token = sh.lock().unwrap_or_else(|e| e.into_inner()).token.clone(); - let hello = json!({"hello": {"v": 1, "room": room, "name": name, "resume": token}}); + let hello = + json!({"hello": {"v": 1, "room": room, "name": name, "resume": token, "parts": true}}); + let mut link = Joined::new(link); if link.send_text(hello.to_string()).await.is_err() { return RxEnd::Lost; } @@ -726,7 +937,8 @@ pub(crate) async fn receive_with<L: Link>( } }; if let Some(r) = v.get("refused") { - return fail(&sh, "refused", r["why"].as_str().map(str::to_string)); + let (state, why) = refused_state(r["why"].as_str()); + return fail(&sh, state, why); } let Some(o) = v.get("offer") else { return fail( @@ -842,7 +1054,8 @@ pub(crate) async fn receive_with<L: Link>( ); } if let Some(r) = v.get("refused") { - return fail(&sh, "refused", r["why"].as_str().map(str::to_string)); + let (state, why) = refused_state(r["why"].as_str()); + return fail(&sh, state, why); } if let Some(a) = v.get("allowed") { // No more files than the accepted items can have. @@ -1148,3 +1361,88 @@ pub(crate) fn now_ms() -> u64 { .duration_since(std::time::UNIX_EPOCH) .map_or(0, |d| d.as_millis() as u64) } + +#[cfg(test)] +mod parts_tests { + use super::*; + + #[test] + fn a_long_message_goes_in_parts_only_to_a_receiver_that_reads_them() { + use TextPlan::*; + let long = 300 * 1024; + assert_eq!(plan_text(1000, false, true), Whole); + assert_eq!(plan_text(long, true, true), Parts); + assert_eq!(plan_text(long, true, false), Parts); + // An older receiver: whole where the connection takes it, else refused plainly. + assert_eq!(plan_text(long, false, false), Whole); + assert_eq!(plan_text(100 * 1024, false, true), Whole); + assert_eq!(plan_text(long, false, true), TooBig); + assert_eq!(plan_text(JOINED_MAX + 1, true, true), TooBig); + } + + #[test] + fn parts_come_back_as_the_message_cut_between_characters() { + let t: String = (0..40_000).map(|i| ['a', 'é', '漢', '🎮'][i % 4]).collect(); + let parts = split_text(&t); + assert!(parts.len() > 3); + assert!(parts + .iter() + .all(|p| p.len() < TEXT_WHOLE && p.starts_with("{\"part\":"))); + let mut j = Joined::new(()); + let mut got = None; + for (i, p) in parts.iter().enumerate() { + match j.push(p).unwrap() { + Some(whole) => { + assert_eq!(i + 1, parts.len()); + got = Some(whole); + } + None => assert!(i + 1 < parts.len()), + } + } + assert_eq!(got.unwrap(), t); + // Again on the same link: it started over. + let again = split_text("{\"x\":1}"); + assert_eq!(j.push(&again[0]).unwrap().as_deref(), Some("{\"x\":1}")); + } + + #[test] + fn parts_out_of_order_or_too_many_are_refused() { + let parts = split_text(&"y".repeat(3 * PART_TEXT)); + let mut j = Joined::new(()); + assert!(j.push(&parts[1]).is_err(), "the first part missing"); + let mut j = Joined::new(()); + j.push(&parts[0]).unwrap(); + assert!(j.push(&parts[0]).is_err(), "a part twice"); + let mut j = Joined::new(()); + assert!(j + .push(&json!({"part": {"i": 0, "of": 2, "t": "a"}}).to_string()) + .is_ok()); + assert!(j + .push(&json!({"part": {"i": 1, "of": 3, "t": "b"}}).to_string()) + .is_err()); + assert!(Joined::new(()).push("{\"part\": 1}").is_err()); + } + + /// What a receiver gets when the parts were broken: a plain refusal it ends on. + #[tokio::test] + async fn a_broken_set_of_parts_ends_the_receive_plainly() { + let (mut sock, link) = mem_pair(); + let mut j = Joined::new(link); + sock.send(Message::Text( + json!({"part": {"i": 1, "of": 2, "t": "a"}}) + .to_string() + .into(), + )) + .await + .unwrap(); + match j.recv().await { + Some(In::Text(t)) => assert!(t.contains("too_big"), "{t}"), + other => panic!("{other:?}"), + } + assert_eq!(refused_state(Some("too_big")).0, "failed"); + assert_eq!( + refused_state(Some("used")), + ("refused", Some("used".into())) + ); + } +} diff --git a/engine/crates/ps5upload-fpkg/src/exfat.rs b/engine/crates/ps5upload-fpkg/src/exfat.rs index 62e15b4b2..bb50ac7ec 100644 --- a/engine/crates/ps5upload-fpkg/src/exfat.rs +++ b/engine/crates/ps5upload-fpkg/src/exfat.rs @@ -147,6 +147,16 @@ impl ExFat { /// [`ExFat::walk`], plus the directories left with nothing in them once junk is skipped /// (sorted), as [`crate::source::scan_tree`] reports them for a folder. pub fn walk_tree(&mut self) -> Result<(Vec<ExFatFile>, Vec<String>)> { + // Every directory of a sound volume is clusters of its own, so all of them together + // never hold more than the heap: a walk that has read more is reading the same + // clusters again through directories that overlap, which a crafted image can make + // go on for terabytes (a million directories of up to 64 MiB each). + let heap = u64::from(self.geom.cluster_count) * self.geom.cluster_size; + self.walk_within(heap) + } + + /// [`ExFat::walk_tree`], reading at most `dir_budget` directory bytes in all. + fn walk_within(&mut self, dir_budget: u64) -> Result<(Vec<ExFatFile>, Vec<String>)> { let root = self.root_cluster; let bytes = self.chain_stream(root)?; let mut w = Walked { @@ -155,7 +165,10 @@ impl ExFat { dirs: std::collections::HashSet::from([root]), path_bytes: 0, listed: 0, + dir_bytes: 0, + dir_budget, }; + w.read_dir(bytes.len() as u64)?; self.walk_dir(&bytes, "", 0, &mut w)?; let (mut files, mut empty) = (w.files, w.empty); files.sort_by(|a, b| a.path.cmp(&b.path)); @@ -205,6 +218,8 @@ impl ExFat { e.first_cluster )); } + // Charged before it is read: the budget is what stops the reading. + w.read_dir(e.size.max(self.geom.cluster_size))?; let bytes = self.read_dir_stream(&e, &path)?; if !self.walk_dir(&bytes, &format!("{path}/"), depth + 1, w)? { w.keep(&path)?; @@ -460,9 +475,26 @@ struct Walked { /// [`MAX_ENTRIES`]: counted as they are parsed, so the entries of directories still being /// walked further up count too. listed: usize, + /// Directory bytes read so far, every directory's, against `dir_budget`. + dir_bytes: u64, + /// The most directory bytes the walk may read: the heap's size (see [`ExFat::walk_tree`]). + dir_budget: u64, } impl Walked { + /// Count one more directory's bytes against the walk's budget. + fn read_dir(&mut self, bytes: u64) -> Result<()> { + self.dir_bytes = self.dir_bytes.saturating_add(bytes); + if self.dir_bytes > self.dir_budget { + return format_err(format!( + "the volume's directories add up to more than its {} bytes: they overlap, \ + so the image is damaged", + self.dir_budget + )); + } + Ok(()) + } + /// Count one more kept path against the walk's budgets. fn keep(&mut self, path: &str) -> Result<()> { self.path_bytes += path.len(); @@ -1273,4 +1305,44 @@ mod tests { assert!(err.contains("past the image"), "{err}"); std::fs::remove_dir_all(&dir).ok(); } + + /// A crafted volume's directories can overlap, and a walk that reads the same clusters again + /// through each would grind on for as long as they let it. A walk reads no more directory + /// bytes than the volume holds: a sound one never needs more, as its directories are + /// clusters of their own. + #[test] + fn the_walk_reads_no_more_directory_bytes_than_the_volume_holds() { + let path = + std::env::temp_dir().join(format!("fpkg-exfat-{}-dir-budget", std::process::id())); + std::fs::write(&path, image_with_dirs()).unwrap(); + let mut volume = ExFat::open(&path).unwrap(); + std::fs::remove_file(&path).ok(); + // The sound image: its root and four directories, one cluster each, in nine clusters. + let (files, _) = volume.walk_tree().unwrap(); + assert_eq!(files.len(), 2); + assert!(volume.walk_within(5 * 4096).is_ok()); + // One cluster less than those five, and the walk stops instead of reading on. + let err = volume.walk_within(4 * 4096).unwrap_err().to_string(); + assert!(err.contains("add up to more than"), "{err}"); + } + + /// Overlapping directories, as a crafted image has them: `empty` now claims the rest of the + /// volume, over the clusters `junk`, `nest` and `deeper` have. Nothing in it parses as more than it + /// did, yet the walk reads more than the volume holds and is refused. + #[test] + fn overlapping_directories_are_refused() { + let mut img = image_with_dirs(); + // `empty`'s stream record is the root's eighth record (cluster 4): its data length. + let at = 2 * 512 + (4 - 2) * 4096 + 7 * 32 + 24; + img[at..at + 8].copy_from_slice(&(5 * 4096u64).to_le_bytes()); + // And `junk` (the root's eleventh record) runs on over `nest` and `deeper`. + let at = at + 3 * 32; + img[at..at + 8].copy_from_slice(&(3 * 4096u64).to_le_bytes()); + let path = std::env::temp_dir().join(format!("fpkg-exfat-{}-overlap", std::process::id())); + std::fs::write(&path, img).unwrap(); + let err = ExFatSource::open(&path).err().map(|e| e.to_string()); + std::fs::remove_file(&path).ok(); + let err = err.expect("refused"); + assert!(err.contains("add up to more than"), "{err}"); + } } diff --git a/engine/crates/ps5upload-fpkg/src/pkg_name.rs b/engine/crates/ps5upload-fpkg/src/pkg_name.rs index 3550be819..cddc1ea2b 100644 --- a/engine/crates/ps5upload-fpkg/src/pkg_name.rs +++ b/engine/crates/ps5upload-fpkg/src/pkg_name.rs @@ -98,6 +98,20 @@ impl Refusal { } } +/// How long a new name may be in this package, in UTF-8 bytes of plain text. A rename never +/// moves anything in the package, so the room is what the package itself has: the old names' +/// own bytes and the whitespace its `param.json` and manifest can give up (PS5), or the fixed +/// room of its `param.sfo` strings (PS4); never more than [`MAX_NAME_BYTES`]. A character that +/// has to be written escaped (`"` and `\` in `param.json`; `&`, `<` and `>` in the manifest) +/// takes more than its own bytes, so such a name can still be refused a few bytes earlier. +#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize)] +pub struct Room { + /// Changing only the entries that hold the current default name. + pub default_name: usize, + /// Giving every language the name. + pub all_languages: usize, +} + /// A package's names as it holds them. #[derive(Debug, Clone, serde::Serialize)] pub struct Names { @@ -111,6 +125,8 @@ pub struct Names { pub other_names: usize, /// Why the name can't be changed; `None` when it can. pub refusal: Option<Refusal>, + /// How long a new name may be; `None` when it can't be changed. + pub room: Option<Room>, } /// Bytes to write at an offset of the package. @@ -238,6 +254,7 @@ fn names_of( other_names, entries, refusal, + room: None, } } @@ -286,6 +303,17 @@ impl ParamDoc { } } +/// The longest plain name `edit_param` can put into the entries `which`: each takes the name +/// and its two quotes, out of the old literals' bytes and all the whitespace between tokens. +fn param_room(doc: &ParamDoc, which: &[usize]) -> usize { + if which.is_empty() { + return MAX_NAME_BYTES; + } + let old: usize = which.iter().map(|i| doc.names[*i].span.len()).sum(); + let spare: usize = doc.whitespace.iter().map(|r| r.len()).sum(); + ((old + spare) / which.len()).saturating_sub(2) +} + /// Where a value sits in a `param.json`, as far as names go. #[derive(Clone)] enum Place { @@ -675,6 +703,18 @@ fn manifest_indentation(xml: &[u8]) -> Vec<Range<usize>> { out } +/// The longest plain name `set_manifest_name` can put in place of `old`: the old name's bytes +/// and all the indentation the manifest can give up. `None` when the manifest's name is not +/// changed with the package's (it has none, or holds another). +fn manifest_room(xml: &[u8], old: &str) -> Option<usize> { + let inner = element(xml, "titleName")?; + if xml_unescape(&String::from_utf8_lossy(&xml[inner.clone()])) != old { + return None; + } + let spare: usize = manifest_indentation(xml).iter().map(|r| r.len()).sum(); + Some(inner.len() + spare) +} + /// `xml` with `<titleName>` changed from `old` to `new`, at the same length: spaces after /// the element when it gets shorter, indentation given up when it gets longer. `None` when /// the manifest has no such element or it holds another name (left as it is). @@ -918,6 +958,45 @@ impl Ps5 { ) } + /// [`Ps5::names`] with the room a new name has: `param.json`'s and, when the package's + /// manifest repeats the name, the manifest's (the smaller of the two counts). + fn names_with_room(&mut self) -> Names { + let mut names = self.names(); + if names.refusal.is_some() { + return names; + } + let Some((_, doc)) = &self.param else { + return names; + }; + // A manifest that can't be read here limits nothing here: the rename itself reads it + // again and says what is wrong with it. + let manifest = si::read(&mut self.file) + .ok() + .flatten() + .and_then(|zip| { + let m = zip + .members + .iter() + .find(|m| m.name.ends_with("pfsimage.xml"))?; + if m.size > MAX_MANIFEST { + return None; + } + self.file.read_at(m.offset, m.size as usize).ok() + }) + .and_then(|xml| manifest_room(&xml, &names.name)) + .unwrap_or(usize::MAX); + let room = |all: bool| { + param_room(doc, &targets(&names.entries, &names.name, all)) + .min(manifest) + .min(MAX_NAME_BYTES) + }; + names.room = Some(Room { + default_name: room(false), + all_languages: room(true), + }); + names + } + /// The container checks that hold, by name. fn held(&self) -> Vec<String> { verify::container_report(&self.fih_block, &self.fih, &self.cnt) @@ -1405,6 +1484,28 @@ impl Ps4 { ) } + /// [`Ps4::names`] with the room a new name has: the smallest `param.sfo` string it would + /// go into, less its zero byte. + fn names_with_room(&self) -> Names { + let mut names = self.names(); + if names.refusal.is_some() { + return names; + } + let room = |all: bool| { + targets(&names.entries, &names.name, all) + .iter() + .map(|i| self.names[*i].data.len().saturating_sub(1)) + .min() + .unwrap_or(MAX_NAME_BYTES) + .min(MAX_NAME_BYTES) + }; + names.room = Some(Room { + default_name: room(false), + all_languages: room(true), + }); + names + } + fn plan(mut self, name: &str, all: bool, reader_reads_name: bool) -> Result<Plan> { let names = self.names(); if let Some(r) = &self.refusal { @@ -1574,8 +1675,8 @@ fn load(path: &Path) -> Result<Loaded> { /// The names the package at `path` holds, and whether they can be changed. pub fn read(path: &Path) -> Result<Names> { Ok(match load(path)? { - Loaded::Ps5(p) => p.names(), - Loaded::Ps4(p) => p.names(), + Loaded::Ps5(mut p) => p.names_with_room(), + Loaded::Ps4(p) => p.names_with_room(), Loaded::Refused(names) => names, }) } diff --git a/engine/crates/ps5upload-fpkg/src/pkg_name/tests.rs b/engine/crates/ps5upload-fpkg/src/pkg_name/tests.rs index 7b4811ff7..6235f3235 100644 --- a/engine/crates/ps5upload-fpkg/src/pkg_name/tests.rs +++ b/engine/crates/ps5upload-fpkg/src/pkg_name/tests.rs @@ -674,3 +674,80 @@ fn a_manifest_digest_is_set_only_over_the_one_it_holds() { let e = set_manifest_digest(&mut xml, "param-digest", &old, &new).unwrap_err(); assert!(e.contains("is not the container's"), "{e}"); } + +/// The room `read` reports is exact for plain text: a name of that many bytes fits, one more +/// does not. With and without whitespace to give up, for the default name and for every +/// language. +#[test] +fn the_room_a_ps5_package_reports_is_what_fits() { + for (label, param) in [ + ("compact", compact_param()), + ("pretty", pretty_param()), + ("top", pretty_param_with_a_top_name()), + ] { + let dir = TempDir::new(&format!("ps5-room-{label}")); + let pkg = ps5_package(dir.path(), ¶m); + let names = read(&pkg).unwrap(); + let room = names.room.expect("a fake package says its room"); + assert!(room.default_name <= MAX_NAME_BYTES && room.all_languages <= MAX_NAME_BYTES); + for (all, bytes) in [(false, room.default_name), (true, room.all_languages)] { + let fits = "n".repeat(bytes); + let p = plan(&pkg, &fits, all) + .unwrap_or_else(|e| panic!("{label} all={all}: {bytes} bytes should fit: {e}")); + assert!(p.changed > 0); + if bytes < MAX_NAME_BYTES { + let over = "n".repeat(bytes + 1); + let e = plan(&pkg, &over, all).unwrap_err().to_string(); + assert!( + e.contains("too long for this package"), + "{label} all={all}: {e}" + ); + } + } + // A name written to the limit still checks out on disk. + let p = plan(&pkg, &"n".repeat(room.all_languages), true).unwrap(); + apply(&pkg, &p); + check(&pkg, &p).unwrap(); + assert!(full_verify(&pkg).ok(), "{label}"); + } + // No whitespace at all: exactly the old name's length. + let dir = TempDir::new("ps5-room-exact"); + let pkg = ps5_package(dir.path(), &compact_param()); + let room = read(&pkg).unwrap().room.unwrap(); + assert!(room.default_name >= MARKED.len(), "{room:?}"); +} + +#[test] +fn the_room_a_ps4_package_reports_is_what_fits() { + let dir = TempDir::new("ps4-room"); + let pkg = ps4_package(dir.path()); + let room = read(&pkg) + .unwrap() + .room + .expect("a fake package says its room"); + for (all, bytes) in [(false, room.default_name), (true, room.all_languages)] { + assert!(bytes > 0 && bytes <= MAX_NAME_BYTES); + plan(&pkg, &"n".repeat(bytes), all) + .unwrap_or_else(|e| panic!("all={all}: {bytes} bytes should fit: {e}")); + if bytes < MAX_NAME_BYTES { + let e = plan(&pkg, &"n".repeat(bytes + 1), all) + .unwrap_err() + .to_string(); + assert!(e.contains("too long for this package"), "all={all}: {e}"); + } + } +} + +#[test] +fn a_package_that_can_not_be_renamed_reports_no_room() { + let dir = TempDir::new("no-room"); + let delta = dir.path().join("delta.pkg"); + std::fs::write( + &delta, + [crate::lih::MAGIC.as_slice(), &[0u8; 64][..]].concat(), + ) + .unwrap(); + let names = read(&delta).unwrap(); + assert!(names.refusal.is_some()); + assert_eq!(names.room, None); +} diff --git a/engine/crates/ps5upload-fpkg/src/pkg_source.rs b/engine/crates/ps5upload-fpkg/src/pkg_source.rs index e48d3ba6b..ed432b6ae 100644 --- a/engine/crates/ps5upload-fpkg/src/pkg_source.rs +++ b/engine/crates/ps5upload-fpkg/src/pkg_source.rs @@ -1150,8 +1150,20 @@ impl PkgSource { } } +/// What a package whose blocks are stored shuffled is told. +pub const SHUFFLED_MESSAGE: &str = + "this package stores its data in a shuffled byte order, which this reader does not read yet"; + /// The block layout's boundary table: each file's logical start in afid order, then the data -/// end, the metadata base and the mount size. Laid out as [`kraken_image::describe`] reads it. +/// end, the metadata base and the mount size. Laid out as [`kraken_image::describe`] reads it: +/// the outer-block digests (8 B each), then the shuffle-pattern table (header bits 28..31, 8 B a +/// pattern), then the table. Reading it from straight after the digests took a shuffle table for +/// boundaries, and the metadata from the wrong place. +/// +/// A table that names any pattern but the identity (all zeros) is refused: the per-block shuffle +/// is undone by [`kraken_image::decode_described`], but no package with one has been read back +/// here (the builder writes none, and there is no sample), so such a package is refused in words +/// rather than read as bytes no one has checked. fn block_bounds(blob: &[u8]) -> Result<Vec<u64>> { if blob.len() < 16 { return Err(bad("the package's layout descriptor is too short")); @@ -1159,7 +1171,14 @@ fn block_bounds(blob: &[u8]) -> Result<Vec<u64>> { let (w0, w1) = (le64(blob, 0), le64(blob, 8)); let files = (w0 & 0xFF_FFFF) as usize + 1; let outer = (w1 & 0xFF_FFFF) as usize; - let at = 16 + outer * 8; + let shuffles = ((w0 >> 28) & 0xF) as usize; + let patterns = blob + .get(16 + outer * 8..16 + (outer + shuffles) * 8) + .ok_or_else(|| bad("the package's layout descriptor ends inside its shuffle table"))?; + if patterns.iter().any(|&b| b != 0) { + return Err(bad(SHUFFLED_MESSAGE)); + } + let at = 16 + (outer + shuffles) * 8; let table = blob .get(at..at + files * 6) .ok_or_else(|| bad("the package's layout descriptor ends inside its file table"))?; @@ -1471,6 +1490,50 @@ impl SourceTree for PkgSource { mod tests { use super::*; + /// A descriptor's head as the block layout has it: `outer` digests, `table` shuffle + /// patterns, then the boundary table `bounds` (6 B each). + fn descriptor(outer: usize, table: &[[u8; 8]], bounds: &[u64]) -> Vec<u8> { + let w0 = (bounds.len() as u64 - 1) | ((table.len() as u64) << 28) | (7u64 << 32); + let mut blob = w0.to_le_bytes().to_vec(); + blob.extend_from_slice(&(outer as u64).to_le_bytes()); + blob.extend(std::iter::repeat_n(0xAB, outer * 8)); + blob.extend(table.iter().flatten()); + for b in bounds { + blob.extend_from_slice(&b.to_le_bytes()[..5]); + blob.push(0); + } + blob + } + + /// The audit's case: the boundary table was read from straight after the outer digests, + /// as if no package had a shuffle table, though the header says how many patterns sit + /// there first (as `kraken_image::describe` reads it). A table of identity patterns now + /// moves the boundaries as it should; one with a real shuffle is refused in words. + #[test] + fn the_boundary_table_is_read_after_the_shuffle_table() { + let bounds = [0u64, 0x4_0000, 0x9_0000, 0xA_0000, 0xB_0000]; + let plain = descriptor(2, &[], &bounds); + assert_eq!(block_bounds(&plain).unwrap(), bounds); + for n in [1usize, 3, 15] { + let identity = descriptor(2, &vec![[0u8; 8]; n], &bounds); + assert_eq!( + block_bounds(&identity).unwrap(), + bounds, + "{n} identity patterns" + ); + } + let mut table = vec![[0u8; 8]; 2]; + table[1][..2].copy_from_slice(&[4, 4]); + let shuffled = descriptor(2, &table, &bounds); + let e = block_bounds(&shuffled).unwrap_err().to_string(); + assert!(e.contains("shuffled byte order"), "{e}"); + // A header naming more patterns than the blob holds. + let mut short = plain.clone(); + short.truncate(16 + 2 * 8); + short[..8].copy_from_slice(&(4u64 | 15 << 28).to_le_bytes()); + assert!(block_bounds(&short).is_err()); + } + fn open_bytes(bytes: Vec<u8>) -> Result<PkgSource> { let len = bytes.len() as u64; PkgSource::from_reader( diff --git a/engine/crates/ps5upload-fpkg/src/ps4_merge.rs b/engine/crates/ps5upload-fpkg/src/ps4_merge.rs index b5f6e42e9..3634f51a7 100644 --- a/engine/crates/ps5upload-fpkg/src/ps4_merge.rs +++ b/engine/crates/ps5upload-fpkg/src/ps4_merge.rs @@ -178,6 +178,13 @@ impl Ps4Merged { } let game_version = sfo_text(&game_params, "APP_VER").unwrap_or_default(); let update_version = sfo_text(&update_params, "APP_VER").unwrap_or_default(); + // No version is not a newer version: said as what it is. + if update_version.trim().is_empty() { + return format_err( + "the update doesn't say its version (it has no APP_VER), so it can't be told \ + to be newer than the game", + ); + } if version_cmp(&update_version, &game_version) != std::cmp::Ordering::Greater { return format_err(format!( "the update ({update_version}) isn't newer than the game ({game_version}): \ @@ -469,6 +476,9 @@ mod tests { assert!(e.contains("is for CUSA11111"), "{e}"); let e = err(game(), update("01.00", "CUSA99990")); assert!(e.contains("isn't newer"), "{e}"); + // An update that names no version used to count as newer than any game. + let e = err(game(), update("", "CUSA99990")); + assert!(e.contains("doesn't say its version"), "{e}"); let e = err(update("01.05", "CUSA99990"), update("01.06", "CUSA99990")); assert!(e.contains("itself an update"), "{e}"); let e = err(game(), game()); diff --git a/engine/crates/ps5upload-fpkg/src/ufs2_source.rs b/engine/crates/ps5upload-fpkg/src/ufs2_source.rs index 77cee3cf2..a664f43dd 100644 --- a/engine/crates/ps5upload-fpkg/src/ufs2_source.rs +++ b/engine/crates/ps5upload-fpkg/src/ufs2_source.rs @@ -2,7 +2,7 @@ use std::path::Path; -use ps5upload_pkg::ufs2::{Inode, Ufs2Error, Ufs2Image, ROOT_INODE}; +use ps5upload_pkg::ufs2::{Inode, Ufs2Error, Ufs2Image, WalkBudget, ROOT_INODE}; use crate::source::{dir_label, is_junk, SourceFile, SourceTree}; use crate::{format_err, ReadSeek, Result}; @@ -55,6 +55,7 @@ impl Ufs2Source { dirs: std::collections::HashSet::from([ROOT_INODE]), path_bytes: 0, listed: 0, + budget: WalkBudget::default(), special: Vec::new(), special_count: 0, }; @@ -151,6 +152,8 @@ struct Walk<'a> { /// [`MAX_ENTRIES`]: counted as they are listed, so the entries of directories still being /// walked further up count too. listed: usize, + /// Directory bytes read so far, every directory's: see [`WalkBudget`]. + budget: WalkBudget, /// Entries that are neither files nor directories, as `path (kind)`: the first /// [`MAX_SPECIAL_LISTED`], refused together once the walk is done. special: Vec<String>, @@ -181,7 +184,7 @@ fn walk( return format_err(format!("{prefix} nests deeper than {MAX_DEPTH} levels")); } let entries: Vec<_> = image - .list_dir(dir) + .list_dir_in_walk(dir, &mut tree.budget) .map_err(|e| crate::Error::Format(format!("{}: {e}", dir_label(prefix))))? .into_iter() .filter(|e| !e.name.is_empty() && !is_junk(&e.name)) diff --git a/engine/crates/ps5upload-hub/PROTOCOL.md b/engine/crates/ps5upload-hub/PROTOCOL.md index 8b0b51060..ac414ca1e 100644 --- a/engine/crates/ps5upload-hub/PROTOCOL.md +++ b/engine/crates/ps5upload-hub/PROTOCOL.md @@ -31,13 +31,20 @@ Endpoint: `wss://hub.phantomptr.com/ws`. | Name | Made by | Form | |------|---------|------| -| `room` | the host (engine) | 22 base64url characters (`A-Z a-z 0-9 - _`): 16 random bytes, no padding | +| `room` | the host (engine) | 22 base64url characters (`A-Z a-z 0-9 - _`), made from the secret: the first 21 characters of base64url(SHA-256(`ps5upload-hub room` + one zero byte + `secret`)), then `h`. Older apps: 16 random bytes, no padding (such an id never ends in `h`) | | `secret` | the host (engine) | 43 base64url characters: 32 random bytes, no padding | | `gid` | the hub | 12 base64url characters (9 random bytes), unique within the room | The invite link carries the `room` only. The `secret` never leaves the host; the hub keeps only its SHA-256 and uses it to let the same host take the room back after a reconnect. +A room id that ends in `h` is **bound** to its secret: the hub opens it only for the secret it +was made from, so nobody else with the link can open it, also on a hub that has just restarted +and has no rooms. The id is the proof; the hub stores nothing for it. An id of any other form (an +older app's) opens for any secret while it is free, as before: that host's room can be taken by +a link holder after a hub restart until the app is updated. Hosts and hubs of either age work +with each other. + ## Messages ### Host @@ -53,8 +60,10 @@ its SHA-256 and uses it to let the same host take the room back after a reconnec sends one `{"t":"guest","gid":...}` for every guest still in the room, so the new socket can pick their negotiation back up. - Existing room, different secret: `{"t":"error","why":"room_taken"}`, close. +- A bound room id (ending in `h`) with a secret it was not made from: `room_taken`, close, + whether the room is open or not. - A room whose host is gone waits **2 minutes** for a reclaim, then is removed (its id is free - again, for any secret). + again: for any secret, or a bound id for its own only). Host receives: @@ -76,6 +85,10 @@ Host receives: - No such room, or its host is away: `{"t":"error","why":"no_room"}`, close. - Room has 8 guests: `{"t":"error","why":"room_full"}`, close. - After `closed` the hub closes the socket (code 1000). +- A guest leaves once its connection to the host is up. One still in the room **3 minutes** + after it joined is removed: `{"t":"error","why":"timeout"}`, close (4000); the host gets + `left` for it. (The guest page holds a place it took early for a minute at most and gives ICE + 15 s, so no real guest stays that long; idle sockets cannot keep a room full.) ### Signal (both sides) @@ -93,6 +106,12 @@ Forwarded as `{"t":"signal","from":"host"|"<gid>","data":<data unchanged>}`. - A guest may only address `"host"`; a host only a `gid`. Anything else: `bad_target`, close. - A host addressing a `gid` that has gone gets `{"t":"error","why":"no_peer"}`; this one error does **not** close the socket (the guest may have left a moment ago). +- A host over its signal limit is not closed: the signals past it are dropped (not forwarded, + no error) until the minute is over. Guests make a host send (it answers each offer), so a + limit that closed the host let anyone with the link cut it off. +- A guest over its own limit, or over its client's in the room (all that client's guests + there together, those that left included), gets `rate_limited`, close. Joining again does not + refill a client's: while it is used up, that client's `join` to the room gets `rate_limited`. ### Leave @@ -126,13 +145,14 @@ Forwarded as `{"t":"signal","from":"host"|"<gid>","data":<data unchanged>}`. | `bad_state` | `host`/`join` on a socket that already has a role; `signal`/`leave` before one | | `bad_target` | a signal `to` the sender may not address | | `bad_data` | signal `data` missing, not an object, or over 12 KiB | -| `room_taken` | `host` with the wrong secret | +| `room_taken` | `host` with the wrong secret (for a bound room id: one it was not made from) | | `no_room` | `join` to a room that does not exist or has no host right now | | `room_full` | `join` to a room with 8 guests | -| `rate_limited` | over a per-minute limit (below) | +| `rate_limited` | over a per-minute limit (below; a host's signals past its limit are dropped instead) | | `server_full` | `host` when the hub has 5,000 rooms | | `too_many_rooms` | `host` from a client that already has 8 rooms | | `no_peer` | signal to a guest that has gone (not fatal) | +| `timeout` | a guest still in its room 3 minutes after it joined | ## Limits (defaults) @@ -140,7 +160,8 @@ Forwarded as `{"t":"signal","from":"host"|"<gid>","data":<data unchanged>}`. |-------|---------| | guests per room | 8 | | signals per guest | 20 per minute | -| signals per host (all its guests together) | 200 per minute | +| signals per guest client in one room (its guests together, joins again included) | 60 per minute | +| signals per host (all its guests together) | 200 per minute (past it: dropped) | | `join` attempts per client | 30 per minute (found or not) | | rooms on the hub | 5,000 | | rooms per client | 8 (a room counts toward its creator until removed) | @@ -149,6 +170,7 @@ Forwarded as `{"t":"signal","from":"host"|"<gid>","data":<data unchanged>}`. | open connections on the hub | 2,000 (HTTP 503 past it) | | time to send `host` or `join` | 10 s | | room without host | removed after 2 minutes | +| guest in a room | removed 3 minutes after it joined | | STUN requests per client (if STUN is on) | 60 per minute (over that: no answer) | A *client* is an IPv4 address or an IPv6 /64. Behind a reverse proxy, the client address comes @@ -181,8 +203,9 @@ IPv6. It ignores every other message and does no TURN. - `GET /health`: `ok`. - `GET /metrics`: Prometheus text, counts only (rooms, guests, connections, hosts, reclaims, - joins, signals, expired rooms, STUN requests, errors by kind). Kept private: localhost only - behind Caddy, or a separate private port (`HUB_METRICS_LISTEN`) on Fly. + joins, signals, dropped host signals, expired rooms and guests, STUN requests, errors by + kind). Kept private: localhost only behind Caddy, or a separate private port + (`HUB_METRICS_LISTEN`) on Fly. ## Privacy @@ -208,5 +231,5 @@ host ← {"t":"left","gid":"G"} ``` Who sends the offer is up to the engine and the page; the hub does not care. Once the WebRTC -connection is up, both sides may stay connected to the hub (for renegotiation) or the guest may -leave; the media does not depend on the hub. +connection is up the guest leaves the hub (it would be removed 3 minutes after it joined anyway); +the host stays for new guests. The media does not depend on the hub. diff --git a/engine/crates/ps5upload-hub/deploy/FLY.md b/engine/crates/ps5upload-hub/deploy/FLY.md index 983e92662..516fa373b 100644 --- a/engine/crates/ps5upload-hub/deploy/FLY.md +++ b/engine/crates/ps5upload-hub/deploy/FLY.md @@ -44,7 +44,10 @@ fly status curl https://ps5upload-hub.fly.dev/health # prints ok ``` -Later deploys: just `fly deploy --ha=false` from the same directory. +Later deploys: just `fly deploy --ha=false` from the same directory. The hub and the app may be +updated in either order: a newer hub takes older apps' rooms as before, and an older hub takes a +newer app's. Only rooms of an updated app on an updated hub are bound to their host (nobody else +can open them after a restart; PROTOCOL.md, Identifiers). ## 4. The hub.phantomptr.com name diff --git a/engine/crates/ps5upload-hub/deploy/ps5upload-hub.env b/engine/crates/ps5upload-hub/deploy/ps5upload-hub.env index aeccbd624..7561fd30f 100644 --- a/engine/crates/ps5upload-hub/deploy/ps5upload-hub.env +++ b/engine/crates/ps5upload-hub/deploy/ps5upload-hub.env @@ -14,6 +14,8 @@ HUB_CLIENT_IP_HEADER=x-forwarded-for # Limits (defaults shown): #HUB_MAX_GUESTS_PER_ROOM=8 #HUB_MAX_SIGNALS_PER_GUEST=20 +# One client's guests in one room together, joining again included: +#HUB_MAX_SIGNALS_PER_GUEST_CLIENT=60 #HUB_MAX_SIGNALS_PER_HOST=200 #HUB_MAX_JOINS_PER_IP=30 #HUB_MAX_ROOMS=5000 @@ -25,4 +27,6 @@ HUB_CLIENT_IP_HEADER=x-forwarded-for #HUB_HELLO_SECS=10 #HUB_MAX_STUN_PER_IP=60 #HUB_ROOM_IDLE_SECS=120 +# A guest still in its room this long after it joined is removed: +#HUB_GUEST_MAX_SECS=180 #HUB_ALLOWED_ORIGINS=https://ps5upload.phantomptr.com,tauri://localhost,http://tauri.localhost,https://tauri.localhost diff --git a/engine/crates/ps5upload-hub/src/config.rs b/engine/crates/ps5upload-hub/src/config.rs index 52669be06..d40643375 100644 --- a/engine/crates/ps5upload-hub/src/config.rs +++ b/engine/crates/ps5upload-hub/src/config.rs @@ -101,6 +101,12 @@ pub struct Config { pub max_guests_per_room: usize, pub max_signals_per_guest: u32, + /// Signals one guest client (an address, see `limits.rs`) may send in one room per window, + /// all its guests there together, those that left included: joining again does not refill + /// it. Room for a few guests from one home. + pub max_signals_per_guest_client: u32, + /// Signals a host may send per window, to all its guests together. Past it they are + /// dropped, not forwarded; the host stays. pub max_signals_per_host: u32, pub max_joins_per_ip: u32, pub max_rooms: usize, @@ -119,6 +125,11 @@ pub struct Config { pub rate_window: Duration, /// A room with no host for this long is removed. pub room_idle_ttl: Duration, + /// A guest still in its room this long after it joined is removed (it gets `timeout`). A + /// client leaves the hub once its connection to the host is up, within a minute and a half + /// at most (a page holds the place it took early for a minute, ICE gets 15 seconds), so a + /// guest past this has not made a session: idle sockets cannot keep a room full. + pub guest_max_age: Duration, /// WebSocket ping cadence. A peer heard from within the last interval is not pinged (the /// engine pings the hub itself), so a quiet peer is pinged at most every two intervals. pub ping_interval: Duration, @@ -152,6 +163,7 @@ impl Default for Config { client_ip_header: "x-forwarded-for".to_string(), max_guests_per_room: 8, max_signals_per_guest: 20, + max_signals_per_guest_client: 60, max_signals_per_host: 200, max_joins_per_ip: 30, max_rooms: 5_000, @@ -168,6 +180,8 @@ impl Default for Config { hello_timeout: Duration::from_secs(10), rate_window: Duration::from_secs(60), room_idle_ttl: Duration::from_secs(120), + // Twice the longest a real guest stays (about 75 s), with room for a slow network. + guest_max_age: Duration::from_secs(180), ping_interval: Duration::from_secs(20), peer_timeout: Duration::from_secs(60), sweep_interval: Duration::from_secs(30), @@ -252,6 +266,11 @@ impl Config { "HUB_MAX_SIGNALS_PER_GUEST", &mut c.max_signals_per_guest, )?; + num( + get, + "HUB_MAX_SIGNALS_PER_GUEST_CLIENT", + &mut c.max_signals_per_guest_client, + )?; num(get, "HUB_MAX_SIGNALS_PER_HOST", &mut c.max_signals_per_host)?; num(get, "HUB_MAX_JOINS_PER_IP", &mut c.max_joins_per_ip)?; num(get, "HUB_MAX_ROOMS", &mut c.max_rooms)?; @@ -272,6 +291,7 @@ impl Config { secs(get, "HUB_HELLO_SECS", &mut c.hello_timeout)?; secs(get, "HUB_RATE_WINDOW_SECS", &mut c.rate_window)?; secs(get, "HUB_ROOM_IDLE_SECS", &mut c.room_idle_ttl)?; + secs(get, "HUB_GUEST_MAX_SECS", &mut c.guest_max_age)?; secs(get, "HUB_PING_SECS", &mut c.ping_interval)?; secs(get, "HUB_PEER_TIMEOUT_SECS", &mut c.peer_timeout)?; secs(get, "HUB_SUMMARY_SECS", &mut c.summary_interval)?; @@ -284,6 +304,9 @@ impl Config { if c.rate_window.is_zero() { return Err("HUB_RATE_WINDOW_SECS must be above zero".into()); } + if c.guest_max_age.is_zero() { + return Err("HUB_GUEST_MAX_SECS must be above zero".into()); + } Ok(c) } } diff --git a/engine/crates/ps5upload-hub/src/hub.rs b/engine/crates/ps5upload-hub/src/hub.rs index 80b5b86ab..8ff30caa8 100644 --- a/engine/crates/ps5upload-hub/src/hub.rs +++ b/engine/crates/ps5upload-hub/src/hub.rs @@ -34,6 +34,33 @@ pub const PROTOCOL_VERSION: u64 = 1; pub const ROOM_LEN: usize = 22; pub const SECRET_LEN: usize = 43; pub const GID_LEN: usize = 12; +/// The last character of a room id made from its host's secret ([`room_for_secret`]). A room id +/// of 16 random bytes (what older apps make) never ends in it: the last of its 22 base64url +/// characters holds 2 bits only, so it is always `A`, `Q`, `g` or `w`. +pub const BOUND_ROOM_MARK: char = 'h'; +/// What a bound room id hashes before the secret: the id is never a prefix of the hash the hub +/// keeps for reclaims. +const BOUND_ROOM_DOMAIN: &[u8] = b"ps5upload-hub room\0"; + +/// The room id a host's secret gives: 21 base64url characters of a SHA-256 of the secret (126 +/// bits), then [`BOUND_ROOM_MARK`]. The hub opens a room with an id of this form only for the +/// secret it was made from, so a link holder cannot open it with a secret of their own, also +/// after a hub restart (when the hub has no rooms at all): the id is the proof, nothing is stored. +pub fn room_for_secret(secret: &str) -> String { + let h = Sha256::new() + .chain_update(BOUND_ROOM_DOMAIN) + .chain_update(secret.as_bytes()) + .finalize(); + let mut id = base64::engine::general_purpose::URL_SAFE_NO_PAD.encode(h); + id.truncate(ROOM_LEN - 1); + id.push(BOUND_ROOM_MARK); + id +} + +/// A room id of the bound form ([`room_for_secret`]): only its own secret may host it. +pub fn is_bound_room(room: &str) -> bool { + room.len() == ROOM_LEN && room.ends_with(BOUND_ROOM_MARK) +} /// Messages queued for one peer before it counts as too slow. const PEER_QUEUE: usize = 64; /// The hard frame cap given to the WebSocket layer. Frames between the protocol limit and this @@ -93,11 +120,23 @@ struct Room { host_signals: Window, hostless_since: Option<Instant>, guests: HashMap<String, Guest>, + /// Each guest client's signals in this room ([`Config::max_signals_per_guest_client`]), + /// kept when its guest goes so that joining again does not refill them. Bounded: at most + /// [`GUEST_CLIENTS_PER_SEAT`] per seat, and windows that ran out are dropped. + guest_clients: HashMap<IpKey, Window>, } +/// Guest clients a room keeps a signal budget for, per seat (8 seats: 32 clients a minute). +const GUEST_CLIENTS_PER_SEAT: usize = 4; + struct Guest { peer: Peer, signals: Window, + /// When it joined: a guest still here [`Config::guest_max_age`] later is removed. + joined: Instant, + /// Who it is (the address [`client_ip`] gave): its signals count toward that client's + /// budget in the room too. + client: IpKey, } #[derive(Clone)] @@ -567,6 +606,12 @@ fn on_host( if !is_b64url(secret, SECRET_LEN) { return Err(ErrorKind::BadSecret); } + // A bound id opens for its own secret only. Before, the first `host` for an id after a hub + // restart took it with any secret: anyone with the link could open the room as theirs, its + // host got `room_taken` from then on, and the guests' offers went to them. + if is_bound_room(room_id) && room_for_secret(secret) != room_id { + return Err(ErrorKind::RoomTaken); + } let hash = hash_secret(secret); let now = Instant::now(); let mut st = shared.state.lock().unwrap_or_else(|e| e.into_inner()); @@ -602,6 +647,7 @@ fn on_host( host_signals: Window::new(now), hostless_since: None, guests: HashMap::new(), + guest_clients: HashMap::new(), }, ); Metrics::inc(&shared.metrics.hosts); @@ -643,6 +689,28 @@ fn on_join( if room.guests.len() >= cfg.max_guests_per_room { return Err(ErrorKind::RoomFull); } + // The client's signal budget here outlives its guests: before, each join came with a fresh + // one, so one client joining again and again (30 times a minute) sent the host 600 signals + // a minute where one guest may send 20. A client that has used it up is refused now rather + // than at its first signal. The table holds clients that joined within the window, at most + // a few per seat: past that, a new client waits for windows to run out. + let cap = cfg + .max_guests_per_room + .saturating_mul(GUEST_CLIENTS_PER_SEAT); + if !room.guest_clients.contains_key(&ip) && room.guest_clients.len() >= cap { + room.guest_clients + .retain(|_, w| !w.expired(now, cfg.rate_window)); + if room.guest_clients.len() >= cap { + return Err(ErrorKind::RateLimited); + } + } + let budget = room + .guest_clients + .entry(ip) + .or_insert_with(|| Window::new(now)); + if budget.used_up(now, cfg.rate_window, cfg.max_signals_per_guest_client) { + return Err(ErrorKind::RateLimited); + } let gid = loop { let g = random_b64(GID_LEN * 3 / 4); if !room.guests.contains_key(&g) { @@ -654,6 +722,8 @@ fn on_join( Guest { peer: me.clone(), signals: Window::new(now), + joined: now, + client: ip, }, ); host.send( @@ -699,6 +769,15 @@ fn on_signal(shared: &Shared, role: &mut Role, msg: &Msg) -> Result<Action, Erro { return Err(ErrorKind::RateLimited); } + // (An entry the sweeper dropped as run out starts again: a guest in the room has a + // seat, so this adds at most one per seat past the join's bound.) + let client = r + .guest_clients + .entry(g.client) + .or_insert_with(|| Window::new(now)); + if !client.hit(now, cfg.rate_window, cfg.max_signals_per_guest_client) { + return Err(ErrorKind::RateLimited); + } let Some(h) = &r.host else { return Err(ErrorKind::NoPeer); }; @@ -713,11 +792,16 @@ fn on_signal(shared: &Shared, role: &mut Role, msg: &Msg) -> Result<Action, Erro let Some(r) = st.rooms.get_mut(room.as_str()) else { return Err(ErrorKind::NoPeer); }; + // Over the host's limit: the signal is dropped and the host stays. Before, the host + // was closed (and every guest with it, and again on each reconnect while the window + // lasted), and guests make a host send: it answers each offer. So anyone with the + // link could cut the host off by offering fast enough. if !r .host_signals .hit(now, cfg.rate_window, cfg.max_signals_per_host) { - return Err(ErrorKind::RateLimited); + Metrics::inc(&shared.metrics.host_signals_dropped); + return Ok(Action::Reply(Vec::new())); } let Some(g) = r.guests.get(to) else { return Err(ErrorKind::NoPeer); @@ -830,6 +914,11 @@ pub(crate) async fn sweeper(shared: Arc<Shared>, stun_table: Arc<Mutex<RateTable st.remove_room(&id); Metrics::inc(&shared.metrics.rooms_expired); } + expire_guests(&mut st, now, cfg.guest_max_age, &shared.metrics); + for r in st.rooms.values_mut() { + r.guest_clients + .retain(|_, w| !w.expired(now, cfg.rate_window)); + } st.joins.sweep(now, cfg.rate_window); } stun_table @@ -863,6 +952,34 @@ pub(crate) async fn sweeper(shared: Arc<Shared>, stun_table: Arc<Mutex<RateTable } } +/// Removes the guests that joined `max_age` ago or more. The hub only introduces a guest: every +/// client leaves its room once its connection to the host is up (the guest page and the share +/// client from the start), well within a minute and a half, so one still here has not made a +/// session and will not. Before, a few sockets that joined and then sat idle (answering pings) +/// kept a room full for as long as they liked. The guest gets `timeout` (4000), its host `left`. +fn expire_guests(st: &mut State, now: Instant, max_age: Duration, m: &Metrics) { + for r in st.rooms.values_mut() { + let old: Vec<String> = r + .guests + .iter() + .filter(|(_, g)| now.duration_since(g.joined) >= max_age) + .map(|(gid, _)| gid.clone()) + .collect(); + for gid in old { + let Some(g) = r.guests.remove(&gid) else { + continue; + }; + m.error(ErrorKind::Timeout); + Metrics::inc(&m.guests_expired); + g.peer.send(Out::Text(error_text(ErrorKind::Timeout)), m); + g.peer.send(Out::Close(CLOSE_PROTOCOL, "timeout"), m); + if let Some(h) = &r.host { + h.send(Out::Text(json!({"t": "left", "gid": gid}).to_string()), m); + } + } + } +} + /// Resolves once shutdown is asked for (holds no borrow of the channel across the await). async fn stopped(rx: &mut tokio::sync::watch::Receiver<bool>) { let _ = rx.wait_for(|v| *v).await; @@ -1039,6 +1156,77 @@ mod tests { assert_eq!(got["data"], json!({"b": 2})); } + #[test] + fn a_bound_room_id_is_the_secrets_and_a_random_one_is_never_bound() { + let a = random_b64(32); + let b = random_b64(32); + let ra = room_for_secret(&a); + assert_eq!(ra, room_for_secret(&a)); + assert_ne!(ra, room_for_secret(&b)); + assert!(is_b64url(&ra, ROOM_LEN) && is_bound_room(&ra)); + // Not a piece of the hash kept for reclaims. + let kept = base64::engine::general_purpose::URL_SAFE_NO_PAD.encode(hash_secret(&a)); + assert!(!kept.starts_with(&ra[..ROOM_LEN - 1])); + // What older apps make: 16 random bytes. Never of the bound form. + for _ in 0..2_000 { + let old = random_b64(16); + assert_eq!(old.len(), ROOM_LEN); + assert!(!is_bound_room(&old), "{old}"); + } + // In process: a bound id with another secret is refused, with its own taken. + let sh = shared(Config::default()); + let (p, _rx) = peer(1); + let host = |room: &str, secret: &str| { + let msg = json!({"v": 1, "t": "host", "room": room, "secret": secret}).to_string(); + handle_text(&sh, &mut Role::None, &p, ip(), &msg).map(|_| ()) + }; + assert!(matches!(host(&ra, &b), Err(ErrorKind::RoomTaken))); + assert!(host(&ra, &a).is_ok()); + } + + /// The per-client budgets a room keeps are bounded: past a few clients per seat in one window + /// a new client is refused (an old one is not) until windows run out. + #[test] + fn a_rooms_client_budgets_are_bounded() { + let window = Duration::from_millis(200); + let sh = shared(Config { + max_guests_per_room: 1, + rate_window: window, + ..Config::default() + }); + let (hp, _hrx) = peer(1); + let room = "A".repeat(ROOM_LEN); + let host = json!({"v": 1, "t": "host", "room": room, "secret": "S".repeat(SECRET_LEN)}); + assert!(handle_text(&sh, &mut Role::None, &hp, ip(), &host.to_string()).is_ok()); + let join = json!({"v": 1, "t": "join", "room": room}).to_string(); + let client = |n: u32| IpKey::V4(0xc633_6400 + n); + // Join and leave: one seat, one client at a time. + let visit = |n: u32| { + let (gp, _grx) = peer(10 + u64::from(n)); + let mut role = Role::None; + let res = handle_text(&sh, &mut role, &gp, client(n), &join).map(|_| ()); + if res.is_ok() { + let leave = json!({"t": "leave"}).to_string(); + assert!(handle_text(&sh, &mut role, &gp, client(n), &leave).is_ok()); + } + res + }; + let cap = GUEST_CLIENTS_PER_SEAT as u32; + for n in 0..cap { + assert!(visit(n).is_ok(), "client {n}"); + } + assert!(matches!(visit(cap), Err(ErrorKind::RateLimited))); + assert!(visit(0).is_ok(), "a client it has may come back"); + let kept = |sh: &Shared| { + let st = sh.state.lock().unwrap(); + st.rooms[&room].guest_clients.len() + }; + assert_eq!(kept(&sh), GUEST_CLIENTS_PER_SEAT); + std::thread::sleep(window); + assert!(visit(cap).is_ok(), "windows ran out"); + assert_eq!(kept(&sh), 1); + } + /// `cargo test -p ps5upload-hub --release forward_cost -- --ignored --nocapture`: the time the /// hub spends on one forwarded offer (about 5 KB) and one ICE candidate, in process. #[test] @@ -1046,6 +1234,7 @@ mod tests { fn forward_cost() { let c = Config { max_signals_per_guest: u32::MAX, + max_signals_per_guest_client: u32::MAX, max_signals_per_host: u32::MAX, ..Config::default() }; diff --git a/engine/crates/ps5upload-hub/src/limits.rs b/engine/crates/ps5upload-hub/src/limits.rs index 296ba0382..4000cd329 100644 --- a/engine/crates/ps5upload-hub/src/limits.rs +++ b/engine/crates/ps5upload-hub/src/limits.rs @@ -71,7 +71,12 @@ impl Window { true } - fn expired(&self, now: Instant, window: Duration) -> bool { + /// `max` events counted in a window that is still running: the next [`Window::hit`] fails. + pub fn used_up(&self, now: Instant, window: Duration, max: u32) -> bool { + !self.expired(now, window) && self.count >= max + } + + pub fn expired(&self, now: Instant, window: Duration) -> bool { now.duration_since(self.start) >= window } } @@ -128,7 +133,10 @@ mod tests { assert!(win.hit(t0, w, 2)); assert!(win.hit(t0, w, 2)); assert!(!win.hit(t0, w, 2)); + assert!(win.used_up(t0, w, 2)); + assert!(!win.used_up(t0 + w, w, 2)); assert!(win.hit(t0 + w, w, 2)); + assert!(!win.used_up(t0 + w, w, 2)); } #[test] diff --git a/engine/crates/ps5upload-hub/src/metrics.rs b/engine/crates/ps5upload-hub/src/metrics.rs index 34ef0d148..01e5a3940 100644 --- a/engine/crates/ps5upload-hub/src/metrics.rs +++ b/engine/crates/ps5upload-hub/src/metrics.rs @@ -116,7 +116,9 @@ pub struct Metrics { pub reclaims: AtomicU64, pub joins: AtomicU64, pub signals: AtomicU64, + pub host_signals_dropped: AtomicU64, pub rooms_expired: AtomicU64, + pub guests_expired: AtomicU64, pub stun_requests: AtomicU64, pub stun_ignored: AtomicU64, pub stun_limited: AtomicU64, @@ -144,7 +146,8 @@ impl Metrics { self.errors.iter().map(|e| e.load(Ordering::Relaxed)).sum() } - /// Requests refused by a limit (rate, size of the hub, rooms or connections per client). + /// Requests refused by a limit (rate, size of the hub, rooms or connections per client), and + /// host signals dropped by the host's. pub fn refused_total(&self) -> u64 { [ ErrorKind::RateLimited, @@ -156,6 +159,7 @@ impl Metrics { .map(|k| self.errors(*k)) .sum::<u64>() + self.stun_limited.load(Ordering::Relaxed) + + self.host_signals_dropped.load(Ordering::Relaxed) } /// A number that grows whenever any counter does: the summary skips an interval in which it @@ -166,7 +170,9 @@ impl Metrics { &self.reclaims, &self.joins, &self.signals, + &self.host_signals_dropped, &self.rooms_expired, + &self.guests_expired, &self.stun_requests, &self.stun_ignored, &self.stun_limited, @@ -214,11 +220,21 @@ impl Metrics { ); counter("hub_joins_total", "Guests joined.", &self.joins); counter("hub_signals_total", "Signals forwarded.", &self.signals); + counter( + "hub_host_signals_dropped_total", + "Host signals not forwarded: over the host's limit.", + &self.host_signals_dropped, + ); counter( "hub_rooms_expired_total", "Rooms removed after their host stayed away.", &self.rooms_expired, ); + counter( + "hub_guests_expired_total", + "Guests removed for staying in a room past the longest a join takes.", + &self.guests_expired, + ); counter( "hub_stun_requests_total", "STUN Binding requests answered.", diff --git a/engine/crates/ps5upload-hub/tests/hub.rs b/engine/crates/ps5upload-hub/tests/hub.rs index 649c58e3e..e6950e558 100644 --- a/engine/crates/ps5upload-hub/tests/hub.rs +++ b/engine/crates/ps5upload-hub/tests/hub.rs @@ -175,7 +175,12 @@ async fn host(t: &TestHub, r: &str, s: &str) -> Ws { /// Joins; returns the guest socket and its gid (and checks the host heard about it). async fn join(t: &TestHub, host_ws: &mut Ws, r: &str) -> (Ws, String) { - let mut ws = connect(t).await; + join_from(t, host_ws, r, None).await +} + +/// [`join`] as the client a trusted proxy names (`xff`). +async fn join_from(t: &TestHub, host_ws: &mut Ws, r: &str, xff: Option<&str>) -> (Ws, String) { + let mut ws = connect_with(t, None, xff).await; send(&mut ws, json!({"v":1,"t":"join","room":r})).await; let j = recv(&mut ws).await; assert_eq!(j["t"], "joined", "{j}"); @@ -342,6 +347,112 @@ async fn reclaim_and_room_taken() { host(&t, &r, &secret(5)).await; } +/// A room id made from its host's secret opens for that secret only: on the hub as it runs and on +/// a hub that has just restarted with no rooms at all (before, the first `host` after a restart +/// took any id with any secret, so a link holder could open the room as theirs). +#[tokio::test] +async fn a_bound_room_opens_for_its_own_secret_only_also_after_a_restart() { + let s = secret(40); + let r = ps5upload_hub::hub::room_for_secret(&s); + assert!(ps5upload_hub::hub::is_bound_room(&r), "{r}"); + let t = start(cfg()).await; + let mut h = host(&t, &r, &s).await; + let (_g, _) = join(&t, &mut h, &r).await; + t.hub.stop(Duration::from_secs(3)).await; + assert_eq!(recv_close(&mut h).await, Some(1001)); + + // The hub is back with nothing in memory. Someone with the link comes first: refused. + let t = start(cfg()).await; + let mut x = connect(&t).await; + send( + &mut x, + json!({"v":1,"t":"host","room":r,"secret":secret(41)}), + ) + .await; + expect_fatal(&mut x, "room_taken").await; + // The host comes back with its secret: the room is its again, and guests reach it. + let mut h = host(&t, &r, &s).await; + let (mut g, gid) = join(&t, &mut h, &r).await; + send(&mut g, json!({"t":"signal","to":"host","data":{"o":1}})).await; + assert_eq!( + recv(&mut h).await, + json!({"t":"signal","from":gid,"data":{"o":1}}) + ); + // Any id of the bound form needs the secret it was made from, room or no room. + let other = ps5upload_hub::hub::room_for_secret(&secret(42)); + let mut y = connect(&t).await; + send( + &mut y, + json!({"v":1,"t":"host","room":other,"secret":secret(43)}), + ) + .await; + expect_fatal(&mut y, "room_taken").await; +} + +/// An older app's room id (16 random bytes, so it ends in A, Q, g or w) opens as before: with any +/// secret while the id is free, for that secret only while it is open. +#[tokio::test] +async fn an_older_apps_room_id_still_opens() { + use base64::Engine as _; + let t = start(cfg()).await; + let mut open = Vec::new(); + for (n, last) in [(0u8, 'A'), (1, 'Q'), (2, 'g'), (3, 'w')] { + let mut bytes = [7u8; 16]; + // The last character is the last byte's low 2 bits, then 4 zero bits. + bytes[15] = 0x1c | n; + let r = base64::engine::general_purpose::URL_SAFE_NO_PAD.encode(bytes); + assert_eq!((r.len(), r.chars().last()), (22, Some(last)), "{r}"); + assert!(!ps5upload_hub::hub::is_bound_room(&r)); + let mut h = host(&t, &r, &secret(50 + u32::from(n))).await; + let (_g, _) = join(&t, &mut h, &r).await; + let mut x = connect(&t).await; + send( + &mut x, + json!({"v":1,"t":"host","room":r,"secret":secret(99)}), + ) + .await; + expect_fatal(&mut x, "room_taken").await; + open.push(h); + } +} + +/// A guest that joined and then sat in the room (it never left, as every client does once its +/// connection is up) is removed after the longest a join may take, and its seat is free again. +#[tokio::test] +async fn an_idle_guest_is_removed_after_its_time() { + let t = start(Config { + max_guests_per_room: 2, + guest_max_age: Duration::from_millis(400), + sweep_interval: Duration::from_millis(50), + ..cfg() + }) + .await; + let r = room(45); + let mut h = host(&t, &r, &secret(45)).await; + let (mut g1, gid1) = join(&t, &mut h, &r).await; + let (mut g2, gid2) = join(&t, &mut h, &r).await; + let mut full = connect(&t).await; + send(&mut full, json!({"v":1,"t":"join","room":r})).await; + expect_fatal(&mut full, "room_full").await; + // Both idle guests go: each is told, and so is the host. + for g in [&mut g1, &mut g2] { + expect_fatal(g, "timeout").await; + } + let mut left = [recv(&mut h).await, recv(&mut h).await]; + left.sort_by_key(|v| v["gid"].as_str().unwrap_or("").to_string()); + let mut want = [ + json!({"t":"left","gid":gid1}), + json!({"t":"left","gid":gid2}), + ]; + want.sort_by_key(|v| v["gid"].as_str().unwrap_or("").to_string()); + assert_eq!(left, want); + // The seats are free, and the host is still there. + let (_g3, _) = join(&t, &mut h, &r).await; + let m = t.hub.shared.metrics_text(); + assert_eq!(metric(&m, "hub_guests_expired_total"), 2); + assert_eq!(metric(&m, "hub_rooms_hosted"), 1); +} + #[tokio::test] async fn limit_guests_per_room() { let t = start(Config { @@ -386,8 +497,68 @@ async fn limit_signals() { send(&mut h, json!({"t":"signal","to":gid2,"data":{"i":i}})).await; assert_eq!(recv(&mut g2).await["data"]["i"], i); } + // Over the host's limit: dropped, and the host stays with its guests (it was closed, and + // its guests with it: guests can make a host send, so that was theirs to do). send(&mut h, json!({"t":"signal","to":gid2,"data":{"i":4}})).await; - expect_fatal(&mut h, "rate_limited").await; + quiet(&mut g2, Duration::from_millis(200)).await; + send( + &mut g2, + json!({"t":"signal","to":"host","data":{"still":1}}), + ) + .await; + assert_eq!( + recv(&mut h).await, + json!({"t":"signal","from":gid2,"data":{"still":1}}) + ); + let m = t.hub.shared.metrics_text(); + assert_eq!(metric(&m, "hub_host_signals_dropped_total"), 1); + assert_eq!(metric(&m, "hub_rooms_hosted"), 1); +} + +/// A guest's budget is its client's in the room, and leaving and joining again does not refill +/// it (it did: each join came with 20 fresh signals, and a client may join 30 times a minute). +/// Another client has its own. +#[tokio::test] +async fn a_clients_signals_in_a_room_last_across_its_joins() { + let t = start(Config { + max_signals_per_guest: 3, + max_signals_per_guest_client: 5, + trusted_proxies: vec!["127.0.0.1".parse::<Cidr>().unwrap()], + ..cfg() + }) + .await; + let r = room(13); + let mut h = host(&t, &r, &secret(13)).await; + let a = Some("203.0.113.5"); + let (mut a1, gid) = join_from(&t, &mut h, &r, a).await; + for i in 0..3 { + send(&mut a1, json!({"t":"signal","to":"host","data":{"i":i}})).await; + assert_eq!(recv(&mut h).await["data"]["i"], i); + } + // One guest's own limit, as before. + send(&mut a1, json!({"t":"signal","to":"host","data":{"i":3}})).await; + expect_fatal(&mut a1, "rate_limited").await; + assert_eq!(recv(&mut h).await, json!({"t":"left","gid":gid})); + // The same client again: what is left of its 5, not 3 more. + let (mut a2, gid) = join_from(&t, &mut h, &r, a).await; + for i in 0..2 { + send(&mut a2, json!({"t":"signal","to":"host","data":{"j":i}})).await; + assert_eq!(recv(&mut h).await["data"]["j"], i); + } + send(&mut a2, json!({"t":"signal","to":"host","data":{"j":2}})).await; + expect_fatal(&mut a2, "rate_limited").await; + assert_eq!(recv(&mut h).await, json!({"t":"left","gid":gid})); + // Used up: it may not even join until the window runs out. + let mut a3 = connect_with(&t, None, a).await; + send(&mut a3, json!({"v":1,"t":"join","room":r})).await; + expect_fatal(&mut a3, "rate_limited").await; + // Another client is not held to it. + let (mut b, gid) = join_from(&t, &mut h, &r, Some("198.51.100.7")).await; + send(&mut b, json!({"t":"signal","to":"host","data":{"b":1}})).await; + assert_eq!( + recv(&mut h).await, + json!({"t":"signal","from":gid,"data":{"b":1}}) + ); } #[tokio::test] diff --git a/engine/crates/ps5upload-pkg/src/kind.rs b/engine/crates/ps5upload-pkg/src/kind.rs index 71c130077..76f1b9a3c 100644 --- a/engine/crates/ps5upload-pkg/src/kind.rs +++ b/engine/crates/ps5upload-pkg/src/kind.rs @@ -218,9 +218,14 @@ pub fn normalize_version(ver: &str) -> String { .join(".") } -/// Orders versions numerically segment by segment; non-numeric segments sort last. +/// Orders versions numerically segment by segment; non-numeric segments sort last. A blank +/// version is no version: it sorts below every real one (it used to sort above them all, so a +/// package that named no version won every "which is newest"). pub fn version_cmp(a: &str, b: &str) -> std::cmp::Ordering { let key = |v: &str| -> Vec<(u8, u64)> { + if v.trim().is_empty() { + return Vec::new(); + } v.split('.') .map(|s| match s.trim().parse::<u64>() { Ok(n) => (0, n), @@ -334,6 +339,23 @@ mod tests { assert_eq!(version_cmp("1.32", "1.32"), std::cmp::Ordering::Equal); } + #[test] + fn a_blank_version_sorts_below_every_real_one() { + use std::cmp::Ordering::{Equal, Greater, Less}; + for real in ["0", "0.0", "1.00", "01.05", "9.99.999", "1.0a"] { + assert_eq!(version_cmp("", real), Less, "blank against {real}"); + assert_eq!(version_cmp(real, " "), Greater, "{real} against blank"); + } + assert_eq!(version_cmp("", " "), Equal); + // The newest of a list is never the one that names no version. + let newest = ["1.02", "", "1.10", " "] + .into_iter() + .max_by(|a, b| version_cmp(a, b)); + assert_eq!(newest, Some("1.10")); + // A segment that is no number still sorts last among real versions. + assert_eq!(version_cmp("1.x", "1.9"), Greater); + } + #[test] fn ids_and_regions_come_from_the_content_id() { assert_eq!( diff --git a/engine/crates/ps5upload-pkg/src/lib.rs b/engine/crates/ps5upload-pkg/src/lib.rs index 348c5287d..cf1b8e0c1 100644 --- a/engine/crates/ps5upload-pkg/src/lib.rs +++ b/engine/crates/ps5upload-pkg/src/lib.rs @@ -142,7 +142,15 @@ pub fn extract_from_ffpkg( let target = dest_dir.join(leaf_name); create_dir_all(&target).map_err(Ufs2Error::Io)?; let mut walked = std::collections::HashSet::from([inode.number]); - extract_dir_recursive(&mut img, &inode, &target, &mut result, 0, &mut walked)?; + extract_dir_recursive( + &mut img, + &inode, + &target, + &mut result, + 0, + &mut walked, + &mut ufs2::WalkBudget::default(), + )?; } else { return Err(Ufs2Error::NotFound { component: format!("{leaf_name} (not a file or directory)"), @@ -199,6 +207,7 @@ fn extract_dir_recursive<R: Read + Seek>( result: &mut FfpkgExtractResult, depth: u32, walked: &mut std::collections::HashSet<u64>, + budget: &mut ufs2::WalkBudget, ) -> Result<(), Ufs2Error> { // Bound recursion against pathological nesting. A directory cycle is refused on its own // (`walked`): an entry naming its own directory or an ancestor is not stopped by the depth @@ -209,7 +218,7 @@ fn extract_dir_recursive<R: Read + Seek>( max: FFPKG_EXTRACT_MAX_DEPTH, }); } - let entries = img.list_dir(dir)?; + let entries = img.list_dir_in_walk(dir, budget)?; for e in entries { if !is_safe_child_name(&e.name) { // Skip but don't fail the whole extract — a hostile @@ -229,7 +238,15 @@ fn extract_dir_recursive<R: Read + Seek>( }); } create_dir_all(&child_path).map_err(Ufs2Error::Io)?; - extract_dir_recursive(img, &child_inode, &child_path, result, depth + 1, walked)?; + extract_dir_recursive( + img, + &child_inode, + &child_path, + result, + depth + 1, + walked, + budget, + )?; } else if child_inode.is_file() { let written = extract_file(img, &child_inode, &child_path)?; result.file_count += 1; @@ -609,6 +626,11 @@ pub struct PkgMetadata { /// Non-fatal warnings raised during parse — surfaced in the UI as /// a yellow caution row. Empty for a clean stock PKG. pub warnings: Vec<String>, + /// The least this package's file (every part of a split set together) has to be for its + /// own header to be true: see [`declared_size_from`]. A file shorter than this is still + /// being copied, or was cut short. `None` when the header declares nothing. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub declared_size: Option<u64>, } #[derive(Debug, Clone, Serialize, Deserialize)] @@ -634,6 +656,72 @@ pub fn parse_pkg(path: &Path) -> Result<PkgMetadata, PkgError> { parse_pkg_from(&mut f, size, path) } +/// `len` bytes at `at`, when the `size`-byte file holds them all. +fn bytes_at<R: Read + Seek>(f: &mut R, size: u64, at: u64, len: usize) -> Option<Vec<u8>> { + if at.checked_add(len as u64)? > size { + return None; + } + f.seek(SeekFrom::Start(at)).ok()?; + let mut buf = vec![0u8; len]; + f.read_exact(&mut buf).ok()?; + Some(buf) +} + +/// The least a package's file has to be for its own header to be true, read from the header +/// alone. `None` when it is not a `\x7FCNT` / `\x7FFIH` package or its header declares nothing. +/// +/// - PS4 (`\x7FCNT`): the end of the container's body (`0x20` + `0x28`), the end of its image +/// (`0x410` + `0x418`) and the package size the header records (`0x430`), whichever is most. +/// A `\x7FCNT` whose content type is a PS5 one is judged by its body alone: what its +/// `0x400` block means outside a finalized image is not measured. +/// - PS5 (`\x7FFIH`): the end of the embedded container (at `0x58`: its header, and its body +/// when the header can be read), and for a debug image the end of the outer image +/// (`0x10` + `0x18`). The install information that follows the container records no length +/// in a header, so a file that lacks only part of that is not seen here. +/// +/// `size` only says which header bytes can be read. The answer is for the whole package: +/// compare it with every part of a split set together, which may be more than `size`. +pub fn declared_size_from<R: Read + Seek>(f: &mut R, size: u64) -> Option<u64> { + let be64 = |b: &[u8], o: usize| u64::from_be_bytes(b[o..o + 8].try_into().unwrap()); + let le64 = |b: &[u8], o: usize| u64::from_le_bytes(b[o..o + 8].try_into().unwrap()); + let head = bytes_at(f, size, 0, 0xA0)?; + let magic = u32::from_be_bytes([head[0], head[1], head[2], head[3]]); + let mut need = 0u64; + // An end that overflows is a header that says nothing usable, not a longer package. + let mut at_least = |end: Option<u64>| need = need.max(end.unwrap_or(0)); + if magic == PKG_MAGIC { + at_least(be64(&head, 0x20).checked_add(be64(&head, 0x28))); + let content_type = u32::from_be_bytes([head[0x74], head[0x75], head[0x76], head[0x77]]); + if kind::content_type_platform(content_type) != Some("PS5") { + if let Some(image) = bytes_at(f, size, 0x400, 0x38) { + if u32::from_be_bytes([image[0], image[1], image[2], image[3]]) >= 1 { + at_least(be64(&image, 0x10).checked_add(be64(&image, 0x18))); + } + at_least(Some(be64(&image, 0x30))); + } + } + } else if magic == PKG_MAGIC_FIH { + let cnt_at = le64(&head, 0x58); + if cnt_at != 0 { + at_least(cnt_at.checked_add(0xA0)); + if let Some(cnt) = bytes_at(f, size, cnt_at, 0xA0) { + if cnt[0..4] == PKG_MAGIC.to_be_bytes() { + at_least( + cnt_at + .checked_add(be64(&cnt, 0x20)) + .and_then(|at| at.checked_add(be64(&cnt, 0x28))), + ); + } + } + } + // 0x00 marks a debug image, whose outer image sits where these two fields say. + if head[0x05] == 0 { + at_least(le64(&head, 0x10).checked_add(le64(&head, 0x18))); + } + } + (need > 0).then_some(need) +} + /// [`parse_pkg`] over any seekable bytes of `size` (a package on a server or the console); /// `path` is only recorded in the result. pub fn parse_pkg_from<R: Read + Seek>( @@ -653,6 +741,7 @@ pub fn parse_pkg_from<R: Read + Seek>( Some(buf) }) .unwrap_or_default(); + let declared_size = declared_size_from(f, size); f.seek(SeekFrom::Start(0))?; let mut head = [0u8; 0xA0]; @@ -678,6 +767,7 @@ pub fn parse_pkg_from<R: Read + Seek>( content_flags: 0, icon_png_base64: None, warnings: Vec::new(), + declared_size, }; let (container_base, container_head) = if magic == PKG_MAGIC_FIH { @@ -2006,6 +2096,7 @@ mod tests { content_flags: 0, icon_png_base64: None, warnings: Vec::new(), + declared_size: None, }; parse_sfo_into(&sfo, &mut meta).expect("SFO should parse"); assert_eq!(meta.app_ver, "01.04"); @@ -2031,6 +2122,7 @@ mod tests { content_flags: 0, icon_png_base64: None, warnings: Vec::new(), + declared_size: None, }; let mut json = br#"{"contentId":"UP0000-PPSA01234_00-TESTGAME00000000","titleId":"PPSA01234","contentVersion":"01.002.000","localizedParameters":{"defaultLanguage":"en-US","en-US":{"titleName":"Test Game"}}}"#.to_vec(); json.extend_from_slice(&[0, 0]); @@ -2158,6 +2250,93 @@ mod tests { assert_eq!(b64_encode(b"foobar"), "Zm9vYmFy"); } + /// A PS4 package header of `total` declared bytes: a body after the header, then an image. + fn ps4_declaring(total: u64) -> Vec<u8> { + let mut pkg = build_pkg_multi( + "UP0000-CUSA01234_00-TESTGAME00000000", + &[("CATEGORY", "gd")], + ); + pkg.resize(0x2000, 0); + pkg[0x74..0x78].copy_from_slice(&0x1Au32.to_be_bytes()); + pkg[0x20..0x28].copy_from_slice(&0x1000u64.to_be_bytes()); + pkg[0x28..0x30].copy_from_slice(&0x1000u64.to_be_bytes()); + pkg[0x400..0x404].copy_from_slice(&1u32.to_be_bytes()); + pkg[0x410..0x418].copy_from_slice(&0x2000u64.to_be_bytes()); + pkg[0x418..0x420].copy_from_slice(&(total - 0x2000).to_be_bytes()); + pkg[0x430..0x438].copy_from_slice(&total.to_be_bytes()); + pkg + } + + #[test] + fn a_ps4_package_says_how_long_it_has_to_be() { + let whole = 0x9000u64; + let mut pkg = ps4_declaring(whole); + let declared = + |bytes: &[u8]| declared_size_from(&mut std::io::Cursor::new(bytes), bytes.len() as u64); + // Still being copied: the header is there, most of the image is not. + assert_eq!(declared(&pkg), Some(whole)); + let meta = parse_pkg_from( + &mut std::io::Cursor::new(&pkg), + pkg.len() as u64, + Path::new("a.pkg"), + ) + .unwrap(); + assert_eq!(meta.declared_size, Some(whole)); + assert!(meta.size < whole); + assert_eq!(meta.content_id, "UP0000-CUSA01234_00-TESTGAME00000000"); + // The whole file says the same, and is that long. + pkg.resize(whole as usize, 0); + assert_eq!(declared(&pkg), Some(whole)); + + // The package size field left empty: the image's end still says it. + let mut no_total = ps4_declaring(whole); + no_total[0x430..0x438].fill(0); + assert_eq!(declared(&no_total), Some(whole)); + // No image either: the body's end. + no_total[0x400..0x420].fill(0); + assert_eq!(declared(&no_total), Some(0x2000)); + // Cut inside the header: only the fields that are there count. + assert_eq!(declared(&no_total[..0x200]), Some(0x2000)); + // Sizes that overflow say nothing, they do not make the package endless. + let mut wild = ps4_declaring(whole); + wild[0x410..0x418].copy_from_slice(&u64::MAX.to_be_bytes()); + assert_eq!(declared(&wild), Some(whole)); + // A header that declares nothing, and a file that is no package. + let plain = build_pkg_multi("UP0000-CUSA01234_00-TESTGAME00000000", &[]); + assert_eq!(declared(&plain), None); + assert_eq!(declared(&[0u8; 0x1000]), None); + assert_eq!(declared(&[0x7F, b'C', b'N', b'T']), None); + } + + #[test] + fn a_ps5_package_says_how_long_it_has_to_be() { + let block = 0x10000usize; + let mut cnt = build_pkg_multi("UP0000-PPSA01234_00-TESTGAME00000000", &[]); + cnt.resize(0x3000, 0); + cnt[0x20..0x28].copy_from_slice(&0x2000u64.to_be_bytes()); + cnt[0x28..0x30].copy_from_slice(&0x1000u64.to_be_bytes()); + // Header block, three blocks of image, then the container. + let cnt_at = 4 * block; + let mut pkg = vec![0u8; cnt_at]; + pkg[0..4].copy_from_slice(&PKG_MAGIC_FIH.to_be_bytes()); + pkg[0x06..0x08].copy_from_slice(&3u16.to_le_bytes()); + pkg[0x10..0x18].copy_from_slice(&(block as u64).to_le_bytes()); + pkg[0x18..0x20].copy_from_slice(&(3 * block as u64).to_le_bytes()); + pkg[0x58..0x60].copy_from_slice(&(cnt_at as u64).to_le_bytes()); + pkg.extend_from_slice(&cnt); + let whole = (cnt_at + 0x3000) as u64; + let declared = + |bytes: &[u8]| declared_size_from(&mut std::io::Cursor::new(bytes), bytes.len() as u64); + assert_eq!(declared(&pkg), Some(whole)); + // Cut inside the image: the container can't be read, but its place is known. + assert_eq!(declared(&pkg[..2 * block]), Some(cnt_at as u64 + 0xA0)); + // A retail image (0x80) is judged by its container only. + let mut retail = pkg.clone(); + retail[0x05] = 0x80; + retail[0x18..0x20].copy_from_slice(&u64::MAX.to_le_bytes()); + assert_eq!(declared(&retail), Some(whole)); + } + #[test] fn truncated_file_errors_cleanly() { let dir = tempdir(); @@ -2459,8 +2638,16 @@ mod tests { sample_paths: Vec::new(), }; let mut walked = std::collections::HashSet::from([root.number]); - let e = extract_dir_recursive(&mut img, &root, &dest, &mut result, 0, &mut walked) - .unwrap_err(); + let e = extract_dir_recursive( + &mut img, + &root, + &dest, + &mut result, + 0, + &mut walked, + &mut ufs2::WalkBudget::default(), + ) + .unwrap_err(); assert!( matches!(e, Ufs2Error::DirectoryCycle { inode: 2 }), "{names:?}: {e}" diff --git a/engine/crates/ps5upload-pkg/src/ufs2.rs b/engine/crates/ps5upload-pkg/src/ufs2.rs index 60323af07..a01cf8fee 100644 --- a/engine/crates/ps5upload-pkg/src/ufs2.rs +++ b/engine/crates/ps5upload-pkg/src/ufs2.rs @@ -58,6 +58,37 @@ pub const ROOT_INODE: u64 = 2; // ponytail: 64 MiB per directory read whole (~250,000 maximal names), stream the entries block by block if a real image ever needs more pub const MAX_DIR_BYTES: u64 = 64 * 1024 * 1024; +/// The most directory bytes one walk of an image reads in all, as the PFS reader bounds its +/// walk. Each directory may hold [`MAX_DIR_BYTES`] and a walk may list a million entries, so a +/// crafted image of directories that claim the most and share their blocks would otherwise have +/// a walk read terabytes. A real game's directories are a few MiB together. +pub const MAX_WALK_DIR_BYTES: u64 = 2 << 30; + +/// What one walk of an image has read of its directories, against [`MAX_WALK_DIR_BYTES`]: give +/// each walk its own and list through [`Ufs2Image::list_dir_in_walk`]. +#[derive(Debug)] +pub struct WalkBudget { + dir_bytes: u64, + max: u64, +} + +impl Default for WalkBudget { + fn default() -> Self { + Self { + dir_bytes: 0, + max: MAX_WALK_DIR_BYTES, + } + } +} + +impl WalkBudget { + /// A budget of `max` bytes, for a test that cannot make gigabytes of directories. + #[doc(hidden)] + pub fn with_max(max: u64) -> Self { + Self { dir_bytes: 0, max } + } +} + /// The most entries [`Ufs2Image::list_dir`] returns for one directory. The byte budget alone /// would allow five million twelve-byte records, each a [`DirEntry`] on the heap. pub const MAX_DIR_ENTRIES: usize = 1_000_000; @@ -118,6 +149,8 @@ pub enum Ufs2Error { InodeRunTooLong { count: u64, max: u64 }, #[error("directory inode {inode} has more than {max} entries")] TooManyEntries { inode: u64, max: usize }, + #[error("the image's directories add up to more than {max} bytes: the image is damaged")] + WalkTooLarge { max: u64 }, #[error("directory inode {inode} holds a name that {why} (bytes {hex})")] BadName { inode: u64, @@ -474,6 +507,22 @@ fn parse_inode(n: u64, buf: &[u8]) -> Inode { } impl<R: Read + Seek> Ufs2Image<R> { + /// [`Ufs2Image::list_dir`] as one step of a walk: the directory's bytes are charged to + /// `budget` before they are read, and a walk past it is refused. + pub fn list_dir_in_walk( + &mut self, + dir: &Inode, + budget: &mut WalkBudget, + ) -> Result<Vec<DirEntry>, Ufs2Error> { + if dir.is_dir() { + budget.dir_bytes = budget.dir_bytes.saturating_add(dir.size); + if budget.dir_bytes > budget.max { + return Err(Ufs2Error::WalkTooLarge { max: budget.max }); + } + } + self.list_dir(dir) + } + /// List entries in a directory inode. pub fn list_dir(&mut self, dir: &Inode) -> Result<Vec<DirEntry>, Ufs2Error> { if !dir.is_dir() { @@ -1276,6 +1325,27 @@ mod tests { )); } + /// A walk charges every directory it lists: once their bytes add up to more than its budget + /// the next listing is refused, before that directory is read. + #[test] + fn a_walk_past_its_directory_budget_is_refused() { + let (mut img, dir) = big_dir(40, 8); + let mut walk = WalkBudget::with_max(3 * dir.size); + for _ in 0..3 { + assert_eq!(img.list_dir_in_walk(&dir, &mut walk).unwrap().len(), 40); + } + assert!(matches!( + img.list_dir_in_walk(&dir, &mut walk), + Err(Ufs2Error::WalkTooLarge { .. }) + )); + // A real walk's budget is far above any real image's directories. + assert!(WalkBudget::default().max >= 1 << 30); + // A file is no directory, and costs nothing. + let mut file = dir.clone(); + file.mode = 0o100644; + assert!(img.list_dir_in_walk(&file, &mut walk).unwrap().is_empty()); + } + /// A directory inode claiming more than the budget is refused before anything is read. #[test] fn a_directory_over_the_budget_is_refused() { diff --git a/payload/include/config.h b/payload/include/config.h index 0d57967c3..d269e4cbb 100644 --- a/payload/include/config.h +++ b/payload/include/config.h @@ -5,7 +5,7 @@ * UI tell apart an old payload still running from a build that includes * a particular fix, without having to boot the console. Keep in sync * with the desktop app's package.json during releases. */ -#define PS5UPLOAD2_VERSION "12.6.30" +#define PS5UPLOAD2_VERSION "12.6.31" /* Author credit — embedded in the startup toast so anyone looking at * the console screen knows who wrote the software that just loaded. * Kept separate from VERSION so release scripts can bump the version diff --git a/payload/include/mesh.h b/payload/include/mesh.h index 5160a98c0..dd23df721 100644 --- a/payload/include/mesh.h +++ b/payload/include/mesh.h @@ -75,8 +75,8 @@ enum { MESH_LOCK = 4, /* {op:take|release,name,ttl,force,label} -> {ok,got,...} */ MESH_DEVICE = 5, /* {op:rename|remove|block|unblock|allow|decline,id,name} -> {ok} */ MESH_SETTINGS = 6, /* {require_approval?,prune_days?} -> settings */ - MESH_DOC_GET = 7, /* {name} -> {rev,doc} */ - MESH_DOC_PUT = 8, /* {name,base,doc} -> {ok,saved,rev[,doc]} */ + MESH_DOC_GET = 7, /* {name} -> {rev,doc} (doc null: never written; err doc_unreadable: unknown) */ + MESH_DOC_PUT = 8, /* {name,base,doc} -> {ok,saved,rev[,doc]} (never over a doc_unreadable one) */ MESH_ANNOUNCE = 9, /* {kind,text} -> {ok,rev} */ }; diff --git a/payload/include/utf8_cut.h b/payload/include/utf8_cut.h new file mode 100644 index 000000000..e33aed1d4 --- /dev/null +++ b/payload/include/utf8_cut.h @@ -0,0 +1,37 @@ +#ifndef PS5UPLOAD_UTF8_CUT_H +#define PS5UPLOAD_UTF8_CUT_H + +/* Cutting UTF-8 text short on a character boundary. A byte cut puts half a character (a + * Japanese or accented file name) at the edge of what is kept, and the engine reads such text + * as invalid: a status line ended in garbage, or was not shown at all. Header-only, so the host + * self-test (tests/utf8_cut_selftest.c) runs the same code. */ +#include <stddef.h> + +/* 1 for a UTF-8 continuation byte (10xxxxxx). */ +static inline int utf8_is_cont(unsigned char c) { return (c & 0xC0) == 0x80; } + +/* Where the last at most `keep` bytes of `s` (`len` bytes) start, moved forward past the + * continuation bytes of a character the cut would split, so the tail starts on a whole + * character. `len` when nothing is kept. */ +static inline size_t utf8_tail_start(const char *s, size_t len, size_t keep) { + size_t i = len > keep ? len - keep : 0; + while (i < len && utf8_is_cont((unsigned char)s[i])) i++; + return i; +} + +/* The length of `s` (`len` bytes) without a last character that is cut short: a lead byte + * whose continuation bytes did not all make it. Text that is whole, or not UTF-8 to begin + * with, keeps its length. */ +static inline size_t utf8_whole_prefix(const char *s, size_t len) { + size_t i = len, have, need; + unsigned char lead; + while (i > 0 && len - i < 3 && utf8_is_cont((unsigned char)s[i - 1])) i--; + if (i == 0) return len; + lead = (unsigned char)s[i - 1]; + if (lead < 0xC0) return len; /* ASCII last, or a stray continuation byte: nothing cut here */ + need = lead >= 0xF0 ? 4 : lead >= 0xE0 ? 3 : 2; + have = len - (i - 1); + return have < need ? i - 1 : len; +} + +#endif diff --git a/payload/src/fs_jobs.c b/payload/src/fs_jobs.c index 1c7da8660..9630eace3 100644 --- a/payload/src/fs_jobs.c +++ b/payload/src/fs_jobs.c @@ -16,6 +16,7 @@ #include "ava1_op.h" #include "blake3.h" #include "path_policy.h" +#include "utf8_cut.h" #define MAX_DEPTH 64 @@ -569,6 +570,8 @@ static void fail_note(void *arg, const char *path, const char *what) { int e = errno; /* the walkers report right after the failing call */ if (f->n++ == 0) { snprintf(f->first, sizeof f->first, "%s", path); + /* A path longer than the buffer is cut on a character, never inside one. */ + f->first[utf8_whole_prefix(f->first, strlen(f->first))] = '\0'; snprintf(f->what, sizeof f->what, "%s", what); /* "mount", "path too long", "too deep" are the walker's own refusals, not an errno. */ f->err = (strcmp(what, "mount") == 0 || strcmp(what, "path too long") == 0 || strcmp(what, "too deep") == 0) @@ -578,7 +581,8 @@ static void fail_note(void *arg, const char *path, const char *what) { } /* The cause of a partly failed walk: `<token>: <what> <first path>: <errno text> (<n> left)`, cut - * to the status line, keeping the END of a long path (the part that tells folders apart). A path + * to the status line, keeping the END of a long path (the part that tells folders apart), from a + * whole character on (a byte cut put half of one first: text that is not UTF-8). A path * under `base` (the parent of the folder the job works on) is shown from that folder down. */ static void fail_message(const fail_t *f, const char *token, const char *unit) { char shown[110]; @@ -587,9 +591,9 @@ static void fail_message(const fail_t *f, const char *token, const char *unit) { if (bl > 1 && strncmp(p, f->base, bl) == 0 && p[bl] == '/' && p[bl + 1]) p += bl + 1; l = strlen(p); if (l > keep) { + size_t from = utf8_tail_start(p, l, keep - 3); memcpy(shown, "...", 3); - memcpy(shown + 3, p + l - (keep - 3), keep - 3); - shown[keep] = '\0'; + memcpy(shown + 3, p + from, l - from + 1); } else { memcpy(shown, p, l + 1); } diff --git a/payload/src/hw_info.c b/payload/src/hw_info.c index 1066b0bd3..0061b7b6a 100644 --- a/payload/src/hw_info.c +++ b/payload/src/hw_info.c @@ -1117,31 +1117,20 @@ int hw_power_get_text(char *out, size_t out_cap, size_t *out_written, return 0; } -/* ── HW_STORAGE: "Console Storage" aggregate ───────────────────── +/* ── HW_STORAGE: the internal drive as its filesystem counts it ── * - * Approximates PS5 Settings → Storage → Console Storage: * Total = /user total + /system_data total + /system_ex total * Free = /user bavail + /system_data bavail + /system_ex bavail * Used = Total - Free * - * `bavail` is what the kernel reports as "available to non-root" - * users; `bfree` is the raw free count. The difference is the - * "reserved" pool the filesystem keeps so root can still write - * even when bavail hits zero. + * `bavail` is what the kernel offers a writer; `bfree` is the raw free count. The difference + * (reported as reserved) is space the filesystem holds back: it is part of `used`, and is never + * taken off `free` a second time. * - * Reserve model — confirmed against a live PS5 (FS_LIST_VOLUMES + - * HW_STORAGE on a 2 TB Pro): Settings COUNTS THE UFS RESERVE AS USED, - * it does not shave it off the headline total. For that console the - * raw /user partition is f_blocks×f_bsize ≈ 1.96 TB with a ~292 GB - * (15%) reserve; Settings shows Size ≈ 1.89 TB / Used ≈ 1.72 TB. So - * total must be the FULL partition (not total-reserved) and `used` = - * total-bavail folds the reserve into used, matching Settings to a - * few GB. An earlier build subtracted reserved from total; that made - * the headline ~292 GB too small and made `used` disagree with - * Settings by the whole reserve, which is what this corrects. A small - * residual (~70 GB) remains because Settings also hides a fixed system - * reserve that statfs can't see — that gap needs a Sony content- - * manager API to close and is out of scope here. + * These are statfs counters and nothing else. They are NOT the figures of the PS5's own + * Settings > Storage screen (#944): on a 2 TB Pro this reported /user 1.995 TB with 175.5 GB + * free while that screen showed 71.35 GB free of 1.89 TB. How Sony counts is not known here. + * An earlier note in this place said the two matched to a few GB; they do not. * * Each statfs failure is non-fatal — the missing partition just * contributes zero. /system_ex may not be mounted on some firmware @@ -1175,10 +1164,10 @@ int hw_storage_get_text(char *out, size_t out_cap, size_t *out_written, uint64_t u_total = 0, u_bfree = 0, u_bavail = 0; storage_read_part("/user", &u_total, &u_bfree, &u_bavail); - /* Reserved = bfree - bavail (the slice the FS keeps for root). Kept - * for the reserved_bytes telemetry fields below; it is NOT shaved - * off total — Settings counts it as used, so we let used_bytes = - * total - bavail absorb it (see the header comment). */ + /* Reserved = bfree - bavail (what the filesystem holds back). Kept + * for the reserved_bytes fields below; it is NOT shaved off total: + * used_bytes = total - bavail already counts it as used (see the + * header comment). */ uint64_t u_reserved = (u_bfree > u_bavail) ? (u_bfree - u_bavail) : 0; uint64_t sd_total = 0, sd_bfree = 0, sd_bavail = 0; diff --git a/payload/src/mesh.c b/payload/src/mesh.c index abc8e10fd..ebcb6aca9 100644 --- a/payload/src/mesh.c +++ b/payload/src/mesh.c @@ -231,18 +231,82 @@ static void skip_ws(const char *s, size_t n, size_t *i) { while (*i < n && (s[*i] == ' ' || s[*i] == '\t' || s[*i] == '\n' || s[*i] == '\r')) (*i)++; } +/* Four hex digits at s[i]: their value in *v. */ +static int hex4(const char *s, size_t n, size_t i, unsigned *v) { + unsigned k, x = 0; + if (i > n || n - i < 4) return -1; + for (k = 0; k < 4; k++) { + int h = hexval((unsigned char)s[i + k]); + if (h < 0) return -1; + x = x << 4 | (unsigned)h; + } + *v = x; + return 0; +} + +/* One UTF-8 character whose first byte (0x80 or more) is s[*i]: well formed, in its shortest form, + * no surrogate and at most U+10FFFF (what every JSON reader takes). */ +static int skip_utf8(const char *s, size_t n, size_t *i) { + unsigned c = (unsigned char)s[*i], need, cp, k; + if (c >= 0xC2 && c <= 0xDF) { + need = 1; + cp = c & 0x1Fu; + } else if (c >= 0xE0 && c <= 0xEF) { + need = 2; + cp = c & 0x0Fu; + } else if (c >= 0xF0 && c <= 0xF4) { + need = 3; + cp = c & 0x07u; + } else + return -1; + if (n - *i <= need) return -1; + for (k = 1; k <= need; k++) { + unsigned b = (unsigned char)s[*i + k]; + if ((b & 0xC0u) != 0x80u) return -1; + cp = cp << 6 | (b & 0x3Fu); + } + if ((need == 2 && cp < 0x800u) || (need == 3 && (cp < 0x10000u || cp > 0x10FFFFu)) || + (cp >= 0xD800u && cp <= 0xDFFFu)) + return -1; + *i += need + 1; + return 0; +} + +/* A string as JSON has it: only its escapes (a \u escape of a surrogate in a whole pair), no control + * byte, and valid UTF-8. Anything looser was stored, and then no engine could read the document. */ static int skip_string(const char *s, size_t n, size_t *i) { if (*i >= n || s[*i] != '"') return -1; - for ((*i)++; *i < n; (*i)++) { - if (s[*i] == '\\') { + (*i)++; + while (*i < n) { + unsigned char c = (unsigned char)s[*i]; + unsigned u, lo; + if (c == '"') { (*i)++; + return 0; + } + if (c < 0x20) return -1; + if (c >= 0x80) { + if (skip_utf8(s, n, i) != 0) return -1; continue; } - if (s[*i] == '"') { + if (c != '\\') { (*i)++; - return 0; + continue; + } + if (++(*i) >= n) return -1; + if (s[*i] && strchr("\"\\/bfnrt", s[*i])) { + (*i)++; + continue; + } + if (s[*i] != 'u' || hex4(s, n, *i + 1, &u) != 0) return -1; + *i += 5; + if (u >= 0xDC00u && u <= 0xDFFFu) return -1; /* the second half of a pair, alone */ + if (u >= 0xD800u && u <= 0xDBFFu) { /* the first half: the second must follow */ + if (n - *i < 6 || s[*i] != '\\' || s[*i + 1] != 'u' || hex4(s, n, *i + 2, &lo) != 0 || lo < 0xDC00u || + lo > 0xDFFFu) + return -1; + *i += 6; } - if ((unsigned char)s[*i] < 0x20) return -1; } return -1; } @@ -302,7 +366,9 @@ static int skip_value_d(const char *s, size_t n, size_t *i, int depth) { } default: if (s[*i] == '-') (*i)++; - if (digits(s, n, i) != 0) return -1; + /* A leading 0 stands alone ("01" is no JSON number: every engine refused the document). */ + if (*i < n && s[*i] == '0') (*i)++; + else if (digits(s, n, i) != 0) return -1; if (*i < n && s[*i] == '.') { (*i)++; if (digits(s, n, i) != 0) return -1; @@ -748,17 +814,22 @@ static void put_settings(buf_t *b) { static int do_hello(const uint8_t caller[32], const char *body, size_t n, char *out, size_t cap, const mesh_online_t *on, int non) { - char name[NAME_MAX_], kind[KIND_MAX], os[OS_MAX], app[APP_MAX], hex[65], tmp[NAME_MAX_]; + char name[NAME_MAX_], kind[KIND_MAX], os[OS_MAX], app[APP_MAX], hex[65], *tmp; uint8_t ev[32]; int evicted = 0, isnew = 0, i; uint32_t ip = 0; dev_t_ *d; buf_t b = { out, 0, cap, 0 }; name[0] = kind[0] = os[0] = app[0] = 0; - if (webui_json_str(body, n, "name", tmp, sizeof tmp) == 1) clean_field(name, sizeof name, tmp); - if (webui_json_str(body, n, "kind", tmp, sizeof tmp) == 1) clean_field(kind, sizeof kind, tmp); - if (webui_json_str(body, n, "os", tmp, sizeof tmp) == 1) clean_field(os, sizeof os, tmp); - if (webui_json_str(body, n, "app", tmp, sizeof tmp) == 1) clean_field(app, sizeof app, tmp); + /* Each read whole (a string never decodes longer than the body that holds it), then cut to its + * field on a character boundary, as the engine cuts it. A name of 64 bytes or more did not fit + * the buffer and was dropped: the console went on showing the old one. */ + if (!(tmp = malloc(n + 1))) return fail(out, cap, "out_of_memory"); + if (webui_json_str(body, n, "name", tmp, n + 1) == 1) clean_field(name, sizeof name, tmp); + if (webui_json_str(body, n, "kind", tmp, n + 1) == 1) clean_field(kind, sizeof kind, tmp); + if (webui_json_str(body, n, "os", tmp, n + 1) == 1) clean_field(os, sizeof os, tmp); + if (webui_json_str(body, n, "app", tmp, n + 1) == 1) clean_field(app, sizeof app, tmp); + free(tmp); for (i = 0; i < non; i++) if (memcmp(on[i].key, caller, 32) == 0) ip = on[i].ip; pthread_mutex_lock(&g_mu); @@ -1062,7 +1133,7 @@ static int do_lock(const uint8_t caller[32], const char *body, size_t n, char *o } static int do_device(const uint8_t caller[32], const char *body, size_t n, char *out, size_t cap) { - char op[16], id[80], name[NAME_MAX_ * 2]; + char op[16], id[80]; uint8_t key[32]; int forget = 0, r; dev_t_ *d, *me; @@ -1108,11 +1179,20 @@ static int do_device(const uint8_t caller[32], const char *body, size_t n, char return fail(out, cap, "not_found"); } if (!strcmp(op, "rename")) { - if (webui_json_str(body, n, "name", name, sizeof name) != 1) { + /* Read whole and cut as a hello's name is (one of 128 bytes or more was refused). */ + char *name = malloc(n + 1); + int got; + if (!name) { + pthread_mutex_unlock(&g_mu); + return fail(out, cap, "out_of_memory"); + } + got = webui_json_str(body, n, "name", name, n + 1); + if (got == 1) clean_field(d->nick, sizeof d->nick, name); + free(name); + if (got != 1) { pthread_mutex_unlock(&g_mu); return fail(out, cap, "bad_request"); } - clean_field(d->nick, sizeof d->nick, name); } else if (!strcmp(op, "remove")) { add_event("removed", caller, "%s removed %s", me ? shown_name(me) : "A device", shown_name(d)); d->used = 0; @@ -1184,25 +1264,45 @@ static int doc_name_ok(const char *s) { return 1; } -/* A document file: "<rev>\n<json>". Under g_mu. *rev 0 and NULL when there is none. */ -static char *doc_load(const char *name, uint64_t *rev, size_t *len) { +/* A document file: "<rev>\n<json>". Under g_mu. 1: read (*doc, *len, *rev); 0: there is none (never + * written; *rev 0); -1: it is there but could not be read (an I/O error, no memory, too large, not + * a document). A file that could not be read is never answered as none: every engine then took the + * console for one without drives (forgetting every folder it keeps there), and the next write, on + * revision 0, replaced what was in it. */ +static int doc_load(const char *name, uint64_t *rev, char **doc, size_t *len) { char path[512], file[64], *p, *nl; - size_t n; + size_t n, max = MESH_DOC_MAX + 32; + FILE *f; + int bad; *rev = 0; *len = 0; + *doc = NULL; snprintf(file, sizeof file, "doc-%s", name); path_of(path, sizeof path, file); - if (!(p = read_all(path, MESH_DOC_MAX + 32, &n))) return NULL; + if (!(f = fopen(path, "rb"))) return errno == ENOENT ? 0 : -1; + if (!(p = malloc(max + 1))) { + fclose(f); + return -1; + } + n = fread(p, 1, max + 1, f); + bad = ferror(f) || n > max; + fclose(f); + if (bad) { + free(p); + return -1; + } + p[n] = 0; nl = memchr(p, '\n', n); if (!nl || !is_one(nl + 1, n - (size_t)(nl + 1 - p), '{')) { free(p); - return NULL; + return -1; } *rev = strtoull(p, NULL, 10); *len = n - (size_t)(nl + 1 - p); memmove(p, nl + 1, *len); p[*len] = 0; - return p; + *doc = p; + return 1; } static int doc_count(void) { @@ -1223,11 +1323,14 @@ static int do_doc_get(const char *body, size_t n, char *out, size_t cap) { uint64_t rev; size_t len; char *doc; + int got; buf_t b = { out, 0, cap, 0 }; if (webui_json_str(body, n, "name", name, sizeof name) != 1 || !doc_name_ok(name)) return fail(out, cap, "bad_request"); pthread_mutex_lock(&g_mu); - doc = doc_load(name, &rev, &len); + got = doc_load(name, &rev, &doc, &len); pthread_mutex_unlock(&g_mu); + /* Not "none": what is in it is unknown, and a caller keeps what it has. */ + if (got < 0) return fail(out, cap, "doc_unreadable"); putf(&b, "{\"ok\":true,\"rev\":%llu,\"doc\":", (unsigned long long)rev); if (doc) put(&b, doc, len); else puts_(&b, "null"); @@ -1242,14 +1345,24 @@ static int do_doc_put(const char *body, size_t n, char *out, size_t cap) { const char *v; size_t vl, len; char *cur, *text; - int saved = 0; + int saved = 0, found; buf_t b = { out, 0, cap, 0 }; if (webui_json_str(body, n, "name", name, sizeof name) != 1 || !doc_name_ok(name) || - webui_json_u64(body, n, "base", &base) != 1 || top_value(body, n, "doc", &v, &vl) != 1 || !is_one(v, vl, '{')) + webui_json_u64(body, n, "base", &base) != 1) return fail(out, cap, "bad_request"); + /* Stored only when it is JSON every reader takes: one that is not was kept, and from then on + * every engine failed to read the whole answer, on every read. */ + found = top_value(body, n, "doc", &v, &vl); + if (found < 0) return fail(out, cap, "invalid_json"); + if (found == 0 || *v != '{') return fail(out, cap, "bad_request"); /* a document is an object */ + if (!is_one(v, vl, '{')) return fail(out, cap, "invalid_json"); if (vl > MESH_DOC_MAX) return fail(out, cap, "too_large"); pthread_mutex_lock(&g_mu); - cur = doc_load(name, &rev, &len); + /* Never written over what could not be read: it may hold every drive. */ + if (doc_load(name, &rev, &cur, &len) < 0) { + pthread_mutex_unlock(&g_mu); + return fail(out, cap, "doc_unreadable"); + } if (base == rev) { if (!cur && doc_count() >= MESH_DOCS_MAX) { pthread_mutex_unlock(&g_mu); diff --git a/payload/src/runtime.c b/payload/src/runtime.c index 338133e32..2ab653544 100644 --- a/payload/src/runtime.c +++ b/payload/src/runtime.c @@ -2052,11 +2052,11 @@ static int handle_fs_list_volumes(runtime_state_t *state) { avail > safety_reserve ? avail - safety_reserve : 0; /* Reserve model: total is the FULL partition (f_blocks×f_bsize) and * the UFS root reserve (bfree-bavail) is left to fall into `used` - * (used = total - avail). This matches the PS5 Settings → Storage - * screen, which was confirmed against a live console to count the - * reserve as used rather than shaving it off the headline total. + * (used = total - avail). These are the filesystem's counters, not + * the PS5 Settings → Storage figures, which can show a smaller drive + * and much less free space (#944). * (An earlier build published total = raw - reserve here, which on a - * 2 TB Pro understated the /data total by ~292 GB / 15% vs Settings.) + * 2 TB Pro understated the /data total by ~292 GB / 15%.) * bfs/exfat report bavail≈bfree so their reserve is ~0 and this is a * no-op for USB/M.2 drives. */ int writable = (mnts[i].f_flags & MNT_RDONLY) ? 0 : 1; diff --git a/payload/tests/mesh_selftest.c b/payload/tests/mesh_selftest.c index cc7e21a07..ea7ff29d5 100644 --- a/payload/tests/mesh_selftest.c +++ b/payload/tests/mesh_selftest.c @@ -6,6 +6,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <sys/stat.h> #include <unistd.h> #include "mesh.h" @@ -260,6 +261,51 @@ static void test_hello_and_state(void) { CHECK(has(call(MESH_STATE, 1, "{}"), "\"nick\":\"My phone\"")); } +/* `"name":"<n times s>"` into out. */ +static void name_of(char *out, size_t cap, const char *key, const char *s, int times) { + size_t o = (size_t)snprintf(out, cap, "\"%s\":\"", key); + while (times-- > 0 && o + strlen(s) + 3 < cap) o += (size_t)snprintf(out + o, cap - o, "%s", s); + snprintf(out + o, cap - o, "\""); +} + +/* A long name is cut to 63 bytes on a character boundary, as the engine cuts it (its test + * a_device_name_is_cut_as_the_console_cuts_it checks the same names): it was dropped whole, and the + * console went on showing the old one. */ +static void test_long_names(void) { + char body[1200], want[400]; + const char *r; + start(); + online(1, 0x0100a8c0u); + call(MESH_HELLO, 1, "{\"name\":\"Old name\"}"); + /* 35 two-byte letters: 31 fit. */ + name_of(want, sizeof want, "name", "\xc3\xa9", 35); + snprintf(body, sizeof body, "{%s}", want); + CHECK(has(call(MESH_HELLO, 1, body), "\"ok\":true")); + r = call(MESH_STATE, 1, "{}"); + name_of(want, sizeof want, "name", "\xc3\xa9", 31); + CHECK(has(r, want) && !has(r, "\"name\":\"Old name\"")); + /* Plain letters: 63 of 300. */ + name_of(want, sizeof want, "name", "x", 300); + snprintf(body, sizeof body, "{%s,\"kind\":\"desktop\"}", want); + call(MESH_HELLO, 1, body); + name_of(want, sizeof want, "name", "x", 63); + r = call(MESH_STATE, 1, "{}"); + CHECK(has(r, want) && has(r, "\"kind\":\"desktop\"")); + /* A four-byte character over the edge goes whole. */ + name_of(want, sizeof want, "name", "a", 61); + snprintf(body, sizeof body, "{%.*s\xf0\x9f\x98\x80\"}", (int)strlen(want) - 1, want); + call(MESH_HELLO, 1, body); + CHECK(has(call(MESH_STATE, 1, "{}"), want)); + /* A nickname too. */ + name_of(want, sizeof want, "name", "\xc3\xbc", 100); + snprintf(body, sizeof body, + "{\"op\":\"rename\",\"id\":\"01000000000000000000000000000000000000000000000000000000000000ab\",%s}", + want); + CHECK(has(call(MESH_DEVICE, 1, body), "\"ok\":true")); + name_of(want, sizeof want, "nick", "\xc3\xbc", 31); + CHECK(has(call(MESH_STATE, 1, "{}"), want)); +} + static void test_locks(void) { const char *r; start(); @@ -319,12 +365,101 @@ static void test_docs(void) { CHECK(has(r, "\"saved\":false") && has(r, "\"rev\":1") && has(r, "\"a\":{\"v\":\"1\"")); CHECK(has(call(MESH_DOC_PUT, 2, "{\"name\":\"../x\",\"base\":0,\"doc\":{}}"), "bad_request")); CHECK(has(call(MESH_DOC_PUT, 2, "{\"name\":\"user\",\"base\":1,\"doc\":[1]}"), "bad_request")); - CHECK(has(call(MESH_DOC_PUT, 2, "{\"name\":\"user\",\"base\":1,\"doc\":{\"a\":}}"), "bad_request")); + CHECK(has(call(MESH_DOC_PUT, 2, "{\"name\":\"user\",\"base\":1,\"doc\":{\"a\":}}"), "invalid_json")); /* Survives a restart. */ reload(); CHECK(has(call(MESH_DOC_GET, 1, "{\"name\":\"user\"}"), "\"rev\":1")); } +/* The bytes of v1/doc-<name>, or "" (a static buffer). */ +static const char *doc_file(const char *name) { + static char text[4096]; + char path[512]; + size_t n = 0; + FILE *f; + snprintf(path, sizeof path, "%s/v1/doc-%s", g_dir, name); + text[0] = 0; + if ((f = fopen(path, "rb"))) { + n = fread(text, 1, sizeof text - 1, f); + fclose(f); + } + text[n] = 0; + return text; +} + +/* A document that is there but cannot be read is never answered as one never written (every + * engine then forgot the drives on this console), and never written over. */ +static void test_doc_unreadable(void) { + char path[512]; + const char *r; + FILE *f; + start(); + CHECK(has(call(MESH_DOC_PUT, 1, "{\"name\":\"drives\",\"base\":0,\"doc\":{\"drives\":[{\"id\":\"a\"}]}}"), + "\"saved\":true")); + snprintf(path, sizeof path, "%s/v1/doc-drives", g_dir); + /* It cannot be opened (when run as root, anything can: then this part proves nothing). */ + CHECK(chmod(path, 0) == 0); + if (access(path, R_OK) != 0) { + r = call(MESH_DOC_GET, 1, "{\"name\":\"drives\"}"); + CHECK(has(r, "\"ok\":false") && has(r, "\"err\":\"doc_unreadable\"") && !has(r, "\"doc\"")); + r = call(MESH_DOC_PUT, 1, "{\"name\":\"drives\",\"base\":0,\"doc\":{\"drives\":[]}}"); + CHECK(has(r, "\"err\":\"doc_unreadable\"") && !has(r, "\"saved\"")); + } + CHECK(chmod(path, 0600) == 0); + r = call(MESH_DOC_GET, 1, "{\"name\":\"drives\"}"); + CHECK(has(r, "\"rev\":1") && has(r, "{\"drives\":[{\"id\":\"a\"}]}")); + /* It is not a document (cut short): the same, and it stays as it is. */ + if ((f = fopen(path, "wb"))) { + fputs("4\n{\"drives\":[{\"id\":", f); + fclose(f); + } + CHECK(has(call(MESH_DOC_GET, 1, "{\"name\":\"drives\"}"), "\"err\":\"doc_unreadable\"")); + CHECK(has(call(MESH_DOC_PUT, 1, "{\"name\":\"drives\",\"base\":0,\"doc\":{}}"), "\"err\":\"doc_unreadable\"")); + CHECK(has(call(MESH_DOC_PUT, 1, "{\"name\":\"drives\",\"base\":4,\"doc\":{}}"), "\"err\":\"doc_unreadable\"")); + CHECK(!strcmp(doc_file("drives"), "4\n{\"drives\":[{\"id\":")); + /* One never written is still none. */ + r = call(MESH_DOC_GET, 1, "{\"name\":\"other\"}"); + CHECK(has(r, "\"ok\":true") && has(r, "\"rev\":0") && has(r, "\"doc\":null")); +} + +/* A document that is not JSON every reader takes is refused, and what was there stays. */ +static void test_doc_json(void) { + static const char *const bad[] = { + "{\"a\":01}", /* a leading zero */ + "{\"a\":-01}", /* the same, negative */ + "{\"a\":1.}", /* no digit after the point */ + "{\"a\":\"\\x\"}", /* not an escape */ + "{\"a\":\"\\u12\"}", /* a short \u */ + "{\"a\":\"\\ud800\"}", /* half a pair */ + "{\"a\":\"\\udc00\"}", /* the other half, alone */ + "{\"a\":\"\\ud800\\u0041\"}", /* a pair that is not one */ + "{\"a\":\"\xc0\x80\"}", /* an overlong UTF-8 form */ + "{\"a\":\"\xed\xa0\x80\"}", /* a surrogate in UTF-8 */ + "{\"a\":\"\xf5\x80\x80\x80\"}", /* past U+10FFFF */ + "{\"a\":\"\xe2\x82\"}", /* cut short */ + "{\"a\":\"\x80\"}", /* a stray continuation byte */ + "{\"a\":\"tab\there\"}", /* a control byte */ + "{\"a\":nul}", + }; + char body[256]; + const char *r; + size_t k; + start(); + CHECK(has(call(MESH_DOC_PUT, 1, "{\"name\":\"user\",\"base\":0,\"doc\":{\"v\":1}}"), "\"saved\":true")); + for (k = 0; k < sizeof bad / sizeof bad[0]; k++) { + snprintf(body, sizeof body, "{\"name\":\"user\",\"base\":1,\"doc\":%s}", bad[k]); + r = call(MESH_DOC_PUT, 1, body); + if (!has(r, "\"err\":\"invalid_json\"")) fprintf(stderr, "accepted: %s -> %s\n", bad[k], r); + CHECK(has(r, "\"err\":\"invalid_json\"")); + } + CHECK(!strcmp(doc_file("user"), "1\n{\"v\":1}")); + /* What every reader takes still goes in. */ + r = call(MESH_DOC_PUT, 1, + "{\"name\":\"user\",\"base\":1,\"doc\":{\"a\":0,\"b\":-0.5e+3,\"c\":[10,true,null]," + "\"d\":\"\\u00e9\\ud83d\\ude00\\\"\\\\\\/\\b\\f\\n\\r\\t\",\"e\":\"\xc3\xa9\xf0\x9f\x98\x80\"}}"); + CHECK(has(r, "\"saved\":true") && has(r, "\"rev\":2")); +} + static void test_persist_and_prune(void) { const char *r; start(); @@ -373,8 +508,11 @@ int main(void) { test_ask_limits(); test_older_app_is_listed(); test_hello_and_state(); + test_long_names(); test_locks(); test_docs(); + test_doc_unreadable(); + test_doc_json(); test_persist_and_prune(); test_events(); { diff --git a/payload/tests/utf8_cut_selftest.c b/payload/tests/utf8_cut_selftest.c new file mode 100644 index 000000000..dce64ee2e --- /dev/null +++ b/payload/tests/utf8_cut_selftest.c @@ -0,0 +1,109 @@ +/* Host tests for utf8_cut.h: a delete or chmod that partly failed names its first path on the + * status line, cut to the line's room from the end (fs_jobs.c fail_message) and to its buffer from + * the start (fail_note). Both cuts were byte cuts and could split a character of a Japanese or + * accented name. Build: see the root Makefile test-payload. */ +#include <stdio.h> +#include <string.h> + +#include "utf8_cut.h" + +static int failures = 0; + +#define CHECK(expr) \ + do { \ + if (!(expr)) { \ + fprintf(stderr, "FAIL line %d: %s\n", __LINE__, #expr); \ + failures++; \ + } \ + } while (0) + +/* 1 when `s` (`n` bytes) is whole, well-formed UTF-8 (lead and continuation bytes only; the + * cuts never make overlong forms, so the shape is what matters here). */ +static int whole_utf8(const char *s, size_t n) { + size_t i = 0; + while (i < n) { + unsigned char c = (unsigned char)s[i]; + size_t need = c < 0x80 ? 1 : (c >= 0xC2 && c <= 0xDF) ? 2 : (c >= 0xE0 && c <= 0xEF) ? 3 : (c >= 0xF0 && c <= 0xF4) ? 4 : 0; + size_t k; + if (need == 0 || i + need > n) return 0; + for (k = 1; k < need; k++) + if (!utf8_is_cont((unsigned char)s[i + k])) return 0; + i += need; + } + return 1; +} + +/* fail_message's cut: "..." and the end of `p` that fits `keep` bytes, from a whole character. */ +static void shown_tail(const char *p, char *shown, size_t cap) { + size_t l = strlen(p), keep = cap - 1; + if (l > keep) { + size_t from = utf8_tail_start(p, l, keep - 3); + memcpy(shown, "...", 3); + memcpy(shown + 3, p + from, l - from + 1); + } else { + memcpy(shown, p, l + 1); + } +} + +int main(void) { + char path[600], shown[110], first[64]; + size_t pad, i, n; + + /* The tail starts on a character for every alignment of 2-, 3- and 4-byte characters. */ + for (pad = 0; pad < 4; pad++) { + const char *chars[] = {"\xC3\xA9", "\xE6\x97\xA5", "\xF0\x9F\x8E\xAE"}; + for (i = 0; i < 3; i++) { + size_t k; + snprintf(path, sizeof path, "/data/%.*s", (int)pad, "xyz"); + for (k = 0; k < 60; k++) strcat(path, chars[i]); + strcat(path, "/save.dat"); + shown_tail(path, shown, sizeof shown); + n = strlen(shown); + CHECK(n <= sizeof shown - 1); + CHECK(strncmp(shown, "...", 3) == 0); + CHECK(whole_utf8(shown, n)); + CHECK(strcmp(shown + n - 9, "/save.dat") == 0); + /* As much as fits: never more than a character's bytes short. */ + CHECK(n + 3 >= sizeof shown - 1); + } + } + /* Short text is kept whole; ASCII is cut exactly. */ + shown_tail("/data/a/b", shown, sizeof shown); + CHECK(strcmp(shown, "/data/a/b") == 0); + CHECK(utf8_tail_start("abcdef", 6, 4) == 2); + CHECK(utf8_tail_start("abc", 3, 0) == 3); + CHECK(utf8_tail_start("abc", 3, 10) == 0); + /* "a" + U+00E9: keeping 1 byte would start inside the character, so nothing of it is kept. */ + CHECK(utf8_tail_start("a\xC3\xA9", 3, 1) == 3); + CHECK(utf8_tail_start("a\xC3\xA9", 3, 2) == 1); + + /* The front cut (snprintf into the first-path buffer) drops a character cut short. */ + for (pad = 0; pad < 4; pad++) { + size_t k; + snprintf(path, sizeof path, "/%.*s", (int)pad, "xyz"); + for (k = 0; k < 40; k++) strcat(path, "\xE6\x97\xA5"); + snprintf(first, sizeof first, "%s", path); + first[utf8_whole_prefix(first, strlen(first))] = '\0'; + n = strlen(first); + CHECK(whole_utf8(first, n)); + CHECK(n + 3 > sizeof first - 1); + CHECK(strncmp(first, path, n) == 0); + } + CHECK(utf8_whole_prefix("ab", 2) == 2); + CHECK(utf8_whole_prefix("", 0) == 0); + CHECK(utf8_whole_prefix("a\xC3\xA9", 3) == 3); + CHECK(utf8_whole_prefix("a\xC3", 2) == 1); + CHECK(utf8_whole_prefix("a\xE6\x97", 3) == 1); + CHECK(utf8_whole_prefix("a\xF0\x9F\x8E", 4) == 1); + CHECK(utf8_whole_prefix("a\xF0\x9F\x8E\xAE", 5) == 5); + /* Not UTF-8 to begin with (a stray continuation byte, Latin-1): left as it is. */ + CHECK(utf8_whole_prefix("a\xA9", 2) == 2); + CHECK(utf8_whole_prefix("\x80\x80\x80\x80\x80", 5) == 5); + + if (failures) { + fprintf(stderr, "%d failure(s)\n", failures); + return 1; + } + printf("utf8_cut_selftest: ok\n"); + return 0; +} diff --git a/scripts/build-console-strings.mjs b/scripts/build-console-strings.mjs index eb74dc091..5d0390b5e 100644 --- a/scripts/build-console-strings.mjs +++ b/scripts/build-console-strings.mjs @@ -23,6 +23,7 @@ import fs from "node:fs"; import path from "node:path"; import vm from "node:vm"; import { fileURLToPath } from "node:url"; +import { RTL_LOCALES, isolateLatin } from "./rtl-isolate.mjs"; const repoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), ".."); const LOCALES_DIR = path.join(repoRoot, "client/src/i18n/locales"); @@ -49,11 +50,15 @@ export function extractConsoleStrings() { const out = {}; for (const f of files) { const dict = loadLocale(path.join(LOCALES_DIR, f)); + const code = f.replace(/\.ts$/, ""); + // The page shows these as they are: a right-to-left locale's Latin names and paths are kept + // whole here, as the app's loader does for its own (client/src/i18n/isolateLatin.ts). + const whole = RTL_LOCALES.includes(code) ? isolateLatin : (s) => s; const picked = {}; for (const key of Object.keys(dict).sort()) { - if (key.startsWith(PREFIX)) picked[key] = dict[key]; + if (key.startsWith(PREFIX)) picked[key] = whole(dict[key]); } - out[f.replace(/\.ts$/, "")] = picked; + out[code] = picked; } if (!out.en) throw new Error(`${LOCALES_DIR} has no en.ts`); return out; diff --git a/scripts/i18n-source-hashes.json b/scripts/i18n-source-hashes.json index d1586e597..97946e82e 100644 --- a/scripts/i18n-source-hashes.json +++ b/scripts/i18n-source-hashes.json @@ -1171,6 +1171,7 @@ "collection.org_title": "2b641d7c YImxcZUF-XuThVOphpYdKjwxI8OFTUf7Mn1XDs--NDumPYeqNs1FOk0iPD1R", "collection.org_undo": "a8283ade 7sDdDq3XvKfqdZiRq079rawWyZ8GMn3GWub_kjSeGtfEfDSTa2X5y_kmpKr3", "collection.org_undo_body": "95bde2ed Wx3PXdilNN274mDiYgZtgiX4B_AQPIQfQLIZ7tUzzgjzFvUWwWJ9pXwlQZM9", + "collection.org_undo_incomplete": "8b2d6514 U2gMr4SKLcAZ84LANLV-9JsjUyFXLBG0XfBl4B09E2uUMvLvMaemnZdtw8jb", "collection.org_undo_title": "9218adc1 qjTZDYWRV1icZ7MLUQEB_qvdC0c0QlGmWzK-aU0ejkUuzapXlHcLR9JKPPM_", "collection.org_undone": "326a2d91 W9jviD-pgeI5Lm9Ki4uxD65Evv11VrgiCITWWlkMwKPWo_yiVNHhL19LsVkA", "collection.org_unsure": "12e412b6 3CJZBXJ-2Y0W10kw2Tb3eewSSeDljDMIAq40fp5b5ec8YBGzSRLxDtpDRL5H", @@ -2890,8 +2891,10 @@ "drive_delete": "cb7ca0b8 5NIqkJFu27ugSFt53sLVWXukCDNFgHULwwR2bY63qpsUojRSamBzxt6UiK0O", "drive_delete_body": "cedf98d8 cysHNKv7z-Cu1Qw5lM8nxOJWC31dWBpuYl1cK3wzpG8MwMYvHVAhYxqUfWyX", "drive_delete_title": "454934df qHubS3dGsV0g0haYfQ9MvVk25oB9ADdOoSWVxuV84pPsp86cUTp32aVVOsTA", + "drive_deleted_later": "8adfc4a4 ItxGKRibhgJLOYqOY6C1ZI3TLytAALg2qjQxeUS1vnkI5I0oKhfXcCkcz7kN", "drive_detail_changed_here": "bf6a9722 ZBwD7iUY7gNSXDgOvEKjw19erviybRfbz2HsV7DQIaakvJ8hgGX0acCHTz5Z", "drive_detail_changed_there": "e4dd34ba _8W_o95MvQ7fMlM0m3hYklrfuNuCW1F_v-xHLrcze8feDHPI8GAmSza8Wsu9", + "drive_detail_console_list_unreadable": "18e7ebcb D2P1t9S3wKX2X6wQlDCEG75dA3a-kgL99BV3-D94kjUxBvP_Bkstkx8bwDcL", "drive_detail_helper_old": "fa623f2f gpbByXkzjJ96yl4CNqybekYPNDv370ZCggasGlPr0TerU1HBfwdtCophCrxv", "drive_detail_hub_no_marker": "1918b8f2 CYbxbJeaBAcsuC_KC_VFWOzsQBJf5hX9Kjr4QxK-ZB5g61CvF-EArW3g-Ty6", "drive_detail_install_running": "4b37fcfe Wd9IMTyuAqHt9gp_a9Yw1BvVH3N-TxIJQ1pT3FnaC5MbI-lwkd4OOn4QYAGa", @@ -2934,6 +2937,7 @@ "drive_leave": "fc6e4a40 R5f7j5oiwk__w8SSXQDN8KDSDYsWAJSY4Ir-lCrLQIVpDk_p-jbO61SY4SY4", "drive_leave_body": "a80780d4 kFq-cUpRqf8xFXlX9323gxfV8cuTmxUX-eZWSMjqECyFm7LBXvQKFxcWhAs-", "drive_leave_title": "50b162ae JXMW0tqUAwa--un5oJJV7YlsC5oUkBAgbcLKceOCaTVhrLw5rI9fitDpuXCT", + "drive_left_later": "98637c4c Uy4BdWw0tCp_SprAP9VMwRbl4S5E3F3QuaKeGmnQIAN5BF9pWWQBjMtShYpp", "drive_link_allow_deletes": "e686e085 TisoAOqzBhf3Icdi-VUEvXNTFZWH-WYFDoT8TeItKzDZMLvuPR8uMj0yxsWS", "drive_link_already": "165a67d0 QcWetkZVQS5qyItkBAEPT3HBOc7USxsNOap1385Cu9AK6yT0We7nlY1p4_Of", "drive_link_body": "9d765682 zkWLSxI_a6T6b6N_oEhh3KvzKg8UCMUOhiKCCUo75TT5l58Md9oGSZGVPCad", @@ -3926,14 +3930,15 @@ "fs_snapshot_batch": "4ee262bb VHB3o6OKvYbDlKbLVqLZTtKYK0qKZkdGOI0ycvRc1tyBWrOmSHhOhFEALBnI", "fs_snapshot_batch_create": "3d637b2d UfjHiQ8E91-vquaiRnBOZAaAv0D3Ok-ckWJ-MOfyn0prbnoe6cFZRhprAG33", "fs_snapshot_batch_ok": "8d483835 FC8owpcCsCWi8jQdi0b9aMIFDuganHtp2g1NMSkBCiT-7alTJa62ozruBiRa", - "fs_snapshot_folder": "36baf3ce UayGls1h1h1Db1gZPKzG5wuK9d7We58wMSuftzH_m4bRha6qYW-Gs4I_FINw", + "fs_snapshot_folder_v2": "673d6652 I3mCDvq7QhH4IqVEobYekiP-RlnEOtgChxjqaEbG5vjckGBXImsGqy0owFn8", "fs_snapshot_tooltip": "33a5b54c OTsIYuOCBm-QdrkO7nGAjYnE6eZdQmnlSK8kuwuwTc8As1FaOyUCDnc6cKeg", - "fs_snapshots_open": "f187f78e R_7OTgw5b7KFsUgi7Bnyz0glatJatJSw8ltf6618YfwkHsmWeFR1ASaZ6aZ6", + "fs_snapshots_see": "5446013e p1u0rl2I9oYcmzz7hLk9_mzu9cXHy91LrH0DqvHn18ScFm9if8pnghZ5yZ5y", "fs_sort_modified": "e8ce5dca 0FavmX1jyB5VXqrmLwcxAqHKrockkPbx1kGZf5SB5VSiFhwLQS9sgXJXuhTp", "fs_sort_name": "dcd1d522 Uqs-wn3NHViuacHssEZTsRnt9paUIafsJJT0NLhUIaHafm0SHZfyLF1E6pSd", "fs_sort_size": "1af85190 PvGV_1rtwWbc4nDdwkY36_kNGwPhtFTBTgiMi2vIb7VyCsOomD1hOBUNtUNt", "fs_space_action": "5e7e7d8c rdqYuBzJGURHaQ_6jgogqeWHVBf_U38tZNDZkflnnAj_gqxZZb2gPsLMPoSq", - "fs_space_here": "54706fe9 PcDQpNafhH2F20mtUYal2EVqy94-ICa_szKt5d77RXQJ66nQ2Qt6zG232bNH", + "fs_space_drive": "ecb58755 HoGtRz83lnqrrofpN0uWsvMjZagiPBH7sNPX1RxJHKpQ8JtwzCo6szgKh3D2", + "fs_space_here_v2": "33e38909 gjBsMj_9tl-IRzx54JqzGdw8CIGCI_ZBDp4V5hTQ_77zapPUNoPFoKKSjvm_", "fs_space_open_folder": "d79fbeb7 T7eb6nUpCsB-zeP8sRAqiwnSwo9uW5llqkslB6iQr584RfbASvkih3hhFcUb", "fs_space_title": "5e7e7d8c rdqYuBzJGURHaQ_6jgogqeWHVBf_U38tZNDZkflnnAj_gqxZZb2gPsLMPoSq", "fs_tag_folder": "74ccd433 vJBeHKMwKc0LhTELN8tQ7K3HdMzLpXj7D5VYdMzUY5c6DRDoHfmlU3fHgqrx", @@ -4544,8 +4549,9 @@ "hw_sensors_partial": "047505c1 xHSH_63heMabE22ZF8UXaoU8C0xAosbdILOB-f0FNETxdOPXof9knXrgqiWu", "hw_serial": "8ea09493 V4ncTOdgqIsvRd9BGq-OH6vaRCouufGeq5gKjDrwxsuxNJXYFePC3tlIVb6R", "hw_storage_free": "f411a1fb H1gXPOOwnFi2k-QFi2GYgUN89I_-alft5ZlJ2BdgUE4S6OZL2OHuZ7TZnTZn", - "hw_storage_reserved": "3385ffe6 6K-VckEIFFkNeDo5CgEuqOQB1Cs2uQ5TwIjKQO_FkN5JL43opOP81DZw7Zw7", - "hw_storage_reserved_hint": "13f59b2e iYf9TOmCzMK8Wue6wB_B-Ncry-s9XxfG1goT7kMVFqCYzFggDHuidL8ahU9v", + "hw_storage_held_back": "77f81361 G5pklO2gv4wisCGgucHJ85WmPXIjwx_QXZifbcsD4TIv9k-NkK0rADPwkELG", + "hw_storage_held_back_hint": "234dae8e uOXDXoitNOvvCyl1DW5-NPcs6sHxu5DllS0i7J8iYW45SxPBEPLsmeK5L2fC", + "hw_storage_note": "68b2286f K9SHDURHAN-Nn7Hp3XgWn28548DX73Pwh5JCyc037VlUQGPs6hdZ5mxDN6UF", "hw_storage_total": "c9b3c382 uu1GVmo2vybP6P7ybPtUNkQ8ybPvJ9AfwWoSQbHybPaRPXZphujE_26NywR7", "hw_storage_used": "ae7d8dfa hG6ydFq3uHzgbgb3hywkF4Sv5c8mkrmwIk8VnHgHzgK0u1fV7ZInbGk3amEX", "image_dest_default": "4a73673c RmIu3ED3qS9hVK5qzyP_AhQkVAh_ackOBrAQGgFYp5O99aNd0MhCHZRAfXK0", @@ -6294,6 +6300,7 @@ "pm_origin_list": "1be3886f lFDsVl2X7Wjnxs7xQAS-9ozhBjWwTvvghy-h6QQ6JK8xF7CajZVmpmwSNafi", "pm_origin_list_boot": "6c6a507f NChno21XhEmX-9ocKugjrKR-6LGyiuz4Pp4uMbGO6Io-yC1f5E_p3CfFtLxo", "pm_probing": "39b5dbe6 t9npS8zhM_WEIdYX3Qq00DhIDLs23ov4RZix_EF4vE9pgavxVGAmL9Iuh4o9", + "pm_row_more": "f608d334 P2Or71mTVEP9X4lH8zOROR7Q4A4fZb3-une32eIH4hWpYzlPxATiizCDgCDg", "pm_running_badge": "e3a2afec f2FW6BENCpzAHUvisSwQTvEvJUPQQ6RuoGSdAPpbys4O4M51TyH0vxbYkMPp", "pm_saved_elsewhere": "13b4f8c2 vXZDgTBUPGUVIozyePBD5clSILglBeRHT5h3bTc5mh_NadxKa1WP29Z99WSp", "pm_saved_empty": "2c648fd4 kHjTvMrn7MRLi-7oXqI9kuK9wLkRZFa2RSSign5dtdG35Fhkflq7-FoD6DrQ", @@ -6912,6 +6919,8 @@ "receive_cheats_on": "0fd195e2 a8_shrEobQwgrIpyEH10WoRUIR04-aI8Ohoh2xwjhA1pjJ5hZnzQz8nNAzs_", "receive_connecting": "1dda7e06 osgxJ8wsiUTfg1cET1_gMYgKkDtBw9_IMnDO0Nd10QP2qYcgg1xPEylBRO9T", "receive_controls_used": "ee06fcd2 KhSoBViGoWysGUx2fZZ8CCklcG1ji6-kjgcXaRsJWG9AOALoI3SJ1yBUXBUX", + "receive_data_unreadable": "70a9db0c 1BPXcVI1V8Vb0VDOpsO7uOZoBLD85M0OsW7uuRzDdX7L78md8Pt4N-qNetMU", + "receive_data_unreadable_body": "fce9b511 mmSvENLeYgXnOXsahgRMru2WDpF0A5sTFSUKSbnmOyA3Yl8Y1NDmsBWeNp9Z", "receive_declined": "2f56155e HR1y3O7-jZJzpBPsVp7IEomOhv2303nwAkW9SzpufoRtieagDn8R3Jt5HWvj", "receive_done": "278a6cad ih2vpdlEvDm5fvQJ3pGHaaFpPUsmOHFNU8fpMm_ngZ_k5r1pMhrCi7wO5TDX", "receive_done_button": "11a6767d PvVIaYJdUtfpZdJ8orSbsC89_uXBZgEDFcnMPZ0bpF7wXYvjvoYpvRwLPwLP", @@ -8650,6 +8659,8 @@ "update_err_rate_limited_later": "650654c0 jiW2P8sEO6QjIuPZ1s4vNEZqcytDNX-q4eagPBD3kduorTN-QewiQ7Lsir0c", "update_err_too_large": "953829e7 uN_Oc8mu68sngkz8unaiZpd0tgPh5JFZK7mYOZps2pHKe217Ddbiwovb6OGj", "update_err_unsafe_url": "4886bcac Bb7D0Nz_iLcQjBAi2Ngi9H2PyUmkir7NlgLn4ftw0OJEELFkUVKqbRaPlqty", + "update_finishing_body": "9b9ef90d lg1XFX1A8rJeDez0HplqxiY8Gbyl_v9P8okMVlnx5mYJRzTJpsvQZqjpxAiT", + "update_finishing_title": "bb783e31 xm8WCBWm9GMbZNZhN5WfAANtrK0HdwVQkvvcrBWOIstAnj5Ik2-6Lb5BW5BW", "update_idle_v2": "c67faf05 LOddI7jyLz4OV_PBf2oLk__zQ26xTIyWIhwJYrtIoo74yDA8DIupPTdSkRd5", "update_install_error": "0085e979 IGS3KtCO7EYSPW9VDKgYfwR9KRBQcomCxV_G5C6xE-ZLwKbreODrw5hgM4bl", "update_install_failed_body": "05a409da jgNQTv9n6X_LY5bWqFN0PTEZ3e7zZrF3VZ5e9QVY-mRxGZQRGqEaNlRHdMgu", @@ -8760,6 +8771,7 @@ "upload_dest_final_path": "7fbcbe91 7H8xOVQG4pdPl1JwmQ85xjotih7Tebo1YKneYijyGortFVeSK0i1bzBlHqLd", "upload_dest_image_folder_note": "d8faa55f WYwM2ZU2HUKK8jJ5GEGN_0VGhvJiV0sZRt3DewFeyVpfZksm1602RY5kGUtr", "upload_dest_presets": "1d096828 CTfrFbWhLbqn8HF62BSCKD_KObsOSyo-kHmJRommgw7UIorvhwnXyn6Bm8Zi", + "upload_dest_room": "97a3b199 pN0sFA0wF6PETFC18S-NXhfUE6uEjP8ST0s57UNqikm2up9DMnKZ2r2pKAG3", "upload_dest_subpath_label": "0c00e0db 30oqhbxvXpgwwDrGvHUpF08F8kP2qGt8LwkTSAph7SR08Wst7AApq73HabNw", "upload_dest_will_create": "28ae1201 qEUtnVD9iNbw6tsSmIqgLoequ2QWlQgCmv9L0LvOX5Cw024DOmrnTD26Z16x", "upload_detect_error_title": "54a0e8c1 rMd_Ga9swVKDKJVRhSNG-Ibdp3kU8Zjy6tJ8ipqbbqvyLnmWMHu5omC8HFXs", @@ -8872,6 +8884,7 @@ "upload_phase_skipping": "c3d220e4 7A8IbY4Zsz7fHXkf_D2EQm7vv6mlvwSJeegtg4I80iepuaOi_lloyuPhXPmV", "upload_phase_verifying": "97c2b7f9 WIiOgSm5-88mttTb5HO1yr8-yaPISv6V8VErD799l3JYkzXq0SI3gYOihBMN", "upload_phase_verifying_count": "c3c42b33 9BNZasKZEY_EDX8S0ZMBafm7fAAND4EwjycRZm6LPcWHQOtpPZrCoMBBp0nw", + "upload_phone_upload_first": "6d4e7456 If7G5ahDTXiJ38G2hrQk7E8joCUXwhZH7ZtLfZYuQ0O8c1tuakT-pUN75Fah", "upload_pick_here_mobile3": "dce662a1 XK6BJxE9QQQFx3qrLr1WZwE5HmZYSnB2l-u_7zE87J_Q3QX5sIZxx0i3K1UN", "upload_picker_from_ps5_hint": "83af04e4 PgLKp-IF6nPsO-tqX8ffvFbJB8oRPc5sfHzSwPjruHUGUZG8DTJ49klO9kUK", "upload_pkg_card_desc_upload": "45909c40 dVffvL2OzDd_cbiHZdM6LGvBgxFGsTnx8iaoDl_SdPB0VX6kFUx6FJclDfbb", @@ -8887,11 +8900,13 @@ "upload_pkg_name_all_v2": "f3721f7f MNXwRK2DO0ZrsL3zjPQEklKarYD_GqltuD_NVyhK0BaoYc76ODoKDMi1jQ-Y", "upload_pkg_name_failed": "bb25088a NcidVUKii5VEBx8tkuuQRTQ8WkVOsStjQXZ37Ho6bUwyMIrGF0bhn8_zoxNA", "upload_pkg_name_hint": "2a467651 qvVb2mg2vy5yFS_BdTxUBDUFotmO-pwVIyGWs2MsqpfDHMO1LZ3i98mAYANM", + "upload_pkg_name_left": "709cf894 P8hFUZwBz8Irdwn3l35IW_Riv92d8cZgYq1nxobADfrVgvMfnNBlZ9FGj2Ol", "upload_pkg_name_refused": "f75e5289 HyTrvlhIS8RkY91J2N_Ihjes_Zq4ZM1G6Weub0AzkSx0AieQsKAd08Gz5EqP", "upload_pkg_name_retail": "c7ee7334 8acduLYmylTnEs2mTSJXXNr6sHSnMsY9moyKB_qa0P5EtIhSQvsMCVnwoTbG", "upload_pkg_name_save": "e17a8484 3yiAsFQ4x3X6rn2cBR3jCA5mydweshaAMhAQCT4kx8eHr4fDWKkoqDuFr7g9", "upload_pkg_name_saved": "6a90a1f5 Lco1I2xUJVEj5inBfqHNLD_IzrxVYuLJFzxJumpOlAHXcoQiEZXb_aCJcvx4", "upload_pkg_name_title": "3d9c7e0b EYpD7QClRq7vT8KmXAkHGPNeV9KG_i7ypKv6FiIW3INWTHLdoCiPGgOiULI0", + "upload_pkg_name_too_long": "84169130 9NTXDjqmoVKSsvFytQj-IBlZFuksCqEzSRkbnqtS8EHIujpSXs9kVGdO8stz", "upload_pkg_stream_recommended": "ffee2550 no9ZsK-p_gSKYMbrn6IsR2LGQGd95sDymgRW4G4bVcIoENMe_KlC2dCbrFeM", "upload_preflight_error_title": "cfb9a00a 7z-5V960Mnz1leyE1xMdJHpknzrBKDMKO30hWUrRQuveIKWoFcE0QFt66ZQA", "upload_preflight_failed": "c5c1ede3 YbpMDWl22FG7QM7B8IaBG9dWB2UNylmtkJHvnlZF6eBVlr8zhi4foHSQsEyV", @@ -9178,7 +9193,8 @@ "volumes_free_of_mounted": "f7318641 U--qm1CYUgXYyGZdwgKa2CSBWargMvVtu_FI_80DtwzsBd7W9bFSkoOIVOIV", "volumes_free_of_storage": "f7318641 U--qm1CYUgXYyGZdwgKa2CSBWargMvVtu_FI_80DtwzsBd7W9bFSkoOIVOIV", "volumes_free_up": "5912ec8c 8qSq_xbPX_elf3ZDKuBXfSa2GC7eZ1rTIfwmCCPnN_LxFSTuG9Z3J9PR0vaG", - "volumes_kept_by_console": "a749b35a 14_4d7Ldde0Tre5UfcuGr-6YYdSOjM_1MEnlxek9szy29D1oWHBAvD1oaILV", + "volumes_held_back": "da4c01c9 EC-p1g1k8GlQxQQ9dSANz4BEKJyc7751c4mVu4S0uesR02zlCJ1Y1yl-Gb49", + "volumes_likely_fits": "e7172c51 wYiJeZDkh-oGAyJKUBIUTw0jlQA9IaQlIRmJPRoA2sO83YACrWI4xVFus0in", "volumes_mounted": "6704cfb8 Z161KBB5gdezSQpJQzpQE48HVl5spbQRt6nGCNSdezXKnw_Z_3sMpuhoBLKw", "volumes_mounted_disk_images": "da5affff K9i8GBN6oUi_mGsE7uDcxykGCyFWrhOIHWMgyxlYKTNlin-m7K6BoK0Pg2UW", "volumes_mounted_rw": "e12ba4f3 FbXxp22J75bhKOBoibsLraVDQ-t4EOp78_1nwkGmRVjbkCnjI1QQtn1cMMLI", @@ -9186,6 +9202,7 @@ "volumes_pct_used_storage": "19e8fbbc TFvzDNbPIYDP8JIG6z8GTb3EsikRL289ck0f7FjYDPsafvkknHiXKpb1mb1m", "volumes_pkg_copies_here": "6c150fa6 gc7nkooIVHebrMsMWgVspfFxA9aFzKJZjxXkev_gFM2uJw8D6sUMAfuBA4qd", "volumes_pkg_copies_hint": "33f8e88b AlmSCr5x__2wWYX4rrP3fVeJ49ba1sMHHDGYtAwjPRgqzpx2_Gh0T5N5RgDk", + "volumes_ps5_shows_less": "2f83e0b0 PObWOPLOTAu6ZiASAt1ovE9h6ctiu_t-gcI9lLQiij8ZIeeOh8Z9Fiwpp03Q", "volumes_read_error": "ce17ea9d p97C5QwIX1yhvpJCc5z06eCRJ3pqiB9cJ5sad6PiJRJndUPPDDnbdFppZQ4k", "volumes_read_only": "4fed3970 SjuoIkefvZPcyiSF1D9byIzwJwCnKEJO9XAjw3jpImvAPtXvW9r4iCO17JYs", "volumes_retry": "942087cc FNViuElIZqSVvpurycyvIS5k6HxILX-2zGWhvjmueEUYkDlGHzDxY0uHhfln", @@ -9194,7 +9211,6 @@ "volumes_unmount": "2ad51f6d bckCD0bawXM8uk3xs3euRggbYKuC4AiA4tP4KIgXM8G3Ob5Oy0nkYQBrw5kv", "volumes_unmount_confirm_body": "569bc732 GsVZJeVPcLC8b05LobjuY55TWejqdgwABtAKuf7db-tuN_FiOv99Grmitwfz", "volumes_unmount_confirm_title": "67638a68 wnQtpxb6e2WqoMLarDjsQ-svEkrS3HVpf2YyMOGSVHOgeV_435mnvWXgsNOQ", - "volumes_upload_safe_capacity": "0717f1ef 0M1JeNdbGa4YGsLvMyxE5ooPK9QyM3dPcMqQ15HkNLn2ogJyZOrKgZQaPazd", "wake_at_sign_in": "c7dbc355 4wk-L739QtVl3MVl16fMD3RaUPzJsZwG9NFqBDPqUL9gbU3v_s5_-DYgyzF2", "wake_passcode_body": "475002f4 t78h6zIV6A2yNqXddKmJToreMR4n1go_coC4rkbdmpxlkAgjXu-0zSinfxxF", "wake_passcode_cancelled": "9c898b2b AsqXING6t902sY_eeduCyLcsx3gGB_KIZmS3d0qCqtehw5lDnLPgbbDMiMv2", diff --git a/scripts/rtl-isolate.mjs b/scripts/rtl-isolate.mjs new file mode 100644 index 000000000..dd3162e8c --- /dev/null +++ b/scripts/rtl-isolate.mjs @@ -0,0 +1,41 @@ +/* + * Latin text with a symbol, kept whole inside a right-to-left sentence ("ShadowMount+" is otherwise + * drawn "+ShadowMount"). The same function as client/src/i18n/isolateLatin.ts, which explains it, + * for build scripts that write strings the app's own loader never sees (the console page's + * locales, build-console-strings.mjs). client/src/i18n/isolateLatin.test.ts holds the two to the + * same result on every right-to-left string: change both together. + */ + +/** The locales written right to left (i18n.ts RTL_CODES). */ +export const RTL_LOCALES = ["ar", "fa"]; + +const LRI = "⁦"; +const PDI = "⁩"; +const UNIT = "(?:\\{\\w+\\}|[A-Za-z0-9]+)"; +const PIECE = new RegExp( + `${LRI}[^${PDI}]*${PDI}|[*./\\\\~]*${UNIT}(?:[._\\-/\\\\:+&@'=?%#~]{0,3}${UNIT})*[+#]*`, + "g", +); +const OPENS = /[\s([{"'«“‘]/; + +function split(m, before) { + if (m.startsWith(LRI)) return null; + let lead = ""; + let piece = m; + if (before !== "" && !OPENS.test(before)) { + lead = /^[*./\\~]*/.exec(m)[0]; + piece = m.slice(lead.length); + } + const own = piece.replace(/\{\w+\}/g, ""); + if (!/[A-Za-z]/.test(own) || /^[A-Za-z0-9]+$/.test(piece)) return null; + return { lead, piece }; +} + +/** `s` with every piece of Latin text that holds a symbol isolated. Idempotent. */ +export function isolateLatin(s) { + if (!/[A-Za-z]/.test(s)) return s; + return s.replace(PIECE, (m, at) => { + const cut = split(m, at > 0 ? s[at - 1] : ""); + return cut ? cut.lead + LRI + cut.piece + PDI : m; + }); +} diff --git a/site/assets/shots/add-ps5-dark.webp b/site/assets/shots/add-ps5-dark.webp index 2d2b3b7d4..71fc5b817 100644 Binary files a/site/assets/shots/add-ps5-dark.webp and b/site/assets/shots/add-ps5-dark.webp differ diff --git a/site/assets/shots/add-ps5-light.webp b/site/assets/shots/add-ps5-light.webp index ba3a3827a..5afeb1076 100644 Binary files a/site/assets/shots/add-ps5-light.webp and b/site/assets/shots/add-ps5-light.webp differ diff --git a/site/assets/shots/approval-dark.webp b/site/assets/shots/approval-dark.webp index 6e9261c05..f766c1767 100644 Binary files a/site/assets/shots/approval-dark.webp and b/site/assets/shots/approval-dark.webp differ diff --git a/site/assets/shots/approval-light.webp b/site/assets/shots/approval-light.webp index b1a14ded9..a7520a73a 100644 Binary files a/site/assets/shots/approval-light.webp and b/site/assets/shots/approval-light.webp differ diff --git a/site/assets/shots/ar/add-ps5-dark.webp b/site/assets/shots/ar/add-ps5-dark.webp index 4c1cf972c..f42250759 100644 Binary files a/site/assets/shots/ar/add-ps5-dark.webp and b/site/assets/shots/ar/add-ps5-dark.webp differ diff --git a/site/assets/shots/ar/add-ps5-light.webp b/site/assets/shots/ar/add-ps5-light.webp index d684965d9..bf2848c7e 100644 Binary files a/site/assets/shots/ar/add-ps5-light.webp and b/site/assets/shots/ar/add-ps5-light.webp differ diff --git a/site/assets/shots/ar/approval-dark.webp b/site/assets/shots/ar/approval-dark.webp index e4c4e2245..12ded4488 100644 Binary files a/site/assets/shots/ar/approval-dark.webp and b/site/assets/shots/ar/approval-dark.webp differ diff --git a/site/assets/shots/ar/approval-light.webp b/site/assets/shots/ar/approval-light.webp index 36d8eb25c..072f728e9 100644 Binary files a/site/assets/shots/ar/approval-light.webp and b/site/assets/shots/ar/approval-light.webp differ diff --git a/site/assets/shots/ar/connection-dark.webp b/site/assets/shots/ar/connection-dark.webp index cbfce07c3..d30b11160 100644 Binary files a/site/assets/shots/ar/connection-dark.webp and b/site/assets/shots/ar/connection-dark.webp differ diff --git a/site/assets/shots/ar/connection-light.webp b/site/assets/shots/ar/connection-light.webp index 0ea84acba..bef0f05af 100644 Binary files a/site/assets/shots/ar/connection-light.webp and b/site/assets/shots/ar/connection-light.webp differ diff --git a/site/assets/shots/ar/consoles-dark.webp b/site/assets/shots/ar/consoles-dark.webp index e8b4bb778..6ede0fffe 100644 Binary files a/site/assets/shots/ar/consoles-dark.webp and b/site/assets/shots/ar/consoles-dark.webp differ diff --git a/site/assets/shots/ar/consoles-light.webp b/site/assets/shots/ar/consoles-light.webp index b99243d30..46fa9509d 100644 Binary files a/site/assets/shots/ar/consoles-light.webp and b/site/assets/shots/ar/consoles-light.webp differ diff --git a/site/assets/shots/ar/files-dark.webp b/site/assets/shots/ar/files-dark.webp index 3d79af3ea..7ee2ad96e 100644 Binary files a/site/assets/shots/ar/files-dark.webp and b/site/assets/shots/ar/files-dark.webp differ diff --git a/site/assets/shots/ar/files-light.webp b/site/assets/shots/ar/files-light.webp index cc3b4d5e2..65f07650a 100644 Binary files a/site/assets/shots/ar/files-light.webp and b/site/assets/shots/ar/files-light.webp differ diff --git a/site/assets/shots/ar/games-dark.webp b/site/assets/shots/ar/games-dark.webp index 5a55d3ec9..707bc5048 100644 Binary files a/site/assets/shots/ar/games-dark.webp and b/site/assets/shots/ar/games-dark.webp differ diff --git a/site/assets/shots/ar/games-light.webp b/site/assets/shots/ar/games-light.webp index 588d8e107..20dce53c5 100644 Binary files a/site/assets/shots/ar/games-light.webp and b/site/assets/shots/ar/games-light.webp differ diff --git a/site/assets/shots/ar/home-dark.webp b/site/assets/shots/ar/home-dark.webp index b5086976d..79585ef3d 100644 Binary files a/site/assets/shots/ar/home-dark.webp and b/site/assets/shots/ar/home-dark.webp differ diff --git a/site/assets/shots/ar/home-light.webp b/site/assets/shots/ar/home-light.webp index da22cbdb0..20b74bd29 100644 Binary files a/site/assets/shots/ar/home-light.webp and b/site/assets/shots/ar/home-light.webp differ diff --git a/site/assets/shots/ar/invite-dark.webp b/site/assets/shots/ar/invite-dark.webp index 584e35fce..6b960beba 100644 Binary files a/site/assets/shots/ar/invite-dark.webp and b/site/assets/shots/ar/invite-dark.webp differ diff --git a/site/assets/shots/ar/invite-light.webp b/site/assets/shots/ar/invite-light.webp index 0207796c7..7f259bf6c 100644 Binary files a/site/assets/shots/ar/invite-light.webp and b/site/assets/shots/ar/invite-light.webp differ diff --git a/site/assets/shots/ar/kbm-dark.webp b/site/assets/shots/ar/kbm-dark.webp index 30ceaf9d2..123fe56df 100644 Binary files a/site/assets/shots/ar/kbm-dark.webp and b/site/assets/shots/ar/kbm-dark.webp differ diff --git a/site/assets/shots/ar/kbm-light.webp b/site/assets/shots/ar/kbm-light.webp index f5349e0e1..2c485f0f4 100644 Binary files a/site/assets/shots/ar/kbm-light.webp and b/site/assets/shots/ar/kbm-light.webp differ diff --git a/site/assets/shots/ar/m-files-dark.webp b/site/assets/shots/ar/m-files-dark.webp index f61daae32..e964262d3 100644 Binary files a/site/assets/shots/ar/m-files-dark.webp and b/site/assets/shots/ar/m-files-dark.webp differ diff --git a/site/assets/shots/ar/m-files-light.webp b/site/assets/shots/ar/m-files-light.webp index 711d64f9c..fd2a07423 100644 Binary files a/site/assets/shots/ar/m-files-light.webp and b/site/assets/shots/ar/m-files-light.webp differ diff --git a/site/assets/shots/ar/m-games-dark.webp b/site/assets/shots/ar/m-games-dark.webp index 07f1b2770..767ca945d 100644 Binary files a/site/assets/shots/ar/m-games-dark.webp and b/site/assets/shots/ar/m-games-dark.webp differ diff --git a/site/assets/shots/ar/m-games-light.webp b/site/assets/shots/ar/m-games-light.webp index 47cf9b873..8cd08aba1 100644 Binary files a/site/assets/shots/ar/m-games-light.webp and b/site/assets/shots/ar/m-games-light.webp differ diff --git a/site/assets/shots/ar/m-guest-dark.webp b/site/assets/shots/ar/m-guest-dark.webp index d68da1409..cfbcc9ed3 100644 Binary files a/site/assets/shots/ar/m-guest-dark.webp and b/site/assets/shots/ar/m-guest-dark.webp differ diff --git a/site/assets/shots/ar/m-home-dark.webp b/site/assets/shots/ar/m-home-dark.webp index 517bb88ea..07f7facd4 100644 Binary files a/site/assets/shots/ar/m-home-dark.webp and b/site/assets/shots/ar/m-home-dark.webp differ diff --git a/site/assets/shots/ar/m-home-light.webp b/site/assets/shots/ar/m-home-light.webp index a4a91a457..bc4c858cf 100644 Binary files a/site/assets/shots/ar/m-home-light.webp and b/site/assets/shots/ar/m-home-light.webp differ diff --git a/site/assets/shots/ar/m-play-dark.webp b/site/assets/shots/ar/m-play-dark.webp index ac6c1afbb..f38268122 100644 Binary files a/site/assets/shots/ar/m-play-dark.webp and b/site/assets/shots/ar/m-play-dark.webp differ diff --git a/site/assets/shots/ar/m-play-light.webp b/site/assets/shots/ar/m-play-light.webp index 44360acb4..ce2e74a7e 100644 Binary files a/site/assets/shots/ar/m-play-light.webp and b/site/assets/shots/ar/m-play-light.webp differ diff --git a/site/assets/shots/ar/phones-dark.webp b/site/assets/shots/ar/phones-dark.webp index 856419c2f..c6d897b5c 100644 Binary files a/site/assets/shots/ar/phones-dark.webp and b/site/assets/shots/ar/phones-dark.webp differ diff --git a/site/assets/shots/ar/phones-light.webp b/site/assets/shots/ar/phones-light.webp index 348ec90ad..5dd8dc0bf 100644 Binary files a/site/assets/shots/ar/phones-light.webp and b/site/assets/shots/ar/phones-light.webp differ diff --git a/site/assets/shots/ar/pkg-name-dark.webp b/site/assets/shots/ar/pkg-name-dark.webp index 5ae4b7c98..54b5a05bd 100644 Binary files a/site/assets/shots/ar/pkg-name-dark.webp and b/site/assets/shots/ar/pkg-name-dark.webp differ diff --git a/site/assets/shots/ar/pkg-name-light.webp b/site/assets/shots/ar/pkg-name-light.webp index b7c3c2df4..5d98f1265 100644 Binary files a/site/assets/shots/ar/pkg-name-light.webp and b/site/assets/shots/ar/pkg-name-light.webp differ diff --git a/site/assets/shots/ar/play-dark.webp b/site/assets/shots/ar/play-dark.webp index c19dd1434..f21ee3723 100644 Binary files a/site/assets/shots/ar/play-dark.webp and b/site/assets/shots/ar/play-dark.webp differ diff --git a/site/assets/shots/ar/play-light.webp b/site/assets/shots/ar/play-light.webp index 434fd3198..5ea66f76c 100644 Binary files a/site/assets/shots/ar/play-light.webp and b/site/assets/shots/ar/play-light.webp differ diff --git a/site/assets/shots/ar/receive-dark.webp b/site/assets/shots/ar/receive-dark.webp index 459745c55..30d129b0a 100644 Binary files a/site/assets/shots/ar/receive-dark.webp and b/site/assets/shots/ar/receive-dark.webp differ diff --git a/site/assets/shots/ar/receive-light.webp b/site/assets/shots/ar/receive-light.webp index a5a76c5b5..ad89b27ef 100644 Binary files a/site/assets/shots/ar/receive-light.webp and b/site/assets/shots/ar/receive-light.webp differ diff --git a/site/assets/shots/ar/setup-dark.webp b/site/assets/shots/ar/setup-dark.webp index fa9e675d7..24b4a144d 100644 Binary files a/site/assets/shots/ar/setup-dark.webp and b/site/assets/shots/ar/setup-dark.webp differ diff --git a/site/assets/shots/ar/setup-light.webp b/site/assets/shots/ar/setup-light.webp index 00b5cfacb..12bdc31a1 100644 Binary files a/site/assets/shots/ar/setup-light.webp and b/site/assets/shots/ar/setup-light.webp differ diff --git a/site/assets/shots/ar/share-dark.webp b/site/assets/shots/ar/share-dark.webp index 1554b46b2..0b934ad52 100644 Binary files a/site/assets/shots/ar/share-dark.webp and b/site/assets/shots/ar/share-dark.webp differ diff --git a/site/assets/shots/ar/share-light.webp b/site/assets/shots/ar/share-light.webp index 66898e8fc..5aba2061b 100644 Binary files a/site/assets/shots/ar/share-light.webp and b/site/assets/shots/ar/share-light.webp differ diff --git a/site/assets/shots/ar/share-link-dark.webp b/site/assets/shots/ar/share-link-dark.webp index 5a428eeb8..6cd84cb4f 100644 Binary files a/site/assets/shots/ar/share-link-dark.webp and b/site/assets/shots/ar/share-link-dark.webp differ diff --git a/site/assets/shots/ar/share-link-light.webp b/site/assets/shots/ar/share-link-light.webp index e04e8035f..f01ffe15b 100644 Binary files a/site/assets/shots/ar/share-link-light.webp and b/site/assets/shots/ar/share-link-light.webp differ diff --git a/site/assets/shots/ar/tailscale-connection-dark.webp b/site/assets/shots/ar/tailscale-connection-dark.webp index 17f905401..4cc89bf5d 100644 Binary files a/site/assets/shots/ar/tailscale-connection-dark.webp and b/site/assets/shots/ar/tailscale-connection-dark.webp differ diff --git a/site/assets/shots/ar/tailscale-connection-light.webp b/site/assets/shots/ar/tailscale-connection-light.webp index 37ece62f3..f79f07d52 100644 Binary files a/site/assets/shots/ar/tailscale-connection-light.webp and b/site/assets/shots/ar/tailscale-connection-light.webp differ diff --git a/site/assets/shots/ar/tailscale-settings-dark.webp b/site/assets/shots/ar/tailscale-settings-dark.webp index 5593b8766..68623fa71 100644 Binary files a/site/assets/shots/ar/tailscale-settings-dark.webp and b/site/assets/shots/ar/tailscale-settings-dark.webp differ diff --git a/site/assets/shots/ar/tailscale-settings-light.webp b/site/assets/shots/ar/tailscale-settings-light.webp index fd2a319ba..0b4776c3c 100644 Binary files a/site/assets/shots/ar/tailscale-settings-light.webp and b/site/assets/shots/ar/tailscale-settings-light.webp differ diff --git a/site/assets/shots/ar/together-net-dark.webp b/site/assets/shots/ar/together-net-dark.webp index b09d77757..9befc1186 100644 Binary files a/site/assets/shots/ar/together-net-dark.webp and b/site/assets/shots/ar/together-net-dark.webp differ diff --git a/site/assets/shots/ar/together-net-light.webp b/site/assets/shots/ar/together-net-light.webp index 32d0e7f6a..0c48f970c 100644 Binary files a/site/assets/shots/ar/together-net-light.webp and b/site/assets/shots/ar/together-net-light.webp differ diff --git a/site/assets/shots/ar/together-tab-dark.webp b/site/assets/shots/ar/together-tab-dark.webp index 166684e08..791370ffc 100644 Binary files a/site/assets/shots/ar/together-tab-dark.webp and b/site/assets/shots/ar/together-tab-dark.webp differ diff --git a/site/assets/shots/ar/together-tab-light.webp b/site/assets/shots/ar/together-tab-light.webp index ab3359bde..db8a2e2fc 100644 Binary files a/site/assets/shots/ar/together-tab-light.webp and b/site/assets/shots/ar/together-tab-light.webp differ diff --git a/site/assets/shots/ar/ts-found-dark.webp b/site/assets/shots/ar/ts-found-dark.webp index 3e5638cb6..d967feda5 100644 Binary files a/site/assets/shots/ar/ts-found-dark.webp and b/site/assets/shots/ar/ts-found-dark.webp differ diff --git a/site/assets/shots/ar/ts-found-light.webp b/site/assets/shots/ar/ts-found-light.webp index 923c00447..688ee4f28 100644 Binary files a/site/assets/shots/ar/ts-found-light.webp and b/site/assets/shots/ar/ts-found-light.webp differ diff --git a/site/assets/shots/ar/upload-dark.webp b/site/assets/shots/ar/upload-dark.webp index b0eb2e6d3..32f0bc686 100644 Binary files a/site/assets/shots/ar/upload-dark.webp and b/site/assets/shots/ar/upload-dark.webp differ diff --git a/site/assets/shots/ar/upload-light.webp b/site/assets/shots/ar/upload-light.webp index 825a13d31..a237975f9 100644 Binary files a/site/assets/shots/ar/upload-light.webp and b/site/assets/shots/ar/upload-light.webp differ diff --git a/site/assets/shots/ar/workshop-dark.webp b/site/assets/shots/ar/workshop-dark.webp index 853961b0b..33a00b574 100644 Binary files a/site/assets/shots/ar/workshop-dark.webp and b/site/assets/shots/ar/workshop-dark.webp differ diff --git a/site/assets/shots/ar/workshop-light.webp b/site/assets/shots/ar/workshop-light.webp index e55d9e0e6..3b32275d0 100644 Binary files a/site/assets/shots/ar/workshop-light.webp and b/site/assets/shots/ar/workshop-light.webp differ diff --git a/site/assets/shots/bn/add-ps5-dark.webp b/site/assets/shots/bn/add-ps5-dark.webp index 4e9aa00d6..e215009a3 100644 Binary files a/site/assets/shots/bn/add-ps5-dark.webp and b/site/assets/shots/bn/add-ps5-dark.webp differ diff --git a/site/assets/shots/bn/add-ps5-light.webp b/site/assets/shots/bn/add-ps5-light.webp index f9ceb28d2..80ea5a174 100644 Binary files a/site/assets/shots/bn/add-ps5-light.webp and b/site/assets/shots/bn/add-ps5-light.webp differ diff --git a/site/assets/shots/bn/approval-dark.webp b/site/assets/shots/bn/approval-dark.webp index 104bf2a47..359c151d5 100644 Binary files a/site/assets/shots/bn/approval-dark.webp and b/site/assets/shots/bn/approval-dark.webp differ diff --git a/site/assets/shots/bn/approval-light.webp b/site/assets/shots/bn/approval-light.webp index 112339f84..9cb52375e 100644 Binary files a/site/assets/shots/bn/approval-light.webp and b/site/assets/shots/bn/approval-light.webp differ diff --git a/site/assets/shots/bn/connection-dark.webp b/site/assets/shots/bn/connection-dark.webp index 9f7a7ee41..1f780eddb 100644 Binary files a/site/assets/shots/bn/connection-dark.webp and b/site/assets/shots/bn/connection-dark.webp differ diff --git a/site/assets/shots/bn/connection-light.webp b/site/assets/shots/bn/connection-light.webp index 5df75b91d..a96495726 100644 Binary files a/site/assets/shots/bn/connection-light.webp and b/site/assets/shots/bn/connection-light.webp differ diff --git a/site/assets/shots/bn/consoles-dark.webp b/site/assets/shots/bn/consoles-dark.webp index 20a617183..60a2859e1 100644 Binary files a/site/assets/shots/bn/consoles-dark.webp and b/site/assets/shots/bn/consoles-dark.webp differ diff --git a/site/assets/shots/bn/consoles-light.webp b/site/assets/shots/bn/consoles-light.webp index eeebee2fb..b8e0c9064 100644 Binary files a/site/assets/shots/bn/consoles-light.webp and b/site/assets/shots/bn/consoles-light.webp differ diff --git a/site/assets/shots/bn/files-dark.webp b/site/assets/shots/bn/files-dark.webp index 39eb33e84..5c3918c77 100644 Binary files a/site/assets/shots/bn/files-dark.webp and b/site/assets/shots/bn/files-dark.webp differ diff --git a/site/assets/shots/bn/files-light.webp b/site/assets/shots/bn/files-light.webp index ce46e62e7..2b8c6ab45 100644 Binary files a/site/assets/shots/bn/files-light.webp and b/site/assets/shots/bn/files-light.webp differ diff --git a/site/assets/shots/bn/games-dark.webp b/site/assets/shots/bn/games-dark.webp index 6128f167b..f8173ce87 100644 Binary files a/site/assets/shots/bn/games-dark.webp and b/site/assets/shots/bn/games-dark.webp differ diff --git a/site/assets/shots/bn/games-light.webp b/site/assets/shots/bn/games-light.webp index 147967442..532387067 100644 Binary files a/site/assets/shots/bn/games-light.webp and b/site/assets/shots/bn/games-light.webp differ diff --git a/site/assets/shots/bn/home-dark.webp b/site/assets/shots/bn/home-dark.webp index eb03aafef..90d13176c 100644 Binary files a/site/assets/shots/bn/home-dark.webp and b/site/assets/shots/bn/home-dark.webp differ diff --git a/site/assets/shots/bn/home-light.webp b/site/assets/shots/bn/home-light.webp index 06239ab2e..2cc9231d8 100644 Binary files a/site/assets/shots/bn/home-light.webp and b/site/assets/shots/bn/home-light.webp differ diff --git a/site/assets/shots/bn/invite-dark.webp b/site/assets/shots/bn/invite-dark.webp index 74eae9d57..a9c569638 100644 Binary files a/site/assets/shots/bn/invite-dark.webp and b/site/assets/shots/bn/invite-dark.webp differ diff --git a/site/assets/shots/bn/invite-light.webp b/site/assets/shots/bn/invite-light.webp index 07164d2a0..289138005 100644 Binary files a/site/assets/shots/bn/invite-light.webp and b/site/assets/shots/bn/invite-light.webp differ diff --git a/site/assets/shots/bn/kbm-dark.webp b/site/assets/shots/bn/kbm-dark.webp index 6c4277ebe..e76ad9537 100644 Binary files a/site/assets/shots/bn/kbm-dark.webp and b/site/assets/shots/bn/kbm-dark.webp differ diff --git a/site/assets/shots/bn/kbm-light.webp b/site/assets/shots/bn/kbm-light.webp index 9c7c2531e..ca3f03d99 100644 Binary files a/site/assets/shots/bn/kbm-light.webp and b/site/assets/shots/bn/kbm-light.webp differ diff --git a/site/assets/shots/bn/kbm-settings-dark.webp b/site/assets/shots/bn/kbm-settings-dark.webp index 7b55a96a9..3527d27ec 100644 Binary files a/site/assets/shots/bn/kbm-settings-dark.webp and b/site/assets/shots/bn/kbm-settings-dark.webp differ diff --git a/site/assets/shots/bn/kbm-settings-light.webp b/site/assets/shots/bn/kbm-settings-light.webp index 92483f73d..6056af88b 100644 Binary files a/site/assets/shots/bn/kbm-settings-light.webp and b/site/assets/shots/bn/kbm-settings-light.webp differ diff --git a/site/assets/shots/bn/m-files-dark.webp b/site/assets/shots/bn/m-files-dark.webp index 98a79bd87..1d709afae 100644 Binary files a/site/assets/shots/bn/m-files-dark.webp and b/site/assets/shots/bn/m-files-dark.webp differ diff --git a/site/assets/shots/bn/m-files-light.webp b/site/assets/shots/bn/m-files-light.webp index 870ee931c..bbf4aeb3b 100644 Binary files a/site/assets/shots/bn/m-files-light.webp and b/site/assets/shots/bn/m-files-light.webp differ diff --git a/site/assets/shots/bn/m-games-dark.webp b/site/assets/shots/bn/m-games-dark.webp index 081cf7e5f..7888f974a 100644 Binary files a/site/assets/shots/bn/m-games-dark.webp and b/site/assets/shots/bn/m-games-dark.webp differ diff --git a/site/assets/shots/bn/m-games-light.webp b/site/assets/shots/bn/m-games-light.webp index 4230f5957..e288441ea 100644 Binary files a/site/assets/shots/bn/m-games-light.webp and b/site/assets/shots/bn/m-games-light.webp differ diff --git a/site/assets/shots/bn/m-guest-dark.webp b/site/assets/shots/bn/m-guest-dark.webp index fae875a7e..8f9b7b740 100644 Binary files a/site/assets/shots/bn/m-guest-dark.webp and b/site/assets/shots/bn/m-guest-dark.webp differ diff --git a/site/assets/shots/bn/m-guest-light.webp b/site/assets/shots/bn/m-guest-light.webp index 134d917a4..8c11bd43a 100644 Binary files a/site/assets/shots/bn/m-guest-light.webp and b/site/assets/shots/bn/m-guest-light.webp differ diff --git a/site/assets/shots/bn/m-home-dark.webp b/site/assets/shots/bn/m-home-dark.webp index 53be5aa5f..e3c64fcdb 100644 Binary files a/site/assets/shots/bn/m-home-dark.webp and b/site/assets/shots/bn/m-home-dark.webp differ diff --git a/site/assets/shots/bn/m-home-light.webp b/site/assets/shots/bn/m-home-light.webp index ee3d0b024..77b260a93 100644 Binary files a/site/assets/shots/bn/m-home-light.webp and b/site/assets/shots/bn/m-home-light.webp differ diff --git a/site/assets/shots/bn/m-play-dark.webp b/site/assets/shots/bn/m-play-dark.webp index 349e136bb..b9f9c2c5f 100644 Binary files a/site/assets/shots/bn/m-play-dark.webp and b/site/assets/shots/bn/m-play-dark.webp differ diff --git a/site/assets/shots/bn/m-play-light.webp b/site/assets/shots/bn/m-play-light.webp index f5f42cca5..2ae7a1da8 100644 Binary files a/site/assets/shots/bn/m-play-light.webp and b/site/assets/shots/bn/m-play-light.webp differ diff --git a/site/assets/shots/bn/phones-dark.webp b/site/assets/shots/bn/phones-dark.webp index 8e4040eb4..72a916de2 100644 Binary files a/site/assets/shots/bn/phones-dark.webp and b/site/assets/shots/bn/phones-dark.webp differ diff --git a/site/assets/shots/bn/phones-light.webp b/site/assets/shots/bn/phones-light.webp index 688821a9a..444d28cb7 100644 Binary files a/site/assets/shots/bn/phones-light.webp and b/site/assets/shots/bn/phones-light.webp differ diff --git a/site/assets/shots/bn/pkg-name-dark.webp b/site/assets/shots/bn/pkg-name-dark.webp index a0ff9e491..cec68525e 100644 Binary files a/site/assets/shots/bn/pkg-name-dark.webp and b/site/assets/shots/bn/pkg-name-dark.webp differ diff --git a/site/assets/shots/bn/pkg-name-light.webp b/site/assets/shots/bn/pkg-name-light.webp index b22696cca..ba13b7975 100644 Binary files a/site/assets/shots/bn/pkg-name-light.webp and b/site/assets/shots/bn/pkg-name-light.webp differ diff --git a/site/assets/shots/bn/play-dark.webp b/site/assets/shots/bn/play-dark.webp index 67428dbdb..c36ce6944 100644 Binary files a/site/assets/shots/bn/play-dark.webp and b/site/assets/shots/bn/play-dark.webp differ diff --git a/site/assets/shots/bn/play-light.webp b/site/assets/shots/bn/play-light.webp index 448ef12b3..6e9ec4641 100644 Binary files a/site/assets/shots/bn/play-light.webp and b/site/assets/shots/bn/play-light.webp differ diff --git a/site/assets/shots/bn/receive-dark.webp b/site/assets/shots/bn/receive-dark.webp index 52844a18a..e0e8240b1 100644 Binary files a/site/assets/shots/bn/receive-dark.webp and b/site/assets/shots/bn/receive-dark.webp differ diff --git a/site/assets/shots/bn/receive-light.webp b/site/assets/shots/bn/receive-light.webp index 2ab077120..c109b195d 100644 Binary files a/site/assets/shots/bn/receive-light.webp and b/site/assets/shots/bn/receive-light.webp differ diff --git a/site/assets/shots/bn/setup-dark.webp b/site/assets/shots/bn/setup-dark.webp index c79944d48..1d2f01514 100644 Binary files a/site/assets/shots/bn/setup-dark.webp and b/site/assets/shots/bn/setup-dark.webp differ diff --git a/site/assets/shots/bn/setup-light.webp b/site/assets/shots/bn/setup-light.webp index 7a56d8865..84dbd7e37 100644 Binary files a/site/assets/shots/bn/setup-light.webp and b/site/assets/shots/bn/setup-light.webp differ diff --git a/site/assets/shots/bn/share-dark.webp b/site/assets/shots/bn/share-dark.webp index a303f6178..26b615dd4 100644 Binary files a/site/assets/shots/bn/share-dark.webp and b/site/assets/shots/bn/share-dark.webp differ diff --git a/site/assets/shots/bn/share-light.webp b/site/assets/shots/bn/share-light.webp index 6e389197f..eebeaf190 100644 Binary files a/site/assets/shots/bn/share-light.webp and b/site/assets/shots/bn/share-light.webp differ diff --git a/site/assets/shots/bn/share-link-dark.webp b/site/assets/shots/bn/share-link-dark.webp index 03a640317..a789db390 100644 Binary files a/site/assets/shots/bn/share-link-dark.webp and b/site/assets/shots/bn/share-link-dark.webp differ diff --git a/site/assets/shots/bn/share-link-light.webp b/site/assets/shots/bn/share-link-light.webp index 149ba9bb8..6df7eeea0 100644 Binary files a/site/assets/shots/bn/share-link-light.webp and b/site/assets/shots/bn/share-link-light.webp differ diff --git a/site/assets/shots/bn/tailscale-connection-dark.webp b/site/assets/shots/bn/tailscale-connection-dark.webp index e5b7a0dcc..0d74819a2 100644 Binary files a/site/assets/shots/bn/tailscale-connection-dark.webp and b/site/assets/shots/bn/tailscale-connection-dark.webp differ diff --git a/site/assets/shots/bn/tailscale-connection-light.webp b/site/assets/shots/bn/tailscale-connection-light.webp index 77f8b7b1b..56ad0785c 100644 Binary files a/site/assets/shots/bn/tailscale-connection-light.webp and b/site/assets/shots/bn/tailscale-connection-light.webp differ diff --git a/site/assets/shots/bn/tailscale-settings-dark.webp b/site/assets/shots/bn/tailscale-settings-dark.webp index af5bef316..ae318732c 100644 Binary files a/site/assets/shots/bn/tailscale-settings-dark.webp and b/site/assets/shots/bn/tailscale-settings-dark.webp differ diff --git a/site/assets/shots/bn/tailscale-settings-light.webp b/site/assets/shots/bn/tailscale-settings-light.webp index 094704b9c..4b7a945c8 100644 Binary files a/site/assets/shots/bn/tailscale-settings-light.webp and b/site/assets/shots/bn/tailscale-settings-light.webp differ diff --git a/site/assets/shots/bn/together-net-dark.webp b/site/assets/shots/bn/together-net-dark.webp index 41d1a9428..c7b415b64 100644 Binary files a/site/assets/shots/bn/together-net-dark.webp and b/site/assets/shots/bn/together-net-dark.webp differ diff --git a/site/assets/shots/bn/together-net-light.webp b/site/assets/shots/bn/together-net-light.webp index 13e2e462a..40f94fe6f 100644 Binary files a/site/assets/shots/bn/together-net-light.webp and b/site/assets/shots/bn/together-net-light.webp differ diff --git a/site/assets/shots/bn/together-tab-dark.webp b/site/assets/shots/bn/together-tab-dark.webp index 4bd2e9600..fe1a765d0 100644 Binary files a/site/assets/shots/bn/together-tab-dark.webp and b/site/assets/shots/bn/together-tab-dark.webp differ diff --git a/site/assets/shots/bn/together-tab-light.webp b/site/assets/shots/bn/together-tab-light.webp index 1ac9e4a4a..5d0486e33 100644 Binary files a/site/assets/shots/bn/together-tab-light.webp and b/site/assets/shots/bn/together-tab-light.webp differ diff --git a/site/assets/shots/bn/ts-found-dark.webp b/site/assets/shots/bn/ts-found-dark.webp index bddd869b8..2d66313d0 100644 Binary files a/site/assets/shots/bn/ts-found-dark.webp and b/site/assets/shots/bn/ts-found-dark.webp differ diff --git a/site/assets/shots/bn/ts-found-light.webp b/site/assets/shots/bn/ts-found-light.webp index 42b365337..806f4937c 100644 Binary files a/site/assets/shots/bn/ts-found-light.webp and b/site/assets/shots/bn/ts-found-light.webp differ diff --git a/site/assets/shots/bn/upload-dark.webp b/site/assets/shots/bn/upload-dark.webp index 39fa9abaa..caf76a9ed 100644 Binary files a/site/assets/shots/bn/upload-dark.webp and b/site/assets/shots/bn/upload-dark.webp differ diff --git a/site/assets/shots/bn/upload-light.webp b/site/assets/shots/bn/upload-light.webp index eb65f93fa..ffa8067ef 100644 Binary files a/site/assets/shots/bn/upload-light.webp and b/site/assets/shots/bn/upload-light.webp differ diff --git a/site/assets/shots/bn/workshop-dark.webp b/site/assets/shots/bn/workshop-dark.webp index 3d2064953..baa3399c9 100644 Binary files a/site/assets/shots/bn/workshop-dark.webp and b/site/assets/shots/bn/workshop-dark.webp differ diff --git a/site/assets/shots/bn/workshop-light.webp b/site/assets/shots/bn/workshop-light.webp index f20563fc9..a9a4c3ac5 100644 Binary files a/site/assets/shots/bn/workshop-light.webp and b/site/assets/shots/bn/workshop-light.webp differ diff --git a/site/assets/shots/connection-dark.webp b/site/assets/shots/connection-dark.webp index 75559277b..6ad8b642d 100644 Binary files a/site/assets/shots/connection-dark.webp and b/site/assets/shots/connection-dark.webp differ diff --git a/site/assets/shots/connection-light.webp b/site/assets/shots/connection-light.webp index 5b2fea26f..89b9a8245 100644 Binary files a/site/assets/shots/connection-light.webp and b/site/assets/shots/connection-light.webp differ diff --git a/site/assets/shots/consoles-dark.webp b/site/assets/shots/consoles-dark.webp index b2e1b27ce..bd1d14a1c 100644 Binary files a/site/assets/shots/consoles-dark.webp and b/site/assets/shots/consoles-dark.webp differ diff --git a/site/assets/shots/consoles-light.webp b/site/assets/shots/consoles-light.webp index ffa04b789..913b28d71 100644 Binary files a/site/assets/shots/consoles-light.webp and b/site/assets/shots/consoles-light.webp differ diff --git a/site/assets/shots/de/add-ps5-dark.webp b/site/assets/shots/de/add-ps5-dark.webp index c986ea660..2f6c9c87a 100644 Binary files a/site/assets/shots/de/add-ps5-dark.webp and b/site/assets/shots/de/add-ps5-dark.webp differ diff --git a/site/assets/shots/de/add-ps5-light.webp b/site/assets/shots/de/add-ps5-light.webp index cc4bd9f26..29a60952b 100644 Binary files a/site/assets/shots/de/add-ps5-light.webp and b/site/assets/shots/de/add-ps5-light.webp differ diff --git a/site/assets/shots/de/approval-dark.webp b/site/assets/shots/de/approval-dark.webp index 8f527e223..c38972b63 100644 Binary files a/site/assets/shots/de/approval-dark.webp and b/site/assets/shots/de/approval-dark.webp differ diff --git a/site/assets/shots/de/approval-light.webp b/site/assets/shots/de/approval-light.webp index b9fb6143c..12c058698 100644 Binary files a/site/assets/shots/de/approval-light.webp and b/site/assets/shots/de/approval-light.webp differ diff --git a/site/assets/shots/de/connection-dark.webp b/site/assets/shots/de/connection-dark.webp index e607b680c..cb804b900 100644 Binary files a/site/assets/shots/de/connection-dark.webp and b/site/assets/shots/de/connection-dark.webp differ diff --git a/site/assets/shots/de/connection-light.webp b/site/assets/shots/de/connection-light.webp index a9979d27a..54aa1135b 100644 Binary files a/site/assets/shots/de/connection-light.webp and b/site/assets/shots/de/connection-light.webp differ diff --git a/site/assets/shots/de/consoles-dark.webp b/site/assets/shots/de/consoles-dark.webp index 74aa6a656..984ccf98a 100644 Binary files a/site/assets/shots/de/consoles-dark.webp and b/site/assets/shots/de/consoles-dark.webp differ diff --git a/site/assets/shots/de/consoles-light.webp b/site/assets/shots/de/consoles-light.webp index 9d94be298..5d66f205f 100644 Binary files a/site/assets/shots/de/consoles-light.webp and b/site/assets/shots/de/consoles-light.webp differ diff --git a/site/assets/shots/de/files-dark.webp b/site/assets/shots/de/files-dark.webp index 4b9934220..a75312ed2 100644 Binary files a/site/assets/shots/de/files-dark.webp and b/site/assets/shots/de/files-dark.webp differ diff --git a/site/assets/shots/de/files-light.webp b/site/assets/shots/de/files-light.webp index 1b3cdda62..6bdfdc18d 100644 Binary files a/site/assets/shots/de/files-light.webp and b/site/assets/shots/de/files-light.webp differ diff --git a/site/assets/shots/de/games-dark.webp b/site/assets/shots/de/games-dark.webp index 753f5f2ba..31a004895 100644 Binary files a/site/assets/shots/de/games-dark.webp and b/site/assets/shots/de/games-dark.webp differ diff --git a/site/assets/shots/de/games-light.webp b/site/assets/shots/de/games-light.webp index 2be4f00d0..119656d73 100644 Binary files a/site/assets/shots/de/games-light.webp and b/site/assets/shots/de/games-light.webp differ diff --git a/site/assets/shots/de/home-dark.webp b/site/assets/shots/de/home-dark.webp index fb8de88c9..72f439476 100644 Binary files a/site/assets/shots/de/home-dark.webp and b/site/assets/shots/de/home-dark.webp differ diff --git a/site/assets/shots/de/home-light.webp b/site/assets/shots/de/home-light.webp index b95a77ec8..74206c652 100644 Binary files a/site/assets/shots/de/home-light.webp and b/site/assets/shots/de/home-light.webp differ diff --git a/site/assets/shots/de/invite-dark.webp b/site/assets/shots/de/invite-dark.webp index bfd8b2966..ff585317e 100644 Binary files a/site/assets/shots/de/invite-dark.webp and b/site/assets/shots/de/invite-dark.webp differ diff --git a/site/assets/shots/de/invite-light.webp b/site/assets/shots/de/invite-light.webp index 53b73185b..f80ec379a 100644 Binary files a/site/assets/shots/de/invite-light.webp and b/site/assets/shots/de/invite-light.webp differ diff --git a/site/assets/shots/de/kbm-dark.webp b/site/assets/shots/de/kbm-dark.webp index e931e8d1a..5c552ad7d 100644 Binary files a/site/assets/shots/de/kbm-dark.webp and b/site/assets/shots/de/kbm-dark.webp differ diff --git a/site/assets/shots/de/kbm-light.webp b/site/assets/shots/de/kbm-light.webp index 4883f3c9e..638d5fd2f 100644 Binary files a/site/assets/shots/de/kbm-light.webp and b/site/assets/shots/de/kbm-light.webp differ diff --git a/site/assets/shots/de/kbm-settings-dark.webp b/site/assets/shots/de/kbm-settings-dark.webp index 0739304b1..56ca7ee2d 100644 Binary files a/site/assets/shots/de/kbm-settings-dark.webp and b/site/assets/shots/de/kbm-settings-dark.webp differ diff --git a/site/assets/shots/de/kbm-settings-light.webp b/site/assets/shots/de/kbm-settings-light.webp index cc7e139ef..4ff8fd954 100644 Binary files a/site/assets/shots/de/kbm-settings-light.webp and b/site/assets/shots/de/kbm-settings-light.webp differ diff --git a/site/assets/shots/de/m-files-dark.webp b/site/assets/shots/de/m-files-dark.webp index 01a740de0..f2885121d 100644 Binary files a/site/assets/shots/de/m-files-dark.webp and b/site/assets/shots/de/m-files-dark.webp differ diff --git a/site/assets/shots/de/m-files-light.webp b/site/assets/shots/de/m-files-light.webp index 0de8bda17..70fb647e2 100644 Binary files a/site/assets/shots/de/m-files-light.webp and b/site/assets/shots/de/m-files-light.webp differ diff --git a/site/assets/shots/de/m-games-dark.webp b/site/assets/shots/de/m-games-dark.webp index 999c661d0..2b4c5f22a 100644 Binary files a/site/assets/shots/de/m-games-dark.webp and b/site/assets/shots/de/m-games-dark.webp differ diff --git a/site/assets/shots/de/m-games-light.webp b/site/assets/shots/de/m-games-light.webp index 769205438..95aa23a5f 100644 Binary files a/site/assets/shots/de/m-games-light.webp and b/site/assets/shots/de/m-games-light.webp differ diff --git a/site/assets/shots/de/m-guest-dark.webp b/site/assets/shots/de/m-guest-dark.webp index d0169f526..8f9b7b740 100644 Binary files a/site/assets/shots/de/m-guest-dark.webp and b/site/assets/shots/de/m-guest-dark.webp differ diff --git a/site/assets/shots/de/m-guest-light.webp b/site/assets/shots/de/m-guest-light.webp index a712cba8c..8c11bd43a 100644 Binary files a/site/assets/shots/de/m-guest-light.webp and b/site/assets/shots/de/m-guest-light.webp differ diff --git a/site/assets/shots/de/m-home-dark.webp b/site/assets/shots/de/m-home-dark.webp index 23a4f4dc5..145a25b1b 100644 Binary files a/site/assets/shots/de/m-home-dark.webp and b/site/assets/shots/de/m-home-dark.webp differ diff --git a/site/assets/shots/de/m-home-light.webp b/site/assets/shots/de/m-home-light.webp index 48290dca6..10fc9bb8e 100644 Binary files a/site/assets/shots/de/m-home-light.webp and b/site/assets/shots/de/m-home-light.webp differ diff --git a/site/assets/shots/de/m-play-dark.webp b/site/assets/shots/de/m-play-dark.webp index daef06acb..a06813c2c 100644 Binary files a/site/assets/shots/de/m-play-dark.webp and b/site/assets/shots/de/m-play-dark.webp differ diff --git a/site/assets/shots/de/m-play-light.webp b/site/assets/shots/de/m-play-light.webp index 0bb6a0ce4..938fa8c58 100644 Binary files a/site/assets/shots/de/m-play-light.webp and b/site/assets/shots/de/m-play-light.webp differ diff --git a/site/assets/shots/de/phones-dark.webp b/site/assets/shots/de/phones-dark.webp index 69a12f6c9..476c35fe0 100644 Binary files a/site/assets/shots/de/phones-dark.webp and b/site/assets/shots/de/phones-dark.webp differ diff --git a/site/assets/shots/de/phones-light.webp b/site/assets/shots/de/phones-light.webp index 3a8beb573..95e385f70 100644 Binary files a/site/assets/shots/de/phones-light.webp and b/site/assets/shots/de/phones-light.webp differ diff --git a/site/assets/shots/de/pkg-name-dark.webp b/site/assets/shots/de/pkg-name-dark.webp index 03463f5f8..2ec9a3202 100644 Binary files a/site/assets/shots/de/pkg-name-dark.webp and b/site/assets/shots/de/pkg-name-dark.webp differ diff --git a/site/assets/shots/de/pkg-name-light.webp b/site/assets/shots/de/pkg-name-light.webp index c949ea996..b22104460 100644 Binary files a/site/assets/shots/de/pkg-name-light.webp and b/site/assets/shots/de/pkg-name-light.webp differ diff --git a/site/assets/shots/de/play-dark.webp b/site/assets/shots/de/play-dark.webp index 66a4a6fd9..39df8ecad 100644 Binary files a/site/assets/shots/de/play-dark.webp and b/site/assets/shots/de/play-dark.webp differ diff --git a/site/assets/shots/de/play-light.webp b/site/assets/shots/de/play-light.webp index 1cb80b5a8..d5350c480 100644 Binary files a/site/assets/shots/de/play-light.webp and b/site/assets/shots/de/play-light.webp differ diff --git a/site/assets/shots/de/receive-dark.webp b/site/assets/shots/de/receive-dark.webp index aa598d55d..89cd697b4 100644 Binary files a/site/assets/shots/de/receive-dark.webp and b/site/assets/shots/de/receive-dark.webp differ diff --git a/site/assets/shots/de/receive-light.webp b/site/assets/shots/de/receive-light.webp index 00716f84b..93cb173a7 100644 Binary files a/site/assets/shots/de/receive-light.webp and b/site/assets/shots/de/receive-light.webp differ diff --git a/site/assets/shots/de/setup-dark.webp b/site/assets/shots/de/setup-dark.webp index 98c923867..0e0680d60 100644 Binary files a/site/assets/shots/de/setup-dark.webp and b/site/assets/shots/de/setup-dark.webp differ diff --git a/site/assets/shots/de/setup-light.webp b/site/assets/shots/de/setup-light.webp index bffe6c1e1..0ad89edc0 100644 Binary files a/site/assets/shots/de/setup-light.webp and b/site/assets/shots/de/setup-light.webp differ diff --git a/site/assets/shots/de/share-dark.webp b/site/assets/shots/de/share-dark.webp index 8c9d25ef7..3f81fe3f7 100644 Binary files a/site/assets/shots/de/share-dark.webp and b/site/assets/shots/de/share-dark.webp differ diff --git a/site/assets/shots/de/share-light.webp b/site/assets/shots/de/share-light.webp index 97b5998d7..9aa38df62 100644 Binary files a/site/assets/shots/de/share-light.webp and b/site/assets/shots/de/share-light.webp differ diff --git a/site/assets/shots/de/share-link-dark.webp b/site/assets/shots/de/share-link-dark.webp index c76391e68..b7ff47007 100644 Binary files a/site/assets/shots/de/share-link-dark.webp and b/site/assets/shots/de/share-link-dark.webp differ diff --git a/site/assets/shots/de/share-link-light.webp b/site/assets/shots/de/share-link-light.webp index 022381f6a..d25915ae4 100644 Binary files a/site/assets/shots/de/share-link-light.webp and b/site/assets/shots/de/share-link-light.webp differ diff --git a/site/assets/shots/de/tailscale-connection-dark.webp b/site/assets/shots/de/tailscale-connection-dark.webp index 2f754d6a8..76e0cc5e1 100644 Binary files a/site/assets/shots/de/tailscale-connection-dark.webp and b/site/assets/shots/de/tailscale-connection-dark.webp differ diff --git a/site/assets/shots/de/tailscale-connection-light.webp b/site/assets/shots/de/tailscale-connection-light.webp index 26053dc1b..104d4c566 100644 Binary files a/site/assets/shots/de/tailscale-connection-light.webp and b/site/assets/shots/de/tailscale-connection-light.webp differ diff --git a/site/assets/shots/de/tailscale-settings-dark.webp b/site/assets/shots/de/tailscale-settings-dark.webp index cbad2641c..a85bf5c82 100644 Binary files a/site/assets/shots/de/tailscale-settings-dark.webp and b/site/assets/shots/de/tailscale-settings-dark.webp differ diff --git a/site/assets/shots/de/tailscale-settings-light.webp b/site/assets/shots/de/tailscale-settings-light.webp index 4b73dc442..a022bcc92 100644 Binary files a/site/assets/shots/de/tailscale-settings-light.webp and b/site/assets/shots/de/tailscale-settings-light.webp differ diff --git a/site/assets/shots/de/together-net-dark.webp b/site/assets/shots/de/together-net-dark.webp index ec14be34e..36eff49a0 100644 Binary files a/site/assets/shots/de/together-net-dark.webp and b/site/assets/shots/de/together-net-dark.webp differ diff --git a/site/assets/shots/de/together-net-light.webp b/site/assets/shots/de/together-net-light.webp index 3ff13ee3e..da4f00f40 100644 Binary files a/site/assets/shots/de/together-net-light.webp and b/site/assets/shots/de/together-net-light.webp differ diff --git a/site/assets/shots/de/together-tab-dark.webp b/site/assets/shots/de/together-tab-dark.webp index 1af6f1218..6045f4f79 100644 Binary files a/site/assets/shots/de/together-tab-dark.webp and b/site/assets/shots/de/together-tab-dark.webp differ diff --git a/site/assets/shots/de/together-tab-light.webp b/site/assets/shots/de/together-tab-light.webp index 3a730fee9..8ee4fefcf 100644 Binary files a/site/assets/shots/de/together-tab-light.webp and b/site/assets/shots/de/together-tab-light.webp differ diff --git a/site/assets/shots/de/ts-found-dark.webp b/site/assets/shots/de/ts-found-dark.webp index edbd1b7e7..40b4ddf66 100644 Binary files a/site/assets/shots/de/ts-found-dark.webp and b/site/assets/shots/de/ts-found-dark.webp differ diff --git a/site/assets/shots/de/ts-found-light.webp b/site/assets/shots/de/ts-found-light.webp index c5691227d..d363148c4 100644 Binary files a/site/assets/shots/de/ts-found-light.webp and b/site/assets/shots/de/ts-found-light.webp differ diff --git a/site/assets/shots/de/upload-dark.webp b/site/assets/shots/de/upload-dark.webp index 3d9e83298..7c4a9ff5d 100644 Binary files a/site/assets/shots/de/upload-dark.webp and b/site/assets/shots/de/upload-dark.webp differ diff --git a/site/assets/shots/de/upload-light.webp b/site/assets/shots/de/upload-light.webp index 15eb0847c..953c7f7e8 100644 Binary files a/site/assets/shots/de/upload-light.webp and b/site/assets/shots/de/upload-light.webp differ diff --git a/site/assets/shots/de/workshop-dark.webp b/site/assets/shots/de/workshop-dark.webp index 667a5d2be..f5fc16ed0 100644 Binary files a/site/assets/shots/de/workshop-dark.webp and b/site/assets/shots/de/workshop-dark.webp differ diff --git a/site/assets/shots/de/workshop-light.webp b/site/assets/shots/de/workshop-light.webp index 4acd0aff8..64df974e7 100644 Binary files a/site/assets/shots/de/workshop-light.webp and b/site/assets/shots/de/workshop-light.webp differ diff --git a/site/assets/shots/es/add-ps5-dark.webp b/site/assets/shots/es/add-ps5-dark.webp index c17136325..bdf7745ca 100644 Binary files a/site/assets/shots/es/add-ps5-dark.webp and b/site/assets/shots/es/add-ps5-dark.webp differ diff --git a/site/assets/shots/es/add-ps5-light.webp b/site/assets/shots/es/add-ps5-light.webp index 53aff42d6..aac0a5bc2 100644 Binary files a/site/assets/shots/es/add-ps5-light.webp and b/site/assets/shots/es/add-ps5-light.webp differ diff --git a/site/assets/shots/es/approval-dark.webp b/site/assets/shots/es/approval-dark.webp index 94aed0a62..917398732 100644 Binary files a/site/assets/shots/es/approval-dark.webp and b/site/assets/shots/es/approval-dark.webp differ diff --git a/site/assets/shots/es/approval-light.webp b/site/assets/shots/es/approval-light.webp index 949b4dcb6..42fd74546 100644 Binary files a/site/assets/shots/es/approval-light.webp and b/site/assets/shots/es/approval-light.webp differ diff --git a/site/assets/shots/es/connection-dark.webp b/site/assets/shots/es/connection-dark.webp index cc079ae7e..09bf5abc0 100644 Binary files a/site/assets/shots/es/connection-dark.webp and b/site/assets/shots/es/connection-dark.webp differ diff --git a/site/assets/shots/es/connection-light.webp b/site/assets/shots/es/connection-light.webp index 35ec38508..bba617cc2 100644 Binary files a/site/assets/shots/es/connection-light.webp and b/site/assets/shots/es/connection-light.webp differ diff --git a/site/assets/shots/es/consoles-dark.webp b/site/assets/shots/es/consoles-dark.webp index 2579681f9..4fba7bd00 100644 Binary files a/site/assets/shots/es/consoles-dark.webp and b/site/assets/shots/es/consoles-dark.webp differ diff --git a/site/assets/shots/es/consoles-light.webp b/site/assets/shots/es/consoles-light.webp index 3872a2879..1de1899f6 100644 Binary files a/site/assets/shots/es/consoles-light.webp and b/site/assets/shots/es/consoles-light.webp differ diff --git a/site/assets/shots/es/files-dark.webp b/site/assets/shots/es/files-dark.webp index b60bad4ae..6d05b2da3 100644 Binary files a/site/assets/shots/es/files-dark.webp and b/site/assets/shots/es/files-dark.webp differ diff --git a/site/assets/shots/es/files-light.webp b/site/assets/shots/es/files-light.webp index ea8ae0062..0427a4a10 100644 Binary files a/site/assets/shots/es/files-light.webp and b/site/assets/shots/es/files-light.webp differ diff --git a/site/assets/shots/es/games-dark.webp b/site/assets/shots/es/games-dark.webp index b14ef1676..f8b0fcbf5 100644 Binary files a/site/assets/shots/es/games-dark.webp and b/site/assets/shots/es/games-dark.webp differ diff --git a/site/assets/shots/es/games-light.webp b/site/assets/shots/es/games-light.webp index f67007e4b..f3e72f5c4 100644 Binary files a/site/assets/shots/es/games-light.webp and b/site/assets/shots/es/games-light.webp differ diff --git a/site/assets/shots/es/home-dark.webp b/site/assets/shots/es/home-dark.webp index 826075004..a33f39b10 100644 Binary files a/site/assets/shots/es/home-dark.webp and b/site/assets/shots/es/home-dark.webp differ diff --git a/site/assets/shots/es/home-light.webp b/site/assets/shots/es/home-light.webp index 7a60c39d2..338696ace 100644 Binary files a/site/assets/shots/es/home-light.webp and b/site/assets/shots/es/home-light.webp differ diff --git a/site/assets/shots/es/invite-dark.webp b/site/assets/shots/es/invite-dark.webp index b4eae191c..cbd727d65 100644 Binary files a/site/assets/shots/es/invite-dark.webp and b/site/assets/shots/es/invite-dark.webp differ diff --git a/site/assets/shots/es/invite-light.webp b/site/assets/shots/es/invite-light.webp index 7e3fb8996..389490bef 100644 Binary files a/site/assets/shots/es/invite-light.webp and b/site/assets/shots/es/invite-light.webp differ diff --git a/site/assets/shots/es/kbm-dark.webp b/site/assets/shots/es/kbm-dark.webp index 7d6f75ad0..62a8e1cf9 100644 Binary files a/site/assets/shots/es/kbm-dark.webp and b/site/assets/shots/es/kbm-dark.webp differ diff --git a/site/assets/shots/es/kbm-light.webp b/site/assets/shots/es/kbm-light.webp index beec3428a..0e16d443d 100644 Binary files a/site/assets/shots/es/kbm-light.webp and b/site/assets/shots/es/kbm-light.webp differ diff --git a/site/assets/shots/es/kbm-settings-dark.webp b/site/assets/shots/es/kbm-settings-dark.webp index 042ec3c2f..0b081ae6f 100644 Binary files a/site/assets/shots/es/kbm-settings-dark.webp and b/site/assets/shots/es/kbm-settings-dark.webp differ diff --git a/site/assets/shots/es/kbm-settings-light.webp b/site/assets/shots/es/kbm-settings-light.webp index abe4c60ae..2844154a8 100644 Binary files a/site/assets/shots/es/kbm-settings-light.webp and b/site/assets/shots/es/kbm-settings-light.webp differ diff --git a/site/assets/shots/es/m-files-dark.webp b/site/assets/shots/es/m-files-dark.webp index ff9a692f3..f10965dd9 100644 Binary files a/site/assets/shots/es/m-files-dark.webp and b/site/assets/shots/es/m-files-dark.webp differ diff --git a/site/assets/shots/es/m-files-light.webp b/site/assets/shots/es/m-files-light.webp index d7308add0..754dcca39 100644 Binary files a/site/assets/shots/es/m-files-light.webp and b/site/assets/shots/es/m-files-light.webp differ diff --git a/site/assets/shots/es/m-games-dark.webp b/site/assets/shots/es/m-games-dark.webp index 06b505200..aa7ec2876 100644 Binary files a/site/assets/shots/es/m-games-dark.webp and b/site/assets/shots/es/m-games-dark.webp differ diff --git a/site/assets/shots/es/m-games-light.webp b/site/assets/shots/es/m-games-light.webp index 2c5bbe40a..d80d140c9 100644 Binary files a/site/assets/shots/es/m-games-light.webp and b/site/assets/shots/es/m-games-light.webp differ diff --git a/site/assets/shots/es/m-guest-dark.webp b/site/assets/shots/es/m-guest-dark.webp index 134d917a4..480db41a0 100644 Binary files a/site/assets/shots/es/m-guest-dark.webp and b/site/assets/shots/es/m-guest-dark.webp differ diff --git a/site/assets/shots/es/m-guest-light.webp b/site/assets/shots/es/m-guest-light.webp index 567e4b2cc..fae875a7e 100644 Binary files a/site/assets/shots/es/m-guest-light.webp and b/site/assets/shots/es/m-guest-light.webp differ diff --git a/site/assets/shots/es/m-home-dark.webp b/site/assets/shots/es/m-home-dark.webp index 07ac215b8..68a957221 100644 Binary files a/site/assets/shots/es/m-home-dark.webp and b/site/assets/shots/es/m-home-dark.webp differ diff --git a/site/assets/shots/es/m-home-light.webp b/site/assets/shots/es/m-home-light.webp index 0bfe9c959..07737a897 100644 Binary files a/site/assets/shots/es/m-home-light.webp and b/site/assets/shots/es/m-home-light.webp differ diff --git a/site/assets/shots/es/m-play-dark.webp b/site/assets/shots/es/m-play-dark.webp index 2515bf3f4..b10bf4b61 100644 Binary files a/site/assets/shots/es/m-play-dark.webp and b/site/assets/shots/es/m-play-dark.webp differ diff --git a/site/assets/shots/es/m-play-light.webp b/site/assets/shots/es/m-play-light.webp index d7aa998f4..be35027c9 100644 Binary files a/site/assets/shots/es/m-play-light.webp and b/site/assets/shots/es/m-play-light.webp differ diff --git a/site/assets/shots/es/phones-dark.webp b/site/assets/shots/es/phones-dark.webp index 923c36d03..a78ae247f 100644 Binary files a/site/assets/shots/es/phones-dark.webp and b/site/assets/shots/es/phones-dark.webp differ diff --git a/site/assets/shots/es/phones-light.webp b/site/assets/shots/es/phones-light.webp index 5444611ea..9cbd2b525 100644 Binary files a/site/assets/shots/es/phones-light.webp and b/site/assets/shots/es/phones-light.webp differ diff --git a/site/assets/shots/es/pkg-name-dark.webp b/site/assets/shots/es/pkg-name-dark.webp index 15a2147a8..85e14d667 100644 Binary files a/site/assets/shots/es/pkg-name-dark.webp and b/site/assets/shots/es/pkg-name-dark.webp differ diff --git a/site/assets/shots/es/pkg-name-light.webp b/site/assets/shots/es/pkg-name-light.webp index f72a9a69e..3db29a0b0 100644 Binary files a/site/assets/shots/es/pkg-name-light.webp and b/site/assets/shots/es/pkg-name-light.webp differ diff --git a/site/assets/shots/es/play-dark.webp b/site/assets/shots/es/play-dark.webp index d6414c285..8385057cd 100644 Binary files a/site/assets/shots/es/play-dark.webp and b/site/assets/shots/es/play-dark.webp differ diff --git a/site/assets/shots/es/play-light.webp b/site/assets/shots/es/play-light.webp index 4f0a4a1fa..9195b6abc 100644 Binary files a/site/assets/shots/es/play-light.webp and b/site/assets/shots/es/play-light.webp differ diff --git a/site/assets/shots/es/receive-dark.webp b/site/assets/shots/es/receive-dark.webp index 7c5c0a223..22c502c6c 100644 Binary files a/site/assets/shots/es/receive-dark.webp and b/site/assets/shots/es/receive-dark.webp differ diff --git a/site/assets/shots/es/receive-light.webp b/site/assets/shots/es/receive-light.webp index 6f76ab8d6..b1b6da56d 100644 Binary files a/site/assets/shots/es/receive-light.webp and b/site/assets/shots/es/receive-light.webp differ diff --git a/site/assets/shots/es/setup-dark.webp b/site/assets/shots/es/setup-dark.webp index 7c2131c25..581c4ee9e 100644 Binary files a/site/assets/shots/es/setup-dark.webp and b/site/assets/shots/es/setup-dark.webp differ diff --git a/site/assets/shots/es/setup-light.webp b/site/assets/shots/es/setup-light.webp index f8b3417ba..e1b94c077 100644 Binary files a/site/assets/shots/es/setup-light.webp and b/site/assets/shots/es/setup-light.webp differ diff --git a/site/assets/shots/es/share-dark.webp b/site/assets/shots/es/share-dark.webp index 82d2bf28f..3b81b3ded 100644 Binary files a/site/assets/shots/es/share-dark.webp and b/site/assets/shots/es/share-dark.webp differ diff --git a/site/assets/shots/es/share-light.webp b/site/assets/shots/es/share-light.webp index def647feb..1dd2c38af 100644 Binary files a/site/assets/shots/es/share-light.webp and b/site/assets/shots/es/share-light.webp differ diff --git a/site/assets/shots/es/share-link-dark.webp b/site/assets/shots/es/share-link-dark.webp index 519387167..71d8013f7 100644 Binary files a/site/assets/shots/es/share-link-dark.webp and b/site/assets/shots/es/share-link-dark.webp differ diff --git a/site/assets/shots/es/share-link-light.webp b/site/assets/shots/es/share-link-light.webp index 0c5a1a424..e6ef23a12 100644 Binary files a/site/assets/shots/es/share-link-light.webp and b/site/assets/shots/es/share-link-light.webp differ diff --git a/site/assets/shots/es/tailscale-connection-dark.webp b/site/assets/shots/es/tailscale-connection-dark.webp index e49fa15a5..9f9cf18e7 100644 Binary files a/site/assets/shots/es/tailscale-connection-dark.webp and b/site/assets/shots/es/tailscale-connection-dark.webp differ diff --git a/site/assets/shots/es/tailscale-connection-light.webp b/site/assets/shots/es/tailscale-connection-light.webp index 9dadc2e6d..0656ac9eb 100644 Binary files a/site/assets/shots/es/tailscale-connection-light.webp and b/site/assets/shots/es/tailscale-connection-light.webp differ diff --git a/site/assets/shots/es/tailscale-settings-dark.webp b/site/assets/shots/es/tailscale-settings-dark.webp index 290b8ac6f..ada84807c 100644 Binary files a/site/assets/shots/es/tailscale-settings-dark.webp and b/site/assets/shots/es/tailscale-settings-dark.webp differ diff --git a/site/assets/shots/es/tailscale-settings-light.webp b/site/assets/shots/es/tailscale-settings-light.webp index cb03210a2..0db89ec7d 100644 Binary files a/site/assets/shots/es/tailscale-settings-light.webp and b/site/assets/shots/es/tailscale-settings-light.webp differ diff --git a/site/assets/shots/es/together-net-dark.webp b/site/assets/shots/es/together-net-dark.webp index 9f6f19d99..00b7d8482 100644 Binary files a/site/assets/shots/es/together-net-dark.webp and b/site/assets/shots/es/together-net-dark.webp differ diff --git a/site/assets/shots/es/together-net-light.webp b/site/assets/shots/es/together-net-light.webp index a74cb363f..15628a7a0 100644 Binary files a/site/assets/shots/es/together-net-light.webp and b/site/assets/shots/es/together-net-light.webp differ diff --git a/site/assets/shots/es/together-tab-dark.webp b/site/assets/shots/es/together-tab-dark.webp index 45284f8de..5a1d881e2 100644 Binary files a/site/assets/shots/es/together-tab-dark.webp and b/site/assets/shots/es/together-tab-dark.webp differ diff --git a/site/assets/shots/es/together-tab-light.webp b/site/assets/shots/es/together-tab-light.webp index 80b6b87b0..82b985d4e 100644 Binary files a/site/assets/shots/es/together-tab-light.webp and b/site/assets/shots/es/together-tab-light.webp differ diff --git a/site/assets/shots/es/ts-found-dark.webp b/site/assets/shots/es/ts-found-dark.webp index 33928de69..e7788c0de 100644 Binary files a/site/assets/shots/es/ts-found-dark.webp and b/site/assets/shots/es/ts-found-dark.webp differ diff --git a/site/assets/shots/es/ts-found-light.webp b/site/assets/shots/es/ts-found-light.webp index f978fe7c6..33487e9e4 100644 Binary files a/site/assets/shots/es/ts-found-light.webp and b/site/assets/shots/es/ts-found-light.webp differ diff --git a/site/assets/shots/es/upload-dark.webp b/site/assets/shots/es/upload-dark.webp index 28d42d52e..7eccb95fa 100644 Binary files a/site/assets/shots/es/upload-dark.webp and b/site/assets/shots/es/upload-dark.webp differ diff --git a/site/assets/shots/es/upload-light.webp b/site/assets/shots/es/upload-light.webp index 09cdef258..81bea6a35 100644 Binary files a/site/assets/shots/es/upload-light.webp and b/site/assets/shots/es/upload-light.webp differ diff --git a/site/assets/shots/es/workshop-dark.webp b/site/assets/shots/es/workshop-dark.webp index 4c72a7419..b5fb4602c 100644 Binary files a/site/assets/shots/es/workshop-dark.webp and b/site/assets/shots/es/workshop-dark.webp differ diff --git a/site/assets/shots/es/workshop-light.webp b/site/assets/shots/es/workshop-light.webp index 20c282dbc..f2c65b2be 100644 Binary files a/site/assets/shots/es/workshop-light.webp and b/site/assets/shots/es/workshop-light.webp differ diff --git a/site/assets/shots/fa/add-ps5-dark.webp b/site/assets/shots/fa/add-ps5-dark.webp index 03e6d813b..a1d7a4f80 100644 Binary files a/site/assets/shots/fa/add-ps5-dark.webp and b/site/assets/shots/fa/add-ps5-dark.webp differ diff --git a/site/assets/shots/fa/add-ps5-light.webp b/site/assets/shots/fa/add-ps5-light.webp index 140bc5d7b..b72f5e686 100644 Binary files a/site/assets/shots/fa/add-ps5-light.webp and b/site/assets/shots/fa/add-ps5-light.webp differ diff --git a/site/assets/shots/fa/approval-dark.webp b/site/assets/shots/fa/approval-dark.webp index e5530db5a..873691a5b 100644 Binary files a/site/assets/shots/fa/approval-dark.webp and b/site/assets/shots/fa/approval-dark.webp differ diff --git a/site/assets/shots/fa/approval-light.webp b/site/assets/shots/fa/approval-light.webp index ae74f18f9..e7164146b 100644 Binary files a/site/assets/shots/fa/approval-light.webp and b/site/assets/shots/fa/approval-light.webp differ diff --git a/site/assets/shots/fa/connection-dark.webp b/site/assets/shots/fa/connection-dark.webp index 9c5b97e88..5be093fae 100644 Binary files a/site/assets/shots/fa/connection-dark.webp and b/site/assets/shots/fa/connection-dark.webp differ diff --git a/site/assets/shots/fa/connection-light.webp b/site/assets/shots/fa/connection-light.webp index f4a0bb43d..ca4e5e28c 100644 Binary files a/site/assets/shots/fa/connection-light.webp and b/site/assets/shots/fa/connection-light.webp differ diff --git a/site/assets/shots/fa/consoles-dark.webp b/site/assets/shots/fa/consoles-dark.webp index 4f3490a07..5d5d93968 100644 Binary files a/site/assets/shots/fa/consoles-dark.webp and b/site/assets/shots/fa/consoles-dark.webp differ diff --git a/site/assets/shots/fa/consoles-light.webp b/site/assets/shots/fa/consoles-light.webp index 26b7c8e16..9d76c2169 100644 Binary files a/site/assets/shots/fa/consoles-light.webp and b/site/assets/shots/fa/consoles-light.webp differ diff --git a/site/assets/shots/fa/files-dark.webp b/site/assets/shots/fa/files-dark.webp index b2fd4e88f..c9f41a34f 100644 Binary files a/site/assets/shots/fa/files-dark.webp and b/site/assets/shots/fa/files-dark.webp differ diff --git a/site/assets/shots/fa/files-light.webp b/site/assets/shots/fa/files-light.webp index dc7e9c962..74be83cad 100644 Binary files a/site/assets/shots/fa/files-light.webp and b/site/assets/shots/fa/files-light.webp differ diff --git a/site/assets/shots/fa/games-dark.webp b/site/assets/shots/fa/games-dark.webp index 43f1489ae..264fa5599 100644 Binary files a/site/assets/shots/fa/games-dark.webp and b/site/assets/shots/fa/games-dark.webp differ diff --git a/site/assets/shots/fa/games-light.webp b/site/assets/shots/fa/games-light.webp index ab563ff8f..c998326e1 100644 Binary files a/site/assets/shots/fa/games-light.webp and b/site/assets/shots/fa/games-light.webp differ diff --git a/site/assets/shots/fa/home-dark.webp b/site/assets/shots/fa/home-dark.webp index e9ff10603..38d56e907 100644 Binary files a/site/assets/shots/fa/home-dark.webp and b/site/assets/shots/fa/home-dark.webp differ diff --git a/site/assets/shots/fa/home-light.webp b/site/assets/shots/fa/home-light.webp index 0be400b21..623abd1fb 100644 Binary files a/site/assets/shots/fa/home-light.webp and b/site/assets/shots/fa/home-light.webp differ diff --git a/site/assets/shots/fa/invite-dark.webp b/site/assets/shots/fa/invite-dark.webp index f06a6062b..6eb59077c 100644 Binary files a/site/assets/shots/fa/invite-dark.webp and b/site/assets/shots/fa/invite-dark.webp differ diff --git a/site/assets/shots/fa/invite-light.webp b/site/assets/shots/fa/invite-light.webp index d6705ccf6..489a69ae6 100644 Binary files a/site/assets/shots/fa/invite-light.webp and b/site/assets/shots/fa/invite-light.webp differ diff --git a/site/assets/shots/fa/kbm-dark.webp b/site/assets/shots/fa/kbm-dark.webp index 66ce0ea80..79832d792 100644 Binary files a/site/assets/shots/fa/kbm-dark.webp and b/site/assets/shots/fa/kbm-dark.webp differ diff --git a/site/assets/shots/fa/kbm-light.webp b/site/assets/shots/fa/kbm-light.webp index 1a5e96751..34a3f42c4 100644 Binary files a/site/assets/shots/fa/kbm-light.webp and b/site/assets/shots/fa/kbm-light.webp differ diff --git a/site/assets/shots/fa/kbm-settings-light.webp b/site/assets/shots/fa/kbm-settings-light.webp index e0f82ee66..d068fa1ec 100644 Binary files a/site/assets/shots/fa/kbm-settings-light.webp and b/site/assets/shots/fa/kbm-settings-light.webp differ diff --git a/site/assets/shots/fa/m-files-dark.webp b/site/assets/shots/fa/m-files-dark.webp index bff9cece7..32805de90 100644 Binary files a/site/assets/shots/fa/m-files-dark.webp and b/site/assets/shots/fa/m-files-dark.webp differ diff --git a/site/assets/shots/fa/m-files-light.webp b/site/assets/shots/fa/m-files-light.webp index cbefd36fa..0487da5c5 100644 Binary files a/site/assets/shots/fa/m-files-light.webp and b/site/assets/shots/fa/m-files-light.webp differ diff --git a/site/assets/shots/fa/m-games-dark.webp b/site/assets/shots/fa/m-games-dark.webp index f81ef6845..3be7a46e3 100644 Binary files a/site/assets/shots/fa/m-games-dark.webp and b/site/assets/shots/fa/m-games-dark.webp differ diff --git a/site/assets/shots/fa/m-games-light.webp b/site/assets/shots/fa/m-games-light.webp index 4e8f2e547..4a7ab0327 100644 Binary files a/site/assets/shots/fa/m-games-light.webp and b/site/assets/shots/fa/m-games-light.webp differ diff --git a/site/assets/shots/fa/m-guest-light.webp b/site/assets/shots/fa/m-guest-light.webp index 04ce5cfc4..ffeea931b 100644 Binary files a/site/assets/shots/fa/m-guest-light.webp and b/site/assets/shots/fa/m-guest-light.webp differ diff --git a/site/assets/shots/fa/m-home-dark.webp b/site/assets/shots/fa/m-home-dark.webp index 27e4ce0e6..0cfdeff82 100644 Binary files a/site/assets/shots/fa/m-home-dark.webp and b/site/assets/shots/fa/m-home-dark.webp differ diff --git a/site/assets/shots/fa/m-home-light.webp b/site/assets/shots/fa/m-home-light.webp index f1a09eab7..c71053fa1 100644 Binary files a/site/assets/shots/fa/m-home-light.webp and b/site/assets/shots/fa/m-home-light.webp differ diff --git a/site/assets/shots/fa/m-play-dark.webp b/site/assets/shots/fa/m-play-dark.webp index d75e736e1..9406b5c67 100644 Binary files a/site/assets/shots/fa/m-play-dark.webp and b/site/assets/shots/fa/m-play-dark.webp differ diff --git a/site/assets/shots/fa/m-play-light.webp b/site/assets/shots/fa/m-play-light.webp index 0af8db6ed..66ed0c118 100644 Binary files a/site/assets/shots/fa/m-play-light.webp and b/site/assets/shots/fa/m-play-light.webp differ diff --git a/site/assets/shots/fa/phones-dark.webp b/site/assets/shots/fa/phones-dark.webp index dd10a0f66..cc9e61d6b 100644 Binary files a/site/assets/shots/fa/phones-dark.webp and b/site/assets/shots/fa/phones-dark.webp differ diff --git a/site/assets/shots/fa/phones-light.webp b/site/assets/shots/fa/phones-light.webp index d4f40aa47..41ea7bb91 100644 Binary files a/site/assets/shots/fa/phones-light.webp and b/site/assets/shots/fa/phones-light.webp differ diff --git a/site/assets/shots/fa/pkg-name-dark.webp b/site/assets/shots/fa/pkg-name-dark.webp index dd5d397bc..642e88a05 100644 Binary files a/site/assets/shots/fa/pkg-name-dark.webp and b/site/assets/shots/fa/pkg-name-dark.webp differ diff --git a/site/assets/shots/fa/pkg-name-light.webp b/site/assets/shots/fa/pkg-name-light.webp index 886b49f40..7ca065148 100644 Binary files a/site/assets/shots/fa/pkg-name-light.webp and b/site/assets/shots/fa/pkg-name-light.webp differ diff --git a/site/assets/shots/fa/play-dark.webp b/site/assets/shots/fa/play-dark.webp index e9e81e791..a66dcf7f7 100644 Binary files a/site/assets/shots/fa/play-dark.webp and b/site/assets/shots/fa/play-dark.webp differ diff --git a/site/assets/shots/fa/play-light.webp b/site/assets/shots/fa/play-light.webp index 620e9e646..ed732a330 100644 Binary files a/site/assets/shots/fa/play-light.webp and b/site/assets/shots/fa/play-light.webp differ diff --git a/site/assets/shots/fa/receive-dark.webp b/site/assets/shots/fa/receive-dark.webp index 093728ee7..6a3ab9782 100644 Binary files a/site/assets/shots/fa/receive-dark.webp and b/site/assets/shots/fa/receive-dark.webp differ diff --git a/site/assets/shots/fa/receive-light.webp b/site/assets/shots/fa/receive-light.webp index a88f06e11..e44f9e1d8 100644 Binary files a/site/assets/shots/fa/receive-light.webp and b/site/assets/shots/fa/receive-light.webp differ diff --git a/site/assets/shots/fa/setup-dark.webp b/site/assets/shots/fa/setup-dark.webp index 7e3bcb748..f667039f7 100644 Binary files a/site/assets/shots/fa/setup-dark.webp and b/site/assets/shots/fa/setup-dark.webp differ diff --git a/site/assets/shots/fa/setup-light.webp b/site/assets/shots/fa/setup-light.webp index 35d5731a3..bcbb36b7e 100644 Binary files a/site/assets/shots/fa/setup-light.webp and b/site/assets/shots/fa/setup-light.webp differ diff --git a/site/assets/shots/fa/share-dark.webp b/site/assets/shots/fa/share-dark.webp index a5c8f7241..e9c202e94 100644 Binary files a/site/assets/shots/fa/share-dark.webp and b/site/assets/shots/fa/share-dark.webp differ diff --git a/site/assets/shots/fa/share-light.webp b/site/assets/shots/fa/share-light.webp index 37cfecaa2..b4f614e61 100644 Binary files a/site/assets/shots/fa/share-light.webp and b/site/assets/shots/fa/share-light.webp differ diff --git a/site/assets/shots/fa/share-link-dark.webp b/site/assets/shots/fa/share-link-dark.webp index 86f2ff232..c70e718d0 100644 Binary files a/site/assets/shots/fa/share-link-dark.webp and b/site/assets/shots/fa/share-link-dark.webp differ diff --git a/site/assets/shots/fa/share-link-light.webp b/site/assets/shots/fa/share-link-light.webp index 3751e9c33..1f968ee63 100644 Binary files a/site/assets/shots/fa/share-link-light.webp and b/site/assets/shots/fa/share-link-light.webp differ diff --git a/site/assets/shots/fa/tailscale-connection-dark.webp b/site/assets/shots/fa/tailscale-connection-dark.webp index e0a3b9fe8..f145f81c8 100644 Binary files a/site/assets/shots/fa/tailscale-connection-dark.webp and b/site/assets/shots/fa/tailscale-connection-dark.webp differ diff --git a/site/assets/shots/fa/tailscale-connection-light.webp b/site/assets/shots/fa/tailscale-connection-light.webp index ad11ee734..9bf350f9e 100644 Binary files a/site/assets/shots/fa/tailscale-connection-light.webp and b/site/assets/shots/fa/tailscale-connection-light.webp differ diff --git a/site/assets/shots/fa/tailscale-settings-dark.webp b/site/assets/shots/fa/tailscale-settings-dark.webp index aacf2e7b0..7dc80ee1f 100644 Binary files a/site/assets/shots/fa/tailscale-settings-dark.webp and b/site/assets/shots/fa/tailscale-settings-dark.webp differ diff --git a/site/assets/shots/fa/tailscale-settings-light.webp b/site/assets/shots/fa/tailscale-settings-light.webp index 30ccb9d2a..d9fc3865d 100644 Binary files a/site/assets/shots/fa/tailscale-settings-light.webp and b/site/assets/shots/fa/tailscale-settings-light.webp differ diff --git a/site/assets/shots/fa/together-net-dark.webp b/site/assets/shots/fa/together-net-dark.webp index f0b4819d9..d3b2bbbe1 100644 Binary files a/site/assets/shots/fa/together-net-dark.webp and b/site/assets/shots/fa/together-net-dark.webp differ diff --git a/site/assets/shots/fa/together-net-light.webp b/site/assets/shots/fa/together-net-light.webp index 93d35d47b..e8bdfe1fa 100644 Binary files a/site/assets/shots/fa/together-net-light.webp and b/site/assets/shots/fa/together-net-light.webp differ diff --git a/site/assets/shots/fa/together-tab-dark.webp b/site/assets/shots/fa/together-tab-dark.webp index d352dad7c..3ddab5dae 100644 Binary files a/site/assets/shots/fa/together-tab-dark.webp and b/site/assets/shots/fa/together-tab-dark.webp differ diff --git a/site/assets/shots/fa/together-tab-light.webp b/site/assets/shots/fa/together-tab-light.webp index e9d5f9457..18ccce5b9 100644 Binary files a/site/assets/shots/fa/together-tab-light.webp and b/site/assets/shots/fa/together-tab-light.webp differ diff --git a/site/assets/shots/fa/ts-found-dark.webp b/site/assets/shots/fa/ts-found-dark.webp index b9d60eb69..570501979 100644 Binary files a/site/assets/shots/fa/ts-found-dark.webp and b/site/assets/shots/fa/ts-found-dark.webp differ diff --git a/site/assets/shots/fa/ts-found-light.webp b/site/assets/shots/fa/ts-found-light.webp index 6897e2119..0f615bbfc 100644 Binary files a/site/assets/shots/fa/ts-found-light.webp and b/site/assets/shots/fa/ts-found-light.webp differ diff --git a/site/assets/shots/fa/upload-dark.webp b/site/assets/shots/fa/upload-dark.webp index 70a5516da..9bd871f1e 100644 Binary files a/site/assets/shots/fa/upload-dark.webp and b/site/assets/shots/fa/upload-dark.webp differ diff --git a/site/assets/shots/fa/upload-light.webp b/site/assets/shots/fa/upload-light.webp index 9e5d07ae6..5d786b8b1 100644 Binary files a/site/assets/shots/fa/upload-light.webp and b/site/assets/shots/fa/upload-light.webp differ diff --git a/site/assets/shots/fa/workshop-dark.webp b/site/assets/shots/fa/workshop-dark.webp index cfe039fd9..52b4ecf41 100644 Binary files a/site/assets/shots/fa/workshop-dark.webp and b/site/assets/shots/fa/workshop-dark.webp differ diff --git a/site/assets/shots/fa/workshop-light.webp b/site/assets/shots/fa/workshop-light.webp index 4278e3d9e..0ecda0232 100644 Binary files a/site/assets/shots/fa/workshop-light.webp and b/site/assets/shots/fa/workshop-light.webp differ diff --git a/site/assets/shots/files-dark.webp b/site/assets/shots/files-dark.webp index d1226ff5b..69dbdb24b 100644 Binary files a/site/assets/shots/files-dark.webp and b/site/assets/shots/files-dark.webp differ diff --git a/site/assets/shots/files-light.webp b/site/assets/shots/files-light.webp index 5e22db3df..9e8c4d7fc 100644 Binary files a/site/assets/shots/files-light.webp and b/site/assets/shots/files-light.webp differ diff --git a/site/assets/shots/fr/add-ps5-dark.webp b/site/assets/shots/fr/add-ps5-dark.webp index 1b59a3823..559409170 100644 Binary files a/site/assets/shots/fr/add-ps5-dark.webp and b/site/assets/shots/fr/add-ps5-dark.webp differ diff --git a/site/assets/shots/fr/add-ps5-light.webp b/site/assets/shots/fr/add-ps5-light.webp index 037687cd2..087477b98 100644 Binary files a/site/assets/shots/fr/add-ps5-light.webp and b/site/assets/shots/fr/add-ps5-light.webp differ diff --git a/site/assets/shots/fr/approval-dark.webp b/site/assets/shots/fr/approval-dark.webp index 8d55fb091..f581f9302 100644 Binary files a/site/assets/shots/fr/approval-dark.webp and b/site/assets/shots/fr/approval-dark.webp differ diff --git a/site/assets/shots/fr/approval-light.webp b/site/assets/shots/fr/approval-light.webp index a858f6303..b14a1d6b4 100644 Binary files a/site/assets/shots/fr/approval-light.webp and b/site/assets/shots/fr/approval-light.webp differ diff --git a/site/assets/shots/fr/connection-dark.webp b/site/assets/shots/fr/connection-dark.webp index 4438ca49a..8d7453802 100644 Binary files a/site/assets/shots/fr/connection-dark.webp and b/site/assets/shots/fr/connection-dark.webp differ diff --git a/site/assets/shots/fr/connection-light.webp b/site/assets/shots/fr/connection-light.webp index bcfc282e5..4ab073d39 100644 Binary files a/site/assets/shots/fr/connection-light.webp and b/site/assets/shots/fr/connection-light.webp differ diff --git a/site/assets/shots/fr/consoles-dark.webp b/site/assets/shots/fr/consoles-dark.webp index a1d5f7d34..69a639b42 100644 Binary files a/site/assets/shots/fr/consoles-dark.webp and b/site/assets/shots/fr/consoles-dark.webp differ diff --git a/site/assets/shots/fr/consoles-light.webp b/site/assets/shots/fr/consoles-light.webp index 81963b7b9..a41f348aa 100644 Binary files a/site/assets/shots/fr/consoles-light.webp and b/site/assets/shots/fr/consoles-light.webp differ diff --git a/site/assets/shots/fr/files-dark.webp b/site/assets/shots/fr/files-dark.webp index 98ab08089..e5e829efe 100644 Binary files a/site/assets/shots/fr/files-dark.webp and b/site/assets/shots/fr/files-dark.webp differ diff --git a/site/assets/shots/fr/files-light.webp b/site/assets/shots/fr/files-light.webp index a384af746..85af33e13 100644 Binary files a/site/assets/shots/fr/files-light.webp and b/site/assets/shots/fr/files-light.webp differ diff --git a/site/assets/shots/fr/games-dark.webp b/site/assets/shots/fr/games-dark.webp index f7d91564e..09f6f5ad7 100644 Binary files a/site/assets/shots/fr/games-dark.webp and b/site/assets/shots/fr/games-dark.webp differ diff --git a/site/assets/shots/fr/games-light.webp b/site/assets/shots/fr/games-light.webp index 62c05c613..1aec9fd6c 100644 Binary files a/site/assets/shots/fr/games-light.webp and b/site/assets/shots/fr/games-light.webp differ diff --git a/site/assets/shots/fr/home-dark.webp b/site/assets/shots/fr/home-dark.webp index eaac87d4e..c539abef6 100644 Binary files a/site/assets/shots/fr/home-dark.webp and b/site/assets/shots/fr/home-dark.webp differ diff --git a/site/assets/shots/fr/home-light.webp b/site/assets/shots/fr/home-light.webp index e54a9a028..8294be22a 100644 Binary files a/site/assets/shots/fr/home-light.webp and b/site/assets/shots/fr/home-light.webp differ diff --git a/site/assets/shots/fr/invite-dark.webp b/site/assets/shots/fr/invite-dark.webp index 8afd5e561..09808f150 100644 Binary files a/site/assets/shots/fr/invite-dark.webp and b/site/assets/shots/fr/invite-dark.webp differ diff --git a/site/assets/shots/fr/invite-light.webp b/site/assets/shots/fr/invite-light.webp index 6a3f212b6..54ae02882 100644 Binary files a/site/assets/shots/fr/invite-light.webp and b/site/assets/shots/fr/invite-light.webp differ diff --git a/site/assets/shots/fr/kbm-dark.webp b/site/assets/shots/fr/kbm-dark.webp index cad2d8009..26b0d20ff 100644 Binary files a/site/assets/shots/fr/kbm-dark.webp and b/site/assets/shots/fr/kbm-dark.webp differ diff --git a/site/assets/shots/fr/kbm-light.webp b/site/assets/shots/fr/kbm-light.webp index 8c06bfda9..4d01e97ec 100644 Binary files a/site/assets/shots/fr/kbm-light.webp and b/site/assets/shots/fr/kbm-light.webp differ diff --git a/site/assets/shots/fr/kbm-settings-dark.webp b/site/assets/shots/fr/kbm-settings-dark.webp index 127f257ea..a45e36818 100644 Binary files a/site/assets/shots/fr/kbm-settings-dark.webp and b/site/assets/shots/fr/kbm-settings-dark.webp differ diff --git a/site/assets/shots/fr/kbm-settings-light.webp b/site/assets/shots/fr/kbm-settings-light.webp index 9374725b6..ab6efc476 100644 Binary files a/site/assets/shots/fr/kbm-settings-light.webp and b/site/assets/shots/fr/kbm-settings-light.webp differ diff --git a/site/assets/shots/fr/m-files-dark.webp b/site/assets/shots/fr/m-files-dark.webp index 7fafa5401..6a54a6e91 100644 Binary files a/site/assets/shots/fr/m-files-dark.webp and b/site/assets/shots/fr/m-files-dark.webp differ diff --git a/site/assets/shots/fr/m-files-light.webp b/site/assets/shots/fr/m-files-light.webp index 18e5f1f87..e704c06d9 100644 Binary files a/site/assets/shots/fr/m-files-light.webp and b/site/assets/shots/fr/m-files-light.webp differ diff --git a/site/assets/shots/fr/m-games-dark.webp b/site/assets/shots/fr/m-games-dark.webp index 2119f1d91..1c67ff570 100644 Binary files a/site/assets/shots/fr/m-games-dark.webp and b/site/assets/shots/fr/m-games-dark.webp differ diff --git a/site/assets/shots/fr/m-games-light.webp b/site/assets/shots/fr/m-games-light.webp index 2aebc0854..5a6580a29 100644 Binary files a/site/assets/shots/fr/m-games-light.webp and b/site/assets/shots/fr/m-games-light.webp differ diff --git a/site/assets/shots/fr/m-guest-dark.webp b/site/assets/shots/fr/m-guest-dark.webp index dda91402c..8c11bd43a 100644 Binary files a/site/assets/shots/fr/m-guest-dark.webp and b/site/assets/shots/fr/m-guest-dark.webp differ diff --git a/site/assets/shots/fr/m-guest-light.webp b/site/assets/shots/fr/m-guest-light.webp index 40c4fae1b..fae875a7e 100644 Binary files a/site/assets/shots/fr/m-guest-light.webp and b/site/assets/shots/fr/m-guest-light.webp differ diff --git a/site/assets/shots/fr/m-home-dark.webp b/site/assets/shots/fr/m-home-dark.webp index 9df3b2187..325c9eca7 100644 Binary files a/site/assets/shots/fr/m-home-dark.webp and b/site/assets/shots/fr/m-home-dark.webp differ diff --git a/site/assets/shots/fr/m-home-light.webp b/site/assets/shots/fr/m-home-light.webp index 16e13e7eb..0621ba9d1 100644 Binary files a/site/assets/shots/fr/m-home-light.webp and b/site/assets/shots/fr/m-home-light.webp differ diff --git a/site/assets/shots/fr/m-play-dark.webp b/site/assets/shots/fr/m-play-dark.webp index 8152ab2c0..5ad9bdd65 100644 Binary files a/site/assets/shots/fr/m-play-dark.webp and b/site/assets/shots/fr/m-play-dark.webp differ diff --git a/site/assets/shots/fr/m-play-light.webp b/site/assets/shots/fr/m-play-light.webp index 5af4c6721..687ab59d8 100644 Binary files a/site/assets/shots/fr/m-play-light.webp and b/site/assets/shots/fr/m-play-light.webp differ diff --git a/site/assets/shots/fr/phones-dark.webp b/site/assets/shots/fr/phones-dark.webp index 1eca7dfb6..0904650d5 100644 Binary files a/site/assets/shots/fr/phones-dark.webp and b/site/assets/shots/fr/phones-dark.webp differ diff --git a/site/assets/shots/fr/phones-light.webp b/site/assets/shots/fr/phones-light.webp index 8b977cdfa..2797fc9c0 100644 Binary files a/site/assets/shots/fr/phones-light.webp and b/site/assets/shots/fr/phones-light.webp differ diff --git a/site/assets/shots/fr/pkg-name-dark.webp b/site/assets/shots/fr/pkg-name-dark.webp index 6794c6c20..b3ce18f12 100644 Binary files a/site/assets/shots/fr/pkg-name-dark.webp and b/site/assets/shots/fr/pkg-name-dark.webp differ diff --git a/site/assets/shots/fr/pkg-name-light.webp b/site/assets/shots/fr/pkg-name-light.webp index fb480cae2..4d86e63b4 100644 Binary files a/site/assets/shots/fr/pkg-name-light.webp and b/site/assets/shots/fr/pkg-name-light.webp differ diff --git a/site/assets/shots/fr/play-dark.webp b/site/assets/shots/fr/play-dark.webp index d22580526..d998cd802 100644 Binary files a/site/assets/shots/fr/play-dark.webp and b/site/assets/shots/fr/play-dark.webp differ diff --git a/site/assets/shots/fr/play-light.webp b/site/assets/shots/fr/play-light.webp index d3fe07c8c..cae717222 100644 Binary files a/site/assets/shots/fr/play-light.webp and b/site/assets/shots/fr/play-light.webp differ diff --git a/site/assets/shots/fr/receive-dark.webp b/site/assets/shots/fr/receive-dark.webp index aa5cb43a8..774daf6d2 100644 Binary files a/site/assets/shots/fr/receive-dark.webp and b/site/assets/shots/fr/receive-dark.webp differ diff --git a/site/assets/shots/fr/receive-light.webp b/site/assets/shots/fr/receive-light.webp index 15707592f..6409cc65f 100644 Binary files a/site/assets/shots/fr/receive-light.webp and b/site/assets/shots/fr/receive-light.webp differ diff --git a/site/assets/shots/fr/setup-dark.webp b/site/assets/shots/fr/setup-dark.webp index e479dd4d3..6147ff779 100644 Binary files a/site/assets/shots/fr/setup-dark.webp and b/site/assets/shots/fr/setup-dark.webp differ diff --git a/site/assets/shots/fr/setup-light.webp b/site/assets/shots/fr/setup-light.webp index 64cde393e..9fdf2455f 100644 Binary files a/site/assets/shots/fr/setup-light.webp and b/site/assets/shots/fr/setup-light.webp differ diff --git a/site/assets/shots/fr/share-dark.webp b/site/assets/shots/fr/share-dark.webp index 37410f992..fc2cf7c9d 100644 Binary files a/site/assets/shots/fr/share-dark.webp and b/site/assets/shots/fr/share-dark.webp differ diff --git a/site/assets/shots/fr/share-light.webp b/site/assets/shots/fr/share-light.webp index 5fab2a19b..a7aeca481 100644 Binary files a/site/assets/shots/fr/share-light.webp and b/site/assets/shots/fr/share-light.webp differ diff --git a/site/assets/shots/fr/share-link-dark.webp b/site/assets/shots/fr/share-link-dark.webp index 1ce9e3963..ced88f878 100644 Binary files a/site/assets/shots/fr/share-link-dark.webp and b/site/assets/shots/fr/share-link-dark.webp differ diff --git a/site/assets/shots/fr/share-link-light.webp b/site/assets/shots/fr/share-link-light.webp index 9edda398e..bd099aa1b 100644 Binary files a/site/assets/shots/fr/share-link-light.webp and b/site/assets/shots/fr/share-link-light.webp differ diff --git a/site/assets/shots/fr/tailscale-connection-dark.webp b/site/assets/shots/fr/tailscale-connection-dark.webp index 0f4687ba5..988496222 100644 Binary files a/site/assets/shots/fr/tailscale-connection-dark.webp and b/site/assets/shots/fr/tailscale-connection-dark.webp differ diff --git a/site/assets/shots/fr/tailscale-connection-light.webp b/site/assets/shots/fr/tailscale-connection-light.webp index 99a0d1eb5..4f32ccf7d 100644 Binary files a/site/assets/shots/fr/tailscale-connection-light.webp and b/site/assets/shots/fr/tailscale-connection-light.webp differ diff --git a/site/assets/shots/fr/tailscale-settings-dark.webp b/site/assets/shots/fr/tailscale-settings-dark.webp index 130b123eb..8d9064262 100644 Binary files a/site/assets/shots/fr/tailscale-settings-dark.webp and b/site/assets/shots/fr/tailscale-settings-dark.webp differ diff --git a/site/assets/shots/fr/tailscale-settings-light.webp b/site/assets/shots/fr/tailscale-settings-light.webp index 819a129ab..2268aea4b 100644 Binary files a/site/assets/shots/fr/tailscale-settings-light.webp and b/site/assets/shots/fr/tailscale-settings-light.webp differ diff --git a/site/assets/shots/fr/together-net-dark.webp b/site/assets/shots/fr/together-net-dark.webp index 20422e61a..92dcd6624 100644 Binary files a/site/assets/shots/fr/together-net-dark.webp and b/site/assets/shots/fr/together-net-dark.webp differ diff --git a/site/assets/shots/fr/together-net-light.webp b/site/assets/shots/fr/together-net-light.webp index 68cae18d7..efc643a73 100644 Binary files a/site/assets/shots/fr/together-net-light.webp and b/site/assets/shots/fr/together-net-light.webp differ diff --git a/site/assets/shots/fr/together-tab-dark.webp b/site/assets/shots/fr/together-tab-dark.webp index 67d2abd1e..ad4604b02 100644 Binary files a/site/assets/shots/fr/together-tab-dark.webp and b/site/assets/shots/fr/together-tab-dark.webp differ diff --git a/site/assets/shots/fr/together-tab-light.webp b/site/assets/shots/fr/together-tab-light.webp index dfcbe79fa..7ebd8d276 100644 Binary files a/site/assets/shots/fr/together-tab-light.webp and b/site/assets/shots/fr/together-tab-light.webp differ diff --git a/site/assets/shots/fr/ts-found-dark.webp b/site/assets/shots/fr/ts-found-dark.webp index 9d001f50f..7da30c5ca 100644 Binary files a/site/assets/shots/fr/ts-found-dark.webp and b/site/assets/shots/fr/ts-found-dark.webp differ diff --git a/site/assets/shots/fr/ts-found-light.webp b/site/assets/shots/fr/ts-found-light.webp index 157d59839..9ede3da02 100644 Binary files a/site/assets/shots/fr/ts-found-light.webp and b/site/assets/shots/fr/ts-found-light.webp differ diff --git a/site/assets/shots/fr/upload-dark.webp b/site/assets/shots/fr/upload-dark.webp index 0e43159a2..803546d74 100644 Binary files a/site/assets/shots/fr/upload-dark.webp and b/site/assets/shots/fr/upload-dark.webp differ diff --git a/site/assets/shots/fr/upload-light.webp b/site/assets/shots/fr/upload-light.webp index db5ab73d9..fc45741bb 100644 Binary files a/site/assets/shots/fr/upload-light.webp and b/site/assets/shots/fr/upload-light.webp differ diff --git a/site/assets/shots/fr/workshop-dark.webp b/site/assets/shots/fr/workshop-dark.webp index b968bac48..d5cbe21be 100644 Binary files a/site/assets/shots/fr/workshop-dark.webp and b/site/assets/shots/fr/workshop-dark.webp differ diff --git a/site/assets/shots/fr/workshop-light.webp b/site/assets/shots/fr/workshop-light.webp index a022c62cc..f5992b383 100644 Binary files a/site/assets/shots/fr/workshop-light.webp and b/site/assets/shots/fr/workshop-light.webp differ diff --git a/site/assets/shots/games-dark.webp b/site/assets/shots/games-dark.webp index b0cb730db..41f6266d4 100644 Binary files a/site/assets/shots/games-dark.webp and b/site/assets/shots/games-dark.webp differ diff --git a/site/assets/shots/games-light.webp b/site/assets/shots/games-light.webp index f79345750..af9d28b1e 100644 Binary files a/site/assets/shots/games-light.webp and b/site/assets/shots/games-light.webp differ diff --git a/site/assets/shots/hi/add-ps5-dark.webp b/site/assets/shots/hi/add-ps5-dark.webp index 9a6e3ea96..8f6c3c740 100644 Binary files a/site/assets/shots/hi/add-ps5-dark.webp and b/site/assets/shots/hi/add-ps5-dark.webp differ diff --git a/site/assets/shots/hi/add-ps5-light.webp b/site/assets/shots/hi/add-ps5-light.webp index c3ab8eb34..722938f57 100644 Binary files a/site/assets/shots/hi/add-ps5-light.webp and b/site/assets/shots/hi/add-ps5-light.webp differ diff --git a/site/assets/shots/hi/approval-dark.webp b/site/assets/shots/hi/approval-dark.webp index ee17539ea..ecd1929e8 100644 Binary files a/site/assets/shots/hi/approval-dark.webp and b/site/assets/shots/hi/approval-dark.webp differ diff --git a/site/assets/shots/hi/approval-light.webp b/site/assets/shots/hi/approval-light.webp index ffca898e6..b6d0566e8 100644 Binary files a/site/assets/shots/hi/approval-light.webp and b/site/assets/shots/hi/approval-light.webp differ diff --git a/site/assets/shots/hi/connection-dark.webp b/site/assets/shots/hi/connection-dark.webp index 4728fd818..684633615 100644 Binary files a/site/assets/shots/hi/connection-dark.webp and b/site/assets/shots/hi/connection-dark.webp differ diff --git a/site/assets/shots/hi/connection-light.webp b/site/assets/shots/hi/connection-light.webp index d4dff8b09..993022e00 100644 Binary files a/site/assets/shots/hi/connection-light.webp and b/site/assets/shots/hi/connection-light.webp differ diff --git a/site/assets/shots/hi/consoles-dark.webp b/site/assets/shots/hi/consoles-dark.webp index eeeabc388..27bd88c35 100644 Binary files a/site/assets/shots/hi/consoles-dark.webp and b/site/assets/shots/hi/consoles-dark.webp differ diff --git a/site/assets/shots/hi/consoles-light.webp b/site/assets/shots/hi/consoles-light.webp index 5f8582ecf..3799a95b4 100644 Binary files a/site/assets/shots/hi/consoles-light.webp and b/site/assets/shots/hi/consoles-light.webp differ diff --git a/site/assets/shots/hi/files-dark.webp b/site/assets/shots/hi/files-dark.webp index bb4beef49..6f068373a 100644 Binary files a/site/assets/shots/hi/files-dark.webp and b/site/assets/shots/hi/files-dark.webp differ diff --git a/site/assets/shots/hi/files-light.webp b/site/assets/shots/hi/files-light.webp index 6c635da8b..2d1d4a430 100644 Binary files a/site/assets/shots/hi/files-light.webp and b/site/assets/shots/hi/files-light.webp differ diff --git a/site/assets/shots/hi/games-dark.webp b/site/assets/shots/hi/games-dark.webp index 8446b73d7..2bd781261 100644 Binary files a/site/assets/shots/hi/games-dark.webp and b/site/assets/shots/hi/games-dark.webp differ diff --git a/site/assets/shots/hi/games-light.webp b/site/assets/shots/hi/games-light.webp index cd577ca39..f4d4559b3 100644 Binary files a/site/assets/shots/hi/games-light.webp and b/site/assets/shots/hi/games-light.webp differ diff --git a/site/assets/shots/hi/home-dark.webp b/site/assets/shots/hi/home-dark.webp index 986c486cc..35a98f81e 100644 Binary files a/site/assets/shots/hi/home-dark.webp and b/site/assets/shots/hi/home-dark.webp differ diff --git a/site/assets/shots/hi/home-light.webp b/site/assets/shots/hi/home-light.webp index 051e111c1..b35db1166 100644 Binary files a/site/assets/shots/hi/home-light.webp and b/site/assets/shots/hi/home-light.webp differ diff --git a/site/assets/shots/hi/invite-dark.webp b/site/assets/shots/hi/invite-dark.webp index 5d3dd3894..09cb673d2 100644 Binary files a/site/assets/shots/hi/invite-dark.webp and b/site/assets/shots/hi/invite-dark.webp differ diff --git a/site/assets/shots/hi/invite-light.webp b/site/assets/shots/hi/invite-light.webp index 91b9074b3..898047648 100644 Binary files a/site/assets/shots/hi/invite-light.webp and b/site/assets/shots/hi/invite-light.webp differ diff --git a/site/assets/shots/hi/kbm-dark.webp b/site/assets/shots/hi/kbm-dark.webp index ff464b421..df8c879b2 100644 Binary files a/site/assets/shots/hi/kbm-dark.webp and b/site/assets/shots/hi/kbm-dark.webp differ diff --git a/site/assets/shots/hi/kbm-light.webp b/site/assets/shots/hi/kbm-light.webp index 8b5e90e73..8f3fc1742 100644 Binary files a/site/assets/shots/hi/kbm-light.webp and b/site/assets/shots/hi/kbm-light.webp differ diff --git a/site/assets/shots/hi/kbm-settings-dark.webp b/site/assets/shots/hi/kbm-settings-dark.webp index 078df05e9..dd0a82180 100644 Binary files a/site/assets/shots/hi/kbm-settings-dark.webp and b/site/assets/shots/hi/kbm-settings-dark.webp differ diff --git a/site/assets/shots/hi/kbm-settings-light.webp b/site/assets/shots/hi/kbm-settings-light.webp index a29aeb02c..3822e5bbd 100644 Binary files a/site/assets/shots/hi/kbm-settings-light.webp and b/site/assets/shots/hi/kbm-settings-light.webp differ diff --git a/site/assets/shots/hi/m-files-dark.webp b/site/assets/shots/hi/m-files-dark.webp index 77053bc32..9c49c8783 100644 Binary files a/site/assets/shots/hi/m-files-dark.webp and b/site/assets/shots/hi/m-files-dark.webp differ diff --git a/site/assets/shots/hi/m-files-light.webp b/site/assets/shots/hi/m-files-light.webp index 70531cc1a..59f92365b 100644 Binary files a/site/assets/shots/hi/m-files-light.webp and b/site/assets/shots/hi/m-files-light.webp differ diff --git a/site/assets/shots/hi/m-games-dark.webp b/site/assets/shots/hi/m-games-dark.webp index 26b4bb861..916637bc8 100644 Binary files a/site/assets/shots/hi/m-games-dark.webp and b/site/assets/shots/hi/m-games-dark.webp differ diff --git a/site/assets/shots/hi/m-games-light.webp b/site/assets/shots/hi/m-games-light.webp index 910d48848..206f97546 100644 Binary files a/site/assets/shots/hi/m-games-light.webp and b/site/assets/shots/hi/m-games-light.webp differ diff --git a/site/assets/shots/hi/m-guest-light.webp b/site/assets/shots/hi/m-guest-light.webp index 8c11bd43a..fae875a7e 100644 Binary files a/site/assets/shots/hi/m-guest-light.webp and b/site/assets/shots/hi/m-guest-light.webp differ diff --git a/site/assets/shots/hi/m-home-dark.webp b/site/assets/shots/hi/m-home-dark.webp index b1ca04ec5..c9ec0b57d 100644 Binary files a/site/assets/shots/hi/m-home-dark.webp and b/site/assets/shots/hi/m-home-dark.webp differ diff --git a/site/assets/shots/hi/m-home-light.webp b/site/assets/shots/hi/m-home-light.webp index c67c7eee2..9cb9b9227 100644 Binary files a/site/assets/shots/hi/m-home-light.webp and b/site/assets/shots/hi/m-home-light.webp differ diff --git a/site/assets/shots/hi/m-play-dark.webp b/site/assets/shots/hi/m-play-dark.webp index 98bf40d7b..084a68e56 100644 Binary files a/site/assets/shots/hi/m-play-dark.webp and b/site/assets/shots/hi/m-play-dark.webp differ diff --git a/site/assets/shots/hi/m-play-light.webp b/site/assets/shots/hi/m-play-light.webp index 9fca2ce6c..574ac9283 100644 Binary files a/site/assets/shots/hi/m-play-light.webp and b/site/assets/shots/hi/m-play-light.webp differ diff --git a/site/assets/shots/hi/phones-dark.webp b/site/assets/shots/hi/phones-dark.webp index 225f58fed..0a430ab02 100644 Binary files a/site/assets/shots/hi/phones-dark.webp and b/site/assets/shots/hi/phones-dark.webp differ diff --git a/site/assets/shots/hi/phones-light.webp b/site/assets/shots/hi/phones-light.webp index 031c17a36..2a41a99ff 100644 Binary files a/site/assets/shots/hi/phones-light.webp and b/site/assets/shots/hi/phones-light.webp differ diff --git a/site/assets/shots/hi/pkg-name-dark.webp b/site/assets/shots/hi/pkg-name-dark.webp index e3a268610..3729f2919 100644 Binary files a/site/assets/shots/hi/pkg-name-dark.webp and b/site/assets/shots/hi/pkg-name-dark.webp differ diff --git a/site/assets/shots/hi/pkg-name-light.webp b/site/assets/shots/hi/pkg-name-light.webp index d1d1cfc4f..e33aad756 100644 Binary files a/site/assets/shots/hi/pkg-name-light.webp and b/site/assets/shots/hi/pkg-name-light.webp differ diff --git a/site/assets/shots/hi/play-dark.webp b/site/assets/shots/hi/play-dark.webp index 2d0c29f6e..23eeeb514 100644 Binary files a/site/assets/shots/hi/play-dark.webp and b/site/assets/shots/hi/play-dark.webp differ diff --git a/site/assets/shots/hi/play-light.webp b/site/assets/shots/hi/play-light.webp index 47824b8c6..d0a546be3 100644 Binary files a/site/assets/shots/hi/play-light.webp and b/site/assets/shots/hi/play-light.webp differ diff --git a/site/assets/shots/hi/receive-dark.webp b/site/assets/shots/hi/receive-dark.webp index 3d8cc73b1..9e4104660 100644 Binary files a/site/assets/shots/hi/receive-dark.webp and b/site/assets/shots/hi/receive-dark.webp differ diff --git a/site/assets/shots/hi/receive-light.webp b/site/assets/shots/hi/receive-light.webp index 955484ba4..96b4c2a05 100644 Binary files a/site/assets/shots/hi/receive-light.webp and b/site/assets/shots/hi/receive-light.webp differ diff --git a/site/assets/shots/hi/setup-dark.webp b/site/assets/shots/hi/setup-dark.webp index 4337dc3c2..2c1803a67 100644 Binary files a/site/assets/shots/hi/setup-dark.webp and b/site/assets/shots/hi/setup-dark.webp differ diff --git a/site/assets/shots/hi/setup-light.webp b/site/assets/shots/hi/setup-light.webp index 971824af5..298be0939 100644 Binary files a/site/assets/shots/hi/setup-light.webp and b/site/assets/shots/hi/setup-light.webp differ diff --git a/site/assets/shots/hi/share-dark.webp b/site/assets/shots/hi/share-dark.webp index 375b8fed9..993110ba1 100644 Binary files a/site/assets/shots/hi/share-dark.webp and b/site/assets/shots/hi/share-dark.webp differ diff --git a/site/assets/shots/hi/share-light.webp b/site/assets/shots/hi/share-light.webp index 6985b7647..dda544dd4 100644 Binary files a/site/assets/shots/hi/share-light.webp and b/site/assets/shots/hi/share-light.webp differ diff --git a/site/assets/shots/hi/share-link-dark.webp b/site/assets/shots/hi/share-link-dark.webp index a01cfb8ac..70fd16381 100644 Binary files a/site/assets/shots/hi/share-link-dark.webp and b/site/assets/shots/hi/share-link-dark.webp differ diff --git a/site/assets/shots/hi/share-link-light.webp b/site/assets/shots/hi/share-link-light.webp index 419fa3512..1fbd83269 100644 Binary files a/site/assets/shots/hi/share-link-light.webp and b/site/assets/shots/hi/share-link-light.webp differ diff --git a/site/assets/shots/hi/tailscale-connection-dark.webp b/site/assets/shots/hi/tailscale-connection-dark.webp index 01d2bfd10..fef2157ea 100644 Binary files a/site/assets/shots/hi/tailscale-connection-dark.webp and b/site/assets/shots/hi/tailscale-connection-dark.webp differ diff --git a/site/assets/shots/hi/tailscale-connection-light.webp b/site/assets/shots/hi/tailscale-connection-light.webp index 02297bcbf..0fbb9562b 100644 Binary files a/site/assets/shots/hi/tailscale-connection-light.webp and b/site/assets/shots/hi/tailscale-connection-light.webp differ diff --git a/site/assets/shots/hi/tailscale-settings-dark.webp b/site/assets/shots/hi/tailscale-settings-dark.webp index 71f7b84d5..3eef2de81 100644 Binary files a/site/assets/shots/hi/tailscale-settings-dark.webp and b/site/assets/shots/hi/tailscale-settings-dark.webp differ diff --git a/site/assets/shots/hi/tailscale-settings-light.webp b/site/assets/shots/hi/tailscale-settings-light.webp index 3c2884ea3..fb62c3bb0 100644 Binary files a/site/assets/shots/hi/tailscale-settings-light.webp and b/site/assets/shots/hi/tailscale-settings-light.webp differ diff --git a/site/assets/shots/hi/together-net-dark.webp b/site/assets/shots/hi/together-net-dark.webp index f7761cb47..699f43c98 100644 Binary files a/site/assets/shots/hi/together-net-dark.webp and b/site/assets/shots/hi/together-net-dark.webp differ diff --git a/site/assets/shots/hi/together-net-light.webp b/site/assets/shots/hi/together-net-light.webp index 984cbfd62..b5329b6da 100644 Binary files a/site/assets/shots/hi/together-net-light.webp and b/site/assets/shots/hi/together-net-light.webp differ diff --git a/site/assets/shots/hi/together-tab-dark.webp b/site/assets/shots/hi/together-tab-dark.webp index 52de061e0..4de44e6f5 100644 Binary files a/site/assets/shots/hi/together-tab-dark.webp and b/site/assets/shots/hi/together-tab-dark.webp differ diff --git a/site/assets/shots/hi/together-tab-light.webp b/site/assets/shots/hi/together-tab-light.webp index 61037d311..834c25870 100644 Binary files a/site/assets/shots/hi/together-tab-light.webp and b/site/assets/shots/hi/together-tab-light.webp differ diff --git a/site/assets/shots/hi/ts-found-dark.webp b/site/assets/shots/hi/ts-found-dark.webp index ccc19d82f..dc8f4c44a 100644 Binary files a/site/assets/shots/hi/ts-found-dark.webp and b/site/assets/shots/hi/ts-found-dark.webp differ diff --git a/site/assets/shots/hi/ts-found-light.webp b/site/assets/shots/hi/ts-found-light.webp index 7ebb012f2..17231c53c 100644 Binary files a/site/assets/shots/hi/ts-found-light.webp and b/site/assets/shots/hi/ts-found-light.webp differ diff --git a/site/assets/shots/hi/upload-dark.webp b/site/assets/shots/hi/upload-dark.webp index a5402f7b4..ce1606782 100644 Binary files a/site/assets/shots/hi/upload-dark.webp and b/site/assets/shots/hi/upload-dark.webp differ diff --git a/site/assets/shots/hi/upload-light.webp b/site/assets/shots/hi/upload-light.webp index 3f9de821e..b74c91730 100644 Binary files a/site/assets/shots/hi/upload-light.webp and b/site/assets/shots/hi/upload-light.webp differ diff --git a/site/assets/shots/hi/workshop-dark.webp b/site/assets/shots/hi/workshop-dark.webp index d3bee8b80..a8e894933 100644 Binary files a/site/assets/shots/hi/workshop-dark.webp and b/site/assets/shots/hi/workshop-dark.webp differ diff --git a/site/assets/shots/hi/workshop-light.webp b/site/assets/shots/hi/workshop-light.webp index 89dcbf994..b4df03112 100644 Binary files a/site/assets/shots/hi/workshop-light.webp and b/site/assets/shots/hi/workshop-light.webp differ diff --git a/site/assets/shots/home-dark.webp b/site/assets/shots/home-dark.webp index 595a35c50..f4ed59dab 100644 Binary files a/site/assets/shots/home-dark.webp and b/site/assets/shots/home-dark.webp differ diff --git a/site/assets/shots/home-light.webp b/site/assets/shots/home-light.webp index 22ee99d9d..dd5264adb 100644 Binary files a/site/assets/shots/home-light.webp and b/site/assets/shots/home-light.webp differ diff --git a/site/assets/shots/hu/add-ps5-dark.webp b/site/assets/shots/hu/add-ps5-dark.webp index ea1adc9a8..881484bf9 100644 Binary files a/site/assets/shots/hu/add-ps5-dark.webp and b/site/assets/shots/hu/add-ps5-dark.webp differ diff --git a/site/assets/shots/hu/add-ps5-light.webp b/site/assets/shots/hu/add-ps5-light.webp index f5fd6fadc..ea42874b2 100644 Binary files a/site/assets/shots/hu/add-ps5-light.webp and b/site/assets/shots/hu/add-ps5-light.webp differ diff --git a/site/assets/shots/hu/approval-dark.webp b/site/assets/shots/hu/approval-dark.webp index eb9281340..e8cc1fce3 100644 Binary files a/site/assets/shots/hu/approval-dark.webp and b/site/assets/shots/hu/approval-dark.webp differ diff --git a/site/assets/shots/hu/approval-light.webp b/site/assets/shots/hu/approval-light.webp index 74bb11381..cb01cfc80 100644 Binary files a/site/assets/shots/hu/approval-light.webp and b/site/assets/shots/hu/approval-light.webp differ diff --git a/site/assets/shots/hu/connection-dark.webp b/site/assets/shots/hu/connection-dark.webp index bb15e36b7..4e27c6e28 100644 Binary files a/site/assets/shots/hu/connection-dark.webp and b/site/assets/shots/hu/connection-dark.webp differ diff --git a/site/assets/shots/hu/connection-light.webp b/site/assets/shots/hu/connection-light.webp index 909add7e0..db657c15f 100644 Binary files a/site/assets/shots/hu/connection-light.webp and b/site/assets/shots/hu/connection-light.webp differ diff --git a/site/assets/shots/hu/consoles-dark.webp b/site/assets/shots/hu/consoles-dark.webp index b3d7976f3..feb6f58b3 100644 Binary files a/site/assets/shots/hu/consoles-dark.webp and b/site/assets/shots/hu/consoles-dark.webp differ diff --git a/site/assets/shots/hu/consoles-light.webp b/site/assets/shots/hu/consoles-light.webp index 11d107a16..013038823 100644 Binary files a/site/assets/shots/hu/consoles-light.webp and b/site/assets/shots/hu/consoles-light.webp differ diff --git a/site/assets/shots/hu/files-dark.webp b/site/assets/shots/hu/files-dark.webp index c3650c80c..6226dbce9 100644 Binary files a/site/assets/shots/hu/files-dark.webp and b/site/assets/shots/hu/files-dark.webp differ diff --git a/site/assets/shots/hu/files-light.webp b/site/assets/shots/hu/files-light.webp index aa5bc87b8..9451d386d 100644 Binary files a/site/assets/shots/hu/files-light.webp and b/site/assets/shots/hu/files-light.webp differ diff --git a/site/assets/shots/hu/games-dark.webp b/site/assets/shots/hu/games-dark.webp index e2a513b53..f0e4c805f 100644 Binary files a/site/assets/shots/hu/games-dark.webp and b/site/assets/shots/hu/games-dark.webp differ diff --git a/site/assets/shots/hu/games-light.webp b/site/assets/shots/hu/games-light.webp index e14be47ff..e509c2053 100644 Binary files a/site/assets/shots/hu/games-light.webp and b/site/assets/shots/hu/games-light.webp differ diff --git a/site/assets/shots/hu/home-dark.webp b/site/assets/shots/hu/home-dark.webp index 7a3df9f10..76d82c6ba 100644 Binary files a/site/assets/shots/hu/home-dark.webp and b/site/assets/shots/hu/home-dark.webp differ diff --git a/site/assets/shots/hu/home-light.webp b/site/assets/shots/hu/home-light.webp index e380a828c..61326cb58 100644 Binary files a/site/assets/shots/hu/home-light.webp and b/site/assets/shots/hu/home-light.webp differ diff --git a/site/assets/shots/hu/invite-dark.webp b/site/assets/shots/hu/invite-dark.webp index 8263f4cc0..a03e4739c 100644 Binary files a/site/assets/shots/hu/invite-dark.webp and b/site/assets/shots/hu/invite-dark.webp differ diff --git a/site/assets/shots/hu/invite-light.webp b/site/assets/shots/hu/invite-light.webp index dac484f4d..f74ac4fb9 100644 Binary files a/site/assets/shots/hu/invite-light.webp and b/site/assets/shots/hu/invite-light.webp differ diff --git a/site/assets/shots/hu/kbm-dark.webp b/site/assets/shots/hu/kbm-dark.webp index aa9862a2c..12097fc13 100644 Binary files a/site/assets/shots/hu/kbm-dark.webp and b/site/assets/shots/hu/kbm-dark.webp differ diff --git a/site/assets/shots/hu/kbm-light.webp b/site/assets/shots/hu/kbm-light.webp index d166f041a..52c7984ee 100644 Binary files a/site/assets/shots/hu/kbm-light.webp and b/site/assets/shots/hu/kbm-light.webp differ diff --git a/site/assets/shots/hu/kbm-settings-dark.webp b/site/assets/shots/hu/kbm-settings-dark.webp index c295e6568..ae10a6af6 100644 Binary files a/site/assets/shots/hu/kbm-settings-dark.webp and b/site/assets/shots/hu/kbm-settings-dark.webp differ diff --git a/site/assets/shots/hu/kbm-settings-light.webp b/site/assets/shots/hu/kbm-settings-light.webp index acfdb211b..82880763e 100644 Binary files a/site/assets/shots/hu/kbm-settings-light.webp and b/site/assets/shots/hu/kbm-settings-light.webp differ diff --git a/site/assets/shots/hu/m-files-dark.webp b/site/assets/shots/hu/m-files-dark.webp index 5b42920ef..a17bc4a64 100644 Binary files a/site/assets/shots/hu/m-files-dark.webp and b/site/assets/shots/hu/m-files-dark.webp differ diff --git a/site/assets/shots/hu/m-files-light.webp b/site/assets/shots/hu/m-files-light.webp index b45131b91..8ae773054 100644 Binary files a/site/assets/shots/hu/m-files-light.webp and b/site/assets/shots/hu/m-files-light.webp differ diff --git a/site/assets/shots/hu/m-games-dark.webp b/site/assets/shots/hu/m-games-dark.webp index 1cbc66b4f..754d42d5f 100644 Binary files a/site/assets/shots/hu/m-games-dark.webp and b/site/assets/shots/hu/m-games-dark.webp differ diff --git a/site/assets/shots/hu/m-games-light.webp b/site/assets/shots/hu/m-games-light.webp index 8ef9cd843..6f7b26801 100644 Binary files a/site/assets/shots/hu/m-games-light.webp and b/site/assets/shots/hu/m-games-light.webp differ diff --git a/site/assets/shots/hu/m-guest-dark.webp b/site/assets/shots/hu/m-guest-dark.webp index fae875a7e..567e4b2cc 100644 Binary files a/site/assets/shots/hu/m-guest-dark.webp and b/site/assets/shots/hu/m-guest-dark.webp differ diff --git a/site/assets/shots/hu/m-guest-light.webp b/site/assets/shots/hu/m-guest-light.webp index fae875a7e..567e4b2cc 100644 Binary files a/site/assets/shots/hu/m-guest-light.webp and b/site/assets/shots/hu/m-guest-light.webp differ diff --git a/site/assets/shots/hu/m-home-dark.webp b/site/assets/shots/hu/m-home-dark.webp index 9db8c6c8d..b69bfd86f 100644 Binary files a/site/assets/shots/hu/m-home-dark.webp and b/site/assets/shots/hu/m-home-dark.webp differ diff --git a/site/assets/shots/hu/m-home-light.webp b/site/assets/shots/hu/m-home-light.webp index e696a0e2a..39759e0a7 100644 Binary files a/site/assets/shots/hu/m-home-light.webp and b/site/assets/shots/hu/m-home-light.webp differ diff --git a/site/assets/shots/hu/m-play-dark.webp b/site/assets/shots/hu/m-play-dark.webp index 6f021afaa..cb7013537 100644 Binary files a/site/assets/shots/hu/m-play-dark.webp and b/site/assets/shots/hu/m-play-dark.webp differ diff --git a/site/assets/shots/hu/m-play-light.webp b/site/assets/shots/hu/m-play-light.webp index 5e75ef7d1..abc3b7db2 100644 Binary files a/site/assets/shots/hu/m-play-light.webp and b/site/assets/shots/hu/m-play-light.webp differ diff --git a/site/assets/shots/hu/phones-dark.webp b/site/assets/shots/hu/phones-dark.webp index de37270a0..f2bbb466b 100644 Binary files a/site/assets/shots/hu/phones-dark.webp and b/site/assets/shots/hu/phones-dark.webp differ diff --git a/site/assets/shots/hu/phones-light.webp b/site/assets/shots/hu/phones-light.webp index b85f03333..1350c39da 100644 Binary files a/site/assets/shots/hu/phones-light.webp and b/site/assets/shots/hu/phones-light.webp differ diff --git a/site/assets/shots/hu/pkg-name-dark.webp b/site/assets/shots/hu/pkg-name-dark.webp index 2937cc9d2..6cb469842 100644 Binary files a/site/assets/shots/hu/pkg-name-dark.webp and b/site/assets/shots/hu/pkg-name-dark.webp differ diff --git a/site/assets/shots/hu/pkg-name-light.webp b/site/assets/shots/hu/pkg-name-light.webp index 801a7942c..9a089e430 100644 Binary files a/site/assets/shots/hu/pkg-name-light.webp and b/site/assets/shots/hu/pkg-name-light.webp differ diff --git a/site/assets/shots/hu/play-dark.webp b/site/assets/shots/hu/play-dark.webp index ed5047cb3..4828226b9 100644 Binary files a/site/assets/shots/hu/play-dark.webp and b/site/assets/shots/hu/play-dark.webp differ diff --git a/site/assets/shots/hu/play-light.webp b/site/assets/shots/hu/play-light.webp index 0f2bab689..354b53b34 100644 Binary files a/site/assets/shots/hu/play-light.webp and b/site/assets/shots/hu/play-light.webp differ diff --git a/site/assets/shots/hu/receive-dark.webp b/site/assets/shots/hu/receive-dark.webp index 54ceab6d2..4d845d5ad 100644 Binary files a/site/assets/shots/hu/receive-dark.webp and b/site/assets/shots/hu/receive-dark.webp differ diff --git a/site/assets/shots/hu/receive-light.webp b/site/assets/shots/hu/receive-light.webp index f1daad123..69ce317d2 100644 Binary files a/site/assets/shots/hu/receive-light.webp and b/site/assets/shots/hu/receive-light.webp differ diff --git a/site/assets/shots/hu/setup-dark.webp b/site/assets/shots/hu/setup-dark.webp index 1403517dc..7bf004f63 100644 Binary files a/site/assets/shots/hu/setup-dark.webp and b/site/assets/shots/hu/setup-dark.webp differ diff --git a/site/assets/shots/hu/setup-light.webp b/site/assets/shots/hu/setup-light.webp index 925e0dd8a..bb621d403 100644 Binary files a/site/assets/shots/hu/setup-light.webp and b/site/assets/shots/hu/setup-light.webp differ diff --git a/site/assets/shots/hu/share-dark.webp b/site/assets/shots/hu/share-dark.webp index 8177fc24b..81c6037f6 100644 Binary files a/site/assets/shots/hu/share-dark.webp and b/site/assets/shots/hu/share-dark.webp differ diff --git a/site/assets/shots/hu/share-light.webp b/site/assets/shots/hu/share-light.webp index 5a5e0f057..086a6844d 100644 Binary files a/site/assets/shots/hu/share-light.webp and b/site/assets/shots/hu/share-light.webp differ diff --git a/site/assets/shots/hu/share-link-dark.webp b/site/assets/shots/hu/share-link-dark.webp index bbd4761e6..ed20451c1 100644 Binary files a/site/assets/shots/hu/share-link-dark.webp and b/site/assets/shots/hu/share-link-dark.webp differ diff --git a/site/assets/shots/hu/share-link-light.webp b/site/assets/shots/hu/share-link-light.webp index 90c4d76b6..bb4371b8c 100644 Binary files a/site/assets/shots/hu/share-link-light.webp and b/site/assets/shots/hu/share-link-light.webp differ diff --git a/site/assets/shots/hu/tailscale-connection-dark.webp b/site/assets/shots/hu/tailscale-connection-dark.webp index 2064ab865..97b025885 100644 Binary files a/site/assets/shots/hu/tailscale-connection-dark.webp and b/site/assets/shots/hu/tailscale-connection-dark.webp differ diff --git a/site/assets/shots/hu/tailscale-connection-light.webp b/site/assets/shots/hu/tailscale-connection-light.webp index 63814e514..099c8217e 100644 Binary files a/site/assets/shots/hu/tailscale-connection-light.webp and b/site/assets/shots/hu/tailscale-connection-light.webp differ diff --git a/site/assets/shots/hu/tailscale-settings-dark.webp b/site/assets/shots/hu/tailscale-settings-dark.webp index 881521a63..9bc99a3fe 100644 Binary files a/site/assets/shots/hu/tailscale-settings-dark.webp and b/site/assets/shots/hu/tailscale-settings-dark.webp differ diff --git a/site/assets/shots/hu/tailscale-settings-light.webp b/site/assets/shots/hu/tailscale-settings-light.webp index 9ce09afea..54692d27e 100644 Binary files a/site/assets/shots/hu/tailscale-settings-light.webp and b/site/assets/shots/hu/tailscale-settings-light.webp differ diff --git a/site/assets/shots/hu/together-net-dark.webp b/site/assets/shots/hu/together-net-dark.webp index 968c5b374..16d1fd145 100644 Binary files a/site/assets/shots/hu/together-net-dark.webp and b/site/assets/shots/hu/together-net-dark.webp differ diff --git a/site/assets/shots/hu/together-net-light.webp b/site/assets/shots/hu/together-net-light.webp index bc75c7c0f..890c2a936 100644 Binary files a/site/assets/shots/hu/together-net-light.webp and b/site/assets/shots/hu/together-net-light.webp differ diff --git a/site/assets/shots/hu/together-tab-dark.webp b/site/assets/shots/hu/together-tab-dark.webp index b11c8ec9f..d14a1b6e1 100644 Binary files a/site/assets/shots/hu/together-tab-dark.webp and b/site/assets/shots/hu/together-tab-dark.webp differ diff --git a/site/assets/shots/hu/together-tab-light.webp b/site/assets/shots/hu/together-tab-light.webp index 1c4f3e4b4..79feb8847 100644 Binary files a/site/assets/shots/hu/together-tab-light.webp and b/site/assets/shots/hu/together-tab-light.webp differ diff --git a/site/assets/shots/hu/ts-found-dark.webp b/site/assets/shots/hu/ts-found-dark.webp index 579a65eb2..22f250ec4 100644 Binary files a/site/assets/shots/hu/ts-found-dark.webp and b/site/assets/shots/hu/ts-found-dark.webp differ diff --git a/site/assets/shots/hu/ts-found-light.webp b/site/assets/shots/hu/ts-found-light.webp index c6d8a915d..6cac7ee82 100644 Binary files a/site/assets/shots/hu/ts-found-light.webp and b/site/assets/shots/hu/ts-found-light.webp differ diff --git a/site/assets/shots/hu/upload-dark.webp b/site/assets/shots/hu/upload-dark.webp index 02960db63..54d4230ce 100644 Binary files a/site/assets/shots/hu/upload-dark.webp and b/site/assets/shots/hu/upload-dark.webp differ diff --git a/site/assets/shots/hu/upload-light.webp b/site/assets/shots/hu/upload-light.webp index e26633229..fbec0034f 100644 Binary files a/site/assets/shots/hu/upload-light.webp and b/site/assets/shots/hu/upload-light.webp differ diff --git a/site/assets/shots/hu/workshop-dark.webp b/site/assets/shots/hu/workshop-dark.webp index bb96b0321..e7c82ebdb 100644 Binary files a/site/assets/shots/hu/workshop-dark.webp and b/site/assets/shots/hu/workshop-dark.webp differ diff --git a/site/assets/shots/hu/workshop-light.webp b/site/assets/shots/hu/workshop-light.webp index 53677d281..b93f86d08 100644 Binary files a/site/assets/shots/hu/workshop-light.webp and b/site/assets/shots/hu/workshop-light.webp differ diff --git a/site/assets/shots/id/add-ps5-dark.webp b/site/assets/shots/id/add-ps5-dark.webp index e46650f7e..44494643a 100644 Binary files a/site/assets/shots/id/add-ps5-dark.webp and b/site/assets/shots/id/add-ps5-dark.webp differ diff --git a/site/assets/shots/id/add-ps5-light.webp b/site/assets/shots/id/add-ps5-light.webp index a95ec5792..346f02e77 100644 Binary files a/site/assets/shots/id/add-ps5-light.webp and b/site/assets/shots/id/add-ps5-light.webp differ diff --git a/site/assets/shots/id/approval-dark.webp b/site/assets/shots/id/approval-dark.webp index 189488870..d92bbb3db 100644 Binary files a/site/assets/shots/id/approval-dark.webp and b/site/assets/shots/id/approval-dark.webp differ diff --git a/site/assets/shots/id/approval-light.webp b/site/assets/shots/id/approval-light.webp index 723f8f3df..19e7638a3 100644 Binary files a/site/assets/shots/id/approval-light.webp and b/site/assets/shots/id/approval-light.webp differ diff --git a/site/assets/shots/id/connection-dark.webp b/site/assets/shots/id/connection-dark.webp index 6a2569603..28dcdafd1 100644 Binary files a/site/assets/shots/id/connection-dark.webp and b/site/assets/shots/id/connection-dark.webp differ diff --git a/site/assets/shots/id/connection-light.webp b/site/assets/shots/id/connection-light.webp index 86a400195..28f4b4ec3 100644 Binary files a/site/assets/shots/id/connection-light.webp and b/site/assets/shots/id/connection-light.webp differ diff --git a/site/assets/shots/id/consoles-dark.webp b/site/assets/shots/id/consoles-dark.webp index 90ea5de65..81b6d8956 100644 Binary files a/site/assets/shots/id/consoles-dark.webp and b/site/assets/shots/id/consoles-dark.webp differ diff --git a/site/assets/shots/id/consoles-light.webp b/site/assets/shots/id/consoles-light.webp index b747c8a01..144e6aa45 100644 Binary files a/site/assets/shots/id/consoles-light.webp and b/site/assets/shots/id/consoles-light.webp differ diff --git a/site/assets/shots/id/files-dark.webp b/site/assets/shots/id/files-dark.webp index 270fdc9d8..0291deee5 100644 Binary files a/site/assets/shots/id/files-dark.webp and b/site/assets/shots/id/files-dark.webp differ diff --git a/site/assets/shots/id/files-light.webp b/site/assets/shots/id/files-light.webp index d248e9003..a2a3e799a 100644 Binary files a/site/assets/shots/id/files-light.webp and b/site/assets/shots/id/files-light.webp differ diff --git a/site/assets/shots/id/games-dark.webp b/site/assets/shots/id/games-dark.webp index 70506f42f..43dd09b86 100644 Binary files a/site/assets/shots/id/games-dark.webp and b/site/assets/shots/id/games-dark.webp differ diff --git a/site/assets/shots/id/games-light.webp b/site/assets/shots/id/games-light.webp index 8a8819c53..59da824fc 100644 Binary files a/site/assets/shots/id/games-light.webp and b/site/assets/shots/id/games-light.webp differ diff --git a/site/assets/shots/id/home-dark.webp b/site/assets/shots/id/home-dark.webp index 0c57c1a8d..521d4a0de 100644 Binary files a/site/assets/shots/id/home-dark.webp and b/site/assets/shots/id/home-dark.webp differ diff --git a/site/assets/shots/id/home-light.webp b/site/assets/shots/id/home-light.webp index 6034b2d72..362db07a1 100644 Binary files a/site/assets/shots/id/home-light.webp and b/site/assets/shots/id/home-light.webp differ diff --git a/site/assets/shots/id/invite-dark.webp b/site/assets/shots/id/invite-dark.webp index ec3f687c5..e8d579246 100644 Binary files a/site/assets/shots/id/invite-dark.webp and b/site/assets/shots/id/invite-dark.webp differ diff --git a/site/assets/shots/id/invite-light.webp b/site/assets/shots/id/invite-light.webp index ad1c09ed3..c8f1cc76e 100644 Binary files a/site/assets/shots/id/invite-light.webp and b/site/assets/shots/id/invite-light.webp differ diff --git a/site/assets/shots/id/kbm-dark.webp b/site/assets/shots/id/kbm-dark.webp index 346df3c9c..fbfec8805 100644 Binary files a/site/assets/shots/id/kbm-dark.webp and b/site/assets/shots/id/kbm-dark.webp differ diff --git a/site/assets/shots/id/kbm-light.webp b/site/assets/shots/id/kbm-light.webp index 5e80f4585..3ab6dd9a9 100644 Binary files a/site/assets/shots/id/kbm-light.webp and b/site/assets/shots/id/kbm-light.webp differ diff --git a/site/assets/shots/id/kbm-settings-dark.webp b/site/assets/shots/id/kbm-settings-dark.webp index 8ef5ebbad..7f04d7508 100644 Binary files a/site/assets/shots/id/kbm-settings-dark.webp and b/site/assets/shots/id/kbm-settings-dark.webp differ diff --git a/site/assets/shots/id/kbm-settings-light.webp b/site/assets/shots/id/kbm-settings-light.webp index ef4299e1c..6076098c4 100644 Binary files a/site/assets/shots/id/kbm-settings-light.webp and b/site/assets/shots/id/kbm-settings-light.webp differ diff --git a/site/assets/shots/id/m-files-dark.webp b/site/assets/shots/id/m-files-dark.webp index 9c96dd686..a47ef7f75 100644 Binary files a/site/assets/shots/id/m-files-dark.webp and b/site/assets/shots/id/m-files-dark.webp differ diff --git a/site/assets/shots/id/m-files-light.webp b/site/assets/shots/id/m-files-light.webp index 300563114..7bd6ab91a 100644 Binary files a/site/assets/shots/id/m-files-light.webp and b/site/assets/shots/id/m-files-light.webp differ diff --git a/site/assets/shots/id/m-games-dark.webp b/site/assets/shots/id/m-games-dark.webp index 8a5b48539..f9a90417a 100644 Binary files a/site/assets/shots/id/m-games-dark.webp and b/site/assets/shots/id/m-games-dark.webp differ diff --git a/site/assets/shots/id/m-games-light.webp b/site/assets/shots/id/m-games-light.webp index 2e2a250d6..497be4a44 100644 Binary files a/site/assets/shots/id/m-games-light.webp and b/site/assets/shots/id/m-games-light.webp differ diff --git a/site/assets/shots/id/m-guest-dark.webp b/site/assets/shots/id/m-guest-dark.webp index 134d917a4..567e4b2cc 100644 Binary files a/site/assets/shots/id/m-guest-dark.webp and b/site/assets/shots/id/m-guest-dark.webp differ diff --git a/site/assets/shots/id/m-guest-light.webp b/site/assets/shots/id/m-guest-light.webp index 567e4b2cc..8c11bd43a 100644 Binary files a/site/assets/shots/id/m-guest-light.webp and b/site/assets/shots/id/m-guest-light.webp differ diff --git a/site/assets/shots/id/m-home-dark.webp b/site/assets/shots/id/m-home-dark.webp index 0ec9e127b..fee1ac658 100644 Binary files a/site/assets/shots/id/m-home-dark.webp and b/site/assets/shots/id/m-home-dark.webp differ diff --git a/site/assets/shots/id/m-home-light.webp b/site/assets/shots/id/m-home-light.webp index 776d9281e..3d7ef8675 100644 Binary files a/site/assets/shots/id/m-home-light.webp and b/site/assets/shots/id/m-home-light.webp differ diff --git a/site/assets/shots/id/m-play-dark.webp b/site/assets/shots/id/m-play-dark.webp index 155205941..7c4bce406 100644 Binary files a/site/assets/shots/id/m-play-dark.webp and b/site/assets/shots/id/m-play-dark.webp differ diff --git a/site/assets/shots/id/m-play-light.webp b/site/assets/shots/id/m-play-light.webp index 32e2ba964..69b071a98 100644 Binary files a/site/assets/shots/id/m-play-light.webp and b/site/assets/shots/id/m-play-light.webp differ diff --git a/site/assets/shots/id/phones-dark.webp b/site/assets/shots/id/phones-dark.webp index bbd53fc1d..beef3ba37 100644 Binary files a/site/assets/shots/id/phones-dark.webp and b/site/assets/shots/id/phones-dark.webp differ diff --git a/site/assets/shots/id/phones-light.webp b/site/assets/shots/id/phones-light.webp index d67606371..79ccf21d7 100644 Binary files a/site/assets/shots/id/phones-light.webp and b/site/assets/shots/id/phones-light.webp differ diff --git a/site/assets/shots/id/pkg-name-dark.webp b/site/assets/shots/id/pkg-name-dark.webp index a9bbee66c..1157e5208 100644 Binary files a/site/assets/shots/id/pkg-name-dark.webp and b/site/assets/shots/id/pkg-name-dark.webp differ diff --git a/site/assets/shots/id/pkg-name-light.webp b/site/assets/shots/id/pkg-name-light.webp index be958f21b..0d91bda57 100644 Binary files a/site/assets/shots/id/pkg-name-light.webp and b/site/assets/shots/id/pkg-name-light.webp differ diff --git a/site/assets/shots/id/play-dark.webp b/site/assets/shots/id/play-dark.webp index e3f815b4f..d25641af8 100644 Binary files a/site/assets/shots/id/play-dark.webp and b/site/assets/shots/id/play-dark.webp differ diff --git a/site/assets/shots/id/play-light.webp b/site/assets/shots/id/play-light.webp index 69d351b32..11d75d7a9 100644 Binary files a/site/assets/shots/id/play-light.webp and b/site/assets/shots/id/play-light.webp differ diff --git a/site/assets/shots/id/receive-dark.webp b/site/assets/shots/id/receive-dark.webp index 797754dd5..c8f540c34 100644 Binary files a/site/assets/shots/id/receive-dark.webp and b/site/assets/shots/id/receive-dark.webp differ diff --git a/site/assets/shots/id/receive-light.webp b/site/assets/shots/id/receive-light.webp index a31609737..61988b3df 100644 Binary files a/site/assets/shots/id/receive-light.webp and b/site/assets/shots/id/receive-light.webp differ diff --git a/site/assets/shots/id/setup-dark.webp b/site/assets/shots/id/setup-dark.webp index 9df6f8209..05cc9f14b 100644 Binary files a/site/assets/shots/id/setup-dark.webp and b/site/assets/shots/id/setup-dark.webp differ diff --git a/site/assets/shots/id/setup-light.webp b/site/assets/shots/id/setup-light.webp index 34f98e229..bac23a01d 100644 Binary files a/site/assets/shots/id/setup-light.webp and b/site/assets/shots/id/setup-light.webp differ diff --git a/site/assets/shots/id/share-dark.webp b/site/assets/shots/id/share-dark.webp index ae7d98d77..37a7fa179 100644 Binary files a/site/assets/shots/id/share-dark.webp and b/site/assets/shots/id/share-dark.webp differ diff --git a/site/assets/shots/id/share-light.webp b/site/assets/shots/id/share-light.webp index 6cf3cdab9..fcf07a658 100644 Binary files a/site/assets/shots/id/share-light.webp and b/site/assets/shots/id/share-light.webp differ diff --git a/site/assets/shots/id/share-link-dark.webp b/site/assets/shots/id/share-link-dark.webp index c4794dd75..35171f8c9 100644 Binary files a/site/assets/shots/id/share-link-dark.webp and b/site/assets/shots/id/share-link-dark.webp differ diff --git a/site/assets/shots/id/share-link-light.webp b/site/assets/shots/id/share-link-light.webp index c276c477d..a606aaabc 100644 Binary files a/site/assets/shots/id/share-link-light.webp and b/site/assets/shots/id/share-link-light.webp differ diff --git a/site/assets/shots/id/tailscale-connection-dark.webp b/site/assets/shots/id/tailscale-connection-dark.webp index 47d0175ec..4ee500473 100644 Binary files a/site/assets/shots/id/tailscale-connection-dark.webp and b/site/assets/shots/id/tailscale-connection-dark.webp differ diff --git a/site/assets/shots/id/tailscale-connection-light.webp b/site/assets/shots/id/tailscale-connection-light.webp index f0d106d77..4f40d7f91 100644 Binary files a/site/assets/shots/id/tailscale-connection-light.webp and b/site/assets/shots/id/tailscale-connection-light.webp differ diff --git a/site/assets/shots/id/tailscale-settings-dark.webp b/site/assets/shots/id/tailscale-settings-dark.webp index 95e4b46e7..f28a7eaeb 100644 Binary files a/site/assets/shots/id/tailscale-settings-dark.webp and b/site/assets/shots/id/tailscale-settings-dark.webp differ diff --git a/site/assets/shots/id/tailscale-settings-light.webp b/site/assets/shots/id/tailscale-settings-light.webp index 507e171ef..ccd776e3b 100644 Binary files a/site/assets/shots/id/tailscale-settings-light.webp and b/site/assets/shots/id/tailscale-settings-light.webp differ diff --git a/site/assets/shots/id/together-net-dark.webp b/site/assets/shots/id/together-net-dark.webp index c3c4ae0d1..aaa023b0c 100644 Binary files a/site/assets/shots/id/together-net-dark.webp and b/site/assets/shots/id/together-net-dark.webp differ diff --git a/site/assets/shots/id/together-net-light.webp b/site/assets/shots/id/together-net-light.webp index 52e7e9fb7..4e4334501 100644 Binary files a/site/assets/shots/id/together-net-light.webp and b/site/assets/shots/id/together-net-light.webp differ diff --git a/site/assets/shots/id/together-tab-dark.webp b/site/assets/shots/id/together-tab-dark.webp index ae222a6ee..0b0a72696 100644 Binary files a/site/assets/shots/id/together-tab-dark.webp and b/site/assets/shots/id/together-tab-dark.webp differ diff --git a/site/assets/shots/id/together-tab-light.webp b/site/assets/shots/id/together-tab-light.webp index ee4b05058..0ce73ff27 100644 Binary files a/site/assets/shots/id/together-tab-light.webp and b/site/assets/shots/id/together-tab-light.webp differ diff --git a/site/assets/shots/id/ts-found-dark.webp b/site/assets/shots/id/ts-found-dark.webp index 21bb5eba1..ae21d8e46 100644 Binary files a/site/assets/shots/id/ts-found-dark.webp and b/site/assets/shots/id/ts-found-dark.webp differ diff --git a/site/assets/shots/id/ts-found-light.webp b/site/assets/shots/id/ts-found-light.webp index 192133a61..76d9559ab 100644 Binary files a/site/assets/shots/id/ts-found-light.webp and b/site/assets/shots/id/ts-found-light.webp differ diff --git a/site/assets/shots/id/upload-dark.webp b/site/assets/shots/id/upload-dark.webp index 9ac0b724f..333d98f86 100644 Binary files a/site/assets/shots/id/upload-dark.webp and b/site/assets/shots/id/upload-dark.webp differ diff --git a/site/assets/shots/id/upload-light.webp b/site/assets/shots/id/upload-light.webp index bbb4e4f86..2dfdfee30 100644 Binary files a/site/assets/shots/id/upload-light.webp and b/site/assets/shots/id/upload-light.webp differ diff --git a/site/assets/shots/id/workshop-dark.webp b/site/assets/shots/id/workshop-dark.webp index c22609ebb..67b516d39 100644 Binary files a/site/assets/shots/id/workshop-dark.webp and b/site/assets/shots/id/workshop-dark.webp differ diff --git a/site/assets/shots/id/workshop-light.webp b/site/assets/shots/id/workshop-light.webp index d16af5100..ff88804e5 100644 Binary files a/site/assets/shots/id/workshop-light.webp and b/site/assets/shots/id/workshop-light.webp differ diff --git a/site/assets/shots/invite-dark.webp b/site/assets/shots/invite-dark.webp index 675be60c8..f9adf2893 100644 Binary files a/site/assets/shots/invite-dark.webp and b/site/assets/shots/invite-dark.webp differ diff --git a/site/assets/shots/invite-light.webp b/site/assets/shots/invite-light.webp index 42d93634b..c8a566f43 100644 Binary files a/site/assets/shots/invite-light.webp and b/site/assets/shots/invite-light.webp differ diff --git a/site/assets/shots/it/add-ps5-dark.webp b/site/assets/shots/it/add-ps5-dark.webp index 3a9cfbe19..fee0f62c9 100644 Binary files a/site/assets/shots/it/add-ps5-dark.webp and b/site/assets/shots/it/add-ps5-dark.webp differ diff --git a/site/assets/shots/it/add-ps5-light.webp b/site/assets/shots/it/add-ps5-light.webp index 521481aa5..af69c05bd 100644 Binary files a/site/assets/shots/it/add-ps5-light.webp and b/site/assets/shots/it/add-ps5-light.webp differ diff --git a/site/assets/shots/it/approval-dark.webp b/site/assets/shots/it/approval-dark.webp index 910b51e83..b9e5a9d34 100644 Binary files a/site/assets/shots/it/approval-dark.webp and b/site/assets/shots/it/approval-dark.webp differ diff --git a/site/assets/shots/it/approval-light.webp b/site/assets/shots/it/approval-light.webp index 1c93b1f2d..f22707a35 100644 Binary files a/site/assets/shots/it/approval-light.webp and b/site/assets/shots/it/approval-light.webp differ diff --git a/site/assets/shots/it/connection-dark.webp b/site/assets/shots/it/connection-dark.webp index 3b3cd6d31..d215efac0 100644 Binary files a/site/assets/shots/it/connection-dark.webp and b/site/assets/shots/it/connection-dark.webp differ diff --git a/site/assets/shots/it/connection-light.webp b/site/assets/shots/it/connection-light.webp index 4a08966a7..24b04027b 100644 Binary files a/site/assets/shots/it/connection-light.webp and b/site/assets/shots/it/connection-light.webp differ diff --git a/site/assets/shots/it/consoles-dark.webp b/site/assets/shots/it/consoles-dark.webp index 0050b89a2..6fb551c68 100644 Binary files a/site/assets/shots/it/consoles-dark.webp and b/site/assets/shots/it/consoles-dark.webp differ diff --git a/site/assets/shots/it/consoles-light.webp b/site/assets/shots/it/consoles-light.webp index 5ca9ea8b1..0ea6e14ec 100644 Binary files a/site/assets/shots/it/consoles-light.webp and b/site/assets/shots/it/consoles-light.webp differ diff --git a/site/assets/shots/it/files-dark.webp b/site/assets/shots/it/files-dark.webp index bd8f4bf98..9ff73113c 100644 Binary files a/site/assets/shots/it/files-dark.webp and b/site/assets/shots/it/files-dark.webp differ diff --git a/site/assets/shots/it/files-light.webp b/site/assets/shots/it/files-light.webp index 2e1154d84..7c7e37493 100644 Binary files a/site/assets/shots/it/files-light.webp and b/site/assets/shots/it/files-light.webp differ diff --git a/site/assets/shots/it/games-dark.webp b/site/assets/shots/it/games-dark.webp index 97a925d0e..07eb7f7da 100644 Binary files a/site/assets/shots/it/games-dark.webp and b/site/assets/shots/it/games-dark.webp differ diff --git a/site/assets/shots/it/games-light.webp b/site/assets/shots/it/games-light.webp index c0cf64019..7c6694eff 100644 Binary files a/site/assets/shots/it/games-light.webp and b/site/assets/shots/it/games-light.webp differ diff --git a/site/assets/shots/it/home-dark.webp b/site/assets/shots/it/home-dark.webp index ba02e40c1..d03e681f2 100644 Binary files a/site/assets/shots/it/home-dark.webp and b/site/assets/shots/it/home-dark.webp differ diff --git a/site/assets/shots/it/home-light.webp b/site/assets/shots/it/home-light.webp index 95da0c027..ce283d445 100644 Binary files a/site/assets/shots/it/home-light.webp and b/site/assets/shots/it/home-light.webp differ diff --git a/site/assets/shots/it/invite-dark.webp b/site/assets/shots/it/invite-dark.webp index 5dbba0d9e..e7592cf04 100644 Binary files a/site/assets/shots/it/invite-dark.webp and b/site/assets/shots/it/invite-dark.webp differ diff --git a/site/assets/shots/it/invite-light.webp b/site/assets/shots/it/invite-light.webp index a31485cda..a59024ac2 100644 Binary files a/site/assets/shots/it/invite-light.webp and b/site/assets/shots/it/invite-light.webp differ diff --git a/site/assets/shots/it/kbm-dark.webp b/site/assets/shots/it/kbm-dark.webp index 2b7a1abf5..180e3dd4a 100644 Binary files a/site/assets/shots/it/kbm-dark.webp and b/site/assets/shots/it/kbm-dark.webp differ diff --git a/site/assets/shots/it/kbm-light.webp b/site/assets/shots/it/kbm-light.webp index 00088072d..6b8bd2e64 100644 Binary files a/site/assets/shots/it/kbm-light.webp and b/site/assets/shots/it/kbm-light.webp differ diff --git a/site/assets/shots/it/kbm-settings-dark.webp b/site/assets/shots/it/kbm-settings-dark.webp index 3a995b84b..0c5e10091 100644 Binary files a/site/assets/shots/it/kbm-settings-dark.webp and b/site/assets/shots/it/kbm-settings-dark.webp differ diff --git a/site/assets/shots/it/kbm-settings-light.webp b/site/assets/shots/it/kbm-settings-light.webp index 0a903c427..d820d8489 100644 Binary files a/site/assets/shots/it/kbm-settings-light.webp and b/site/assets/shots/it/kbm-settings-light.webp differ diff --git a/site/assets/shots/it/m-files-dark.webp b/site/assets/shots/it/m-files-dark.webp index 758d60d92..8a702fef8 100644 Binary files a/site/assets/shots/it/m-files-dark.webp and b/site/assets/shots/it/m-files-dark.webp differ diff --git a/site/assets/shots/it/m-files-light.webp b/site/assets/shots/it/m-files-light.webp index 237c476c2..a78177d3f 100644 Binary files a/site/assets/shots/it/m-files-light.webp and b/site/assets/shots/it/m-files-light.webp differ diff --git a/site/assets/shots/it/m-games-dark.webp b/site/assets/shots/it/m-games-dark.webp index 6904ab098..a0471eb3c 100644 Binary files a/site/assets/shots/it/m-games-dark.webp and b/site/assets/shots/it/m-games-dark.webp differ diff --git a/site/assets/shots/it/m-games-light.webp b/site/assets/shots/it/m-games-light.webp index e78186999..973ac562c 100644 Binary files a/site/assets/shots/it/m-games-light.webp and b/site/assets/shots/it/m-games-light.webp differ diff --git a/site/assets/shots/it/m-guest-dark.webp b/site/assets/shots/it/m-guest-dark.webp index 90c5c5869..2c3b8a200 100644 Binary files a/site/assets/shots/it/m-guest-dark.webp and b/site/assets/shots/it/m-guest-dark.webp differ diff --git a/site/assets/shots/it/m-guest-light.webp b/site/assets/shots/it/m-guest-light.webp index 8c11bd43a..050badc8e 100644 Binary files a/site/assets/shots/it/m-guest-light.webp and b/site/assets/shots/it/m-guest-light.webp differ diff --git a/site/assets/shots/it/m-home-dark.webp b/site/assets/shots/it/m-home-dark.webp index c99d57247..3f1d832f1 100644 Binary files a/site/assets/shots/it/m-home-dark.webp and b/site/assets/shots/it/m-home-dark.webp differ diff --git a/site/assets/shots/it/m-home-light.webp b/site/assets/shots/it/m-home-light.webp index 27afe80c3..68ff4f752 100644 Binary files a/site/assets/shots/it/m-home-light.webp and b/site/assets/shots/it/m-home-light.webp differ diff --git a/site/assets/shots/it/m-play-dark.webp b/site/assets/shots/it/m-play-dark.webp index 05b126470..e32564940 100644 Binary files a/site/assets/shots/it/m-play-dark.webp and b/site/assets/shots/it/m-play-dark.webp differ diff --git a/site/assets/shots/it/m-play-light.webp b/site/assets/shots/it/m-play-light.webp index 49e2d8070..85efcb73d 100644 Binary files a/site/assets/shots/it/m-play-light.webp and b/site/assets/shots/it/m-play-light.webp differ diff --git a/site/assets/shots/it/phones-dark.webp b/site/assets/shots/it/phones-dark.webp index ecec0a92f..9700f1914 100644 Binary files a/site/assets/shots/it/phones-dark.webp and b/site/assets/shots/it/phones-dark.webp differ diff --git a/site/assets/shots/it/phones-light.webp b/site/assets/shots/it/phones-light.webp index 8933c5188..49a8acf24 100644 Binary files a/site/assets/shots/it/phones-light.webp and b/site/assets/shots/it/phones-light.webp differ diff --git a/site/assets/shots/it/pkg-name-dark.webp b/site/assets/shots/it/pkg-name-dark.webp index eb8c4de88..453ac5174 100644 Binary files a/site/assets/shots/it/pkg-name-dark.webp and b/site/assets/shots/it/pkg-name-dark.webp differ diff --git a/site/assets/shots/it/pkg-name-light.webp b/site/assets/shots/it/pkg-name-light.webp index 74ca8c25b..b3c3989e4 100644 Binary files a/site/assets/shots/it/pkg-name-light.webp and b/site/assets/shots/it/pkg-name-light.webp differ diff --git a/site/assets/shots/it/play-dark.webp b/site/assets/shots/it/play-dark.webp index 8cba0b1d5..a04c045bb 100644 Binary files a/site/assets/shots/it/play-dark.webp and b/site/assets/shots/it/play-dark.webp differ diff --git a/site/assets/shots/it/play-light.webp b/site/assets/shots/it/play-light.webp index 3e05ae1c9..3def7f5c9 100644 Binary files a/site/assets/shots/it/play-light.webp and b/site/assets/shots/it/play-light.webp differ diff --git a/site/assets/shots/it/receive-dark.webp b/site/assets/shots/it/receive-dark.webp index 4e9a03de4..003dd409d 100644 Binary files a/site/assets/shots/it/receive-dark.webp and b/site/assets/shots/it/receive-dark.webp differ diff --git a/site/assets/shots/it/receive-light.webp b/site/assets/shots/it/receive-light.webp index 2d7024d8c..ab605305c 100644 Binary files a/site/assets/shots/it/receive-light.webp and b/site/assets/shots/it/receive-light.webp differ diff --git a/site/assets/shots/it/setup-dark.webp b/site/assets/shots/it/setup-dark.webp index 26d57838e..5d5ccdf92 100644 Binary files a/site/assets/shots/it/setup-dark.webp and b/site/assets/shots/it/setup-dark.webp differ diff --git a/site/assets/shots/it/setup-light.webp b/site/assets/shots/it/setup-light.webp index 35317c1ad..14a9a91f3 100644 Binary files a/site/assets/shots/it/setup-light.webp and b/site/assets/shots/it/setup-light.webp differ diff --git a/site/assets/shots/it/share-dark.webp b/site/assets/shots/it/share-dark.webp index 0c28007b9..bc0101a2b 100644 Binary files a/site/assets/shots/it/share-dark.webp and b/site/assets/shots/it/share-dark.webp differ diff --git a/site/assets/shots/it/share-light.webp b/site/assets/shots/it/share-light.webp index ce0c09d4a..6509f65f0 100644 Binary files a/site/assets/shots/it/share-light.webp and b/site/assets/shots/it/share-light.webp differ diff --git a/site/assets/shots/it/share-link-dark.webp b/site/assets/shots/it/share-link-dark.webp index 5af281f3f..d3de4f121 100644 Binary files a/site/assets/shots/it/share-link-dark.webp and b/site/assets/shots/it/share-link-dark.webp differ diff --git a/site/assets/shots/it/share-link-light.webp b/site/assets/shots/it/share-link-light.webp index 65615757c..1bae6ab6d 100644 Binary files a/site/assets/shots/it/share-link-light.webp and b/site/assets/shots/it/share-link-light.webp differ diff --git a/site/assets/shots/it/tailscale-connection-dark.webp b/site/assets/shots/it/tailscale-connection-dark.webp index 7e233a5f1..a67580cf4 100644 Binary files a/site/assets/shots/it/tailscale-connection-dark.webp and b/site/assets/shots/it/tailscale-connection-dark.webp differ diff --git a/site/assets/shots/it/tailscale-connection-light.webp b/site/assets/shots/it/tailscale-connection-light.webp index 4872c1570..4759d6565 100644 Binary files a/site/assets/shots/it/tailscale-connection-light.webp and b/site/assets/shots/it/tailscale-connection-light.webp differ diff --git a/site/assets/shots/it/tailscale-settings-dark.webp b/site/assets/shots/it/tailscale-settings-dark.webp index a26142a69..e124fc6bb 100644 Binary files a/site/assets/shots/it/tailscale-settings-dark.webp and b/site/assets/shots/it/tailscale-settings-dark.webp differ diff --git a/site/assets/shots/it/tailscale-settings-light.webp b/site/assets/shots/it/tailscale-settings-light.webp index 5f6e07130..7f9032403 100644 Binary files a/site/assets/shots/it/tailscale-settings-light.webp and b/site/assets/shots/it/tailscale-settings-light.webp differ diff --git a/site/assets/shots/it/together-net-dark.webp b/site/assets/shots/it/together-net-dark.webp index 76d83ebe2..2a74d681b 100644 Binary files a/site/assets/shots/it/together-net-dark.webp and b/site/assets/shots/it/together-net-dark.webp differ diff --git a/site/assets/shots/it/together-net-light.webp b/site/assets/shots/it/together-net-light.webp index d3063b8d9..00272181b 100644 Binary files a/site/assets/shots/it/together-net-light.webp and b/site/assets/shots/it/together-net-light.webp differ diff --git a/site/assets/shots/it/together-tab-dark.webp b/site/assets/shots/it/together-tab-dark.webp index e3e3aecc7..131fe2fcf 100644 Binary files a/site/assets/shots/it/together-tab-dark.webp and b/site/assets/shots/it/together-tab-dark.webp differ diff --git a/site/assets/shots/it/together-tab-light.webp b/site/assets/shots/it/together-tab-light.webp index be8489be4..475458fde 100644 Binary files a/site/assets/shots/it/together-tab-light.webp and b/site/assets/shots/it/together-tab-light.webp differ diff --git a/site/assets/shots/it/ts-found-dark.webp b/site/assets/shots/it/ts-found-dark.webp index c5373b305..04a723084 100644 Binary files a/site/assets/shots/it/ts-found-dark.webp and b/site/assets/shots/it/ts-found-dark.webp differ diff --git a/site/assets/shots/it/ts-found-light.webp b/site/assets/shots/it/ts-found-light.webp index 787cd669e..8baffcac0 100644 Binary files a/site/assets/shots/it/ts-found-light.webp and b/site/assets/shots/it/ts-found-light.webp differ diff --git a/site/assets/shots/it/upload-dark.webp b/site/assets/shots/it/upload-dark.webp index c38f84371..b8c167366 100644 Binary files a/site/assets/shots/it/upload-dark.webp and b/site/assets/shots/it/upload-dark.webp differ diff --git a/site/assets/shots/it/upload-light.webp b/site/assets/shots/it/upload-light.webp index 36eacb1f3..03d69570d 100644 Binary files a/site/assets/shots/it/upload-light.webp and b/site/assets/shots/it/upload-light.webp differ diff --git a/site/assets/shots/it/workshop-dark.webp b/site/assets/shots/it/workshop-dark.webp index b68e91ee3..589b57f59 100644 Binary files a/site/assets/shots/it/workshop-dark.webp and b/site/assets/shots/it/workshop-dark.webp differ diff --git a/site/assets/shots/it/workshop-light.webp b/site/assets/shots/it/workshop-light.webp index 3ec68cdc3..77cbea688 100644 Binary files a/site/assets/shots/it/workshop-light.webp and b/site/assets/shots/it/workshop-light.webp differ diff --git a/site/assets/shots/ja/add-ps5-dark.webp b/site/assets/shots/ja/add-ps5-dark.webp index cf39996da..16e3b527d 100644 Binary files a/site/assets/shots/ja/add-ps5-dark.webp and b/site/assets/shots/ja/add-ps5-dark.webp differ diff --git a/site/assets/shots/ja/add-ps5-light.webp b/site/assets/shots/ja/add-ps5-light.webp index 62f77c929..267e633f1 100644 Binary files a/site/assets/shots/ja/add-ps5-light.webp and b/site/assets/shots/ja/add-ps5-light.webp differ diff --git a/site/assets/shots/ja/approval-dark.webp b/site/assets/shots/ja/approval-dark.webp index 6c2e4ebea..1eba577c6 100644 Binary files a/site/assets/shots/ja/approval-dark.webp and b/site/assets/shots/ja/approval-dark.webp differ diff --git a/site/assets/shots/ja/approval-light.webp b/site/assets/shots/ja/approval-light.webp index 78c184c23..546793157 100644 Binary files a/site/assets/shots/ja/approval-light.webp and b/site/assets/shots/ja/approval-light.webp differ diff --git a/site/assets/shots/ja/connection-dark.webp b/site/assets/shots/ja/connection-dark.webp index 50a384a0b..6693252ef 100644 Binary files a/site/assets/shots/ja/connection-dark.webp and b/site/assets/shots/ja/connection-dark.webp differ diff --git a/site/assets/shots/ja/connection-light.webp b/site/assets/shots/ja/connection-light.webp index 0d68c37e7..348f3f912 100644 Binary files a/site/assets/shots/ja/connection-light.webp and b/site/assets/shots/ja/connection-light.webp differ diff --git a/site/assets/shots/ja/consoles-dark.webp b/site/assets/shots/ja/consoles-dark.webp index a33575ac7..0c7140e39 100644 Binary files a/site/assets/shots/ja/consoles-dark.webp and b/site/assets/shots/ja/consoles-dark.webp differ diff --git a/site/assets/shots/ja/consoles-light.webp b/site/assets/shots/ja/consoles-light.webp index 058205f06..85fb0148f 100644 Binary files a/site/assets/shots/ja/consoles-light.webp and b/site/assets/shots/ja/consoles-light.webp differ diff --git a/site/assets/shots/ja/files-dark.webp b/site/assets/shots/ja/files-dark.webp index 9536e411b..45c4657d1 100644 Binary files a/site/assets/shots/ja/files-dark.webp and b/site/assets/shots/ja/files-dark.webp differ diff --git a/site/assets/shots/ja/files-light.webp b/site/assets/shots/ja/files-light.webp index 9cbd72a99..fae3c4751 100644 Binary files a/site/assets/shots/ja/files-light.webp and b/site/assets/shots/ja/files-light.webp differ diff --git a/site/assets/shots/ja/games-dark.webp b/site/assets/shots/ja/games-dark.webp index 93aebacbc..3029ffaba 100644 Binary files a/site/assets/shots/ja/games-dark.webp and b/site/assets/shots/ja/games-dark.webp differ diff --git a/site/assets/shots/ja/games-light.webp b/site/assets/shots/ja/games-light.webp index 221dc0819..cf7a34f65 100644 Binary files a/site/assets/shots/ja/games-light.webp and b/site/assets/shots/ja/games-light.webp differ diff --git a/site/assets/shots/ja/home-dark.webp b/site/assets/shots/ja/home-dark.webp index 62bf26773..f6a2a60a5 100644 Binary files a/site/assets/shots/ja/home-dark.webp and b/site/assets/shots/ja/home-dark.webp differ diff --git a/site/assets/shots/ja/home-light.webp b/site/assets/shots/ja/home-light.webp index e3443522c..bf78dfeb6 100644 Binary files a/site/assets/shots/ja/home-light.webp and b/site/assets/shots/ja/home-light.webp differ diff --git a/site/assets/shots/ja/invite-dark.webp b/site/assets/shots/ja/invite-dark.webp index afff8efb6..973aef46a 100644 Binary files a/site/assets/shots/ja/invite-dark.webp and b/site/assets/shots/ja/invite-dark.webp differ diff --git a/site/assets/shots/ja/invite-light.webp b/site/assets/shots/ja/invite-light.webp index 4f3039a6b..045d2025c 100644 Binary files a/site/assets/shots/ja/invite-light.webp and b/site/assets/shots/ja/invite-light.webp differ diff --git a/site/assets/shots/ja/kbm-dark.webp b/site/assets/shots/ja/kbm-dark.webp index 6602c767e..9558c457b 100644 Binary files a/site/assets/shots/ja/kbm-dark.webp and b/site/assets/shots/ja/kbm-dark.webp differ diff --git a/site/assets/shots/ja/kbm-light.webp b/site/assets/shots/ja/kbm-light.webp index 2bc566db5..c0347d183 100644 Binary files a/site/assets/shots/ja/kbm-light.webp and b/site/assets/shots/ja/kbm-light.webp differ diff --git a/site/assets/shots/ja/kbm-settings-dark.webp b/site/assets/shots/ja/kbm-settings-dark.webp index c868bfc2a..19c43dc5b 100644 Binary files a/site/assets/shots/ja/kbm-settings-dark.webp and b/site/assets/shots/ja/kbm-settings-dark.webp differ diff --git a/site/assets/shots/ja/kbm-settings-light.webp b/site/assets/shots/ja/kbm-settings-light.webp index 027659a1b..3d83f3806 100644 Binary files a/site/assets/shots/ja/kbm-settings-light.webp and b/site/assets/shots/ja/kbm-settings-light.webp differ diff --git a/site/assets/shots/ja/m-files-dark.webp b/site/assets/shots/ja/m-files-dark.webp index 2bdcfc1b7..741358949 100644 Binary files a/site/assets/shots/ja/m-files-dark.webp and b/site/assets/shots/ja/m-files-dark.webp differ diff --git a/site/assets/shots/ja/m-files-light.webp b/site/assets/shots/ja/m-files-light.webp index d467f3578..a8c41c07c 100644 Binary files a/site/assets/shots/ja/m-files-light.webp and b/site/assets/shots/ja/m-files-light.webp differ diff --git a/site/assets/shots/ja/m-games-dark.webp b/site/assets/shots/ja/m-games-dark.webp index b8eaa19b9..981af295d 100644 Binary files a/site/assets/shots/ja/m-games-dark.webp and b/site/assets/shots/ja/m-games-dark.webp differ diff --git a/site/assets/shots/ja/m-games-light.webp b/site/assets/shots/ja/m-games-light.webp index c8a8b3394..8d8dbbce1 100644 Binary files a/site/assets/shots/ja/m-games-light.webp and b/site/assets/shots/ja/m-games-light.webp differ diff --git a/site/assets/shots/ja/m-guest-dark.webp b/site/assets/shots/ja/m-guest-dark.webp index 8c11bd43a..134d917a4 100644 Binary files a/site/assets/shots/ja/m-guest-dark.webp and b/site/assets/shots/ja/m-guest-dark.webp differ diff --git a/site/assets/shots/ja/m-guest-light.webp b/site/assets/shots/ja/m-guest-light.webp index 567e4b2cc..134d917a4 100644 Binary files a/site/assets/shots/ja/m-guest-light.webp and b/site/assets/shots/ja/m-guest-light.webp differ diff --git a/site/assets/shots/ja/m-home-dark.webp b/site/assets/shots/ja/m-home-dark.webp index 4ca0459fb..203de3814 100644 Binary files a/site/assets/shots/ja/m-home-dark.webp and b/site/assets/shots/ja/m-home-dark.webp differ diff --git a/site/assets/shots/ja/m-home-light.webp b/site/assets/shots/ja/m-home-light.webp index 58d7d62bd..4f3649f87 100644 Binary files a/site/assets/shots/ja/m-home-light.webp and b/site/assets/shots/ja/m-home-light.webp differ diff --git a/site/assets/shots/ja/m-play-dark.webp b/site/assets/shots/ja/m-play-dark.webp index 4b5b190d0..94cad30e6 100644 Binary files a/site/assets/shots/ja/m-play-dark.webp and b/site/assets/shots/ja/m-play-dark.webp differ diff --git a/site/assets/shots/ja/m-play-light.webp b/site/assets/shots/ja/m-play-light.webp index b87dc9323..bc759d6be 100644 Binary files a/site/assets/shots/ja/m-play-light.webp and b/site/assets/shots/ja/m-play-light.webp differ diff --git a/site/assets/shots/ja/phones-dark.webp b/site/assets/shots/ja/phones-dark.webp index bf07d9eb9..770be7a47 100644 Binary files a/site/assets/shots/ja/phones-dark.webp and b/site/assets/shots/ja/phones-dark.webp differ diff --git a/site/assets/shots/ja/phones-light.webp b/site/assets/shots/ja/phones-light.webp index db949bb50..1006c732c 100644 Binary files a/site/assets/shots/ja/phones-light.webp and b/site/assets/shots/ja/phones-light.webp differ diff --git a/site/assets/shots/ja/pkg-name-dark.webp b/site/assets/shots/ja/pkg-name-dark.webp index 23680a0e7..2fb06bdb7 100644 Binary files a/site/assets/shots/ja/pkg-name-dark.webp and b/site/assets/shots/ja/pkg-name-dark.webp differ diff --git a/site/assets/shots/ja/pkg-name-light.webp b/site/assets/shots/ja/pkg-name-light.webp index 5727259fe..c86504894 100644 Binary files a/site/assets/shots/ja/pkg-name-light.webp and b/site/assets/shots/ja/pkg-name-light.webp differ diff --git a/site/assets/shots/ja/play-dark.webp b/site/assets/shots/ja/play-dark.webp index f879a166b..efbbda117 100644 Binary files a/site/assets/shots/ja/play-dark.webp and b/site/assets/shots/ja/play-dark.webp differ diff --git a/site/assets/shots/ja/play-light.webp b/site/assets/shots/ja/play-light.webp index 1e1939bd9..8a0e3071f 100644 Binary files a/site/assets/shots/ja/play-light.webp and b/site/assets/shots/ja/play-light.webp differ diff --git a/site/assets/shots/ja/receive-dark.webp b/site/assets/shots/ja/receive-dark.webp index d2574e12f..85734d515 100644 Binary files a/site/assets/shots/ja/receive-dark.webp and b/site/assets/shots/ja/receive-dark.webp differ diff --git a/site/assets/shots/ja/receive-light.webp b/site/assets/shots/ja/receive-light.webp index 1da8cd5fd..c9a1307bf 100644 Binary files a/site/assets/shots/ja/receive-light.webp and b/site/assets/shots/ja/receive-light.webp differ diff --git a/site/assets/shots/ja/setup-dark.webp b/site/assets/shots/ja/setup-dark.webp index bda281861..d78e90839 100644 Binary files a/site/assets/shots/ja/setup-dark.webp and b/site/assets/shots/ja/setup-dark.webp differ diff --git a/site/assets/shots/ja/setup-light.webp b/site/assets/shots/ja/setup-light.webp index d187fa848..d9e75f382 100644 Binary files a/site/assets/shots/ja/setup-light.webp and b/site/assets/shots/ja/setup-light.webp differ diff --git a/site/assets/shots/ja/share-dark.webp b/site/assets/shots/ja/share-dark.webp index 9fd208614..63a743a9b 100644 Binary files a/site/assets/shots/ja/share-dark.webp and b/site/assets/shots/ja/share-dark.webp differ diff --git a/site/assets/shots/ja/share-light.webp b/site/assets/shots/ja/share-light.webp index 91acba4c1..ce78d5f9a 100644 Binary files a/site/assets/shots/ja/share-light.webp and b/site/assets/shots/ja/share-light.webp differ diff --git a/site/assets/shots/ja/share-link-dark.webp b/site/assets/shots/ja/share-link-dark.webp index b29da08bc..9785bdf4d 100644 Binary files a/site/assets/shots/ja/share-link-dark.webp and b/site/assets/shots/ja/share-link-dark.webp differ diff --git a/site/assets/shots/ja/share-link-light.webp b/site/assets/shots/ja/share-link-light.webp index f2ee37a8d..fa45f96fd 100644 Binary files a/site/assets/shots/ja/share-link-light.webp and b/site/assets/shots/ja/share-link-light.webp differ diff --git a/site/assets/shots/ja/tailscale-connection-dark.webp b/site/assets/shots/ja/tailscale-connection-dark.webp index d26d23513..20b8dfd47 100644 Binary files a/site/assets/shots/ja/tailscale-connection-dark.webp and b/site/assets/shots/ja/tailscale-connection-dark.webp differ diff --git a/site/assets/shots/ja/tailscale-connection-light.webp b/site/assets/shots/ja/tailscale-connection-light.webp index feccc15d2..14388ffee 100644 Binary files a/site/assets/shots/ja/tailscale-connection-light.webp and b/site/assets/shots/ja/tailscale-connection-light.webp differ diff --git a/site/assets/shots/ja/tailscale-settings-dark.webp b/site/assets/shots/ja/tailscale-settings-dark.webp index 501e1d2ac..60437316f 100644 Binary files a/site/assets/shots/ja/tailscale-settings-dark.webp and b/site/assets/shots/ja/tailscale-settings-dark.webp differ diff --git a/site/assets/shots/ja/tailscale-settings-light.webp b/site/assets/shots/ja/tailscale-settings-light.webp index c1875eb7a..06e893078 100644 Binary files a/site/assets/shots/ja/tailscale-settings-light.webp and b/site/assets/shots/ja/tailscale-settings-light.webp differ diff --git a/site/assets/shots/ja/together-net-dark.webp b/site/assets/shots/ja/together-net-dark.webp index 9b9a79b82..8f6d0ec90 100644 Binary files a/site/assets/shots/ja/together-net-dark.webp and b/site/assets/shots/ja/together-net-dark.webp differ diff --git a/site/assets/shots/ja/together-net-light.webp b/site/assets/shots/ja/together-net-light.webp index b87f903ab..e025f1493 100644 Binary files a/site/assets/shots/ja/together-net-light.webp and b/site/assets/shots/ja/together-net-light.webp differ diff --git a/site/assets/shots/ja/together-tab-dark.webp b/site/assets/shots/ja/together-tab-dark.webp index 143b8f7fe..c0530a18c 100644 Binary files a/site/assets/shots/ja/together-tab-dark.webp and b/site/assets/shots/ja/together-tab-dark.webp differ diff --git a/site/assets/shots/ja/together-tab-light.webp b/site/assets/shots/ja/together-tab-light.webp index 93097fb6e..fe2e1ee40 100644 Binary files a/site/assets/shots/ja/together-tab-light.webp and b/site/assets/shots/ja/together-tab-light.webp differ diff --git a/site/assets/shots/ja/ts-found-dark.webp b/site/assets/shots/ja/ts-found-dark.webp index ecd9985d2..d51110e87 100644 Binary files a/site/assets/shots/ja/ts-found-dark.webp and b/site/assets/shots/ja/ts-found-dark.webp differ diff --git a/site/assets/shots/ja/ts-found-light.webp b/site/assets/shots/ja/ts-found-light.webp index a0b05b02d..f6e37cc48 100644 Binary files a/site/assets/shots/ja/ts-found-light.webp and b/site/assets/shots/ja/ts-found-light.webp differ diff --git a/site/assets/shots/ja/upload-dark.webp b/site/assets/shots/ja/upload-dark.webp index 2569d6c18..4d3bf2ea6 100644 Binary files a/site/assets/shots/ja/upload-dark.webp and b/site/assets/shots/ja/upload-dark.webp differ diff --git a/site/assets/shots/ja/upload-light.webp b/site/assets/shots/ja/upload-light.webp index c9d7a9d2b..8db3c6292 100644 Binary files a/site/assets/shots/ja/upload-light.webp and b/site/assets/shots/ja/upload-light.webp differ diff --git a/site/assets/shots/ja/workshop-dark.webp b/site/assets/shots/ja/workshop-dark.webp index cd050362c..544a9d26c 100644 Binary files a/site/assets/shots/ja/workshop-dark.webp and b/site/assets/shots/ja/workshop-dark.webp differ diff --git a/site/assets/shots/ja/workshop-light.webp b/site/assets/shots/ja/workshop-light.webp index 7432206a5..09acc68f9 100644 Binary files a/site/assets/shots/ja/workshop-light.webp and b/site/assets/shots/ja/workshop-light.webp differ diff --git a/site/assets/shots/kbm-dark.webp b/site/assets/shots/kbm-dark.webp index 610ea959f..bf51778c6 100644 Binary files a/site/assets/shots/kbm-dark.webp and b/site/assets/shots/kbm-dark.webp differ diff --git a/site/assets/shots/kbm-light.webp b/site/assets/shots/kbm-light.webp index 52f6e3978..3e270c403 100644 Binary files a/site/assets/shots/kbm-light.webp and b/site/assets/shots/kbm-light.webp differ diff --git a/site/assets/shots/kbm-settings-dark.webp b/site/assets/shots/kbm-settings-dark.webp index 99c4aded8..adec1f8e8 100644 Binary files a/site/assets/shots/kbm-settings-dark.webp and b/site/assets/shots/kbm-settings-dark.webp differ diff --git a/site/assets/shots/kbm-settings-light.webp b/site/assets/shots/kbm-settings-light.webp index 9271b8b3f..862068c6d 100644 Binary files a/site/assets/shots/kbm-settings-light.webp and b/site/assets/shots/kbm-settings-light.webp differ diff --git a/site/assets/shots/ko/add-ps5-dark.webp b/site/assets/shots/ko/add-ps5-dark.webp index 3037d292f..86d1de004 100644 Binary files a/site/assets/shots/ko/add-ps5-dark.webp and b/site/assets/shots/ko/add-ps5-dark.webp differ diff --git a/site/assets/shots/ko/add-ps5-light.webp b/site/assets/shots/ko/add-ps5-light.webp index 91b0679d2..9cfbd0698 100644 Binary files a/site/assets/shots/ko/add-ps5-light.webp and b/site/assets/shots/ko/add-ps5-light.webp differ diff --git a/site/assets/shots/ko/approval-dark.webp b/site/assets/shots/ko/approval-dark.webp index 25c346b65..41a91da68 100644 Binary files a/site/assets/shots/ko/approval-dark.webp and b/site/assets/shots/ko/approval-dark.webp differ diff --git a/site/assets/shots/ko/approval-light.webp b/site/assets/shots/ko/approval-light.webp index db2a6d1c1..bc0fb8c8e 100644 Binary files a/site/assets/shots/ko/approval-light.webp and b/site/assets/shots/ko/approval-light.webp differ diff --git a/site/assets/shots/ko/connection-dark.webp b/site/assets/shots/ko/connection-dark.webp index 35025749a..05a0172e6 100644 Binary files a/site/assets/shots/ko/connection-dark.webp and b/site/assets/shots/ko/connection-dark.webp differ diff --git a/site/assets/shots/ko/connection-light.webp b/site/assets/shots/ko/connection-light.webp index 1804dfc57..3878ec70f 100644 Binary files a/site/assets/shots/ko/connection-light.webp and b/site/assets/shots/ko/connection-light.webp differ diff --git a/site/assets/shots/ko/consoles-dark.webp b/site/assets/shots/ko/consoles-dark.webp index 360d2130b..034868693 100644 Binary files a/site/assets/shots/ko/consoles-dark.webp and b/site/assets/shots/ko/consoles-dark.webp differ diff --git a/site/assets/shots/ko/consoles-light.webp b/site/assets/shots/ko/consoles-light.webp index ea1402b0f..31ba42cd0 100644 Binary files a/site/assets/shots/ko/consoles-light.webp and b/site/assets/shots/ko/consoles-light.webp differ diff --git a/site/assets/shots/ko/files-dark.webp b/site/assets/shots/ko/files-dark.webp index a4134f9e1..35eaaa57e 100644 Binary files a/site/assets/shots/ko/files-dark.webp and b/site/assets/shots/ko/files-dark.webp differ diff --git a/site/assets/shots/ko/files-light.webp b/site/assets/shots/ko/files-light.webp index 7b86d0679..49b07fcaf 100644 Binary files a/site/assets/shots/ko/files-light.webp and b/site/assets/shots/ko/files-light.webp differ diff --git a/site/assets/shots/ko/games-dark.webp b/site/assets/shots/ko/games-dark.webp index e803db82a..ae9a95293 100644 Binary files a/site/assets/shots/ko/games-dark.webp and b/site/assets/shots/ko/games-dark.webp differ diff --git a/site/assets/shots/ko/games-light.webp b/site/assets/shots/ko/games-light.webp index b7c05df08..a3554dd5c 100644 Binary files a/site/assets/shots/ko/games-light.webp and b/site/assets/shots/ko/games-light.webp differ diff --git a/site/assets/shots/ko/home-dark.webp b/site/assets/shots/ko/home-dark.webp index b35a527b4..dccfef392 100644 Binary files a/site/assets/shots/ko/home-dark.webp and b/site/assets/shots/ko/home-dark.webp differ diff --git a/site/assets/shots/ko/home-light.webp b/site/assets/shots/ko/home-light.webp index 57fe5a5f0..51ceda60c 100644 Binary files a/site/assets/shots/ko/home-light.webp and b/site/assets/shots/ko/home-light.webp differ diff --git a/site/assets/shots/ko/invite-dark.webp b/site/assets/shots/ko/invite-dark.webp index 214341f28..051d7f7dd 100644 Binary files a/site/assets/shots/ko/invite-dark.webp and b/site/assets/shots/ko/invite-dark.webp differ diff --git a/site/assets/shots/ko/invite-light.webp b/site/assets/shots/ko/invite-light.webp index 780917cab..e03342ce8 100644 Binary files a/site/assets/shots/ko/invite-light.webp and b/site/assets/shots/ko/invite-light.webp differ diff --git a/site/assets/shots/ko/kbm-dark.webp b/site/assets/shots/ko/kbm-dark.webp index ab9b4c76e..032264479 100644 Binary files a/site/assets/shots/ko/kbm-dark.webp and b/site/assets/shots/ko/kbm-dark.webp differ diff --git a/site/assets/shots/ko/kbm-light.webp b/site/assets/shots/ko/kbm-light.webp index b9b0224a3..29bc4099b 100644 Binary files a/site/assets/shots/ko/kbm-light.webp and b/site/assets/shots/ko/kbm-light.webp differ diff --git a/site/assets/shots/ko/kbm-settings-dark.webp b/site/assets/shots/ko/kbm-settings-dark.webp index 69799a9a0..2d925b1c3 100644 Binary files a/site/assets/shots/ko/kbm-settings-dark.webp and b/site/assets/shots/ko/kbm-settings-dark.webp differ diff --git a/site/assets/shots/ko/kbm-settings-light.webp b/site/assets/shots/ko/kbm-settings-light.webp index bd9b8fb20..0eb1c1ffa 100644 Binary files a/site/assets/shots/ko/kbm-settings-light.webp and b/site/assets/shots/ko/kbm-settings-light.webp differ diff --git a/site/assets/shots/ko/m-files-dark.webp b/site/assets/shots/ko/m-files-dark.webp index fbed1bd8d..6dfa46bed 100644 Binary files a/site/assets/shots/ko/m-files-dark.webp and b/site/assets/shots/ko/m-files-dark.webp differ diff --git a/site/assets/shots/ko/m-files-light.webp b/site/assets/shots/ko/m-files-light.webp index 9fe8b87fc..badcb4269 100644 Binary files a/site/assets/shots/ko/m-files-light.webp and b/site/assets/shots/ko/m-files-light.webp differ diff --git a/site/assets/shots/ko/m-games-dark.webp b/site/assets/shots/ko/m-games-dark.webp index a8b64fb12..cf485b6b1 100644 Binary files a/site/assets/shots/ko/m-games-dark.webp and b/site/assets/shots/ko/m-games-dark.webp differ diff --git a/site/assets/shots/ko/m-games-light.webp b/site/assets/shots/ko/m-games-light.webp index 6a887b580..44ccbeff9 100644 Binary files a/site/assets/shots/ko/m-games-light.webp and b/site/assets/shots/ko/m-games-light.webp differ diff --git a/site/assets/shots/ko/m-guest-dark.webp b/site/assets/shots/ko/m-guest-dark.webp index fe57870d5..b4c94fcff 100644 Binary files a/site/assets/shots/ko/m-guest-dark.webp and b/site/assets/shots/ko/m-guest-dark.webp differ diff --git a/site/assets/shots/ko/m-guest-light.webp b/site/assets/shots/ko/m-guest-light.webp index 8c11bd43a..90c5c5869 100644 Binary files a/site/assets/shots/ko/m-guest-light.webp and b/site/assets/shots/ko/m-guest-light.webp differ diff --git a/site/assets/shots/ko/m-home-dark.webp b/site/assets/shots/ko/m-home-dark.webp index c201c2a1d..ae54a8f1c 100644 Binary files a/site/assets/shots/ko/m-home-dark.webp and b/site/assets/shots/ko/m-home-dark.webp differ diff --git a/site/assets/shots/ko/m-home-light.webp b/site/assets/shots/ko/m-home-light.webp index 3744fab69..f23798a3f 100644 Binary files a/site/assets/shots/ko/m-home-light.webp and b/site/assets/shots/ko/m-home-light.webp differ diff --git a/site/assets/shots/ko/m-play-dark.webp b/site/assets/shots/ko/m-play-dark.webp index 36cbf9959..1639afec9 100644 Binary files a/site/assets/shots/ko/m-play-dark.webp and b/site/assets/shots/ko/m-play-dark.webp differ diff --git a/site/assets/shots/ko/m-play-light.webp b/site/assets/shots/ko/m-play-light.webp index 2d94ab6b0..8a32551e3 100644 Binary files a/site/assets/shots/ko/m-play-light.webp and b/site/assets/shots/ko/m-play-light.webp differ diff --git a/site/assets/shots/ko/phones-dark.webp b/site/assets/shots/ko/phones-dark.webp index 5d5a25a7e..0f9353f5c 100644 Binary files a/site/assets/shots/ko/phones-dark.webp and b/site/assets/shots/ko/phones-dark.webp differ diff --git a/site/assets/shots/ko/phones-light.webp b/site/assets/shots/ko/phones-light.webp index 586808561..5ea84d183 100644 Binary files a/site/assets/shots/ko/phones-light.webp and b/site/assets/shots/ko/phones-light.webp differ diff --git a/site/assets/shots/ko/pkg-name-dark.webp b/site/assets/shots/ko/pkg-name-dark.webp index bda7b481d..d926f99ce 100644 Binary files a/site/assets/shots/ko/pkg-name-dark.webp and b/site/assets/shots/ko/pkg-name-dark.webp differ diff --git a/site/assets/shots/ko/pkg-name-light.webp b/site/assets/shots/ko/pkg-name-light.webp index c2bbc3ff7..07e1c1482 100644 Binary files a/site/assets/shots/ko/pkg-name-light.webp and b/site/assets/shots/ko/pkg-name-light.webp differ diff --git a/site/assets/shots/ko/play-dark.webp b/site/assets/shots/ko/play-dark.webp index d1cbdff4a..029b61b45 100644 Binary files a/site/assets/shots/ko/play-dark.webp and b/site/assets/shots/ko/play-dark.webp differ diff --git a/site/assets/shots/ko/play-light.webp b/site/assets/shots/ko/play-light.webp index fdbee559f..d6a3d35fd 100644 Binary files a/site/assets/shots/ko/play-light.webp and b/site/assets/shots/ko/play-light.webp differ diff --git a/site/assets/shots/ko/receive-dark.webp b/site/assets/shots/ko/receive-dark.webp index 038d55063..100ca76cd 100644 Binary files a/site/assets/shots/ko/receive-dark.webp and b/site/assets/shots/ko/receive-dark.webp differ diff --git a/site/assets/shots/ko/receive-light.webp b/site/assets/shots/ko/receive-light.webp index 4022aeb4b..998a8ee82 100644 Binary files a/site/assets/shots/ko/receive-light.webp and b/site/assets/shots/ko/receive-light.webp differ diff --git a/site/assets/shots/ko/setup-dark.webp b/site/assets/shots/ko/setup-dark.webp index c73760c78..5715c41c2 100644 Binary files a/site/assets/shots/ko/setup-dark.webp and b/site/assets/shots/ko/setup-dark.webp differ diff --git a/site/assets/shots/ko/setup-light.webp b/site/assets/shots/ko/setup-light.webp index 2f97ea271..59197cd47 100644 Binary files a/site/assets/shots/ko/setup-light.webp and b/site/assets/shots/ko/setup-light.webp differ diff --git a/site/assets/shots/ko/share-dark.webp b/site/assets/shots/ko/share-dark.webp index e995cad0e..161bdd487 100644 Binary files a/site/assets/shots/ko/share-dark.webp and b/site/assets/shots/ko/share-dark.webp differ diff --git a/site/assets/shots/ko/share-light.webp b/site/assets/shots/ko/share-light.webp index b023c505c..12c8dfbb9 100644 Binary files a/site/assets/shots/ko/share-light.webp and b/site/assets/shots/ko/share-light.webp differ diff --git a/site/assets/shots/ko/share-link-dark.webp b/site/assets/shots/ko/share-link-dark.webp index cafdefccf..78a83eb73 100644 Binary files a/site/assets/shots/ko/share-link-dark.webp and b/site/assets/shots/ko/share-link-dark.webp differ diff --git a/site/assets/shots/ko/share-link-light.webp b/site/assets/shots/ko/share-link-light.webp index 205097d2c..f09e45275 100644 Binary files a/site/assets/shots/ko/share-link-light.webp and b/site/assets/shots/ko/share-link-light.webp differ diff --git a/site/assets/shots/ko/tailscale-connection-dark.webp b/site/assets/shots/ko/tailscale-connection-dark.webp index a11b6f076..5e5a3880f 100644 Binary files a/site/assets/shots/ko/tailscale-connection-dark.webp and b/site/assets/shots/ko/tailscale-connection-dark.webp differ diff --git a/site/assets/shots/ko/tailscale-connection-light.webp b/site/assets/shots/ko/tailscale-connection-light.webp index 4608be825..a9c27518a 100644 Binary files a/site/assets/shots/ko/tailscale-connection-light.webp and b/site/assets/shots/ko/tailscale-connection-light.webp differ diff --git a/site/assets/shots/ko/tailscale-settings-dark.webp b/site/assets/shots/ko/tailscale-settings-dark.webp index a8ca10160..fc2ea1ece 100644 Binary files a/site/assets/shots/ko/tailscale-settings-dark.webp and b/site/assets/shots/ko/tailscale-settings-dark.webp differ diff --git a/site/assets/shots/ko/tailscale-settings-light.webp b/site/assets/shots/ko/tailscale-settings-light.webp index 169601e50..068efded2 100644 Binary files a/site/assets/shots/ko/tailscale-settings-light.webp and b/site/assets/shots/ko/tailscale-settings-light.webp differ diff --git a/site/assets/shots/ko/together-net-dark.webp b/site/assets/shots/ko/together-net-dark.webp index 630c0682d..192afe1c2 100644 Binary files a/site/assets/shots/ko/together-net-dark.webp and b/site/assets/shots/ko/together-net-dark.webp differ diff --git a/site/assets/shots/ko/together-net-light.webp b/site/assets/shots/ko/together-net-light.webp index a76c6ea02..732d90e8b 100644 Binary files a/site/assets/shots/ko/together-net-light.webp and b/site/assets/shots/ko/together-net-light.webp differ diff --git a/site/assets/shots/ko/together-tab-dark.webp b/site/assets/shots/ko/together-tab-dark.webp index f5753001a..88f3dec1e 100644 Binary files a/site/assets/shots/ko/together-tab-dark.webp and b/site/assets/shots/ko/together-tab-dark.webp differ diff --git a/site/assets/shots/ko/together-tab-light.webp b/site/assets/shots/ko/together-tab-light.webp index f2479d8a8..09d188817 100644 Binary files a/site/assets/shots/ko/together-tab-light.webp and b/site/assets/shots/ko/together-tab-light.webp differ diff --git a/site/assets/shots/ko/ts-found-dark.webp b/site/assets/shots/ko/ts-found-dark.webp index 0e87cd5bc..e6ab81068 100644 Binary files a/site/assets/shots/ko/ts-found-dark.webp and b/site/assets/shots/ko/ts-found-dark.webp differ diff --git a/site/assets/shots/ko/ts-found-light.webp b/site/assets/shots/ko/ts-found-light.webp index bc3fa03c2..26b85ce24 100644 Binary files a/site/assets/shots/ko/ts-found-light.webp and b/site/assets/shots/ko/ts-found-light.webp differ diff --git a/site/assets/shots/ko/upload-dark.webp b/site/assets/shots/ko/upload-dark.webp index 465912398..81bbaee94 100644 Binary files a/site/assets/shots/ko/upload-dark.webp and b/site/assets/shots/ko/upload-dark.webp differ diff --git a/site/assets/shots/ko/upload-light.webp b/site/assets/shots/ko/upload-light.webp index ee92c0c5f..cc6dfae74 100644 Binary files a/site/assets/shots/ko/upload-light.webp and b/site/assets/shots/ko/upload-light.webp differ diff --git a/site/assets/shots/ko/workshop-dark.webp b/site/assets/shots/ko/workshop-dark.webp index 9a6fc3d00..27dadd731 100644 Binary files a/site/assets/shots/ko/workshop-dark.webp and b/site/assets/shots/ko/workshop-dark.webp differ diff --git a/site/assets/shots/ko/workshop-light.webp b/site/assets/shots/ko/workshop-light.webp index de0ec199f..d791cda25 100644 Binary files a/site/assets/shots/ko/workshop-light.webp and b/site/assets/shots/ko/workshop-light.webp differ diff --git a/site/assets/shots/m-files-dark.webp b/site/assets/shots/m-files-dark.webp index d4971c30e..bf4ea431f 100644 Binary files a/site/assets/shots/m-files-dark.webp and b/site/assets/shots/m-files-dark.webp differ diff --git a/site/assets/shots/m-files-light.webp b/site/assets/shots/m-files-light.webp index 38548f466..bf4eaebe9 100644 Binary files a/site/assets/shots/m-files-light.webp and b/site/assets/shots/m-files-light.webp differ diff --git a/site/assets/shots/m-games-dark.webp b/site/assets/shots/m-games-dark.webp index 7454c7c59..6c5333d9a 100644 Binary files a/site/assets/shots/m-games-dark.webp and b/site/assets/shots/m-games-dark.webp differ diff --git a/site/assets/shots/m-games-light.webp b/site/assets/shots/m-games-light.webp index 0fd05844e..1f5302959 100644 Binary files a/site/assets/shots/m-games-light.webp and b/site/assets/shots/m-games-light.webp differ diff --git a/site/assets/shots/m-guest-dark.webp b/site/assets/shots/m-guest-dark.webp index fe57870d5..8c11bd43a 100644 Binary files a/site/assets/shots/m-guest-dark.webp and b/site/assets/shots/m-guest-dark.webp differ diff --git a/site/assets/shots/m-guest-light.webp b/site/assets/shots/m-guest-light.webp index 90c5c5869..be0f20d77 100644 Binary files a/site/assets/shots/m-guest-light.webp and b/site/assets/shots/m-guest-light.webp differ diff --git a/site/assets/shots/m-home-dark.webp b/site/assets/shots/m-home-dark.webp index 544b60776..b81404d1c 100644 Binary files a/site/assets/shots/m-home-dark.webp and b/site/assets/shots/m-home-dark.webp differ diff --git a/site/assets/shots/m-home-light.webp b/site/assets/shots/m-home-light.webp index 310092ed1..f6f4c5f3b 100644 Binary files a/site/assets/shots/m-home-light.webp and b/site/assets/shots/m-home-light.webp differ diff --git a/site/assets/shots/m-play-dark.webp b/site/assets/shots/m-play-dark.webp index b70bd1fec..e7ea16383 100644 Binary files a/site/assets/shots/m-play-dark.webp and b/site/assets/shots/m-play-dark.webp differ diff --git a/site/assets/shots/m-play-light.webp b/site/assets/shots/m-play-light.webp index 881bf0d84..686cc6f73 100644 Binary files a/site/assets/shots/m-play-light.webp and b/site/assets/shots/m-play-light.webp differ diff --git a/site/assets/shots/phones-dark.webp b/site/assets/shots/phones-dark.webp index b7c7b537b..121005f0d 100644 Binary files a/site/assets/shots/phones-dark.webp and b/site/assets/shots/phones-dark.webp differ diff --git a/site/assets/shots/phones-light.webp b/site/assets/shots/phones-light.webp index 13542518f..1d3f1704f 100644 Binary files a/site/assets/shots/phones-light.webp and b/site/assets/shots/phones-light.webp differ diff --git a/site/assets/shots/pkg-name-dark.webp b/site/assets/shots/pkg-name-dark.webp index 1162e818d..60f0fef40 100644 Binary files a/site/assets/shots/pkg-name-dark.webp and b/site/assets/shots/pkg-name-dark.webp differ diff --git a/site/assets/shots/pkg-name-light.webp b/site/assets/shots/pkg-name-light.webp index b080c8c96..d97cce829 100644 Binary files a/site/assets/shots/pkg-name-light.webp and b/site/assets/shots/pkg-name-light.webp differ diff --git a/site/assets/shots/pl/add-ps5-dark.webp b/site/assets/shots/pl/add-ps5-dark.webp index 4faece0a8..251b07407 100644 Binary files a/site/assets/shots/pl/add-ps5-dark.webp and b/site/assets/shots/pl/add-ps5-dark.webp differ diff --git a/site/assets/shots/pl/add-ps5-light.webp b/site/assets/shots/pl/add-ps5-light.webp index 347b20c2c..c8ab3019d 100644 Binary files a/site/assets/shots/pl/add-ps5-light.webp and b/site/assets/shots/pl/add-ps5-light.webp differ diff --git a/site/assets/shots/pl/approval-dark.webp b/site/assets/shots/pl/approval-dark.webp index 1106631e8..644636c35 100644 Binary files a/site/assets/shots/pl/approval-dark.webp and b/site/assets/shots/pl/approval-dark.webp differ diff --git a/site/assets/shots/pl/approval-light.webp b/site/assets/shots/pl/approval-light.webp index 6938649ae..da41bbea9 100644 Binary files a/site/assets/shots/pl/approval-light.webp and b/site/assets/shots/pl/approval-light.webp differ diff --git a/site/assets/shots/pl/connection-dark.webp b/site/assets/shots/pl/connection-dark.webp index e6b934bc7..f7eb09e78 100644 Binary files a/site/assets/shots/pl/connection-dark.webp and b/site/assets/shots/pl/connection-dark.webp differ diff --git a/site/assets/shots/pl/connection-light.webp b/site/assets/shots/pl/connection-light.webp index a178d506b..ce28b9021 100644 Binary files a/site/assets/shots/pl/connection-light.webp and b/site/assets/shots/pl/connection-light.webp differ diff --git a/site/assets/shots/pl/consoles-dark.webp b/site/assets/shots/pl/consoles-dark.webp index 2acac81c9..3883c0679 100644 Binary files a/site/assets/shots/pl/consoles-dark.webp and b/site/assets/shots/pl/consoles-dark.webp differ diff --git a/site/assets/shots/pl/consoles-light.webp b/site/assets/shots/pl/consoles-light.webp index b234dd642..93335bd84 100644 Binary files a/site/assets/shots/pl/consoles-light.webp and b/site/assets/shots/pl/consoles-light.webp differ diff --git a/site/assets/shots/pl/files-dark.webp b/site/assets/shots/pl/files-dark.webp index 50c0233fb..f3ad0a6ff 100644 Binary files a/site/assets/shots/pl/files-dark.webp and b/site/assets/shots/pl/files-dark.webp differ diff --git a/site/assets/shots/pl/files-light.webp b/site/assets/shots/pl/files-light.webp index 79fbceeac..a6ad23c9b 100644 Binary files a/site/assets/shots/pl/files-light.webp and b/site/assets/shots/pl/files-light.webp differ diff --git a/site/assets/shots/pl/games-dark.webp b/site/assets/shots/pl/games-dark.webp index 6bb6057cb..b27bd5de6 100644 Binary files a/site/assets/shots/pl/games-dark.webp and b/site/assets/shots/pl/games-dark.webp differ diff --git a/site/assets/shots/pl/games-light.webp b/site/assets/shots/pl/games-light.webp index dfd44cdbe..de8ba9e67 100644 Binary files a/site/assets/shots/pl/games-light.webp and b/site/assets/shots/pl/games-light.webp differ diff --git a/site/assets/shots/pl/home-dark.webp b/site/assets/shots/pl/home-dark.webp index a22958b29..043141915 100644 Binary files a/site/assets/shots/pl/home-dark.webp and b/site/assets/shots/pl/home-dark.webp differ diff --git a/site/assets/shots/pl/home-light.webp b/site/assets/shots/pl/home-light.webp index edc3b0e2c..f8bcbab53 100644 Binary files a/site/assets/shots/pl/home-light.webp and b/site/assets/shots/pl/home-light.webp differ diff --git a/site/assets/shots/pl/invite-dark.webp b/site/assets/shots/pl/invite-dark.webp index 82fcef3ed..790197f13 100644 Binary files a/site/assets/shots/pl/invite-dark.webp and b/site/assets/shots/pl/invite-dark.webp differ diff --git a/site/assets/shots/pl/invite-light.webp b/site/assets/shots/pl/invite-light.webp index 771ebc59a..7358351e1 100644 Binary files a/site/assets/shots/pl/invite-light.webp and b/site/assets/shots/pl/invite-light.webp differ diff --git a/site/assets/shots/pl/kbm-dark.webp b/site/assets/shots/pl/kbm-dark.webp index e0f71555a..6119ccc12 100644 Binary files a/site/assets/shots/pl/kbm-dark.webp and b/site/assets/shots/pl/kbm-dark.webp differ diff --git a/site/assets/shots/pl/kbm-light.webp b/site/assets/shots/pl/kbm-light.webp index 65c8564f6..32d6f7228 100644 Binary files a/site/assets/shots/pl/kbm-light.webp and b/site/assets/shots/pl/kbm-light.webp differ diff --git a/site/assets/shots/pl/kbm-settings-dark.webp b/site/assets/shots/pl/kbm-settings-dark.webp index 1333d6bf7..25a7307c7 100644 Binary files a/site/assets/shots/pl/kbm-settings-dark.webp and b/site/assets/shots/pl/kbm-settings-dark.webp differ diff --git a/site/assets/shots/pl/kbm-settings-light.webp b/site/assets/shots/pl/kbm-settings-light.webp index 41e51c211..b01bb2dff 100644 Binary files a/site/assets/shots/pl/kbm-settings-light.webp and b/site/assets/shots/pl/kbm-settings-light.webp differ diff --git a/site/assets/shots/pl/m-files-dark.webp b/site/assets/shots/pl/m-files-dark.webp index 6411fb334..216edf821 100644 Binary files a/site/assets/shots/pl/m-files-dark.webp and b/site/assets/shots/pl/m-files-dark.webp differ diff --git a/site/assets/shots/pl/m-files-light.webp b/site/assets/shots/pl/m-files-light.webp index 80e3432e5..a4b99eb95 100644 Binary files a/site/assets/shots/pl/m-files-light.webp and b/site/assets/shots/pl/m-files-light.webp differ diff --git a/site/assets/shots/pl/m-games-dark.webp b/site/assets/shots/pl/m-games-dark.webp index fdf30ec64..a98d39360 100644 Binary files a/site/assets/shots/pl/m-games-dark.webp and b/site/assets/shots/pl/m-games-dark.webp differ diff --git a/site/assets/shots/pl/m-games-light.webp b/site/assets/shots/pl/m-games-light.webp index 32ec9ed8d..f773310e7 100644 Binary files a/site/assets/shots/pl/m-games-light.webp and b/site/assets/shots/pl/m-games-light.webp differ diff --git a/site/assets/shots/pl/m-guest-dark.webp b/site/assets/shots/pl/m-guest-dark.webp index 8f9b7b740..90c5c5869 100644 Binary files a/site/assets/shots/pl/m-guest-dark.webp and b/site/assets/shots/pl/m-guest-dark.webp differ diff --git a/site/assets/shots/pl/m-guest-light.webp b/site/assets/shots/pl/m-guest-light.webp index 8c11bd43a..fae875a7e 100644 Binary files a/site/assets/shots/pl/m-guest-light.webp and b/site/assets/shots/pl/m-guest-light.webp differ diff --git a/site/assets/shots/pl/m-home-dark.webp b/site/assets/shots/pl/m-home-dark.webp index 8fe3a5946..56fb3fe01 100644 Binary files a/site/assets/shots/pl/m-home-dark.webp and b/site/assets/shots/pl/m-home-dark.webp differ diff --git a/site/assets/shots/pl/m-home-light.webp b/site/assets/shots/pl/m-home-light.webp index b771d2042..1c7e23c26 100644 Binary files a/site/assets/shots/pl/m-home-light.webp and b/site/assets/shots/pl/m-home-light.webp differ diff --git a/site/assets/shots/pl/m-play-dark.webp b/site/assets/shots/pl/m-play-dark.webp index 1cb463045..4950a338a 100644 Binary files a/site/assets/shots/pl/m-play-dark.webp and b/site/assets/shots/pl/m-play-dark.webp differ diff --git a/site/assets/shots/pl/m-play-light.webp b/site/assets/shots/pl/m-play-light.webp index 18ad4a49f..1f8741680 100644 Binary files a/site/assets/shots/pl/m-play-light.webp and b/site/assets/shots/pl/m-play-light.webp differ diff --git a/site/assets/shots/pl/phones-dark.webp b/site/assets/shots/pl/phones-dark.webp index 0c9b2304e..9e4f52dd0 100644 Binary files a/site/assets/shots/pl/phones-dark.webp and b/site/assets/shots/pl/phones-dark.webp differ diff --git a/site/assets/shots/pl/phones-light.webp b/site/assets/shots/pl/phones-light.webp index 0fcfe4280..7c6d4eff4 100644 Binary files a/site/assets/shots/pl/phones-light.webp and b/site/assets/shots/pl/phones-light.webp differ diff --git a/site/assets/shots/pl/pkg-name-dark.webp b/site/assets/shots/pl/pkg-name-dark.webp index a0d7a25ac..25b7e2507 100644 Binary files a/site/assets/shots/pl/pkg-name-dark.webp and b/site/assets/shots/pl/pkg-name-dark.webp differ diff --git a/site/assets/shots/pl/pkg-name-light.webp b/site/assets/shots/pl/pkg-name-light.webp index 9771808d9..222dc7430 100644 Binary files a/site/assets/shots/pl/pkg-name-light.webp and b/site/assets/shots/pl/pkg-name-light.webp differ diff --git a/site/assets/shots/pl/play-dark.webp b/site/assets/shots/pl/play-dark.webp index 2b4dad9f5..62211a4ec 100644 Binary files a/site/assets/shots/pl/play-dark.webp and b/site/assets/shots/pl/play-dark.webp differ diff --git a/site/assets/shots/pl/play-light.webp b/site/assets/shots/pl/play-light.webp index 658bd9c91..ce3313f80 100644 Binary files a/site/assets/shots/pl/play-light.webp and b/site/assets/shots/pl/play-light.webp differ diff --git a/site/assets/shots/pl/receive-dark.webp b/site/assets/shots/pl/receive-dark.webp index 6356850e0..e57f17d7e 100644 Binary files a/site/assets/shots/pl/receive-dark.webp and b/site/assets/shots/pl/receive-dark.webp differ diff --git a/site/assets/shots/pl/receive-light.webp b/site/assets/shots/pl/receive-light.webp index 8f866481a..9843ccec8 100644 Binary files a/site/assets/shots/pl/receive-light.webp and b/site/assets/shots/pl/receive-light.webp differ diff --git a/site/assets/shots/pl/setup-dark.webp b/site/assets/shots/pl/setup-dark.webp index c2b110fdc..08cdb0d90 100644 Binary files a/site/assets/shots/pl/setup-dark.webp and b/site/assets/shots/pl/setup-dark.webp differ diff --git a/site/assets/shots/pl/setup-light.webp b/site/assets/shots/pl/setup-light.webp index 23bc40e6d..ebe6d15a1 100644 Binary files a/site/assets/shots/pl/setup-light.webp and b/site/assets/shots/pl/setup-light.webp differ diff --git a/site/assets/shots/pl/share-dark.webp b/site/assets/shots/pl/share-dark.webp index d6a1fd5cb..58c0b2397 100644 Binary files a/site/assets/shots/pl/share-dark.webp and b/site/assets/shots/pl/share-dark.webp differ diff --git a/site/assets/shots/pl/share-light.webp b/site/assets/shots/pl/share-light.webp index 9b7fefe5f..f302e855a 100644 Binary files a/site/assets/shots/pl/share-light.webp and b/site/assets/shots/pl/share-light.webp differ diff --git a/site/assets/shots/pl/share-link-dark.webp b/site/assets/shots/pl/share-link-dark.webp index e1fb65384..daf520b77 100644 Binary files a/site/assets/shots/pl/share-link-dark.webp and b/site/assets/shots/pl/share-link-dark.webp differ diff --git a/site/assets/shots/pl/share-link-light.webp b/site/assets/shots/pl/share-link-light.webp index d41acb5ac..1065a4eaa 100644 Binary files a/site/assets/shots/pl/share-link-light.webp and b/site/assets/shots/pl/share-link-light.webp differ diff --git a/site/assets/shots/pl/tailscale-connection-dark.webp b/site/assets/shots/pl/tailscale-connection-dark.webp index adf7e69a3..5a988a605 100644 Binary files a/site/assets/shots/pl/tailscale-connection-dark.webp and b/site/assets/shots/pl/tailscale-connection-dark.webp differ diff --git a/site/assets/shots/pl/tailscale-connection-light.webp b/site/assets/shots/pl/tailscale-connection-light.webp index d8c11c223..5cfef0b4e 100644 Binary files a/site/assets/shots/pl/tailscale-connection-light.webp and b/site/assets/shots/pl/tailscale-connection-light.webp differ diff --git a/site/assets/shots/pl/tailscale-settings-dark.webp b/site/assets/shots/pl/tailscale-settings-dark.webp index 4e12c50a4..0150bccae 100644 Binary files a/site/assets/shots/pl/tailscale-settings-dark.webp and b/site/assets/shots/pl/tailscale-settings-dark.webp differ diff --git a/site/assets/shots/pl/tailscale-settings-light.webp b/site/assets/shots/pl/tailscale-settings-light.webp index 97e55c0c0..bc785630a 100644 Binary files a/site/assets/shots/pl/tailscale-settings-light.webp and b/site/assets/shots/pl/tailscale-settings-light.webp differ diff --git a/site/assets/shots/pl/together-net-dark.webp b/site/assets/shots/pl/together-net-dark.webp index fbe648ff0..72c21579d 100644 Binary files a/site/assets/shots/pl/together-net-dark.webp and b/site/assets/shots/pl/together-net-dark.webp differ diff --git a/site/assets/shots/pl/together-net-light.webp b/site/assets/shots/pl/together-net-light.webp index 5d8c59565..dea9c39e4 100644 Binary files a/site/assets/shots/pl/together-net-light.webp and b/site/assets/shots/pl/together-net-light.webp differ diff --git a/site/assets/shots/pl/together-tab-dark.webp b/site/assets/shots/pl/together-tab-dark.webp index b0a161cbf..9bfa80d9a 100644 Binary files a/site/assets/shots/pl/together-tab-dark.webp and b/site/assets/shots/pl/together-tab-dark.webp differ diff --git a/site/assets/shots/pl/together-tab-light.webp b/site/assets/shots/pl/together-tab-light.webp index 3448e4a6b..9254115f3 100644 Binary files a/site/assets/shots/pl/together-tab-light.webp and b/site/assets/shots/pl/together-tab-light.webp differ diff --git a/site/assets/shots/pl/ts-found-dark.webp b/site/assets/shots/pl/ts-found-dark.webp index 239d903c8..8599fa2c9 100644 Binary files a/site/assets/shots/pl/ts-found-dark.webp and b/site/assets/shots/pl/ts-found-dark.webp differ diff --git a/site/assets/shots/pl/ts-found-light.webp b/site/assets/shots/pl/ts-found-light.webp index 2ed4cb45b..3c6834f74 100644 Binary files a/site/assets/shots/pl/ts-found-light.webp and b/site/assets/shots/pl/ts-found-light.webp differ diff --git a/site/assets/shots/pl/upload-dark.webp b/site/assets/shots/pl/upload-dark.webp index f70f8bd34..2c3d1fb9b 100644 Binary files a/site/assets/shots/pl/upload-dark.webp and b/site/assets/shots/pl/upload-dark.webp differ diff --git a/site/assets/shots/pl/upload-light.webp b/site/assets/shots/pl/upload-light.webp index ef11ecda5..572bb6433 100644 Binary files a/site/assets/shots/pl/upload-light.webp and b/site/assets/shots/pl/upload-light.webp differ diff --git a/site/assets/shots/pl/workshop-dark.webp b/site/assets/shots/pl/workshop-dark.webp index 3c5c9b4de..e8ee6b7e9 100644 Binary files a/site/assets/shots/pl/workshop-dark.webp and b/site/assets/shots/pl/workshop-dark.webp differ diff --git a/site/assets/shots/pl/workshop-light.webp b/site/assets/shots/pl/workshop-light.webp index 74689ccb2..f5e8c38d9 100644 Binary files a/site/assets/shots/pl/workshop-light.webp and b/site/assets/shots/pl/workshop-light.webp differ diff --git a/site/assets/shots/play-dark.webp b/site/assets/shots/play-dark.webp index 4c89f7235..3dc1067ea 100644 Binary files a/site/assets/shots/play-dark.webp and b/site/assets/shots/play-dark.webp differ diff --git a/site/assets/shots/play-light.webp b/site/assets/shots/play-light.webp index 96b6ebbc0..4e039e9d3 100644 Binary files a/site/assets/shots/play-light.webp and b/site/assets/shots/play-light.webp differ diff --git a/site/assets/shots/pt-BR/add-ps5-dark.webp b/site/assets/shots/pt-BR/add-ps5-dark.webp index cfa441822..b9bd77d22 100644 Binary files a/site/assets/shots/pt-BR/add-ps5-dark.webp and b/site/assets/shots/pt-BR/add-ps5-dark.webp differ diff --git a/site/assets/shots/pt-BR/add-ps5-light.webp b/site/assets/shots/pt-BR/add-ps5-light.webp index d10825548..95ada439d 100644 Binary files a/site/assets/shots/pt-BR/add-ps5-light.webp and b/site/assets/shots/pt-BR/add-ps5-light.webp differ diff --git a/site/assets/shots/pt-BR/approval-dark.webp b/site/assets/shots/pt-BR/approval-dark.webp index 9efee16ea..02de4fb32 100644 Binary files a/site/assets/shots/pt-BR/approval-dark.webp and b/site/assets/shots/pt-BR/approval-dark.webp differ diff --git a/site/assets/shots/pt-BR/approval-light.webp b/site/assets/shots/pt-BR/approval-light.webp index 2db3fa11b..5cc6faf68 100644 Binary files a/site/assets/shots/pt-BR/approval-light.webp and b/site/assets/shots/pt-BR/approval-light.webp differ diff --git a/site/assets/shots/pt-BR/connection-dark.webp b/site/assets/shots/pt-BR/connection-dark.webp index defb060fa..ad8ab135b 100644 Binary files a/site/assets/shots/pt-BR/connection-dark.webp and b/site/assets/shots/pt-BR/connection-dark.webp differ diff --git a/site/assets/shots/pt-BR/connection-light.webp b/site/assets/shots/pt-BR/connection-light.webp index 1ae613342..d60d63874 100644 Binary files a/site/assets/shots/pt-BR/connection-light.webp and b/site/assets/shots/pt-BR/connection-light.webp differ diff --git a/site/assets/shots/pt-BR/consoles-dark.webp b/site/assets/shots/pt-BR/consoles-dark.webp index dd46e797e..eb65a83f3 100644 Binary files a/site/assets/shots/pt-BR/consoles-dark.webp and b/site/assets/shots/pt-BR/consoles-dark.webp differ diff --git a/site/assets/shots/pt-BR/consoles-light.webp b/site/assets/shots/pt-BR/consoles-light.webp index 95da338aa..a905d485f 100644 Binary files a/site/assets/shots/pt-BR/consoles-light.webp and b/site/assets/shots/pt-BR/consoles-light.webp differ diff --git a/site/assets/shots/pt-BR/files-dark.webp b/site/assets/shots/pt-BR/files-dark.webp index 28dae779f..f7b8c7096 100644 Binary files a/site/assets/shots/pt-BR/files-dark.webp and b/site/assets/shots/pt-BR/files-dark.webp differ diff --git a/site/assets/shots/pt-BR/files-light.webp b/site/assets/shots/pt-BR/files-light.webp index 4d3e1e795..0452b658d 100644 Binary files a/site/assets/shots/pt-BR/files-light.webp and b/site/assets/shots/pt-BR/files-light.webp differ diff --git a/site/assets/shots/pt-BR/games-dark.webp b/site/assets/shots/pt-BR/games-dark.webp index 088f0ed3a..3186b721f 100644 Binary files a/site/assets/shots/pt-BR/games-dark.webp and b/site/assets/shots/pt-BR/games-dark.webp differ diff --git a/site/assets/shots/pt-BR/games-light.webp b/site/assets/shots/pt-BR/games-light.webp index febfe16d2..afbc4fda5 100644 Binary files a/site/assets/shots/pt-BR/games-light.webp and b/site/assets/shots/pt-BR/games-light.webp differ diff --git a/site/assets/shots/pt-BR/home-dark.webp b/site/assets/shots/pt-BR/home-dark.webp index 7082419a6..973d462ab 100644 Binary files a/site/assets/shots/pt-BR/home-dark.webp and b/site/assets/shots/pt-BR/home-dark.webp differ diff --git a/site/assets/shots/pt-BR/home-light.webp b/site/assets/shots/pt-BR/home-light.webp index a80c9e6e4..9e92310a2 100644 Binary files a/site/assets/shots/pt-BR/home-light.webp and b/site/assets/shots/pt-BR/home-light.webp differ diff --git a/site/assets/shots/pt-BR/invite-dark.webp b/site/assets/shots/pt-BR/invite-dark.webp index 4eba4e199..8409991df 100644 Binary files a/site/assets/shots/pt-BR/invite-dark.webp and b/site/assets/shots/pt-BR/invite-dark.webp differ diff --git a/site/assets/shots/pt-BR/invite-light.webp b/site/assets/shots/pt-BR/invite-light.webp index 84603678f..7644e219d 100644 Binary files a/site/assets/shots/pt-BR/invite-light.webp and b/site/assets/shots/pt-BR/invite-light.webp differ diff --git a/site/assets/shots/pt-BR/kbm-dark.webp b/site/assets/shots/pt-BR/kbm-dark.webp index 45b90dc54..ab685c5a6 100644 Binary files a/site/assets/shots/pt-BR/kbm-dark.webp and b/site/assets/shots/pt-BR/kbm-dark.webp differ diff --git a/site/assets/shots/pt-BR/kbm-light.webp b/site/assets/shots/pt-BR/kbm-light.webp index 1c685ba72..250bda5ce 100644 Binary files a/site/assets/shots/pt-BR/kbm-light.webp and b/site/assets/shots/pt-BR/kbm-light.webp differ diff --git a/site/assets/shots/pt-BR/kbm-settings-dark.webp b/site/assets/shots/pt-BR/kbm-settings-dark.webp index 309f14c0e..ef331b1a1 100644 Binary files a/site/assets/shots/pt-BR/kbm-settings-dark.webp and b/site/assets/shots/pt-BR/kbm-settings-dark.webp differ diff --git a/site/assets/shots/pt-BR/kbm-settings-light.webp b/site/assets/shots/pt-BR/kbm-settings-light.webp index 2bb0534c0..2e0c4ba18 100644 Binary files a/site/assets/shots/pt-BR/kbm-settings-light.webp and b/site/assets/shots/pt-BR/kbm-settings-light.webp differ diff --git a/site/assets/shots/pt-BR/m-files-dark.webp b/site/assets/shots/pt-BR/m-files-dark.webp index 3326f294e..cee2b878d 100644 Binary files a/site/assets/shots/pt-BR/m-files-dark.webp and b/site/assets/shots/pt-BR/m-files-dark.webp differ diff --git a/site/assets/shots/pt-BR/m-files-light.webp b/site/assets/shots/pt-BR/m-files-light.webp index 9ce2284e0..d5b357697 100644 Binary files a/site/assets/shots/pt-BR/m-files-light.webp and b/site/assets/shots/pt-BR/m-files-light.webp differ diff --git a/site/assets/shots/pt-BR/m-games-dark.webp b/site/assets/shots/pt-BR/m-games-dark.webp index 42c93085b..31ff17c92 100644 Binary files a/site/assets/shots/pt-BR/m-games-dark.webp and b/site/assets/shots/pt-BR/m-games-dark.webp differ diff --git a/site/assets/shots/pt-BR/m-games-light.webp b/site/assets/shots/pt-BR/m-games-light.webp index 24cbca9b2..3519bf65f 100644 Binary files a/site/assets/shots/pt-BR/m-games-light.webp and b/site/assets/shots/pt-BR/m-games-light.webp differ diff --git a/site/assets/shots/pt-BR/m-guest-dark.webp b/site/assets/shots/pt-BR/m-guest-dark.webp index 8c11bd43a..134d917a4 100644 Binary files a/site/assets/shots/pt-BR/m-guest-dark.webp and b/site/assets/shots/pt-BR/m-guest-dark.webp differ diff --git a/site/assets/shots/pt-BR/m-guest-light.webp b/site/assets/shots/pt-BR/m-guest-light.webp index 30312a8c6..8c11bd43a 100644 Binary files a/site/assets/shots/pt-BR/m-guest-light.webp and b/site/assets/shots/pt-BR/m-guest-light.webp differ diff --git a/site/assets/shots/pt-BR/m-home-dark.webp b/site/assets/shots/pt-BR/m-home-dark.webp index cb5fcdd05..3f1b6d854 100644 Binary files a/site/assets/shots/pt-BR/m-home-dark.webp and b/site/assets/shots/pt-BR/m-home-dark.webp differ diff --git a/site/assets/shots/pt-BR/m-home-light.webp b/site/assets/shots/pt-BR/m-home-light.webp index e9db5ff0d..47bc23bc7 100644 Binary files a/site/assets/shots/pt-BR/m-home-light.webp and b/site/assets/shots/pt-BR/m-home-light.webp differ diff --git a/site/assets/shots/pt-BR/m-play-dark.webp b/site/assets/shots/pt-BR/m-play-dark.webp index 320de735f..2fd150150 100644 Binary files a/site/assets/shots/pt-BR/m-play-dark.webp and b/site/assets/shots/pt-BR/m-play-dark.webp differ diff --git a/site/assets/shots/pt-BR/m-play-light.webp b/site/assets/shots/pt-BR/m-play-light.webp index a96276bb4..a4db8fb79 100644 Binary files a/site/assets/shots/pt-BR/m-play-light.webp and b/site/assets/shots/pt-BR/m-play-light.webp differ diff --git a/site/assets/shots/pt-BR/phones-dark.webp b/site/assets/shots/pt-BR/phones-dark.webp index 071cdc5e0..90b8f40b0 100644 Binary files a/site/assets/shots/pt-BR/phones-dark.webp and b/site/assets/shots/pt-BR/phones-dark.webp differ diff --git a/site/assets/shots/pt-BR/phones-light.webp b/site/assets/shots/pt-BR/phones-light.webp index 19fc7c63f..5a5ed6de3 100644 Binary files a/site/assets/shots/pt-BR/phones-light.webp and b/site/assets/shots/pt-BR/phones-light.webp differ diff --git a/site/assets/shots/pt-BR/pkg-name-dark.webp b/site/assets/shots/pt-BR/pkg-name-dark.webp index c885c3782..36df3a6b7 100644 Binary files a/site/assets/shots/pt-BR/pkg-name-dark.webp and b/site/assets/shots/pt-BR/pkg-name-dark.webp differ diff --git a/site/assets/shots/pt-BR/pkg-name-light.webp b/site/assets/shots/pt-BR/pkg-name-light.webp index 0e02433ed..83af49689 100644 Binary files a/site/assets/shots/pt-BR/pkg-name-light.webp and b/site/assets/shots/pt-BR/pkg-name-light.webp differ diff --git a/site/assets/shots/pt-BR/play-dark.webp b/site/assets/shots/pt-BR/play-dark.webp index 2789d81c8..a7f61a03c 100644 Binary files a/site/assets/shots/pt-BR/play-dark.webp and b/site/assets/shots/pt-BR/play-dark.webp differ diff --git a/site/assets/shots/pt-BR/play-light.webp b/site/assets/shots/pt-BR/play-light.webp index eb1527539..ec7671db8 100644 Binary files a/site/assets/shots/pt-BR/play-light.webp and b/site/assets/shots/pt-BR/play-light.webp differ diff --git a/site/assets/shots/pt-BR/receive-dark.webp b/site/assets/shots/pt-BR/receive-dark.webp index c7abb7661..57403a892 100644 Binary files a/site/assets/shots/pt-BR/receive-dark.webp and b/site/assets/shots/pt-BR/receive-dark.webp differ diff --git a/site/assets/shots/pt-BR/receive-light.webp b/site/assets/shots/pt-BR/receive-light.webp index a4da98826..a93ff12a1 100644 Binary files a/site/assets/shots/pt-BR/receive-light.webp and b/site/assets/shots/pt-BR/receive-light.webp differ diff --git a/site/assets/shots/pt-BR/setup-dark.webp b/site/assets/shots/pt-BR/setup-dark.webp index de9a13975..88b348a70 100644 Binary files a/site/assets/shots/pt-BR/setup-dark.webp and b/site/assets/shots/pt-BR/setup-dark.webp differ diff --git a/site/assets/shots/pt-BR/setup-light.webp b/site/assets/shots/pt-BR/setup-light.webp index 46266af12..389a583d5 100644 Binary files a/site/assets/shots/pt-BR/setup-light.webp and b/site/assets/shots/pt-BR/setup-light.webp differ diff --git a/site/assets/shots/pt-BR/share-dark.webp b/site/assets/shots/pt-BR/share-dark.webp index ced82b17e..9820e3000 100644 Binary files a/site/assets/shots/pt-BR/share-dark.webp and b/site/assets/shots/pt-BR/share-dark.webp differ diff --git a/site/assets/shots/pt-BR/share-light.webp b/site/assets/shots/pt-BR/share-light.webp index 98229af7f..814e570b5 100644 Binary files a/site/assets/shots/pt-BR/share-light.webp and b/site/assets/shots/pt-BR/share-light.webp differ diff --git a/site/assets/shots/pt-BR/share-link-dark.webp b/site/assets/shots/pt-BR/share-link-dark.webp index 43b87e77a..4bbaea3ce 100644 Binary files a/site/assets/shots/pt-BR/share-link-dark.webp and b/site/assets/shots/pt-BR/share-link-dark.webp differ diff --git a/site/assets/shots/pt-BR/share-link-light.webp b/site/assets/shots/pt-BR/share-link-light.webp index 004b95c91..227443d00 100644 Binary files a/site/assets/shots/pt-BR/share-link-light.webp and b/site/assets/shots/pt-BR/share-link-light.webp differ diff --git a/site/assets/shots/pt-BR/tailscale-connection-dark.webp b/site/assets/shots/pt-BR/tailscale-connection-dark.webp index 5150f59c6..55a9e6542 100644 Binary files a/site/assets/shots/pt-BR/tailscale-connection-dark.webp and b/site/assets/shots/pt-BR/tailscale-connection-dark.webp differ diff --git a/site/assets/shots/pt-BR/tailscale-connection-light.webp b/site/assets/shots/pt-BR/tailscale-connection-light.webp index 6811324bb..3d5856813 100644 Binary files a/site/assets/shots/pt-BR/tailscale-connection-light.webp and b/site/assets/shots/pt-BR/tailscale-connection-light.webp differ diff --git a/site/assets/shots/pt-BR/tailscale-settings-dark.webp b/site/assets/shots/pt-BR/tailscale-settings-dark.webp index 26bda8331..1ac8d59ed 100644 Binary files a/site/assets/shots/pt-BR/tailscale-settings-dark.webp and b/site/assets/shots/pt-BR/tailscale-settings-dark.webp differ diff --git a/site/assets/shots/pt-BR/tailscale-settings-light.webp b/site/assets/shots/pt-BR/tailscale-settings-light.webp index 170be3251..62a6091ca 100644 Binary files a/site/assets/shots/pt-BR/tailscale-settings-light.webp and b/site/assets/shots/pt-BR/tailscale-settings-light.webp differ diff --git a/site/assets/shots/pt-BR/together-net-dark.webp b/site/assets/shots/pt-BR/together-net-dark.webp index ec4ce3f07..cc384937e 100644 Binary files a/site/assets/shots/pt-BR/together-net-dark.webp and b/site/assets/shots/pt-BR/together-net-dark.webp differ diff --git a/site/assets/shots/pt-BR/together-net-light.webp b/site/assets/shots/pt-BR/together-net-light.webp index 88dea9667..213325eec 100644 Binary files a/site/assets/shots/pt-BR/together-net-light.webp and b/site/assets/shots/pt-BR/together-net-light.webp differ diff --git a/site/assets/shots/pt-BR/together-tab-dark.webp b/site/assets/shots/pt-BR/together-tab-dark.webp index a338f4f6e..8cb7b24aa 100644 Binary files a/site/assets/shots/pt-BR/together-tab-dark.webp and b/site/assets/shots/pt-BR/together-tab-dark.webp differ diff --git a/site/assets/shots/pt-BR/together-tab-light.webp b/site/assets/shots/pt-BR/together-tab-light.webp index 2d903d64b..53e77020c 100644 Binary files a/site/assets/shots/pt-BR/together-tab-light.webp and b/site/assets/shots/pt-BR/together-tab-light.webp differ diff --git a/site/assets/shots/pt-BR/ts-found-dark.webp b/site/assets/shots/pt-BR/ts-found-dark.webp index d08ce00be..9f0594619 100644 Binary files a/site/assets/shots/pt-BR/ts-found-dark.webp and b/site/assets/shots/pt-BR/ts-found-dark.webp differ diff --git a/site/assets/shots/pt-BR/ts-found-light.webp b/site/assets/shots/pt-BR/ts-found-light.webp index 007db42a8..469dc533a 100644 Binary files a/site/assets/shots/pt-BR/ts-found-light.webp and b/site/assets/shots/pt-BR/ts-found-light.webp differ diff --git a/site/assets/shots/pt-BR/upload-dark.webp b/site/assets/shots/pt-BR/upload-dark.webp index 6bd2bcf1a..55855c86c 100644 Binary files a/site/assets/shots/pt-BR/upload-dark.webp and b/site/assets/shots/pt-BR/upload-dark.webp differ diff --git a/site/assets/shots/pt-BR/upload-light.webp b/site/assets/shots/pt-BR/upload-light.webp index c3b376c18..5ff238699 100644 Binary files a/site/assets/shots/pt-BR/upload-light.webp and b/site/assets/shots/pt-BR/upload-light.webp differ diff --git a/site/assets/shots/pt-BR/workshop-dark.webp b/site/assets/shots/pt-BR/workshop-dark.webp index 9fa9a52f1..72614de2f 100644 Binary files a/site/assets/shots/pt-BR/workshop-dark.webp and b/site/assets/shots/pt-BR/workshop-dark.webp differ diff --git a/site/assets/shots/pt-BR/workshop-light.webp b/site/assets/shots/pt-BR/workshop-light.webp index a2f4077af..f6a328748 100644 Binary files a/site/assets/shots/pt-BR/workshop-light.webp and b/site/assets/shots/pt-BR/workshop-light.webp differ diff --git a/site/assets/shots/receive-dark.webp b/site/assets/shots/receive-dark.webp index 9a3c292ab..fb64467e2 100644 Binary files a/site/assets/shots/receive-dark.webp and b/site/assets/shots/receive-dark.webp differ diff --git a/site/assets/shots/receive-light.webp b/site/assets/shots/receive-light.webp index e20efee55..832867368 100644 Binary files a/site/assets/shots/receive-light.webp and b/site/assets/shots/receive-light.webp differ diff --git a/site/assets/shots/ru/add-ps5-dark.webp b/site/assets/shots/ru/add-ps5-dark.webp index a0b5fad05..925cfd3ae 100644 Binary files a/site/assets/shots/ru/add-ps5-dark.webp and b/site/assets/shots/ru/add-ps5-dark.webp differ diff --git a/site/assets/shots/ru/add-ps5-light.webp b/site/assets/shots/ru/add-ps5-light.webp index 99433b2f7..e634dbc35 100644 Binary files a/site/assets/shots/ru/add-ps5-light.webp and b/site/assets/shots/ru/add-ps5-light.webp differ diff --git a/site/assets/shots/ru/approval-dark.webp b/site/assets/shots/ru/approval-dark.webp index 70792f797..f0eb74544 100644 Binary files a/site/assets/shots/ru/approval-dark.webp and b/site/assets/shots/ru/approval-dark.webp differ diff --git a/site/assets/shots/ru/approval-light.webp b/site/assets/shots/ru/approval-light.webp index 315f0c775..d521804fc 100644 Binary files a/site/assets/shots/ru/approval-light.webp and b/site/assets/shots/ru/approval-light.webp differ diff --git a/site/assets/shots/ru/connection-dark.webp b/site/assets/shots/ru/connection-dark.webp index 181bde2ac..50169ad0e 100644 Binary files a/site/assets/shots/ru/connection-dark.webp and b/site/assets/shots/ru/connection-dark.webp differ diff --git a/site/assets/shots/ru/connection-light.webp b/site/assets/shots/ru/connection-light.webp index 65c9c40c4..afc0513b3 100644 Binary files a/site/assets/shots/ru/connection-light.webp and b/site/assets/shots/ru/connection-light.webp differ diff --git a/site/assets/shots/ru/consoles-dark.webp b/site/assets/shots/ru/consoles-dark.webp index 0373f789e..c77b8beae 100644 Binary files a/site/assets/shots/ru/consoles-dark.webp and b/site/assets/shots/ru/consoles-dark.webp differ diff --git a/site/assets/shots/ru/consoles-light.webp b/site/assets/shots/ru/consoles-light.webp index 81244df65..98e528243 100644 Binary files a/site/assets/shots/ru/consoles-light.webp and b/site/assets/shots/ru/consoles-light.webp differ diff --git a/site/assets/shots/ru/files-dark.webp b/site/assets/shots/ru/files-dark.webp index 1ea83f54b..e56b0aecc 100644 Binary files a/site/assets/shots/ru/files-dark.webp and b/site/assets/shots/ru/files-dark.webp differ diff --git a/site/assets/shots/ru/files-light.webp b/site/assets/shots/ru/files-light.webp index 9ec5cfeb5..f9e85f735 100644 Binary files a/site/assets/shots/ru/files-light.webp and b/site/assets/shots/ru/files-light.webp differ diff --git a/site/assets/shots/ru/games-dark.webp b/site/assets/shots/ru/games-dark.webp index 980a5f2b1..919982a60 100644 Binary files a/site/assets/shots/ru/games-dark.webp and b/site/assets/shots/ru/games-dark.webp differ diff --git a/site/assets/shots/ru/games-light.webp b/site/assets/shots/ru/games-light.webp index d49464e25..711b32cb0 100644 Binary files a/site/assets/shots/ru/games-light.webp and b/site/assets/shots/ru/games-light.webp differ diff --git a/site/assets/shots/ru/home-dark.webp b/site/assets/shots/ru/home-dark.webp index 38a4bea98..8634e743c 100644 Binary files a/site/assets/shots/ru/home-dark.webp and b/site/assets/shots/ru/home-dark.webp differ diff --git a/site/assets/shots/ru/home-light.webp b/site/assets/shots/ru/home-light.webp index ce72e2494..9b37a3876 100644 Binary files a/site/assets/shots/ru/home-light.webp and b/site/assets/shots/ru/home-light.webp differ diff --git a/site/assets/shots/ru/invite-dark.webp b/site/assets/shots/ru/invite-dark.webp index 4133a379c..9e5292f79 100644 Binary files a/site/assets/shots/ru/invite-dark.webp and b/site/assets/shots/ru/invite-dark.webp differ diff --git a/site/assets/shots/ru/invite-light.webp b/site/assets/shots/ru/invite-light.webp index 9f7b57f47..b303424de 100644 Binary files a/site/assets/shots/ru/invite-light.webp and b/site/assets/shots/ru/invite-light.webp differ diff --git a/site/assets/shots/ru/kbm-dark.webp b/site/assets/shots/ru/kbm-dark.webp index 43e7a2b53..0feed3976 100644 Binary files a/site/assets/shots/ru/kbm-dark.webp and b/site/assets/shots/ru/kbm-dark.webp differ diff --git a/site/assets/shots/ru/kbm-light.webp b/site/assets/shots/ru/kbm-light.webp index 4155a6682..3e16915a1 100644 Binary files a/site/assets/shots/ru/kbm-light.webp and b/site/assets/shots/ru/kbm-light.webp differ diff --git a/site/assets/shots/ru/kbm-settings-dark.webp b/site/assets/shots/ru/kbm-settings-dark.webp index fe7055461..eae15a4b2 100644 Binary files a/site/assets/shots/ru/kbm-settings-dark.webp and b/site/assets/shots/ru/kbm-settings-dark.webp differ diff --git a/site/assets/shots/ru/kbm-settings-light.webp b/site/assets/shots/ru/kbm-settings-light.webp index eb70b3534..17be0e7a0 100644 Binary files a/site/assets/shots/ru/kbm-settings-light.webp and b/site/assets/shots/ru/kbm-settings-light.webp differ diff --git a/site/assets/shots/ru/m-files-dark.webp b/site/assets/shots/ru/m-files-dark.webp index 2660421cf..9c838e399 100644 Binary files a/site/assets/shots/ru/m-files-dark.webp and b/site/assets/shots/ru/m-files-dark.webp differ diff --git a/site/assets/shots/ru/m-files-light.webp b/site/assets/shots/ru/m-files-light.webp index 08a6cc882..3aacfe59a 100644 Binary files a/site/assets/shots/ru/m-files-light.webp and b/site/assets/shots/ru/m-files-light.webp differ diff --git a/site/assets/shots/ru/m-games-dark.webp b/site/assets/shots/ru/m-games-dark.webp index 86c4eefd0..a750bd385 100644 Binary files a/site/assets/shots/ru/m-games-dark.webp and b/site/assets/shots/ru/m-games-dark.webp differ diff --git a/site/assets/shots/ru/m-games-light.webp b/site/assets/shots/ru/m-games-light.webp index 33d14a79c..66a0b9dab 100644 Binary files a/site/assets/shots/ru/m-games-light.webp and b/site/assets/shots/ru/m-games-light.webp differ diff --git a/site/assets/shots/ru/m-guest-dark.webp b/site/assets/shots/ru/m-guest-dark.webp index 8c11bd43a..8f9b7b740 100644 Binary files a/site/assets/shots/ru/m-guest-dark.webp and b/site/assets/shots/ru/m-guest-dark.webp differ diff --git a/site/assets/shots/ru/m-guest-light.webp b/site/assets/shots/ru/m-guest-light.webp index 8f9b7b740..567e4b2cc 100644 Binary files a/site/assets/shots/ru/m-guest-light.webp and b/site/assets/shots/ru/m-guest-light.webp differ diff --git a/site/assets/shots/ru/m-home-dark.webp b/site/assets/shots/ru/m-home-dark.webp index b965254f3..202f26e97 100644 Binary files a/site/assets/shots/ru/m-home-dark.webp and b/site/assets/shots/ru/m-home-dark.webp differ diff --git a/site/assets/shots/ru/m-home-light.webp b/site/assets/shots/ru/m-home-light.webp index ee4e2b818..3bca23b2e 100644 Binary files a/site/assets/shots/ru/m-home-light.webp and b/site/assets/shots/ru/m-home-light.webp differ diff --git a/site/assets/shots/ru/m-play-dark.webp b/site/assets/shots/ru/m-play-dark.webp index bb059ee60..ecbee3817 100644 Binary files a/site/assets/shots/ru/m-play-dark.webp and b/site/assets/shots/ru/m-play-dark.webp differ diff --git a/site/assets/shots/ru/m-play-light.webp b/site/assets/shots/ru/m-play-light.webp index 32d4c9e7b..c67cc0312 100644 Binary files a/site/assets/shots/ru/m-play-light.webp and b/site/assets/shots/ru/m-play-light.webp differ diff --git a/site/assets/shots/ru/phones-dark.webp b/site/assets/shots/ru/phones-dark.webp index b290ef094..909568a2e 100644 Binary files a/site/assets/shots/ru/phones-dark.webp and b/site/assets/shots/ru/phones-dark.webp differ diff --git a/site/assets/shots/ru/phones-light.webp b/site/assets/shots/ru/phones-light.webp index 041b6e2f6..cdd864fd1 100644 Binary files a/site/assets/shots/ru/phones-light.webp and b/site/assets/shots/ru/phones-light.webp differ diff --git a/site/assets/shots/ru/pkg-name-dark.webp b/site/assets/shots/ru/pkg-name-dark.webp index 0425297e5..03fe948e8 100644 Binary files a/site/assets/shots/ru/pkg-name-dark.webp and b/site/assets/shots/ru/pkg-name-dark.webp differ diff --git a/site/assets/shots/ru/pkg-name-light.webp b/site/assets/shots/ru/pkg-name-light.webp index dd0bd8175..c008db5b8 100644 Binary files a/site/assets/shots/ru/pkg-name-light.webp and b/site/assets/shots/ru/pkg-name-light.webp differ diff --git a/site/assets/shots/ru/play-dark.webp b/site/assets/shots/ru/play-dark.webp index b7d126064..bff213686 100644 Binary files a/site/assets/shots/ru/play-dark.webp and b/site/assets/shots/ru/play-dark.webp differ diff --git a/site/assets/shots/ru/play-light.webp b/site/assets/shots/ru/play-light.webp index e000c5673..698485b6f 100644 Binary files a/site/assets/shots/ru/play-light.webp and b/site/assets/shots/ru/play-light.webp differ diff --git a/site/assets/shots/ru/receive-dark.webp b/site/assets/shots/ru/receive-dark.webp index bc6af83a2..739d909e0 100644 Binary files a/site/assets/shots/ru/receive-dark.webp and b/site/assets/shots/ru/receive-dark.webp differ diff --git a/site/assets/shots/ru/receive-light.webp b/site/assets/shots/ru/receive-light.webp index 86bfac528..834c680cd 100644 Binary files a/site/assets/shots/ru/receive-light.webp and b/site/assets/shots/ru/receive-light.webp differ diff --git a/site/assets/shots/ru/setup-dark.webp b/site/assets/shots/ru/setup-dark.webp index 19a3b8132..8dd1cb797 100644 Binary files a/site/assets/shots/ru/setup-dark.webp and b/site/assets/shots/ru/setup-dark.webp differ diff --git a/site/assets/shots/ru/setup-light.webp b/site/assets/shots/ru/setup-light.webp index 0a54fb4fb..16ba88f48 100644 Binary files a/site/assets/shots/ru/setup-light.webp and b/site/assets/shots/ru/setup-light.webp differ diff --git a/site/assets/shots/ru/share-dark.webp b/site/assets/shots/ru/share-dark.webp index 1c08765fb..ab93d99cb 100644 Binary files a/site/assets/shots/ru/share-dark.webp and b/site/assets/shots/ru/share-dark.webp differ diff --git a/site/assets/shots/ru/share-light.webp b/site/assets/shots/ru/share-light.webp index 4b962c92e..aca581b51 100644 Binary files a/site/assets/shots/ru/share-light.webp and b/site/assets/shots/ru/share-light.webp differ diff --git a/site/assets/shots/ru/share-link-dark.webp b/site/assets/shots/ru/share-link-dark.webp index ca6d16c5a..707d4be36 100644 Binary files a/site/assets/shots/ru/share-link-dark.webp and b/site/assets/shots/ru/share-link-dark.webp differ diff --git a/site/assets/shots/ru/share-link-light.webp b/site/assets/shots/ru/share-link-light.webp index f14f0276e..2a0b1ee8c 100644 Binary files a/site/assets/shots/ru/share-link-light.webp and b/site/assets/shots/ru/share-link-light.webp differ diff --git a/site/assets/shots/ru/tailscale-connection-dark.webp b/site/assets/shots/ru/tailscale-connection-dark.webp index 03a200b28..73c7d0e71 100644 Binary files a/site/assets/shots/ru/tailscale-connection-dark.webp and b/site/assets/shots/ru/tailscale-connection-dark.webp differ diff --git a/site/assets/shots/ru/tailscale-connection-light.webp b/site/assets/shots/ru/tailscale-connection-light.webp index 4a6b3926b..09b3264c4 100644 Binary files a/site/assets/shots/ru/tailscale-connection-light.webp and b/site/assets/shots/ru/tailscale-connection-light.webp differ diff --git a/site/assets/shots/ru/tailscale-settings-dark.webp b/site/assets/shots/ru/tailscale-settings-dark.webp index 5bf5023f4..21437f28e 100644 Binary files a/site/assets/shots/ru/tailscale-settings-dark.webp and b/site/assets/shots/ru/tailscale-settings-dark.webp differ diff --git a/site/assets/shots/ru/tailscale-settings-light.webp b/site/assets/shots/ru/tailscale-settings-light.webp index cc63998dc..7df6c601b 100644 Binary files a/site/assets/shots/ru/tailscale-settings-light.webp and b/site/assets/shots/ru/tailscale-settings-light.webp differ diff --git a/site/assets/shots/ru/together-net-dark.webp b/site/assets/shots/ru/together-net-dark.webp index fd5440843..be54d51b0 100644 Binary files a/site/assets/shots/ru/together-net-dark.webp and b/site/assets/shots/ru/together-net-dark.webp differ diff --git a/site/assets/shots/ru/together-net-light.webp b/site/assets/shots/ru/together-net-light.webp index eda116362..c6ff6f856 100644 Binary files a/site/assets/shots/ru/together-net-light.webp and b/site/assets/shots/ru/together-net-light.webp differ diff --git a/site/assets/shots/ru/together-tab-dark.webp b/site/assets/shots/ru/together-tab-dark.webp index bd6e238bd..e6c8b3678 100644 Binary files a/site/assets/shots/ru/together-tab-dark.webp and b/site/assets/shots/ru/together-tab-dark.webp differ diff --git a/site/assets/shots/ru/together-tab-light.webp b/site/assets/shots/ru/together-tab-light.webp index dd59699f4..aec9bb85b 100644 Binary files a/site/assets/shots/ru/together-tab-light.webp and b/site/assets/shots/ru/together-tab-light.webp differ diff --git a/site/assets/shots/ru/ts-found-dark.webp b/site/assets/shots/ru/ts-found-dark.webp index d2601e7db..e86f7259e 100644 Binary files a/site/assets/shots/ru/ts-found-dark.webp and b/site/assets/shots/ru/ts-found-dark.webp differ diff --git a/site/assets/shots/ru/ts-found-light.webp b/site/assets/shots/ru/ts-found-light.webp index b92f91e45..3fbfcb7c7 100644 Binary files a/site/assets/shots/ru/ts-found-light.webp and b/site/assets/shots/ru/ts-found-light.webp differ diff --git a/site/assets/shots/ru/upload-dark.webp b/site/assets/shots/ru/upload-dark.webp index c294cca1d..b98723348 100644 Binary files a/site/assets/shots/ru/upload-dark.webp and b/site/assets/shots/ru/upload-dark.webp differ diff --git a/site/assets/shots/ru/upload-light.webp b/site/assets/shots/ru/upload-light.webp index d9e2660a5..eb83189cb 100644 Binary files a/site/assets/shots/ru/upload-light.webp and b/site/assets/shots/ru/upload-light.webp differ diff --git a/site/assets/shots/ru/workshop-dark.webp b/site/assets/shots/ru/workshop-dark.webp index 2a416e256..34552f2d4 100644 Binary files a/site/assets/shots/ru/workshop-dark.webp and b/site/assets/shots/ru/workshop-dark.webp differ diff --git a/site/assets/shots/ru/workshop-light.webp b/site/assets/shots/ru/workshop-light.webp index c3f8adbb3..b83d1d042 100644 Binary files a/site/assets/shots/ru/workshop-light.webp and b/site/assets/shots/ru/workshop-light.webp differ diff --git a/site/assets/shots/setup-dark.webp b/site/assets/shots/setup-dark.webp index f75613526..397a09d44 100644 Binary files a/site/assets/shots/setup-dark.webp and b/site/assets/shots/setup-dark.webp differ diff --git a/site/assets/shots/setup-light.webp b/site/assets/shots/setup-light.webp index 6d8ff877c..1a0421dc4 100644 Binary files a/site/assets/shots/setup-light.webp and b/site/assets/shots/setup-light.webp differ diff --git a/site/assets/shots/share-dark.webp b/site/assets/shots/share-dark.webp index 9459780e3..ecf66eb21 100644 Binary files a/site/assets/shots/share-dark.webp and b/site/assets/shots/share-dark.webp differ diff --git a/site/assets/shots/share-light.webp b/site/assets/shots/share-light.webp index 34659cd72..10bdcd832 100644 Binary files a/site/assets/shots/share-light.webp and b/site/assets/shots/share-light.webp differ diff --git a/site/assets/shots/share-link-dark.webp b/site/assets/shots/share-link-dark.webp index afc19340b..2fc60a34a 100644 Binary files a/site/assets/shots/share-link-dark.webp and b/site/assets/shots/share-link-dark.webp differ diff --git a/site/assets/shots/share-link-light.webp b/site/assets/shots/share-link-light.webp index 1b57e6189..105fd1a6a 100644 Binary files a/site/assets/shots/share-link-light.webp and b/site/assets/shots/share-link-light.webp differ diff --git a/site/assets/shots/tailscale-connection-dark.webp b/site/assets/shots/tailscale-connection-dark.webp index 2798b236e..6d45ddc30 100644 Binary files a/site/assets/shots/tailscale-connection-dark.webp and b/site/assets/shots/tailscale-connection-dark.webp differ diff --git a/site/assets/shots/tailscale-connection-light.webp b/site/assets/shots/tailscale-connection-light.webp index fa1b7cc47..a96a5c9d1 100644 Binary files a/site/assets/shots/tailscale-connection-light.webp and b/site/assets/shots/tailscale-connection-light.webp differ diff --git a/site/assets/shots/tailscale-settings-dark.webp b/site/assets/shots/tailscale-settings-dark.webp index dc6f1c8c6..6895f484d 100644 Binary files a/site/assets/shots/tailscale-settings-dark.webp and b/site/assets/shots/tailscale-settings-dark.webp differ diff --git a/site/assets/shots/tailscale-settings-light.webp b/site/assets/shots/tailscale-settings-light.webp index c212961d0..f779d793b 100644 Binary files a/site/assets/shots/tailscale-settings-light.webp and b/site/assets/shots/tailscale-settings-light.webp differ diff --git a/site/assets/shots/th/add-ps5-dark.webp b/site/assets/shots/th/add-ps5-dark.webp index fd4ed1245..15ba4bd7f 100644 Binary files a/site/assets/shots/th/add-ps5-dark.webp and b/site/assets/shots/th/add-ps5-dark.webp differ diff --git a/site/assets/shots/th/add-ps5-light.webp b/site/assets/shots/th/add-ps5-light.webp index 6def048f8..71250e22e 100644 Binary files a/site/assets/shots/th/add-ps5-light.webp and b/site/assets/shots/th/add-ps5-light.webp differ diff --git a/site/assets/shots/th/approval-dark.webp b/site/assets/shots/th/approval-dark.webp index b3c5536fc..f703614a7 100644 Binary files a/site/assets/shots/th/approval-dark.webp and b/site/assets/shots/th/approval-dark.webp differ diff --git a/site/assets/shots/th/approval-light.webp b/site/assets/shots/th/approval-light.webp index 3df6a7027..c47125b37 100644 Binary files a/site/assets/shots/th/approval-light.webp and b/site/assets/shots/th/approval-light.webp differ diff --git a/site/assets/shots/th/connection-dark.webp b/site/assets/shots/th/connection-dark.webp index f59a41b2e..eeb508de8 100644 Binary files a/site/assets/shots/th/connection-dark.webp and b/site/assets/shots/th/connection-dark.webp differ diff --git a/site/assets/shots/th/connection-light.webp b/site/assets/shots/th/connection-light.webp index 4a7928309..034ef9aee 100644 Binary files a/site/assets/shots/th/connection-light.webp and b/site/assets/shots/th/connection-light.webp differ diff --git a/site/assets/shots/th/consoles-dark.webp b/site/assets/shots/th/consoles-dark.webp index b4846ed23..84e6a5748 100644 Binary files a/site/assets/shots/th/consoles-dark.webp and b/site/assets/shots/th/consoles-dark.webp differ diff --git a/site/assets/shots/th/consoles-light.webp b/site/assets/shots/th/consoles-light.webp index d5ca1d1d6..76109bec9 100644 Binary files a/site/assets/shots/th/consoles-light.webp and b/site/assets/shots/th/consoles-light.webp differ diff --git a/site/assets/shots/th/files-dark.webp b/site/assets/shots/th/files-dark.webp index e1a69d3c1..668bf87c2 100644 Binary files a/site/assets/shots/th/files-dark.webp and b/site/assets/shots/th/files-dark.webp differ diff --git a/site/assets/shots/th/files-light.webp b/site/assets/shots/th/files-light.webp index 8d33fa085..d0b121090 100644 Binary files a/site/assets/shots/th/files-light.webp and b/site/assets/shots/th/files-light.webp differ diff --git a/site/assets/shots/th/games-dark.webp b/site/assets/shots/th/games-dark.webp index 17e6da0fa..b8ac75292 100644 Binary files a/site/assets/shots/th/games-dark.webp and b/site/assets/shots/th/games-dark.webp differ diff --git a/site/assets/shots/th/games-light.webp b/site/assets/shots/th/games-light.webp index b7bd45f7c..692e1f656 100644 Binary files a/site/assets/shots/th/games-light.webp and b/site/assets/shots/th/games-light.webp differ diff --git a/site/assets/shots/th/home-dark.webp b/site/assets/shots/th/home-dark.webp index d52d9ca98..45553a791 100644 Binary files a/site/assets/shots/th/home-dark.webp and b/site/assets/shots/th/home-dark.webp differ diff --git a/site/assets/shots/th/home-light.webp b/site/assets/shots/th/home-light.webp index 68f40be7d..b3930809e 100644 Binary files a/site/assets/shots/th/home-light.webp and b/site/assets/shots/th/home-light.webp differ diff --git a/site/assets/shots/th/invite-dark.webp b/site/assets/shots/th/invite-dark.webp index 6dc15133c..b5edec76e 100644 Binary files a/site/assets/shots/th/invite-dark.webp and b/site/assets/shots/th/invite-dark.webp differ diff --git a/site/assets/shots/th/invite-light.webp b/site/assets/shots/th/invite-light.webp index ee745dde5..f5096bdd5 100644 Binary files a/site/assets/shots/th/invite-light.webp and b/site/assets/shots/th/invite-light.webp differ diff --git a/site/assets/shots/th/kbm-dark.webp b/site/assets/shots/th/kbm-dark.webp index 41e024be9..5fc0fb318 100644 Binary files a/site/assets/shots/th/kbm-dark.webp and b/site/assets/shots/th/kbm-dark.webp differ diff --git a/site/assets/shots/th/kbm-light.webp b/site/assets/shots/th/kbm-light.webp index 37e6b2233..6fa61b303 100644 Binary files a/site/assets/shots/th/kbm-light.webp and b/site/assets/shots/th/kbm-light.webp differ diff --git a/site/assets/shots/th/kbm-settings-dark.webp b/site/assets/shots/th/kbm-settings-dark.webp index a204c044c..bcf284f10 100644 Binary files a/site/assets/shots/th/kbm-settings-dark.webp and b/site/assets/shots/th/kbm-settings-dark.webp differ diff --git a/site/assets/shots/th/kbm-settings-light.webp b/site/assets/shots/th/kbm-settings-light.webp index 10a7f87b2..20c5da1a2 100644 Binary files a/site/assets/shots/th/kbm-settings-light.webp and b/site/assets/shots/th/kbm-settings-light.webp differ diff --git a/site/assets/shots/th/m-files-dark.webp b/site/assets/shots/th/m-files-dark.webp index cab409053..decc58889 100644 Binary files a/site/assets/shots/th/m-files-dark.webp and b/site/assets/shots/th/m-files-dark.webp differ diff --git a/site/assets/shots/th/m-files-light.webp b/site/assets/shots/th/m-files-light.webp index dfdea07c1..b429f2543 100644 Binary files a/site/assets/shots/th/m-files-light.webp and b/site/assets/shots/th/m-files-light.webp differ diff --git a/site/assets/shots/th/m-games-dark.webp b/site/assets/shots/th/m-games-dark.webp index 9da85db65..0d35bea91 100644 Binary files a/site/assets/shots/th/m-games-dark.webp and b/site/assets/shots/th/m-games-dark.webp differ diff --git a/site/assets/shots/th/m-games-light.webp b/site/assets/shots/th/m-games-light.webp index ab00002a4..bdc9c1688 100644 Binary files a/site/assets/shots/th/m-games-light.webp and b/site/assets/shots/th/m-games-light.webp differ diff --git a/site/assets/shots/th/m-home-dark.webp b/site/assets/shots/th/m-home-dark.webp index 616d80a3f..b9406de2e 100644 Binary files a/site/assets/shots/th/m-home-dark.webp and b/site/assets/shots/th/m-home-dark.webp differ diff --git a/site/assets/shots/th/m-home-light.webp b/site/assets/shots/th/m-home-light.webp index acaee59ea..3c5569e13 100644 Binary files a/site/assets/shots/th/m-home-light.webp and b/site/assets/shots/th/m-home-light.webp differ diff --git a/site/assets/shots/th/m-play-dark.webp b/site/assets/shots/th/m-play-dark.webp index 6b5a5e4ce..b89b2c006 100644 Binary files a/site/assets/shots/th/m-play-dark.webp and b/site/assets/shots/th/m-play-dark.webp differ diff --git a/site/assets/shots/th/m-play-light.webp b/site/assets/shots/th/m-play-light.webp index e83cd408b..7ddfea8f2 100644 Binary files a/site/assets/shots/th/m-play-light.webp and b/site/assets/shots/th/m-play-light.webp differ diff --git a/site/assets/shots/th/phones-dark.webp b/site/assets/shots/th/phones-dark.webp index e6735ab0b..3462d65eb 100644 Binary files a/site/assets/shots/th/phones-dark.webp and b/site/assets/shots/th/phones-dark.webp differ diff --git a/site/assets/shots/th/phones-light.webp b/site/assets/shots/th/phones-light.webp index f7e2ffddb..1c3ba7531 100644 Binary files a/site/assets/shots/th/phones-light.webp and b/site/assets/shots/th/phones-light.webp differ diff --git a/site/assets/shots/th/pkg-name-dark.webp b/site/assets/shots/th/pkg-name-dark.webp index f117ac669..3e33d1241 100644 Binary files a/site/assets/shots/th/pkg-name-dark.webp and b/site/assets/shots/th/pkg-name-dark.webp differ diff --git a/site/assets/shots/th/pkg-name-light.webp b/site/assets/shots/th/pkg-name-light.webp index adb53e438..8eb7205dd 100644 Binary files a/site/assets/shots/th/pkg-name-light.webp and b/site/assets/shots/th/pkg-name-light.webp differ diff --git a/site/assets/shots/th/play-dark.webp b/site/assets/shots/th/play-dark.webp index db4ba3ccc..c9123458d 100644 Binary files a/site/assets/shots/th/play-dark.webp and b/site/assets/shots/th/play-dark.webp differ diff --git a/site/assets/shots/th/play-light.webp b/site/assets/shots/th/play-light.webp index c588faac1..782e9bb33 100644 Binary files a/site/assets/shots/th/play-light.webp and b/site/assets/shots/th/play-light.webp differ diff --git a/site/assets/shots/th/receive-dark.webp b/site/assets/shots/th/receive-dark.webp index da05691df..d714ead0c 100644 Binary files a/site/assets/shots/th/receive-dark.webp and b/site/assets/shots/th/receive-dark.webp differ diff --git a/site/assets/shots/th/receive-light.webp b/site/assets/shots/th/receive-light.webp index 8696a9ec9..b2e85eeba 100644 Binary files a/site/assets/shots/th/receive-light.webp and b/site/assets/shots/th/receive-light.webp differ diff --git a/site/assets/shots/th/setup-dark.webp b/site/assets/shots/th/setup-dark.webp index b0349e9c3..6205a025f 100644 Binary files a/site/assets/shots/th/setup-dark.webp and b/site/assets/shots/th/setup-dark.webp differ diff --git a/site/assets/shots/th/setup-light.webp b/site/assets/shots/th/setup-light.webp index 7b6c01bae..71320eb91 100644 Binary files a/site/assets/shots/th/setup-light.webp and b/site/assets/shots/th/setup-light.webp differ diff --git a/site/assets/shots/th/share-dark.webp b/site/assets/shots/th/share-dark.webp index f0fc5dad6..af741b321 100644 Binary files a/site/assets/shots/th/share-dark.webp and b/site/assets/shots/th/share-dark.webp differ diff --git a/site/assets/shots/th/share-light.webp b/site/assets/shots/th/share-light.webp index 8f870fad2..39cd4fae4 100644 Binary files a/site/assets/shots/th/share-light.webp and b/site/assets/shots/th/share-light.webp differ diff --git a/site/assets/shots/th/share-link-dark.webp b/site/assets/shots/th/share-link-dark.webp index 753501dda..7f977a801 100644 Binary files a/site/assets/shots/th/share-link-dark.webp and b/site/assets/shots/th/share-link-dark.webp differ diff --git a/site/assets/shots/th/share-link-light.webp b/site/assets/shots/th/share-link-light.webp index 667df7b0c..b8c3b9583 100644 Binary files a/site/assets/shots/th/share-link-light.webp and b/site/assets/shots/th/share-link-light.webp differ diff --git a/site/assets/shots/th/tailscale-connection-dark.webp b/site/assets/shots/th/tailscale-connection-dark.webp index 19b687678..be588afd9 100644 Binary files a/site/assets/shots/th/tailscale-connection-dark.webp and b/site/assets/shots/th/tailscale-connection-dark.webp differ diff --git a/site/assets/shots/th/tailscale-connection-light.webp b/site/assets/shots/th/tailscale-connection-light.webp index 9cfab6a4f..6046c26b6 100644 Binary files a/site/assets/shots/th/tailscale-connection-light.webp and b/site/assets/shots/th/tailscale-connection-light.webp differ diff --git a/site/assets/shots/th/tailscale-settings-dark.webp b/site/assets/shots/th/tailscale-settings-dark.webp index e6eacbb65..2f43ac943 100644 Binary files a/site/assets/shots/th/tailscale-settings-dark.webp and b/site/assets/shots/th/tailscale-settings-dark.webp differ diff --git a/site/assets/shots/th/tailscale-settings-light.webp b/site/assets/shots/th/tailscale-settings-light.webp index cbdfe2a36..449cff16d 100644 Binary files a/site/assets/shots/th/tailscale-settings-light.webp and b/site/assets/shots/th/tailscale-settings-light.webp differ diff --git a/site/assets/shots/th/together-net-dark.webp b/site/assets/shots/th/together-net-dark.webp index 4b62176a0..b443c6bd3 100644 Binary files a/site/assets/shots/th/together-net-dark.webp and b/site/assets/shots/th/together-net-dark.webp differ diff --git a/site/assets/shots/th/together-net-light.webp b/site/assets/shots/th/together-net-light.webp index 8a53c5581..59298d142 100644 Binary files a/site/assets/shots/th/together-net-light.webp and b/site/assets/shots/th/together-net-light.webp differ diff --git a/site/assets/shots/th/together-tab-dark.webp b/site/assets/shots/th/together-tab-dark.webp index 67b378582..c7b9b5e03 100644 Binary files a/site/assets/shots/th/together-tab-dark.webp and b/site/assets/shots/th/together-tab-dark.webp differ diff --git a/site/assets/shots/th/together-tab-light.webp b/site/assets/shots/th/together-tab-light.webp index 3de68ab6f..2e5dcd084 100644 Binary files a/site/assets/shots/th/together-tab-light.webp and b/site/assets/shots/th/together-tab-light.webp differ diff --git a/site/assets/shots/th/ts-found-dark.webp b/site/assets/shots/th/ts-found-dark.webp index c0c6dbe30..abd46b3bd 100644 Binary files a/site/assets/shots/th/ts-found-dark.webp and b/site/assets/shots/th/ts-found-dark.webp differ diff --git a/site/assets/shots/th/ts-found-light.webp b/site/assets/shots/th/ts-found-light.webp index 75e532deb..913bf9857 100644 Binary files a/site/assets/shots/th/ts-found-light.webp and b/site/assets/shots/th/ts-found-light.webp differ diff --git a/site/assets/shots/th/upload-dark.webp b/site/assets/shots/th/upload-dark.webp index 62a99b27f..290174833 100644 Binary files a/site/assets/shots/th/upload-dark.webp and b/site/assets/shots/th/upload-dark.webp differ diff --git a/site/assets/shots/th/upload-light.webp b/site/assets/shots/th/upload-light.webp index 98e2d4bcd..4a12f02d4 100644 Binary files a/site/assets/shots/th/upload-light.webp and b/site/assets/shots/th/upload-light.webp differ diff --git a/site/assets/shots/th/workshop-dark.webp b/site/assets/shots/th/workshop-dark.webp index a5c19f245..22a492958 100644 Binary files a/site/assets/shots/th/workshop-dark.webp and b/site/assets/shots/th/workshop-dark.webp differ diff --git a/site/assets/shots/th/workshop-light.webp b/site/assets/shots/th/workshop-light.webp index ce253823f..ce9027a0d 100644 Binary files a/site/assets/shots/th/workshop-light.webp and b/site/assets/shots/th/workshop-light.webp differ diff --git a/site/assets/shots/together-net-dark.webp b/site/assets/shots/together-net-dark.webp index be26d4d1b..d2326673f 100644 Binary files a/site/assets/shots/together-net-dark.webp and b/site/assets/shots/together-net-dark.webp differ diff --git a/site/assets/shots/together-net-light.webp b/site/assets/shots/together-net-light.webp index 3fc344e21..c14f838ab 100644 Binary files a/site/assets/shots/together-net-light.webp and b/site/assets/shots/together-net-light.webp differ diff --git a/site/assets/shots/together-tab-dark.webp b/site/assets/shots/together-tab-dark.webp index 1aeb98afd..f8b05b20f 100644 Binary files a/site/assets/shots/together-tab-dark.webp and b/site/assets/shots/together-tab-dark.webp differ diff --git a/site/assets/shots/together-tab-light.webp b/site/assets/shots/together-tab-light.webp index 020758d08..26329e038 100644 Binary files a/site/assets/shots/together-tab-light.webp and b/site/assets/shots/together-tab-light.webp differ diff --git a/site/assets/shots/tr/add-ps5-dark.webp b/site/assets/shots/tr/add-ps5-dark.webp index 8a7b0d6c6..71bb0c69e 100644 Binary files a/site/assets/shots/tr/add-ps5-dark.webp and b/site/assets/shots/tr/add-ps5-dark.webp differ diff --git a/site/assets/shots/tr/add-ps5-light.webp b/site/assets/shots/tr/add-ps5-light.webp index 996275b21..afbd9d92a 100644 Binary files a/site/assets/shots/tr/add-ps5-light.webp and b/site/assets/shots/tr/add-ps5-light.webp differ diff --git a/site/assets/shots/tr/approval-dark.webp b/site/assets/shots/tr/approval-dark.webp index 495cd55a2..36e8a5fd5 100644 Binary files a/site/assets/shots/tr/approval-dark.webp and b/site/assets/shots/tr/approval-dark.webp differ diff --git a/site/assets/shots/tr/approval-light.webp b/site/assets/shots/tr/approval-light.webp index abe25f0f8..78f7b2659 100644 Binary files a/site/assets/shots/tr/approval-light.webp and b/site/assets/shots/tr/approval-light.webp differ diff --git a/site/assets/shots/tr/connection-dark.webp b/site/assets/shots/tr/connection-dark.webp index b87af58a4..373dfb3a4 100644 Binary files a/site/assets/shots/tr/connection-dark.webp and b/site/assets/shots/tr/connection-dark.webp differ diff --git a/site/assets/shots/tr/connection-light.webp b/site/assets/shots/tr/connection-light.webp index e88d58353..8c41b0f5b 100644 Binary files a/site/assets/shots/tr/connection-light.webp and b/site/assets/shots/tr/connection-light.webp differ diff --git a/site/assets/shots/tr/consoles-dark.webp b/site/assets/shots/tr/consoles-dark.webp index 8a624544a..e89e87e92 100644 Binary files a/site/assets/shots/tr/consoles-dark.webp and b/site/assets/shots/tr/consoles-dark.webp differ diff --git a/site/assets/shots/tr/consoles-light.webp b/site/assets/shots/tr/consoles-light.webp index 9fe300f7b..a24c3df3d 100644 Binary files a/site/assets/shots/tr/consoles-light.webp and b/site/assets/shots/tr/consoles-light.webp differ diff --git a/site/assets/shots/tr/files-dark.webp b/site/assets/shots/tr/files-dark.webp index 9eadda8af..493fbcc2a 100644 Binary files a/site/assets/shots/tr/files-dark.webp and b/site/assets/shots/tr/files-dark.webp differ diff --git a/site/assets/shots/tr/files-light.webp b/site/assets/shots/tr/files-light.webp index 8f85aa10e..c2a9be433 100644 Binary files a/site/assets/shots/tr/files-light.webp and b/site/assets/shots/tr/files-light.webp differ diff --git a/site/assets/shots/tr/games-dark.webp b/site/assets/shots/tr/games-dark.webp index 43be24566..d71f73dd7 100644 Binary files a/site/assets/shots/tr/games-dark.webp and b/site/assets/shots/tr/games-dark.webp differ diff --git a/site/assets/shots/tr/games-light.webp b/site/assets/shots/tr/games-light.webp index b045aaf8b..acddb37c1 100644 Binary files a/site/assets/shots/tr/games-light.webp and b/site/assets/shots/tr/games-light.webp differ diff --git a/site/assets/shots/tr/home-dark.webp b/site/assets/shots/tr/home-dark.webp index 722f14a0a..32c088a1a 100644 Binary files a/site/assets/shots/tr/home-dark.webp and b/site/assets/shots/tr/home-dark.webp differ diff --git a/site/assets/shots/tr/home-light.webp b/site/assets/shots/tr/home-light.webp index 57e99ea9f..e7f6d6133 100644 Binary files a/site/assets/shots/tr/home-light.webp and b/site/assets/shots/tr/home-light.webp differ diff --git a/site/assets/shots/tr/invite-dark.webp b/site/assets/shots/tr/invite-dark.webp index c76ca2e39..89db74ead 100644 Binary files a/site/assets/shots/tr/invite-dark.webp and b/site/assets/shots/tr/invite-dark.webp differ diff --git a/site/assets/shots/tr/invite-light.webp b/site/assets/shots/tr/invite-light.webp index c8a09531d..4df5bb250 100644 Binary files a/site/assets/shots/tr/invite-light.webp and b/site/assets/shots/tr/invite-light.webp differ diff --git a/site/assets/shots/tr/kbm-dark.webp b/site/assets/shots/tr/kbm-dark.webp index 84b833e18..380bded5b 100644 Binary files a/site/assets/shots/tr/kbm-dark.webp and b/site/assets/shots/tr/kbm-dark.webp differ diff --git a/site/assets/shots/tr/kbm-light.webp b/site/assets/shots/tr/kbm-light.webp index 30ce74121..47b4a3e9b 100644 Binary files a/site/assets/shots/tr/kbm-light.webp and b/site/assets/shots/tr/kbm-light.webp differ diff --git a/site/assets/shots/tr/kbm-settings-dark.webp b/site/assets/shots/tr/kbm-settings-dark.webp index 10f712064..ffffe5a2a 100644 Binary files a/site/assets/shots/tr/kbm-settings-dark.webp and b/site/assets/shots/tr/kbm-settings-dark.webp differ diff --git a/site/assets/shots/tr/kbm-settings-light.webp b/site/assets/shots/tr/kbm-settings-light.webp index 892558cdd..ac8152cb1 100644 Binary files a/site/assets/shots/tr/kbm-settings-light.webp and b/site/assets/shots/tr/kbm-settings-light.webp differ diff --git a/site/assets/shots/tr/m-files-dark.webp b/site/assets/shots/tr/m-files-dark.webp index 6a9350bb1..08e4c8d60 100644 Binary files a/site/assets/shots/tr/m-files-dark.webp and b/site/assets/shots/tr/m-files-dark.webp differ diff --git a/site/assets/shots/tr/m-files-light.webp b/site/assets/shots/tr/m-files-light.webp index 14242a220..80ce89117 100644 Binary files a/site/assets/shots/tr/m-files-light.webp and b/site/assets/shots/tr/m-files-light.webp differ diff --git a/site/assets/shots/tr/m-games-dark.webp b/site/assets/shots/tr/m-games-dark.webp index b0287489e..8e017c934 100644 Binary files a/site/assets/shots/tr/m-games-dark.webp and b/site/assets/shots/tr/m-games-dark.webp differ diff --git a/site/assets/shots/tr/m-games-light.webp b/site/assets/shots/tr/m-games-light.webp index e487b778b..0e85871f0 100644 Binary files a/site/assets/shots/tr/m-games-light.webp and b/site/assets/shots/tr/m-games-light.webp differ diff --git a/site/assets/shots/tr/m-guest-dark.webp b/site/assets/shots/tr/m-guest-dark.webp index e518f2b72..9f5d4e438 100644 Binary files a/site/assets/shots/tr/m-guest-dark.webp and b/site/assets/shots/tr/m-guest-dark.webp differ diff --git a/site/assets/shots/tr/m-guest-light.webp b/site/assets/shots/tr/m-guest-light.webp index 9f5d4e438..a64c62e7a 100644 Binary files a/site/assets/shots/tr/m-guest-light.webp and b/site/assets/shots/tr/m-guest-light.webp differ diff --git a/site/assets/shots/tr/m-home-dark.webp b/site/assets/shots/tr/m-home-dark.webp index 972000bfa..3d0292086 100644 Binary files a/site/assets/shots/tr/m-home-dark.webp and b/site/assets/shots/tr/m-home-dark.webp differ diff --git a/site/assets/shots/tr/m-home-light.webp b/site/assets/shots/tr/m-home-light.webp index 828d1c05c..878cbec5f 100644 Binary files a/site/assets/shots/tr/m-home-light.webp and b/site/assets/shots/tr/m-home-light.webp differ diff --git a/site/assets/shots/tr/m-play-dark.webp b/site/assets/shots/tr/m-play-dark.webp index 12b6ec0e1..cc232247f 100644 Binary files a/site/assets/shots/tr/m-play-dark.webp and b/site/assets/shots/tr/m-play-dark.webp differ diff --git a/site/assets/shots/tr/m-play-light.webp b/site/assets/shots/tr/m-play-light.webp index 9ee8293e6..f29b28503 100644 Binary files a/site/assets/shots/tr/m-play-light.webp and b/site/assets/shots/tr/m-play-light.webp differ diff --git a/site/assets/shots/tr/phones-dark.webp b/site/assets/shots/tr/phones-dark.webp index cabf62c25..b633f04c5 100644 Binary files a/site/assets/shots/tr/phones-dark.webp and b/site/assets/shots/tr/phones-dark.webp differ diff --git a/site/assets/shots/tr/phones-light.webp b/site/assets/shots/tr/phones-light.webp index 423d2881b..8d3d2913b 100644 Binary files a/site/assets/shots/tr/phones-light.webp and b/site/assets/shots/tr/phones-light.webp differ diff --git a/site/assets/shots/tr/pkg-name-dark.webp b/site/assets/shots/tr/pkg-name-dark.webp index 738ee3b6a..04914c2b4 100644 Binary files a/site/assets/shots/tr/pkg-name-dark.webp and b/site/assets/shots/tr/pkg-name-dark.webp differ diff --git a/site/assets/shots/tr/pkg-name-light.webp b/site/assets/shots/tr/pkg-name-light.webp index e3ed4b955..7f4fe9355 100644 Binary files a/site/assets/shots/tr/pkg-name-light.webp and b/site/assets/shots/tr/pkg-name-light.webp differ diff --git a/site/assets/shots/tr/play-dark.webp b/site/assets/shots/tr/play-dark.webp index 5e36fbf5c..70c562dfe 100644 Binary files a/site/assets/shots/tr/play-dark.webp and b/site/assets/shots/tr/play-dark.webp differ diff --git a/site/assets/shots/tr/play-light.webp b/site/assets/shots/tr/play-light.webp index 15b848351..1e2996eb8 100644 Binary files a/site/assets/shots/tr/play-light.webp and b/site/assets/shots/tr/play-light.webp differ diff --git a/site/assets/shots/tr/receive-dark.webp b/site/assets/shots/tr/receive-dark.webp index 06c2c33c1..9bfeebca4 100644 Binary files a/site/assets/shots/tr/receive-dark.webp and b/site/assets/shots/tr/receive-dark.webp differ diff --git a/site/assets/shots/tr/receive-light.webp b/site/assets/shots/tr/receive-light.webp index d4c8fc976..5bb9ba22b 100644 Binary files a/site/assets/shots/tr/receive-light.webp and b/site/assets/shots/tr/receive-light.webp differ diff --git a/site/assets/shots/tr/setup-dark.webp b/site/assets/shots/tr/setup-dark.webp index d58157225..fb5cf8ba2 100644 Binary files a/site/assets/shots/tr/setup-dark.webp and b/site/assets/shots/tr/setup-dark.webp differ diff --git a/site/assets/shots/tr/setup-light.webp b/site/assets/shots/tr/setup-light.webp index 644a5ac54..4e6c87c4a 100644 Binary files a/site/assets/shots/tr/setup-light.webp and b/site/assets/shots/tr/setup-light.webp differ diff --git a/site/assets/shots/tr/share-dark.webp b/site/assets/shots/tr/share-dark.webp index 51e647db9..cb3d27394 100644 Binary files a/site/assets/shots/tr/share-dark.webp and b/site/assets/shots/tr/share-dark.webp differ diff --git a/site/assets/shots/tr/share-light.webp b/site/assets/shots/tr/share-light.webp index 924e994a7..e906410c5 100644 Binary files a/site/assets/shots/tr/share-light.webp and b/site/assets/shots/tr/share-light.webp differ diff --git a/site/assets/shots/tr/share-link-dark.webp b/site/assets/shots/tr/share-link-dark.webp index 01c21e7b6..baa1860dd 100644 Binary files a/site/assets/shots/tr/share-link-dark.webp and b/site/assets/shots/tr/share-link-dark.webp differ diff --git a/site/assets/shots/tr/share-link-light.webp b/site/assets/shots/tr/share-link-light.webp index aa8d6f8a1..115760e63 100644 Binary files a/site/assets/shots/tr/share-link-light.webp and b/site/assets/shots/tr/share-link-light.webp differ diff --git a/site/assets/shots/tr/tailscale-connection-dark.webp b/site/assets/shots/tr/tailscale-connection-dark.webp index f4b34ef75..706721dd2 100644 Binary files a/site/assets/shots/tr/tailscale-connection-dark.webp and b/site/assets/shots/tr/tailscale-connection-dark.webp differ diff --git a/site/assets/shots/tr/tailscale-connection-light.webp b/site/assets/shots/tr/tailscale-connection-light.webp index 8e0a07990..0b4c642de 100644 Binary files a/site/assets/shots/tr/tailscale-connection-light.webp and b/site/assets/shots/tr/tailscale-connection-light.webp differ diff --git a/site/assets/shots/tr/tailscale-settings-dark.webp b/site/assets/shots/tr/tailscale-settings-dark.webp index 172a970a2..00f242ffe 100644 Binary files a/site/assets/shots/tr/tailscale-settings-dark.webp and b/site/assets/shots/tr/tailscale-settings-dark.webp differ diff --git a/site/assets/shots/tr/tailscale-settings-light.webp b/site/assets/shots/tr/tailscale-settings-light.webp index bff0ece6e..d700a1b42 100644 Binary files a/site/assets/shots/tr/tailscale-settings-light.webp and b/site/assets/shots/tr/tailscale-settings-light.webp differ diff --git a/site/assets/shots/tr/together-net-dark.webp b/site/assets/shots/tr/together-net-dark.webp index 977115d1f..96e235f4f 100644 Binary files a/site/assets/shots/tr/together-net-dark.webp and b/site/assets/shots/tr/together-net-dark.webp differ diff --git a/site/assets/shots/tr/together-net-light.webp b/site/assets/shots/tr/together-net-light.webp index 42cfa562d..1ba0ec9ca 100644 Binary files a/site/assets/shots/tr/together-net-light.webp and b/site/assets/shots/tr/together-net-light.webp differ diff --git a/site/assets/shots/tr/together-tab-dark.webp b/site/assets/shots/tr/together-tab-dark.webp index 917716188..90d3edcf1 100644 Binary files a/site/assets/shots/tr/together-tab-dark.webp and b/site/assets/shots/tr/together-tab-dark.webp differ diff --git a/site/assets/shots/tr/together-tab-light.webp b/site/assets/shots/tr/together-tab-light.webp index 90c84f221..c7ab5e86e 100644 Binary files a/site/assets/shots/tr/together-tab-light.webp and b/site/assets/shots/tr/together-tab-light.webp differ diff --git a/site/assets/shots/tr/ts-found-dark.webp b/site/assets/shots/tr/ts-found-dark.webp index f8a89ca1b..518f4fbee 100644 Binary files a/site/assets/shots/tr/ts-found-dark.webp and b/site/assets/shots/tr/ts-found-dark.webp differ diff --git a/site/assets/shots/tr/ts-found-light.webp b/site/assets/shots/tr/ts-found-light.webp index ac557aae1..683938b15 100644 Binary files a/site/assets/shots/tr/ts-found-light.webp and b/site/assets/shots/tr/ts-found-light.webp differ diff --git a/site/assets/shots/tr/upload-dark.webp b/site/assets/shots/tr/upload-dark.webp index 125a9d475..98a486d6a 100644 Binary files a/site/assets/shots/tr/upload-dark.webp and b/site/assets/shots/tr/upload-dark.webp differ diff --git a/site/assets/shots/tr/upload-light.webp b/site/assets/shots/tr/upload-light.webp index af276685f..d27ef6ca1 100644 Binary files a/site/assets/shots/tr/upload-light.webp and b/site/assets/shots/tr/upload-light.webp differ diff --git a/site/assets/shots/tr/workshop-dark.webp b/site/assets/shots/tr/workshop-dark.webp index 1566c8e2a..8831b1877 100644 Binary files a/site/assets/shots/tr/workshop-dark.webp and b/site/assets/shots/tr/workshop-dark.webp differ diff --git a/site/assets/shots/tr/workshop-light.webp b/site/assets/shots/tr/workshop-light.webp index e1a5b2b9d..5601f6fe7 100644 Binary files a/site/assets/shots/tr/workshop-light.webp and b/site/assets/shots/tr/workshop-light.webp differ diff --git a/site/assets/shots/ts-found-dark.webp b/site/assets/shots/ts-found-dark.webp index d820137bd..f29add621 100644 Binary files a/site/assets/shots/ts-found-dark.webp and b/site/assets/shots/ts-found-dark.webp differ diff --git a/site/assets/shots/ts-found-light.webp b/site/assets/shots/ts-found-light.webp index 0bfcca62a..ae3d4df92 100644 Binary files a/site/assets/shots/ts-found-light.webp and b/site/assets/shots/ts-found-light.webp differ diff --git a/site/assets/shots/upload-dark.webp b/site/assets/shots/upload-dark.webp index b4f0aebd7..1392bccab 100644 Binary files a/site/assets/shots/upload-dark.webp and b/site/assets/shots/upload-dark.webp differ diff --git a/site/assets/shots/upload-light.webp b/site/assets/shots/upload-light.webp index 73f132a85..d1b4b3c1f 100644 Binary files a/site/assets/shots/upload-light.webp and b/site/assets/shots/upload-light.webp differ diff --git a/site/assets/shots/vi/add-ps5-dark.webp b/site/assets/shots/vi/add-ps5-dark.webp index 35a506154..5dc354116 100644 Binary files a/site/assets/shots/vi/add-ps5-dark.webp and b/site/assets/shots/vi/add-ps5-dark.webp differ diff --git a/site/assets/shots/vi/add-ps5-light.webp b/site/assets/shots/vi/add-ps5-light.webp index 3b6f66e60..bebf0c1f7 100644 Binary files a/site/assets/shots/vi/add-ps5-light.webp and b/site/assets/shots/vi/add-ps5-light.webp differ diff --git a/site/assets/shots/vi/approval-dark.webp b/site/assets/shots/vi/approval-dark.webp index fa9538970..72f5cd3ee 100644 Binary files a/site/assets/shots/vi/approval-dark.webp and b/site/assets/shots/vi/approval-dark.webp differ diff --git a/site/assets/shots/vi/approval-light.webp b/site/assets/shots/vi/approval-light.webp index fcb26894d..258bc7b57 100644 Binary files a/site/assets/shots/vi/approval-light.webp and b/site/assets/shots/vi/approval-light.webp differ diff --git a/site/assets/shots/vi/connection-dark.webp b/site/assets/shots/vi/connection-dark.webp index af2981042..239d40167 100644 Binary files a/site/assets/shots/vi/connection-dark.webp and b/site/assets/shots/vi/connection-dark.webp differ diff --git a/site/assets/shots/vi/connection-light.webp b/site/assets/shots/vi/connection-light.webp index 21c1048ca..ab53b4cb4 100644 Binary files a/site/assets/shots/vi/connection-light.webp and b/site/assets/shots/vi/connection-light.webp differ diff --git a/site/assets/shots/vi/consoles-dark.webp b/site/assets/shots/vi/consoles-dark.webp index 214477b7b..46987c16d 100644 Binary files a/site/assets/shots/vi/consoles-dark.webp and b/site/assets/shots/vi/consoles-dark.webp differ diff --git a/site/assets/shots/vi/consoles-light.webp b/site/assets/shots/vi/consoles-light.webp index e4e7c6482..a02ade7ec 100644 Binary files a/site/assets/shots/vi/consoles-light.webp and b/site/assets/shots/vi/consoles-light.webp differ diff --git a/site/assets/shots/vi/files-dark.webp b/site/assets/shots/vi/files-dark.webp index 277ebdffa..9768da719 100644 Binary files a/site/assets/shots/vi/files-dark.webp and b/site/assets/shots/vi/files-dark.webp differ diff --git a/site/assets/shots/vi/files-light.webp b/site/assets/shots/vi/files-light.webp index 4ffe03da3..6459cc21d 100644 Binary files a/site/assets/shots/vi/files-light.webp and b/site/assets/shots/vi/files-light.webp differ diff --git a/site/assets/shots/vi/games-dark.webp b/site/assets/shots/vi/games-dark.webp index d88371d78..ea6a3bf32 100644 Binary files a/site/assets/shots/vi/games-dark.webp and b/site/assets/shots/vi/games-dark.webp differ diff --git a/site/assets/shots/vi/games-light.webp b/site/assets/shots/vi/games-light.webp index 19ff7697c..75a3b1ca8 100644 Binary files a/site/assets/shots/vi/games-light.webp and b/site/assets/shots/vi/games-light.webp differ diff --git a/site/assets/shots/vi/home-dark.webp b/site/assets/shots/vi/home-dark.webp index ee495d414..d91525b47 100644 Binary files a/site/assets/shots/vi/home-dark.webp and b/site/assets/shots/vi/home-dark.webp differ diff --git a/site/assets/shots/vi/home-light.webp b/site/assets/shots/vi/home-light.webp index 81ea7a164..42d696663 100644 Binary files a/site/assets/shots/vi/home-light.webp and b/site/assets/shots/vi/home-light.webp differ diff --git a/site/assets/shots/vi/invite-dark.webp b/site/assets/shots/vi/invite-dark.webp index 661f84a06..162d845dc 100644 Binary files a/site/assets/shots/vi/invite-dark.webp and b/site/assets/shots/vi/invite-dark.webp differ diff --git a/site/assets/shots/vi/invite-light.webp b/site/assets/shots/vi/invite-light.webp index 53c6d1e7f..fb58314d3 100644 Binary files a/site/assets/shots/vi/invite-light.webp and b/site/assets/shots/vi/invite-light.webp differ diff --git a/site/assets/shots/vi/kbm-dark.webp b/site/assets/shots/vi/kbm-dark.webp index 6afe9b7d4..02f78aa29 100644 Binary files a/site/assets/shots/vi/kbm-dark.webp and b/site/assets/shots/vi/kbm-dark.webp differ diff --git a/site/assets/shots/vi/kbm-light.webp b/site/assets/shots/vi/kbm-light.webp index 893dceff9..2fa58ca9c 100644 Binary files a/site/assets/shots/vi/kbm-light.webp and b/site/assets/shots/vi/kbm-light.webp differ diff --git a/site/assets/shots/vi/kbm-settings-dark.webp b/site/assets/shots/vi/kbm-settings-dark.webp index 2aab518bc..aed37dcde 100644 Binary files a/site/assets/shots/vi/kbm-settings-dark.webp and b/site/assets/shots/vi/kbm-settings-dark.webp differ diff --git a/site/assets/shots/vi/kbm-settings-light.webp b/site/assets/shots/vi/kbm-settings-light.webp index 56a79d2d5..06cdcd88a 100644 Binary files a/site/assets/shots/vi/kbm-settings-light.webp and b/site/assets/shots/vi/kbm-settings-light.webp differ diff --git a/site/assets/shots/vi/m-files-dark.webp b/site/assets/shots/vi/m-files-dark.webp index 425e27255..1396ef1bb 100644 Binary files a/site/assets/shots/vi/m-files-dark.webp and b/site/assets/shots/vi/m-files-dark.webp differ diff --git a/site/assets/shots/vi/m-files-light.webp b/site/assets/shots/vi/m-files-light.webp index 541c0f6f0..2efeeabfb 100644 Binary files a/site/assets/shots/vi/m-files-light.webp and b/site/assets/shots/vi/m-files-light.webp differ diff --git a/site/assets/shots/vi/m-games-dark.webp b/site/assets/shots/vi/m-games-dark.webp index 14e9a2856..d170a538d 100644 Binary files a/site/assets/shots/vi/m-games-dark.webp and b/site/assets/shots/vi/m-games-dark.webp differ diff --git a/site/assets/shots/vi/m-games-light.webp b/site/assets/shots/vi/m-games-light.webp index a75173c57..18a41a5c1 100644 Binary files a/site/assets/shots/vi/m-games-light.webp and b/site/assets/shots/vi/m-games-light.webp differ diff --git a/site/assets/shots/vi/m-guest-dark.webp b/site/assets/shots/vi/m-guest-dark.webp index 567e4b2cc..fae875a7e 100644 Binary files a/site/assets/shots/vi/m-guest-dark.webp and b/site/assets/shots/vi/m-guest-dark.webp differ diff --git a/site/assets/shots/vi/m-guest-light.webp b/site/assets/shots/vi/m-guest-light.webp index 90c5c5869..8c11bd43a 100644 Binary files a/site/assets/shots/vi/m-guest-light.webp and b/site/assets/shots/vi/m-guest-light.webp differ diff --git a/site/assets/shots/vi/m-home-dark.webp b/site/assets/shots/vi/m-home-dark.webp index c6d95743c..28af5332f 100644 Binary files a/site/assets/shots/vi/m-home-dark.webp and b/site/assets/shots/vi/m-home-dark.webp differ diff --git a/site/assets/shots/vi/m-home-light.webp b/site/assets/shots/vi/m-home-light.webp index f06841dc3..9b8fe2011 100644 Binary files a/site/assets/shots/vi/m-home-light.webp and b/site/assets/shots/vi/m-home-light.webp differ diff --git a/site/assets/shots/vi/m-play-dark.webp b/site/assets/shots/vi/m-play-dark.webp index a293b0b00..4fa1b136f 100644 Binary files a/site/assets/shots/vi/m-play-dark.webp and b/site/assets/shots/vi/m-play-dark.webp differ diff --git a/site/assets/shots/vi/m-play-light.webp b/site/assets/shots/vi/m-play-light.webp index e091e0f6f..f946aa857 100644 Binary files a/site/assets/shots/vi/m-play-light.webp and b/site/assets/shots/vi/m-play-light.webp differ diff --git a/site/assets/shots/vi/phones-dark.webp b/site/assets/shots/vi/phones-dark.webp index d0055306c..da853c669 100644 Binary files a/site/assets/shots/vi/phones-dark.webp and b/site/assets/shots/vi/phones-dark.webp differ diff --git a/site/assets/shots/vi/phones-light.webp b/site/assets/shots/vi/phones-light.webp index cb87b5afc..d25b6e341 100644 Binary files a/site/assets/shots/vi/phones-light.webp and b/site/assets/shots/vi/phones-light.webp differ diff --git a/site/assets/shots/vi/pkg-name-dark.webp b/site/assets/shots/vi/pkg-name-dark.webp index 938d78ec8..a732922f5 100644 Binary files a/site/assets/shots/vi/pkg-name-dark.webp and b/site/assets/shots/vi/pkg-name-dark.webp differ diff --git a/site/assets/shots/vi/pkg-name-light.webp b/site/assets/shots/vi/pkg-name-light.webp index d534f07d2..4eb4da103 100644 Binary files a/site/assets/shots/vi/pkg-name-light.webp and b/site/assets/shots/vi/pkg-name-light.webp differ diff --git a/site/assets/shots/vi/play-dark.webp b/site/assets/shots/vi/play-dark.webp index 60f945ad9..67fe1f5a9 100644 Binary files a/site/assets/shots/vi/play-dark.webp and b/site/assets/shots/vi/play-dark.webp differ diff --git a/site/assets/shots/vi/play-light.webp b/site/assets/shots/vi/play-light.webp index 793a50c90..ca3d4ae51 100644 Binary files a/site/assets/shots/vi/play-light.webp and b/site/assets/shots/vi/play-light.webp differ diff --git a/site/assets/shots/vi/receive-dark.webp b/site/assets/shots/vi/receive-dark.webp index 1c34c788e..a53efbe26 100644 Binary files a/site/assets/shots/vi/receive-dark.webp and b/site/assets/shots/vi/receive-dark.webp differ diff --git a/site/assets/shots/vi/receive-light.webp b/site/assets/shots/vi/receive-light.webp index 87063306b..7e384cdb2 100644 Binary files a/site/assets/shots/vi/receive-light.webp and b/site/assets/shots/vi/receive-light.webp differ diff --git a/site/assets/shots/vi/setup-dark.webp b/site/assets/shots/vi/setup-dark.webp index 9c8680dd6..0b0979e0b 100644 Binary files a/site/assets/shots/vi/setup-dark.webp and b/site/assets/shots/vi/setup-dark.webp differ diff --git a/site/assets/shots/vi/setup-light.webp b/site/assets/shots/vi/setup-light.webp index fcf17bb64..5440595c7 100644 Binary files a/site/assets/shots/vi/setup-light.webp and b/site/assets/shots/vi/setup-light.webp differ diff --git a/site/assets/shots/vi/share-dark.webp b/site/assets/shots/vi/share-dark.webp index 777dcf9d0..873625316 100644 Binary files a/site/assets/shots/vi/share-dark.webp and b/site/assets/shots/vi/share-dark.webp differ diff --git a/site/assets/shots/vi/share-light.webp b/site/assets/shots/vi/share-light.webp index db63c99c2..6882a3240 100644 Binary files a/site/assets/shots/vi/share-light.webp and b/site/assets/shots/vi/share-light.webp differ diff --git a/site/assets/shots/vi/share-link-dark.webp b/site/assets/shots/vi/share-link-dark.webp index e5b27dc3f..77bc3adae 100644 Binary files a/site/assets/shots/vi/share-link-dark.webp and b/site/assets/shots/vi/share-link-dark.webp differ diff --git a/site/assets/shots/vi/share-link-light.webp b/site/assets/shots/vi/share-link-light.webp index 494970b06..bad2a02a2 100644 Binary files a/site/assets/shots/vi/share-link-light.webp and b/site/assets/shots/vi/share-link-light.webp differ diff --git a/site/assets/shots/vi/tailscale-connection-dark.webp b/site/assets/shots/vi/tailscale-connection-dark.webp index e216a41d6..4b20cfe37 100644 Binary files a/site/assets/shots/vi/tailscale-connection-dark.webp and b/site/assets/shots/vi/tailscale-connection-dark.webp differ diff --git a/site/assets/shots/vi/tailscale-connection-light.webp b/site/assets/shots/vi/tailscale-connection-light.webp index 6273a81ea..20a7daac7 100644 Binary files a/site/assets/shots/vi/tailscale-connection-light.webp and b/site/assets/shots/vi/tailscale-connection-light.webp differ diff --git a/site/assets/shots/vi/tailscale-settings-dark.webp b/site/assets/shots/vi/tailscale-settings-dark.webp index e89e87b0c..e13f32e4b 100644 Binary files a/site/assets/shots/vi/tailscale-settings-dark.webp and b/site/assets/shots/vi/tailscale-settings-dark.webp differ diff --git a/site/assets/shots/vi/tailscale-settings-light.webp b/site/assets/shots/vi/tailscale-settings-light.webp index 6ffbf46cb..6de8b9709 100644 Binary files a/site/assets/shots/vi/tailscale-settings-light.webp and b/site/assets/shots/vi/tailscale-settings-light.webp differ diff --git a/site/assets/shots/vi/together-net-dark.webp b/site/assets/shots/vi/together-net-dark.webp index aa37272af..f6aea0428 100644 Binary files a/site/assets/shots/vi/together-net-dark.webp and b/site/assets/shots/vi/together-net-dark.webp differ diff --git a/site/assets/shots/vi/together-net-light.webp b/site/assets/shots/vi/together-net-light.webp index 5b21c9ead..fc889c34d 100644 Binary files a/site/assets/shots/vi/together-net-light.webp and b/site/assets/shots/vi/together-net-light.webp differ diff --git a/site/assets/shots/vi/together-tab-dark.webp b/site/assets/shots/vi/together-tab-dark.webp index ea98b3a6d..287daa88e 100644 Binary files a/site/assets/shots/vi/together-tab-dark.webp and b/site/assets/shots/vi/together-tab-dark.webp differ diff --git a/site/assets/shots/vi/together-tab-light.webp b/site/assets/shots/vi/together-tab-light.webp index 2a66dab58..ce4163a1d 100644 Binary files a/site/assets/shots/vi/together-tab-light.webp and b/site/assets/shots/vi/together-tab-light.webp differ diff --git a/site/assets/shots/vi/ts-found-dark.webp b/site/assets/shots/vi/ts-found-dark.webp index 43a9bac2e..9406ce077 100644 Binary files a/site/assets/shots/vi/ts-found-dark.webp and b/site/assets/shots/vi/ts-found-dark.webp differ diff --git a/site/assets/shots/vi/ts-found-light.webp b/site/assets/shots/vi/ts-found-light.webp index 40e9a73fc..4e62840e0 100644 Binary files a/site/assets/shots/vi/ts-found-light.webp and b/site/assets/shots/vi/ts-found-light.webp differ diff --git a/site/assets/shots/vi/upload-dark.webp b/site/assets/shots/vi/upload-dark.webp index a4bae9286..aca0e0759 100644 Binary files a/site/assets/shots/vi/upload-dark.webp and b/site/assets/shots/vi/upload-dark.webp differ diff --git a/site/assets/shots/vi/upload-light.webp b/site/assets/shots/vi/upload-light.webp index 71bb41a73..c85459e57 100644 Binary files a/site/assets/shots/vi/upload-light.webp and b/site/assets/shots/vi/upload-light.webp differ diff --git a/site/assets/shots/vi/workshop-dark.webp b/site/assets/shots/vi/workshop-dark.webp index 50323df0a..7bcb73109 100644 Binary files a/site/assets/shots/vi/workshop-dark.webp and b/site/assets/shots/vi/workshop-dark.webp differ diff --git a/site/assets/shots/vi/workshop-light.webp b/site/assets/shots/vi/workshop-light.webp index 8d52e7f35..8a2e93612 100644 Binary files a/site/assets/shots/vi/workshop-light.webp and b/site/assets/shots/vi/workshop-light.webp differ diff --git a/site/assets/shots/workshop-dark.webp b/site/assets/shots/workshop-dark.webp index 184dfe48d..891816116 100644 Binary files a/site/assets/shots/workshop-dark.webp and b/site/assets/shots/workshop-dark.webp differ diff --git a/site/assets/shots/workshop-light.webp b/site/assets/shots/workshop-light.webp index 477c45108..3cece0059 100644 Binary files a/site/assets/shots/workshop-light.webp and b/site/assets/shots/workshop-light.webp differ diff --git a/site/assets/shots/zh-CN/add-ps5-dark.webp b/site/assets/shots/zh-CN/add-ps5-dark.webp index 4d295a80e..6a3cc8a4c 100644 Binary files a/site/assets/shots/zh-CN/add-ps5-dark.webp and b/site/assets/shots/zh-CN/add-ps5-dark.webp differ diff --git a/site/assets/shots/zh-CN/add-ps5-light.webp b/site/assets/shots/zh-CN/add-ps5-light.webp index 341940f8b..4793bab70 100644 Binary files a/site/assets/shots/zh-CN/add-ps5-light.webp and b/site/assets/shots/zh-CN/add-ps5-light.webp differ diff --git a/site/assets/shots/zh-CN/approval-dark.webp b/site/assets/shots/zh-CN/approval-dark.webp index 9bef7f274..e6ea74fce 100644 Binary files a/site/assets/shots/zh-CN/approval-dark.webp and b/site/assets/shots/zh-CN/approval-dark.webp differ diff --git a/site/assets/shots/zh-CN/approval-light.webp b/site/assets/shots/zh-CN/approval-light.webp index 1ee09ee91..458ba4f3e 100644 Binary files a/site/assets/shots/zh-CN/approval-light.webp and b/site/assets/shots/zh-CN/approval-light.webp differ diff --git a/site/assets/shots/zh-CN/connection-dark.webp b/site/assets/shots/zh-CN/connection-dark.webp index b77abfed0..dac6a1e22 100644 Binary files a/site/assets/shots/zh-CN/connection-dark.webp and b/site/assets/shots/zh-CN/connection-dark.webp differ diff --git a/site/assets/shots/zh-CN/connection-light.webp b/site/assets/shots/zh-CN/connection-light.webp index f3cc9bbbe..046717a2c 100644 Binary files a/site/assets/shots/zh-CN/connection-light.webp and b/site/assets/shots/zh-CN/connection-light.webp differ diff --git a/site/assets/shots/zh-CN/consoles-dark.webp b/site/assets/shots/zh-CN/consoles-dark.webp index 2eea7952d..ce7f59723 100644 Binary files a/site/assets/shots/zh-CN/consoles-dark.webp and b/site/assets/shots/zh-CN/consoles-dark.webp differ diff --git a/site/assets/shots/zh-CN/consoles-light.webp b/site/assets/shots/zh-CN/consoles-light.webp index 77a314c71..166aa7530 100644 Binary files a/site/assets/shots/zh-CN/consoles-light.webp and b/site/assets/shots/zh-CN/consoles-light.webp differ diff --git a/site/assets/shots/zh-CN/files-dark.webp b/site/assets/shots/zh-CN/files-dark.webp index 0017b6228..6587b8295 100644 Binary files a/site/assets/shots/zh-CN/files-dark.webp and b/site/assets/shots/zh-CN/files-dark.webp differ diff --git a/site/assets/shots/zh-CN/files-light.webp b/site/assets/shots/zh-CN/files-light.webp index 15f6ee461..925367eb5 100644 Binary files a/site/assets/shots/zh-CN/files-light.webp and b/site/assets/shots/zh-CN/files-light.webp differ diff --git a/site/assets/shots/zh-CN/games-dark.webp b/site/assets/shots/zh-CN/games-dark.webp index 33c9b9815..5133ba8c6 100644 Binary files a/site/assets/shots/zh-CN/games-dark.webp and b/site/assets/shots/zh-CN/games-dark.webp differ diff --git a/site/assets/shots/zh-CN/games-light.webp b/site/assets/shots/zh-CN/games-light.webp index 7fff88e7f..277f11718 100644 Binary files a/site/assets/shots/zh-CN/games-light.webp and b/site/assets/shots/zh-CN/games-light.webp differ diff --git a/site/assets/shots/zh-CN/home-dark.webp b/site/assets/shots/zh-CN/home-dark.webp index 3b2614790..c351158b8 100644 Binary files a/site/assets/shots/zh-CN/home-dark.webp and b/site/assets/shots/zh-CN/home-dark.webp differ diff --git a/site/assets/shots/zh-CN/home-light.webp b/site/assets/shots/zh-CN/home-light.webp index 3f29ed590..ca62e33a0 100644 Binary files a/site/assets/shots/zh-CN/home-light.webp and b/site/assets/shots/zh-CN/home-light.webp differ diff --git a/site/assets/shots/zh-CN/invite-dark.webp b/site/assets/shots/zh-CN/invite-dark.webp index 9678e98ea..1331843fc 100644 Binary files a/site/assets/shots/zh-CN/invite-dark.webp and b/site/assets/shots/zh-CN/invite-dark.webp differ diff --git a/site/assets/shots/zh-CN/invite-light.webp b/site/assets/shots/zh-CN/invite-light.webp index e4be11379..ede83adf8 100644 Binary files a/site/assets/shots/zh-CN/invite-light.webp and b/site/assets/shots/zh-CN/invite-light.webp differ diff --git a/site/assets/shots/zh-CN/kbm-dark.webp b/site/assets/shots/zh-CN/kbm-dark.webp index 01b8d0afc..e8ecad7e0 100644 Binary files a/site/assets/shots/zh-CN/kbm-dark.webp and b/site/assets/shots/zh-CN/kbm-dark.webp differ diff --git a/site/assets/shots/zh-CN/kbm-light.webp b/site/assets/shots/zh-CN/kbm-light.webp index 6f0964bda..b70bead2f 100644 Binary files a/site/assets/shots/zh-CN/kbm-light.webp and b/site/assets/shots/zh-CN/kbm-light.webp differ diff --git a/site/assets/shots/zh-CN/kbm-settings-dark.webp b/site/assets/shots/zh-CN/kbm-settings-dark.webp index 34a5b84c2..8b1fe73b0 100644 Binary files a/site/assets/shots/zh-CN/kbm-settings-dark.webp and b/site/assets/shots/zh-CN/kbm-settings-dark.webp differ diff --git a/site/assets/shots/zh-CN/kbm-settings-light.webp b/site/assets/shots/zh-CN/kbm-settings-light.webp index e538108b7..10df9dd3b 100644 Binary files a/site/assets/shots/zh-CN/kbm-settings-light.webp and b/site/assets/shots/zh-CN/kbm-settings-light.webp differ diff --git a/site/assets/shots/zh-CN/m-files-dark.webp b/site/assets/shots/zh-CN/m-files-dark.webp index 947b0d14e..46242898d 100644 Binary files a/site/assets/shots/zh-CN/m-files-dark.webp and b/site/assets/shots/zh-CN/m-files-dark.webp differ diff --git a/site/assets/shots/zh-CN/m-files-light.webp b/site/assets/shots/zh-CN/m-files-light.webp index 4c957c741..b36479402 100644 Binary files a/site/assets/shots/zh-CN/m-files-light.webp and b/site/assets/shots/zh-CN/m-files-light.webp differ diff --git a/site/assets/shots/zh-CN/m-games-dark.webp b/site/assets/shots/zh-CN/m-games-dark.webp index 8d2bc62ed..c215fd4c6 100644 Binary files a/site/assets/shots/zh-CN/m-games-dark.webp and b/site/assets/shots/zh-CN/m-games-dark.webp differ diff --git a/site/assets/shots/zh-CN/m-games-light.webp b/site/assets/shots/zh-CN/m-games-light.webp index 117638023..e5aae84a6 100644 Binary files a/site/assets/shots/zh-CN/m-games-light.webp and b/site/assets/shots/zh-CN/m-games-light.webp differ diff --git a/site/assets/shots/zh-CN/m-home-dark.webp b/site/assets/shots/zh-CN/m-home-dark.webp index 5870da0bc..34b0ce8a8 100644 Binary files a/site/assets/shots/zh-CN/m-home-dark.webp and b/site/assets/shots/zh-CN/m-home-dark.webp differ diff --git a/site/assets/shots/zh-CN/m-home-light.webp b/site/assets/shots/zh-CN/m-home-light.webp index eb0783bf3..b7913b494 100644 Binary files a/site/assets/shots/zh-CN/m-home-light.webp and b/site/assets/shots/zh-CN/m-home-light.webp differ diff --git a/site/assets/shots/zh-CN/m-play-dark.webp b/site/assets/shots/zh-CN/m-play-dark.webp index 86aaee3d0..15505e261 100644 Binary files a/site/assets/shots/zh-CN/m-play-dark.webp and b/site/assets/shots/zh-CN/m-play-dark.webp differ diff --git a/site/assets/shots/zh-CN/m-play-light.webp b/site/assets/shots/zh-CN/m-play-light.webp index 22e3d261d..7042912b8 100644 Binary files a/site/assets/shots/zh-CN/m-play-light.webp and b/site/assets/shots/zh-CN/m-play-light.webp differ diff --git a/site/assets/shots/zh-CN/phones-dark.webp b/site/assets/shots/zh-CN/phones-dark.webp index 35c72a231..ad06d3e3e 100644 Binary files a/site/assets/shots/zh-CN/phones-dark.webp and b/site/assets/shots/zh-CN/phones-dark.webp differ diff --git a/site/assets/shots/zh-CN/phones-light.webp b/site/assets/shots/zh-CN/phones-light.webp index e2dacebf5..9bc41baf4 100644 Binary files a/site/assets/shots/zh-CN/phones-light.webp and b/site/assets/shots/zh-CN/phones-light.webp differ diff --git a/site/assets/shots/zh-CN/pkg-name-dark.webp b/site/assets/shots/zh-CN/pkg-name-dark.webp index 44e915fcc..958bd5711 100644 Binary files a/site/assets/shots/zh-CN/pkg-name-dark.webp and b/site/assets/shots/zh-CN/pkg-name-dark.webp differ diff --git a/site/assets/shots/zh-CN/pkg-name-light.webp b/site/assets/shots/zh-CN/pkg-name-light.webp index e7020934a..a20e401bd 100644 Binary files a/site/assets/shots/zh-CN/pkg-name-light.webp and b/site/assets/shots/zh-CN/pkg-name-light.webp differ diff --git a/site/assets/shots/zh-CN/play-dark.webp b/site/assets/shots/zh-CN/play-dark.webp index 3571ae0f3..78edfe054 100644 Binary files a/site/assets/shots/zh-CN/play-dark.webp and b/site/assets/shots/zh-CN/play-dark.webp differ diff --git a/site/assets/shots/zh-CN/play-light.webp b/site/assets/shots/zh-CN/play-light.webp index 4f766e4fa..b513e5940 100644 Binary files a/site/assets/shots/zh-CN/play-light.webp and b/site/assets/shots/zh-CN/play-light.webp differ diff --git a/site/assets/shots/zh-CN/receive-dark.webp b/site/assets/shots/zh-CN/receive-dark.webp index 27352ce72..00760994c 100644 Binary files a/site/assets/shots/zh-CN/receive-dark.webp and b/site/assets/shots/zh-CN/receive-dark.webp differ diff --git a/site/assets/shots/zh-CN/receive-light.webp b/site/assets/shots/zh-CN/receive-light.webp index 30ba819e3..b82ece76e 100644 Binary files a/site/assets/shots/zh-CN/receive-light.webp and b/site/assets/shots/zh-CN/receive-light.webp differ diff --git a/site/assets/shots/zh-CN/setup-dark.webp b/site/assets/shots/zh-CN/setup-dark.webp index a47f01ca9..316d5ce64 100644 Binary files a/site/assets/shots/zh-CN/setup-dark.webp and b/site/assets/shots/zh-CN/setup-dark.webp differ diff --git a/site/assets/shots/zh-CN/setup-light.webp b/site/assets/shots/zh-CN/setup-light.webp index 0f8135004..3ce47fe08 100644 Binary files a/site/assets/shots/zh-CN/setup-light.webp and b/site/assets/shots/zh-CN/setup-light.webp differ diff --git a/site/assets/shots/zh-CN/share-dark.webp b/site/assets/shots/zh-CN/share-dark.webp index 2499682f8..d078fd147 100644 Binary files a/site/assets/shots/zh-CN/share-dark.webp and b/site/assets/shots/zh-CN/share-dark.webp differ diff --git a/site/assets/shots/zh-CN/share-light.webp b/site/assets/shots/zh-CN/share-light.webp index ca11d334f..aafe9ec72 100644 Binary files a/site/assets/shots/zh-CN/share-light.webp and b/site/assets/shots/zh-CN/share-light.webp differ diff --git a/site/assets/shots/zh-CN/share-link-dark.webp b/site/assets/shots/zh-CN/share-link-dark.webp index 137c2e338..d9bb2943a 100644 Binary files a/site/assets/shots/zh-CN/share-link-dark.webp and b/site/assets/shots/zh-CN/share-link-dark.webp differ diff --git a/site/assets/shots/zh-CN/share-link-light.webp b/site/assets/shots/zh-CN/share-link-light.webp index e5b162930..f5360a384 100644 Binary files a/site/assets/shots/zh-CN/share-link-light.webp and b/site/assets/shots/zh-CN/share-link-light.webp differ diff --git a/site/assets/shots/zh-CN/tailscale-connection-dark.webp b/site/assets/shots/zh-CN/tailscale-connection-dark.webp index dd7b4d870..53753d6f8 100644 Binary files a/site/assets/shots/zh-CN/tailscale-connection-dark.webp and b/site/assets/shots/zh-CN/tailscale-connection-dark.webp differ diff --git a/site/assets/shots/zh-CN/tailscale-connection-light.webp b/site/assets/shots/zh-CN/tailscale-connection-light.webp index c9fd55cbc..639a487eb 100644 Binary files a/site/assets/shots/zh-CN/tailscale-connection-light.webp and b/site/assets/shots/zh-CN/tailscale-connection-light.webp differ diff --git a/site/assets/shots/zh-CN/tailscale-settings-dark.webp b/site/assets/shots/zh-CN/tailscale-settings-dark.webp index 82e9210f2..c538631fc 100644 Binary files a/site/assets/shots/zh-CN/tailscale-settings-dark.webp and b/site/assets/shots/zh-CN/tailscale-settings-dark.webp differ diff --git a/site/assets/shots/zh-CN/tailscale-settings-light.webp b/site/assets/shots/zh-CN/tailscale-settings-light.webp index 0f54c9808..526bafc99 100644 Binary files a/site/assets/shots/zh-CN/tailscale-settings-light.webp and b/site/assets/shots/zh-CN/tailscale-settings-light.webp differ diff --git a/site/assets/shots/zh-CN/together-net-dark.webp b/site/assets/shots/zh-CN/together-net-dark.webp index 98ece5abb..7c9a36a21 100644 Binary files a/site/assets/shots/zh-CN/together-net-dark.webp and b/site/assets/shots/zh-CN/together-net-dark.webp differ diff --git a/site/assets/shots/zh-CN/together-net-light.webp b/site/assets/shots/zh-CN/together-net-light.webp index b02e5c439..587b9ec06 100644 Binary files a/site/assets/shots/zh-CN/together-net-light.webp and b/site/assets/shots/zh-CN/together-net-light.webp differ diff --git a/site/assets/shots/zh-CN/together-tab-dark.webp b/site/assets/shots/zh-CN/together-tab-dark.webp index a17422f4c..4b9b582f2 100644 Binary files a/site/assets/shots/zh-CN/together-tab-dark.webp and b/site/assets/shots/zh-CN/together-tab-dark.webp differ diff --git a/site/assets/shots/zh-CN/together-tab-light.webp b/site/assets/shots/zh-CN/together-tab-light.webp index 9597efeea..0a6aca812 100644 Binary files a/site/assets/shots/zh-CN/together-tab-light.webp and b/site/assets/shots/zh-CN/together-tab-light.webp differ diff --git a/site/assets/shots/zh-CN/ts-found-dark.webp b/site/assets/shots/zh-CN/ts-found-dark.webp index 6dad72b33..f933e8c2d 100644 Binary files a/site/assets/shots/zh-CN/ts-found-dark.webp and b/site/assets/shots/zh-CN/ts-found-dark.webp differ diff --git a/site/assets/shots/zh-CN/ts-found-light.webp b/site/assets/shots/zh-CN/ts-found-light.webp index 8bf2db8ca..50340909b 100644 Binary files a/site/assets/shots/zh-CN/ts-found-light.webp and b/site/assets/shots/zh-CN/ts-found-light.webp differ diff --git a/site/assets/shots/zh-CN/upload-dark.webp b/site/assets/shots/zh-CN/upload-dark.webp index 885ef5654..02457e2dd 100644 Binary files a/site/assets/shots/zh-CN/upload-dark.webp and b/site/assets/shots/zh-CN/upload-dark.webp differ diff --git a/site/assets/shots/zh-CN/upload-light.webp b/site/assets/shots/zh-CN/upload-light.webp index 6611e7400..750f765c7 100644 Binary files a/site/assets/shots/zh-CN/upload-light.webp and b/site/assets/shots/zh-CN/upload-light.webp differ diff --git a/site/assets/shots/zh-CN/workshop-dark.webp b/site/assets/shots/zh-CN/workshop-dark.webp index 7e78ec211..f19f25e5f 100644 Binary files a/site/assets/shots/zh-CN/workshop-dark.webp and b/site/assets/shots/zh-CN/workshop-dark.webp differ diff --git a/site/assets/shots/zh-CN/workshop-light.webp b/site/assets/shots/zh-CN/workshop-light.webp index 3a45ab41f..c5e4a337f 100644 Binary files a/site/assets/shots/zh-CN/workshop-light.webp and b/site/assets/shots/zh-CN/workshop-light.webp differ diff --git a/site/assets/shots/zh-TW/add-ps5-dark.webp b/site/assets/shots/zh-TW/add-ps5-dark.webp index e29e2d081..2ccbdbccf 100644 Binary files a/site/assets/shots/zh-TW/add-ps5-dark.webp and b/site/assets/shots/zh-TW/add-ps5-dark.webp differ diff --git a/site/assets/shots/zh-TW/add-ps5-light.webp b/site/assets/shots/zh-TW/add-ps5-light.webp index 1d81d94e3..2649db235 100644 Binary files a/site/assets/shots/zh-TW/add-ps5-light.webp and b/site/assets/shots/zh-TW/add-ps5-light.webp differ diff --git a/site/assets/shots/zh-TW/approval-dark.webp b/site/assets/shots/zh-TW/approval-dark.webp index 9cfeb05d4..8a681f734 100644 Binary files a/site/assets/shots/zh-TW/approval-dark.webp and b/site/assets/shots/zh-TW/approval-dark.webp differ diff --git a/site/assets/shots/zh-TW/approval-light.webp b/site/assets/shots/zh-TW/approval-light.webp index 4e3200aa4..d7513723f 100644 Binary files a/site/assets/shots/zh-TW/approval-light.webp and b/site/assets/shots/zh-TW/approval-light.webp differ diff --git a/site/assets/shots/zh-TW/connection-dark.webp b/site/assets/shots/zh-TW/connection-dark.webp index 9c913d564..cdbfb2a50 100644 Binary files a/site/assets/shots/zh-TW/connection-dark.webp and b/site/assets/shots/zh-TW/connection-dark.webp differ diff --git a/site/assets/shots/zh-TW/connection-light.webp b/site/assets/shots/zh-TW/connection-light.webp index f32e07a95..f2de045a5 100644 Binary files a/site/assets/shots/zh-TW/connection-light.webp and b/site/assets/shots/zh-TW/connection-light.webp differ diff --git a/site/assets/shots/zh-TW/consoles-dark.webp b/site/assets/shots/zh-TW/consoles-dark.webp index 394c7398a..0252137eb 100644 Binary files a/site/assets/shots/zh-TW/consoles-dark.webp and b/site/assets/shots/zh-TW/consoles-dark.webp differ diff --git a/site/assets/shots/zh-TW/consoles-light.webp b/site/assets/shots/zh-TW/consoles-light.webp index cafedc272..fddce383b 100644 Binary files a/site/assets/shots/zh-TW/consoles-light.webp and b/site/assets/shots/zh-TW/consoles-light.webp differ diff --git a/site/assets/shots/zh-TW/files-dark.webp b/site/assets/shots/zh-TW/files-dark.webp index b48b0dc19..92e95100e 100644 Binary files a/site/assets/shots/zh-TW/files-dark.webp and b/site/assets/shots/zh-TW/files-dark.webp differ diff --git a/site/assets/shots/zh-TW/files-light.webp b/site/assets/shots/zh-TW/files-light.webp index 9b654f01c..883004951 100644 Binary files a/site/assets/shots/zh-TW/files-light.webp and b/site/assets/shots/zh-TW/files-light.webp differ diff --git a/site/assets/shots/zh-TW/games-dark.webp b/site/assets/shots/zh-TW/games-dark.webp index 262a85332..485b62faa 100644 Binary files a/site/assets/shots/zh-TW/games-dark.webp and b/site/assets/shots/zh-TW/games-dark.webp differ diff --git a/site/assets/shots/zh-TW/games-light.webp b/site/assets/shots/zh-TW/games-light.webp index f343815e1..198bb6616 100644 Binary files a/site/assets/shots/zh-TW/games-light.webp and b/site/assets/shots/zh-TW/games-light.webp differ diff --git a/site/assets/shots/zh-TW/home-dark.webp b/site/assets/shots/zh-TW/home-dark.webp index ed83f43c6..5ffbea0b3 100644 Binary files a/site/assets/shots/zh-TW/home-dark.webp and b/site/assets/shots/zh-TW/home-dark.webp differ diff --git a/site/assets/shots/zh-TW/home-light.webp b/site/assets/shots/zh-TW/home-light.webp index 4100479f6..1c1ad5221 100644 Binary files a/site/assets/shots/zh-TW/home-light.webp and b/site/assets/shots/zh-TW/home-light.webp differ diff --git a/site/assets/shots/zh-TW/invite-dark.webp b/site/assets/shots/zh-TW/invite-dark.webp index bb1cdc6d0..eb6a46ebc 100644 Binary files a/site/assets/shots/zh-TW/invite-dark.webp and b/site/assets/shots/zh-TW/invite-dark.webp differ diff --git a/site/assets/shots/zh-TW/invite-light.webp b/site/assets/shots/zh-TW/invite-light.webp index c9dcb4fe6..1ffc47810 100644 Binary files a/site/assets/shots/zh-TW/invite-light.webp and b/site/assets/shots/zh-TW/invite-light.webp differ diff --git a/site/assets/shots/zh-TW/kbm-dark.webp b/site/assets/shots/zh-TW/kbm-dark.webp index eaea42bd2..f3ebc28f7 100644 Binary files a/site/assets/shots/zh-TW/kbm-dark.webp and b/site/assets/shots/zh-TW/kbm-dark.webp differ diff --git a/site/assets/shots/zh-TW/kbm-light.webp b/site/assets/shots/zh-TW/kbm-light.webp index fe9203c41..f0d8946e2 100644 Binary files a/site/assets/shots/zh-TW/kbm-light.webp and b/site/assets/shots/zh-TW/kbm-light.webp differ diff --git a/site/assets/shots/zh-TW/kbm-settings-dark.webp b/site/assets/shots/zh-TW/kbm-settings-dark.webp index 8f17e64eb..c74633fb8 100644 Binary files a/site/assets/shots/zh-TW/kbm-settings-dark.webp and b/site/assets/shots/zh-TW/kbm-settings-dark.webp differ diff --git a/site/assets/shots/zh-TW/kbm-settings-light.webp b/site/assets/shots/zh-TW/kbm-settings-light.webp index 301019896..cd6c5e416 100644 Binary files a/site/assets/shots/zh-TW/kbm-settings-light.webp and b/site/assets/shots/zh-TW/kbm-settings-light.webp differ diff --git a/site/assets/shots/zh-TW/m-files-dark.webp b/site/assets/shots/zh-TW/m-files-dark.webp index c3b5c17e8..f60326a92 100644 Binary files a/site/assets/shots/zh-TW/m-files-dark.webp and b/site/assets/shots/zh-TW/m-files-dark.webp differ diff --git a/site/assets/shots/zh-TW/m-files-light.webp b/site/assets/shots/zh-TW/m-files-light.webp index ed8e702ce..3a4a5acea 100644 Binary files a/site/assets/shots/zh-TW/m-files-light.webp and b/site/assets/shots/zh-TW/m-files-light.webp differ diff --git a/site/assets/shots/zh-TW/m-games-dark.webp b/site/assets/shots/zh-TW/m-games-dark.webp index 4eaeb9961..091d3013c 100644 Binary files a/site/assets/shots/zh-TW/m-games-dark.webp and b/site/assets/shots/zh-TW/m-games-dark.webp differ diff --git a/site/assets/shots/zh-TW/m-games-light.webp b/site/assets/shots/zh-TW/m-games-light.webp index a7522e867..5c8fac2c3 100644 Binary files a/site/assets/shots/zh-TW/m-games-light.webp and b/site/assets/shots/zh-TW/m-games-light.webp differ diff --git a/site/assets/shots/zh-TW/m-guest-dark.webp b/site/assets/shots/zh-TW/m-guest-dark.webp index a712cba8c..fae875a7e 100644 Binary files a/site/assets/shots/zh-TW/m-guest-dark.webp and b/site/assets/shots/zh-TW/m-guest-dark.webp differ diff --git a/site/assets/shots/zh-TW/m-guest-light.webp b/site/assets/shots/zh-TW/m-guest-light.webp index 8c11bd43a..8f9b7b740 100644 Binary files a/site/assets/shots/zh-TW/m-guest-light.webp and b/site/assets/shots/zh-TW/m-guest-light.webp differ diff --git a/site/assets/shots/zh-TW/m-home-dark.webp b/site/assets/shots/zh-TW/m-home-dark.webp index 0f53b65ea..9f748517f 100644 Binary files a/site/assets/shots/zh-TW/m-home-dark.webp and b/site/assets/shots/zh-TW/m-home-dark.webp differ diff --git a/site/assets/shots/zh-TW/m-home-light.webp b/site/assets/shots/zh-TW/m-home-light.webp index 6f2bb2fdb..71586672b 100644 Binary files a/site/assets/shots/zh-TW/m-home-light.webp and b/site/assets/shots/zh-TW/m-home-light.webp differ diff --git a/site/assets/shots/zh-TW/m-play-dark.webp b/site/assets/shots/zh-TW/m-play-dark.webp index 26134f399..3c7eb34ca 100644 Binary files a/site/assets/shots/zh-TW/m-play-dark.webp and b/site/assets/shots/zh-TW/m-play-dark.webp differ diff --git a/site/assets/shots/zh-TW/m-play-light.webp b/site/assets/shots/zh-TW/m-play-light.webp index 55ccf4eda..6aaf34bea 100644 Binary files a/site/assets/shots/zh-TW/m-play-light.webp and b/site/assets/shots/zh-TW/m-play-light.webp differ diff --git a/site/assets/shots/zh-TW/phones-dark.webp b/site/assets/shots/zh-TW/phones-dark.webp index c08b5a70e..e430f2b62 100644 Binary files a/site/assets/shots/zh-TW/phones-dark.webp and b/site/assets/shots/zh-TW/phones-dark.webp differ diff --git a/site/assets/shots/zh-TW/phones-light.webp b/site/assets/shots/zh-TW/phones-light.webp index 370864208..9590b9125 100644 Binary files a/site/assets/shots/zh-TW/phones-light.webp and b/site/assets/shots/zh-TW/phones-light.webp differ diff --git a/site/assets/shots/zh-TW/pkg-name-dark.webp b/site/assets/shots/zh-TW/pkg-name-dark.webp index 04f12e7cf..410376bc1 100644 Binary files a/site/assets/shots/zh-TW/pkg-name-dark.webp and b/site/assets/shots/zh-TW/pkg-name-dark.webp differ diff --git a/site/assets/shots/zh-TW/pkg-name-light.webp b/site/assets/shots/zh-TW/pkg-name-light.webp index f1497a10d..fc4c5329d 100644 Binary files a/site/assets/shots/zh-TW/pkg-name-light.webp and b/site/assets/shots/zh-TW/pkg-name-light.webp differ diff --git a/site/assets/shots/zh-TW/play-dark.webp b/site/assets/shots/zh-TW/play-dark.webp index 4fae48394..8117f357a 100644 Binary files a/site/assets/shots/zh-TW/play-dark.webp and b/site/assets/shots/zh-TW/play-dark.webp differ diff --git a/site/assets/shots/zh-TW/play-light.webp b/site/assets/shots/zh-TW/play-light.webp index 557eca7bb..9e488054c 100644 Binary files a/site/assets/shots/zh-TW/play-light.webp and b/site/assets/shots/zh-TW/play-light.webp differ diff --git a/site/assets/shots/zh-TW/receive-dark.webp b/site/assets/shots/zh-TW/receive-dark.webp index 19780c4b7..9a5e77a3e 100644 Binary files a/site/assets/shots/zh-TW/receive-dark.webp and b/site/assets/shots/zh-TW/receive-dark.webp differ diff --git a/site/assets/shots/zh-TW/receive-light.webp b/site/assets/shots/zh-TW/receive-light.webp index f77ed7474..9ca2e1069 100644 Binary files a/site/assets/shots/zh-TW/receive-light.webp and b/site/assets/shots/zh-TW/receive-light.webp differ diff --git a/site/assets/shots/zh-TW/setup-dark.webp b/site/assets/shots/zh-TW/setup-dark.webp index 16fdc9be1..0a3f85875 100644 Binary files a/site/assets/shots/zh-TW/setup-dark.webp and b/site/assets/shots/zh-TW/setup-dark.webp differ diff --git a/site/assets/shots/zh-TW/setup-light.webp b/site/assets/shots/zh-TW/setup-light.webp index 6745072d1..8e38bdd07 100644 Binary files a/site/assets/shots/zh-TW/setup-light.webp and b/site/assets/shots/zh-TW/setup-light.webp differ diff --git a/site/assets/shots/zh-TW/share-dark.webp b/site/assets/shots/zh-TW/share-dark.webp index b943f7fdd..508c06dc8 100644 Binary files a/site/assets/shots/zh-TW/share-dark.webp and b/site/assets/shots/zh-TW/share-dark.webp differ diff --git a/site/assets/shots/zh-TW/share-light.webp b/site/assets/shots/zh-TW/share-light.webp index 1e2ef6c5f..547e4879d 100644 Binary files a/site/assets/shots/zh-TW/share-light.webp and b/site/assets/shots/zh-TW/share-light.webp differ diff --git a/site/assets/shots/zh-TW/share-link-dark.webp b/site/assets/shots/zh-TW/share-link-dark.webp index 0205fe395..515d8a898 100644 Binary files a/site/assets/shots/zh-TW/share-link-dark.webp and b/site/assets/shots/zh-TW/share-link-dark.webp differ diff --git a/site/assets/shots/zh-TW/share-link-light.webp b/site/assets/shots/zh-TW/share-link-light.webp index cf98e6c25..bd6e2234a 100644 Binary files a/site/assets/shots/zh-TW/share-link-light.webp and b/site/assets/shots/zh-TW/share-link-light.webp differ diff --git a/site/assets/shots/zh-TW/tailscale-connection-dark.webp b/site/assets/shots/zh-TW/tailscale-connection-dark.webp index bf1017c36..a906e4b5f 100644 Binary files a/site/assets/shots/zh-TW/tailscale-connection-dark.webp and b/site/assets/shots/zh-TW/tailscale-connection-dark.webp differ diff --git a/site/assets/shots/zh-TW/tailscale-connection-light.webp b/site/assets/shots/zh-TW/tailscale-connection-light.webp index 657a3e6a4..e6f53ac2e 100644 Binary files a/site/assets/shots/zh-TW/tailscale-connection-light.webp and b/site/assets/shots/zh-TW/tailscale-connection-light.webp differ diff --git a/site/assets/shots/zh-TW/tailscale-settings-dark.webp b/site/assets/shots/zh-TW/tailscale-settings-dark.webp index 94434b905..6160e0d25 100644 Binary files a/site/assets/shots/zh-TW/tailscale-settings-dark.webp and b/site/assets/shots/zh-TW/tailscale-settings-dark.webp differ diff --git a/site/assets/shots/zh-TW/tailscale-settings-light.webp b/site/assets/shots/zh-TW/tailscale-settings-light.webp index 48a293533..687ede4eb 100644 Binary files a/site/assets/shots/zh-TW/tailscale-settings-light.webp and b/site/assets/shots/zh-TW/tailscale-settings-light.webp differ diff --git a/site/assets/shots/zh-TW/together-net-dark.webp b/site/assets/shots/zh-TW/together-net-dark.webp index b6f3c712e..63c147e6f 100644 Binary files a/site/assets/shots/zh-TW/together-net-dark.webp and b/site/assets/shots/zh-TW/together-net-dark.webp differ diff --git a/site/assets/shots/zh-TW/together-net-light.webp b/site/assets/shots/zh-TW/together-net-light.webp index 7d619ceeb..f2f6f16b9 100644 Binary files a/site/assets/shots/zh-TW/together-net-light.webp and b/site/assets/shots/zh-TW/together-net-light.webp differ diff --git a/site/assets/shots/zh-TW/together-tab-dark.webp b/site/assets/shots/zh-TW/together-tab-dark.webp index 9f8fc6476..542382734 100644 Binary files a/site/assets/shots/zh-TW/together-tab-dark.webp and b/site/assets/shots/zh-TW/together-tab-dark.webp differ diff --git a/site/assets/shots/zh-TW/together-tab-light.webp b/site/assets/shots/zh-TW/together-tab-light.webp index 7e18fff27..9175fa54c 100644 Binary files a/site/assets/shots/zh-TW/together-tab-light.webp and b/site/assets/shots/zh-TW/together-tab-light.webp differ diff --git a/site/assets/shots/zh-TW/ts-found-dark.webp b/site/assets/shots/zh-TW/ts-found-dark.webp index f8ba01808..8820a303c 100644 Binary files a/site/assets/shots/zh-TW/ts-found-dark.webp and b/site/assets/shots/zh-TW/ts-found-dark.webp differ diff --git a/site/assets/shots/zh-TW/ts-found-light.webp b/site/assets/shots/zh-TW/ts-found-light.webp index 14bf1befb..846560706 100644 Binary files a/site/assets/shots/zh-TW/ts-found-light.webp and b/site/assets/shots/zh-TW/ts-found-light.webp differ diff --git a/site/assets/shots/zh-TW/upload-dark.webp b/site/assets/shots/zh-TW/upload-dark.webp index 03c594483..49166f164 100644 Binary files a/site/assets/shots/zh-TW/upload-dark.webp and b/site/assets/shots/zh-TW/upload-dark.webp differ diff --git a/site/assets/shots/zh-TW/upload-light.webp b/site/assets/shots/zh-TW/upload-light.webp index 60e25db6a..0553d92e2 100644 Binary files a/site/assets/shots/zh-TW/upload-light.webp and b/site/assets/shots/zh-TW/upload-light.webp differ diff --git a/site/assets/shots/zh-TW/workshop-dark.webp b/site/assets/shots/zh-TW/workshop-dark.webp index d262e990c..80abd59de 100644 Binary files a/site/assets/shots/zh-TW/workshop-dark.webp and b/site/assets/shots/zh-TW/workshop-dark.webp differ diff --git a/site/assets/shots/zh-TW/workshop-light.webp b/site/assets/shots/zh-TW/workshop-light.webp index 57624af86..c8db230f9 100644 Binary files a/site/assets/shots/zh-TW/workshop-light.webp and b/site/assets/shots/zh-TW/workshop-light.webp differ diff --git a/site/join/index.html b/site/join/index.html index 8321b59d2..a1377f178 100644 --- a/site/join/index.html +++ b/site/join/index.html @@ -270,7 +270,7 @@ z AÍp\Ž0N˜HJê´ªØ^U I€wu¸öôú!3å6³‹âVq£³¹´RN£%y10º:pŠ#\:J:b9Hµ7h_Ž:¢I9 _¼™µV,þ <`});var E={a:v};this.setModule=t=>{e.setModule(bi,t)},this.getModule=()=>e.getModule(bi),this.instantiate=()=>(this.getModule().then(e=>WebAssembly.instantiate(e,E)).then(e=>{let t=e.exports;y(t),a=t.g,o(),T(t),n()}),this.ready=new Promise(e=>{n=e}).then(()=>{this.HEAP=a.buffer,this.malloc=x,this.free=C,this.opus_frame_decoder_create=b,this.opus_frame_decode_float_deinterleaved=S,this.opus_frame_decoder_destroy=ee}),this)}var xi=o((()=>{}));function Si(e={}){Si.errors||Object.defineProperties(Si,{errors:{value:new Map([[-1,`OPUS_BAD_ARG: One or more invalid/out of range arguments`],[-2,`OPUS_BUFFER_TOO_SMALL: Not enough bytes allocated in the buffer`],[-3,`OPUS_INTERNAL_ERROR: An internal error was detected`],[-4,`OPUS_INVALID_PACKET: The compressed data passed is corrupted`],[-5,`OPUS_UNIMPLEMENTED: Invalid/unsupported request number`],[-6,`OPUS_INVALID_STATE: An encoder or decoder structure is invalid or already freed`],[-7,`OPUS_ALLOC_FAIL: Memory allocation has failed`]])}}),this._init=()=>new this._WASMAudioDecoderCommon(this).instantiate(this._EmscriptenWASM,this._module).then(e=>{this._common=e,this._inputBytes=0,this._outputSamples=0,this._frameNumber=0,this._input=this._common.allocateTypedArray(this._inputSize,Uint8Array),this._output=this._common.allocateTypedArray(this._outputChannels*this._outputChannelSize,Float32Array);let t=this._common.allocateTypedArray(this._channels,Uint8Array);t.buf.set(this._channelMappingTable),this._decoder=this._common.wasm.opus_frame_decoder_create(this._sampleRate,this._channels,this._streamCount,this._coupledStreamCount,t.ptr,this._preSkip,this._forceStereo)}),Object.defineProperty(this,"ready",{enumerable:!0,get:()=>this._ready}),this.reset=()=>(this.free(),this._init()),this.free=()=>{this._common.free(),this._common.wasm.opus_frame_decoder_destroy(this._decoder),this._common.wasm.free(this._decoder)},this._decode=e=>{if(!(e instanceof Uint8Array))throw Error(`Data to decode must be Uint8Array. Instead got `+typeof e);this._input.buf.set(e);let t=this._common.wasm.opus_frame_decode_float_deinterleaved(this._decoder,this._input.ptr,e.length,this._output.ptr),n;return t<0&&(n=`libopus `+t+` `+(Si.errors.get(t)||`Unknown Error`),console.error(n),t=0),{outputBuffer:this._common.getOutputChannels(this._output.buf,this._outputChannels,t),samplesDecoded:t,error:n}},this.decodeFrame=e=>{let t=[],n=this._decode(e);return n.error&&this._common.addError(t,n.error,e.length,this._frameNumber,this._inputBytes,this._outputSamples),this._frameNumber++,this._inputBytes+=e.length,this._outputSamples+=n.samplesDecoded,this._WASMAudioDecoderCommon.getDecodedAudioMultiChannel(t,[n.outputBuffer],this._outputChannels,n.samplesDecoded,this._sampleRate)},this.decodeFrames=e=>{let t=[],n=[],r=0,i=0;for(;i<e.length;){let a=e[i++],o=this._decode(a);t.push(o.outputBuffer),r+=o.samplesDecoded,o.error&&this._common.addError(n,o.error,a.length,this._frameNumber,this._inputBytes,this._outputSamples),this._frameNumber++,this._inputBytes+=a.length,this._outputSamples+=o.samplesDecoded}return this._WASMAudioDecoderCommon.getDecodedAudioMultiChannel(n,t,this._outputChannels,r,this._sampleRate)},this._isWebWorker=Si.isWebWorker,this._WASMAudioDecoderCommon=Si.WASMAudioDecoderCommon||P,this._EmscriptenWASM=Si.EmscriptenWASM||bi,this._module=Si.module;let t=e=>typeof e==`number`,n=e.sampleRate,r=e.channels,i=e.streamCount,a=e.coupledStreamCount,o=e.channelMappingTable,s=e.preSkip,c=+!!e.forceStereo;if(r>2&&(!t(i)||!t(a)||!Array.isArray(o)))throw Error(`Invalid Opus Decoder Options for multichannel decoding.`);return this._sampleRate=[8e3,12e3,16e3,24e3,48e3].includes(n)?n:48e3,this._channels=t(r)?r:2,this._streamCount=t(i)?i:1,this._coupledStreamCount=t(a)?a:this._channels-1,this._channelMappingTable=o||(this._channels===2?[0,1]:[0]),this._preSkip=s||0,this._forceStereo=r<=8&&r!=2?c:0,this._inputSize=3840*this._channels,this._outputChannelSize=5760,this._outputChannels=this._forceStereo?2:this._channels,this._ready=this._init(),this}var Ci=o((()=>{yi(),xi()})),wi,Ti=o((()=>{yi(),xi(),Ci(),wi=class extends hi{constructor(e){super(e,`opus-decoder`,Si,bi)}async decodeFrame(e){return this.postToDecoder(`decodeFrame`,e)}async decodeFrames(e){return this.postToDecoder(`decodeFrames`,e)}}})),Ei=c({OpusDecoder:()=>Si,OpusDecoderWebWorker:()=>wi}),Di=o((()=>{Ci(),Ti(),yi(),_i(Si,`OpusDecoder`),_i(wi,`OpusDecoderWebWorker`)})),Oi=[8e3,12e3,16e3,24e3,48e3],ki=null;function Ai(){return ki??=Xn(()=>Promise.resolve().then(()=>(Di(),Ei)),__VITE_PRELOAD__,import.meta.url).catch(e=>{throw ki=null,e}),ki}function ji(){return typeof WebAssembly==`object`&&typeof WebAssembly.instantiate==`function`}function Mi(e,t,n,r){return{numberOfFrames:t,numberOfChannels:e.length,sampleRate:n,timestamp:r,format:`f32-planar`,duration:Math.round(t/n*1e6),copyTo(n,r){n.set(e[r.planeIndex].subarray(0,t))},close(){}}}var Ni=class{constructor(e,t=Ai){this.init=e,this.load=t,this.state=`unconfigured`,this.dec=null,this.pending=[]}configure(e){if(this.state===`closed`)throw Error(`the decoder is closed`);if(!ji())throw Error(`no WebAssembly here`);let t=e.sampleRate;if(!Oi.includes(t))throw Error(`Opus does not decode at ${t} Hz`);let n=e.numberOfChannels;if(n<1||n>2)throw Error(`${n} channels: only mono and stereo are decoded`);this.state=`configured`,this.load().then(async e=>{if(this.state===`closed`)return;let r=new e.OpusDecoder({channels:n,sampleRate:t});if(await r.ready,this.state!==`configured`){r.free();return}this.dec=r;let i=this.pending;this.pending=[];for(let e of i)this.state===`configured`&&this.run(e)}).catch(e=>this.fail(e))}decode(e){if(this.state!==`configured`)return;let t=e;if(this.dec)return this.run(t);this.pending.push({timestamp:t.timestamp,data:t.data.slice()}),this.pending.length>50&&this.pending.shift()}run(e){let t=this.dec;if(!t)return;let n;try{n=t.decodeFrame(e.data)}catch(e){return this.fail(e)}n.samplesDecoded&&n.channelData.length&&this.init.output(Mi(n.channelData,n.samplesDecoded,n.sampleRate,e.timestamp))}fail(e){if(this.state===`closed`)return;this.close();let t=e instanceof Error?e:Error(String(e));queueMicrotask(()=>this.init.error(t))}close(){this.state=`closed`,this.pending=[];let e=this.dec;this.dec=null;try{e?.free()}catch{}}},Pi={makeDecoder:e=>new Ni(e),makeChunk:e=>({type:e.type,timestamp:e.timestamp,data:e.data instanceof Uint8Array?e.data:new Uint8Array(e.data)})};function Fi(e,t){for(let n=0;n+3<e.length;n++)if(e[n]===0&&e[n+1]===0&&e[n+2]===1){if(t){let t=e[n+3]>>1&63;if(t>=16&&t<=21)return!0;if(t<16)return!1}else{let t=e[n+3]&31;if(t===5)return!0;if(t===1)return!1}}return!1}function Ii(e){for(let t=0;t+6<e.length;t++)if(e[t]===0&&e[t+1]===0&&e[t+2]===1&&(e[t+3]&31)==7){let n=e=>e.toString(16).padStart(2,`0`);return`avc1.${n(e[t+4])}${n(e[t+5])}${n(e[t+6])}`}return`avc1.4d4028`}var Li=[`hev1.1.6.L153.B0`,`hvc1.1.6.L153.B0`,`hev1.2.4.L153.B0`,`hvc1.2.4.L153.B0`,`hev1.1.6.L150.90`];async function Ri(e,t){if(typeof VideoDecoder>`u`)return null;for(let n of Li)try{if((await VideoDecoder.isConfigSupported({codec:n,codedWidth:e,codedHeight:t})).supported)return n}catch{}return null}function zi(e){let t=[];for(let n=0;n+2<e.length;n++)e[n]===0&&e[n+1]===0&&e[n+2]===1&&(t.push(n+3),n+=2);return t.map((n,r)=>{let i=r+1<t.length?t[r+1]-3:e.length;for(;i>n&&e[i-1]===0;)i--;return e.subarray(n,i)}).filter(e=>e.length>0)}var Bi=(e,t)=>t?e[0]>>1&63:e[0]&31;function Vi(e,...t){let n=8+t.reduce((e,t)=>e+t.length,0),r=new Uint8Array(n);new DataView(r.buffer).setUint32(0,n);for(let t=0;t<4;t++)r[4+t]=e.charCodeAt(t);let i=8;for(let e of t)r.set(e,i),i+=e.length;return r}function F(...e){let t=new Uint8Array(e.reduce((e,[,t])=>e+t,0)),n=0;for(let[r,i]of e){for(let e=i-1;e>=0;e--)t[n+i-1-e]=Math.floor(r/2**(8*e))&255;n+=i}return t}var Hi=(e,t,n,...r)=>Vi(e,F([t,1],[n,3]),...r),Ui=F([65536,4],[0,4],[0,4],[0,4],[65536,4],[0,4],[0,4],[0,4],[1073741824,4]);function Wi(e){let t=e.handler===`vide`,n=Vi(`ftyp`,new TextEncoder().encode(`isom`),F([1,4]),new TextEncoder().encode(`isomiso6mp41`)),r=Vi(`moov`,Hi(`mvhd`,0,0,F([0,4],[0,4],[e.timescale,4],[0,4],[65536,4],[256,2],[0,2],[0,4],[0,4]),Ui,new Uint8Array(24),F([2,4])),Vi(`trak`,Hi(`tkhd`,0,3,F([0,4],[0,4],[1,4],[0,4],[0,4],[0,4],[0,4],[0,2],[0,2],[t?0:256,2],[0,2]),Ui,F([(e.width??0)*65536,4],[(e.height??0)*65536,4])),Vi(`mdia`,Hi(`mdhd`,0,0,F([0,4],[0,4],[e.timescale,4],[0,4],[21956,2],[0,2])),Hi(`hdlr`,0,0,F([0,4]),new TextEncoder().encode(e.handler),new Uint8Array(12),F([0,1])),Vi(`minf`,t?Hi(`vmhd`,0,1,new Uint8Array(8)):Hi(`smhd`,0,0,F([0,4])),Vi(`dinf`,Hi(`dref`,0,0,F([1,4]),Hi(`url `,0,1))),Vi(`stbl`,Hi(`stsd`,0,0,F([1,4]),e.sampleEntry),Hi(`stts`,0,0,F([0,4])),Hi(`stsc`,0,0,F([0,4])),Hi(`stsz`,0,0,F([0,4],[0,4])),Hi(`stco`,0,0,F([0,4])))))),Vi(`mvex`,Hi(`trex`,0,0,F([1,4],[1,4],[0,4],[0,4],[0,4])))),i=new Uint8Array(n.length+r.length);return i.set(n,0),i.set(r,n.length),i}function Gi(e,t,n,r,i){let a=i?33554432:16842752,o=e=>Hi(`trun`,0,1793,F([1,4],[e,4],[n,4],[r.length,4],[a,4])),s=e=>Vi(`traf`,Hi(`tfhd`,0,131072,F([1,4])),Hi(`tfdt`,1,0,F([t,8])),o(e)),c=Hi(`mfhd`,0,0,F([e,4])),l=Vi(`moof`,c,s(0)).length,u=Vi(`moof`,c,s(l+8)),d=Vi(`mdat`,r),f=new Uint8Array(u.length+d.length);return f.set(u,0),f.set(d,u.length),f}function Ki(e,t,n=!1){let r=t?[35,...n?[32,33,34]:[]]:[9,...n?[7,8]:[]],i=zi(e).filter(e=>!r.includes(Bi(e,t))),a=new Uint8Array(i.reduce((e,t)=>e+4+t.length,0)),o=new DataView(a.buffer),s=0;for(let e of i)o.setUint32(s,e.length),a.set(e,s+4),s+=4+e.length;return a}var qi=e=>e.toString(16).padStart(2,`0`),Ji=e=>{let t=new Uint8Array(2+e.length);return t[0]=e.length>>8,t[1]=e.length&255,t.set(e,2),t},Yi=e=>{let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),n=0;for(let r of e)t.set(r,n),n+=r.length;return t};function Xi(e){let t=zi(e),n=t.filter(e=>Bi(e,!1)===7),r=t.filter(e=>Bi(e,!1)===8);return!n.length||!r.length||n[0].length<4?null:Yi([F([1,1],[n[0][1],1],[n[0][2],1],[n[0][3],1],[255,1],[224|n.length,1]),...n.map(Ji),F([r.length,1]),...r.map(Ji)])}function Zi(e,t,n){let r=zi(e),i=e=>r.filter(n=>Bi(n,t)===e),a=(e,t)=>Vi(e,new Uint8Array(6),F([1,2],[0,16],[n.w,2],[n.h,2],[4718592,4],[4718592,4],[0,4],[1,2]),new Uint8Array(32),F([24,2],[65535,2]),t);if(!t){let t=i(7),r=Xi(e);return r?{init:Wi({handler:`vide`,timescale:9e4,sampleEntry:a(`avc1`,Vi(`avcC`,r)),width:n.w,height:n.h}),mime:`video/mp4; codecs="avc1.${qi(t[0][1])}${qi(t[0][2])}${qi(t[0][3])}"`}:null}let o=i(32),s=i(33),c=i(34);if(!o.length||!s.length||!c.length)return null;let l=Xr(s[0]);if(l.length<15)return null;let u=l.subarray(3,15),d=u[0]&31,f=d===2?2:0,p=(e,t)=>Yi([F([128|e,1],[t.length,2]),...t.map(Ji)]),m=Vi(`hvcC`,F([1,1]),u,F([61440,2],[252,1],[253,1],[248|f,1],[248|f,1],[0,2],[15,1],[3,1]),p(32,o),p(33,s),p(34,c)),h=[``,`A`,`B`,`C`][u[0]>>6],g=0,_=(u[1]<<24|u[2]<<16|u[3]<<8|u[4])>>>0;for(let e=0;e<32;e++)_&1<<e&&(g|=1<<31-e);let v=Array.from(u.subarray(5,11));for(;v.length&&v[v.length-1]===0;)v.pop();let y=[`hvc1.${h}${d}`,(g>>>0).toString(16),`${u[0]&32?`H`:`L`}${u[11]}`,...v.map(e=>e.toString(16))].join(`.`);return{init:Wi({handler:`vide`,timescale:9e4,sampleEntry:a(`hvc1`,m),width:n.w,height:n.h}),mime:`video/mp4; codecs="${y}"`}}function Qi(e,t,n,r,i,a){return Gi(e,t,n,Ki(r,i),a)}function $i(e,t){let n=Vi(`dOps`,F([0,1],[e,1],[312,2],[t,4],[0,2],[0,1]));return Wi({handler:`soun`,timescale:48e3,sampleEntry:Vi(`Opus`,new Uint8Array(6),F([1,2],[0,8],[e,2],[16,2],[0,4],[3145728e3,4]),n)})}function ea(e){if(!e.length)return 960;let t=e[0]>>3,n=t<12?[480,960,1920,2880][t%4]:t<16?[480,960][t%2]:[120,240,480,960][t%4],r=e[0]&3,i=r===0?1:r===3?(e[1]??1)&63:2;return n*Math.max(1,i)}function ta(e,t,n){return Gi(e,t,ea(n),n,!0)}var na={watch:30,player:4},ra={watch:{seek:.5,speed:1/0,target:.05},player:{seek:.15,speed:.06,target:.02}},ia={seek:.8,speed:.25,target:.12};function aa(e,t,n){let r=typeof n==`string`?ra[n]:n;return e>r.seek?{seekTo:t-r.target,rate:1}:e>r.speed?{seekTo:null,rate:1.1}:{seekTo:null,rate:1}}function oa(e,t=`watch`,n){return typeof VideoDecoder<`u`?new ha(e,t,n):new ka(e,t,n)}var sa=class{constructor(e,t=()=>performance.now()){this.ask=e,this.now=t,this.last=-1/0}waiting(){if(!this.ask)return;let e=this.now();e-this.last<1e3||(this.last=e,this.ask())}};function I(e){return e.length<3?null:{index:e[0]<<8|e[1],packet:e.subarray(2)}}var L=class{constructor(){this.last=-1}take(e){if(this.last>=0){let t=e-this.last&65535;if(t===0||t>=32768)return!1}return this.last=e,!0}reset(){this.last=-1}};function ca(e){if(e.length>=10)return e;let t=new Uint8Array(10);t.set(e.subarray(0,6));let n=new DataView(t.buffer);return n.setUint32(6,Math.round(n.getUint32(2)/100)||480),t}function la(e,t){return{snd:e,snd_decoded:t.decoded,snd_concealed:t.concealed,snd_underruns:t.underruns,snd_dropped:t.dropped}}var ua=class{constructor(e,t=.2){this.min=e,this.max=t,this.next=0,this.calmSince=0,this.minLead=1/0,this.windowAt=0,this.underruns=0,this.dropped=0,this.cushion=e}at(e,t){this.next<e+.005?(this.next>0&&(this.underruns++,this.cushion=Math.min(this.max,this.cushion+.02)),this.calmSince=e,this.next=e+this.cushion,this.minLead=1/0,this.windowAt=e):e-this.calmSince>10&&this.cushion>this.min&&(this.cushion=Math.max(this.min,this.cushion-.01),this.calmSince=e);let n=this.next-e;if(n>this.cushion+.15)return this.dropped++,null;if(this.minLead=Math.min(this.minLead,n),e-this.windowAt>=.25){let t=this.minLead>this.cushion+da;if(this.minLead=1/0,this.windowAt=e,t)return this.dropped++,null}let r=this.next;return this.next+=t,r}reset(){this.next=0}},da=.02;async function fa(e,t){try{return typeof AudioDecoder>`u`?!1:!!(await AudioDecoder.isConfigSupported({codec:`opus`,sampleRate:e,numberOfChannels:t})).supported}catch{return!1}}var pa=class{constructor(e,t=()=>performance.now()){this.decoder=e,this.now=t,this.n={frames:0,dropped:0,late:0,stalls:0,stall_ms:0,worst_stall_ms:0,key_waits:0},this.a=0,this.d=0,this.w=!1,this.q=[],this.sum=0,this.cnt=0,this.codec=``}get frames(){return this.n.frames}arrived(){let e=this.now();this.a&&e-this.a>50&&this.n.late++,this.a=e}drop(){this.n.dropped++,this.w||this.n.key_waits++,this.w=!0}decoding(){this.w=!1,this.q.push(this.now())>64&&this.q.shift()}drawn(e=!1){let t=this.now(),n=e?this.q.shift():void 0;n!==void 0&&(this.sum+=t-n,this.cnt++);let r=this.d?t-this.d:0;r>100&&this.stall(r),this.d=t,this.n.frames++}stall(e){this.n.stalls++,this.n.stall_ms+=e,this.n.worst_stall_ms=Math.max(this.n.worst_stall_ms,e)}snapshot(){let e=this.d?this.now()-this.d:0,t={...this.n,decoder:this.decoder};this.codec&&(t.codec=this.codec),e>100&&(t.stalls=this.n.stalls+1,t.stall_ms=this.n.stall_ms+e,t.worst_stall_ms=Math.max(this.n.worst_stall_ms,e));for(let e of[`stall_ms`,`worst_stall_ms`])t[e]=Math.round(t[e]);return t.decode_ms=this.cnt?Math.round(this.sum/this.cnt*10)/10:0,this.sum=this.cnt=0,t}},ma=[`pointerup`,`touchend`,`click`,`keydown`],ha=class{get element(){if(!this.wrap){let e=document.createElement(`div`);e.className=`h-full w-full`,e.append(this.canvas),this.mse&&e.append(this.mse.element),this.wrap=e}return this.wrap}get stats(){return this.mse?.stats??this.ownStats}soundReport(){return this.soundOn?this.mseSound?this.mseSound.report():la(this.soundWasm?`wasm`:`webcodecs`,this.soundStats):null}constructor(e,t=`watch`,n){this.onProblem=e,this.latency=t,this.onNeedKey=n,this.canvas=document.createElement(`canvas`),this.wrap=null,this.mse=null,this.failsNoPicture=0,this.ctx=this.canvas.getContext(`2d`,{alpha:!1}),this.hevc=!1,this.header=null,this.spsRect=null,this.software=!1,this.video=null,this.opening=!1,this.stopped=!1,this.sawKey=!1,this.ownStats=new pa(`webcodecs`),this.problemShown=!1,this.ts=0,this.pipe=null,this.audioGen=0,this.actx=null,this.soundOn=!1,this.unarm=null,this.mseSound=null,this.audioHeader=null,this.soundWasm=!1,this.onSoundFail=null,this.muted=!1,this.keyAsk=new sa(n),this.clock=new ua(t===`player`?.05:.08),typeof AudioDecoder>`u`&&va()&&(this.mseSound=new ya(t,()=>this.mseSoundFailed())),this.canvas.className=`block h-full w-full object-contain`,this.canvas.dataset.testid=`watch-canvas`}setHevc(e){this.hevc=e,this.header&&(this.spsRect=ni(this.header,e)),this.mse?.setHevc(e)}get onMse(){return!!this.mse}decodeFailed(){if(this.mse||this.ownStats.frames>0||++this.failsNoPicture<3||!xa())return!1;let e=new ka(this.onProblem,this.latency,this.onNeedKey);e.setHevc(this.hevc),e.markProblemShown(),this.mse=e;let t=this.video;this.video=null;try{t?.close()}catch{}return this.canvas.style&&(this.canvas.style.display=`none`),this.wrap?.append(e.element),this.header&&e.onMessage(new Uint8Array([0,...this.header]).buffer),this.onNeedKey?.(),!0}startSound(){this.soundOn=!0,ga(),this.mseSound?this.mseSound.start():this.openContext()}openContext(){try{if(!this.actx){let e=new AudioContext({latencyHint:`interactive`});this.actx=e,e.onstatechange=()=>{this.actx===e&&e.state!==`running`&&e.state!==`closed`&&this.armResume()}}this.actx.resume().catch(()=>{})}catch{this.onSoundFail?.()}}get sound(){return this.soundOn}setMuted(e){this.muted=e,this.mseSound?.setMuted(e)}resumeSound(){if(!this.soundOn)return;if(this.mseSound)return this.mseSound.resume();let e=this.actx;e&&e.state!==`running`&&e.state!==`closed`&&(this.clock.reset(),e.resume().catch(()=>{}),this.armResume())}get soundStats(){return{decoded:this.pipe?.decoded??0,concealed:this.pipe?.concealed??0,underruns:this.clock.underruns,dropped:this.clock.dropped,cushionMs:Math.round(this.clock.cushion*1e3)}}armResume(){if(this.unarm||typeof window>`u`||!window.addEventListener)return;let e=()=>{let e=this.actx;if(!e||e.state===`closed`)return this.unarm?.();this.clock.reset(),e.resume().then(()=>{e.state===`running`&&this.unarm?.()}).catch(()=>{})};for(let t of ma)window.addEventListener(t,e,!0);this.unarm=()=>{for(let t of ma)window.removeEventListener(t,e,!0);this.unarm=null}}onMessage(e){let t=new Uint8Array(e);if(t.length<1||this.stopped)return;let n=t[0],r=t.subarray(1);if(this.mse&&(n===0||n===1))return n===0&&(this.header=r.slice()),this.mse.onMessage(e);n===0?this.openVideo(r.slice()):n===1?this.onVideo(r):n===3?this.openAudio(r.slice()):n===4&&this.onAudio(r)}async openVideo(e){if(this.header=e,this.spsRect=ni(e,this.hevc),!this.opening){this.opening=!0;try{let t=this.hevc?await Aa(e):Ii(e);if(this.mse||this.stopped)return;if(!t){this.problemShown=!0,this.onProblem(`no_hevc`);return}this.ownStats.codec=t;let n=this.hevc?void 0:Xi(e)??void 0;try{this.video?.close()}catch{}let r=new VideoDecoder({output:e=>{let t=this.realVisible(e),n=this.canvas;(n.width!==t.displayWidth||n.height!==t.displayHeight)&&(n.width=t.displayWidth,n.height=t.displayHeight),this.ctx?.drawImage(t,0,0,n.width,n.height),this.ownStats.drawn(!0),t.close(),this.problemShown&&(this.problemShown=!1,this.onProblem(null))},error:()=>{this.video===r&&(this.problemShown=!0,this.onProblem(`decode`),this.decodeFailed()||this.rebuild())}}),i={codec:t,optimizeForLatency:!0};n&&(i.description=n),this.software&&(i.hardwareAcceleration=`prefer-software`),r.configure(i),this.video=r,this.sawKey=!1}catch{this.problemShown=!0,this.onProblem(`decode`),this.decodeFailed()}finally{this.opening=!1}}}realVisible(e){let t=this.spsRect,n=ri(e,t);if(n)try{let t=new VideoFrame(e,{visibleRect:{x:n.x,y:n.y,width:n.w,height:n.h},displayWidth:n.w,displayHeight:n.h});return e.close(),t}catch{return e}let r=e.visibleRect;if(t&&r&&!this.software&&(r.width<t.w-16||r.height<t.h-16)){this.software=!0;let e=this.video;queueMicrotask(()=>{if(this.video===e){try{e?.close()}catch{}this.rebuild(),this.onNeedKey?.()}})}return e}rebuild(){this.mse||this.stopped||(this.video=null,this.sawKey=!1,this.header&&this.openVideo(this.header).then(()=>this.keyAsk.waiting()))}onVideo(e){let t=this.video;if(t?.state===`closed`){this.opening||this.rebuild();return}if(!t||t.state!==`configured`)return;let n=Fi(e,this.hevc);if(this.ownStats.arrived(),!this.sawKey&&!n)return this.ownStats.drop(),this.keyAsk.waiting();if(!n&&t.decodeQueueSize>na[this.latency])return this.sawKey=!1,this.ownStats.drop(),this.keyAsk.waiting();this.sawKey=!0;let r=e;this.hevc?n&&this.header&&(r=new Uint8Array(this.header.length+e.length),r.set(this.header,0),r.set(e,this.header.length)):r=Ki(e,!1,!0),this.ts+=16667,this.ownStats.decoding(),t.decode(new EncodedVideoChunk({type:n?`key`:`delta`,timestamp:this.ts,data:r}))}openAudio(e){if(e.length<6)return;let t=++this.audioGen;if(this.pipe?.reset(),this.pipe=null,this.clock.reset(),this.audioHeader=e,this.mseSound)return this.mseSound.setHeader(e);let n=e[0];fa(new DataView(e.buffer,e.byteOffset,e.byteLength).getUint32(2),n).then(n=>{if(t!==this.audioGen)return;if(!n)return va()?this.soundThroughMse(e):this.soundThroughWasm(e);let r=new si((e,t)=>this.play(e,t,r.sampleRate));try{r.header(ca(e)),this.pipe=r}catch{this.soundThroughMse(e)}})}soundThroughMse(e){this.pipe=null,this.mseSound||(this.mseSound=new ya(this.latency,()=>this.mseSoundFailed()),this.soundOn&&this.mseSound.start()),this.mseSound.setHeader(e)}soundThroughWasm(e){this.pipe?.reset(),this.soundWasm=!0;let t=new si((e,n)=>this.play(e,n,t.sampleRate),Pi,()=>{this.pipe===t&&(this.pipe=null),this.onSoundFail?.()});this.pipe=t,t.header(ca(e))}mseSoundFailed(){let e=this.mseSound;e&&(this.mseSound=null,e.stop(),this.soundOn&&(this.openContext(),this.actx&&this.actx.state!==`running`&&this.armResume()),this.audioHeader&&this.soundThroughWasm(this.audioHeader))}onAudio(e){if(this.mseSound)return this.mseSound.frame(e);this.soundOn&&this.pipe&&this.pipe.packet(e)}play(e,t,n){let r=this.actx;if(!r||r.state!==`running`||!e.length)return;let i=e[0].length,a=this.clock.at(r.currentTime,i/n);if(a===null)return;let o=r.createBuffer(e.length,i,n),s=this.muted?0:t;e.forEach((e,t)=>o.copyToChannel(s===1?e:e.map(e=>e*s),t));let c=r.createBufferSource();c.buffer=o,c.connect(r.destination),c.start(a)}stop(){this.stopped=!0;try{this.video?.close()}catch{}this.mse?.stop(),this.audioGen++,this.pipe?.reset(),this.pipe=null,this.unarm?.(),this.actx?.close().catch(()=>{}),this.mseSound?.stop()}};function ga(){try{let e=navigator.audioSession;e&&e.type!==`playback`&&(e.type=`playback`)}catch{}}function _a(e,t){try{return e.isTypeSupported(t)}catch{return!1}}function va(){let e=typeof window>`u`?null:xa();return!!e&&(_a(e,`audio/mp4; codecs="Opus"`)||_a(e,`audio/mp4; codecs="opus"`))}var ya=class{constructor(e,t,n=document.createElement(`audio`)){this.onFail=t,this.header=null,this.time=0,this.on=!1,this.failed=!1,this.order=new L,this.el=n,this.track=new Ta(n,()=>this.fail(),e===`player`?ia:e)}get playing(){return this.on&&!this.failed}report(){return{snd:`mse`,snd_jumps:this.track.seeks}}setHeader(e){this.header=e,this.on&&this.open()}start(){if(!this.on&&(this.on=!0,this.header&&this.open(),!this.failed))try{this.el.play()?.catch?.(()=>{})}catch{}}frame(e){if(!this.on||this.failed||!this.track.ready&&!this.track.backlog)return;let t=I(e);if(!t||!this.order.take(t.index))return;let n=ta(this.track.nextSeq(),this.time,t.packet);this.time+=ea(t.packet),this.track.push(n)}setMuted(e){this.el.muted=e}resume(){if(this.playing&&this.el.paused)try{this.el.play()?.catch?.(()=>{})}catch{}}stop(){this.on=!1,this.track.close()}open(){let e=this.header;if(!e||e.length<6||this.failed)return;let t=e[0],n=$i(t,new DataView(e.buffer,e.byteOffset,e.byteLength).getUint32(2));this.track.open(`audio/mp4; codecs="Opus"`,n)||this.track.open(`audio/mp4; codecs="opus"`,n)?(this.time=0,this.order.reset()):this.fail()}fail(){this.failed||(this.failed=!0,this.onFail())}},ba=class{constructor(e,t,n=Pi){this.onFail=t,this.codecs=n,this.actx=null,this.pipe=null,this.header=null,this.on=!1,this.failed=!1,this.muted=!1,this.unarm=null,this.played=!1,this.clock=new ua(e===`player`?.05:.08)}get playing(){return this.on&&!this.failed}get stats(){return{decoded:this.pipe?.decoded??0,concealed:this.pipe?.concealed??0,underruns:this.clock.underruns,dropped:this.clock.dropped}}start(){if(!this.failed){this.on=!0,ga();try{if(!this.actx){let e=new AudioContext({latencyHint:`interactive`});this.actx=e,e.onstatechange=()=>{this.actx===e&&e.state!==`running`&&e.state!==`closed`&&this.armResume()}}this.actx.resume().catch(()=>{}),this.actx.state!==`running`&&this.armResume()}catch{return this.fail()}this.header&&!this.pipe&&this.open()}}setHeader(e){e.length<6||(this.header=e,this.pipe?.reset(),this.pipe=null,this.clock.reset(),this.on&&this.open())}frame(e){this.on&&!this.failed&&this.pipe?.packet(e)}setMuted(e){this.muted=e}resume(){let e=this.actx;this.playing&&e&&e.state!==`running`&&e.state!==`closed`&&(this.clock.reset(),e.resume().catch(()=>{}),this.armResume())}stop(){this.on=!1,this.pipe?.reset(),this.pipe=null,this.unarm?.(),this.actx?.close().catch(()=>{}),this.actx=null}open(){let e=this.header;if(!e||this.failed)return;let t=new si((e,n)=>this.play(e,n,t.sampleRate),this.codecs,()=>{this.pipe===t&&this.fail()});this.pipe=t,t.header(ca(e))}play(e,t,n){let r=this.actx;if(!r||r.state!==`running`||!e.length)return;let i=e[0].length,a=this.clock.at(r.currentTime,i/n);if(a===null)return;let o=r.createBuffer(e.length,i,n),s=this.muted?0:t;e.forEach((e,t)=>o.copyToChannel(s===1?e:e.map(e=>e*s),t));let c=r.createBufferSource();c.buffer=o,c.connect(r.destination),c.start(a),this.played=!0}armResume(){if(this.unarm||typeof window>`u`||!window.addEventListener)return;let e=()=>{let e=this.actx;if(!e||e.state===`closed`)return this.unarm?.();this.clock.reset(),e.resume().then(()=>{e.state===`running`&&this.unarm?.()}).catch(()=>{})};for(let t of ma)window.addEventListener(t,e,!0);this.unarm=()=>{for(let t of ma)window.removeEventListener(t,e,!0);this.unarm=null}}fail(){this.failed||(this.failed=!0,this.stop(),this.onFail())}};function xa(){let e=window;return e.ManagedMediaSource??e.MediaSource??null}var Sa=10,Ca=3;function wa(e,t,n,r=Ca){let i=null;for(let a of e)a>t&&a<=n-r&&(i=a);return i}var Ta=class{constructor(e,t,n=`watch`,r,i=()=>performance.now()){this.el=e,this.onError=t,this.latency=n,this.onNeedKey=r,this.now=i,this.ms=null,this.sb=null,this.queue=[],this.mime=``,this.seq=1,this.ready=!1,this.dropped=!1,this.keys=null,this.seeks=0,this.maxLagS=0,this.fromZero=0,this.trims=0,this.lastJump=null,this.trimAt=-1,this.trimFrom=-1,this.keyAt=-1,this.attached=null,r&&(this.keys=[])}setEdge(e){this.latency=e}markKey(e){this.keys?.push(e),this.keyAt=this.now()}open(e,t){let n=xa();if(!n||!_a(n,e))return!1;this.close();let r=new n;return this.ms=r,this.mime=e,this.queue=[t],this.seq=1,this.ready=!1,this.keys&&=[],r.addEventListener(`sourceopen`,()=>{if(this.ms===r)try{let e=r.addSourceBuffer(this.mime);e.mode=`segments`,e.addEventListener(`updateend`,()=>this.pump()),e.addEventListener(`error`,()=>this.onError()),this.sb=e,this.ready=!0,this.pump()}catch{this.onError()}}),`ManagedMediaSource`in window&&n===window.ManagedMediaSource&&(this.el.disableRemotePlayback=!0),this.attached=Ea(this.el,r),!0}nextSeq(){return this.seq++}get backlog(){return this.queue.length}push(e){this.queue.push(e),this.pump()}pump(){let e=this.sb;if(!e||e.updating||!this.ready)return;let t=this.el;if(e.buffered.length){let n=e.buffered.end(e.buffered.length-1),r=e.buffered.start(0),i=n-t.currentTime,a=aa(i,n,this.latency);if(a.seekTo!==null){this.seeks++,this.maxLagS=Math.max(this.maxLagS,i);let o=this.now(),s=e=>e<0?-1:Math.round(o-e);t.currentTime<.05&&r>1&&this.fromZero++,this.lastJump={at:t.currentTime,start:r,end:n,ranges:e.buffered.length,readyState:t.readyState,paused:t.paused,seeking:t.seeking,sinceTrimMs:s(this.trimAt),trimFrom:this.trimFrom,sinceKeyMs:s(this.keyAt)},t.currentTime=Math.max(r,a.seekTo)}if(t.playbackRate!==a.rate&&(t.playbackRate=a.rate),t.currentTime-r>Sa&&this.trim(e,r))return}let n=this.queue.shift();if(n){try{e.appendBuffer(n)}catch{this.dropped=!0}t.paused&&t.play().catch(()=>{})}}trim(e,t){let n=this.el.currentTime,r=n-Ca;if(this.keys){if(r=wa(this.keys,t,n),r===null)return(this.keys[this.keys.length-1]??-1/0)<=n-Ca&&this.onNeedKey?.(),!1;let e=r;this.keys=this.keys.filter(t=>t>=e),r-=.001}try{return e.remove(t,r),this.trims++,this.trimAt=this.now(),this.trimFrom=n,!0}catch{return!1}}close(){this.ready=!1,this.sb=null,this.queue=[];let e=this.ms;if(this.ms=null,e&&e.readyState===`open`)try{e.endOfStream()}catch{}if(this.attached===`object`)try{this.el.srcObject=null}catch{}this.attached=null,this.el.src?.startsWith(`blob:`)&&URL.revokeObjectURL(this.el.src),this.el.removeAttribute(`src`)}};function Ea(e,t){if(`srcObject`in e)try{return e.srcObject=t,`object`}catch{}return e.src=URL.createObjectURL(t),`url`}var Da=1e4,Oa=class{constructor(e=3,t=Da,n=()=>performance.now()){this.max=e,this.windowMs=t,this.now=n,this.at=[]}fail(){let e=this.now();return this.at=this.at.filter(t=>e-t<this.windowMs),this.at.push(e),this.at.length>=this.max}clear(){this.at=[]}},ka=class{constructor(e,t=`watch`,n,r){this.onProblem=e,this.latency=t,this.wasm=null,this.audioHeader=null,this.muted=!1,this.gaveUp=!1,this.reopening=!1,this.failedWhileOpening=!1,this.wrap=document.createElement(`div`),this.hevc=!1,this.header=null,this.sawKey=!1,this.stats=new pa(`mse`),this.problemShown=!1,this.vTime=0,this.vLast=0,this.soundOn=!1,this.onSoundFail=null,this.onGiveUp=null,this.keyAsk=new sa(n),this.fails=new Oa(3,Da,r);let i=document.createElement(`video`);i.muted=!0,i.autoplay=!0,i.playsInline=!0,i.className=`block h-full w-full object-contain`,i.dataset.testid=`watch-video`,this.audio=new ya(t,()=>this.soundThroughWasm()),this.wrap.className=`h-full w-full`,this.wrap.append(i,this.audio.el),this.video=new Ta(i,()=>this.showProblem(),t,()=>this.keyAsk.waiting()),i.addEventListener(`error`,()=>this.restartVideo()),i.addEventListener(`playing`,()=>{this.fails.clear(),this.problemShown&&(this.problemShown=!1,this.onProblem(null))})}markProblemShown(){this.problemShown=!0}showProblem(){this.problemShown||(this.problemShown=!0,this.onProblem(`decode`))}restartVideo(){if(this.gaveUp)return;if(this.reopening){this.failedWhileOpening=!0;return}if(this.showProblem(),this.fails.fail()){this.gaveUp=!0,this.video.close(),this.onGiveUp?.();return}let e=this.header;if(e){this.header=null,this.reopening=!0,this.failedWhileOpening=!1;try{this.openVideo(e)}finally{this.reopening=!1}this.sawKey=!1,this.keyAsk.waiting(),this.failedWhileOpening&&(this.failedWhileOpening=!1,this.restartVideo())}}get failed(){return this.gaveUp}setVideoEdge(e){this.video.setEdge(e)}get videoSeeks(){return{seeks:this.video.seeks,maxLagMs:Math.round(this.video.maxLagS*1e3),fromZero:this.video.fromZero,trims:this.video.trims,lastJump:this.video.lastJump}}get element(){return this.wrap}resume(){let e=this.video.el;e.paused&&e.play()?.catch?.(()=>{})}setHevc(e){this.hevc=e}startSound(){if(this.soundOn=!0,this.wasm)return this.wasm.start();if(!va())return this.soundThroughWasm();this.audio.start()}soundThroughWasm(){if(this.wasm)return;this.audio.stop();let e=new ba(this.latency,()=>this.onSoundFail?.());this.wasm=e,e.setMuted(this.muted),this.audioHeader&&e.setHeader(this.audioHeader),this.soundOn&&e.start()}resumeSound(){this.soundOn&&(this.wasm?this.wasm.resume():this.audio.resume())}setMuted(e){this.muted=e,this.audio.setMuted(e),this.wasm?.setMuted(e)}soundReport(){return this.soundOn?this.wasm?la(`wasm`,this.wasm.stats):this.audio.report():null}get soundPlaying(){return this.wasm?this.wasm.played:this.audio.playing}get sound(){return this.soundOn}onMessage(e){let t=new Uint8Array(e);if(t.length<1)return;let n=t[0],r=t.subarray(1);n===0?this.openVideo(r.slice()):n===1?this.onVideo(r):n===3?(this.audioHeader=r.slice(),(this.wasm??this.audio).setHeader(this.audioHeader)):n===4&&(this.wasm??this.audio).frame(r)}openVideo(e){let t=!!this.header&&this.header.length===e.length&&this.header.every((t,n)=>t===e[n]);if(t&&this.video.ready)return;if(this.gaveUp){if(t)return;this.gaveUp=!1,this.fails.clear()}this.header=e;let n=ni(e,this.hevc)??{w:1920,h:1080},r=Zi(e,this.hevc,n);r&&(this.stats.codec=/codecs="([^"]+)"/.exec(r.mime)?.[1]??``,this.video.open(r.mime,r.init)?(this.sawKey=!1,this.vTime=0,this.vLast=0):(this.problemShown=!0,this.onProblem(this.hevc?`no_hevc`:`decode`)))}onVideo(e){if(!this.video.ready&&!this.video.backlog)return;let t=Fi(e,this.hevc);if(this.video.dropped&&(this.video.dropped=!1,this.sawKey=!1),this.stats.arrived(),!this.sawKey&&!t)return this.stats.drop(),this.keyAsk.waiting();if(!t&&this.video.backlog>na[this.latency])return this.sawKey=!1,this.stats.drop(),this.keyAsk.waiting();this.sawKey=!0,this.stats.drawn();let n=performance.now(),r=this.vLast?Math.min(9e3,Math.max(750,Math.round((n-this.vLast)*90))):1500;this.vLast=n,t&&this.video.markKey(this.vTime/9e4),this.video.push(Qi(this.video.nextSeq(),this.vTime,r,e,this.hevc,t)),this.vTime+=r}stop(){this.video.close(),this.audio.stop(),this.wasm?.stop()}};async function Aa(e){let t=ii(e);if(t&&typeof VideoDecoder<`u`)try{if((await VideoDecoder.isConfigSupported({codec:t,codedWidth:1920,codedHeight:1080})).supported)return t}catch{}return Ri(1920,1080)}var R={CROSS:1,CIRCLE:2,SQUARE:4,TRIANGLE:8,LEFT:16,RIGHT:32,UP:64,DOWN:128,L1:256,R1:512,L3:1024,R3:2048,OPTIONS:4096,SHARE:8192,TOUCHPAD:16384,PS:32768},ja={buttons:0,l2:0,r2:0,lx:0,ly:0,rx:0,ry:0};function Ma(e,t){let n=e=>Math.max(0,Math.min(1,e));return[Math.round(n(e)*1919),Math.round(n(t)*941)]}var Na={ArrowUp:{button:R.UP},ArrowDown:{button:R.DOWN},ArrowLeft:{button:R.LEFT},ArrowRight:{button:R.RIGHT},Enter:{button:R.CROSS},Space:{button:R.CROSS},Backspace:{button:R.CIRCLE},Escape:{button:R.CIRCLE},KeyQ:{button:R.SQUARE},KeyE:{button:R.TRIANGLE},KeyZ:{button:R.L1},KeyC:{button:R.R1},Digit1:{trigger:`l2`},Digit3:{trigger:`r2`},KeyF:{button:R.L3},KeyG:{button:R.R3},Tab:{button:R.OPTIONS},Backquote:{button:R.SHARE},KeyH:{button:R.PS},KeyT:{button:R.TOUCHPAD},KeyW:{stick:`ly`,dir:-1},KeyS:{stick:`ly`,dir:1},KeyA:{stick:`lx`,dir:-1},KeyD:{stick:`lx`,dir:1},KeyI:{stick:`ry`,dir:-1},KeyK:{stick:`ry`,dir:1},KeyJ:{stick:`rx`,dir:-1},KeyL:{stick:`rx`,dir:1}};R.UP,R.DOWN,R.LEFT,R.RIGHT,R.CROSS,R.CIRCLE,R.SQUARE,R.TRIANGLE,R.L1,R.R1,R.L3,R.R3,R.OPTIONS,R.SHARE,R.PS,R.TOUCHPAD;var Pa=e=>Math.max(-32768,Math.min(32767,Math.round(e)));function Fa(e,t=Na){let n={...ja};for(let r of e){let e=t[r];e&&(`button`in e?n.buttons|=e.button:`stick`in e?n[e.stick]=Pa(n[e.stick]+e.dir*32767):n[e.trigger]=255)}return n}var Ia=[R.CROSS,R.CIRCLE,R.SQUARE,R.TRIANGLE,R.L1,R.R1,0,0,R.SHARE,R.OPTIONS,R.L3,R.R3,R.UP,R.DOWN,R.LEFT,R.RIGHT,R.PS,R.TOUCHPAD];function La(e){return Math.abs(e)<=1.01?Math.round((e+1)*3.5)%8:null}var Ra=[0,1,1,1,0,-1,-1,-1],za=[-1,-1,0,1,1,1,0,-1];function Ba(e,t){let n=e.axes[t.a]??0;if(t.hat){let e=La(n);return e===null?0:(t.hat===`x`?Ra:za)[e]}return t.inv?-n:n}var Va={buttons:Ia.flatMap((e,t)=>e?[[e,{b:t}]]:[]),l2:{b:6},r2:{b:7},lx:{a:0},ly:{a:1},rx:{a:2},ry:{a:3}};function Ha(e,t,n=!1){if(`b`in t){let r=e.buttons[t.b];return r?n&&r.value>0?Math.min(1,r.value):Math.max(+!!r.pressed,r.value):0}if(`h`in t){let n=La(e.axes[t.h]??9);if(n===null)return 0;let r=(n-t.at+8)%8;return+(r===0||r===1||r===7)}let r=e.axes[t.a];if(r===void 0)return 0;let i=t.rest??0;return Math.min(1,Math.max(0,(r-i)/(t.d-i)))}function Ua(e){if(e.mapping===`standard`)return Va;let t=Wa.get(e.id);if(t)return t;let n=e.axes.findIndex(e=>Math.abs(e)>1.05);if(n<0)return Va;let r={...Va,buttons:[...Va.buttons,[R.UP,{h:n,at:0}],[R.RIGHT,{h:n,at:2}],[R.DOWN,{h:n,at:4}],[R.LEFT,{h:n,at:6}]]};return Wa.set(e.id,r),r}var Wa=new Map;function Ga(e,t=Ua){let n={...ja},r=e=>Math.abs(e)<.08?0:Pa(e*32767),i=(e,t)=>Math.abs(t)>Math.abs(e)?t:e,a=(e,t)=>t?r(Ba(e,t)):0;for(let r of e){if(!r||!r.connected)continue;let e=t(r);for(let[t,i]of e.buttons)Ha(r,i)>.5&&(n.buttons|=t);e.l2&&(n.l2=Math.max(n.l2,Math.round(Ha(r,e.l2,!0)*255))),e.r2&&(n.r2=Math.max(n.r2,Math.round(Ha(r,e.r2,!0)*255))),n.lx=i(n.lx,a(r,e.lx)),n.ly=i(n.ly,a(r,e.ly)),n.rx=i(n.rx,a(r,e.rx)),n.ry=i(n.ry,a(r,e.ry))}return n}function Ka(e,t){return{buttons:e.buttons|t.buttons,l2:Math.max(e.l2,t.l2),r2:Math.max(e.r2,t.r2),lx:Pa(e.lx+t.lx),ly:Pa(e.ly+t.ly),rx:Pa(e.rx+t.rx),ry:Pa(e.ry+t.ry),touch:e.touch??t.touch??null,motion:e.motion??t.motion??null}}function qa(e,t,n,r=()=>globalThis.navigator?.getGamepads?.()??[]){let i=e=>e?.vibrationActuator;for(let a of e.some(i)?e:r()){let e=i(a);e&&(t===0&&n===0?e.reset?.():e.playEffect?.(`dual-rumble`,{duration:1e3,strongMagnitude:t/255,weakMagnitude:n/255}))}}var Ja=new Map;function Ya(e,t){return{id:`${e.id} (app)`,index:3+e.slot,connected:!0,mapping:`standard`,timestamp:0,axes:e.axes,buttons:e.buttons.map(e=>({pressed:e>.5,touched:e>0,value:e})),vibrationActuator:t?.vibrationActuator??null,hapticActuators:t?.hapticActuators??[]}}function Xa(e){let t=e?.getGamepads?.()??[];return Ja.size===0||t.some(e=>!!e?.connected)?[...t]:[...Ja.values()].sort((e,t)=>e.slot-t.slot).map(e=>Ya(e))}var Za=`b2,b1,b3,b0,b4,b5,b6,b7,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a3,a4(b1,b2,b0,b3,b6,b4,b7,b5,b8,b9,,,-a1,+a1,-a0,+a0(b1,b2,b0,b3,b4,b5,b6,b7,b8,b9,,,,,,,,,a0,a1(b0,b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a3(b2,b1,b3,b0,b4,b5,,,b8,b9,,,-a1,+a1,-a0,+a0(b1,b2,b0,b3,b4,b5,b6,b7,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a3(b2,b3,b0,b1,b4,b5,b6,b7,b8,b9,,,h0.1,h0.4,h0.8,h0.2,b11,,a0,a1,a2,a3(b1,b2,b0,b3,b4,b5,b6,b7,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,b12,,a0,a1,a2,a3(b1,b2,b0,b3,b4,b5,a3,a4,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,b12,,a0,a1,a2,a5(b0,b1,b3,b4,b6,b7,b8,b9,b10,b11,b13,b14,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a3(b1,b2,b0,b3,b4,b5,b6,b7,b8,b9,,,h0.1,h0.4,h0.8,h0.2,b12,,a0,a1(b1,b0,b2,b3,,b7,a3,a4,,b9,,,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a5,a2(b1,b0,b2,b3,,b7,a3,a4,,b9,,,b12,b14,b15,b13,,,a0,a1,a5,a2(b1,b0,b2,b3,,b7,b4,b5,,b9,,,b12,b14,b15,b13,,,a0,a1,a5~,a2~(b0,b1,b2,b3,b4,b5,a2,a5,b6,b7,b9,b10,h0.1,h0.4,h0.8,h0.2,b8,,a0,a1,a3,a4(b1,b2,,,b7,b5,b4,,,b9,,,b12,b14,b15,b13,,,a0,a1,a5,a2(b0,b1,b3,b4,b6,b5,b7,b2,b8,,,,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a3,a4(b0,b1,b3,b4,b6,b7,b9,b10,b2,b8,,,h0.1,h0.4,h0.8,h0.2,b5,,a0,a1,a3,a4(b1,b2,b0,b3,b4,b5,b6,b7,b8,b9,,,-a1,+a1,-a0,+a0(b0,b1,b3,b4,b6,b5,b7,b2,,b8,,,-a1,+a1,-a0,+a0(b0,b1,b3,b4,b6,b7,a5,a4,b10,b11,b12,b13,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a3(b0,b1,b2,b3,b4,b5,a5,a4,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,b14,,a0,a1,a2,a3(b14,b13,b15,b12,b10,b11,b8,b9,b0,b3,b1,b2,b4,b6,b7,b5,b16,,a0,a1,a2,a3(b0,b1,b3,b2,b4,b5,a2,a5,b8,b9,b11,b12,h0.1,h0.4,h0.8,h0.2,b10,,a0,a1,a3,a4(b1,b2,b0,b3,b4,b5,a3,a4,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,b12,b13,a0,a1,a2,a5(b2,b1,b3,b0,b6,b7,b4,b5,b8,b9,,,-a1,+a1,-a0,+a0(b1,b2,b0,b3,b4,b5,,,b8,b9,,,b12,b13,b15,b14,,,a0,a1,a3,a4(b0,b1,b3,b2,b4,b5,b6,b7,b8,b9,b11,b12,b13,b14,b15,b16,b10,,a0,a1,a2,a3(b0,b1,b3,b2,,b6,a2,a5,,b7,,,b8,b9,b10,b11,,,a0,a1,a3,a4(b0,b1,b3,b2,b4,b5,,,b8,b9,,,b10,b11,b12,b13,,,a0,a1,a2,a3(b0,b1,b2,b3,b4,b5,,,b13,b8,b10,,,,,,,,hx,hy(b0,b1,b2,b3,b4,b5,,,b12,b9,b11,,,,,,,,hx,hy(b0,b1,b3,b2,b5,b6,b7,b8,b9,b10,b12,b13,b14,b15,b16,b17,b11,,a0,a1,a2,a3(b0,b1,b3,b2,b5,b6,b7,b8,b9,b10,b12,b13,h0.1,h0.4,h0.8,h0.2,b11,,a0,a1,a2,a3(b0,b1,b3,b2,b4,b5,b6,b7,b8,b9,,,h0.1,h0.4,h0.8,h0.2(b0,b1,,,,b2,,b4,,b5,,,h0.1,h0.4,h0.8,h0.2,b6(b0,b1,b2,b3,b12,b4,b13,b5,b14,b6,b15,b7,b11,b8,b10,b9,b16,,a0,a1~,a2,a3~(b1,b3,b0,b2,b13,b5,b12,b4,,b6,,,b11,b8,b10,b9,b16,,a0,a1~,a2,a3~(b0,b1,b3,b4,b6,b7,a5,a4,b10,b11,b13,b14,h0.1,h0.4,h0.8,h0.2,b33,,a0,a1,a2,a3(b2,b1,b3,b0,b4,b5,b6,b7,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,b12,,a0,a1,a2,a3(b0,b1,b3,b4,b6,b7,b8,b9,b10,b11,b13,b16,h0.1,h0.4,h0.8,h0.2,b12,,a0,a1,a2,a3(b0,b1,b3,b4,b6,b7,a5,a4,b10,b11,b13,b14,h0.1,h0.4,h0.8,h0.2,b15,,a0,a1,a2,a3(b1,b2,b0,b3,b4,b5,b6,b7,b8,b9,,,h0.1,h0.4,h0.8,h0.2,b12(b0,b1,b2,b3,b4,b5,a2,a5,b6,b7,b9,b10,,,,,b8,,a0,a1,a3,a4(b1,b0,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,b12,,a0,a1,a2,a3(b1,b2,b0,b3,b4,b5,b6,b7,b8,b9,,,h0.1,h0.4,h0.8,h0.2,b12,b13(b1,b2,b0,b3,b4,b5,b6,b7,b8,b9,b10,,h0.1,h0.4,h0.8,h0.2,b12,b13(b0,b1,b2,b3,b4,b5,b6,b7,b8,b9,b11,b12,h0.1,h0.4,h0.8,h0.2,b10,,a0,a1,a2,a3(b0,b1,b2,b3,b4,b5,a2,a5,b6,b7,b9,b10,b12,b13,b14,b15,,,a0,a1,a3,a4(b0,b1,b2,b3,b4,b5,a2,a5,b6,b7,b9,b10,b14,b13,b14,b13,,,a0,a1,a3,a4(b1,b0,b2,b3,,,,,b8,b9,,,h0.1,h0.4,h0.8,h0.2(b2,b3,b1,b0,b4,b5,b6,b7,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,b12,,a0,a1,a2,a3(b0,b1,b2,b3,b4,b5,b6,b7,b8,b9,,,h0.1,h0.4,h0.8,h0.2,b10(b1,b2,b0,b3,b4,b5,a3,a4,b8,b9,,,h0.1,h0.4,h0.8,h0.2,b12,b13,a0,a1,a2,a5(b1,b2,b0,b3,b4,b5,b6,b7,b8,b9,,,h0.1,h0.4,h0.8,h0.2,b12,,a0,a1,a2,a3(b0,b1,b2,b3,b4,b5,+a2,+a5,b6,b7,b9,b10,h0.1,h0.4,h0.8,h0.2,b8,,a0,a1,a3,a4(b1,b2,b0,b3,b4,b5,a3,a4,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,b12,b13(b1,b2,b0,b3,b4,b5,b6,b7,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,b12(b1,b2,b0,b3,b4,b5,b6,b7,b8,b9,,,h0.1,h0.4,h0.8,h0.2(b1,b2,b0,b3,b4,b5,a3,a4,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,b13,,a0,a1,a2,a5(b0,b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,b12,,a0,a1,a2,a3(b1,b0,b3,b2,b4,b5,a2,a5,b6,b7,,,h0.1,h0.4,h0.8,h0.2,b8(b1,b2,,,,,,,b8,b9,,,h0.1,h0.4,h0.8,h0.2(b0,b1,b3,b4,b6,b7,a5,a4,b10,b11,b13,b14,h0.1,h0.4,h0.8,h0.2,b12,,a0,a1,a2,a3(b0,b1,b3,b4,b6,b7,a5,a4,b10,b11,b13,b14,h0.1,h0.4,h0.8,h0.2,b21,,a0,a1,a2,a3(b0,b1,b2,b3,b4,b5,a5,a4,b6,b7,b9,b10,h0.1,h0.4,h0.8,h0.2,b8,,a0,a1,a2,a3(b1,b2,b0,b3,b4,b5,a3,a4,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,b13,b13,a0,a1,a2,a5(b0,b1,b2,b3,b4,b5,a5,a4,,b6,b7,b8,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a3(b0,b1,b2,b3,b4,b5,a2,a5,b7,b6,b9,b10,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a3,a4(b0,b1,b2,b3,b4,b5,a2,a5,b6,b7,b9,b10,h0.1,h0.4,h0.8,h0.2,b7,,a0,a1,a3,a4(b0,b1,b2,b3,b4,b5,a2,a5,b6,b7,b9,b10,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a3,a4(b0,b1,b2,b3,b4,b5,a5,a4,b9,b6,b7,b8,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a3(b0,b1,b3,b4,b6,b7,a5,a4,b10,b11,b13,b14,h0.1,h0.4,h0.8,h0.2,b22,,a0,a1,a2,a3(b0,b1,b2,b3,b4,b5,a2,a3,b6,b7,b9,,b12,b14,b15,b13,b8,,a0,a1(b3,b4,b5,b6,b7,b8,a9,a8,b11,b12,b14,b15,b16,b17,b18,b19,b13,,a0,a1,a2,a3(b0,b1,b3,b4,b8,b6,b9,b7,,b11,,,h0.1,h0.4,h0.8,h0.2,,,a0,a1(b0,b1,b3,b4,b7,b9,b6,b8,b10,b11,,,h0.1,h0.4,h0.8,h0.2(b0,b1,b2,b3,b4,b5,a2,a5,b6,b7,b9,b10,h0.1,h0.4,h0.8,h0.2,,,a0,a1(b1,b0,b4,b3,b6,b7,,,b10,b11,,,-a1,+a1,-a0,+a0(b1,b0,b4,b3,b6,b7,b8,b9,b10,b11,b13,b14,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a3(b0,b1,,,b6,b7,b8,b9,,b11,,,h0.1,h0.4,h0.8,h0.2,b12,,a0,a1,a2,a3(b0,b3,b1,b4,,b10,a5,a4,,b11,b13,b14,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a3(b1,b0,b4,b3,b6,b7,a5,a4,b10,b11,b13,b14,h0.1,h0.4,h0.8,h0.2,b12,,a0,a1,a2,a3(b0,b1,,,b6,b7,b8,b9,b10,b11,b13,,h0.1,h0.4,h0.8,h0.2,b12,,a0,a1,a2,a3(b0,b1,b3,b4,b6,b7,b8,b9,b10,b11,b13,b14,h0.1,h0.4,h0.8,h0.2,b2,,a0,a1,a2,a3(b1,b0,b4,b3,b6,b7,b8,b9,b10,b11,b13,b14,h0.1,h0.4,h0.8,h0.2,b2,,a0,a1,a2,a3(b1,b0,b4,b3,b6,b7,,,b10,b11,,,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a3(b1,b0,b4,b3,b6,b7,a5,a4,b10,b11,b13,b14,h0.1,h0.4,h0.8,h0.2,b2,,a0,a1,a2,a3(b0,b1,b3,b4,b6,b7,b8,b9,b10,b11,,,h0.1,h0.4,h0.8,h0.2,b2,,a0,a1,a2,a3(b0,b1,b3,b4,,b6,,b7,b10,b11,,,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a3(b1,b0,,,,,,,b10,b11,,,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a3(b0,b1,b3,b4,b6,b7,a8,b9,b10,b11,,,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a3(b1,b0,b4,b3,b6,b7,b8,b9,b10,b11,b13,b14,h0.1,h0.4,h0.8,h0.2,b12,,a0,a1,a2,a3(b1,b0,b4,b3,b6,b7,b8,b9,b10,b11,b13,b14,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a3,a4(b1,b0,b4,b3,b6,b7,a5,a4,b10,b11,b13,b14,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a3(b0,b1,b3,b4,b8,b6,b9,b7,,b10,,,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a3(b1,b0,b4,b3,b6,b7,a4,a5,b10,b11,b13,b14,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a3(b1,b0,b4,b3,b6,b7,b8,b9,b10,b11,,,h0.1,h0.4,h0.8,h0.2,b12,,a0,a1,a2,a3(b0,b1,b3,b4,b6,b7,,,b10,b11,b13,b14,h0.1,h0.4,h0.8,h0.2,b12,,a0,a1,a2,a3(b2,b1,b3,b0,b4,b5,b6,b7,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a3(b1,b2,b0,b3,b6,b4,b7,b5,b8,b9,,,-a4,+a4,-a3,+a3(b4,b8,b0,b12,b16,b20,b24,b28,b32,b36,b40,b44,h0.1,h0.4,h0.8,h0.2,,,a0,a4,a8,a12(b8,b12,b0,b4,b16,b20,b24,b28,b32,b36,,,h0.1,h0.4,h0.8,h0.2,b44,,a0,a4,a8,a12(b4,b0,b8,b12,,b28,a12,a16,,b36,,,h0.1,h0.4,h0.8,h0.2,,,a0,a4,a20,a8(b1,b2,b0,b3,,b7,a3,a4,,b9,,,b12,b14,b15,b13,,,a0,a1,a5,a2(b4,b0,b8,b12,,b28,a12,a16,,b36,,,b48,b56,b60,b52,,,a0,a4,a20,a8(b1,b2,,,b7,b5,a3,,,b9,,,b12,b14,b15,b13,,,a0,a1,a5,a2(b0,b1,b2,b3,b4,b5,a2,a5,b9,b8,b6,b7,b11,b12,b13,b14,b10,,a0,a1,a3,a4(b0,b1,b3,b4,b6,b7,,,b5,b8,,,-a1,+a1,-a0,+a0,b2(b0,b1,b2,b3,b4,b5,b6,b15,b8,b9,,,h0.1,h0.4,h0.8,h0.2(b1,b2,b0,b3,b4,b5,b6,b7,b8,b9,b10,b13,h0.1,h0.4,h0.8,h0.2,b12,,a0,a1,a2,a3(b1,b2,b0,b3,b4,b5,b6,b7,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,b12,b13,a0,a1,a2,a3(b1,b2,b0,b3,b4,b5,b6,b7,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,b12,b13(b1,b2,b0,b3,b4,b5,b6,b7,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,b12,,a0,a1,a2,a5(b0,b1,b3,b4,b6,b7,a5,a4,b12,b13,b15,b16,h0.1,h0.4,h0.8,h0.2,b14,,a0,a1,a2,a3(b1,b0,b4,b3,b6,b7,a5,a4,b10,b11,,,-a1,+a1,-a0,+a0,b2(b0,b1,b3,b4,b6,b7,,,b10,b11,,,-a1,+a1,-a0,+a0(b0,b1,b3,b4,b6,b7,b8,a4,b10,b11,b13,b14,h0.1,h0.4,h0.8,h0.2,b12,,a0,a1,a2,a3(b0,b1,b3,b4,b6,b7,b8,b9,b10,b11,b13,b14,h0.1,h0.4,h0.8,h0.2,b12,,a0,a1,a2,a3(b1,b0,b4,b3,b6,b7,,,b10,b11,,,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a31(b0,b1,b3,b4,b8,b6,b9,b7,,b11,,,h0.1,h0.4,h0.8,h0.2,b2,,a0,a1,a2,a3(b0,b1,b3,b4,b6,b7,b8,b9,b10,b11,,,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a3(b0,b1,b3,b4,b6,b7,a5,a4,b10,b11,,,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a3(b1,b0,b4,b3,b6,b7,b8,b9,b10,b11,b13,b14,h0.1,h0.4,h0.8,h0.2,b12,,a0,a1,a3,a4(b1,b0,b4,b3,b6,b7,a4,a5,b10,b11,b13,b14,h0.1,h0.4,h0.8,h0.2,b2,,a0,a1,a2,a3(b1,b0,b4,b3,b6,b7,a5,a4,b10,b11,,,h0.1,h0.4,h0.8,h0.2,b12,,a0,a1,a2,a3(b0,b1,b3,b4,b6,b7,,,b10,b11,,,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a3(b0,b1,b3,b4,b6,b7,,,b10,b11,,,,,,,,,hx,hy(b0,b1,b2,b3,b4,b5,b6,b7,b16,b15,b8,b9,b10,b11,b13,b12,b17,,a0,a1~,a2,a3~(b2,b1,b3,b0,b4,b5,b6,b7,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a4(b2,b1,b3,b0,b4,b5,b6,b7,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a5(b0,b1,b2,b3,b33,b5,,,b6,b7,,,h0.1,h0.4,h0.8,h0.2(b0,b1,b3,b4,b6,b2,,,,b9,,,h0.1,h0.4,h0.8,h0.2(b1,b2,b0,b3,b4,b5,b6,b7,b8,b9,,,h0.1,h0.4,h0.8,h0.2,,,a0,a1(b0,b1,b3,b4,b6,b7,b8,b9,b10,b11,b13,b14,h0.1,h0.4,h0.8,h0.2,b12,,a0,a1,a3,a4(b1,b2,,,b6,,b9,b7,,b8,,,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a3,a2(b2,b1,b3,b0,b4,b5,a3,a4,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a5(b0,b1,b3,b4,,b6,,b2,b7,b9,,,b2,b14,b15,b13(b0,b1,b2,b3,b4,b5,a2,a5,b6,b7,b8,b9,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a3,a4(b0,b1,b3,b4,b6,b5,b7,b2,b10,b8,,,h0.1,h0.4,h0.8,h0.2,,,a0,a1(b0,b1,b3,b4,b6,b7,a5~,a2~,b2,b8,b8,b5,h0.1,h0.4,h0.8,h0.2,,,a0,a1(b0,b1,b4,,b9,b10,b6,b7,b8,,b5,b2,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a3,a4(b0,b1,b2,b3,b4,b5,,,b6,b7,b8,b9,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a3,a4(b0,b1,b2,b3,b5,b4,b10,b11,b7,b6,b8,b9,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a3,a4(b0,b1,b3,b4,b6,b7,b8,b9,b10,b11,b13,b14,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a5(b1,b2,b0,b3,b4,b5,a3,a4,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a5(b0,b1,b3,b2,b6,b7,b4,b5,b8,b9,b11,b12,b13,b14,b15,b16,,,a0,a1,a2,a3(b0,b1,b3,b4,b6,b7,b8,b9,b10,b11,b13,b14,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a3,a4(b16,b19,b17,b18,b6,b7,b8,b9,b10,b11,b13,,h0.1,h0.4,h0.8,h0.2,b12,,a0,a1,a3,a4(b2,b1,b3,b0,b6,b7,b4,b5,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a5,a2(b0,b1,b2,b3,b4,b5,a2,a2,b6,b7,b8,b9,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a3,a4(b0,b1,b2,b3,b4,b5,a2,,b6,b7,b8,b9,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a5(b0,b1,b2,b3,b4,b5,b8,b9,b6,b7,,,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a3,a4(b0,b1,b2,b3,b4,b5,b10,b11,b6,b7,b8,b9,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a3,a4(b0,b1,b2,b3,b4,b5,b10,b11,b7,b6,b8,b9,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a3,a4(b1,b2,b0,b3,b4,b5,b6,b7,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a5(b1,b2,b0,b3,b10,b5,b11,b7,b8,b9,b4,b6,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a3(b1,b2,b0,b3,b5,b7,b4,b6,b8,b9,,,h0.1,h0.4,h0.8,h0.2,b12(b1,b2,b0,b3,b4,b5,a3,a4,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a3(b1,b2,b0,b3,b4,b5,a3,a4,b8,b13,b10,b11,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a5(b1,b2,b0,b3,b4,b5,b6,b7,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,b12,b13,a0,a1,a2,a5(b0,b4,b2,b1,b3,b6,,,b11,b9,,,h0.1,h0.4,h0.8,h0.2(b1,b2,b0,b3,b4,b5,a2,a5,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a3,a4(b0,b1,b2,b3,b9,b10,a4,a5,b4,b6,b7,b8,b11,b12,b13,b14,,,a0,a1,a2,a3(b1,b0,b3,b2,b4,b5,,,b6,b7,b8,b9,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a3,a4(b1,b2,b0,b3,b4,b5,b6,b7,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,,,a0,a1(b0,b1,b2,b3,b4,b5,+a2,-a2,b6,b7,b8,b9,h0.1,h0.4,h0.8,h0.2,,,a0,a1(b1,b0,b3,b2,b4,b5,b6,b7,b8,b9,b10,b11,h0.1,h0.4,h0.8,h0.2,b12,,a0,a1,a2,a3(b0,b1,b3,b4,b6,b7,,,,b11,b13,b14,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a5(b0,b1,b2,b3,b4,b5,+a2,-a2,b6,b7,b8,b9,b11,b14,b12,b13,b10,,a0,a1,a3,a4(b0,b1,b2,b3,b4,b5,,a2,b6,b7,b8,b9,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a3,a4(b0,b1,b3,b4,b6,b7,a4,a3,,,b13,b14,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a5(b0,b1,b2,b3,b4,b5,,,b6,b7,b8,b9,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a2,a5(b6,b7,b9,b10,b12,b13,b14,b15,b16,b17,b19,b20,h0.1,h0.4,h0.8,h0.2,b18,,a0,a1,a3,a4(b0,b1,b2,b3,b4,b5,+a2,-a2,b6,b7,b8,b9,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a3,a4(b0,b1,,,,,,,b7,b6,,,h0.1,h0.4,h0.8,h0.2,,,a0,a1(b0,b1,b3,b4,b6,b7,,,b10,b11,,,h0.1,h0.4,h0.8,h0.2,,,a0,a1(b0,b1,b3,b4,b6,b7,,,b10,b11,,,,,,,,,a0,a1(b1,b0,b4,b3,b6,b7,b8,b9,b10,b11,b13,b14,h0.1,h0.4,h0.8,h0.2,b2,,a0,a1,a2,a5(b1,b0,b4,b3,b6,b7,b8,b9,b10,b11,b13,b14,h0.1,h0.4,h0.8,h0.2,b2,,a0,a1,a3,a4(b1,b0,b4,b3,,b6,,b7,b10,b11,,,h0.1,h0.4,h0.8,h0.2,,,a0,a1,a3,a5`.split(`(`),Qa={l00790006:0,l00790011:1,l00790016:2,l00790122:3,l00790126:4,l00791800:5,l00791803:6,l0079181a:7,l0079181b:8,l0079181c:9,l00791830:10,l00791843:11,l00791844:12,l00791845:11,l00791846:13,l007918d2:7,l007918d4:14,l0079954e:15,l046dc20a:16,l046dc211:17,l046dc216:5,l046dc218:5,l046dc219:5,l046dc21a:18,l046dc21d:14,l046dc21e:14,l046dc21f:14,l046dcad1:5,l046dcad2:5,l04b4010a:19,l04b42411:20,l04b42412:21,l054c0268:22,l054c05c4:23,l054c09cc:24,l054c0ba0:24,l054c0cda:25,l054c0ce6:24,l054c0df2:24,l054c0e5f:24,l054c1337:26,l057e0330:27,l057e0337:28,l057e1337:29,l057e2006:30,l057e2007:31,l057e2008:32,l057e2009:33,l057e2017:34,l057e201e:35,l057e2069:36,l057e2073:37,l05ac022d:38,l05ac055b:39,l05ac057a:40,l05ac061a:41,l0e6f0109:42,l0e6f011e:7,l0e6f011f:14,l0e6f0128:5,l0e6f012f:7,l0e6f0130:7,l0e6f0131:14,l0e6f0139:14,l0e6f0146:43,l0e6f0164:14,l0e6f0180:7,l0e6f0181:7,l0e6f0184:7,l0e6f0185:44,l0e6f0187:7,l0e6f0188:7,l0e6f0203:45,l0e6f0207:46,l0e6f0213:14,l0e6f0214:7,l0e6f02a7:14,l0e6f02a8:47,l0e6f02b2:48,l0e6f02b8:14,l0e6f02c8:14,l0e6f02d7:49,l0e6f02d8:14,l0e6f02da:14,l0e6f02ef:14,l0e6f02f1:14,l0e6f0301:14,l0e6f0315:14,l0e6f0401:14,l0e6f0413:14,l0e6f1112:50,l0e6f1113:51,l0e6ff501:14,l0f0d0009:7,l0f0d0010:42,l0f0d0011:7,l0f0d0016:52,l0f0d0022:42,l0f0d004d:7,l0f0d005e:53,l0f0d005f:54,l0f0d0066:24,l0f0d0067:14,l0f0d006a:8,l0f0d006b:7,l0f0d006d:55,l0f0d006e:7,l0f0d0084:8,l0f0d0085:7,l0f0d0086:47,l0f0d0087:56,l0f0d0088:57,l0f0d0092:58,l0f0d00aa:39,l0f0d00c1:7,l0f0d00ee:59,l0f0d00f6:60,l0f0d00fb:39,l0f0d0137:61,l0f0d0138:62,l0f0d0150:14,l0f0d0185:14,l0f0d0196:63,l0f0d01ab:63,l15320401:24,l15320402:7,l15320705:64,l15320900:65,l15320a03:14,l15320a14:14,l15320a29:14,l15321000:8,l15321008:66,l1532100a:59,l1532100b:24,l15321100:24,l18d19400:65,l20d60dad:67,l20d62002:68,l20d62005:14,l20d6200b:14,l20d6200f:69,l20d62065:14,l20d62802:14,l20d64001:70,l20d64002:70,l20d64005:14,l20d66271:71,l20d6792a:24,l20d689e5:71,l20d6a710:5,l20d6a711:7,l20d6a712:7,l20d6a713:7,l20d6a714:7,l20d6ca6d:7,l24c65300:14,l24c6531a:14,l24c6541a:14,l24c6543a:14,l24c6581a:14,l24c65b02:14,l24c65d04:14,l24c6891a:63,l24c6891b:63,l24c6892a:72,l24c6892b:63,l24c6fafe:14,l27f80bbf:63,l28de1102:73,l28de1105:73,l28de1106:73,l28de1142:73,l28de11fc:43,l28de11ff:14,l28de1201:73,l28de1202:73,l28de1205:74,l2dc80651:75,l2dc81003:76,l2dc81080:76,l2dc82000:14,l2dc82003:14,l2dc8200a:77,l2dc82019:14,l2dc82025:14,l2dc82101:63,l2dc82830:78,l2dc82862:79,l2dc82865:79,l2dc82869:80,l2dc8286a:81,l2dc83010:82,l2dc83011:63,l2dc83012:63,l2dc83013:63,l2dc83015:63,l2dc83016:63,l2dc83017:63,l2dc83019:83,l2dc8301b:63,l2dc8301d:63,l2dc83100:84,l2dc83101:85,l2dc83102:85,l2dc83103:85,l2dc83104:85,l2dc83106:14,l2dc8310a:14,l2dc8310b:14,l2dc83230:86,l2dc83810:79,l2dc83820:87,l2dc85006:88,l2dc85101:89,l2dc85103:86,l2dc85104:90,l2dc85107:91,l2dc85108:91,l2dc85109:90,l2dc85111:92,l2dc85112:82,l2dc86000:92,l2dc86001:93,l2dc86002:92,l2dc86006:82,l2dc86007:94,l2dc86009:82,l2dc86012:63,l2dc86100:87,l2dc86101:93,l2dc86102:92,l2dc86728:95,l2dc89000:96,l2dc89001:96,l2dc89012:93,l2dc89015:79,l2dc89018:78,l2dc89020:97,l2dc89025:98,l2dc8ab21:78,l35371004:14,l35371007:63,l3537100b:14,l35371046:63,l35371058:63,l35371094:63,l35371097:63,l358a0102:63,l358a0202:63,l358a0203:63,l358a0204:63,m00790006:99,m00790011:100,m00791800:101,m00791803:102,m0079181c:41,m00791843:103,m00791844:104,m00791846:105,m007918d2:39,m0079954e:106,m046dc216:5,m046dc218:5,m046dc219:5,m046dc21a:18,m046dc21f:107,m04b4010a:108,m04b42411:20,m04b42412:20,m054c0268:22,m054c05c4:24,m054c09cc:24,m054c0ba0:24,m054c0cda:25,m054c0ce6:24,m054c0df2:24,m054c0e5f:24,m054c1337:26,m057e2006:30,m057e2007:31,m057e2009:60,m057e2017:109,m057e2069:36,m057e2073:37,m05ac061a:41,m0e6f0109:42,m0e6f0184:110,m0e6f0187:5,m0e6f0201:107,m0e6f0203:45,m0e6f0207:46,m0e6f0401:107,m0f0d002d:54,m0f0d004d:7,m0f0d005e:111,m0f0d005f:7,m0f0d0066:24,m0f0d006e:7,m0f0d0084:8,m0f0d0085:7,m0f0d0087:112,m0f0d0088:57,m0f0d0092:58,m0f0d00aa:39,m0f0d00c1:7,m0f0d00ee:113,m0f0d00f6:3,m0f0d0138:62,m0f0d0200:7,m15320401:24,m15320402:7,m15320705:64,m15320900:65,m15320a03:107,m15321000:8,m15321100:24,m18d19400:65,m20d66271:71,m20d6792a:24,m20d6a710:7,m20d6a711:44,m20d6ca6d:7,m24c6543a:107,m24c65d04:107,m24c6891a:114,m24c6891b:63,m24c6892a:64,m24c6892b:63,m24c6fafe:107,m2dc80651:115,m2dc82820:116,m2dc82830:78,m2dc82840:78,m2dc82865:87,m2dc82869:80,m2dc8286a:81,m2dc83011:63,m2dc83012:63,m2dc83013:63,m2dc83015:117,m2dc83016:63,m2dc83017:118,m2dc83019:83,m2dc8301b:63,m2dc8301d:63,m2dc83100:9,m2dc83101:85,m2dc83102:85,m2dc83103:85,m2dc83104:85,m2dc83105:84,m2dc83230:119,m2dc83810:94,m2dc85006:120,m2dc85101:89,m2dc85103:86,m2dc85104:90,m2dc85107:121,m2dc85108:122,m2dc85109:90,m2dc85111:82,m2dc85112:82,m2dc86001:79,m2dc86002:85,m2dc86006:82,m2dc86009:123,m2dc86101:85,m2dc86102:85,m2dc86728:95,m2dc89000:96,m2dc89001:79,m2dc89012:78,m2dc89015:124,m2dc89018:78,m2dc89020:125,m2dc89025:126,m2dc89026:127,m2dc8ab12:116,m35371022:63,m35371041:63,m35371046:63,m35371104:63,m358a0102:63,m358a0201:128,m358a0202:128,m358a0203:128,m358a0204:63,w00790002:129,w00790007:129,w0079000a:129,w00790016:18,w00790122:99,w00790126:130,w00791804:131,w0079181a:7,w0079181b:113,w00791824:132,w00791830:133,w00791845:11,w00791847:12,w0079184f:134,w00791879:135,w0079188f:136,w007918ae:137,w007918d4:138,w046dc209:139,w046dc20a:16,w046dc20b:140,w046dc211:141,w046dc21d:138,w046dc21e:142,w046dc242:142,w046dca84:143,w046dca88:143,w046dcad1:5,w046dcad2:7,w04b42410:144,w04b4c681:130,w054c05c5:145,w057e0330:146,w05ac022d:144,w05ac033d:147,w05ac044d:147,w05ac055b:39,w05ac057a:148,w0e6f0003:149,w0e6f0111:7,w0e6f0114:7,w0e6f0119:7,w0e6f011a:7,w0e6f011e:7,w0e6f011f:150,w0e6f0124:42,w0e6f0128:7,w0e6f012f:7,w0e6f0130:7,w0e6f0132:7,w0e6f0146:138,w0e6f0164:151,w0e6f0180:7,w0e6f0181:7,w0e6f0185:44,w0e6f0188:7,w0e6f0189:7,w0e6f0214:7,w0e6f0301:138,w0e6f1113:51,w0e6f6302:7,w0f0d0009:7,w0f0d000a:152,w0f0d000c:153,w0f0d000d:154,w0f0d0010:155,w0f0d0011:57,w0f0d0013:155,w0f0d001b:152,w0f0d0021:155,w0f0d0022:54,w0f0d0025:42,w0f0d0026:155,w0f0d0027:42,w0f0d0032:155,w0f0d003d:156,w0f0d0040:157,w0f0d0042:155,w0f0d0049:7,w0f0d004b:155,w0f0d0051:155,w0f0d0054:7,w0f0d0055:8,w0f0d005b:113,w0f0d005c:7,w0f0d0064:155,w0f0d0067:70,w0f0d006a:8,w0f0d006b:7,w0f0d006f:158,w0f0d0070:57,w0f0d007b:155,w0f0d008a:8,w0f0d008b:7,w0f0d008c:138,w0f0d009c:8,w0f0d00a0:159,w0f0d00a5:160,w0f0d00a6:111,w0f0d00ad:161,w0f0d00ae:142,w0f0d00af:162,w0f0d00c0:138,w0f0d00c9:5,w0f0d00d8:163,w0f0d00dc:138,w0f0d0101:5,w0f0d0104:142,w0f0d0123:144,w0f0d0137:164,w0f0d0162:165,w0f0d0164:166,w0f0d0196:134,w0f0d0202:167,w0f0d1011:168,w153202a6:169,w15320300:170,w15320707:147,w15320a14:138,w15321004:145,w15321007:145,w15321009:145,w1532100a:5,w18d12c40:171,w20d60060:7,w20d60dad:142,w20d6319f:7,w20d64026:134,w20d64033:134,w20d6571d:7,w20d6576d:7,w20d65795:7,w20d657c7:7,w20d657e5:7,w20d689e5:172,w20d6a712:7,w20d6a713:7,w20d6a714:7,w20d6a720:7,w24c6531a:153,w24c65b02:138,w27f80bbf:173,w28de11fc:70,w28de11ff:174,w2dc802e0:175,w2dc81003:176,w2dc81080:176,w2dc82100:144,w2dc82810:177,w2dc82862:78,w2dc83000:78,w2dc83001:178,w2dc8301c:134,w2dc8310a:134,w2dc83820:179,w2dc85001:180,w2dc86000:79,w2dc86003:123,w2dc86012:134,w2dc86100:85,w2dc86103:123,w2dc8ab11:179,w2dc8ab20:178,w2dc8ab21:78,w35371004:138,w35371007:134,w35371094:134,w35371116:134},$a=e=>e.toLowerCase().padStart(4,`0`);function eo(e){let t=/^(.*?)\s*\((?:[^()]*?\s)?Vendor:\s*([0-9a-f]{1,4})\s+Product:\s*([0-9a-f]{1,4})\s*\)\s*$/i.exec(e);if(t)return{vendor:$a(t[2]),product:$a(t[3]),name:t[1].trim()};let n=/^([0-9a-f]{1,4})-([0-9a-f]{1,4})-(.*)$/i.exec(e.trim());return n?{vendor:$a(n[1]),product:$a(n[2]),name:n[3].trim()}:null}function to(e){return(eo(e)?.name??e.replace(/\s*\((?:XInput\s*)?STANDARD GAMEPAD\)\s*$/i,``)).trim()||e}function no(e=globalThis.navigator){let t=e?.userAgent??``;return/Android|iPhone|iPad|iPod/i.test(t)?null:/Macintosh|Mac OS X/i.test(t)?(e?.maxTouchPoints??0)>1?null:`m`:/Windows/i.test(t)?`w`:/Linux|CrOS|X11/i.test(t)?`l`:null}function ro(e,t){if(!t)return null;let n=t===`l`?[`l`]:[`m`,`w`];for(let t of n){let n=Qa[`${t}${e.vendor}${e.product}`];if(n!==void 0)return Za[n]??null}return null}function io(e){return e.mapping!==`standard`&&eo(e.id)?.vendor===`2dc8`}var ao={6003:`switch`,6006:`switch`,6103:`switch`,3010:`switch`,6001:`startx`,6002:`startx`,6101:`startx`,6102:`startx`,3011:`receiver`,3012:`receiver`,3013:`receiver`,3015:`receiver`,3016:`receiver`,3017:`receiver`,"301b":`receiver`,"301c":`receiver`,"301d":`receiver`,6012:`receiver`,5112:`none`,9020:`none`};function oo(e){let t=eo(e);return t&&ao[t.product]||`manual`}var so={1:0,2:2,4:4,8:6};function co(e){let t=0,n=!1;for(let r of e){let e=/a(\d+)/.exec(r);e&&(t=Math.max(t,Number(e[1])+1)),r.startsWith(`h`)&&(n=!0)}return{n:t,hat:n}}function lo(e,t,n){let{n:r,hat:i}=co(t),a=Ia.length,o=e.axes.findIndex(e=>Math.abs(e)>1.05),s=e=>e;if(i&&o<0)return n===`l`&&e.axes.length>=r+2?{hat:-1,hatXY:r,axis:s}:null;if(!(i?o>r:n!==`l`&&e.axes.length>=r+2))return{hat:o,hatXY:-1,axis:s};if(r<=4)return{hat:o,hatXY:-1,axis:e=>[0,1,2,5][e]??e};let c=t[a+2]?.replace(`~`,``)===`a2`&&t[a+3]?.replace(`~`,``)===`a3`,l=[t[6],t[7]].every(e=>/^a[45]~?$/.test(e??``));return r===6&&c&&l?{hat:o,hatXY:-1,axis:e=>[0,1,2,5,3,4][e]??e}:{hat:o,hatXY:-1,axis:s}}function uo(e,t){let n=/^b(\d+)$/.exec(e);if(n)return{b:Number(n[1])};if(n=/^([+-]?)a(\d+)(~?)$/.exec(e),n){let e=t.axis(Number(n[2]));return n[1]===`+`?{a:e,d:1}:n[1]===`-`?{a:e,d:-1}:n[3]?{a:e,d:-1,rest:1}:{a:e,d:1,rest:-1}}if(n=/^h0\.(\d)$/.exec(e),n){let e=so[n[1]];if(e===void 0)return null;if(t.hat>=0)return{h:t.hat,at:e};if(t.hatXY>=0)return e===0?{a:t.hatXY+1,d:-1}:e===4?{a:t.hatXY+1,d:1}:e===6?{a:t.hatXY,d:-1}:{a:t.hatXY,d:1}}return null}function fo(e,t){let n=/^a(\d+)(~?)$/.exec(e);if(n)return n[2]?{a:t.axis(Number(n[1])),inv:!0}:{a:t.axis(Number(n[1]))};if(e===`hx`||e===`hy`){if(t.hat>=0)return{a:t.hat,hat:e===`hx`?`x`:`y`};if(t.hatXY>=0)return{a:t.hatXY+ +(e===`hy`)}}return null}function po(e,t,n){let r=e.split(`,`),i=lo(t,r,n);if(!i)return null;let a={buttons:[],l2:null,r2:null,lx:null,ly:null,rx:null,ry:null};for(let e=0;e<Ia.length;e++){let t=r[e];if(!t)continue;let n=uo(t,i);n&&(e===6?a.l2=n:e===7?a.r2=n:Ia[e]&&a.buttons.push([Ia[e],n]))}let o=Ia.length;return a.lx=fo(r[o]??``,i),a.ly=fo(r[o+1]??``,i),a.rx=fo(r[o+2]??``,i),a.ry=fo(r[o+3]??``,i),a}var mo=new Map;function ho(e,t=no()){if(e.mapping===`standard`||!t)return null;let n=`${t}|${e.id}|${e.axes.length}`;if(mo.has(n))return mo.get(n)??null;let r=eo(e.id),i=r?ro(r,t):null;if(!i)return mo.set(n,null),null;let a=po(i,e,t);return a&&mo.set(n,a),a}var go=`ps5upload.rp_pad_profiles.v1`;function _o(e){return e===null||typeof e==`object`&&!Array.isArray(e)}function vo(e){if(!e||typeof e!=`object`)return!1;let t=e;return Array.isArray(t.buttons)&&t.buttons.every(e=>Array.isArray(e)&&e.length===2&&typeof e[0]==`number`&&_o(e[1]))&&[t.l2,t.r2,t.lx,t.ly,t.rx,t.ry].every(_o)}function yo(){try{let e=Lt(go),t=e?JSON.parse(e):null;return!t||typeof t!=`object`||Array.isArray(t)?{}:Object.fromEntries(Object.entries(t).filter(e=>vo(e[1])))}catch{return{}}}function bo(e,t){let n=yo();return t?n[e]=t:delete n[e],It(go,JSON.stringify(n)),xo=n,n}var xo=null;function So(e){return xo??=yo(),xo[e.id]??To(xo,e.id)??ho(e)??Ua(e)}function Co(e){return xo??=yo(),xo[e.id]?`saved`:e.mapping===`standard`?`standard`:ho(e)?`known`:`guess`}function wo(e){return ho(e)??Ua(e)}function To(e,t){if(!t.endsWith(` (app)`))return null;let n=t.slice(0,-6).trim().toLowerCase();if(!n)return null;let r=Object.keys(e).filter(e=>{let t=e.trim().toLowerCase();return t===n||t.includes(n)}),i=r.find(e=>e.trim().toLowerCase()===n)??(r.length===1?r[0]:null);return i?(xo=bo(t,e[i]),e[i]):null}function Eo(e){return{buttons:e.buttons.map(e=>Math.max(+!!e.pressed,e.value)),axes:[...e.axes]}}function Do(e,t){let n=null;if(t.buttons.forEach((t,r)=>{let i=t-(e.buttons[r]??0);t>.5&&i>.5&&(!n||i>n.amount)&&(n={src:{b:r},amount:i})}),n)return n.src;for(let n=0;n<t.axes.length;n++){let r=Math.abs(e.axes[n]??0)>1.05?La(t.axes[n]):null;if(r!==null)return{h:n,at:r}}return t.axes.forEach((t,r)=>{let i=e.axes[r]??0,a=t-i;if(!(Math.abs(a)<.6)&&(!n||Math.abs(a)>n.amount)){let e=a>0?1:-1;n={src:Math.abs(i)>.5?{a:r,d:e,rest:i}:{a:r,d:e},amount:Math.abs(a)}}}),n?n.src:null}function Oo(e,t){let n=null;if(t.axes.forEach((t,r)=>{let i=t-(e.axes[r]??0);Math.abs(i)>=.6&&(!n||Math.abs(i)>Math.abs(n.moved))&&(n={a:r,moved:i})}),!n)return null;let r=n;return r.moved>0?{a:r.a}:{a:r.a,inv:!0}}var ko=[{kind:`button`,bit:R.CROSS,name:`✕`},{kind:`button`,bit:R.CIRCLE,name:`○`},{kind:`button`,bit:R.SQUARE,name:`□`},{kind:`button`,bit:R.TRIANGLE,name:`△`},{kind:`button`,bit:R.UP,name:`↑`},{kind:`button`,bit:R.DOWN,name:`↓`},{kind:`button`,bit:R.LEFT,name:`←`},{kind:`button`,bit:R.RIGHT,name:`→`},{kind:`button`,bit:R.L1,name:`L1`},{kind:`button`,bit:R.R1,name:`R1`},{kind:`trigger`,which:`l2`,name:`L2`},{kind:`trigger`,which:`r2`,name:`R2`},{kind:`button`,bit:R.L3,name:`L3`},{kind:`button`,bit:R.R3,name:`R3`},{kind:`button`,bit:R.OPTIONS,name:`Options`},{kind:`button`,bit:R.SHARE,name:`Create`},{kind:`button`,bit:R.PS,name:`PS`},{kind:`button`,bit:R.TOUCHPAD,name:`Touchpad`},{kind:`axis`,which:`lx`,name:`L →`},{kind:`axis`,which:`ly`,name:`L ↓`},{kind:`axis`,which:`rx`,name:`R →`},{kind:`axis`,which:`ry`,name:`R ↓`}];function Ao(){return{buttons:[],l2:null,r2:null,lx:null,ly:null,rx:null,ry:null}}function jo(e,t,n){return t.kind===`button`?{...e,buttons:[...e.buttons.filter(([e])=>e!==t.bit),[t.bit,n]]}:(t.kind,{...e,[t.which]:n})}function Mo(e,t=Va){let n=new Set(e.buttons.map(([e])=>e)),r=e=>`b`in e?`b${e.b}`:`h`in e?`h${e.h}.${e.at}`:`a${e.a}${e.d}`,i=new Set([...e.buttons.map(([,e])=>r(e)),...[e.l2,e.r2].filter(e=>!!e).map(r)]);return{buttons:[...e.buttons,...t.buttons.filter(([e,t])=>!n.has(e)&&!i.has(r(t)))],l2:e.l2??t.l2,r2:e.r2??t.r2,lx:e.lx??t.lx,ly:e.ly??t.ly,rx:e.rx??t.rx,ry:e.ry??t.ry}}var No=ko.filter(e=>e.kind!==`button`||![R.L3,R.R3,R.OPTIONS,R.SHARE,R.PS,R.TOUCHPAD].includes(e.bit));function Po(e,t){return t.buttons.every((t,n)=>Math.abs(t-(e.buttons[n]??0))<.3)&&t.axes.every((t,n)=>Math.abs(t-(e.axes[n]??0))<.3)}var Fo=class{constructor(e=ko){this.steps=e,this.step=0,this.prof=Ao(),this.rest=null,this.waiting=!0}get done(){return this.step>=this.steps.length}get current(){return this.steps[this.step]??null}feed(e){if(this.done)return!1;if(!this.rest)return this.rest=e,this.waiting=!1,!1;if(this.waiting)return Po(this.rest,e)&&(this.waiting=!1),!1;let t=this.steps[this.step],n=t.kind===`axis`?Oo(this.rest,e):Do(this.rest,e);return n?(this.prof=jo(this.prof,t,n),this.go(this.step+1),!0):!1}skip(){this.go(this.step+1)}back(){this.step>0&&this.go(this.step-1)}go(e){this.waiting=!0,this.step=Math.min(e,this.steps.length)}profile(e=Va){return Mo(this.prof,e)}};function Io(e,t){return e.buttons===t.buttons&&e.l2===t.l2&&e.r2===t.r2&&e.lx===t.lx&&e.ly===t.ly&&e.rx===t.rx&&e.ry===t.ry&&(e.touch?.[0]??-1)===(t.touch?.[0]??-1)&&(e.touch?.[1]??-1)===(t.touch?.[1]??-1)&&(e.motion?.t??-1)===(t.motion?.t??-1)}function Lo(){try{return typeof sessionStorage<`u`?sessionStorage:null}catch{return null}}var Ro=e=>`ps5upload.join.token.${e??`app`}`,zo=class{constructor(e){this.o=e,this.ws=null,this.stage={kind:`connecting`},this.token=null,this.player=0,this.last={...ja},this.lastSent=0,this.neutral=!1,this.stopped=!1,this.attempt=0,this.deadline=0,this.raf=0,this.keepalive=null,this.pinger=null,this.retry=null,this.lastHeard=0,this.hostAway=!1,this.pings=0,this.now=e.now??(()=>Date.now()),this.storage=e.storage===void 0?Lo():e.storage,this.WS=e.WebSocketImpl??WebSocket,this.seq=this.now()>>>0;try{this.token=this.storage?.getItem(this.key)??null}catch{this.token=null}}get key(){return Ro(this.o.invite??this.o.code??null)}get current(){return this.stage}get socket(){return this.ws}get resumeToken(){return this.token}setStage(e){this.stage=e,this.o.onStage(e)}start(){if(this.stopped=!1,this.setStage({kind:`connecting`}),this.connect(),this.stopped)return;let e=()=>{this.sendPad(!1),this.raf=(this.o.raf??(e=>window.requestAnimationFrame(e)))(e)};this.raf=(this.o.raf??(e=>window.requestAnimationFrame(e)))(e),this.keepalive=setInterval(()=>this.sendPad(!1),100),this.pinger=setInterval(()=>this.ping(),1e3)}connect(){let e;try{e=new this.WS(this.o.url)}catch{this.dropped();return}this.ws=e,e.binaryType=`arraybuffer`,e.onopen=()=>{if(this.ws!==e)return;this.lastHeard=this.now();let t={name:this.o.name};this.o.invite&&(t.invite=this.o.invite),this.o.code&&(t.code=this.o.code),this.token&&(t.resume=this.token),e.send(JSON.stringify({hello:t}))},e.onmessage=t=>{this.ws===e&&(this.lastHeard=this.now(),typeof t.data==`string`?this.onText(t.data):t.data instanceof ArrayBuffer&&this.stage.kind===`joined`&&this.o.onFrame?.(t.data))},e.onclose=t=>{if(this.ws!==e)return;this.ws=null;let n=Ue(t);n===`mismatch`?(this.forgetToken(),this.finish({kind:`ended`,why:n})):n&&this.stage.kind!==`joined`&&this.stage.kind!==`reconnecting`?this.finish({kind:`ended`,why:n}):this.dropped()},e.onerror=()=>{}}onText(e){let t=Je(e);if(t)switch(t.kind){case`pong`:{let e=this.now()-t.t;e>=0&&e<6e4&&this.o.onRtt?.(e);return}case`asking`:this.stage.kind!==`reconnecting`&&this.setStage({kind:`asking`});return;case`waiting`:this.hostAway||(this.hostAway=!0,this.deadline=this.now()+et),this.attempt=0,this.setStage(this.reconnectingStage());return;case`joined`:this.token=t.token,this.player=t.player,this.attempt=0,this.hostAway=!1;try{this.storage?.setItem(this.key,t.token)}catch{}{let e=t.track&&this.ws?.media||null;this.o.onCodec?.(t.hevc,e,!!e&&t.audio&&!!e.audio)}this.setStage({kind:`joined`,player:t.player,hevc:t.hevc}),this.sendPad(!0);return;case`refused`:this.forgetToken(),this.hostAway&&t.why!==`seat_taken`?this.finish({kind:`ended`,why:`host_stopped`}):this.finish({kind:`refused`,why:t.why});return;case`bye`:if(t.why===`host_stopped`&&this.token){this.hostWait();return}this.forgetToken(),this.finish({kind:`ended`,why:t.why});return;case`status`:this.stage.kind===`joined`&&t.status.player>0&&t.status.player!==this.stage.player&&(this.player=t.status.player,this.setStage({...this.stage,player:t.status.player})),this.o.onStatus?.(t.status);return;case`feedback`:t.rumble&&this.o.onRumble?.(t.rumble[0],t.rumble[1]),t.light&&this.o.onLight?.(t.light);return}}hostWait(){this.hostAway=!0,this.deadline=this.now()+et,this.attempt=0;let e=this.ws;this.ws=null;try{e?.close()}catch{}this.scheduleRetry()}reconnectingStage(){return{kind:`reconnecting`,player:this.player,attempt:this.attempt,deadline:this.deadline,...this.hostAway?{hostStopped:!0}:{}}}giveUp(){this.forgetToken(),this.finish({kind:`ended`,why:this.hostAway?`host_stopped`:`gave_up`})}dropped(){if(this.stopped)return;let e=this.stage;e.kind===`joined`||e.kind===`reconnecting`&&this.token?(e.kind===`joined`&&(this.deadline=this.now()+$e),this.scheduleRetry()):this.finish({kind:`ended`,why:`lost`})}scheduleRetry(){if(this.stopped)return;if(this.now()>=this.deadline){this.giveUp();return}let e=Qe(this.attempt);this.setStage(this.reconnectingStage()),this.attempt+=1,this.retry&&clearTimeout(this.retry),this.retry=setTimeout(()=>{this.retry=null,this.stopped||(this.now()>=this.deadline?this.giveUp():this.connect())},e)}forgetToken(){this.token=null;try{this.storage?.removeItem(this.key)}catch{}}ping(){if(this.hostAway&&!this.stopped&&this.now()>=this.deadline+5e3||!this.stopped&&this.stage.kind===`reconnecting`&&this.now()>=this.deadline+5e3){this.giveUp();return}let e=this.ws;if(e&&e.readyState===this.WS.OPEN){if(this.stage.kind===`joined`&&this.now()-this.lastHeard>3500){this.ws=null;try{e.close()}catch{}this.dropped()}else if(e.send(JSON.stringify({ping:this.now()})),this.stage.kind===`joined`&&this.o.readStats&&++this.pings%2==0){let t=this.o.readStats();t&&e.send(JSON.stringify({stats:t}))}}}setNeutral(e){this.neutral!==e&&(this.neutral=e,this.sendPad(!0))}sendPad(e){let t=this.ws;if(!t||t.readyState!==this.WS.OPEN||this.stage.kind!==`joined`)return;let n=this.neutral?{...ja,touch:null,motion:null}:this.o.readPad(),r=this.now();!e&&Io(n,this.last)&&r-this.lastSent<100||(this.last=n,this.lastSent=r,this.seq=this.seq+1>>>0,t.send(Ze(this.seq,n)))}clearTimers(){(this.o.cancelRaf??(e=>window.cancelAnimationFrame(e)))(this.raf),this.keepalive&&clearInterval(this.keepalive),this.pinger&&clearInterval(this.pinger),this.retry&&clearTimeout(this.retry),this.keepalive=this.pinger=this.retry=null}finish(e){this.stopped=!0,this.clearTimers();let t=this.ws;this.ws=null;try{t?.close()}catch{}this.setStage(e)}askKeyframe(){let e=this.ws;e&&e.readyState===this.WS.OPEN&&this.stage.kind===`joined`&&e.send(JSON.stringify({keyframe:!0}))}leave(){let e=this.ws;e&&e.readyState===this.WS.OPEN&&(this.stage.kind===`joined`&&(this.seq=this.seq+1>>>0,e.send(Ze(this.seq,ja))),e.send(JSON.stringify({leave:1}))),this.forgetToken(),this.finish({kind:`ended`,why:`left`})}stop(){let e=this.ws;e&&e.readyState===this.WS.OPEN&&this.stage.kind===`joined`&&(this.seq=this.seq+1>>>0,e.send(Ze(this.seq,ja))),this.stopped=!0,this.clearTimers(),this.ws=null;try{e?.close()}catch{}}},Bo=s((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),z=s(((e,t)=>{t.exports=Bo()}))(),Vo=`ps5upload.openIn`,Ho=`ps5upload.openIn.tab`;function Uo(){try{return sessionStorage.getItem(Ho)===`browser`}catch{return!1}}function B(){try{sessionStorage.setItem(Ho,`browser`)}catch{}}function V(e){return e===`browser`?`browser`:e===`app`?`opening`:`ask`}function Wo({appLink:e,children:t}){let n=Ie(),[r,i]=(0,D.useState)(()=>Uo()?`browser`:V(Lt(Vo))),[a,o]=(0,D.useState)(!1);if((0,D.useEffect)(()=>{r===`opening`&&Lt(`ps5upload.openIn`)===`app`&&(location.href=e)},[]),r===`browser`)return(0,z.jsx)(z.Fragment,{children:t});let s=()=>{a&&It(Vo,`app`),i(`opening`),location.href=e},c=()=>{r===`ask`&&a?It(Vo,`browser`):r===`opening`&&Lt(`ps5upload.openIn`)===`app`&&Rt(Vo),B(),i(`browser`)};return(0,z.jsx)(`div`,{className:`flex min-h-[100dvh] items-center justify-center bg-black px-6 text-white`,"data-testid":`open-in-gate`,"data-join-ui":``,children:(0,z.jsx)(`div`,{className:`w-full max-w-sm space-y-4 rounded-2xl border border-white/10 bg-neutral-900 p-6`,children:r===`ask`?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`div`,{className:`space-y-1`,children:[(0,z.jsx)(`h1`,{className:`text-lg font-semibold`,children:n(`open_in_title`,void 0,`Open in the PS5Upload app?`)}),(0,z.jsx)(`p`,{className:`text-sm text-white/60`,children:n(`open_in_body`,void 0,`Have the PS5Upload app on this device? Open this there, or carry on in the browser.`)})]}),(0,z.jsx)(`button`,{type:`button`,onClick:s,autoFocus:!0,className:`w-full rounded-full bg-white py-2.5 text-sm font-semibold text-black`,"data-testid":`open-in-app`,children:n(`open_in_app`,void 0,`Open in the app`)}),(0,z.jsx)(`button`,{type:`button`,onClick:c,className:`w-full rounded-full border border-white/20 py-2.5 text-sm font-semibold text-white hover:bg-white/10`,"data-testid":`open-in-browser`,children:n(`open_in_browser`,void 0,`Continue in browser`)}),(0,z.jsxs)(`label`,{className:`flex items-center justify-center gap-2 text-xs text-white/60`,children:[(0,z.jsx)(`input`,{type:`checkbox`,checked:a,onChange:e=>o(e.target.checked),"data-testid":`open-in-remember`}),n(`open_in_remember`,void 0,`Remember my choice on this device`)]})]}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`div`,{className:`space-y-1`,children:[(0,z.jsx)(`h1`,{className:`text-lg font-semibold`,children:n(`open_in_opening`,void 0,`Opening the PS5Upload app…`)}),(0,z.jsx)(`p`,{className:`text-sm text-white/60`,children:n(`open_in_not_opened`,void 0,`Nothing happened? The app may not be on this device.`)})]}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>location.href=e,autoFocus:!0,className:`w-full rounded-full bg-white py-2.5 text-sm font-semibold text-black`,"data-testid":`open-in-again`,children:n(`open_in_again`,void 0,`Try again`)}),(0,z.jsx)(`button`,{type:`button`,onClick:c,className:`w-full rounded-full border border-white/20 py-2.5 text-sm font-semibold text-white hover:bg-white/10`,"data-testid":`open-in-browser`,children:n(`open_in_browser`,void 0,`Continue in browser`)})]})})})}var Go=[`a[href]`,`button:not([disabled])`,`input:not([disabled]):not([type='hidden'])`,`select:not([disabled])`,`textarea:not([disabled])`,`summary`,`[contenteditable='true']`,`[tabindex]`].map(e=>`${e}:not([tabindex='-1'])`).join(`, `),Ko=new Set,qo=[];function Jo(){for(let e of Ko)e()}function Yo(){return qo.length}function Xo(e){return qo.push(e),Jo(),()=>{let t=qo.lastIndexOf(e);t!==-1&&qo.splice(t,1),Jo()}}function Zo(e,t,n){switch(n){case`down`:return t.top-e.bottom;case`up`:return e.top-t.bottom;case`right`:return t.left-e.right;case`left`:return e.left-t.right}}function H(e,t,n){let r=(e.left+e.right)/2,i=(e.top+e.bottom)/2,a=(t.left+t.right)/2,o=(t.top+t.bottom)/2;switch(n){case`down`:return o>i&&t.top>=e.top+1;case`up`:return o<i&&t.bottom<=e.bottom-1;case`right`:return a>r&&t.left>=e.left+1;case`left`:return a<r&&t.right<=e.right-1}}function Qo(e,t,n){let r=n===`up`||n===`down`,i=r?e.left:e.top,a=r?e.right:e.bottom,o=r?t.left:t.top,s=r?t.right:t.bottom,c=Math.min(a,s)-Math.max(i,o);return c>0?{gap:0,overlap:c}:{gap:-c,overlap:0}}function $o(e,t,n){let r=null,i=1/0,a=!1;for(let o of t){if(!H(e,o.rect,n))continue;let t=Math.max(0,Zo(e,o.rect,n)),s=Qo(e,o.rect,n),c=s.overlap>0;if(a&&!c)continue;let l=c?t-s.overlap/1e6:Math.hypot(t,2*s.gap);(c&&!a||l<i)&&(r=o.el,i=l,a=c)}return r}var es={ArrowUp:`up`,ArrowDown:`down`,ArrowLeft:`left`,ArrowRight:`right`},ts=/^(text|search|email|url|tel|password|number|date|time|datetime-local|month|week)$/;function ns(e=typeof window>`u`?void 0:window){try{return!!e?.PS5UploadTv?.isTv()}catch{return!1}}function rs(e=typeof document>`u`?void 0:document){return e?.documentElement.dataset.tv===`1`}function is(e,t){if(!e)return!1;if(e.closest(`[data-own-arrows]`))return!0;let n=e.tagName;if(n===`TEXTAREA`||e.isContentEditable)return!0;let r=t===`left`||t===`right`;if(n===`INPUT`){let t=(e.type||`text`).toLowerCase();if(t===`range`||ts.test(t))return r}return!1}var as=`[aria-modal="true"], [role="dialog"], [role="alertdialog"]`;function os(e){let t=e.activeElement?.closest(as);if(t)return t;if(Yo()>0){let t=e.querySelectorAll(as);if(t.length)return t[t.length-1]}return e}function ss(e){let t=[];return e.querySelectorAll(Go).forEach(e=>{if(e.closest(`[inert], [aria-hidden='true']`)||e.disabled)return;let n=e.getBoundingClientRect();n.width<=0||n.height<=0||t.push({el:e,rect:n})}),t}function cs(e){return(e.find(e=>e.el.getAttribute(`aria-current`)===`page`)??e[0])?.el??null}function ls(e,t=document){let n=es[e.key];if(!n||e.defaultPrevented||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)return!1;let r=t.activeElement;if(is(r,n))return!1;let i=ss(os(t));if(!i.length)return!1;let a=i.find(e=>e.el===r),o=a?$o(a.rect,i.filter(e=>e!==a),n):cs(i);return o?(e.preventDefault(),o.focus(),typeof o.scrollIntoView==`function`&&o.scrollIntoView({block:`nearest`,inline:`nearest`}),!0):!1}var us=!1;function ds(e){us||(us=!0,e.addEventListener(`keydown`,t=>void ls(t,e.document)))}function fs(e=typeof window>`u`?void 0:window){e&&(ns(e)&&(e.document.documentElement.dataset.tv=`1`),ds(e))}function ps({id:e,className:t}){let n=Ie(),r=oo(e);if(r===`none`)return(0,z.jsx)(`span`,{className:t,"data-testid":`pad-8bitdo-hint`,"data-how":r,children:n(`pad_8bitdo_no_xinput`,void 0,`This 8BitDo has no X-input mode. If a button is wrong, check the controller.`)});let i=r===`switch`?n(`pad_8bitdo_how_switch`,void 0,`set the switch on the back to X, then press Start`):r===`startx`?n(`pad_8bitdo_how_startx`,void 0,`turn it off, then hold Start + X to turn it on`):r===`receiver`?n(`pad_8bitdo_how_receiver`,void 0,`use its 2.4G receiver or a USB cable`):n(`pad_8bitdo_how_manual`,void 0,`its manual says how`);return(0,z.jsx)(`span`,{className:t,"data-testid":`pad-8bitdo-hint`,"data-how":r,children:n(`pad_8bitdo_xinput`,{how:i},`For the best result, switch your 8BitDo to X-input mode: ${i}.`)})}var ms=new Set,hs={held:new Set,touch:null,touchPad:ja,mapping:!1,get paused(){return ms.size>0},motion:null},gs={s:.85,m:1,l:1.15},_s=.25;function vs(e){return typeof e!=`number`||!Number.isFinite(e)?1:Math.min(1,Math.max(_s,e))}var ys={overlay:{width:844,height:390},deck:{width:390,height:480}},bs=.7,xs=1.4;function Ss(e,t,n,r){let i=gs[e]??1;if(!(t>0)||!(n>0))return i;let a=r?ys.deck:ys.overlay,o=Math.min(xs,Math.max(bs,Math.min(t/a.width,n/a.height)));return Math.round(o*i*1e3)/1e3}var Cs=34;function ws(e,t){return t>0&&8+Math.max(112*e,90)+156*e+124*e+Math.max(56*e,44)+Cs>t}function Ts(e,t,n){let r=e/32767,i=t/32767,a=Math.hypot(r,i),o=a>1?1/a:1;return{dx:r*o*n,dy:i*o*n}}var Es=`calc(50% + (env(safe-area-inset-left) - env(safe-area-inset-right)) / 2)`,Ds=32767,Os=12;function ks({stream:e,layout:t=`overlay`,opacity:n=1,size:r=`m`,deckTop:i=`0px`,onMenu:a}){let o=Ie(),s=(0,D.useRef)(new Map),c=(0,D.useRef)({...ja}),[l,u]=(0,D.useState)({...ja}),[d,f]=(0,D.useState)({l:!1,r:!1,touchpad:!1}),p=(0,D.useRef)(null),[m,h]=(0,D.useState)({width:0,height:0});(0,D.useEffect)(()=>{let e=p.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect();h(e=>e.width===t.width&&e.height===t.height?e:{width:t.width,height:t.height})};if(t(),typeof ResizeObserver>`u`)return window.addEventListener(`resize`,t),()=>window.removeEventListener(`resize`,t);let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]),(0,D.useEffect)(()=>()=>{hs.touchPad={...ja}},[]);let g=()=>{let t={...ja,touch:null},n={l:!1,r:!1,touchpad:!1};for(let e of s.current.values())e.kind===`stick`&&(n[e.which]=!0),e.kind===`touchpad`&&(n.touchpad=!0),e.kind===`button`&&(t.buttons|=e.bit),e.kind===`trigger`&&(t[e.which]=255),e.kind===`touchpad`&&e.pressed&&(t.buttons|=R.TOUCHPAD);t.lx=c.current.lx,t.ly=c.current.ly,t.rx=c.current.rx,t.ry=c.current.ry,t.touch=c.current.touch??null,hs.touchPad=t,e?.sendPad(),u(t),f(e=>e.l===n.l&&e.r===n.r&&e.touchpad===n.touchpad?e:n)},_=(e,t,n)=>{let r=Math.max(-1,Math.min(1,(t-e.cx)/e.radius)),i=Math.max(-1,Math.min(1,(n-e.cy)/e.radius));c.current[e.which===`l`?`lx`:`rx`]=Math.round(r*Ds),c.current[e.which===`l`?`ly`:`ry`]=Math.round(i*Ds)},v=(e,t)=>{e.preventDefault(),e.stopPropagation();let n=e.currentTarget;try{n.setPointerCapture(e.pointerId)}catch{}let r=t(n);s.current.set(e.pointerId,r),r.kind===`stick`&&_(r,e.clientX,e.clientY),r.kind===`touchpad`&&(c.current.touch=Ma((e.clientX-r.rect.left)/r.rect.width,(e.clientY-r.rect.top)/r.rect.height)),navigator.vibrate?.(8),g()},y=e=>{let t=s.current.get(e.pointerId);if(t){if(e.stopPropagation(),t.kind===`stick`)_(t,e.clientX,e.clientY);else if(t.kind===`touchpad`)c.current.touch=Ma((e.clientX-t.rect.left)/t.rect.width,(e.clientY-t.rect.top)/t.rect.height),t.pressed&&Math.hypot(e.clientX-t.x0,e.clientY-t.y0)>Os&&(t.pressed=!1);else return;g()}},b=e=>{let t=s.current.get(e.pointerId);t&&(e.stopPropagation(),s.current.delete(e.pointerId),t.kind===`stick`&&(c.current[t.which===`l`?`lx`:`rx`]=0,c.current[t.which===`l`?`ly`:`ry`]=0),t.kind===`touchpad`&&(c.current.touch=null),g())},x=e=>e.stopPropagation(),S={onPointerMove:y,onPointerUp:b,onPointerCancel:b,onClick:x,onDoubleClick:x},ee=e=>(l.buttons&e)!==0,C=e=>`border-[1.5px] shadow-[0_0_3px_rgba(0,0,0,0.35)] transition-colors duration-75 ${e?`border-white bg-white/50`:`border-white/70 bg-white/10`}`,w=`text-white [text-shadow:0_1px_2px_rgba(0,0,0,0.6)]`,T={filter:`drop-shadow(0 0 1.5px rgba(0,0,0,0.5))`},E=e=>({stroke:e?`#fff`:`rgba(255,255,255,0.75)`,fill:e?`rgba(255,255,255,0.5)`:`rgba(255,255,255,0.1)`}),te=`pointer-events-auto flex touch-none select-none items-center justify-center bg-transparent p-0`,ne={minHeight:`calc(44px / var(--k))`,minWidth:`calc(44px / var(--k))`},re=(e,t,n,r)=>(0,z.jsx)(`button`,{type:`button`,"aria-label":e,onPointerDown:e=>v(e,()=>({kind:`button`,bit:t})),...S,className:`${te} ${n}`,style:ne,children:r}),ie=(e,t,n,r)=>(0,z.jsx)(`span`,{className:`flex h-[32px] w-[76px] items-center justify-center text-[13px] font-semibold tracking-wide ${w} ${C(t)}`,style:{borderRadius:r?n===`l`?`16px 9px 9px 9px`:`9px 16px 9px 9px`:`9px`},children:e}),ae=(e,t,n,r)=>re(e,t,`h-[44px] w-[84px]`,ie(e,ee(t),n,r)),oe=(e,t,n)=>(0,z.jsx)(`button`,{type:`button`,"aria-label":e,onPointerDown:e=>v(e,()=>({kind:`trigger`,which:t})),...S,className:`${te} h-[44px] w-[84px]`,style:ne,children:ie(e,l[t]>0,n,!0)}),se=(e,t,n)=>re(e,t,`h-[52px] w-[52px]`,(0,z.jsx)(`svg`,{viewBox:`0 0 52 52`,width:`52`,height:`52`,"aria-hidden":!0,style:T,children:(0,z.jsxs)(`g`,{transform:`rotate(${n} 26 26)`,strokeWidth:`1.5`,strokeLinejoin:`round`,...E(ee(t)),children:[(0,z.jsx)(`path`,{d:`M10 9 Q10 3 16 3 L36 3 Q42 3 42 9 L42 30 Q42 34.5 38.5 38 L29.5 47 Q26 50.5 22.5 47 L13.5 38 Q10 34.5 10 30 Z`}),(0,z.jsx)(`path`,{d:`M20.5 23 L26 17 L31.5 23`,fill:`none`,stroke:`#fff`,strokeLinecap:`round`,strokeWidth:`1.8`})]})})),ce=(e,t,n)=>re(e,t,`h-[52px] w-[52px]`,(0,z.jsxs)(`svg`,{viewBox:`0 0 52 52`,width:`52`,height:`52`,"aria-hidden":!0,style:T,children:[(0,z.jsx)(`circle`,{cx:`26`,cy:`26`,r:`22.5`,strokeWidth:`1.5`,...E(ee(t))}),(0,z.jsx)(`g`,{fill:`none`,stroke:`#fff`,strokeWidth:`1.8`,strokeLinejoin:`round`,strokeLinecap:`round`,children:n})]})),le=(e,t)=>re(e,t,`h-[44px] min-w-[64px] px-[4px]`,(0,z.jsx)(`span`,{className:`flex h-[24px] items-center rounded-full px-[10px] text-[10px] font-semibold uppercase tracking-wider ${w} ${C(ee(t))}`,children:e})),ue=(e,t)=>re(e,t,`h-[44px] w-[44px]`,(0,z.jsx)(`span`,{className:`flex h-[36px] w-[36px] items-center justify-center rounded-full text-[11px] font-bold ${w} ${C(ee(t))}`,children:e})),de=e=>{let{dx:t,dy:n}=Ts(e===`l`?l.lx:l.rx,e===`l`?l.ly:l.ry,34),r=d[e];return(0,z.jsx)(`div`,{"aria-label":e===`l`?o(`rp_touch_left_stick`,void 0,`Left stick`):o(`rp_touch_right_stick`,void 0,`Right stick`),onPointerDown:t=>v(t,t=>{let n=t.getBoundingClientRect();return{kind:`stick`,which:e,cx:n.left+n.width/2,cy:n.top+n.height/2,radius:n.width/2}}),...S,className:`pointer-events-auto relative h-[124px] w-[124px] touch-none rounded-full border-[1.5px] shadow-[0_0_3px_rgba(0,0,0,0.3)] transition-colors duration-75 ${r?`border-white/80 bg-white/[0.12]`:`border-white/45 bg-white/[0.05]`}`,children:(0,z.jsx)(`div`,{className:`absolute left-1/2 top-1/2 h-[54px] w-[54px] rounded-full ${C(r)}`,style:{transform:`translate(calc(-50% + ${t}px), calc(-50% + ${n}px))`}})})},O=t===`deck`,fe=Ss(r,m.width,m.height,O),pe=e=>`${e}px * var(--k)`,k=`max(12px, env(safe-area-inset-left))`,me=`max(12px, env(safe-area-inset-right))`,he=`max(12px, env(safe-area-inset-bottom))`,ge=O?`8px`:t===`overlay-bar`?`3.5rem`:`max(10px, env(safe-area-inset-top))`,_e=(e,t,n=0)=>t?n?`calc(${e} + max(${pe(t)}, ${n}px))`:`calc(${e} + ${pe(t)})`:e,ye=(e,t)=>({position:`absolute`,...t,transform:`scale(var(--k))`,transformOrigin:e}),be=O&&ws(fe,m.height),A=O?void 0:`58%`,j=e=>O?{top:_e(ge,be?96:112,be?72:90),[e]:e===`left`?k:me}:{top:A,translate:`0 -50%`,[e]:e===`left`?k:me},xe=e=>({bottom:be?he:_e(he,O?56:0,44),[e]:be?`calc(${e===`left`?k:me} + 8px + max(${pe(80)}, 44px))`:_e(e===`left`?k:me,O?40:168)}),Se=!!a&&!O;return(0,z.jsxs)(`div`,{ref:p,className:`pointer-events-none absolute z-10 select-none [-webkit-touch-callout:none] ${O?`inset-x-0 bottom-0`:`inset-0`}`,style:{top:O?i:void 0,"--k":fe},"data-testid":`rp-touch`,"data-layout":t,"data-scale":fe,onContextMenu:e=>e.preventDefault(),children:[(0,z.jsxs)(`div`,{className:`absolute inset-0`,style:{opacity:vs(n)},children:[(0,z.jsx)(`div`,{style:ye(`top left`,{top:ge,left:k}),children:(0,z.jsxs)(`div`,{className:`ms-[8px] flex flex-col`,style:{rotate:O?void 0:`6deg`,transformOrigin:`top left`},children:[oe(`L2`,`l2`,`l`),ae(`L1`,R.L1,`l`,!1)]})}),(0,z.jsx)(`div`,{style:ye(`top right`,{top:ge,right:me}),children:(0,z.jsxs)(`div`,{className:`me-[8px] flex flex-col items-end`,style:{rotate:O?void 0:`-6deg`,transformOrigin:`top right`},children:[oe(`R2`,`r2`,`r`),ae(`R1`,R.R1,`r`,!1)]})}),(0,z.jsx)(`div`,{"aria-label":o(`rp_touch_touchpad`,void 0,`Touchpad`),onPointerDown:e=>v(e,t=>({kind:`touchpad`,rect:t.getBoundingClientRect(),x0:e.clientX,y0:e.clientY,pressed:!0})),...S,className:`pointer-events-auto absolute touch-none rounded-2xl border-[1.5px] shadow-[0_0_3px_rgba(0,0,0,0.3)] transition-colors duration-75 ${d.touchpad?`border-white/80 bg-white/25`:`border-white/40 bg-white/[0.05]`}`,style:O?{top:_e(ge,6),left:_e(k,104),right:_e(me,104),height:`max(44px, calc(${pe(64)}))`}:{top:ge,left:`50%`,translate:`-50% 0`,width:`min(calc(${pe(250)}), 34vw)`,height:`max(44px, calc(${pe(56)}))`}}),(0,z.jsxs)(`div`,{className:`grid grid-cols-3 grid-rows-3`,style:ye(O?`top left`:`left center`,j(`left`)),children:[(0,z.jsx)(`span`,{}),se(`↑`,R.UP,0),(0,z.jsx)(`span`,{}),se(`←`,R.LEFT,-90),(0,z.jsx)(`span`,{}),se(`→`,R.RIGHT,90),(0,z.jsx)(`span`,{}),se(`↓`,R.DOWN,180),(0,z.jsx)(`span`,{})]}),(0,z.jsxs)(`div`,{className:`grid grid-cols-3 grid-rows-3`,style:ye(O?`top right`:`right center`,j(`right`)),children:[(0,z.jsx)(`span`,{}),ce(`△`,R.TRIANGLE,(0,z.jsx)(`path`,{d:`M26 16.5 L35 32 L17 32 Z`})),(0,z.jsx)(`span`,{}),ce(`□`,R.SQUARE,(0,z.jsx)(`rect`,{x:`18`,y:`18`,width:`16`,height:`16`,rx:`1`})),(0,z.jsx)(`span`,{}),ce(`○`,R.CIRCLE,(0,z.jsx)(`circle`,{cx:`26`,cy:`26`,r:`8.5`})),(0,z.jsx)(`span`,{}),ce(`✕`,R.CROSS,(0,z.jsx)(`path`,{d:`M19 19 L33 33 M33 19 L19 33`})),(0,z.jsx)(`span`,{})]}),(0,z.jsx)(`div`,{style:ye(`bottom left`,xe(`left`)),children:de(`l`)}),(0,z.jsx)(`div`,{style:ye(`bottom right`,xe(`right`)),children:de(`r`)}),(0,z.jsx)(`div`,{style:ye(`bottom left`,{bottom:he,left:k}),children:le(`Create`,R.SHARE)}),(0,z.jsx)(`div`,{style:ye(`bottom right`,{bottom:he,right:me}),children:le(`Options`,R.OPTIONS)}),(0,z.jsx)(`div`,{style:ye(`bottom center`,{bottom:be?_e(he,124,88):_e(he,Se?48:0,48),left:Es,translate:`-50% 0`}),children:ue(`PS`,R.PS)})]}),Se&&(0,z.jsx)(`div`,{style:{...ye(`bottom center`,{bottom:he,left:`calc(50% + (env(safe-area-inset-left) - env(safe-area-inset-right)) / 2)`,translate:`-50% 0`}),opacity:Math.max(.7,vs(n))},children:(0,z.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),a?.()},onDoubleClick:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),"aria-label":o(`rp_menu`,void 0,`Menu`),"aria-haspopup":`dialog`,className:`${te} h-[44px] w-[56px]`,style:ne,"data-testid":`rp-menu-handle`,children:(0,z.jsx)(`span`,{className:`flex h-[26px] w-[44px] items-center justify-center rounded-full ${w} ${C(!1)}`,children:(0,z.jsx)(ve,{size:15,strokeWidth:2,"aria-hidden":!0})})})})]})}var As=`data:video/mp4;base64,AAAAIGZ0eXBpc29tAAACAGlzb21pc28yYXZjMW1wNDEAAAYZbW9vdgAAAGxtdmhkAAAAAAAAAAAAAAAAAAAfQAAAfQAAAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAmt0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAABAAAAAAAAfQAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAABAAAAAQAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAH0AAAAAAAABAAAAAAHjbWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAABAAAABAABVxAAAAAAALWhkbHIAAAAAAAAAAHZpZGUAAAAAAAAAAAAAAABWaWRlb0hhbmRsZXIAAAABjm1pbmYAAAAUdm1oZAAAAAEAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAU5zdGJsAAAAunN0c2QAAAAAAAAAAQAAAKphdmMxAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAABAAEABIAAAASAAAAAAAAAABFExhdmM2My4xLjEwMiBsaWJ4MjY0AAAAAAAAAAAAAAAAGP//AAAAMGF2Y0MBQsAK/+EAF2dCwAqmEXsBEAAAAwAQAAADACDxImEYAQAGaMhCAZSyAAAAEHBhc3AAAAABAAAAAQAAABRidHJ0AAAAAAAABUAAAAAAAAAAGHN0dHMAAAAAAAAAAQAAAAQAAEAAAAAAFHN0c3MAAAAAAAAAAQAAAAEAAAAcc3RzYwAAAAAAAAABAAAAAQAAAAEAAAABAAAAJHN0c3oAAAAAAAAAAAAAAAQAAAKCAAAACgAAAAoAAAAKAAAAIHN0Y28AAAAAAAAABAAABlwAAAj+AAAJKAAACVIAAALZdHJhawAAAFx0a2hkAAAAAwAAAAAAAAAAAAAAAgAAAAAAAH0AAAAAAAAAAAAAAAABAQAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAJGVkdHMAAAAcZWxzdAAAAAAAAAABAAB9AAAABAAAAQAAAAACUW1kaWEAAAAgbWRoZAAAAAAAAAAAAAAAAAAAH0AAAIEAVcQAAAAAAC1oZGxyAAAAAAAAAABzb3VuAAAAAAAAAAAAAAAAU291bmRIYW5kbGVyAAAAAfxtaW5mAAAAEHNtaGQAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAcBzdGJsAAAAfnN0c2QAAAAAAAAAAQAAAG5tcDRhAAAAAAAAAAEAAAAAAAAAAAABABAAAAAAH0AAAAAAADZlc2RzAAAAAAOAgIAlAAIABICAgBdAFQAAAAAAH0AAAAEcBYCAgAUViFblAAaAgIABAgAAABRidHJ0AAAAAAAAH0AAAAEcAAAAIHN0dHMAAAAAAAAAAgAAACAAAAQAAAAAAQAAAQAAAAAoc3RzYwAAAAAAAAACAAAAAQAAAAEAAAABAAAAAgAAAAgAAAABAAAAmHN0c3oAAAAAAAAAAAAAACEAAAATAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAkc3RjbwAAAAAAAAAFAAAGSQAACN4AAAkIAAAJMgAACVwAAAAac2dwZAEAAAByb2xsAAAAAgAAAAH//wAAABxzYmdwAAAAAHJvbGwAAAABAAAAIQAAAAEAAABhdWR0YQAAAFltZXRhAAAAAAAAACFoZGxyAAAAAAAAAABtZGlyYXBwbAAAAAAAAAAAAAAAACxpbHN0AAAAJKl0b28AAAAcZGF0YQAAAAEAAAAATGF2ZjYzLjEuMTAyAAAACGZyZWUAAAM7bWRhdNwATGF2YzYzLjEuMTAyAAIwQA4AAAJvBgX//2vcRem95tlIt5Ys2CDZI+7veDI2NCAtIGNvcmUgMTY1IHIzMjIyIGIzNTYwNWEgLSBILjI2NC9NUEVHLTQgQVZDIGNvZGVjIC0gQ29weWxlZnQgMjAwMy0yMDI1IC0gaHR0cDovL3d3dy52aWRlb2xhbi5vcmcveDI2NC5odG1sIC0gb3B0aW9uczogY2FiYWM9MCByZWY9MTYgZGVibG9jaz0xOjA6MCBhbmFseXNlPTB4MToweDEzMSBtZT11bWggc3VibWU9MTAgcHN5PTEgcHN5X3JkPTEuMDA6MC4wMCBtaXhlZF9yZWY9MSBtZV9yYW5nZT0yNCBjaHJvbWFfbWU9MSB0cmVsbGlzPTIgOHg4ZGN0PTAgY3FtPTAgZGVhZHpvbmU9MjEsMTEgZmFzdF9wc2tpcD0xIGNocm9tYV9xcF9vZmZzZXQ9LTIgdGhyZWFkcz0xIGxvb2thaGVhZF90aHJlYWRzPTEgc2xpY2VkX3RocmVhZHM9MCBucj0wIGRlY2ltYXRlPTEgaW50ZXJsYWNlZD0wIGJsdXJheV9jb21wYXQ9MCBjb25zdHJhaW5lZF9pbnRyYT0wIGJmcmFtZXM9MCB3ZWlnaHRwPTAga2V5aW50PTQga2V5aW50X21pbj0xIHNjZW5lY3V0PTQwIGludHJhX3JlZnJlc2g9MCByY19sb29rYWhlYWQ9NCByYz1jcmYgbWJ0cmVlPTEgY3JmPTUxLjAgcWNvbXA9MC42MCBxcG1pbj0wIHFwbWF4PTY5IHFwc3RlcD00IGlwX3JhdGlvPTEuNDAgYXE9MToxLjAwAIAAAAALZYiCAv5MUAAQv8ABGCAHARggBwEYIAcBGCAHARggBwEYIAcBGCAHARggBwAAAAZBmhwF/UABGCAHARggBwEYIAcBGCAHARggBwEYIAcBGCAHARggBwAAAAZBmioBb1ABGCAHARggBwEYIAcBGCAHARggBwEYIAcBGCAHARggBwAAAAZBmjsBX1ABGCAHARggBwEYIAcBGCAHARggBwEYIAcBGCAHARggBw==`,js=null,Ms=null;function Ns(e){e.play().catch(()=>{if(Ms||js!==e)return;let t=()=>{Ps(),js===e&&e.play().catch(()=>{})};window.addEventListener(`pointerdown`,t,{capture:!0}),Ms=()=>window.removeEventListener(`pointerdown`,t,{capture:!0})})}function Ps(){Ms?.(),Ms=null}function Fs(){if(typeof document<`u`){if(!js){let e=document.createElement(`video`);e.muted=!0,e.loop=!0,e.playsInline=!0,e.setAttribute(`playsinline`,``),e.setAttribute(`aria-hidden`,`true`),e.setAttribute(`data-testid`,`keep-screen-video`),e.style.cssText=`position:fixed;left:0;top:0;width:1px;height:1px;opacity:0;pointer-events:none`,e.src=As,document.body.appendChild(e),js=e}Ns(js)}}function Is(){Ps(),js&&=(js.pause(),js.removeAttribute(`src`),js.remove(),null)}function Ls(){return typeof navigator>`u`?null:navigator.wakeLock??null}function Rs(){return dt()||!Pn()}var zs=new Set,Bs=null,Vs=Promise.resolve(),Hs=!1;async function Us(){if(zs.size===0||Bs&&!Bs.released)return;let e=Ls();if(!e)dt()&&Fs();else try{let t=await e.request(`screen`);t.addEventListener(`release`,()=>{Bs===t&&(Bs=null)}),Bs=t}catch{}}async function Ws(){Is();let e=Bs;if(Bs=null,e&&!e.released)try{await e.release()}catch{}}function Gs(){Hs||typeof document>`u`||(Hs=!0,document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`visible`&&zs.size>0&&(Vs=Vs.then(Us))}))}function Ks(e,t){if(!Rs())return;Gs();let n=zs.size>0;t?zs.add(e):zs.delete(e);let r=zs.size>0;n!==r&&(Vs=Vs.then(r?Us:Ws))}var qs=new Set;function Js(){if(typeof window<`u`)return window.PS5UploadPad}function Ys(e,t){let n=qs.size>0;t?qs.add(e):qs.delete(e);let r=qs.size>0;if(n!==r)try{Js()?.setActive(r)}catch{}}var Xs=class e{constructor(e){this.receiver=e,this.last=null,this.was={}}get frames(){return Number(this.last?.frames??0)}static report(e,t){let n=t=>e[t]??0,r=e=>n(e)-(t[e]??0),i=(e,t)=>r(t)>0?Math.round(r(e)/r(t)*1e4)/10:0;return{frames:n(`framesDecoded`),dropped:n(`framesDropped`),stalls:n(`freezeCount`),stall_ms:Math.round(n(`totalFreezesDuration`)*1e3),decode_ms:i(`totalDecodeTime`,`framesDecoded`),jitter_ms:i(`jitterBufferDelay`,`jitterBufferEmittedCount`),nacks:n(`nackCount`),plis:n(`pliCount`),decoder:`track`}}snapshot(){return this.receiver.getStats().then(t=>{t.forEach(t=>{t.type===`inbound-rtp`&&t.kind===`video`&&(this.last=e.report(t,this.was),this.was={...t})})}).catch(()=>{}),this.last}},Zs=class{constructor(e){this.inner=e,this.video=document.createElement(`video`),this.wrap=document.createElement(`div`),this.media=null,this.trackStats=null,this.audio=!1,this.soundOn=!1,this.muted=!1;let t=this.video;t.muted=t.autoplay=t.playsInline=!0,t.className=`block h-full w-full object-contain`,t.dataset.testid=`track-video`,this.wrap.className=`h-full w-full`,this.wrap.append(t,e.element),this.setTrack(null)}get element(){return this.wrap}get stats(){return this.trackStats??this.inner.stats}setTrack(e,t=!1){this.media=e,this.audio=!!e&&t,this.applySound(),this.trackStats=e?new Xs(e.receiver):null,this.video.style.display=e?``:`none`,this.inner.element.style.display=e?`none`:``,this.video.srcObject!==(e?.stream??null)&&(this.video.srcObject=e?.stream??null),e&&this.play()}play(){try{this.video.play()?.catch?.(()=>{})}catch{}}onMessage(e){let t=new Uint8Array(e)[0];this.media&&t<=1||(!this.audio||t!==3&&t!==4)&&this.inner.onMessage(e)}applySound(){this.video.muted=!(this.audio&&this.soundOn&&!this.muted)}setHevc(e){this.inner.setHevc(e)}set onSoundFail(e){this.inner.onSoundFail=e}soundReport(){return this.inner.soundReport()}startSound(){this.inner.startSound(),this.soundOn=!0,this.applySound(),this.media&&this.play()}setMuted(e){this.inner.setMuted(e),this.muted=e,this.applySound()}resumeSound(){this.inner.resumeSound(),this.media&&this.video.paused&&this.play()}stop(){this.inner.stop(),this.video.srcObject=null}},Qs=`ps5upload.join.muted`,$s=5e3,ec=Object.fromEntries(Object.entries(Na).filter(([e])=>e!==`Escape`)),tc=new Set;function nc(e){if(!(e.code in ec)||e.ctrlKey||e.metaKey||e.altKey)return!1;let t=e.target;if(e.code===`Tab`&&(e.shiftKey||rc(t)))return!1;let n=t?.tagName;return!(n===`INPUT`||n===`TEXTAREA`||n===`SELECT`||t?.isContentEditable||rc(t))}function rc(e){let t=e?.tagName;if(t===`BUTTON`||t===`A`)return!0;let n=e?.getAttribute?.(`role`);return n===`button`||n===`link`||n===`menuitem`||n===`tab`||n===`switch`}var ic=!1;function ac(e){ic=e}function oc(e,t,n=null){if(!e||e.frames===0&&!t)return null;let r=e.snapshot();return r&&{...r,...t?{problem:t}:{},...n??{}}}function sc(){if(ic)return{...ja};let e=Ga(Xa(typeof navigator>`u`?void 0:navigator),So),t=hs.touchPad;return{...Ka(Ka(e,Fa(tc,ec)),t),touch:t.touch??null,motion:hs.motion??null}}var cc=class{constructor(e){this.opts=e,this.player=null,this.listeners=new Set,this.cleanups=[],this.subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e)),this.snap={stage:{kind:`connecting`},status:null,rttMs:null,light:null,problem:null,sound:!1,noSound:!1,host:e.host,muted:uc(),path:null},this.client=new zo({url:e.url,invite:e.invite,code:e.code??null,name:e.name,WebSocketImpl:e.transport,readPad:sc,onStage:e=>{this.set({stage:e}),e.kind===`joined`&&this.readPath(),(e.kind===`refused`||e.kind===`ended`)&&this.teardown()},onStatus:e=>this.set({status:e,host:e.host??this.snap.host}),onRtt:e=>this.set({rttMs:e}),onFrame:e=>this.picture().onMessage(e),readStats:()=>oc(this.player?.stats??null,this.snap.problem,this.player?.soundReport()??null),onCodec:(e,t,n)=>{let r=this.picture();r.setHevc(e),r instanceof Zs&&(r.setTrack(t,!!n),t&&this.snap.problem&&this.set({problem:null}))},onRumble:(e,t)=>{let n=Xa(typeof navigator>`u`?void 0:navigator);qa(n,e,t),n.some(e=>e?.connected)||navigator.vibrate?.(e||t?200:0)},onLight:e=>this.set({light:e})})}picture(){if(!this.player){let e=oa(e=>this.set({problem:e}),`player`,()=>this.client.askKeyframe());this.player=this.opts.transport?new Zs(e):e,this.player.onSoundFail=()=>this.set({noSound:!0}),this.player.setMuted(this.snap.muted)}return this.player}async readPath(){let e=this.client.socket,t=this.opts.path??null;if(e?.netPath)try{t=await e.netPath()??this.opts.path??null}catch{t=null}t!==this.snap.path&&this.set({path:t})}get element(){return this.picture().element}start(){let e=()=>{document.visibilityState===`hidden`?tc.clear():this.player?.resumeSound(),this.client.setNeutral(document.visibilityState===`hidden`)},t=()=>{tc.clear(),this.client.setNeutral(!0)},n=e=>{this.client.current.kind===`joined`&&nc(e)&&(!this.opts.keysLive||this.opts.keysLive())&&(e.preventDefault(),tc.add(e.code))},r=e=>{tc.delete(e.code)&&nc(e)&&e.preventDefault()};window.addEventListener(`keydown`,n),window.addEventListener(`keyup`,r);let i=()=>{this.client.setNeutral(document.visibilityState===`hidden`),document.visibilityState!==`hidden`&&this.player?.resumeSound()};document.addEventListener(`visibilitychange`,e),window.addEventListener(`blur`,t),window.addEventListener(`focus`,i);let a=setInterval(()=>{this.client.current.kind===`joined`&&this.readPath()},$s);this.cleanups.push(()=>{clearInterval(a),document.removeEventListener(`visibilitychange`,e),window.removeEventListener(`blur`,t),window.removeEventListener(`focus`,i),window.removeEventListener(`keydown`,n),window.removeEventListener(`keyup`,r),tc.clear()}),this.client.start()}setMuted(e){this.player?.setMuted(e);try{localStorage.setItem(Qs,e?`1`:`0`)}catch{}this.set({muted:e})}startSound(){this.snap.sound||(this.picture().startSound(),this.set({sound:!0}))}leave(){this.client.leave(),this.teardown()}stop(){this.client.stop(),this.teardown()}teardown(){for(let e of this.cleanups.splice(0))e();hs.touchPad={buttons:0,l2:0,r2:0,lx:0,ly:0,rx:0,ry:0};let e=this.player;this.player=null,e&&(e.stop(),e.element.remove())}sendPad(){this.client.sendPad(!1)}get snapshot(){return this.snap}set(e){this.snap={...this.snap,...e};for(let e of this.listeners)e()}};function lc(e){return(0,D.useSyncExternalStore)(e.subscribe,()=>e.snapshot)}function uc(){try{return typeof localStorage<`u`&&localStorage.getItem(Qs)===`1`}catch{return!1}}function dc(e){let t=()=>{let t=e.snapshot.stage.kind,n=t!==`refused`&&t!==`ended`;Ks(`play-together`,n),Ys(`play-together`,n)};t();let n=e.subscribe(t);return()=>{n(),Ks(`play-together`,!1),Ys(`play-together`,!1)}}var fc=3e3,pc=class{constructor(e,t=fc){this.onChange=e,this.delay=t,this.enabled=!1,this.pinned=!1,this.sticky=!1,this.shown=!0,this.timer=null}get visible(){return!this.enabled||this.pinned||this.shown}set(e,t,n=!1){let r=this.enabled&&!this.pinned,i=this.enabled,a=this.sticky;this.enabled=e,this.pinned=t,this.sticky=n,!e||t?(this.stop(),this.show(!0)):n?(this.stop(),!i||!a?this.show(!1):r||this.show(!0)):(!r||a)&&(this.show(!0),this.arm())}poke(){this.show(!0),this.enabled&&!this.pinned&&!this.sticky&&this.arm()}toggle(){this.visible?this.hide():this.poke()}hide(){this.enabled&&!this.pinned&&(this.stop(),this.show(!1))}dispose(){this.stop()}arm(){this.stop(),this.timer=setTimeout(()=>{this.timer=null,this.show(!1)},this.delay)}stop(){this.timer!==null&&clearTimeout(this.timer),this.timer=null}show(e){this.shown!==e&&(this.shown=e,this.onChange(e))}};function mc(e,t,n=!1){let[r,i]=(0,D.useState)(!0),a=(0,D.useRef)(null);(0,D.useEffect)(()=>{let e=new pc(i);return a.current=e,()=>{e.dispose(),a.current=null}},[]),(0,D.useEffect)(()=>{a.current?.set(e,t,n)},[e,t,n]);let o=(0,D.useCallback)(()=>a.current?.poke(),[]),s=(0,D.useCallback)(()=>a.current?.hide(),[]),c=(0,D.useCallback)(()=>a.current?.toggle(),[]);return{shown:!e||t||r,poke:o,hide:s,toggle:c}}var hc=3e4,gc=class{constructor(e,t=hc){this.onChange=e,this.ms=t,this.picking=!1,this.over=!1,this.timer=null}get shown(){return this.picking&&!this.over}set(e){e!==this.picking&&(this.picking=e,this.over=!1,this.stop(),e&&(this.timer=setTimeout(()=>{this.timer=null,this.over=!0,this.onChange()},this.ms)))}stop(){this.timer&&clearTimeout(this.timer),this.timer=null}reset(){this.stop(),this.picking=!1,this.over=!1}};function _c(e){let[,t]=(0,D.useState)(0),[n]=(0,D.useState)(()=>new gc(()=>t(e=>e+1)));return(0,D.useEffect)(()=>{n.set(e),t(e=>e+1)},[n,e]),(0,D.useEffect)(()=>()=>n.reset(),[n]),n.shown}var vc=()=>Xa(typeof navigator>`u`?void 0:navigator).filter(e=>!!e?.connected);function yc(e,t){if(t.kind===`axis`)return t.which===`lx`?e(`rp_pad_step_lx`,void 0,`Push the left stick right`):t.which===`ly`?e(`rp_pad_step_ly`,void 0,`Push the left stick down`):t.which===`rx`?e(`rp_pad_step_rx`,void 0,`Push the right stick right`):e(`rp_pad_step_ry`,void 0,`Push the right stick down`);if(t.kind===`button`){if(t.bit===R.CROSS)return e(`join_check_bottom`,void 0,`Press the bottom face button (✕)`);if(t.bit===R.CIRCLE)return e(`join_check_right`,void 0,`Press the right face button (○)`);if(t.bit===R.SQUARE)return e(`join_check_left`,void 0,`Press the left face button (□)`);if(t.bit===R.TRIANGLE)return e(`join_check_top`,void 0,`Press the top face button (△)`)}return e(`rp_pad_press`,{name:t.name},`Press ${t.name}`)}function bc(e,t){let n=(0,D.useRef)(t);(0,D.useEffect)(()=>{n.current=t}),(0,D.useEffect)(()=>{if(e===null)return;let t=0,r=()=>{n.current(vc().find(t=>t.index===e)??null),t=window.requestAnimationFrame(r)};return t=window.requestAnimationFrame(r),()=>window.cancelAnimationFrame(t)},[e])}var xc=[[R.CROSS,`✕`],[R.CIRCLE,`○`],[R.SQUARE,`□`],[R.TRIANGLE,`△`],[R.UP,`↑`],[R.DOWN,`↓`],[R.LEFT,`←`],[R.RIGHT,`→`],[R.L1,`L1`],[R.R1,`R1`],[R.L3,`L3`],[R.R3,`R3`],[R.SHARE,`Create`],[R.OPTIONS,`Options`],[R.PS,`PS`],[R.TOUCHPAD,`Touchpad`]];function Sc({pad:e}){let t=e=>`flex h-8 min-w-8 items-center justify-center rounded-md px-1.5 text-xs font-medium ${e?`bg-white text-black`:`bg-white/10 text-white/70`}`,n=(e,t,n)=>(0,z.jsxs)(`span`,{className:`relative flex h-12 w-12 items-center justify-center rounded-full bg-white/10 text-[10px] text-white/50`,children:[n,(0,z.jsx)(`span`,{className:`absolute h-3 w-3 rounded-full bg-white`,style:{left:`calc(50% + ${e/32767*18}px - 6px)`,top:`calc(50% + ${t/32767*18}px - 6px)`}})]});return(0,z.jsxs)(`div`,{className:`space-y-2`,"data-testid":`join-pad-test`,"data-buttons":e.buttons,children:[(0,z.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[xc.map(([n,r])=>(0,z.jsx)(`span`,{className:t((e.buttons&n)!==0),"data-on":(e.buttons&n)===0?`0`:`1`,children:r},n)),(0,z.jsx)(`span`,{className:t(e.l2>30),children:`L2`}),(0,z.jsx)(`span`,{className:t(e.r2>30),children:`R2`})]}),(0,z.jsxs)(`div`,{className:`flex gap-3`,children:[n(e.lx,e.ly,`L`),n(e.rx,e.ry,`R`)]})]})}function Cc({onClose:e}){let t=Ie(),[n,r]=(0,D.useState)(()=>vc().map(e=>({index:e.index,id:e.id}))),[i,a]=(0,D.useState)(()=>vc()[0]?.index??null),[o,s]=(0,D.useState)(ja),[c,l]=(0,D.useState)(null),[u,d]=(0,D.useState)(0),[f,p]=(0,D.useState)(yo),[m,h]=(0,D.useState)(null),[g,_]=(0,D.useState)(null),v=(0,D.useRef)(null);(0,D.useEffect)(()=>(ac(!0),()=>ac(!1)),[]),(0,D.useEffect)(()=>{(v.current?.querySelector(`[data-testid="join-pad-learn-start"]`)??v.current?.querySelector(`[data-testid="join-pad-check-close"]`))?.focus({preventScroll:!0})},[]),(0,D.useEffect)(()=>{let e=document.activeElement;e&&e!==document.body||v.current?.querySelector(`button:not([disabled])`)?.focus({preventScroll:!0})},[c,u]),(0,D.useEffect)(()=>{let e=()=>{let e=vc();r(t=>t.length===e.length&&t.every((t,n)=>t.id===e[n].id&&t.index===e[n].index)?t:e.map(e=>({index:e.index,id:e.id}))),a(t=>t!==null&&e.some(e=>e.index===t)?t:e[0]?.index??null)},t=window.setInterval(e,500);return window.addEventListener(`gamepadconnected`,e),window.addEventListener(`gamepaddisconnected`,e),()=>{window.clearInterval(t),window.removeEventListener(`gamepadconnected`,e),window.removeEventListener(`gamepaddisconnected`,e)}},[]),bc(i,e=>{if(_(t=>t?.id===e?.id?t:e),!e)return;if(c){c.feed(Eo(e))&&y(c,e);return}let t=Ga([e],So);s(e=>e.buttons===t.buttons&&e.l2===t.l2&&e.r2===t.r2&&e.lx===t.lx&&e.ly===t.ly&&e.rx===t.rx&&e.ry===t.ry?e:t)});let y=(e,n)=>{if(!e.done)return d(e.step);let r=n?.id??g?.id;l(null),r&&(p(bo(r,e.profile(n?wo(n):void 0))),h(t(`join_check_saved`,void 0,`Saved for this controller on this device. Try it below.`)))},b=()=>{h(null),d(0),l(new Fo(No))},x=g,S=x?Co(x):null,ee=!!(x&&f[x.id]);return(0,z.jsx)(`div`,{ref:v,role:`dialog`,"aria-modal":`true`,"aria-label":t(`join_check_title`,void 0,`Check your controller`),className:`absolute inset-0 z-40 flex items-center justify-center bg-black/70 p-4 backdrop-blur-sm`,"data-testid":`join-pad-check`,onPointerDown:e=>e.stopPropagation(),children:(0,z.jsxs)(`div`,{className:`w-[min(26rem,100%)] space-y-3 rounded-2xl border border-white/10 bg-neutral-900/95 p-4 text-sm text-white shadow-2xl`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsx)(me,{size:16,className:`text-white/70`}),(0,z.jsx)(`p`,{className:`flex-1 font-semibold`,children:t(`join_check_title`,void 0,`Check your controller`)}),(0,z.jsx)(`button`,{type:`button`,onClick:e,"aria-label":t(`join_done`,void 0,`Done`),className:`flex h-8 w-8 items-center justify-center rounded-full bg-white/10 hover:bg-white/20`,"data-testid":`join-pad-check-close`,children:(0,z.jsx)(De,{size:15})})]}),x?(0,z.jsxs)(z.Fragment,{children:[n.length>1&&(0,z.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:n.map(e=>(0,z.jsx)(`button`,{type:`button`,disabled:!!c,onClick:()=>a(e.index),className:`rounded-full px-2.5 py-1 text-xs ${e.index===i?`bg-white text-black`:`bg-white/10`}`,children:to(e.id)},`${e.index}-${e.id}`))}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`p`,{className:`truncate font-medium`,"data-testid":`join-pad-check-name`,children:to(x.id)}),(0,z.jsx)(`p`,{className:`text-xs text-white/60`,"data-testid":`join-pad-check-kind`,"data-kind":S??``,children:S===`saved`?t(`rp_pad_mapped`,void 0,`Plays with your mapping`):S===`guess`?t(`join_check_unknown`,void 0,`This controller isn't on our list, so its buttons may be mixed up. Setting it up takes a few seconds.`):t(`rp_pad_standard`,void 0,`Recognized`)}),io(x)&&(0,z.jsx)(ps,{id:x.id,className:`mt-1 block text-xs text-amber-200/90`})]}),c?(0,z.jsxs)(`div`,{className:`space-y-3`,"data-testid":`join-pad-learn`,children:[(0,z.jsx)(`p`,{className:`text-xs text-white/60`,children:t(`rp_pad_progress`,{n:u+1,total:c.steps.length},`${u+1} of ${c.steps.length}`)}),(0,z.jsx)(`p`,{className:`text-lg font-semibold`,"data-testid":`join-pad-learn-step`,children:c.current?yc(t,c.current):``}),(0,z.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,z.jsx)(`button`,{type:`button`,onClick:()=>{c.skip(),y(c,x)},className:`rounded-full bg-white/15 px-3 py-1.5 text-xs hover:bg-white/25`,"data-testid":`join-pad-learn-skip`,children:t(`rp_pad_skip`,void 0,`Skip`)}),u>0&&(0,z.jsx)(`button`,{type:`button`,onClick:()=>{c.back(),d(c.step)},className:`rounded-full bg-white/15 px-3 py-1.5 text-xs hover:bg-white/25`,children:t(`rp_pad_back`,void 0,`Back`)}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>l(null),className:`rounded-full px-3 py-1.5 text-xs text-white/70 hover:bg-white/10`,children:t(`rp_pad_cancel`,void 0,`Cancel`)})]})]}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`p`,{className:`text-xs text-white/60`,children:t(`join_check_try`,void 0,`Press buttons and move the sticks: what you press lights up.`)}),(0,z.jsx)(Sc,{pad:o}),m&&(0,z.jsx)(`p`,{className:`text-xs text-emerald-300`,role:`status`,children:m}),(0,z.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,z.jsx)(`button`,{type:`button`,onClick:b,className:`rounded-full bg-white px-3 py-1.5 text-xs font-medium text-black`,"data-testid":`join-pad-learn-start`,children:ee?t(`join_check_redo`,void 0,`Redo`):t(`join_check_map`,void 0,`Set up the buttons`)}),ee&&(0,z.jsx)(`button`,{type:`button`,onClick:()=>{p(bo(x.id,null)),h(null)},className:`rounded-full bg-white/15 px-3 py-1.5 text-xs hover:bg-white/25`,"data-testid":`join-pad-reset`,children:t(`rp_pad_reset`,void 0,`Reset`)}),(0,z.jsx)(`button`,{type:`button`,onClick:e,className:`rounded-full bg-white/15 px-3 py-1.5 text-xs hover:bg-white/25`,"data-testid":`join-pad-check-done`,children:t(`join_done`,void 0,`Done`)})]})]})]}):(0,z.jsx)(`p`,{className:`text-white/70`,children:t(`rp_pads_none`,void 0,`No controller seen yet. Connect one and press any button on it.`)})]})})}function wc(e,t){let[n,r]=(0,D.useState)(!1);return(0,D.useEffect)(()=>{if(!e||!t)return;let n=!0;return Be(e,Le).then(e=>{n&&!e&&r(!0)}),()=>{n=!1}},[e,t]),n}function Tc({href:e}){let t=Ie();return(0,z.jsxs)(`div`,{className:`flex flex-col items-center gap-3 text-center`,"data-testid":`open-on-wifi`,children:[(0,z.jsx)(`p`,{className:`max-w-sm text-sm text-white/60`,children:t(`join_open_lan_body`,void 0,`Can't reach the internet? If you're on the same Wi-Fi as your friend, open the game there.`)}),(0,z.jsx)(`a`,{href:e,rel:`noreferrer`,className:`rounded-full bg-white px-4 py-2 text-sm font-medium text-black`,"data-testid":`open-on-wifi-link`,children:t(`join_open_lan`,void 0,`Open on this Wi-Fi`)})]})}function Ec(e){let t=Math.max(0,Math.ceil(e));return`${Math.floor(t/60)}:${String(t%60).padStart(2,`0`)}`}var Dc=`ps5upload.join.guided`,Oc=1;function kc(e){return e.player!==Oc&&(!e.guided||e.movedOff)&&!e.reconnecting}function Ac(e,t){switch(t){case`lan`:return e(`join_path_lan`,void 0,`Home network`);case`tailscale`:return e(`join_path_tailscale`,void 0,`Tailscale`);default:return e(`join_path_internet`,void 0,`Internet`)}}function jc(e,t){return e(`join_seat_taken`,{host:t},`${t} needed their controller back and no other controller was free on the PS5, so you're out of the game. Ask ${t} to let you in again.`)}function Mc(e,t,n,r=!1){if(t.kind===`refused`)switch(t.why){case`key`:return e(`join_refused_key`,{host:n},`This invite has expired. Ask ${n} for a new link.`);case`expired`:return e(`join_refused_expired`,{host:n},`Your place in the game was lost. Ask ${n} to let you in again.`);case`full`:return e(`join_refused_full`,void 0,`The game is full: four players already.`);case`denied`:return e(`join_refused_denied`,{host:n},`${n} didn't let you in this time.`);case`no_answer`:return e(`join_refused_no_answer`,{host:n},`${n} didn't answer in time. Tell ${n}, then try again.`);case`closed`:return e(`join_refused_closed`,{host:n},`${n} isn't hosting Play Together right now.`);case`old_helper`:return e(`join_refused_old_helper`,{host:n},`${n}'s PS5 needs an updated helper for Play Together.`);case`not_playing`:return e(`join_refused_not_playing`,{host:n},`${n} isn't playing right now. Ask ${n} to start Play first.`);case`unreachable`:return e(`join_refused_unreachable`,{host:n},`${n}'s computer couldn't reach their PS5. Try again in a moment.`);case`slow_down`:return e(`join_refused_slow_down`,void 0,`Too many wrong codes. Wait a minute, then try again.`);case`address`:return e(`join_refused_address`,{host:n},`This link's address is outside your home network, so the app will not use it. Ask ${n} for a link with their computer's IP address.`);case`seat_taken`:return jc(e,n);default:return e(`join_refused_other`,{host:n},`${n} didn't let you in.`)}if(t.kind===`ended`)switch(t.why){case`kicked`:return e(`join_ended_kicked`,{host:n},`${n} took you out of the game.`);case`closed`:return e(`join_ended_closed`,{host:n},`${n} closed Play Together.`);case`host_stopped`:return e(`join_ended_host_stopped`,void 0,`The host stopped playing.`);case`replaced`:return e(`join_ended_replaced`,void 0,`This game was opened in another tab or on another device, so it stopped here.`);case`pad_lost`:return e(`join_ended_pad_lost`,{host:n},`The PS5 lost your controller, so you're out of the game. Ask ${n} to let you in again.`);case`gave_up`:return e(`join_ended_gave_up`,{host:n},`The connection to ${n} didn't come back in time.`);case`lost`:return r?e(`join_net_lost`,{host:n},`The connection to ${n} dropped. Check your internet connection, then ask again.`):e(`join_ended_lost`,{host:n},`Couldn't reach ${n}. Check that you're on the same network.`);case`left`:return e(`join_ended_left`,void 0,`You left the game.`);case`seat_taken`:return jc(e,n);case`mismatch`:return e(`join_net_mismatch`,void 0,`This link doesn't match the host; ask them for a new one.`);case`no_direct`:return e(`join_net_no_direct`,void 0,`A direct connection isn't possible from this network (both sides' routers are strict). Try Wi-Fi instead of mobile data, or ask the host to turn on UPnP.`);case`no_room`:return e(`join_net_no_room`,{host:n},`This invite isn't open any more. Ask ${n} for a new link.`);case`net_full`:return e(`join_net_full`,{host:n},`${n}'s game has no room for another friend right now. Try again in a moment.`);case`no_hub`:return e(`join_net_no_hub`,void 0,`Couldn't reach the PS5Upload invite service. Check your internet connection, then try again.`);case`offer`:return e(`join_net_offer`,{host:n},`${n}'s computer couldn't connect to this browser. Try another browser.`);case`no_webrtc`:return e(`join_net_no_webrtc`,void 0,`This browser can't make direct connections. Try a recent Chrome, Safari or Firefox.`)}return``}function Nc(e){let[t,n]=(0,D.useState)(()=>Date.now());return(0,D.useEffect)(()=>{if(!e)return;n(Date.now());let t=window.setInterval(()=>n(Date.now()),500);return()=>window.clearInterval(t)},[e]),t}function Pc(){let[e,t]=(0,D.useState)({ready:!1,pressed:!1,id:null,kind:null,weak8BitDo:!1});return(0,D.useEffect)(()=>{let e=()=>{let e=Xa(typeof navigator>`u`?void 0:navigator).find(e=>!!e?.connected),n=!!e,r=n?sc():null,i=!!r&&(r.buttons!==0||r.l2>30||r.r2>30),a=e?.id??null,o=e?Co(e):null,s=!!e&&io(e);t(e=>e.ready===n&&e.pressed===i&&e.id===a&&e.kind===o&&e.weak8BitDo===s?e:{ready:n,pressed:i,id:a,kind:o,weak8BitDo:s})};e();let n=window.setInterval(e,120);return window.addEventListener(`gamepadconnected`,e),window.addEventListener(`gamepaddisconnected`,e),()=>{window.clearInterval(n),window.removeEventListener(`gamepadconnected`,e),window.removeEventListener(`gamepaddisconnected`,e)}},[]),e}function Fc(e){return!!e?.closest?.(`[data-testid="rp-touch"]`)}var Ic=14,Lc=()=>typeof window<`u`&&!rs()&&!!window.matchMedia?.(`(pointer: coarse)`).matches;function Rc(e,t,n){return!e||e===t||e.closest?.(`[data-join-game]`)?`game`:n?.contains(e)?`controls`:`page`}function zc(e){return e.checking?`close-check`:e.guide?`close-guide`:e.where===`game`?`show-controls`:e.full?`leave-full`:null}var Bc={good:`var(--color-good,#32d074)`,fair:`var(--color-warn,#ffb340)`,slow:`var(--color-bad,#ff6961)`,none:`rgba(255,255,255,.5)`};function Vc({text:e,body:t,onCancel:n}){let r=Ie();return(0,z.jsxs)(`div`,{className:`flex flex-col items-center gap-5 px-6 py-10 text-center`,"data-testid":`join-waiting`,children:[(0,z.jsxs)(`div`,{className:`relative flex h-24 w-24 items-center justify-center`,"aria-hidden":!0,children:[(0,z.jsx)(`span`,{className:`absolute inset-0 animate-ping rounded-full bg-white/10 [animation-duration:2.4s]`}),(0,z.jsx)(`span`,{className:`absolute inset-3 animate-pulse rounded-full bg-white/10 [animation-duration:2.4s]`}),(0,z.jsx)(`span`,{className:`relative flex h-14 w-14 items-center justify-center rounded-full bg-white/15`,children:(0,z.jsx)(Se,{size:26})})]}),(0,z.jsx)(`p`,{className:`max-w-sm text-base font-medium`,"data-testid":`join-stage`,children:e}),t&&(0,z.jsx)(`p`,{className:`max-w-sm text-sm text-white/60`,children:t}),(0,z.jsx)(`button`,{type:`button`,onClick:n,autoFocus:!0,className:`rounded-full bg-white/15 px-4 py-2 text-sm hover:bg-white/25`,"data-testid":`join-cancel`,children:r(`join_cancel`,void 0,`Cancel`)})]})}function Hc({session:e,inApp:t=!1,onLeave:n,onAgain:r,onFullscreen:i,lanUrl:a=null,hubDown:o=!1}){let s=Ie(),c=lc(e),{stage:l,status:u}=c,d=c.host??s(`join_host_fallback`,void 0,`your friend`),f=(0,D.useRef)(null),p=(0,D.useRef)(null),m=(0,D.useRef)(null),[h,g]=(0,D.useState)(!1),[_,v]=(0,D.useState)(()=>Lt(Dc)===`1`),[y,b]=(0,D.useState)(()=>typeof window<`u`&&window.innerHeight>window.innerWidth),x=Pc(),[S,ee]=(0,D.useState)(!1),C=l.kind===`reconnecting`,w=Nc(C),T=l.kind===`joined`||C,E=u?.state===`picking_user`,te=l.kind===`joined`||l.kind===`reconnecting`?l.player:0,[ne,re]=(0,D.useState)(!1),ie=(0,D.useRef)(te);(0,D.useEffect)(()=>{ie.current===Oc&&te>Oc&&re(!0),te&&(ie.current=te)},[te]);let[ae,oe]=(0,D.useState)(!1),[se,ce]=(0,D.useState)(!1),le=T&&(h||!t),de=Lc(),fe=_c(E),k=mc(le,C||fe&&!de||ae||se,de),{poke:he}=k,_e=(0,D.useRef)(null),ve=()=>{_e.current&&clearTimeout(_e.current.timer),_e.current=null};(0,D.useEffect)(()=>ve,[]);let[ye,A]=(0,D.useState)(!1),xe=(0,D.useRef)(!1);(0,D.useEffect)(()=>{if(!le||!de||k.shown||!_||xe.current)return;xe.current=!0,A(!0);let e=setTimeout(()=>A(!1),6e3);return()=>clearTimeout(e)},[le,de,k.shown,_]),(0,D.useEffect)(()=>{if(!T)return;let t=e.element;return f.current?.appendChild(t),()=>t.remove()},[T,e]),(0,D.useEffect)(()=>{if(!T||c.sound)return;let t=()=>e.startSound(),n=[`pointerup`,`touchend`,`click`,`keydown`];for(let e of n)window.addEventListener(e,t,!0);return()=>{for(let e of n)window.removeEventListener(e,t,!0)}},[T,c.sound,e]),(0,D.useEffect)(()=>{let e=()=>b(window.innerHeight>window.innerWidth);return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),(0,D.useEffect)(()=>{if(h)return()=>void i?.(!1)},[h,i]);let Ce=(0,D.useRef)(h);(0,D.useEffect)(()=>{Ce.current=h},[h]),(0,D.useEffect)(()=>{if(!t||!T||!Lc()||typeof window>`u`||!window.matchMedia)return;let e=window.matchMedia(`(orientation: landscape)`),n=()=>{e.matches&&!Ce.current&&(g(!0),i?.(!0))};return n(),e.addEventListener?.(`change`,n),()=>e.removeEventListener?.(`change`,n)},[t,T,i]),(0,D.useEffect)(()=>{t&&T&&rs()&&!Ce.current&&(g(!0),i?.(!0))},[t,T,i]),(0,D.useEffect)(()=>{if(!T)return;let e=e=>{if(e.key!==`Escape`)return;if(S)return void Le.current();if(he(),h)return g(!1);let t=Rc(document.activeElement,document.body,p.current);t===`game`?Le.current():t===`controls`&&m.current?.focus({preventScroll:!0})};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[T,h,he,S]),(0,D.useEffect)(()=>{if(!h||!Lc())return;window.history.pushState(window.history.state,``);let e=window.location.href,t=!1,n=()=>{t=!0,g(!1)};return window.addEventListener(`popstate`,n),()=>{window.removeEventListener(`popstate`,n),!t&&window.location.href===e&&window.history.back()}},[h]),(0,D.useEffect)(()=>{if(!h||typeof document>`u`)return;let e=()=>{document.fullscreenElement||Lc()||g(!1)};return document.addEventListener(`fullscreenchange`,e),()=>document.removeEventListener(`fullscreenchange`,e)},[h]);let Te=rs(),Ee=T&&kc({player:te,guided:_,movedOff:ne,reconnecting:C})&&!u?.playsAs,De=async e=>{g(e),await i?.(e)},Oe=()=>m.current?.focus({preventScroll:!0}),ke=()=>{It(Dc,`1`),v(!0),re(!1)},Ae=()=>{he();let e=C?`[data-testid="join-reconnecting-leave"]`:`[data-testid="join-bar"] button`;p.current?.querySelector(e)?.focus({preventScroll:!0})},je=()=>{let e=p.current?.querySelector(`[data-testid="join-check-open"]`);e?e.focus({preventScroll:!0}):Oe(),ee(!1)},Me=()=>Rc(document.activeElement,document.body,p.current),[Ne,Pe]=(0,D.useState)(`game`);(0,D.useEffect)(()=>{if(!T)return;let e=()=>Pe(Me()),t=()=>window.setTimeout(e,0);return e(),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t)}},[T]);let Fe=()=>{switch(T?zc({checking:S,guide:Ee,where:Me(),full:h}):null){case`close-check`:return je(),!0;case`close-guide`:return ke(),Oe(),!0;case`show-controls`:return Ae(),!0;case`leave-full`:return De(!1),!0;default:return!1}},Le=(0,D.useRef)(Fe);(0,D.useEffect)(()=>{Le.current=Fe});let Re=t&&!de&&T&&zc({checking:S,guide:Ee,where:Ne,full:h})!==null;(0,D.useEffect)(()=>{if(Re)return Xo(()=>void Le.current())},[Re]);let ze=!t&&T&&!de;(0,D.useEffect)(()=>{if(!ze)return;let e=window.location.href;window.history.pushState(window.history.state,``);let t=!0,n=()=>{if(t=!1,!Le.current())return window.history.back();window.history.pushState(window.history.state,``),t=!0};return window.addEventListener(`popstate`,n),()=>{window.removeEventListener(`popstate`,n),t&&window.location.href===e&&window.history.back()}},[ze]);let Be=l.kind===`joined`;(0,D.useEffect)(()=>{if(!Be)return;let e=document.activeElement;if(e&&e!==document.body)return;let t=Te&&Ee?p.current?.querySelector(`[data-testid="join-guide-ok"]`):null;t?t.focus({preventScroll:!0}):Oe()},[Be]),(0,D.useEffect)(()=>{x.pressed&&T&&!S&&Me()===`controls`&&Oe()},[x.pressed]);let Ve=()=>{e.leave(),n()};if(l.kind===`connecting`||l.kind===`asking`)return(0,z.jsxs)(`div`,{className:t?`rounded-[var(--radius-card)] bg-neutral-900 text-white`:`flex min-h-[100dvh] flex-col items-center justify-center gap-4 bg-black text-white`,"data-join-ui":``,children:[l.kind===`connecting`&&o&&a&&(0,z.jsx)(Tc,{href:a}),(0,z.jsx)(Vc,{text:l.kind===`connecting`?s(`join_connecting`,{host:d},`Connecting to ${d}…`):s(`join_waiting`,{host:d},`Waiting for ${d} to let you in`),body:l.kind===`asking`?s(`join_waiting_body`,{host:d},`${d} sees your name on their screen and taps Allow.`):void 0,onCancel:Ve})]});if(l.kind===`refused`||l.kind===`ended`){let i=l.kind===`refused`||l.why!==`left`&&l.why!==`mismatch`;return(0,z.jsxs)(`div`,{className:t?`flex flex-col items-center gap-4 rounded-[var(--radius-card)] bg-neutral-900 px-6 py-10 text-center text-white`:`flex min-h-[100dvh] flex-col items-center justify-center gap-4 bg-black px-6 text-center text-white`,"data-testid":`join-ended`,"data-why":l.why,"data-join-ui":``,children:[(0,z.jsx)(Se,{size:28,className:`text-white/60`}),(0,z.jsx)(`p`,{className:`max-w-sm text-base`,"data-testid":`join-ended-text`,children:Mc(s,l,d,e.opts.internet??!!e.opts.transport)}),a&&l.why===`no_hub`&&(0,z.jsx)(Tc,{href:a}),(0,z.jsxs)(`div`,{className:`flex flex-wrap justify-center gap-2`,children:[i&&(0,z.jsx)(`button`,{type:`button`,onClick:r,autoFocus:!0,className:`rounded-full bg-white px-4 py-2 text-sm font-medium text-black`,"data-testid":`join-again`,children:l.kind===`refused`&&l.why===`not_playing`?s(`join_retry`,void 0,`Try again`):s(`join_again`,void 0,`Ask to join again`)}),(0,z.jsx)(`button`,{type:`button`,onClick:n,autoFocus:!i,className:`rounded-full bg-white/15 px-4 py-2 text-sm`,"data-testid":`join-done`,children:s(`join_done`,void 0,`Done`)})]})]})}let He=l.player,Ue=c.light??at(He),We=c.rttMs??u?.rttMs??null,Ge=it(We),Ke=Lc(),qe=T&&!C&&!x.ready&&Ke&&(!t||h),Je=kc({player:He,guided:_,movedOff:ne,reconnecting:C}),Ye=He===Oc,Xe=u?.playsAs??null,Ze=C?(l.deadline-w)/1e3:0,Qe=()=>De(!h),$e=t&&!h&&Ke&&T,et=(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`span`,{className:`flex items-center gap-1.5 rounded-full bg-black/60 px-2.5 py-1 font-medium`,"data-testid":`join-player`,children:[(0,z.jsx)(`span`,{className:`inline-block h-2.5 w-2.5 rounded-full`,style:{background:`rgb(${Ue[0]},${Ue[1]},${Ue[2]})`}}),t&&(0,z.jsxs)(`span`,{className:`text-white/80`,children:[s(`join_playing_at`,{host:d},`Playing at ${d}'s`),` · `]}),s(`join_you_are`,{n:He},`You are Player ${He}`)]}),We!=null&&(0,z.jsxs)(`span`,{className:`rounded-full bg-black/60 px-2 py-1 tabular-nums`,style:{color:Bc[Ge]},"data-testid":`join-delay`,"data-tone":Ge,"data-path":c.path??void 0,children:[c.path&&(0,z.jsxs)(`span`,{className:`text-white/80`,children:[Ac(s,c.path),` · `]}),Math.round(We),` ms`]}),Ye&&(0,z.jsx)(`span`,{className:`rounded-full bg-black/60 px-2.5 py-1 text-white/85`,"data-testid":`join-seat-stream`,children:s(`join_seat_stream`,{host:d},`You're playing as ${d}'s PS5 user. No need to pick one.`)}),Xe&&!Ye&&(0,z.jsx)(`span`,{className:`rounded-full bg-black/60 px-2.5 py-1 text-white/85`,"data-testid":`join-plays-as`,children:s(`join_plays_as`,{profile:Xe},`You're playing as ${Xe}. No need to pick one.`)}),E&&!Ye&&u?.seatNote&&(0,z.jsx)(`span`,{className:`rounded-full bg-black/60 px-2.5 py-1 text-white/85`,"data-testid":`join-seat-note`,children:s(`join_seat_tv_asks`,{host:d},`${d} chose a profile for you, but it couldn't be used. The TV will ask who you are.`)}),E&&!Ye&&(0,z.jsx)(`span`,{className:`rounded-full bg-white/90 px-2.5 py-1 font-medium text-black`,"data-testid":`join-picking`,children:s(`join_picking`,void 0,`Press PS, then pick Quick Play on the TV`)})]}),tt=(0,z.jsxs)(z.Fragment,{children:[le&&de&&k.shown&&!C&&(0,z.jsxs)(`button`,{type:`button`,onClick:k.hide,className:`flex items-center gap-1 rounded-full bg-white/15 px-2.5 py-1 font-medium`,"data-testid":`join-hide-controls`,children:[(0,z.jsx)(pe,{size:13}),s(`join_hide_controls`,void 0,`Hide`)]}),!c.sound&&(0,z.jsxs)(`button`,{type:`button`,onClick:()=>e.startSound(),className:`flex items-center gap-1 rounded-full bg-white/90 px-2.5 py-1 font-medium text-black`,"data-testid":`join-sound`,children:[(0,z.jsx)(we,{size:13}),s(`join_sound`,void 0,`Tap for sound`)]}),c.sound&&!c.noSound&&(0,z.jsxs)(`button`,{type:`button`,onClick:()=>e.setMuted(!c.muted),"aria-pressed":c.muted,className:`flex items-center gap-1 rounded-full bg-white/15 px-2.5 py-1 hover:bg-white/25`,"data-testid":`join-mute`,children:[c.muted?(0,z.jsx)(M,{size:13}):(0,z.jsx)(we,{size:13}),c.muted?s(`rp_unmute`,void 0,`Sound on`):s(`rp_mute`,void 0,`Mute`)]}),c.noSound&&(0,z.jsxs)(`span`,{className:`flex items-center gap-1 rounded-full bg-black/60 px-2.5 py-1 text-white/80`,"data-testid":`join-no-sound`,children:[(0,z.jsx)(M,{size:13}),s(`join_no_sound`,void 0,`No sound in this browser`)]}),(t||typeof document<`u`&&!!document.documentElement.requestFullscreen)&&(0,z.jsx)(`button`,{type:`button`,onClick:()=>void Qe(),"aria-label":h?s(`join_exit_fullscreen`,void 0,`Leave full screen`):s(`pad_fill`,void 0,`Full screen`),className:`flex items-center gap-1 rounded-full bg-white/15 px-2.5 py-1 hover:bg-white/25`,"data-testid":`join-full`,children:h?(0,z.jsx)(be,{size:13}):(0,z.jsx)(O,{size:13})}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>ee(!0),"aria-label":s(`join_check_title`,void 0,`Check your controller`),title:s(`join_check_title`,void 0,`Check your controller`),className:`flex items-center gap-1 rounded-full bg-white/15 px-2.5 py-1 hover:bg-white/25`,"data-testid":`join-check-open`,children:(0,z.jsx)(me,{size:13})}),(0,z.jsxs)(`button`,{type:`button`,onClick:Ve,className:`flex items-center gap-1 rounded-full bg-[var(--color-danger,#dc2626)] px-3 py-1 font-medium`,"data-testid":`join-leave`,children:[(0,z.jsx)(ge,{size:13}),s(`join_leave`,void 0,`Leave`)]})]}),nt=k.shown?`opacity-100`:`pointer-events-none opacity-0`,rt={"data-testid":`join-bar`,"data-shown":k.shown?`1`:`0`,onFocus:e=>{(Te||e.target.matches?.(`:focus-visible`))&&ce(!0)},onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||ce(!1)},onPointerEnter:e=>{e.pointerType===`mouse`&&oe(!0)},onPointerLeave:()=>oe(!1)},ot=h||!t?`fixed inset-0 z-[200] bg-black`:`relative mx-auto aspect-video w-full max-w-[max(20rem,calc((100dvh_-_22rem)*16/9))] overflow-hidden rounded-[var(--radius-card)] bg-black shadow-[var(--shadow-2)]`,st=t&&h;return(0,z.jsxs)(`div`,{className:`space-y-2`,ref:p,"data-join-ui":``,children:[(0,z.jsxs)(`div`,{className:`${ot} select-none text-white [-webkit-touch-callout:none]`,style:{touchAction:`none`},role:st?`dialog`:void 0,"aria-modal":st?!0:void 0,"aria-label":st?s(`pad_fill`,void 0,`Full screen`):void 0,onPointerMove:e=>{if(e.pointerType===`mouse`)return he();let t=_e.current;t&&t.id===e.pointerId&&Math.hypot(e.clientX-t.x,e.clientY-t.y)>Ic&&ve()},onPointerDown:e=>{if(Fc(e.target))return;if(e.pointerType===`mouse`||!de)return he();if(e.target.closest?.(`[data-testid="join-bar"], button, a, input, [role="button"]`))return;ve();let{pointerId:t,clientX:n,clientY:r}=e;_e.current={id:t,x:n,y:r,timer:setTimeout(()=>{_e.current=null,navigator.vibrate?.(15),k.toggle()},450)}},onPointerUp:ve,onPointerCancel:ve,onPointerLeave:ve,"data-testid":`join-stage-view`,children:[(0,z.jsx)(`div`,{ref:f,className:`pointer-events-none absolute inset-0 z-0 flex items-center justify-center`,"aria-hidden":!0}),le&&!k.shown&&!C&&We!=null&&(0,z.jsxs)(`span`,{className:`pointer-events-none absolute z-10 rounded-full bg-black/40 px-1.5 py-0.5 text-[10px] leading-none tabular-nums`,style:{color:Bc[Ge],top:`max(0.5rem, env(safe-area-inset-top))`,right:`max(0.5rem, env(safe-area-inset-right))`},"data-testid":`join-delay-corner`,children:[Math.round(We),` ms`]}),qe?(0,z.jsxs)(`div`,{className:`absolute left-1/2 top-1/2 z-20 flex w-max max-w-[min(24rem,calc(100%-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col items-center gap-2 rounded-2xl bg-black/70 p-3 text-xs backdrop-blur-sm transition-opacity duration-300 ${nt}`,...rt,children:[(0,z.jsx)(`div`,{className:`flex flex-wrap items-center justify-center gap-2`,children:et}),(0,z.jsx)(`div`,{className:`flex flex-wrap items-center justify-center gap-2`,children:tt})]}):$e?null:(0,z.jsxs)(`div`,{className:`absolute inset-x-0 top-0 z-20 flex flex-wrap items-center gap-2 bg-gradient-to-b from-black/70 to-transparent px-3 pb-5 pt-[max(8px,env(safe-area-inset-top))] text-xs transition-opacity duration-300 ${nt}`,...rt,children:[et,(0,z.jsx)(`span`,{className:`flex-1`}),tt]}),!k.shown&&!qe&&(0,z.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),he()},"aria-label":s(`join_show_controls`,void 0,`Show controls`),className:`absolute left-1/2 top-[max(6px,env(safe-area-inset-top))] z-20 flex h-7 w-11 -translate-x-1/2 items-center justify-center rounded-full bg-black/40 text-white/70 opacity-60 hover:opacity-100 focus-visible:opacity-100`,"data-testid":`join-show-controls`,children:(0,z.jsx)(ue,{size:16,"aria-hidden":!0})}),ye&&!k.shown&&(0,z.jsx)(`p`,{className:`pointer-events-none absolute left-1/2 top-[max(10px,env(safe-area-inset-top))] z-20 -translate-x-1/2 rounded-full bg-black/60 px-3 py-1 text-xs text-white/85`,"data-testid":`join-hold-hint`,children:s(`join_hold_hint`,void 0,`Press and hold the picture to show the buttons`)}),c.problem&&(0,z.jsx)(`p`,{className:`absolute inset-x-4 top-1/2 z-10 -translate-y-1/2 text-center text-sm text-white/85`,"data-testid":`join-problem`,children:c.problem===`no_hevc`?s(`pad_watch_no_hevc`,void 0,`This device can't play this stream's picture: the computer streams HEVC, and this device plays only H.264.`):s(`pad_watch_decode`,void 0,`The picture could not be played here.`)}),S&&(0,z.jsx)(Cc,{onClose:je}),qe&&(0,z.jsx)(ks,{stream:e,layout:`overlay`,onMenu:()=>k.shown?k.hide():he()}),!qe&&!C&&(0,z.jsxs)(`div`,{className:`absolute bottom-3 left-3 z-20 flex items-center gap-2 rounded-2xl bg-black/70 px-3 py-1.5 text-xs transition-opacity duration-300 ${nt}`,"data-testid":`join-pad`,children:[(0,z.jsx)(me,{size:14,style:{color:x.pressed?`rgb(${Ue[0]},${Ue[1]},${Ue[2]})`:void 0}}),x.ready?(0,z.jsxs)(`span`,{className:`flex flex-col items-start gap-1`,children:[(0,z.jsx)(`span`,{children:s(`join_pad_ready`,void 0,`Your controller is ready`)}),x.weak8BitDo&&x.id&&(0,z.jsx)(ps,{id:x.id,className:`text-amber-200/90`}),x.kind===`guess`&&no()&&(0,z.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2 text-white/75`,"data-testid":`join-pad-unknown`,children:[s(`join_check_unknown_short`,void 0,`Not on our list: buttons may be mixed up.`),(0,z.jsx)(`button`,{type:`button`,onClick:()=>ee(!0),className:`rounded-full bg-white px-2.5 py-0.5 font-medium text-black`,"data-testid":`join-pad-unknown-check`,children:s(`join_check_title`,void 0,`Check your controller`)})]})]}):Ke&&t&&!h?s(`join_full_to_play`,void 0,`Tap full screen to play with the on-screen controller.`):(0,z.jsxs)(`span`,{className:`flex flex-col`,children:[(0,z.jsx)(`span`,{children:s(`join_pad_none`,void 0,`Connect a controller (USB or Bluetooth) and press any button.`)}),(0,z.jsx)(`span`,{className:`text-white/60`,"data-testid":`join-pad-keys`,children:s(`join_pad_keys`,void 0,`Or use the keyboard: WASD move, arrows D-pad, Enter ✕, Backspace ○, Q □, E △, Tab Options.`)})]}),Te&&(0,z.jsx)(`span`,{className:`max-w-[14rem] border-l border-white/20 pl-2 text-white/70`,"data-testid":`join-tv-back`,children:s(`join_tv_back_hint`,void 0,`Press Back on the remote for the buttons.`)})]}),u?.blockSystem&&u.state===`playing`&&!qe&&(0,z.jsx)(`p`,{className:`absolute bottom-3 right-3 z-20 rounded-full bg-black/60 px-3 py-1 text-[11px] text-white/70 transition-opacity duration-300 ${nt}`,"data-testid":`join-blocked`,children:s(`join_block_note`,{host:d},`${d} turned off PS and Create for friends.`)}),fe&&!Ye&&de&&!k.shown&&!C&&(0,z.jsx)(`p`,{className:`pointer-events-none absolute left-1/2 top-2 z-20 -translate-x-1/2 whitespace-nowrap rounded-full bg-white/90 px-2.5 py-1 text-xs font-medium text-black`,"data-testid":`join-picking-note`,children:s(`join_picking`,void 0,`Press PS, then pick Quick Play on the TV`)}),Je&&!Xe&&(0,z.jsxs)(`div`,{className:`absolute bottom-14 left-1/2 z-30 w-[min(22rem,calc(100%-2rem))] -translate-x-1/2 rounded-2xl border border-white/10 bg-neutral-900/90 p-4 text-sm shadow-2xl backdrop-blur-md`,"data-testid":`join-guide`,children:[(0,z.jsx)(`p`,{className:`font-semibold`,children:s(`join_guide_title`,void 0,`One more step on the TV`)}),(0,z.jsx)(`p`,{className:`mt-1 text-white/75`,children:s(`join_guide_body`,void 0,`On your controller, press PS once. The TV asks "Who's using this controller?". Pick Quick Play or your own user. The host doesn't need to do anything.`)}),(0,z.jsx)(`p`,{className:`mt-1 text-white/60`,children:s(`join_guide_menus`,void 0,`On the PS5's home screen only the host controls the menus; your controller plays inside games.`)}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>{ke(),Oe()},className:`mt-3 rounded-full bg-white px-3 py-1 text-xs font-medium text-black`,"data-testid":`join-guide-ok`,children:s(`join_guide_ok`,void 0,`Got it`)})]}),C&&(0,z.jsxs)(`div`,{className:`absolute inset-0 z-30 flex flex-col items-center justify-center gap-3 bg-black/70 px-6 text-center`,"data-testid":`join-reconnecting`,children:[(0,z.jsxs)(`button`,{type:`button`,onClick:Ve,className:`absolute right-3 top-[max(10px,env(safe-area-inset-top))] flex items-center gap-1 rounded-full bg-white/15 px-3 py-1.5 text-sm font-medium hover:bg-white/25`,"data-testid":`join-reconnecting-leave`,children:[(0,z.jsx)(ge,{size:14}),s(`join_leave`,void 0,`Leave`)]}),(0,z.jsx)(`span`,{className:`h-7 w-7 animate-spin rounded-full border-2 border-white/30 border-t-white`,"aria-hidden":!0}),l.hostStopped?(0,z.jsx)(`p`,{className:`max-w-sm text-base font-medium`,"data-testid":`join-host-away`,children:s(`join_host_away`,{time:Ec(Ze)},`The host stopped playing — waiting for them to start again (${Ec(Ze)})`)}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`p`,{className:`text-base font-medium`,children:s(`join_reconnecting`,void 0,`Reconnecting…`)}),(0,z.jsx)(`p`,{className:`text-sm text-white/70`,"data-testid":`join-reconnecting-left`,children:s(`join_reconnecting_left`,{time:Ec(Ze)},`Your place is kept for ${Ec(Ze)}.`)})]})]}),!t&&T&&y&&Ke&&(0,z.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 bottom-16 z-20 flex justify-center`,children:(0,z.jsxs)(`span`,{className:`flex items-center gap-2 rounded-full bg-black/70 px-3 py-1.5 text-xs text-white/85`,children:[(0,z.jsx)(j,{size:14}),s(`pad_turn`,void 0,`Turn the phone sideways`)]})}),(0,z.jsx)(`div`,{ref:m,tabIndex:0,"data-own-arrows":``,"data-join-game":``,"aria-label":s(`join_game_label`,{host:d},`${d}'s game`),className:`pointer-events-none absolute inset-0 outline-none`,"data-testid":`join-game`})]}),$e&&(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 rounded-[var(--radius-card)] bg-neutral-900 px-3 py-2 text-xs text-white`,"data-testid":`join-bar`,"data-shown":`1`,"data-below":`1`,children:[(0,z.jsx)(`div`,{className:`flex w-full min-w-0 flex-wrap items-center gap-2`,children:et}),(0,z.jsxs)(`button`,{type:`button`,onClick:()=>void Qe(),className:`flex h-11 min-w-0 flex-1 items-center justify-center gap-1.5 rounded-full bg-white/15 px-3 text-sm font-medium hover:bg-white/25`,"data-testid":`join-fullscreen-below`,children:[(0,z.jsx)(O,{size:15}),s(`pad_fill`,void 0,`Full screen`)]}),c.sound&&!c.noSound?(0,z.jsx)(`button`,{type:`button`,onClick:()=>e.setMuted(!c.muted),"aria-pressed":c.muted,"aria-label":c.muted?s(`rp_unmute`,void 0,`Sound on`):s(`rp_mute`,void 0,`Mute`),className:`flex h-11 w-11 items-center justify-center rounded-full bg-white/15 hover:bg-white/25`,children:c.muted?(0,z.jsx)(M,{size:16}):(0,z.jsx)(we,{size:16})}):c.sound?null:(0,z.jsxs)(`button`,{type:`button`,onClick:()=>e.startSound(),className:`flex h-11 items-center justify-center gap-1.5 rounded-full bg-white px-3 text-sm font-medium text-black`,children:[(0,z.jsx)(we,{size:15}),s(`join_sound`,void 0,`Tap for sound`)]}),(0,z.jsxs)(`button`,{type:`button`,onClick:Ve,className:`flex h-11 items-center justify-center gap-1.5 rounded-full bg-[var(--color-danger,#dc2626)] px-4 text-sm font-medium`,"data-testid":`join-leave-below`,children:[(0,z.jsx)(ge,{size:15}),s(`join_leave`,void 0,`Leave`)]})]})]})}var Uc=`ps5upload.join.name`;function Wc(e){return/iPhone/.test(e)?`iPhone`:/iPad/.test(e)?`iPad`:/Android/.test(e)?`Android`:``}function Gc(e){return e.trim().slice(0,32)}function Kc(e=``){return Gc(Lt(`ps5upload.join.name`)??``)||e}function qc(e){let t=Gc(e);return t&&It(Uc,t),t}function Jc(e){try{return!!sessionStorage.getItem(Ro(e))}catch{return!1}}async function Yc(e){try{e?(await document.documentElement.requestFullscreen?.({navigationUI:`hide`}),await screen.orientation.lock?.(`landscape`)):document.fullscreenElement&&await document.exitFullscreen()}catch{}}function Xc({url:e,invite:t,host:n,transport:r,lanUrl:i=null,path:a=null,internet:o}){let s=Ie(),c=wc(r&&o!==!1?e:null,i),[l,u]=(0,D.useState)(()=>Kc(Wc(typeof navigator>`u`?``:navigator.userAgent))),[d,f]=(0,D.useState)(null),[p,m]=(0,D.useState)(0),h=(0,D.useCallback)(e=>{if(!e)return;let t=typeof window<`u`&&!!window.matchMedia?.(`(pointer: coarse)`).matches,n=e.querySelector(`[data-testid="join-name"]`)?.value.trim()?`join-go`:t?null:`join-name`;n&&e.querySelector(`[data-testid="${n}"]`)?.focus({preventScroll:!0})},[]),g=i=>{let s=qc(i);if(!s)return;let c=new cc({url:e,invite:t,name:s,host:n,transport:r,path:a,...o===void 0?{}:{internet:o}});f(c),m(e=>e+1),c.start()};if((0,D.useEffect)(()=>{!d&&Jc(t)&&l.trim()&&g(l)},[]),(0,D.useEffect)(()=>d?dc(d):void 0,[d]),(0,D.useEffect)(()=>{if(!d)return;let e=()=>d.stop();return window.addEventListener(`pagehide`,e),()=>window.removeEventListener(`pagehide`,e)},[d]),d)return(0,z.jsx)(Hc,{session:d,lanUrl:i,hubDown:c,onLeave:()=>f(null),onAgain:()=>{d.stop(),g(l)},onFullscreen:Yc},p);let _=n??s(`join_host_fallback`,void 0,`your friend`),v=(0,z.jsx)(`div`,{className:`flex min-h-[100dvh] items-center justify-center bg-black px-6 text-white`,"data-testid":`join-name-step`,"data-join-ui":``,children:(0,z.jsxs)(`form`,{ref:h,className:`w-full max-w-sm space-y-4 rounded-2xl border border-white/10 bg-neutral-900 p-6`,onSubmit:e=>{e.preventDefault(),g(l)},children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,z.jsx)(`span`,{className:`flex h-10 w-10 items-center justify-center rounded-full bg-white/10`,children:(0,z.jsx)(Se,{size:20})}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`h1`,{className:`text-lg font-semibold`,children:s(`join_title`,void 0,`Join a friend's game`)}),(0,z.jsx)(`p`,{className:`text-sm text-white/60`,children:s(`join_title_body`,{host:_},`Play on ${_}'s PS5 as Player 2, 3 or 4.`)})]})]}),(0,z.jsxs)(`label`,{className:`block space-y-1.5`,children:[(0,z.jsx)(`span`,{className:`text-sm font-medium`,children:s(`join_name_label`,void 0,`Your name`)}),(0,z.jsx)(`input`,{value:l,onChange:e=>u(e.target.value),maxLength:32,autoComplete:`nickname`,className:`block w-full rounded-lg border border-white/15 bg-black px-3 py-2 text-base outline-none focus:border-white/50`,"data-testid":`join-name`}),(0,z.jsx)(`span`,{className:`block text-xs text-white/50`,children:s(`join_name_hint`,void 0,`Your friend sees this when you ask to join.`)})]}),(0,z.jsx)(`button`,{type:`submit`,disabled:!l.trim(),className:`w-full rounded-full bg-white py-2.5 text-sm font-semibold text-black disabled:opacity-40`,"data-testid":`join-go`,children:s(`join_button`,void 0,`Join`)}),c&&i&&(0,z.jsx)(Tc,{href:i})]})});return t?(0,z.jsx)(Wo,{appLink:rt(location.href),children:v}):v}function Zc(e){let t=(e??``).trim().replace(/^\[|\]$/g,``).toLowerCase(),n=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/.exec(t);if(n){let e=n.slice(1).map(Number);if(e.some(e=>e>255))return null;let[t,r]=e;return t===10||t===172&&r>=16&&r<32||t===192&&r===168||t===169&&r===254||t===127?0:t===100&&r>=64&&r<128?1:2}if(!t.includes(`:`)||!/^[0-9a-f:.]+$/.test(t))return null;if(t.startsWith(`fd7a:115c:a1e0:`))return 1;let r=parseInt(t.split(`:`)[0]||`0`,16);return(r&65024)==64512||(r&65472)==65152||t===`::1`?0:2}function Qc(e,t){let n=Zc(e),r=Zc(t);return n===1||r===1?`tailscale`:r===0?`lan`:r===2?`internet`:null}function $c(e){let t=(e??``).toLowerCase();if(t.endsWith(`.local`))return`lan`;if(t.endsWith(`.ts.net`))return`tailscale`;let n=Zc(t);return n===0?`lan`:n===1?`tailscale`:null}function el(e){let t=[];if(typeof e.forEach==`function`)e.forEach(e=>t.push(e));else for(let n of e)t.push(n);let n=new Map(t.map(e=>[String(e.id),e])),r=t.filter(e=>e.type===`candidate-pair`),i=t.filter(e=>e.type===`transport`&&typeof e.selectedCandidatePairId==`string`).map(e=>n.get(String(e.selectedCandidatePairId))).find(Boolean)??r.find(e=>e.selected===!0)??r.find(e=>e.nominated===!0&&e.state===`succeeded`);if(!i)return null;let a=e=>{let t=n.get(String(e));if(!t)return null;let r=t.address??t.ip;return typeof r==`string`?r:null};return Qc(a(i.localCandidateId),a(i.remoteCandidateId))}function tl(e){let t=e.replace(/:\d+$/,``).replace(/^\[|\]$/g,``);return`${t===`localhost`||t===`127.0.0.1`||t===`::1`?`ws`:`wss`}://${e}/ws`}function nl(e){let t=new Set;for(let n of e.matchAll(/^a=fingerprint:sha-256[ \t]+([0-9A-Fa-f:]+)[ \t]*\r?$/gim))t.add(n[1].toUpperCase());return/^a=fingerprint:(?!sha-256[ \t])/im.test(e)?null:t.size===1?[...t][0]:null}function rl(e,t){let n=nl(e);return n!==null&&n===t.toUpperCase()}var il=16777216;function al(e){let t=16383,n=Math.max(1,Math.ceil(e.length/t)),r=[];for(let i=0;i<n;i++){let a=e.subarray(i*t,Math.min(e.length,(i+1)*t)),o=new Uint8Array(a.length+1);o[0]=i+1===n?0:1,o.set(a,1),r.push(o)}return r}var ol=class{constructor(e=il){this.max=e,this.parts=[],this.size=0}push(e){let t=e instanceof Uint8Array?e:new Uint8Array(e);if(t.length===0)return{kind:`error`,why:`empty`};let n=t[0],r=t.subarray(1);if(n===2||n===3)return r.length===8?{kind:n===2?`ping`:`pong`,data:r.slice()}:{kind:`error`,why:`ping_size`};if(n!==0&&n!==1)return{kind:`error`,why:`header`};if(this.size+r.length>this.max)return this.parts=[],this.size=0,{kind:`error`,why:`too_big`};if(this.parts.push(r.slice()),this.size+=r.length,n===1)return{kind:`partial`};let i=new Uint8Array(this.size),a=0;for(let e of this.parts)i.set(e,a),a+=e.length;return this.parts=[],this.size=0,{kind:`message`,data:i.buffer}}};function sl(e){let t=new Uint8Array(9);return t[0]=3,t.set(e.subarray(0,8),1),t}var cl=[`stun:stun.cloudflare.com:3478`,`stun:stun.l.google.com:19302`],ll=1500,ul=2e4;function dl(e){let t=e?.codecs??[],n=e=>t.filter(t=>t.mimeType.toLowerCase()===e);return[...n(`video/h264`),...n(`video/h265`),...n(`video/rtx`)]}var fl=null;function pl(e){e.onopen=e.onmessage=e.onclose=e.onerror=null;try{e.readyState===1&&e.send(JSON.stringify({t:`leave`})),e.close(1e3)}catch{}}function ml(e,t={}){let n=t.WebSocketImpl??(typeof WebSocket>`u`?void 0:WebSocket);if(!n||fl)return;let r=tl(e.hub),i;try{i=new n(r)}catch{return}let a={url:r,room:e.room,ws:i,msgs:[],timer:null};fl=a;let o=()=>{fl===a&&(fl=null,a.timer&&clearTimeout(a.timer),pl(i))};i.onopen=()=>i.send(JSON.stringify({v:1,t:`join`,room:e.room})),i.onmessage=e=>{if(typeof e.data==`string`)try{a.msgs.push(JSON.parse(e.data))}catch{}},i.onclose=o,i.onerror=()=>{},a.timer=setTimeout(o,t.keepMs??6e4)}function hl(e,t){let n=fl;return n?(fl=null,n.timer&&clearTimeout(n.timer),n.url!==e||n.room!==t||n.ws.readyState>1||n.msgs.some(e=>e.t===`error`||e.t===`closed`)?(pl(n.ws),null):{ws:n.ws,msgs:n.msgs}):null}function gl(e,t={}){var n;let r=t.WebSocketImpl??(typeof WebSocket>`u`?void 0:WebSocket),i=t.PeerConnection??(typeof RTCPeerConnection>`u`?void 0:RTCPeerConnection),a=t.iceTimeoutMs??15e3,o=t.log??(()=>{});class s{constructor(e){this.CONNECTING=0,this.OPEN=1,this.CLOSING=2,this.CLOSED=3,this.readyState=0,this.binaryType=`arraybuffer`,this.onopen=null,this.onmessage=null,this.onclose=null,this.onerror=null,this.hub=null,this.pc=null,this.dc=null,this.timer=null,this.rx=new ol,this.answered=!1,this.early=[],this.hubBackUntil=0,this.offerSdp=null,this.offerSent=!1,this.ownEarly=[],this.media=null,setTimeout(()=>this.begin(),0)}begin(){if(this.readyState!==0)return;if(!i||!r){this.fail(`no_webrtc`);return}let n=t.signalUrl??tl(e.hub),a=t.signalUrl||t.lan?null:hl(n,e.room),s;if(a)s=a.ws,o(`hub: joined early`);else try{s=new r(n)}catch{this.fail(`no_hub`);return}if(this.hub=s,this.prepare(),this.readyState===0){s.onopen=()=>s.send(JSON.stringify(t.lan?{v:1,t:`join`,lan:!0}:{v:1,t:`join`,room:e.room})),s.onmessage=e=>{if(typeof e.data!=`string`)return;let t;try{t=JSON.parse(e.data)}catch{return}this.onHub(t)},s.onclose=e=>{this.hub===s&&(this.hub=null,this.readyState===0&&(this.answered||e?.code===1001&&this.hubRestarting()||this.fail(`no_hub`)))},s.onerror=()=>{};for(let e of a?.msgs??[])this.onHub(e)}}signal(e){let t=this.hub;t&&t.readyState===1&&t.send(JSON.stringify({t:`signal`,to:`host`,data:e}))}onHub(e){if(this.readyState===0)switch(e.t){case`joined`:o(`hub: joined room as ${e.gid??`?`}`),this.sendOffer();return;case`signal`:e.from===`host`&&e.data&&typeof e.data==`object`&&this.onSignal(e.data);return;case`closed`:this.fail(`no_room`);return;case`error`:if(o(`hub: error ${e.why??`?`}`),e.why===`no_room`&&this.hubBackUntil&&this.hubRestarting())return;this.fail(e.why===`no_room`?`no_room`:e.why===`room_full`?`net_full`:`no_hub`);return}}prepare(){if(!i)return;this.offerSent=!1,this.ownEarly=[];let e;try{e=new i({iceServers:[{urls:cl}]})}catch{this.fail(`no_webrtc`);return}this.pc=e;let n=e.createDataChannel(t.label??`join`,{ordered:!0});if(n.binaryType=`arraybuffer`,this.dc=n,n.onopen=()=>this.opened(n),n.onmessage=e=>this.fromChannel(e.data),n.onclose=()=>{this.dc===n&&this.dropped()},t.video&&e.addTransceiver){try{let t=e.addTransceiver(`video`,{direction:`recvonly`}),n=dl(globalThis.RTCRtpReceiver?.getCapabilities?.(`video`));n.length&&t.setCodecPreferences&&t.setCodecPreferences(n)}catch{}try{e.addTransceiver(`audio`,{direction:`recvonly`})}catch{}e.ontrack=t=>{if(this.pc!==e)return;let n=this.media?.stream??t.streams[0]??new MediaStream;n.getTracks().includes(t.track)||n.addTrack(t.track),this.media=t.track.kind===`audio`?{stream:n,receiver:this.media?.receiver??t.receiver,audio:t.receiver}:{stream:n,receiver:t.receiver,...this.media?.audio?{audio:this.media.audio}:{}}}}e.onicecandidate=t=>{if(this.pc!==e)return;let n=t.candidate;if(!n||!n.candidate)return;let r={type:`candidate`,candidate:n.candidate,sdpMid:n.sdpMid??`0`};this.offerSent?this.signal(r):this.ownEarly.push(r)},e.oniceconnectionstatechange=()=>{if(this.pc!==e)return;let t=e.iceConnectionState;o(`ice: ${t}`),t===`failed`&&(this.readyState===0?this.fail(`no_direct`):this.dropped())},this.offerSdp=(async()=>{let t=await e.createOffer();return await e.setLocalDescription(t),e.localDescription?.sdp??t.sdp??``})().catch(()=>(this.pc===e&&this.fail(`no_webrtc`),null))}async sendOffer(){let e=this.pc,t=this.offerSdp;if(!e||!t||this.offerSent)return;this.clearTimer(),this.timer=setTimeout(()=>{this.timer=null,this.readyState===0&&this.fail(`no_direct`)},a);let n=await t;if(this.pc===e&&n!==null&&this.readyState===0){this.signal({type:`offer`,sdp:n}),this.offerSent=!0;for(let e of this.ownEarly.splice(0))this.signal(e)}}async onSignal(t){let n=this.pc;if(t.type===`bye`)this.fail(t.why===`full`?`net_full`:`offer`);else if(n){if(t.type===`answer`){if(this.answered||typeof t.sdp!=`string`)return;if(e.fp?!rl(t.sdp,e.fp):nl(t.sdp)===null){o(`answer: fingerprint does not match the link`),this.fail(`mismatch`);return}this.answered=!0;try{await n.setRemoteDescription({type:`answer`,sdp:t.sdp});for(let e of this.early.splice(0))await n.addIceCandidate(e).catch(()=>{})}catch{this.fail(`offer`)}}else if(t.type===`candidate`&&typeof t.candidate==`string`&&t.candidate){let e={candidate:t.candidate,sdpMid:typeof t.sdpMid==`string`?t.sdpMid:`0`,sdpMLineIndex:typeof t.sdpMLineIndex==`number`?t.sdpMLineIndex:0};this.answered?await n.addIceCandidate(e).catch(()=>{}):this.early.push(e)}}}opened(e){this.dc===e&&this.readyState===0&&(this.clearTimer(),this.readyState=1,o(`channel open`),this.leaveHub(),this.onopen?.(new Event(`open`)))}fromChannel(e){if(this.readyState!==1)return;if(typeof e==`string`){this.onmessage?.(new MessageEvent(`message`,{data:e}));return}if(!(e instanceof ArrayBuffer))return;let t=this.rx.push(e);switch(t.kind){case`ping`:try{this.dc?.send(sl(t.data))}catch{}return;case`message`:this.onmessage?.(new MessageEvent(`message`,{data:t.data}));return;case`error`:o(`channel: bad binary message (${t.why})`),this.dropped();return;default:return}}async netPath(){let e=this.pc;if(!e||this.readyState!==1||typeof e.getStats!=`function`)return null;try{return el(await e.getStats())}catch{return null}}send(e){let t=this.dc;if(this.readyState!==1||!t||t.readyState!==`open`)throw Error(`not open`);if(typeof e==`string`){t.send(e);return}let n=ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e);for(let e of al(n))t.send(e)}close(){this.readyState!==3&&(this.teardown(),this.emitClose(1e3,``,!0))}clearTimer(){this.timer&&clearTimeout(this.timer),this.timer=null}leaveHub(){let e=this.hub;if(this.hub=null,e)try{e.readyState===1&&e.send(JSON.stringify({t:`leave`})),e.close(1e3)}catch{}}hubRestarting(){let e=Date.now();return this.hubBackUntil||=e+ul,e>=this.hubBackUntil?!1:(o(`hub: restarting, trying again`),this.clearTimer(),this.leaveHub(),this.closePeer(),this.answered=!1,this.early=[],this.timer=setTimeout(()=>{this.timer=null,this.begin()},ll),!0)}teardown(){this.readyState=3,this.clearTimer(),this.leaveHub(),this.closePeer()}closePeer(){let e=this.pc,t=this.dc;this.pc=null,this.dc=null,this.media=null,this.offerSdp=null,this.offerSent=!1,this.ownEarly=[];try{t?.close()}catch{}try{e?.close()}catch{}}dropped(){this.readyState!==3&&(this.teardown(),this.emitClose(1006,``,!1))}fail(e){this.readyState!==3&&(o(`failed: ${e}`),this.teardown(),this.emitClose(He,`net:${e}`,!1))}emitClose(e,t,n){let r=this.onclose;if(!r)return;let i=typeof CloseEvent>`u`?{type:`close`,code:e,reason:t,wasClean:n}:new CloseEvent(`close`,{code:e,reason:t,wasClean:n});setTimeout(()=>r(i),0)}}return n=s,n.CONNECTING=0,n.OPEN=1,n.CLOSING=2,n.CLOSED=3,s}var _l=3e3;function vl(e,t){return/^https?:\/\/[^/?#]+(\/[^?#]*)?\/join\/?$/.test(e)?e.replace(/^http/,`ws`).replace(/\/join\/?$/,`/${t}`):null}var U=e=>vl(e,`api/join/signal`);function yl(e){let t=[];if(e.rtc){let n=e.net??{room:``,key:``,fp:e.fp??``,hub:``};for(let[r,i]of[[`lan`,e.lan],[`tailscale`,e.ts]]){let a=i?U(i):null;if(!a)continue;let o=e.rtcMake(n,{signalUrl:e.reach(a),...e.net?{}:{lan:!0}});t.push({via:r,make:()=>new o(``),pinned:!!n.fp})}if(e.net){let n=e.rtcMake(e.net,{});t.push({via:`hub`,make:()=>new n(``),pinned:!0})}}let n=e.lan?vl(e.lan,`api/join/ws`):null;if(n){let r=e.reach(n);t.push({via:`socket`,make:()=>e.socket(r)})}return t}var bl=new Map;function xl(e,t,n=300,r=_l){let i=e.some(e=>e===`lan`||e===`tailscale`),a=e.some(e=>e!==`socket`);return e.map(e=>e===t?0:e===`hub`&&i?n:e===`socket`&&a?r:0)}function Sl(e){let t=e.find(e=>e.via===`hub`),n=e.find(e=>(e.via===`lan`||e.via===`tailscale`)&&[`no_direct`,`net_full`,`offer`].includes(Ue(e.e)??``));return t&&(Ue(t.e)!==`no_hub`||!n)?t.e:n?n.e:t?.e??e[e.length-1]?.e??null}function Cl(e,t){var n;let r=t.log??(()=>{}),i=t.headStartMs??300,a=t.socketAfterMs??3e3;class o{constructor(e){this.CONNECTING=0,this.OPEN=1,this.CLOSING=2,this.CLOSED=3,this.readyState=0,this.binaryType=`arraybuffer`,this.onopen=null,this.onmessage=null,this.onclose=null,this.onerror=null,this.live=[],this.waiting=[],this.pinned=new Set,this.t0=0,this.closes=[],this.winner=null,setTimeout(()=>this.begin(),0)}get via(){return this.winner?.via??null}get media(){return this.winner?.s?.media??null}async netPath(){let e=this.winner?.s;return e?.netPath?e.netPath():null}begin(){if(this.readyState!==0)return;let n=e();if(!n.length){this.end({type:`close`,code:1006,reason:``,wasClean:!1});return}this.t0=Date.now();for(let e of n)e.pinned&&this.pinned.add(e.via);let r=xl(n.map(e=>e.via),bl.get(t.room)??null,i,a);n.forEach((e,t)=>{r[t]===0?this.launch(e.via,e.make):this.waiting.push({via:e.via,make:e.make,timer:setTimeout(()=>this.startWaiting(e.via),r[t])})})}startWaiting(e){let t=this.waiting.findIndex(t=>t.via===e);if(t<0)return;let[n]=this.waiting.splice(t,1);clearTimeout(n.timer),this.launch(n.via,n.make)}launch(e,t){if(this.readyState!==0)return;let n;try{n=t()}catch{this.tryClosed(e,{type:`close`,code:1006,reason:``,wasClean:!1});return}r(`path: trying ${e}`);let i={via:e,s:n};this.live.push(i),n.binaryType=this.binaryType,n.onopen=e=>this.won(i,e),n.onclose=t=>{this.live=this.live.filter(e=>e!==i),this.tryClosed(e,t)},n.onerror=()=>{},n.onmessage=null}tryClosed(e,t){if(this.readyState===0){if(r(`path: ${e} failed after ${Date.now()-this.t0} ms${t?.reason?` (${t.reason})`:``}`),this.closes.push({via:e,e:t}),this.pinned.has(e)&&Ue(t)===`mismatch`){for(let e of this.waiting.filter(e=>e.via===`socket`))clearTimeout(e.timer);this.waiting=this.waiting.filter(e=>e.via!==`socket`)}!this.live.length&&this.waiting.length?this.startWaiting(this.waiting[0].via):!this.live.length&&!this.waiting.length&&this.end(Sl(this.closes))}}won(e,n){if(this.readyState!==0)return;this.winner=e,bl.set(t.room,e.via),r(`path: playing by ${e.via} after ${Date.now()-this.t0} ms`);for(let e of this.waiting.splice(0))clearTimeout(e.timer);for(let t of this.live.splice(0))if(t!==e){t.s.onopen=t.s.onclose=t.s.onmessage=t.s.onerror=null;try{t.s.close()}catch{}}let i=e.s;i.onmessage=e=>this.onmessage?.(e),i.onerror=e=>this.onerror?.(e),i.onclose=e=>{this.readyState!==3&&(this.readyState=3,this.onclose?.(e))},this.readyState=1,t.onWin?.(e.via),this.onopen?.(n)}send(e){if(this.readyState!==1||!this.winner)throw Error(`not open`);this.winner.s.send(e)}close(e,t){if(this.readyState===3)return;let n=this.readyState===1;this.readyState=3;for(let e of this.waiting.splice(0))clearTimeout(e.timer);let r=this.winner?[this.winner,...this.live]:this.live.splice(0);for(let n of r){n.s.onopen=n.s.onclose=n.s.onmessage=n.s.onerror=null;try{n.s.close(e,t)}catch{}}let i=this.onclose;if(i){let r={type:`close`,code:e??1e3,reason:t??``,wasClean:n};setTimeout(()=>i(r),0)}}end(e){if(this.readyState===3)return;this.readyState=3;let t=this.onclose,n=e??{type:`close`,code:1006,reason:``,wasClean:!1};t&&setTimeout(()=>t(n),0)}}return n=o,n.CONNECTING=0,n.OPEN=1,n.CLOSING=2,n.CLOSED=3,o}fs();var wl=new URLSearchParams(location.hash.slice(1)),Tl=wl.get(`n`)?.trim()||null,El=nt(location.hash);El&&ml(El);var Dl=(0,x.createRoot)(document.getElementById(`root`));if(El){let e=gl(El,{video:!0,log:e=>console.info(`[join] ${e}`)}),t=Re(location.hash,`join`);Dl.render((0,z.jsx)(Xc,{url:tl(El.hub),invite:El.key,host:Tl,transport:e,lanUrl:t?ze(t,{key:El.key}):null}))}else{let e=wl.get(`i`)||null,t=location.pathname.replace(/\/join\/?$/,``),n=`${location.protocol===`https:`?`wss`:`ws`}://${location.host}${t}/api/join/ws`,r=e=>console.info(`[join] ${e}`),i=`${location.origin}${t}/join`,a=typeof RTCPeerConnection>`u`?void 0:Cl(()=>yl({net:null,lan:i,ts:null,fp:tt(wl.get(`fp`)),rtc:!0,reach:e=>e,rtcMake:(e,t)=>gl(e,{video:!0,log:r,...t}),socket:e=>new WebSocket(e)}),{room:i,log:r});Dl.render((0,z.jsx)(Xc,{url:n,invite:e,host:Tl,path:$c(location.hostname),transport:a,internet:!1}))}</script> <style>/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */ -@supports (((-webkit-hyphens:none)) and (not (margin-trim:block))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}}:root:not(#\#):not(#\#),:host:not(#\#):not(#\#){--font-sans:system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Helvetica, Arial, sans-serif;--font-mono:ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;--color-amber-200:color(display-p3 .979824 .904554 .57325);--color-emerald-300:color(display-p3 .524941 .903425 .722352);--color-neutral-900:color(display-p3 .0905274 .0905274 .0905274);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-sm:24rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-wide:.025em;--tracking-wider:.05em;--radius-md:.375rem;--radius-lg:.5rem;--radius-2xl:1rem;--animate-spin:spin 1s linear infinite;--animate-ping:ping 1s cubic-bezier(0, 0, .2, 1) infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-sm:8px;--blur-md:12px;--aspect-video:16 / 9;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}@supports (color:lab(0% 0 0)){:root:not(#\#):not(#\#),:host:not(#\#):not(#\#){--color-amber-200:lab(91.7203% -.505269 49.9084);--color-emerald-300:lab(83.9203% -48.7124 13.8849);--color-neutral-900:lab(7.78201% -.0000149012 0)}}:not(#\#):not(#\#):not(#\#):not(#\#),:not(#\#):not(#\#):not(#\#):not(#\#):after,:not(#\#):not(#\#):not(#\#):not(#\#):before{box-sizing:border-box;border:0 solid;margin:0;padding:0}:not(#\#):not(#\#):not(#\#):not(#\#)::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-file-upload-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}:not(#\#):not(#\#):not(#\#):not(#\#)::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html:not(#\#):not(#\#):not(#\#):not(#\#),:host:not(#\#):not(#\#):not(#\#):not(#\#){-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr:not(#\#):not(#\#):not(#\#):not(#\#){height:0;color:inherit;border-top-width:1px}abbr:where([title]):not(#\#):not(#\#):not(#\#):not(#\#){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1:not(#\#):not(#\#):not(#\#):not(#\#),h2:not(#\#):not(#\#):not(#\#):not(#\#),h3:not(#\#):not(#\#):not(#\#):not(#\#),h4:not(#\#):not(#\#):not(#\#):not(#\#),h5:not(#\#):not(#\#):not(#\#):not(#\#),h6:not(#\#):not(#\#):not(#\#):not(#\#){font-size:inherit;font-weight:inherit}a:not(#\#):not(#\#):not(#\#):not(#\#){color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b:not(#\#):not(#\#):not(#\#):not(#\#),strong:not(#\#):not(#\#):not(#\#):not(#\#){font-weight:bolder}code:not(#\#):not(#\#):not(#\#):not(#\#),kbd:not(#\#):not(#\#):not(#\#):not(#\#),samp:not(#\#):not(#\#):not(#\#):not(#\#),pre:not(#\#):not(#\#):not(#\#):not(#\#){font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small:not(#\#):not(#\#):not(#\#):not(#\#){font-size:80%}sub:not(#\#):not(#\#):not(#\#):not(#\#),sup:not(#\#):not(#\#):not(#\#):not(#\#){vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub:not(#\#):not(#\#):not(#\#):not(#\#){bottom:-.25em}sup:not(#\#):not(#\#):not(#\#):not(#\#){top:-.5em}table:not(#\#):not(#\#):not(#\#):not(#\#){text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)):not(#\#):not(#\#):not(#\#):not(#\#){outline:auto}progress:not(#\#):not(#\#):not(#\#):not(#\#){vertical-align:baseline}summary:not(#\#):not(#\#):not(#\#):not(#\#){display:list-item}ol:not(#\#):not(#\#):not(#\#):not(#\#),ul:not(#\#):not(#\#):not(#\#):not(#\#),menu:not(#\#):not(#\#):not(#\#):not(#\#){list-style:none}img:not(#\#):not(#\#):not(#\#):not(#\#),svg:not(#\#):not(#\#):not(#\#):not(#\#),video:not(#\#):not(#\#):not(#\#):not(#\#),canvas:not(#\#):not(#\#):not(#\#):not(#\#),audio:not(#\#):not(#\#):not(#\#):not(#\#),iframe:not(#\#):not(#\#):not(#\#):not(#\#),embed:not(#\#):not(#\#):not(#\#):not(#\#),object:not(#\#):not(#\#):not(#\#):not(#\#){vertical-align:middle;display:block}img:not(#\#):not(#\#):not(#\#):not(#\#),video:not(#\#):not(#\#):not(#\#):not(#\#){max-width:100%;height:auto}button:not(#\#):not(#\#):not(#\#):not(#\#),input:not(#\#):not(#\#):not(#\#):not(#\#),select:not(#\#):not(#\#):not(#\#):not(#\#),optgroup:not(#\#):not(#\#):not(#\#):not(#\#),textarea:not(#\#):not(#\#):not(#\#):not(#\#){font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-file-upload-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:not(#\#):not(#\#):not(#\#):not(#\#)::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])):not(#\#):not(#\#):not(#\#):not(#\#) optgroup{font-weight:bolder}:where(select:is([multiple],[size])):not(#\#):not(#\#):not(#\#):not(#\#) optgroup option{padding-inline-start:20px}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-file-upload-button{margin-inline-end:4px}:not(#\#):not(#\#):not(#\#):not(#\#)::file-selector-button{margin-inline-end:4px}:not(#\#):not(#\#):not(#\#):not(#\#)::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){:not(#\#):not(#\#):not(#\#):not(#\#)::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){:not(#\#):not(#\#):not(#\#):not(#\#)::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea:not(#\#):not(#\#):not(#\#):not(#\#){resize:vertical}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-search-decoration{-webkit-appearance:none}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-datetime-edit{display:inline-flex}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-datetime-edit-fields-wrapper{padding:0}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-datetime-edit{padding-block-start:0;padding-block-end:0}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-datetime-edit-year-field{padding-block-start:0;padding-block-end:0}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-datetime-edit-month-field{padding-block-start:0;padding-block-end:0}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-datetime-edit-day-field{padding-block-start:0;padding-block-end:0}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-datetime-edit-hour-field{padding-block-start:0;padding-block-end:0}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-datetime-edit-minute-field{padding-block-start:0;padding-block-end:0}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-datetime-edit-second-field{padding-block-start:0;padding-block-end:0}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-datetime-edit-millisecond-field{padding-block-start:0;padding-block-end:0}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-datetime-edit-meridiem-field{padding-block-start:0;padding-block-end:0}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid:not(#\#):not(#\#):not(#\#):not(#\#){box-shadow:none}button:not(#\#):not(#\#):not(#\#):not(#\#),input:where([type=button],[type=reset],[type=submit]):not(#\#):not(#\#):not(#\#):not(#\#){-webkit-appearance:button;appearance:button}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-file-upload-button{-webkit-appearance:button;appearance:button}:not(#\#):not(#\#):not(#\#):not(#\#)::file-selector-button{-webkit-appearance:button;appearance:button}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-inner-spin-button{height:auto}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])):not(#\#){display:none!important}:not(#\#):not(#\#):not(#\#):not(#\#),:not(#\#):not(#\#):not(#\#):not(#\#):before,:not(#\#):not(#\#):not(#\#):not(#\#):after{min-width:0}body:not(#\#):not(#\#):not(#\#):not(#\#){overflow-wrap:break-word}img:not(#\#):not(#\#):not(#\#):not(#\#),svg:not(#\#):not(#\#):not(#\#):not(#\#),video:not(#\#):not(#\#):not(#\#):not(#\#),canvas:not(#\#):not(#\#):not(#\#):not(#\#),select:not(#\#):not(#\#):not(#\#):not(#\#),input:not(#\#):not(#\#):not(#\#):not(#\#),textarea:not(#\#):not(#\#):not(#\#):not(#\#){max-width:100%}.input:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.select:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding:.45rem .9rem;font-size:.875rem}.input-sm:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding:.25rem .7rem;font-size:.75rem}.pointer-events-auto:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){pointer-events:auto}.pointer-events-none:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){pointer-events:none}.visible:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){visibility:visible}.absolute:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){position:absolute}.fixed:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){position:fixed}.relative:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){position:relative}.static:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){position:static}.sticky:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){position:sticky}.inset-0:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){top:0;bottom:0;left:0;right:0}.inset-3:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){inset:calc(var(--spacing) * 3)}.inset-x-0:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){left:0;right:0}.inset-x-4:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){inset-inline:calc(var(--spacing) * 4)}.top-0:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){top:0}.top-1\/2:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){top:50%}.top-2:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){top:calc(var(--spacing) * 2)}.top-\[max\(6px\,env\(safe-area-inset-top\)\)\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){top:max(6px, env(safe-area-inset-top))}.top-\[max\(10px\,env\(safe-area-inset-top\)\)\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){top:max(10px, env(safe-area-inset-top))}.right-3:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){right:calc(var(--spacing) * 3)}.bottom-0:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){bottom:0}.bottom-3:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){bottom:calc(var(--spacing) * 3)}.bottom-14:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){bottom:calc(var(--spacing) * 14)}.bottom-16:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){bottom:calc(var(--spacing) * 16)}.left-1\/2:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){left:50%}.left-3:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){left:calc(var(--spacing) * 3)}.z-0:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){z-index:0}.z-10:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){z-index:10}.z-20:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){z-index:20}.z-30:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){z-index:30}.z-40:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){z-index:40}.z-\[200\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){z-index:200}.container:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:100%}@media (min-width:40rem){.container:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){max-width:40rem}}@media (min-width:48rem){.container:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){max-width:48rem}}@media (min-width:64rem){.container:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){max-width:64rem}}@media (min-width:80rem){.container:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){max-width:80rem}}@media (min-width:96rem){.container:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){max-width:96rem}}.mx-auto:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){margin-inline-start:auto;margin-inline-end:auto}.ms-\[8px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){margin-inline-start:8px}.me-\[8px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){margin-inline-end:8px}.mt-1:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){margin-top:var(--spacing)}.mt-3:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){margin-top:calc(var(--spacing) * 3)}.block:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){display:block}.flex:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){display:flex}.grid:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){display:grid}.hidden:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){display:none}.inline:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){display:inline}.inline-block:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){display:inline-block}.table:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){display:table}.aspect-video:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){aspect-ratio:var(--aspect-video)}.h-2\.5:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:calc(var(--spacing) * 2.5)}.h-3:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:calc(var(--spacing) * 3)}.h-7:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:calc(var(--spacing) * 7)}.h-8:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:calc(var(--spacing) * 8)}.h-10:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:calc(var(--spacing) * 10)}.h-11:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:calc(var(--spacing) * 11)}.h-12:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:calc(var(--spacing) * 12)}.h-14:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:calc(var(--spacing) * 14)}.h-24:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:calc(var(--spacing) * 24)}.h-\[24px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:24px}.h-\[26px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:26px}.h-\[32px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:32px}.h-\[36px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:36px}.h-\[44px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:44px}.h-\[52px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:52px}.h-\[54px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:54px}.h-\[124px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:124px}.h-full:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:100%}.min-h-\[100dvh\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){min-height:100dvh}.w-2\.5:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:calc(var(--spacing) * 2.5)}.w-3:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:calc(var(--spacing) * 3)}.w-7:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:calc(var(--spacing) * 7)}.w-8:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:calc(var(--spacing) * 8)}.w-10:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:calc(var(--spacing) * 10)}.w-11:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:calc(var(--spacing) * 11)}.w-12:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:calc(var(--spacing) * 12)}.w-14:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:calc(var(--spacing) * 14)}.w-24:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:calc(var(--spacing) * 24)}.w-\[36px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:36px}.w-\[44px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:44px}.w-\[52px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:52px}.w-\[54px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:54px}.w-\[56px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:56px}.w-\[76px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:76px}.w-\[84px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:84px}.w-\[124px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:124px}.w-\[min\(22rem\,calc\(100\%-2rem\)\)\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:min(22rem,100% - 2rem)}.w-\[min\(26rem\,100\%\)\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:min(26rem,100%)}.w-full:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:100%}.w-max:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:max-content}.max-w-\[14rem\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){max-width:14rem}.max-w-\[max\(20rem\,calc\(\(100dvh_-_22rem\)\*16\/9\)\)\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){max-width:max(20rem,177.778dvh - 39.1111rem)}.max-w-\[min\(24rem\,calc\(100\%-2rem\)\)\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){max-width:min(24rem,100% - 2rem)}.max-w-sm:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){max-width:var(--container-sm)}.min-w-0:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){min-width:0}.min-w-8:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){min-width:calc(var(--spacing) * 8)}.min-w-\[64px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){min-width:64px}.flex-1:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){flex:1}.-translate-x-1\/2:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\/2:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.transform:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){transform:var(--tw-rotate-x, ) var(--tw-rotate-y, ) var(--tw-rotate-z, ) var(--tw-skew-x, ) var(--tw-skew-y, )}.animate-ping:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){animation:var(--animate-ping)}.animate-pulse:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){animation:var(--animate-pulse)}.animate-spin:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){animation:var(--animate-spin)}.touch-none:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){touch-action:none}.resize:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){resize:both}.grid-cols-3:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){grid-template-columns:repeat(3,minmax(0,1fr))}.grid-rows-3:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){grid-template-rows:repeat(3,minmax(0,1fr))}.flex-col:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){flex-direction:column}.flex-wrap:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){flex-wrap:wrap}.items-center:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){align-items:center}.items-end:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){align-items:flex-end}.items-start:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){align-items:flex-start}.justify-center:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){justify-content:center}.gap-1:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){gap:var(--spacing)}.gap-1\.5:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){gap:calc(var(--spacing) * 1.5)}.gap-2:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){gap:calc(var(--spacing) * 2)}.gap-3:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){gap:calc(var(--spacing) * 3)}.gap-4:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){gap:calc(var(--spacing) * 4)}.gap-5:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){gap:calc(var(--spacing) * 5)}:where(.space-y-1>:not(:last-child)):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}.truncate:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){overflow:hidden}.rounded:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-radius:.25rem}.rounded-2xl:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-radius:var(--radius-2xl)}.rounded-\[var\(--radius-card\)\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-radius:var(--radius-card)}.rounded-full:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-radius:2147483647px}.rounded-lg:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-radius:var(--radius-lg)}.rounded-md:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-radius:var(--radius-md)}.border:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-style:var(--tw-border-style);border-width:1px}.border-2:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-style:var(--tw-border-style);border-width:2px}.border-\[1\.5px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-style:var(--tw-border-style);border-width:1.5px}.border-l:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-left-style:var(--tw-border-style);border-left-width:1px}.border-white:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:var(--color-white)}.border-white\/10:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.border-white\/10:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}.border-white\/15:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:#ffffff26}@supports (color:color-mix(in lab, red, red)){.border-white\/15:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:color-mix(in oklab, var(--color-white) 15%, transparent)}}.border-white\/20:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:#fff3}@supports (color:color-mix(in lab, red, red)){.border-white\/20:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:color-mix(in oklab, var(--color-white) 20%, transparent)}}.border-white\/30:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:#ffffff4d}@supports (color:color-mix(in lab, red, red)){.border-white\/30:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:color-mix(in oklab, var(--color-white) 30%, transparent)}}.border-white\/40:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:#fff6}@supports (color:color-mix(in lab, red, red)){.border-white\/40:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:color-mix(in oklab, var(--color-white) 40%, transparent)}}.border-white\/45:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:#ffffff73}@supports (color:color-mix(in lab, red, red)){.border-white\/45:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:color-mix(in oklab, var(--color-white) 45%, transparent)}}.border-white\/70:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:#ffffffb3}@supports (color:color-mix(in lab, red, red)){.border-white\/70:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:color-mix(in oklab, var(--color-white) 70%, transparent)}}.border-white\/80:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:#fffc}@supports (color:color-mix(in lab, red, red)){.border-white\/80:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:color-mix(in oklab, var(--color-white) 80%, transparent)}}.border-t-white:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-top-color:var(--color-white)}.bg-\[var\(--color-danger\,\#dc2626\)\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:var(--color-danger,#dc2626)}.bg-black:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:var(--color-black)}.bg-black\/40:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#0006}@supports (color:color-mix(in lab, red, red)){.bg-black\/40:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-black) 40%, transparent)}}.bg-black\/60:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#0009}@supports (color:color-mix(in lab, red, red)){.bg-black\/60:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-black) 60%, transparent)}}.bg-black\/70:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#000000b3}@supports (color:color-mix(in lab, red, red)){.bg-black\/70:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-black) 70%, transparent)}}.bg-neutral-900:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:var(--color-neutral-900)}.bg-neutral-900\/90:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#171717e6}@supports (color:color-mix(in lab, red, red)){.bg-neutral-900\/90:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-neutral-900) 90%, transparent)}}.bg-neutral-900\/95:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#171717f2}@supports (color:color-mix(in lab, red, red)){.bg-neutral-900\/95:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-neutral-900) 95%, transparent)}}.bg-transparent:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#0000}.bg-white:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:var(--color-white)}.bg-white\/10:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.bg-white\/10:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}.bg-white\/15:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#ffffff26}@supports (color:color-mix(in lab, red, red)){.bg-white\/15:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-white) 15%, transparent)}}.bg-white\/25:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#ffffff40}@supports (color:color-mix(in lab, red, red)){.bg-white\/25:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-white) 25%, transparent)}}.bg-white\/50:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#ffffff80}@supports (color:color-mix(in lab, red, red)){.bg-white\/50:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-white) 50%, transparent)}}.bg-white\/90:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#ffffffe6}@supports (color:color-mix(in lab, red, red)){.bg-white\/90:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-white) 90%, transparent)}}.bg-white\/\[0\.05\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#ffffff0d}@supports (color:color-mix(in lab, red, red)){.bg-white\/\[0\.05\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-white) 5%, transparent)}}.bg-white\/\[0\.12\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#ffffff1f}@supports (color:color-mix(in lab, red, red)){.bg-white\/\[0\.12\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-white) 12%, transparent)}}.bg-gradient-to-b:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-gradient-position:to bottom in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-black\/70:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-gradient-from:#000000b3}@supports (color:color-mix(in lab, red, red)){.from-black\/70:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-gradient-from:color-mix(in oklab, var(--color-black) 70%, transparent)}}.from-black\/70:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-transparent:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-gradient-to:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.object-contain:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){object-fit:contain}.object-cover:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){object-fit:cover}.object-fill:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){object-fit:fill}.p-0:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding:0}.p-3:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding:calc(var(--spacing) * 3)}.p-4:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding:calc(var(--spacing) * 4)}.p-6:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding:calc(var(--spacing) * 6)}.px-1\.5:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-inline:calc(var(--spacing) * 1.5)}.px-2:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-inline:calc(var(--spacing) * 2)}.px-2\.5:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-inline:calc(var(--spacing) * 2.5)}.px-3:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-inline:calc(var(--spacing) * 3)}.px-4:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-inline:calc(var(--spacing) * 4)}.px-6:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-inline:calc(var(--spacing) * 6)}.px-\[4px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-inline-start:4px;padding-inline-end:4px}.px-\[10px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-inline-start:10px;padding-inline-end:10px}.py-0\.5:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-block:calc(var(--spacing) * .5)}.py-1:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-block:var(--spacing)}.py-1\.5:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-block:calc(var(--spacing) * 1.5)}.py-2:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-block:calc(var(--spacing) * 2)}.py-2\.5:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-block:calc(var(--spacing) * 2.5)}.py-10:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-block:calc(var(--spacing) * 10)}.pt-\[max\(8px\,env\(safe-area-inset-top\)\)\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-top:max(8px, env(safe-area-inset-top))}.pb-5:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-bottom:calc(var(--spacing) * 5)}.pl-2:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-left:calc(var(--spacing) * 2)}.text-center:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){text-align:center}.text-base:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){font-size:10px}.text-\[11px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){font-size:11px}.text-\[13px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){font-size:13px}.leading-none:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-leading:1;line-height:1}.font-bold:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wide:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.whitespace-nowrap:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){white-space:nowrap}.text-amber-200\/90:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:#fee685e6}@supports (color:color-mix(in lab, red, red)){.text-amber-200\/90:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:color-mix(in oklab, var(--color-amber-200) 90%, transparent)}}.text-black:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:var(--color-black)}.text-emerald-300:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:var(--color-emerald-300)}.text-white:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:var(--color-white)}.text-white\/50:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:#ffffff80}@supports (color:color-mix(in lab, red, red)){.text-white\/50:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:color-mix(in oklab, var(--color-white) 50%, transparent)}}.text-white\/60:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:#fff9}@supports (color:color-mix(in lab, red, red)){.text-white\/60:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:color-mix(in oklab, var(--color-white) 60%, transparent)}}.text-white\/70:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:#ffffffb3}@supports (color:color-mix(in lab, red, red)){.text-white\/70:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:color-mix(in oklab, var(--color-white) 70%, transparent)}}.text-white\/75:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:#ffffffbf}@supports (color:color-mix(in lab, red, red)){.text-white\/75:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:color-mix(in oklab, var(--color-white) 75%, transparent)}}.text-white\/80:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:#fffc}@supports (color:color-mix(in lab, red, red)){.text-white\/80:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:color-mix(in oklab, var(--color-white) 80%, transparent)}}.text-white\/85:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:#ffffffd9}@supports (color:color-mix(in lab, red, red)){.text-white\/85:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:color-mix(in oklab, var(--color-white) 85%, transparent)}}.lowercase:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){text-transform:lowercase}.uppercase:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){text-transform:uppercase}.tabular-nums:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal, ) var(--tw-slashed-zero, ) var(--tw-numeric-figure, ) var(--tw-numeric-spacing, ) var(--tw-numeric-fraction, )}.opacity-0:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){opacity:0}.opacity-60:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){opacity:.6}.opacity-100:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){opacity:1}.shadow:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-2xl:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\[0_0_3px_rgba\(0\,0\,0\,0\.3\)\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-shadow:0 0 3px var(--tw-shadow-color,#0000004d);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\[0_0_3px_rgba\(0\,0\,0\,0\.35\)\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-shadow:0 0 3px var(--tw-shadow-color,#00000059);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\[var\(--shadow-2\)\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-shadow:var(--shadow-2);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-ring-shadow:var(--tw-ring-inset, ) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.blur:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-blur:blur(8px);filter:var(--tw-blur, ) var(--tw-brightness, ) var(--tw-contrast, ) var(--tw-grayscale, ) var(--tw-hue-rotate, ) var(--tw-invert, ) var(--tw-saturate, ) var(--tw-sepia, ) var(--tw-drop-shadow, )}.filter:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){filter:var(--tw-blur, ) var(--tw-brightness, ) var(--tw-contrast, ) var(--tw-grayscale, ) var(--tw-hue-rotate, ) var(--tw-invert, ) var(--tw-saturate, ) var(--tw-sepia, ) var(--tw-drop-shadow, )}.backdrop-blur-md:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, );backdrop-filter:var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, )}.backdrop-blur-sm:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, );backdrop-filter:var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, )}.transition-colors:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-75:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-duration:75ms;transition-duration:75ms}.duration-300:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-duration:.3s;transition-duration:.3s}.outline-none:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-outline-style:none;outline-style:none}.select-none:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){-webkit-user-select:none;user-select:none}.\[-webkit-touch-callout\:none\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){-webkit-touch-callout:none}.\[animation-duration\:2\.4s\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){animation-duration:2.4s}.\[text-shadow\:0_1px_2px_rgba\(0\,0\,0\,0\.6\)\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){text-shadow:0 1px 2px #0009}@media (hover:hover){.hover\:bg-white\/10:hover:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.hover\:bg-white\/10:hover:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}.hover\:bg-white\/20:hover:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#fff3}@supports (color:color-mix(in lab, red, red)){.hover\:bg-white\/20:hover:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-white) 20%, transparent)}}.hover\:bg-white\/25:hover:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#ffffff40}@supports (color:color-mix(in lab, red, red)){.hover\:bg-white\/25:hover:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-white) 25%, transparent)}}.hover\:opacity-100:hover:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){opacity:1}}.focus\:border-white\/50:focus:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:#ffffff80}@supports (color:color-mix(in lab, red, red)){.focus\:border-white\/50:focus:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:color-mix(in oklab, var(--color-white) 50%, transparent)}}.focus-visible\:opacity-100:focus-visible:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){opacity:1}.disabled\:opacity-40:disabled:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){opacity:.4}:root:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--color-surface:#ffffff0a;--color-surface-2:#ffffff0f;--color-surface-3:#ffffff1a;--color-surface-raised:#ffffff12;--color-float:#2c2c2ef5;--color-canvas:#ffffff09;--glass-edge:#ffffff1a;--color-pill:#ffffff1f;--color-border:#ffffff1a;--color-border-strong:#fff3;--color-muted:#a1a1a8;--color-text:#f5f5f7;--color-accent:#4da3ff;--color-accent-contrast:#fff;--color-accent-soft:#0a84ff2e;--color-accent-bright:#3b9bff;--color-accent-pink:#3b9bff;--accent-fill:linear-gradient(#0a72e8, #0a72e8);--accent-glow:0 1px 2px #0000004d;--color-good:#32d074;--color-good-soft:#32d07424;--color-warn:#ffb340;--color-warn-soft:#ffb34024;--color-bad:#ff6961;--color-bad-soft:#ff696124;--color-ps4:#8fb0ff;--color-ps4-soft:#8fb0ff26;--color-ps5:#c3a2ff;--color-ps5-soft:#c3a2ff26;--shadow-logo:0 12px 40px -10px #00000080;--shadow-1:0 1px 2px #0000002e;--shadow-2:0 10px 30px -10px #0000008c, 0 0 0 .5px #0006;--shadow-3:0 24px 70px -20px #000000b3, 0 0 0 .5px #0006;--edge-highlight:inset 0 1px 0 #ffffff0d;--overlay-scrim:#00000073;--atmosphere-base:#1e1e20;--atmosphere:none;--dot-color:transparent;--glass-blur:24px;--color-accent-glow:#0a84ff40;--radius-control:999px;--radius-field:.5rem;--radius-card:.875rem;--radius-panel:1rem;--radius-canvas:0px;--content-max:none}:root:is([data-theme=light],[data-theme=peach]):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light;--color-surface:#00000008;--color-surface-2:#fff;--color-surface-3:#00000012;--color-surface-raised:#fff;--color-float:#fffffff7;--color-canvas:#00000006;--glass-edge:#00000014;--color-pill:#00000014;--color-border:#0000001a;--color-border-strong:#0003;--color-muted:#5f5f66;--color-text:#1d1d1f;--color-accent:#0064d2;--color-accent-contrast:#fff;--color-accent-soft:#0071e31f;--color-accent-bright:#0071e3;--color-accent-pink:#0071e3;--accent-fill:linear-gradient(#0071e3, #0071e3);--accent-glow:0 1px 2px #0000001f;--color-good:#1a7f43;--color-good-soft:#1a7f431f;--color-warn:#8a5200;--color-warn-soft:#d68c1e29;--color-bad:#c4252f;--color-bad-soft:#d700151a;--color-ps4:#2a55b8;--color-ps4-soft:#2a55b81f;--color-ps5:#6b3fc4;--color-ps5-soft:#6b3fc41f;--shadow-logo:0 12px 40px -10px #0003;--shadow-1:0 1px 2px #0000000d;--shadow-2:0 10px 30px -10px #00000038, 0 0 0 .5px #0000001f;--shadow-3:0 24px 70px -20px #0000004d, 0 0 0 .5px #0000001f;--edge-highlight:inset 0 0 0 0 transparent;--overlay-scrim:#0003;--atmosphere-base:#f5f5f7;--atmosphere:none;--dot-color:transparent;--color-accent-glow:#0071e338}:root[data-theme=peach]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--color-surface:#783c140a;--color-surface-3:#783c1414;--color-float:#fffcf9f7;--color-canvas:#783c1408;--glass-edge:#5a2d0f1a;--color-pill:#c2410c1a;--color-border:#5a2d0f1f;--color-border-strong:#5a2d0f3d;--color-muted:#6e5244;--color-text:#2b1d16;--color-accent:#b93d0a;--color-accent-soft:#ea580c1f;--color-accent-bright:#c2410c;--color-accent-pink:#c2410c;--accent-fill:linear-gradient(#c2410c, #c2410c);--color-accent-glow:#ea580c38;--shadow-logo:0 12px 40px -10px #5a2d0f38;--shadow-1:0 1px 2px #5a2d0f0f;--shadow-2:0 10px 30px -10px #5a2d0f38, 0 0 0 .5px #5a2d0f1f;--shadow-3:0 24px 70px -20px #5a2d0f4d, 0 0 0 .5px #5a2d0f1f;--overlay-scrim:#3c1e0a38;--atmosphere-base:#fbf4ee}:root[data-theme=oled]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--color-surface:#ffffff0d;--color-surface-2:#ffffff12;--color-surface-raised:#ffffff14;--color-float:#141416fa;--color-canvas:transparent;--shadow-logo:none;--shadow-1:none;--shadow-2:0 0 0 .5px #ffffff24;--shadow-3:0 0 0 .5px #ffffff29;--edge-highlight:inset 0 0 0 0 transparent;--overlay-scrim:#000000b3;--atmosphere-base:#000;--glass-blur:0px}:root[data-contrast=high]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--color-surface:#1c1c1e;--color-surface-2:#232325;--color-surface-3:#3a3a3c;--color-surface-raised:#2c2c2e;--color-float:#2c2c2e;--color-canvas:#161618;--glass-edge:#fff6;--glass-blur:0px}:root:is([data-theme=light],[data-theme=peach])[data-contrast=high]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--color-surface:#fff;--color-surface-2:#fff;--color-surface-3:#e5e5ea;--color-surface-raised:#fff;--color-float:#fff;--color-canvas:#f5f5f7;--glass-edge:#00000073;--color-border:#00000059;--color-border-strong:#0009}:root[data-theme=oled][data-contrast=high]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--color-surface:#000;--color-surface-2:#121214;--color-surface-raised:#1a1a1c;--color-float:#1a1a1c;--color-canvas:#000}@media (prefers-reduced-transparency:reduce){:root:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--glass-blur:0px;--color-surface-2:#2c2c2ef5;--color-surface-raised:#323234f5;--color-canvas:#1e1e20f5}:root:is([data-theme=light],[data-theme=peach]):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--color-surface-2:#ffffffe6;--color-surface-raised:#ffffffeb;--color-canvas:#ffffffbf}:root[data-theme=oled]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--color-surface-2:#121214fa;--color-surface-raised:#1a1a1cfa;--color-canvas:transparent}}:root[data-transparency=reduced]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--glass-blur:0px;--color-surface-2:#2c2c2ef5;--color-surface-raised:#323234f5;--color-canvas:#1e1e20f5}:root[data-transparency=reduced]:is([data-theme=light],[data-theme=peach]):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--color-surface-2:#ffffffe6;--color-surface-raised:#ffffffeb;--color-canvas:#ffffffbf}:root[data-transparency=reduced][data-theme=oled]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--color-surface-2:#121214fa;--color-surface-raised:#1a1a1cfa;--color-canvas:transparent}:root[data-motion=reduced]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),:root[data-motion=none]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--glass-blur:0px}html:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),body:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),#root:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:100dvh;color:var(--color-text);font-family:var(--font-sans);font-size:var(--ui-base-size,18px);text-size-adjust:100%;-webkit-font-smoothing:antialiased;font-variant-numeric:tabular-nums;margin:0;overflow:hidden}body:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){position:relative}html:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:var(--atmosphere-base);background-image:var(--atmosphere);background-repeat:no-repeat;background-size:100% 100%;background-attachment:fixed}body:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),#root:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:0 0}body:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){overscroll-behavior-y:contain}.app-page:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:100%;max-width:var(--content-max);margin-inline-start:auto;margin-inline-end:auto;padding:1.75rem clamp(2rem,2.5vw,3rem) 2.5rem}.card-flow:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){grid-template-columns:repeat(auto-fill,minmax(min(100%,44rem),1fr));align-items:start;gap:.75rem;display:grid}.app-page-tabs:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:100%;max-width:var(--content-max);margin-inline-start:auto;margin-inline-end:auto;padding:1.25rem clamp(2rem,2.5vw,3rem) 0}.glass:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-surface-2);border:1px solid var(--glass-edge);box-shadow:var(--edge-highlight), var(--shadow-1);-webkit-backdrop-filter:blur(var(--glass-blur)) saturate(1.4);backdrop-filter:blur(var(--glass-blur)) saturate(1.4)}.glass-float:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-float);border:1px solid var(--glass-edge);box-shadow:var(--edge-highlight), var(--shadow-2);-webkit-backdrop-filter:blur(var(--glass-blur)) saturate(1.4);backdrop-filter:blur(var(--glass-blur)) saturate(1.4)}.float-solid:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:linear-gradient(var(--color-float), var(--color-float)), var(--atmosphere-base);border:1px solid var(--glass-edge)}.surface-panel:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border:1px solid var(--glass-edge);border-radius:var(--radius-panel);background:var(--color-surface-raised);box-shadow:var(--edge-highlight), var(--shadow-1)}.dot-texture:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-image:radial-gradient(var(--dot-color) 1.2px, transparent 1.6px);background-size:12px 12px;-webkit-mask-image:radial-gradient(closest-side,#000 30%,#0000 100%);mask-image:radial-gradient(closest-side,#000 30%,#0000 100%)}.fade-x:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){-webkit-mask-image:linear-gradient(to right, transparent, #000 var(--fade-start,0px), #000 calc(100% - var(--fade-end,0px)), transparent);-webkit-mask-image:linear-gradient(to right, transparent, #000 var(--fade-start,0px), #000 calc(100% - var(--fade-end,0px)), transparent);-webkit-mask-image:linear-gradient(to right, transparent, #000 var(--fade-start,0px), #000 calc(100% - var(--fade-end,0px)), transparent);-webkit-mask-image:linear-gradient(to right, transparent, #000 var(--fade-start,0px), #000 calc(100% - var(--fade-end,0px)), transparent);mask-image:linear-gradient(to right, transparent, #000 var(--fade-start,0px), #000 calc(100% - var(--fade-end,0px)), transparent)}[dir=rtl]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .fade-x{-webkit-mask-image:linear-gradient(to left, transparent, #000 var(--fade-start,0px), #000 calc(100% - var(--fade-end,0px)), transparent);-webkit-mask-image:linear-gradient(to left, transparent, #000 var(--fade-start,0px), #000 calc(100% - var(--fade-end,0px)), transparent);-webkit-mask-image:linear-gradient(to left, transparent, #000 var(--fade-start,0px), #000 calc(100% - var(--fade-end,0px)), transparent);-webkit-mask-image:linear-gradient(to left, transparent, #000 var(--fade-start,0px), #000 calc(100% - var(--fade-end,0px)), transparent);mask-image:linear-gradient(to left, transparent, #000 var(--fade-start,0px), #000 calc(100% - var(--fade-end,0px)), transparent)}.icon-orb-button:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border:1px solid var(--glass-edge);background:var(--color-surface-raised);width:2.75rem;height:2.75rem;color:var(--color-text);box-shadow:var(--edge-highlight), var(--shadow-1);border-radius:9999px;flex:none;place-items:center;transition:transform .14s,background-color .14s,box-shadow .14s;display:inline-grid}.icon-orb-button:hover:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-float);transform:translateY(-1px)}.action-tile:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-radius:var(--radius-card);border:1px solid var(--glass-edge);background:var(--color-surface-raised);min-height:5.5rem;box-shadow:var(--edge-highlight), var(--shadow-1);padding:1rem 1.125rem;transition:transform .16s,background-color .16s,box-shadow .16s;display:block;container-type:inline-size}.action-tile:not([aria-disabled=true]):hover:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-float);box-shadow:var(--edge-highlight), var(--shadow-2);transform:translateY(-2px)}.action-tile[aria-disabled=true]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){cursor:not-allowed;opacity:.6}.action-tile-inner:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){align-items:center;gap:.875rem;min-height:3.5rem;display:flex}@container (width<=15rem){.action-tile-inner:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){flex-direction:column;align-items:flex-start;gap:.625rem;min-height:0}.action-tile-inner:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .action-tile-chevron{display:none}}@media (max-width:639px){.action-tile:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){min-height:0;padding:.875rem}}.metric-row:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-bottom:1px solid var(--color-border);justify-content:space-between;align-items:center;gap:1rem;min-height:2.25rem;font-size:.8125rem;display:flex}.metric-row:last-child:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-bottom:0}.icon-disc:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-accent-soft);width:2rem;height:2rem;color:var(--color-accent-bright);border-radius:9999px;flex:none;place-items:center;display:inline-grid}.chip:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border:1px solid var(--color-border-strong);color:var(--color-text);white-space:nowrap;border-radius:9999px;align-items:center;transition:background-color .14s,border-color .14s,box-shadow .14s;display:inline-flex}.chip:hover:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-surface)}.chip[aria-pressed=true]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.chip[aria-checked=true]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.chip[aria-selected=true]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.chip.is-active:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-pill);border-color:#0000;font-weight:600}@media (min-width:768px){.shell-sidebar:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-canvas);border-inline-end:1px solid var(--color-border)}}.shell-safe-x:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-left:var(--safe-left);padding-right:var(--safe-right)}@media (min-width:768px){.shell-sidebar:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-top:var(--safe-top)}}@media (min-width:768px) and (pointer:coarse) and (orientation:landscape) and (max-height:520px){.shell-statusbar{display:none!important}.shell-safe-x:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-bottom:var(--safe-bottom)}.shell-sidebar:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)>:first-child{height:3.5rem}}.nav-pill:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:var(--color-text)}.nav-pill:hover:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-surface)}.nav-pill.active:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.nav-pill[aria-current=page]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-pill);font-weight:600}.nav-pill:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .nav-pill-icon{color:var(--color-muted)}.nav-pill.active:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .nav-pill-icon,.nav-pill[aria-current=page]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .nav-pill-icon{color:var(--color-accent-bright)}:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){box-sizing:border-box}:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::selection{background:var(--color-accent);color:var(--color-accent-contrast)}:where(a,button,[role=button],[role=menuitem],[role=tab],[tabindex]):focus-visible:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){outline:2px solid var(--color-accent);outline-offset:2px}:where(input,select,textarea):focus-visible:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){outline:2px solid var(--color-accent);outline-offset:1px}:root[data-tv="1"]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) :where(a,button,input,select,textarea,summary,[role=button],[role=menuitem],[role=tab],[tabindex]):focus{outline:3px solid var(--color-accent);outline-offset:3px}:root[data-tv="1"]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) [data-join-ui] :where(a,button,input,select,textarea,summary,[role=button],[tabindex]):focus{outline-offset:3px;outline:3px solid #fff}[data-join-ui]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) :where(a,button,input,select,textarea,summary,[role=button],[tabindex]):focus-visible{outline-offset:3px;outline:3px solid #fff}:root[data-tv="1"]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) [data-join-ui] :where(a,button,input,select,textarea,summary,[role=button],[tabindex]):focus{outline-width:4px}:is([data-join-game]:focus,[data-join-game]:focus-visible){outline:none!important}:is(.input:focus-visible:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.select:focus-visible:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.field-quiet:focus-visible:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)){outline:none}.field-shell:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){transition:box-shadow .14s,background-color .14s}.field-shell:has(.field-quiet:focus-visible):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){box-shadow:inset 0 -2px 0 var(--color-accent)}.field-shell.rounded-full:has(.field-quiet:focus-visible):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){box-shadow:0 0 0 2px var(--color-accent), 0 0 0 5px var(--color-accent-soft)}.field-shell-ring:has(.field-quiet:focus-visible):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){box-shadow:0 0 0 2px var(--color-accent), 0 0 0 5px var(--color-accent-soft)}.scrim:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--overlay-scrim);-webkit-backdrop-filter:blur(calc(var(--glass-blur) / 4));backdrop-filter:blur(calc(var(--glass-blur) / 4))}.glass-bar:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-float);-webkit-backdrop-filter:blur(var(--glass-blur)) saturate(1.4);backdrop-filter:blur(var(--glass-blur)) saturate(1.4)}:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){scrollbar-width:thin;scrollbar-color:var(--color-border-strong) transparent}:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-scrollbar{width:10px;height:10px}:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-scrollbar-track{background:0 0}:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-scrollbar-thumb{background:var(--color-border-strong);background-clip:padding-box;border:2px solid #0000;border-radius:8px}:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-scrollbar-thumb:hover{background:var(--color-muted);background-clip:padding-box}@keyframes ps-fade-in{0%{opacity:0}to{opacity:1}}@keyframes ps-pop-in{0%{opacity:0;transform:translateY(8px)scale(.98)}to{opacity:1;transform:translateY(0)scale(1)}}@keyframes ps-rise-in{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}@keyframes ps-drawer-in{0%{transform:translate(-100%)}to{transform:translate(0)}}@keyframes ps-sheet-in{0%{opacity:0;transform:translateY(24px)}to{opacity:1;transform:translateY(0)}}@keyframes ps-side-in{0%{opacity:0;transform:translate(24px)}to{opacity:1;transform:translate(0)}}@keyframes ps-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@keyframes ps-soft-pulse{0%,to{opacity:1}50%{opacity:.45}}.anim-scrim:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){animation:.15s ease-out both ps-fade-in}.anim-pop:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){animation:.18s cubic-bezier(.2,.8,.2,1) both ps-pop-in}.anim-rise:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){animation:.14s cubic-bezier(.2,.8,.2,1) both ps-rise-in}.anim-screen:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){animation:.2s cubic-bezier(.2,.8,.2,1) backwards ps-rise-in}.anim-drawer:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){animation:.22s cubic-bezier(.2,.8,.2,1) both ps-drawer-in}.anim-sheet:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){animation:.22s cubic-bezier(.2,.8,.2,1) both ps-sheet-in}.anim-side:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){animation:.2s cubic-bezier(.2,.8,.2,1) both ps-side-in}.anim-sheet-up:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){animation:.22s cubic-bezier(.2,.8,.2,1) both ps-sheet-in}.anim-skeleton:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:linear-gradient(100deg, var(--color-surface-3) 40%, var(--color-surface-raised) 50%, var(--color-surface-3) 60%);background-size:200% 100%;animation:2.2s linear infinite ps-shimmer}.anim-status-pulse:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){animation:2.4s ease-in-out infinite ps-soft-pulse}.elev-1:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){box-shadow:var(--edge-highlight), var(--shadow-1)}@media (max-width:767px){.app-page:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding:1rem}.app-page-tabs:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding:1rem 1rem 0}}.elev-2:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){box-shadow:var(--edge-highlight), var(--shadow-2)}.elev-3:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){box-shadow:var(--edge-highlight), var(--shadow-3)}.support-button:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:#fff;background-image:linear-gradient(135deg,#ff3d6e 0%,#ff6a4d 55%,#ff9a3c 100%);transition:transform .16s cubic-bezier(.2,.8,.2,1),box-shadow .16s,filter .16s;box-shadow:0 6px 18px -6px #ff3d6ea6,inset 0 1px #ffffff40}.support-button:hover:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){filter:brightness(1.06);transform:translateY(-1px);box-shadow:0 10px 24px -8px #ff3d6ebf,inset 0 1px #ffffff40}.support-button:active:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){transform:translateY(0)}.support-button:focus-visible:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){outline-offset:2px;outline:2px solid #ff3d6e}.support-heart:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){transform-origin:50%;animation:2.8s ease-in-out infinite support-beat}@keyframes support-beat{0%,70%,to{transform:scale(1)}76%{transform:scale(1.22)}82%{transform:scale(1)}88%{transform:scale(1.14)}}:root[data-motion=none]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .support-heart{animation:none}.fs-reveal:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){outline:2px solid var(--color-accent);outline-offset:-1px;box-shadow:inset 0 0 0 999px var(--color-accent)}@supports (color:color-mix(in lab, red, red)){.fs-reveal:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){box-shadow:inset 0 0 0 999px color-mix(in srgb, var(--color-accent) 16%, transparent)}}@keyframes fs-reveal{0%,45%{outline-color:var(--color-accent);box-shadow:inset 0 0 0 999px color-mix(in srgb, var(--color-accent) 16%, transparent)}to{outline-color:#0000;box-shadow:inset 0 0 0 999px #0000}}@media (prefers-reduced-motion:no-preference){:root:not([data-motion=none]):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .fs-reveal{animation:2s ease-out forwards fs-reveal}}@media (prefers-reduced-motion:reduce){.anim-scrim:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.anim-pop:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.support-heart:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.anim-rise:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.anim-screen:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.anim-drawer:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.anim-sheet:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.anim-sheet-up:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.anim-side:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.anim-skeleton:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.anim-status-pulse:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){animation:none}*,:before,:after{transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}:root[data-motion=reduced]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .anim-pop{animation-duration:90ms}:root[data-motion=reduced]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .anim-screen,:root[data-motion=none]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .anim-scrim,:root[data-motion=none]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .anim-pop,:root[data-motion=none]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .anim-rise,:root[data-motion=none]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .anim-screen,:root[data-motion=none]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .anim-drawer,:root[data-motion=none]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .anim-sheet,:root[data-motion=none]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .anim-sheet-up,:root[data-motion=none]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .anim-side,:root[data-motion=none]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .anim-skeleton,:root[data-motion=none]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .anim-status-pulse{animation:none}:root[data-motion=none] *,:root[data-motion=none] :before,:root[data-motion=none] :after{transition-duration:.01ms!important}:root[data-contrast=high]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--color-border:var(--color-border-strong);--color-muted:var(--color-text)}:root[data-contrast=high]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) :where(a,button,[role=button],[role=menuitem],[role=tab],[tabindex]):focus-visible{outline-offset:4px;outline-width:3px}:root:is(:lang(ar),:lang(fa)):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--font-sans:system-ui, "SF Arabic", "Noto Sans Arabic", "Geeza Pro", "Segoe UI", Tahoma, sans-serif}:root:is(:lang(ar),:lang(fa)):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) :not(.font-mono,code,kbd,pre,input,textarea){letter-spacing:normal}:root:is(:lang(ar),:lang(fa)):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .uppercase{text-transform:none;font-size:.8125rem}:root[data-dyslexia=true]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) body,:root[data-dyslexia=true]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) #root{letter-spacing:.01em;font-family:Atkinson Hyperlegible,OpenDyslexic,system-ui,-apple-system,sans-serif;line-height:1.5}.sr-only:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.skip-link:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){z-index:100;background:var(--color-accent);color:var(--color-accent-contrast);border-radius:0 0 .375rem;padding:.5rem 1rem;font-size:.875rem;font-weight:500;transition:top .15s;position:absolute;top:-100%;left:0}.skip-link:focus:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){outline:2px solid var(--color-accent);outline-offset:2px;top:0}.safe-top:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-top:var(--safe-top)}:root:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--safe-bottom:max(env(safe-area-inset-bottom), var(--nav-inset-bottom,0px));--safe-top:max(env(safe-area-inset-top), var(--sys-inset-top,0px));--safe-left:max(env(safe-area-inset-left), var(--sys-inset-left,0px));--safe-right:max(env(safe-area-inset-right), var(--sys-inset-right,0px))}.safe-bottom:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-bottom:var(--safe-bottom)}html[data-keyboard] [data-bottom-nav],html[data-keyboard] [data-testid=activity-pill]{display:none!important}@media not all and (min-width:40rem),(pointer:coarse) and (max-height:520px){html[data-selection-bar] [data-bottom-nav]{display:none!important}[data-top-bar]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .icon-orb-button{width:44px;height:44px}}@media (max-width:767.98px){html[data-screen-bar]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) [data-top-bar]{min-height:0;padding-top:var(--safe-top);padding-bottom:0}html[data-screen-bar]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) [data-top-bar]>*{display:none}}.tab-rail-probe:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){visibility:hidden;pointer-events:none;padding-left:var(--safe-left);padding-right:var(--safe-right);position:fixed}@media (max-width:767px){[data-bottom-nav][data-rail]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){top:max(calc(var(--safe-top) + 9.75rem), calc(100dvh - var(--safe-bottom) - .6rem - 24rem));border-radius:2rem;flex-direction:column;gap:0;height:auto}[data-bottom-nav][data-rail=right]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:calc(var(--safe-right) - .75rem);left:auto;right:.375rem}[data-bottom-nav][data-rail=left]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:calc(var(--safe-left) - .75rem);left:.375rem;right:auto}html[data-tab-rail]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) [data-testid=activity-pill]{bottom:calc(var(--safe-bottom) + .6rem)}html[data-tab-rail]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .tab-room{padding-bottom:calc(1rem + var(--safe-bottom))}}.safe-left:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-left:var(--safe-left)}.safe-right:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-right:var(--safe-right)}.safe-pad:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-top:var(--safe-top);padding-bottom:var(--safe-bottom);padding-left:var(--safe-left);padding-right:var(--safe-right)}.h-bottom-nav:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:calc(56px + var(--safe-bottom))}.h-top-bar:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){min-height:calc(44px + var(--safe-top));padding-left:calc(var(--safe-left) + 1rem);padding-right:calc(var(--safe-right) + 1rem)}@media (max-width:767.98px){.panel-sheet-x:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){left:max(.5rem, var(--safe-left));right:max(.5rem, var(--safe-right))}}.modal-safe-x:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-left:max(1rem, var(--safe-left));padding-right:max(1rem, var(--safe-right))}@media (max-width:639.98px){.modal-safe-x:has(>.anim-sheet-up):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-left:var(--safe-left);padding-right:var(--safe-right)}}@media (pointer:coarse){button:not([role=switch]):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),[role=button]:not([role=switch]):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),[role=tab]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),[role=menuitem]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),[role=menuitemcheckbox]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),[role=menuitemradio]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),[role=option]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),[role=treeitem]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),select:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),textarea:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),input:not([type=checkbox]):not([type=radio]):not([type=range]):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){min-height:44px}}input[type=checkbox]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),input[type=radio]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:1.15rem;height:1.15rem;accent-color:var(--color-accent);cursor:pointer}@media (pointer:coarse){input[type=checkbox]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),input[type=radio]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:1.4rem;height:1.4rem}}.input:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-radius:var(--radius-control);border:1px solid var(--glass-edge);background:var(--color-surface-raised);width:100%;color:var(--color-text);transition:border-color .15s,box-shadow .15s;box-shadow:inset 0 1px 2px #0000000f}:root:is([data-theme=light],[data-theme=peach]):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .input,:root:is([data-theme=light],[data-theme=peach]):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .select{border-color:#00000024}textarea.input:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-radius:var(--radius-field)}.input:focus:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.select:focus:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:var(--color-accent);box-shadow:0 0 0 3px var(--color-accent-soft)}.input:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::placeholder{color:var(--color-muted)}:root[dir=rtl]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) :where(.font-mono,code,kbd,samp,pre,.tabular-nums){unicode-bidi:plaintext}:where(input,textarea):placeholder-shown:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){text-overflow:ellipsis}@media (max-width:767px){.input:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.input-sm:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.select:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){min-height:2.75rem}}.select:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-radius:var(--radius-control);border:1px solid var(--glass-edge);background:var(--color-surface-raised);width:100%;color:var(--color-text);transition:border-color .15s,box-shadow .15s}select:not([multiple]):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){-webkit-appearance:none;appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-position:right .75rem center;background-repeat:no-repeat;padding-inline-end:2rem}[dir=rtl]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) select:not([multiple]){background-position:.75rem}.select:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) option,select:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) option{background:var(--color-float);color:var(--color-text)}.radio:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.checkbox:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){accent-color:var(--color-accent);cursor:pointer}.badge:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-radius:9999px;align-items:center;gap:.25rem;padding:.15rem .6rem;font-size:.75rem;font-weight:500;line-height:1;display:inline-flex}.badge-sm:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding:.0625rem .375rem;font-size:.6875rem}.badge-success:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-good-soft);color:var(--color-good)}.badge-warn:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-warn-soft);color:var(--color-warn)}.badge-bad:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-bad-soft);color:var(--color-bad)}.list-row-contain-sm:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){content-visibility:auto;contain-intrinsic-size:auto 2.25rem}.rp-place:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){container-type:size}.rp-mini:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--mini-top:calc(var(--safe-top) + 4.25rem);--mini-bottom:calc(var(--safe-bottom) + 5.5rem);--mini-left:calc(var(--safe-left) + .75rem);--mini-right:calc(var(--safe-right) + .75rem);width:min(max(140px,40vw),100vw - 1.5rem)}@media (min-width:768px){.rp-mini:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--mini-top:5rem;--mini-bottom:3rem;--mini-left:1rem;--mini-right:1rem;width:min(320px,100vw - 2rem)}}.rp-mini[data-corner=tl]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){top:var(--mini-top);left:var(--mini-left)}.rp-mini[data-corner=tr]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){top:var(--mini-top);right:var(--mini-right)}.rp-mini[data-corner=bl]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){bottom:var(--mini-bottom);left:var(--mini-left)}.rp-mini[data-corner=br]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){bottom:var(--mini-bottom);right:var(--mini-right)}.rp-picture:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){flex:none;width:100%;max-width:none;height:100%;max-height:none;display:block}@supports (width:1cqw){.rp-picture:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){object-fit:fill}.rp-picture[data-fit=fit]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:min(100cqw, 100cqh * var(--rp-shape));height:min(100cqh, 100cqw / var(--rp-shape))}.rp-picture[data-fit=fill]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:max(100cqw, 100cqh * var(--rp-shape));height:max(100cqh, 100cqw / var(--rp-shape))}.rp-picture[data-fit=stretch]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:100cqw;height:100cqh}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes ping{75%,to{opacity:0;transform:scale(2)}}@keyframes pulse{50%{opacity:.5}} +@supports (((-webkit-hyphens:none)) and (not (margin-trim:block))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}}:root:not(#\#):not(#\#),:host:not(#\#):not(#\#){--font-sans:system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Helvetica, Arial, sans-serif;--font-mono:ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;--color-amber-200:color(display-p3 .979824 .904554 .57325);--color-emerald-300:color(display-p3 .524941 .903425 .722352);--color-neutral-900:color(display-p3 .0905274 .0905274 .0905274);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-sm:24rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-wide:.025em;--tracking-wider:.05em;--radius-md:.375rem;--radius-lg:.5rem;--radius-2xl:1rem;--animate-spin:spin 1s linear infinite;--animate-ping:ping 1s cubic-bezier(0, 0, .2, 1) infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-sm:8px;--blur-md:12px;--aspect-video:16 / 9;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}@supports (color:lab(0% 0 0)){:root:not(#\#):not(#\#),:host:not(#\#):not(#\#){--color-amber-200:lab(91.7203% -.505269 49.9084);--color-emerald-300:lab(83.9203% -48.7124 13.8849);--color-neutral-900:lab(7.78201% -.0000149012 0)}}:not(#\#):not(#\#):not(#\#):not(#\#),:not(#\#):not(#\#):not(#\#):not(#\#):after,:not(#\#):not(#\#):not(#\#):not(#\#):before{box-sizing:border-box;border:0 solid;margin:0;padding:0}:not(#\#):not(#\#):not(#\#):not(#\#)::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-file-upload-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}:not(#\#):not(#\#):not(#\#):not(#\#)::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html:not(#\#):not(#\#):not(#\#):not(#\#),:host:not(#\#):not(#\#):not(#\#):not(#\#){-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr:not(#\#):not(#\#):not(#\#):not(#\#){height:0;color:inherit;border-top-width:1px}abbr:where([title]):not(#\#):not(#\#):not(#\#):not(#\#){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1:not(#\#):not(#\#):not(#\#):not(#\#),h2:not(#\#):not(#\#):not(#\#):not(#\#),h3:not(#\#):not(#\#):not(#\#):not(#\#),h4:not(#\#):not(#\#):not(#\#):not(#\#),h5:not(#\#):not(#\#):not(#\#):not(#\#),h6:not(#\#):not(#\#):not(#\#):not(#\#){font-size:inherit;font-weight:inherit}a:not(#\#):not(#\#):not(#\#):not(#\#){color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b:not(#\#):not(#\#):not(#\#):not(#\#),strong:not(#\#):not(#\#):not(#\#):not(#\#){font-weight:bolder}code:not(#\#):not(#\#):not(#\#):not(#\#),kbd:not(#\#):not(#\#):not(#\#):not(#\#),samp:not(#\#):not(#\#):not(#\#):not(#\#),pre:not(#\#):not(#\#):not(#\#):not(#\#){font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small:not(#\#):not(#\#):not(#\#):not(#\#){font-size:80%}sub:not(#\#):not(#\#):not(#\#):not(#\#),sup:not(#\#):not(#\#):not(#\#):not(#\#){vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub:not(#\#):not(#\#):not(#\#):not(#\#){bottom:-.25em}sup:not(#\#):not(#\#):not(#\#):not(#\#){top:-.5em}table:not(#\#):not(#\#):not(#\#):not(#\#){text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)):not(#\#):not(#\#):not(#\#):not(#\#){outline:auto}progress:not(#\#):not(#\#):not(#\#):not(#\#){vertical-align:baseline}summary:not(#\#):not(#\#):not(#\#):not(#\#){display:list-item}ol:not(#\#):not(#\#):not(#\#):not(#\#),ul:not(#\#):not(#\#):not(#\#):not(#\#),menu:not(#\#):not(#\#):not(#\#):not(#\#){list-style:none}img:not(#\#):not(#\#):not(#\#):not(#\#),svg:not(#\#):not(#\#):not(#\#):not(#\#),video:not(#\#):not(#\#):not(#\#):not(#\#),canvas:not(#\#):not(#\#):not(#\#):not(#\#),audio:not(#\#):not(#\#):not(#\#):not(#\#),iframe:not(#\#):not(#\#):not(#\#):not(#\#),embed:not(#\#):not(#\#):not(#\#):not(#\#),object:not(#\#):not(#\#):not(#\#):not(#\#){vertical-align:middle;display:block}img:not(#\#):not(#\#):not(#\#):not(#\#),video:not(#\#):not(#\#):not(#\#):not(#\#){max-width:100%;height:auto}button:not(#\#):not(#\#):not(#\#):not(#\#),input:not(#\#):not(#\#):not(#\#):not(#\#),select:not(#\#):not(#\#):not(#\#):not(#\#),optgroup:not(#\#):not(#\#):not(#\#):not(#\#),textarea:not(#\#):not(#\#):not(#\#):not(#\#){font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-file-upload-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:not(#\#):not(#\#):not(#\#):not(#\#)::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])):not(#\#):not(#\#):not(#\#):not(#\#) optgroup{font-weight:bolder}:where(select:is([multiple],[size])):not(#\#):not(#\#):not(#\#):not(#\#) optgroup option{padding-inline-start:20px}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-file-upload-button{margin-inline-end:4px}:not(#\#):not(#\#):not(#\#):not(#\#)::file-selector-button{margin-inline-end:4px}:not(#\#):not(#\#):not(#\#):not(#\#)::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){:not(#\#):not(#\#):not(#\#):not(#\#)::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){:not(#\#):not(#\#):not(#\#):not(#\#)::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea:not(#\#):not(#\#):not(#\#):not(#\#){resize:vertical}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-search-decoration{-webkit-appearance:none}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-datetime-edit{display:inline-flex}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-datetime-edit-fields-wrapper{padding:0}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-datetime-edit{padding-block-start:0;padding-block-end:0}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-datetime-edit-year-field{padding-block-start:0;padding-block-end:0}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-datetime-edit-month-field{padding-block-start:0;padding-block-end:0}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-datetime-edit-day-field{padding-block-start:0;padding-block-end:0}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-datetime-edit-hour-field{padding-block-start:0;padding-block-end:0}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-datetime-edit-minute-field{padding-block-start:0;padding-block-end:0}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-datetime-edit-second-field{padding-block-start:0;padding-block-end:0}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-datetime-edit-millisecond-field{padding-block-start:0;padding-block-end:0}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-datetime-edit-meridiem-field{padding-block-start:0;padding-block-end:0}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid:not(#\#):not(#\#):not(#\#):not(#\#){box-shadow:none}button:not(#\#):not(#\#):not(#\#):not(#\#),input:where([type=button],[type=reset],[type=submit]):not(#\#):not(#\#):not(#\#):not(#\#){-webkit-appearance:button;appearance:button}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-file-upload-button{-webkit-appearance:button;appearance:button}:not(#\#):not(#\#):not(#\#):not(#\#)::file-selector-button{-webkit-appearance:button;appearance:button}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-inner-spin-button{height:auto}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])):not(#\#){display:none!important}:not(#\#):not(#\#):not(#\#):not(#\#),:not(#\#):not(#\#):not(#\#):not(#\#):before,:not(#\#):not(#\#):not(#\#):not(#\#):after{min-width:0}body:not(#\#):not(#\#):not(#\#):not(#\#){overflow-wrap:break-word}img:not(#\#):not(#\#):not(#\#):not(#\#),svg:not(#\#):not(#\#):not(#\#):not(#\#),video:not(#\#):not(#\#):not(#\#):not(#\#),canvas:not(#\#):not(#\#):not(#\#):not(#\#),select:not(#\#):not(#\#):not(#\#):not(#\#),input:not(#\#):not(#\#):not(#\#):not(#\#),textarea:not(#\#):not(#\#):not(#\#):not(#\#){max-width:100%}.input:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.select:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding:.45rem .9rem;font-size:.875rem}.input-sm:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding:.25rem .7rem;font-size:.75rem}.pointer-events-auto:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){pointer-events:auto}.pointer-events-none:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){pointer-events:none}.visible:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){visibility:visible}.absolute:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){position:absolute}.fixed:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){position:fixed}.relative:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){position:relative}.static:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){position:static}.sticky:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){position:sticky}.inset-0:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){top:0;bottom:0;left:0;right:0}.inset-3:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){inset:calc(var(--spacing) * 3)}.inset-x-0:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){left:0;right:0}.inset-x-4:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){inset-inline:calc(var(--spacing) * 4)}.top-0:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){top:0}.top-1\/2:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){top:50%}.top-2:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){top:calc(var(--spacing) * 2)}.top-\[max\(6px\,env\(safe-area-inset-top\)\)\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){top:max(6px, env(safe-area-inset-top))}.top-\[max\(10px\,env\(safe-area-inset-top\)\)\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){top:max(10px, env(safe-area-inset-top))}.right-3:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){right:calc(var(--spacing) * 3)}.bottom-0:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){bottom:0}.bottom-3:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){bottom:calc(var(--spacing) * 3)}.bottom-14:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){bottom:calc(var(--spacing) * 14)}.bottom-16:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){bottom:calc(var(--spacing) * 16)}.left-1\/2:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){left:50%}.left-3:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){left:calc(var(--spacing) * 3)}.z-0:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){z-index:0}.z-10:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){z-index:10}.z-20:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){z-index:20}.z-30:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){z-index:30}.z-40:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){z-index:40}.z-\[200\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){z-index:200}.container:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:100%}@media (min-width:40rem){.container:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){max-width:40rem}}@media (min-width:48rem){.container:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){max-width:48rem}}@media (min-width:64rem){.container:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){max-width:64rem}}@media (min-width:80rem){.container:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){max-width:80rem}}@media (min-width:96rem){.container:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){max-width:96rem}}.mx-auto:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){margin-inline-start:auto;margin-inline-end:auto}.ms-\[8px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){margin-inline-start:8px}.me-\[8px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){margin-inline-end:8px}.mt-1:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){margin-top:var(--spacing)}.mt-3:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){margin-top:calc(var(--spacing) * 3)}.block:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){display:block}.flex:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){display:flex}.grid:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){display:grid}.hidden:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){display:none}.inline:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){display:inline}.inline-block:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){display:inline-block}.table:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){display:table}.aspect-video:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){aspect-ratio:var(--aspect-video)}.h-2\.5:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:calc(var(--spacing) * 2.5)}.h-3:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:calc(var(--spacing) * 3)}.h-7:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:calc(var(--spacing) * 7)}.h-8:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:calc(var(--spacing) * 8)}.h-10:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:calc(var(--spacing) * 10)}.h-11:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:calc(var(--spacing) * 11)}.h-12:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:calc(var(--spacing) * 12)}.h-14:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:calc(var(--spacing) * 14)}.h-24:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:calc(var(--spacing) * 24)}.h-\[24px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:24px}.h-\[26px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:26px}.h-\[32px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:32px}.h-\[36px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:36px}.h-\[44px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:44px}.h-\[52px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:52px}.h-\[54px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:54px}.h-\[124px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:124px}.h-full:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:100%}.min-h-\[100dvh\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){min-height:100dvh}.w-2\.5:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:calc(var(--spacing) * 2.5)}.w-3:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:calc(var(--spacing) * 3)}.w-7:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:calc(var(--spacing) * 7)}.w-8:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:calc(var(--spacing) * 8)}.w-10:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:calc(var(--spacing) * 10)}.w-11:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:calc(var(--spacing) * 11)}.w-12:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:calc(var(--spacing) * 12)}.w-14:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:calc(var(--spacing) * 14)}.w-24:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:calc(var(--spacing) * 24)}.w-\[36px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:36px}.w-\[44px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:44px}.w-\[52px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:52px}.w-\[54px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:54px}.w-\[56px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:56px}.w-\[76px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:76px}.w-\[84px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:84px}.w-\[124px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:124px}.w-\[min\(22rem\,calc\(100\%-2rem\)\)\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:min(22rem,100% - 2rem)}.w-\[min\(26rem\,100\%\)\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:min(26rem,100%)}.w-full:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:100%}.w-max:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:max-content}.max-w-\[14rem\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){max-width:14rem}.max-w-\[max\(20rem\,calc\(\(100dvh_-_22rem\)\*16\/9\)\)\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){max-width:max(20rem,177.778dvh - 39.1111rem)}.max-w-\[min\(24rem\,calc\(100\%-2rem\)\)\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){max-width:min(24rem,100% - 2rem)}.max-w-sm:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){max-width:var(--container-sm)}.min-w-0:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){min-width:0}.min-w-8:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){min-width:calc(var(--spacing) * 8)}.min-w-\[64px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){min-width:64px}.flex-1:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){flex:1}.-translate-x-1\/2:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\/2:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.transform:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){transform:var(--tw-rotate-x, ) var(--tw-rotate-y, ) var(--tw-rotate-z, ) var(--tw-skew-x, ) var(--tw-skew-y, )}.animate-ping:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){animation:var(--animate-ping)}.animate-pulse:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){animation:var(--animate-pulse)}.animate-spin:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){animation:var(--animate-spin)}.touch-none:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){touch-action:none}.resize:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){resize:both}.grid-cols-3:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){grid-template-columns:repeat(3,minmax(0,1fr))}.grid-rows-3:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){grid-template-rows:repeat(3,minmax(0,1fr))}.flex-col:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){flex-direction:column}.flex-wrap:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){flex-wrap:wrap}.items-center:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){align-items:center}.items-end:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){align-items:flex-end}.items-start:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){align-items:flex-start}.justify-center:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){justify-content:center}.gap-1:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){gap:var(--spacing)}.gap-1\.5:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){gap:calc(var(--spacing) * 1.5)}.gap-2:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){gap:calc(var(--spacing) * 2)}.gap-3:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){gap:calc(var(--spacing) * 3)}.gap-4:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){gap:calc(var(--spacing) * 4)}.gap-5:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){gap:calc(var(--spacing) * 5)}:where(.space-y-1>:not(:last-child)):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}.truncate:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){overflow:hidden}.rounded:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-radius:.25rem}.rounded-2xl:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-radius:var(--radius-2xl)}.rounded-\[var\(--radius-card\)\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-radius:var(--radius-card)}.rounded-full:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-radius:2147483647px}.rounded-lg:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-radius:var(--radius-lg)}.rounded-md:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-radius:var(--radius-md)}.border:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-style:var(--tw-border-style);border-width:1px}.border-2:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-style:var(--tw-border-style);border-width:2px}.border-\[1\.5px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-style:var(--tw-border-style);border-width:1.5px}.border-l:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-left-style:var(--tw-border-style);border-left-width:1px}.border-white:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:var(--color-white)}.border-white\/10:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.border-white\/10:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}.border-white\/15:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:#ffffff26}@supports (color:color-mix(in lab, red, red)){.border-white\/15:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:color-mix(in oklab, var(--color-white) 15%, transparent)}}.border-white\/20:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:#fff3}@supports (color:color-mix(in lab, red, red)){.border-white\/20:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:color-mix(in oklab, var(--color-white) 20%, transparent)}}.border-white\/30:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:#ffffff4d}@supports (color:color-mix(in lab, red, red)){.border-white\/30:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:color-mix(in oklab, var(--color-white) 30%, transparent)}}.border-white\/40:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:#fff6}@supports (color:color-mix(in lab, red, red)){.border-white\/40:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:color-mix(in oklab, var(--color-white) 40%, transparent)}}.border-white\/45:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:#ffffff73}@supports (color:color-mix(in lab, red, red)){.border-white\/45:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:color-mix(in oklab, var(--color-white) 45%, transparent)}}.border-white\/70:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:#ffffffb3}@supports (color:color-mix(in lab, red, red)){.border-white\/70:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:color-mix(in oklab, var(--color-white) 70%, transparent)}}.border-white\/80:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:#fffc}@supports (color:color-mix(in lab, red, red)){.border-white\/80:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:color-mix(in oklab, var(--color-white) 80%, transparent)}}.border-t-white:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-top-color:var(--color-white)}.bg-\[var\(--color-danger\,\#dc2626\)\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:var(--color-danger,#dc2626)}.bg-black:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:var(--color-black)}.bg-black\/40:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#0006}@supports (color:color-mix(in lab, red, red)){.bg-black\/40:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-black) 40%, transparent)}}.bg-black\/60:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#0009}@supports (color:color-mix(in lab, red, red)){.bg-black\/60:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-black) 60%, transparent)}}.bg-black\/70:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#000000b3}@supports (color:color-mix(in lab, red, red)){.bg-black\/70:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-black) 70%, transparent)}}.bg-neutral-900:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:var(--color-neutral-900)}.bg-neutral-900\/90:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#171717e6}@supports (color:color-mix(in lab, red, red)){.bg-neutral-900\/90:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-neutral-900) 90%, transparent)}}.bg-neutral-900\/95:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#171717f2}@supports (color:color-mix(in lab, red, red)){.bg-neutral-900\/95:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-neutral-900) 95%, transparent)}}.bg-transparent:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#0000}.bg-white:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:var(--color-white)}.bg-white\/10:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.bg-white\/10:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}.bg-white\/15:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#ffffff26}@supports (color:color-mix(in lab, red, red)){.bg-white\/15:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-white) 15%, transparent)}}.bg-white\/25:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#ffffff40}@supports (color:color-mix(in lab, red, red)){.bg-white\/25:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-white) 25%, transparent)}}.bg-white\/50:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#ffffff80}@supports (color:color-mix(in lab, red, red)){.bg-white\/50:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-white) 50%, transparent)}}.bg-white\/90:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#ffffffe6}@supports (color:color-mix(in lab, red, red)){.bg-white\/90:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-white) 90%, transparent)}}.bg-white\/\[0\.05\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#ffffff0d}@supports (color:color-mix(in lab, red, red)){.bg-white\/\[0\.05\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-white) 5%, transparent)}}.bg-white\/\[0\.12\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#ffffff1f}@supports (color:color-mix(in lab, red, red)){.bg-white\/\[0\.12\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-white) 12%, transparent)}}.bg-gradient-to-b:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-gradient-position:to bottom in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-black\/70:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-gradient-from:#000000b3}@supports (color:color-mix(in lab, red, red)){.from-black\/70:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-gradient-from:color-mix(in oklab, var(--color-black) 70%, transparent)}}.from-black\/70:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-transparent:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-gradient-to:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.object-contain:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){object-fit:contain}.object-cover:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){object-fit:cover}.object-fill:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){object-fit:fill}.p-0:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding:0}.p-3:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding:calc(var(--spacing) * 3)}.p-4:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding:calc(var(--spacing) * 4)}.p-6:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding:calc(var(--spacing) * 6)}.px-1\.5:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-inline:calc(var(--spacing) * 1.5)}.px-2:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-inline:calc(var(--spacing) * 2)}.px-2\.5:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-inline:calc(var(--spacing) * 2.5)}.px-3:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-inline:calc(var(--spacing) * 3)}.px-4:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-inline:calc(var(--spacing) * 4)}.px-6:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-inline:calc(var(--spacing) * 6)}.px-\[4px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-inline-start:4px;padding-inline-end:4px}.px-\[10px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-inline-start:10px;padding-inline-end:10px}.py-0\.5:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-block:calc(var(--spacing) * .5)}.py-1:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-block:var(--spacing)}.py-1\.5:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-block:calc(var(--spacing) * 1.5)}.py-2:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-block:calc(var(--spacing) * 2)}.py-2\.5:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-block:calc(var(--spacing) * 2.5)}.py-10:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-block:calc(var(--spacing) * 10)}.pt-\[max\(8px\,env\(safe-area-inset-top\)\)\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-top:max(8px, env(safe-area-inset-top))}.pb-5:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-bottom:calc(var(--spacing) * 5)}.pl-2:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-left:calc(var(--spacing) * 2)}.text-center:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){text-align:center}.text-base:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){font-size:10px}.text-\[11px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){font-size:11px}.text-\[13px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){font-size:13px}.leading-none:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-leading:1;line-height:1}.font-bold:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wide:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.whitespace-nowrap:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){white-space:nowrap}.text-amber-200\/90:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:#fee685e6}@supports (color:color-mix(in lab, red, red)){.text-amber-200\/90:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:color-mix(in oklab, var(--color-amber-200) 90%, transparent)}}.text-black:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:var(--color-black)}.text-emerald-300:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:var(--color-emerald-300)}.text-white:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:var(--color-white)}.text-white\/50:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:#ffffff80}@supports (color:color-mix(in lab, red, red)){.text-white\/50:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:color-mix(in oklab, var(--color-white) 50%, transparent)}}.text-white\/60:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:#fff9}@supports (color:color-mix(in lab, red, red)){.text-white\/60:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:color-mix(in oklab, var(--color-white) 60%, transparent)}}.text-white\/70:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:#ffffffb3}@supports (color:color-mix(in lab, red, red)){.text-white\/70:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:color-mix(in oklab, var(--color-white) 70%, transparent)}}.text-white\/75:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:#ffffffbf}@supports (color:color-mix(in lab, red, red)){.text-white\/75:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:color-mix(in oklab, var(--color-white) 75%, transparent)}}.text-white\/80:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:#fffc}@supports (color:color-mix(in lab, red, red)){.text-white\/80:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:color-mix(in oklab, var(--color-white) 80%, transparent)}}.text-white\/85:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:#ffffffd9}@supports (color:color-mix(in lab, red, red)){.text-white\/85:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:color-mix(in oklab, var(--color-white) 85%, transparent)}}.lowercase:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){text-transform:lowercase}.uppercase:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){text-transform:uppercase}.tabular-nums:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal, ) var(--tw-slashed-zero, ) var(--tw-numeric-figure, ) var(--tw-numeric-spacing, ) var(--tw-numeric-fraction, )}.opacity-0:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){opacity:0}.opacity-60:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){opacity:.6}.opacity-100:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){opacity:1}.shadow:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-2xl:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\[0_0_3px_rgba\(0\,0\,0\,0\.3\)\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-shadow:0 0 3px var(--tw-shadow-color,#0000004d);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\[0_0_3px_rgba\(0\,0\,0\,0\.35\)\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-shadow:0 0 3px var(--tw-shadow-color,#00000059);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\[var\(--shadow-2\)\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-shadow:var(--shadow-2);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-ring-shadow:var(--tw-ring-inset, ) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.blur:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-blur:blur(8px);filter:var(--tw-blur, ) var(--tw-brightness, ) var(--tw-contrast, ) var(--tw-grayscale, ) var(--tw-hue-rotate, ) var(--tw-invert, ) var(--tw-saturate, ) var(--tw-sepia, ) var(--tw-drop-shadow, )}.filter:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){filter:var(--tw-blur, ) var(--tw-brightness, ) var(--tw-contrast, ) var(--tw-grayscale, ) var(--tw-hue-rotate, ) var(--tw-invert, ) var(--tw-saturate, ) var(--tw-sepia, ) var(--tw-drop-shadow, )}.backdrop-blur-md:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, );backdrop-filter:var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, )}.backdrop-blur-sm:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, );backdrop-filter:var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, )}.transition-colors:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-75:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-duration:75ms;transition-duration:75ms}.duration-300:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-duration:.3s;transition-duration:.3s}.outline-none:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-outline-style:none;outline-style:none}.select-none:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){-webkit-user-select:none;user-select:none}.\[-webkit-touch-callout\:none\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){-webkit-touch-callout:none}.\[animation-duration\:2\.4s\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){animation-duration:2.4s}.\[text-shadow\:0_1px_2px_rgba\(0\,0\,0\,0\.6\)\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){text-shadow:0 1px 2px #0009}@media (hover:hover){.hover\:bg-white\/10:hover:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.hover\:bg-white\/10:hover:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}.hover\:bg-white\/20:hover:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#fff3}@supports (color:color-mix(in lab, red, red)){.hover\:bg-white\/20:hover:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-white) 20%, transparent)}}.hover\:bg-white\/25:hover:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#ffffff40}@supports (color:color-mix(in lab, red, red)){.hover\:bg-white\/25:hover:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-white) 25%, transparent)}}.hover\:opacity-100:hover:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){opacity:1}}.focus\:border-white\/50:focus:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:#ffffff80}@supports (color:color-mix(in lab, red, red)){.focus\:border-white\/50:focus:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:color-mix(in oklab, var(--color-white) 50%, transparent)}}.focus-visible\:opacity-100:focus-visible:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){opacity:1}.disabled\:opacity-40:disabled:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){opacity:.4}:root:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--color-surface:#ffffff0a;--color-surface-2:#ffffff0f;--color-surface-3:#ffffff1a;--color-surface-raised:#ffffff12;--color-float:#2c2c2ef5;--color-canvas:#ffffff09;--glass-edge:#ffffff1a;--color-pill:#ffffff1f;--color-border:#ffffff1a;--color-border-strong:#fff3;--color-muted:#a1a1a8;--color-text:#f5f5f7;--color-accent:#4da3ff;--color-accent-contrast:#fff;--color-accent-soft:#0a84ff2e;--color-accent-bright:#3b9bff;--color-accent-pink:#3b9bff;--accent-fill:linear-gradient(#0a72e8, #0a72e8);--accent-glow:0 1px 2px #0000004d;--color-good:#32d074;--color-good-soft:#32d07424;--color-warn:#ffb340;--color-warn-soft:#ffb34024;--color-bad:#ff6961;--color-bad-soft:#ff696124;--color-ps4:#8fb0ff;--color-ps4-soft:#8fb0ff26;--color-ps5:#c3a2ff;--color-ps5-soft:#c3a2ff26;--shadow-logo:0 12px 40px -10px #00000080;--shadow-1:0 1px 2px #0000002e;--shadow-2:0 10px 30px -10px #0000008c, 0 0 0 .5px #0006;--shadow-3:0 24px 70px -20px #000000b3, 0 0 0 .5px #0006;--edge-highlight:inset 0 1px 0 #ffffff0d;--overlay-scrim:#00000073;--atmosphere-base:#1e1e20;--atmosphere:none;--dot-color:transparent;--glass-blur:24px;--color-accent-glow:#0a84ff40;--radius-control:999px;--radius-field:.5rem;--radius-card:.875rem;--radius-panel:1rem;--radius-canvas:0px;--content-max:none}:root:is([data-theme=light],[data-theme=peach]):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light;--color-surface:#00000008;--color-surface-2:#fff;--color-surface-3:#00000012;--color-surface-raised:#fff;--color-float:#fffffff7;--color-canvas:#00000006;--glass-edge:#00000014;--color-pill:#00000014;--color-border:#0000001a;--color-border-strong:#0003;--color-muted:#5f5f66;--color-text:#1d1d1f;--color-accent:#0064d2;--color-accent-contrast:#fff;--color-accent-soft:#0071e31f;--color-accent-bright:#0071e3;--color-accent-pink:#0071e3;--accent-fill:linear-gradient(#0071e3, #0071e3);--accent-glow:0 1px 2px #0000001f;--color-good:#1a7f43;--color-good-soft:#1a7f431f;--color-warn:#8a5200;--color-warn-soft:#d68c1e29;--color-bad:#c4252f;--color-bad-soft:#d700151a;--color-ps4:#2a55b8;--color-ps4-soft:#2a55b81f;--color-ps5:#6b3fc4;--color-ps5-soft:#6b3fc41f;--shadow-logo:0 12px 40px -10px #0003;--shadow-1:0 1px 2px #0000000d;--shadow-2:0 10px 30px -10px #00000038, 0 0 0 .5px #0000001f;--shadow-3:0 24px 70px -20px #0000004d, 0 0 0 .5px #0000001f;--edge-highlight:inset 0 0 0 0 transparent;--overlay-scrim:#0003;--atmosphere-base:#f5f5f7;--atmosphere:none;--dot-color:transparent;--color-accent-glow:#0071e338}:root[data-theme=peach]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--color-surface:#783c140a;--color-surface-3:#783c1414;--color-float:#fffcf9f7;--color-canvas:#783c1408;--glass-edge:#5a2d0f1a;--color-pill:#c2410c1a;--color-border:#5a2d0f1f;--color-border-strong:#5a2d0f3d;--color-muted:#6e5244;--color-text:#2b1d16;--color-accent:#b93d0a;--color-accent-soft:#ea580c1f;--color-accent-bright:#c2410c;--color-accent-pink:#c2410c;--accent-fill:linear-gradient(#c2410c, #c2410c);--color-accent-glow:#ea580c38;--shadow-logo:0 12px 40px -10px #5a2d0f38;--shadow-1:0 1px 2px #5a2d0f0f;--shadow-2:0 10px 30px -10px #5a2d0f38, 0 0 0 .5px #5a2d0f1f;--shadow-3:0 24px 70px -20px #5a2d0f4d, 0 0 0 .5px #5a2d0f1f;--overlay-scrim:#3c1e0a38;--atmosphere-base:#fbf4ee}:root[data-theme=oled]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--color-surface:#ffffff0d;--color-surface-2:#ffffff12;--color-surface-raised:#ffffff14;--color-float:#141416fa;--color-canvas:transparent;--shadow-logo:none;--shadow-1:none;--shadow-2:0 0 0 .5px #ffffff24;--shadow-3:0 0 0 .5px #ffffff29;--edge-highlight:inset 0 0 0 0 transparent;--overlay-scrim:#000000b3;--atmosphere-base:#000;--glass-blur:0px}:root[data-contrast=high]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--color-surface:#1c1c1e;--color-surface-2:#232325;--color-surface-3:#3a3a3c;--color-surface-raised:#2c2c2e;--color-float:#2c2c2e;--color-canvas:#161618;--glass-edge:#fff6;--glass-blur:0px}:root:is([data-theme=light],[data-theme=peach])[data-contrast=high]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--color-surface:#fff;--color-surface-2:#fff;--color-surface-3:#e5e5ea;--color-surface-raised:#fff;--color-float:#fff;--color-canvas:#f5f5f7;--glass-edge:#00000073;--color-border:#00000059;--color-border-strong:#0009}:root[data-theme=oled][data-contrast=high]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--color-surface:#000;--color-surface-2:#121214;--color-surface-raised:#1a1a1c;--color-float:#1a1a1c;--color-canvas:#000}@media (prefers-reduced-transparency:reduce){:root:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--glass-blur:0px;--color-surface-2:#2c2c2ef5;--color-surface-raised:#323234f5;--color-canvas:#1e1e20f5}:root:is([data-theme=light],[data-theme=peach]):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--color-surface-2:#ffffffe6;--color-surface-raised:#ffffffeb;--color-canvas:#ffffffbf}:root[data-theme=oled]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--color-surface-2:#121214fa;--color-surface-raised:#1a1a1cfa;--color-canvas:transparent}}:root[data-transparency=reduced]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--glass-blur:0px;--color-surface-2:#2c2c2ef5;--color-surface-raised:#323234f5;--color-canvas:#1e1e20f5}:root[data-transparency=reduced]:is([data-theme=light],[data-theme=peach]):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--color-surface-2:#ffffffe6;--color-surface-raised:#ffffffeb;--color-canvas:#ffffffbf}:root[data-transparency=reduced][data-theme=oled]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--color-surface-2:#121214fa;--color-surface-raised:#1a1a1cfa;--color-canvas:transparent}:root[data-motion=reduced]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),:root[data-motion=none]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--glass-blur:0px}html:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),body:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),#root:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:100dvh;color:var(--color-text);font-family:var(--font-sans);font-size:var(--ui-base-size,18px);text-size-adjust:100%;-webkit-font-smoothing:antialiased;font-variant-numeric:tabular-nums;margin:0;overflow:hidden}body:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){position:relative}html:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:var(--atmosphere-base);background-image:var(--atmosphere);background-repeat:no-repeat;background-size:100% 100%;background-attachment:fixed}body:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),#root:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:0 0}body:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){overscroll-behavior-y:contain}.app-page:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:100%;max-width:var(--content-max);margin-inline-start:auto;margin-inline-end:auto;padding:1.75rem clamp(2rem,2.5vw,3rem) 2.5rem}.card-flow:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){grid-template-columns:repeat(auto-fill,minmax(min(100%,44rem),1fr));align-items:start;gap:.75rem;display:grid}.app-page-tabs:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:100%;max-width:var(--content-max);margin-inline-start:auto;margin-inline-end:auto;padding:1.25rem clamp(2rem,2.5vw,3rem) 0}.glass:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-surface-2);border:1px solid var(--glass-edge);box-shadow:var(--edge-highlight), var(--shadow-1);-webkit-backdrop-filter:blur(var(--glass-blur)) saturate(1.4);backdrop-filter:blur(var(--glass-blur)) saturate(1.4)}.glass-float:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-float);border:1px solid var(--glass-edge);box-shadow:var(--edge-highlight), var(--shadow-2);-webkit-backdrop-filter:blur(var(--glass-blur)) saturate(1.4);backdrop-filter:blur(var(--glass-blur)) saturate(1.4)}.float-solid:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:linear-gradient(var(--color-float), var(--color-float)), var(--atmosphere-base);border:1px solid var(--glass-edge)}.surface-panel:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border:1px solid var(--glass-edge);border-radius:var(--radius-panel);background:var(--color-surface-raised);box-shadow:var(--edge-highlight), var(--shadow-1)}.dot-texture:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-image:radial-gradient(var(--dot-color) 1.2px, transparent 1.6px);background-size:12px 12px;-webkit-mask-image:radial-gradient(closest-side,#000 30%,#0000 100%);mask-image:radial-gradient(closest-side,#000 30%,#0000 100%)}.fade-x:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){-webkit-mask-image:linear-gradient(to right, transparent, #000 var(--fade-start,0px), #000 calc(100% - var(--fade-end,0px)), transparent);-webkit-mask-image:linear-gradient(to right, transparent, #000 var(--fade-start,0px), #000 calc(100% - var(--fade-end,0px)), transparent);-webkit-mask-image:linear-gradient(to right, transparent, #000 var(--fade-start,0px), #000 calc(100% - var(--fade-end,0px)), transparent);-webkit-mask-image:linear-gradient(to right, transparent, #000 var(--fade-start,0px), #000 calc(100% - var(--fade-end,0px)), transparent);mask-image:linear-gradient(to right, transparent, #000 var(--fade-start,0px), #000 calc(100% - var(--fade-end,0px)), transparent)}[dir=rtl]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .fade-x{-webkit-mask-image:linear-gradient(to left, transparent, #000 var(--fade-start,0px), #000 calc(100% - var(--fade-end,0px)), transparent);-webkit-mask-image:linear-gradient(to left, transparent, #000 var(--fade-start,0px), #000 calc(100% - var(--fade-end,0px)), transparent);-webkit-mask-image:linear-gradient(to left, transparent, #000 var(--fade-start,0px), #000 calc(100% - var(--fade-end,0px)), transparent);-webkit-mask-image:linear-gradient(to left, transparent, #000 var(--fade-start,0px), #000 calc(100% - var(--fade-end,0px)), transparent);mask-image:linear-gradient(to left, transparent, #000 var(--fade-start,0px), #000 calc(100% - var(--fade-end,0px)), transparent)}.icon-orb-button:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border:1px solid var(--glass-edge);background:var(--color-surface-raised);width:2.75rem;height:2.75rem;color:var(--color-text);box-shadow:var(--edge-highlight), var(--shadow-1);border-radius:9999px;flex:none;place-items:center;transition:transform .14s,background-color .14s,box-shadow .14s;display:inline-grid}.icon-orb-button:hover:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-float);transform:translateY(-1px)}.action-tile:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-radius:var(--radius-card);border:1px solid var(--glass-edge);background:var(--color-surface-raised);min-height:5.5rem;box-shadow:var(--edge-highlight), var(--shadow-1);padding:1rem 1.125rem;transition:transform .16s,background-color .16s,box-shadow .16s;display:block;container-type:inline-size}.action-tile:not([aria-disabled=true]):hover:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-float);box-shadow:var(--edge-highlight), var(--shadow-2);transform:translateY(-2px)}.action-tile[aria-disabled=true]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){cursor:not-allowed;opacity:.6}.action-tile-inner:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){align-items:center;gap:.875rem;min-height:3.5rem;display:flex}@container (width<=15rem){.action-tile-inner:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){flex-direction:column;align-items:flex-start;gap:.625rem;min-height:0}.action-tile-inner:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .action-tile-chevron{display:none}}@media (max-width:639px){.action-tile:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){min-height:0;padding:.875rem}}.metric-row:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-bottom:1px solid var(--color-border);justify-content:space-between;align-items:center;gap:1rem;min-height:2.25rem;font-size:.8125rem;display:flex}.metric-row:last-child:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-bottom:0}.icon-disc:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-accent-soft);width:2rem;height:2rem;color:var(--color-accent-bright);border-radius:9999px;flex:none;place-items:center;display:inline-grid}.chip:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border:1px solid var(--color-border-strong);color:var(--color-text);white-space:nowrap;border-radius:9999px;align-items:center;transition:background-color .14s,border-color .14s,box-shadow .14s;display:inline-flex}.chip:hover:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-surface)}.chip[aria-pressed=true]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.chip[aria-checked=true]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.chip[aria-selected=true]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.chip.is-active:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-pill);border-color:#0000;font-weight:600}@media (min-width:768px){.shell-sidebar:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-canvas);border-inline-end:1px solid var(--color-border)}}.shell-safe-x:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-left:var(--safe-left);padding-right:var(--safe-right)}@media (min-width:768px){.shell-sidebar:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-top:var(--safe-top)}}@media (min-width:768px) and (pointer:coarse) and (orientation:landscape) and (max-height:520px){.shell-statusbar{display:none!important}.shell-safe-x:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-bottom:var(--safe-bottom)}.shell-sidebar:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)>:first-child{height:3.5rem}}.nav-pill:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:var(--color-text)}.nav-pill:hover:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-surface)}.nav-pill.active:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.nav-pill[aria-current=page]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-pill);font-weight:600}.nav-pill:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .nav-pill-icon{color:var(--color-muted)}.nav-pill.active:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .nav-pill-icon,.nav-pill[aria-current=page]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .nav-pill-icon{color:var(--color-accent-bright)}:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){box-sizing:border-box}:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::selection{background:var(--color-accent);color:var(--color-accent-contrast)}:where(a,button,[role=button],[role=menuitem],[role=tab],[tabindex]):focus-visible:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){outline:2px solid var(--color-accent);outline-offset:2px}:where(input,select,textarea):focus-visible:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){outline:2px solid var(--color-accent);outline-offset:1px}:root[data-tv="1"]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) :where(a,button,input,select,textarea,summary,[role=button],[role=menuitem],[role=tab],[tabindex]):focus{outline:3px solid var(--color-accent);outline-offset:3px}:root[data-tv="1"]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) [data-join-ui] :where(a,button,input,select,textarea,summary,[role=button],[tabindex]):focus{outline-offset:3px;outline:3px solid #fff}[data-join-ui]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) :where(a,button,input,select,textarea,summary,[role=button],[tabindex]):focus-visible{outline-offset:3px;outline:3px solid #fff}:root[data-tv="1"]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) [data-join-ui] :where(a,button,input,select,textarea,summary,[role=button],[tabindex]):focus{outline-width:4px}:is([data-join-game]:focus,[data-join-game]:focus-visible){outline:none!important}:is(.input:focus-visible:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.select:focus-visible:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.field-quiet:focus-visible:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)){outline:none}.field-shell:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){transition:box-shadow .14s,background-color .14s}.field-shell:has(.field-quiet:focus-visible):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){box-shadow:inset 0 -2px 0 var(--color-accent)}.field-shell.rounded-full:has(.field-quiet:focus-visible):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){box-shadow:0 0 0 2px var(--color-accent), 0 0 0 5px var(--color-accent-soft)}.field-shell-ring:has(.field-quiet:focus-visible):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){box-shadow:0 0 0 2px var(--color-accent), 0 0 0 5px var(--color-accent-soft)}.scrim:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--overlay-scrim);-webkit-backdrop-filter:blur(calc(var(--glass-blur) / 4));backdrop-filter:blur(calc(var(--glass-blur) / 4))}.glass-bar:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-float);-webkit-backdrop-filter:blur(var(--glass-blur)) saturate(1.4);backdrop-filter:blur(var(--glass-blur)) saturate(1.4)}:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){scrollbar-width:thin;scrollbar-color:var(--color-border-strong) transparent}:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-scrollbar{width:10px;height:10px}:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-scrollbar-track{background:0 0}:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-scrollbar-thumb{background:var(--color-border-strong);background-clip:padding-box;border:2px solid #0000;border-radius:8px}:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-scrollbar-thumb:hover{background:var(--color-muted);background-clip:padding-box}@keyframes ps-fade-in{0%{opacity:0}to{opacity:1}}@keyframes ps-pop-in{0%{opacity:0;transform:translateY(8px)scale(.98)}to{opacity:1;transform:translateY(0)scale(1)}}@keyframes ps-rise-in{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}@keyframes ps-drawer-in{0%{transform:translate(-100%)}to{transform:translate(0)}}@keyframes ps-sheet-in{0%{opacity:0;transform:translateY(24px)}to{opacity:1;transform:translateY(0)}}@keyframes ps-side-in{0%{opacity:0;transform:translate(24px)}to{opacity:1;transform:translate(0)}}@keyframes ps-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@keyframes ps-soft-pulse{0%,to{opacity:1}50%{opacity:.45}}.anim-scrim:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){animation:.15s ease-out both ps-fade-in}.anim-pop:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){animation:.18s cubic-bezier(.2,.8,.2,1) both ps-pop-in}.anim-rise:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){animation:.14s cubic-bezier(.2,.8,.2,1) both ps-rise-in}.anim-screen:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){animation:.2s cubic-bezier(.2,.8,.2,1) backwards ps-rise-in}.anim-drawer:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){animation:.22s cubic-bezier(.2,.8,.2,1) both ps-drawer-in}.anim-sheet:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){animation:.22s cubic-bezier(.2,.8,.2,1) both ps-sheet-in}.anim-side:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){animation:.2s cubic-bezier(.2,.8,.2,1) both ps-side-in}.anim-sheet-up:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){animation:.22s cubic-bezier(.2,.8,.2,1) both ps-sheet-in}.anim-skeleton:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:linear-gradient(100deg, var(--color-surface-3) 40%, var(--color-surface-raised) 50%, var(--color-surface-3) 60%);background-size:200% 100%;animation:2.2s linear infinite ps-shimmer}.anim-status-pulse:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){animation:2.4s ease-in-out infinite ps-soft-pulse}.elev-1:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){box-shadow:var(--edge-highlight), var(--shadow-1)}@media (max-width:767px){.app-page:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding:1rem}.app-page-tabs:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding:1rem 1rem 0}}.elev-2:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){box-shadow:var(--edge-highlight), var(--shadow-2)}.elev-3:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){box-shadow:var(--edge-highlight), var(--shadow-3)}.support-button:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:#fff;background-image:linear-gradient(135deg,#ff3d6e 0%,#ff6a4d 55%,#ff9a3c 100%);transition:transform .16s cubic-bezier(.2,.8,.2,1),box-shadow .16s,filter .16s;box-shadow:0 6px 18px -6px #ff3d6ea6,inset 0 1px #ffffff40}.support-button:hover:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){filter:brightness(1.06);transform:translateY(-1px);box-shadow:0 10px 24px -8px #ff3d6ebf,inset 0 1px #ffffff40}.support-button:active:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){transform:translateY(0)}.support-button:focus-visible:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){outline-offset:2px;outline:2px solid #ff3d6e}.support-heart:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){transform-origin:50%;animation:2.8s ease-in-out infinite support-beat}@keyframes support-beat{0%,70%,to{transform:scale(1)}76%{transform:scale(1.22)}82%{transform:scale(1)}88%{transform:scale(1.14)}}:root[data-motion=none]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .support-heart{animation:none}.fs-reveal:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){outline:2px solid var(--color-accent);outline-offset:-1px;box-shadow:inset 0 0 0 999px var(--color-accent)}@supports (color:color-mix(in lab, red, red)){.fs-reveal:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){box-shadow:inset 0 0 0 999px color-mix(in srgb, var(--color-accent) 16%, transparent)}}@keyframes fs-reveal{0%,45%{outline-color:var(--color-accent);box-shadow:inset 0 0 0 999px color-mix(in srgb, var(--color-accent) 16%, transparent)}to{outline-color:#0000;box-shadow:inset 0 0 0 999px #0000}}@media (prefers-reduced-motion:no-preference){:root:not([data-motion=none]):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .fs-reveal{animation:2s ease-out forwards fs-reveal}}@media (prefers-reduced-motion:reduce){.anim-scrim:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.anim-pop:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.support-heart:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.anim-rise:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.anim-screen:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.anim-drawer:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.anim-sheet:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.anim-sheet-up:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.anim-side:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.anim-skeleton:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.anim-status-pulse:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){animation:none}*,:before,:after{transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}:root[data-motion=reduced]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .anim-pop{animation-duration:90ms}:root[data-motion=reduced]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .anim-screen,:root[data-motion=none]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .anim-scrim,:root[data-motion=none]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .anim-pop,:root[data-motion=none]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .anim-rise,:root[data-motion=none]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .anim-screen,:root[data-motion=none]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .anim-drawer,:root[data-motion=none]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .anim-sheet,:root[data-motion=none]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .anim-sheet-up,:root[data-motion=none]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .anim-side,:root[data-motion=none]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .anim-skeleton,:root[data-motion=none]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .anim-status-pulse{animation:none}:root[data-motion=none] *,:root[data-motion=none] :before,:root[data-motion=none] :after{transition-duration:.01ms!important}:root[data-contrast=high]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--color-border:var(--color-border-strong);--color-muted:var(--color-text)}:root[data-contrast=high]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) :where(a,button,[role=button],[role=menuitem],[role=tab],[tabindex]):focus-visible{outline-offset:4px;outline-width:3px}:root:is(:lang(ar),:lang(fa)):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--font-sans:system-ui, "SF Arabic", "Noto Sans Arabic", "Geeza Pro", "Segoe UI", Tahoma, sans-serif}:root:is(:lang(ar),:lang(fa)):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) :not(.font-mono,code,kbd,pre,input,textarea){letter-spacing:normal}:root:is(:lang(ar),:lang(fa)):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .uppercase{text-transform:none;font-size:.8125rem}:root[data-dyslexia=true]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) body,:root[data-dyslexia=true]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) #root{letter-spacing:.01em;font-family:Atkinson Hyperlegible,OpenDyslexic,system-ui,-apple-system,sans-serif;line-height:1.5}.sr-only:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.skip-link:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){z-index:100;background:var(--color-accent);color:var(--color-accent-contrast);border-radius:0 0 .375rem;padding:.5rem 1rem;font-size:.875rem;font-weight:500;transition:top .15s;position:absolute;top:-100%;left:0}.skip-link:focus:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){outline:2px solid var(--color-accent);outline-offset:2px;top:0}.safe-top:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-top:var(--safe-top)}:root:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--safe-bottom:max(env(safe-area-inset-bottom), var(--nav-inset-bottom,0px));--safe-top:max(env(safe-area-inset-top), var(--sys-inset-top,0px));--safe-left:max(env(safe-area-inset-left), var(--sys-inset-left,0px));--safe-right:max(env(safe-area-inset-right), var(--sys-inset-right,0px))}.safe-bottom:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-bottom:var(--safe-bottom)}:root:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--float-bottom:0px}@media (max-width:767.98px){:root:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--float-bottom:calc(88px + var(--safe-bottom))}html[data-activity-pill]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--float-bottom:calc(5.1rem + var(--safe-bottom) + var(--activity-pill-h,2.75rem) + .375rem)}.tab-room:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){scroll-padding-bottom:calc(var(--float-bottom) + 4.5rem)}}html[data-keyboard] [data-bottom-nav],html[data-keyboard] [data-testid=activity-pill]{display:none!important}@media not all and (min-width:40rem),(pointer:coarse) and (max-height:520px){html[data-selection-bar] [data-bottom-nav]{display:none!important}[data-top-bar]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .icon-orb-button{width:44px;height:44px}}@media (min-width:768px) and (pointer:coarse) and (orientation:landscape) and (max-height:520px){html[data-screen-bar]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) [data-top-row]{padding-top:var(--safe-top)}html[data-screen-bar]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) [data-top-row]>:not([data-keep]){display:none}}@media (max-width:767.98px){html[data-screen-bar]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) [data-top-bar]{min-height:0;padding-top:var(--safe-top);padding-bottom:0}html[data-screen-bar]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) [data-top-bar]>*{display:none}}.tab-rail-probe:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){visibility:hidden;pointer-events:none;padding-left:var(--safe-left);padding-right:var(--safe-right);position:fixed}@media (max-width:767px){[data-bottom-nav][data-rail]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){top:max(calc(var(--safe-top) + 9.75rem), calc(100dvh - var(--safe-bottom) - .6rem - 24rem));border-radius:2rem;flex-direction:column;gap:0;height:auto}[data-bottom-nav][data-rail=right]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:calc(var(--safe-right) - .75rem);left:auto;right:.375rem}[data-bottom-nav][data-rail=left]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:calc(var(--safe-left) - .75rem);left:.375rem;right:auto}html[data-tab-rail]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) [data-testid=activity-pill]{bottom:calc(var(--safe-bottom) + .6rem)}html[data-tab-rail]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--float-bottom:calc(1rem + var(--safe-bottom))}html[data-tab-rail][data-activity-pill]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--float-bottom:calc(.6rem + var(--safe-bottom) + var(--activity-pill-h,2.75rem) + .375rem)}}.safe-left:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-left:var(--safe-left)}.safe-right:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-right:var(--safe-right)}.safe-pad:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-top:var(--safe-top);padding-bottom:var(--safe-bottom);padding-left:var(--safe-left);padding-right:var(--safe-right)}.h-bottom-nav:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:calc(56px + var(--safe-bottom))}.h-top-bar:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){min-height:calc(44px + var(--safe-top));padding-left:calc(var(--safe-left) + 1rem);padding-right:calc(var(--safe-right) + 1rem)}@media (max-width:767.98px){.panel-sheet-x:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){left:max(.5rem, var(--safe-left));right:max(.5rem, var(--safe-right))}}.modal-safe-x:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-left:max(1rem, var(--safe-left));padding-right:max(1rem, var(--safe-right))}@media (max-width:639.98px){.modal-safe-x:has(>.anim-sheet-up):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-left:var(--safe-left);padding-right:var(--safe-right)}}@media (pointer:coarse){button:not([role=switch]):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),[role=button]:not([role=switch]):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),[role=tab]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),[role=menuitem]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),[role=menuitemcheckbox]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),[role=menuitemradio]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),[role=option]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),[role=treeitem]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),select:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),textarea:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),input:not([type=checkbox]):not([type=radio]):not([type=range]):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){min-height:44px}}input[type=checkbox]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),input[type=radio]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:1.15rem;height:1.15rem;accent-color:var(--color-accent);cursor:pointer}@media (pointer:coarse){input[type=checkbox]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),input[type=radio]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:1.4rem;height:1.4rem}}.input:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-radius:var(--radius-control);border:1px solid var(--glass-edge);background:var(--color-surface-raised);width:100%;color:var(--color-text);transition:border-color .15s,box-shadow .15s;box-shadow:inset 0 1px 2px #0000000f}:root:is([data-theme=light],[data-theme=peach]):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .input,:root:is([data-theme=light],[data-theme=peach]):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .select{border-color:#00000024}textarea.input:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-radius:var(--radius-field)}.input:focus:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.select:focus:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:var(--color-accent);box-shadow:0 0 0 3px var(--color-accent-soft)}.input:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::placeholder{color:var(--color-muted)}:root[dir=rtl]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) :where(.font-mono,code,kbd,samp,pre,.tabular-nums){unicode-bidi:plaintext}:where(input,textarea):placeholder-shown:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){text-overflow:ellipsis}@media (max-width:767px){.input:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.input-sm:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.select:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){min-height:2.75rem}}.select:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-radius:var(--radius-control);border:1px solid var(--glass-edge);background:var(--color-surface-raised);width:100%;color:var(--color-text);transition:border-color .15s,box-shadow .15s}select:not([multiple]):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){-webkit-appearance:none;appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-position:right .75rem center;background-repeat:no-repeat;padding-inline-end:2rem}[dir=rtl]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) select:not([multiple]){background-position:.75rem}.select:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) option,select:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) option{background:var(--color-float);color:var(--color-text)}.radio:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.checkbox:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){accent-color:var(--color-accent);cursor:pointer}.badge:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-radius:9999px;align-items:center;gap:.25rem;padding:.15rem .6rem;font-size:.75rem;font-weight:500;line-height:1;display:inline-flex}.badge-sm:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding:.0625rem .375rem;font-size:.6875rem}.badge-success:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-good-soft);color:var(--color-good)}.badge-warn:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-warn-soft);color:var(--color-warn)}.badge-bad:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-bad-soft);color:var(--color-bad)}.list-row-contain-sm:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){content-visibility:auto;contain-intrinsic-size:auto 2.25rem}.rp-place:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){container-type:size}.rp-mini:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--mini-top:calc(var(--safe-top) + 4.25rem);--mini-bottom:calc(var(--safe-bottom) + 5.5rem);--mini-left:calc(var(--safe-left) + .75rem);--mini-right:calc(var(--safe-right) + .75rem);width:min(max(140px,40vw),100vw - 1.5rem)}@media (min-width:768px){.rp-mini:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--mini-top:5rem;--mini-bottom:3rem;--mini-left:1rem;--mini-right:1rem;width:min(320px,100vw - 2rem)}}.rp-mini[data-corner=tl]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){top:var(--mini-top);left:var(--mini-left)}.rp-mini[data-corner=tr]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){top:var(--mini-top);right:var(--mini-right)}.rp-mini[data-corner=bl]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){bottom:var(--mini-bottom);left:var(--mini-left)}.rp-mini[data-corner=br]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){bottom:var(--mini-bottom);right:var(--mini-right)}.rp-picture:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){flex:none;width:100%;max-width:none;height:100%;max-height:none;display:block}@supports (width:1cqw){.rp-picture:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){object-fit:fill}.rp-picture[data-fit=fit]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:min(100cqw, 100cqh * var(--rp-shape));height:min(100cqh, 100cqw / var(--rp-shape))}.rp-picture[data-fit=fill]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:max(100cqw, 100cqh * var(--rp-shape));height:max(100cqh, 100cqw / var(--rp-shape))}.rp-picture[data-fit=stretch]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:100cqw;height:100cqh}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes ping{75%,to{opacity:0;transform:scale(2)}}@keyframes pulse{50%{opacity:.5}} /*$vite$:1*/</style> </head> <body style="margin: 0; background: #000"> diff --git a/site/pad/index.html b/site/pad/index.html index 429adcc5c..5b9222869 100644 --- a/site/pad/index.html +++ b/site/pad/index.html @@ -270,7 +270,7 @@ z AÍp\Ž0N˜HJê´ªØ^U I€wu¸öôú!3å6³‹âVq£³¹´RN£%y10º:pŠ#\:J:b9Hµ7h_Ž:¢I9 _¼™µV,þ <`});var w={a:v};this.setModule=t=>{e.setModule(fi,t)},this.getModule=()=>e.getModule(fi),this.instantiate=()=>(this.getModule().then(e=>WebAssembly.instantiate(e,w)).then(e=>{let t=e.exports;y(t),a=t.g,o(),ne(t),n()}),this.ready=new Promise(e=>{n=e}).then(()=>{this.HEAP=a.buffer,this.malloc=x,this.free=te,this.opus_frame_decoder_create=b,this.opus_frame_decode_float_deinterleaved=S,this.opus_frame_decoder_destroy=ee}),this)}var pi=o((()=>{}));function mi(e={}){mi.errors||Object.defineProperties(mi,{errors:{value:new Map([[-1,`OPUS_BAD_ARG: One or more invalid/out of range arguments`],[-2,`OPUS_BUFFER_TOO_SMALL: Not enough bytes allocated in the buffer`],[-3,`OPUS_INTERNAL_ERROR: An internal error was detected`],[-4,`OPUS_INVALID_PACKET: The compressed data passed is corrupted`],[-5,`OPUS_UNIMPLEMENTED: Invalid/unsupported request number`],[-6,`OPUS_INVALID_STATE: An encoder or decoder structure is invalid or already freed`],[-7,`OPUS_ALLOC_FAIL: Memory allocation has failed`]])}}),this._init=()=>new this._WASMAudioDecoderCommon(this).instantiate(this._EmscriptenWASM,this._module).then(e=>{this._common=e,this._inputBytes=0,this._outputSamples=0,this._frameNumber=0,this._input=this._common.allocateTypedArray(this._inputSize,Uint8Array),this._output=this._common.allocateTypedArray(this._outputChannels*this._outputChannelSize,Float32Array);let t=this._common.allocateTypedArray(this._channels,Uint8Array);t.buf.set(this._channelMappingTable),this._decoder=this._common.wasm.opus_frame_decoder_create(this._sampleRate,this._channels,this._streamCount,this._coupledStreamCount,t.ptr,this._preSkip,this._forceStereo)}),Object.defineProperty(this,"ready",{enumerable:!0,get:()=>this._ready}),this.reset=()=>(this.free(),this._init()),this.free=()=>{this._common.free(),this._common.wasm.opus_frame_decoder_destroy(this._decoder),this._common.wasm.free(this._decoder)},this._decode=e=>{if(!(e instanceof Uint8Array))throw Error(`Data to decode must be Uint8Array. Instead got `+typeof e);this._input.buf.set(e);let t=this._common.wasm.opus_frame_decode_float_deinterleaved(this._decoder,this._input.ptr,e.length,this._output.ptr),n;return t<0&&(n=`libopus `+t+` `+(mi.errors.get(t)||`Unknown Error`),console.error(n),t=0),{outputBuffer:this._common.getOutputChannels(this._output.buf,this._outputChannels,t),samplesDecoded:t,error:n}},this.decodeFrame=e=>{let t=[],n=this._decode(e);return n.error&&this._common.addError(t,n.error,e.length,this._frameNumber,this._inputBytes,this._outputSamples),this._frameNumber++,this._inputBytes+=e.length,this._outputSamples+=n.samplesDecoded,this._WASMAudioDecoderCommon.getDecodedAudioMultiChannel(t,[n.outputBuffer],this._outputChannels,n.samplesDecoded,this._sampleRate)},this.decodeFrames=e=>{let t=[],n=[],r=0,i=0;for(;i<e.length;){let a=e[i++],o=this._decode(a);t.push(o.outputBuffer),r+=o.samplesDecoded,o.error&&this._common.addError(n,o.error,a.length,this._frameNumber,this._inputBytes,this._outputSamples),this._frameNumber++,this._inputBytes+=a.length,this._outputSamples+=o.samplesDecoded}return this._WASMAudioDecoderCommon.getDecodedAudioMultiChannel(n,t,this._outputChannels,r,this._sampleRate)},this._isWebWorker=mi.isWebWorker,this._WASMAudioDecoderCommon=mi.WASMAudioDecoderCommon||ni,this._EmscriptenWASM=mi.EmscriptenWASM||fi,this._module=mi.module;let t=e=>typeof e==`number`,n=e.sampleRate,r=e.channels,i=e.streamCount,a=e.coupledStreamCount,o=e.channelMappingTable,s=e.preSkip,c=+!!e.forceStereo;if(r>2&&(!t(i)||!t(a)||!Array.isArray(o)))throw Error(`Invalid Opus Decoder Options for multichannel decoding.`);return this._sampleRate=[8e3,12e3,16e3,24e3,48e3].includes(n)?n:48e3,this._channels=t(r)?r:2,this._streamCount=t(i)?i:1,this._coupledStreamCount=t(a)?a:this._channels-1,this._channelMappingTable=o||(this._channels===2?[0,1]:[0]),this._preSkip=s||0,this._forceStereo=r<=8&&r!=2?c:0,this._inputSize=3840*this._channels,this._outputChannelSize=5760,this._outputChannels=this._forceStereo?2:this._channels,this._ready=this._init(),this}var hi=o((()=>{di(),pi()})),gi,_i=o((()=>{di(),pi(),hi(),gi=class extends si{constructor(e){super(e,`opus-decoder`,mi,fi)}async decodeFrame(e){return this.postToDecoder(`decodeFrame`,e)}async decodeFrames(e){return this.postToDecoder(`decodeFrames`,e)}}})),vi=c({OpusDecoder:()=>mi,OpusDecoderWebWorker:()=>gi}),yi=o((()=>{hi(),_i(),di(),li(mi,`OpusDecoder`),li(gi,`OpusDecoderWebWorker`)})),bi=[8e3,12e3,16e3,24e3,48e3],xi=null;function Si(){return xi??=Vn(()=>Promise.resolve().then(()=>(yi(),vi)),__VITE_PRELOAD__,import.meta.url).catch(e=>{throw xi=null,e}),xi}function Ci(){return typeof WebAssembly==`object`&&typeof WebAssembly.instantiate==`function`}function wi(e,t,n,r){return{numberOfFrames:t,numberOfChannels:e.length,sampleRate:n,timestamp:r,format:`f32-planar`,duration:Math.round(t/n*1e6),copyTo(n,r){n.set(e[r.planeIndex].subarray(0,t))},close(){}}}var Ti=class{constructor(e,t=Si){this.init=e,this.load=t,this.state=`unconfigured`,this.dec=null,this.pending=[]}configure(e){if(this.state===`closed`)throw Error(`the decoder is closed`);if(!Ci())throw Error(`no WebAssembly here`);let t=e.sampleRate;if(!bi.includes(t))throw Error(`Opus does not decode at ${t} Hz`);let n=e.numberOfChannels;if(n<1||n>2)throw Error(`${n} channels: only mono and stereo are decoded`);this.state=`configured`,this.load().then(async e=>{if(this.state===`closed`)return;let r=new e.OpusDecoder({channels:n,sampleRate:t});if(await r.ready,this.state!==`configured`){r.free();return}this.dec=r;let i=this.pending;this.pending=[];for(let e of i)this.state===`configured`&&this.run(e)}).catch(e=>this.fail(e))}decode(e){if(this.state!==`configured`)return;let t=e;if(this.dec)return this.run(t);this.pending.push({timestamp:t.timestamp,data:t.data.slice()}),this.pending.length>50&&this.pending.shift()}run(e){let t=this.dec;if(!t)return;let n;try{n=t.decodeFrame(e.data)}catch(e){return this.fail(e)}n.samplesDecoded&&n.channelData.length&&this.init.output(wi(n.channelData,n.samplesDecoded,n.sampleRate,e.timestamp))}fail(e){if(this.state===`closed`)return;this.close();let t=e instanceof Error?e:Error(String(e));queueMicrotask(()=>this.init.error(t))}close(){this.state=`closed`,this.pending=[];let e=this.dec;this.dec=null;try{e?.free()}catch{}}},Ei={makeDecoder:e=>new Ti(e),makeChunk:e=>({type:e.type,timestamp:e.timestamp,data:e.data instanceof Uint8Array?e.data:new Uint8Array(e.data)})};function Di(e,t){for(let n=0;n+3<e.length;n++)if(e[n]===0&&e[n+1]===0&&e[n+2]===1){if(t){let t=e[n+3]>>1&63;if(t>=16&&t<=21)return!0;if(t<16)return!1}else{let t=e[n+3]&31;if(t===5)return!0;if(t===1)return!1}}return!1}function Oi(e){for(let t=0;t+6<e.length;t++)if(e[t]===0&&e[t+1]===0&&e[t+2]===1&&(e[t+3]&31)==7){let n=e=>e.toString(16).padStart(2,`0`);return`avc1.${n(e[t+4])}${n(e[t+5])}${n(e[t+6])}`}return`avc1.4d4028`}var ki=[`hev1.1.6.L153.B0`,`hvc1.1.6.L153.B0`,`hev1.2.4.L153.B0`,`hvc1.2.4.L153.B0`,`hev1.1.6.L150.90`];async function Ai(e,t){if(typeof VideoDecoder>`u`)return null;for(let n of ki)try{if((await VideoDecoder.isConfigSupported({codec:n,codedWidth:e,codedHeight:t})).supported)return n}catch{}return null}function ji(e){let t=[];for(let n=0;n+2<e.length;n++)e[n]===0&&e[n+1]===0&&e[n+2]===1&&(t.push(n+3),n+=2);return t.map((n,r)=>{let i=r+1<t.length?t[r+1]-3:e.length;for(;i>n&&e[i-1]===0;)i--;return e.subarray(n,i)}).filter(e=>e.length>0)}var Mi=(e,t)=>t?e[0]>>1&63:e[0]&31;function j(e,...t){let n=8+t.reduce((e,t)=>e+t.length,0),r=new Uint8Array(n);new DataView(r.buffer).setUint32(0,n);for(let t=0;t<4;t++)r[4+t]=e.charCodeAt(t);let i=8;for(let e of t)r.set(e,i),i+=e.length;return r}function M(...e){let t=new Uint8Array(e.reduce((e,[,t])=>e+t,0)),n=0;for(let[r,i]of e){for(let e=i-1;e>=0;e--)t[n+i-1-e]=Math.floor(r/2**(8*e))&255;n+=i}return t}var Ni=(e,t,n,...r)=>j(e,M([t,1],[n,3]),...r),Pi=M([65536,4],[0,4],[0,4],[0,4],[65536,4],[0,4],[0,4],[0,4],[1073741824,4]);function Fi(e){let t=e.handler===`vide`,n=j(`ftyp`,new TextEncoder().encode(`isom`),M([1,4]),new TextEncoder().encode(`isomiso6mp41`)),r=j(`moov`,Ni(`mvhd`,0,0,M([0,4],[0,4],[e.timescale,4],[0,4],[65536,4],[256,2],[0,2],[0,4],[0,4]),Pi,new Uint8Array(24),M([2,4])),j(`trak`,Ni(`tkhd`,0,3,M([0,4],[0,4],[1,4],[0,4],[0,4],[0,4],[0,4],[0,2],[0,2],[t?0:256,2],[0,2]),Pi,M([(e.width??0)*65536,4],[(e.height??0)*65536,4])),j(`mdia`,Ni(`mdhd`,0,0,M([0,4],[0,4],[e.timescale,4],[0,4],[21956,2],[0,2])),Ni(`hdlr`,0,0,M([0,4]),new TextEncoder().encode(e.handler),new Uint8Array(12),M([0,1])),j(`minf`,t?Ni(`vmhd`,0,1,new Uint8Array(8)):Ni(`smhd`,0,0,M([0,4])),j(`dinf`,Ni(`dref`,0,0,M([1,4]),Ni(`url `,0,1))),j(`stbl`,Ni(`stsd`,0,0,M([1,4]),e.sampleEntry),Ni(`stts`,0,0,M([0,4])),Ni(`stsc`,0,0,M([0,4])),Ni(`stsz`,0,0,M([0,4],[0,4])),Ni(`stco`,0,0,M([0,4])))))),j(`mvex`,Ni(`trex`,0,0,M([1,4],[1,4],[0,4],[0,4],[0,4])))),i=new Uint8Array(n.length+r.length);return i.set(n,0),i.set(r,n.length),i}function Ii(e,t,n,r,i){let a=i?33554432:16842752,o=e=>Ni(`trun`,0,1793,M([1,4],[e,4],[n,4],[r.length,4],[a,4])),s=e=>j(`traf`,Ni(`tfhd`,0,131072,M([1,4])),Ni(`tfdt`,1,0,M([t,8])),o(e)),c=Ni(`mfhd`,0,0,M([e,4])),l=j(`moof`,c,s(0)).length,u=j(`moof`,c,s(l+8)),d=j(`mdat`,r),f=new Uint8Array(u.length+d.length);return f.set(u,0),f.set(d,u.length),f}function Li(e,t,n=!1){let r=t?[35,...n?[32,33,34]:[]]:[9,...n?[7,8]:[]],i=ji(e).filter(e=>!r.includes(Mi(e,t))),a=new Uint8Array(i.reduce((e,t)=>e+4+t.length,0)),o=new DataView(a.buffer),s=0;for(let e of i)o.setUint32(s,e.length),a.set(e,s+4),s+=4+e.length;return a}var Ri=e=>e.toString(16).padStart(2,`0`),zi=e=>{let t=new Uint8Array(2+e.length);return t[0]=e.length>>8,t[1]=e.length&255,t.set(e,2),t},Bi=e=>{let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),n=0;for(let r of e)t.set(r,n),n+=r.length;return t};function Vi(e){let t=ji(e),n=t.filter(e=>Mi(e,!1)===7),r=t.filter(e=>Mi(e,!1)===8);return!n.length||!r.length||n[0].length<4?null:Bi([M([1,1],[n[0][1],1],[n[0][2],1],[n[0][3],1],[255,1],[224|n.length,1]),...n.map(zi),M([r.length,1]),...r.map(zi)])}function Hi(e,t,n){let r=ji(e),i=e=>r.filter(n=>Mi(n,t)===e),a=(e,t)=>j(e,new Uint8Array(6),M([1,2],[0,16],[n.w,2],[n.h,2],[4718592,4],[4718592,4],[0,4],[1,2]),new Uint8Array(32),M([24,2],[65535,2]),t);if(!t){let t=i(7),r=Vi(e);return r?{init:Fi({handler:`vide`,timescale:9e4,sampleEntry:a(`avc1`,j(`avcC`,r)),width:n.w,height:n.h}),mime:`video/mp4; codecs="avc1.${Ri(t[0][1])}${Ri(t[0][2])}${Ri(t[0][3])}"`}:null}let o=i(32),s=i(33),c=i(34);if(!o.length||!s.length||!c.length)return null;let l=Vr(s[0]);if(l.length<15)return null;let u=l.subarray(3,15),d=u[0]&31,f=d===2?2:0,p=(e,t)=>Bi([M([128|e,1],[t.length,2]),...t.map(zi)]),m=j(`hvcC`,M([1,1]),u,M([61440,2],[252,1],[253,1],[248|f,1],[248|f,1],[0,2],[15,1],[3,1]),p(32,o),p(33,s),p(34,c)),h=[``,`A`,`B`,`C`][u[0]>>6],g=0,_=(u[1]<<24|u[2]<<16|u[3]<<8|u[4])>>>0;for(let e=0;e<32;e++)_&1<<e&&(g|=1<<31-e);let v=Array.from(u.subarray(5,11));for(;v.length&&v[v.length-1]===0;)v.pop();let y=[`hvc1.${h}${d}`,(g>>>0).toString(16),`${u[0]&32?`H`:`L`}${u[11]}`,...v.map(e=>e.toString(16))].join(`.`);return{init:Fi({handler:`vide`,timescale:9e4,sampleEntry:a(`hvc1`,m),width:n.w,height:n.h}),mime:`video/mp4; codecs="${y}"`}}function Ui(e,t,n,r,i,a){return Ii(e,t,n,Li(r,i),a)}function Wi(e,t){let n=j(`dOps`,M([0,1],[e,1],[312,2],[t,4],[0,2],[0,1]));return Fi({handler:`soun`,timescale:48e3,sampleEntry:j(`Opus`,new Uint8Array(6),M([1,2],[0,8],[e,2],[16,2],[0,4],[3145728e3,4]),n)})}function Gi(e){if(!e.length)return 960;let t=e[0]>>3,n=t<12?[480,960,1920,2880][t%4]:t<16?[480,960][t%2]:[120,240,480,960][t%4],r=e[0]&3,i=r===0?1:r===3?(e[1]??1)&63:2;return n*Math.max(1,i)}function Ki(e,t,n){return Ii(e,t,Gi(n),n,!0)}var qi={watch:30,player:4},Ji={watch:{seek:.5,speed:1/0,target:.05},player:{seek:.15,speed:.06,target:.02}},Yi={seek:.8,speed:.25,target:.12};function Xi(e,t,n){let r=typeof n==`string`?Ji[n]:n;return e>r.seek?{seekTo:t-r.target,rate:1}:e>r.speed?{seekTo:null,rate:1.1}:{seekTo:null,rate:1}}function Zi(e,t=`watch`,n){return typeof VideoDecoder<`u`?new ca(e,t,n):new ba(e,t,n)}var Qi=class{constructor(e,t=()=>performance.now()){this.ask=e,this.now=t,this.last=-1/0}waiting(){if(!this.ask)return;let e=this.now();e-this.last<1e3||(this.last=e,this.ask())}};function $i(e){return e.length<3?null:{index:e[0]<<8|e[1],packet:e.subarray(2)}}var ea=class{constructor(){this.last=-1}take(e){if(this.last>=0){let t=e-this.last&65535;if(t===0||t>=32768)return!1}return this.last=e,!0}reset(){this.last=-1}};function ta(e){if(e.length>=10)return e;let t=new Uint8Array(10);t.set(e.subarray(0,6));let n=new DataView(t.buffer);return n.setUint32(6,Math.round(n.getUint32(2)/100)||480),t}function na(e,t){return{snd:e,snd_decoded:t.decoded,snd_concealed:t.concealed,snd_underruns:t.underruns,snd_dropped:t.dropped}}var ra=class{constructor(e,t=.2){this.min=e,this.max=t,this.next=0,this.calmSince=0,this.minLead=1/0,this.windowAt=0,this.underruns=0,this.dropped=0,this.cushion=e}at(e,t){this.next<e+.005?(this.next>0&&(this.underruns++,this.cushion=Math.min(this.max,this.cushion+.02)),this.calmSince=e,this.next=e+this.cushion,this.minLead=1/0,this.windowAt=e):e-this.calmSince>10&&this.cushion>this.min&&(this.cushion=Math.max(this.min,this.cushion-.01),this.calmSince=e);let n=this.next-e;if(n>this.cushion+.15)return this.dropped++,null;if(this.minLead=Math.min(this.minLead,n),e-this.windowAt>=.25){let t=this.minLead>this.cushion+ia;if(this.minLead=1/0,this.windowAt=e,t)return this.dropped++,null}let r=this.next;return this.next+=t,r}reset(){this.next=0}},ia=.02;async function aa(e,t){try{return typeof AudioDecoder>`u`?!1:!!(await AudioDecoder.isConfigSupported({codec:`opus`,sampleRate:e,numberOfChannels:t})).supported}catch{return!1}}var oa=class{constructor(e,t=()=>performance.now()){this.decoder=e,this.now=t,this.n={frames:0,dropped:0,late:0,stalls:0,stall_ms:0,worst_stall_ms:0,key_waits:0},this.a=0,this.d=0,this.w=!1,this.q=[],this.sum=0,this.cnt=0,this.codec=``}get frames(){return this.n.frames}arrived(){let e=this.now();this.a&&e-this.a>50&&this.n.late++,this.a=e}drop(){this.n.dropped++,this.w||this.n.key_waits++,this.w=!0}decoding(){this.w=!1,this.q.push(this.now())>64&&this.q.shift()}drawn(e=!1){let t=this.now(),n=e?this.q.shift():void 0;n!==void 0&&(this.sum+=t-n,this.cnt++);let r=this.d?t-this.d:0;r>100&&this.stall(r),this.d=t,this.n.frames++}stall(e){this.n.stalls++,this.n.stall_ms+=e,this.n.worst_stall_ms=Math.max(this.n.worst_stall_ms,e)}snapshot(){let e=this.d?this.now()-this.d:0,t={...this.n,decoder:this.decoder};this.codec&&(t.codec=this.codec),e>100&&(t.stalls=this.n.stalls+1,t.stall_ms=this.n.stall_ms+e,t.worst_stall_ms=Math.max(this.n.worst_stall_ms,e));for(let e of[`stall_ms`,`worst_stall_ms`])t[e]=Math.round(t[e]);return t.decode_ms=this.cnt?Math.round(this.sum/this.cnt*10)/10:0,this.sum=this.cnt=0,t}},sa=[`pointerup`,`touchend`,`click`,`keydown`],ca=class{get element(){if(!this.wrap){let e=document.createElement(`div`);e.className=`h-full w-full`,e.append(this.canvas),this.mse&&e.append(this.mse.element),this.wrap=e}return this.wrap}get stats(){return this.mse?.stats??this.ownStats}soundReport(){return this.soundOn?this.mseSound?this.mseSound.report():na(this.soundWasm?`wasm`:`webcodecs`,this.soundStats):null}constructor(e,t=`watch`,n){this.onProblem=e,this.latency=t,this.onNeedKey=n,this.canvas=document.createElement(`canvas`),this.wrap=null,this.mse=null,this.failsNoPicture=0,this.ctx=this.canvas.getContext(`2d`,{alpha:!1}),this.hevc=!1,this.header=null,this.spsRect=null,this.software=!1,this.video=null,this.opening=!1,this.stopped=!1,this.sawKey=!1,this.ownStats=new oa(`webcodecs`),this.problemShown=!1,this.ts=0,this.pipe=null,this.audioGen=0,this.actx=null,this.soundOn=!1,this.unarm=null,this.mseSound=null,this.audioHeader=null,this.soundWasm=!1,this.onSoundFail=null,this.muted=!1,this.keyAsk=new Qi(n),this.clock=new ra(t===`player`?.05:.08),typeof AudioDecoder>`u`&&N()&&(this.mseSound=new P(t,()=>this.mseSoundFailed())),this.canvas.className=`block h-full w-full object-contain`,this.canvas.dataset.testid=`watch-canvas`}setHevc(e){this.hevc=e,this.header&&(this.spsRect=qr(this.header,e)),this.mse?.setHevc(e)}get onMse(){return!!this.mse}decodeFailed(){if(this.mse||this.ownStats.frames>0||++this.failsNoPicture<3||!fa())return!1;let e=new ba(this.onProblem,this.latency,this.onNeedKey);e.setHevc(this.hevc),e.markProblemShown(),this.mse=e;let t=this.video;this.video=null;try{t?.close()}catch{}return this.canvas.style&&(this.canvas.style.display=`none`),this.wrap?.append(e.element),this.header&&e.onMessage(new Uint8Array([0,...this.header]).buffer),this.onNeedKey?.(),!0}startSound(){this.soundOn=!0,la(),this.mseSound?this.mseSound.start():this.openContext()}openContext(){try{if(!this.actx){let e=new AudioContext({latencyHint:`interactive`});this.actx=e,e.onstatechange=()=>{this.actx===e&&e.state!==`running`&&e.state!==`closed`&&this.armResume()}}this.actx.resume().catch(()=>{})}catch{this.onSoundFail?.()}}get sound(){return this.soundOn}setMuted(e){this.muted=e,this.mseSound?.setMuted(e)}resumeSound(){if(!this.soundOn)return;if(this.mseSound)return this.mseSound.resume();let e=this.actx;e&&e.state!==`running`&&e.state!==`closed`&&(this.clock.reset(),e.resume().catch(()=>{}),this.armResume())}get soundStats(){return{decoded:this.pipe?.decoded??0,concealed:this.pipe?.concealed??0,underruns:this.clock.underruns,dropped:this.clock.dropped,cushionMs:Math.round(this.clock.cushion*1e3)}}armResume(){if(this.unarm||typeof window>`u`||!window.addEventListener)return;let e=()=>{let e=this.actx;if(!e||e.state===`closed`)return this.unarm?.();this.clock.reset(),e.resume().then(()=>{e.state===`running`&&this.unarm?.()}).catch(()=>{})};for(let t of sa)window.addEventListener(t,e,!0);this.unarm=()=>{for(let t of sa)window.removeEventListener(t,e,!0);this.unarm=null}}onMessage(e){let t=new Uint8Array(e);if(t.length<1||this.stopped)return;let n=t[0],r=t.subarray(1);if(this.mse&&(n===0||n===1))return n===0&&(this.header=r.slice()),this.mse.onMessage(e);n===0?this.openVideo(r.slice()):n===1?this.onVideo(r):n===3?this.openAudio(r.slice()):n===4&&this.onAudio(r)}async openVideo(e){if(this.header=e,this.spsRect=qr(e,this.hevc),!this.opening){this.opening=!0;try{let t=this.hevc?await xa(e):Oi(e);if(this.mse||this.stopped)return;if(!t){this.problemShown=!0,this.onProblem(`no_hevc`);return}this.ownStats.codec=t;let n=this.hevc?void 0:Vi(e)??void 0;try{this.video?.close()}catch{}let r=new VideoDecoder({output:e=>{let t=this.realVisible(e),n=this.canvas;(n.width!==t.displayWidth||n.height!==t.displayHeight)&&(n.width=t.displayWidth,n.height=t.displayHeight),this.ctx?.drawImage(t,0,0,n.width,n.height),this.ownStats.drawn(!0),t.close(),this.problemShown&&(this.problemShown=!1,this.onProblem(null))},error:()=>{this.video===r&&(this.problemShown=!0,this.onProblem(`decode`),this.decodeFailed()||this.rebuild())}}),i={codec:t,optimizeForLatency:!0};n&&(i.description=n),this.software&&(i.hardwareAcceleration=`prefer-software`),r.configure(i),this.video=r,this.sawKey=!1}catch{this.problemShown=!0,this.onProblem(`decode`),this.decodeFailed()}finally{this.opening=!1}}}realVisible(e){let t=this.spsRect,n=Jr(e,t);if(n)try{let t=new VideoFrame(e,{visibleRect:{x:n.x,y:n.y,width:n.w,height:n.h},displayWidth:n.w,displayHeight:n.h});return e.close(),t}catch{return e}let r=e.visibleRect;if(t&&r&&!this.software&&(r.width<t.w-16||r.height<t.h-16)){this.software=!0;let e=this.video;queueMicrotask(()=>{if(this.video===e){try{e?.close()}catch{}this.rebuild(),this.onNeedKey?.()}})}return e}rebuild(){this.mse||this.stopped||(this.video=null,this.sawKey=!1,this.header&&this.openVideo(this.header).then(()=>this.keyAsk.waiting()))}onVideo(e){let t=this.video;if(t?.state===`closed`){this.opening||this.rebuild();return}if(!t||t.state!==`configured`)return;let n=Di(e,this.hevc);if(this.ownStats.arrived(),!this.sawKey&&!n)return this.ownStats.drop(),this.keyAsk.waiting();if(!n&&t.decodeQueueSize>qi[this.latency])return this.sawKey=!1,this.ownStats.drop(),this.keyAsk.waiting();this.sawKey=!0;let r=e;this.hevc?n&&this.header&&(r=new Uint8Array(this.header.length+e.length),r.set(this.header,0),r.set(e,this.header.length)):r=Li(e,!1,!0),this.ts+=16667,this.ownStats.decoding(),t.decode(new EncodedVideoChunk({type:n?`key`:`delta`,timestamp:this.ts,data:r}))}openAudio(e){if(e.length<6)return;let t=++this.audioGen;if(this.pipe?.reset(),this.pipe=null,this.clock.reset(),this.audioHeader=e,this.mseSound)return this.mseSound.setHeader(e);let n=e[0];aa(new DataView(e.buffer,e.byteOffset,e.byteLength).getUint32(2),n).then(n=>{if(t!==this.audioGen)return;if(!n)return N()?this.soundThroughMse(e):this.soundThroughWasm(e);let r=new Qr((e,t)=>this.play(e,t,r.sampleRate));try{r.header(ta(e)),this.pipe=r}catch{this.soundThroughMse(e)}})}soundThroughMse(e){this.pipe=null,this.mseSound||(this.mseSound=new P(this.latency,()=>this.mseSoundFailed()),this.soundOn&&this.mseSound.start()),this.mseSound.setHeader(e)}soundThroughWasm(e){this.pipe?.reset(),this.soundWasm=!0;let t=new Qr((e,n)=>this.play(e,n,t.sampleRate),Ei,()=>{this.pipe===t&&(this.pipe=null),this.onSoundFail?.()});this.pipe=t,t.header(ta(e))}mseSoundFailed(){let e=this.mseSound;e&&(this.mseSound=null,e.stop(),this.soundOn&&(this.openContext(),this.actx&&this.actx.state!==`running`&&this.armResume()),this.audioHeader&&this.soundThroughWasm(this.audioHeader))}onAudio(e){if(this.mseSound)return this.mseSound.frame(e);this.soundOn&&this.pipe&&this.pipe.packet(e)}play(e,t,n){let r=this.actx;if(!r||r.state!==`running`||!e.length)return;let i=e[0].length,a=this.clock.at(r.currentTime,i/n);if(a===null)return;let o=r.createBuffer(e.length,i,n),s=this.muted?0:t;e.forEach((e,t)=>o.copyToChannel(s===1?e:e.map(e=>e*s),t));let c=r.createBufferSource();c.buffer=o,c.connect(r.destination),c.start(a)}stop(){this.stopped=!0;try{this.video?.close()}catch{}this.mse?.stop(),this.audioGen++,this.pipe?.reset(),this.pipe=null,this.unarm?.(),this.actx?.close().catch(()=>{}),this.mseSound?.stop()}};function la(){try{let e=navigator.audioSession;e&&e.type!==`playback`&&(e.type=`playback`)}catch{}}function ua(e,t){try{return e.isTypeSupported(t)}catch{return!1}}function N(){let e=typeof window>`u`?null:fa();return!!e&&(ua(e,`audio/mp4; codecs="Opus"`)||ua(e,`audio/mp4; codecs="opus"`))}var P=class{constructor(e,t,n=document.createElement(`audio`)){this.onFail=t,this.header=null,this.time=0,this.on=!1,this.failed=!1,this.order=new ea,this.el=n,this.track=new ga(n,()=>this.fail(),e===`player`?Yi:e)}get playing(){return this.on&&!this.failed}report(){return{snd:`mse`,snd_jumps:this.track.seeks}}setHeader(e){this.header=e,this.on&&this.open()}start(){if(!this.on&&(this.on=!0,this.header&&this.open(),!this.failed))try{this.el.play()?.catch?.(()=>{})}catch{}}frame(e){if(!this.on||this.failed||!this.track.ready&&!this.track.backlog)return;let t=$i(e);if(!t||!this.order.take(t.index))return;let n=Ki(this.track.nextSeq(),this.time,t.packet);this.time+=Gi(t.packet),this.track.push(n)}setMuted(e){this.el.muted=e}resume(){if(this.playing&&this.el.paused)try{this.el.play()?.catch?.(()=>{})}catch{}}stop(){this.on=!1,this.track.close()}open(){let e=this.header;if(!e||e.length<6||this.failed)return;let t=e[0],n=Wi(t,new DataView(e.buffer,e.byteOffset,e.byteLength).getUint32(2));this.track.open(`audio/mp4; codecs="Opus"`,n)||this.track.open(`audio/mp4; codecs="opus"`,n)?(this.time=0,this.order.reset()):this.fail()}fail(){this.failed||(this.failed=!0,this.onFail())}},da=class{constructor(e,t,n=Ei){this.onFail=t,this.codecs=n,this.actx=null,this.pipe=null,this.header=null,this.on=!1,this.failed=!1,this.muted=!1,this.unarm=null,this.played=!1,this.clock=new ra(e===`player`?.05:.08)}get playing(){return this.on&&!this.failed}get stats(){return{decoded:this.pipe?.decoded??0,concealed:this.pipe?.concealed??0,underruns:this.clock.underruns,dropped:this.clock.dropped}}start(){if(!this.failed){this.on=!0,la();try{if(!this.actx){let e=new AudioContext({latencyHint:`interactive`});this.actx=e,e.onstatechange=()=>{this.actx===e&&e.state!==`running`&&e.state!==`closed`&&this.armResume()}}this.actx.resume().catch(()=>{}),this.actx.state!==`running`&&this.armResume()}catch{return this.fail()}this.header&&!this.pipe&&this.open()}}setHeader(e){e.length<6||(this.header=e,this.pipe?.reset(),this.pipe=null,this.clock.reset(),this.on&&this.open())}frame(e){this.on&&!this.failed&&this.pipe?.packet(e)}setMuted(e){this.muted=e}resume(){let e=this.actx;this.playing&&e&&e.state!==`running`&&e.state!==`closed`&&(this.clock.reset(),e.resume().catch(()=>{}),this.armResume())}stop(){this.on=!1,this.pipe?.reset(),this.pipe=null,this.unarm?.(),this.actx?.close().catch(()=>{}),this.actx=null}open(){let e=this.header;if(!e||this.failed)return;let t=new Qr((e,n)=>this.play(e,n,t.sampleRate),this.codecs,()=>{this.pipe===t&&this.fail()});this.pipe=t,t.header(ta(e))}play(e,t,n){let r=this.actx;if(!r||r.state!==`running`||!e.length)return;let i=e[0].length,a=this.clock.at(r.currentTime,i/n);if(a===null)return;let o=r.createBuffer(e.length,i,n),s=this.muted?0:t;e.forEach((e,t)=>o.copyToChannel(s===1?e:e.map(e=>e*s),t));let c=r.createBufferSource();c.buffer=o,c.connect(r.destination),c.start(a),this.played=!0}armResume(){if(this.unarm||typeof window>`u`||!window.addEventListener)return;let e=()=>{let e=this.actx;if(!e||e.state===`closed`)return this.unarm?.();this.clock.reset(),e.resume().then(()=>{e.state===`running`&&this.unarm?.()}).catch(()=>{})};for(let t of sa)window.addEventListener(t,e,!0);this.unarm=()=>{for(let t of sa)window.removeEventListener(t,e,!0);this.unarm=null}}fail(){this.failed||(this.failed=!0,this.stop(),this.onFail())}};function fa(){let e=window;return e.ManagedMediaSource??e.MediaSource??null}var pa=10,ma=3;function ha(e,t,n,r=ma){let i=null;for(let a of e)a>t&&a<=n-r&&(i=a);return i}var ga=class{constructor(e,t,n=`watch`,r,i=()=>performance.now()){this.el=e,this.onError=t,this.latency=n,this.onNeedKey=r,this.now=i,this.ms=null,this.sb=null,this.queue=[],this.mime=``,this.seq=1,this.ready=!1,this.dropped=!1,this.keys=null,this.seeks=0,this.maxLagS=0,this.fromZero=0,this.trims=0,this.lastJump=null,this.trimAt=-1,this.trimFrom=-1,this.keyAt=-1,this.attached=null,r&&(this.keys=[])}setEdge(e){this.latency=e}markKey(e){this.keys?.push(e),this.keyAt=this.now()}open(e,t){let n=fa();if(!n||!ua(n,e))return!1;this.close();let r=new n;return this.ms=r,this.mime=e,this.queue=[t],this.seq=1,this.ready=!1,this.keys&&=[],r.addEventListener(`sourceopen`,()=>{if(this.ms===r)try{let e=r.addSourceBuffer(this.mime);e.mode=`segments`,e.addEventListener(`updateend`,()=>this.pump()),e.addEventListener(`error`,()=>this.onError()),this.sb=e,this.ready=!0,this.pump()}catch{this.onError()}}),`ManagedMediaSource`in window&&n===window.ManagedMediaSource&&(this.el.disableRemotePlayback=!0),this.attached=_a(this.el,r),!0}nextSeq(){return this.seq++}get backlog(){return this.queue.length}push(e){this.queue.push(e),this.pump()}pump(){let e=this.sb;if(!e||e.updating||!this.ready)return;let t=this.el;if(e.buffered.length){let n=e.buffered.end(e.buffered.length-1),r=e.buffered.start(0),i=n-t.currentTime,a=Xi(i,n,this.latency);if(a.seekTo!==null){this.seeks++,this.maxLagS=Math.max(this.maxLagS,i);let o=this.now(),s=e=>e<0?-1:Math.round(o-e);t.currentTime<.05&&r>1&&this.fromZero++,this.lastJump={at:t.currentTime,start:r,end:n,ranges:e.buffered.length,readyState:t.readyState,paused:t.paused,seeking:t.seeking,sinceTrimMs:s(this.trimAt),trimFrom:this.trimFrom,sinceKeyMs:s(this.keyAt)},t.currentTime=Math.max(r,a.seekTo)}if(t.playbackRate!==a.rate&&(t.playbackRate=a.rate),t.currentTime-r>pa&&this.trim(e,r))return}let n=this.queue.shift();if(n){try{e.appendBuffer(n)}catch{this.dropped=!0}t.paused&&t.play().catch(()=>{})}}trim(e,t){let n=this.el.currentTime,r=n-ma;if(this.keys){if(r=ha(this.keys,t,n),r===null)return(this.keys[this.keys.length-1]??-1/0)<=n-ma&&this.onNeedKey?.(),!1;let e=r;this.keys=this.keys.filter(t=>t>=e),r-=.001}try{return e.remove(t,r),this.trims++,this.trimAt=this.now(),this.trimFrom=n,!0}catch{return!1}}close(){this.ready=!1,this.sb=null,this.queue=[];let e=this.ms;if(this.ms=null,e&&e.readyState===`open`)try{e.endOfStream()}catch{}if(this.attached===`object`)try{this.el.srcObject=null}catch{}this.attached=null,this.el.src?.startsWith(`blob:`)&&URL.revokeObjectURL(this.el.src),this.el.removeAttribute(`src`)}};function _a(e,t){if(`srcObject`in e)try{return e.srcObject=t,`object`}catch{}return e.src=URL.createObjectURL(t),`url`}var va=1e4,ya=class{constructor(e=3,t=va,n=()=>performance.now()){this.max=e,this.windowMs=t,this.now=n,this.at=[]}fail(){let e=this.now();return this.at=this.at.filter(t=>e-t<this.windowMs),this.at.push(e),this.at.length>=this.max}clear(){this.at=[]}},ba=class{constructor(e,t=`watch`,n,r){this.onProblem=e,this.latency=t,this.wasm=null,this.audioHeader=null,this.muted=!1,this.gaveUp=!1,this.reopening=!1,this.failedWhileOpening=!1,this.wrap=document.createElement(`div`),this.hevc=!1,this.header=null,this.sawKey=!1,this.stats=new oa(`mse`),this.problemShown=!1,this.vTime=0,this.vLast=0,this.soundOn=!1,this.onSoundFail=null,this.onGiveUp=null,this.keyAsk=new Qi(n),this.fails=new ya(3,va,r);let i=document.createElement(`video`);i.muted=!0,i.autoplay=!0,i.playsInline=!0,i.className=`block h-full w-full object-contain`,i.dataset.testid=`watch-video`,this.audio=new P(t,()=>this.soundThroughWasm()),this.wrap.className=`h-full w-full`,this.wrap.append(i,this.audio.el),this.video=new ga(i,()=>this.showProblem(),t,()=>this.keyAsk.waiting()),i.addEventListener(`error`,()=>this.restartVideo()),i.addEventListener(`playing`,()=>{this.fails.clear(),this.problemShown&&(this.problemShown=!1,this.onProblem(null))})}markProblemShown(){this.problemShown=!0}showProblem(){this.problemShown||(this.problemShown=!0,this.onProblem(`decode`))}restartVideo(){if(this.gaveUp)return;if(this.reopening){this.failedWhileOpening=!0;return}if(this.showProblem(),this.fails.fail()){this.gaveUp=!0,this.video.close(),this.onGiveUp?.();return}let e=this.header;if(e){this.header=null,this.reopening=!0,this.failedWhileOpening=!1;try{this.openVideo(e)}finally{this.reopening=!1}this.sawKey=!1,this.keyAsk.waiting(),this.failedWhileOpening&&(this.failedWhileOpening=!1,this.restartVideo())}}get failed(){return this.gaveUp}setVideoEdge(e){this.video.setEdge(e)}get videoSeeks(){return{seeks:this.video.seeks,maxLagMs:Math.round(this.video.maxLagS*1e3),fromZero:this.video.fromZero,trims:this.video.trims,lastJump:this.video.lastJump}}get element(){return this.wrap}resume(){let e=this.video.el;e.paused&&e.play()?.catch?.(()=>{})}setHevc(e){this.hevc=e}startSound(){if(this.soundOn=!0,this.wasm)return this.wasm.start();if(!N())return this.soundThroughWasm();this.audio.start()}soundThroughWasm(){if(this.wasm)return;this.audio.stop();let e=new da(this.latency,()=>this.onSoundFail?.());this.wasm=e,e.setMuted(this.muted),this.audioHeader&&e.setHeader(this.audioHeader),this.soundOn&&e.start()}resumeSound(){this.soundOn&&(this.wasm?this.wasm.resume():this.audio.resume())}setMuted(e){this.muted=e,this.audio.setMuted(e),this.wasm?.setMuted(e)}soundReport(){return this.soundOn?this.wasm?na(`wasm`,this.wasm.stats):this.audio.report():null}get soundPlaying(){return this.wasm?this.wasm.played:this.audio.playing}get sound(){return this.soundOn}onMessage(e){let t=new Uint8Array(e);if(t.length<1)return;let n=t[0],r=t.subarray(1);n===0?this.openVideo(r.slice()):n===1?this.onVideo(r):n===3?(this.audioHeader=r.slice(),(this.wasm??this.audio).setHeader(this.audioHeader)):n===4&&(this.wasm??this.audio).frame(r)}openVideo(e){let t=!!this.header&&this.header.length===e.length&&this.header.every((t,n)=>t===e[n]);if(t&&this.video.ready)return;if(this.gaveUp){if(t)return;this.gaveUp=!1,this.fails.clear()}this.header=e;let n=qr(e,this.hevc)??{w:1920,h:1080},r=Hi(e,this.hevc,n);r&&(this.stats.codec=/codecs="([^"]+)"/.exec(r.mime)?.[1]??``,this.video.open(r.mime,r.init)?(this.sawKey=!1,this.vTime=0,this.vLast=0):(this.problemShown=!0,this.onProblem(this.hevc?`no_hevc`:`decode`)))}onVideo(e){if(!this.video.ready&&!this.video.backlog)return;let t=Di(e,this.hevc);if(this.video.dropped&&(this.video.dropped=!1,this.sawKey=!1),this.stats.arrived(),!this.sawKey&&!t)return this.stats.drop(),this.keyAsk.waiting();if(!t&&this.video.backlog>qi[this.latency])return this.sawKey=!1,this.stats.drop(),this.keyAsk.waiting();this.sawKey=!0,this.stats.drawn();let n=performance.now(),r=this.vLast?Math.min(9e3,Math.max(750,Math.round((n-this.vLast)*90))):1500;this.vLast=n,t&&this.video.markKey(this.vTime/9e4),this.video.push(Ui(this.video.nextSeq(),this.vTime,r,e,this.hevc,t)),this.vTime+=r}stop(){this.video.close(),this.audio.stop(),this.wasm?.stop()}};async function xa(e){let t=Yr(e);if(t&&typeof VideoDecoder<`u`)try{if((await VideoDecoder.isConfigSupported({codec:t,codedWidth:1920,codedHeight:1080})).supported)return t}catch{}return Ai(1920,1080)}var F={CROSS:1,CIRCLE:2,SQUARE:4,TRIANGLE:8,LEFT:16,RIGHT:32,UP:64,DOWN:128,L1:256,R1:512,L3:1024,R3:2048,OPTIONS:4096,SHARE:8192,TOUCHPAD:16384,PS:32768},Sa={buttons:0,l2:0,r2:0,lx:0,ly:0,rx:0,ry:0};function Ca(e,t){let n=e=>Math.max(0,Math.min(1,e));return[Math.round(n(e)*1919),Math.round(n(t)*941)]}F.UP,F.DOWN,F.LEFT,F.RIGHT,F.CROSS,F.CROSS,F.CIRCLE,F.CIRCLE,F.SQUARE,F.TRIANGLE,F.L1,F.R1,F.L3,F.R3,F.OPTIONS,F.SHARE,F.PS,F.TOUCHPAD,F.UP,F.DOWN,F.LEFT,F.RIGHT,F.CROSS,F.CIRCLE,F.SQUARE,F.TRIANGLE,F.L1,F.R1,F.L3,F.R3,F.OPTIONS,F.SHARE,F.PS,F.TOUCHPAD;var wa=e=>Math.max(-32768,Math.min(32767,Math.round(e))),Ta=[F.CROSS,F.CIRCLE,F.SQUARE,F.TRIANGLE,F.L1,F.R1,0,0,F.SHARE,F.OPTIONS,F.L3,F.R3,F.UP,F.DOWN,F.LEFT,F.RIGHT,F.PS,F.TOUCHPAD];function Ea(e){return Math.abs(e)<=1.01?Math.round((e+1)*3.5)%8:null}var Da=[0,1,1,1,0,-1,-1,-1],Oa=[-1,-1,0,1,1,1,0,-1];function ka(e,t){let n=e.axes[t.a]??0;if(t.hat){let e=Ea(n);return e===null?0:(t.hat===`x`?Da:Oa)[e]}return t.inv?-n:n}var Aa={buttons:Ta.flatMap((e,t)=>e?[[e,{b:t}]]:[]),l2:{b:6},r2:{b:7},lx:{a:0},ly:{a:1},rx:{a:2},ry:{a:3}};function ja(e,t,n=!1){if(`b`in t){let r=e.buttons[t.b];return r?n&&r.value>0?Math.min(1,r.value):Math.max(+!!r.pressed,r.value):0}if(`h`in t){let n=Ea(e.axes[t.h]??9);if(n===null)return 0;let r=(n-t.at+8)%8;return+(r===0||r===1||r===7)}let r=e.axes[t.a];if(r===void 0)return 0;let i=t.rest??0;return Math.min(1,Math.max(0,(r-i)/(t.d-i)))}function Ma(e){if(e.mapping===`standard`)return Aa;let t=Na.get(e.id);if(t)return t;let n=e.axes.findIndex(e=>Math.abs(e)>1.05);if(n<0)return Aa;let r={...Aa,buttons:[...Aa.buttons,[F.UP,{h:n,at:0}],[F.RIGHT,{h:n,at:2}],[F.DOWN,{h:n,at:4}],[F.LEFT,{h:n,at:6}]]};return Na.set(e.id,r),r}var Na=new Map;function Pa(e,t=Ma){let n={...Sa},r=e=>Math.abs(e)<.08?0:wa(e*32767),i=(e,t)=>Math.abs(t)>Math.abs(e)?t:e,a=(e,t)=>t?r(ka(e,t)):0;for(let r of e){if(!r||!r.connected)continue;let e=t(r);for(let[t,i]of e.buttons)ja(r,i)>.5&&(n.buttons|=t);e.l2&&(n.l2=Math.max(n.l2,Math.round(ja(r,e.l2,!0)*255))),e.r2&&(n.r2=Math.max(n.r2,Math.round(ja(r,e.r2,!0)*255))),n.lx=i(n.lx,a(r,e.lx)),n.ly=i(n.ly,a(r,e.ly)),n.rx=i(n.rx,a(r,e.rx)),n.ry=i(n.ry,a(r,e.ry))}return n}function Fa(e,t){return{buttons:e.buttons|t.buttons,l2:Math.max(e.l2,t.l2),r2:Math.max(e.r2,t.r2),lx:wa(e.lx+t.lx),ly:wa(e.ly+t.ly),rx:wa(e.rx+t.rx),ry:wa(e.ry+t.ry),touch:e.touch??t.touch??null,motion:e.motion??t.motion??null}}var I=e=>e.toLowerCase().padStart(4,`0`);function Ia(e){let t=/^(.*?)\s*\((?:[^()]*?\s)?Vendor:\s*([0-9a-f]{1,4})\s+Product:\s*([0-9a-f]{1,4})\s*\)\s*$/i.exec(e);if(t)return{vendor:I(t[2]),product:I(t[3]),name:t[1].trim()};let n=/^([0-9a-f]{1,4})-([0-9a-f]{1,4})-(.*)$/i.exec(e.trim());return n?{vendor:I(n[1]),product:I(n[2]),name:n[3].trim()}:null}function La(e=globalThis.navigator){let t=e?.userAgent??``;return/Android|iPhone|iPad|iPod/i.test(t)?null:/Macintosh|Mac OS X/i.test(t)?(e?.maxTouchPoints??0)>1?null:`m`:/Windows/i.test(t)?`w`:/Linux|CrOS|X11/i.test(t)?`l`:null}function Ra(e,t){if(!t)return null;let n=t===`l`?[`l`]:[`m`,`w`];for(let t of n){let n=Ge[`${t}${e.vendor}${e.product}`];if(n!==void 0)return We[n]??null}return null}var za={1:0,2:2,4:4,8:6};function Ba(e){let t=0,n=!1;for(let r of e){let e=/a(\d+)/.exec(r);e&&(t=Math.max(t,Number(e[1])+1)),r.startsWith(`h`)&&(n=!0)}return{n:t,hat:n}}function Va(e,t,n){let{n:r,hat:i}=Ba(t),a=Ta.length,o=e.axes.findIndex(e=>Math.abs(e)>1.05),s=e=>e;if(i&&o<0)return n===`l`&&e.axes.length>=r+2?{hat:-1,hatXY:r,axis:s}:null;if(!(i?o>r:n!==`l`&&e.axes.length>=r+2))return{hat:o,hatXY:-1,axis:s};if(r<=4)return{hat:o,hatXY:-1,axis:e=>[0,1,2,5][e]??e};let c=t[a+2]?.replace(`~`,``)===`a2`&&t[a+3]?.replace(`~`,``)===`a3`,l=[t[6],t[7]].every(e=>/^a[45]~?$/.test(e??``));return r===6&&c&&l?{hat:o,hatXY:-1,axis:e=>[0,1,2,5,3,4][e]??e}:{hat:o,hatXY:-1,axis:s}}function Ha(e,t){let n=/^b(\d+)$/.exec(e);if(n)return{b:Number(n[1])};if(n=/^([+-]?)a(\d+)(~?)$/.exec(e),n){let e=t.axis(Number(n[2]));return n[1]===`+`?{a:e,d:1}:n[1]===`-`?{a:e,d:-1}:n[3]?{a:e,d:-1,rest:1}:{a:e,d:1,rest:-1}}if(n=/^h0\.(\d)$/.exec(e),n){let e=za[n[1]];if(e===void 0)return null;if(t.hat>=0)return{h:t.hat,at:e};if(t.hatXY>=0)return e===0?{a:t.hatXY+1,d:-1}:e===4?{a:t.hatXY+1,d:1}:e===6?{a:t.hatXY,d:-1}:{a:t.hatXY,d:1}}return null}function Ua(e,t){let n=/^a(\d+)(~?)$/.exec(e);if(n)return n[2]?{a:t.axis(Number(n[1])),inv:!0}:{a:t.axis(Number(n[1]))};if(e===`hx`||e===`hy`){if(t.hat>=0)return{a:t.hat,hat:e===`hx`?`x`:`y`};if(t.hatXY>=0)return{a:t.hatXY+ +(e===`hy`)}}return null}function Wa(e,t,n){let r=e.split(`,`),i=Va(t,r,n);if(!i)return null;let a={buttons:[],l2:null,r2:null,lx:null,ly:null,rx:null,ry:null};for(let e=0;e<Ta.length;e++){let t=r[e];if(!t)continue;let n=Ha(t,i);n&&(e===6?a.l2=n:e===7?a.r2=n:Ta[e]&&a.buttons.push([Ta[e],n]))}let o=Ta.length;return a.lx=Ua(r[o]??``,i),a.ly=Ua(r[o+1]??``,i),a.rx=Ua(r[o+2]??``,i),a.ry=Ua(r[o+3]??``,i),a}var Ga=new Map;function Ka(e,t=La()){if(e.mapping===`standard`||!t)return null;let n=`${t}|${e.id}|${e.axes.length}`;if(Ga.has(n))return Ga.get(n)??null;let r=Ia(e.id),i=r?Ra(r,t):null;if(!i)return Ga.set(n,null),null;let a=Wa(i,e,t);return a&&Ga.set(n,a),a}var qa=`ps5upload.rp_pad_profiles.v1`;function Ja(e){return e===null||typeof e==`object`&&!Array.isArray(e)}function Ya(e){if(!e||typeof e!=`object`)return!1;let t=e;return Array.isArray(t.buttons)&&t.buttons.every(e=>Array.isArray(e)&&e.length===2&&typeof e[0]==`number`&&Ja(e[1]))&&[t.l2,t.r2,t.lx,t.ly,t.rx,t.ry].every(Ja)}function Xa(){try{let e=yt(qa),t=e?JSON.parse(e):null;return!t||typeof t!=`object`||Array.isArray(t)?{}:Object.fromEntries(Object.entries(t).filter(e=>Ya(e[1])))}catch{return{}}}function Za(e,t){let n=Xa();return t?n[e]=t:delete n[e],vt(qa,JSON.stringify(n)),Qa=n,n}var Qa=null;function $a(e){return Qa??=Xa(),Qa[e.id]??eo(Qa,e.id)??Ka(e)??Ma(e)}function eo(e,t){if(!t.endsWith(` (app)`))return null;let n=t.slice(0,-6).trim().toLowerCase();if(!n)return null;let r=Object.keys(e).filter(e=>{let t=e.trim().toLowerCase();return t===n||t.includes(n)}),i=r.find(e=>e.trim().toLowerCase()===n)??(r.length===1?r[0]:null);return i?(Qa=Za(t,e[i]),e[i]):null}[{kind:`button`,bit:F.CROSS,name:`✕`},{kind:`button`,bit:F.CIRCLE,name:`○`},{kind:`button`,bit:F.SQUARE,name:`□`},{kind:`button`,bit:F.TRIANGLE,name:`△`},{kind:`button`,bit:F.UP,name:`↑`},{kind:`button`,bit:F.DOWN,name:`↓`},{kind:`button`,bit:F.LEFT,name:`←`},{kind:`button`,bit:F.RIGHT,name:`→`},{kind:`button`,bit:F.L1,name:`L1`},{kind:`button`,bit:F.R1,name:`R1`},{kind:`trigger`,which:`l2`,name:`L2`},{kind:`trigger`,which:`r2`,name:`R2`},{kind:`button`,bit:F.L3,name:`L3`},{kind:`button`,bit:F.R3,name:`R3`},{kind:`button`,bit:F.OPTIONS,name:`Options`},{kind:`button`,bit:F.SHARE,name:`Create`},{kind:`button`,bit:F.PS,name:`PS`},{kind:`button`,bit:F.TOUCHPAD,name:`Touchpad`},{kind:`axis`,which:`lx`,name:`L →`},{kind:`axis`,which:`ly`,name:`L ↓`},{kind:`axis`,which:`rx`,name:`R →`},{kind:`axis`,which:`ry`,name:`R ↓`}].filter(e=>e.kind!==`button`||![F.L3,F.R3,F.OPTIONS,F.SHARE,F.PS,F.TOUCHPAD].includes(e.bit));var to=12e4;function no(e){let t;try{t=JSON.parse(e)}catch{return null}return Array.isArray(t.rumble)?{rumble:[Number(t.rumble[0])||0,Number(t.rumble[1])||0]}:Array.isArray(t.light)?{light:t.light}:t.stage===`asking`?{kind:`asking`}:t.stage===`refused`?{kind:`refused`,why:String(t.why??``)}:t.stage===`joined`?{kind:`joined`,host:t.session?.host??null,playing:!!t.session?.playing,passcode:!!t.session?.passcode}:null}function ro(e,t){return e.buttons===t.buttons&&e.l2===t.l2&&e.r2===t.r2&&e.lx===t.lx&&e.ly===t.ly&&e.rx===t.rx&&e.ry===t.ry&&(e.touch?.[0]??-1)===(t.touch?.[0]??-1)&&(e.touch?.[1]??-1)===(t.touch?.[1]??-1)&&(e.motion?.t??-1)===(t.motion?.t??-1)}var io=class{constructor(e){this.o=e,this.ws=null,this.last={...Sa},this.lastSent=0,this.raf=0,this.keepalive=null,this.watchdog=null,this.retry=null,this.done=!1,this.stage={kind:`connecting`},this.wasIn=!1,this.attempt=0,this.deadline=0,this.lastHeard=0,this.control=!1,this.neutral=!1,this.now=e.now??(()=>Date.now()),this.WS=e.WebSocketImpl??WebSocket}get currentStage(){return this.stage}setStage(e){this.stage=e,this.o.onStage(e)}start(){if(this.done=!1,this.setStage({kind:`connecting`}),this.connect(),this.done)return;let e=this.o.raf??(e=>window.requestAnimationFrame(e)),t=()=>{this.send(!1),this.raf=e(t)};this.raf=e(t),this.keepalive=setInterval(()=>this.send(!1),250),this.watchdog=setInterval(()=>this.checkSilence(),1e3)}connect(){let e;this.lastHeard=this.now();try{e=new this.WS(this.o.url)}catch{this.dropped();return}this.ws=e,e.binaryType=`arraybuffer`,this.control=!this.o.watch,this.o.watch&&this.o.watch.onControl(!1),e.onmessage=t=>{this.ws===e&&(this.lastHeard=this.now(),this.onMessage(t.data))},e.onclose=t=>{if(this.ws!==e)return;this.ws=null;let n=Le(t);n&&!this.wasIn?this.finish({kind:`refused`,why:`net:${n}`}):this.dropped()},e.onopen=()=>{this.ws===e&&(this.lastHeard=this.now(),this.o.hello&&e.send(JSON.stringify({hello:this.o.hello})),this.send(!0))}}onMessage(e){if(typeof e!=`string`){e instanceof ArrayBuffer&&this.o.watch?.onFrame(e);return}if(this.o.hello&&e.startsWith(`{"rt":`))try{let t=JSON.parse(e);if(typeof t.rt==`string`&&/^[0-9a-f]{32}$/.test(t.rt)){this.o.hello.rt=t.rt,this.o.onReconnectToken?.(t.rt);return}}catch{}if(e.includes(`"kbm_caps"`))try{let t=JSON.parse(e);if(t.kbm_caps){let e=t.kbm_caps;this.o.onKbmCaps?.({mouse:e.mouse===!0,keyboard:e.keyboard===!0,reason:typeof e.reason==`string`?e.reason:null});return}}catch{}if(this.o.watch)try{let t=JSON.parse(e);if(t.watch&&this.o.watch.onCodec(!!t.watch.hevc),typeof t.control==`boolean`){this.control=t.control,this.o.watch.onControl(t.control),t.control&&this.send(!0);return}}catch{}let t=no(e);if(t){if(`rumble`in t){let[e,n]=t.rumble;navigator.vibrate?.(e||n?250:0)}else if(`light`in t)this.o.onLight?.(t.light);else if(t.kind===`refused`)this.finish(t);else{if(t.kind===`joined`){let e=this.stage.kind!==`joined`;this.wasIn=!0,this.attempt=0,this.setStage(t),e&&this.send(!0);return}this.setStage(t)}}}dropped(){if(this.done)return;if(!this.wasIn||(this.stage.kind!==`reconnecting`&&(this.deadline=this.now()+to),this.now()>=this.deadline)){this.finish({kind:`lost`});return}let e=Re(this.attempt);this.setStage({kind:`reconnecting`,attempt:this.attempt}),this.attempt+=1,this.retry&&clearTimeout(this.retry),this.retry=setTimeout(()=>{this.retry=null,this.done||this.connect()},e)}checkSilence(){let e=this.ws;if(e&&!this.done&&(this.stage.kind===`joined`||this.stage.kind===`reconnecting`)&&!(this.now()-this.lastHeard<=3500)){this.ws=null;try{e.close()}catch{}this.dropped()}}wake(){this.stage.kind===`lost`&&this.wasIn?(this.attempt=0,this.start()):this.stage.kind===`reconnecting`&&(this.deadline=this.now()+to,this.attempt=0,this.retry&&(clearTimeout(this.retry),this.retry=null,this.connect()))}setNeutral(e){this.neutral!==e&&(this.neutral=e,this.send(!0))}current(){let e=Pa(Ue(typeof navigator>`u`?void 0:navigator),$a),t=this.o.touchPad();return{...Fa(e,t),touch:t.touch??null,motion:this.o.motion?.()??null}}send(e){let t=this.ws;if(!t||t.readyState!==this.WS.OPEN||!this.control)return;let n=this.neutral?{...Sa,touch:null,motion:null}:this.current(),r=this.now();!e&&ro(n,this.last)&&r-this.lastSent<250||(this.last=n,this.lastSent=r,t.send(JSON.stringify({pad:{...n,touch:n.touch??null,motion:n.motion??null},ka:1})))}askKeyframe(){let e=this.ws;e&&e.readyState===this.WS.OPEN&&e.send(JSON.stringify({keyframe:!0}))}sendKbm(e){let t=this.ws;return!t||t.readyState!==this.WS.OPEN||!this.control?!1:(t.send(e instanceof Uint8Array?e:JSON.stringify(e)),!0)}sendPad(){this.send(!1)}clearTimers(){(this.o.cancelRaf??(e=>window.cancelAnimationFrame(e)))(this.raf),this.keepalive&&clearInterval(this.keepalive),this.watchdog&&clearInterval(this.watchdog),this.retry&&clearTimeout(this.retry),this.keepalive=this.watchdog=this.retry=null}finish(e){this.done=!0,this.clearTimers();let t=this.ws;this.ws=null;try{t?.close()}catch{}this.setStage(e)}stop(){this.done=!0,this.clearTimers();let e=this.ws;this.ws=null,e&&e.readyState===this.WS.OPEN&&e.send(JSON.stringify({pad:{...Sa,touch:null}})),e?.close()}},ao=`ps5upload.pad.device`;function oo(e,t=e=>crypto.getRandomValues(e)){let n=e.get(ao);if(n&&/^[0-9a-f]{32}$/.test(n))return n;let r=new Uint8Array(16);t(r);let i=Array.from(r,e=>e.toString(16).padStart(2,`0`)).join(``);return e.set(ao,i),i}var so=new Set,co={held:new Set,touch:null,touchPad:Sa,mapping:!1,get paused(){return so.size>0},motion:null},lo={s:.85,m:1,l:1.15},uo=.25;function fo(e){return typeof e!=`number`||!Number.isFinite(e)?1:Math.min(1,Math.max(uo,e))}var po={overlay:{width:844,height:390},deck:{width:390,height:480}},mo=.7,ho=1.4;function go(e,t,n,r){let i=lo[e]??1;if(!(t>0)||!(n>0))return i;let a=r?po.deck:po.overlay,o=Math.min(ho,Math.max(mo,Math.min(t/a.width,n/a.height)));return Math.round(o*i*1e3)/1e3}var _o=34;function vo(e,t){return t>0&&8+Math.max(112*e,90)+156*e+124*e+Math.max(56*e,44)+_o>t}function yo(e,t,n){let r=e/32767,i=t/32767,a=Math.hypot(r,i),o=a>1?1/a:1;return{dx:r*o*n,dy:i*o*n}}var bo=s((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),L=s(((e,t)=>{t.exports=bo()}))(),xo=`calc(50% + (env(safe-area-inset-left) - env(safe-area-inset-right)) / 2)`,So=32767,Co=12;function wo({stream:e,layout:t=`overlay`,opacity:n=1,size:r=`m`,deckTop:i=`0px`,onMenu:a}){let o=Tn(),s=(0,T.useRef)(new Map),c=(0,T.useRef)({...Sa}),[l,u]=(0,T.useState)({...Sa}),[d,f]=(0,T.useState)({l:!1,r:!1,touchpad:!1}),p=(0,T.useRef)(null),[m,h]=(0,T.useState)({width:0,height:0});(0,T.useEffect)(()=>{let e=p.current;if(!e)return;let t=()=>{let t=e.getBoundingClientRect();h(e=>e.width===t.width&&e.height===t.height?e:{width:t.width,height:t.height})};if(t(),typeof ResizeObserver>`u`)return window.addEventListener(`resize`,t),()=>window.removeEventListener(`resize`,t);let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]),(0,T.useEffect)(()=>()=>{co.touchPad={...Sa}},[]);let g=()=>{let t={...Sa,touch:null},n={l:!1,r:!1,touchpad:!1};for(let e of s.current.values())e.kind===`stick`&&(n[e.which]=!0),e.kind===`touchpad`&&(n.touchpad=!0),e.kind===`button`&&(t.buttons|=e.bit),e.kind===`trigger`&&(t[e.which]=255),e.kind===`touchpad`&&e.pressed&&(t.buttons|=F.TOUCHPAD);t.lx=c.current.lx,t.ly=c.current.ly,t.rx=c.current.rx,t.ry=c.current.ry,t.touch=c.current.touch??null,co.touchPad=t,e?.sendPad(),u(t),f(e=>e.l===n.l&&e.r===n.r&&e.touchpad===n.touchpad?e:n)},_=(e,t,n)=>{let r=Math.max(-1,Math.min(1,(t-e.cx)/e.radius)),i=Math.max(-1,Math.min(1,(n-e.cy)/e.radius));c.current[e.which===`l`?`lx`:`rx`]=Math.round(r*So),c.current[e.which===`l`?`ly`:`ry`]=Math.round(i*So)},v=(e,t)=>{e.preventDefault(),e.stopPropagation();let n=e.currentTarget;try{n.setPointerCapture(e.pointerId)}catch{}let r=t(n);s.current.set(e.pointerId,r),r.kind===`stick`&&_(r,e.clientX,e.clientY),r.kind===`touchpad`&&(c.current.touch=Ca((e.clientX-r.rect.left)/r.rect.width,(e.clientY-r.rect.top)/r.rect.height)),navigator.vibrate?.(8),g()},y=e=>{let t=s.current.get(e.pointerId);if(t){if(e.stopPropagation(),t.kind===`stick`)_(t,e.clientX,e.clientY);else if(t.kind===`touchpad`)c.current.touch=Ca((e.clientX-t.rect.left)/t.rect.width,(e.clientY-t.rect.top)/t.rect.height),t.pressed&&Math.hypot(e.clientX-t.x0,e.clientY-t.y0)>Co&&(t.pressed=!1);else return;g()}},b=e=>{let t=s.current.get(e.pointerId);t&&(e.stopPropagation(),s.current.delete(e.pointerId),t.kind===`stick`&&(c.current[t.which===`l`?`lx`:`rx`]=0,c.current[t.which===`l`?`ly`:`ry`]=0),t.kind===`touchpad`&&(c.current.touch=null),g())},x=e=>e.stopPropagation(),S={onPointerMove:y,onPointerUp:b,onPointerCancel:b,onClick:x,onDoubleClick:x},ee=e=>(l.buttons&e)!==0,te=e=>`border-[1.5px] shadow-[0_0_3px_rgba(0,0,0,0.35)] transition-colors duration-75 ${e?`border-white bg-white/50`:`border-white/70 bg-white/10`}`,C=`text-white [text-shadow:0_1px_2px_rgba(0,0,0,0.6)]`,ne={filter:`drop-shadow(0 0 1.5px rgba(0,0,0,0.5))`},w=e=>({stroke:e?`#fff`:`rgba(255,255,255,0.75)`,fill:e?`rgba(255,255,255,0.5)`:`rgba(255,255,255,0.1)`}),re=`pointer-events-auto flex touch-none select-none items-center justify-center bg-transparent p-0`,ie={minHeight:`calc(44px / var(--k))`,minWidth:`calc(44px / var(--k))`},ae=(e,t,n,r)=>(0,L.jsx)(`button`,{type:`button`,"aria-label":e,onPointerDown:e=>v(e,()=>({kind:`button`,bit:t})),...S,className:`${re} ${n}`,style:ie,children:r}),oe=(e,t,n,r)=>(0,L.jsx)(`span`,{className:`flex h-[32px] w-[76px] items-center justify-center text-[13px] font-semibold tracking-wide ${C} ${te(t)}`,style:{borderRadius:r?n===`l`?`16px 9px 9px 9px`:`9px 16px 9px 9px`:`9px`},children:e}),se=(e,t,n,r)=>ae(e,t,`h-[44px] w-[84px]`,oe(e,ee(t),n,r)),ce=(e,t,n)=>(0,L.jsx)(`button`,{type:`button`,"aria-label":e,onPointerDown:e=>v(e,()=>({kind:`trigger`,which:t})),...S,className:`${re} h-[44px] w-[84px]`,style:ie,children:oe(e,l[t]>0,n,!0)}),le=(e,t,n)=>ae(e,t,`h-[52px] w-[52px]`,(0,L.jsx)(`svg`,{viewBox:`0 0 52 52`,width:`52`,height:`52`,"aria-hidden":!0,style:ne,children:(0,L.jsxs)(`g`,{transform:`rotate(${n} 26 26)`,strokeWidth:`1.5`,strokeLinejoin:`round`,...w(ee(t)),children:[(0,L.jsx)(`path`,{d:`M10 9 Q10 3 16 3 L36 3 Q42 3 42 9 L42 30 Q42 34.5 38.5 38 L29.5 47 Q26 50.5 22.5 47 L13.5 38 Q10 34.5 10 30 Z`}),(0,L.jsx)(`path`,{d:`M20.5 23 L26 17 L31.5 23`,fill:`none`,stroke:`#fff`,strokeLinecap:`round`,strokeWidth:`1.8`})]})})),ue=(e,t,n)=>ae(e,t,`h-[52px] w-[52px]`,(0,L.jsxs)(`svg`,{viewBox:`0 0 52 52`,width:`52`,height:`52`,"aria-hidden":!0,style:ne,children:[(0,L.jsx)(`circle`,{cx:`26`,cy:`26`,r:`22.5`,strokeWidth:`1.5`,...w(ee(t))}),(0,L.jsx)(`g`,{fill:`none`,stroke:`#fff`,strokeWidth:`1.8`,strokeLinejoin:`round`,strokeLinecap:`round`,children:n})]})),de=(e,t)=>ae(e,t,`h-[44px] min-w-[64px] px-[4px]`,(0,L.jsx)(`span`,{className:`flex h-[24px] items-center rounded-full px-[10px] text-[10px] font-semibold uppercase tracking-wider ${C} ${te(ee(t))}`,children:e})),fe=(e,t)=>ae(e,t,`h-[44px] w-[44px]`,(0,L.jsx)(`span`,{className:`flex h-[36px] w-[36px] items-center justify-center rounded-full text-[11px] font-bold ${C} ${te(ee(t))}`,children:e})),pe=e=>{let{dx:t,dy:n}=yo(e===`l`?l.lx:l.rx,e===`l`?l.ly:l.ry,34),r=d[e];return(0,L.jsx)(`div`,{"aria-label":e===`l`?o(`rp_touch_left_stick`,void 0,`Left stick`):o(`rp_touch_right_stick`,void 0,`Right stick`),onPointerDown:t=>v(t,t=>{let n=t.getBoundingClientRect();return{kind:`stick`,which:e,cx:n.left+n.width/2,cy:n.top+n.height/2,radius:n.width/2}}),...S,className:`pointer-events-auto relative h-[124px] w-[124px] touch-none rounded-full border-[1.5px] shadow-[0_0_3px_rgba(0,0,0,0.3)] transition-colors duration-75 ${r?`border-white/80 bg-white/[0.12]`:`border-white/45 bg-white/[0.05]`}`,children:(0,L.jsx)(`div`,{className:`absolute left-1/2 top-1/2 h-[54px] w-[54px] rounded-full ${te(r)}`,style:{transform:`translate(calc(-50% + ${t}px), calc(-50% + ${n}px))`}})})},E=t===`deck`,me=go(r,m.width,m.height,E),he=e=>`${e}px * var(--k)`,ge=`max(12px, env(safe-area-inset-left))`,ve=`max(12px, env(safe-area-inset-right))`,ye=`max(12px, env(safe-area-inset-bottom))`,be=E?`8px`:t===`overlay-bar`?`3.5rem`:`max(10px, env(safe-area-inset-top))`,xe=(e,t,n=0)=>t?n?`calc(${e} + max(${he(t)}, ${n}px))`:`calc(${e} + ${he(t)})`:e,Se=(e,t)=>({position:`absolute`,...t,transform:`scale(var(--k))`,transformOrigin:e}),Ce=E&&vo(me,m.height),D=E?void 0:`58%`,O=e=>E?{top:xe(be,Ce?96:112,Ce?72:90),[e]:e===`left`?ge:ve}:{top:D,translate:`0 -50%`,[e]:e===`left`?ge:ve},we=e=>({bottom:Ce?ye:xe(ye,E?56:0,44),[e]:Ce?`calc(${e===`left`?ge:ve} + 8px + max(${he(80)}, 44px))`:xe(e===`left`?ge:ve,E?40:168)}),Te=!!a&&!E;return(0,L.jsxs)(`div`,{ref:p,className:`pointer-events-none absolute z-10 select-none [-webkit-touch-callout:none] ${E?`inset-x-0 bottom-0`:`inset-0`}`,style:{top:E?i:void 0,"--k":me},"data-testid":`rp-touch`,"data-layout":t,"data-scale":me,onContextMenu:e=>e.preventDefault(),children:[(0,L.jsxs)(`div`,{className:`absolute inset-0`,style:{opacity:fo(n)},children:[(0,L.jsx)(`div`,{style:Se(`top left`,{top:be,left:ge}),children:(0,L.jsxs)(`div`,{className:`ms-[8px] flex flex-col`,style:{rotate:E?void 0:`6deg`,transformOrigin:`top left`},children:[ce(`L2`,`l2`,`l`),se(`L1`,F.L1,`l`,!1)]})}),(0,L.jsx)(`div`,{style:Se(`top right`,{top:be,right:ve}),children:(0,L.jsxs)(`div`,{className:`me-[8px] flex flex-col items-end`,style:{rotate:E?void 0:`-6deg`,transformOrigin:`top right`},children:[ce(`R2`,`r2`,`r`),se(`R1`,F.R1,`r`,!1)]})}),(0,L.jsx)(`div`,{"aria-label":o(`rp_touch_touchpad`,void 0,`Touchpad`),onPointerDown:e=>v(e,t=>({kind:`touchpad`,rect:t.getBoundingClientRect(),x0:e.clientX,y0:e.clientY,pressed:!0})),...S,className:`pointer-events-auto absolute touch-none rounded-2xl border-[1.5px] shadow-[0_0_3px_rgba(0,0,0,0.3)] transition-colors duration-75 ${d.touchpad?`border-white/80 bg-white/25`:`border-white/40 bg-white/[0.05]`}`,style:E?{top:xe(be,6),left:xe(ge,104),right:xe(ve,104),height:`max(44px, calc(${he(64)}))`}:{top:be,left:`50%`,translate:`-50% 0`,width:`min(calc(${he(250)}), 34vw)`,height:`max(44px, calc(${he(56)}))`}}),(0,L.jsxs)(`div`,{className:`grid grid-cols-3 grid-rows-3`,style:Se(E?`top left`:`left center`,O(`left`)),children:[(0,L.jsx)(`span`,{}),le(`↑`,F.UP,0),(0,L.jsx)(`span`,{}),le(`←`,F.LEFT,-90),(0,L.jsx)(`span`,{}),le(`→`,F.RIGHT,90),(0,L.jsx)(`span`,{}),le(`↓`,F.DOWN,180),(0,L.jsx)(`span`,{})]}),(0,L.jsxs)(`div`,{className:`grid grid-cols-3 grid-rows-3`,style:Se(E?`top right`:`right center`,O(`right`)),children:[(0,L.jsx)(`span`,{}),ue(`△`,F.TRIANGLE,(0,L.jsx)(`path`,{d:`M26 16.5 L35 32 L17 32 Z`})),(0,L.jsx)(`span`,{}),ue(`□`,F.SQUARE,(0,L.jsx)(`rect`,{x:`18`,y:`18`,width:`16`,height:`16`,rx:`1`})),(0,L.jsx)(`span`,{}),ue(`○`,F.CIRCLE,(0,L.jsx)(`circle`,{cx:`26`,cy:`26`,r:`8.5`})),(0,L.jsx)(`span`,{}),ue(`✕`,F.CROSS,(0,L.jsx)(`path`,{d:`M19 19 L33 33 M33 19 L19 33`})),(0,L.jsx)(`span`,{})]}),(0,L.jsx)(`div`,{style:Se(`bottom left`,we(`left`)),children:pe(`l`)}),(0,L.jsx)(`div`,{style:Se(`bottom right`,we(`right`)),children:pe(`r`)}),(0,L.jsx)(`div`,{style:Se(`bottom left`,{bottom:ye,left:ge}),children:de(`Create`,F.SHARE)}),(0,L.jsx)(`div`,{style:Se(`bottom right`,{bottom:ye,right:ve}),children:de(`Options`,F.OPTIONS)}),(0,L.jsx)(`div`,{style:Se(`bottom center`,{bottom:Ce?xe(ye,124,88):xe(ye,Te?48:0,48),left:xo,translate:`-50% 0`}),children:fe(`PS`,F.PS)})]}),Te&&(0,L.jsx)(`div`,{style:{...Se(`bottom center`,{bottom:ye,left:`calc(50% + (env(safe-area-inset-left) - env(safe-area-inset-right)) / 2)`,translate:`-50% 0`}),opacity:Math.max(.7,fo(n))},children:(0,L.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),a?.()},onDoubleClick:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),"aria-label":o(`rp_menu`,void 0,`Menu`),"aria-haspopup":`dialog`,className:`${re} h-[44px] w-[56px]`,style:ie,"data-testid":`rp-menu-handle`,children:(0,L.jsx)(`span`,{className:`flex h-[26px] w-[44px] items-center justify-center rounded-full ${C} ${te(!1)}`,children:(0,L.jsx)(_e,{size:15,strokeWidth:2,"aria-hidden":!0})})})})]})}var To=class{constructor(e,t=()=>1){this.sink=e,this.speed=t,this.fingers=new Map,this.most=0,this.moved=!1,this.gestureT0=0,this.lastTap=null,this.dragging=!1}down(e,t,n,r){if(!this.fingers.size){this.most=0,this.moved=!1,this.gestureT0=r;let e=this.lastTap;e&&r-e.t<=300&&Math.hypot(t-e.x,n-e.y)<=40&&(this.dragging=!0,this.sink.button(0,!0)),this.lastTap=null}this.fingers.set(e,{x:t,y:n,x0:t,y0:n,t0:r}),this.most=Math.max(this.most,this.fingers.size)}move(e,t,n){let r=this.fingers.get(e);if(!r)return;let i=t-r.x,a=n-r.y;if(r.x=t,r.y=n,!this.moved&&Math.hypot(t-r.x0,n-r.y0)>10&&(this.moved=!0),!this.moved)return;if(this.fingers.size>=2){if(this.dragging)return;let e=this.fingers.size;this.sink.scroll(-a/e,-i/e);return}if(this.most>=2)return;let o=this.speed();this.sink.move(i*o,a*o)}up(e,t){let n=this.fingers.get(e);if(!n||(this.fingers.delete(e),this.fingers.size))return;if(this.dragging){this.dragging=!1,this.sink.button(0,!1);return}let r=t-this.gestureT0<=250+(this.most>=2?150:0);if(this.moved||!r)return;let i=this.most>=2?2:0;this.sink.button(i,!0),this.sink.button(i,!1),i===0&&(this.lastTap={t,x:n.x,y:n.y})}cancel(){this.fingers.clear(),this.lastTap=null,this.dragging&&(this.dragging=!1,this.sink.button(0,!1))}},Eo={" ":`Space`,"-":`Minus`,"=":`Equal`,"[":`BracketLeft`,"]":`BracketRight`,"\\":`Backslash`,";":`Semicolon`,"'":`Quote`,"`":`Backquote`,",":`Comma`,".":`Period`,"/":`Slash`,"\n":`Enter`,"\r":`Enter`," ":`Tab`},Do={"!":`Digit1`,"@":`Digit2`,"#":`Digit3`,$:`Digit4`,"%":`Digit5`,"^":`Digit6`,"&":`Digit7`,"*":`Digit8`,"(":`Digit9`,")":`Digit0`,_:`Minus`,"+":`Equal`,"{":`BracketLeft`,"}":`BracketRight`,"|":`Backslash`,":":`Semicolon`,'"':`Quote`,"~":`Backquote`,"<":`Comma`,">":`Period`,"?":`Slash`};function Oo(e){return e.length===1?e>=`a`&&e<=`z`?{code:`Key${e.toUpperCase()}`,shift:!1}:e>=`A`&&e<=`Z`?{code:`Key${e}`,shift:!0}:e>=`0`&&e<=`9`?{code:`Digit${e}`,shift:!1}:Eo[e]?{code:Eo[e],shift:!1}:Do[e]?{code:Do[e],shift:!0}:null:null}var ko={Backspace:`Backspace`,Enter:`Enter`,Tab:`Tab`,Escape:`Escape`,Delete:`Delete`,ArrowUp:`ArrowUp`,ArrowDown:`ArrowDown`,ArrowLeft:`ArrowLeft`,ArrowRight:`ArrowRight`,Home:`Home`,End:`End`,PageUp:`PageUp`,PageDown:`PageDown`};function Ao(e){return ko[e]??null}function jo(e,t){let n=``;for(let r of t){let t=Oo(r);t?Mo(e,t.code,t.shift):n+=r}return n}function Mo(e,t,n=!1){let r=n&&!e.shiftHeld?.();r&&e.key(`ShiftLeft`,!0),e.key(t,!0),e.key(t,!1),r&&e.key(`ShiftLeft`,!1)}function No(e,t){let n=[...e],r=[...t],i=0;for(;i<n.length&&i<r.length&&n[i]===r[i];)i++;return{deleted:n.length-i,inserted:r.slice(i).join(``)}}function Po({sink:e,speed:t,className:n=``,style:r,children:i,testId:a=`rp-touchpad`}){let o=(0,T.useRef)(e),s=(0,T.useRef)(t);(0,T.useEffect)(()=>{o.current=e,s.current=t});let c=(0,T.useRef)(null),l=()=>c.current??=new To({move:(e,t)=>o.current?.move(e,t),button:(e,t)=>o.current?.button(e,t),scroll:(e,t)=>o.current?.scroll(e,t)},()=>s.current);(0,T.useEffect)(()=>()=>c.current?.cancel(),[]);let u=e=>e.stopPropagation();return(0,L.jsx)(`div`,{className:`touch-none select-none [-webkit-touch-callout:none] ${n}`,style:r,"data-testid":a,onPointerDown:e=>{u(e);try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}l().down(e.pointerId,e.clientX,e.clientY,e.timeStamp)},onPointerMove:e=>{u(e),l().move(e.pointerId,e.clientX,e.clientY)},onPointerUp:e=>{u(e),l().up(e.pointerId,e.timeStamp)},onPointerCancel:e=>{u(e),l().cancel()},onClick:u,onDoubleClick:u,onContextMenu:e=>{e.preventDefault(),u(e)},children:i})}var R=` `,Fo=40;function Io({sink:e,onUntypeable:t,className:n=``}){let r=Tn(),i=(0,T.useRef)(null),a=(0,T.useRef)(R),o=(0,T.useRef)(!1),[s,c]=(0,T.useState)(!1),[l,u]=(0,T.useState)(!1);(0,T.useEffect)(()=>{if(!l)return;let e=window.setTimeout(()=>u(!1),3e3);return()=>window.clearTimeout(e)},[l]);let d=()=>{let e=i.current;e&&!o.current&&(!e.value.startsWith(R)||e.value.length>Fo)&&(e.value=R,a.current=R)},f=()=>{let n=i.current;if(!n||!e)return;let{deleted:r,inserted:o}=No(a.current,n.value);a.current=n.value;for(let t=0;t<r;t++)Mo(e,`Backspace`);let s=jo(e,o);s&&!t?.(s)&&u(!0),d()};return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`button`,{type:`button`,"aria-label":r(`rp_tp_keyboard`,void 0,`Keyboard`),title:r(`rp_tp_keyboard`,void 0,`Keyboard`),"aria-pressed":s,disabled:!e,onPointerDown:e=>e.stopPropagation(),onClick:e=>{e.stopPropagation();let t=i.current;t&&(s?t.blur():(t.value=R,a.current=R,t.focus({preventScroll:!0}),t.setSelectionRange(t.value.length,t.value.length)))},className:`flex h-11 w-11 items-center justify-center rounded-full border border-white/25 bg-black/45 text-white backdrop-blur-sm disabled:opacity-40 ${s?`bg-white/30`:``} ${n}`,"data-testid":`rp-tp-keyboard`,children:(0,L.jsx)(he,{size:18,"aria-hidden":!0})}),(0,L.jsx)(`input`,{ref:i,type:`text`,defaultValue:R,autoComplete:`off`,autoCorrect:`off`,autoCapitalize:`off`,spellCheck:!1,enterKeyHint:`send`,"aria-label":r(`rp_tp_keyboard`,void 0,`Keyboard`),className:`pointer-events-none fixed bottom-0 left-1/2 h-px w-px opacity-0`,"data-testid":`rp-tp-keyboard-input`,"data-rp-typing":``,onFocus:()=>c(!0),onBlur:()=>c(!1),onPointerDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation(),onKeyDown:t=>{if(t.stopPropagation(),!e||t.nativeEvent.isComposing)return;let n=Ao(t.key);n&&(t.preventDefault(),Mo(e,n))},onKeyUp:e=>e.stopPropagation(),onCompositionStart:()=>{o.current=!0},onCompositionEnd:()=>{o.current=!1,f()},onInput:f}),l&&(0,L.jsx)(`div`,{className:`pointer-events-none fixed bottom-20 left-1/2 z-[300] w-max max-w-[min(22rem,calc(100%-2rem))] -translate-x-1/2 rounded-full bg-black/80 px-3 py-1.5 text-center text-xs text-white`,"data-testid":`rp-tp-untypeable`,children:r(`rp_tp_untypeable`,void 0,`Only English letters, numbers and symbols can be typed here. Use a text field on the PS5 for others.`)})]})}function Lo({mode:e,onChange:t,blocked:n,style:r,touchpadLabel:i,tight:a=!1,hidden:o=!1}){let s=Tn(),c=(r,i,o)=>{let s=r===`touchpad`&&!!n;return(0,L.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":e===r,"aria-disabled":s||void 0,"aria-label":a&&e!==r?o:void 0,title:s?n:o,onClick:e=>{e.stopPropagation(),s||t(r)},onPointerDown:e=>e.stopPropagation(),onDoubleClick:e=>e.stopPropagation(),className:`flex h-8 items-center gap-1 rounded-full px-2.5 text-xs ${e===r?`bg-white text-black`:`text-white`} ${s?`opacity-40`:``}`,"data-testid":`rp-touch-mode-${r}`,children:[i,(!a||e===r)&&(0,L.jsx)(`span`,{children:o})]})};return(0,L.jsxs)(`div`,{role:`radiogroup`,"aria-label":s(`rp_tp_mode`,void 0,`Touch controls`),"aria-hidden":o||void 0,className:`absolute left-1/2 z-30 flex -translate-x-1/2 gap-0.5 rounded-full border border-white/20 bg-black/50 p-0.5 backdrop-blur-sm transition-opacity duration-200 ${o?`pointer-events-none opacity-0`:`pointer-events-auto opacity-100`}`,style:r,"data-testid":`rp-touch-mode`,children:[c(`controller`,(0,L.jsx)(E,{size:14,"aria-hidden":!0}),s(`rp_kbm_controller`,void 0,`Controller`)),c(`touchpad`,(0,L.jsx)(ye,{size:14,"aria-hidden":!0}),i??s(`rp_tp_touchpad`,void 0,`Touchpad`))]})}var Ro={0:1,2:2,1:4,3:8,4:16},zo={ControlLeft:1,ShiftLeft:2,AltLeft:4,MetaLeft:8,OSLeft:8,ControlRight:16,ShiftRight:32,AltRight:64,MetaRight:128,OSRight:128};function Bo(){let e={};for(let t=0;t<26;t++)e[`Key${String.fromCharCode(65+t)}`]=4+t;for(let t=1;t<=9;t++)e[`Digit${t}`]=30+t-1;e.Digit0=39,Object.assign(e,{Enter:40,Escape:41,Backspace:42,Tab:43,Space:44,Minus:45,Equal:46,BracketLeft:47,BracketRight:48,Backslash:49,IntlHash:50,Semicolon:51,Quote:52,Backquote:53,Comma:54,Period:55,Slash:56,CapsLock:57,PrintScreen:70,ScrollLock:71,Pause:72,Insert:73,Home:74,PageUp:75,Delete:76,End:77,PageDown:78,ArrowRight:79,ArrowLeft:80,ArrowDown:81,ArrowUp:82,NumLock:83,NumpadDivide:84,NumpadMultiply:85,NumpadSubtract:86,NumpadAdd:87,NumpadEnter:88,NumpadDecimal:99,IntlBackslash:100,ContextMenu:101,NumpadEqual:103,IntlRo:135,KanaMode:136,IntlYen:137,Convert:138,NonConvert:139,Lang1:144,Lang2:145});for(let t=1;t<=9;t++)e[`Numpad${t}`]=89+t-1;e.Numpad0=98;for(let t=1;t<=12;t++)e[`F${t}`]=58+t-1;for(let t=13;t<=24;t++)e[`F${t}`]=104+t-13;return e}var Vo=Bo(),Ho=(e,t,n)=>Math.max(t,Math.min(n,Math.trunc(e)));function Uo(e,t=0,n=0,r=0,i=0){let a=new Uint8Array(17),o=new DataView(a.buffer);return a[0]=8,a[1]=e.buttons&255,a[2]=e.mods&255,o.setInt16(3,Ho(t,-32768,32767),!0),o.setInt16(5,Ho(n,-32768,32767),!0),o.setInt8(7,Ho(r,-128,127)),o.setInt8(8,Ho(i,-128,127)),e.keys.slice(0,8).forEach((e,t)=>a[9+t]=e&255),a}function Wo(e){let t={buttons:0,mods:0,keys:[]};for(let n of e){t.buttons|=n.buttons,t.mods|=n.mods;for(let e of n.keys)!t.keys.includes(e)&&t.keys.length<8&&t.keys.push(e)}return t}function z(e,t,n){let r=e+t/(n===1?3:n===2?1:100),i=Math.trunc(r);return{notches:-i,carry:r-i}}var B=class{constructor(e){this.st={buttons:0,mods:0,keys:[]},this.dx=0,this.dy=0,this.wheel=0,this.hwheel=0,this.wheelCarry=0,this.hwheelCarry=0,this.moveTimer=null,this.hb=null,this.want={mouse:!1,keyboard:!1},this.guests=new Map,this.d={setTimer:(e,t)=>window.setTimeout(e,t),clearTimer:e=>window.clearTimeout(e),setRepeat:(e,t)=>window.setInterval(e,t),clearRepeat:e=>window.clearInterval(e),...e}}get state(){return this.st}shiftHeld(){return(this.st.mods&(zo.ShiftLeft|zo.ShiftRight))!==0}get holding(){return this.st.buttons!==0||this.st.mods!==0||this.st.keys.length>0}setWant(e){let t=e.mouse||e.keyboard,n=e.mouse!==this.want.mouse||e.keyboard!==this.want.keyboard;this.want={...e},n&&(this.hb!==null&&this.d.clearRepeat(this.hb),this.hb=null,this.beat(),t&&(this.hb=this.d.setRepeat(()=>this.beat(),500)))}get wanted(){return this.want}beat(){let e=this.want.mouse||this.want.keyboard;this.d.send({kbm:e?{on:!0,mouse:this.want.mouse,keyboard:this.want.keyboard}:{on:!1}})}key(e,t){let n=zo[e];if(n){let e=t?this.st.mods|n:this.st.mods&~n;return e!==this.st.mods&&(this.st={...this.st,mods:e},this.flush()),!0}let r=Vo[e];if(!r)return!1;let i=this.st.keys.includes(r);return t&&!i&&this.st.keys.length<8?(this.st={...this.st,keys:[...this.st.keys,r]},this.flush()):!t&&i&&(this.st={...this.st,keys:this.st.keys.filter(e=>e!==r)},this.flush()),!0}button(e,t){let n=Ro[e];if(!n)return;let r=t?this.st.buttons|n:this.st.buttons&~n;r!==this.st.buttons&&(this.st={...this.st,buttons:r},this.flush())}guest(e,t){if(t)this.guests.set(e,{buttons:t.buttons,mods:t.mods,keys:t.keys.slice(0,8)});else if(!this.guests.delete(e))return;this.flush()}guestMotion(e,t,n,r){this.dx+=e,this.dy+=t,this.wheel+=n,this.hwheel+=r,(e||t||n||r)&&this.later()}get guestIds(){return[...this.guests.keys()]}move(e,t){this.dx+=e,this.dy+=t,this.later()}scroll(e,t,n){let r=z(this.wheelCarry,e,n),i=z(this.hwheelCarry,t,n);this.wheelCarry=r.carry,this.hwheelCarry=i.carry,this.wheel+=r.notches,this.hwheel-=i.notches,(this.wheel||this.hwheel)&&this.later()}later(){this.moveTimer===null&&(this.moveTimer=this.d.setTimer(()=>this.flush(),4))}flush(){this.moveTimer!==null&&this.d.clearTimer(this.moveTimer),this.moveTimer=null;let e=this.guests.size?Wo([this.st,...this.guests.values()]):this.st;do{let t=Ho(this.dx,-32768,32767),n=Ho(this.dy,-32768,32767),r=Ho(this.wheel,-128,127),i=Ho(this.hwheel,-128,127);this.dx-=t,this.dy-=n,this.wheel-=r,this.hwheel-=i,this.d.send(Uo(e,t,n,r,i))}while(Math.abs(this.dx)>=1||Math.abs(this.dy)>=1||this.wheel||this.hwheel)}releaseAll(){this.dx=this.dy=this.wheel=this.hwheel=0,this.wheelCarry=this.hwheelCarry=0;let e=this.holding;this.st={buttons:0,mods:0,keys:[]},this.moveTimer!==null&&this.d.clearTimer(this.moveTimer),this.moveTimer=null,e&&this.d.send(Uo(this.guests.size?Wo(this.guests.values()):this.st))}dispose(){this.guests.clear(),this.releaseAll(),this.setWant({mouse:!1,keyboard:!1})}},Go=`data:video/mp4;base64,AAAAIGZ0eXBpc29tAAACAGlzb21pc28yYXZjMW1wNDEAAAYZbW9vdgAAAGxtdmhkAAAAAAAAAAAAAAAAAAAfQAAAfQAAAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAmt0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAABAAAAAAAAfQAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAABAAAAAQAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAH0AAAAAAAABAAAAAAHjbWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAABAAAABAABVxAAAAAAALWhkbHIAAAAAAAAAAHZpZGUAAAAAAAAAAAAAAABWaWRlb0hhbmRsZXIAAAABjm1pbmYAAAAUdm1oZAAAAAEAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAU5zdGJsAAAAunN0c2QAAAAAAAAAAQAAAKphdmMxAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAABAAEABIAAAASAAAAAAAAAABFExhdmM2My4xLjEwMiBsaWJ4MjY0AAAAAAAAAAAAAAAAGP//AAAAMGF2Y0MBQsAK/+EAF2dCwAqmEXsBEAAAAwAQAAADACDxImEYAQAGaMhCAZSyAAAAEHBhc3AAAAABAAAAAQAAABRidHJ0AAAAAAAABUAAAAAAAAAAGHN0dHMAAAAAAAAAAQAAAAQAAEAAAAAAFHN0c3MAAAAAAAAAAQAAAAEAAAAcc3RzYwAAAAAAAAABAAAAAQAAAAEAAAABAAAAJHN0c3oAAAAAAAAAAAAAAAQAAAKCAAAACgAAAAoAAAAKAAAAIHN0Y28AAAAAAAAABAAABlwAAAj+AAAJKAAACVIAAALZdHJhawAAAFx0a2hkAAAAAwAAAAAAAAAAAAAAAgAAAAAAAH0AAAAAAAAAAAAAAAABAQAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAJGVkdHMAAAAcZWxzdAAAAAAAAAABAAB9AAAABAAAAQAAAAACUW1kaWEAAAAgbWRoZAAAAAAAAAAAAAAAAAAAH0AAAIEAVcQAAAAAAC1oZGxyAAAAAAAAAABzb3VuAAAAAAAAAAAAAAAAU291bmRIYW5kbGVyAAAAAfxtaW5mAAAAEHNtaGQAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAcBzdGJsAAAAfnN0c2QAAAAAAAAAAQAAAG5tcDRhAAAAAAAAAAEAAAAAAAAAAAABABAAAAAAH0AAAAAAADZlc2RzAAAAAAOAgIAlAAIABICAgBdAFQAAAAAAH0AAAAEcBYCAgAUViFblAAaAgIABAgAAABRidHJ0AAAAAAAAH0AAAAEcAAAAIHN0dHMAAAAAAAAAAgAAACAAAAQAAAAAAQAAAQAAAAAoc3RzYwAAAAAAAAACAAAAAQAAAAEAAAABAAAAAgAAAAgAAAABAAAAmHN0c3oAAAAAAAAAAAAAACEAAAATAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAkc3RjbwAAAAAAAAAFAAAGSQAACN4AAAkIAAAJMgAACVwAAAAac2dwZAEAAAByb2xsAAAAAgAAAAH//wAAABxzYmdwAAAAAHJvbGwAAAABAAAAIQAAAAEAAABhdWR0YQAAAFltZXRhAAAAAAAAACFoZGxyAAAAAAAAAABtZGlyYXBwbAAAAAAAAAAAAAAAACxpbHN0AAAAJKl0b28AAAAcZGF0YQAAAAEAAAAATGF2ZjYzLjEuMTAyAAAACGZyZWUAAAM7bWRhdNwATGF2YzYzLjEuMTAyAAIwQA4AAAJvBgX//2vcRem95tlIt5Ys2CDZI+7veDI2NCAtIGNvcmUgMTY1IHIzMjIyIGIzNTYwNWEgLSBILjI2NC9NUEVHLTQgQVZDIGNvZGVjIC0gQ29weWxlZnQgMjAwMy0yMDI1IC0gaHR0cDovL3d3dy52aWRlb2xhbi5vcmcveDI2NC5odG1sIC0gb3B0aW9uczogY2FiYWM9MCByZWY9MTYgZGVibG9jaz0xOjA6MCBhbmFseXNlPTB4MToweDEzMSBtZT11bWggc3VibWU9MTAgcHN5PTEgcHN5X3JkPTEuMDA6MC4wMCBtaXhlZF9yZWY9MSBtZV9yYW5nZT0yNCBjaHJvbWFfbWU9MSB0cmVsbGlzPTIgOHg4ZGN0PTAgY3FtPTAgZGVhZHpvbmU9MjEsMTEgZmFzdF9wc2tpcD0xIGNocm9tYV9xcF9vZmZzZXQ9LTIgdGhyZWFkcz0xIGxvb2thaGVhZF90aHJlYWRzPTEgc2xpY2VkX3RocmVhZHM9MCBucj0wIGRlY2ltYXRlPTEgaW50ZXJsYWNlZD0wIGJsdXJheV9jb21wYXQ9MCBjb25zdHJhaW5lZF9pbnRyYT0wIGJmcmFtZXM9MCB3ZWlnaHRwPTAga2V5aW50PTQga2V5aW50X21pbj0xIHNjZW5lY3V0PTQwIGludHJhX3JlZnJlc2g9MCByY19sb29rYWhlYWQ9NCByYz1jcmYgbWJ0cmVlPTEgY3JmPTUxLjAgcWNvbXA9MC42MCBxcG1pbj0wIHFwbWF4PTY5IHFwc3RlcD00IGlwX3JhdGlvPTEuNDAgYXE9MToxLjAwAIAAAAALZYiCAv5MUAAQv8ABGCAHARggBwEYIAcBGCAHARggBwEYIAcBGCAHARggBwAAAAZBmhwF/UABGCAHARggBwEYIAcBGCAHARggBwEYIAcBGCAHARggBwAAAAZBmioBb1ABGCAHARggBwEYIAcBGCAHARggBwEYIAcBGCAHARggBwAAAAZBmjsBX1ABGCAHARggBwEYIAcBGCAHARggBwEYIAcBGCAHARggBw==`,Ko=null,qo=null;function Jo(e){e.play().catch(()=>{if(qo||Ko!==e)return;let t=()=>{Yo(),Ko===e&&e.play().catch(()=>{})};window.addEventListener(`pointerdown`,t,{capture:!0}),qo=()=>window.removeEventListener(`pointerdown`,t,{capture:!0})})}function Yo(){qo?.(),qo=null}function Xo(){if(typeof document<`u`){if(!Ko){let e=document.createElement(`video`);e.muted=!0,e.loop=!0,e.playsInline=!0,e.setAttribute(`playsinline`,``),e.setAttribute(`aria-hidden`,`true`),e.setAttribute(`data-testid`,`keep-screen-video`),e.style.cssText=`position:fixed;left:0;top:0;width:1px;height:1px;opacity:0;pointer-events:none`,e.src=Go,document.body.appendChild(e),Ko=e}Jo(Ko)}}function Zo(){Yo(),Ko&&=(Ko.pause(),Ko.removeAttribute(`src`),Ko.remove(),null)}function Qo(){return typeof navigator>`u`?null:navigator.wakeLock??null}function V(){return Te()||!gn()}var $o=new Set,es=null,ts=Promise.resolve(),ns=!1;async function rs(){if($o.size===0||es&&!es.released)return;let e=Qo();if(!e)Te()&&Xo();else try{let t=await e.request(`screen`);t.addEventListener(`release`,()=>{es===t&&(es=null)}),es=t}catch{}}async function is(){Zo();let e=es;if(es=null,e&&!e.released)try{await e.release()}catch{}}function as(){ns||typeof document>`u`||(ns=!0,document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`visible`&&$o.size>0&&(ts=ts.then(rs))}))}function os(e,t){if(!V())return;as();let n=$o.size>0;t?$o.add(e):$o.delete(e);let r=$o.size>0;n!==r&&(ts=ts.then(r?rs:is))}var ss=new Set;function cs(){if(typeof window<`u`)return window.PS5UploadPad}function ls(e,t){let n=ss.size>0;t?ss.add(e):ss.delete(e);let r=ss.size>0;if(n!==r)try{cs()?.setActive(r)}catch{}}function us(e,t){let[n,r]=(0,T.useState)(!1);return(0,T.useEffect)(()=>{if(!e||!t)return;let n=!0;return Pe(e,je).then(e=>{n&&!e&&r(!0)}),()=>{n=!1}},[e,t]),n}function ds({href:e}){let t=Tn();return(0,L.jsxs)(`div`,{className:`flex flex-col items-center gap-3 text-center`,"data-testid":`open-on-wifi`,children:[(0,L.jsx)(`p`,{className:`max-w-sm text-sm text-white/60`,children:t(`join_open_lan_body`,void 0,`Can't reach the internet? If you're on the same Wi-Fi as your friend, open the game there.`)}),(0,L.jsx)(`a`,{href:e,rel:`noreferrer`,className:`rounded-full bg-white px-4 py-2 text-sm font-medium text-black`,"data-testid":`open-on-wifi-link`,children:t(`join_open_lan`,void 0,`Open on this Wi-Fi`)})]})}function fs(e,t,n){switch(t.kind){case`connecting`:return e(`pad_connecting`,void 0,`Connecting…`);case`asking`:return e(`pad_asking`,{name:n},`Waiting for ${n} to allow this phone…`);case`joined`:return t.host?t.passcode&&!t.playing?e(`pad_wait_passcode`,{name:n},`Waiting for the passcode on ${n}`):t.playing?e(`pad_playing`,{host:t.host},`Controller for ${t.host}`):e(`pad_starting`,void 0,`Connected. The stream is starting…`):e(`pad_no_session`,void 0,`Connected. Waiting for Remote Play to start on the computer.`);case`refused`:return t.why===`denied`?e(`pad_denied`,void 0,`The computer said no.`):t.why===`no_answer`?e(`pad_no_answer`,void 0,`The computer didn't answer in time. Try again.`):t.why===`kicked`?e(`pad_kicked`,void 0,`The computer took this phone out of the game.`):t.why===`closed`?e(`pad_link_closed`,void 0,`The computer closed the link. Scan the new code to play again.`):t.why===`key`?e(`pad_old_code`,void 0,`This code has expired. Scan the new one on the computer.`):t.why===`full`?e(`pad_full`,void 0,`Four phones are playing already.`):t.why===`no_stream`?e(`pad_watch_no_stream`,void 0,`Nothing is streaming on the computer right now.`):t.why.startsWith(`net:`)?ps(e,t.why.slice(4)):e(`pad_refused`,void 0,`The computer did not let this phone in.`);case`reconnecting`:return e(`pad_reconnecting`,void 0,`Connection lost. Reconnecting…`);case`lost`:return e(`pad_lost`,void 0,`Lost the connection to the computer.`)}}function ps(e,t){switch(t){case`mismatch`:return e(`join_net_mismatch`,void 0,`This link doesn't match the host; ask them for a new one.`);case`no_direct`:return e(`join_net_no_direct`,void 0,`A direct connection isn't possible from this network (both sides' routers are strict). Try Wi-Fi instead of mobile data, or ask the host to turn on UPnP.`);case`no_room`:return e(`pad_old_code`,void 0,`This code has expired. Scan the new one on the computer.`);case`net_full`:return e(`pad_full`,void 0,`Four phones are playing already.`);case`no_hub`:return e(`join_net_no_hub`,void 0,`Couldn't reach the PS5Upload invite service. Check your internet connection, then try again.`);case`offer`:case`no_webrtc`:return e(`join_net_no_webrtc`,void 0,`This browser can't make direct connections. Try a recent Chrome, Safari or Firefox.`);default:return e(`pad_lost`,void 0,`Lost the connection to the computer.`)}}function ms(e){return e.kind!==`refused`||e.why!==`kicked`&&e.why!==`closed`}async function hs(){try{await document.documentElement.requestFullscreen?.({navigationUI:`hide`}),await screen.orientation.lock?.(`landscape`)}catch{}}function gs(e,t){return t?.mouse?null:t?.reason===`vinput_helper_old`||t?.reason===`helper_old`?e(`rp_kbm_helper_old`,void 0,`Update the PS5 helper to use a keyboard and mouse.`):t?.reason===`vinput_needs_loader`?e(`rp_kbm_needs_loader`,void 0,`Needs a payload loader on port 9021`):e(`rp_kbm_unavailable`,void 0,`Native keyboard & mouse isn't available on this console yet.`)}function _s({client:e,caps:t}){let n=Tn(),r=(0,T.useMemo)(()=>new B({send:t=>e.sendKbm(t)}),[e]);(0,T.useEffect)(()=>{r.setWant({mouse:!0,keyboard:t.keyboard})},[r,t.keyboard]),(0,T.useEffect)(()=>()=>r.dispose(),[r]);let i=(0,T.useMemo)(()=>({move:(e,t)=>r.move(e,t),button:(e,t)=>r.button(e,t),scroll:(e,t)=>r.scroll(e,t,0),key:(e,t)=>r.key(e,t),shiftHeld:()=>r.shiftHeld()}),[r]);return(0,L.jsxs)(Po,{sink:i,speed:1.5,className:`absolute inset-0 z-10`,testId:`pad-touchpad`,children:[(0,L.jsx)(`p`,{className:`pointer-events-none absolute inset-x-6 top-1/2 -translate-y-1/2 text-center text-xs leading-5 text-white/50`,children:n(`rp_tp_tips`,void 0,`Drag to move. Tap to click. Two fingers: tap to right-click, drag to scroll. Tap, then touch and drag to select.`)}),(0,L.jsx)(`div`,{className:`absolute`,style:{right:`max(12px, env(safe-area-inset-right))`,bottom:`max(12px, env(safe-area-inset-bottom))`},children:(0,L.jsx)(Io,{sink:t.keyboard?i:null})})]})}function vs({url:e,computer:t,onLeave:n,watch:r=!1,transport:i,hello:a,onReconnectToken:o,lanUrl:s=null}){let c=Tn(),l=us(i?e:null,s),u=t??c(`pad_net_computer`,void 0,`the computer`),[d,f]=(0,T.useState)({kind:`connecting`}),[p,m]=(0,T.useState)(0),[h,g]=(0,T.useState)(()=>typeof window<`u`&&window.innerHeight>window.innerWidth),[_,v]=(0,T.useState)(null),[y,b]=(0,T.useState)(null),[x,S]=(0,T.useState)(!1),ee=(0,T.useRef)(null),te=(0,T.useRef)(null),[C,ne]=(0,T.useState)(!r),[w,re]=(0,T.useState)(null),[ie,ae]=(0,T.useState)(!1),[oe,se]=(0,T.useState)(null),[ce,le]=(0,T.useState)(`controller`);(0,T.useEffect)(()=>(os(`pad-remote`,!0),ls(`pad-remote`,!0),()=>{os(`pad-remote`,!1),ls(`pad-remote`,!1)}),[]),(0,T.useEffect)(()=>{if(!x)return;let e=Ae(e=>{co.motion=e});return()=>{e(),co.motion=null}},[x]),(0,T.useEffect)(()=>{let t=r?Zi(re,`watch`,()=>n.askKeyframe()):null;ee.current=t,t&&te.current?.appendChild(t.element),ne(!r),ae(!1);let n=new io({url:e,WebSocketImpl:i,hello:a,onReconnectToken:o,onStage:f,touchPad:()=>co.touchPad,onLight:v,onKbmCaps:se,motion:()=>co.motion,watch:t?{onFrame:e=>t.onMessage(e),onCodec:e=>t.setHevc(e),onControl:ne}:void 0});b(n),n.start();let s=()=>{let e=document.visibilityState===`hidden`;n.setNeutral(e),e||n.wake()},c=()=>n.setNeutral(!0);return document.addEventListener(`visibilitychange`,s),window.addEventListener(`blur`,c),window.addEventListener(`focus`,s),()=>{document.removeEventListener(`visibilitychange`,s),window.removeEventListener(`blur`,c),window.removeEventListener(`focus`,s),n.stop(),t?.stop(),t?.element.remove()}},[e,p,r]),(0,T.useEffect)(()=>{let e=()=>g(window.innerHeight>window.innerWidth);return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]);let ue=d.kind===`refused`||d.kind===`lost`,de=d.kind===`joined`||d.kind===`reconnecting`,pe=!!s&&!de&&(l||d.kind===`refused`&&d.why===`net:no_hub`);return(0,L.jsxs)(`div`,{className:`fixed inset-0 select-none overflow-hidden bg-black text-white [-webkit-touch-callout:none]`,style:{touchAction:`none`},"data-testid":`pad-app`,children:[(0,L.jsxs)(`div`,{className:`absolute inset-x-0 top-0 z-20 flex items-center justify-center gap-2 px-3 pt-[max(6px,env(safe-area-inset-top))] text-xs text-white/80`,children:[(0,L.jsx)(`span`,{className:`inline-block h-2 w-2 shrink-0 rounded-full`,style:{background:d.kind===`joined`?_?`rgb(${_[0]},${_[1]},${_[2]})`:`var(--color-success,#22c55e)`:ue?`var(--color-bad,#ef4444)`:`#eab308`}}),(0,L.jsx)(`span`,{className:`truncate`,"data-testid":`pad-stage`,children:r&&d.kind===`joined`&&d.host&&(!d.passcode||d.playing)?C?c(`pad_watch_control`,void 0,`Watching, and you have the controller`):c(`pad_watch_watching`,{host:d.host},`Watching ${d.host}`):fs(c,d,u)}),de&&typeof document<`u`&&!!document.documentElement.requestFullscreen&&!document.fullscreenElement&&(0,L.jsxs)(`button`,{type:`button`,onClick:()=>void hs(),className:`flex items-center gap-1 rounded-full bg-white/15 px-2 py-1`,"data-testid":`pad-full`,children:[(0,L.jsx)(fe,{size:12}),c(`pad_fill`,void 0,`Full screen`)]}),de&&k()&&(0,L.jsx)(`button`,{type:`button`,onClick:()=>{x?S(!1):ke().then(S)},"aria-pressed":x,className:`rounded-full px-2 py-1 ${x?`bg-white text-black`:`bg-white/15`}`,"data-testid":`pad-motion`,children:c(`pad_motion`,void 0,`Motion`)}),n&&(0,L.jsx)(`button`,{type:`button`,onClick:n,className:`rounded-full bg-white/15 px-2 py-1`,"data-testid":`pad-leave`,children:c(`pad_leave`,void 0,`Stop being a controller`)})]}),(0,L.jsx)(`div`,{ref:te,className:`absolute inset-0 z-0 flex items-center justify-center`,"aria-hidden":!0}),r&&de&&!ie&&(0,L.jsxs)(`button`,{type:`button`,onClick:()=>{ee.current?.startSound(),ae(!0)},className:`absolute bottom-4 left-1/2 z-20 flex -translate-x-1/2 items-center gap-1.5 rounded-full bg-white/90 px-3 py-1.5 text-xs font-medium text-black`,"data-testid":`watch-sound`,children:[(0,L.jsx)(Ce,{size:14}),c(`pad_watch_sound`,void 0,`Sound`)]}),r&&w&&(0,L.jsx)(`p`,{className:`absolute inset-x-4 top-1/2 z-10 -translate-y-1/2 text-center text-sm text-white/85`,"data-testid":`watch-problem`,children:w===`no_hevc`?c(`pad_watch_no_hevc`,void 0,`This device can't play this stream's picture: the computer streams HEVC, and this device plays only H.264.`):c(`pad_watch_decode`,void 0,`The picture could not be played here.`)}),de&&C&&(ce===`touchpad`&&oe?.mouse&&y?(0,L.jsx)(_s,{client:y,caps:oe}):(0,L.jsx)(wo,{stream:y,layout:`overlay`})),de&&C&&(0,L.jsx)(Lo,{mode:ce===`touchpad`&&oe?.mouse?`touchpad`:`controller`,onChange:le,blocked:gs(c,oe),touchpadLabel:c(`pad_touchpad_tab`,void 0,`Touchpad & keyboard`),style:{top:`calc(max(6px, env(safe-area-inset-top)) + 2rem)`}}),de&&h&&(0,L.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 bottom-6 z-20 flex justify-center`,children:(0,L.jsxs)(`span`,{className:`flex items-center gap-2 rounded-full bg-black/70 px-3 py-1.5 text-xs text-white/85`,children:[(0,L.jsx)(xe,{size:14}),c(`pad_turn`,void 0,`Turn the phone sideways`)]})}),pe&&!ue&&s&&(0,L.jsx)(`div`,{className:`absolute inset-x-0 bottom-8 z-10 flex justify-center px-6`,children:(0,L.jsx)(ds,{href:s})}),ue&&(0,L.jsxs)(`div`,{className:`absolute inset-0 z-10 flex flex-col items-center justify-center gap-3 px-6 text-center text-sm`,children:[(0,L.jsx)(`p`,{className:`max-w-sm text-white/85`,children:fs(c,d,u)}),pe&&s&&(0,L.jsx)(ds,{href:s}),ms(d)&&(0,L.jsx)(`button`,{type:`button`,onClick:()=>m(e=>e+1),className:`rounded-full bg-white px-4 py-2 text-sm font-medium text-black`,"data-testid":`pad-retry`,children:c(`pad_retry`,void 0,`Try again`)})]})]})}var ys=`ps5upload.openIn`,bs=`ps5upload.openIn.tab`;function xs(){try{return sessionStorage.getItem(bs)===`browser`}catch{return!1}}function Ss(){try{sessionStorage.setItem(bs,`browser`)}catch{}}function Cs(e){return e===`browser`?`browser`:e===`app`?`opening`:`ask`}function ws({appLink:e,children:t}){let n=Tn(),[r,i]=(0,T.useState)(()=>xs()?`browser`:Cs(yt(ys))),[a,o]=(0,T.useState)(!1);if((0,T.useEffect)(()=>{r===`opening`&&yt(`ps5upload.openIn`)===`app`&&(location.href=e)},[]),r===`browser`)return(0,L.jsx)(L.Fragment,{children:t});let s=()=>{a&&vt(ys,`app`),i(`opening`),location.href=e},c=()=>{r===`ask`&&a?vt(ys,`browser`):r===`opening`&&yt(`ps5upload.openIn`)===`app`&&bt(ys),Ss(),i(`browser`)};return(0,L.jsx)(`div`,{className:`flex min-h-[100dvh] items-center justify-center bg-black px-6 text-white`,"data-testid":`open-in-gate`,"data-join-ui":``,children:(0,L.jsx)(`div`,{className:`w-full max-w-sm space-y-4 rounded-2xl border border-white/10 bg-neutral-900 p-6`,children:r===`ask`?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`div`,{className:`space-y-1`,children:[(0,L.jsx)(`h1`,{className:`text-lg font-semibold`,children:n(`open_in_title`,void 0,`Open in the PS5Upload app?`)}),(0,L.jsx)(`p`,{className:`text-sm text-white/60`,children:n(`open_in_body`,void 0,`Have the PS5Upload app on this device? Open this there, or carry on in the browser.`)})]}),(0,L.jsx)(`button`,{type:`button`,onClick:s,autoFocus:!0,className:`w-full rounded-full bg-white py-2.5 text-sm font-semibold text-black`,"data-testid":`open-in-app`,children:n(`open_in_app`,void 0,`Open in the app`)}),(0,L.jsx)(`button`,{type:`button`,onClick:c,className:`w-full rounded-full border border-white/20 py-2.5 text-sm font-semibold text-white hover:bg-white/10`,"data-testid":`open-in-browser`,children:n(`open_in_browser`,void 0,`Continue in browser`)}),(0,L.jsxs)(`label`,{className:`flex items-center justify-center gap-2 text-xs text-white/60`,children:[(0,L.jsx)(`input`,{type:`checkbox`,checked:a,onChange:e=>o(e.target.checked),"data-testid":`open-in-remember`}),n(`open_in_remember`,void 0,`Remember my choice on this device`)]})]}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`div`,{className:`space-y-1`,children:[(0,L.jsx)(`h1`,{className:`text-lg font-semibold`,children:n(`open_in_opening`,void 0,`Opening the PS5Upload app…`)}),(0,L.jsx)(`p`,{className:`text-sm text-white/60`,children:n(`open_in_not_opened`,void 0,`Nothing happened? The app may not be on this device.`)})]}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>location.href=e,autoFocus:!0,className:`w-full rounded-full bg-white py-2.5 text-sm font-semibold text-black`,"data-testid":`open-in-again`,children:n(`open_in_again`,void 0,`Try again`)}),(0,L.jsx)(`button`,{type:`button`,onClick:c,className:`w-full rounded-full border border-white/20 py-2.5 text-sm font-semibold text-white hover:bg-white/10`,"data-testid":`open-in-browser`,children:n(`open_in_browser`,void 0,`Continue in browser`)})]})})})}function Ts(e){return`ps5upload://pad?link=${encodeURIComponent(e)}`}function Es(e){let t=(e??``).trim().replace(/^\[|\]$/g,``).toLowerCase(),n=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/.exec(t);if(n){let e=n.slice(1).map(Number);if(e.some(e=>e>255))return null;let[t,r]=e;return t===10||t===172&&r>=16&&r<32||t===192&&r===168||t===169&&r===254||t===127?0:t===100&&r>=64&&r<128?1:2}if(!t.includes(`:`)||!/^[0-9a-f:.]+$/.test(t))return null;if(t.startsWith(`fd7a:115c:a1e0:`))return 1;let r=parseInt(t.split(`:`)[0]||`0`,16);return(r&65024)==64512||(r&65472)==65152||t===`::1`?0:2}function Ds(e,t){let n=Es(e),r=Es(t);return n===1||r===1?`tailscale`:r===0?`lan`:r===2?`internet`:null}function Os(e){let t=[];if(typeof e.forEach==`function`)e.forEach(e=>t.push(e));else for(let n of e)t.push(n);let n=new Map(t.map(e=>[String(e.id),e])),r=t.filter(e=>e.type===`candidate-pair`),i=t.filter(e=>e.type===`transport`&&typeof e.selectedCandidatePairId==`string`).map(e=>n.get(String(e.selectedCandidatePairId))).find(Boolean)??r.find(e=>e.selected===!0)??r.find(e=>e.nominated===!0&&e.state===`succeeded`);if(!i)return null;let a=e=>{let t=n.get(String(e));if(!t)return null;let r=t.address??t.ip;return typeof r==`string`?r:null};return Ds(a(i.localCandidateId),a(i.remoteCandidateId))}function ks(e){let t=e.replace(/:\d+$/,``).replace(/^\[|\]$/g,``);return`${t===`localhost`||t===`127.0.0.1`||t===`::1`?`ws`:`wss`}://${e}/ws`}function As(e){let t=new Set;for(let n of e.matchAll(/^a=fingerprint:sha-256[ \t]+([0-9A-Fa-f:]+)[ \t]*\r?$/gim))t.add(n[1].toUpperCase());return/^a=fingerprint:(?!sha-256[ \t])/im.test(e)?null:t.size===1?[...t][0]:null}function js(e,t){let n=As(e);return n!==null&&n===t.toUpperCase()}var Ms=16777216;function Ns(e){let t=16383,n=Math.max(1,Math.ceil(e.length/t)),r=[];for(let i=0;i<n;i++){let a=e.subarray(i*t,Math.min(e.length,(i+1)*t)),o=new Uint8Array(a.length+1);o[0]=i+1===n?0:1,o.set(a,1),r.push(o)}return r}var Ps=class{constructor(e=Ms){this.max=e,this.parts=[],this.size=0}push(e){let t=e instanceof Uint8Array?e:new Uint8Array(e);if(t.length===0)return{kind:`error`,why:`empty`};let n=t[0],r=t.subarray(1);if(n===2||n===3)return r.length===8?{kind:n===2?`ping`:`pong`,data:r.slice()}:{kind:`error`,why:`ping_size`};if(n!==0&&n!==1)return{kind:`error`,why:`header`};if(this.size+r.length>this.max)return this.parts=[],this.size=0,{kind:`error`,why:`too_big`};if(this.parts.push(r.slice()),this.size+=r.length,n===1)return{kind:`partial`};let i=new Uint8Array(this.size),a=0;for(let e of this.parts)i.set(e,a),a+=e.length;return this.parts=[],this.size=0,{kind:`message`,data:i.buffer}}};function Fs(e){let t=new Uint8Array(9);return t[0]=3,t.set(e.subarray(0,8),1),t}var Is=[`stun:stun.cloudflare.com:3478`,`stun:stun.l.google.com:19302`],Ls=1500,Rs=2e4;function zs(e){let t=e?.codecs??[],n=e=>t.filter(t=>t.mimeType.toLowerCase()===e);return[...n(`video/h264`),...n(`video/h265`),...n(`video/rtx`)]}var Bs=null;function Vs(e){e.onopen=e.onmessage=e.onclose=e.onerror=null;try{e.readyState===1&&e.send(JSON.stringify({t:`leave`})),e.close(1e3)}catch{}}function Hs(e,t){let n=Bs;return n?(Bs=null,n.timer&&clearTimeout(n.timer),n.url!==e||n.room!==t||n.ws.readyState>1||n.msgs.some(e=>e.t===`error`||e.t===`closed`)?(Vs(n.ws),null):{ws:n.ws,msgs:n.msgs}):null}function Us(e,t={}){var n;let r=t.WebSocketImpl??(typeof WebSocket>`u`?void 0:WebSocket),i=t.PeerConnection??(typeof RTCPeerConnection>`u`?void 0:RTCPeerConnection),a=t.iceTimeoutMs??15e3,o=t.log??(()=>{});class s{constructor(e){this.CONNECTING=0,this.OPEN=1,this.CLOSING=2,this.CLOSED=3,this.readyState=0,this.binaryType=`arraybuffer`,this.onopen=null,this.onmessage=null,this.onclose=null,this.onerror=null,this.hub=null,this.pc=null,this.dc=null,this.timer=null,this.rx=new Ps,this.answered=!1,this.early=[],this.hubBackUntil=0,this.offerSdp=null,this.offerSent=!1,this.ownEarly=[],this.media=null,setTimeout(()=>this.begin(),0)}begin(){if(this.readyState!==0)return;if(!i||!r){this.fail(`no_webrtc`);return}let n=t.signalUrl??ks(e.hub),a=t.signalUrl||t.lan?null:Hs(n,e.room),s;if(a)s=a.ws,o(`hub: joined early`);else try{s=new r(n)}catch{this.fail(`no_hub`);return}if(this.hub=s,this.prepare(),this.readyState===0){s.onopen=()=>s.send(JSON.stringify(t.lan?{v:1,t:`join`,lan:!0}:{v:1,t:`join`,room:e.room})),s.onmessage=e=>{if(typeof e.data!=`string`)return;let t;try{t=JSON.parse(e.data)}catch{return}this.onHub(t)},s.onclose=e=>{this.hub===s&&(this.hub=null,this.readyState===0&&(this.answered||e?.code===1001&&this.hubRestarting()||this.fail(`no_hub`)))},s.onerror=()=>{};for(let e of a?.msgs??[])this.onHub(e)}}signal(e){let t=this.hub;t&&t.readyState===1&&t.send(JSON.stringify({t:`signal`,to:`host`,data:e}))}onHub(e){if(this.readyState===0)switch(e.t){case`joined`:o(`hub: joined room as ${e.gid??`?`}`),this.sendOffer();return;case`signal`:e.from===`host`&&e.data&&typeof e.data==`object`&&this.onSignal(e.data);return;case`closed`:this.fail(`no_room`);return;case`error`:if(o(`hub: error ${e.why??`?`}`),e.why===`no_room`&&this.hubBackUntil&&this.hubRestarting())return;this.fail(e.why===`no_room`?`no_room`:e.why===`room_full`?`net_full`:`no_hub`);return}}prepare(){if(!i)return;this.offerSent=!1,this.ownEarly=[];let e;try{e=new i({iceServers:[{urls:Is}]})}catch{this.fail(`no_webrtc`);return}this.pc=e;let n=e.createDataChannel(t.label??`join`,{ordered:!0});if(n.binaryType=`arraybuffer`,this.dc=n,n.onopen=()=>this.opened(n),n.onmessage=e=>this.fromChannel(e.data),n.onclose=()=>{this.dc===n&&this.dropped()},t.video&&e.addTransceiver){try{let t=e.addTransceiver(`video`,{direction:`recvonly`}),n=zs(globalThis.RTCRtpReceiver?.getCapabilities?.(`video`));n.length&&t.setCodecPreferences&&t.setCodecPreferences(n)}catch{}try{e.addTransceiver(`audio`,{direction:`recvonly`})}catch{}e.ontrack=t=>{if(this.pc!==e)return;let n=this.media?.stream??t.streams[0]??new MediaStream;n.getTracks().includes(t.track)||n.addTrack(t.track),this.media=t.track.kind===`audio`?{stream:n,receiver:this.media?.receiver??t.receiver,audio:t.receiver}:{stream:n,receiver:t.receiver,...this.media?.audio?{audio:this.media.audio}:{}}}}e.onicecandidate=t=>{if(this.pc!==e)return;let n=t.candidate;if(!n||!n.candidate)return;let r={type:`candidate`,candidate:n.candidate,sdpMid:n.sdpMid??`0`};this.offerSent?this.signal(r):this.ownEarly.push(r)},e.oniceconnectionstatechange=()=>{if(this.pc!==e)return;let t=e.iceConnectionState;o(`ice: ${t}`),t===`failed`&&(this.readyState===0?this.fail(`no_direct`):this.dropped())},this.offerSdp=(async()=>{let t=await e.createOffer();return await e.setLocalDescription(t),e.localDescription?.sdp??t.sdp??``})().catch(()=>(this.pc===e&&this.fail(`no_webrtc`),null))}async sendOffer(){let e=this.pc,t=this.offerSdp;if(!e||!t||this.offerSent)return;this.clearTimer(),this.timer=setTimeout(()=>{this.timer=null,this.readyState===0&&this.fail(`no_direct`)},a);let n=await t;if(this.pc===e&&n!==null&&this.readyState===0){this.signal({type:`offer`,sdp:n}),this.offerSent=!0;for(let e of this.ownEarly.splice(0))this.signal(e)}}async onSignal(t){let n=this.pc;if(t.type===`bye`)this.fail(t.why===`full`?`net_full`:`offer`);else if(n){if(t.type===`answer`){if(this.answered||typeof t.sdp!=`string`)return;if(e.fp?!js(t.sdp,e.fp):As(t.sdp)===null){o(`answer: fingerprint does not match the link`),this.fail(`mismatch`);return}this.answered=!0;try{await n.setRemoteDescription({type:`answer`,sdp:t.sdp});for(let e of this.early.splice(0))await n.addIceCandidate(e).catch(()=>{})}catch{this.fail(`offer`)}}else if(t.type===`candidate`&&typeof t.candidate==`string`&&t.candidate){let e={candidate:t.candidate,sdpMid:typeof t.sdpMid==`string`?t.sdpMid:`0`,sdpMLineIndex:typeof t.sdpMLineIndex==`number`?t.sdpMLineIndex:0};this.answered?await n.addIceCandidate(e).catch(()=>{}):this.early.push(e)}}}opened(e){this.dc===e&&this.readyState===0&&(this.clearTimer(),this.readyState=1,o(`channel open`),this.leaveHub(),this.onopen?.(new Event(`open`)))}fromChannel(e){if(this.readyState!==1)return;if(typeof e==`string`){this.onmessage?.(new MessageEvent(`message`,{data:e}));return}if(!(e instanceof ArrayBuffer))return;let t=this.rx.push(e);switch(t.kind){case`ping`:try{this.dc?.send(Fs(t.data))}catch{}return;case`message`:this.onmessage?.(new MessageEvent(`message`,{data:t.data}));return;case`error`:o(`channel: bad binary message (${t.why})`),this.dropped();return;default:return}}async netPath(){let e=this.pc;if(!e||this.readyState!==1||typeof e.getStats!=`function`)return null;try{return Os(await e.getStats())}catch{return null}}send(e){let t=this.dc;if(this.readyState!==1||!t||t.readyState!==`open`)throw Error(`not open`);if(typeof e==`string`){t.send(e);return}let n=ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e);for(let e of Ns(n))t.send(e)}close(){this.readyState!==3&&(this.teardown(),this.emitClose(1e3,``,!0))}clearTimer(){this.timer&&clearTimeout(this.timer),this.timer=null}leaveHub(){let e=this.hub;if(this.hub=null,e)try{e.readyState===1&&e.send(JSON.stringify({t:`leave`})),e.close(1e3)}catch{}}hubRestarting(){let e=Date.now();return this.hubBackUntil||=e+Rs,e>=this.hubBackUntil?!1:(o(`hub: restarting, trying again`),this.clearTimer(),this.leaveHub(),this.closePeer(),this.answered=!1,this.early=[],this.timer=setTimeout(()=>{this.timer=null,this.begin()},Ls),!0)}teardown(){this.readyState=3,this.clearTimer(),this.leaveHub(),this.closePeer()}closePeer(){let e=this.pc,t=this.dc;this.pc=null,this.dc=null,this.media=null,this.offerSdp=null,this.offerSent=!1,this.ownEarly=[];try{t?.close()}catch{}try{e?.close()}catch{}}dropped(){this.readyState!==3&&(this.teardown(),this.emitClose(1006,``,!1))}fail(e){this.readyState!==3&&(o(`failed: ${e}`),this.teardown(),this.emitClose(Ie,`net:${e}`,!1))}emitClose(e,t,n){let r=this.onclose;if(!r)return;let i=typeof CloseEvent>`u`?{type:`close`,code:e,reason:t,wasClean:n}:new CloseEvent(`close`,{code:e,reason:t,wasClean:n});setTimeout(()=>r(i),0)}}return n=s,n.CONNECTING=0,n.OPEN=1,n.CLOSING=2,n.CLOSED=3,s}function Ws(e,t=0){return/iPad/.test(e)||/Macintosh/.test(e)&&t>1?`ipad`:/iPhone|iPod/.test(e)?`iphone`:/Android/.test(e)?`android`:`phone`}var Gs=new URLSearchParams(location.hash.slice(1)),Ks=Gs.get(`t`)??``,qs=Gs.get(`w`)===`1`,Js=Ws(navigator.userAgent,navigator.maxTouchPoints),Ys=oo({get:yt,set:vt}),Xs=Be(location.hash),Zs=(0,x.createRoot)(document.getElementById(`root`));if(Xs){let e=Us(Xs,{label:`pad`,log:e=>console.info(`[pad] ${e}`)}),t=`ps5upload.pad.rt.${Xs.room}`,n=yt(t),r={t:Xs.key,name:Js,d:Ys,...qs?{w:1}:{},...n?{rt:n}:{}},i=Me(location.hash,`pad`);Zs.render((0,L.jsx)(vs,{url:ks(Xs.hub),computer:null,watch:qs,transport:e,hello:r,onReconnectToken:e=>vt(t,e),lanUrl:i?Ne(i,{watch:qs}):null}))}else{let e=location.pathname.replace(/\/pad\/?$/,``),t=`${location.protocol===`https:`?`wss`:`ws`}://${location.host}${e}/api/pad/ws?t=${encodeURIComponent(Ks)}&name=${Js}&d=${Ys}${qs?`&w=1`:``}`;Zs.render((0,L.jsx)(ws,{appLink:Ts(location.href),children:(0,L.jsx)(vs,{url:t,computer:location.hostname,watch:qs})}))}</script> <style>/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */ -@supports (((-webkit-hyphens:none)) and (not (margin-trim:block))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}}:root:not(#\#):not(#\#),:host:not(#\#):not(#\#){--font-sans:system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Helvetica, Arial, sans-serif;--font-mono:ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;--color-neutral-900:color(display-p3 .0905274 .0905274 .0905274);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-sm:24rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-wide:.025em;--tracking-wider:.05em;--radius-xl:.75rem;--radius-2xl:1rem;--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}@supports (color:lab(0% 0 0)){:root:not(#\#):not(#\#),:host:not(#\#):not(#\#){--color-neutral-900:lab(7.78201% -.0000149012 0)}}:not(#\#):not(#\#):not(#\#):not(#\#),:not(#\#):not(#\#):not(#\#):not(#\#):after,:not(#\#):not(#\#):not(#\#):not(#\#):before{box-sizing:border-box;border:0 solid;margin:0;padding:0}:not(#\#):not(#\#):not(#\#):not(#\#)::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-file-upload-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}:not(#\#):not(#\#):not(#\#):not(#\#)::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html:not(#\#):not(#\#):not(#\#):not(#\#),:host:not(#\#):not(#\#):not(#\#):not(#\#){-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr:not(#\#):not(#\#):not(#\#):not(#\#){height:0;color:inherit;border-top-width:1px}abbr:where([title]):not(#\#):not(#\#):not(#\#):not(#\#){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1:not(#\#):not(#\#):not(#\#):not(#\#),h2:not(#\#):not(#\#):not(#\#):not(#\#),h3:not(#\#):not(#\#):not(#\#):not(#\#),h4:not(#\#):not(#\#):not(#\#):not(#\#),h5:not(#\#):not(#\#):not(#\#):not(#\#),h6:not(#\#):not(#\#):not(#\#):not(#\#){font-size:inherit;font-weight:inherit}a:not(#\#):not(#\#):not(#\#):not(#\#){color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b:not(#\#):not(#\#):not(#\#):not(#\#),strong:not(#\#):not(#\#):not(#\#):not(#\#){font-weight:bolder}code:not(#\#):not(#\#):not(#\#):not(#\#),kbd:not(#\#):not(#\#):not(#\#):not(#\#),samp:not(#\#):not(#\#):not(#\#):not(#\#),pre:not(#\#):not(#\#):not(#\#):not(#\#){font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small:not(#\#):not(#\#):not(#\#):not(#\#){font-size:80%}sub:not(#\#):not(#\#):not(#\#):not(#\#),sup:not(#\#):not(#\#):not(#\#):not(#\#){vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub:not(#\#):not(#\#):not(#\#):not(#\#){bottom:-.25em}sup:not(#\#):not(#\#):not(#\#):not(#\#){top:-.5em}table:not(#\#):not(#\#):not(#\#):not(#\#){text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)):not(#\#):not(#\#):not(#\#):not(#\#){outline:auto}progress:not(#\#):not(#\#):not(#\#):not(#\#){vertical-align:baseline}summary:not(#\#):not(#\#):not(#\#):not(#\#){display:list-item}ol:not(#\#):not(#\#):not(#\#):not(#\#),ul:not(#\#):not(#\#):not(#\#):not(#\#),menu:not(#\#):not(#\#):not(#\#):not(#\#){list-style:none}img:not(#\#):not(#\#):not(#\#):not(#\#),svg:not(#\#):not(#\#):not(#\#):not(#\#),video:not(#\#):not(#\#):not(#\#):not(#\#),canvas:not(#\#):not(#\#):not(#\#):not(#\#),audio:not(#\#):not(#\#):not(#\#):not(#\#),iframe:not(#\#):not(#\#):not(#\#):not(#\#),embed:not(#\#):not(#\#):not(#\#):not(#\#),object:not(#\#):not(#\#):not(#\#):not(#\#){vertical-align:middle;display:block}img:not(#\#):not(#\#):not(#\#):not(#\#),video:not(#\#):not(#\#):not(#\#):not(#\#){max-width:100%;height:auto}button:not(#\#):not(#\#):not(#\#):not(#\#),input:not(#\#):not(#\#):not(#\#):not(#\#),select:not(#\#):not(#\#):not(#\#):not(#\#),optgroup:not(#\#):not(#\#):not(#\#):not(#\#),textarea:not(#\#):not(#\#):not(#\#):not(#\#){font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-file-upload-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:not(#\#):not(#\#):not(#\#):not(#\#)::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])):not(#\#):not(#\#):not(#\#):not(#\#) optgroup{font-weight:bolder}:where(select:is([multiple],[size])):not(#\#):not(#\#):not(#\#):not(#\#) optgroup option{padding-inline-start:20px}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-file-upload-button{margin-inline-end:4px}:not(#\#):not(#\#):not(#\#):not(#\#)::file-selector-button{margin-inline-end:4px}:not(#\#):not(#\#):not(#\#):not(#\#)::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){:not(#\#):not(#\#):not(#\#):not(#\#)::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){:not(#\#):not(#\#):not(#\#):not(#\#)::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea:not(#\#):not(#\#):not(#\#):not(#\#){resize:vertical}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-search-decoration{-webkit-appearance:none}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-datetime-edit{display:inline-flex}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-datetime-edit-fields-wrapper{padding:0}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-datetime-edit{padding-block-start:0;padding-block-end:0}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-datetime-edit-year-field{padding-block-start:0;padding-block-end:0}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-datetime-edit-month-field{padding-block-start:0;padding-block-end:0}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-datetime-edit-day-field{padding-block-start:0;padding-block-end:0}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-datetime-edit-hour-field{padding-block-start:0;padding-block-end:0}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-datetime-edit-minute-field{padding-block-start:0;padding-block-end:0}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-datetime-edit-second-field{padding-block-start:0;padding-block-end:0}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-datetime-edit-millisecond-field{padding-block-start:0;padding-block-end:0}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-datetime-edit-meridiem-field{padding-block-start:0;padding-block-end:0}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid:not(#\#):not(#\#):not(#\#):not(#\#){box-shadow:none}button:not(#\#):not(#\#):not(#\#):not(#\#),input:where([type=button],[type=reset],[type=submit]):not(#\#):not(#\#):not(#\#):not(#\#){-webkit-appearance:button;appearance:button}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-file-upload-button{-webkit-appearance:button;appearance:button}:not(#\#):not(#\#):not(#\#):not(#\#)::file-selector-button{-webkit-appearance:button;appearance:button}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-inner-spin-button{height:auto}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])):not(#\#){display:none!important}:not(#\#):not(#\#):not(#\#):not(#\#),:not(#\#):not(#\#):not(#\#):not(#\#):before,:not(#\#):not(#\#):not(#\#):not(#\#):after{min-width:0}body:not(#\#):not(#\#):not(#\#):not(#\#){overflow-wrap:break-word}img:not(#\#):not(#\#):not(#\#):not(#\#),svg:not(#\#):not(#\#):not(#\#):not(#\#),video:not(#\#):not(#\#):not(#\#):not(#\#),canvas:not(#\#):not(#\#):not(#\#):not(#\#),select:not(#\#):not(#\#):not(#\#):not(#\#),input:not(#\#):not(#\#):not(#\#):not(#\#),textarea:not(#\#):not(#\#):not(#\#):not(#\#){max-width:100%}.input:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.select:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding:.45rem .9rem;font-size:.875rem}.input-sm:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding:.25rem .7rem;font-size:.75rem}.pointer-events-auto:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){pointer-events:auto}.pointer-events-none:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){pointer-events:none}.invisible:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){visibility:hidden}.visible:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){visibility:visible}.absolute:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){position:absolute}.fixed:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){position:fixed}.relative:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){position:relative}.static:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){position:static}.sticky:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){position:sticky}.inset-0:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){top:0;bottom:0;left:0;right:0}.inset-x-0:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){left:0;right:0}.inset-x-4:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){inset-inline:calc(var(--spacing) * 4)}.inset-x-6:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){inset-inline:calc(var(--spacing) * 6)}.top-0:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){top:0}.top-1\/2:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){top:50%}.bottom-0:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){bottom:0}.bottom-4:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){bottom:calc(var(--spacing) * 4)}.bottom-6:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){bottom:calc(var(--spacing) * 6)}.bottom-8:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){bottom:calc(var(--spacing) * 8)}.bottom-20:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){bottom:calc(var(--spacing) * 20)}.left-1\/2:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){left:50%}.z-0:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){z-index:0}.z-10:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){z-index:10}.z-20:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){z-index:20}.z-30:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){z-index:30}.z-\[300\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){z-index:300}.container:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:100%}@media (min-width:40rem){.container:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){max-width:40rem}}@media (min-width:48rem){.container:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){max-width:48rem}}@media (min-width:64rem){.container:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){max-width:64rem}}@media (min-width:80rem){.container:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){max-width:80rem}}@media (min-width:96rem){.container:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){max-width:96rem}}.ms-\[8px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){margin-inline-start:8px}.me-\[8px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){margin-inline-end:8px}.block:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){display:block}.flex:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){display:flex}.grid:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){display:grid}.hidden:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){display:none}.inline:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){display:inline}.inline-block:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){display:inline-block}.table:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){display:table}.h-2:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:calc(var(--spacing) * 2)}.h-8:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:calc(var(--spacing) * 8)}.h-11:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:calc(var(--spacing) * 11)}.h-\[24px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:24px}.h-\[26px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:26px}.h-\[32px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:32px}.h-\[36px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:36px}.h-\[44px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:44px}.h-\[52px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:52px}.h-\[54px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:54px}.h-\[124px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:124px}.h-full:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:100%}.h-px:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:1px}.min-h-\[100dvh\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){min-height:100dvh}.w-2:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:calc(var(--spacing) * 2)}.w-11:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:calc(var(--spacing) * 11)}.w-\[36px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:36px}.w-\[44px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:44px}.w-\[52px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:52px}.w-\[54px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:54px}.w-\[56px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:56px}.w-\[76px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:76px}.w-\[84px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:84px}.w-\[124px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:124px}.w-full:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:100%}.w-max:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:max-content}.w-px:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:1px}.max-w-\[calc\(100\%-2rem\)\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){max-width:calc(100% - 2rem)}.max-w-\[min\(22rem\,calc\(100\%-2rem\)\)\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){max-width:min(22rem,100% - 2rem)}.max-w-sm:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){max-width:var(--container-sm)}.min-w-\[64px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){min-width:64px}.shrink-0:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){flex-shrink:0}.-translate-x-1\/2:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\/2:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.transform:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){transform:var(--tw-rotate-x, ) var(--tw-rotate-y, ) var(--tw-rotate-z, ) var(--tw-skew-x, ) var(--tw-skew-y, )}.touch-none:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){touch-action:none}.resize:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){resize:both}.grid-cols-3:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){grid-template-columns:repeat(3,minmax(0,1fr))}.grid-rows-3:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){grid-template-rows:repeat(3,minmax(0,1fr))}.flex-col:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){flex-direction:column}.items-center:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){align-items:center}.items-end:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){align-items:flex-end}.justify-center:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){justify-content:center}.gap-0\.5:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){gap:calc(var(--spacing) * .5)}.gap-1:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){gap:var(--spacing)}.gap-1\.5:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){gap:calc(var(--spacing) * 1.5)}.gap-2:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){gap:calc(var(--spacing) * 2)}.gap-3:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){gap:calc(var(--spacing) * 3)}:where(.space-y-1>:not(:last-child)):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}.truncate:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){overflow:hidden}.rounded:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-radius:.25rem}.rounded-2xl:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-radius:var(--radius-2xl)}.rounded-full:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-radius:2147483647px}.rounded-xl:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-radius:var(--radius-xl)}.border:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-style:var(--tw-border-style);border-width:1px}.border-\[1\.5px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-style:var(--tw-border-style);border-width:1.5px}.border-t:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-top-style:var(--tw-border-style);border-top-width:1px}.border-white:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:var(--color-white)}.border-white\/10:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.border-white\/10:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}.border-white\/20:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:#fff3}@supports (color:color-mix(in lab, red, red)){.border-white\/20:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:color-mix(in oklab, var(--color-white) 20%, transparent)}}.border-white\/25:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:#ffffff40}@supports (color:color-mix(in lab, red, red)){.border-white\/25:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:color-mix(in oklab, var(--color-white) 25%, transparent)}}.border-white\/40:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:#fff6}@supports (color:color-mix(in lab, red, red)){.border-white\/40:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:color-mix(in oklab, var(--color-white) 40%, transparent)}}.border-white\/45:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:#ffffff73}@supports (color:color-mix(in lab, red, red)){.border-white\/45:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:color-mix(in oklab, var(--color-white) 45%, transparent)}}.border-white\/70:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:#ffffffb3}@supports (color:color-mix(in lab, red, red)){.border-white\/70:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:color-mix(in oklab, var(--color-white) 70%, transparent)}}.border-white\/80:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:#fffc}@supports (color:color-mix(in lab, red, red)){.border-white\/80:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:color-mix(in oklab, var(--color-white) 80%, transparent)}}.bg-black:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:var(--color-black)}.bg-black\/40:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#0006}@supports (color:color-mix(in lab, red, red)){.bg-black\/40:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-black) 40%, transparent)}}.bg-black\/45:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#00000073}@supports (color:color-mix(in lab, red, red)){.bg-black\/45:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-black) 45%, transparent)}}.bg-black\/50:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#00000080}@supports (color:color-mix(in lab, red, red)){.bg-black\/50:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-black) 50%, transparent)}}.bg-black\/60:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#0009}@supports (color:color-mix(in lab, red, red)){.bg-black\/60:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-black) 60%, transparent)}}.bg-black\/70:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#000000b3}@supports (color:color-mix(in lab, red, red)){.bg-black\/70:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-black) 70%, transparent)}}.bg-black\/80:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#000c}@supports (color:color-mix(in lab, red, red)){.bg-black\/80:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-black) 80%, transparent)}}.bg-neutral-900:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:var(--color-neutral-900)}.bg-transparent:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#0000}.bg-white:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:var(--color-white)}.bg-white\/10:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.bg-white\/10:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}.bg-white\/15:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#ffffff26}@supports (color:color-mix(in lab, red, red)){.bg-white\/15:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-white) 15%, transparent)}}.bg-white\/25:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#ffffff40}@supports (color:color-mix(in lab, red, red)){.bg-white\/25:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-white) 25%, transparent)}}.bg-white\/30:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#ffffff4d}@supports (color:color-mix(in lab, red, red)){.bg-white\/30:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-white) 30%, transparent)}}.bg-white\/50:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#ffffff80}@supports (color:color-mix(in lab, red, red)){.bg-white\/50:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-white) 50%, transparent)}}.bg-white\/90:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#ffffffe6}@supports (color:color-mix(in lab, red, red)){.bg-white\/90:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-white) 90%, transparent)}}.bg-white\/\[0\.03\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#ffffff08}@supports (color:color-mix(in lab, red, red)){.bg-white\/\[0\.03\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-white) 3%, transparent)}}.bg-white\/\[0\.05\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#ffffff0d}@supports (color:color-mix(in lab, red, red)){.bg-white\/\[0\.05\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-white) 5%, transparent)}}.bg-white\/\[0\.12\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#ffffff1f}@supports (color:color-mix(in lab, red, red)){.bg-white\/\[0\.12\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-white) 12%, transparent)}}.object-contain:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){object-fit:contain}.object-cover:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){object-fit:cover}.object-fill:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){object-fit:fill}.p-0:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding:0}.p-0\.5:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding:calc(var(--spacing) * .5)}.p-6:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding:calc(var(--spacing) * 6)}.px-2:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-inline:calc(var(--spacing) * 2)}.px-2\.5:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-inline:calc(var(--spacing) * 2.5)}.px-3:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-inline:calc(var(--spacing) * 3)}.px-4:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-inline:calc(var(--spacing) * 4)}.px-6:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-inline:calc(var(--spacing) * 6)}.px-\[4px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-inline-start:4px;padding-inline-end:4px}.px-\[10px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-inline-start:10px;padding-inline-end:10px}.py-1:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-block:var(--spacing)}.py-1\.5:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-block:calc(var(--spacing) * 1.5)}.py-2:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-block:calc(var(--spacing) * 2)}.py-2\.5:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-block:calc(var(--spacing) * 2.5)}.pt-\[max\(6px\,env\(safe-area-inset-top\)\)\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-top:max(6px, env(safe-area-inset-top))}.text-center:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){text-align:center}.text-lg:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){font-size:10px}.text-\[11px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){font-size:11px}.text-\[13px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){font-size:13px}.leading-5:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.font-bold:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wide:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.text-black:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:var(--color-black)}.text-white:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:var(--color-white)}.text-white\/50:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:#ffffff80}@supports (color:color-mix(in lab, red, red)){.text-white\/50:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:color-mix(in oklab, var(--color-white) 50%, transparent)}}.text-white\/60:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:#fff9}@supports (color:color-mix(in lab, red, red)){.text-white\/60:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:color-mix(in oklab, var(--color-white) 60%, transparent)}}.text-white\/80:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:#fffc}@supports (color:color-mix(in lab, red, red)){.text-white\/80:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:color-mix(in oklab, var(--color-white) 80%, transparent)}}.text-white\/85:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:#ffffffd9}@supports (color:color-mix(in lab, red, red)){.text-white\/85:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:color-mix(in oklab, var(--color-white) 85%, transparent)}}.lowercase:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){text-transform:lowercase}.uppercase:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){text-transform:uppercase}.opacity-0:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){opacity:0}.opacity-40:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){opacity:.4}.opacity-100:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){opacity:1}.shadow:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\[0_0_3px_rgba\(0\,0\,0\,0\.3\)\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-shadow:0 0 3px var(--tw-shadow-color,#0000004d);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\[0_0_3px_rgba\(0\,0\,0\,0\.35\)\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-shadow:0 0 3px var(--tw-shadow-color,#00000059);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-ring-shadow:var(--tw-ring-inset, ) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.blur:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-blur:blur(8px);filter:var(--tw-blur, ) var(--tw-brightness, ) var(--tw-contrast, ) var(--tw-grayscale, ) var(--tw-hue-rotate, ) var(--tw-invert, ) var(--tw-saturate, ) var(--tw-sepia, ) var(--tw-drop-shadow, )}.filter:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){filter:var(--tw-blur, ) var(--tw-brightness, ) var(--tw-contrast, ) var(--tw-grayscale, ) var(--tw-hue-rotate, ) var(--tw-invert, ) var(--tw-saturate, ) var(--tw-sepia, ) var(--tw-drop-shadow, )}.backdrop-blur-sm:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, );backdrop-filter:var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, )}.transition-colors:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-75:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-duration:75ms;transition-duration:75ms}.duration-200:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-duration:.2s;transition-duration:.2s}.select-none:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){-webkit-user-select:none;user-select:none}.\[-webkit-touch-callout\:none\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){-webkit-touch-callout:none}.\[text-shadow\:0_1px_2px_rgba\(0\,0\,0\,0\.6\)\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){text-shadow:0 1px 2px #0009}@media (hover:hover){.hover\:bg-white\/10:hover:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.hover\:bg-white\/10:hover:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}}.disabled\:opacity-40:disabled:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){opacity:.4}:root:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--color-surface:#ffffff0a;--color-surface-2:#ffffff0f;--color-surface-3:#ffffff1a;--color-surface-raised:#ffffff12;--color-float:#2c2c2ef5;--color-canvas:#ffffff09;--glass-edge:#ffffff1a;--color-pill:#ffffff1f;--color-border:#ffffff1a;--color-border-strong:#fff3;--color-muted:#a1a1a8;--color-text:#f5f5f7;--color-accent:#4da3ff;--color-accent-contrast:#fff;--color-accent-soft:#0a84ff2e;--color-accent-bright:#3b9bff;--color-accent-pink:#3b9bff;--accent-fill:linear-gradient(#0a72e8, #0a72e8);--accent-glow:0 1px 2px #0000004d;--color-good:#32d074;--color-good-soft:#32d07424;--color-warn:#ffb340;--color-warn-soft:#ffb34024;--color-bad:#ff6961;--color-bad-soft:#ff696124;--color-ps4:#8fb0ff;--color-ps4-soft:#8fb0ff26;--color-ps5:#c3a2ff;--color-ps5-soft:#c3a2ff26;--shadow-logo:0 12px 40px -10px #00000080;--shadow-1:0 1px 2px #0000002e;--shadow-2:0 10px 30px -10px #0000008c, 0 0 0 .5px #0006;--shadow-3:0 24px 70px -20px #000000b3, 0 0 0 .5px #0006;--edge-highlight:inset 0 1px 0 #ffffff0d;--overlay-scrim:#00000073;--atmosphere-base:#1e1e20;--atmosphere:none;--dot-color:transparent;--glass-blur:24px;--color-accent-glow:#0a84ff40;--radius-control:999px;--radius-field:.5rem;--radius-card:.875rem;--radius-panel:1rem;--radius-canvas:0px;--content-max:none}:root:is([data-theme=light],[data-theme=peach]):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light;--color-surface:#00000008;--color-surface-2:#fff;--color-surface-3:#00000012;--color-surface-raised:#fff;--color-float:#fffffff7;--color-canvas:#00000006;--glass-edge:#00000014;--color-pill:#00000014;--color-border:#0000001a;--color-border-strong:#0003;--color-muted:#5f5f66;--color-text:#1d1d1f;--color-accent:#0064d2;--color-accent-contrast:#fff;--color-accent-soft:#0071e31f;--color-accent-bright:#0071e3;--color-accent-pink:#0071e3;--accent-fill:linear-gradient(#0071e3, #0071e3);--accent-glow:0 1px 2px #0000001f;--color-good:#1a7f43;--color-good-soft:#1a7f431f;--color-warn:#8a5200;--color-warn-soft:#d68c1e29;--color-bad:#c4252f;--color-bad-soft:#d700151a;--color-ps4:#2a55b8;--color-ps4-soft:#2a55b81f;--color-ps5:#6b3fc4;--color-ps5-soft:#6b3fc41f;--shadow-logo:0 12px 40px -10px #0003;--shadow-1:0 1px 2px #0000000d;--shadow-2:0 10px 30px -10px #00000038, 0 0 0 .5px #0000001f;--shadow-3:0 24px 70px -20px #0000004d, 0 0 0 .5px #0000001f;--edge-highlight:inset 0 0 0 0 transparent;--overlay-scrim:#0003;--atmosphere-base:#f5f5f7;--atmosphere:none;--dot-color:transparent;--color-accent-glow:#0071e338}:root[data-theme=peach]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--color-surface:#783c140a;--color-surface-3:#783c1414;--color-float:#fffcf9f7;--color-canvas:#783c1408;--glass-edge:#5a2d0f1a;--color-pill:#c2410c1a;--color-border:#5a2d0f1f;--color-border-strong:#5a2d0f3d;--color-muted:#6e5244;--color-text:#2b1d16;--color-accent:#b93d0a;--color-accent-soft:#ea580c1f;--color-accent-bright:#c2410c;--color-accent-pink:#c2410c;--accent-fill:linear-gradient(#c2410c, #c2410c);--color-accent-glow:#ea580c38;--shadow-logo:0 12px 40px -10px #5a2d0f38;--shadow-1:0 1px 2px #5a2d0f0f;--shadow-2:0 10px 30px -10px #5a2d0f38, 0 0 0 .5px #5a2d0f1f;--shadow-3:0 24px 70px -20px #5a2d0f4d, 0 0 0 .5px #5a2d0f1f;--overlay-scrim:#3c1e0a38;--atmosphere-base:#fbf4ee}:root[data-theme=oled]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--color-surface:#ffffff0d;--color-surface-2:#ffffff12;--color-surface-raised:#ffffff14;--color-float:#141416fa;--color-canvas:transparent;--shadow-logo:none;--shadow-1:none;--shadow-2:0 0 0 .5px #ffffff24;--shadow-3:0 0 0 .5px #ffffff29;--edge-highlight:inset 0 0 0 0 transparent;--overlay-scrim:#000000b3;--atmosphere-base:#000;--glass-blur:0px}:root[data-contrast=high]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--color-surface:#1c1c1e;--color-surface-2:#232325;--color-surface-3:#3a3a3c;--color-surface-raised:#2c2c2e;--color-float:#2c2c2e;--color-canvas:#161618;--glass-edge:#fff6;--glass-blur:0px}:root:is([data-theme=light],[data-theme=peach])[data-contrast=high]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--color-surface:#fff;--color-surface-2:#fff;--color-surface-3:#e5e5ea;--color-surface-raised:#fff;--color-float:#fff;--color-canvas:#f5f5f7;--glass-edge:#00000073;--color-border:#00000059;--color-border-strong:#0009}:root[data-theme=oled][data-contrast=high]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--color-surface:#000;--color-surface-2:#121214;--color-surface-raised:#1a1a1c;--color-float:#1a1a1c;--color-canvas:#000}@media (prefers-reduced-transparency:reduce){:root:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--glass-blur:0px;--color-surface-2:#2c2c2ef5;--color-surface-raised:#323234f5;--color-canvas:#1e1e20f5}:root:is([data-theme=light],[data-theme=peach]):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--color-surface-2:#ffffffe6;--color-surface-raised:#ffffffeb;--color-canvas:#ffffffbf}:root[data-theme=oled]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--color-surface-2:#121214fa;--color-surface-raised:#1a1a1cfa;--color-canvas:transparent}}:root[data-transparency=reduced]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--glass-blur:0px;--color-surface-2:#2c2c2ef5;--color-surface-raised:#323234f5;--color-canvas:#1e1e20f5}:root[data-transparency=reduced]:is([data-theme=light],[data-theme=peach]):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--color-surface-2:#ffffffe6;--color-surface-raised:#ffffffeb;--color-canvas:#ffffffbf}:root[data-transparency=reduced][data-theme=oled]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--color-surface-2:#121214fa;--color-surface-raised:#1a1a1cfa;--color-canvas:transparent}:root[data-motion=reduced]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),:root[data-motion=none]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--glass-blur:0px}html:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),body:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),#root:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:100dvh;color:var(--color-text);font-family:var(--font-sans);font-size:var(--ui-base-size,18px);text-size-adjust:100%;-webkit-font-smoothing:antialiased;font-variant-numeric:tabular-nums;margin:0;overflow:hidden}body:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){position:relative}html:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:var(--atmosphere-base);background-image:var(--atmosphere);background-repeat:no-repeat;background-size:100% 100%;background-attachment:fixed}body:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),#root:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:0 0}body:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){overscroll-behavior-y:contain}.app-page:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:100%;max-width:var(--content-max);margin-inline-start:auto;margin-inline-end:auto;padding:1.75rem clamp(2rem,2.5vw,3rem) 2.5rem}.card-flow:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){grid-template-columns:repeat(auto-fill,minmax(min(100%,44rem),1fr));align-items:start;gap:.75rem;display:grid}.app-page-tabs:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:100%;max-width:var(--content-max);margin-inline-start:auto;margin-inline-end:auto;padding:1.25rem clamp(2rem,2.5vw,3rem) 0}.glass:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-surface-2);border:1px solid var(--glass-edge);box-shadow:var(--edge-highlight), var(--shadow-1);-webkit-backdrop-filter:blur(var(--glass-blur)) saturate(1.4);backdrop-filter:blur(var(--glass-blur)) saturate(1.4)}.glass-float:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-float);border:1px solid var(--glass-edge);box-shadow:var(--edge-highlight), var(--shadow-2);-webkit-backdrop-filter:blur(var(--glass-blur)) saturate(1.4);backdrop-filter:blur(var(--glass-blur)) saturate(1.4)}.float-solid:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:linear-gradient(var(--color-float), var(--color-float)), var(--atmosphere-base);border:1px solid var(--glass-edge)}.surface-panel:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border:1px solid var(--glass-edge);border-radius:var(--radius-panel);background:var(--color-surface-raised);box-shadow:var(--edge-highlight), var(--shadow-1)}.dot-texture:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-image:radial-gradient(var(--dot-color) 1.2px, transparent 1.6px);background-size:12px 12px;-webkit-mask-image:radial-gradient(closest-side,#000 30%,#0000 100%);mask-image:radial-gradient(closest-side,#000 30%,#0000 100%)}.fade-x:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){-webkit-mask-image:linear-gradient(to right, transparent, #000 var(--fade-start,0px), #000 calc(100% - var(--fade-end,0px)), transparent);-webkit-mask-image:linear-gradient(to right, transparent, #000 var(--fade-start,0px), #000 calc(100% - var(--fade-end,0px)), transparent);-webkit-mask-image:linear-gradient(to right, transparent, #000 var(--fade-start,0px), #000 calc(100% - var(--fade-end,0px)), transparent);-webkit-mask-image:linear-gradient(to right, transparent, #000 var(--fade-start,0px), #000 calc(100% - var(--fade-end,0px)), transparent);mask-image:linear-gradient(to right, transparent, #000 var(--fade-start,0px), #000 calc(100% - var(--fade-end,0px)), transparent)}[dir=rtl]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .fade-x{-webkit-mask-image:linear-gradient(to left, transparent, #000 var(--fade-start,0px), #000 calc(100% - var(--fade-end,0px)), transparent);-webkit-mask-image:linear-gradient(to left, transparent, #000 var(--fade-start,0px), #000 calc(100% - var(--fade-end,0px)), transparent);-webkit-mask-image:linear-gradient(to left, transparent, #000 var(--fade-start,0px), #000 calc(100% - var(--fade-end,0px)), transparent);-webkit-mask-image:linear-gradient(to left, transparent, #000 var(--fade-start,0px), #000 calc(100% - var(--fade-end,0px)), transparent);mask-image:linear-gradient(to left, transparent, #000 var(--fade-start,0px), #000 calc(100% - var(--fade-end,0px)), transparent)}.icon-orb-button:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border:1px solid var(--glass-edge);background:var(--color-surface-raised);width:2.75rem;height:2.75rem;color:var(--color-text);box-shadow:var(--edge-highlight), var(--shadow-1);border-radius:9999px;flex:none;place-items:center;transition:transform .14s,background-color .14s,box-shadow .14s;display:inline-grid}.icon-orb-button:hover:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-float);transform:translateY(-1px)}.action-tile:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-radius:var(--radius-card);border:1px solid var(--glass-edge);background:var(--color-surface-raised);min-height:5.5rem;box-shadow:var(--edge-highlight), var(--shadow-1);padding:1rem 1.125rem;transition:transform .16s,background-color .16s,box-shadow .16s;display:block;container-type:inline-size}.action-tile:not([aria-disabled=true]):hover:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-float);box-shadow:var(--edge-highlight), var(--shadow-2);transform:translateY(-2px)}.action-tile[aria-disabled=true]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){cursor:not-allowed;opacity:.6}.action-tile-inner:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){align-items:center;gap:.875rem;min-height:3.5rem;display:flex}@container (width<=15rem){.action-tile-inner:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){flex-direction:column;align-items:flex-start;gap:.625rem;min-height:0}.action-tile-inner:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .action-tile-chevron{display:none}}@media (max-width:639px){.action-tile:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){min-height:0;padding:.875rem}}.metric-row:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-bottom:1px solid var(--color-border);justify-content:space-between;align-items:center;gap:1rem;min-height:2.25rem;font-size:.8125rem;display:flex}.metric-row:last-child:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-bottom:0}.icon-disc:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-accent-soft);width:2rem;height:2rem;color:var(--color-accent-bright);border-radius:9999px;flex:none;place-items:center;display:inline-grid}.chip:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border:1px solid var(--color-border-strong);color:var(--color-text);white-space:nowrap;border-radius:9999px;align-items:center;transition:background-color .14s,border-color .14s,box-shadow .14s;display:inline-flex}.chip:hover:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-surface)}.chip[aria-pressed=true]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.chip[aria-checked=true]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.chip[aria-selected=true]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.chip.is-active:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-pill);border-color:#0000;font-weight:600}@media (min-width:768px){.shell-sidebar:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-canvas);border-inline-end:1px solid var(--color-border)}}.shell-safe-x:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-left:var(--safe-left);padding-right:var(--safe-right)}@media (min-width:768px){.shell-sidebar:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-top:var(--safe-top)}}@media (min-width:768px) and (pointer:coarse) and (orientation:landscape) and (max-height:520px){.shell-statusbar{display:none!important}.shell-safe-x:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-bottom:var(--safe-bottom)}.shell-sidebar:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)>:first-child{height:3.5rem}}.nav-pill:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:var(--color-text)}.nav-pill:hover:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-surface)}.nav-pill.active:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.nav-pill[aria-current=page]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-pill);font-weight:600}.nav-pill:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .nav-pill-icon{color:var(--color-muted)}.nav-pill.active:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .nav-pill-icon,.nav-pill[aria-current=page]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .nav-pill-icon{color:var(--color-accent-bright)}:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){box-sizing:border-box}:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::selection{background:var(--color-accent);color:var(--color-accent-contrast)}:where(a,button,[role=button],[role=menuitem],[role=tab],[tabindex]):focus-visible:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){outline:2px solid var(--color-accent);outline-offset:2px}:where(input,select,textarea):focus-visible:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){outline:2px solid var(--color-accent);outline-offset:1px}:root[data-tv="1"]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) :where(a,button,input,select,textarea,summary,[role=button],[role=menuitem],[role=tab],[tabindex]):focus{outline:3px solid var(--color-accent);outline-offset:3px}:root[data-tv="1"]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) [data-join-ui] :where(a,button,input,select,textarea,summary,[role=button],[tabindex]):focus{outline-offset:3px;outline:3px solid #fff}[data-join-ui]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) :where(a,button,input,select,textarea,summary,[role=button],[tabindex]):focus-visible{outline-offset:3px;outline:3px solid #fff}:root[data-tv="1"]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) [data-join-ui] :where(a,button,input,select,textarea,summary,[role=button],[tabindex]):focus{outline-width:4px}:is([data-join-game]:focus,[data-join-game]:focus-visible){outline:none!important}:is(.input:focus-visible:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.select:focus-visible:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.field-quiet:focus-visible:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)){outline:none}.field-shell:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){transition:box-shadow .14s,background-color .14s}.field-shell:has(.field-quiet:focus-visible):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){box-shadow:inset 0 -2px 0 var(--color-accent)}.field-shell.rounded-full:has(.field-quiet:focus-visible):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){box-shadow:0 0 0 2px var(--color-accent), 0 0 0 5px var(--color-accent-soft)}.field-shell-ring:has(.field-quiet:focus-visible):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){box-shadow:0 0 0 2px var(--color-accent), 0 0 0 5px var(--color-accent-soft)}.scrim:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--overlay-scrim);-webkit-backdrop-filter:blur(calc(var(--glass-blur) / 4));backdrop-filter:blur(calc(var(--glass-blur) / 4))}.glass-bar:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-float);-webkit-backdrop-filter:blur(var(--glass-blur)) saturate(1.4);backdrop-filter:blur(var(--glass-blur)) saturate(1.4)}:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){scrollbar-width:thin;scrollbar-color:var(--color-border-strong) transparent}:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-scrollbar{width:10px;height:10px}:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-scrollbar-track{background:0 0}:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-scrollbar-thumb{background:var(--color-border-strong);background-clip:padding-box;border:2px solid #0000;border-radius:8px}:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-scrollbar-thumb:hover{background:var(--color-muted);background-clip:padding-box}@keyframes ps-fade-in{0%{opacity:0}to{opacity:1}}@keyframes ps-pop-in{0%{opacity:0;transform:translateY(8px)scale(.98)}to{opacity:1;transform:translateY(0)scale(1)}}@keyframes ps-rise-in{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}@keyframes ps-drawer-in{0%{transform:translate(-100%)}to{transform:translate(0)}}@keyframes ps-sheet-in{0%{opacity:0;transform:translateY(24px)}to{opacity:1;transform:translateY(0)}}@keyframes ps-side-in{0%{opacity:0;transform:translate(24px)}to{opacity:1;transform:translate(0)}}@keyframes ps-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@keyframes ps-soft-pulse{0%,to{opacity:1}50%{opacity:.45}}.anim-scrim:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){animation:.15s ease-out both ps-fade-in}.anim-pop:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){animation:.18s cubic-bezier(.2,.8,.2,1) both ps-pop-in}.anim-rise:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){animation:.14s cubic-bezier(.2,.8,.2,1) both ps-rise-in}.anim-screen:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){animation:.2s cubic-bezier(.2,.8,.2,1) backwards ps-rise-in}.anim-drawer:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){animation:.22s cubic-bezier(.2,.8,.2,1) both ps-drawer-in}.anim-sheet:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){animation:.22s cubic-bezier(.2,.8,.2,1) both ps-sheet-in}.anim-side:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){animation:.2s cubic-bezier(.2,.8,.2,1) both ps-side-in}.anim-sheet-up:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){animation:.22s cubic-bezier(.2,.8,.2,1) both ps-sheet-in}.anim-skeleton:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:linear-gradient(100deg, var(--color-surface-3) 40%, var(--color-surface-raised) 50%, var(--color-surface-3) 60%);background-size:200% 100%;animation:2.2s linear infinite ps-shimmer}.anim-status-pulse:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){animation:2.4s ease-in-out infinite ps-soft-pulse}.elev-1:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){box-shadow:var(--edge-highlight), var(--shadow-1)}@media (max-width:767px){.app-page:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding:1rem}.app-page-tabs:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding:1rem 1rem 0}}.elev-2:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){box-shadow:var(--edge-highlight), var(--shadow-2)}.elev-3:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){box-shadow:var(--edge-highlight), var(--shadow-3)}.support-button:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:#fff;background-image:linear-gradient(135deg,#ff3d6e 0%,#ff6a4d 55%,#ff9a3c 100%);transition:transform .16s cubic-bezier(.2,.8,.2,1),box-shadow .16s,filter .16s;box-shadow:0 6px 18px -6px #ff3d6ea6,inset 0 1px #ffffff40}.support-button:hover:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){filter:brightness(1.06);transform:translateY(-1px);box-shadow:0 10px 24px -8px #ff3d6ebf,inset 0 1px #ffffff40}.support-button:active:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){transform:translateY(0)}.support-button:focus-visible:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){outline-offset:2px;outline:2px solid #ff3d6e}.support-heart:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){transform-origin:50%;animation:2.8s ease-in-out infinite support-beat}@keyframes support-beat{0%,70%,to{transform:scale(1)}76%{transform:scale(1.22)}82%{transform:scale(1)}88%{transform:scale(1.14)}}:root[data-motion=none]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .support-heart{animation:none}.fs-reveal:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){outline:2px solid var(--color-accent);outline-offset:-1px;box-shadow:inset 0 0 0 999px var(--color-accent)}@supports (color:color-mix(in lab, red, red)){.fs-reveal:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){box-shadow:inset 0 0 0 999px color-mix(in srgb, var(--color-accent) 16%, transparent)}}@keyframes fs-reveal{0%,45%{outline-color:var(--color-accent);box-shadow:inset 0 0 0 999px color-mix(in srgb, var(--color-accent) 16%, transparent)}to{outline-color:#0000;box-shadow:inset 0 0 0 999px #0000}}@media (prefers-reduced-motion:no-preference){:root:not([data-motion=none]):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .fs-reveal{animation:2s ease-out forwards fs-reveal}}@media (prefers-reduced-motion:reduce){.anim-scrim:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.anim-pop:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.support-heart:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.anim-rise:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.anim-screen:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.anim-drawer:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.anim-sheet:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.anim-sheet-up:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.anim-side:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.anim-skeleton:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.anim-status-pulse:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){animation:none}*,:before,:after{transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}:root[data-motion=reduced]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .anim-pop{animation-duration:90ms}:root[data-motion=reduced]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .anim-screen,:root[data-motion=none]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .anim-scrim,:root[data-motion=none]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .anim-pop,:root[data-motion=none]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .anim-rise,:root[data-motion=none]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .anim-screen,:root[data-motion=none]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .anim-drawer,:root[data-motion=none]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .anim-sheet,:root[data-motion=none]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .anim-sheet-up,:root[data-motion=none]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .anim-side,:root[data-motion=none]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .anim-skeleton,:root[data-motion=none]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .anim-status-pulse{animation:none}:root[data-motion=none] *,:root[data-motion=none] :before,:root[data-motion=none] :after{transition-duration:.01ms!important}:root[data-contrast=high]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--color-border:var(--color-border-strong);--color-muted:var(--color-text)}:root[data-contrast=high]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) :where(a,button,[role=button],[role=menuitem],[role=tab],[tabindex]):focus-visible{outline-offset:4px;outline-width:3px}:root:is(:lang(ar),:lang(fa)):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--font-sans:system-ui, "SF Arabic", "Noto Sans Arabic", "Geeza Pro", "Segoe UI", Tahoma, sans-serif}:root:is(:lang(ar),:lang(fa)):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) :not(.font-mono,code,kbd,pre,input,textarea){letter-spacing:normal}:root:is(:lang(ar),:lang(fa)):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .uppercase{text-transform:none;font-size:.8125rem}:root[data-dyslexia=true]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) body,:root[data-dyslexia=true]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) #root{letter-spacing:.01em;font-family:Atkinson Hyperlegible,OpenDyslexic,system-ui,-apple-system,sans-serif;line-height:1.5}.sr-only:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.skip-link:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){z-index:100;background:var(--color-accent);color:var(--color-accent-contrast);border-radius:0 0 .375rem;padding:.5rem 1rem;font-size:.875rem;font-weight:500;transition:top .15s;position:absolute;top:-100%;left:0}.skip-link:focus:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){outline:2px solid var(--color-accent);outline-offset:2px;top:0}.safe-top:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-top:var(--safe-top)}:root:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--safe-bottom:max(env(safe-area-inset-bottom), var(--nav-inset-bottom,0px));--safe-top:max(env(safe-area-inset-top), var(--sys-inset-top,0px));--safe-left:max(env(safe-area-inset-left), var(--sys-inset-left,0px));--safe-right:max(env(safe-area-inset-right), var(--sys-inset-right,0px))}.safe-bottom:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-bottom:var(--safe-bottom)}html[data-keyboard] [data-bottom-nav],html[data-keyboard] [data-testid=activity-pill]{display:none!important}@media not all and (min-width:40rem),(pointer:coarse) and (max-height:520px){html[data-selection-bar] [data-bottom-nav]{display:none!important}[data-top-bar]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .icon-orb-button{width:44px;height:44px}}@media (max-width:767.98px){html[data-screen-bar]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) [data-top-bar]{min-height:0;padding-top:var(--safe-top);padding-bottom:0}html[data-screen-bar]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) [data-top-bar]>*{display:none}}.tab-rail-probe:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){visibility:hidden;pointer-events:none;padding-left:var(--safe-left);padding-right:var(--safe-right);position:fixed}@media (max-width:767px){[data-bottom-nav][data-rail]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){top:max(calc(var(--safe-top) + 9.75rem), calc(100dvh - var(--safe-bottom) - .6rem - 24rem));border-radius:2rem;flex-direction:column;gap:0;height:auto}[data-bottom-nav][data-rail=right]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:calc(var(--safe-right) - .75rem);left:auto;right:.375rem}[data-bottom-nav][data-rail=left]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:calc(var(--safe-left) - .75rem);left:.375rem;right:auto}html[data-tab-rail]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) [data-testid=activity-pill]{bottom:calc(var(--safe-bottom) + .6rem)}html[data-tab-rail]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .tab-room{padding-bottom:calc(1rem + var(--safe-bottom))}}.safe-left:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-left:var(--safe-left)}.safe-right:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-right:var(--safe-right)}.safe-pad:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-top:var(--safe-top);padding-bottom:var(--safe-bottom);padding-left:var(--safe-left);padding-right:var(--safe-right)}.h-bottom-nav:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:calc(56px + var(--safe-bottom))}.h-top-bar:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){min-height:calc(44px + var(--safe-top));padding-left:calc(var(--safe-left) + 1rem);padding-right:calc(var(--safe-right) + 1rem)}@media (max-width:767.98px){.panel-sheet-x:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){left:max(.5rem, var(--safe-left));right:max(.5rem, var(--safe-right))}}.modal-safe-x:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-left:max(1rem, var(--safe-left));padding-right:max(1rem, var(--safe-right))}@media (max-width:639.98px){.modal-safe-x:has(>.anim-sheet-up):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-left:var(--safe-left);padding-right:var(--safe-right)}}@media (pointer:coarse){button:not([role=switch]):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),[role=button]:not([role=switch]):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),[role=tab]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),[role=menuitem]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),[role=menuitemcheckbox]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),[role=menuitemradio]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),[role=option]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),[role=treeitem]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),select:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),textarea:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),input:not([type=checkbox]):not([type=radio]):not([type=range]):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){min-height:44px}}input[type=checkbox]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),input[type=radio]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:1.15rem;height:1.15rem;accent-color:var(--color-accent);cursor:pointer}@media (pointer:coarse){input[type=checkbox]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),input[type=radio]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:1.4rem;height:1.4rem}}.input:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-radius:var(--radius-control);border:1px solid var(--glass-edge);background:var(--color-surface-raised);width:100%;color:var(--color-text);transition:border-color .15s,box-shadow .15s;box-shadow:inset 0 1px 2px #0000000f}:root:is([data-theme=light],[data-theme=peach]):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .input,:root:is([data-theme=light],[data-theme=peach]):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .select{border-color:#00000024}textarea.input:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-radius:var(--radius-field)}.input:focus:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.select:focus:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:var(--color-accent);box-shadow:0 0 0 3px var(--color-accent-soft)}.input:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::placeholder{color:var(--color-muted)}:root[dir=rtl]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) :where(.font-mono,code,kbd,samp,pre,.tabular-nums){unicode-bidi:plaintext}:where(input,textarea):placeholder-shown:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){text-overflow:ellipsis}@media (max-width:767px){.input:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.input-sm:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.select:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){min-height:2.75rem}}.select:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-radius:var(--radius-control);border:1px solid var(--glass-edge);background:var(--color-surface-raised);width:100%;color:var(--color-text);transition:border-color .15s,box-shadow .15s}select:not([multiple]):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){-webkit-appearance:none;appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-position:right .75rem center;background-repeat:no-repeat;padding-inline-end:2rem}[dir=rtl]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) select:not([multiple]){background-position:.75rem}.select:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) option,select:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) option{background:var(--color-float);color:var(--color-text)}.radio:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.checkbox:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){accent-color:var(--color-accent);cursor:pointer}.badge:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-radius:9999px;align-items:center;gap:.25rem;padding:.15rem .6rem;font-size:.75rem;font-weight:500;line-height:1;display:inline-flex}.badge-sm:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding:.0625rem .375rem;font-size:.6875rem}.badge-success:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-good-soft);color:var(--color-good)}.badge-warn:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-warn-soft);color:var(--color-warn)}.badge-bad:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-bad-soft);color:var(--color-bad)}.list-row-contain-sm:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){content-visibility:auto;contain-intrinsic-size:auto 2.25rem}.rp-place:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){container-type:size}.rp-mini:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--mini-top:calc(var(--safe-top) + 4.25rem);--mini-bottom:calc(var(--safe-bottom) + 5.5rem);--mini-left:calc(var(--safe-left) + .75rem);--mini-right:calc(var(--safe-right) + .75rem);width:min(max(140px,40vw),100vw - 1.5rem)}@media (min-width:768px){.rp-mini:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--mini-top:5rem;--mini-bottom:3rem;--mini-left:1rem;--mini-right:1rem;width:min(320px,100vw - 2rem)}}.rp-mini[data-corner=tl]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){top:var(--mini-top);left:var(--mini-left)}.rp-mini[data-corner=tr]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){top:var(--mini-top);right:var(--mini-right)}.rp-mini[data-corner=bl]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){bottom:var(--mini-bottom);left:var(--mini-left)}.rp-mini[data-corner=br]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){bottom:var(--mini-bottom);right:var(--mini-right)}.rp-picture:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){flex:none;width:100%;max-width:none;height:100%;max-height:none;display:block}@supports (width:1cqw){.rp-picture:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){object-fit:fill}.rp-picture[data-fit=fit]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:min(100cqw, 100cqh * var(--rp-shape));height:min(100cqh, 100cqw / var(--rp-shape))}.rp-picture[data-fit=fill]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:max(100cqw, 100cqh * var(--rp-shape));height:max(100cqh, 100cqw / var(--rp-shape))}.rp-picture[data-fit=stretch]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:100cqw;height:100cqh}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false} +@supports (((-webkit-hyphens:none)) and (not (margin-trim:block))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}}:root:not(#\#):not(#\#),:host:not(#\#):not(#\#){--font-sans:system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Helvetica, Arial, sans-serif;--font-mono:ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;--color-neutral-900:color(display-p3 .0905274 .0905274 .0905274);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-sm:24rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-wide:.025em;--tracking-wider:.05em;--radius-xl:.75rem;--radius-2xl:1rem;--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}@supports (color:lab(0% 0 0)){:root:not(#\#):not(#\#),:host:not(#\#):not(#\#){--color-neutral-900:lab(7.78201% -.0000149012 0)}}:not(#\#):not(#\#):not(#\#):not(#\#),:not(#\#):not(#\#):not(#\#):not(#\#):after,:not(#\#):not(#\#):not(#\#):not(#\#):before{box-sizing:border-box;border:0 solid;margin:0;padding:0}:not(#\#):not(#\#):not(#\#):not(#\#)::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-file-upload-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}:not(#\#):not(#\#):not(#\#):not(#\#)::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html:not(#\#):not(#\#):not(#\#):not(#\#),:host:not(#\#):not(#\#):not(#\#):not(#\#){-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr:not(#\#):not(#\#):not(#\#):not(#\#){height:0;color:inherit;border-top-width:1px}abbr:where([title]):not(#\#):not(#\#):not(#\#):not(#\#){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1:not(#\#):not(#\#):not(#\#):not(#\#),h2:not(#\#):not(#\#):not(#\#):not(#\#),h3:not(#\#):not(#\#):not(#\#):not(#\#),h4:not(#\#):not(#\#):not(#\#):not(#\#),h5:not(#\#):not(#\#):not(#\#):not(#\#),h6:not(#\#):not(#\#):not(#\#):not(#\#){font-size:inherit;font-weight:inherit}a:not(#\#):not(#\#):not(#\#):not(#\#){color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b:not(#\#):not(#\#):not(#\#):not(#\#),strong:not(#\#):not(#\#):not(#\#):not(#\#){font-weight:bolder}code:not(#\#):not(#\#):not(#\#):not(#\#),kbd:not(#\#):not(#\#):not(#\#):not(#\#),samp:not(#\#):not(#\#):not(#\#):not(#\#),pre:not(#\#):not(#\#):not(#\#):not(#\#){font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small:not(#\#):not(#\#):not(#\#):not(#\#){font-size:80%}sub:not(#\#):not(#\#):not(#\#):not(#\#),sup:not(#\#):not(#\#):not(#\#):not(#\#){vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub:not(#\#):not(#\#):not(#\#):not(#\#){bottom:-.25em}sup:not(#\#):not(#\#):not(#\#):not(#\#){top:-.5em}table:not(#\#):not(#\#):not(#\#):not(#\#){text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)):not(#\#):not(#\#):not(#\#):not(#\#){outline:auto}progress:not(#\#):not(#\#):not(#\#):not(#\#){vertical-align:baseline}summary:not(#\#):not(#\#):not(#\#):not(#\#){display:list-item}ol:not(#\#):not(#\#):not(#\#):not(#\#),ul:not(#\#):not(#\#):not(#\#):not(#\#),menu:not(#\#):not(#\#):not(#\#):not(#\#){list-style:none}img:not(#\#):not(#\#):not(#\#):not(#\#),svg:not(#\#):not(#\#):not(#\#):not(#\#),video:not(#\#):not(#\#):not(#\#):not(#\#),canvas:not(#\#):not(#\#):not(#\#):not(#\#),audio:not(#\#):not(#\#):not(#\#):not(#\#),iframe:not(#\#):not(#\#):not(#\#):not(#\#),embed:not(#\#):not(#\#):not(#\#):not(#\#),object:not(#\#):not(#\#):not(#\#):not(#\#){vertical-align:middle;display:block}img:not(#\#):not(#\#):not(#\#):not(#\#),video:not(#\#):not(#\#):not(#\#):not(#\#){max-width:100%;height:auto}button:not(#\#):not(#\#):not(#\#):not(#\#),input:not(#\#):not(#\#):not(#\#):not(#\#),select:not(#\#):not(#\#):not(#\#):not(#\#),optgroup:not(#\#):not(#\#):not(#\#):not(#\#),textarea:not(#\#):not(#\#):not(#\#):not(#\#){font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-file-upload-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:not(#\#):not(#\#):not(#\#):not(#\#)::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])):not(#\#):not(#\#):not(#\#):not(#\#) optgroup{font-weight:bolder}:where(select:is([multiple],[size])):not(#\#):not(#\#):not(#\#):not(#\#) optgroup option{padding-inline-start:20px}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-file-upload-button{margin-inline-end:4px}:not(#\#):not(#\#):not(#\#):not(#\#)::file-selector-button{margin-inline-end:4px}:not(#\#):not(#\#):not(#\#):not(#\#)::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){:not(#\#):not(#\#):not(#\#):not(#\#)::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){:not(#\#):not(#\#):not(#\#):not(#\#)::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea:not(#\#):not(#\#):not(#\#):not(#\#){resize:vertical}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-search-decoration{-webkit-appearance:none}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-datetime-edit{display:inline-flex}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-datetime-edit-fields-wrapper{padding:0}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-datetime-edit{padding-block-start:0;padding-block-end:0}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-datetime-edit-year-field{padding-block-start:0;padding-block-end:0}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-datetime-edit-month-field{padding-block-start:0;padding-block-end:0}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-datetime-edit-day-field{padding-block-start:0;padding-block-end:0}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-datetime-edit-hour-field{padding-block-start:0;padding-block-end:0}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-datetime-edit-minute-field{padding-block-start:0;padding-block-end:0}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-datetime-edit-second-field{padding-block-start:0;padding-block-end:0}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-datetime-edit-millisecond-field{padding-block-start:0;padding-block-end:0}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-datetime-edit-meridiem-field{padding-block-start:0;padding-block-end:0}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid:not(#\#):not(#\#):not(#\#):not(#\#){box-shadow:none}button:not(#\#):not(#\#):not(#\#):not(#\#),input:where([type=button],[type=reset],[type=submit]):not(#\#):not(#\#):not(#\#):not(#\#){-webkit-appearance:button;appearance:button}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-file-upload-button{-webkit-appearance:button;appearance:button}:not(#\#):not(#\#):not(#\#):not(#\#)::file-selector-button{-webkit-appearance:button;appearance:button}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-inner-spin-button{height:auto}:not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])):not(#\#){display:none!important}:not(#\#):not(#\#):not(#\#):not(#\#),:not(#\#):not(#\#):not(#\#):not(#\#):before,:not(#\#):not(#\#):not(#\#):not(#\#):after{min-width:0}body:not(#\#):not(#\#):not(#\#):not(#\#){overflow-wrap:break-word}img:not(#\#):not(#\#):not(#\#):not(#\#),svg:not(#\#):not(#\#):not(#\#):not(#\#),video:not(#\#):not(#\#):not(#\#):not(#\#),canvas:not(#\#):not(#\#):not(#\#):not(#\#),select:not(#\#):not(#\#):not(#\#):not(#\#),input:not(#\#):not(#\#):not(#\#):not(#\#),textarea:not(#\#):not(#\#):not(#\#):not(#\#){max-width:100%}.input:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.select:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding:.45rem .9rem;font-size:.875rem}.input-sm:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding:.25rem .7rem;font-size:.75rem}.pointer-events-auto:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){pointer-events:auto}.pointer-events-none:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){pointer-events:none}.invisible:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){visibility:hidden}.visible:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){visibility:visible}.absolute:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){position:absolute}.fixed:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){position:fixed}.relative:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){position:relative}.static:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){position:static}.sticky:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){position:sticky}.inset-0:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){top:0;bottom:0;left:0;right:0}.inset-x-0:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){left:0;right:0}.inset-x-4:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){inset-inline:calc(var(--spacing) * 4)}.inset-x-6:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){inset-inline:calc(var(--spacing) * 6)}.top-0:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){top:0}.top-1\/2:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){top:50%}.bottom-0:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){bottom:0}.bottom-4:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){bottom:calc(var(--spacing) * 4)}.bottom-6:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){bottom:calc(var(--spacing) * 6)}.bottom-8:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){bottom:calc(var(--spacing) * 8)}.bottom-20:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){bottom:calc(var(--spacing) * 20)}.left-1\/2:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){left:50%}.z-0:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){z-index:0}.z-10:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){z-index:10}.z-20:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){z-index:20}.z-30:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){z-index:30}.z-\[300\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){z-index:300}.container:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:100%}@media (min-width:40rem){.container:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){max-width:40rem}}@media (min-width:48rem){.container:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){max-width:48rem}}@media (min-width:64rem){.container:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){max-width:64rem}}@media (min-width:80rem){.container:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){max-width:80rem}}@media (min-width:96rem){.container:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){max-width:96rem}}.ms-\[8px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){margin-inline-start:8px}.me-\[8px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){margin-inline-end:8px}.block:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){display:block}.flex:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){display:flex}.grid:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){display:grid}.hidden:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){display:none}.inline:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){display:inline}.inline-block:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){display:inline-block}.table:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){display:table}.h-2:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:calc(var(--spacing) * 2)}.h-8:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:calc(var(--spacing) * 8)}.h-11:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:calc(var(--spacing) * 11)}.h-\[24px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:24px}.h-\[26px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:26px}.h-\[32px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:32px}.h-\[36px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:36px}.h-\[44px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:44px}.h-\[52px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:52px}.h-\[54px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:54px}.h-\[124px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:124px}.h-full:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:100%}.h-px:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:1px}.min-h-\[100dvh\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){min-height:100dvh}.w-2:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:calc(var(--spacing) * 2)}.w-11:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:calc(var(--spacing) * 11)}.w-\[36px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:36px}.w-\[44px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:44px}.w-\[52px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:52px}.w-\[54px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:54px}.w-\[56px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:56px}.w-\[76px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:76px}.w-\[84px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:84px}.w-\[124px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:124px}.w-full:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:100%}.w-max:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:max-content}.w-px:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:1px}.max-w-\[calc\(100\%-2rem\)\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){max-width:calc(100% - 2rem)}.max-w-\[min\(22rem\,calc\(100\%-2rem\)\)\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){max-width:min(22rem,100% - 2rem)}.max-w-sm:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){max-width:var(--container-sm)}.min-w-\[64px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){min-width:64px}.shrink-0:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){flex-shrink:0}.-translate-x-1\/2:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\/2:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.transform:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){transform:var(--tw-rotate-x, ) var(--tw-rotate-y, ) var(--tw-rotate-z, ) var(--tw-skew-x, ) var(--tw-skew-y, )}.touch-none:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){touch-action:none}.resize:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){resize:both}.grid-cols-3:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){grid-template-columns:repeat(3,minmax(0,1fr))}.grid-rows-3:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){grid-template-rows:repeat(3,minmax(0,1fr))}.flex-col:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){flex-direction:column}.items-center:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){align-items:center}.items-end:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){align-items:flex-end}.justify-center:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){justify-content:center}.gap-0\.5:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){gap:calc(var(--spacing) * .5)}.gap-1:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){gap:var(--spacing)}.gap-1\.5:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){gap:calc(var(--spacing) * 1.5)}.gap-2:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){gap:calc(var(--spacing) * 2)}.gap-3:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){gap:calc(var(--spacing) * 3)}:where(.space-y-1>:not(:last-child)):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}.truncate:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){overflow:hidden}.rounded:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-radius:.25rem}.rounded-2xl:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-radius:var(--radius-2xl)}.rounded-full:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-radius:2147483647px}.rounded-xl:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-radius:var(--radius-xl)}.border:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-style:var(--tw-border-style);border-width:1px}.border-\[1\.5px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-style:var(--tw-border-style);border-width:1.5px}.border-t:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-top-style:var(--tw-border-style);border-top-width:1px}.border-white:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:var(--color-white)}.border-white\/10:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.border-white\/10:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}.border-white\/20:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:#fff3}@supports (color:color-mix(in lab, red, red)){.border-white\/20:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:color-mix(in oklab, var(--color-white) 20%, transparent)}}.border-white\/25:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:#ffffff40}@supports (color:color-mix(in lab, red, red)){.border-white\/25:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:color-mix(in oklab, var(--color-white) 25%, transparent)}}.border-white\/40:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:#fff6}@supports (color:color-mix(in lab, red, red)){.border-white\/40:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:color-mix(in oklab, var(--color-white) 40%, transparent)}}.border-white\/45:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:#ffffff73}@supports (color:color-mix(in lab, red, red)){.border-white\/45:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:color-mix(in oklab, var(--color-white) 45%, transparent)}}.border-white\/70:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:#ffffffb3}@supports (color:color-mix(in lab, red, red)){.border-white\/70:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:color-mix(in oklab, var(--color-white) 70%, transparent)}}.border-white\/80:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:#fffc}@supports (color:color-mix(in lab, red, red)){.border-white\/80:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:color-mix(in oklab, var(--color-white) 80%, transparent)}}.bg-black:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:var(--color-black)}.bg-black\/40:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#0006}@supports (color:color-mix(in lab, red, red)){.bg-black\/40:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-black) 40%, transparent)}}.bg-black\/45:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#00000073}@supports (color:color-mix(in lab, red, red)){.bg-black\/45:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-black) 45%, transparent)}}.bg-black\/50:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#00000080}@supports (color:color-mix(in lab, red, red)){.bg-black\/50:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-black) 50%, transparent)}}.bg-black\/60:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#0009}@supports (color:color-mix(in lab, red, red)){.bg-black\/60:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-black) 60%, transparent)}}.bg-black\/70:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#000000b3}@supports (color:color-mix(in lab, red, red)){.bg-black\/70:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-black) 70%, transparent)}}.bg-black\/80:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#000c}@supports (color:color-mix(in lab, red, red)){.bg-black\/80:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-black) 80%, transparent)}}.bg-neutral-900:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:var(--color-neutral-900)}.bg-transparent:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#0000}.bg-white:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:var(--color-white)}.bg-white\/10:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.bg-white\/10:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}.bg-white\/15:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#ffffff26}@supports (color:color-mix(in lab, red, red)){.bg-white\/15:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-white) 15%, transparent)}}.bg-white\/25:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#ffffff40}@supports (color:color-mix(in lab, red, red)){.bg-white\/25:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-white) 25%, transparent)}}.bg-white\/30:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#ffffff4d}@supports (color:color-mix(in lab, red, red)){.bg-white\/30:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-white) 30%, transparent)}}.bg-white\/50:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#ffffff80}@supports (color:color-mix(in lab, red, red)){.bg-white\/50:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-white) 50%, transparent)}}.bg-white\/90:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#ffffffe6}@supports (color:color-mix(in lab, red, red)){.bg-white\/90:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-white) 90%, transparent)}}.bg-white\/\[0\.03\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#ffffff08}@supports (color:color-mix(in lab, red, red)){.bg-white\/\[0\.03\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-white) 3%, transparent)}}.bg-white\/\[0\.05\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#ffffff0d}@supports (color:color-mix(in lab, red, red)){.bg-white\/\[0\.05\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-white) 5%, transparent)}}.bg-white\/\[0\.12\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#ffffff1f}@supports (color:color-mix(in lab, red, red)){.bg-white\/\[0\.12\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-white) 12%, transparent)}}.object-contain:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){object-fit:contain}.object-cover:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){object-fit:cover}.object-fill:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){object-fit:fill}.p-0:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding:0}.p-0\.5:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding:calc(var(--spacing) * .5)}.p-6:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding:calc(var(--spacing) * 6)}.px-2:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-inline:calc(var(--spacing) * 2)}.px-2\.5:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-inline:calc(var(--spacing) * 2.5)}.px-3:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-inline:calc(var(--spacing) * 3)}.px-4:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-inline:calc(var(--spacing) * 4)}.px-6:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-inline:calc(var(--spacing) * 6)}.px-\[4px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-inline-start:4px;padding-inline-end:4px}.px-\[10px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-inline-start:10px;padding-inline-end:10px}.py-1:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-block:var(--spacing)}.py-1\.5:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-block:calc(var(--spacing) * 1.5)}.py-2:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-block:calc(var(--spacing) * 2)}.py-2\.5:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-block:calc(var(--spacing) * 2.5)}.pt-\[max\(6px\,env\(safe-area-inset-top\)\)\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-top:max(6px, env(safe-area-inset-top))}.text-center:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){text-align:center}.text-lg:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){font-size:10px}.text-\[11px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){font-size:11px}.text-\[13px\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){font-size:13px}.leading-5:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.font-bold:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wide:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.text-black:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:var(--color-black)}.text-white:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:var(--color-white)}.text-white\/50:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:#ffffff80}@supports (color:color-mix(in lab, red, red)){.text-white\/50:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:color-mix(in oklab, var(--color-white) 50%, transparent)}}.text-white\/60:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:#fff9}@supports (color:color-mix(in lab, red, red)){.text-white\/60:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:color-mix(in oklab, var(--color-white) 60%, transparent)}}.text-white\/80:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:#fffc}@supports (color:color-mix(in lab, red, red)){.text-white\/80:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:color-mix(in oklab, var(--color-white) 80%, transparent)}}.text-white\/85:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:#ffffffd9}@supports (color:color-mix(in lab, red, red)){.text-white\/85:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:color-mix(in oklab, var(--color-white) 85%, transparent)}}.lowercase:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){text-transform:lowercase}.uppercase:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){text-transform:uppercase}.opacity-0:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){opacity:0}.opacity-40:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){opacity:.4}.opacity-100:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){opacity:1}.shadow:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\[0_0_3px_rgba\(0\,0\,0\,0\.3\)\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-shadow:0 0 3px var(--tw-shadow-color,#0000004d);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\[0_0_3px_rgba\(0\,0\,0\,0\.35\)\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-shadow:0 0 3px var(--tw-shadow-color,#00000059);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-ring-shadow:var(--tw-ring-inset, ) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.blur:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-blur:blur(8px);filter:var(--tw-blur, ) var(--tw-brightness, ) var(--tw-contrast, ) var(--tw-grayscale, ) var(--tw-hue-rotate, ) var(--tw-invert, ) var(--tw-saturate, ) var(--tw-sepia, ) var(--tw-drop-shadow, )}.filter:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){filter:var(--tw-blur, ) var(--tw-brightness, ) var(--tw-contrast, ) var(--tw-grayscale, ) var(--tw-hue-rotate, ) var(--tw-invert, ) var(--tw-saturate, ) var(--tw-sepia, ) var(--tw-drop-shadow, )}.backdrop-blur-sm:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, );backdrop-filter:var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, )}.transition-colors:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-75:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-duration:75ms;transition-duration:75ms}.duration-200:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--tw-duration:.2s;transition-duration:.2s}.select-none:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){-webkit-user-select:none;user-select:none}.\[-webkit-touch-callout\:none\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){-webkit-touch-callout:none}.\[text-shadow\:0_1px_2px_rgba\(0\,0\,0\,0\.6\)\]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){text-shadow:0 1px 2px #0009}@media (hover:hover){.hover\:bg-white\/10:hover:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.hover\:bg-white\/10:hover:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}}.disabled\:opacity-40:disabled:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){opacity:.4}:root:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--color-surface:#ffffff0a;--color-surface-2:#ffffff0f;--color-surface-3:#ffffff1a;--color-surface-raised:#ffffff12;--color-float:#2c2c2ef5;--color-canvas:#ffffff09;--glass-edge:#ffffff1a;--color-pill:#ffffff1f;--color-border:#ffffff1a;--color-border-strong:#fff3;--color-muted:#a1a1a8;--color-text:#f5f5f7;--color-accent:#4da3ff;--color-accent-contrast:#fff;--color-accent-soft:#0a84ff2e;--color-accent-bright:#3b9bff;--color-accent-pink:#3b9bff;--accent-fill:linear-gradient(#0a72e8, #0a72e8);--accent-glow:0 1px 2px #0000004d;--color-good:#32d074;--color-good-soft:#32d07424;--color-warn:#ffb340;--color-warn-soft:#ffb34024;--color-bad:#ff6961;--color-bad-soft:#ff696124;--color-ps4:#8fb0ff;--color-ps4-soft:#8fb0ff26;--color-ps5:#c3a2ff;--color-ps5-soft:#c3a2ff26;--shadow-logo:0 12px 40px -10px #00000080;--shadow-1:0 1px 2px #0000002e;--shadow-2:0 10px 30px -10px #0000008c, 0 0 0 .5px #0006;--shadow-3:0 24px 70px -20px #000000b3, 0 0 0 .5px #0006;--edge-highlight:inset 0 1px 0 #ffffff0d;--overlay-scrim:#00000073;--atmosphere-base:#1e1e20;--atmosphere:none;--dot-color:transparent;--glass-blur:24px;--color-accent-glow:#0a84ff40;--radius-control:999px;--radius-field:.5rem;--radius-card:.875rem;--radius-panel:1rem;--radius-canvas:0px;--content-max:none}:root:is([data-theme=light],[data-theme=peach]):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light;--color-surface:#00000008;--color-surface-2:#fff;--color-surface-3:#00000012;--color-surface-raised:#fff;--color-float:#fffffff7;--color-canvas:#00000006;--glass-edge:#00000014;--color-pill:#00000014;--color-border:#0000001a;--color-border-strong:#0003;--color-muted:#5f5f66;--color-text:#1d1d1f;--color-accent:#0064d2;--color-accent-contrast:#fff;--color-accent-soft:#0071e31f;--color-accent-bright:#0071e3;--color-accent-pink:#0071e3;--accent-fill:linear-gradient(#0071e3, #0071e3);--accent-glow:0 1px 2px #0000001f;--color-good:#1a7f43;--color-good-soft:#1a7f431f;--color-warn:#8a5200;--color-warn-soft:#d68c1e29;--color-bad:#c4252f;--color-bad-soft:#d700151a;--color-ps4:#2a55b8;--color-ps4-soft:#2a55b81f;--color-ps5:#6b3fc4;--color-ps5-soft:#6b3fc41f;--shadow-logo:0 12px 40px -10px #0003;--shadow-1:0 1px 2px #0000000d;--shadow-2:0 10px 30px -10px #00000038, 0 0 0 .5px #0000001f;--shadow-3:0 24px 70px -20px #0000004d, 0 0 0 .5px #0000001f;--edge-highlight:inset 0 0 0 0 transparent;--overlay-scrim:#0003;--atmosphere-base:#f5f5f7;--atmosphere:none;--dot-color:transparent;--color-accent-glow:#0071e338}:root[data-theme=peach]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--color-surface:#783c140a;--color-surface-3:#783c1414;--color-float:#fffcf9f7;--color-canvas:#783c1408;--glass-edge:#5a2d0f1a;--color-pill:#c2410c1a;--color-border:#5a2d0f1f;--color-border-strong:#5a2d0f3d;--color-muted:#6e5244;--color-text:#2b1d16;--color-accent:#b93d0a;--color-accent-soft:#ea580c1f;--color-accent-bright:#c2410c;--color-accent-pink:#c2410c;--accent-fill:linear-gradient(#c2410c, #c2410c);--color-accent-glow:#ea580c38;--shadow-logo:0 12px 40px -10px #5a2d0f38;--shadow-1:0 1px 2px #5a2d0f0f;--shadow-2:0 10px 30px -10px #5a2d0f38, 0 0 0 .5px #5a2d0f1f;--shadow-3:0 24px 70px -20px #5a2d0f4d, 0 0 0 .5px #5a2d0f1f;--overlay-scrim:#3c1e0a38;--atmosphere-base:#fbf4ee}:root[data-theme=oled]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--color-surface:#ffffff0d;--color-surface-2:#ffffff12;--color-surface-raised:#ffffff14;--color-float:#141416fa;--color-canvas:transparent;--shadow-logo:none;--shadow-1:none;--shadow-2:0 0 0 .5px #ffffff24;--shadow-3:0 0 0 .5px #ffffff29;--edge-highlight:inset 0 0 0 0 transparent;--overlay-scrim:#000000b3;--atmosphere-base:#000;--glass-blur:0px}:root[data-contrast=high]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--color-surface:#1c1c1e;--color-surface-2:#232325;--color-surface-3:#3a3a3c;--color-surface-raised:#2c2c2e;--color-float:#2c2c2e;--color-canvas:#161618;--glass-edge:#fff6;--glass-blur:0px}:root:is([data-theme=light],[data-theme=peach])[data-contrast=high]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--color-surface:#fff;--color-surface-2:#fff;--color-surface-3:#e5e5ea;--color-surface-raised:#fff;--color-float:#fff;--color-canvas:#f5f5f7;--glass-edge:#00000073;--color-border:#00000059;--color-border-strong:#0009}:root[data-theme=oled][data-contrast=high]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--color-surface:#000;--color-surface-2:#121214;--color-surface-raised:#1a1a1c;--color-float:#1a1a1c;--color-canvas:#000}@media (prefers-reduced-transparency:reduce){:root:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--glass-blur:0px;--color-surface-2:#2c2c2ef5;--color-surface-raised:#323234f5;--color-canvas:#1e1e20f5}:root:is([data-theme=light],[data-theme=peach]):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--color-surface-2:#ffffffe6;--color-surface-raised:#ffffffeb;--color-canvas:#ffffffbf}:root[data-theme=oled]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--color-surface-2:#121214fa;--color-surface-raised:#1a1a1cfa;--color-canvas:transparent}}:root[data-transparency=reduced]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--glass-blur:0px;--color-surface-2:#2c2c2ef5;--color-surface-raised:#323234f5;--color-canvas:#1e1e20f5}:root[data-transparency=reduced]:is([data-theme=light],[data-theme=peach]):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--color-surface-2:#ffffffe6;--color-surface-raised:#ffffffeb;--color-canvas:#ffffffbf}:root[data-transparency=reduced][data-theme=oled]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--color-surface-2:#121214fa;--color-surface-raised:#1a1a1cfa;--color-canvas:transparent}:root[data-motion=reduced]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),:root[data-motion=none]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--glass-blur:0px}html:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),body:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),#root:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:100dvh;color:var(--color-text);font-family:var(--font-sans);font-size:var(--ui-base-size,18px);text-size-adjust:100%;-webkit-font-smoothing:antialiased;font-variant-numeric:tabular-nums;margin:0;overflow:hidden}body:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){position:relative}html:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:var(--atmosphere-base);background-image:var(--atmosphere);background-repeat:no-repeat;background-size:100% 100%;background-attachment:fixed}body:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),#root:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:0 0}body:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){overscroll-behavior-y:contain}.app-page:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:100%;max-width:var(--content-max);margin-inline-start:auto;margin-inline-end:auto;padding:1.75rem clamp(2rem,2.5vw,3rem) 2.5rem}.card-flow:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){grid-template-columns:repeat(auto-fill,minmax(min(100%,44rem),1fr));align-items:start;gap:.75rem;display:grid}.app-page-tabs:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:100%;max-width:var(--content-max);margin-inline-start:auto;margin-inline-end:auto;padding:1.25rem clamp(2rem,2.5vw,3rem) 0}.glass:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-surface-2);border:1px solid var(--glass-edge);box-shadow:var(--edge-highlight), var(--shadow-1);-webkit-backdrop-filter:blur(var(--glass-blur)) saturate(1.4);backdrop-filter:blur(var(--glass-blur)) saturate(1.4)}.glass-float:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-float);border:1px solid var(--glass-edge);box-shadow:var(--edge-highlight), var(--shadow-2);-webkit-backdrop-filter:blur(var(--glass-blur)) saturate(1.4);backdrop-filter:blur(var(--glass-blur)) saturate(1.4)}.float-solid:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:linear-gradient(var(--color-float), var(--color-float)), var(--atmosphere-base);border:1px solid var(--glass-edge)}.surface-panel:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border:1px solid var(--glass-edge);border-radius:var(--radius-panel);background:var(--color-surface-raised);box-shadow:var(--edge-highlight), var(--shadow-1)}.dot-texture:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-image:radial-gradient(var(--dot-color) 1.2px, transparent 1.6px);background-size:12px 12px;-webkit-mask-image:radial-gradient(closest-side,#000 30%,#0000 100%);mask-image:radial-gradient(closest-side,#000 30%,#0000 100%)}.fade-x:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){-webkit-mask-image:linear-gradient(to right, transparent, #000 var(--fade-start,0px), #000 calc(100% - var(--fade-end,0px)), transparent);-webkit-mask-image:linear-gradient(to right, transparent, #000 var(--fade-start,0px), #000 calc(100% - var(--fade-end,0px)), transparent);-webkit-mask-image:linear-gradient(to right, transparent, #000 var(--fade-start,0px), #000 calc(100% - var(--fade-end,0px)), transparent);-webkit-mask-image:linear-gradient(to right, transparent, #000 var(--fade-start,0px), #000 calc(100% - var(--fade-end,0px)), transparent);mask-image:linear-gradient(to right, transparent, #000 var(--fade-start,0px), #000 calc(100% - var(--fade-end,0px)), transparent)}[dir=rtl]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .fade-x{-webkit-mask-image:linear-gradient(to left, transparent, #000 var(--fade-start,0px), #000 calc(100% - var(--fade-end,0px)), transparent);-webkit-mask-image:linear-gradient(to left, transparent, #000 var(--fade-start,0px), #000 calc(100% - var(--fade-end,0px)), transparent);-webkit-mask-image:linear-gradient(to left, transparent, #000 var(--fade-start,0px), #000 calc(100% - var(--fade-end,0px)), transparent);-webkit-mask-image:linear-gradient(to left, transparent, #000 var(--fade-start,0px), #000 calc(100% - var(--fade-end,0px)), transparent);mask-image:linear-gradient(to left, transparent, #000 var(--fade-start,0px), #000 calc(100% - var(--fade-end,0px)), transparent)}.icon-orb-button:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border:1px solid var(--glass-edge);background:var(--color-surface-raised);width:2.75rem;height:2.75rem;color:var(--color-text);box-shadow:var(--edge-highlight), var(--shadow-1);border-radius:9999px;flex:none;place-items:center;transition:transform .14s,background-color .14s,box-shadow .14s;display:inline-grid}.icon-orb-button:hover:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-float);transform:translateY(-1px)}.action-tile:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-radius:var(--radius-card);border:1px solid var(--glass-edge);background:var(--color-surface-raised);min-height:5.5rem;box-shadow:var(--edge-highlight), var(--shadow-1);padding:1rem 1.125rem;transition:transform .16s,background-color .16s,box-shadow .16s;display:block;container-type:inline-size}.action-tile:not([aria-disabled=true]):hover:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-float);box-shadow:var(--edge-highlight), var(--shadow-2);transform:translateY(-2px)}.action-tile[aria-disabled=true]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){cursor:not-allowed;opacity:.6}.action-tile-inner:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){align-items:center;gap:.875rem;min-height:3.5rem;display:flex}@container (width<=15rem){.action-tile-inner:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){flex-direction:column;align-items:flex-start;gap:.625rem;min-height:0}.action-tile-inner:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .action-tile-chevron{display:none}}@media (max-width:639px){.action-tile:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){min-height:0;padding:.875rem}}.metric-row:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-bottom:1px solid var(--color-border);justify-content:space-between;align-items:center;gap:1rem;min-height:2.25rem;font-size:.8125rem;display:flex}.metric-row:last-child:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-bottom:0}.icon-disc:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-accent-soft);width:2rem;height:2rem;color:var(--color-accent-bright);border-radius:9999px;flex:none;place-items:center;display:inline-grid}.chip:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border:1px solid var(--color-border-strong);color:var(--color-text);white-space:nowrap;border-radius:9999px;align-items:center;transition:background-color .14s,border-color .14s,box-shadow .14s;display:inline-flex}.chip:hover:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-surface)}.chip[aria-pressed=true]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.chip[aria-checked=true]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.chip[aria-selected=true]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.chip.is-active:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-pill);border-color:#0000;font-weight:600}@media (min-width:768px){.shell-sidebar:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-canvas);border-inline-end:1px solid var(--color-border)}}.shell-safe-x:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-left:var(--safe-left);padding-right:var(--safe-right)}@media (min-width:768px){.shell-sidebar:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-top:var(--safe-top)}}@media (min-width:768px) and (pointer:coarse) and (orientation:landscape) and (max-height:520px){.shell-statusbar{display:none!important}.shell-safe-x:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-bottom:var(--safe-bottom)}.shell-sidebar:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)>:first-child{height:3.5rem}}.nav-pill:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:var(--color-text)}.nav-pill:hover:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-surface)}.nav-pill.active:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.nav-pill[aria-current=page]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-pill);font-weight:600}.nav-pill:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .nav-pill-icon{color:var(--color-muted)}.nav-pill.active:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .nav-pill-icon,.nav-pill[aria-current=page]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .nav-pill-icon{color:var(--color-accent-bright)}:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){box-sizing:border-box}:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::selection{background:var(--color-accent);color:var(--color-accent-contrast)}:where(a,button,[role=button],[role=menuitem],[role=tab],[tabindex]):focus-visible:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){outline:2px solid var(--color-accent);outline-offset:2px}:where(input,select,textarea):focus-visible:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){outline:2px solid var(--color-accent);outline-offset:1px}:root[data-tv="1"]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) :where(a,button,input,select,textarea,summary,[role=button],[role=menuitem],[role=tab],[tabindex]):focus{outline:3px solid var(--color-accent);outline-offset:3px}:root[data-tv="1"]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) [data-join-ui] :where(a,button,input,select,textarea,summary,[role=button],[tabindex]):focus{outline-offset:3px;outline:3px solid #fff}[data-join-ui]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) :where(a,button,input,select,textarea,summary,[role=button],[tabindex]):focus-visible{outline-offset:3px;outline:3px solid #fff}:root[data-tv="1"]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) [data-join-ui] :where(a,button,input,select,textarea,summary,[role=button],[tabindex]):focus{outline-width:4px}:is([data-join-game]:focus,[data-join-game]:focus-visible){outline:none!important}:is(.input:focus-visible:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.select:focus-visible:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.field-quiet:focus-visible:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)){outline:none}.field-shell:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){transition:box-shadow .14s,background-color .14s}.field-shell:has(.field-quiet:focus-visible):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){box-shadow:inset 0 -2px 0 var(--color-accent)}.field-shell.rounded-full:has(.field-quiet:focus-visible):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){box-shadow:0 0 0 2px var(--color-accent), 0 0 0 5px var(--color-accent-soft)}.field-shell-ring:has(.field-quiet:focus-visible):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){box-shadow:0 0 0 2px var(--color-accent), 0 0 0 5px var(--color-accent-soft)}.scrim:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--overlay-scrim);-webkit-backdrop-filter:blur(calc(var(--glass-blur) / 4));backdrop-filter:blur(calc(var(--glass-blur) / 4))}.glass-bar:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-float);-webkit-backdrop-filter:blur(var(--glass-blur)) saturate(1.4);backdrop-filter:blur(var(--glass-blur)) saturate(1.4)}:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){scrollbar-width:thin;scrollbar-color:var(--color-border-strong) transparent}:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-scrollbar{width:10px;height:10px}:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-scrollbar-track{background:0 0}:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-scrollbar-thumb{background:var(--color-border-strong);background-clip:padding-box;border:2px solid #0000;border-radius:8px}:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-scrollbar-thumb:hover{background:var(--color-muted);background-clip:padding-box}@keyframes ps-fade-in{0%{opacity:0}to{opacity:1}}@keyframes ps-pop-in{0%{opacity:0;transform:translateY(8px)scale(.98)}to{opacity:1;transform:translateY(0)scale(1)}}@keyframes ps-rise-in{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}@keyframes ps-drawer-in{0%{transform:translate(-100%)}to{transform:translate(0)}}@keyframes ps-sheet-in{0%{opacity:0;transform:translateY(24px)}to{opacity:1;transform:translateY(0)}}@keyframes ps-side-in{0%{opacity:0;transform:translate(24px)}to{opacity:1;transform:translate(0)}}@keyframes ps-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@keyframes ps-soft-pulse{0%,to{opacity:1}50%{opacity:.45}}.anim-scrim:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){animation:.15s ease-out both ps-fade-in}.anim-pop:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){animation:.18s cubic-bezier(.2,.8,.2,1) both ps-pop-in}.anim-rise:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){animation:.14s cubic-bezier(.2,.8,.2,1) both ps-rise-in}.anim-screen:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){animation:.2s cubic-bezier(.2,.8,.2,1) backwards ps-rise-in}.anim-drawer:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){animation:.22s cubic-bezier(.2,.8,.2,1) both ps-drawer-in}.anim-sheet:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){animation:.22s cubic-bezier(.2,.8,.2,1) both ps-sheet-in}.anim-side:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){animation:.2s cubic-bezier(.2,.8,.2,1) both ps-side-in}.anim-sheet-up:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){animation:.22s cubic-bezier(.2,.8,.2,1) both ps-sheet-in}.anim-skeleton:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:linear-gradient(100deg, var(--color-surface-3) 40%, var(--color-surface-raised) 50%, var(--color-surface-3) 60%);background-size:200% 100%;animation:2.2s linear infinite ps-shimmer}.anim-status-pulse:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){animation:2.4s ease-in-out infinite ps-soft-pulse}.elev-1:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){box-shadow:var(--edge-highlight), var(--shadow-1)}@media (max-width:767px){.app-page:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding:1rem}.app-page-tabs:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding:1rem 1rem 0}}.elev-2:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){box-shadow:var(--edge-highlight), var(--shadow-2)}.elev-3:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){box-shadow:var(--edge-highlight), var(--shadow-3)}.support-button:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){color:#fff;background-image:linear-gradient(135deg,#ff3d6e 0%,#ff6a4d 55%,#ff9a3c 100%);transition:transform .16s cubic-bezier(.2,.8,.2,1),box-shadow .16s,filter .16s;box-shadow:0 6px 18px -6px #ff3d6ea6,inset 0 1px #ffffff40}.support-button:hover:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){filter:brightness(1.06);transform:translateY(-1px);box-shadow:0 10px 24px -8px #ff3d6ebf,inset 0 1px #ffffff40}.support-button:active:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){transform:translateY(0)}.support-button:focus-visible:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){outline-offset:2px;outline:2px solid #ff3d6e}.support-heart:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){transform-origin:50%;animation:2.8s ease-in-out infinite support-beat}@keyframes support-beat{0%,70%,to{transform:scale(1)}76%{transform:scale(1.22)}82%{transform:scale(1)}88%{transform:scale(1.14)}}:root[data-motion=none]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .support-heart{animation:none}.fs-reveal:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){outline:2px solid var(--color-accent);outline-offset:-1px;box-shadow:inset 0 0 0 999px var(--color-accent)}@supports (color:color-mix(in lab, red, red)){.fs-reveal:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){box-shadow:inset 0 0 0 999px color-mix(in srgb, var(--color-accent) 16%, transparent)}}@keyframes fs-reveal{0%,45%{outline-color:var(--color-accent);box-shadow:inset 0 0 0 999px color-mix(in srgb, var(--color-accent) 16%, transparent)}to{outline-color:#0000;box-shadow:inset 0 0 0 999px #0000}}@media (prefers-reduced-motion:no-preference){:root:not([data-motion=none]):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .fs-reveal{animation:2s ease-out forwards fs-reveal}}@media (prefers-reduced-motion:reduce){.anim-scrim:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.anim-pop:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.support-heart:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.anim-rise:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.anim-screen:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.anim-drawer:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.anim-sheet:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.anim-sheet-up:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.anim-side:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.anim-skeleton:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.anim-status-pulse:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){animation:none}*,:before,:after{transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}:root[data-motion=reduced]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .anim-pop{animation-duration:90ms}:root[data-motion=reduced]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .anim-screen,:root[data-motion=none]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .anim-scrim,:root[data-motion=none]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .anim-pop,:root[data-motion=none]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .anim-rise,:root[data-motion=none]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .anim-screen,:root[data-motion=none]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .anim-drawer,:root[data-motion=none]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .anim-sheet,:root[data-motion=none]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .anim-sheet-up,:root[data-motion=none]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .anim-side,:root[data-motion=none]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .anim-skeleton,:root[data-motion=none]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .anim-status-pulse{animation:none}:root[data-motion=none] *,:root[data-motion=none] :before,:root[data-motion=none] :after{transition-duration:.01ms!important}:root[data-contrast=high]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--color-border:var(--color-border-strong);--color-muted:var(--color-text)}:root[data-contrast=high]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) :where(a,button,[role=button],[role=menuitem],[role=tab],[tabindex]):focus-visible{outline-offset:4px;outline-width:3px}:root:is(:lang(ar),:lang(fa)):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--font-sans:system-ui, "SF Arabic", "Noto Sans Arabic", "Geeza Pro", "Segoe UI", Tahoma, sans-serif}:root:is(:lang(ar),:lang(fa)):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) :not(.font-mono,code,kbd,pre,input,textarea){letter-spacing:normal}:root:is(:lang(ar),:lang(fa)):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .uppercase{text-transform:none;font-size:.8125rem}:root[data-dyslexia=true]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) body,:root[data-dyslexia=true]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) #root{letter-spacing:.01em;font-family:Atkinson Hyperlegible,OpenDyslexic,system-ui,-apple-system,sans-serif;line-height:1.5}.sr-only:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.skip-link:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){z-index:100;background:var(--color-accent);color:var(--color-accent-contrast);border-radius:0 0 .375rem;padding:.5rem 1rem;font-size:.875rem;font-weight:500;transition:top .15s;position:absolute;top:-100%;left:0}.skip-link:focus:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){outline:2px solid var(--color-accent);outline-offset:2px;top:0}.safe-top:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-top:var(--safe-top)}:root:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--safe-bottom:max(env(safe-area-inset-bottom), var(--nav-inset-bottom,0px));--safe-top:max(env(safe-area-inset-top), var(--sys-inset-top,0px));--safe-left:max(env(safe-area-inset-left), var(--sys-inset-left,0px));--safe-right:max(env(safe-area-inset-right), var(--sys-inset-right,0px))}.safe-bottom:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-bottom:var(--safe-bottom)}:root:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--float-bottom:0px}@media (max-width:767.98px){:root:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--float-bottom:calc(88px + var(--safe-bottom))}html[data-activity-pill]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--float-bottom:calc(5.1rem + var(--safe-bottom) + var(--activity-pill-h,2.75rem) + .375rem)}.tab-room:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){scroll-padding-bottom:calc(var(--float-bottom) + 4.5rem)}}html[data-keyboard] [data-bottom-nav],html[data-keyboard] [data-testid=activity-pill]{display:none!important}@media not all and (min-width:40rem),(pointer:coarse) and (max-height:520px){html[data-selection-bar] [data-bottom-nav]{display:none!important}[data-top-bar]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .icon-orb-button{width:44px;height:44px}}@media (min-width:768px) and (pointer:coarse) and (orientation:landscape) and (max-height:520px){html[data-screen-bar]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) [data-top-row]{padding-top:var(--safe-top)}html[data-screen-bar]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) [data-top-row]>:not([data-keep]){display:none}}@media (max-width:767.98px){html[data-screen-bar]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) [data-top-bar]{min-height:0;padding-top:var(--safe-top);padding-bottom:0}html[data-screen-bar]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) [data-top-bar]>*{display:none}}.tab-rail-probe:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){visibility:hidden;pointer-events:none;padding-left:var(--safe-left);padding-right:var(--safe-right);position:fixed}@media (max-width:767px){[data-bottom-nav][data-rail]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){top:max(calc(var(--safe-top) + 9.75rem), calc(100dvh - var(--safe-bottom) - .6rem - 24rem));border-radius:2rem;flex-direction:column;gap:0;height:auto}[data-bottom-nav][data-rail=right]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:calc(var(--safe-right) - .75rem);left:auto;right:.375rem}[data-bottom-nav][data-rail=left]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:calc(var(--safe-left) - .75rem);left:.375rem;right:auto}html[data-tab-rail]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) [data-testid=activity-pill]{bottom:calc(var(--safe-bottom) + .6rem)}html[data-tab-rail]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--float-bottom:calc(1rem + var(--safe-bottom))}html[data-tab-rail][data-activity-pill]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--float-bottom:calc(.6rem + var(--safe-bottom) + var(--activity-pill-h,2.75rem) + .375rem)}}.safe-left:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-left:var(--safe-left)}.safe-right:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-right:var(--safe-right)}.safe-pad:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-top:var(--safe-top);padding-bottom:var(--safe-bottom);padding-left:var(--safe-left);padding-right:var(--safe-right)}.h-bottom-nav:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){height:calc(56px + var(--safe-bottom))}.h-top-bar:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){min-height:calc(44px + var(--safe-top));padding-left:calc(var(--safe-left) + 1rem);padding-right:calc(var(--safe-right) + 1rem)}@media (max-width:767.98px){.panel-sheet-x:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){left:max(.5rem, var(--safe-left));right:max(.5rem, var(--safe-right))}}.modal-safe-x:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-left:max(1rem, var(--safe-left));padding-right:max(1rem, var(--safe-right))}@media (max-width:639.98px){.modal-safe-x:has(>.anim-sheet-up):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding-left:var(--safe-left);padding-right:var(--safe-right)}}@media (pointer:coarse){button:not([role=switch]):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),[role=button]:not([role=switch]):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),[role=tab]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),[role=menuitem]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),[role=menuitemcheckbox]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),[role=menuitemradio]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),[role=option]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),[role=treeitem]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),select:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),textarea:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),input:not([type=checkbox]):not([type=radio]):not([type=range]):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){min-height:44px}}input[type=checkbox]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),input[type=radio]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:1.15rem;height:1.15rem;accent-color:var(--color-accent);cursor:pointer}@media (pointer:coarse){input[type=checkbox]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),input[type=radio]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:1.4rem;height:1.4rem}}.input:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-radius:var(--radius-control);border:1px solid var(--glass-edge);background:var(--color-surface-raised);width:100%;color:var(--color-text);transition:border-color .15s,box-shadow .15s;box-shadow:inset 0 1px 2px #0000000f}:root:is([data-theme=light],[data-theme=peach]):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .input,:root:is([data-theme=light],[data-theme=peach]):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) .select{border-color:#00000024}textarea.input:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-radius:var(--radius-field)}.input:focus:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.select:focus:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-color:var(--color-accent);box-shadow:0 0 0 3px var(--color-accent-soft)}.input:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::placeholder{color:var(--color-muted)}:root[dir=rtl]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) :where(.font-mono,code,kbd,samp,pre,.tabular-nums){unicode-bidi:plaintext}:where(input,textarea):placeholder-shown:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){text-overflow:ellipsis}@media (max-width:767px){.input:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.input-sm:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.select:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){min-height:2.75rem}}.select:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-radius:var(--radius-control);border:1px solid var(--glass-edge);background:var(--color-surface-raised);width:100%;color:var(--color-text);transition:border-color .15s,box-shadow .15s}select:not([multiple]):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){-webkit-appearance:none;appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-position:right .75rem center;background-repeat:no-repeat;padding-inline-end:2rem}[dir=rtl]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) select:not([multiple]){background-position:.75rem}.select:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) option,select:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#) option{background:var(--color-float);color:var(--color-text)}.radio:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#),.checkbox:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){accent-color:var(--color-accent);cursor:pointer}.badge:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){border-radius:9999px;align-items:center;gap:.25rem;padding:.15rem .6rem;font-size:.75rem;font-weight:500;line-height:1;display:inline-flex}.badge-sm:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){padding:.0625rem .375rem;font-size:.6875rem}.badge-success:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-good-soft);color:var(--color-good)}.badge-warn:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-warn-soft);color:var(--color-warn)}.badge-bad:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background:var(--color-bad-soft);color:var(--color-bad)}.list-row-contain-sm:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){content-visibility:auto;contain-intrinsic-size:auto 2.25rem}.rp-place:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){container-type:size}.rp-mini:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--mini-top:calc(var(--safe-top) + 4.25rem);--mini-bottom:calc(var(--safe-bottom) + 5.5rem);--mini-left:calc(var(--safe-left) + .75rem);--mini-right:calc(var(--safe-right) + .75rem);width:min(max(140px,40vw),100vw - 1.5rem)}@media (min-width:768px){.rp-mini:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){--mini-top:5rem;--mini-bottom:3rem;--mini-left:1rem;--mini-right:1rem;width:min(320px,100vw - 2rem)}}.rp-mini[data-corner=tl]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){top:var(--mini-top);left:var(--mini-left)}.rp-mini[data-corner=tr]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){top:var(--mini-top);right:var(--mini-right)}.rp-mini[data-corner=bl]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){bottom:var(--mini-bottom);left:var(--mini-left)}.rp-mini[data-corner=br]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){bottom:var(--mini-bottom);right:var(--mini-right)}.rp-picture:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){flex:none;width:100%;max-width:none;height:100%;max-height:none;display:block}@supports (width:1cqw){.rp-picture:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){object-fit:fill}.rp-picture[data-fit=fit]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:min(100cqw, 100cqh * var(--rp-shape));height:min(100cqh, 100cqw / var(--rp-shape))}.rp-picture[data-fit=fill]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:max(100cqw, 100cqh * var(--rp-shape));height:max(100cqh, 100cqw / var(--rp-shape))}.rp-picture[data-fit=stretch]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){width:100cqw;height:100cqh}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false} /*$vite$:1*/</style> </head> <body style="margin: 0; background: #000"> diff --git a/third_party/ava1 b/third_party/ava1 index ae1d47133..3433a2080 160000 --- a/third_party/ava1 +++ b/third_party/ava1 @@ -1 +1 @@ -Subproject commit ae1d471331348e0a9d3ffbae9cddaf088b8ddbbd +Subproject commit 3433a2080ac6252d52f1a1f008792acd000aedd3