diff --git a/.dockerignore b/.dockerignore index fecc5f77e23a59af0967d862208a8cce7f2502da..c6932c7e18a01f3df30e923f90a14e8188a71098 100644 --- a/.dockerignore +++ b/.dockerignore @@ -13,6 +13,16 @@ develop-eggs/ dist/* !dist/docker-input/ !dist/docker-input/*.tar.gz +# 内嵌 agy2api 的预编译前端资源需要进入镜像 +!agy2api/dist/ +!agy2api/dist/** +# 本地开发产物不进入镜像 +agy2api/.venv/ +agy2api/creds/ +agy2api/data/ +agy2api/frontend/node_modules/ +agy2api/**/__pycache__/ +agy2api/**/*.py[cod] downloads/ eggs/ .eggs/ diff --git a/.env.example b/.env.example index 840a81e1609221dc6627c1ce9d6c7e62b8c7c15d..ef6926527296d5851886976b7e8c75df97b1e6b3 100644 --- a/.env.example +++ b/.env.example @@ -18,3 +18,8 @@ DS2API_CONFIG_PATH=/app/config.json # Optional: static admin assets path # DS2API_STATIC_ADMIN_DIR=/app/static/admin + +# Embedded agy2api sidecar (Gemini / Antigravity) +# AGY2API_BASE_URL=http://127.0.0.1:7861 +# AGY2API_API_PASSWORD=change-me +# AGY2API_PANEL_PASSWORD=change-me diff --git a/.github/workflows/sync-to-hf.yml b/.github/workflows/sync-to-hf.yml index 10b738b59a382382d975878ee252623296369a59..8b26f4ac21505312827c3e725f8837dd3a21b43e 100644 --- a/.github/workflows/sync-to-hf.yml +++ b/.github/workflows/sync-to-hf.yml @@ -3,6 +3,7 @@ name: Sync to Hugging Face on: push: branches: [main] + workflow_dispatch: jobs: sync-to-hf: diff --git a/.gitignore b/.gitignore index 8c8a61759444e58103bc8f6fd3b4da74fc2ec41c..166462c9429afbf077de6fa32aa76688587d0a0b 100644 --- a/.gitignore +++ b/.gitignore @@ -35,6 +35,9 @@ pnpm-lock.yaml # Build artifacts dist/ +# 内嵌 agy2api 的预编译前端资源必须入库 +!agy2api/dist/ +!agy2api/dist/** *.tsbuildinfo .cache/ .parcel-cache/ diff --git a/API.en.md b/API.en.md index c14962fe80dac0eb00c8f89ccb1c9ec2d0605d7f..778d0503e82abf84c479b8da36726ad8b7549725 100644 --- a/API.en.md +++ b/API.en.md @@ -123,10 +123,14 @@ Gemini-compatible clients can also send `x-goog-api-key`, `?key=`, or `?api_key= | POST | `/messages` | Business | Claude shortcut path | | POST | `/v1/messages/count_tokens` | Business | Claude token counting shortcut | | POST | `/messages/count_tokens` | Business | Claude token counting shortcut | +| GET | `/v1beta/models` | None | Gemini model list (static catalog + agy2api live discovery) | +| GET | `/v1beta/models/{model}` | None | Gemini single-model lookup | | POST | `/v1beta/models/{model}:generateContent` | Business | Gemini non-stream | | POST | `/v1beta/models/{model}:streamGenerateContent` | Business | Gemini stream | | POST | `/v1/models/{model}:generateContent` | Business | Gemini non-stream compat path | | POST | `/v1/models/{model}:streamGenerateContent` | Business | Gemini stream compat path | +| GET | `/agy/` | AGY panel password | Embedded agy2api panel (Antigravity OAuth / credentials) | +| ANY | `/agy/*` | AGY panel password / API password | agy2api native OpenAI / Gemini / Claude endpoints | | GET | `/api/version` | None | Ollama version endpoint | | GET | `/api/tags` | None | Ollama model list | | POST | `/api/show` | None | Ollama model capability query (returns `id` + `capabilities`) | @@ -204,7 +208,7 @@ Server-side records are essentially an archive of DeepSeek upstream responses: O ### `GET /v1/models` -No auth required. Returns the currently supported DeepSeek native model list. +No auth required. Returns the currently supported DeepSeek native models plus the embedded agy2api Gemini models. **Response**: @@ -215,11 +219,17 @@ No auth required. Returns the currently supported DeepSeek native model list. {"id": "deepseek-v4-flash", "object": "model", "created": 1677610602, "owned_by": "deepseek", "permission": []}, {"id": "deepseek-v4-flash-nothinking", "object": "model", "created": 1677610602, "owned_by": "deepseek", "permission": []}, {"id": "deepseek-v4-flash-search", "object": "model", "created": 1677610602, "owned_by": "deepseek", "permission": []}, - {"id": "deepseek-v4-flash-search-nothinking", "object": "model", "created": 1677610602, "owned_by": "deepseek", "permission": []} + {"id": "deepseek-v4-flash-search-nothinking", "object": "model", "created": 1677610602, "owned_by": "deepseek", "permission": []}, + {"id": "gemini-2.5-pro", "object": "model", "created": 1715635200, "owned_by": "google", "permission": []}, + {"id": "gemini-3-pro-preview", "object": "model", "created": 1715635200, "owned_by": "google", "permission": []} ] } ``` +The static Gemini set is: `gemini-2.5-flash`, `gemini-2.5-pro`, `gemini-2.5-pro-high`, `gemini-2.5-pro-low`, `gemini-2.5-pro-search`, `gemini-3-flash-preview`, `gemini-3-pro-preview`, `gemini-3.1-pro-preview`, `gemini-3.1-flash-image`. They are served by the embedded agy2api sidecar, whose separate panel lives at `/agy/`. + +When agy2api has Antigravity credentials configured, the list also merges the Gemini models returned by its live `/v1/models` endpoint (including new upstream IDs and `抗截断-` variants). The result is cached for 60 seconds, with automatic fallback to the static catalog if the sidecar is unavailable. + > Note: `/v1/models` returns normalized DeepSeek native model IDs. Common aliases are accepted only as request input and are not expanded as separate items in this endpoint. A `-nothinking` suffix means thinking/reasoning is always off, regardless of what the request asks for. > > The model line has collapsed to the four flash variants above: `deepseek-v4-pro` / `deepseek-v4-pro-search` / `deepseek-v4-vision` and their `-nothinking` forms are retired and no longer appear in this endpoint, Ollama `/api/tags`, or `/anthropic/v1/models`. Old names still work as request input and are silently mapped to the matching flash model (see the next section). @@ -228,6 +238,7 @@ No auth required. Returns the currently supported DeepSeek native model list. For `chat` / `responses` / `embeddings`, DS2API follows a wide-input/strict-output policy: +0. If the model name (after stripping the `抗截断-` prefix) starts with `gemini-`, `/v1/chat/completions`, `/v1/messages` and the Gemini-native routes are forwarded to the embedded agy2api sidecar before this chain. 1. Match DeepSeek native model IDs first. 2. Then match exact keys in `model_aliases`. 3. If the request name ends with `-nothinking`, resolve the base alias and append the corresponding no-thinking variant. @@ -238,7 +249,7 @@ Built-in aliases come from `internal/config/models.go`; `config.model_aliases` c - OpenAI / Codex: `gpt-4o`, `gpt-4.1`, `gpt-5`, `gpt-5.5`, `gpt-5-codex`, `gpt-5.3-codex`, `codex-mini-latest` → `deepseek-v4-flash` - OpenAI reasoning: `o1`, `o3`, `o4-mini` → `deepseek-v4-flash`; `o3-deep-research`, `o4-mini-deep-research` → `deepseek-v4-flash-search` - Claude: `claude-opus-4-6`, `claude-sonnet-4-6`, `claude-haiku-4-5`, `claude-3-5-sonnet-latest` → `deepseek-v4-flash` -- Gemini: `gemini-2.5-pro`, `gemini-2.5-flash`, `gemini-3.1-pro`, `gemini-3-pro`, `gemini-3-flash`, `gemini-3.1-flash-lite`, `gemini-pro-vision` → `deepseek-v4-flash` +- Gemini (only on interfaces not dispatched to agy2api, such as `/v1/responses`): `gemini-2.5-pro`, `gemini-2.5-flash`, `gemini-3.1-pro`, `gemini-3-pro`, `gemini-3-flash`, `gemini-3.1-flash-lite`, `gemini-pro-vision` → `deepseek-v4-flash` - Other exact built-in aliases: `llama-3.1-70b-instruct`, `qwen-max` → `deepseek-v4-flash` Aliases with a `-nothinking` suffix also map to the corresponding forced no-thinking DeepSeek model. @@ -304,7 +315,7 @@ Content-Type: application/json | Field | Type | Required | Notes | | --- | --- | --- | --- | -| `model` | string | ✅ | DeepSeek native models + common aliases (`gpt-5.5`, `gpt-5.4-mini`, `gpt-5.3-codex`, `o3`, `claude-opus-4-6`, `gemini-2.5-pro`, `gemini-3.1-pro`, `gemini-3-flash`, etc.); `-nothinking` suffixes force thinking / reasoning off | +| `model` | string | ✅ | DeepSeek native models + common aliases (`gpt-5.5`, `gpt-5.4-mini`, `gpt-5.3-codex`, `o3`, `claude-opus-4-6`, `claude-sonnet-4-6`, etc.); `gemini-*` models (`gemini-2.5-pro`, `gemini-3-pro-preview`, ...) are forwarded to the embedded agy2api; `-nothinking` on DeepSeek models forces thinking / reasoning off | | `messages` | array | ✅ | OpenAI-style messages | | `stream` | boolean | ❌ | Default `false` | | `tools` | array | ❌ | Function calling schema | diff --git a/API.md b/API.md index 8dab6d353a6d9b3b882f85455f91070cf5a87512..590a4ebfde27814eafcccf7ccdd42bbb8bfea7ed 100644 --- a/API.md +++ b/API.md @@ -123,10 +123,14 @@ Gemini 兼容客户端还可以使用 `x-goog-api-key`、`?key=` 或 `?api_key=` | POST | `/messages` | 业务 | Claude 消息快捷路径 | | POST | `/v1/messages/count_tokens` | 业务 | Claude token 计数快捷路径 | | POST | `/messages/count_tokens` | 业务 | Claude token 计数快捷路径 | +| GET | `/v1beta/models` | 无 | Gemini 模型列表(静态清单 + agy2api 动态发现) | +| GET | `/v1beta/models/{model}` | 无 | Gemini 单模型查询 | | POST | `/v1beta/models/{model}:generateContent` | 业务 | Gemini 非流式 | | POST | `/v1beta/models/{model}:streamGenerateContent` | 业务 | Gemini 流式 | | POST | `/v1/models/{model}:generateContent` | 业务 | Gemini 非流式兼容路径 | | POST | `/v1/models/{model}:streamGenerateContent` | 业务 | Gemini 流式兼容路径 | +| GET | `/agy/` | AGY 面板密码 | 内嵌 agy2api 独立面板(Antigravity OAuth / 凭证管理) | +| ANY | `/agy/*` | AGY 面板密码 / API 密码 | agy2api 原生 OpenAI / Gemini / Claude 接口 | | GET | `/api/version` | 无 | Ollama 版本接口 | | GET | `/api/tags` | 无 | Ollama 模型列表 | | POST | `/api/show` | 无 | Ollama 单模型能力查询(返回 `id` 与 `capabilities`) | @@ -204,7 +208,7 @@ OpenAI `/v1/*` 仍是规范路径。对于只配置 DS2API 根地址的客户端 ### `GET /v1/models` -无需鉴权。返回当前支持的 DeepSeek 原生模型列表。 +无需鉴权。返回当前支持的 DeepSeek 原生模型与内嵌 agy2api 的 Gemini 模型列表。 **响应示例**: @@ -215,11 +219,17 @@ OpenAI `/v1/*` 仍是规范路径。对于只配置 DS2API 根地址的客户端 {"id": "deepseek-v4-flash", "object": "model", "created": 1677610602, "owned_by": "deepseek", "permission": []}, {"id": "deepseek-v4-flash-nothinking", "object": "model", "created": 1677610602, "owned_by": "deepseek", "permission": []}, {"id": "deepseek-v4-flash-search", "object": "model", "created": 1677610602, "owned_by": "deepseek", "permission": []}, - {"id": "deepseek-v4-flash-search-nothinking", "object": "model", "created": 1677610602, "owned_by": "deepseek", "permission": []} + {"id": "deepseek-v4-flash-search-nothinking", "object": "model", "created": 1677610602, "owned_by": "deepseek", "permission": []}, + {"id": "gemini-2.5-pro", "object": "model", "created": 1715635200, "owned_by": "google", "permission": []}, + {"id": "gemini-3-pro-preview", "object": "model", "created": 1715635200, "owned_by": "google", "permission": []} ] } ``` +Gemini 模型固定包含:`gemini-2.5-flash`、`gemini-2.5-pro`、`gemini-2.5-pro-high`、`gemini-2.5-pro-low`、`gemini-2.5-pro-search`、`gemini-3-flash-preview`、`gemini-3-pro-preview`、`gemini-3.1-pro-preview`、`gemini-3.1-flash-image`。这些模型由内嵌 agy2api 承接,独立面板位于 `/agy/`。 + +当 agy2api 已配置 Antigravity 凭证时,列表还会合并其 `/v1/models` 动态返回的 Gemini 模型(含上游新增型号与 `抗截断-` 变体),结果缓存 60 秒;旁车不可用时自动回退到上述静态清单。 + > 说明:`/v1/models` 返回的是规范化后的 DeepSeek 原生模型 ID;常见 alias 仅用于请求入参解析,不会在该接口中单独展开返回。带 `-nothinking` 后缀的模型表示无论请求里是否显式开启 thinking / reasoning,都会强制关闭思考输出。 > > 模型系列已收敛到上表 4 个 flash 变体:`deepseek-v4-pro` / `deepseek-v4-pro-search` / `deepseek-v4-vision` 及其 `-nothinking` 形式已下线,不再出现在本接口、Ollama `/api/tags` 与 `/anthropic/v1/models` 中,但旧名字仍可被请求,解析时静默映射到 flash 对应项(见下一节)。 @@ -228,6 +238,7 @@ OpenAI `/v1/*` 仍是规范路径。对于只配置 DS2API 根地址的客户端 对 `chat` / `responses` / `embeddings` 的 `model` 字段采用“宽进严出”: +0. 若模型名(去掉 `抗截断-` 前缀后)以 `gemini-` 开头,`/v1/chat/completions`、`/v1/messages`、Gemini 原生接口会直接转发给内嵌 agy2api,不进入下述 DeepSeek 解析链。 1. 先匹配 DeepSeek 原生模型。 2. 再匹配 `model_aliases` 精确映射。 3. 如果请求名以 `-nothinking` 结尾,则在最终解析出的规范模型上追加对应的无思考变体。 @@ -238,7 +249,7 @@ OpenAI `/v1/*` 仍是规范路径。对于只配置 DS2API 根地址的客户端 - OpenAI / Codex:`gpt-4o`、`gpt-4.1`、`gpt-5`、`gpt-5.5`、`gpt-5-codex`、`gpt-5.3-codex`、`codex-mini-latest` → `deepseek-v4-flash` - OpenAI reasoning:`o1`、`o3`、`o4-mini` → `deepseek-v4-flash`;`o3-deep-research`、`o4-mini-deep-research` → `deepseek-v4-flash-search` - Claude:`claude-opus-4-6`、`claude-sonnet-4-6`、`claude-haiku-4-5`、`claude-3-5-sonnet-latest` → `deepseek-v4-flash` -- Gemini:`gemini-2.5-pro`、`gemini-2.5-flash`、`gemini-3.1-pro`、`gemini-3-pro`、`gemini-3-flash`、`gemini-3.1-flash-lite`、`gemini-pro-vision` → `deepseek-v4-flash` +- Gemini(仅未分流到 agy2api 的接口,例如 `/v1/responses`):`gemini-2.5-pro`、`gemini-2.5-flash`、`gemini-3.1-pro`、`gemini-3-pro`、`gemini-3-flash`、`gemini-3.1-flash-lite`、`gemini-pro-vision` → `deepseek-v4-flash` - 其他内置精确 alias:`llama-3.1-70b-instruct`、`qwen-max` → `deepseek-v4-flash` 上述 alias 若在请求名后追加 `-nothinking` 后缀,也会映射到对应的强制关闭 thinking 版本。 @@ -304,7 +315,7 @@ Content-Type: application/json | 字段 | 类型 | 必填 | 说明 | | --- | --- | --- | --- | -| `model` | string | ✅ | 支持 DeepSeek 原生模型 + 常见 alias(如 `gpt-5.5`、`gpt-5.4-mini`、`gpt-5.3-codex`、`o3`、`claude-opus-4-6`、`claude-sonnet-4-6`、`gemini-2.5-pro`、`gemini-3.1-pro`、`gemini-3-flash` 等);若模型名带 `-nothinking` 后缀,则强制关闭 thinking / reasoning | +| `model` | string | ✅ | 支持 DeepSeek 原生模型 + 常见 alias(如 `gpt-5.5`、`gpt-5.4-mini`、`gpt-5.3-codex`、`o3`、`claude-opus-4-6`、`claude-sonnet-4-6` 等);`gemini-*` 模型(如 `gemini-2.5-pro`、`gemini-3-pro-preview`)会转发给内嵌 agy2api;DeepSeek 模型名带 `-nothinking` 后缀时强制关闭 thinking / reasoning | | `messages` | array | ✅ | OpenAI 风格消息数组 | | `stream` | boolean | ❌ | 默认 `false` | | `tools` | array | ❌ | Function Calling 定义 | diff --git a/Dockerfile b/Dockerfile index 7ace07abb51101c569e50d655a7912797801e013..5b19b85fea9a4f2a889ac36e991924a6f14c4bb9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,18 +24,29 @@ RUN set -eux; \ FROM busybox:1.36.1-musl AS busybox-tools -FROM debian:bookworm-slim AS runtime-base +FROM python:3.13-slim AS runtime-base WORKDIR /app RUN apt-get update \ && apt-get install -y --no-install-recommends ca-certificates gosu \ && groupadd -r ds2api && useradd -r -g ds2api -d /app -s /sbin/nologin ds2api \ - && mkdir -p /app/data /data && chown -R ds2api:ds2api /app /data \ + && mkdir -p /app/data /data /data/agy2api/creds /data/agy2api/data \ + && chown -R ds2api:ds2api /app /data \ && rm -rf /var/lib/apt/lists/* +# 内嵌 agy2api 的 Python 依赖(复用 requirements.txt 提升层缓存命中率) +COPY agy2api/requirements.txt /tmp/agy2api-requirements.txt +RUN pip install --no-cache-dir -r /tmp/agy2api-requirements.txt \ + && rm -f /tmp/agy2api-requirements.txt COPY --from=busybox-tools /bin/busybox /usr/local/bin/busybox +# 内嵌 agy2api(已含编译好的前端 dist),data/creds 指向持久化目录。 +COPY --chown=ds2api:ds2api agy2api /app/agy2api +RUN rm -rf /app/agy2api/data /app/agy2api/creds \ + && ln -s /data/agy2api/data /app/agy2api/data \ + && ln -s /data/agy2api/creds /app/agy2api/creds EXPOSE 7860 ENV PORT=7860 ENV DS2API_CONFIG_PATH=/data/config.json ENV DS2API_CHAT_HISTORY_PATH=/data/chat_history.json +ENV AGY2API_BASE_URL=http://127.0.0.1:7861 COPY entrypoint.sh /usr/local/bin/entrypoint.sh RUN chmod +x /usr/local/bin/entrypoint.sh CMD ["/usr/local/bin/entrypoint.sh"] diff --git a/README.en.md b/README.en.md index 4afe6d177867ca69d00404e8e062d5dde77fc333..efbcf4064be4b6ddaca521614c8db3c06dbdc722 100644 --- a/README.en.md +++ b/README.en.md @@ -139,6 +139,7 @@ For the full module-by-module architecture and directory responsibilities, see [ | Tool Calling | **Off by default** (`tools.enabled`); when enabled: anti-leak handling, non-code-block feature match, early `delta.tool_calls`, structured incremental output | | Admin API | Config management, runtime settings hot-reload, proxy management, account testing/batch test, session cleanup, import/export, Vercel sync, version check | | WebUI Admin Panel | SPA at `/admin` (bilingual Chinese/English, dark mode, with server-side conversation history) | +| Embedded AGY2API | Separate Antigravity panel at `/agy/` with OAuth, credential management and usage logs; Gemini models are proxied in the same container | | Health Probes | `GET /healthz` (liveness), `GET /readyz` (readiness) | OpenAI `/v1/*` routes remain canonical, and DS2API also accepts root shortcuts such as `/models`, `/chat/completions`, `/responses`, `/embeddings`, `/files`, and `/files/{file_id}` for clients configured with the bare service URL. @@ -176,7 +177,23 @@ Upstream has merged the former pro / vision lanes into flash, so `/v1/models`, O The upstream `model_type` is now only `default`; there is no separate expert or vision lane. -Besides native IDs, DS2API also accepts common aliases as input (for example `gpt-4.1`, `gpt-5`, `gpt-5-codex`, `o3`, `claude-*`, `gemini-*`), but `/v1/models` returns normalized DeepSeek native model IDs. All built-in aliases point at the flash models; `o3-deep-research` and `o4-mini-deep-research` point at `deepseek-v4-flash-search`. The complete alias behavior is documented in [API.en.md](API.en.md#model-alias-resolution) and `config.example.json`. +Besides native IDs, DS2API also accepts common aliases as input (for example `gpt-4.1`, `gpt-5`, `gpt-5-codex`, `o3`, `claude-*`), but `/v1/models` returns normalized DeepSeek native model IDs. All built-in aliases point at the flash models; `o3-deep-research` and `o4-mini-deep-research` point at `deepseek-v4-flash-search`. The complete alias behavior is documented in [API.en.md](API.en.md#model-alias-resolution) and `config.example.json`. + +### Gemini via Embedded AGY2API + +The repository vendors [agy2api](https://github.com/su-kaka/agy2api) (CNC-1.0) as a local Python sidecar. `/v1/models` now publishes: + +`gemini-2.5-flash`, `gemini-2.5-pro`, `gemini-2.5-pro-high`, `gemini-2.5-pro-low`, `gemini-2.5-pro-search`, `gemini-3-flash-preview`, `gemini-3-pro-preview`, `gemini-3.1-pro-preview`, `gemini-3.1-flash-image`. + +Any OpenAI/Claude/Gemini-native request whose model starts with `gemini-` (including the `抗截断-` prefix variant) is forwarded to agy2api before the DeepSeek alias chain. The proxy validates your DS2API API key (`Authorization`, `x-api-key`, `x-goog-api-key` or `?key=`) and injects the sidecar password upstream. + +- Separate panel: `/agy/` (the DS2API panel remains at `/admin`) +- Sidecar data: `/data/agy2api/` +- `AGY2API_BASE_URL` (default `http://127.0.0.1:7861`, set `off` to disable) +- `AGY2API_API_PASSWORD` (default: `DS2API_ADMIN_KEY`, then `pwd`) +- `AGY2API_PANEL_PASSWORD` (default: same as API password) + +Interfaces agy2api does not implement (for example `/v1/responses`) keep the legacy DeepSeek alias behavior. Thinking and native search are resolved in one shared path: model default → explicit client signal (`thinking`, `reasoning`, `reasoning_effort`, `enable_search`, `web_search_options`) → `-nothinking` models always force thinking off. Full rules: [prompt compatibility doc](docs/prompt-compatibility.md) (Chinese) and [API.en.md](API.en.md). @@ -202,7 +219,7 @@ Besides the primary aliases above, `/anthropic/v1/models` also returns Claude 4. ### Gemini Endpoint -The Gemini adapter maps model names to DeepSeek native models via `model_aliases` or exact built-in aliases (covering common `gemini-2.5-*`, `gemini-3*`, and `gemini-pro-vision` names), supporting both `generateContent` and `streamGenerateContent` call patterns with full Tool Calling support (`functionDeclarations` → `functionCall` output). If the Gemini model name has a `-nothinking` suffix, such as `gemini-2.5-pro-nothinking`, it maps to the corresponding forced no-thinking model. +Gemini-native requests for `gemini-*` models are forwarded to the embedded agy2api sidecar, supporting `generateContent`, `streamGenerateContent` and `countTokens` with Antigravity thinking/image variants. Requests for DeepSeek model names (or legacy aliases) still use the native adapter, which maps names via `model_aliases`/built-in aliases and keeps full Tool Calling support (`functionDeclarations` → `functionCall`). If a DeepSeek model name has a `-nothinking` suffix, such as `deepseek-v4-flash-nothinking`, it forces thinking off. ## Quick Start diff --git a/README.md b/README.md index fee2ba26c8aa061a3b327bd133408f09877c640a..c2532b3606ed5e7be6ed79345d9199847d05f21c 100644 --- a/README.md +++ b/README.md @@ -9,12 +9,44 @@ pinned: false # DS2API - DeepSeek to OpenAI API Adapter -DeepSeek web chat to OpenAI-compatible API adapter with multi-protocol support (OpenAI, Claude, Gemini). +DeepSeek web chat to OpenAI-compatible API adapter with multi-protocol support (OpenAI, Claude, Gemini), plus an embedded [agy2api](https://github.com/su-kaka/agy2api) sidecar for Google Antigravity / Gemini models. ## Quick Start -1. Visit /admin to configure your DeepSeek accounts and API keys -2. Use the OpenAI-compatible API at /v1/chat/completions +1. Visit `/admin` to configure your DeepSeek accounts and API keys +2. Visit `/agy/` to complete Antigravity OAuth and manage Gemini credentials (separate panel) +3. Use the OpenAI-compatible API at `/v1/chat/completions`; requests whose `model` starts with `gemini-` are routed to agy2api automatically + +### Local development (Go + Python sidecar) + +```bash +./scripts/dev-agy.sh # terminal 1: agy2api on 127.0.0.1:7861 +go run ./cmd/ds2api # terminal 2: DS2API on :5001 +``` + +`dev-agy.sh` creates `agy2api/.venv`, installs `agy2api/requirements.txt`, and honors `AGY2API_API_PASSWORD`, `AGY2API_PANEL_PASSWORD` and `DS2API_ADMIN_KEY`. Set `AGY2API_BASE_URL=off` to disable the sidecar integration. + +## Embedded AGY2API (Gemini / Antigravity) + +The repository vendors agy2api (CNC-1.0) under `agy2api/` and runs it as a local Python sidecar inside the same container: + +- Separate panel: `/agy/` (Antigravity OAuth, credentials, usage logs). The original DS2API panel stays at `/admin`. +- OpenAI-compatible: `/v1/chat/completions` (and `/chat/completions`) with a `gemini-*` model. +- Claude-compatible: `/v1/messages` with a `gemini-*` model. +- Gemini native: `/v1beta/models/{model}:generateContent`, `:streamGenerateContent`, `:countTokens` (and the `/v1/models/...` aliases). +- Model list: `/v1/models` publishes the static Gemini catalog (`gemini-2.5-flash`, `gemini-2.5-pro` with `-high` / `-low` / `-search`, `gemini-3-flash-preview`, `gemini-3-pro-preview`, `gemini-3.1-pro-preview`, `gemini-3.1-flash-image`) and merges agy2api's live model list with a 60s cache and static fallback. Gemini-native `GET /v1beta/models` and `GET /v1beta/models/{model}` are also available. +- Authentication: the same DS2API API keys work (`Authorization: Bearer`, `x-api-key`, `x-goog-api-key`, or `?key=`). The proxy validates the key and injects the agy2api password upstream. +- Data: credentials and request logs live in `/data/agy2api/`. + +Environment variables: + +| Variable | Default | Description | +| --- | --- | --- | +| `AGY2API_BASE_URL` | `http://127.0.0.1:7861` | Sidecar address; set `off` to disable routing | +| `AGY2API_API_PASSWORD` | `DS2API_ADMIN_KEY`, then `pwd` | API password used between DS2API and agy2api | +| `AGY2API_PANEL_PASSWORD` | same as API password | Login password for the `/agy/` panel | + +> Gemini models are dispatched before the DeepSeek alias chain, so they no longer fall back to DeepSeek. Interfaces that agy2api does not implement (for example `/v1/responses`) keep the old alias behavior. ## Documentation diff --git a/agy2api/.dockerignore b/agy2api/.dockerignore new file mode 100644 index 0000000000000000000000000000000000000000..a69eb6b5c2c580fac5bf190b273497a259a659c6 --- /dev/null +++ b/agy2api/.dockerignore @@ -0,0 +1,17 @@ +# Docker ignore +.venv/ +venv/ +__pycache__/ +*.py[cod] +.git/ +.github/ +.idea/ +.vscode/ +.claude/ +.pytest_cache/ +frontend/node_modules/ +creds/ +*.log +log.txt +.env +tests/ diff --git a/agy2api/.env.example b/agy2api/.env.example new file mode 100644 index 0000000000000000000000000000000000000000..159a57a03b193fedb693e854b73887b46ff03e1d --- /dev/null +++ b/agy2api/.env.example @@ -0,0 +1,154 @@ +# ================================================================ +# AGY2API 环境变量配置示例文件 +# 复制此文件为 .env 并根据需要修改配置值 +# ================================================================ + +# ================================================================ +# 服务器配置 +# ================================================================ + +# 服务器监听地址 +# 默认: 0.0.0.0 (监听所有网络接口) +HOST=0.0.0.0 + +# 服务器端口 +# 默认: 7861 +PORT=7861 + +# 反代保留路径前缀时需剥掉的前缀 (如 /AGY2API) +# 仅在反代将 /AGY2API/xxx 原样转发到本服务时配置; 反代已剥掉前缀时留空 +# 默认: 空 (不剥离) +PATH_PREFIX= + +# ================================================================ +# 密码配置 (分离密码) +# ================================================================ + +# 聊天API访问密码 (用于OpenAI/Gemini/Claude API端点认证) +# 默认: pwd +API_PASSWORD=your_api_password + +# 控制面板访问密码 (用于Web界面登录认证) +# 默认: pwd +PANEL_PASSWORD=your_panel_password + +# IP 白名单 (可选) +# 启用开关 + 逗号或换行分隔的白名单列表 +# 每条支持: 单个IP / CIDR网段 / 起止范围(- 或 ~ 分隔), IPv4/IPv6 均可 +# 开启后仅白名单内 IP 可访问面板和 API, 其余 IP 直接 403 +# 默认: 关闭 (不限制) +IP_WHITELIST_ENABLED=false +IP_WHITELIST= + +# 模型名复写 (可选) +# 启用后按规则匹配请求模型名(支持正则), 命中则替换为指定模型名 +# 规则格式: JSON 数组 [匹配正则, 替换模型名] 的数组; 也支持 "正则->替换名" 逗号分隔 +# 替换名支持正则反向引用 (如 \1) +# 默认: 关闭 +MODEL_REWRITE_ENABLED=false +MODEL_REWRITE_RULES=[["^gpt-4$","gemini-2.5-pro"],["^claude-3-5-sonnet.*$","claude-sonnet-4-5"]] + +# ================================================================ +# 存储配置 +# ================================================================ + +# 存储后端优先级: PostgreSQL > 本地sqlite文件存储 +# 系统会自动选择可用的最高优先级存储后端 + +# PostgreSQL 分布式存储模式配置 (最高优先级) +# 设置 POSTGRESQL_URI 后自动启用 PostgreSQL 模式 +# 格式: postgresql://user:password@localhost:5432/agy2api +# 默认: 无 (不启用 PostgreSQL 存储,使用本地SQLite) +POSTGRESQL_URI= + +# ================================================================ +# Google API 配置 +# ================================================================ + +# 凭证文件目录 (仅在文件存储模式下使用) +# 默认: ./creds +CREDENTIALS_DIR=./creds + +# 代理配置 (可选) +# 支持 http, https, socks5 代理 +# 格式: http://proxy:port, https://proxy:port, socks5://proxy:port +PROXY=http://localhost:7890 + +# Google API 代理 URL 配置 (可选) + +# Google OAuth2 端点 +# 默认: https://oauth2.googleapis.com +OAUTH_PROXY_URL=https://oauth2.googleapis.com + +# 用于Google APIs调用的代理URL +# 默认: https://www.googleapis.com +GOOGLEAPIS_PROXY_URL=https://www.googleapis.com + +# 用于Google Antigravity API的URL +# 默认: https://daily-cloudcode-pa.googleapis.com +ANTIGRAVITY_API_URL=https://daily-cloudcode-pa.googleapis.com + +# ================================================================ +# 错误处理和重试配置 +# ================================================================ + +# 是否启用自动封禁功能 +# 当凭证返回特定错误码时自动禁用该凭证 +# 默认: false +AUTO_BAN=false + +# 自动封禁的错误码列表 (逗号分隔) +# 默认: 403 +AUTO_BAN_ERROR_CODES=403 + +# 是否启用 429 错误重试 +# 默认: true +RETRY_429_ENABLED=true + +# 429 错误最大重试次数 +# 默认: 5 +RETRY_429_MAX_RETRIES=5 + +# 429 错误重试间隔 (秒) +# 默认: 1 +RETRY_429_INTERVAL=1 + +# ================================================================ +# 日志配置 +# ================================================================ + +# 日志级别 +# 可选值: debug, info, warning, error, critical +# 默认: info +LOG_LEVEL=info + +# 完全静默:不打印任何日志到控制台输出 +# 默认: 1(打印日志) +ENABLE_LOG=1 + +# ================================================================ +# 高级功能配置 +# ================================================================ + +# 抗截断最大尝试次数 +# 用于 "抗截断-" 前缀的模型 +# 默认: 3 +ANTI_TRUNCATION_MAX_ATTEMPTS=3 + +# ================================================================ +# 环境变量使用说明 +# ================================================================ + +# 1. 存储模式配置 (按优先级自动选择): +# - PostgreSQL 分布式模式 (最高优先级): 设置 POSTGRESQL_URI,数据存储在 PostgreSQL 数据库 +# - SQLite 本地模式 (默认): 不设置上述 URI,数据存储在本地 creds/credentials.db + +# 2. 密码配置: +# API_PASSWORD(聊天API)与 PANEL_PASSWORD(控制面板)独立设置,默认均为 pwd + +# 3. 通用配置优先级: +# 环境变量 > 默认值 + +# 4. 布尔值环境变量: +# true/1/yes/on 表示启用 +# false/0/no/off 表示禁用 diff --git a/agy2api/.gitignore b/agy2api/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..e92d34175f5f87b47ea6769761969d9a3cf9c71e --- /dev/null +++ b/agy2api/.gitignore @@ -0,0 +1,106 @@ +# Credential files - should never be committed +*.json +!package.json +!package-lock.json +!tsconfig.json +*.toml +!pyproject.toml +creds/ +data/ +CLAUDE.md +GEMINI.md +.kiro +# Environment configuration +.env + +# Python +uv.lock +.python-version +__pycache__/ +*.py[cod] +*$py.class +*.so +.Python +build/ +develop-eggs/ +!dist/ +!dist/** +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +pip-wheel-metadata/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# Node (frontend) +frontend/node_modules/ + +# PyInstaller +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ + +# Virtual environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# IDE +.vscode/ +.idea/ +.claude/ +*.swp +*.swo +*~ + +# OS +.DS_Store +.DS_Store? +._* +.Spotlight-V100 +.Trashes +ehthumbs.db +Thumbs.db + +# Logs +*.log +log.txt + +# Temporary files +*.tmp +*.temp +*.bak + +tools/ +aicode/ +streamchat/ diff --git a/agy2api/AGENTS.md b/agy2api/AGENTS.md new file mode 100644 index 0000000000000000000000000000000000000000..68605b0f5df666610a3d93de7de41e2ac9b07c16 --- /dev/null +++ b/agy2api/AGENTS.md @@ -0,0 +1,52 @@ +# AGENTS.md + +本仓库使用 `uv` 管理依赖(`pyproject.toml` / `uv.lock`)。 + +## Python 环境(重要) + +**在执行任何 Python 相关命令(运行、测试、安装依赖等)时,请始终使用 backend 目录下的虚拟环境解释器:** + +```bash +.venv\Scripts\python.exe +``` + +例如: + +```bash +# 运行后端 +.venv\Scripts\python.exe web.py + +# 安装依赖(优先使用 uv) +.venv\Scripts\python.exe -m pip install -r requirements.txt + +# 查看已安装的包 +.venv\Scripts\python.exe -m pip list +``` + +不要使用系统全局的 `python` / `python3`,也不要自行新建虚拟环境。 + +## 前端构建 + +前端位于 `frontend/` 目录,使用 `pnpm` 作为包管理器: + +```bash +cd frontend +pnpm install +pnpm build +``` + +不要使用 `npm` / `yarn` 或创建 `package-lock.json` / `yarn.lock`。 + +## 依赖导入规范 + +**所有依赖导入(`import` / `from ... import ...`)必须统一放在文件顶部(module docstring、`__future__` 导入和 `__all__` 之后)。** + +唯一的例外:**存在循环依赖时**,可以在函数/方法内部延迟导入,并在导入语句旁注释说明原因,例如: + +```python +def some_func(): + # 循环依赖,延迟导入 + from src.auth import verify_token +``` + +除上述例外,禁止在函数内部、条件分支中随意散落导入语句。 diff --git a/agy2api/CONTRIBUTING.md b/agy2api/CONTRIBUTING.md new file mode 100644 index 0000000000000000000000000000000000000000..d00e7b128f772c96762cfc1a7dde93655063b04f --- /dev/null +++ b/agy2api/CONTRIBUTING.md @@ -0,0 +1,169 @@ +# Contributing to agy2api + +First off, thank you for considering contributing to agy2api! It's people like you that make agy2api such a great tool. + +## Code of Conduct + +This project is intended for personal learning and research purposes only. By participating, you are expected to uphold this code and respect the CNC-1.0 license restrictions on commercial use. + +## How Can I Contribute? + +### Reporting Bugs + +Before creating bug reports, please check the existing issues to avoid duplicates. When you create a bug report, include as many details as possible: + +* **Use a clear and descriptive title** +* **Describe the exact steps to reproduce the problem** +* **Provide specific examples** - Include code snippets, configuration files, or log outputs +* **Describe the behavior you observed** and what you expected to see +* **Include environment details**: OS, Python version, Docker version (if applicable) + +### Suggesting Enhancements + +Enhancement suggestions are tracked as GitHub issues. When creating an enhancement suggestion, include: + +* **Use a clear and descriptive title** +* **Provide a detailed description** of the suggested enhancement +* **Explain why this enhancement would be useful** +* **List any alternative solutions** you've considered + +### Pull Requests + +1. Fork the repo and create your branch from `master` +2. If you've added code that should be tested, add tests +3. If you've changed APIs, update the documentation +4. Ensure the test suite passes +5. Make sure your code follows the existing style +6. Write a clear commit message + +## Development Setup + +### Prerequisites + +* Python 3.12 or higher +* pip or uv package manager + +### Setting Up Your Development Environment + +```bash +# Clone your fork +git clone https://github.com/YOUR_USERNAME/agy2api.git +cd agy2api + +# Install development dependencies +make install-dev +# or +pip install -e ".[dev]" + +# Copy environment example +cp .env.example .env +# Edit .env with your configuration +``` + +### Development Workflow + +```bash +# Run tests +make test + +# Format code +make format + +# Run linters +make lint + +# Run the application locally +make run +``` + +### Testing + +We use pytest for testing. All new features should include appropriate tests. + +```bash +# Run all tests +make test + +# Run with coverage +make test-cov + +# Run specific test file +python -m pytest test_tool_calling.py -v +``` + +### Code Style + +* We use [Black](https://black.readthedocs.io/) for code formatting (line length: 100) +* We use [flake8](https://flake8.pycqa.org/) for linting +* We use [mypy](http://mypy-lang.org/) for type checking (optional, but encouraged) + +```bash +# Format your code before committing +make format + +# Check if code is properly formatted +make format-check + +# Run linters +make lint +``` + +## Project Structure + +``` +agy2api/ +├── src/ # Main source code +│ ├── auth.py # Authentication and OAuth +│ ├── credential_manager.py # Credential rotation +│ ├── openai_router.py # OpenAI-compatible endpoints +│ ├── gemini_router.py # Gemini native endpoints +│ ├── openai_transfer.py # Format conversion +│ ├── storage/ # Storage backends (Redis, MongoDB, Postgres, File) +│ └── ... +├── dist/ # Compiled frontend static files +├── tests/ # Test directory (to be created) +├── test_*.py # Test files (root level) +├── web.py # Main application entry point +├── config.py # Configuration management +└── requirements.txt # Production dependencies +``` + +## Coding Guidelines + +### Python Style + +* Follow PEP 8 guidelines +* Use type hints where appropriate +* Write docstrings for classes and functions +* Keep functions focused and concise + +### Commit Messages + +* Use the present tense ("Add feature" not "Added feature") +* Use the imperative mood ("Move cursor to..." not "Moves cursor to...") +* Limit the first line to 72 characters or less +* Reference issues and pull requests liberally after the first line + +### Documentation + +* Update the README.md if you change functionality +* Comment your code where necessary +* Update the .env.example if you add new configuration options + +## License + +By contributing to agy2api, you agree that your contributions will be licensed under the CNC-1.0 license. This is a strict anti-commercial license - see [LICENSE](LICENSE) for details. + +### Important License Restrictions + +* ❌ No commercial use +* ❌ No use by companies with revenue > $1M USD +* ❌ No use by VC-backed or publicly traded companies +* ✅ Personal learning, research, and educational use only +* ✅ Open source integration (must follow same license) + +## Questions? + +Feel free to open an issue with your question or reach out to the maintainers. + +Thank you for contributing! 🎉 diff --git a/agy2api/Dockerfile b/agy2api/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..761a9420c311c0f9628ad19bbb67d43d8bd344c9 --- /dev/null +++ b/agy2api/Dockerfile @@ -0,0 +1,41 @@ +# Multi-stage build for agy2api +FROM python:3.13-slim as base + +# Set environment variables +ENV PYTHONUNBUFFERED=1 \ + PYTHONDONTWRITEBYTECODE=1 \ + PIP_NO_CACHE_DIR=1 \ + PIP_DISABLE_PIP_VERSION_CHECK=1 \ + TZ=Asia/Shanghai + +# Install tzdata, jemalloc and set timezone +# jemalloc 替代 glibc malloc,大幅减少内存碎片化 +RUN apt-get update && \ + apt-get install -y --no-install-recommends tzdata libjemalloc2 && \ + ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \ + echo "Asia/Shanghai" > /etc/timezone && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +# 使用 jemalloc 替代 glibc malloc +# jemalloc 会主动将空闲内存归还给操作系统,避免 RSS 持续增长 +ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2 +# jemalloc 配置:启用后台线程回收、脏页衰减时间 5 秒(默认 10 秒) +ENV MALLOC_CONF="background_thread:true,dirty_decay_ms:5000,muzzy_decay_ms:5000" + +WORKDIR /app + +# Copy only requirements first for better caching +COPY requirements.txt . + +# Install Python dependencies +RUN pip install --no-cache-dir -r requirements.txt + +# Copy application code +COPY . . + +# Expose port +EXPOSE 7861 + +# 通过 web.py 启动,使 HOST/PORT 环境变量生效 +CMD ["python", "web.py"] diff --git a/agy2api/LICENSE b/agy2api/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..cb17b15a47eee655e47b769e3e6553a8c259e79a --- /dev/null +++ b/agy2api/LICENSE @@ -0,0 +1,83 @@ +Cooperative Non-Commercial License (CNC-1.0) + +Copyright (c) 2024 agy2api contributors + +Permission is hereby granted, free of charge, to any person or organization +obtaining a copy of this software and associated documentation files (the +"Software"), to use, copy, modify, merge, publish, distribute, and/or +sublicense the Software, subject to the following conditions: + +TERMS AND CONDITIONS: + +1. NON-COMMERCIAL USE ONLY + The Software may only be used for non-commercial purposes. Commercial use + is strictly prohibited without explicit written permission from the + copyright holders. + +2. DEFINITION OF COMMERCIAL USE + "Commercial use" includes but is not limited to: + a) Using the Software to provide paid services or products + b) Integrating the Software into commercial products or services + c) Using the Software in any business operation that generates revenue + d) Offering the Software as part of a paid subscription or service + e) Using the Software to compete with the original project commercially + +3. COPYLEFT REQUIREMENT + Any derivative works, modifications, or substantial portions of the Software + must be licensed under the same or substantially similar terms. This ensures + that all derivatives remain non-commercial and freely available. + +4. SOURCE CODE AVAILABILITY + If you distribute the Software or any derivative works, you must make the + complete source code available under the same license terms at no charge. + +5. ATTRIBUTION REQUIREMENT + You must retain all copyright notices, license notices, and attribution + statements in all copies or substantial portions of the Software. + +6. ANTI-CORPORATE CLAUSE + This Software may not be used by corporations with annual revenue exceeding + $1 million USD, venture capital backed companies, or publicly traded + companies without explicit written permission from the copyright holders. + +7. EDUCATIONAL AND RESEARCH EXEMPTION + Use by educational institutions, non-profit research organizations, and + individual researchers for educational or research purposes is explicitly + permitted and encouraged. + +8. MODIFICATION AND CONTRIBUTION + Modifications and contributions to the Software are welcomed and encouraged, + provided they comply with these license terms. Contributors grant the same + license to their contributions. + +9. PATENT GRANT + Each contributor grants you a non-exclusive, worldwide, royalty-free patent + license to make, have made, use, offer to sell, sell, import, and otherwise + transfer the Work for non-commercial purposes only. + +10. TERMINATION + This license automatically terminates if you violate any of its terms. + Upon termination, you must cease all use and distribution of the Software + and destroy all copies in your possession. + +11. LIABILITY DISCLAIMER + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + +12. JURISDICTION + This license shall be governed by and construed in accordance with the laws + of the jurisdiction where the copyright holder resides. + +SUMMARY: +This license allows free use, modification, and distribution of the Software +for non-commercial purposes only. It explicitly prohibits commercial use and +ensures that all derivatives remain freely available under the same terms. +The license promotes cooperative development while preventing commercial +exploitation of the community's work. + +For commercial licensing inquiries, please contact the copyright holders. \ No newline at end of file diff --git a/agy2api/README.md b/agy2api/README.md new file mode 100644 index 0000000000000000000000000000000000000000..73316929ac876f42d5fdd50edf4b06bf48e5774d --- /dev/null +++ b/agy2api/README.md @@ -0,0 +1,348 @@ +# AGY2API + +**将 Google Antigravity 转换为 OpenAI、Gemini 和 Claude API 兼容接口** + +[![Python 3.12+](https://img.shields.io/badge/python-3.12+-blue.svg)](https://www.python.org/downloads/) +[![License: CNC-1.0](https://img.shields.io/badge/License-CNC--1.0-red.svg)](LICENSE) +[![Docker](https://img.shields.io/badge/docker-available-blue.svg)](https://github.com/su-kaka/agy2api/pkgs/container/agy2api) + +[English](docs/README_EN.md) | 中文 | [日本語](docs/README_JA.md) + +> **⚠️ 重要变更**:GeminiCLI 端点已被谷歌抛弃,本项目已完全移除 GeminiCLI 相关代码,仅保留 Antigravity 模式。 + +## 安装指南 + +### Termux 环境 + +**初始安装** +```bash +curl -o termux-install.sh "https://raw.githubusercontent.com/su-kaka/agy2api/refs/heads/master/termux-install.sh" && chmod +x termux-install.sh && ./termux-install.sh +``` + +**重启服务** +```bash +cd agy2api +bash termux-start.sh +``` + +### Windows 环境 + +**初始安装** +```powershell +iex (iwr "https://raw.githubusercontent.com/su-kaka/agy2api/refs/heads/master/install.ps1" -UseBasicParsing).Content +``` + +**重启服务** +双击执行 `start.bat` + +### Linux 环境 + +**初始安装** +```bash +curl -o install.sh "https://raw.githubusercontent.com/su-kaka/agy2api/refs/heads/master/install.sh" && chmod +x install.sh && ./install.sh +``` + +**重启服务** +```bash +cd agy2api +bash start.sh +``` + +### macOS 环境 + +**初始安装** +```bash +curl -o darwin-install.sh "https://raw.githubusercontent.com/su-kaka/agy2api/refs/heads/master/darwin-install.sh" && chmod +x darwin-install.sh && ./darwin-install.sh +``` + +**重启服务** +```bash +cd agy2api +bash start.sh +``` + +### Docker 环境 + +**Docker 运行命令** +```bash +docker run -d --name agy2api --network host -e API_PASSWORD=api_pwd -e PANEL_PASSWORD=panel_pwd -e PORT=7861 -v $(pwd)/data/creds:/app/creds -v $(pwd)/data/request_logs:/app/data/request_logs ghcr.io/su-kaka/agy2api:latest +``` + +**Docker Compose 运行命令** +1. 使用仓库中的 `docker-compose.yml`,或参考以下内容: + ```yaml + version: '3.8' + + services: + agy2api: + image: ghcr.io/su-kaka/agy2api:latest + container_name: agy2api + restart: unless-stopped + network_mode: host + environment: + # 密码配置(分离密码) + - API_PASSWORD=your_api_password + - PANEL_PASSWORD=your_panel_password + - PORT=7861 + volumes: + - ./data/creds:/app/creds + - ./data/request_logs:/app/data/request_logs + ``` +2. 启动服务: + ```bash + docker-compose up -d + ``` + +## 核心功能 + +### 🔄 API 端点和格式支持 + +**Antigravity 多端点多格式支持** +- **OpenAI 格式端点**:`/v1/chat/completions` 和 `/v1/models` +- **Gemini 原生端点**:`/v1/models/{model}:generateContent` 和 `streamGenerateContent` +- **Claude 格式端点**:`/v1/messages` +- 支持所有 Antigravity 模型(Claude、Gemini 等) +- 自动模型名称映射和思维模式检测 +- 多种认证方式:Bearer 头部、x-api-key、x-goog-api-key、URL 参数 key + +### 📊 智能凭证管理系统 + +- 多个 Google OAuth 凭证自动轮换(随机负载均衡) +- 模型级冷却(429 错误自动设置对应模型家族的 CD:image / argon / gemini / claude+gpt 共享冷却) +- 自动故障检测和凭证禁用 +- 凭证使用统计和配额/额度查询 +- 批量操作(启用、禁用、删除) +- 以邮箱为唯一键,重复导入自动覆盖去重 +- 自动获取 Google 账户邮箱地址、订阅等级(Tier)和 Project ID + +### 🌊 流式传输和响应处理 + +- 真正的实时流式响应(SSE) +- 流式抗截断功能(防止回答被截断,通过"抗截断-"前缀启用) +- 思维链(Thinking)内容分离 + +### 🎛️ Web 管理控制台 + +基于 React + Vite + Tailwind 编译的现代化前端界面: +- Antigravity OAuth 认证流程(支持回调 URL 快捷方式) +- 凭证文件上传(JSON/ZIP)、下载、详情查看 +- 凭证导出(规范 JSON:refresh_token/access_token/expiry/email/tier/project_id) +- 系统配置管理(环境变量锁定提示、热更新) +- 批量凭证操作和状态筛选、批量导入(缺失字段自动获取) +- 移动端自适应 + +## 支持的模型 + +模型列表从 Antigravity API 动态获取,支持所有 Antigravity 模型: + +- **Claude 系列**:`claude-sonnet-4-5`、`claude-opus-4-5` 等 +- **Gemini 系列**:`gemini-2.5-flash`、`gemini-3-flash-preview` 等 + +**特殊功能变体:** +- **抗截断模式**:在模型名称前添加 `抗截断-` 前缀 + - 例:`抗截断-gemini-2.5-pro` + - 通过合成工具调用绕过截断限制,确保完整回答(流式和非流式均有效) +- **图像生成模型**支持分辨率(`-2k`、`-4k`)和比例(`-16x9`、`-9x16` 等)后缀 + +## 配置说明 + +1. 访问 `http://127.0.0.1:7861`(默认端口,可通过 PORT 环境变量修改) +2. 完成 Antigravity OAuth 认证流程(默认密码:`pwd`,可通过环境变量修改) +3. 配置客户端: + +**OpenAI 兼容客户端:** +- **端点地址**:`http://127.0.0.1:7861/v1` +- **API 密钥**:`pwd`(默认值,可通过 API_PASSWORD 环境变量修改) + +**Gemini 原生客户端:** +- **端点地址**:`http://127.0.0.1:7861` +- **认证方式**:`Authorization: Bearer 密钥`、`x-goog-api-key: 密钥` 或 URL 参数 `?key=密钥` + +**Claude 客户端:** +- **端点地址**:`http://127.0.0.1:7861/v1/messages` +- **认证方式**:`x-api-key: 密钥` 或 `Authorization: Bearer 密钥` + +## 💾 数据存储 + +### 存储后端 + +| 后端 | 说明 | 启用方式 | +|------|------|----------| +| **SQLite**(默认) | 本地文件存储,开箱即用 | 无需配置,数据存储在 `creds/credentials.db` | +| **PostgreSQL** | 云端分布式存储,多实例部署 | 设置 `POSTGRESQL_URI` 环境变量 | + +### 凭证数据结构 + +凭证以**邮箱(email)为唯一键**存储,字段为结构化数据库列(不再使用 JSON blob): +`email`、`access_token`、`refresh_token`、`client_id`、`client_secret`、`project_id`、`expiry`、`tier` + +凭证导入/导出使用规范 JSON 格式:`{"refresh_token": "...", "access_token": "...", "expiry": "...", "email": "...", "tier": "...", "project_id": "..."}`(仅 `refresh_token` 必填,`access_token` 未过期时直接复用,其余字段可自动获取)。 + +### 环境变量配置 + +**基础配置** +- `PORT`: 服务端口(默认:7861) +- `HOST`: 服务器监听地址(默认:0.0.0.0) + +**密码配置** +- `API_PASSWORD`: 聊天 API 访问密码(默认:pwd) +- `PANEL_PASSWORD`: 控制面板访问密码(默认:pwd) + +**访问控制配置** +- `IP_WHITELIST_ENABLED`: 启用 IP 白名单(默认:false,不限制) +- `IP_WHITELIST`: IP 白名单列表,逗号或换行分隔(默认:空)。每条支持单个 IP(`192.168.1.1`)、CIDR 网段(`192.168.1.0/24`)、起止范围(`10.0.0.1-10.0.0.100`),IPv4 / IPv6 均可。开启后仅白名单内 IP 可访问面板和 API,其余 IP 直接 403;面板保存后立即生效 + +**模型名复写配置** +- `MODEL_REWRITE_ENABLED`: 启用模型名复写(默认:false) +- `MODEL_REWRITE_RULES`: 复写规则,每条为 `[匹配正则, 替换模型名]`(默认:空)。自上而下首条命中即替换,替换支持正则反向引用(如 `\1`)。例:把 `gpt-4o` 映射到 `gemini-2.5-pro`。面板保存后立即生效 + +**存储配置** +- `CREDENTIALS_DIR`: 凭证数据库目录(默认:./creds) +- `POSTGRESQL_URI`: PostgreSQL 连接字符串(设置后启用 PostgreSQL 模式) + +**网络和代理配置** +- `PROXY`: 代理地址(支持 `http://`、`https://`、`socks5://`、`socks5h://`,可带账号密码 `user:pass@host:port`) +- `OAUTH_PROXY_URL`: OAuth 认证代理端点 +- `GOOGLEAPIS_PROXY_URL`: Google APIs 代理端点 +- `ANTIGRAVITY_API_URL`: Antigravity API 端点 +- `PATH_PREFIX`: 反代保留路径前缀(如 `/AGY2API`)时配置,由后端在路由匹配前剥掉该前缀;默认:空(不剥离) + +**性能和稳定性配置** +- `RETRY_429_ENABLED`: 启用错误自动重试(默认:true) +- `RETRY_429_MAX_RETRIES`: 最大重试次数(默认:5) +- `RETRY_429_INTERVAL`: 重试间隔,秒(默认:1) +- `ANTI_TRUNCATION_MAX_ATTEMPTS`: 抗截断最大重试次数(默认:3) + +**自动化配置** +- `AUTO_BAN`: 启用凭证自动封禁(默认:false) +- `AUTO_BAN_ERROR_CODES`: 触发自动封禁的错误码(默认:403) + +**响应行为配置** +- `RETURN_THOUGHTS_TO_FRONTEND`: 返回思维链到前端(默认:true) + +**敏感词过滤配置** +- `SENSITIVE_WORDS_ENABLED`: 启用敏感词过滤(默认:false) +- `SENSITIVE_WORDS`: 敏感词列表,逗号或换行分隔(默认:空)。命中后整词替换为空,不区分大小写,支持中文,面板保存后立即生效 + +**请求日志配置** +- `USAGE_LOG_ENABLED`: 启用请求日志(默认:true)。记录每次 API 请求(模型、凭证、token 用量、耗时、状态)到数据库,不自动清理,可在面板手动清理或清空 + +**请求体详细日志配置** +- `REQUEST_LOG_ENABLED`: 启用请求体详细日志(默认:false)。开启后,当请求命中指定错误码时,把发往上游的完整请求头(已脱敏)与请求体保存为 JSON 文件到 `data/request_logs/`,数据库仅记录文件索引,在"请求日志"详情中查看。主要用于请求体错误时排查 debug;清理/清空日志时会同步删除对应文件(Docker 部署请挂载 `./data/request_logs:/app/data/request_logs` 以持久化) +- `REQUEST_LOG_ERROR_CODES`: 触发详细日志的错误码列表,逗号分隔(默认:400) + +**凭证选择模式** +- `CREDENTIAL_SELECT_MODE`: 凭证选择模式(默认:cache) + - `random` — 完全随机负载均衡,每次请求随机挑选凭证 + - `cache` — 缓存匹配(推荐):以"模型 + system 指令(或首条 user 消息)"哈希会话 key,相同会话复用同一凭证,命中 Google 上游 prompt cache;凭证 CD 后自动切换并重新绑定 + - `sticky` — 凭证粘性:所有请求锁定同一凭证,直到其进入 CD 或被禁用 +- `REDIS_URL`: Redis 连接串(可选)。设置后缓存匹配的会话绑定存入 Redis,多实例共享;未设置时使用进程内存后端 + +**日志配置** +- `LOG_LEVEL`: 日志级别(DEBUG/INFO/WARNING/ERROR,默认:INFO) +- `ENABLE_LOG`: 完全静默,不打印任何日志(设为 0 启用静默,默认:1) + +## API 使用示例 + +### OpenAI 格式 + +```bash +curl -X POST "http://127.0.0.1:7861/v1/chat/completions" \ + -H "Authorization: Bearer your_api_password" \ + -H "Content-Type: application/json" \ + -d '{ + "model": "claude-sonnet-4-5", + "messages": [ + {"role": "user", "content": "Hello"} + ], + "stream": true + }' +``` + +### Gemini 原生格式 + +```bash +curl -X POST "http://127.0.0.1:7861/v1/models/gemini-2.5-flash:generateContent?key=your_api_password" \ + -H "Content-Type: application/json" \ + -d '{ + "contents": [ + {"role": "user", "parts": [{"text": "Hello"}]} + ] + }' +``` + +### Claude 格式 + +```bash +curl -X POST "http://127.0.0.1:7861/v1/messages" \ + -H "x-api-key: your_api_password" \ + -H "anthropic-version: 2023-06-01" \ + -H "Content-Type: application/json" \ + -d '{ + "model": "claude-sonnet-4-5", + "max_tokens": 1024, + "messages": [ + {"role": "user", "content": "Hello, Claude!"} + ] + }' +``` + +### 图像生成(Gemini 原生 SDK) + +```python +from io import BytesIO +from PIL import Image +from google.genai import Client +from google.genai.types import HttpOptions +from google.genai import types + +client = Client( + api_key="pwd", + http_options=HttpOptions(base_url="http://127.0.0.1:7861"), +) + +prompt = "画一只猫" + +response = client.models.generate_content( + model="gemini-3.1-flash-image", + contents=[prompt], + config=types.GenerateContentConfig( + image_config=types.ImageConfig( + aspect_ratio="16:9", + ) + ) +) +for part in response.candidates[0].content.parts: + if part.text is not None: + print(part.text) + elif part.inline_data is not None: + image = Image.open(BytesIO(part.inline_data.data)) + image.save("generated_image.png") +``` + +## 🛠️ 前端开发 + +控制面板前端源码位于 `frontend/` 目录(React + Vite + Tailwind CSS): + +```bash +cd frontend +npm install +npm run dev # 开发模式,端口 3000,代理后端 API +npm run build # 构建到 dist/(生产模式使用) +``` + +后端直接托管 `dist/` 下编译后的静态文件,无需 Node.js 运行时。 + +## 💬 交流群 + +欢迎加入 QQ 群交流讨论! + +**QQ 群号:1083250744** + +## 许可证与免责声明 + +本项目仅供学习研究使用,禁止商业用途和倒卖。 + +## ⚠️ 许可证声明 + +本项目使用 [CNC-1.0 许可证](LICENSE)(反商业许可证)。 diff --git a/agy2api/config.py b/agy2api/config.py new file mode 100644 index 0000000000000000000000000000000000000000..9aca33137a6d65776ef7b33ef559f36d7c208433 --- /dev/null +++ b/agy2api/config.py @@ -0,0 +1,791 @@ +""" +Configuration constants for the Geminicli2api proxy server. +Centralizes all configuration to avoid duplication across modules. + +- 启动时加载一次配置到内存 +- 修改配置时调用 reload_config() 重新从数据库加载 +""" + +import ipaddress +import json +import os +import re +from typing import Any, Optional + +from log import log + +# 全局配置缓存 +_config_cache: dict[str, Any] = {} +_config_initialized = False + +# Client Configuration + +# 需要自动封禁的错误码 (默认值,可通过环境变量或配置覆盖) +AUTO_BAN_ERROR_CODES = [403] + +# ====================== 环境变量映射表 ====================== +# 统一维护环境变量名和配置键名的映射关系 +# 格式: "环境变量名": "配置键名" +ENV_MAPPINGS = { + "CREDENTIALS_DIR": "credentials_dir", + "PROXY": "proxy", + "OAUTH_PROXY_URL": "oauth_proxy_url", + "GOOGLEAPIS_PROXY_URL": "googleapis_proxy_url", + "ANTIGRAVITY_API_URL": "antigravity_api_url", + "AUTO_BAN": "auto_ban_enabled", + "AUTO_BAN_ERROR_CODES": "auto_ban_error_codes", + "RETRY_429_MAX_RETRIES": "retry_429_max_retries", + "RETRY_429_ENABLED": "retry_429_enabled", + "RETRY_429_INTERVAL": "retry_429_interval", + "ANTI_TRUNCATION_MAX_ATTEMPTS": "anti_truncation_max_attempts", + "RETURN_THOUGHTS_TO_FRONTEND": "return_thoughts_to_frontend", + "SENSITIVE_WORDS": "sensitive_words", + "SENSITIVE_WORDS_ENABLED": "sensitive_words_enabled", + "IP_WHITELIST": "ip_whitelist", + "IP_WHITELIST_ENABLED": "ip_whitelist_enabled", + "MODEL_REWRITE_ENABLED": "model_rewrite_enabled", + "MODEL_REWRITE_RULES": "model_rewrite_rules", + "USAGE_LOG_ENABLED": "usage_log_enabled", + "REQUEST_LOG_ENABLED": "request_log_enabled", + "REQUEST_LOG_ERROR_CODES": "request_log_error_codes", + "CREDENTIAL_SELECT_MODE": "credential_select_mode", + "HOST": "host", + "PORT": "port", + "API_PASSWORD": "api_password", + "PANEL_PASSWORD": "panel_password", +} + + +# ====================== 配置系统 ====================== + +async def init_config(): + """初始化配置缓存(启动时调用一次)""" + global _config_cache, _config_initialized + + if _config_initialized: + return + + try: + from src.storage.database import get_database + database = await get_database() + _config_cache = await database.get_all_config() + _config_initialized = True + except Exception: + # 初始化失败时使用空缓存 + _config_cache = {} + _config_initialized = True + + +async def reload_config(): + """重新加载配置(修改配置后调用)""" + global _config_cache, _config_initialized + + try: + from src.storage.database import get_database + database = await get_database() + + # 重新加载数据库配置缓存 + await database.reload_config_cache() + + # 重新加载配置缓存 + _config_cache = await database.get_all_config() + _config_initialized = True + except Exception: + pass + + +def _get_cached_config(key: str, default: Any = None) -> Any: + """从内存缓存获取配置(同步)""" + return _config_cache.get(key, default) + + +async def get_config_value(key: str, default: Any = None, env_var: Optional[str] = None) -> Any: + """Get configuration value with priority: ENV > Storage > default.""" + # 确保配置已初始化 + if not _config_initialized: + await init_config() + + # Priority 1: Environment variable + if env_var and os.getenv(env_var): + return os.getenv(env_var) + + # Priority 2: Memory cache + value = _get_cached_config(key) + if value is not None: + return value + + return default + + +# Configuration getters - all async +async def get_proxy_config(): + """Get proxy configuration, validating the URL format. + + Supports http://, https://, socks5://, socks5h:// schemes, all with + optional embedded credentials (user:pass@host:port). + """ + proxy_url = await get_config_value("proxy", env_var="PROXY") + if not proxy_url: + return None + + proxy_url = proxy_url.strip() + scheme = proxy_url.split("://", 1)[0].lower() + if scheme not in ("http", "https", "socks5", "socks5h"): + log.warning( + f"不支持的代理协议: {scheme}://(支持 http/https/socks5/socks5h),已忽略代理" + ) + return None + return proxy_url + + +async def get_auto_ban_enabled() -> bool: + """Get auto ban enabled setting.""" + env_value = os.getenv("AUTO_BAN") + if env_value: + return env_value.lower() in ("true", "1", "yes", "on") + + return bool(await get_config_value("auto_ban_enabled", False)) + + +async def get_auto_ban_error_codes() -> list: + """ + Get auto ban error codes. + + Environment variable: AUTO_BAN_ERROR_CODES (comma-separated, e.g., "400,403") + Database config key: auto_ban_error_codes + Default: [400, 403] + """ + env_value = os.getenv("AUTO_BAN_ERROR_CODES") + if env_value: + try: + return [int(code.strip()) for code in env_value.split(",") if code.strip()] + except ValueError: + pass + + codes = await get_config_value("auto_ban_error_codes") + if codes and isinstance(codes, list): + return codes + return AUTO_BAN_ERROR_CODES + + +async def get_retry_429_max_retries() -> int: + """Get max retries for 429 errors.""" + env_value = os.getenv("RETRY_429_MAX_RETRIES") + if env_value: + try: + return int(env_value) + except ValueError: + pass + + return int(await get_config_value("retry_429_max_retries", 5)) + + +async def get_retry_429_enabled() -> bool: + """Get 429 retry enabled setting.""" + env_value = os.getenv("RETRY_429_ENABLED") + if env_value: + return env_value.lower() in ("true", "1", "yes", "on") + + return bool(await get_config_value("retry_429_enabled", True)) + + +async def get_retry_429_interval() -> float: + """Get 429 retry interval in seconds.""" + env_value = os.getenv("RETRY_429_INTERVAL") + if env_value: + try: + return float(env_value) + except ValueError: + pass + + return float(await get_config_value("retry_429_interval", 1)) + + +async def get_anti_truncation_max_attempts() -> int: + """ + Get maximum attempts for anti-truncation continuation. + + Environment variable: ANTI_TRUNCATION_MAX_ATTEMPTS + Database config key: anti_truncation_max_attempts + Default: 3 + """ + env_value = os.getenv("ANTI_TRUNCATION_MAX_ATTEMPTS") + if env_value: + try: + return int(env_value) + except ValueError: + pass + + return int(await get_config_value("anti_truncation_max_attempts", 3)) + + +# Server Configuration +async def get_server_host() -> str: + """ + Get server host setting. + + Environment variable: HOST + Database config key: host + Default: 0.0.0.0 + """ + return str(await get_config_value("host", "0.0.0.0", "HOST")) + + +async def get_server_port() -> int: + """ + Get server port setting. + + Environment variable: PORT + Database config key: port + Default: 7861 + """ + env_value = os.getenv("PORT") + if env_value: + try: + return int(env_value) + except ValueError: + pass + + return int(await get_config_value("port", 7861)) + + +async def get_api_password() -> str: + """ + Get API password setting for chat endpoints. + + Environment variable: API_PASSWORD + Database config key: api_password + Default: pwd + """ + return str(await get_config_value("api_password", "pwd", "API_PASSWORD")) + + +async def get_panel_password() -> str: + """ + Get panel password setting for web interface. + + Environment variable: PANEL_PASSWORD + Database config key: panel_password + Default: pwd + """ + return str(await get_config_value("panel_password", "pwd", "PANEL_PASSWORD")) + + +async def get_credentials_dir() -> str: + """ + Get credentials directory setting. + + Environment variable: CREDENTIALS_DIR + Database config key: credentials_dir + Default: ./creds + """ + return str(await get_config_value("credentials_dir", "./creds", "CREDENTIALS_DIR")) + +async def get_return_thoughts_to_frontend() -> bool: + """ + Get return thoughts to frontend setting. + + 控制是否将思维链返回到前端。 + 启用后,思维链会在响应中返回;禁用后,思维链会在响应中被过滤掉。 + + Environment variable: RETURN_THOUGHTS_TO_FRONTEND + Database config key: return_thoughts_to_frontend + Default: True + """ + env_value = os.getenv("RETURN_THOUGHTS_TO_FRONTEND") + if env_value: + return env_value.lower() in ("true", "1", "yes", "on") + + return bool(await get_config_value("return_thoughts_to_frontend", True)) + + +# ====================== 敏感词过滤 ====================== + +# 敏感词正则编译缓存: (原始词表指纹, 编译后的 pattern 列表) +_sensitive_words_cache: dict = {"fingerprint": None, "patterns": []} + + +async def get_sensitive_words_enabled() -> bool: + """ + 敏感词过滤开关。 + + Environment variable: SENSITIVE_WORDS_ENABLED + Database config key: sensitive_words_enabled + Default: False + """ + env_value = os.getenv("SENSITIVE_WORDS_ENABLED") + if env_value: + return env_value.lower() in ("true", "1", "yes", "on") + + return bool(await get_config_value("sensitive_words_enabled", False)) + + +async def get_sensitive_words() -> list: + """ + 敏感词列表(支持正则),每行一个;空列表表示不过滤。 + + Environment variable: SENSITIVE_WORDS (逗号或换行分隔) + Database config key: sensitive_words + Default: [] + """ + env_value = os.getenv("SENSITIVE_WORDS") + if env_value: + words = [w.strip() for w in re.split(r"[,\n]", env_value) if w.strip()] + return words + + value = await get_config_value("sensitive_words") + if isinstance(value, list): + return [str(w) for w in value if str(w).strip()] + if isinstance(value, str) and value.strip(): + return [w.strip() for w in re.split(r"[,\n]", value) if w.strip()] + return [] + + +def compile_sensitive_words(words: list): + """ + 编译敏感词为大小写不敏感的正则列表(带缓存)。 + + 每个词按字面量转义后编译(用户输入的是词/短语而非正则语法), + 触发后整词替换为空。支持中文(re.UNICODE 默认开启)。 + + Returns: + 编译后的 Pattern 列表;无效条目跳过并告警。 + """ + fingerprint = tuple(words) + if _sensitive_words_cache["fingerprint"] == fingerprint: + return _sensitive_words_cache["patterns"] + + patterns = [] + for word in words: + word = str(word).strip() + if not word: + continue + try: + patterns.append(re.compile(re.escape(word), re.IGNORECASE | re.UNICODE)) + except re.error as e: + log.warning(f"敏感词编译失败,已跳过: {word!r} ({e})") + + _sensitive_words_cache["fingerprint"] = fingerprint + _sensitive_words_cache["patterns"] = patterns + return patterns + + +def apply_sensitive_word_filter(text: str, patterns) -> str: + """将文本中命中的敏感词(大小写不敏感)替换为空""" + if not text or not patterns: + return text + for pattern in patterns: + text = pattern.sub("", text) + return text + + +async def get_sensitive_word_filter(): + """ + 获取生效的敏感词过滤条件(供请求处理管道调用)。 + + Returns: + (enabled, patterns);未启用时 patterns 为空列表。 + """ + if not await get_sensitive_words_enabled(): + return False, [] + words = await get_sensitive_words() + if not words: + return False, [] + return True, compile_sensitive_words(words) + + +# ====================== IP 白名单 ====================== + +# IP 白名单规则缓存: (原始条目指纹, 解析结果 (rules, invalid)) +_ip_whitelist_cache: dict = {"fingerprint": None, "result": ([], [])} + + +def parse_ip_whitelist_line(line: str): + """ + 解析单条白名单条目为 (lo, hi, version) 网络对象;无效时抛出 ValueError。 + + 支持格式(IPv4 / IPv6): + - 单个 IP: 192.168.1.1 / ::1 + - CIDR 网段: 192.168.1.0/24 / 2001:db8::/32 + - IP 起止范围(- 或 ~ 分隔): 192.168.1.1-192.168.1.100 / ::1-::10 + """ + line = str(line).strip() + if not line: + raise ValueError("空条目") + + for sep in ("~", "-"): + if sep in line: + start_str, _, end_str = line.partition(sep) + if start_str.strip() and end_str.strip(): + start = ipaddress.ip_address(start_str.strip()) + end = ipaddress.ip_address(end_str.strip()) + if start.version != end.version: + raise ValueError(f"起止 IP 版本不一致: {line}") + if int(start) > int(end): + start, end = end, start + return start, end, start.version + + if "/" in line: + net = ipaddress.ip_network(line, strict=False) + return net.network_address, net.broadcast_address, net.version + + addr = ipaddress.ip_address(line) + return addr, addr, addr.version + + +def compile_ip_whitelist(entries: list): + """ + 解析白名单条目列表为规则列表(带缓存)。 + + Returns: + (rules, invalid)——rules 为 [(lo, hi, version), ...],invalid 为解析失败的原始条目。 + """ + fingerprint = tuple(str(e) for e in entries) + if _ip_whitelist_cache["fingerprint"] == fingerprint: + return _ip_whitelist_cache["result"] + + rules = [] + invalid = [] + for entry in entries: + entry = str(entry).strip() + if not entry: + continue + try: + rules.append(parse_ip_whitelist_line(entry)) + except ValueError: + invalid.append(entry) + + result = (rules, invalid) + _ip_whitelist_cache["fingerprint"] = fingerprint + _ip_whitelist_cache["result"] = result + return result + + +def ip_in_whitelist(client_ip: str, rules: list) -> bool: + """判断客户端 IP 是否命中白名单规则(IPv4/IPv6 均支持)""" + if not client_ip: + return False + try: + addr = ipaddress.ip_address(client_ip) + except ValueError: + return False + return any(lo.version == addr.version and lo <= addr <= hi for lo, hi, _ in rules) + + +async def get_ip_whitelist_enabled() -> bool: + """ + IP 白名单开关。 + + Environment variable: IP_WHITELIST_ENABLED + Database config key: ip_whitelist_enabled + Default: False + """ + env_value = os.getenv("IP_WHITELIST_ENABLED") + if env_value: + return env_value.lower() in ("true", "1", "yes", "on") + + return bool(await get_config_value("ip_whitelist_enabled", False)) + + +async def get_ip_whitelist() -> list: + """ + IP 白名单列表,每行一条;空列表表示不限制。 + + 支持单个 IP、CIDR 网段、起止范围(- 或 ~ 分隔),IPv4/IPv6 均可。 + 仅在开关开启时生效,命中白名单以外 IP 的所有请求(面板 + API)将直接返回 403。 + + Environment variable: IP_WHITELIST (逗号或换行分隔) + Database config key: ip_whitelist + Default: [] + """ + env_value = os.getenv("IP_WHITELIST") + if env_value is not None and env_value.strip(): + return [e.strip() for e in re.split(r"[,\n]", env_value) if e.strip()] + + value = await get_config_value("ip_whitelist") + if isinstance(value, list): + return [str(e).strip() for e in value if str(e).strip()] + if isinstance(value, str) and value.strip(): + return [e.strip() for e in re.split(r"[,\n]", value) if e.strip()] + return [] + + +async def get_ip_whitelist_rules(): + """ + 获取生效的 IP 白名单规则(供请求拦截中间件调用)。 + + Returns: + (enabled, rules);开关关闭或白名单为空时不启用限制。 + """ + if not await get_ip_whitelist_enabled(): + return False, [] + entries = await get_ip_whitelist() + if not entries: + return False, [] + rules, invalid = compile_ip_whitelist(entries) + if invalid: + log.warning(f"IP 白名单中存在无效条目(已跳过): {invalid}") + return bool(rules), rules + + +# ====================== 模型名复写 ====================== + +# 模型名复写规则缓存: (指纹, (编译后的规则列表, 无效规则列表)) +_model_rewrite_cache: dict = {"fingerprint": None, "result": ([], [])} + + +async def get_model_rewrite_enabled() -> bool: + """ + 模型名复写开关。 + + Environment variable: MODEL_REWRITE_ENABLED + Database config key: model_rewrite_enabled + Default: False + """ + env_value = os.getenv("MODEL_REWRITE_ENABLED") + if env_value: + return env_value.lower() in ("true", "1", "yes", "on") + + return bool(await get_config_value("model_rewrite_enabled", False)) + + +async def get_model_rewrite_rules_config() -> list: + """ + 模型名复写规则列表,每条为 [pattern, replacement]。 + + pattern 支持正则(对模型名做全匹配搜索,命中任意一处即替换), + replacement 中可使用正则反向引用(如 \\1)。 + + Environment variable: MODEL_REWRITE_RULES (JSON 数组,如 [["gpt-4","gemini-2.5-pro"]];也支持 "pat->rep" 逗号分隔的简化格式) + Database config key: model_rewrite_rules + Default: [] + """ + env_value = os.getenv("MODEL_REWRITE_RULES") + if env_value is not None and env_value.strip(): + parsed = _parse_model_rewrite_rules_value(env_value) + if parsed is not None: + return parsed + + value = await get_config_value("model_rewrite_rules") + return _parse_model_rewrite_rules_value(value) or [] + + +def _parse_model_rewrite_rules_value(value: Any) -> Optional[list]: + """将配置值解析为 [[pattern, replacement], ...];无法解析时返回 None""" + if isinstance(value, list): + rules = [] + for item in value: + if isinstance(item, (list, tuple)) and len(item) == 2 and all(isinstance(x, str) for x in item): + rules.append([item[0], item[1]]) + elif isinstance(item, dict) and isinstance(item.get("pattern"), str) and isinstance(item.get("replacement"), str): + rules.append([item["pattern"], item["replacement"]]) + return rules + if isinstance(value, str) and value.strip(): + # 优先尝试 JSON 数组格式(环境变量推荐格式) + if value.strip().startswith("["): + try: + parsed = json.loads(value) + if isinstance(parsed, list): + inner = _parse_model_rewrite_rules_value(parsed) + if inner is not None: + return inner + except (json.JSONDecodeError, ValueError): + pass + # 兼容 "pat->rep,pat->rep" 简化格式 + rules = [] + for pair in value.split(","): + pair = pair.strip() + if "->" in pair: + pat, _, rep = pair.partition("->") + rules.append([pat.strip(), rep.strip()]) + return rules or None + return None + + +def compile_model_rewrite_rules(rules: list): + """ + 编译复写规则为 (pattern, replacement) 元组列表(带缓存)。 + + Returns: + (compiled, invalid)——invalid 为编译失败的原始规则。 + """ + fingerprint = tuple(tuple(r) for r in rules) + if _model_rewrite_cache["fingerprint"] == fingerprint: + return _model_rewrite_cache["result"] + + compiled = [] + invalid = [] + for rule in rules: + if not (isinstance(rule, (list, tuple)) and len(rule) == 2): + continue + pattern, replacement = rule[0], rule[1] + try: + compiled.append((re.compile(str(pattern)), str(replacement))) + except re.error: + invalid.append(rule) + + result = (compiled, invalid) + _model_rewrite_cache["fingerprint"] = fingerprint + _model_rewrite_cache["result"] = result + return result + + +def rewrite_model_name(model_name: str, compiled_rules: list) -> str: + """ + 按规则顺序应用模型名复写(命中第一条即停止)。 + + 使用 re.sub 全字符串搜索替换;replacement 支持 \\1 等反向引用。 + """ + for pattern, replacement in compiled_rules: + if pattern.search(model_name): + return pattern.sub(replacement, model_name) + return model_name + + +async def get_model_rewrite_filter(): + """ + 获取生效的模型名复写规则(供请求处理管道调用)。 + + Returns: + (enabled, compiled_rules);未启用时 compiled_rules 为空列表。 + """ + if not await get_model_rewrite_enabled(): + return False, [] + rules = await get_model_rewrite_rules_config() + if not rules: + return False, [] + compiled, invalid = compile_model_rewrite_rules(rules) + if invalid: + log.warning(f"模型名复写规则中存在无效正则(已跳过): {invalid}") + return bool(compiled), compiled + + +# ====================== 请求日志 ====================== + +async def get_usage_log_enabled() -> bool: + """ + 请求日志(usage_log)开关。 + + Environment variable: USAGE_LOG_ENABLED + Database config key: usage_log_enabled + Default: True + """ + env_value = os.getenv("USAGE_LOG_ENABLED") + if env_value: + return env_value.lower() in ("true", "1", "yes", "on") + + return bool(await get_config_value("usage_log_enabled", True)) + + +async def get_request_log_enabled() -> bool: + """ + 请求体详细日志开关。 + + Environment variable: REQUEST_LOG_ENABLED + Database config key: request_log_enabled + Default: False + """ + env_value = os.getenv("REQUEST_LOG_ENABLED") + if env_value: + return env_value.lower() in ("true", "1", "yes", "on") + + return bool(await get_config_value("request_log_enabled", False)) + + +async def get_request_log_error_codes() -> list: + """ + 请求体详细日志记录的错误码列表(仅命中时写盘)。 + + Environment variable: REQUEST_LOG_ERROR_CODES (逗号分隔, 如 "400,429") + Database config key: request_log_error_codes + Default: [400] + """ + env_value = os.getenv("REQUEST_LOG_ERROR_CODES") + if env_value: + try: + return [int(code.strip()) for code in env_value.split(",") if code.strip()] + except ValueError: + pass + + codes = await get_config_value("request_log_error_codes") + if codes and isinstance(codes, list): + return codes + return [400] + + +# ====================== 凭证选择模式 ====================== + +# 合法的凭证选择模式 +CREDENTIAL_SELECT_MODES = ("random", "cache", "sticky") + + +async def get_credential_select_mode() -> str: + """ + 凭证选择模式: + - random: 完全随机负载均衡(无亲和) + - cache: 会话缓存匹配(默认)——相同会话内容复用同一凭证,命中上游 prompt cache + - sticky: 凭证粘性——尽量保持同一凭证直到其进入 CD 或被禁用 + + Environment variable: CREDENTIAL_SELECT_MODE + Database config key: credential_select_mode + Default: cache + """ + value = await get_config_value("credential_select_mode", "cache", "CREDENTIAL_SELECT_MODE") + value = str(value).strip().lower() + if value not in CREDENTIAL_SELECT_MODES: + log.warning(f"无效的凭证选择模式: {value},回落为 cache") + return "cache" + return value + + +async def get_oauth_proxy_url() -> str: + """ + Get OAuth proxy URL setting. + + 用于Google OAuth2认证的代理URL。 + + Environment variable: OAUTH_PROXY_URL + Database config key: oauth_proxy_url + Default: https://oauth2.googleapis.com + """ + return str( + await get_config_value( + "oauth_proxy_url", "https://oauth2.googleapis.com", "OAUTH_PROXY_URL" + ) + ) + + +async def get_googleapis_proxy_url() -> str: + """ + Get Google APIs proxy URL setting. + + 用于Google APIs调用的代理URL。 + + Environment variable: GOOGLEAPIS_PROXY_URL + Database config key: googleapis_proxy_url + Default: https://www.googleapis.com + """ + return str( + await get_config_value( + "googleapis_proxy_url", "https://www.googleapis.com", "GOOGLEAPIS_PROXY_URL" + ) + ) + + +async def get_antigravity_api_url() -> str: + """ + Get Antigravity API URL setting. + + 用于Google Antigravity API的URL。 + + Environment variable: ANTIGRAVITY_API_URL + Database config key: antigravity_api_url + Default: https://daily-cloudcode-pa.googleapis.com + """ + return str( + await get_config_value( + "antigravity_api_url", + "https://daily-cloudcode-pa.googleapis.com", + "ANTIGRAVITY_API_URL", + ) + ) diff --git a/agy2api/darwin-install.sh b/agy2api/darwin-install.sh new file mode 100755 index 0000000000000000000000000000000000000000..68be58a23ab8c9e1efb1721a2424c4004408a4e8 --- /dev/null +++ b/agy2api/darwin-install.sh @@ -0,0 +1,55 @@ +#!/bin/bash +# macOS 安装脚本 (支持 Intel 和 Apple Silicon) + +# 确保 Homebrew 已安装 +if ! command -v brew &> /dev/null; then + echo "未检测到 Homebrew,开始安装..." + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + + # 检测 Homebrew 安装路径并设置环境变量 + if [[ -f "/opt/homebrew/bin/brew" ]]; then + # Apple Silicon Mac + eval "$(/opt/homebrew/bin/brew shellenv)" + elif [[ -f "/usr/local/bin/brew" ]]; then + # Intel Mac + eval "$(/usr/local/bin/brew shellenv)" + fi +fi + +# 更新 brew 并安装 git +brew update +brew install git + +# 安装 uv (Python 环境管理工具) +curl -Ls https://astral.sh/uv/install.sh | sh + +# 确保 uv 在 PATH 中 +export PATH="$HOME/.local/bin:$PATH" + +# 克隆或进入项目目录 +if [ -f "./web.py" ]; then + # 已经在目标目录 + : +elif [ -f "./agy2api/web.py" ]; then + cd ./agy2api +else + git clone https://github.com/su-kaka/agy2api.git + cd ./agy2api +fi + +# 拉取最新代码 +git pull + +# 创建并同步虚拟环境 +uv sync + +# 激活虚拟环境 +if [ -f ".venv/bin/activate" ]; then + source .venv/bin/activate +else + echo "❌ 未找到虚拟环境,请检查 uv 是否安装成功" + exit 1 +fi + +# 启动项目 +python3 web.py diff --git a/agy2api/dist/assets/index-CqsIYAIJ.js b/agy2api/dist/assets/index-CqsIYAIJ.js new file mode 100644 index 0000000000000000000000000000000000000000..371d76827d2940fdd45fb4c9b75d09bc4564c8e5 --- /dev/null +++ b/agy2api/dist/assets/index-CqsIYAIJ.js @@ -0,0 +1,249 @@ +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const o of l.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerPolicy&&(l.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?l.credentials="include":s.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(s){if(s.ep)return;s.ep=!0;const l=n(s);fetch(s.href,l)}})();function kp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Nc={exports:{}},Tl={},jc={exports:{}},G={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var cs=Symbol.for("react.element"),Sp=Symbol.for("react.portal"),Np=Symbol.for("react.fragment"),jp=Symbol.for("react.strict_mode"),_p=Symbol.for("react.profiler"),Ep=Symbol.for("react.provider"),Cp=Symbol.for("react.context"),bp=Symbol.for("react.forward_ref"),Op=Symbol.for("react.suspense"),Rp=Symbol.for("react.memo"),Pp=Symbol.for("react.lazy"),Ma=Symbol.iterator;function Tp(e){return e===null||typeof e!="object"?null:(e=Ma&&e[Ma]||e["@@iterator"],typeof e=="function"?e:null)}var _c={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Ec=Object.assign,Cc={};function pr(e,t,n){this.props=e,this.context=t,this.refs=Cc,this.updater=n||_c}pr.prototype.isReactComponent={};pr.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};pr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function bc(){}bc.prototype=pr.prototype;function Di(e,t,n){this.props=e,this.context=t,this.refs=Cc,this.updater=n||_c}var Fi=Di.prototype=new bc;Fi.constructor=Di;Ec(Fi,pr.prototype);Fi.isPureReactComponent=!0;var Ia=Array.isArray,Oc=Object.prototype.hasOwnProperty,Mi={current:null},Rc={key:!0,ref:!0,__self:!0,__source:!0};function Pc(e,t,n){var r,s={},l=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(l=""+t.key),t)Oc.call(t,r)&&!Rc.hasOwnProperty(r)&&(s[r]=t[r]);var a=arguments.length-2;if(a===1)s.children=n;else if(1>>1,Q=A[H];if(0>>1;Hs(Pe,L))Ps(X,Pe)?(A[H]=X,A[P]=L,H=P):(A[H]=Pe,A[ee]=L,H=ee);else if(Ps(X,L))A[H]=X,A[P]=L,H=P;else break e}}return F}function s(A,F){var L=A.sortIndex-F.sortIndex;return L!==0?L:A.id-F.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var u=[],c=[],m=1,g=null,y=3,v=!1,N=!1,w=!1,T=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,f=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function d(A){for(var F=n(c);F!==null;){if(F.callback===null)r(c);else if(F.startTime<=A)r(c),F.sortIndex=F.expirationTime,t(u,F);else break;F=n(c)}}function h(A){if(w=!1,d(A),!N)if(n(u)!==null)N=!0,B(k);else{var F=n(c);F!==null&&Fe(h,F.startTime-A)}}function k(A,F){N=!1,w&&(w=!1,x(_),_=-1),v=!0;var L=y;try{for(d(F),g=n(u);g!==null&&(!(g.expirationTime>F)||A&&!$());){var H=g.callback;if(typeof H=="function"){g.callback=null,y=g.priorityLevel;var Q=H(g.expirationTime<=F);F=e.unstable_now(),typeof Q=="function"?g.callback=Q:g===n(u)&&r(u),d(F)}else r(u);g=n(u)}if(g!==null)var ge=!0;else{var ee=n(c);ee!==null&&Fe(h,ee.startTime-F),ge=!1}return ge}finally{g=null,y=L,v=!1}}var S=!1,E=null,_=-1,M=5,O=-1;function $(){return!(e.unstable_now()-OA||125H?(A.sortIndex=L,t(c,A),n(u)===null&&A===n(c)&&(w?(x(_),_=-1):w=!0,Fe(h,L-H))):(A.sortIndex=Q,t(u,A),N||v||(N=!0,B(k))),A},e.unstable_shouldYield=$,e.unstable_wrapCallback=function(A){var F=y;return function(){var L=y;y=F;try{return A.apply(this,arguments)}finally{y=L}}}})(Dc);Lc.exports=Dc;var Vp=Lc.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Wp=b,tt=Vp;function C(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Lo=Object.prototype.hasOwnProperty,qp=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,$a={},Ba={};function Qp(e){return Lo.call(Ba,e)?!0:Lo.call($a,e)?!1:qp.test(e)?Ba[e]=!0:($a[e]=!0,!1)}function Kp(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Gp(e,t,n,r){if(t===null||typeof t>"u"||Kp(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function He(e,t,n,r,s,l,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=l,this.removeEmptyString=o}var Re={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Re[e]=new He(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Re[t]=new He(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Re[e]=new He(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Re[e]=new He(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Re[e]=new He(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Re[e]=new He(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Re[e]=new He(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Re[e]=new He(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Re[e]=new He(e,5,!1,e.toLowerCase(),null,!1,!1)});var Ui=/[\-:]([a-z])/g;function $i(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Ui,$i);Re[t]=new He(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Ui,$i);Re[t]=new He(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Ui,$i);Re[t]=new He(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Re[e]=new He(e,1,!1,e.toLowerCase(),null,!1,!1)});Re.xlinkHref=new He("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Re[e]=new He(e,1,!1,e.toLowerCase(),null,!0,!0)});function Bi(e,t,n,r){var s=Re.hasOwnProperty(t)?Re[t]:null;(s!==null?s.type!==0:r||!(2a||s[o]!==l[a]){var u=` +`+s[o].replace(" at new "," at ");return e.displayName&&u.includes("")&&(u=u.replace("",e.displayName)),u}while(1<=o&&0<=a);break}}}finally{eo=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Tr(e):""}function Jp(e){switch(e.tag){case 5:return Tr(e.type);case 16:return Tr("Lazy");case 13:return Tr("Suspense");case 19:return Tr("SuspenseList");case 0:case 2:case 15:return e=to(e.type,!1),e;case 11:return e=to(e.type.render,!1),e;case 1:return e=to(e.type,!0),e;default:return""}}function Io(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case $n:return"Fragment";case Un:return"Portal";case Do:return"Profiler";case Hi:return"StrictMode";case Fo:return"Suspense";case Mo:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Ic:return(e.displayName||"Context")+".Consumer";case Mc:return(e._context.displayName||"Context")+".Provider";case Vi:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Wi:return t=e.displayName||null,t!==null?t:Io(e.type)||"Memo";case Wt:t=e._payload,e=e._init;try{return Io(e(t))}catch{}}return null}function Xp(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Io(t);case 8:return t===Hi?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function on(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function $c(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Yp(e){var t=$c(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,l=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(o){r=""+o,l.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function js(e){e._valueTracker||(e._valueTracker=Yp(e))}function Bc(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=$c(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function sl(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Uo(e,t){var n=t.checked;return pe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Va(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=on(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Hc(e,t){t=t.checked,t!=null&&Bi(e,"checked",t,!1)}function $o(e,t){Hc(e,t);var n=on(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Bo(e,t.type,n):t.hasOwnProperty("defaultValue")&&Bo(e,t.type,on(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Wa(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Bo(e,t,n){(t!=="number"||sl(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ar=Array.isArray;function Yn(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s"+t.valueOf().toString()+"",t=_s.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Qr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Dr={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Zp=["Webkit","ms","Moz","O"];Object.keys(Dr).forEach(function(e){Zp.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Dr[t]=Dr[e]})});function Qc(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Dr.hasOwnProperty(e)&&Dr[e]?(""+t).trim():t+"px"}function Kc(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=Qc(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var em=pe({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Wo(e,t){if(t){if(em[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(C(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(C(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(C(61))}if(t.style!=null&&typeof t.style!="object")throw Error(C(62))}}function qo(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Qo=null;function qi(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ko=null,Zn=null,er=null;function Ka(e){if(e=ps(e)){if(typeof Ko!="function")throw Error(C(280));var t=e.stateNode;t&&(t=Fl(t),Ko(e.stateNode,e.type,t))}}function Gc(e){Zn?er?er.push(e):er=[e]:Zn=e}function Jc(){if(Zn){var e=Zn,t=er;if(er=Zn=null,Ka(e),t)for(e=0;e>>=0,e===0?32:31-(dm(e)/fm|0)|0}var Es=64,Cs=4194304;function zr(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function al(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,l=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~s;a!==0?r=zr(a):(l&=o,l!==0&&(r=zr(l)))}else o=n&~s,o!==0?r=zr(o):l!==0&&(r=zr(l));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,l=t&-t,s>=l||s===16&&(l&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function ds(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-vt(t),e[t]=n}function ym(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Mr),ru=" ",su=!1;function yd(e,t){switch(e){case"keyup":return Vm.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function gd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Bn=!1;function qm(e,t){switch(e){case"compositionend":return gd(t);case"keypress":return t.which!==32?null:(su=!0,ru);case"textInput":return e=t.data,e===ru&&su?null:e;default:return null}}function Qm(e,t){if(Bn)return e==="compositionend"||!ea&&yd(e,t)?(e=md(),Vs=Xi=Jt=null,Bn=!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:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=au(n)}}function kd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?kd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Sd(){for(var e=window,t=sl();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=sl(e.document)}return t}function ta(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")}function nh(e){var t=Sd(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&kd(n.ownerDocument.documentElement,n)){if(r!==null&&ta(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=n.textContent.length,l=Math.min(r.start,s);r=r.end===void 0?l:Math.min(r.end,s),!e.extend&&l>r&&(s=r,r=l,l=s),s=uu(n,l);var o=uu(n,r);s&&o&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),l>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Hn=null,ei=null,Ur=null,ti=!1;function cu(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ti||Hn==null||Hn!==sl(r)||(r=Hn,"selectionStart"in r&&ta(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Ur&&Zr(Ur,r)||(Ur=r,r=dl(ei,"onSelect"),0qn||(e.current=ii[qn],ii[qn]=null,qn--)}function oe(e,t){qn++,ii[qn]=e.current,e.current=t}var an={},De=dn(an),Qe=dn(!1),Nn=an;function ir(e,t){var n=e.type.contextTypes;if(!n)return an;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},l;for(l in n)s[l]=t[l];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function Ke(e){return e=e.childContextTypes,e!=null}function pl(){ue(Qe),ue(De)}function gu(e,t,n){if(De.current!==an)throw Error(C(168));oe(De,t),oe(Qe,n)}function Pd(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(C(108,Xp(e)||"Unknown",s));return pe({},n,r)}function ml(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||an,Nn=De.current,oe(De,e),oe(Qe,Qe.current),!0}function xu(e,t,n){var r=e.stateNode;if(!r)throw Error(C(169));n?(e=Pd(e,t,Nn),r.__reactInternalMemoizedMergedChildContext=e,ue(Qe),ue(De),oe(De,e)):ue(Qe),oe(Qe,n)}var Tt=null,Ml=!1,yo=!1;function Td(e){Tt===null?Tt=[e]:Tt.push(e)}function mh(e){Ml=!0,Td(e)}function fn(){if(!yo&&Tt!==null){yo=!0;var e=0,t=ne;try{var n=Tt;for(ne=1;e>=o,s-=o,At=1<<32-vt(t)+s|n<_?(M=E,E=null):M=E.sibling;var O=y(x,E,d[_],h);if(O===null){E===null&&(E=M);break}e&&E&&O.alternate===null&&t(x,E),f=l(O,f,_),S===null?k=O:S.sibling=O,S=O,E=M}if(_===d.length)return n(x,E),ce&&mn(x,_),k;if(E===null){for(;__?(M=E,E=null):M=E.sibling;var $=y(x,E,O.value,h);if($===null){E===null&&(E=M);break}e&&E&&$.alternate===null&&t(x,E),f=l($,f,_),S===null?k=$:S.sibling=$,S=$,E=M}if(O.done)return n(x,E),ce&&mn(x,_),k;if(E===null){for(;!O.done;_++,O=d.next())O=g(x,O.value,h),O!==null&&(f=l(O,f,_),S===null?k=O:S.sibling=O,S=O);return ce&&mn(x,_),k}for(E=r(x,E);!O.done;_++,O=d.next())O=v(E,x,_,O.value,h),O!==null&&(e&&O.alternate!==null&&E.delete(O.key===null?_:O.key),f=l(O,f,_),S===null?k=O:S.sibling=O,S=O);return e&&E.forEach(function(K){return t(x,K)}),ce&&mn(x,_),k}function T(x,f,d,h){if(typeof d=="object"&&d!==null&&d.type===$n&&d.key===null&&(d=d.props.children),typeof d=="object"&&d!==null){switch(d.$$typeof){case Ns:e:{for(var k=d.key,S=f;S!==null;){if(S.key===k){if(k=d.type,k===$n){if(S.tag===7){n(x,S.sibling),f=s(S,d.props.children),f.return=x,x=f;break e}}else if(S.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Wt&&ku(k)===S.type){n(x,S.sibling),f=s(S,d.props),f.ref=_r(x,S,d),f.return=x,x=f;break e}n(x,S);break}else t(x,S);S=S.sibling}d.type===$n?(f=kn(d.props.children,x.mode,h,d.key),f.return=x,x=f):(h=Ys(d.type,d.key,d.props,null,x.mode,h),h.ref=_r(x,f,d),h.return=x,x=h)}return o(x);case Un:e:{for(S=d.key;f!==null;){if(f.key===S)if(f.tag===4&&f.stateNode.containerInfo===d.containerInfo&&f.stateNode.implementation===d.implementation){n(x,f.sibling),f=s(f,d.children||[]),f.return=x,x=f;break e}else{n(x,f);break}else t(x,f);f=f.sibling}f=jo(d,x.mode,h),f.return=x,x=f}return o(x);case Wt:return S=d._init,T(x,f,S(d._payload),h)}if(Ar(d))return N(x,f,d,h);if(wr(d))return w(x,f,d,h);zs(x,d)}return typeof d=="string"&&d!==""||typeof d=="number"?(d=""+d,f!==null&&f.tag===6?(n(x,f.sibling),f=s(f,d),f.return=x,x=f):(n(x,f),f=No(d,x.mode,h),f.return=x,x=f),o(x)):n(x,f)}return T}var ur=Dd(!0),Fd=Dd(!1),gl=dn(null),xl=null,Gn=null,la=null;function oa(){la=Gn=xl=null}function ia(e){var t=gl.current;ue(gl),e._currentValue=t}function ci(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function nr(e,t){xl=e,la=Gn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(qe=!0),e.firstContext=null)}function ct(e){var t=e._currentValue;if(la!==e)if(e={context:e,memoizedValue:t,next:null},Gn===null){if(xl===null)throw Error(C(308));Gn=e,xl.dependencies={lanes:0,firstContext:e}}else Gn=Gn.next=e;return t}var gn=null;function aa(e){gn===null?gn=[e]:gn.push(e)}function Md(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,aa(t)):(n.next=s.next,s.next=n),t.interleaved=n,Mt(e,r)}function Mt(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var qt=!1;function ua(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Id(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Lt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function nn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Z&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,Mt(e,n)}return s=r.interleaved,s===null?(t.next=t,aa(r)):(t.next=s.next,s.next=t),r.interleaved=t,Mt(e,n)}function qs(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ki(e,n)}}function Su(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,l=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};l===null?s=l=o:l=l.next=o,n=n.next}while(n!==null);l===null?s=l=t:l=l.next=t}else s=l=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:l,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function vl(e,t,n,r){var s=e.updateQueue;qt=!1;var l=s.firstBaseUpdate,o=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var u=a,c=u.next;u.next=null,o===null?l=c:o.next=c,o=u;var m=e.alternate;m!==null&&(m=m.updateQueue,a=m.lastBaseUpdate,a!==o&&(a===null?m.firstBaseUpdate=c:a.next=c,m.lastBaseUpdate=u))}if(l!==null){var g=s.baseState;o=0,m=c=u=null,a=l;do{var y=a.lane,v=a.eventTime;if((r&y)===y){m!==null&&(m=m.next={eventTime:v,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var N=e,w=a;switch(y=t,v=n,w.tag){case 1:if(N=w.payload,typeof N=="function"){g=N.call(v,g,y);break e}g=N;break e;case 3:N.flags=N.flags&-65537|128;case 0:if(N=w.payload,y=typeof N=="function"?N.call(v,g,y):N,y==null)break e;g=pe({},g,y);break e;case 2:qt=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,y=s.effects,y===null?s.effects=[a]:y.push(a))}else v={eventTime:v,lane:y,tag:a.tag,payload:a.payload,callback:a.callback,next:null},m===null?(c=m=v,u=g):m=m.next=v,o|=y;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;y=a,a=y.next,y.next=null,s.lastBaseUpdate=y,s.shared.pending=null}}while(!0);if(m===null&&(u=g),s.baseState=u,s.firstBaseUpdate=c,s.lastBaseUpdate=m,t=s.shared.interleaved,t!==null){s=t;do o|=s.lane,s=s.next;while(s!==t)}else l===null&&(s.shared.lanes=0);En|=o,e.lanes=o,e.memoizedState=g}}function Nu(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=xo.transition;xo.transition={};try{e(!1),t()}finally{ne=n,xo.transition=r}}function nf(){return dt().memoizedState}function xh(e,t,n){var r=sn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},rf(e))sf(t,n);else if(n=Md(e,t,n,r),n!==null){var s=$e();wt(n,e,r,s),lf(n,t,r)}}function vh(e,t,n){var r=sn(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(rf(e))sf(t,s);else{var l=e.alternate;if(e.lanes===0&&(l===null||l.lanes===0)&&(l=t.lastRenderedReducer,l!==null))try{var o=t.lastRenderedState,a=l(o,n);if(s.hasEagerState=!0,s.eagerState=a,St(a,o)){var u=t.interleaved;u===null?(s.next=s,aa(t)):(s.next=u.next,u.next=s),t.interleaved=s;return}}catch{}finally{}n=Md(e,t,s,r),n!==null&&(s=$e(),wt(n,e,r,s),lf(n,t,r))}}function rf(e){var t=e.alternate;return e===fe||t!==null&&t===fe}function sf(e,t){$r=kl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function lf(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ki(e,n)}}var Sl={readContext:ct,useCallback:Ae,useContext:Ae,useEffect:Ae,useImperativeHandle:Ae,useInsertionEffect:Ae,useLayoutEffect:Ae,useMemo:Ae,useReducer:Ae,useRef:Ae,useState:Ae,useDebugValue:Ae,useDeferredValue:Ae,useTransition:Ae,useMutableSource:Ae,useSyncExternalStore:Ae,useId:Ae,unstable_isNewReconciler:!1},wh={readContext:ct,useCallback:function(e,t){return _t().memoizedState=[e,t===void 0?null:t],e},useContext:ct,useEffect:_u,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Ks(4194308,4,Xd.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ks(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ks(4,2,e,t)},useMemo:function(e,t){var n=_t();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=_t();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=xh.bind(null,fe,e),[r.memoizedState,e]},useRef:function(e){var t=_t();return e={current:e},t.memoizedState=e},useState:ju,useDebugValue:ga,useDeferredValue:function(e){return _t().memoizedState=e},useTransition:function(){var e=ju(!1),t=e[0];return e=gh.bind(null,e[1]),_t().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=fe,s=_t();if(ce){if(n===void 0)throw Error(C(407));n=n()}else{if(n=t(),Ce===null)throw Error(C(349));_n&30||Hd(r,t,n)}s.memoizedState=n;var l={value:n,getSnapshot:t};return s.queue=l,_u(Wd.bind(null,r,l,e),[e]),r.flags|=2048,is(9,Vd.bind(null,r,l,n,t),void 0,null),n},useId:function(){var e=_t(),t=Ce.identifierPrefix;if(ce){var n=zt,r=At;n=(r&~(1<<32-vt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ls++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[Et]=t,e[ns]=r,yf(e,t,!1,!1),t.stateNode=e;e:{switch(o=qo(n,r),n){case"dialog":ae("cancel",e),ae("close",e),s=r;break;case"iframe":case"object":case"embed":ae("load",e),s=r;break;case"video":case"audio":for(s=0;sfr&&(t.flags|=128,r=!0,Er(l,!1),t.lanes=4194304)}else{if(!r)if(e=wl(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Er(l,!0),l.tail===null&&l.tailMode==="hidden"&&!o.alternate&&!ce)return ze(t),null}else 2*he()-l.renderingStartTime>fr&&n!==1073741824&&(t.flags|=128,r=!0,Er(l,!1),t.lanes=4194304);l.isBackwards?(o.sibling=t.child,t.child=o):(n=l.last,n!==null?n.sibling=o:t.child=o,l.last=o)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=he(),t.sibling=null,n=de.current,oe(de,r?n&1|2:n&1),t):(ze(t),null);case 22:case 23:return Na(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Ye&1073741824&&(ze(t),t.subtreeFlags&6&&(t.flags|=8192)):ze(t),null;case 24:return null;case 25:return null}throw Error(C(156,t.tag))}function bh(e,t){switch(ra(t),t.tag){case 1:return Ke(t.type)&&pl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return cr(),ue(Qe),ue(De),fa(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return da(t),null;case 13:if(ue(de),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(C(340));ar()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ue(de),null;case 4:return cr(),null;case 10:return ia(t.type._context),null;case 22:case 23:return Na(),null;case 24:return null;default:return null}}var Ds=!1,Le=!1,Oh=typeof WeakSet=="function"?WeakSet:Set,z=null;function Jn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){me(e,t,r)}else n.current=null}function vi(e,t,n){try{n()}catch(r){me(e,t,r)}}var Du=!1;function Rh(e,t){if(ni=ul,e=Sd(),ta(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,l=r.focusNode;r=r.focusOffset;try{n.nodeType,l.nodeType}catch{n=null;break e}var o=0,a=-1,u=-1,c=0,m=0,g=e,y=null;t:for(;;){for(var v;g!==n||s!==0&&g.nodeType!==3||(a=o+s),g!==l||r!==0&&g.nodeType!==3||(u=o+r),g.nodeType===3&&(o+=g.nodeValue.length),(v=g.firstChild)!==null;)y=g,g=v;for(;;){if(g===e)break t;if(y===n&&++c===s&&(a=o),y===l&&++m===r&&(u=o),(v=g.nextSibling)!==null)break;g=y,y=g.parentNode}g=v}n=a===-1||u===-1?null:{start:a,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(ri={focusedElem:e,selectionRange:n},ul=!1,z=t;z!==null;)if(t=z,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,z=e;else for(;z!==null;){t=z;try{var N=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(N!==null){var w=N.memoizedProps,T=N.memoizedState,x=t.stateNode,f=x.getSnapshotBeforeUpdate(t.elementType===t.type?w:yt(t.type,w),T);x.__reactInternalSnapshotBeforeUpdate=f}break;case 3:var d=t.stateNode.containerInfo;d.nodeType===1?d.textContent="":d.nodeType===9&&d.documentElement&&d.removeChild(d.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(C(163))}}catch(h){me(t,t.return,h)}if(e=t.sibling,e!==null){e.return=t.return,z=e;break}z=t.return}return N=Du,Du=!1,N}function Br(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var l=s.destroy;s.destroy=void 0,l!==void 0&&vi(t,n,l)}s=s.next}while(s!==r)}}function $l(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function wi(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function vf(e){var t=e.alternate;t!==null&&(e.alternate=null,vf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Et],delete t[ns],delete t[oi],delete t[fh],delete t[ph])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function wf(e){return e.tag===5||e.tag===3||e.tag===4}function Fu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||wf(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.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 ki(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=fl));else if(r!==4&&(e=e.child,e!==null))for(ki(e,t,n),e=e.sibling;e!==null;)ki(e,t,n),e=e.sibling}function Si(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Si(e,t,n),e=e.sibling;e!==null;)Si(e,t,n),e=e.sibling}var be=null,gt=!1;function Ht(e,t,n){for(n=n.child;n!==null;)kf(e,t,n),n=n.sibling}function kf(e,t,n){if(bt&&typeof bt.onCommitFiberUnmount=="function")try{bt.onCommitFiberUnmount(Al,n)}catch{}switch(n.tag){case 5:Le||Jn(n,t);case 6:var r=be,s=gt;be=null,Ht(e,t,n),be=r,gt=s,be!==null&&(gt?(e=be,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):be.removeChild(n.stateNode));break;case 18:be!==null&&(gt?(e=be,n=n.stateNode,e.nodeType===8?ho(e.parentNode,n):e.nodeType===1&&ho(e,n),Xr(e)):ho(be,n.stateNode));break;case 4:r=be,s=gt,be=n.stateNode.containerInfo,gt=!0,Ht(e,t,n),be=r,gt=s;break;case 0:case 11:case 14:case 15:if(!Le&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var l=s,o=l.destroy;l=l.tag,o!==void 0&&(l&2||l&4)&&vi(n,t,o),s=s.next}while(s!==r)}Ht(e,t,n);break;case 1:if(!Le&&(Jn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){me(n,t,a)}Ht(e,t,n);break;case 21:Ht(e,t,n);break;case 22:n.mode&1?(Le=(r=Le)||n.memoizedState!==null,Ht(e,t,n),Le=r):Ht(e,t,n);break;default:Ht(e,t,n)}}function Mu(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Oh),t.forEach(function(r){var s=Ih.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function ht(e,t){var n=t.deletions;if(n!==null)for(var r=0;rs&&(s=o),r&=~l}if(r=s,r=he()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Th(r/1960))-r,10e?16:e,Xt===null)var r=!1;else{if(e=Xt,Xt=null,_l=0,Z&6)throw Error(C(331));var s=Z;for(Z|=4,z=e.current;z!==null;){var l=z,o=l.child;if(z.flags&16){var a=l.deletions;if(a!==null){for(var u=0;uhe()-ka?wn(e,0):wa|=n),Ge(e,t)}function Of(e,t){t===0&&(e.mode&1?(t=Cs,Cs<<=1,!(Cs&130023424)&&(Cs=4194304)):t=1);var n=$e();e=Mt(e,t),e!==null&&(ds(e,t,n),Ge(e,n))}function Mh(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Of(e,n)}function Ih(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(C(314))}r!==null&&r.delete(t),Of(e,n)}var Rf;Rf=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Qe.current)qe=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return qe=!1,Eh(e,t,n);qe=!!(e.flags&131072)}else qe=!1,ce&&t.flags&1048576&&Ad(t,yl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Gs(e,t),e=t.pendingProps;var s=ir(t,De.current);nr(t,n),s=ma(null,t,r,e,s,n);var l=ha();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ke(r)?(l=!0,ml(t)):l=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,ua(t),s.updater=Ul,t.stateNode=s,s._reactInternals=t,fi(t,r,e,n),t=hi(null,t,r,!0,l,n)):(t.tag=0,ce&&l&&na(t),Ue(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Gs(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=$h(r),e=yt(r,e),s){case 0:t=mi(null,t,r,e,n);break e;case 1:t=Au(null,t,r,e,n);break e;case 11:t=Pu(null,t,r,e,n);break e;case 14:t=Tu(null,t,r,yt(r.type,e),n);break e}throw Error(C(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:yt(r,s),mi(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:yt(r,s),Au(e,t,r,s,n);case 3:e:{if(pf(t),e===null)throw Error(C(387));r=t.pendingProps,l=t.memoizedState,s=l.element,Id(e,t),vl(t,r,null,n);var o=t.memoizedState;if(r=o.element,l.isDehydrated)if(l={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=l,t.memoizedState=l,t.flags&256){s=dr(Error(C(423)),t),t=zu(e,t,r,n,s);break e}else if(r!==s){s=dr(Error(C(424)),t),t=zu(e,t,r,n,s);break e}else for(Ze=tn(t.stateNode.containerInfo.firstChild),et=t,ce=!0,xt=null,n=Fd(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ar(),r===s){t=It(e,t,n);break e}Ue(e,t,r,n)}t=t.child}return t;case 5:return Ud(t),e===null&&ui(t),r=t.type,s=t.pendingProps,l=e!==null?e.memoizedProps:null,o=s.children,si(r,s)?o=null:l!==null&&si(r,l)&&(t.flags|=32),ff(e,t),Ue(e,t,o,n),t.child;case 6:return e===null&&ui(t),null;case 13:return mf(e,t,n);case 4:return ca(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ur(t,null,r,n):Ue(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:yt(r,s),Pu(e,t,r,s,n);case 7:return Ue(e,t,t.pendingProps,n),t.child;case 8:return Ue(e,t,t.pendingProps.children,n),t.child;case 12:return Ue(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,l=t.memoizedProps,o=s.value,oe(gl,r._currentValue),r._currentValue=o,l!==null)if(St(l.value,o)){if(l.children===s.children&&!Qe.current){t=It(e,t,n);break e}}else for(l=t.child,l!==null&&(l.return=t);l!==null;){var a=l.dependencies;if(a!==null){o=l.child;for(var u=a.firstContext;u!==null;){if(u.context===r){if(l.tag===1){u=Lt(-1,n&-n),u.tag=2;var c=l.updateQueue;if(c!==null){c=c.shared;var m=c.pending;m===null?u.next=u:(u.next=m.next,m.next=u),c.pending=u}}l.lanes|=n,u=l.alternate,u!==null&&(u.lanes|=n),ci(l.return,n,t),a.lanes|=n;break}u=u.next}}else if(l.tag===10)o=l.type===t.type?null:l.child;else if(l.tag===18){if(o=l.return,o===null)throw Error(C(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),ci(o,n,t),o=l.sibling}else o=l.child;if(o!==null)o.return=l;else for(o=l;o!==null;){if(o===t){o=null;break}if(l=o.sibling,l!==null){l.return=o.return,o=l;break}o=o.return}l=o}Ue(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,nr(t,n),s=ct(s),r=r(s),t.flags|=1,Ue(e,t,r,n),t.child;case 14:return r=t.type,s=yt(r,t.pendingProps),s=yt(r.type,s),Tu(e,t,r,s,n);case 15:return cf(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:yt(r,s),Gs(e,t),t.tag=1,Ke(r)?(e=!0,ml(t)):e=!1,nr(t,n),of(t,r,s),fi(t,r,s,n),hi(null,t,r,!0,e,n);case 19:return hf(e,t,n);case 22:return df(e,t,n)}throw Error(C(156,t.tag))};function Pf(e,t){return rd(e,t)}function Uh(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function at(e,t,n,r){return new Uh(e,t,n,r)}function _a(e){return e=e.prototype,!(!e||!e.isReactComponent)}function $h(e){if(typeof e=="function")return _a(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Vi)return 11;if(e===Wi)return 14}return 2}function ln(e,t){var n=e.alternate;return n===null?(n=at(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Ys(e,t,n,r,s,l){var o=2;if(r=e,typeof e=="function")_a(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case $n:return kn(n.children,s,l,t);case Hi:o=8,s|=8;break;case Do:return e=at(12,n,t,s|2),e.elementType=Do,e.lanes=l,e;case Fo:return e=at(13,n,t,s),e.elementType=Fo,e.lanes=l,e;case Mo:return e=at(19,n,t,s),e.elementType=Mo,e.lanes=l,e;case Uc:return Hl(n,s,l,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Mc:o=10;break e;case Ic:o=9;break e;case Vi:o=11;break e;case Wi:o=14;break e;case Wt:o=16,r=null;break e}throw Error(C(130,e==null?e:typeof e,""))}return t=at(o,n,t,s),t.elementType=e,t.type=r,t.lanes=l,t}function kn(e,t,n,r){return e=at(7,e,r,t),e.lanes=n,e}function Hl(e,t,n,r){return e=at(22,e,r,t),e.elementType=Uc,e.lanes=n,e.stateNode={isHidden:!1},e}function No(e,t,n){return e=at(6,e,null,t),e.lanes=n,e}function jo(e,t,n){return t=at(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Bh(e,t,n,r,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ro(0),this.expirationTimes=ro(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ro(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Ea(e,t,n,r,s,l,o,a,u){return e=new Bh(e,t,n,a,u),t===1?(t=1,l===!0&&(t|=8)):t=0,l=at(3,null,null,t),e.current=l,l.stateNode=e,l.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},ua(l),e}function Hh(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Lf)}catch(e){console.error(e)}}Lf(),zc.exports=nt;var Kh=zc.exports,qu=Kh;zo.createRoot=qu.createRoot,zo.hydrateRoot=qu.hydrateRoot;/** + * @license lucide-react v0.294.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var Gh={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + * @license lucide-react v0.294.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Jh=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),Y=(e,t)=>{const n=b.forwardRef(({color:r="currentColor",size:s=24,strokeWidth:l=2,absoluteStrokeWidth:o,className:a="",children:u,...c},m)=>b.createElement("svg",{ref:m,...Gh,width:s,height:s,stroke:r,strokeWidth:o?Number(l)*24/Number(s):l,className:["lucide",`lucide-${Jh(e)}`,a].join(" "),...c},[...t.map(([g,y])=>b.createElement(g,y)),...Array.isArray(u)?u:[u]]));return n.displayName=`${e}`,n};/** + * @license lucide-react v0.294.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ci=Y("AlertCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** + * @license lucide-react v0.294.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Xh=Y("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** + * @license lucide-react v0.294.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Qu=Y("Ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]);/** + * @license lucide-react v0.294.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Df=Y("BarChart3",[["path",{d:"M3 3v18h18",key:"1s2lah"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/** + * @license lucide-react v0.294.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const sr=Y("CheckCircle",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/** + * @license lucide-react v0.294.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ff=Y("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** + * @license lucide-react v0.294.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Mf=Y("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** + * @license lucide-react v0.294.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const bi=Y("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** + * @license lucide-react v0.294.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Yh=Y("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** + * @license lucide-react v0.294.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const If=Y("Cpu",[["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"9",y:"9",width:"6",height:"6",key:"o3kz5p"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/** + * @license lucide-react v0.294.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Zh=Y("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/** + * @license lucide-react v0.294.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ku=Y("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/** + * @license lucide-react v0.294.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Uf=Y("ExternalLink",[["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}],["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["line",{x1:"10",x2:"21",y1:"14",y2:"3",key:"18c3s4"}]]);/** + * @license lucide-react v0.294.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const e0=Y("EyeOff",[["path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24",key:"1jxqfv"}],["path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68",key:"9wicm4"}],["path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61",key:"1jreej"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]);/** + * @license lucide-react v0.294.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const t0=Y("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** + * @license lucide-react v0.294.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const n0=Y("FileJson",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]]);/** + * @license lucide-react v0.294.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const r0=Y("FileText",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["line",{x1:"16",x2:"8",y1:"13",y2:"13",key:"14keom"}],["line",{x1:"16",x2:"8",y1:"17",y2:"17",key:"17nazh"}],["line",{x1:"10",x2:"8",y1:"9",y2:"9",key:"1a5vjj"}]]);/** + * @license lucide-react v0.294.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const s0=Y("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);/** + * @license lucide-react v0.294.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Wr=Y("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** + * @license lucide-react v0.294.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const l0=Y("KeyRound",[["path",{d:"M2 18v3c0 .6.4 1 1 1h4v-3h3v-3h2l1.4-1.4a6.5 6.5 0 1 0-4-4Z",key:"167ctg"}],["circle",{cx:"16.5",cy:"7.5",r:".5",key:"1kog09"}]]);/** + * @license lucide-react v0.294.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const kt=Y("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** + * @license lucide-react v0.294.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const o0=Y("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** + * @license lucide-react v0.294.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const i0=Y("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** + * @license lucide-react v0.294.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Gt=Y("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** + * @license lucide-react v0.294.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const us=Y("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);/** + * @license lucide-react v0.294.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const a0=Y("Save",[["path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z",key:"1owoqh"}],["polyline",{points:"17 21 17 13 7 13 7 21",key:"1md35c"}],["polyline",{points:"7 3 7 8 15 8",key:"8nz8an"}]]);/** + * @license lucide-react v0.294.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const u0=Y("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** + * @license lucide-react v0.294.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const c0=Y("Shield",[["path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10",key:"1irkt0"}]]);/** + * @license lucide-react v0.294.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const d0=Y("Snowflake",[["line",{x1:"2",x2:"22",y1:"12",y2:"12",key:"1dnqot"}],["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"m20 16-4-4 4-4",key:"rquw4f"}],["path",{d:"m4 8 4 4-4 4",key:"12s3z9"}],["path",{d:"m16 4-4 4-4-4",key:"1tumq1"}],["path",{d:"m8 20 4-4 4 4",key:"9p200w"}]]);/** + * @license lucide-react v0.294.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const bl=Y("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** + * @license lucide-react v0.294.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Oi=Y("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/** + * @license lucide-react v0.294.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const f0=Y("XCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/** + * @license lucide-react v0.294.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const $f=Y("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** + * @license lucide-react v0.294.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Bf=Y("Zap",[["polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2",key:"45s27k"}]]);function Hf(e,t){return function(){return e.apply(t,arguments)}}const{toString:p0}=Object.prototype,{getPrototypeOf:Ut}=Object,{iterator:hs,toStringTag:Vf}=Symbol,$t=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Wf=e=>typeof e=="string"&&(e==="__proto__"||e==="constructor"||e==="prototype"),Kl=(e,t,n)=>e===Object.prototype||!n&&t===null,m0=e=>{if(!Object.isExtensible(e))return!1;const t=Object.getOwnPropertyNames(e);return Object.getOwnPropertySymbols&&t.push(...Object.getOwnPropertySymbols(e)),t.every(n=>{if(Wf(n))return!1;const r=Object.getOwnPropertyDescriptor(e,n);return!!r&&r.configurable&&r.writable===!0})},Ra=(e,t)=>{let n=e;const r=[];for(;n!=null;){if(r.indexOf(n)!==-1)return!1;r.push(n);const s=Ut(n);if(Kl(n,s,n===e))return!1;if($t(n,t))return!0;n=s}return!1},h0=(e,t)=>e!=null&&Ra(e,t)?e[t]:void 0,y0=e=>{if(e==null||typeof e!="object"&&typeof e!="function")return e;const t=Ut(e);if(t===null&&m0(e))return e;const n=Object.create(null),r=Object.create(null),s=[];let l=e;for(;l!=null&&s.indexOf(l)===-1;){s.push(l);const o=l===e?t:Ut(l);if(Kl(l,o,l===e))break;const a=Object.getOwnPropertyNames(l);Object.getOwnPropertySymbols&&a.push(...Object.getOwnPropertySymbols(l));for(const u of a)Wf(u)||$t(r,u)||(n[u]=e[u],r[u]=!0);l=o}return n},Pa=(e=>t=>{const n=p0.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),ft=e=>(e=e.toLowerCase(),t=>Pa(t)===e),Gl=e=>t=>typeof t===e,{isArray:bn}=Array,On=Gl("undefined");function yr(e){return e!==null&&!On(e)&&e.constructor!==null&&!On(e.constructor)&&Je(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const qf=ft("ArrayBuffer");function g0(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&qf(e.buffer),t}const x0=Gl("string"),Je=Gl("function"),v0=Gl("number"),gr=e=>e!==null&&typeof e=="object",w0=e=>e===!0||e===!1,Zs=e=>{if(!gr(e))return!1;const t=Ut(e);return(t===null||t===Object.prototype||Ut(t)===null)&&(Kl(e,t,!0)||!$t(e,Vf)&&!$t(e,hs))},k0=e=>{if(!gr(e)||yr(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},S0=ft("Date"),N0=ft("File"),j0=e=>!!(e&&typeof e.uri<"u"),_0=e=>e&&typeof e.getParts<"u",E0=ft("Blob"),C0=ft("FileList"),b0=ft("Set"),O0=e=>gr(e)&&Je(e.pipe);function R0(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const Gu=R0(),Ju=typeof Gu.FormData<"u"?Gu.FormData:void 0,P0=e=>{if(!e)return!1;if(Ju&&e instanceof Ju)return!0;const t=Ut(e);if(!t||t===Object.prototype||!Je(e.append))return!1;const n=Pa(e);return n==="formdata"||n==="object"&&Je(e.toString)&&e.toString()==="[object FormData]"},T0=ft("URLSearchParams"),[A0,z0,L0,D0]=["ReadableStream","Request","Response","Headers"].map(ft),F0=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ys(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),bn(e))for(r=0,s=e.length;r0;)if(s=n[r],t===s.toLowerCase())return s;return null}const vn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Qf=e=>!On(e)&&e!==vn;function Ri(...e){const{caseless:t,skipUndefined:n}=Qf(this)&&this||{},r={},s=t?Object.create(null):null,l=(o,a)=>{if(a==="__proto__"||a==="constructor"||a==="prototype")return;let u=a;if(s&&typeof a=="string"){const m=a.toLowerCase(),g=s[m];g!==void 0&&$t(r,g)?u=g:s[m]=a}const c=$t(r,u)?r[u]:void 0;Zs(c)&&Zs(o)?r[u]=Ri(c,o):Zs(o)?r[u]=Ri({},o):bn(o)?r[u]=o.slice():(!n||!On(o))&&(r[u]=o)};for(let o=0,a=e.length;o(ys(t,(s,l)=>{n&&Je(s)?Object.defineProperty(e,l,{__proto__:null,value:Hf(s,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,l,{__proto__:null,value:s,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),U0=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),$0=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},B0=(e,t,n,r)=>{let s,l,o;const a={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),l=s.length;l-- >0;)o=s[l],(!r||r(o,e,t))&&!a[o]&&(t[o]=e[o],a[o]=!0);e=n!==!1&&Ut(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},H0=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},V0=e=>{if(!e)return null;if(bn(e))return e;let t=e.length;if(!Number.isSafeInteger(t)||t<0||t>4294967295)return null;const n=new Set,r=new Set;let s=e;for(;s!=null&&n.size{const u=+a;Number.isInteger(u)&&u>=0&&u0;)l[t]=e[t];return l},W0=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Ut(Uint8Array)),q0=(e,t)=>{const r=(e&&e[hs]).call(e);let s;for(;(s=r.next())&&!s.done;){const l=s.value;t.call(e,l[0],l[1])}},Q0=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},K0=ft("HTMLFormElement"),G0=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),{propertyIsEnumerable:J0}=Object.prototype,X0=ft("RegExp"),Kf=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};ys(n,(s,l)=>{let o;(o=t(s,l,e))!==!1&&(r[l]=o||s)}),Object.defineProperties(e,r)},Y0=e=>{Kf(e,(t,n)=>{if(Je(e)&&["arguments","caller","callee"].includes(n))return!1;const r=e[n];if(Je(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Z0=(e,t)=>{const n={},r=s=>{s.forEach(l=>{n[l]=!0})};return bn(e)?r(e):r(String(e).split(t)),n},ey=()=>{},ty=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function ny(e){return!!(e&&Je(e.append)&&e[Vf]==="FormData"&&e[hs])}const ry=e=>{const t=new WeakSet,n=r=>{if(gr(r)){if(t.has(r))return;if(yr(r))return r;if(!("toJSON"in r)){t.add(r);let s;if(b0(r)){s=[];for(const l of r){const o=n(l);!On(o)&&s.push(o)}}else s=bn(r)?[]:{},ys(r,(l,o)=>{const a=n(l);!On(a)&&(s[o]=a)});return t.delete(r),s}}return r};return n(e)},sy=ft("AsyncFunction"),ly=e=>e&&(gr(e)||Je(e))&&Je(e.then)&&Je(e.catch),Gf=((e,t)=>e?setImmediate:t?((n,r)=>(vn.addEventListener("message",({source:s,data:l})=>{s===vn&&l===n&&r.length&&r.shift()()},!1),s=>{r.push(s),vn.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Je(vn.postMessage)),oy=typeof queueMicrotask<"u"?queueMicrotask.bind(vn):typeof process<"u"&&process.nextTick||Gf,Jf=e=>e!=null&&Je(e[hs]),iy=e=>e!=null&&Ra(e,hs)&&Jf(e),p={isArray:bn,isArrayBuffer:qf,isBuffer:yr,isFormData:P0,isArrayBufferView:g0,isString:x0,isNumber:v0,isBoolean:w0,isObject:gr,isPlainObject:Zs,isEmptyObject:k0,isReadableStream:A0,isRequest:z0,isResponse:L0,isHeaders:D0,isUndefined:On,isDate:S0,isFile:N0,isReactNativeBlob:j0,isReactNative:_0,isBlob:E0,isRegExp:X0,isFunction:Je,isStream:O0,isURLSearchParams:T0,isTypedArray:W0,isFileList:C0,forEach:ys,merge:Ri,extend:I0,trim:F0,stripBOM:U0,inherits:$0,toFlatObject:B0,kindOf:Pa,kindOfTest:ft,endsWith:H0,toArray:V0,forEachEntry:q0,matchAll:Q0,isHTMLForm:K0,hasOwnProperty:$t,hasOwnProp:$t,hasOwnInPrototypeChain:Ra,getSafeProp:h0,toSafeFlatObject:y0,reduceDescriptors:Kf,freezeMethods:Y0,toObjectSet:Z0,toCamelCase:G0,noop:ey,toFiniteNumber:ty,findKey:M0,global:vn,isContextDefined:Qf,isSpecCompliantForm:ny,toJSONObject:ry,isAsyncFn:sy,isThenable:ly,setImmediate:Gf,asap:oy,isIterable:Jf,isSafeIterable:iy},ay=p.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),uy=e=>{const t=Object.create(null);let n,r,s;return e&&e.split(` +`).forEach(function(o){s=o.indexOf(":"),n=o.substring(0,s).trim().toLowerCase(),r=o.substring(s+1).trim();const a=p.hasOwnProp(t,n);!n||a&&p.hasOwnProp(ay,n)||(n==="set-cookie"?a?t[n].push(r):t[n]=[r]:t[n]=a?t[n]+", "+r:r)}),t};function cy(e){let t=0,n=e.length;for(;tt;){const r=e.charCodeAt(n-1);if(r!==9&&r!==32)break;n-=1}return t===0&&n===e.length?e:e.slice(t,n)}const dy=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),fy=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function Ta(e,t){return p.isArray(e)?e.map(n=>Ta(n,t)):cy(String(e).replace(t,""))}const py=e=>Ta(e,dy),my=e=>Ta(e,fy);function Xf(e){const t=Object.create(null);return p.forEach(e.toJSON(),(n,r)=>{t[r]=my(n)}),t}const Xu=Symbol("internals");function br(e){return e&&String(e).trim().toLowerCase()}function el(e){return e===!1||e==null?e:p.isArray(e)?e.map(el):py(String(e))}function hy(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const yy=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function _o(e){let t=0,n=e.length;for(;tt;){const r=e.charCodeAt(n-1);if(r!==9&&r!==32)break;n-=1}return t===0&&n===e.length?e:e.slice(t,n)}function gy(e){const t=e.length-1;if(t<1||e.charCodeAt(0)!==34||e.charCodeAt(t)!==34)return e;let n="";for(let r=1;r=t))return e;n+=e[r]}return n}function xy(e){const t=Object.create(null),n=String(e);let r=0,s=!1,l=!1;function o(a){const u=_o(n.slice(r,a)),c=u.indexOf("=");if(c<1)return;const m=_o(u.slice(0,c));if(!yy.test(m))return;const g=m.toLowerCase();if(g==="__proto__"||g==="constructor"||g==="prototype")return;const y=_o(u.slice(c+1));t[g]=gy(y)}for(let a=0;a/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()),wy="__Proto__",Yu=e=>e==="__proto__"?wy:e;function Eo(e,t,n,r,s){if(p.isFunction(r))return r.call(e,t,n);if(s&&(t=n),!!p.isString(t)){if(p.isString(r))return t.indexOf(r)!==-1;if(p.isRegExp(r))return r.test(t)}}function ky(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function Sy(e,t){const n=p.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{__proto__:null,value:function(s,l,o){return this[r].call(this,t,s,l,o)},configurable:!0})})}let Ne=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function l(a,u,c){const m=br(u);if(!m)return;const g=p.findKey(s,m);(!g||s[g]===void 0||c===!0||c===void 0&&s[g]!==!1)&&(s[Yu(g||u)]=el(a))}const o=(a,u)=>p.forEach(a,(c,m)=>l(c,m,u));if(p.isPlainObject(t)||t instanceof this.constructor)o(t,n);else if(p.isString(t)&&(t=t.trim())&&!vy(t))o(uy(t),n);else if(p.isObject(t)&&p.isSafeIterable(t)){let a=Object.create(null),u,c;for(const m of t){if(!p.isArray(m))throw new TypeError("Object iterator must return a key-value pair");c=m[0],p.hasOwnProp(a,c)?(u=a[c],a[c]=p.isArray(u)?[...u,m[1]]:[u,m[1]]):a[c]=m[1]}o(a,n)}else t!=null&&l(n,t,r);return this}get(t,n){if(t=br(t),t){const r=p.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return hy(s);if(p.isFunction(n))return n.call(this,s,r);if(p.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=br(t),t){const r=p.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Eo(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function l(o){if(o=br(o),o){const a=p.findKey(r,o);a&&(!n||Eo(r,r[a],a,n))&&(delete r[a],s=!0)}}return p.isArray(t)?t.forEach(l):l(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const l=n[r];(!t||Eo(this,this[l],l,t,!0))&&(delete this[l],s=!0)}return s}normalize(t){const n=this,r=Object.create(null);return p.forEach(this,(s,l)=>{const o=p.findKey(r,l);if(o){n[o]=el(s),delete n[l];return}const a=Yu(t?ky(l):String(l).trim());a!==l&&delete n[l],n[a]=el(s),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return p.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&p.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` +`)}getSetCookie(){const t=this.get("set-cookie");return p.isArray(t)?t:t==null||t===!1?[]:[t]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static parseParameters(t){return xy(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[Xu]=this[Xu]={accessors:{}}).accessors,s=this.prototype;function l(o){const a=br(o);r[a]||(Sy(s,o),r[a]=!0)}return p.isArray(t)?t.forEach(l):l(t),this}};Ne.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);p.reduceDescriptors(Ne.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});p.freezeMethods(Ne);const Ol="[REDACTED ****]";function Ny(e){if(p.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(p.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}function jy(e,t){const n=new Set(t.map(l=>String(l).toLowerCase())),r=[],s=l=>{if(l===null||typeof l!="object"||p.isBuffer(l))return l;if(r.indexOf(l)!==-1)return;l instanceof Ne&&(l=l.toJSON()),r.push(l);let o;if(p.isArray(l))o=[],l.forEach((a,u)=>{const c=s(a);p.isUndefined(c)||(o[u]=c)});else{if(!p.isPlainObject(l)&&Ny(l))return r.pop(),l;o=Object.create(null);for(const[a,u]of Object.entries(l)){const c=n.has(a.toLowerCase())?Ol:s(u);p.isUndefined(c)||(o[a]=c)}}return r.pop(),o};return s(e)}function Zu(e){try{return String(e)}catch{return""}}function _y(e){return e.errors.map(n=>{try{return n&&n.message?Zu(n.message):Zu(n)}catch{return""}}).filter(Boolean).join("; ")||e.name||"AggregateError"}const Ey=` +Caused by: `,Pi=Symbol("causeStack");function Cy(e,t){const n=p.hasOwnProp(e,Pi)&&e[Pi];return n&&t.endsWith(n)?t.length-n.length:-1}function by(e,t){try{const n=t&&t.stack;if(typeof n!="string"||!n)return;const r=e.stack;if(typeof r!="string"||!r)return;const s=Ey+n;e.stack=r+s,Object.defineProperty(e,Pi,{__proto__:null,value:s})}catch{}}let R=class Yf extends Error{static from(t,n,r,s,l,o){let a=t.message;!a&&p.isArray(t.errors)&&t.errors.length&&(a=_y(t));const u=new Yf(a,n||t.code,r,s,l);return Object.defineProperty(u,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),u.name=t.name,by(u,t),t.status!=null&&u.status==null&&(u.status=t.status),o&&Object.assign(u,o),u}constructor(t,n,r,s,l){super(t),Object.defineProperty(this,"message",{__proto__:null,value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),r&&(this.config=r),s&&(this.request=s),l&&(this.response=l,this.status=l.status)}toJSON(){const t=this.config,n=t&&p.hasOwnProp(t,"redact")?t.redact:void 0,r=p.isArray(n)&&n.length>0?jy(t,n):p.toJSONObject(t);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:r,code:this.code,status:this.status}}};R.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";R.ERR_BAD_OPTION="ERR_BAD_OPTION";R.ECONNABORTED="ECONNABORTED";R.ETIMEDOUT="ETIMEDOUT";R.ECONNREFUSED="ECONNREFUSED";R.ERR_NETWORK="ERR_NETWORK";R.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";R.ERR_DEPRECATED="ERR_DEPRECATED";R.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";R.ERR_BAD_REQUEST="ERR_BAD_REQUEST";R.ERR_CANCELED="ERR_CANCELED";R.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";R.ERR_INVALID_URL="ERR_INVALID_URL";R.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const Oy=null,Zf=100;function Ti(e){return p.isPlainObject(e)||p.isArray(e)}function ep(e){return p.endsWith(e,"[]")?e.slice(0,-2):e}function Co(e,t,n){return e?e.concat(t).map(function(s,l){return s=ep(s),!n&&l?"["+s+"]":s}).join(n?".":""):t}function Ry(e){return p.isArray(e)&&!e.some(Ti)}const Py=p.toFlatObject(p,{},null,function(t){return/^is[A-Z]/.test(t)});function Jl(e,t,n){if(!p.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(f,d)=>{const h=p.getSafeProp(n,f);return p.isUndefined(h)?d:h},s=r("metaTokens",!0),l=r("visitor")||w,o=r("dots",!1),a=r("indexes",!1),u=r("Blob")||typeof Blob<"u"&&Blob,c=r("maxDepth",Zf),m=u&&p.isSpecCompliantForm(t),g=[];if(!p.isFunction(l))throw new TypeError("visitor must be a function");function y(f){if(f===null)return"";if(p.isDate(f))return f.toISOString();if(p.isBoolean(f))return f.toString();if(!m&&p.isBlob(f))throw new R("Blob is not supported. Use a Buffer instead.");if(p.isArrayBuffer(f)||p.isTypedArray(f)){if(m&&typeof u=="function")return new u([f]);throw new R("Blob is not supported. Use a Buffer instead.",R.ERR_NOT_SUPPORT)}return f}function v(f){if(f>c)throw new R("Object is too deeply nested ("+f+" levels). Max depth: "+c,R.ERR_FORM_DATA_DEPTH_EXCEEDED)}function N(f,d){if(c===1/0)return JSON.stringify(f);const h=[];return JSON.stringify(f,function(S,E){if(!p.isObject(E))return E;for(;h.length&&h[h.length-1]!==this;)h.pop();return h.push(E),v(d+h.length-1),E})}function w(f,d,h){let k=f;if(p.isReactNative(t)&&p.isReactNativeBlob(f))return t.append(Co(h,d,o),y(f)),!1;if(f&&!h&&typeof f=="object"){if(p.endsWith(d,"{}"))d=s?d:d.slice(0,-2),f=N(f,1);else if(p.isArray(f)&&Ry(f)||(p.isFileList(f)||p.endsWith(d,"[]"))&&(k=p.toArray(f)))return d=ep(d),k.forEach(function(E,_){!(p.isUndefined(E)||E===null)&&t.append(a===!0?Co([d],_,o):a===null?d:d+"[]",y(E))}),!1}return Ti(f)?!0:(t.append(Co(h,d,o),y(f)),!1)}const T=Object.assign(Py,{defaultVisitor:w,convertValue:y,isVisitable:Ti});function x(f,d,h=0){if(!p.isUndefined(f)){if(v(h),g.indexOf(f)!==-1)throw new Error("Circular reference detected in "+d.join("."));g.push(f),p.forEach(f,function(S,E){(!(p.isUndefined(S)||S===null)&&l.call(t,S,p.isString(E)?E.trim():E,d,T))===!0&&x(S,d?d.concat(E):[E],h+1)}),g.pop()}}if(!p.isObject(e))throw new TypeError("data must be an object");return x(e),t}function ec(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(r){return t[r]})}function Aa(e,t){this._pairs=[],e&&Jl(e,this,t)}const tp=Aa.prototype;tp.append=function(t,n){this._pairs.push([t,n])};tp.toString=function(t){const n=t?r=>t.call(this,r,ec):ec;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function Ty(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function np(e,t,n){if(!t)return e;e=e||"";const r=p.isFunction(n)?{serialize:n}:n,s=p.getSafeProp(r,"encode")||Ty,l=p.getSafeProp(r,"serialize");let o;if(l?o=l(t,r):o=p.isURLSearchParams(t)?t.toString():new Aa(t,r).toString(s),o){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}const Or=Symbol("internals");function rp(e){return e?e.length:0}function tc(e){if(e)for(;e.length&&e[e.length-1]===null;)e.pop()}function Ay(e){return typeof e=="string"&&e!==""&&String(Number(e))===e?Number(e):e}function Rr(e,t){const n=e.handlers,r=rp(n);n!==t.handlersRef?(t.handlersRef=n,t.handlerEntries.clear()):r!==t.handlersLength&&(r?t.handlerEntries.forEach(function(l,o){n[l.index]!==l.handler&&t.handlerEntries.delete(o)}):t.handlerEntries.clear()),t.handlersLength=r}class nc{constructor(){this.handlers=[],this[Or]={handlersRef:this.handlers,handlersLength:this.handlers.length,handlerEntries:new Map,iterationDepth:0,nextId:0}}use(t,n,r){const s={fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null},l=this[Or];this.handlers==null&&(this.handlers=[]),Rr(this,l);const o=l.nextId++;return this.handlers.push(s),l.handlerEntries.set(o,{handler:s,index:this.handlers.length-1}),l.handlersLength=this.handlers.length,o}eject(t){const n=this[Or];Rr(this,n);const r=Ay(t),s=n.handlerEntries.get(r);if(s){if(n.handlerEntries.delete(r),this.handlers[s.index]!==s.handler)return;this.handlers[s.index]=null,n.iterationDepth||(tc(this.handlers),n.handlersLength=this.handlers.length)}}clear(){this.handlers&&(this.handlers=[],Rr(this,this[Or]))}forEach(t){const n=this[Or];Rr(this,n),n.iterationDepth++;try{p.forEach(this.handlers,function(s){s!==null&&t(s)})}finally{--n.iterationDepth||(Rr(this,n),tc(this.handlers),n.handlersLength=rp(this.handlers))}}}const za={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0,encodeBasicAuthUsername:!1},zy=typeof URLSearchParams<"u"?URLSearchParams:Aa,Ly=typeof FormData<"u"?FormData:null,Dy=typeof Blob<"u"?Blob:null,Fy={isBrowser:!0,classes:{URLSearchParams:zy,FormData:Ly,Blob:Dy},protocols:["http","https","file","blob","url","data"]},La=typeof window<"u"&&typeof document<"u",Ai=typeof navigator=="object"&&navigator||void 0,My=La&&(!Ai||["ReactNative","NativeScript","NS"].indexOf(Ai.product)<0),Iy=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Uy=La&&window.location.href||"http://localhost",$y=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:La,hasStandardBrowserEnv:My,hasStandardBrowserWebWorkerEnv:Iy,navigator:Ai,origin:Uy},Symbol.toStringTag,{value:"Module"})),ve={...$y,...Fy};function By(e,t){return Jl(e,new ve.classes.URLSearchParams,{visitor:function(n,r,s,l){return ve.isNode&&p.isBuffer(n)?(this.append(r,n.toString("base64")),!1):l.defaultVisitor.apply(this,arguments)},...t})}const rc=Zf;function sp(e){if(e>rc)throw new R("FormData field is too deeply nested ("+e+" levels). Max depth: "+rc,R.ERR_FORM_DATA_DEPTH_EXCEEDED)}function Hy(e){const t=[],n=/[^.[\]]+|\[([^.[\]]*)]/g;let r;for(;(r=n.exec(e))!==null;)sp(t.length),t.push(r[0]==="[]"?"":r[1]||r[0]);return t}function lp(e){const t={},n=Object.keys(e);let r;const s=n.length;let l;for(r=0;rn!==String(r))?lp(e):e}function Vy(e){const t=[e];for(;t.length;){const n=t.pop();Object.keys(n).forEach(r=>{const s=n[r]=op(n[r]);(p.isArray(s)||p.isPlainObject(s))&&t.push(s)})}return e}function ip(e){function t(n,r,s,l){sp(l);let o=n[l++];if(o==="__proto__")return!0;const a=Number.isFinite(+o),u=l>=n.length;return o=!o&&p.isArray(s)?s.length:o,u?(p.hasOwnProp(s,o)?(s[o]=op(s[o]),s[o]=p.isArray(s[o])?s[o].concat(r):[s[o],r]):s[o]=r,!a):((!p.hasOwnProp(s,o)||!p.isObject(s[o]))&&(s[o]=[]),t(n,r,s[o],l)&&p.isArray(s[o])&&(s[o]=lp(s[o])),!a)}if(p.isFormData(e)&&p.isFunction(e.entries)){const n={};return p.forEachEntry(e,(r,s)=>{t(Hy(r),s,n,0)}),Vy(n)}return null}const ap=Object.freeze(["get","delete","head","options","post","put","patch","purge","link","unlink","query"]),Mn=(e,t)=>e!=null&&p.hasOwnProp(e,t)?e[t]:void 0;function Wy(e,t,n){if(p.isString(e))try{return(t||JSON.parse)(e),p.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const gs={transitional:za,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,l=p.isObject(t);if(l&&p.isHTMLForm(t)&&(t=new FormData(t)),p.isFormData(t))return s?JSON.stringify(ip(t)):t;if(p.isArrayBuffer(t)||p.isBuffer(t)||p.isStream(t)||p.isFile(t)||p.isBlob(t)||p.isReadableStream(t))return t;if(p.isArrayBufferView(t))return t.buffer;if(p.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(l){const u=Mn(this,"formSerializer");if(r.indexOf("application/x-www-form-urlencoded")>-1)return By(t,u).toString();if((a=p.isFileList(t))||r.indexOf("multipart/form-data")>-1){const c=Mn(this,"env"),m=c&&c.FormData;return Jl(a?{"files[]":t}:t,m&&new m,u)}}return l||s?(n.setContentType("application/json",!1),Wy(t)):t}],transformResponse:[function(t){const n=Mn(this,"transitional")||gs.transitional,r=n&&n.forcedJSONParsing,s=Mn(this,"responseType"),l=s==="json";if(p.isResponse(t)||p.isReadableStream(t))return t;if(t&&p.isString(t)&&(r&&!s||l)){const a=!(n&&n.silentJSONParsing)&&l;try{return JSON.parse(t,Mn(this,"parseReviver"))}catch(u){if(a)throw u.name==="SyntaxError"?R.from(u,R.ERR_BAD_RESPONSE,this,null,Mn(this,"response")):u}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ve.classes.FormData,Blob:ve.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};p.forEach(ap,e=>{gs.headers[e]={}});function bo(e,t){const n=this||gs,r=t||n,s=Ne.from(r.headers);let l=r.data;return p.forEach(e,function(a){l=a.call(n,l,s.normalize(),t?t.status:void 0)}),s.normalize(),l}function up(e){return!!(e&&e.__CANCEL__)}let xs=class extends R{constructor(t,n,r){super(t??"canceled",R.ERR_CANCELED,n,r),this.name="CanceledError",this.__CANCEL__=!0}};function cp(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new R("Request failed with status code "+n.status,n.status>=400&&n.status<500?R.ERR_BAD_REQUEST:R.ERR_BAD_RESPONSE,n.config,n.request,n))}const qy=/[\t\n\r]/g;function dp(e){if(typeof e!="string")return e;let t=0;for(;t{try{return decodeURIComponent(e)}catch{return e}},fp=ve.hasStandardBrowserEnv?{write(e,t,n,r,s,l,o){if(typeof document>"u")return;const a=[`${e}=${encodeURIComponent(t)}`];p.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),p.isString(r)&&a.push(`path=${r}`),p.isString(s)&&a.push(`domain=${s}`),l===!0&&a.push("secure"),p.isString(o)&&a.push(`SameSite=${o}`),document.cookie=a.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie;if(!t)return null;const n=t.split(";");for(let r=0;r{n=g,s=null,l&&(clearTimeout(l),l=null),e(...m)};return[(...m)=>{const g=Date.now(),y=g-n;y>=r?o(m,g):(s=m,l||(l=setTimeout(()=>{l=null,o(s)},r-y)))},()=>s&&o(s),(...m)=>o(m)]}const Rl=(e,t,n=3)=>{let r=0;const s=Qy(50,250);return Ky(l=>{if(!l||!p.isNumber(l.loaded))return;const o=l.loaded,a=l.lengthComputable?l.total:void 0,u=Math.max(0,a!=null?Math.min(o,a):o),c=Math.max(0,u-r),m=s(c);r=Math.max(r,u);const g={loaded:u,total:a,progress:a?u/a:void 0,bytes:c,rate:m||void 0,estimated:m&&a?(a-u)/m:void 0,event:l,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(g)},n)},lc=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},oc=(e,t=p.asap)=>(...n)=>t(()=>e(...n)),Gy=ve.hasStandardBrowserEnv?(e=>t=>(t=new URL(t,document.baseURI||ve.origin),e.protocol===t.protocol&&e.host===t.host&&e.port===t.port))(new URL(ve.origin)):()=>!0;function Jy(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Xy(e,t){if(!t)return e;let n=e.length;for(;n>0&&e.charCodeAt(n-1)===47;)n--;return e.slice(0,n)+"/"+t.replace(/^\/+/,"")}const Yy=/^https?:(?!\/\/)/i;function Zy(e){return e&&e.replace(/(^|&)([^=&]*=)?[^&]+/g,(t,n,r="")=>`${n}${r}${Ol}`)}function eg(e){const t=e.replace(/^(https?:\/{0,2})[^/?#]*@/i,`$1${Ol}@`),n=t.indexOf("#"),s=(n===-1?t:t.slice(0,n)).replace(/([?&][^=&#]*=)[^&#]*/g,`$1${Ol}`);return n===-1?s:`${s}#${Zy(t.slice(n+1))}`}function ic(e,t){if(typeof e=="string"){const n=dp(e);if(Yy.test(n))throw new R(`Invalid URL ${JSON.stringify(eg(n))}: missing "//" after protocol`,R.ERR_INVALID_URL,t)}}function pp(e,t,n,r){ic(t,r);let s=!Jy(t);return e&&(s||n===!1)?(ic(e,r),Xy(e,t)):t}function tg(e){const t=[{value:e}],n=new WeakSet,r=new WeakSet;for(;t.length;){const{value:s,done:l}=t.pop();if(!p.isPlainObject(s)&&!p.isArray(s))continue;if(l){n.delete(s);continue}if(n.has(s))throw new R("Circular reference detected in params",R.ERR_BAD_OPTION_VALUE);if(r.has(s))continue;r.add(s),n.add(s),t.push({value:s,done:!0});const o=Object.keys(s);Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor&&Object.getOwnPropertySymbols(s).forEach(a=>{const u=Object.getOwnPropertyDescriptor(s,a);u&&u.enumerable&&o.push(a)}),o.forEach(a=>{if(a==="__proto__"||a==="constructor"||a==="prototype"){const u=Object.getOwnPropertyDescriptor(s,a);u&&p.hasOwnProp(u,"value")&&t.push({value:u.value})}else t.push({value:s[a]})})}}const ac=e=>e instanceof Ne?{...e}:e,zi=e=>Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor?Object.keys(e).concat(Object.getOwnPropertySymbols(e).filter(t=>{const n=Object.getOwnPropertyDescriptor(e,t);return n&&n.enumerable})):Object.keys(e);function ng(e,t){const n=[],r=new WeakMap,s={};function l(a,u){if(!p.isPlainObject(u))return p.isArray(u)?u.slice():u;const c=p.isPlainObject(a)?a:s;let m=r.get(u);if(m||(m=new WeakMap,r.set(u,m)),m.has(c))return m.get(c);const g={};return m.set(c,g),n.push({base:c,source:u,result:g}),g}const o=p.isUndefined(t)?l(void 0,e):l(e,t);for(;n.length;){const{base:a,source:u,result:c}=n.pop(),m=new Set(zi(a)),g=new Set(zi(u));new Set([...m,...g]).forEach(v=>{if(v==="__proto__"||v==="constructor"||v==="prototype")return;const N=g.has(v),w=N?u[v]:void 0,T=(!N||p.isPlainObject(w))&&m.has(v)?a[v]:void 0;c[v]=N?l(T,w):l(void 0,T)})}return tg(o),o}function un(e,t,n,r){return p.isPlainObject(e)&&p.isPlainObject(t)?p.merge.call({caseless:r},e,t):p.isPlainObject(t)?p.merge({},t):p.isArray(t)?t.slice():t}function mp(e,t,n,r){if(p.isUndefined(t)){if(!p.isUndefined(e))return un(void 0,e,n,r)}else return un(e,t,n,r)}function Ro(e,t){if(!p.isUndefined(t))return un(void 0,t)}function ie(e,t){if(p.isUndefined(t)){if(!p.isUndefined(e))return un(void 0,e)}else return un(void 0,t)}function rg(e,t,n){const r=p.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!p.isUndefined(r))if(p.isPlainObject(r)){if(p.hasOwnProp(r,n))return r[n]}else return;const s=p.hasOwnProp(e,"transitional")?e.transitional:void 0;if(p.isPlainObject(s)&&p.hasOwnProp(s,n))return s[n]}function Li(e,t,n,r,s){if(p.hasOwnProp(s,n))return un(e,t);if(p.hasOwnProp(r,n))return un(void 0,e)}function sg(e,t,n){return mp(ac(e),ac(t),n,!0)}const lg=Object.freeze({__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0}),uc={url:Ro,method:Ro,data:Ro,baseURL:ie,transformRequest:ie,transformResponse:ie,params:ng,paramsSerializer:ie,timeout:ie,timeoutErrorMessage:ie,withCredentials:ie,withXSRFToken:ie,adapter:ie,responseType:ie,xsrfCookieName:ie,xsrfHeaderName:ie,onUploadProgress:ie,onDownloadProgress:ie,decompress:ie,maxContentLength:ie,maxBodyLength:ie,beforeRedirect:ie,transport:ie,httpAgent:ie,httpsAgent:ie,cancelToken:ie,socketPath:ie,allowedSocketPaths:ie,responseEncoding:ie,validateStatus:Li,headers:sg};function Rn(e,t){e=e||{},t=t||{};const n=Object.create(null);Object.defineProperty(n,"hasOwnProperty",lg);const r=zi({...e,...t});for(let s=0,l=r.length;s{og.includes(r.toLowerCase())&&e.set(r,s)})}const cc=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,n)=>String.fromCharCode(parseInt(n,16))),ag=e=>fp.read(e);function hp(e,t=ag){const n=Rn({},e),r=v=>p.hasOwnProp(n,v)?n[v]:void 0,s=r("data");let l=r("withXSRFToken");const o=r("xsrfHeaderName"),a=r("xsrfCookieName");let u=r("headers");const c=r("auth"),m=r("baseURL"),g=r("allowAbsoluteUrls"),y=r("url");if(n.headers=u=Ne.from(u),n.url=np(pp(m,y,g,n),r("params"),r("paramsSerializer")),c){const v=p.getSafeProp(c,"username")||"",N=p.getSafeProp(c,"password")||"",w=r("transitional"),T=w&&p.hasOwnProp(w,"encodeBasicAuthUsername")&&w.encodeBasicAuthUsername===!0;try{u.set("Authorization","Basic "+btoa((T?cc(v):v)+":"+(N?cc(N):"")))}catch(x){throw R.from(x,R.ERR_BAD_OPTION_VALUE,e)}}if(p.isFormData(s)){const v=p.getSafeProp(s,"getHeaders");ve.hasStandardBrowserEnv||ve.hasStandardBrowserWebWorkerEnv||p.isReactNative(s)?u.setContentType(void 0):p.isFunction(v)&&ig(u,v.call(s),r("formDataHeaderPolicy"))}if(ve.hasStandardBrowserEnv&&(p.isFunction(l)&&(l=l(n)),l===!0||l==null&&Gy(n.url))){const N=o&&a&&t(a);N&&u.set(o,N)}return n}const ug=typeof XMLHttpRequest<"u",cg=ug&&function(e){return new Promise(function(n,r){let s;try{const _=ve.hasStandardBrowserEnv&&typeof window<"u"&&window.cookieStore;s=_&&p.isFunction(_.get)}catch{}let l;const o=hp(e,s?_=>(l=_,null):void 0);let a=o.data;const u=Ne.from(o.headers).normalize();let{responseType:c,onUploadProgress:m,onDownloadProgress:g}=o,y,v,N,w,T,x,f;function d(){clearTimeout(v);try{T&&T()}catch(_){setTimeout(()=>{throw _})}try{x&&x()}catch(_){setTimeout(()=>{throw _})}h&&(w&&h.removeEventListener("progress",w),h.upload&&(N&&h.upload.removeEventListener("progress",N),T&&h.upload.removeEventListener("loadend",T))),o.cancelToken&&o.cancelToken.unsubscribe(y),o.signal&&o.signal.removeEventListener("abort",y)}let h=new XMLHttpRequest;h.open(o.method.toUpperCase(),o.url,!0),h.timeout=o.timeout;function k(_){if(!h)return;if(h.status===0&&(Oo(dp(o.url))||Oo(ve.origin))!=="file"&&!(h.responseURL&&h.responseURL.startsWith("file:"))){r(new R("Request aborted",R.ECONNABORTED,e,h)),d(),h=null;return}try{_?f&&f(_):x&&x()}catch(K){setTimeout(()=>{throw K})}if(!h)return;const M=Ne.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),$={data:!c||c==="text"||c==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:M,config:e,request:h};cp(function(re){n(re),d()},function(re){r(re),d()},$),h=null}if("onloadend"in h?h.onloadend=k:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.startsWith("file:"))||setTimeout(k)},h.onabort=function(){h&&(r(new R("Request aborted",R.ECONNABORTED,e,h)),d(),h=null)},h.onerror=function(M){const O=M&&M.message?M.message:"Network Error",$=new R(O,R.ERR_NETWORK,e,h);$.event=M||null,r($),d(),h=null},h.ontimeout=function(){if(!h)return;let M=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const O=o.transitional||za;o.timeoutErrorMessage&&(M=o.timeoutErrorMessage),r(new R(M,O.clarifyTimeoutError?R.ETIMEDOUT:R.ECONNABORTED,e,h)),d(),h=null},a===void 0&&u.setContentType(null),p.isUndefined(o.withCredentials)||(h.withCredentials=!!o.withCredentials),c&&c!=="json"&&(h.responseType=o.responseType),g&&([w,x,f]=Rl(g,!0),h.addEventListener("progress",w)),m&&h.upload&&([N,T]=Rl(m),h.upload.addEventListener("progress",N),h.upload.addEventListener("loadend",T)),o.cancelToken||o.signal){if(y=_=>{if(!h)return;r(!_||_.type?new xs(null,e,h):_);const M=h;d(),h=null,M.abort()},o.cancelToken&&o.cancelToken.subscribe(y),!h)return;o.signal&&(o.signal.aborted?y():o.signal.addEventListener("abort",y))}if(!h)return;const S=Oo(o.url);if(S&&!ve.protocols.includes(S)){r(new R("Unsupported protocol "+S+":",R.ERR_BAD_REQUEST,e)),d();return}const E=()=>{h&&("setRequestHeader"in h&&p.forEach(Xf(u),function(M,O){h.setRequestHeader(O,M)}),h.send(a||null))};if(l){const _=typeof performance<"u"&&p.isFunction(performance.now)?()=>performance.now():Date.now,M=h.timeout>0?_()+Number(h.timeout):void 0,O=()=>{if(!h)return;const $=h;$.ontimeout(),$.abort()};if(M!==void 0){const $=()=>{const K=M-_();K>0?v=setTimeout($,Math.min(K,2147483647)):O()};$()}fp.readAsync(l).then($=>{if(h){if(M!==void 0&&_()>=M){O();return}if($){const K=p.hasOwnProp(o,"xsrfHeaderName")&&o.xsrfHeaderName;u.set(K,$)}E()}}).catch($=>{h&&(r(R.from($,null,e,h)),d(),h=null)})}else E()})},dg=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const n=new AbortController;let r=!1;const s=function(u){if(!r){r=!0,o();const c=u instanceof Error?u:this.reason;n.abort(c instanceof R?c:new xs(c instanceof Error?c.message:c))}};let l=t&&setTimeout(()=>{l=null,s(new R(`timeout of ${t}ms exceeded`,R.ETIMEDOUT))},t);const o=()=>{e&&(l&&clearTimeout(l),l=null,e.forEach(u=>{const c=p.getSafeProp(u,"unsubscribe");p.isFunction(c)?c.call(u,s):u.removeEventListener("abort",s)}),e=null)};e.forEach(u=>{if(!r){if(u.aborted){s.call(u);return}u.addEventListener("abort",s,{once:!0})}});const{signal:a}=n;return a.unsubscribe=()=>p.asap(o),a},fg=function*(e,t){let n=e.byteLength;if(n{const s=pg(e,t);let l=0,o,a=u=>{o||(o=!0,r&&r(u))};return new ReadableStream({async pull(u){try{const{done:c,value:m}=await s.next();if(c){a(),u.close();return}let g=m.byteLength;if(n){let y=l+=g;n(y)}u.enqueue(new Uint8Array(m))}catch(c){throw a(c),c}},cancel(u){return a(u),s.return()}},{highWaterMark:2})},Vt=`\r +`,fc=e=>String(e).replace(/\r\n|\r|\n/g,Vt),pc=e=>String(e).replace(/[\r\n"]/g,t=>t==="\r"?"%0D":t===` +`?"%0A":"%22"),Pr=(e,t)=>{let n=0;for(let r=0;r=55296&&s<=56319&&e.charCodeAt(r+1)>=56320&&e.charCodeAt(r+1)<=57343?(n+=4,r++):n+=3}return n};class tl extends TypeError{constructor(t,n){super(t),this.name="FormDataError",this.reason=n}}function hg(e,t,n,r,s){if(!p.isFunction(t))throw new tl("Blob is not supported","blob");if(!p.isString(s)||!/^[A-Za-z0-9'()+_,./:=? -]{1,70}$/.test(s)||/ $/.test(s))throw new tl("Invalid multipart boundary","boundary");const l="--"+s+"--"+Vt;let o=l.length;const a=[],u=m=>{if(o+m>n)throw r()};u(0);for(const[m,g]of e){const y=p.isString(g),v=y?Pr(g,!0):g.size;if(!Number.isFinite(v)||v<0)throw new tl("Unsupported FormData part size","part");u(v+Pr(m,!0)+(!y&&g.name?Pr(g.name,!1):0)+(!y&&g.type?Pr(g.type,!1):0));let N="--"+s+Vt+'Content-Disposition: form-data; name="'+pc(fc(m))+'"';y||(N+='; filename="'+pc(p.isString(g.name)?g.name:"blob")+'"'+Vt+"Content-Type: "+String(g.type||"application/octet-stream").replace(/[\r\n]/g,"")),N+=Vt+Vt;const w=Pr(N,!1)+v+Vt.length;u(w),o+=w,a.push({header:N,value:g,isString:y})}const c=[];for(const m of a)c.push(m.header,m.isString?fc(m.value):m.value,Vt);return c.push(l),new t(c,{type:"multipart/form-data; boundary="+s})}function yg(e,t,n,r,s){if(!p.isFunction(t))throw new R("Blob is not supported",R.ERR_NOT_SUPPORT);if(s===void 0)if(p.isFunction(ve.generateString))s="axios-"+ve.generateString(36,"0123456789abcdef");else{const l=p.global.crypto;if(!l||!p.isFunction(l.getRandomValues))throw new R("Random byte generation is not supported",R.ERR_NOT_SUPPORT);const o=new Uint8Array(18);l.getRandomValues(o),s="axios-"+Array.from(o,a=>("0"+a.toString(16)).slice(-2)).join("")}try{return hg(e,t,n,r,s)}catch(l){if(l instanceof tl){const o=l.reason==="boundary"?R.ERR_BAD_OPTION_VALUE:R.ERR_BAD_REQUEST;throw new R(l.message,o)}throw l}}const mc=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,yp=(e,t,n)=>t+2e<=57?e-48:(e&223)-55,gg=e=>e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===43||e===47||e===45||e===95,xg=e=>e===9||e===10||e===12||e===13||e===32,vg=e=>{const t=Math.floor(e/4),n=e%4;return t*3+(n===2?1:n===3?2:0)},wg=e=>{const t=e.length;let n=0;return t>0&&e.charCodeAt(t-1)===61&&(n++,t>1&&e.charCodeAt(t-2)===61&&n++),Math.floor((t-n)*3/4)},kg=e=>{const t=e.length;let n=0,r=0,s=!1;for(let l=0;l0){s=!0;continue}n++}}return s||r>2||r>0&&(n+r)%4!==0||n%4===1?wg(e):vg(n)},Sg=(e,t,n)=>{if(!e||typeof e!="string"||!/^data:/i.test(e))return 0;const r=e.indexOf(",");if(r<0)return 0;const s=e.slice(5,r),l=e.slice(r+1);if(n.test(s))return t(l);let a=0;for(let u=0,c=l.length;u=55296&&m<=56319&&u+1=56320&&g<=57343?(a+=4,u++):a+=3}else a+=3}return a};function Ng(e){const t=typeof e=="string"?e.indexOf("#"):-1;return Sg(t===-1?e:e.slice(0,t),kg,/; *base64[\t\n\f\r ]*$/i)}const Da="1.21.1",yc=64*1024,gc={cache:"default",redirect:"follow",referrer:"about:client",referrerPolicy:"",mode:"cors",integrity:"",keepalive:!1,priority:"auto",window:null},{isFunction:Is}=p,jg=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,n)=>String.fromCharCode(parseInt(n,16))),xc=e=>{if(!p.isString(e))return e;try{return decodeURIComponent(e)}catch{return e}},Us=(e,...t)=>{try{return!!e(...t)}catch{return!1}},_g=e=>{const t=e.indexOf("://");let n=e;return t!==-1&&(n=n.slice(t+3)),n.includes("@")||n.includes(":")},Eg=e=>{const t=p.global!==void 0&&p.global!==null?p.global:globalThis,{ReadableStream:n,TextEncoder:r}=t;e=p.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response,Blob:t.Blob},e);const s=p.hasOwnProp(e,"fetch")?e.fetch:void 0,{Request:l,Response:o,Blob:a}=e,u=s?Is(s):typeof fetch=="function",c=Is(l),m=Is(o);if(!u)return!1;const g=u&&Is(n),y=u&&(typeof r=="function"?(d=>h=>d.encode(h))(new r):async d=>new Uint8Array(await new l(d).arrayBuffer())),v=c&&g&&Us(()=>{let d=!1;const h=new l(ve.origin,{body:new n,method:"POST",get duplex(){return d=!0,"half"}}),k=h.headers.has("Content-Type");return h.body!=null&&h.body.cancel(),d&&!k}),N=m&&g&&Us(()=>p.isReadableStream(new o("").body)),w=Object.assign(Object.create(null),gc);c&&!Us(()=>new l(ve.origin,w))&&(delete w.cache,Us(()=>new l(ve.origin,w))||(w.cache=gc.cache));const T={stream:N&&(d=>d.body)};u&&["text","arrayBuffer","blob","formData","stream"].forEach(d=>{!T[d]&&(T[d]=(h,k)=>{let S=h&&h[d];if(S)return S.call(h);throw new R(`Response type '${d}' is not supported`,R.ERR_NOT_SUPPORT,k)})});const x=async d=>{if(d==null)return 0;if(p.isBlob(d))return d.size;if(p.isArrayBufferView(d)||p.isArrayBuffer(d))return d.byteLength;if(p.isURLSearchParams(d)&&(d=d+""),p.isString(d))return(await y(d)).byteLength},f=async(d,h)=>{const k=p.toFiniteNumber(d.getContentLength());return k??x(h)};return async d=>{let{url:h,method:k,data:S,signal:E,cancelToken:_,timeout:M,onDownloadProgress:O,onUploadProgress:$,responseType:K,headers:re,withCredentials:q="same-origin",fetchOptions:pt,maxContentLength:B,maxBodyLength:Fe,maxRedirects:A}=hp(d);const F=p.isNumber(B)&&B>-1,L=p.isNumber(Fe)&&Fe>-1,H=J=>p.hasOwnProp(d,J)?d[J]:void 0;let Q=s||fetch;K=K?(K+"").toLowerCase():"text";let ge=dg([E,_&&_.toAbortSignal()],M),ee=null;const Pe=ge&&ge.unsubscribe&&(()=>{ge.unsubscribe()});let P,X=null,te=null;const Te=()=>new R("Request body larger than maxBodyLength limit",R.ERR_BAD_REQUEST,d,ee);try{let J;const Ve=H("auth");if(Ve){const V=p.getSafeProp(Ve,"username")||"",we=p.getSafeProp(Ve,"password")||"";J={username:V,password:we}}let Me;if(_g(h)){if(Me=new URL(h,ve.origin),!J&&(Me.username||Me.password)){const V=xc(Me.username),we=xc(Me.password);J={username:V,password:we}}(Me.username||Me.password)&&(Me.username="",Me.password="",h=Me.href)}if(J&&(re.delete("authorization"),re.set("Authorization","Basic "+btoa(jg((J.username||"")+":"+(J.password||""))))),F&&Me&&Me.protocol==="data:"&&Ng(Me.href)>B)throw new R("maxContentLength size of "+B+" exceeded",R.ERR_BAD_RESPONSE,d,ee);const An=p.isSpecCompliantForm(S)&&Ne.from(H("headers")).getContentType();let zn;if(p.isString(An)&&/^multipart\/form-data(?:\s*;|$)/i.test(An.trim())){const V=Ne.parseParameters(An);p.hasOwnProp(V,"boundary")&&(zn=V.boundary)}if(p.isSpecCompliantForm(S)&&k!=="get"&&k!=="head"&&(L||$&&v||zn!==void 0)&&(S=yg(S,a,L?Fe:1/0,Te,zn),re.setContentType(zn===void 0?S.type:An),P=S.size),L&&k!=="get"&&k!=="head"){const V=await x(S);if(typeof V=="number"&&isFinite(V)&&(P=V,V>Fe))throw Te()}const Ln=L&&(p.isReadableStream(S)||p.isStream(S)),pn=(V,we,Rt)=>dc(V,yc,Nt=>{if(L&&Nt>Fe)throw X=Te();we&&we(Nt)},Rt);if(v&&k!=="get"&&k!=="head"&&($||Ln)){if(P=P??await f(re,S),P!==0||Ln){let V=new l(h,{method:"POST",body:S,duplex:"half"}),we;if(p.isFormData(S)&&(we=V.headers.get("content-type"))&&re.setContentType(we),V.body){const[Rt,Nt]=$&&lc(P,Rl(oc($)))||[];S=pn(V.body,Rt,Nt)}}}else if(Ln&&!c&&g&&k!=="get"&&k!=="head")S=pn(S);else if(Ln&&c&&!v&&k!=="get"&&k!=="head")throw new R("Stream request bodies are not supported by the current fetch implementation",R.ERR_NOT_SUPPORT,d,ee);p.isString(q)||(q=q?"include":"omit");const vs=c&&"credentials"in l.prototype;if(p.isFormData(S)){const V=re.getContentType();V&&/^multipart\/form-data/i.test(V)&&!/boundary=/i.test(V)&&re.delete("content-type")}re.set("User-Agent","axios/"+Da,!1);const Xe=pt==null?pt:Object.assign(Object.create(null),pt);Xe&&(delete Xe.body,delete Xe.headers,delete Xe.method,delete Xe.signal,delete Xe.duplex,delete Xe.credentials);const mt=Object.assign(Object.create(null),Xe,{signal:ge,method:k.toUpperCase(),headers:Xf(re.normalize()),body:S,duplex:"half",credentials:vs?q:void 0});c&&(p.forEach(w,(V,we)=>{mt[we]===void 0&&(mt[we]=V)}),mt.signal===void 0&&(mt.signal=null),mt.body===void 0&&(mt.body=null)),A===0&&(mt.redirect="manual",Xe&&(Xe.redirect="manual")),ee=c&&new l(h,mt);let st=await(c?Q(ee,Xe):Q(h,mt));const xr=Ne.from(st.headers);if(F){const V=p.toFiniteNumber(xr.getContentLength());if(V!=null&&V>B)throw new R("maxContentLength size of "+B+" exceeded",R.ERR_BAD_RESPONSE,d,ee)}const Dn=N&&(K==="stream"||K==="response");if(N&&st.body&&(O||F||Dn&&Pe)){const V={};["status","statusText","headers"].forEach(j=>{V[j]=st[j]});const we=p.toFiniteNumber(xr.getContentLength()),[Rt,Nt]=O&&lc(we,Rl(oc(O),!0))||[];let vr=0;const ws=j=>{if(F&&(vr=j,vr>B))throw te=new R("maxContentLength size of "+B+" exceeded",R.ERR_BAD_RESPONSE,d,ee);Rt&&Rt(j)};st=new o(dc(st.body,yc,ws,()=>{Nt&&Nt(),Pe&&Pe()}),V)}K=K||"text";let lt=await T[p.findKey(T,K)||"text"](st,d);if(F&&!N&&!Dn){let V;if(lt!=null&&(typeof lt.byteLength=="number"?V=lt.byteLength:typeof lt.size=="number"?V=lt.size:typeof lt=="string"&&(V=typeof r=="function"?new r().encode(lt).byteLength:lt.length)),typeof V=="number"&&V>B)throw new R("maxContentLength size of "+B+" exceeded",R.ERR_BAD_RESPONSE,d,ee)}return!Dn&&Pe&&Pe(),await new Promise((V,we)=>{cp(V,we,{data:lt,headers:Ne.from(st.headers),status:st.status,statusText:st.statusText,config:d,request:ee})})}catch(J){if(Pe&&Pe(),ge&&ge.aborted&&ge.reason instanceof R){const Ve=ge.reason;throw Ve.config=d,ee&&(Ve.request=ee),J!==Ve&&Object.defineProperty(Ve,"cause",{__proto__:null,value:J,writable:!0,enumerable:!1,configurable:!0}),Ve}if(X)throw ee&&!X.request&&(X.request=ee),X;if(te)throw te;if(J instanceof R)throw ee&&!J.request&&(J.request=ee),J;if(J&&J.name==="TypeError"&&/Load failed|fetch/i.test(J.message)){const Ve=new R("Network Error",R.ERR_NETWORK,d,ee,J&&J.response);throw Object.defineProperty(Ve,"cause",{__proto__:null,value:J.cause||J,writable:!0,enumerable:!1,configurable:!0}),Ve}throw R.from(J,J&&J.code,d,ee,J&&J.response)}}},Cg=new Map,gp=e=>{const t=Object.create(null),n=e&&p.hasOwnProp(e,"env")&&e.env;["fetch","Request","Response","Blob"].forEach(v=>{n&&p.hasOwnProp(n,v)&&(t[v]=n[v])});const{fetch:r,Request:s,Response:l,Blob:o}=t,a=[s,l,r,o];let u=a.length,c=u,m,g,y=Cg;for(;c--;)m=a[c],g=y.get(m),g===void 0&&y.set(m,g=c?new Map:Eg(t)),y=g;return g};gp();const Fa={http:Oy,xhr:cg,fetch:{get:gp}};p.forEach(Fa,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch{}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});const vc=e=>`- ${e}`,bg=e=>p.isFunction(e)||e===null||e===!1;function Og(e,t){e=p.isArray(e)?e:[e];const{length:n}=e;let r,s;const l={};for(let o=0;o`adapter ${u} `+(c===!1?"is not supported by the environment":"is not available in the build"));let a=n?o.length>1?`since : +`+o.map(vc).join(` +`):" "+vc(o[0]):"as no adapter specified";throw new R("There is no suitable adapter to dispatch the request "+a,R.ERR_NOT_SUPPORT)}return s}const xp={getAdapter:Og,adapters:Fa};function Po(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new xs(null,e)}function Rg(){return typeof performance<"u"&&p.isFunction(performance.now)?()=>performance.now():Date.now}function wc(e,t){return Math.max(0,Math.round(e()-t))}function To(e){const t=p.toSafeFlatObject(e);Po(t),t.headers=Ne.from(p.getSafeProp(t,"headers")),t.data=bo.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1);const n=xp.getAdapter(t.adapter||gs.adapter,t),r=Rg(),s=r();return n(t).then(function(o){Po(t),o.duration=wc(r,s),t.response=o;try{o.data=bo.call(t,t.transformResponse,o)}finally{delete t.response}return o.headers=Ne.from(o.headers),o},function(o){if(!up(o)&&(Po(t),o&&o.response)){o.response.duration=wc(r,s),t.response=o.response;try{o.response.data=bo.call(t,t.transformResponse,o.response)}finally{delete t.response}o.response.headers=Ne.from(o.response.headers)}return Promise.reject(o)})}const Xl={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Xl[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const kc={};Xl.transitional=function(t,n,r){function s(l,o){return"[Axios v"+Da+"] Transitional option '"+l+"'"+o+(r?". "+r:"")}return(l,o,a)=>{if(t===!1)throw new R(s(o," has been removed"+(n?" in "+n:"")),R.ERR_DEPRECATED);return n&&!kc[o]&&(kc[o]=!0,console.warn(s(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(l,o,a):!0}};Xl.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function Pg(e,t,n){if(typeof e!="object"||e===null)throw new R("options must be an object",R.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const l=r[s],o=Object.prototype.hasOwnProperty.call(t,l)?t[l]:void 0;if(o){const a=e[l],u=a===void 0||o(a,l,e);if(u!==!0)throw new R("option "+l+" must be "+u,R.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new R("Unknown option "+l,R.ERR_BAD_OPTION)}}const nl={assertOptions:Pg,validators:Xl},_e=nl.validators,Ao=e=>{if(e==null||p.isPlainObject(e)||e instanceof Ne)return!0;try{return p.isObject(e)&&p.getSafeProp(e,Symbol.toStringTag)==="AxiosHeaders"&&["toJSON","set","get","has","delete","clear","normalize","concat","toString",Symbol.iterator].every(t=>p.isFunction(p.getSafeProp(e,t)))}catch{return!1}};let Sn=class{constructor(t){this.defaults=t||{},this.interceptors={request:new nc,response:new nc}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error)try{let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const l=s.stack;let o="";if(typeof l=="string"){const a=l.indexOf(` +`);o=a===-1?"":l.slice(a+1)}if(!r.stack)r.stack=o;else if(o){const a=o.indexOf(` +`),u=a===-1?-1:o.indexOf(` +`,a+1),c=u===-1?o:o.slice(u+1),m=String(r.stack),g=Cy(r,m),y=g===-1?m:m.slice(0,g),v=g===-1?"":m.slice(g);y.endsWith(c)||(r.stack=y+` +`+o+v)}}catch{}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Rn(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:l}=n;r!==void 0&&nl.assertOptions(r,{silentJSONParsing:_e.transitional(_e.boolean),forcedJSONParsing:_e.transitional(_e.boolean),clarifyTimeoutError:_e.transitional(_e.boolean),legacyInterceptorReqResOrdering:_e.transitional(_e.boolean),advertiseZstdAcceptEncoding:_e.transitional(_e.boolean),validateStatusUndefinedResolves:_e.transitional(_e.boolean),encodeBasicAuthUsername:_e.transitional(_e.boolean)},!1),s!=null&&(p.isFunction(s)?n.paramsSerializer={serialize:s}:nl.assertOptions(s,{encode:_e.function,serialize:_e.function},!0)),n.allowAbsoluteUrls!==void 0||(p.hasOwnProp(this.defaults,"allowAbsoluteUrls")&&this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),nl.assertOptions(n,{baseUrl:_e.spelling("baseURL"),withXsrfToken:_e.spelling("withXSRFToken")},!0),n.method=(p.getSafeProp(n,"method")||p.getSafeProp(this.defaults,"method")||"get").toLowerCase();const o=p.getSafeProp(l,"common"),a=p.getSafeProp(l,n.method),u=l&&p.merge(Ao(o)?o:void 0,Ao(a)?a:void 0);l&&p.forEach(ap.concat("common"),T=>{Ao(p.getSafeProp(l,T))&&delete l[T]}),n.headers=Ne.concat(u,l);const c=[];let m=!0;this.interceptors.request.forEach(function(x){if(typeof x.runWhen=="function"&&x.runWhen(n)===!1)return;m=m&&x.synchronous;const f=n.transitional||za;f&&f.legacyInterceptorReqResOrdering?c.unshift(x.fulfilled,x.rejected):c.push(x.fulfilled,x.rejected)});const g=[];this.interceptors.response.forEach(function(x){g.push(x.fulfilled,x.rejected)});let y,v=0,N;if(!m){const T=[To.bind(this),void 0];for(T.unshift(...c),T.push(...g),N=T.length,y=Promise.resolve(n);vTo.call(this,w)))}catch(d){y=Promise.reject(d)}break}}if(!y)try{y=To.call(this,w)}catch(T){y=Promise.reject(T)}for(v=0,N=g.length;v{if(!r._listeners)return;let l=r._listeners.length;for(;l-- >0;)r._listeners[l](s);r._listeners=null}),this.promise.then=s=>{let l;const o=new Promise(a=>{r.subscribe(a),l=a}).then(s);return o.cancel=function(){r.unsubscribe(l)},o},t(function(l,o,a){r.reason||(r.reason=new xs(l,o,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new vp(function(s){t=s}),cancel:t}}};function Ag(e){return function(n){return e.apply(null,n)}}function zg(e){return p.isObject(e)&&e.isAxiosError===!0}const rl={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,ContentTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,UnprocessableContent:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(rl).forEach(([e,t])=>{rl[t]===void 0&&(rl[t]=e)});function wp(e){const t=new Sn(e),n=Hf(Sn.prototype.request,t);return p.extend(n,Sn.prototype,t,{allOwnKeys:!0}),p.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return wp(Rn(e,s))},n}const ye=wp(gs);ye.Axios=Sn;ye.CanceledError=xs;ye.CancelToken=Tg;ye.isCancel=up;ye.VERSION=Da;ye.toFormData=Jl;ye.AxiosError=R;ye.Cancel=ye.CanceledError;ye.all=function(t){return Promise.all(t)};ye.spread=Ag;ye.isAxiosError=zg;ye.mergeConfig=Rn;ye.AxiosHeaders=Ne;ye.formToJSON=e=>ip(p.isHTMLForm(e)?new FormData(e):e);ye.getAdapter=xp.getAdapter;ye.HttpStatusCode=rl;ye.default=ye;const{Axios:Xg,AxiosError:Yg,CanceledError:Zg,isCancel:ex,CancelToken:tx,VERSION:nx,all:rx,Cancel:sx,isAxiosError:lx,spread:ox,toFormData:ix,AxiosHeaders:ax,HttpStatusCode:ux,formToJSON:cx,getAdapter:dx,mergeConfig:fx,create:px}=ye;function Pl(){const{pathname:e}=window.location;return e.endsWith("/")?e:e+"/"}const le=ye.create({baseURL:Pl(),timeout:12e4});le.interceptors.request.use(e=>{const t=localStorage.getItem("panelToken");return t&&(e.headers.Authorization=`Bearer ${t}`),e});le.interceptors.response.use(e=>e,e=>{var t;return((t=e.response)==null?void 0:t.status)===401&&(localStorage.removeItem("panelToken"),window.location.href=Pl()),Promise.reject(e)});function Lg({onSuccess:e}){const[t,n]=b.useState(""),[r,s]=b.useState(!1),[l,o]=b.useState(""),[a,u]=b.useState(!1),c=async m=>{var g,y;m.preventDefault(),o(""),u(!0);try{const v=await le.post("/auth/login",{password:t});localStorage.setItem("panelToken",v.data.token),e()}catch(v){o(((y=(g=v.response)==null?void 0:g.data)==null?void 0:y.detail)||"登录失败")}finally{u(!1)}};return i.jsx("div",{className:"min-h-screen flex items-center justify-center p-4",children:i.jsxs("div",{className:"w-full max-w-md",children:[i.jsxs("div",{className:"text-center mb-8",children:[i.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-2xl bg-purple-600/20 mb-4",children:i.jsx(us,{className:"w-10 h-10 text-purple-400"})}),i.jsx("h1",{className:"text-3xl font-bold text-white",children:"AGY2API"}),i.jsx("p",{className:"text-gray-400 mt-2",children:"Antigravity API 代理服务控制面板"})]}),i.jsxs("div",{className:"card",children:[i.jsx("h2",{className:"text-xl font-semibold mb-6 text-center",children:"登录控制面板"}),l&&i.jsx("div",{className:"bg-red-500/10 border border-red-500/30 text-red-400 px-4 py-3 rounded-lg mb-4",children:l}),i.jsxs("form",{onSubmit:c,className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:"密码"}),i.jsxs("div",{className:"relative",children:[i.jsx("input",{type:r?"text":"password",value:t,onChange:m=>n(m.target.value),className:"w-full px-4 py-3 bg-dark-800 border border-dark-600 rounded-lg text-white placeholder-gray-500 pr-12",placeholder:"请输入控制面板密码",required:!0}),i.jsx("button",{type:"button",onClick:()=>s(!r),className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-300",children:r?i.jsx(e0,{size:20}):i.jsx(t0,{size:20})})]})]}),i.jsx("button",{type:"submit",disabled:a,className:"w-full btn btn-primary py-3 flex items-center justify-center disabled:opacity-50",children:a?i.jsx("span",{className:"animate-spin rounded-full h-5 w-5 border-b-2 border-white"}):"登录"})]})]})]})})}function lr({type:e="info",title:t,children:n,onClose:r}){b.useEffect(()=>{const l=o=>{o.key==="Escape"&&(r==null||r())};return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[r]);const s={success:{icon:i.jsx(sr,{size:20,className:"text-green-400"}),border:"border-green-500/40",iconBg:"bg-green-500/15"},error:{icon:i.jsx(Ci,{size:20,className:"text-red-400"}),border:"border-red-500/40",iconBg:"bg-red-500/15"},info:{icon:i.jsx(Wr,{size:20,className:"text-blue-400"}),border:"border-blue-500/40",iconBg:"bg-blue-500/15"}}[e]||{};return i.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/60",onClick:r,children:i.jsxs("div",{className:`card max-w-md w-full border ${s.border} p-0 overflow-hidden`,onClick:l=>l.stopPropagation(),children:[i.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-dark-700",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:`p-1.5 rounded-lg ${s.iconBg}`,children:s.icon}),i.jsx("h3",{className:"text-sm font-semibold text-gray-200",children:t})]}),i.jsx("button",{onClick:r,className:"text-gray-400 hover:text-white",children:i.jsx($f,{size:16})})]}),i.jsx("div",{className:"px-4 py-3 text-sm text-gray-300 max-h-[60vh] overflow-y-auto break-all",children:n}),i.jsx("div",{className:"px-4 py-3 border-t border-dark-700 text-right",children:i.jsx("button",{onClick:r,className:"btn btn-secondary text-xs px-4 py-1.5",children:"关闭"})})]})})}function Dg(){const[e,t]=b.useState(!1),[n,r]=b.useState(!1),[s,l]=b.useState(""),[o,a]=b.useState(""),[u,c]=b.useState(!1),[m,g]=b.useState(""),[y,v]=b.useState(null),[N,w]=b.useState(!1),T=async()=>{var k,S;t(!0),v(null),l(""),g("");try{const E=await le.post("/auth/start",{});l(E.data.auth_url),v({type:"info",text:"已生成认证链接,请在新窗口完成 Google 授权"})}catch(E){v({type:"error",text:((S=(k=E.response)==null?void 0:k.data)==null?void 0:S.detail)||"获取认证链接失败"})}finally{t(!1)}},x=async()=>{var k,S;r(!0);try{const E=await le.post("/auth/callback",{});g(JSON.stringify(E.data.credentials,null,2)),v({type:"success",text:`认证成功!凭证已保存:${E.data.email||"未知邮箱"}`})}catch(E){v({type:"error",text:((S=(k=E.response)==null?void 0:k.data)==null?void 0:S.detail)||"获取凭证失败,请确认已完成授权"})}finally{r(!1)}},f=async()=>{var k,S;if(!o.trim()){v({type:"error",text:"请粘贴完整的回调URL"});return}r(!0);try{const E=await le.post("/auth/callback-url",{callback_url:o.trim()});g(JSON.stringify(E.data.credentials,null,2)),v({type:"success",text:`认证成功!凭证已保存:${E.data.email||"未知邮箱"}`})}catch(E){v({type:"error",text:((S=(k=E.response)==null?void 0:k.data)==null?void 0:S.detail)||"从回调URL获取凭证失败"})}finally{r(!1)}},d=()=>{navigator.clipboard.writeText(s),w(!0),setTimeout(()=>w(!1),1500)},h=()=>{const k=new Blob([m],{type:"application/json"}),S=URL.createObjectURL(k),E=document.createElement("a");E.href=S,E.download="antigravity-credentials.json",E.click(),URL.revokeObjectURL(S)};return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"bg-gradient-to-br from-orange-900/30 to-orange-800/10 border border-orange-700/30 rounded-xl p-5",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx(us,{className:"w-5 h-5 text-orange-400"}),i.jsx("h3",{className:"text-lg font-semibold text-orange-400",children:"Antigravity 认证模式"})]}),i.jsx("p",{className:"text-sm text-gray-400",children:"通过 Google OAuth 获取 Antigravity 凭证。授权成功后系统会自动获取 Project ID 和订阅等级,并保存凭证到数据库。"})]}),y&&i.jsx(lr,{type:y.type,title:y.type==="success"?"操作成功":y.type==="error"?"操作失败":"提示",onClose:()=>v(null),children:i.jsx("span",{className:"whitespace-pre-wrap break-all",children:y.text})}),i.jsxs("button",{onClick:T,disabled:e,className:"btn btn-primary flex items-center gap-2 disabled:opacity-50",children:[e?i.jsx(kt,{className:"animate-spin",size:18}):i.jsx(us,{size:18}),"获取 Antigravity 认证链接"]}),s&&i.jsxs("div",{className:"card space-y-4",children:[i.jsx("h3",{className:"font-semibold",children:"认证链接"}),i.jsxs("div",{className:"bg-dark-800 border border-purple-500/30 rounded-lg p-4 flex items-center justify-between gap-3",children:[i.jsxs("a",{href:s,target:"_blank",rel:"noopener noreferrer",className:"text-purple-400 hover:text-purple-300 break-all text-sm flex items-center gap-1",children:["点击此链接进行 Google 认证 ",i.jsx(Uf,{size:14})]}),i.jsxs("button",{onClick:d,className:"btn btn-secondary text-xs px-3 py-1.5 flex items-center gap-1 flex-shrink-0",children:[N?i.jsx(Ff,{size:14}):i.jsx(Yh,{size:14}),N?"已复制":"复制"]})]}),i.jsxs("div",{className:"bg-blue-500/10 border border-blue-500/30 rounded-lg p-4 text-sm text-gray-400",children:[i.jsx("p",{className:"font-medium text-blue-400 mb-2",children:"使用说明"}),i.jsxs("ol",{className:"list-decimal list-inside space-y-1",children:[i.jsx("li",{children:"点击上方认证链接,在新窗口中完成 Google 账号授权"}),i.jsx("li",{children:"授权成功后会跳转到 localhost 显示成功页面"}),i.jsx("li",{children:"关闭 OAuth 窗口,返回本页面"}),i.jsx("li",{children:'点击下方"获取凭证"按钮完成流程'})]})]}),i.jsxs("div",{className:"border border-dark-600 rounded-lg",children:[i.jsxs("button",{onClick:()=>c(!u),className:"w-full flex items-center justify-between px-4 py-3 text-sm text-gray-400 hover:text-gray-200",children:[i.jsx("span",{children:"🚀 无法回源?试试快捷方式(粘贴回调URL)"}),i.jsx(Mf,{size:16,className:`transition-transform ${u?"rotate-180":""}`})]}),u&&i.jsxs("div",{className:"px-4 pb-4 space-y-3",children:[i.jsx("p",{className:"text-xs text-gray-500",children:"适用场景:云服务器/VPS、Docker 容器、防火墙阻止回调端口等。 完成 Google 授权后,复制浏览器地址栏的完整 URL 粘贴到下方。"}),i.jsx("textarea",{value:o,onChange:k=>a(k.target.value),placeholder:"http://localhost:11451/?state=xxx&code=xxx&scope=xxx...",className:"w-full px-3 py-2 bg-dark-800 border border-dark-600 rounded-lg text-sm text-white placeholder-gray-500",rows:3}),i.jsxs("button",{onClick:f,disabled:n,className:"btn btn-secondary text-sm flex items-center gap-2 disabled:opacity-50",children:[n&&i.jsx(kt,{className:"animate-spin",size:14}),"从回调URL获取凭证"]})]})]}),i.jsxs("button",{onClick:x,disabled:n,className:"btn btn-primary flex items-center gap-2 disabled:opacity-50",children:[n&&i.jsx(kt,{className:"animate-spin",size:18}),"获取 Antigravity 凭证"]})]}),m&&i.jsxs("div",{className:"card space-y-4",children:[i.jsx("h3",{className:"font-semibold",children:"凭证内容"}),i.jsx("pre",{className:"bg-dark-800 border border-dark-600 rounded-lg p-4 text-xs text-gray-300 overflow-x-auto max-h-96 overflow-y-auto",children:m}),i.jsx("button",{onClick:h,className:"btn btn-secondary text-sm",children:"下载凭证文件"})]})]})}function Ct({value:e,onChange:t,options:n,className:r="",disabled:s=!1}){const[l,o]=b.useState(!1),[a,u]=b.useState({dropUp:!1,maxHeight:240}),c=b.useRef(null);b.useEffect(()=>{if(!l)return;const y=N=>{c.current&&!c.current.contains(N.target)&&o(!1)},v=N=>{N.key==="Escape"&&o(!1)};return document.addEventListener("mousedown",y),document.addEventListener("touchstart",y),document.addEventListener("keydown",v),()=>{document.removeEventListener("mousedown",y),document.removeEventListener("touchstart",y),document.removeEventListener("keydown",v)}},[l]);const m=()=>{if(!s){if(!l&&c.current){const y=c.current.getBoundingClientRect(),v=window.innerHeight-y.bottom,N=y.top,w=Math.min(n.length*40+10,240);v>=w||v>=N?u({dropUp:!1,maxHeight:Math.min(v-8,w)}):u({dropUp:!0,maxHeight:Math.min(N-8,w)})}o(y=>!y)}},g=n.find(y=>y.value===e);return i.jsxs("div",{ref:c,className:`relative ${r}`,children:[i.jsxs("button",{type:"button",disabled:s,"aria-haspopup":"listbox","aria-expanded":l,onClick:m,className:`w-full flex items-center justify-between gap-1 text-left bg-dark-800 border border-dark-600 rounded-lg px-3 py-2 text-gray-200 text-xs sm:text-sm focus:outline-none focus:ring-2 focus:ring-purple-500/50 ${l?"ring-2 ring-purple-500/50 border-purple-500/50":""} ${s?"opacity-40 cursor-not-allowed":"cursor-pointer"}`,children:[i.jsx("span",{className:"truncate",children:g?g.label:""}),i.jsx(Mf,{size:14,className:`shrink-0 text-gray-400 transition-transform duration-200 ${l?"rotate-180":""}`})]}),l&&i.jsx("div",{role:"listbox",style:{maxHeight:Math.max(a.maxHeight,96)},className:`absolute left-0 right-0 z-20 overflow-y-auto rounded-lg border border-dark-600 bg-dark-800 py-1 shadow-xl ${a.dropUp?"bottom-full mb-1":"top-full mt-1"}`,children:n.map(y=>i.jsxs("button",{type:"button",role:"option","aria-selected":y.value===e,onClick:()=>{t(y.value),o(!1)},className:`flex w-full items-center justify-between gap-2 px-3 py-2.5 sm:py-2 text-left text-xs sm:text-sm ${y.value===e?"bg-purple-600/20 text-purple-300":"text-gray-200 hover:bg-dark-700"}`,children:[i.jsx("span",{className:"truncate",children:y.label}),y.value===e&&i.jsx(Ff,{size:14,className:"shrink-0"})]},y.value))})]})}function Fg(){var st,xr,Dn,lt,V,we,Rt,Nt,vr,ws;const[e,t]=b.useState([]),[n,r]=b.useState({total:0,normal:0,disabled:0}),[s,l]=b.useState(0),[o,a]=b.useState(1),[u,c]=b.useState(20),[m,g]=b.useState("all"),[y,v]=b.useState("all"),[N,w]=b.useState("all"),[T,x]=b.useState("all"),[f,d]=b.useState(!0),[h,k]=b.useState(new Set),[S,E]=b.useState(null),[_,M]=b.useState(null),[O,$]=b.useState(new Set),[K,re]=b.useState(Date.now()/1e3),[q,pt]=b.useState(null),[B,Fe]=b.useState({}),[A,F]=b.useState(null);b.useEffect(()=>{const j=setInterval(()=>re(Date.now()/1e3),1e3);return()=>clearInterval(j)},[]);const L=b.useCallback(async()=>{var j,D;d(!0);try{const U=(o-1)*u,I=await le.get("/creds/status",{params:{offset:U,limit:u,status_filter:m,error_code_filter:y,cooldown_filter:N,tier_filter:T}});t(I.data.items),l(I.data.total),r(I.data.stats||{total:0,normal:0,disabled:0}),k(new Set)}catch(U){H("error",((D=(j=U.response)==null?void 0:j.data)==null?void 0:D.detail)||"加载凭证失败")}finally{d(!1)}},[o,u,m,y,N,T]);b.useEffect(()=>{L()},[L]);const H=b.useCallback((j,D,U)=>{E({type:j,text:D,title:U||(j==="success"?"操作成功":j==="error"?"操作失败":"提示")})},[]),Q=(j,D)=>{$(U=>{const I=new Set(U);return D?I.add(j):I.delete(j),I})},ge=async(j,D)=>{var U,I;Q(j,!0);try{const W=await le.post("/creds/action",{email:j,action:D});H("success",W.data.message),L()}catch(W){H("error",((I=(U=W.response)==null?void 0:U.data)==null?void 0:I.detail)||"操作失败")}finally{Q(j,!1)}},ee=async j=>{var D,U,I;if(h.size!==0){Q("__batch__",!0);try{const W=await le.post("/creds/batch-action",{action:j,emails:Array.from(h)});H((D=W.data.errors)!=null&&D.length?"error":"success",W.data.message),L()}catch(W){H("error",((I=(U=W.response)==null?void 0:U.data)==null?void 0:I.detail)||"批量操作失败")}finally{Q("__batch__",!1)}}},Pe=async j=>{var D,U,I,W,se,Ie;Q(j,!0);try{const je=await le.post(`/creds/verify-project/${encodeURIComponent(j)}`);if(je.data.success){const ks=Array.isArray(je.data.supported_models)?je.data.supported_models.length:0;H("success",`Project=${je.data.project_id}, Tier=${je.data.subscription_tier}, 模型数=${ks}`,`检验成功: ${j}`)}else H("error",je.data.message||je.data.error||"检验失败",`检验失败: ${j}`);L()}catch(je){H("error",((U=(D=je.response)==null?void 0:D.data)==null?void 0:U.detail)||((W=(I=je.response)==null?void 0:I.data)==null?void 0:W.error)||((Ie=(se=je.response)==null?void 0:se.data)==null?void 0:Ie.message)||"检验失败",`检验失败: ${j}`)}finally{Q(j,!1)}},P=async j=>{var D,U;Q(j,!0);try{const I=await le.post(`/creds/refresh-models/${encodeURIComponent(j)}`);if(I.data.success){const W=I.data.supported_models||[];F(se=>se&&se.email===j?{...se,models:W}:se),L()}}catch(I){H("error",((U=(D=I.response)==null?void 0:D.data)==null?void 0:U.detail)||"刷新模型列表失败",`刷新失败: ${j}`)}finally{Q(j,!1)}},X=async j=>{var D,U;Q(j,!0);try{const I=await le.post(`/creds/test/${encodeURIComponent(j)}`);H("success",I.data.message||(I.status===429?"凭证被限流(429)但有效":"凭证测试通过"),`测试成功: ${j}`),L()}catch(I){const W=((D=I.response)==null?void 0:D.data)||{},se=(U=I.response)==null?void 0:U.status,Ie=W.error||W.detail||W.message||"测试失败";H(se===429?"info":"error",`HTTP ${se} +${Ie}`,`测试失败: ${j}`),L()}finally{Q(j,!1)}},te=async j=>{pt({email:j}),Q(j,!0);try{const D=await le.get(`/creds/quota/${encodeURIComponent(j)}`);if(D.data.success){const U=Te(D.data.quotaGroups||[]);Fe(I=>({...I,[j]:U}))}else Fe(U=>({...U,[j]:{error:D.data.error||"获取额度失败"}}))}catch(D){Fe(U=>{var I,W,se,Ie;return{...U,[j]:{error:((W=(I=D.response)==null?void 0:I.data)==null?void 0:W.detail)||((Ie=(se=D.response)==null?void 0:se.data)==null?void 0:Ie.error)||"获取额度失败"}}})}finally{Q(j,!1)}},Te=j=>{const D={claude:{remaining:0,count:0,resetTime:""},gemini:{remaining:0,count:0,resetTime:""}};return j.forEach(U=>{const W=(U.displayName||"").toLowerCase().includes("claude")?D.claude:D.gemini;W.count+=1;let se=null,Ie="";if((U.buckets||[]).forEach(je=>{const ks=(je.remainingFraction||0)*100;(se===null||ks1&&(D.claude.remaining=Math.round(D.claude.remaining/D.claude.count)),D.gemini.count>1&&(D.gemini.remaining=Math.round(D.gemini.remaining/D.gemini.count)),D},J=j=>j>=80?{bar:"bg-green-500",text:"text-green-400"}:j>=40?{bar:"bg-yellow-500",text:"text-yellow-400"}:j>=20?{bar:"bg-orange-500",text:"text-orange-400"}:{bar:"bg-red-500",text:"text-red-400"},Ve=async j=>{var D,U;try{const I=await le.get(`/creds/export/${encodeURIComponent(j)}`,{responseType:"blob"}),W=URL.createObjectURL(I.data),se=document.createElement("a");se.href=W,se.download=`${j}.json`,se.click(),URL.revokeObjectURL(W),H("success",`已导出 ${j}.json`)}catch(I){H("error",((U=(D=I.response)==null?void 0:D.data)==null?void 0:U.detail)||"导出失败")}},Me=async()=>{var j,D;Q("__batch__",!0);try{const U=await le.get("/creds/download-all",{responseType:"blob"}),I=URL.createObjectURL(U.data),W=document.createElement("a");W.href=I,W.download="antigravity_credentials.zip",W.click(),URL.revokeObjectURL(I)}catch(U){H("error",((D=(j=U.response)==null?void 0:j.data)==null?void 0:D.detail)||"下载失败")}finally{Q("__batch__",!1)}},An=async j=>{var D,U;try{const I=await le.get(`/creds/errors/${encodeURIComponent(j)}`);M(I.data)}catch(I){H("error",((U=(D=I.response)==null?void 0:D.data)==null?void 0:U.detail)||"获取错误信息失败")}},zn=j=>{k(D=>{const U=new Set(D);return U.has(j)?U.delete(j):U.add(j),U})},Ln=()=>{h.size===e.length?k(new Set):k(new Set(e.map(j=>j.email)))},pn=Math.max(1,Math.ceil(s/u)),vs=j=>j?new Date(j*1e3).toLocaleString():"-",Xe=j=>{const D=Object.entries(j||{}).filter(([,je])=>je>K);if(!D.length)return null;const I=Math.max(...D.map(([,je])=>je))-K,W=Math.floor(I/3600),se=Math.floor(I%3600/60),Ie=Math.floor(I%60);return W>0?`${W}h${se}m`:se>0?`${se}m${Ie}s`:`${Ie}s`},mt=j=>j==="ultra"?"bg-red-500/10 text-red-400 border-red-500/30":j==="pro"?"bg-amber-500/10 text-amber-400 border-amber-500/30":"bg-blue-500/10 text-blue-400 border-blue-500/30";return i.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[S&&i.jsx(lr,{type:S.type,title:S.title,onClose:()=>E(null),children:i.jsx("span",{className:"whitespace-pre-wrap",children:S.text})}),i.jsxs("div",{className:"grid grid-cols-3 gap-2 sm:gap-4",children:[i.jsxs("div",{className:"bg-dark-800 border border-dark-600 rounded-xl p-3 sm:p-4 text-center",children:[i.jsx("div",{className:"text-xl sm:text-2xl font-bold text-white",children:n.total}),i.jsx("div",{className:"text-xs text-gray-500 mt-0.5",children:"总计"})]}),i.jsxs("div",{className:"bg-emerald-900/20 border border-emerald-700/30 rounded-xl p-3 sm:p-4 text-center",children:[i.jsx("div",{className:"text-xl sm:text-2xl font-bold text-emerald-400",children:n.normal}),i.jsx("div",{className:"text-xs text-gray-500 mt-0.5",children:"正常"})]}),i.jsxs("div",{className:"bg-red-900/20 border border-red-700/30 rounded-xl p-3 sm:p-4 text-center",children:[i.jsx("div",{className:"text-xl sm:text-2xl font-bold text-red-400",children:n.disabled}),i.jsx("div",{className:"text-xs text-gray-500 mt-0.5",children:"禁用"})]})]}),i.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[i.jsxs("button",{onClick:L,disabled:f,className:"btn btn-secondary text-xs sm:text-sm px-3 py-1.5 sm:px-4 sm:py-2 flex items-center gap-1.5",children:[i.jsx(Gt,{size:15,className:f?"animate-spin":""}),"刷新状态"]}),i.jsxs("button",{onClick:Me,disabled:O.has("__batch__"),className:"btn btn-secondary text-xs sm:text-sm px-3 py-1.5 sm:px-4 sm:py-2 flex items-center gap-1.5",children:[i.jsx(Ku,{size:15}),"打包导出"]})]}),i.jsxs("div",{className:"grid grid-cols-2 sm:flex sm:flex-wrap gap-2 sm:gap-3 text-sm",children:[i.jsx(Ct,{value:m,onChange:j=>{g(j),a(1)},className:"w-full sm:w-32",options:[{value:"all",label:"全部凭证"},{value:"enabled",label:"仅启用"},{value:"disabled",label:"仅禁用"}]}),i.jsx(Ct,{value:y,onChange:j=>{v(j),a(1)},className:"w-full sm:w-32",options:[{value:"all",label:"错误码: 全部"},{value:"none",label:"无错误"},{value:"400",label:"400"},{value:"403",label:"403"},{value:"429",label:"429"},{value:"500",label:"500"}]}),i.jsx(Ct,{value:N,onChange:j=>{w(j),a(1)},className:"w-full sm:w-32",options:[{value:"all",label:"冷却: 全部"},{value:"in_cooldown",label:"CD中"},{value:"no_cooldown",label:"未CD"}]}),i.jsx(Ct,{value:T,onChange:j=>{x(j),a(1)},className:"w-full sm:w-32",options:[{value:"all",label:"Tier: 全部"},{value:"free",label:"Free"},{value:"pro",label:"Pro"},{value:"ultra",label:"Ultra"}]}),i.jsx(Ct,{value:u,onChange:j=>{c(Number(j)),a(1)},className:"w-full sm:w-32",options:[20,50,100,200,500,1e3].map(j=>({value:j,label:`每页 ${j}`}))})]}),i.jsx("div",{className:"card p-3 sm:p-4",children:i.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-2 text-sm",children:[i.jsxs("label",{className:"flex items-center gap-2 text-gray-400 cursor-pointer select-none",children:[i.jsx("input",{type:"checkbox",checked:h.size===e.length&&e.length>0,onChange:Ln,className:"accent-purple-600 w-4 h-4"}),"全选"]}),i.jsxs("span",{className:"text-gray-500 text-xs",children:["已选 ",h.size," 项"]}),i.jsxs("div",{className:"flex flex-wrap gap-2",children:[i.jsx("button",{onClick:()=>ee("enable"),disabled:h.size===0||O.has("__batch__"),className:"btn btn-secondary text-xs px-3 py-1.5 disabled:opacity-40",children:"批量启用"}),i.jsx("button",{onClick:()=>ee("disable"),disabled:h.size===0||O.has("__batch__"),className:"btn btn-secondary text-xs px-3 py-1.5 disabled:opacity-40",children:"批量禁用"}),i.jsx("button",{onClick:()=>ee("refresh_models"),disabled:h.size===0||O.has("__batch__"),className:"btn btn-secondary text-xs px-3 py-1.5 disabled:opacity-40",children:"批量刷新模型"}),i.jsx("button",{onClick:()=>ee("delete"),disabled:h.size===0||O.has("__batch__"),className:"btn btn-danger text-xs px-3 py-1.5 disabled:opacity-40",children:"批量删除"})]})]})}),f?i.jsx("div",{className:"flex items-center justify-center py-12",children:i.jsx(kt,{className:"animate-spin text-purple-500",size:28})}):e.length===0?i.jsx("div",{className:"card text-center py-12 text-gray-500 text-sm",children:"没有凭证。请先通过 OAuth 认证或批量导入添加凭证。"}):i.jsx("div",{className:"grid gap-3 sm:gap-4 grid-cols-1 md:grid-cols-2 xl:grid-cols-3",children:e.map(j=>{var I,W;const D=Xe(j.model_cooldowns),U=O.has(j.email);return i.jsxs("div",{className:`card p-3 sm:p-4 space-y-3 transition-colors ${j.disabled?"border-red-500/30":""}`,children:[i.jsxs("div",{className:"flex items-start gap-2.5",children:[i.jsx("input",{type:"checkbox",checked:h.has(j.email),onChange:()=>zn(j.email),className:"accent-purple-600 w-4 h-4 flex-shrink-0 mt-0.5"}),i.jsxs("div",{className:"flex-1 min-w-0 space-y-1.5",children:[i.jsx("div",{className:"text-sm font-medium text-white break-all leading-snug",children:j.email}),i.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[i.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full border ${mt(j.tier)}`,children:j.tier||"pro"}),j.disabled?i.jsxs("span",{className:"text-red-400 text-xs flex items-center gap-1",children:[i.jsx(Qu,{size:12})," 禁用"]}):i.jsxs("span",{className:"text-emerald-400 text-xs flex items-center gap-1",children:[i.jsx(sr,{size:12})," 启用"]})]})]})]}),i.jsxs("div",{className:"space-y-1 text-xs",children:[i.jsxs("div",{className:"flex items-center justify-between gap-2",children:[D?i.jsxs("span",{className:"text-cyan-400 flex items-center gap-1",children:[i.jsx(d0,{size:12})," CD ",D]}):i.jsxs("span",{className:"text-gray-600 flex items-center gap-1",children:[i.jsx(bi,{size:12})," 无CD"]}),(I=j.error_codes)!=null&&I.length?i.jsxs("button",{onClick:()=>An(j.email),className:"text-red-400 hover:text-red-300 flex items-center gap-1",children:[i.jsx(Ci,{size:12}),j.error_codes.join(",")]}):i.jsxs("span",{className:"text-gray-600 flex items-center gap-1",children:[i.jsx(sr,{size:12})," 无错误"]})]}),i.jsxs("div",{className:"flex items-center justify-between gap-2 text-gray-500",children:[i.jsxs("div",{className:"flex items-center gap-1 min-w-0",children:[i.jsx(bi,{size:12,className:"flex-shrink-0"}),i.jsx("span",{className:"truncate",title:vs(j.last_success),children:vs(j.last_success)})]}),i.jsxs("button",{onClick:()=>F({email:j.email,models:j.supported_models||[]}),className:"text-purple-400 hover:text-purple-300 flex items-center gap-1 flex-shrink-0",title:"点击查看或刷新该凭证支持的模型列表",children:[i.jsx(If,{size:12}),(W=j.supported_models)!=null&&W.length?`模型 ${j.supported_models.length}`:"模型未检测"]})]})]}),i.jsx("div",{className:"grid grid-cols-3 gap-1.5 pt-1 border-t border-dark-700",children:U?i.jsx("div",{className:"col-span-3 flex items-center justify-center py-1.5",children:i.jsx(kt,{size:16,className:"animate-spin text-purple-400"})}):i.jsxs(i.Fragment,{children:[i.jsxs("button",{onClick:()=>Pe(j.email),className:"text-xs px-2 py-1.5 rounded-lg bg-dark-700 hover:bg-dark-600 text-gray-300 flex items-center justify-center gap-1",title:"检验 Project ID / Tier(可修复 403)",children:[i.jsx(c0,{size:13})," 检验"]}),i.jsxs("button",{onClick:()=>X(j.email),className:"text-xs px-2 py-1.5 rounded-lg bg-dark-700 hover:bg-dark-600 text-gray-300 flex items-center justify-center gap-1",title:"测试凭证",children:[i.jsx(Bf,{size:13})," 测试"]}),i.jsxs("button",{onClick:()=>te(j.email),disabled:j.disabled,className:"text-xs px-2 py-1.5 rounded-lg bg-dark-700 hover:bg-dark-600 text-gray-300 flex items-center justify-center gap-1 disabled:opacity-40",title:"查看额度",children:[i.jsx(Df,{size:13})," 额度"]}),i.jsxs("button",{onClick:()=>Ve(j.email),className:"text-xs px-2 py-1.5 rounded-lg bg-dark-700 hover:bg-dark-600 text-gray-300 flex items-center justify-center gap-1",title:"导出凭证(邮箱.json)",children:[i.jsx(Ku,{size:13})," 导出"]}),i.jsxs("button",{onClick:()=>ge(j.email,j.disabled?"enable":"disable"),className:`text-xs px-2 py-1.5 rounded-lg flex items-center justify-center gap-1 ${j.disabled?"bg-emerald-600/20 hover:bg-emerald-600/30 text-emerald-400":"bg-amber-600/20 hover:bg-amber-600/30 text-amber-400"}`,children:[j.disabled?i.jsx(sr,{size:13}):i.jsx(Qu,{size:13}),j.disabled?"启用":"禁用"]}),i.jsxs("button",{onClick:()=>ge(j.email,"delete"),className:"text-xs px-2 py-1.5 rounded-lg bg-red-600/10 hover:bg-red-600/20 text-red-400 flex items-center justify-center gap-1",title:"删除",children:[i.jsx(bl,{size:13})," 删除"]})]})})]},j.email)})}),s>u&&i.jsxs("div",{className:"flex items-center justify-between text-sm",children:[i.jsxs("span",{className:"text-gray-500 text-xs sm:text-sm",children:["共 ",s," 个凭证,第 ",o,"/",pn," 页"]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("button",{onClick:()=>a(j=>Math.max(1,j-1)),disabled:o<=1,className:"btn btn-secondary text-xs px-3 py-1.5 disabled:opacity-40",children:"上一页"}),i.jsxs("span",{className:"text-gray-400 text-xs sm:text-sm",children:[o," / ",pn]}),i.jsx("button",{onClick:()=>a(j=>Math.min(pn,j+1)),disabled:o>=pn,className:"btn btn-secondary text-xs px-3 py-1.5 disabled:opacity-40",children:"下一页"})]})]}),A&&i.jsx(lr,{type:"info",title:`支持模型列表 - ${A.email}`,onClose:()=>F(null),children:i.jsxs("div",{className:"space-y-3",children:[O.has(A.email)?i.jsxs("div",{className:"flex items-center justify-center py-6 text-gray-500",children:[i.jsx(Gt,{size:16,className:"animate-spin mr-2"}),"正在获取模型列表..."]}):((st=A.models)==null?void 0:st.length)>0?i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"text-xs text-gray-400",children:["共支持 ",A.models.length," 个模型:"]}),i.jsx("div",{className:"flex flex-wrap gap-1.5 max-h-60 overflow-y-auto p-2 bg-dark-900/60 border border-dark-700 rounded-lg",children:A.models.map(j=>i.jsx("span",{className:"text-xs px-2 py-0.5 rounded bg-dark-700 text-gray-200 border border-dark-600 font-mono",children:j},j))})]}):i.jsx("div",{className:"text-center py-4 text-gray-500 text-sm",children:"尚未记录该凭证的模型列表,请点击下方按钮检测。"}),i.jsxs("button",{onClick:()=>P(A.email),disabled:O.has(A.email),className:"w-full text-xs text-gray-300 hover:text-white py-2 rounded-lg bg-dark-700 hover:bg-dark-600 flex items-center justify-center gap-1.5 disabled:opacity-50",children:[i.jsx(Gt,{size:12,className:O.has(A.email)?"animate-spin":""}),"刷新模型列表"]})]})}),q&&i.jsx(lr,{type:"info",title:`额度信息 - ${q.email}`,onClose:()=>pt(null),children:O.has(q.email)?i.jsxs("div",{className:"flex items-center justify-center py-6 text-gray-500",children:[i.jsx(Gt,{size:16,className:"animate-spin mr-2"}),"加载额度中..."]}):(xr=B[q.email])!=null&&xr.error?i.jsx("div",{className:"text-center py-4 text-red-400",children:B[q.email].error}):B[q.email]?i.jsxs("div",{className:"space-y-3",children:[((Dn=B[q.email].claude)==null?void 0:Dn.count)>0&&i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[i.jsx("span",{className:"text-purple-400 text-sm",children:"Claude"}),i.jsxs("span",{className:`text-sm font-medium ${J(B[q.email].claude.remaining).text}`,children:[B[q.email].claude.remaining.toFixed(1),"%"]})]}),i.jsx("div",{className:"bg-dark-600 rounded-full h-2",children:i.jsx("div",{className:`h-2 rounded-full ${J(B[q.email].claude.remaining).bar}`,style:{width:`${Math.min(B[q.email].claude.remaining,100)}%`}})})]}),((lt=B[q.email].gemini)==null?void 0:lt.count)>0&&i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[i.jsx("span",{className:"text-cyan-400 text-sm",children:"Gemini"}),i.jsxs("span",{className:`text-sm font-medium ${J(B[q.email].gemini.remaining).text}`,children:[B[q.email].gemini.remaining.toFixed(1),"%"]})]}),i.jsx("div",{className:"bg-dark-600 rounded-full h-2",children:i.jsx("div",{className:`h-2 rounded-full ${J(B[q.email].gemini.remaining).bar}`,style:{width:`${Math.min(B[q.email].gemini.remaining,100)}%`}})})]}),!((V=B[q.email].claude)!=null&&V.count)&&!((we=B[q.email].gemini)!=null&&we.count)&&i.jsx("div",{className:"text-center py-3 text-gray-500",children:"暂无额度数据"}),(((Rt=B[q.email].claude)==null?void 0:Rt.resetTime)||((Nt=B[q.email].gemini)==null?void 0:Nt.resetTime))&&i.jsxs("div",{className:"text-xs text-gray-500 text-right pt-1",children:["重置:"," ",((vr=B[q.email].claude)==null?void 0:vr.resetTime)||((ws=B[q.email].gemini)==null?void 0:ws.resetTime)]}),i.jsxs("button",{onClick:()=>te(q.email),disabled:O.has(q.email),className:"w-full text-xs text-gray-400 hover:text-white py-2 rounded-lg bg-dark-700 hover:bg-dark-600 flex items-center justify-center gap-1.5 disabled:opacity-50",children:[i.jsx(Gt,{size:12,className:O.has(q.email)?"animate-spin":""}),"刷新额度"]})]}):i.jsx("div",{className:"text-center py-4 text-gray-500",children:"加载中..."})}),_&&i.jsx("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center p-4 z-50",onClick:()=>M(null),children:i.jsxs("div",{className:"bg-dark-900 border border-dark-600 rounded-xl max-w-2xl w-full max-h-[80vh] overflow-hidden flex flex-col",onClick:j=>j.stopPropagation(),children:[i.jsxs("div",{className:"flex items-center justify-between px-4 sm:px-5 py-4 border-b border-dark-700",children:[i.jsxs("h3",{className:"font-semibold flex items-center gap-2 text-sm sm:text-base break-all",children:[i.jsx(Ci,{size:16,className:"text-red-400 flex-shrink-0"}),"错误详情 - ",_.email]}),i.jsx("button",{onClick:()=>M(null),className:"text-gray-400 hover:text-white flex-shrink-0",children:"✕"})]}),i.jsxs("div",{className:"p-4 sm:p-5 overflow-y-auto space-y-4",children:[i.jsxs("div",{children:[i.jsx("div",{className:"text-sm text-gray-400 mb-1",children:"错误码"}),i.jsx("div",{className:"text-red-400 text-sm",children:(_.error_codes||[]).join(", ")||"无"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-sm text-gray-400 mb-1",children:"错误信息"}),i.jsx("pre",{className:"bg-dark-800 border border-dark-600 rounded-lg p-3 sm:p-4 text-xs text-gray-300 overflow-auto max-h-56 whitespace-pre-wrap",children:JSON.stringify(_.error_messages,null,2)})]}),i.jsxs("div",{className:"flex flex-wrap gap-2",children:[i.jsx("button",{onClick:()=>{Pe(_.email),M(null)},className:"btn btn-primary text-sm",children:"检验修复(重新获取Project ID)"}),i.jsx("button",{onClick:()=>{X(_.email),M(null)},className:"btn btn-secondary text-sm",children:"测试凭证"})]})]})]})})]})}function Mg(){var N;const[e,t]=b.useState([]),[n,r]=b.useState(!1),[s,l]=b.useState(null),[o,a]=b.useState(!1),u=b.useRef(null),c=w=>{const T=Array.from(w).filter(x=>x.name.endsWith(".json")||x.name.endsWith(".zip"));t(x=>{const f=new Set(x.map(d=>d.name));return[...x,...T.filter(d=>!f.has(d.name))]}),l(null)},m=w=>{t(T=>T.filter(x=>x.name!==w))},g=async()=>{var w,T;if(e.length!==0){r(!0),l(null);try{const x=new FormData;e.forEach(d=>x.append("files",d));const f=await le.post("/creds/upload",x,{headers:{"Content-Type":"multipart/form-data"}});l(f.data)}catch(x){l({error:((T=(w=x.response)==null?void 0:w.data)==null?void 0:T.detail)||"上传失败"})}finally{r(!1)}}},y=(s==null?void 0:s.uploaded_count)||0,v=(s==null?void 0:s.total_count)||0;return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"bg-gradient-to-br from-emerald-900/30 to-emerald-800/10 border border-emerald-700/30 rounded-xl p-5",children:[i.jsx("h3",{className:"text-lg font-semibold text-emerald-400 mb-2",children:"批量导入凭证"}),i.jsx("p",{className:"text-sm text-gray-400",children:"支持批量导入 Antigravity 凭证(.json 或包含 JSON 文件的 .zip)。"}),i.jsxs("div",{className:"mt-3 text-xs text-gray-500 bg-dark-800/60 rounded-lg p-3",children:[i.jsx("p",{className:"mb-1 font-medium text-gray-400",children:"规范 JSON 格式:"}),i.jsx("pre",{className:"text-emerald-300/80 whitespace-pre-wrap font-mono",children:`{ + "refresh_token": "必填", + "access_token": "可选,未过期时直接复用", + "expiry": "可选,access_token 过期时间", + "email": "可选,缺失自动获取", + "tier": "可选,缺失自动获取", + "project_id": "可选,缺失自动获取" +}`}),i.jsx("p",{className:"mt-2",children:"refresh_token 无效的凭证将导入失败;同邮箱凭证自动去重(覆盖更新)。"})]})]}),i.jsxs("div",{className:`border-2 border-dashed rounded-xl p-10 text-center cursor-pointer transition-colors ${o?"border-purple-500 bg-purple-500/10":"border-dark-600 hover:border-dark-500"}`,onClick:()=>{var w;return(w=u.current)==null?void 0:w.click()},onDragOver:w=>{w.preventDefault(),a(!0)},onDragLeave:()=>a(!1),onDrop:w=>{w.preventDefault(),a(!1),c(w.dataTransfer.files)},children:[i.jsx(Oi,{className:"mx-auto text-purple-400 mb-3",size:32}),i.jsx("p",{className:"text-gray-300",children:"点击选择文件或拖拽文件到此区域"}),i.jsx("p",{className:"text-gray-500 text-sm mt-1",children:"支持 .json 和 .zip 格式,ZIP 会自动提取其中的 JSON 凭证"}),i.jsx("input",{ref:u,type:"file",multiple:!0,accept:".json,.zip",className:"hidden",onChange:w=>{c(w.target.files),w.target.value=""}})]}),e.length>0&&i.jsxs("div",{className:"card space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("h4",{className:"text-sm font-medium text-gray-300",children:["已选择 ",e.length," 个文件"]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsxs("button",{onClick:g,disabled:n,className:"btn btn-primary text-sm flex items-center gap-1.5 disabled:opacity-50",children:[n?i.jsx(kt,{size:14,className:"animate-spin"}):i.jsx(Oi,{size:14}),n?"上传中...":"上传文件"]}),i.jsx("button",{onClick:()=>t([]),disabled:n,className:"btn btn-secondary text-sm",children:"清空列表"})]})]}),i.jsx("div",{className:"space-y-1.5 max-h-64 overflow-y-auto",children:e.map(w=>i.jsxs("div",{className:"flex items-center justify-between bg-dark-800 border border-dark-600 rounded-lg px-3 py-2 text-sm",children:[i.jsxs("div",{className:"flex items-center gap-2 text-gray-300 min-w-0",children:[i.jsx(n0,{size:15,className:"text-purple-400 flex-shrink-0"}),i.jsx("span",{className:"truncate",children:w.name})]}),i.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[i.jsxs("span",{className:"text-gray-500 text-xs",children:[(w.size/1024).toFixed(1)," KB"]}),i.jsx("button",{onClick:()=>m(w.name),className:"text-gray-500 hover:text-red-400",children:i.jsx($f,{size:14})})]})]},w.name))})]}),s&&i.jsx("div",{className:"card space-y-3",children:s.error?i.jsx("div",{className:"bg-red-500/10 border border-red-500/30 text-red-400 px-4 py-3 rounded-lg",children:s.error}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"bg-green-500/10 border border-green-500/30 text-green-400 px-4 py-3 rounded-lg flex items-center gap-2",children:[i.jsx(sr,{size:16}),s.message||`上传完成: 成功 ${y}/${v} 个文件`]}),((N=s.results)==null?void 0:N.some(w=>w.status==="error"))&&i.jsxs("div",{className:"space-y-1.5",children:[i.jsx("div",{className:"text-sm text-gray-400",children:"失败详情:"}),s.results.filter(w=>w.status==="error").map((w,T)=>i.jsxs("div",{className:"bg-red-500/10 border border-red-500/20 text-red-400 text-xs px-3 py-2 rounded-lg",children:[i.jsx("span",{className:"font-medium",children:w.filename}),": ",w.message]},T))]})]})})]})}function Ig({value:e,onChange:t,placeholder:n}){const r=u=>Array.isArray(u)?u.join(", "):u??"",[s,l]=b.useState(()=>r(e)),o=b.useRef(!1);b.useEffect(()=>{o.current||l(r(e))},[e]);const a=u=>{const c=u.split(/[,\s]+/).map(m=>parseInt(m,10)).filter(m=>Number.isInteger(m)&&m>=100&&m<=599);t([...new Set(c)].sort((m,g)=>m-g))};return i.jsx("input",{type:"text",value:s,onFocus:()=>{o.current=!0},onChange:u=>{const c=u.target.value;l(c),a(c)},onBlur:()=>{o.current=!1,a(s)},placeholder:n,className:"w-full sm:w-64 px-3 py-2 bg-dark-800 border border-dark-600 rounded-lg text-sm text-white placeholder-gray-500 font-mono"})}function Ug({value:e,onChange:t,placeholder:n}){const r=u=>Array.isArray(u)?u.join(` +`):u??"",[s,l]=b.useState(()=>r(e)),o=b.useRef(!1);b.useEffect(()=>{o.current||l(r(e))},[e]);const a=u=>{const c=u.split(/\r?\n/).map(m=>m.replace(/\s+$/,"")).filter(m=>m.trim()!=="");t(c)};return i.jsx("textarea",{value:s,onFocus:()=>{o.current=!0},onChange:u=>{const c=u.target.value;l(c),a(c)},onBlur:()=>{o.current=!1,a(s)},placeholder:n,rows:6,className:"w-full px-3 py-2 bg-dark-800 border border-dark-600 rounded-lg text-sm text-white placeholder-gray-500 font-mono"})}const $g=[{title:"服务器配置",fields:[{key:"host",label:"服务器主机地址",type:"text",note:"服务器监听的主机地址,0.0.0.0表示监听所有接口(重启生效)"},{key:"port",label:"服务器端口",type:"number",note:"服务器监听的端口号(重启生效)"},{key:"api_password",label:"API 访问密码",type:"text",note:"聊天API访问密码,用于 OpenAI / Gemini / Claude 端点认证"},{key:"panel_password",label:"控制面板密码",type:"text",note:"控制面板访问密码"}]},{title:"IP 白名单",fields:[{key:"ip_whitelist_enabled",label:"启用 IP 白名单",type:"bool",note:"开启后仅白名单内的 IP 可访问面板和 API,其余 IP 直接 403。留空列表或关闭开关则不限制。保存后立即生效(热更新)"},{key:"ip_whitelist",label:"IP 白名单列表",type:"textarea",showIf:e=>!!e.ip_whitelist_enabled,note:"每行一条,支持单个 IP、CIDR 网段、起止范围(- 或 ~ 分隔),IPv4 / IPv6 均可",placeholder:`例如: +127.0.0.1 +192.168.1.0/24 +10.0.0.1-10.0.0.100 +::1 +2001:db8::/32`}]},{title:"基础配置",fields:[{key:"credentials_dir",label:"凭证目录路径",type:"text",note:"存储认证文件的目录路径"},{key:"proxy",label:"代理设置",type:"text",note:"支持 http/https/socks5/socks5h,可带账号密码(user:pass@host:port),留空不使用(重启生效)",placeholder:"http://user:pass@proxy:port 或 socks5h://proxy:port"}]},{title:"端点配置",fields:[{key:"oauth_proxy_url",label:"OAuth Endpoint",type:"text",note:"Google OAuth2 端点,用于 token 获取和刷新"},{key:"googleapis_proxy_url",label:"Google APIs Endpoint",type:"text",note:"Google APIs 端点"},{key:"antigravity_api_url",label:"Antigravity API Endpoint",type:"text",note:"Antigravity API 端点"}]},{title:"自动封禁配置",fields:[{key:"auto_ban_enabled",label:"启用自动封禁",type:"bool",note:"遇到指定错误码时自动禁用凭证"},{key:"auto_ban_error_codes",label:"自动封禁错误码",type:"text",note:"JSON 数组格式,如 [403, 400]"}]},{title:"重试配置",fields:[{key:"retry_429_enabled",label:"启用错误重试",type:"bool",note:"遇到错误时自动重试"},{key:"retry_429_max_retries",label:"最大重试次数",type:"number",note:"遇到错误时的最大重试次数"},{key:"retry_429_interval",label:"重试间隔(秒)",type:"number",note:"两次重试间的等待秒数,允许 0(立即重试),范围 0-3600"}]},{title:"凭证选择模式",fields:[{key:"credential_select_mode",label:"选择模式",type:"select",note:"决定每次 API 请求如何挑选凭证",options:[{value:"random",label:"完全随机"},{value:"cache",label:"缓存匹配(推荐)"},{value:"sticky",label:"凭证不变直到 CD"}],descriptions:{random:"完全随机负载均衡:每次请求从可用凭证中随机挑选一个,最均匀地分摊负载,但相同会话可能命中不同凭证,无法利用上游 prompt cache。",cache:'缓存匹配(默认推荐):以"模型 + system 指令(或首条 user 消息)"哈希出会话 key,相同会话始终复用同一凭证——命中 Google 上游的 prompt cache,长对话更快、更省 token。凭证进入 CD 后自动切换并重新绑定。建议搭配 Redis(REDIS_URL)实现多实例共享。',sticky:"凭证粘性:所有请求锁定同一个凭证,直到该凭证进入冷却(CD)或被禁用才切换到下一个。适合最大化单凭证的缓存命中,但负载不均——单凭证扛满全量请求,其余凭证闲置。"}}]},{title:"响应配置",fields:[{key:"return_thoughts_to_frontend",label:"返回思维链到前端",type:"bool",note:"启用后思维链会在响应中返回;禁用后过滤掉"}]},{title:"抗截断配置",fields:[{key:"anti_truncation_max_attempts",label:"抗截断最大重试次数",type:"number",note:"检测到输出截断时的最大续传尝试次数(1-10)。使用'抗截断-'前缀的模型生效"}]},{title:"敏感词过滤",fields:[{key:"sensitive_words_enabled",label:"启用敏感词过滤",type:"bool",note:"请求中命中敏感词的内容会被替换为空,避免触发 Google API 端点的敏感词拦截"},{key:"sensitive_words",label:"敏感词列表",type:"textarea",showIf:e=>!!e.sensitive_words_enabled,note:"每行一个词或短语,不区分大小写,支持中文。命中后整词替换为空。保存后立即生效(热更新)",placeholder:`例如: +sensitive word +敏感词 +另一个词`}]},{title:"模型名复写",fields:[{key:"model_rewrite_enabled",label:"启用模型名复写",type:"bool",note:"开启后按规则匹配请求中的模型名(支持正则),命中则替换为规则指定的模型名。常用于把客户端固定模型名映射到实际可用的上游模型。保存后立即生效(热更新)"},{key:"model_rewrite_rules",label:"复写规则",type:"rules",showIf:e=>!!e.model_rewrite_enabled,note:"每行一条规则:匹配正则 + 替换模型名。自上而下首条命中即生效,替换支持正则反向引用(如 \\1)"}]},{title:"请求日志",fields:[{key:"usage_log_enabled",label:"启用请求日志",type:"bool",note:'记录每次 API 请求(模型、凭证、token 用量、耗时、状态)到数据库,在"请求日志"页面查看。日志不自动清理,可在该页面手动清理或清空'},{key:"request_log_enabled",label:"启用请求体详细日志",type:"bool",note:"开启后,当请求命中下方错误码时,把发往上游的完整请求头(已脱敏)与请求体保存为 JSON 文件(data/request_logs/)。主要用于请求体错误时排查 debug;清理/清空日志时会同步删除这些文件"},{key:"request_log_error_codes",label:"详细日志错误码",type:"csv_numbers",showIf:e=>!!e.request_log_enabled,note:"仅当最终响应状态码命中此列表时记录详细日志,逗号分隔,如 400, 429。留空默认只记录 400",placeholder:"400, 429"}]}];function Bg(){const[e,t]=b.useState({}),[n,r]=b.useState([]),[s,l]=b.useState(!0),[o,a]=b.useState(!1),[u,c]=b.useState(null);b.useEffect(()=>{m()},[]);const m=async({silent:d=!1}={})=>{var h,k;l(!0);try{const S=await le.get("/config/get");t(S.data.config||{}),r(S.data.env_locked||[]),d||c(null)}catch(S){c({type:"error",text:((k=(h=S.response)==null?void 0:h.data)==null?void 0:k.detail)||"加载配置失败"})}finally{l(!1)}},g=async()=>{var d,h;a(!0);try{const k=await le.post("/config/save",{config:e});c({type:"success",text:k.data.message||"配置保存成功"}),await m({silent:!0})}catch(k){c({type:"error",text:((h=(d=k.response)==null?void 0:d.data)==null?void 0:h.detail)||"保存配置失败"})}finally{a(!1)}},y=(d,h)=>{t(k=>({...k,[d]:h}))},v="https://gcli-api.sukaka.top",N={oauth_proxy_url:"https://oauth2.googleapis.com",googleapis_proxy_url:"https://www.googleapis.com",antigravity_api_url:"https://daily-cloudcode-pa.googleapis.com"},w={oauth_proxy_url:"/oauth2",googleapis_proxy_url:"/googleapis",antigravity_api_url:"/daily-cloudcode-pa"},T=()=>{t(d=>{const h={...d};for(const[k,S]of Object.entries(w))n.includes(k)||(h[k]=v+S);return h})},x=()=>{t(d=>{const h={...d};for(const[k,S]of Object.entries(N))n.includes(k)||(h[k]=S);return h})},f=d=>{const h=n.includes(d.key),k=e[d.key]??"";if(h)return i.jsx("div",{className:"text-xs text-amber-400/80 bg-amber-500/10 border border-amber-500/20 rounded-lg px-3 py-2",children:"该配置已被环境变量锁定,修改环境变量后重启生效"});if(d.type==="bool")return i.jsxs("label",{className:"flex items-center gap-3 cursor-pointer select-none",children:[i.jsx("button",{type:"button",onClick:()=>y(d.key,!k),className:`relative w-11 h-6 rounded-full transition-colors ${k?"bg-purple-600":"bg-dark-600"}`,children:i.jsx("span",{className:`absolute top-0.5 left-0.5 w-5 h-5 bg-white rounded-full transition-transform ${k?"translate-x-5":""}`})}),i.jsx("span",{className:"text-sm text-gray-300",children:k?"已启用":"已禁用"})]});if(d.type==="select"){const S=d.options.find(E=>E.value===k)||d.options[0];return i.jsxs("div",{className:"space-y-2",children:[i.jsx(Ct,{value:(S==null?void 0:S.value)??"",onChange:E=>y(d.key,E),options:d.options,className:"w-full sm:w-64"}),d.descriptions&&S&&i.jsx("div",{className:"bg-dark-800/60 border border-dark-600 rounded-lg p-3 text-xs sm:text-sm text-gray-300 leading-relaxed",children:d.descriptions[S.value]})]})}if(d.type==="csv_numbers")return i.jsx(Ig,{value:k,onChange:S=>y(d.key,S),placeholder:d.placeholder});if(d.type==="rules"){const S=Array.isArray(k)?k.map(O=>Array.isArray(O)?[String(O[0]??""),String(O[1]??"")]:["",""]):[],E=(O,$,K)=>{const re=S.map(q=>[...q]);re[O][$]=K,y(d.key,re)},_=O=>{y(d.key,S.filter(($,K)=>K!==O))},M=()=>{y(d.key,[...S,["",""]])};return i.jsxs("div",{className:"space-y-2",children:[S.length===0&&i.jsx("div",{className:"text-xs text-gray-500 bg-dark-800/60 border border-dark-700 rounded-lg px-3 py-2",children:"暂无规则,点击下方按钮新增"}),S.map((O,$)=>i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("input",{type:"text",value:O[0],onChange:K=>E($,0,K.target.value),placeholder:"匹配正则,如 ^gpt-4$",className:"flex-1 min-w-0 px-3 py-2 bg-dark-800 border border-dark-600 rounded-lg text-sm text-white placeholder-gray-500 font-mono"}),i.jsx("span",{className:"text-gray-500 text-sm shrink-0",children:"→"}),i.jsx("input",{type:"text",value:O[1],onChange:K=>E($,1,K.target.value),placeholder:"替换模型名,如 gemini-2.5-pro",className:"flex-1 min-w-0 px-3 py-2 bg-dark-800 border border-dark-600 rounded-lg text-sm text-white placeholder-gray-500 font-mono"}),i.jsx("button",{type:"button",onClick:()=>_($),className:"shrink-0 p-2 text-gray-500 hover:text-red-400 transition-colors",title:"删除该规则",children:i.jsx(bl,{size:16})})]},$)),i.jsxs("button",{type:"button",onClick:M,className:"btn btn-secondary text-xs px-3 py-1.5 flex items-center gap-1.5",children:[i.jsx(i0,{size:14}),"新增规则"]})]})}return d.type==="textarea"?i.jsx(Ug,{value:k,onChange:S=>y(d.key,S),placeholder:d.placeholder}):i.jsx("input",{type:d.type,value:k,onChange:S=>y(d.key,d.type==="number"?Number(S.target.value):S.target.value),placeholder:d.placeholder,className:"w-full px-3 py-2 bg-dark-800 border border-dark-600 rounded-lg text-sm text-white placeholder-gray-500"})};return i.jsxs("div",{className:"space-y-6",children:[i.jsx("div",{className:"sticky top-0 z-30 -mx-1 px-1 py-2 bg-dark-950/95 backdrop-blur border-b border-dark-700 rounded-lg",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("button",{onClick:m,disabled:s,className:"btn btn-secondary text-sm flex items-center gap-1.5",children:[i.jsx(Gt,{size:15,className:s?"animate-spin":""}),"刷新配置"]}),i.jsxs("button",{onClick:g,disabled:o||s,className:"btn btn-primary text-sm flex items-center gap-1.5 disabled:opacity-50",children:[o?i.jsx(kt,{size:15,className:"animate-spin"}):i.jsx(a0,{size:15}),o?"保存中...":"保存配置"]})]})}),u&&i.jsx(lr,{type:u.type,title:u.type==="success"?"操作成功":"操作失败",onClose:()=>c(null),children:i.jsx("span",{className:"whitespace-pre-wrap break-all",children:u.text})}),s?i.jsx("div",{className:"flex items-center justify-center py-12",children:i.jsx(kt,{className:"animate-spin text-purple-500",size:28})}):i.jsx("div",{className:"space-y-6",children:$g.map(d=>i.jsxs("div",{className:"card",children:[i.jsx("h3",{className:"text-base font-semibold text-purple-400 mb-4 border-b border-dark-700 pb-3",children:d.title}),d.title==="端点配置"&&i.jsxs("div",{className:"flex flex-wrap gap-2 mb-4",children:[i.jsx("button",{type:"button",onClick:T,className:"btn btn-secondary text-xs px-3 py-1.5",children:"🚀 一键使用镜像网址"}),i.jsx("button",{type:"button",onClick:x,className:"btn btn-secondary text-xs px-3 py-1.5",children:"🔄 还原官方端点"})]}),i.jsx("div",{className:"space-y-5",children:d.fields.filter(h=>!h.showIf||h.showIf(e)).map(h=>i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1.5",children:h.label}),f(h),h.note&&i.jsx("p",{className:"text-xs text-gray-500 mt-1.5",children:h.note})]},h.key))})]},d.title))})]})}function Hg({version:e,onCheckUpdate:t,checkingUpdate:n}){const r=`${window.location.origin}${Pl()}`,s=[{label:"OpenAI 格式",value:`${r}v1/chat/completions`},{label:"Gemini 格式",value:`${r}v1beta/models`},{label:"Claude 格式",value:`${r}v1/messages`}],l=o=>{navigator.clipboard.writeText(o)};return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"card p-4 sm:p-6",children:[i.jsxs("h3",{className:"text-sm font-medium text-gray-400 mb-3 flex items-center gap-2",children:[i.jsx(Bf,{size:16,className:"text-amber-400"}),"API 端点(点击复制)"]}),i.jsx("div",{className:"space-y-2",children:s.map(o=>i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-1 sm:gap-3 text-sm",children:[i.jsx("span",{className:"text-gray-500 sm:w-24 flex-shrink-0",children:o.label}),i.jsx("code",{className:"bg-dark-800 border border-dark-600 rounded px-2 py-1 text-xs text-gray-300 cursor-pointer hover:text-white break-all",onClick:()=>l(o.value),children:o.value})]},o.label))})]}),i.jsxs("div",{className:"card",children:[i.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[i.jsx("div",{className:"inline-flex items-center justify-center w-12 h-12 rounded-2xl bg-purple-600/20",children:i.jsx(us,{className:"w-7 h-7 text-purple-400"})}),i.jsxs("div",{children:[i.jsx("h2",{className:"text-2xl font-bold text-white",children:"AGY2API"}),i.jsx("p",{className:"text-gray-400 text-sm",children:e!=null&&e.version?`版本: ${e.version}`:"Antigravity API 代理服务"})]})]}),i.jsx("p",{className:"text-gray-400 text-sm leading-relaxed",children:"将 Google Antigravity API 转换为 OpenAI、Gemini 和 Anthropic 兼容格式的代理工具。支持多账户管理(邮箱去重)、自动轮换、模型级冷却、凭证导入导出等功能。"}),i.jsxs("div",{className:"flex flex-wrap items-center gap-4 mt-4",children:[i.jsxs("a",{href:"https://github.com/su-kaka/agy2api",target:"_blank",rel:"noopener noreferrer",className:"text-purple-400 hover:text-purple-300 text-sm flex items-center gap-1.5",children:[i.jsx(s0,{size:15}),"GitHub 仓库",i.jsx(Uf,{size:12})]}),i.jsxs("button",{onClick:t,disabled:n,className:"text-blue-400 hover:text-blue-300 text-sm flex items-center gap-1.5 disabled:opacity-50",children:[n?i.jsx(Wr,{size:14,className:"animate-pulse"}):i.jsx(Gt,{size:14}),n?"检查中...":"检查更新"]}),(e==null?void 0:e.check_update)&&(e==null?void 0:e.has_update)&&i.jsxs("span",{className:"text-emerald-400 text-sm flex items-center gap-1.5",children:[i.jsx(Wr,{size:14}),"有新版本可用: ",e.latest_version]}),(e==null?void 0:e.check_update)&&(e==null?void 0:e.has_update)===!1&&i.jsxs("span",{className:"text-gray-400 text-sm flex items-center gap-1.5",children:[i.jsx(Wr,{size:14}),"已是最新版本"]})]})]}),i.jsxs("div",{className:"card",children:[i.jsx("h3",{className:"text-lg font-semibold text-blue-400 mb-4",children:"✨ 主要功能"}),i.jsxs("div",{className:"grid md:grid-cols-2 gap-4 text-sm",children:[i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"text-gray-300",children:[i.jsx("span",{className:"text-amber-400",children:"⚡"})," ",i.jsx("strong",{children:"多格式兼容:"}),"OpenAI / Gemini / Anthropic 三种 API 格式"]}),i.jsxs("div",{className:"text-gray-300",children:[i.jsx("span",{className:"text-cyan-400",children:"🔄"})," ",i.jsx("strong",{children:"自动轮换:"}),"随机负载均衡,自动跳过冷却和禁用的凭证"]}),i.jsxs("div",{className:"text-gray-300",children:[i.jsx("span",{className:"text-emerald-400",children:"🛡️"})," ",i.jsx("strong",{children:"自动封禁:"}),"遇到指定错误码自动禁用异常凭证"]}),i.jsxs("div",{className:"text-gray-300",children:[i.jsx("span",{className:"text-purple-400",children:"❄️"})," ",i.jsx("strong",{children:"模型级冷却:"}),"429 错误自动设置模型级 CD"]})]}),i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"text-gray-300",children:[i.jsx("span",{className:"text-red-400",children:"✂️"})," ",i.jsx("strong",{children:"抗截断:"}),'"抗截断-" 前缀模型自动续传截断的响应']}),i.jsxs("div",{className:"text-gray-300",children:[i.jsx("span",{className:"text-emerald-400",children:"📊"})," ",i.jsx("strong",{children:"实时监控:"}),"凭证状态、错误码、额度查询"]}),i.jsxs("div",{className:"text-gray-300",children:[i.jsx("span",{className:"text-gray-400",children:"📱"})," ",i.jsx("strong",{children:"响应式界面:"}),"桌面/移动端自适应"]})]})]})]}),i.jsxs("div",{className:"card text-center",children:[i.jsx("h3",{className:"text-lg font-semibold text-blue-400 mb-4",children:"💬 交流群"}),i.jsx("p",{className:"text-gray-400 text-sm mb-3",children:"欢迎加入 QQ 群交流讨论!"}),i.jsx("div",{className:"inline-block bg-white rounded-xl p-3",children:i.jsx("img",{src:`${Pl()}docs/qq-group.jpg`,alt:"QQ 群二维码",className:"w-40 h-40 rounded-lg"})}),i.jsx("p",{className:"text-blue-400 font-semibold mt-3",children:"QQ 群号:1083250744"})]}),i.jsxs("div",{className:"bg-amber-500/10 border border-amber-500/30 rounded-xl p-5",children:[i.jsx("div",{className:"text-amber-400 font-medium mb-2",children:"⚠️ 使用声明"}),i.jsx("p",{className:"text-sm text-amber-400/80",children:"本项目仅供学习研究使用,禁止商业用途和倒卖。"})]}),e&&i.jsxs("div",{className:"card",children:[i.jsx("h3",{className:"text-base font-semibold text-gray-300 mb-3",children:"版本信息"}),i.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[i.jsxs("div",{className:"text-gray-500",children:["当前版本: ",i.jsx("span",{className:"text-gray-300",children:e.version||"-"})]}),i.jsxs("div",{className:"text-gray-500",children:["构建哈希: ",i.jsx("span",{className:"text-gray-300",children:e.full_hash||"-"})]}),i.jsxs("div",{className:"text-gray-500",children:["更新说明: ",i.jsx("span",{className:"text-gray-300",children:e.message||"-"})]}),i.jsxs("div",{className:"text-gray-500",children:["构建日期: ",i.jsx("span",{className:"text-gray-300",children:e.date||"-"})]})]})]})]})}const Vg=[20,50,100,200].map(e=>({value:e,label:`每页 ${e}`}));function Sc(e){const t=new Date(e*1e3),n=r=>String(r).padStart(2,"0");return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`}function In(e){return e?e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e):"0"}function Wg(e){if(typeof e!="string")return JSON.stringify(e??null,null,2);try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}function qg(){const[e,t]=b.useState([]),[n,r]=b.useState(0),[s,l]=b.useState(null),[o,a]=b.useState(1),[u,c]=b.useState(20),[m,g]=b.useState("all"),[y,v]=b.useState(""),[N,w]=b.useState(""),[T,x]=b.useState(""),[f,d]=b.useState(!0),[h,k]=b.useState(!1),[S,E]=b.useState(null),[_,M]=b.useState(null),[O,$]=b.useState(null),[K,re]=b.useState(!1),[q,pt]=b.useState(null),[B,Fe]=b.useState(24),A=b.useCallback(async()=>{var P,X;d(!0);try{const te={offset:(o-1)*u,limit:u,status:m};y&&(te.api_format=y),N.trim()&&(te.model_name=N.trim());const Te=parseInt(T,10);T.trim()!==""&&Number.isInteger(Te)&&(te.status_code=Te),B>0&&(te.start_timestamp=Math.floor(Date.now()/1e3)-B*3600);const J=await le.get("/usage-logs/list",{params:te});t(J.data.items),r(J.data.total)}catch(te){E({type:"error",text:((X=(P=te.response)==null?void 0:P.data)==null?void 0:X.detail)||"加载日志失败"})}finally{d(!1)}},[o,u,m,y,N,T,B]),F=b.useCallback(async()=>{try{const P={};B>0&&(P.start_timestamp=Math.floor(Date.now()/1e3)-B*3600),y&&(P.api_format=y),N.trim()&&(P.model_name=N.trim());const X=await le.get("/usage-logs/stats",{params:P});l(X.data)}catch{}},[B,y,N]);b.useEffect(()=>{A()},[A]),b.useEffect(()=>{F()},[F]);const L=()=>{A(),F()},H=async()=>{var P,X;if(window.confirm("确定要清理 3 天前的日志吗?此操作不可恢复。")){k(!0);try{const te=await le.post("/usage-logs/clear",null,{params:{days:3}});E({type:"success",text:te.data.message||"清理成功"}),L()}catch(te){E({type:"error",text:((X=(P=te.response)==null?void 0:P.data)==null?void 0:X.detail)||"清理失败"})}finally{k(!1)}}},Q=async()=>{var P,X;if(window.confirm(`确定要清空全部请求日志吗? +整张日志表将被删除重建,不留任何残留,此操作不可恢复。`)){k(!0);try{const te=await le.post("/usage-logs/truncate");E({type:"success",text:te.data.message||"已清空全部日志"}),L()}catch(te){E({type:"error",text:((X=(P=te.response)==null?void 0:P.data)==null?void 0:X.detail)||"清空失败"})}finally{k(!1)}}},ge=Math.max(1,Math.ceil(n/u)),ee=async()=>{var P,X;if(_!=null&&_.request_log_file){pt(null),re(!0);try{const te=await le.get("/usage-logs/request-body",{params:{path:_.request_log_file}});$(te.data)}catch(te){$({__missing:!0,__message:((X=(P=te.response)==null?void 0:P.data)==null?void 0:X.detail)||"详细日志文件不存在或已清理"})}finally{re(!1)}}},Pe=async()=>{var te;if(!O||O.__missing)return;const P=JSON.stringify(O,null,2);let X=!1;try{if((te=navigator.clipboard)!=null&&te.writeText)await navigator.clipboard.writeText(P),X=!0;else{const Te=document.createElement("textarea");Te.value=P,Te.style.position="fixed",Te.style.top="-9999px",Te.style.opacity="0",document.body.appendChild(Te),Te.select(),X=document.execCommand("copy"),document.body.removeChild(Te)}}catch{X=!1}pt(X?"ok":"fail")};return i.jsxs("div",{className:"space-y-4",children:[s&&i.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[i.jsxs("div",{className:"card p-4 flex items-center gap-3",children:[i.jsx("div",{className:"p-2.5 bg-purple-600/20 rounded-lg",children:i.jsx(Zh,{size:20,className:"text-purple-400"})}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("div",{className:"text-xl font-bold",children:s.total_requests}),i.jsx("div",{className:"text-xs text-gray-500",children:"总请求"})]})]}),i.jsxs("div",{className:"card p-4 flex items-center gap-3",children:[i.jsx("div",{className:"p-2.5 bg-green-600/20 rounded-lg",children:i.jsx(sr,{size:20,className:"text-green-400"})}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("div",{className:"text-xl font-bold text-green-400",children:s.success_count}),i.jsx("div",{className:"text-xs text-gray-500",children:"成功"})]})]}),i.jsxs("div",{className:"card p-4 flex items-center gap-3",children:[i.jsx("div",{className:"p-2.5 bg-red-600/20 rounded-lg",children:i.jsx(f0,{size:20,className:"text-red-400"})}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("div",{className:"text-xl font-bold text-red-400",children:s.error_count}),i.jsx("div",{className:"text-xs text-gray-500",children:"失败"})]})]}),i.jsxs("div",{className:"card p-4 flex items-center gap-3",children:[i.jsx("div",{className:"p-2.5 bg-blue-600/20 rounded-lg",children:i.jsx(If,{size:20,className:"text-blue-400"})}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("div",{className:"text-xl font-bold",children:In(s.total_tokens)}),i.jsxs("div",{className:"text-xs text-gray-500",children:["总 Tokens",s.cached_tokens>0?`(缓存 ${In(s.cached_tokens)})`:""]})]})]})]}),i.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[i.jsxs("button",{onClick:L,disabled:f,className:"btn btn-secondary text-xs sm:text-sm px-3 py-1.5 sm:px-4 sm:py-2 flex items-center gap-1.5",children:[i.jsx(Gt,{size:15,className:f?"animate-spin":""}),"刷新"]}),i.jsxs("button",{onClick:H,disabled:h,className:"btn btn-secondary text-xs sm:text-sm px-3 py-1.5 sm:px-4 sm:py-2 flex items-center gap-1.5",children:[h?i.jsx(kt,{size:15,className:"animate-spin"}):i.jsx(bl,{size:15}),"清理3天前日志"]}),i.jsxs("button",{onClick:Q,disabled:h,className:"btn btn-danger text-xs sm:text-sm px-3 py-1.5 sm:px-4 sm:py-2 flex items-center gap-1.5",children:[i.jsx(bl,{size:15}),"清空全部日志"]})]}),S&&i.jsx(lr,{type:S.type,title:S.type==="success"?"操作成功":"操作失败",onClose:()=>E(null),children:i.jsx("span",{className:"whitespace-pre-wrap break-all",children:S.text})}),i.jsxs("div",{className:"grid grid-cols-2 sm:flex sm:flex-wrap gap-2 sm:gap-3 text-sm",children:[i.jsx(Ct,{value:B,onChange:P=>{Fe(Number(P)),a(1)},className:"w-full sm:w-32",options:[{value:1,label:"最近 1 小时"},{value:6,label:"最近 6 小时"},{value:24,label:"最近 24 小时"},{value:24*7,label:"最近 7 天"},{value:24*30,label:"最近 30 天"},{value:0,label:"全部时间"}]}),i.jsx(Ct,{value:m,onChange:P=>{g(P),a(1)},className:"w-full sm:w-32",options:[{value:"all",label:"状态: 全部"},{value:"success",label:"仅成功"},{value:"error",label:"仅失败"}]}),i.jsx(Ct,{value:y,onChange:P=>{v(P),a(1)},className:"w-full sm:w-32",options:[{value:"",label:"格式: 全部"},{value:"openai",label:"OpenAI"},{value:"gemini",label:"Gemini"},{value:"anthropic",label:"Claude"}]}),i.jsx("input",{value:N,onChange:P=>{w(P.target.value),a(1)},placeholder:"模型名筛选",className:"w-full sm:w-40 bg-dark-800 border border-dark-600 rounded-lg px-3 py-2 text-gray-200 text-xs sm:text-sm placeholder-gray-500"}),i.jsx("input",{value:T,onChange:P=>{x(P.target.value),a(1)},placeholder:"错误码筛选",inputMode:"numeric",className:"w-full sm:w-28 bg-dark-800 border border-dark-600 rounded-lg px-3 py-2 text-gray-200 text-xs sm:text-sm placeholder-gray-500"}),i.jsx(Ct,{value:u,onChange:P=>{c(Number(P)),a(1)},className:"w-full sm:w-32",options:Vg})]}),f?i.jsx("div",{className:"flex items-center justify-center py-12",children:i.jsx(kt,{className:"animate-spin text-purple-500",size:28})}):e.length===0?i.jsx("div",{className:"card p-8 text-center text-gray-500",children:"暂无请求日志"}):i.jsx("div",{className:"space-y-2",children:e.map(P=>i.jsx("button",{onClick:()=>{M(P),$(null)},className:"card p-3 sm:p-4 w-full text-left hover:border-purple-500/40 transition-colors cursor-pointer",children:i.jsxs("div",{className:"flex items-start justify-between gap-2",children:[i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[i.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${P.success?"bg-green-500/15 text-green-400":"bg-red-500/15 text-red-400"}`,children:P.success?"✓ 成功":`✗ ${P.status_code||"失败"}`}),i.jsx("span",{className:"text-sm font-medium text-gray-200 truncate",children:P.model_name||"(unknown)"}),P.upstream_model_name&&P.upstream_model_name!==P.model_name&&i.jsxs("span",{className:"text-xs text-gray-500 truncate",title:"后端真实模型名",children:["→ ",P.upstream_model_name]}),i.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-dark-700 text-gray-400",children:P.api_format==="openai"?"OpenAI":P.api_format==="gemini"?"Gemini":P.api_format==="anthropic"?"Claude":P.api_format||"?"}),P.is_stream&&i.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-blue-500/15 text-blue-400",children:"流式"}),P.request_log_file&&i.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-amber-500/15 text-amber-400",children:"详细"})]}),i.jsxs("div",{className:"text-xs text-gray-500 mt-1 flex flex-wrap gap-x-3 gap-y-0.5",children:[i.jsxs("span",{className:"flex items-center gap-1",children:[i.jsx(bi,{size:11}),Sc(P.created_at)]}),i.jsxs("span",{children:[(P.use_time||0).toFixed(1),"s"]}),i.jsx("span",{children:P.credential_email||"-"})]})]}),i.jsxs("div",{className:"text-right shrink-0 text-xs text-gray-400",children:[i.jsxs("div",{children:[In(P.total_tokens)," tokens"]}),i.jsxs("div",{className:"text-gray-600",children:["↑",In(P.prompt_tokens)," ↓",In(P.completion_tokens)]}),P.cached_tokens>0&&i.jsxs("div",{className:"text-emerald-500/80",title:"Prompt 中命中缓存的 token",children:["⚡缓存 ",In(P.cached_tokens)]})]})]})},P.id))}),n>0&&i.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-400",children:[i.jsxs("span",{children:["共 ",n," 条"]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("button",{onClick:()=>a(P=>Math.max(1,P-1)),disabled:o<=1,className:"btn btn-secondary text-xs px-3 py-1.5 disabled:opacity-40",children:"上一页"}),i.jsxs("span",{children:[o," / ",ge]}),i.jsx("button",{onClick:()=>a(P=>Math.min(ge,P+1)),disabled:o>=ge,className:"btn btn-secondary text-xs px-3 py-1.5 disabled:opacity-40",children:"下一页"})]})]}),_&&i.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/60",onClick:()=>M(null),children:i.jsxs("div",{className:"card max-w-lg w-full max-h-[80vh] overflow-y-auto",onClick:P=>P.stopPropagation(),children:[i.jsxs("div",{className:"flex items-center justify-between mb-4",children:[i.jsx("h3",{className:"text-base font-semibold text-purple-400",children:"请求详情"}),i.jsx("button",{onClick:()=>M(null),className:"text-gray-400 hover:text-white",children:"✕"})]}),i.jsxs("div",{className:"space-y-2 text-sm",children:[[["时间",Sc(_.created_at)],["请求 ID",_.request_id||"-"],["状态",_.success?"成功":`失败 (${_.status_code})`],["API 格式",_.api_format||"-"],["客户端 IP",_.client_ip||"-"],["请求模型",_.model_name||"-"],["真实模型",_.upstream_model_name||_.model_name||"-"],["凭证",_.credential_email||"-"],["流式",_.is_stream?"是":"否"],["耗时",`${(_.use_time||0).toFixed(2)}s`],["Prompt Tokens",String(_.prompt_tokens)],["Completion Tokens",String(_.completion_tokens)],["Total Tokens",String(_.total_tokens)],..._.cached_tokens>0?[["缓存 Tokens",String(_.cached_tokens)]]:[]].map(([P,X])=>i.jsxs("div",{className:"flex justify-between gap-4 border-b border-dark-700 pb-1.5",children:[i.jsx("span",{className:"text-gray-500 shrink-0",children:P}),i.jsx("span",{className:"text-gray-200 text-right break-all",children:X})]},P)),_.error_message&&i.jsxs("div",{children:[i.jsx("div",{className:"text-gray-500 mb-1",children:"错误信息"}),i.jsx("div",{className:"bg-red-500/10 border border-red-500/30 rounded-lg p-2.5 text-xs text-red-300 break-all",children:_.error_message})]}),_.request_log_file&&i.jsxs("div",{className:"pt-2",children:[i.jsxs("div",{className:"flex items-center justify-between gap-2",children:[i.jsx("div",{className:"text-gray-500",children:"请求体详细日志"}),i.jsxs("button",{onClick:ee,disabled:K,className:"btn btn-secondary text-xs px-3 py-1.5 flex items-center gap-1.5",children:[K?i.jsx(kt,{size:13,className:"animate-spin"}):i.jsx(r0,{size:13}),"查看详细内容"]})]}),i.jsx("p",{className:"text-xs text-gray-500 mt-1.5",children:"命中指定错误码时保存了发往上游的完整请求头与请求体,用于排查请求体错误(如 400)"})]})]})]})}),O&&i.jsx("div",{className:"fixed inset-0 z-[60] flex items-center justify-center p-4 bg-black/70",onClick:()=>$(null),children:i.jsx("div",{className:"card max-w-4xl w-full max-h-[85vh] overflow-y-auto",onClick:P=>P.stopPropagation(),children:O.__missing?i.jsxs("div",{className:"py-8 text-center text-sm text-gray-400",children:[i.jsx(Xh,{size:28,className:"mx-auto mb-3 text-amber-400"}),i.jsx("div",{children:O.__message}),i.jsx("div",{className:"text-xs text-gray-500 mt-2",children:"磁盘上的详细日志文件可能已被清理或手动删除"})]}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex items-center justify-between mb-3",children:[i.jsx("h3",{className:"text-base font-semibold text-purple-400",children:"请求体详细日志"}),i.jsxs("div",{className:"flex items-center gap-2",children:[q==="ok"&&i.jsx("span",{className:"text-xs text-green-400",children:"已复制"}),q==="fail"&&i.jsx("span",{className:"text-xs text-red-400",children:"复制失败"}),i.jsx("button",{onClick:Pe,className:"btn btn-secondary text-xs px-3 py-1.5",children:"复制 JSON"}),i.jsx("button",{onClick:()=>$(null),className:"text-gray-400 hover:text-white",children:"✕"})]})]}),i.jsx("p",{className:"text-xs text-gray-500 mb-3",children:"命中指定错误码时保存,用于排查请求体错误:完整记录发往上游的请求头(已脱敏)与请求体。响应体为上游返回的原始错误。"}),i.jsxs("div",{className:"space-y-3 text-xs",children:[i.jsxs("div",{children:[i.jsx("div",{className:"text-gray-400 mb-1",children:"请求 URL"}),i.jsx("pre",{className:"bg-dark-800 border border-dark-600 rounded-lg p-2.5 overflow-x-auto text-gray-200 whitespace-pre-wrap break-all",children:O.url||"-"})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-gray-400 mb-1",children:"请求头(已脱敏)"}),i.jsx("pre",{className:"bg-dark-800 border border-dark-600 rounded-lg p-2.5 overflow-x-auto text-gray-200",children:JSON.stringify(O.request_headers||{},null,2)})]}),i.jsxs("div",{children:[i.jsx("div",{className:"text-gray-400 mb-1",children:"请求体"}),i.jsx("pre",{className:"bg-dark-800 border border-dark-600 rounded-lg p-2.5 overflow-x-auto text-gray-200",children:JSON.stringify(O.request_body??{},null,2)})]}),O.response_body&&i.jsxs("div",{children:[i.jsx("div",{className:"text-gray-400 mb-1",children:"上游响应"}),i.jsx("pre",{className:"bg-dark-800 border border-dark-600 rounded-lg p-2.5 overflow-x-auto text-gray-200 whitespace-pre-wrap break-all",children:Wg(O.response_body)})]}),O.error_message&&i.jsxs("div",{children:[i.jsx("div",{className:"text-gray-400 mb-1",children:"错误摘要"}),i.jsx("pre",{className:"bg-red-500/10 border border-red-500/30 rounded-lg p-2.5 overflow-x-auto text-red-300 whitespace-pre-wrap break-all",children:O.error_message})]})]})]})})})]})}function Qg(){const[e,t]=b.useState(()=>!!localStorage.getItem("panelToken")),[n,r]=b.useState("oauth"),[s,l]=b.useState(null),[o,a]=b.useState(!1),u=()=>{a(!0),le.get("/version/info",{params:{check_update:"true"}}).then(g=>l(g.data)).catch(()=>{}).finally(()=>a(!1))};b.useEffect(()=>{le.get("/version/info").then(g=>l(g.data)).catch(()=>{})},[]);const c=()=>{localStorage.removeItem("panelToken"),t(!1)};if(!e)return i.jsx(Lg,{onSuccess:()=>t(!0)});const m=[{id:"oauth",label:"OAuth 认证",icon:us},{id:"credentials",label:"凭证管理",icon:l0},{id:"upload",label:"批量导入",icon:Oi},{id:"usage-logs",label:"请求日志",icon:Df},{id:"config",label:"配置管理",icon:u0},{id:"about",label:"项目信息",icon:Wr}];return i.jsxs("div",{className:"min-h-screen",children:[i.jsx("nav",{className:"bg-dark-900 border-b border-dark-700 sticky top-0 z-10",children:i.jsxs("div",{className:"max-w-6xl mx-auto px-4 py-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"flex items-center gap-3",children:i.jsxs("div",{children:[i.jsx("span",{className:"text-xl font-bold",children:"AGY2API"}),(s==null?void 0:s.version)&&i.jsxs("span",{className:"ml-2 text-xs text-gray-500",children:["v",s.version]})]})}),i.jsxs("button",{onClick:c,className:"px-3 py-1.5 sm:px-4 sm:py-2 bg-red-600 hover:bg-red-700 text-white rounded-lg flex items-center gap-1 sm:gap-2 text-sm",children:[i.jsx(o0,{size:16}),i.jsx("span",{className:"hidden sm:inline",children:"退出登录"})]})]}),i.jsx("div",{className:"flex items-center gap-1 sm:gap-2 mt-4 overflow-x-auto pb-1",children:m.map(g=>{const y=g.icon;return i.jsxs("button",{onClick:()=>r(g.id),className:`px-3 sm:px-4 py-2 text-xs sm:text-sm font-medium rounded-lg whitespace-nowrap flex items-center gap-1.5 transition-colors ${n===g.id?"bg-purple-600 text-white":"text-gray-400 hover:text-white hover:bg-dark-700"}`,children:[i.jsx(y,{size:15}),g.label]},g.id)})})]})}),i.jsxs("div",{className:"max-w-6xl mx-auto px-4 py-6",children:[n==="oauth"&&i.jsx(Dg,{}),n==="credentials"&&i.jsx(Fg,{}),n==="upload"&&i.jsx(Mg,{}),n==="usage-logs"&&i.jsx(qg,{}),n==="config"&&i.jsx(Bg,{}),n==="about"&&i.jsx(Hg,{version:s,onCheckUpdate:u,checkingUpdate:o})]})]})}zo.createRoot(document.getElementById("root")).render(i.jsx(Fp.StrictMode,{children:i.jsx(Qg,{})})); diff --git a/agy2api/dist/assets/index-xC348ENO.css b/agy2api/dist/assets/index-xC348ENO.css new file mode 100644 index 0000000000000000000000000000000000000000..de0986ab34b780d51da8ca411a8c334cdfe5b88c --- /dev/null +++ b/agy2api/dist/assets/index-xC348ENO.css @@ -0,0 +1 @@ +*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.bottom-full{bottom:100%}.left-0{left:0}.left-0\.5{left:.125rem}.right-0{right:0}.right-3{right:.75rem}.top-0{top:0}.top-0\.5{top:.125rem}.top-1\/2{top:50%}.top-full{top:100%}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-50{z-index:50}.z-\[60\]{z-index:60}.col-span-3{grid-column:span 3 / span 3}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.mx-auto{margin-left:auto;margin-right:auto}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-2{margin-left:.5rem}.mr-2{margin-right:.5rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.hidden{display:none}.h-10{height:2.5rem}.h-12{height:3rem}.h-16{height:4rem}.h-2{height:.5rem}.h-4{height:1rem}.h-40{height:10rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.max-h-56{max-height:14rem}.max-h-60{max-height:15rem}.max-h-64{max-height:16rem}.max-h-96{max-height:24rem}.max-h-\[60vh\]{max-height:60vh}.max-h-\[80vh\]{max-height:80vh}.max-h-\[85vh\]{max-height:85vh}.min-h-screen{min-height:100vh}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-12{width:3rem}.w-16{width:4rem}.w-4{width:1rem}.w-40{width:10rem}.w-5{width:1.25rem}.w-7{width:1.75rem}.w-full{width:100%}.min-w-0{min-width:0px}.max-w-2xl{max-width:42rem}.max-w-4xl{max-width:56rem}.max-w-6xl{max-width:72rem}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.flex-1{flex:1 1 0%}.flex-shrink-0,.shrink-0{flex-shrink:0}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-5{--tw-translate-x: 1.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-2\.5{gap:.625rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-x-3{-moz-column-gap:.75rem;column-gap:.75rem}.gap-y-0\.5{row-gap:.125rem}.gap-y-2{row-gap:.5rem}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-amber-500\/20{border-color:#f59e0b33}.border-amber-500\/30{border-color:#f59e0b4d}.border-blue-500\/30{border-color:#3b82f64d}.border-blue-500\/40{border-color:#3b82f666}.border-dark-600{--tw-border-opacity: 1;border-color:rgb(71 85 105 / var(--tw-border-opacity, 1))}.border-dark-700{--tw-border-opacity: 1;border-color:rgb(51 65 85 / var(--tw-border-opacity, 1))}.border-emerald-700\/30{border-color:#0478574d}.border-green-500\/30{border-color:#22c55e4d}.border-green-500\/40{border-color:#22c55e66}.border-orange-700\/30{border-color:#c2410c4d}.border-purple-500{--tw-border-opacity: 1;border-color:rgb(168 85 247 / var(--tw-border-opacity, 1))}.border-purple-500\/30{border-color:#a855f74d}.border-purple-500\/50{border-color:#a855f780}.border-red-500\/20{border-color:#ef444433}.border-red-500\/30{border-color:#ef44444d}.border-red-500\/40{border-color:#ef444466}.border-red-700\/30{border-color:#b91c1c4d}.border-white{--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity, 1))}.bg-amber-500\/10{background-color:#f59e0b1a}.bg-amber-500\/15{background-color:#f59e0b26}.bg-amber-600\/20{background-color:#d9770633}.bg-black\/60{background-color:#0009}.bg-black\/70{background-color:#000000b3}.bg-blue-500\/10{background-color:#3b82f61a}.bg-blue-500\/15{background-color:#3b82f626}.bg-blue-600\/20{background-color:#2563eb33}.bg-dark-600{--tw-bg-opacity: 1;background-color:rgb(71 85 105 / var(--tw-bg-opacity, 1))}.bg-dark-700{--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity, 1))}.bg-dark-800{--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1))}.bg-dark-800\/60{background-color:#1e293b99}.bg-dark-900{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1))}.bg-dark-900\/60{background-color:#0f172a99}.bg-dark-950\/95{background-color:#020617f2}.bg-emerald-600\/20{background-color:#05966933}.bg-emerald-900\/20{background-color:#064e3b33}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-green-500\/10{background-color:#22c55e1a}.bg-green-500\/15{background-color:#22c55e26}.bg-green-600\/20{background-color:#16a34a33}.bg-orange-500{--tw-bg-opacity: 1;background-color:rgb(249 115 22 / var(--tw-bg-opacity, 1))}.bg-purple-500\/10{background-color:#a855f71a}.bg-purple-600{--tw-bg-opacity: 1;background-color:rgb(147 51 234 / var(--tw-bg-opacity, 1))}.bg-purple-600\/20{background-color:#9333ea33}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-500\/10{background-color:#ef44441a}.bg-red-500\/15{background-color:#ef444426}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.bg-red-600\/10{background-color:#dc26261a}.bg-red-600\/20{background-color:#dc262633}.bg-red-900\/20{background-color:#7f1d1d33}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-yellow-500{--tw-bg-opacity: 1;background-color:rgb(234 179 8 / var(--tw-bg-opacity, 1))}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.from-emerald-900\/30{--tw-gradient-from: rgb(6 78 59 / .3) var(--tw-gradient-from-position);--tw-gradient-to: rgb(6 78 59 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-orange-900\/30{--tw-gradient-from: rgb(124 45 18 / .3) var(--tw-gradient-from-position);--tw-gradient-to: rgb(124 45 18 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-emerald-800\/10{--tw-gradient-to: rgb(6 95 70 / .1) var(--tw-gradient-to-position)}.to-orange-800\/10{--tw-gradient-to: rgb(154 52 18 / .1) var(--tw-gradient-to-position)}.p-0{padding:0}.p-1\.5{padding:.375rem}.p-10{padding:2.5rem}.p-2{padding:.5rem}.p-2\.5{padding:.625rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-8{padding:2rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-1{padding-bottom:.25rem}.pb-1\.5{padding-bottom:.375rem}.pb-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pr-12{padding-right:3rem}.pt-1{padding-top:.25rem}.pt-2{padding-top:.5rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.leading-relaxed{line-height:1.625}.leading-snug{line-height:1.375}.text-amber-400{--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.text-amber-400\/80{color:#fbbf24cc}.text-blue-400{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.text-cyan-400{--tw-text-opacity: 1;color:rgb(34 211 238 / var(--tw-text-opacity, 1))}.text-emerald-300\/80{color:#6ee7b7cc}.text-emerald-400{--tw-text-opacity: 1;color:rgb(52 211 153 / var(--tw-text-opacity, 1))}.text-emerald-500\/80{color:#10b981cc}.text-gray-200{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-green-400{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.text-orange-400{--tw-text-opacity: 1;color:rgb(251 146 60 / var(--tw-text-opacity, 1))}.text-purple-300{--tw-text-opacity: 1;color:rgb(216 180 254 / var(--tw-text-opacity, 1))}.text-purple-400{--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity, 1))}.text-purple-500{--tw-text-opacity: 1;color:rgb(168 85 247 / var(--tw-text-opacity, 1))}.text-red-300{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-400{--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.placeholder-gray-500::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(107 114 128 / var(--tw-placeholder-opacity, 1))}.placeholder-gray-500::placeholder{--tw-placeholder-opacity: 1;color:rgb(107 114 128 / var(--tw-placeholder-opacity, 1))}.accent-purple-600{accent-color:#9333ea}.opacity-40{opacity:.4}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-purple-500\/50{--tw-ring-color: rgb(168 85 247 / .5)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur{--tw-backdrop-blur: blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}body{--tw-bg-opacity: 1;background-color:rgb(2 6 23 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(243 244 246 / var(--tw-text-opacity, 1));font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1))}::-webkit-scrollbar-thumb{border-radius:9999px;--tw-bg-opacity: 1;background-color:rgb(71 85 105 / var(--tw-bg-opacity, 1))}::-webkit-scrollbar-thumb:hover{--tw-bg-opacity: 1;background-color:rgb(100 116 139 / var(--tw-bg-opacity, 1))}input:focus,textarea:focus,select:focus{outline:2px solid transparent;outline-offset:2px;--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000);--tw-ring-color: rgb(168 85 247 / .5)}.btn{border-radius:.5rem;padding:.5rem 1rem;font-weight:500;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.2s}.btn-primary{--tw-bg-opacity: 1;background-color:rgb(147 51 234 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.btn-primary:hover{--tw-bg-opacity: 1;background-color:rgb(126 34 206 / var(--tw-bg-opacity, 1))}.btn-secondary{--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.btn-secondary:hover{--tw-bg-opacity: 1;background-color:rgb(71 85 105 / var(--tw-bg-opacity, 1))}.btn-danger{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.btn-danger:hover{--tw-bg-opacity: 1;background-color:rgb(185 28 28 / var(--tw-bg-opacity, 1))}.card{border-radius:.75rem;border-width:1px;--tw-border-opacity: 1;border-color:rgb(51 65 85 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1));padding:1.5rem}.table-container{overflow-x:auto;border-radius:.5rem;border-width:1px;--tw-border-opacity: 1;border-color:rgb(51 65 85 / var(--tw-border-opacity, 1))}table{width:100%}th{--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1));padding:.75rem 1rem;text-align:left;font-size:.875rem;line-height:1.25rem;font-weight:500;--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}td{border-top-width:1px;--tw-border-opacity: 1;border-color:rgb(51 65 85 / var(--tw-border-opacity, 1));padding:.75rem 1rem;font-size:.875rem;line-height:1.25rem}tr:hover td{background-color:#1e293b80}.hover\:border-dark-500:hover{--tw-border-opacity: 1;border-color:rgb(100 116 139 / var(--tw-border-opacity, 1))}.hover\:border-purple-500\/40:hover{border-color:#a855f766}.hover\:bg-amber-600\/30:hover{background-color:#d977064d}.hover\:bg-dark-600:hover{--tw-bg-opacity: 1;background-color:rgb(71 85 105 / var(--tw-bg-opacity, 1))}.hover\:bg-dark-700:hover{--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity, 1))}.hover\:bg-emerald-600\/30:hover{background-color:#0596694d}.hover\:bg-red-600\/20:hover{background-color:#dc262633}.hover\:bg-red-700:hover{--tw-bg-opacity: 1;background-color:rgb(185 28 28 / var(--tw-bg-opacity, 1))}.hover\:text-blue-300:hover{--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity, 1))}.hover\:text-gray-200:hover{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.hover\:text-gray-300:hover{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.hover\:text-purple-300:hover{--tw-text-opacity: 1;color:rgb(216 180 254 / var(--tw-text-opacity, 1))}.hover\:text-red-300:hover{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.hover\:text-red-400:hover{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.hover\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-purple-500\/50:focus{--tw-ring-color: rgb(168 85 247 / .5)}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}@media (min-width: 640px){.sm\:inline{display:inline}.sm\:flex{display:flex}.sm\:w-24{width:6rem}.sm\:w-28{width:7rem}.sm\:w-32{width:8rem}.sm\:w-40{width:10rem}.sm\:w-64{width:16rem}.sm\:flex-row{flex-direction:row}.sm\:flex-wrap{flex-wrap:wrap}.sm\:items-center{align-items:center}.sm\:gap-2{gap:.5rem}.sm\:gap-3{gap:.75rem}.sm\:gap-4{gap:1rem}.sm\:space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.sm\:p-4{padding:1rem}.sm\:p-5{padding:1.25rem}.sm\:p-6{padding:1.5rem}.sm\:px-4{padding-left:1rem;padding-right:1rem}.sm\:px-5{padding-left:1.25rem;padding-right:1.25rem}.sm\:py-2{padding-top:.5rem;padding-bottom:.5rem}.sm\:text-2xl{font-size:1.5rem;line-height:2rem}.sm\:text-base{font-size:1rem;line-height:1.5rem}.sm\:text-sm{font-size:.875rem;line-height:1.25rem}}@media (min-width: 768px){.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (min-width: 1024px){.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}@media (min-width: 1280px){.xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}} diff --git a/agy2api/dist/favicon-32.png b/agy2api/dist/favicon-32.png new file mode 100644 index 0000000000000000000000000000000000000000..9c0da8717472d23c25ee61c71e89e0b443d53250 Binary files /dev/null and b/agy2api/dist/favicon-32.png differ diff --git a/agy2api/dist/favicon.ico b/agy2api/dist/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..04a93ee5433296d278c27999e762ffc1733a2ee0 Binary files /dev/null and b/agy2api/dist/favicon.ico differ diff --git a/agy2api/dist/index.html b/agy2api/dist/index.html new file mode 100644 index 0000000000000000000000000000000000000000..07c069ca32a83f424dbc61c403675d9ec39efe8c --- /dev/null +++ b/agy2api/dist/index.html @@ -0,0 +1,24 @@ + + + + + + + AGY2API - Antigravity 控制面板 + + + + + +
+ + diff --git a/agy2api/docker-compose.yml b/agy2api/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..c9cb9edb4c414f48c9ccb7d282d2bab75764aae7 --- /dev/null +++ b/agy2api/docker-compose.yml @@ -0,0 +1,25 @@ +version: '3.8' + +services: + agy2api: + image: ghcr.io/su-kaka/agy2api:latest + container_name: agy2api + restart: unless-stopped + network_mode: host + environment: + # 密码配置(分离密码) + - API_PASSWORD=${API_PASSWORD:-your_api_password} + - PANEL_PASSWORD=${PANEL_PASSWORD:-your_panel_password} + + # 服务器配置 + - PORT=${PORT:-7861} + - HOST=${HOST:-0.0.0.0} + + # 可选: PostgreSQL 配置 (分布式存储) + # - POSTGRESQL_URI=${POSTGRESQL_URI} + + # 可选: 代理配置 + # - PROXY=${PROXY} + volumes: + - ./data/creds:/app/creds + - ./data/request_logs:/app/data/request_logs diff --git a/agy2api/docs/README_EN.md b/agy2api/docs/README_EN.md new file mode 100644 index 0000000000000000000000000000000000000000..83579bae197d2a9e8c3736c49f7308d7e21b301c --- /dev/null +++ b/agy2api/docs/README_EN.md @@ -0,0 +1,681 @@ +# AGY2API + +**Convert Google Antigravity to OpenAI, Gemini, and Claude API Compatible Interfaces** + +[![Python 3.12+](https://img.shields.io/badge/python-3.12+-blue.svg)](https://www.python.org/downloads/) +[![License: CNC-1.0](https://img.shields.io/badge/License-CNC--1.0-red.svg)](../LICENSE) +[![Docker](https://img.shields.io/badge/docker-available-blue.svg)](https://github.com/su-kaka/agy2api/pkgs/container/agy2api) + +[中文](../README.md) | English | [日本語](./README_JA.md) + +> **⚠️ Important Change**: The GeminiCLI endpoint has been deprecated by Google. All GeminiCLI-related code has been completely removed; only the Antigravity mode remains. + +## Installation Guide + +### Termux Environment + +**Initial Installation** +```bash +curl -o termux-install.sh "https://raw.githubusercontent.com/su-kaka/agy2api/refs/heads/master/termux-install.sh" && chmod +x termux-install.sh && ./termux-install.sh +``` + +**Restart Service** +```bash +cd agy2api +bash termux-start.sh +``` + +### Windows Environment + +**Initial Installation** +```powershell +iex (iwr "https://raw.githubusercontent.com/su-kaka/agy2api/refs/heads/master/install.ps1" -UseBasicParsing).Content +``` + +**Restart Service** +Double-click to execute `start.bat` + +### Linux Environment + +**Initial Installation** +```bash +curl -o install.sh "https://raw.githubusercontent.com/su-kaka/agy2api/refs/heads/master/install.sh" && chmod +x install.sh && ./install.sh +``` + +**Restart Service** +```bash +cd agy2api +bash start.sh +``` + +### macOS Environment + +**Initial Installation** +```bash +curl -o darwin-install.sh "https://raw.githubusercontent.com/su-kaka/agy2api/refs/heads/master/darwin-install.sh" && chmod +x darwin-install.sh && ./darwin-install.sh +``` + +**Restart Service** +```bash +cd agy2api +bash start.sh +``` + +### Docker Environment + +**Docker Run Command** +```bash +docker run -d --name agy2api --network host -e API_PASSWORD=api_pwd -e PANEL_PASSWORD=panel_pwd -e PORT=7861 -v $(pwd)/data/creds:/app/creds -v $(pwd)/data/request_logs:/app/data/request_logs ghcr.io/su-kaka/agy2api:latest +``` + +**Docker Mac** +```bash +docker run -d \ + --name agy2api \ + -p 7861:7861 \ + -p 8080:8080 \ + -e API_PASSWORD=api_pwd \ + -e PANEL_PASSWORD=panel_pwd \ + -e PORT=7861 \ + -v "$(pwd)/data/creds":/app/creds \ + -v "$(pwd)/data/request_logs":/app/data/request_logs \ + ghcr.io/su-kaka/agy2api:latest +``` + +**Docker Compose Run Command** +1. Save the following content as `docker-compose.yml` file: + ```yaml + version: '3.8' + + services: + agy2api: + image: ghcr.io/su-kaka/agy2api:latest + container_name: agy2api + restart: unless-stopped + network_mode: host + environment: + # Password configuration (separate passwords) + - API_PASSWORD=your_api_password + - PANEL_PASSWORD=your_panel_password + - PORT=7861 + volumes: + - ./data/creds:/app/creds + - ./data/request_logs:/app/data/request_logs + healthcheck: + test: ["CMD-SHELL", "python -c \"import sys, urllib.request, os; port = os.environ.get('PORT', '7861'); req = urllib.request.Request(f'http://localhost:{port}/v1/models', headers={'Authorization': 'Bearer ' + os.environ.get('API_PASSWORD', 'pwd')}); sys.exit(0 if urllib.request.urlopen(req, timeout=5).getcode() == 200 else 1)\""] + interval: 30s + timeout: 10s + retries: 3 + start_period: 40s + ``` +2. Start the service: + ```bash + docker-compose up -d + ``` + +## Core Features + +### 🔄 API Endpoints and Format Support + +**Multi-endpoint Multi-format Support** +- **OpenAI Compatible Endpoints**: `/v1/chat/completions` and `/v1/models` + - Supports standard OpenAI format (messages structure) + - Supports Gemini native format (contents structure) + - Automatic format detection and conversion, no manual switching required + - Supports multimodal input (text + images) +- **Gemini Native Endpoints**: `/v1/models/{model}:generateContent` and `streamGenerateContent` + - Supports complete Gemini native API specifications + - Multiple authentication methods: Bearer Token, x-goog-api-key header, URL parameter key +- **Claude Format Compatibility**: Full support for Claude API format + - Endpoint: `/v1/messages` (follows Claude API specification) + - Supports Claude standard messages format + - Supports system parameter and Claude-specific features + - Automatically converts to backend-supported format +- **Antigravity API Support**: Supports OpenAI, Gemini, and Claude formats + - OpenAI format endpoint: `/v1/chat/completions` + - Gemini format endpoint: `/v1/models/{model}:generateContent` and `streamGenerateContent` + - Claude format endpoint: `/v1/messages` + - Supports all Antigravity models (Claude, Gemini, etc.) + - Automatic model name mapping and thinking mode detection + +### 🔐 Authentication and Security Management + +**Flexible Password Management** +- **Separate Password Support**: API password (chat endpoints) and control panel password can be set independently +- **Multiple Authentication Methods**: Supports Authorization Bearer, x-goog-api-key header, URL parameters, etc. +- **JWT Token Authentication**: Control panel supports JWT token authentication +- **User Email Retrieval**: Automatically retrieves and displays Google account email addresses + +### 📊 Intelligent Credential Management System + +**Advanced Credential Management** +- Multiple Google OAuth credential automatic rotation +- Enhanced stability through redundant authentication +- Load balancing and concurrent request support +- Automatic failure detection and credential disabling +- Credential usage statistics and quota management +- Credentials keyed by email (unique); re-importing the same email overwrites automatically +- Batch operations (enable, disable, delete) + +**Credential Status Monitoring** +- Real-time credential health checks +- Error code tracking (429, 403, 500, etc.) +- Automatic banning mechanism (configurable) + +### 🌊 Streaming and Response Processing + +**Multiple Streaming Support** +- True real-time streaming responses +- Streaming anti-truncation feature (prevents answer truncation) +- Asynchronous task management and timeout handling + +**Response Optimization** +- Thinking chain content separation +- Reasoning process (reasoning_content) handling +- Multi-turn conversation context management + +### 🎛️ Web Management Console + +**Full-featured Web Interface** +- Antigravity OAuth authentication flow (with callback URL shortcut) +- Credential file upload, download, and management +- System configuration management +- Usage statistics and monitoring dashboard +- Mobile-friendly interface + +**Batch Operation Support** +- ZIP/JSON batch credential upload (Antigravity) +- Batch enable/disable/delete credentials +- Batch user email retrieval +- Batch configuration management +- Unified batch upload interface for all credential types + +### 🔧 Advanced Configuration and Customization + +**Network and Proxy Configuration** +- HTTP/HTTPS proxy support +- Proxy endpoint configuration (OAuth, Google APIs, metadata service) +- Timeout and retry configuration +- Network error handling and recovery + +**Performance and Stability Configuration** +- 429 error automatic retry (configurable interval and attempts) +- Anti-truncation maximum retry attempts + +**Logging and Debugging** +- Multi-level logging system (DEBUG, INFO, WARNING, ERROR) +- Console-only logging (`ENABLE_LOG=0` for full silence) + +### 🔄 Environment Variables and Configuration Management + +**Flexible Configuration Methods** +- Environment variable configuration +- Hot configuration updates (partial configuration items) +- Configuration locking (environment variable priority) + +## Supported Models + +All models have 1M context window capacity. Each credential file provides 1000 request quota. + +### 🤖 Base Models +- `gemini-2.5-pro` +- `gemini-3-pro-preview` +- `gemini-3.1-pro-preview` + +### 🧠 Thinking Models +- `gemini-2.5-pro-high`: Thinking mode +- `gemini-2.5-pro-low`: Low thinking mode +- Supports custom thinking budget configuration +- Automatic separation of thinking content and final answers + +### 🔍 Search-Enhanced Models +- `gemini-2.5-pro-search`: Model with integrated search functionality + +### 🖼️ Image Generation Models (Antigravity) +- `gemini-3.1-flash-image`: Base image generation model +- **Resolution Suffixes**: + - `-2k`: 2K resolution + - `-4k`: 4K HD resolution +- **Aspect Ratio Suffixes**: + - `-1x1`: Square (avatar) + - `-16x9`: Landscape (desktop wallpaper) + - `-9x16`: Portrait (mobile wallpaper) + - `-21x9`: Ultra-wide (ultrawide monitor) + - `-4x3`: Traditional display + - `-3x4`: Portrait poster +- **Combination Examples**: + - `gemini-3.1-flash-image-4k-16x9`: 4K landscape + - `gemini-3.1-flash-image-2k-9x16`: 2K portrait +- When no ratio is specified, the API automatically decides the aspect ratio + +### 🌊 Special Feature Variants + + + +- **Anti-truncation Mode**: Add `抗截断-` prefix to model name + - Example: `抗截断-gemini-2.5-pro` + - Uses synthetic tool calls to bypass truncation limits and ensure complete answers (works for both streaming and non-streaming) + +### 🔧 Automatic Model Feature Detection +- System automatically recognizes feature identifiers in model names +- Transparently handles feature mode transitions +- Supports feature combination usage + +--- + +## Configuration Instructions + +1. Visit `http://127.0.0.1:7861` (default port, modifiable via PORT environment variable) +2. Complete OAuth authentication flow (default password: `pwd`, modifiable via environment variables) +3. Configure client: + +**OpenAI Compatible Client:** + - **Endpoint Address**: `http://127.0.0.1:7861/v1` + - **API Key**: `pwd` (default value, modifiable via API_PASSWORD environment variable) + +**Gemini Native Client:** + - **Endpoint Address**: `http://127.0.0.1:7861` + - **Authentication Methods**: + - `Authorization: Bearer your_api_password` + - `x-goog-api-key: your_api_password` + - URL parameter: `?key=your_api_password` + +## 💾 Data Storage Mode + +### 🌟 Storage Backend Support + +agy2api supports two storage backends: **Local SQLite (Default)** and **PostgreSQL (Cloud Distributed Storage)** + +### 📁 Local SQLite Storage (Default) + +**Default Storage Method** +- No configuration required, works out of the box +- Data is stored in a local SQLite database (`creds/credentials.db`) +- Suitable for single-machine deployment and personal use + +**Credential Structure** + +Credentials are stored as structured database columns (no JSON blobs), keyed uniquely by **email**: +`email`, `access_token`, `refresh_token`, `client_id`, `client_secret`, `project_id`, `expiry`, `tier` + +Import/export uses a standardized JSON format: `{"refresh_token": "...", "access_token": "...", "expiry": "...", "email": "...", "tier": "...", "project_id": "..."}` (only `refresh_token` is required; an unexpired `access_token` is reused directly; the rest are fetched automatically). + +### Environment Variable Configuration + +**Basic Configuration** +- `PORT`: Service port (default: 7861) +- `HOST`: Server listen address (default: 0.0.0.0) + +**Password Configuration** +- `API_PASSWORD`: Chat API access password (default: pwd) +- `PANEL_PASSWORD`: Control panel access password (default: pwd) + +**Access Control Configuration** +- `IP_WHITELIST_ENABLED`: Enable IP whitelist (default: false, no restriction) +- `IP_WHITELIST`: IP whitelist, comma or newline separated (default: empty). Each entry supports a single IP (`192.168.1.1`), CIDR range (`192.168.1.0/24`), or start-end range (`10.0.0.1-10.0.0.100`), for both IPv4 / IPv6. Once enabled, only whitelisted IPs can access the panel and API; all others get 403. Effective immediately after panel save + +**Model Name Rewrite** +- `MODEL_REWRITE_ENABLED`: Enable model name rewriting (default: false) +- `MODEL_REWRITE_RULES`: Rewrite rules, each `[match regex, replacement model name]` (default: empty). First match from top wins; replacements support regex backreferences (e.g. `\1`). Example: map `gpt-4o` to `gemini-2.5-pro`. Effective immediately after panel save + +**Performance and Stability Configuration** +- `RETRY_429_ENABLED`: Enable 429 error automatic retry (default: true) +- `RETRY_429_MAX_RETRIES`: Maximum retry attempts for 429 errors (default: 5) +- `RETRY_429_INTERVAL`: Retry interval for 429 errors, in seconds (default: 1.0) +- `ANTI_TRUNCATION_MAX_ATTEMPTS`: Maximum retry attempts for anti-truncation (default: 3) + +**Network and Proxy Configuration** +- `PROXY`: Proxy address (supports `http://`, `https://`, `socks5://`, `socks5h://`, optionally with credentials `user:pass@host:port`) +- `OAUTH_PROXY_URL`: OAuth authentication proxy endpoint +- `GOOGLEAPIS_PROXY_URL`: Google APIs proxy endpoint +- `PATH_PREFIX`: When the reverse proxy preserves the path prefix (e.g. `/AGY2API`), set this so the backend strips it before routing; default: empty (no stripping) + +**Automation Configuration** +- `AUTO_BAN`: Enable automatic credential banning (default: false) +- `AUTO_BAN_ERROR_CODES`: Error codes that trigger automatic banning (default: 403) + +**Logging Configuration** +- `LOG_LEVEL`: Log level (DEBUG/INFO/WARNING/ERROR, default: INFO) +- `ENABLE_LOG`: Full silence, no log output (set to 0 to enable, default: 1) + +**Response Behavior Configuration** +- `RETURN_THOUGHTS_TO_FRONTEND`: Return thinking chain to the frontend (default: true) + +**Sensitive Word Filtering** +- `SENSITIVE_WORDS_ENABLED`: Enable sensitive word filtering (default: false) +- `SENSITIVE_WORDS`: Sensitive word list, comma or newline separated (default: empty). Matches are replaced with empty string, case-insensitive, Chinese supported, effective immediately after panel save + +**Usage Log** +- `USAGE_LOG_ENABLED`: Enable request logging (default: true). Records every API request (model, credential, token usage, latency, status) to the database. No automatic cleanup; use the panel to clear logs manually + +**Request Body Debug Log** +- `REQUEST_LOG_ENABLED`: Enable request body debug logging (default: false). When enabled and the final status code matches the configured codes, the full request headers (redacted) and body sent upstream are saved as JSON files under `data/request_logs/`. Only the file index is stored in the database; view it from the request log detail modal. Mainly for debugging request body errors (e.g. 400); clearing/truncating logs also deletes these files (mount `./data/request_logs:/app/data/request_logs` in Docker to persist) +- `REQUEST_LOG_ERROR_CODES`: Status codes that trigger debug logging, comma separated (default: 400) + +**Credential Select Mode** +- `CREDENTIAL_SELECT_MODE`: Credential selection mode (default: cache) + - `random` — Fully random load balancing, each request picks a random credential + - `cache` — Cache affinity (recommended): hashes "model + system instruction (or first user message)" into a session key; the same session reuses the same credential, hitting Google's upstream prompt cache; automatically switches and rebinds after credential cooldown + - `sticky` — Sticky: all requests lock onto one credential until it enters cooldown or gets disabled +- `REDIS_URL`: Redis connection string (optional). When set, cache-mode session bindings are stored in Redis for multi-instance sharing; otherwise an in-process memory backend is used + +**Storage Configuration** + +**SQLite (Default)** +- No configuration required, database file created in `creds/` automatically + +**PostgreSQL (Optional Cloud Storage)** +- `POSTGRESQL_URI`: PostgreSQL connection string (enables PostgreSQL mode when set) + +**Docker Usage Example** +```bash +docker run -d --name agy2api \ + -e API_PASSWORD=my_api_password \ + -e PANEL_PASSWORD=my_panel_password \ + -e PORT=7861 \ + ghcr.io/su-kaka/agy2api:latest +``` + +### API Usage Methods + +This service supports multiple complete sets of API endpoints: + +#### 3. Claude API Format Endpoints + +**Endpoint:** `/v1/messages` +**Authentication:** `x-api-key: your_api_password` or `Authorization: Bearer your_api_password` + +**Request Example:** +```bash +curl -X POST "http://127.0.0.1:7861/v1/messages" \ + -H "x-api-key: your_api_password" \ + -H "anthropic-version: 2023-06-01" \ + -H "Content-Type: application/json" \ + -d '{ + "model": "gemini-2.5-pro", + "max_tokens": 1024, + "messages": [ + {"role": "user", "content": "Hello, Claude!"} + ] + }' +``` + +**Support for system parameter:** +```json +{ + "model": "gemini-2.5-pro", + "max_tokens": 1024, + "system": "You are a helpful assistant", + "messages": [ + {"role": "user", "content": "Hello"} + ] +} +``` + +**Notes:** +- Fully compatible with Claude API format specification +- Automatically converts to Gemini format for backend calls +- Supports all Claude standard parameters +- Response format follows Claude API specification + +#### 4. Antigravity API Endpoints + +**Supports three formats: OpenAI, Gemini, and Claude** + +##### Antigravity OpenAI Format Endpoints + +**Endpoint:** `/v1/chat/completions` +**Authentication:** `Authorization: Bearer your_api_password` + +**Request Example:** +```bash +curl -X POST "http://127.0.0.1:7861/v1/chat/completions" \ + -H "Authorization: Bearer your_api_password" \ + -H "Content-Type: application/json" \ + -d '{ + "model": "claude-sonnet-4-5", + "messages": [ + {"role": "user", "content": "Hello"} + ], + "stream": true + }' +``` + +##### Antigravity Gemini Format Endpoints + +**Non-streaming Endpoint:** `/v1/models/{model}:generateContent` +**Streaming Endpoint:** `/v1/models/{model}:streamGenerateContent` + +**Authentication Methods (choose one):** +- `Authorization: Bearer your_api_password` +- `x-goog-api-key: your_api_password` +- URL parameter: `?key=your_api_password` + +**Request Examples:** +```bash +# Gemini format non-streaming request +curl -X POST "http://127.0.0.1:7861/v1/models/claude-sonnet-4-5:generateContent" \ + -H "x-goog-api-key: your_api_password" \ + -H "Content-Type: application/json" \ + -d '{ + "contents": [ + {"role": "user", "parts": [{"text": "Hello"}]} + ], + "generationConfig": { + "temperature": 0.7 + } + }' + +# Gemini format streaming request +curl -X POST "http://127.0.0.1:7861/v1/models/gemini-2.5-flash:streamGenerateContent?key=your_api_password" \ + -H "Content-Type: application/json" \ + -d '{ + "contents": [ + {"role": "user", "parts": [{"text": "Hello"}]} + ] + }' +``` + +##### Antigravity Claude Format Endpoints + +**Endpoint:** `/v1/messages` +**Authentication:** `x-api-key: your_api_password` + +**Request Example:** +```bash +curl -X POST "http://127.0.0.1:7861/v1/messages" \ + -H "x-api-key: your_api_password" \ + -H "anthropic-version: 2023-06-01" \ + -H "Content-Type: application/json" \ + -d '{ + "model": "claude-sonnet-4-5", + "max_tokens": 1024, + "messages": [ + {"role": "user", "content": "Hello"} + ] + }' +``` + +**Supported Antigravity Models:** +- Claude series: `claude-sonnet-4-5`, `claude-opus-4-5`, etc. +- Gemini series: `gemini-2.5-flash`, `gemini-2.5-pro`, etc. +- Automatically supports thinking models + +**Gemini Native Example:** +```python +from io import BytesIO +from PIL import Image +from google.genai import Client +from google.genai.types import HttpOptions +from google.genai import types +# The client gets the API key from the environment variable `GEMINI_API_KEY`. + +client = Client( + api_key="pwd", + http_options=HttpOptions(base_url="http://127.0.0.1:7861"), + ) + +prompt = ( + """ + Draw a cat + """ +) + +response = client.models.generate_content( + model="gemini-3.1-flash-image", + contents=[prompt], + config=types.GenerateContentConfig( + image_config=types.ImageConfig( + aspect_ratio="16:9", + ) + ) +) +for part in response.candidates[0].content.parts: + if part.text is not None: + print(part.text) + elif part.inline_data is not None: + image = Image.open(BytesIO(part.inline_data.data)) + image.save("generated_image.png") + +``` + +**Notes:** +- OpenAI endpoints return OpenAI-compatible format +- Gemini endpoints return Gemini native format +- Both endpoints use the same API password + +## 📋 Complete API Reference + +### Web Console API + +**Authentication Endpoints** +- `POST /auth/login` - User login +- `POST /auth/start` - Start Antigravity OAuth authentication +- `POST /auth/callback` - Handle OAuth callback +- `POST /auth/callback-url` - Complete authentication directly from callback URL +- `GET /auth/status/{project_id}` - Check authentication status + +**Credential Management Endpoints** +- `POST /creds/upload` - Batch upload credential files (supports JSON and ZIP) +- `GET /creds/status` - Get credential status list (supports pagination and filtering) +- `GET /creds/detail/{email}` - Get single credential details +- `POST /creds/action` - Single credential operation (enable/disable/delete) +- `POST /creds/batch-action` - Batch credential operations +- `GET /creds/export/{email}` - Export single credential as standardized JSON +- `GET /creds/download-all` - Package download all credentials (standardized JSON, one file per email) +- `GET /creds/quota/{email}` - Get credential quota information + +**Configuration Management Endpoints** +- `GET /config/get` - Get current configuration +- `POST /config/save` - Save configuration + +**Version Information Endpoints** +- `GET /version/info` - Get version information (optional `check_update=true` parameter to check for updates) + +### Chat API Features + +**Multimodal Support** +```json +{ + "model": "gemini-2.5-pro", + "messages": [ + { + "role": "user", + "content": [ + {"type": "text", "text": "Describe this image"}, + { + "type": "image_url", + "image_url": { + "url": "data:image/jpeg;base64,/9j/4AAQSkZJRgABA..." + } + } + ] + } + ] +} +``` + +**Thinking Mode Support** +```json +{ + "model": "gemini-2.5-pro-high", + "messages": [ + {"role": "user", "content": "Complex math problem"} + ] +} +``` + +Response will include separated thinking content: +```json +{ + "choices": [{ + "message": { + "role": "assistant", + "content": "Final answer", + "reasoning_content": "Detailed thought process..." + } + }] +} +``` + +**Anti-truncation Usage** +```json +{ + "model": "抗截断-gemini-2.5-pro", + "messages": [ + {"role": "user", "content": "Write a long article"} + ], + "stream": true +} +``` + +--- + +## 🛠️ Frontend Development + +The panel frontend source lives in `frontend/` (React + Vite + Tailwind CSS): + +```bash +cd frontend +npm install +npm run dev # Development mode, port 3000, proxies backend API +npm run build # Build to dist/ (used in production) +``` + +The backend serves the compiled static files under `dist/` directly; no Node.js runtime required. + +## 💬 Community + +Welcome to join the QQ group for discussion! + +**QQ Group: 1083250744** + +--- + +## License and Disclaimer + +This project is for learning and research purposes only. Using this project indicates that you agree to: +- Not use this project for any commercial purposes +- Bear all risks and responsibilities of using this project +- Comply with relevant terms of service and legal regulations + +The project authors are not responsible for any direct or indirect losses arising from the use of this project. + +## ⚠️ License Declaration + +**This project is licensed under the Cooperative Non-Commercial License (CNC-1.0)** + +This is a strict anti-commercial open source license. Please refer to the [LICENSE](../LICENSE) file for details. + +### ✅ Permitted Uses: +- Personal learning, research, and educational purposes +- Non-profit organization use +- Open source project integration (must comply with the same license) +- Academic research and publication + +### ❌ Prohibited Uses: +- Any form of commercial use +- Enterprise use with annual revenue exceeding $1 million +- Venture capital-backed or publicly traded companies +- Providing paid services or products +- Commercial competitive use diff --git a/agy2api/docs/README_JA.md b/agy2api/docs/README_JA.md new file mode 100644 index 0000000000000000000000000000000000000000..4792e2fead7725c0d16ba779dfe580593dc6e08e --- /dev/null +++ b/agy2api/docs/README_JA.md @@ -0,0 +1,680 @@ +# AGY2API + +**Google AntigravityをOpenAI、Gemini、Claude API互換インターフェースに変換** + +[![Python 3.12+](https://img.shields.io/badge/python-3.12+-blue.svg)](https://www.python.org/downloads/) +[![License: CNC-1.0](https://img.shields.io/badge/License-CNC--1.0-red.svg)](../LICENSE) +[![Docker](https://img.shields.io/badge/docker-available-blue.svg)](https://github.com/su-kaka/agy2api/pkgs/container/agy2api) + +[中文](../README.md) | [English](README_EN.md) | 日本語 + +## インストールガイド + +### Termux環境 + +**初期インストール** +```bash +curl -o termux-install.sh "https://raw.githubusercontent.com/su-kaka/agy2api/refs/heads/master/termux-install.sh" && chmod +x termux-install.sh && ./termux-install.sh +``` + +**サービス再起動** +```bash +cd agy2api +bash termux-start.sh +``` + +### Windows環境 + +**初期インストール** +```powershell +iex (iwr "https://raw.githubusercontent.com/su-kaka/agy2api/refs/heads/master/install.ps1" -UseBasicParsing).Content +``` + +**サービス再起動** +`start.bat` をダブルクリックして実行 + +### Linux環境 + +**初期インストール** +```bash +curl -o install.sh "https://raw.githubusercontent.com/su-kaka/agy2api/refs/heads/master/install.sh" && chmod +x install.sh && ./install.sh +``` + +**サービス再起動** +```bash +cd agy2api +bash start.sh +``` + +### macOS環境 + +**初期インストール** +```bash +curl -o darwin-install.sh "https://raw.githubusercontent.com/su-kaka/agy2api/refs/heads/master/darwin-install.sh" && chmod +x darwin-install.sh && ./darwin-install.sh +``` + +**サービス再起動** +```bash +cd agy2api +bash start.sh +``` + +### Docker環境 + +**Docker Runコマンド** +```bash +docker run -d --name agy2api --network host -e API_PASSWORD=api_pwd -e PANEL_PASSWORD=panel_pwd -e PORT=7861 -v $(pwd)/data/creds:/app/creds -v $(pwd)/data/request_logs:/app/data/request_logs ghcr.io/su-kaka/agy2api:latest +``` + +**Docker Mac** +```bash +docker run -d \ +--name agy2api \ +-p 7861:7861 \ +-p 8080:8080 \ +-e API_PASSWORD=api_pwd \ +-e PANEL_PASSWORD=panel_pwd \ +-e PORT=7861 \ +-v $(pwd)/data/creds:/app/creds \ +-v $(pwd)/data/request_logs:/app/data/request_logs \ +ghcr.io/su-kaka/agy2api:latest +``` + +**Docker Compose Runコマンド** +1. 以下の内容を `docker-compose.yml` ファイルとして保存: + ```yaml + version: '3.8' + + services: + agy2api: + image: ghcr.io/su-kaka/agy2api:latest + container_name: agy2api + restart: unless-stopped + network_mode: host + environment: + # パスワード設定(個別パスワード) + - API_PASSWORD=your_api_password + - PANEL_PASSWORD=your_panel_password + - PORT=7861 + volumes: + - ./data/creds:/app/creds + - ./data/request_logs:/app/data/request_logs + healthcheck: + test: ["CMD-SHELL", "python -c \"import sys, urllib.request, os; port = os.environ.get('PORT', '7861'); req = urllib.request.Request(f'http://localhost:{port}/v1/models', headers={'Authorization': 'Bearer ' + os.environ.get('API_PASSWORD', 'pwd')}); sys.exit(0 if urllib.request.urlopen(req, timeout=5).getcode() == 200 else 1)\""] + interval: 30s + timeout: 10s + retries: 3 + start_period: 40s + ``` +2. サービスを起動: + ```bash + docker-compose up -d + ``` + +## コア機能 + +### 🔄 APIエンドポイントとフォーマット対応 + +**マルチエンドポイント・マルチフォーマット対応** +- **OpenAI互換エンドポイント**: `/v1/chat/completions` および `/v1/models` + - 標準OpenAIフォーマット(messages構造)に対応 + - Geminiネイティブフォーマット(contents構造)に対応 + - フォーマットの自動検出・変換、手動切替不要 + - マルチモーダル入力に対応(テキスト+画像) +- **Geminiネイティブエンドポイント**: `/v1/models/{model}:generateContent` および `streamGenerateContent` + - Geminiネイティブ API仕様に完全対応 + - 複数の認証方式: Bearer Token、x-goog-api-keyヘッダー、URLパラメータkey +- **Claudeフォーマット互換**: Claude APIフォーマットに完全対応 + - エンドポイント: `/v1/messages`(Claude API仕様に準拠) + - Claude標準messagesフォーマットに対応 + - systemパラメータおよびClaude固有機能に対応 + - バックエンド対応フォーマットへの自動変換 +- **Antigravity API対応**: OpenAI、Gemini、Claudeフォーマットに対応 + - OpenAIフォーマットエンドポイント: `/v1/chat/completions` + - Geminiフォーマットエンドポイント: `/v1/models/{model}:generateContent` および `streamGenerateContent` + - Claudeフォーマットエンドポイント: `/v1/messages` + - 全Antigravityモデルに対応(Claude、Geminiなど) + - モデル名の自動マッピングおよびThinkingモード検出 + +### 🔐 認証とセキュリティ管理 + +**柔軟なパスワード管理** +- **個別パスワード対応**: APIパスワード(チャットエンドポイント)とコントロールパネルパスワードを個別に設定可能 +- **複数の認証方式**: Authorization Bearer、x-goog-api-keyヘッダー、URLパラメータなどに対応 +- **JWTトークン認証**: コントロールパネルはJWTトークン認証に対応 +- **ユーザーメール取得**: Googleアカウントのメールアドレスを自動取得・表示 + +### 📊 インテリジェントなクレデンシャル管理システム + +**高度なクレデンシャル管理** +- 複数のGoogle OAuthクレデンシャルの自動ローテーション +- 冗長認証による安定性の向上 +- ロードバランシングと同時リクエスト対応 +- 自動障害検出とクレデンシャル無効化 +- クレデンシャル使用統計とクォータ管理 +- クレデンシャルファイルの手動有効化/無効化に対応 +- クレデンシャルファイルの一括操作(有効化、無効化、削除) + +**クレデンシャルステータス監視** +- リアルタイムのクレデンシャルヘルスチェック +- エラーコードの追跡(429、403、500など) +- 自動BAN機能(設定可能) + +### 🌊 ストリーミングとレスポンス処理 + +**複数のストリーミング対応** +- リアルタイムストリーミングレスポンス +- ストリーミング途切れ防止機能(回答の途切れを防止) +- 非同期タスク管理とタイムアウト処理 + +**レスポンス最適化** +- 思考チェーン内容の分離 +- 推論プロセス(reasoning_content)の処理 +- マルチターン会話のコンテキスト管理 + +### 🎛️ Web管理コンソール + +**フル機能のWebインターフェース** +- Antigravity OAuth認証フロー(コールバックURLショートカット対応) +- クレデンシャルファイルのアップロード、ダウンロード、管理 +- システム設定管理 +- 使用統計と監視ダッシュボード +- モバイル対応インターフェース + +**一括操作対応** +- ZIP/JSON一括クレデンシャルアップロード(Antigravity) +- クレデンシャルの一括有効化/無効化/削除 +- ユーザーメールの一括取得 +- 設定の一括管理 +- 全クレデンシャルタイプ統合一括アップロードインターフェース + +### 🔧 高度な設定とカスタマイズ + +**ネットワークとプロキシ設定** +- HTTP/HTTPSプロキシ対応 +- プロキシエンドポイント設定(OAuth、Google APIs、メタデータサービス) +- タイムアウトとリトライ設定 +- ネットワークエラー処理とリカバリ + +**パフォーマンスと安定性の設定** +- 429エラーの自動リトライ(間隔と回数を設定可能) +- 途切れ防止の最大リトライ回数 + +**ログとデバッグ** +- マルチレベルログシステム(DEBUG、INFO、WARNING、ERROR) +- コンソールのみのログ出力(`ENABLE_LOG=0` で完全サイレント) + +### 🔄 環境変数と設定管理 + +**柔軟な設定方法** +- 環境変数による設定 +- ホット設定更新(一部設定項目) +- 設定ロック(環境変数優先) + +## 対応モデル + +全モデルが100万トークンのコンテキストウィンドウに対応。各クレデンシャルファイルで1000リクエストのクォータを提供。 + +### 🤖 基本モデル +- `gemini-2.5-pro` +- `gemini-3-pro-preview` +- `gemini-3.1-pro-preview` + +### 🧠 Thinkingモデル +- `gemini-2.5-pro-high`: Thinkingモード +- `gemini-2.5-pro-low`: 低Thinkingモード +- カスタムThinkingバジェット設定に対応 +- 思考内容と最終回答の自動分離 + +### 🔍 検索拡張モデル +- `gemini-2.5-pro-search`: 検索機能統合モデル + +### 🖼️ 画像生成モデル(Antigravity) +- `gemini-3.1-flash-image`: 基本画像生成モデル +- **解像度サフィックス**: + - `-2k`: 2K解像度 + - `-4k`: 4K HD解像度 +- **アスペクト比サフィックス**: + - `-1x1`: 正方形(アバター) + - `-16x9`: 横長(デスクトップ壁紙) + - `-9x16`: 縦長(モバイル壁紙) + - `-21x9`: ウルトラワイド(ウルトラワイドモニター) + - `-4x3`: 従来のディスプレイ + - `-3x4`: 縦型ポスター +- **組み合わせ例**: + - `gemini-3.1-flash-image-4k-16x9`: 4K横長 + - `gemini-3.1-flash-image-2k-9x16`: 2K縦長 +- 比率未指定時はAPIが自動的にアスペクト比を決定 + +### 🌊 特殊機能バリアント +- **途切れ防止モード**: モデル名に `抗截断-` プレフィックスを追加 + - 例: `抗截断-gemini-2.5-pro` + - 合成ツール呼び出しで途切れ制限を回避し、完全な回答を保証(ストリーミング・非ストリーミング両対応) + +### 🔧 モデル機能の自動検出 +- システムがモデル名内の機能識別子を自動認識 +- 機能モード切替を透過的に処理 +- 機能の組み合わせ使用に対応 + +--- + +## 設定手順 + +1. `http://127.0.0.1:7861` にアクセス(デフォルトポート、PORT環境変数で変更可能) +2. OAuth認証フローを完了(デフォルトパスワード: `pwd`、環境変数で変更可能) + - **GCLIモード**: Google Cloud Gemini APIクレデンシャルの取得用 +3. クライアントを設定: + +**OpenAI互換クライアント:** + - **エンドポイントアドレス**: `http://127.0.0.1:7861/v1` + - **APIキー**: `pwd`(デフォルト値、API_PASSWORD環境変数で変更可能) + +**Geminiネイティブクライアント:** + - **エンドポイントアドレス**: `http://127.0.0.1:7861` + - **認証方式**: + - `Authorization: Bearer your_api_password` + - `x-goog-api-key: your_api_password` + - URLパラメータ: `?key=your_api_password` + +## 💾 データストレージモード + +### 🌟 ストレージバックエンド対応 + +agy2apiは2つのストレージバックエンドに対応: **ローカルSQLite(デフォルト)** と **PostgreSQL(クラウド分散ストレージ)** + +### 📁 ローカルSQLiteストレージ(デフォルト) + +**デフォルトストレージ方式** +- 設定不要、すぐに利用可能 +- データはローカルSQLiteデータベース(`creds/credentials.db`)に保存 +- 単一マシンデプロイおよび個人利用に最適 + +**クレデンシャル構造** + +クレデンシャルは**メールアドレス(email)を一意キー**として構造化データベースカラムで保存されます(JSON blobは不使用): +`email`、`access_token`、`refresh_token`、`client_id`、`client_secret`、`project_id`、`expiry`、`tier` + +インポート/エクスポートは標準化JSON形式: `{"refresh_token": "...", "access_token": "...", "expiry": "...", "email": "...", "tier": "...", "project_id": "..."}`(`refresh_token` のみ必須、有効期限内の `access_token` はそのまま再利用、残りは自動取得)。 + +### 環境変数設定 + +**基本設定** +- `PORT`: サービスポート(デフォルト: 7861) +- `HOST`: サーバーリッスンアドレス(デフォルト: 0.0.0.0) + +**パスワード設定** +- `API_PASSWORD`: チャットAPIアクセスパスワード(デフォルト: pwd) +- `PANEL_PASSWORD`: コントロールパネルアクセスパスワード(デフォルト: pwd) + +**アクセス制御設定** +- `IP_WHITELIST_ENABLED`: IPホワイトリストの有効化(デフォルト: false、制限なし) +- `IP_WHITELIST`: IPホワイトリスト、カンマまたは改行区切り(デフォルト: 空)。各エントリは単一IP(`192.168.1.1`)、CIDR範囲(`192.168.1.0/24`)、開始-終了範囲(`10.0.0.1-10.0.0.100`)に対応、IPv4 / IPv6 両方可。有効化するとホワイトリスト内のIPのみがパネルとAPIにアクセスでき、それ以外は 403。パネル保存後すぐに有効 + +**モデル名リライト設定** +- `MODEL_REWRITE_ENABLED`: モデル名リライトの有効化(デフォルト: false) +- `MODEL_REWRITE_RULES`: リライトルール、各 `[マッチ正規表現, 置換モデル名]`(デフォルト: 空)。上から最初にマッチしたものが有効、置換は正規表現の後方参照(例: `\1`)に対応。例: `gpt-4o` を `gemini-2.5-pro` にマッピング。パネル保存後すぐに有効 + +**パフォーマンスと安定性の設定** +- `RETRY_429_ENABLED`: 429エラー自動リトライの有効化(デフォルト: true) +- `RETRY_429_MAX_RETRIES`: 429エラーの最大リトライ回数(デフォルト: 5) +- `RETRY_429_INTERVAL`: 429エラーのリトライ間隔、秒単位(デフォルト: 1.0) +- `ANTI_TRUNCATION_MAX_ATTEMPTS`: 途切れ防止の最大リトライ回数(デフォルト: 3) + +**ネットワークとプロキシ設定** +- `PROXY`: プロキシアドレス(`http://`、`https://`、`socks5://`、`socks5h://` 対応、`user:pass@host:port` 形式の認証情報付きも可) +- `OAUTH_PROXY_URL`: OAuth認証プロキシエンドポイント +- `GOOGLEAPIS_PROXY_URL`: Google APIsプロキシエンドポイント +- `PATH_PREFIX`: リバースプロキシがパスプレフィックスを保持する場合(例: `/AGY2API`)、バックエンドがルーティング前にプレフィックスを剥がすよう設定。デフォルト: 空(剥がさない) + +**自動化設定** +- `AUTO_BAN`: クレデンシャル自動BANの有効化(デフォルト: false) +- `AUTO_BAN_ERROR_CODES`: 自動BANをトリガーするエラーコード(デフォルト: 403) + +**ログ設定** +- `LOG_LEVEL`: ログレベル(DEBUG/INFO/WARNING/ERROR、デフォルト: INFO) +- `ENABLE_LOG`: 完全サイレント(0で無効化、デフォルト: 1) + +**レスポンス動作設定** +- `RETURN_THOUGHTS_TO_FRONTEND`: 思考チェーンをフロントエンドに返す(デフォルト: true) + +**センシティブワードフィルタリング** +- `SENSITIVE_WORDS_ENABLED`: センシティブワードフィルタリングの有効化(デフォルト: false) +- `SENSITIVE_WORDS`: センシティブワードリスト、カンマまたは改行区切り(デフォルト: 空)。ヒットすると空文字列に置換、大文字小文字を区別しない、中国語対応、パネル保存後すぐに有効 + +**使用ログ** +- `USAGE_LOG_ENABLED`: リクエストログの有効化(デフォルト: true)。すべてのAPIリクエスト(モデル、クレデンシャル、トークン使用量、レイテンシ、ステータス)をデータベースに記録。自動削除なし、パネルから手動クリア可能 + +**リクエストボディデバッグログ** +- `REQUEST_LOG_ENABLED`: リクエストボディ詳細ログの有効化(デフォルト: false)。有効化すると、最終ステータスコードが指定コードに一致した場合、上流へ送信した完全なリクエストヘッダー(マスク済み)とボディを JSON ファイルとして `data/request_logs/` に保存。データベースにはファイル索引のみ記録し、リクエストログ詳細から閲覧可能。主にリクエストボディエラー(例: 400)のデバッグ用。ログのクリア/全削除時にこれらのファイルも削除(Docker では `./data/request_logs:/app/data/request_logs` をマウントして永続化) +- `REQUEST_LOG_ERROR_CODES`: デバッグログを記録するステータスコードリスト、カンマ区切り(デフォルト: 400) + +**クレデンシャル選択モード** +- `CREDENTIAL_SELECT_MODE`: クレデンシャル選択モード(デフォルト: cache) + - `random` — 完全ランダムな負荷分散、各リクエストはランダムにクレデンシャルを選択 + - `cache` — キャッシュマッチング(推奨):「モデル + システム指示(または最初の user メッセージ)」をハッシュ化したセッションキーで、同じセッションは同じクレデンシャルを再利用し、Google 上流の prompt cache にヒット。クールダウン後は自動切替と再バインド + - `sticky` — スティッキー: すべてのリクエストが CD に入るか無効化されるまで同じクレデンシャルに固定 +- `REDIS_URL`: Redis 接続文字列(オプション)。設定するとキャッシュモードのセッションバインドを Redis に保存しマルチインスタンス共有。未設定時はプロセス内メモリバックエンドを使用 + +**ストレージ設定** + +**SQLite(デフォルト)** +- 設定不要、`creds/` にデータベースファイルを自動作成 + +**PostgreSQL(オプションのクラウドストレージ)** +- `POSTGRESQL_URI`: PostgreSQL接続文字列(設定するとPostgreSQLモードが有効) + + +**Docker使用例** +```bash +docker run -d --name agy2api \ + -e API_PASSWORD=my_api_password \ + -e PANEL_PASSWORD=my_panel_password \ + -e PORT=7861 \ + ghcr.io/su-kaka/agy2api:latest +``` + +### API使用方法 + +本サービスは複数の完全なAPIエンドポイントセットに対応しています: + +#### 3. Claude APIフォーマットエンドポイント + +**エンドポイント:** `/v1/messages` +**認証:** `x-api-key: your_api_password` または `Authorization: Bearer your_api_password` + +**リクエスト例:** +```bash +curl -X POST "http://127.0.0.1:7861/v1/messages" \ + -H "x-api-key: your_api_password" \ + -H "anthropic-version: 2023-06-01" \ + -H "Content-Type: application/json" \ + -d '{ + "model": "gemini-2.5-pro", + "max_tokens": 1024, + "messages": [ + {"role": "user", "content": "Hello, Claude!"} + ] + }' +``` + +**systemパラメータの対応:** +```json +{ + "model": "gemini-2.5-pro", + "max_tokens": 1024, + "system": "You are a helpful assistant", + "messages": [ + {"role": "user", "content": "Hello"} + ] +} +``` + +**注意事項:** +- Claude APIフォーマット仕様に完全互換 +- バックエンド呼び出し時にGeminiフォーマットへ自動変換 +- すべてのClaude標準パラメータに対応 +- レスポンスフォーマットはClaude API仕様に準拠 + +#### Antigravity APIエンドポイント + +**OpenAI、Gemini、Claudeの3フォーマットに対応** + +##### Antigravity OpenAIフォーマットエンドポイント + +**エンドポイント:** `/v1/chat/completions` +**認証:** `Authorization: Bearer your_api_password` + +**リクエスト例:** +```bash +curl -X POST "http://127.0.0.1:7861/v1/chat/completions" \ + -H "Authorization: Bearer your_api_password" \ + -H "Content-Type: application/json" \ + -d '{ + "model": "claude-sonnet-4-5", + "messages": [ + {"role": "user", "content": "Hello"} + ], + "stream": true + }' +``` + +##### Antigravity Geminiフォーマットエンドポイント + +**非ストリーミングエンドポイント:** `/v1/models/{model}:generateContent` +**ストリーミングエンドポイント:** `/v1/models/{model}:streamGenerateContent` + +**認証方式(いずれか1つを選択):** +- `Authorization: Bearer your_api_password` +- `x-goog-api-key: your_api_password` +- URLパラメータ: `?key=your_api_password` + +**リクエスト例:** +```bash +# Geminiフォーマット非ストリーミングリクエスト +curl -X POST "http://127.0.0.1:7861/v1/models/claude-sonnet-4-5:generateContent" \ + -H "x-goog-api-key: your_api_password" \ + -H "Content-Type: application/json" \ + -d '{ + "contents": [ + {"role": "user", "parts": [{"text": "Hello"}]} + ], + "generationConfig": { + "temperature": 0.7 + } + }' + +# Geminiフォーマットストリーミングリクエスト +curl -X POST "http://127.0.0.1:7861/v1/models/gemini-2.5-flash:streamGenerateContent?key=your_api_password" \ + -H "Content-Type: application/json" \ + -d '{ + "contents": [ + {"role": "user", "parts": [{"text": "Hello"}]} + ] + }' +``` + +##### Antigravity Claudeフォーマットエンドポイント + +**エンドポイント:** `/v1/messages` +**認証:** `x-api-key: your_api_password` + +**リクエスト例:** +```bash +curl -X POST "http://127.0.0.1:7861/v1/messages" \ + -H "x-api-key: your_api_password" \ + -H "anthropic-version: 2023-06-01" \ + -H "Content-Type: application/json" \ + -d '{ + "model": "claude-sonnet-4-5", + "max_tokens": 1024, + "messages": [ + {"role": "user", "content": "Hello"} + ] + }' +``` + +**対応Antigravityモデル:** +- Claudeシリーズ: `claude-sonnet-4-5`、`claude-opus-4-5` など +- Geminiシリーズ: `gemini-2.5-flash`、`gemini-2.5-pro` など +- Thinkingモデルに自動対応 + +**Geminiネイティブの例:** +```python +from io import BytesIO +from PIL import Image +from google.genai import Client +from google.genai.types import HttpOptions +from google.genai import types +# クライアントは環境変数 `GEMINI_API_KEY` からAPIキーを取得します。 + +client = Client( + api_key="pwd", + http_options=HttpOptions(base_url="http://127.0.0.1:7861"), + ) + +prompt = ( + """ + 猫を描いて + """ +) + +response = client.models.generate_content( + model="gemini-3.1-flash-image", + contents=[prompt], + config=types.GenerateContentConfig( + image_config=types.ImageConfig( + aspect_ratio="16:9", + ) + ) +) +for part in response.candidates[0].content.parts: + if part.text is not None: + print(part.text) + elif part.inline_data is not None: + image = Image.open(BytesIO(part.inline_data.data)) + image.save("generated_image.png") + +``` + +**注意事項:** +- OpenAIエンドポイントはOpenAI互換フォーマットを返します +- GeminiエンドポイントはGeminiネイティブフォーマットを返します +- 両エンドポイントとも同一のAPIパスワードを使用 + +## 📋 完全なAPIリファレンス + +### Webコンソール API + +**認証エンドポイント** +- `POST /auth/login` - ユーザーログイン +- `POST /auth/start` - Antigravity OAuth認証の開始 +- `POST /auth/callback` - OAuthコールバックの処理 +- `POST /auth/callback-url` - コールバックURLから直接認証を完了 +- `GET /auth/status/{project_id}` - 認証ステータスの確認 + +**クレデンシャル管理エンドポイント** +- `POST /creds/upload` - クレデンシャルファイルの一括アップロード(JSONおよびZIP対応) +- `GET /creds/status` - クレデンシャルステータス一覧の取得(ページネーションとフィルタリング対応) +- `GET /creds/detail/{email}` - 単一クレデンシャルの詳細取得 +- `POST /creds/action` - 単一クレデンシャル操作(有効化/無効化/削除) +- `POST /creds/batch-action` - クレデンシャルの一括操作 +- `GET /creds/export/{email}` - 単一クレデンシャルを標準化JSONでエクスポート +- `GET /creds/download-all` - 全クレデンシャルの一括ダウンロード +- `POST /creds/refresh-all-emails` - ユーザーメールの一括更新 +- `POST /creds/deduplicate-by-email` - メールによるクレデンシャルの重複排除 +- `GET /creds/quota/{email}` - クレデンシャルのクォータ情報取得 + +**設定管理エンドポイント** +- `GET /config/get` - 現在の設定の取得 +- `POST /config/save` - 設定の保存 + +**バージョン情報エンドポイント** +- `GET /version/info` - バージョン情報の取得(オプション `check_update=true` パラメータで更新確認) + +### チャットAPI機能 + +**マルチモーダル対応** +```json +{ + "model": "gemini-2.5-pro", + "messages": [ + { + "role": "user", + "content": [ + {"type": "text", "text": "この画像を説明してください"}, + { + "type": "image_url", + "image_url": { + "url": "data:image/jpeg;base64,/9j/4AAQSkZJRgABA..." + } + } + ] + } + ] +} +``` + +**Thinkingモード対応** +```json +{ + "model": "gemini-2.5-pro-high", + "messages": [ + {"role": "user", "content": "複雑な数学の問題"} + ] +} +``` + +レスポンスには分離された思考内容が含まれます: +```json +{ + "choices": [{ + "message": { + "role": "assistant", + "content": "最終回答", + "reasoning_content": "詳細な思考プロセス..." + } + }] +} +``` + +**途切れ防止の使用方法** +```json +{ + "model": "抗截断-gemini-2.5-pro", + "messages": [ + {"role": "user", "content": "長い記事を書いてください"} + ], + "stream": true +} +``` + +--- + +## 🛠️ フロントエンド開発 + +パネルのフロントエンドソースは `frontend/` にあります(React + Vite + Tailwind CSS): + +```bash +cd frontend +npm install +npm run dev # 開発モード、ポート3000、バックエンドAPIをプロキシ +npm run build # dist/ にビルド(本番で使用) +``` + +バックエンドは `dist/` のコンパイル済み静的ファイルを直接配信します。Node.jsランタイムは不要です。 + +## 💬 コミュニティ + +QQグループへの参加をお待ちしています! + +**QQグループ: 1083250744** + +--- + +## ライセンスと免責事項 + +本プロジェクトは学習および研究目的のみに使用できます。本プロジェクトの使用は、以下に同意したことを意味します: +- 本プロジェクトをいかなる商用目的にも使用しないこと +- 本プロジェクトの使用に伴うすべてのリスクと責任を負うこと +- 関連するサービス利用規約および法的規制を遵守すること + +プロジェクトの作者は、本プロジェクトの使用から生じるいかなる直接的または間接的な損害についても責任を負いません。 + +## ⚠️ ライセンスについて + +**本プロジェクトはCooperative Non-Commercial License (CNC-1.0) の下でライセンスされています** + +これは厳格な非商用オープンソースライセンスです。詳細は [LICENSE](../LICENSE) ファイルをご参照ください。 + +### ✅ 許可される用途: +- 個人の学習、研究、教育目的 +- 非営利団体での利用 +- オープンソースプロジェクトへの統合(同一ライセンスの遵守が必要) +- 学術研究および論文発表 + +### ❌ 禁止される用途: +- あらゆる形態の商用利用 +- 年間売上が100万ドルを超える企業での利用 +- ベンチャーキャピタルの出資を受けた企業または上場企業 +- 有料サービスまたは製品の提供 +- 商業的な競合利用 diff --git a/agy2api/frontend/index.html b/agy2api/frontend/index.html new file mode 100644 index 0000000000000000000000000000000000000000..b713c45d3f99f662829197688594d20ac0144468 --- /dev/null +++ b/agy2api/frontend/index.html @@ -0,0 +1,23 @@ + + + + + + + AGY2API - Antigravity 控制面板 + + + +
+ + + diff --git a/agy2api/frontend/package-lock.json b/agy2api/frontend/package-lock.json new file mode 100644 index 0000000000000000000000000000000000000000..145dff9c337a3360a73a3dd4dcf52d76561cd0ed --- /dev/null +++ b/agy2api/frontend/package-lock.json @@ -0,0 +1,2959 @@ +{ + "name": "agy2api-frontend", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "agy2api-frontend", + "version": "1.0.0", + "dependencies": { + "axios": "^1.6.2", + "lucide-react": "^0.294.0", + "react": "^18.2.0", + "react-dom": "^18.2.0" + }, + "devDependencies": { + "@vitejs/plugin-react": "^4.2.1", + "autoprefixer": "^10.4.16", + "postcss": "^8.4.32", + "tailwindcss": "^3.3.6", + "vite": "^5.0.8" + } + }, + "node_modules/@alloc/quick-lru": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@alloc/quick-lru/-/quick-lru-5.3.0.tgz", + "integrity": "sha512-U4+70Pc5ZS9osnCBCE5Jha/ciHM+Yp+CNMNC/7HvYbNRk1Ldd+f7qO65W5qfhu/TCv+/ozljlXXe9Nj8419DMA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz", + "integrity": "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.29.7", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.7.tgz", + "integrity": "sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.7.tgz", + "integrity": "sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.7", + "@babel/generator": "^7.29.7", + "@babel/helper-compilation-targets": "^7.29.7", + "@babel/helper-module-transforms": "^7.29.7", + "@babel/helpers": "^7.29.7", + "@babel/parser": "^7.29.7", + "@babel/template": "^7.29.7", + "@babel/traverse": "^7.29.7", + "@babel/types": "^7.29.7", + "@jridgewell/remapping": "^2.3.5", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/generator": { + "version": "7.29.8", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.8.tgz", + "integrity": "sha512-gZbepsdh3WDtgZKWL+vTPh71LSBrm/Y4/QDZBVCcYfmeTEEuoOYwlSy+G1StfJg+/Zy550u/3TATbm7qDbbMtg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.29.8", + "@babel/types": "^7.29.8", + "@jridgewell/gen-mapping": "^0.3.12", + "@jridgewell/trace-mapping": "^0.3.28", + "jsesc": "^3.0.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.29.7.tgz", + "integrity": "sha512-wem6WaBj4NaVYVdNhLPPVacES6ZJ+KBBfSkTMD3YZxbP3rm3Di85tJU5ljaUNhaOynt+Aj0xruhYuzQBt8n71g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.29.7", + "@babel/helper-validator-option": "^7.29.7", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-globals": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.29.7.tgz", + "integrity": "sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.29.7.tgz", + "integrity": "sha512-ejHwrQQYcm9xnTivShn2IDOlIzInN34AXskvq9QicvCtEzq1Vzclu/tKF8Jq1Cg8JG2GL6/EmjgsCT7lXepE3g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.29.7", + "@babel/types": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.29.7.tgz", + "integrity": "sha512-UPUVSyXbOh627KiCIGQSgwWzGeBKLkaJ9PJEdrngIwMSzxLR4jS4+f1f1jb7VzBbg8nFLaYotvVPFCTqdrmTAg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.29.7", + "@babel/helper-validator-identifier": "^7.29.7", + "@babel/traverse": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.29.7.tgz", + "integrity": "sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.7.tgz", + "integrity": "sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz", + "integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.29.7.tgz", + "integrity": "sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.29.10", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.10.tgz", + "integrity": "sha512-EMCx3AGZ3WfAl6ht7AyQoPm2Lh+BGYEMdc4Q6Hf7uSCDOZFuLq44qNwL+iaim8VlyYhRAo4X43+weadK8ZB4Yg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.29.7", + "@babel/types": "^7.29.8" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.29.9", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.9.tgz", + "integrity": "sha512-CjXrNHTnvqBVqHgdBysY3vk2T8tpJHb5/RMeHJBTyVa9xgugCB0CJTx/3oO8RV2QRQP391RWpB7D6hLjm8V9uA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.29.8" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-self": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.29.7.tgz", + "integrity": "sha512-TL0hMc9xzy86VD31nUiwzd5otRAcyEPcsegCxolO0PvcXuH1v0kECe/UIznYFihpkvU5wg/jk4v0TTEFfm53fw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-source": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.29.7.tgz", + "integrity": "sha512-06IyK09H3wi4cGbhDBwp5gUGo0IKtnYa8tyTiephirPCK6fbobVGiXMMI5zLQ4aKEYP3wZ3ArU44o+8KMrSG/Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/template": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.29.7.tgz", + "integrity": "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.7", + "@babel/parser": "^7.29.7", + "@babel/types": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.29.10", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.10.tgz", + "integrity": "sha512-B3lYAs2nkKskbgQ1nfy8Ma9ao9Q1rntTAQHrzzyDuj+TSO+X3le6PfWwqDvodsb+OumE10eMFfuMCTQSQ5iuIQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.7", + "@babel/generator": "^7.29.8", + "@babel/helper-globals": "^7.29.7", + "@babel/parser": "^7.29.9", + "@babel/template": "^7.29.7", + "@babel/types": "^7.29.8", + "debug": "^4.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.29.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.8.tgz", + "integrity": "sha512-Vj1jF3cPfxg7OAfoI7QnVKLoILlm2JF9pnVHrX8qx7AHMiYWT+NDAA7jChlNgRS4WTLc/fD1lXLmPixluj+3Gg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.29.7", + "@babel/helper-validator-identifier": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz", + "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@napi-rs/lzma-linux-x64-gnu": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/@napi-rs/lzma-linux-x64-gnu/-/lzma-linux-x64-gnu-1.5.1.tgz", + "integrity": "sha512-oTXEIha4SsuXdTA4Iyskj0kpdx2yVXdhd75c2v3xGrHFfVMsbhTPZU/nMPL4sWKo4pBHm3aucLaqGlF696dTyQ==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^22.20 || ^24.12 || >=25" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.0.0-beta.27", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-beta.27.tgz", + "integrity": "sha512-+d0F4MKMCbeVUJwG96uQ4SgAznZNSq93I3V+9NHA4OpvqG8mRCpGdKmK8l/dl02h2CCDHwW2FqilnTyDcAnqjA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.65.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.65.0.tgz", + "integrity": "sha512-t2AnVba25baFdq7gczzS13JyVcdubLVbFX1X04mxrggDrTQPUXNv3XM0k9H1hr5tqvg7AVvtQ720QHAj0iYqhg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.65.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.65.0.tgz", + "integrity": "sha512-dNONUaEwPGhl/nuO2KV8VABWlcjYyU6KtZGN8dQv5OS5JU7JSCxPijVNKXbRJd0iuTzTiJ4TjPt/4bbvDRNiMQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.65.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.65.0.tgz", + "integrity": "sha512-zWQqUH+9zavr2Bxuzfpuv2SIF3X31cr58TvSQC9o1GhpOvkqRwr60GkZdQcudyT/BEgdpdSafjgd2I13MbTL7g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.65.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.65.0.tgz", + "integrity": "sha512-RQYreBFWtO4//hIuOaZkYUnF/lPU4lz35dveDimDshWCJvVisVtJ/shmT9bkXK8wFJY+FJF89X6F3Cq1qI3LCw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.65.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.65.0.tgz", + "integrity": "sha512-A0NfMj6Cuh/9BE5k3awJKv6HoxFVXIcLAb6SZqAMoxUHPA1ZNNK4RsGuUPD/vL7nEAm9LG+ZzXWWTrnC0XtkpA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.65.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.65.0.tgz", + "integrity": "sha512-BI6/H7q3aP0I7S7GOrjyxTjgEJlSnovXE38+bdxBpuKN6z+d//uF+T+VQ3Q7ltJL/71p17ufartARX9Ja5gOGQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.65.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.65.0.tgz", + "integrity": "sha512-W1vUprf09RWaVWnsFP1vlUkEWJzTZlpObOEAYZXt9Fq0UVAOYEkeGr7wBX7McKqqIQskXdBnpiOMgwPujordgA==", + "cpu": [ + "arm" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.65.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.65.0.tgz", + "integrity": "sha512-s8QTcZWgrl9haFzEGIqyE5BWyo89pFDGLMBFZ752WYxk8DJwNU/O1X6pZgPw829d9/sm6CCHyrMP3aurt76p1Q==", + "cpu": [ + "arm" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.65.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.65.0.tgz", + "integrity": "sha512-ke1f6dLRzkqveyjjF2fkEwQYZvxHtNNwjegY8nJrwcO0Bdqr8CzFO/pKE0Bns13cx0qz2Ba2Y0Hs3dSwMdnHxA==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.65.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.65.0.tgz", + "integrity": "sha512-926SMeUcy4y18Rz/w2aJiUKOnyAnm6czg72bXkQEaeemsll+Wr0hnsjb2BGRpHvWgwAMYy5ACJCotbvfLCfj0A==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-gnu": { + "version": "4.65.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.65.0.tgz", + "integrity": "sha512-6T7JNRP1hc4hqF2dUsEoVLOt9K8tmODoCLldtQRYnrddGGQY8Gqe2pM/qMMUo7EMowpP7oa2N95k0/8sYK/ipw==", + "cpu": [ + "loong64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-musl": { + "version": "4.65.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.65.0.tgz", + "integrity": "sha512-SImGFl1Je5kpyAgOCPONVT7h6ASV8mAUwGRjY7eZvVjPg//PfHOXgI+P241RF/+HqsA4PP3qD527ysWFKNQyhQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-gnu": { + "version": "4.65.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.65.0.tgz", + "integrity": "sha512-XeDTbmPF1Yu5asfXGPrMkWoxTDhgryQbmw5Q1+R582O51VNCk23J6f2pDrsAp5YkneBVBwtExx6ZGOb9D2aQ6A==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-musl": { + "version": "4.65.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.65.0.tgz", + "integrity": "sha512-VS55JUI/1nsljmV/jfqNkLZXFw8uMO8nNlfoHmSevNf6fO3neuhyDvx9dv3c/Ytt8r/431SL8Qax1dpYvOMZTg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.65.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.65.0.tgz", + "integrity": "sha512-Vblw84TbX7RS4la1Y4+yQ7aore/oSyaNtFbppuBr5Vs/4LfBeXKq9dIfoExw6zOvRERqd2rRAjnZRaMhH/0x5w==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-musl": { + "version": "4.65.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.65.0.tgz", + "integrity": "sha512-7+gHjtONvKgwR9InTKFaLq53f6YzBJkgeMRBENdWTsQr+spahGqQm8HF5aXpq8i4JaRrOqYyv6Zn1WltDTxaZQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.65.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.65.0.tgz", + "integrity": "sha512-KvNDC0J6s4vVHhtJ6KrDXU0Er0au/hmRIBq/+1maCV8TseGupeKizq0bWcrbp2HE1T8xoknvN0Q/KZ/YF0qX3w==", + "cpu": [ + "s390x" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.65.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.65.0.tgz", + "integrity": "sha512-GExdD15WPvu/x/drELjVam7vX8EsPgvTMOa/iJL/p/4m/oOqzbb7JXZg8fXR4hlXtg/sF2zyTZ3bR0AEtEMlhQ==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.65.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.65.0.tgz", + "integrity": "sha512-8sT9PemIZfIMED4Vd4KGoOXVDj5CMSWNcGdbheRUx9TYS03yOWdT2Q0lXPyEyNBB9YTilwewIQKNIBk6Nxi0Kg==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-openbsd-x64": { + "version": "4.65.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.65.0.tgz", + "integrity": "sha512-pO6Ehi0jo5yE0R6PltKhJhv9mlIiyzBJk5N5NUF2OF6xtVKI+1bdXxj/rb0jGXy3hck1ELVT0QPY3tzkAm360w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ] + }, + "node_modules/@rollup/rollup-openharmony-arm64": { + "version": "4.65.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.65.0.tgz", + "integrity": "sha512-vo7N3/+cjjPDYr8vtxC+qSNgWa9sDvJ7g8N8R5SWqFY4WiNH1ULcAU70SKVyHeiIZOYYwNP9pTipmhN5sl1NPw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.65.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.65.0.tgz", + "integrity": "sha512-ArwvgFAbjKcDM7qqotZ4OVYf+UMT9xH2YzkCzK4+AuZSDihMlz1Ekoe4INwBVXzn2mnJzuIYOcSx07iTBijGRQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.65.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.65.0.tgz", + "integrity": "sha512-QGMmK4/cxKE/36FoLMSHQBCyymv/eFTnsCvvsBF0rgmOvVbvX78VWZRerL3dHa77f4pM6Xcc2iGDhJ10w/svKQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-gnu": { + "version": "4.65.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.65.0.tgz", + "integrity": "sha512-XfKYFWHIPs4HPODIMsGF1IKlS3H1e3WokUZIgpmn4+uNnZBlnRDDHEylNyazbQXwhMKZre68OjtRYbKqb5+j8w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.65.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.65.0.tgz", + "integrity": "sha512-wPWi++K4Bs1VR4XihOhfGi4IGX6Cub7FlerTf8X2v+2BtDHddgSqWCXwGD+h2yAe4/niIhNDwAltioOC+wEogQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@types/babel__core": { + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", + "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "node_modules/@types/babel__generator": { + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.27.0.tgz", + "integrity": "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__template": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", + "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__traverse": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.28.0.tgz", + "integrity": "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.28.2" + } + }, + "node_modules/@types/estree": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz", + "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@vitejs/plugin-react": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-4.7.0.tgz", + "integrity": "sha512-gUu9hwfWvvEDBBmgtAowQCojwZmJ5mcLn3aufeCsitijs3+f2NsrPtlAWIR6OPiqljl96GVCUbLe0HyqIpVaoA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.28.0", + "@babel/plugin-transform-react-jsx-self": "^7.27.1", + "@babel/plugin-transform-react-jsx-source": "^7.27.1", + "@rolldown/pluginutils": "1.0.0-beta.27", + "@types/babel__core": "^7.20.5", + "react-refresh": "^0.17.0" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "peerDependencies": { + "vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0" + } + }, + "node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "license": "MIT", + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", + "dev": true, + "license": "MIT" + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "license": "ISC", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/arg": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz", + "integrity": "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==", + "dev": true, + "license": "MIT" + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "license": "MIT" + }, + "node_modules/autoprefixer": { + "version": "10.6.1", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.6.1.tgz", + "integrity": "sha512-cL1Qz6ADZhcEbny/8HPfe99J6HhNoYtpX2LFLIbhgGE7Q1hlQVkYFdetDN7Id3KiQxhDrHwzlHr/YQCnZ8+xSA==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/autoprefixer" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "browserslist": "^4.28.9", + "caniuse-lite": "^1.0.30001810", + "fraction.js": "^5.3.4", + "picocolors": "^1.1.1", + "postcss-value-parser": "^4.2.0" + }, + "bin": { + "autoprefixer": "bin/autoprefixer" + }, + "engines": { + "node": "^10 || ^12 || >=14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "node_modules/axios": { + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.20.0.tgz", + "integrity": "sha512-r8aOh8j9cGKpgQAqpzrUHnSIc6a59Y3Xf/cv8sy1DrHCkZHzQGEuoq1tARk6qSyDdtQGSDgpb9kFlruzPvrgwg==", + "license": "MIT", + "dependencies": { + "follow-redirects": "^1.16.0", + "form-data": "^4.0.6", + "https-proxy-agent": "^5.0.1", + "proxy-from-env": "^2.1.0" + } + }, + "node_modules/baseline-browser-mapping": { + "version": "2.11.31", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.31.tgz", + "integrity": "sha512-b0k7wXlWjpuL/Uxb/pYlpjY0ej5BjAmurtPUk3eRGuloI4yjK32m8TiKUQ81l1ptcLjKS/KH2+uqIolZti1x4Q==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "baseline-browser-mapping": "dist/cli.cjs" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/binary-extensions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browserslist": { + "version": "4.29.4", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.29.4.tgz", + "integrity": "sha512-2TcbbiwXEq+N0kD36tykpCfyyQigUXmuwNQbnPp4Xk4PX9JOqVIKjJlIDjpH7uY6tmRGoAd+apeT1p60T8wsdA==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "baseline-browser-mapping": "^2.11.29", + "caniuse-lite": "^1.0.30001816", + "electron-to-chromium": "^1.5.459", + "node-releases": "^2.0.59", + "update-browserslist-db": "^1.3.4" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/camelcase-css": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/camelcase-css/-/camelcase-css-2.0.1.tgz", + "integrity": "sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001819", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001819.tgz", + "integrity": "sha512-LFUqIIAwpzsIuevnKnsR9qnStBcgzPShTX61lBwN9uFkkf8o8zLiebEjbW8AYtZiF+1YKDWfdt/pWDtMuG8Xwg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, + "node_modules/chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/chokidar/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/commander": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", + "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true, + "license": "MIT" + }, + "node_modules/cssesc": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", + "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", + "dev": true, + "license": "MIT", + "bin": { + "cssesc": "bin/cssesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/didyoumean": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/didyoumean/-/didyoumean-1.2.2.tgz", + "integrity": "sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/dlv": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/dlv/-/dlv-1.1.3.tgz", + "integrity": "sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==", + "dev": true, + "license": "MIT" + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/electron-to-chromium": { + "version": "1.5.463", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.463.tgz", + "integrity": "sha512-nVWNU6ltFjopvOdD44J4zoBkgO0M+WZiFKKFV7EjebOH9z0KNphk6bCEjplXtJofL21ARIuuwWOCsFkBVklm6w==", + "dev": true, + "license": "ISC" + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz", + "integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/fast-glob": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", + "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.8" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fastq": { + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.20.3.tgz", + "integrity": "sha512-XKv5nnLs6nLF71NgiKJLIZFLkPyIEuOselLG7ujZnGrRfQK8HpvY+WqKhAJUAdLomwVHErVS4LfxFlPq0/FTAw==", + "dev": true, + "license": "ISC", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/follow-redirects": { + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.16.1.tgz", + "integrity": "sha512-FNvFGzoMLWmE6Yj9spb/zjd7yiNCHiAW9/Tg9CXrQ8wuu32HtlJOwWO11OJafl5FfY3DxTdQ0vj42zU1kvv5jg==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "license": "MIT", + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/form-data": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.6.tgz", + "integrity": "sha512-vKatAh4SlVfgbv+YtmhiRjhEMJsYpsG1Y2rMQtR+SVSbytsSD1YGzDIcrAJmdFec88u/+VoGmxnl+80gL1tRCQ==", + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.4", + "mime-types": "^2.1.35" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fraction.js": { + "version": "5.3.4", + "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-5.3.4.tgz", + "integrity": "sha512-1X1NTtiJphryn/uLQz3whtY6jK3fTqoE3ohKs0tT+Ujr1W59oopxmoEh7Lu5p6vBaPbgoM0bzveAW4Qi5RyWDQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "*" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/rawify" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz", + "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "license": "MIT", + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "license": "MIT", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-core-module": { + "version": "2.17.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.17.0.tgz", + "integrity": "sha512-J/vG0zBCbIKOQFfufSwyXdMrsohyJIUNkrnmo6WZGzoM7tr/lsbfW5b2BvisL6zsyMzK9UxV9L6c7AoFbyXHOA==", + "dev": true, + "license": "MIT", + "dependencies": { + "hasown": "^2.0.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/jiti": { + "version": "1.21.7", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.7.tgz", + "integrity": "sha512-/imKNG4EbWNrVjoNC/1H5/9GFy+tqjGBHCaSsN+P2RnPqjsLmv6UD3Ej+Kj8nBWaRAwyk7kK5ZUc+OEatnTR3A==", + "dev": true, + "license": "MIT", + "bin": { + "jiti": "bin/jiti.js" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "license": "MIT" + }, + "node_modules/jsesc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "dev": true, + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "license": "MIT", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/lilconfig": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.4.tgz", + "integrity": "sha512-zJZyBmQhArDRefuWTypZxwDpFDIYmrj8ypSBvwGD5P13Y95s6DjzKgu4DVdGbeQa5PDEsAOCAPNk4X+QOR006w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antonk52" + } + }, + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "dev": true, + "license": "MIT" + }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "license": "MIT", + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, + "node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/lucide-react": { + "version": "0.294.0", + "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.294.0.tgz", + "integrity": "sha512-V7o0/VECSGbLHn3/1O67FUgBwWB+hmzshrgDVRJQhMh8uj5D3HBuIvhuAmQTtlupILSplwIZg5FTc4tTKMA2SA==", + "license": "ISC", + "peerDependencies": { + "react": "^16.5.1 || ^17.0.0 || ^18.0.0" + } + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "dev": true, + "license": "MIT", + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/mz": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", + "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" + } + }, + "node_modules/nanoid": { + "version": "3.3.20", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz", + "integrity": "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/node-releases": { + "version": "2.0.60", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.60.tgz", + "integrity": "sha512-OmO8+GM1JUZqXET720VrJCwkjUCXmCMQm0Z3UDDRbfNLHS4NEAvY60j5jiFv0tkKw2PNNlqOLhahVmwJIOLDIQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-hash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz", + "integrity": "sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true, + "license": "MIT" + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", + "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pirates": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.7.tgz", + "integrity": "sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "node_modules/postcss": { + "version": "8.5.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.31.tgz", + "integrity": "sha512-YUbWYCgErwnMAVkjUnYa+KlMBzGpHwiIt/DE7f0G33AuX2LH9UcTk6KgWxd3zRU+pN3u/C+Xl3EnMLM4Hea7Sg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.20", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/postcss-import": { + "version": "15.1.0", + "resolved": "https://registry.npmjs.org/postcss-import/-/postcss-import-15.1.0.tgz", + "integrity": "sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==", + "dev": true, + "license": "MIT", + "dependencies": { + "postcss-value-parser": "^4.0.0", + "read-cache": "^1.0.0", + "resolve": "^1.1.7" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "postcss": "^8.0.0" + } + }, + "node_modules/postcss-js": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/postcss-js/-/postcss-js-4.1.0.tgz", + "integrity": "sha512-oIAOTqgIo7q2EOwbhb8UalYePMvYoIeRY2YKntdpFQXNosSu3vLrniGgmH9OKs/qAkfoj5oB3le/7mINW1LCfw==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "camelcase-css": "^2.0.1" + }, + "engines": { + "node": "^12 || ^14 || >= 16" + }, + "peerDependencies": { + "postcss": "^8.4.21" + } + }, + "node_modules/postcss-load-config": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-6.0.1.tgz", + "integrity": "sha512-oPtTM4oerL+UXmx+93ytZVN82RrlY/wPUV8IeDxFrzIjXOLF1pN+EmKPLbubvKHT2HC20xXsCAH2Z+CKV6Oz/g==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "lilconfig": "^3.1.1" + }, + "engines": { + "node": ">= 18" + }, + "peerDependencies": { + "jiti": ">=1.21.0", + "postcss": ">=8.0.9", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + }, + "postcss": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/postcss-nested": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/postcss-nested/-/postcss-nested-6.2.0.tgz", + "integrity": "sha512-HQbt28KulC5AJzG+cZtj9kvKB93CFCdLvog1WFLf1D+xmMvPGlBstkpTEZfK5+AN9hfJocyBFCNiqyS48bpgzQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "postcss-selector-parser": "^6.1.1" + }, + "engines": { + "node": ">=12.0" + }, + "peerDependencies": { + "postcss": "^8.2.14" + } + }, + "node_modules/postcss-selector-parser": { + "version": "6.1.5", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.5.tgz", + "integrity": "sha512-TEHFzb5KRDKaOgJ4TYE+0jyJtFbjLvkdVOu0fZ2b6MTWzoqZd4Le+61aEppWkvTlYePgOX4ATL1wsAIPMLTw6Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/postcss-value-parser": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", + "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/proxy-from-env": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-2.1.0.tgz", + "integrity": "sha512-cJ+oHTW1VAEa8cJslgmUZrc+sjRKgAKl3Zyse6+PV38hZe/V6Z14TbCuXcan9F9ghlz4QrFr2c92TNF82UkYHA==", + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/react": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", + "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", + "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0", + "scheduler": "^0.23.2" + }, + "peerDependencies": { + "react": "^18.3.1" + } + }, + "node_modules/react-refresh": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.17.0.tgz", + "integrity": "sha512-z6F7K9bV85EfseRCp2bzrpyQ0Gkw1uLoCel9XBVWPg/TjRj94SkJzUTGfOa4bs7iJvBWtQG0Wq7wnI0syw3EBQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/read-cache": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.2.tgz", + "integrity": "sha512-/peqiBB/n07gQGLsWaHho3WfvUyRscw0gYTsEFMhrIe/nWLkYaf5SbKYjGYqtRV3aPwykJgF2VEMo1ac4bnsGA==", + "dev": true, + "license": "MIT" + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/resolve": { + "version": "1.22.13", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.13.tgz", + "integrity": "sha512-Dj/cW9zBV2aRj6XzCxuGIs3ESZKv02jixne3q6jFZYZ3/Tg09gHHviSMDL4kObh9pqSahdRHEnDoaP2gn8YLhA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "is-core-module": "^2.17.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/reusify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", + "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", + "dev": true, + "license": "MIT", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rollup": { + "version": "4.65.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.65.0.tgz", + "integrity": "sha512-QVCvQUTGDN6JRwi3jVGCY3H4aTHvi9rX0LyoBMkGUvdh/Z6O51CzcLz85BWZaTCDGhl6ySGqYZs+xI1jmPqGcw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "1.0.9" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@napi-rs/lzma-linux-x64-gnu": "1.5.1", + "@rollup/rollup-android-arm-eabi": "4.65.0", + "@rollup/rollup-android-arm64": "4.65.0", + "@rollup/rollup-darwin-arm64": "4.65.0", + "@rollup/rollup-darwin-x64": "4.65.0", + "@rollup/rollup-freebsd-arm64": "4.65.0", + "@rollup/rollup-freebsd-x64": "4.65.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.65.0", + "@rollup/rollup-linux-arm-musleabihf": "4.65.0", + "@rollup/rollup-linux-arm64-gnu": "4.65.0", + "@rollup/rollup-linux-arm64-musl": "4.65.0", + "@rollup/rollup-linux-loong64-gnu": "4.65.0", + "@rollup/rollup-linux-loong64-musl": "4.65.0", + "@rollup/rollup-linux-ppc64-gnu": "4.65.0", + "@rollup/rollup-linux-ppc64-musl": "4.65.0", + "@rollup/rollup-linux-riscv64-gnu": "4.65.0", + "@rollup/rollup-linux-riscv64-musl": "4.65.0", + "@rollup/rollup-linux-s390x-gnu": "4.65.0", + "@rollup/rollup-linux-x64-gnu": "4.65.0", + "@rollup/rollup-linux-x64-musl": "4.65.0", + "@rollup/rollup-openbsd-x64": "4.65.0", + "@rollup/rollup-openharmony-arm64": "4.65.0", + "@rollup/rollup-win32-arm64-msvc": "4.65.0", + "@rollup/rollup-win32-ia32-msvc": "4.65.0", + "@rollup/rollup-win32-x64-gnu": "4.65.0", + "@rollup/rollup-win32-x64-msvc": "4.65.0", + "fsevents": "~2.3.2" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/scheduler": { + "version": "0.23.2", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz", + "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0" + } + }, + "node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/source-map-js": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.2.tgz", + "integrity": "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sucrase": { + "version": "3.35.1", + "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.35.1.tgz", + "integrity": "sha512-DhuTmvZWux4H1UOnWMB3sk0sbaCVOoQZjv8u1rDoTV0HTdGem9hkAZtl4JZy8P2z4Bg0nT+YMeOFyVr4zcG5Tw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.2", + "commander": "^4.0.0", + "lines-and-columns": "^1.1.6", + "mz": "^2.7.0", + "pirates": "^4.0.1", + "tinyglobby": "^0.2.11", + "ts-interface-checker": "^0.1.9" + }, + "bin": { + "sucrase": "bin/sucrase", + "sucrase-node": "bin/sucrase-node" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/tailwindcss": { + "version": "3.4.19", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.19.tgz", + "integrity": "sha512-3ofp+LL8E+pK/JuPLPggVAIaEuhvIz4qNcf3nA1Xn2o/7fb7s/TYpHhwGDv1ZU3PkBluUVaF8PyCHcm48cKLWQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@alloc/quick-lru": "^5.2.0", + "arg": "^5.0.2", + "chokidar": "^3.6.0", + "didyoumean": "^1.2.2", + "dlv": "^1.1.3", + "fast-glob": "^3.3.2", + "glob-parent": "^6.0.2", + "is-glob": "^4.0.3", + "jiti": "^1.21.7", + "lilconfig": "^3.1.3", + "micromatch": "^4.0.8", + "normalize-path": "^3.0.0", + "object-hash": "^3.0.0", + "picocolors": "^1.1.1", + "postcss": "^8.4.47", + "postcss-import": "^15.1.0", + "postcss-js": "^4.0.1", + "postcss-load-config": "^4.0.2 || ^5.0 || ^6.0", + "postcss-nested": "^6.2.0", + "postcss-selector-parser": "^6.1.2", + "resolve": "^1.22.8", + "sucrase": "^3.35.0" + }, + "bin": { + "tailwind": "lib/cli.js", + "tailwindcss": "lib/cli.js" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/thenify": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", + "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "any-promise": "^1.0.0" + } + }, + "node_modules/thenify-all": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", + "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", + "dev": true, + "license": "MIT", + "dependencies": { + "thenify": ">= 3.1.0 < 4" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/tinyglobby": { + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", + "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.4" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tinyglobby/node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/tinyglobby/node_modules/picomatch": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz", + "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/ts-interface-checker": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz", + "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/update-browserslist-db": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.4.tgz", + "integrity": "sha512-t8wonIOdQyOjtPd2VktlBu6QjTVTks6v8bSi7kd0r2Vll8TK1JYDZtRRdbmCHOAMphkZgrzK+L+vXK4pyZ8t4A==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true, + "license": "MIT" + }, + "node_modules/vite": { + "version": "5.4.21", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.21.tgz", + "integrity": "sha512-o5a9xKjbtuhY6Bi5S3+HvbRERmouabWbyUcpXXUA1u+GNUKoROi9byOJ8M0nHbHYHkYICiMlqxkg1KkYmm25Sw==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "^0.21.3", + "postcss": "^8.4.43", + "rollup": "^4.20.0" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^18.0.0 || >=20.0.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "sass-embedded": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.4.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + } + } + }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true, + "license": "ISC" + } + } +} diff --git a/agy2api/frontend/package.json b/agy2api/frontend/package.json new file mode 100644 index 0000000000000000000000000000000000000000..91e0069bc75748aff346609873bc6b57dc0c23a0 --- /dev/null +++ b/agy2api/frontend/package.json @@ -0,0 +1,24 @@ +{ + "name": "agy2api-frontend", + "private": true, + "version": "1.0.0", + "type": "module", + "scripts": { + "dev": "vite", + "build": "vite build", + "preview": "vite preview" + }, + "dependencies": { + "axios": "^1.6.2", + "lucide-react": "^0.294.0", + "react": "^18.2.0", + "react-dom": "^18.2.0" + }, + "devDependencies": { + "@vitejs/plugin-react": "^4.2.1", + "autoprefixer": "^10.4.16", + "postcss": "^8.4.32", + "tailwindcss": "^3.3.6", + "vite": "^5.0.8" + } +} diff --git a/agy2api/frontend/postcss.config.js b/agy2api/frontend/postcss.config.js new file mode 100644 index 0000000000000000000000000000000000000000..2aa7205d4b402a1bdfbe07110c61df920b370066 --- /dev/null +++ b/agy2api/frontend/postcss.config.js @@ -0,0 +1,6 @@ +export default { + plugins: { + tailwindcss: {}, + autoprefixer: {}, + }, +}; diff --git a/agy2api/frontend/public/favicon-32.png b/agy2api/frontend/public/favicon-32.png new file mode 100644 index 0000000000000000000000000000000000000000..9c0da8717472d23c25ee61c71e89e0b443d53250 Binary files /dev/null and b/agy2api/frontend/public/favicon-32.png differ diff --git a/agy2api/frontend/public/favicon.ico b/agy2api/frontend/public/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..04a93ee5433296d278c27999e762ffc1733a2ee0 Binary files /dev/null and b/agy2api/frontend/public/favicon.ico differ diff --git a/agy2api/frontend/src/App.jsx b/agy2api/frontend/src/App.jsx new file mode 100644 index 0000000000000000000000000000000000000000..bd29d1824c2dba5d854cfe5e7bceee4fa58c782c --- /dev/null +++ b/agy2api/frontend/src/App.jsx @@ -0,0 +1,116 @@ +import { + LogOut, + Rocket, + Settings, + KeyRound, + Upload, + Info, + BarChart3, +} from "lucide-react"; +import { useEffect, useState } from "react"; +import api from "./api"; +import Login from "./pages/Login"; +import OAuth from "./pages/OAuth"; +import Credentials from "./pages/Credentials"; +import UploadPage from "./pages/Upload"; +import Config from "./pages/Config"; +import About from "./pages/About"; +import UsageLogs from "./pages/UsageLogs"; + +export default function App() { + const [loggedIn, setLoggedIn] = useState(() => !!localStorage.getItem("panelToken")); + const [activeTab, setActiveTab] = useState("oauth"); + const [version, setVersion] = useState(null); + const [checkingUpdate, setCheckingUpdate] = useState(false); + + const checkUpdate = () => { + setCheckingUpdate(true); + api + .get("/version/info", { params: { check_update: "true" } }) + .then((res) => setVersion(res.data)) + .catch(() => {}) + .finally(() => setCheckingUpdate(false)); + }; + + useEffect(() => { + api + .get("/version/info") + .then((res) => setVersion(res.data)) + .catch(() => {}); + }, []); + + const logout = () => { + localStorage.removeItem("panelToken"); + setLoggedIn(false); + }; + + if (!loggedIn) { + return setLoggedIn(true)} />; + } + + const tabs = [ + { id: "oauth", label: "OAuth 认证", icon: Rocket }, + { id: "credentials", label: "凭证管理", icon: KeyRound }, + { id: "upload", label: "批量导入", icon: Upload }, + { id: "usage-logs", label: "请求日志", icon: BarChart3 }, + { id: "config", label: "配置管理", icon: Settings }, + { id: "about", label: "项目信息", icon: Info }, + ]; + + return ( +
+ {/* 导航栏 */} + + +
+ {activeTab === "oauth" && } + {activeTab === "credentials" && } + {activeTab === "upload" && } + {activeTab === "usage-logs" && } + {activeTab === "config" && } + {activeTab === "about" && } +
+
+ ); +} diff --git a/agy2api/frontend/src/api.js b/agy2api/frontend/src/api.js new file mode 100644 index 0000000000000000000000000000000000000000..4f11bbce45ce8a78647f1cf036dd9daa9e1be343 --- /dev/null +++ b/agy2api/frontend/src/api.js @@ -0,0 +1,31 @@ +import axios from "axios"; +import { getBasePath } from "./basePath.js"; + +const api = axios.create({ + // 基径取面板页面所在路径(末尾补斜杠),反代到子路径下时请求仍落在同一子路径内 + baseURL: getBasePath(), + timeout: 120000, +}); + +// 请求拦截器 - 添加token +api.interceptors.request.use((config) => { + const token = localStorage.getItem("panelToken"); + if (token) { + config.headers.Authorization = `Bearer ${token}`; + } + return config; +}); + +// 响应拦截器 - 处理错误 +api.interceptors.response.use( + (response) => response, + (error) => { + if (error.response?.status === 401) { + localStorage.removeItem("panelToken"); + window.location.href = getBasePath(); + } + return Promise.reject(error); + } +); + +export default api; diff --git a/agy2api/frontend/src/basePath.js b/agy2api/frontend/src/basePath.js new file mode 100644 index 0000000000000000000000000000000000000000..6811a29d976dc7cb834d661e87c6a892aa8bb77f --- /dev/null +++ b/agy2api/frontend/src/basePath.js @@ -0,0 +1,8 @@ +// 计算控制面板的基径(以 "/" 开头并以 "/" 结尾) +// 面板是单入口应用,文档地址即挂载点:根路径部署为 "/",反代子路径部署为 +// "/AGY2API/" 等形式。部分反代不补齐末尾斜杠,访问地址可能为 "/AGY2API", +// 此处统一补齐,保证 API 请求与页面跳转落在同一子路径下 +export function getBasePath() { + const { pathname } = window.location; + return pathname.endsWith("/") ? pathname : pathname + "/"; +} diff --git a/agy2api/frontend/src/components/Modal.jsx b/agy2api/frontend/src/components/Modal.jsx new file mode 100644 index 0000000000000000000000000000000000000000..f9696a927f920b384e163ef95b682b3f09d99b99 --- /dev/null +++ b/agy2api/frontend/src/components/Modal.jsx @@ -0,0 +1,49 @@ +import { useEffect } from "react"; +import { AlertCircle, CheckCircle, Info, X } from "lucide-react"; + +/** + * 通用消息弹窗 + * type: success / error / info + */ +export default function Modal({ type = "info", title, children, onClose }) { + useEffect(() => { + const onKey = (e) => { + if (e.key === "Escape") onClose?.(); + }; + document.addEventListener("keydown", onKey); + return () => document.removeEventListener("keydown", onKey); + }, [onClose]); + + const styles = { + success: { icon: , border: "border-green-500/40", iconBg: "bg-green-500/15" }, + error: { icon: , border: "border-red-500/40", iconBg: "bg-red-500/15" }, + info: { icon: , border: "border-blue-500/40", iconBg: "bg-blue-500/15" }, + }[type] || {}; + + return ( +
+
e.stopPropagation()} + > +
+
+ {styles.icon} +

{title}

+
+ +
+
+ {children} +
+
+ +
+
+
+ ); +} diff --git a/agy2api/frontend/src/components/Select.jsx b/agy2api/frontend/src/components/Select.jsx new file mode 100644 index 0000000000000000000000000000000000000000..4fb834e2c76011c0c8b0468e8f3551613850b72c --- /dev/null +++ b/agy2api/frontend/src/components/Select.jsx @@ -0,0 +1,100 @@ +import { Check, ChevronDown } from "lucide-react"; +import { useEffect, useRef, useState } from "react"; + +/** + * 自定义下拉选择器:选项面板由自身渲染(非原生 select 弹窗), + * 面板与触发器左右边缘完全对齐;空间不足时自动向上弹出。 + */ +export default function Select({ value, onChange, options, className = "", disabled = false }) { + const [open, setOpen] = useState(false); + const [placement, setPlacement] = useState({ dropUp: false, maxHeight: 240 }); + const rootRef = useRef(null); + + useEffect(() => { + if (!open) return; + const onPointerDown = (e) => { + if (rootRef.current && !rootRef.current.contains(e.target)) setOpen(false); + }; + const onKey = (e) => { + if (e.key === "Escape") setOpen(false); + }; + document.addEventListener("mousedown", onPointerDown); + document.addEventListener("touchstart", onPointerDown); + document.addEventListener("keydown", onKey); + return () => { + document.removeEventListener("mousedown", onPointerDown); + document.removeEventListener("touchstart", onPointerDown); + document.removeEventListener("keydown", onKey); + }; + }, [open]); + + const toggle = () => { + if (disabled) return; + if (!open && rootRef.current) { + const rect = rootRef.current.getBoundingClientRect(); + const spaceBelow = window.innerHeight - rect.bottom; + const spaceAbove = rect.top; + // 面板高度按选项数量估算(每项约 40px,含内边距),上限 240px + const desired = Math.min(options.length * 40 + 10, 240); + if (spaceBelow >= desired || spaceBelow >= spaceAbove) { + setPlacement({ dropUp: false, maxHeight: Math.min(spaceBelow - 8, desired) }); + } else { + setPlacement({ dropUp: true, maxHeight: Math.min(spaceAbove - 8, desired) }); + } + } + setOpen((v) => !v); + }; + + const current = options.find((o) => o.value === value); + + return ( +
+ + {open && ( +
+ {options.map((o) => ( + + ))} +
+ )} +
+ ); +} diff --git a/agy2api/frontend/src/index.css b/agy2api/frontend/src/index.css new file mode 100644 index 0000000000000000000000000000000000000000..7cccd6e2705fd91917b7357b486de0491db7a8e5 --- /dev/null +++ b/agy2api/frontend/src/index.css @@ -0,0 +1,77 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; + +body { + @apply bg-dark-950 text-gray-100; + font-family: + -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; +} + +/* 自定义滚动条 */ +::-webkit-scrollbar { + width: 8px; + height: 8px; +} + +::-webkit-scrollbar-track { + @apply bg-dark-900; +} + +::-webkit-scrollbar-thumb { + @apply bg-dark-600 rounded-full; +} + +::-webkit-scrollbar-thumb:hover { + @apply bg-dark-500; +} + +/* 输入框聚焦样式 */ +input:focus, +textarea:focus, +select:focus { + @apply outline-none ring-2 ring-purple-500/50; +} + +/* 按钮基础样式 */ +.btn { + @apply px-4 py-2 rounded-lg font-medium transition-all duration-200; +} + +.btn-primary { + @apply bg-purple-600 hover:bg-purple-700 text-white; +} + +.btn-secondary { + @apply bg-dark-700 hover:bg-dark-600 text-gray-200; +} + +.btn-danger { + @apply bg-red-600 hover:bg-red-700 text-white; +} + +/* 卡片样式 */ +.card { + @apply bg-dark-900 border border-dark-700 rounded-xl p-6; +} + +/* 表格样式 */ +.table-container { + @apply overflow-x-auto rounded-lg border border-dark-700; +} + +table { + @apply w-full; +} + +th { + @apply bg-dark-800 px-4 py-3 text-left text-sm font-medium text-gray-400; +} + +td { + @apply px-4 py-3 text-sm border-t border-dark-700; +} + +tr:hover td { + @apply bg-dark-800/50; +} diff --git a/agy2api/frontend/src/main.jsx b/agy2api/frontend/src/main.jsx new file mode 100644 index 0000000000000000000000000000000000000000..7f2a04542081ea2be91fce8c8d93cd8c9fa8385d --- /dev/null +++ b/agy2api/frontend/src/main.jsx @@ -0,0 +1,10 @@ +import React from "react"; +import ReactDOM from "react-dom/client"; +import App from "./App"; +import "./index.css"; + +ReactDOM.createRoot(document.getElementById("root")).render( + + + , +); diff --git a/agy2api/frontend/src/pages/About.jsx b/agy2api/frontend/src/pages/About.jsx new file mode 100644 index 0000000000000000000000000000000000000000..6198d4abc27d707150352170c86597d4eadb2333 --- /dev/null +++ b/agy2api/frontend/src/pages/About.jsx @@ -0,0 +1,177 @@ +import { ExternalLink, Github, Info, RefreshCw, Rocket, Zap } from "lucide-react"; +import { getBasePath } from "../basePath.js"; + +export default function About({ version, onCheckUpdate, checkingUpdate }) { + const apiBase = `${window.location.origin}${getBasePath()}`; + const apiEndpoints = [ + { label: "OpenAI 格式", value: `${apiBase}v1/chat/completions` }, + { label: "Gemini 格式", value: `${apiBase}v1beta/models` }, + { label: "Claude 格式", value: `${apiBase}v1/messages` }, + ]; + + const copyText = (text) => { + navigator.clipboard.writeText(text); + }; + + return ( +
+ {/* API 端点 */} +
+

+ + API 端点(点击复制) +

+
+ {apiEndpoints.map((ep) => ( +
+ {ep.label} + copyText(ep.value)} + > + {ep.value} + +
+ ))} +
+
+ + {/* 项目简介 */} +
+
+
+ +
+
+

AGY2API

+

+ {version?.version ? `版本: ${version.version}` : "Antigravity API 代理服务"} +

+
+
+

+ 将 Google Antigravity API 转换为 OpenAI、Gemini 和 Anthropic + 兼容格式的代理工具。支持多账户管理(邮箱去重)、自动轮换、模型级冷却、凭证导入导出等功能。 +

+
+ + + GitHub 仓库 + + + + {version?.check_update && version?.has_update && ( + + + 有新版本可用: {version.latest_version} + + )} + {version?.check_update && version?.has_update === false && ( + + + 已是最新版本 + + )} +
+
+ + {/* 主要功能 */} +
+

✨ 主要功能

+
+
+
+ ⚡{" "} + 多格式兼容:OpenAI / Gemini / Anthropic 三种 API 格式 +
+
+ 🔄{" "} + 自动轮换:随机负载均衡,自动跳过冷却和禁用的凭证 +
+
+ 🛡️{" "} + 自动封禁:遇到指定错误码自动禁用异常凭证 +
+
+ ❄️{" "} + 模型级冷却:429 错误自动设置模型级 CD +
+
+
+
+ ✂️{" "} + 抗截断:"抗截断-" 前缀模型自动续传截断的响应 +
+
+ 📊{" "} + 实时监控:凭证状态、错误码、额度查询 +
+
+ 📱{" "} + 响应式界面:桌面/移动端自适应 +
+
+
+
+ + {/* 交流群 */} +
+

💬 交流群

+

欢迎加入 QQ 群交流讨论!

+
+ QQ 群二维码 +
+

QQ 群号:1083250744

+
+ + {/* 使用声明 */} +
+
⚠️ 使用声明
+

+ 本项目仅供学习研究使用,禁止商业用途和倒卖。 +

+
+ + {/* 版本信息 */} + {version && ( +
+

版本信息

+
+
+ 当前版本: {version.version || "-"} +
+
+ 构建哈希: {version.full_hash || "-"} +
+
+ 更新说明: {version.message || "-"} +
+
+ 构建日期: {version.date || "-"} +
+
+
+ )} +
+ ); +} diff --git a/agy2api/frontend/src/pages/Config.jsx b/agy2api/frontend/src/pages/Config.jsx new file mode 100644 index 0000000000000000000000000000000000000000..0e77610d80bf95d35c9edae21a39cb7a70f11741 --- /dev/null +++ b/agy2api/frontend/src/pages/Config.jsx @@ -0,0 +1,512 @@ +import { Loader2, Plus, RefreshCw, Save, Trash2 } from "lucide-react"; +import { useEffect, useRef, useState } from "react"; +import Modal from "../components/Modal"; +import Select from "../components/Select"; +import api from "../api"; + +// 错误码输入:编辑期间保留原始文本,仅在按键时把已解析的数组回写配置(保证保存时取到最新值), +// 失焦时再归一化显示。原实现在每次按键即时解析并回写数组,导致分隔符与未成形的中间输入被即时 +// 过滤/截断,无法输入多个错误码,也无法输入小于 100 的中间数字。 +function CsvNumbersField({ value, onChange, placeholder }) { + const toText = (v) => (Array.isArray(v) ? v.join(", ") : (v ?? "")); + const [text, setText] = useState(() => toText(value)); + const focusedRef = useRef(false); + + // 仅在非编辑态(失焦)时同步外部配置变化,避免编辑过程中被即时覆盖 + useEffect(() => { + if (!focusedRef.current) setText(toText(value)); + }, [value]); + + const commitText = (raw) => { + const nums = raw + .split(/[,\s]+/) + .map((x) => parseInt(x, 10)) + .filter((n) => Number.isInteger(n) && n >= 100 && n <= 599); + onChange([...new Set(nums)].sort((a, b) => a - b)); + }; + + return ( + { + focusedRef.current = true; + }} + onChange={(e) => { + const raw = e.target.value; + setText(raw); + commitText(raw); + }} + onBlur={() => { + focusedRef.current = false; + commitText(text); + }} + placeholder={placeholder} + className="w-full sm:w-64 px-3 py-2 bg-dark-800 border border-dark-600 rounded-lg text-sm text-white placeholder-gray-500 font-mono" + /> + ); +} + +// 多行文本(敏感词 / IP 白名单等,每行一条):编辑期间保留原始文本(允许末尾空行与连续回车), +// 仅在按键时把清洗后的数组回写配置(保证保存时取到最新值),失焦时再归一化显示。 +// 原实现在每次按键即时 split + 过滤空行,末尾按回车产生的新空行被立即移除, +// 导致"最后一行按回车没反应"、无法换行新增词条。 +function LinesField({ value, onChange, placeholder }) { + const toText = (v) => (Array.isArray(v) ? v.join("\n") : v ?? ""); + const [text, setText] = useState(() => toText(value)); + const focusedRef = useRef(false); + + // 仅在非编辑态(失焦)时同步外部配置变化,避免编辑过程中被即时覆盖 + useEffect(() => { + if (!focusedRef.current) setText(toText(value)); + }, [value]); + + const commitText = (raw) => { + const lines = raw + .split(/\r?\n/) + .map((w) => w.replace(/\s+$/, "")) + .filter((w) => w.trim() !== ""); + onChange(lines); + }; + + return ( +