From 19632dbca998e9d6d70b50bc0c01cc44d112344d Mon Sep 17 00:00:00 2001 From: zendaya Date: Sun, 3 May 2026 18:22:01 +0200 Subject: [PATCH 1/2] feat: implement read access control for GET /v1/* routes and enhance health endpoint response - Introduced `require_protected_read_access` to enforce Bearer token authentication for read routes when `FLIGHTDECK_LOCAL_API_TOKEN` is set, aligning with the existing mutation access model. - Updated the `/health` endpoint to include `read_auth` in the response, indicating whether read routes require Bearer authentication. - Enhanced documentation to clarify the new access requirements for read APIs and updated related tests to validate the changes. This update strengthens security by ensuring that read operations are also protected when a local API token is configured, providing a consistent access control model across the API. --- .github/workflows/ci.yml | 4 +- AGENTS.md | 2 +- CHANGELOG.md | 4 ++ CLAUDE.md | 2 + DEVELOPMENT.md | 4 +- README.md | 2 +- SECURITY.md | 8 ++- docs/cli.md | 6 ++- docs/http-api.md | 26 +++++----- docs/operations-and-policy.md | 27 +++++++++- docs/sdk.md | 9 ++-- docs/web-ui.md | 7 +-- pyproject.toml | 14 ++++++ src/flightdeck/cli/main.py | 27 +++++++++- src/flightdeck/db_connect.py | 63 ++++++++++++++++++++++-- src/flightdeck/server/app.py | 10 ++-- src/flightdeck/server/mutation_access.py | 40 +++++++++++++-- src/flightdeck/server/routes/metrics.py | 5 +- src/flightdeck/server/routes/read.py | 5 +- tests/test_server_health.py | 25 +++++++++- web/README.md | 2 +- web/e2e/smoke.spec.ts | 6 ++- web/src/api.ts | 2 + web/src/components/SecurityStatusBar.tsx | 32 +++++++++--- web/src/pages/ActionsPage.tsx | 5 +- 25 files changed, 275 insertions(+), 62 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0357faf..10924b1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,7 +59,7 @@ jobs: run: uv run python -m ruff check src tests - name: Test - run: uv run python -m pytest + run: uv run python -m pytest --cov=flightdeck --cov-fail-under=80 --cov-report=term - name: JSON Schemas drift check run: | @@ -161,7 +161,7 @@ jobs: run: uv run python -m ruff check src tests - name: Test - run: uv run python -m pytest + run: uv run python -m pytest --cov=flightdeck --cov-fail-under=80 --cov-report=term - name: JSON Schemas drift check run: | diff --git a/AGENTS.md b/AGENTS.md index 82e0cff..968143b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -98,7 +98,7 @@ Fallback (activated **venv** or global tools): the same steps with **`python -m On **Windows**, use `py -3` in place of `python` if that is how your environment is set up. If pytest temp dirs fail with permissions, see **`DEVELOPMENT.md`** / **`tests/conftest.py`**. -**CI bar** (mirrors **`.github/workflows/ci.yml`** on the **`.python-version`** interpreter): see the workflow for the exact sequence; includes **`uv sync --frozen --extra dev`**, **`web/`** **`npm ci`** + **`npm run build`** + **`git diff --exit-code`** on **`static/`**, Playwright **`npm run test:e2e`**, **ruff**, **pytest**, schema drift check, **`flightdeck-quickstart-verify`**, **`flightdeck --help`**. When you change **`pyproject.toml`** optional extras (including **`flightdeck.integrations`** extras), run **`uv lock`** and commit **`uv.lock`**. The workflow may include a separate **integrations** job that **`uv sync`**s **`dev`** plus selected integration extras and runs targeted tests. +**CI bar** (mirrors **`.github/workflows/ci.yml`** on the **`.python-version`** interpreter): see the workflow for the exact sequence; includes **`uv sync --frozen --extra dev`**, **`web/`** **`npm ci`** + **`npm run build`** + **`git diff --exit-code`** on **`static/`**, Playwright **`npm run test:e2e`**, **ruff**, **`pytest --cov=flightdeck --cov-fail-under=80`**, schema drift check, **`flightdeck-quickstart-verify`**, **`flightdeck --help`**. When you change **`pyproject.toml`** optional extras (including **`flightdeck.integrations`** extras), run **`uv lock`** and commit **`uv.lock`**. The workflow may include a separate **integrations** job that **`uv sync`**s **`dev`** plus selected integration extras and runs targeted tests. Use a repo-local temp directory if the OS temp directory is restricted. diff --git a/CHANGELOG.md b/CHANGELOG.md index 3cb9a9d..d783c4c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ This project follows [Semantic Versioning](https://semver.org/). From **v1.0.0** ### Breaking - **`POST /v1/events`:** uses the same **`FLIGHTDECK_LOCAL_API_TOKEN`** / loopback policy as promotion and rollback. Remote unauthenticated ingest is no longer accepted; set the env var and send **`Authorization: Bearer`** (Python SDK **`api_token=`**, or **`--api-token`** / env in **[examples/integration/emit_sample_events.node.mjs](examples/integration/emit_sample_events.node.mjs)**). +- **`GET /v1/*`:** when **`FLIGHTDECK_LOCAL_API_TOKEN`** is set, read APIs require **`Authorization: Bearer`** (same header as writes); previously only mutations were Bearer-gated. - **Python:** **`requires-python`** is **`>=3.11,<4`** (replaces **`>=3.14,<3.15`**). **`[tool.ruff] target-version`** is **`py311`**. CI follows **`.python-version`** (currently **3.12**). ### Changed @@ -17,6 +18,9 @@ This project follows [Semantic Versioning](https://semver.org/). From **v1.0.0** ### Added +- **`GET /health`:** **`read_auth`** (`open` vs `bearer`) describes whether **`GET /v1/*`** requires **`Authorization: Bearer`** when **`FLIGHTDECK_LOCAL_API_TOKEN`** is set (aligned with writes). +- **SQLite:** bounded retries on **`database is locked` / busy** for ledger **`execute`** paths; **`flightdeck serve --sqlite-lock-timeout`** / **`--retry-sqlite-lock`** (and env **`FLIGHTDECK_SQLITE_*`**) plus **`docs/operations-and-policy.md`** concurrency notes. +- **CI / dev:** **`pytest-cov`** with **`--cov-fail-under=80`** on **`src/flightdeck`** (**`integrations/*`**, **`quickstart_smoke`**, and **`sdk/client.py`** omitted from the denominator — see **`[tool.coverage.run]`** in **`pyproject.toml`**). - **Experimental `flightdeck.integrations`:** optional extras **`integrations-langchain`**, **`integrations-temporal`**, **`integrations-openai-agents`**, and meta **`integrations-ci`** (CI job); thin mappers from OpenAI chat completions, Anthropic messages, OpenAI Agents–style results, LangChain callbacks, CrewAI-style manual totals, and Temporal-oriented **`labels`**. Docs: **`docs/sdk-integrations.md`**; examples: **`examples/integration/adoption/`**. Contributor policy updates in **`AGENTS.md`** / **`CLAUDE.md`**. ### Changed diff --git a/CLAUDE.md b/CLAUDE.md index cea0311..28d46ed 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -32,6 +32,8 @@ uv run flightdeck-quickstart-verify uv run flightdeck --help ``` +CI runs **`pytest --cov=flightdeck --cov-fail-under=80`** (see **`AGENTS.md`** / **`pyproject.toml`**). + If you changed **Pydantic / wire models** affecting **`schemas/`**: **`uv run python scripts/generate_schemas.py`**, then **`git diff --exit-code schemas/`** must be clean—commit **`schemas/`** updates with the PR. If you changed **`web/`** (React UI): from **`web/`**, run **`npm ci`** then **`npm run build`**, then from the repo root **`git diff --exit-code src/flightdeck/server/static/`** must be clean—commit all updates under that path (CI fails otherwise). When behavior changes, run **`npm run test:e2e`** from **`web/`**. diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 6930772..f42ccf7 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -28,7 +28,7 @@ Local driver test helper (Docker optional): **`scripts/run_postgres_tests.ps1`** | Extra | Packages installed | When to use | |-------|--------------------|-------------| -| `dev` | `pytest`, `ruff` | Development and CI; required to run tests and lint | +| `dev` | `pytest`, `pytest-cov`, `ruff` | Development and CI; required to run tests and lint | | `openai` | `openai>=1.0` | If you want to use the OpenAI Python client alongside the SDK in your own agent code (not required by FlightDeck core) | | `anthropic` | `anthropic>=0.20` | Same, for the Anthropic Python client | | `telemetry` | `opentelemetry-api`, `-sdk`, `-exporter-otlp` | Forward-looking OTLP integration; FlightDeck core does **not** import OpenTelemetry at runtime | @@ -270,7 +270,7 @@ virtual environment's Python executable directly: .venv/bin/python -m pytest ``` -Use **`uv run python -m pytest`** from the repo root so imports like **`from tests.test_spine import …`** resolve the same way as in CI. +Use **`uv run python -m pytest`** from the repo root so imports like **`from tests.test_spine import …`** resolve the same way as in CI. CI adds **`--cov=flightdeck --cov-fail-under=80`** (see **`[tool.coverage.run]`** in **`pyproject.toml`** for **`omit`** — integrations shims, the quickstart entrypoint, and the HTTP SDK client are excluded so the gate tracks core ledger/diff/policy code). ## Environment variables diff --git a/README.md b/README.md index a6d161d..752229a 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,7 @@ Shipped locally: ### Local HTTP API With **`flightdeck serve`** (default bind **127.0.0.1**), the app exposes **`GET /health`**, **`GET /v1/workspace`** -(read-only workspace flags for scripts and the bundled UI), **`GET /v1/metrics`**, **`GET /v1/releases`**, **`GET /v1/promoted`**, **`GET /v1/actions`**, **`GET /v1/promotion-requests`**, **`GET /v1/runs`**, **`POST /v1/events`**, **`POST /v1/diff`**, **`POST /v1/promote`**, **`POST /v1/promote/request`**, **`POST /v1/promote/confirm`**, and **`POST /v1/rollback`**. **`POST /v1/promote`**, **`POST /v1/promote/request`**, **`POST /v1/promote/confirm`**, **`POST /v1/rollback`**, and **`POST /v1/events`** accept requests only from loopback clients unless **`FLIGHTDECK_LOCAL_API_TOKEN`** is set, in which case callers must send **`Authorization: Bearer `** (same behavior as the **`web/`** dev UI via **`VITE_FLIGHTDECK_LOCAL_API_TOKEN`**). **`POST /v1/diff`** stays read-only and does not use that gate. See **[docs/http-api.md](docs/http-api.md)** and **[SECURITY.md](SECURITY.md)**. +(read-only workspace flags for scripts and the bundled UI), **`GET /v1/metrics`**, **`GET /v1/releases`**, **`GET /v1/promoted`**, **`GET /v1/actions`**, **`GET /v1/promotion-requests`**, **`GET /v1/runs`**, **`POST /v1/events`**, **`POST /v1/diff`**, **`POST /v1/promote`**, **`POST /v1/promote/request`**, **`POST /v1/promote/confirm`**, and **`POST /v1/rollback`**. **`POST /v1/promote`**, **`POST /v1/promote/request`**, **`POST /v1/promote/confirm`**, **`POST /v1/rollback`**, and **`POST /v1/events`** accept requests only from loopback clients unless **`FLIGHTDECK_LOCAL_API_TOKEN`** is set, in which case callers must send **`Authorization: Bearer `**; when that token is set, the same Bearer header is required for **`GET /v1/*`** read APIs (bundled UI via **`VITE_FLIGHTDECK_LOCAL_API_TOKEN`**). **`POST /v1/diff`** stays unauthenticated. See **[docs/http-api.md](docs/http-api.md)** and **[SECURITY.md](SECURITY.md)**. ## Quickstart diff --git a/SECURITY.md b/SECURITY.md index 4ff33cc..5f83f52 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -38,8 +38,12 @@ See **[CONTRIBUTING.md](CONTRIBUTING.md)** for a pre-push checklist aligned with The bundled server is intended for **local development and demos**. **`POST /v1/promote`**, **`POST /v1/promote/request`**, **`POST /v1/promote/confirm`**, **`POST /v1/rollback`**, and **`POST /v1/events`** (run event ingest) share one **ledger-write** access model in server code: with no token configured, only **loopback** clients (`127.0.0.1`, `::1`, `localhost`, and the Starlette test client) may call them. If you set **`FLIGHTDECK_LOCAL_API_TOKEN`**, every such request must include **`Authorization: Bearer `**; use a strong random value and treat it like a local secret. Remote emitters (agents, sidecars) must use the Bearer path when the server listens beyond loopback. -**Human approval** (`promotion_requires_approval: true` in `flightdeck.yaml`) adds a **second actor step** before a promote is applied: **`POST /v1/promote/request`** creates a pending row; **`POST /v1/promote/confirm`** completes it. **Policy still runs on confirm** — approval is not a bypass; a request that fails policy remains blocked with the same HTTP **409** outcome as a direct promote. **`GET /v1/workspace`**, **`GET /v1/promotion-requests`**, and other read-only **`GET /v1/*`** routes stay on the read tier (no Bearer required unless you add external controls). +**Human approval** (`promotion_requires_approval: true` in `flightdeck.yaml`) adds a **second actor step** before a promote is applied: **`POST /v1/promote/request`** creates a pending row; **`POST /v1/promote/confirm`** completes it. **Policy still runs on confirm** — approval is not a bypass; a request that fails policy remains blocked with the same HTTP **409** outcome as a direct promote. -**`POST /v1/diff`** is intentionally unauthenticated (read-only computation on stored evidence). When `flightdeck serve` binds to `127.0.0.1` (the default), callers are constrained by network topology; if you use **`--host 0.0.0.0`**, protect read routes at the network layer if exposure is a concern. +When **`FLIGHTDECK_LOCAL_API_TOKEN`** is set, **read-only `GET /v1/*`** routes (workspace, metrics, runs, audit slices, etc.) require the **same** **`Authorization: Bearer`** header as ledger writes, so port-forwards and shared networks do not expose the audit trail without credentials. With no token configured, those reads stay open—use network controls if you bind beyond loopback. + +**`POST /v1/diff`** is intentionally unauthenticated (read-only computation on stored evidence). When `flightdeck serve` binds to `127.0.0.1` (the default), callers are constrained by network topology; if you use **`--host 0.0.0.0`**, treat **`POST /v1/diff`** exposure explicitly. + +**SQLite:** one hot writer per workspace file is the safe default; parallel servers on the same path risk **`database is locked`**. The server retries for a bounded time (see **`flightdeck serve --help`** and **`docs/http-api.md`**). Prefer **separate workspace directories** per concurrent process in CI, or **`database_url`** (PostgreSQL) for multi-writer deployments. For **Compose healthchecks**, **SQLite backup** scheduling, and an **operator checklist** (logs, restarts, one writer per workspace file), see **[examples/deploy/README.md](examples/deploy/README.md)**. diff --git a/docs/cli.md b/docs/cli.md index 402f8be..526d07b 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -108,7 +108,7 @@ Failed checks print to stderr and exit 1. Passing exits 0. Start the local FlightDeck HTTP service. ```bash -flightdeck serve [--host HOST] [--port PORT] [--reload] +flightdeck serve [--host HOST] [--port PORT] [--reload] [--sqlite-lock-timeout SECONDS] [--retry-sqlite-lock / --no-retry-sqlite-lock] ``` | Option | Default | Description | @@ -116,12 +116,14 @@ flightdeck serve [--host HOST] [--port PORT] [--reload] | `--host` | `127.0.0.1` | Bind address. Non-loopback addresses print a security warning | | `--port` | `8765` | Bind port | | `--reload` | off | Hot-reload on source changes (development only) | +| `--sqlite-lock-timeout` | `30` | Seconds to retry SQLite `database is locked` / busy errors on ledger statements (`0` disables timed retries) | +| `--retry-sqlite-lock` | on | Retry locked/busy SQLite executes until the timeout elapses | The server exposes `/v1/*` JSON routes. See [http-api.md](http-api.md) for full route documentation. **Authentication:** set `FLIGHTDECK_LOCAL_API_TOKEN` to require a Bearer token for -mutation routes (`POST /v1/promote`, `POST /v1/rollback`). See +ledger writes and for **`GET /v1/*`** read APIs. See [http-api.md § Authentication](http-api.md). ```bash diff --git a/docs/http-api.md b/docs/http-api.md index d7cb34f..e6b2f06 100644 --- a/docs/http-api.md +++ b/docs/http-api.md @@ -10,6 +10,7 @@ default and is intended for **local development and CI**, not public exposure. flightdeck serve # default: 127.0.0.1:8765 flightdeck serve --port 9000 # custom port flightdeck serve --host 0.0.0.0 # non-loopback (prints warning; see Security) +flightdeck serve --sqlite-lock-timeout 45 --retry-sqlite-lock # SQLite busy/locked retries (default 30s on) ``` The server requires a `flightdeck.yaml` in the working directory. Run `flightdeck init` @@ -22,7 +23,7 @@ Two access tiers: | Route | No token configured | `FLIGHTDECK_LOCAL_API_TOKEN` set | |-------|--------------------|---------------------------------| | `GET /health` | open | open | -| `GET /v1/*` (reads, including `GET /v1/workspace`, `GET /v1/metrics`, `GET /v1/runs`, `GET /v1/runs/export`, `GET /v1/promotion-requests`) | open | open | +| `GET /v1/*` (reads: workspace, metrics, releases, promoted, actions, promotion-requests, runs, runs/export) | open | `Authorization: Bearer ` required | | `POST /v1/events` | loopback only | `Authorization: Bearer ` required | | `POST /v1/diff` | open | open | | `POST /v1/promote` | loopback only | `Authorization: Bearer ` required | @@ -30,11 +31,12 @@ Two access tiers: | `POST /v1/rollback` | loopback only | `Authorization: Bearer ` required | `POST /v1/events` uses the **same** loopback / Bearer gate as promote and rollback -(`require_ledger_write_access` in `server/mutation_access.py`). Remote agents must set -`FLIGHTDECK_LOCAL_API_TOKEN` on the server and send matching `Authorization: Bearer` headers -(including the Python SDK’s `api_token=`). When no token is configured, only loopback -callers (`127.0.0.1`, `::1`, `localhost`) may append run events, so binding `--host 0.0.0.0` -does not leave ingest open to arbitrary clients on the network. +(`require_ledger_write_access` in `server/mutation_access.py`). **`GET /v1/*`** uses +`require_protected_read_access`: with a token set, send the same **`Authorization: Bearer`** +header (Python SDK **`api_token=`**). Remote agents must set `FLIGHTDECK_LOCAL_API_TOKEN` on +the server and send matching Bearer headers when using non-loopback hosts. When no token is +configured, only loopback callers (`127.0.0.1`, `::1`, `localhost`) may append run events, so +binding `--host 0.0.0.0` does not leave ingest open to arbitrary clients on the network. ```bash export FLIGHTDECK_LOCAL_API_TOKEN="$(openssl rand -hex 32)" @@ -56,15 +58,17 @@ Health probe. Always returns HTTP 200 while the server is up. **Response** ```json -{"status": "ok", "mutation_auth": "loopback"} +{"status": "ok", "mutation_auth": "loopback", "read_auth": "open"} ``` -`mutation_auth` is always present on current servers: +`mutation_auth` and `read_auth` are always present on current servers: -- `"loopback"` — `FLIGHTDECK_LOCAL_API_TOKEN` is not set; ledger writes (including **`POST /v1/events`**) are allowed only from loopback clients (no Bearer gate). -- `"bearer"` — `FLIGHTDECK_LOCAL_API_TOKEN` is set; ledger writes require `Authorization: Bearer ` from any client host. +- **`mutation_auth`:** `"loopback"` — no API token; ledger writes (including **`POST /v1/events`**) are allowed only from loopback clients. `"bearer"` — token set; writes require `Authorization: Bearer ` from any host. +- **`read_auth`:** `"open"` — no API token; **`GET /v1/*`** need no Bearer. `"bearer"` — token set; read APIs require the same Bearer header as writes. -This field never includes secret material. +Neither field includes secret material. + +**SQLite contention:** parallel writers against the **same** workspace SQLite file can see `database is locked`. The server retries locked/busy statements for a bounded time (CLI **`--sqlite-lock-timeout`** / **`--no-retry-sqlite-lock`**, env **`FLIGHTDECK_SQLITE_LOCK_TIMEOUT_S`**, **`FLIGHTDECK_SQLITE_RETRY_ON_LOCK`**, **`FLIGHTDECK_SQLITE_BUSY_TIMEOUT_MS`** for `PRAGMA busy_timeout`). CI and multi-process setups should still use **one workspace path per concurrent server** or switch to **`database_url`** (PostgreSQL) for multi-writer throughput — see **[operations-and-policy.md](operations-and-policy.md#sqlite-concurrency-and-postgresql)**. --- diff --git a/docs/operations-and-policy.md b/docs/operations-and-policy.md index e5697a3..0e53a88 100644 --- a/docs/operations-and-policy.md +++ b/docs/operations-and-policy.md @@ -58,10 +58,33 @@ scenarios), it re-runs the same load-and-migrate sequence and stores the results it also means the working directory at **first request time** determines which `flightdeck.yaml` is loaded, not the directory at process start. -`_require_mutation_access` (called by `POST /v1/promote` and `POST /v1/rollback`) reads +`require_ledger_write_access` (ledger writes, including **`POST /v1/events`**) and +`require_protected_read_access` (**`GET /v1/*`** when a token is configured) read `request.app.state.local_api_token` set during lifespan or lazy init. The test client host `"testclient"` is included in `_LOCAL_CLIENT_HOSTS` alongside loopback addresses so that -integration tests can call mutation routes without a Bearer token. +integration tests can call **write** routes without a Bearer token when no server token is +set; when **`FLIGHTDECK_LOCAL_API_TOKEN`** is set, writes and reads require **Bearer** even +from the test client. + +--- + +## SQLite concurrency and PostgreSQL + +The default ledger is **SQLite** under **`.flightdeck/`**. SQLite allows **one writer at a +time** per database file. Running **multiple `flightdeck serve` processes** (or CI jobs) +against the **same** workspace directory can surface **`database is locked`** / +**`OperationalError`**. Mitigations: + +- **One server per workspace path** in automation; give each parallel job its own **`$WORKSPACE`** / temp dir (`flightdeck init` there). +- **Bounded retries:** the server retries locked/busy SQLite executes for up to + **`--sqlite-lock-timeout`** seconds (see **`flightdeck serve --help`** and env vars in + **`docs/http-api.md`**). This improves correctness under brief contention; it does not make + concurrent multi-writer access safe on one file. +- **PostgreSQL:** set **`database_url`** in **`flightdeck.yaml`** and install **`psycopg`** + (**`--extra postgres`**). Migrations are the same **`Storage.migrate()`** DDL as SQLite. + There is **no built-in SQLite → Postgres row copy**; for a controlled migration, export + evidence (**`runs export`**, **`GET /v1/runs/export`**) and re-ingest, or use your own ETL + plus a fresh Postgres workspace. --- diff --git a/docs/sdk.md b/docs/sdk.md index 0744b01..8bd687d 100644 --- a/docs/sdk.md +++ b/docs/sdk.md @@ -79,9 +79,10 @@ method is a coroutine. Call `await client.aclose()` instead of `client.close()`. When `flightdeck serve` is started with `FLIGHTDECK_LOCAL_API_TOKEN` set, every **ledger write** — **`POST /v1/promote`**, **`POST /v1/promote/request`**, **`POST /v1/promote/confirm`**, **`POST /v1/rollback`**, and **`POST /v1/events`** (`ingest_run_events`) — requires the -matching Bearer token on the `FlightdeckClient` (`api_token=…`). With no token configured -on the server, those routes accept only **loopback** callers; read routes and **`POST /v1/diff`** -stay open. +matching Bearer token on the `FlightdeckClient` (`api_token=…`). The same token is required +for **`GET /v1/*`** read APIs (`get_workspace`, `list_runs`, …). With no token configured on the +server, writes accept only **loopback** callers and reads are open; **`POST /v1/diff`** stays +unauthenticated regardless. ```python client = FlightdeckClient( @@ -96,7 +97,7 @@ See [SECURITY.md](../SECURITY.md) for the full access model. ### `health() -> dict` -`GET /health` — returns `{"status": "ok", "mutation_auth": "loopback"|"bearer"}` when the server is up (`mutation_auth` describes ledger-write auth, including event ingest; see **HTTP API**). +`GET /health` — returns `{"status": "ok", "mutation_auth": "…", "read_auth": "…"}` when the server is up (`mutation_auth` / `read_auth` describe write vs read Bearer policy; see **HTTP API**). ### `get_workspace() -> dict` diff --git a/docs/web-ui.md b/docs/web-ui.md index 0f940b4..6aaf080 100644 --- a/docs/web-ui.md +++ b/docs/web-ui.md @@ -112,7 +112,7 @@ Build-time configuration helpers read from `import.meta.env`: Mounted by `AppShell` at the top of the main content column (below the sidebar on wide layouts). Fetches `GET /health` -on mount to read `mutation_auth` (`"bearer"` or `"loopback"`), then renders an info or +on mount to read `mutation_auth` and `read_auth` (`"bearer"` / `"loopback"` and `"bearer"` / `"open"`), then renders an info or warning strip: | Condition | What is shown | @@ -127,8 +127,8 @@ warning strip: The component never displays the token value itself. It uses the `role="status"` ARIA role for live-region accessibility. -**Token mismatch detection:** when `mutation_auth` is `"bearer"` and -`clientMutationTokenConfigured()` is `false`, the strip warns that mutation requests will +**Token mismatch detection:** when the server uses a Bearer token (`mutation_auth` is `"bearer"`) and +`clientMutationTokenConfigured()` is `false`, the strip warns that API requests will fail. This is a configuration hint only — the server enforces the actual gate. --- @@ -266,6 +266,7 @@ type HealthPayload = { status: string; /** Present on current servers; "bearer" when FLIGHTDECK_LOCAL_API_TOKEN is set. */ mutation_auth?: "bearer" | "loopback"; + read_auth?: "bearer" | "open"; }; /** Mirrors the `policy` sub-object in promote/rollback responses and diff responses. */ diff --git a/pyproject.toml b/pyproject.toml index 9a7c48b..7d50194 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -50,6 +50,7 @@ all = [ ] dev = [ "pytest>=7.0", + "pytest-cov>=4.0", "ruff==0.15.12", ] postgres = [ @@ -91,3 +92,16 @@ testpaths = ["tests"] # Keep pytest basetemp under the repo (gitignored `.tmp/`) so Windows runs do not rely # on `%TEMP%\pytest-of-*`, which can raise PermissionError when scandir is denied. addopts = "--basetemp=.tmp/pytest" + +[tool.coverage.run] +source = ["src/flightdeck"] +omit = [ + "src/flightdeck/quickstart_smoke.py", + "src/flightdeck/integrations/*", + # Thin HTTP wrapper; core policy/diff/storage coverage is the governance bar. + "src/flightdeck/sdk/client.py", +] + +[tool.coverage.report] +show_missing = true +skip_empty = true diff --git a/src/flightdeck/cli/main.py b/src/flightdeck/cli/main.py index 0382779..b7b1fd1 100644 --- a/src/flightdeck/cli/main.py +++ b/src/flightdeck/cli/main.py @@ -120,10 +120,35 @@ def doctor_cmd(backup_path: Path | None) -> None: @click.option("--host", default="127.0.0.1", show_default=True) @click.option("--port", default=8765, show_default=True) @click.option("--reload", is_flag=True, default=False) -def serve(host: str, port: int, reload: bool) -> None: +@click.option( + "--sqlite-lock-timeout", + type=float, + default=30.0, + show_default=True, + help=( + "Seconds to retry SQLite 'database is locked' / 'busy' errors on ledger statements " + "(0 disables timed retries; PRAGMA busy_timeout still uses FLIGHTDECK_SQLITE_BUSY_TIMEOUT_MS)." + ), +) +@click.option( + "--retry-sqlite-lock/--no-retry-sqlite-lock", + default=True, + show_default=True, + help="Retry SQLite locked/busy errors until --sqlite-lock-timeout elapses.", +) +def serve( + host: str, + port: int, + reload: bool, + sqlite_lock_timeout: float, + retry_sqlite_lock: bool, +) -> None: """Start the local FlightDeck HTTP service (ingest + local release operations).""" import uvicorn + os.environ["FLIGHTDECK_SQLITE_LOCK_TIMEOUT_S"] = str(sqlite_lock_timeout) + os.environ["FLIGHTDECK_SQLITE_RETRY_ON_LOCK"] = "1" if retry_sqlite_lock else "0" + loopback_hosts = {"127.0.0.1", "::1", "localhost"} if host.strip() not in loopback_hosts: click.echo( diff --git a/src/flightdeck/db_connect.py b/src/flightdeck/db_connect.py index 22692c4..8566402 100644 --- a/src/flightdeck/db_connect.py +++ b/src/flightdeck/db_connect.py @@ -2,7 +2,10 @@ from __future__ import annotations +import os +import random import sqlite3 +import time from collections.abc import Iterator, Mapping from contextlib import contextmanager from typing import Any, Literal @@ -10,6 +13,40 @@ Backend = Literal["sqlite", "postgresql"] +def sqlite_busy_timeout_ms() -> int: + raw = os.environ.get("FLIGHTDECK_SQLITE_BUSY_TIMEOUT_MS", "").strip() + if raw: + try: + return max(0, int(raw)) + except ValueError: + pass + return 30_000 + + +def sqlite_lock_retry_enabled() -> bool: + v = os.environ.get("FLIGHTDECK_SQLITE_RETRY_ON_LOCK", "1").strip().lower() + return v not in ("0", "false", "no", "off") + + +def sqlite_lock_deadline_seconds() -> float | None: + """``None`` = do not spin on locked/busy (fail after first error). ``>0`` = wall-clock budget.""" + raw = os.environ.get("FLIGHTDECK_SQLITE_LOCK_TIMEOUT_S", "30").strip() + try: + t = float(raw) + except ValueError: + t = 30.0 + if t <= 0: + return None + return t + + +def _is_sqlite_busy_or_locked(exc: BaseException) -> bool: + if not isinstance(exc, sqlite3.OperationalError): + return False + msg = str(exc).lower() + return "locked" in msg or "busy" in msg + + def detect_backend(dsn: str) -> Backend: s = dsn.strip() if s.startswith(("postgresql://", "postgres://")): @@ -126,9 +163,25 @@ def execute(self, sql: str, params: tuple[Any, ...] | list[Any] | None = None) - p = tuple(params) if params is not None else () if self._backend == "sqlite": assert self._sqlite is not None - cur = self._sqlite.execute(sql2, p) - self._last = DbCursor(self._backend, cur, None) - return self._last + deadline_s = sqlite_lock_deadline_seconds() + retry_on = sqlite_lock_retry_enabled() and deadline_s is not None + start = time.monotonic() + attempt = 0 + while True: + try: + cur = self._sqlite.execute(sql2, p) + self._last = DbCursor(self._backend, cur, None) + return self._last + except sqlite3.OperationalError as e: + if not retry_on or not _is_sqlite_busy_or_locked(e): + raise + elapsed = time.monotonic() - start + if elapsed >= deadline_s: + raise + cap = deadline_s - elapsed + sleep = min(0.05 * (2 ** min(attempt, 8)), 1.0) * (0.5 + random.random()) + time.sleep(min(sleep, cap)) + attempt += 1 assert self._pg is not None require_psycopg() from psycopg.rows import dict_row @@ -168,7 +221,9 @@ def configure_sqlite(conn: sqlite3.Connection) -> None: conn.execute("PRAGMA foreign_keys=ON;") conn.execute("PRAGMA journal_mode=WAL;") conn.execute("PRAGMA synchronous=NORMAL;") - conn.execute("PRAGMA busy_timeout=5000;") + busy = sqlite_busy_timeout_ms() + # PRAGMA busy_timeout does not accept bound parameters on all SQLite builds. + conn.execute(f"PRAGMA busy_timeout={int(busy)};") @contextmanager diff --git a/src/flightdeck/server/app.py b/src/flightdeck/server/app.py index 9d11464..62eb7c6 100644 --- a/src/flightdeck/server/app.py +++ b/src/flightdeck/server/app.py @@ -33,18 +33,20 @@ async def lifespan(app: FastAPI): @app.get("/health") def health(request: Request) -> dict[str, str]: - """Liveness plus safe ledger-write auth hints (no secrets). + """Liveness plus safe API auth hints (no secrets). ``mutation_auth`` applies to **POST /v1/events** as well as promote/rollback: ``bearer`` when ``FLIGHTDECK_LOCAL_API_TOKEN`` is set (Bearer required for those routes from any client host), else ``loopback`` (writes allowed only from - loopback unless the token is configured). ``POST /v1/diff`` is not a ledger write - and stays unauthenticated. + loopback unless the token is configured). ``read_auth`` applies to **GET /v1/*** + (workspace, metrics, runs, …): ``bearer`` when the same token is set (Bearer + required), else ``open``. ``POST /v1/diff`` is not gated by these fields. """ token = getattr(request.app.state, "local_api_token", None) token_s = token.strip() if isinstance(token, str) else "" mutation_auth = "bearer" if token_s else "loopback" - return {"status": "ok", "mutation_auth": mutation_auth} + read_auth = "bearer" if token_s else "open" + return {"status": "ok", "mutation_auth": mutation_auth, "read_auth": read_auth} @app.get("/") def ui_index() -> FileResponse: diff --git a/src/flightdeck/server/mutation_access.py b/src/flightdeck/server/mutation_access.py index 3a62b9c..af39891 100644 --- a/src/flightdeck/server/mutation_access.py +++ b/src/flightdeck/server/mutation_access.py @@ -1,4 +1,4 @@ -"""Shared access control for HTTP routes that append to or mutate the workspace ledger.""" +"""Shared access control for HTTP routes that touch the workspace ledger or read its contents.""" from __future__ import annotations @@ -9,6 +9,37 @@ _LOCAL_CLIENT_HOSTS = frozenset({"127.0.0.1", "::1", "localhost", "testclient"}) +def _normalized_local_api_token(request: Request) -> str: + raw: str | None = getattr(request.app.state, "local_api_token", None) + if not isinstance(raw, str): + return "" + return raw.strip() + + +def _bearer_matches(request: Request, expected: str) -> bool: + auth_header = request.headers.get("authorization", "") + return auth_header == f"Bearer {expected}" + + +def require_protected_read_access(request: Request) -> None: + """When ``FLIGHTDECK_LOCAL_API_TOKEN`` is set, require Bearer on read ``GET /v1/*`` routes. + + With no token configured, read routes stay open (network placement is the operator's + boundary). With a token, every caller must send ``Authorization: Bearer `` — + same header as ledger writes — so shared clusters and port-forwards do not leak the + audit trail to unauthenticated peers. + """ + ensure_app_state(request) + expected = _normalized_local_api_token(request) + if not expected: + return + if not _bearer_matches(request, expected): + raise HTTPException( + status_code=401, + detail="Missing or invalid API token for read route.", + ) + + def require_ledger_write_access(request: Request) -> None: """Require loopback client or Bearer token (same model as promote/rollback). @@ -18,10 +49,9 @@ def require_ledger_write_access(request: Request) -> None: event ingest open to the whole network. """ ensure_app_state(request) - expected_token: str | None = getattr(request.app.state, "local_api_token", None) - auth_header = request.headers.get("authorization", "") - if expected_token: - if auth_header != f"Bearer {expected_token}": + expected = _normalized_local_api_token(request) + if expected: + if not _bearer_matches(request, expected): raise HTTPException(status_code=401, detail="Missing or invalid API token for mutation route.") return diff --git a/src/flightdeck/server/routes/metrics.py b/src/flightdeck/server/routes/metrics.py index 89bc4e6..5bc28bf 100644 --- a/src/flightdeck/server/routes/metrics.py +++ b/src/flightdeck/server/routes/metrics.py @@ -1,12 +1,13 @@ from __future__ import annotations -from fastapi import APIRouter, Request +from fastapi import APIRouter, Depends, Request from flightdeck.models import utc_now +from flightdeck.server.mutation_access import require_protected_read_access from flightdeck.server.routes.common import ensure_app_state from flightdeck.storage import LATEST_SCHEMA_MIGRATION_VERSION -router = APIRouter() +router = APIRouter(dependencies=[Depends(require_protected_read_access)]) @router.get("/v1/metrics") diff --git a/src/flightdeck/server/routes/read.py b/src/flightdeck/server/routes/read.py index 8913fcd..1c1f2ae 100644 --- a/src/flightdeck/server/routes/read.py +++ b/src/flightdeck/server/routes/read.py @@ -2,15 +2,16 @@ import json -from fastapi import APIRouter, HTTPException, Query, Request +from fastapi import APIRouter, Depends, HTTPException, Query, Request from fastapi.responses import StreamingResponse from flightdeck import __version__ as flightdeck_version from flightdeck.models import PromotionRequestRecord, WorkspacePublic from flightdeck.operations import OperationError, list_timeline, query_run_events_page +from flightdeck.server.mutation_access import require_protected_read_access from flightdeck.server.routes.common import ensure_app_state -router = APIRouter() +router = APIRouter(dependencies=[Depends(require_protected_read_access)]) @router.get("/v1/workspace") diff --git a/tests/test_server_health.py b/tests/test_server_health.py index 890a100..edaa544 100644 --- a/tests/test_server_health.py +++ b/tests/test_server_health.py @@ -19,7 +19,7 @@ def test_health_includes_mutation_auth_loopback_when_no_token(monkeypatch: pytes with TestClient(create_app()) as client: r = client.get("/health") assert r.status_code == 200 - assert r.json() == {"status": "ok", "mutation_auth": "loopback"} + assert r.json() == {"status": "ok", "mutation_auth": "loopback", "read_auth": "open"} def test_health_includes_mutation_auth_bearer_when_token_set(monkeypatch: pytest.MonkeyPatch) -> None: @@ -27,7 +27,7 @@ def test_health_includes_mutation_auth_bearer_when_token_set(monkeypatch: pytest with TestClient(create_app()) as client: r = client.get("/health") assert r.status_code == 200 - assert r.json() == {"status": "ok", "mutation_auth": "bearer"} + assert r.json() == {"status": "ok", "mutation_auth": "bearer", "read_auth": "bearer"} def test_health_whitespace_only_token_treated_as_loopback(monkeypatch: pytest.MonkeyPatch) -> None: @@ -36,6 +36,27 @@ def test_health_whitespace_only_token_treated_as_loopback(monkeypatch: pytest.Mo r = client.get("/health") assert r.status_code == 200 assert r.json()["mutation_auth"] == "loopback" + assert r.json()["read_auth"] == "open" + + +def test_get_v1_metrics_401_without_bearer_when_token_set(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None: + monkeypatch.setenv("FLIGHTDECK_LOCAL_API_TOKEN", "metrics-read-gate") + monkeypatch.chdir(tmp_path) + assert CliRunner().invoke(cli, ["init"]).exit_code == 0 + with TestClient(create_app()) as client: + r = client.get("/v1/metrics") + assert r.status_code == 401 + assert "read route" in r.json()["detail"] + + +def test_get_v1_metrics_200_with_bearer_when_token_set(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None: + monkeypatch.setenv("FLIGHTDECK_LOCAL_API_TOKEN", "metrics-read-ok") + monkeypatch.chdir(tmp_path) + assert CliRunner().invoke(cli, ["init"]).exit_code == 0 + with TestClient(create_app()) as client: + r = client.get("/v1/metrics", headers={"Authorization": "Bearer metrics-read-ok"}) + assert r.status_code == 200 + assert r.json()["counters"]["releases_total"] == 0 def test_v1_metrics_returns_counters(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None: diff --git a/web/README.md b/web/README.md index b684d4e..d5285e2 100644 --- a/web/README.md +++ b/web/README.md @@ -33,7 +33,7 @@ After any change under **`web/src/`** (or **`vite.config.ts`**, **`package.json` **Vite** proxies **`/v1/*`** and **`/health`** to **`http://127.0.0.1:8765`** (override with **`VITE_DEV_PROXY_TARGET`** in **`.env.local`** or the environment). The React app calls relative **`/v1/...`** URLs so the browser talks to the Vite dev server only. -**Auth:** when the server has **`FLIGHTDECK_LOCAL_API_TOKEN`** set, set **`VITE_FLIGHTDECK_LOCAL_API_TOKEN`** in **`.env.local`** to the same value so promote/rollback requests include **`Authorization: Bearer …`**. +**Auth:** when the server has **`FLIGHTDECK_LOCAL_API_TOKEN`** set, set **`VITE_FLIGHTDECK_LOCAL_API_TOKEN`** in **`.env.local`** to the same value so **`GET /v1/*`** and promote/rollback requests include **`Authorization: Bearer …`**. **Read-only UI:** set **`VITE_FLIGHTDECK_UI_READ_ONLY=true`** to hide the Promote nav entry and block **`#/actions`** (demos / wall displays). The shell still loads **`/health`** and shows a read-only banner. diff --git a/web/e2e/smoke.spec.ts b/web/e2e/smoke.spec.ts index 970d482..f94941c 100644 --- a/web/e2e/smoke.spec.ts +++ b/web/e2e/smoke.spec.ts @@ -51,7 +51,11 @@ test("actions page shows direct Promote when approval off", async ({ page }) => test("health endpoint", async ({ request }) => { const res = await request.get("/health"); expect(res.ok()).toBeTruthy(); - await expect(res.json()).resolves.toMatchObject({ status: "ok", mutation_auth: "loopback" }); + await expect(res.json()).resolves.toMatchObject({ + status: "ok", + mutation_auth: "loopback", + read_auth: "open", + }); }); test("security status reflects server loopback mode", async ({ page }) => { diff --git a/web/src/api.ts b/web/src/api.ts index eca5fd8..300f79f 100644 --- a/web/src/api.ts +++ b/web/src/api.ts @@ -37,6 +37,8 @@ export type HealthPayload = { status: string; /** Present on current servers; `bearer` when `FLIGHTDECK_LOCAL_API_TOKEN` is set. */ mutation_auth?: "bearer" | "loopback"; + /** `bearer` when the same token gates `GET /v1/*`; `open` when read routes need no Bearer. */ + read_auth?: "bearer" | "open"; }; /** diff --git a/web/src/components/SecurityStatusBar.tsx b/web/src/components/SecurityStatusBar.tsx index 8556284..c60b1c6 100644 --- a/web/src/components/SecurityStatusBar.tsx +++ b/web/src/components/SecurityStatusBar.tsx @@ -8,8 +8,15 @@ function resolveMutationAuth(data: HealthPayload): "bearer" | "loopback" | null return null; } +function resolveReadAuth(data: HealthPayload): "bearer" | "open" | null { + const r = data.read_auth; + if (r === "bearer" || r === "open") return r; + return null; +} + export function SecurityStatusBar() { const [auth, setAuth] = useState<"bearer" | "loopback" | null>(null); + const [readAuth, setReadAuth] = useState<"bearer" | "open" | null>(null); const [fetchErr, setFetchErr] = useState(null); const [healthLoading, setHealthLoading] = useState(true); @@ -21,11 +28,13 @@ export function SecurityStatusBar() { const h = await fetchHealth(); if (!cancelled) { setAuth(resolveMutationAuth(h)); + setReadAuth(resolveReadAuth(h)); setFetchErr(null); } } catch (e) { if (!cancelled) { setAuth(null); + setReadAuth(null); setFetchErr(String(e)); } } finally { @@ -56,7 +65,7 @@ export function SecurityStatusBar() {
Checking server security

- Checking /health for mutation rules… + Checking /health for API security…

@@ -78,10 +87,15 @@ export function SecurityStatusBar() { return null; } + const readLine = + readAuth === "bearer" + ? "GET /v1/* read APIs require the same Bearer token." + : "GET /v1/* read APIs are open (no Bearer) while the server has no API token configured."; + const serverLine = auth === "bearer" - ? "Server requires an Authorization: Bearer token for promote and rollback." - : "Server allows promote and rollback from loopback without a Bearer token."; + ? "Server requires an Authorization: Bearer token for ledger writes (ingest, promote, rollback)." + : "Server allows ledger writes from loopback without a Bearer token."; const clientLine = hasClient ? "This UI build sends a client token (VITE_FLIGHTDECK_LOCAL_API_TOKEN is set)." @@ -91,9 +105,10 @@ export function SecurityStatusBar() { return (

- Bearer mutations: VITE_FLIGHTDECK_LOCAL_API_TOKEN is set — + Bearer API: VITE_FLIGHTDECK_LOCAL_API_TOKEN is set — confirm it matches the server's{" "} - FLIGHTDECK_LOCAL_API_TOKEN. + FLIGHTDECK_LOCAL_API_TOKEN (writes and{" "} + GET /v1/* when the server uses a token).

); @@ -103,14 +118,15 @@ export function SecurityStatusBar() {
{mismatch ? (

- Server expects a Bearer token for mutations, but this UI is not configured with{" "} - VITE_FLIGHTDECK_LOCAL_API_TOKEN. Promote and rollback - requests will be rejected until the token matches{" "} + Server expects a Bearer token for writes and read APIs, but this UI is not configured with{" "} + VITE_FLIGHTDECK_LOCAL_API_TOKEN. Requests will be rejected + until the token matches{" "} FLIGHTDECK_LOCAL_API_TOKEN on the server.

) : (

{serverLine}{" "} + {readLine}{" "} {clientLine}

)} diff --git a/web/src/pages/ActionsPage.tsx b/web/src/pages/ActionsPage.tsx index 52cdcc7..dd84916 100644 --- a/web/src/pages/ActionsPage.tsx +++ b/web/src/pages/ActionsPage.tsx @@ -279,9 +279,10 @@ export function ActionsPage() {

Promote & rollback

- Mutations use the same HTTP contract as the CLI. When{" "} + Writes use the same HTTP contract as the CLI. When{" "} FLIGHTDECK_LOCAL_API_TOKEN is set, include it via{" "} - VITE_FLIGHTDECK_LOCAL_API_TOKEN for local dev. + VITE_FLIGHTDECK_LOCAL_API_TOKEN so reads and mutations + send Authorization: Bearer.

From de912d1dcd4462a5e3e49dde1c117b00d401054c Mon Sep 17 00:00:00 2001 From: zendaya Date: Sun, 3 May 2026 18:22:48 +0200 Subject: [PATCH 2/2] Remove obsolete JavaScript file `index-DHNA23gJ.js` from static assets directory. --- .../{index-DHNA23gJ.js => index-BMbVZO_a.js} | 12 +- src/flightdeck/server/static/index.html | 2 +- uv.lock | 174 ++++++++++++++++++ 3 files changed, 181 insertions(+), 7 deletions(-) rename src/flightdeck/server/static/assets/{index-DHNA23gJ.js => index-BMbVZO_a.js} (66%) diff --git a/src/flightdeck/server/static/assets/index-DHNA23gJ.js b/src/flightdeck/server/static/assets/index-BMbVZO_a.js similarity index 66% rename from src/flightdeck/server/static/assets/index-DHNA23gJ.js rename to src/flightdeck/server/static/assets/index-BMbVZO_a.js index da8f2a4..0c29e82 100644 --- a/src/flightdeck/server/static/assets/index-DHNA23gJ.js +++ b/src/flightdeck/server/static/assets/index-BMbVZO_a.js @@ -1,11 +1,11 @@ -(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const m of document.querySelectorAll('link[rel="modulepreload"]'))f(m);new MutationObserver(m=>{for(const h of m)if(h.type==="childList")for(const _ of h.addedNodes)_.tagName==="LINK"&&_.rel==="modulepreload"&&f(_)}).observe(document,{childList:!0,subtree:!0});function o(m){const h={};return m.integrity&&(h.integrity=m.integrity),m.referrerPolicy&&(h.referrerPolicy=m.referrerPolicy),m.crossOrigin==="use-credentials"?h.credentials="include":m.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function f(m){if(m.ep)return;m.ep=!0;const h=o(m);fetch(m.href,h)}})();var Gs={exports:{}},Qn={};var mm;function Ry(){if(mm)return Qn;mm=1;var i=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function o(f,m,h){var _=null;if(h!==void 0&&(_=""+h),m.key!==void 0&&(_=""+m.key),"key"in m){h={};for(var R in m)R!=="key"&&(h[R]=m[R])}else h=m;return m=h.ref,{$$typeof:i,type:f,key:_,ref:m!==void 0?m:null,props:h}}return Qn.Fragment=r,Qn.jsx=o,Qn.jsxs=o,Qn}var hm;function Ay(){return hm||(hm=1,Gs.exports=Ry()),Gs.exports}var c=Ay(),Qs={exports:{}},ae={};var vm;function zy(){if(vm)return ae;vm=1;var i=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),f=Symbol.for("react.strict_mode"),m=Symbol.for("react.profiler"),h=Symbol.for("react.consumer"),_=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),S=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),E=Symbol.for("react.activity"),L=Symbol.iterator;function B(b){return b===null||typeof b!="object"?null:(b=L&&b[L]||b["@@iterator"],typeof b=="function"?b:null)}var V={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Q=Object.assign,w={};function Z(b,M,X){this.props=b,this.context=M,this.refs=w,this.updater=X||V}Z.prototype.isReactComponent={},Z.prototype.setState=function(b,M){if(typeof b!="object"&&typeof b!="function"&&b!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,b,M,"setState")},Z.prototype.forceUpdate=function(b){this.updater.enqueueForceUpdate(this,b,"forceUpdate")};function F(){}F.prototype=Z.prototype;function $(b,M,X){this.props=b,this.context=M,this.refs=w,this.updater=X||V}var G=$.prototype=new F;G.constructor=$,Q(G,Z.prototype),G.isPureReactComponent=!0;var ne=Array.isArray;function pe(){}var H={H:null,A:null,T:null,S:null},se=Object.prototype.hasOwnProperty;function He(b,M,X){var J=X.ref;return{$$typeof:i,type:b,key:M,ref:J!==void 0?J:null,props:X}}function de(b,M){return He(b.type,M,b.props)}function Qe(b){return typeof b=="object"&&b!==null&&b.$$typeof===i}function Se(b){var M={"=":"=0",":":"=2"};return"$"+b.replace(/[=:]/g,function(X){return M[X]})}var Ee=/\/+/g;function Ce(b,M){return typeof b=="object"&&b!==null&&b.key!=null?Se(""+b.key):M.toString(36)}function De(b){switch(b.status){case"fulfilled":return b.value;case"rejected":throw b.reason;default:switch(typeof b.status=="string"?b.then(pe,pe):(b.status="pending",b.then(function(M){b.status==="pending"&&(b.status="fulfilled",b.value=M)},function(M){b.status==="pending"&&(b.status="rejected",b.reason=M)})),b.status){case"fulfilled":return b.value;case"rejected":throw b.reason}}throw b}function O(b,M,X,J,le){var ue=typeof b;(ue==="undefined"||ue==="boolean")&&(b=null);var ge=!1;if(b===null)ge=!0;else switch(ue){case"bigint":case"string":case"number":ge=!0;break;case"object":switch(b.$$typeof){case i:case r:ge=!0;break;case z:return ge=b._init,O(ge(b._payload),M,X,J,le)}}if(ge)return le=le(b),ge=J===""?"."+Ce(b,0):J,ne(le)?(X="",ge!=null&&(X=ge.replace(Ee,"$&/")+"/"),O(le,M,X,"",function(oe){return oe})):le!=null&&(Qe(le)&&(le=de(le,X+(le.key==null||b&&b.key===le.key?"":(""+le.key).replace(Ee,"$&/")+"/")+ge)),M.push(le)),1;ge=0;var Ve=J===""?".":J+":";if(ne(b))for(var q=0;q>>1,ee=O[_e];if(0>>1;_em(X,P))Jm(le,X)?(O[_e]=le,O[J]=P,_e=J):(O[_e]=X,O[M]=P,_e=M);else if(Jm(le,P))O[_e]=le,O[J]=P,_e=J;else break e}}return Y}function m(O,Y){var P=O.sortIndex-Y.sortIndex;return P!==0?P:O.id-Y.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var h=performance;i.unstable_now=function(){return h.now()}}else{var _=Date,R=_.now();i.unstable_now=function(){return _.now()-R}}var S=[],y=[],z=1,E=null,L=3,B=!1,V=!1,Q=!1,w=!1,Z=typeof setTimeout=="function"?setTimeout:null,F=typeof clearTimeout=="function"?clearTimeout:null,$=typeof setImmediate<"u"?setImmediate:null;function G(O){for(var Y=o(y);Y!==null;){if(Y.callback===null)f(y);else if(Y.startTime<=O)f(y),Y.sortIndex=Y.expirationTime,r(S,Y);else break;Y=o(y)}}function ne(O){if(Q=!1,G(O),!V)if(o(S)!==null)V=!0,pe||(pe=!0,Se());else{var Y=o(y);Y!==null&&De(ne,Y.startTime-O)}}var pe=!1,H=-1,se=5,He=-1;function de(){return w?!0:!(i.unstable_now()-HeO&&de());){var _e=E.callback;if(typeof _e=="function"){E.callback=null,L=E.priorityLevel;var ee=_e(E.expirationTime<=O);if(O=i.unstable_now(),typeof ee=="function"){E.callback=ee,G(O),Y=!0;break t}E===o(S)&&f(S),G(O)}else f(S);E=o(S)}if(E!==null)Y=!0;else{var b=o(y);b!==null&&De(ne,b.startTime-O),Y=!1}}break e}finally{E=null,L=P,B=!1}Y=void 0}}finally{Y?Se():pe=!1}}}var Se;if(typeof $=="function")Se=function(){$(Qe)};else if(typeof MessageChannel<"u"){var Ee=new MessageChannel,Ce=Ee.port2;Ee.port1.onmessage=Qe,Se=function(){Ce.postMessage(null)}}else Se=function(){Z(Qe,0)};function De(O,Y){H=Z(function(){O(i.unstable_now())},Y)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(O){O.callback=null},i.unstable_forceFrameRate=function(O){0>O||125_e?(O.sortIndex=P,r(y,O),o(S)===null&&O===o(y)&&(Q?(F(H),H=-1):Q=!0,De(ne,P-_e))):(O.sortIndex=ee,r(S,O),V||B||(V=!0,pe||(pe=!0,Se()))),O},i.unstable_shouldYield=de,i.unstable_wrapCallback=function(O){var Y=L;return function(){var P=L;L=Y;try{return O.apply(this,arguments)}finally{L=P}}}})(Vs)),Vs}var gm;function Cy(){return gm||(gm=1,Zs.exports=Oy()),Zs.exports}var Ks={exports:{}},it={};var bm;function Dy(){if(bm)return it;bm=1;var i=tf();function r(S){var y="https://react.dev/errors/"+S;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(r){console.error(r)}}return i(),Ks.exports=Dy(),Ks.exports}var Sm;function Uy(){if(Sm)return Xn;Sm=1;var i=Cy(),r=tf(),o=My();function f(e){var t="https://react.dev/errors/"+e;if(1ee||(e.current=_e[ee],_e[ee]=null,ee--)}function X(e,t){ee++,_e[ee]=e.current,e.current=t}var J=b(null),le=b(null),ue=b(null),ge=b(null);function Ve(e,t){switch(X(ue,t),X(le,e),X(J,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?qd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=qd(t),e=wd(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}M(J),X(J,e)}function q(){M(J),M(le),M(ue)}function oe(e){e.memoizedState!==null&&X(ge,e);var t=J.current,l=wd(t,e.type);t!==l&&(X(le,e),X(J,l))}function Ue(e){le.current===e&&(M(J),M(le)),ge.current===e&&(M(ge),Bn._currentValue=P)}var K,fe;function re(e){if(K===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);K=t&&t[1]||"",fe=-1{for(const h of m)if(h.type==="childList")for(const _ of h.addedNodes)_.tagName==="LINK"&&_.rel==="modulepreload"&&r(_)}).observe(document,{childList:!0,subtree:!0});function o(m){const h={};return m.integrity&&(h.integrity=m.integrity),m.referrerPolicy&&(h.referrerPolicy=m.referrerPolicy),m.crossOrigin==="use-credentials"?h.credentials="include":m.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function r(m){if(m.ep)return;m.ep=!0;const h=o(m);fetch(m.href,h)}})();var Gs={exports:{}},Qn={};var mm;function Ry(){if(mm)return Qn;mm=1;var i=Symbol.for("react.transitional.element"),f=Symbol.for("react.fragment");function o(r,m,h){var _=null;if(h!==void 0&&(_=""+h),m.key!==void 0&&(_=""+m.key),"key"in m){h={};for(var R in m)R!=="key"&&(h[R]=m[R])}else h=m;return m=h.ref,{$$typeof:i,type:r,key:_,ref:m!==void 0?m:null,props:h}}return Qn.Fragment=f,Qn.jsx=o,Qn.jsxs=o,Qn}var hm;function Ay(){return hm||(hm=1,Gs.exports=Ry()),Gs.exports}var c=Ay(),Qs={exports:{}},ae={};var vm;function zy(){if(vm)return ae;vm=1;var i=Symbol.for("react.transitional.element"),f=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),m=Symbol.for("react.profiler"),h=Symbol.for("react.consumer"),_=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),S=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),N=Symbol.for("react.activity"),L=Symbol.iterator;function w(b){return b===null||typeof b!="object"?null:(b=L&&b[L]||b["@@iterator"],typeof b=="function"?b:null)}var V={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Q=Object.assign,B={};function Z(b,M,X){this.props=b,this.context=M,this.refs=B,this.updater=X||V}Z.prototype.isReactComponent={},Z.prototype.setState=function(b,M){if(typeof b!="object"&&typeof b!="function"&&b!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,b,M,"setState")},Z.prototype.forceUpdate=function(b){this.updater.enqueueForceUpdate(this,b,"forceUpdate")};function F(){}F.prototype=Z.prototype;function $(b,M,X){this.props=b,this.context=M,this.refs=B,this.updater=X||V}var G=$.prototype=new F;G.constructor=$,Q(G,Z.prototype),G.isPureReactComponent=!0;var ne=Array.isArray;function pe(){}var H={H:null,A:null,T:null,S:null},se=Object.prototype.hasOwnProperty;function He(b,M,X){var J=X.ref;return{$$typeof:i,type:b,key:M,ref:J!==void 0?J:null,props:X}}function de(b,M){return He(b.type,M,b.props)}function Qe(b){return typeof b=="object"&&b!==null&&b.$$typeof===i}function Se(b){var M={"=":"=0",":":"=2"};return"$"+b.replace(/[=:]/g,function(X){return M[X]})}var Ee=/\/+/g;function Ce(b,M){return typeof b=="object"&&b!==null&&b.key!=null?Se(""+b.key):M.toString(36)}function De(b){switch(b.status){case"fulfilled":return b.value;case"rejected":throw b.reason;default:switch(typeof b.status=="string"?b.then(pe,pe):(b.status="pending",b.then(function(M){b.status==="pending"&&(b.status="fulfilled",b.value=M)},function(M){b.status==="pending"&&(b.status="rejected",b.reason=M)})),b.status){case"fulfilled":return b.value;case"rejected":throw b.reason}}throw b}function O(b,M,X,J,le){var ue=typeof b;(ue==="undefined"||ue==="boolean")&&(b=null);var ge=!1;if(b===null)ge=!0;else switch(ue){case"bigint":case"string":case"number":ge=!0;break;case"object":switch(b.$$typeof){case i:case f:ge=!0;break;case z:return ge=b._init,O(ge(b._payload),M,X,J,le)}}if(ge)return le=le(b),ge=J===""?"."+Ce(b,0):J,ne(le)?(X="",ge!=null&&(X=ge.replace(Ee,"$&/")+"/"),O(le,M,X,"",function(oe){return oe})):le!=null&&(Qe(le)&&(le=de(le,X+(le.key==null||b&&b.key===le.key?"":(""+le.key).replace(Ee,"$&/")+"/")+ge)),M.push(le)),1;ge=0;var Ve=J===""?".":J+":";if(ne(b))for(var q=0;q>>1,ee=O[_e];if(0>>1;_em(X,P))Jm(le,X)?(O[_e]=le,O[J]=P,_e=J):(O[_e]=X,O[M]=P,_e=M);else if(Jm(le,P))O[_e]=le,O[J]=P,_e=J;else break e}}return Y}function m(O,Y){var P=O.sortIndex-Y.sortIndex;return P!==0?P:O.id-Y.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var h=performance;i.unstable_now=function(){return h.now()}}else{var _=Date,R=_.now();i.unstable_now=function(){return _.now()-R}}var S=[],y=[],z=1,N=null,L=3,w=!1,V=!1,Q=!1,B=!1,Z=typeof setTimeout=="function"?setTimeout:null,F=typeof clearTimeout=="function"?clearTimeout:null,$=typeof setImmediate<"u"?setImmediate:null;function G(O){for(var Y=o(y);Y!==null;){if(Y.callback===null)r(y);else if(Y.startTime<=O)r(y),Y.sortIndex=Y.expirationTime,f(S,Y);else break;Y=o(y)}}function ne(O){if(Q=!1,G(O),!V)if(o(S)!==null)V=!0,pe||(pe=!0,Se());else{var Y=o(y);Y!==null&&De(ne,Y.startTime-O)}}var pe=!1,H=-1,se=5,He=-1;function de(){return B?!0:!(i.unstable_now()-HeO&&de());){var _e=N.callback;if(typeof _e=="function"){N.callback=null,L=N.priorityLevel;var ee=_e(N.expirationTime<=O);if(O=i.unstable_now(),typeof ee=="function"){N.callback=ee,G(O),Y=!0;break t}N===o(S)&&r(S),G(O)}else r(S);N=o(S)}if(N!==null)Y=!0;else{var b=o(y);b!==null&&De(ne,b.startTime-O),Y=!1}}break e}finally{N=null,L=P,w=!1}Y=void 0}}finally{Y?Se():pe=!1}}}var Se;if(typeof $=="function")Se=function(){$(Qe)};else if(typeof MessageChannel<"u"){var Ee=new MessageChannel,Ce=Ee.port2;Ee.port1.onmessage=Qe,Se=function(){Ce.postMessage(null)}}else Se=function(){Z(Qe,0)};function De(O,Y){H=Z(function(){O(i.unstable_now())},Y)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(O){O.callback=null},i.unstable_forceFrameRate=function(O){0>O||125_e?(O.sortIndex=P,f(y,O),o(S)===null&&O===o(y)&&(Q?(F(H),H=-1):Q=!0,De(ne,P-_e))):(O.sortIndex=ee,f(S,O),V||w||(V=!0,pe||(pe=!0,Se()))),O},i.unstable_shouldYield=de,i.unstable_wrapCallback=function(O){var Y=L;return function(){var P=L;L=Y;try{return O.apply(this,arguments)}finally{L=P}}}})(Vs)),Vs}var gm;function Cy(){return gm||(gm=1,Zs.exports=Oy()),Zs.exports}var Ks={exports:{}},it={};var bm;function Dy(){if(bm)return it;bm=1;var i=tf();function f(S){var y="https://react.dev/errors/"+S;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(f){console.error(f)}}return i(),Ks.exports=Dy(),Ks.exports}var Sm;function Uy(){if(Sm)return Xn;Sm=1;var i=Cy(),f=tf(),o=My();function r(e){var t="https://react.dev/errors/"+e;if(1ee||(e.current=_e[ee],_e[ee]=null,ee--)}function X(e,t){ee++,_e[ee]=e.current,e.current=t}var J=b(null),le=b(null),ue=b(null),ge=b(null);function Ve(e,t){switch(X(ue,t),X(le,e),X(J,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?qd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=qd(t),e=wd(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}M(J),X(J,e)}function q(){M(J),M(le),M(ue)}function oe(e){e.memoizedState!==null&&X(ge,e);var t=J.current,l=wd(t,e.type);t!==l&&(X(le,e),X(J,l))}function Ue(e){le.current===e&&(M(J),M(le)),ge.current===e&&(M(ge),Bn._currentValue=P)}var K,fe;function re(e){if(K===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);K=t&&t[1]||"",fe=-1)":-1n||v[a]!==N[n]){var C=` +`),E=d.split(` +`);for(n=a=0;an||v[a]!==E[n]){var C=` `+v[a].replace(" at new "," at ");return e.displayName&&C.includes("")&&(C=C.replace("",e.displayName)),C}while(1<=a&&0<=n);break}}}finally{ut=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?re(l):""}function Pe(e,t){switch(e.tag){case 26:case 27:case 5:return re(e.type);case 16:return re("Lazy");case 13:return e.child!==t&&t!==null?re("Suspense Fallback"):re("Suspense");case 19:return re("SuspenseList");case 0:case 15:return st(e.type,!1);case 11:return st(e.type.render,!1);case 1:return st(e.type,!0);case 31:return re("Activity");default:return""}}function Fn(e){try{var t="",l=null;do t+=Pe(e,l),l=e,e=e.return;while(e);return t}catch(a){return` Error generating stack: `+a.message+` -`+a.stack}}var Ti=Object.prototype.hasOwnProperty,Ri=i.unstable_scheduleCallback,Ai=i.unstable_cancelCallback,uh=i.unstable_shouldYield,ih=i.unstable_requestPaint,yt=i.unstable_now,ch=i.unstable_getCurrentPriorityLevel,mf=i.unstable_ImmediatePriority,hf=i.unstable_UserBlockingPriority,In=i.unstable_NormalPriority,sh=i.unstable_LowPriority,vf=i.unstable_IdlePriority,fh=i.log,rh=i.unstable_setDisableYieldValue,$a=null,pt=null;function hl(e){if(typeof fh=="function"&&rh(e),pt&&typeof pt.setStrictMode=="function")try{pt.setStrictMode($a,e)}catch{}}var gt=Math.clz32?Math.clz32:mh,oh=Math.log,dh=Math.LN2;function mh(e){return e>>>=0,e===0?32:31-(oh(e)/dh|0)|0}var Pn=256,eu=262144,tu=4194304;function Ll(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function lu(e,t,l){var a=e.pendingLanes;if(a===0)return 0;var n=0,u=e.suspendedLanes,s=e.pingedLanes;e=e.warmLanes;var d=a&134217727;return d!==0?(a=d&~u,a!==0?n=Ll(a):(s&=d,s!==0?n=Ll(s):l||(l=d&~e,l!==0&&(n=Ll(l))))):(d=a&~u,d!==0?n=Ll(d):s!==0?n=Ll(s):l||(l=a&~e,l!==0&&(n=Ll(l)))),n===0?0:t!==0&&t!==n&&(t&u)===0&&(u=n&-n,l=t&-t,u>=l||u===32&&(l&4194048)!==0)?t:n}function Wa(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function hh(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function yf(){var e=tu;return tu<<=1,(tu&62914560)===0&&(tu=4194304),e}function zi(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function Fa(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function vh(e,t,l,a,n,u){var s=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var d=e.entanglements,v=e.expirationTimes,N=e.hiddenUpdates;for(l=s&~l;0"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Sh=/[\n"\\]/g;function At(e){return e.replace(Sh,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Hi(e,t,l,a,n,u,s,d){e.name="",s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?e.type=s:e.removeAttribute("type"),t!=null?s==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Rt(t)):e.value!==""+Rt(t)&&(e.value=""+Rt(t)):s!=="submit"&&s!=="reset"||e.removeAttribute("value"),t!=null?qi(e,s,Rt(t)):l!=null?qi(e,s,Rt(l)):a!=null&&e.removeAttribute("value"),n==null&&u!=null&&(e.defaultChecked=!!u),n!=null&&(e.checked=n&&typeof n!="function"&&typeof n!="symbol"),d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"?e.name=""+Rt(d):e.removeAttribute("name")}function zf(e,t,l,a,n,u,s,d){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.type=u),t!=null||l!=null){if(!(u!=="submit"&&u!=="reset"||t!=null)){Ui(e);return}l=l!=null?""+Rt(l):"",t=t!=null?""+Rt(t):l,d||t===e.value||(e.value=t),e.defaultValue=t}a=a??n,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=d?e.checked:!!a,e.defaultChecked=!!a,s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(e.name=s),Ui(e)}function qi(e,t,l){t==="number"&&uu(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function oa(e,t,l,a){if(e=e.options,t){t={};for(var n=0;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Gi=!1;if(Ft)try{var tn={};Object.defineProperty(tn,"passive",{get:function(){Gi=!0}}),window.addEventListener("test",tn,tn),window.removeEventListener("test",tn,tn)}catch{Gi=!1}var yl=null,Qi=null,cu=null;function qf(){if(cu)return cu;var e,t=Qi,l=t.length,a,n="value"in yl?yl.value:yl.textContent,u=n.length;for(e=0;e=nn),Qf=" ",Xf=!1;function Zf(e,t){switch(e){case"keyup":return $h.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Vf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var va=!1;function Fh(e,t){switch(e){case"compositionend":return Vf(t);case"keypress":return t.which!==32?null:(Xf=!0,Qf);case"textInput":return e=t.data,e===Qf&&Xf?null:e;default:return null}}function Ih(e,t){if(va)return e==="compositionend"||!Ji&&Zf(e,t)?(e=qf(),cu=Qi=yl=null,va=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:l,offset:t-e};e=a}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Pf(l)}}function tr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?tr(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function lr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=uu(e.document);t instanceof e.HTMLIFrameElement;){try{var l=typeof t.contentWindow.location.href=="string"}catch{l=!1}if(l)e=t.contentWindow;else break;t=uu(e.document)}return t}function Wi(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var iv=Ft&&"documentMode"in document&&11>=document.documentMode,ya=null,Fi=null,fn=null,Ii=!1;function ar(e,t,l){var a=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Ii||ya==null||ya!==uu(a)||(a=ya,"selectionStart"in a&&Wi(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),fn&&sn(fn,a)||(fn=a,a=ei(Fi,"onSelect"),0>=s,n-=s,Zt=1<<32-gt(t)+n|l<ce?(ye=W,W=null):ye=W.sibling;var je=T(x,W,j[ce],D);if(je===null){W===null&&(W=ye);break}e&&W&&je.alternate===null&&t(x,W),g=u(je,g,ce),xe===null?I=je:xe.sibling=je,xe=je,W=ye}if(ce===j.length)return l(x,W),be&&Pt(x,ce),I;if(W===null){for(;cece?(ye=W,W=null):ye=W.sibling;var Bl=T(x,W,je.value,D);if(Bl===null){W===null&&(W=ye);break}e&&W&&Bl.alternate===null&&t(x,W),g=u(Bl,g,ce),xe===null?I=Bl:xe.sibling=Bl,xe=Bl,W=ye}if(je.done)return l(x,W),be&&Pt(x,ce),I;if(W===null){for(;!je.done;ce++,je=j.next())je=U(x,je.value,D),je!==null&&(g=u(je,g,ce),xe===null?I=je:xe.sibling=je,xe=je);return be&&Pt(x,ce),I}for(W=a(W);!je.done;ce++,je=j.next())je=A(W,x,ce,je.value,D),je!==null&&(e&&je.alternate!==null&&W.delete(je.key===null?ce:je.key),g=u(je,g,ce),xe===null?I=je:xe.sibling=je,xe=je);return e&&W.forEach(function(Ty){return t(x,Ty)}),be&&Pt(x,ce),I}function Oe(x,g,j,D){if(typeof j=="object"&&j!==null&&j.type===Q&&j.key===null&&(j=j.props.children),typeof j=="object"&&j!==null){switch(j.$$typeof){case B:e:{for(var I=j.key;g!==null;){if(g.key===I){if(I=j.type,I===Q){if(g.tag===7){l(x,g.sibling),D=n(g,j.props.children),D.return=x,x=D;break e}}else if(g.elementType===I||typeof I=="object"&&I!==null&&I.$$typeof===se&&Wl(I)===g.type){l(x,g.sibling),D=n(g,j.props),vn(D,j),D.return=x,x=D;break e}l(x,g);break}else t(x,g);g=g.sibling}j.type===Q?(D=Vl(j.props.children,x.mode,D,j.key),D.return=x,x=D):(D=pu(j.type,j.key,j.props,null,x.mode,D),vn(D,j),D.return=x,x=D)}return s(x);case V:e:{for(I=j.key;g!==null;){if(g.key===I)if(g.tag===4&&g.stateNode.containerInfo===j.containerInfo&&g.stateNode.implementation===j.implementation){l(x,g.sibling),D=n(g,j.children||[]),D.return=x,x=D;break e}else{l(x,g);break}else t(x,g);g=g.sibling}D=uc(j,x.mode,D),D.return=x,x=D}return s(x);case se:return j=Wl(j),Oe(x,g,j,D)}if(De(j))return k(x,g,j,D);if(Se(j)){if(I=Se(j),typeof I!="function")throw Error(f(150));return j=I.call(j),te(x,g,j,D)}if(typeof j.then=="function")return Oe(x,g,Nu(j),D);if(j.$$typeof===$)return Oe(x,g,_u(x,j),D);Eu(x,j)}return typeof j=="string"&&j!==""||typeof j=="number"||typeof j=="bigint"?(j=""+j,g!==null&&g.tag===6?(l(x,g.sibling),D=n(g,j),D.return=x,x=D):(l(x,g),D=nc(j,x.mode,D),D.return=x,x=D),s(x)):l(x,g)}return function(x,g,j,D){try{hn=0;var I=Oe(x,g,j,D);return Ra=null,I}catch(W){if(W===Ta||W===xu)throw W;var xe=_t(29,W,null,x.mode);return xe.lanes=D,xe.return=x,xe}}}var Il=Tr(!0),Rr=Tr(!1),Sl=!1;function pc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function gc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function xl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function jl(e,t,l){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(Ne&2)!==0){var n=a.pending;return n===null?t.next=t:(t.next=n.next,n.next=t),a.pending=t,t=yu(e),rr(e,null,l),t}return vu(e,a,t,l),yu(e)}function yn(e,t,l){if(t=t.updateQueue,t!==null&&(t=t.shared,(l&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,l|=a,t.lanes=l,gf(e,l)}}function bc(e,t){var l=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,l===a)){var n=null,u=null;if(l=l.firstBaseUpdate,l!==null){do{var s={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};u===null?n=u=s:u=u.next=s,l=l.next}while(l!==null);u===null?n=u=t:u=u.next=t}else n=u=t;l={baseState:a.baseState,firstBaseUpdate:n,lastBaseUpdate:u,shared:a.shared,callbacks:a.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=t:e.next=t,l.lastBaseUpdate=t}var _c=!1;function pn(){if(_c){var e=Ea;if(e!==null)throw e}}function gn(e,t,l,a){_c=!1;var n=e.updateQueue;Sl=!1;var u=n.firstBaseUpdate,s=n.lastBaseUpdate,d=n.shared.pending;if(d!==null){n.shared.pending=null;var v=d,N=v.next;v.next=null,s===null?u=N:s.next=N,s=v;var C=e.alternate;C!==null&&(C=C.updateQueue,d=C.lastBaseUpdate,d!==s&&(d===null?C.firstBaseUpdate=N:d.next=N,C.lastBaseUpdate=v))}if(u!==null){var U=n.baseState;s=0,C=N=v=null,d=u;do{var T=d.lane&-536870913,A=T!==d.lane;if(A?(ve&T)===T:(a&T)===T){T!==0&&T===Na&&(_c=!0),C!==null&&(C=C.next={lane:0,tag:d.tag,payload:d.payload,callback:null,next:null});e:{var k=e,te=d;T=t;var Oe=l;switch(te.tag){case 1:if(k=te.payload,typeof k=="function"){U=k.call(Oe,U,T);break e}U=k;break e;case 3:k.flags=k.flags&-65537|128;case 0:if(k=te.payload,T=typeof k=="function"?k.call(Oe,U,T):k,T==null)break e;U=E({},U,T);break e;case 2:Sl=!0}}T=d.callback,T!==null&&(e.flags|=64,A&&(e.flags|=8192),A=n.callbacks,A===null?n.callbacks=[T]:A.push(T))}else A={lane:T,tag:d.tag,payload:d.payload,callback:d.callback,next:null},C===null?(N=C=A,v=U):C=C.next=A,s|=T;if(d=d.next,d===null){if(d=n.shared.pending,d===null)break;A=d,d=A.next,A.next=null,n.lastBaseUpdate=A,n.shared.pending=null}}while(!0);C===null&&(v=U),n.baseState=v,n.firstBaseUpdate=N,n.lastBaseUpdate=C,u===null&&(n.shared.lanes=0),Al|=s,e.lanes=s,e.memoizedState=U}}function Ar(e,t){if(typeof e!="function")throw Error(f(191,e));e.call(t)}function zr(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;eu?u:8;var s=O.T,d={};O.T=d,Lc(e,!1,t,l);try{var v=n(),N=O.S;if(N!==null&&N(d,v),v!==null&&typeof v=="object"&&typeof v.then=="function"){var C=vv(v,a);Sn(e,t,C,Et(e))}else Sn(e,t,a,Et(e))}catch(U){Sn(e,t,{then:function(){},status:"rejected",reason:U},Et())}finally{Y.p=u,s!==null&&d.types!==null&&(s.types=d.types),O.T=s}}function Sv(){}function wc(e,t,l,a){if(e.tag!==5)throw Error(f(476));var n=co(e).queue;io(e,n,t,P,l===null?Sv:function(){return so(e),l(a)})}function co(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:P,baseState:P,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:al,lastRenderedState:P},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:al,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function so(e){var t=co(e);t.next===null&&(t=e.alternate.memoizedState),Sn(e,t.next.queue,{},Et())}function Bc(){return lt(Bn)}function fo(){return Ze().memoizedState}function ro(){return Ze().memoizedState}function xv(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=Et();e=xl(l);var a=jl(t,e,l);a!==null&&(vt(a,t,l),yn(a,t,l)),t={cache:mc()},e.payload=t;return}t=t.return}}function jv(e,t,l){var a=Et();l={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Hu(e)?mo(t,l):(l=lc(e,t,l,a),l!==null&&(vt(l,e,a),ho(l,t,a)))}function oo(e,t,l){var a=Et();Sn(e,t,l,a)}function Sn(e,t,l,a){var n={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Hu(e))mo(t,n);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var s=t.lastRenderedState,d=u(s,l);if(n.hasEagerState=!0,n.eagerState=d,bt(d,s))return vu(e,t,n,0),Me===null&&hu(),!1}catch{}if(l=lc(e,t,n,a),l!==null)return vt(l,e,a),ho(l,t,a),!0}return!1}function Lc(e,t,l,a){if(a={lane:2,revertLane:ps(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Hu(e)){if(t)throw Error(f(479))}else t=lc(e,l,a,2),t!==null&&vt(t,e,2)}function Hu(e){var t=e.alternate;return e===ie||t!==null&&t===ie}function mo(e,t){za=Au=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function ho(e,t,l){if((l&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,l|=a,t.lanes=l,gf(e,l)}}var xn={readContext:lt,use:Cu,useCallback:Ye,useContext:Ye,useEffect:Ye,useImperativeHandle:Ye,useLayoutEffect:Ye,useInsertionEffect:Ye,useMemo:Ye,useReducer:Ye,useRef:Ye,useState:Ye,useDebugValue:Ye,useDeferredValue:Ye,useTransition:Ye,useSyncExternalStore:Ye,useId:Ye,useHostTransitionStatus:Ye,useFormState:Ye,useActionState:Ye,useOptimistic:Ye,useMemoCache:Ye,useCacheRefresh:Ye};xn.useEffectEvent=Ye;var vo={readContext:lt,use:Cu,useCallback:function(e,t){return ct().memoizedState=[e,t===void 0?null:t],e},useContext:lt,useEffect:Fr,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,Mu(4194308,4,to.bind(null,t,e),l)},useLayoutEffect:function(e,t){return Mu(4194308,4,e,t)},useInsertionEffect:function(e,t){Mu(4,2,e,t)},useMemo:function(e,t){var l=ct();t=t===void 0?null:t;var a=e();if(Pl){hl(!0);try{e()}finally{hl(!1)}}return l.memoizedState=[a,t],a},useReducer:function(e,t,l){var a=ct();if(l!==void 0){var n=l(t);if(Pl){hl(!0);try{l(t)}finally{hl(!1)}}}else n=t;return a.memoizedState=a.baseState=n,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},a.queue=e,e=e.dispatch=jv.bind(null,ie,e),[a.memoizedState,e]},useRef:function(e){var t=ct();return e={current:e},t.memoizedState=e},useState:function(e){e=Dc(e);var t=e.queue,l=oo.bind(null,ie,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:Hc,useDeferredValue:function(e,t){var l=ct();return qc(l,e,t)},useTransition:function(){var e=Dc(!1);return e=io.bind(null,ie,e.queue,!0,!1),ct().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var a=ie,n=ct();if(be){if(l===void 0)throw Error(f(407));l=l()}else{if(l=t(),Me===null)throw Error(f(349));(ve&127)!==0||Hr(a,t,l)}n.memoizedState=l;var u={value:l,getSnapshot:t};return n.queue=u,Fr(wr.bind(null,a,u,e),[e]),a.flags|=2048,Ca(9,{destroy:void 0},qr.bind(null,a,u,l,t),null),l},useId:function(){var e=ct(),t=Me.identifierPrefix;if(be){var l=Vt,a=Zt;l=(a&~(1<<32-gt(a)-1)).toString(32)+l,t="_"+t+"R_"+l,l=zu++,0<\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof a.is=="string"?s.createElement("select",{is:a.is}):s.createElement("select"),a.multiple?u.multiple=!0:a.size&&(u.size=a.size);break;default:u=typeof a.is=="string"?s.createElement(n,{is:a.is}):s.createElement(n)}}u[et]=t,u[ft]=a;e:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)u.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break e;for(;s.sibling===null;){if(s.return===null||s.return===t)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=u;e:switch(nt(u,n,a),n){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&ul(t)}}return we(t),Pc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&ul(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(f(166));if(e=ue.current,xa(t)){if(e=t.stateNode,l=t.memoizedProps,a=null,n=tt,n!==null)switch(n.tag){case 27:case 5:a=n.memoizedProps}e[et]=t,e=!!(e.nodeValue===l||a!==null&&a.suppressHydrationWarning===!0||Ud(e.nodeValue,l)),e||bl(t,!0)}else e=ti(e).createTextNode(a),e[et]=t,t.stateNode=e}return we(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(a=xa(t),l!==null){if(e===null){if(!a)throw Error(f(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(f(557));e[et]=t}else Kl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;we(t),e=!1}else l=fc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(xt(t),t):(xt(t),null);if((t.flags&128)!==0)throw Error(f(558))}return we(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(n=xa(t),a!==null&&a.dehydrated!==null){if(e===null){if(!n)throw Error(f(318));if(n=t.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(f(317));n[et]=t}else Kl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;we(t),n=!1}else n=fc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),n=!0;if(!n)return t.flags&256?(xt(t),t):(xt(t),null)}return xt(t),(t.flags&128)!==0?(t.lanes=l,t):(l=a!==null,e=e!==null&&e.memoizedState!==null,l&&(a=t.child,n=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(n=a.alternate.memoizedState.cachePool.pool),u=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),u!==n&&(a.flags|=2048)),l!==e&&l&&(t.child.flags|=8192),Yu(t,t.updateQueue),we(t),null);case 4:return q(),e===null&&Ss(t.stateNode.containerInfo),we(t),null;case 10:return tl(t.type),we(t),null;case 19:if(M(Xe),a=t.memoizedState,a===null)return we(t),null;if(n=(t.flags&128)!==0,u=a.rendering,u===null)if(n)Nn(a,!1);else{if(Ge!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(u=Ru(e),u!==null){for(t.flags|=128,Nn(a,!1),e=u.updateQueue,t.updateQueue=e,Yu(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)or(l,e),l=l.sibling;return X(Xe,Xe.current&1|2),be&&Pt(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&yt()>Vu&&(t.flags|=128,n=!0,Nn(a,!1),t.lanes=4194304)}else{if(!n)if(e=Ru(u),e!==null){if(t.flags|=128,n=!0,e=e.updateQueue,t.updateQueue=e,Yu(t,e),Nn(a,!0),a.tail===null&&a.tailMode==="hidden"&&!u.alternate&&!be)return we(t),null}else 2*yt()-a.renderingStartTime>Vu&&l!==536870912&&(t.flags|=128,n=!0,Nn(a,!1),t.lanes=4194304);a.isBackwards?(u.sibling=t.child,t.child=u):(e=a.last,e!==null?e.sibling=u:t.child=u,a.last=u)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=yt(),e.sibling=null,l=Xe.current,X(Xe,n?l&1|2:l&1),be&&Pt(t,a.treeForkCount),e):(we(t),null);case 22:case 23:return xt(t),xc(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(l&536870912)!==0&&(t.flags&128)===0&&(we(t),t.subtreeFlags&6&&(t.flags|=8192)):we(t),l=t.updateQueue,l!==null&&Yu(t,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==l&&(t.flags|=2048),e!==null&&M($l),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),tl(Ke),we(t),null;case 25:return null;case 30:return null}throw Error(f(156,t.tag))}function Av(e,t){switch(cc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return tl(Ke),q(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ue(t),null;case 31:if(t.memoizedState!==null){if(xt(t),t.alternate===null)throw Error(f(340));Kl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(xt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(f(340));Kl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return M(Xe),null;case 4:return q(),null;case 10:return tl(t.type),null;case 22:case 23:return xt(t),xc(),e!==null&&M($l),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return tl(Ke),null;case 25:return null;default:return null}}function Lo(e,t){switch(cc(t),t.tag){case 3:tl(Ke),q();break;case 26:case 27:case 5:Ue(t);break;case 4:q();break;case 31:t.memoizedState!==null&&xt(t);break;case 13:xt(t);break;case 19:M(Xe);break;case 10:tl(t.type);break;case 22:case 23:xt(t),xc(),e!==null&&M($l);break;case 24:tl(Ke)}}function En(e,t){try{var l=t.updateQueue,a=l!==null?l.lastEffect:null;if(a!==null){var n=a.next;l=n;do{if((l.tag&e)===e){a=void 0;var u=l.create,s=l.inst;a=u(),s.destroy=a}l=l.next}while(l!==n)}}catch(d){Re(t,t.return,d)}}function Tl(e,t,l){try{var a=t.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var u=n.next;a=u;do{if((a.tag&e)===e){var s=a.inst,d=s.destroy;if(d!==void 0){s.destroy=void 0,n=t;var v=l,N=d;try{N()}catch(C){Re(n,v,C)}}}a=a.next}while(a!==u)}}catch(C){Re(t,t.return,C)}}function Yo(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{zr(t,l)}catch(a){Re(e,e.return,a)}}}function Go(e,t,l){l.props=ea(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(a){Re(e,t,a)}}function Tn(e,t){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof l=="function"?e.refCleanup=l(a):l.current=a}}catch(n){Re(e,t,n)}}function Kt(e,t){var l=e.ref,a=e.refCleanup;if(l!==null)if(typeof a=="function")try{a()}catch(n){Re(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(n){Re(e,t,n)}else l.current=null}function Qo(e){var t=e.type,l=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":l.autoFocus&&a.focus();break e;case"img":l.src?a.src=l.src:l.srcSet&&(a.srcset=l.srcSet)}}catch(n){Re(e,e.return,n)}}function es(e,t,l){try{var a=e.stateNode;Wv(a,e.type,l,t),a[ft]=t}catch(n){Re(e,e.return,n)}}function Xo(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ml(e.type)||e.tag===4}function ts(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Xo(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Ml(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function ls(e,t,l){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(e,t):(t=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,t.appendChild(e),l=l._reactRootContainer,l!=null||t.onclick!==null||(t.onclick=Wt));else if(a!==4&&(a===27&&Ml(e.type)&&(l=e.stateNode,t=null),e=e.child,e!==null))for(ls(e,t,l),e=e.sibling;e!==null;)ls(e,t,l),e=e.sibling}function Gu(e,t,l){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?l.insertBefore(e,t):l.appendChild(e);else if(a!==4&&(a===27&&Ml(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(Gu(e,t,l),e=e.sibling;e!==null;)Gu(e,t,l),e=e.sibling}function Zo(e){var t=e.stateNode,l=e.memoizedProps;try{for(var a=e.type,n=t.attributes;n.length;)t.removeAttributeNode(n[0]);nt(t,a,l),t[et]=e,t[ft]=l}catch(u){Re(e,e.return,u)}}var il=!1,$e=!1,as=!1,Vo=typeof WeakSet=="function"?WeakSet:Set,Ie=null;function zv(e,t){if(e=e.containerInfo,Ns=si,e=lr(e),Wi(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var a=l.getSelection&&l.getSelection();if(a&&a.rangeCount!==0){l=a.anchorNode;var n=a.anchorOffset,u=a.focusNode;a=a.focusOffset;try{l.nodeType,u.nodeType}catch{l=null;break e}var s=0,d=-1,v=-1,N=0,C=0,U=e,T=null;t:for(;;){for(var A;U!==l||n!==0&&U.nodeType!==3||(d=s+n),U!==u||a!==0&&U.nodeType!==3||(v=s+a),U.nodeType===3&&(s+=U.nodeValue.length),(A=U.firstChild)!==null;)T=U,U=A;for(;;){if(U===e)break t;if(T===l&&++N===n&&(d=s),T===u&&++C===a&&(v=s),(A=U.nextSibling)!==null)break;U=T,T=U.parentNode}U=A}l=d===-1||v===-1?null:{start:d,end:v}}else l=null}l=l||{start:0,end:0}}else l=null;for(Es={focusedElem:e,selectionRange:l},si=!1,Ie=t;Ie!==null;)if(t=Ie,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ie=e;else for(;Ie!==null;){switch(t=Ie,u=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(l=0;l title"))),nt(u,a,l),u[et]=e,Fe(u),a=u;break e;case"link":var s=Fd("link","href",n).get(a+(l.href||""));if(s){for(var d=0;dOe&&(s=Oe,Oe=te,te=s);var x=er(d,te),g=er(d,Oe);if(x&&g&&(A.rangeCount!==1||A.anchorNode!==x.node||A.anchorOffset!==x.offset||A.focusNode!==g.node||A.focusOffset!==g.offset)){var j=U.createRange();j.setStart(x.node,x.offset),A.removeAllRanges(),te>Oe?(A.addRange(j),A.extend(g.node,g.offset)):(j.setEnd(g.node,g.offset),A.addRange(j))}}}}for(U=[],A=d;A=A.parentNode;)A.nodeType===1&&U.push({element:A,left:A.scrollLeft,top:A.scrollTop});for(typeof d.focus=="function"&&d.focus(),d=0;dl?32:l,O.T=null,l=rs,rs=null;var u=Ol,s=ol;if(We=0,qa=Ol=null,ol=0,(Ne&6)!==0)throw Error(f(331));var d=Ne;if(Ne|=4,ld(u.current),Po(u,u.current,s,l),Ne=d,Dn(0,!1),pt&&typeof pt.onPostCommitFiberRoot=="function")try{pt.onPostCommitFiberRoot($a,u)}catch{}return!0}finally{Y.p=n,O.T=a,_d(e,t)}}function xd(e,t,l){t=Ot(l,t),t=Xc(e.stateNode,t,2),e=jl(e,t,2),e!==null&&(Fa(e,2),Jt(e))}function Re(e,t,l){if(e.tag===3)xd(e,e,l);else for(;t!==null;){if(t.tag===3){xd(t,e,l);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(zl===null||!zl.has(a))){e=Ot(l,e),l=jo(2),a=jl(t,l,2),a!==null&&(No(l,a,t,e),Fa(a,2),Jt(a));break}}t=t.return}}function hs(e,t,l){var a=e.pingCache;if(a===null){a=e.pingCache=new Dv;var n=new Set;a.set(t,n)}else n=a.get(t),n===void 0&&(n=new Set,a.set(t,n));n.has(l)||(is=!0,n.add(l),e=wv.bind(null,e,t,l),t.then(e,e))}function wv(e,t,l){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,Me===e&&(ve&l)===l&&(Ge===4||Ge===3&&(ve&62914560)===ve&&300>yt()-Zu?(Ne&2)===0&&wa(e,0):cs|=l,Ha===ve&&(Ha=0)),Jt(e)}function jd(e,t){t===0&&(t=yf()),e=Zl(e,t),e!==null&&(Fa(e,t),Jt(e))}function Bv(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),jd(e,l)}function Lv(e,t){var l=0;switch(e.tag){case 31:case 13:var a=e.stateNode,n=e.memoizedState;n!==null&&(l=n.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(f(314))}a!==null&&a.delete(t),jd(e,l)}function Yv(e,t){return Ri(e,t)}var Fu=null,La=null,vs=!1,Iu=!1,ys=!1,Dl=0;function Jt(e){e!==La&&e.next===null&&(La===null?Fu=La=e:La=La.next=e),Iu=!0,vs||(vs=!0,Qv())}function Dn(e,t){if(!ys&&Iu){ys=!0;do for(var l=!1,a=Fu;a!==null;){if(e!==0){var n=a.pendingLanes;if(n===0)var u=0;else{var s=a.suspendedLanes,d=a.pingedLanes;u=(1<<31-gt(42|e)+1)-1,u&=n&~(s&~d),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(l=!0,Rd(a,u))}else u=ve,u=lu(a,a===Me?u:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(u&3)===0||Wa(a,u)||(l=!0,Rd(a,u));a=a.next}while(l);ys=!1}}function Gv(){Nd()}function Nd(){Iu=vs=!1;var e=0;Dl!==0&&Iv()&&(e=Dl);for(var t=yt(),l=null,a=Fu;a!==null;){var n=a.next,u=Ed(a,t);u===0?(a.next=null,l===null?Fu=n:l.next=n,n===null&&(La=l)):(l=a,(e!==0||(u&3)!==0)&&(Iu=!0)),a=n}We!==0&&We!==5||Dn(e),Dl!==0&&(Dl=0)}function Ed(e,t){for(var l=e.suspendedLanes,a=e.pingedLanes,n=e.expirationTimes,u=e.pendingLanes&-62914561;0d)break;var C=v.transferSize,U=v.initiatorType;C&&Hd(U)&&(v=v.responseEnd,s+=C*(v"u"?null:document;function Jd(e,t,l){var a=Ya;if(a&&typeof t=="string"&&t){var n=At(t);n='link[rel="'+e+'"][href="'+n+'"]',typeof l=="string"&&(n+='[crossorigin="'+l+'"]'),Kd.has(n)||(Kd.add(n),e={rel:e,crossOrigin:l,href:t},a.querySelector(n)===null&&(t=a.createElement("link"),nt(t,"link",e),Fe(t),a.head.appendChild(t)))}}function cy(e){dl.D(e),Jd("dns-prefetch",e,null)}function sy(e,t){dl.C(e,t),Jd("preconnect",e,t)}function fy(e,t,l){dl.L(e,t,l);var a=Ya;if(a&&e&&t){var n='link[rel="preload"][as="'+At(t)+'"]';t==="image"&&l&&l.imageSrcSet?(n+='[imagesrcset="'+At(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(n+='[imagesizes="'+At(l.imageSizes)+'"]')):n+='[href="'+At(e)+'"]';var u=n;switch(t){case"style":u=Ga(e);break;case"script":u=Qa(e)}qt.has(u)||(e=E({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),qt.set(u,e),a.querySelector(n)!==null||t==="style"&&a.querySelector(qn(u))||t==="script"&&a.querySelector(wn(u))||(t=a.createElement("link"),nt(t,"link",e),Fe(t),a.head.appendChild(t)))}}function ry(e,t){dl.m(e,t);var l=Ya;if(l&&e){var a=t&&typeof t.as=="string"?t.as:"script",n='link[rel="modulepreload"][as="'+At(a)+'"][href="'+At(e)+'"]',u=n;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=Qa(e)}if(!qt.has(u)&&(e=E({rel:"modulepreload",href:e},t),qt.set(u,e),l.querySelector(n)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(wn(u)))return}a=l.createElement("link"),nt(a,"link",e),Fe(a),l.head.appendChild(a)}}}function oy(e,t,l){dl.S(e,t,l);var a=Ya;if(a&&e){var n=fa(a).hoistableStyles,u=Ga(e);t=t||"default";var s=n.get(u);if(!s){var d={loading:0,preload:null};if(s=a.querySelector(qn(u)))d.loading=5;else{e=E({rel:"stylesheet",href:e,"data-precedence":t},l),(l=qt.get(u))&&Ds(e,l);var v=s=a.createElement("link");Fe(v),nt(v,"link",e),v._p=new Promise(function(N,C){v.onload=N,v.onerror=C}),v.addEventListener("load",function(){d.loading|=1}),v.addEventListener("error",function(){d.loading|=2}),d.loading|=4,ai(s,t,a)}s={type:"stylesheet",instance:s,count:1,state:d},n.set(u,s)}}}function dy(e,t){dl.X(e,t);var l=Ya;if(l&&e){var a=fa(l).hoistableScripts,n=Qa(e),u=a.get(n);u||(u=l.querySelector(wn(n)),u||(e=E({src:e,async:!0},t),(t=qt.get(n))&&Ms(e,t),u=l.createElement("script"),Fe(u),nt(u,"link",e),l.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(n,u))}}function my(e,t){dl.M(e,t);var l=Ya;if(l&&e){var a=fa(l).hoistableScripts,n=Qa(e),u=a.get(n);u||(u=l.querySelector(wn(n)),u||(e=E({src:e,async:!0,type:"module"},t),(t=qt.get(n))&&Ms(e,t),u=l.createElement("script"),Fe(u),nt(u,"link",e),l.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(n,u))}}function kd(e,t,l,a){var n=(n=ue.current)?li(n):null;if(!n)throw Error(f(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(t=Ga(l.href),l=fa(n).hoistableStyles,a=l.get(t),a||(a={type:"style",instance:null,count:0,state:null},l.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=Ga(l.href);var u=fa(n).hoistableStyles,s=u.get(e);if(s||(n=n.ownerDocument||n,s={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,s),(u=n.querySelector(qn(e)))&&!u._p&&(s.instance=u,s.state.loading=5),qt.has(e)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},qt.set(e,l),u||hy(n,e,l,s.state))),t&&a===null)throw Error(f(528,""));return s}if(t&&a!==null)throw Error(f(529,""));return null;case"script":return t=l.async,l=l.src,typeof l=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Qa(l),l=fa(n).hoistableScripts,a=l.get(t),a||(a={type:"script",instance:null,count:0,state:null},l.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(f(444,e))}}function Ga(e){return'href="'+At(e)+'"'}function qn(e){return'link[rel="stylesheet"]['+e+"]"}function $d(e){return E({},e,{"data-precedence":e.precedence,precedence:null})}function hy(e,t,l,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),nt(t,"link",l),Fe(t),e.head.appendChild(t))}function Qa(e){return'[src="'+At(e)+'"]'}function wn(e){return"script[async]"+e}function Wd(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+At(l.href)+'"]');if(a)return t.instance=a,Fe(a),a;var n=E({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),Fe(a),nt(a,"style",n),ai(a,l.precedence,e),t.instance=a;case"stylesheet":n=Ga(l.href);var u=e.querySelector(qn(n));if(u)return t.state.loading|=4,t.instance=u,Fe(u),u;a=$d(l),(n=qt.get(n))&&Ds(a,n),u=(e.ownerDocument||e).createElement("link"),Fe(u);var s=u;return s._p=new Promise(function(d,v){s.onload=d,s.onerror=v}),nt(u,"link",a),t.state.loading|=4,ai(u,l.precedence,e),t.instance=u;case"script":return u=Qa(l.src),(n=e.querySelector(wn(u)))?(t.instance=n,Fe(n),n):(a=l,(n=qt.get(u))&&(a=E({},l),Ms(a,n)),e=e.ownerDocument||e,n=e.createElement("script"),Fe(n),nt(n,"link",a),e.head.appendChild(n),t.instance=n);case"void":return null;default:throw Error(f(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,ai(a,l.precedence,e));return t.instance}function ai(e,t,l){for(var a=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),n=a.length?a[a.length-1]:null,u=n,s=0;s title"):null)}function vy(e,t,l){if(l===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Pd(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function yy(e,t,l,a){if(l.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var n=Ga(a.href),u=t.querySelector(qn(n));if(u){t=u._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=ui.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=u,Fe(u);return}u=t.ownerDocument||t,a=$d(a),(n=qt.get(n))&&Ds(a,n),u=u.createElement("link"),Fe(u);var s=u;s._p=new Promise(function(d,v){s.onload=d,s.onerror=v}),nt(u,"link",a),l.instance=u}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,t),(t=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=ui.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var Us=0;function py(e,t){return e.stylesheets&&e.count===0&&ci(e,e.stylesheets),0Us?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(n)}}:null}function ui(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ci(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ii=null;function ci(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ii=new Map,t.forEach(gy,e),ii=null,ui.call(e))}function gy(e,t){if(!(t.state.loading&4)){var l=ii.get(e);if(l)var a=l.get(null);else{l=new Map,ii.set(e,l);for(var n=e.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(r){console.error(r)}}return i(),Xs.exports=Uy(),Xs.exports}var qy=Hy();var jm="popstate";function Nm(i){return typeof i=="object"&&i!=null&&"pathname"in i&&"search"in i&&"hash"in i&&"state"in i&&"key"in i}function wy(i={}){function r(m,h){let{pathname:_="/",search:R="",hash:S=""}=ua(m.location.hash.substring(1));return!_.startsWith("/")&&!_.startsWith(".")&&(_="/"+_),Is("",{pathname:_,search:R,hash:S},h.state&&h.state.usr||null,h.state&&h.state.key||"default")}function o(m,h){let _=m.document.querySelector("base"),R="";if(_&&_.getAttribute("href")){let S=m.location.href,y=S.indexOf("#");R=y===-1?S:S.slice(0,y)}return R+"#"+(typeof h=="string"?h:kn(h))}function f(m,h){Bt(m.pathname.charAt(0)==="/",`relative pathnames are not supported in hash history.push(${JSON.stringify(h)})`)}return Ly(r,o,f,i)}function Le(i,r){if(i===!1||i===null||typeof i>"u")throw new Error(r)}function Bt(i,r){if(!i){typeof console<"u"&&console.warn(r);try{throw new Error(r)}catch{}}}function By(){return Math.random().toString(36).substring(2,10)}function Em(i,r){return{usr:i.state,key:i.key,idx:r,masked:i.unstable_mask?{pathname:i.pathname,search:i.search,hash:i.hash}:void 0}}function Is(i,r,o=null,f,m){return{pathname:typeof i=="string"?i:i.pathname,search:"",hash:"",...typeof r=="string"?ua(r):r,state:o,key:r&&r.key||f||By(),unstable_mask:m}}function kn({pathname:i="/",search:r="",hash:o=""}){return r&&r!=="?"&&(i+=r.charAt(0)==="?"?r:"?"+r),o&&o!=="#"&&(i+=o.charAt(0)==="#"?o:"#"+o),i}function ua(i){let r={};if(i){let o=i.indexOf("#");o>=0&&(r.hash=i.substring(o),i=i.substring(0,o));let f=i.indexOf("?");f>=0&&(r.search=i.substring(f),i=i.substring(0,f)),i&&(r.pathname=i)}return r}function Ly(i,r,o,f={}){let{window:m=document.defaultView,v5Compat:h=!1}=f,_=m.history,R="POP",S=null,y=z();y==null&&(y=0,_.replaceState({..._.state,idx:y},""));function z(){return(_.state||{idx:null}).idx}function E(){R="POP";let w=z(),Z=w==null?null:w-y;y=w,S&&S({action:R,location:Q.location,delta:Z})}function L(w,Z){R="PUSH";let F=Nm(w)?w:Is(Q.location,w,Z);o&&o(F,w),y=z()+1;let $=Em(F,y),G=Q.createHref(F.unstable_mask||F);try{_.pushState($,"",G)}catch(ne){if(ne instanceof DOMException&&ne.name==="DataCloneError")throw ne;m.location.assign(G)}h&&S&&S({action:R,location:Q.location,delta:1})}function B(w,Z){R="REPLACE";let F=Nm(w)?w:Is(Q.location,w,Z);o&&o(F,w),y=z();let $=Em(F,y),G=Q.createHref(F.unstable_mask||F);_.replaceState($,"",G),h&&S&&S({action:R,location:Q.location,delta:0})}function V(w){return Yy(w)}let Q={get action(){return R},get location(){return i(m,_)},listen(w){if(S)throw new Error("A history only accepts one active listener");return m.addEventListener(jm,E),S=w,()=>{m.removeEventListener(jm,E),S=null}},createHref(w){return r(m,w)},createURL:V,encodeLocation(w){let Z=V(w);return{pathname:Z.pathname,search:Z.search,hash:Z.hash}},push:L,replace:B,go(w){return _.go(w)}};return Q}function Yy(i,r=!1){let o="http://localhost";typeof window<"u"&&(o=window.location.origin!=="null"?window.location.origin:window.location.href),Le(o,"No window.location.(origin|href) available to create URL");let f=typeof i=="string"?i:kn(i);return f=f.replace(/ $/,"%20"),!r&&f.startsWith("//")&&(f=o+f),new URL(f,o)}function Um(i,r,o="/"){return Gy(i,r,o,!1)}function Gy(i,r,o,f){let m=typeof r=="string"?ua(r):r,h=ml(m.pathname||"/",o);if(h==null)return null;let _=Hm(i);Qy(_);let R=null;for(let S=0;R==null&&S<_.length;++S){let y=Py(h);R=Fy(_[S],y,f)}return R}function Hm(i,r=[],o=[],f="",m=!1){let h=(_,R,S=m,y)=>{let z={relativePath:y===void 0?_.path||"":y,caseSensitive:_.caseSensitive===!0,childrenIndex:R,route:_};if(z.relativePath.startsWith("/")){if(!z.relativePath.startsWith(f)&&S)return;Le(z.relativePath.startsWith(f),`Absolute route path "${z.relativePath}" nested under path "${f}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),z.relativePath=z.relativePath.slice(f.length)}let E=Qt([f,z.relativePath]),L=o.concat(z);_.children&&_.children.length>0&&(Le(_.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${E}".`),Hm(_.children,r,L,E,S)),!(_.path==null&&!_.index)&&r.push({path:E,score:$y(E,_.index),routesMeta:L})};return i.forEach((_,R)=>{if(_.path===""||!_.path?.includes("?"))h(_,R);else for(let S of qm(_.path))h(_,R,!0,S)}),r}function qm(i){let r=i.split("/");if(r.length===0)return[];let[o,...f]=r,m=o.endsWith("?"),h=o.replace(/\?$/,"");if(f.length===0)return m?[h,""]:[h];let _=qm(f.join("/")),R=[];return R.push(..._.map(S=>S===""?h:[h,S].join("/"))),m&&R.push(..._),R.map(S=>i.startsWith("/")&&S===""?"/":S)}function Qy(i){i.sort((r,o)=>r.score!==o.score?o.score-r.score:Wy(r.routesMeta.map(f=>f.childrenIndex),o.routesMeta.map(f=>f.childrenIndex)))}var Xy=/^:[\w-]+$/,Zy=3,Vy=2,Ky=1,Jy=10,ky=-2,Tm=i=>i==="*";function $y(i,r){let o=i.split("/"),f=o.length;return o.some(Tm)&&(f+=ky),r&&(f+=Vy),o.filter(m=>!Tm(m)).reduce((m,h)=>m+(Xy.test(h)?Zy:h===""?Ky:Jy),f)}function Wy(i,r){return i.length===r.length&&i.slice(0,-1).every((f,m)=>f===r[m])?i[i.length-1]-r[r.length-1]:0}function Fy(i,r,o=!1){let{routesMeta:f}=i,m={},h="/",_=[];for(let R=0;R{if(z==="*"){let V=R[L]||"";_=h.slice(0,h.length-V.length).replace(/(.)\/+$/,"$1")}const B=R[L];return E&&!B?y[z]=void 0:y[z]=(B||"").replace(/%2F/g,"/"),y},{}),pathname:h,pathnameBase:_,pattern:i}}function Iy(i,r=!1,o=!0){Bt(i==="*"||!i.endsWith("*")||i.endsWith("/*"),`Route path "${i}" will be treated as if it were "${i.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${i.replace(/\*$/,"/*")}".`);let f=[],m="^"+i.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(_,R,S,y,z)=>{if(f.push({paramName:R,isOptional:S!=null}),S){let E=z.charAt(y+_.length);return E&&E!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return i.endsWith("*")?(f.push({paramName:"*"}),m+=i==="*"||i==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):o?m+="\\/*$":i!==""&&i!=="/"&&(m+="(?:(?=\\/|$))"),[new RegExp(m,r?void 0:"i"),f]}function Py(i){try{return i.split("/").map(r=>decodeURIComponent(r).replace(/\//g,"%2F")).join("/")}catch(r){return Bt(!1,`The URL path "${i}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${r}).`),i}}function ml(i,r){if(r==="/")return i;if(!i.toLowerCase().startsWith(r.toLowerCase()))return null;let o=r.endsWith("/")?r.length-1:r.length,f=i.charAt(o);return f&&f!=="/"?null:i.slice(o)||"/"}var ep=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function tp(i,r="/"){let{pathname:o,search:f="",hash:m=""}=typeof i=="string"?ua(i):i,h;return o?(o=wm(o),o.startsWith("/")?h=Rm(o.substring(1),"/"):h=Rm(o,r)):h=r,{pathname:h,search:np(f),hash:up(m)}}function Rm(i,r){let o=xi(r).split("/");return i.split("/").forEach(m=>{m===".."?o.length>1&&o.pop():m!=="."&&o.push(m)}),o.length>1?o.join("/"):"/"}function Js(i,r,o,f){return`Cannot include a '${i}' character in a manually specified \`to.${r}\` field [${JSON.stringify(f)}]. Please separate it out to the \`to.${o}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function lp(i){return i.filter((r,o)=>o===0||r.route.path&&r.route.path.length>0)}function lf(i){let r=lp(i);return r.map((o,f)=>f===r.length-1?o.pathname:o.pathnameBase)}function ji(i,r,o,f=!1){let m;typeof i=="string"?m=ua(i):(m={...i},Le(!m.pathname||!m.pathname.includes("?"),Js("?","pathname","search",m)),Le(!m.pathname||!m.pathname.includes("#"),Js("#","pathname","hash",m)),Le(!m.search||!m.search.includes("#"),Js("#","search","hash",m)));let h=i===""||m.pathname==="",_=h?"/":m.pathname,R;if(_==null)R=o;else{let E=r.length-1;if(!f&&_.startsWith("..")){let L=_.split("/");for(;L[0]==="..";)L.shift(),E-=1;m.pathname=L.join("/")}R=E>=0?r[E]:"/"}let S=tp(m,R),y=_&&_!=="/"&&_.endsWith("/"),z=(h||_===".")&&o.endsWith("/");return!S.pathname.endsWith("/")&&(y||z)&&(S.pathname+="/"),S}var wm=i=>i.replace(/\/\/+/g,"/"),Qt=i=>wm(i.join("/")),xi=i=>i.replace(/\/+$/,""),ap=i=>xi(i).replace(/^\/*/,"/"),np=i=>!i||i==="?"?"":i.startsWith("?")?i:"?"+i,up=i=>!i||i==="#"?"":i.startsWith("#")?i:"#"+i,ip=class{constructor(i,r,o,f=!1){this.status=i,this.statusText=r||"",this.internal=f,o instanceof Error?(this.data=o.toString(),this.error=o):this.data=o}};function cp(i){return i!=null&&typeof i.status=="number"&&typeof i.statusText=="string"&&typeof i.internal=="boolean"&&"data"in i}function sp(i){let r=i.map(o=>o.route.path).filter(Boolean);return Qt(r)||"/"}var Bm=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Lm(i,r){let o=i;if(typeof o!="string"||!ep.test(o))return{absoluteURL:void 0,isExternal:!1,to:o};let f=o,m=!1;if(Bm)try{let h=new URL(window.location.href),_=o.startsWith("//")?new URL(h.protocol+o):new URL(o),R=ml(_.pathname,r);_.origin===h.origin&&R!=null?o=R+_.search+_.hash:m=!0}catch{Bt(!1,` contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:f,isExternal:m,to:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Ym=["POST","PUT","PATCH","DELETE"];new Set(Ym);var fp=["GET",...Ym];new Set(fp);var Ja=p.createContext(null);Ja.displayName="DataRouter";var Ni=p.createContext(null);Ni.displayName="DataRouterState";var Gm=p.createContext(!1);function rp(){return p.useContext(Gm)}var Qm=p.createContext({isTransitioning:!1});Qm.displayName="ViewTransition";var op=p.createContext(new Map);op.displayName="Fetchers";var dp=p.createContext(null);dp.displayName="Await";var Tt=p.createContext(null);Tt.displayName="Navigation";var $n=p.createContext(null);$n.displayName="Location";var Xt=p.createContext({outlet:null,matches:[],isDataRoute:!1});Xt.displayName="Route";var af=p.createContext(null);af.displayName="RouteError";var Xm="REACT_ROUTER_ERROR",mp="REDIRECT",hp="ROUTE_ERROR_RESPONSE";function vp(i){if(i.startsWith(`${Xm}:${mp}:{`))try{let r=JSON.parse(i.slice(28));if(typeof r=="object"&&r&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.location=="string"&&typeof r.reloadDocument=="boolean"&&typeof r.replace=="boolean")return r}catch{}}function yp(i){if(i.startsWith(`${Xm}:${hp}:{`))try{let r=JSON.parse(i.slice(40));if(typeof r=="object"&&r&&typeof r.status=="number"&&typeof r.statusText=="string")return new ip(r.status,r.statusText,r.data)}catch{}}function pp(i,{relative:r}={}){Le(ka(),"useHref() may be used only in the context of a component.");let{basename:o,navigator:f}=p.useContext(Tt),{hash:m,pathname:h,search:_}=Wn(i,{relative:r}),R=h;return o!=="/"&&(R=h==="/"?o:Qt([o,h])),f.createHref({pathname:R,search:_,hash:m})}function ka(){return p.useContext($n)!=null}function kt(){return Le(ka(),"useLocation() may be used only in the context of a component."),p.useContext($n).location}var Zm="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Vm(i){p.useContext(Tt).static||p.useLayoutEffect(i)}function Km(){let{isDataRoute:i}=p.useContext(Xt);return i?Dp():gp()}function gp(){Le(ka(),"useNavigate() may be used only in the context of a component.");let i=p.useContext(Ja),{basename:r,navigator:o}=p.useContext(Tt),{matches:f}=p.useContext(Xt),{pathname:m}=kt(),h=JSON.stringify(lf(f)),_=p.useRef(!1);return Vm(()=>{_.current=!0}),p.useCallback((S,y={})=>{if(Bt(_.current,Zm),!_.current)return;if(typeof S=="number"){o.go(S);return}let z=ji(S,JSON.parse(h),m,y.relative==="path");i==null&&r!=="/"&&(z.pathname=z.pathname==="/"?r:Qt([r,z.pathname])),(y.replace?o.replace:o.push)(z,y.state,y)},[r,o,h,m,i])}var bp=p.createContext(null);function _p(i){let r=p.useContext(Xt).outlet;return p.useMemo(()=>r&&p.createElement(bp.Provider,{value:i},r),[r,i])}function Wn(i,{relative:r}={}){let{matches:o}=p.useContext(Xt),{pathname:f}=kt(),m=JSON.stringify(lf(o));return p.useMemo(()=>ji(i,JSON.parse(m),f,r==="path"),[i,m,f,r])}function Sp(i,r){return Jm(i,r)}function Jm(i,r,o){Le(ka(),"useRoutes() may be used only in the context of a component.");let{navigator:f}=p.useContext(Tt),{matches:m}=p.useContext(Xt),h=m[m.length-1],_=h?h.params:{},R=h?h.pathname:"/",S=h?h.pathnameBase:"/",y=h&&h.route;{let w=y&&y.path||"";$m(R,!y||w.endsWith("*")||w.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${R}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. +`+a.stack}}var Ti=Object.prototype.hasOwnProperty,Ri=i.unstable_scheduleCallback,Ai=i.unstable_cancelCallback,uh=i.unstable_shouldYield,ih=i.unstable_requestPaint,yt=i.unstable_now,ch=i.unstable_getCurrentPriorityLevel,mf=i.unstable_ImmediatePriority,hf=i.unstable_UserBlockingPriority,In=i.unstable_NormalPriority,sh=i.unstable_LowPriority,vf=i.unstable_IdlePriority,fh=i.log,rh=i.unstable_setDisableYieldValue,$a=null,pt=null;function hl(e){if(typeof fh=="function"&&rh(e),pt&&typeof pt.setStrictMode=="function")try{pt.setStrictMode($a,e)}catch{}}var gt=Math.clz32?Math.clz32:mh,oh=Math.log,dh=Math.LN2;function mh(e){return e>>>=0,e===0?32:31-(oh(e)/dh|0)|0}var Pn=256,eu=262144,tu=4194304;function Ll(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function lu(e,t,l){var a=e.pendingLanes;if(a===0)return 0;var n=0,u=e.suspendedLanes,s=e.pingedLanes;e=e.warmLanes;var d=a&134217727;return d!==0?(a=d&~u,a!==0?n=Ll(a):(s&=d,s!==0?n=Ll(s):l||(l=d&~e,l!==0&&(n=Ll(l))))):(d=a&~u,d!==0?n=Ll(d):s!==0?n=Ll(s):l||(l=a&~e,l!==0&&(n=Ll(l)))),n===0?0:t!==0&&t!==n&&(t&u)===0&&(u=n&-n,l=t&-t,u>=l||u===32&&(l&4194048)!==0)?t:n}function Wa(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function hh(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function yf(){var e=tu;return tu<<=1,(tu&62914560)===0&&(tu=4194304),e}function zi(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function Fa(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function vh(e,t,l,a,n,u){var s=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var d=e.entanglements,v=e.expirationTimes,E=e.hiddenUpdates;for(l=s&~l;0"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Sh=/[\n"\\]/g;function At(e){return e.replace(Sh,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Hi(e,t,l,a,n,u,s,d){e.name="",s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?e.type=s:e.removeAttribute("type"),t!=null?s==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Rt(t)):e.value!==""+Rt(t)&&(e.value=""+Rt(t)):s!=="submit"&&s!=="reset"||e.removeAttribute("value"),t!=null?qi(e,s,Rt(t)):l!=null?qi(e,s,Rt(l)):a!=null&&e.removeAttribute("value"),n==null&&u!=null&&(e.defaultChecked=!!u),n!=null&&(e.checked=n&&typeof n!="function"&&typeof n!="symbol"),d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"?e.name=""+Rt(d):e.removeAttribute("name")}function zf(e,t,l,a,n,u,s,d){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.type=u),t!=null||l!=null){if(!(u!=="submit"&&u!=="reset"||t!=null)){Ui(e);return}l=l!=null?""+Rt(l):"",t=t!=null?""+Rt(t):l,d||t===e.value||(e.value=t),e.defaultValue=t}a=a??n,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=d?e.checked:!!a,e.defaultChecked=!!a,s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(e.name=s),Ui(e)}function qi(e,t,l){t==="number"&&uu(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function oa(e,t,l,a){if(e=e.options,t){t={};for(var n=0;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Gi=!1;if(Ft)try{var tn={};Object.defineProperty(tn,"passive",{get:function(){Gi=!0}}),window.addEventListener("test",tn,tn),window.removeEventListener("test",tn,tn)}catch{Gi=!1}var yl=null,Qi=null,cu=null;function qf(){if(cu)return cu;var e,t=Qi,l=t.length,a,n="value"in yl?yl.value:yl.textContent,u=n.length;for(e=0;e=nn),Qf=" ",Xf=!1;function Zf(e,t){switch(e){case"keyup":return $h.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Vf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var va=!1;function Fh(e,t){switch(e){case"compositionend":return Vf(t);case"keypress":return t.which!==32?null:(Xf=!0,Qf);case"textInput":return e=t.data,e===Qf&&Xf?null:e;default:return null}}function Ih(e,t){if(va)return e==="compositionend"||!Ji&&Zf(e,t)?(e=qf(),cu=Qi=yl=null,va=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:l,offset:t-e};e=a}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Pf(l)}}function tr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?tr(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function lr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=uu(e.document);t instanceof e.HTMLIFrameElement;){try{var l=typeof t.contentWindow.location.href=="string"}catch{l=!1}if(l)e=t.contentWindow;else break;t=uu(e.document)}return t}function Wi(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var iv=Ft&&"documentMode"in document&&11>=document.documentMode,ya=null,Fi=null,fn=null,Ii=!1;function ar(e,t,l){var a=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Ii||ya==null||ya!==uu(a)||(a=ya,"selectionStart"in a&&Wi(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),fn&&sn(fn,a)||(fn=a,a=ei(Fi,"onSelect"),0>=s,n-=s,Zt=1<<32-gt(t)+n|l<ce?(ye=W,W=null):ye=W.sibling;var je=T(x,W,j[ce],D);if(je===null){W===null&&(W=ye);break}e&&W&&je.alternate===null&&t(x,W),g=u(je,g,ce),xe===null?I=je:xe.sibling=je,xe=je,W=ye}if(ce===j.length)return l(x,W),be&&Pt(x,ce),I;if(W===null){for(;cece?(ye=W,W=null):ye=W.sibling;var Bl=T(x,W,je.value,D);if(Bl===null){W===null&&(W=ye);break}e&&W&&Bl.alternate===null&&t(x,W),g=u(Bl,g,ce),xe===null?I=Bl:xe.sibling=Bl,xe=Bl,W=ye}if(je.done)return l(x,W),be&&Pt(x,ce),I;if(W===null){for(;!je.done;ce++,je=j.next())je=U(x,je.value,D),je!==null&&(g=u(je,g,ce),xe===null?I=je:xe.sibling=je,xe=je);return be&&Pt(x,ce),I}for(W=a(W);!je.done;ce++,je=j.next())je=A(W,x,ce,je.value,D),je!==null&&(e&&je.alternate!==null&&W.delete(je.key===null?ce:je.key),g=u(je,g,ce),xe===null?I=je:xe.sibling=je,xe=je);return e&&W.forEach(function(Ty){return t(x,Ty)}),be&&Pt(x,ce),I}function Oe(x,g,j,D){if(typeof j=="object"&&j!==null&&j.type===Q&&j.key===null&&(j=j.props.children),typeof j=="object"&&j!==null){switch(j.$$typeof){case w:e:{for(var I=j.key;g!==null;){if(g.key===I){if(I=j.type,I===Q){if(g.tag===7){l(x,g.sibling),D=n(g,j.props.children),D.return=x,x=D;break e}}else if(g.elementType===I||typeof I=="object"&&I!==null&&I.$$typeof===se&&Wl(I)===g.type){l(x,g.sibling),D=n(g,j.props),vn(D,j),D.return=x,x=D;break e}l(x,g);break}else t(x,g);g=g.sibling}j.type===Q?(D=Vl(j.props.children,x.mode,D,j.key),D.return=x,x=D):(D=pu(j.type,j.key,j.props,null,x.mode,D),vn(D,j),D.return=x,x=D)}return s(x);case V:e:{for(I=j.key;g!==null;){if(g.key===I)if(g.tag===4&&g.stateNode.containerInfo===j.containerInfo&&g.stateNode.implementation===j.implementation){l(x,g.sibling),D=n(g,j.children||[]),D.return=x,x=D;break e}else{l(x,g);break}else t(x,g);g=g.sibling}D=uc(j,x.mode,D),D.return=x,x=D}return s(x);case se:return j=Wl(j),Oe(x,g,j,D)}if(De(j))return k(x,g,j,D);if(Se(j)){if(I=Se(j),typeof I!="function")throw Error(r(150));return j=I.call(j),te(x,g,j,D)}if(typeof j.then=="function")return Oe(x,g,Nu(j),D);if(j.$$typeof===$)return Oe(x,g,_u(x,j),D);Eu(x,j)}return typeof j=="string"&&j!==""||typeof j=="number"||typeof j=="bigint"?(j=""+j,g!==null&&g.tag===6?(l(x,g.sibling),D=n(g,j),D.return=x,x=D):(l(x,g),D=nc(j,x.mode,D),D.return=x,x=D),s(x)):l(x,g)}return function(x,g,j,D){try{hn=0;var I=Oe(x,g,j,D);return Ra=null,I}catch(W){if(W===Ta||W===xu)throw W;var xe=_t(29,W,null,x.mode);return xe.lanes=D,xe.return=x,xe}}}var Il=Tr(!0),Rr=Tr(!1),Sl=!1;function pc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function gc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function xl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function jl(e,t,l){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(Ne&2)!==0){var n=a.pending;return n===null?t.next=t:(t.next=n.next,n.next=t),a.pending=t,t=yu(e),rr(e,null,l),t}return vu(e,a,t,l),yu(e)}function yn(e,t,l){if(t=t.updateQueue,t!==null&&(t=t.shared,(l&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,l|=a,t.lanes=l,gf(e,l)}}function bc(e,t){var l=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,l===a)){var n=null,u=null;if(l=l.firstBaseUpdate,l!==null){do{var s={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};u===null?n=u=s:u=u.next=s,l=l.next}while(l!==null);u===null?n=u=t:u=u.next=t}else n=u=t;l={baseState:a.baseState,firstBaseUpdate:n,lastBaseUpdate:u,shared:a.shared,callbacks:a.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=t:e.next=t,l.lastBaseUpdate=t}var _c=!1;function pn(){if(_c){var e=Ea;if(e!==null)throw e}}function gn(e,t,l,a){_c=!1;var n=e.updateQueue;Sl=!1;var u=n.firstBaseUpdate,s=n.lastBaseUpdate,d=n.shared.pending;if(d!==null){n.shared.pending=null;var v=d,E=v.next;v.next=null,s===null?u=E:s.next=E,s=v;var C=e.alternate;C!==null&&(C=C.updateQueue,d=C.lastBaseUpdate,d!==s&&(d===null?C.firstBaseUpdate=E:d.next=E,C.lastBaseUpdate=v))}if(u!==null){var U=n.baseState;s=0,C=E=v=null,d=u;do{var T=d.lane&-536870913,A=T!==d.lane;if(A?(ve&T)===T:(a&T)===T){T!==0&&T===Na&&(_c=!0),C!==null&&(C=C.next={lane:0,tag:d.tag,payload:d.payload,callback:null,next:null});e:{var k=e,te=d;T=t;var Oe=l;switch(te.tag){case 1:if(k=te.payload,typeof k=="function"){U=k.call(Oe,U,T);break e}U=k;break e;case 3:k.flags=k.flags&-65537|128;case 0:if(k=te.payload,T=typeof k=="function"?k.call(Oe,U,T):k,T==null)break e;U=N({},U,T);break e;case 2:Sl=!0}}T=d.callback,T!==null&&(e.flags|=64,A&&(e.flags|=8192),A=n.callbacks,A===null?n.callbacks=[T]:A.push(T))}else A={lane:T,tag:d.tag,payload:d.payload,callback:d.callback,next:null},C===null?(E=C=A,v=U):C=C.next=A,s|=T;if(d=d.next,d===null){if(d=n.shared.pending,d===null)break;A=d,d=A.next,A.next=null,n.lastBaseUpdate=A,n.shared.pending=null}}while(!0);C===null&&(v=U),n.baseState=v,n.firstBaseUpdate=E,n.lastBaseUpdate=C,u===null&&(n.shared.lanes=0),Al|=s,e.lanes=s,e.memoizedState=U}}function Ar(e,t){if(typeof e!="function")throw Error(r(191,e));e.call(t)}function zr(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;eu?u:8;var s=O.T,d={};O.T=d,Lc(e,!1,t,l);try{var v=n(),E=O.S;if(E!==null&&E(d,v),v!==null&&typeof v=="object"&&typeof v.then=="function"){var C=vv(v,a);Sn(e,t,C,Et(e))}else Sn(e,t,a,Et(e))}catch(U){Sn(e,t,{then:function(){},status:"rejected",reason:U},Et())}finally{Y.p=u,s!==null&&d.types!==null&&(s.types=d.types),O.T=s}}function Sv(){}function wc(e,t,l,a){if(e.tag!==5)throw Error(r(476));var n=co(e).queue;io(e,n,t,P,l===null?Sv:function(){return so(e),l(a)})}function co(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:P,baseState:P,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:al,lastRenderedState:P},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:al,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function so(e){var t=co(e);t.next===null&&(t=e.alternate.memoizedState),Sn(e,t.next.queue,{},Et())}function Bc(){return lt(Bn)}function fo(){return Ze().memoizedState}function ro(){return Ze().memoizedState}function xv(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=Et();e=xl(l);var a=jl(t,e,l);a!==null&&(vt(a,t,l),yn(a,t,l)),t={cache:mc()},e.payload=t;return}t=t.return}}function jv(e,t,l){var a=Et();l={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Hu(e)?mo(t,l):(l=lc(e,t,l,a),l!==null&&(vt(l,e,a),ho(l,t,a)))}function oo(e,t,l){var a=Et();Sn(e,t,l,a)}function Sn(e,t,l,a){var n={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Hu(e))mo(t,n);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var s=t.lastRenderedState,d=u(s,l);if(n.hasEagerState=!0,n.eagerState=d,bt(d,s))return vu(e,t,n,0),Me===null&&hu(),!1}catch{}if(l=lc(e,t,n,a),l!==null)return vt(l,e,a),ho(l,t,a),!0}return!1}function Lc(e,t,l,a){if(a={lane:2,revertLane:ps(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Hu(e)){if(t)throw Error(r(479))}else t=lc(e,l,a,2),t!==null&&vt(t,e,2)}function Hu(e){var t=e.alternate;return e===ie||t!==null&&t===ie}function mo(e,t){za=Au=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function ho(e,t,l){if((l&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,l|=a,t.lanes=l,gf(e,l)}}var xn={readContext:lt,use:Cu,useCallback:Ye,useContext:Ye,useEffect:Ye,useImperativeHandle:Ye,useLayoutEffect:Ye,useInsertionEffect:Ye,useMemo:Ye,useReducer:Ye,useRef:Ye,useState:Ye,useDebugValue:Ye,useDeferredValue:Ye,useTransition:Ye,useSyncExternalStore:Ye,useId:Ye,useHostTransitionStatus:Ye,useFormState:Ye,useActionState:Ye,useOptimistic:Ye,useMemoCache:Ye,useCacheRefresh:Ye};xn.useEffectEvent=Ye;var vo={readContext:lt,use:Cu,useCallback:function(e,t){return ct().memoizedState=[e,t===void 0?null:t],e},useContext:lt,useEffect:Fr,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,Mu(4194308,4,to.bind(null,t,e),l)},useLayoutEffect:function(e,t){return Mu(4194308,4,e,t)},useInsertionEffect:function(e,t){Mu(4,2,e,t)},useMemo:function(e,t){var l=ct();t=t===void 0?null:t;var a=e();if(Pl){hl(!0);try{e()}finally{hl(!1)}}return l.memoizedState=[a,t],a},useReducer:function(e,t,l){var a=ct();if(l!==void 0){var n=l(t);if(Pl){hl(!0);try{l(t)}finally{hl(!1)}}}else n=t;return a.memoizedState=a.baseState=n,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},a.queue=e,e=e.dispatch=jv.bind(null,ie,e),[a.memoizedState,e]},useRef:function(e){var t=ct();return e={current:e},t.memoizedState=e},useState:function(e){e=Dc(e);var t=e.queue,l=oo.bind(null,ie,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:Hc,useDeferredValue:function(e,t){var l=ct();return qc(l,e,t)},useTransition:function(){var e=Dc(!1);return e=io.bind(null,ie,e.queue,!0,!1),ct().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var a=ie,n=ct();if(be){if(l===void 0)throw Error(r(407));l=l()}else{if(l=t(),Me===null)throw Error(r(349));(ve&127)!==0||Hr(a,t,l)}n.memoizedState=l;var u={value:l,getSnapshot:t};return n.queue=u,Fr(wr.bind(null,a,u,e),[e]),a.flags|=2048,Ca(9,{destroy:void 0},qr.bind(null,a,u,l,t),null),l},useId:function(){var e=ct(),t=Me.identifierPrefix;if(be){var l=Vt,a=Zt;l=(a&~(1<<32-gt(a)-1)).toString(32)+l,t="_"+t+"R_"+l,l=zu++,0<\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof a.is=="string"?s.createElement("select",{is:a.is}):s.createElement("select"),a.multiple?u.multiple=!0:a.size&&(u.size=a.size);break;default:u=typeof a.is=="string"?s.createElement(n,{is:a.is}):s.createElement(n)}}u[et]=t,u[ft]=a;e:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)u.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break e;for(;s.sibling===null;){if(s.return===null||s.return===t)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=u;e:switch(nt(u,n,a),n){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&ul(t)}}return we(t),Pc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&ul(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(r(166));if(e=ue.current,xa(t)){if(e=t.stateNode,l=t.memoizedProps,a=null,n=tt,n!==null)switch(n.tag){case 27:case 5:a=n.memoizedProps}e[et]=t,e=!!(e.nodeValue===l||a!==null&&a.suppressHydrationWarning===!0||Ud(e.nodeValue,l)),e||bl(t,!0)}else e=ti(e).createTextNode(a),e[et]=t,t.stateNode=e}return we(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(a=xa(t),l!==null){if(e===null){if(!a)throw Error(r(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(557));e[et]=t}else Kl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;we(t),e=!1}else l=fc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(xt(t),t):(xt(t),null);if((t.flags&128)!==0)throw Error(r(558))}return we(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(n=xa(t),a!==null&&a.dehydrated!==null){if(e===null){if(!n)throw Error(r(318));if(n=t.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(r(317));n[et]=t}else Kl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;we(t),n=!1}else n=fc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),n=!0;if(!n)return t.flags&256?(xt(t),t):(xt(t),null)}return xt(t),(t.flags&128)!==0?(t.lanes=l,t):(l=a!==null,e=e!==null&&e.memoizedState!==null,l&&(a=t.child,n=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(n=a.alternate.memoizedState.cachePool.pool),u=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),u!==n&&(a.flags|=2048)),l!==e&&l&&(t.child.flags|=8192),Yu(t,t.updateQueue),we(t),null);case 4:return q(),e===null&&Ss(t.stateNode.containerInfo),we(t),null;case 10:return tl(t.type),we(t),null;case 19:if(M(Xe),a=t.memoizedState,a===null)return we(t),null;if(n=(t.flags&128)!==0,u=a.rendering,u===null)if(n)Nn(a,!1);else{if(Ge!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(u=Ru(e),u!==null){for(t.flags|=128,Nn(a,!1),e=u.updateQueue,t.updateQueue=e,Yu(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)or(l,e),l=l.sibling;return X(Xe,Xe.current&1|2),be&&Pt(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&yt()>Vu&&(t.flags|=128,n=!0,Nn(a,!1),t.lanes=4194304)}else{if(!n)if(e=Ru(u),e!==null){if(t.flags|=128,n=!0,e=e.updateQueue,t.updateQueue=e,Yu(t,e),Nn(a,!0),a.tail===null&&a.tailMode==="hidden"&&!u.alternate&&!be)return we(t),null}else 2*yt()-a.renderingStartTime>Vu&&l!==536870912&&(t.flags|=128,n=!0,Nn(a,!1),t.lanes=4194304);a.isBackwards?(u.sibling=t.child,t.child=u):(e=a.last,e!==null?e.sibling=u:t.child=u,a.last=u)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=yt(),e.sibling=null,l=Xe.current,X(Xe,n?l&1|2:l&1),be&&Pt(t,a.treeForkCount),e):(we(t),null);case 22:case 23:return xt(t),xc(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(l&536870912)!==0&&(t.flags&128)===0&&(we(t),t.subtreeFlags&6&&(t.flags|=8192)):we(t),l=t.updateQueue,l!==null&&Yu(t,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==l&&(t.flags|=2048),e!==null&&M($l),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),tl(Ke),we(t),null;case 25:return null;case 30:return null}throw Error(r(156,t.tag))}function Av(e,t){switch(cc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return tl(Ke),q(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ue(t),null;case 31:if(t.memoizedState!==null){if(xt(t),t.alternate===null)throw Error(r(340));Kl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(xt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));Kl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return M(Xe),null;case 4:return q(),null;case 10:return tl(t.type),null;case 22:case 23:return xt(t),xc(),e!==null&&M($l),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return tl(Ke),null;case 25:return null;default:return null}}function Lo(e,t){switch(cc(t),t.tag){case 3:tl(Ke),q();break;case 26:case 27:case 5:Ue(t);break;case 4:q();break;case 31:t.memoizedState!==null&&xt(t);break;case 13:xt(t);break;case 19:M(Xe);break;case 10:tl(t.type);break;case 22:case 23:xt(t),xc(),e!==null&&M($l);break;case 24:tl(Ke)}}function En(e,t){try{var l=t.updateQueue,a=l!==null?l.lastEffect:null;if(a!==null){var n=a.next;l=n;do{if((l.tag&e)===e){a=void 0;var u=l.create,s=l.inst;a=u(),s.destroy=a}l=l.next}while(l!==n)}}catch(d){Re(t,t.return,d)}}function Tl(e,t,l){try{var a=t.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var u=n.next;a=u;do{if((a.tag&e)===e){var s=a.inst,d=s.destroy;if(d!==void 0){s.destroy=void 0,n=t;var v=l,E=d;try{E()}catch(C){Re(n,v,C)}}}a=a.next}while(a!==u)}}catch(C){Re(t,t.return,C)}}function Yo(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{zr(t,l)}catch(a){Re(e,e.return,a)}}}function Go(e,t,l){l.props=ea(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(a){Re(e,t,a)}}function Tn(e,t){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof l=="function"?e.refCleanup=l(a):l.current=a}}catch(n){Re(e,t,n)}}function Kt(e,t){var l=e.ref,a=e.refCleanup;if(l!==null)if(typeof a=="function")try{a()}catch(n){Re(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(n){Re(e,t,n)}else l.current=null}function Qo(e){var t=e.type,l=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":l.autoFocus&&a.focus();break e;case"img":l.src?a.src=l.src:l.srcSet&&(a.srcset=l.srcSet)}}catch(n){Re(e,e.return,n)}}function es(e,t,l){try{var a=e.stateNode;Wv(a,e.type,l,t),a[ft]=t}catch(n){Re(e,e.return,n)}}function Xo(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ml(e.type)||e.tag===4}function ts(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Xo(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Ml(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function ls(e,t,l){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(e,t):(t=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,t.appendChild(e),l=l._reactRootContainer,l!=null||t.onclick!==null||(t.onclick=Wt));else if(a!==4&&(a===27&&Ml(e.type)&&(l=e.stateNode,t=null),e=e.child,e!==null))for(ls(e,t,l),e=e.sibling;e!==null;)ls(e,t,l),e=e.sibling}function Gu(e,t,l){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?l.insertBefore(e,t):l.appendChild(e);else if(a!==4&&(a===27&&Ml(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(Gu(e,t,l),e=e.sibling;e!==null;)Gu(e,t,l),e=e.sibling}function Zo(e){var t=e.stateNode,l=e.memoizedProps;try{for(var a=e.type,n=t.attributes;n.length;)t.removeAttributeNode(n[0]);nt(t,a,l),t[et]=e,t[ft]=l}catch(u){Re(e,e.return,u)}}var il=!1,$e=!1,as=!1,Vo=typeof WeakSet=="function"?WeakSet:Set,Ie=null;function zv(e,t){if(e=e.containerInfo,Ns=si,e=lr(e),Wi(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var a=l.getSelection&&l.getSelection();if(a&&a.rangeCount!==0){l=a.anchorNode;var n=a.anchorOffset,u=a.focusNode;a=a.focusOffset;try{l.nodeType,u.nodeType}catch{l=null;break e}var s=0,d=-1,v=-1,E=0,C=0,U=e,T=null;t:for(;;){for(var A;U!==l||n!==0&&U.nodeType!==3||(d=s+n),U!==u||a!==0&&U.nodeType!==3||(v=s+a),U.nodeType===3&&(s+=U.nodeValue.length),(A=U.firstChild)!==null;)T=U,U=A;for(;;){if(U===e)break t;if(T===l&&++E===n&&(d=s),T===u&&++C===a&&(v=s),(A=U.nextSibling)!==null)break;U=T,T=U.parentNode}U=A}l=d===-1||v===-1?null:{start:d,end:v}}else l=null}l=l||{start:0,end:0}}else l=null;for(Es={focusedElem:e,selectionRange:l},si=!1,Ie=t;Ie!==null;)if(t=Ie,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ie=e;else for(;Ie!==null;){switch(t=Ie,u=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(l=0;l title"))),nt(u,a,l),u[et]=e,Fe(u),a=u;break e;case"link":var s=Fd("link","href",n).get(a+(l.href||""));if(s){for(var d=0;dOe&&(s=Oe,Oe=te,te=s);var x=er(d,te),g=er(d,Oe);if(x&&g&&(A.rangeCount!==1||A.anchorNode!==x.node||A.anchorOffset!==x.offset||A.focusNode!==g.node||A.focusOffset!==g.offset)){var j=U.createRange();j.setStart(x.node,x.offset),A.removeAllRanges(),te>Oe?(A.addRange(j),A.extend(g.node,g.offset)):(j.setEnd(g.node,g.offset),A.addRange(j))}}}}for(U=[],A=d;A=A.parentNode;)A.nodeType===1&&U.push({element:A,left:A.scrollLeft,top:A.scrollTop});for(typeof d.focus=="function"&&d.focus(),d=0;dl?32:l,O.T=null,l=rs,rs=null;var u=Ol,s=ol;if(We=0,qa=Ol=null,ol=0,(Ne&6)!==0)throw Error(r(331));var d=Ne;if(Ne|=4,ld(u.current),Po(u,u.current,s,l),Ne=d,Dn(0,!1),pt&&typeof pt.onPostCommitFiberRoot=="function")try{pt.onPostCommitFiberRoot($a,u)}catch{}return!0}finally{Y.p=n,O.T=a,_d(e,t)}}function xd(e,t,l){t=Ot(l,t),t=Xc(e.stateNode,t,2),e=jl(e,t,2),e!==null&&(Fa(e,2),Jt(e))}function Re(e,t,l){if(e.tag===3)xd(e,e,l);else for(;t!==null;){if(t.tag===3){xd(t,e,l);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(zl===null||!zl.has(a))){e=Ot(l,e),l=jo(2),a=jl(t,l,2),a!==null&&(No(l,a,t,e),Fa(a,2),Jt(a));break}}t=t.return}}function hs(e,t,l){var a=e.pingCache;if(a===null){a=e.pingCache=new Dv;var n=new Set;a.set(t,n)}else n=a.get(t),n===void 0&&(n=new Set,a.set(t,n));n.has(l)||(is=!0,n.add(l),e=wv.bind(null,e,t,l),t.then(e,e))}function wv(e,t,l){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,Me===e&&(ve&l)===l&&(Ge===4||Ge===3&&(ve&62914560)===ve&&300>yt()-Zu?(Ne&2)===0&&wa(e,0):cs|=l,Ha===ve&&(Ha=0)),Jt(e)}function jd(e,t){t===0&&(t=yf()),e=Zl(e,t),e!==null&&(Fa(e,t),Jt(e))}function Bv(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),jd(e,l)}function Lv(e,t){var l=0;switch(e.tag){case 31:case 13:var a=e.stateNode,n=e.memoizedState;n!==null&&(l=n.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(r(314))}a!==null&&a.delete(t),jd(e,l)}function Yv(e,t){return Ri(e,t)}var Fu=null,La=null,vs=!1,Iu=!1,ys=!1,Dl=0;function Jt(e){e!==La&&e.next===null&&(La===null?Fu=La=e:La=La.next=e),Iu=!0,vs||(vs=!0,Qv())}function Dn(e,t){if(!ys&&Iu){ys=!0;do for(var l=!1,a=Fu;a!==null;){if(e!==0){var n=a.pendingLanes;if(n===0)var u=0;else{var s=a.suspendedLanes,d=a.pingedLanes;u=(1<<31-gt(42|e)+1)-1,u&=n&~(s&~d),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(l=!0,Rd(a,u))}else u=ve,u=lu(a,a===Me?u:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(u&3)===0||Wa(a,u)||(l=!0,Rd(a,u));a=a.next}while(l);ys=!1}}function Gv(){Nd()}function Nd(){Iu=vs=!1;var e=0;Dl!==0&&Iv()&&(e=Dl);for(var t=yt(),l=null,a=Fu;a!==null;){var n=a.next,u=Ed(a,t);u===0?(a.next=null,l===null?Fu=n:l.next=n,n===null&&(La=l)):(l=a,(e!==0||(u&3)!==0)&&(Iu=!0)),a=n}We!==0&&We!==5||Dn(e),Dl!==0&&(Dl=0)}function Ed(e,t){for(var l=e.suspendedLanes,a=e.pingedLanes,n=e.expirationTimes,u=e.pendingLanes&-62914561;0d)break;var C=v.transferSize,U=v.initiatorType;C&&Hd(U)&&(v=v.responseEnd,s+=C*(v"u"?null:document;function Jd(e,t,l){var a=Ya;if(a&&typeof t=="string"&&t){var n=At(t);n='link[rel="'+e+'"][href="'+n+'"]',typeof l=="string"&&(n+='[crossorigin="'+l+'"]'),Kd.has(n)||(Kd.add(n),e={rel:e,crossOrigin:l,href:t},a.querySelector(n)===null&&(t=a.createElement("link"),nt(t,"link",e),Fe(t),a.head.appendChild(t)))}}function cy(e){dl.D(e),Jd("dns-prefetch",e,null)}function sy(e,t){dl.C(e,t),Jd("preconnect",e,t)}function fy(e,t,l){dl.L(e,t,l);var a=Ya;if(a&&e&&t){var n='link[rel="preload"][as="'+At(t)+'"]';t==="image"&&l&&l.imageSrcSet?(n+='[imagesrcset="'+At(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(n+='[imagesizes="'+At(l.imageSizes)+'"]')):n+='[href="'+At(e)+'"]';var u=n;switch(t){case"style":u=Ga(e);break;case"script":u=Qa(e)}qt.has(u)||(e=N({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),qt.set(u,e),a.querySelector(n)!==null||t==="style"&&a.querySelector(qn(u))||t==="script"&&a.querySelector(wn(u))||(t=a.createElement("link"),nt(t,"link",e),Fe(t),a.head.appendChild(t)))}}function ry(e,t){dl.m(e,t);var l=Ya;if(l&&e){var a=t&&typeof t.as=="string"?t.as:"script",n='link[rel="modulepreload"][as="'+At(a)+'"][href="'+At(e)+'"]',u=n;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=Qa(e)}if(!qt.has(u)&&(e=N({rel:"modulepreload",href:e},t),qt.set(u,e),l.querySelector(n)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(wn(u)))return}a=l.createElement("link"),nt(a,"link",e),Fe(a),l.head.appendChild(a)}}}function oy(e,t,l){dl.S(e,t,l);var a=Ya;if(a&&e){var n=fa(a).hoistableStyles,u=Ga(e);t=t||"default";var s=n.get(u);if(!s){var d={loading:0,preload:null};if(s=a.querySelector(qn(u)))d.loading=5;else{e=N({rel:"stylesheet",href:e,"data-precedence":t},l),(l=qt.get(u))&&Ds(e,l);var v=s=a.createElement("link");Fe(v),nt(v,"link",e),v._p=new Promise(function(E,C){v.onload=E,v.onerror=C}),v.addEventListener("load",function(){d.loading|=1}),v.addEventListener("error",function(){d.loading|=2}),d.loading|=4,ai(s,t,a)}s={type:"stylesheet",instance:s,count:1,state:d},n.set(u,s)}}}function dy(e,t){dl.X(e,t);var l=Ya;if(l&&e){var a=fa(l).hoistableScripts,n=Qa(e),u=a.get(n);u||(u=l.querySelector(wn(n)),u||(e=N({src:e,async:!0},t),(t=qt.get(n))&&Ms(e,t),u=l.createElement("script"),Fe(u),nt(u,"link",e),l.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(n,u))}}function my(e,t){dl.M(e,t);var l=Ya;if(l&&e){var a=fa(l).hoistableScripts,n=Qa(e),u=a.get(n);u||(u=l.querySelector(wn(n)),u||(e=N({src:e,async:!0,type:"module"},t),(t=qt.get(n))&&Ms(e,t),u=l.createElement("script"),Fe(u),nt(u,"link",e),l.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(n,u))}}function kd(e,t,l,a){var n=(n=ue.current)?li(n):null;if(!n)throw Error(r(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(t=Ga(l.href),l=fa(n).hoistableStyles,a=l.get(t),a||(a={type:"style",instance:null,count:0,state:null},l.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=Ga(l.href);var u=fa(n).hoistableStyles,s=u.get(e);if(s||(n=n.ownerDocument||n,s={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,s),(u=n.querySelector(qn(e)))&&!u._p&&(s.instance=u,s.state.loading=5),qt.has(e)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},qt.set(e,l),u||hy(n,e,l,s.state))),t&&a===null)throw Error(r(528,""));return s}if(t&&a!==null)throw Error(r(529,""));return null;case"script":return t=l.async,l=l.src,typeof l=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Qa(l),l=fa(n).hoistableScripts,a=l.get(t),a||(a={type:"script",instance:null,count:0,state:null},l.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,e))}}function Ga(e){return'href="'+At(e)+'"'}function qn(e){return'link[rel="stylesheet"]['+e+"]"}function $d(e){return N({},e,{"data-precedence":e.precedence,precedence:null})}function hy(e,t,l,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),nt(t,"link",l),Fe(t),e.head.appendChild(t))}function Qa(e){return'[src="'+At(e)+'"]'}function wn(e){return"script[async]"+e}function Wd(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+At(l.href)+'"]');if(a)return t.instance=a,Fe(a),a;var n=N({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),Fe(a),nt(a,"style",n),ai(a,l.precedence,e),t.instance=a;case"stylesheet":n=Ga(l.href);var u=e.querySelector(qn(n));if(u)return t.state.loading|=4,t.instance=u,Fe(u),u;a=$d(l),(n=qt.get(n))&&Ds(a,n),u=(e.ownerDocument||e).createElement("link"),Fe(u);var s=u;return s._p=new Promise(function(d,v){s.onload=d,s.onerror=v}),nt(u,"link",a),t.state.loading|=4,ai(u,l.precedence,e),t.instance=u;case"script":return u=Qa(l.src),(n=e.querySelector(wn(u)))?(t.instance=n,Fe(n),n):(a=l,(n=qt.get(u))&&(a=N({},l),Ms(a,n)),e=e.ownerDocument||e,n=e.createElement("script"),Fe(n),nt(n,"link",a),e.head.appendChild(n),t.instance=n);case"void":return null;default:throw Error(r(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,ai(a,l.precedence,e));return t.instance}function ai(e,t,l){for(var a=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),n=a.length?a[a.length-1]:null,u=n,s=0;s title"):null)}function vy(e,t,l){if(l===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Pd(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function yy(e,t,l,a){if(l.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var n=Ga(a.href),u=t.querySelector(qn(n));if(u){t=u._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=ui.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=u,Fe(u);return}u=t.ownerDocument||t,a=$d(a),(n=qt.get(n))&&Ds(a,n),u=u.createElement("link"),Fe(u);var s=u;s._p=new Promise(function(d,v){s.onload=d,s.onerror=v}),nt(u,"link",a),l.instance=u}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,t),(t=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=ui.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var Us=0;function py(e,t){return e.stylesheets&&e.count===0&&ci(e,e.stylesheets),0Us?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(n)}}:null}function ui(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ci(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ii=null;function ci(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ii=new Map,t.forEach(gy,e),ii=null,ui.call(e))}function gy(e,t){if(!(t.state.loading&4)){var l=ii.get(e);if(l)var a=l.get(null);else{l=new Map,ii.set(e,l);for(var n=e.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(f){console.error(f)}}return i(),Xs.exports=Uy(),Xs.exports}var qy=Hy();var jm="popstate";function Nm(i){return typeof i=="object"&&i!=null&&"pathname"in i&&"search"in i&&"hash"in i&&"state"in i&&"key"in i}function wy(i={}){function f(m,h){let{pathname:_="/",search:R="",hash:S=""}=ua(m.location.hash.substring(1));return!_.startsWith("/")&&!_.startsWith(".")&&(_="/"+_),Is("",{pathname:_,search:R,hash:S},h.state&&h.state.usr||null,h.state&&h.state.key||"default")}function o(m,h){let _=m.document.querySelector("base"),R="";if(_&&_.getAttribute("href")){let S=m.location.href,y=S.indexOf("#");R=y===-1?S:S.slice(0,y)}return R+"#"+(typeof h=="string"?h:kn(h))}function r(m,h){Bt(m.pathname.charAt(0)==="/",`relative pathnames are not supported in hash history.push(${JSON.stringify(h)})`)}return Ly(f,o,r,i)}function Le(i,f){if(i===!1||i===null||typeof i>"u")throw new Error(f)}function Bt(i,f){if(!i){typeof console<"u"&&console.warn(f);try{throw new Error(f)}catch{}}}function By(){return Math.random().toString(36).substring(2,10)}function Em(i,f){return{usr:i.state,key:i.key,idx:f,masked:i.unstable_mask?{pathname:i.pathname,search:i.search,hash:i.hash}:void 0}}function Is(i,f,o=null,r,m){return{pathname:typeof i=="string"?i:i.pathname,search:"",hash:"",...typeof f=="string"?ua(f):f,state:o,key:f&&f.key||r||By(),unstable_mask:m}}function kn({pathname:i="/",search:f="",hash:o=""}){return f&&f!=="?"&&(i+=f.charAt(0)==="?"?f:"?"+f),o&&o!=="#"&&(i+=o.charAt(0)==="#"?o:"#"+o),i}function ua(i){let f={};if(i){let o=i.indexOf("#");o>=0&&(f.hash=i.substring(o),i=i.substring(0,o));let r=i.indexOf("?");r>=0&&(f.search=i.substring(r),i=i.substring(0,r)),i&&(f.pathname=i)}return f}function Ly(i,f,o,r={}){let{window:m=document.defaultView,v5Compat:h=!1}=r,_=m.history,R="POP",S=null,y=z();y==null&&(y=0,_.replaceState({..._.state,idx:y},""));function z(){return(_.state||{idx:null}).idx}function N(){R="POP";let B=z(),Z=B==null?null:B-y;y=B,S&&S({action:R,location:Q.location,delta:Z})}function L(B,Z){R="PUSH";let F=Nm(B)?B:Is(Q.location,B,Z);o&&o(F,B),y=z()+1;let $=Em(F,y),G=Q.createHref(F.unstable_mask||F);try{_.pushState($,"",G)}catch(ne){if(ne instanceof DOMException&&ne.name==="DataCloneError")throw ne;m.location.assign(G)}h&&S&&S({action:R,location:Q.location,delta:1})}function w(B,Z){R="REPLACE";let F=Nm(B)?B:Is(Q.location,B,Z);o&&o(F,B),y=z();let $=Em(F,y),G=Q.createHref(F.unstable_mask||F);_.replaceState($,"",G),h&&S&&S({action:R,location:Q.location,delta:0})}function V(B){return Yy(B)}let Q={get action(){return R},get location(){return i(m,_)},listen(B){if(S)throw new Error("A history only accepts one active listener");return m.addEventListener(jm,N),S=B,()=>{m.removeEventListener(jm,N),S=null}},createHref(B){return f(m,B)},createURL:V,encodeLocation(B){let Z=V(B);return{pathname:Z.pathname,search:Z.search,hash:Z.hash}},push:L,replace:w,go(B){return _.go(B)}};return Q}function Yy(i,f=!1){let o="http://localhost";typeof window<"u"&&(o=window.location.origin!=="null"?window.location.origin:window.location.href),Le(o,"No window.location.(origin|href) available to create URL");let r=typeof i=="string"?i:kn(i);return r=r.replace(/ $/,"%20"),!f&&r.startsWith("//")&&(r=o+r),new URL(r,o)}function Um(i,f,o="/"){return Gy(i,f,o,!1)}function Gy(i,f,o,r){let m=typeof f=="string"?ua(f):f,h=ml(m.pathname||"/",o);if(h==null)return null;let _=Hm(i);Qy(_);let R=null;for(let S=0;R==null&&S<_.length;++S){let y=Py(h);R=Fy(_[S],y,r)}return R}function Hm(i,f=[],o=[],r="",m=!1){let h=(_,R,S=m,y)=>{let z={relativePath:y===void 0?_.path||"":y,caseSensitive:_.caseSensitive===!0,childrenIndex:R,route:_};if(z.relativePath.startsWith("/")){if(!z.relativePath.startsWith(r)&&S)return;Le(z.relativePath.startsWith(r),`Absolute route path "${z.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),z.relativePath=z.relativePath.slice(r.length)}let N=Qt([r,z.relativePath]),L=o.concat(z);_.children&&_.children.length>0&&(Le(_.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${N}".`),Hm(_.children,f,L,N,S)),!(_.path==null&&!_.index)&&f.push({path:N,score:$y(N,_.index),routesMeta:L})};return i.forEach((_,R)=>{if(_.path===""||!_.path?.includes("?"))h(_,R);else for(let S of qm(_.path))h(_,R,!0,S)}),f}function qm(i){let f=i.split("/");if(f.length===0)return[];let[o,...r]=f,m=o.endsWith("?"),h=o.replace(/\?$/,"");if(r.length===0)return m?[h,""]:[h];let _=qm(r.join("/")),R=[];return R.push(..._.map(S=>S===""?h:[h,S].join("/"))),m&&R.push(..._),R.map(S=>i.startsWith("/")&&S===""?"/":S)}function Qy(i){i.sort((f,o)=>f.score!==o.score?o.score-f.score:Wy(f.routesMeta.map(r=>r.childrenIndex),o.routesMeta.map(r=>r.childrenIndex)))}var Xy=/^:[\w-]+$/,Zy=3,Vy=2,Ky=1,Jy=10,ky=-2,Tm=i=>i==="*";function $y(i,f){let o=i.split("/"),r=o.length;return o.some(Tm)&&(r+=ky),f&&(r+=Vy),o.filter(m=>!Tm(m)).reduce((m,h)=>m+(Xy.test(h)?Zy:h===""?Ky:Jy),r)}function Wy(i,f){return i.length===f.length&&i.slice(0,-1).every((r,m)=>r===f[m])?i[i.length-1]-f[f.length-1]:0}function Fy(i,f,o=!1){let{routesMeta:r}=i,m={},h="/",_=[];for(let R=0;R{if(z==="*"){let V=R[L]||"";_=h.slice(0,h.length-V.length).replace(/(.)\/+$/,"$1")}const w=R[L];return N&&!w?y[z]=void 0:y[z]=(w||"").replace(/%2F/g,"/"),y},{}),pathname:h,pathnameBase:_,pattern:i}}function Iy(i,f=!1,o=!0){Bt(i==="*"||!i.endsWith("*")||i.endsWith("/*"),`Route path "${i}" will be treated as if it were "${i.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${i.replace(/\*$/,"/*")}".`);let r=[],m="^"+i.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(_,R,S,y,z)=>{if(r.push({paramName:R,isOptional:S!=null}),S){let N=z.charAt(y+_.length);return N&&N!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return i.endsWith("*")?(r.push({paramName:"*"}),m+=i==="*"||i==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):o?m+="\\/*$":i!==""&&i!=="/"&&(m+="(?:(?=\\/|$))"),[new RegExp(m,f?void 0:"i"),r]}function Py(i){try{return i.split("/").map(f=>decodeURIComponent(f).replace(/\//g,"%2F")).join("/")}catch(f){return Bt(!1,`The URL path "${i}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${f}).`),i}}function ml(i,f){if(f==="/")return i;if(!i.toLowerCase().startsWith(f.toLowerCase()))return null;let o=f.endsWith("/")?f.length-1:f.length,r=i.charAt(o);return r&&r!=="/"?null:i.slice(o)||"/"}var ep=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function tp(i,f="/"){let{pathname:o,search:r="",hash:m=""}=typeof i=="string"?ua(i):i,h;return o?(o=wm(o),o.startsWith("/")?h=Rm(o.substring(1),"/"):h=Rm(o,f)):h=f,{pathname:h,search:np(r),hash:up(m)}}function Rm(i,f){let o=xi(f).split("/");return i.split("/").forEach(m=>{m===".."?o.length>1&&o.pop():m!=="."&&o.push(m)}),o.length>1?o.join("/"):"/"}function Js(i,f,o,r){return`Cannot include a '${i}' character in a manually specified \`to.${f}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${o}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function lp(i){return i.filter((f,o)=>o===0||f.route.path&&f.route.path.length>0)}function lf(i){let f=lp(i);return f.map((o,r)=>r===f.length-1?o.pathname:o.pathnameBase)}function ji(i,f,o,r=!1){let m;typeof i=="string"?m=ua(i):(m={...i},Le(!m.pathname||!m.pathname.includes("?"),Js("?","pathname","search",m)),Le(!m.pathname||!m.pathname.includes("#"),Js("#","pathname","hash",m)),Le(!m.search||!m.search.includes("#"),Js("#","search","hash",m)));let h=i===""||m.pathname==="",_=h?"/":m.pathname,R;if(_==null)R=o;else{let N=f.length-1;if(!r&&_.startsWith("..")){let L=_.split("/");for(;L[0]==="..";)L.shift(),N-=1;m.pathname=L.join("/")}R=N>=0?f[N]:"/"}let S=tp(m,R),y=_&&_!=="/"&&_.endsWith("/"),z=(h||_===".")&&o.endsWith("/");return!S.pathname.endsWith("/")&&(y||z)&&(S.pathname+="/"),S}var wm=i=>i.replace(/\/\/+/g,"/"),Qt=i=>wm(i.join("/")),xi=i=>i.replace(/\/+$/,""),ap=i=>xi(i).replace(/^\/*/,"/"),np=i=>!i||i==="?"?"":i.startsWith("?")?i:"?"+i,up=i=>!i||i==="#"?"":i.startsWith("#")?i:"#"+i,ip=class{constructor(i,f,o,r=!1){this.status=i,this.statusText=f||"",this.internal=r,o instanceof Error?(this.data=o.toString(),this.error=o):this.data=o}};function cp(i){return i!=null&&typeof i.status=="number"&&typeof i.statusText=="string"&&typeof i.internal=="boolean"&&"data"in i}function sp(i){let f=i.map(o=>o.route.path).filter(Boolean);return Qt(f)||"/"}var Bm=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Lm(i,f){let o=i;if(typeof o!="string"||!ep.test(o))return{absoluteURL:void 0,isExternal:!1,to:o};let r=o,m=!1;if(Bm)try{let h=new URL(window.location.href),_=o.startsWith("//")?new URL(h.protocol+o):new URL(o),R=ml(_.pathname,f);_.origin===h.origin&&R!=null?o=R+_.search+_.hash:m=!0}catch{Bt(!1,` contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:m,to:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Ym=["POST","PUT","PATCH","DELETE"];new Set(Ym);var fp=["GET",...Ym];new Set(fp);var Ja=p.createContext(null);Ja.displayName="DataRouter";var Ni=p.createContext(null);Ni.displayName="DataRouterState";var Gm=p.createContext(!1);function rp(){return p.useContext(Gm)}var Qm=p.createContext({isTransitioning:!1});Qm.displayName="ViewTransition";var op=p.createContext(new Map);op.displayName="Fetchers";var dp=p.createContext(null);dp.displayName="Await";var Tt=p.createContext(null);Tt.displayName="Navigation";var $n=p.createContext(null);$n.displayName="Location";var Xt=p.createContext({outlet:null,matches:[],isDataRoute:!1});Xt.displayName="Route";var af=p.createContext(null);af.displayName="RouteError";var Xm="REACT_ROUTER_ERROR",mp="REDIRECT",hp="ROUTE_ERROR_RESPONSE";function vp(i){if(i.startsWith(`${Xm}:${mp}:{`))try{let f=JSON.parse(i.slice(28));if(typeof f=="object"&&f&&typeof f.status=="number"&&typeof f.statusText=="string"&&typeof f.location=="string"&&typeof f.reloadDocument=="boolean"&&typeof f.replace=="boolean")return f}catch{}}function yp(i){if(i.startsWith(`${Xm}:${hp}:{`))try{let f=JSON.parse(i.slice(40));if(typeof f=="object"&&f&&typeof f.status=="number"&&typeof f.statusText=="string")return new ip(f.status,f.statusText,f.data)}catch{}}function pp(i,{relative:f}={}){Le(ka(),"useHref() may be used only in the context of a component.");let{basename:o,navigator:r}=p.useContext(Tt),{hash:m,pathname:h,search:_}=Wn(i,{relative:f}),R=h;return o!=="/"&&(R=h==="/"?o:Qt([o,h])),r.createHref({pathname:R,search:_,hash:m})}function ka(){return p.useContext($n)!=null}function kt(){return Le(ka(),"useLocation() may be used only in the context of a component."),p.useContext($n).location}var Zm="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Vm(i){p.useContext(Tt).static||p.useLayoutEffect(i)}function Km(){let{isDataRoute:i}=p.useContext(Xt);return i?Dp():gp()}function gp(){Le(ka(),"useNavigate() may be used only in the context of a component.");let i=p.useContext(Ja),{basename:f,navigator:o}=p.useContext(Tt),{matches:r}=p.useContext(Xt),{pathname:m}=kt(),h=JSON.stringify(lf(r)),_=p.useRef(!1);return Vm(()=>{_.current=!0}),p.useCallback((S,y={})=>{if(Bt(_.current,Zm),!_.current)return;if(typeof S=="number"){o.go(S);return}let z=ji(S,JSON.parse(h),m,y.relative==="path");i==null&&f!=="/"&&(z.pathname=z.pathname==="/"?f:Qt([f,z.pathname])),(y.replace?o.replace:o.push)(z,y.state,y)},[f,o,h,m,i])}var bp=p.createContext(null);function _p(i){let f=p.useContext(Xt).outlet;return p.useMemo(()=>f&&p.createElement(bp.Provider,{value:i},f),[f,i])}function Wn(i,{relative:f}={}){let{matches:o}=p.useContext(Xt),{pathname:r}=kt(),m=JSON.stringify(lf(o));return p.useMemo(()=>ji(i,JSON.parse(m),r,f==="path"),[i,m,r,f])}function Sp(i,f){return Jm(i,f)}function Jm(i,f,o){Le(ka(),"useRoutes() may be used only in the context of a component.");let{navigator:r}=p.useContext(Tt),{matches:m}=p.useContext(Xt),h=m[m.length-1],_=h?h.params:{},R=h?h.pathname:"/",S=h?h.pathnameBase:"/",y=h&&h.route;{let B=y&&y.path||"";$m(R,!y||B.endsWith("*")||B.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${R}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. -Please change the parent to .`)}let z=kt(),E;if(r){let w=typeof r=="string"?ua(r):r;Le(S==="/"||w.pathname?.startsWith(S),`When overriding the location using \`\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${S}" but pathname "${w.pathname}" was given in the \`location\` prop.`),E=w}else E=z;let L=E.pathname||"/",B=L;if(S!=="/"){let w=S.replace(/^\//,"").split("/");B="/"+L.replace(/^\//,"").split("/").slice(w.length).join("/")}let V=Um(i,{pathname:B});Bt(y||V!=null,`No routes matched location "${E.pathname}${E.search}${E.hash}" `),Bt(V==null||V[V.length-1].route.element!==void 0||V[V.length-1].route.Component!==void 0||V[V.length-1].route.lazy!==void 0,`Matched leaf route at location "${E.pathname}${E.search}${E.hash}" does not have an element or Component. This means it will render an with a null value by default resulting in an "empty" page.`);let Q=Tp(V&&V.map(w=>Object.assign({},w,{params:Object.assign({},_,w.params),pathname:Qt([S,f.encodeLocation?f.encodeLocation(w.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?S:Qt([S,f.encodeLocation?f.encodeLocation(w.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathnameBase])})),m,o);return r&&Q?p.createElement($n.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...E},navigationType:"POP"}},Q):Q}function xp(){let i=Cp(),r=cp(i)?`${i.status} ${i.statusText}`:i instanceof Error?i.message:JSON.stringify(i),o=i instanceof Error?i.stack:null,f="rgba(200,200,200, 0.5)",m={padding:"0.5rem",backgroundColor:f},h={padding:"2px 4px",backgroundColor:f},_=null;return console.error("Error handled by React Router default ErrorBoundary:",i),_=p.createElement(p.Fragment,null,p.createElement("p",null,"💿 Hey developer 👋"),p.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",p.createElement("code",{style:h},"ErrorBoundary")," or"," ",p.createElement("code",{style:h},"errorElement")," prop on your route.")),p.createElement(p.Fragment,null,p.createElement("h2",null,"Unexpected Application Error!"),p.createElement("h3",{style:{fontStyle:"italic"}},r),o?p.createElement("pre",{style:m},o):null,_)}var jp=p.createElement(xp,null),km=class extends p.Component{constructor(i){super(i),this.state={location:i.location,revalidation:i.revalidation,error:i.error}}static getDerivedStateFromError(i){return{error:i}}static getDerivedStateFromProps(i,r){return r.location!==i.location||r.revalidation!=="idle"&&i.revalidation==="idle"?{error:i.error,location:i.location,revalidation:i.revalidation}:{error:i.error!==void 0?i.error:r.error,location:r.location,revalidation:i.revalidation||r.revalidation}}componentDidCatch(i,r){this.props.onError?this.props.onError(i,r):console.error("React Router caught the following error during render",i)}render(){let i=this.state.error;if(this.context&&typeof i=="object"&&i&&"digest"in i&&typeof i.digest=="string"){const o=yp(i.digest);o&&(i=o)}let r=i!==void 0?p.createElement(Xt.Provider,{value:this.props.routeContext},p.createElement(af.Provider,{value:i,children:this.props.component})):this.props.children;return this.context?p.createElement(Np,{error:i},r):r}};km.contextType=Gm;var ks=new WeakMap;function Np({children:i,error:r}){let{basename:o}=p.useContext(Tt);if(typeof r=="object"&&r&&"digest"in r&&typeof r.digest=="string"){let f=vp(r.digest);if(f){let m=ks.get(r);if(m)throw m;let h=Lm(f.location,o);if(Bm&&!ks.get(r))if(h.isExternal||f.reloadDocument)window.location.href=h.absoluteURL||h.to;else{const _=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(h.to,{replace:f.replace}));throw ks.set(r,_),_}return p.createElement("meta",{httpEquiv:"refresh",content:`0;url=${h.absoluteURL||h.to}`})}}return i}function Ep({routeContext:i,match:r,children:o}){let f=p.useContext(Ja);return f&&f.static&&f.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(f.staticContext._deepestRenderedBoundaryId=r.route.id),p.createElement(Xt.Provider,{value:i},o)}function Tp(i,r=[],o){let f=o?.state;if(i==null){if(!f)return null;if(f.errors)i=f.matches;else if(r.length===0&&!f.initialized&&f.matches.length>0)i=f.matches;else return null}let m=i,h=f?.errors;if(h!=null){let z=m.findIndex(E=>E.route.id&&h?.[E.route.id]!==void 0);Le(z>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(h).join(",")}`),m=m.slice(0,Math.min(m.length,z+1))}let _=!1,R=-1;if(o&&f){_=f.renderFallback;for(let z=0;z=0?m=m.slice(0,R+1):m=[m[0]];break}}}}let S=o?.onError,y=f&&S?(z,E)=>{S(z,{location:f.location,params:f.matches?.[0]?.params??{},unstable_pattern:sp(f.matches),errorInfo:E})}:void 0;return m.reduceRight((z,E,L)=>{let B,V=!1,Q=null,w=null;f&&(B=h&&E.route.id?h[E.route.id]:void 0,Q=E.route.errorElement||jp,_&&(R<0&&L===0?($m("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),V=!0,w=null):R===L&&(V=!0,w=E.route.hydrateFallbackElement||null)));let Z=r.concat(m.slice(0,L+1)),F=()=>{let $;return B?$=Q:V?$=w:E.route.Component?$=p.createElement(E.route.Component,null):E.route.element?$=E.route.element:$=z,p.createElement(Ep,{match:E,routeContext:{outlet:z,matches:Z,isDataRoute:f!=null},children:$})};return f&&(E.route.ErrorBoundary||E.route.errorElement||L===0)?p.createElement(km,{location:f.location,revalidation:f.revalidation,component:Q,error:B,children:F(),routeContext:{outlet:null,matches:Z,isDataRoute:!0},onError:y}):F()},null)}function nf(i){return`${i} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Rp(i){let r=p.useContext(Ja);return Le(r,nf(i)),r}function Ap(i){let r=p.useContext(Ni);return Le(r,nf(i)),r}function zp(i){let r=p.useContext(Xt);return Le(r,nf(i)),r}function uf(i){let r=zp(i),o=r.matches[r.matches.length-1];return Le(o.route.id,`${i} can only be used on routes that contain a unique "id"`),o.route.id}function Op(){return uf("useRouteId")}function Cp(){let i=p.useContext(af),r=Ap("useRouteError"),o=uf("useRouteError");return i!==void 0?i:r.errors?.[o]}function Dp(){let{router:i}=Rp("useNavigate"),r=uf("useNavigate"),o=p.useRef(!1);return Vm(()=>{o.current=!0}),p.useCallback(async(m,h={})=>{Bt(o.current,Zm),o.current&&(typeof m=="number"?await i.navigate(m):await i.navigate(m,{fromRouteId:r,...h}))},[i,r])}var Am={};function $m(i,r,o){!r&&!Am[i]&&(Am[i]=!0,Bt(!1,o))}p.memo(Mp);function Mp({routes:i,future:r,state:o,isStatic:f,onError:m}){return Jm(i,void 0,{state:o,isStatic:f,onError:m})}function Up({to:i,replace:r,state:o,relative:f}){Le(ka()," may be used only in the context of a component.");let{static:m}=p.useContext(Tt);Bt(!m," must not be used on the initial render in a . This is a no-op, but you should modify your code so the is only ever rendered in response to some user interaction or state change.");let{matches:h}=p.useContext(Xt),{pathname:_}=kt(),R=Km(),S=ji(i,lf(h),_,f==="path"),y=JSON.stringify(S);return p.useEffect(()=>{R(JSON.parse(y),{replace:r,state:o,relative:f})},[R,y,f,r,o]),null}function Hp(i){return _p(i.context)}function na(i){Le(!1,"A is only ever to be used as the child of element, never rendered directly. Please wrap your in a .")}function qp({basename:i="/",children:r=null,location:o,navigationType:f="POP",navigator:m,static:h=!1,unstable_useTransitions:_}){Le(!ka(),"You cannot render a inside another . You should never have more than one in your app.");let R=i.replace(/^\/*/,"/"),S=p.useMemo(()=>({basename:R,navigator:m,static:h,unstable_useTransitions:_,future:{}}),[R,m,h,_]);typeof o=="string"&&(o=ua(o));let{pathname:y="/",search:z="",hash:E="",state:L=null,key:B="default",unstable_mask:V}=o,Q=p.useMemo(()=>{let w=ml(y,R);return w==null?null:{location:{pathname:w,search:z,hash:E,state:L,key:B,unstable_mask:V},navigationType:f}},[R,y,z,E,L,B,f,V]);return Bt(Q!=null,` is not able to match the URL "${y}${z}${E}" because it does not start with the basename, so the won't render anything.`),Q==null?null:p.createElement(Tt.Provider,{value:S},p.createElement($n.Provider,{children:r,value:Q}))}function wp({children:i,location:r}){return Sp(Ps(i),r)}function Ps(i,r=[]){let o=[];return p.Children.forEach(i,(f,m)=>{if(!p.isValidElement(f))return;let h=[...r,m];if(f.type===p.Fragment){o.push.apply(o,Ps(f.props.children,h));return}Le(f.type===na,`[${typeof f.type=="string"?f.type:f.type.name}] is not a component. All component children of must be a or `),Le(!f.props.index||!f.props.children,"An index route cannot have child routes.");let _={id:f.props.id||h.join("-"),caseSensitive:f.props.caseSensitive,element:f.props.element,Component:f.props.Component,index:f.props.index,path:f.props.path,middleware:f.props.middleware,loader:f.props.loader,action:f.props.action,hydrateFallbackElement:f.props.hydrateFallbackElement,HydrateFallback:f.props.HydrateFallback,errorElement:f.props.errorElement,ErrorBoundary:f.props.ErrorBoundary,hasErrorBoundary:f.props.hasErrorBoundary===!0||f.props.ErrorBoundary!=null||f.props.errorElement!=null,shouldRevalidate:f.props.shouldRevalidate,handle:f.props.handle,lazy:f.props.lazy};f.props.children&&(_.children=Ps(f.props.children,h)),o.push(_)}),o}var gi="get",bi="application/x-www-form-urlencoded";function Ei(i){return typeof HTMLElement<"u"&&i instanceof HTMLElement}function Bp(i){return Ei(i)&&i.tagName.toLowerCase()==="button"}function Lp(i){return Ei(i)&&i.tagName.toLowerCase()==="form"}function Yp(i){return Ei(i)&&i.tagName.toLowerCase()==="input"}function Gp(i){return!!(i.metaKey||i.altKey||i.ctrlKey||i.shiftKey)}function Qp(i,r){return i.button===0&&(!r||r==="_self")&&!Gp(i)}var vi=null;function Xp(){if(vi===null)try{new FormData(document.createElement("form"),0),vi=!1}catch{vi=!0}return vi}var Zp=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function $s(i){return i!=null&&!Zp.has(i)?(Bt(!1,`"${i}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${bi}"`),null):i}function Vp(i,r){let o,f,m,h,_;if(Lp(i)){let R=i.getAttribute("action");f=R?ml(R,r):null,o=i.getAttribute("method")||gi,m=$s(i.getAttribute("enctype"))||bi,h=new FormData(i)}else if(Bp(i)||Yp(i)&&(i.type==="submit"||i.type==="image")){let R=i.form;if(R==null)throw new Error('Cannot submit a