diff --git a/README.md b/README.md
index 33f3929..f2bb21e 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@ Sonda is a privacy-first, self-hosted music server written in Go. It streams the
It is a single executable, one database (SQLite by default, PostgreSQL if you prefer) and the folders that hold your music. There is no Redis, no message broker and no cloud account.
-> **Status: early.** The local-playback part works end to end: accounts, libraries, scanning, search, and streaming with HTTP Range. Suggestions of new artists work too (Discover). Radio queues, a web client and OpenSubsonic compatibility are not built yet (see [What is not there yet](#what-is-not-there-yet)). The API may still change.
+> **Status: early.** The local-playback part works end to end: accounts, libraries, scanning, search, and streaming with HTTP Range. Suggestions of new artists work too (Discover). Radio queues and OpenSubsonic compatibility are not built yet, and the web client in `web/` is a work in progress (see [What is not there yet](#what-is-not-there-yet) and [Web app](#web-app)). The API may still change.
## What works today
@@ -27,7 +27,7 @@ It is a single executable, one database (SQLite by default, PostgreSQL if you pr
## What is not there yet
-Radio queues, a web client, OpenSubsonic compatibility, transcoding, and the ListenBrainz integration.
+Radio queues, OpenSubsonic compatibility, transcoding, and the ListenBrainz integration. The web client exists (see [Web app](#web-app)) but `sondad` does not serve it yet, and it has no Discover or admin screens yet.
## Requirements
@@ -295,6 +295,20 @@ Back up the database and `sonda.toml`. Your music stays wherever you keep it.
- **PostgreSQL:** `pg_dump` the database.
- `sonda.toml` holds the secret that signs tokens; treat the copy like a password.
+## Web app
+
+A web client lives in `web/` (React, Vite and shadcn/ui). It talks only to the Sonda server: no CDN, no external fonts, no analytics. `sondad` does not serve it yet, so for now it runs next to the server:
+
+```bash
+cd web
+npm install
+SONDA_URL=http://127.0.0.1:8080 npm run dev # open http://localhost:5173, /api is proxied to Sonda
+```
+
+What it does today: sign in (and create the first account of a new server), browse artists, albums and songs, search, and play with a queue, shuffle, repeat, media keys and a full-screen player. Artist pages show the Wikipedia text, similar artists and tags when those providers are on, each with its credit, and the photo credit next to the photo. It reports one listen per play. There are six themes (Sonda, Tokyo Night, Gruvbox dark, Gruvbox light, Dracula and Neon) and two languages (English and Italian), both chosen in Settings.
+
+More commands, all run in `web/`: `npm test`, `npm run build`, and `npm run gen:api`, which rebuilds `src/api/schema.d.ts` from the OpenAPI spec (it fetches the generator with `npx`, so it needs the network once). Discover, the admin screens and serving the app from the binary come later.
+
## Development
```bash
@@ -333,6 +347,7 @@ internal/usersettings/ the settings that belong to one user
internal/storage/ SQLite and PostgreSQL through bun, the repositories
internal/streaming/ opening a track's file safely
migrations/ SQL migrations, one folder per database
+web/ the web client (React, Vite, shadcn/ui)
```
The API description is `internal/api/openapi/openapi.yaml`, written by hand and embedded in the binary. Two tests keep it in step with the code: one fails when a route and the spec disagree in either direction, and a contract test sends real requests through every operation and validates each response (status, headers, JSON body) against the spec. Adding or changing an endpoint therefore means updating the spec in the same change. Response objects are closed (`additionalProperties: false`), so a field added in the code and forgotten in the spec fails the build.
diff --git a/web/.gitignore b/web/.gitignore
new file mode 100644
index 0000000..a547bf3
--- /dev/null
+++ b/web/.gitignore
@@ -0,0 +1,24 @@
+# Logs
+logs
+*.log
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+pnpm-debug.log*
+lerna-debug.log*
+
+node_modules
+dist
+dist-ssr
+*.local
+
+# Editor directories and files
+.vscode/*
+!.vscode/extensions.json
+.idea
+.DS_Store
+*.suo
+*.ntvs*
+*.njsproj
+*.sln
+*.sw?
diff --git a/web/.oxlintrc.json b/web/.oxlintrc.json
new file mode 100644
index 0000000..6fa991d
--- /dev/null
+++ b/web/.oxlintrc.json
@@ -0,0 +1,8 @@
+{
+ "$schema": "./node_modules/oxlint/configuration_schema.json",
+ "plugins": ["react", "typescript", "oxc"],
+ "rules": {
+ "react/rules-of-hooks": "error",
+ "react/only-export-components": ["warn", { "allowConstantExport": true }]
+ }
+}
diff --git a/web/components.json b/web/components.json
new file mode 100644
index 0000000..15addee
--- /dev/null
+++ b/web/components.json
@@ -0,0 +1,25 @@
+{
+ "$schema": "https://ui.shadcn.com/schema.json",
+ "style": "base-nova",
+ "rsc": false,
+ "tsx": true,
+ "tailwind": {
+ "config": "",
+ "css": "src/index.css",
+ "baseColor": "neutral",
+ "cssVariables": true,
+ "prefix": ""
+ },
+ "iconLibrary": "lucide",
+ "rtl": false,
+ "aliases": {
+ "components": "@/components",
+ "utils": "@/lib/utils",
+ "ui": "@/components/ui",
+ "lib": "@/lib",
+ "hooks": "@/hooks"
+ },
+ "menuColor": "default",
+ "menuAccent": "subtle",
+ "registries": {}
+}
diff --git a/web/index.html b/web/index.html
new file mode 100644
index 0000000..97acf7e
--- /dev/null
+++ b/web/index.html
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+ Sonda
+
+
+
+
+
+
diff --git a/web/package-lock.json b/web/package-lock.json
new file mode 100644
index 0000000..38a2c84
--- /dev/null
+++ b/web/package-lock.json
@@ -0,0 +1,6212 @@
+{
+ "name": "web",
+ "version": "0.0.0",
+ "lockfileVersion": 3,
+ "requires": true,
+ "packages": {
+ "": {
+ "name": "web",
+ "version": "0.0.0",
+ "dependencies": {
+ "@base-ui/react": "^1.9.0",
+ "@fontsource/figtree": "^5.3.0",
+ "@fontsource/fraunces": "^5.3.0",
+ "@tanstack/react-query": "^5.107.1",
+ "class-variance-authority": "^0.7.1",
+ "cn": "^0.5.2",
+ "i18next": "^27.1.1",
+ "lucide-react": "^1.72.0",
+ "react": "^19.3.1",
+ "react-dom": "^19.3.1",
+ "react-i18next": "^18.0.1",
+ "react-router-dom": "^7.18.5",
+ "shadcn": "^4.23.0",
+ "tw-animate-css": "^1.4.0",
+ "zustand": "^5.1.0"
+ },
+ "devDependencies": {
+ "@tailwindcss/vite": "^4.3.5",
+ "@testing-library/jest-dom": "^7.0.1",
+ "@testing-library/react": "^16.3.3",
+ "@testing-library/user-event": "^14.6.10",
+ "@types/node": "^24.19.2",
+ "@types/react": "^19.3.0",
+ "@types/react-dom": "^19.3.0",
+ "@vitejs/plugin-react": "^6.1.2",
+ "jsdom": "^31.0.0",
+ "oxlint": "^1.90.0",
+ "tailwindcss": "^4.3.5",
+ "typescript": "~7.0.2",
+ "vite": "^8.3.6",
+ "vitest": "^5.1.0"
+ }
+ },
+ "node_modules/@adobe/css-tools": {
+ "version": "4.5.0",
+ "resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.5.0.tgz",
+ "integrity": "sha512-6OzddxPio9UiWTCemp4N8cYLV2ZN1ncRnV1cVGtve7dhPOtRkleRyx32GQCYSwDYgaHU3USMm84tNsvKzRCa1Q==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@babel/code-frame": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz",
+ "integrity": "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==",
+ "license": "MIT",
+ "dependencies": {
+ "@babel/helper-validator-identifier": "^7.29.7",
+ "js-tokens": "^4.0.0",
+ "picocolors": "^1.1.1"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/compat-data": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.7.tgz",
+ "integrity": "sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/core": {
+ "version": "7.29.13",
+ "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.13.tgz",
+ "integrity": "sha512-j1nvOQCZYSgp7HLmisnCXFTpVvFODiijQ9QHkORfGKWH6YDtskTEeCJS7eV545GZ9UBzrq0e2xsOd5QQ5PjIqw==",
+ "license": "MIT",
+ "dependencies": {
+ "@babel/code-frame": "^7.29.7",
+ "@babel/generator": "^7.29.13",
+ "@babel/helper-compilation-targets": "^7.29.13",
+ "@babel/helper-module-transforms": "^7.29.13",
+ "@babel/helpers": "^7.29.13",
+ "@babel/parser": "^7.29.13",
+ "@babel/template": "^7.29.7",
+ "@babel/traverse": "^7.29.13",
+ "@babel/types": "^7.29.11",
+ "@jridgewell/remapping": "^2.3.5",
+ "convert-source-map": "^2.0.0",
+ "debug": "^4.1.0",
+ "gensync": "^1.0.0-beta.2",
+ "json5": "^2.2.3",
+ "semver": "^6.3.1"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/babel"
+ }
+ },
+ "node_modules/@babel/generator": {
+ "version": "7.29.14",
+ "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.14.tgz",
+ "integrity": "sha512-qSY56jgW5JnSXzuekLVil6zaOQxOCtOHidr65KkaMBw772IuAY28Qx4ZykAcDn8+FRF15qk80XzKwgSc/RYW6g==",
+ "license": "MIT",
+ "dependencies": {
+ "@babel/parser": "^7.29.14",
+ "@babel/types": "^7.29.14",
+ "@jridgewell/gen-mapping": "^0.3.12",
+ "@jridgewell/trace-mapping": "^0.3.28",
+ "jsesc": "^3.0.2"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-annotate-as-pure": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.29.7.tgz",
+ "integrity": "sha512-OoK6239jHPuSQOoS0kfTVKn0b/rVTk0seKq4Gd2UMLtmOVLjDC0ki3e+c90Trqv2gMfvJFqkiljrr568+qddiw==",
+ "license": "MIT",
+ "dependencies": {
+ "@babel/types": "^7.29.7"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-compilation-targets": {
+ "version": "7.29.13",
+ "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.29.13.tgz",
+ "integrity": "sha512-8WxJ4/Vmes3ghacj8VOJy3NW8eyHiFY/4thU/LSBuBE470+igjR/j1ZTNn8fV5VdNrLx6iXUwig526UdOvfP0w==",
+ "license": "MIT",
+ "dependencies": {
+ "@babel/compat-data": "^7.29.7",
+ "@babel/helper-validator-option": "^7.29.7",
+ "browserslist": "^4.24.0",
+ "lru-cache": "^5.1.1",
+ "semver": "^6.3.1"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-compilation-targets/node_modules/lru-cache": {
+ "version": "5.1.1",
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz",
+ "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==",
+ "license": "ISC",
+ "dependencies": {
+ "yallist": "^3.0.2"
+ }
+ },
+ "node_modules/@babel/helper-create-class-features-plugin": {
+ "version": "7.29.13",
+ "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.29.13.tgz",
+ "integrity": "sha512-fo8/Fr44/DMV71FQjk/HA0Npmu3bo5DFoWTCW1dhUR8Vx3NFfAVeEy0TbcBpt4e+hd2QhdmWgmspHo/9iWj8RA==",
+ "license": "MIT",
+ "dependencies": {
+ "@babel/helper-annotate-as-pure": "^7.29.7",
+ "@babel/helper-member-expression-to-functions": "^7.29.7",
+ "@babel/helper-optimise-call-expression": "^7.29.7",
+ "@babel/helper-replace-supers": "^7.29.7",
+ "@babel/helper-skip-transparent-expression-wrappers": "^7.29.13",
+ "@babel/traverse": "^7.29.13",
+ "semver": "^6.3.1"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0"
+ }
+ },
+ "node_modules/@babel/helper-globals": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.29.7.tgz",
+ "integrity": "sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-member-expression-to-functions": {
+ "version": "7.29.14",
+ "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.29.14.tgz",
+ "integrity": "sha512-FuTSn8mXKAP+aHXnbkCYQsQAdlEIJptEutwc2NaPd28hyVqsjRDmBnI2EPJX6HCodKIqOHfayQHqtxQCkqwthA==",
+ "license": "MIT",
+ "dependencies": {
+ "@babel/helper-skip-transparent-expression-wrappers": "^7.29.13",
+ "@babel/traverse": "^7.29.14",
+ "@babel/types": "^7.29.14"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-module-imports": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.29.7.tgz",
+ "integrity": "sha512-ejHwrQQYcm9xnTivShn2IDOlIzInN34AXskvq9QicvCtEzq1Vzclu/tKF8Jq1Cg8JG2GL6/EmjgsCT7lXepE3g==",
+ "license": "MIT",
+ "dependencies": {
+ "@babel/traverse": "^7.29.7",
+ "@babel/types": "^7.29.7"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-module-transforms": {
+ "version": "7.29.14",
+ "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.29.14.tgz",
+ "integrity": "sha512-2XDvQVd9JESaOgGc4jT2/jquTAO7ppA5noTZQqH+MmZ89yjCzScLwtCPbWtkPZylL+TLWR49IwWmk+QkRR4GsA==",
+ "license": "MIT",
+ "dependencies": {
+ "@babel/helper-module-imports": "^7.29.7",
+ "@babel/helper-validator-identifier": "^7.29.7",
+ "@babel/traverse": "^7.29.14"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0"
+ }
+ },
+ "node_modules/@babel/helper-optimise-call-expression": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.29.7.tgz",
+ "integrity": "sha512-+kmGVjcT9RGYzoDwdwEqEvGgKe3BYq+O1iGzjFubaNgZHwYHP6lsF2Yghf4kEuv9BV7tYDZ913aBW9am6YKong==",
+ "license": "MIT",
+ "dependencies": {
+ "@babel/types": "^7.29.7"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-plugin-utils": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.29.7.tgz",
+ "integrity": "sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-replace-supers": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.29.7.tgz",
+ "integrity": "sha512-atfGXWSeCiF4DnKZIfmJfQRkSw9b9gNNXR1kqKjbhG4pGYCOnkp8OcTB8E3NXjBu8NpheSnOeNKz8KT7UNFTmQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@babel/helper-member-expression-to-functions": "^7.29.7",
+ "@babel/helper-optimise-call-expression": "^7.29.7",
+ "@babel/traverse": "^7.29.7"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0"
+ }
+ },
+ "node_modules/@babel/helper-skip-transparent-expression-wrappers": {
+ "version": "7.29.13",
+ "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.29.13.tgz",
+ "integrity": "sha512-Abm4rKIH0tmCayJLwcoeOkdzpYUphTbO52fHhyEBHn7S0R+ni4epNLI/8nq1L0DN2Bl0u5qmgWm2Og/z4fBb+Q==",
+ "license": "MIT",
+ "dependencies": {
+ "@babel/traverse": "^7.29.13",
+ "@babel/types": "^7.29.11"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-string-parser": {
+ "version": "7.29.14",
+ "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.14.tgz",
+ "integrity": "sha512-CXvKMFvM80ihI7Vox9jb+kQjnyjESQNPM+vB7U0Zz6TWuZA+Z/FL0QPMH300h33qJtIx+REeBhXqWOPW48TcAQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-validator-identifier": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz",
+ "integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-validator-option": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.29.7.tgz",
+ "integrity": "sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helpers": {
+ "version": "7.29.14",
+ "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.14.tgz",
+ "integrity": "sha512-6E3Mi1r0B0umq6vmZa4/78q+64fqO2YY0THUdjDPKUCKhNb0yQy5NQIaPHCSD3ryTgiTss//P4JsWS80AsZ6LQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@babel/template": "^7.29.7",
+ "@babel/types": "^7.29.14"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/parser": {
+ "version": "7.29.14",
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.14.tgz",
+ "integrity": "sha512-VL220vXuyO2z3rNIQwY7ftj9UwpqOt+33sH+sBWkOekbsSR2g7EEMnOx24ZlCH0xOA3DM/33SifVFGbnJD8r/w==",
+ "license": "MIT",
+ "dependencies": {
+ "@babel/types": "^7.29.14"
+ },
+ "bin": {
+ "parser": "bin/babel-parser.js"
+ },
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/@babel/plugin-syntax-jsx": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.29.7.tgz",
+ "integrity": "sha512-TSu8+mHCoEaaCDEZ0I3+6mvTBYR4PCxQwf2z9/r5Tbztv6NaLR3B9thGTTxX2WGuGHJqRiAbKPeGTJ5XWXVg6A==",
+ "license": "MIT",
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.29.7"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-syntax-typescript": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.29.7.tgz",
+ "integrity": "sha512-ngr+82Sh0xMz25TPCZi+nC2iTzjfCdWS2ONXTp/PtSCHCgaCNBpdMqgvJ2ccdLlClVZ7sisIgB914j/JFe+RZA==",
+ "license": "MIT",
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.29.7"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-modules-commonjs": {
+ "version": "7.29.14",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.29.14.tgz",
+ "integrity": "sha512-mbv2yy5dqP6e3DbusCx+5AypXkFbyJD/JhG4/XhA+BIADOw5o7W+X0ewSp/h3w7gRL3oR5yny2/K8ljiydj4uA==",
+ "license": "MIT",
+ "dependencies": {
+ "@babel/helper-module-transforms": "^7.29.14",
+ "@babel/helper-plugin-utils": "^7.29.7"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-typescript": {
+ "version": "7.29.9",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.29.9.tgz",
+ "integrity": "sha512-FFwIwzU+7SCOuxxV4YtJql6T9981ZVTm+FHO5GhVsRqCTdy0WwrEZh3l42ARpXruJUDGOptdduHW6Zr7pNPLNg==",
+ "license": "MIT",
+ "dependencies": {
+ "@babel/helper-annotate-as-pure": "^7.29.7",
+ "@babel/helper-create-class-features-plugin": "^7.29.7",
+ "@babel/helper-plugin-utils": "^7.29.7",
+ "@babel/helper-skip-transparent-expression-wrappers": "^7.29.7",
+ "@babel/plugin-syntax-typescript": "^7.29.7"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/preset-typescript": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.29.7.tgz",
+ "integrity": "sha512-/Foi8vKY2EVbed/1eZx0gJEEwHAIxogrySI7rULcRIvhZzbvoE/b5qG5Ghc0WKAFKOHA9SD1x7RsFlOYdutIiQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.29.7",
+ "@babel/helper-validator-option": "^7.29.7",
+ "@babel/plugin-syntax-jsx": "^7.29.7",
+ "@babel/plugin-transform-modules-commonjs": "^7.29.7",
+ "@babel/plugin-transform-typescript": "^7.29.7"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/runtime": {
+ "version": "7.29.14",
+ "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.29.14.tgz",
+ "integrity": "sha512-Y5tqevQaUAZhhj82BpYMNC1ssvLQTVAfwKdm8iy8qwmhvC2/CpcAu8OC+QEtjM7pMk7knx83u1Qj8gzkicyelw==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/template": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.29.7.tgz",
+ "integrity": "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg==",
+ "license": "MIT",
+ "dependencies": {
+ "@babel/code-frame": "^7.29.7",
+ "@babel/parser": "^7.29.7",
+ "@babel/types": "^7.29.7"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/traverse": {
+ "version": "7.29.14",
+ "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.14.tgz",
+ "integrity": "sha512-RAdQJrBgmIH1FWvN0X+1hoDxzMzlP4cv/1Zi4dn4tG1H0cTb+rw7CzUxQJhp1f4ANd8j5vH3fy8BAWFGkBDEsA==",
+ "license": "MIT",
+ "dependencies": {
+ "@babel/code-frame": "^7.29.7",
+ "@babel/generator": "^7.29.14",
+ "@babel/helper-globals": "^7.29.7",
+ "@babel/parser": "^7.29.14",
+ "@babel/template": "^7.29.7",
+ "@babel/types": "^7.29.14",
+ "debug": "^4.3.1"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/types": {
+ "version": "7.29.14",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.14.tgz",
+ "integrity": "sha512-UjI/dKmwJwT9pOszJitq2G6EObZPnsZUfdCr92z2TlF3EZK9J3EdfOKUrCzHl6wFthbzwhzl1Soc/UIwxRiq6w==",
+ "license": "MIT",
+ "dependencies": {
+ "@babel/helper-string-parser": "^7.29.14",
+ "@babel/helper-validator-identifier": "^7.29.7"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@base-ui/react": {
+ "version": "1.9.0",
+ "resolved": "https://registry.npmjs.org/@base-ui/react/-/react-1.9.0.tgz",
+ "integrity": "sha512-S8CSYosASBKtpL8SWUfS78rFElfLijiCgA7oHOK22jCJ95FULsYyKwBNFOgudt0RA+/7yNc7F81bOvQnRgbBiQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@babel/runtime": "^7.29.7 || ^8.0.0",
+ "@base-ui/utils": "0.5.0",
+ "@floating-ui/react-dom": "^2.1.9",
+ "@floating-ui/utils": "^0.2.12",
+ "use-sync-external-store": "^1.7.0"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/mui-org"
+ },
+ "peerDependencies": {
+ "@date-fns/tz": "^1.2.0",
+ "@types/react": "^17 || ^18 || ^19",
+ "date-fns": "^4.0.0",
+ "react": "^17 || ^18 || ^19",
+ "react-dom": "^17 || ^18 || ^19"
+ },
+ "peerDependenciesMeta": {
+ "@date-fns/tz": {
+ "optional": true
+ },
+ "@types/react": {
+ "optional": true
+ },
+ "date-fns": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@base-ui/utils": {
+ "version": "0.5.0",
+ "resolved": "https://registry.npmjs.org/@base-ui/utils/-/utils-0.5.0.tgz",
+ "integrity": "sha512-dYGGcEttjkYiMoa5nHm8vLaJ2UcuTWxo3BFAwOYXeRg/q7UVVvA6cacEIXEs3FgBfK1CGtW1ptElqs7wsx+t9A==",
+ "license": "MIT",
+ "dependencies": {
+ "@babel/runtime": "^7.29.7 || ^8.0.0",
+ "@floating-ui/utils": "^0.2.12",
+ "reselect": "^5.3.0",
+ "use-sync-external-store": "^1.7.0"
+ },
+ "peerDependencies": {
+ "@types/react": "^17 || ^18 || ^19",
+ "react": "^17 || ^18 || ^19",
+ "react-dom": "^17 || ^18 || ^19"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@dotenvx/dotenvx": {
+ "version": "1.75.1",
+ "resolved": "https://registry.npmjs.org/@dotenvx/dotenvx/-/dotenvx-1.75.1.tgz",
+ "integrity": "sha512-/BITOC9dmS/edY2zQwZNicQ059O6RKabtQfyEafV0nGtfYRNHYy1DIPiYVcov40+tob9hfmBnbR963dS+EQ1DQ==",
+ "license": "BSD-3-Clause",
+ "dependencies": {
+ "@dotenvx/primitives": "^0.8.0",
+ "commander": "^11.1.0",
+ "conf": "^10.2.0",
+ "dotenv": "^17.2.1",
+ "enquirer": "^2.4.1",
+ "env-paths": "^2.2.1",
+ "execa": "^5.1.1",
+ "fdir": "^6.2.0",
+ "ignore": "^5.3.0",
+ "object-treeify": "1.1.33",
+ "open": "^8.4.2",
+ "picomatch": "^4.0.4",
+ "systeminformation": "^5.22.11",
+ "undici": "^7.11.0",
+ "which": "^4.0.0",
+ "yocto-spinner": "^1.1.0"
+ },
+ "bin": {
+ "dotenvx": "src/cli/dotenvx.js"
+ },
+ "funding": {
+ "url": "https://dotenvx.com"
+ }
+ },
+ "node_modules/@dotenvx/dotenvx/node_modules/commander": {
+ "version": "11.1.0",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz",
+ "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=16"
+ }
+ },
+ "node_modules/@dotenvx/dotenvx/node_modules/define-lazy-prop": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz",
+ "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/@dotenvx/dotenvx/node_modules/execa": {
+ "version": "5.1.1",
+ "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz",
+ "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==",
+ "license": "MIT",
+ "dependencies": {
+ "cross-spawn": "^7.0.3",
+ "get-stream": "^6.0.0",
+ "human-signals": "^2.1.0",
+ "is-stream": "^2.0.0",
+ "merge-stream": "^2.0.0",
+ "npm-run-path": "^4.0.1",
+ "onetime": "^5.1.2",
+ "signal-exit": "^3.0.3",
+ "strip-final-newline": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sindresorhus/execa?sponsor=1"
+ }
+ },
+ "node_modules/@dotenvx/dotenvx/node_modules/get-stream": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz",
+ "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/@dotenvx/dotenvx/node_modules/human-signals": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz",
+ "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==",
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=10.17.0"
+ }
+ },
+ "node_modules/@dotenvx/dotenvx/node_modules/is-docker": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz",
+ "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==",
+ "license": "MIT",
+ "bin": {
+ "is-docker": "cli.js"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/@dotenvx/dotenvx/node_modules/is-stream": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz",
+ "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/@dotenvx/dotenvx/node_modules/is-wsl": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz",
+ "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==",
+ "license": "MIT",
+ "dependencies": {
+ "is-docker": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/@dotenvx/dotenvx/node_modules/npm-run-path": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz",
+ "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==",
+ "license": "MIT",
+ "dependencies": {
+ "path-key": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/@dotenvx/dotenvx/node_modules/open": {
+ "version": "8.4.2",
+ "resolved": "https://registry.npmjs.org/open/-/open-8.4.2.tgz",
+ "integrity": "sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==",
+ "license": "MIT",
+ "dependencies": {
+ "define-lazy-prop": "^2.0.0",
+ "is-docker": "^2.1.1",
+ "is-wsl": "^2.2.0"
+ },
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/@dotenvx/dotenvx/node_modules/signal-exit": {
+ "version": "3.0.7",
+ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz",
+ "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==",
+ "license": "ISC"
+ },
+ "node_modules/@dotenvx/dotenvx/node_modules/strip-final-newline": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz",
+ "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/@dotenvx/dotenvx/node_modules/undici": {
+ "version": "7.30.2",
+ "resolved": "https://registry.npmjs.org/undici/-/undici-7.30.2.tgz",
+ "integrity": "sha512-mLyPQnHwUxaM/rideoK/+KL8DaAJLRl4aBCfmX444aCSLnIaomqPLtNRe2jdCYcsk5wZzXrDIQC8ZeYNRAYyIA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=20.18.1"
+ }
+ },
+ "node_modules/@dotenvx/primitives": {
+ "version": "0.8.0",
+ "resolved": "https://registry.npmjs.org/@dotenvx/primitives/-/primitives-0.8.0.tgz",
+ "integrity": "sha512-VYJy0uhFm9zTJ1TxBaW/pA8bjbOM/OttaNMwZ1RHG4JKyRG7DhSdiqD1ipQoAyoD22olUtxbP78W9xY3Wd11bg==",
+ "license": "BSD-3-Clause"
+ },
+ "node_modules/@emnapi/core": {
+ "version": "2.0.0-beta.2",
+ "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-2.0.0-beta.2.tgz",
+ "integrity": "sha512-MzCVoWtcg4Pm2B3je5mMvYMvj3MmBKw+fU7vbsJc9/iT8ip6/eYIHo/Dsm/mr+wsHB6SEyJDuxB09Yy6r/8+4A==",
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "@emnapi/wasi-threads": "2.2.0",
+ "tslib": "^2.4.0"
+ }
+ },
+ "node_modules/@emnapi/runtime": {
+ "version": "2.0.0-beta.2",
+ "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-2.0.0-beta.2.tgz",
+ "integrity": "sha512-JcrSPzPvZuNZvJqPTF9Fw25LbOJ8avzFVlaf2grmH4Cku0oGP47tRgqPZadcfj3YoZMHkFVnCYFbQM8I+i5QEw==",
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "tslib": "^2.4.0"
+ }
+ },
+ "node_modules/@emnapi/wasi-threads": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-2.2.0.tgz",
+ "integrity": "sha512-JP7OYH38Q7+pyTAe14raZHLQIK7BDKbdwji+Xi3pcd/6QkJYQH3SX4wu6EplGrGJWRepoNzedfm0G3B9Z4e9Rw==",
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "tslib": "^2.4.0"
+ }
+ },
+ "node_modules/@exodus/bytes": {
+ "version": "1.16.0",
+ "resolved": "https://registry.npmjs.org/@exodus/bytes/-/bytes-1.16.0.tgz",
+ "integrity": "sha512-IcpW84uEn3N7ETtNZMlxKhfl6Pec8rUNGOTBtWbK1FKhJxIFAptZyVrvVRVBimAJxJCgc3PxepxkdWWG4DVzfA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "^20.19.0 || ^22.12.0 || >=24.0.0"
+ },
+ "peerDependencies": {
+ "@noble/hashes": "^1.8.0 || ^2.0.0"
+ },
+ "peerDependenciesMeta": {
+ "@noble/hashes": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@floating-ui/core": {
+ "version": "1.8.0",
+ "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.8.0.tgz",
+ "integrity": "sha512-0CIZ5itps/8x7BG8dEIhs53BvCUH2PCoogtakwRTut+Arm58sJooJ0AuZhLw2HJYIR5cMLNPBSS728sPho2khQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@floating-ui/utils": "^0.2.12"
+ }
+ },
+ "node_modules/@floating-ui/dom": {
+ "version": "1.8.0",
+ "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.8.0.tgz",
+ "integrity": "sha512-yXSrzeHZBTZadLOlfyhCkJHNeLJnHRnRInwdZ40L7ZiaAtrBwoYlsDrX3v5zB1Utk7CLfzcOVnVVWoXEky7Ceg==",
+ "license": "MIT",
+ "dependencies": {
+ "@floating-ui/core": "^1.8.0",
+ "@floating-ui/utils": "^0.2.12"
+ }
+ },
+ "node_modules/@floating-ui/react-dom": {
+ "version": "2.1.9",
+ "resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.1.9.tgz",
+ "integrity": "sha512-JDjEFGCpImxDCA7JJKviA0M9+RtmJdj0m/NVU5IMgBK+AmZouAQQ7/+2GLH0GXXY0YMw9oXPB8hKdbPYg5QLYg==",
+ "license": "MIT",
+ "dependencies": {
+ "@floating-ui/dom": "^1.8.0"
+ },
+ "peerDependencies": {
+ "react": ">=16.8.0",
+ "react-dom": ">=16.8.0"
+ }
+ },
+ "node_modules/@floating-ui/utils": {
+ "version": "0.2.12",
+ "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.12.tgz",
+ "integrity": "sha512-HpCo8tmWzLVad5s2d19EhAz5zqrrQ6s69qd6moPMQvkOuSwDT1YgRfWSVuc4ennqrgv3OHppiOGMQ7oC13yIww==",
+ "license": "MIT"
+ },
+ "node_modules/@fontsource/figtree": {
+ "version": "5.3.0",
+ "resolved": "https://registry.npmjs.org/@fontsource/figtree/-/figtree-5.3.0.tgz",
+ "integrity": "sha512-/iTcTXL1eRBGhvD7NN9dnKzXzWqDLVZVEUFI9xIxAC1G/hXU8tCyYeXCAuPOuvSYPInFUP7H6KLGgygmDfy1SA==",
+ "license": "OFL-1.1",
+ "funding": {
+ "url": "https://github.com/sponsors/ayuhito"
+ }
+ },
+ "node_modules/@fontsource/fraunces": {
+ "version": "5.3.0",
+ "resolved": "https://registry.npmjs.org/@fontsource/fraunces/-/fraunces-5.3.0.tgz",
+ "integrity": "sha512-LEHTOBiZufQzAvnAe2rZ8ZknbDS28Q9kzwb0L+gZJEmjLGr8hhZ/5NuHXwDuHBWhVXYoiGGXmrb0H6Ko/RrHTg==",
+ "license": "OFL-1.1",
+ "funding": {
+ "url": "https://github.com/sponsors/ayuhito"
+ }
+ },
+ "node_modules/@jridgewell/gen-mapping": {
+ "version": "0.3.13",
+ "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz",
+ "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==",
+ "license": "MIT",
+ "dependencies": {
+ "@jridgewell/sourcemap-codec": "^1.5.0",
+ "@jridgewell/trace-mapping": "^0.3.24"
+ }
+ },
+ "node_modules/@jridgewell/remapping": {
+ "version": "2.3.5",
+ "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz",
+ "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@jridgewell/gen-mapping": "^0.3.5",
+ "@jridgewell/trace-mapping": "^0.3.24"
+ }
+ },
+ "node_modules/@jridgewell/resolve-uri": {
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz",
+ "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/@jridgewell/sourcemap-codec": {
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz",
+ "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==",
+ "license": "MIT"
+ },
+ "node_modules/@jridgewell/trace-mapping": {
+ "version": "0.3.31",
+ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz",
+ "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==",
+ "license": "MIT",
+ "dependencies": {
+ "@jridgewell/resolve-uri": "^3.1.0",
+ "@jridgewell/sourcemap-codec": "^1.4.14"
+ }
+ },
+ "node_modules/@modelcontextprotocol/core": {
+ "version": "2.4.0",
+ "resolved": "https://registry.npmjs.org/@modelcontextprotocol/core/-/core-2.4.0.tgz",
+ "integrity": "sha512-z8QBKqdfXLPzkLQuG4xp8hrVEMm1PZ1IgxMN2sMbJiFiAKOWXnAzogXn2W4aqIBlP1ea6U5yiqVquvUNM1Cj6Q==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "zod": "^4.2.0"
+ },
+ "engines": {
+ "node": ">=20"
+ }
+ },
+ "node_modules/@modelcontextprotocol/server": {
+ "version": "2.4.0",
+ "resolved": "https://registry.npmjs.org/@modelcontextprotocol/server/-/server-2.4.0.tgz",
+ "integrity": "sha512-rgR9yxSaAJ+bcsi/XroT/S2AfPiIWloXAnrdfYSCms9ivVju0ishu/wW0J21Ho6+ZOR1r7RyeRbjiRuF87ix5Q==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@modelcontextprotocol/core": "2.4.0",
+ "zod": "^4.2.0"
+ },
+ "engines": {
+ "node": ">=20"
+ }
+ },
+ "node_modules/@napi-rs/wasm-runtime": {
+ "version": "1.2.6",
+ "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.2.6.tgz",
+ "integrity": "sha512-mRyDmEw9/fCDXCGfL1sbgIw/GUK0PVxRW4YwgPN61F3LQ+fSyoBFarJVzgGyhF6kRzEQZ0FejDqm4WLXSeqQmw==",
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "@tybys/wasm-util": "^0.10.3"
+ },
+ "engines": {
+ "node": "^20.19.0 || ^22.13.0 || >=23.5.0"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/Brooooooklyn"
+ },
+ "peerDependencies": {
+ "@emnapi/core": "^1.7.1 || 2.0.0-beta.2",
+ "@emnapi/runtime": "^1.7.1 || 2.0.0-beta.2"
+ }
+ },
+ "node_modules/@nodelib/fs.scandir": {
+ "version": "2.1.5",
+ "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
+ "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==",
+ "license": "MIT",
+ "dependencies": {
+ "@nodelib/fs.stat": "2.0.5",
+ "run-parallel": "^1.1.9"
+ },
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/@nodelib/fs.stat": {
+ "version": "2.0.5",
+ "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz",
+ "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/@nodelib/fs.walk": {
+ "version": "1.2.8",
+ "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz",
+ "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==",
+ "license": "MIT",
+ "dependencies": {
+ "@nodelib/fs.scandir": "2.1.5",
+ "fastq": "^1.6.0"
+ },
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/@oxc-project/types": {
+ "version": "0.156.0",
+ "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.156.0.tgz",
+ "integrity": "sha512-1Duyg48TdJNdyhEB8Xn1L36bT9Pv6GUtlKjHxOys8xkaF/rQq3XJE+bAurSK/AgIz5mGFsb77cn9Pb20+WCScw==",
+ "dev": true,
+ "license": "MIT",
+ "funding": {
+ "url": "https://github.com/sponsors/oxc-project"
+ }
+ },
+ "node_modules/@oxlint/binding-android-arm-eabi": {
+ "version": "1.93.0",
+ "resolved": "https://registry.npmjs.org/@oxlint/binding-android-arm-eabi/-/binding-android-arm-eabi-1.93.0.tgz",
+ "integrity": "sha512-KKw70pbD5Pvq3G2lJ+WQ71XPMjCmg37rkSe2+mDqCRP3PoTSdDMuEi4UOnE8JBtyNM7bek61EC2s0Jt7S7u+Sg==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": "^20.19.0 || >=22.12.0"
+ }
+ },
+ "node_modules/@oxlint/binding-android-arm64": {
+ "version": "1.93.0",
+ "resolved": "https://registry.npmjs.org/@oxlint/binding-android-arm64/-/binding-android-arm64-1.93.0.tgz",
+ "integrity": "sha512-fvr1fTUZGelwRxKDt64pf28aL1WaWgviwz3X+E/FcRYvrlEahH0NECRz/c1SY+K+KWmZk5uAf6h1kQnyBkp/2A==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": "^20.19.0 || >=22.12.0"
+ }
+ },
+ "node_modules/@oxlint/binding-darwin-arm64": {
+ "version": "1.93.0",
+ "resolved": "https://registry.npmjs.org/@oxlint/binding-darwin-arm64/-/binding-darwin-arm64-1.93.0.tgz",
+ "integrity": "sha512-VdvSN9JRf4Es6ZzoAdvEeh8tgKdw8L4H82WmA8MMPVfPdZGCwE/nI27Z1HrRHYQhPxOh4kmnxQEioSUFrOvDaw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": "^20.19.0 || >=22.12.0"
+ }
+ },
+ "node_modules/@oxlint/binding-darwin-x64": {
+ "version": "1.93.0",
+ "resolved": "https://registry.npmjs.org/@oxlint/binding-darwin-x64/-/binding-darwin-x64-1.93.0.tgz",
+ "integrity": "sha512-QR1V890Ml0YGRG0F/iV0K9igG+pOhe+VWd+aZnxY849rRHZf3F2gEoQks5+GVHf105X9Mh/6HdShTP5juekG2g==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": "^20.19.0 || >=22.12.0"
+ }
+ },
+ "node_modules/@oxlint/binding-freebsd-x64": {
+ "version": "1.93.0",
+ "resolved": "https://registry.npmjs.org/@oxlint/binding-freebsd-x64/-/binding-freebsd-x64-1.93.0.tgz",
+ "integrity": "sha512-jDfIbi30zZaKi+rTvig3sge+Xhi8pFFSgHxb0jzovc4qh8ETm/irKV9c7N/JsuwnYc5sbvf4IC8w1vQQ0IL+BA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": "^20.19.0 || >=22.12.0"
+ }
+ },
+ "node_modules/@oxlint/binding-linux-arm-gnueabihf": {
+ "version": "1.93.0",
+ "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.93.0.tgz",
+ "integrity": "sha512-qtxZ714ND/koFgVH00QgxlzZiIbRPmguaPhnHRU5DFFtrtEdOrSnZD4U/H2AzXrXkZ59eQbMBnJwbum5XohrIQ==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": "^20.19.0 || >=22.12.0"
+ }
+ },
+ "node_modules/@oxlint/binding-linux-arm-musleabihf": {
+ "version": "1.93.0",
+ "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-1.93.0.tgz",
+ "integrity": "sha512-5pJ9NjMvH7WMUqXB6bTTOSemBm39w2cod27Hu3+Yom/GhbTeNXlYcpDx1o4CgBP6fhp0YHG66TNdVaUm6sHjsA==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": "^20.19.0 || >=22.12.0"
+ }
+ },
+ "node_modules/@oxlint/binding-linux-arm64-gnu": {
+ "version": "1.93.0",
+ "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.93.0.tgz",
+ "integrity": "sha512-pRf+7jtbt2fHE23SX7qBxRgnBZicUgsoCK1PVIjnOk+t3a6UBkpt/GrKI99WlxsKUxftz/5nv/kfKvScmYywkw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "libc": [
+ "glibc"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": "^20.19.0 || >=22.12.0"
+ }
+ },
+ "node_modules/@oxlint/binding-linux-arm64-musl": {
+ "version": "1.93.0",
+ "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.93.0.tgz",
+ "integrity": "sha512-zM8Fd/K8sqGvsBcJBZ3oVZ3ctGWbszA08IaGt5gFFF5RcunppAI/ZnAXbouABvnWeJ//S44KKlfPZnDDbeiphg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "libc": [
+ "musl"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": "^20.19.0 || >=22.12.0"
+ }
+ },
+ "node_modules/@oxlint/binding-linux-ppc64-gnu": {
+ "version": "1.93.0",
+ "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.93.0.tgz",
+ "integrity": "sha512-7qKCnvhZKDXJG2pdbLazd2hw4FxjJHbZOFrrbzyy5PdHfPLH9vnNUa1le01A8uItZuYKPBPncH+HCoEiFT4SgA==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "libc": [
+ "glibc"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": "^20.19.0 || >=22.12.0"
+ }
+ },
+ "node_modules/@oxlint/binding-linux-riscv64-gnu": {
+ "version": "1.93.0",
+ "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-1.93.0.tgz",
+ "integrity": "sha512-2pgulxC6G8V5wE750NJE/fRkf9aO6i6yoj10wyaR2EdiNtan4OemsOtsQ0ZTXGdY8Q3IoTmlND3GYvjJsvikYg==",
+ "cpu": [
+ "riscv64"
+ ],
+ "dev": true,
+ "libc": [
+ "glibc"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": "^20.19.0 || >=22.12.0"
+ }
+ },
+ "node_modules/@oxlint/binding-linux-riscv64-musl": {
+ "version": "1.93.0",
+ "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-1.93.0.tgz",
+ "integrity": "sha512-yWsn6Gg2PnGG5jlyDz5+pHGiMTMiy4adaa4WRMzDgzB8efaShk1JMmTHIBSVLQMh0tYXRs4CN5uJCO79r4Mi4g==",
+ "cpu": [
+ "riscv64"
+ ],
+ "dev": true,
+ "libc": [
+ "musl"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": "^20.19.0 || >=22.12.0"
+ }
+ },
+ "node_modules/@oxlint/binding-linux-s390x-gnu": {
+ "version": "1.93.0",
+ "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.93.0.tgz",
+ "integrity": "sha512-WCn5plwp/ezS2RDPQKp0/EXEVRr9/dDexUdRKmsMFqzNM5xBSZ1wbsi3PuMk1VfkMRnI5BuazCsziCWMXRDOlw==",
+ "cpu": [
+ "s390x"
+ ],
+ "dev": true,
+ "libc": [
+ "glibc"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": "^20.19.0 || >=22.12.0"
+ }
+ },
+ "node_modules/@oxlint/binding-linux-x64-gnu": {
+ "version": "1.93.0",
+ "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.93.0.tgz",
+ "integrity": "sha512-F2CGjb9LAkzH+IYTZSzd1klQ1vk5z6Utjax64WeLByCkYXbVDbsun+Oy2hLfW2MDSKCvW+jwy/9ld0EPgdeu+A==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "libc": [
+ "glibc"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": "^20.19.0 || >=22.12.0"
+ }
+ },
+ "node_modules/@oxlint/binding-linux-x64-musl": {
+ "version": "1.93.0",
+ "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-x64-musl/-/binding-linux-x64-musl-1.93.0.tgz",
+ "integrity": "sha512-plf5DE2objcG8Tf7mXRuRa8tT8rzDkpjqXQtKoGsKHWkpgsialbON1+cCtoSEUTVbQUjXvuAm8vV9+3rR0yCBw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "libc": [
+ "musl"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": "^20.19.0 || >=22.12.0"
+ }
+ },
+ "node_modules/@oxlint/binding-openharmony-arm64": {
+ "version": "1.93.0",
+ "resolved": "https://registry.npmjs.org/@oxlint/binding-openharmony-arm64/-/binding-openharmony-arm64-1.93.0.tgz",
+ "integrity": "sha512-Kp2yJrKvoTe9FfKdO/xwLNUbs2bYTMKx0+aoQD1s0h/Tx0kSgtHSdGmrk8tTKdluosjFbo88qYRIaNIX43AfFw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openharmony"
+ ],
+ "engines": {
+ "node": "^20.19.0 || >=22.12.0"
+ }
+ },
+ "node_modules/@oxlint/binding-win32-arm64-msvc": {
+ "version": "1.93.0",
+ "resolved": "https://registry.npmjs.org/@oxlint/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.93.0.tgz",
+ "integrity": "sha512-vigjcHCFsR6KjnWTEVfaCxcMYapEuaK9FZa1MpewwQ1S+Xud3v0okfkj1RySsD6RF1NRHIjSlQSalTnKIaj3nA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": "^20.19.0 || >=22.12.0"
+ }
+ },
+ "node_modules/@oxlint/binding-win32-ia32-msvc": {
+ "version": "1.93.0",
+ "resolved": "https://registry.npmjs.org/@oxlint/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-1.93.0.tgz",
+ "integrity": "sha512-0Ot3BEe/AAr2/uQhe55r8CmPlperYk2mQmxdutOru7oU0kir6IiEVHb1TG3GORRlfra97lPHVDLhgmihiKzLrg==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": "^20.19.0 || >=22.12.0"
+ }
+ },
+ "node_modules/@oxlint/binding-win32-x64-msvc": {
+ "version": "1.93.0",
+ "resolved": "https://registry.npmjs.org/@oxlint/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.93.0.tgz",
+ "integrity": "sha512-ZzzIIVs/Qkm8trUWYKF0OYub5ALlv50/3gsEZbKAvWgz+yNJX6uRmQ8ySPXU2Q0/Y9m4JCOjhpmC8XUYbPHX5Q==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": "^20.19.0 || >=22.12.0"
+ }
+ },
+ "node_modules/@rolldown/binding-android-arm-eabi": {
+ "version": "1.2.19",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm-eabi/-/binding-android-arm-eabi-1.2.19.tgz",
+ "integrity": "sha512-e+Ebe0WT+9tbXmNKPIiC8YrWAHYwug3m6i4p3rZGGulfZri1jtI4HslT+OZnFf/OIHowWF71DTlHwXBP2SiA7A==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": "^20.19.0 || >=22.12.0"
+ }
+ },
+ "node_modules/@rolldown/binding-android-arm64": {
+ "version": "1.2.19",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.2.19.tgz",
+ "integrity": "sha512-hOombrTJ+szt2ciEzS7oCA78lMPBgF5UMQWCJIyNfnrI7GLl8HYoFqCnpL2gcPOaXMqryGCU5ExdQKyDDcC+yA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": "^20.19.0 || >=22.12.0"
+ }
+ },
+ "node_modules/@rolldown/binding-darwin-arm64": {
+ "version": "1.2.19",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.2.19.tgz",
+ "integrity": "sha512-XoMA2pwCKGTQzUjPgtRwkedH4WmXhdIPKT6l6oOxd1PUbNodGI6DcBekgN7EC//+x3pfBYX/qL1gNmZAqivw5g==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": "^20.19.0 || >=22.12.0"
+ }
+ },
+ "node_modules/@rolldown/binding-darwin-x64": {
+ "version": "1.2.19",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.2.19.tgz",
+ "integrity": "sha512-zo8EsSSwMZCY/e+fRnGaX02YGgvJD0yvhNi/9hpGPA2MJ9ZF8dPCw75UGfpI6OpQ/myR/dIYmogRvqiZD0TrXg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": "^20.19.0 || >=22.12.0"
+ }
+ },
+ "node_modules/@rolldown/binding-freebsd-x64": {
+ "version": "1.2.19",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.2.19.tgz",
+ "integrity": "sha512-O8ISAOfI1nj7AuBPd30FSF47z7f7lzlk5poQVGgiikvQuGEBFYvW8ki+UEnT+YJPnNGjQzn304klt4O9FUE7mA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": "^20.19.0 || >=22.12.0"
+ }
+ },
+ "node_modules/@rolldown/binding-linux-arm-gnueabihf": {
+ "version": "1.2.19",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.2.19.tgz",
+ "integrity": "sha512-/lYCba5NO0yq4S0jGMH8QTBtkvQxoXjoQWzF5BcWp9MjB9jxVRD1GQDNofkVjcOj30DWyhLIN/4Oe60JKzaONw==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": "^20.19.0 || >=22.12.0"
+ }
+ },
+ "node_modules/@rolldown/binding-linux-arm64-gnu": {
+ "version": "1.2.19",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.2.19.tgz",
+ "integrity": "sha512-pm/apFMBnSbFb3O6nG5pHO1iqHhZrjGDFEjSm+ot9J17XXPvH9L90y5h+jgfHCE+Qdlsvy8qKEcU4VKxgjD+vA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "libc": [
+ "glibc"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": "^20.19.0 || >=22.12.0"
+ }
+ },
+ "node_modules/@rolldown/binding-linux-arm64-musl": {
+ "version": "1.2.19",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.2.19.tgz",
+ "integrity": "sha512-K1SmQp3FFichn8oqrNIwvFoZ5wcvjC7goBzpaMNvLf9FZc+QB/QvLmnpJZgAAGHiD980tP8FZZnXk2K94rvlxg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "libc": [
+ "musl"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": "^20.19.0 || >=22.12.0"
+ }
+ },
+ "node_modules/@rolldown/binding-linux-ppc64-gnu": {
+ "version": "1.2.19",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.2.19.tgz",
+ "integrity": "sha512-I0xwD57jP/3A7+5UPZin2w8Y7XHEmEM5zqpYZOcQ45MlNW6tUJUziymV3yRr7rL4vwyfEcRsRksC4a7Kc08p5Q==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "libc": [
+ "glibc"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": "^20.19.0 || >=22.12.0"
+ }
+ },
+ "node_modules/@rolldown/binding-linux-s390x-gnu": {
+ "version": "1.2.19",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.2.19.tgz",
+ "integrity": "sha512-BrtEHT24SNXj9HiXqy+s/kXiSiQGt6EKCPUlRirAoIioVxKGnbXBUEkbZASAei7iZJB0/Ynm+0JP00Ipx7AnSw==",
+ "cpu": [
+ "s390x"
+ ],
+ "dev": true,
+ "libc": [
+ "glibc"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": "^20.19.0 || >=22.12.0"
+ }
+ },
+ "node_modules/@rolldown/binding-linux-x64-gnu": {
+ "version": "1.2.19",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.2.19.tgz",
+ "integrity": "sha512-rm75/9DkHKeU2WnA8w4X94WGYgLlDCFCfkQC+4bguVJmC/jvDRv2B+2wLOYhyE0fVuv7//Ckk39OoOufyCu76Q==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "libc": [
+ "glibc"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": "^20.19.0 || >=22.12.0"
+ }
+ },
+ "node_modules/@rolldown/binding-linux-x64-musl": {
+ "version": "1.2.19",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.2.19.tgz",
+ "integrity": "sha512-irh/4+iYFM4GAzpluDErgjz89bj6NDtqqMAG/6O1LG38Ed3NpyebzCpcVNkFW8uhy+/3/BocUvnXDR33CXWe9A==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "libc": [
+ "musl"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": "^20.19.0 || >=22.12.0"
+ }
+ },
+ "node_modules/@rolldown/binding-openharmony-arm64": {
+ "version": "1.2.19",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.2.19.tgz",
+ "integrity": "sha512-+KWTWNoPt+CfSq94CiceWu3yPE+QzkaG+phPyz9G60tmZLwfQkcA4AeksafzvJAw4pvg1mcd5a1TkUqVv0s4JA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openharmony"
+ ],
+ "engines": {
+ "node": "^20.19.0 || >=22.12.0"
+ }
+ },
+ "node_modules/@rolldown/binding-wasm32-wasi": {
+ "version": "1.2.19",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.2.19.tgz",
+ "integrity": "sha512-7EH+skOsl5qpWnK0vzamgJFhOv1cwxQpsxm8tI883K9fur5c27p8q87fzEO6BbBPabA2/+s/zR63/pLc137iOg==",
+ "cpu": [
+ "wasm32"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "@emnapi/core": "2.0.0-beta.2",
+ "@emnapi/runtime": "2.0.0-beta.2",
+ "@napi-rs/wasm-runtime": "1.2.6"
+ },
+ "engines": {
+ "node": "^20.19.0 || ^22.13.0 || >=23.5.0"
+ }
+ },
+ "node_modules/@rolldown/binding-win32-arm64-msvc": {
+ "version": "1.2.19",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.2.19.tgz",
+ "integrity": "sha512-3Q1Yg1Q7tEvBWoZf5rFvG/GKZQPgwfru+p4wBajDfJFBs0SHCpL++dfTjW9gyAKd1T7ZpIYvdaUax7Pa/IhFVQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": "^20.19.0 || >=22.12.0"
+ }
+ },
+ "node_modules/@rolldown/binding-win32-x64-msvc": {
+ "version": "1.2.19",
+ "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.2.19.tgz",
+ "integrity": "sha512-y/sqRRc6d7hECzOFc5n3LSeqctmIp9mMjY1Kq4s14uLPd/LZ4z7i1zrW6fMtp2mPeuQIC4e6ULMcwQzMomqQag==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": "^20.19.0 || >=22.12.0"
+ }
+ },
+ "node_modules/@rolldown/pluginutils": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.1.0.tgz",
+ "integrity": "sha512-K+NU2HDCEem4sClgHH4ZZXwdJeNFkJo+hRk479DIwdIviAPN2hFJH1KHHwg8CxHQXvi0M5XY4deTXINfIiSG6w==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@sec-ant/readable-stream": {
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/@sec-ant/readable-stream/-/readable-stream-0.4.1.tgz",
+ "integrity": "sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg==",
+ "license": "MIT"
+ },
+ "node_modules/@shadcn/registry": {
+ "version": "0.2.1",
+ "resolved": "https://registry.npmjs.org/@shadcn/registry/-/registry-0.2.1.tgz",
+ "integrity": "sha512-wMvZ3DGdnhCwtpeFbwKybSGfCcP52bZX77jMKgZvupmirgyA5KRLlkeQXkI2RGHIaD8TX2iWe2wcIEjjqzg2FQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@babel/core": "^7.28.0",
+ "@babel/parser": "^7.28.0",
+ "@babel/plugin-transform-typescript": "^7.28.0",
+ "@babel/preset-typescript": "^7.27.1",
+ "@dotenvx/dotenvx": "^1.48.4",
+ "cn": "^0.2.4",
+ "code-block-writer": "^13.0.3",
+ "deepmerge": "^4.3.1",
+ "execa": "^9.6.0",
+ "fast-glob": "^3.3.3",
+ "fs-extra": "^11.3.1",
+ "fuzzysort": "^3.1.0",
+ "kleur": "^4.1.5",
+ "ora": "^8.2.0",
+ "postcss": "^8.5.23",
+ "prompts": "^2.4.2",
+ "recast": "^0.23.11",
+ "socks": "^2.8.8",
+ "stringify-object": "^5.0.0",
+ "tsconfig-paths": "^4.2.0",
+ "type-fest": "^4.41.0",
+ "undici": "^7.30.1",
+ "zod": "^4.2.0"
+ },
+ "engines": {
+ "node": ">=20.18.1"
+ }
+ },
+ "node_modules/@shadcn/registry/node_modules/cn": {
+ "version": "0.2.6",
+ "resolved": "https://registry.npmjs.org/cn/-/cn-0.2.6.tgz",
+ "integrity": "sha512-+i4L0zUGgRcEnhsxueVrP7iBGxBx5iD0WOTYg1MwFEu2ZyCmH5Ov2V1cul2Ht5UchRQQgftCf4be/RxspuW6QQ==",
+ "license": "MIT",
+ "bin": {
+ "cn": "bin/cn.mjs"
+ },
+ "engines": {
+ "node": ">=20"
+ }
+ },
+ "node_modules/@shadcn/registry/node_modules/undici": {
+ "version": "7.30.2",
+ "resolved": "https://registry.npmjs.org/undici/-/undici-7.30.2.tgz",
+ "integrity": "sha512-mLyPQnHwUxaM/rideoK/+KL8DaAJLRl4aBCfmX444aCSLnIaomqPLtNRe2jdCYcsk5wZzXrDIQC8ZeYNRAYyIA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=20.18.1"
+ }
+ },
+ "node_modules/@sindresorhus/merge-streams": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-4.0.0.tgz",
+ "integrity": "sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/@tailwindcss/node": {
+ "version": "4.3.5",
+ "resolved": "https://registry.npmjs.org/@tailwindcss/node/-/node-4.3.5.tgz",
+ "integrity": "sha512-yT53FzV4ke0cr/BguDxhWMpm5MJu1O2muzk+tKw6lKHjODAsYArBbWwFbJiaksfzFv1tpkO9QHGzmfs1hJT66g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@jridgewell/remapping": "^2.3.5",
+ "enhanced-resolve": "^5.24.5",
+ "jiti": "^2.7.0",
+ "lightningcss": "1.33.0",
+ "magic-string": "^1.1.0",
+ "source-map-js": "^1.2.1",
+ "tailwindcss": "4.3.5"
+ }
+ },
+ "node_modules/@tailwindcss/oxide": {
+ "version": "4.3.5",
+ "resolved": "https://registry.npmjs.org/@tailwindcss/oxide/-/oxide-4.3.5.tgz",
+ "integrity": "sha512-PynqGLZsZvwM9tqD/CUxkOIfyd6K5elZ2MooauzJryP/UqXYgi3yYbtt3N0Xe+MHV/eFKPFQCEfIKAqlAS1CBg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 20"
+ },
+ "optionalDependencies": {
+ "@tailwindcss/oxide-android-arm64": "4.3.5",
+ "@tailwindcss/oxide-darwin-arm64": "4.3.5",
+ "@tailwindcss/oxide-darwin-x64": "4.3.5",
+ "@tailwindcss/oxide-freebsd-x64": "4.3.5",
+ "@tailwindcss/oxide-linux-arm-gnueabihf": "4.3.5",
+ "@tailwindcss/oxide-linux-arm64-gnu": "4.3.5",
+ "@tailwindcss/oxide-linux-arm64-musl": "4.3.5",
+ "@tailwindcss/oxide-linux-x64-gnu": "4.3.5",
+ "@tailwindcss/oxide-linux-x64-musl": "4.3.5",
+ "@tailwindcss/oxide-wasm32-wasi": "4.3.5",
+ "@tailwindcss/oxide-win32-arm64-msvc": "4.3.5",
+ "@tailwindcss/oxide-win32-x64-msvc": "4.3.5"
+ }
+ },
+ "node_modules/@tailwindcss/oxide-android-arm64": {
+ "version": "4.3.5",
+ "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-android-arm64/-/oxide-android-arm64-4.3.5.tgz",
+ "integrity": "sha512-Se0z5xMqcSQanJD1IYmO0cGpK3iv0fp3ZsIT7xRJZ1Da5PghvNoc46zz4jIQn+aan3dV9T8AermFNN9QPmsh0Q==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">= 20"
+ }
+ },
+ "node_modules/@tailwindcss/oxide-darwin-arm64": {
+ "version": "4.3.5",
+ "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-arm64/-/oxide-darwin-arm64-4.3.5.tgz",
+ "integrity": "sha512-UPrgTDuUbvmqGMZuCnmI3FKee/tYKzKdp00/kuB4oSGB213VYg8QTdF7lVhnPoBXq/mIfJ+ILoBFqNOboWcMwQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">= 20"
+ }
+ },
+ "node_modules/@tailwindcss/oxide-darwin-x64": {
+ "version": "4.3.5",
+ "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-x64/-/oxide-darwin-x64-4.3.5.tgz",
+ "integrity": "sha512-E+p7HEtjI0b8D7kbbWxH067cGui6d4c79COGko9fAPVE3rwc1E7ld2HFCbaG86AOGWS5VKQYqZOaf38ya4uxTQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">= 20"
+ }
+ },
+ "node_modules/@tailwindcss/oxide-freebsd-x64": {
+ "version": "4.3.5",
+ "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-freebsd-x64/-/oxide-freebsd-x64-4.3.5.tgz",
+ "integrity": "sha512-yWEWcWyAG7rWOcTpJTjdhQ3pcaFY2h+0bqTRfgU3G2fz87ZU3AKdvdZKhslD+kyHnjBUWKvNdRYwIYC5dI1tIg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">= 20"
+ }
+ },
+ "node_modules/@tailwindcss/oxide-linux-arm-gnueabihf": {
+ "version": "4.3.5",
+ "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm-gnueabihf/-/oxide-linux-arm-gnueabihf-4.3.5.tgz",
+ "integrity": "sha512-WmeVjtJhZlr+smpqcdR2kQkkn6arHIJnUIBxTO2EJcTLGY1ecVXNo2hbSn8xc0IH2aEtys936iMWKGyj0GaKnA==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 20"
+ }
+ },
+ "node_modules/@tailwindcss/oxide-linux-arm64-gnu": {
+ "version": "4.3.5",
+ "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-gnu/-/oxide-linux-arm64-gnu-4.3.5.tgz",
+ "integrity": "sha512-DTCSyucc6ShMp1QMqV5R94Z7xlgNgUzkGmFF1rL5HH2Qjy4eSmEqy+YLGkqqYvWa4sILtgrBt1JjRKbneQtiFQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "libc": [
+ "glibc"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 20"
+ }
+ },
+ "node_modules/@tailwindcss/oxide-linux-arm64-musl": {
+ "version": "4.3.5",
+ "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-musl/-/oxide-linux-arm64-musl-4.3.5.tgz",
+ "integrity": "sha512-H9lsvO4x9E4nE4Hi8h7NHHw0O/kcVSu+iOyFHNGdYzazGgDjFHZbE6S3hQ8kMcbNXSBlMdNi67LV5EVqtpaJtw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "libc": [
+ "musl"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 20"
+ }
+ },
+ "node_modules/@tailwindcss/oxide-linux-x64-gnu": {
+ "version": "4.3.5",
+ "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-gnu/-/oxide-linux-x64-gnu-4.3.5.tgz",
+ "integrity": "sha512-4uxQvtBvPuIdl13WfUBj9xMZHH14PtHZ8OZdtLmdyDtG66sCa1t599NZT+jagkUzRtWhuul1qRZQ1nAJscXN5g==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "libc": [
+ "glibc"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 20"
+ }
+ },
+ "node_modules/@tailwindcss/oxide-linux-x64-musl": {
+ "version": "4.3.5",
+ "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-musl/-/oxide-linux-x64-musl-4.3.5.tgz",
+ "integrity": "sha512-0JQAzs7jwbA7O6+z/adU+Jk3AXwsu3npAhtr5escXS7TqEqWcaDV7qHuI+0Vy/KQRuVGnLQREcSJWYauyV3oqg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "libc": [
+ "musl"
+ ],
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 20"
+ }
+ },
+ "node_modules/@tailwindcss/oxide-wasm32-wasi": {
+ "version": "4.3.5",
+ "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-wasm32-wasi/-/oxide-wasm32-wasi-4.3.5.tgz",
+ "integrity": "sha512-OJhFmlEfdzMr+avACdi40RPtnkW0B6hXyxL/8r+tnEHBWZji36CYRjEXrrvgBmaYsD3oEOBqwYFRKsYvzFe7Bw==",
+ "bundleDependencies": [
+ "@napi-rs/wasm-runtime",
+ "@emnapi/core",
+ "@emnapi/runtime",
+ "@tybys/wasm-util",
+ "@emnapi/wasi-threads",
+ "tslib"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "@emnapi/core": "^1.11.3",
+ "@emnapi/runtime": "^1.11.3",
+ "@emnapi/wasi-threads": "^1.2.3",
+ "@napi-rs/wasm-runtime": "^1.2.2",
+ "@tybys/wasm-util": "^0.10.3",
+ "tslib": "^2.8.1"
+ },
+ "engines": {
+ "node": "^20.19.0 || ^22.13.0 || >=23.5.0"
+ }
+ },
+ "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/@emnapi/core": {
+ "version": "1.11.3",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "@emnapi/wasi-threads": "1.2.3",
+ "tslib": "^2.4.0"
+ }
+ },
+ "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/@emnapi/runtime": {
+ "version": "1.11.3",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "tslib": "^2.4.0"
+ }
+ },
+ "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/@emnapi/wasi-threads": {
+ "version": "1.2.3",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "tslib": "^2.4.0"
+ }
+ },
+ "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/@napi-rs/wasm-runtime": {
+ "version": "1.2.2",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "@tybys/wasm-util": "^0.10.3"
+ },
+ "engines": {
+ "node": "^20.19.0 || ^22.13.0 || >=23.5.0"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/Brooooooklyn"
+ },
+ "peerDependencies": {
+ "@emnapi/core": "^1.7.1 || ^2.0.0-alpha.3",
+ "@emnapi/runtime": "^1.7.1 || ^2.0.0-alpha.3"
+ }
+ },
+ "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/@tybys/wasm-util": {
+ "version": "0.10.3",
+ "dev": true,
+ "inBundle": true,
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "tslib": "^2.4.0"
+ }
+ },
+ "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/tslib": {
+ "version": "2.8.1",
+ "dev": true,
+ "inBundle": true,
+ "license": "0BSD",
+ "optional": true
+ },
+ "node_modules/@tailwindcss/oxide-win32-arm64-msvc": {
+ "version": "4.3.5",
+ "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-arm64-msvc/-/oxide-win32-arm64-msvc-4.3.5.tgz",
+ "integrity": "sha512-9o8jgthi+QE5eandnboiJT64VQfnIArfZzSTdgbhEK5aafdiu2jTW9Honi/mwYHxBZuH1vAC57IFyrh+0iK5Gg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">= 20"
+ }
+ },
+ "node_modules/@tailwindcss/oxide-win32-x64-msvc": {
+ "version": "4.3.5",
+ "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-x64-msvc/-/oxide-win32-x64-msvc-4.3.5.tgz",
+ "integrity": "sha512-XiKFfIy1RWe7qK4WqByxNW7Oz1/nkOy8o/BWhHminyV1PmpUd8Eedj5v2A8h2kpqeVlz6xRnwk9Fr/ZXNLcZfg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">= 20"
+ }
+ },
+ "node_modules/@tailwindcss/vite": {
+ "version": "4.3.5",
+ "resolved": "https://registry.npmjs.org/@tailwindcss/vite/-/vite-4.3.5.tgz",
+ "integrity": "sha512-BCNiY0a1ZjdOHVqw7kyb7U72BwfMF3dfUuN+tQsLWky/J5JOI/r7abibglXfygrZhVO/3u3V+E25kkKTeMkXaQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@tailwindcss/node": "4.3.5",
+ "@tailwindcss/oxide": "4.3.5",
+ "tailwindcss": "4.3.5"
+ },
+ "peerDependencies": {
+ "vite": "^5.2.0 || ^6 || ^7 || ^8"
+ }
+ },
+ "node_modules/@tanstack/query-core": {
+ "version": "5.107.1",
+ "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.107.1.tgz",
+ "integrity": "sha512-PSyAik11oQBEVOiVy5hjZWHmoUqOXqK1WYy4v55mcxozEfKaQgpUMsgnXhWjuESzSht8JfzqMS1m6M/9CpNgvg==",
+ "license": "MIT",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/tannerlinsley"
+ }
+ },
+ "node_modules/@tanstack/react-query": {
+ "version": "5.107.1",
+ "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.107.1.tgz",
+ "integrity": "sha512-udCOOLp3ZAheUrIHLCe+ZZge6nr2ZUrGMSWcCuXsjY1Bf2JeeE09oxst97PILiCY6N8xo/7bIo3Hvz13zh06FA==",
+ "license": "MIT",
+ "dependencies": {
+ "@tanstack/query-core": "5.107.1"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/tannerlinsley"
+ },
+ "peerDependencies": {
+ "@types/react": "^18 || ^19",
+ "react": "^18 || ^19"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@testing-library/dom": {
+ "version": "10.4.2",
+ "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-10.4.2.tgz",
+ "integrity": "sha512-yzr2S9HyAIdhz2/6qHgbs665Q7PKVcDF05vsOlHPxG1mo36gKVesdYVeDLnXgfjJ03CrKRk08knc6+E/9m8v2Q==",
+ "dev": true,
+ "license": "MIT",
+ "peer": true,
+ "dependencies": {
+ "@babel/code-frame": "^7.10.4",
+ "@babel/runtime": "^7.12.5",
+ "@types/aria-query": "^5.0.1",
+ "aria-query": "5.3.0",
+ "dom-accessibility-api": "^0.5.9",
+ "lz-string": "^1.5.0",
+ "picocolors": "1.1.1",
+ "pretty-format": "^27.0.2"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@testing-library/jest-dom": {
+ "version": "7.0.1",
+ "resolved": "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-7.0.1.tgz",
+ "integrity": "sha512-oMDTC3oA+6CXSO2JZnvOI7CA6oVub6kij5ggk9ohwye5slmkwxYDXcPOVxgMw/RQlticjtO0C1RZkR97HgrWMw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@adobe/css-tools": "^4.4.0",
+ "aria-query": "^5.0.0",
+ "css.escape": "^1.5.1",
+ "dom-accessibility-api": "^0.6.3",
+ "picocolors": "^1.1.1",
+ "redent": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=22",
+ "npm": ">=6",
+ "yarn": ">=1"
+ },
+ "peerDependencies": {
+ "@testing-library/dom": ">=10 <11",
+ "vitest": ">= 0.32"
+ },
+ "peerDependenciesMeta": {
+ "vitest": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@testing-library/jest-dom/node_modules/dom-accessibility-api": {
+ "version": "0.6.3",
+ "resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.6.3.tgz",
+ "integrity": "sha512-7ZgogeTnjuHbo+ct10G9Ffp0mif17idi0IyWNVA/wcwcm7NPOD/WEHVP3n7n3MhXqxoIYm8d6MuZohYWIZ4T3w==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@testing-library/react": {
+ "version": "16.3.3",
+ "resolved": "https://registry.npmjs.org/@testing-library/react/-/react-16.3.3.tgz",
+ "integrity": "sha512-Uo193NgQbPMz6lrrhtRQQFcMC6Re/ELLFbbuVL30WDlZxlpZf9/lMHTAVxPRLw1q1iu9OJmR1c2BLiENRstdBg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/runtime": "^7.12.5"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "peerDependencies": {
+ "@testing-library/dom": "^10.0.0",
+ "@types/react": "^18.0.0 || ^19.0.0",
+ "@types/react-dom": "^18.0.0 || ^19.0.0",
+ "react": "^18.0.0 || ^19.0.0",
+ "react-dom": "^18.0.0 || ^19.0.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@testing-library/user-event": {
+ "version": "14.6.10",
+ "resolved": "https://registry.npmjs.org/@testing-library/user-event/-/user-event-14.6.10.tgz",
+ "integrity": "sha512-tA4stGNp3mLGOGO+lh87UA56Tz4c8NVGBSkyIF58O+W/bs2Re9BCI9xihnL70+DsThncFznE0skS88SM1D2hyg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12",
+ "npm": ">=6"
+ },
+ "peerDependencies": {
+ "@testing-library/dom": ">=7.21.4"
+ }
+ },
+ "node_modules/@ts-morph/common": {
+ "version": "0.27.0",
+ "resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.27.0.tgz",
+ "integrity": "sha512-Wf29UqxWDpc+i61k3oIOzcUfQt79PIT9y/MWfAGlrkjg6lBC1hwDECLXPVJAhWjiGbfBCxZd65F/LIZF3+jeJQ==",
+ "license": "MIT",
+ "dependencies": {
+ "fast-glob": "^3.3.3",
+ "minimatch": "^10.0.1",
+ "path-browserify": "^1.0.1"
+ }
+ },
+ "node_modules/@tybys/wasm-util": {
+ "version": "0.10.4",
+ "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.4.tgz",
+ "integrity": "sha512-W3c4gRigFS0T/Ma4qIYF3GDAc5AQdHb1yL5znJT1Zv1YaD9Kitx656wBjvr19qbiosmZT8lWDM5BEMynUqX65A==",
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "tslib": "^2.4.0"
+ }
+ },
+ "node_modules/@types/aria-query": {
+ "version": "5.0.4",
+ "resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-5.0.4.tgz",
+ "integrity": "sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw==",
+ "dev": true,
+ "license": "MIT",
+ "peer": true
+ },
+ "node_modules/@types/chai": {
+ "version": "5.2.3",
+ "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.3.tgz",
+ "integrity": "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@types/deep-eql": "*",
+ "assertion-error": "^2.0.1"
+ }
+ },
+ "node_modules/@types/deep-eql": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/@types/deep-eql/-/deep-eql-4.0.2.tgz",
+ "integrity": "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@types/estree": {
+ "version": "1.0.10",
+ "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.10.tgz",
+ "integrity": "sha512-lTyOMnOcmRBzdCv6/4zUZCrEhV0xrqQiUZBZtVcbmLHBXKLnN8q89v/wKRF/Q0HbwVsqbIG3o5HDoFl9sduM+g==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@types/node": {
+ "version": "24.19.2",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-24.19.2.tgz",
+ "integrity": "sha512-93d49wCWJkCyN87MxLpNN6KXPCwFw7bVUg79mGUV1OS40JGWwVCr8n61DXCSqz7CV6/VfPkb7xec7uP2M+QHWQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "undici-types": ">=7.24.0 <7.24.7"
+ }
+ },
+ "node_modules/@types/react": {
+ "version": "19.3.0",
+ "resolved": "https://registry.npmjs.org/@types/react/-/react-19.3.0.tgz",
+ "integrity": "sha512-N0rFCuH9YoxG9/m61l9MfpJKfmLOVU0em7ipIz6TRgSSkvReLB9vL85GB+yr8Bs5leqpvg96JSwF4ZS1s4viQg==",
+ "devOptional": true,
+ "license": "MIT",
+ "dependencies": {
+ "csstype": "^3.2.2"
+ }
+ },
+ "node_modules/@types/react-dom": {
+ "version": "19.3.0",
+ "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.3.0.tgz",
+ "integrity": "sha512-ZI7bU42mZXXKHn/qNLEw2IrbiINU7X5+vfgdixBHkCNpYWXjKgfQ/P+uyGb5CjOLB9UcnTeg3rylQtV2hym44Q==",
+ "dev": true,
+ "license": "MIT",
+ "peerDependencies": {
+ "@types/react": "^19.3.0"
+ }
+ },
+ "node_modules/@types/validate-npm-package-name": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/@types/validate-npm-package-name/-/validate-npm-package-name-4.0.2.tgz",
+ "integrity": "sha512-lrpDziQipxCEeK5kWxvljWYhUvOiB2A9izZd9B2AFarYAkqZshb4lPbRs7zKEic6eGtH8V/2qJW+dPp9OtF6bw==",
+ "license": "MIT"
+ },
+ "node_modules/@typescript/typescript-aix-ppc64": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-aix-ppc64/-/typescript-aix-ppc64-7.0.2.tgz",
+ "integrity": "sha512-MTKKkWB7p/0E9xi1d1tHtZ5PiLkGEMIq88pK2CubZjOsLtYTLqhgIgi6zepFa+9GHZ6h05NMCkQxGKiPXMxXtQ==",
+ "cpu": [
+ "ppc64"
+ ],
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "aix"
+ ],
+ "engines": {
+ "node": ">=16.20.0"
+ }
+ },
+ "node_modules/@typescript/typescript-darwin-arm64": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-darwin-arm64/-/typescript-darwin-arm64-7.0.2.tgz",
+ "integrity": "sha512-gowzar9MwS/aRWp6f3a4KUqzRjAZjOsmGNCM6LcTgXum+dBfgsBVMN+AgvOCCbguXyick6LJhpBszxMebJ8syA==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=16.20.0"
+ }
+ },
+ "node_modules/@typescript/typescript-darwin-x64": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-darwin-x64/-/typescript-darwin-x64-7.0.2.tgz",
+ "integrity": "sha512-SZ9xZInqApNlNGc9s0W1VSsktYSOe9cFqNOIqmN1Gs8SmkjKZYFt017G4VwPxASInODuAdbTW7sXiFUf893RgA==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=16.20.0"
+ }
+ },
+ "node_modules/@typescript/typescript-freebsd-arm64": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-freebsd-arm64/-/typescript-freebsd-arm64-7.0.2.tgz",
+ "integrity": "sha512-W5NH4y/J0plIIS5b2xvTEkU7JFxyqdMAOgf+Ilhl0vHQXKO5dZoxd+C/jEtq56c4F3wk71RB4BMRQ2XdI+bwYQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=16.20.0"
+ }
+ },
+ "node_modules/@typescript/typescript-freebsd-x64": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-freebsd-x64/-/typescript-freebsd-x64-7.0.2.tgz",
+ "integrity": "sha512-UMGDx5sTpzNw3WiPebH7l90IWfJggEd+egHt/q6p7/Cm3zqoV7VxkGXt+3DxPIw8CcmvAB0j3sVVfbhX+M4Tpw==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=16.20.0"
+ }
+ },
+ "node_modules/@typescript/typescript-linux-arm": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-arm/-/typescript-linux-arm-7.0.2.tgz",
+ "integrity": "sha512-gffT3xPz9sR7j/YJExkyPntrI0P2EP9XbOyWzth2/Gs0RstK+90RBcO0ncXoXy/beYll1SXw846Nf2zdnEz0QQ==",
+ "cpu": [
+ "arm"
+ ],
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=16.20.0"
+ }
+ },
+ "node_modules/@typescript/typescript-linux-arm64": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-arm64/-/typescript-linux-arm64-7.0.2.tgz",
+ "integrity": "sha512-Qh4eU4/y3yDjnfjjyPYihMj5/ODIlmt+Bzu17OI+fiSRDW57QmU5SiN63exPRNJPKUzcc1INa1NXdrJ+MqHjUQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=16.20.0"
+ }
+ },
+ "node_modules/@typescript/typescript-linux-loong64": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-loong64/-/typescript-linux-loong64-7.0.2.tgz",
+ "integrity": "sha512-uEHck9i8hoAzXPiYRib1O7miOnz23SxIeVl6F4LXox+qov1K35jHcEW6VHKvZI+pyvl7fZEP4MCU5LYvIq1GuQ==",
+ "cpu": [
+ "loong64"
+ ],
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=16.20.0"
+ }
+ },
+ "node_modules/@typescript/typescript-linux-mips64el": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-mips64el/-/typescript-linux-mips64el-7.0.2.tgz",
+ "integrity": "sha512-R4KvAMnE43W5Qeqb0Ly56O3mWMWIAgsMyz36DCaycd5nbg/9kzm0liw3JocfRqyJY0KPmzFjbswozXyW0DnIYA==",
+ "cpu": [
+ "mips64el"
+ ],
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=16.20.0"
+ }
+ },
+ "node_modules/@typescript/typescript-linux-ppc64": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-ppc64/-/typescript-linux-ppc64-7.0.2.tgz",
+ "integrity": "sha512-DORx5b3sd/4S7eayxm4FQv+A7CrkUIGRaHiwI8oiHTAI1fAPWhF4J0vAlkC8biAlHSVVwxMQ3tjZ2/DVbnQiiA==",
+ "cpu": [
+ "ppc64"
+ ],
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=16.20.0"
+ }
+ },
+ "node_modules/@typescript/typescript-linux-riscv64": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-riscv64/-/typescript-linux-riscv64-7.0.2.tgz",
+ "integrity": "sha512-wf0jqEDOjrPRnKwYRyyJDRo11KMbvMFrU+q4zqKyChODBzvlkbhNQfKvLxQCcwTpdDaXSHZTVuh0JoCrKCUMHQ==",
+ "cpu": [
+ "riscv64"
+ ],
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=16.20.0"
+ }
+ },
+ "node_modules/@typescript/typescript-linux-s390x": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-s390x/-/typescript-linux-s390x-7.0.2.tgz",
+ "integrity": "sha512-IkwJc3L7yhytWd/ewjyxNDfOmswCm9GWMJT/ue/dU4aZNbwZeYAetq42VyLmsmSjvoX7z74X6ZaYCtzAr0EuGw==",
+ "cpu": [
+ "s390x"
+ ],
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=16.20.0"
+ }
+ },
+ "node_modules/@typescript/typescript-linux-x64": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-x64/-/typescript-linux-x64-7.0.2.tgz",
+ "integrity": "sha512-EYdf2cNg7rgCWJnxCdJ+F3V39O8ihb37eHAu1LK8oAFizgTQbPOK7zHHXbPt8rX24COqODXeI3sIf0fCXG7H/A==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=16.20.0"
+ }
+ },
+ "node_modules/@typescript/typescript-netbsd-arm64": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-netbsd-arm64/-/typescript-netbsd-arm64-7.0.2.tgz",
+ "integrity": "sha512-+polYF4MF04aPpO5FTkHran9yUQDSXqy5GiSDKpsll5jy3l3+g9QLhpf39T+ePtefhXLOGrLl0QIjkQP6VnelA==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=16.20.0"
+ }
+ },
+ "node_modules/@typescript/typescript-netbsd-x64": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-netbsd-x64/-/typescript-netbsd-x64-7.0.2.tgz",
+ "integrity": "sha512-8YIT0EHM/3dq10ZOVF/A7pc/YSMtbcecct4rWtexrnSCHOPcpC2KTLXfTCR6vDpnSiY12heNb1GiN/wu+T/FyA==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=16.20.0"
+ }
+ },
+ "node_modules/@typescript/typescript-openbsd-arm64": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-openbsd-arm64/-/typescript-openbsd-arm64-7.0.2.tgz",
+ "integrity": "sha512-APT8+ClYnuYm1u9+kgGXoMj2VzWzcymwh2gNSQVySHfkRDGOTVkoWLjCmOQSaO+PoqQ57B0flRp9SA+7GnnkzQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=16.20.0"
+ }
+ },
+ "node_modules/@typescript/typescript-openbsd-x64": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-openbsd-x64/-/typescript-openbsd-x64-7.0.2.tgz",
+ "integrity": "sha512-yX7s+Q0Dln0Dt9tEzZsAjXXR/+ytBM7AlglaqyeMPxQszJ1JhlJdZ6jLA+IzldHtflX81em7lDao1xXu+aRRkg==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=16.20.0"
+ }
+ },
+ "node_modules/@typescript/typescript-sunos-x64": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-sunos-x64/-/typescript-sunos-x64-7.0.2.tgz",
+ "integrity": "sha512-dLJDGaLZ1D4HPQn62u1n8mBDkJREwMsAkCdkwd4Ieqw+x3TUyTsqY0YiBCtE6H6OzzgGk3iuZ3vFWRS+E8/d1g==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "sunos"
+ ],
+ "engines": {
+ "node": ">=16.20.0"
+ }
+ },
+ "node_modules/@typescript/typescript-win32-arm64": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-win32-arm64/-/typescript-win32-arm64-7.0.2.tgz",
+ "integrity": "sha512-Gyl1Vy6OsWesLzmq+EP0Fb7b4Nid5232AvcA2SFcdYreldpNtYFFofPjnt62y9hQy7VTaZp65ICJjuAQRaVcIQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=16.20.0"
+ }
+ },
+ "node_modules/@typescript/typescript-win32-x64": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-win32-x64/-/typescript-win32-x64-7.0.2.tgz",
+ "integrity": "sha512-0BQ3HkAHHlKLSp1qRvf3SUhGpGsDuhB/jgFw75guyqbxJqEaS0Cw/VFO8i2nHglJUzQCRtMMR/IBAKE3ETMC4g==",
+ "cpu": [
+ "x64"
+ ],
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=16.20.0"
+ }
+ },
+ "node_modules/@vitejs/plugin-react": {
+ "version": "6.3.0",
+ "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-6.3.0.tgz",
+ "integrity": "sha512-H9E955aVvD2F4zNHCw4eIZbIfF6xKldlh7MNu+hSU7xwQzh65lI/N+CJWqmfhi0PEjDXIt/H7T7J/4wU63KJiw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@rolldown/pluginutils": "^1.0.1"
+ },
+ "engines": {
+ "node": "^20.19.0 || >=22.12.0"
+ },
+ "peerDependencies": {
+ "@rolldown/plugin-babel": "^0.1.7 || ^0.2.0 || ^0.3.0",
+ "babel-plugin-react-compiler": "^1.0.0",
+ "oxc-transform-react": ">=0.152.0 <0.157.0",
+ "vite": "^8.0.0"
+ },
+ "peerDependenciesMeta": {
+ "@rolldown/plugin-babel": {
+ "optional": true
+ },
+ "babel-plugin-react-compiler": {
+ "optional": true
+ },
+ "oxc-transform-react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@vitest/mocker": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-5.1.0.tgz",
+ "integrity": "sha512-5umB9/jlWcqVS6fsrFmv5Gdnpu6wAUio/lEOwAmvB7v+lFo/IW2B9FhAD0p19GCULTgMzLCdUmuCDCnAzWgppQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@jridgewell/trace-mapping": "0.3.31",
+ "@vitest/spy": "5.1.0",
+ "estree-walker": "^3.0.3",
+ "magic-string": "^1.4.3"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
+ },
+ "peerDependencies": {
+ "msw": "^2.4.9 || ^3.0.0",
+ "vite": "^6.0.0 || ^7.0.0 || ^8.0.0"
+ },
+ "peerDependenciesMeta": {
+ "msw": {
+ "optional": true
+ },
+ "vite": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@vitest/spy": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-5.1.0.tgz",
+ "integrity": "sha512-2DPO5OMHWKrBngC+fCmTQqemNF0gidRhp3lxbBmRhW+M1XJrfgPpqNqWVevXtn2f2ufD5ZaR1B6B641aAlcX5A==",
+ "dev": true,
+ "license": "MIT",
+ "funding": {
+ "url": "https://opencollective.com/vitest"
+ }
+ },
+ "node_modules/ajv": {
+ "version": "8.20.0",
+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz",
+ "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==",
+ "license": "MIT",
+ "dependencies": {
+ "fast-deep-equal": "^3.1.3",
+ "fast-uri": "^3.0.1",
+ "json-schema-traverse": "^1.0.0",
+ "require-from-string": "^2.0.2"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/epoberezkin"
+ }
+ },
+ "node_modules/ajv-formats": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz",
+ "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==",
+ "license": "MIT",
+ "dependencies": {
+ "ajv": "^8.0.0"
+ },
+ "peerDependencies": {
+ "ajv": "^8.0.0"
+ },
+ "peerDependenciesMeta": {
+ "ajv": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/ansi-colors": {
+ "version": "4.1.3",
+ "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz",
+ "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/ansi-regex": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
+ "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/ansi-styles": {
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz",
+ "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==",
+ "dev": true,
+ "license": "MIT",
+ "peer": true,
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/ansi-styles?sponsor=1"
+ }
+ },
+ "node_modules/aria-query": {
+ "version": "5.3.0",
+ "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz",
+ "integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "dependencies": {
+ "dequal": "^2.0.3"
+ }
+ },
+ "node_modules/assertion-error": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz",
+ "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/ast-types": {
+ "version": "0.16.3",
+ "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.16.3.tgz",
+ "integrity": "sha512-FvWoWYfSCM6kRxCSH+MGLHIKKGRL6A6AW7Zek2O32REPQRdg131428uRTKMBYAeRd3XXAaHDS60Wpri7CdKDrA==",
+ "license": "MIT",
+ "dependencies": {
+ "tslib": "^2.0.1"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/atomically": {
+ "version": "1.7.0",
+ "resolved": "https://registry.npmjs.org/atomically/-/atomically-1.7.0.tgz",
+ "integrity": "sha512-Xcz9l0z7y9yQ9rdDaxlmaI4uJHf/T8g9hOEzJcsEqX2SjCj4J20uK7+ldkDHMbpJDK76wF7xEIgxc/vSlsfw5w==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=10.12.0"
+ }
+ },
+ "node_modules/balanced-match": {
+ "version": "4.0.4",
+ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz",
+ "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==",
+ "license": "MIT",
+ "engines": {
+ "node": "18 || 20 || >=22"
+ }
+ },
+ "node_modules/baseline-browser-mapping": {
+ "version": "2.11.36",
+ "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.36.tgz",
+ "integrity": "sha512-AbPFGS4K9S3meMRCLTM0Zas+e9X7b5ygUBOboDT5zevCZt9ByKSbMtKhwyVqW+oL8WemPVsbP7X3rdZcIyOa0w==",
+ "license": "Apache-2.0",
+ "bin": {
+ "baseline-browser-mapping": "dist/cli.cjs"
+ },
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/bcp-47": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/bcp-47/-/bcp-47-2.1.2.tgz",
+ "integrity": "sha512-wsv86UuNFuPnVieKLyECTT+CP1WSAHeoIg5P3xu2kA9Z+7fVPoKt7dxzSeEhtJel0AI+NW3fIW3KtTKQKUCngg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "is-alphabetical": "^2.0.0",
+ "is-alphanumerical": "^2.0.0",
+ "is-decimal": "^2.0.0"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
+ "node_modules/bcp-47-match": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/bcp-47-match/-/bcp-47-match-2.0.3.tgz",
+ "integrity": "sha512-JtTezzbAibu8G0R9op9zb3vcWZd9JF6M0xOYGPn0fNCd7wOpRB1mU2mH9T8gaBGbAAyIIVgB2G7xG0GP98zMAQ==",
+ "dev": true,
+ "license": "MIT",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
+ "node_modules/brace-expansion": {
+ "version": "5.0.13",
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.13.tgz",
+ "integrity": "sha512-Vh3dmFbc4wZeox7M9I/0L9GfFd83Su4+yCck/OF9Gi/P/dAHn0RT7X4K9R7gMNMhDck3DvhR6QXsnQdjjgwNvQ==",
+ "license": "MIT",
+ "dependencies": {
+ "balanced-match": "^4.0.2"
+ },
+ "engines": {
+ "node": "20 || >=22"
+ }
+ },
+ "node_modules/braces": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
+ "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
+ "license": "MIT",
+ "dependencies": {
+ "fill-range": "^7.1.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/browserslist": {
+ "version": "4.29.5",
+ "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.29.5.tgz",
+ "integrity": "sha512-khTmKu5NGYTotqcYo8Bew2k4RAE9PuXRSFRXG2lQBrCEQHyeQ/vX6gKMxfokwywBsLiXZMnHsmWMG1pnO8J7uQ==",
+ "funding": [
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/browserslist"
+ },
+ {
+ "type": "tidelift",
+ "url": "https://tidelift.com/funding/github/npm/browserslist"
+ },
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/ai"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "baseline-browser-mapping": "^2.11.33",
+ "caniuse-lite": "^1.0.30001819",
+ "electron-to-chromium": "^1.5.464",
+ "node-releases": "^2.0.60",
+ "update-browserslist-db": "^1.3.4"
+ },
+ "bin": {
+ "browserslist": "cli.js"
+ },
+ "engines": {
+ "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7"
+ }
+ },
+ "node_modules/bundle-name": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/bundle-name/-/bundle-name-4.1.1.tgz",
+ "integrity": "sha512-DdH81/zPLVS11EUgWq3tEu/xn+EzljlMYooDNdzWEnFha3R3NBMpMV1UqYIpjYHV/SgpFKMIX1Oh7o06SjM/oA==",
+ "license": "MIT",
+ "dependencies": {
+ "run-applescript": "^7.0.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/caniuse-lite": {
+ "version": "1.0.30001826",
+ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001826.tgz",
+ "integrity": "sha512-wTB+9tIbLro/BCXwLuNV1meHE4L9dS6dArMDwgYfNBPMYScqClHyGunhkCSDtHhe/69Xl0sHlKgBVZ+fNsYtWA==",
+ "funding": [
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/browserslist"
+ },
+ {
+ "type": "tidelift",
+ "url": "https://tidelift.com/funding/github/npm/caniuse-lite"
+ },
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/ai"
+ }
+ ],
+ "license": "CC-BY-4.0"
+ },
+ "node_modules/chai": {
+ "version": "6.3.0",
+ "resolved": "https://registry.npmjs.org/chai/-/chai-6.3.0.tgz",
+ "integrity": "sha512-XWAtwJ6OHO+tj0EKCs0Y2UamnyOxseZWltU4x2U2wh8g4AigdjwvtUjvLP2tqkA/avxHEtzxNaqGq/YGNwckKg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/chalk": {
+ "version": "5.6.2",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz",
+ "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==",
+ "license": "MIT",
+ "engines": {
+ "node": "^12.17.0 || ^14.13 || >=16.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/chalk?sponsor=1"
+ }
+ },
+ "node_modules/class-variance-authority": {
+ "version": "0.7.1",
+ "resolved": "https://registry.npmjs.org/class-variance-authority/-/class-variance-authority-0.7.1.tgz",
+ "integrity": "sha512-Ka+9Trutv7G8M6WT6SeiRWz792K5qEqIGEGzXKhAE6xOWAY6pPH8U+9IY3oCMv6kqTmLsv7Xh/2w2RigkePMsg==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "clsx": "^2.1.1"
+ },
+ "funding": {
+ "url": "https://polar.sh/cva"
+ }
+ },
+ "node_modules/cli-cursor": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-5.0.0.tgz",
+ "integrity": "sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==",
+ "license": "MIT",
+ "dependencies": {
+ "restore-cursor": "^5.0.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/cli-spinners": {
+ "version": "2.9.2",
+ "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz",
+ "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/clsx": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz",
+ "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/cn": {
+ "version": "0.5.2",
+ "resolved": "https://registry.npmjs.org/cn/-/cn-0.5.2.tgz",
+ "integrity": "sha512-wm10E6iuJ37rALOw3D+3cfaXXZSLNMh2uxpQn3dNICqfJM59yXqgbA9/9Iiz155j5kYNLdK6WreNdW3NQtx3OQ==",
+ "license": "MIT",
+ "bin": {
+ "cn": "bin/cn.mjs"
+ },
+ "engines": {
+ "node": ">=22"
+ }
+ },
+ "node_modules/code-block-writer": {
+ "version": "13.0.3",
+ "resolved": "https://registry.npmjs.org/code-block-writer/-/code-block-writer-13.0.3.tgz",
+ "integrity": "sha512-Oofo0pq3IKnsFtuHqSF7TqBfr71aeyZDVJ0HpmqB7FBM2qEigL0iPONSCZSO9pE9dZTAxANe5XHG9Uy0YMv8cg==",
+ "license": "MIT"
+ },
+ "node_modules/commander": {
+ "version": "14.0.3",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-14.0.3.tgz",
+ "integrity": "sha512-H+y0Jo/T1RZ9qPP4Eh1pkcQcLRglraJaSLoyOtHxu6AapkjWVCy2Sit1QQ4x3Dng8qDlSsZEet7g5Pq06MvTgw==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=20"
+ }
+ },
+ "node_modules/conf": {
+ "version": "10.2.0",
+ "resolved": "https://registry.npmjs.org/conf/-/conf-10.2.0.tgz",
+ "integrity": "sha512-8fLl9F04EJqjSqH+QjITQfJF8BrOVaYr1jewVgSRAEWePfxT0sku4w2hrGQ60BC/TNLGQ2pgxNlTbWQmMPFvXg==",
+ "license": "MIT",
+ "dependencies": {
+ "ajv": "^8.6.3",
+ "ajv-formats": "^2.1.1",
+ "atomically": "^1.7.0",
+ "debounce-fn": "^4.0.0",
+ "dot-prop": "^6.0.1",
+ "env-paths": "^2.2.1",
+ "json-schema-typed": "^7.0.3",
+ "onetime": "^5.1.2",
+ "pkg-up": "^3.1.0",
+ "semver": "^7.3.5"
+ },
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/conf/node_modules/semver": {
+ "version": "7.8.6",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.6.tgz",
+ "integrity": "sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==",
+ "license": "ISC",
+ "bin": {
+ "semver": "bin/semver.js"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/convert-source-map": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz",
+ "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==",
+ "license": "MIT"
+ },
+ "node_modules/cookie": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/cookie/-/cookie-1.1.1.tgz",
+ "integrity": "sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/cross-spawn": {
+ "version": "7.0.6",
+ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
+ "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
+ "license": "MIT",
+ "dependencies": {
+ "path-key": "^3.1.0",
+ "shebang-command": "^2.0.0",
+ "which": "^2.0.1"
+ },
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/cross-spawn/node_modules/isexe": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
+ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==",
+ "license": "ISC"
+ },
+ "node_modules/cross-spawn/node_modules/which": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
+ "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
+ "license": "ISC",
+ "dependencies": {
+ "isexe": "^2.0.0"
+ },
+ "bin": {
+ "node-which": "bin/node-which"
+ },
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/css.escape": {
+ "version": "1.5.1",
+ "resolved": "https://registry.npmjs.org/css.escape/-/css.escape-1.5.1.tgz",
+ "integrity": "sha512-YUifsXXuknHlUsmlgyY0PKzgPOr7/FjCePfHNt0jxm83wHZi44VDMQ7/fGNkjY3/jV1MC+1CmZbaHzugyeRtpg==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/csstype": {
+ "version": "3.2.3",
+ "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz",
+ "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==",
+ "devOptional": true,
+ "license": "MIT"
+ },
+ "node_modules/data-urls": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-8.0.0.tgz",
+ "integrity": "sha512-JQUCCK+/CAGbGGx618PlFZMXH81Jtj7t73CHv9dd/zVWvxgGT2zLFRjnKb+Ng46GIwcy+f7f88qd4duqllK+WQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "whatwg-mimetype": "^5.0.0",
+ "whatwg-url": "^17.1.2"
+ },
+ "engines": {
+ "node": "^22.14.0 || >=24.0.0"
+ }
+ },
+ "node_modules/debounce-fn": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/debounce-fn/-/debounce-fn-4.0.0.tgz",
+ "integrity": "sha512-8pYCQiL9Xdcg0UPSD3d+0KMlOjp+KGU5EPwYddgzQ7DATsg4fuUDjQtsYLmWjnk2obnNHgV3vE2Y4jejSOJVBQ==",
+ "license": "MIT",
+ "dependencies": {
+ "mimic-fn": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/debug": {
+ "version": "4.4.3",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
+ "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",
+ "license": "MIT",
+ "dependencies": {
+ "ms": "^2.1.3"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/decimal.js": {
+ "version": "10.6.0",
+ "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.6.0.tgz",
+ "integrity": "sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/dedent": {
+ "version": "1.7.2",
+ "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.7.2.tgz",
+ "integrity": "sha512-WzMx3mW98SN+zn3hgemf4OzdmyNhhhKz5Ay0pUfQiMQ3e1g+xmTJWp/pKdwKVXhdSkAEGIIzqeuWrL3mV/AXbA==",
+ "license": "MIT",
+ "peerDependencies": {
+ "babel-plugin-macros": "^3.1.0"
+ },
+ "peerDependenciesMeta": {
+ "babel-plugin-macros": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/deepmerge": {
+ "version": "4.3.1",
+ "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz",
+ "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/default-browser": {
+ "version": "5.5.1",
+ "resolved": "https://registry.npmjs.org/default-browser/-/default-browser-5.5.1.tgz",
+ "integrity": "sha512-m1pAzaJgZ/gssEqlOhJkPJp8Xly7QyW6xcrkUa2KKcDeDSEMP7X8xipU3snUcfisTQx0w1AGae+9UtJSfVnXGw==",
+ "license": "MIT",
+ "dependencies": {
+ "bundle-name": "^4.1.0",
+ "default-browser-id": "^5.0.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/default-browser-id": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/default-browser-id/-/default-browser-id-5.0.1.tgz",
+ "integrity": "sha512-x1VCxdX4t+8wVfd1so/9w+vQ4vx7lKd2Qp5tDRutErwmR85OgmfX7RlLRMWafRMY7hbEiXIbudNrjOAPa/hL8Q==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/define-lazy-prop": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-3.0.0.tgz",
+ "integrity": "sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/dequal": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz",
+ "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/detect-libc": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz",
+ "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/diff": {
+ "version": "8.0.4",
+ "resolved": "https://registry.npmjs.org/diff/-/diff-8.0.4.tgz",
+ "integrity": "sha512-DPi0FmjiSU5EvQV0++GFDOJ9ASQUVFh5kD+OzOnYdi7n3Wpm9hWWGfB/O2blfHcMVTL5WkQXSnRiK9makhrcnw==",
+ "license": "BSD-3-Clause",
+ "engines": {
+ "node": ">=0.3.1"
+ }
+ },
+ "node_modules/dom-accessibility-api": {
+ "version": "0.5.16",
+ "resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.5.16.tgz",
+ "integrity": "sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==",
+ "dev": true,
+ "license": "MIT",
+ "peer": true
+ },
+ "node_modules/dot-prop": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz",
+ "integrity": "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==",
+ "license": "MIT",
+ "dependencies": {
+ "is-obj": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/dotenv": {
+ "version": "17.4.2",
+ "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-17.4.2.tgz",
+ "integrity": "sha512-nI4U3TottKAcAD9LLud4Cb7b2QztQMUEfHbvhTH09bqXTxnSie8WnjPALV/WMCrJZ6UV/qHJ6L03OqO3LcdYZw==",
+ "license": "BSD-2-Clause",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://dotenvx.com"
+ }
+ },
+ "node_modules/electron-to-chromium": {
+ "version": "1.5.483",
+ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.483.tgz",
+ "integrity": "sha512-zkGOvf625oaZgK+mhTF4hl3aTAfIOOnR7Jey0e7fUktdJWrB/wsLnzPKvWaqZkMCJ1yzUkAh6IqDJ9GMr3pR2Q==",
+ "license": "ISC"
+ },
+ "node_modules/emoji-regex": {
+ "version": "10.6.0",
+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz",
+ "integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==",
+ "license": "MIT"
+ },
+ "node_modules/enhanced-resolve": {
+ "version": "5.26.1",
+ "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.26.1.tgz",
+ "integrity": "sha512-PPnnSJq3azKOIewXR/uppBV/6h98dprBJ/WaQ9Qgj10xX1lJLNfg+XShpbsrSqcDSy2yYYyhfXM1wWhftqgyzw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "graceful-fs": "^4.2.4",
+ "tapable": "^2.3.3"
+ },
+ "engines": {
+ "node": ">=10.13.0"
+ }
+ },
+ "node_modules/enquirer": {
+ "version": "2.4.1",
+ "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.4.1.tgz",
+ "integrity": "sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==",
+ "license": "MIT",
+ "dependencies": {
+ "ansi-colors": "^4.1.1",
+ "strip-ansi": "^6.0.1"
+ },
+ "engines": {
+ "node": ">=8.6"
+ }
+ },
+ "node_modules/entities": {
+ "version": "9.0.0",
+ "resolved": "https://registry.npmjs.org/entities/-/entities-9.0.0.tgz",
+ "integrity": "sha512-oJFNDJg3kTPwAD1cNn2+WmUq4wFoo09npc3Ydf1D7ED4smRiWrsKnaLxykrTWgyGEcusc87P5dxlAleol9kpkg==",
+ "dev": true,
+ "license": "BSD-2-Clause",
+ "engines": {
+ "node": ">=20.19.0"
+ },
+ "funding": {
+ "url": "https://github.com/fb55/entities?sponsor=1"
+ }
+ },
+ "node_modules/env-paths": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz",
+ "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/es-module-lexer": {
+ "version": "2.3.2",
+ "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-2.3.2.tgz",
+ "integrity": "sha512-poHGpORABojJJucnV9KbOavETW8lBVnphkW77ER5/BQ5Fz7oXSoCNek7IH3vR5nRjdsEz926ibFYX8KtLQmdyw==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/escalade": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz",
+ "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/esprima": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
+ "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",
+ "license": "BSD-2-Clause",
+ "bin": {
+ "esparse": "bin/esparse.js",
+ "esvalidate": "bin/esvalidate.js"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/estree-walker": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz",
+ "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@types/estree": "^1.0.0"
+ }
+ },
+ "node_modules/execa": {
+ "version": "9.6.1",
+ "resolved": "https://registry.npmjs.org/execa/-/execa-9.6.1.tgz",
+ "integrity": "sha512-9Be3ZoN4LmYR90tUoVu2te2BsbzHfhJyfEiAVfz7N5/zv+jduIfLrV2xdQXOHbaD6KgpGdO9PRPM1Y4Q9QkPkA==",
+ "license": "MIT",
+ "dependencies": {
+ "@sindresorhus/merge-streams": "^4.0.0",
+ "cross-spawn": "^7.0.6",
+ "figures": "^6.1.0",
+ "get-stream": "^9.0.0",
+ "human-signals": "^8.0.1",
+ "is-plain-obj": "^4.1.0",
+ "is-stream": "^4.0.1",
+ "npm-run-path": "^6.0.0",
+ "pretty-ms": "^9.2.0",
+ "signal-exit": "^4.1.0",
+ "strip-final-newline": "^4.0.0",
+ "yoctocolors": "^2.1.1"
+ },
+ "engines": {
+ "node": "^18.19.0 || >=20.5.0"
+ },
+ "funding": {
+ "url": "https://github.com/sindresorhus/execa?sponsor=1"
+ }
+ },
+ "node_modules/expect-type": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.4.0.tgz",
+ "integrity": "sha512-KfYbmpRm0VbLjEvVa9yGwCi9GI34xvi7A/HXYWQO65CSD2u3MczUJSuwXKFIxlGsgBQizV9q5J9NHj4VG0n+pA==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=12.0.0"
+ }
+ },
+ "node_modules/fast-deep-equal": {
+ "version": "3.1.3",
+ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
+ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
+ "license": "MIT"
+ },
+ "node_modules/fast-glob": {
+ "version": "3.3.3",
+ "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz",
+ "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==",
+ "license": "MIT",
+ "dependencies": {
+ "@nodelib/fs.stat": "^2.0.2",
+ "@nodelib/fs.walk": "^1.2.3",
+ "glob-parent": "^5.1.2",
+ "merge2": "^1.3.0",
+ "micromatch": "^4.0.8"
+ },
+ "engines": {
+ "node": ">=8.6.0"
+ }
+ },
+ "node_modules/fast-uri": {
+ "version": "3.1.9",
+ "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.9.tgz",
+ "integrity": "sha512-hS/0Wt3Ya043oKXs0sIxrMpKQITXhMLIrVAKKXi4gozGC9v7YRWVnXIZzjNPTO02M9BdxLCWqK1yRXgNziVyJQ==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/fastify"
+ },
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/fastify"
+ }
+ ],
+ "license": "BSD-3-Clause"
+ },
+ "node_modules/fastq": {
+ "version": "1.20.3",
+ "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.20.3.tgz",
+ "integrity": "sha512-XKv5nnLs6nLF71NgiKJLIZFLkPyIEuOselLG7ujZnGrRfQK8HpvY+WqKhAJUAdLomwVHErVS4LfxFlPq0/FTAw==",
+ "license": "ISC",
+ "dependencies": {
+ "reusify": "^1.0.4"
+ }
+ },
+ "node_modules/fdir": {
+ "version": "6.5.0",
+ "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz",
+ "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=12.0.0"
+ },
+ "peerDependencies": {
+ "picomatch": "^3 || ^4"
+ },
+ "peerDependenciesMeta": {
+ "picomatch": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/figures": {
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/figures/-/figures-6.1.0.tgz",
+ "integrity": "sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==",
+ "license": "MIT",
+ "dependencies": {
+ "is-unicode-supported": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/fill-range": {
+ "version": "7.1.1",
+ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
+ "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
+ "license": "MIT",
+ "dependencies": {
+ "to-regex-range": "^5.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/find-up": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz",
+ "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==",
+ "license": "MIT",
+ "dependencies": {
+ "locate-path": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/fs-extra": {
+ "version": "11.4.1",
+ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.4.1.tgz",
+ "integrity": "sha512-KYAb4c9BJQI6QqGKthV68OHe0badztdXJWKo0WtBA9IuCFPTKvE5ZdUBglP833aMjhaSPNO4A5j/EkzZtGlKjA==",
+ "license": "MIT",
+ "dependencies": {
+ "graceful-fs": "^4.2.0",
+ "jsonfile": "^6.0.1",
+ "universalify": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=14.14"
+ }
+ },
+ "node_modules/fsevents": {
+ "version": "2.3.3",
+ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
+ "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
+ "dev": true,
+ "hasInstallScript": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": "^8.16.0 || ^10.6.0 || >=11.0.0"
+ }
+ },
+ "node_modules/fuzzysort": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/fuzzysort/-/fuzzysort-3.1.0.tgz",
+ "integrity": "sha512-sR9BNCjBg6LNgwvxlBd0sBABvQitkLzoVY9MYYROQVX/FvfJ4Mai9LsGhDgd8qYdds0bY77VzYd5iuB+v5rwQQ==",
+ "license": "MIT"
+ },
+ "node_modules/gensync": {
+ "version": "1.0.0-beta.2",
+ "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz",
+ "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/get-east-asian-width": {
+ "version": "1.7.0",
+ "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.7.0.tgz",
+ "integrity": "sha512-XjH1AECxf0giL2V1aU8vKyRR2ppRUb5c0EvT7zuJTokQ74bNo52zOtghqdWIqrhUD79fo3x0WfKZdOqxF6LG1Q==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/get-own-enumerable-keys": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/get-own-enumerable-keys/-/get-own-enumerable-keys-1.0.0.tgz",
+ "integrity": "sha512-PKsK2FSrQCyxcGHsGrLDcK0lx+0Ke+6e8KFFozA9/fIQLhQzPaRvJFdcz7+Axg3jUH/Mq+NI4xa5u/UT2tQskA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=14.16"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/get-stream": {
+ "version": "9.0.1",
+ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-9.0.1.tgz",
+ "integrity": "sha512-kVCxPF3vQM/N0B1PmoqVUqgHP+EeVjmZSQn+1oCRPxd2P21P2F19lIgbR3HBosbB1PUhOAoctJnfEn2GbN2eZA==",
+ "license": "MIT",
+ "dependencies": {
+ "@sec-ant/readable-stream": "^0.4.1",
+ "is-stream": "^4.0.1"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/glob-parent": {
+ "version": "5.1.2",
+ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
+ "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
+ "license": "ISC",
+ "dependencies": {
+ "is-glob": "^4.0.1"
+ },
+ "engines": {
+ "node": ">= 6"
+ }
+ },
+ "node_modules/graceful-fs": {
+ "version": "4.2.11",
+ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz",
+ "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==",
+ "license": "ISC"
+ },
+ "node_modules/html-encoding-sniffer": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-7.0.0.tgz",
+ "integrity": "sha512-UikN5yr7xsCDAq87Or5or0PAlD3HJJOKVzM05az588WnpDJ4Ux7a2A53Qi6gofGg2/EtvF/H4hCi/TXfCW4Y6w==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@exodus/bytes": "^1.15.1"
+ },
+ "engines": {
+ "node": "^22.13.0 || >=24.0.0"
+ }
+ },
+ "node_modules/html-parse-stringify": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/html-parse-stringify/-/html-parse-stringify-4.0.1.tgz",
+ "integrity": "sha512-0zHsZJrK7S3K2aucXWL6ycoYJ/iNtIcFHC/nYQgFklPtrv5LpJctIiSCroWZWeuoXvuyFdzp6KzjJQ+OT5MfFw==",
+ "license": "MIT",
+ "funding": {
+ "url": "https://locize.com"
+ }
+ },
+ "node_modules/human-signals": {
+ "version": "8.0.1",
+ "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-8.0.1.tgz",
+ "integrity": "sha512-eKCa6bwnJhvxj14kZk5NCPc6Hb6BdsU9DZcOnmQKSnO1VKrfV0zCvtttPZUsBvjmNDn8rpcJfpwSYnHBjc95MQ==",
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=18.18.0"
+ }
+ },
+ "node_modules/i18next": {
+ "version": "27.1.1",
+ "resolved": "https://registry.npmjs.org/i18next/-/i18next-27.1.1.tgz",
+ "integrity": "sha512-Qq3aJizS3RXQ30crhx9BKQLrHoa6GKpgrOJjVZ9vgj3EBxAddrmVfDNUrAMxSUimw5Jc+ld4SSZUAzf1q4nGyQ==",
+ "funding": [
+ {
+ "type": "individual",
+ "url": "https://www.locize.com/i18next"
+ },
+ {
+ "type": "individual",
+ "url": "https://www.i18next.com/how-to/faq#i18next-is-awesome.-how-can-i-support-the-project"
+ },
+ {
+ "type": "individual",
+ "url": "https://www.locize.com"
+ }
+ ],
+ "license": "MIT",
+ "engines": {
+ "node": ">=22"
+ },
+ "peerDependencies": {
+ "typescript": "^5 || ^6 || ^7"
+ },
+ "peerDependenciesMeta": {
+ "typescript": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/ignore": {
+ "version": "5.3.2",
+ "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz",
+ "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 4"
+ }
+ },
+ "node_modules/indent-string": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz",
+ "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/ip-address": {
+ "version": "10.7.6",
+ "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.7.6.tgz",
+ "integrity": "sha512-00LYkM6byILa9eQIx6qoaXCM40xTLd56AZ4vyaPW3YTyb49VZYPo5xsiAq4tuQ54GH4R7gVdYScJ1B7B77PuTg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 12"
+ }
+ },
+ "node_modules/is-alphabetical": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-2.0.1.tgz",
+ "integrity": "sha512-FWyyY60MeTNyeSRpkM2Iry0G9hpr7/9kD40mD/cGQEuilcZYS4okz8SN2Q6rLCJ8gbCt6fN+rC+6tMGS99LaxQ==",
+ "dev": true,
+ "license": "MIT",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
+ "node_modules/is-alphanumerical": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-2.0.1.tgz",
+ "integrity": "sha512-hmbYhX/9MUMF5uh7tOXyK/n0ZvWpad5caBA17GsC6vyuCqaWliRG5K1qS9inmUhEMaOBIW7/whAnSwveW/LtZw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "is-alphabetical": "^2.0.0",
+ "is-decimal": "^2.0.0"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
+ "node_modules/is-decimal": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/is-decimal/-/is-decimal-2.0.1.tgz",
+ "integrity": "sha512-AAB9hiomQs5DXWcRB1rqsxGUstbRroFOPPVAomNk/3XHR5JyEZChOyTWe2oayKnsSsr/kcGqF+z6yuH6HHpN0A==",
+ "dev": true,
+ "license": "MIT",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/wooorm"
+ }
+ },
+ "node_modules/is-docker": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz",
+ "integrity": "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==",
+ "license": "MIT",
+ "bin": {
+ "is-docker": "cli.js"
+ },
+ "engines": {
+ "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/is-extglob": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
+ "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/is-glob": {
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
+ "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
+ "license": "MIT",
+ "dependencies": {
+ "is-extglob": "^2.1.1"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/is-in-ssh": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-in-ssh/-/is-in-ssh-1.0.0.tgz",
+ "integrity": "sha512-jYa6Q9rH90kR1vKB6NM7qqd1mge3Fx4Dhw5TVlK1MUBqhEOuCagrEHMevNuCcbECmXZ0ThXkRm+Ymr51HwEPAw==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=20"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/is-inside-container": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz",
+ "integrity": "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==",
+ "license": "MIT",
+ "dependencies": {
+ "is-docker": "^3.0.0"
+ },
+ "bin": {
+ "is-inside-container": "cli.js"
+ },
+ "engines": {
+ "node": ">=14.16"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/is-interactive": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-2.0.0.tgz",
+ "integrity": "sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/is-number": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
+ "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.12.0"
+ }
+ },
+ "node_modules/is-obj": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz",
+ "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/is-plain-obj": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz",
+ "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/is-potential-custom-element-name": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz",
+ "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/is-regexp": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/is-regexp/-/is-regexp-3.1.0.tgz",
+ "integrity": "sha512-rbku49cWloU5bSMI+zaRaXdQHXnthP6DZ/vLnfdSKyL4zUzuWnomtOEiZZOd+ioQ+avFo/qau3KPTc7Fjy1uPA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/is-stream": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-4.0.1.tgz",
+ "integrity": "sha512-Dnz92NInDqYckGEUJv689RbRiTSEHCQ7wOVeALbkOz999YpqT46yMRIGtSNl2iCL1waAZSx40+h59NV/EwzV/A==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/is-unicode-supported": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-2.1.0.tgz",
+ "integrity": "sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/is-wsl": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-3.1.1.tgz",
+ "integrity": "sha512-e6rvdUCiQCAuumZslxRJWR/Doq4VpPR82kqclvcS0efgt430SlGIk05vdCN58+VrzgtIcfNODjozVielycD4Sw==",
+ "license": "MIT",
+ "dependencies": {
+ "is-inside-container": "^1.0.0"
+ },
+ "engines": {
+ "node": ">=16"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/isexe": {
+ "version": "3.1.5",
+ "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.5.tgz",
+ "integrity": "sha512-6B3tLtFqtQS4ekarvLVMZ+X+VlvQekbe4taUkf/rhVO3d/h0M2rfARm/pXLcPEsjjMsFgrFgSrhQIxcSVrBz8w==",
+ "license": "BlueOak-1.0.0",
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/jiti": {
+ "version": "2.7.0",
+ "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.7.0.tgz",
+ "integrity": "sha512-AC/7JofJvZGrrneWNaEnJeOLUx+JlGt7tNa0wZiRPT4MY1wmfKjt2+6O2p2uz2+skll8OZZmJMNqeke7kKbNgQ==",
+ "dev": true,
+ "license": "MIT",
+ "bin": {
+ "jiti": "lib/jiti-cli.mjs"
+ }
+ },
+ "node_modules/js-tokens": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
+ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==",
+ "license": "MIT"
+ },
+ "node_modules/jsdom": {
+ "version": "31.0.0",
+ "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-31.0.0.tgz",
+ "integrity": "sha512-xAkhD9z1eyFC5+QUi9K24CaZJgdCQ2GOGLW1GdVDoQvkp/AxEH9TQ0pAplPOlIiV92hfcgnFOADZypbjgbBT6Q==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@exodus/bytes": "^1.16.0",
+ "bcp-47": "^2.1.2",
+ "bcp-47-match": "^2.0.3",
+ "data-urls": "^8.0.0",
+ "decimal.js": "^10.6.0",
+ "html-encoding-sniffer": "^7.0.0",
+ "is-potential-custom-element-name": "^1.0.1",
+ "lru-cache": "^11.5.3",
+ "parse5": "^8.1.0",
+ "parse5-parser-stream": "^8.1.0",
+ "saxes": "^6.0.0",
+ "tough-cookie": "^6.0.2",
+ "undici": "^8.12.3",
+ "w3c-xmlserializer": "^6.0.0",
+ "webidl-conversions": "^8.0.1",
+ "whatwg-mimetype": "^5.0.0",
+ "whatwg-url": "^17.3.0",
+ "xml-name-validator": "^5.0.0"
+ },
+ "engines": {
+ "node": "^22.22.2 || ^24.15.0 || >=26.0.0"
+ },
+ "peerDependencies": {
+ "@napi-rs/canvas": "^1.0.13"
+ },
+ "peerDependenciesMeta": {
+ "@napi-rs/canvas": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/jsesc": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz",
+ "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==",
+ "license": "MIT",
+ "bin": {
+ "jsesc": "bin/jsesc"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/json-schema-traverse": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",
+ "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==",
+ "license": "MIT"
+ },
+ "node_modules/json-schema-typed": {
+ "version": "7.0.3",
+ "resolved": "https://registry.npmjs.org/json-schema-typed/-/json-schema-typed-7.0.3.tgz",
+ "integrity": "sha512-7DE8mpG+/fVw+dTpjbxnx47TaMnDfOI1jwft9g1VybltZCduyRQPJPvc+zzKY9WPHxhPWczyFuYa6I8Mw4iU5A==",
+ "license": "BSD-2-Clause"
+ },
+ "node_modules/json5": {
+ "version": "2.2.3",
+ "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz",
+ "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==",
+ "license": "MIT",
+ "bin": {
+ "json5": "lib/cli.js"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/jsonfile": {
+ "version": "6.2.1",
+ "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.1.tgz",
+ "integrity": "sha512-zwOTdL3rFQ/lRdBnntKVOX6k5cKJwEc1HdilT71BWEu7J41gXIB2MRp+vxduPSwZJPWBxEzv4yH1wYLJGUHX4Q==",
+ "license": "MIT",
+ "dependencies": {
+ "universalify": "^2.0.0"
+ },
+ "optionalDependencies": {
+ "graceful-fs": "^4.1.6"
+ }
+ },
+ "node_modules/kleur": {
+ "version": "4.1.5",
+ "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz",
+ "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/lightningcss": {
+ "version": "1.33.0",
+ "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.33.0.tgz",
+ "integrity": "sha512-WkUDrojuJs0xkgGf2udWxa3yGBRxPtxUkB79i6aCZLRgc7PM8fZe9TosfPDcvEpQZbuFASnHYmRLBLUbmLOIIA==",
+ "dev": true,
+ "license": "MPL-2.0",
+ "dependencies": {
+ "detect-libc": "^2.0.3"
+ },
+ "engines": {
+ "node": ">= 12.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/parcel"
+ },
+ "optionalDependencies": {
+ "lightningcss-android-arm64": "1.33.0",
+ "lightningcss-darwin-arm64": "1.33.0",
+ "lightningcss-darwin-x64": "1.33.0",
+ "lightningcss-freebsd-x64": "1.33.0",
+ "lightningcss-linux-arm-gnueabihf": "1.33.0",
+ "lightningcss-linux-arm64-gnu": "1.33.0",
+ "lightningcss-linux-arm64-musl": "1.33.0",
+ "lightningcss-linux-x64-gnu": "1.33.0",
+ "lightningcss-linux-x64-musl": "1.33.0",
+ "lightningcss-win32-arm64-msvc": "1.33.0",
+ "lightningcss-win32-x64-msvc": "1.33.0"
+ }
+ },
+ "node_modules/lightningcss-android-arm64": {
+ "version": "1.33.0",
+ "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.33.0.tgz",
+ "integrity": "sha512-gEpRTalKdosp4Bb8qWtc2iOgE5SeIHlpS1up9bFq2wAyYhl1UdTObYiHe98zEM9SQvSoqQZ1IQD0JNpg3Ml5pg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MPL-2.0",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">= 12.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/parcel"
+ }
+ },
+ "node_modules/lightningcss-darwin-arm64": {
+ "version": "1.33.0",
+ "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.33.0.tgz",
+ "integrity": "sha512-Sciaz8eenNTKn9b3t7+xr0ipTp9YxKQY4npwQ3mrRuL0BAVHBLyZxofhaKBAVtzmtRZ/zTyo0/to4B1uWG/Djg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MPL-2.0",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">= 12.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/parcel"
+ }
+ },
+ "node_modules/lightningcss-darwin-x64": {
+ "version": "1.33.0",
+ "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.33.0.tgz",
+ "integrity": "sha512-Z5UPAxzrjlWNNyGy6i65cJzzvgJ5D3T6wMvs+gWpY9d7qRhANrxqAp6LhxIgZhWEw18RfJTGcRxjuLIBr+m8XQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MPL-2.0",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">= 12.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/parcel"
+ }
+ },
+ "node_modules/lightningcss-freebsd-x64": {
+ "version": "1.33.0",
+ "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.33.0.tgz",
+ "integrity": "sha512-QQM/Ti/hQajJwCY+RiWuCZ9sdtI/XQk7nDK5vC8kkdwixezOlDgvDx7+RT+QjK6FcFT4MpsuoBnHIo/O3StRRg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MPL-2.0",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">= 12.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/parcel"
+ }
+ },
+ "node_modules/lightningcss-linux-arm-gnueabihf": {
+ "version": "1.33.0",
+ "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.33.0.tgz",
+ "integrity": "sha512-N7FVBe6iS24MlM6R/4RBTxGhQheZGs7tiQ9U32UtF75NzP5Q7xWPRqLBCKxlRQRk3rY1jCIPLzx7WzOhuUIRLQ==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MPL-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 12.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/parcel"
+ }
+ },
+ "node_modules/lightningcss-linux-arm64-gnu": {
+ "version": "1.33.0",
+ "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.33.0.tgz",
+ "integrity": "sha512-j2v/itmy4HlNxlc6voKXYgBqNi0Ng2LShg4z7GufpEgs05P+2suBVyi9I6YHq5uoVFx9ETin3eCEhLVyXGQnKg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "libc": [
+ "glibc"
+ ],
+ "license": "MPL-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 12.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/parcel"
+ }
+ },
+ "node_modules/lightningcss-linux-arm64-musl": {
+ "version": "1.33.0",
+ "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.33.0.tgz",
+ "integrity": "sha512-yiO5ROMuYQgXbC60yjZU5CYSFZGKXL0HFATXt9mHJn1+zW55oCtMI9NfcVhYLMFDL7gV7oBPon/EmMMGg2OvtQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "libc": [
+ "musl"
+ ],
+ "license": "MPL-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 12.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/parcel"
+ }
+ },
+ "node_modules/lightningcss-linux-x64-gnu": {
+ "version": "1.33.0",
+ "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.33.0.tgz",
+ "integrity": "sha512-ar+Ju7LmcN0Jo4FpL4hpFybwNG9/3A/Br5KW2n2jyODg3MEZXaDYADdemoNS+BDNfMgKvylJLj4S5tyRActuAg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "libc": [
+ "glibc"
+ ],
+ "license": "MPL-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 12.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/parcel"
+ }
+ },
+ "node_modules/lightningcss-linux-x64-musl": {
+ "version": "1.33.0",
+ "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.33.0.tgz",
+ "integrity": "sha512-RYiYbkokw0trfKqqzfF55lginwEPrD3OJDfTuJzFs1MK6iFnDenaz1fqLLtX4ITG3OktJQXOeTaw1awrBAlZPw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "libc": [
+ "musl"
+ ],
+ "license": "MPL-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 12.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/parcel"
+ }
+ },
+ "node_modules/lightningcss-win32-arm64-msvc": {
+ "version": "1.33.0",
+ "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.33.0.tgz",
+ "integrity": "sha512-1K+MPfLSFVpphzpdbfkhlWk6wBrTObBzS2T6db10PNOZgR9GoVsAWzwNyuhUYYbTp23j+4RrncfujZ4uAzXvwA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MPL-2.0",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">= 12.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/parcel"
+ }
+ },
+ "node_modules/lightningcss-win32-x64-msvc": {
+ "version": "1.33.0",
+ "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.33.0.tgz",
+ "integrity": "sha512-OlEICDx/Xl0FqSp4bry8zFnCvGpig3Gl4gCquvYwHuqJKEC1+n9NgDniFvqHGmMv1ZkqDJrDqKKSykTDX+ehuA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MPL-2.0",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">= 12.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/parcel"
+ }
+ },
+ "node_modules/locate-path": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz",
+ "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==",
+ "license": "MIT",
+ "dependencies": {
+ "p-locate": "^3.0.0",
+ "path-exists": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/log-symbols": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-6.0.0.tgz",
+ "integrity": "sha512-i24m8rpwhmPIS4zscNzK6MSEhk0DUWa/8iYQWxhffV8jkI4Phvs3F+quL5xvS0gdQR0FyTCMMH33Y78dDTzzIw==",
+ "license": "MIT",
+ "dependencies": {
+ "chalk": "^5.3.0",
+ "is-unicode-supported": "^1.3.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/log-symbols/node_modules/is-unicode-supported": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz",
+ "integrity": "sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/lru-cache": {
+ "version": "11.5.3",
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.3.tgz",
+ "integrity": "sha512-U4N8FgzmWxc8k1VH8Kr6lQg18U7Fjvby6wXHVRX/ZZ7IwWbRMgrRbP0Wrb5q5NVinryp4SQampHKdvtecItxUg==",
+ "dev": true,
+ "license": "BlueOak-1.0.0",
+ "engines": {
+ "node": "20 || >=22"
+ }
+ },
+ "node_modules/lucide-react": {
+ "version": "1.72.0",
+ "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-1.72.0.tgz",
+ "integrity": "sha512-fbF5i1GU8GODETa3Q7rXqrJrcx3iPYrQtxthom103zGx+Z0BGwKYAW9s+9435ohYJ7hQm0av0PoZcqI1CRwNrg==",
+ "license": "ISC",
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/lz-string": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/lz-string/-/lz-string-1.5.0.tgz",
+ "integrity": "sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==",
+ "dev": true,
+ "license": "MIT",
+ "peer": true,
+ "bin": {
+ "lz-string": "bin/bin.js"
+ }
+ },
+ "node_modules/magic-string": {
+ "version": "1.4.5",
+ "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-1.4.5.tgz",
+ "integrity": "sha512-oLLC2+YvQUfAa+vxoufE/yc1icb87M9iXIRqAoR/2EhE/8cb3SF/+Gi0c2By1B+5Vz2e2vQtUvHiu1+63Znh+w==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@jridgewell/sourcemap-codec": "^1.6.0"
+ }
+ },
+ "node_modules/merge-stream": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz",
+ "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==",
+ "license": "MIT"
+ },
+ "node_modules/merge2": {
+ "version": "1.4.1",
+ "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz",
+ "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/micromatch": {
+ "version": "4.0.8",
+ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz",
+ "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==",
+ "license": "MIT",
+ "dependencies": {
+ "braces": "^3.0.3",
+ "picomatch": "^2.3.1"
+ },
+ "engines": {
+ "node": ">=8.6"
+ }
+ },
+ "node_modules/micromatch/node_modules/picomatch": {
+ "version": "2.3.2",
+ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz",
+ "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=8.6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/jonschlinkert"
+ }
+ },
+ "node_modules/mimic-fn": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-3.1.0.tgz",
+ "integrity": "sha512-Ysbi9uYW9hFyfrThdDEQuykN4Ey6BuwPD2kpI5ES/nFTDn/98yxYNLZJcgUAKPT/mcrLLKaGzJR9YVxJrIdASQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/mimic-function": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/mimic-function/-/mimic-function-5.0.1.tgz",
+ "integrity": "sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/min-indent": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz",
+ "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/minimatch": {
+ "version": "10.2.6",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz",
+ "integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==",
+ "license": "BlueOak-1.0.0",
+ "dependencies": {
+ "brace-expansion": "^5.0.8"
+ },
+ "engines": {
+ "node": "18 || 20 || >=22"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/minimist": {
+ "version": "1.2.8",
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
+ "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
+ "license": "MIT",
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/ms": {
+ "version": "2.1.3",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
+ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
+ "license": "MIT"
+ },
+ "node_modules/nanoid": {
+ "version": "3.3.20",
+ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz",
+ "integrity": "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/ai"
+ }
+ ],
+ "license": "MIT",
+ "bin": {
+ "nanoid": "bin/nanoid.cjs"
+ },
+ "engines": {
+ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
+ }
+ },
+ "node_modules/node-releases": {
+ "version": "2.0.63",
+ "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.63.tgz",
+ "integrity": "sha512-6li2QanLsAXpIH2R6j77MzRyvOyrvdTqlKtO4CgBdHGNvN99ZZfyxszHc5o5+IZBWD5u6Hzwg83JoGXmqZNG9Q==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/npm-run-path": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-6.0.0.tgz",
+ "integrity": "sha512-9qny7Z9DsQU8Ou39ERsPU4OZQlSTP47ShQzuKZ6PRXpYLtIFgl/DEBYEXKlvcEa+9tHVcK8CF81Y2V72qaZhWA==",
+ "license": "MIT",
+ "dependencies": {
+ "path-key": "^4.0.0",
+ "unicorn-magic": "^0.3.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/npm-run-path/node_modules/path-key": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz",
+ "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/object-treeify": {
+ "version": "1.1.33",
+ "resolved": "https://registry.npmjs.org/object-treeify/-/object-treeify-1.1.33.tgz",
+ "integrity": "sha512-EFVjAYfzWqWsBMRHPMAXLCDIJnpMhdWAqR7xG6M6a2cs6PMFpl/+Z20w9zDW4vkxOFfddegBKq9Rehd0bxWE7A==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/obug": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/obug/-/obug-3.0.0.tgz",
+ "integrity": "sha512-5vvB5+W7ePv+p3uqxi+RcW1XAzLW0/hxt3/4X4Lc4qHudzOhmBiBwOY6DRob4WnanAEGvNcLjF+KNOufrUoEQw==",
+ "dev": true,
+ "funding": [
+ "https://github.com/sponsors/sxzz",
+ "https://opencollective.com/debug"
+ ],
+ "license": "MIT",
+ "engines": {
+ "node": ">=12.20.0"
+ }
+ },
+ "node_modules/onetime": {
+ "version": "5.1.2",
+ "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz",
+ "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==",
+ "license": "MIT",
+ "dependencies": {
+ "mimic-fn": "^2.1.0"
+ },
+ "engines": {
+ "node": ">=6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/onetime/node_modules/mimic-fn": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz",
+ "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/open": {
+ "version": "11.0.4",
+ "resolved": "https://registry.npmjs.org/open/-/open-11.0.4.tgz",
+ "integrity": "sha512-++Zlftm0kVLPmzC06t6epuWmcRMDbI4z5P3NNX979WA/k23+NtSOynEGzsVfZwguKw2mi5umVgnBlJQMwRz4Pg==",
+ "license": "MIT",
+ "dependencies": {
+ "default-browser": "^5.5.1",
+ "define-lazy-prop": "^3.0.0",
+ "is-in-ssh": "^1.0.0",
+ "is-inside-container": "^1.0.0",
+ "powershell-utils": "^0.2.1",
+ "wsl-utils": "^1.0.0"
+ },
+ "engines": {
+ "node": ">=20"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/ora": {
+ "version": "8.2.0",
+ "resolved": "https://registry.npmjs.org/ora/-/ora-8.2.0.tgz",
+ "integrity": "sha512-weP+BZ8MVNnlCm8c0Qdc1WSWq4Qn7I+9CJGm7Qali6g44e/PUzbjNqJX5NJ9ljlNMosfJvg1fKEGILklK9cwnw==",
+ "license": "MIT",
+ "dependencies": {
+ "chalk": "^5.3.0",
+ "cli-cursor": "^5.0.0",
+ "cli-spinners": "^2.9.2",
+ "is-interactive": "^2.0.0",
+ "is-unicode-supported": "^2.0.0",
+ "log-symbols": "^6.0.0",
+ "stdin-discarder": "^0.2.2",
+ "string-width": "^7.2.0",
+ "strip-ansi": "^7.1.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/ora/node_modules/ansi-regex": {
+ "version": "6.6.0",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.6.0.tgz",
+ "integrity": "sha512-XZ5apbzreCbXSKwPjJstu8R0zOi247w3XYwWxtwBXgpZrCyc1Ka7p9/xY0A9/diMewmHbEKz+FIraWaEWjlN5g==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/ansi-regex?sponsor=1"
+ }
+ },
+ "node_modules/ora/node_modules/strip-ansi": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz",
+ "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==",
+ "license": "MIT",
+ "dependencies": {
+ "ansi-regex": "^6.2.2"
+ },
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/strip-ansi?sponsor=1"
+ }
+ },
+ "node_modules/oxlint": {
+ "version": "1.93.0",
+ "resolved": "https://registry.npmjs.org/oxlint/-/oxlint-1.93.0.tgz",
+ "integrity": "sha512-19JMsQFX+YvEbcUTFQxjTwhvs0Ibg0D6CFneSLgpwnACWcY/6LjhpGpkPodh0T5aIT1pjMTLlYaeBFzaVgugTA==",
+ "dev": true,
+ "license": "MIT",
+ "bin": {
+ "oxlint": "bin/oxlint"
+ },
+ "engines": {
+ "node": "^20.19.0 || >=22.12.0"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/oxc-project"
+ },
+ "optionalDependencies": {
+ "@oxlint/binding-android-arm-eabi": "1.93.0",
+ "@oxlint/binding-android-arm64": "1.93.0",
+ "@oxlint/binding-darwin-arm64": "1.93.0",
+ "@oxlint/binding-darwin-x64": "1.93.0",
+ "@oxlint/binding-freebsd-x64": "1.93.0",
+ "@oxlint/binding-linux-arm-gnueabihf": "1.93.0",
+ "@oxlint/binding-linux-arm-musleabihf": "1.93.0",
+ "@oxlint/binding-linux-arm64-gnu": "1.93.0",
+ "@oxlint/binding-linux-arm64-musl": "1.93.0",
+ "@oxlint/binding-linux-ppc64-gnu": "1.93.0",
+ "@oxlint/binding-linux-riscv64-gnu": "1.93.0",
+ "@oxlint/binding-linux-riscv64-musl": "1.93.0",
+ "@oxlint/binding-linux-s390x-gnu": "1.93.0",
+ "@oxlint/binding-linux-x64-gnu": "1.93.0",
+ "@oxlint/binding-linux-x64-musl": "1.93.0",
+ "@oxlint/binding-openharmony-arm64": "1.93.0",
+ "@oxlint/binding-win32-arm64-msvc": "1.93.0",
+ "@oxlint/binding-win32-ia32-msvc": "1.93.0",
+ "@oxlint/binding-win32-x64-msvc": "1.93.0"
+ },
+ "peerDependencies": {
+ "oxlint-tsgolint": ">=7.0.2005",
+ "vite-plus": "*"
+ },
+ "peerDependenciesMeta": {
+ "oxlint-tsgolint": {
+ "optional": true
+ },
+ "vite-plus": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/p-limit": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
+ "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
+ "license": "MIT",
+ "dependencies": {
+ "p-try": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/p-locate": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz",
+ "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==",
+ "license": "MIT",
+ "dependencies": {
+ "p-limit": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/p-try": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
+ "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/parse-ms": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-4.0.0.tgz",
+ "integrity": "sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/parse5": {
+ "version": "8.1.1",
+ "resolved": "https://registry.npmjs.org/parse5/-/parse5-8.1.1.tgz",
+ "integrity": "sha512-EcR/6WDcU7b2N3vQSxKALCk9lXGtUMQxXio008OEMBE0kavu/7JLfBEeFPzi43nMqVDSbEn3QCK+BMCc9zO//w==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "entities": "^9.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/inikulin/parse5?sponsor=1"
+ }
+ },
+ "node_modules/parse5-parser-stream": {
+ "version": "8.1.1",
+ "resolved": "https://registry.npmjs.org/parse5-parser-stream/-/parse5-parser-stream-8.1.1.tgz",
+ "integrity": "sha512-hMcVbbUJcQmP8rURWUdYrT1flRiBiBVjq/RYGguJpDUgIXSqdYKlE0CxthmdMWoSlBAuL5bUBa73g0pttSy7Hw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "parse5": "^8.1.1"
+ },
+ "funding": {
+ "url": "https://github.com/inikulin/parse5?sponsor=1"
+ }
+ },
+ "node_modules/path-browserify": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz",
+ "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==",
+ "license": "MIT"
+ },
+ "node_modules/path-exists": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz",
+ "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/path-key": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
+ "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/picocolors": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
+ "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==",
+ "license": "ISC"
+ },
+ "node_modules/picomatch": {
+ "version": "4.0.7",
+ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz",
+ "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/jonschlinkert"
+ }
+ },
+ "node_modules/pkg-up": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-3.1.0.tgz",
+ "integrity": "sha512-nDywThFk1i4BQK4twPQ6TA4RT8bDY96yeuCVBWL3ePARCiEKDRSrNGbFIgUJpLp+XeIR65v8ra7WuJOFUBtkMA==",
+ "license": "MIT",
+ "dependencies": {
+ "find-up": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/postcss": {
+ "version": "8.5.32",
+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.32.tgz",
+ "integrity": "sha512-LJlKCCAUFKOuZxipUdYw1NzIITEsPcgyOG9LkvRJvuKj/bRzbuRY0ARXvL0pWGpsZvn8jku+LMep2eU0seHp8g==",
+ "funding": [
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/postcss/"
+ },
+ {
+ "type": "tidelift",
+ "url": "https://tidelift.com/funding/github/npm/postcss"
+ },
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/ai"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "nanoid": "^3.3.20",
+ "picocolors": "^1.1.1",
+ "source-map-js": "^1.2.2"
+ },
+ "engines": {
+ "node": "^10 || ^12 || >=14"
+ }
+ },
+ "node_modules/postcss-selector-parser": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.2.0.tgz",
+ "integrity": "sha512-Khh/tERVBn0I1499dvBSHY0pWJloMJWUxDsOBM0CCDPAcVZ10Jl2L1qy1f19uEX22spa8Mv7DCdEQJc0cGwBhQ==",
+ "license": "MIT",
+ "dependencies": {
+ "util-deprecate": "^1.0.2"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/powershell-utils": {
+ "version": "0.2.1",
+ "resolved": "https://registry.npmjs.org/powershell-utils/-/powershell-utils-0.2.1.tgz",
+ "integrity": "sha512-C+y9x90UElAddDZmV4qOx9W53B61PO7cIqWz2dQsWlwswuq4mr8NEwytdGKboYbQlGZ3awrkTeNvcZiZNHnQ8A==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=20"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/pretty-format": {
+ "version": "27.5.1",
+ "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.5.1.tgz",
+ "integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==",
+ "dev": true,
+ "license": "MIT",
+ "peer": true,
+ "dependencies": {
+ "ansi-regex": "^5.0.1",
+ "ansi-styles": "^5.0.0",
+ "react-is": "^17.0.1"
+ },
+ "engines": {
+ "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0"
+ }
+ },
+ "node_modules/pretty-ms": {
+ "version": "9.3.1",
+ "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-9.3.1.tgz",
+ "integrity": "sha512-HzMy3Geq23nVALD/M2LliU+F+M+gVNsvkQWWqeBZ8HDiCgzo6YPJ/Omrmtq24EFrIsk0a3EkQGEd7bDOo+IhGA==",
+ "license": "MIT",
+ "dependencies": {
+ "parse-ms": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/prompts": {
+ "version": "2.4.2",
+ "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz",
+ "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==",
+ "license": "MIT",
+ "dependencies": {
+ "kleur": "^3.0.3",
+ "sisteransi": "^1.0.5"
+ },
+ "engines": {
+ "node": ">= 6"
+ }
+ },
+ "node_modules/prompts/node_modules/kleur": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz",
+ "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/punycode": {
+ "version": "2.3.1",
+ "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz",
+ "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/queue-microtask": {
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
+ "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ],
+ "license": "MIT"
+ },
+ "node_modules/react": {
+ "version": "19.3.1",
+ "resolved": "https://registry.npmjs.org/react/-/react-19.3.1.tgz",
+ "integrity": "sha512-QNhWdt7nrgVWWQG58QuGsAR3jv3Hbe4mb4vz7w2csnHavciZJgda1CPNaldF6eVxv90ud3jUXpKlHL69gO38yw==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/react-dom": {
+ "version": "19.3.1",
+ "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.3.1.tgz",
+ "integrity": "sha512-Y0bARz53lhEC1NMCASs0/j+faB/zqt3R8hpvg1e8+61ZVJ4UL0UdC4cBbXfZMcIuhrfgeILTLe+ZeBCavQPtKQ==",
+ "license": "MIT",
+ "dependencies": {
+ "scheduler": "^0.28.0"
+ },
+ "peerDependencies": {
+ "react": "^19.3.1"
+ }
+ },
+ "node_modules/react-i18next": {
+ "version": "18.0.1",
+ "resolved": "https://registry.npmjs.org/react-i18next/-/react-i18next-18.0.1.tgz",
+ "integrity": "sha512-kPWXI0E/lrPj3+/umcKNzYZVnWmEedLiamMzDIHfbs+5ANf6yzvlZsjKou8f7kaGkfMMDLIZBejV+4aSN1CyBw==",
+ "license": "MIT",
+ "dependencies": {
+ "html-parse-stringify": "^4.0.1"
+ },
+ "engines": {
+ "node": ">=22"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "i18next": ">= 27.0.1",
+ "react": ">= 18.0.0",
+ "typescript": "^5 || ^6 || ^7"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "typescript": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/react-is": {
+ "version": "17.0.2",
+ "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz",
+ "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==",
+ "dev": true,
+ "license": "MIT",
+ "peer": true
+ },
+ "node_modules/react-router": {
+ "version": "7.18.5",
+ "resolved": "https://registry.npmjs.org/react-router/-/react-router-7.18.5.tgz",
+ "integrity": "sha512-dTgvcXDOrLPrlLHrcZAqWveiK1hMSqN+rGAJzegP8HtmNkfRxOoshGWBNX3ZJ0cZjOHkRdlUJtaIhZMLLyGyPw==",
+ "license": "MIT",
+ "dependencies": {
+ "cookie": "^1.0.1",
+ "set-cookie-parser": "^2.6.0"
+ },
+ "engines": {
+ "node": ">=20.0.0"
+ },
+ "peerDependencies": {
+ "react": ">=18",
+ "react-dom": ">=18"
+ },
+ "peerDependenciesMeta": {
+ "react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/react-router-dom": {
+ "version": "7.18.5",
+ "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-7.18.5.tgz",
+ "integrity": "sha512-9HcfDMU6JJ/fp6gJZYGwNE6RknVGS4kBjH1HkNw959mCJi70TVwdipQWv2FEol9uGpi+SZTFtVpJPtEQfayeOw==",
+ "license": "MIT",
+ "dependencies": {
+ "react-router": "7.18.5"
+ },
+ "engines": {
+ "node": ">=20.0.0"
+ },
+ "peerDependencies": {
+ "react": ">=18",
+ "react-dom": ">=18"
+ }
+ },
+ "node_modules/recast": {
+ "version": "0.23.21",
+ "resolved": "https://registry.npmjs.org/recast/-/recast-0.23.21.tgz",
+ "integrity": "sha512-mFAyJq9vUbSTARLZUvAEf1z3YxlvAwswbmxMx2mPA/MSm4KmpwvwvhsH/NIrZhyOuwD60Lzyw2qh83uCbgTPYw==",
+ "license": "MIT",
+ "dependencies": {
+ "ast-types": "^0.16.1",
+ "esprima": "~4.0.0",
+ "source-map": "~0.6.1",
+ "tiny-invariant": "^1.3.3",
+ "tslib": "^2.0.1"
+ },
+ "engines": {
+ "node": ">= 4"
+ }
+ },
+ "node_modules/redent": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz",
+ "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "indent-string": "^4.0.0",
+ "strip-indent": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/require-from-string": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz",
+ "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/reselect": {
+ "version": "5.3.0",
+ "resolved": "https://registry.npmjs.org/reselect/-/reselect-5.3.0.tgz",
+ "integrity": "sha512-XGoLeRAVzUTcJ1qkxPQhDJyIZ5d6zzZD9nT7AEZOaaU9UbWclhycElmhO+VD5bFeLuzhPBaOV2oXC8uG35ZSpg==",
+ "license": "MIT"
+ },
+ "node_modules/restore-cursor": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-5.1.0.tgz",
+ "integrity": "sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==",
+ "license": "MIT",
+ "dependencies": {
+ "onetime": "^7.0.0",
+ "signal-exit": "^4.1.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/restore-cursor/node_modules/onetime": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/onetime/-/onetime-7.0.0.tgz",
+ "integrity": "sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==",
+ "license": "MIT",
+ "dependencies": {
+ "mimic-function": "^5.0.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/reusify": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz",
+ "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==",
+ "license": "MIT",
+ "engines": {
+ "iojs": ">=1.0.0",
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/rolldown": {
+ "version": "1.2.19",
+ "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.2.19.tgz",
+ "integrity": "sha512-QIiV1J9d0pzN4jeeTH4sjPy0AZ6cAy2cG0ExeoE1+U8Rvj+hR3gYkokx0YbeUNGlZqiQJJ2utcETe0oKXwzsuA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@oxc-project/types": "=0.156.0",
+ "@rolldown/pluginutils": "^1.0.0"
+ },
+ "bin": {
+ "rolldown": "bin/cli.mjs"
+ },
+ "engines": {
+ "node": "^20.19.0 || >=22.12.0"
+ },
+ "optionalDependencies": {
+ "@rolldown/binding-android-arm-eabi": "1.2.19",
+ "@rolldown/binding-android-arm64": "1.2.19",
+ "@rolldown/binding-darwin-arm64": "1.2.19",
+ "@rolldown/binding-darwin-x64": "1.2.19",
+ "@rolldown/binding-freebsd-x64": "1.2.19",
+ "@rolldown/binding-linux-arm-gnueabihf": "1.2.19",
+ "@rolldown/binding-linux-arm64-gnu": "1.2.19",
+ "@rolldown/binding-linux-arm64-musl": "1.2.19",
+ "@rolldown/binding-linux-ppc64-gnu": "1.2.19",
+ "@rolldown/binding-linux-s390x-gnu": "1.2.19",
+ "@rolldown/binding-linux-x64-gnu": "1.2.19",
+ "@rolldown/binding-linux-x64-musl": "1.2.19",
+ "@rolldown/binding-openharmony-arm64": "1.2.19",
+ "@rolldown/binding-wasm32-wasi": "1.2.19",
+ "@rolldown/binding-win32-arm64-msvc": "1.2.19",
+ "@rolldown/binding-win32-x64-msvc": "1.2.19"
+ }
+ },
+ "node_modules/run-applescript": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/run-applescript/-/run-applescript-7.1.0.tgz",
+ "integrity": "sha512-DPe5pVFaAsinSaV6QjQ6gdiedWDcRCbUuiQfQa2wmWV7+xC9bGulGI8+TdRmoFkAPaBXk8CrAbnlY2ISniJ47Q==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/run-parallel": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz",
+ "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "queue-microtask": "^1.2.2"
+ }
+ },
+ "node_modules/saxes": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/saxes/-/saxes-6.0.0.tgz",
+ "integrity": "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==",
+ "dev": true,
+ "license": "ISC",
+ "dependencies": {
+ "xmlchars": "^2.2.0"
+ },
+ "engines": {
+ "node": ">=v12.22.7"
+ }
+ },
+ "node_modules/scheduler": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.28.0.tgz",
+ "integrity": "sha512-juorfCmIkIw8tT+p5BXSm6PJjQF/ycEYmKyzURCIt/RaZIhL+PulbQ9Yu2z1HdOJDdqDTlxA1+xKBmHXJsczAw==",
+ "license": "MIT"
+ },
+ "node_modules/semver": {
+ "version": "6.3.2",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.2.tgz",
+ "integrity": "sha512-GYrCADwpu6yV5OAvchkQ27Z5wwMxWAEMg5NNWjyHh/5DboFFqbdbvYNIvZouQpxXyeMPoTOh0vdPYKlf0ZswdQ==",
+ "license": "ISC",
+ "bin": {
+ "semver": "bin/semver.js"
+ }
+ },
+ "node_modules/set-cookie-parser": {
+ "version": "2.7.3",
+ "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.7.3.tgz",
+ "integrity": "sha512-irZHtTqurLna57KQG/s+fzOwv/J6XSH4cs8M/vsrY3uCaQ3S6+QJguAH0WdN47SXlk82voMZ4naWMQf8fdEoIg==",
+ "license": "MIT"
+ },
+ "node_modules/shadcn": {
+ "version": "4.23.0",
+ "resolved": "https://registry.npmjs.org/shadcn/-/shadcn-4.23.0.tgz",
+ "integrity": "sha512-lKgq7QPFgkV/6EOrMCwvEn7ZAw/YnM/grhxzJmK4cZdw3E4F3Ut2EmWvrn2E+vzJp1y/76mxU185OSkXo9Ff+Q==",
+ "license": "MIT",
+ "dependencies": {
+ "@babel/core": "^7.28.0",
+ "@babel/parser": "^7.28.0",
+ "@babel/plugin-transform-typescript": "^7.28.0",
+ "@babel/preset-typescript": "^7.27.1",
+ "@dotenvx/dotenvx": "^1.48.4",
+ "@modelcontextprotocol/server": "^2.3.1",
+ "@shadcn/registry": "0.2.1",
+ "@types/validate-npm-package-name": "^4.0.2",
+ "browserslist": "^4.29.3",
+ "cn": "^0.2.4",
+ "commander": "^14.0.0",
+ "dedent": "^1.6.0",
+ "deepmerge": "^4.3.1",
+ "diff": "^8.0.2",
+ "execa": "^9.6.0",
+ "fast-glob": "^3.3.3",
+ "fs-extra": "^11.3.1",
+ "fuzzysort": "^3.1.0",
+ "kleur": "^4.1.5",
+ "open": "^11.0.4",
+ "ora": "^8.2.0",
+ "postcss": "^8.5.23",
+ "postcss-selector-parser": "^7.1.6",
+ "prompts": "^2.4.2",
+ "recast": "^0.23.11",
+ "socks": "^2.8.8",
+ "stringify-object": "^5.0.0",
+ "ts-morph": "^26.0.0",
+ "tsconfig-paths": "^4.2.0",
+ "undici": "^7.30.1",
+ "validate-npm-package-name": "^7.0.1",
+ "zod": "^4.2.0"
+ },
+ "bin": {
+ "shadcn": "dist/index.js"
+ },
+ "engines": {
+ "node": ">=20.18.1"
+ }
+ },
+ "node_modules/shadcn/node_modules/cn": {
+ "version": "0.2.6",
+ "resolved": "https://registry.npmjs.org/cn/-/cn-0.2.6.tgz",
+ "integrity": "sha512-+i4L0zUGgRcEnhsxueVrP7iBGxBx5iD0WOTYg1MwFEu2ZyCmH5Ov2V1cul2Ht5UchRQQgftCf4be/RxspuW6QQ==",
+ "license": "MIT",
+ "bin": {
+ "cn": "bin/cn.mjs"
+ },
+ "engines": {
+ "node": ">=20"
+ }
+ },
+ "node_modules/shadcn/node_modules/undici": {
+ "version": "7.30.2",
+ "resolved": "https://registry.npmjs.org/undici/-/undici-7.30.2.tgz",
+ "integrity": "sha512-mLyPQnHwUxaM/rideoK/+KL8DaAJLRl4aBCfmX444aCSLnIaomqPLtNRe2jdCYcsk5wZzXrDIQC8ZeYNRAYyIA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=20.18.1"
+ }
+ },
+ "node_modules/shebang-command": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
+ "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
+ "license": "MIT",
+ "dependencies": {
+ "shebang-regex": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/shebang-regex": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
+ "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/signal-exit": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz",
+ "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==",
+ "license": "ISC",
+ "engines": {
+ "node": ">=14"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/sisteransi": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz",
+ "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==",
+ "license": "MIT"
+ },
+ "node_modules/smart-buffer": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz",
+ "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 6.0.0",
+ "npm": ">= 3.0.0"
+ }
+ },
+ "node_modules/socks": {
+ "version": "2.8.10",
+ "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.10.tgz",
+ "integrity": "sha512-e0VyvkVTwVYViNovRkZ9aodhxVlyoMn7eJhVUPxZ+eK9P/7CBkxvvsBOHqFPEH416726W8tLXXXjKwqgTErrCQ==",
+ "license": "MIT",
+ "dependencies": {
+ "ip-address": "^10.1.1",
+ "smart-buffer": "^4.2.0"
+ },
+ "engines": {
+ "node": ">= 10.0.0",
+ "npm": ">= 3.0.0"
+ }
+ },
+ "node_modules/source-map": {
+ "version": "0.6.1",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+ "license": "BSD-3-Clause",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/source-map-js": {
+ "version": "1.2.2",
+ "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.2.tgz",
+ "integrity": "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==",
+ "license": "BSD-3-Clause",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/std-env": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/std-env/-/std-env-4.3.0.tgz",
+ "integrity": "sha512-OtU/EgQ1kIm5KwqQpBC6ZEMXrZRui11w8zgfTWp8cdO9B8OaPsbA8bTHO2P+HNo1VlUTGMVBwPhydu6poeXiag==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/stdin-discarder": {
+ "version": "0.2.2",
+ "resolved": "https://registry.npmjs.org/stdin-discarder/-/stdin-discarder-0.2.2.tgz",
+ "integrity": "sha512-UhDfHmA92YAlNnCfhmq0VeNL5bDbiZGg7sZ2IvPsXubGkiNa9EC+tUTsjBRsYUAz87btI6/1wf4XoVvQ3uRnmQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/string-width": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz",
+ "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==",
+ "license": "MIT",
+ "dependencies": {
+ "emoji-regex": "^10.3.0",
+ "get-east-asian-width": "^1.0.0",
+ "strip-ansi": "^7.1.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/string-width/node_modules/ansi-regex": {
+ "version": "6.6.0",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.6.0.tgz",
+ "integrity": "sha512-XZ5apbzreCbXSKwPjJstu8R0zOi247w3XYwWxtwBXgpZrCyc1Ka7p9/xY0A9/diMewmHbEKz+FIraWaEWjlN5g==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/ansi-regex?sponsor=1"
+ }
+ },
+ "node_modules/string-width/node_modules/strip-ansi": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz",
+ "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==",
+ "license": "MIT",
+ "dependencies": {
+ "ansi-regex": "^6.2.2"
+ },
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/strip-ansi?sponsor=1"
+ }
+ },
+ "node_modules/stringify-object": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/stringify-object/-/stringify-object-5.0.0.tgz",
+ "integrity": "sha512-zaJYxz2FtcMb4f+g60KsRNFOpVMUyuJgA51Zi5Z1DOTC3S59+OQiVOzE9GZt0x72uBGWKsQIuBKeF9iusmKFsg==",
+ "license": "BSD-2-Clause",
+ "dependencies": {
+ "get-own-enumerable-keys": "^1.0.0",
+ "is-obj": "^3.0.0",
+ "is-regexp": "^3.1.0"
+ },
+ "engines": {
+ "node": ">=14.16"
+ },
+ "funding": {
+ "url": "https://github.com/yeoman/stringify-object?sponsor=1"
+ }
+ },
+ "node_modules/stringify-object/node_modules/is-obj": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-3.0.0.tgz",
+ "integrity": "sha512-IlsXEHOjtKhpN8r/tRFj2nDyTmHvcfNeu/nrRIcXE17ROeatXchkojffa1SpdqW4cr/Fj6QkEf/Gn4zf6KKvEQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/strip-ansi": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
+ "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
+ "license": "MIT",
+ "dependencies": {
+ "ansi-regex": "^5.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/strip-bom": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz",
+ "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/strip-final-newline": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-4.0.0.tgz",
+ "integrity": "sha512-aulFJcD6YK8V1G7iRB5tigAP4TsHBZZrOV8pjV++zdUwmeV8uzbY7yn6h9MswN62adStNZFuCIx4haBnRuMDaw==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/strip-indent": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz",
+ "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "min-indent": "^1.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/systeminformation": {
+ "version": "5.33.19",
+ "resolved": "https://registry.npmjs.org/systeminformation/-/systeminformation-5.33.19.tgz",
+ "integrity": "sha512-Zm7wGeCG7PqfvzegMJIzrxICopWqYCeLATVmvxOOci1isLcNVKgY4Fr0hhYQzvc7cgtK3377jQVChTFAnznOiA==",
+ "license": "MIT",
+ "os": [
+ "darwin",
+ "linux",
+ "win32",
+ "freebsd",
+ "openbsd",
+ "netbsd",
+ "sunos",
+ "android"
+ ],
+ "bin": {
+ "systeminformation": "lib/cli.js"
+ },
+ "engines": {
+ "node": ">=10.0.0"
+ },
+ "funding": {
+ "type": "Buy me a coffee",
+ "url": "https://www.buymeacoffee.com/systeminfo"
+ }
+ },
+ "node_modules/tailwindcss": {
+ "version": "4.3.5",
+ "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.3.5.tgz",
+ "integrity": "sha512-FcQk9BuffmEHJP2G0XmB2SplU1aLTI7j07Kunk+U74Ny+XiWOtzXz9aujFZ/avntw1e2cOv/3PkgzflQ7gX2vQ==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/tapable": {
+ "version": "2.3.3",
+ "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.3.tgz",
+ "integrity": "sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/webpack"
+ }
+ },
+ "node_modules/tiny-invariant": {
+ "version": "1.3.3",
+ "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz",
+ "integrity": "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==",
+ "license": "MIT"
+ },
+ "node_modules/tinybench": {
+ "version": "6.2.3",
+ "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-6.2.3.tgz",
+ "integrity": "sha512-Al01C2JIBnO2CXCAPbpAl6sUiOZHeThGtHYNTa51JRw9PyWOCdr+9Ong05R4qg/Sk3+H645E8ov1h2c58ityNw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=20.0.0"
+ }
+ },
+ "node_modules/tinyexec": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.3.1.tgz",
+ "integrity": "sha512-GCvB3aoys96IuDFBMcTB46JOR6mdMtAToqwiW8JlWhsoh1mhHi/xn9ss/Dg7N555GiJyEt2qzoG/NHCwM6h1EA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tinyglobby": {
+ "version": "0.2.17",
+ "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz",
+ "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "fdir": "^6.5.0",
+ "picomatch": "^4.0.4"
+ },
+ "engines": {
+ "node": ">=12.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/SuperchupuDev"
+ }
+ },
+ "node_modules/tldts": {
+ "version": "7.4.24",
+ "resolved": "https://registry.npmjs.org/tldts/-/tldts-7.4.24.tgz",
+ "integrity": "sha512-U01tx3MjOgsmMlx4kcFzhQfuHmCiIWRTq2UGba5feyxh8T1swfWE5XXPkAQS5r2/Yps4zroS7IPgJW+lXtmiOA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "tldts-core": "^7.4.24"
+ },
+ "bin": {
+ "tldts": "bin/cli.js"
+ }
+ },
+ "node_modules/tldts-core": {
+ "version": "7.4.24",
+ "resolved": "https://registry.npmjs.org/tldts-core/-/tldts-core-7.4.24.tgz",
+ "integrity": "sha512-J2RPAloMbjXNAVxtJ0LlrMRUVqtvDQ0C4Kv6gT4FFk/2BAO2inFx3gJQtsttEYO59h0hWGl8cuA7UUzBb1x4dg==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/to-regex-range": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
+ "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
+ "license": "MIT",
+ "dependencies": {
+ "is-number": "^7.0.0"
+ },
+ "engines": {
+ "node": ">=8.0"
+ }
+ },
+ "node_modules/tough-cookie": {
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-6.1.0.tgz",
+ "integrity": "sha512-FTxc8u8Kl2tz0Lat1u8ksvcy8bwHRyEMawwTWybo51JqaC6O7SvfuhAKg+Ld6VqyIe2QRJBzY9HA7y2WyFRT2w==",
+ "dev": true,
+ "license": "BSD-3-Clause",
+ "dependencies": {
+ "tldts": "^7.0.5"
+ },
+ "engines": {
+ "node": ">=16"
+ }
+ },
+ "node_modules/tr46": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/tr46/-/tr46-7.0.0.tgz",
+ "integrity": "sha512-BcDSDW+SIGWVOns1Zm6Yg91q9AEj7eaID0QDY9oIqJD1A8dscNwMcl9Sms2DeuWCNov1X0/oXanHGYQBSLwZsg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "punycode": "^2.3.1"
+ },
+ "engines": {
+ "node": "^22.14.0 || >=24.0.0"
+ }
+ },
+ "node_modules/ts-morph": {
+ "version": "26.0.0",
+ "resolved": "https://registry.npmjs.org/ts-morph/-/ts-morph-26.0.0.tgz",
+ "integrity": "sha512-ztMO++owQnz8c/gIENcM9XfCEzgoGphTv+nKpYNM1bgsdOVC/jRZuEBf6N+mLLDNg68Kl+GgUZfOySaRiG1/Ug==",
+ "license": "MIT",
+ "dependencies": {
+ "@ts-morph/common": "~0.27.0",
+ "code-block-writer": "^13.0.3"
+ }
+ },
+ "node_modules/tsconfig-paths": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-4.2.0.tgz",
+ "integrity": "sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg==",
+ "license": "MIT",
+ "dependencies": {
+ "json5": "^2.2.2",
+ "minimist": "^1.2.6",
+ "strip-bom": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/tslib": {
+ "version": "2.9.1",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.9.1.tgz",
+ "integrity": "sha512-a4Ux9VKuIMHsOS7ENbEq6hK2ZGYIT27Rtl0E4eD9KqwxhKiQeMZE/9xb3IdYwWaSOyIBQLExhQgXDTYoiCxnWA==",
+ "license": "0BSD"
+ },
+ "node_modules/tw-animate-css": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/tw-animate-css/-/tw-animate-css-1.4.0.tgz",
+ "integrity": "sha512-7bziOlRqH0hJx80h/3mbicLW7o8qLsH5+RaLR2t+OHM3D0JlWGODQKQ4cxbK7WlvmUxpcj6Kgu6EKqjrGFe3QQ==",
+ "license": "MIT",
+ "funding": {
+ "url": "https://github.com/sponsors/Wombosvideo"
+ }
+ },
+ "node_modules/type-fest": {
+ "version": "4.41.0",
+ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz",
+ "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==",
+ "license": "(MIT OR CC0-1.0)",
+ "engines": {
+ "node": ">=16"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/typescript": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-7.0.2.tgz",
+ "integrity": "sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA==",
+ "devOptional": true,
+ "license": "Apache-2.0",
+ "bin": {
+ "tsc": "bin/tsc"
+ },
+ "engines": {
+ "node": ">=16.20.0"
+ },
+ "optionalDependencies": {
+ "@typescript/typescript-aix-ppc64": "7.0.2",
+ "@typescript/typescript-darwin-arm64": "7.0.2",
+ "@typescript/typescript-darwin-x64": "7.0.2",
+ "@typescript/typescript-freebsd-arm64": "7.0.2",
+ "@typescript/typescript-freebsd-x64": "7.0.2",
+ "@typescript/typescript-linux-arm": "7.0.2",
+ "@typescript/typescript-linux-arm64": "7.0.2",
+ "@typescript/typescript-linux-loong64": "7.0.2",
+ "@typescript/typescript-linux-mips64el": "7.0.2",
+ "@typescript/typescript-linux-ppc64": "7.0.2",
+ "@typescript/typescript-linux-riscv64": "7.0.2",
+ "@typescript/typescript-linux-s390x": "7.0.2",
+ "@typescript/typescript-linux-x64": "7.0.2",
+ "@typescript/typescript-netbsd-arm64": "7.0.2",
+ "@typescript/typescript-netbsd-x64": "7.0.2",
+ "@typescript/typescript-openbsd-arm64": "7.0.2",
+ "@typescript/typescript-openbsd-x64": "7.0.2",
+ "@typescript/typescript-sunos-x64": "7.0.2",
+ "@typescript/typescript-win32-arm64": "7.0.2",
+ "@typescript/typescript-win32-x64": "7.0.2"
+ }
+ },
+ "node_modules/undici": {
+ "version": "8.12.4",
+ "resolved": "https://registry.npmjs.org/undici/-/undici-8.12.4.tgz",
+ "integrity": "sha512-8Mx+uNKKER2bA4AdtedkqRbwUCIJFr2nJckXRe5yrDqzePqwLP7VNcctN8/XdmDSbF7mS+jJKIszlL+vbam1VA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=22.19.0"
+ }
+ },
+ "node_modules/undici-types": {
+ "version": "7.24.6",
+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.24.6.tgz",
+ "integrity": "sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/unicorn-magic": {
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.3.0.tgz",
+ "integrity": "sha512-+QBBXBCvifc56fsbuxZQ6Sic3wqqc3WWaqxs58gvJrcOuN83HGTCwz3oS5phzU9LthRNE9VrJCFCLUgHeeFnfA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/universalify": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz",
+ "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 10.0.0"
+ }
+ },
+ "node_modules/update-browserslist-db": {
+ "version": "1.3.4",
+ "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.4.tgz",
+ "integrity": "sha512-t8wonIOdQyOjtPd2VktlBu6QjTVTks6v8bSi7kd0r2Vll8TK1JYDZtRRdbmCHOAMphkZgrzK+L+vXK4pyZ8t4A==",
+ "funding": [
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/browserslist"
+ },
+ {
+ "type": "tidelift",
+ "url": "https://tidelift.com/funding/github/npm/browserslist"
+ },
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/ai"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "escalade": "^3.2.0",
+ "picocolors": "^1.1.1"
+ },
+ "bin": {
+ "update-browserslist-db": "cli.js"
+ },
+ "peerDependencies": {
+ "browserslist": ">= 4.21.0"
+ }
+ },
+ "node_modules/use-sync-external-store": {
+ "version": "1.7.0",
+ "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.7.0.tgz",
+ "integrity": "sha512-6L+EeigHMQhdaIPNIFUKwfWJSwWFQ8gJbJ2DLOs5sDIegTwR9fRxvnM3uciHKjIZhFz+KAv2emhWMRvDmMcY8A==",
+ "license": "MIT",
+ "peerDependencies": {
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
+ }
+ },
+ "node_modules/util-deprecate": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
+ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==",
+ "license": "MIT"
+ },
+ "node_modules/validate-npm-package-name": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-7.0.2.tgz",
+ "integrity": "sha512-hVDIBwsRruT73PbK7uP5ebUt+ezEtCmzZz3F59BSr2F6OVFnJ/6h8liuvdLrQ88Xmnk6/+xGGuq+pG9WwTuy3A==",
+ "license": "ISC",
+ "engines": {
+ "node": "^20.17.0 || >=22.9.0"
+ }
+ },
+ "node_modules/vite": {
+ "version": "8.3.8",
+ "resolved": "https://registry.npmjs.org/vite/-/vite-8.3.8.tgz",
+ "integrity": "sha512-LzOn3h9rG/0vhLdXrV4yJ4QFA9eEoqCl+Yx+kGJd7aB9w6nfNgVHKSYwLPZUHrz4ZGa+t+kXjV9itvcHDLQouA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "lightningcss": "^1.33.0",
+ "picomatch": "^4.0.7",
+ "postcss": "^8.5.32",
+ "rolldown": "~1.2.18",
+ "tinyglobby": "^0.2.17"
+ },
+ "bin": {
+ "vite": "bin/vite.js"
+ },
+ "engines": {
+ "node": "^20.19.0 || >=22.12.0"
+ },
+ "funding": {
+ "url": "https://github.com/vitejs/vite?sponsor=1"
+ },
+ "optionalDependencies": {
+ "fsevents": "~2.3.3"
+ },
+ "peerDependencies": {
+ "@types/node": "^20.19.0 || >=22.12.0",
+ "@vitejs/devtools": "^0.7.1 || ^0.8.0",
+ "esbuild": "^0.27.0 || ^0.28.0",
+ "jiti": ">=1.21.0",
+ "less": "^4.0.0",
+ "sass": "^1.70.0",
+ "sass-embedded": "^1.70.0",
+ "stylus": ">=0.54.8",
+ "sugarss": "^5.0.0",
+ "terser": "^5.16.0",
+ "tsx": "^4.8.1",
+ "yaml": "^2.4.2"
+ },
+ "peerDependenciesMeta": {
+ "@types/node": {
+ "optional": true
+ },
+ "@vitejs/devtools": {
+ "optional": true
+ },
+ "esbuild": {
+ "optional": true
+ },
+ "jiti": {
+ "optional": true
+ },
+ "less": {
+ "optional": true
+ },
+ "sass": {
+ "optional": true
+ },
+ "sass-embedded": {
+ "optional": true
+ },
+ "stylus": {
+ "optional": true
+ },
+ "sugarss": {
+ "optional": true
+ },
+ "terser": {
+ "optional": true
+ },
+ "tsx": {
+ "optional": true
+ },
+ "yaml": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/vitest": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/vitest/-/vitest-5.1.0.tgz",
+ "integrity": "sha512-MzmNFnrwa8v8lF1bLxw3UJ4EREwVOVb75VqJZmUDRjJ6EluK/x9th7qTbaeDk41WxE1GxWqmTXcdsfobfH5sOA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@types/chai": "^5.2.2",
+ "@vitest/mocker": "5.1.0",
+ "chai": "^6.3.0",
+ "es-module-lexer": "^2.3.2",
+ "expect-type": "^1.4.0",
+ "magic-string": "^1.4.3",
+ "obug": "^3.0.0",
+ "picomatch": "^4.0.7",
+ "std-env": "^4.3.0",
+ "tinybench": "^6.2.2",
+ "tinyexec": "^1.3.1",
+ "tinyglobby": "^0.2.17",
+ "why-is-node-running": "3.2.1"
+ },
+ "bin": {
+ "vitest": "vitest.mjs"
+ },
+ "engines": {
+ "node": "^22.12.0 || ^24.0.0 || >=26.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/vitest"
+ },
+ "peerDependencies": {
+ "@edge-runtime/vm": "*",
+ "@opentelemetry/api": "^1.9.0",
+ "@types/node": "^22.0.0 || >=24.0.0",
+ "@vitest/browser-playwright": "5.1.0",
+ "@vitest/browser-preview": "5.1.0",
+ "@vitest/browser-webdriverio": "^5.0.0-beta.5 || >=5.0.0",
+ "@vitest/coverage-istanbul": "5.1.0",
+ "@vitest/coverage-v8": "5.1.0",
+ "@vitest/ui": "5.1.0",
+ "happy-dom": "*",
+ "jsdom": "*",
+ "vite": "^6.4.0 || ^7.0.0 || ^8.0.0"
+ },
+ "peerDependenciesMeta": {
+ "@edge-runtime/vm": {
+ "optional": true
+ },
+ "@opentelemetry/api": {
+ "optional": true
+ },
+ "@types/node": {
+ "optional": true
+ },
+ "@vitest/browser-playwright": {
+ "optional": true
+ },
+ "@vitest/browser-preview": {
+ "optional": true
+ },
+ "@vitest/browser-webdriverio": {
+ "optional": true
+ },
+ "@vitest/coverage-istanbul": {
+ "optional": true
+ },
+ "@vitest/coverage-v8": {
+ "optional": true
+ },
+ "@vitest/ui": {
+ "optional": true
+ },
+ "happy-dom": {
+ "optional": true
+ },
+ "jsdom": {
+ "optional": true
+ },
+ "vite": {
+ "optional": false
+ }
+ }
+ },
+ "node_modules/w3c-xmlserializer": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-6.0.0.tgz",
+ "integrity": "sha512-4Nsy8K5Tr6SPDH9jhKJOHf7ChDrc1zufZTVSF7x72hwuEXBqxqk9G6cK+K2NRUtB3iELRJqjXb4JPDMBjMTl2Q==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "xml-name-validator": "^5.0.0"
+ },
+ "engines": {
+ "node": "^22.22.2 || ^24.15.0 || >=26.0.0"
+ }
+ },
+ "node_modules/webidl-conversions": {
+ "version": "8.0.1",
+ "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-8.0.1.tgz",
+ "integrity": "sha512-BMhLD/Sw+GbJC21C/UgyaZX41nPt8bUTg+jWyDeg7e7YN4xOM05YPSIXceACnXVtqyEw/LMClUQMtMZ+PGGpqQ==",
+ "dev": true,
+ "license": "BSD-2-Clause",
+ "engines": {
+ "node": ">=20"
+ }
+ },
+ "node_modules/whatwg-mimetype": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-5.0.0.tgz",
+ "integrity": "sha512-sXcNcHOC51uPGF0P/D4NVtrkjSU2fNsm9iog4ZvZJsL3rjoDAzXZhkm2MWt1y+PUdggKAYVoMAIYcs78wJ51Cw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=20"
+ }
+ },
+ "node_modules/whatwg-url": {
+ "version": "17.3.0",
+ "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-17.3.0.tgz",
+ "integrity": "sha512-KwOAJrpf+GTgBvcBQJcP38sMF0DsQKdwtG+TxM2pW44P6E5k0hDbWrDmyuJDIF0Uef0aQq0ZoJs+5oI+k8ddhg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@exodus/bytes": "^1.16.0",
+ "tr46": "^7.0.0",
+ "webidl-conversions": "^8.0.1"
+ },
+ "engines": {
+ "node": "^22.14.0 || >=24.0.0"
+ }
+ },
+ "node_modules/which": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/which/-/which-4.0.0.tgz",
+ "integrity": "sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg==",
+ "license": "ISC",
+ "dependencies": {
+ "isexe": "^3.1.1"
+ },
+ "bin": {
+ "node-which": "bin/which.js"
+ },
+ "engines": {
+ "node": "^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/why-is-node-running": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-3.2.1.tgz",
+ "integrity": "sha512-Tb2FUhB4vUsGQlfSquQLYkApkuPAFQXGFzxWKHHumVz2dK+X1RUm/HnID4+TfIGYJ1kTcwOaCk/buYCEJr6YjQ==",
+ "dev": true,
+ "license": "MIT",
+ "bin": {
+ "why-is-node-running": "cli.js"
+ },
+ "engines": {
+ "node": ">=20.11"
+ }
+ },
+ "node_modules/wsl-utils": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/wsl-utils/-/wsl-utils-1.0.1.tgz",
+ "integrity": "sha512-c16PKLIRxBYpR3jSWsdS7SFp0COm5SOQdiFjY818dYFHJbMGuLBszpF07LBWmOS1uzrHa9VGdynsEgoeKy0oOQ==",
+ "license": "MIT",
+ "dependencies": {
+ "is-wsl": "^3.1.0",
+ "powershell-utils": "^0.2.0"
+ },
+ "engines": {
+ "node": ">=20"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/xml-name-validator": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-5.0.0.tgz",
+ "integrity": "sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/xmlchars": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz",
+ "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/yallist": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",
+ "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==",
+ "license": "ISC"
+ },
+ "node_modules/yocto-spinner": {
+ "version": "1.2.2",
+ "resolved": "https://registry.npmjs.org/yocto-spinner/-/yocto-spinner-1.2.2.tgz",
+ "integrity": "sha512-DODGl1wJjA/s5pnJFKau9lIYHT81lnhob1i3e1TjxZRxEhWRKl74nTbWE6H5KlkViQQTo/Z29YFdxzTZAMY3ng==",
+ "license": "MIT",
+ "dependencies": {
+ "yoctocolors": "^2.1.1"
+ },
+ "engines": {
+ "node": ">=18.19"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/yoctocolors": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/yoctocolors/-/yoctocolors-2.2.0.tgz",
+ "integrity": "sha512-xYqdZFUK/VYazNl/oCDYN+3WloWQwMfZxBoiNt6qNyk+xfOdi598muWE42rNZFp1kNOiqW936q5RhUdnpqElSg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/zod": {
+ "version": "4.6.7",
+ "resolved": "https://registry.npmjs.org/zod/-/zod-4.6.7.tgz",
+ "integrity": "sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg==",
+ "license": "MIT",
+ "funding": {
+ "url": "https://github.com/sponsors/colinhacks"
+ }
+ },
+ "node_modules/zustand": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/zustand/-/zustand-5.1.0.tgz",
+ "integrity": "sha512-ciJZlP48M1PTQbVQq81CGVFxHTLpZNrFjKqwjtCU34AWuXTZT/jrF3p9+fI84Cf1eSCMLapxqBy/SNTfwOBuqA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=12.20.0"
+ },
+ "peerDependencies": {
+ "@types/react": ">=18.0.0",
+ "immer": ">=9.0.6",
+ "react": ">=18.0.0",
+ "use-sync-external-store": ">=1.2.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "immer": {
+ "optional": true
+ },
+ "react": {
+ "optional": true
+ },
+ "use-sync-external-store": {
+ "optional": true
+ }
+ }
+ }
+ }
+}
diff --git a/web/package.json b/web/package.json
new file mode 100644
index 0000000..5fc1577
--- /dev/null
+++ b/web/package.json
@@ -0,0 +1,47 @@
+{
+ "name": "sonda-web",
+ "private": true,
+ "version": "0.0.0",
+ "type": "module",
+ "scripts": {
+ "dev": "vite",
+ "build": "tsc -b && vite build",
+ "lint": "oxlint",
+ "preview": "vite preview",
+ "test": "vitest run",
+ "gen:api": "node scripts/gen-api.mjs"
+ },
+ "dependencies": {
+ "@base-ui/react": "^1.9.0",
+ "@fontsource/figtree": "^5.3.0",
+ "@fontsource/fraunces": "^5.3.0",
+ "@tanstack/react-query": "^5.107.1",
+ "class-variance-authority": "^0.7.1",
+ "cn": "^0.5.2",
+ "i18next": "^27.1.1",
+ "lucide-react": "^1.72.0",
+ "react": "^19.3.1",
+ "react-dom": "^19.3.1",
+ "react-i18next": "^18.0.1",
+ "react-router-dom": "^7.18.5",
+ "shadcn": "^4.23.0",
+ "tw-animate-css": "^1.4.0",
+ "zustand": "^5.1.0"
+ },
+ "devDependencies": {
+ "@tailwindcss/vite": "^4.3.5",
+ "@testing-library/jest-dom": "^7.0.1",
+ "@testing-library/react": "^16.3.3",
+ "@testing-library/user-event": "^14.6.10",
+ "@types/node": "^24.19.2",
+ "@types/react": "^19.3.0",
+ "@types/react-dom": "^19.3.0",
+ "@vitejs/plugin-react": "^6.1.2",
+ "jsdom": "^31.0.0",
+ "oxlint": "^1.90.0",
+ "tailwindcss": "^4.3.5",
+ "typescript": "~7.0.2",
+ "vite": "^8.3.6",
+ "vitest": "^5.1.0"
+ }
+}
diff --git a/web/public/favicon.svg b/web/public/favicon.svg
new file mode 100644
index 0000000..6893eb1
--- /dev/null
+++ b/web/public/favicon.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/web/scripts/gen-api.mjs b/web/scripts/gen-api.mjs
new file mode 100644
index 0000000..5de7b5f
--- /dev/null
+++ b/web/scripts/gen-api.mjs
@@ -0,0 +1,13 @@
+// Regenerates src/api/schema.d.ts from the API spec in the Go module.
+// openapi-typescript is run through npx because it still asks for TypeScript 5 as a peer.
+import { execFileSync } from 'node:child_process'
+import { fileURLToPath } from 'node:url'
+
+const root = fileURLToPath(new URL('..', import.meta.url))
+const spec = fileURLToPath(new URL('../../internal/api/openapi/openapi.yaml', import.meta.url))
+
+execFileSync(
+ 'npx',
+ ['--yes', 'openapi-typescript@7.13.0', spec, '-o', 'src/api/schema.d.ts'],
+ { cwd: root, stdio: 'inherit' },
+)
diff --git a/web/src/App.tsx b/web/src/App.tsx
new file mode 100644
index 0000000..1060a12
--- /dev/null
+++ b/web/src/App.tsx
@@ -0,0 +1,17 @@
+import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
+import { createBrowserRouter, RouterProvider } from 'react-router-dom'
+import AuthGate from './auth/AuthGate'
+import { routes } from './router'
+
+const queryClient = new QueryClient({ defaultOptions: { queries: { staleTime: 30_000, retry: 1 } } })
+const router = createBrowserRouter(routes)
+
+export default function App() {
+ return (
+
+
+
+
+
+ )
+}
diff --git a/web/src/api/catalog.test.tsx b/web/src/api/catalog.test.tsx
new file mode 100644
index 0000000..5f9a8e2
--- /dev/null
+++ b/web/src/api/catalog.test.tsx
@@ -0,0 +1,101 @@
+import { act, renderHook, waitFor } from '@testing-library/react'
+import { expect, test } from 'vitest'
+import { createWrapper } from '@/test/queryWrapper'
+import { mockFetch } from '@/test/mockFetch'
+import { useAlbum, useAlbumList, useArtist, useArtistList, useTrackList } from './catalog'
+
+/** A page of `total` fake items, 50 at a time, as the server pages them. */
+function paged(total: number, make: (i: number) => object) {
+ return ({ url }: { url: URL }) => {
+ const limit = Number(url.searchParams.get('limit') ?? 50)
+ const offset = Number(url.searchParams.get('offset') ?? 0)
+ const items = Array.from({ length: Math.max(0, Math.min(limit, total - offset)) }, (_, i) => make(offset + i))
+ return { items, total, limit, offset }
+ }
+}
+
+const artist = (i: number) => ({ id: i + 1, name: `Artist ${i}`, album_count: 1, track_count: 3 })
+
+test('pages are asked for 50 at a time and the next one is offered until the end', async () => {
+ const { calls } = mockFetch({ 'GET /api/v1/artists': paged(120, artist) })
+ const { result } = renderHook(() => useArtistList(), { wrapper: createWrapper() })
+
+ await waitFor(() => expect(result.current.data?.items).toHaveLength(50))
+ expect(result.current.data?.total).toBe(120)
+ expect(result.current.hasNextPage).toBe(true)
+ expect(calls[0].url.searchParams.get('limit')).toBe('50')
+ expect(calls[0].url.searchParams.get('offset')).toBe('0')
+
+ await act(() => result.current.fetchNextPage())
+ await waitFor(() => expect(result.current.data?.items).toHaveLength(100))
+ expect(result.current.hasNextPage).toBe(true)
+
+ await act(() => result.current.fetchNextPage())
+ await waitFor(() => expect(result.current.data?.items).toHaveLength(120))
+ expect(result.current.hasNextPage).toBe(false)
+ expect(calls.map((c) => c.url.searchParams.get('offset'))).toEqual(['0', '50', '100'])
+})
+
+test('an empty library has no next page', async () => {
+ mockFetch({ 'GET /api/v1/artists': paged(0, artist) })
+ const { result } = renderHook(() => useArtistList(), { wrapper: createWrapper() })
+ await waitFor(() => expect(result.current.isSuccess).toBe(true))
+ expect(result.current.data?.items).toEqual([])
+ expect(result.current.hasNextPage).toBe(false)
+})
+
+test('the search text goes to the server as typed', async () => {
+ const { calls } = mockFetch({ 'GET /api/v1/artists': paged(1, artist) })
+ const { result } = renderHook(() => useArtistList('bjork'), { wrapper: createWrapper() })
+ await waitFor(() => expect(result.current.isSuccess).toBe(true))
+ expect(calls[0].url.searchParams.get('q')).toBe('bjork')
+})
+
+test('no search text sends no q', async () => {
+ const { calls } = mockFetch({ 'GET /api/v1/artists': paged(1, artist) })
+ const { result } = renderHook(() => useArtistList(), { wrapper: createWrapper() })
+ await waitFor(() => expect(result.current.isSuccess).toBe(true))
+ expect(calls[0].url.searchParams.has('q')).toBe(false)
+})
+
+test('a list can ask for a smaller page', async () => {
+ const { calls } = mockFetch({ 'GET /api/v1/artists': paged(10, artist) })
+ const { result } = renderHook(() => useArtistList('x', { pageSize: 6 }), { wrapper: createWrapper() })
+ await waitFor(() => expect(result.current.data?.items).toHaveLength(6))
+ expect(calls[0].url.searchParams.get('limit')).toBe('6')
+ expect(result.current.hasNextPage).toBe(true)
+})
+
+test('a list that is switched off asks for nothing', async () => {
+ const { calls } = mockFetch({ 'GET /api/v1/artists': paged(1, artist) })
+ const { result } = renderHook(() => useArtistList('x', { enabled: false }), { wrapper: createWrapper() })
+ await new Promise((r) => setTimeout(r, 50))
+ expect(calls).toHaveLength(0)
+ expect(result.current.data).toBeUndefined()
+})
+
+test('albums can be limited to an artist', async () => {
+ const { calls } = mockFetch({ 'GET /api/v1/albums': paged(1, (i) => ({ id: i + 1, title: 'A' })) })
+ const { result } = renderHook(() => useAlbumList({ artistId: 7 }), { wrapper: createWrapper() })
+ await waitFor(() => expect(result.current.isSuccess).toBe(true))
+ expect(calls[0].url.searchParams.get('artist_id')).toBe('7')
+})
+
+test('tracks can be limited to an album', async () => {
+ const { calls } = mockFetch({ 'GET /api/v1/tracks': paged(1, (i) => ({ id: i + 1, title: 'T' })) })
+ const { result } = renderHook(() => useTrackList({ albumId: 4 }), { wrapper: createWrapper() })
+ await waitFor(() => expect(result.current.isSuccess).toBe(true))
+ expect(calls[0].url.searchParams.get('album_id')).toBe('4')
+})
+
+test('one artist and one album are read by id', async () => {
+ mockFetch({
+ 'GET /api/v1/artists/3': () => artist(2),
+ 'GET /api/v1/albums/9': () => ({ id: 9, title: 'Homogenic', artist: null, track_count: 10, duration_ms: 1 }),
+ })
+ const wrapper = createWrapper()
+ const a = renderHook(() => useArtist(3), { wrapper })
+ const b = renderHook(() => useAlbum(9), { wrapper })
+ await waitFor(() => expect(a.result.current.data?.name).toBe('Artist 2'))
+ await waitFor(() => expect(b.result.current.data?.title).toBe('Homogenic'))
+})
diff --git a/web/src/api/catalog.ts b/web/src/api/catalog.ts
new file mode 100644
index 0000000..5cfe6ec
--- /dev/null
+++ b/web/src/api/catalog.ts
@@ -0,0 +1,63 @@
+import { useInfiniteQuery, useQuery } from '@tanstack/react-query'
+import type { components } from './schema'
+import { api } from './client'
+
+export type Artist = components['schemas']['Artist']
+export type Album = components['schemas']['Album']
+export type Track = components['schemas']['Track']
+
+export interface Page {
+ items: T[]
+ total: number
+ limit: number
+ offset: number
+}
+
+const PAGE_SIZE = 50
+
+type Params = Record
+
+export interface ListOptions {
+ /** How many items one request asks for (default 50). */
+ pageSize?: number
+ /** False keeps the list from asking for anything yet (default true). */
+ enabled?: boolean
+}
+
+/** A list the server pages by `limit` and `offset`, read one page after the other. */
+function usePagedList(path: string, params: Params, opts: ListOptions = {}) {
+ const pageSize = opts.pageSize ?? PAGE_SIZE
+ return useInfiniteQuery({
+ queryKey: [path, params, pageSize],
+ enabled: opts.enabled ?? true,
+ initialPageParam: 0,
+ queryFn: ({ pageParam }) => api.get>(path, { ...params, limit: pageSize, offset: pageParam }),
+ getNextPageParam: (last) => {
+ const next = last.offset + last.items.length
+ return last.items.length > 0 && next < last.total ? next : undefined
+ },
+ select: (data) => ({ items: data.pages.flatMap((p) => p.items), total: data.pages[0]?.total ?? 0 }),
+ })
+}
+
+export function useArtistList(q?: string, list: ListOptions = {}) {
+ return usePagedList('/artists', { q: q || undefined }, list)
+}
+
+export function useAlbumList(opts: { q?: string; artistId?: number } & ListOptions = {}) {
+ const { q, artistId, ...list } = opts
+ return usePagedList('/albums', { q: q || undefined, artist_id: artistId }, list)
+}
+
+export function useTrackList(opts: { q?: string; artistId?: number; albumId?: number } & ListOptions = {}) {
+ const { q, artistId, albumId, ...list } = opts
+ return usePagedList('/tracks', { q: q || undefined, artist_id: artistId, album_id: albumId }, list)
+}
+
+export function useArtist(id: number) {
+ return useQuery({ queryKey: ['artist', id], queryFn: () => api.get(`/artists/${id}`) })
+}
+
+export function useAlbum(id: number) {
+ return useQuery({ queryKey: ['album', id], queryFn: () => api.get(`/albums/${id}`) })
+}
diff --git a/web/src/api/client.test.ts b/web/src/api/client.test.ts
new file mode 100644
index 0000000..12ef72d
--- /dev/null
+++ b/web/src/api/client.test.ts
@@ -0,0 +1,113 @@
+import { beforeEach, expect, test, vi } from 'vitest'
+import { apiError, mockFetch } from '@/test/mockFetch'
+import { api, ApiError, setAuthHooks } from './client'
+
+const hooks = {
+ getAccessToken: vi.fn(async () => 't1' as string | null),
+ refresh: vi.fn(async () => 't2' as string | null),
+ signOut: vi.fn(),
+}
+
+beforeEach(() => {
+ hooks.getAccessToken.mockClear().mockResolvedValue('t1')
+ hooks.refresh.mockClear().mockResolvedValue('t2')
+ hooks.signOut.mockClear()
+ setAuthHooks(hooks)
+})
+
+function authorization(call: { init: RequestInit }): string | undefined {
+ return (call.init.headers as Record).Authorization
+}
+
+test('sends the access token as a bearer token', async () => {
+ const { calls } = mockFetch({ 'GET /api/v1/artists': () => ({ items: [] }) })
+ await api.get('/artists')
+ expect(authorization(calls[0])).toBe('Bearer t1')
+})
+
+test('an error response becomes an ApiError with the server code', async () => {
+ mockFetch({ 'GET /api/v1/artists': () => apiError(400, 'invalid_input', 'bad limit') })
+ const failure = await api.get('/artists').catch((e: unknown) => e)
+ expect(failure).toBeInstanceOf(ApiError)
+ expect(failure).toMatchObject({ status: 400, code: 'invalid_input', message: 'bad limit' })
+})
+
+test('a 401 renews the session and retries once', async () => {
+ let n = 0
+ const { calls } = mockFetch({
+ 'GET /api/v1/artists': () => (++n === 1 ? apiError(401, 'unauthorized') : { items: ['ok'] }),
+ })
+ await expect(api.get('/artists')).resolves.toEqual({ items: ['ok'] })
+ expect(calls).toHaveLength(2)
+ expect(hooks.refresh).toHaveBeenCalledTimes(1)
+ expect(authorization(calls[1])).toBe('Bearer t2')
+ expect(hooks.signOut).not.toHaveBeenCalled()
+})
+
+test('a second 401 signs the user out and the error reaches the caller', async () => {
+ const { calls } = mockFetch({ 'GET /api/v1/artists': () => apiError(401, 'unauthorized') })
+ await expect(api.get('/artists')).rejects.toMatchObject({ status: 401, code: 'unauthorized' })
+ expect(calls).toHaveLength(2)
+ expect(hooks.signOut).toHaveBeenCalledTimes(1)
+})
+
+test('a 401 with nothing to renew signs out without a retry', async () => {
+ hooks.refresh.mockResolvedValue(null)
+ const { calls } = mockFetch({ 'GET /api/v1/artists': () => apiError(401, 'unauthorized') })
+ await expect(api.get('/artists')).rejects.toMatchObject({ status: 401 })
+ expect(calls).toHaveLength(1)
+ expect(hooks.signOut).toHaveBeenCalledTimes(1)
+})
+
+test('a call that does not need a session sends no token and never renews', async () => {
+ const { calls } = mockFetch({ 'POST /api/v1/auth/login': () => apiError(401, 'invalid_credentials') })
+ await expect(api.post('/auth/login', { username: 'a', password: 'b' }, { auth: false })).rejects.toMatchObject({
+ code: 'invalid_credentials',
+ })
+ expect(hooks.getAccessToken).not.toHaveBeenCalled()
+ expect(hooks.refresh).not.toHaveBeenCalled()
+ expect(authorization(calls[0])).toBeUndefined()
+})
+
+test('query values are sent, undefined ones are left out', async () => {
+ const { calls } = mockFetch({ 'GET /api/v1/albums': () => ({ items: [] }) })
+ await api.get('/albums', { q: 'björk', limit: 50, artist_id: undefined, counted: true })
+ expect(calls[0].url.searchParams.get('q')).toBe('björk')
+ expect(calls[0].url.searchParams.get('limit')).toBe('50')
+ expect(calls[0].url.searchParams.has('artist_id')).toBe(false)
+ expect(calls[0].url.searchParams.get('counted')).toBe('true')
+})
+
+test('a JSON body is sent with its content type', async () => {
+ const { calls } = mockFetch({ 'POST /api/v1/listens': () => ({ status: 'recorded' }) })
+ await api.post('/listens', { track_id: 3 })
+ expect((calls[0].init.headers as Record)['Content-Type']).toBe('application/json')
+ expect(JSON.parse(calls[0].init.body as string)).toEqual({ track_id: 3 })
+})
+
+test('keepalive lets a request outlive the page', async () => {
+ const { calls } = mockFetch({ 'POST /api/v1/listens': () => ({ status: 'recorded' }) })
+ await api.post('/listens', { track_id: 3 }, { keepalive: true })
+ expect(calls[0].init.keepalive).toBe(true)
+})
+
+test('a request without keepalive does not ask for it', async () => {
+ const { calls } = mockFetch({ 'POST /api/v1/listens': () => ({ status: 'recorded' }) })
+ await api.post('/listens', { track_id: 3 })
+ expect(calls[0].init.keepalive).toBeUndefined()
+})
+
+test('a 204 answer gives undefined', async () => {
+ mockFetch({ 'POST /api/v1/auth/logout': () => new Response(null, { status: 204 }) })
+ await expect(api.post('/auth/logout', { refresh_token: 'r' }, { auth: false })).resolves.toBeUndefined()
+})
+
+test('a network failure becomes an ApiError with the code network', async () => {
+ vi.stubGlobal(
+ 'fetch',
+ vi.fn(async () => {
+ throw new TypeError('Failed to fetch')
+ }),
+ )
+ await expect(api.get('/artists')).rejects.toMatchObject({ status: 0, code: 'network' })
+})
diff --git a/web/src/api/client.ts b/web/src/api/client.ts
new file mode 100644
index 0000000..6a33e67
--- /dev/null
+++ b/web/src/api/client.ts
@@ -0,0 +1,105 @@
+/** What the server answers when a call fails: `{"error": {"code", "message"}}`. */
+export class ApiError extends Error {
+ status: number
+ code: string
+
+ constructor(status: number, code: string, message: string) {
+ super(message)
+ this.name = 'ApiError'
+ this.status = status
+ this.code = code
+ }
+}
+
+/** The session side of a call, injected so that this file never imports the session (which imports this). */
+export interface AuthHooks {
+ getAccessToken(): Promise
+ /** Renews the session; resolves to the new access token, or null when there is nothing to renew. */
+ refresh(): Promise
+ signOut(): void
+}
+
+let hooks: AuthHooks = {
+ getAccessToken: async () => null,
+ refresh: async () => null,
+ signOut: () => {},
+}
+
+export function setAuthHooks(next: AuthHooks): void {
+ hooks = next
+}
+
+type Query = Record
+
+export interface CallOptions {
+ /** Default true. Login, register, refresh and logout say false: they carry no token and never renew. */
+ auth?: boolean
+ /** Lets the request finish after the page is closed (the browser allows it for small bodies). */
+ keepalive?: boolean
+}
+
+const BASE = '/api/v1'
+
+function buildUrl(path: string, params?: Query): string {
+ const query = new URLSearchParams()
+ for (const [key, value] of Object.entries(params ?? {})) {
+ if (value !== undefined) query.set(key, String(value))
+ }
+ const text = query.toString()
+ return `${BASE}${path}${text ? `?${text}` : ''}`
+}
+
+async function toApiError(res: Response): Promise {
+ try {
+ const body = (await res.json()) as { error?: { code?: string; message?: string } }
+ return new ApiError(res.status, body.error?.code ?? 'unknown', body.error?.message ?? res.statusText)
+ } catch {
+ return new ApiError(res.status, 'unknown', res.statusText)
+ }
+}
+
+async function send(
+ method: string,
+ url: string,
+ body: unknown,
+ token: string | null,
+ keepalive: boolean | undefined,
+): Promise {
+ const headers: Record = { Accept: 'application/json' }
+ if (body !== undefined) headers['Content-Type'] = 'application/json'
+ if (token) headers.Authorization = `Bearer ${token}`
+ try {
+ return await fetch(url, {
+ method,
+ headers,
+ body: body === undefined ? undefined : JSON.stringify(body),
+ keepalive: keepalive || undefined,
+ })
+ } catch {
+ throw new ApiError(0, 'network', 'The server cannot be reached')
+ }
+}
+
+async function request(method: string, path: string, params: Query | undefined, body: unknown, opts: CallOptions): Promise {
+ const auth = opts.auth ?? true
+ const url = buildUrl(path, params)
+ let res = await send(method, url, body, auth ? await hooks.getAccessToken() : null, opts.keepalive)
+
+ if (res.status === 401 && auth) {
+ const fresh = await hooks.refresh()
+ if (fresh) res = await send(method, url, body, fresh, opts.keepalive)
+ if (res.status === 401) hooks.signOut()
+ }
+
+ if (!res.ok) throw await toApiError(res)
+ if (res.status === 204) return undefined as T
+ return (await res.json()) as T
+}
+
+export const api = {
+ get: (path: string, params?: Query, opts: CallOptions = {}) => request('GET', path, params, undefined, opts),
+ post: (path: string, body?: unknown, opts: CallOptions = {}) => request('POST', path, undefined, body ?? {}, opts),
+ patch: (path: string, body?: unknown, opts: CallOptions = {}) => request('PATCH', path, undefined, body ?? {}, opts),
+ put: (path: string, body?: unknown, opts: CallOptions = {}) => request('PUT', path, undefined, body ?? {}, opts),
+ del: (path: string, opts: CallOptions = {}) => request('DELETE', path, undefined, undefined, opts),
+}
diff --git a/web/src/api/listens.ts b/web/src/api/listens.ts
new file mode 100644
index 0000000..5e08e63
--- /dev/null
+++ b/web/src/api/listens.ts
@@ -0,0 +1,22 @@
+import { useQuery } from '@tanstack/react-query'
+import { api } from './client'
+import type { components } from './schema'
+
+type Listen = components['schemas']['Listen']
+export type ListenItem = components['schemas']['ListenItem']
+type ListenPage = components['schemas']['ListenPage']
+
+/** The last 30 listens that count, newest first. */
+export function useRecentListens() {
+ return useQuery({
+ queryKey: ['listens', 'recent'],
+ queryFn: () => api.get('/listens', { counted: true, limit: 30 }),
+ })
+}
+
+/** What `POST /listens` takes, with the fields the player always sends. */
+export type ListenBody = Required>
+
+export async function sendListen(body: ListenBody, opts?: { keepalive?: boolean }): Promise {
+ await api.post('/listens', body, { keepalive: opts?.keepalive })
+}
diff --git a/web/src/api/providers.ts b/web/src/api/providers.ts
new file mode 100644
index 0000000..1b8b5e9
--- /dev/null
+++ b/web/src/api/providers.ts
@@ -0,0 +1,47 @@
+import { useQuery } from '@tanstack/react-query'
+import { api, ApiError } from './client'
+import type { components } from './schema'
+
+export type ArtistDescription = components['schemas']['ArtistDescription']
+export type SimilarArtists = components['schemas']['SimilarArtists']
+export type ArtistTags = components['schemas']['ArtistTags']
+export type PictureCredit = components['schemas']['PictureCredit']
+
+export function useArtistDescription(id: number) {
+ return useQuery({
+ queryKey: ['artist', id, 'description'],
+ queryFn: () => api.get(`/artists/${id}/description`),
+ })
+}
+
+export function useSimilarArtists(id: number) {
+ return useQuery({
+ queryKey: ['artist', id, 'similar'],
+ queryFn: () => api.get(`/artists/${id}/similar`),
+ })
+}
+
+export function useArtistTags(id: number) {
+ return useQuery({
+ queryKey: ['artist', id, 'tags'],
+ queryFn: () => api.get(`/artists/${id}/tags`),
+ })
+}
+
+/**
+ * The credit of the artist photo. There is no credit when there is no picture (provider off, no free
+ * picture, no MusicBrainz id) or the picture provider is down: those answer `null`, not an error.
+ */
+export function useArtistImageCredit(id: number) {
+ return useQuery({
+ queryKey: ['artist', id, 'image-credit'],
+ queryFn: async () => {
+ try {
+ return await api.get(`/artists/${id}/image/credit`)
+ } catch (e) {
+ if (e instanceof ApiError && (e.status === 404 || e.status === 502)) return null
+ throw e
+ }
+ },
+ })
+}
diff --git a/web/src/api/schema.d.ts b/web/src/api/schema.d.ts
new file mode 100644
index 0000000..fceae48
--- /dev/null
+++ b/web/src/api/schema.d.ts
@@ -0,0 +1,4016 @@
+/**
+ * This file was auto-generated by openapi-typescript.
+ * Do not make direct changes to the file.
+ */
+
+export interface paths {
+ "/health": {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ /** Liveness check */
+ get: operations["getHealth"];
+ put?: never;
+ post?: never;
+ delete?: never;
+ options?: never;
+ head?: never;
+ patch?: never;
+ trace?: never;
+ };
+ "/openapi.yaml": {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ /** This document */
+ get: operations["getOpenAPI"];
+ put?: never;
+ post?: never;
+ delete?: never;
+ options?: never;
+ head?: never;
+ patch?: never;
+ trace?: never;
+ };
+ "/auth/register": {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ get?: never;
+ put?: never;
+ /**
+ * Create the first user
+ * @description Only works while no user exists. The new user is the admin. Afterwards registration is
+ * closed and admins create accounts with `POST /users`.
+ */
+ post: operations["register"];
+ delete?: never;
+ options?: never;
+ head?: never;
+ patch?: never;
+ trace?: never;
+ };
+ "/auth/login": {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ get?: never;
+ put?: never;
+ /** Open a session */
+ post: operations["login"];
+ delete?: never;
+ options?: never;
+ head?: never;
+ patch?: never;
+ trace?: never;
+ };
+ "/auth/refresh": {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ get?: never;
+ put?: never;
+ /**
+ * Renew a session
+ * @description Exchanges a refresh token for a new access token and a new refresh token. The old refresh
+ * token stops working. Presenting a spent one again, more than ten seconds after it was used,
+ * ends every session of that user; inside those ten seconds it only fails, so two tabs
+ * refreshing together do not log each other out. This holds for any spent token, including
+ * one revoked by logout or by a password change.
+ */
+ post: operations["refresh"];
+ delete?: never;
+ options?: never;
+ head?: never;
+ patch?: never;
+ trace?: never;
+ };
+ "/auth/logout": {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ get?: never;
+ put?: never;
+ /**
+ * End a session
+ * @description Revokes one refresh token. Always answers 204, so it never reveals whether the token existed.
+ */
+ post: operations["logout"];
+ delete?: never;
+ options?: never;
+ head?: never;
+ patch?: never;
+ trace?: never;
+ };
+ "/auth/me": {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ /** The signed-in account */
+ get: operations["getMe"];
+ put?: never;
+ post?: never;
+ delete?: never;
+ options?: never;
+ head?: never;
+ patch?: never;
+ trace?: never;
+ };
+ "/auth/password": {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ get?: never;
+ put?: never;
+ /**
+ * Change your password
+ * @description Revokes every refresh token of the account, so no session can be renewed. An access token
+ * that was already issued keeps working until it expires (15 minutes by default).
+ */
+ post: operations["changePassword"];
+ delete?: never;
+ options?: never;
+ head?: never;
+ patch?: never;
+ trace?: never;
+ };
+ "/users": {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ /**
+ * List users
+ * @description Admin only.
+ */
+ get: operations["listUsers"];
+ put?: never;
+ /**
+ * Create a user
+ * @description Admin only.
+ */
+ post: operations["createUser"];
+ delete?: never;
+ options?: never;
+ head?: never;
+ patch?: never;
+ trace?: never;
+ };
+ "/users/{id}": {
+ parameters: {
+ query?: never;
+ header?: never;
+ path: {
+ id: components["parameters"]["Id"];
+ };
+ cookie?: never;
+ };
+ get?: never;
+ put?: never;
+ post?: never;
+ /**
+ * Delete a user
+ * @description Admin only. Removes the account and its refresh tokens. Access tokens already issued stop
+ * working at once on admin routes, `/auth/me`, `/auth/password` and `/listens`; other routes
+ * accept them until they expire (15 minutes by default). The last admin cannot be deleted.
+ */
+ delete: operations["deleteUser"];
+ options?: never;
+ head?: never;
+ /**
+ * Grant or remove the admin role
+ * @description Admin only. The last admin cannot be demoted.
+ */
+ patch: operations["updateUser"];
+ trace?: never;
+ };
+ "/users/{id}/password": {
+ parameters: {
+ query?: never;
+ header?: never;
+ path: {
+ id: components["parameters"]["Id"];
+ };
+ cookie?: never;
+ };
+ get?: never;
+ /**
+ * Reset a user's password
+ * @description Admin only. Revokes every refresh token of that user, so no session can be renewed. Access
+ * tokens already issued keep working until they expire (15 minutes by default).
+ */
+ put: operations["resetUserPassword"];
+ post?: never;
+ delete?: never;
+ options?: never;
+ head?: never;
+ patch?: never;
+ trace?: never;
+ };
+ "/libraries": {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ /**
+ * List libraries
+ * @description Admin only.
+ */
+ get: operations["listLibraries"];
+ put?: never;
+ /**
+ * Add a library
+ * @description Admin only. The path must be an absolute, existing directory, never the filesystem root,
+ * and never inside or around another library (a bad path or an overlap is `400 invalid_input`).
+ * A name or path that another library already uses is `409 library_exists`. Names are unique
+ * ignoring case.
+ */
+ post: operations["createLibrary"];
+ delete?: never;
+ options?: never;
+ head?: never;
+ patch?: never;
+ trace?: never;
+ };
+ "/libraries/{id}": {
+ parameters: {
+ query?: never;
+ header?: never;
+ path: {
+ id: components["parameters"]["Id"];
+ };
+ cookie?: never;
+ };
+ get?: never;
+ put?: never;
+ post?: never;
+ /**
+ * Remove a library
+ * @description Admin only. Removes the library and its index entries. Tracks and listening history stay;
+ * the music on disk is never touched. Refused while a scan runs.
+ */
+ delete: operations["deleteLibrary"];
+ options?: never;
+ head?: never;
+ /**
+ * Rename or move a library
+ * @description Admin only. Send `name`, `path` or both. Files keep their identity when the path changes.
+ * Changing the path is refused while a scan runs.
+ */
+ patch: operations["updateLibrary"];
+ trace?: never;
+ };
+ "/libraries/{id}/scan": {
+ parameters: {
+ query?: never;
+ header?: never;
+ path: {
+ id: components["parameters"]["Id"];
+ };
+ cookie?: never;
+ };
+ get?: never;
+ put?: never;
+ /**
+ * Scan one library
+ * @description Admin only. Starts a scan in the background; follow it with `GET /library/scan`. With
+ * `full=true` every file is read again, not only the new or changed ones.
+ */
+ post: operations["scanLibrary"];
+ delete?: never;
+ options?: never;
+ head?: never;
+ patch?: never;
+ trace?: never;
+ };
+ "/library/covers": {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ /**
+ * Progress of the job that builds the covers
+ * @description Whether the job is running, how far it is (`progress`, only while it runs), and how the last one
+ * ended. The job is described at `POST /library/covers`.
+ */
+ get: operations["getCoversJob"];
+ put?: never;
+ /**
+ * Build all the covers in the background
+ * @description Admin only. Starts, in the background and one at a time like a scan, a job that builds the
+ * cover of every album that has something to play and no cover that is still good, instead of
+ * waiting for each album to be opened; follow it with `GET /library/covers`. For each album it
+ * does what `GET /albums/{id}/cover` does: the pictures in the user's own files first and, only
+ * if the album has none and an admin switched the `coverartarchive` provider on, the Cover Art
+ * Archive by the release group id of the album's tags. An album whose cover is still good (a
+ * found one for a week, "no cover" for a day) is skipped; send `refresh=true` to search every
+ * album again.
+ *
+ * **This goes through the whole library.** With the archive on, it sends
+ * the release group id of every album that has no picture in its files, one after the other and
+ * spaced out. It gives up, and says why in `last_error`, when the provider fails for five albums
+ * in a row, and also when the files cannot be read (an unmounted disk): it never turns that into
+ * "no cover" and never replaces a cover that was built. A cover that came from the archive is kept
+ * when the provider was switched off since, even with `refresh=true`; only taking its data back
+ * (`DELETE /providers/coverartarchive/data`) removes those. `DELETE /library/covers` stops it.
+ */
+ post: operations["startCoversJob"];
+ /**
+ * Stop the job that builds the covers
+ * @description Admin only. Asks a running job to end after the album it is on (its requests to the provider may still finish); the covers already built stay.
+ * It answers the same when no job is running.
+ */
+ delete: operations["stopCoversJob"];
+ options?: never;
+ head?: never;
+ patch?: never;
+ trace?: never;
+ };
+ "/library/artist-images": {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ /**
+ * Progress of the job that looks for the artist pictures
+ * @description Whether the job is running, how far it is (`progress`, only while it runs), and how the last one
+ * ended. The job is described at `POST /library/artist-images`.
+ */
+ get: operations["getArtistImagesJob"];
+ put?: never;
+ /**
+ * Look for all the artist pictures in the background
+ * @description Admin only. Starts, in the background and one at a time like a scan, a job that looks for the
+ * picture of every artist of the library that has a MusicBrainz id and no answer about its
+ * picture that is still good, instead of waiting for each artist to be opened; follow it with
+ * `GET /library/artist-images`. For each artist it does what `GET /artists/{id}/image` does, by
+ * the artist's MusicBrainz id and never by name: MusicBrainz, Wikidata, then a free picture on
+ * Wikimedia Commons. It needs an admin to have switched both the `commons` and the `musicbrainz`
+ * providers on; with either off the job ends at once and says so in `last_error`. Artists with
+ * no id are not touched. A picture is good for 30 days and "no picture" for a week; send
+ * `refresh=true` to search every artist again. A refresh never replaces a stored picture by a
+ * failure.
+ *
+ * **This goes through the whole library.** It sends the MusicBrainz id
+ * of every artist, one after the other and spaced out, to MusicBrainz, Wikidata and Commons. It
+ * gives up, and says why in `last_error`, when the providers fail for five artists in a row.
+ * `DELETE /library/artist-images` stops it.
+ */
+ post: operations["startArtistImagesJob"];
+ /**
+ * Stop the job that looks for the artist pictures
+ * @description Admin only. Asks a running job to end after the artist it is on (its requests to the providers may still finish); the pictures already found
+ * stay. It answers the same when no job is running.
+ */
+ delete: operations["stopArtistImagesJob"];
+ options?: never;
+ head?: never;
+ patch?: never;
+ trace?: never;
+ };
+ "/library/descriptions": {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ /**
+ * Progress of the job that looks for the artist descriptions
+ * @description Whether the job is running, how far it is (`progress`, only while it runs), and how the last one
+ * ended. The job is described at `POST /library/descriptions`.
+ */
+ get: operations["getDescriptionsJob"];
+ put?: never;
+ /**
+ * Look for all the artist descriptions in the background
+ * @description Admin only. Starts, in the background and one at a time like a scan, a job that looks for the
+ * description of every artist of the library that has a MusicBrainz id and no answer about its
+ * description that is still good; follow it with `GET /library/descriptions`. For each artist it
+ * does what `GET /artists/{id}/description` does, by the artist's MusicBrainz id and never by
+ * name: MusicBrainz, Wikidata, then Wikipedia. It needs an admin to have switched both the
+ * `wikipedia` and the `musicbrainz` providers on; with either off the job ends at once and says
+ * so in `last_error`. Artists with no id are not touched. A description is good for 30 days and
+ * "no description" for a day; send `refresh=true` to read every artist again. A refresh never
+ * replaces a stored description by a failure.
+ *
+ * **This goes through the whole library.** It sends the MusicBrainz id
+ * of every artist, one after the other and spaced out, to MusicBrainz, Wikidata and Wikipedia.
+ * It gives up, and says why in `last_error`, when the providers fail for five artists in a row.
+ * `DELETE /library/descriptions` stops it.
+ */
+ post: operations["startDescriptionsJob"];
+ /**
+ * Stop the job that looks for the artist descriptions
+ * @description Admin only. Asks a running job to end after the artist it is on (its requests to the providers may still finish); the descriptions already
+ * found stay. It answers the same when no job is running.
+ */
+ delete: operations["stopDescriptionsJob"];
+ options?: never;
+ head?: never;
+ patch?: never;
+ trace?: never;
+ };
+ "/library/scan": {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ /**
+ * Scan status
+ * @description Whether a scan is running and how the last one ended.
+ */
+ get: operations["getScanStatus"];
+ put?: never;
+ /**
+ * Scan every library
+ * @description Admin only. Starts a scan in the background. Only MP3 and FLAC files are read; other audio
+ * formats are counted as `unsupported`. Housekeeping folders of NAS boxes (`@Recycle`,
+ * `#recycle`, `@eaDir`, `.@__thumb`, `$RECYCLE.BIN`) are skipped.
+ *
+ * A scan reads the tags of files that are new or changed. Send `full=true` to read every file
+ * again: that is how MusicBrainz ids and genres reach music that was indexed before they were
+ * read. Files keep their identity, so listening history is kept.
+ */
+ post: operations["scanAll"];
+ delete?: never;
+ options?: never;
+ head?: never;
+ patch?: never;
+ trace?: never;
+ };
+ "/artists": {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ /**
+ * List artists
+ * @description Artists credited on a playable track, or that are the album artist of an album with one.
+ * Sorted by name.
+ */
+ get: operations["listArtists"];
+ put?: never;
+ post?: never;
+ delete?: never;
+ options?: never;
+ head?: never;
+ patch?: never;
+ trace?: never;
+ };
+ "/artists/{id}": {
+ parameters: {
+ query?: never;
+ header?: never;
+ path: {
+ id: components["parameters"]["Id"];
+ };
+ cookie?: never;
+ };
+ /** One artist */
+ get: operations["getArtist"];
+ put?: never;
+ post?: never;
+ delete?: never;
+ options?: never;
+ head?: never;
+ patch?: never;
+ trace?: never;
+ };
+ "/artists/{id}/similar": {
+ parameters: {
+ query?: never;
+ header?: never;
+ path: {
+ id: components["parameters"]["Id"];
+ };
+ cookie?: never;
+ };
+ /**
+ * Artists similar to one
+ * @description Artists an external provider (Last.fm) finds similar to this one, best first. Each says
+ * whether it is in the library, and `id` works with `GET /artists/{id}`; one that is not in the
+ * library has no files.
+ *
+ * The provider is only asked when an admin switched it on and the stored answer is missing or
+ * old (7 days; a "no such artist" answer is kept 1 day). What is sent is the artist's name or
+ * MusicBrainz id and nothing about any user. Several requests for the same artist at once
+ * make one call.
+ *
+ * A provider that is off or failing is not an error: the answer is `200` and `provider_status`
+ * says why. Then `items` holds whatever was stored before, if anything, and `stale` is true
+ * when it is older than it should be.
+ *
+ * `score` is the provider's own number between 0 and 1. It is relative to the list it came
+ * in (the best one is usually 1), so it only compares artists inside one answer. `rank` is the
+ * position. Show `attribution` where you show the data.
+ */
+ get: operations["getSimilarArtists"];
+ put?: never;
+ post?: never;
+ delete?: never;
+ options?: never;
+ head?: never;
+ patch?: never;
+ trace?: never;
+ };
+ "/artists/{id}/tags": {
+ parameters: {
+ query?: never;
+ header?: never;
+ path: {
+ id: components["parameters"]["Id"];
+ };
+ cookie?: never;
+ };
+ /**
+ * Tags of an artist, from each provider
+ * @description What each provider says kind of music this artist plays: Last.fm's top tags and
+ * MusicBrainz's tags and genres, and last the genres of the artist's own music files
+ * (`provider` is `files`: the genre tags the scan read, each weighted by how many of the
+ * playable tracks the artist is credited on have it; it asks nobody, is always `ok` and has a null `retrieved_at`). There is
+ * always one entry for each, Last.fm first. The
+ * weights are the providers' own numbers, kept as they came and never mixed: Last.fm's is
+ * relative to the artist (1 to 100, the top tag is usually 100; a tag with no votes is dropped),
+ * MusicBrainz's is a count of votes. `genre` is true for a MusicBrainz tag that it also lists among its curated genres, and for
+ * every tag of the `files` entry, which are genres by definition.
+ *
+ * A provider is only asked when an admin switched it on and its stored answer is missing or
+ * old (7 days; a "no such artist" answer is kept 1 day), with the same rules as
+ * `GET /artists/{id}/similar`. What is sent is the artist's name or MusicBrainz id to
+ * Last.fm (its id when known), and only the MusicBrainz id to MusicBrainz: Sonda never looks
+ * an id up by name. An artist's id comes from the tags in the music files, or from Last.fm
+ * for an artist it named that is not in the library; for any other artist the MusicBrainz
+ * entry says `no_id`. Show each `attribution` where you show the tags.
+ */
+ get: operations["getArtistTags"];
+ put?: never;
+ post?: never;
+ delete?: never;
+ options?: never;
+ head?: never;
+ patch?: never;
+ trace?: never;
+ };
+ "/discover": {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ /**
+ * Artists you may like
+ * @description Suggests artists, in your library or not, each with a `score` from 0 to 1 and the parts
+ * it is made of, so every number can be explained.
+ *
+ * **Where it starts.** From the artists you name with `seed` (one to five, repeat the
+ * parameter), or, when you named none and turned on `discover_from_listening` in
+ * `PATCH /me/settings`, from the up to 20 artists you play most. With neither the request
+ * is refused (`seed_required`) and nothing is sent to anyone. For each seed, the similar
+ * artists are the stored ones, or are asked from Last.fm when they are missing or old and
+ * an admin switched Last.fm on (see `GET /artists/{id}/similar`). **What is sent**:
+ * the name or MusicBrainz id of each seed, and, for the best candidates that have no tags
+ * yet, the name of the candidate (tags are asked from Last.fm only, never from MusicBrainz).
+ * The seeds from your listening are therefore sent only when you allowed it. A seed is never
+ * suggested to itself, and nobody else's listening is read.
+ *
+ * **The score** is `S = wA·A + wG·G + wP·P + wD·D` with the weights of the server's
+ * `[scoring]` config (default 0.40, 0.25, 0.25, 0.10; only their proportions matter).
+ * `a` is the affinity: 1 − Π(1 − weight·match) over the seeds that point at the artist, where
+ * `match` is Last.fm's similarity (relative to each seed's own list) and `weight` is 1 for a
+ * seed you named or your `preference` for one taken from your listening (see
+ * `GET /me/taste`). `g` is how close the artist's tags are to the tags of the artists you like (cosine
+ * of the tag vectors); it is `null` when there is nothing to compare, and then the score is
+ * worked out without it, the other weights rescaled, so a missing part never counts as a bad
+ * one. `p` is what your listening says about the artist, from `preference`
+ * mapped to 0 to 1, and 0.5 for an artist you never played. `d` is a bonus for what you have
+ * not played: `1 / (1 + listens)`.
+ *
+ * Only the best candidates by affinity (at least 20) are scored, then the best `limit` by
+ * score are returned; ties go to the higher affinity, then to the lower id. `because` names
+ * up to three seeds that count most for the suggestion. The first request after a seed's data
+ * gets old can take several seconds, because the provider is asked politely, a few at a time;
+ * later ones are served from the database.
+ *
+ * `provider_status` is `disabled` when something had to be asked from Last.fm (a seed's
+ * similar artists are missing or old) and Last.fm is off or has no key; anything stored earlier
+ * is still used, so the list can be empty. With every seed's data stored and fresh the status is `ok`
+ * whether Last.fm is on or not. It is `error` when Last.fm failed for some seed (the
+ * rest is still returned) and `ok` otherwise. Show `attribution` where you show the data.
+ */
+ get: operations["discover"];
+ put?: never;
+ post?: never;
+ delete?: never;
+ options?: never;
+ head?: never;
+ patch?: never;
+ trace?: never;
+ };
+ "/discover/dismissed": {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ /**
+ * Artists you are not interested in
+ * @description The artists you told Discover you are not interested in (`POST /discover/{id}/dismiss`),
+ * newest first. Only yours; nobody else's choices are visible or affect your Discover.
+ */
+ get: operations["listDismissed"];
+ put?: never;
+ post?: never;
+ delete?: never;
+ options?: never;
+ head?: never;
+ patch?: never;
+ trace?: never;
+ };
+ "/discover/{id}/dismiss": {
+ parameters: {
+ query?: never;
+ header?: never;
+ path: {
+ id: components["parameters"]["Id"];
+ };
+ cookie?: never;
+ };
+ get?: never;
+ put?: never;
+ /**
+ * Not interested in this artist
+ * @description Hides the artist from your Discover: it is never suggested again, and an artist taken
+ * from your listening that you dismissed no longer seeds your suggestions. An artist is
+ * dismissed or on your wishlist, never both: dismissing one that is on the wishlist takes
+ * it off. Doing it twice is the same as once. Nothing is sent to anyone.
+ *
+ * The artist can be one of yours or one a provider named. An artist that a provider named
+ * and nobody else does is kept for as long as it is dismissed, so the choice survives a
+ * new list from the provider; such an artist is listed for you, but other users cannot see
+ * that it exists. When an admin takes a provider's data back (`DELETE
+ * /providers/{name}/data`), what only that provider's lists named goes, your choice with it.
+ */
+ post: operations["dismissArtist"];
+ /**
+ * Interested again
+ * @description Lets Discover suggest the artist again. A wish on the wishlist is not touched.
+ */
+ delete: operations["undismissArtist"];
+ options?: never;
+ head?: never;
+ patch?: never;
+ trace?: never;
+ };
+ "/wishlist": {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ /**
+ * Your wishlist
+ * @description The artists you want, newest first. It is a list for you: nothing is downloaded or
+ * sent anywhere. `in_library` says whether there is music of the artist to play now, so a
+ * client can hide the ones you already got. Only yours.
+ */
+ get: operations["listWishlist"];
+ put?: never;
+ post?: never;
+ delete?: never;
+ options?: never;
+ head?: never;
+ patch?: never;
+ trace?: never;
+ };
+ "/wishlist/{id}": {
+ parameters: {
+ query?: never;
+ header?: never;
+ path: {
+ id: components["parameters"]["Id"];
+ };
+ cookie?: never;
+ };
+ get?: never;
+ /**
+ * Put an artist on your wishlist
+ * @description Adds the artist. An artist is on the wishlist or dismissed, never both: adding one you
+ * dismissed lifts the dismissal. Doing it twice keeps the first date. The artist can be one
+ * of yours or one a provider named; the latter is kept while it is on a wishlist (see
+ * `POST /discover/{id}/dismiss` for what a purge does). Discover marks it `wishlisted`.
+ */
+ put: operations["addToWishlist"];
+ post?: never;
+ /**
+ * Take an artist off your wishlist
+ * @description A dismissal of the artist is not touched.
+ */
+ delete: operations["removeFromWishlist"];
+ options?: never;
+ head?: never;
+ patch?: never;
+ trace?: never;
+ };
+ "/me/taste": {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ /**
+ * What Sonda has learned about your taste
+ * @description Your taste, worked out from your own listening history every time you ask. It uses local
+ * data only: nothing is sent to any provider, and nobody else's history is read.
+ *
+ * Each event has a value: a `complete` listen +1, any other listen that counts +0.5 (see
+ * `POST /listens`), a `skip` before that -1, and a play too short to mean anything 0. An
+ * event weighs half as much for every 90 days (`taste.half_life_days`) that has passed, and
+ * one dated after the moment of the request weighs as if it happened then. Only the last
+ * ten half-lives are read (900 days by default); older events weigh less than a thousandth
+ * and are left out, also from `listens`. For each artist the values add up, and `preference`
+ * is `tanh(sum / 3)`: from -1 to 1, approaching both (a large sum rounds to exactly 1), so
+ * one skip does not sink an artist and listening makes one loved at most. A track with
+ * several artists credits each of them.
+ *
+ * `artists` are the ones you like (a `preference` above 0), the most played first. They are
+ * ordered by the sum itself, so artists whose `preference` rounds to 1 keep their order;
+ * ties go to the lower id. `tags` are the kinds of music you like, at most 50: the tags of
+ * those artists (the genres of your files that still exist, and what Last.fm and MusicBrainz
+ * said earlier, if they were ever asked) added up, each artist weighing as much as its
+ * `preference`, and scaled so the best tag is 1, best first. Tags are read from what is already stored; this
+ * request never asks a provider. The tag profile is built from your 200 most liked artists.
+ */
+ get: operations["getMyTaste"];
+ put?: never;
+ post?: never;
+ delete?: never;
+ options?: never;
+ head?: never;
+ patch?: never;
+ trace?: never;
+ };
+ "/me/settings": {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ /**
+ * Your own settings
+ * @description Settings that belong to you, not to the server. Everyone starts with the private
+ * defaults: anything that would send something about your taste to a provider is off.
+ */
+ get: operations["getMySettings"];
+ put?: never;
+ post?: never;
+ delete?: never;
+ options?: never;
+ head?: never;
+ /**
+ * Change your own settings
+ * @description Changes the settings named in the body and leaves the others alone. An empty object
+ * changes nothing. `null` is the same as leaving a field out. The body must be one JSON
+ * object, with nothing after it, and the names must be spelt exactly: a setting that does
+ * not exist is refused rather than ignored.
+ */
+ patch: operations["updateMySettings"];
+ trace?: never;
+ };
+ "/artists/{id}/description": {
+ parameters: {
+ query?: never;
+ header?: never;
+ path: {
+ id: components["parameters"]["Id"];
+ };
+ cookie?: never;
+ };
+ /**
+ * What Wikipedia says about an artist
+ * @description A short text about the artist from Wikipedia, with the page it comes from. The way to it
+ * is a chain of identifiers, never a search by name: the artist's MusicBrainz id, then the
+ * Wikidata item that MusicBrainz links to it, then the Wikipedia page that Wikidata names in
+ * the first of the server's languages (`[wikipedia] languages`, the code of the Wikipedia:
+ * `it`, `en`, `no` for Norwegian; a language with no Wikipedia finds nothing) that has one. A page is used
+ * only if it is an article about that same item (not a page of disambiguation). An artist
+ * with no MusicBrainz id answers `no_id`: Sonda does not look an id up by name.
+ *
+ * It needs the `wikipedia` provider and also the `musicbrainz` one, because the link to
+ * Wikidata comes from MusicBrainz; an admin switches them on, and nothing is sent while
+ * either is off (`disabled`, also when an answer is stored). What is sent: the MusicBrainz id
+ * to MusicBrainz (with the contact set for MusicBrainz), the Wikidata item to Wikidata and the
+ * title of the page to Wikipedia (with the contact set for Wikipedia), and your server's IP
+ * address with them. The answer is stored: 30 days, or a
+ * day when there was nothing to find, and an old one is returned as `stale` if Wikipedia
+ * fails. When there is nothing to show, `description` is `null` and `provider_status` is
+ * `ok`.
+ *
+ * The text is CC BY-SA 4.0. Where you show it, name the page (`title`), link to it (`url`) and
+ * give the licence (`license`, `license_url`), and say if you changed it.
+ */
+ get: operations["getArtistDescription"];
+ put?: never;
+ post?: never;
+ delete?: never;
+ options?: never;
+ head?: never;
+ patch?: never;
+ trace?: never;
+ };
+ "/artists/{id}/image": {
+ parameters: {
+ query?: never;
+ header?: never;
+ path: {
+ id: components["parameters"]["Id"];
+ };
+ cookie?: never;
+ };
+ /**
+ * A free picture of an artist
+ * @description A JPEG made from a picture of the artist on Wikimedia Commons, only when its licence is
+ * free: public domain, CC0, CC BY or CC BY-SA. Non-commercial, no-derivatives, fair use and
+ * unknown licences are refused, because Sonda keeps a copy. **Where you show it, show its
+ * credit** (`GET /artists/{id}/image/credit`): the author, the licence and the page of the file.
+ *
+ * The way to it is a chain of identifiers, never a search by name: the artist's MusicBrainz
+ * id, the Wikidata item MusicBrainz links to it, the picture Wikidata names for it, and Commons
+ * for its licence and a copy. It needs the `commons` provider and the `musicbrainz` one, which
+ * an admin switches on. It is built the first time it is asked for (that request can take a few
+ * seconds), scaled to fit, saved in the data folder, and served from there afterwards: for 30
+ * days, or a week when there is no free picture; an older copy is served when Commons cannot
+ * be reached. What is sent: the MusicBrainz id to MusicBrainz, the Wikidata item to Wikidata,
+ * the name of the file to Commons, and the address of a copy to Wikimedia, with your server's
+ * IP address and a `User-Agent` with a contact.
+ *
+ * An ` ` element cannot send headers, so, like the stream and the covers, this accepts
+ * the access token as the `access_token` query parameter. A header, when present, always wins.
+ */
+ get: operations["getArtistImage"];
+ put?: never;
+ post?: never;
+ delete?: never;
+ options?: never;
+ /**
+ * Headers of a picture
+ * @description Same as `GET`, without the body.
+ */
+ head: operations["headArtistImage"];
+ patch?: never;
+ trace?: never;
+ };
+ "/artists/{id}/image/credit": {
+ parameters: {
+ query?: never;
+ header?: never;
+ path: {
+ id: components["parameters"]["Id"];
+ };
+ cookie?: never;
+ };
+ /**
+ * The credit of a picture of an artist
+ * @description Whose the picture is and under which licence, to be shown next to it (the licences ask for
+ * it). The author is plain text and may be empty; `license_url` may be empty when the licence
+ * has no address; `page_url` is the page of the file on Commons, where everything is.
+ * It answers like `GET /artists/{id}/image` (same errors), because the credit exists only with a
+ * picture: the first request for an artist can take as long as the picture does (several seconds).
+ */
+ get: operations["getArtistImageCredit"];
+ put?: never;
+ post?: never;
+ delete?: never;
+ options?: never;
+ head?: never;
+ patch?: never;
+ trace?: never;
+ };
+ "/albums": {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ /**
+ * List albums
+ * @description Albums with a playable track, sorted by title. `artist_id` matches the albums an artist
+ * owns plus those where it is credited on a playable track, the same set as its `album_count`.
+ */
+ get: operations["listAlbums"];
+ put?: never;
+ post?: never;
+ delete?: never;
+ options?: never;
+ head?: never;
+ patch?: never;
+ trace?: never;
+ };
+ "/albums/{id}": {
+ parameters: {
+ query?: never;
+ header?: never;
+ path: {
+ id: components["parameters"]["Id"];
+ };
+ cookie?: never;
+ };
+ /** One album */
+ get: operations["getAlbum"];
+ put?: never;
+ post?: never;
+ delete?: never;
+ options?: never;
+ head?: never;
+ patch?: never;
+ trace?: never;
+ };
+ "/albums/{id}/cover": {
+ parameters: {
+ query?: never;
+ header?: never;
+ path: {
+ id: components["parameters"]["Id"];
+ };
+ cookie?: never;
+ };
+ /**
+ * The cover of an album
+ * @description A JPEG made from the picture in the album's own files: the picture embedded in one of
+ * its first files, or else a `cover`, `folder`, `front`, `album` or `albumart` image
+ * (`.jpg`, `.jpeg` or `.png`, any case) in the album's folder, in that order of names. It
+ * is built the first time it is asked for (that request can take a moment), scaled to fit
+ * and saved in the server's data folder, and served from there afterwards. It never
+ * contacts anybody (unless the `coverartarchive` provider is on, see below). Pictures that are too big (over 20 MB or 16 million pixels) or are not
+ * pictures are ignored, and only files inside the library are read.
+ *
+ * For an album split in folders named like `CD1` or `Disc 2`, the picture in the folder
+ * above them is used too. When the files have no picture at all, and an admin switched on
+ * the `coverartarchive` provider, the cover is asked from the Cover Art Archive by the
+ * MusicBrainz release group id that the tags of the album's files carry (never by title; a
+ * full rescan reads that tag again for music indexed before); only that id leaves the server.
+ * The files of the user always come first. That request can take several seconds and may
+ * answer `provider_unavailable`. At most a couple of covers are built at the same time, so a
+ * client that asks for many at once may wait.
+ *
+ * An album with no picture answers `cover_not_found`, and the server does not look again
+ * for a day; a new or changed file of the album, or a full rescan, makes it look again.
+ * A cover that was found is checked again after a week, so a picture replaced in the
+ * folder is noticed.
+ * The picture is `private` for an hour in caches and has an `ETag`: send it back as
+ * `If-None-Match`.
+ *
+ * An ` ` element cannot send headers, so, like the stream, this also accepts the access
+ * token as the `access_token` query parameter. A header, when present, always wins.
+ */
+ get: operations["getAlbumCover"];
+ put?: never;
+ post?: never;
+ delete?: never;
+ options?: never;
+ /**
+ * Headers of a cover
+ * @description Same as `GET`, without the body.
+ */
+ head: operations["headAlbumCover"];
+ patch?: never;
+ trace?: never;
+ };
+ "/tracks": {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ /**
+ * List tracks
+ * @description Tracks with at least one file that is not flagged missing; a track with several files
+ * appears once. Grouped by album, then disc and track number.
+ */
+ get: operations["listTracks"];
+ put?: never;
+ post?: never;
+ delete?: never;
+ options?: never;
+ head?: never;
+ patch?: never;
+ trace?: never;
+ };
+ "/tracks/{id}": {
+ parameters: {
+ query?: never;
+ header?: never;
+ path: {
+ id: components["parameters"]["Id"];
+ };
+ cookie?: never;
+ };
+ /** One track */
+ get: operations["getTrack"];
+ put?: never;
+ post?: never;
+ delete?: never;
+ options?: never;
+ head?: never;
+ patch?: never;
+ trace?: never;
+ };
+ "/tracks/{id}/stream": {
+ parameters: {
+ query?: never;
+ header?: never;
+ path: {
+ id: components["parameters"]["Id"];
+ };
+ cookie?: never;
+ };
+ /**
+ * Stream a track
+ * @description Serves the original audio file. Supports `Range` requests, so players can seek, and
+ * conditional requests. Streaming never records a listen; report one with `POST /listens`.
+ *
+ * An `` element cannot send headers, so this is the only operation that also accepts
+ * the access token as the `access_token` query parameter. A header, when present, always wins.
+ */
+ get: operations["streamTrack"];
+ put?: never;
+ post?: never;
+ delete?: never;
+ options?: never;
+ /**
+ * Headers of a stream
+ * @description Same as `GET`, without the body.
+ */
+ head: operations["headTrackStream"];
+ patch?: never;
+ trace?: never;
+ };
+ "/providers": {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ /**
+ * List the external providers
+ * @description Admin only. Every provider Sonda knows (Last.fm, MusicBrainz), with whether it is on and
+ * what it would send. Providers are off by default: nothing leaves the server until an admin
+ * enables one. The API key is never returned; `has_api_key` says whether one is stored.
+ */
+ get: operations["listProviders"];
+ put?: never;
+ post?: never;
+ delete?: never;
+ options?: never;
+ head?: never;
+ patch?: never;
+ trace?: never;
+ };
+ "/providers/{name}": {
+ parameters: {
+ query?: never;
+ header?: never;
+ path: {
+ name: "lastfm" | "musicbrainz" | "wikipedia" | "commons" | "coverartarchive";
+ };
+ cookie?: never;
+ };
+ get?: never;
+ /**
+ * Set up a provider
+ * @description Admin only. Send any of `enabled`, `api_key` and `contact`; fields you leave out are kept.
+ *
+ * The key is write-only: it is never returned and never logged. Sending an empty `api_key`
+ * clears it, and turns a provider that needs a key (Last.fm) off; a provider that needs none
+ * (MusicBrainz) is not affected. A provider that needs a key cannot be enabled without one. `contact` goes into the User-Agent sent to the provider (MusicBrainz
+ * asks for a URL or an e-mail address); empty means the project address.
+ */
+ put: operations["updateProvider"];
+ post?: never;
+ delete?: never;
+ options?: never;
+ head?: never;
+ patch?: never;
+ trace?: never;
+ };
+ "/providers/{name}/test": {
+ parameters: {
+ query?: never;
+ header?: never;
+ path: {
+ name: "lastfm" | "musicbrainz" | "wikipedia" | "commons" | "coverartarchive";
+ };
+ cookie?: never;
+ };
+ get?: never;
+ put?: never;
+ /**
+ * Check a provider's API key
+ * @description Admin only. Asks the provider one cheap question with the stored key, to find out whether
+ * it works. It works whether the provider is on or off, so you can check before switching it on.
+ * It is the only request Sonda makes at an admin's command rather than for a listener, and it
+ * sends nothing but the key. A provider that cannot be reached or refuses the key is not an
+ * error here: the answer is `200` with `ok` false and the reason in `status`.
+ *
+ * MusicBrainz has no key: its test only asks whether the service answers. A provider that
+ * has no test is a `400`.
+ */
+ post: operations["testProvider"];
+ delete?: never;
+ options?: never;
+ head?: never;
+ patch?: never;
+ trace?: never;
+ };
+ "/providers/{name}/data": {
+ parameters: {
+ query?: never;
+ header?: never;
+ path: {
+ name: "lastfm" | "musicbrainz" | "wikipedia" | "commons" | "coverartarchive";
+ };
+ cookie?: never;
+ };
+ get?: never;
+ put?: never;
+ post?: never;
+ /**
+ * Remove what a provider gave
+ * @description Admin only. Removes everything the provider told Sonda: its lists of similar artists, its
+ * tags and the records of when it was asked, and then the artists that only that data named
+ * and that nobody has files for. Last.fm's terms ask for exactly this when an agreement ends.
+ *
+ * Your own artists, music, listens and settings are not touched, and the provider is not
+ * switched off: if it is still on, it is asked again when someone asks. The answer counts what
+ * was removed; doing it again removes nothing.
+ */
+ delete: operations["purgeProviderData"];
+ options?: never;
+ head?: never;
+ patch?: never;
+ trace?: never;
+ };
+ "/listens": {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ /**
+ * Your listening history
+ * @description The events you reported, newest first, each with `counted`: whether it counts as a listen
+ * under the current rule (see `POST /listens`). Nobody else's history is visible.
+ */
+ get: operations["listListens"];
+ put?: never;
+ /**
+ * Record a listen
+ * @description Clients report what the listener did: **one event per play**, when the play ends or is
+ * abandoned, with the time actually played (`complete` if it finished, `skip` if the listener
+ * moved on, `play` if it simply stopped).
+ *
+ * Use **one `idempotency_key` per play**. A retry with the same key from the same user is
+ * recorded once and answered with `duplicate`. An event cannot be upgraded afterwards: a later
+ * event with a key that was already used is ignored, even if its type or duration differ, and
+ * sending it with a new key would count the same play twice.
+ *
+ * **What counts as a listen.** An event counts when its type is `complete`, or when
+ * `duration_played_ms` is at least `listening.min_listen_seconds` (20 seconds by default).
+ * A `play` or `skip` shorter than that is stored but does not count. The rule is applied when
+ * the history is read, so changing the setting re-reads the past. The answer says whether this
+ * event counts; for a `duplicate` it describes the event you sent.
+ *
+ * **Plausibility.** When the length of the track is known, `duration_played_ms` may not exceed
+ * twice that length plus 10 seconds (a listener can seek back and loop). Streaming a file never
+ * records anything on its own.
+ */
+ post: operations["recordListen"];
+ delete?: never;
+ options?: never;
+ head?: never;
+ patch?: never;
+ trace?: never;
+ };
+}
+export type webhooks = Record;
+export interface components {
+ schemas: {
+ Error: {
+ error: {
+ /**
+ * @description A stable identifier, for example `invalid_input`, `unauthorized`, `admin_required`,
+ * `user_not_found`, `last_admin`, `library_exists`, `scan_running`, `track_not_found`.
+ */
+ code: string;
+ message: string;
+ };
+ };
+ Credentials: {
+ username: string;
+ /**
+ * Format: password
+ * @description 8 to 256 bytes (UTF-8).
+ */
+ password: string;
+ };
+ LoginRequest: {
+ username: string;
+ /** Format: password */
+ password: string;
+ };
+ CreateUser: components["schemas"]["Credentials"] & {
+ /** @default false */
+ is_admin: boolean;
+ };
+ User: {
+ /** Format: int64 */
+ id: number;
+ username: string;
+ is_admin: boolean;
+ };
+ Session: {
+ access_token: string;
+ /** Format: date-time */
+ access_expires_at: string;
+ /** @description Works once. */
+ refresh_token: string;
+ /** Format: date-time */
+ refresh_expires_at: string;
+ user: components["schemas"]["User"];
+ };
+ RefreshRequest: {
+ refresh_token: string;
+ };
+ PasswordChange: {
+ /** Format: password */
+ current_password: string;
+ /**
+ * Format: password
+ * @description 8 to 256 bytes (UTF-8).
+ */
+ new_password: string;
+ };
+ Library: {
+ /** Format: int64 */
+ id: number;
+ name: string;
+ /** @description Absolute directory on the server. */
+ path: string;
+ /** Format: date-time */
+ created_at: string;
+ };
+ NewLibrary: {
+ name: string;
+ /** @description Absolute, existing directory. */
+ path: string;
+ };
+ LibraryUpdate: {
+ name?: string;
+ path?: string;
+ } | unknown | unknown;
+ ScanSummary: {
+ /** @description Libraries covered by the scan. */
+ libraries: number;
+ /** @description Audio files seen on disk (MP3 and FLAC). */
+ found: number;
+ added: number;
+ updated: number;
+ unchanged: number;
+ /** @description Files that moved; they keep their track. */
+ renamed: number;
+ /** @description Files that were missing and are back. */
+ restored: number;
+ /** @description Files newly flagged as missing. They are never deleted. */
+ missing: number;
+ /** @description Files that could not be read. */
+ failed: number;
+ /** @description Symlinks and special files. */
+ skipped: number;
+ /** @description Audio files in formats Sonda cannot read yet, such as m4a, ogg or wav. */
+ unsupported: number;
+ };
+ ScanStatus: {
+ running: boolean;
+ /** Format: date-time */
+ started_at?: string;
+ /** Format: date-time */
+ last_finished_at?: string;
+ last?: components["schemas"]["ScanSummary"];
+ last_error?: string;
+ };
+ ArtistRef: {
+ /** Format: int64 */
+ id: number;
+ name: string;
+ };
+ AlbumRef: {
+ /** Format: int64 */
+ id: number;
+ title: string;
+ };
+ Artist: {
+ /** Format: int64 */
+ id: number;
+ name: string;
+ album_count: number;
+ /** @description Playable tracks the artist is credited on. */
+ track_count: number;
+ };
+ Album: {
+ /** Format: int64 */
+ id: number;
+ title: string;
+ /** @description The album artist; null when the album has none. */
+ artist: {
+ /** Format: int64 */
+ id: number;
+ name: string;
+ } | null;
+ track_count: number;
+ /** Format: int64 */
+ duration_ms: number;
+ };
+ Track: {
+ /** Format: int64 */
+ id: number;
+ title: string;
+ /** Format: int64 */
+ duration_ms: number;
+ /** @description 0 when unknown. */
+ track_no: number;
+ /** @description 0 when unknown. */
+ disc_no: number;
+ /** @description The album; null for a track that belongs to none. */
+ album: {
+ /** Format: int64 */
+ id: number;
+ title: string;
+ } | null;
+ artists: components["schemas"]["ArtistRef"][];
+ /** @description Format of the first playable file, for example `mp3` or `flac`. */
+ format: string;
+ };
+ ArtistPage: {
+ items: components["schemas"]["Artist"][];
+ /** @description Size of the whole result, not of this page. */
+ total: number;
+ limit: number;
+ offset: number;
+ };
+ AlbumPage: {
+ items: components["schemas"]["Album"][];
+ total: number;
+ limit: number;
+ offset: number;
+ };
+ TrackPage: {
+ items: components["schemas"]["Track"][];
+ total: number;
+ limit: number;
+ offset: number;
+ };
+ Listen: {
+ /** Format: int64 */
+ track_id: number;
+ /** @enum {string} */
+ event_type: "play" | "complete" | "skip";
+ /**
+ * Format: date-time
+ * @description Defaults to now.
+ */
+ occurred_at?: string;
+ /**
+ * Format: int64
+ * @description Milliseconds actually played. Up to twice the track length plus 10 seconds when that length is known.
+ */
+ duration_played_ms?: number;
+ /** @description One per play, 1 to 128 bytes (UTF-8). A key that was already used is ignored. */
+ idempotency_key: string;
+ };
+ Provider: {
+ /** @enum {string} */
+ name: "lastfm" | "musicbrainz" | "wikipedia" | "commons" | "coverartarchive";
+ /** @description Whether Sonda may contact this provider. */
+ enabled: boolean;
+ needs_api_key: boolean;
+ /** @description Whether a key is stored. The key itself is never returned. */
+ has_api_key: boolean;
+ /** @description Contact in the User-Agent; empty means the project address. */
+ contact: string;
+ /** @description Plain statement of what is sent to the provider, and what never is. */
+ sends: string;
+ /** @description Terms of use and attribution that apply to the provider's data. */
+ notes: string;
+ /**
+ * Format: date-time
+ * @description When the settings last changed; null if they never did.
+ */
+ updated_at: string | null;
+ };
+ ProviderUpdate: {
+ enabled?: boolean;
+ /**
+ * Format: password
+ * @description A Last.fm key is 32 hexadecimal characters. Empty clears it.
+ */
+ api_key?: string;
+ /** @description A URL or e-mail address, without parentheses. Empty restores the default. */
+ contact?: string;
+ } | unknown | unknown | unknown;
+ ArtistDescription: {
+ /** @enum {string} */
+ provider: "wikipedia";
+ /**
+ * @description `ok` when the stored answer is as fresh as it needs to be (which can be "nothing found");
+ * `disabled` when the provider is off; `error` when Wikipedia could not be asked; `no_id`
+ * when the artist has no MusicBrainz id.
+ * @enum {string}
+ */
+ provider_status: "ok" | "disabled" | "error" | "no_id";
+ /** @description True when the description is older than it should be because Wikipedia could not be asked. */
+ stale: boolean;
+ /**
+ * Format: date-time
+ * @description When it was read; null when nothing is known.
+ */
+ retrieved_at: string | null;
+ /** @description What to show where the text is shown. */
+ attribution: string;
+ description: components["schemas"]["Description"] | null;
+ };
+ Description: {
+ /** @description The first paragraph of the article, plain text, at most 4000 characters. */
+ text: string;
+ /** @description One line, like "gruppo musicale inglese". May be empty. */
+ short: string;
+ /** @description The language of the page, like `it`. */
+ language: string;
+ /** @description The title of the page. */
+ title: string;
+ /**
+ * Format: uri
+ * @description The page, on Wikipedia.
+ */
+ url: string;
+ /** @description The licence of the text. */
+ license: string;
+ /** Format: uri */
+ license_url: string;
+ };
+ PictureCredit: {
+ /** @description Where the picture comes from: `Wikimedia Commons`. */
+ source: string;
+ /** @description Plain text. May be empty. */
+ author: string;
+ /** @description Like `CC BY-SA 4.0`. */
+ license: string;
+ /** @description The licence, on creativecommons.org. May be empty. */
+ license_url: string;
+ /**
+ * Format: uri
+ * @description The page of the file on Commons.
+ */
+ page_url: string;
+ };
+ ProviderPurge: {
+ /** @description Similar-artist links removed. */
+ similar_artists: number;
+ /** @description Artist descriptions removed (only the data of Wikipedia has any). */
+ descriptions: number;
+ /** @description Pictures removed: the photos of artists for Commons, the covers that came from the archive for the Cover Art Archive. */
+ images: number;
+ /** @description Tags removed. */
+ tags: number;
+ /** @description Artists removed because only the removed data named them and nobody has files for them. */
+ artists: number;
+ };
+ ProviderTest: {
+ ok: boolean;
+ /**
+ * @description `no_api_key`: none is stored, so nobody was asked. `key_refused`: the provider does not accept
+ * it. `rate_limited`: try again later. `unreachable`: the provider did not answer. `error`: anything else.
+ * @enum {string}
+ */
+ status: "ok" | "no_api_key" | "key_refused" | "rate_limited" | "unreachable" | "error";
+ };
+ ArtistTags: {
+ sources: {
+ /** @enum {string} */
+ provider: "lastfm" | "musicbrainz" | "files";
+ /**
+ * @description `ok`: the data is as fresh as it needs to be. `disabled`: the provider is off or has no
+ * key, so it was not asked. `error`: it was asked and failed. `no_id`: it needs the
+ * MusicBrainz id of the artist, which is not known, so it was not asked.
+ * @enum {string}
+ */
+ provider_status: "ok" | "disabled" | "error" | "no_id";
+ /** @description True when `tags` are older than they should be because the provider could not be asked. */
+ stale: boolean;
+ /**
+ * Format: date-time
+ * @description When the provider was last read for this artist; null if never.
+ */
+ retrieved_at: string | null;
+ /** @description Credit to show where the tags are shown. */
+ attribution: string;
+ /** @description The heaviest tags first, at most 50. */
+ tags: {
+ /** @description Lower case. */
+ name: string;
+ /** @description The provider's own number; see the operation. */
+ weight: number;
+ genre: boolean;
+ }[];
+ }[];
+ };
+ SimilarArtists: {
+ /** @enum {string} */
+ provider: "lastfm";
+ /**
+ * @description `ok`: the data is as fresh as it needs to be. `disabled`: the provider is off or has no key,
+ * so it was not asked. `error`: it was asked and failed.
+ * @enum {string}
+ */
+ provider_status: "ok" | "disabled" | "error";
+ /** @description True when `items` are older than they should be because the provider could not be asked. */
+ stale: boolean;
+ /**
+ * Format: date-time
+ * @description When the provider was last read for this artist; null if never.
+ */
+ retrieved_at: string | null;
+ /** @description Credit to show where the data is shown. */
+ attribution: string;
+ items: {
+ artist: components["schemas"]["ArtistRef"];
+ /** @description Whether the artist has something playable in the library. */
+ in_library: boolean;
+ /** @description The provider's own number, relative to this list. */
+ score: number;
+ /** @description Position in the provider's list, 1 first. */
+ rank: number;
+ }[];
+ };
+ ListenResult: {
+ /** @enum {string} */
+ status: "recorded" | "duplicate";
+ /** @description Whether the event counts as a listen. */
+ counted: boolean;
+ };
+ ListenItem: {
+ /** Format: int64 */
+ id: number;
+ track: {
+ /** Format: int64 */
+ id: number;
+ title: string;
+ };
+ /** @enum {string} */
+ event_type: "play" | "complete" | "skip";
+ /** Format: date-time */
+ occurred_at: string;
+ /** Format: int64 */
+ duration_played_ms: number;
+ /** @description Whether the event counts as a listen under the current rule. */
+ counted: boolean;
+ };
+ Taste: {
+ artists: components["schemas"]["TasteArtist"][];
+ tags: components["schemas"]["TasteTag"][];
+ };
+ Discover: {
+ /** @enum {string} */
+ provider_status: "ok" | "disabled" | "error";
+ /** @description What to show where the data is shown. */
+ attribution: string;
+ /** @description True when the seeds were taken from your listening, false when you named them. */
+ from_listening: boolean;
+ seeds: components["schemas"]["DiscoverSeed"][];
+ items: components["schemas"]["Suggestion"][];
+ };
+ MarkedPage: {
+ items: components["schemas"]["MarkedArtist"][];
+ /** @description Size of the whole list, not of this page. */
+ total: number;
+ limit: number;
+ offset: number;
+ };
+ MarkedArtist: {
+ artist: components["schemas"]["ArtistRef"];
+ /** @description Whether there is music of the artist to play. */
+ in_library: boolean;
+ /** Format: date-time */
+ marked_at: string;
+ };
+ DiscoverSeed: {
+ /** Format: int64 */
+ id: number;
+ name: string;
+ /** @description 1 for a seed you named, your preference for one taken from your listening. */
+ weight: number;
+ };
+ Suggestion: {
+ artist: components["schemas"]["ArtistRef"];
+ in_library: boolean;
+ /** @description True when the artist is on your wishlist. */
+ wishlisted: boolean;
+ score: number;
+ components: components["schemas"]["ScoreParts"];
+ /** @description Up to three seeds that count most for this suggestion, strongest first. */
+ because: components["schemas"]["SuggestionReason"][];
+ };
+ ScoreParts: {
+ /** @description Affinity. */
+ a: number;
+ /** @description Genre. Null when the artist has no tags or you have no taste to compare with; the score is then worked out without it. */
+ g: number | null;
+ /** @description Preference. 0.5 for an artist you never played. */
+ p: number;
+ /** @description Discovery bonus. */
+ d: number;
+ };
+ SuggestionReason: {
+ artist: components["schemas"]["ArtistRef"];
+ /** @description Last.fm's similarity of the suggestion to this seed, relative to the seed's own list. */
+ match: number;
+ };
+ CoversJobStatus: {
+ running: boolean;
+ /**
+ * Format: date-time
+ * @description When the last job started.
+ */
+ started_at?: string;
+ /** Format: date-time */
+ last_finished_at?: string;
+ /** @description Only while the job runs. */
+ progress?: {
+ done: number;
+ /** @description Albums the job set out to do. */
+ total: number;
+ };
+ /** @description How the last finished job ended. */
+ last?: {
+ /** @description Albums looked at. */
+ checked: number;
+ /** @description Covers found in the user's own files. */
+ from_files: number;
+ /** @description Covers from the Cover Art Archive. */
+ from_archive: number;
+ /** @description Albums with no cover anywhere. */
+ none: number;
+ /** @description Albums that vanished while the job ran. */
+ skipped: number;
+ /** @description Albums whose cover could not be built just then. */
+ failed: number;
+ /** @description It was stopped, or the application was. */
+ stopped: boolean;
+ };
+ /** @description Why the last job ended before the end, for example that the provider kept failing. */
+ last_error?: string;
+ };
+ ArtistJobStatus: {
+ running: boolean;
+ /**
+ * Format: date-time
+ * @description When the last job started.
+ */
+ started_at?: string;
+ /** Format: date-time */
+ last_finished_at?: string;
+ /** @description Only while the job runs. */
+ progress?: {
+ done: number;
+ /** @description Artists the job set out to do. */
+ total: number;
+ };
+ /** @description How the last finished job ended. */
+ last?: {
+ /** @description Artists looked at. */
+ checked: number;
+ /** @description Artists for which a picture, or a description, was found. */
+ found: number;
+ /** @description Artists for which the provider has nothing. */
+ none: number;
+ /** @description Artists that vanished, or lost their id, while the job ran. */
+ skipped: number;
+ /** @description Artists that could not be looked up just then. */
+ failed: number;
+ /** @description It was stopped, or the application was. */
+ stopped: boolean;
+ };
+ /** @description Why the last job ended before the end, for example that a provider is off or kept failing. */
+ last_error?: string;
+ };
+ UserSettings: {
+ /**
+ * @description When true, Discover may start from the artists you listen to most. That sends their
+ * names to Last.fm, which is asked for artists similar to each one (only when an admin
+ * switched Last.fm on). When false, Discover starts only from artists you name yourself.
+ * False until you turn it on. What Last.fm answers is stored like any other lookup and is
+ * shared: another user can see from `retrieved_at` in `GET /artists/{id}/similar` that
+ * somebody looked an artist up, but not who.
+ */
+ discover_from_listening: boolean;
+ };
+ UpdateUserSettings: {
+ discover_from_listening?: boolean | null;
+ };
+ TasteArtist: {
+ /** Format: int64 */
+ id: number;
+ name: string;
+ /** @description How much you like the artist. Only artists above 0 are listed. */
+ preference: number;
+ /** @description Events that count as a listen, with no decay, within the period that is read (ten half-lives). */
+ listens: number;
+ /**
+ * Format: date-time
+ * @description The most recent listen that counted.
+ */
+ last_listened_at: string;
+ };
+ TasteTag: {
+ /** @description Lower case. */
+ tag: string;
+ /** @description How much the tag matters to you; the best one is 1. */
+ weight: number;
+ };
+ ListenPage: {
+ items: components["schemas"]["ListenItem"][];
+ /** @description Size of the whole result, not of this page. */
+ total: number;
+ limit: number;
+ offset: number;
+ };
+ };
+ responses: {
+ /** @description The request is malformed or a value is out of range (`invalid_input`). */
+ InvalidInput: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ /** @description The access token is missing, invalid or expired, or the account it belongs to no longer exists (`unauthorized`). */
+ Unauthorized: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ /** @description The account is not an admin (`admin_required`). */
+ AdminRequired: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ /** @description No such library (`library_not_found`). */
+ LibraryNotFound: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ /** @description The scan was started in the background. */
+ ScanStarted: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": {
+ /** @enum {string} */
+ status: "started";
+ };
+ };
+ };
+ };
+ parameters: {
+ Id: number;
+ /**
+ * @description Case- and accent-insensitive substring of the name or title: `bjork`, `BJORK` and `BJÖRK` all
+ * find `Björk`, and `strasse` finds `Straße`. At most 200 characters.
+ */
+ Q: string;
+ /** @description `true` reads every file again, not only the new or changed ones. Only `true` and `false` are accepted. */
+ Full: boolean;
+ /** @description Page size. 50 when absent or 0; values above 200 are lowered to 200. */
+ Limit: number;
+ Offset: number;
+ /** @description Only items with a playable file in this library. */
+ LibraryId: number;
+ ArtistId: number;
+ AlbumId: number;
+ };
+ requestBodies: never;
+ headers: {
+ /** @description Identifies the stored picture, in quotes. */
+ ETag: string;
+ /** @description `private, max-age=3600`. */
+ CacheControl: string;
+ /** @description Always `bytes`. */
+ AcceptRanges: string;
+ ContentLength: number;
+ LastModified: string;
+ };
+ pathItems: never;
+}
+export type $defs = Record;
+export interface operations {
+ getHealth: {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ requestBody?: never;
+ responses: {
+ /** @description The server is up. */
+ 200: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": {
+ /** @enum {string} */
+ status: "ok";
+ };
+ };
+ };
+ };
+ };
+ getOpenAPI: {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ requestBody?: never;
+ responses: {
+ /** @description The OpenAPI description of the API. */
+ 200: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/yaml": string;
+ };
+ };
+ };
+ };
+ register: {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ requestBody: {
+ content: {
+ "application/json": components["schemas"]["Credentials"];
+ };
+ };
+ responses: {
+ /** @description The admin account. */
+ 201: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["User"];
+ };
+ };
+ 400: components["responses"]["InvalidInput"];
+ /** @description A user already exists (`registration_closed`). */
+ 403: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ /** @description The username is taken (`username_taken`). */
+ 409: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ };
+ };
+ login: {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ requestBody: {
+ content: {
+ "application/json": components["schemas"]["LoginRequest"];
+ };
+ };
+ responses: {
+ /** @description A new session. */
+ 200: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Session"];
+ };
+ };
+ 400: components["responses"]["InvalidInput"];
+ /** @description Wrong username or password (`invalid_credentials`). */
+ 401: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ };
+ };
+ refresh: {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ requestBody: {
+ content: {
+ "application/json": components["schemas"]["RefreshRequest"];
+ };
+ };
+ responses: {
+ /** @description A new session. */
+ 200: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Session"];
+ };
+ };
+ 400: components["responses"]["InvalidInput"];
+ /** @description The refresh token is unknown, expired or already used (`invalid_refresh_token`). */
+ 401: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ };
+ };
+ logout: {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ requestBody: {
+ content: {
+ "application/json": components["schemas"]["RefreshRequest"];
+ };
+ };
+ responses: {
+ /** @description Done. */
+ 204: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content?: never;
+ };
+ 400: components["responses"]["InvalidInput"];
+ };
+ };
+ getMe: {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ requestBody?: never;
+ responses: {
+ /** @description Your account. */
+ 200: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["User"];
+ };
+ };
+ 401: components["responses"]["Unauthorized"];
+ };
+ };
+ changePassword: {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ requestBody: {
+ content: {
+ "application/json": components["schemas"]["PasswordChange"];
+ };
+ };
+ responses: {
+ /** @description Password changed. */
+ 204: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content?: never;
+ };
+ 400: components["responses"]["InvalidInput"];
+ 401: components["responses"]["Unauthorized"];
+ /** @description The current password is wrong (`invalid_credentials`). */
+ 403: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ };
+ };
+ listUsers: {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ requestBody?: never;
+ responses: {
+ /** @description Every account, oldest first. */
+ 200: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": {
+ users: components["schemas"]["User"][];
+ };
+ };
+ };
+ 401: components["responses"]["Unauthorized"];
+ 403: components["responses"]["AdminRequired"];
+ };
+ };
+ createUser: {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ requestBody: {
+ content: {
+ "application/json": components["schemas"]["CreateUser"];
+ };
+ };
+ responses: {
+ /** @description The new account. */
+ 201: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["User"];
+ };
+ };
+ 400: components["responses"]["InvalidInput"];
+ 401: components["responses"]["Unauthorized"];
+ 403: components["responses"]["AdminRequired"];
+ /** @description The username is taken (`username_taken`). */
+ 409: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ };
+ };
+ deleteUser: {
+ parameters: {
+ query?: never;
+ header?: never;
+ path: {
+ id: components["parameters"]["Id"];
+ };
+ cookie?: never;
+ };
+ requestBody?: never;
+ responses: {
+ /** @description Deleted. */
+ 204: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content?: never;
+ };
+ 400: components["responses"]["InvalidInput"];
+ 401: components["responses"]["Unauthorized"];
+ 403: components["responses"]["AdminRequired"];
+ /** @description No such user (`user_not_found`). */
+ 404: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ /** @description This is the last admin (`last_admin`). */
+ 409: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ };
+ };
+ updateUser: {
+ parameters: {
+ query?: never;
+ header?: never;
+ path: {
+ id: components["parameters"]["Id"];
+ };
+ cookie?: never;
+ };
+ requestBody: {
+ content: {
+ "application/json": {
+ is_admin: boolean;
+ };
+ };
+ };
+ responses: {
+ /** @description The updated account. */
+ 200: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["User"];
+ };
+ };
+ 400: components["responses"]["InvalidInput"];
+ 401: components["responses"]["Unauthorized"];
+ 403: components["responses"]["AdminRequired"];
+ /** @description No such user (`user_not_found`). */
+ 404: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ /** @description This is the last admin (`last_admin`). */
+ 409: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ };
+ };
+ resetUserPassword: {
+ parameters: {
+ query?: never;
+ header?: never;
+ path: {
+ id: components["parameters"]["Id"];
+ };
+ cookie?: never;
+ };
+ requestBody: {
+ content: {
+ "application/json": {
+ /**
+ * Format: password
+ * @description 8 to 256 bytes (UTF-8).
+ */
+ password: string;
+ };
+ };
+ };
+ responses: {
+ /** @description Password reset. */
+ 204: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content?: never;
+ };
+ 400: components["responses"]["InvalidInput"];
+ 401: components["responses"]["Unauthorized"];
+ 403: components["responses"]["AdminRequired"];
+ /** @description No such user (`user_not_found`). */
+ 404: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ };
+ };
+ listLibraries: {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ requestBody?: never;
+ responses: {
+ /** @description Every library, oldest first. */
+ 200: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": {
+ libraries: components["schemas"]["Library"][];
+ };
+ };
+ };
+ 401: components["responses"]["Unauthorized"];
+ 403: components["responses"]["AdminRequired"];
+ };
+ };
+ createLibrary: {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ requestBody: {
+ content: {
+ "application/json": components["schemas"]["NewLibrary"];
+ };
+ };
+ responses: {
+ /** @description The new library. */
+ 201: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Library"];
+ };
+ };
+ 400: components["responses"]["InvalidInput"];
+ 401: components["responses"]["Unauthorized"];
+ 403: components["responses"]["AdminRequired"];
+ /** @description Another library has this name or path (`library_exists`). */
+ 409: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ };
+ };
+ deleteLibrary: {
+ parameters: {
+ query?: never;
+ header?: never;
+ path: {
+ id: components["parameters"]["Id"];
+ };
+ cookie?: never;
+ };
+ requestBody?: never;
+ responses: {
+ /** @description Removed. */
+ 204: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content?: never;
+ };
+ 400: components["responses"]["InvalidInput"];
+ 401: components["responses"]["Unauthorized"];
+ 403: components["responses"]["AdminRequired"];
+ 404: components["responses"]["LibraryNotFound"];
+ /** @description A scan is running (`scan_running`). */
+ 409: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ };
+ };
+ updateLibrary: {
+ parameters: {
+ query?: never;
+ header?: never;
+ path: {
+ id: components["parameters"]["Id"];
+ };
+ cookie?: never;
+ };
+ requestBody: {
+ content: {
+ "application/json": components["schemas"]["LibraryUpdate"];
+ };
+ };
+ responses: {
+ /** @description The updated library. */
+ 200: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Library"];
+ };
+ };
+ 400: components["responses"]["InvalidInput"];
+ 401: components["responses"]["Unauthorized"];
+ 403: components["responses"]["AdminRequired"];
+ 404: components["responses"]["LibraryNotFound"];
+ /** @description The name or path is used by another library (`library_exists`), or a scan is running (`scan_running`). */
+ 409: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ };
+ };
+ scanLibrary: {
+ parameters: {
+ query?: {
+ /** @description `true` reads every file again, not only the new or changed ones. Only `true` and `false` are accepted. */
+ full?: components["parameters"]["Full"];
+ };
+ header?: never;
+ path: {
+ id: components["parameters"]["Id"];
+ };
+ cookie?: never;
+ };
+ requestBody?: never;
+ responses: {
+ 202: components["responses"]["ScanStarted"];
+ 400: components["responses"]["InvalidInput"];
+ 401: components["responses"]["Unauthorized"];
+ 403: components["responses"]["AdminRequired"];
+ 404: components["responses"]["LibraryNotFound"];
+ /** @description A scan is already running (`scan_running`). */
+ 409: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ };
+ };
+ getCoversJob: {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ requestBody?: never;
+ responses: {
+ /** @description The job. */
+ 200: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["CoversJobStatus"];
+ };
+ };
+ 401: components["responses"]["Unauthorized"];
+ };
+ };
+ startCoversJob: {
+ parameters: {
+ query?: {
+ /** @description `true` searches every album again, also those that have a good cover. `false` when absent. */
+ refresh?: boolean;
+ };
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ requestBody?: never;
+ responses: {
+ /** @description The job was started in the background. */
+ 202: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": {
+ /** @enum {string} */
+ status: "started";
+ };
+ };
+ };
+ 400: components["responses"]["InvalidInput"];
+ 401: components["responses"]["Unauthorized"];
+ 403: components["responses"]["AdminRequired"];
+ /** @description The job is already running (`covers_job_running`). */
+ 409: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ /** @description The albums could not be counted (`internal`). */
+ 500: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ };
+ };
+ stopCoversJob: {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ requestBody?: never;
+ responses: {
+ /** @description Done, also when no job was running. */
+ 204: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content?: never;
+ };
+ 401: components["responses"]["Unauthorized"];
+ 403: components["responses"]["AdminRequired"];
+ };
+ };
+ getArtistImagesJob: {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ requestBody?: never;
+ responses: {
+ /** @description The job. */
+ 200: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["ArtistJobStatus"];
+ };
+ };
+ 401: components["responses"]["Unauthorized"];
+ };
+ };
+ startArtistImagesJob: {
+ parameters: {
+ query?: {
+ /** @description `true` searches every artist again, also those with a good answer. `false` when absent. */
+ refresh?: boolean;
+ };
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ requestBody?: never;
+ responses: {
+ /** @description The job was started in the background. */
+ 202: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": {
+ /** @enum {string} */
+ status: "started";
+ };
+ };
+ };
+ 400: components["responses"]["InvalidInput"];
+ 401: components["responses"]["Unauthorized"];
+ 403: components["responses"]["AdminRequired"];
+ /** @description The job is already running (`artist_images_job_running`). */
+ 409: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ /** @description The artists could not be counted (`internal`). */
+ 500: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ };
+ };
+ stopArtistImagesJob: {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ requestBody?: never;
+ responses: {
+ /** @description Done, also when no job was running. */
+ 204: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content?: never;
+ };
+ 401: components["responses"]["Unauthorized"];
+ 403: components["responses"]["AdminRequired"];
+ };
+ };
+ getDescriptionsJob: {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ requestBody?: never;
+ responses: {
+ /** @description The job. */
+ 200: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["ArtistJobStatus"];
+ };
+ };
+ 401: components["responses"]["Unauthorized"];
+ };
+ };
+ startDescriptionsJob: {
+ parameters: {
+ query?: {
+ /** @description `true` reads every artist again, also those with a good answer. `false` when absent. */
+ refresh?: boolean;
+ };
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ requestBody?: never;
+ responses: {
+ /** @description The job was started in the background. */
+ 202: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": {
+ /** @enum {string} */
+ status: "started";
+ };
+ };
+ };
+ 400: components["responses"]["InvalidInput"];
+ 401: components["responses"]["Unauthorized"];
+ 403: components["responses"]["AdminRequired"];
+ /** @description The job is already running (`descriptions_job_running`). */
+ 409: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ /** @description The artists could not be counted (`internal`). */
+ 500: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ };
+ };
+ stopDescriptionsJob: {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ requestBody?: never;
+ responses: {
+ /** @description Done, also when no job was running. */
+ 204: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content?: never;
+ };
+ 401: components["responses"]["Unauthorized"];
+ 403: components["responses"]["AdminRequired"];
+ };
+ };
+ getScanStatus: {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ requestBody?: never;
+ responses: {
+ /** @description The current state. */
+ 200: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["ScanStatus"];
+ };
+ };
+ 401: components["responses"]["Unauthorized"];
+ };
+ };
+ scanAll: {
+ parameters: {
+ query?: {
+ /** @description `true` reads every file again, not only the new or changed ones. Only `true` and `false` are accepted. */
+ full?: components["parameters"]["Full"];
+ };
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ requestBody?: never;
+ responses: {
+ 202: components["responses"]["ScanStarted"];
+ 400: components["responses"]["InvalidInput"];
+ 401: components["responses"]["Unauthorized"];
+ 403: components["responses"]["AdminRequired"];
+ /** @description A scan is already running (`scan_running`), or there is no library yet (`no_libraries`). */
+ 409: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ };
+ };
+ listArtists: {
+ parameters: {
+ query?: {
+ /**
+ * @description Case- and accent-insensitive substring of the name or title: `bjork`, `BJORK` and `BJÖRK` all
+ * find `Björk`, and `strasse` finds `Straße`. At most 200 characters.
+ */
+ q?: components["parameters"]["Q"];
+ /** @description Page size. 50 when absent or 0; values above 200 are lowered to 200. */
+ limit?: components["parameters"]["Limit"];
+ offset?: components["parameters"]["Offset"];
+ /** @description Only items with a playable file in this library. */
+ library_id?: components["parameters"]["LibraryId"];
+ };
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ requestBody?: never;
+ responses: {
+ /** @description A page of artists. */
+ 200: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["ArtistPage"];
+ };
+ };
+ 400: components["responses"]["InvalidInput"];
+ 401: components["responses"]["Unauthorized"];
+ };
+ };
+ getArtist: {
+ parameters: {
+ query?: never;
+ header?: never;
+ path: {
+ id: components["parameters"]["Id"];
+ };
+ cookie?: never;
+ };
+ requestBody?: never;
+ responses: {
+ /** @description The artist. */
+ 200: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Artist"];
+ };
+ };
+ 400: components["responses"]["InvalidInput"];
+ 401: components["responses"]["Unauthorized"];
+ /**
+ * @description No such artist (`artist_not_found`). An artist with nothing to play is not found either,
+ * unless a provider named it as similar to another artist: those can be shown, with
+ * `track_count` and `album_count` of 0, but they are never part of the lists.
+ */
+ 404: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ };
+ };
+ getSimilarArtists: {
+ parameters: {
+ query?: {
+ /** @description How many to return. 20 when absent or 0; values above 50 are lowered to 50, the most that is kept. */
+ limit?: number;
+ };
+ header?: never;
+ path: {
+ id: components["parameters"]["Id"];
+ };
+ cookie?: never;
+ };
+ requestBody?: never;
+ responses: {
+ /** @description The similar artists. */
+ 200: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["SimilarArtists"];
+ };
+ };
+ 400: components["responses"]["InvalidInput"];
+ 401: components["responses"]["Unauthorized"];
+ /** @description No such artist (`artist_not_found`). */
+ 404: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ };
+ };
+ getArtistTags: {
+ parameters: {
+ query?: never;
+ header?: never;
+ path: {
+ id: components["parameters"]["Id"];
+ };
+ cookie?: never;
+ };
+ requestBody?: never;
+ responses: {
+ /** @description One entry per provider. */
+ 200: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["ArtistTags"];
+ };
+ };
+ 400: components["responses"]["InvalidInput"];
+ 401: components["responses"]["Unauthorized"];
+ /** @description No such artist (`artist_not_found`). */
+ 404: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ };
+ };
+ discover: {
+ parameters: {
+ query?: {
+ /** @description An artist id to start from. Repeat up to 5 times. Without it, your listening is used if you allowed that. */
+ seed?: number[];
+ /** @description How many suggestions to return. 20 when absent or 0; values above 30 are lowered to 30. */
+ limit?: number;
+ /** @description `true` keeps only artists you have, `false` only artists you do not. Absent keeps both. */
+ in_library?: boolean;
+ };
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ requestBody?: never;
+ responses: {
+ /** @description The suggestions, best first. */
+ 200: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Discover"];
+ };
+ };
+ /** @description A seed that is not an artist, too many seeds, a bad `limit` or `in_library` (`invalid_input`), or no seed and no permission to use your listening (`seed_required`). */
+ 400: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ 401: components["responses"]["Unauthorized"];
+ };
+ };
+ listDismissed: {
+ parameters: {
+ query?: {
+ /** @description Page size. 50 when absent or 0; values above 200 are lowered to 200. */
+ limit?: components["parameters"]["Limit"];
+ offset?: components["parameters"]["Offset"];
+ };
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ requestBody?: never;
+ responses: {
+ /** @description A page of artists. */
+ 200: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["MarkedPage"];
+ };
+ };
+ 400: components["responses"]["InvalidInput"];
+ 401: components["responses"]["Unauthorized"];
+ };
+ };
+ dismissArtist: {
+ parameters: {
+ query?: never;
+ header?: never;
+ path: {
+ id: components["parameters"]["Id"];
+ };
+ cookie?: never;
+ };
+ requestBody?: never;
+ responses: {
+ /** @description Done, also when it was already dismissed. */
+ 204: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content?: never;
+ };
+ 400: components["responses"]["InvalidInput"];
+ 401: components["responses"]["Unauthorized"];
+ /** @description No such artist (`artist_not_found`). */
+ 404: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ };
+ };
+ undismissArtist: {
+ parameters: {
+ query?: never;
+ header?: never;
+ path: {
+ id: components["parameters"]["Id"];
+ };
+ cookie?: never;
+ };
+ requestBody?: never;
+ responses: {
+ /** @description Done, also when it was not dismissed. */
+ 204: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content?: never;
+ };
+ 400: components["responses"]["InvalidInput"];
+ 401: components["responses"]["Unauthorized"];
+ /** @description No such artist (`artist_not_found`). */
+ 404: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ };
+ };
+ listWishlist: {
+ parameters: {
+ query?: {
+ /** @description Page size. 50 when absent or 0; values above 200 are lowered to 200. */
+ limit?: components["parameters"]["Limit"];
+ offset?: components["parameters"]["Offset"];
+ };
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ requestBody?: never;
+ responses: {
+ /** @description A page of artists. */
+ 200: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["MarkedPage"];
+ };
+ };
+ 400: components["responses"]["InvalidInput"];
+ 401: components["responses"]["Unauthorized"];
+ };
+ };
+ addToWishlist: {
+ parameters: {
+ query?: never;
+ header?: never;
+ path: {
+ id: components["parameters"]["Id"];
+ };
+ cookie?: never;
+ };
+ requestBody?: never;
+ responses: {
+ /** @description Done, also when it was already there. */
+ 204: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content?: never;
+ };
+ 400: components["responses"]["InvalidInput"];
+ 401: components["responses"]["Unauthorized"];
+ /** @description No such artist (`artist_not_found`). */
+ 404: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ };
+ };
+ removeFromWishlist: {
+ parameters: {
+ query?: never;
+ header?: never;
+ path: {
+ id: components["parameters"]["Id"];
+ };
+ cookie?: never;
+ };
+ requestBody?: never;
+ responses: {
+ /** @description Done, also when it was not there. */
+ 204: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content?: never;
+ };
+ 400: components["responses"]["InvalidInput"];
+ 401: components["responses"]["Unauthorized"];
+ /** @description No such artist (`artist_not_found`). */
+ 404: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ };
+ };
+ getMyTaste: {
+ parameters: {
+ query?: {
+ /** @description How many artists to return. 20 when absent or 0; values above 50 are lowered to 50. It does not limit `tags`. */
+ limit?: number;
+ };
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ requestBody?: never;
+ responses: {
+ /** @description Your taste. Both lists are empty until you have listened to something. */
+ 200: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Taste"];
+ };
+ };
+ 400: components["responses"]["InvalidInput"];
+ 401: components["responses"]["Unauthorized"];
+ };
+ };
+ getMySettings: {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ requestBody?: never;
+ responses: {
+ /** @description Your settings. */
+ 200: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["UserSettings"];
+ };
+ };
+ 401: components["responses"]["Unauthorized"];
+ };
+ };
+ updateMySettings: {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ requestBody: {
+ content: {
+ "application/json": components["schemas"]["UpdateUserSettings"];
+ };
+ };
+ responses: {
+ /** @description Your settings as they are now. */
+ 200: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["UserSettings"];
+ };
+ };
+ 400: components["responses"]["InvalidInput"];
+ 401: components["responses"]["Unauthorized"];
+ };
+ };
+ getArtistDescription: {
+ parameters: {
+ query?: never;
+ header?: never;
+ path: {
+ id: components["parameters"]["Id"];
+ };
+ cookie?: never;
+ };
+ requestBody?: never;
+ responses: {
+ /** @description The description, or `null` with the status that says why. */
+ 200: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["ArtistDescription"];
+ };
+ };
+ 400: components["responses"]["InvalidInput"];
+ 401: components["responses"]["Unauthorized"];
+ /** @description No such artist (`artist_not_found`). */
+ 404: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ };
+ };
+ getArtistImage: {
+ parameters: {
+ query?: {
+ /** @description `small` (300 pixels at most on the longest side) or `large` (1000). Large when absent. */
+ size?: "small" | "large";
+ };
+ header?: {
+ "If-None-Match"?: string;
+ Range?: string;
+ };
+ path: {
+ id: components["parameters"]["Id"];
+ };
+ cookie?: never;
+ };
+ requestBody?: never;
+ responses: {
+ /** @description The picture. */
+ 200: {
+ headers: {
+ ETag: components["headers"]["ETag"];
+ "Cache-Control": components["headers"]["CacheControl"];
+ "Content-Length": components["headers"]["ContentLength"];
+ "Last-Modified": components["headers"]["LastModified"];
+ [name: string]: unknown;
+ };
+ content: {
+ "image/jpeg": string;
+ };
+ };
+ /** @description The requested byte range of the picture. */
+ 206: {
+ headers: {
+ "Content-Range"?: string;
+ [name: string]: unknown;
+ };
+ content: {
+ "image/jpeg": string;
+ };
+ };
+ /** @description Not modified since the `ETag` sent. */
+ 304: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content?: never;
+ };
+ 400: components["responses"]["InvalidInput"];
+ 401: components["responses"]["Unauthorized"];
+ /**
+ * @description No such artist (`artist_not_found`), no free picture of it (`image_not_found`), the
+ * provider is off (`provider_disabled`), or the artist has no MusicBrainz id
+ * (`no_musicbrainz_id`).
+ */
+ 404: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ /** @description The picture provider could not be reached (`provider_unavailable`). Try again later. */
+ 502: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ };
+ };
+ headArtistImage: {
+ parameters: {
+ query?: {
+ size?: "small" | "large";
+ };
+ header?: {
+ "If-None-Match"?: string;
+ };
+ path: {
+ id: components["parameters"]["Id"];
+ };
+ cookie?: never;
+ };
+ requestBody?: never;
+ responses: {
+ /** @description Headers of the picture. */
+ 200: {
+ headers: {
+ ETag: components["headers"]["ETag"];
+ "Cache-Control": components["headers"]["CacheControl"];
+ "Content-Length": components["headers"]["ContentLength"];
+ "Last-Modified": components["headers"]["LastModified"];
+ [name: string]: unknown;
+ };
+ content?: never;
+ };
+ /** @description Not modified since the `ETag` sent. */
+ 304: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content?: never;
+ };
+ 400: components["responses"]["InvalidInput"];
+ 401: components["responses"]["Unauthorized"];
+ /** @description No such artist, no free picture, the provider is off or the artist has no MusicBrainz id. */
+ 404: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content?: never;
+ };
+ /** @description The picture provider could not be reached. */
+ 502: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content?: never;
+ };
+ };
+ };
+ getArtistImageCredit: {
+ parameters: {
+ query?: never;
+ header?: never;
+ path: {
+ id: components["parameters"]["Id"];
+ };
+ cookie?: never;
+ };
+ requestBody?: never;
+ responses: {
+ /** @description The credit. */
+ 200: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["PictureCredit"];
+ };
+ };
+ 400: components["responses"]["InvalidInput"];
+ 401: components["responses"]["Unauthorized"];
+ /** @description No such artist (`artist_not_found`), no free picture (`image_not_found`), the provider is off (`provider_disabled`) or the artist has no MusicBrainz id (`no_musicbrainz_id`). */
+ 404: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ /** @description The picture provider could not be reached (`provider_unavailable`). */
+ 502: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ };
+ };
+ listAlbums: {
+ parameters: {
+ query?: {
+ /**
+ * @description Case- and accent-insensitive substring of the name or title: `bjork`, `BJORK` and `BJÖRK` all
+ * find `Björk`, and `strasse` finds `Straße`. At most 200 characters.
+ */
+ q?: components["parameters"]["Q"];
+ /** @description Page size. 50 when absent or 0; values above 200 are lowered to 200. */
+ limit?: components["parameters"]["Limit"];
+ offset?: components["parameters"]["Offset"];
+ /** @description Only items with a playable file in this library. */
+ library_id?: components["parameters"]["LibraryId"];
+ artist_id?: components["parameters"]["ArtistId"];
+ };
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ requestBody?: never;
+ responses: {
+ /** @description A page of albums. */
+ 200: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["AlbumPage"];
+ };
+ };
+ 400: components["responses"]["InvalidInput"];
+ 401: components["responses"]["Unauthorized"];
+ };
+ };
+ getAlbum: {
+ parameters: {
+ query?: never;
+ header?: never;
+ path: {
+ id: components["parameters"]["Id"];
+ };
+ cookie?: never;
+ };
+ requestBody?: never;
+ responses: {
+ /** @description The album. */
+ 200: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Album"];
+ };
+ };
+ 400: components["responses"]["InvalidInput"];
+ 401: components["responses"]["Unauthorized"];
+ /** @description No such album, or nothing of it can be played (`album_not_found`). */
+ 404: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ };
+ };
+ getAlbumCover: {
+ parameters: {
+ query?: {
+ /** @description `small` (300 pixels at most on the longest side) or `large` (1000). Large when absent. Never enlarged: a small picture stays as it is. */
+ size?: "small" | "large";
+ };
+ header?: {
+ "If-None-Match"?: string;
+ Range?: string;
+ };
+ path: {
+ id: components["parameters"]["Id"];
+ };
+ cookie?: never;
+ };
+ requestBody?: never;
+ responses: {
+ /** @description The cover. */
+ 200: {
+ headers: {
+ ETag: components["headers"]["ETag"];
+ "Cache-Control": components["headers"]["CacheControl"];
+ "Content-Length": components["headers"]["ContentLength"];
+ "Last-Modified": components["headers"]["LastModified"];
+ [name: string]: unknown;
+ };
+ content: {
+ "image/jpeg": string;
+ };
+ };
+ /** @description The requested byte range of the cover. */
+ 206: {
+ headers: {
+ "Content-Range"?: string;
+ [name: string]: unknown;
+ };
+ content: {
+ "image/jpeg": string;
+ };
+ };
+ /** @description Not modified since the `ETag` sent. */
+ 304: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content?: never;
+ };
+ 400: components["responses"]["InvalidInput"];
+ 401: components["responses"]["Unauthorized"];
+ /** @description No such album (`album_not_found`), or it has no cover (`cover_not_found`). */
+ 404: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ /** @description The cover provider could not be reached (`provider_unavailable`). Try again later. */
+ 502: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ /**
+ * @description None of the album's files or folders could be read, for example because the disk is not
+ * mounted (`files_unreadable`). That says nothing about whether there is a picture, so it is
+ * not remembered as "no cover" and nothing already built is touched. Try again later.
+ */
+ 503: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ };
+ };
+ headAlbumCover: {
+ parameters: {
+ query?: {
+ size?: "small" | "large";
+ };
+ header?: {
+ "If-None-Match"?: string;
+ };
+ path: {
+ id: components["parameters"]["Id"];
+ };
+ cookie?: never;
+ };
+ requestBody?: never;
+ responses: {
+ /** @description Headers of the cover. */
+ 200: {
+ headers: {
+ ETag: components["headers"]["ETag"];
+ "Cache-Control": components["headers"]["CacheControl"];
+ "Content-Length": components["headers"]["ContentLength"];
+ "Last-Modified": components["headers"]["LastModified"];
+ [name: string]: unknown;
+ };
+ content?: never;
+ };
+ /** @description Not modified since the `ETag` sent. */
+ 304: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content?: never;
+ };
+ 400: components["responses"]["InvalidInput"];
+ 401: components["responses"]["Unauthorized"];
+ /** @description No such album, or it has no cover. */
+ 404: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content?: never;
+ };
+ /** @description The cover provider could not be reached. */
+ 502: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content?: never;
+ };
+ /** @description None of the album's files could be read. */
+ 503: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content?: never;
+ };
+ };
+ };
+ listTracks: {
+ parameters: {
+ query?: {
+ /**
+ * @description Case- and accent-insensitive substring of the name or title: `bjork`, `BJORK` and `BJÖRK` all
+ * find `Björk`, and `strasse` finds `Straße`. At most 200 characters.
+ */
+ q?: components["parameters"]["Q"];
+ /** @description Page size. 50 when absent or 0; values above 200 are lowered to 200. */
+ limit?: components["parameters"]["Limit"];
+ offset?: components["parameters"]["Offset"];
+ /** @description Only items with a playable file in this library. */
+ library_id?: components["parameters"]["LibraryId"];
+ artist_id?: components["parameters"]["ArtistId"];
+ album_id?: components["parameters"]["AlbumId"];
+ };
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ requestBody?: never;
+ responses: {
+ /** @description A page of tracks. */
+ 200: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["TrackPage"];
+ };
+ };
+ 400: components["responses"]["InvalidInput"];
+ 401: components["responses"]["Unauthorized"];
+ };
+ };
+ getTrack: {
+ parameters: {
+ query?: never;
+ header?: never;
+ path: {
+ id: components["parameters"]["Id"];
+ };
+ cookie?: never;
+ };
+ requestBody?: never;
+ responses: {
+ /** @description The track. */
+ 200: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Track"];
+ };
+ };
+ 400: components["responses"]["InvalidInput"];
+ 401: components["responses"]["Unauthorized"];
+ /** @description No such track, or it has no playable file (`track_not_found`). */
+ 404: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ };
+ };
+ streamTrack: {
+ parameters: {
+ query?: never;
+ header?: {
+ /** @description A byte range, for example `bytes=0-99`. */
+ Range?: string;
+ "If-Modified-Since"?: string;
+ "If-Unmodified-Since"?: string;
+ };
+ path: {
+ id: components["parameters"]["Id"];
+ };
+ cookie?: never;
+ };
+ requestBody?: never;
+ responses: {
+ /** @description The whole file. */
+ 200: {
+ headers: {
+ "Accept-Ranges": components["headers"]["AcceptRanges"];
+ "Content-Length": components["headers"]["ContentLength"];
+ "Last-Modified": components["headers"]["LastModified"];
+ [name: string]: unknown;
+ };
+ content: {
+ "audio/mpeg": string;
+ "audio/flac": string;
+ };
+ };
+ /**
+ * @description The requested byte range. Several ranges in one request are answered as
+ * `multipart/byteranges`.
+ */
+ 206: {
+ headers: {
+ /** @description The range sent and the size of the file, for example `bytes 0-99/40635`. Absent for a multipart answer. */
+ "Content-Range"?: string;
+ [name: string]: unknown;
+ };
+ content: {
+ "audio/mpeg": string;
+ "audio/flac": string;
+ "multipart/byteranges": string;
+ };
+ };
+ /** @description Not modified since `If-Modified-Since`. */
+ 304: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content?: never;
+ };
+ 400: components["responses"]["InvalidInput"];
+ 401: components["responses"]["Unauthorized"];
+ /** @description No such track (`track_not_found`), or its file is not available (`file_missing`). */
+ 404: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ /** @description `If-Unmodified-Since` names a date before the last change of the file. */
+ 412: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content?: never;
+ };
+ /** @description The range cannot be satisfied. */
+ 416: {
+ headers: {
+ /** @description `bytes *\/`. */
+ "Content-Range"?: string;
+ [name: string]: unknown;
+ };
+ content?: never;
+ };
+ };
+ };
+ headTrackStream: {
+ parameters: {
+ query?: never;
+ header?: {
+ Range?: string;
+ "If-Modified-Since"?: string;
+ "If-Unmodified-Since"?: string;
+ };
+ path: {
+ id: components["parameters"]["Id"];
+ };
+ cookie?: never;
+ };
+ requestBody?: never;
+ responses: {
+ /** @description Headers of the whole file. */
+ 200: {
+ headers: {
+ "Accept-Ranges": components["headers"]["AcceptRanges"];
+ "Content-Length": components["headers"]["ContentLength"];
+ "Last-Modified": components["headers"]["LastModified"];
+ [name: string]: unknown;
+ };
+ content?: never;
+ };
+ /** @description Headers of the requested range. */
+ 206: {
+ headers: {
+ "Content-Range"?: string;
+ [name: string]: unknown;
+ };
+ content?: never;
+ };
+ /** @description Not modified since `If-Modified-Since`. */
+ 304: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content?: never;
+ };
+ 400: components["responses"]["InvalidInput"];
+ 401: components["responses"]["Unauthorized"];
+ /** @description No such track or file. */
+ 404: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content?: never;
+ };
+ /** @description `If-Unmodified-Since` names a date before the last change of the file. */
+ 412: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content?: never;
+ };
+ /** @description The range cannot be satisfied. */
+ 416: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content?: never;
+ };
+ };
+ };
+ listProviders: {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ requestBody?: never;
+ responses: {
+ /** @description The providers, in a fixed order. */
+ 200: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": {
+ providers: components["schemas"]["Provider"][];
+ };
+ };
+ };
+ 401: components["responses"]["Unauthorized"];
+ 403: components["responses"]["AdminRequired"];
+ };
+ };
+ updateProvider: {
+ parameters: {
+ query?: never;
+ header?: never;
+ path: {
+ name: "lastfm" | "musicbrainz" | "wikipedia" | "commons" | "coverartarchive";
+ };
+ cookie?: never;
+ };
+ requestBody: {
+ content: {
+ "application/json": components["schemas"]["ProviderUpdate"];
+ };
+ };
+ responses: {
+ /** @description The provider as it is now. */
+ 200: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Provider"];
+ };
+ };
+ 400: components["responses"]["InvalidInput"];
+ 401: components["responses"]["Unauthorized"];
+ 403: components["responses"]["AdminRequired"];
+ /** @description No such provider (`provider_not_found`). */
+ 404: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ };
+ };
+ testProvider: {
+ parameters: {
+ query?: never;
+ header?: never;
+ path: {
+ name: "lastfm" | "musicbrainz" | "wikipedia" | "commons" | "coverartarchive";
+ };
+ cookie?: never;
+ };
+ requestBody?: never;
+ responses: {
+ /** @description The outcome of the check. */
+ 200: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["ProviderTest"];
+ };
+ };
+ 400: components["responses"]["InvalidInput"];
+ 401: components["responses"]["Unauthorized"];
+ 403: components["responses"]["AdminRequired"];
+ /** @description No such provider (`provider_not_found`). */
+ 404: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ };
+ };
+ purgeProviderData: {
+ parameters: {
+ query?: never;
+ header?: never;
+ path: {
+ name: "lastfm" | "musicbrainz" | "wikipedia" | "commons" | "coverartarchive";
+ };
+ cookie?: never;
+ };
+ requestBody?: never;
+ responses: {
+ /** @description What was removed. */
+ 200: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["ProviderPurge"];
+ };
+ };
+ 401: components["responses"]["Unauthorized"];
+ 403: components["responses"]["AdminRequired"];
+ /** @description No such provider (`provider_not_found`). */
+ 404: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ };
+ };
+ listListens: {
+ parameters: {
+ query?: {
+ /** @description Page size. 50 when absent or 0; values above 200 are lowered to 200. */
+ limit?: components["parameters"]["Limit"];
+ offset?: components["parameters"]["Offset"];
+ /** @description Send `true` to list only the events that count as a listen. */
+ counted?: true;
+ };
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ requestBody?: never;
+ responses: {
+ /** @description A page of events. */
+ 200: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["ListenPage"];
+ };
+ };
+ 400: components["responses"]["InvalidInput"];
+ 401: components["responses"]["Unauthorized"];
+ };
+ };
+ recordListen: {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ requestBody: {
+ content: {
+ "application/json": components["schemas"]["Listen"];
+ };
+ };
+ responses: {
+ /** @description Already recorded (same `idempotency_key`). */
+ 200: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["ListenResult"];
+ };
+ };
+ /** @description Recorded. */
+ 201: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["ListenResult"];
+ };
+ };
+ 400: components["responses"]["InvalidInput"];
+ 401: components["responses"]["Unauthorized"];
+ /** @description No such track (`track_not_found`). */
+ 404: {
+ headers: {
+ [name: string]: unknown;
+ };
+ content: {
+ "application/json": components["schemas"]["Error"];
+ };
+ };
+ };
+ };
+}
diff --git a/web/src/auth/AuthGate.tsx b/web/src/auth/AuthGate.tsx
new file mode 100644
index 0000000..7f5fe51
--- /dev/null
+++ b/web/src/auth/AuthGate.tsx
@@ -0,0 +1,16 @@
+import type { ReactNode } from 'react'
+import { useTranslation } from 'react-i18next'
+import LoginPage from './LoginPage'
+import { useSession } from './session'
+
+/** Shows the app to a signed-in user and the sign-in form to everyone else. */
+export default function AuthGate({ children }: { children: ReactNode }) {
+ const { status } = useSession()
+ const { t } = useTranslation()
+
+ if (status === 'loading') {
+ return
+ }
+ if (status === 'anonymous') return
+ return <>{children}>
+}
diff --git a/web/src/auth/LoginPage.test.tsx b/web/src/auth/LoginPage.test.tsx
new file mode 100644
index 0000000..4af1071
--- /dev/null
+++ b/web/src/auth/LoginPage.test.tsx
@@ -0,0 +1,94 @@
+import { render, screen } from '@testing-library/react'
+import userEvent from '@testing-library/user-event'
+import { beforeEach, expect, test, vi } from 'vitest'
+import { initI18n } from '@/i18n'
+import { apiError, mockFetch } from '@/test/mockFetch'
+import AuthGate from './AuthGate'
+import LoginPage from './LoginPage'
+import { sessionStore } from './session'
+
+const user = { id: 1, username: 'tom', is_admin: true }
+const session = {
+ access_token: 'a1',
+ access_expires_at: new Date(Date.now() + 900_000).toISOString(),
+ refresh_token: 'r1',
+ refresh_expires_at: new Date(Date.now() + 86_400_000).toISOString(),
+ user,
+}
+
+beforeEach(async () => {
+ vi.spyOn(navigator, 'language', 'get').mockReturnValue('en-US')
+ await initI18n()
+ sessionStore.setState({ status: 'anonymous', user: null, accessToken: null, accessExpiresAt: 0, refreshToken: null })
+})
+
+async function fill(username: string, password: string) {
+ await userEvent.type(screen.getByLabelText('Username'), username)
+ await userEvent.type(screen.getByLabelText('Password'), password)
+}
+
+test('a wrong password shows the translated message', async () => {
+ mockFetch({ 'POST /api/v1/auth/login': () => apiError(401, 'invalid_credentials') })
+ render( )
+ await fill('tom', 'wrong-password')
+ await userEvent.click(screen.getByRole('button', { name: 'Sign in' }))
+ expect(await screen.findByRole('alert')).toHaveTextContent('Wrong username or password.')
+})
+
+test('signing in sends what was typed', async () => {
+ const { calls } = mockFetch({ 'POST /api/v1/auth/login': () => session })
+ render( )
+ await fill('tom', 'secret123')
+ await userEvent.click(screen.getByRole('button', { name: 'Sign in' }))
+ await vi.waitFor(() => expect(sessionStore.getState().status).toBe('authenticated'))
+ expect(JSON.parse(calls[0].init.body as string)).toEqual({ username: 'tom', password: 'secret123' })
+})
+
+test('the first-account link switches to registration and says when one already exists', async () => {
+ mockFetch({ 'POST /api/v1/auth/register': () => apiError(403, 'registration_closed') })
+ render( )
+ await userEvent.click(screen.getByRole('button', { name: 'This is a new server: create the first account' }))
+ await fill('tom', 'secret123')
+ await userEvent.click(screen.getByRole('button', { name: 'Create account' }))
+ expect(await screen.findByRole('alert')).toHaveTextContent('An account already exists.')
+})
+
+test('an unreachable server is reported as such', async () => {
+ vi.stubGlobal(
+ 'fetch',
+ vi.fn(async () => {
+ throw new TypeError('Failed to fetch')
+ }),
+ )
+ render( )
+ await fill('tom', 'secret123')
+ await userEvent.click(screen.getByRole('button', { name: 'Sign in' }))
+ expect(await screen.findByRole('alert')).toHaveTextContent('Cannot reach the server.')
+})
+
+test('AuthGate shows nothing while loading, the form when signed out, the app when signed in', () => {
+ sessionStore.setState({ status: 'loading' })
+ const { rerender } = render(
+
+ the app
+ ,
+ )
+ expect(screen.queryByText('the app')).not.toBeInTheDocument()
+ expect(screen.queryByLabelText('Username')).not.toBeInTheDocument()
+
+ sessionStore.setState({ status: 'anonymous' })
+ rerender(
+
+ the app
+ ,
+ )
+ expect(screen.getByLabelText('Username')).toBeInTheDocument()
+
+ sessionStore.setState({ status: 'authenticated', user })
+ rerender(
+
+ the app
+ ,
+ )
+ expect(screen.getByText('the app')).toBeInTheDocument()
+})
diff --git a/web/src/auth/LoginPage.tsx b/web/src/auth/LoginPage.tsx
new file mode 100644
index 0000000..cf24bc6
--- /dev/null
+++ b/web/src/auth/LoginPage.tsx
@@ -0,0 +1,89 @@
+import { useState, type FormEvent } from 'react'
+import { useTranslation } from 'react-i18next'
+import { ApiError } from '@/api/client'
+import { Button } from '@/components/ui/button'
+import { Input } from '@/components/ui/input'
+import { Label } from '@/components/ui/label'
+import { errorMessageKey } from '@/i18n'
+import { login, register } from './session'
+
+/** Sign in, or (on a new server) create the first account, which becomes the admin. */
+export default function LoginPage() {
+ const { t } = useTranslation()
+ const [creating, setCreating] = useState(false)
+ const [username, setUsername] = useState('')
+ const [password, setPassword] = useState('')
+ const [error, setError] = useState(null)
+ const [busy, setBusy] = useState(false)
+
+ async function submit(event: FormEvent) {
+ event.preventDefault()
+ setBusy(true)
+ setError(null)
+ try {
+ await (creating ? register : login)(username, password)
+ } catch (e) {
+ setError(t(errorMessageKey(e instanceof ApiError ? e.code : 'unknown')))
+ } finally {
+ setBusy(false)
+ }
+ }
+
+ return (
+
+
+
+
+
+
+
+
+ {t('app.name')}
+
+
{creating ? t('auth.registerTitle') : t('auth.signInTitle')}
+
+
{
+ setCreating(!creating)
+ setError(null)
+ }}
+ >
+ {creating ? t('auth.haveAccount') : t('auth.firstUser')}
+
+
+
+ )
+}
diff --git a/web/src/auth/session.test.ts b/web/src/auth/session.test.ts
new file mode 100644
index 0000000..0fbf830
--- /dev/null
+++ b/web/src/auth/session.test.ts
@@ -0,0 +1,286 @@
+import { afterEach, beforeEach, expect, test, vi } from 'vitest'
+import { apiError, mockFetch } from '@/test/mockFetch'
+import {
+ getAccessToken,
+ login,
+ logout,
+ mediaUrl,
+ onTokenChange,
+ register,
+ restoreSession,
+ sessionStore,
+} from './session'
+
+const user = { id: 1, username: 'tom', is_admin: true }
+
+function session(opts: { access?: string; refresh?: string; expiresInSeconds?: number } = {}) {
+ const { access = 'a1', refresh = 'r1', expiresInSeconds = 900 } = opts
+ return {
+ access_token: access,
+ access_expires_at: new Date(Date.now() + expiresInSeconds * 1000).toISOString(),
+ refresh_token: refresh,
+ refresh_expires_at: new Date(Date.now() + 86_400_000).toISOString(),
+ user,
+ }
+}
+
+function stored() {
+ const raw = localStorage.getItem('sonda.session')
+ return raw ? JSON.parse(raw) : null
+}
+
+function storeSession(s: ReturnType) {
+ localStorage.setItem('sonda.session', JSON.stringify(s))
+}
+
+beforeEach(() => {
+ sessionStore.setState({
+ status: 'loading',
+ user: null,
+ accessToken: null,
+ accessExpiresAt: 0,
+ refreshToken: null,
+ })
+})
+
+afterEach(() => {
+ vi.restoreAllMocks()
+ delete (navigator as unknown as Record).locks
+})
+
+test('login keeps the session and opens it', async () => {
+ const { calls } = mockFetch({ 'POST /api/v1/auth/login': () => session() })
+ await login('tom', 'secret123')
+ expect(sessionStore.getState().status).toBe('authenticated')
+ expect(sessionStore.getState().user).toEqual(user)
+ expect(stored().access_token).toBe('a1')
+ expect(stored().refresh_token).toBe('r1')
+ expect(JSON.parse(calls[0].init.body as string)).toEqual({ username: 'tom', password: 'secret123' })
+ expect((calls[0].init.headers as Record).Authorization).toBeUndefined()
+})
+
+test('register creates the account and then signs in', async () => {
+ const { calls } = mockFetch({
+ 'POST /api/v1/auth/register': () => new Response(JSON.stringify(user), { status: 201 }),
+ 'POST /api/v1/auth/login': () => session(),
+ })
+ await register('tom', 'secret123')
+ expect(calls.map((c) => c.key)).toEqual(['POST /api/v1/auth/register', 'POST /api/v1/auth/login'])
+ expect(sessionStore.getState().status).toBe('authenticated')
+})
+
+test('a token with time left is returned without any request', async () => {
+ const { calls } = mockFetch({ 'POST /api/v1/auth/login': () => session({ expiresInSeconds: 600 }) })
+ await login('tom', 'secret123')
+ await expect(getAccessToken()).resolves.toBe('a1')
+ expect(calls).toHaveLength(1)
+})
+
+test('five calls at once with 30 seconds left send a single refresh', async () => {
+ mockFetch({
+ 'POST /api/v1/auth/login': () => session({ expiresInSeconds: 30 }),
+ 'POST /api/v1/auth/refresh': () => session({ access: 'a2', refresh: 'r2' }),
+ })
+ await login('tom', 'secret123')
+ const tokens = await Promise.all([1, 2, 3, 4, 5].map(() => getAccessToken()))
+ expect(tokens).toEqual(['a2', 'a2', 'a2', 'a2', 'a2'])
+ const calls = (fetch as ReturnType).mock.calls.filter(([url]) => String(url).endsWith('/auth/refresh'))
+ expect(calls).toHaveLength(1)
+ expect(stored().refresh_token).toBe('r2')
+})
+
+test('a refresh sends the stored refresh token', async () => {
+ const { calls } = mockFetch({
+ 'POST /api/v1/auth/login': () => session({ expiresInSeconds: 30, refresh: 'r1' }),
+ 'POST /api/v1/auth/refresh': () => session({ access: 'a2', refresh: 'r2' }),
+ })
+ await login('tom', 'secret123')
+ await getAccessToken()
+ const refresh = calls.find((c) => c.key === 'POST /api/v1/auth/refresh')!
+ expect(JSON.parse(refresh.init.body as string)).toEqual({ refresh_token: 'r1' })
+})
+
+test('a second tab that already renewed the session is adopted, not renewed again', async () => {
+ const { calls } = mockFetch({ 'POST /api/v1/auth/login': () => session({ expiresInSeconds: 30 }) })
+ await login('tom', 'secret123')
+ // The lock is where tab B gets in first: by the time this tab holds it, B has written a fresh session.
+ Object.defineProperty(navigator, 'locks', {
+ configurable: true,
+ value: {
+ request: async (_name: string, fn: () => Promise) => {
+ storeSession(session({ access: 'from-tab-b', refresh: 'r-b' }))
+ return fn()
+ },
+ },
+ })
+ await expect(getAccessToken()).resolves.toBe('from-tab-b')
+ expect(calls.filter((c) => c.key === 'POST /api/v1/auth/refresh')).toHaveLength(0)
+ expect(sessionStore.getState().refreshToken).toBe('r-b')
+})
+
+test('a refresh token the server refuses signs out once and stops asking', async () => {
+ const { calls } = mockFetch({
+ 'POST /api/v1/auth/login': () => session({ expiresInSeconds: 30 }),
+ 'POST /api/v1/auth/refresh': () => apiError(401, 'invalid_refresh_token'),
+ })
+ await login('tom', 'secret123')
+ await expect(getAccessToken()).resolves.toBeNull()
+ expect(sessionStore.getState().status).toBe('anonymous')
+ expect(localStorage.getItem('sonda.session')).toBeNull()
+ const before = calls.length
+ await expect(getAccessToken()).resolves.toBeNull()
+ expect(calls).toHaveLength(before)
+})
+
+test('a network failure while renewing keeps the session', async () => {
+ mockFetch({
+ 'POST /api/v1/auth/login': () => session({ expiresInSeconds: 30 }),
+ 'POST /api/v1/auth/refresh': () => {
+ throw new TypeError('Failed to fetch')
+ },
+ })
+ await login('tom', 'secret123')
+ await expect(getAccessToken()).resolves.toBe('a1')
+ expect(sessionStore.getState().status).toBe('authenticated')
+ expect(stored()).not.toBeNull()
+})
+
+test('login works for the page lifetime when storage is blocked', async () => {
+ vi.spyOn(Storage.prototype, 'setItem').mockImplementation(() => {
+ throw new Error('blocked')
+ })
+ mockFetch({ 'POST /api/v1/auth/login': () => session() })
+ await login('tom', 'secret123')
+ expect(sessionStore.getState().status).toBe('authenticated')
+ await expect(getAccessToken()).resolves.toBe('a1')
+})
+
+test('mediaUrl adds the token to a path of the API', async () => {
+ mockFetch({ 'POST /api/v1/auth/login': () => session({ access: 'tok' }) })
+ await login('tom', 'secret123')
+ expect(mediaUrl('/tracks/3/stream')).toBe('/api/v1/tracks/3/stream?access_token=tok')
+})
+
+test('mediaUrl without a session gives the bare URL', () => {
+ expect(mediaUrl('/albums/2/cover')).toBe('/api/v1/albums/2/cover')
+})
+
+test('listeners hear about a new token until they unsubscribe', async () => {
+ mockFetch({
+ 'POST /api/v1/auth/login': () => session({ expiresInSeconds: 30 }),
+ 'POST /api/v1/auth/refresh': () => session({ access: 'a2', refresh: 'r2' }),
+ })
+ const heard: string[] = []
+ const off = onTokenChange((t) => heard.push(t))
+ await login('tom', 'secret123')
+ await getAccessToken()
+ off()
+ sessionStore.setState({ accessExpiresAt: Date.now() + 10_000 })
+ mockFetch({ 'POST /api/v1/auth/refresh': () => session({ access: 'a3', refresh: 'r3' }) })
+ await getAccessToken()
+ expect(heard).toEqual(['a1', 'a2'])
+})
+
+const refreshRequests = (calls: { key: string }[]) => calls.filter((c) => c.key === 'POST /api/v1/auth/refresh')
+
+test('a session about to run out is renewed in the background, before anyone asks for the token', async () => {
+ vi.useFakeTimers()
+ const { calls } = mockFetch({
+ 'POST /api/v1/auth/login': () => session({ expiresInSeconds: 900 }),
+ 'POST /api/v1/auth/refresh': () => session({ access: 'a2', refresh: 'r2' }),
+ })
+ await login('tom', 'secret123')
+ const heard: string[] = []
+ onTokenChange((t) => heard.push(t))
+
+ await vi.advanceTimersByTimeAsync(11 * 60_000)
+ expect(refreshRequests(calls)).toHaveLength(0)
+
+ await vi.advanceTimersByTimeAsync(2 * 60_000) // 13 minutes in: two left
+ expect(refreshRequests(calls)).toHaveLength(1)
+ expect(heard).toEqual(['a2'])
+ expect(sessionStore.getState().accessToken).toBe('a2')
+
+ await vi.advanceTimersByTimeAsync(5 * 60_000) // the new token has plenty of time left
+ expect(refreshRequests(calls)).toHaveLength(1)
+})
+
+test('signing out stops the renewal in the background', async () => {
+ vi.useFakeTimers()
+ const { calls } = mockFetch({
+ 'POST /api/v1/auth/login': () => session({ expiresInSeconds: 900 }),
+ 'POST /api/v1/auth/logout': () => new Response(null, { status: 204 }),
+ })
+ await login('tom', 'secret123')
+ await logout()
+ await vi.advanceTimersByTimeAsync(20 * 60_000)
+ expect(refreshRequests(calls)).toHaveLength(0)
+})
+
+test('a renewal the server refuses in the background signs out and is not tried again', async () => {
+ vi.useFakeTimers()
+ const { calls } = mockFetch({
+ 'POST /api/v1/auth/login': () => session({ expiresInSeconds: 900 }),
+ 'POST /api/v1/auth/refresh': () => apiError(401, 'invalid_refresh_token'),
+ })
+ await login('tom', 'secret123')
+ await vi.advanceTimersByTimeAsync(13 * 60_000)
+ expect(sessionStore.getState().status).toBe('anonymous')
+ await vi.advanceTimersByTimeAsync(10 * 60_000)
+ expect(refreshRequests(calls)).toHaveLength(1)
+})
+
+test('logout revokes the refresh token and forgets the session', async () => {
+ const { calls } = mockFetch({
+ 'POST /api/v1/auth/login': () => session(),
+ 'POST /api/v1/auth/logout': () => new Response(null, { status: 204 }),
+ })
+ await login('tom', 'secret123')
+ await logout()
+ const call = calls.find((c) => c.key === 'POST /api/v1/auth/logout')!
+ expect(JSON.parse(call.init.body as string)).toEqual({ refresh_token: 'r1' })
+ expect(sessionStore.getState().status).toBe('anonymous')
+ expect(localStorage.getItem('sonda.session')).toBeNull()
+})
+
+test('logout forgets the session even when the server cannot be reached', async () => {
+ mockFetch({
+ 'POST /api/v1/auth/login': () => session(),
+ 'POST /api/v1/auth/logout': () => {
+ throw new TypeError('Failed to fetch')
+ },
+ })
+ await login('tom', 'secret123')
+ await logout()
+ expect(sessionStore.getState().status).toBe('anonymous')
+})
+
+test('restoring with nothing stored leaves you signed out', async () => {
+ await restoreSession()
+ expect(sessionStore.getState().status).toBe('anonymous')
+})
+
+test('restoring a fresh stored session signs in without a request', async () => {
+ const { calls } = mockFetch({})
+ storeSession(session({ access: 'kept' }))
+ await restoreSession()
+ expect(sessionStore.getState().status).toBe('authenticated')
+ expect(sessionStore.getState().user).toEqual(user)
+ expect(calls).toHaveLength(0)
+ await expect(getAccessToken()).resolves.toBe('kept')
+})
+
+test('restoring a session whose access token ran out renews it', async () => {
+ mockFetch({ 'POST /api/v1/auth/refresh': () => session({ access: 'renewed', refresh: 'r2' }) })
+ storeSession(session({ expiresInSeconds: -60 }))
+ await restoreSession()
+ expect(sessionStore.getState().status).toBe('authenticated')
+ expect(sessionStore.getState().accessToken).toBe('renewed')
+})
+
+test('restoring a session the server no longer accepts signs out', async () => {
+ mockFetch({ 'POST /api/v1/auth/refresh': () => apiError(401, 'invalid_refresh_token') })
+ storeSession(session({ expiresInSeconds: -60 }))
+ await restoreSession()
+ expect(sessionStore.getState().status).toBe('anonymous')
+})
diff --git a/web/src/auth/session.ts b/web/src/auth/session.ts
new file mode 100644
index 0000000..c78ce66
--- /dev/null
+++ b/web/src/auth/session.ts
@@ -0,0 +1,231 @@
+import { create } from 'zustand'
+import { useShallow } from 'zustand/react/shallow'
+import { api, ApiError, setAuthHooks } from '@/api/client'
+import type { components } from '@/api/schema'
+
+type Session = components['schemas']['Session']
+type User = components['schemas']['User']
+
+type Status = 'loading' | 'anonymous' | 'authenticated'
+
+interface SessionState {
+ status: Status
+ user: User | null
+ accessToken: string | null
+ /** Milliseconds since the epoch. */
+ accessExpiresAt: number
+ refreshToken: string | null
+}
+
+const STORAGE_KEY = 'sonda.session'
+/** An access token with less than this left is renewed before it is used. */
+const SKEW_MS = 60_000
+
+export const sessionStore = create()(() => ({
+ status: 'loading',
+ user: null,
+ accessToken: null,
+ accessExpiresAt: 0,
+ refreshToken: null,
+}))
+
+export function useSession(): { status: Status; user: User | null } {
+ return sessionStore(useShallow((s) => ({ status: s.status, user: s.user })))
+}
+
+/** The current access token, for components whose media URLs must follow it when it is renewed. */
+export function useAccessToken(): string | null {
+ return sessionStore((s) => s.accessToken)
+}
+
+// --- storage -------------------------------------------------------------------------------------
+// The whole session lives in localStorage so that a second tab can adopt a session the first one
+// already renewed (a refresh token works once). When storage is blocked the memory copy is enough.
+
+type Stored = Pick
+
+function readStored(): Stored | null {
+ try {
+ const raw = localStorage.getItem(STORAGE_KEY)
+ if (!raw) return null
+ const s = JSON.parse(raw) as Partial
+ if (typeof s.access_token !== 'string' || typeof s.refresh_token !== 'string') return null
+ if (typeof s.access_expires_at !== 'string' || !s.user) return null
+ return s as Stored
+ } catch {
+ return null
+ }
+}
+
+function writeStored(s: SessionState) {
+ try {
+ if (!s.accessToken || !s.refreshToken || !s.user) {
+ localStorage.removeItem(STORAGE_KEY)
+ return
+ }
+ const stored: Stored = {
+ access_token: s.accessToken,
+ access_expires_at: new Date(s.accessExpiresAt).toISOString(),
+ refresh_token: s.refreshToken,
+ user: s.user,
+ }
+ localStorage.setItem(STORAGE_KEY, JSON.stringify(stored))
+ } catch {
+ // The session still works for this page view.
+ }
+}
+
+// --- token listeners -----------------------------------------------------------------------------
+
+const listeners = new Set<(token: string) => void>()
+
+/** Calls `cb` whenever the access token changes (sign-in, renewal). Returns the function that stops it. */
+export function onTokenChange(cb: (token: string) => void): () => void {
+ listeners.add(cb)
+ return () => listeners.delete(cb)
+}
+
+// --- renewal in the background -------------------------------------------------------------------
+// The player builds the stream URL of the next track from the current token, so the token has to be
+// fresh even when nobody is calling the API. Check every 30 seconds and renew when under 3 minutes are
+// left (a hidden tab may check only once a minute, so there is room).
+
+const KEEP_FRESH_EVERY_MS = 30_000
+const RENEW_AHEAD_MS = 3 * 60_000
+
+let keepFreshTimer: ReturnType | null = null
+
+function stopKeepFresh() {
+ if (keepFreshTimer !== null) clearInterval(keepFreshTimer)
+ keepFreshTimer = null
+}
+
+function startKeepFresh() {
+ stopKeepFresh()
+ keepFreshTimer = setInterval(() => {
+ const s = sessionStore.getState()
+ if (s.status === 'authenticated' && s.accessExpiresAt - Date.now() <= RENEW_AHEAD_MS) void refresh()
+ }, KEEP_FRESH_EVERY_MS)
+}
+
+// --- state changes -------------------------------------------------------------------------------
+
+function open(s: Stored, persist: boolean) {
+ const previous = sessionStore.getState().accessToken
+ sessionStore.setState({
+ status: 'authenticated',
+ user: s.user,
+ accessToken: s.access_token,
+ accessExpiresAt: Date.parse(s.access_expires_at),
+ refreshToken: s.refresh_token,
+ })
+ if (persist) writeStored(sessionStore.getState())
+ startKeepFresh()
+ if (previous !== s.access_token) listeners.forEach((fn) => fn(s.access_token))
+}
+
+export function signOut(): void {
+ stopKeepFresh()
+ sessionStore.setState({ status: 'anonymous', user: null, accessToken: null, accessExpiresAt: 0, refreshToken: null })
+ try {
+ localStorage.removeItem(STORAGE_KEY)
+ } catch {
+ // nothing stored that we could remove
+ }
+}
+
+// --- public operations ---------------------------------------------------------------------------
+
+export async function login(username: string, password: string): Promise {
+ const session = await api.post('/auth/login', { username, password }, { auth: false })
+ open(session, true)
+}
+
+export async function register(username: string, password: string): Promise {
+ await api.post('/auth/register', { username, password }, { auth: false })
+ await login(username, password)
+}
+
+export async function logout(): Promise {
+ const { refreshToken } = sessionStore.getState()
+ try {
+ if (refreshToken) await api.post('/auth/logout', { refresh_token: refreshToken }, { auth: false })
+ } catch {
+ // The server could not be reached: the session is forgotten here all the same.
+ }
+ signOut()
+}
+
+/** Opens the session kept in storage, renewing it first if its access token has run out. */
+export async function restoreSession(): Promise {
+ const stored = readStored()
+ if (!stored) {
+ sessionStore.setState({ status: 'anonymous' })
+ return
+ }
+ open(stored, false)
+ if (Date.parse(stored.access_expires_at) - Date.now() <= SKEW_MS) await refresh()
+}
+
+export async function getAccessToken(): Promise {
+ const s = sessionStore.getState()
+ if (!s.accessToken && !s.refreshToken) return null
+ if (s.accessToken && s.accessExpiresAt - Date.now() > SKEW_MS) return s.accessToken
+ return refresh()
+}
+
+/** A path of the API that an or can load: the token goes in the query. */
+export function mediaUrl(path: string): string {
+ const base = `/api/v1${path}`
+ const token = sessionStore.getState().accessToken
+ if (!token) return base
+ return `${base}${base.includes('?') ? '&' : '?'}access_token=${encodeURIComponent(token)}`
+}
+
+// --- renewal -------------------------------------------------------------------------------------
+
+let inflight: Promise | null = null
+
+/** Renews the session. Callers in this tab share one request; tabs share one request through a lock. */
+function refresh(): Promise {
+ inflight ??= withLock(renew).finally(() => {
+ inflight = null
+ })
+ return inflight
+}
+
+function withLock(fn: () => Promise): Promise {
+ const locks = navigator.locks as LockManager | undefined
+ return locks ? locks.request('sonda-refresh', fn) : fn()
+}
+
+async function renew(): Promise {
+ // Another tab may have renewed while this one waited for the lock: if storage holds a session other
+ // than the one in memory, and it is fresh, use it instead of renewing again.
+ const stored = readStored()
+ const mine = sessionStore.getState().accessToken
+ if (stored && stored.access_token !== mine && Date.parse(stored.access_expires_at) - Date.now() > SKEW_MS) {
+ open(stored, false)
+ return stored.access_token
+ }
+
+ const refreshToken = stored?.refresh_token ?? sessionStore.getState().refreshToken
+ if (!refreshToken) {
+ signOut()
+ return null
+ }
+ try {
+ const session = await api.post('/auth/refresh', { refresh_token: refreshToken }, { auth: false })
+ open(session, true)
+ return session.access_token
+ } catch (e) {
+ // The server refused the token (4xx): the session is over. Unreachable or failing (0, 5xx): keep it.
+ if (e instanceof ApiError && e.status >= 400 && e.status < 500) {
+ signOut()
+ return null
+ }
+ return sessionStore.getState().accessToken
+ }
+}
+
+setAuthHooks({ getAccessToken, refresh, signOut })
diff --git a/web/src/components/ArtistPhoto.tsx b/web/src/components/ArtistPhoto.tsx
new file mode 100644
index 0000000..3aa2639
--- /dev/null
+++ b/web/src/components/ArtistPhoto.tsx
@@ -0,0 +1,35 @@
+import { useState } from 'react'
+import { mediaUrl, useAccessToken } from '@/auth/session'
+
+/** The first character of the name, for an artist with no picture. */
+function initial(name: string): string {
+ return Array.from(name.trim())[0]?.toUpperCase() ?? '?'
+}
+
+/** A round photo of an artist, or the first letter of the name when there is no free picture. */
+export default function ArtistPhoto({ artistId, name, size }: { artistId: number; name: string; size: number }) {
+ useAccessToken() // the URL carries the token, so it has to follow a renewal
+ const src = mediaUrl(`/artists/${artistId}/image`)
+ const [failed, setFailed] = useState(null)
+
+ return (
+
+ {failed !== src ? (
+
setFailed(src)}
+ />
+ ) : (
+
+ {initial(name)}
+
+ )}
+
+ )
+}
diff --git a/web/src/components/Attribution.test.tsx b/web/src/components/Attribution.test.tsx
new file mode 100644
index 0000000..571f1f2
--- /dev/null
+++ b/web/src/components/Attribution.test.tsx
@@ -0,0 +1,20 @@
+import { render, screen } from '@testing-library/react'
+import { expect, test } from 'vitest'
+import { ExternalLink } from './Attribution'
+
+test('an address on the web is a link that opens in a new tab and does not hand over the page', () => {
+ render(Radiohead )
+ const link = screen.getByRole('link', { name: 'Radiohead' })
+ expect(link).toHaveAttribute('href', 'https://en.wikipedia.org/wiki/Radiohead')
+ expect(link).toHaveAttribute('target', '_blank')
+ expect(link).toHaveAttribute('rel', 'noopener noreferrer')
+})
+
+test.each(['javascript:alert(1)', 'data:text/html,x ', '/relative/path', 'not an address', ''])(
+ 'the address %j is shown as plain text, never as a link',
+ (href) => {
+ render(Credit )
+ expect(screen.queryByRole('link')).not.toBeInTheDocument()
+ expect(screen.getByText('Credit')).toBeInTheDocument()
+ },
+)
diff --git a/web/src/components/Attribution.tsx b/web/src/components/Attribution.tsx
new file mode 100644
index 0000000..45ec58c
--- /dev/null
+++ b/web/src/components/Attribution.tsx
@@ -0,0 +1,26 @@
+import type { ReactNode } from 'react'
+
+/** Only an absolute address on the web is worth a link: provider text never gets to run a script (`javascript:`). */
+function isWebAddress(href: string): boolean {
+ try {
+ const { protocol } = new URL(href)
+ return protocol === 'https:' || protocol === 'http:'
+ } catch {
+ return false
+ }
+}
+
+/** A link to another site, opened in a new tab. An address that is not a web address is shown as plain text. */
+export function ExternalLink({ href, children }: { href: string; children: ReactNode }) {
+ if (!isWebAddress(href)) return <>{children}>
+ return (
+
+ {children}
+
+ )
+}
+
+/** The credit that has to be shown wherever provider data is shown (a text, a picture, tags). */
+export default function Attribution({ children }: { children: ReactNode }) {
+ return {children}
+}
diff --git a/web/src/components/ChoiceGroup.tsx b/web/src/components/ChoiceGroup.tsx
new file mode 100644
index 0000000..14b836c
--- /dev/null
+++ b/web/src/components/ChoiceGroup.tsx
@@ -0,0 +1,47 @@
+import { useId, type ReactNode } from 'react'
+
+interface Choice {
+ value: T
+ label: string
+ /** A small picture of the choice (the colours of a theme). It is decoration. */
+ preview?: ReactNode
+}
+
+interface ChoiceGroupProps {
+ label: string
+ choices: readonly Choice[]
+ value: T
+ onChange(value: T): void
+}
+
+/** One choice out of a few, as native radio buttons: the arrow keys and screen readers work as they should. */
+export default function ChoiceGroup({ label, choices, value, onChange }: ChoiceGroupProps) {
+ const name = useId()
+ const labelId = `${name}-label`
+ return (
+
+
+ {label}
+
+
+ {choices.map((choice) => (
+
+ onChange(choice.value)}
+ className="sr-only"
+ />
+ {choice.preview}
+ {choice.label}
+
+ ))}
+
+
+ )
+}
diff --git a/web/src/components/Cover.test.tsx b/web/src/components/Cover.test.tsx
new file mode 100644
index 0000000..d1dc31a
--- /dev/null
+++ b/web/src/components/Cover.test.tsx
@@ -0,0 +1,83 @@
+import { act, fireEvent, render, screen } from '@testing-library/react'
+import { beforeEach, expect, test } from 'vitest'
+import { sessionStore } from '@/auth/session'
+import { mockFetch } from '@/test/mockFetch'
+import ArtistPhoto from './ArtistPhoto'
+import Cover from './Cover'
+
+beforeEach(() => {
+ sessionStore.setState({ status: 'anonymous', user: null, accessToken: null, accessExpiresAt: 0, refreshToken: null })
+})
+
+function placeholder(container: HTMLElement) {
+ return container.querySelector('[data-placeholder]')
+}
+
+test('a cover asks for the album cover of the API', () => {
+ const { container } = render( )
+ const img = container.querySelector('img')!
+ expect(img.getAttribute('src')).toBe('/api/v1/albums/12/cover')
+ expect(img).toHaveAttribute('loading', 'lazy')
+ expect(img).toHaveAttribute('alt', '')
+ expect(placeholder(container)).toBeNull()
+})
+
+test('the cover URL carries the access token and follows it when it changes', () => {
+ sessionStore.setState({ accessToken: 'tok1' })
+ const { container } = render( )
+ expect(container.querySelector('img')!.getAttribute('src')).toBe('/api/v1/albums/12/cover?access_token=tok1')
+ act(() => sessionStore.setState({ accessToken: 'tok2' }))
+ expect(container.querySelector('img')!.getAttribute('src')).toBe('/api/v1/albums/12/cover?access_token=tok2')
+})
+
+test('a cover that fails to load is replaced by the placeholder', () => {
+ const { container } = render( )
+ fireEvent.error(container.querySelector('img')!)
+ expect(container.querySelector('img')).toBeNull()
+ expect(placeholder(container)).not.toBeNull()
+})
+
+test('a failed cover is tried again once the token has changed', () => {
+ sessionStore.setState({ accessToken: 'old' })
+ const { container } = render( )
+ fireEvent.error(container.querySelector('img')!)
+ expect(placeholder(container)).not.toBeNull()
+ act(() => sessionStore.setState({ accessToken: 'new' }))
+ expect(container.querySelector('img')).not.toBeNull()
+})
+
+test('a track with no album shows the placeholder and asks for nothing', () => {
+ const { calls } = mockFetch({})
+ const { container } = render( )
+ expect(container.querySelector('img')).toBeNull()
+ expect(placeholder(container)).not.toBeNull()
+ expect(calls).toHaveLength(0)
+})
+
+test('the cover has the size it was given', () => {
+ const { container } = render( )
+ const box = container.firstElementChild as HTMLElement
+ expect(box.style.width).toBe('96px')
+ expect(box.style.height).toBe('96px')
+})
+
+test('an artist photo shows the name as its text alternative', () => {
+ render( )
+ const img = screen.getByAltText('Björk')
+ expect(img.getAttribute('src')).toBe('/api/v1/artists/5/image')
+})
+
+test('an artist photo that fails to load shows the first letter of the name', () => {
+ const { container } = render( )
+ fireEvent.error(container.querySelector('img')!)
+ expect(container.querySelector('img')).toBeNull()
+ expect(screen.getByText('B')).toBeInTheDocument()
+})
+
+test('a very long or empty artist name does not break the photo', () => {
+ const long = 'x'.repeat(200)
+ expect(() => render( )).not.toThrow()
+ const { container } = render( )
+ fireEvent.error(container.querySelector('img')!)
+ expect(screen.getByText('?')).toBeInTheDocument()
+})
diff --git a/web/src/components/Cover.tsx b/web/src/components/Cover.tsx
new file mode 100644
index 0000000..9690c9b
--- /dev/null
+++ b/web/src/components/Cover.tsx
@@ -0,0 +1,41 @@
+import { useState } from 'react'
+import { mediaUrl, useAccessToken } from '@/auth/session'
+
+interface CoverProps {
+ albumId: number | null
+ /** Pixels. With `fluid` it is the largest size: the cover shrinks to fit a narrow screen. */
+ size: number
+ fluid?: boolean
+}
+
+/** The cover of an album, or concentric rings when there is none (or it cannot be loaded). */
+export default function Cover({ albumId, size, fluid = false }: CoverProps) {
+ useAccessToken() // the URL carries the token, so it has to follow a renewal
+ const src = albumId === null ? null : mediaUrl(`/albums/${albumId}/cover`)
+ // A failure is remembered for this URL only: a renewed token makes a new URL, which is tried again.
+ const [failed, setFailed] = useState(null)
+ const showImage = src !== null && failed !== src
+
+ return (
+
+ {showImage ? (
+
setFailed(src)}
+ />
+ ) : (
+
+
+
+
+
+ )}
+
+ )
+}
diff --git a/web/src/components/LoadMore.tsx b/web/src/components/LoadMore.tsx
new file mode 100644
index 0000000..94992e6
--- /dev/null
+++ b/web/src/components/LoadMore.tsx
@@ -0,0 +1,19 @@
+import { useTranslation } from 'react-i18next'
+import { Button } from '@/components/ui/button'
+
+interface PagedQuery {
+ hasNextPage: boolean
+ isFetchingNextPage: boolean
+ fetchNextPage(): unknown
+}
+
+/** The button under a paged list: shown until the whole list has been loaded. */
+export default function LoadMore({ query }: { query: PagedQuery }) {
+ const { t } = useTranslation()
+ if (!query.hasNextPage) return null
+ return (
+ query.fetchNextPage()}>
+ {t('common.showMore')}
+
+ )
+}
diff --git a/web/src/components/ProviderMessage.tsx b/web/src/components/ProviderMessage.tsx
new file mode 100644
index 0000000..4d4e865
--- /dev/null
+++ b/web/src/components/ProviderMessage.tsx
@@ -0,0 +1,13 @@
+import { useTranslation } from 'react-i18next'
+import { EmptyMessage } from './Status'
+
+export type ProviderStatus = 'ok' | 'disabled' | 'error' | 'no_id'
+
+/** Why a provider section is empty. `ok` is not a reason: the caller says "nothing found" itself. */
+export default function ProviderMessage({ status, provider }: { status: Exclude; provider: string }) {
+ const { t } = useTranslation()
+ const name = t(`provider.${provider}`)
+ if (status === 'disabled') return {t('empty.providerDisabled', { provider: name })}
+ if (status === 'no_id') return {t('empty.noId')}
+ return {t('empty.providerError', { provider: name })}
+}
diff --git a/web/src/components/Scrubber.tsx b/web/src/components/Scrubber.tsx
new file mode 100644
index 0000000..097a719
--- /dev/null
+++ b/web/src/components/Scrubber.tsx
@@ -0,0 +1,55 @@
+import { useTranslation } from 'react-i18next'
+import { formatTime } from '@/lib/time'
+import { cn } from '@/lib/utils'
+
+const BARS = 64
+
+interface ScrubberProps {
+ positionMs: number
+ durationMs: number
+ onSeek(ms: number): void
+ /** `line` is a thin bar; `bars` is a row of equal segments (a progress control, not a waveform). */
+ variant: 'line' | 'bars'
+}
+
+/** The seek control of the player: always a native range input, so the keyboard and screen readers work. */
+export default function Scrubber({ positionMs, durationMs, onSeek, variant }: ScrubberProps) {
+ const { t } = useTranslation()
+ const disabled = !(durationMs > 0)
+ const max = disabled ? 1 : durationMs
+ const value = Math.min(Math.max(positionMs, 0), max)
+ const filled = (value / max) * BARS
+
+ const input = (
+ onSeek(Number(e.target.value))}
+ className={cn(
+ 'cursor-pointer disabled:cursor-default',
+ variant === 'line' ? 'h-1 w-full accent-primary' : 'absolute inset-0 h-full w-full opacity-0',
+ )}
+ />
+ )
+
+ if (variant === 'line') return input
+
+ return (
+
+ {Array.from({ length: BARS }, (_, i) => (
+
+ ))}
+ {input}
+
+ )
+}
diff --git a/web/src/components/Section.tsx b/web/src/components/Section.tsx
new file mode 100644
index 0000000..225f527
--- /dev/null
+++ b/web/src/components/Section.tsx
@@ -0,0 +1,11 @@
+import type { ReactNode } from 'react'
+
+/** A titled part of a page. Its label makes it a landmark ("About", "Tags", "Artists"...). */
+export default function Section({ title, children }: { title: string; children: ReactNode }) {
+ return (
+
+ )
+}
diff --git a/web/src/components/Status.tsx b/web/src/components/Status.tsx
new file mode 100644
index 0000000..2c75849
--- /dev/null
+++ b/web/src/components/Status.tsx
@@ -0,0 +1,35 @@
+import type { ReactNode } from 'react'
+import { useTranslation } from 'react-i18next'
+import { ApiError } from '@/api/client'
+import { Button } from '@/components/ui/button'
+import { errorMessageKey } from '@/i18n'
+
+export function Loading() {
+ const { t } = useTranslation()
+ return (
+
+ {t('common.loading')}
+
+ )
+}
+
+/** What went wrong, in words, with a way to try again. */
+export function ErrorMessage({ error, onRetry }: { error: unknown; onRetry?: () => void }) {
+ const { t } = useTranslation()
+ const code = error instanceof ApiError ? error.code : 'unknown'
+ return (
+
+
{t(errorMessageKey(code))}
+ {onRetry && (
+
+ {t('common.retry')}
+
+ )}
+
+ )
+}
+
+/** An empty page or section: says what is missing instead of leaving a gap. */
+export function EmptyMessage({ children }: { children: ReactNode }) {
+ return {children}
+}
diff --git a/web/src/components/TrackList.tsx b/web/src/components/TrackList.tsx
new file mode 100644
index 0000000..cf6e204
--- /dev/null
+++ b/web/src/components/TrackList.tsx
@@ -0,0 +1,22 @@
+import type { Track } from '@/api/catalog'
+import { currentTrack, usePlayer } from '@/player/store'
+import TrackRow from './TrackRow'
+
+/** The songs of a list. Clicking one plays the whole list from that song. */
+export default function TrackList({ tracks }: { tracks: Track[] }) {
+ const playTracks = usePlayer((s) => s.playTracks)
+ const playingId = usePlayer((s) => currentTrack(s)?.id)
+ return (
+
+ {tracks.map((track, i) => (
+ playTracks(tracks, i)}
+ />
+ ))}
+
+ )
+}
diff --git a/web/src/components/TrackRow.tsx b/web/src/components/TrackRow.tsx
new file mode 100644
index 0000000..90da7ff
--- /dev/null
+++ b/web/src/components/TrackRow.tsx
@@ -0,0 +1,37 @@
+import type { Track } from '@/api/catalog'
+import { formatTime } from '@/lib/time'
+import { cn } from '@/lib/utils'
+
+interface TrackRowProps {
+ track: Track
+ /** Position in the list, shown when the track has no number of its own. */
+ index: number
+ onPlay(): void
+ /** The track that is playing now. */
+ active?: boolean
+}
+
+/** One song in a list: number, title, artists and length. Clicking it plays it. */
+export default function TrackRow({ track, index, onPlay, active = false }: TrackRowProps) {
+ const artists = track.artists.map((a) => a.name).join(', ') || '—'
+ return (
+
+
+ {track.track_no > 0 ? track.track_no : index + 1}
+
+
+ {track.title}
+ {artists}
+
+ {formatTime(track.duration_ms)}
+
+ )
+}
diff --git a/web/src/components/cards.tsx b/web/src/components/cards.tsx
new file mode 100644
index 0000000..1f197e7
--- /dev/null
+++ b/web/src/components/cards.tsx
@@ -0,0 +1,35 @@
+import { useTranslation } from 'react-i18next'
+import { Link } from 'react-router-dom'
+import type { Album, Artist } from '@/api/catalog'
+import ArtistPhoto from './ArtistPhoto'
+import Cover from './Cover'
+
+/** The grid the cards sit in. */
+export const CARD_GRID = 'grid grid-cols-[repeat(auto-fill,minmax(160px,1fr))] gap-4'
+
+export function ArtistCard({ artist }: { artist: Artist }) {
+ const { t } = useTranslation()
+ return (
+
+
+
+ {artist.name}
+
+ {t('artist.albumCount', { count: artist.album_count })}
+
+
+
+ )
+}
+
+export function AlbumCard({ album }: { album: Album }) {
+ return (
+
+
+
+ {album.title}
+ {album.artist?.name ?? '—'}
+
+
+ )
+}
diff --git a/web/src/components/layout/NowPlaying.tsx b/web/src/components/layout/NowPlaying.tsx
new file mode 100644
index 0000000..f925765
--- /dev/null
+++ b/web/src/components/layout/NowPlaying.tsx
@@ -0,0 +1,117 @@
+import { X } from 'lucide-react'
+import { useEffect } from 'react'
+import { useTranslation } from 'react-i18next'
+import { Link } from 'react-router-dom'
+import Cover from '@/components/Cover'
+import Scrubber from '@/components/Scrubber'
+import TrackRow from '@/components/TrackRow'
+import { Button } from '@/components/ui/button'
+import { Dialog, DialogContent, DialogDescription, DialogTitle } from '@/components/ui/dialog'
+import { formatTime } from '@/lib/time'
+import { currentTrack, usePlayer } from '@/player/store'
+import { useNowPlayingUi } from '@/player/ui'
+import PlayerControls from './PlayerControls'
+
+const UP_NEXT = 3
+
+/** The full-screen player: a big cover, the controls and what comes next. */
+export default function NowPlaying() {
+ const { t } = useTranslation()
+ const { open, setOpen } = useNowPlayingUi()
+ const player = usePlayer()
+ const track = currentTrack(player)
+
+ // Nothing left to show (the queue was emptied): close.
+ useEffect(() => {
+ if (open && !track) setOpen(false)
+ }, [open, track, setOpen])
+
+ const upNext = player.queue.slice(player.index + 1, player.index + 1 + UP_NEXT)
+
+ return (
+
+
+ {track && (
+ <>
+ setOpen(false)}
+ >
+
+
+ {t('player.nowPlaying')}
+
+
+
+
+
+
+
+
+
+ {track.title}
+
+
+ {track.artists.length === 0
+ ? '—'
+ : track.artists.map((a, i) => (
+
+ {i > 0 && ', '}
+ setOpen(false)} className="hover:underline">
+ {a.name}
+
+
+ ))}
+
+ {track.album && (
+
setOpen(false)}
+ className="text-muted-foreground hover:underline"
+ >
+ {track.album.title}
+
+ )}
+
+
+
+
+
+ {formatTime(player.positionMs)}
+ {formatTime(track.duration_ms)}
+
+
+
+
+
+ {upNext.length > 0 && (
+
+ {t('player.upNext')}
+ {upNext.map((next, k) => (
+ player.jumpTo(player.index + 1 + k)}
+ />
+ ))}
+
+ )}
+
+
+ >
+ )}
+
+
+ )
+}
diff --git a/web/src/components/layout/Player.test.tsx b/web/src/components/layout/Player.test.tsx
new file mode 100644
index 0000000..ff4fb48
--- /dev/null
+++ b/web/src/components/layout/Player.test.tsx
@@ -0,0 +1,270 @@
+import { act, fireEvent, render, screen, within } from '@testing-library/react'
+import userEvent from '@testing-library/user-event'
+import { MemoryRouter } from 'react-router-dom'
+import { beforeEach, expect, test, vi } from 'vitest'
+import type { Track } from '@/api/catalog'
+import { sessionStore } from '@/auth/session'
+import Scrubber from '@/components/Scrubber'
+import TrackRow from '@/components/TrackRow'
+import { initI18n } from '@/i18n'
+import { usePlayer } from '@/player/store'
+import { useNowPlayingUi } from '@/player/ui'
+import PlayerBar from './PlayerBar'
+
+function track(n: number, over: Partial = {}): Track {
+ return {
+ id: n,
+ title: `Song ${n}`,
+ duration_ms: 200_000,
+ track_no: n,
+ disc_no: 1,
+ album: { id: 10, title: 'Album' },
+ artists: [{ id: 5, name: 'Radiohead' }],
+ format: 'flac',
+ ...over,
+ }
+}
+
+const [a, b, c, d, e] = [1, 2, 3, 4, 5].map((n) => track(n))
+
+beforeEach(async () => {
+ vi.spyOn(navigator, 'language', 'get').mockReturnValue('en-US')
+ await initI18n()
+ sessionStore.setState({ status: 'authenticated', user: { id: 1, username: 'tom', is_admin: false } })
+ usePlayer.setState({
+ queue: [],
+ original: [],
+ index: 0,
+ playing: false,
+ positionMs: 0,
+ shuffle: false,
+ repeat: 'off',
+ seekMs: null,
+ seekId: 0,
+ playId: 0,
+ })
+ useNowPlayingUi.setState({ open: false })
+})
+
+function renderBar(extra?: React.ReactNode) {
+ return render(
+
+
+ {extra}
+ ,
+ )
+}
+
+// --- Scrubber ----------------------------------------------------------------------------------
+
+test.each(['line', 'bars'] as const)('the %s scrubber seeks to the position that was chosen', (variant) => {
+ const onSeek = vi.fn()
+ render( )
+ fireEvent.change(screen.getByRole('slider', { name: 'Seek' }), { target: { value: '100000' } })
+ expect(onSeek).toHaveBeenCalledWith(100_000)
+})
+
+test('the scrubber says where it is in words', () => {
+ render( {}} variant="line" />)
+ expect(screen.getByRole('slider', { name: 'Seek' })).toHaveAttribute('aria-valuetext', '2:27 of 6:27')
+})
+
+test('a scrubber with no known length cannot be moved', () => {
+ render( {}} variant="line" />)
+ expect(screen.getByRole('slider', { name: 'Seek' })).toBeDisabled()
+})
+
+// --- TrackRow ----------------------------------------------------------------------------------
+
+test('a row shows the track number, title, artists and length, and plays when clicked', async () => {
+ const onPlay = vi.fn()
+ render(
+
+
+ ,
+ )
+ const row = screen.getByRole('button', { name: /Song 3/ })
+ expect(row).toHaveTextContent('7')
+ expect(row).toHaveTextContent('Radiohead')
+ expect(row).toHaveTextContent('2:27')
+ await userEvent.click(row)
+ expect(onPlay).toHaveBeenCalledTimes(1)
+})
+
+test('a row of a track with no number shows its position in the list', () => {
+ render(
+
+ {}} />
+ ,
+ )
+ expect(screen.getByRole('button', { name: /Song 3/ })).toHaveTextContent('5')
+})
+
+test('a row of a track with no album and no artists still renders', () => {
+ render(
+
+ {}} />
+ ,
+ )
+ expect(screen.getByRole('button', { name: /Song 3/ })).toHaveTextContent('—')
+})
+
+test('the row of the track that is playing is marked', () => {
+ render(
+
+ {}} active />
+ ,
+ )
+ expect(screen.getByRole('button', { name: /Song 1/ })).toHaveAttribute('aria-current', 'true')
+})
+
+// --- PlayerBar ---------------------------------------------------------------------------------
+
+test('with nothing in the queue the bar says so and its controls are disabled', () => {
+ renderBar()
+ expect(screen.getByText('Nothing playing')).toBeInTheDocument()
+ for (const name of ['Previous', 'Play', 'Next', 'Shuffle', 'Repeat: off']) {
+ expect(screen.getByRole('button', { name })).toBeDisabled()
+ }
+ expect(screen.getByRole('slider', { name: 'Seek' })).toBeDisabled()
+})
+
+test('the play button says Pause while playing and Play while paused', async () => {
+ act(() => usePlayer.getState().playTracks([a, b]))
+ renderBar()
+ await userEvent.click(screen.getByRole('button', { name: 'Pause' }))
+ expect(usePlayer.getState().playing).toBe(false)
+ expect(screen.getByRole('button', { name: 'Play' })).toBeInTheDocument()
+})
+
+test('the bar shows the track, links to its artists, and the time', () => {
+ act(() => {
+ usePlayer.getState().playTracks([a])
+ usePlayer.getState().tick(147_000)
+ })
+ renderBar()
+ expect(screen.getByText('Song 1')).toBeInTheDocument()
+ expect(screen.getByRole('link', { name: 'Radiohead' })).toHaveAttribute('href', '/artists/5')
+ expect(screen.getByText('2:27')).toBeInTheDocument()
+ expect(screen.getByText('3:20')).toBeInTheDocument()
+})
+
+test('next and previous move through the queue', async () => {
+ act(() => usePlayer.getState().playTracks([a, b, c]))
+ renderBar()
+ await userEvent.click(screen.getByRole('button', { name: 'Next' }))
+ expect(usePlayer.getState().index).toBe(1)
+ await userEvent.click(screen.getByRole('button', { name: 'Previous' }))
+ expect(usePlayer.getState().index).toBe(0)
+})
+
+test('dragging the scrubber to the middle seeks to half of the track', () => {
+ act(() => usePlayer.getState().playTracks([a]))
+ renderBar()
+ fireEvent.change(screen.getByRole('slider', { name: 'Seek' }), { target: { value: '100000' } })
+ expect(usePlayer.getState().positionMs).toBe(100_000)
+ expect(usePlayer.getState().seekMs).toBe(100_000)
+})
+
+test('shuffle is a toggle and repeat goes through off, all and one', async () => {
+ act(() => usePlayer.getState().playTracks([a, b]))
+ renderBar()
+ const shuffle = screen.getByRole('button', { name: 'Shuffle' })
+ expect(shuffle).toHaveAttribute('aria-pressed', 'false')
+ await userEvent.click(shuffle)
+ expect(shuffle).toHaveAttribute('aria-pressed', 'true')
+
+ await userEvent.click(screen.getByRole('button', { name: 'Repeat: off' }))
+ await userEvent.click(screen.getByRole('button', { name: 'Repeat: all' }))
+ expect(screen.getByRole('button', { name: 'Repeat: one' })).toBeInTheDocument()
+})
+
+test('a track with no album and no artists plays without breaking the bar', () => {
+ act(() => usePlayer.getState().playTracks([track(9, { album: null, artists: [] })]))
+ expect(() => renderBar()).not.toThrow()
+ expect(screen.getByText('Song 9')).toBeInTheDocument()
+})
+
+test('Space plays and pauses, except while typing in a field', async () => {
+ act(() => usePlayer.getState().playTracks([a]))
+ renderBar( )
+
+ await userEvent.click(screen.getByLabelText('Search box'))
+ await userEvent.keyboard(' ')
+ expect(usePlayer.getState().playing).toBe(true)
+
+ await userEvent.click(document.body)
+ await userEvent.keyboard(' ')
+ expect(usePlayer.getState().playing).toBe(false)
+ await userEvent.keyboard(' ')
+ expect(usePlayer.getState().playing).toBe(true)
+})
+
+// --- Full-screen player ------------------------------------------------------------------------
+
+async function openNowPlaying() {
+ const opener = screen.getByRole('button', { name: 'Open the full-screen player' })
+ await userEvent.click(opener)
+ return { opener, dialog: await screen.findByRole('dialog') }
+}
+
+test('the full-screen player opens on the current track and Escape closes it and gives focus back', async () => {
+ act(() => usePlayer.getState().playTracks([a, b]))
+ renderBar()
+ const { opener, dialog } = await openNowPlaying()
+ expect(within(dialog).getByRole('heading', { name: 'Song 1' })).toBeInTheDocument()
+ expect(within(dialog).getByRole('link', { name: 'Radiohead' })).toBeInTheDocument()
+ expect(within(dialog).getByRole('link', { name: 'Album' })).toHaveAttribute('href', '/albums/10')
+
+ await userEvent.keyboard('{Escape}')
+ expect(screen.queryByRole('dialog')).not.toBeInTheDocument()
+ expect(opener).toHaveFocus()
+})
+
+test('the full-screen player has a close button', async () => {
+ act(() => usePlayer.getState().playTracks([a]))
+ renderBar()
+ const { dialog } = await openNowPlaying()
+ await userEvent.click(within(dialog).getByRole('button', { name: 'Close' }))
+ expect(screen.queryByRole('dialog')).not.toBeInTheDocument()
+})
+
+test('the full-screen player controls the same player', async () => {
+ act(() => usePlayer.getState().playTracks([a, b]))
+ renderBar()
+ const { dialog } = await openNowPlaying()
+ await userEvent.click(within(dialog).getByRole('button', { name: 'Next' }))
+ expect(usePlayer.getState().index).toBe(1)
+ expect(within(dialog).getByRole('heading', { name: 'Song 2' })).toBeInTheDocument()
+})
+
+test('Up next shows the next three tracks and a click plays one of them', async () => {
+ act(() => usePlayer.getState().playTracks([a, b, c, d, e]))
+ renderBar()
+ const { dialog } = await openNowPlaying()
+ const upNext = within(dialog).getByRole('region', { name: 'Up next' })
+ expect(within(upNext).getAllByRole('button')).toHaveLength(3)
+ expect(within(upNext).queryByText('Song 5')).not.toBeInTheDocument()
+ await userEvent.click(within(upNext).getByRole('button', { name: /Song 3/ }))
+ expect(usePlayer.getState().index).toBe(2)
+})
+
+test('a track with no album and no artists opens in the full-screen player', async () => {
+ act(() => usePlayer.getState().playTracks([track(9, { album: null, artists: [] })]))
+ renderBar()
+ const { dialog } = await openNowPlaying()
+ expect(within(dialog).getByRole('heading', { name: 'Song 9' })).toBeInTheDocument()
+})
+
+test('Tab stays inside the full-screen player', async () => {
+ act(() => usePlayer.getState().playTracks([a, b]))
+ renderBar()
+ const { dialog } = await openNowPlaying()
+ const outside = [screen.queryByRole('navigation'), document.body.querySelector('footer')]
+ for (let i = 0; i < 25; i++) {
+ await userEvent.tab()
+ // The dialog hands focus on through invisible guard elements; once it has done so, focus is inside it.
+ await vi.waitFor(() => expect(dialog).toContainElement(document.activeElement as HTMLElement))
+ for (const el of outside) if (el) expect(el.contains(document.activeElement)).toBe(false)
+ }
+})
diff --git a/web/src/components/layout/PlayerBar.tsx b/web/src/components/layout/PlayerBar.tsx
new file mode 100644
index 0000000..e28c493
--- /dev/null
+++ b/web/src/components/layout/PlayerBar.tsx
@@ -0,0 +1,102 @@
+import { ListMusic } from 'lucide-react'
+import { useEffect } from 'react'
+import { useTranslation } from 'react-i18next'
+import { Link } from 'react-router-dom'
+import Cover from '@/components/Cover'
+import Scrubber from '@/components/Scrubber'
+import { Button } from '@/components/ui/button'
+import { formatTime } from '@/lib/time'
+import { currentTrack, usePlayer } from '@/player/store'
+import { useNowPlayingUi } from '@/player/ui'
+import NowPlaying from './NowPlaying'
+import PlayerControls from './PlayerControls'
+
+/** Space plays and pauses, unless the keypress belongs to a field, a button or a link. */
+function usePlayPauseKey() {
+ useEffect(() => {
+ const onKeyDown = (e: KeyboardEvent) => {
+ if (e.code !== 'Space' || e.defaultPrevented || e.ctrlKey || e.metaKey || e.altKey) return
+ const target = e.target instanceof HTMLElement ? e.target : null
+ if (target?.closest('input, textarea, select, button, a, summary, [contenteditable="true"]')) return
+ e.preventDefault()
+ usePlayer.getState().togglePlay()
+ }
+ window.addEventListener('keydown', onKeyDown)
+ return () => window.removeEventListener('keydown', onKeyDown)
+ }, [])
+}
+
+/** The bar at the bottom of every page: what is playing, the controls and the position. */
+export default function PlayerBar() {
+ const { t } = useTranslation()
+ const player = usePlayer()
+ const setOpen = useNowPlayingUi((s) => s.setOpen)
+ const track = currentTrack(player)
+ usePlayPauseKey()
+
+ return (
+
+
+ {track ? (
+ <>
+
setOpen(true)} className="rounded-md">
+
+
+
+ setOpen(true)} className="truncate text-left font-bold">
+ {track.title}
+
+
+ {track.artists.length === 0
+ ? '—'
+ : track.artists.map((a, i) => (
+
+ {i > 0 && ', '}
+
+ {a.name}
+
+
+ ))}
+
+
+ >
+ ) : (
+
{t('player.nothingPlaying')}
+ )}
+
+
+
+
+
+
{formatTime(track ? player.positionMs : 0)}
+
+
+
+
{formatTime(track?.duration_ms ?? 0)}
+
+
+
+
+ setOpen(true)}
+ >
+
+
+
+
+
+
+ )
+}
diff --git a/web/src/components/layout/PlayerControls.tsx b/web/src/components/layout/PlayerControls.tsx
new file mode 100644
index 0000000..9ece9b1
--- /dev/null
+++ b/web/src/components/layout/PlayerControls.tsx
@@ -0,0 +1,52 @@
+import { Pause, Play, Repeat, Repeat1, Shuffle, SkipBack, SkipForward } from 'lucide-react'
+import { useTranslation } from 'react-i18next'
+import { Button } from '@/components/ui/button'
+import { cn } from '@/lib/utils'
+import { currentTrack, usePlayer } from '@/player/store'
+
+/** Shuffle, previous, play/pause, next and repeat. Used by the player bar and the full-screen player. */
+export default function PlayerControls({ large = false }: { large?: boolean }) {
+ const { t } = useTranslation()
+ const player = usePlayer()
+ const none = currentTrack(player) === null
+ const small = large ? 'size-12' : 'size-11'
+ const repeatLabel = { off: 'player.repeatOff', all: 'player.repeatAll', one: 'player.repeatOne' }[player.repeat]
+
+ return (
+
+
+
+
+
+
+
+
+ {player.playing ? : }
+
+
+
+
+
+ {player.repeat === 'one' ? : }
+
+
+ )
+}
diff --git a/web/src/components/layout/Shell.test.tsx b/web/src/components/layout/Shell.test.tsx
new file mode 100644
index 0000000..c7df56a
--- /dev/null
+++ b/web/src/components/layout/Shell.test.tsx
@@ -0,0 +1,78 @@
+import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
+import { render, screen, within } from '@testing-library/react'
+import { createMemoryRouter, RouterProvider } from 'react-router-dom'
+import { beforeEach, expect, test, vi } from 'vitest'
+import { initI18n } from '@/i18n'
+import { routes } from '@/router'
+import { mockFetch } from '@/test/mockFetch'
+
+beforeEach(async () => {
+ vi.spyOn(navigator, 'language', 'get').mockReturnValue('en-US')
+ await initI18n()
+})
+
+function renderAt(path: string) {
+ const router = createMemoryRouter(routes, { initialEntries: [path] })
+ render(
+
+
+ ,
+ )
+}
+
+function mainNav() {
+ return screen.getByRole('navigation', { name: 'Main' })
+}
+
+test('at /artists the Artists link is the current page and the others are not', () => {
+ renderAt('/artists')
+ const nav = within(mainNav())
+ expect(nav.getByRole('link', { name: 'Artists' })).toHaveAttribute('aria-current', 'page')
+ for (const name of ['Home', 'Search', 'Albums', 'Songs', 'Settings']) {
+ expect(nav.getByRole('link', { name })).not.toHaveAttribute('aria-current')
+ }
+})
+
+test('Home is the current page only on /', () => {
+ renderAt('/')
+ expect(within(mainNav()).getByRole('link', { name: 'Home' })).toHaveAttribute('aria-current', 'page')
+})
+
+test('an artist page keeps the Artists link current', () => {
+ renderAt('/artists/5')
+ expect(within(mainNav()).getByRole('link', { name: 'Artists' })).toHaveAttribute('aria-current', 'page')
+})
+
+test('the page has one main landmark and says what the server does with data', () => {
+ renderAt('/songs')
+ expect(screen.getAllByRole('main')).toHaveLength(1)
+ expect(screen.getByText('Nothing leaves this server unless an admin turns a provider on.')).toBeInTheDocument()
+})
+
+test('the home page opens with a greeting as its heading', () => {
+ renderAt('/')
+ expect(screen.getByRole('heading', { level: 1 })).toHaveTextContent(/^Good (morning|afternoon|evening)$/)
+})
+
+test.each([
+ ['/search', 'Search'],
+ ['/artists', 'Artists'],
+ ['/albums', 'Albums'],
+ ['/songs', 'Songs'],
+ ['/settings', 'Settings'],
+])('the route %s opens a page headed %s', (path, heading) => {
+ renderAt(path)
+ expect(screen.getByRole('heading', { level: 1, name: heading })).toBeInTheDocument()
+})
+
+test.each(['/artists/5', '/albums/5'])('the detail route %s opens inside the shell and starts loading', (path) => {
+ mockFetch({})
+ renderAt(path)
+ expect(within(screen.getByRole('main')).getByRole('status')).toHaveTextContent('Loading')
+})
+
+test('an unknown path shows the not-found page with a way back', () => {
+ renderAt('/no/such/page')
+ expect(screen.getByRole('heading', { name: 'This page does not exist' })).toBeInTheDocument()
+ expect(screen.getByRole('link', { name: 'Back to Home' })).toHaveAttribute('href', '/')
+})
diff --git a/web/src/components/layout/Shell.tsx b/web/src/components/layout/Shell.tsx
new file mode 100644
index 0000000..0a91e94
--- /dev/null
+++ b/web/src/components/layout/Shell.tsx
@@ -0,0 +1,23 @@
+import { Outlet } from 'react-router-dom'
+import { usePlayerEngine } from '@/player/usePlayer'
+import PlayerBar from './PlayerBar'
+import Sidebar from './Sidebar'
+
+/** The frame of the app: the sidebar, the page, and the player bar. */
+export default function Shell() {
+ usePlayerEngine()
+ return (
+
+
+
+
+
+
+
+ {/* Sticky here, not on the bar: a sticky element only sticks inside its parent. */}
+
+
+ )
+}
diff --git a/web/src/components/layout/Sidebar.tsx b/web/src/components/layout/Sidebar.tsx
new file mode 100644
index 0000000..3f099b7
--- /dev/null
+++ b/web/src/components/layout/Sidebar.tsx
@@ -0,0 +1,52 @@
+import { NavLink } from 'react-router-dom'
+import { useTranslation } from 'react-i18next'
+import { cn } from '@/lib/utils'
+
+const LINKS = [
+ { to: '/', key: 'nav.home', end: true },
+ { to: '/search', key: 'nav.search', end: false },
+ { to: '/artists', key: 'nav.artists', end: false },
+ { to: '/albums', key: 'nav.albums', end: false },
+ { to: '/songs', key: 'nav.songs', end: false },
+ { to: '/settings', key: 'nav.settings', end: false },
+]
+
+export default function Sidebar() {
+ const { t } = useTranslation()
+ return (
+
+
+
+
+
+
+
+ {t('app.name')}
+
+
+ {LINKS.map((link) => (
+
+
+ cn(
+ 'flex min-h-11 items-center rounded-lg px-3 font-semibold',
+ isActive ? 'bg-secondary text-foreground' : 'text-muted-foreground hover:text-foreground',
+ )
+ }
+ >
+ {t(link.key)}
+
+
+ ))}
+
+
+ {t('app.privacy')}
+
+
+ )
+}
diff --git a/web/src/components/ui/button.tsx b/web/src/components/ui/button.tsx
new file mode 100644
index 0000000..997e0c7
--- /dev/null
+++ b/web/src/components/ui/button.tsx
@@ -0,0 +1,57 @@
+import { Button as ButtonPrimitive } from "@base-ui/react/button"
+import { cva, type VariantProps } from "class-variance-authority"
+import { cn } from "cn"
+
+const buttonVariants = cva(
+ "group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
+ {
+ variants: {
+ variant: {
+ default: "bg-primary text-primary-foreground hover:bg-primary/80",
+ outline:
+ "border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
+ secondary:
+ "bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
+ ghost:
+ "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
+ destructive:
+ "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",
+ link: "text-primary underline-offset-4 hover:underline",
+ },
+ size: {
+ default:
+ "h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
+ xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
+ sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
+ lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
+ icon: "size-8",
+ "icon-xs":
+ "size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
+ "icon-sm":
+ "size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg",
+ "icon-lg": "size-9",
+ },
+ },
+ defaultVariants: {
+ variant: "default",
+ size: "default",
+ },
+ }
+)
+
+function Button({
+ className,
+ variant = "default",
+ size = "default",
+ ...props
+}: ButtonPrimitive.Props & VariantProps) {
+ return (
+
+ )
+}
+
+export { Button, buttonVariants }
diff --git a/web/src/components/ui/dialog.tsx b/web/src/components/ui/dialog.tsx
new file mode 100644
index 0000000..c962a2d
--- /dev/null
+++ b/web/src/components/ui/dialog.tsx
@@ -0,0 +1,158 @@
+import * as React from "react"
+import { Dialog as DialogPrimitive } from "@base-ui/react/dialog"
+import { cn } from "cn"
+
+import { Button } from "@/components/ui/button"
+import { XIcon } from "lucide-react"
+
+function Dialog({ ...props }: DialogPrimitive.Root.Props) {
+ return
+}
+
+function DialogTrigger({ ...props }: DialogPrimitive.Trigger.Props) {
+ return
+}
+
+function DialogPortal({ ...props }: DialogPrimitive.Portal.Props) {
+ return
+}
+
+function DialogClose({ ...props }: DialogPrimitive.Close.Props) {
+ return
+}
+
+function DialogOverlay({
+ className,
+ ...props
+}: DialogPrimitive.Backdrop.Props) {
+ return (
+
+ )
+}
+
+function DialogContent({
+ className,
+ children,
+ showCloseButton = true,
+ ...props
+}: DialogPrimitive.Popup.Props & {
+ showCloseButton?: boolean
+}) {
+ return (
+
+
+
+ {children}
+ {showCloseButton && (
+
+ }
+ >
+
+ Close
+
+ )}
+
+
+ )
+}
+
+function DialogHeader({ className, ...props }: React.ComponentProps<"div">) {
+ return (
+
+ )
+}
+
+function DialogFooter({
+ className,
+ showCloseButton = false,
+ children,
+ ...props
+}: React.ComponentProps<"div"> & {
+ showCloseButton?: boolean
+}) {
+ return (
+
+ {children}
+ {showCloseButton && (
+ }>
+ Close
+
+ )}
+
+ )
+}
+
+function DialogTitle({ className, ...props }: DialogPrimitive.Title.Props) {
+ return (
+
+ )
+}
+
+function DialogDescription({
+ className,
+ ...props
+}: DialogPrimitive.Description.Props) {
+ return (
+
+ )
+}
+
+export {
+ Dialog,
+ DialogClose,
+ DialogContent,
+ DialogDescription,
+ DialogFooter,
+ DialogHeader,
+ DialogOverlay,
+ DialogPortal,
+ DialogTitle,
+ DialogTrigger,
+}
diff --git a/web/src/components/ui/input.tsx b/web/src/components/ui/input.tsx
new file mode 100644
index 0000000..7c4ab5a
--- /dev/null
+++ b/web/src/components/ui/input.tsx
@@ -0,0 +1,19 @@
+import * as React from "react"
+import { Input as InputPrimitive } from "@base-ui/react/input"
+import { cn } from "cn"
+
+function Input({ className, type, ...props }: React.ComponentProps<"input">) {
+ return (
+
+ )
+}
+
+export { Input }
diff --git a/web/src/components/ui/label.tsx b/web/src/components/ui/label.tsx
new file mode 100644
index 0000000..8b230f5
--- /dev/null
+++ b/web/src/components/ui/label.tsx
@@ -0,0 +1,17 @@
+import * as React from "react"
+import { cn } from "cn"
+
+function Label({ className, ...props }: React.ComponentProps<"label">) {
+ return (
+
+ )
+}
+
+export { Label }
diff --git a/web/src/i18n/i18n.test.ts b/web/src/i18n/i18n.test.ts
new file mode 100644
index 0000000..7a1bf07
--- /dev/null
+++ b/web/src/i18n/i18n.test.ts
@@ -0,0 +1,86 @@
+import { afterEach, expect, test, vi } from 'vitest'
+import i18n from 'i18next'
+import en from './locales/en.json'
+import it from './locales/it.json'
+import { errorMessageKey, initI18n, setLanguage } from './index'
+
+function flatten(obj: Record, prefix = ''): Record {
+ const out: Record = {}
+ for (const [key, value] of Object.entries(obj)) {
+ const path = prefix ? `${prefix}.${key}` : key
+ if (value && typeof value === 'object') Object.assign(out, flatten(value as Record, path))
+ else out[path] = value
+ }
+ return out
+}
+
+function browserLanguage(value: string) {
+ vi.spyOn(navigator, 'language', 'get').mockReturnValue(value)
+}
+
+afterEach(() => {
+ vi.restoreAllMocks()
+})
+
+test('English and Italian have exactly the same keys', () => {
+ expect(Object.keys(flatten(it)).sort()).toEqual(Object.keys(flatten(en)).sort())
+})
+
+test('no text is empty', () => {
+ for (const messages of [en, it]) {
+ for (const [key, value] of Object.entries(flatten(messages))) {
+ expect(String(value).trim(), key).not.toBe('')
+ }
+ }
+})
+
+test('an Italian browser gets Italian', async () => {
+ browserLanguage('it-IT')
+ await initI18n()
+ expect(i18n.language).toBe('it')
+ expect(i18n.t('nav.home')).toBe(flatten(it)['nav.home'])
+})
+
+test('any other browser language gets English', async () => {
+ browserLanguage('fr-FR')
+ await initI18n()
+ expect(i18n.language).toBe('en')
+})
+
+test('a stored language beats the browser language', async () => {
+ browserLanguage('it-IT')
+ localStorage.setItem('sonda.lang', 'en')
+ await initI18n()
+ expect(i18n.language).toBe('en')
+})
+
+test('a stored value that is not a language is ignored', async () => {
+ browserLanguage('en-US')
+ localStorage.setItem('sonda.lang', 'klingon')
+ await initI18n()
+ expect(i18n.language).toBe('en')
+})
+
+test('setLanguage changes the page language and remembers it', async () => {
+ browserLanguage('en-US')
+ await initI18n()
+ await setLanguage('it')
+ expect(document.documentElement.lang).toBe('it')
+ expect(localStorage.getItem('sonda.lang')).toBe('it')
+ expect(i18n.language).toBe('it')
+})
+
+test('setLanguage still works when storage throws', async () => {
+ vi.spyOn(Storage.prototype, 'setItem').mockImplementation(() => {
+ throw new Error('blocked')
+ })
+ await expect(setLanguage('en')).resolves.toBeUndefined()
+ expect(document.documentElement.lang).toBe('en')
+})
+
+test('an API error code maps to its text, or to the generic one', async () => {
+ browserLanguage('en-US')
+ await initI18n()
+ expect(errorMessageKey('invalid_credentials')).toBe('error.invalid_credentials')
+ expect(errorMessageKey('something_new_the_server_added')).toBe('error.unknown')
+})
diff --git a/web/src/i18n/index.ts b/web/src/i18n/index.ts
new file mode 100644
index 0000000..3e4ea17
--- /dev/null
+++ b/web/src/i18n/index.ts
@@ -0,0 +1,67 @@
+import i18n from 'i18next'
+import { initReactI18next, useTranslation } from 'react-i18next'
+import en from './locales/en.json'
+import it from './locales/it.json'
+
+export type Lang = 'en' | 'it'
+
+const KEY = 'sonda.lang'
+const LANGS: readonly Lang[] = ['en', 'it']
+
+function isLang(value: unknown): value is Lang {
+ return LANGS.includes(value as Lang)
+}
+
+function readStored(): string | null {
+ try {
+ return localStorage.getItem(KEY)
+ } catch {
+ return null
+ }
+}
+
+/** The stored choice, else Italian for an Italian browser, else English. */
+function detect(): Lang {
+ const stored = readStored()
+ if (isLang(stored)) return stored
+ return navigator.language.toLowerCase().startsWith('it') ? 'it' : 'en'
+}
+
+export async function initI18n(): Promise {
+ const lng = detect()
+ if (i18n.isInitialized) {
+ await i18n.changeLanguage(lng)
+ } else {
+ await i18n.use(initReactI18next).init({
+ resources: { en: { translation: en }, it: { translation: it } },
+ lng,
+ fallbackLng: 'en',
+ interpolation: { escapeValue: false },
+ })
+ }
+ document.documentElement.lang = lng
+}
+
+export async function setLanguage(lang: Lang): Promise {
+ if (!i18n.isInitialized) await initI18n()
+ await i18n.changeLanguage(lang)
+ document.documentElement.lang = lang
+ try {
+ localStorage.setItem(KEY, lang)
+ } catch {
+ // The choice still applies for this page view.
+ }
+}
+
+export function useLanguage(): { lang: Lang; setLanguage: (lang: Lang) => Promise } {
+ const { i18n: instance } = useTranslation()
+ return { lang: isLang(instance.language) ? instance.language : 'en', setLanguage }
+}
+
+/** The text key for an API error code, or the generic one when the code is not known here. */
+export function errorMessageKey(code: string): string {
+ const key = `error.${code}`
+ return i18n.exists(key) ? key : 'error.unknown'
+}
+
+export { i18n }
diff --git a/web/src/i18n/locales/en.json b/web/src/i18n/locales/en.json
new file mode 100644
index 0000000..3524951
--- /dev/null
+++ b/web/src/i18n/locales/en.json
@@ -0,0 +1,146 @@
+{
+ "app": {
+ "name": "Sonda",
+ "privacy": "Nothing leaves this server unless an admin turns a provider on."
+ },
+ "nav": {
+ "main": "Main",
+ "home": "Home",
+ "search": "Search",
+ "artists": "Artists",
+ "albums": "Albums",
+ "songs": "Songs",
+ "settings": "Settings"
+ },
+ "common": {
+ "loading": "Loading",
+ "retry": "Try again",
+ "showMore": "Show more",
+ "seeAll": "See all",
+ "notFound": "This page does not exist",
+ "backHome": "Back to Home"
+ },
+ "player": {
+ "label": "Player",
+ "play": "Play",
+ "pause": "Pause",
+ "next": "Next",
+ "previous": "Previous",
+ "shuffle": "Shuffle",
+ "repeatOff": "Repeat: off",
+ "repeatAll": "Repeat: all",
+ "repeatOne": "Repeat: one",
+ "seek": "Seek",
+ "seekValue": "{{position}} of {{duration}}",
+ "nothingPlaying": "Nothing playing",
+ "open": "Open the full-screen player",
+ "close": "Close",
+ "upNext": "Up next",
+ "queue": "Queue",
+ "nowPlaying": "Now playing"
+ },
+ "settings": {
+ "account": "Account",
+ "admin": "Admin",
+ "signOut": "Sign out",
+ "appearance": "Appearance",
+ "theme": "Theme",
+ "language": "Language",
+ "password": "Password",
+ "currentPassword": "Current password",
+ "newPassword": "New password",
+ "passwordHint": "8 to 256 characters. Changing it signs you out everywhere.",
+ "passwordLength": "The new password needs 8 to 256 characters.",
+ "currentPasswordWrong": "The current password is wrong.",
+ "changePassword": "Change password"
+ },
+ "home": {
+ "greeting_morning": "Good morning",
+ "greeting_afternoon": "Good afternoon",
+ "greeting_evening": "Good evening",
+ "recent": "Recently played",
+ "nothingPlayed": "Play something and it will show up here.",
+ "emptyLibrary": "Your library is empty. An admin can add a folder of music and scan it.",
+ "trackGone": "That song is no longer in your library."
+ },
+ "search": {
+ "label": "Search your library",
+ "placeholder": "Artists, albums and songs",
+ "hint": "Type to search artists, albums and songs.",
+ "nothingFound": "Nothing found for “{{q}}”."
+ },
+ "provider": {
+ "wikipedia": "Wikipedia",
+ "lastfm": "Last.fm",
+ "musicbrainz": "MusicBrainz",
+ "files": "your files"
+ },
+ "empty": {
+ "artists": "No artists yet.",
+ "albums": "No albums yet.",
+ "songs": "No songs yet.",
+ "noMatch": "Nothing matches “{{q}}”.",
+ "nothingFound": "Nothing was found.",
+ "nothingOfArtist": "Nothing of this artist is in your library.",
+ "providerDisabled": "Turn on {{provider}} in the server settings to see this.",
+ "providerError": "{{provider}} could not be reached. Try again later.",
+ "noId": "This artist has no MusicBrainz id, so Sonda cannot look it up.",
+ "stale": "This may be out of date: the provider could not be reached."
+ },
+ "notFound": {
+ "album": "This album does not exist.",
+ "artist": "This artist does not exist."
+ },
+ "album": {
+ "meta_one": "{{count}} song · {{duration}}",
+ "meta_other": "{{count}} songs · {{duration}}"
+ },
+ "artist": {
+ "albumCount_one": "{{count}} album",
+ "albumCount_other": "{{count}} albums",
+ "songCount_one": "{{count}} song",
+ "songCount_other": "{{count}} songs",
+ "albums": "Albums",
+ "songs": "Songs",
+ "about": "About",
+ "similar": "Similar artists",
+ "tags": "Tags",
+ "inLibrary": "In your library"
+ },
+ "attribution": {
+ "wikipedia": "Text from Wikipedia:",
+ "photo": "Photo",
+ "photoBy": "Photo: {{author}}"
+ },
+ "theme": {
+ "sonda": "Sonda",
+ "tokyo-night": "Tokyo Night",
+ "gruvbox-dark": "Gruvbox dark",
+ "gruvbox-light": "Gruvbox light",
+ "dracula": "Dracula",
+ "neon": "Neon"
+ },
+ "lang": {
+ "en": "English",
+ "it": "Italiano"
+ },
+ "auth": {
+ "signInTitle": "Sign in",
+ "registerTitle": "Create the first account",
+ "username": "Username",
+ "password": "Password",
+ "signIn": "Sign in",
+ "createAccount": "Create account",
+ "firstUser": "This is a new server: create the first account",
+ "haveAccount": "I already have an account"
+ },
+ "error": {
+ "invalid_credentials": "Wrong username or password.",
+ "registration_closed": "An account already exists. Ask an admin to create yours.",
+ "username_taken": "That username is taken.",
+ "invalid_input": "Check what you typed and try again.",
+ "unauthorized": "Your session has ended. Sign in again.",
+ "network": "Cannot reach the server. Check your connection and try again.",
+ "unknown": "Something went wrong. Try again."
+ }
+}
diff --git a/web/src/i18n/locales/it.json b/web/src/i18n/locales/it.json
new file mode 100644
index 0000000..ab82b72
--- /dev/null
+++ b/web/src/i18n/locales/it.json
@@ -0,0 +1,146 @@
+{
+ "app": {
+ "name": "Sonda",
+ "privacy": "Niente esce da questo server finché un admin non accende un provider."
+ },
+ "nav": {
+ "main": "Principale",
+ "home": "Home",
+ "search": "Cerca",
+ "artists": "Artisti",
+ "albums": "Album",
+ "songs": "Brani",
+ "settings": "Impostazioni"
+ },
+ "common": {
+ "loading": "Caricamento",
+ "retry": "Riprova",
+ "showMore": "Mostra altro",
+ "seeAll": "Mostra tutto",
+ "notFound": "Questa pagina non esiste",
+ "backHome": "Torna alla Home"
+ },
+ "player": {
+ "label": "Player",
+ "play": "Riproduci",
+ "pause": "Pausa",
+ "next": "Avanti",
+ "previous": "Indietro",
+ "shuffle": "Casuale",
+ "repeatOff": "Ripeti: no",
+ "repeatAll": "Ripeti: tutto",
+ "repeatOne": "Ripeti: un brano",
+ "seek": "Posizione",
+ "seekValue": "{{position}} di {{duration}}",
+ "nothingPlaying": "Niente in riproduzione",
+ "open": "Apri il player a schermo intero",
+ "close": "Chiudi",
+ "upNext": "Prossimi brani",
+ "queue": "Coda",
+ "nowPlaying": "In riproduzione"
+ },
+ "settings": {
+ "account": "Account",
+ "admin": "Admin",
+ "signOut": "Esci",
+ "appearance": "Aspetto",
+ "theme": "Tema",
+ "language": "Lingua",
+ "password": "Password",
+ "currentPassword": "Password attuale",
+ "newPassword": "Nuova password",
+ "passwordHint": "Da 8 a 256 caratteri. Cambiarla ti disconnette ovunque.",
+ "passwordLength": "La nuova password deve avere da 8 a 256 caratteri.",
+ "currentPasswordWrong": "La password attuale è sbagliata.",
+ "changePassword": "Cambia password"
+ },
+ "home": {
+ "greeting_morning": "Buongiorno",
+ "greeting_afternoon": "Buon pomeriggio",
+ "greeting_evening": "Buonasera",
+ "recent": "Ascoltati di recente",
+ "nothingPlayed": "Ascolta qualcosa e comparirà qui.",
+ "emptyLibrary": "La libreria è vuota. Un admin può aggiungere una cartella di musica e scansionarla.",
+ "trackGone": "Quel brano non è più nella tua libreria."
+ },
+ "search": {
+ "label": "Cerca nella libreria",
+ "placeholder": "Artisti, album e brani",
+ "hint": "Scrivi per cercare artisti, album e brani.",
+ "nothingFound": "Non ho trovato niente per “{{q}}”."
+ },
+ "provider": {
+ "wikipedia": "Wikipedia",
+ "lastfm": "Last.fm",
+ "musicbrainz": "MusicBrainz",
+ "files": "i tuoi file"
+ },
+ "empty": {
+ "artists": "Ancora nessun artista.",
+ "albums": "Ancora nessun album.",
+ "songs": "Ancora nessun brano.",
+ "noMatch": "Niente corrisponde a “{{q}}”.",
+ "nothingFound": "Non è stato trovato niente.",
+ "nothingOfArtist": "Di questo artista non c'è niente nella tua libreria.",
+ "providerDisabled": "Accendi {{provider}} nelle impostazioni del server per vederlo.",
+ "providerError": "{{provider}} non risponde. Riprova più tardi.",
+ "noId": "Questo artista non ha un id MusicBrainz, quindi Sonda non può cercarlo.",
+ "stale": "Potrebbe essere vecchio: il provider non ha risposto."
+ },
+ "notFound": {
+ "album": "Questo album non esiste.",
+ "artist": "Questo artista non esiste."
+ },
+ "album": {
+ "meta_one": "{{count}} brano · {{duration}}",
+ "meta_other": "{{count}} brani · {{duration}}"
+ },
+ "artist": {
+ "albumCount_one": "{{count}} album",
+ "albumCount_other": "{{count}} album",
+ "songCount_one": "{{count}} brano",
+ "songCount_other": "{{count}} brani",
+ "albums": "Album",
+ "songs": "Brani",
+ "about": "Info",
+ "similar": "Artisti simili",
+ "tags": "Tag",
+ "inLibrary": "Nella tua libreria"
+ },
+ "attribution": {
+ "wikipedia": "Testo da Wikipedia:",
+ "photo": "Foto",
+ "photoBy": "Foto: {{author}}"
+ },
+ "theme": {
+ "sonda": "Sonda",
+ "tokyo-night": "Tokyo Night",
+ "gruvbox-dark": "Gruvbox scuro",
+ "gruvbox-light": "Gruvbox chiaro",
+ "dracula": "Dracula",
+ "neon": "Neon"
+ },
+ "lang": {
+ "en": "English",
+ "it": "Italiano"
+ },
+ "auth": {
+ "signInTitle": "Accedi",
+ "registerTitle": "Crea il primo account",
+ "username": "Nome utente",
+ "password": "Password",
+ "signIn": "Accedi",
+ "createAccount": "Crea account",
+ "firstUser": "Questo server è nuovo: crea il primo account",
+ "haveAccount": "Ho già un account"
+ },
+ "error": {
+ "invalid_credentials": "Nome utente o password sbagliati.",
+ "registration_closed": "Esiste già un account. Chiedi a un admin di creare il tuo.",
+ "username_taken": "Questo nome utente è già preso.",
+ "invalid_input": "Controlla quello che hai scritto e riprova.",
+ "unauthorized": "La sessione è terminata. Accedi di nuovo.",
+ "network": "Il server non risponde. Controlla la connessione e riprova.",
+ "unknown": "Qualcosa è andato storto. Riprova."
+ }
+}
diff --git a/web/src/index.css b/web/src/index.css
new file mode 100644
index 0000000..56f5018
--- /dev/null
+++ b/web/src/index.css
@@ -0,0 +1,61 @@
+@import "tailwindcss";
+@import "tw-animate-css";
+@import "shadcn/tailwind.css";
+@import "@fontsource/figtree/400.css";
+@import "@fontsource/figtree/500.css";
+@import "@fontsource/figtree/600.css";
+@import "@fontsource/figtree/700.css";
+@import "@fontsource/figtree/800.css";
+@import "@fontsource/fraunces/600.css";
+@import "@fontsource/fraunces/700.css";
+@import "./theme/themes.css";
+
+/* The dark variant follows the theme, not the OS setting. */
+@custom-variant dark (&:is([data-theme="sonda"] *, [data-theme="tokyo-night"] *, [data-theme="gruvbox-dark"] *, [data-theme="dracula"] *, [data-theme="neon"] *));
+
+@theme inline {
+ --font-heading: var(--font-sans);
+ --font-sans: 'Figtree', system-ui, sans-serif;
+ --font-display: 'Fraunces', Georgia, serif;
+ --color-ring: var(--ring);
+ --color-input: var(--input);
+ --color-border: var(--border);
+ --color-destructive: var(--destructive);
+ --color-accent-foreground: var(--accent-foreground);
+ --color-accent: var(--accent);
+ --color-muted-foreground: var(--muted-foreground);
+ --color-muted: var(--muted);
+ --color-secondary-foreground: var(--secondary-foreground);
+ --color-secondary: var(--secondary);
+ --color-primary-foreground: var(--primary-foreground);
+ --color-primary: var(--primary);
+ --color-popover-foreground: var(--popover-foreground);
+ --color-popover: var(--popover);
+ --color-card-foreground: var(--card-foreground);
+ --color-card: var(--card);
+ --color-foreground: var(--foreground);
+ --color-background: var(--background);
+ --radius-sm: calc(var(--radius) * 0.6);
+ --radius-md: calc(var(--radius) * 0.8);
+ --radius-lg: var(--radius);
+ --radius-xl: calc(var(--radius) * 1.4);
+ --radius-2xl: calc(var(--radius) * 1.8);
+ --radius-3xl: calc(var(--radius) * 2.2);
+ --radius-4xl: calc(var(--radius) * 2.6);
+}
+
+:root {
+ --radius: 0.25rem;
+}
+
+@layer base {
+ * {
+ @apply border-border outline-ring/50;
+ }
+ body {
+ @apply bg-background text-foreground;
+ }
+ html {
+ @apply font-sans;
+ }
+}
diff --git a/web/src/lib/time.test.ts b/web/src/lib/time.test.ts
new file mode 100644
index 0000000..eaed80e
--- /dev/null
+++ b/web/src/lib/time.test.ts
@@ -0,0 +1,22 @@
+import { expect, test } from 'vitest'
+import { formatTime } from './time'
+
+test.each([
+ [0, '0:00'],
+ [999, '0:00'],
+ [1000, '0:01'],
+ [59_999, '0:59'],
+ [147_000, '2:27'],
+ [387_000, '6:27'],
+ [3_599_000, '59:59'],
+ [3_600_000, '1:00:00'],
+ [4_000_000, '1:06:40'],
+])('%i ms is written %s', (ms, text) => {
+ expect(formatTime(ms)).toBe(text)
+})
+
+test('a negative or unknown time is written as zero', () => {
+ expect(formatTime(-5)).toBe('0:00')
+ expect(formatTime(Number.NaN)).toBe('0:00')
+ expect(formatTime(Number.POSITIVE_INFINITY)).toBe('0:00')
+})
diff --git a/web/src/lib/time.ts b/web/src/lib/time.ts
new file mode 100644
index 0000000..d388d0a
--- /dev/null
+++ b/web/src/lib/time.ts
@@ -0,0 +1,9 @@
+/** Minutes and seconds ("2:27"), with hours when there are any ("1:06:40"). Anything that is not a time is "0:00". */
+export function formatTime(ms: number): string {
+ if (!Number.isFinite(ms) || ms < 0) return '0:00'
+ const total = Math.floor(ms / 1000)
+ const hours = Math.floor(total / 3600)
+ const minutes = Math.floor((total % 3600) / 60)
+ const seconds = String(total % 60).padStart(2, '0')
+ return hours > 0 ? `${hours}:${String(minutes).padStart(2, '0')}:${seconds}` : `${minutes}:${seconds}`
+}
diff --git a/web/src/lib/utils.ts b/web/src/lib/utils.ts
new file mode 100644
index 0000000..f815ded
--- /dev/null
+++ b/web/src/lib/utils.ts
@@ -0,0 +1 @@
+export { cn } from "cn"
diff --git a/web/src/lib/uuid.test.ts b/web/src/lib/uuid.test.ts
new file mode 100644
index 0000000..7caf6f2
--- /dev/null
+++ b/web/src/lib/uuid.test.ts
@@ -0,0 +1,20 @@
+import { afterEach, expect, test, vi } from 'vitest'
+import { uuid } from './uuid'
+
+const V4 = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/
+
+afterEach(() => {
+ vi.unstubAllGlobals()
+})
+
+test('a uuid has the shape of a version 4 uuid', () => {
+ expect(uuid()).toMatch(V4)
+})
+
+test('where crypto.randomUUID does not exist (a page opened over plain HTTP) it still makes one', () => {
+ const real = globalThis.crypto
+ vi.stubGlobal('crypto', { getRandomValues: (a: Uint8Array) => real.getRandomValues(a) })
+ const first = uuid()
+ expect(first).toMatch(V4)
+ expect(uuid()).not.toBe(first)
+})
diff --git a/web/src/lib/uuid.ts b/web/src/lib/uuid.ts
new file mode 100644
index 0000000..c438303
--- /dev/null
+++ b/web/src/lib/uuid.ts
@@ -0,0 +1,13 @@
+/**
+ * A random version 4 uuid. `crypto.randomUUID` only exists on secure pages (HTTPS or localhost), and a
+ * home server is often opened over plain HTTP on the local network, so fall back to `getRandomValues`,
+ * which works everywhere.
+ */
+export function uuid(): string {
+ if (typeof crypto.randomUUID === 'function') return crypto.randomUUID()
+ const bytes = crypto.getRandomValues(new Uint8Array(16))
+ bytes[6] = (bytes[6] & 0x0f) | 0x40 // version 4
+ bytes[8] = (bytes[8] & 0x3f) | 0x80 // variant 10
+ const hex = Array.from(bytes, (b) => b.toString(16).padStart(2, '0')).join('')
+ return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`
+}
diff --git a/web/src/main.tsx b/web/src/main.tsx
new file mode 100644
index 0000000..4aa850c
--- /dev/null
+++ b/web/src/main.tsx
@@ -0,0 +1,18 @@
+import { StrictMode } from 'react'
+import { createRoot } from 'react-dom/client'
+import './index.css'
+import App from './App.tsx'
+import { restoreSession } from './auth/session'
+import { initI18n } from './i18n'
+import { initTheme } from './theme/theme'
+
+initTheme()
+void restoreSession()
+
+void initI18n().then(() => {
+ createRoot(document.getElementById('root')!).render(
+
+
+ ,
+ )
+})
diff --git a/web/src/pages/AlbumPage.tsx b/web/src/pages/AlbumPage.tsx
new file mode 100644
index 0000000..f3d878a
--- /dev/null
+++ b/web/src/pages/AlbumPage.tsx
@@ -0,0 +1,78 @@
+import { Play } from 'lucide-react'
+import { useTranslation } from 'react-i18next'
+import { Link, useParams } from 'react-router-dom'
+import { useAlbum, useTrackList } from '@/api/catalog'
+import { ApiError } from '@/api/client'
+import Cover from '@/components/Cover'
+import LoadMore from '@/components/LoadMore'
+import { EmptyMessage, ErrorMessage, Loading } from '@/components/Status'
+import TrackList from '@/components/TrackList'
+import { Button } from '@/components/ui/button'
+import { formatTime } from '@/lib/time'
+import { usePlayer } from '@/player/store'
+
+export default function AlbumPage() {
+ const { t } = useTranslation()
+ const id = Number(useParams().id)
+ if (!Number.isInteger(id) || id < 1) return {t('notFound.album')}
+ return
+}
+
+function AlbumView({ id }: { id: number }) {
+ const { t } = useTranslation()
+ const album = useAlbum(id)
+ const tracks = useTrackList({ albumId: id })
+ const playTracks = usePlayer((s) => s.playTracks)
+ const items = tracks.data?.items ?? []
+
+ if (album.isError) {
+ if (album.error instanceof ApiError && album.error.status === 404) return {t('notFound.album')}
+ return album.refetch()} />
+ }
+ if (!album.data) return
+ const a = album.data
+
+ return (
+
+
+
+
+
playTracks(items, 0)}>
+
+ {t('player.play')}
+
+
+
+ {tracks.isError ? (
+
tracks.refetch()} />
+ ) : tracks.isPending ? (
+
+ ) : (
+ <>
+
+
+ >
+ )}
+
+ )
+}
diff --git a/web/src/pages/AlbumsPage.tsx b/web/src/pages/AlbumsPage.tsx
new file mode 100644
index 0000000..177bb30
--- /dev/null
+++ b/web/src/pages/AlbumsPage.tsx
@@ -0,0 +1,38 @@
+import { useTranslation } from 'react-i18next'
+import { useSearchParams } from 'react-router-dom'
+import { useAlbumList } from '@/api/catalog'
+import { AlbumCard, CARD_GRID } from '@/components/cards'
+import LoadMore from '@/components/LoadMore'
+import { EmptyMessage, ErrorMessage, Loading } from '@/components/Status'
+
+export default function AlbumsPage() {
+ const { t } = useTranslation()
+ const [params] = useSearchParams()
+ const q = params.get('q') ?? ''
+ const query = useAlbumList({ q })
+ const items = query.data?.items ?? []
+
+ return (
+
+
{t('nav.albums')}
+ {query.isError ? (
+
query.refetch()} />
+ ) : query.isPending ? (
+
+ ) : items.length === 0 ? (
+ {q ? t('empty.noMatch', { q }) : t('empty.albums')}
+ ) : (
+ <>
+
+ {items.map((album) => (
+
+
+
+ ))}
+
+
+ >
+ )}
+
+ )
+}
diff --git a/web/src/pages/ArtistPage.tsx b/web/src/pages/ArtistPage.tsx
new file mode 100644
index 0000000..278a1d3
--- /dev/null
+++ b/web/src/pages/ArtistPage.tsx
@@ -0,0 +1,106 @@
+import { Play } from 'lucide-react'
+import { useTranslation } from 'react-i18next'
+import { useParams } from 'react-router-dom'
+import { useAlbumList, useArtist, useTrackList } from '@/api/catalog'
+import { ApiError } from '@/api/client'
+import ArtistPhoto from '@/components/ArtistPhoto'
+import { AlbumCard, CARD_GRID } from '@/components/cards'
+import LoadMore from '@/components/LoadMore'
+import { EmptyMessage, ErrorMessage, Loading } from '@/components/Status'
+import TrackList from '@/components/TrackList'
+import { Button } from '@/components/ui/button'
+import { usePlayer } from '@/player/store'
+import Section from '@/components/Section'
+import { About, PhotoCredit, Similar, Tags } from './ArtistSections'
+
+export default function ArtistPage() {
+ const { t } = useTranslation()
+ const id = Number(useParams().id)
+ if (!Number.isInteger(id) || id < 1) return {t('notFound.artist')}
+ return
+}
+
+function ArtistView({ id }: { id: number }) {
+ const { t } = useTranslation()
+ const artist = useArtist(id)
+ const albums = useAlbumList({ artistId: id })
+ const tracks = useTrackList({ artistId: id })
+ const playTracks = usePlayer((s) => s.playTracks)
+ const songs = tracks.data?.items ?? []
+
+ if (artist.isError) {
+ if (artist.error instanceof ApiError && artist.error.status === 404) return {t('notFound.artist')}
+ return artist.refetch()} />
+ }
+ if (!artist.data) return
+ const a = artist.data
+ const nothingHere = a.album_count === 0 && a.track_count === 0
+
+ return (
+
+
+
+ {nothingHere ? (
+
{t('empty.nothingOfArtist')}
+ ) : (
+ <>
+
+ {albums.isError ? (
+ albums.refetch()} />
+ ) : albums.isPending ? (
+
+ ) : (
+ <>
+
+ {(albums.data?.items ?? []).map((album) => (
+
+
+
+ ))}
+
+
+ >
+ )}
+
+
+ {tracks.isError ? (
+ tracks.refetch()} />
+ ) : tracks.isPending ? (
+
+ ) : (
+ <>
+
+
+ >
+ )}
+
+ >
+ )}
+
+
+
+
+
+ )
+}
diff --git a/web/src/pages/ArtistSections.tsx b/web/src/pages/ArtistSections.tsx
new file mode 100644
index 0000000..4941dcf
--- /dev/null
+++ b/web/src/pages/ArtistSections.tsx
@@ -0,0 +1,135 @@
+import { useTranslation } from 'react-i18next'
+import { Link } from 'react-router-dom'
+import { useArtistDescription, useArtistImageCredit, useArtistTags, useSimilarArtists } from '@/api/providers'
+import Attribution, { ExternalLink } from '@/components/Attribution'
+import ProviderMessage from '@/components/ProviderMessage'
+import Section from '@/components/Section'
+import { EmptyMessage, ErrorMessage, Loading } from '@/components/Status'
+
+const MAX_TAGS = 10
+
+export function About({ artistId }: { artistId: number }) {
+ const { t } = useTranslation()
+ const query = useArtistDescription(artistId)
+ const data = query.data
+
+ return (
+
+ {query.isError ? (
+ query.refetch()} />
+ ) : !data ? (
+
+ ) : data.provider_status !== 'ok' ? (
+
+ ) : !data.description ? (
+ {t('empty.nothingFound')}
+ ) : (
+ <>
+ {data.description.text}
+
+ {t('attribution.wikipedia')} {data.description.title}
+ {' · '}
+ {data.description.license}
+
+ {data.stale && {t('empty.stale')} }
+ >
+ )}
+
+ )
+}
+
+export function Similar({ artistId }: { artistId: number }) {
+ const { t } = useTranslation()
+ const query = useSimilarArtists(artistId)
+ const data = query.data
+
+ return (
+
+ {query.isError ? (
+ query.refetch()} />
+ ) : !data ? (
+
+ ) : data.provider_status !== 'ok' ? (
+
+ ) : data.items.length === 0 ? (
+ {t('empty.nothingFound')}
+ ) : (
+ <>
+
+ {data.items.map((item) => (
+
+
+ {item.artist.name}
+ {item.in_library && {t('artist.inLibrary')} }
+
+
+ ))}
+
+ {data.attribution && {data.attribution} }
+ {data.stale && {t('empty.stale')} }
+ >
+ )}
+
+ )
+}
+
+export function Tags({ artistId }: { artistId: number }) {
+ const { t } = useTranslation()
+ const query = useArtistTags(artistId)
+ const sources = query.data?.sources ?? []
+ const shown = sources.filter((s) => s.provider_status === 'ok' && s.tags.length > 0)
+ // When no source gave any tag, say why for the first one that could not.
+ const reason =
+ sources.find((s) => s.provider_status === 'disabled') ??
+ sources.find((s) => s.provider_status === 'error') ??
+ sources.find((s) => s.provider_status === 'no_id')
+
+ return (
+
+ {query.isError ? (
+ query.refetch()} />
+ ) : !query.data ? (
+
+ ) : shown.length > 0 ? (
+ shown.map((source) => (
+
+
+ {[...source.tags]
+ .sort((a, b) => b.weight - a.weight)
+ .slice(0, MAX_TAGS)
+ .map((tag) => (
+
+ {tag.name}
+
+ ))}
+
+ {source.attribution &&
{source.attribution} }
+
+ ))
+ ) : reason && reason.provider_status !== 'ok' ? (
+
+ ) : (
+ {t('empty.nothingFound')}
+ )}
+
+ )
+}
+
+/** Whose photo it is and under which licence (the licences ask for it). Nothing when there is no credit. */
+export function PhotoCredit({ artistId }: { artistId: number }) {
+ const { t } = useTranslation()
+ const credit = useArtistImageCredit(artistId).data
+ if (!credit) return null
+ return (
+
+ {credit.author ? t('attribution.photoBy', { author: credit.author }) : t('attribution.photo')}
+ {' · '}
+ {credit.license_url ? {credit.license} : credit.license}
+ {' · '}
+ {credit.source}
+
+ )
+}
diff --git a/web/src/pages/ArtistsPage.tsx b/web/src/pages/ArtistsPage.tsx
new file mode 100644
index 0000000..5fbfd05
--- /dev/null
+++ b/web/src/pages/ArtistsPage.tsx
@@ -0,0 +1,38 @@
+import { useTranslation } from 'react-i18next'
+import { useSearchParams } from 'react-router-dom'
+import { useArtistList } from '@/api/catalog'
+import { ArtistCard, CARD_GRID } from '@/components/cards'
+import LoadMore from '@/components/LoadMore'
+import { EmptyMessage, ErrorMessage, Loading } from '@/components/Status'
+
+export default function ArtistsPage() {
+ const { t } = useTranslation()
+ const [params] = useSearchParams()
+ const q = params.get('q') ?? ''
+ const query = useArtistList(q)
+ const items = query.data?.items ?? []
+
+ return (
+
+
{t('nav.artists')}
+ {query.isError ? (
+
query.refetch()} />
+ ) : query.isPending ? (
+
+ ) : items.length === 0 ? (
+ {q ? t('empty.noMatch', { q }) : t('empty.artists')}
+ ) : (
+ <>
+
+ {items.map((artist) => (
+
+
+
+ ))}
+
+
+ >
+ )}
+
+ )
+}
diff --git a/web/src/pages/HomePage.test.tsx b/web/src/pages/HomePage.test.tsx
new file mode 100644
index 0000000..96fd9de
--- /dev/null
+++ b/web/src/pages/HomePage.test.tsx
@@ -0,0 +1,161 @@
+import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
+import { render, screen, within } from '@testing-library/react'
+import userEvent from '@testing-library/user-event'
+import { MemoryRouter } from 'react-router-dom'
+import { beforeEach, expect, test, vi } from 'vitest'
+import { sessionStore } from '@/auth/session'
+import { initI18n } from '@/i18n'
+import { usePlayer } from '@/player/store'
+import { apiError, mockFetch, type MockRoutes } from '@/test/mockFetch'
+import HomePage from './HomePage'
+
+const page = (items: object[], total = items.length) => ({ items, total, limit: 10, offset: 0 })
+
+const listen = (trackId: number, i = 0) => ({
+ id: 1000 + i,
+ track: { id: trackId, title: `Song ${trackId}` },
+ event_type: 'complete',
+ occurred_at: '2026-11-12T10:00:00Z',
+ duration_played_ms: 200_000,
+ counted: true,
+})
+
+const track = (n: number) => ({
+ id: n,
+ title: `Song ${n}`,
+ duration_ms: 200_000,
+ track_no: 1,
+ disc_no: 1,
+ album: null,
+ artists: [],
+ format: 'mp3',
+})
+
+const album = { id: 9, title: 'OK Computer', artist: { id: 5, name: 'Radiohead' }, track_count: 12, duration_ms: 1 }
+const artist = { id: 5, name: 'Radiohead', album_count: 1, track_count: 12 }
+
+function routes(over: MockRoutes = {}): MockRoutes {
+ return {
+ 'GET /api/v1/listens': () => page([listen(1), listen(2, 1)]),
+ 'GET /api/v1/albums': () => page([album]),
+ 'GET /api/v1/artists': () => page([artist]),
+ ...over,
+ }
+}
+
+function renderHome() {
+ const client = new QueryClient({ defaultOptions: { queries: { retry: false } } })
+ return render(
+
+
+
+
+ ,
+ )
+}
+
+beforeEach(async () => {
+ vi.spyOn(navigator, 'language', 'get').mockReturnValue('en-US')
+ await initI18n()
+ sessionStore.setState({ status: 'authenticated', user: { id: 1, username: 'tom', is_admin: false } })
+ usePlayer.setState({ queue: [], original: [], index: 0, playing: false, positionMs: 0 })
+})
+
+test.each([
+ [2, 'Good evening'],
+ [5, 'Good morning'],
+ [8, 'Good morning'],
+ [11, 'Good morning'],
+ [12, 'Good afternoon'],
+ [17, 'Good afternoon'],
+ [18, 'Good evening'],
+ [23, 'Good evening'],
+])('at %i o\'clock the greeting is %s', async (hour, greeting) => {
+ vi.useFakeTimers({ toFake: ['Date'] })
+ vi.setSystemTime(new Date(2026, 10, 12, hour, 30))
+ mockFetch(routes())
+ renderHome()
+ expect(screen.getByRole('heading', { level: 1, name: greeting })).toBeInTheDocument()
+})
+
+test('the history is asked for as counted listens, 30 at most', async () => {
+ const { calls } = mockFetch(routes())
+ renderHome()
+ await screen.findByRole('button', { name: 'Song 1' })
+ const call = calls.find((c) => c.key === 'GET /api/v1/listens')!
+ expect(call.url.searchParams.get('counted')).toBe('true')
+ expect(call.url.searchParams.get('limit')).toBe('30')
+})
+
+test('a song listened to many times is one tile', async () => {
+ mockFetch(routes({ 'GET /api/v1/listens': () => page([listen(1, 0), listen(1, 1), listen(2, 2), listen(1, 3), listen(3, 4)]) }))
+ renderHome()
+ const shelf = await screen.findByRole('region', { name: 'Recently played' })
+ expect(await within(shelf).findAllByRole('button')).toHaveLength(3)
+})
+
+test('at most six songs are shown, the most recent first', async () => {
+ const items = Array.from({ length: 8 }, (_, i) => listen(i + 1, i))
+ mockFetch(routes({ 'GET /api/v1/listens': () => page(items) }))
+ renderHome()
+ const shelf = await screen.findByRole('region', { name: 'Recently played' })
+ const names = (await within(shelf).findAllByRole('button')).map((b) => b.textContent)
+ expect(names).toEqual(['Song 1', 'Song 2', 'Song 3', 'Song 4', 'Song 5', 'Song 6'])
+})
+
+test('a click on a recent song fetches it and plays it', async () => {
+ const { calls } = mockFetch(routes({ 'GET /api/v1/tracks/2': () => track(2) }))
+ renderHome()
+ await userEvent.click(await screen.findByRole('button', { name: 'Song 2' }))
+ await vi.waitFor(() => expect(usePlayer.getState().queue.map((t) => t.id)).toEqual([2]))
+ expect(usePlayer.getState().playing).toBe(true)
+ expect(calls.some((c) => c.key === 'GET /api/v1/tracks/2')).toBe(true)
+})
+
+test('a recent song that is gone from the library says so and plays nothing', async () => {
+ mockFetch(routes({ 'GET /api/v1/tracks/2': () => apiError(404, 'track_not_found') }))
+ renderHome()
+ await userEvent.click(await screen.findByRole('button', { name: 'Song 2' }))
+ expect(await screen.findByText('That song is no longer in your library.')).toBeInTheDocument()
+ expect(usePlayer.getState().queue).toEqual([])
+})
+
+test('with no history it says to play something', async () => {
+ mockFetch(routes({ 'GET /api/v1/listens': () => page([]) }))
+ renderHome()
+ expect(await screen.findByText('Play something and it will show up here.')).toBeInTheDocument()
+})
+
+test('albums and artists have their own shelves with links to their pages', async () => {
+ mockFetch(routes())
+ renderHome()
+ const albums = await screen.findByRole('region', { name: 'Albums' })
+ expect(await within(albums).findByRole('link', { name: /OK Computer/ })).toHaveAttribute('href', '/albums/9')
+ const artists = await screen.findByRole('region', { name: 'Artists' })
+ expect(await within(artists).findByRole('link', { name: /Radiohead/ })).toHaveAttribute('href', '/artists/5')
+})
+
+test('a shelf with more than ten items links to the whole list', async () => {
+ mockFetch(routes({ 'GET /api/v1/albums': () => page([album], 40) }))
+ renderHome()
+ const albums = await screen.findByRole('region', { name: 'Albums' })
+ expect(await within(albums).findByRole('link', { name: 'See all' })).toHaveAttribute('href', '/albums')
+})
+
+test('an empty library says so instead of showing empty shelves', async () => {
+ mockFetch(routes({
+ 'GET /api/v1/listens': () => page([]),
+ 'GET /api/v1/albums': () => page([]),
+ 'GET /api/v1/artists': () => page([]),
+ }))
+ renderHome()
+ expect(await screen.findByText(/Your library is empty/)).toBeInTheDocument()
+ expect(screen.queryByRole('region', { name: 'Albums' })).not.toBeInTheDocument()
+})
+
+test('when the history cannot be read the shelves of albums and artists still show', async () => {
+ mockFetch(routes({ 'GET /api/v1/listens': () => apiError(500, 'internal') }))
+ renderHome()
+ expect(await screen.findByRole('link', { name: /OK Computer/ })).toBeInTheDocument()
+ expect(await screen.findByRole('alert')).toHaveTextContent('Something went wrong. Try again.')
+})
diff --git a/web/src/pages/HomePage.tsx b/web/src/pages/HomePage.tsx
new file mode 100644
index 0000000..79c601d
--- /dev/null
+++ b/web/src/pages/HomePage.tsx
@@ -0,0 +1,138 @@
+import { useQueryClient } from '@tanstack/react-query'
+import { useState } from 'react'
+import { useTranslation } from 'react-i18next'
+import { Link } from 'react-router-dom'
+import { useAlbumList, useArtistList, type Track } from '@/api/catalog'
+import { api, ApiError } from '@/api/client'
+import { useRecentListens } from '@/api/listens'
+import { AlbumCard, ArtistCard, CARD_GRID } from '@/components/cards'
+import Section from '@/components/Section'
+import { EmptyMessage, ErrorMessage, Loading } from '@/components/Status'
+import { errorMessageKey } from '@/i18n'
+import { usePlayer } from '@/player/store'
+
+/** How many recent songs, albums and artists the page shows. */
+const RECENT = 6
+const SHELF = 10
+
+function greetingKey(hour: number): string {
+ if (hour >= 5 && hour < 12) return 'home.greeting_morning'
+ if (hour >= 12 && hour < 18) return 'home.greeting_afternoon'
+ return 'home.greeting_evening'
+}
+
+export default function HomePage() {
+ const { t } = useTranslation()
+ const queryClient = useQueryClient()
+ const playTracks = usePlayer((s) => s.playTracks)
+ const history = useRecentListens()
+ const albums = useAlbumList({ pageSize: SHELF })
+ const artists = useArtistList(undefined, { pageSize: SHELF })
+ const [playError, setPlayError] = useState(null)
+ // Read once per visit of the page: the greeting does not need to change while it is open.
+ const [hour] = useState(() => new Date().getHours())
+
+ // The same song listened to again and again is one tile; the most recent listen comes first.
+ const recent = [...new Map((history.data?.items ?? []).map((l) => [l.track.id, l.track])).values()].slice(0, RECENT)
+ const albumItems = albums.data?.items ?? []
+ const artistItems = artists.data?.items ?? []
+ const libraryEmpty = albums.data?.total === 0 && artists.data?.total === 0
+
+ async function play(id: number) {
+ try {
+ const track = await queryClient.fetchQuery({
+ queryKey: ['track', id],
+ queryFn: () => api.get(`/tracks/${id}`),
+ staleTime: 60_000,
+ })
+ setPlayError(null)
+ playTracks([track], 0)
+ } catch (e) {
+ const gone = e instanceof ApiError && e.status === 404
+ setPlayError(gone ? t('home.trackGone') : t(errorMessageKey(e instanceof ApiError ? e.code : 'unknown')))
+ }
+ }
+
+ return (
+
+
{t(greetingKey(hour))}
+
+ {libraryEmpty ? (
+
{t('home.emptyLibrary')}
+ ) : (
+ <>
+
+ {history.isError ? (
+ history.refetch()} />
+ ) : history.isPending ? (
+
+ ) : recent.length === 0 ? (
+ {t('home.nothingPlayed')}
+ ) : (
+
+ {recent.map((track) => (
+
+ play(track.id)}
+ className="flex min-h-14 w-full items-center rounded-lg bg-secondary px-4 text-left font-bold hover:bg-accent"
+ >
+ {track.title}
+
+
+ ))}
+
+ )}
+ {playError && (
+
+ {playError}
+
+ )}
+
+
+ {albums.isError ? (
+
albums.refetch()} />
+ ) : (
+ albumItems.length > 0 && (
+
+
+ {albumItems.map((album) => (
+
+
+
+ ))}
+
+ {(albums.data?.total ?? 0) > albumItems.length && (
+
+ {t('common.seeAll')}
+
+ )}
+
+ )
+ )}
+
+ {artists.isError ? (
+ artists.refetch()} />
+ ) : (
+ artistItems.length > 0 && (
+
+
+ {artistItems.map((artist) => (
+
+
+
+ ))}
+
+ {(artists.data?.total ?? 0) > artistItems.length && (
+
+ {t('common.seeAll')}
+
+ )}
+
+ )
+ )}
+ >
+ )}
+
+ )
+}
diff --git a/web/src/pages/NotFoundPage.tsx b/web/src/pages/NotFoundPage.tsx
new file mode 100644
index 0000000..5e1a305
--- /dev/null
+++ b/web/src/pages/NotFoundPage.tsx
@@ -0,0 +1,14 @@
+import { Link } from 'react-router-dom'
+import { useTranslation } from 'react-i18next'
+
+export default function NotFoundPage() {
+ const { t } = useTranslation()
+ return (
+
+
{t('common.notFound')}
+
+ {t('common.backHome')}
+
+
+ )
+}
diff --git a/web/src/pages/SearchPage.test.tsx b/web/src/pages/SearchPage.test.tsx
new file mode 100644
index 0000000..31e16b1
--- /dev/null
+++ b/web/src/pages/SearchPage.test.tsx
@@ -0,0 +1,176 @@
+import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
+import { fireEvent, render, screen, within } from '@testing-library/react'
+import userEvent from '@testing-library/user-event'
+import { MemoryRouter, Route, Routes, useLocation } from 'react-router-dom'
+import { beforeEach, expect, test, vi } from 'vitest'
+import { sessionStore } from '@/auth/session'
+import { initI18n } from '@/i18n'
+import { usePlayer } from '@/player/store'
+import { mockFetch, type MockRoutes } from '@/test/mockFetch'
+import SearchPage from './SearchPage'
+
+const wait = (ms: number) => new Promise((r) => setTimeout(r, ms))
+
+const page = (items: object[], total = items.length) => ({ items, total, limit: 6, offset: 0 })
+const artist = (i: number) => ({ id: i + 1, name: `Artist ${i}`, album_count: 1, track_count: 3 })
+const album = (i: number) => ({ id: i + 20, title: `Album ${i}`, artist: { id: 1, name: 'Björk' }, track_count: 9, duration_ms: 1 })
+const song = (i: number) => ({
+ id: i + 100,
+ title: `Song ${i}`,
+ duration_ms: 200_000,
+ track_no: i + 1,
+ disc_no: 1,
+ album: null,
+ artists: [{ id: 1, name: 'Björk' }],
+ format: 'mp3',
+})
+
+function routes(over: MockRoutes = {}): MockRoutes {
+ return {
+ 'GET /api/v1/artists': () => page(Array.from({ length: 6 }, (_, i) => artist(i)), 10),
+ 'GET /api/v1/albums': () => page([album(0), album(1)]),
+ 'GET /api/v1/tracks': () => page([song(0), song(1)]),
+ ...over,
+ }
+}
+
+function Location() {
+ return {useLocation().pathname + useLocation().search}
+}
+
+function renderSearch(path = '/search') {
+ const client = new QueryClient({ defaultOptions: { queries: { retry: false } } })
+ return render(
+
+
+
+
+ } />
+
+
+ ,
+ )
+}
+
+const box = () => screen.getByRole('searchbox', { name: 'Search your library' })
+
+beforeEach(async () => {
+ vi.spyOn(navigator, 'language', 'get').mockReturnValue('en-US')
+ await initI18n()
+ sessionStore.setState({ status: 'authenticated', user: { id: 1, username: 'tom', is_admin: false } })
+ usePlayer.setState({ queue: [], original: [], index: 0, playing: false, positionMs: 0 })
+})
+
+test('typing sends one request per list, once, with the text as it was typed', async () => {
+ const { calls } = mockFetch(routes())
+ renderSearch()
+ await userEvent.type(box(), 'bjork')
+ expect(await screen.findByRole('region', { name: 'Artists' })).toBeInTheDocument()
+ for (const key of ['GET /api/v1/artists', 'GET /api/v1/albums', 'GET /api/v1/tracks']) {
+ const sent = calls.filter((c) => c.key === key)
+ expect(sent).toHaveLength(1)
+ expect(sent[0].url.searchParams.get('q')).toBe('bjork')
+ expect(sent[0].url.searchParams.get('limit')).toBe('6')
+ }
+})
+
+test('the results come in three groups', async () => {
+ mockFetch(routes())
+ renderSearch()
+ await userEvent.type(box(), 'bjork')
+ const artists = await screen.findByRole('region', { name: 'Artists' })
+ const albums = await screen.findByRole('region', { name: 'Albums' })
+ const songs = await screen.findByRole('region', { name: 'Songs' })
+ expect(within(artists).getAllByRole('link', { name: /Artist \d/ })).toHaveLength(6)
+ expect(within(albums).getAllByRole('link', { name: /Album \d/ })).toHaveLength(2)
+ expect(within(songs).getAllByRole('button', { name: /Song \d/ })).toHaveLength(2)
+})
+
+test('a group with more results than shown links to the full list with the same search', async () => {
+ mockFetch(routes())
+ renderSearch()
+ await userEvent.type(box(), 'bjork')
+ const artists = await screen.findByRole('region', { name: 'Artists' })
+ expect(within(artists).getByRole('link', { name: 'See all' })).toHaveAttribute('href', '/artists?q=bjork')
+ const albums = await screen.findByRole('region', { name: 'Albums' })
+ expect(within(albums).queryByRole('link', { name: 'See all' })).not.toBeInTheDocument()
+})
+
+test('a click on a found song plays it', async () => {
+ mockFetch(routes())
+ renderSearch()
+ await userEvent.type(box(), 'bjork')
+ await userEvent.click(await screen.findByRole('button', { name: /Song 1/ }))
+ expect(usePlayer.getState().queue.map((t) => t.id)).toEqual([100, 101])
+ expect(usePlayer.getState().index).toBe(1)
+})
+
+test('with nothing typed there is a hint and no request', async () => {
+ const { calls } = mockFetch(routes())
+ renderSearch()
+ await wait(350)
+ expect(screen.getByText('Type to search artists, albums and songs.')).toBeInTheDocument()
+ expect(calls).toHaveLength(0)
+})
+
+test('text that is only spaces is not a search', async () => {
+ const { calls } = mockFetch(routes())
+ renderSearch()
+ await userEvent.type(box(), ' ')
+ await wait(350)
+ expect(calls).toHaveLength(0)
+})
+
+test('a search in the address fills the box and runs at once', async () => {
+ const { calls } = mockFetch(routes())
+ renderSearch('/search?q=x')
+ expect(box()).toHaveValue('x')
+ expect(await screen.findByRole('region', { name: 'Artists' })).toBeInTheDocument()
+ expect(calls[0].url.searchParams.get('q')).toBe('x')
+})
+
+test('the address follows what was typed', async () => {
+ mockFetch(routes())
+ renderSearch()
+ await userEvent.type(box(), 'bjork')
+ await screen.findByRole('region', { name: 'Artists' })
+ expect(screen.getByTestId('location')).toHaveTextContent('/search?q=bjork')
+ await userEvent.clear(box())
+ await wait(350)
+ expect(screen.getByTestId('location')).toHaveTextContent(/^\/search$/)
+})
+
+test('a search longer than the server accepts is cut to 200 characters', async () => {
+ const { calls } = mockFetch(routes())
+ renderSearch()
+ fireEvent.change(box(), { target: { value: 'a'.repeat(201) } })
+ await screen.findByRole('region', { name: 'Artists' })
+ expect(calls[0].url.searchParams.get('q')).toHaveLength(200)
+})
+
+test('accents and capitals are left to the server', async () => {
+ const { calls } = mockFetch(routes())
+ renderSearch()
+ fireEvent.change(box(), { target: { value: 'BJÖRK' } })
+ await screen.findByRole('region', { name: 'Artists' })
+ expect(calls[0].url.searchParams.get('q')).toBe('BJÖRK')
+})
+
+test('when nothing matches it says so', async () => {
+ mockFetch(routes({
+ 'GET /api/v1/artists': () => page([]),
+ 'GET /api/v1/albums': () => page([]),
+ 'GET /api/v1/tracks': () => page([]),
+ }))
+ renderSearch()
+ await userEvent.type(box(), 'zzz')
+ expect(await screen.findByText('Nothing found for “zzz”.')).toBeInTheDocument()
+})
+
+test('a group with no results is left out', async () => {
+ mockFetch(routes({ 'GET /api/v1/albums': () => page([]) }))
+ renderSearch()
+ await userEvent.type(box(), 'bjork')
+ await screen.findByRole('region', { name: 'Artists' })
+ expect(screen.queryByRole('region', { name: 'Albums' })).not.toBeInTheDocument()
+})
diff --git a/web/src/pages/SearchPage.tsx b/web/src/pages/SearchPage.tsx
new file mode 100644
index 0000000..a0256c6
--- /dev/null
+++ b/web/src/pages/SearchPage.tsx
@@ -0,0 +1,112 @@
+import { useEffect, useState } from 'react'
+import { useTranslation } from 'react-i18next'
+import { Link, useSearchParams } from 'react-router-dom'
+import { useAlbumList, useArtistList, useTrackList } from '@/api/catalog'
+import { AlbumCard, ArtistCard, CARD_GRID } from '@/components/cards'
+import Section from '@/components/Section'
+import { EmptyMessage, ErrorMessage, Loading } from '@/components/Status'
+import TrackList from '@/components/TrackList'
+import { Input } from '@/components/ui/input'
+
+/** Wait this long after the last keystroke before asking the server. */
+const DEBOUNCE_MS = 250
+/** What the server accepts as search text. */
+const MAX_QUERY_LENGTH = 200
+/** How many of each kind are shown; the rest is one click away. */
+const SHOWN = 6
+
+export default function SearchPage() {
+ const { t } = useTranslation()
+ const [params, setParams] = useSearchParams()
+ const [text, setText] = useState(params.get('q') ?? '')
+ const [typed, setTyped] = useState(text)
+
+ useEffect(() => {
+ const timer = setTimeout(() => setTyped(text), DEBOUNCE_MS)
+ return () => clearTimeout(timer)
+ }, [text])
+
+ // Searching by spaces is not searching; the server takes at most 200 characters.
+ const q = Array.from(typed.trim()).slice(0, MAX_QUERY_LENGTH).join('')
+ const enabled = q !== ''
+
+ useEffect(() => {
+ setParams(q ? { q } : {}, { replace: true })
+ }, [q, setParams])
+
+ const list = { pageSize: SHOWN, enabled }
+ const artists = useArtistList(q, list)
+ const albums = useAlbumList({ q, ...list })
+ const songs = useTrackList({ q, ...list })
+ const all = [artists, albums, songs]
+ const failed = all.find((query) => query.isError)
+
+ const seeAll = (page: string) => (
+
+ {t('common.seeAll')}
+
+ )
+
+ return (
+
+
{t('nav.search')}
+
+
+ {t('search.label')}
+
+ setText(e.target.value)}
+ className="h-12 rounded-md px-5"
+ />
+
+
+ {!enabled ? (
+
{t('search.hint')}
+ ) : failed ? (
+
all.forEach((query) => query.refetch())} />
+ ) : all.some((query) => query.isPending) ? (
+
+ ) : all.every((query) => (query.data?.items.length ?? 0) === 0) ? (
+ {t('search.nothingFound', { q })}
+ ) : (
+ <>
+ {(artists.data?.items.length ?? 0) > 0 && (
+
+
+ {artists.data!.items.map((artist) => (
+
+
+
+ ))}
+
+ {artists.data!.total > artists.data!.items.length && seeAll('artists')}
+
+ )}
+ {(albums.data?.items.length ?? 0) > 0 && (
+
+
+ {albums.data!.items.map((album) => (
+
+
+
+ ))}
+
+ {albums.data!.total > albums.data!.items.length && seeAll('albums')}
+
+ )}
+ {(songs.data?.items.length ?? 0) > 0 && (
+
+
+ {songs.data!.total > songs.data!.items.length && seeAll('songs')}
+
+ )}
+ >
+ )}
+
+ )
+}
diff --git a/web/src/pages/SettingsPage.test.tsx b/web/src/pages/SettingsPage.test.tsx
new file mode 100644
index 0000000..db500ab
--- /dev/null
+++ b/web/src/pages/SettingsPage.test.tsx
@@ -0,0 +1,162 @@
+import { render, screen } from '@testing-library/react'
+import userEvent from '@testing-library/user-event'
+import { MemoryRouter } from 'react-router-dom'
+import { beforeEach, expect, test, vi } from 'vitest'
+import { sessionStore } from '@/auth/session'
+import { initI18n } from '@/i18n'
+import { usePlayer } from '@/player/store'
+import { apiError, mockFetch } from '@/test/mockFetch'
+import { initTheme } from '@/theme/theme'
+import SettingsPage from './SettingsPage'
+
+const noContent = () => new Response(null, { status: 204 })
+
+function renderSettings() {
+ return render(
+
+
+ ,
+ )
+}
+
+beforeEach(async () => {
+ vi.spyOn(navigator, 'language', 'get').mockReturnValue('en-US')
+ await initI18n()
+ initTheme()
+ sessionStore.setState({
+ status: 'authenticated',
+ user: { id: 1, username: 'tom', is_admin: true },
+ accessToken: 'a1',
+ accessExpiresAt: Date.now() + 600_000,
+ refreshToken: 'r1',
+ })
+})
+
+async function changePassword(current: string, next: string) {
+ await userEvent.type(screen.getByLabelText('Current password'), current)
+ await userEvent.type(screen.getByLabelText('New password'), next)
+ await userEvent.click(screen.getByRole('button', { name: 'Change password' }))
+}
+
+test('the page says who is signed in', () => {
+ renderSettings()
+ expect(screen.getByText('tom')).toBeInTheDocument()
+ expect(screen.getByText('Admin')).toBeInTheDocument()
+})
+
+test('a user who is not an admin is not called one', () => {
+ sessionStore.setState({ user: { id: 2, username: 'ann', is_admin: false } })
+ renderSettings()
+ expect(screen.getByText('ann')).toBeInTheDocument()
+ expect(screen.queryByText('Admin')).not.toBeInTheDocument()
+})
+
+test('each group of choices has a label you can see, not only one for screen readers', () => {
+ renderSettings()
+ expect(screen.getByText('Theme')).toBeVisible()
+ expect(screen.getByText('Language')).toBeVisible()
+ expect(screen.getByRole('radiogroup', { name: 'Theme' })).toBeInTheDocument()
+ expect(screen.getByRole('radiogroup', { name: 'Language' })).toBeInTheDocument()
+})
+
+test('all six themes can be chosen and the current one is selected', async () => {
+ renderSettings()
+ const group = screen.getByRole('radiogroup', { name: 'Theme' })
+ expect(group).toBeInTheDocument()
+ for (const name of ['Sonda', 'Tokyo Night', 'Gruvbox dark', 'Gruvbox light', 'Dracula', 'Neon']) {
+ expect(screen.getByRole('radio', { name })).toBeInTheDocument()
+ }
+ expect(screen.getByRole('radio', { name: 'Sonda' })).toBeChecked()
+})
+
+test('choosing Gruvbox light changes the theme of the page and remembers it', async () => {
+ renderSettings()
+ await userEvent.click(screen.getByRole('radio', { name: 'Gruvbox light' }))
+ expect(document.documentElement.dataset.theme).toBe('gruvbox-light')
+ expect(localStorage.getItem('sonda.theme')).toBe('gruvbox-light')
+ expect(screen.getByRole('radio', { name: 'Gruvbox light' })).toBeChecked()
+})
+
+test('the theme can be chosen with the keyboard', async () => {
+ renderSettings()
+ screen.getByRole('radio', { name: 'Sonda' }).focus()
+ await userEvent.keyboard('{ArrowDown}')
+ expect(document.documentElement.dataset.theme).toBe('tokyo-night')
+})
+
+test('choosing Italian changes the words on the page', async () => {
+ renderSettings()
+ expect(screen.getByRole('heading', { level: 1, name: 'Settings' })).toBeInTheDocument()
+ await userEvent.click(screen.getByRole('radio', { name: 'Italiano' }))
+ expect(await screen.findByRole('heading', { level: 1, name: 'Impostazioni' })).toBeInTheDocument()
+ expect(document.documentElement.lang).toBe('it')
+ expect(localStorage.getItem('sonda.lang')).toBe('it')
+})
+
+test('a new password of seven characters is refused here, with no request', async () => {
+ const { calls } = mockFetch({})
+ renderSettings()
+ await changePassword('old-password', '1234567')
+ expect(await screen.findByRole('alert')).toHaveTextContent('The new password needs 8 to 256 characters.')
+ expect(calls).toHaveLength(0)
+})
+
+test('a new password longer than 256 bytes is refused here, with no request', async () => {
+ const { calls } = mockFetch({})
+ renderSettings()
+ await userEvent.type(screen.getByLabelText('Current password'), 'old-password')
+ await userEvent.click(screen.getByLabelText('New password'))
+ await userEvent.paste('x'.repeat(257))
+ await userEvent.click(screen.getByRole('button', { name: 'Change password' }))
+ expect(await screen.findByRole('alert')).toHaveTextContent('8 to 256')
+ expect(calls).toHaveLength(0)
+})
+
+test('a changed password signs this session out, because the server ends every session', async () => {
+ const { calls } = mockFetch({
+ 'POST /api/v1/auth/password': noContent,
+ 'POST /api/v1/auth/logout': noContent,
+ })
+ renderSettings()
+ await changePassword('old-password', 'new-password-1')
+ await vi.waitFor(() => expect(sessionStore.getState().status).toBe('anonymous'))
+ const change = calls.find((c) => c.key === 'POST /api/v1/auth/password')!
+ expect(JSON.parse(change.init.body as string)).toEqual({
+ current_password: 'old-password',
+ new_password: 'new-password-1',
+ })
+})
+
+test('a wrong current password is explained and keeps the session', async () => {
+ mockFetch({ 'POST /api/v1/auth/password': () => apiError(403, 'invalid_credentials') })
+ renderSettings()
+ await changePassword('not-my-password', 'new-password-1')
+ expect(await screen.findByRole('alert')).toHaveTextContent('The current password is wrong.')
+ expect(sessionStore.getState().status).toBe('authenticated')
+})
+
+test('a password change that fails for another reason says so', async () => {
+ mockFetch({ 'POST /api/v1/auth/password': () => apiError(500, 'internal') })
+ renderSettings()
+ await changePassword('old-password', 'new-password-1')
+ expect(await screen.findByRole('alert')).toHaveTextContent('Something went wrong. Try again.')
+})
+
+test('signing out also stops the music, so the next person does not inherit the queue', async () => {
+ mockFetch({ 'POST /api/v1/auth/logout': noContent, 'POST /api/v1/listens': () => ({ status: 'recorded', counted: false }) })
+ usePlayer.getState().playTracks([
+ { id: 1, title: 'Airbag', duration_ms: 1000, track_no: 1, disc_no: 1, album: null, artists: [], format: 'mp3' },
+ ])
+ renderSettings()
+ await userEvent.click(screen.getByRole('button', { name: 'Sign out' }))
+ await vi.waitFor(() => expect(sessionStore.getState().status).toBe('anonymous'))
+ expect(usePlayer.getState().queue).toEqual([])
+ expect(usePlayer.getState().playing).toBe(false)
+})
+
+test('signing out forgets the session', async () => {
+ mockFetch({ 'POST /api/v1/auth/logout': noContent })
+ renderSettings()
+ await userEvent.click(screen.getByRole('button', { name: 'Sign out' }))
+ await vi.waitFor(() => expect(sessionStore.getState().status).toBe('anonymous'))
+})
diff --git a/web/src/pages/SettingsPage.tsx b/web/src/pages/SettingsPage.tsx
new file mode 100644
index 0000000..00f355e
--- /dev/null
+++ b/web/src/pages/SettingsPage.tsx
@@ -0,0 +1,144 @@
+import { useState, type FormEvent } from 'react'
+import { useTranslation } from 'react-i18next'
+import { api, ApiError } from '@/api/client'
+import { logout, useSession } from '@/auth/session'
+import ChoiceGroup from '@/components/ChoiceGroup'
+import Section from '@/components/Section'
+import { Button } from '@/components/ui/button'
+import { Input } from '@/components/ui/input'
+import { Label } from '@/components/ui/label'
+import { errorMessageKey, useLanguage, type Lang } from '@/i18n'
+import { usePlayer } from '@/player/store'
+import { THEMES, useTheme, type ThemeId } from '@/theme/theme'
+
+const MIN_PASSWORD_BYTES = 8
+const MAX_PASSWORD_BYTES = 256
+
+/** Stops the music first, so that the play in progress is reported while the session is still valid. */
+async function leave() {
+ usePlayer.getState().playTracks([])
+ await logout()
+}
+
+/** The colours of a theme in three stripes. The attribute makes the stripes use that theme's variables. */
+function ThemePreview({ id }: { id: ThemeId }) {
+ return (
+
+
+
+
+
+ )
+}
+
+function ChangePassword() {
+ const { t } = useTranslation()
+ const [current, setCurrent] = useState('')
+ const [next, setNext] = useState('')
+ const [error, setError] = useState(null)
+ const [busy, setBusy] = useState(false)
+
+ async function submit(event: FormEvent) {
+ event.preventDefault()
+ setError(null)
+ // The server counts bytes, not characters.
+ const bytes = new TextEncoder().encode(next).length
+ if (bytes < MIN_PASSWORD_BYTES || bytes > MAX_PASSWORD_BYTES) {
+ setError(t('settings.passwordLength'))
+ return
+ }
+ setBusy(true)
+ try {
+ await api.post('/auth/password', { current_password: current, new_password: next })
+ // The server ended every session of this account, this one included: go back to the sign-in screen.
+ await leave()
+ } catch (e) {
+ const wrong = e instanceof ApiError && e.status === 403 && e.code === 'invalid_credentials'
+ setError(wrong ? t('settings.currentPasswordWrong') : t(errorMessageKey(e instanceof ApiError ? e.code : 'unknown')))
+ setBusy(false)
+ }
+ }
+
+ return (
+
+ )
+}
+
+export default function SettingsPage() {
+ const { t } = useTranslation()
+ const { user } = useSession()
+ const { theme, setTheme } = useTheme()
+ const { lang, setLanguage } = useLanguage()
+
+ return (
+
+
{t('nav.settings')}
+
+
+
+
{user?.username}
+ {user?.is_admin && (
+
{t('settings.admin')}
+ )}
+
void leave()}>
+ {t('settings.signOut')}
+
+
+
+
+
+ ({ value: th.id, label: t(th.labelKey), preview: }))}
+ />
+
+ label={t('settings.language')}
+ value={lang}
+ onChange={(value) => void setLanguage(value)}
+ choices={[
+ { value: 'en', label: t('lang.en') },
+ { value: 'it', label: t('lang.it') },
+ ]}
+ />
+
+
+
+
+ )
+}
diff --git a/web/src/pages/SongsPage.tsx b/web/src/pages/SongsPage.tsx
new file mode 100644
index 0000000..0d0720b
--- /dev/null
+++ b/web/src/pages/SongsPage.tsx
@@ -0,0 +1,32 @@
+import { useTranslation } from 'react-i18next'
+import { useSearchParams } from 'react-router-dom'
+import { useTrackList } from '@/api/catalog'
+import LoadMore from '@/components/LoadMore'
+import { EmptyMessage, ErrorMessage, Loading } from '@/components/Status'
+import TrackList from '@/components/TrackList'
+
+export default function SongsPage() {
+ const { t } = useTranslation()
+ const [params] = useSearchParams()
+ const q = params.get('q') ?? ''
+ const query = useTrackList({ q })
+ const items = query.data?.items ?? []
+
+ return (
+
+
{t('nav.songs')}
+ {query.isError ? (
+ query.refetch()} />
+ ) : query.isPending ? (
+
+ ) : items.length === 0 ? (
+ {q ? t('empty.noMatch', { q }) : t('empty.songs')}
+ ) : (
+ <>
+
+
+ >
+ )}
+
+ )
+}
diff --git a/web/src/pages/pages.test.tsx b/web/src/pages/pages.test.tsx
new file mode 100644
index 0000000..6f987d2
--- /dev/null
+++ b/web/src/pages/pages.test.tsx
@@ -0,0 +1,449 @@
+import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
+import { fireEvent, render, screen, waitFor, within } from '@testing-library/react'
+import userEvent from '@testing-library/user-event'
+import type { ReactElement } from 'react'
+import { MemoryRouter, Route, Routes } from 'react-router-dom'
+import { beforeEach, expect, test, vi } from 'vitest'
+import { sessionStore } from '@/auth/session'
+import { initI18n } from '@/i18n'
+import { usePlayer } from '@/player/store'
+import { apiError, mockFetch, type MockRoutes } from '@/test/mockFetch'
+import AlbumPage from './AlbumPage'
+import AlbumsPage from './AlbumsPage'
+import ArtistPage from './ArtistPage'
+import ArtistsPage from './ArtistsPage'
+import SongsPage from './SongsPage'
+
+// --- fixtures --------------------------------------------------------------------------------
+
+const artistRef = { id: 5, name: 'Radiohead' }
+
+function track(n: number, over: object = {}) {
+ return {
+ id: n,
+ title: `Song ${n}`,
+ duration_ms: 200_000,
+ track_no: n,
+ disc_no: 1,
+ album: { id: 9, title: 'OK Computer' },
+ artists: [artistRef],
+ format: 'flac',
+ ...over,
+ }
+}
+
+const page = (items: object[], total = items.length) => ({ items, total, limit: 50, offset: 0 })
+
+/** The server pages a list of `total` generated items, 50 at a time. */
+function paged(total: number, make: (i: number) => object) {
+ return ({ url }: { url: URL }) => {
+ const limit = Number(url.searchParams.get('limit') ?? 50)
+ const offset = Number(url.searchParams.get('offset') ?? 0)
+ const items = Array.from({ length: Math.max(0, Math.min(limit, total - offset)) }, (_, i) => make(offset + i))
+ return { items, total, limit, offset }
+ }
+}
+
+const album = { id: 9, title: 'OK Computer', artist: artistRef, track_count: 3, duration_ms: 3_600_000 }
+const artist = { id: 5, name: 'Radiohead', album_count: 1, track_count: 3 }
+
+const wikipedia = {
+ provider: 'wikipedia',
+ provider_status: 'ok',
+ stale: false,
+ retrieved_at: '2026-11-01T00:00:00Z',
+ attribution: 'Text from Wikipedia (CC BY-SA 4.0)',
+ description: {
+ text: 'English rock band formed in Abingdon.',
+ short: 'English rock band',
+ language: 'en',
+ title: 'Radiohead',
+ url: 'https://en.wikipedia.org/wiki/Radiohead',
+ license: 'CC BY-SA 4.0',
+ license_url: 'https://creativecommons.org/licenses/by-sa/4.0/',
+ },
+}
+
+const similarOff = {
+ provider: 'lastfm',
+ provider_status: 'disabled',
+ stale: false,
+ retrieved_at: null,
+ attribution: '',
+ items: [],
+}
+
+const tagsOff = {
+ sources: [
+ { provider: 'files', provider_status: 'ok', stale: false, retrieved_at: null, attribution: '', tags: [] },
+ { provider: 'lastfm', provider_status: 'disabled', stale: false, retrieved_at: null, attribution: '', tags: [] },
+ ],
+}
+
+const descriptionOff = { ...wikipedia, provider_status: 'disabled', retrieved_at: null, description: null }
+
+/** Everything an artist page asks for, with the providers off (the default); a test overrides what it needs. */
+function artistRoutes(over: MockRoutes = {}): MockRoutes {
+ return {
+ 'GET /api/v1/artists/5': () => artist,
+ 'GET /api/v1/albums': () => page([album]),
+ 'GET /api/v1/tracks': () => page([track(1), track(2), track(3)]),
+ 'GET /api/v1/artists/5/description': () => descriptionOff,
+ 'GET /api/v1/artists/5/similar': () => similarOff,
+ 'GET /api/v1/artists/5/tags': () => tagsOff,
+ 'GET /api/v1/artists/5/image/credit': () => apiError(404, 'provider_disabled'),
+ ...over,
+ }
+}
+
+function renderPage(element: ReactElement, path: string, routePath = path) {
+ const client = new QueryClient({ defaultOptions: { queries: { retry: false } } })
+ return render(
+
+
+
+
+
+
+ ,
+ )
+}
+
+beforeEach(async () => {
+ vi.spyOn(navigator, 'language', 'get').mockReturnValue('en-US')
+ await initI18n()
+ sessionStore.setState({ status: 'authenticated', user: { id: 1, username: 'tom', is_admin: false } })
+ usePlayer.setState({
+ queue: [],
+ original: [],
+ index: 0,
+ playing: false,
+ positionMs: 0,
+ shuffle: false,
+ repeat: 'off',
+ seekMs: null,
+ seekId: 0,
+ playId: 0,
+ })
+})
+
+// --- album page ------------------------------------------------------------------------------
+
+function albumRoutes(over: MockRoutes = {}): MockRoutes {
+ return {
+ 'GET /api/v1/albums/9': () => album,
+ 'GET /api/v1/tracks': () => page([track(1), track(2), track(3)]),
+ ...over,
+ }
+}
+
+test('the album page shows the album, its artist and its songs', async () => {
+ mockFetch(albumRoutes())
+ renderPage( , '/albums/9', '/albums/:id')
+ expect(await screen.findByRole('heading', { level: 1, name: 'OK Computer' })).toBeInTheDocument()
+ expect(screen.getByRole('link', { name: 'Radiohead' })).toHaveAttribute('href', '/artists/5')
+ expect(await screen.findAllByRole('button', { name: /Song \d/ })).toHaveLength(3)
+ expect(screen.getByText(/3 songs/)).toBeInTheDocument()
+})
+
+test('a click on the third song plays the album from that song', async () => {
+ mockFetch(albumRoutes())
+ renderPage( , '/albums/9', '/albums/:id')
+ await userEvent.click(await screen.findByRole('button', { name: /Song 3/ }))
+ expect(usePlayer.getState().queue.map((t) => t.id)).toEqual([1, 2, 3])
+ expect(usePlayer.getState().index).toBe(2)
+ expect(usePlayer.getState().playing).toBe(true)
+})
+
+test('the play button plays the album from the first song', async () => {
+ mockFetch(albumRoutes())
+ renderPage( , '/albums/9', '/albums/:id')
+ await screen.findAllByRole('button', { name: /Song \d/ })
+ await userEvent.click(screen.getByRole('button', { name: 'Play' }))
+ expect(usePlayer.getState().index).toBe(0)
+ expect(usePlayer.getState().queue).toHaveLength(3)
+})
+
+test('the song that is playing is marked in the list', async () => {
+ mockFetch(albumRoutes())
+ renderPage( , '/albums/9', '/albums/:id')
+ const rows = await screen.findAllByRole('button', { name: /Song \d/ })
+ await userEvent.click(rows[1])
+ expect(screen.getByRole('button', { name: /Song 2/ })).toHaveAttribute('aria-current', 'true')
+ expect(screen.getByRole('button', { name: /Song 1/ })).not.toHaveAttribute('aria-current')
+})
+
+test('an album with no artist renders without a link', async () => {
+ mockFetch(albumRoutes({ 'GET /api/v1/albums/9': () => ({ ...album, artist: null }) }))
+ renderPage( , '/albums/9', '/albums/:id')
+ expect(await screen.findByRole('heading', { level: 1, name: 'OK Computer' })).toBeInTheDocument()
+ expect(screen.queryByRole('link', { name: 'Radiohead' })).not.toBeInTheDocument()
+})
+
+test('an album the server does not know says so', async () => {
+ mockFetch(albumRoutes({ 'GET /api/v1/albums/9': () => apiError(404, 'album_not_found') }))
+ renderPage( , '/albums/9', '/albums/:id')
+ expect(await screen.findByText('This album does not exist.')).toBeInTheDocument()
+})
+
+// --- artist page -----------------------------------------------------------------------------
+
+test('the artist page shows the artist with their albums and songs even when every provider is off', async () => {
+ mockFetch(artistRoutes())
+ renderPage( , '/artists/5', '/artists/:id')
+ expect(await screen.findByRole('heading', { level: 1, name: 'Radiohead' })).toBeInTheDocument()
+ expect(await screen.findByRole('link', { name: /OK Computer/ })).toHaveAttribute('href', '/albums/9')
+ expect(await screen.findAllByRole('button', { name: /Song \d/ })).toHaveLength(3)
+})
+
+test('with Wikipedia off the description says how to turn it on and has no link to Wikipedia', async () => {
+ mockFetch(artistRoutes())
+ renderPage( , '/artists/5', '/artists/:id')
+ const about = await screen.findByRole('region', { name: 'About' })
+ expect(await within(about).findByText('Turn on Wikipedia in the server settings to see this.')).toBeInTheDocument()
+ expect(within(about).queryByRole('link')).not.toBeInTheDocument()
+})
+
+test('a Wikipedia description shows its text, the page it comes from and its licence', async () => {
+ mockFetch(artistRoutes({ 'GET /api/v1/artists/5/description': () => wikipedia }))
+ renderPage( , '/artists/5', '/artists/:id')
+ const about = await screen.findByRole('region', { name: 'About' })
+ expect(await within(about).findByText('English rock band formed in Abingdon.')).toBeInTheDocument()
+ expect(within(about).getByRole('link', { name: 'Radiohead' })).toHaveAttribute(
+ 'href',
+ 'https://en.wikipedia.org/wiki/Radiohead',
+ )
+ expect(within(about).getByRole('link', { name: 'CC BY-SA 4.0' })).toHaveAttribute(
+ 'href',
+ 'https://creativecommons.org/licenses/by-sa/4.0/',
+ )
+})
+
+test('a description Wikipedia could not give says so, and an artist with no MusicBrainz id explains why', async () => {
+ mockFetch(artistRoutes({ 'GET /api/v1/artists/5/description': () => ({ ...descriptionOff, provider_status: 'error' }) }))
+ const first = renderPage( , '/artists/5', '/artists/:id')
+ expect(await screen.findByText('Wikipedia could not be reached. Try again later.')).toBeInTheDocument()
+ first.unmount()
+
+ mockFetch(artistRoutes({ 'GET /api/v1/artists/5/description': () => ({ ...descriptionOff, provider_status: 'no_id' }) }))
+ renderPage( , '/artists/5', '/artists/:id')
+ expect(await screen.findByText(/has no MusicBrainz id/)).toBeInTheDocument()
+})
+
+test('when the similar artists fail the albums and songs still show', async () => {
+ mockFetch(
+ artistRoutes({
+ 'GET /api/v1/artists/5/similar': () => ({ ...similarOff, provider_status: 'error' }),
+ }),
+ )
+ renderPage( , '/artists/5', '/artists/:id')
+ const similar = await screen.findByRole('region', { name: 'Similar artists' })
+ expect(await within(similar).findByText('Last.fm could not be reached. Try again later.')).toBeInTheDocument()
+ expect(await screen.findByRole('link', { name: /OK Computer/ })).toBeInTheDocument()
+ expect(await screen.findAllByRole('button', { name: /Song \d/ })).toHaveLength(3)
+})
+
+test('similar artists link to their pages, say which are in the library, and carry the credit', async () => {
+ mockFetch(
+ artistRoutes({
+ 'GET /api/v1/artists/5/similar': () => ({
+ provider: 'lastfm',
+ provider_status: 'ok',
+ stale: false,
+ retrieved_at: '2026-11-01T00:00:00Z',
+ attribution: 'Similar artists from Last.fm',
+ items: [
+ { artist: { id: 6, name: 'Portishead' }, in_library: true, score: 0.9, rank: 1 },
+ { artist: { id: 7, name: 'Massive Attack' }, in_library: false, score: 0.8, rank: 2 },
+ ],
+ }),
+ }),
+ )
+ renderPage( , '/artists/5', '/artists/:id')
+ const similar = await screen.findByRole('region', { name: 'Similar artists' })
+ const portishead = await within(similar).findByRole('link', { name: /Portishead/ })
+ expect(portishead).toHaveAttribute('href', '/artists/6')
+ expect(portishead).toHaveTextContent('In your library')
+ expect(within(similar).getByRole('link', { name: /Massive Attack/ })).not.toHaveTextContent('In your library')
+ expect(within(similar).getByText('Similar artists from Last.fm')).toBeInTheDocument()
+})
+
+test('tags show with their credit when a provider gave some, and say how to turn it on when none did', async () => {
+ mockFetch(
+ artistRoutes({
+ 'GET /api/v1/artists/5/tags': () => ({
+ sources: [
+ {
+ provider: 'lastfm',
+ provider_status: 'ok',
+ stale: false,
+ retrieved_at: '2026-11-01T00:00:00Z',
+ attribution: 'Tags from Last.fm',
+ tags: [
+ { name: 'alternative', weight: 100, genre: true },
+ { name: 'british', weight: 60, genre: false },
+ ],
+ },
+ ],
+ }),
+ }),
+ )
+ const first = renderPage( , '/artists/5', '/artists/:id')
+ const tags = await screen.findByRole('region', { name: 'Tags' })
+ expect(await within(tags).findByText('alternative')).toBeInTheDocument()
+ expect(within(tags).getByText('british')).toBeInTheDocument()
+ expect(within(tags).getByText('Tags from Last.fm')).toBeInTheDocument()
+ first.unmount()
+
+ mockFetch(artistRoutes())
+ renderPage( , '/artists/5', '/artists/:id')
+ const off = await screen.findByRole('region', { name: 'Tags' })
+ expect(await within(off).findByText('Turn on Last.fm in the server settings to see this.')).toBeInTheDocument()
+})
+
+test('only the ten heaviest tags are shown', async () => {
+ const tags = Array.from({ length: 15 }, (_, i) => ({ name: `tag${i}`, weight: 100 - i, genre: false }))
+ mockFetch(
+ artistRoutes({
+ 'GET /api/v1/artists/5/tags': () => ({
+ sources: [
+ { provider: 'lastfm', provider_status: 'ok', stale: false, retrieved_at: null, attribution: 'x', tags },
+ ],
+ }),
+ }),
+ )
+ renderPage( , '/artists/5', '/artists/:id')
+ const region = await screen.findByRole('region', { name: 'Tags' })
+ expect(await within(region).findByText('tag0')).toBeInTheDocument()
+ expect(within(region).getByText('tag9')).toBeInTheDocument()
+ expect(within(region).queryByText('tag10')).not.toBeInTheDocument()
+})
+
+test('with no photo credit the artist shows an initial and no credit line', async () => {
+ mockFetch(artistRoutes())
+ const { container } = renderPage( , '/artists/5', '/artists/:id')
+ await screen.findByRole('heading', { level: 1, name: 'Radiohead' })
+ fireEvent.error(container.querySelector('img[alt="Radiohead"]')!)
+ expect(screen.getByText('R')).toBeInTheDocument()
+ await waitFor(() => expect(screen.queryByText(/Wikimedia Commons/)).not.toBeInTheDocument())
+})
+
+test('a photo credit names the author, the licence and the page of the picture', async () => {
+ mockFetch(
+ artistRoutes({
+ 'GET /api/v1/artists/5/image/credit': () => ({
+ source: 'Wikimedia Commons',
+ author: 'Jane Photographer',
+ license: 'CC BY-SA 4.0',
+ license_url: 'https://creativecommons.org/licenses/by-sa/4.0/',
+ page_url: 'https://commons.wikimedia.org/wiki/File:Radiohead.jpg',
+ }),
+ }),
+ )
+ renderPage( , '/artists/5', '/artists/:id')
+ expect(await screen.findByText(/Jane Photographer/)).toBeInTheDocument()
+ expect(screen.getByRole('link', { name: 'CC BY-SA 4.0' })).toHaveAttribute(
+ 'href',
+ 'https://creativecommons.org/licenses/by-sa/4.0/',
+ )
+ expect(screen.getByRole('link', { name: 'Wikimedia Commons' })).toHaveAttribute(
+ 'href',
+ 'https://commons.wikimedia.org/wiki/File:Radiohead.jpg',
+ )
+})
+
+test('a photo credit that fails with a server error does not break the page', async () => {
+ mockFetch(artistRoutes({ 'GET /api/v1/artists/5/image/credit': () => apiError(502, 'provider_unavailable') }))
+ renderPage( , '/artists/5', '/artists/:id')
+ expect(await screen.findByRole('heading', { level: 1, name: 'Radiohead' })).toBeInTheDocument()
+})
+
+test('an artist a provider named, with nothing to play, still has a page', async () => {
+ mockFetch(
+ artistRoutes({
+ 'GET /api/v1/artists/5': () => ({ ...artist, album_count: 0, track_count: 0 }),
+ 'GET /api/v1/albums': () => page([]),
+ 'GET /api/v1/tracks': () => page([]),
+ }),
+ )
+ renderPage( , '/artists/5', '/artists/:id')
+ expect(await screen.findByRole('heading', { level: 1, name: 'Radiohead' })).toBeInTheDocument()
+ expect(await screen.findByText('Nothing of this artist is in your library.')).toBeInTheDocument()
+})
+
+test('an artist the server does not know says so', async () => {
+ mockFetch(artistRoutes({ 'GET /api/v1/artists/5': () => apiError(404, 'artist_not_found') }))
+ renderPage( , '/artists/5', '/artists/:id')
+ expect(await screen.findByText('This artist does not exist.')).toBeInTheDocument()
+})
+
+test('a click on a song of the artist plays the artist songs from there', async () => {
+ mockFetch(artistRoutes())
+ renderPage( , '/artists/5', '/artists/:id')
+ await userEvent.click(await screen.findByRole('button', { name: /Song 2/ }))
+ expect(usePlayer.getState().queue).toHaveLength(3)
+ expect(usePlayer.getState().index).toBe(1)
+})
+
+// --- lists -----------------------------------------------------------------------------------
+
+const artistItem = (i: number) => ({ id: i + 1, name: `Artist ${i}`, album_count: 1, track_count: 3 })
+
+test('the artists list loads 50 at a time until the whole list is shown', async () => {
+ mockFetch({ 'GET /api/v1/artists': paged(120, artistItem) })
+ renderPage( , '/artists')
+ expect(await screen.findAllByRole('link')).toHaveLength(50)
+ await userEvent.click(screen.getByRole('button', { name: 'Show more' }))
+ await waitFor(() => expect(screen.getAllByRole('link')).toHaveLength(100))
+ await userEvent.click(screen.getByRole('button', { name: 'Show more' }))
+ await waitFor(() => expect(screen.getAllByRole('link')).toHaveLength(120))
+ expect(screen.queryByRole('button', { name: 'Show more' })).not.toBeInTheDocument()
+})
+
+test('the artists list sends the search text from the address', async () => {
+ const { calls } = mockFetch({ 'GET /api/v1/artists': paged(1, artistItem) })
+ renderPage( , '/artists?q=bjork', '/artists')
+ await screen.findAllByRole('link')
+ expect(calls[0].url.searchParams.get('q')).toBe('bjork')
+})
+
+test('an empty library says so instead of showing an empty page', async () => {
+ mockFetch({ 'GET /api/v1/artists': paged(0, artistItem) })
+ renderPage( , '/artists')
+ expect(await screen.findByText('No artists yet.')).toBeInTheDocument()
+})
+
+test('a list that fails to load says so and can be tried again', async () => {
+ let fail = true
+ mockFetch({
+ 'GET /api/v1/artists': (req) => (fail ? apiError(500, 'internal') : paged(1, artistItem)(req)),
+ })
+ renderPage( , '/artists')
+ expect(await screen.findByRole('alert')).toHaveTextContent('Something went wrong. Try again.')
+ fail = false
+ await userEvent.click(screen.getByRole('button', { name: 'Try again' }))
+ expect(await screen.findByRole('link', { name: /Artist 0/ })).toBeInTheDocument()
+})
+
+test('the albums list shows each album with its artist and links to it', async () => {
+ mockFetch({ 'GET /api/v1/albums': () => page([album, { ...album, id: 10, title: 'Kid A', artist: null }]) })
+ renderPage( , '/albums')
+ const link = await screen.findByRole('link', { name: /OK Computer/ })
+ expect(link).toHaveAttribute('href', '/albums/9')
+ expect(link).toHaveTextContent('Radiohead')
+ expect(screen.getByRole('link', { name: /Kid A/ })).toHaveAttribute('href', '/albums/10')
+})
+
+test('the songs list plays from the song that was clicked', async () => {
+ mockFetch({ 'GET /api/v1/tracks': () => page([track(1), track(2), track(3)]) })
+ renderPage( , '/songs')
+ await userEvent.click(await screen.findByRole('button', { name: /Song 2/ }))
+ expect(usePlayer.getState().queue.map((t) => t.id)).toEqual([1, 2, 3])
+ expect(usePlayer.getState().index).toBe(1)
+})
+
+test('a song with no album and no artists is listed', async () => {
+ mockFetch({ 'GET /api/v1/tracks': () => page([track(1, { album: null, artists: [] })]) })
+ renderPage( , '/songs')
+ expect(await screen.findByRole('button', { name: /Song 1/ })).toHaveTextContent('—')
+})
diff --git a/web/src/player/engine.test.ts b/web/src/player/engine.test.ts
new file mode 100644
index 0000000..c970fcc
--- /dev/null
+++ b/web/src/player/engine.test.ts
@@ -0,0 +1,250 @@
+import { afterEach, beforeEach, expect, test, vi } from 'vitest'
+import type { Track } from '@/api/catalog'
+import { login, sessionStore } from '@/auth/session'
+import { mockFetch } from '@/test/mockFetch'
+import { createEngine, type AudioLike } from './engine'
+import { usePlayer } from './store'
+
+type AudioEvent = 'timeupdate' | 'ended' | 'error' | 'loadedmetadata'
+
+/** A stand-in for the audio element: it keeps what was set and lets a test fire the events. */
+class FakeAudio implements AudioLike {
+ currentTime = 0
+ duration = Number.NaN
+ paused = true
+ playCalls = 0
+ private url = ''
+ private handlers = new Map void>>()
+
+ get src() {
+ return this.url
+ }
+ set src(value: string) {
+ this.url = value
+ this.currentTime = 0 // a new resource starts over, and loading pauses the element
+ this.paused = true
+ }
+ async play() {
+ this.playCalls++
+ this.paused = false
+ }
+ pause() {
+ this.paused = true
+ }
+ addEventListener(type: AudioEvent, fn: () => void) {
+ if (!this.handlers.has(type)) this.handlers.set(type, new Set())
+ this.handlers.get(type)!.add(fn)
+ }
+ removeEventListener(type: string, fn: () => void) {
+ this.handlers.get(type)?.delete(fn)
+ }
+ emit(type: AudioEvent) {
+ this.handlers.get(type)?.forEach((fn) => fn())
+ }
+ listenerCount() {
+ return [...this.handlers.values()].reduce((n, set) => n + set.size, 0)
+ }
+}
+
+function track(n: number): Track {
+ return {
+ id: n,
+ title: `t${n}`,
+ duration_ms: 200_000,
+ track_no: n,
+ disc_no: 1,
+ album: null,
+ artists: [],
+ format: 'mp3',
+ }
+}
+
+const [t1, t2, t3] = [1, 2, 3].map(track)
+
+function session(access: string) {
+ return {
+ access_token: access,
+ access_expires_at: new Date(Date.now() + 900_000).toISOString(),
+ refresh_token: `r-${access}`,
+ refresh_expires_at: new Date(Date.now() + 86_400_000).toISOString(),
+ user: { id: 1, username: 'tom', is_admin: false },
+ }
+}
+
+let audio: FakeAudio
+let engine: { destroy(): void }
+const hooks = { onStart: vi.fn(), onPlayed: vi.fn(), onFinish: vi.fn() }
+
+beforeEach(async () => {
+ usePlayer.setState({
+ queue: [],
+ original: [],
+ index: 0,
+ playing: false,
+ positionMs: 0,
+ shuffle: false,
+ repeat: 'off',
+ seekMs: null,
+ seekId: 0,
+ playId: 0,
+ })
+ sessionStore.setState({ status: 'anonymous', user: null, accessToken: null, accessExpiresAt: 0, refreshToken: null })
+ hooks.onStart.mockClear()
+ hooks.onPlayed.mockClear()
+ hooks.onFinish.mockClear()
+ mockFetch({ 'POST /api/v1/auth/login': () => session('tok1') })
+ await login('tom', 'secret123')
+ audio = new FakeAudio()
+ engine = createEngine(audio, hooks)
+})
+
+afterEach(() => {
+ engine.destroy()
+})
+
+test('the current track is loaded from its stream URL with the token and played', () => {
+ usePlayer.getState().playTracks([t1, t2])
+ expect(audio.src).toBe('/api/v1/tracks/1/stream?access_token=tok1')
+ expect(audio.paused).toBe(false)
+ expect(hooks.onStart).toHaveBeenCalledWith(1)
+})
+
+test('pause and play follow the player', () => {
+ usePlayer.getState().playTracks([t1])
+ usePlayer.getState().togglePlay()
+ expect(audio.paused).toBe(true)
+ usePlayer.getState().togglePlay()
+ expect(audio.paused).toBe(false)
+})
+
+test('a seek moves the audio', () => {
+ usePlayer.getState().playTracks([t1])
+ usePlayer.getState().seek(42_000)
+ expect(audio.currentTime).toBe(42)
+})
+
+test('the position of the player follows the audio', () => {
+ usePlayer.getState().playTracks([t1])
+ audio.currentTime = 12.5
+ audio.emit('timeupdate')
+ expect(usePlayer.getState().positionMs).toBe(12_500)
+})
+
+test('a renewed token while a track plays keeps it playing from the same second', async () => {
+ usePlayer.getState().playTracks([t1])
+ audio.currentTime = 42
+ mockFetch({ 'POST /api/v1/auth/login': () => session('tok2') })
+ await login('tom', 'secret123')
+
+ expect(audio.src).toBe('/api/v1/tracks/1/stream?access_token=tok2')
+ const playsBefore = audio.playCalls
+ audio.emit('loadedmetadata')
+ expect(audio.currentTime).toBe(42)
+ expect(audio.paused).toBe(false)
+ expect(audio.playCalls).toBe(playsBefore + 1)
+ expect(hooks.onStart).toHaveBeenCalledTimes(1) // the same play, not a new one
+})
+
+test('a renewed token while paused keeps the position and stays paused', async () => {
+ usePlayer.getState().playTracks([t1])
+ usePlayer.getState().togglePlay()
+ audio.currentTime = 42
+ mockFetch({ 'POST /api/v1/auth/login': () => session('tok2') })
+ await login('tom', 'secret123')
+
+ const playsBefore = audio.playCalls
+ audio.emit('loadedmetadata')
+ expect(audio.currentTime).toBe(42)
+ expect(audio.paused).toBe(true)
+ expect(audio.playCalls).toBe(playsBefore)
+})
+
+test('a renewed token with nothing loaded does nothing', async () => {
+ mockFetch({ 'POST /api/v1/auth/login': () => session('tok2') })
+ await login('tom', 'secret123')
+ expect(audio.src).toBe('')
+})
+
+test('a track that ends moves on to the next and is reported as complete once', () => {
+ usePlayer.getState().playTracks([t1, t2])
+ audio.emit('ended')
+ expect(usePlayer.getState().index).toBe(1)
+ expect(audio.src).toBe('/api/v1/tracks/2/stream?access_token=tok1')
+ expect(hooks.onFinish).toHaveBeenCalledTimes(1)
+ expect(hooks.onFinish).toHaveBeenCalledWith('complete')
+ expect(hooks.onStart).toHaveBeenLastCalledWith(2)
+})
+
+test('moving on before the end reports a skip, but only if something had been played', () => {
+ usePlayer.getState().playTracks([t1, t2, t3])
+ usePlayer.getState().next() // nothing played yet
+ expect(hooks.onFinish).not.toHaveBeenCalled()
+
+ audio.currentTime = 1.5
+ audio.emit('timeupdate')
+ usePlayer.getState().next()
+ expect(hooks.onFinish).toHaveBeenCalledTimes(1)
+ expect(hooks.onFinish).toHaveBeenCalledWith('skip')
+})
+
+test('playing the same track again starts a new play', () => {
+ usePlayer.getState().playTracks([t1])
+ audio.currentTime = 1
+ audio.emit('timeupdate')
+ usePlayer.getState().playTracks([t1])
+ expect(hooks.onFinish).toHaveBeenCalledWith('skip')
+ expect(hooks.onStart).toHaveBeenCalledTimes(2)
+})
+
+test('repeat one after the end starts a new play of the same track', () => {
+ usePlayer.getState().playTracks([t1])
+ usePlayer.getState().cycleRepeat()
+ usePlayer.getState().cycleRepeat() // one
+ audio.emit('ended')
+ expect(hooks.onFinish).toHaveBeenCalledWith('complete')
+ expect(hooks.onStart).toHaveBeenCalledTimes(2)
+ expect(audio.currentTime).toBe(0)
+ expect(audio.paused).toBe(false)
+})
+
+test('time played is counted in steps of at most two seconds, so a seek is not counted', () => {
+ usePlayer.getState().playTracks([t1])
+ audio.currentTime = 0.5
+ audio.emit('timeupdate')
+ audio.currentTime = 1
+ audio.emit('timeupdate')
+ audio.currentTime = 31
+ audio.emit('timeupdate')
+ expect(hooks.onPlayed.mock.calls.map(([ms]) => ms)).toEqual([500, 500, 2000])
+})
+
+test('time is not counted while paused', () => {
+ usePlayer.getState().playTracks([t1])
+ usePlayer.getState().togglePlay()
+ audio.currentTime = 5
+ audio.emit('timeupdate')
+ expect(hooks.onPlayed).not.toHaveBeenCalled()
+})
+
+test('a stream that cannot be played stops the player', () => {
+ usePlayer.getState().playTracks([t1])
+ audio.emit('error')
+ expect(usePlayer.getState().playing).toBe(false)
+})
+
+test('an empty queue unloads the audio', () => {
+ usePlayer.getState().playTracks([t1])
+ usePlayer.getState().removeAt(0)
+ expect(audio.paused).toBe(true)
+ expect(audio.src).toBe('')
+})
+
+test('after destroy the engine no longer listens to anyone', async () => {
+ engine.destroy()
+ expect(audio.listenerCount()).toBe(0)
+ usePlayer.getState().playTracks([t1])
+ expect(audio.src).toBe('')
+ mockFetch({ 'POST /api/v1/auth/login': () => session('tok9') })
+ await login('tom', 'secret123')
+ expect(audio.src).toBe('')
+})
diff --git a/web/src/player/engine.ts b/web/src/player/engine.ts
new file mode 100644
index 0000000..370e9a2
--- /dev/null
+++ b/web/src/player/engine.ts
@@ -0,0 +1,155 @@
+import { mediaUrl, onTokenChange } from '@/auth/session'
+import { currentTrack, usePlayer, type PlayerState } from './store'
+
+export type AudioEvent = 'timeupdate' | 'ended' | 'error' | 'loadedmetadata'
+
+/** The part of an audio element the engine uses, so that tests can stand in for it. */
+export interface AudioLike {
+ src: string
+ currentTime: number
+ duration: number
+ paused: boolean
+ play(): Promise
+ pause(): void
+ addEventListener(type: AudioEvent, fn: () => void): void
+ removeEventListener(type: string, fn: () => void): void
+}
+
+export type FinishType = 'complete' | 'skip' | 'play'
+
+export interface EngineHooks {
+ /** A play of a track begins. */
+ onStart?(trackId: number): void
+ /** Time that was really listened to, in milliseconds (never more than 2000 at once). */
+ onPlayed?(deltaMs: number): void
+ /** The play ends: `complete` when the track reached its end, `skip` when the listener moved on. */
+ onFinish?(type: FinishType): void
+}
+
+/** The largest step of `timeupdate` that counts as listening; a bigger one is a seek. */
+const MAX_STEP_MS = 2000
+
+const streamUrl = (trackId: number) => mediaUrl(`/tracks/${trackId}/stream`)
+
+/**
+ * Drives an audio element from the player store: loads the current track, plays and pauses, seeks,
+ * advances when a track ends, and swaps the URL when the access token is renewed without losing the place.
+ */
+export function createEngine(audio: AudioLike, hooks: EngineHooks = {}): { destroy(): void } {
+ const initial = usePlayer.getState()
+ let loadedId: number | null = null
+ let loadedPlayId = initial.playId
+ let loadedSeekId = initial.seekId
+ let finished = true
+ let playedMs = 0
+ let lastTime = 0
+ let pendingRestore: { time: number; resume: boolean } | null = null
+
+ function play() {
+ audio.play().catch(() => usePlayer.setState({ playing: false })) // the browser refused: wait for a click
+ }
+
+ function load(state: PlayerState) {
+ if (loadedId !== null && !finished && playedMs > 0) hooks.onFinish?.('skip')
+ const track = currentTrack(state)
+ loadedPlayId = state.playId
+ loadedSeekId = state.seekId
+ pendingRestore = null
+ playedMs = 0
+ lastTime = 0
+ if (!track) {
+ audio.pause()
+ audio.src = ''
+ loadedId = null
+ finished = true
+ return
+ }
+ audio.src = streamUrl(track.id)
+ loadedId = track.id
+ finished = false
+ hooks.onStart?.(track.id)
+ if (state.playing) play()
+ }
+
+ function seek(state: PlayerState, previous: PlayerState) {
+ loadedSeekId = state.seekId
+ const ms = state.seekMs ?? 0
+ audio.currentTime = ms / 1000
+ lastTime = ms
+ if (finished && ms === 0 && loadedId !== null) {
+ // The track ran to its end and starts over: that is a new play.
+ finished = false
+ playedMs = 0
+ hooks.onStart?.(loadedId)
+ }
+ if (state.playing && state.playing === previous.playing) play()
+ }
+
+ function sync(state: PlayerState, previous: PlayerState) {
+ const track = currentTrack(state)
+ if ((track?.id ?? null) !== loadedId || state.playId !== loadedPlayId) {
+ load(state)
+ return
+ }
+ if (state.seekId !== loadedSeekId) seek(state, previous)
+ if (state.playing !== previous.playing) {
+ if (state.playing) play()
+ else audio.pause()
+ }
+ }
+
+ const unsubscribeStore = usePlayer.subscribe(sync)
+ sync(initial, { ...initial, queue: [], playId: initial.playId - 1 })
+
+ const unsubscribeToken = onTokenChange(() => {
+ if (loadedId === null) return
+ pendingRestore = { time: audio.currentTime, resume: usePlayer.getState().playing }
+ audio.src = streamUrl(loadedId)
+ })
+
+ const onLoadedMetadata = () => {
+ if (!pendingRestore) return
+ const { time, resume } = pendingRestore
+ pendingRestore = null
+ audio.currentTime = time
+ if (resume) play()
+ }
+
+ const onTimeUpdate = () => {
+ const ms = audio.currentTime * 1000
+ usePlayer.getState().tick(Math.round(ms))
+ const delta = ms - lastTime
+ lastTime = ms
+ if (!audio.paused && delta > 0) {
+ const step = Math.min(delta, MAX_STEP_MS)
+ playedMs += step
+ hooks.onPlayed?.(step)
+ }
+ }
+
+ const onEnded = () => {
+ if (!finished) {
+ finished = true
+ hooks.onFinish?.('complete')
+ }
+ usePlayer.getState().trackEnded()
+ }
+
+ const onError = () => usePlayer.setState({ playing: false })
+
+ audio.addEventListener('loadedmetadata', onLoadedMetadata)
+ audio.addEventListener('timeupdate', onTimeUpdate)
+ audio.addEventListener('ended', onEnded)
+ audio.addEventListener('error', onError)
+
+ return {
+ destroy() {
+ unsubscribeStore()
+ unsubscribeToken()
+ audio.removeEventListener('loadedmetadata', onLoadedMetadata)
+ audio.removeEventListener('timeupdate', onTimeUpdate)
+ audio.removeEventListener('ended', onEnded)
+ audio.removeEventListener('error', onError)
+ },
+ }
+}
diff --git a/web/src/player/listens.test.ts b/web/src/player/listens.test.ts
new file mode 100644
index 0000000..de83ef5
--- /dev/null
+++ b/web/src/player/listens.test.ts
@@ -0,0 +1,170 @@
+import { beforeEach, expect, test, vi } from 'vitest'
+import { ApiError } from '@/api/client'
+import { createListenReporter, type ListenBody } from './listens'
+
+const NOW = new Date('2026-11-12T20:00:00.000Z')
+
+let keyCounter = 0
+const send = vi.fn<(body: ListenBody, opts?: { keepalive?: boolean }) => Promise>()
+
+function reporter() {
+ return createListenReporter({ send, uuid: () => `key-${++keyCounter}`, now: () => NOW })
+}
+
+beforeEach(() => {
+ vi.useFakeTimers()
+ keyCounter = 0
+ send.mockReset().mockResolvedValue(undefined)
+})
+
+test('a track played to the end is sent once, as complete, with the time played', () => {
+ const r = reporter()
+ r.start(1)
+ r.addPlayed(10_000)
+ r.addPlayed(15_000)
+ r.finish('complete')
+ expect(send).toHaveBeenCalledTimes(1)
+ expect(send).toHaveBeenCalledWith(
+ {
+ track_id: 1,
+ event_type: 'complete',
+ occurred_at: '2026-11-12T20:00:00.000Z',
+ duration_played_ms: 25_000,
+ idempotency_key: 'key-1',
+ },
+ undefined,
+ )
+})
+
+test('finishing twice sends once', () => {
+ const r = reporter()
+ r.start(1)
+ r.addPlayed(5000)
+ r.finish('complete')
+ r.finish('skip')
+ expect(send).toHaveBeenCalledTimes(1)
+})
+
+test('a play with no time played sends nothing', () => {
+ const r = reporter()
+ r.start(1)
+ r.finish('complete')
+ expect(send).not.toHaveBeenCalled()
+})
+
+test('time or a finish with no play in progress is ignored', () => {
+ const r = reporter()
+ r.addPlayed(5000)
+ r.finish('skip')
+ r.flushOnHide()
+ expect(send).not.toHaveBeenCalled()
+})
+
+test('starting another track without a finish reports a skip for the first one', () => {
+ const r = reporter()
+ r.start(1)
+ r.addPlayed(5000)
+ r.start(2)
+ r.addPlayed(3000)
+ r.finish('complete')
+ expect(send).toHaveBeenCalledTimes(2)
+ const [skip, complete] = send.mock.calls.map(([body]) => body)
+ expect(skip).toMatchObject({ track_id: 1, event_type: 'skip', duration_played_ms: 5000, idempotency_key: 'key-1' })
+ expect(complete).toMatchObject({ track_id: 2, event_type: 'complete', duration_played_ms: 3000, idempotency_key: 'key-2' })
+})
+
+test('a failed send is tried again with the same body and the same key', async () => {
+ send.mockRejectedValueOnce(new ApiError(0, 'network', 'down'))
+ const r = reporter()
+ r.start(1)
+ r.addPlayed(25_000)
+ r.finish('complete')
+ await vi.advanceTimersByTimeAsync(0)
+ expect(send).toHaveBeenCalledTimes(1)
+
+ await vi.advanceTimersByTimeAsync(1000)
+ expect(send).toHaveBeenCalledTimes(2)
+ expect(send.mock.calls[1][0]).toEqual(send.mock.calls[0][0])
+ expect(send.mock.calls[1][0].idempotency_key).toBe('key-1')
+})
+
+test('retries come after 1, 4 and 16 seconds and then stop', async () => {
+ send.mockRejectedValue(new ApiError(503, 'unavailable', 'later'))
+ const r = reporter()
+ r.start(1)
+ r.addPlayed(25_000)
+ r.finish('complete')
+ await vi.advanceTimersByTimeAsync(0)
+ expect(send).toHaveBeenCalledTimes(1)
+ await vi.advanceTimersByTimeAsync(999)
+ expect(send).toHaveBeenCalledTimes(1)
+ await vi.advanceTimersByTimeAsync(1)
+ expect(send).toHaveBeenCalledTimes(2)
+ await vi.advanceTimersByTimeAsync(4000)
+ expect(send).toHaveBeenCalledTimes(3)
+ await vi.advanceTimersByTimeAsync(16_000)
+ expect(send).toHaveBeenCalledTimes(4)
+ await vi.advanceTimersByTimeAsync(600_000)
+ expect(send).toHaveBeenCalledTimes(4)
+})
+
+test.each([
+ [400, 'invalid_input'],
+ [404, 'track_not_found'],
+])('an answer of %i is final and is not sent again', async (status, code) => {
+ send.mockRejectedValue(new ApiError(status, code, 'no'))
+ const r = reporter()
+ r.start(1)
+ r.addPlayed(25_000)
+ r.finish('complete')
+ await vi.advanceTimersByTimeAsync(600_000)
+ expect(send).toHaveBeenCalledTimes(1)
+})
+
+test('closing the page mid-track sends the play as it stands, once, without waiting for the answer', () => {
+ const r = reporter()
+ r.start(1)
+ r.addPlayed(12_000)
+ r.flushOnHide()
+ r.flushOnHide()
+ expect(send).toHaveBeenCalledTimes(1)
+ expect(send).toHaveBeenCalledWith(
+ expect.objectContaining({ track_id: 1, event_type: 'play', duration_played_ms: 12_000, idempotency_key: 'key-1' }),
+ { keepalive: true },
+ )
+})
+
+test('closing the page with nothing played sends nothing', () => {
+ const r = reporter()
+ r.start(1)
+ r.flushOnHide()
+ expect(send).not.toHaveBeenCalled()
+})
+
+test('closing the page sends once more what was waiting for a retry, with the same key', async () => {
+ send.mockRejectedValueOnce(new ApiError(0, 'network', 'down'))
+ const r = reporter()
+ r.start(1)
+ r.addPlayed(25_000)
+ r.finish('complete')
+ await vi.advanceTimersByTimeAsync(0)
+
+ r.flushOnHide()
+ expect(send).toHaveBeenCalledTimes(2)
+ expect(send.mock.calls[1][0].idempotency_key).toBe('key-1')
+ expect(send.mock.calls[1][1]).toEqual({ keepalive: true })
+
+ await vi.advanceTimersByTimeAsync(600_000)
+ expect(send).toHaveBeenCalledTimes(2)
+})
+
+test('a new play after a finished one has its own key', () => {
+ const r = reporter()
+ r.start(1)
+ r.addPlayed(1000)
+ r.finish('complete')
+ r.start(1)
+ r.addPlayed(2000)
+ r.finish('complete')
+ expect(send.mock.calls.map(([b]) => b.idempotency_key)).toEqual(['key-1', 'key-2'])
+})
diff --git a/web/src/player/listens.ts b/web/src/player/listens.ts
new file mode 100644
index 0000000..1dee495
--- /dev/null
+++ b/web/src/player/listens.ts
@@ -0,0 +1,94 @@
+import { ApiError } from '@/api/client'
+import type { ListenBody } from '@/api/listens'
+
+export type { ListenBody }
+
+export interface ListenReporterDeps {
+ send(body: ListenBody, opts?: { keepalive?: boolean }): Promise
+ uuid(): string
+ now(): Date
+}
+
+export interface ListenReporter {
+ /** A play of a track begins. If another play is still open it is closed as a skip first. */
+ start(trackId: number): void
+ /** Time really listened to in the open play. */
+ addPlayed(deltaMs: number): void
+ /** Closes the open play and sends it. A play with no time played is not sent. */
+ finish(type: 'complete' | 'skip' | 'play'): void
+ /** The page is closing: sends the open play as it stands, and what was waiting for a retry, at once. */
+ flushOnHide(): void
+}
+
+/** Waits before the first, second and third retry. Each retry sends the same body with the same key. */
+const RETRY_DELAYS_MS = [1000, 4000, 16_000]
+
+interface Waiting {
+ body: ListenBody
+ attempt: number
+ timer: ReturnType | null
+}
+
+/**
+ * One event per play, each with its own idempotency key, so that a retry is recorded once.
+ * A 400 or 404 answer is final; anything else (no network, 5xx, a token that expired) is retried.
+ */
+export function createListenReporter(deps: ListenReporterDeps): ListenReporter {
+ let open: { trackId: number; key: string; playedMs: number } | null = null
+ const waiting = new Map()
+
+ async function attempt(entry: Waiting, opts: { keepalive?: boolean } | undefined, mayRetry: boolean) {
+ const key = entry.body.idempotency_key
+ try {
+ await deps.send(entry.body, opts)
+ waiting.delete(key)
+ } catch (e) {
+ const final = e instanceof ApiError && (e.status === 400 || e.status === 404)
+ if (final || !mayRetry || entry.attempt >= RETRY_DELAYS_MS.length) {
+ waiting.delete(key)
+ return
+ }
+ waiting.set(key, entry)
+ entry.timer = setTimeout(() => {
+ entry.timer = null
+ void attempt(entry, undefined, true)
+ }, RETRY_DELAYS_MS[entry.attempt++])
+ }
+ }
+
+ function close(type: 'complete' | 'skip' | 'play', opts?: { keepalive?: boolean }) {
+ const play = open
+ open = null
+ if (!play || play.playedMs <= 0) return
+ const body: ListenBody = {
+ track_id: play.trackId,
+ event_type: type,
+ occurred_at: deps.now().toISOString(),
+ duration_played_ms: Math.round(play.playedMs),
+ idempotency_key: play.key,
+ }
+ void attempt({ body, attempt: 0, timer: null }, opts, !opts?.keepalive)
+ }
+
+ return {
+ start(trackId) {
+ if (open) close('skip')
+ open = { trackId, key: deps.uuid(), playedMs: 0 }
+ },
+ addPlayed(deltaMs) {
+ if (open) open.playedMs += deltaMs
+ },
+ finish(type) {
+ close(type)
+ },
+ flushOnHide() {
+ close('play', { keepalive: true })
+ for (const entry of [...waiting.values()]) {
+ if (entry.timer) clearTimeout(entry.timer)
+ entry.timer = null
+ waiting.delete(entry.body.idempotency_key)
+ void attempt(entry, { keepalive: true }, false)
+ }
+ },
+ }
+}
diff --git a/web/src/player/mediaSession.test.ts b/web/src/player/mediaSession.test.ts
new file mode 100644
index 0000000..faf90ec
--- /dev/null
+++ b/web/src/player/mediaSession.test.ts
@@ -0,0 +1,85 @@
+import { afterEach, expect, test, vi } from 'vitest'
+import type { Track } from '@/api/catalog'
+import { setMediaSession } from './mediaSession'
+
+class FakeMetadata {
+ title = ''
+ artist = ''
+ album = ''
+ artwork: { src: string }[] = []
+ constructor(init: Partial) {
+ Object.assign(this, init)
+ }
+}
+
+const handlers = { play: vi.fn(), pause: vi.fn(), next: vi.fn(), prev: vi.fn() }
+
+function withMediaSession() {
+ const registered = new Map void>()
+ const mediaSession = {
+ metadata: null as FakeMetadata | null,
+ setActionHandler: vi.fn((action: string, fn: (() => void) | null) => {
+ if (fn) registered.set(action, fn)
+ else registered.delete(action)
+ }),
+ }
+ vi.stubGlobal('MediaMetadata', FakeMetadata)
+ Object.defineProperty(navigator, 'mediaSession', { configurable: true, value: mediaSession })
+ return { mediaSession, registered }
+}
+
+afterEach(() => {
+ delete (navigator as unknown as Record).mediaSession
+})
+
+const track: Track = {
+ id: 7,
+ title: 'Paranoid Android',
+ duration_ms: 387_000,
+ track_no: 2,
+ disc_no: 1,
+ album: { id: 3, title: 'OK Computer' },
+ artists: [
+ { id: 1, name: 'Radiohead' },
+ { id: 2, name: 'Guest' },
+ ],
+ format: 'flac',
+}
+
+test('the lock screen shows the title, the artists and the album', () => {
+ const { mediaSession } = withMediaSession()
+ setMediaSession(track, handlers)
+ expect(mediaSession.metadata).toMatchObject({ title: 'Paranoid Android', artist: 'Radiohead, Guest', album: 'OK Computer' })
+ expect(mediaSession.metadata!.artwork[0].src).toContain('/albums/3/cover')
+})
+
+test('a track with no album and no artists still shows its title', () => {
+ const { mediaSession } = withMediaSession()
+ setMediaSession({ ...track, album: null, artists: [] }, handlers)
+ expect(mediaSession.metadata).toMatchObject({ title: 'Paranoid Android', artist: '', album: '' })
+ expect(mediaSession.metadata!.artwork).toEqual([])
+})
+
+test('the media keys are wired to the player', () => {
+ const { registered } = withMediaSession()
+ setMediaSession(track, handlers)
+ registered.get('play')!()
+ registered.get('pause')!()
+ registered.get('nexttrack')!()
+ registered.get('previoustrack')!()
+ expect(handlers.play).toHaveBeenCalledTimes(1)
+ expect(handlers.pause).toHaveBeenCalledTimes(1)
+ expect(handlers.next).toHaveBeenCalledTimes(1)
+ expect(handlers.prev).toHaveBeenCalledTimes(1)
+})
+
+test('nothing playing clears the lock screen', () => {
+ const { mediaSession } = withMediaSession()
+ setMediaSession(track, handlers)
+ setMediaSession(null, handlers)
+ expect(mediaSession.metadata).toBeNull()
+})
+
+test('a browser without the Media Session API is left alone', () => {
+ expect(() => setMediaSession(track, handlers)).not.toThrow()
+})
diff --git a/web/src/player/mediaSession.ts b/web/src/player/mediaSession.ts
new file mode 100644
index 0000000..5881db0
--- /dev/null
+++ b/web/src/player/mediaSession.ts
@@ -0,0 +1,29 @@
+import type { Track } from '@/api/catalog'
+import { mediaUrl } from '@/auth/session'
+
+export interface MediaKeyHandlers {
+ play(): void
+ pause(): void
+ next(): void
+ prev(): void
+}
+
+/** Tells the operating system what is playing (lock screen, media keys). Does nothing where the API is missing. */
+export function setMediaSession(track: Track | null, handlers: MediaKeyHandlers): void {
+ const session = navigator.mediaSession as MediaSession | undefined
+ if (!session) return
+ if (!track) {
+ session.metadata = null
+ return
+ }
+ session.metadata = new MediaMetadata({
+ title: track.title,
+ artist: track.artists.map((a) => a.name).join(', '),
+ album: track.album?.title ?? '',
+ artwork: track.album ? [{ src: mediaUrl(`/albums/${track.album.id}/cover`) }] : [],
+ })
+ session.setActionHandler('play', handlers.play)
+ session.setActionHandler('pause', handlers.pause)
+ session.setActionHandler('nexttrack', handlers.next)
+ session.setActionHandler('previoustrack', handlers.prev)
+}
diff --git a/web/src/player/store.test.ts b/web/src/player/store.test.ts
new file mode 100644
index 0000000..5a53897
--- /dev/null
+++ b/web/src/player/store.test.ts
@@ -0,0 +1,310 @@
+import { beforeEach, expect, test } from 'vitest'
+import type { Track } from '@/api/catalog'
+import { currentTrack, setRandom, usePlayer } from './store'
+
+function track(n: number, durationMs = 200_000): Track {
+ return {
+ id: n,
+ title: `t${n}`,
+ duration_ms: durationMs,
+ track_no: n,
+ disc_no: 1,
+ album: { id: 1, title: 'Album' },
+ artists: [{ id: 1, name: 'Artist' }],
+ format: 'flac',
+ }
+}
+
+const [t1, t2, t3, t4, t5] = [1, 2, 3, 4, 5].map((n) => track(n))
+const all = [t1, t2, t3, t4, t5]
+
+const ids = () => usePlayer.getState().queue.map((t) => t.id)
+const current = () => currentTrack(usePlayer.getState())
+
+beforeEach(() => {
+ usePlayer.setState({
+ queue: [],
+ original: [],
+ index: 0,
+ playing: false,
+ positionMs: 0,
+ shuffle: false,
+ repeat: 'off',
+ seekMs: null,
+ seekId: 0,
+ })
+ setRandom(() => 0)
+})
+
+test('playTracks fills the queue and starts the first track', () => {
+ usePlayer.getState().playTracks(all)
+ expect(ids()).toEqual([1, 2, 3, 4, 5])
+ expect(current()).toBe(t1)
+ expect(usePlayer.getState().playing).toBe(true)
+})
+
+test('playTracks can start from any track', () => {
+ usePlayer.getState().playTracks(all, 2)
+ expect(current()).toBe(t3)
+ expect(ids()).toEqual([1, 2, 3, 4, 5])
+})
+
+test('playTracks with nothing to play leaves an empty, stopped queue', () => {
+ usePlayer.getState().playTracks([], 0)
+ expect(ids()).toEqual([])
+ expect(current()).toBeNull()
+ expect(usePlayer.getState().playing).toBe(false)
+})
+
+test('togglePlay does nothing with an empty queue and flips play and pause otherwise', () => {
+ usePlayer.getState().togglePlay()
+ expect(usePlayer.getState().playing).toBe(false)
+ usePlayer.getState().playTracks(all)
+ usePlayer.getState().togglePlay()
+ expect(usePlayer.getState().playing).toBe(false)
+ usePlayer.getState().togglePlay()
+ expect(usePlayer.getState().playing).toBe(true)
+})
+
+test('next goes to the following track and plays it', () => {
+ usePlayer.getState().playTracks(all)
+ usePlayer.getState().togglePlay() // paused
+ usePlayer.getState().tick(5000)
+ usePlayer.getState().next()
+ expect(current()).toBe(t2)
+ expect(usePlayer.getState().playing).toBe(true)
+ expect(usePlayer.getState().positionMs).toBe(0)
+})
+
+test('next at the end stops when repeat is off and keeps the last track', () => {
+ usePlayer.getState().playTracks(all, 4)
+ usePlayer.getState().next()
+ expect(current()).toBe(t5)
+ expect(usePlayer.getState().playing).toBe(false)
+ expect(usePlayer.getState().positionMs).toBe(0)
+})
+
+test('next at the end wraps to the first track when repeat is all', () => {
+ usePlayer.getState().playTracks(all, 4)
+ usePlayer.getState().cycleRepeat() // all
+ usePlayer.getState().next()
+ expect(current()).toBe(t1)
+ expect(usePlayer.getState().playing).toBe(true)
+})
+
+test('previous restarts the track when more than three seconds have played', () => {
+ usePlayer.getState().playTracks(all, 2)
+ usePlayer.getState().tick(3001)
+ const before = usePlayer.getState().seekId
+ usePlayer.getState().prev()
+ expect(current()).toBe(t3)
+ expect(usePlayer.getState().positionMs).toBe(0)
+ expect(usePlayer.getState().seekMs).toBe(0)
+ expect(usePlayer.getState().seekId).toBe(before + 1)
+})
+
+test('previous within the first three seconds goes back one track', () => {
+ usePlayer.getState().playTracks(all, 2)
+ usePlayer.getState().tick(3000)
+ usePlayer.getState().prev()
+ expect(current()).toBe(t2)
+ expect(usePlayer.getState().playing).toBe(true)
+})
+
+test('previous on the first track restarts it', () => {
+ usePlayer.getState().playTracks(all)
+ usePlayer.getState().tick(1000)
+ const before = usePlayer.getState().seekId
+ usePlayer.getState().prev()
+ expect(current()).toBe(t1)
+ expect(usePlayer.getState().seekId).toBe(before + 1)
+ expect(usePlayer.getState().positionMs).toBe(0)
+})
+
+test('a track that ends moves on to the next one', () => {
+ usePlayer.getState().playTracks(all)
+ usePlayer.getState().trackEnded()
+ expect(current()).toBe(t2)
+})
+
+test('a track that ends with repeat one plays again from the start', () => {
+ usePlayer.getState().playTracks(all, 1)
+ usePlayer.getState().cycleRepeat()
+ usePlayer.getState().cycleRepeat() // one
+ const before = usePlayer.getState().seekId
+ usePlayer.getState().trackEnded()
+ expect(current()).toBe(t2)
+ expect(usePlayer.getState().playing).toBe(true)
+ expect(usePlayer.getState().seekMs).toBe(0)
+ expect(usePlayer.getState().seekId).toBe(before + 1)
+})
+
+test('a last track that ends with repeat off stops the player', () => {
+ usePlayer.getState().playTracks(all, 4)
+ usePlayer.getState().trackEnded()
+ expect(usePlayer.getState().playing).toBe(false)
+})
+
+test('repeat goes off, all, one and back to off', () => {
+ const seen = [usePlayer.getState().repeat]
+ for (let i = 0; i < 3; i++) {
+ usePlayer.getState().cycleRepeat()
+ seen.push(usePlayer.getState().repeat)
+ }
+ expect(seen).toEqual(['off', 'all', 'one', 'off'])
+})
+
+test('seek stores the position and asks the engine to move', () => {
+ usePlayer.getState().playTracks(all)
+ usePlayer.getState().seek(42_000)
+ expect(usePlayer.getState().positionMs).toBe(42_000)
+ expect(usePlayer.getState().seekMs).toBe(42_000)
+ expect(usePlayer.getState().seekId).toBe(1)
+})
+
+test('seek never goes below zero or past the end of the track', () => {
+ usePlayer.getState().playTracks([track(9, 60_000)])
+ usePlayer.getState().seek(-5)
+ expect(usePlayer.getState().positionMs).toBe(0)
+ usePlayer.getState().seek(90_000)
+ expect(usePlayer.getState().positionMs).toBe(60_000)
+})
+
+test('tick follows the audio without asking the engine to move', () => {
+ usePlayer.getState().playTracks(all)
+ usePlayer.getState().tick(1234)
+ expect(usePlayer.getState().positionMs).toBe(1234)
+ expect(usePlayer.getState().seekId).toBe(0)
+})
+
+test('enqueue adds to the end and playNext right after the current track', () => {
+ usePlayer.getState().playTracks([t1, t2, t3], 1)
+ usePlayer.getState().enqueue(t5)
+ usePlayer.getState().playNext(t4)
+ expect(ids()).toEqual([1, 2, 4, 3, 5])
+ expect(current()).toBe(t2)
+})
+
+test('playNext on an empty queue makes the track the only one', () => {
+ usePlayer.getState().playNext(t3)
+ expect(ids()).toEqual([3])
+ expect(current()).toBe(t3)
+ expect(usePlayer.getState().playing).toBe(false)
+})
+
+test('removing a track before the current one keeps the current track playing', () => {
+ usePlayer.getState().playTracks(all, 3)
+ usePlayer.getState().removeAt(0)
+ expect(ids()).toEqual([2, 3, 4, 5])
+ expect(current()).toBe(t4)
+})
+
+test('removing a track after the current one leaves the current track alone', () => {
+ usePlayer.getState().playTracks(all, 1)
+ usePlayer.getState().removeAt(3)
+ expect(ids()).toEqual([1, 2, 3, 5])
+ expect(current()).toBe(t2)
+})
+
+test('removing the current track plays the one that followed it', () => {
+ usePlayer.getState().playTracks(all, 1)
+ usePlayer.getState().tick(9000)
+ usePlayer.getState().removeAt(1)
+ expect(ids()).toEqual([1, 3, 4, 5])
+ expect(current()).toBe(t3)
+ expect(usePlayer.getState().playing).toBe(true)
+ expect(usePlayer.getState().positionMs).toBe(0)
+})
+
+test('removing the current track when it is the last one stops the player', () => {
+ usePlayer.getState().playTracks([t1, t2], 1)
+ usePlayer.getState().removeAt(1)
+ expect(ids()).toEqual([1])
+ expect(current()).toBe(t1)
+ expect(usePlayer.getState().playing).toBe(false)
+})
+
+test('removing the only track empties the queue and stops', () => {
+ usePlayer.getState().playTracks([t1])
+ usePlayer.getState().removeAt(0)
+ expect(ids()).toEqual([])
+ expect(current()).toBeNull()
+ expect(usePlayer.getState().playing).toBe(false)
+})
+
+test('removing a position that does not exist changes nothing', () => {
+ usePlayer.getState().playTracks(all)
+ usePlayer.getState().removeAt(9)
+ usePlayer.getState().removeAt(-1)
+ expect(ids()).toEqual([1, 2, 3, 4, 5])
+})
+
+test('jumpTo plays the track at that position from the start', () => {
+ usePlayer.getState().playTracks(all, 0)
+ usePlayer.getState().togglePlay() // paused
+ usePlayer.getState().tick(7000)
+ usePlayer.getState().jumpTo(3)
+ expect(current()).toBe(t4)
+ expect(usePlayer.getState().playing).toBe(true)
+ expect(usePlayer.getState().positionMs).toBe(0)
+})
+
+test('jumpTo the track already playing starts it over', () => {
+ usePlayer.getState().playTracks(all, 1)
+ const before = usePlayer.getState().seekId
+ usePlayer.getState().jumpTo(1)
+ expect(current()).toBe(t2)
+ expect(usePlayer.getState().seekId).toBe(before + 1)
+})
+
+test('jumpTo a position that does not exist changes nothing', () => {
+ usePlayer.getState().playTracks(all, 1)
+ usePlayer.getState().jumpTo(9)
+ usePlayer.getState().jumpTo(-1)
+ expect(current()).toBe(t2)
+})
+
+test('turning shuffle on reorders only the tracks after the current one', () => {
+ usePlayer.getState().playTracks(all, 1)
+ usePlayer.getState().toggleShuffle()
+ // with a random source that always answers 0 the rest [3,4,5] becomes [4,5,3]
+ expect(ids()).toEqual([1, 2, 4, 5, 3])
+ expect(current()).toBe(t2)
+ expect(usePlayer.getState().shuffle).toBe(true)
+})
+
+test('turning shuffle off restores the original order around the current track', () => {
+ usePlayer.getState().playTracks(all, 0)
+ usePlayer.getState().toggleShuffle()
+ usePlayer.getState().next() // now on the second track of the shuffled order
+ const playing = current()!
+ usePlayer.getState().toggleShuffle()
+ expect(ids()).toEqual([1, 2, 3, 4, 5])
+ expect(current()).toBe(playing)
+ expect(usePlayer.getState().shuffle).toBe(false)
+})
+
+test('shuffle on and straight off gives back the same queue', () => {
+ usePlayer.getState().playTracks(all, 2)
+ usePlayer.getState().toggleShuffle()
+ usePlayer.getState().toggleShuffle()
+ expect(ids()).toEqual([1, 2, 3, 4, 5])
+ expect(current()).toBe(t3)
+})
+
+test('a track added while shuffled is kept in the original order when shuffle is turned off', () => {
+ usePlayer.getState().playTracks([t1, t2, t3], 0)
+ usePlayer.getState().toggleShuffle()
+ usePlayer.getState().enqueue(t4)
+ usePlayer.getState().toggleShuffle()
+ expect(ids()).toEqual([1, 2, 3, 4])
+})
+
+test('with shuffle on, playTracks starts at the chosen track and shuffles the rest', () => {
+ usePlayer.getState().toggleShuffle()
+ usePlayer.getState().playTracks(all, 2)
+ expect(current()).toBe(t3)
+ expect(usePlayer.getState().index).toBe(0)
+ expect(ids().slice().sort()).toEqual([1, 2, 3, 4, 5])
+ expect(ids()[0]).toBe(3)
+})
diff --git a/web/src/player/store.ts b/web/src/player/store.ts
new file mode 100644
index 0000000..ab2c131
--- /dev/null
+++ b/web/src/player/store.ts
@@ -0,0 +1,192 @@
+import { create } from 'zustand'
+import type { Track } from '@/api/catalog'
+
+export type Repeat = 'off' | 'all' | 'one'
+
+export interface PlayerState {
+ queue: Track[]
+ index: number
+ playing: boolean
+ positionMs: number
+ shuffle: boolean
+ repeat: Repeat
+ /** The queue in its own order, kept while it is shuffled so that turning shuffle off can restore it. */
+ original: Track[]
+ /** The audio engine moves to `seekMs` whenever `seekId` changes. */
+ seekMs: number | null
+ seekId: number
+ /** Changes every time a new list is started, so that playing the same track again restarts it. */
+ playId: number
+
+ playTracks(tracks: Track[], start?: number): void
+ togglePlay(): void
+ next(): void
+ prev(): void
+ trackEnded(): void
+ seek(ms: number): void
+ tick(positionMs: number): void
+ enqueue(track: Track): void
+ playNext(track: Track): void
+ removeAt(i: number): void
+ toggleShuffle(): void
+ cycleRepeat(): void
+ /** Plays the track at this position of the queue from the start. */
+ jumpTo(i: number): void
+}
+
+let random: () => number = Math.random
+
+/** Tests replace the random source to get a known shuffle. */
+export function setRandom(fn: () => number): void {
+ random = fn
+}
+
+/** Fisher–Yates on a copy. */
+function shuffled(items: T[]): T[] {
+ const out = items.slice()
+ for (let i = out.length - 1; i > 0; i--) {
+ const j = Math.floor(random() * (i + 1))
+ ;[out[i], out[j]] = [out[j], out[i]]
+ }
+ return out
+}
+
+export function currentTrack(state: Pick): Track | null {
+ return state.queue[state.index] ?? null
+}
+
+/** The fields that make the engine start the current track over. */
+const restart = (s: PlayerState) => ({ positionMs: 0, seekMs: 0, seekId: s.seekId + 1 })
+
+const RESTART_AFTER_MS = 3000
+
+export const usePlayer = create()((set, get) => ({
+ queue: [],
+ index: 0,
+ playing: false,
+ positionMs: 0,
+ shuffle: false,
+ repeat: 'off',
+ original: [],
+ seekMs: null,
+ seekId: 0,
+ playId: 0,
+
+ playTracks(tracks, start = 0) {
+ set((s) => {
+ if (tracks.length === 0) {
+ return { queue: [], original: [], index: 0, playing: false, positionMs: 0, playId: s.playId + 1 }
+ }
+ const i = Math.min(Math.max(start, 0), tracks.length - 1)
+ const queue = s.shuffle ? [tracks[i], ...shuffled(tracks.filter((_, k) => k !== i))] : tracks
+ return {
+ queue,
+ original: tracks,
+ index: s.shuffle ? 0 : i,
+ playing: true,
+ positionMs: 0,
+ playId: s.playId + 1,
+ }
+ })
+ },
+
+ togglePlay() {
+ set((s) => (currentTrack(s) ? { playing: !s.playing } : s))
+ },
+
+ next() {
+ set((s) => {
+ if (s.queue.length === 0) return s
+ if (s.index < s.queue.length - 1) return { index: s.index + 1, playing: true, positionMs: 0 }
+ if (s.repeat === 'all') {
+ return { index: 0, playing: true, positionMs: 0, ...(s.index === 0 ? restart(s) : {}) }
+ }
+ return { playing: false, ...restart(s) }
+ })
+ },
+
+ prev() {
+ set((s) => {
+ if (s.queue.length === 0) return s
+ if (s.positionMs > RESTART_AFTER_MS || s.index === 0) return restart(s)
+ return { index: s.index - 1, playing: true, positionMs: 0 }
+ })
+ },
+
+ trackEnded() {
+ const s = get()
+ if (s.repeat === 'one' && currentTrack(s)) set({ playing: true, ...restart(s) })
+ else s.next()
+ },
+
+ seek(ms) {
+ set((s) => {
+ const duration = currentTrack(s)?.duration_ms ?? 0
+ const clamped = Math.max(0, duration > 0 ? Math.min(ms, duration) : ms)
+ return { positionMs: clamped, seekMs: clamped, seekId: s.seekId + 1 }
+ })
+ },
+
+ tick(positionMs) {
+ set({ positionMs })
+ },
+
+ enqueue(track) {
+ set((s) => ({ queue: [...s.queue, track], original: [...s.original, track] }))
+ },
+
+ playNext(track) {
+ set((s) => {
+ if (s.queue.length === 0) return { queue: [track], original: [track], index: 0 }
+ const queue = s.queue.slice()
+ queue.splice(s.index + 1, 0, track)
+ const original = s.original.slice()
+ const at = original.indexOf(currentTrack(s)!)
+ original.splice(at + 1, 0, track)
+ return { queue, original }
+ })
+ },
+
+ removeAt(i) {
+ set((s) => {
+ if (i < 0 || i >= s.queue.length) return s
+ const removed = s.queue[i]
+ const queue = s.queue.filter((_, k) => k !== i)
+ const original = s.original.slice()
+ const at = original.indexOf(removed)
+ if (at >= 0) original.splice(at, 1)
+
+ if (queue.length === 0) return { queue, original, index: 0, playing: false, positionMs: 0 }
+ if (i < s.index) return { queue, original, index: s.index - 1 }
+ if (i > s.index) return { queue, original }
+ // The current track was removed: the one that followed it is now at the same position.
+ if (i < queue.length) return { queue, original, playing: true, positionMs: 0 }
+ return { queue, original, index: queue.length - 1, playing: false, positionMs: 0 }
+ })
+ },
+
+ toggleShuffle() {
+ set((s) => {
+ if (!s.shuffle) {
+ const queue = [...s.queue.slice(0, s.index + 1), ...shuffled(s.queue.slice(s.index + 1))]
+ return { shuffle: true, queue, original: s.queue.slice() }
+ }
+ const now = currentTrack(s)
+ const found = now ? s.original.indexOf(now) : -1
+ const index = found >= 0 ? found : Math.min(s.index, Math.max(s.original.length - 1, 0))
+ return { shuffle: false, queue: s.original.slice(), index }
+ })
+ },
+
+ cycleRepeat() {
+ set((s) => ({ repeat: s.repeat === 'off' ? 'all' : s.repeat === 'all' ? 'one' : 'off' }))
+ },
+
+ jumpTo(i) {
+ set((s) => {
+ if (i < 0 || i >= s.queue.length) return s
+ if (i === s.index) return { playing: true, ...restart(s) }
+ return { index: i, playing: true, positionMs: 0 }
+ })
+ },
+}))
diff --git a/web/src/player/ui.ts b/web/src/player/ui.ts
new file mode 100644
index 0000000..de28b27
--- /dev/null
+++ b/web/src/player/ui.ts
@@ -0,0 +1,7 @@
+import { create } from 'zustand'
+
+/** Whether the full-screen player is open. */
+export const useNowPlayingUi = create<{ open: boolean; setOpen(open: boolean): void }>()((set) => ({
+ open: false,
+ setOpen: (open) => set({ open }),
+}))
diff --git a/web/src/player/usePlayer.test.tsx b/web/src/player/usePlayer.test.tsx
new file mode 100644
index 0000000..6b45fca
--- /dev/null
+++ b/web/src/player/usePlayer.test.tsx
@@ -0,0 +1,135 @@
+import { act, renderHook, waitFor } from '@testing-library/react'
+import { beforeEach, expect, test, vi } from 'vitest'
+import type { Track } from '@/api/catalog'
+import { sessionStore } from '@/auth/session'
+import { mockFetch } from '@/test/mockFetch'
+import { usePlayer } from './store'
+import { usePlayerEngine } from './usePlayer'
+
+class FakeElement extends EventTarget {
+ src = ''
+ currentTime = 0
+ duration = Number.NaN
+ paused = true
+ play() {
+ this.paused = false
+ return Promise.resolve()
+ }
+ pause() {
+ this.paused = true
+ }
+}
+
+let audio: FakeElement
+
+const track: Track = {
+ id: 1,
+ title: 'Airbag',
+ duration_ms: 284_000,
+ track_no: 1,
+ disc_no: 1,
+ album: null,
+ artists: [],
+ format: 'mp3',
+}
+
+function listenCalls(calls: { key: string; init: RequestInit }[]) {
+ return calls.filter((c) => c.key === 'POST /api/v1/listens').map((c) => ({ ...c, body: JSON.parse(c.init.body as string) }))
+}
+
+beforeEach(() => {
+ audio = new FakeElement()
+ vi.stubGlobal('Audio', function () {
+ return audio
+ })
+ usePlayer.setState({
+ queue: [],
+ original: [],
+ index: 0,
+ playing: false,
+ positionMs: 0,
+ shuffle: false,
+ repeat: 'off',
+ seekMs: null,
+ seekId: 0,
+ playId: 0,
+ })
+ sessionStore.setState({
+ status: 'authenticated',
+ user: { id: 1, username: 'tom', is_admin: false },
+ accessToken: 'tok',
+ accessExpiresAt: Date.now() + 600_000,
+ refreshToken: 'r',
+ })
+})
+
+function play(seconds: number) {
+ act(() => usePlayer.getState().playTracks([track]))
+ audio.currentTime = seconds
+ audio.dispatchEvent(new Event('timeupdate'))
+}
+
+test('a track played to its end is reported once as complete with the time played', async () => {
+ const { calls } = mockFetch({ 'POST /api/v1/listens': () => ({ status: 'recorded', counted: true }) })
+ renderHook(() => usePlayerEngine())
+ play(1.5)
+ act(() => {
+ audio.dispatchEvent(new Event('ended'))
+ })
+ await waitFor(() => expect(listenCalls(calls)).toHaveLength(1))
+ expect(listenCalls(calls)[0].body).toMatchObject({ track_id: 1, event_type: 'complete', duration_played_ms: 1500 })
+ expect(listenCalls(calls)[0].body.idempotency_key).toMatch(/\S+/)
+})
+
+test('closing the page mid-track reports the play as it stands, and lets the request outlive the page', async () => {
+ const { calls } = mockFetch({ 'POST /api/v1/listens': () => ({ status: 'recorded', counted: false }) })
+ renderHook(() => usePlayerEngine())
+ play(1.5)
+ window.dispatchEvent(new Event('pagehide'))
+ await waitFor(() => expect(listenCalls(calls)).toHaveLength(1))
+ expect(listenCalls(calls)[0].body).toMatchObject({ event_type: 'play', duration_played_ms: 1500 })
+ expect(listenCalls(calls)[0].init.keepalive).toBe(true)
+})
+
+test('a play is reported where crypto.randomUUID does not exist, as on a page opened over plain HTTP', async () => {
+ const real = globalThis.crypto
+ vi.stubGlobal('crypto', { getRandomValues: (a: Uint8Array) => real.getRandomValues(a) })
+ const { calls } = mockFetch({ 'POST /api/v1/listens': () => ({ status: 'recorded', counted: true }) })
+ renderHook(() => usePlayerEngine())
+ play(1.5)
+ act(() => {
+ audio.dispatchEvent(new Event('ended'))
+ })
+ await waitFor(() => expect(listenCalls(calls)).toHaveLength(1))
+ expect(listenCalls(calls)[0].body.idempotency_key).toMatch(/^[0-9a-f-]{36}$/)
+})
+
+test('when the app closes the music stops and the queue is emptied, so nobody inherits it', () => {
+ const { unmount } = renderHook(() => usePlayerEngine())
+ play(1.5)
+ expect(usePlayer.getState().queue).toHaveLength(1)
+ unmount()
+ expect(usePlayer.getState().queue).toEqual([])
+ expect(usePlayer.getState().playing).toBe(false)
+ expect(audio.paused).toBe(true)
+})
+
+test('hiding the tab does not end a play: the music goes on in the background', async () => {
+ const { calls } = mockFetch({ 'POST /api/v1/listens': () => ({ status: 'recorded', counted: true }) })
+ renderHook(() => usePlayerEngine())
+ play(1.5)
+ vi.spyOn(document, 'visibilityState', 'get').mockReturnValue('hidden')
+ document.dispatchEvent(new Event('visibilitychange'))
+ await Promise.resolve()
+ expect(listenCalls(calls)).toHaveLength(0)
+})
+
+test('once the engine is unmounted the page closing reports nothing', async () => {
+ const { calls } = mockFetch({ 'POST /api/v1/listens': () => ({ status: 'recorded', counted: true }) })
+ const { unmount } = renderHook(() => usePlayerEngine())
+ play(1.5)
+ unmount()
+ window.dispatchEvent(new Event('pagehide'))
+ await Promise.resolve()
+ expect(listenCalls(calls)).toHaveLength(0)
+})
diff --git a/web/src/player/usePlayer.ts b/web/src/player/usePlayer.ts
new file mode 100644
index 0000000..6f713c3
--- /dev/null
+++ b/web/src/player/usePlayer.ts
@@ -0,0 +1,51 @@
+import { useEffect } from 'react'
+import { sendListen } from '@/api/listens'
+import { uuid } from '@/lib/uuid'
+import { createEngine } from './engine'
+import { createListenReporter } from './listens'
+import { setMediaSession } from './mediaSession'
+import { currentTrack, usePlayer } from './store'
+
+/**
+ * Mounts the audio engine once for the whole app. It also reports every play to the server, and keeps
+ * the media keys and the lock screen in step.
+ */
+export function usePlayerEngine(): void {
+ useEffect(() => {
+ const audio = new Audio()
+ const reporter = createListenReporter({
+ send: sendListen,
+ uuid,
+ now: () => new Date(),
+ })
+ const engine = createEngine(audio, {
+ onStart: reporter.start,
+ onPlayed: reporter.addPlayed,
+ onFinish: reporter.finish,
+ })
+
+ // Only closing the page ends a play early. A hidden tab keeps playing, so it is not an end.
+ const onPageHide = () => reporter.flushOnHide()
+ window.addEventListener('pagehide', onPageHide)
+
+ const keys = {
+ play: () => !usePlayer.getState().playing && usePlayer.getState().togglePlay(),
+ pause: () => usePlayer.getState().playing && usePlayer.getState().togglePlay(),
+ next: () => usePlayer.getState().next(),
+ prev: () => usePlayer.getState().prev(),
+ }
+ const stopMediaSession = usePlayer.subscribe((state, previous) => {
+ const track = currentTrack(state)
+ if (track?.id !== currentTrack(previous)?.id) setMediaSession(track, keys)
+ })
+
+ return () => {
+ window.removeEventListener('pagehide', onPageHide)
+ stopMediaSession()
+ engine.destroy()
+ audio.pause()
+ // The app is closing (signed out): the next person to sign in on this page must not inherit the queue.
+ usePlayer.getState().playTracks([])
+ }
+ }, [])
+}
diff --git a/web/src/router.tsx b/web/src/router.tsx
new file mode 100644
index 0000000..1771082
--- /dev/null
+++ b/web/src/router.tsx
@@ -0,0 +1,28 @@
+import type { RouteObject } from 'react-router-dom'
+import Shell from '@/components/layout/Shell'
+import AlbumPage from '@/pages/AlbumPage'
+import AlbumsPage from '@/pages/AlbumsPage'
+import ArtistPage from '@/pages/ArtistPage'
+import ArtistsPage from '@/pages/ArtistsPage'
+import HomePage from '@/pages/HomePage'
+import NotFoundPage from '@/pages/NotFoundPage'
+import SearchPage from '@/pages/SearchPage'
+import SettingsPage from '@/pages/SettingsPage'
+import SongsPage from '@/pages/SongsPage'
+
+export const routes: RouteObject[] = [
+ {
+ element: ,
+ children: [
+ { path: '/', element: },
+ { path: '/search', element: },
+ { path: '/artists', element: },
+ { path: '/artists/:id', element: },
+ { path: '/albums', element: },
+ { path: '/albums/:id', element: },
+ { path: '/songs', element: },
+ { path: '/settings', element: },
+ { path: '*', element: },
+ ],
+ },
+]
diff --git a/web/src/smoke.test.tsx b/web/src/smoke.test.tsx
new file mode 100644
index 0000000..a98ac42
--- /dev/null
+++ b/web/src/smoke.test.tsx
@@ -0,0 +1,22 @@
+import { render, screen } from '@testing-library/react'
+import { beforeEach, expect, test, vi } from 'vitest'
+import App from './App'
+import { sessionStore } from './auth/session'
+import { initI18n } from './i18n'
+
+beforeEach(async () => {
+ vi.spyOn(navigator, 'language', 'get').mockReturnValue('en-US')
+ await initI18n()
+})
+
+test('a signed-in user sees the app', () => {
+ sessionStore.setState({ status: 'authenticated', user: { id: 1, username: 'tom', is_admin: true } })
+ render( )
+ expect(screen.getByText('Sonda')).toBeInTheDocument()
+})
+
+test('a signed-out user sees the sign-in form instead', () => {
+ sessionStore.setState({ status: 'anonymous', user: null })
+ render( )
+ expect(screen.getByLabelText('Username')).toBeInTheDocument()
+})
diff --git a/web/src/test/mockFetch.ts b/web/src/test/mockFetch.ts
new file mode 100644
index 0000000..ad2ad6e
--- /dev/null
+++ b/web/src/test/mockFetch.ts
@@ -0,0 +1,51 @@
+import { vi } from 'vitest'
+
+export interface MockRequest {
+ url: URL
+ init: RequestInit
+}
+
+type Reply = Response | object | undefined
+export type MockRoutes = Record Reply | Promise>
+
+export interface RecordedCall {
+ key: string
+ url: URL
+ init: RequestInit
+}
+
+/**
+ * Replaces the global fetch. A route key is "METHOD /api/v1/path" (the query is not part of the key).
+ * A handler may return a Response, or any object, which becomes a 200 JSON response.
+ * A request that matches no route throws, so a test never talks to a real server by accident.
+ */
+export function mockFetch(routes: MockRoutes): { calls: RecordedCall[] } {
+ const calls: RecordedCall[] = []
+ vi.stubGlobal(
+ 'fetch',
+ vi.fn(async (input: RequestInfo | URL, init: RequestInit = {}) => {
+ const raw = typeof input === 'string' ? input : input instanceof URL ? input.href : input.url
+ const url = new URL(raw, 'http://sonda.test')
+ const method = (init.method ?? 'GET').toUpperCase()
+ const key = `${method} ${url.pathname}`
+ calls.push({ key, url, init })
+ const handler = routes[key]
+ if (!handler) throw new Error(`mockFetch: no route for ${key}`)
+ const reply = await handler({ url, init })
+ if (reply instanceof Response) return reply
+ return new Response(JSON.stringify(reply ?? {}), {
+ status: 200,
+ headers: { 'Content-Type': 'application/json' },
+ })
+ }),
+ )
+ return { calls }
+}
+
+/** An API error response in the shape the server uses. */
+export function apiError(status: number, code: string, message = code): Response {
+ return new Response(JSON.stringify({ error: { code, message } }), {
+ status,
+ headers: { 'Content-Type': 'application/json' },
+ })
+}
diff --git a/web/src/test/queryWrapper.tsx b/web/src/test/queryWrapper.tsx
new file mode 100644
index 0000000..3fa88b7
--- /dev/null
+++ b/web/src/test/queryWrapper.tsx
@@ -0,0 +1,10 @@
+import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
+import type { ReactNode } from 'react'
+
+/** A fresh query client per test, with retries off so a failing call fails at once. */
+export function createWrapper() {
+ const client = new QueryClient({ defaultOptions: { queries: { retry: false, gcTime: 0 } } })
+ return function Wrapper({ children }: { children: ReactNode }) {
+ return {children}
+ }
+}
diff --git a/web/src/test/setup.ts b/web/src/test/setup.ts
new file mode 100644
index 0000000..407244c
--- /dev/null
+++ b/web/src/test/setup.ts
@@ -0,0 +1,19 @@
+import '@testing-library/jest-dom/vitest'
+import { cleanup } from '@testing-library/react'
+import { afterEach, vi } from 'vitest'
+
+// jsdom has no media playback: its play, pause and load only print "not implemented".
+Object.defineProperty(window.HTMLMediaElement.prototype, 'play', { configurable: true, value: () => Promise.resolve() })
+Object.defineProperty(window.HTMLMediaElement.prototype, 'pause', { configurable: true, value: () => {} })
+Object.defineProperty(window.HTMLMediaElement.prototype, 'load', { configurable: true, value: () => {} })
+
+afterEach(() => {
+ cleanup()
+ vi.unstubAllGlobals()
+ vi.useRealTimers()
+ try {
+ localStorage.clear()
+ } catch {
+ // storage may be unavailable in a test that replaced it
+ }
+})
diff --git a/web/src/theme/contrast.test.ts b/web/src/theme/contrast.test.ts
new file mode 100644
index 0000000..fc4267a
--- /dev/null
+++ b/web/src/theme/contrast.test.ts
@@ -0,0 +1,55 @@
+import { readFileSync } from 'node:fs'
+import { resolve } from 'node:path'
+import { describe, expect, test } from 'vitest'
+import { THEMES } from './theme'
+
+// Vitest runs from web/. (import.meta.url is not a file URL under jsdom, and ?raw gives empty CSS.)
+const css = readFileSync(resolve(process.cwd(), 'src/theme/themes.css'), 'utf8')
+
+function parseTheme(id: string): Record {
+ const block = new RegExp(`\\[data-theme="${id}"\\]\\s*\\{([^}]*)\\}`).exec(css)
+ if (!block) throw new Error(`themes.css has no block for ${id}`)
+ const tokens: Record = {}
+ for (const m of block[1].matchAll(/--([a-z-]+):\s*(#[0-9a-fA-F]{6})\s*;/g)) tokens[m[1]] = m[2]
+ return tokens
+}
+
+function luminance(hex: string): number {
+ const channel = (i: number) => {
+ const c = parseInt(hex.slice(1 + i * 2, 3 + i * 2), 16) / 255
+ return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4
+ }
+ return 0.2126 * channel(0) + 0.7152 * channel(1) + 0.0722 * channel(2)
+}
+
+function ratio(a: string, b: string): number {
+ const [hi, lo] = [luminance(a), luminance(b)].sort((x, y) => y - x)
+ return (hi + 0.05) / (lo + 0.05)
+}
+
+// [foreground token, background token, minimum ratio]
+const pairs: [string, string, number][] = [
+ ['foreground', 'background', 4.5],
+ ['foreground', 'card', 4.5],
+ ['muted-foreground', 'background', 4.5],
+ ['muted-foreground', 'card', 4.5],
+ ['primary-foreground', 'primary', 4.5],
+ ['primary', 'background', 3],
+ ['input', 'background', 3],
+ ['input', 'card', 3],
+ ['ring', 'background', 3],
+]
+
+describe.each(THEMES.map((t) => t.id))('theme %s', (id) => {
+ const tokens = parseTheme(id)
+
+ test.each(pairs)('%s on %s is at least %d:1', (fg, bg, min) => {
+ expect(tokens[fg], `--${fg} missing`).toBeDefined()
+ expect(tokens[bg], `--${bg} missing`).toBeDefined()
+ expect(ratio(tokens[fg], tokens[bg])).toBeGreaterThanOrEqual(min)
+ })
+
+ test('defines a divider colour', () => {
+ expect(tokens['border']).toBeDefined()
+ })
+})
diff --git a/web/src/theme/theme.test.ts b/web/src/theme/theme.test.ts
new file mode 100644
index 0000000..a369b76
--- /dev/null
+++ b/web/src/theme/theme.test.ts
@@ -0,0 +1,55 @@
+import { afterEach, beforeEach, expect, test, vi } from 'vitest'
+import { getTheme, initTheme, setTheme, THEMES } from './theme'
+
+beforeEach(() => {
+ delete document.documentElement.dataset.theme
+})
+
+afterEach(() => {
+ vi.restoreAllMocks()
+})
+
+test('there are six themes and sonda comes first', () => {
+ expect(THEMES.map((t) => t.id)).toEqual(['sonda', 'tokyo-night', 'gruvbox-dark', 'gruvbox-light', 'dracula', 'neon'])
+})
+
+test('initTheme with nothing stored uses sonda', () => {
+ initTheme()
+ expect(document.documentElement.dataset.theme).toBe('sonda')
+ expect(getTheme()).toBe('sonda')
+})
+
+test('initTheme uses the stored theme', () => {
+ localStorage.setItem('sonda.theme', 'gruvbox-light')
+ initTheme()
+ expect(document.documentElement.dataset.theme).toBe('gruvbox-light')
+})
+
+test('initTheme falls back to sonda for a value it does not know', () => {
+ localStorage.setItem('sonda.theme', 'garbage')
+ initTheme()
+ expect(document.documentElement.dataset.theme).toBe('sonda')
+})
+
+test('setTheme stores the choice and sets data-theme', () => {
+ setTheme('tokyo-night')
+ expect(localStorage.getItem('sonda.theme')).toBe('tokyo-night')
+ expect(document.documentElement.dataset.theme).toBe('tokyo-night')
+ expect(getTheme()).toBe('tokyo-night')
+})
+
+test('setTheme still works when storage throws', () => {
+ vi.spyOn(Storage.prototype, 'setItem').mockImplementation(() => {
+ throw new Error('blocked')
+ })
+ expect(() => setTheme('gruvbox-dark')).not.toThrow()
+ expect(document.documentElement.dataset.theme).toBe('gruvbox-dark')
+})
+
+test('initTheme still works when reading storage throws', () => {
+ vi.spyOn(Storage.prototype, 'getItem').mockImplementation(() => {
+ throw new Error('blocked')
+ })
+ expect(() => initTheme()).not.toThrow()
+ expect(document.documentElement.dataset.theme).toBe('sonda')
+})
diff --git a/web/src/theme/theme.ts b/web/src/theme/theme.ts
new file mode 100644
index 0000000..9f9c2d8
--- /dev/null
+++ b/web/src/theme/theme.ts
@@ -0,0 +1,64 @@
+import { useSyncExternalStore } from 'react'
+
+export type ThemeId = 'sonda' | 'tokyo-night' | 'gruvbox-dark' | 'gruvbox-light' | 'dracula' | 'neon'
+
+export const THEMES: readonly { id: ThemeId; labelKey: string }[] = [
+ { id: 'sonda', labelKey: 'theme.sonda' },
+ { id: 'tokyo-night', labelKey: 'theme.tokyo-night' },
+ { id: 'gruvbox-dark', labelKey: 'theme.gruvbox-dark' },
+ { id: 'gruvbox-light', labelKey: 'theme.gruvbox-light' },
+ { id: 'dracula', labelKey: 'theme.dracula' },
+ { id: 'neon', labelKey: 'theme.neon' },
+]
+
+const KEY = 'sonda.theme'
+const DEFAULT: ThemeId = 'sonda'
+
+let current: ThemeId = DEFAULT
+const listeners = new Set<() => void>()
+
+function isThemeId(value: unknown): value is ThemeId {
+ return THEMES.some((t) => t.id === value)
+}
+
+function readStored(): string | null {
+ try {
+ return localStorage.getItem(KEY)
+ } catch {
+ return null
+ }
+}
+
+function apply(id: ThemeId) {
+ current = id
+ document.documentElement.dataset.theme = id
+ listeners.forEach((fn) => fn())
+}
+
+export function getTheme(): ThemeId {
+ return current
+}
+
+export function setTheme(id: ThemeId): void {
+ apply(id)
+ try {
+ localStorage.setItem(KEY, id)
+ } catch {
+ // The choice still applies for this page view.
+ }
+}
+
+export function initTheme(): void {
+ const stored = readStored()
+ apply(isThemeId(stored) ? stored : DEFAULT)
+}
+
+function subscribe(fn: () => void): () => void {
+ listeners.add(fn)
+ return () => listeners.delete(fn)
+}
+
+export function useTheme(): { theme: ThemeId; setTheme: (id: ThemeId) => void } {
+ const theme = useSyncExternalStore(subscribe, getTheme)
+ return { theme, setTheme }
+}
diff --git a/web/src/theme/themes.css b/web/src/theme/themes.css
new file mode 100644
index 0000000..104bf5b
--- /dev/null
+++ b/web/src/theme/themes.css
@@ -0,0 +1,139 @@
+/*
+ * The six themes. Every colour is a plain hex value so that contrast.test.ts can check it.
+ * Token names are the ones shadcn/ui uses.
+ * --border is a quiet divider; --input is the outline of a form control and has to be seen (3:1).
+ */
+
+[data-theme="sonda"] {
+ color-scheme: dark;
+ --background: #0a1218;
+ --foreground: #e8f1f2;
+ --card: #111c24;
+ --card-foreground: #e8f1f2;
+ --popover: #111c24;
+ --popover-foreground: #e8f1f2;
+ --primary: #3dd6b0;
+ --primary-foreground: #04231c;
+ --secondary: #182630;
+ --secondary-foreground: #e8f1f2;
+ --muted: #182630;
+ --muted-foreground: #93a7ae;
+ --accent: #182630;
+ --accent-foreground: #e8f1f2;
+ --destructive: #ff7a8a;
+ --border: #1e2f3a;
+ --input: #5e7a87;
+ --ring: #3dd6b0;
+}
+
+[data-theme="tokyo-night"] {
+ color-scheme: dark;
+ --background: #1a1b26;
+ --foreground: #c0caf5;
+ --card: #24283b;
+ --card-foreground: #c0caf5;
+ --popover: #24283b;
+ --popover-foreground: #c0caf5;
+ --primary: #7aa2f7;
+ --primary-foreground: #1a1b26;
+ --secondary: #2f3549;
+ --secondary-foreground: #c0caf5;
+ --muted: #2f3549;
+ --muted-foreground: #9aa5ce;
+ --accent: #2f3549;
+ --accent-foreground: #c0caf5;
+ --destructive: #f7768e;
+ --border: #3b4261;
+ --input: #7982aa;
+ --ring: #7aa2f7;
+}
+
+[data-theme="gruvbox-dark"] {
+ color-scheme: dark;
+ --background: #282828;
+ --foreground: #ebdbb2;
+ --card: #3c3836;
+ --card-foreground: #ebdbb2;
+ --popover: #3c3836;
+ --popover-foreground: #ebdbb2;
+ --primary: #fabd2f;
+ --primary-foreground: #282828;
+ --secondary: #504945;
+ --secondary-foreground: #ebdbb2;
+ --muted: #504945;
+ --muted-foreground: #bdae93;
+ --accent: #504945;
+ --accent-foreground: #ebdbb2;
+ --destructive: #fb4934;
+ --border: #504945;
+ --input: #928374;
+ --ring: #fabd2f;
+}
+
+/* The lively one: Dracula's violet ground with a hot pink accent. */
+[data-theme="dracula"] {
+ color-scheme: dark;
+ --background: #282a36;
+ --foreground: #f8f8f2;
+ --card: #343746;
+ --card-foreground: #f8f8f2;
+ --popover: #343746;
+ --popover-foreground: #f8f8f2;
+ --primary: #ff79c6;
+ --primary-foreground: #282a36;
+ --secondary: #44475a;
+ --secondary-foreground: #f8f8f2;
+ --muted: #44475a;
+ --muted-foreground: #b4b8d4;
+ --accent: #44475a;
+ --accent-foreground: #f8f8f2;
+ --destructive: #ff5555;
+ --border: #44475a;
+ --input: #7081b8;
+ --ring: #ff79c6;
+}
+
+/* The loudest one: colour in the surfaces too. Deep indigo ground, saturated violet panels, electric yellow. */
+[data-theme="neon"] {
+ color-scheme: dark;
+ --background: #14073d;
+ --foreground: #fff4ff;
+ --card: #2a1070;
+ --card-foreground: #fff4ff;
+ --popover: #2a1070;
+ --popover-foreground: #fff4ff;
+ --primary: #ffd23f;
+ --primary-foreground: #14073d;
+ --secondary: #4a22b0;
+ --secondary-foreground: #fff4ff;
+ --muted: #4a22b0;
+ --muted-foreground: #d4c2ff;
+ --accent: #5a2fd0;
+ --accent-foreground: #fff4ff;
+ --destructive: #ff6b81;
+ --border: #4a22b0;
+ --input: #9b85ff;
+ --ring: #ffd23f;
+}
+
+[data-theme="gruvbox-light"] {
+ color-scheme: light;
+ --background: #fbf1c7;
+ --foreground: #3c3836;
+ --card: #ebdbb2;
+ --card-foreground: #3c3836;
+ --popover: #ebdbb2;
+ --popover-foreground: #3c3836;
+ --primary: #af3a03;
+ --primary-foreground: #fbf1c7;
+ --secondary: #d5c4a1;
+ --secondary-foreground: #3c3836;
+ --muted: #d5c4a1;
+ --muted-foreground: #665c54;
+ --accent: #d5c4a1;
+ --accent-foreground: #3c3836;
+ --destructive: #9d0006;
+ --border: #d5c4a1;
+ --input: #7c6f64;
+ --ring: #af3a03;
+}
diff --git a/web/tsconfig.app.json b/web/tsconfig.app.json
new file mode 100644
index 0000000..1a101b3
--- /dev/null
+++ b/web/tsconfig.app.json
@@ -0,0 +1,27 @@
+{
+ "compilerOptions": {
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
+ "target": "es2023",
+ "lib": ["ES2023", "DOM"],
+ "module": "esnext",
+ "types": ["vite/client", "node"],
+ "allowArbitraryExtensions": true,
+ "paths": { "@/*": ["./src/*"] },
+ "skipLibCheck": true,
+
+ /* Bundler mode */
+ "moduleResolution": "bundler",
+ "allowImportingTsExtensions": true,
+ "verbatimModuleSyntax": true,
+ "moduleDetection": "force",
+ "noEmit": true,
+ "jsx": "react-jsx",
+
+ /* Linting */
+ "noUnusedLocals": true,
+ "noUnusedParameters": true,
+ "erasableSyntaxOnly": true,
+ "noFallthroughCasesInSwitch": true
+ },
+ "include": ["src"]
+}
diff --git a/web/tsconfig.json b/web/tsconfig.json
new file mode 100644
index 0000000..5d54e8a
--- /dev/null
+++ b/web/tsconfig.json
@@ -0,0 +1,10 @@
+{
+ "files": [],
+ "references": [
+ { "path": "./tsconfig.app.json" },
+ { "path": "./tsconfig.node.json" }
+ ],
+ "compilerOptions": {
+ "paths": { "@/*": ["./src/*"] }
+ }
+}
diff --git a/web/tsconfig.node.json b/web/tsconfig.node.json
new file mode 100644
index 0000000..8455dcb
--- /dev/null
+++ b/web/tsconfig.node.json
@@ -0,0 +1,23 @@
+{
+ "compilerOptions": {
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
+ "target": "es2023",
+ "lib": ["ES2023"],
+ "types": ["node"],
+ "skipLibCheck": true,
+
+ /* Bundler mode */
+ "module": "nodenext",
+ "allowImportingTsExtensions": true,
+ "verbatimModuleSyntax": true,
+ "moduleDetection": "force",
+ "noEmit": true,
+
+ /* Linting */
+ "noUnusedLocals": true,
+ "noUnusedParameters": true,
+ "erasableSyntaxOnly": true,
+ "noFallthroughCasesInSwitch": true
+ },
+ "include": ["vite.config.ts"]
+}
diff --git a/web/vite.config.ts b/web/vite.config.ts
new file mode 100644
index 0000000..d7fa32d
--- /dev/null
+++ b/web/vite.config.ts
@@ -0,0 +1,23 @@
+///
+import tailwindcss from '@tailwindcss/vite'
+import react from '@vitejs/plugin-react'
+import { fileURLToPath } from 'node:url'
+import { defineConfig } from 'vite'
+
+// The dev server proxies /api to a running sondad; set SONDA_URL to point elsewhere.
+const target = process.env.SONDA_URL ?? 'http://127.0.0.1:8080'
+
+export default defineConfig({
+ plugins: [react(), tailwindcss()],
+ resolve: {
+ alias: { '@': fileURLToPath(new URL('./src', import.meta.url)) },
+ },
+ server: {
+ proxy: { '/api': { target, changeOrigin: false } },
+ },
+ test: {
+ environment: 'jsdom',
+ setupFiles: ['./src/test/setup.ts'],
+ css: false,
+ },
+})