diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..359bb53 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# 默认忽略的文件 +/shelf/ +/workspace.xml diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..c6a19c0 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,12 @@ + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/it-architecture.iml b/.idea/it-architecture.iml new file mode 100644 index 0000000..d0876a7 --- /dev/null +++ b/.idea/it-architecture.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..eda7594 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..204ce90 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/README.md b/README.md index 0ab0b9b..578266b 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,185 @@ -# it-architecture +# 公司 IT 系统全景与数据流向平台 +把原来那份单文件 `index.html`(公司 IT 系统全景图)升级成一个真正可运行的系统: +Python 后端 + SQLite 持久化 + 可配置前端,多人访问同一份数据,不再依赖浏览器 localStorage。 + +## 与原版页面的对应关系 + +| 原版页面 | 现在的去向 | +| --- | --- | +| ① 系统全景总览 | 保留为「系统全景总览」,字段编辑改为写库,所有人共享;新增「快捷入口」直达各系统 | +| ② 系统关系与业务链路 | **按要求删除**,其信息已并入数据流向图 | +| ③ 目标架构与迁移规划 | 改为**数据流向图**:带流动动画,且可直接拖拽摆放、拉线建流 | +| 系统交换明细 | **按要求移除**,该位置改为「Agent 布局总览图」占位页 | +| localStorage + 导出离线 HTML | 改为 SQLite + 配置备份 JSON 导入/导出 | +| 乐观锁单文档同步 | 改为按行 CRUD,附变更审计(谁在什么时候改了什么) | + +## 目录结构 + +``` +backend/ FastAPI + 标准库 sqlite3(无 ORM) + app/db.py 连接、建表、显式事务 + app/seed.py 内置清单:3 层级 / 18 系统 / 6 数据类型 / 36 条数据流 + app/services/ 指标生成(metrics)与图布局(graph) + app/routers/ content(层级/系统/类型/配置)、flows、graph、backup + tests/ 63 条 pytest +frontend/ Vue 3 + Vite + TS + Tailwind + Pinia(组件风格取自 sub2api) + src/components/ common / icons / layout / panorama / flow + src/views/ 全景、数据流向图、Agent 布局总览图(占位)、配置、审计 +``` + +## 启动 + +```bash +./start.sh # 生产式:单进程提供 API + 页面,http://localhost:8787 +./dev.sh # 开发式:后端 8787 热重载 + 前端 5273 HMR +python3 -m pytest -q # 后端测试(在 backend/ 目录下) +npm run typecheck # 前端类型检查(在 frontend/ 目录下) +``` + +数据库默认 `backend/panorama.db`,用 `DB_PATH=/path/to.db` 可改位置。直接复制该文件即整库备份。 + +## 数据模型 + +- `layers` 层级(通用 / 部门业务 / 底座),决定全景图分区 +- `systems` 系统清单:状态、技术栈、地址、域名、负责人、说明、`impl_time`(实现时间)、 + `entry_enabled`(是否展示快捷入口),`tier` 决定数据流向图所在列 +- `flow_types` 数据类型:决定连线颜色与线型,取值遵循下面「一眼看出主流向」一节的统一图例 +- `data_flows` 数据流:起止系统、传输内容、方向、**触发间隔 / 单次条数 / 单批体积 / 时延 / 同步异步 / 高峰时段** +- `flow_metrics` 按小时聚合的 batches、records、bytes、errors、latency +- `settings` 平台配置(含 `editing_enabled` 全站编辑开关、`flow_route_style` 连线线型),`audit_logs` 变更审计 + +## 系统跳转入口与实现时间 + +「系统配置 · 系统跳转入口」是一行一个系统的编辑表:跳转地址、是否展示快捷入口、实现时间。 +保存后「系统全景总览」顶部出现「快捷入口」一排按钮,点中系统卡片时右侧也会出现「访问系统」。 +地址留空则退回用域名打开,两者都没填时这一排会给出填写指引而不是整排消失。 +地址不带协议前缀(如 `oa.example.com`)时自动补 `http://`,否则浏览器会当成本站相对路径跳错页面。 + +「实现时间」是自由文本(`2024-06 上线`、`2023 Q4 立项 / 2024-08 验收` 都行), +在系统详情栏和跳转入口表两处都能填,同一个字段。 + +## 系统名称随时可改 + +名称是普通字段,不是建档后就锁死的表头:全景总览选中系统后,右侧详情栏第一个输入框就是「系统名称」; +「系统配置 · 系统跳转入口」那一行的系统名也能直接改,回车或失焦即保存。 +改名只动展示名,`key` 作为主键不变,数据流的起止点、画布上的摆放位置都不受影响; +全景图、数据流向图、快捷入口、汇报清单读的都是改名后的名字。 +空白名称前端不提交、后端返 `422`,超长名称截到 80 字,改动照旧进变更审计。 + +## 汇报模式与图片导出 + +数据流向图工具条上的「汇报模式」把画布换成整屏演示视图(`components/flow/FlowPresentation.vue`): + +- 图占满整屏,卡片、连线、层级列头按可用空间放大,不再有统计卡与工具条抢位置 +- 「线型」三选一(折线 / 曲线 / 直线,默认折线),当场切给听众看,选中的存进 `flow_route_style` +- 「突出主流向」默认打开:自右向左的回流链路压到很淡,先看清 ①→②→③→④ 这条主干 +- 「流向」分步按钮 ①→② / ②→③ / ③→④ / 跨列,一次只讲一跳,其余链路退到底色, + 右侧清单同步只列这一跳的链路,讲完点「全部」回到整图 +- 关系名称默认不显示(挑中一跳、悬停或选中卡片时才出现),要逐条念就勾「显示全部关系名称」 +- 右侧「汇报清单」两个标签页:「业务链路」按数据类型分组编号,从上往下念就是一条条业务线, + 点一条即在画布上聚焦;「系统清单」按层级列分组,附每个系统的入向 / 出向链路数与尚未接入的系统 +- 顶部图例可点(只看某一类链路),可关流动动画、切速度;`Esc` 或「退出」回到编辑视图 +- 「导出图片」出 2× PNG(可直接贴 PPT),「SVG」出矢量图:导出的就是屏幕上这套几何, + 含标题、统计、图例、层级列与生成时间,走线与线型跟着屏幕上选的来(`components/flow/flowExport.ts`) + +## 一眼看出主流向 + +四十条链路挤在一张图上,靠的是四件事(都在 `components/flow/flowLayout.ts`): + +- **三种线型**:`折线`(默认,直角走线,线段走列与列之间的走廊,交叉最少)、`曲线`(弧线,画面柔和)、 + `直线`(两点直线,最短最直接,链路多时交叉会变多)。走线偏好存 `settings.flow_route_style` +- **走廊走线**:每条链路只走它终点前面那条走廊,同走廊的链路按高度排槽位,走廊内部不再互相交叉; + 同列互传的链路走列旁的水沟,不从中间卡片上压过去 +- **边绑定**:汇入同一个系统的同类链路(例如十来个系统都去 UniHub 做 SSO 票据校验)共用走廊里同一条 + 干线,到卡片前才散成各自的接入点,画面上先看到一股粗绳、再看到十几条支线;折线共用干线, + 曲线在干线上的同一点汇聚,直线保持一对一。干线只在两条以上链路真正重叠的那一段画出来 +- **列内重心排序**:卡片按与它通信的卡片的平均高度来回微调(左右各扫三轮),互相调用的系统自然对上, + 大部分链路变成短横跳而不是斜穿四列;排序种子与并列规则固定,每次打开都是同一张图 + +主次靠墨量分:线条宽 1~3.4px、不透明度 32%~92% 都由同步节奏换算,分钟级高频链路粗而实, +夜间批量细而淡;汇报模式的「突出主流向」再把回流链路压到 18%。 + +颜色与线型是一套统一图例(`components/flow/flowStyle.ts`,种子数据与配置页都按它取值): + +| 编码 | 含义 | 线型 | +| --- | --- | --- | +| 蓝 | API / 同步调用(核心业务链路、底座能力调用) | 实线 | +| 紫 | 鉴权 / MCP 取数(统一认证、智能体取数) | 实线 / 点划线(定时) | +| 绿 | 异步消息 / 事件推送 | 虚线 | +| 灰 | 定时任务 / 归档沉淀 | 点划线 | +| 红 | 人工操作 / 线下流程 | 点划线 | + +线型本身即节奏:实线同步调用、虚线异步消息、点划线定时任务或人工、点线低频参考链路。 +图例在编辑视图、汇报模式和导出的 SVG 里都由同一个组件画(`components/flow/FlowLegend.vue`), +颜色前面带真实线型的小样,不会出现图例和画面对不上。 + +卡片也按层级上色:入口青、中枢绿、业务蓝、底座橙,列带只包到自己卡片的高度, +两系统的入口层不再拖出一条空白长条;入向 / 出向数量挪到卡片右上角的小角标,卡面只剩系统名和归属。 + +## 只读模式 + +「系统配置 · 平台配置」里的「允许编辑」是全站开关。关掉后: + +- 各页面隐藏新增 / 编辑 / 删除入口,表单只读,顶部出现「只读模式」标记 +- 后端所有写接口返回 `423`,被拒绝的请求不会写入任何数据,也不会留下审计记录 +- 数据流向图的拖拽摆放、拉线建流、恢复自动排列同样被锁住(画布仍可查看与播放动画) +- 读取与指标接口不受影响;`PATCH /api/settings` 始终开放,否则就无法解锁 + +## 数据流动情况是怎么定出来的 + +初始 36 条链路按业务语义分为 6 类,节奏取自真实系统常见形态,可在界面上随时改: + +| 类型 | 典型链路 | 节奏设定 | +| --- | --- | --- | +| 核心业务链路 | PMS 预算闸门 ⇄ OA、OA 合同→OMS、SCC 归档转订单、报销→财务助理→金蝶 | 10~60 分钟批量,同步为主 | +| 移动端入口 / 消息 | OA→企微 待办与收款群通知、企微→财务助理 PDF 报销、企微→EDRS 填报提醒 | 5 分钟级高频小包 | +| MCP 取数(Agent) | unibot ⇄ PMS / OMS / SCC / EDRS、unibot ⇄ UniTensor 算力 | 小时级取数,单次数据量大 | +| 底座能力调用 | 财务助理→k3s OCR/对象存储、docs→UniTensor 推理、DMS→镜像仓库 | 分钟级,单批体积跨度大 | +| 统一认证 SSO | 各业务系统→UniHub 票据校验 | 高频极小包(约 4 KB) | +| 归档 / 知识沉淀 | OA→NAS 盖章合同原件、docs→ekb 知识沉淀、unibot→ekb 检索 | 低频大文件 | + +历史流量不是写死的常量:`services/metrics.py` 用每条链路的节奏乘以一条工作时段曲线(含午休回落、夜间低谷、周末系数)生成 30 天逐小时记录,并按固定随机种子加抖动,因此重跑结果稳定;`POST /api/metrics/tick` 再往当前小时累加增量,让看板上的数字持续变化。 + +## 数据流向图是可以直接编辑的画布 + +图上的东西就在图上改,不用绕去配置页: + +- 「选择 / 摆放」模式下按住系统卡片就能拖,松手即落位;拖到别的列会同时改掉它的层级,列带高亮提示会落到哪一列 +- 「连线」模式下从一张卡片拖到另一张卡片,松手后弹出已填好起止点的数据流表单,补一个关系名称就建好这条链路;不想拖也行,先点起点卡片再点终点卡片 +- 工具条上的「新增系统」在当前列补一张卡片;「自动整理」清掉全部手动位置回到自动排列 +- 位置存在 `systems.flow_x / flow_y`,刷新与换人打开都是同一张图;`PUT /api/graph/layout` 一次拖拽记一条审计,`POST /api/graph/layout/reset` 恢复自动 + +## 流动感是怎么实现的 + +这一屏只回答"谁在什么时候往哪儿传什么",因此画面上没有任何流量数字(条数、体积、时延、本小时都在「系统配置 · 数据流」和历史趋势页看): + +- 粒子密度与速度取自链路节奏:`cadence = √(1 - log(间隔秒) 映射到 30 秒~6 小时)`,分钟级链路密而快,夜间批量疏而慢,同步调用再加一点 +- 动画时长按路径长度与强度反比计算,再除以全局速度倍率;每条链路的粒子用负 `begin` 偏移错开,均匀铺在路径上而不是首尾相接 +- 连线标签只显示关系名称,卡片上只显示入向 / 出向链路数 +- 顶部可关动画(投屏/低配设备)、调 0.25×~3× 速度、按数据类型筛选 + +图本身是自适应的(`components/flow/flowLayout.ts`),换窗口大小不会把系统卡片切掉: + +- 列间距按面板宽度分配,行间距按面板高度分配;装不下时整图等比缩小(下限 0.68),省出来的宽度回补给列间距 +- 同一侧的多条连线在卡片边缘按对端位置排槽位,八条 SSO 链路各走各的接入点,不会挤成一团 +- 连线说明逐条摆放:先按序号在本条曲线上取位,再依次试其他位置,避开系统卡片与已放好的说明;实在放不下就先隐藏,鼠标移到连线或选中对应系统时再出现 +- 右侧详情栏只在选中连线/系统时出现,平时让图占满整宽;选中系统时给出上下游链路清单,可直接点进某一条 +- 每列顶部标出层级名与该列的系统数,卡片上的状态点含义写在图例行右侧,不用回全景图对照 +- 没有任何筛选时,还没接上链路的系统也会留在画布上(它们正是等着被连线的对象);一旦筛选就只显示命中子图 + +## 接口一览 + +`/api/layers` `/api/systems` `/api/flow-types` `/api/flows` 均为标准 REST; +读模型 `/api/graph`(含拓扑计数 `counts`)`/api/metrics/summary|hourly|live|flows/{id}` `/api/audit`; +画布布局 `PUT /api/graph/layout` `POST /api/graph/layout/reset`; +配置 `/api/settings`;备份 `/api/backup`(`mode` 支持 `replace` / `merge`)。 + +写请求通过 `X-Editor` 请求头记录编辑者(含中文时前端自动百分号编码,后端解码)。 +交互文档:启动后访问 `/docs`。 + +## 已知边界 + +- 单文件 SQLite + WAL,适合部门级内部工具;更高并发请换 PG/MySQL +- 数据流向图以桌面屏为主,窄屏下侧栏收成图标栏,图区内可横向拖动查看 +- 指标由链路配置推导而来,不是真实采集数据;接入真实埋点时只需改写 `flow_metrics` 的写入方 diff --git a/backend/app/__init__.py b/backend/app/__init__.py new file mode 100644 index 0000000..4416e73 --- /dev/null +++ b/backend/app/__init__.py @@ -0,0 +1 @@ +"""IT system panorama service.""" diff --git a/backend/app/config.py b/backend/app/config.py new file mode 100644 index 0000000..fe897aa --- /dev/null +++ b/backend/app/config.py @@ -0,0 +1,21 @@ +"""Runtime configuration for the IT panorama service.""" + +from __future__ import annotations + +import os +from pathlib import Path + +BASE_DIR = Path(__file__).resolve().parent.parent +DEFAULT_DB = BASE_DIR / "panorama.db" + + +def db_path() -> Path: + raw = os.environ.get("DB_PATH") + return Path(raw).expanduser().resolve() if raw else DEFAULT_DB + + +# Payload guard for the full-graph save endpoint. +MAX_BODY_BYTES = int(os.environ.get("MAX_BODY_BYTES", str(5 * 1024 * 1024))) + +# Static frontend build produced by `pnpm build` inside ../frontend. +WEB_DIST = Path(os.environ.get("WEB_DIST", str(BASE_DIR.parent / "frontend" / "dist"))) diff --git a/backend/app/db.py b/backend/app/db.py new file mode 100644 index 0000000..2a4414a --- /dev/null +++ b/backend/app/db.py @@ -0,0 +1,256 @@ +"""SQLite access layer: connection factory, schema, and small shared helpers. + +The project deliberately uses the standard library ``sqlite3`` instead of an ORM. +Every request gets its own short lived connection so the WAL journal can serve +readers while a writer is committing. +""" + +from __future__ import annotations + +import json +import sqlite3 +from contextlib import contextmanager +from datetime import datetime, timezone +from typing import Any, Iterable, Iterator + +from . import config + +SCHEMA = """ +CREATE TABLE IF NOT EXISTS layers ( + id TEXT PRIMARY KEY, + name TEXT NOT NULL, + short_name TEXT NOT NULL DEFAULT '', + color TEXT NOT NULL DEFAULT '#0d9488', + description TEXT NOT NULL DEFAULT '', + sort_order INTEGER NOT NULL DEFAULT 0 +); + +CREATE TABLE IF NOT EXISTS systems ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + key TEXT NOT NULL UNIQUE, + name TEXT NOT NULL, + layer_id TEXT REFERENCES layers(id) ON DELETE SET NULL, + dept TEXT NOT NULL DEFAULT '', + status TEXT NOT NULL DEFAULT 'unknown', + tech TEXT NOT NULL DEFAULT '', + url TEXT NOT NULL DEFAULT '', + domain TEXT NOT NULL DEFAULT '', + owner TEXT NOT NULL DEFAULT '', + description TEXT NOT NULL DEFAULT '', + tier INTEGER NOT NULL DEFAULT 2, + -- Manual position on the data-flow canvas; NULL means "let the layout engine place it". + flow_x REAL, + flow_y REAL, + -- When the system went live. Free form: '2024-06' and '2023 Q4 上线' are both valid. + impl_time TEXT NOT NULL DEFAULT '', + -- Whether the panorama overview offers a jump button for this system. + entry_enabled INTEGER NOT NULL DEFAULT 1, + sort_order INTEGER NOT NULL DEFAULT 0, + created_at TEXT NOT NULL DEFAULT '', + updated_at TEXT NOT NULL DEFAULT '' +); +CREATE INDEX IF NOT EXISTS idx_systems_layer ON systems(layer_id); + +CREATE TABLE IF NOT EXISTS flow_types ( + id TEXT PRIMARY KEY, + name TEXT NOT NULL, + color TEXT NOT NULL DEFAULT '#64748b', + line_style TEXT NOT NULL DEFAULT 'solid', + default_interval INTEGER NOT NULL DEFAULT 3600, + description TEXT NOT NULL DEFAULT '', + sort_order INTEGER NOT NULL DEFAULT 0 +); + +CREATE TABLE IF NOT EXISTS data_flows ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + source_key TEXT NOT NULL, + target_key TEXT NOT NULL, + flow_type_id TEXT NOT NULL REFERENCES flow_types(id) ON DELETE CASCADE, + label TEXT NOT NULL DEFAULT '', + payload TEXT NOT NULL DEFAULT '', + direction TEXT NOT NULL DEFAULT 'forward', + interval_sec INTEGER NOT NULL DEFAULT 3600, + records_per_batch INTEGER NOT NULL DEFAULT 1, + avg_payload_kb REAL NOT NULL DEFAULT 1.0, + latency_ms INTEGER NOT NULL DEFAULT 120, + reliability TEXT NOT NULL DEFAULT 'sync', + peak_hours TEXT NOT NULL DEFAULT '1,2,3,4,5,6,7,8', + enabled INTEGER NOT NULL DEFAULT 1, + note TEXT NOT NULL DEFAULT '', + sort_order INTEGER NOT NULL DEFAULT 0, + created_at TEXT NOT NULL DEFAULT '', + updated_at TEXT NOT NULL DEFAULT '' +); +CREATE INDEX IF NOT EXISTS idx_flows_source ON data_flows(source_key); +CREATE INDEX IF NOT EXISTS idx_flows_target ON data_flows(target_key); + +-- Hourly aggregate per flow. hour_bucket is a local date string 'YYYY-MM-DD'. +CREATE TABLE IF NOT EXISTS flow_metrics ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + flow_id INTEGER NOT NULL REFERENCES data_flows(id) ON DELETE CASCADE, + day TEXT NOT NULL, + hour INTEGER NOT NULL, + batches INTEGER NOT NULL DEFAULT 0, + records INTEGER NOT NULL DEFAULT 0, + bytes INTEGER NOT NULL DEFAULT 0, + errors INTEGER NOT NULL DEFAULT 0, + latency_ms INTEGER NOT NULL DEFAULT 0, + UNIQUE(flow_id, day, hour) +); +CREATE INDEX IF NOT EXISTS idx_metrics_day ON flow_metrics(day); + +CREATE TABLE IF NOT EXISTS settings ( + key TEXT PRIMARY KEY, + value TEXT NOT NULL, + updated_at TEXT NOT NULL DEFAULT '' +); + +CREATE TABLE IF NOT EXISTS audit_logs ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + actor TEXT NOT NULL DEFAULT '匿名', + entity TEXT NOT NULL, + entity_id TEXT NOT NULL DEFAULT '', + action TEXT NOT NULL, + summary TEXT NOT NULL DEFAULT '', + created_at TEXT NOT NULL DEFAULT '' +); +CREATE INDEX IF NOT EXISTS idx_audit_created ON audit_logs(created_at); +""" + + +def utcnow() -> str: + return datetime.now(timezone.utc).astimezone().replace(microsecond=0).isoformat(sep=" ") + + +def connect() -> sqlite3.Connection: + # Resolved through the module (not a captured name) so a patched config takes effect + # for connections opened later, including tests that swap the database per case. + path = config.db_path() + path.parent.mkdir(parents=True, exist_ok=True) + # check_same_thread=False is required because FastAPI resolves sync dependencies and + # runs the endpoint body on different threadpool threads. Safety is preserved because + # every request gets its own connection and never shares it with another request. + conn = sqlite3.connect(path, timeout=15.0, isolation_level=None, check_same_thread=False) + conn.row_factory = sqlite3.Row + conn.execute("PRAGMA journal_mode=WAL;") + conn.execute("PRAGMA foreign_keys=ON;") + conn.execute("PRAGMA busy_timeout=8000;") + return conn + + +# Columns added after the first release, backfilled on older database files. +MIGRATIONS: tuple[tuple[str, str, str], ...] = ( + ("systems", "flow_x", "REAL"), + ("systems", "flow_y", "REAL"), + ("systems", "impl_time", "TEXT NOT NULL DEFAULT ''"), + ("systems", "entry_enabled", "INTEGER NOT NULL DEFAULT 1"), +) + + +def migrate(conn: sqlite3.Connection) -> None: + # The shape is read once per table so a migration can target any table, and a table + # that gains several columns at once is only queried once. + seen: dict[str, set[str]] = {} + for table, column, ddl in MIGRATIONS: + if table not in seen: + seen[table] = {row["name"] for row in conn.execute(f"PRAGMA table_info({table})")} + if column in seen[table]: + continue + try: + conn.execute(f"ALTER TABLE {table} ADD COLUMN {column} {ddl}") + except sqlite3.OperationalError as exc: + # Two processes starting at the same instant both see the missing column; + # whichever loses the race has nothing left to add. + if "duplicate column name" not in str(exc): + raise + seen[table].add(column) + + +def init_db() -> None: + conn = connect() + try: + conn.executescript(SCHEMA) + migrate(conn) + finally: + conn.close() + + +@contextmanager +def transaction(conn: sqlite3.Connection) -> Iterator[sqlite3.Connection]: + """Explicit write transaction. + + The connections run with ``isolation_level=None`` so reads stay autocommit, which + also means the bare ``with conn:`` idiom would silently provide no atomicity. + """ + conn.execute("BEGIN IMMEDIATE") + try: + yield conn + except BaseException: + conn.execute("ROLLBACK") + raise + else: + conn.execute("COMMIT") + + +def get_db() -> Iterator[sqlite3.Connection]: + """FastAPI dependency handing out one connection per request.""" + conn = connect() + try: + yield conn + finally: + conn.close() + + +# -------------------------------------------------------------------------- +# Row helpers +# -------------------------------------------------------------------------- + +def rows_to_dicts(rows: Iterable[sqlite3.Row]) -> list[dict[str, Any]]: + return [dict(row) for row in rows] + + +def one(conn: sqlite3.Connection, sql: str, params: Iterable[Any] = ()) -> dict[str, Any] | None: + row = conn.execute(sql, tuple(params)).fetchone() + return dict(row) if row else None + + +def all_(conn: sqlite3.Connection, sql: str, params: Iterable[Any] = ()) -> list[dict[str, Any]]: + return rows_to_dicts(conn.execute(sql, tuple(params)).fetchall()) + + +def json_dump(value: Any) -> str: + return json.dumps(value, ensure_ascii=False, separators=(",", ":")) + + +def setting(conn: sqlite3.Connection, key: str, default: Any = None) -> Any: + row = conn.execute("SELECT value FROM settings WHERE key = ?", (key,)).fetchone() + if row is None: + return default + try: + return json.loads(row["value"]) + except json.JSONDecodeError: + return default + + +def set_setting(conn: sqlite3.Connection, key: str, value: Any) -> None: + conn.execute( + """INSERT INTO settings (key, value, updated_at) VALUES (?, ?, ?) + ON CONFLICT(key) DO UPDATE SET value = excluded.value, updated_at = excluded.updated_at""", + (key, json_dump(value), utcnow()), + ) + + +def log_audit( + conn: sqlite3.Connection, + *, + actor: str, + entity: str, + entity_id: Any = "", + action: str, + summary: str = "", +) -> None: + conn.execute( + """INSERT INTO audit_logs (actor, entity, entity_id, action, summary, created_at) + VALUES (?, ?, ?, ?, ?, ?)""", + (actor[:40] or "匿名", entity, str(entity_id), action, summary[:300], utcnow()), + ) diff --git a/backend/app/deps.py b/backend/app/deps.py new file mode 100644 index 0000000..44c9b40 --- /dev/null +++ b/backend/app/deps.py @@ -0,0 +1,41 @@ +"""Shared request helpers.""" + +from __future__ import annotations + +import sqlite3 +from typing import Annotated +from urllib.parse import unquote + +from fastapi import Depends, HTTPException, Request + +from .db import get_db, setting + +def ensure_editable(db: sqlite3.Connection, action: str = "修改") -> None: + """Abort a content write while the platform is switched to read-only. + + 423 Locked says "this exists but cannot be edited right now", which is exactly what + the switch means, and the frontend turns it into a toast naming that switch. The + ``/api/settings`` endpoints deliberately stay open: locking the platform must never + lock the page that unlocks it again. + """ + if setting(db, "editing_enabled", True) is False: + raise HTTPException(423, f"平台已锁定为只读,无法{action}。请在「系统配置 · 平台配置」打开「允许编辑」后重试。") + + +def require_editable(db: Annotated[sqlite3.Connection, Depends(get_db)]) -> None: + """Route dependency form of :func:`ensure_editable` for plain content writes.""" + ensure_editable(db) + + +def actor_from(request: Request) -> str: + """Editing identity travels on a header so every write method can stay uniform. + + Header values cannot carry Chinese text, so the client percent-encodes it and we + decode here. Anything that is not valid escape coding is kept as-is. + """ + raw = request.headers.get("X-Editor") or request.headers.get("X-Actor") or "" + try: + decoded = unquote(raw, errors="strict") # strict so malformed input falls back below + except (UnicodeDecodeError, ValueError): + decoded = raw + return decoded.strip()[:40] or "匿名" diff --git a/backend/app/main.py b/backend/app/main.py new file mode 100644 index 0000000..d444ffa --- /dev/null +++ b/backend/app/main.py @@ -0,0 +1,108 @@ +"""FastAPI application: JSON API plus static hosting for the built frontend.""" + +from __future__ import annotations + +import logging +from contextlib import asynccontextmanager + +from fastapi import FastAPI, Request +from fastapi.middleware.cors import CORSMiddleware +from fastapi.responses import FileResponse, JSONResponse +from fastapi.staticfiles import StaticFiles + +from .config import MAX_BODY_BYTES, WEB_DIST +from . import config +from .db import init_db +from .routers import backup, content, flows, graph +from .seed import seed + +logging.basicConfig(level=logging.INFO, format="%(asctime)s %(levelname)-7s %(name)s: %(message)s") +logger = logging.getLogger("it.panorama") + + +@asynccontextmanager +async def lifespan(app: FastAPI): + init_db() + conn = None + from .db import connect + from .services import metrics + + conn = connect() + try: + if seed(conn): + logger.info("数据库首次初始化完成,已写入内置系统清单与数据流。") + metrics.ensure_history(conn) + finally: + conn.close() + logger.info("SQLite: %s", config.db_path()) + yield + + +app = FastAPI( + title="公司 IT 系统全景与数据流向平台", + version="1.0.0", + description="IT 系统清单、数据流向图与流量指标的统一可配置后端。", + lifespan=lifespan, +) + +app.add_middleware( + CORSMiddleware, + allow_origins=["*"], + allow_credentials=False, + allow_methods=["*"], + allow_headers=["*"], +) + + +@app.middleware("http") +async def limit_body_size(request: Request, call_next): + """Guard the import endpoint before the body is buffered in memory.""" + declared = request.headers.get("content-length") + if declared and request.method in {"POST", "PUT", "PATCH"} and int(declared) > MAX_BODY_BYTES: + return JSONResponse({"detail": "请求体过大"}, status_code=413) + return await call_next(request) + + +app.include_router(content.router) +app.include_router(flows.router) +app.include_router(graph.router) +app.include_router(backup.router) + + +@app.get("/api/health") +def health() -> dict: + return {"ok": True, "db": str(config.db_path())} + + +# ---------------------------------------------------------------- static frontend + +if WEB_DIST.is_dir(): + app.mount("/assets", StaticFiles(directory=WEB_DIST / "assets"), name="assets") + + @app.get("/favicon.ico", include_in_schema=False) + def favicon(): + path = WEB_DIST / "favicon.ico" + return FileResponse(path) if path.is_file() else JSONResponse({}, status_code=404) + + @app.get("/{full_path:path}", include_in_schema=False) + def spa(full_path: str): + """History-mode routing means unknown paths must fall back to index.html.""" + if full_path.startswith("api/"): + # A typo in an API path must not masquerade as a successful page load. + return JSONResponse({"detail": "接口不存在"}, status_code=404) + candidate = (WEB_DIST / full_path).resolve() + if full_path and candidate.is_file() and candidate.is_relative_to(WEB_DIST.resolve()): + return FileResponse(candidate) + return FileResponse(WEB_DIST / "index.html") + +else: + + @app.get("/", include_in_schema=False) + def missing_frontend() -> JSONResponse: + return JSONResponse( + { + "detail": "前端尚未构建。请在 ../frontend 执行 pnpm install && pnpm build," + "或使用 pnpm dev(默认 http://localhost:5273,已代理 /api 到本服务)。" + }, + status_code=200, + ) diff --git a/backend/app/routers/__init__.py b/backend/app/routers/__init__.py new file mode 100644 index 0000000..f7ec5ce --- /dev/null +++ b/backend/app/routers/__init__.py @@ -0,0 +1 @@ +"""API routers.""" diff --git a/backend/app/routers/backup.py b/backend/app/routers/backup.py new file mode 100644 index 0000000..6b35cd6 --- /dev/null +++ b/backend/app/routers/backup.py @@ -0,0 +1,173 @@ +"""Whole-graph export/import so the platform stays as portable as the original page.""" + +from __future__ import annotations + +import sqlite3 +from typing import Annotated + +from fastapi import APIRouter, Depends, HTTPException, Request + +from ..db import all_, get_db, json_dump, log_audit, set_setting, transaction, utcnow +from ..deps import actor_from, ensure_editable +from ..schemas import BackupIn + +router = APIRouter(prefix="/api", tags=["backup"]) + +DB = Annotated[sqlite3.Connection, Depends(get_db)] + +TABLES = ("layers", "systems", "flow_types", "data_flows") + + +@router.get("/backup") +def export_backup(db: DB) -> dict: + payload: dict = {"schema_version": 1, "exported_at": utcnow()} + for table in TABLES: + rows = all_(db, f"SELECT * FROM {table}") # noqa: S608 - table names come from a fixed tuple + if table == "data_flows": + for row in rows: + row["peak_hours"] = _loads(row.get("peak_hours")) + payload[table] = rows + payload["settings"] = { + row["key"]: _maybe_json(row["value"]) for row in all_(db, "SELECT key, value FROM settings") + if row["key"] != "last_live_tick" + } + return payload + + +@router.post("/backup") +def import_backup(payload: BackupIn, db: DB, request: Request) -> dict: + ensure_editable(db, "导入配置") + if not any(getattr(payload, table) for table in TABLES): + raise HTTPException(400, "备份文件中没有可导入的数据") + errors: list[str] = [] + imported = {table: 0 for table in TABLES} + actor = actor_from(request) + + with transaction(db): + if payload.mode == "replace": + # Metrics depend on flow ids, so a full replace resets history too. + for table in reversed(TABLES): + db.execute(f"DELETE FROM {table}") + db.execute("DELETE FROM settings") + + for layer in payload.layers: + if not _has(layer, "id", "name"): + errors.append("层级缺少 id 或 name,已跳过") + continue + db.execute( + """INSERT INTO layers (id, name, short_name, color, description, sort_order) + VALUES (?,?,?,?,?,?) + ON CONFLICT(id) DO UPDATE SET name=excluded.name, short_name=excluded.short_name, + color=excluded.color, description=excluded.description, sort_order=excluded.sort_order""", + (layer["id"], layer["name"], layer.get("short_name", ""), layer.get("color", "#0d9488"), + layer.get("description", ""), int(layer.get("sort_order", 0))), + ) + imported["layers"] += 1 + + for system in payload.systems: + if not _has(system, "key", "name"): + errors.append("系统缺少 key 或 name,已跳过") + continue + now = utcnow() + db.execute( + """INSERT INTO systems (key, name, layer_id, dept, status, tech, url, domain, owner, + impl_time, entry_enabled, description, tier, flow_x, flow_y, + sort_order, created_at, updated_at) + VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) + ON CONFLICT(key) DO UPDATE SET name=excluded.name, layer_id=excluded.layer_id, + dept=excluded.dept, status=excluded.status, tech=excluded.tech, url=excluded.url, + domain=excluded.domain, owner=excluded.owner, impl_time=excluded.impl_time, + entry_enabled=excluded.entry_enabled, description=excluded.description, + tier=excluded.tier, flow_x=excluded.flow_x, flow_y=excluded.flow_y, sort_order=excluded.sort_order, updated_at=excluded.updated_at""", + (system["key"], system["name"], system.get("layer_id"), system.get("dept", ""), + system.get("status", "unknown"), system.get("tech", ""), system.get("url", ""), + system.get("domain", ""), system.get("owner", ""), system.get("impl_time", ""), + 1 if system.get("entry_enabled", 1) else 0, system.get("description", ""), + int(system.get("tier", 2)), system.get("flow_x"), system.get("flow_y"), + int(system.get("sort_order", 0)), now, now), + ) + imported["systems"] += 1 + + for flow_type in payload.flow_types: + if not _has(flow_type, "id", "name"): + errors.append("数据类型缺少 id 或 name,已跳过") + continue + db.execute( + """INSERT INTO flow_types (id, name, color, line_style, default_interval, description, sort_order) + VALUES (?,?,?,?,?,?,?) + ON CONFLICT(id) DO UPDATE SET name=excluded.name, color=excluded.color, + line_style=excluded.line_style, default_interval=excluded.default_interval, + description=excluded.description, sort_order=excluded.sort_order""", + (flow_type["id"], flow_type["name"], flow_type.get("color", "#64748b"), + flow_type.get("line_style", "dashed"), int(flow_type.get("default_interval", 3600)), + flow_type.get("description", ""), int(flow_type.get("sort_order", 0))), + ) + imported["flow_types"] += 1 + + known_systems = {row["key"] for row in all_(db, "SELECT key FROM systems")} + known_types = {row["id"] for row in all_(db, "SELECT id FROM flow_types")} + now = utcnow() + for flow in payload.data_flows: + source, target = flow.get("source_key"), flow.get("target_key") + type_id = flow.get("flow_type_id") + if source not in known_systems or target not in known_systems: + errors.append(f"数据流 {source} → {target} 的端点系统不存在,已跳过") + continue + if type_id not in known_types: + errors.append(f"数据流 {flow.get('label', '')} 的数据类型 {type_id} 不存在,已跳过") + continue + columns = ["source_key", "target_key", "flow_type_id", "label", "payload", "direction", + "interval_sec", "records_per_batch", "avg_payload_kb", "latency_ms", + "reliability", "peak_hours", "enabled", "note", "sort_order", "created_at", "updated_at"] + values: list = [source, target, type_id, flow.get("label", ""), flow.get("payload", ""), + flow.get("direction", "forward"), int(flow.get("interval_sec", 3600)), + int(flow.get("records_per_batch", 1)), float(flow.get("avg_payload_kb", 1.0)), + int(flow.get("latency_ms", 120)), flow.get("reliability", "async"), + json_dump(flow.get("peak_hours") or []), 1 if flow.get("enabled", True) else 0, + flow.get("note", ""), int(flow.get("sort_order", 0)), now, now] + # Keep the original id when the backup carries one, so re-importing updates in place + # and existing metrics stay attached to the same flow. + flow_id = flow.get("id") + if isinstance(flow_id, int): + columns.insert(0, "id") + values.insert(0, flow_id) + placeholders = ", ".join("?" for _ in values) + column_list = ", ".join(columns) + upsert = ", ".join(f"{column}=excluded.{column}" for column in columns if column != "id") + sql = ( + f"INSERT INTO data_flows ({column_list}) VALUES ({placeholders}) " + f"ON CONFLICT(id) DO UPDATE SET {upsert}" + ) + db.execute(sql, values) + imported["data_flows"] += 1 + + for key, value in (payload.settings or {}).items(): + set_setting(db, key, value) + + log_audit(db, actor=actor, entity="backup", action="import", + summary=f"{payload.mode} 导入:{imported['systems']} 系统 / {imported['data_flows']} 数据流") + + return {"imported": imported, "errors": errors, "mode": payload.mode} + + +def _has(row: dict, *keys: str) -> bool: + return all(row.get(key) not in (None, "") for key in keys) + + +def _loads(raw) -> list[int]: + import json + + try: + value = json.loads(raw or "[]") + except (TypeError, json.JSONDecodeError): + return [] + return [int(v) for v in value] if isinstance(value, list) else [] + + +def _maybe_json(raw: str): + import json + + try: + return json.loads(raw) + except json.JSONDecodeError: + return raw diff --git a/backend/app/routers/content.py b/backend/app/routers/content.py new file mode 100644 index 0000000..ee6ec34 --- /dev/null +++ b/backend/app/routers/content.py @@ -0,0 +1,252 @@ +"""Layers, systems and flow types: the configurable vocabulary of the platform.""" + +from __future__ import annotations + +import sqlite3 +from typing import Annotated + +from fastapi import APIRouter, Depends, HTTPException, Request + +from ..db import all_, get_db, log_audit, one, set_setting, transaction, utcnow +from ..deps import actor_from, require_editable +from ..schemas import LayerIn, FlowTypeIn, SettingsIn, SystemIn, SystemPatch + +router = APIRouter(prefix="/api", tags=["content"]) + +DB = Annotated[sqlite3.Connection, Depends(get_db)] + + +# ---------------------------------------------------------------- layers + +@router.get("/layers") +def list_layers(db: DB) -> list[dict]: + return all_(db, """SELECT l.*, (SELECT COUNT(*) FROM systems s WHERE s.layer_id = l.id) AS system_count + FROM layers l ORDER BY l.sort_order, l.id""") + + +@router.post("/layers", status_code=201, dependencies=[Depends(require_editable)]) +def create_layer(payload: LayerIn, db: DB, request: Request) -> dict: + if one(db, "SELECT id FROM layers WHERE id = ?", (payload.id,)): + raise HTTPException(409, "层级 ID 已存在") + with transaction(db): + db.execute( + "INSERT INTO layers (id, name, short_name, color, description, sort_order) VALUES (?,?,?,?,?,?)", + (payload.id, payload.name, payload.short_name, payload.color, payload.description, payload.sort_order), + ) + log_audit(db, actor=actor_from(request), entity="layer", entity_id=payload.id, + action="create", summary=f"新增层级 {payload.name}") + return one(db, "SELECT * FROM layers WHERE id = ?", (payload.id,)) # type: ignore[return-value] + + +@router.put("/layers/{layer_id}", dependencies=[Depends(require_editable)]) +def update_layer(layer_id: str, payload: LayerIn, db: DB, request: Request) -> dict: + if not one(db, "SELECT id FROM layers WHERE id = ?", (layer_id,)): + raise HTTPException(404, "层级不存在") + with transaction(db): + db.execute( + """UPDATE layers SET name=?, short_name=?, color=?, description=?, sort_order=? WHERE id=?""", + (payload.name, payload.short_name, payload.color, payload.description, payload.sort_order, layer_id), + ) + log_audit(db, actor=actor_from(request), entity="layer", entity_id=layer_id, + action="update", summary=f"更新层级 {payload.name}") + return one(db, "SELECT * FROM layers WHERE id = ?", (layer_id,)) # type: ignore[return-value] + + +@router.delete("/layers/{layer_id}", dependencies=[Depends(require_editable)]) +def delete_layer(layer_id: str, db: DB, request: Request) -> dict: + row = one(db, "SELECT name FROM layers WHERE id = ?", (layer_id,)) + if not row: + raise HTTPException(404, "层级不存在") + used = one(db, "SELECT COUNT(*) AS c FROM systems WHERE layer_id = ?", (layer_id,)) + if used and used["c"]: + raise HTTPException(409, f"仍有 {used['c']} 个系统属于该层级,请先调整这些系统的层级归属") + with transaction(db): + db.execute("DELETE FROM layers WHERE id = ?", (layer_id,)) + log_audit(db, actor=actor_from(request), entity="layer", entity_id=layer_id, + action="delete", summary=f"删除层级 {row['name']}") + return {"ok": True} + + +# ---------------------------------------------------------------- systems + +SYSTEM_SELECT = """SELECT s.*, l.name AS layer_name, l.color AS layer_color + FROM systems s LEFT JOIN layers l ON l.id = s.layer_id""" + + +def _shape_system(row: dict | None) -> dict | None: + """SQLite stores the jump switch as 0/1; the API promises a real boolean.""" + if row is not None: + row["entry_enabled"] = bool(row.get("entry_enabled", 1)) + return row + + +def _all_systems(db: sqlite3.Connection, sql: str, params: object = ()) -> list[dict]: + return [_shape_system(row) for row in all_(db, sql, params)] + + +@router.get("/systems") +def list_systems(db: DB, layer_id: str | None = None, status: str | None = None, + keyword: str | None = None) -> list[dict]: + sql, params = SYSTEM_SELECT, [] + where = [] + if layer_id: + where.append("s.layer_id = ?") + params.append(layer_id) + if status: + where.append("s.status = ?") + params.append(status) + if keyword: + where.append("(s.name LIKE ? OR s.dept LIKE ? OR s.tech LIKE ? OR s.description LIKE ?)") + params.extend([f"%{keyword}%"] * 4) + if where: + sql += " WHERE " + " AND ".join(where) + sql += " ORDER BY COALESCE(l.sort_order, 99), s.sort_order, s.id" + return _all_systems(db, sql, params) + + +@router.get("/systems/{key}") +def get_system(key: str, db: DB) -> dict: + row = _shape_system(one(db, SYSTEM_SELECT + " WHERE s.key = ?", (key,))) + if not row: + raise HTTPException(404, "系统不存在") + return row + + +@router.post("/systems", status_code=201, dependencies=[Depends(require_editable)]) +def create_system(payload: SystemIn, db: DB, request: Request) -> dict: + if one(db, "SELECT key FROM systems WHERE key = ?", (payload.key,)): + raise HTTPException(409, "系统标识已存在") + if payload.layer_id and not one(db, "SELECT id FROM layers WHERE id = ?", (payload.layer_id,)): + raise HTTPException(400, "所属层级不存在") + now = utcnow() + with transaction(db): + db.execute( + """INSERT INTO systems (key, name, layer_id, dept, status, tech, url, domain, owner, + impl_time, entry_enabled, description, tier, flow_x, flow_y, + sort_order, created_at, updated_at) + VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)""", + (payload.key, payload.name, payload.layer_id, payload.dept, payload.status, payload.tech, + payload.url, payload.domain, payload.owner, payload.impl_time, + 1 if payload.entry_enabled else 0, payload.description, payload.tier, + payload.flow_x, payload.flow_y, payload.sort_order, now, now), + ) + log_audit(db, actor=actor_from(request), entity="system", entity_id=payload.key, + action="create", summary=f"新增系统 {payload.name}") + return _shape_system(one(db, SYSTEM_SELECT + " WHERE s.key = ?", (payload.key,))) # type: ignore[return-value] + + +@router.patch("/systems/{key}", dependencies=[Depends(require_editable)]) +def update_system(key: str, payload: SystemPatch, db: DB, request: Request) -> dict: + current = _shape_system(one(db, "SELECT * FROM systems WHERE key = ?", (key,))) + if not current: + raise HTTPException(404, "系统不存在") + changes = payload.model_dump(exclude_unset=True) + if not changes: + return current + if changes.get("layer_id") and not one(db, "SELECT id FROM layers WHERE id = ?", (changes["layer_id"],)): + raise HTTPException(400, "所属层级不存在") + if "impl_time" in changes: + changes["impl_time"] = (changes["impl_time"] or "").strip()[:120] + if "entry_enabled" in changes: + changes["entry_enabled"] = 1 if changes["entry_enabled"] else 0 + changes["updated_at"] = utcnow() + assignments = ", ".join(f"{column} = ?" for column in changes) + with transaction(db): + db.execute(f"UPDATE systems SET {assignments} WHERE key = ?", [*changes.values(), key]) + log_audit(db, actor=actor_from(request), entity="system", entity_id=key, action="update", + summary="更新字段:" + "、".join(k for k in changes if k != "updated_at")) + return _shape_system(one(db, SYSTEM_SELECT + " WHERE s.key = ?", (key,))) # type: ignore[return-value] + + +@router.delete("/systems/{key}", dependencies=[Depends(require_editable)]) +def delete_system(key: str, db: DB, request: Request) -> dict: + if not one(db, "SELECT key FROM systems WHERE key = ?", (key,)): + raise HTTPException(404, "系统不存在") + flows = one(db, "SELECT COUNT(*) AS c FROM data_flows WHERE source_key = ? OR target_key = ?", (key, key)) + with transaction(db): + db.execute("DELETE FROM systems WHERE key = ?", (key,)) + log_audit(db, actor=actor_from(request), entity="system", entity_id=key, action="delete", + summary=f"删除系统,级联移除 {flows['c'] if flows else 0} 条数据流") + return {"ok": True, "removed_flows": flows["c"] if flows else 0} + + +# ---------------------------------------------------------------- flow types + +@router.get("/flow-types") +def list_flow_types(db: DB) -> list[dict]: + return all_(db, """SELECT t.*, (SELECT COUNT(*) FROM data_flows f WHERE f.flow_type_id = t.id) AS flow_count + FROM flow_types t ORDER BY t.sort_order, t.id""") + + +@router.post("/flow-types", status_code=201, dependencies=[Depends(require_editable)]) +def create_flow_type(payload: FlowTypeIn, db: DB, request: Request) -> dict: + if one(db, "SELECT id FROM flow_types WHERE id = ?", (payload.id,)): + raise HTTPException(409, "数据类型 ID 已存在") + with transaction(db): + db.execute( + """INSERT INTO flow_types (id, name, color, line_style, default_interval, description, sort_order) + VALUES (?,?,?,?,?,?,?)""", + (payload.id, payload.name, payload.color, payload.line_style, + payload.default_interval, payload.description, payload.sort_order), + ) + log_audit(db, actor=actor_from(request), entity="flow_type", entity_id=payload.id, + action="create", summary=f"新增数据类型 {payload.name}") + return one(db, "SELECT * FROM flow_types WHERE id = ?", (payload.id,)) # type: ignore[return-value] + + +@router.put("/flow-types/{type_id}", dependencies=[Depends(require_editable)]) +def update_flow_type(type_id: str, payload: FlowTypeIn, db: DB, request: Request) -> dict: + if not one(db, "SELECT id FROM flow_types WHERE id = ?", (type_id,)): + raise HTTPException(404, "数据类型不存在") + with transaction(db): + db.execute( + """UPDATE flow_types SET name=?, color=?, line_style=?, default_interval=?, description=?, sort_order=? + WHERE id=?""", + (payload.name, payload.color, payload.line_style, payload.default_interval, + payload.description, payload.sort_order, type_id), + ) + log_audit(db, actor=actor_from(request), entity="flow_type", entity_id=type_id, + action="update", summary=f"更新数据类型 {payload.name}") + return one(db, "SELECT * FROM flow_types WHERE id = ?", (type_id,)) # type: ignore[return-value] + + +@router.delete("/flow-types/{type_id}", dependencies=[Depends(require_editable)]) +def delete_flow_type(type_id: str, db: DB, request: Request) -> dict: + row = one(db, "SELECT name FROM flow_types WHERE id = ?", (type_id,)) + if not row: + raise HTTPException(404, "数据类型不存在") + used = one(db, "SELECT COUNT(*) AS c FROM data_flows WHERE flow_type_id = ?", (type_id,)) + if used and used["c"]: + raise HTTPException(409, f"仍有 {used['c']} 条数据流使用该类型,请先调整这些数据流") + with transaction(db): + db.execute("DELETE FROM flow_types WHERE id = ?", (type_id,)) + log_audit(db, actor=actor_from(request), entity="flow_type", entity_id=type_id, + action="delete", summary=f"删除数据类型 {row['name']}") + return {"ok": True} + + +# ---------------------------------------------------------------- settings + +@router.get("/settings") +def get_settings(db: DB) -> dict: + rows = all_(db, "SELECT key, value FROM settings") + import json + + out: dict = {} + for row in rows: + try: + out[row["key"]] = json.loads(row["value"]) + except json.JSONDecodeError: + out[row["key"]] = row["value"] + return out + + +@router.patch("/settings") +def patch_settings(payload: SettingsIn, db: DB, request: Request) -> dict: + changes = payload.model_dump(exclude_unset=True) + with transaction(db): + for key, value in changes.items(): + set_setting(db, key, value) + log_audit(db, actor=actor_from(request), entity="settings", action="update", + summary="更新配置:" + "、".join(changes)) + return get_settings(db) diff --git a/backend/app/routers/flows.py b/backend/app/routers/flows.py new file mode 100644 index 0000000..5f963be --- /dev/null +++ b/backend/app/routers/flows.py @@ -0,0 +1,141 @@ +"""Data flow CRUD: the edges that make up the data-flow graph.""" + +from __future__ import annotations + +import json +import sqlite3 +from typing import Annotated + +from fastapi import APIRouter, Depends, HTTPException, Request + +from ..db import all_, get_db, json_dump, log_audit, one, transaction, utcnow +from ..deps import actor_from, ensure_editable +from ..schemas import FlowIn, FlowPatch + +router = APIRouter(prefix="/api/flows", tags=["flows"]) + +DB = Annotated[sqlite3.Connection, Depends(get_db)] + +FLOW_SELECT = """SELECT f.*, t.name AS flow_type_name, t.color AS flow_type_color, + t.line_style AS flow_type_line_style, + s.name AS source_name, g.name AS target_name + FROM data_flows f + JOIN flow_types t ON t.id = f.flow_type_id + JOIN systems s ON s.key = f.source_key + JOIN systems g ON g.key = f.target_key""" + + +def _loads(raw) -> list[int]: + try: + value = json.loads(raw or "[]") + except (TypeError, json.JSONDecodeError): + return [] + return sorted({int(v) for v in value if 0 <= int(v) <= 23}) if isinstance(value, list) else [] + + +def _shape(row: dict | None) -> dict | None: + if row is None: + return None + row["peak_hours"] = _loads(row.get("peak_hours")) + row["enabled"] = bool(row.get("enabled")) + return row + + +def _validate_endpoints(db: sqlite3.Connection, source: str, target: str) -> None: + if source == target: + raise HTTPException(400, "起点与终点不能是同一个系统") + for key, role in ((source, "起点"), (target, "终点")): + if not one(db, "SELECT key FROM systems WHERE key = ?", (key,)): + raise HTTPException(400, f"{role}系统不存在:{key}") + + +@router.get("") +def list_flows(db: DB, flow_type_id: str | None = None, enabled: bool | None = None) -> list[dict]: + sql, params = FLOW_SELECT, [] + where = [] + if flow_type_id: + where.append("f.flow_type_id = ?") + params.append(flow_type_id) + if enabled is not None: + where.append("f.enabled = ?") + params.append(1 if enabled else 0) + if where: + sql += " WHERE " + " AND ".join(where) + sql += " ORDER BY f.sort_order, f.id" + return [_shape(row) for row in all_(db, sql, params)] + + +@router.get("/{flow_id}") +def get_flow(flow_id: int, db: DB) -> dict: + row = one(db, FLOW_SELECT + " WHERE f.id = ?", (flow_id,)) + if not row: + raise HTTPException(404, "数据流不存在") + return _shape(row) + + +@router.post("", status_code=201) +def create_flow(payload: FlowIn, db: DB, request: Request) -> dict: + ensure_editable(db, "新增数据流") + _validate_endpoints(db, payload.source_key, payload.target_key) + if not one(db, "SELECT id FROM flow_types WHERE id = ?", (payload.flow_type_id,)): + raise HTTPException(400, "数据类型不存在") + clash = one(db, """SELECT id FROM data_flows WHERE source_key = ? AND target_key = ? + AND flow_type_id = ? AND label = ?""", + (payload.source_key, payload.target_key, payload.flow_type_id, payload.label)) + if clash: + raise HTTPException(409, "相同起点、终点、类型与名称的数据流已存在") + now = utcnow() + with transaction(db): + db.execute( + """INSERT INTO data_flows (source_key, target_key, flow_type_id, label, payload, direction, + interval_sec, records_per_batch, avg_payload_kb, latency_ms, + reliability, peak_hours, enabled, note, sort_order, created_at, updated_at) + VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)""", + (payload.source_key, payload.target_key, payload.flow_type_id, payload.label, payload.payload, + payload.direction, payload.interval_sec, payload.records_per_batch, payload.avg_payload_kb, + payload.latency_ms, payload.reliability, json_dump(payload.peak_hours), + 1 if payload.enabled else 0, payload.note, payload.sort_order, now, now), + ) + log_audit(db, actor=actor_from(request), entity="flow", entity_id=payload.label, + action="create", summary=f"新增数据流 {payload.source_key} → {payload.target_key}") + return _shape(one(db, FLOW_SELECT + " WHERE f.id = (SELECT MAX(id) FROM data_flows)")) + + +@router.patch("/{flow_id}") +def update_flow(flow_id: int, payload: FlowPatch, db: DB, request: Request) -> dict: + ensure_editable(db, "修改数据流") + current = one(db, "SELECT * FROM data_flows WHERE id = ?", (flow_id,)) + if not current: + raise HTTPException(404, "数据流不存在") + changes = payload.model_dump(exclude_unset=True) + if not changes: + return _shape(current) + source = changes.get("source_key", current["source_key"]) + target = changes.get("target_key", current["target_key"]) + _validate_endpoints(db, source, target) + if changes.get("flow_type_id") and not one(db, "SELECT id FROM flow_types WHERE id = ?", (changes["flow_type_id"],)): + raise HTTPException(400, "数据类型不存在") + if "peak_hours" in changes: + changes["peak_hours"] = json_dump(sorted({int(h) for h in changes["peak_hours"] or [] if 0 <= int(h) <= 23})) + if "enabled" in changes: + changes["enabled"] = 1 if changes["enabled"] else 0 + changes["updated_at"] = utcnow() + assignments = ", ".join(f"{column} = ?" for column in changes) + with transaction(db): + db.execute(f"UPDATE data_flows SET {assignments} WHERE id = ?", [*changes.values(), flow_id]) + log_audit(db, actor=actor_from(request), entity="flow", entity_id=flow_id, action="update", + summary="更新字段:" + "、".join(k for k in changes if k != "updated_at")) + return _shape(one(db, FLOW_SELECT + " WHERE f.id = ?", (flow_id,))) + + +@router.delete("/{flow_id}") +def delete_flow(flow_id: int, db: DB, request: Request) -> dict: + ensure_editable(db, "删除数据流") + current = one(db, "SELECT label FROM data_flows WHERE id = ?", (flow_id,)) + if not current: + raise HTTPException(404, "数据流不存在") + with transaction(db): + db.execute("DELETE FROM data_flows WHERE id = ?", (flow_id,)) + log_audit(db, actor=actor_from(request), entity="flow", entity_id=flow_id, + action="delete", summary=f"删除数据流 {current['label']}") + return {"ok": True} diff --git a/backend/app/routers/graph.py b/backend/app/routers/graph.py new file mode 100644 index 0000000..4d834b9 --- /dev/null +++ b/backend/app/routers/graph.py @@ -0,0 +1,173 @@ +"""Aggregated read models: the whole graph, KPI totals, live counters and audit trail.""" + +from __future__ import annotations + +import sqlite3 +from datetime import date, datetime, timedelta +from typing import Annotated + +from fastapi import APIRouter, Depends, HTTPException, Query, Request + +from ..db import all_, get_db, log_audit, one, transaction, utcnow +from ..deps import actor_from, ensure_editable +from ..schemas import LayoutIn +from ..services import metrics +from ..services.graph import build_graph, tier_label + +router = APIRouter(prefix="/api", tags=["graph"]) + +DB = Annotated[sqlite3.Connection, Depends(get_db)] + + +@router.get("/graph") +def graph(db: DB, days: int = Query(7, ge=1, le=90), include_disabled: bool = False) -> dict: + return build_graph(db, days=days, include_disabled=include_disabled) + + +@router.put("/graph/layout") +def save_layout(payload: LayoutIn, db: DB, request: Request) -> dict: + """Persist where the user dropped the cards on the data-flow canvas. + + One request carries a whole drag gesture so the audit trail records "moved three cards" + instead of three entries per card. A coordinate sent as null puts that card back under + automatic placement. + """ + ensure_editable(db, "调整数据流向图布局") + now = utcnow() + placed = 0 + cleared = 0 + moved: list[str] = [] + missing: list[str] = [] + + with transaction(db): + for item in payload.items: + row = one(db, "SELECT key, name, tier FROM systems WHERE key = ?", (item.key,)) + if not row: + missing.append(item.key) + continue + given = item.model_fields_set + columns: dict[str, object] = {} + if "x" in given: + columns["flow_x"] = item.x + if "y" in given: + columns["flow_y"] = item.y + if columns: + if item.x is None and item.y is None: + cleared += 1 + elif item.x is not None or item.y is not None: + placed += 1 + if item.tier is not None and item.tier != row["tier"]: + columns["tier"] = item.tier + moved.append(f"{row['name']}→{tier_label(item.tier)}") + if not columns: + continue + columns["updated_at"] = now + assignments = ", ".join(f"{column} = ?" for column in columns) + db.execute(f"UPDATE systems SET {assignments} WHERE key = ?", [*columns.values(), item.key]) # noqa: S608 + + parts = [] + if placed: + parts.append(f"手动摆放 {placed} 个系统") + if cleared: + parts.append(f"{cleared} 个恢复自动排列") + if moved: + parts.append("换列:" + "、".join(moved[:5]) + ("等" if len(moved) > 5 else "")) + summary = "数据流向图布局:" + ";".join(parts) if parts else "" + if summary: + log_audit(db, actor=actor_from(request), entity="layout", entity_id="flow_graph", + action="update", summary=summary) + + return {"ok": True, "placed": placed, "cleared": cleared, "moved": len(moved), "missing": missing} + + +@router.post("/graph/layout/reset") +def reset_layout(db: DB, request: Request) -> dict: + """Drop every manual position so the layout engine lays the graph out again.""" + ensure_editable(db, "恢复自动排列") + with transaction(db): + cursor = db.execute( + "UPDATE systems SET flow_x = NULL, flow_y = NULL, updated_at = ? " + "WHERE flow_x IS NOT NULL OR flow_y IS NOT NULL", + (utcnow(),), + ) + cleared = cursor.rowcount + if cleared: + log_audit(db, actor=actor_from(request), entity="layout", entity_id="flow_graph", + action="update", summary=f"数据流向图恢复自动排列({cleared} 个系统)") + return {"ok": True, "cleared": cleared} + + +@router.get("/metrics/summary") +def summary(db: DB, days: int = Query(7, ge=1, le=90)) -> dict: + totals = metrics.totals(db, days) + counts = one(db, """SELECT + (SELECT COUNT(*) FROM systems) AS systems, + (SELECT COUNT(*) FROM data_flows WHERE enabled = 1) AS flows, + (SELECT COUNT(*) FROM data_flows) AS flows_all, + (SELECT COUNT(*) FROM flow_types) AS flow_types, + (SELECT COUNT(*) FROM layers) AS layers""") + health = metrics.flow_health(db, days=days) + states = [h["health"] for h in health.values()] + return { + "range_days": days, + "totals": totals, + "counts": counts, + "health": { + "healthy": states.count("healthy"), + "watch": states.count("watch"), + "risk": states.count("risk"), + }, + "generated_at": datetime.now().replace(microsecond=0).isoformat(), + } + + +@router.get("/metrics/hourly") +def hourly(db: DB, days: int = Query(3, ge=1, le=90)) -> dict: + """Network-wide hourly curve plus a per-flow breakdown, for the trend charts.""" + metrics.ensure_history(db) + start = (date.today() - timedelta(days=days - 1)).isoformat() + rows = all_(db, """SELECT m.day, m.hour, SUM(m.batches) AS batches, SUM(m.records) AS records, + SUM(m.bytes) AS bytes, SUM(m.errors) AS errors, + AVG(NULLIF(m.latency_ms,0)) AS latency + FROM flow_metrics m JOIN data_flows f ON f.id = m.flow_id + WHERE f.enabled = 1 AND m.day >= ? + GROUP BY m.day, m.hour ORDER BY m.day, m.hour""", (start,)) + return {"days": days, "start": start, "points": rows} + + +@router.get("/metrics/flows/{flow_id}") +def flow_series(flow_id: int, db: DB, days: int = Query(7, ge=1, le=90)) -> dict: + if not one(db, "SELECT id FROM data_flows WHERE id = ?", (flow_id,)): + raise HTTPException(404, "数据流不存在") + return {"flow_id": flow_id, "days": days, "points": metrics.hourly_series(db, flow_id, days)} + + +@router.get("/metrics/live") +def live(db: DB) -> dict: + """Current-hour snapshot for every enabled flow; drives the animated graph.""" + today = date.today().isoformat() + hour = datetime.now().hour + rows = all_(db, """SELECT f.id AS flow_id, f.source_key, f.target_key, f.flow_type_id, f.label, + f.direction, f.enabled, COALESCE(m.batches,0) AS batches, + COALESCE(m.records,0) AS records, COALESCE(m.bytes,0) AS bytes, + COALESCE(m.errors,0) AS errors, COALESCE(m.latency_ms,0) AS latency_ms + FROM data_flows f + LEFT JOIN flow_metrics m ON m.flow_id = f.id AND m.day = ? AND m.hour = ? + ORDER BY f.id""", (today, hour)) + return {"day": today, "hour": hour, "flows": rows} + + +@router.post("/metrics/tick") +def tick(db: DB) -> dict: + return metrics.live_tick(db) + + +@router.get("/audit") +def audit(db: DB, limit: int = Query(50, ge=1, le=500), entity: str | None = None) -> list[dict]: + sql, params = "SELECT * FROM audit_logs", [] + if entity: + sql += " WHERE entity = ?" + params.append(entity) + sql += " ORDER BY id DESC LIMIT ?" + params.append(limit) + return all_(db, sql, params) diff --git a/backend/app/schemas.py b/backend/app/schemas.py new file mode 100644 index 0000000..fd87ea1 --- /dev/null +++ b/backend/app/schemas.py @@ -0,0 +1,191 @@ +"""Request/response models. Responses stay plain dicts straight from SQLite so the +API surface does not drift from what the frontend already receives.""" + +from __future__ import annotations + +from typing import Literal + +from pydantic import BaseModel, Field, field_validator + +StatusKey = Literal["running", "improving", "dev", "unknown"] +Direction = Literal["forward", "backward", "bidirectional"] +Reliability = Literal["sync", "async"] + + +def _clean(value: str | None, limit: int = 500) -> str: + return (value or "").strip()[:limit] + + +class LayerIn(BaseModel): + id: str = Field(min_length=1, max_length=40) + name: str = Field(min_length=1, max_length=80) + short_name: str = "" + color: str = "#0d9488" + description: str = "" + sort_order: int = 0 + + @field_validator("id") + @classmethod + def _norm_id(cls, v: str) -> str: + return _clean(v, 40) + + @field_validator("name") + @classmethod + def _norm_name(cls, v: str) -> str: + return _clean(v, 80) + + +class SystemIn(BaseModel): + key: str = Field(min_length=1, max_length=60) + name: str = Field(min_length=1, max_length=80) + layer_id: str | None = None + dept: str = "" + status: StatusKey = "unknown" + tech: str = "" + url: str = "" + domain: str = "" + owner: str = "" + impl_time: str = "" + entry_enabled: bool = True + description: str = "" + tier: int = Field(default=2, ge=0, le=9) + flow_x: float | None = Field(default=None, ge=-4000, le=8000) + flow_y: float | None = Field(default=None, ge=-4000, le=8000) + sort_order: int = 0 + + @field_validator("key") + @classmethod + def _norm_key(cls, v: str) -> str: + return _clean(v, 60) + + @field_validator("name") + @classmethod + def _norm_name(cls, v: str) -> str: + return _clean(v, 80) + + +class SystemPatch(BaseModel): + name: str | None = None + layer_id: str | None = None + dept: str | None = None + status: StatusKey | None = None + tech: str | None = None + url: str | None = None + domain: str | None = None + owner: str | None = None + impl_time: str | None = None + entry_enabled: bool | None = None + description: str | None = None + tier: int | None = Field(default=None, ge=0, le=9) + flow_x: float | None = Field(default=None, ge=-4000, le=8000) + flow_y: float | None = Field(default=None, ge=-4000, le=8000) + sort_order: int | None = None + + @field_validator("name") + @classmethod + def _norm_name(cls, v: str | None) -> str | None: + # Renaming later is an ordinary edit, but an empty name would blank out every card. + if v is None: + return None + cleaned = _clean(v, 80) + if not cleaned: + raise ValueError("系统名称不能为空") + return cleaned + + +class LayoutItem(BaseModel): + # One card on the data-flow canvas; a null coordinate means place it automatically. + key: str = Field(min_length=1, max_length=60) + x: float | None = Field(default=None, ge=-4000, le=8000) + y: float | None = Field(default=None, ge=-4000, le=8000) + tier: int | None = Field(default=None, ge=0, le=9) + + +class LayoutIn(BaseModel): + items: list[LayoutItem] = Field(default_factory=list, max_length=400) + + +class FlowTypeIn(BaseModel): + id: str = Field(min_length=1, max_length=40) + name: str = Field(min_length=1, max_length=60) + color: str = "#64748b" + # 线型是节奏的编码: 实线同步、虚线异步、点划线定时/人工、点线低频参考。 + line_style: Literal["solid", "dashed", "dash-dot", "dotted"] = "dashed" + default_interval: int = Field(default=3600, ge=10, le=86400) + description: str = "" + sort_order: int = 0 + + +class FlowIn(BaseModel): + source_key: str = Field(min_length=1, max_length=60) + target_key: str = Field(min_length=1, max_length=60) + flow_type_id: str + label: str = Field(min_length=1, max_length=80) + payload: str = "" + direction: Direction = "forward" + interval_sec: int = Field(default=3600, ge=10, le=86400) + records_per_batch: int = Field(default=1, ge=0, le=1_000_000) + avg_payload_kb: float = Field(default=1.0, ge=0, le=10_000_000) + latency_ms: int = Field(default=120, ge=0, le=600_000) + reliability: Reliability = "async" + peak_hours: list[int] = Field(default_factory=lambda: [9, 10, 11, 14, 15, 16, 17]) + enabled: bool = True + note: str = "" + sort_order: int = 0 + + @field_validator("peak_hours") + @classmethod + def _hours(cls, v: list[int]) -> list[int]: + clean = sorted({int(h) for h in v if 0 <= int(h) <= 23}) + return clean + + @field_validator("label") + @classmethod + def _label(cls, v: str) -> str: + return _clean(v, 80) + + +class FlowPatch(BaseModel): + source_key: str | None = None + target_key: str | None = None + flow_type_id: str | None = None + label: str | None = None + payload: str | None = None + direction: Direction | None = None + interval_sec: int | None = Field(default=None, ge=10, le=86400) + records_per_batch: int | None = Field(default=None, ge=0, le=1_000_000) + avg_payload_kb: float | None = Field(default=None, ge=0, le=10_000_000) + latency_ms: int | None = Field(default=None, ge=0, le=600_000) + reliability: Reliability | None = None + peak_hours: list[int] | None = None + enabled: bool | None = None + note: str | None = None + sort_order: int | None = None + + +class Actor(BaseModel): + """Optional editing identity carried on write requests.""" + + actor: str = "匿名" + + +class SettingsIn(BaseModel): + site_title: str | None = None + site_subtitle: str | None = None + editing_enabled: bool | None = None + animation_enabled: bool | None = None + animation_speed: float | None = Field(default=None, ge=0.1, le=5) + live_mode: bool | None = None + live_interval_sec: int | None = Field(default=None, ge=5, le=600) + default_range_days: int | None = Field(default=None, ge=1, le=90) + #: How links are drawn on the data-flow canvas: orthogonal, curved, or plain segments. + flow_route_style: Literal["elbow", "curve", "straight"] | None = None + + +class BackupIn(BaseModel): + layers: list[dict] = Field(default_factory=list) + systems: list[dict] = Field(default_factory=list) + flow_types: list[dict] = Field(default_factory=list) + data_flows: list[dict] = Field(default_factory=list) + settings: dict = Field(default_factory=dict) + mode: Literal["replace", "merge"] = "replace" diff --git a/backend/app/seed.py b/backend/app/seed.py new file mode 100644 index 0000000..96c1cdf --- /dev/null +++ b/backend/app/seed.py @@ -0,0 +1,392 @@ +"""Seed content: the IT system inventory plus the initial data-flow topology. + +Everything here is editable through the API afterwards; seeding only runs when the +database is still empty so local edits are never overwritten. +""" + +from __future__ import annotations + +import sqlite3 + +from .db import json_dump, set_setting, transaction, utcnow + +LAYERS = [ + { + "id": "common", + "name": "通用系统(全公司使用)", + "short_name": "通用系统", + "color": "#0d9488", + "description": "面向全公司提供的通用办公与协同系统。", + "sort_order": 1, + }, + { + "id": "dept", + "name": "各部门业务系统", + "short_name": "部门业务", + "color": "#2563eb", + "description": "由各业务部门主导建设、服务本部门主流程的系统。", + "sort_order": 2, + }, + { + "id": "base", + "name": "底座(基础平台)", + "short_name": "底座", + "color": "#7c3aed", + "description": "为上层系统提供认证、算力、存储与组件复用能力的底座平台。", + "sort_order": 3, + }, +] + +# tier drives the column of a node inside the data-flow graph: +# 0 = 统一入口层, 1 = 审批中枢, 2 = 业务系统, 3 = 底座能力 +SYSTEMS = [ + # ---- 通用系统 ---- + { + "key": "oa", "name": "OA(华智OA)", "layer_id": "common", "dept": "", + "status": "running", "tech": "Java / Spring Boot / MySQL", + "tier": 1, + "description": "统一办公自动化系统(华智OA),覆盖审批、流程、协同办公,全公司正常使用中,也是当前审批数据的主要产生源。", + }, + { + "key": "finance-bot", "name": "财务数字助理", "layer_id": "common", "dept": "", + "status": "running", "tech": "Python / OCR / MySQL", + "tier": 2, + "description": "智能化财务辅助系统,承接 OA 报销单据做票据识别与入账处理,正常使用中。", + }, + { + "key": "nas", "name": "NAS文件服务", "layer_id": "common", "dept": "", + "status": "running", "tech": "NAS / SMB", + "tier": 3, + "description": "网络文件存储与共享服务,承载盖章合同原件等归档文件,正常使用中。", + }, + { + "key": "wecom", "name": "企业微信", "layer_id": "common", "dept": "", + "status": "running", "tech": "企业微信开放平台", + "tier": 0, + "description": "统一沟通与移动办公平台,移动端统一接入入口,负责备案发起与消息提醒回传;使用独立账号体系,不接入 UniHub SSO。", + }, + { + "key": "ekb", "name": "ekb知识库", "layer_id": "common", "dept": "", + "status": "dev", "tech": "Java / Elasticsearch", + "tier": 3, + "description": "企业级知识库系统,目前开发完善中,上线后服务全公司知识管理与智能检索。", + }, + { + "key": "unibot", "name": "unibot(智能体平台)", "layer_id": "common", "dept": "", + "status": "running", "tech": "Python / Agent / MCP", + "tier": 0, + "description": "公司级 AI 智能体平台,经 MCP 总线向业务系统取数做经营分析,算力经 UniTensor 中转。", + }, + # ---- 各部门业务系统 ---- + { + "key": "kingdee", "name": "金蝶", "layer_id": "dept", "dept": "经营管理中心", + "status": "running", "tech": "金蝶 ERP", + "tier": 2, + "description": "财务管理/ERP 系统,用于经营管理中心的财务与业务一体化管理,付款/报销/开票在此完成记账。", + }, + { + "key": "edrs", "name": "EDRS日报系统", "layer_id": "dept", "dept": "经营管理中心", + "status": "improving", "tech": "Vue / Java / MySQL", + "tier": 2, + "description": "员工日报填报与汇总系统,支撑经营数据报送与追踪,经 MCP 接入 unibot 做交叉分析。", + }, + { + "key": "pms", "name": "PMS四算", "layer_id": "dept", "dept": "方案系统事业部、协同营销事业部", + "status": "running", "tech": "Java / MySQL", + "tier": 2, + "description": "项目四算管理系统(估算/概算/预算/决算),在合同与付款前提供预算闸门校验。", + }, + { + "key": "oms", "name": "OMS", "layer_id": "dept", "dept": "云智产品事业部", + "status": "improving", "tech": "Java / Spring Boot / MySQL", + "tier": 2, + "description": "订单/运营管理系统,云智产品事业部核心业务系统,驱动采购、付款、开票的履约链路。", + }, + { + "key": "dms", "name": "DMS新光线", "layer_id": "dept", "dept": "软件开发事业部", + "status": "running", "tech": "Java / MySQL", + "tier": 2, + "description": "研发/项目管理系统,定制项目信息与华智 OA 双向同步;调用 UniTensor 算力,经 MCP 接入 unibot。", + }, + { + "key": "docs", "name": "docs文档系统", "layer_id": "dept", "dept": "软件开发事业部", + "status": "running", "tech": "Node.js / MongoDB", + "tier": 2, + "description": "在线文档协作系统,用于研发知识沉淀与文档共享;调用 UniTensor 中转的大模型算力并统计 token 消耗。", + }, + { + "key": "gitea", "name": "Gitea代码仓", "layer_id": "dept", "dept": "软件开发事业部", + "status": "running", "tech": "Gitea / Docker", + "tier": 2, + "description": "自建 Git 代码托管平台,承载全公司研发代码协作,正常使用中。", + }, + { + "key": "scc", "name": "SCC", "layer_id": "dept", "dept": "云智销售部", + "status": "improving", "tech": "Vue / Java / MySQL", + "tier": 2, + "description": "云智销售部业务系统(商机/客户/销售过程),商机备案与费用出差备案由此发起,签单后转 OMS 订单。", + }, + # ---- 底座 ---- + { + "key": "unitensor", "name": "UniTensor", "layer_id": "base", "dept": "", + "status": "improving", "tech": "Python / GPU / 推理服务", + "tier": 3, + "description": "底层基础组件/大模型算力中转平台,作为 Agent 与各系统推理请求的统一中转站。", + }, + { + "key": "unihub", "name": "UniHub统一认证平台", "layer_id": "base", "dept": "", + "status": "improving", "tech": "OAuth2 / OIDC", + "tier": 3, + "description": "全公司统一身份认证中心(SSO)与智能体统一接入监管平台,为各系统提供登录认证与权限基础。", + }, + { + "key": "k3s", "name": "k3s基础服务", "layer_id": "base", "dept": "", + "status": "running", "tech": "k3s / minIO / Docker Registry", + "tier": 3, + "description": "容器化微服务运行底座,统一纳管 fileview 文件预览、OCR 文字提取、minIO 对象存储、Docker 镜像仓库。", + }, + { + "key": "dsh", "name": "DSH组件市场", "layer_id": "base", "dept": "", + "status": "improving", "tech": "前端组件 / npm 私服", + "tier": 3, + "description": "公司级组件市场,统一沉淀、共享与复用公共组件与通用能力,支撑业务系统快速集成。", + }, +] + +FLOW_TYPES = [ + { + "id": "core", "name": "核心业务链路", "color": "#1d4ed8", "line_style": "solid", + "default_interval": 1800, "sort_order": 1, + "description": "预算→合同→订单→签单→归档的主业务闭环数据。", + }, + { + "id": "entry", "name": "移动端入口 / 消息", "color": "#16a34a", "line_style": "dashed", + "default_interval": 300, "sort_order": 2, + "description": "企业微信作为移动端统一入口发起备案,并回传消息与通知。", + }, + { + "id": "mcp", "name": "MCP 取数(Agent)", "color": "#a855f7", "line_style": "dash-dot", + "default_interval": 3600, "sort_order": 3, + "description": "unibot 经 MCP 总线向业务系统读取结构化数据做智能分析。", + }, + { + "id": "cap", "name": "底座能力调用", "color": "#0ea5e9", "line_style": "solid", + "default_interval": 900, "sort_order": 4, + "description": "业务系统调用底座能力:算力推理、对象存储、OCR、文件预览。", + }, + { + "id": "auth", "name": "统一认证(SSO)", "color": "#7c3aed", "line_style": "solid", + "default_interval": 300, "sort_order": 5, + "description": "各系统跳转 UniHub 完成票据校验与登录态同步。", + }, + { + "id": "archive", "name": "归档 / 知识沉淀", "color": "#64748b", "line_style": "dash-dot", + "default_interval": 3600, "sort_order": 6, + "description": "合同原件归档、文档知识沉淀等低频大批量数据传输。", + }, +] + +# interval_sec / records / kb / latency describe the steady state of each link. +# peak_hours are the local hours (0-23) when the link is busiest. +FLOWS = [ + # ---------- 核心业务闭环 ---------- + dict(source="pms", target="oa", type="core", label="预算闸门", payload="预算/概算可用额度校验结果", + direction="bidirectional", interval_sec=1800, records_per_batch=42, avg_payload_kb=64, + latency_ms=180, reliability="sync", peak_hours=[9, 10, 11, 14, 15, 16, 17], + note="合同/付款审批前调用 PMS 预算闸门,审批结果回写占用与执行数。"), + dict(source="oa", target="oms", type="core", label="合同→订单", payload="合同编号、金额、客户、履约条款", + interval_sec=1800, records_per_batch=26, avg_payload_kb=96, latency_ms=220, + reliability="sync", peak_hours=[10, 11, 14, 15, 16, 17, 18], + note="合同审批通过后由 OA 推送结构化数据到 OMS 转订单。"), + dict(source="oms", target="scc", type="core", label="订单/签单回填", payload="订单状态、交付节点", + interval_sec=3600, records_per_batch=18, avg_payload_kb=48, latency_ms=260, + reliability="async", peak_hours=[9, 10, 15, 16, 17], note=None), + dict(source="scc", target="oms", type="core", label="归档转订单", payload="签单归档信息、开票抬头", + interval_sec=3600, records_per_batch=12, avg_payload_kb=40, latency_ms=240, + reliability="async", peak_hours=[16, 17, 18], note=None), + dict(source="oa", target="finance-bot", type="core", label="报销单据", payload="报销单、发票影像、成本中心", + interval_sec=900, records_per_batch=58, avg_payload_kb=220, latency_ms=320, + reliability="sync", peak_hours=[11, 12, 16, 17, 18], note="费用报销审批完成后推送财务数字助理做票据识别。"), + dict(source="finance-bot", target="kingdee", type="core", label="记账凭证", payload="凭证分录、票据号、金额", + interval_sec=3600, records_per_batch=35, avg_payload_kb=52, latency_ms=420, + reliability="async", peak_hours=[9, 10, 15, 16, 17, 18], note="识别通过的单据由财务在金蝶完成记账。"), + dict(source="dms", target="oa", type="core", label="项目信息同步", payload="定制项目主数据、里程碑", + direction="bidirectional", interval_sec=3600, records_per_batch=30, avg_payload_kb=88, + latency_ms=280, reliability="sync", peak_hours=[10, 11, 14, 15, 16], + note="定制项目信息接口保留不变,双向同步。"), + # ---------- 企业微信入口 ---------- + dict(source="oa", target="wecom", type="entry", label="待办/收款群通知", payload="审批待办卡片、收款群消息", + interval_sec=300, records_per_batch=120, avg_payload_kb=12, latency_ms=160, + reliability="async", peak_hours=[9, 10, 11, 14, 15, 16, 17, 18]), + dict(source="wecom", target="finance-bot", type="entry", label="导出PDF报销", payload="移动端报销 PDF、票据照片", + interval_sec=1800, records_per_batch=20, avg_payload_kb=480, latency_ms=620, + reliability="async", peak_hours=[12, 17, 18, 19], note="员工在企微端上传 PDF,由财务助理识别。"), + dict(source="scc", target="wecom", type="entry", label="商机备案", payload="商机备案表单、客户名称", + interval_sec=1800, records_per_batch=15, avg_payload_kb=24, latency_ms=200, + reliability="sync", peak_hours=[10, 11, 15, 16, 17]), + dict(source="pms", target="wecom", type="entry", label="概算备案", payload="概算编号、项目归属", + interval_sec=3600, records_per_batch=10, avg_payload_kb=18, latency_ms=190, + reliability="sync", peak_hours=[10, 11, 14, 15]), + dict(source="wecom", target="edrs", type="entry", label="填报提醒", payload="日报催办与填报回执", + interval_sec=3600, records_per_batch=90, avg_payload_kb=8, latency_ms=150, + reliability="async", peak_hours=[9, 18, 19, 20], note="早间提醒与日终催办。"), + # ---------- MCP 取数 ---------- + dict(source="unibot", target="pms", type="mcp", label="MCP 取数", payload="四算执行进度、预算占用", + direction="bidirectional", interval_sec=3600, records_per_batch=200, avg_payload_kb=180, + latency_ms=520, reliability="sync", peak_hours=[9, 10, 14, 15, 16]), + dict(source="unibot", target="oms", type="mcp", label="MCP 取数", payload="订单履约与回款进度", + direction="bidirectional", interval_sec=3600, records_per_batch=220, avg_payload_kb=196, + latency_ms=540, reliability="sync", peak_hours=[9, 10, 14, 15, 16]), + dict(source="unibot", target="scc", type="mcp", label="MCP 取数", payload="商机漏斗与签单数据", + direction="bidirectional", interval_sec=3600, records_per_batch=160, avg_payload_kb=140, + latency_ms=500, reliability="sync", peak_hours=[9, 10, 15, 16, 17]), + dict(source="unibot", target="edrs", type="mcp", label="MCP 取数", payload="日报投入工时与经营口径数据", + direction="bidirectional", interval_sec=3600, records_per_batch=180, avg_payload_kb=120, + latency_ms=480, reliability="sync", peak_hours=[9, 18, 19]), + dict(source="unibot", target="unitensor", type="mcp", label="Agent 算力中转", payload="推理请求与返回 token", + direction="bidirectional", interval_sec=60, records_per_batch=480, avg_payload_kb=320, + latency_ms=900, reliability="sync", peak_hours=list(range(8, 21)), + note="Agent 推理全部经 UniTensor 中转站。"), + # ---------- 底座能力调用 ---------- + dict(source="docs", target="unitensor", type="cap", label="调用算力·统计token", payload="文档摘要/问答推理请求", + interval_sec=300, records_per_batch=320, avg_payload_kb=260, latency_ms=760, + reliability="async", peak_hours=list(range(9, 19))), + dict(source="dms", target="unitensor", type="cap", label="调用算力", payload="代码辅助推理请求", + interval_sec=600, records_per_batch=200, avg_payload_kb=210, latency_ms=700, + reliability="async", peak_hours=[10, 11, 14, 15, 16, 17]), + dict(source="finance-bot", target="k3s", type="cap", label="文件预览/OCR/对象存储", payload="发票影像、识别中间件", + interval_sec=900, records_per_batch=90, avg_payload_kb=1500, latency_ms=520, + reliability="sync", peak_hours=[11, 12, 16, 17, 18]), + dict(source="scc", target="k3s", type="cap", label="对象存储", payload="商机附件、资质材料", + interval_sec=1800, records_per_batch=45, avg_payload_kb=2200, latency_ms=580, + reliability="async", peak_hours=[10, 11, 14, 15, 16]), + dict(source="docs", target="k3s", type="cap", label="文件预览", payload="文档预览渲染对象", + interval_sec=900, records_per_batch=150, avg_payload_kb=880, latency_ms=340, + reliability="async", peak_hours=list(range(9, 19))), + dict(source="dms", target="k3s", type="cap", label="镜像仓库", payload="构建镜像层", + interval_sec=3600, records_per_batch=12, avg_payload_kb=64000, latency_ms=1200, + reliability="async", peak_hours=[11, 17, 18], note="CI 构建推送镜像,单次体量大、频次低。"), + dict(source="dms", target="gitea", type="cap", label="CI 触发", payload="流水线触发与构建回调", + direction="bidirectional", interval_sec=600, records_per_batch=35, avg_payload_kb=36, + latency_ms=280, reliability="async", peak_hours=[10, 11, 14, 15, 16, 17]), + dict(source="dms", target="dsh", type="cap", label="组件发布/拉取", payload="公共组件包版本", + interval_sec=86400, records_per_batch=6, avg_payload_kb=12000, latency_ms=1500, + reliability="async", peak_hours=[15, 16, 17], note="组件市场发布节奏按工作日估算。"), + # ---------- 统一认证 ---------- + dict(source="oa", target="unihub", type="auth", label="SSO 票据校验", payload="OIDC token 交换", + interval_sec=300, records_per_batch=400, avg_payload_kb=4, latency_ms=90, + reliability="sync", peak_hours=[9, 10, 13, 14, 15, 16, 17]), + dict(source="pms", target="unihub", type="auth", label="SSO 票据校验", payload="OIDC token 交换", + interval_sec=600, records_per_batch=120, avg_payload_kb=4, latency_ms=90, + reliability="sync", peak_hours=[9, 10, 14, 15, 16]), + dict(source="oms", target="unihub", type="auth", label="SSO 票据校验", payload="OIDC token 交换", + interval_sec=600, records_per_batch=150, avg_payload_kb=4, latency_ms=95, + reliability="sync", peak_hours=[9, 10, 14, 15, 16, 17]), + dict(source="scc", target="unihub", type="auth", label="SSO 票据校验", payload="OIDC token 交换", + interval_sec=600, records_per_batch=110, avg_payload_kb=4, latency_ms=92, + reliability="sync", peak_hours=[9, 10, 14, 15, 16, 17]), + dict(source="dms", target="unihub", type="auth", label="SSO 票据校验", payload="OIDC token 交换", + interval_sec=600, records_per_batch=70, avg_payload_kb=4, latency_ms=88, + reliability="sync", peak_hours=[10, 11, 14, 15, 16]), + dict(source="docs", target="unihub", type="auth", label="SSO 票据校验", payload="OIDC token 交换", + interval_sec=600, records_per_batch=95, avg_payload_kb=4, latency_ms=86, + reliability="sync", peak_hours=list(range(9, 19))), + dict(source="gitea", target="unihub", type="auth", label="SSO 票据校验", payload="OIDC token 交换", + interval_sec=900, records_per_batch=60, avg_payload_kb=4, latency_ms=85, + reliability="sync", peak_hours=[10, 11, 14, 15, 16, 17]), + dict(source="ekb", target="unihub", type="auth", label="SSO 票据校验", payload="OIDC token 交换", + interval_sec=1800, records_per_batch=25, avg_payload_kb=4, latency_ms=90, + reliability="sync", peak_hours=[10, 11, 15, 16]), + # ---------- 归档 / 知识沉淀 ---------- + dict(source="oa", target="nas", type="archive", label="盖章合同原件归档", payload="盖章合同 PDF 原件", + interval_sec=3600, records_per_batch=8, avg_payload_kb=24000, latency_ms=1800, + reliability="async", peak_hours=[16, 17, 18], note="流程走完后归档,单文件体量大。"), + dict(source="docs", target="ekb", type="archive", label="知识沉淀同步", payload="结项文档、方案模板", + interval_sec=3600, records_per_batch=22, avg_payload_kb=3600, latency_ms=900, + reliability="async", peak_hours=[17, 18, 19]), + dict(source="unibot", target="ekb", type="archive", label="企业知识检索", payload="RAG 检索与向量召回", + direction="bidirectional", interval_sec=600, records_per_batch=260, avg_payload_kb=640, + latency_ms=1100, reliability="sync", peak_hours=list(range(9, 19))), +] + +DEFAULT_SETTINGS = { + "site_title": "公司 IT 系统全景与数据流向平台", + "site_subtitle": "① 系统全景总览 | ② 数据流向图(实时流动)", + "editing_enabled": True, + "animation_enabled": True, + "animation_speed": 1.0, + "live_mode": True, + "live_interval_sec": 15, + "default_range_days": 7, + "metric_seed": "it-panorama-seed-v1", + # 折线 (正交走线) reads best in a report, so it is the shipped default; 曲线 / 直线 stay one click away. + "flow_route_style": "elbow", +} + + +def already_seeded(conn: sqlite3.Connection) -> bool: + row = conn.execute("SELECT COUNT(*) AS c FROM systems").fetchone() + return bool(row and row["c"]) + + +def seed(conn: sqlite3.Connection) -> bool: + """Populate a fresh database. Returns True when seeding actually ran.""" + if already_seeded(conn): + return False + + now = utcnow() + with transaction(conn): + for layer in LAYERS: + conn.execute( + "INSERT INTO layers (id, name, short_name, color, description, sort_order) VALUES (?,?,?,?,?,?)", + (layer["id"], layer["name"], layer["short_name"], layer["color"], layer["description"], layer["sort_order"]), + ) + + for index, system in enumerate(SYSTEMS): + conn.execute( + """INSERT INTO systems (key, name, layer_id, dept, status, tech, url, domain, owner, + description, tier, sort_order, created_at, updated_at) + VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?)""", + ( + system["key"], system["name"], system["layer_id"], system.get("dept", ""), + system["status"], system.get("tech", ""), system.get("url", ""), system.get("domain", ""), + system.get("owner", ""), system["description"], system["tier"], index, now, now, + ), + ) + + for flow_type in FLOW_TYPES: + conn.execute( + """INSERT INTO flow_types (id, name, color, line_style, default_interval, description, sort_order) + VALUES (?,?,?,?,?,?,?)""", + ( + flow_type["id"], flow_type["name"], flow_type["color"], flow_type["line_style"], + flow_type["default_interval"], flow_type["description"], flow_type["sort_order"], + ), + ) + + for index, flow in enumerate(FLOWS): + conn.execute( + """INSERT INTO data_flows (source_key, target_key, flow_type_id, label, payload, direction, + interval_sec, records_per_batch, avg_payload_kb, latency_ms, + reliability, peak_hours, enabled, note, sort_order, created_at, updated_at) + VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)""", + ( + flow["source"], flow["target"], flow["type"], flow["label"], flow.get("payload") or "", + flow.get("direction") or "forward", flow["interval_sec"], flow["records_per_batch"], + flow["avg_payload_kb"], flow["latency_ms"], flow.get("reliability", "async"), + json_dump(flow["peak_hours"]), 1, flow.get("note") or "", index, now, now, + ), + ) + + for key, value in DEFAULT_SETTINGS.items(): + set_setting(conn, key, value) + + return True + + +def ensure_graph_shape(conn: sqlite3.Connection) -> None: + """Fill tier ranks derived from the flow graph when they look unset.""" + rows = conn.execute("SELECT DISTINCT tier FROM systems").fetchall() + if len(rows) >= 2: + return + conn.executescript("UPDATE systems SET tier = 2;") diff --git a/backend/app/services/__init__.py b/backend/app/services/__init__.py new file mode 100644 index 0000000..8162292 --- /dev/null +++ b/backend/app/services/__init__.py @@ -0,0 +1 @@ +"""Domain services.""" diff --git a/backend/app/services/graph.py b/backend/app/services/graph.py new file mode 100644 index 0000000..bb3437e --- /dev/null +++ b/backend/app/services/graph.py @@ -0,0 +1,211 @@ +"""Build the data-flow graph payload consumed by the frontend. + +The frontend does no topology work of its own: it receives node ranks plus edge +endpoints, so the picture stays stable across reloads and both the web app and any +future client render exactly the same graph. +""" + +from __future__ import annotations + +import sqlite3 +from collections import defaultdict, deque + +from ..db import all_ +from . import metrics +from .metrics import parse_peak_hours + + +# Column meaning inside the data-flow graph; mirrors TIER_LABELS in the frontend. +TIER_LABELS = ('统一入口层', '审批 / 流程中枢', '业务系统层', '底座能力层') + + +def tier_label(tier: int) -> str: + try: + return TIER_LABELS[tier] + except IndexError: + return f'第 {tier + 1} 层' + + +def load_systems(conn: sqlite3.Connection) -> list[dict]: + return all_( + conn, + """SELECT s.*, l.name AS layer_name, l.short_name AS layer_short_name, l.color AS layer_color + FROM systems s LEFT JOIN layers l ON l.id = s.layer_id + ORDER BY s.sort_order, s.id""", + ) + + +def load_flows(conn: sqlite3.Connection) -> list[dict]: + return all_( + conn, + """SELECT f.*, t.name AS flow_type_name, t.color AS flow_type_color, + t.line_style AS flow_type_line_style, t.default_interval AS flow_type_default_interval, + s.name AS source_name, g.name AS target_name, + s.tier AS source_tier, g.tier AS target_tier + FROM data_flows f + JOIN flow_types t ON t.id = f.flow_type_id + JOIN systems s ON s.key = f.source_key + JOIN systems g ON g.key = f.target_key + ORDER BY f.sort_order, f.id""", + ) + + +def compute_depth(systems: list[dict], flows: list[dict]) -> dict[str, int]: + """Longest-path depth from any source node, used only as a layout hint. + + Tiers stay authoritative for the visible columns; depth merely flags nodes whose + declared tier disagrees with the direction of their edges, which is what the + "layout suggestions" panel reports. + """ + adjacency: dict[str, list[str]] = defaultdict(list) + indegree: dict[str, int] = {s["key"]: 0 for s in systems} + for flow in flows: + if not flow["enabled"]: + continue + # Bidirectional links say nothing about ordering, so they must not push a + # node to the right; only strict one-way traffic implies a downstream rank. + if flow.get("direction") == "bidirectional": + continue + source, target = flow["source_key"], flow["target_key"] + if source not in indegree or target not in indegree: + continue + adjacency[source].append(target) + indegree[target] += 1 + + depth = dict.fromkeys(indegree, 0) + degrees = dict(indegree) + queue = deque(sorted(key for key, degree in degrees.items() if degree == 0)) + while queue: + node = queue.popleft() + for nxt in adjacency[node]: + depth[nxt] = max(depth[nxt], depth[node] + 1) + degrees[nxt] -= 1 + if degrees[nxt] == 0: + queue.append(nxt) + return depth + + +def layout_suggestions(systems: list[dict], depth: dict[str, int]) -> list[dict]: + """Flag nodes whose declared tier trails the depth implied by their incoming edges.""" + hints = [] + for system in systems: + implied = depth.get(system["key"], 0) + declared = int(system["tier"]) + if implied > declared: + hints.append({ + "key": system["key"], + "name": system["name"], + "tier": declared, + "implied_depth": implied, + "reason": "上游链路深度大于当前层级,数据显示它可能应放在更靠右的列", + }) + return hints + + +def build_graph(conn: sqlite3.Connection, *, days: int = 7, include_disabled: bool = False) -> dict: + metrics.ensure_history(conn) + systems = load_systems(conn) + flows = load_flows(conn) + health = metrics.flow_health(conn, days=days) + + active = [f for f in flows if f["enabled"]] if not include_disabled else flows + depth = compute_depth(systems, active) + ranks = {s["key"]: int(s["tier"]) for s in systems} + + degree: dict[str, int] = defaultdict(int) + for flow in active: + degree[flow["source_key"]] += 1 + degree[flow["target_key"]] += 1 + + nodes = [] + for system in systems: + key = system["key"] + node_health = [health.get(f["id"], {}).get("health") for f in active + if key in (f["source_key"], f["target_key"])] + nodes.append({ + "key": key, + "name": system["name"], + "layer_id": system["layer_id"], + "layer_name": system["layer_name"], + "layer_color": system["layer_color"], + "dept": system["dept"], + "status": system["status"], + "tech": system["tech"], + "url": system["url"], + "domain": system["domain"], + "owner": system["owner"], + "impl_time": system.get("impl_time") or "", + "entry_enabled": bool(system.get("entry_enabled", 1)), + "description": system["description"], + "tier": int(system["tier"]), + "flow_x": system.get("flow_x"), + "flow_y": system.get("flow_y"), + "rank": ranks.get(key, int(system["tier"])), + "depth": depth.get(key, 0), + "degree": degree[key], + "out_count": sum(1 for f in active if f["source_key"] == key), + "in_count": sum(1 for f in active if f["target_key"] == key), + "health": ( + "risk" if "risk" in node_health else + "watch" if "watch" in node_health else + "healthy" if node_health else "idle" + ), + }) + + edges = [] + for flow in flows: + if not include_disabled and not flow["enabled"]: + continue + h = health.get(flow["id"], {}) + edges.append({ + "id": flow["id"], + "source_key": flow["source_key"], + "target_key": flow["target_key"], + "source_name": flow["source_name"], + "target_name": flow["target_name"], + "flow_type_id": flow["flow_type_id"], + "flow_type_name": flow["flow_type_name"], + "color": flow["flow_type_color"], + "line_style": flow["flow_type_line_style"], + "label": flow["label"], + "payload": flow["payload"], + "direction": flow["direction"], + "interval_sec": flow["interval_sec"], + "records_per_batch": flow["records_per_batch"], + "avg_payload_kb": flow["avg_payload_kb"], + "latency_ms": flow["latency_ms"], + "reliability": flow["reliability"], + "peak_hours": sorted(parse_peak_hours(flow["peak_hours"])), + "enabled": bool(flow["enabled"]), + "note": flow["note"], + "throughput_rps": metrics.throughput_rps(flow, h), + "payload_mb_per_hour": metrics.payload_rps(flow), + "health": { + "batches": h.get("batches", 0), + "records": h.get("records", 0), + "bytes": h.get("bytes", 0), + "errors": h.get("errors", 0), + "error_rate": h.get("error_rate", 0), + "avg_latency_ms": h.get("avg_latency_ms", flow["latency_ms"]), + "peak_hour_records": h.get("peak_hour_records", 0), + "state": h.get("health", "idle"), + }, + }) + + return { + "nodes": nodes, + "edges": edges, + "ranks": ranks, + "rank_count": (max(ranks.values()) + 1) if ranks else 0, + "suggestions": layout_suggestions(systems, depth), + # Topology counts belong to the graph itself, so the flow canvas needs no second + # request (and no traffic metrics) just to label its own header. + "counts": { + "systems": len(systems), + "layers": len({system["layer_id"] for system in systems if system["layer_id"]}), + "tiers": len({int(system["tier"]) for system in systems}), + "flows_total": len(flows), + "flows_enabled": sum(1 for flow in flows if flow["enabled"]), + "linked_systems": sum(1 for system in systems if degree[system["key"]]), + }, + } diff --git a/backend/app/services/metrics.py b/backend/app/services/metrics.py new file mode 100644 index 0000000..7d520af --- /dev/null +++ b/backend/app/services/metrics.py @@ -0,0 +1,288 @@ +"""Flow metrics: deterministic history generation plus live increments. + +Each flow row carries a steady-state cadence (interval, batch size, payload). The +hourly history is derived from that cadence with a seeded jitter so the graph has +real numbers to animate against, and re-generating the same day always yields the +same figures. The live tick then adds small increments on top so the picture moves +while somebody is watching it. +""" + +from __future__ import annotations + +import json +import random +import sqlite3 +from datetime import date, datetime, timedelta + +from ..db import all_, json_dump, setting, transaction, utcnow + +# Weekday shape: the company works during business hours, quieter at night. +NIGHT_FACTOR = 0.06 +WEEKEND_FACTOR = 0.18 + +PEAK_CURVE = { + 0: 0.05, 1: 0.04, 2: 0.03, 3: 0.03, 4: 0.03, 5: 0.04, + 6: 0.07, 7: 0.12, 8: 0.35, 9: 0.78, 10: 1.00, 11: 0.92, + 12: 0.42, 13: 0.55, 14: 0.96, 15: 1.00, 16: 0.94, 17: 0.86, + 18: 0.46, 19: 0.30, 20: 0.22, 21: 0.15, 22: 0.10, 23: 0.07, +} + + +def parse_peak_hours(raw) -> list[int]: + """Accept either the stored JSON string or an already decoded list.""" + if isinstance(raw, str): + try: + raw = json.loads(raw or "[]") + except json.JSONDecodeError: + return [] + if not isinstance(raw, (list, tuple, set)): + return [] + return {int(v) for v in raw if isinstance(v, (int, float)) and 0 <= int(v) <= 23} + + +def hour_weight(hour: int, peak_hours, reliability: str) -> float: + """Relative activity for one hour, blending the global curve with flow peaks.""" + peak_hours = parse_peak_hours(peak_hours) + base = PEAK_CURVE.get(hour, 0.1) + if hour in peak_hours: + base = max(base, 0.62 + 0.38 * PEAK_CURVE.get(hour, 0.1)) + if reliability == "sync": + # Interactive links track head-office hours closely. + base *= 1.0 + else: + # Batch jobs keep a low background trickle outside office hours. + base = max(base, 0.12) + return max(0.02, min(1.4, base)) + + +def expected_batches(flow: dict, hour: int) -> float: + interval = max(30, int(flow["interval_sec"] or 3600)) + capacity = 3600.0 / interval + return capacity * hour_weight(hour, flow["peak_hours"], flow["reliability"]) + + +def _rng(seed: str, flow_id: int, day: str, hour: int) -> random.Random: + return random.Random(f"{seed}|{flow_id}|{day}|{hour}") + + +def day_is_weekend(day: date) -> bool: + return day.weekday() >= 5 + + +def compute_bucket(flow: dict, day: date, hour: int, seed: str) -> dict: + """Deterministic metric bucket for one flow/hour.""" + rng = _rng(seed, flow["id"], day.isoformat(), hour) + weight = hour_weight(hour, flow["peak_hours"], flow["reliability"]) + factor = WEEKEND_FACTOR if day_is_weekend(day) else 1.0 + expected = expected_batches(flow, hour) * factor + jitter = rng.uniform(0.72, 1.32) + batches = max(0, int(round(expected * jitter))) + if batches == 0 and rng.random() < 0.12 * weight: + batches = 1 + per_batch = max(1, int(flow["records_per_batch"])) + records = int(round(batches * per_batch * rng.uniform(0.8, 1.24))) if batches else 0 + kb = float(flow["avg_payload_kb"] or 1.0) + payload_bytes = int(round(batches * kb * 1024 * rng.uniform(0.78, 1.3))) + # Occasional degraded window on async links so the health view has variety. + error_rate = 0.004 if flow["reliability"] == "async" else 0.001 + errors = int(round(records * error_rate * rng.choice([0, 0, 0, 1, 1, 2, 6]))) + latency = int(round(int(flow["latency_ms"]) * rng.uniform(0.82, 1.45))) + return { + "day": day.isoformat(), + "hour": hour, + "batches": batches, + "records": records, + "bytes": payload_bytes, + "errors": errors, + "latency_ms": latency, + } + + +def upsert_bucket(conn: sqlite3.Connection, flow_id: int, bucket: dict) -> None: + conn.execute( + """INSERT INTO flow_metrics (flow_id, day, hour, batches, records, bytes, errors, latency_ms) + VALUES (?,?,?,?,?,?,?,?) + ON CONFLICT(flow_id, day, hour) DO UPDATE SET + batches = excluded.batches, + records = excluded.records, + bytes = excluded.bytes, + errors = excluded.errors, + latency_ms = excluded.latency_ms""", + ( + flow_id, bucket["day"], bucket["hour"], bucket["batches"], + bucket["records"], bucket["bytes"], bucket["errors"], bucket["latency_ms"], + ), + ) + + +def ensure_history(conn: sqlite3.Connection, days: int = 30) -> None: + """Backfill hourly history for any flow that does not have its own rows yet. + + Checked per flow rather than globally so links added after the first run still + get a believable history instead of rendering as dead edges. + """ + flows = all_( + conn, + """SELECT f.* FROM data_flows f + WHERE NOT EXISTS (SELECT 1 FROM flow_metrics m WHERE m.flow_id = f.id)""", + ) + if not flows: + return + seed = str(setting(conn, "metric_seed", "it-panorama-seed-v1")) + today = date.today() + with transaction(conn): + for flow in flows: + for offset in range(days, 0, -1): + day = today - timedelta(days=offset) + for hour in range(24): + upsert_bucket(conn, flow["id"], compute_bucket(flow, day, hour, seed)) + # Today only up to the current hour so the graph never claims future traffic. + day = today + for hour in range(datetime.now().hour + 1): + upsert_bucket(conn, flow["id"], compute_bucket(flow, day, hour, seed)) + + +def live_tick(conn: sqlite3.Connection) -> dict: + """Advance the current hour by one live step. Returns a compact summary.""" + seed = str(setting(conn, "metric_seed", "it-panorama-seed-v1")) + now = datetime.now() + today = now.date() + hour = now.hour + rng = random.Random(f"live|{seed}|{today.isoformat()}|{hour}|{int(now.timestamp() // 7)}") + flows = all_(conn, "SELECT * FROM data_flows WHERE enabled = 1") + touched = 0 + with transaction(conn): + for flow in flows: + weight = hour_weight(hour, flow["peak_hours"], flow["reliability"]) + probability = min(0.95, weight * 0.85) + if rng.random() > probability: + continue + expected = expected_batches(flow, hour) / 24.0 + batches = max(1, int(round(expected * rng.uniform(0.6, 2.2)))) + conn.execute( + """INSERT INTO flow_metrics (flow_id, day, hour, batches, records, bytes, errors, latency_ms) + VALUES (?,?,?,?,?,?,?,?) + ON CONFLICT(flow_id, day, hour) DO UPDATE SET + batches = batches + excluded.batches, + records = records + excluded.records, + bytes = bytes + excluded.bytes, + errors = errors + excluded.errors, + latency_ms = (latency_ms * 3 + excluded.latency_ms) / 4""", + ( + flow["id"], today.isoformat(), hour, batches, + int(round(batches * flow["records_per_batch"] * rng.uniform(0.85, 1.3))), + int(round(batches * float(flow["avg_payload_kb"]) * 1024 * rng.uniform(0.85, 1.25))), + 1 if (flow["reliability"] == "async" and rng.random() < 0.05) else 0, + int(round(int(flow["latency_ms"]) * rng.uniform(0.85, 1.4))), + ), + ) + touched += 1 + conn.execute("INSERT INTO settings (key, value, updated_at) VALUES ('last_live_tick', ?, ?) " + "ON CONFLICT(key) DO UPDATE SET value = excluded.value, updated_at = excluded.updated_at", + (json_dump(now.replace(microsecond=0).isoformat()), utcnow())) + return {"touched": touched, "at": now.replace(microsecond=0).isoformat()} + + +def totals(conn: sqlite3.Connection, days: int) -> dict: + """Rolling totals used by the KPI cards.""" + start = (date.today() - timedelta(days=days - 1)).isoformat() + row = conn.execute( + """SELECT COALESCE(SUM(m.batches),0) AS batches, COALESCE(SUM(m.records),0) AS records, + COALESCE(SUM(m.bytes),0) AS bytes, COALESCE(SUM(m.errors),0) AS errors, + AVG(NULLIF(m.latency_ms,0)) AS avg_latency + FROM flow_metrics m JOIN data_flows f ON f.id = m.flow_id + WHERE f.enabled = 1 AND m.day >= ?""", + (start,), + ).fetchone() + active = conn.execute( + """SELECT COUNT(*) AS c FROM flow_metrics m JOIN data_flows f ON f.id = m.flow_id + WHERE f.enabled = 1 AND m.day >= ? AND m.records > 0""", + (start,), + ).fetchone() + return { + "batches": int(row["batches"] or 0), + "records": int(row["records"] or 0), + "bytes": int(row["bytes"] or 0), + "errors": int(row["errors"] or 0), + "avg_latency_ms": int(round(row["avg_latency"] or 0)), + "active_buckets": int(active["c"] or 0), + } + + +def series_for_day(conn: sqlite3.Connection, day: str) -> list[dict]: + return all_( + conn, + """SELECT flow_id, hour, batches, records, bytes, errors, latency_ms + FROM flow_metrics WHERE day = ? ORDER BY flow_id, hour""", + (day,), + ) + + +def hourly_series(conn: sqlite3.Connection, flow_id: int, days: int) -> list[dict]: + start = (date.today() - timedelta(days=days - 1)).isoformat() + return all_( + conn, + """SELECT day, hour, batches, records, bytes, errors, latency_ms FROM flow_metrics + WHERE flow_id = ? AND day >= ? ORDER BY day, hour""", + (flow_id, start), + ) + + +def health_label(error_rate: float, latency_ms: int) -> str: + if error_rate >= 0.02: + return "risk" + if error_rate >= 0.005 or latency_ms >= 900: + return "watch" + return "healthy" + + +def flow_health(conn: sqlite3.Connection, days: int = 7) -> dict[int, dict]: + """Per-flow aggregate health over the trailing window.""" + start = (date.today() - timedelta(days=days - 1)).isoformat() + rows = all_( + conn, + """SELECT flow_id, SUM(batches) AS batches, SUM(records) AS records, SUM(bytes) AS bytes, + SUM(errors) AS errors, AVG(NULLIF(latency_ms,0)) AS latency, + MAX(records) AS peak_records + FROM flow_metrics WHERE day >= ? GROUP BY flow_id""", + (start,), + ) + out: dict[int, dict] = {} + for row in rows: + records = int(row["records"] or 0) + errors = int(row["errors"] or 0) + latency = int(round(row["latency"] or 0)) + rate = (errors / records) if records else 0.0 + out[int(row["flow_id"])] = { + "batches": int(row["batches"] or 0), + "records": records, + "bytes": int(row["bytes"] or 0), + "errors": errors, + "error_rate": round(rate, 5), + "avg_latency_ms": latency, + "peak_hour_records": int(row["peak_records"] or 0), + "health": health_label(rate, latency), + } + return out + + +def throughput_rps(flow: dict, health: dict | None) -> float: + """Records per second used to drive particle density and speed on the client.""" + interval = max(30, int(flow["interval_sec"] or 3600)) + weight = hour_weight(datetime.now().hour, flow["peak_hours"], flow["reliability"]) + factor = WEEKEND_FACTOR if day_is_weekend(date.today()) else 1.0 + per_hour = (3600.0 / interval) * weight * factor * int(flow["records_per_batch"]) + return round(per_hour / 3600.0, 4) + + +def payload_rps(flow: dict) -> float: + interval = max(30, int(flow["interval_sec"] or 3600)) + weight = hour_weight(datetime.now().hour, flow["peak_hours"], flow["reliability"]) + factor = WEEKEND_FACTOR if day_is_weekend(date.today()) else 1.0 + return round((3600.0 / interval) * weight * factor * float(flow["avg_payload_kb"]) / 1024.0, 4) + + +__all__ = [ + "compute_bucket", "ensure_history", "live_tick", "totals", "series_for_day", + "hourly_series", "flow_health", "throughput_rps", "payload_rps", "hour_weight", "parse_peak_hours" +] diff --git a/backend/panorama.db b/backend/panorama.db new file mode 100644 index 0000000..f14e415 Binary files /dev/null and b/backend/panorama.db differ diff --git a/backend/requirements-dev.txt b/backend/requirements-dev.txt new file mode 100644 index 0000000..2f21eed --- /dev/null +++ b/backend/requirements-dev.txt @@ -0,0 +1,3 @@ +-r requirements.txt +pytest>=8.0 +httpx>=0.27 diff --git a/backend/requirements.txt b/backend/requirements.txt new file mode 100644 index 0000000..da5e2d4 --- /dev/null +++ b/backend/requirements.txt @@ -0,0 +1,3 @@ +fastapi>=0.115 +uvicorn[standard]>=0.30 +pydantic>=2.7 diff --git a/backend/run.py b/backend/run.py new file mode 100644 index 0000000..1522c0e --- /dev/null +++ b/backend/run.py @@ -0,0 +1,13 @@ +"""Development entrypoint: python run.py""" + +import os + +import uvicorn + +if __name__ == "__main__": + uvicorn.run( + "app.main:app", + host=os.environ.get("HOST", "0.0.0.0"), + port=int(os.environ.get("PORT", 8787)), + reload=bool(os.environ.get("RELOAD")), + ) diff --git a/backend/tests/conftest.py b/backend/tests/conftest.py new file mode 100644 index 0000000..d0e9110 --- /dev/null +++ b/backend/tests/conftest.py @@ -0,0 +1,39 @@ +"""Shared fixtures. Tests run against a throwaway database per test.""" + +from __future__ import annotations + +import os +import sys +from pathlib import Path + +import pytest + +sys.path.insert(0, str(Path(__file__).resolve().parent.parent)) + + +class FakeRequest: + """Minimal stand-in for starlette's Request: routers only read the editor header.""" + + def __init__(self, actor: str = "测试员") -> None: + self.headers = {"X-Editor": actor} + + +@pytest.fixture() +def db(tmp_path, monkeypatch): + monkeypatch.setenv("DB_PATH", str(tmp_path / "test.db")) + from app import config + + monkeypatch.setattr(config, "db_path", lambda: tmp_path / "test.db") + from app.db import connect, init_db + from app.seed import seed + + init_db() + conn = connect() + seed(conn) + yield conn + conn.close() + + +@pytest.fixture() +def request_(): + return FakeRequest() diff --git a/backend/tests/test_api.py b/backend/tests/test_api.py new file mode 100644 index 0000000..f75a3a1 --- /dev/null +++ b/backend/tests/test_api.py @@ -0,0 +1,404 @@ +"""End-to-end HTTP tests against the real ASGI app, including static hosting.""" + +from __future__ import annotations + +import pytest +from fastapi.testclient import TestClient + + +@pytest.fixture() +def client(tmp_path, monkeypatch): + monkeypatch.setenv("DB_PATH", str(tmp_path / "api.db")) + from app import config + + monkeypatch.setattr(config, "db_path", lambda: tmp_path / "api.db") + from app.main import app + + with TestClient(app) as instance: + yield instance + + +# ------------------------------------------------------------------ read models + +def test_health_and_seed(client): + assert client.get("/api/health").status_code == 200 + assert client.get("/api/layers").json().__len__() == 3 + assert len(client.get("/api/systems").json()) == 18 + assert len(client.get("/api/flow-types").json()) == 6 + assert len(client.get("/api/flows").json()) == 36 + + +def test_graph_payload_is_animation_ready(client): + graph = client.get("/api/graph?days=7").json() + assert len(graph["nodes"]) == 18 and len(graph["edges"]) == 36 + for edge in graph["edges"]: + # the frontend layout keys edges by endpoint key and animates on these numbers + assert edge["source_key"] and edge["target_key"] + assert edge["color"] and edge["line_style"] + assert edge["throughput_rps"] >= 0 + assert edge["health"]["state"] in {"healthy", "watch", "risk", "idle"} + assert {node["rank"] for node in graph["nodes"]} == {node["tier"] for node in graph["nodes"]} + + +def test_metrics_endpoints_agree(client): + summary = client.get("/api/metrics/summary?days=7").json() + assert summary["totals"]["records"] > 0 + hourly = client.get("/api/metrics/hourly?days=2").json() + assert hourly["points"], "hourly curve must not be empty" + live = client.get("/api/metrics/live").json() + assert len(live["flows"]) == 36 + + +def test_flow_series_and_audit(client): + flow_id = client.get("/api/flows").json()[0]["id"] + series = client.get(f"/api/metrics/flows/{flow_id}?days=3").json() + assert series["points"] + assert client.get("/api/metrics/flows/999999").status_code == 404 + assert isinstance(client.get("/api/audit?limit=10").json(), list) + + +# ------------------------------------------------------------------ writes over HTTP + +def test_system_crud_and_validation_over_http(client): + created = client.post("/api/systems", json={"key": "http-demo", "name": "HTTP 系统", "layer_id": "base"}) + assert created.status_code == 201 + assert created.json()["layer_name"] == "底座(基础平台)" + + assert client.post("/api/systems", json={"key": "http-demo", "name": "重复"}).status_code == 409 + assert client.post("/api/systems", json={"key": "x", "name": "无层级", "layer_id": "ghost"}).status_code == 400 + assert client.patch("/api/systems/http-demo", json={"status": "dev"}).json()["status"] == "dev" + assert client.patch("/api/systems/ghost", json={"status": "dev"}).status_code == 404 + assert client.delete("/api/layers/base").status_code == 409, "层级仍被使用时不得删除" + assert client.delete("/api/systems/http-demo").json()["ok"] is True + + +def test_flow_guardrails_over_http(client): + base = {"source_key": "pms", "target_key": "kingdee", "flow_type_id": "core", "label": "HTTP 链路"} + created = client.post("/api/flows", json=base) + assert created.status_code == 201 + assert created.json()["peak_hours"] == [9, 10, 11, 14, 15, 16, 17] + assert client.post("/api/flows", json=base).status_code == 409 + assert client.post("/api/flows", json={**base, "target_key": "pms"}).status_code == 400 + assert client.post("/api/flows", json={**base, "interval_sec": 1}).status_code == 422 + flow_id = created.json()["id"] + assert client.patch(f"/api/flows/{flow_id}", json={"enabled": False}).json()["enabled"] is False + assert client.delete(f"/api/flows/{flow_id}").json()["ok"] is True + + +def test_editor_header_roundtrips_chinese_names(client): + """The browser cannot put Chinese text in a header, so the client percent-encodes it.""" + encoded = "%E5%BA%B7%E6%96%87%E6%99%B6" + client.post("/api/systems", json={"key": "hdr", "name": "请求头系统"}, headers={"X-Editor": encoded}) + latest = client.get("/api/audit?limit=1").json()[0] + assert latest["actor"] == "康文晶" + + +def test_settings_patch_is_partial(client): + before = client.get("/api/settings").json() + updated = client.patch("/api/settings", json={"live_interval_sec": 30}).json() + assert updated["live_interval_sec"] == 30 + assert updated["site_title"] == before["site_title"], "未提交的配置必须保留" + + +# ------------------------------------------------------------------ system fields + +def test_impl_time_and_entry_flag_roundtrip(client): + """实现时间 is free-form text and the jump switch decides who shows a shortcut.""" + created = client.post( + "/api/systems", + json={"key": "entry-demo", "name": "入口系统", "url": "https://x.example.com", + "impl_time": "2024-06 上线", "entry_enabled": False}, + ) + assert created.status_code == 201 + assert created.json()["impl_time"] == "2024-06 上线" + assert created.json()["entry_enabled"] is False + + patched = client.patch("/api/systems/entry-demo", json={"entry_enabled": True}).json() + assert patched["entry_enabled"] is True + assert client.patch("/api/systems/entry-demo", json={"impl_time": " "}).json()["impl_time"] == "" + + node = next(n for n in client.get("/api/graph").json()["nodes"] if n["key"] == "entry-demo") + assert node["impl_time"] == "" and node["entry_enabled"] is True + + +def test_seeded_systems_carry_the_new_fields(client): + for system in client.get("/api/systems").json(): + assert system["impl_time"] == "" + assert system["entry_enabled"] is True, "默认所有系统都可以展示快捷入口" + + +def test_system_name_can_be_renamed_after_creation(client): + """系统名称 is an ordinary field: the only rule is "not blank", the key never moves.""" + renamed = client.patch("/api/systems/oa", json={"name": " OA(华智 OA · 新版) "}) + assert renamed.status_code == 200 + assert renamed.json()["name"] == "OA(华智 OA · 新版)" + assert renamed.json()["key"] == "oa", "改名不改主键" + + assert client.patch("/api/systems/oa", json={"name": " "}).status_code == 422 + + # The flow read model carries its own copy of the name, so a rename has to reach it. + graph = client.get("/api/graph").json() + node = next(item for item in graph["nodes"] if item["key"] == "oa") + assert node["name"] == "OA(华智 OA · 新版)" + edge = next(item for item in graph["edges"] if item["source_key"] == "oa") + assert edge["source_name"] == "OA(华智 OA · 新版)" + + audit = client.get("/api/audit?limit=5").json() + assert any("name" in entry["summary"] for entry in audit) + + # Over-long names are cut rather than rejected; the field is capped, not precious. + assert len(client.patch("/api/systems/oa", json={"name": "x" * 200}).json()["name"]) == 80 + + +# ------------------------------------------------------------------ read-only switch + +def test_read_only_lock_blocks_content_writes(client): + assert client.patch("/api/settings", json={"editing_enabled": False}).json()["editing_enabled"] is False + + blocked = [ + client.post("/api/systems", json={"key": "locked", "name": "锁定测试"}), + client.patch("/api/systems/oa", json={"name": "改名"}), + client.delete("/api/systems/oa"), + client.post("/api/layers", json={"id": "locked", "name": "锁定层"}), + client.post("/api/flow-types", json={"id": "locked", "name": "锁定类型"}), + client.post("/api/flows", json={"source_key": "oa", "target_key": "oms", + "flow_type_id": "core", "label": "锁定链路"}), + client.put("/api/graph/layout", json={"items": [{"key": "oa", "x": 10, "y": 10}]}), + ] + assert [response.status_code for response in blocked] == [423] * len(blocked) + assert "只读" in blocked[0].json()["detail"] + + assert client.get("/api/systems").json(), "读取不受开关影响" + assert client.patch("/api/systems/oa", json={"name": "改名"}).status_code == 423 + assert next(s for s in client.get("/api/systems").json() if s["key"] == "oa")["name"] != "改名" + + +def test_read_only_switch_can_be_turned_back_off(client): + """Locking the platform must never lock the page that unlocks it.""" + client.patch("/api/settings", json={"editing_enabled": False}) + assert client.patch("/api/settings", json={"editing_enabled": True}).json()["editing_enabled"] is True + assert client.post("/api/systems", json={"key": "after", "name": "解锁后"}).status_code == 201 + # A locked import is refused before anything is written. + client.patch("/api/settings", json={"editing_enabled": False}) + payload = client.get("/api/backup").json() + assert client.post("/api/backup", json={**payload, "mode": "replace"}).status_code == 423 + assert len(client.get("/api/systems").json()) == 19, "被拒绝的导入不得改动数据" + + +def test_live_metrics_still_run_while_locked(client): + """实时推进 is a display clock, not a user edit, so it keeps ticking in read-only.""" + client.patch("/api/settings", json={"editing_enabled": False}) + assert client.post("/api/metrics/tick").status_code == 200 + + +def test_matrix_endpoint_is_gone(client): + assert client.get("/api/metrics/matrix?days=7").status_code == 404 + + +# ------------------------------------------------------------------ backup + +def test_backup_export_then_merge_is_idempotent(client): + payload = client.get("/api/backup").json() + assert payload["systems"] and payload["data_flows"] and payload["schema_version"] == 1 + result = client.post("/api/backup", json={**payload, "mode": "merge"}).json() + assert result["errors"] == [] + assert len(client.get("/api/systems").json()) == 18, "按 id 合并不应产生重复" + + +def test_backup_replace_drops_orphans(client): + payload = client.get("/api/backup").json() + payload["systems"] = [s for s in payload["systems"] if s["key"] in {"oa", "pms"}] + result = client.post("/api/backup", json={**payload, "mode": "replace"}).json() + assert len(client.get("/api/systems").json()) == 2 + assert any("端点系统不存在" in message for message in result["errors"]) + # The restored graph must still render, and only the link whose endpoints both + # survived may remain. + graph = client.get("/api/graph?days=7").json() + assert len(graph["nodes"]) == 2 + assert [(e["source_key"], e["target_key"]) for e in graph["edges"]] == [("pms", "oa")] + # History for the restored flow is rebuilt from its cadence rather than left blank. + assert graph["edges"][0]["health"]["records"] > 0 + + +def test_backup_rejects_empty_payload(client): + assert client.post("/api/backup", json={}).status_code == 400 + + +# ------------------------------------------------------------------ routing + +def test_unknown_api_path_returns_json_404_not_the_spa_shell(client): + response = client.get("/api/does-not-exist") + assert response.status_code == 404 + assert response.json() == {"detail": "接口不存在"} + + +def test_spa_routes_serve_the_built_app(client): + from app.config import WEB_DIST + + if not WEB_DIST.is_dir(): + pytest.skip("前端尚未构建,跳过静态托管校验") + for path in ("/", "/flow", "/panorama", "/config"): + response = client.get(path) + assert response.status_code == 200, path + assert "text/html" in response.headers["content-type"] + assert client.get("/favicon.svg").status_code == 200 + + +# ------------------------------------------------------------------ canvas layout + +def _node(client, key): + return next(node for node in client.get("/api/graph").json()["nodes"] if node["key"] == key) + + +def test_seeded_nodes_start_on_automatic_placement(client): + for node in client.get("/api/graph").json()["nodes"]: + assert node["flow_x"] is None and node["flow_y"] is None + + +def test_layout_endpoint_persists_positions_and_tier(client): + response = client.put( + "/api/graph/layout", + json={"items": [{"key": "oa", "x": 421.5, "y": 260, "tier": 2}]}, + headers={"X-Editor": "%E5%BC%A0%E5%B7%A5"}, + ) + assert response.status_code == 200 + assert response.json() == {"ok": True, "placed": 1, "cleared": 0, "moved": 1, "missing": []} + + node = _node(client, "oa") + assert (node["flow_x"], node["flow_y"], node["tier"]) == (421.5, 260.0, 2) + + audit = client.get("/api/audit").json() + assert len(audit) == 1, "a whole drag gesture is one audit entry, not one per card" + assert audit[0]["actor"] == "张工" + assert "手动摆放 1 个系统" in audit[0]["summary"] + + +def test_layout_tier_change_alone_keeps_the_dropped_position(client): + client.put("/api/graph/layout", json={"items": [{"key": "oa", "x": 120, "y": 80}]}) + client.put("/api/graph/layout", json={"items": [{"key": "oa", "tier": 3}]}) + + node = _node(client, "oa") + assert (node["flow_x"], node["flow_y"], node["tier"]) == (120.0, 80.0, 3) + + +def test_layout_null_coordinates_return_a_card_to_auto_placement(client): + client.put("/api/graph/layout", json={"items": [{"key": "oa", "x": 10, "y": 20}]}) + response = client.put("/api/graph/layout", json={"items": [{"key": "oa", "x": None, "y": None}]}) + assert response.json()["cleared"] == 1 + + node = _node(client, "oa") + assert node["flow_x"] is None and node["flow_y"] is None + + +def test_layout_reset_clears_every_manual_position(client): + client.put("/api/graph/layout", json={"items": [ + {"key": "oa", "x": 10, "y": 20}, {"key": "pms", "x": 30, "y": 40}, + ]}) + assert client.post("/api/graph/layout/reset").json() == {"ok": True, "cleared": 2} + assert all(node["flow_x"] is None for node in client.get("/api/graph").json()["nodes"]) + + +def test_layout_reports_unknown_keys_and_rejects_runaway_coordinates(client): + response = client.put("/api/graph/layout", json={"items": [{"key": "ghost", "x": 5, "y": 5}]}) + assert response.json()["missing"] == ["ghost"] + assert client.put("/api/graph/layout", json={"items": [{"key": "oa", "x": 999999}]}).status_code == 422 + assert client.put("/api/graph/layout", json={"items": [{"key": "oa", "tier": 99}]}).status_code == 422 + + +def test_empty_layout_write_is_not_audited(client): + assert client.put("/api/graph/layout", json={"items": []}).status_code == 200 + assert client.get("/api/audit").json() == [] + + +def test_new_system_can_be_born_at_a_canvas_position(client): + created = client.post("/api/systems", json={ + "key": "crm", "name": "CRM 客户管理", "layer_id": "dept", "dept": "云智销售部首", + "status": "dev", "tier": 2, "flow_x": 512, "flow_y": 640, + }) + assert created.status_code == 201 + node = _node(client, "crm") + assert (node["flow_x"], node["flow_y"]) == (512.0, 640.0) + + +def test_backup_round_trip_keeps_manual_positions(client): + client.put("/api/graph/layout", json={"items": [{"key": "oa", "x": 333, "y": 444}]}) + snapshot = client.get("/api/backup").json() + client.post("/api/graph/layout/reset") + assert _node(client, "oa")["flow_x"] is None + + assert client.post("/api/backup", json={**snapshot, "mode": "replace"}).status_code == 200 + assert _node(client, "oa")["flow_x"] == 333.0 + + +def test_read_only_lock_blocks_layout_reset(client): + """恢复自动排列 rewrites every card, so the switch has to cover it too.""" + client.put("/api/graph/layout", json={"items": [{"key": "oa", "x": 210, "y": 260}]}) + client.patch("/api/settings", json={"editing_enabled": False}) + + blocked = client.post("/api/graph/layout/reset") + assert blocked.status_code == 423 + assert "只读" in blocked.json()["detail"] + assert _node(client, "oa")["flow_x"] == 210.0, "被拒绝的重置不得清空手动位置" + + assert client.patch("/api/settings", json={"editing_enabled": True}).status_code == 200 + assert client.post("/api/graph/layout/reset").json() == {"ok": True, "cleared": 1} + + +def test_graph_payload_carries_topology_counts(client): + """The flow canvas reads its own header numbers from the graph, metrics-free.""" + graph = client.get("/api/graph").json() + counts = graph["counts"] + systems = client.get("/api/systems").json() + flows = client.get("/api/flows").json() + + assert counts["systems"] == len(systems) == len(graph["nodes"]) + assert counts["flows_total"] == len(flows) + assert counts["flows_enabled"] == sum(1 for flow in flows if flow["enabled"]) + assert counts["tiers"] == len({system["tier"] for system in systems}) + assert counts["linked_systems"] == sum(1 for node in graph["nodes"] if node["degree"]) + + client.post("/api/systems", json={"key": "crm_new", "name": "CRM 客户管理"}) + created = client.post("/api/flows", json={"source_key": "oa", "target_key": "crm_new", + "flow_type_id": "core", "label": "新链路"}) + assert created.status_code == 201 + after = client.get("/api/graph").json()["counts"] + assert after["flows_total"] == counts["flows_total"] + 1 + assert after["flows_enabled"] == counts["flows_enabled"] + 1 + + +@pytest.mark.parametrize("style", ["elbow", "curve", "straight"]) +def test_flow_route_style_round_trips_through_settings(client, style): + """线型是汇报现场的偏好,要跟着设置走,刷新和换设备都不能丢。""" + assert client.patch("/api/settings", json={"flow_route_style": style}).json()["flow_route_style"] == style + assert client.get("/api/settings").json()["flow_route_style"] == style + + +def test_flow_route_style_rejects_unknown_value(client): + """一个认不出的线型会让画布退回默认走线,不如在入口就拒绝。""" + assert client.patch("/api/settings", json={"flow_route_style": "curve"}).status_code == 200 + assert client.patch("/api/settings", json={"flow_route_style": "spaghetti"}).status_code == 422 + assert client.get("/api/settings").json()["flow_route_style"] == "curve" + + +def test_flow_type_accepts_dash_dot_line_style(client): + """点划线 carries 定时任务 / 人工 in the legend, so both ends have to accept it.""" + created = client.post( + "/api/flow-types", json={"id": "nightly", "name": "夜间批处理", "line_style": "dash-dot"} + ) + assert created.status_code == 201 + assert created.json()["line_style"] == "dash-dot" + + payload = created.json() | {"name": "夜间批处理", "line_style": "solid"} + assert client.put("/api/flow-types/nightly", json=payload).json()["line_style"] == "solid" + + +def test_shipped_flow_types_follow_the_colour_legend(client): + """图例承诺"蓝=调用、紫=鉴权取数、绿=消息、灰=定时、红=人工",种子数据必须真的这么画。""" + types = {item["id"]: item for item in client.get("/api/flow-types").json()} + + assert types["core"]["color"].startswith("#1") and types["core"]["line_style"] == "solid" + assert types["cap"]["line_style"] == "solid", "底座能力调用是同步调用" + assert types["entry"]["line_style"] == "dashed", "消息推送是异步" + assert types["mcp"]["line_style"] == "dash-dot", "MCP 取数是定时" + assert types["archive"]["line_style"] == "dash-dot", "归档沉淀是定时" + assert types["auth"]["color"] == "#7c3aed" and types["core"]["color"] != types["cap"]["color"] diff --git a/backend/tests/test_backend.py b/backend/tests/test_backend.py new file mode 100644 index 0000000..e808649 --- /dev/null +++ b/backend/tests/test_backend.py @@ -0,0 +1,431 @@ +"""Backend behaviour: seeding, metrics, CRUD guards, and backup round-trips.""" + +from __future__ import annotations + +from datetime import date, datetime + +import pytest +from fastapi import HTTPException + +from conftest import FakeRequest +from app.routers import backup as backup_api +from app.routers import content, flows +from app.schemas import BackupIn, FlowIn, FlowPatch, FlowTypeIn, LayerIn, SettingsIn, SystemIn, SystemPatch +from app.seed import FLOWS, SYSTEMS, seed +from app.services import metrics +from app.services.graph import build_graph + + +# ------------------------------------------------------------------ seeding + +def test_seed_is_idempotent(db): + assert seed(db) is False + assert db.execute("SELECT COUNT(*) AS c FROM systems").fetchone()["c"] == len(SYSTEMS) + + +def test_every_flow_endpoint_resolves(db): + rows = db.execute("SELECT * FROM data_flows").fetchall() + keys = {r["key"] for r in db.execute("SELECT key FROM systems").fetchall()} + assert len(rows) == len(FLOWS) + for row in rows: + assert row["source_key"] in keys and row["target_key"] in keys + assert row["source_key"] != row["target_key"] + + +def test_tiers_are_contiguous_and_layered(db): + tiers = {r["tier"] for r in db.execute("SELECT tier FROM systems").fetchall()} + assert min(tiers) == 0 and tiers == set(range(min(tiers), max(tiers) + 1)) + + +# ------------------------------------------------------------------ metrics + +def test_history_backfills_only_flows_without_rows(db): + metrics.ensure_history(db) + first = db.execute("SELECT COUNT(*) AS c FROM flow_metrics").fetchone()["c"] + metrics.ensure_history(db) + assert db.execute("SELECT COUNT(*) AS c FROM flow_metrics").fetchone()["c"] == first + assert first > 0 + + # A newly added link gets its own history rather than rendering dead. + created = flows.create_flow( + FlowIn(source_key="pms", target_key="kingdee", flow_type_id="core", label="新增测试链路"), + db, + FakeRequest(), + ) + metrics.ensure_history(db) + own = db.execute("SELECT COUNT(*) AS c FROM flow_metrics WHERE flow_id = ?", (created["id"],)).fetchone()["c"] + assert own == 24 * 30 + datetime.now().hour + 1 + + +def test_bucket_generation_is_deterministic(db): + metrics.ensure_history(db) + flow = db.execute("SELECT * FROM data_flows WHERE enabled = 1 LIMIT 1").fetchone() + today = date.today() + a = metrics.compute_bucket(dict(flow), today, 10, "seed-x") + b = metrics.compute_bucket(dict(flow), today, 10, "seed-x") + assert a == b + assert metrics.compute_bucket(dict(flow), today, 3, "seed-x")["batches"] <= a["batches"] + 1 + + +def test_live_tick_advances_current_hour(db): + metrics.ensure_history(db) + today = date.today().isoformat() + before = db.execute( + "SELECT COALESCE(SUM(records),0) AS r FROM flow_metrics WHERE day = ?", (today,) + ).fetchone()["r"] + result = metrics.live_tick(db) + after = db.execute( + "SELECT COALESCE(SUM(records),0) AS r FROM flow_metrics WHERE day = ?", (today,) + ).fetchone()["r"] + assert result["touched"] > 0 + assert after > before + + +def test_totals_and_health_shape(db): + metrics.ensure_history(db) + totals = metrics.totals(db, 7) + assert totals["records"] > 0 and totals["avg_latency_ms"] > 0 + health = metrics.flow_health(db, days=7) + assert health and all(h["health"] in {"healthy", "watch", "risk"} for h in health.values()) + + +# ------------------------------------------------------------------ graph + +def test_graph_uses_declared_tiers_as_ranks(db): + metrics.ensure_history(db) + graph = build_graph(db, days=7) + by_key = {n["key"]: n for n in graph["nodes"]} + assert by_key["wecom"]["rank"] == 0, "统一入口层必须留在最左列" + assert all(n["rank"] == n["tier"] for n in graph["nodes"]) + assert {n["health"] for n in graph["nodes"]} <= {"healthy", "watch", "risk", "idle"} + + +def test_graph_edges_carry_animation_inputs(db): + metrics.ensure_history(db) + graph = build_graph(db, days=7) + assert len(graph["edges"]) == len(FLOWS) + for edge in graph["edges"]: + assert edge["color"] and edge["throughput_rps"] >= 0 and edge["payload_mb_per_hour"] >= 0 + assert edge["health"]["state"] in {"healthy", "watch", "risk", "idle"} + + +def test_disabled_flows_are_hidden_by_default(db): + metrics.ensure_history(db) + target = db.execute("SELECT id FROM data_flows LIMIT 1").fetchone()["id"] + flows.update_flow(target, FlowPatch(enabled=False), db, FakeRequest()) + assert len(build_graph(db, days=7)["edges"]) == len(FLOWS) - 1 + assert len(build_graph(db, days=7, include_disabled=True)["edges"]) == len(FLOWS) + + +# ------------------------------------------------------------------ CRUD guards + +def test_system_crud_roundtrip(db): + created = content.create_system(SystemIn(key="demo", name="演示系统", layer_id="base", tier=3), db, FakeRequest()) + assert created["layer_name"] == "底座(基础平台)" + updated = content.update_system("demo", SystemPatch(status="dev", tech="Python"), db, FakeRequest()) + assert updated["status"] == "dev" and updated["tech"] == "Python" + assert content.get_system("demo", db)["name"] == "演示系统" + assert content.delete_system("demo", db, FakeRequest())["ok"] is True + with pytest.raises(HTTPException) as exc: + content.get_system("demo", db) + assert exc.value.status_code == 404 + + +def test_system_validation_rejects_unknown_layer(db): + with pytest.raises(HTTPException) as exc: + content.create_system(SystemIn(key="x1", name="X", layer_id="nope"), db, FakeRequest()) + assert exc.value.status_code == 400 + + +def test_layer_delete_blocked_while_in_use(db): + with pytest.raises(HTTPException) as exc: + content.delete_layer("base", db, FakeRequest()) + assert exc.value.status_code == 409 + + +def test_layer_delete_allowed_once_empty(db): + content.create_layer(LayerIn(id="tmp", name="临时层"), db, FakeRequest()) + assert content.delete_layer("tmp", db, FakeRequest())["ok"] is True + + +def test_duplicate_layer_id_rejected(db): + content.create_layer(LayerIn(id="tmp2", name="临时层2"), db, FakeRequest()) + with pytest.raises(HTTPException) as exc: + content.create_layer(LayerIn(id="tmp2", name="重名"), db, FakeRequest()) + assert exc.value.status_code == 409 + + +def test_flow_rejects_self_loop_and_missing_endpoints(db): + base = dict(flow_type_id="core", label="测试") + with pytest.raises(HTTPException) as exc: + flows.create_flow(FlowIn(source_key="oa", target_key="oa", **base), db, FakeRequest()) + assert exc.value.status_code == 400 + with pytest.raises(HTTPException): + flows.create_flow(FlowIn(source_key="oa", target_key="ghost", **base), db, FakeRequest()) + + +def test_flow_duplicate_rejected(db): + payload = FlowIn(source_key="pms", target_key="kingdee", flow_type_id="core", label="唯一测试链路") + flows.create_flow(payload, db, FakeRequest()) + with pytest.raises(HTTPException) as exc: + flows.create_flow(payload, db, FakeRequest()) + assert exc.value.status_code == 409 + + +def test_flow_patch_normalizes_peak_hours_and_enabled(db): + created = flows.create_flow( + FlowIn(source_key="pms", target_key="nas", flow_type_id="archive", label="测试归档", + peak_hours=[30, 9, 9, 8]), + db, FakeRequest(), + ) + assert created["peak_hours"] == [8, 9] + patched = flows.update_flow(created["id"], FlowPatch(enabled=False, peak_hours=[25, 7]), db, FakeRequest()) + assert patched["enabled"] is False and patched["peak_hours"] == [7] + + +def test_flow_type_delete_blocked_while_in_use(db): + with pytest.raises(HTTPException) as exc: + content.delete_flow_type("core", db, FakeRequest()) + assert exc.value.status_code == 409 + + +def test_flow_type_crud(db): + content.create_flow_type(FlowTypeIn(id="batch", name="批处理", line_style="dotted"), db, FakeRequest()) + row = content.update_flow_type("batch", FlowTypeIn(id="batch", name="批处理2"), db, FakeRequest()) + assert row["name"] == "批处理2" + assert content.delete_flow_type("batch", db, FakeRequest())["ok"] is True + + +def test_settings_patch_partial(db): + updated = content.patch_settings(SettingsIn(site_title="新标题"), db, FakeRequest()) + assert updated["site_title"] == "新标题" + assert "animation_speed" in updated, "未提交的配置项必须保留" + + +def test_audit_records_editor_identity(db): + content.create_system(SystemIn(key="audited", name="审计系统"), db, FakeRequest()) + logs = db.execute("SELECT * FROM audit_logs ORDER BY id DESC LIMIT 1").fetchone() + assert logs["actor"] == "测试员" and logs["action"] == "create" + + +# ------------------------------------------------------------------ backup + +def test_backup_roundtrip_preserves_counts(db): + metrics.ensure_history(db) + payload = backup_api.export_backup(db) + assert payload["systems"] and payload["data_flows"] + + imported = backup_api.import_backup( + BackupIn(**{**payload, "mode": "merge"}), db, FakeRequest() + ) + assert imported["errors"] == [] + assert imported["imported"]["systems"] == len(SYSTEMS) + # Merging the same ids must not duplicate rows. + assert db.execute("SELECT COUNT(*) AS c FROM data_flows").fetchone()["c"] == len(FLOWS) + # Metrics stay attached because the ids were preserved. + assert db.execute("SELECT COUNT(*) AS c FROM flow_metrics").fetchone()["c"] > 0 + + +def test_backup_replace_wipes_and_restores(db): + payload = backup_api.export_backup(db) + payload["systems"] = [s for s in payload["systems"] if s["key"] in {"oa", "pms"}] + result = backup_api.import_backup(BackupIn(**{**payload, "mode": "replace"}), db, FakeRequest()) + assert db.execute("SELECT COUNT(*) AS c FROM systems").fetchone()["c"] == 2 + # Only the link whose endpoints both survived is restored; the rest are rejected + # rather than silently imported against missing systems. + surviving = db.execute("SELECT source_key, target_key FROM data_flows").fetchall() + assert [(r["source_key"], r["target_key"]) for r in surviving] == [("pms", "oa")] + assert any("端点系统不存在" in e for e in result["errors"]) + # A replace wipes history too, so metrics are rebuilt from the restored cadence. + metrics.ensure_history(db) + assert db.execute("SELECT COUNT(*) AS c FROM flow_metrics").fetchone()["c"] == 24 * 30 + datetime.now().hour + 1 + + +def test_backup_rejects_empty_payload(db): + with pytest.raises(HTTPException) as exc: + backup_api.import_backup(BackupIn(), db, FakeRequest()) + assert exc.value.status_code == 400 + + +# ------------------------------------------------------------------ threading + +def test_request_connection_works_across_threadpool_threads(tmp_path, monkeypatch): + """FastAPI resolves a sync dependency on one threadpool worker and runs the + endpoint body on another. The request-scoped connection is created in the + dependency, so it must tolerate being used from a different thread; sqlite's + default same-thread guard otherwise raises ProgrammingError on every request. + """ + import threading + + monkeypatch.setenv("DB_PATH", str(tmp_path / "thread.db")) + from app import config + + monkeypatch.setattr(config, "db_path", lambda: tmp_path / "thread.db") + from app.db import connect, init_db, get_db + from app.seed import seed + + init_db() + bootstrap = connect() + seed(bootstrap) + bootstrap.close() + + # The dependency yields the connection. Keep a reference to the generator itself, + # otherwise it is finalized immediately and closes the connection underneath us. + dependency = get_db() + connection = next(dependency) + errors: list[BaseException] = [] + done = threading.Event() + + # ...and the endpoint body consumes it on a foreign thread. + def worker(): + try: + assert connection.execute("SELECT COUNT(*) AS c FROM systems").fetchone()["c"] == len(SYSTEMS) + except BaseException as exc: # noqa: BLE001 - surfaced below as a test failure + errors.append(exc) + finally: + done.set() + + thread = threading.Thread(target=worker) + thread.start() + thread.join(timeout=10) + assert done.is_set(), "worker thread did not finish" + assert not errors, f"connection rejected on foreign thread: {errors!r}" + next(dependency, None) + + +# ------------------------------------------------------------------ actor header + +def test_actor_header_is_percent_decoded(): + """HTTP headers cannot carry Chinese text, so the client percent-encodes the + editor name; the audit trail must still record the readable name.""" + from app.deps import actor_from + + class Headers: + def __init__(self, value): + self._value = value + + def get(self, key, default=""): + return self._value if key.lower() in ("x-editor", "x-actor") else default + + assert actor_from(type("R", (), {"headers": Headers("%E5%BA%B7%E6%96%87%E6%99%B6")})()) == "康文晶" + assert actor_from(type("R", (), {"headers": Headers("alice")})()) == "alice" + assert actor_from(type("R", (), {"headers": Headers("")})()) == "匿名" + # Malformed escapes decode leniently rather than raising. + assert actor_from(type("R", (), {"headers": Headers("%%%E4%B8%AD")})()) == "%%中" + # Invalid UTF-8 byte escapes fall back to the raw header instead of 500ing. + assert actor_from(type("R", (), {"headers": Headers("%FF%FE")})()) == "%FF%FE" + + +def test_impl_time_and_entry_flag_survive_backup_roundtrip(db): + metrics.ensure_history(db) + content.update_system( + "oa", + SystemPatch(impl_time="2024-06 上线", entry_enabled=False, url="https://oa.example.com"), + db, + FakeRequest(), + ) + payload = backup_api.export_backup(db) + db.execute("UPDATE systems SET impl_time = '', entry_enabled = 1, url = '' WHERE key = 'oa'") + + backup_api.import_backup(BackupIn(**{**payload, "mode": "merge"}), db, FakeRequest()) + row = db.execute("SELECT impl_time, entry_enabled, url FROM systems WHERE key = 'oa'").fetchone() + assert (row["impl_time"], row["entry_enabled"], row["url"]) == ("2024-06 上线", 0, "https://oa.example.com") + + +def test_graph_nodes_expose_impl_time_and_entry_flag(db): + content.update_system("oa", SystemPatch(impl_time="2023 Q4 立项", entry_enabled=False), db, FakeRequest()) + node = next(n for n in build_graph(db)["nodes"] if n["key"] == "oa") + assert node["impl_time"] == "2023 Q4 立项" + assert node["entry_enabled"] is False + + +def test_read_only_lock_blocks_service_level_writes(db): + """The same switch guards the service functions, not only the HTTP layer.""" + from app.deps import ensure_editable + from app.schemas import SettingsIn + + content.patch_settings(SettingsIn(editing_enabled=False), db, FakeRequest()) + with pytest.raises(HTTPException) as exc: + ensure_editable(db, "新增系统") + assert exc.value.status_code == 423 and "只读" in exc.value.detail + + content.patch_settings(SettingsIn(editing_enabled=True), db, FakeRequest()) + ensure_editable(db) # must not raise + + +def test_manual_layout_columns_are_added_to_older_databases(tmp_path, monkeypatch): + """flow_x/flow_y arrived after the first release; old files must gain them in place.""" + import sqlite3 + + from app import config + from app.db import init_db + + path = tmp_path / "legacy.db" + legacy = sqlite3.connect(path) + legacy.executescript( + """ + CREATE TABLE systems ( + id INTEGER PRIMARY KEY AUTOINCREMENT, key TEXT NOT NULL UNIQUE, name TEXT NOT NULL, + layer_id TEXT, dept TEXT NOT NULL DEFAULT '', status TEXT NOT NULL DEFAULT 'unknown', + tech TEXT NOT NULL DEFAULT '', url TEXT NOT NULL DEFAULT '', domain TEXT NOT NULL DEFAULT '', + owner TEXT NOT NULL DEFAULT '', description TEXT NOT NULL DEFAULT '', + tier INTEGER NOT NULL DEFAULT 2, sort_order INTEGER NOT NULL DEFAULT 0, + created_at TEXT NOT NULL DEFAULT '', updated_at TEXT NOT NULL DEFAULT '' + ); + INSERT INTO systems (key, name) VALUES ('oa', 'OA'); + """ + ) + legacy.commit() + legacy.close() + + monkeypatch.setenv("DB_PATH", str(path)) + monkeypatch.setattr(config, "db_path", lambda: path) + init_db() + init_db() # migrating twice must not fail + + conn = sqlite3.connect(path) + columns = {row[1] for row in conn.execute("PRAGMA table_info(systems)")} + assert {"flow_x", "flow_y", "impl_time", "entry_enabled"} <= columns + assert conn.execute("SELECT COUNT(*) FROM systems").fetchone()[0] == 1 + conn.close() + + +def test_tier_label_covers_every_configured_column(): + from app.services.graph import TIER_LABELS, tier_label + + assert len(TIER_LABELS) == 4 + assert tier_label(0) == "统一入口层" + assert tier_label(7).startswith("第 8 层") + + +def test_migrate_survives_losing_an_add_column_race(tmp_path, monkeypatch): + """Two processes boot at once; the one that loses the ALTER must still start. + + That is exactly what happened when both servers came up against the same file: the + losing connection still saw the column as missing, then hit `duplicate column name`. + """ + import sqlite3 + + path = tmp_path / "race.db" + monkeypatch.setenv("DB_PATH", str(path)) + from app import config + + monkeypatch.setattr(config, "db_path", lambda: path) + from app.db import init_db, migrate + + init_db() + + class Blind: + """Connection view frozen before the other process added the columns.""" + + def __init__(self, conn: sqlite3.Connection) -> None: + self.conn = conn + + def execute(self, sql: str): + if sql.startswith("PRAGMA table_info"): + return iter(()) + return self.conn.execute(sql) + + conn = sqlite3.connect(path) + migrate(Blind(conn)) # must not raise + conn.close() diff --git a/dev.sh b/dev.sh new file mode 100755 index 0000000..701f3b5 --- /dev/null +++ b/dev.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# 开发模式:后端 8787(热重载)+ 前端 5273(HMR,已代理 /api 到后端)。 +set -euo pipefail +cd "$(dirname "$0")" + +export DB_PATH="${DB_PATH:-$PWD/backend/panorama.db}" +export RELOAD=1 + +cleanup() { kill 0 2>/dev/null || true; } +trap cleanup EXIT INT TERM + +echo "==> 后端 http://localhost:8787 (API 文档 /docs)" +(cd backend && python3 -m uvicorn app.main:app --host 0.0.0.0 --port 8787 --reload) & + +[ -d frontend/node_modules ] || (cd frontend && npm install --no-audit --no-fund) + +echo "==> 前端 http://localhost:5273" +(cd frontend && npm run dev) diff --git a/frontend/index.html b/frontend/index.html new file mode 100644 index 0000000..c353dd8 --- /dev/null +++ b/frontend/index.html @@ -0,0 +1,13 @@ + + + + + + + 公司 IT 系统全景与数据流向平台 + + +
+ + + diff --git a/frontend/node_modules/.bin/autoprefixer b/frontend/node_modules/.bin/autoprefixer new file mode 120000 index 0000000..e876d81 --- /dev/null +++ b/frontend/node_modules/.bin/autoprefixer @@ -0,0 +1 @@ +../autoprefixer/bin/autoprefixer \ No newline at end of file diff --git a/frontend/node_modules/.bin/baseline-browser-mapping b/frontend/node_modules/.bin/baseline-browser-mapping new file mode 120000 index 0000000..8e9a12d --- /dev/null +++ b/frontend/node_modules/.bin/baseline-browser-mapping @@ -0,0 +1 @@ +../baseline-browser-mapping/dist/cli.cjs \ No newline at end of file diff --git a/frontend/node_modules/.bin/browserslist b/frontend/node_modules/.bin/browserslist new file mode 120000 index 0000000..3cd991b --- /dev/null +++ b/frontend/node_modules/.bin/browserslist @@ -0,0 +1 @@ +../browserslist/cli.js \ No newline at end of file diff --git a/frontend/node_modules/.bin/cssesc b/frontend/node_modules/.bin/cssesc new file mode 120000 index 0000000..487b689 --- /dev/null +++ b/frontend/node_modules/.bin/cssesc @@ -0,0 +1 @@ +../cssesc/bin/cssesc \ No newline at end of file diff --git a/frontend/node_modules/.bin/esbuild b/frontend/node_modules/.bin/esbuild new file mode 120000 index 0000000..c83ac07 --- /dev/null +++ b/frontend/node_modules/.bin/esbuild @@ -0,0 +1 @@ +../esbuild/bin/esbuild \ No newline at end of file diff --git a/frontend/node_modules/.bin/he b/frontend/node_modules/.bin/he new file mode 120000 index 0000000..2a8eb5e --- /dev/null +++ b/frontend/node_modules/.bin/he @@ -0,0 +1 @@ +../he/bin/he \ No newline at end of file diff --git a/frontend/node_modules/.bin/jiti b/frontend/node_modules/.bin/jiti new file mode 120000 index 0000000..031ee3f --- /dev/null +++ b/frontend/node_modules/.bin/jiti @@ -0,0 +1 @@ +../jiti/bin/jiti.js \ No newline at end of file diff --git a/frontend/node_modules/.bin/nanoid b/frontend/node_modules/.bin/nanoid new file mode 120000 index 0000000..e2be547 --- /dev/null +++ b/frontend/node_modules/.bin/nanoid @@ -0,0 +1 @@ +../nanoid/bin/nanoid.cjs \ No newline at end of file diff --git a/frontend/node_modules/.bin/parser b/frontend/node_modules/.bin/parser new file mode 120000 index 0000000..ce7bf97 --- /dev/null +++ b/frontend/node_modules/.bin/parser @@ -0,0 +1 @@ +../@babel/parser/bin/babel-parser.js \ No newline at end of file diff --git a/frontend/node_modules/.bin/resolve b/frontend/node_modules/.bin/resolve new file mode 120000 index 0000000..b6afda6 --- /dev/null +++ b/frontend/node_modules/.bin/resolve @@ -0,0 +1 @@ +../resolve/bin/resolve \ No newline at end of file diff --git a/frontend/node_modules/.bin/rollup b/frontend/node_modules/.bin/rollup new file mode 120000 index 0000000..5939621 --- /dev/null +++ b/frontend/node_modules/.bin/rollup @@ -0,0 +1 @@ +../rollup/dist/bin/rollup \ No newline at end of file diff --git a/frontend/node_modules/.bin/sucrase b/frontend/node_modules/.bin/sucrase new file mode 120000 index 0000000..0ac7e77 --- /dev/null +++ b/frontend/node_modules/.bin/sucrase @@ -0,0 +1 @@ +../sucrase/bin/sucrase \ No newline at end of file diff --git a/frontend/node_modules/.bin/sucrase-node b/frontend/node_modules/.bin/sucrase-node new file mode 120000 index 0000000..8b96fae --- /dev/null +++ b/frontend/node_modules/.bin/sucrase-node @@ -0,0 +1 @@ +../sucrase/bin/sucrase-node \ No newline at end of file diff --git a/frontend/node_modules/.bin/tailwind b/frontend/node_modules/.bin/tailwind new file mode 120000 index 0000000..d497797 --- /dev/null +++ b/frontend/node_modules/.bin/tailwind @@ -0,0 +1 @@ +../tailwindcss/lib/cli.js \ No newline at end of file diff --git a/frontend/node_modules/.bin/tailwindcss b/frontend/node_modules/.bin/tailwindcss new file mode 120000 index 0000000..d497797 --- /dev/null +++ b/frontend/node_modules/.bin/tailwindcss @@ -0,0 +1 @@ +../tailwindcss/lib/cli.js \ No newline at end of file diff --git a/frontend/node_modules/.bin/tsc b/frontend/node_modules/.bin/tsc new file mode 120000 index 0000000..0863208 --- /dev/null +++ b/frontend/node_modules/.bin/tsc @@ -0,0 +1 @@ +../typescript/bin/tsc \ No newline at end of file diff --git a/frontend/node_modules/.bin/tsserver b/frontend/node_modules/.bin/tsserver new file mode 120000 index 0000000..f8f8f1a --- /dev/null +++ b/frontend/node_modules/.bin/tsserver @@ -0,0 +1 @@ +../typescript/bin/tsserver \ No newline at end of file diff --git a/frontend/node_modules/.bin/update-browserslist-db b/frontend/node_modules/.bin/update-browserslist-db new file mode 120000 index 0000000..b11e16f --- /dev/null +++ b/frontend/node_modules/.bin/update-browserslist-db @@ -0,0 +1 @@ +../update-browserslist-db/cli.js \ No newline at end of file diff --git a/frontend/node_modules/.bin/vite b/frontend/node_modules/.bin/vite new file mode 120000 index 0000000..6d1e3be --- /dev/null +++ b/frontend/node_modules/.bin/vite @@ -0,0 +1 @@ +../vite/bin/vite.js \ No newline at end of file diff --git a/frontend/node_modules/.bin/vue-demi-fix b/frontend/node_modules/.bin/vue-demi-fix new file mode 120000 index 0000000..547c76f --- /dev/null +++ b/frontend/node_modules/.bin/vue-demi-fix @@ -0,0 +1 @@ +../vue-demi/bin/vue-demi-fix.js \ No newline at end of file diff --git a/frontend/node_modules/.bin/vue-demi-switch b/frontend/node_modules/.bin/vue-demi-switch new file mode 120000 index 0000000..3db0c0c --- /dev/null +++ b/frontend/node_modules/.bin/vue-demi-switch @@ -0,0 +1 @@ +../vue-demi/bin/vue-demi-switch.js \ No newline at end of file diff --git a/frontend/node_modules/.bin/vue-tsc b/frontend/node_modules/.bin/vue-tsc new file mode 120000 index 0000000..dac82d9 --- /dev/null +++ b/frontend/node_modules/.bin/vue-tsc @@ -0,0 +1 @@ +../vue-tsc/bin/vue-tsc.js \ No newline at end of file diff --git a/frontend/node_modules/.package-lock.json b/frontend/node_modules/.package-lock.json new file mode 100644 index 0000000..15ac6f9 --- /dev/null +++ b/frontend/node_modules/.package-lock.json @@ -0,0 +1,2950 @@ +{ + "name": "it-panorama-frontend", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "node_modules/@alloc/quick-lru": { + "version": "5.3.0", + "resolved": "https://registry.npmmirror.com/@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/helper-string-parser": { + "version": "7.29.7", + "resolved": "https://registry.npmmirror.com/@babel/helper-string-parser/-/helper-string-parser-7.29.7.tgz", + "integrity": "sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.29.7", + "resolved": "https://registry.npmmirror.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz", + "integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.29.9", + "resolved": "https://registry.npmmirror.com/@babel/parser/-/parser-7.29.9.tgz", + "integrity": "sha512-CjXrNHTnvqBVqHgdBysY3vk2T8tpJHb5/RMeHJBTyVa9xgugCB0CJTx/3oO8RV2QRQP391RWpB7D6hLjm8V9uA==", + "license": "MIT", + "dependencies": { + "@babel/types": "^7.29.8" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/types": { + "version": "7.29.8", + "resolved": "https://registry.npmmirror.com/@babel/types/-/types-7.29.8.tgz", + "integrity": "sha512-Vj1jF3cPfxg7OAfoI7QnVKLoILlm2JF9pnVHrX8qx7AHMiYWT+NDAA7jChlNgRS4WTLc/fD1lXLmPixluj+3Gg==", + "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.npmmirror.com/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "ideallyInert": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "cpu": [ + "arm" + ], + "dev": true, + "ideallyInert": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "ideallyInert": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "cpu": [ + "x64" + ], + "dev": true, + "ideallyInert": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@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.npmmirror.com/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "cpu": [ + "x64" + ], + "dev": true, + "ideallyInert": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "cpu": [ + "arm64" + ], + "dev": true, + "ideallyInert": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "cpu": [ + "x64" + ], + "dev": true, + "ideallyInert": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "cpu": [ + "arm" + ], + "dev": true, + "ideallyInert": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "ideallyInert": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "cpu": [ + "ia32" + ], + "dev": true, + "ideallyInert": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "cpu": [ + "loong64" + ], + "dev": true, + "ideallyInert": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "ideallyInert": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "ideallyInert": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "ideallyInert": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "cpu": [ + "s390x" + ], + "dev": true, + "ideallyInert": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "cpu": [ + "x64" + ], + "dev": true, + "ideallyInert": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "cpu": [ + "x64" + ], + "dev": true, + "ideallyInert": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "cpu": [ + "x64" + ], + "dev": true, + "ideallyInert": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "cpu": [ + "x64" + ], + "dev": true, + "ideallyInert": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "cpu": [ + "arm64" + ], + "dev": true, + "ideallyInert": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "ideallyInert": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "cpu": [ + "x64" + ], + "dev": true, + "ideallyInert": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmmirror.com/@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/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmmirror.com/@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.npmmirror.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz", + "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==", + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmmirror.com/@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.npmmirror.com/@napi-rs/lzma-linux-x64-gnu/-/lzma-linux-x64-gnu-1.5.1.tgz", + "integrity": "sha512-oTXEIha4SsuXdTA4Iyskj0kpdx2yVXdhd75c2v3xGrHFfVMsbhTPZU/nMPL4sWKo4pBHm3aucLaqGlF696dTyQ==", + "cpu": [ + "x64" + ], + "dev": true, + "ideallyInert": true, + "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.npmmirror.com/@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.npmmirror.com/@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.npmmirror.com/@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/@rollup/rollup-android-arm-eabi": { + "version": "4.64.4", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.64.4.tgz", + "integrity": "sha512-7sdQKCYk/JCWa7rlXOgIa7AEAfZnUu/twNX4m4ECouPWsYhzxHfslKCFpOs43J8uux356TUU8NCuQus3XISCbQ==", + "cpu": [ + "arm" + ], + "dev": true, + "ideallyInert": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.64.4", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.64.4.tgz", + "integrity": "sha512-iV5jlPMChTQgD0UCTcT9rLHN4DNce34v5Mw0IN7csTSg4RDaKq9AximXPL35k+sGXcfrR4OeQMvFNe+OmV1rhw==", + "cpu": [ + "arm64" + ], + "dev": true, + "ideallyInert": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.64.4", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.64.4.tgz", + "integrity": "sha512-a0Sswc+5v8BVkjHGOaJCTbFArZZUJCGFi2y39FWGdiplOToMNzr1tE4v3l67DW+vGyYD2sS5PfhDdUCyrr3mjA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.64.4", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.64.4.tgz", + "integrity": "sha512-qHH6RSwVPuNkqbOv0hgZKonHBW/ZIaHpd3bgH5LRPJ/8oRE+6Dl36OfS7wUQyeSeqQsAh1NrpwmUemgH1fh1WQ==", + "cpu": [ + "x64" + ], + "dev": true, + "ideallyInert": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.64.4", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.64.4.tgz", + "integrity": "sha512-hs9CVjHH9WPGfeHZ5yvHYEiEm7hhm7M/16ytRTxrir7q+KnGaQ6EO1JYcrGooVIHYN1Z3H7sLIwxe97NNBYg6A==", + "cpu": [ + "arm64" + ], + "dev": true, + "ideallyInert": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.64.4", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.64.4.tgz", + "integrity": "sha512-4UYtjV0FBOToshUTYvwoTbfvig9Ec94EcE56WehhqaFZK43rK9sLNYO+vRMnJ9GTOxanFkKB/IvBKt96VmCYiA==", + "cpu": [ + "x64" + ], + "dev": true, + "ideallyInert": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.64.4", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.64.4.tgz", + "integrity": "sha512-Md2BnPCGXVtoyaqPCxxahW4f8r5h8e1Iago6LFQRf+b9m8YOnkfW2L9l1KK9UsQa2gXYoVAVTi6mQgkVNSrOuQ==", + "cpu": [ + "arm" + ], + "dev": true, + "ideallyInert": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.64.4", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.64.4.tgz", + "integrity": "sha512-oBAOMLpMKggD7Z9oTZCVUp4dDMa84Br/PV5mm6IL1kykBgk5Kp3gyu2buW8KFzvkktyFj+NdZdZCxpRqNgO71A==", + "cpu": [ + "arm" + ], + "dev": true, + "ideallyInert": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.64.4", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.64.4.tgz", + "integrity": "sha512-KYgCzHJjmFhXb7kPv6ih9c6HdY/4JXr6MmLtWFRmK0hAgXxLBx2tI24J1OYJyFl7DfxnzREWSLDj3FxKHfPHjQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "ideallyInert": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.64.4", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.64.4.tgz", + "integrity": "sha512-xpeOpK+6OQfqZL3HQ1leCKM/JFZz0BmpVGkeydWRBdjYYgDlry7a2RWZ0rxnoJ29wMUK/xa/e1CSnnjV7UnxBw==", + "cpu": [ + "arm64" + ], + "dev": true, + "ideallyInert": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-gnu": { + "version": "4.64.4", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.64.4.tgz", + "integrity": "sha512-Iju/GGedDha6/e8lseZIxO2i3xPg+aJFw+l07QijRsEkGiUzQbsdNGaouTZwa6N1nu4q9WVJUbc/ejwPN24i+Q==", + "cpu": [ + "loong64" + ], + "dev": true, + "ideallyInert": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-musl": { + "version": "4.64.4", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.64.4.tgz", + "integrity": "sha512-v3fNKbpq8uHqlMayTSaRCX9GVa/OECoY5beetD1qa5MKeRmrlgWve98UpcxgQAqGKQpqhcflDAe1AvjIUMenWQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "ideallyInert": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-gnu": { + "version": "4.64.4", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.64.4.tgz", + "integrity": "sha512-ngxCMEz/wPVGkB/Fx7yGW8LkkL1mtg/V/KOYZQytTUe/MCh/w3nsvS0CnjhdS6YEJb98StA2aUnPaQZte0uCZg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "ideallyInert": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-musl": { + "version": "4.64.4", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.64.4.tgz", + "integrity": "sha512-ob/5q9wu+GPAIJvqOzcr0tUo7vIuczYoVmxgfCjbSCE2zwbi/rxkR35b/fnQKGrI5fCua7ULhnB7w7wHseLlNQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "ideallyInert": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.64.4", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.64.4.tgz", + "integrity": "sha512-FsFK/3sO22/ogdbJ1TtWFyZAfru07l+4ya1OHn0L7renzB7qoQp0gaaTya7zKezubV5OoG9mSek1Z4qcT5rdew==", + "cpu": [ + "riscv64" + ], + "dev": true, + "ideallyInert": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-musl": { + "version": "4.64.4", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.64.4.tgz", + "integrity": "sha512-id50wkt+Jt20/66TkMr04OXdUB64Sj4W3WVhMVf/KuTiy5NFQLGgmCwE0RBobDPr22zyKxEE1U6zMAeBTgnZaQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "ideallyInert": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.64.4", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.64.4.tgz", + "integrity": "sha512-WinoPEOOZz+rKnluSytyemucpXtygq1LJaU+HBxclUXPz7IVBJIjcdDH9V4nN/yvYjyiVeb/fH32HSX2acLmrw==", + "cpu": [ + "s390x" + ], + "dev": true, + "ideallyInert": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.64.4", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.64.4.tgz", + "integrity": "sha512-Fs5AqGrSuvXIPSGpZQAUHyM+7eRpKkWvIxN8eTf/8hoTCiKybb2FeqBnB5R9OyVOYI3/vP+VgSBOHT1zkYkKSA==", + "cpu": [ + "x64" + ], + "dev": true, + "ideallyInert": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.64.4", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.64.4.tgz", + "integrity": "sha512-EdzYVEpaQG2YSRW/qi/uHcersoPi119NmUK/hgBQJdAZvk7HjlSKHsBWQvofZ8ZoL98R9SUNJUAtBwRlAsZ7WA==", + "cpu": [ + "x64" + ], + "dev": true, + "ideallyInert": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-openbsd-x64": { + "version": "4.64.4", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.64.4.tgz", + "integrity": "sha512-FZarHZsoTVzvMfCS0hDWcybs+VvkC5TPEYREZhuyD93GGMBBYKa413z2zUsXJEGU7hHJ7EEr4mUUMV1WfHIVmA==", + "cpu": [ + "x64" + ], + "dev": true, + "ideallyInert": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ] + }, + "node_modules/@rollup/rollup-openharmony-arm64": { + "version": "4.64.4", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.64.4.tgz", + "integrity": "sha512-A+nCwcEGR1r2MET1kikO4O9nkq6bjpA4gGwZiyZ8CsL3FMqPvh4OREYyZHv/WJjl8eCgfUqh9dFUc01qBOUOgQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "ideallyInert": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.64.4", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.64.4.tgz", + "integrity": "sha512-9dS3eF2HL38ItWUF6wbStGGoLALgh3e+BbBfq5VEAm/NKhnEibz/B+D719uTET83+E1lZL2TKlv6idlzOorrgA==", + "cpu": [ + "arm64" + ], + "dev": true, + "ideallyInert": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.64.4", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.64.4.tgz", + "integrity": "sha512-n2waAp+bsaATQlfM0dSsFWG+Juj3GBGYI5MS4prChfjn3z+PvijnWZT9FmRtcK6Db0F4rfGzMJUP5VENvb7wig==", + "cpu": [ + "ia32" + ], + "dev": true, + "ideallyInert": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-gnu": { + "version": "4.64.4", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.64.4.tgz", + "integrity": "sha512-kXMhVM8CVi/jRZAN8+SPVTdd1kl71WCVAajeu5JaVwsmjmAO40MiEj4QBDJeoWkLICE3b7jnRQK/mBQyhh0BCw==", + "cpu": [ + "x64" + ], + "dev": true, + "ideallyInert": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.64.4", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.64.4.tgz", + "integrity": "sha512-OWiFOGLjX+ZPsRJjo9yQpU3rq5wBNxyPjB9Sc6PmSPVQgUKVSHQu2zR5y1YkZ+HFzy4rHfYhwnT2PQSUgatnJA==", + "cpu": [ + "x64" + ], + "dev": true, + "ideallyInert": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@types/estree": { + "version": "1.0.9", + "resolved": "https://registry.npmmirror.com/@types/estree/-/estree-1.0.9.tgz", + "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "20.19.43", + "resolved": "https://registry.npmmirror.com/@types/node/-/node-20.19.43.tgz", + "integrity": "sha512-6oYBAi5ikg4Pl+kGsoYtawUMBT2zZMCvPNF7pVLnHZfd1zf38DRiWn/gT01RYCdUqkv7Fhr+C9ot4/tb+2sVvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.21.0" + } + }, + "node_modules/@types/web-bluetooth": { + "version": "0.0.20", + "resolved": "https://registry.npmmirror.com/@types/web-bluetooth/-/web-bluetooth-0.0.20.tgz", + "integrity": "sha512-g9gZnnXVq7gM7v3tJCWV/qw7w+KeOlSHAhgF9RytFyifW6AF61hdT2ucrYhPq9hLs5JIryeupHV3qGk95dH9ow==", + "license": "MIT" + }, + "node_modules/@vitejs/plugin-vue": { + "version": "5.2.4", + "resolved": "https://registry.npmmirror.com/@vitejs/plugin-vue/-/plugin-vue-5.2.4.tgz", + "integrity": "sha512-7Yx/SXSOcQq5HiiV3orevHUFn+pmMB4cgbEkDYgnkUWb0WfeQ/wa2yFv6D5ICiCQOVpjA7vYDXrC7AGO8yjDHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "peerDependencies": { + "vite": "^5.0.0 || ^6.0.0", + "vue": "^3.2.25" + } + }, + "node_modules/@volar/language-core": { + "version": "2.4.15", + "resolved": "https://registry.npmmirror.com/@volar/language-core/-/language-core-2.4.15.tgz", + "integrity": "sha512-3VHw+QZU0ZG9IuQmzT68IyN4hZNd9GchGPhbD9+pa8CVv7rnoOZwo7T8weIbrRmihqy3ATpdfXFnqRrfPVK6CA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@volar/source-map": "2.4.15" + } + }, + "node_modules/@volar/source-map": { + "version": "2.4.15", + "resolved": "https://registry.npmmirror.com/@volar/source-map/-/source-map-2.4.15.tgz", + "integrity": "sha512-CPbMWlUN6hVZJYGcU/GSoHu4EnCHiLaXI9n8c9la6RaI9W5JHX+NqG+GSQcB0JdC2FIBLdZJwGsfKyBB71VlTg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@volar/typescript": { + "version": "2.4.15", + "resolved": "https://registry.npmmirror.com/@volar/typescript/-/typescript-2.4.15.tgz", + "integrity": "sha512-2aZ8i0cqPGjXb4BhkMsPYDkkuc2ZQ6yOpqwAuNwUoncELqoy5fRgOQtLR9gB0g902iS0NAkvpIzs27geVyVdPg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@volar/language-core": "2.4.15", + "path-browserify": "^1.0.1", + "vscode-uri": "^3.0.8" + } + }, + "node_modules/@vue/compiler-core": { + "version": "3.5.43", + "resolved": "https://registry.npmmirror.com/@vue/compiler-core/-/compiler-core-3.5.43.tgz", + "integrity": "sha512-zdiLhnbe1QQqgDT8xZMpNmyqZ3qlI+/Q/FHQco57Kwl/b05HhCzN6eVGN9QU9rbga4CrS0H5SYY8VGHZCt/1Hg==", + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.29.8", + "@vue/shared": "3.5.43", + "entities": "^7.0.1", + "estree-walker": "^2.0.2", + "source-map-js": "^1.2.1" + } + }, + "node_modules/@vue/compiler-dom": { + "version": "3.5.43", + "resolved": "https://registry.npmmirror.com/@vue/compiler-dom/-/compiler-dom-3.5.43.tgz", + "integrity": "sha512-PEZoAk3NQmsn/ejMzSOCyTYqwGqczrWm70PuhBKjjv1+TCoQAaO/zOqNwjV+honlNstT5ILxtc+8r8UUfj+iEQ==", + "license": "MIT", + "dependencies": { + "@vue/compiler-core": "3.5.43", + "@vue/shared": "3.5.43" + } + }, + "node_modules/@vue/compiler-sfc": { + "version": "3.5.43", + "resolved": "https://registry.npmmirror.com/@vue/compiler-sfc/-/compiler-sfc-3.5.43.tgz", + "integrity": "sha512-FCbrG3XNCRl+js3huuKx4IVHBLTvMkJhVepjbxSPu1gn4yWLaYtGNQdjJGZaMytXB6qb76qQDDmDSLy/vkmleQ==", + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.29.8", + "@vue/compiler-core": "3.5.43", + "@vue/compiler-dom": "3.5.43", + "@vue/compiler-ssr": "3.5.43", + "@vue/shared": "3.5.43", + "estree-walker": "^2.0.2", + "magic-string": "^0.30.21", + "postcss": "^8.5.28", + "source-map-js": "^1.2.1" + } + }, + "node_modules/@vue/compiler-ssr": { + "version": "3.5.43", + "resolved": "https://registry.npmmirror.com/@vue/compiler-ssr/-/compiler-ssr-3.5.43.tgz", + "integrity": "sha512-GF62orf7KiJX9RqrHNGrYBudsQGD0OhJ5nDs90O8UiDuS40+YMYomiXu6w6EuvtXuRDc3MSNis3EaaSKAVSWpg==", + "license": "MIT", + "dependencies": { + "@vue/compiler-dom": "3.5.43", + "@vue/shared": "3.5.43" + } + }, + "node_modules/@vue/compiler-vue2": { + "version": "2.7.16", + "resolved": "https://registry.npmmirror.com/@vue/compiler-vue2/-/compiler-vue2-2.7.16.tgz", + "integrity": "sha512-qYC3Psj9S/mfu9uVi5WvNZIzq+xnXMhOwbTFKKDD7b1lhpnn71jXSFdTQ+WsIEk0ONCd7VV2IMm7ONl6tbQ86A==", + "dev": true, + "license": "MIT", + "dependencies": { + "de-indent": "^1.0.2", + "he": "^1.2.0" + } + }, + "node_modules/@vue/devtools-api": { + "version": "6.6.4", + "resolved": "https://registry.npmmirror.com/@vue/devtools-api/-/devtools-api-6.6.4.tgz", + "integrity": "sha512-sGhTPMuXqZ1rVOk32RylztWkfXTRhuS7vgAKv0zjqk8gbsHkJ7xfFf+jbySxt7tWObEJwyKaHMikV/WGDiQm8g==", + "license": "MIT" + }, + "node_modules/@vue/language-core": { + "version": "2.2.12", + "resolved": "https://registry.npmmirror.com/@vue/language-core/-/language-core-2.2.12.tgz", + "integrity": "sha512-IsGljWbKGU1MZpBPN+BvPAdr55YPkj2nB/TBNGNC32Vy2qLG25DYu/NBN2vNtZqdRbTRjaoYrahLrToim2NanA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@volar/language-core": "2.4.15", + "@vue/compiler-dom": "^3.5.0", + "@vue/compiler-vue2": "^2.7.16", + "@vue/shared": "^3.5.0", + "alien-signals": "^1.0.3", + "minimatch": "^9.0.3", + "muggle-string": "^0.4.1", + "path-browserify": "^1.0.1" + }, + "peerDependencies": { + "typescript": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@vue/reactivity": { + "version": "3.5.43", + "resolved": "https://registry.npmmirror.com/@vue/reactivity/-/reactivity-3.5.43.tgz", + "integrity": "sha512-G/c9GyOZNI2jVaaS6OX1EF1SSFSv7H0ERqNTl4+DTFMlZmB5eVAB53aLQNam/7NL2NPtaDD7RdVrzf8uJzMuOA==", + "license": "MIT", + "dependencies": { + "@vue/shared": "3.5.43" + } + }, + "node_modules/@vue/runtime-core": { + "version": "3.5.43", + "resolved": "https://registry.npmmirror.com/@vue/runtime-core/-/runtime-core-3.5.43.tgz", + "integrity": "sha512-hU6U6VnVhBGQDpvlnnDlIB8ZGJBiOcgk2lh/0InltHiz3D8oSkluvuvY+do1G2H3+udeKFsmaBlgVYP7gXQzEw==", + "license": "MIT", + "dependencies": { + "@vue/reactivity": "3.5.43", + "@vue/shared": "3.5.43" + } + }, + "node_modules/@vue/runtime-dom": { + "version": "3.5.43", + "resolved": "https://registry.npmmirror.com/@vue/runtime-dom/-/runtime-dom-3.5.43.tgz", + "integrity": "sha512-Bb2Jc0YjjJdMt1SJmb9b2L/IWd3I8lIT9x9eS/xvvP9CiVgna0ffua74xKRmt4/uSJ+0r4iN8ex1jrqkhQGWQw==", + "license": "MIT", + "dependencies": { + "@vue/reactivity": "3.5.43", + "@vue/runtime-core": "3.5.43", + "@vue/shared": "3.5.43", + "csstype": "^3.2.3" + } + }, + "node_modules/@vue/server-renderer": { + "version": "3.5.43", + "resolved": "https://registry.npmmirror.com/@vue/server-renderer/-/server-renderer-3.5.43.tgz", + "integrity": "sha512-l2Ygjv9NehV94PSBxNWsAHC0j/eIIKbn92mBuWXAPGLnn6HfJ6MH5ubsd+Nk0YoZ5FRuxWI1P2VSoh+dbPQhCQ==", + "license": "MIT", + "dependencies": { + "@vue/compiler-ssr": "3.5.43", + "@vue/runtime-dom": "3.5.43", + "@vue/shared": "3.5.43" + } + }, + "node_modules/@vue/shared": { + "version": "3.5.43", + "resolved": "https://registry.npmmirror.com/@vue/shared/-/shared-3.5.43.tgz", + "integrity": "sha512-uksS7YGMR5NZyr4JNq0Rp+QyLns0ueaz20KwzIPW9R0LH1Vnt4E+XUM29PNseEbf1www2gOuhuDi5AKOIXag9Q==", + "license": "MIT" + }, + "node_modules/@vueuse/core": { + "version": "10.11.1", + "resolved": "https://registry.npmmirror.com/@vueuse/core/-/core-10.11.1.tgz", + "integrity": "sha512-guoy26JQktXPcz+0n3GukWIy/JDNKti9v6VEMu6kV2sYBsWuGiTU8OWdg+ADfUbHg3/3DlqySDe7JmdHrktiww==", + "license": "MIT", + "dependencies": { + "@types/web-bluetooth": "^0.0.20", + "@vueuse/metadata": "10.11.1", + "@vueuse/shared": "10.11.1", + "vue-demi": ">=0.14.8" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/@vueuse/metadata": { + "version": "10.11.1", + "resolved": "https://registry.npmmirror.com/@vueuse/metadata/-/metadata-10.11.1.tgz", + "integrity": "sha512-IGa5FXd003Ug1qAZmyE8wF3sJ81xGLSqTqtQ6jaVfkeZ4i5kS2mwQF61yhVqojRnenVew5PldLyRgvdl4YYuSw==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/@vueuse/shared": { + "version": "10.11.1", + "resolved": "https://registry.npmmirror.com/@vueuse/shared/-/shared-10.11.1.tgz", + "integrity": "sha512-LHpC8711VFZlDaYUXEBbFBCQ7GS3dVU9mjOhhMhXP6txTV4EhYQg/KGnQuvt/sPAtoUKq7VVUnL6mVtFoL42sA==", + "license": "MIT", + "dependencies": { + "vue-demi": ">=0.14.8" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmmirror.com/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/alien-signals": { + "version": "1.0.13", + "resolved": "https://registry.npmmirror.com/alien-signals/-/alien-signals-1.0.13.tgz", + "integrity": "sha512-OGj9yyTnJEttvzhTUWuscOvtqxq5vrhF7vL9oS0xJ2mK0ItPYP1/y+vCFebfxoEyAz0++1AIwJ5CMr+Fk3nDmg==", + "dev": true, + "license": "MIT" + }, + "node_modules/any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmmirror.com/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.npmmirror.com/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.npmmirror.com/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.npmmirror.com/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "license": "MIT" + }, + "node_modules/autoprefixer": { + "version": "10.6.1", + "resolved": "https://registry.npmmirror.com/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.npmmirror.com/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/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/baseline-browser-mapping": { + "version": "2.11.28", + "resolved": "https://registry.npmmirror.com/baseline-browser-mapping/-/baseline-browser-mapping-2.11.28.tgz", + "integrity": "sha512-br0LOmjJqr6Rt4AEkadbcNf67Zpo7EPwKsWbjnRrJIa1QYFHQBqM4C7F2WTbV8ahTEcg1Eo+Y0aWjjORInYFyA==", + "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.npmmirror.com/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/brace-expansion": { + "version": "2.1.7", + "resolved": "https://registry.npmmirror.com/brace-expansion/-/brace-expansion-2.1.7.tgz", + "integrity": "sha512-uZbew1NqdmPDTMJ8ah1y+b+9QEJrfkXFk3RcTQw3X0jW/xRUvFKsg1CfQdSYGdTbXZWExtU3J3ccxtnfw1Fi0g==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmmirror.com/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.3", + "resolved": "https://registry.npmmirror.com/browserslist/-/browserslist-4.29.3.tgz", + "integrity": "sha512-1R4kiYKXGViqEN0CnoDrXc1StD9niAwu+j2dukWzrD4bJgsD4lDmEp0CRbc6E/vYJIfTHwPmwyaKtVSudICdPA==", + "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.26", + "caniuse-lite": "^1.0.30001813", + "electron-to-chromium": "^1.5.439", + "node-releases": "^2.0.57", + "update-browserslist-db": "^1.3.3" + }, + "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.npmmirror.com/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.npmmirror.com/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.30001815", + "resolved": "https://registry.npmmirror.com/caniuse-lite/-/caniuse-lite-1.0.30001815.tgz", + "integrity": "sha512-uDybUEyfgbyJJ93J1vikTylBX31AkdVYeVPeffMQpf8XN7hSfr0oZOn4VFOIMNvtU5+rHvC5Udg2TgtJKHm23Q==", + "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.npmmirror.com/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.npmmirror.com/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.npmmirror.com/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.npmmirror.com/commander/-/commander-4.1.1.tgz", + "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "node_modules/cssesc": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/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/csstype": { + "version": "3.2.3", + "resolved": "https://registry.npmmirror.com/csstype/-/csstype-3.2.3.tgz", + "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", + "license": "MIT" + }, + "node_modules/de-indent": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/de-indent/-/de-indent-1.0.2.tgz", + "integrity": "sha512-e/1zu3xH5MQryN2zdVaF0OrdNLUbvWxzMbi+iNA6Bky7l1RoP8a2fIbRocyHclXt/arDrrR6lL3TqFD9pMQTsg==", + "dev": true, + "license": "MIT" + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmmirror.com/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.npmmirror.com/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.npmmirror.com/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.npmmirror.com/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.npmmirror.com/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.452", + "resolved": "https://registry.npmmirror.com/electron-to-chromium/-/electron-to-chromium-1.5.452.tgz", + "integrity": "sha512-cVvk1YBSj6571VmV6hdJTqj94Y79xSu8cj6Y9t6ae4Y4431z8/7EJFvu3rVp90xhfuv9BpPKUmaLfTo4+FOGBg==", + "dev": true, + "license": "ISC" + }, + "node_modules/entities": { + "version": "7.0.1", + "resolved": "https://registry.npmmirror.com/entities/-/entities-7.0.1.tgz", + "integrity": "sha512-TWrgLOFUQTH994YUyl1yT4uyavY5nNB5muff+RtWaqNVCAK408b5ZnnbNAUEWLTCpum9w6arT70i1XdQ4UeOPA==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/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.npmmirror.com/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.npmmirror.com/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.npmmirror.com/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.npmmirror.com/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.npmmirror.com/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmmirror.com/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "license": "MIT" + }, + "node_modules/fast-glob": { + "version": "3.3.3", + "resolved": "https://registry.npmmirror.com/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.npmmirror.com/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.npmmirror.com/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.npmmirror.com/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.npmmirror.com/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.npmmirror.com/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.npmmirror.com/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.npmmirror.com/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "ideallyInert": 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.npmmirror.com/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmmirror.com/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.npmmirror.com/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.npmmirror.com/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.npmmirror.com/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.npmmirror.com/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.npmmirror.com/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.npmmirror.com/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/he": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true, + "license": "MIT", + "bin": { + "he": "bin/he" + } + }, + "node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmmirror.com/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.npmmirror.com/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.npmmirror.com/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.npmmirror.com/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.npmmirror.com/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.npmmirror.com/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.npmmirror.com/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/lilconfig": { + "version": "3.1.3", + "resolved": "https://registry.npmmirror.com/lilconfig/-/lilconfig-3.1.3.tgz", + "integrity": "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==", + "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.npmmirror.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "dev": true, + "license": "MIT" + }, + "node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmmirror.com/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmmirror.com/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.npmmirror.com/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.npmmirror.com/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.npmmirror.com/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.npmmirror.com/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/minimatch": { + "version": "9.0.9", + "resolved": "https://registry.npmmirror.com/minimatch/-/minimatch-9.0.9.tgz", + "integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.2" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmmirror.com/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/muggle-string": { + "version": "0.4.1", + "resolved": "https://registry.npmmirror.com/muggle-string/-/muggle-string-0.4.1.tgz", + "integrity": "sha512-VNTrAak/KhO2i8dqqnqnAHOa3cYBwXEZe9h+D5h/1ZqFSTEFHdM65lR7RoIqq3tBBYavsOXV84NoHXZ0AkPyqQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/mz": { + "version": "2.7.0", + "resolved": "https://registry.npmmirror.com/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.npmmirror.com/nanoid/-/nanoid-3.3.20.tgz", + "integrity": "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/node-releases": { + "version": "2.0.58", + "resolved": "https://registry.npmmirror.com/node-releases/-/node-releases-2.0.58.tgz", + "integrity": "sha512-BdiKAgbfRlvfMq/XzO/AF9NPmaA8a+YpLAyAFTVFBj3gARrAIfWvNq7Q7NE4se3KgFu0KkrvQMxTS0XVnsGzHg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/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.npmmirror.com/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.npmmirror.com/object-hash/-/object-hash-3.0.0.tgz", + "integrity": "sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "node_modules/path-browserify": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/path-browserify/-/path-browserify-1.0.1.tgz", + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", + "dev": true, + "license": "MIT" + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmmirror.com/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.npmmirror.com/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "2.3.2", + "resolved": "https://registry.npmmirror.com/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/pinia": { + "version": "2.3.1", + "resolved": "https://registry.npmmirror.com/pinia/-/pinia-2.3.1.tgz", + "integrity": "sha512-khUlZSwt9xXCaTbbxFYBKDc/bWAGWJjOgvxETwkTN7KRm66EeT1ZdZj6i2ceh9sP2Pzqsbc704r2yngBrxBVug==", + "license": "MIT", + "dependencies": { + "@vue/devtools-api": "^6.6.3", + "vue-demi": "^0.14.10" + }, + "funding": { + "url": "https://github.com/sponsors/posva" + }, + "peerDependencies": { + "typescript": ">=4.4.4", + "vue": "^2.7.0 || ^3.5.11" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/pirates": { + "version": "4.0.7", + "resolved": "https://registry.npmmirror.com/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.29", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-8.5.29.tgz", + "integrity": "sha512-49cGhUbXj8Qenv0iTMxA1cFBzxXoctpC9Ujd77t1WcbJIr6nF/eI7g/8MgxrYldFRuAXvja7xQRwavoW7kgrxQ==", + "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.19", + "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.npmmirror.com/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.npmmirror.com/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.npmmirror.com/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.npmmirror.com/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.4", + "resolved": "https://registry.npmmirror.com/postcss-selector-parser/-/postcss-selector-parser-6.1.4.tgz", + "integrity": "sha512-bIoJLOmjCO1S9XdY/DcnR5hJxvrDir1PbGChrzXG3vw0/FOliy/fA3dmdhQ441kah4gKv+TwckGzex6wNS5cnQ==", + "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.npmmirror.com/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.npmmirror.com/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.npmmirror.com/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/read-cache": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/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.npmmirror.com/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.npmmirror.com/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.npmmirror.com/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.64.4", + "resolved": "https://registry.npmmirror.com/rollup/-/rollup-4.64.4.tgz", + "integrity": "sha512-1DTowQbct6FOZTjZoYrZ8BwsjIwsB89HxwOn2pWPEyEKWWvKI8OrpTgmicB3fUbQzhlooCQRIn6JLUPhE0CZUA==", + "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.64.4", + "@rollup/rollup-android-arm64": "4.64.4", + "@rollup/rollup-darwin-arm64": "4.64.4", + "@rollup/rollup-darwin-x64": "4.64.4", + "@rollup/rollup-freebsd-arm64": "4.64.4", + "@rollup/rollup-freebsd-x64": "4.64.4", + "@rollup/rollup-linux-arm-gnueabihf": "4.64.4", + "@rollup/rollup-linux-arm-musleabihf": "4.64.4", + "@rollup/rollup-linux-arm64-gnu": "4.64.4", + "@rollup/rollup-linux-arm64-musl": "4.64.4", + "@rollup/rollup-linux-loong64-gnu": "4.64.4", + "@rollup/rollup-linux-loong64-musl": "4.64.4", + "@rollup/rollup-linux-ppc64-gnu": "4.64.4", + "@rollup/rollup-linux-ppc64-musl": "4.64.4", + "@rollup/rollup-linux-riscv64-gnu": "4.64.4", + "@rollup/rollup-linux-riscv64-musl": "4.64.4", + "@rollup/rollup-linux-s390x-gnu": "4.64.4", + "@rollup/rollup-linux-x64-gnu": "4.64.4", + "@rollup/rollup-linux-x64-musl": "4.64.4", + "@rollup/rollup-openbsd-x64": "4.64.4", + "@rollup/rollup-openharmony-arm64": "4.64.4", + "@rollup/rollup-win32-arm64-msvc": "4.64.4", + "@rollup/rollup-win32-ia32-msvc": "4.64.4", + "@rollup/rollup-win32-x64-gnu": "4.64.4", + "@rollup/rollup-win32-x64-msvc": "4.64.4", + "fsevents": "~2.3.2" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/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/source-map-js": { + "version": "1.2.2", + "resolved": "https://registry.npmmirror.com/source-map-js/-/source-map-js-1.2.2.tgz", + "integrity": "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sucrase": { + "version": "3.35.1", + "resolved": "https://registry.npmmirror.com/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.npmmirror.com/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.npmmirror.com/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.npmmirror.com/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.npmmirror.com/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.npmmirror.com/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.npmmirror.com/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.npmmirror.com/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.npmmirror.com/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.npmmirror.com/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/typescript": { + "version": "5.6.3", + "resolved": "https://registry.npmmirror.com/typescript/-/typescript-5.6.3.tgz", + "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==", + "devOptional": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmmirror.com/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/update-browserslist-db": { + "version": "1.3.4", + "resolved": "https://registry.npmmirror.com/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.npmmirror.com/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.npmmirror.com/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/vscode-uri": { + "version": "3.2.0", + "resolved": "https://registry.npmmirror.com/vscode-uri/-/vscode-uri-3.2.0.tgz", + "integrity": "sha512-m2gXo3bn0G1kT9InzMf07fTbqMbGtyckj3bH5ktLO+1Ssv+yiATZ4dhwaQv9UZWxJh6E9IFGnQyjgWVDWVBDrg==", + "dev": true, + "license": "MIT" + }, + "node_modules/vue": { + "version": "3.5.43", + "resolved": "https://registry.npmmirror.com/vue/-/vue-3.5.43.tgz", + "integrity": "sha512-o5qZoksdnjIKvW1srZ3ab7pcDNYAerBjRe54D0LBLfRdCYFrSgBHVXokMas35czQc0//lmx4/tuY4ZNQ+Rf2Ng==", + "license": "MIT", + "dependencies": { + "@vue/compiler-dom": "3.5.43", + "@vue/compiler-sfc": "3.5.43", + "@vue/runtime-dom": "3.5.43", + "@vue/server-renderer": "3.5.43", + "@vue/shared": "3.5.43" + }, + "peerDependencies": { + "typescript": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/vue-demi": { + "version": "0.14.10", + "resolved": "https://registry.npmmirror.com/vue-demi/-/vue-demi-0.14.10.tgz", + "integrity": "sha512-nMZBOwuzabUO0nLgIcc6rycZEebF6eeUfaiQx9+WSk8e29IbLvPU9feI6tqW4kTo3hvoYAJkMh8n8D0fuISphg==", + "hasInstallScript": true, + "license": "MIT", + "bin": { + "vue-demi-fix": "bin/vue-demi-fix.js", + "vue-demi-switch": "bin/vue-demi-switch.js" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + }, + "peerDependencies": { + "@vue/composition-api": "^1.0.0-rc.1", + "vue": "^3.0.0-0 || ^2.6.0" + }, + "peerDependenciesMeta": { + "@vue/composition-api": { + "optional": true + } + } + }, + "node_modules/vue-router": { + "version": "4.6.4", + "resolved": "https://registry.npmmirror.com/vue-router/-/vue-router-4.6.4.tgz", + "integrity": "sha512-Hz9q5sa33Yhduglwz6g9skT8OBPii+4bFn88w6J+J4MfEo4KRRpmiNG/hHHkdbRFlLBOqxN8y8gf2Fb0MTUgVg==", + "license": "MIT", + "dependencies": { + "@vue/devtools-api": "^6.6.4" + }, + "funding": { + "url": "https://github.com/sponsors/posva" + }, + "peerDependencies": { + "vue": "^3.5.0" + } + }, + "node_modules/vue-tsc": { + "version": "2.2.12", + "resolved": "https://registry.npmmirror.com/vue-tsc/-/vue-tsc-2.2.12.tgz", + "integrity": "sha512-P7OP77b2h/Pmk+lZdJ0YWs+5tJ6J2+uOQPo7tlBnY44QqQSPYvS0qVT4wqDJgwrZaLe47etJLLQRFia71GYITw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@volar/typescript": "2.4.15", + "@vue/language-core": "2.2.12" + }, + "bin": { + "vue-tsc": "bin/vue-tsc.js" + }, + "peerDependencies": { + "typescript": ">=5.0.0" + } + } + } +} diff --git a/frontend/node_modules/.vite/deps/_metadata.json b/frontend/node_modules/.vite/deps/_metadata.json new file mode 100644 index 0000000..2a8f4ab --- /dev/null +++ b/frontend/node_modules/.vite/deps/_metadata.json @@ -0,0 +1,43 @@ +{ + "hash": "6e5cdcad", + "configHash": "5676f1d7", + "lockfileHash": "b8fc5ddb", + "browserHash": "ba239a32", + "optimized": { + "axios": { + "src": "../../axios/index.js", + "file": "axios.js", + "fileHash": "0eabf0a3", + "needsInterop": false + }, + "pinia": { + "src": "../../pinia/dist/pinia.mjs", + "file": "pinia.js", + "fileHash": "86193d4d", + "needsInterop": false + }, + "vue": { + "src": "../../vue/dist/vue.runtime.esm-bundler.js", + "file": "vue.js", + "fileHash": "40f4b8ab", + "needsInterop": false + }, + "vue-router": { + "src": "../../vue-router/dist/vue-router.mjs", + "file": "vue-router.js", + "fileHash": "4a9239aa", + "needsInterop": false + } + }, + "chunks": { + "chunk-YFT6OQ5R": { + "file": "chunk-YFT6OQ5R.js" + }, + "chunk-GKNS7JV4": { + "file": "chunk-GKNS7JV4.js" + }, + "chunk-PZ5AY32C": { + "file": "chunk-PZ5AY32C.js" + } + } +} \ No newline at end of file diff --git a/frontend/node_modules/.vite/deps/axios.js b/frontend/node_modules/.vite/deps/axios.js new file mode 100644 index 0000000..38e4401 --- /dev/null +++ b/frontend/node_modules/.vite/deps/axios.js @@ -0,0 +1,3804 @@ +import { + __export +} from "./chunk-PZ5AY32C.js"; + +// node_modules/axios/lib/helpers/bind.js +function bind(fn, thisArg) { + return function wrap() { + return fn.apply(thisArg, arguments); + }; +} + +// node_modules/axios/lib/utils.js +var { toString } = Object.prototype; +var { getPrototypeOf } = Object; +var { iterator, toStringTag } = Symbol; +var hasOwnProperty = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype); +var isUnsafeObjectKey = (prop) => typeof prop === "string" && (prop === "__proto__" || prop === "constructor" || prop === "prototype"); +var isPrototypeBoundary = (obj, prototype2, source) => obj === Object.prototype || !source && prototype2 === null; +var isSafeAndFullyMutable = (obj) => { + if (!Object.isExtensible(obj)) { + return false; + } + const props = Object.getOwnPropertyNames(obj); + if (Object.getOwnPropertySymbols) { + props.push(...Object.getOwnPropertySymbols(obj)); + } + return props.every((prop) => { + if (isUnsafeObjectKey(prop)) { + return false; + } + const descriptor = Object.getOwnPropertyDescriptor(obj, prop); + return !!descriptor && descriptor.configurable && descriptor.writable === true; + }); +}; +var hasOwnInPrototypeChain = (thing, prop) => { + let obj = thing; + const seen = []; + while (obj != null) { + if (seen.indexOf(obj) !== -1) { + return false; + } + seen.push(obj); + const prototype2 = getPrototypeOf(obj); + if (isPrototypeBoundary(obj, prototype2, obj === thing)) { + return false; + } + if (hasOwnProperty(obj, prop)) { + return true; + } + obj = prototype2; + } + return false; +}; +var getSafeProp = (obj, prop) => obj != null && hasOwnInPrototypeChain(obj, prop) ? obj[prop] : void 0; +var toSafeFlatObject = (thing) => { + if (thing == null || typeof thing !== "object" && typeof thing !== "function") { + return thing; + } + const sourcePrototype = getPrototypeOf(thing); + if (sourcePrototype === null && isSafeAndFullyMutable(thing)) { + return thing; + } + const result = /* @__PURE__ */ Object.create(null); + const merged = /* @__PURE__ */ Object.create(null); + const seen = []; + let current = thing; + while (current != null) { + if (seen.indexOf(current) !== -1) { + break; + } + seen.push(current); + const prototype2 = current === thing ? sourcePrototype : getPrototypeOf(current); + if (isPrototypeBoundary(current, prototype2, current === thing)) { + break; + } + const props = Object.getOwnPropertyNames(current); + if (Object.getOwnPropertySymbols) { + props.push(...Object.getOwnPropertySymbols(current)); + } + for (const prop of props) { + if (isUnsafeObjectKey(prop)) { + continue; + } + if (!hasOwnProperty(merged, prop)) { + result[prop] = thing[prop]; + merged[prop] = true; + } + } + current = prototype2; + } + return result; +}; +var kindOf = /* @__PURE__ */ ((cache) => (thing) => { + const str = toString.call(thing); + return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); +})(/* @__PURE__ */ Object.create(null)); +var kindOfTest = (type) => { + type = type.toLowerCase(); + return (thing) => kindOf(thing) === type; +}; +var typeOfTest = (type) => (thing) => typeof thing === type; +var { isArray } = Array; +var isUndefined = typeOfTest("undefined"); +function isBuffer(val) { + return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val); +} +var isArrayBuffer = kindOfTest("ArrayBuffer"); +function isArrayBufferView(val) { + let result; + if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) { + result = ArrayBuffer.isView(val); + } else { + result = val && val.buffer && isArrayBuffer(val.buffer); + } + return result; +} +var isString = typeOfTest("string"); +var isFunction = typeOfTest("function"); +var isNumber = typeOfTest("number"); +var isObject = (thing) => thing !== null && typeof thing === "object"; +var isBoolean = (thing) => thing === true || thing === false; +var isPlainObject = (val) => { + if (!isObject(val)) { + return false; + } + const prototype2 = getPrototypeOf(val); + return (prototype2 === null || prototype2 === Object.prototype || getPrototypeOf(prototype2) === null) && // Treat safe own/inherited Symbol.toStringTag or Symbol.iterator members as + // evidence the value is tagged/iterable, while ignoring members reachable + // only through shared or terminal prototype boundaries. + !hasOwnInPrototypeChain(val, toStringTag) && !hasOwnInPrototypeChain(val, iterator); +}; +var isEmptyObject = (val) => { + if (!isObject(val) || isBuffer(val)) { + return false; + } + try { + return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype; + } catch (e) { + return false; + } +}; +var isDate = kindOfTest("Date"); +var isFile = kindOfTest("File"); +var isReactNativeBlob = (value) => { + return !!(value && typeof value.uri !== "undefined"); +}; +var isReactNative = (formData) => formData && typeof formData.getParts !== "undefined"; +var isBlob = kindOfTest("Blob"); +var isFileList = kindOfTest("FileList"); +var isSet = kindOfTest("Set"); +var isStream = (val) => isObject(val) && isFunction(val.pipe); +function getGlobal() { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + return {}; +} +var G = getGlobal(); +var FormDataCtor = typeof G.FormData !== "undefined" ? G.FormData : void 0; +var isFormData = (thing) => { + if (!thing) return false; + if (FormDataCtor && thing instanceof FormDataCtor) return true; + const proto = getPrototypeOf(thing); + if (!proto || proto === Object.prototype) return false; + if (!isFunction(thing.append)) return false; + const kind = kindOf(thing); + return kind === "formdata" || // detect form-data instance + kind === "object" && isFunction(thing.toString) && thing.toString() === "[object FormData]"; +}; +var isURLSearchParams = kindOfTest("URLSearchParams"); +var [isReadableStream, isRequest, isResponse, isHeaders] = [ + "ReadableStream", + "Request", + "Response", + "Headers" +].map(kindOfTest); +var trim = (str) => { + return str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ""); +}; +function forEach(obj, fn, { allOwnKeys = false } = {}) { + if (obj === null || typeof obj === "undefined") { + return; + } + let i; + let l; + if (typeof obj !== "object") { + obj = [obj]; + } + if (isArray(obj)) { + for (i = 0, l = obj.length; i < l; i++) { + fn.call(null, obj[i], i, obj); + } + } else { + if (isBuffer(obj)) { + return; + } + const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj); + const len = keys.length; + let key; + for (i = 0; i < len; i++) { + key = keys[i]; + fn.call(null, obj[key], key, obj); + } + } +} +function findKey(obj, key) { + if (isBuffer(obj)) { + return null; + } + key = key.toLowerCase(); + const keys = Object.keys(obj); + let i = keys.length; + let _key; + while (i-- > 0) { + _key = keys[i]; + if (key === _key.toLowerCase()) { + return _key; + } + } + return null; +} +var _global = (() => { + if (typeof globalThis !== "undefined") return globalThis; + return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : global; +})(); +var isContextDefined = (context) => !isUndefined(context) && context !== _global; +function merge(...objs) { + const { caseless, skipUndefined } = isContextDefined(this) && this || {}; + const result = {}; + const assignValue = (val, key) => { + if (key === "__proto__" || key === "constructor" || key === "prototype") { + return; + } + const targetKey = caseless && typeof key === "string" && findKey(result, key) || key; + const existing = hasOwnProperty(result, targetKey) ? result[targetKey] : void 0; + if (isPlainObject(existing) && isPlainObject(val)) { + result[targetKey] = merge(existing, val); + } else if (isPlainObject(val)) { + result[targetKey] = merge({}, val); + } else if (isArray(val)) { + result[targetKey] = val.slice(); + } else if (!skipUndefined || !isUndefined(val)) { + result[targetKey] = val; + } + }; + for (let i = 0, l = objs.length; i < l; i++) { + const source = objs[i]; + if (!source || isBuffer(source)) { + continue; + } + forEach(source, assignValue); + if (typeof source !== "object" || isArray(source)) { + continue; + } + const symbols = Object.getOwnPropertySymbols(source); + for (let j = 0; j < symbols.length; j++) { + const symbol = symbols[j]; + if (propertyIsEnumerable.call(source, symbol)) { + assignValue(source[symbol], symbol); + } + } + } + return result; +} +var extend = (a, b, thisArg, { allOwnKeys } = {}) => { + forEach( + b, + (val, key) => { + if (thisArg && isFunction(val)) { + Object.defineProperty(a, key, { + // Null-proto descriptor so a polluted Object.prototype.get cannot + // hijack defineProperty's accessor-vs-data resolution. + __proto__: null, + value: bind(val, thisArg), + writable: true, + enumerable: true, + configurable: true + }); + } else { + Object.defineProperty(a, key, { + __proto__: null, + value: val, + writable: true, + enumerable: true, + configurable: true + }); + } + }, + { allOwnKeys } + ); + return a; +}; +var stripBOM = (content) => { + if (content.charCodeAt(0) === 65279) { + content = content.slice(1); + } + return content; +}; +var inherits = (constructor, superConstructor, props, descriptors) => { + constructor.prototype = Object.create(superConstructor.prototype, descriptors); + Object.defineProperty(constructor.prototype, "constructor", { + __proto__: null, + value: constructor, + writable: true, + enumerable: false, + configurable: true + }); + Object.defineProperty(constructor, "super", { + __proto__: null, + value: superConstructor.prototype + }); + props && Object.assign(constructor.prototype, props); +}; +var toFlatObject = (sourceObj, destObj, filter2, propFilter) => { + let props; + let i; + let prop; + const merged = {}; + destObj = destObj || {}; + if (sourceObj == null) return destObj; + do { + props = Object.getOwnPropertyNames(sourceObj); + i = props.length; + while (i-- > 0) { + prop = props[i]; + if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) { + destObj[prop] = sourceObj[prop]; + merged[prop] = true; + } + } + sourceObj = filter2 !== false && getPrototypeOf(sourceObj); + } while (sourceObj && (!filter2 || filter2(sourceObj, destObj)) && sourceObj !== Object.prototype); + return destObj; +}; +var endsWith = (str, searchString, position) => { + str = String(str); + if (position === void 0 || position > str.length) { + position = str.length; + } + position -= searchString.length; + const lastIndex = str.indexOf(searchString, position); + return lastIndex !== -1 && lastIndex === position; +}; +var toArray = (thing) => { + if (!thing) return null; + if (isArray(thing)) return thing; + let i = thing.length; + if (!isNumber(i)) return null; + const arr = new Array(i); + while (i-- > 0) { + arr[i] = thing[i]; + } + return arr; +}; +var isTypedArray = /* @__PURE__ */ ((TypedArray) => { + return (thing) => { + return TypedArray && thing instanceof TypedArray; + }; +})(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array)); +var forEachEntry = (obj, fn) => { + const generator = obj && obj[iterator]; + const _iterator = generator.call(obj); + let result; + while ((result = _iterator.next()) && !result.done) { + const pair = result.value; + fn.call(obj, pair[0], pair[1]); + } +}; +var matchAll = (regExp, str) => { + let matches; + const arr = []; + while ((matches = regExp.exec(str)) !== null) { + arr.push(matches); + } + return arr; +}; +var isHTMLForm = kindOfTest("HTMLFormElement"); +var toCamelCase = (str) => { + return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function replacer(m, p1, p2) { + return p1.toUpperCase() + p2; + }); +}; +var { propertyIsEnumerable } = Object.prototype; +var isRegExp = kindOfTest("RegExp"); +var reduceDescriptors = (obj, reducer) => { + const descriptors = Object.getOwnPropertyDescriptors(obj); + const reducedDescriptors = {}; + forEach(descriptors, (descriptor, name) => { + let ret; + if ((ret = reducer(descriptor, name, obj)) !== false) { + reducedDescriptors[name] = ret || descriptor; + } + }); + Object.defineProperties(obj, reducedDescriptors); +}; +var freezeMethods = (obj) => { + reduceDescriptors(obj, (descriptor, name) => { + if (isFunction(obj) && ["arguments", "caller", "callee"].includes(name)) { + return false; + } + const value = obj[name]; + if (!isFunction(value)) return; + descriptor.enumerable = false; + if ("writable" in descriptor) { + descriptor.writable = false; + return; + } + if (!descriptor.set) { + descriptor.set = () => { + throw Error("Can not rewrite read-only method '" + name + "'"); + }; + } + }); +}; +var toObjectSet = (arrayOrString, delimiter) => { + const obj = {}; + const define = (arr) => { + arr.forEach((value) => { + obj[value] = true; + }); + }; + isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter)); + return obj; +}; +var noop = () => { +}; +var toFiniteNumber = (value, defaultValue) => { + return value != null && Number.isFinite(value = +value) ? value : defaultValue; +}; +function isSpecCompliantForm(thing) { + return !!(thing && isFunction(thing.append) && thing[toStringTag] === "FormData" && thing[iterator]); +} +var toJSONObject = (obj) => { + const visited = /* @__PURE__ */ new WeakSet(); + const visit = (source) => { + if (isObject(source)) { + if (visited.has(source)) { + return; + } + if (isBuffer(source)) { + return source; + } + if (!("toJSON" in source)) { + visited.add(source); + let target; + if (isSet(source)) { + target = []; + for (const value of source) { + const reducedValue = visit(value); + !isUndefined(reducedValue) && target.push(reducedValue); + } + } else { + target = isArray(source) ? [] : {}; + forEach(source, (value, key) => { + const reducedValue = visit(value); + !isUndefined(reducedValue) && (target[key] = reducedValue); + }); + } + visited.delete(source); + return target; + } + } + return source; + }; + return visit(obj); +}; +var isAsyncFn = kindOfTest("AsyncFunction"); +var isThenable = (thing) => thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch); +var _setImmediate = ((setImmediateSupported, postMessageSupported) => { + if (setImmediateSupported) { + return setImmediate; + } + return postMessageSupported ? ((token, callbacks) => { + _global.addEventListener( + "message", + ({ source, data }) => { + if (source === _global && data === token) { + callbacks.length && callbacks.shift()(); + } + }, + false + ); + return (cb) => { + callbacks.push(cb); + _global.postMessage(token, "*"); + }; + })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb); +})(typeof setImmediate === "function", isFunction(_global.postMessage)); +var asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate; +var isIterable = (thing) => thing != null && isFunction(thing[iterator]); +var isSafeIterable = (thing) => thing != null && hasOwnInPrototypeChain(thing, iterator) && isIterable(thing); +var utils_default = { + isArray, + isArrayBuffer, + isBuffer, + isFormData, + isArrayBufferView, + isString, + isNumber, + isBoolean, + isObject, + isPlainObject, + isEmptyObject, + isReadableStream, + isRequest, + isResponse, + isHeaders, + isUndefined, + isDate, + isFile, + isReactNativeBlob, + isReactNative, + isBlob, + isRegExp, + isFunction, + isStream, + isURLSearchParams, + isTypedArray, + isFileList, + forEach, + merge, + extend, + trim, + stripBOM, + inherits, + toFlatObject, + kindOf, + kindOfTest, + endsWith, + toArray, + forEachEntry, + matchAll, + isHTMLForm, + hasOwnProperty, + hasOwnProp: hasOwnProperty, + // an alias to avoid ESLint no-prototype-builtins detection + hasOwnInPrototypeChain, + getSafeProp, + toSafeFlatObject, + reduceDescriptors, + freezeMethods, + toObjectSet, + toCamelCase, + noop, + toFiniteNumber, + findKey, + global: _global, + isContextDefined, + isSpecCompliantForm, + toJSONObject, + isAsyncFn, + isThenable, + setImmediate: _setImmediate, + asap, + isIterable, + isSafeIterable +}; + +// node_modules/axios/lib/helpers/parseHeaders.js +var ignoreDuplicateOf = utils_default.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" +]); +var parseHeaders_default = (rawHeaders) => { + const parsed = {}; + let key; + let val; + let i; + rawHeaders && rawHeaders.split("\n").forEach(function parser(line) { + i = line.indexOf(":"); + key = line.substring(0, i).trim().toLowerCase(); + val = line.substring(i + 1).trim(); + const hasKey = utils_default.hasOwnProp(parsed, key); + if (!key || hasKey && utils_default.hasOwnProp(ignoreDuplicateOf, key)) { + return; + } + if (key === "set-cookie") { + if (hasKey) { + parsed[key].push(val); + } else { + parsed[key] = [val]; + } + } else { + parsed[key] = hasKey ? parsed[key] + ", " + val : val; + } + }); + return parsed; +}; + +// node_modules/axios/lib/helpers/sanitizeHeaderValue.js +function trimSPorHTAB(str) { + let start = 0; + let end = str.length; + while (start < end) { + const code = str.charCodeAt(start); + if (code !== 9 && code !== 32) { + break; + } + start += 1; + } + while (end > start) { + const code = str.charCodeAt(end - 1); + if (code !== 9 && code !== 32) { + break; + } + end -= 1; + } + return start === 0 && end === str.length ? str : str.slice(start, end); +} +var INVALID_UNICODE_HEADER_VALUE_CHARS = new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+", "g"); +var INVALID_BYTE_STRING_HEADER_VALUE_CHARS = new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+", "g"); +function sanitizeValue(value, invalidChars) { + if (utils_default.isArray(value)) { + return value.map((item) => sanitizeValue(item, invalidChars)); + } + return trimSPorHTAB(String(value).replace(invalidChars, "")); +} +var sanitizeHeaderValue = (value) => sanitizeValue(value, INVALID_UNICODE_HEADER_VALUE_CHARS); +var sanitizeByteStringHeaderValue = (value) => sanitizeValue(value, INVALID_BYTE_STRING_HEADER_VALUE_CHARS); +function toByteStringHeaderObject(headers) { + const byteStringHeaders = /* @__PURE__ */ Object.create(null); + utils_default.forEach(headers.toJSON(), (value, header) => { + byteStringHeaders[header] = sanitizeByteStringHeaderValue(value); + }); + return byteStringHeaders; +} + +// node_modules/axios/lib/core/AxiosHeaders.js +var $internals = Symbol("internals"); +function normalizeHeader(header) { + return header && String(header).trim().toLowerCase(); +} +function normalizeValue(value) { + if (value === false || value == null) { + return value; + } + return utils_default.isArray(value) ? value.map(normalizeValue) : sanitizeHeaderValue(String(value)); +} +function parseTokens(str) { + const tokens = /* @__PURE__ */ Object.create(null); + const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; + let match; + while (match = tokensRE.exec(str)) { + tokens[match[1]] = match[2]; + } + return tokens; +} +var parameterNameRE = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/; +function trimOWS(value) { + let start = 0; + let end = value.length; + while (start < end) { + const code = value.charCodeAt(start); + if (code !== 9 && code !== 32) { + break; + } + start += 1; + } + while (end > start) { + const code = value.charCodeAt(end - 1); + if (code !== 9 && code !== 32) { + break; + } + end -= 1; + } + return start === 0 && end === value.length ? value : value.slice(start, end); +} +function decodeQuotedString(value) { + const last = value.length - 1; + if (last < 1 || value.charCodeAt(0) !== 34 || value.charCodeAt(last) !== 34) { + return value; + } + let decoded = ""; + for (let i = 1; i < last; i++) { + const code = value.charCodeAt(i); + if (code === 34) { + return value; + } + if (code === 92) { + i += 1; + if (i >= last) { + return value; + } + } + decoded += value[i]; + } + return decoded; +} +function parseParameters(value) { + const parameters = /* @__PURE__ */ Object.create(null); + const str = String(value); + let start = 0; + let quoted = false; + let escaped = false; + function parseParameter(end) { + const part = trimOWS(str.slice(start, end)); + const equals = part.indexOf("="); + if (equals < 1) { + return; + } + const name = trimOWS(part.slice(0, equals)); + if (!parameterNameRE.test(name)) { + return; + } + const normalizedName = name.toLowerCase(); + if (normalizedName === "__proto__" || normalizedName === "constructor" || normalizedName === "prototype") { + return; + } + const parameterValue = trimOWS(part.slice(equals + 1)); + parameters[normalizedName] = decodeQuotedString(parameterValue); + } + for (let i = 0; i < str.length; i++) { + const code = str.charCodeAt(i); + if (quoted) { + if (escaped) { + escaped = false; + } else if (code === 92) { + escaped = true; + } else if (code === 34) { + quoted = false; + } + } else if (code === 34) { + quoted = true; + } else if (code === 44 || code === 59) { + parseParameter(i); + start = i + 1; + } + } + parseParameter(str.length); + return parameters; +} +var isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim()); +function matchHeaderValue(context, value, header, filter2, isHeaderNameFilter) { + if (utils_default.isFunction(filter2)) { + return filter2.call(this, value, header); + } + if (isHeaderNameFilter) { + value = header; + } + if (!utils_default.isString(value)) return; + if (utils_default.isString(filter2)) { + return value.indexOf(filter2) !== -1; + } + if (utils_default.isRegExp(filter2)) { + return filter2.test(value); + } +} +function formatHeader(header) { + return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => { + return char.toUpperCase() + str; + }); +} +function buildAccessors(obj, header) { + const accessorName = utils_default.toCamelCase(" " + header); + ["get", "set", "has"].forEach((methodName) => { + Object.defineProperty(obj, methodName + accessorName, { + // Null-proto descriptor so a polluted Object.prototype.get cannot turn + // this data descriptor into an accessor descriptor on the way in. + __proto__: null, + value: function(arg1, arg2, arg3) { + return this[methodName].call(this, header, arg1, arg2, arg3); + }, + configurable: true + }); + }); +} +var AxiosHeaders = class { + constructor(headers) { + headers && this.set(headers); + } + set(header, valueOrRewrite, rewrite) { + const self2 = this; + function setHeader(_value, _header, _rewrite) { + const lHeader = normalizeHeader(_header); + if (!lHeader) { + return; + } + const key = utils_default.findKey(self2, lHeader); + if (!key || self2[key] === void 0 || _rewrite === true || _rewrite === void 0 && self2[key] !== false) { + self2[key || _header] = normalizeValue(_value); + } + } + const setHeaders = (headers, _rewrite) => utils_default.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite)); + if (utils_default.isPlainObject(header) || header instanceof this.constructor) { + setHeaders(header, valueOrRewrite); + } else if (utils_default.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) { + setHeaders(parseHeaders_default(header), valueOrRewrite); + } else if (utils_default.isObject(header) && utils_default.isSafeIterable(header)) { + let obj = /* @__PURE__ */ Object.create(null), dest, key; + for (const entry of header) { + if (!utils_default.isArray(entry)) { + throw new TypeError("Object iterator must return a key-value pair"); + } + key = entry[0]; + if (utils_default.hasOwnProp(obj, key)) { + dest = obj[key]; + obj[key] = utils_default.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]]; + } else { + obj[key] = entry[1]; + } + } + setHeaders(obj, valueOrRewrite); + } else { + header != null && setHeader(valueOrRewrite, header, rewrite); + } + return this; + } + get(header, parser) { + header = normalizeHeader(header); + if (header) { + const key = utils_default.findKey(this, header); + if (key) { + const value = this[key]; + if (!parser) { + return value; + } + if (parser === true) { + return parseTokens(value); + } + if (utils_default.isFunction(parser)) { + return parser.call(this, value, key); + } + if (utils_default.isRegExp(parser)) { + return parser.exec(value); + } + throw new TypeError("parser must be boolean|regexp|function"); + } + } + } + has(header, matcher) { + header = normalizeHeader(header); + if (header) { + const key = utils_default.findKey(this, header); + return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher))); + } + return false; + } + delete(header, matcher) { + const self2 = this; + let deleted = false; + function deleteHeader(_header) { + _header = normalizeHeader(_header); + if (_header) { + const key = utils_default.findKey(self2, _header); + if (key && (!matcher || matchHeaderValue(self2, self2[key], key, matcher))) { + delete self2[key]; + deleted = true; + } + } + } + if (utils_default.isArray(header)) { + header.forEach(deleteHeader); + } else { + deleteHeader(header); + } + return deleted; + } + clear(matcher) { + const keys = Object.keys(this); + let i = keys.length; + let deleted = false; + while (i--) { + const key = keys[i]; + if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) { + delete this[key]; + deleted = true; + } + } + return deleted; + } + normalize(format) { + const self2 = this; + const headers = {}; + utils_default.forEach(this, (value, header) => { + const key = utils_default.findKey(headers, header); + if (key) { + self2[key] = normalizeValue(value); + delete self2[header]; + return; + } + const normalized = format ? formatHeader(header) : String(header).trim(); + if (normalized !== header) { + delete self2[header]; + } + self2[normalized] = normalizeValue(value); + headers[normalized] = true; + }); + return this; + } + concat(...targets) { + return this.constructor.concat(this, ...targets); + } + toJSON(asStrings) { + const obj = /* @__PURE__ */ Object.create(null); + utils_default.forEach(this, (value, header) => { + value != null && value !== false && (obj[header] = asStrings && utils_default.isArray(value) ? value.join(", ") : value); + }); + return obj; + } + [Symbol.iterator]() { + return Object.entries(this.toJSON())[Symbol.iterator](); + } + toString() { + return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n"); + } + getSetCookie() { + const value = this.get("set-cookie"); + return utils_default.isArray(value) ? value : value == null || value === false ? [] : [value]; + } + get [Symbol.toStringTag]() { + return "AxiosHeaders"; + } + static from(thing) { + return thing instanceof this ? thing : new this(thing); + } + static parseParameters(value) { + return parseParameters(value); + } + static concat(first, ...targets) { + const computed = new this(first); + targets.forEach((target) => computed.set(target)); + return computed; + } + static accessor(header) { + const internals = this[$internals] = this[$internals] = { + accessors: {} + }; + const accessors = internals.accessors; + const prototype2 = this.prototype; + function defineAccessor(_header) { + const lHeader = normalizeHeader(_header); + if (!accessors[lHeader]) { + buildAccessors(prototype2, _header); + accessors[lHeader] = true; + } + } + utils_default.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header); + return this; + } +}; +AxiosHeaders.accessor([ + "Content-Type", + "Content-Length", + "Accept", + "Accept-Encoding", + "User-Agent", + "Authorization" +]); +utils_default.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => { + let mapped = key[0].toUpperCase() + key.slice(1); + return { + get: () => value, + set(headerValue) { + this[mapped] = headerValue; + } + }; +}); +utils_default.freezeMethods(AxiosHeaders); +var AxiosHeaders_default = AxiosHeaders; + +// node_modules/axios/lib/core/AxiosError.js +var REDACTED = "[REDACTED ****]"; +function hasOwnOrPrototypeToJSON(source) { + if (utils_default.hasOwnProp(source, "toJSON")) { + return true; + } + let prototype2 = Object.getPrototypeOf(source); + while (prototype2 && prototype2 !== Object.prototype) { + if (utils_default.hasOwnProp(prototype2, "toJSON")) { + return true; + } + prototype2 = Object.getPrototypeOf(prototype2); + } + return false; +} +function redactConfig(config, redactKeys) { + const lowerKeys = new Set(redactKeys.map((k) => String(k).toLowerCase())); + const seen = []; + const visit = (source) => { + if (source === null || typeof source !== "object") return source; + if (utils_default.isBuffer(source)) return source; + if (seen.indexOf(source) !== -1) return void 0; + if (source instanceof AxiosHeaders_default) { + source = source.toJSON(); + } + seen.push(source); + let result; + if (utils_default.isArray(source)) { + result = []; + source.forEach((v, i) => { + const reducedValue = visit(v); + if (!utils_default.isUndefined(reducedValue)) { + result[i] = reducedValue; + } + }); + } else { + if (!utils_default.isPlainObject(source) && hasOwnOrPrototypeToJSON(source)) { + seen.pop(); + return source; + } + result = /* @__PURE__ */ Object.create(null); + for (const [key, value] of Object.entries(source)) { + const reducedValue = lowerKeys.has(key.toLowerCase()) ? REDACTED : visit(value); + if (!utils_default.isUndefined(reducedValue)) { + result[key] = reducedValue; + } + } + } + seen.pop(); + return result; + }; + return visit(config); +} +function stringifySafely(value) { + try { + return String(value); + } catch (err) { + return ""; + } +} +function aggregateErrorMessage(error) { + const message = error.errors.map((entry) => { + try { + return entry && entry.message ? stringifySafely(entry.message) : stringifySafely(entry); + } catch (err) { + return ""; + } + }).filter(Boolean).join("; "); + return message || error.name || "AggregateError"; +} +var AxiosError = class _AxiosError extends Error { + static from(error, code, config, request, response, customProps) { + let message = error.message; + if (!message && utils_default.isArray(error.errors) && error.errors.length) { + message = aggregateErrorMessage(error); + } + const axiosError = new _AxiosError(message, code || error.code, config, request, response); + Object.defineProperty(axiosError, "cause", { + __proto__: null, + value: error, + writable: true, + enumerable: false, + configurable: true + }); + axiosError.name = error.name; + if (error.status != null && axiosError.status == null) { + axiosError.status = error.status; + } + customProps && Object.assign(axiosError, customProps); + return axiosError; + } + /** + * Create an Error with the specified message, config, error code, request and response. + * + * @param {string} message The error message. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [config] The config. + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * + * @returns {Error} The created error. + */ + constructor(message, code, config, request, response) { + super(message); + Object.defineProperty(this, "message", { + // Null-proto descriptor so a polluted Object.prototype.get cannot turn + // this data descriptor into an accessor descriptor on the way in. + __proto__: null, + value: message, + enumerable: true, + writable: true, + configurable: true + }); + this.name = "AxiosError"; + this.isAxiosError = true; + code && (this.code = code); + config && (this.config = config); + request && (this.request = request); + if (response) { + this.response = response; + this.status = response.status; + } + } + toJSON() { + const config = this.config; + const redactKeys = config && utils_default.hasOwnProp(config, "redact") ? config.redact : void 0; + const serializedConfig = utils_default.isArray(redactKeys) && redactKeys.length > 0 ? redactConfig(config, redactKeys) : utils_default.toJSONObject(config); + return { + // Standard + message: this.message, + name: this.name, + // Microsoft + description: this.description, + number: this.number, + // Mozilla + fileName: this.fileName, + lineNumber: this.lineNumber, + columnNumber: this.columnNumber, + stack: this.stack, + // Axios + config: serializedConfig, + code: this.code, + status: this.status + }; + } +}; +AxiosError.ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE"; +AxiosError.ERR_BAD_OPTION = "ERR_BAD_OPTION"; +AxiosError.ECONNABORTED = "ECONNABORTED"; +AxiosError.ETIMEDOUT = "ETIMEDOUT"; +AxiosError.ECONNREFUSED = "ECONNREFUSED"; +AxiosError.ERR_NETWORK = "ERR_NETWORK"; +AxiosError.ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS"; +AxiosError.ERR_DEPRECATED = "ERR_DEPRECATED"; +AxiosError.ERR_BAD_RESPONSE = "ERR_BAD_RESPONSE"; +AxiosError.ERR_BAD_REQUEST = "ERR_BAD_REQUEST"; +AxiosError.ERR_CANCELED = "ERR_CANCELED"; +AxiosError.ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT"; +AxiosError.ERR_INVALID_URL = "ERR_INVALID_URL"; +AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED = "ERR_FORM_DATA_DEPTH_EXCEEDED"; +var AxiosError_default = AxiosError; + +// node_modules/axios/lib/helpers/null.js +var null_default = null; + +// node_modules/axios/lib/helpers/toFormData.js +var DEFAULT_FORM_DATA_MAX_DEPTH = 100; +function isVisitable(thing) { + return utils_default.isPlainObject(thing) || utils_default.isArray(thing); +} +function removeBrackets(key) { + return utils_default.endsWith(key, "[]") ? key.slice(0, -2) : key; +} +function renderKey(path, key, dots) { + if (!path) return key; + return path.concat(key).map(function each(token, i) { + token = removeBrackets(token); + return !dots && i ? "[" + token + "]" : token; + }).join(dots ? "." : ""); +} +function isFlatArray(arr) { + return utils_default.isArray(arr) && !arr.some(isVisitable); +} +var predicates = utils_default.toFlatObject(utils_default, {}, null, function filter(prop) { + return /^is[A-Z]/.test(prop); +}); +function toFormData(obj, formData, options) { + if (!utils_default.isObject(obj)) { + throw new TypeError("target must be an object"); + } + formData = formData || new (null_default || FormData)(); + const option = (name, fallback) => { + const value = utils_default.getSafeProp(options, name); + return utils_default.isUndefined(value) ? fallback : value; + }; + const metaTokens = option("metaTokens", true); + const visitor = option("visitor") || defaultVisitor; + const dots = option("dots", false); + const indexes = option("indexes", false); + const _Blob = option("Blob") || typeof Blob !== "undefined" && Blob; + const maxDepth = option("maxDepth", DEFAULT_FORM_DATA_MAX_DEPTH); + const useBlob = _Blob && utils_default.isSpecCompliantForm(formData); + const stack = []; + if (!utils_default.isFunction(visitor)) { + throw new TypeError("visitor must be a function"); + } + function convertValue(value) { + if (value === null) return ""; + if (utils_default.isDate(value)) { + return value.toISOString(); + } + if (utils_default.isBoolean(value)) { + return value.toString(); + } + if (!useBlob && utils_default.isBlob(value)) { + throw new AxiosError_default("Blob is not supported. Use a Buffer instead."); + } + if (utils_default.isArrayBuffer(value) || utils_default.isTypedArray(value)) { + if (useBlob && typeof _Blob === "function") { + return new _Blob([value]); + } + if (null_default && null_default.isBufferAvailable()) { + return null_default.from(value); + } + throw new AxiosError_default( + "Blob is not supported. Use a Buffer instead.", + AxiosError_default.ERR_NOT_SUPPORT + ); + } + return value; + } + function throwIfMaxDepthExceeded(depth) { + if (depth > maxDepth) { + throw new AxiosError_default( + "Object is too deeply nested (" + depth + " levels). Max depth: " + maxDepth, + AxiosError_default.ERR_FORM_DATA_DEPTH_EXCEEDED + ); + } + } + function stringifyWithDepthLimit(value, depth) { + if (maxDepth === Infinity) { + return JSON.stringify(value); + } + const ancestors = []; + return JSON.stringify(value, function limitDepth(_key, currentValue) { + if (!utils_default.isObject(currentValue)) { + return currentValue; + } + while (ancestors.length && ancestors[ancestors.length - 1] !== this) { + ancestors.pop(); + } + ancestors.push(currentValue); + throwIfMaxDepthExceeded(depth + ancestors.length - 1); + return currentValue; + }); + } + function defaultVisitor(value, key, path) { + let arr = value; + if (utils_default.isReactNative(formData) && utils_default.isReactNativeBlob(value)) { + formData.append(renderKey(path, key, dots), convertValue(value)); + return false; + } + if (value && !path && typeof value === "object") { + if (utils_default.endsWith(key, "{}")) { + key = metaTokens ? key : key.slice(0, -2); + value = stringifyWithDepthLimit(value, 1); + } else if (utils_default.isArray(value) && isFlatArray(value) || (utils_default.isFileList(value) || utils_default.endsWith(key, "[]")) && (arr = utils_default.toArray(value))) { + key = removeBrackets(key); + arr.forEach(function each(el, index) { + !(utils_default.isUndefined(el) || el === null) && formData.append( + // eslint-disable-next-line no-nested-ternary + indexes === true ? renderKey([key], index, dots) : indexes === null ? key : key + "[]", + convertValue(el) + ); + }); + return false; + } + } + if (isVisitable(value)) { + return true; + } + formData.append(renderKey(path, key, dots), convertValue(value)); + return false; + } + const exposedHelpers = Object.assign(predicates, { + defaultVisitor, + convertValue, + isVisitable + }); + function build(value, path, depth = 0) { + if (utils_default.isUndefined(value)) return; + throwIfMaxDepthExceeded(depth); + if (stack.indexOf(value) !== -1) { + throw new Error("Circular reference detected in " + path.join(".")); + } + stack.push(value); + utils_default.forEach(value, function each(el, key) { + const result = !(utils_default.isUndefined(el) || el === null) && visitor.call(formData, el, utils_default.isString(key) ? key.trim() : key, path, exposedHelpers); + if (result === true) { + build(el, path ? path.concat(key) : [key], depth + 1); + } + }); + stack.pop(); + } + if (!utils_default.isObject(obj)) { + throw new TypeError("data must be an object"); + } + build(obj); + return formData; +} +var toFormData_default = toFormData; + +// node_modules/axios/lib/helpers/AxiosURLSearchParams.js +function encode(str) { + const charMap = { + "!": "%21", + "'": "%27", + "(": "%28", + ")": "%29", + "~": "%7E", + "%20": "+" + }; + return encodeURIComponent(str).replace(/[!'()~]|%20/g, function replacer(match) { + return charMap[match]; + }); +} +function AxiosURLSearchParams(params, options) { + this._pairs = []; + params && toFormData_default(params, this, options); +} +var prototype = AxiosURLSearchParams.prototype; +prototype.append = function append(name, value) { + this._pairs.push([name, value]); +}; +prototype.toString = function toString2(encoder) { + const _encode = encoder ? (value) => encoder.call(this, value, encode) : encode; + return this._pairs.map(function each(pair) { + return _encode(pair[0]) + "=" + _encode(pair[1]); + }, "").join("&"); +}; +var AxiosURLSearchParams_default = AxiosURLSearchParams; + +// node_modules/axios/lib/helpers/buildURL.js +function encode2(val) { + return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+"); +} +function buildURL(url, params, options) { + if (!params) { + return url; + } + url = url || ""; + const _options = utils_default.isFunction(options) ? { + serialize: options + } : options; + const _encode = utils_default.getSafeProp(_options, "encode") || encode2; + const serializeFn = utils_default.getSafeProp(_options, "serialize"); + let serializedParams; + if (serializeFn) { + serializedParams = serializeFn(params, _options); + } else { + serializedParams = utils_default.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams_default(params, _options).toString(_encode); + } + if (serializedParams) { + const hashmarkIndex = url.indexOf("#"); + if (hashmarkIndex !== -1) { + url = url.slice(0, hashmarkIndex); + } + url += (url.indexOf("?") === -1 ? "?" : "&") + serializedParams; + } + return url; +} + +// node_modules/axios/lib/core/InterceptorManager.js +var $internals2 = Symbol("internals"); +function countHandlers(handlers) { + return handlers ? handlers.length : 0; +} +function trimHandlers(handlers) { + if (!handlers) { + return; + } + while (handlers.length && handlers[handlers.length - 1] === null) { + handlers.pop(); + } +} +function syncHandlerEntries(manager, internals) { + const handlers = manager.handlers; + const length = countHandlers(handlers); + if (handlers !== internals.handlersRef) { + internals.handlersRef = handlers; + internals.handlerEntries.clear(); + } else if (length !== internals.handlersLength) { + if (!length) { + internals.handlerEntries.clear(); + } else { + internals.handlerEntries.forEach(function removeStaleEntry(entry, id) { + if (handlers[entry.index] !== entry.handler) { + internals.handlerEntries.delete(id); + } + }); + } + } + internals.handlersLength = length; +} +var InterceptorManager = class { + constructor() { + this.handlers = []; + this[$internals2] = { + handlersRef: this.handlers, + handlersLength: this.handlers.length, + handlerEntries: /* @__PURE__ */ new Map(), + iterationDepth: 0, + nextId: 0 + }; + } + /** + * Add a new interceptor to the stack + * + * @param {Function} fulfilled The function to handle `then` for a `Promise` + * @param {Function} rejected The function to handle `reject` for a `Promise` + * @param {Object} options The options for the interceptor, synchronous and runWhen + * + * @return {Number} An ID used to remove interceptor later + */ + use(fulfilled, rejected, options) { + const handler = { + fulfilled, + rejected, + synchronous: options ? options.synchronous : false, + runWhen: options ? options.runWhen : null + }; + const internals = this[$internals2]; + if (this.handlers == null) { + this.handlers = []; + } + syncHandlerEntries(this, internals); + const id = internals.nextId++; + this.handlers.push(handler); + internals.handlerEntries.set(id, { + handler, + index: this.handlers.length - 1 + }); + internals.handlersLength = this.handlers.length; + return id; + } + /** + * Remove an interceptor from the stack + * + * @param {Number} id The ID that was returned by `use` + * + * @returns {void} + */ + eject(id) { + const internals = this[$internals2]; + syncHandlerEntries(this, internals); + const entry = internals.handlerEntries.get(id); + if (entry) { + internals.handlerEntries.delete(id); + if (this.handlers[entry.index] !== entry.handler) { + return; + } + this.handlers[entry.index] = null; + if (!internals.iterationDepth) { + trimHandlers(this.handlers); + internals.handlersLength = this.handlers.length; + } + } + } + /** + * Clear all interceptors from the stack + * + * @returns {void} + */ + clear() { + if (this.handlers) { + this.handlers = []; + syncHandlerEntries(this, this[$internals2]); + } + } + /** + * Iterate over all the registered interceptors + * + * This method is particularly useful for skipping over any + * interceptors that may have become `null` calling `eject`. + * + * @param {Function} fn The function to call for each interceptor + * + * @returns {void} + */ + forEach(fn) { + const internals = this[$internals2]; + syncHandlerEntries(this, internals); + internals.iterationDepth++; + try { + utils_default.forEach(this.handlers, function forEachHandler(h) { + if (h !== null) { + fn(h); + } + }); + } finally { + if (!--internals.iterationDepth) { + syncHandlerEntries(this, internals); + trimHandlers(this.handlers); + internals.handlersLength = countHandlers(this.handlers); + } + } + } +}; +var InterceptorManager_default = InterceptorManager; + +// node_modules/axios/lib/defaults/transitional.js +var transitional_default = { + silentJSONParsing: true, + forcedJSONParsing: true, + clarifyTimeoutError: false, + legacyInterceptorReqResOrdering: true, + advertiseZstdAcceptEncoding: false, + validateStatusUndefinedResolves: true +}; + +// node_modules/axios/lib/platform/browser/classes/URLSearchParams.js +var URLSearchParams_default = typeof URLSearchParams !== "undefined" ? URLSearchParams : AxiosURLSearchParams_default; + +// node_modules/axios/lib/platform/browser/classes/FormData.js +var FormData_default = typeof FormData !== "undefined" ? FormData : null; + +// node_modules/axios/lib/platform/browser/classes/Blob.js +var Blob_default = typeof Blob !== "undefined" ? Blob : null; + +// node_modules/axios/lib/platform/browser/index.js +var browser_default = { + isBrowser: true, + classes: { + URLSearchParams: URLSearchParams_default, + FormData: FormData_default, + Blob: Blob_default + }, + protocols: ["http", "https", "file", "blob", "url", "data"] +}; + +// node_modules/axios/lib/platform/common/utils.js +var utils_exports = {}; +__export(utils_exports, { + hasBrowserEnv: () => hasBrowserEnv, + hasStandardBrowserEnv: () => hasStandardBrowserEnv, + hasStandardBrowserWebWorkerEnv: () => hasStandardBrowserWebWorkerEnv, + navigator: () => _navigator, + origin: () => origin +}); +var hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined"; +var _navigator = typeof navigator === "object" && navigator || void 0; +var hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ["ReactNative", "NativeScript", "NS"].indexOf(_navigator.product) < 0); +var hasStandardBrowserWebWorkerEnv = (() => { + return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef + self instanceof WorkerGlobalScope && typeof self.importScripts === "function"; +})(); +var origin = hasBrowserEnv && window.location.href || "http://localhost"; + +// node_modules/axios/lib/platform/index.js +var platform_default = { + ...utils_exports, + ...browser_default +}; + +// node_modules/axios/lib/helpers/toURLEncodedForm.js +function toURLEncodedForm(data, options) { + return toFormData_default(data, new platform_default.classes.URLSearchParams(), { + visitor: function(value, key, path, helpers) { + if (platform_default.isNode && utils_default.isBuffer(value)) { + this.append(key, value.toString("base64")); + return false; + } + return helpers.defaultVisitor.apply(this, arguments); + }, + ...options + }); +} + +// node_modules/axios/lib/helpers/formDataToJSON.js +var MAX_DEPTH = DEFAULT_FORM_DATA_MAX_DEPTH; +function throwIfDepthExceeded(index) { + if (index > MAX_DEPTH) { + throw new AxiosError_default( + "FormData field is too deeply nested (" + index + " levels). Max depth: " + MAX_DEPTH, + AxiosError_default.ERR_FORM_DATA_DEPTH_EXCEEDED + ); + } +} +function parsePropPath(name) { + const path = []; + const pattern = /[^.[\]]+|\[([^.[\]]*)]/g; + let match; + while ((match = pattern.exec(name)) !== null) { + throwIfDepthExceeded(path.length); + path.push(match[0] === "[]" ? "" : match[1] || match[0]); + } + return path; +} +function arrayToObject(arr) { + const obj = {}; + const keys = Object.keys(arr); + let i; + const len = keys.length; + let key; + for (i = 0; i < len; i++) { + key = keys[i]; + obj[key] = arr[key]; + } + return obj; +} +function formDataToJSON(formData) { + function buildPath(path, value, target, index) { + throwIfDepthExceeded(index); + let name = path[index++]; + if (name === "__proto__") return true; + const isNumericKey = Number.isFinite(+name); + const isLast = index >= path.length; + name = !name && utils_default.isArray(target) ? target.length : name; + if (isLast) { + if (utils_default.hasOwnProp(target, name)) { + target[name] = utils_default.isArray(target[name]) ? target[name].concat(value) : [target[name], value]; + } else { + target[name] = value; + } + return !isNumericKey; + } + if (!utils_default.hasOwnProp(target, name) || !utils_default.isObject(target[name])) { + target[name] = []; + } + const result = buildPath(path, value, target[name], index); + if (result && utils_default.isArray(target[name])) { + target[name] = arrayToObject(target[name]); + } + return !isNumericKey; + } + if (utils_default.isFormData(formData) && utils_default.isFunction(formData.entries)) { + const obj = {}; + utils_default.forEachEntry(formData, (name, value) => { + buildPath(parsePropPath(name), value, obj, 0); + }); + return obj; + } + return null; +} +var formDataToJSON_default = formDataToJSON; + +// node_modules/axios/lib/core/methodList.js +var methodList = Object.freeze([ + "get", + "delete", + "head", + "options", + "post", + "put", + "patch", + "purge", + "link", + "unlink", + "query" +]); +var methodList_default = methodList; + +// node_modules/axios/lib/defaults/index.js +var own = (obj, key) => obj != null && utils_default.hasOwnProp(obj, key) ? obj[key] : void 0; +function stringifySafely2(rawValue, parser, encoder) { + if (utils_default.isString(rawValue)) { + try { + (parser || JSON.parse)(rawValue); + return utils_default.trim(rawValue); + } catch (e) { + if (e.name !== "SyntaxError") { + throw e; + } + } + } + return (encoder || JSON.stringify)(rawValue); +} +var defaults = { + transitional: transitional_default, + adapter: ["xhr", "http", "fetch"], + transformRequest: [ + function transformRequest(data, headers) { + const contentType = headers.getContentType() || ""; + const hasJSONContentType = contentType.indexOf("application/json") > -1; + const isObjectPayload = utils_default.isObject(data); + if (isObjectPayload && utils_default.isHTMLForm(data)) { + data = new FormData(data); + } + const isFormData2 = utils_default.isFormData(data); + if (isFormData2) { + return hasJSONContentType ? JSON.stringify(formDataToJSON_default(data)) : data; + } + if (utils_default.isArrayBuffer(data) || utils_default.isBuffer(data) || utils_default.isStream(data) || utils_default.isFile(data) || utils_default.isBlob(data) || utils_default.isReadableStream(data)) { + return data; + } + if (utils_default.isArrayBufferView(data)) { + return data.buffer; + } + if (utils_default.isURLSearchParams(data)) { + headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false); + return data.toString(); + } + let isFileList2; + if (isObjectPayload) { + const formSerializer = own(this, "formSerializer"); + if (contentType.indexOf("application/x-www-form-urlencoded") > -1) { + return toURLEncodedForm(data, formSerializer).toString(); + } + if ((isFileList2 = utils_default.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) { + const env = own(this, "env"); + const _FormData = env && env.FormData; + return toFormData_default( + isFileList2 ? { "files[]": data } : data, + _FormData && new _FormData(), + formSerializer + ); + } + } + if (isObjectPayload || hasJSONContentType) { + headers.setContentType("application/json", false); + return stringifySafely2(data); + } + return data; + } + ], + transformResponse: [ + function transformResponse(data) { + const transitional2 = own(this, "transitional") || defaults.transitional; + const forcedJSONParsing = transitional2 && transitional2.forcedJSONParsing; + const responseType = own(this, "responseType"); + const JSONRequested = responseType === "json"; + if (utils_default.isResponse(data) || utils_default.isReadableStream(data)) { + return data; + } + if (data && utils_default.isString(data) && (forcedJSONParsing && !responseType || JSONRequested)) { + const silentJSONParsing = transitional2 && transitional2.silentJSONParsing; + const strictJSONParsing = !silentJSONParsing && JSONRequested; + try { + return JSON.parse(data, own(this, "parseReviver")); + } catch (e) { + if (strictJSONParsing) { + if (e.name === "SyntaxError") { + throw AxiosError_default.from(e, AxiosError_default.ERR_BAD_RESPONSE, this, null, own(this, "response")); + } + throw e; + } + } + } + return data; + } + ], + /** + * A timeout in milliseconds to abort a request. If set to 0 (default) a + * timeout is not created. + */ + timeout: 0, + xsrfCookieName: "XSRF-TOKEN", + xsrfHeaderName: "X-XSRF-TOKEN", + maxContentLength: -1, + maxBodyLength: -1, + env: { + FormData: platform_default.classes.FormData, + Blob: platform_default.classes.Blob + }, + validateStatus: function validateStatus(status) { + return status >= 200 && status < 300; + }, + headers: { + common: { + Accept: "application/json, text/plain, */*", + "Content-Type": void 0 + } + } +}; +utils_default.forEach(methodList_default, (method) => { + defaults.headers[method] = {}; +}); +var defaults_default = defaults; + +// node_modules/axios/lib/core/transformData.js +function transformData(fns, response) { + const config = this || defaults_default; + const context = response || config; + const headers = AxiosHeaders_default.from(context.headers); + let data = context.data; + utils_default.forEach(fns, function transform(fn) { + data = fn.call(config, data, headers.normalize(), response ? response.status : void 0); + }); + headers.normalize(); + return data; +} + +// node_modules/axios/lib/cancel/isCancel.js +function isCancel(value) { + return !!(value && value.__CANCEL__); +} + +// node_modules/axios/lib/cancel/CanceledError.js +var CanceledError = class extends AxiosError_default { + /** + * A `CanceledError` is an object that is thrown when an operation is canceled. + * + * @param {string=} message The message. + * @param {Object=} config The config. + * @param {Object=} request The request. + * + * @returns {CanceledError} The created error. + */ + constructor(message, config, request) { + super(message == null ? "canceled" : message, AxiosError_default.ERR_CANCELED, config, request); + this.name = "CanceledError"; + this.__CANCEL__ = true; + } +}; +var CanceledError_default = CanceledError; + +// node_modules/axios/lib/core/settle.js +function settle(resolve, reject, response) { + const validateStatus2 = response.config.validateStatus; + if (!response.status || !validateStatus2 || validateStatus2(response.status)) { + resolve(response); + } else { + reject(new AxiosError_default( + "Request failed with status code " + response.status, + response.status >= 400 && response.status < 500 ? AxiosError_default.ERR_BAD_REQUEST : AxiosError_default.ERR_BAD_RESPONSE, + response.config, + response.request, + response + )); + } +} + +// node_modules/axios/lib/helpers/normalizeURLForProtocolCheck.js +var urlParserControlCharacters = /[\t\n\r]/g; +function normalizeURLForProtocolCheck(url) { + if (typeof url !== "string") { + return url; + } + let start = 0; + while (start < url.length && url.charCodeAt(start) <= 32) { + start++; + } + return url.slice(start).replace(urlParserControlCharacters, ""); +} + +// node_modules/axios/lib/helpers/parseProtocol.js +function parseProtocol(url) { + const match = /^([-+\w]{1,25}):(?:\/\/)?/.exec(url); + return match && match[1] || ""; +} + +// node_modules/axios/lib/helpers/speedometer.js +function speedometer(samplesCount, min) { + samplesCount = samplesCount || 10; + const bytes = new Array(samplesCount); + const timestamps = new Array(samplesCount); + let head = 0; + let tail = 0; + let firstSampleTS; + min = min !== void 0 ? min : 1e3; + return function push(chunkLength) { + const now = Date.now(); + const startedAt = timestamps[tail]; + if (!firstSampleTS) { + firstSampleTS = now; + } + bytes[head] = chunkLength; + timestamps[head] = now; + let i = tail; + let bytesCount = 0; + while (i !== head) { + bytesCount += bytes[i++]; + i = i % samplesCount; + } + head = (head + 1) % samplesCount; + if (head === tail) { + tail = (tail + 1) % samplesCount; + } + if (now - firstSampleTS < min) { + return; + } + const passed = startedAt && now - startedAt; + return passed ? Math.round(bytesCount * 1e3 / passed) : void 0; + }; +} +var speedometer_default = speedometer; + +// node_modules/axios/lib/helpers/throttle.js +function throttle(fn, freq) { + let timestamp = 0; + let threshold = 1e3 / freq; + let lastArgs; + let timer; + const invoke = (args, now = Date.now()) => { + timestamp = now; + lastArgs = null; + if (timer) { + clearTimeout(timer); + timer = null; + } + fn(...args); + }; + const throttled = (...args) => { + const now = Date.now(); + const passed = now - timestamp; + if (passed >= threshold) { + invoke(args, now); + } else { + lastArgs = args; + if (!timer) { + timer = setTimeout(() => { + timer = null; + invoke(lastArgs); + }, threshold - passed); + } + } + }; + const flush = () => lastArgs && invoke(lastArgs); + const flushWith = (...args) => invoke(args); + return [throttled, flush, flushWith]; +} +var throttle_default = throttle; + +// node_modules/axios/lib/helpers/progressEventReducer.js +var progressEventReducer = (listener, isDownloadStream, freq = 3) => { + let bytesNotified = 0; + const _speedometer = speedometer_default(50, 250); + return throttle_default((e) => { + if (!e || !utils_default.isNumber(e.loaded)) { + return; + } + const rawLoaded = e.loaded; + const total = e.lengthComputable ? e.total : void 0; + const loaded = Math.max(0, total != null ? Math.min(rawLoaded, total) : rawLoaded); + const progressBytes = Math.max(0, loaded - bytesNotified); + const rate = _speedometer(progressBytes); + bytesNotified = Math.max(bytesNotified, loaded); + const data = { + loaded, + total, + progress: total ? loaded / total : void 0, + bytes: progressBytes, + rate: rate ? rate : void 0, + estimated: rate && total ? (total - loaded) / rate : void 0, + event: e, + lengthComputable: total != null, + [isDownloadStream ? "download" : "upload"]: true + }; + listener(data); + }, freq); +}; +var progressEventDecorator = (total, throttled) => { + const lengthComputable = total != null; + return [ + (loaded) => throttled[0]({ + lengthComputable, + total, + loaded + }), + throttled[1] + ]; +}; +var asyncDecorator = (fn, scheduler = utils_default.asap) => (...args) => scheduler(() => fn(...args)); + +// node_modules/axios/lib/helpers/isURLSameOrigin.js +var isURLSameOrigin_default = platform_default.hasStandardBrowserEnv ? /* @__PURE__ */ ((origin2, isMSIE) => (url) => { + url = new URL(url, platform_default.origin); + return origin2.protocol === url.protocol && origin2.host === url.host && (isMSIE || origin2.port === url.port); +})( + new URL(platform_default.origin), + platform_default.navigator && /(msie|trident)/i.test(platform_default.navigator.userAgent) +) : () => true; + +// node_modules/axios/lib/helpers/cookies.js +var cookies_default = platform_default.hasStandardBrowserEnv ? ( + // Standard browser envs support document.cookie + { + write(name, value, expires, path, domain, secure, sameSite) { + if (typeof document === "undefined") return; + const cookie = [`${name}=${encodeURIComponent(value)}`]; + if (utils_default.isNumber(expires)) { + cookie.push(`expires=${new Date(expires).toUTCString()}`); + } + if (utils_default.isString(path)) { + cookie.push(`path=${path}`); + } + if (utils_default.isString(domain)) { + cookie.push(`domain=${domain}`); + } + if (secure === true) { + cookie.push("secure"); + } + if (utils_default.isString(sameSite)) { + cookie.push(`SameSite=${sameSite}`); + } + document.cookie = cookie.join("; "); + }, + read(name) { + if (typeof document === "undefined") return null; + const cookies = document.cookie.split(";"); + for (let i = 0; i < cookies.length; i++) { + const cookie = cookies[i].replace(/^\s+/, ""); + const eq = cookie.indexOf("="); + if (eq !== -1 && cookie.slice(0, eq) === name) { + try { + return decodeURIComponent(cookie.slice(eq + 1)); + } catch (e) { + return cookie.slice(eq + 1); + } + } + } + return null; + }, + remove(name) { + this.write(name, "", Date.now() - 864e5, "/"); + } + } +) : ( + // Non-standard browser env (web workers, react-native) lack needed support. + { + write() { + }, + read() { + return null; + }, + remove() { + } + } +); + +// node_modules/axios/lib/helpers/isAbsoluteURL.js +function isAbsoluteURL(url) { + if (typeof url !== "string") { + return false; + } + return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url); +} + +// node_modules/axios/lib/helpers/combineURLs.js +function combineURLs(baseURL, relativeURL) { + if (!relativeURL) { + return baseURL; + } + let end = baseURL.length; + while (end > 0 && baseURL.charCodeAt(end - 1) === 47) { + end--; + } + return baseURL.slice(0, end) + "/" + relativeURL.replace(/^\/+/, ""); +} + +// node_modules/axios/lib/core/buildFullPath.js +var malformedHttpProtocol = /^https?:(?!\/\/)/i; +function redactFragment(fragment) { + if (!fragment) { + return fragment; + } + return fragment.replace(/(^|&)([^=&]*=)?[^&]+/g, (match, separator, parameterName = "") => { + return `${separator}${parameterName}${REDACTED}`; + }); +} +function redactSensitiveURLParts(url) { + const redactedURL = url.replace(/^(https?:\/{0,2})[^/?#]*@/i, `$1${REDACTED}@`); + const fragmentIndex = redactedURL.indexOf("#"); + const urlWithoutFragment = fragmentIndex === -1 ? redactedURL : redactedURL.slice(0, fragmentIndex); + const redactedURLWithoutFragment = urlWithoutFragment.replace( + /([?&][^=&#]*=)[^&#]*/g, + `$1${REDACTED}` + ); + if (fragmentIndex === -1) { + return redactedURLWithoutFragment; + } + return `${redactedURLWithoutFragment}#${redactFragment(redactedURL.slice(fragmentIndex + 1))}`; +} +function assertValidHttpProtocolURL(url, config) { + if (typeof url === "string") { + const normalizedURL = normalizeURLForProtocolCheck(url); + if (malformedHttpProtocol.test(normalizedURL)) { + throw new AxiosError_default( + `Invalid URL ${JSON.stringify(redactSensitiveURLParts(normalizedURL))}: missing "//" after protocol`, + AxiosError_default.ERR_INVALID_URL, + config + ); + } + } +} +function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls, config) { + assertValidHttpProtocolURL(requestedURL, config); + let isRelativeUrl = !isAbsoluteURL(requestedURL); + if (baseURL && (isRelativeUrl || allowAbsoluteUrls === false)) { + assertValidHttpProtocolURL(baseURL, config); + return combineURLs(baseURL, requestedURL); + } + return requestedURL; +} + +// node_modules/axios/lib/core/mergeConfig.js +var headersToObject = (thing) => thing instanceof AxiosHeaders_default ? { ...thing } : thing; +var ownEnumerableKeys = (thing) => { + if (Object.getOwnPropertySymbols && Object.getOwnPropertyDescriptor) { + return Object.keys(thing).concat( + Object.getOwnPropertySymbols(thing).filter( + (symbol) => Object.getOwnPropertyDescriptor(thing, symbol).enumerable + ) + ); + } + return Object.keys(thing); +}; +function mergeConfig(config1, config2) { + config1 = config1 || {}; + config2 = config2 || {}; + const config = /* @__PURE__ */ Object.create(null); + Object.defineProperty(config, "hasOwnProperty", { + // Null-proto descriptor so a polluted Object.prototype.get cannot turn + // this data descriptor into an accessor descriptor on the way in. + __proto__: null, + value: Object.prototype.hasOwnProperty, + enumerable: false, + writable: true, + configurable: true + }); + function getMergedValue(target, source, prop, caseless) { + if (utils_default.isPlainObject(target) && utils_default.isPlainObject(source)) { + return utils_default.merge.call({ caseless }, target, source); + } else if (utils_default.isPlainObject(source)) { + return utils_default.merge({}, source); + } else if (utils_default.isArray(source)) { + return source.slice(); + } + return source; + } + function mergeDeepProperties(a, b, prop, caseless) { + if (!utils_default.isUndefined(b)) { + return getMergedValue(a, b, prop, caseless); + } else if (!utils_default.isUndefined(a)) { + return getMergedValue(void 0, a, prop, caseless); + } + } + function valueFromConfig2(a, b) { + if (!utils_default.isUndefined(b)) { + return getMergedValue(void 0, b); + } + } + function defaultToConfig2(a, b) { + if (!utils_default.isUndefined(b)) { + return getMergedValue(void 0, b); + } else if (!utils_default.isUndefined(a)) { + return getMergedValue(void 0, a); + } + } + function getMergedTransitionalOption(prop) { + const transitional2 = utils_default.hasOwnProp(config2, "transitional") ? config2.transitional : void 0; + if (!utils_default.isUndefined(transitional2)) { + if (utils_default.isPlainObject(transitional2)) { + if (utils_default.hasOwnProp(transitional2, prop)) { + return transitional2[prop]; + } + } else { + return void 0; + } + } + const transitional1 = utils_default.hasOwnProp(config1, "transitional") ? config1.transitional : void 0; + if (utils_default.isPlainObject(transitional1) && utils_default.hasOwnProp(transitional1, prop)) { + return transitional1[prop]; + } + return void 0; + } + function mergeDirectKeys(a, b, prop) { + if (utils_default.hasOwnProp(config2, prop)) { + return getMergedValue(a, b); + } else if (utils_default.hasOwnProp(config1, prop)) { + return getMergedValue(void 0, a); + } + } + const mergeMap = { + url: valueFromConfig2, + method: valueFromConfig2, + data: valueFromConfig2, + baseURL: defaultToConfig2, + transformRequest: defaultToConfig2, + transformResponse: defaultToConfig2, + paramsSerializer: defaultToConfig2, + timeout: defaultToConfig2, + timeoutErrorMessage: defaultToConfig2, + withCredentials: defaultToConfig2, + withXSRFToken: defaultToConfig2, + adapter: defaultToConfig2, + responseType: defaultToConfig2, + xsrfCookieName: defaultToConfig2, + xsrfHeaderName: defaultToConfig2, + onUploadProgress: defaultToConfig2, + onDownloadProgress: defaultToConfig2, + decompress: defaultToConfig2, + maxContentLength: defaultToConfig2, + maxBodyLength: defaultToConfig2, + beforeRedirect: defaultToConfig2, + transport: defaultToConfig2, + httpAgent: defaultToConfig2, + httpsAgent: defaultToConfig2, + cancelToken: defaultToConfig2, + socketPath: defaultToConfig2, + allowedSocketPaths: defaultToConfig2, + responseEncoding: defaultToConfig2, + validateStatus: mergeDirectKeys, + headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true) + }; + utils_default.forEach(ownEnumerableKeys({ ...config1, ...config2 }), function computeConfigValue(prop) { + if (prop === "__proto__" || prop === "constructor" || prop === "prototype") return; + const merge2 = utils_default.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties; + const a = utils_default.hasOwnProp(config1, prop) ? config1[prop] : void 0; + const b = utils_default.hasOwnProp(config2, prop) ? config2[prop] : void 0; + const configValue = merge2(a, b, prop); + utils_default.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue); + }); + if (utils_default.hasOwnProp(config2, "validateStatus") && utils_default.isUndefined(config2.validateStatus) && getMergedTransitionalOption("validateStatusUndefinedResolves") === false) { + if (utils_default.hasOwnProp(config1, "validateStatus")) { + config.validateStatus = getMergedValue(void 0, config1.validateStatus); + } else { + delete config.validateStatus; + } + } + return config; +} + +// node_modules/axios/lib/core/setFormDataHeaders.js +var FORM_DATA_CONTENT_HEADERS = ["content-type", "content-length"]; +function setFormDataHeaders(headers, formHeaders, policy) { + if (policy !== "content-only") { + headers.set(formHeaders); + return; + } + Object.entries(formHeaders || {}).forEach(([key, val]) => { + if (FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) { + headers.set(key, val); + } + }); +} + +// node_modules/axios/lib/helpers/resolveConfig.js +var encodeUTF8 = (str) => encodeURIComponent(str).replace( + /%([0-9A-F]{2})/gi, + (_, hex) => String.fromCharCode(parseInt(hex, 16)) +); +function resolveConfig(config) { + const newConfig = mergeConfig({}, config); + const own2 = (key) => utils_default.hasOwnProp(newConfig, key) ? newConfig[key] : void 0; + const data = own2("data"); + let withXSRFToken = own2("withXSRFToken"); + const xsrfHeaderName = own2("xsrfHeaderName"); + const xsrfCookieName = own2("xsrfCookieName"); + let headers = own2("headers"); + const auth = own2("auth"); + const baseURL = own2("baseURL"); + const allowAbsoluteUrls = own2("allowAbsoluteUrls"); + const url = own2("url"); + newConfig.headers = headers = AxiosHeaders_default.from(headers); + newConfig.url = buildURL( + buildFullPath(baseURL, url, allowAbsoluteUrls, newConfig), + own2("params"), + own2("paramsSerializer") + ); + if (auth) { + const username = utils_default.getSafeProp(auth, "username") || ""; + const password = utils_default.getSafeProp(auth, "password") || ""; + try { + headers.set( + "Authorization", + "Basic " + btoa(username + ":" + (password ? encodeUTF8(password) : "")) + ); + } catch (e) { + throw AxiosError_default.from(e, AxiosError_default.ERR_BAD_OPTION_VALUE, config); + } + } + if (utils_default.isFormData(data)) { + const getHeaders = utils_default.getSafeProp(data, "getHeaders"); + if (platform_default.hasStandardBrowserEnv || platform_default.hasStandardBrowserWebWorkerEnv || utils_default.isReactNative(data)) { + headers.setContentType(void 0); + } else if (utils_default.isFunction(getHeaders)) { + setFormDataHeaders(headers, getHeaders.call(data), own2("formDataHeaderPolicy")); + } + } + if (platform_default.hasStandardBrowserEnv) { + if (utils_default.isFunction(withXSRFToken)) { + withXSRFToken = withXSRFToken(newConfig); + } + const shouldSendXSRF = withXSRFToken === true || withXSRFToken == null && isURLSameOrigin_default(newConfig.url); + if (shouldSendXSRF) { + const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies_default.read(xsrfCookieName); + if (xsrfValue) { + headers.set(xsrfHeaderName, xsrfValue); + } + } + } + return newConfig; +} +var resolveConfig_default = resolveConfig; + +// node_modules/axios/lib/adapters/xhr.js +var isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined"; +var xhr_default = isXHRAdapterSupported && function(config) { + return new Promise(function dispatchXhrRequest(resolve, reject) { + const _config = resolveConfig_default(config); + let requestData = _config.data; + const requestHeaders = AxiosHeaders_default.from(_config.headers).normalize(); + let { responseType, onUploadProgress, onDownloadProgress } = _config; + let onCanceled; + let uploadThrottled, downloadThrottled; + let flushUpload, flushDownload, flushDownloadWithEvent; + function done() { + flushUpload && flushUpload(); + flushDownload && flushDownload(); + _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled); + _config.signal && _config.signal.removeEventListener("abort", onCanceled); + } + let request = new XMLHttpRequest(); + request.open(_config.method.toUpperCase(), _config.url, true); + request.timeout = _config.timeout; + function onloadend(event) { + if (!request) { + return; + } + if (request.status === 0 && (parseProtocol(normalizeURLForProtocolCheck(_config.url)) || parseProtocol(platform_default.origin)) !== "file" && !(request.responseURL && request.responseURL.startsWith("file:"))) { + reject(new AxiosError_default("Request aborted", AxiosError_default.ECONNABORTED, config, request)); + done(); + request = null; + return; + } + try { + if (event) { + flushDownloadWithEvent && flushDownloadWithEvent(event); + } else { + flushDownload && flushDownload(); + } + } catch (err) { + setTimeout(() => { + throw err; + }); + } + if (!request) { + return; + } + const responseHeaders = AxiosHeaders_default.from( + "getAllResponseHeaders" in request && request.getAllResponseHeaders() + ); + const responseData = !responseType || responseType === "text" || responseType === "json" ? request.responseText : request.response; + const response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders, + config, + request + }; + settle( + function _resolve(value) { + resolve(value); + done(); + }, + function _reject(err) { + reject(err); + done(); + }, + response + ); + request = null; + } + if ("onloadend" in request) { + request.onloadend = onloadend; + } else { + request.onreadystatechange = function handleLoad() { + if (!request || request.readyState !== 4) { + return; + } + if (request.status === 0 && !(request.responseURL && request.responseURL.startsWith("file:"))) { + return; + } + setTimeout(onloadend); + }; + } + request.onabort = function handleAbort() { + if (!request) { + return; + } + reject(new AxiosError_default("Request aborted", AxiosError_default.ECONNABORTED, config, request)); + done(); + request = null; + }; + request.onerror = function handleError(event) { + const msg = event && event.message ? event.message : "Network Error"; + const err = new AxiosError_default(msg, AxiosError_default.ERR_NETWORK, config, request); + err.event = event || null; + reject(err); + done(); + request = null; + }; + request.ontimeout = function handleTimeout() { + let timeoutErrorMessage = _config.timeout ? "timeout of " + _config.timeout + "ms exceeded" : "timeout exceeded"; + const transitional2 = _config.transitional || transitional_default; + if (_config.timeoutErrorMessage) { + timeoutErrorMessage = _config.timeoutErrorMessage; + } + reject( + new AxiosError_default( + timeoutErrorMessage, + transitional2.clarifyTimeoutError ? AxiosError_default.ETIMEDOUT : AxiosError_default.ECONNABORTED, + config, + request + ) + ); + done(); + request = null; + }; + requestData === void 0 && requestHeaders.setContentType(null); + if ("setRequestHeader" in request) { + utils_default.forEach(toByteStringHeaderObject(requestHeaders), function setRequestHeader(val, key) { + request.setRequestHeader(key, val); + }); + } + if (!utils_default.isUndefined(_config.withCredentials)) { + request.withCredentials = !!_config.withCredentials; + } + if (responseType && responseType !== "json") { + request.responseType = _config.responseType; + } + if (onDownloadProgress) { + [downloadThrottled, flushDownload, flushDownloadWithEvent] = progressEventReducer( + onDownloadProgress, + true + ); + request.addEventListener("progress", downloadThrottled); + } + if (onUploadProgress && request.upload) { + [uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress); + request.upload.addEventListener("progress", uploadThrottled); + request.upload.addEventListener("loadend", flushUpload); + } + if (_config.cancelToken || _config.signal) { + onCanceled = (cancel) => { + if (!request) { + return; + } + reject(!cancel || cancel.type ? new CanceledError_default(null, config, request) : cancel); + request.abort(); + done(); + request = null; + }; + _config.cancelToken && _config.cancelToken.subscribe(onCanceled); + if (_config.signal) { + _config.signal.aborted ? onCanceled() : _config.signal.addEventListener("abort", onCanceled); + } + } + const protocol = parseProtocol(_config.url); + if (protocol && !platform_default.protocols.includes(protocol)) { + reject( + new AxiosError_default( + "Unsupported protocol " + protocol + ":", + AxiosError_default.ERR_BAD_REQUEST, + config + ) + ); + done(); + return; + } + request.send(requestData || null); + }); +}; + +// node_modules/axios/lib/helpers/composeSignals.js +var composeSignals = (signals, timeout) => { + signals = signals ? signals.filter(Boolean) : []; + if (!timeout && !signals.length) { + return; + } + const controller = new AbortController(); + let aborted = false; + const onabort = function(reason) { + if (!aborted) { + aborted = true; + unsubscribe(); + const err = reason instanceof Error ? reason : this.reason; + controller.abort( + err instanceof AxiosError_default ? err : new CanceledError_default(err instanceof Error ? err.message : err) + ); + } + }; + let timer = timeout && setTimeout(() => { + timer = null; + onabort(new AxiosError_default(`timeout of ${timeout}ms exceeded`, AxiosError_default.ETIMEDOUT)); + }, timeout); + const unsubscribe = () => { + if (!signals) { + return; + } + timer && clearTimeout(timer); + timer = null; + signals.forEach((signal2) => { + signal2.unsubscribe ? signal2.unsubscribe(onabort) : signal2.removeEventListener("abort", onabort); + }); + signals = null; + }; + signals.forEach((signal2) => { + if (aborted) { + return; + } + if (signal2.aborted) { + onabort.call(signal2); + return; + } + signal2.addEventListener("abort", onabort, { once: true }); + }); + const { signal } = controller; + signal.unsubscribe = () => utils_default.asap(unsubscribe); + return signal; +}; +var composeSignals_default = composeSignals; + +// node_modules/axios/lib/helpers/trackStream.js +var streamChunk = function* (chunk, chunkSize) { + let len = chunk.byteLength; + if (!chunkSize || len < chunkSize) { + yield chunk; + return; + } + let pos = 0; + let end; + while (pos < len) { + end = pos + chunkSize; + yield chunk.slice(pos, end); + pos = end; + } +}; +var readBytes = async function* (iterable, chunkSize) { + for await (const chunk of readStream(iterable)) { + yield* streamChunk(chunk, chunkSize); + } +}; +var readStream = async function* (stream) { + if (stream[Symbol.asyncIterator]) { + yield* stream; + return; + } + const reader = stream.getReader(); + try { + for (; ; ) { + const { done, value } = await reader.read(); + if (done) { + break; + } + yield value; + } + } finally { + await reader.cancel(); + } +}; +var trackStream = (stream, chunkSize, onProgress, onFinish) => { + const iterator2 = readBytes(stream, chunkSize); + let bytes = 0; + let done; + let _onFinish = (e) => { + if (!done) { + done = true; + onFinish && onFinish(e); + } + }; + return new ReadableStream( + { + async pull(controller) { + try { + const { done: done2, value } = await iterator2.next(); + if (done2) { + _onFinish(); + controller.close(); + return; + } + let len = value.byteLength; + if (onProgress) { + let loadedBytes = bytes += len; + onProgress(loadedBytes); + } + controller.enqueue(new Uint8Array(value)); + } catch (err) { + _onFinish(err); + throw err; + } + }, + cancel(reason) { + _onFinish(reason); + return iterator2.return(); + } + }, + { + highWaterMark: 2 + } + ); +}; + +// node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js +var isHexDigit = (charCode) => charCode >= 48 && charCode <= 57 || charCode >= 65 && charCode <= 70 || charCode >= 97 && charCode <= 102; +var isPercentEncodedByte = (str, i, len) => i + 2 < len && isHexDigit(str.charCodeAt(i + 1)) && isHexDigit(str.charCodeAt(i + 2)); +var hexValue = (charCode) => charCode <= 57 ? charCode - 48 : (charCode & 223) - 55; +var isBase64Char = (charCode) => charCode >= 65 && charCode <= 90 || // A-Z +charCode >= 97 && charCode <= 122 || // a-z +charCode >= 48 && charCode <= 57 || // 0-9 +charCode === 43 || // + +charCode === 47 || // / +charCode === 45 || // - (base64url) +charCode === 95; +var isBase64Whitespace = (charCode) => charCode === 9 || charCode === 10 || charCode === 12 || charCode === 13 || charCode === 32; +var base64Bytes = (significant) => { + const groups = Math.floor(significant / 4); + const remainder = significant % 4; + return groups * 3 + (remainder === 2 ? 1 : remainder === 3 ? 2 : 0); +}; +var estimateBase64BufferAllocation = (body) => { + const len = body.length; + let padding = 0; + if (len > 0 && body.charCodeAt(len - 1) === 61) { + padding++; + if (len > 1 && body.charCodeAt(len - 2) === 61) { + padding++; + } + } + return Math.floor((len - padding) * 3 / 4); +}; +var estimatePercentDecodedBase64Bytes = (body) => { + const len = body.length; + let significant = 0; + let padding = 0; + let invalid = false; + for (let i = 0; i < len; i++) { + let code = body.charCodeAt(i); + if (code === 37 && isPercentEncodedByte(body, i, len)) { + code = hexValue(body.charCodeAt(i + 1)) * 16 + hexValue(body.charCodeAt(i + 2)); + i += 2; + } + if (isBase64Whitespace(code)) { + continue; + } + if (code === 61) { + padding++; + continue; + } + if (!isBase64Char(code) || padding > 0) { + invalid = true; + continue; + } + significant++; + } + if (invalid || padding > 2 || padding > 0 && (significant + padding) % 4 !== 0 || significant % 4 === 1) { + return estimateBase64BufferAllocation(body); + } + return base64Bytes(significant); +}; +var estimateDataURLBytes = (url, estimateBase64) => { + if (!url || typeof url !== "string") return 0; + if (!url.startsWith("data:")) return 0; + const comma = url.indexOf(","); + if (comma < 0) return 0; + const meta = url.slice(5, comma); + const body = url.slice(comma + 1); + const isBase64 = /;base64/i.test(meta); + if (isBase64) { + return estimateBase64(body); + } + let bytes = 0; + for (let i = 0, len = body.length; i < len; i++) { + const c = body.charCodeAt(i); + if (c === 37 && isPercentEncodedByte(body, i, len)) { + bytes += 1; + i += 2; + } else if (c < 128) { + bytes += 1; + } else if (c < 2048) { + bytes += 2; + } else if (c >= 55296 && c <= 56319 && i + 1 < len) { + const next = body.charCodeAt(i + 1); + if (next >= 56320 && next <= 57343) { + bytes += 4; + i++; + } else { + bytes += 3; + } + } else { + bytes += 3; + } + } + return bytes; +}; +function estimateDataURLDecodedBytes(url) { + const fragmentIndex = typeof url === "string" ? url.indexOf("#") : -1; + return estimateDataURLBytes( + fragmentIndex === -1 ? url : url.slice(0, fragmentIndex), + estimatePercentDecodedBase64Bytes + ); +} + +// node_modules/axios/lib/env/data.js +var VERSION = "1.20.0"; + +// node_modules/axios/lib/adapters/fetch.js +var DEFAULT_CHUNK_SIZE = 64 * 1024; +var DEFAULT_REQUEST_OPTIONS = { + cache: "default", + redirect: "follow", + referrer: "about:client", + referrerPolicy: "", + mode: "cors", + integrity: "", + keepalive: false, + priority: "auto", + window: null +}; +var { isFunction: isFunction2 } = utils_default; +var encodeUTF82 = (str) => encodeURIComponent(str).replace( + /%([0-9A-F]{2})/gi, + (_, hex) => String.fromCharCode(parseInt(hex, 16)) +); +var decodeURIComponentSafe = (value) => { + if (!utils_default.isString(value)) { + return value; + } + try { + return decodeURIComponent(value); + } catch (error) { + return value; + } +}; +var test = (fn, ...args) => { + try { + return !!fn(...args); + } catch (e) { + return false; + } +}; +var maybeWithAuthCredentials = (url) => { + const protocolIndex = url.indexOf("://"); + let urlToCheck = url; + if (protocolIndex !== -1) { + urlToCheck = urlToCheck.slice(protocolIndex + 3); + } + return urlToCheck.includes("@") || urlToCheck.includes(":"); +}; +var factory = (env) => { + const globalObject = utils_default.global !== void 0 && utils_default.global !== null ? utils_default.global : globalThis; + const { ReadableStream: ReadableStream2, TextEncoder } = globalObject; + env = utils_default.merge.call( + { + skipUndefined: true + }, + { + Request: globalObject.Request, + Response: globalObject.Response + }, + env + ); + const { fetch: envFetch, Request, Response } = env; + const isFetchSupported = envFetch ? isFunction2(envFetch) : typeof fetch === "function"; + const isRequestSupported = isFunction2(Request); + const isResponseSupported = isFunction2(Response); + if (!isFetchSupported) { + return false; + } + const isReadableStreamSupported = isFetchSupported && isFunction2(ReadableStream2); + const encodeText = isFetchSupported && (typeof TextEncoder === "function" ? /* @__PURE__ */ ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) : async (str) => new Uint8Array(await new Request(str).arrayBuffer())); + const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => { + let duplexAccessed = false; + const request = new Request(platform_default.origin, { + body: new ReadableStream2(), + method: "POST", + get duplex() { + duplexAccessed = true; + return "half"; + } + }); + const hasContentType = request.headers.has("Content-Type"); + if (request.body != null) { + request.body.cancel(); + } + return duplexAccessed && !hasContentType; + }); + const supportsResponseStream = isResponseSupported && isReadableStreamSupported && test(() => utils_default.isReadableStream(new Response("").body)); + const resolvers = { + stream: supportsResponseStream && ((res) => res.body) + }; + isFetchSupported && (() => { + ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type) => { + !resolvers[type] && (resolvers[type] = (res, config) => { + let method = res && res[type]; + if (method) { + return method.call(res); + } + throw new AxiosError_default( + `Response type '${type}' is not supported`, + AxiosError_default.ERR_NOT_SUPPORT, + config + ); + }); + }); + })(); + const getBodyLength = async (body) => { + if (body == null) { + return 0; + } + if (utils_default.isBlob(body)) { + return body.size; + } + if (utils_default.isSpecCompliantForm(body)) { + const _request = new Request(platform_default.origin, { + method: "POST", + body + }); + return (await _request.arrayBuffer()).byteLength; + } + if (utils_default.isArrayBufferView(body) || utils_default.isArrayBuffer(body)) { + return body.byteLength; + } + if (utils_default.isURLSearchParams(body)) { + body = body + ""; + } + if (utils_default.isString(body)) { + return (await encodeText(body)).byteLength; + } + }; + const resolveBodyLength = async (headers, body) => { + const length = utils_default.toFiniteNumber(headers.getContentLength()); + return length == null ? getBodyLength(body) : length; + }; + return async (config) => { + let { + url, + method, + data, + signal, + cancelToken, + timeout, + onDownloadProgress, + onUploadProgress, + responseType, + headers, + withCredentials = "same-origin", + fetchOptions, + maxContentLength, + maxBodyLength, + maxRedirects + } = resolveConfig_default(config); + const hasMaxContentLength = utils_default.isNumber(maxContentLength) && maxContentLength > -1; + const hasMaxBodyLength = utils_default.isNumber(maxBodyLength) && maxBodyLength > -1; + const own2 = (key) => utils_default.hasOwnProp(config, key) ? config[key] : void 0; + let _fetch = envFetch || fetch; + responseType = responseType ? (responseType + "").toLowerCase() : "text"; + let composedSignal = composeSignals_default( + [signal, cancelToken && cancelToken.toAbortSignal()], + timeout + ); + let request = null; + const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => { + composedSignal.unsubscribe(); + }); + let requestContentLength; + let pendingBodyError = null; + const maxBodyLengthError = () => new AxiosError_default( + "Request body larger than maxBodyLength limit", + AxiosError_default.ERR_BAD_REQUEST, + config, + request + ); + try { + let auth = void 0; + const configAuth = own2("auth"); + if (configAuth) { + const username = utils_default.getSafeProp(configAuth, "username") || ""; + const password = utils_default.getSafeProp(configAuth, "password") || ""; + auth = { + username, + password + }; + } + if (maybeWithAuthCredentials(url)) { + const parsedURL = new URL(url, platform_default.origin); + if (!auth && (parsedURL.username || parsedURL.password)) { + const urlUsername = decodeURIComponentSafe(parsedURL.username); + const urlPassword = decodeURIComponentSafe(parsedURL.password); + auth = { + username: urlUsername, + password: urlPassword + }; + } + if (parsedURL.username || parsedURL.password) { + parsedURL.username = ""; + parsedURL.password = ""; + url = parsedURL.href; + } + } + if (auth) { + headers.delete("authorization"); + headers.set( + "Authorization", + "Basic " + btoa(encodeUTF82((auth.username || "") + ":" + (auth.password || ""))) + ); + } + if (hasMaxContentLength && typeof url === "string" && url.startsWith("data:")) { + const estimated = estimateDataURLDecodedBytes(url); + if (estimated > maxContentLength) { + throw new AxiosError_default( + "maxContentLength size of " + maxContentLength + " exceeded", + AxiosError_default.ERR_BAD_RESPONSE, + config, + request + ); + } + } + if (hasMaxBodyLength && method !== "get" && method !== "head") { + const outboundLength = await getBodyLength(data); + if (typeof outboundLength === "number" && isFinite(outboundLength)) { + requestContentLength = outboundLength; + if (outboundLength > maxBodyLength) { + throw maxBodyLengthError(); + } + } + } + const mustEnforceStreamBody = hasMaxBodyLength && (utils_default.isReadableStream(data) || utils_default.isStream(data)); + const trackRequestStream = (stream, onProgress, flush) => trackStream( + stream, + DEFAULT_CHUNK_SIZE, + (loadedBytes) => { + if (hasMaxBodyLength && loadedBytes > maxBodyLength) { + throw pendingBodyError = maxBodyLengthError(); + } + onProgress && onProgress(loadedBytes); + }, + flush + ); + if (supportsRequestStream && method !== "get" && method !== "head" && (onUploadProgress || mustEnforceStreamBody)) { + requestContentLength = requestContentLength == null ? await resolveBodyLength(headers, data) : requestContentLength; + if (requestContentLength !== 0 || mustEnforceStreamBody) { + let _request = new Request(url, { + method: "POST", + body: data, + duplex: "half" + }); + let contentTypeHeader; + if (utils_default.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) { + headers.setContentType(contentTypeHeader); + } + if (_request.body) { + const [onProgress, flush] = onUploadProgress && progressEventDecorator( + requestContentLength, + progressEventReducer(asyncDecorator(onUploadProgress)) + ) || []; + data = trackRequestStream(_request.body, onProgress, flush); + } + } + } else if (mustEnforceStreamBody && !isRequestSupported && isReadableStreamSupported && method !== "get" && method !== "head") { + data = trackRequestStream(data); + } else if (mustEnforceStreamBody && isRequestSupported && !supportsRequestStream && method !== "get" && method !== "head") { + throw new AxiosError_default( + "Stream request bodies are not supported by the current fetch implementation", + AxiosError_default.ERR_NOT_SUPPORT, + config, + request + ); + } + if (!utils_default.isString(withCredentials)) { + withCredentials = withCredentials ? "include" : "omit"; + } + const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype; + if (utils_default.isFormData(data)) { + const contentType = headers.getContentType(); + if (contentType && /^multipart\/form-data/i.test(contentType) && !/boundary=/i.test(contentType)) { + headers.delete("content-type"); + } + } + headers.set("User-Agent", "axios/" + VERSION, false); + const safeFetchOptions = fetchOptions == null ? fetchOptions : Object.assign(/* @__PURE__ */ Object.create(null), fetchOptions); + if (safeFetchOptions) { + delete safeFetchOptions.body; + delete safeFetchOptions.headers; + delete safeFetchOptions.method; + delete safeFetchOptions.signal; + delete safeFetchOptions.duplex; + delete safeFetchOptions.credentials; + } + const resolvedOptions = Object.assign(/* @__PURE__ */ Object.create(null), safeFetchOptions, { + signal: composedSignal, + method: method.toUpperCase(), + headers: toByteStringHeaderObject(headers.normalize()), + body: data, + duplex: "half", + credentials: isCredentialsSupported ? withCredentials : void 0 + }); + if (isRequestSupported) { + utils_default.forEach(DEFAULT_REQUEST_OPTIONS, (value, key) => { + if (resolvedOptions[key] === void 0) { + resolvedOptions[key] = value; + } + }); + if (resolvedOptions.signal === void 0) { + resolvedOptions.signal = null; + } + if (resolvedOptions.body === void 0) { + resolvedOptions.body = null; + } + } + if (maxRedirects === 0) { + resolvedOptions.redirect = "manual"; + if (safeFetchOptions) { + safeFetchOptions.redirect = "manual"; + } + } + request = isRequestSupported && new Request(url, resolvedOptions); + let response = await (isRequestSupported ? _fetch(request, safeFetchOptions) : _fetch(url, resolvedOptions)); + const responseHeaders = AxiosHeaders_default.from(response.headers); + if (hasMaxContentLength) { + const declaredLength = utils_default.toFiniteNumber(responseHeaders.getContentLength()); + if (declaredLength != null && declaredLength > maxContentLength) { + throw new AxiosError_default( + "maxContentLength size of " + maxContentLength + " exceeded", + AxiosError_default.ERR_BAD_RESPONSE, + config, + request + ); + } + } + const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response"); + if (supportsResponseStream && response.body && (onDownloadProgress || hasMaxContentLength || isStreamResponse && unsubscribe)) { + const options = {}; + ["status", "statusText", "headers"].forEach((prop) => { + options[prop] = response[prop]; + }); + const responseContentLength = utils_default.toFiniteNumber(responseHeaders.getContentLength()); + const [onProgress, flush] = onDownloadProgress && progressEventDecorator( + responseContentLength, + progressEventReducer(asyncDecorator(onDownloadProgress), true) + ) || []; + let bytesRead = 0; + const onChunkProgress = (loadedBytes) => { + if (hasMaxContentLength) { + bytesRead = loadedBytes; + if (bytesRead > maxContentLength) { + throw new AxiosError_default( + "maxContentLength size of " + maxContentLength + " exceeded", + AxiosError_default.ERR_BAD_RESPONSE, + config, + request + ); + } + } + onProgress && onProgress(loadedBytes); + }; + response = new Response( + trackStream(response.body, DEFAULT_CHUNK_SIZE, onChunkProgress, () => { + flush && flush(); + unsubscribe && unsubscribe(); + }), + options + ); + } + responseType = responseType || "text"; + let responseData = await resolvers[utils_default.findKey(resolvers, responseType) || "text"]( + response, + config + ); + if (hasMaxContentLength && !supportsResponseStream && !isStreamResponse) { + let materializedSize; + if (responseData != null) { + if (typeof responseData.byteLength === "number") { + materializedSize = responseData.byteLength; + } else if (typeof responseData.size === "number") { + materializedSize = responseData.size; + } else if (typeof responseData === "string") { + materializedSize = typeof TextEncoder === "function" ? new TextEncoder().encode(responseData).byteLength : responseData.length; + } + } + if (typeof materializedSize === "number" && materializedSize > maxContentLength) { + throw new AxiosError_default( + "maxContentLength size of " + maxContentLength + " exceeded", + AxiosError_default.ERR_BAD_RESPONSE, + config, + request + ); + } + } + !isStreamResponse && unsubscribe && unsubscribe(); + return await new Promise((resolve, reject) => { + settle(resolve, reject, { + data: responseData, + headers: AxiosHeaders_default.from(response.headers), + status: response.status, + statusText: response.statusText, + config, + request + }); + }); + } catch (err) { + unsubscribe && unsubscribe(); + if (composedSignal && composedSignal.aborted && composedSignal.reason instanceof AxiosError_default) { + const canceledError = composedSignal.reason; + canceledError.config = config; + request && (canceledError.request = request); + if (err !== canceledError) { + Object.defineProperty(canceledError, "cause", { + __proto__: null, + value: err, + writable: true, + enumerable: false, + configurable: true + }); + } + throw canceledError; + } + if (pendingBodyError) { + request && !pendingBodyError.request && (pendingBodyError.request = request); + throw pendingBodyError; + } + if (err instanceof AxiosError_default) { + request && !err.request && (err.request = request); + throw err; + } + if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) { + const networkError = new AxiosError_default( + "Network Error", + AxiosError_default.ERR_NETWORK, + config, + request, + err && err.response + ); + Object.defineProperty(networkError, "cause", { + __proto__: null, + value: err.cause || err, + writable: true, + enumerable: false, + configurable: true + }); + throw networkError; + } + throw AxiosError_default.from(err, err && err.code, config, request, err && err.response); + } + }; +}; +var seedCache = /* @__PURE__ */ new Map(); +var getFetch = (config) => { + let env = config && config.env || {}; + const { fetch: fetch2, Request, Response } = env; + const seeds = [Request, Response, fetch2]; + let len = seeds.length, i = len, seed, target, map = seedCache; + while (i--) { + seed = seeds[i]; + target = map.get(seed); + target === void 0 && map.set(seed, target = i ? /* @__PURE__ */ new Map() : factory(env)); + map = target; + } + return target; +}; +var adapter = getFetch(); + +// node_modules/axios/lib/adapters/adapters.js +var knownAdapters = { + http: null_default, + xhr: xhr_default, + fetch: { + get: getFetch + } +}; +utils_default.forEach(knownAdapters, (fn, value) => { + if (fn) { + try { + Object.defineProperty(fn, "name", { __proto__: null, value }); + } catch (e) { + } + Object.defineProperty(fn, "adapterName", { __proto__: null, value }); + } +}); +var renderReason = (reason) => `- ${reason}`; +var isResolvedHandle = (adapter2) => utils_default.isFunction(adapter2) || adapter2 === null || adapter2 === false; +function getAdapter(adapters, config) { + adapters = utils_default.isArray(adapters) ? adapters : [adapters]; + const { length } = adapters; + let nameOrAdapter; + let adapter2; + const rejectedReasons = {}; + for (let i = 0; i < length; i++) { + nameOrAdapter = adapters[i]; + let id; + adapter2 = nameOrAdapter; + if (!isResolvedHandle(nameOrAdapter)) { + adapter2 = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()]; + if (adapter2 === void 0) { + throw new AxiosError_default(`Unknown adapter '${id}'`); + } + } + if (adapter2 && (utils_default.isFunction(adapter2) || (adapter2 = adapter2.get(config)))) { + break; + } + rejectedReasons[id || "#" + i] = adapter2; + } + if (!adapter2) { + const reasons = Object.entries(rejectedReasons).map( + ([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build") + ); + let s = length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified"; + throw new AxiosError_default( + `There is no suitable adapter to dispatch the request ` + s, + AxiosError_default.ERR_NOT_SUPPORT + ); + } + return adapter2; +} +var adapters_default = { + /** + * Resolve an adapter from a list of adapter names or functions. + * @type {Function} + */ + getAdapter, + /** + * Exposes all known adapters + * @type {Object} + */ + adapters: knownAdapters +}; + +// node_modules/axios/lib/core/dispatchRequest.js +function throwIfCancellationRequested(config) { + if (config.cancelToken) { + config.cancelToken.throwIfRequested(); + } + if (config.signal && config.signal.aborted) { + throw new CanceledError_default(null, config); + } +} +function dispatchRequest(_config) { + const config = utils_default.toSafeFlatObject(_config); + throwIfCancellationRequested(config); + config.headers = AxiosHeaders_default.from(utils_default.getSafeProp(config, "headers")); + config.data = transformData.call(config, config.transformRequest); + if (["post", "put", "patch"].indexOf(config.method) !== -1) { + config.headers.setContentType("application/x-www-form-urlencoded", false); + } + const adapter2 = adapters_default.getAdapter(config.adapter || defaults_default.adapter, config); + return adapter2(config).then( + function onAdapterResolution(response) { + throwIfCancellationRequested(config); + config.response = response; + try { + response.data = transformData.call(config, config.transformResponse, response); + } finally { + delete config.response; + } + response.headers = AxiosHeaders_default.from(response.headers); + return response; + }, + function onAdapterRejection(reason) { + if (!isCancel(reason)) { + throwIfCancellationRequested(config); + if (reason && reason.response) { + config.response = reason.response; + try { + reason.response.data = transformData.call( + config, + config.transformResponse, + reason.response + ); + } finally { + delete config.response; + } + reason.response.headers = AxiosHeaders_default.from(reason.response.headers); + } + } + return Promise.reject(reason); + } + ); +} + +// node_modules/axios/lib/helpers/validator.js +var validators = {}; +["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i) => { + validators[type] = function validator(thing) { + return typeof thing === type || "a" + (i < 1 ? "n " : " ") + type; + }; +}); +var deprecatedWarnings = {}; +validators.transitional = function transitional(validator, version, message) { + function formatMessage(opt, desc) { + return "[Axios v" + VERSION + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : ""); + } + return (value, opt, opts) => { + if (validator === false) { + throw new AxiosError_default( + formatMessage(opt, " has been removed" + (version ? " in " + version : "")), + AxiosError_default.ERR_DEPRECATED + ); + } + if (version && !deprecatedWarnings[opt]) { + deprecatedWarnings[opt] = true; + console.warn( + formatMessage( + opt, + " has been deprecated since v" + version + " and will be removed in the near future" + ) + ); + } + return validator ? validator(value, opt, opts) : true; + }; +}; +validators.spelling = function spelling(correctSpelling) { + return (value, opt) => { + console.warn(`${opt} is likely a misspelling of ${correctSpelling}`); + return true; + }; +}; +function assertOptions(options, schema, allowUnknown) { + if (typeof options !== "object" || options === null) { + throw new AxiosError_default("options must be an object", AxiosError_default.ERR_BAD_OPTION_VALUE); + } + const keys = Object.keys(options); + let i = keys.length; + while (i-- > 0) { + const opt = keys[i]; + const validator = Object.prototype.hasOwnProperty.call(schema, opt) ? schema[opt] : void 0; + if (validator) { + const value = options[opt]; + const result = value === void 0 || validator(value, opt, options); + if (result !== true) { + throw new AxiosError_default( + "option " + opt + " must be " + result, + AxiosError_default.ERR_BAD_OPTION_VALUE + ); + } + continue; + } + if (allowUnknown !== true) { + throw new AxiosError_default("Unknown option " + opt, AxiosError_default.ERR_BAD_OPTION); + } + } +} +var validator_default = { + assertOptions, + validators +}; + +// node_modules/axios/lib/core/Axios.js +var validators2 = validator_default.validators; +var Axios = class { + constructor(instanceConfig) { + this.defaults = instanceConfig || {}; + this.interceptors = { + request: new InterceptorManager_default(), + response: new InterceptorManager_default() + }; + } + /** + * Dispatch a request + * + * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults) + * @param {?Object} config + * + * @returns {Promise} The Promise to be fulfilled + */ + async request(configOrUrl, config) { + try { + return await this._request(configOrUrl, config); + } catch (err) { + if (err instanceof Error) { + try { + let dummy = {}; + Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error(); + const dummyStack = dummy.stack; + let stack = ""; + if (typeof dummyStack === "string") { + const firstNewlineIndex = dummyStack.indexOf("\n"); + stack = firstNewlineIndex === -1 ? "" : dummyStack.slice(firstNewlineIndex + 1); + } + if (!err.stack) { + err.stack = stack; + } else if (stack) { + const firstNewlineIndex = stack.indexOf("\n"); + const secondNewlineIndex = firstNewlineIndex === -1 ? -1 : stack.indexOf("\n", firstNewlineIndex + 1); + const stackWithoutTwoTopLines = secondNewlineIndex === -1 ? "" : stack.slice(secondNewlineIndex + 1); + if (!String(err.stack).endsWith(stackWithoutTwoTopLines)) { + err.stack += "\n" + stack; + } + } + } catch (e) { + } + } + throw err; + } + } + _request(configOrUrl, config) { + if (typeof configOrUrl === "string") { + config = config || {}; + config.url = configOrUrl; + } else { + config = configOrUrl || {}; + } + config = mergeConfig(this.defaults, config); + const { transitional: transitional2, paramsSerializer, headers } = config; + if (transitional2 !== void 0) { + validator_default.assertOptions( + transitional2, + { + silentJSONParsing: validators2.transitional(validators2.boolean), + forcedJSONParsing: validators2.transitional(validators2.boolean), + clarifyTimeoutError: validators2.transitional(validators2.boolean), + legacyInterceptorReqResOrdering: validators2.transitional(validators2.boolean), + advertiseZstdAcceptEncoding: validators2.transitional(validators2.boolean), + validateStatusUndefinedResolves: validators2.transitional(validators2.boolean) + }, + false + ); + } + if (paramsSerializer != null) { + if (utils_default.isFunction(paramsSerializer)) { + config.paramsSerializer = { + serialize: paramsSerializer + }; + } else { + validator_default.assertOptions( + paramsSerializer, + { + encode: validators2.function, + serialize: validators2.function + }, + true + ); + } + } + if (config.allowAbsoluteUrls !== void 0) { + } else if (this.defaults.allowAbsoluteUrls !== void 0) { + config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls; + } else { + config.allowAbsoluteUrls = true; + } + validator_default.assertOptions( + config, + { + baseUrl: validators2.spelling("baseURL"), + withXsrfToken: validators2.spelling("withXSRFToken") + }, + true + ); + config.method = (utils_default.getSafeProp(config, "method") || utils_default.getSafeProp(this.defaults, "method") || "get").toLowerCase(); + let contextHeaders = headers && utils_default.merge(headers.common, headers[config.method]); + headers && utils_default.forEach(methodList_default.concat("common"), (method) => { + delete headers[method]; + }); + config.headers = AxiosHeaders_default.concat(contextHeaders, headers); + const requestInterceptorChain = []; + let synchronousRequestInterceptors = true; + this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { + if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config) === false) { + return; + } + synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; + const transitional3 = config.transitional || transitional_default; + const legacyInterceptorReqResOrdering = transitional3 && transitional3.legacyInterceptorReqResOrdering; + if (legacyInterceptorReqResOrdering) { + requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); + } else { + requestInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); + } + }); + const responseInterceptorChain = []; + this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { + responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); + }); + let promise; + let i = 0; + let len; + if (!synchronousRequestInterceptors) { + const chain = [dispatchRequest.bind(this), void 0]; + chain.unshift(...requestInterceptorChain); + chain.push(...responseInterceptorChain); + len = chain.length; + promise = Promise.resolve(config); + while (i < len) { + promise = promise.then(chain[i++], chain[i++]); + } + return promise; + } + len = requestInterceptorChain.length; + let newConfig = config; + while (i < len) { + const onFulfilled = requestInterceptorChain[i++]; + const onRejected = requestInterceptorChain[i++]; + try { + newConfig = onFulfilled ? onFulfilled(newConfig) : newConfig; + } catch (error) { + if (!onRejected) { + promise = Promise.reject(error); + break; + } + try { + const rejectedResult = onRejected.call(this, error); + if (utils_default.isThenable(rejectedResult)) { + promise = Promise.resolve(rejectedResult).then( + () => dispatchRequest.call(this, newConfig) + ); + } + } catch (rejectedError) { + promise = Promise.reject(rejectedError); + } + break; + } + } + if (!promise) { + try { + promise = dispatchRequest.call(this, newConfig); + } catch (error) { + promise = Promise.reject(error); + } + } + i = 0; + len = responseInterceptorChain.length; + while (i < len) { + promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]); + } + return promise; + } + getUri(config) { + config = mergeConfig(this.defaults, config); + const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls, config); + return buildURL(fullPath, config.params, config.paramsSerializer); + } +}; +utils_default.forEach(["delete", "get", "head", "options"], function forEachMethodNoData(method) { + Axios.prototype[method] = function(url, config) { + return this.request( + mergeConfig(config || {}, { + method, + url, + data: config && utils_default.hasOwnProp(config, "data") ? config.data : void 0 + }) + ); + }; +}); +utils_default.forEach(["post", "put", "patch", "query"], function forEachMethodWithData(method) { + function generateHTTPMethod(isForm) { + return function httpMethod(url, data, config) { + return this.request( + mergeConfig(config || {}, { + method, + headers: isForm ? { + "Content-Type": "multipart/form-data" + } : {}, + url, + data + }) + ); + }; + } + Axios.prototype[method] = generateHTTPMethod(); + if (method !== "query") { + Axios.prototype[method + "Form"] = generateHTTPMethod(true); + } +}); +var Axios_default = Axios; + +// node_modules/axios/lib/cancel/CancelToken.js +var CancelToken = class _CancelToken { + constructor(executor) { + if (typeof executor !== "function") { + throw new TypeError("executor must be a function."); + } + let resolvePromise; + this.promise = new Promise(function promiseExecutor(resolve) { + resolvePromise = resolve; + }); + const token = this; + this.promise.then((cancel) => { + if (!token._listeners) return; + let i = token._listeners.length; + while (i-- > 0) { + token._listeners[i](cancel); + } + token._listeners = null; + }); + this.promise.then = (onfulfilled) => { + let _resolve; + const promise = new Promise((resolve) => { + token.subscribe(resolve); + _resolve = resolve; + }).then(onfulfilled); + promise.cancel = function reject() { + token.unsubscribe(_resolve); + }; + return promise; + }; + executor(function cancel(message, config, request) { + if (token.reason) { + return; + } + token.reason = new CanceledError_default(message, config, request); + resolvePromise(token.reason); + }); + } + /** + * Throws a `CanceledError` if cancellation has been requested. + */ + throwIfRequested() { + if (this.reason) { + throw this.reason; + } + } + /** + * Subscribe to the cancel signal + */ + subscribe(listener) { + if (this.reason) { + listener(this.reason); + return; + } + if (this._listeners) { + this._listeners.push(listener); + } else { + this._listeners = [listener]; + } + } + /** + * Unsubscribe from the cancel signal + */ + unsubscribe(listener) { + if (!this._listeners) { + return; + } + const index = this._listeners.indexOf(listener); + if (index !== -1) { + this._listeners.splice(index, 1); + } + } + toAbortSignal() { + const controller = new AbortController(); + const abort = (err) => { + controller.abort(err); + }; + this.subscribe(abort); + controller.signal.unsubscribe = () => this.unsubscribe(abort); + return controller.signal; + } + /** + * Returns an object that contains a new `CancelToken` and a function that, when called, + * cancels the `CancelToken`. + */ + static source() { + let cancel; + const token = new _CancelToken(function executor(c) { + cancel = c; + }); + return { + token, + cancel + }; + } +}; +var CancelToken_default = CancelToken; + +// node_modules/axios/lib/helpers/spread.js +function spread(callback) { + return function wrap(arr) { + return callback.apply(null, arr); + }; +} + +// node_modules/axios/lib/helpers/isAxiosError.js +function isAxiosError(payload) { + return utils_default.isObject(payload) && payload.isAxiosError === true; +} + +// node_modules/axios/lib/helpers/HttpStatusCode.js +var HttpStatusCode = { + 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, + /** + * @deprecated Use `ContentTooLarge` instead. + */ + PayloadTooLarge: 413, + ContentTooLarge: 413, + UriTooLong: 414, + UnsupportedMediaType: 415, + RangeNotSatisfiable: 416, + ExpectationFailed: 417, + ImATeapot: 418, + MisdirectedRequest: 421, + /** + * @deprecated Use `UnprocessableContent` instead. + */ + 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(HttpStatusCode).forEach(([key, value]) => { + if (HttpStatusCode[value] === void 0) { + HttpStatusCode[value] = key; + } +}); +var HttpStatusCode_default = HttpStatusCode; + +// node_modules/axios/lib/axios.js +function createInstance(defaultConfig) { + const context = new Axios_default(defaultConfig); + const instance = bind(Axios_default.prototype.request, context); + utils_default.extend(instance, Axios_default.prototype, context, { allOwnKeys: true }); + utils_default.extend(instance, context, null, { allOwnKeys: true }); + instance.create = function create2(instanceConfig) { + return createInstance(mergeConfig(defaultConfig, instanceConfig)); + }; + return instance; +} +var axios = createInstance(defaults_default); +axios.Axios = Axios_default; +axios.CanceledError = CanceledError_default; +axios.CancelToken = CancelToken_default; +axios.isCancel = isCancel; +axios.VERSION = VERSION; +axios.toFormData = toFormData_default; +axios.AxiosError = AxiosError_default; +axios.Cancel = axios.CanceledError; +axios.all = function all(promises) { + return Promise.all(promises); +}; +axios.spread = spread; +axios.isAxiosError = isAxiosError; +axios.mergeConfig = mergeConfig; +axios.AxiosHeaders = AxiosHeaders_default; +axios.formToJSON = (thing) => formDataToJSON_default(utils_default.isHTMLForm(thing) ? new FormData(thing) : thing); +axios.getAdapter = adapters_default.getAdapter; +axios.HttpStatusCode = HttpStatusCode_default; +axios.default = axios; +var axios_default = axios; + +// node_modules/axios/index.js +var { + Axios: Axios2, + AxiosError: AxiosError2, + CanceledError: CanceledError2, + isCancel: isCancel2, + CancelToken: CancelToken2, + VERSION: VERSION2, + all: all2, + Cancel, + isAxiosError: isAxiosError2, + spread: spread2, + toFormData: toFormData2, + AxiosHeaders: AxiosHeaders2, + HttpStatusCode: HttpStatusCode2, + formToJSON, + getAdapter: getAdapter2, + mergeConfig: mergeConfig2, + create +} = axios_default; +export { + Axios2 as Axios, + AxiosError2 as AxiosError, + AxiosHeaders2 as AxiosHeaders, + Cancel, + CancelToken2 as CancelToken, + CanceledError2 as CanceledError, + HttpStatusCode2 as HttpStatusCode, + VERSION2 as VERSION, + all2 as all, + create, + axios_default as default, + formToJSON, + getAdapter2 as getAdapter, + isAxiosError2 as isAxiosError, + isCancel2 as isCancel, + mergeConfig2 as mergeConfig, + spread2 as spread, + toFormData2 as toFormData +}; +//# sourceMappingURL=axios.js.map diff --git a/frontend/node_modules/.vite/deps/axios.js.map b/frontend/node_modules/.vite/deps/axios.js.map new file mode 100644 index 0000000..963a80b --- /dev/null +++ b/frontend/node_modules/.vite/deps/axios.js.map @@ -0,0 +1,7 @@ +{ + "version": 3, + "sources": ["../../axios/lib/helpers/bind.js", "../../axios/lib/utils.js", "../../axios/lib/helpers/parseHeaders.js", "../../axios/lib/helpers/sanitizeHeaderValue.js", "../../axios/lib/core/AxiosHeaders.js", "../../axios/lib/core/AxiosError.js", "../../axios/lib/helpers/null.js", "../../axios/lib/helpers/toFormData.js", "../../axios/lib/helpers/AxiosURLSearchParams.js", "../../axios/lib/helpers/buildURL.js", "../../axios/lib/core/InterceptorManager.js", "../../axios/lib/defaults/transitional.js", "../../axios/lib/platform/browser/classes/URLSearchParams.js", "../../axios/lib/platform/browser/classes/FormData.js", "../../axios/lib/platform/browser/classes/Blob.js", "../../axios/lib/platform/browser/index.js", "../../axios/lib/platform/common/utils.js", "../../axios/lib/platform/index.js", "../../axios/lib/helpers/toURLEncodedForm.js", "../../axios/lib/helpers/formDataToJSON.js", "../../axios/lib/core/methodList.js", "../../axios/lib/defaults/index.js", "../../axios/lib/core/transformData.js", "../../axios/lib/cancel/isCancel.js", "../../axios/lib/cancel/CanceledError.js", "../../axios/lib/core/settle.js", "../../axios/lib/helpers/normalizeURLForProtocolCheck.js", "../../axios/lib/helpers/parseProtocol.js", "../../axios/lib/helpers/speedometer.js", "../../axios/lib/helpers/throttle.js", "../../axios/lib/helpers/progressEventReducer.js", "../../axios/lib/helpers/isURLSameOrigin.js", "../../axios/lib/helpers/cookies.js", "../../axios/lib/helpers/isAbsoluteURL.js", "../../axios/lib/helpers/combineURLs.js", "../../axios/lib/core/buildFullPath.js", "../../axios/lib/core/mergeConfig.js", "../../axios/lib/core/setFormDataHeaders.js", "../../axios/lib/helpers/resolveConfig.js", "../../axios/lib/adapters/xhr.js", "../../axios/lib/helpers/composeSignals.js", "../../axios/lib/helpers/trackStream.js", "../../axios/lib/helpers/estimateDataURLDecodedBytes.js", "../../axios/lib/env/data.js", "../../axios/lib/adapters/fetch.js", "../../axios/lib/adapters/adapters.js", "../../axios/lib/core/dispatchRequest.js", "../../axios/lib/helpers/validator.js", "../../axios/lib/core/Axios.js", "../../axios/lib/cancel/CancelToken.js", "../../axios/lib/helpers/spread.js", "../../axios/lib/helpers/isAxiosError.js", "../../axios/lib/helpers/HttpStatusCode.js", "../../axios/lib/axios.js", "../../axios/index.js"], + "sourcesContent": ["'use strict';\n\n/**\n * Create a bound version of a function with a specified `this` context\n *\n * @param {Function} fn - The function to bind\n * @param {*} thisArg - The value to be passed as the `this` parameter\n * @returns {Function} A new function that will call the original function with the specified `this` context\n */\nexport default function bind(fn, thisArg) {\n return function wrap() {\n return fn.apply(thisArg, arguments);\n };\n}\n", "'use strict';\n\nimport bind from './helpers/bind.js';\n\n// utils is a library of generic helper functions non-specific to axios\n\nconst { toString } = Object.prototype;\nconst { getPrototypeOf } = Object;\nconst { iterator, toStringTag } = Symbol;\n\n/* Creating a function that will check if an object has a property. */\nconst hasOwnProperty = (\n ({ hasOwnProperty }) =>\n (obj, prop) =>\n hasOwnProperty.call(obj, prop)\n)(Object.prototype);\n\nconst isUnsafeObjectKey = (prop) =>\n typeof prop === 'string' &&\n (prop === '__proto__' || prop === 'constructor' || prop === 'prototype');\n\n/**\n * Determine whether an inherited object must be treated as a shared-prototype\n * boundary. Cross-realm Object.prototype objects cannot be distinguished\n * reliably from application-created null-prototype objects because their\n * properties are mutable, so all inherited terminal prototypes are excluded\n * as a fail-closed boundary. A null-prototype source still keeps its own\n * properties, as produced by mergeConfig and other safe materialization paths.\n *\n * @param {*} obj The object to inspect\n * @param {*} prototype The object's prototype\n * @param {boolean} source Whether obj is the original traversal source\n *\n * @returns {boolean} True when obj is a safe prototype traversal boundary\n */\nconst isPrototypeBoundary = (obj, prototype, source) =>\n obj === Object.prototype || (!source && prototype === null);\n\n/**\n * Determine whether an object can retain its identity through code paths that\n * add, replace, and remove config properties without bypassing unsafe-key\n * filtering. Immutable objects, unsafe-key-bearing objects, and objects with\n * accessor or restricted data properties must be materialized instead.\n *\n * @param {*} obj The object to inspect\n *\n * @returns {boolean} True when every own property is safe and fully mutable\n */\nconst isSafeAndFullyMutable = (obj) => {\n if (!Object.isExtensible(obj)) {\n return false;\n }\n\n const props = Object.getOwnPropertyNames(obj);\n\n if (Object.getOwnPropertySymbols) {\n props.push(...Object.getOwnPropertySymbols(obj));\n }\n\n return props.every((prop) => {\n if (isUnsafeObjectKey(prop)) {\n return false;\n }\n\n const descriptor = Object.getOwnPropertyDescriptor(obj, prop);\n\n return !!descriptor && descriptor.configurable && descriptor.writable === true;\n });\n};\n\n/**\n * Walk the prototype chain (excluding the source realm's Object.prototype)\n * looking for an own `prop`. This distinguishes genuine own/inherited members\n * — including class accessors and template prototypes — from members injected\n * via Object.prototype pollution (e.g. `Object.prototype.username = '...'`),\n * which live on Object.prototype itself and are therefore never matched.\n *\n * @param {*} thing The value whose chain to inspect\n * @param {string|symbol} prop The property key to look for\n *\n * @returns {boolean} True when `prop` is owned below Object.prototype\n */\nconst hasOwnInPrototypeChain = (thing, prop) => {\n let obj = thing;\n const seen = [];\n\n while (obj != null) {\n if (seen.indexOf(obj) !== -1) {\n return false;\n }\n seen.push(obj);\n\n const prototype = getPrototypeOf(obj);\n\n if (isPrototypeBoundary(obj, prototype, obj === thing)) {\n return false;\n }\n\n if (hasOwnProperty(obj, prop)) {\n return true;\n }\n obj = prototype;\n }\n return false;\n};\n\n/**\n * Read `obj[prop]` only when it is safe from Object.prototype pollution. Own\n * properties and members inherited from a non-Object.prototype source (a class\n * instance or template object) are honored; a value reachable only through a\n * polluted Object.prototype is ignored and `undefined` is returned.\n *\n * @param {*} obj The source object\n * @param {string|symbol} prop The property key to read\n *\n * @returns {*} The resolved value, or undefined when unsafe/absent\n */\nconst getSafeProp = (obj, prop) =>\n obj != null && hasOwnInPrototypeChain(obj, prop) ? obj[prop] : undefined;\n\n/**\n * Flatten an object and its application-defined prototype chain into a\n * null-prototype object. Members inherited only from the source realm's\n * Object.prototype are deliberately excluded, while class/template members\n * below that boundary are preserved.\n *\n * @param {*} thing The value to flatten\n *\n * @returns {*} A null-prototype copy, or the original value when it is already\n * structurally safe or is not an object\n */\nconst toSafeFlatObject = (thing) => {\n if (thing == null || (typeof thing !== 'object' && typeof thing !== 'function')) {\n return thing;\n }\n\n const sourcePrototype = getPrototypeOf(thing);\n\n if (sourcePrototype === null && isSafeAndFullyMutable(thing)) {\n return thing;\n }\n\n const result = Object.create(null);\n const merged = Object.create(null);\n const seen = [];\n let current = thing;\n\n while (current != null) {\n if (seen.indexOf(current) !== -1) {\n break;\n }\n\n seen.push(current);\n\n const prototype = current === thing ? sourcePrototype : getPrototypeOf(current);\n\n if (isPrototypeBoundary(current, prototype, current === thing)) {\n break;\n }\n\n const props = Object.getOwnPropertyNames(current);\n\n if (Object.getOwnPropertySymbols) {\n props.push(...Object.getOwnPropertySymbols(current));\n }\n\n for (const prop of props) {\n if (isUnsafeObjectKey(prop)) {\n continue;\n }\n\n if (!hasOwnProperty(merged, prop)) {\n result[prop] = thing[prop];\n merged[prop] = true;\n }\n }\n\n current = prototype;\n }\n\n return result;\n};\n\nconst kindOf = ((cache) => (thing) => {\n const str = toString.call(thing);\n return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());\n})(Object.create(null));\n\nconst kindOfTest = (type) => {\n type = type.toLowerCase();\n return (thing) => kindOf(thing) === type;\n};\n\nconst typeOfTest = (type) => (thing) => typeof thing === type;\n\n/**\n * Determine if a value is a non-null object\n *\n * @param {Object} val The value to test\n *\n * @returns {boolean} True if value is an Array, otherwise false\n */\nconst { isArray } = Array;\n\n/**\n * Determine if a value is undefined\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nconst isUndefined = typeOfTest('undefined');\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return (\n val !== null &&\n !isUndefined(val) &&\n val.constructor !== null &&\n !isUndefined(val.constructor) &&\n isFunction(val.constructor.isBuffer) &&\n val.constructor.isBuffer(val)\n );\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nconst isArrayBuffer = kindOfTest('ArrayBuffer');\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n let result;\n if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView) {\n result = ArrayBuffer.isView(val);\n } else {\n result = val && val.buffer && isArrayBuffer(val.buffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a String, otherwise false\n */\nconst isString = typeOfTest('string');\n\n/**\n * Determine if a value is a Function\n *\n * @param {*} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nconst isFunction = typeOfTest('function');\n\n/**\n * Determine if a value is a Number\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Number, otherwise false\n */\nconst isNumber = typeOfTest('number');\n\n/**\n * Determine if a value is an Object\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an Object, otherwise false\n */\nconst isObject = (thing) => thing !== null && typeof thing === 'object';\n\n/**\n * Determine if a value is a Boolean\n *\n * @param {*} thing The value to test\n * @returns {boolean} True if value is a Boolean, otherwise false\n */\nconst isBoolean = (thing) => thing === true || thing === false;\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a plain Object, otherwise false\n */\nconst isPlainObject = (val) => {\n if (!isObject(val)) {\n return false;\n }\n\n const prototype = getPrototypeOf(val);\n return (\n (prototype === null || prototype === Object.prototype || getPrototypeOf(prototype) === null) &&\n // Treat safe own/inherited Symbol.toStringTag or Symbol.iterator members as\n // evidence the value is tagged/iterable, while ignoring members reachable\n // only through shared or terminal prototype boundaries.\n !hasOwnInPrototypeChain(val, toStringTag) &&\n !hasOwnInPrototypeChain(val, iterator)\n );\n};\n\n/**\n * Determine if a value is an empty object (safely handles Buffers)\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is an empty object, otherwise false\n */\nconst isEmptyObject = (val) => {\n // Early return for non-objects or Buffers to prevent RangeError\n if (!isObject(val) || isBuffer(val)) {\n return false;\n }\n\n try {\n return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;\n } catch (e) {\n // Fallback for any other objects that might cause RangeError with Object.keys()\n return false;\n }\n};\n\n/**\n * Determine if a value is a Date\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Date, otherwise false\n */\nconst isDate = kindOfTest('Date');\n\n/**\n * Determine if a value is a File\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFile = kindOfTest('File');\n\n/**\n * Determine if a value is a React Native Blob\n * React Native \"blob\": an object with a `uri` attribute. Optionally, it can\n * also have a `name` and `type` attribute to specify filename and content type\n *\n * @see https://github.com/facebook/react-native/blob/26684cf3adf4094eb6c405d345a75bf8c7c0bf88/Libraries/Network/FormData.js#L68-L71\n *\n * @param {*} value The value to test\n *\n * @returns {boolean} True if value is a React Native Blob, otherwise false\n */\nconst isReactNativeBlob = (value) => {\n return !!(value && typeof value.uri !== 'undefined');\n};\n\n/**\n * Determine if environment is React Native\n * ReactNative `FormData` has a non-standard `getParts()` method\n *\n * @param {*} formData The formData to test\n *\n * @returns {boolean} True if environment is React Native, otherwise false\n */\nconst isReactNative = (formData) => formData && typeof formData.getParts !== 'undefined';\n\n/**\n * Determine if a value is a Blob\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nconst isBlob = kindOfTest('Blob');\n\n/**\n * Determine if a value is a FileList\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a FileList, otherwise false\n */\nconst isFileList = kindOfTest('FileList');\nconst isSet = kindOfTest('Set');\n\n/**\n * Determine if a value is a Stream\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nconst isStream = (val) => isObject(val) && isFunction(val.pipe);\n\n/**\n * Determine if a value is a FormData\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction getGlobal() {\n if (typeof globalThis !== 'undefined') return globalThis;\n if (typeof self !== 'undefined') return self;\n if (typeof window !== 'undefined') return window;\n if (typeof global !== 'undefined') return global;\n return {};\n}\n\nconst G = getGlobal();\nconst FormDataCtor = typeof G.FormData !== 'undefined' ? G.FormData : undefined;\n\nconst isFormData = (thing) => {\n if (!thing) return false;\n if (FormDataCtor && thing instanceof FormDataCtor) return true;\n // Reject plain objects inheriting directly from Object.prototype so prototype-pollution gadgets can't spoof FormData.\n const proto = getPrototypeOf(thing);\n if (!proto || proto === Object.prototype) return false;\n if (!isFunction(thing.append)) return false;\n const kind = kindOf(thing);\n return (\n kind === 'formdata' ||\n // detect form-data instance\n (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')\n );\n};\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nconst isURLSearchParams = kindOfTest('URLSearchParams');\n\nconst [isReadableStream, isRequest, isResponse, isHeaders] = [\n 'ReadableStream',\n 'Request',\n 'Response',\n 'Headers',\n].map(kindOfTest);\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n *\n * @returns {String} The String freed of excess whitespace\n */\nconst trim = (str) => {\n return str.trim ? str.trim() : str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n};\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n *\n * @param {Object} [options]\n * @param {Boolean} [options.allOwnKeys = false]\n * @returns {any}\n */\nfunction forEach(obj, fn, { allOwnKeys = false } = {}) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n let i;\n let l;\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Buffer check\n if (isBuffer(obj)) {\n return;\n }\n\n // Iterate over object keys\n const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);\n const len = keys.length;\n let key;\n\n for (i = 0; i < len; i++) {\n key = keys[i];\n fn.call(null, obj[key], key, obj);\n }\n }\n}\n\n/**\n * Finds a key in an object, case-insensitive, returning the actual key name.\n * Returns null if the object is a Buffer or if no match is found.\n *\n * @param {Object} obj - The object to search.\n * @param {string} key - The key to find (case-insensitive).\n * @returns {?string} The actual key name if found, otherwise null.\n */\nfunction findKey(obj, key) {\n if (isBuffer(obj)) {\n return null;\n }\n\n key = key.toLowerCase();\n const keys = Object.keys(obj);\n let i = keys.length;\n let _key;\n while (i-- > 0) {\n _key = keys[i];\n if (key === _key.toLowerCase()) {\n return _key;\n }\n }\n return null;\n}\n\nconst _global = (() => {\n /*eslint no-undef:0*/\n if (typeof globalThis !== 'undefined') return globalThis;\n return typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : global;\n})();\n\nconst isContextDefined = (context) => !isUndefined(context) && context !== _global;\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * const result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n *\n * @returns {Object} Result of all merge properties\n */\nfunction merge(...objs) {\n const { caseless, skipUndefined } = (isContextDefined(this) && this) || {};\n const result = {};\n const assignValue = (val, key) => {\n // Skip dangerous property names to prevent prototype pollution\n if (key === '__proto__' || key === 'constructor' || key === 'prototype') {\n return;\n }\n\n // findKey lowercases the key, so caseless lookup only applies to strings —\n // symbol keys are identity-matched.\n const targetKey = (caseless && typeof key === 'string' && findKey(result, key)) || key;\n // Read via own-prop only — a bare `result[targetKey]` walks the prototype\n // chain, so a polluted Object.prototype value could surface here and get\n // copied into the merged result.\n const existing = hasOwnProperty(result, targetKey) ? result[targetKey] : undefined;\n if (isPlainObject(existing) && isPlainObject(val)) {\n result[targetKey] = merge(existing, val);\n } else if (isPlainObject(val)) {\n result[targetKey] = merge({}, val);\n } else if (isArray(val)) {\n result[targetKey] = val.slice();\n } else if (!skipUndefined || !isUndefined(val)) {\n result[targetKey] = val;\n }\n };\n\n for (let i = 0, l = objs.length; i < l; i++) {\n const source = objs[i];\n if (!source || isBuffer(source)) {\n continue;\n }\n\n forEach(source, assignValue);\n\n if (typeof source !== 'object' || isArray(source)) {\n continue;\n }\n\n const symbols = Object.getOwnPropertySymbols(source);\n for (let j = 0; j < symbols.length; j++) {\n const symbol = symbols[j];\n if (propertyIsEnumerable.call(source, symbol)) {\n assignValue(source[symbol], symbol);\n }\n }\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n *\n * @param {Object} [options]\n * @param {Boolean} [options.allOwnKeys]\n * @returns {Object} The resulting value of object a\n */\nconst extend = (a, b, thisArg, { allOwnKeys } = {}) => {\n forEach(\n b,\n (val, key) => {\n if (thisArg && isFunction(val)) {\n Object.defineProperty(a, key, {\n // Null-proto descriptor so a polluted Object.prototype.get cannot\n // hijack defineProperty's accessor-vs-data resolution.\n __proto__: null,\n value: bind(val, thisArg),\n writable: true,\n enumerable: true,\n configurable: true,\n });\n } else {\n Object.defineProperty(a, key, {\n __proto__: null,\n value: val,\n writable: true,\n enumerable: true,\n configurable: true,\n });\n }\n },\n { allOwnKeys }\n );\n return a;\n};\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n *\n * @returns {string} content value without BOM\n */\nconst stripBOM = (content) => {\n if (content.charCodeAt(0) === 0xfeff) {\n content = content.slice(1);\n }\n return content;\n};\n\n/**\n * Inherit the prototype methods from one constructor into another\n * @param {function} constructor\n * @param {function} superConstructor\n * @param {object} [props]\n * @param {object} [descriptors]\n *\n * @returns {void}\n */\nconst inherits = (constructor, superConstructor, props, descriptors) => {\n constructor.prototype = Object.create(superConstructor.prototype, descriptors);\n Object.defineProperty(constructor.prototype, 'constructor', {\n __proto__: null,\n value: constructor,\n writable: true,\n enumerable: false,\n configurable: true,\n });\n Object.defineProperty(constructor, 'super', {\n __proto__: null,\n value: superConstructor.prototype,\n });\n props && Object.assign(constructor.prototype, props);\n};\n\n/**\n * Resolve object with deep prototype chain to a flat object\n * @param {Object} sourceObj source object\n * @param {Object} [destObj]\n * @param {Function|Boolean} [filter]\n * @param {Function} [propFilter]\n *\n * @returns {Object}\n */\nconst toFlatObject = (sourceObj, destObj, filter, propFilter) => {\n let props;\n let i;\n let prop;\n const merged = {};\n\n destObj = destObj || {};\n // eslint-disable-next-line no-eq-null,eqeqeq\n if (sourceObj == null) return destObj;\n\n do {\n props = Object.getOwnPropertyNames(sourceObj);\n i = props.length;\n while (i-- > 0) {\n prop = props[i];\n if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {\n destObj[prop] = sourceObj[prop];\n merged[prop] = true;\n }\n }\n sourceObj = filter !== false && getPrototypeOf(sourceObj);\n } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);\n\n return destObj;\n};\n\n/**\n * Determines whether a string ends with the characters of a specified string\n *\n * @param {String} str\n * @param {String} searchString\n * @param {Number} [position= 0]\n *\n * @returns {boolean}\n */\nconst endsWith = (str, searchString, position) => {\n str = String(str);\n if (position === undefined || position > str.length) {\n position = str.length;\n }\n position -= searchString.length;\n const lastIndex = str.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n};\n\n/**\n * Returns new array from array like object or null if failed\n *\n * @param {*} [thing]\n *\n * @returns {?Array}\n */\nconst toArray = (thing) => {\n if (!thing) return null;\n if (isArray(thing)) return thing;\n let i = thing.length;\n if (!isNumber(i)) return null;\n const arr = new Array(i);\n while (i-- > 0) {\n arr[i] = thing[i];\n }\n return arr;\n};\n\n/**\n * Checking if the Uint8Array exists and if it does, it returns a function that checks if the\n * thing passed in is an instance of Uint8Array\n *\n * @param {TypedArray}\n *\n * @returns {Array}\n */\n// eslint-disable-next-line func-names\nconst isTypedArray = ((TypedArray) => {\n // eslint-disable-next-line func-names\n return (thing) => {\n return TypedArray && thing instanceof TypedArray;\n };\n})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));\n\n/**\n * For each entry in the object, call the function with the key and value.\n *\n * @param {Object} obj - The object to iterate over.\n * @param {Function} fn - The function to call for each entry.\n *\n * @returns {void}\n */\nconst forEachEntry = (obj, fn) => {\n const generator = obj && obj[iterator];\n\n const _iterator = generator.call(obj);\n\n let result;\n\n while ((result = _iterator.next()) && !result.done) {\n const pair = result.value;\n fn.call(obj, pair[0], pair[1]);\n }\n};\n\n/**\n * It takes a regular expression and a string, and returns an array of all the matches\n *\n * @param {string} regExp - The regular expression to match against.\n * @param {string} str - The string to search.\n *\n * @returns {Array}\n */\nconst matchAll = (regExp, str) => {\n let matches;\n const arr = [];\n\n while ((matches = regExp.exec(str)) !== null) {\n arr.push(matches);\n }\n\n return arr;\n};\n\n/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */\nconst isHTMLForm = kindOfTest('HTMLFormElement');\n\nconst toCamelCase = (str) => {\n return str.toLowerCase().replace(/[-_\\s]([a-z\\d])(\\w*)/g, function replacer(m, p1, p2) {\n return p1.toUpperCase() + p2;\n });\n};\n\nconst { propertyIsEnumerable } = Object.prototype;\n\n/**\n * Determine if a value is a RegExp object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a RegExp object, otherwise false\n */\nconst isRegExp = kindOfTest('RegExp');\n\nconst reduceDescriptors = (obj, reducer) => {\n const descriptors = Object.getOwnPropertyDescriptors(obj);\n const reducedDescriptors = {};\n\n forEach(descriptors, (descriptor, name) => {\n let ret;\n if ((ret = reducer(descriptor, name, obj)) !== false) {\n reducedDescriptors[name] = ret || descriptor;\n }\n });\n\n Object.defineProperties(obj, reducedDescriptors);\n};\n\n/**\n * Makes all methods read-only\n * @param {Object} obj\n */\n\nconst freezeMethods = (obj) => {\n reduceDescriptors(obj, (descriptor, name) => {\n // skip restricted props in strict mode\n if (isFunction(obj) && ['arguments', 'caller', 'callee'].includes(name)) {\n return false;\n }\n\n const value = obj[name];\n\n if (!isFunction(value)) return;\n\n descriptor.enumerable = false;\n\n if ('writable' in descriptor) {\n descriptor.writable = false;\n return;\n }\n\n if (!descriptor.set) {\n descriptor.set = () => {\n throw Error(\"Can not rewrite read-only method '\" + name + \"'\");\n };\n }\n });\n};\n\n/**\n * Converts an array or a delimited string into an object set with values as keys and true as values.\n * Useful for fast membership checks.\n *\n * @param {Array|string} arrayOrString - The array or string to convert.\n * @param {string} delimiter - The delimiter to use if input is a string.\n * @returns {Object} An object with keys from the array or string, values set to true.\n */\nconst toObjectSet = (arrayOrString, delimiter) => {\n const obj = {};\n\n const define = (arr) => {\n arr.forEach((value) => {\n obj[value] = true;\n });\n };\n\n isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));\n\n return obj;\n};\n\nconst noop = () => {};\n\nconst toFiniteNumber = (value, defaultValue) => {\n return value != null && Number.isFinite((value = +value)) ? value : defaultValue;\n};\n\n/**\n * If the thing is a FormData object, return true, otherwise return false.\n *\n * @param {unknown} thing - The thing to check.\n *\n * @returns {boolean}\n */\nfunction isSpecCompliantForm(thing) {\n return !!(\n thing &&\n isFunction(thing.append) &&\n thing[toStringTag] === 'FormData' &&\n thing[iterator]\n );\n}\n\n/**\n * Recursively converts an object to a JSON-compatible object, handling circular references and Buffers.\n *\n * @param {Object} obj - The object to convert.\n * @returns {Object} The JSON-compatible object.\n */\nconst toJSONObject = (obj) => {\n const visited = new WeakSet();\n\n const visit = (source) => {\n if (isObject(source)) {\n if (visited.has(source)) {\n return;\n }\n\n //Buffer check\n if (isBuffer(source)) {\n return source;\n }\n\n if (!('toJSON' in source)) {\n // add-on descent / delete-on-ascent: preserves path semantics, so DAG nodes serialise at every occurrence (see #7230).\n visited.add(source);\n\n let target;\n\n if (isSet(source)) {\n target = [];\n for (const value of source) {\n const reducedValue = visit(value);\n !isUndefined(reducedValue) && target.push(reducedValue);\n }\n } else {\n target = isArray(source) ? [] : {};\n\n forEach(source, (value, key) => {\n const reducedValue = visit(value);\n !isUndefined(reducedValue) && (target[key] = reducedValue);\n });\n }\n\n visited.delete(source);\n\n return target;\n }\n }\n\n return source;\n };\n\n return visit(obj);\n};\n\n/**\n * Determines if a value is an async function.\n *\n * @param {*} thing - The value to test.\n * @returns {boolean} True if value is an async function, otherwise false.\n */\nconst isAsyncFn = kindOfTest('AsyncFunction');\n\n/**\n * Determines if a value is thenable (has then and catch methods).\n *\n * @param {*} thing - The value to test.\n * @returns {boolean} True if value is thenable, otherwise false.\n */\nconst isThenable = (thing) =>\n thing &&\n (isObject(thing) || isFunction(thing)) &&\n isFunction(thing.then) &&\n isFunction(thing.catch);\n\n// original code\n// https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34\n\n/**\n * Provides a cross-platform setImmediate implementation.\n * Uses native setImmediate if available, otherwise falls back to postMessage or setTimeout.\n *\n * @param {boolean} setImmediateSupported - Whether setImmediate is supported.\n * @param {boolean} postMessageSupported - Whether postMessage is supported.\n * @returns {Function} A function to schedule a callback asynchronously.\n */\nconst _setImmediate = ((setImmediateSupported, postMessageSupported) => {\n if (setImmediateSupported) {\n return setImmediate;\n }\n\n return postMessageSupported\n ? ((token, callbacks) => {\n _global.addEventListener(\n 'message',\n ({ source, data }) => {\n if (source === _global && data === token) {\n callbacks.length && callbacks.shift()();\n }\n },\n false\n );\n\n return (cb) => {\n callbacks.push(cb);\n _global.postMessage(token, '*');\n };\n })(`axios@${Math.random()}`, [])\n : (cb) => setTimeout(cb);\n})(typeof setImmediate === 'function', isFunction(_global.postMessage));\n\n/**\n * Schedules a microtask or asynchronous callback as soon as possible.\n * Uses queueMicrotask if available, otherwise falls back to process.nextTick or _setImmediate.\n *\n * @type {Function}\n */\nconst asap =\n typeof queueMicrotask !== 'undefined'\n ? queueMicrotask.bind(_global)\n : (typeof process !== 'undefined' && process.nextTick) || _setImmediate;\n\n// *********************\n\nconst isIterable = (thing) => thing != null && isFunction(thing[iterator]);\n\n/**\n * Determine if a value is iterable via an iterator that is NOT sourced solely\n * from a polluted Object.prototype. Use this instead of `isIterable` whenever\n * the iterable comes from untrusted input (e.g. user-supplied header sources),\n * so `Object.prototype[Symbol.iterator] = ...` cannot turn an ordinary object\n * into an attacker-controlled entries iterator.\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value has a non-polluted iterator\n */\nconst isSafeIterable = (thing) =>\n thing != null && hasOwnInPrototypeChain(thing, iterator) && isIterable(thing);\n\nexport default {\n isArray,\n isArrayBuffer,\n isBuffer,\n isFormData,\n isArrayBufferView,\n isString,\n isNumber,\n isBoolean,\n isObject,\n isPlainObject,\n isEmptyObject,\n isReadableStream,\n isRequest,\n isResponse,\n isHeaders,\n isUndefined,\n isDate,\n isFile,\n isReactNativeBlob,\n isReactNative,\n isBlob,\n isRegExp,\n isFunction,\n isStream,\n isURLSearchParams,\n isTypedArray,\n isFileList,\n forEach,\n merge,\n extend,\n trim,\n stripBOM,\n inherits,\n toFlatObject,\n kindOf,\n kindOfTest,\n endsWith,\n toArray,\n forEachEntry,\n matchAll,\n isHTMLForm,\n hasOwnProperty,\n hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection\n hasOwnInPrototypeChain,\n getSafeProp,\n toSafeFlatObject,\n reduceDescriptors,\n freezeMethods,\n toObjectSet,\n toCamelCase,\n noop,\n toFiniteNumber,\n findKey,\n global: _global,\n isContextDefined,\n isSpecCompliantForm,\n toJSONObject,\n isAsyncFn,\n isThenable,\n setImmediate: _setImmediate,\n asap,\n isIterable,\n isSafeIterable,\n};\n", "'use strict';\n\nimport utils from '../utils.js';\n\n// RawAxiosHeaders whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nconst ignoreDuplicateOf = utils.toObjectSet([\n 'age',\n 'authorization',\n 'content-length',\n 'content-type',\n 'etag',\n 'expires',\n 'from',\n 'host',\n 'if-modified-since',\n 'if-unmodified-since',\n 'last-modified',\n 'location',\n 'max-forwards',\n 'proxy-authorization',\n 'referer',\n 'retry-after',\n 'user-agent',\n]);\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} rawHeaders Headers needing to be parsed\n *\n * @returns {Object} Headers parsed into an object\n */\nexport default (rawHeaders) => {\n const parsed = {};\n let key;\n let val;\n let i;\n\n rawHeaders &&\n rawHeaders.split('\\n').forEach(function parser(line) {\n i = line.indexOf(':');\n key = line.substring(0, i).trim().toLowerCase();\n val = line.substring(i + 1).trim();\n\n const hasKey = utils.hasOwnProp(parsed, key);\n\n if (!key || (hasKey && utils.hasOwnProp(ignoreDuplicateOf, key))) {\n return;\n }\n\n if (key === 'set-cookie') {\n if (hasKey) {\n parsed[key].push(val);\n } else {\n parsed[key] = [val];\n }\n } else {\n parsed[key] = hasKey ? parsed[key] + ', ' + val : val;\n }\n });\n\n return parsed;\n};\n", "'use strict';\n\nimport utils from '../utils.js';\n\nfunction trimSPorHTAB(str) {\n let start = 0;\n let end = str.length;\n\n while (start < end) {\n const code = str.charCodeAt(start);\n\n if (code !== 0x09 && code !== 0x20) {\n break;\n }\n\n start += 1;\n }\n\n while (end > start) {\n const code = str.charCodeAt(end - 1);\n\n if (code !== 0x09 && code !== 0x20) {\n break;\n }\n\n end -= 1;\n }\n\n return start === 0 && end === str.length ? str : str.slice(start, end);\n}\n\n// The control-code ranges are intentional: header sanitization strips C0/DEL bytes.\n// eslint-disable-next-line no-control-regex\nconst INVALID_UNICODE_HEADER_VALUE_CHARS = new RegExp('[\\\\u0000-\\\\u0008\\\\u000a-\\\\u001f\\\\u007f]+', 'g');\n// eslint-disable-next-line no-control-regex\nconst INVALID_BYTE_STRING_HEADER_VALUE_CHARS = new RegExp('[^\\\\u0009\\\\u0020-\\\\u007e\\\\u0080-\\\\u00ff]+', 'g');\n\nfunction sanitizeValue(value, invalidChars) {\n if (utils.isArray(value)) {\n return value.map((item) => sanitizeValue(item, invalidChars));\n }\n\n return trimSPorHTAB(String(value).replace(invalidChars, ''));\n}\n\nexport const sanitizeHeaderValue = (value) =>\n sanitizeValue(value, INVALID_UNICODE_HEADER_VALUE_CHARS);\n\nexport const sanitizeByteStringHeaderValue = (value) =>\n sanitizeValue(value, INVALID_BYTE_STRING_HEADER_VALUE_CHARS);\n\nexport function toByteStringHeaderObject(headers) {\n const byteStringHeaders = Object.create(null);\n\n utils.forEach(headers.toJSON(), (value, header) => {\n byteStringHeaders[header] = sanitizeByteStringHeaderValue(value);\n });\n\n return byteStringHeaders;\n}\n", "'use strict';\n\nimport utils from '../utils.js';\nimport parseHeaders from '../helpers/parseHeaders.js';\nimport { sanitizeHeaderValue } from '../helpers/sanitizeHeaderValue.js';\n\nconst $internals = Symbol('internals');\n\nfunction normalizeHeader(header) {\n return header && String(header).trim().toLowerCase();\n}\n\nfunction normalizeValue(value) {\n if (value === false || value == null) {\n return value;\n }\n\n return utils.isArray(value) ? value.map(normalizeValue) : sanitizeHeaderValue(String(value));\n}\n\nfunction parseTokens(str) {\n const tokens = Object.create(null);\n const tokensRE = /([^\\s,;=]+)\\s*(?:=\\s*([^,;]+))?/g;\n let match;\n\n while ((match = tokensRE.exec(str))) {\n tokens[match[1]] = match[2];\n }\n\n return tokens;\n}\n\nconst parameterNameRE = /^[!#$%&'*+\\-.^_`|~0-9A-Za-z]+$/;\n\nfunction trimOWS(value) {\n let start = 0;\n let end = value.length;\n\n while (start < end) {\n const code = value.charCodeAt(start);\n\n if (code !== 0x09 && code !== 0x20) {\n break;\n }\n\n start += 1;\n }\n\n while (end > start) {\n const code = value.charCodeAt(end - 1);\n\n if (code !== 0x09 && code !== 0x20) {\n break;\n }\n\n end -= 1;\n }\n\n return start === 0 && end === value.length ? value : value.slice(start, end);\n}\n\nfunction decodeQuotedString(value) {\n const last = value.length - 1;\n\n if (last < 1 || value.charCodeAt(0) !== 0x22 || value.charCodeAt(last) !== 0x22) {\n return value;\n }\n\n let decoded = '';\n\n for (let i = 1; i < last; i++) {\n const code = value.charCodeAt(i);\n\n if (code === 0x22) {\n return value;\n }\n\n if (code === 0x5c) {\n i += 1;\n\n if (i >= last) {\n return value;\n }\n }\n\n decoded += value[i];\n }\n\n return decoded;\n}\n\nfunction parseParameters(value) {\n const parameters = Object.create(null);\n const str = String(value);\n let start = 0;\n let quoted = false;\n let escaped = false;\n\n function parseParameter(end) {\n const part = trimOWS(str.slice(start, end));\n const equals = part.indexOf('=');\n\n if (equals < 1) {\n return;\n }\n\n const name = trimOWS(part.slice(0, equals));\n\n if (!parameterNameRE.test(name)) {\n return;\n }\n\n const normalizedName = name.toLowerCase();\n\n if (\n normalizedName === '__proto__' ||\n normalizedName === 'constructor' ||\n normalizedName === 'prototype'\n ) {\n return;\n }\n\n const parameterValue = trimOWS(part.slice(equals + 1));\n parameters[normalizedName] = decodeQuotedString(parameterValue);\n }\n\n for (let i = 0; i < str.length; i++) {\n const code = str.charCodeAt(i);\n\n if (quoted) {\n if (escaped) {\n escaped = false;\n } else if (code === 0x5c) {\n escaped = true;\n } else if (code === 0x22) {\n quoted = false;\n }\n } else if (code === 0x22) {\n quoted = true;\n } else if (code === 0x2c || code === 0x3b) {\n parseParameter(i);\n start = i + 1;\n }\n }\n\n parseParameter(str.length);\n\n return parameters;\n}\n\nconst isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());\n\nfunction matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {\n if (utils.isFunction(filter)) {\n return filter.call(this, value, header);\n }\n\n if (isHeaderNameFilter) {\n value = header;\n }\n\n if (!utils.isString(value)) return;\n\n if (utils.isString(filter)) {\n return value.indexOf(filter) !== -1;\n }\n\n if (utils.isRegExp(filter)) {\n return filter.test(value);\n }\n}\n\nfunction formatHeader(header) {\n return header\n .trim()\n .toLowerCase()\n .replace(/([a-z\\d])(\\w*)/g, (w, char, str) => {\n return char.toUpperCase() + str;\n });\n}\n\nfunction buildAccessors(obj, header) {\n const accessorName = utils.toCamelCase(' ' + header);\n\n ['get', 'set', 'has'].forEach((methodName) => {\n Object.defineProperty(obj, methodName + accessorName, {\n // Null-proto descriptor so a polluted Object.prototype.get cannot turn\n // this data descriptor into an accessor descriptor on the way in.\n __proto__: null,\n value: function (arg1, arg2, arg3) {\n return this[methodName].call(this, header, arg1, arg2, arg3);\n },\n configurable: true,\n });\n });\n}\n\nclass AxiosHeaders {\n constructor(headers) {\n headers && this.set(headers);\n }\n\n set(header, valueOrRewrite, rewrite) {\n const self = this;\n\n function setHeader(_value, _header, _rewrite) {\n const lHeader = normalizeHeader(_header);\n\n if (!lHeader) {\n return;\n }\n\n const key = utils.findKey(self, lHeader);\n\n if (\n !key ||\n self[key] === undefined ||\n _rewrite === true ||\n (_rewrite === undefined && self[key] !== false)\n ) {\n self[key || _header] = normalizeValue(_value);\n }\n }\n\n const setHeaders = (headers, _rewrite) =>\n utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));\n\n if (utils.isPlainObject(header) || header instanceof this.constructor) {\n setHeaders(header, valueOrRewrite);\n } else if (utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {\n setHeaders(parseHeaders(header), valueOrRewrite);\n } else if (utils.isObject(header) && utils.isSafeIterable(header)) {\n let obj = Object.create(null),\n dest,\n key;\n for (const entry of header) {\n if (!utils.isArray(entry)) {\n throw new TypeError('Object iterator must return a key-value pair');\n }\n\n key = entry[0];\n\n if (utils.hasOwnProp(obj, key)) {\n dest = obj[key];\n obj[key] = utils.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]];\n } else {\n obj[key] = entry[1];\n }\n }\n\n setHeaders(obj, valueOrRewrite);\n } else {\n header != null && setHeader(valueOrRewrite, header, rewrite);\n }\n\n return this;\n }\n\n get(header, parser) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n if (key) {\n const value = this[key];\n\n if (!parser) {\n return value;\n }\n\n if (parser === true) {\n return parseTokens(value);\n }\n\n if (utils.isFunction(parser)) {\n return parser.call(this, value, key);\n }\n\n if (utils.isRegExp(parser)) {\n return parser.exec(value);\n }\n\n throw new TypeError('parser must be boolean|regexp|function');\n }\n }\n }\n\n has(header, matcher) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n return !!(\n key &&\n this[key] !== undefined &&\n (!matcher || matchHeaderValue(this, this[key], key, matcher))\n );\n }\n\n return false;\n }\n\n delete(header, matcher) {\n const self = this;\n let deleted = false;\n\n function deleteHeader(_header) {\n _header = normalizeHeader(_header);\n\n if (_header) {\n const key = utils.findKey(self, _header);\n\n if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {\n delete self[key];\n\n deleted = true;\n }\n }\n }\n\n if (utils.isArray(header)) {\n header.forEach(deleteHeader);\n } else {\n deleteHeader(header);\n }\n\n return deleted;\n }\n\n clear(matcher) {\n const keys = Object.keys(this);\n let i = keys.length;\n let deleted = false;\n\n while (i--) {\n const key = keys[i];\n if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {\n delete this[key];\n deleted = true;\n }\n }\n\n return deleted;\n }\n\n normalize(format) {\n const self = this;\n const headers = {};\n\n utils.forEach(this, (value, header) => {\n const key = utils.findKey(headers, header);\n\n if (key) {\n self[key] = normalizeValue(value);\n delete self[header];\n return;\n }\n\n const normalized = format ? formatHeader(header) : String(header).trim();\n\n if (normalized !== header) {\n delete self[header];\n }\n\n self[normalized] = normalizeValue(value);\n\n headers[normalized] = true;\n });\n\n return this;\n }\n\n concat(...targets) {\n return this.constructor.concat(this, ...targets);\n }\n\n toJSON(asStrings) {\n const obj = Object.create(null);\n\n utils.forEach(this, (value, header) => {\n value != null &&\n value !== false &&\n (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value);\n });\n\n return obj;\n }\n\n [Symbol.iterator]() {\n return Object.entries(this.toJSON())[Symbol.iterator]();\n }\n\n toString() {\n return Object.entries(this.toJSON())\n .map(([header, value]) => header + ': ' + value)\n .join('\\n');\n }\n\n getSetCookie() {\n const value = this.get('set-cookie');\n return utils.isArray(value) ? value : value == null || value === false ? [] : [value];\n }\n\n get [Symbol.toStringTag]() {\n return 'AxiosHeaders';\n }\n\n static from(thing) {\n return thing instanceof this ? thing : new this(thing);\n }\n\n static parseParameters(value) {\n return parseParameters(value);\n }\n\n static concat(first, ...targets) {\n const computed = new this(first);\n\n targets.forEach((target) => computed.set(target));\n\n return computed;\n }\n\n static accessor(header) {\n const internals =\n (this[$internals] =\n this[$internals] =\n {\n accessors: {},\n });\n\n const accessors = internals.accessors;\n const prototype = this.prototype;\n\n function defineAccessor(_header) {\n const lHeader = normalizeHeader(_header);\n\n if (!accessors[lHeader]) {\n buildAccessors(prototype, _header);\n accessors[lHeader] = true;\n }\n }\n\n utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);\n\n return this;\n }\n}\n\nAxiosHeaders.accessor([\n 'Content-Type',\n 'Content-Length',\n 'Accept',\n 'Accept-Encoding',\n 'User-Agent',\n 'Authorization',\n]);\n\n// reserved names hotfix\nutils.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => {\n let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`\n return {\n get: () => value,\n set(headerValue) {\n this[mapped] = headerValue;\n },\n };\n});\n\nutils.freezeMethods(AxiosHeaders);\n\nexport default AxiosHeaders;\n", "'use strict';\n\nimport utils from '../utils.js';\nimport AxiosHeaders from './AxiosHeaders.js';\n\nexport const REDACTED = '[REDACTED ****]';\n\nfunction hasOwnOrPrototypeToJSON(source) {\n if (utils.hasOwnProp(source, 'toJSON')) {\n return true;\n }\n\n let prototype = Object.getPrototypeOf(source);\n\n while (prototype && prototype !== Object.prototype) {\n if (utils.hasOwnProp(prototype, 'toJSON')) {\n return true;\n }\n\n prototype = Object.getPrototypeOf(prototype);\n }\n\n return false;\n}\n\n// Build a plain-object snapshot of `config` and replace the value of any key\n// (case-insensitive) listed in `redactKeys` with REDACTED. Walks through arrays\n// and AxiosHeaders, and short-circuits on circular references.\nfunction redactConfig(config, redactKeys) {\n const lowerKeys = new Set(redactKeys.map((k) => String(k).toLowerCase()));\n const seen = [];\n\n const visit = (source) => {\n if (source === null || typeof source !== 'object') return source;\n if (utils.isBuffer(source)) return source;\n if (seen.indexOf(source) !== -1) return undefined;\n\n if (source instanceof AxiosHeaders) {\n source = source.toJSON();\n }\n\n seen.push(source);\n\n let result;\n if (utils.isArray(source)) {\n result = [];\n source.forEach((v, i) => {\n const reducedValue = visit(v);\n if (!utils.isUndefined(reducedValue)) {\n result[i] = reducedValue;\n }\n });\n } else {\n if (!utils.isPlainObject(source) && hasOwnOrPrototypeToJSON(source)) {\n seen.pop();\n return source;\n }\n\n result = Object.create(null);\n for (const [key, value] of Object.entries(source)) {\n const reducedValue = lowerKeys.has(key.toLowerCase()) ? REDACTED : visit(value);\n if (!utils.isUndefined(reducedValue)) {\n result[key] = reducedValue;\n }\n }\n }\n\n seen.pop();\n return result;\n };\n\n return visit(config);\n}\n\nfunction stringifySafely(value) {\n try {\n return String(value);\n } catch (err) {\n return '';\n }\n}\n\nfunction aggregateErrorMessage(error) {\n const message = error.errors\n .map((entry) => {\n try {\n return entry && entry.message ? stringifySafely(entry.message) : stringifySafely(entry);\n } catch (err) {\n return '';\n }\n })\n .filter(Boolean)\n .join('; ');\n\n return message || error.name || 'AggregateError';\n}\n\nclass AxiosError extends Error {\n static from(error, code, config, request, response, customProps) {\n // `AggregateError` (thrown by Node on dual-stack/Happy-Eyeballs connection\n // failures) has an empty `message`; its detail lives in `errors[]`. Without\n // this, the wrapped error surfaces with a blank message (see #6721).\n let message = error.message;\n if (!message && utils.isArray(error.errors) && error.errors.length) {\n message = aggregateErrorMessage(error);\n }\n\n const axiosError = new AxiosError(message, code || error.code, config, request, response);\n // Match native `Error` `cause` semantics: non-enumerable. The wrapped\n // error often carries circular internals (sockets, requests, agents), so\n // an enumerable `cause` makes structured loggers (pino/winston) and any\n // own-property walk throw \"Converting circular structure to JSON\".\n // Regression from #6982; see #7205. `__proto__: null` mirrors the\n // `message` descriptor below (prototype-pollution-safe descriptor).\n Object.defineProperty(axiosError, 'cause', {\n __proto__: null,\n value: error,\n writable: true,\n enumerable: false,\n configurable: true,\n });\n axiosError.name = error.name;\n\n // Preserve status from the original error if not already set from response\n if (error.status != null && axiosError.status == null) {\n axiosError.status = error.status;\n }\n\n customProps && Object.assign(axiosError, customProps);\n return axiosError;\n }\n\n /**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [config] The config.\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n *\n * @returns {Error} The created error.\n */\n constructor(message, code, config, request, response) {\n super(message);\n\n // Make message enumerable to maintain backward compatibility\n // The native Error constructor sets message as non-enumerable,\n // but axios < v1.13.3 had it as enumerable\n Object.defineProperty(this, 'message', {\n // Null-proto descriptor so a polluted Object.prototype.get cannot turn\n // this data descriptor into an accessor descriptor on the way in.\n __proto__: null,\n value: message,\n enumerable: true,\n writable: true,\n configurable: true,\n });\n\n this.name = 'AxiosError';\n this.isAxiosError = true;\n code && (this.code = code);\n config && (this.config = config);\n request && (this.request = request);\n if (response) {\n this.response = response;\n this.status = response.status;\n }\n }\n\n toJSON() {\n // Opt-in redaction: when the request config carries a `redact` array, the\n // value of any matching key (case-insensitive, at any depth) is replaced\n // with REDACTED in the serialized snapshot. Undefined or empty leaves the\n // existing serialization behavior unchanged.\n const config = this.config;\n const redactKeys = config && utils.hasOwnProp(config, 'redact') ? config.redact : undefined;\n const serializedConfig =\n utils.isArray(redactKeys) && redactKeys.length > 0\n ? redactConfig(config, redactKeys)\n : utils.toJSONObject(config);\n\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: serializedConfig,\n code: this.code,\n status: this.status,\n };\n }\n}\n\n// This can be changed to static properties as soon as the parser options in .eslint.cjs are updated.\nAxiosError.ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE';\nAxiosError.ERR_BAD_OPTION = 'ERR_BAD_OPTION';\nAxiosError.ECONNABORTED = 'ECONNABORTED';\nAxiosError.ETIMEDOUT = 'ETIMEDOUT';\nAxiosError.ECONNREFUSED = 'ECONNREFUSED';\nAxiosError.ERR_NETWORK = 'ERR_NETWORK';\nAxiosError.ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS';\nAxiosError.ERR_DEPRECATED = 'ERR_DEPRECATED';\nAxiosError.ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE';\nAxiosError.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST';\nAxiosError.ERR_CANCELED = 'ERR_CANCELED';\nAxiosError.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';\nAxiosError.ERR_INVALID_URL = 'ERR_INVALID_URL';\nAxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED = 'ERR_FORM_DATA_DEPTH_EXCEEDED';\n\nexport default AxiosError;\n", "// eslint-disable-next-line strict\nexport default null;\n", "'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\n// temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored\nimport PlatformFormData from '../platform/node/classes/FormData.js';\nimport PlatformBuffer from '../platform/node/classes/Buffer.js';\n\n// Default nesting limit shared with the inverse transform (formDataToJSON) so\n// the FormData <-> JSON round-trip stays symmetric.\nexport const DEFAULT_FORM_DATA_MAX_DEPTH = 100;\n\n/**\n * Determines if the given thing is a array or js object.\n *\n * @param {string} thing - The object or array to be visited.\n *\n * @returns {boolean}\n */\nfunction isVisitable(thing) {\n return utils.isPlainObject(thing) || utils.isArray(thing);\n}\n\n/**\n * It removes the brackets from the end of a string\n *\n * @param {string} key - The key of the parameter.\n *\n * @returns {string} the key without the brackets.\n */\nfunction removeBrackets(key) {\n return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;\n}\n\n/**\n * It takes a path, a key, and a boolean, and returns a string\n *\n * @param {string} path - The path to the current key.\n * @param {string} key - The key of the current object being iterated over.\n * @param {string} dots - If true, the key will be rendered with dots instead of brackets.\n *\n * @returns {string} The path to the current key.\n */\nfunction renderKey(path, key, dots) {\n if (!path) return key;\n return path\n .concat(key)\n .map(function each(token, i) {\n // eslint-disable-next-line no-param-reassign\n token = removeBrackets(token);\n return !dots && i ? '[' + token + ']' : token;\n })\n .join(dots ? '.' : '');\n}\n\n/**\n * If the array is an array and none of its elements are visitable, then it's a flat array.\n *\n * @param {Array} arr - The array to check\n *\n * @returns {boolean}\n */\nfunction isFlatArray(arr) {\n return utils.isArray(arr) && !arr.some(isVisitable);\n}\n\nconst predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {\n return /^is[A-Z]/.test(prop);\n});\n\n/**\n * Convert a data object to FormData\n *\n * @param {Object} obj\n * @param {?Object} [formData]\n * @param {?Object} [options]\n * @param {Function} [options.visitor]\n * @param {Boolean} [options.metaTokens = true]\n * @param {Boolean} [options.dots = false]\n * @param {?Boolean} [options.indexes = false]\n *\n * @returns {Object}\n **/\n\n/**\n * It converts an object into a FormData object\n *\n * @param {Object} obj - The object to convert to form data.\n * @param {string} formData - The FormData object to append to.\n * @param {Object} options\n *\n * @returns\n */\nfunction toFormData(obj, formData, options) {\n if (!utils.isObject(obj)) {\n throw new TypeError('target must be an object');\n }\n\n // eslint-disable-next-line no-param-reassign\n formData = formData || new (PlatformFormData || FormData)();\n\n const option = (name, fallback) => {\n const value = utils.getSafeProp(options, name);\n return utils.isUndefined(value) ? fallback : value;\n };\n\n const metaTokens = option('metaTokens', true);\n // eslint-disable-next-line no-use-before-define\n const visitor = option('visitor') || defaultVisitor;\n const dots = option('dots', false);\n const indexes = option('indexes', false);\n const _Blob = option('Blob') || (typeof Blob !== 'undefined' && Blob);\n const maxDepth = option('maxDepth', DEFAULT_FORM_DATA_MAX_DEPTH);\n const useBlob = _Blob && utils.isSpecCompliantForm(formData);\n const stack = [];\n\n if (!utils.isFunction(visitor)) {\n throw new TypeError('visitor must be a function');\n }\n\n function convertValue(value) {\n if (value === null) return '';\n\n if (utils.isDate(value)) {\n return value.toISOString();\n }\n\n if (utils.isBoolean(value)) {\n return value.toString();\n }\n\n if (!useBlob && utils.isBlob(value)) {\n throw new AxiosError('Blob is not supported. Use a Buffer instead.');\n }\n\n if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {\n if (useBlob && typeof _Blob === 'function') {\n return new _Blob([value]);\n }\n if (PlatformBuffer && PlatformBuffer.isBufferAvailable()) {\n return PlatformBuffer.from(value);\n }\n throw new AxiosError(\n 'Blob is not supported. Use a Buffer instead.',\n AxiosError.ERR_NOT_SUPPORT\n );\n }\n\n return value;\n }\n\n function throwIfMaxDepthExceeded(depth) {\n if (depth > maxDepth) {\n throw new AxiosError(\n 'Object is too deeply nested (' + depth + ' levels). Max depth: ' + maxDepth,\n AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED\n );\n }\n }\n\n function stringifyWithDepthLimit(value, depth) {\n if (maxDepth === Infinity) {\n return JSON.stringify(value);\n }\n\n const ancestors = [];\n\n return JSON.stringify(value, function limitDepth(_key, currentValue) {\n if (!utils.isObject(currentValue)) {\n return currentValue;\n }\n\n while (ancestors.length && ancestors[ancestors.length - 1] !== this) {\n ancestors.pop();\n }\n\n ancestors.push(currentValue);\n throwIfMaxDepthExceeded(depth + ancestors.length - 1);\n\n return currentValue;\n });\n }\n\n /**\n * Default visitor.\n *\n * @param {*} value\n * @param {String|Number} key\n * @param {Array} path\n * @this {FormData}\n *\n * @returns {boolean} return true to visit the each prop of the value recursively\n */\n function defaultVisitor(value, key, path) {\n let arr = value;\n\n if (utils.isReactNative(formData) && utils.isReactNativeBlob(value)) {\n formData.append(renderKey(path, key, dots), convertValue(value));\n return false;\n }\n\n if (value && !path && typeof value === 'object') {\n if (utils.endsWith(key, '{}')) {\n // eslint-disable-next-line no-param-reassign\n key = metaTokens ? key : key.slice(0, -2);\n // eslint-disable-next-line no-param-reassign\n value = stringifyWithDepthLimit(value, 1);\n } else if (\n (utils.isArray(value) && isFlatArray(value)) ||\n ((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value)))\n ) {\n // eslint-disable-next-line no-param-reassign\n key = removeBrackets(key);\n\n arr.forEach(function each(el, index) {\n !(utils.isUndefined(el) || el === null) &&\n formData.append(\n // eslint-disable-next-line no-nested-ternary\n indexes === true\n ? renderKey([key], index, dots)\n : indexes === null\n ? key\n : key + '[]',\n convertValue(el)\n );\n });\n return false;\n }\n }\n\n if (isVisitable(value)) {\n return true;\n }\n\n formData.append(renderKey(path, key, dots), convertValue(value));\n\n return false;\n }\n\n const exposedHelpers = Object.assign(predicates, {\n defaultVisitor,\n convertValue,\n isVisitable,\n });\n\n function build(value, path, depth = 0) {\n if (utils.isUndefined(value)) return;\n\n throwIfMaxDepthExceeded(depth);\n\n if (stack.indexOf(value) !== -1) {\n throw new Error('Circular reference detected in ' + path.join('.'));\n }\n\n stack.push(value);\n\n utils.forEach(value, function each(el, key) {\n const result =\n !(utils.isUndefined(el) || el === null) &&\n visitor.call(formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers);\n\n if (result === true) {\n build(el, path ? path.concat(key) : [key], depth + 1);\n }\n });\n\n stack.pop();\n }\n\n if (!utils.isObject(obj)) {\n throw new TypeError('data must be an object');\n }\n\n build(obj);\n\n return formData;\n}\n\nexport default toFormData;\n", "'use strict';\n\nimport toFormData from './toFormData.js';\n\n/**\n * It encodes a string by replacing all characters that are not in the unreserved set with\n * their percent-encoded equivalents\n *\n * @param {string} str - The string to encode.\n *\n * @returns {string} The encoded string.\n */\nfunction encode(str) {\n const charMap = {\n '!': '%21',\n \"'\": '%27',\n '(': '%28',\n ')': '%29',\n '~': '%7E',\n '%20': '+',\n };\n return encodeURIComponent(str).replace(/[!'()~]|%20/g, function replacer(match) {\n return charMap[match];\n });\n}\n\n/**\n * It takes a params object and converts it to a FormData object\n *\n * @param {Object} params - The parameters to be converted to a FormData object.\n * @param {Object} options - The options object passed to the Axios constructor.\n *\n * @returns {void}\n */\nfunction AxiosURLSearchParams(params, options) {\n this._pairs = [];\n\n params && toFormData(params, this, options);\n}\n\nconst prototype = AxiosURLSearchParams.prototype;\n\nprototype.append = function append(name, value) {\n this._pairs.push([name, value]);\n};\n\nprototype.toString = function toString(encoder) {\n const _encode = encoder\n ? (value) => encoder.call(this, value, encode)\n : encode;\n\n return this._pairs\n .map(function each(pair) {\n return _encode(pair[0]) + '=' + _encode(pair[1]);\n }, '')\n .join('&');\n};\n\nexport default AxiosURLSearchParams;\n", "'use strict';\n\nimport utils from '../utils.js';\nimport AxiosURLSearchParams from './AxiosURLSearchParams.js';\n\n/**\n * It replaces URL-encoded forms of `:`, `$`, `,`, and spaces with\n * their plain counterparts (`:`, `$`, `,`, `+`).\n *\n * @param {string} val The value to be encoded.\n *\n * @returns {string} The encoded value.\n */\nexport function encode(val) {\n return encodeURIComponent(val)\n .replace(/%3A/gi, ':')\n .replace(/%24/g, '$')\n .replace(/%2C/gi, ',')\n .replace(/%20/g, '+');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @param {?(object|Function)} options\n *\n * @returns {string} The formatted url\n */\nexport default function buildURL(url, params, options) {\n if (!params) {\n return url;\n }\n url = url || '';\n\n const _options = utils.isFunction(options)\n ? {\n serialize: options,\n }\n : options;\n\n // Read serializer options pollution-safely: own properties and methods on a\n // class/template prototype are honored, but values injected onto a polluted\n // Object.prototype are ignored.\n const _encode = utils.getSafeProp(_options, 'encode') || encode;\n const serializeFn = utils.getSafeProp(_options, 'serialize');\n\n let serializedParams;\n\n if (serializeFn) {\n serializedParams = serializeFn(params, _options);\n } else {\n serializedParams = utils.isURLSearchParams(params)\n ? params.toString()\n : new AxiosURLSearchParams(params, _options).toString(_encode);\n }\n\n if (serializedParams) {\n const hashmarkIndex = url.indexOf('#');\n\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n}\n", "'use strict';\n\nimport utils from '../utils.js';\n\nconst $internals = Symbol('internals');\n\n// `handlers` is public and may be replaced with a nullish value by user code;\n// `clear()` has always tolerated that. Treat it as an empty stack rather than\n// dereferencing it.\nfunction countHandlers(handlers) {\n return handlers ? handlers.length : 0;\n}\n\nfunction trimHandlers(handlers) {\n if (!handlers) {\n return;\n }\n\n while (handlers.length && handlers[handlers.length - 1] === null) {\n handlers.pop();\n }\n}\n\nfunction syncHandlerEntries(manager, internals) {\n const handlers = manager.handlers;\n const length = countHandlers(handlers);\n\n if (handlers !== internals.handlersRef) {\n internals.handlersRef = handlers;\n internals.handlerEntries.clear();\n } else if (length !== internals.handlersLength) {\n if (!length) {\n internals.handlerEntries.clear();\n } else {\n internals.handlerEntries.forEach(function removeStaleEntry(entry, id) {\n if (handlers[entry.index] !== entry.handler) {\n internals.handlerEntries.delete(id);\n }\n });\n }\n }\n\n internals.handlersLength = length;\n}\n\nclass InterceptorManager {\n constructor() {\n this.handlers = [];\n this[$internals] = {\n handlersRef: this.handlers,\n handlersLength: this.handlers.length,\n handlerEntries: new Map(),\n iterationDepth: 0,\n nextId: 0,\n };\n }\n\n /**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n * @param {Object} options The options for the interceptor, synchronous and runWhen\n *\n * @return {Number} An ID used to remove interceptor later\n */\n use(fulfilled, rejected, options) {\n const handler = {\n fulfilled,\n rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null,\n };\n const internals = this[$internals];\n\n if (this.handlers == null) {\n this.handlers = [];\n }\n\n syncHandlerEntries(this, internals);\n\n const id = internals.nextId++;\n\n this.handlers.push(handler);\n internals.handlerEntries.set(id, {\n handler,\n index: this.handlers.length - 1,\n });\n internals.handlersLength = this.handlers.length;\n\n return id;\n }\n\n /**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n *\n * @returns {void}\n */\n eject(id) {\n const internals = this[$internals];\n\n syncHandlerEntries(this, internals);\n\n const entry = internals.handlerEntries.get(id);\n\n if (entry) {\n internals.handlerEntries.delete(id);\n\n // Ignore IDs invalidated by clear or direct replacement of handlers.\n if (this.handlers[entry.index] !== entry.handler) {\n return;\n }\n\n this.handlers[entry.index] = null;\n\n // Do not reuse an index while forEach is walking its length snapshot.\n if (!internals.iterationDepth) {\n trimHandlers(this.handlers);\n internals.handlersLength = this.handlers.length;\n }\n }\n }\n\n /**\n * Clear all interceptors from the stack\n *\n * @returns {void}\n */\n clear() {\n if (this.handlers) {\n this.handlers = [];\n syncHandlerEntries(this, this[$internals]);\n }\n }\n\n /**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n *\n * @returns {void}\n */\n forEach(fn) {\n const internals = this[$internals];\n\n syncHandlerEntries(this, internals);\n\n internals.iterationDepth++;\n\n try {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n } finally {\n if (!--internals.iterationDepth) {\n syncHandlerEntries(this, internals);\n trimHandlers(this.handlers);\n internals.handlersLength = countHandlers(this.handlers);\n }\n }\n }\n}\n\nexport default InterceptorManager;\n", "'use strict';\n\nexport default {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false,\n legacyInterceptorReqResOrdering: true,\n advertiseZstdAcceptEncoding: false,\n validateStatusUndefinedResolves: true,\n};\n", "'use strict';\n\nimport AxiosURLSearchParams from '../../../helpers/AxiosURLSearchParams.js';\nexport default typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;\n", "'use strict';\n\nexport default typeof FormData !== 'undefined' ? FormData : null;\n", "'use strict';\n\nexport default typeof Blob !== 'undefined' ? Blob : null;\n", "import URLSearchParams from './classes/URLSearchParams.js';\nimport FormData from './classes/FormData.js';\nimport Blob from './classes/Blob.js';\n\nexport default {\n isBrowser: true,\n classes: {\n URLSearchParams,\n FormData,\n Blob,\n },\n protocols: ['http', 'https', 'file', 'blob', 'url', 'data'],\n};\n", "const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';\n\nconst _navigator = (typeof navigator === 'object' && navigator) || undefined;\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n *\n * @returns {boolean}\n */\nconst hasStandardBrowserEnv =\n hasBrowserEnv &&\n (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);\n\n/**\n * Determine if we're running in a standard browser webWorker environment\n *\n * Although the `isStandardBrowserEnv` method indicates that\n * `allows axios to run in a web worker`, the WebWorker will still be\n * filtered out due to its judgment standard\n * `typeof window !== 'undefined' && typeof document !== 'undefined'`.\n * This leads to a problem when axios post `FormData` in webWorker\n */\nconst hasStandardBrowserWebWorkerEnv = (() => {\n return (\n typeof WorkerGlobalScope !== 'undefined' &&\n // eslint-disable-next-line no-undef\n self instanceof WorkerGlobalScope &&\n typeof self.importScripts === 'function'\n );\n})();\n\nconst origin = (hasBrowserEnv && window.location.href) || 'http://localhost';\n\nexport {\n hasBrowserEnv,\n hasStandardBrowserWebWorkerEnv,\n hasStandardBrowserEnv,\n _navigator as navigator,\n origin,\n};\n", "import platform from './node/index.js';\nimport * as utils from './common/utils.js';\n\nexport default {\n ...utils,\n ...platform,\n};\n", "'use strict';\n\nimport utils from '../utils.js';\nimport toFormData from './toFormData.js';\nimport platform from '../platform/index.js';\n\nexport default function toURLEncodedForm(data, options) {\n return toFormData(data, new platform.classes.URLSearchParams(), {\n visitor: function (value, key, path, helpers) {\n if (platform.isNode && utils.isBuffer(value)) {\n this.append(key, value.toString('base64'));\n return false;\n }\n\n return helpers.defaultVisitor.apply(this, arguments);\n },\n ...options,\n });\n}\n", "'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\nimport { DEFAULT_FORM_DATA_MAX_DEPTH } from './toFormData.js';\n\nconst MAX_DEPTH = DEFAULT_FORM_DATA_MAX_DEPTH;\n\nfunction throwIfDepthExceeded(index) {\n if (index > MAX_DEPTH) {\n throw new AxiosError(\n 'FormData field is too deeply nested (' + index + ' levels). Max depth: ' + MAX_DEPTH,\n AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED\n );\n }\n}\n\n/**\n * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']\n *\n * @param {string} name - The name of the property to get.\n *\n * @returns An array of strings.\n */\nfunction parsePropPath(name) {\n // foo[x][y][z] -> ['foo', 'x', 'y', 'z']\n // foo.x.y.z -> ['foo', 'x', 'y', 'z']\n // A path is split on `.` and on `[...]` groups. A segment — whether written\n // in dot notation or captured inside brackets — may contain any character\n // except `.`, `[` and `]`, so a key like `user-name` or `user name` is kept\n // literal instead of being split (#5402). `.`, `[` and `]` keep their existing\n // meaning, e.g. `foo[bar.baz]` -> ['foo', 'bar', 'baz'] and `[]` is an array push.\n // Excluding `[` from the bracket group also makes the match fail fast at the\n // next `[`, so a malformed name cannot rescan to the end of the string from\n // every unmatched `[` — parsing stays linear in the length of the name.\n const path = [];\n const pattern = /[^.[\\]]+|\\[([^.[\\]]*)]/g;\n let match;\n\n while ((match = pattern.exec(name)) !== null) {\n throwIfDepthExceeded(path.length);\n path.push(match[0] === '[]' ? '' : match[1] || match[0]);\n }\n\n return path;\n}\n\n/**\n * Convert an array to an object.\n *\n * @param {Array} arr - The array to convert to an object.\n *\n * @returns An object with the same keys and values as the array.\n */\nfunction arrayToObject(arr) {\n const obj = {};\n const keys = Object.keys(arr);\n let i;\n const len = keys.length;\n let key;\n for (i = 0; i < len; i++) {\n key = keys[i];\n obj[key] = arr[key];\n }\n return obj;\n}\n\n/**\n * It takes a FormData object and returns a JavaScript object\n *\n * @param {string} formData The FormData object to convert to JSON.\n *\n * @returns {Object | null} The converted object.\n */\nfunction formDataToJSON(formData) {\n function buildPath(path, value, target, index) {\n throwIfDepthExceeded(index);\n\n let name = path[index++];\n\n if (name === '__proto__') return true;\n\n const isNumericKey = Number.isFinite(+name);\n const isLast = index >= path.length;\n name = !name && utils.isArray(target) ? target.length : name;\n\n if (isLast) {\n if (utils.hasOwnProp(target, name)) {\n target[name] = utils.isArray(target[name])\n ? target[name].concat(value)\n : [target[name], value];\n } else {\n target[name] = value;\n }\n\n return !isNumericKey;\n }\n\n if (!utils.hasOwnProp(target, name) || !utils.isObject(target[name])) {\n target[name] = [];\n }\n\n const result = buildPath(path, value, target[name], index);\n\n if (result && utils.isArray(target[name])) {\n target[name] = arrayToObject(target[name]);\n }\n\n return !isNumericKey;\n }\n\n if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {\n const obj = {};\n\n utils.forEachEntry(formData, (name, value) => {\n buildPath(parsePropPath(name), value, obj, 0);\n });\n\n return obj;\n }\n\n return null;\n}\n\nexport default formDataToJSON;\n", "'use strict';\n\nconst methodList = Object.freeze([\n 'get',\n 'delete',\n 'head',\n 'options',\n 'post',\n 'put',\n 'patch',\n 'purge',\n 'link',\n 'unlink',\n 'query',\n]);\n\nexport default methodList;\n", "'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\nimport transitionalDefaults from './transitional.js';\nimport toFormData from '../helpers/toFormData.js';\nimport toURLEncodedForm from '../helpers/toURLEncodedForm.js';\nimport platform from '../platform/index.js';\nimport formDataToJSON from '../helpers/formDataToJSON.js';\nimport methodList from '../core/methodList.js';\n\nconst own = (obj, key) => (obj != null && utils.hasOwnProp(obj, key) ? obj[key] : undefined);\n\n/**\n * It takes a string, tries to parse it, and if it fails, it returns the stringified version\n * of the input\n *\n * @param {any} rawValue - The value to be stringified.\n * @param {Function} parser - A function that parses a string into a JavaScript object.\n * @param {Function} encoder - A function that takes a value and returns a string.\n *\n * @returns {string} A stringified version of the rawValue.\n */\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nconst defaults = {\n transitional: transitionalDefaults,\n\n adapter: ['xhr', 'http', 'fetch'],\n\n transformRequest: [\n function transformRequest(data, headers) {\n const contentType = headers.getContentType() || '';\n const hasJSONContentType = contentType.indexOf('application/json') > -1;\n const isObjectPayload = utils.isObject(data);\n\n if (isObjectPayload && utils.isHTMLForm(data)) {\n data = new FormData(data);\n }\n\n const isFormData = utils.isFormData(data);\n\n if (isFormData) {\n return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;\n }\n\n if (\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data) ||\n utils.isReadableStream(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);\n return data.toString();\n }\n\n let isFileList;\n\n if (isObjectPayload) {\n const formSerializer = own(this, 'formSerializer');\n if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {\n return toURLEncodedForm(data, formSerializer).toString();\n }\n\n if (\n (isFileList = utils.isFileList(data)) ||\n contentType.indexOf('multipart/form-data') > -1\n ) {\n const env = own(this, 'env');\n const _FormData = env && env.FormData;\n\n return toFormData(\n isFileList ? { 'files[]': data } : data,\n _FormData && new _FormData(),\n formSerializer\n );\n }\n }\n\n if (isObjectPayload || hasJSONContentType) {\n headers.setContentType('application/json', false);\n return stringifySafely(data);\n }\n\n return data;\n },\n ],\n\n transformResponse: [\n function transformResponse(data) {\n const transitional = own(this, 'transitional') || defaults.transitional;\n const forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n const responseType = own(this, 'responseType');\n const JSONRequested = responseType === 'json';\n\n if (utils.isResponse(data) || utils.isReadableStream(data)) {\n return data;\n }\n\n if (\n data &&\n utils.isString(data) &&\n ((forcedJSONParsing && !responseType) || JSONRequested)\n ) {\n const silentJSONParsing = transitional && transitional.silentJSONParsing;\n const strictJSONParsing = !silentJSONParsing && JSONRequested;\n\n try {\n return JSON.parse(data, own(this, 'parseReviver'));\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, own(this, 'response'));\n }\n throw e;\n }\n }\n }\n\n return data;\n },\n ],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n env: {\n FormData: platform.classes.FormData,\n Blob: platform.classes.Blob,\n },\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n\n headers: {\n common: {\n Accept: 'application/json, text/plain, */*',\n 'Content-Type': undefined,\n },\n },\n};\n\nutils.forEach(methodList, (method) => {\n defaults.headers[method] = {};\n});\n\nexport default defaults;\n", "'use strict';\n\nimport utils from '../utils.js';\nimport defaults from '../defaults/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Array|Function} fns A single function or Array of functions\n * @param {?Object} response The response object\n *\n * @returns {*} The resulting transformed data\n */\nexport default function transformData(fns, response) {\n const config = this || defaults;\n const context = response || config;\n const headers = AxiosHeaders.from(context.headers);\n let data = context.data;\n\n utils.forEach(fns, function transform(fn) {\n data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);\n });\n\n headers.normalize();\n\n return data;\n}\n", "'use strict';\n\nexport default function isCancel(value) {\n return !!(value && value.__CANCEL__);\n}\n", "'use strict';\n\nimport AxiosError from '../core/AxiosError.js';\n\nclass CanceledError extends AxiosError {\n /**\n * A `CanceledError` is an object that is thrown when an operation is canceled.\n *\n * @param {string=} message The message.\n * @param {Object=} config The config.\n * @param {Object=} request The request.\n *\n * @returns {CanceledError} The created error.\n */\n constructor(message, config, request) {\n super(message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);\n this.name = 'CanceledError';\n this.__CANCEL__ = true;\n }\n}\n\nexport default CanceledError;\n", "'use strict';\n\nimport AxiosError from './AxiosError.js';\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n *\n * @returns {object} The response.\n */\nexport default function settle(resolve, reject, response) {\n const validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(new AxiosError(\n 'Request failed with status code ' + response.status,\n response.status >= 400 && response.status < 500 ? AxiosError.ERR_BAD_REQUEST : AxiosError.ERR_BAD_RESPONSE,\n response.config,\n response.request,\n response\n ));\n }\n}\n", "'use strict';\n\nconst urlParserControlCharacters = /[\\t\\n\\r]/g;\n\n/**\n * Match WHATWG URL preprocessing before checking a URL's protocol.\n *\n * @param {string} url\n *\n * @returns {string}\n */\nexport default function normalizeURLForProtocolCheck(url) {\n if (typeof url !== 'string') {\n return url;\n }\n\n let start = 0;\n\n while (start < url.length && url.charCodeAt(start) <= 0x20) {\n start++;\n }\n\n return url.slice(start).replace(urlParserControlCharacters, '');\n}\n", "'use strict';\n\nexport default function parseProtocol(url) {\n const match = /^([-+\\w]{1,25}):(?:\\/\\/)?/.exec(url);\n return (match && match[1]) || '';\n}\n", "'use strict';\n\n/**\n * Calculate data maxRate\n * @param {Number} [samplesCount= 10]\n * @param {Number} [min= 1000]\n * @returns {Function}\n */\nfunction speedometer(samplesCount, min) {\n samplesCount = samplesCount || 10;\n const bytes = new Array(samplesCount);\n const timestamps = new Array(samplesCount);\n let head = 0;\n let tail = 0;\n let firstSampleTS;\n\n min = min !== undefined ? min : 1000;\n\n return function push(chunkLength) {\n const now = Date.now();\n\n const startedAt = timestamps[tail];\n\n if (!firstSampleTS) {\n firstSampleTS = now;\n }\n\n bytes[head] = chunkLength;\n timestamps[head] = now;\n\n let i = tail;\n let bytesCount = 0;\n\n while (i !== head) {\n bytesCount += bytes[i++];\n i = i % samplesCount;\n }\n\n head = (head + 1) % samplesCount;\n\n if (head === tail) {\n tail = (tail + 1) % samplesCount;\n }\n\n if (now - firstSampleTS < min) {\n return;\n }\n\n const passed = startedAt && now - startedAt;\n\n return passed ? Math.round((bytesCount * 1000) / passed) : undefined;\n };\n}\n\nexport default speedometer;\n", "/**\n * Throttle decorator\n * @param {Function} fn\n * @param {Number} freq\n * @return {Array}\n */\nfunction throttle(fn, freq) {\n let timestamp = 0;\n let threshold = 1000 / freq;\n let lastArgs;\n let timer;\n\n const invoke = (args, now = Date.now()) => {\n timestamp = now;\n lastArgs = null;\n if (timer) {\n clearTimeout(timer);\n timer = null;\n }\n fn(...args);\n };\n\n const throttled = (...args) => {\n const now = Date.now();\n const passed = now - timestamp;\n if (passed >= threshold) {\n invoke(args, now);\n } else {\n lastArgs = args;\n if (!timer) {\n timer = setTimeout(() => {\n timer = null;\n invoke(lastArgs);\n }, threshold - passed);\n }\n }\n };\n\n const flush = () => lastArgs && invoke(lastArgs);\n const flushWith = (...args) => invoke(args);\n\n return [throttled, flush, flushWith];\n}\n\nexport default throttle;\n", "import speedometer from './speedometer.js';\nimport throttle from './throttle.js';\nimport utils from '../utils.js';\n\nexport const progressEventReducer = (listener, isDownloadStream, freq = 3) => {\n let bytesNotified = 0;\n const _speedometer = speedometer(50, 250);\n\n return throttle((e) => {\n if (!e || !utils.isNumber(e.loaded)) {\n return;\n }\n const rawLoaded = e.loaded;\n const total = e.lengthComputable ? e.total : undefined;\n const loaded = Math.max(0, total != null ? Math.min(rawLoaded, total) : rawLoaded);\n const progressBytes = Math.max(0, loaded - bytesNotified);\n const rate = _speedometer(progressBytes);\n\n bytesNotified = Math.max(bytesNotified, loaded);\n\n const data = {\n loaded,\n total,\n progress: total ? loaded / total : undefined,\n bytes: progressBytes,\n rate: rate ? rate : undefined,\n estimated: rate && total ? (total - loaded) / rate : undefined,\n event: e,\n lengthComputable: total != null,\n [isDownloadStream ? 'download' : 'upload']: true,\n };\n\n listener(data);\n }, freq);\n};\n\nexport const progressEventDecorator = (total, throttled) => {\n const lengthComputable = total != null;\n\n return [\n (loaded) =>\n throttled[0]({\n lengthComputable,\n total,\n loaded,\n }),\n throttled[1],\n ];\n};\n\nexport const asyncDecorator =\n (fn, scheduler = utils.asap) =>\n (...args) =>\n scheduler(() => fn(...args));\n", "import platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv\n ? ((origin, isMSIE) => (url) => {\n url = new URL(url, platform.origin);\n\n return (\n origin.protocol === url.protocol &&\n origin.host === url.host &&\n (isMSIE || origin.port === url.port)\n );\n })(\n new URL(platform.origin),\n platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)\n )\n : () => true;\n", "import utils from '../utils.js';\nimport platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv\n ? // Standard browser envs support document.cookie\n {\n write(name, value, expires, path, domain, secure, sameSite) {\n if (typeof document === 'undefined') return;\n\n const cookie = [`${name}=${encodeURIComponent(value)}`];\n\n if (utils.isNumber(expires)) {\n cookie.push(`expires=${new Date(expires).toUTCString()}`);\n }\n if (utils.isString(path)) {\n cookie.push(`path=${path}`);\n }\n if (utils.isString(domain)) {\n cookie.push(`domain=${domain}`);\n }\n if (secure === true) {\n cookie.push('secure');\n }\n if (utils.isString(sameSite)) {\n cookie.push(`SameSite=${sameSite}`);\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read(name) {\n if (typeof document === 'undefined') return null;\n // Match name=value by splitting on the semicolon separator instead of building a\n // RegExp from `name` — interpolating an unescaped string into a RegExp would let\n // metacharacters (e.g. `.+?` in an attacker-influenced cookie name) cause ReDoS or\n // match the wrong cookie. Browsers may serialize cookie pairs as either \";\" or\n // \"; \", so ignore optional whitespace before each cookie name.\n const cookies = document.cookie.split(';');\n for (let i = 0; i < cookies.length; i++) {\n const cookie = cookies[i].replace(/^\\s+/, '');\n const eq = cookie.indexOf('=');\n if (eq !== -1 && cookie.slice(0, eq) === name) {\n try {\n return decodeURIComponent(cookie.slice(eq + 1));\n } catch (e) {\n return cookie.slice(eq + 1);\n }\n }\n }\n return null;\n },\n\n remove(name) {\n this.write(name, '', Date.now() - 86400000, '/');\n },\n }\n : // Non-standard browser env (web workers, react-native) lack needed support.\n {\n write() {},\n read() {\n return null;\n },\n remove() {},\n };\n", "'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n *\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nexport default function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n if (typeof url !== 'string') {\n return false;\n }\n\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n}\n", "'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n *\n * @returns {string} The combined URL\n */\nexport default function combineURLs(baseURL, relativeURL) {\n if (!relativeURL) {\n return baseURL;\n }\n\n let end = baseURL.length;\n\n while (end > 0 && baseURL.charCodeAt(end - 1) === 47) {\n end--;\n }\n\n return baseURL.slice(0, end) + '/' + relativeURL.replace(/^\\/+/, '');\n}\n", "'use strict';\n\nimport AxiosError, { REDACTED } from './AxiosError.js';\nimport isAbsoluteURL from '../helpers/isAbsoluteURL.js';\nimport combineURLs from '../helpers/combineURLs.js';\nimport normalizeURLForProtocolCheck from '../helpers/normalizeURLForProtocolCheck.js';\n\nconst malformedHttpProtocol = /^https?:(?!\\/\\/)/i;\n\n// Redact the parts of a URL that can carry secrets before it is embedded in an\n// error message. AxiosError.toJSON() serializes `message` verbatim and errors\n// are commonly logged, while the opt-in `config.redact` model only cleans\n// config keys — it cannot reach the message. Redact only the genuinely\n// sensitive substrings — userinfo (credentials), query parameter values and\n// fragment contents — with the same REDACTED marker the config redaction uses,\n// while keeping the scheme, host, path and parameter names so the offending\n// request stays accurately identifiable.\nfunction redactFragment(fragment) {\n if (!fragment) {\n return fragment;\n }\n\n return fragment.replace(/(^|&)([^=&]*=)?[^&]+/g, (match, separator, parameterName = '') => {\n return `${separator}${parameterName}${REDACTED}`;\n });\n}\n\nfunction redactSensitiveURLParts(url) {\n const redactedURL = url.replace(/^(https?:\\/{0,2})[^/?#]*@/i, `$1${REDACTED}@`);\n const fragmentIndex = redactedURL.indexOf('#');\n const urlWithoutFragment =\n fragmentIndex === -1 ? redactedURL : redactedURL.slice(0, fragmentIndex);\n const redactedURLWithoutFragment = urlWithoutFragment.replace(\n /([?&][^=&#]*=)[^&#]*/g,\n `$1${REDACTED}`\n );\n\n if (fragmentIndex === -1) {\n return redactedURLWithoutFragment;\n }\n\n return `${redactedURLWithoutFragment}#${redactFragment(redactedURL.slice(fragmentIndex + 1))}`;\n}\n\nfunction assertValidHttpProtocolURL(url, config) {\n if (typeof url === 'string') {\n const normalizedURL = normalizeURLForProtocolCheck(url);\n if (malformedHttpProtocol.test(normalizedURL)) {\n throw new AxiosError(\n `Invalid URL ${JSON.stringify(redactSensitiveURLParts(normalizedURL))}: missing \"//\" after protocol`,\n AxiosError.ERR_INVALID_URL,\n config\n );\n }\n }\n}\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n *\n * @returns {string} The combined full path\n */\nexport default function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls, config) {\n assertValidHttpProtocolURL(requestedURL, config);\n let isRelativeUrl = !isAbsoluteURL(requestedURL);\n if (baseURL && (isRelativeUrl || allowAbsoluteUrls === false)) {\n assertValidHttpProtocolURL(baseURL, config);\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n}\n", "'use strict';\n\nimport utils from '../utils.js';\nimport AxiosHeaders from './AxiosHeaders.js';\n\nconst headersToObject = (thing) => (thing instanceof AxiosHeaders ? { ...thing } : thing);\n\nconst ownEnumerableKeys = (thing) => {\n if (Object.getOwnPropertySymbols && Object.getOwnPropertyDescriptor) {\n return Object.keys(thing).concat(\n Object.getOwnPropertySymbols(thing).filter(\n (symbol) => Object.getOwnPropertyDescriptor(thing, symbol).enumerable\n )\n );\n }\n return Object.keys(thing);\n};\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n *\n * @returns {Object} New object resulting from merging config2 to config1\n */\nexport default function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config1 = config1 || {};\n config2 = config2 || {};\n\n // Use a null-prototype object so that downstream reads such as `config.auth`\n // or `config.baseURL` cannot inherit polluted values from Object.prototype.\n // `hasOwnProperty` is restored as a non-enumerable own slot to preserve\n // ergonomics for user code that relies on it.\n const config = Object.create(null);\n Object.defineProperty(config, 'hasOwnProperty', {\n // Null-proto descriptor so a polluted Object.prototype.get cannot turn\n // this data descriptor into an accessor descriptor on the way in.\n __proto__: null,\n value: Object.prototype.hasOwnProperty,\n enumerable: false,\n writable: true,\n configurable: true,\n });\n\n function getMergedValue(target, source, prop, caseless) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge.call({ caseless }, target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n function mergeDeepProperties(a, b, prop, caseless) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(a, b, prop, caseless);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a, prop, caseless);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function valueFromConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function defaultToConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a);\n }\n }\n\n function getMergedTransitionalOption(prop) {\n const transitional2 = utils.hasOwnProp(config2, 'transitional')\n ? config2.transitional\n : undefined;\n\n if (!utils.isUndefined(transitional2)) {\n if (utils.isPlainObject(transitional2)) {\n if (utils.hasOwnProp(transitional2, prop)) {\n return transitional2[prop];\n }\n } else {\n return undefined;\n }\n }\n\n const transitional1 = utils.hasOwnProp(config1, 'transitional')\n ? config1.transitional\n : undefined;\n\n if (utils.isPlainObject(transitional1) && utils.hasOwnProp(transitional1, prop)) {\n return transitional1[prop];\n }\n\n return undefined;\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDirectKeys(a, b, prop) {\n if (utils.hasOwnProp(config2, prop)) {\n return getMergedValue(a, b);\n } else if (utils.hasOwnProp(config1, prop)) {\n return getMergedValue(undefined, a);\n }\n }\n\n const mergeMap = {\n url: valueFromConfig2,\n method: valueFromConfig2,\n data: valueFromConfig2,\n baseURL: defaultToConfig2,\n transformRequest: defaultToConfig2,\n transformResponse: defaultToConfig2,\n paramsSerializer: defaultToConfig2,\n timeout: defaultToConfig2,\n timeoutErrorMessage: defaultToConfig2,\n withCredentials: defaultToConfig2,\n withXSRFToken: defaultToConfig2,\n adapter: defaultToConfig2,\n responseType: defaultToConfig2,\n xsrfCookieName: defaultToConfig2,\n xsrfHeaderName: defaultToConfig2,\n onUploadProgress: defaultToConfig2,\n onDownloadProgress: defaultToConfig2,\n decompress: defaultToConfig2,\n maxContentLength: defaultToConfig2,\n maxBodyLength: defaultToConfig2,\n beforeRedirect: defaultToConfig2,\n transport: defaultToConfig2,\n httpAgent: defaultToConfig2,\n httpsAgent: defaultToConfig2,\n cancelToken: defaultToConfig2,\n socketPath: defaultToConfig2,\n allowedSocketPaths: defaultToConfig2,\n responseEncoding: defaultToConfig2,\n validateStatus: mergeDirectKeys,\n headers: (a, b, prop) =>\n mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true),\n };\n\n utils.forEach(ownEnumerableKeys({ ...config1, ...config2 }), function computeConfigValue(prop) {\n if (prop === '__proto__' || prop === 'constructor' || prop === 'prototype') return;\n const merge = utils.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties;\n const a = utils.hasOwnProp(config1, prop) ? config1[prop] : undefined;\n const b = utils.hasOwnProp(config2, prop) ? config2[prop] : undefined;\n const configValue = merge(a, b, prop);\n (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n if (\n utils.hasOwnProp(config2, 'validateStatus') &&\n utils.isUndefined(config2.validateStatus) &&\n getMergedTransitionalOption('validateStatusUndefinedResolves') === false\n ) {\n if (utils.hasOwnProp(config1, 'validateStatus')) {\n config.validateStatus = getMergedValue(undefined, config1.validateStatus);\n } else {\n delete config.validateStatus;\n }\n }\n\n return config;\n}\n", "'use strict';\n\nconst FORM_DATA_CONTENT_HEADERS = ['content-type', 'content-length'];\n\n/**\n * Apply the headers generated by a FormData implementation to the request headers,\n * honoring the `formDataHeaderPolicy` option: with 'content-only', copy only the\n * content-* headers; otherwise merge all of them.\n *\n * @param {AxiosHeaders} headers - the request headers to mutate\n * @param {Object | null | undefined} formHeaders - headers produced by the FormData implementation\n * @param {String} [policy] - the resolved `formDataHeaderPolicy` config value\n *\n * @returns {void}\n */\nexport default function setFormDataHeaders(headers, formHeaders, policy) {\n if (policy !== 'content-only') {\n headers.set(formHeaders);\n return;\n }\n\n Object.entries(formHeaders || {}).forEach(([key, val]) => {\n if (FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) {\n headers.set(key, val);\n }\n });\n}\n", "import platform from '../platform/index.js';\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\nimport isURLSameOrigin from './isURLSameOrigin.js';\nimport cookies from './cookies.js';\nimport buildFullPath from '../core/buildFullPath.js';\nimport mergeConfig from '../core/mergeConfig.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport setFormDataHeaders from '../core/setFormDataHeaders.js';\nimport buildURL from './buildURL.js';\n\n/**\n * Encode a UTF-8 string to a Latin-1 byte string for use with btoa().\n * This is a modern replacement for the deprecated unescape(encodeURIComponent(str)) pattern.\n *\n * @param {string} str The string to encode\n *\n * @returns {string} UTF-8 bytes as a Latin-1 string\n */\nconst encodeUTF8 = (str) =>\n encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, (_, hex) =>\n String.fromCharCode(parseInt(hex, 16))\n );\n\nfunction resolveConfig(config) {\n const newConfig = mergeConfig({}, config);\n\n // Read only own properties to prevent prototype pollution gadgets\n // (e.g. Object.prototype.baseURL = 'https://evil.com').\n const own = (key) => (utils.hasOwnProp(newConfig, key) ? newConfig[key] : undefined);\n\n const data = own('data');\n let withXSRFToken = own('withXSRFToken');\n const xsrfHeaderName = own('xsrfHeaderName');\n const xsrfCookieName = own('xsrfCookieName');\n let headers = own('headers');\n const auth = own('auth');\n const baseURL = own('baseURL');\n const allowAbsoluteUrls = own('allowAbsoluteUrls');\n const url = own('url');\n\n newConfig.headers = headers = AxiosHeaders.from(headers);\n\n newConfig.url = buildURL(\n buildFullPath(baseURL, url, allowAbsoluteUrls, newConfig),\n own('params'),\n own('paramsSerializer')\n );\n\n // HTTP basic authentication\n if (auth) {\n const username = utils.getSafeProp(auth, 'username') || '';\n const password = utils.getSafeProp(auth, 'password') || '';\n\n try {\n headers.set(\n 'Authorization',\n 'Basic ' + btoa(username + ':' + (password ? encodeUTF8(password) : ''))\n );\n } catch (e) {\n throw AxiosError.from(e, AxiosError.ERR_BAD_OPTION_VALUE, config);\n }\n }\n\n if (utils.isFormData(data)) {\n const getHeaders = utils.getSafeProp(data, 'getHeaders');\n\n if (\n platform.hasStandardBrowserEnv ||\n platform.hasStandardBrowserWebWorkerEnv ||\n utils.isReactNative(data)\n ) {\n headers.setContentType(undefined); // browser/web worker/RN handles it\n } else if (utils.isFunction(getHeaders)) {\n // Node.js FormData (like form-data package)\n setFormDataHeaders(headers, getHeaders.call(data), own('formDataHeaderPolicy'));\n }\n }\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n\n if (platform.hasStandardBrowserEnv) {\n if (utils.isFunction(withXSRFToken)) {\n withXSRFToken = withXSRFToken(newConfig);\n }\n\n // Strict boolean check — prevents proto-pollution gadgets (e.g. Object.prototype.withXSRFToken = 1)\n // and misconfigurations (e.g. \"false\") from short-circuiting the same-origin check and leaking\n // the XSRF token cross-origin.\n const shouldSendXSRF =\n withXSRFToken === true || (withXSRFToken == null && isURLSameOrigin(newConfig.url));\n\n if (shouldSendXSRF) {\n const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);\n\n if (xsrfValue) {\n headers.set(xsrfHeaderName, xsrfValue);\n }\n }\n }\n\n return newConfig;\n}\n\nexport default resolveConfig;\n", "import utils from '../utils.js';\nimport settle from '../core/settle.js';\nimport transitionalDefaults from '../defaults/transitional.js';\nimport AxiosError from '../core/AxiosError.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport normalizeURLForProtocolCheck from '../helpers/normalizeURLForProtocolCheck.js';\nimport parseProtocol from '../helpers/parseProtocol.js';\nimport platform from '../platform/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport { progressEventReducer } from '../helpers/progressEventReducer.js';\nimport resolveConfig from '../helpers/resolveConfig.js';\nimport { toByteStringHeaderObject } from '../helpers/sanitizeHeaderValue.js';\n\nconst isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';\n\nexport default isXHRAdapterSupported &&\n function (config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n const _config = resolveConfig(config);\n let requestData = _config.data;\n const requestHeaders = AxiosHeaders.from(_config.headers).normalize();\n let { responseType, onUploadProgress, onDownloadProgress } = _config;\n let onCanceled;\n let uploadThrottled, downloadThrottled;\n let flushUpload, flushDownload, flushDownloadWithEvent;\n\n function done() {\n flushUpload && flushUpload(); // flush events\n flushDownload && flushDownload(); // flush events\n\n _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);\n\n _config.signal && _config.signal.removeEventListener('abort', onCanceled);\n }\n\n let request = new XMLHttpRequest();\n\n request.open(_config.method.toUpperCase(), _config.url, true);\n\n // Set the request timeout in MS\n request.timeout = _config.timeout;\n\n function onloadend(event) {\n if (!request) {\n return;\n }\n\n // Status 0 means no response was received, which onerror and onabort normally\n // reject before this runs. Firefox 152 fires only readystatechange and loadend for\n // navigation-canceled requests (https://bugzilla.mozilla.org/show_bug.cgi?id=1505389),\n // leaving settle() to resolve them as an empty success. ECONNABORTED is the error\n // onabort raised on Firefox 151. Reads over file:, which some environments report as\n // status 0 on success, are excluded by the request URL's scheme after browser-style\n // preprocessing, by the page origin's scheme for relative URLs (which inherit it), or\n // by responseURL where implemented.\n if (\n request.status === 0 &&\n (parseProtocol(normalizeURLForProtocolCheck(_config.url)) ||\n parseProtocol(platform.origin)) !== 'file' &&\n !(request.responseURL && request.responseURL.startsWith('file:'))\n ) {\n reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));\n done();\n\n // Clean up request\n request = null;\n return;\n }\n\n // When loadend is still dispatching, flushing with it gives progress\n // listeners a final delivery whose event has a live target. The legacy\n // ready-state fallback has no event, so replay its pending progress.\n // A throwing listener must not block settlement; rethrow asynchronously,\n // matching how listener errors surface on the throttle timer path.\n try {\n if (event) {\n flushDownloadWithEvent && flushDownloadWithEvent(event);\n } else {\n flushDownload && flushDownload();\n }\n } catch (err) {\n setTimeout(() => {\n throw err;\n });\n }\n\n // A final progress callback can cancel the request synchronously.\n if (!request) {\n return;\n }\n\n // Prepare the response\n const responseHeaders = AxiosHeaders.from(\n 'getAllResponseHeaders' in request && request.getAllResponseHeaders()\n );\n const responseData =\n !responseType || responseType === 'text' || responseType === 'json'\n ? request.responseText\n : request.response;\n const response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config,\n request,\n };\n\n settle(\n function _resolve(value) {\n resolve(value);\n done();\n },\n function _reject(err) {\n reject(err);\n done();\n },\n response\n );\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (\n request.status === 0 &&\n !(request.responseURL && request.responseURL.startsWith('file:'))\n ) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));\n done();\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError(event) {\n // Browsers deliver a ProgressEvent in XHR onerror\n // (message may be empty; when present, surface it)\n // See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event\n const msg = event && event.message ? event.message : 'Network Error';\n const err = new AxiosError(msg, AxiosError.ERR_NETWORK, config, request);\n // attach the underlying event for consumers who want details\n err.event = event || null;\n reject(err);\n done();\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n let timeoutErrorMessage = _config.timeout\n ? 'timeout of ' + _config.timeout + 'ms exceeded'\n : 'timeout exceeded';\n const transitional = _config.transitional || transitionalDefaults;\n if (_config.timeoutErrorMessage) {\n timeoutErrorMessage = _config.timeoutErrorMessage;\n }\n reject(\n new AxiosError(\n timeoutErrorMessage,\n transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,\n config,\n request\n )\n );\n done();\n\n // Clean up request\n request = null;\n };\n\n // Remove Content-Type if data is undefined\n requestData === undefined && requestHeaders.setContentType(null);\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(toByteStringHeaderObject(requestHeaders), function setRequestHeader(val, key) {\n request.setRequestHeader(key, val);\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(_config.withCredentials)) {\n request.withCredentials = !!_config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = _config.responseType;\n }\n\n // Handle progress if needed\n if (onDownloadProgress) {\n [downloadThrottled, flushDownload, flushDownloadWithEvent] = progressEventReducer(\n onDownloadProgress,\n true\n );\n request.addEventListener('progress', downloadThrottled);\n }\n\n // Not all browsers support upload events\n if (onUploadProgress && request.upload) {\n [uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress);\n\n request.upload.addEventListener('progress', uploadThrottled);\n\n request.upload.addEventListener('loadend', flushUpload);\n }\n\n if (_config.cancelToken || _config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = (cancel) => {\n if (!request) {\n return;\n }\n reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);\n request.abort();\n done();\n request = null;\n };\n\n _config.cancelToken && _config.cancelToken.subscribe(onCanceled);\n if (_config.signal) {\n _config.signal.aborted\n ? onCanceled()\n : _config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n const protocol = parseProtocol(_config.url);\n\n if (protocol && !platform.protocols.includes(protocol)) {\n reject(\n new AxiosError(\n 'Unsupported protocol ' + protocol + ':',\n AxiosError.ERR_BAD_REQUEST,\n config\n )\n );\n done();\n return;\n }\n\n // Send the request\n request.send(requestData || null);\n });\n };\n", "import CanceledError from '../cancel/CanceledError.js';\nimport AxiosError from '../core/AxiosError.js';\nimport utils from '../utils.js';\n\nconst composeSignals = (signals, timeout) => {\n signals = signals ? signals.filter(Boolean) : [];\n\n if (!timeout && !signals.length) {\n return;\n }\n\n const controller = new AbortController();\n\n let aborted = false;\n\n const onabort = function (reason) {\n if (!aborted) {\n aborted = true;\n unsubscribe();\n const err = reason instanceof Error ? reason : this.reason;\n controller.abort(\n err instanceof AxiosError\n ? err\n : new CanceledError(err instanceof Error ? err.message : err)\n );\n }\n };\n\n let timer =\n timeout &&\n setTimeout(() => {\n timer = null;\n onabort(new AxiosError(`timeout of ${timeout}ms exceeded`, AxiosError.ETIMEDOUT));\n }, timeout);\n\n const unsubscribe = () => {\n if (!signals) { return; }\n timer && clearTimeout(timer);\n timer = null;\n signals.forEach((signal) => {\n signal.unsubscribe\n ? signal.unsubscribe(onabort)\n : signal.removeEventListener('abort', onabort);\n });\n signals = null;\n };\n\n signals.forEach((signal) => {\n if (aborted) {\n return;\n }\n\n if (signal.aborted) {\n onabort.call(signal);\n return;\n }\n\n signal.addEventListener('abort', onabort, { once: true });\n });\n\n const { signal } = controller;\n\n signal.unsubscribe = () => utils.asap(unsubscribe);\n\n return signal;\n};\n\nexport default composeSignals;\n", "export const streamChunk = function* (chunk, chunkSize) {\n let len = chunk.byteLength;\n\n if (!chunkSize || len < chunkSize) {\n yield chunk;\n return;\n }\n\n let pos = 0;\n let end;\n\n while (pos < len) {\n end = pos + chunkSize;\n yield chunk.slice(pos, end);\n pos = end;\n }\n};\n\nexport const readBytes = async function* (iterable, chunkSize) {\n for await (const chunk of readStream(iterable)) {\n yield* streamChunk(chunk, chunkSize);\n }\n};\n\nconst readStream = async function* (stream) {\n if (stream[Symbol.asyncIterator]) {\n yield* stream;\n return;\n }\n\n const reader = stream.getReader();\n try {\n for (;;) {\n const { done, value } = await reader.read();\n if (done) {\n break;\n }\n yield value;\n }\n } finally {\n await reader.cancel();\n }\n};\n\nexport const trackStream = (stream, chunkSize, onProgress, onFinish) => {\n const iterator = readBytes(stream, chunkSize);\n\n let bytes = 0;\n let done;\n let _onFinish = (e) => {\n if (!done) {\n done = true;\n onFinish && onFinish(e);\n }\n };\n\n return new ReadableStream(\n {\n async pull(controller) {\n try {\n const { done, value } = await iterator.next();\n\n if (done) {\n _onFinish();\n controller.close();\n return;\n }\n\n let len = value.byteLength;\n if (onProgress) {\n let loadedBytes = (bytes += len);\n onProgress(loadedBytes);\n }\n controller.enqueue(new Uint8Array(value));\n } catch (err) {\n _onFinish(err);\n throw err;\n }\n },\n cancel(reason) {\n _onFinish(reason);\n return iterator.return();\n },\n },\n {\n highWaterMark: 2,\n }\n );\n};\n", "/**\n * Estimate data: URL byte lengths *without* allocating large buffers.\n * - Fetch percent-decodes a base64 body before decoding it.\n * - Node's Buffer.from(body, 'base64') sizes its backing allocation from the\n * raw body, including ignored characters and content after padding.\n * - Non-base64 data is percent-decoded and then encoded as UTF-8.\n */\nconst isHexDigit = (charCode) =>\n (charCode >= 48 && charCode <= 57) ||\n (charCode >= 65 && charCode <= 70) ||\n (charCode >= 97 && charCode <= 102);\n\nconst isPercentEncodedByte = (str, i, len) =>\n i + 2 < len && isHexDigit(str.charCodeAt(i + 1)) && isHexDigit(str.charCodeAt(i + 2));\n\nconst hexValue = (charCode) => (charCode <= 57 ? charCode - 48 : (charCode & 0xdf) - 55);\n\nconst isBase64Char = (charCode) =>\n (charCode >= 65 && charCode <= 90) || // A-Z\n (charCode >= 97 && charCode <= 122) || // a-z\n (charCode >= 48 && charCode <= 57) || // 0-9\n charCode === 43 || // +\n charCode === 47 || // /\n charCode === 45 || // - (base64url)\n charCode === 95; // _ (base64url)\n\nconst isBase64Whitespace = (charCode) =>\n charCode === 9 || charCode === 10 || charCode === 12 || charCode === 13 || charCode === 32;\n\nconst base64Bytes = (significant) => {\n const groups = Math.floor(significant / 4);\n const remainder = significant % 4;\n return groups * 3 + (remainder === 2 ? 1 : remainder === 3 ? 2 : 0);\n};\n\n// Buffer.byteLength(body, 'base64') uses the raw string length as an allocation\n// upper bound even when Buffer.from later ignores characters or stops at '='.\nconst estimateBase64BufferAllocation = (body) => {\n const len = body.length;\n let padding = 0;\n\n if (len > 0 && body.charCodeAt(len - 1) === 61 /* '=' */) {\n padding++;\n\n if (len > 1 && body.charCodeAt(len - 2) === 61 /* '=' */) {\n padding++;\n }\n }\n\n return Math.floor(((len - padding) * 3) / 4);\n};\n\nconst estimatePercentDecodedBase64Bytes = (body) => {\n const len = body.length;\n let significant = 0;\n let padding = 0;\n let invalid = false;\n\n for (let i = 0; i < len; i++) {\n let code = body.charCodeAt(i);\n\n if (code === 37 /* '%' */ && isPercentEncodedByte(body, i, len)) {\n code = hexValue(body.charCodeAt(i + 1)) * 16 + hexValue(body.charCodeAt(i + 2));\n i += 2;\n }\n\n if (isBase64Whitespace(code)) {\n continue;\n }\n\n if (code === 61 /* '=' */) {\n padding++;\n continue;\n }\n\n if (!isBase64Char(code) || padding > 0) {\n invalid = true;\n continue;\n }\n\n significant++;\n }\n\n // Fetch rejects malformed forgiving-base64 input. Returning the raw-size\n // allocation bound keeps that invalid input from becoming a pre-check bypass.\n if (\n invalid ||\n padding > 2 ||\n (padding > 0 && (significant + padding) % 4 !== 0) ||\n significant % 4 === 1\n ) {\n return estimateBase64BufferAllocation(body);\n }\n\n return base64Bytes(significant);\n};\n\nconst estimateDataURLBytes = (url, estimateBase64) => {\n if (!url || typeof url !== 'string') return 0;\n if (!url.startsWith('data:')) return 0;\n\n const comma = url.indexOf(',');\n if (comma < 0) return 0;\n\n const meta = url.slice(5, comma);\n const body = url.slice(comma + 1);\n const isBase64 = /;base64/i.test(meta);\n\n if (isBase64) {\n return estimateBase64(body);\n }\n\n // Compute UTF-8 byte length directly from UTF-16 code units without allocating\n // a byte buffer (TextEncoder.encode would defeat the DoS guard on large bodies).\n // Valid %XX triplets count as one decoded byte; this matches the bytes that\n // decodeURIComponent(body) would produce before Buffer re-encodes the string.\n let bytes = 0;\n for (let i = 0, len = body.length; i < len; i++) {\n const c = body.charCodeAt(i);\n if (c === 37 /* '%' */ && isPercentEncodedByte(body, i, len)) {\n bytes += 1;\n i += 2;\n } else if (c < 0x80) {\n bytes += 1;\n } else if (c < 0x800) {\n bytes += 2;\n } else if (c >= 0xd800 && c <= 0xdbff && i + 1 < len) {\n const next = body.charCodeAt(i + 1);\n if (next >= 0xdc00 && next <= 0xdfff) {\n bytes += 4;\n i++;\n } else {\n bytes += 3;\n }\n } else {\n bytes += 3;\n }\n }\n return bytes;\n};\n\n/**\n * Estimate the percent-decoded payload size used by Fetch data: URLs.\n *\n * @param {string} url\n * @returns {number}\n */\nexport default function estimateDataURLDecodedBytes(url) {\n // Fetch removes URL fragments before processing a data: URL.\n const fragmentIndex = typeof url === 'string' ? url.indexOf('#') : -1;\n\n return estimateDataURLBytes(\n fragmentIndex === -1 ? url : url.slice(0, fragmentIndex),\n estimatePercentDecodedBase64Bytes\n );\n}\n\n/**\n * Estimate the Buffer backing allocation used by Node's raw base64 decoder.\n *\n * @param {string} url\n * @returns {number}\n */\nexport function estimateDataURLBufferAllocation(url) {\n return estimateDataURLBytes(url, estimateBase64BufferAllocation);\n}\n", "export const VERSION = \"1.20.0\";", "import platform from '../platform/index.js';\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\nimport composeSignals from '../helpers/composeSignals.js';\nimport { trackStream } from '../helpers/trackStream.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport {\n progressEventReducer,\n progressEventDecorator,\n asyncDecorator,\n} from '../helpers/progressEventReducer.js';\nimport resolveConfig from '../helpers/resolveConfig.js';\nimport settle from '../core/settle.js';\nimport estimateDataURLDecodedBytes from '../helpers/estimateDataURLDecodedBytes.js';\nimport { VERSION } from '../env/data.js';\nimport { toByteStringHeaderObject } from '../helpers/sanitizeHeaderValue.js';\n\nconst DEFAULT_CHUNK_SIZE = 64 * 1024;\n\nconst DEFAULT_REQUEST_OPTIONS = {\n cache: 'default',\n redirect: 'follow',\n referrer: 'about:client',\n referrerPolicy: '',\n mode: 'cors',\n integrity: '',\n keepalive: false,\n priority: 'auto',\n window: null,\n};\n\nconst { isFunction } = utils;\n\n/**\n * Encode a UTF-8 string to a Latin-1 byte string for use with btoa().\n * This is a modern replacement for the deprecated unescape(encodeURIComponent(str)) pattern.\n *\n * @param {string} str The string to encode\n *\n * @returns {string} UTF-8 bytes as a Latin-1 string\n */\nconst encodeUTF8 = (str) =>\n encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, (_, hex) =>\n String.fromCharCode(parseInt(hex, 16))\n );\n\n// Node's WHATWG URL parser returns `username` and `password` percent-encoded.\n// Decode before composing the `auth` option so credentials such as\n// `my%40email.com:pass` are sent as `my@email.com:pass`. Falls back to the\n// original value for malformed input so a bad encoding never throws.\nconst decodeURIComponentSafe = (value) => {\n if (!utils.isString(value)) {\n return value;\n }\n\n try {\n return decodeURIComponent(value);\n } catch (error) {\n return value;\n }\n};\n\nconst test = (fn, ...args) => {\n try {\n return !!fn(...args);\n } catch (e) {\n return false;\n }\n};\n\nconst maybeWithAuthCredentials = (url) => {\n const protocolIndex = url.indexOf('://');\n let urlToCheck = url;\n if (protocolIndex !== -1) {\n urlToCheck = urlToCheck.slice(protocolIndex + 3);\n }\n return urlToCheck.includes('@') || urlToCheck.includes(':');\n};\n\nconst factory = (env) => {\n const globalObject =\n utils.global !== undefined && utils.global !== null ? utils.global : globalThis;\n const { ReadableStream, TextEncoder } = globalObject;\n\n env = utils.merge.call(\n {\n skipUndefined: true,\n },\n {\n Request: globalObject.Request,\n Response: globalObject.Response,\n },\n env\n );\n\n const { fetch: envFetch, Request, Response } = env;\n const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === 'function';\n const isRequestSupported = isFunction(Request);\n const isResponseSupported = isFunction(Response);\n\n if (!isFetchSupported) {\n return false;\n }\n\n const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream);\n\n const encodeText =\n isFetchSupported &&\n (typeof TextEncoder === 'function'\n ? (\n (encoder) => (str) =>\n encoder.encode(str)\n )(new TextEncoder())\n : async (str) => new Uint8Array(await new Request(str).arrayBuffer()));\n\n const supportsRequestStream =\n isRequestSupported &&\n isReadableStreamSupported &&\n test(() => {\n let duplexAccessed = false;\n\n const request = new Request(platform.origin, {\n body: new ReadableStream(),\n method: 'POST',\n get duplex() {\n duplexAccessed = true;\n return 'half';\n },\n });\n\n const hasContentType = request.headers.has('Content-Type');\n\n if (request.body != null) {\n request.body.cancel();\n }\n\n return duplexAccessed && !hasContentType;\n });\n\n const supportsResponseStream =\n isResponseSupported &&\n isReadableStreamSupported &&\n test(() => utils.isReadableStream(new Response('').body));\n\n const resolvers = {\n stream: supportsResponseStream && ((res) => res.body),\n };\n\n isFetchSupported &&\n (() => {\n ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach((type) => {\n !resolvers[type] &&\n (resolvers[type] = (res, config) => {\n let method = res && res[type];\n\n if (method) {\n return method.call(res);\n }\n\n throw new AxiosError(\n `Response type '${type}' is not supported`,\n AxiosError.ERR_NOT_SUPPORT,\n config\n );\n });\n });\n })();\n\n const getBodyLength = async (body) => {\n if (body == null) {\n return 0;\n }\n\n if (utils.isBlob(body)) {\n return body.size;\n }\n\n if (utils.isSpecCompliantForm(body)) {\n const _request = new Request(platform.origin, {\n method: 'POST',\n body,\n });\n return (await _request.arrayBuffer()).byteLength;\n }\n\n if (utils.isArrayBufferView(body) || utils.isArrayBuffer(body)) {\n return body.byteLength;\n }\n\n if (utils.isURLSearchParams(body)) {\n body = body + '';\n }\n\n if (utils.isString(body)) {\n return (await encodeText(body)).byteLength;\n }\n };\n\n const resolveBodyLength = async (headers, body) => {\n const length = utils.toFiniteNumber(headers.getContentLength());\n\n return length == null ? getBodyLength(body) : length;\n };\n\n return async (config) => {\n let {\n url,\n method,\n data,\n signal,\n cancelToken,\n timeout,\n onDownloadProgress,\n onUploadProgress,\n responseType,\n headers,\n withCredentials = 'same-origin',\n fetchOptions,\n maxContentLength,\n maxBodyLength,\n maxRedirects,\n } = resolveConfig(config);\n\n const hasMaxContentLength = utils.isNumber(maxContentLength) && maxContentLength > -1;\n const hasMaxBodyLength = utils.isNumber(maxBodyLength) && maxBodyLength > -1;\n const own = (key) => (utils.hasOwnProp(config, key) ? config[key] : undefined);\n\n let _fetch = envFetch || fetch;\n\n responseType = responseType ? (responseType + '').toLowerCase() : 'text';\n\n let composedSignal = composeSignals(\n [signal, cancelToken && cancelToken.toAbortSignal()],\n timeout\n );\n\n let request = null;\n\n const unsubscribe =\n composedSignal &&\n composedSignal.unsubscribe &&\n (() => {\n composedSignal.unsubscribe();\n });\n\n let requestContentLength;\n\n // AxiosError we raise while the request body is being streamed. Captured\n // by identity so the catch block can surface it directly, regardless of\n // how the runtime wraps the resulting fetch rejection (undici exposes it\n // as `err.cause`; some browsers drop the original error entirely).\n let pendingBodyError = null;\n\n const maxBodyLengthError = () =>\n new AxiosError(\n 'Request body larger than maxBodyLength limit',\n AxiosError.ERR_BAD_REQUEST,\n config,\n request\n );\n\n try {\n // HTTP basic authentication\n let auth = undefined;\n const configAuth = own('auth');\n\n if (configAuth) {\n const username = utils.getSafeProp(configAuth, 'username') || '';\n const password = utils.getSafeProp(configAuth, 'password') || '';\n auth = {\n username,\n password,\n };\n }\n\n if (maybeWithAuthCredentials(url)) {\n const parsedURL = new URL(url, platform.origin);\n\n if (!auth && (parsedURL.username || parsedURL.password)) {\n const urlUsername = decodeURIComponentSafe(parsedURL.username);\n const urlPassword = decodeURIComponentSafe(parsedURL.password);\n auth = {\n username: urlUsername,\n password: urlPassword,\n };\n }\n\n if (parsedURL.username || parsedURL.password) {\n parsedURL.username = '';\n parsedURL.password = '';\n url = parsedURL.href;\n }\n }\n\n if (auth) {\n headers.delete('authorization');\n headers.set(\n 'Authorization',\n 'Basic ' + btoa(encodeUTF8((auth.username || '') + ':' + (auth.password || '')))\n );\n }\n\n // Enforce maxContentLength for data: URLs up-front so we never materialize\n // an oversized payload. The HTTP adapter applies the same check (see http.js\n // \"if (protocol === 'data:')\" branch).\n if (hasMaxContentLength && typeof url === 'string' && url.startsWith('data:')) {\n const estimated = estimateDataURLDecodedBytes(url);\n if (estimated > maxContentLength) {\n throw new AxiosError(\n 'maxContentLength size of ' + maxContentLength + ' exceeded',\n AxiosError.ERR_BAD_RESPONSE,\n config,\n request\n );\n }\n }\n\n // Enforce maxBodyLength against known-size bodies before dispatch using\n // the body's *actual* size — never a caller-declared Content-Length,\n // which could under-report to slip an oversized body past the check.\n // Unknown-size streams return undefined here and are counted per-chunk\n // below as fetch consumes them.\n if (hasMaxBodyLength && method !== 'get' && method !== 'head') {\n const outboundLength = await getBodyLength(data);\n if (typeof outboundLength === 'number' && isFinite(outboundLength)) {\n requestContentLength = outboundLength;\n if (outboundLength > maxBodyLength) {\n throw maxBodyLengthError();\n }\n }\n }\n\n // A streamed body under maxBodyLength must be counted as fetch consumes\n // it; its size is never trusted from a caller-declared Content-Length.\n const mustEnforceStreamBody =\n hasMaxBodyLength && (utils.isReadableStream(data) || utils.isStream(data));\n\n const trackRequestStream = (stream, onProgress, flush) =>\n trackStream(\n stream,\n DEFAULT_CHUNK_SIZE,\n (loadedBytes) => {\n if (hasMaxBodyLength && loadedBytes > maxBodyLength) {\n throw (pendingBodyError = maxBodyLengthError());\n }\n onProgress && onProgress(loadedBytes);\n },\n flush\n );\n\n if (\n supportsRequestStream &&\n method !== 'get' &&\n method !== 'head' &&\n (onUploadProgress || mustEnforceStreamBody)\n ) {\n requestContentLength =\n requestContentLength == null\n ? await resolveBodyLength(headers, data)\n : requestContentLength;\n\n // A declared length of 0 is only trusted to skip the wrap when we are\n // not enforcing a stream limit (which must not rely on that header).\n if (requestContentLength !== 0 || mustEnforceStreamBody) {\n let _request = new Request(url, {\n method: 'POST',\n body: data,\n duplex: 'half',\n });\n\n let contentTypeHeader;\n\n if (\n utils.isFormData(data) &&\n (contentTypeHeader = _request.headers.get('content-type'))\n ) {\n headers.setContentType(contentTypeHeader);\n }\n\n if (_request.body) {\n const [onProgress, flush] =\n (onUploadProgress &&\n progressEventDecorator(\n requestContentLength,\n progressEventReducer(asyncDecorator(onUploadProgress))\n )) ||\n [];\n\n data = trackRequestStream(_request.body, onProgress, flush);\n }\n }\n } else if (\n mustEnforceStreamBody &&\n !isRequestSupported &&\n isReadableStreamSupported &&\n method !== 'get' &&\n method !== 'head'\n ) {\n data = trackRequestStream(data);\n } else if (\n mustEnforceStreamBody &&\n isRequestSupported &&\n !supportsRequestStream &&\n method !== 'get' &&\n method !== 'head'\n ) {\n throw new AxiosError(\n 'Stream request bodies are not supported by the current fetch implementation',\n AxiosError.ERR_NOT_SUPPORT,\n config,\n request\n );\n }\n\n if (!utils.isString(withCredentials)) {\n withCredentials = withCredentials ? 'include' : 'omit';\n }\n\n // Cloudflare Workers throws when credentials are defined\n // see https://github.com/cloudflare/workerd/issues/902\n const isCredentialsSupported = isRequestSupported && 'credentials' in Request.prototype;\n\n // If data is FormData and Content-Type is multipart/form-data without boundary,\n // delete it so fetch can set it correctly with the boundary\n if (utils.isFormData(data)) {\n const contentType = headers.getContentType();\n if (\n contentType &&\n /^multipart\\/form-data/i.test(contentType) &&\n !/boundary=/i.test(contentType)\n ) {\n headers.delete('content-type');\n }\n }\n\n // Set User-Agent header if not already set (fetch defaults to 'node' in Node.js)\n headers.set('User-Agent', 'axios/' + VERSION, false);\n\n const safeFetchOptions =\n fetchOptions == null ? fetchOptions : Object.assign(Object.create(null), fetchOptions);\n\n if (safeFetchOptions) {\n // These options are owned by Axios and are already reflected in the\n // resolved Request passed to fetch.\n delete safeFetchOptions.body;\n delete safeFetchOptions.headers;\n delete safeFetchOptions.method;\n delete safeFetchOptions.signal;\n delete safeFetchOptions.duplex;\n delete safeFetchOptions.credentials;\n }\n\n const resolvedOptions = Object.assign(Object.create(null), safeFetchOptions, {\n signal: composedSignal,\n method: method.toUpperCase(),\n headers: toByteStringHeaderObject(headers.normalize()),\n body: data,\n duplex: 'half',\n credentials: isCredentialsSupported ? withCredentials : undefined,\n });\n\n if (isRequestSupported) {\n utils.forEach(DEFAULT_REQUEST_OPTIONS, (value, key) => {\n if (resolvedOptions[key] === undefined) {\n resolvedOptions[key] = value;\n }\n });\n\n if (resolvedOptions.signal === undefined) {\n resolvedOptions.signal = null;\n }\n\n if (resolvedOptions.body === undefined) {\n resolvedOptions.body = null;\n }\n }\n\n if (maxRedirects === 0) {\n resolvedOptions.redirect = 'manual';\n\n if (safeFetchOptions) {\n safeFetchOptions.redirect = 'manual';\n }\n }\n\n request = isRequestSupported && new Request(url, resolvedOptions);\n\n let response = await (isRequestSupported\n ? _fetch(request, safeFetchOptions)\n : _fetch(url, resolvedOptions));\n\n const responseHeaders = AxiosHeaders.from(response.headers);\n\n // Cheap pre-check: if the server honestly declares a content-length that\n // already exceeds the cap, reject before we start streaming.\n if (hasMaxContentLength) {\n const declaredLength = utils.toFiniteNumber(responseHeaders.getContentLength());\n if (declaredLength != null && declaredLength > maxContentLength) {\n throw new AxiosError(\n 'maxContentLength size of ' + maxContentLength + ' exceeded',\n AxiosError.ERR_BAD_RESPONSE,\n config,\n request\n );\n }\n }\n\n const isStreamResponse =\n supportsResponseStream && (responseType === 'stream' || responseType === 'response');\n\n if (\n supportsResponseStream &&\n response.body &&\n (onDownloadProgress || hasMaxContentLength || (isStreamResponse && unsubscribe))\n ) {\n const options = {};\n\n ['status', 'statusText', 'headers'].forEach((prop) => {\n options[prop] = response[prop];\n });\n\n const responseContentLength = utils.toFiniteNumber(responseHeaders.getContentLength());\n\n const [onProgress, flush] =\n (onDownloadProgress &&\n progressEventDecorator(\n responseContentLength,\n progressEventReducer(asyncDecorator(onDownloadProgress), true)\n )) ||\n [];\n\n let bytesRead = 0;\n const onChunkProgress = (loadedBytes) => {\n if (hasMaxContentLength) {\n bytesRead = loadedBytes;\n if (bytesRead > maxContentLength) {\n throw new AxiosError(\n 'maxContentLength size of ' + maxContentLength + ' exceeded',\n AxiosError.ERR_BAD_RESPONSE,\n config,\n request\n );\n }\n }\n onProgress && onProgress(loadedBytes);\n };\n\n response = new Response(\n trackStream(response.body, DEFAULT_CHUNK_SIZE, onChunkProgress, () => {\n flush && flush();\n unsubscribe && unsubscribe();\n }),\n options\n );\n }\n\n responseType = responseType || 'text';\n\n let responseData = await resolvers[utils.findKey(resolvers, responseType) || 'text'](\n response,\n config\n );\n\n // Fallback enforcement for environments without ReadableStream support\n // (legacy runtimes). Detect materialized size from typed output; skip\n // streams/Response passthrough since the user will read those themselves.\n if (hasMaxContentLength && !supportsResponseStream && !isStreamResponse) {\n let materializedSize;\n if (responseData != null) {\n if (typeof responseData.byteLength === 'number') {\n materializedSize = responseData.byteLength;\n } else if (typeof responseData.size === 'number') {\n materializedSize = responseData.size;\n } else if (typeof responseData === 'string') {\n materializedSize =\n typeof TextEncoder === 'function'\n ? new TextEncoder().encode(responseData).byteLength\n : responseData.length;\n }\n }\n if (typeof materializedSize === 'number' && materializedSize > maxContentLength) {\n throw new AxiosError(\n 'maxContentLength size of ' + maxContentLength + ' exceeded',\n AxiosError.ERR_BAD_RESPONSE,\n config,\n request\n );\n }\n }\n\n !isStreamResponse && unsubscribe && unsubscribe();\n\n return await new Promise((resolve, reject) => {\n settle(resolve, reject, {\n data: responseData,\n headers: AxiosHeaders.from(response.headers),\n status: response.status,\n statusText: response.statusText,\n config,\n request,\n });\n });\n } catch (err) {\n unsubscribe && unsubscribe();\n\n // Safari can surface fetch aborts as a DOMException-like object whose\n // branded getters throw. Prefer our composed signal reason before reading\n // the caught error, preserving timeout vs cancellation semantics.\n if (composedSignal && composedSignal.aborted && composedSignal.reason instanceof AxiosError) {\n const canceledError = composedSignal.reason;\n canceledError.config = config;\n request && (canceledError.request = request);\n if (err !== canceledError) {\n // Non-enumerable to match native Error `cause` semantics so loggers\n // don't recurse into circular fetch internals (see #7205).\n Object.defineProperty(canceledError, 'cause', {\n __proto__: null,\n value: err,\n writable: true,\n enumerable: false,\n configurable: true,\n });\n }\n throw canceledError;\n }\n\n // Surface a maxBodyLength violation we raised while the request body was\n // being streamed. Matching by identity (rather than reading\n // `err.cause.isAxiosError`) keeps the error deterministic across runtimes\n // and avoids both prototype-pollution reads and mis-attributing a foreign\n // AxiosError that merely happened to land in `err.cause`.\n if (pendingBodyError) {\n request && !pendingBodyError.request && (pendingBodyError.request = request);\n throw pendingBodyError;\n }\n\n // Re-throw AxiosErrors we raised synchronously (data: URL / content-length\n // pre-checks, response size enforcement) without re-wrapping them.\n if (err instanceof AxiosError) {\n request && !err.request && (err.request = request);\n throw err;\n }\n\n if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {\n const networkError = new AxiosError(\n 'Network Error',\n AxiosError.ERR_NETWORK,\n config,\n request,\n err && err.response\n );\n // Non-enumerable to match native Error `cause` semantics so loggers\n // don't recurse into circular fetch internals (see #7205).\n Object.defineProperty(networkError, 'cause', {\n __proto__: null,\n value: err.cause || err,\n writable: true,\n enumerable: false,\n configurable: true,\n });\n throw networkError;\n }\n\n throw AxiosError.from(err, err && err.code, config, request, err && err.response);\n }\n };\n};\n\nconst seedCache = new Map();\n\nexport const getFetch = (config) => {\n let env = (config && config.env) || {};\n const { fetch, Request, Response } = env;\n const seeds = [Request, Response, fetch];\n\n let len = seeds.length,\n i = len,\n seed,\n target,\n map = seedCache;\n\n while (i--) {\n seed = seeds[i];\n target = map.get(seed);\n\n target === undefined && map.set(seed, (target = i ? new Map() : factory(env)));\n\n map = target;\n }\n\n return target;\n};\n\nconst adapter = getFetch();\n\nexport default adapter;\n", "import utils from '../utils.js';\nimport httpAdapter from './http.js';\nimport xhrAdapter from './xhr.js';\nimport * as fetchAdapter from './fetch.js';\nimport AxiosError from '../core/AxiosError.js';\n\n/**\n * Known adapters mapping.\n * Provides environment-specific adapters for Axios:\n * - `http` for Node.js\n * - `xhr` for browsers\n * - `fetch` for fetch API-based requests\n *\n * @type {Object}\n */\nconst knownAdapters = {\n http: httpAdapter,\n xhr: xhrAdapter,\n fetch: {\n get: fetchAdapter.getFetch,\n },\n};\n\n// Assign adapter names for easier debugging and identification\nutils.forEach(knownAdapters, (fn, value) => {\n if (fn) {\n try {\n // Null-proto descriptors so a polluted Object.prototype.get cannot turn\n // these data descriptors into accessor descriptors on the way in.\n Object.defineProperty(fn, 'name', { __proto__: null, value });\n } catch (e) {\n // eslint-disable-next-line no-empty\n }\n Object.defineProperty(fn, 'adapterName', { __proto__: null, value });\n }\n});\n\n/**\n * Render a rejection reason string for unknown or unsupported adapters\n *\n * @param {string} reason\n * @returns {string}\n */\nconst renderReason = (reason) => `- ${reason}`;\n\n/**\n * Check if the adapter is resolved (function, null, or false)\n *\n * @param {Function|null|false} adapter\n * @returns {boolean}\n */\nconst isResolvedHandle = (adapter) =>\n utils.isFunction(adapter) || adapter === null || adapter === false;\n\n/**\n * Get the first suitable adapter from the provided list.\n * Tries each adapter in order until a supported one is found.\n * Throws an AxiosError if no adapter is suitable.\n *\n * @param {Array|string|Function} adapters - Adapter(s) by name or function.\n * @param {Object} config - Axios request configuration\n * @throws {AxiosError} If no suitable adapter is available\n * @returns {Function} The resolved adapter function\n */\nfunction getAdapter(adapters, config) {\n adapters = utils.isArray(adapters) ? adapters : [adapters];\n\n const { length } = adapters;\n let nameOrAdapter;\n let adapter;\n\n const rejectedReasons = {};\n\n for (let i = 0; i < length; i++) {\n nameOrAdapter = adapters[i];\n let id;\n\n adapter = nameOrAdapter;\n\n if (!isResolvedHandle(nameOrAdapter)) {\n adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];\n\n if (adapter === undefined) {\n throw new AxiosError(`Unknown adapter '${id}'`);\n }\n }\n\n if (adapter && (utils.isFunction(adapter) || (adapter = adapter.get(config)))) {\n break;\n }\n\n rejectedReasons[id || '#' + i] = adapter;\n }\n\n if (!adapter) {\n const reasons = Object.entries(rejectedReasons).map(\n ([id, state]) =>\n `adapter ${id} ` +\n (state === false ? 'is not supported by the environment' : 'is not available in the build')\n );\n\n let s = length\n ? reasons.length > 1\n ? 'since :\\n' + reasons.map(renderReason).join('\\n')\n : ' ' + renderReason(reasons[0])\n : 'as no adapter specified';\n\n throw new AxiosError(\n `There is no suitable adapter to dispatch the request ` + s,\n AxiosError.ERR_NOT_SUPPORT\n );\n }\n\n return adapter;\n}\n\n/**\n * Exports Axios adapters and utility to resolve an adapter\n */\nexport default {\n /**\n * Resolve an adapter from a list of adapter names or functions.\n * @type {Function}\n */\n getAdapter,\n\n /**\n * Exposes all known adapters\n * @type {Object}\n */\n adapters: knownAdapters,\n};\n", "'use strict';\n\nimport transformData from './transformData.js';\nimport isCancel from '../cancel/isCancel.js';\nimport defaults from '../defaults/index.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport adapters from '../adapters/adapters.js';\nimport utils from '../utils.js';\n\n/**\n * Throws a `CanceledError` if cancellation has been requested.\n *\n * @param {Object} config The config that is to be used for the request\n *\n * @returns {void}\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new CanceledError(null, config);\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n *\n * @returns {Promise} The Promise to be fulfilled\n */\nexport default function dispatchRequest(_config) {\n // Interceptors may replace the merged config with an ordinary object. Flatten\n // it at the dispatch boundary so shared prototype members cannot become\n // request behavior, while preserving intentional template/class members.\n const config = utils.toSafeFlatObject(_config);\n\n throwIfCancellationRequested(config);\n\n config.headers = AxiosHeaders.from(utils.getSafeProp(config, 'headers'));\n\n // Transform request data\n config.data = transformData.call(config, config.transformRequest);\n\n if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {\n config.headers.setContentType('application/x-www-form-urlencoded', false);\n }\n\n const adapter = adapters.getAdapter(config.adapter || defaults.adapter, config);\n\n return adapter(config).then(\n function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Expose the current response on config so that transformResponse can\n // attach it to any AxiosError it throws (e.g. on JSON parse failure).\n // We clean it up afterwards to avoid polluting the config object.\n config.response = response;\n try {\n response.data = transformData.call(config, config.transformResponse, response);\n } finally {\n delete config.response;\n }\n\n response.headers = AxiosHeaders.from(response.headers);\n\n return response;\n },\n function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n config.response = reason.response;\n try {\n reason.response.data = transformData.call(\n config,\n config.transformResponse,\n reason.response\n );\n } finally {\n delete config.response;\n }\n reason.response.headers = AxiosHeaders.from(reason.response.headers);\n }\n }\n\n return Promise.reject(reason);\n }\n );\n}\n", "'use strict';\n\nimport { VERSION } from '../env/data.js';\nimport AxiosError from '../core/AxiosError.js';\n\nconst validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nconst deprecatedWarnings = {};\n\n/**\n * Transitional option validator\n *\n * @param {function|boolean?} validator - set to false if the transitional option has been removed\n * @param {string?} version - deprecated version / removed since version\n * @param {string?} message - some message with additional info\n *\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n function formatMessage(opt, desc) {\n return (\n '[Axios v' +\n VERSION +\n \"] Transitional option '\" +\n opt +\n \"'\" +\n desc +\n (message ? '. ' + message : '')\n );\n }\n\n // eslint-disable-next-line func-names\n return (value, opt, opts) => {\n if (validator === false) {\n throw new AxiosError(\n formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),\n AxiosError.ERR_DEPRECATED\n );\n }\n\n if (version && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\nvalidators.spelling = function spelling(correctSpelling) {\n return (value, opt) => {\n // eslint-disable-next-line no-console\n console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);\n return true;\n };\n};\n\n/**\n * Assert object's properties type\n *\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n *\n * @returns {object}\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object' || options === null) {\n throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);\n }\n const keys = Object.keys(options);\n let i = keys.length;\n while (i-- > 0) {\n const opt = keys[i];\n // Use hasOwnProperty so a polluted Object.prototype. cannot supply\n // a non-function validator and cause a TypeError.\n const validator = Object.prototype.hasOwnProperty.call(schema, opt) ? schema[opt] : undefined;\n if (validator) {\n const value = options[opt];\n const result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new AxiosError(\n 'option ' + opt + ' must be ' + result,\n AxiosError.ERR_BAD_OPTION_VALUE\n );\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);\n }\n }\n}\n\nexport default {\n assertOptions,\n validators,\n};\n", "'use strict';\n\nimport utils from '../utils.js';\nimport buildURL from '../helpers/buildURL.js';\nimport InterceptorManager from './InterceptorManager.js';\nimport dispatchRequest from './dispatchRequest.js';\nimport mergeConfig from './mergeConfig.js';\nimport buildFullPath from './buildFullPath.js';\nimport methodList from './methodList.js';\nimport validator from '../helpers/validator.js';\nimport AxiosHeaders from './AxiosHeaders.js';\nimport transitionalDefaults from '../defaults/transitional.js';\n\nconst validators = validator.validators;\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n *\n * @return {Axios} A new instance of Axios\n */\nclass Axios {\n constructor(instanceConfig) {\n this.defaults = instanceConfig || {};\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager(),\n };\n }\n\n /**\n * Dispatch a request\n *\n * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)\n * @param {?Object} config\n *\n * @returns {Promise} The Promise to be fulfilled\n */\n async request(configOrUrl, config) {\n try {\n return await this._request(configOrUrl, config);\n } catch (err) {\n if (err instanceof Error) {\n try {\n let dummy = {};\n\n Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error());\n\n const dummyStack = dummy.stack;\n let stack = '';\n\n // slice off the Error: ... line\n if (typeof dummyStack === 'string') {\n const firstNewlineIndex = dummyStack.indexOf('\\n');\n\n stack = firstNewlineIndex === -1 ? '' : dummyStack.slice(firstNewlineIndex + 1);\n }\n\n if (!err.stack) {\n err.stack = stack;\n // match without the 2 top stack lines\n } else if (stack) {\n const firstNewlineIndex = stack.indexOf('\\n');\n const secondNewlineIndex =\n firstNewlineIndex === -1 ? -1 : stack.indexOf('\\n', firstNewlineIndex + 1);\n const stackWithoutTwoTopLines =\n secondNewlineIndex === -1 ? '' : stack.slice(secondNewlineIndex + 1);\n\n if (!String(err.stack).endsWith(stackWithoutTwoTopLines)) {\n err.stack += '\\n' + stack;\n }\n }\n } catch (e) {\n // Ignore failures from custom stack hooks or un-writable stack properties.\n }\n }\n\n throw err;\n }\n }\n\n _request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n const { transitional, paramsSerializer, headers } = config;\n\n if (transitional !== undefined) {\n validator.assertOptions(\n transitional,\n {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean),\n legacyInterceptorReqResOrdering: validators.transitional(validators.boolean),\n advertiseZstdAcceptEncoding: validators.transitional(validators.boolean),\n validateStatusUndefinedResolves: validators.transitional(validators.boolean),\n },\n false\n );\n }\n\n if (paramsSerializer != null) {\n if (utils.isFunction(paramsSerializer)) {\n config.paramsSerializer = {\n serialize: paramsSerializer,\n };\n } else {\n validator.assertOptions(\n paramsSerializer,\n {\n encode: validators.function,\n serialize: validators.function,\n },\n true\n );\n }\n }\n\n // Set config.allowAbsoluteUrls\n if (config.allowAbsoluteUrls !== undefined) {\n // do nothing\n } else if (this.defaults.allowAbsoluteUrls !== undefined) {\n config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;\n } else {\n config.allowAbsoluteUrls = true;\n }\n\n validator.assertOptions(\n config,\n {\n baseUrl: validators.spelling('baseURL'),\n withXsrfToken: validators.spelling('withXSRFToken'),\n },\n true\n );\n\n // Set config.method\n config.method = (\n utils.getSafeProp(config, 'method') ||\n utils.getSafeProp(this.defaults, 'method') ||\n 'get'\n ).toLowerCase();\n\n // Flatten headers\n let contextHeaders = headers && utils.merge(headers.common, headers[config.method]);\n\n headers &&\n utils.forEach(methodList.concat('common'), (method) => {\n delete headers[method];\n });\n\n config.headers = AxiosHeaders.concat(contextHeaders, headers);\n\n // filter out skipped interceptors\n const requestInterceptorChain = [];\n let synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n const transitional = config.transitional || transitionalDefaults;\n const legacyInterceptorReqResOrdering =\n transitional && transitional.legacyInterceptorReqResOrdering;\n\n if (legacyInterceptorReqResOrdering) {\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n } else {\n requestInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n }\n });\n\n const responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n let promise;\n let i = 0;\n let len;\n\n if (!synchronousRequestInterceptors) {\n const chain = [dispatchRequest.bind(this), undefined];\n chain.unshift(...requestInterceptorChain);\n chain.push(...responseInterceptorChain);\n len = chain.length;\n\n promise = Promise.resolve(config);\n\n while (i < len) {\n promise = promise.then(chain[i++], chain[i++]);\n }\n\n return promise;\n }\n\n len = requestInterceptorChain.length;\n\n let newConfig = config;\n\n while (i < len) {\n const onFulfilled = requestInterceptorChain[i++];\n const onRejected = requestInterceptorChain[i++];\n try {\n newConfig = onFulfilled ? onFulfilled(newConfig) : newConfig;\n } catch (error) {\n if (!onRejected) {\n promise = Promise.reject(error);\n break;\n }\n\n try {\n const rejectedResult = onRejected.call(this, error);\n\n if (utils.isThenable(rejectedResult)) {\n promise = Promise.resolve(rejectedResult).then(() =>\n dispatchRequest.call(this, newConfig)\n );\n }\n } catch (rejectedError) {\n promise = Promise.reject(rejectedError);\n }\n\n break;\n }\n }\n\n if (!promise) {\n try {\n promise = dispatchRequest.call(this, newConfig);\n } catch (error) {\n promise = Promise.reject(error);\n }\n }\n\n i = 0;\n len = responseInterceptorChain.length;\n\n while (i < len) {\n promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);\n }\n\n return promise;\n }\n\n getUri(config) {\n config = mergeConfig(this.defaults, config);\n const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls, config);\n return buildURL(fullPath, config.params, config.paramsSerializer);\n }\n}\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function (url, config) {\n return this.request(\n mergeConfig(config || {}, {\n method,\n url,\n data: config && utils.hasOwnProp(config, 'data') ? config.data : undefined,\n })\n );\n };\n});\n\nutils.forEach(['post', 'put', 'patch', 'query'], function forEachMethodWithData(method) {\n function generateHTTPMethod(isForm) {\n return function httpMethod(url, data, config) {\n return this.request(\n mergeConfig(config || {}, {\n method,\n headers: isForm\n ? {\n 'Content-Type': 'multipart/form-data',\n }\n : {},\n url,\n data,\n })\n );\n };\n }\n\n Axios.prototype[method] = generateHTTPMethod();\n\n // QUERY is a safe/idempotent read method; multipart form bodies don't fit\n // its semantics, so no queryForm shorthand is generated.\n if (method !== 'query') {\n Axios.prototype[method + 'Form'] = generateHTTPMethod(true);\n }\n});\n\nexport default Axios;\n", "'use strict';\n\nimport CanceledError from './CanceledError.js';\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @param {Function} executor The executor function.\n *\n * @returns {CancelToken}\n */\nclass CancelToken {\n constructor(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n let resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n const token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then((cancel) => {\n if (!token._listeners) return;\n\n let i = token._listeners.length;\n\n while (i-- > 0) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = (onfulfilled) => {\n let _resolve;\n // eslint-disable-next-line func-names\n const promise = new Promise((resolve) => {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message, config, request) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new CanceledError(message, config, request);\n resolvePromise(token.reason);\n });\n }\n\n /**\n * Throws a `CanceledError` if cancellation has been requested.\n */\n throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n }\n\n /**\n * Subscribe to the cancel signal\n */\n\n subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n }\n\n /**\n * Unsubscribe from the cancel signal\n */\n\n unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n const index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n }\n\n toAbortSignal() {\n const controller = new AbortController();\n\n const abort = (err) => {\n controller.abort(err);\n };\n\n this.subscribe(abort);\n\n controller.signal.unsubscribe = () => this.unsubscribe(abort);\n\n return controller.signal;\n }\n\n /**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\n static source() {\n let cancel;\n const token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token,\n cancel,\n };\n }\n}\n\nexport default CancelToken;\n", "'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * const args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n *\n * @returns {Function}\n */\nexport default function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n}\n", "'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n *\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nexport default function isAxiosError(payload) {\n return utils.isObject(payload) && payload.isAxiosError === true;\n}\n", "const HttpStatusCode = {\n Continue: 100,\n SwitchingProtocols: 101,\n Processing: 102,\n EarlyHints: 103,\n Ok: 200,\n Created: 201,\n Accepted: 202,\n NonAuthoritativeInformation: 203,\n NoContent: 204,\n ResetContent: 205,\n PartialContent: 206,\n MultiStatus: 207,\n AlreadyReported: 208,\n ImUsed: 226,\n MultipleChoices: 300,\n MovedPermanently: 301,\n Found: 302,\n SeeOther: 303,\n NotModified: 304,\n UseProxy: 305,\n Unused: 306,\n TemporaryRedirect: 307,\n PermanentRedirect: 308,\n BadRequest: 400,\n Unauthorized: 401,\n PaymentRequired: 402,\n Forbidden: 403,\n NotFound: 404,\n MethodNotAllowed: 405,\n NotAcceptable: 406,\n ProxyAuthenticationRequired: 407,\n RequestTimeout: 408,\n Conflict: 409,\n Gone: 410,\n LengthRequired: 411,\n PreconditionFailed: 412,\n /**\n * @deprecated Use `ContentTooLarge` instead.\n */\n PayloadTooLarge: 413,\n ContentTooLarge: 413,\n UriTooLong: 414,\n UnsupportedMediaType: 415,\n RangeNotSatisfiable: 416,\n ExpectationFailed: 417,\n ImATeapot: 418,\n MisdirectedRequest: 421,\n /**\n * @deprecated Use `UnprocessableContent` instead.\n */\n UnprocessableEntity: 422,\n UnprocessableContent: 422,\n Locked: 423,\n FailedDependency: 424,\n TooEarly: 425,\n UpgradeRequired: 426,\n PreconditionRequired: 428,\n TooManyRequests: 429,\n RequestHeaderFieldsTooLarge: 431,\n UnavailableForLegalReasons: 451,\n InternalServerError: 500,\n NotImplemented: 501,\n BadGateway: 502,\n ServiceUnavailable: 503,\n GatewayTimeout: 504,\n HttpVersionNotSupported: 505,\n VariantAlsoNegotiates: 506,\n InsufficientStorage: 507,\n LoopDetected: 508,\n NotExtended: 510,\n NetworkAuthenticationRequired: 511,\n WebServerReturnsAnUnknownError: 520,\n WebServerIsDown: 521,\n ConnectionTimedOut: 522,\n OriginIsUnreachable: 523,\n TimeoutOccurred: 524,\n SslHandshakeFailed: 525,\n InvalidSslCertificate: 526,\n};\n\nObject.entries(HttpStatusCode).forEach(([key, value]) => {\n if (HttpStatusCode[value] === undefined) {\n HttpStatusCode[value] = key;\n }\n});\n\nexport default HttpStatusCode;\n", "'use strict';\n\nimport utils from './utils.js';\nimport bind from './helpers/bind.js';\nimport Axios from './core/Axios.js';\nimport mergeConfig from './core/mergeConfig.js';\nimport defaults from './defaults/index.js';\nimport formDataToJSON from './helpers/formDataToJSON.js';\nimport CanceledError from './cancel/CanceledError.js';\nimport CancelToken from './cancel/CancelToken.js';\nimport isCancel from './cancel/isCancel.js';\nimport { VERSION } from './env/data.js';\nimport toFormData from './helpers/toFormData.js';\nimport AxiosError from './core/AxiosError.js';\nimport spread from './helpers/spread.js';\nimport isAxiosError from './helpers/isAxiosError.js';\nimport AxiosHeaders from './core/AxiosHeaders.js';\nimport adapters from './adapters/adapters.js';\nimport HttpStatusCode from './helpers/HttpStatusCode.js';\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n *\n * @returns {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n const context = new Axios(defaultConfig);\n const instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context, { allOwnKeys: true });\n\n // Copy context to instance\n utils.extend(instance, context, null, { allOwnKeys: true });\n\n // Factory for creating new instances\n instance.create = function create(instanceConfig) {\n return createInstance(mergeConfig(defaultConfig, instanceConfig));\n };\n\n return instance;\n}\n\n// Create the default instance to be exported\nconst axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Expose Cancel & CancelToken\naxios.CanceledError = CanceledError;\naxios.CancelToken = CancelToken;\naxios.isCancel = isCancel;\naxios.VERSION = VERSION;\naxios.toFormData = toFormData;\n\n// Expose AxiosError class\naxios.AxiosError = AxiosError;\n\n// alias for CanceledError for backward compatibility\naxios.Cancel = axios.CanceledError;\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\n\naxios.spread = spread;\n\n// Expose isAxiosError\naxios.isAxiosError = isAxiosError;\n\n// Expose mergeConfig\naxios.mergeConfig = mergeConfig;\n\naxios.AxiosHeaders = AxiosHeaders;\n\naxios.formToJSON = (thing) => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);\n\naxios.getAdapter = adapters.getAdapter;\n\naxios.HttpStatusCode = HttpStatusCode;\n\naxios.default = axios;\n\n// this module should only have a default export\nexport default axios;\n", "import axios from './lib/axios.js';\n\n// This module is intended to unwrap Axios default export as named.\n// Keep top-level export same with static properties\n// so that it can keep same with es module or cjs\nconst {\n Axios,\n AxiosError,\n CanceledError,\n isCancel,\n CancelToken,\n VERSION,\n all,\n Cancel,\n isAxiosError,\n spread,\n toFormData,\n AxiosHeaders,\n HttpStatusCode,\n formToJSON,\n getAdapter,\n mergeConfig,\n create,\n} = axios;\n\nexport {\n axios as default,\n create,\n Axios,\n AxiosError,\n CanceledError,\n isCancel,\n CancelToken,\n VERSION,\n all,\n Cancel,\n isAxiosError,\n spread,\n toFormData,\n AxiosHeaders,\n HttpStatusCode,\n formToJSON,\n getAdapter,\n mergeConfig,\n};\n"], + "mappings": ";;;;;AASe,SAAR,KAAsB,IAA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AAGhB,IAAO,gBAAQ;;;ACnFf,IAAM;AAAA,EACJ,OAAAC;AAAA,EACA,YAAAC;AAAA,EACA,eAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC;AAAA,EACA,SAAAC;AAAA,EACA,KAAAC;AAAA,EACA;AAAA,EACA,cAAAC;AAAA,EACA,QAAAC;AAAA,EACA,YAAAC;AAAA,EACA,cAAAC;AAAA,EACA,gBAAAC;AAAA,EACA;AAAA,EACA,YAAAC;AAAA,EACA,aAAAC;AAAA,EACA;AACF,IAAI;", + "names": ["hasOwnProperty", "prototype", "filter", "filter", "self", "prototype", "prototype", "toString", "encode", "$internals", "stringifySafely", "isFormData", "isFileList", "transitional", "validateStatus", "origin", "merge", "own", "transitional", "signal", "iterator", "done", "isFunction", "encodeUTF8", "ReadableStream", "own", "fetch", "adapter", "adapter", "validators", "transitional", "create", "Axios", "AxiosError", "CanceledError", "isCancel", "CancelToken", "VERSION", "all", "isAxiosError", "spread", "toFormData", "AxiosHeaders", "HttpStatusCode", "getAdapter", "mergeConfig"] +} diff --git a/frontend/node_modules/.vite/deps/chunk-GKNS7JV4.js b/frontend/node_modules/.vite/deps/chunk-GKNS7JV4.js new file mode 100644 index 0000000..2e7a37c --- /dev/null +++ b/frontend/node_modules/.vite/deps/chunk-GKNS7JV4.js @@ -0,0 +1,13339 @@ +// node_modules/@vue/shared/dist/shared.esm-bundler.js +function makeMap(str) { + const map2 = /* @__PURE__ */ Object.create(null); + for (const key of str.split(",")) map2[key] = 1; + return (val) => val in map2; +} +var EMPTY_OBJ = true ? Object.freeze({}) : {}; +var EMPTY_ARR = true ? Object.freeze([]) : []; +var NOOP = () => { +}; +var NO = () => false; +var isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter +(key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97); +var isModelListener = (key) => key.startsWith("onUpdate:"); +var extend = Object.assign; +var remove = (arr, el) => { + const i = arr.indexOf(el); + if (i > -1) { + arr.splice(i, 1); + } +}; +var hasOwnProperty = Object.prototype.hasOwnProperty; +var hasOwn = (val, key) => hasOwnProperty.call(val, key); +var isArray = Array.isArray; +var isMap = (val) => toTypeString(val) === "[object Map]"; +var isSet = (val) => toTypeString(val) === "[object Set]"; +var isDate = (val) => toTypeString(val) === "[object Date]"; +var isRegExp = (val) => toTypeString(val) === "[object RegExp]"; +var isFunction = (val) => typeof val === "function"; +var isString = (val) => typeof val === "string"; +var isSymbol = (val) => typeof val === "symbol"; +var isObject = (val) => val !== null && typeof val === "object"; +var isPromise = (val) => { + return (isObject(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch); +}; +var objectToString = Object.prototype.toString; +var toTypeString = (value) => objectToString.call(value); +var toRawType = (value) => { + return toTypeString(value).slice(8, -1); +}; +var isPlainObject = (val) => toTypeString(val) === "[object Object]"; +var isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key; +var isReservedProp = makeMap( + // the leading comma is intentional so empty string "" is also included + ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted" +); +var isBuiltInDirective = makeMap( + "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo" +); +var cacheStringFunction = (fn) => { + const cache = /* @__PURE__ */ Object.create(null); + return (str) => { + const hit = cache[str]; + return hit || (cache[str] = fn(str)); + }; +}; +var camelizeRE = /-\w/g; +var camelize = cacheStringFunction( + (str) => { + return str.replace(camelizeRE, (c) => c.slice(1).toUpperCase()); + } +); +var hyphenateRE = /\B([A-Z])/g; +var hyphenate = cacheStringFunction( + (str) => str.replace(hyphenateRE, "-$1").toLowerCase() +); +var capitalize = cacheStringFunction((str) => { + return str.charAt(0).toUpperCase() + str.slice(1); +}); +var toHandlerKey = cacheStringFunction( + (str) => { + const s = str ? `on${capitalize(str)}` : ``; + return s; + } +); +var hasChanged = (value, oldValue) => !Object.is(value, oldValue); +var invokeArrayFns = (fns, ...arg) => { + for (let i = 0; i < fns.length; i++) { + fns[i](...arg); + } +}; +var def = (obj, key, value, writable = false) => { + Object.defineProperty(obj, key, { + configurable: true, + enumerable: false, + writable, + value + }); +}; +var looseToNumber = (val) => { + const n = parseFloat(val); + return isNaN(n) ? val : n; +}; +var toNumber = (val) => { + const n = isString(val) ? Number(val) : NaN; + return isNaN(n) ? val : n; +}; +var _globalThis; +var getGlobalThis = () => { + return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {}); +}; +var GLOBALS_ALLOWED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol"; +var isGloballyAllowed = makeMap(GLOBALS_ALLOWED); +function normalizeStyle(value) { + if (isArray(value)) { + const res = {}; + for (let i = 0; i < value.length; i++) { + const item = value[i]; + const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item); + if (normalized) { + for (const key in normalized) { + res[key] = normalized[key]; + } + } + } + return res; + } else if (isString(value) || isObject(value)) { + return value; + } +} +var listDelimiterRE = /;(?![^(]*\))/g; +var propertyDelimiterRE = /:([^]+)/; +var styleCommentRE = /"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g; +function parseStringStyle(cssText) { + const ret = {}; + cssText.replace(styleCommentRE, (match) => match.startsWith("/*") ? "" : match).split(listDelimiterRE).forEach((item) => { + if (item) { + const tmp = item.split(propertyDelimiterRE); + tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim()); + } + }); + return ret; +} +function stringifyStyle(styles) { + if (!styles) return ""; + if (isString(styles)) return styles; + let ret = ""; + for (const key in styles) { + const value = styles[key]; + if (isString(value) || typeof value === "number") { + const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key); + ret += `${normalizedKey}:${value};`; + } + } + return ret; +} +function normalizeClass(value) { + let res = ""; + if (isString(value)) { + res = value; + } else if (isArray(value)) { + for (let i = 0; i < value.length; i++) { + const normalized = normalizeClass(value[i]); + if (normalized) { + res += normalized + " "; + } + } + } else if (isObject(value)) { + for (const name in value) { + if (value[name]) { + res += name + " "; + } + } + } + return res.trim(); +} +function normalizeProps(props) { + if (!props) return null; + let { class: klass, style } = props; + if (klass && !isString(klass)) { + props.class = normalizeClass(klass); + } + if (style) { + props.style = normalizeStyle(style); + } + return props; +} +var HTML_TAGS = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot"; +var SVG_TAGS = "svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view"; +var MATH_TAGS = "annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics"; +var VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr"; +var isHTMLTag = makeMap(HTML_TAGS); +var isSVGTag = makeMap(SVG_TAGS); +var isMathMLTag = makeMap(MATH_TAGS); +var isVoidTag = makeMap(VOID_TAGS); +var specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`; +var isSpecialBooleanAttr = makeMap(specialBooleanAttrs); +var isBooleanAttr = makeMap( + specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected` +); +function includeBooleanAttr(value) { + return !!value || value === ""; +} +var isKnownHtmlAttr = makeMap( + `accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap` +); +var isKnownSvgAttr = makeMap( + `xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan` +); +var isKnownMathMLAttr = makeMap( + `accent,accentunder,actiontype,align,alignmentscope,altimg,altimg-height,altimg-valign,altimg-width,alttext,bevelled,close,columnsalign,columnlines,columnspan,denomalign,depth,dir,display,displaystyle,encoding,equalcolumns,equalrows,fence,fontstyle,fontweight,form,frame,framespacing,groupalign,height,href,id,indentalign,indentalignfirst,indentalignlast,indentshift,indentshiftfirst,indentshiftlast,indextype,justify,largetop,largeop,lquote,lspace,mathbackground,mathcolor,mathsize,mathvariant,maxsize,minlabelspacing,mode,other,overflow,position,rowalign,rowlines,rowspan,rquote,rspace,scriptlevel,scriptminsize,scriptsizemultiplier,selection,separator,separators,shift,side,src,stackalign,stretchy,subscriptshift,superscriptshift,symmetric,voffset,width,widths,xlink:href,xlink:show,xlink:type,xmlns` +); +function isRenderableAttrValue(value) { + if (value == null) { + return false; + } + const type = typeof value; + return type === "string" || type === "number" || type === "boolean"; +} +var cssVarNameEscapeSymbolsRE = /[ !"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g; +function getEscapedCssVarName(key, doubleEscape) { + return key.replace( + cssVarNameEscapeSymbolsRE, + (s) => doubleEscape ? s === '"' ? '\\\\\\"' : `\\\\${s}` : `\\${s}` + ); +} +function looseCompareArrays(a, b, seen) { + if (a.length !== b.length) return false; + let equal = true; + for (let i = 0; equal && i < a.length; i++) { + equal = looseEqual(a[i], b[i], seen); + } + return equal; +} +function looseCompareCollections(a, b, seen) { + if (a.size !== b.size) return false; + const candidates = Array.from(b); + const matched = new Uint8Array(candidates.length); + for (const item of a) { + let index = -1; + for (let i = 0; i < candidates.length; i++) { + if (!matched[i] && looseEqual(item, candidates[i], seen)) { + index = i; + break; + } + } + if (index < 0) return false; + matched[index] = 1; + } + return true; +} +function looseCompareObjects(a, b, seen) { + let aValidType = isMap(a); + let bValidType = isMap(b); + if (aValidType || bValidType) { + return aValidType && bValidType ? looseCompareCollections(a, b, seen) : false; + } + aValidType = isSet(a); + bValidType = isSet(b); + if (aValidType || bValidType) { + return aValidType && bValidType ? looseCompareCollections(a, b, seen) : false; + } + const aKeysCount = Object.keys(a).length; + const bKeysCount = Object.keys(b).length; + if (aKeysCount !== bKeysCount) { + return false; + } + for (const key in a) { + const aHasKey = a.hasOwnProperty(key); + const bHasKey = b.hasOwnProperty(key); + if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key], seen)) { + return false; + } + } + return String(a) === String(b); +} +function looseCompareNested(a, b, seen, compare) { + if (!seen) { + seen = [/* @__PURE__ */ new Map(), /* @__PURE__ */ new Map()]; + } + const [seenA, seenB] = seen; + if (seenA.has(a) || seenB.has(b)) { + return seenA.get(a) === b && seenB.get(b) === a; + } + seenA.set(a, b); + seenB.set(b, a); + const equal = compare(a, b, seen); + seenA.delete(a); + seenB.delete(b); + return equal; +} +function looseEqual(a, b, seen) { + if (a === b) return true; + let aValidType = isDate(a); + let bValidType = isDate(b); + if (aValidType || bValidType) { + return aValidType && bValidType ? a.getTime() === b.getTime() : false; + } + aValidType = isSymbol(a); + bValidType = isSymbol(b); + if (aValidType || bValidType) { + return a === b; + } + aValidType = isArray(a); + bValidType = isArray(b); + if (aValidType || bValidType) { + return aValidType && bValidType ? looseCompareNested(a, b, seen, looseCompareArrays) : false; + } + aValidType = isObject(a); + bValidType = isObject(b); + if (aValidType || bValidType) { + if (!aValidType || !bValidType) { + return false; + } + return looseCompareNested(a, b, seen, looseCompareObjects); + } + return String(a) === String(b); +} +function looseIndexOf(arr, val) { + return arr.findIndex((item) => looseEqual(item, val)); +} +var isRef = (val) => { + return !!(val && val["__v_isRef"] === true); +}; +var toDisplayString = (val) => { + return isString(val) ? val : val == null ? "" : isArray(val) || isObject(val) && (val.toString === objectToString || !isFunction(val.toString)) ? isRef(val) ? toDisplayString(val.value) : JSON.stringify(val, replacer, 2) : String(val); +}; +var replacer = (_key, val) => { + if (isRef(val)) { + return replacer(_key, val.value); + } else if (isMap(val)) { + return { + [`Map(${val.size})`]: [...val.entries()].reduce( + (entries, [key, val2], i) => { + entries[stringifySymbol(key, i) + " =>"] = val2; + return entries; + }, + {} + ) + }; + } else if (isSet(val)) { + return { + [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v)) + }; + } else if (isSymbol(val)) { + return stringifySymbol(val); + } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) { + return String(val); + } + return val; +}; +var stringifySymbol = (v, i = "") => { + var _a; + return ( + // Symbol.description in es2019+ so we need to cast here to pass + // the lib: es2016 check + isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v + ); +}; +function normalizeCssVarValue(value) { + if (value == null) { + return "initial"; + } + if (typeof value === "string") { + return value === "" ? " " : value; + } + if (typeof value !== "number" || !Number.isFinite(value)) { + if (true) { + console.warn( + "[Vue warn] Invalid value used for CSS binding. Expected a string or a finite number but received:", + value + ); + } + } + return String(value); +} + +// node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js +function warn(msg, ...args) { + console.warn(`[Vue warn] ${msg}`, ...args); +} +var activeEffectScope; +var EffectScope = class { + // TODO isolatedDeclarations "__v_skip" + constructor(detached = false) { + this.detached = detached; + this._active = true; + this._on = 0; + this.effects = []; + this.cleanups = []; + this._isPaused = false; + this._warnOnRun = true; + this.__v_skip = true; + if (!detached && activeEffectScope) { + if (activeEffectScope.active) { + this.parent = activeEffectScope; + this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push( + this + ) - 1; + } else { + this._active = false; + this._warnOnRun = false; + } + } + } + get active() { + return this._active; + } + pause() { + if (this._active) { + this._isPaused = true; + let i, l; + if (this.scopes) { + const scopes = this.scopes.slice(); + for (i = 0, l = scopes.length; i < l; i++) { + scopes[i].pause(); + } + } + for (i = 0, l = this.effects.length; i < l; i++) { + this.effects[i].pause(); + } + } + } + /** + * Resumes the effect scope, including all child scopes and effects. + */ + resume() { + if (this._active) { + if (this._isPaused) { + this._isPaused = false; + let i, l; + if (this.scopes) { + const scopes = this.scopes.slice(); + for (i = 0, l = scopes.length; i < l; i++) { + scopes[i].resume(); + } + } + const effects = this.effects.slice(); + for (i = 0, l = effects.length; i < l; i++) { + effects[i].resume(); + } + } + } + } + run(fn) { + if (this._active) { + const currentEffectScope = activeEffectScope; + try { + activeEffectScope = this; + return fn(); + } finally { + activeEffectScope = currentEffectScope; + } + } else if (this._warnOnRun) { + warn(`cannot run an inactive effect scope.`); + } + } + /** + * This should only be called on non-detached scopes + * @internal + */ + on() { + if (++this._on === 1) { + this.prevScope = activeEffectScope; + activeEffectScope = this; + } + } + /** + * This should only be called on non-detached scopes + * @internal + */ + off() { + if (this._on > 0 && --this._on === 0) { + if (activeEffectScope === this) { + activeEffectScope = this.prevScope; + } else { + let current = activeEffectScope; + while (current) { + if (current.prevScope === this) { + current.prevScope = this.prevScope; + break; + } + current = current.prevScope; + } + } + this.prevScope = void 0; + } + } + stop(fromParent) { + if (this._active) { + this._active = false; + let i, l; + for (i = 0, l = this.effects.length; i < l; i++) { + this.effects[i].stop(); + } + this.effects.length = 0; + for (i = 0, l = this.cleanups.length; i < l; i++) { + this.cleanups[i](); + } + this.cleanups.length = 0; + if (this.scopes) { + const scopes = this.scopes.slice(); + for (i = 0, l = scopes.length; i < l; i++) { + scopes[i].stop(true); + } + this.scopes.length = 0; + } + if (!this.detached && this.parent && !fromParent) { + const last = this.parent.scopes.pop(); + if (last && last !== this) { + this.parent.scopes[this.index] = last; + last.index = this.index; + } + } + this.parent = void 0; + } + } +}; +function effectScope(detached) { + return new EffectScope(detached); +} +function getCurrentScope() { + return activeEffectScope; +} +function onScopeDispose(fn, failSilently = false) { + if (activeEffectScope) { + activeEffectScope.cleanups.push(fn); + } else if (!failSilently) { + warn( + `onScopeDispose() is called when there is no active effect scope to be associated with.` + ); + } +} +var activeSub; +var pausedQueueEffects = /* @__PURE__ */ new WeakSet(); +var ReactiveEffect = class { + constructor(fn) { + this.fn = fn; + this.deps = void 0; + this.depsTail = void 0; + this.flags = 1 | 4; + this.next = void 0; + this.cleanup = void 0; + this.scheduler = void 0; + if (activeEffectScope) { + if (activeEffectScope.active) { + activeEffectScope.effects.push(this); + } else { + this.flags &= -2; + } + } + } + pause() { + this.flags |= 64; + } + resume() { + if (this.flags & 64) { + this.flags &= -65; + if (pausedQueueEffects.has(this)) { + pausedQueueEffects.delete(this); + this.trigger(); + } + } + } + /** + * @internal + */ + notify() { + if (this.flags & 2 && !(this.flags & 32)) { + return; + } + if (!(this.flags & 8)) { + batch(this); + } + } + run() { + if (!(this.flags & 1)) { + return this.fn(); + } + this.flags |= 2; + cleanupEffect(this); + prepareDeps(this); + const prevEffect = activeSub; + const prevShouldTrack = shouldTrack; + activeSub = this; + shouldTrack = true; + try { + return this.fn(); + } finally { + if (activeSub !== this) { + warn( + "Active effect was not restored correctly - this is likely a Vue internal bug." + ); + } + cleanupDeps(this); + activeSub = prevEffect; + shouldTrack = prevShouldTrack; + this.flags &= -3; + } + } + stop() { + if (this.flags & 1) { + for (let link = this.deps; link; link = link.nextDep) { + removeSub(link); + } + this.deps = this.depsTail = void 0; + cleanupEffect(this); + this.onStop && this.onStop(); + this.flags &= -2; + } + } + trigger() { + if (this.flags & 64) { + pausedQueueEffects.add(this); + } else if (this.scheduler) { + this.scheduler(); + } else { + this.runIfDirty(); + } + } + /** + * @internal + */ + runIfDirty() { + if (isDirty(this)) { + this.run(); + } + } + get dirty() { + return isDirty(this); + } +}; +var batchDepth = 0; +var batchedSub; +var batchedComputed; +function batch(sub, isComputed = false) { + sub.flags |= 8; + if (isComputed) { + sub.next = batchedComputed; + batchedComputed = sub; + return; + } + sub.next = batchedSub; + batchedSub = sub; +} +function startBatch() { + batchDepth++; +} +function endBatch() { + if (--batchDepth > 0) { + return; + } + if (batchedComputed) { + let e = batchedComputed; + batchedComputed = void 0; + while (e) { + const next = e.next; + e.next = void 0; + e.flags &= -9; + e = next; + } + } + let error; + while (batchedSub) { + let e = batchedSub; + batchedSub = void 0; + while (e) { + const next = e.next; + e.next = void 0; + e.flags &= -9; + if (e.flags & 1) { + try { + ; + e.trigger(); + } catch (err) { + if (!error) error = err; + } + } + e = next; + } + } + if (error) throw error; +} +function prepareDeps(sub) { + for (let link = sub.deps; link; link = link.nextDep) { + link.version = -1; + link.prevActiveLink = link.dep.activeLink; + link.dep.activeLink = link; + } +} +function cleanupDeps(sub) { + let head; + let tail = sub.depsTail; + let link = tail; + while (link) { + const prev = link.prevDep; + if (link.version === -1) { + if (link === tail) tail = prev; + removeSub(link); + removeDep(link); + } else { + head = link; + } + link.dep.activeLink = link.prevActiveLink; + link.prevActiveLink = void 0; + link = prev; + } + sub.deps = head; + sub.depsTail = tail; +} +function isDirty(sub) { + for (let link = sub.deps; link; link = link.nextDep) { + if (link.dep.version !== link.version || link.dep.computed && (refreshComputed(link.dep.computed) || link.dep.version !== link.version)) { + return true; + } + } + if (sub._dirty) { + return true; + } + return false; +} +function refreshComputed(computed3) { + if (computed3.flags & 4 && !(computed3.flags & 16)) { + return; + } + computed3.flags &= -17; + if (computed3.globalVersion === globalVersion) { + return; + } + computed3.globalVersion = globalVersion; + if (!computed3.isSSR && computed3.flags & 128 && (!computed3.deps && !computed3._dirty || !isDirty(computed3))) { + return; + } + computed3.flags |= 2; + const dep = computed3.dep; + const prevSub = activeSub; + const prevShouldTrack = shouldTrack; + activeSub = computed3; + shouldTrack = true; + try { + prepareDeps(computed3); + const value = computed3.fn(computed3._value); + if (dep.version === 0 || hasChanged(value, computed3._value)) { + computed3.flags |= 128; + computed3._value = value; + dep.version++; + } + } catch (err) { + dep.version++; + throw err; + } finally { + activeSub = prevSub; + shouldTrack = prevShouldTrack; + cleanupDeps(computed3); + computed3.flags &= -3; + } +} +function removeSub(link, soft = false) { + const { dep, prevSub, nextSub } = link; + if (prevSub) { + prevSub.nextSub = nextSub; + link.prevSub = void 0; + } + if (nextSub) { + nextSub.prevSub = prevSub; + link.nextSub = void 0; + } + if (dep.subsHead === link) { + dep.subsHead = nextSub; + } + if (dep.subs === link) { + dep.subs = prevSub; + if (!prevSub && dep.computed) { + dep.computed.flags &= -5; + for (let l = dep.computed.deps; l; l = l.nextDep) { + removeSub(l, true); + } + } + } + if (!soft && !--dep.sc && dep.map) { + dep.map.delete(dep.key); + } +} +function removeDep(link) { + const { prevDep, nextDep } = link; + if (prevDep) { + prevDep.nextDep = nextDep; + link.prevDep = void 0; + } + if (nextDep) { + nextDep.prevDep = prevDep; + link.nextDep = void 0; + } +} +function effect(fn, options) { + if (fn.effect instanceof ReactiveEffect) { + fn = fn.effect.fn; + } + const e = new ReactiveEffect(fn); + if (options) { + extend(e, options); + } + try { + e.run(); + } catch (err) { + e.stop(); + throw err; + } + const runner = e.run.bind(e); + runner.effect = e; + return runner; +} +function stop(runner) { + runner.effect.stop(); +} +var shouldTrack = true; +var trackStack = []; +function pauseTracking() { + trackStack.push(shouldTrack); + shouldTrack = false; +} +function resetTracking() { + const last = trackStack.pop(); + shouldTrack = last === void 0 ? true : last; +} +function cleanupEffect(e) { + const { cleanup } = e; + e.cleanup = void 0; + if (cleanup) { + const prevSub = activeSub; + activeSub = void 0; + try { + cleanup(); + } finally { + activeSub = prevSub; + } + } +} +var globalVersion = 0; +var Link = class { + constructor(sub, dep) { + this.sub = sub; + this.dep = dep; + this.version = dep.version; + this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0; + } +}; +var Dep = class { + // TODO isolatedDeclarations "__v_skip" + constructor(computed3) { + this.computed = computed3; + this.version = 0; + this.activeLink = void 0; + this.subs = void 0; + this.map = void 0; + this.key = void 0; + this.sc = 0; + this.__v_skip = true; + if (true) { + this.subsHead = void 0; + } + } + track(debugInfo) { + if (!activeSub || !shouldTrack || activeSub === this.computed) { + return; + } + let link = this.activeLink; + if (link === void 0 || link.sub !== activeSub) { + link = this.activeLink = new Link(activeSub, this); + if (!activeSub.deps) { + activeSub.deps = activeSub.depsTail = link; + } else { + link.prevDep = activeSub.depsTail; + activeSub.depsTail.nextDep = link; + activeSub.depsTail = link; + } + addSub(link); + } else if (link.version === -1) { + link.version = this.version; + if (link.nextDep) { + const next = link.nextDep; + next.prevDep = link.prevDep; + if (link.prevDep) { + link.prevDep.nextDep = next; + } + link.prevDep = activeSub.depsTail; + link.nextDep = void 0; + activeSub.depsTail.nextDep = link; + activeSub.depsTail = link; + if (activeSub.deps === link) { + activeSub.deps = next; + } + } + } + if (activeSub.onTrack) { + activeSub.onTrack( + extend( + { + effect: activeSub + }, + debugInfo + ) + ); + } + return link; + } + trigger(debugInfo) { + this.version++; + globalVersion++; + this.notify(debugInfo); + } + notify(debugInfo) { + startBatch(); + try { + if (true) { + for (let head = this.subsHead; head; head = head.nextSub) { + if (head.sub.onTrigger && !(head.sub.flags & 8)) { + head.sub.onTrigger( + extend( + { + effect: head.sub + }, + debugInfo + ) + ); + } + } + } + for (let link = this.subs; link; link = link.prevSub) { + if (link.sub.notify()) { + ; + link.sub.dep.notify(); + } + } + } finally { + endBatch(); + } + } +}; +function addSub(link) { + link.dep.sc++; + if (link.sub.flags & 4) { + const computed3 = link.dep.computed; + if (computed3 && !link.dep.subs) { + computed3.flags |= 4 | 16; + for (let l = computed3.deps; l; l = l.nextDep) { + addSub(l); + } + } + const currentTail = link.dep.subs; + if (currentTail !== link) { + link.prevSub = currentTail; + if (currentTail) currentTail.nextSub = link; + } + if (link.dep.subsHead === void 0) { + link.dep.subsHead = link; + } + link.dep.subs = link; + } +} +var targetMap = /* @__PURE__ */ new WeakMap(); +var ITERATE_KEY = Symbol( + true ? "Object iterate" : "" +); +var MAP_KEY_ITERATE_KEY = Symbol( + true ? "Map keys iterate" : "" +); +var ARRAY_ITERATE_KEY = Symbol( + true ? "Array iterate" : "" +); +function track(target, type, key) { + if (shouldTrack && activeSub) { + let depsMap = targetMap.get(target); + if (!depsMap) { + targetMap.set(target, depsMap = /* @__PURE__ */ new Map()); + } + let dep = depsMap.get(key); + if (!dep) { + depsMap.set(key, dep = new Dep()); + dep.map = depsMap; + dep.key = key; + } + if (true) { + dep.track({ + target, + type, + key + }); + } else { + dep.track(); + } + } +} +function trigger(target, type, key, newValue, oldValue, oldTarget) { + const depsMap = targetMap.get(target); + if (!depsMap) { + globalVersion++; + return; + } + const run = (dep) => { + if (dep) { + if (true) { + dep.trigger({ + target, + type, + key, + newValue, + oldValue, + oldTarget + }); + } else { + dep.trigger(); + } + } + }; + startBatch(); + if (type === "clear") { + depsMap.forEach(run); + } else { + const targetIsArray = isArray(target); + const isArrayIndex = targetIsArray && isIntegerKey(key); + if (targetIsArray && key === "length") { + const newLength = Number(newValue); + depsMap.forEach((dep, key2) => { + if (key2 === "length" || key2 === ARRAY_ITERATE_KEY || !isSymbol(key2) && key2 >= newLength) { + run(dep); + } + }); + } else { + if (key !== void 0 || depsMap.has(void 0)) { + run(depsMap.get(key)); + } + if (isArrayIndex) { + run(depsMap.get(ARRAY_ITERATE_KEY)); + } + switch (type) { + case "add": + if (!targetIsArray) { + run(depsMap.get(ITERATE_KEY)); + if (isMap(target)) { + run(depsMap.get(MAP_KEY_ITERATE_KEY)); + } + } else if (isArrayIndex) { + run(depsMap.get("length")); + } + break; + case "delete": + if (!targetIsArray) { + run(depsMap.get(ITERATE_KEY)); + if (isMap(target)) { + run(depsMap.get(MAP_KEY_ITERATE_KEY)); + } + } + break; + case "set": + if (isMap(target)) { + run(depsMap.get(ITERATE_KEY)); + } + break; + } + } + } + endBatch(); +} +function getDepFromReactive(object, key) { + const depMap = targetMap.get(object); + return depMap && depMap.get(key); +} +function reactiveReadArray(array) { + const raw = toRaw(array); + if (raw === array) return raw; + track(raw, "iterate", ARRAY_ITERATE_KEY); + if (isShallow(array)) return raw; + if (!isReadonly(array)) return raw.map(toReactive); + return isReactive(array) ? raw.map((item) => toReadonly(toReactive(item))) : raw.map(toReadonly); +} +function shallowReadArray(arr) { + track(arr = toRaw(arr), "iterate", ARRAY_ITERATE_KEY); + return arr; +} +function toWrapped(target, item) { + if (isReadonly(target)) { + return isReactive(target) ? toReadonly(toReactive(item)) : toReadonly(item); + } + return toReactive(item); +} +var arrayInstrumentations = { + __proto__: null, + [Symbol.iterator]() { + return iterator(this, Symbol.iterator, (item) => toWrapped(this, item)); + }, + concat(...args) { + return reactiveReadArray(this).concat( + ...args.map((x) => isArray(x) ? reactiveReadArray(x) : x) + ); + }, + entries() { + return iterator(this, "entries", (value) => { + value[1] = toWrapped(this, value[1]); + return value; + }); + }, + every(fn, thisArg) { + return apply(this, "every", fn, thisArg, void 0, arguments); + }, + filter(fn, thisArg) { + return apply( + this, + "filter", + fn, + thisArg, + (v) => v.map((item) => toWrapped(this, item)), + arguments + ); + }, + find(fn, thisArg) { + return apply( + this, + "find", + fn, + thisArg, + (item) => toWrapped(this, item), + arguments + ); + }, + findIndex(fn, thisArg) { + return apply(this, "findIndex", fn, thisArg, void 0, arguments); + }, + findLast(fn, thisArg) { + return apply( + this, + "findLast", + fn, + thisArg, + (item) => toWrapped(this, item), + arguments + ); + }, + findLastIndex(fn, thisArg) { + return apply(this, "findLastIndex", fn, thisArg, void 0, arguments); + }, + // flat, flatMap could benefit from ARRAY_ITERATE but are not straight-forward to implement + forEach(fn, thisArg) { + return apply(this, "forEach", fn, thisArg, void 0, arguments); + }, + includes(...args) { + return searchProxy(this, "includes", args); + }, + indexOf(...args) { + return searchProxy(this, "indexOf", args); + }, + join(separator) { + return reactiveReadArray(this).join(separator); + }, + // keys() iterator only reads `length`, no optimization required + lastIndexOf(...args) { + return searchProxy(this, "lastIndexOf", args); + }, + map(fn, thisArg) { + return apply(this, "map", fn, thisArg, void 0, arguments); + }, + pop() { + return noTracking(this, "pop"); + }, + push(...args) { + return noTracking(this, "push", args); + }, + reduce(fn, ...args) { + return reduce(this, "reduce", fn, args); + }, + reduceRight(fn, ...args) { + return reduce(this, "reduceRight", fn, args); + }, + shift() { + return noTracking(this, "shift"); + }, + // slice could use ARRAY_ITERATE but also seems to beg for range tracking + some(fn, thisArg) { + return apply(this, "some", fn, thisArg, void 0, arguments); + }, + splice(...args) { + return noTracking(this, "splice", args); + }, + toReversed() { + return reactiveReadArray(this).toReversed(); + }, + toSorted(comparer) { + return reactiveReadArray(this).toSorted(comparer); + }, + toSpliced(...args) { + return reactiveReadArray(this).toSpliced(...args); + }, + unshift(...args) { + return noTracking(this, "unshift", args); + }, + values() { + return iterator(this, "values", (item) => toWrapped(this, item)); + } +}; +function iterator(self2, method, wrapValue) { + const arr = shallowReadArray(self2); + const iter = arr[method](); + if (arr !== self2 && !isShallow(self2)) { + iter._next = iter.next; + iter.next = () => { + const result = iter._next(); + if (!result.done) { + result.value = wrapValue(result.value); + } + return result; + }; + } + return iter; +} +var arrayProto = Array.prototype; +function apply(self2, method, fn, thisArg, wrappedRetFn, args) { + const arr = shallowReadArray(self2); + const needsWrap = arr !== self2 && !isShallow(self2); + const methodFn = arr[method]; + if (methodFn !== arrayProto[method]) { + const result2 = methodFn.apply(self2, args); + return needsWrap ? toReactive(result2) : result2; + } + let wrappedFn = fn; + if (arr !== self2) { + if (needsWrap) { + wrappedFn = function(item, index) { + return fn.call(this, toWrapped(self2, item), index, self2); + }; + } else if (fn.length > 2) { + wrappedFn = function(item, index) { + return fn.call(this, item, index, self2); + }; + } + } + const result = methodFn.call(arr, wrappedFn, thisArg); + return needsWrap && wrappedRetFn ? wrappedRetFn(result) : result; +} +function reduce(self2, method, fn, args) { + const arr = shallowReadArray(self2); + const needsWrap = arr !== self2 && !isShallow(self2); + let wrappedFn = fn; + let wrapInitialAccumulator = false; + if (arr !== self2) { + if (needsWrap) { + wrapInitialAccumulator = args.length === 0; + wrappedFn = function(acc, item, index) { + if (wrapInitialAccumulator) { + wrapInitialAccumulator = false; + acc = toWrapped(self2, acc); + } + return fn.call(this, acc, toWrapped(self2, item), index, self2); + }; + } else if (fn.length > 3) { + wrappedFn = function(acc, item, index) { + return fn.call(this, acc, item, index, self2); + }; + } + } + const result = arr[method](wrappedFn, ...args); + return wrapInitialAccumulator ? toWrapped(self2, result) : result; +} +function searchProxy(self2, method, args) { + const arr = toRaw(self2); + track(arr, "iterate", ARRAY_ITERATE_KEY); + const res = arr[method](...args); + if ((res === -1 || res === false) && isProxy(args[0])) { + args[0] = toRaw(args[0]); + return arr[method](...args); + } + return res; +} +function noTracking(self2, method, args = []) { + pauseTracking(); + startBatch(); + const res = toRaw(self2)[method].apply(self2, args); + endBatch(); + resetTracking(); + return res; +} +var isNonTrackableKeys = makeMap(`__proto__,__v_isRef,__isVue`); +var builtInSymbols = new Set( + Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol) +); +function hasOwnProperty2(key) { + if (!isSymbol(key)) key = String(key); + const obj = toRaw(this); + track(obj, "has", key); + return obj.hasOwnProperty(key); +} +var BaseReactiveHandler = class { + constructor(_isReadonly = false, _isShallow = false) { + this._isReadonly = _isReadonly; + this._isShallow = _isShallow; + } + get(target, key, receiver) { + if (key === "__v_skip") return target["__v_skip"]; + const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow; + if (key === "__v_isReactive") { + return !isReadonly2; + } else if (key === "__v_isReadonly") { + return isReadonly2; + } else if (key === "__v_isShallow") { + return isShallow2; + } else if (key === "__v_raw") { + if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype + // this means the receiver is a user proxy of the reactive proxy + Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) { + return target; + } + return; + } + const targetIsArray = isArray(target); + if (!isReadonly2) { + let fn; + if (targetIsArray && (fn = arrayInstrumentations[key])) { + return fn; + } + if (key === "hasOwnProperty") { + return hasOwnProperty2; + } + } + const res = Reflect.get( + target, + key, + // if this is a proxy wrapping a ref, return methods using the raw ref + // as receiver so that we don't have to call `toRaw` on the ref in all + // its class methods + isRef2(target) ? target : receiver + ); + if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) { + return res; + } + if (!isReadonly2) { + track(target, "get", key); + } + if (isShallow2) { + return res; + } + if (isRef2(res)) { + const value = targetIsArray && isIntegerKey(key) ? res : res.value; + return isReadonly2 && isObject(value) ? readonly(value) : value; + } + if (isObject(res)) { + return isReadonly2 ? readonly(res) : reactive(res); + } + return res; + } +}; +var MutableReactiveHandler = class extends BaseReactiveHandler { + constructor(isShallow2 = false) { + super(false, isShallow2); + } + set(target, key, value, receiver) { + let oldValue = target[key]; + const isArrayWithIntegerKey = isArray(target) && isIntegerKey(key); + if (!this._isShallow) { + const isOldValueReadonly = isReadonly(oldValue); + if (!isShallow(value) && !isReadonly(value)) { + oldValue = toRaw(oldValue); + value = toRaw(value); + } + if (!isArrayWithIntegerKey && isRef2(oldValue) && !isRef2(value)) { + if (isOldValueReadonly) { + if (true) { + warn( + `Set operation on key "${String(key)}" failed: target is readonly.`, + target[key] + ); + } + return true; + } else { + oldValue.value = value; + return true; + } + } + } + const hadKey = isArrayWithIntegerKey ? Number(key) < target.length : hasOwn(target, key); + const result = Reflect.set( + target, + key, + value, + isRef2(target) ? target : receiver + ); + if (target === toRaw(receiver) && result) { + if (!hadKey) { + trigger(target, "add", key, value); + } else if (hasChanged(value, oldValue)) { + trigger(target, "set", key, value, oldValue); + } + } + return result; + } + deleteProperty(target, key) { + const hadKey = hasOwn(target, key); + const oldValue = target[key]; + const result = Reflect.deleteProperty(target, key); + if (result && hadKey) { + trigger(target, "delete", key, void 0, oldValue); + } + return result; + } + has(target, key) { + const result = Reflect.has(target, key); + if (!isSymbol(key) || !builtInSymbols.has(key)) { + track(target, "has", key); + } + return result; + } + ownKeys(target) { + track( + target, + "iterate", + isArray(target) ? "length" : ITERATE_KEY + ); + return Reflect.ownKeys(target); + } +}; +var ReadonlyReactiveHandler = class extends BaseReactiveHandler { + constructor(isShallow2 = false) { + super(true, isShallow2); + } + set(target, key) { + if (true) { + warn( + `Set operation on key "${String(key)}" failed: target is readonly.`, + target + ); + } + return true; + } + deleteProperty(target, key) { + if (true) { + warn( + `Delete operation on key "${String(key)}" failed: target is readonly.`, + target + ); + } + return true; + } +}; +var mutableHandlers = new MutableReactiveHandler(); +var readonlyHandlers = new ReadonlyReactiveHandler(); +var shallowReactiveHandlers = new MutableReactiveHandler(true); +var shallowReadonlyHandlers = new ReadonlyReactiveHandler(true); +var toShallow = (value) => value; +var getProto = (v) => Reflect.getPrototypeOf(v); +function createIterableMethod(method, isReadonly2, isShallow2) { + return function(...args) { + const target = this["__v_raw"]; + const rawTarget = toRaw(target); + const targetIsMap = isMap(rawTarget); + const isPair = method === "entries" || method === Symbol.iterator && targetIsMap; + const isKeyOnly = method === "keys" && targetIsMap; + const innerIterator = target[method](...args); + const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive; + !isReadonly2 && track( + rawTarget, + "iterate", + isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY + ); + return extend( + // inheriting all iterator properties + Object.create(innerIterator), + { + // iterator protocol + next() { + const { value, done } = innerIterator.next(); + return done ? { value, done } : { + value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value), + done + }; + } + } + ); + }; +} +function createReadonlyMethod(type) { + return function(...args) { + if (true) { + const key = args[0] ? `on key "${args[0]}" ` : ``; + warn( + `${capitalize(type)} operation ${key}failed: target is readonly.`, + toRaw(this) + ); + } + return type === "delete" ? false : type === "clear" ? void 0 : this; + }; +} +function createInstrumentations(readonly2, shallow) { + const instrumentations = { + get(key) { + const target = this["__v_raw"]; + const rawTarget = toRaw(target); + const rawKey = toRaw(key); + if (!readonly2) { + if (hasChanged(key, rawKey)) { + track(rawTarget, "get", key); + } + track(rawTarget, "get", rawKey); + } + const { has } = getProto(rawTarget); + const wrap = shallow ? toShallow : readonly2 ? toReadonly : toReactive; + if (has.call(rawTarget, key)) { + return wrap(target.get(key)); + } else if (has.call(rawTarget, rawKey)) { + return wrap(target.get(rawKey)); + } else if (target !== rawTarget) { + target.get(key); + } + }, + get size() { + const target = this["__v_raw"]; + !readonly2 && track(toRaw(target), "iterate", ITERATE_KEY); + return target.size; + }, + has(key) { + const target = this["__v_raw"]; + const rawTarget = toRaw(target); + const rawKey = toRaw(key); + if (!readonly2) { + if (hasChanged(key, rawKey)) { + track(rawTarget, "has", key); + } + track(rawTarget, "has", rawKey); + } + return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey); + }, + forEach(callback, thisArg) { + const observed = this; + const target = observed["__v_raw"]; + const rawTarget = toRaw(target); + const wrap = shallow ? toShallow : readonly2 ? toReadonly : toReactive; + !readonly2 && track(rawTarget, "iterate", ITERATE_KEY); + return target.forEach((value, key) => { + return callback.call(thisArg, wrap(value), wrap(key), observed); + }); + } + }; + extend( + instrumentations, + readonly2 ? { + add: createReadonlyMethod("add"), + set: createReadonlyMethod("set"), + delete: createReadonlyMethod("delete"), + clear: createReadonlyMethod("clear") + } : { + add(value) { + const target = toRaw(this); + const proto = getProto(target); + const rawValue = toRaw(value); + const valueToAdd = !shallow && !isShallow(value) && !isReadonly(value) ? rawValue : value; + const hadKey = proto.has.call(target, valueToAdd) || hasChanged(value, valueToAdd) && proto.has.call(target, value) || hasChanged(rawValue, valueToAdd) && proto.has.call(target, rawValue); + if (!hadKey) { + target.add(valueToAdd); + trigger(target, "add", valueToAdd, valueToAdd); + } + return this; + }, + set(key, value) { + if (!shallow && !isShallow(value) && !isReadonly(value)) { + value = toRaw(value); + } + const target = toRaw(this); + const { has, get } = getProto(target); + let hadKey = has.call(target, key); + if (!hadKey) { + key = toRaw(key); + hadKey = has.call(target, key); + } else if (true) { + checkIdentityKeys(target, has, key); + } + const oldValue = get.call(target, key); + target.set(key, value); + if (!hadKey) { + trigger(target, "add", key, value); + } else if (hasChanged(value, oldValue)) { + trigger(target, "set", key, value, oldValue); + } + return this; + }, + delete(key) { + const target = toRaw(this); + const { has, get } = getProto(target); + let hadKey = has.call(target, key); + if (!hadKey) { + key = toRaw(key); + hadKey = has.call(target, key); + } else if (true) { + checkIdentityKeys(target, has, key); + } + const oldValue = get ? get.call(target, key) : void 0; + const result = target.delete(key); + if (hadKey) { + trigger(target, "delete", key, void 0, oldValue); + } + return result; + }, + clear() { + const target = toRaw(this); + const hadItems = target.size !== 0; + const oldTarget = true ? isMap(target) ? new Map(target) : new Set(target) : void 0; + const result = target.clear(); + if (hadItems) { + trigger( + target, + "clear", + void 0, + void 0, + oldTarget + ); + } + return result; + } + } + ); + const iteratorMethods = [ + "keys", + "values", + "entries", + Symbol.iterator + ]; + iteratorMethods.forEach((method) => { + instrumentations[method] = createIterableMethod(method, readonly2, shallow); + }); + return instrumentations; +} +function createInstrumentationGetter(isReadonly2, shallow) { + const instrumentations = createInstrumentations(isReadonly2, shallow); + return (target, key, receiver) => { + if (key === "__v_isReactive") { + return !isReadonly2; + } else if (key === "__v_isReadonly") { + return isReadonly2; + } else if (key === "__v_raw") { + return target; + } + return Reflect.get( + hasOwn(instrumentations, key) && key in target ? instrumentations : target, + key, + receiver + ); + }; +} +var mutableCollectionHandlers = { + get: createInstrumentationGetter(false, false) +}; +var shallowCollectionHandlers = { + get: createInstrumentationGetter(false, true) +}; +var readonlyCollectionHandlers = { + get: createInstrumentationGetter(true, false) +}; +var shallowReadonlyCollectionHandlers = { + get: createInstrumentationGetter(true, true) +}; +function checkIdentityKeys(target, has, key) { + const rawKey = toRaw(key); + if (rawKey !== key && has.call(target, rawKey)) { + const type = toRawType(target); + warn( + `Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.` + ); + } +} +var reactiveMap = /* @__PURE__ */ new WeakMap(); +var shallowReactiveMap = /* @__PURE__ */ new WeakMap(); +var readonlyMap = /* @__PURE__ */ new WeakMap(); +var shallowReadonlyMap = /* @__PURE__ */ new WeakMap(); +function targetTypeMap(rawType) { + switch (rawType) { + case "Object": + case "Array": + return 1; + case "Map": + case "Set": + case "WeakMap": + case "WeakSet": + return 2; + default: + return 0; + } +} +function reactive(target) { + if (isReadonly(target)) { + return target; + } + return createReactiveObject( + target, + false, + mutableHandlers, + mutableCollectionHandlers, + reactiveMap + ); +} +function shallowReactive(target) { + return createReactiveObject( + target, + false, + shallowReactiveHandlers, + shallowCollectionHandlers, + shallowReactiveMap + ); +} +function readonly(target) { + return createReactiveObject( + target, + true, + readonlyHandlers, + readonlyCollectionHandlers, + readonlyMap + ); +} +function shallowReadonly(target) { + return createReactiveObject( + target, + true, + shallowReadonlyHandlers, + shallowReadonlyCollectionHandlers, + shallowReadonlyMap + ); +} +function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) { + if (!isObject(target)) { + if (true) { + warn( + `value cannot be made ${isReadonly2 ? "readonly" : "reactive"}: ${String( + target + )}` + ); + } + return target; + } + if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) { + return target; + } + if (target["__v_skip"] || !Object.isExtensible(target)) { + return target; + } + const existingProxy = proxyMap.get(target); + if (existingProxy) { + return existingProxy; + } + const targetType = targetTypeMap(toRawType(target)); + if (targetType === 0) { + return target; + } + const proxy = new Proxy( + target, + targetType === 2 ? collectionHandlers : baseHandlers + ); + proxyMap.set(target, proxy); + return proxy; +} +function isReactive(value) { + if (isReadonly(value)) { + return isReactive(value["__v_raw"]); + } + return !!(value && value["__v_isReactive"]); +} +function isReadonly(value) { + return !!(value && value["__v_isReadonly"]); +} +function isShallow(value) { + return !!(value && value["__v_isShallow"]); +} +function isProxy(value) { + return value ? !!value["__v_raw"] : false; +} +function toRaw(observed) { + const raw = observed && observed["__v_raw"]; + return raw ? toRaw(raw) : observed; +} +function markRaw(value) { + if (!hasOwn(value, "__v_skip") && Object.isExtensible(value)) { + def(value, "__v_skip", true); + } + return value; +} +var toReactive = (value) => isObject(value) ? reactive(value) : value; +var toReadonly = (value) => isObject(value) ? readonly(value) : value; +function isRef2(r) { + return r ? r["__v_isRef"] === true : false; +} +function ref(value) { + return createRef(value, false); +} +function shallowRef(value) { + return createRef(value, true); +} +function createRef(rawValue, shallow) { + if (isRef2(rawValue)) { + return rawValue; + } + return new RefImpl(rawValue, shallow); +} +var RefImpl = class { + constructor(value, isShallow2) { + this.dep = new Dep(); + this["__v_isRef"] = true; + this["__v_isShallow"] = false; + this._rawValue = isShallow2 ? value : toRaw(value); + this._value = isShallow2 ? value : toReactive(value); + this["__v_isShallow"] = isShallow2; + } + get value() { + if (true) { + this.dep.track({ + target: this, + type: "get", + key: "value" + }); + } else { + this.dep.track(); + } + return this._value; + } + set value(newValue) { + const oldValue = this._rawValue; + const useDirectValue = this["__v_isShallow"] || isShallow(newValue) || isReadonly(newValue); + newValue = useDirectValue ? newValue : toRaw(newValue); + if (hasChanged(newValue, oldValue)) { + this._rawValue = newValue; + this._value = useDirectValue ? newValue : toReactive(newValue); + if (true) { + this.dep.trigger({ + target: this, + type: "set", + key: "value", + newValue, + oldValue + }); + } else { + this.dep.trigger(); + } + } + } +}; +function triggerRef(ref2) { + if (ref2.dep) { + if (true) { + ref2.dep.trigger({ + target: ref2, + type: "set", + key: "value", + newValue: ref2._value + }); + } else { + ref2.dep.trigger(); + } + } +} +function unref(ref2) { + return isRef2(ref2) ? ref2.value : ref2; +} +function toValue(source) { + return isFunction(source) ? source() : unref(source); +} +var shallowUnwrapHandlers = { + get: (target, key, receiver) => key === "__v_raw" ? target : unref(Reflect.get(target, key, receiver)), + set: (target, key, value, receiver) => { + const oldValue = target[key]; + if (isRef2(oldValue) && !isRef2(value)) { + oldValue.value = value; + return true; + } else { + return Reflect.set(target, key, value, receiver); + } + } +}; +function proxyRefs(objectWithRefs) { + return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers); +} +var CustomRefImpl = class { + constructor(factory) { + this["__v_isRef"] = true; + this._value = void 0; + const dep = this.dep = new Dep(); + const { get, set } = factory(dep.track.bind(dep), dep.trigger.bind(dep)); + this._get = get; + this._set = set; + } + get value() { + return this._value = this._get(); + } + set value(newVal) { + this._set(newVal); + } +}; +function customRef(factory) { + return new CustomRefImpl(factory); +} +function toRefs(object) { + if (!isProxy(object)) { + warn(`toRefs() expects a reactive object but received a plain one.`); + } + const ret = isArray(object) ? new Array(object.length) : {}; + for (const key in object) { + ret[key] = propertyToRef(object, key); + } + return ret; +} +var ObjectRefImpl = class { + constructor(_object, key, _defaultValue) { + this._object = _object; + this._defaultValue = _defaultValue; + this["__v_isRef"] = true; + this._value = void 0; + this._key = isSymbol(key) ? key : String(key); + this._raw = toRaw(_object); + let shallow = true; + let obj = _object; + if (!isArray(_object) || isSymbol(this._key) || !isIntegerKey(this._key)) { + do { + shallow = !isProxy(obj) || isShallow(obj); + } while (shallow && (obj = obj["__v_raw"])); + } + this._shallow = shallow; + } + get value() { + let val = this._object[this._key]; + if (this._shallow) { + val = unref(val); + } + return this._value = val === void 0 ? this._defaultValue : val; + } + set value(newVal) { + if (this._shallow && isRef2(this._raw[this._key])) { + const nestedRef = this._object[this._key]; + if (isRef2(nestedRef)) { + nestedRef.value = newVal; + return; + } + } + this._object[this._key] = newVal; + } + get dep() { + return getDepFromReactive(this._raw, this._key); + } +}; +var GetterRefImpl = class { + constructor(_getter) { + this._getter = _getter; + this["__v_isRef"] = true; + this["__v_isReadonly"] = true; + this._value = void 0; + } + get value() { + return this._value = this._getter(); + } +}; +function toRef(source, key, defaultValue) { + if (isRef2(source)) { + return source; + } else if (isFunction(source)) { + return new GetterRefImpl(source); + } else if (isObject(source) && arguments.length > 1) { + return propertyToRef(source, key, defaultValue); + } else { + return ref(source); + } +} +function propertyToRef(source, key, defaultValue) { + return new ObjectRefImpl(source, key, defaultValue); +} +var ComputedRefImpl = class { + constructor(fn, setter, isSSR) { + this.fn = fn; + this.setter = setter; + this._value = void 0; + this.dep = new Dep(this); + this.__v_isRef = true; + this.deps = void 0; + this.depsTail = void 0; + this.flags = 16; + this.globalVersion = globalVersion - 1; + this.next = void 0; + this.effect = this; + this["__v_isReadonly"] = !setter; + this.isSSR = isSSR; + } + /** + * @internal + */ + notify() { + this.flags |= 16; + if (!(this.flags & 8) && // avoid infinite self recursion + activeSub !== this) { + batch(this, true); + return true; + } else if (true) ; + } + get value() { + const link = true ? this.dep.track({ + target: this, + type: "get", + key: "value" + }) : this.dep.track(); + refreshComputed(this); + if (link) { + link.version = this.dep.version; + } + return this._value; + } + set value(newValue) { + if (this.setter) { + this.setter(newValue); + } else if (true) { + warn("Write operation failed: computed value is readonly"); + } + } +}; +function computed(getterOrOptions, debugOptions, isSSR = false) { + let getter; + let setter; + if (isFunction(getterOrOptions)) { + getter = getterOrOptions; + } else { + getter = getterOrOptions.get; + setter = getterOrOptions.set; + } + const cRef = new ComputedRefImpl(getter, setter, isSSR); + if (debugOptions && !isSSR) { + cRef.onTrack = debugOptions.onTrack; + cRef.onTrigger = debugOptions.onTrigger; + } + return cRef; +} +var TrackOpTypes = { + "GET": "get", + "HAS": "has", + "ITERATE": "iterate" +}; +var TriggerOpTypes = { + "SET": "set", + "ADD": "add", + "DELETE": "delete", + "CLEAR": "clear" +}; +var INITIAL_WATCHER_VALUE = {}; +var cleanupMap = /* @__PURE__ */ new WeakMap(); +var activeWatcher = void 0; +function getCurrentWatcher() { + return activeWatcher; +} +function onWatcherCleanup(cleanupFn, failSilently = false, owner = activeWatcher) { + if (owner) { + let cleanups = cleanupMap.get(owner); + if (!cleanups) cleanupMap.set(owner, cleanups = []); + cleanups.push(cleanupFn); + } else if (!failSilently) { + warn( + `onWatcherCleanup() was called when there was no active watcher to associate with.` + ); + } +} +function watch(source, cb, options = EMPTY_OBJ) { + const { immediate, deep, once, scheduler, augmentJob, call } = options; + const warnInvalidSource = (s) => { + (options.onWarn || warn)( + `Invalid watch source: `, + s, + `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.` + ); + }; + const reactiveGetter = (source2) => { + if (deep) return source2; + if (isShallow(source2) || deep === false || deep === 0) + return traverse(source2, 1); + return traverse(source2); + }; + let effect2; + let getter; + let cleanup; + let boundCleanup; + let forceTrigger = false; + let isMultiSource = false; + if (isRef2(source)) { + getter = () => source.value; + forceTrigger = isShallow(source); + } else if (isReactive(source)) { + getter = () => reactiveGetter(source); + forceTrigger = true; + } else if (isArray(source)) { + isMultiSource = true; + forceTrigger = source.some((s) => isReactive(s) || isShallow(s)); + getter = () => source.map((s) => { + if (isRef2(s)) { + return s.value; + } else if (isReactive(s)) { + return reactiveGetter(s); + } else if (isFunction(s)) { + return call ? call(s, 2) : s(); + } else { + warnInvalidSource(s); + } + }); + } else if (isFunction(source)) { + if (cb) { + getter = call ? () => call(source, 2) : source; + } else { + getter = () => { + if (cleanup) { + pauseTracking(); + try { + cleanup(); + } finally { + resetTracking(); + } + } + const currentEffect = activeWatcher; + activeWatcher = effect2; + try { + return call ? call(source, 3, [boundCleanup]) : source(boundCleanup); + } finally { + activeWatcher = currentEffect; + } + }; + } + } else { + getter = NOOP; + warnInvalidSource(source); + } + if (cb && deep) { + const baseGetter = getter; + const depth = deep === true ? Infinity : deep; + getter = () => traverse(baseGetter(), depth); + } + const scope = getCurrentScope(); + const watchHandle = () => { + effect2.stop(); + if (scope && scope.active) { + remove(scope.effects, effect2); + } + }; + if (once && cb) { + const _cb = cb; + cb = (...args) => { + const res = _cb(...args); + watchHandle(); + return res; + }; + } + let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE; + const job = (immediateFirstRun) => { + if (!(effect2.flags & 1) || !effect2.dirty && !immediateFirstRun) { + return; + } + if (cb) { + const newValue = effect2.run(); + if (immediateFirstRun || deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) { + if (cleanup) { + cleanup(); + } + const currentWatcher = activeWatcher; + activeWatcher = effect2; + try { + const args = [ + newValue, + // pass undefined as the old value when it's changed for the first time + oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue, + boundCleanup + ]; + oldValue = newValue; + call ? call(cb, 3, args) : ( + // @ts-expect-error + cb(...args) + ); + } finally { + activeWatcher = currentWatcher; + } + } + } else { + effect2.run(); + } + }; + if (augmentJob) { + augmentJob(job); + } + effect2 = new ReactiveEffect(getter); + effect2.scheduler = scheduler ? () => scheduler(job, false) : job; + boundCleanup = (fn) => onWatcherCleanup(fn, false, effect2); + cleanup = effect2.onStop = () => { + const cleanups = cleanupMap.get(effect2); + if (cleanups) { + if (call) { + call(cleanups, 4); + } else { + for (const cleanup2 of cleanups) cleanup2(); + } + cleanupMap.delete(effect2); + } + }; + if (true) { + effect2.onTrack = options.onTrack; + effect2.onTrigger = options.onTrigger; + } + if (cb) { + if (immediate) { + job(true); + } else { + oldValue = effect2.run(); + } + } else if (scheduler) { + scheduler(job.bind(null, true), true); + } else { + effect2.run(); + } + watchHandle.pause = effect2.pause.bind(effect2); + watchHandle.resume = effect2.resume.bind(effect2); + watchHandle.stop = watchHandle; + return watchHandle; +} +function traverse(value, depth = Infinity, seen) { + if (depth <= 0 || !isObject(value) || value["__v_skip"]) { + return value; + } + seen = seen || /* @__PURE__ */ new Map(); + if ((seen.get(value) || 0) >= depth) { + return value; + } + seen.set(value, depth); + depth--; + if (isRef2(value)) { + traverse(value.value, depth, seen); + } else if (isArray(value)) { + for (let i = 0; i < value.length; i++) { + traverse(value[i], depth, seen); + } + } else if (isSet(value) || isMap(value)) { + value.forEach((v) => { + traverse(v, depth, seen); + }); + } else if (isPlainObject(value)) { + for (const key in value) { + traverse(value[key], depth, seen); + } + for (const key of Object.getOwnPropertySymbols(value)) { + if (Object.prototype.propertyIsEnumerable.call(value, key)) { + traverse(value[key], depth, seen); + } + } + } + return value; +} + +// node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js +var stack = []; +function pushWarningContext(vnode) { + stack.push(vnode); +} +function popWarningContext() { + stack.pop(); +} +var isWarning = false; +function warn$1(msg, ...args) { + if (isWarning) return; + isWarning = true; + pauseTracking(); + const instance = stack.length ? stack[stack.length - 1].component : null; + const appWarnHandler = instance && instance.appContext.config.warnHandler; + const trace = getComponentTrace(); + if (appWarnHandler) { + callWithErrorHandling( + appWarnHandler, + instance, + 11, + [ + // eslint-disable-next-line no-restricted-syntax + msg + args.map((a) => { + var _a, _b; + return (_b = (_a = a.toString) == null ? void 0 : _a.call(a)) != null ? _b : JSON.stringify(a); + }).join(""), + instance && instance.proxy, + trace.map( + ({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>` + ).join("\n"), + trace + ] + ); + } else { + const warnArgs = [`[Vue warn]: ${msg}`, ...args]; + if (trace.length && // avoid spamming console during tests + true) { + warnArgs.push(` +`, ...formatTrace(trace)); + } + console.warn(...warnArgs); + } + resetTracking(); + isWarning = false; +} +function getComponentTrace() { + let currentVNode = stack[stack.length - 1]; + if (!currentVNode) { + return []; + } + const normalizedStack = []; + while (currentVNode) { + const last = normalizedStack[0]; + if (last && last.vnode === currentVNode) { + last.recurseCount++; + } else { + normalizedStack.push({ + vnode: currentVNode, + recurseCount: 0 + }); + } + const parentInstance = currentVNode.component && currentVNode.component.parent; + currentVNode = parentInstance && parentInstance.vnode; + } + return normalizedStack; +} +function formatTrace(trace) { + const logs = []; + trace.forEach((entry, i) => { + logs.push(...i === 0 ? [] : [` +`], ...formatTraceEntry(entry)); + }); + return logs; +} +function formatTraceEntry({ vnode, recurseCount }) { + const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``; + const isRoot = vnode.component ? vnode.component.parent == null : false; + const open = ` at <${formatComponentName( + vnode.component, + vnode.type, + isRoot + )}`; + const close = `>` + postfix; + return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close]; +} +function formatProps(props) { + const res = []; + const keys = Object.keys(props); + keys.slice(0, 3).forEach((key) => { + res.push(...formatProp(key, props[key])); + }); + if (keys.length > 3) { + res.push(` ...`); + } + return res; +} +function formatProp(key, value, raw) { + if (isString(value)) { + value = JSON.stringify(value); + return raw ? value : [`${key}=${value}`]; + } else if (typeof value === "number" || typeof value === "boolean" || value == null) { + return raw ? value : [`${key}=${value}`]; + } else if (isRef2(value)) { + value = formatProp(key, toRaw(value.value), true); + return raw ? value : [`${key}=Ref<`, value, `>`]; + } else if (isFunction(value)) { + return [`${key}=fn${value.name ? `<${value.name}>` : ``}`]; + } else { + value = toRaw(value); + return raw ? value : [`${key}=`, value]; + } +} +function assertNumber(val, type) { + if (false) return; + if (val === void 0) { + return; + } else if (typeof val !== "number") { + warn$1(`${type} is not a valid number - got ${JSON.stringify(val)}.`); + } else if (isNaN(val)) { + warn$1(`${type} is NaN - the duration expression might be incorrect.`); + } +} +var ErrorCodes = { + "SETUP_FUNCTION": 0, + "0": "SETUP_FUNCTION", + "RENDER_FUNCTION": 1, + "1": "RENDER_FUNCTION", + "NATIVE_EVENT_HANDLER": 5, + "5": "NATIVE_EVENT_HANDLER", + "COMPONENT_EVENT_HANDLER": 6, + "6": "COMPONENT_EVENT_HANDLER", + "VNODE_HOOK": 7, + "7": "VNODE_HOOK", + "DIRECTIVE_HOOK": 8, + "8": "DIRECTIVE_HOOK", + "TRANSITION_HOOK": 9, + "9": "TRANSITION_HOOK", + "APP_ERROR_HANDLER": 10, + "10": "APP_ERROR_HANDLER", + "APP_WARN_HANDLER": 11, + "11": "APP_WARN_HANDLER", + "FUNCTION_REF": 12, + "12": "FUNCTION_REF", + "ASYNC_COMPONENT_LOADER": 13, + "13": "ASYNC_COMPONENT_LOADER", + "SCHEDULER": 14, + "14": "SCHEDULER", + "COMPONENT_UPDATE": 15, + "15": "COMPONENT_UPDATE", + "APP_UNMOUNT_CLEANUP": 16, + "16": "APP_UNMOUNT_CLEANUP" +}; +var ErrorTypeStrings$1 = { + ["sp"]: "serverPrefetch hook", + ["bc"]: "beforeCreate hook", + ["c"]: "created hook", + ["bm"]: "beforeMount hook", + ["m"]: "mounted hook", + ["bu"]: "beforeUpdate hook", + ["u"]: "updated", + ["bum"]: "beforeUnmount hook", + ["um"]: "unmounted hook", + ["a"]: "activated hook", + ["da"]: "deactivated hook", + ["ec"]: "errorCaptured hook", + ["rtc"]: "renderTracked hook", + ["rtg"]: "renderTriggered hook", + [0]: "setup function", + [1]: "render function", + [2]: "watcher getter", + [3]: "watcher callback", + [4]: "watcher cleanup function", + [5]: "native event handler", + [6]: "component event handler", + [7]: "vnode hook", + [8]: "directive hook", + [9]: "transition hook", + [10]: "app errorHandler", + [11]: "app warnHandler", + [12]: "ref function", + [13]: "async component loader", + [14]: "scheduler flush", + [15]: "component update", + [16]: "app unmount cleanup function" +}; +function callWithErrorHandling(fn, instance, type, args) { + try { + return args ? fn(...args) : fn(); + } catch (err) { + handleError(err, instance, type); + } +} +function callWithAsyncErrorHandling(fn, instance, type, args) { + if (isFunction(fn)) { + const res = callWithErrorHandling(fn, instance, type, args); + if (res && isPromise(res)) { + res.catch((err) => { + handleError(err, instance, type); + }); + } + return res; + } + if (isArray(fn)) { + const values = []; + for (let i = 0; i < fn.length; i++) { + values.push(callWithAsyncErrorHandling(fn[i], instance, type, args)); + } + return values; + } else if (true) { + warn$1( + `Invalid value type passed to callWithAsyncErrorHandling(): ${typeof fn}` + ); + } +} +function handleError(err, instance, type, throwInDev = true) { + const contextVNode = instance ? instance.vnode : null; + const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ; + if (instance) { + let cur = instance.parent; + const exposedInstance = instance.proxy; + const errorInfo = true ? ErrorTypeStrings$1[type] : `https://vuejs.org/error-reference/#runtime-${type}`; + while (cur) { + const errorCapturedHooks = cur.ec; + if (errorCapturedHooks) { + for (let i = 0; i < errorCapturedHooks.length; i++) { + if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) { + return; + } + } + } + cur = cur.parent; + } + if (errorHandler) { + pauseTracking(); + callWithErrorHandling(errorHandler, null, 10, [ + err, + exposedInstance, + errorInfo + ]); + resetTracking(); + return; + } + } + logError(err, type, contextVNode, throwInDev, throwUnhandledErrorInProduction); +} +function logError(err, type, contextVNode, throwInDev = true, throwInProd = false) { + if (true) { + const info = ErrorTypeStrings$1[type]; + if (contextVNode) { + pushWarningContext(contextVNode); + } + warn$1(`Unhandled error${info ? ` during execution of ${info}` : ``}`); + if (contextVNode) { + popWarningContext(); + } + if (throwInDev) { + throw err; + } else { + console.error(err); + } + } else if (throwInProd) { + throw err; + } else { + console.error(err); + } +} +var queue = []; +var flushIndex = -1; +var pendingPostFlushCbs = []; +var activePostFlushCbs = null; +var postFlushIndex = 0; +var resolvedPromise = Promise.resolve(); +var currentFlushPromise = null; +var RECURSION_LIMIT = 100; +function nextTick(fn) { + const p2 = currentFlushPromise || resolvedPromise; + return fn ? p2.then(this ? fn.bind(this) : fn) : p2; +} +function findInsertionIndex(id) { + let start = flushIndex + 1; + let end = queue.length; + while (start < end) { + const middle = start + end >>> 1; + const middleJob = queue[middle]; + const middleJobId = getId(middleJob); + if (middleJobId < id || middleJobId === id && middleJob.flags & 2) { + start = middle + 1; + } else { + end = middle; + } + } + return start; +} +function queueJob(job) { + if (!(job.flags & 1)) { + const jobId = getId(job); + const lastJob = queue[queue.length - 1]; + if (!lastJob || // fast path when the job id is larger than the tail + !(job.flags & 2) && jobId >= getId(lastJob)) { + queue.push(job); + } else { + queue.splice(findInsertionIndex(jobId), 0, job); + } + job.flags |= 1; + queueFlush(); + } +} +function queueFlush() { + if (!currentFlushPromise) { + currentFlushPromise = resolvedPromise.then(flushJobs); + } +} +function queuePostFlushCb(cb) { + if (!isArray(cb)) { + if (activePostFlushCbs && cb.id === -1) { + activePostFlushCbs.splice(postFlushIndex + 1, 0, cb); + } else if (!(cb.flags & 1)) { + pendingPostFlushCbs.push(cb); + cb.flags |= 1; + } + } else { + for (let i = 0; i < cb.length; i++) { + pendingPostFlushCbs.push(cb[i]); + } + } + queueFlush(); +} +function flushPreFlushCbs(instance, seen, i = flushIndex + 1) { + if (true) { + seen = seen || /* @__PURE__ */ new Map(); + } + for (; i < queue.length; i++) { + const cb = queue[i]; + if (cb && cb.flags & 2) { + if (instance && cb.id !== instance.uid) { + continue; + } + if (checkRecursiveUpdates(seen, cb)) { + continue; + } + queue.splice(i, 1); + i--; + if (cb.flags & 4) { + cb.flags &= -2; + } + cb(); + if (!(cb.flags & 4)) { + cb.flags &= -2; + } + } + } +} +function flushPostFlushCbs(seen) { + if (pendingPostFlushCbs.length) { + const deduped = [...new Set(pendingPostFlushCbs)].sort( + (a, b) => getId(a) - getId(b) + ); + pendingPostFlushCbs.length = 0; + if (activePostFlushCbs) { + for (let i = 0; i < deduped.length; i++) { + activePostFlushCbs.push(deduped[i]); + } + return; + } + activePostFlushCbs = deduped; + if (true) { + seen = seen || /* @__PURE__ */ new Map(); + } + for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) { + const cb = activePostFlushCbs[postFlushIndex]; + if (checkRecursiveUpdates(seen, cb)) { + continue; + } + if (cb.flags & 4) { + cb.flags &= -2; + } + if (!(cb.flags & 8)) cb(); + cb.flags &= -2; + } + activePostFlushCbs = null; + postFlushIndex = 0; + } +} +var getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id; +function flushJobs(seen) { + if (true) { + seen = seen || /* @__PURE__ */ new Map(); + } + const check = true ? (job) => checkRecursiveUpdates(seen, job) : NOOP; + try { + for (flushIndex = 0; flushIndex < queue.length; flushIndex++) { + const job = queue[flushIndex]; + if (job && !(job.flags & 8)) { + if (check(job)) { + continue; + } + if (job.flags & 4) { + job.flags &= ~1; + } + callWithErrorHandling( + job, + job.i, + job.i ? 15 : 14 + ); + if (!(job.flags & 4)) { + job.flags &= ~1; + } + } + } + } finally { + for (; flushIndex < queue.length; flushIndex++) { + const job = queue[flushIndex]; + if (job) { + job.flags &= -2; + } + } + flushIndex = -1; + queue.length = 0; + flushPostFlushCbs(seen); + currentFlushPromise = null; + if (queue.length || pendingPostFlushCbs.length) { + flushJobs(seen); + } + } +} +function checkRecursiveUpdates(seen, fn) { + const count = seen.get(fn) || 0; + if (count > RECURSION_LIMIT) { + const instance = fn.i; + const componentName = instance && getComponentName(instance.type); + handleError( + `Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`, + null, + 10 + ); + return true; + } + seen.set(fn, count + 1); + return false; +} +var isHmrUpdating = false; +var setHmrUpdating = (v) => { + try { + return isHmrUpdating; + } finally { + isHmrUpdating = v; + } +}; +var hmrDirtyComponents = /* @__PURE__ */ new Map(); +if (true) { + getGlobalThis().__VUE_HMR_RUNTIME__ = { + createRecord: tryWrap(createRecord), + rerender: tryWrap(rerender), + reload: tryWrap(reload) + }; +} +var map = /* @__PURE__ */ new Map(); +function registerHMR(instance) { + const id = instance.type.__hmrId; + let record = map.get(id); + if (!record) { + createRecord(id, instance.type); + record = map.get(id); + } + record.instances.add(instance); +} +function unregisterHMR(instance) { + map.get(instance.type.__hmrId).instances.delete(instance); +} +function createRecord(id, initialDef) { + if (map.has(id)) { + return false; + } + map.set(id, { + initialDef: normalizeClassComponent(initialDef), + instances: /* @__PURE__ */ new Set() + }); + return true; +} +function normalizeClassComponent(component) { + return isClassComponent(component) ? component.__vccOpts : component; +} +function rerender(id, newRender) { + const record = map.get(id); + if (!record) { + return; + } + record.initialDef.render = newRender; + [...record.instances].forEach((instance) => { + if (newRender) { + instance.render = newRender; + normalizeClassComponent(instance.type).render = newRender; + } + instance.renderCache = []; + isHmrUpdating = true; + if (!(instance.job.flags & 8)) { + instance.update(); + } + isHmrUpdating = false; + }); +} +function reload(id, newComp) { + const record = map.get(id); + if (!record) return; + newComp = normalizeClassComponent(newComp); + updateComponentDef(record.initialDef, newComp); + const instances = [...record.instances]; + for (let i = 0; i < instances.length; i++) { + const instance = instances[i]; + const oldComp = normalizeClassComponent(instance.type); + let dirtyInstances = hmrDirtyComponents.get(oldComp); + if (!dirtyInstances) { + if (oldComp !== record.initialDef) { + updateComponentDef(oldComp, newComp); + } + hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set()); + } + dirtyInstances.add(instance); + instance.appContext.propsCache.delete(instance.type); + instance.appContext.emitsCache.delete(instance.type); + instance.appContext.optionsCache.delete(instance.type); + if (instance.ceReload) { + dirtyInstances.add(instance); + instance.ceReload(newComp.styles); + dirtyInstances.delete(instance); + } else if (instance.parent) { + queueJob(() => { + if (!(instance.job.flags & 8)) { + isHmrUpdating = true; + instance.parent.update(); + isHmrUpdating = false; + dirtyInstances.delete(instance); + } + }); + } else if (instance.appContext.reload) { + instance.appContext.reload(); + } else if (typeof window !== "undefined") { + window.location.reload(); + } else { + console.warn( + "[HMR] Root or manually mounted instance modified. Full reload required." + ); + } + if (instance.root.ce && instance !== instance.root) { + instance.root.ce._removeChildStyle(oldComp); + } + } + queuePostFlushCb(() => { + hmrDirtyComponents.clear(); + }); +} +function updateComponentDef(oldComp, newComp) { + extend(oldComp, newComp); + for (const key in oldComp) { + if (key !== "__file" && !(key in newComp)) { + delete oldComp[key]; + } + } +} +function tryWrap(fn) { + return (id, arg) => { + try { + return fn(id, arg); + } catch (e) { + console.error(e); + console.warn( + `[HMR] Something went wrong during Vue component hot-reload. Full reload required.` + ); + } + }; +} +var devtools$1; +var buffer = []; +var devtoolsNotInstalled = false; +function emit$1(event, ...args) { + if (devtools$1) { + devtools$1.emit(event, ...args); + } else if (!devtoolsNotInstalled) { + buffer.push({ event, args }); + } +} +function setDevtoolsHook$1(hook, target) { + var _a, _b; + devtools$1 = hook; + if (devtools$1) { + devtools$1.enabled = true; + buffer.forEach(({ event, args }) => devtools$1.emit(event, ...args)); + buffer = []; + } else if ( + // handle late devtools injection - only do this if we are in an actual + // browser environment to avoid the timer handle stalling test runner exit + // (#4815) + typeof window !== "undefined" && // some envs mock window but not fully + window.HTMLElement && // also exclude jsdom + // eslint-disable-next-line no-restricted-syntax + !((_b = (_a = window.navigator) == null ? void 0 : _a.userAgent) == null ? void 0 : _b.includes("jsdom")) + ) { + const replay = target.__VUE_DEVTOOLS_HOOK_REPLAY__ = target.__VUE_DEVTOOLS_HOOK_REPLAY__ || []; + replay.push((newHook) => { + setDevtoolsHook$1(newHook, target); + }); + setTimeout(() => { + if (!devtools$1) { + target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null; + devtoolsNotInstalled = true; + buffer = []; + } + }, 3e3); + } else { + devtoolsNotInstalled = true; + buffer = []; + } +} +function devtoolsInitApp(app, version2) { + emit$1("app:init", app, version2, { + Fragment, + Text, + Comment, + Static + }); +} +function devtoolsUnmountApp(app) { + emit$1("app:unmount", app); +} +var devtoolsComponentAdded = createDevtoolsComponentHook( + "component:added" + /* COMPONENT_ADDED */ +); +var devtoolsComponentUpdated = createDevtoolsComponentHook( + "component:updated" + /* COMPONENT_UPDATED */ +); +var _devtoolsComponentRemoved = createDevtoolsComponentHook( + "component:removed" + /* COMPONENT_REMOVED */ +); +var devtoolsComponentRemoved = (component) => { + if (devtools$1 && typeof devtools$1.cleanupBuffer === "function" && // remove the component if it wasn't buffered + !devtools$1.cleanupBuffer(component)) { + _devtoolsComponentRemoved(component); + } +}; +function createDevtoolsComponentHook(hook) { + return (component) => { + emit$1( + hook, + component.appContext.app, + component.uid, + component.parent ? component.parent.uid : void 0, + component + ); + }; +} +var devtoolsPerfStart = createDevtoolsPerformanceHook( + "perf:start" + /* PERFORMANCE_START */ +); +var devtoolsPerfEnd = createDevtoolsPerformanceHook( + "perf:end" + /* PERFORMANCE_END */ +); +function createDevtoolsPerformanceHook(hook) { + return (component, type, time) => { + emit$1(hook, component.appContext.app, component.uid, component, type, time); + }; +} +function devtoolsComponentEmit(component, event, params) { + emit$1( + "component:emit", + component.appContext.app, + component, + event, + params + ); +} +var currentRenderingInstance = null; +var currentScopeId = null; +function setCurrentRenderingInstance(instance) { + const prev = currentRenderingInstance; + currentRenderingInstance = instance; + currentScopeId = instance && instance.type.__scopeId || null; + return prev; +} +function pushScopeId(id) { + currentScopeId = id; +} +function popScopeId() { + currentScopeId = null; +} +var withScopeId = (_id) => withCtx; +function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) { + if (!ctx) return fn; + if (fn._n) { + return fn; + } + const renderFnWithContext = (...args) => { + if (renderFnWithContext._d) { + setBlockTracking(-1); + } + const prevInstance = setCurrentRenderingInstance(ctx); + const prevStackSize = blockStack.length; + let res; + try { + res = fn(...args); + } finally { + for (let i = blockStack.length; i > prevStackSize; i--) closeBlock(); + setCurrentRenderingInstance(prevInstance); + if (renderFnWithContext._d) { + setBlockTracking(1); + } + } + if (true) { + devtoolsComponentUpdated(ctx); + } + return res; + }; + renderFnWithContext._n = true; + renderFnWithContext._c = true; + renderFnWithContext._d = true; + return renderFnWithContext; +} +function validateDirectiveName(name) { + if (isBuiltInDirective(name)) { + warn$1("Do not use built-in directive ids as custom directive id: " + name); + } +} +function withDirectives(vnode, directives) { + if (currentRenderingInstance === null) { + warn$1(`withDirectives can only be used inside render functions.`); + return vnode; + } + const instance = getComponentPublicInstance(currentRenderingInstance); + const bindings = vnode.dirs || (vnode.dirs = []); + for (let i = 0; i < directives.length; i++) { + let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i]; + if (dir) { + if (isFunction(dir)) { + dir = { + mounted: dir, + updated: dir + }; + } + if (dir.deep) { + traverse(value); + } + bindings.push({ + dir, + instance, + value, + oldValue: void 0, + arg, + modifiers + }); + } + } + return vnode; +} +function invokeDirectiveHook(vnode, prevVNode, instance, name) { + const bindings = vnode.dirs; + const oldBindings = prevVNode && prevVNode.dirs; + for (let i = 0; i < bindings.length; i++) { + const binding = bindings[i]; + if (oldBindings) { + binding.oldValue = oldBindings[i].value; + } + let hook = binding.dir[name]; + if (hook) { + pauseTracking(); + callWithAsyncErrorHandling(hook, instance, 8, [ + vnode.el, + binding, + vnode, + prevVNode + ]); + resetTracking(); + } + } +} +function provide(key, value) { + if (true) { + if (!currentInstance || currentInstance.isMounted) { + warn$1(`provide() can only be used inside setup().`); + } + } + if (currentInstance) { + let provides = currentInstance.provides; + const parentProvides = currentInstance.parent && currentInstance.parent.provides; + if (parentProvides === provides) { + provides = currentInstance.provides = Object.create(parentProvides); + } + provides[key] = value; + } +} +function inject(key, defaultValue, treatDefaultAsFactory = false) { + const instance = getCurrentInstance(); + if (instance || currentApp) { + let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0; + if (provides && key in provides) { + return provides[key]; + } else if (arguments.length > 1) { + return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue; + } else if (true) { + warn$1(`injection "${String(key)}" not found.`); + } + } else if (true) { + warn$1(`inject() can only be used inside setup() or functional components.`); + } +} +function hasInjectionContext() { + return !!(getCurrentInstance() || currentApp); +} +var ssrContextKey = Symbol.for("v-scx"); +var useSSRContext = () => { + { + const ctx = inject(ssrContextKey); + if (!ctx) { + warn$1( + `Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.` + ); + } + return ctx; + } +}; +function watchEffect(effect2, options) { + return doWatch(effect2, null, options); +} +function watchPostEffect(effect2, options) { + return doWatch( + effect2, + null, + true ? extend({}, options, { flush: "post" }) : { flush: "post" } + ); +} +function watchSyncEffect(effect2, options) { + return doWatch( + effect2, + null, + true ? extend({}, options, { flush: "sync" }) : { flush: "sync" } + ); +} +function watch2(source, cb, options) { + if (!isFunction(cb)) { + warn$1( + `\`watch(fn, options?)\` signature has been moved to a separate API. Use \`watchEffect(fn, options?)\` instead. \`watch\` now only supports \`watch(source, cb, options?) signature.` + ); + } + return doWatch(source, cb, options); +} +function doWatch(source, cb, options = EMPTY_OBJ) { + const { immediate, deep, flush, once } = options; + if (!cb) { + if (immediate !== void 0) { + warn$1( + `watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.` + ); + } + if (deep !== void 0) { + warn$1( + `watch() "deep" option is only respected when using the watch(source, callback, options?) signature.` + ); + } + if (once !== void 0) { + warn$1( + `watch() "once" option is only respected when using the watch(source, callback, options?) signature.` + ); + } + } + const baseWatchOptions = extend({}, options); + if (true) baseWatchOptions.onWarn = warn$1; + const runsImmediately = cb && immediate || !cb && flush !== "post"; + let ssrCleanup; + if (isInSSRComponentSetup) { + if (flush === "sync") { + const ctx = useSSRContext(); + ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []); + } else if (!runsImmediately) { + const watchStopHandle = () => { + }; + watchStopHandle.stop = NOOP; + watchStopHandle.resume = NOOP; + watchStopHandle.pause = NOOP; + return watchStopHandle; + } + } + const instance = currentInstance; + baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args); + let isPre = false; + if (flush === "post") { + baseWatchOptions.scheduler = (job) => { + queuePostRenderEffect(job, instance && instance.suspense); + }; + } else if (flush !== "sync") { + isPre = true; + baseWatchOptions.scheduler = (job, isFirstRun) => { + if (isFirstRun) { + job(); + } else { + queueJob(job); + } + }; + } + baseWatchOptions.augmentJob = (job) => { + if (cb) { + job.flags |= 4; + } + if (isPre) { + job.flags |= 2; + if (instance) { + job.id = instance.uid; + job.i = instance; + } + } + }; + const watchHandle = watch(source, cb, baseWatchOptions); + if (isInSSRComponentSetup) { + if (ssrCleanup) { + ssrCleanup.push(watchHandle); + } else if (runsImmediately) { + watchHandle(); + } + } + return watchHandle; +} +function instanceWatch(source, value, options) { + const publicThis = this.proxy; + const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis); + let cb; + if (isFunction(value)) { + cb = value; + } else { + cb = value.handler; + options = value; + } + const reset = setCurrentInstance(this); + const res = doWatch(getter, cb.bind(publicThis), options); + reset(); + return res; +} +function createPathGetter(ctx, path) { + const segments = path.split("."); + return () => { + let cur = ctx; + for (let i = 0; i < segments.length && cur; i++) { + cur = cur[segments[i]]; + } + return cur; + }; +} +var pendingMounts = /* @__PURE__ */ new WeakMap(); +var TeleportEndKey = Symbol("_vte"); +var isTeleport = (type) => type.__isTeleport; +var isTeleportDisabled = (props) => props && (props.disabled || props.disabled === ""); +var isTeleportDeferred = (props) => props && (props.defer || props.defer === ""); +var isTargetSVG = (target) => typeof SVGElement !== "undefined" && target instanceof SVGElement; +var isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement; +var resolveTarget = (props, select) => { + const targetSelector = props && props.to; + if (isString(targetSelector)) { + if (!select) { + warn$1( + `Current renderer does not support string target for Teleports. (missing querySelector renderer option)` + ); + return null; + } else { + const target = select(targetSelector); + if (!target && !isTeleportDisabled(props)) { + warn$1( + `Failed to locate Teleport target with selector "${targetSelector}". Note the target element must exist before the component is mounted - i.e. the target cannot be rendered by the component itself, and ideally should be outside of the entire Vue component tree.` + ); + } + return target; + } + } else { + if (!targetSelector && !isTeleportDisabled(props)) { + warn$1(`Invalid Teleport target: ${targetSelector}`); + } + return targetSelector; + } +}; +var TeleportImpl = { + name: "Teleport", + __isTeleport: true, + process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) { + const { + mc: mountChildren, + pc: patchChildren, + pbc: patchBlockChildren, + o: { insert, querySelector, createText, createComment, parentNode } + } = internals; + const disabled = isTeleportDisabled(n2.props); + let { dynamicChildren } = n2; + if (isHmrUpdating) { + optimized = false; + dynamicChildren = null; + } + const mount = (vnode, container2, anchor2) => { + if (vnode.shapeFlag & 16) { + mountChildren( + vnode.children, + container2, + anchor2, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + optimized + ); + } + }; + const mountToTarget = (vnode = n2) => { + const disabled2 = isTeleportDisabled(vnode.props); + const target = vnode.target = resolveTarget(vnode.props, querySelector); + const targetAnchor = prepareAnchor(target, vnode, createText, insert); + if (target) { + if (namespace !== "svg" && isTargetSVG(target)) { + namespace = "svg"; + } else if (namespace !== "mathml" && isTargetMathML(target)) { + namespace = "mathml"; + } + if (parentComponent && parentComponent.isCE) { + (parentComponent.ce._teleportTargets || (parentComponent.ce._teleportTargets = /* @__PURE__ */ new Set())).add(target); + } + if (!disabled2) { + mount(vnode, target, targetAnchor); + updateCssVars(vnode, false); + } + } else if (!disabled2) { + warn$1("Invalid Teleport target on mount:", target, `(${typeof target})`); + } + }; + const queuePendingMount = (vnode) => { + const mountJob = () => { + if (pendingMounts.get(vnode) !== mountJob) return; + pendingMounts.delete(vnode); + if (isTeleportDisabled(vnode.props)) { + const mountContainer = parentNode(vnode.el) || container; + mount(vnode, mountContainer, vnode.anchor); + updateCssVars(vnode, true); + } + mountToTarget(vnode); + }; + pendingMounts.set(vnode, mountJob); + queuePostRenderEffect(mountJob, parentSuspense); + }; + if (n1 == null) { + const placeholder = n2.el = true ? createComment("teleport start") : createText(""); + const mainAnchor = n2.anchor = true ? createComment("teleport end") : createText(""); + insert(placeholder, container, anchor); + insert(mainAnchor, container, anchor); + if (isTeleportDeferred(n2.props) || parentSuspense && parentSuspense.pendingBranch) { + queuePendingMount(n2); + return; + } + if (disabled) { + mount(n2, container, mainAnchor); + updateCssVars(n2, true); + } + mountToTarget(); + } else { + n2.el = n1.el; + const mainAnchor = n2.anchor = n1.anchor; + const pendingMount = pendingMounts.get(n1); + if (pendingMount) { + pendingMount.flags |= 8; + pendingMounts.delete(n1); + queuePendingMount(n2); + return; + } + n2.targetStart = n1.targetStart; + const target = n2.target = n1.target; + const targetAnchor = n2.targetAnchor = n1.targetAnchor; + const wasDisabled = isTeleportDisabled(n1.props); + const currentContainer = wasDisabled ? container : target; + const currentAnchor = wasDisabled ? mainAnchor : targetAnchor; + if (namespace === "svg" || isTargetSVG(target)) { + namespace = "svg"; + } else if (namespace === "mathml" || isTargetMathML(target)) { + namespace = "mathml"; + } + if (dynamicChildren) { + patchBlockChildren( + n1.dynamicChildren, + dynamicChildren, + currentContainer, + parentComponent, + parentSuspense, + namespace, + slotScopeIds + ); + traverseStaticChildren(n1, n2, false); + } else if (!optimized) { + patchChildren( + n1, + n2, + currentContainer, + currentAnchor, + parentComponent, + parentSuspense, + namespace, + slotScopeIds, + false + ); + } + if (disabled) { + if (!wasDisabled) { + moveTeleport( + n2, + container, + mainAnchor, + internals, + 1 + ); + } else { + if (n2.props && n1.props && n2.props.to !== n1.props.to) { + n2.props.to = n1.props.to; + } + } + } else { + if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) { + const nextTarget = resolveTarget(n2.props, querySelector); + if (nextTarget) { + n2.target = nextTarget; + moveTeleport( + n2, + nextTarget, + null, + internals, + 0 + ); + } else if (true) { + warn$1( + "Invalid Teleport target on update:", + target, + `(${typeof target})` + ); + } + } else if (wasDisabled) { + moveTeleport( + n2, + target, + targetAnchor, + internals, + 1 + ); + } + } + updateCssVars(n2, disabled); + } + }, + remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) { + const { + shapeFlag, + children, + anchor, + targetStart, + targetAnchor, + target, + props + } = vnode; + const disabled = isTeleportDisabled(props); + const shouldRemove = doRemove || !disabled; + const pendingMount = pendingMounts.get(vnode); + if (pendingMount) { + pendingMount.flags |= 8; + pendingMounts.delete(vnode); + } + if (target) { + hostRemove(targetStart); + hostRemove(targetAnchor); + } + doRemove && hostRemove(anchor); + if (!pendingMount && (disabled || target) && shapeFlag & 16) { + for (let i = 0; i < children.length; i++) { + const child = children[i]; + unmount( + child, + parentComponent, + parentSuspense, + shouldRemove, + !!child.dynamicChildren + ); + } + } + }, + move: moveTeleport, + hydrate: hydrateTeleport +}; +function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) { + if (moveType === 0) { + insert(vnode.targetAnchor, container, parentAnchor); + } + const { el, anchor, shapeFlag, children, props } = vnode; + const isReorder = moveType === 2; + if (isReorder) { + insert(el, container, parentAnchor); + } + if (!pendingMounts.has(vnode) && (!isReorder || isTeleportDisabled(props))) { + if (shapeFlag & 16) { + for (let i = 0; i < children.length; i++) { + move( + children[i], + container, + parentAnchor, + 2 + ); + } + } + } + if (isReorder) { + insert(anchor, container, parentAnchor); + } +} +function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, { + o: { nextSibling, parentNode, querySelector, insert, createText } +}, hydrateChildren) { + function hydrateAnchor(target2, targetNode) { + let targetAnchor = targetNode; + while (targetAnchor) { + if (targetAnchor && targetAnchor.nodeType === 8) { + if (targetAnchor.data === "teleport start anchor") { + vnode.targetStart = targetAnchor; + } else if (targetAnchor.data === "teleport anchor") { + vnode.targetAnchor = targetAnchor; + target2._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor); + break; + } + } + targetAnchor = nextSibling(targetAnchor); + } + } + function hydrateDisabledTeleport(node2, vnode2) { + vnode2.anchor = hydrateChildren( + nextSibling(node2), + vnode2, + parentNode(node2), + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + } + const target = vnode.target = resolveTarget( + vnode.props, + querySelector + ); + const disabled = isTeleportDisabled(vnode.props); + if (target) { + const targetNode = target._lpa || target.firstChild; + if (vnode.shapeFlag & 16) { + if (disabled) { + hydrateDisabledTeleport(node, vnode); + hydrateAnchor(target, targetNode); + if (!vnode.targetAnchor) { + prepareAnchor( + target, + vnode, + createText, + insert, + // if target is the same as the main view, insert anchors before current node + // to avoid hydrating mismatch + parentNode(node) === target ? node : null + ); + } + } else { + vnode.anchor = nextSibling(node); + hydrateAnchor(target, targetNode); + if (!vnode.targetAnchor) { + prepareAnchor(target, vnode, createText, insert); + } + hydrateChildren( + targetNode && nextSibling(targetNode), + vnode, + target, + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + } + } + updateCssVars(vnode, disabled); + } else if (disabled) { + if (vnode.shapeFlag & 16) { + hydrateDisabledTeleport(node, vnode); + vnode.targetStart = node; + vnode.targetAnchor = nextSibling(node); + } + } + return vnode.anchor && nextSibling(vnode.anchor); +} +var Teleport = TeleportImpl; +function updateCssVars(vnode, isDisabled) { + const ctx = vnode.ctx; + if (ctx && ctx.ut) { + let node, anchor; + if (isDisabled) { + node = vnode.el; + anchor = vnode.anchor; + } else { + node = vnode.targetStart; + anchor = vnode.targetAnchor; + } + while (node && node !== anchor) { + if (node.nodeType === 1) node.setAttribute("data-v-owner", ctx.uid); + node = node.nextSibling; + } + ctx.ut(); + } +} +function prepareAnchor(target, vnode, createText, insert, anchor = null) { + const targetStart = vnode.targetStart = createText(""); + const targetAnchor = vnode.targetAnchor = createText(""); + targetStart[TeleportEndKey] = targetAnchor; + if (target) { + insert(targetStart, target, anchor); + insert(targetAnchor, target, anchor); + } + return targetAnchor; +} +var leaveCbKey = Symbol("_leaveCb"); +var enterCbKey = Symbol("_enterCb"); +function useTransitionState() { + const state = { + isMounted: false, + isLeaving: false, + isUnmounting: false, + leavingVNodes: /* @__PURE__ */ new Map() + }; + onMounted(() => { + state.isMounted = true; + }); + onBeforeUnmount(() => { + state.isUnmounting = true; + }); + return state; +} +var TransitionHookValidator = [Function, Array]; +var BaseTransitionPropsValidators = { + mode: String, + appear: Boolean, + persisted: Boolean, + // enter + onBeforeEnter: TransitionHookValidator, + onEnter: TransitionHookValidator, + onAfterEnter: TransitionHookValidator, + onEnterCancelled: TransitionHookValidator, + // leave + onBeforeLeave: TransitionHookValidator, + onLeave: TransitionHookValidator, + onAfterLeave: TransitionHookValidator, + onLeaveCancelled: TransitionHookValidator, + // appear + onBeforeAppear: TransitionHookValidator, + onAppear: TransitionHookValidator, + onAfterAppear: TransitionHookValidator, + onAppearCancelled: TransitionHookValidator +}; +var recursiveGetSubtree = (instance) => { + const subTree = instance.subTree; + return subTree.component ? recursiveGetSubtree(subTree.component) : subTree; +}; +var BaseTransitionImpl = { + name: `BaseTransition`, + props: BaseTransitionPropsValidators, + setup(props, { slots }) { + const instance = getCurrentInstance(); + const state = useTransitionState(); + return () => { + const children = slots.default && getTransitionRawChildren(slots.default(), true); + const child = children && children.length ? findNonCommentChild(children) : ( + // Keep explicit default-slot conditionals on the same transition path + // as regular v-if branches, which render a comment placeholder. + instance.subTree ? createCommentVNode() : void 0 + ); + if (!child) { + return; + } + const rawProps = toRaw(props); + const { mode } = rawProps; + if (mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") { + warn$1(`invalid mode: ${mode}`); + } + if (state.isLeaving) { + return emptyPlaceholder(child); + } + const innerChild = getInnerChild$1(child); + if (!innerChild) { + return emptyPlaceholder(child); + } + let enterHooks = resolveTransitionHooks( + innerChild, + rawProps, + state, + instance, + // #11061, ensure enterHooks is fresh after clone + (hooks) => enterHooks = hooks + ); + if (innerChild.type !== Comment) { + setTransitionHooks(innerChild, enterHooks); + } + let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree); + if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(oldInnerChild, innerChild) && recursiveGetSubtree(instance).type !== Comment) { + let leavingHooks = resolveTransitionHooks( + oldInnerChild, + rawProps, + state, + instance + ); + setTransitionHooks(oldInnerChild, leavingHooks); + if (mode === "out-in" && innerChild.type !== Comment) { + state.isLeaving = true; + leavingHooks.afterLeave = () => { + state.isLeaving = false; + if (!(instance.job.flags & 8)) { + instance.update(); + } + delete leavingHooks.afterLeave; + oldInnerChild = void 0; + }; + return emptyPlaceholder(child); + } else if (mode === "in-out" && innerChild.type !== Comment) { + leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => { + const leavingVNodesCache = getLeavingNodesForType( + state, + oldInnerChild + ); + leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild; + el[leaveCbKey] = () => { + earlyRemove(); + el[leaveCbKey] = void 0; + delete enterHooks.delayedLeave; + oldInnerChild = void 0; + }; + enterHooks.delayedLeave = () => { + delayedLeave(); + delete enterHooks.delayedLeave; + oldInnerChild = void 0; + }; + }; + } else { + oldInnerChild = void 0; + } + } else if (oldInnerChild) { + oldInnerChild = void 0; + } + return child; + }; + } +}; +function findNonCommentChild(children) { + let child = children[0]; + if (children.length > 1) { + let hasFound = false; + for (const c of children) { + if (c.type !== Comment) { + if (hasFound) { + warn$1( + " can only be used on a single element or component. Use for lists." + ); + break; + } + child = c; + hasFound = true; + if (false) break; + } + } + } + return child; +} +var BaseTransition = BaseTransitionImpl; +function getLeavingNodesForType(state, vnode) { + const { leavingVNodes } = state; + let leavingVNodesCache = leavingVNodes.get(vnode.type); + if (!leavingVNodesCache) { + leavingVNodesCache = /* @__PURE__ */ Object.create(null); + leavingVNodes.set(vnode.type, leavingVNodesCache); + } + return leavingVNodesCache; +} +function resolveTransitionHooks(vnode, props, state, instance, postClone) { + const { + appear, + mode, + persisted = false, + onBeforeEnter, + onEnter, + onAfterEnter, + onEnterCancelled, + onBeforeLeave, + onLeave, + onAfterLeave, + onLeaveCancelled, + onBeforeAppear, + onAppear, + onAfterAppear, + onAppearCancelled + } = props; + const key = String(vnode.key); + const leavingVNodesCache = getLeavingNodesForType(state, vnode); + const callHook3 = (hook, args) => { + hook && callWithAsyncErrorHandling( + hook, + instance, + 9, + args + ); + }; + const callAsyncHook = (hook, args) => { + const done = args[1]; + callHook3(hook, args); + if (isArray(hook)) { + if (hook.every((hook2) => hook2.length <= 1)) done(); + } else if (hook.length <= 1) { + done(); + } + }; + const hooks = { + mode, + persisted, + beforeEnter(el) { + let hook = onBeforeEnter; + if (!state.isMounted) { + if (appear) { + hook = onBeforeAppear || onBeforeEnter; + } else { + return; + } + } + if (el[leaveCbKey]) { + el[leaveCbKey]( + true + /* cancelled */ + ); + } + const leavingVNode = leavingVNodesCache[key]; + if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) { + leavingVNode.el[leaveCbKey](); + } + callHook3(hook, [el]); + }, + enter(el) { + if (!isHmrUpdating && leavingVNodesCache[key] === vnode) return; + let hook = onEnter; + let afterHook = onAfterEnter; + let cancelHook = onEnterCancelled; + if (!state.isMounted) { + if (appear) { + hook = onAppear || onEnter; + afterHook = onAfterAppear || onAfterEnter; + cancelHook = onAppearCancelled || onEnterCancelled; + } else { + return; + } + } + let called = false; + el[enterCbKey] = (cancelled) => { + if (called) return; + called = true; + if (cancelled) { + callHook3(cancelHook, [el]); + } else { + callHook3(afterHook, [el]); + } + if (hooks.delayedLeave) { + hooks.delayedLeave(); + } + el[enterCbKey] = void 0; + }; + const done = el[enterCbKey].bind(null, false); + if (hook) { + callAsyncHook(hook, [el, done]); + } else { + done(); + } + }, + leave(el, remove2) { + const key2 = String(vnode.key); + if (el[enterCbKey]) { + el[enterCbKey]( + true + /* cancelled */ + ); + } + if (state.isUnmounting) { + return remove2(); + } + callHook3(onBeforeLeave, [el]); + let called = false; + el[leaveCbKey] = (cancelled) => { + if (called) return; + called = true; + remove2(); + if (cancelled) { + callHook3(onLeaveCancelled, [el]); + } else { + callHook3(onAfterLeave, [el]); + } + el[leaveCbKey] = void 0; + if (leavingVNodesCache[key2] === vnode) { + delete leavingVNodesCache[key2]; + } + }; + const done = el[leaveCbKey].bind(null, false); + leavingVNodesCache[key2] = vnode; + if (onLeave) { + callAsyncHook(onLeave, [el, done]); + } else { + done(); + } + }, + clone(vnode2) { + const hooks2 = resolveTransitionHooks( + vnode2, + props, + state, + instance, + postClone + ); + if (postClone) postClone(hooks2); + return hooks2; + } + }; + return hooks; +} +function emptyPlaceholder(vnode) { + if (isKeepAlive(vnode)) { + vnode = cloneVNode(vnode); + vnode.children = null; + return vnode; + } +} +function getInnerChild$1(vnode) { + if (!isKeepAlive(vnode)) { + if (isTeleport(vnode.type) && vnode.children) { + return findNonCommentChild(vnode.children); + } + return vnode; + } + if (vnode.component) { + return vnode.component.subTree; + } + const { shapeFlag, children } = vnode; + if (children) { + if (shapeFlag & 16) { + return children[0]; + } + if (shapeFlag & 32 && isFunction(children.default)) { + return children.default(); + } + } +} +function setTransitionHooks(vnode, hooks) { + if (vnode.shapeFlag & 6 && vnode.component) { + vnode.transition = hooks; + const subTree = vnode.component.subTree; + setTransitionHooks( + isTeleport(subTree.type) ? getInnerChild$1(subTree) || subTree : subTree, + hooks + ); + } else if (vnode.shapeFlag & 128) { + vnode.ssContent.transition = hooks.clone(vnode.ssContent); + vnode.ssFallback.transition = hooks.clone(vnode.ssFallback); + } else { + vnode.transition = hooks; + } +} +function getTransitionRawChildren(children, keepComment = false, parentKey) { + let ret = []; + let keyedFragmentCount = 0; + for (let i = 0; i < children.length; i++) { + let child = children[i]; + const key = parentKey == null ? child.key : String(parentKey) + String(child.key != null ? child.key : i); + if (child.type === Fragment) { + if (child.patchFlag & 128) keyedFragmentCount++; + ret = ret.concat( + getTransitionRawChildren(child.children, keepComment, key) + ); + } else if (keepComment || child.type !== Comment) { + ret.push(key != null ? cloneVNode(child, { key }) : child); + } + } + if (keyedFragmentCount > 1) { + for (let i = 0; i < ret.length; i++) { + ret[i].patchFlag = -2; + } + } + return ret; +} +function defineComponent(options, extraOptions) { + return isFunction(options) ? ( + // #8236: extend call and options.name access are considered side-effects + // by Rollup, so we have to wrap it in a pure-annotated IIFE. + (() => extend({ name: options.name }, extraOptions, { setup: options }))() + ) : options; +} +function useId() { + const i = getCurrentInstance(); + if (i) { + return (i.appContext.config.idPrefix || "v") + "-" + i.ids[0] + i.ids[1]++; + } else if (true) { + warn$1( + `useId() is called when there is no active component instance to be associated with.` + ); + } + return ""; +} +function markAsyncBoundary(instance) { + instance.ids = [instance.ids[0] + instance.ids[2]++ + "-", 0, 0]; +} +var knownTemplateRefs = /* @__PURE__ */ new WeakSet(); +function useTemplateRef(key) { + const i = getCurrentInstance(); + const r = shallowRef(null); + if (i) { + const refs = i.refs === EMPTY_OBJ ? i.refs = {} : i.refs; + if (isTemplateRefKey(refs, key)) { + warn$1(`useTemplateRef('${key}') already exists.`); + } else { + Object.defineProperty(refs, key, { + enumerable: true, + get: () => r.value, + set: (val) => r.value = val + }); + } + } else if (true) { + warn$1( + `useTemplateRef() is called when there is no active component instance to be associated with.` + ); + } + const ret = true ? readonly(r) : r; + if (true) { + knownTemplateRefs.add(ret); + } + return ret; +} +function isTemplateRefKey(refs, key) { + let desc; + return !!((desc = Object.getOwnPropertyDescriptor(refs, key)) && !desc.configurable); +} +var pendingSetRefMap = /* @__PURE__ */ new WeakMap(); +function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) { + if (isArray(rawRef)) { + rawRef.forEach( + (r, i) => setRef( + r, + oldRawRef && (isArray(oldRawRef) ? oldRawRef[i] : oldRawRef), + parentSuspense, + vnode, + isUnmount + ) + ); + return; + } + if (isAsyncWrapper(vnode) && !isUnmount) { + if (vnode.shapeFlag & 512 && vnode.type.__asyncResolved && vnode.component.subTree.component) { + setRef(rawRef, oldRawRef, parentSuspense, vnode.component.subTree); + } + return; + } + const refValue = vnode.shapeFlag & 4 ? getComponentPublicInstance(vnode.component) : vnode.el; + const value = isUnmount ? null : refValue; + const { i: owner, r: ref2 } = rawRef; + if (!owner) { + warn$1( + `Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function.` + ); + return; + } + const oldRef = oldRawRef && oldRawRef.r; + const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs; + const setupState = owner.setupState; + const rawSetupState = toRaw(setupState); + const canSetSetupRef = setupState === EMPTY_OBJ ? NO : (key) => { + if (true) { + if (hasOwn(rawSetupState, key) && !isRef2(rawSetupState[key])) { + warn$1( + `Template ref "${key}" used on a non-ref value. It will not work in the production build.` + ); + } + if (knownTemplateRefs.has(rawSetupState[key])) { + return false; + } + } + if (isTemplateRefKey(refs, key)) { + return false; + } + return hasOwn(rawSetupState, key); + }; + const canSetRef = (ref22, key) => { + if (knownTemplateRefs.has(ref22)) { + return false; + } + if (key && isTemplateRefKey(refs, key)) { + return false; + } + return true; + }; + if (oldRef != null && oldRef !== ref2) { + invalidatePendingSetRef(oldRawRef); + if (isString(oldRef)) { + refs[oldRef] = null; + if (canSetSetupRef(oldRef)) { + setupState[oldRef] = null; + } + } else if (isRef2(oldRef)) { + const oldRawRefAtom = oldRawRef; + if (canSetRef(oldRef, oldRawRefAtom.k)) { + oldRef.value = null; + } + if (oldRawRefAtom.k) refs[oldRawRefAtom.k] = null; + } + } + if (isFunction(ref2)) { + callWithErrorHandling(ref2, owner, 12, [value, refs]); + } else { + const _isString = isString(ref2); + const _isRef = isRef2(ref2); + if (_isString || _isRef) { + const doSet = () => { + if (rawRef.f) { + const existing = _isString ? canSetSetupRef(ref2) ? setupState[ref2] : refs[ref2] : canSetRef(ref2) || !rawRef.k ? ref2.value : refs[rawRef.k]; + if (isUnmount) { + isArray(existing) && remove(existing, refValue); + } else { + if (!isArray(existing)) { + if (_isString) { + refs[ref2] = [refValue]; + if (canSetSetupRef(ref2)) { + setupState[ref2] = refs[ref2]; + } + } else { + const newVal = [refValue]; + if (canSetRef(ref2, rawRef.k)) { + ref2.value = newVal; + } + if (rawRef.k) refs[rawRef.k] = newVal; + } + } else if (!existing.includes(refValue)) { + existing.push(refValue); + } + } + } else if (_isString) { + refs[ref2] = value; + if (canSetSetupRef(ref2)) { + setupState[ref2] = value; + } + } else if (_isRef) { + if (canSetRef(ref2, rawRef.k)) { + ref2.value = value; + } + if (rawRef.k) refs[rawRef.k] = value; + } else if (true) { + warn$1("Invalid template ref type:", ref2, `(${typeof ref2})`); + } + }; + if (value) { + const job = () => { + doSet(); + pendingSetRefMap.delete(rawRef); + }; + job.id = -1; + pendingSetRefMap.set(rawRef, job); + queuePostRenderEffect(job, parentSuspense); + } else { + invalidatePendingSetRef(rawRef); + doSet(); + } + } else if (true) { + warn$1("Invalid template ref type:", ref2, `(${typeof ref2})`); + } + } +} +function invalidatePendingSetRef(rawRef) { + const pendingSetRef = pendingSetRefMap.get(rawRef); + if (pendingSetRef) { + pendingSetRef.flags |= 8; + pendingSetRefMap.delete(rawRef); + } +} +var hasLoggedMismatchError = false; +var logMismatchError = () => { + if (hasLoggedMismatchError) { + return; + } + console.error("Hydration completed but contains mismatches."); + hasLoggedMismatchError = true; +}; +var isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject"; +var isMathMLContainer = (container) => container.namespaceURI.includes("MathML"); +var getContainerType = (container) => { + if (container.nodeType !== 1) return void 0; + if (isSVGContainer(container)) return "svg"; + if (isMathMLContainer(container)) return "mathml"; + return void 0; +}; +var isComment = (node) => node.nodeType === 8; +function createHydrationFunctions(rendererInternals) { + const { + mt: mountComponent, + p: patch, + o: { + patchProp: patchProp2, + createText, + nextSibling, + parentNode, + remove: remove2, + insert, + createComment + } + } = rendererInternals; + const hydrate2 = (vnode, container) => { + if (!container.hasChildNodes()) { + warn$1( + `Attempting to hydrate existing markup but container is empty. Performing full mount instead.` + ); + patch(null, vnode, container); + flushPostFlushCbs(); + container._vnode = vnode; + return; + } + hydrateNode(container.firstChild, vnode, null, null, null); + flushPostFlushCbs(); + container._vnode = vnode; + }; + const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => { + optimized = optimized || !!vnode.dynamicChildren; + const isFragmentStart = isComment(node) && node.data === "["; + const onMismatch = () => handleMismatch( + node, + vnode, + parentComponent, + parentSuspense, + slotScopeIds, + isFragmentStart + ); + const { type, ref: ref2, shapeFlag, patchFlag } = vnode; + let domType = node.nodeType; + vnode.el = node; + if (true) { + def(node, "__vnode", vnode, true); + def(node, "__vueParentComponent", parentComponent, true); + } + if (patchFlag === -2) { + optimized = false; + vnode.dynamicChildren = null; + } + let nextNode = null; + switch (type) { + case Text: + if (domType !== 3) { + if (vnode.children === "") { + insert(vnode.el = createText(""), parentNode(node), node); + nextNode = node; + } else { + nextNode = onMismatch(); + } + } else { + if (node.data !== vnode.children) { + warn$1( + `Hydration text mismatch in`, + node.parentNode, + ` + - rendered on server: ${JSON.stringify( + node.data + )} + - expected on client: ${JSON.stringify(vnode.children)}` + ); + logMismatchError(); + node.data = vnode.children; + } + nextNode = nextSibling(node); + } + break; + case Comment: + if (isTemplateNode(node)) { + nextNode = nextSibling(node); + replaceNode( + vnode.el = node.content.firstChild, + node, + parentComponent + ); + } else if (domType !== 8 || isFragmentStart) { + nextNode = onMismatch(); + } else { + nextNode = nextSibling(node); + } + break; + case Static: + if (isFragmentStart) { + node = nextSibling(node); + domType = node.nodeType; + } + if (domType === 1 || domType === 3) { + nextNode = node; + const needToAdoptContent = !vnode.children.length; + for (let i = 0; i < vnode.staticCount; i++) { + if (needToAdoptContent) + vnode.children += nextNode.nodeType === 1 ? nextNode.outerHTML : nextNode.data; + if (i === vnode.staticCount - 1) { + vnode.anchor = nextNode; + } + nextNode = nextSibling(nextNode); + } + return isFragmentStart ? nextSibling(nextNode) : nextNode; + } else { + onMismatch(); + } + break; + case Fragment: + if (!isFragmentStart) { + nextNode = onMismatch(); + } else { + nextNode = hydrateFragment( + node, + vnode, + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + } + break; + default: + if (shapeFlag & 1) { + if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) { + nextNode = onMismatch(); + } else { + nextNode = hydrateElement( + node, + vnode, + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + } + } else if (shapeFlag & 6) { + vnode.slotScopeIds = slotScopeIds; + const container = parentNode(node); + if (isFragmentStart) { + nextNode = locateClosingAnchor(node); + } else if (isComment(node) && node.data === "teleport start") { + nextNode = locateClosingAnchor(node, node.data, "teleport end"); + } else { + nextNode = nextSibling(node); + } + mountComponent( + vnode, + container, + null, + parentComponent, + parentSuspense, + getContainerType(container), + optimized + ); + if ((isAsyncWrapper(vnode) || vnode.component.asyncDep) && !vnode.component.subTree) { + let subTree; + if (isFragmentStart) { + subTree = createVNode(Static); + subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild; + } else { + subTree = node.nodeType === 3 ? createTextVNode("") : createVNode( + node.nodeType === 8 ? Comment : "div" + ); + } + subTree.el = node; + vnode.component.subTree = subTree; + } + } else if (shapeFlag & 64) { + if (domType !== 8) { + nextNode = onMismatch(); + } else { + nextNode = vnode.type.hydrate( + node, + vnode, + parentComponent, + parentSuspense, + slotScopeIds, + optimized, + rendererInternals, + hydrateChildren + ); + } + } else if (shapeFlag & 128) { + nextNode = vnode.type.hydrate( + node, + vnode, + parentComponent, + parentSuspense, + getContainerType(parentNode(node)), + slotScopeIds, + optimized, + rendererInternals, + hydrateNode + ); + } else if (true) { + warn$1("Invalid HostVNode type:", type, `(${typeof type})`); + } + } + if (ref2 != null) { + setRef(ref2, null, parentSuspense, vnode); + } + return nextNode; + }; + const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => { + optimized = optimized || !!vnode.dynamicChildren; + const { + type, + dynamicProps, + props, + patchFlag, + shapeFlag, + dirs, + transition + } = vnode; + const forcePatch = type === "input" || type === "option"; + const hasDynamicProps = !!dynamicProps; + if (true) { + if (dirs) { + invokeDirectiveHook(vnode, null, parentComponent, "created"); + } + let needCallTransitionHooks = false; + if (isTemplateNode(el)) { + needCallTransitionHooks = needTransition( + null, + // no need check parentSuspense in hydration + transition + ) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear; + const content = el.content.firstChild; + if (needCallTransitionHooks) { + const cls = content.getAttribute("class"); + if (cls) content.$cls = cls; + transition.beforeEnter(content); + } + replaceNode(content, el, parentComponent); + vnode.el = el = content; + } + if (shapeFlag & 16 && // skip if element has innerHTML / textContent + !(props && (props.innerHTML || props.textContent))) { + let next = hydrateChildren( + el.firstChild, + vnode, + el, + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + if (next && !isMismatchAllowed( + el, + 1 + /* CHILDREN */ + )) { + warn$1( + `Hydration children mismatch on`, + el, + ` +Server rendered element contains more child nodes than client vdom.` + ); + logMismatchError(); + } + while (next) { + const cur = next; + next = next.nextSibling; + remove2(cur); + } + } else if (shapeFlag & 8) { + let clientText = vnode.children; + if (clientText[0] === "\n" && (el.tagName === "PRE" || el.tagName === "TEXTAREA")) { + clientText = clientText.slice(1); + } + const { textContent } = el; + if (textContent !== clientText && // innerHTML normalize \r\n or \r into a single \n in the DOM + textContent !== clientText.replace(/\r\n|\r/g, "\n")) { + if (!isMismatchAllowed( + el, + 0 + /* TEXT */ + )) { + warn$1( + `Hydration text content mismatch on`, + el, + ` + - rendered on server: ${textContent} + - expected on client: ${clientText}` + ); + logMismatchError(); + } + el.textContent = vnode.children; + } + } + if (props) { + if (true) { + const isCustomElement = el.tagName.includes("-"); + const namespace = el.namespaceURI.includes("svg") ? "svg" : el.namespaceURI.includes("MathML") ? "mathml" : void 0; + for (const key in props) { + if (// #11189 skip if this node has directives that have created hooks + // as it could have mutated the DOM in any possible way + !(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) { + logMismatchError(); + } + if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers + key[0] === "." || isCustomElement && !isReservedProp(key) || dynamicProps && dynamicProps.includes(key)) { + if (isUnchangedResourceProp(el, key, props[key])) { + continue; + } + patchProp2(el, key, null, props[key], namespace, parentComponent); + } + } + } else if (props.onClick) { + patchProp2( + el, + "onClick", + null, + props.onClick, + void 0, + parentComponent + ); + } else if (patchFlag & 4 && isReactive(props.style)) { + for (const key in props.style) props.style[key]; + } + } + let vnodeHooks; + if (vnodeHooks = props && props.onVnodeBeforeMount) { + invokeVNodeHook(vnodeHooks, parentComponent, vnode); + } + if (dirs) { + invokeDirectiveHook(vnode, null, parentComponent, "beforeMount"); + } + if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) { + queueEffectWithSuspense(() => { + vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode); + needCallTransitionHooks && transition.enter(el); + dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted"); + }, parentSuspense); + } + } + return el.nextSibling; + }; + const hydrateChildren = (node, parentVNode, container, parentComponent, parentSuspense, slotScopeIds, optimized) => { + optimized = optimized || !!parentVNode.dynamicChildren; + const children = parentVNode.children; + const l = children.length; + let hasCheckedMismatch = false; + for (let i = 0; i < l; i++) { + const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]); + const isText = vnode.type === Text; + if (node) { + if (isText && !optimized) { + if (i + 1 < l && normalizeVNode(children[i + 1]).type === Text) { + insert( + createText( + node.data.slice(vnode.children.length) + ), + container, + nextSibling(node) + ); + node.data = vnode.children; + } + } + node = hydrateNode( + node, + vnode, + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + } else if (isText && !vnode.children) { + insert(vnode.el = createText(""), container); + } else { + if (!hasCheckedMismatch) { + hasCheckedMismatch = true; + if (!isMismatchAllowed( + container, + 1 + /* CHILDREN */ + )) { + warn$1( + `Hydration children mismatch on`, + container, + ` +Server rendered element contains fewer child nodes than client vdom.` + ); + logMismatchError(); + } + } + patch( + null, + vnode, + container, + null, + parentComponent, + parentSuspense, + getContainerType(container), + slotScopeIds + ); + } + } + return node; + }; + const hydrateFragment = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => { + const { slotScopeIds: fragmentSlotScopeIds } = vnode; + if (fragmentSlotScopeIds) { + slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds; + } + const container = parentNode(node); + const next = hydrateChildren( + nextSibling(node), + vnode, + container, + parentComponent, + parentSuspense, + slotScopeIds, + optimized + ); + if (next && isComment(next) && next.data === "]") { + return nextSibling(vnode.anchor = next); + } else { + logMismatchError(); + insert(vnode.anchor = createComment(`]`), container, next); + return next; + } + }; + const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => { + if (!isNodeMismatchAllowed(node, vnode)) { + warn$1( + `Hydration node mismatch: +- rendered on server:`, + node, + node.nodeType === 3 ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``, + ` +- expected on client:`, + vnode.type + ); + logMismatchError(); + } + vnode.el = null; + if (isFragment) { + const end = locateClosingAnchor(node); + while (true) { + const next2 = nextSibling(node); + if (next2 && next2 !== end) { + remove2(next2); + } else { + break; + } + } + } + const next = nextSibling(node); + const container = parentNode(node); + remove2(node); + patch( + null, + vnode, + container, + next, + parentComponent, + parentSuspense, + getContainerType(container), + slotScopeIds + ); + if (parentComponent) { + parentComponent.vnode.el = vnode.el; + updateHOCHostEl(parentComponent, vnode.el); + } + return next; + }; + const locateClosingAnchor = (node, open = "[", close = "]") => { + let match = 0; + while (node) { + node = nextSibling(node); + if (node && isComment(node)) { + if (node.data === open) match++; + if (node.data === close) { + if (match === 0) { + return nextSibling(node); + } else { + match--; + } + } + } + } + return node; + }; + const replaceNode = (newNode, oldNode, parentComponent) => { + const parentNode2 = oldNode.parentNode; + if (parentNode2) { + parentNode2.replaceChild(newNode, oldNode); + } + let parent = parentComponent; + while (parent) { + if (parent.vnode.el === oldNode) { + parent.vnode.el = parent.subTree.el = newNode; + } + parent = parent.parent; + } + }; + const isTemplateNode = (node) => { + return node.nodeType === 1 && node.tagName === "TEMPLATE"; + }; + return [hydrate2, hydrateNode]; +} +var resourceProps = /* @__PURE__ */ new Set(["src", "srcset", "href", "poster"]); +function isUnchangedResourceProp(el, key, clientValue) { + if (!resourceProps.has(key)) { + return false; + } + return el.getAttribute(key) === (clientValue == null ? null : `${clientValue}`); +} +function propHasMismatch(el, key, clientValue, vnode, instance) { + let mismatchType; + let mismatchKey; + let actual; + let expected; + if (key === "class") { + if (el.$cls) { + actual = el.$cls; + delete el.$cls; + } else { + actual = el.getAttribute("class"); + } + expected = normalizeClass(clientValue); + if (!isSetEqual(toClassSet(actual || ""), toClassSet(expected))) { + mismatchType = 2; + mismatchKey = `class`; + } + } else if (key === "style") { + actual = el.getAttribute("style") || ""; + expected = isString(clientValue) ? clientValue : stringifyStyle(normalizeStyle(clientValue)); + const actualMap = toStyleMap(actual); + const expectedMap = toStyleMap(expected); + if (vnode.dirs) { + for (const { dir, value } of vnode.dirs) { + if (dir.name === "show" && !value) { + expectedMap.set("display", "none"); + } + } + } + if (instance) { + resolveCssVars(instance, vnode, expectedMap); + } + if (!isMapEqual(actualMap, expectedMap)) { + mismatchType = 3; + mismatchKey = "style"; + } + } else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) { + if (key === "hidden") { + actual = normalizeHiddenValue(el.getAttribute(key)); + expected = normalizeHiddenValue(clientValue); + } else if (isBooleanAttr(key)) { + actual = el.hasAttribute(key); + expected = includeBooleanAttr(clientValue); + } else if (clientValue == null) { + actual = el.hasAttribute(key); + expected = false; + } else { + if (el.hasAttribute(key)) { + actual = el.getAttribute(key); + } else if (key === "value" && el.tagName === "TEXTAREA") { + actual = el.value; + } else { + actual = false; + } + expected = isRenderableAttrValue(clientValue) ? String(clientValue) : false; + } + if (actual !== expected) { + mismatchType = 4; + mismatchKey = key; + } + } + if (mismatchType != null && !isMismatchAllowed(el, mismatchType)) { + const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`; + const preSegment = `Hydration ${MismatchTypeString[mismatchType]} mismatch on`; + const postSegment = ` + - rendered on server: ${format(actual)} + - expected on client: ${format(expected)} + Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead. + You should fix the source of the mismatch.`; + { + warn$1(preSegment, el, postSegment); + } + return true; + } + return false; +} +function normalizeHiddenValue(value) { + if (!isRenderableAttrValue(value)) { + return false; + } + if (isString(value)) { + return value.toLowerCase() === "until-found" ? "until-found" : ""; + } + return includeBooleanAttr(value) ? "" : false; +} +function toClassSet(str) { + return new Set(str.trim().split(/\s+/)); +} +function isSetEqual(a, b) { + if (a.size !== b.size) { + return false; + } + for (const s of a) { + if (!b.has(s)) { + return false; + } + } + return true; +} +function toStyleMap(str) { + const styleMap = /* @__PURE__ */ new Map(); + for (const item of str.split(";")) { + let [key, value] = item.split(":"); + key = key.trim(); + value = value && value.trim(); + if (key && value) { + styleMap.set(key, value); + } + } + return styleMap; +} +function isMapEqual(a, b) { + if (a.size !== b.size) { + return false; + } + for (const [key, value] of a) { + if (value !== b.get(key)) { + return false; + } + } + return true; +} +function resolveCssVars(instance, vnode, expectedMap) { + const root = instance.subTree; + if (instance.getCssVars && (vnode === root || root && root.type === Fragment && root.children.includes(vnode))) { + const cssVars = instance.getCssVars(); + for (const key in cssVars) { + const value = normalizeCssVarValue(cssVars[key]); + expectedMap.set(`--${getEscapedCssVarName(key, false)}`, value); + } + } + if (vnode === root && instance.parent) { + resolveCssVars(instance.parent, instance.vnode, expectedMap); + } +} +var allowMismatchAttr = "data-allow-mismatch"; +var MismatchTypeString = { + [ + 0 + /* TEXT */ + ]: "text", + [ + 1 + /* CHILDREN */ + ]: "children", + [ + 2 + /* CLASS */ + ]: "class", + [ + 3 + /* STYLE */ + ]: "style", + [ + 4 + /* ATTRIBUTE */ + ]: "attribute" +}; +function isMismatchAllowed(el, allowedType) { + if (allowedType === 0 || allowedType === 1) { + while (el && !el.hasAttribute(allowMismatchAttr)) { + el = el.parentElement; + } + } + return isMismatchAllowedByAttr( + el && el.getAttribute(allowMismatchAttr), + allowedType + ); +} +function isMismatchAllowedByAttr(allowedAttr, allowedType) { + if (allowedAttr == null) { + return false; + } else if (allowedAttr === "") { + return true; + } else { + const list = allowedAttr.split(","); + if (allowedType === 0 && list.includes("children")) { + return true; + } + return list.includes(MismatchTypeString[allowedType]); + } +} +function isNodeMismatchAllowed(node, vnode) { + return isMismatchAllowed( + node.parentElement, + 1 + /* CHILDREN */ + ) || isMismatchAllowedByNode(node) || isMismatchAllowedByVNode(vnode); +} +function isMismatchAllowedByNode(node) { + return node.nodeType === 1 && isMismatchAllowedByAttr( + node.getAttribute(allowMismatchAttr), + 1 + /* CHILDREN */ + ); +} +function isMismatchAllowedByVNode({ props }) { + const allowedAttr = props && props[allowMismatchAttr]; + return typeof allowedAttr === "string" && isMismatchAllowedByAttr( + allowedAttr, + 1 + /* CHILDREN */ + ); +} +var requestIdleCallback = getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1)); +var cancelIdleCallback = getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id)); +var hydrateOnIdle = (timeout = 1e4) => (hydrate2) => { + const id = requestIdleCallback(hydrate2, { timeout }); + return () => cancelIdleCallback(id); +}; +function elementIsVisibleInViewport(el) { + const { top, left, bottom, right } = el.getBoundingClientRect(); + const { innerHeight, innerWidth } = window; + return (top > 0 && top < innerHeight || bottom > 0 && bottom < innerHeight) && (left > 0 && left < innerWidth || right > 0 && right < innerWidth); +} +var hydrateOnVisible = (opts) => (hydrate2, forEach) => { + const ob = new IntersectionObserver((entries) => { + for (const e of entries) { + if (!e.isIntersecting) continue; + ob.disconnect(); + hydrate2(); + break; + } + }, opts); + forEach((el) => { + if (!(el instanceof Element)) return; + if (elementIsVisibleInViewport(el)) { + hydrate2(); + ob.disconnect(); + return false; + } + ob.observe(el); + }); + return () => ob.disconnect(); +}; +var hydrateOnMediaQuery = (query) => (hydrate2) => { + if (query) { + const mql = matchMedia(query); + if (mql.matches) { + hydrate2(); + } else { + mql.addEventListener("change", hydrate2, { once: true }); + return () => mql.removeEventListener("change", hydrate2); + } + } +}; +var hydrateOnInteraction = (interactions = []) => (hydrate2, forEach) => { + if (isString(interactions)) interactions = [interactions]; + let hasHydrated = false; + const doHydrate = (e) => { + if (!hasHydrated) { + hasHydrated = true; + teardown(); + hydrate2(); + e.target.dispatchEvent(new e.constructor(e.type, e)); + } + }; + const teardown = () => { + forEach((el) => { + for (const i of interactions) { + el.removeEventListener(i, doHydrate); + } + }); + }; + forEach((el) => { + for (const i of interactions) { + el.addEventListener(i, doHydrate, { once: true }); + } + }); + return teardown; +}; +function forEachElement(node, cb) { + if (isComment(node) && node.data === "[") { + let depth = 1; + let next = node.nextSibling; + while (next) { + if (next.nodeType === 1) { + const result = cb(next); + if (result === false) { + break; + } + } else if (isComment(next)) { + if (next.data === "]") { + if (--depth === 0) break; + } else if (next.data === "[") { + depth++; + } + } + next = next.nextSibling; + } + } else { + cb(node); + } +} +var isAsyncWrapper = (i) => !!i.type.__asyncLoader; +function defineAsyncComponent(source) { + if (isFunction(source)) { + source = { loader: source }; + } + const { + loader, + loadingComponent, + errorComponent, + delay = 200, + hydrate: hydrateStrategy, + timeout, + // undefined = never times out + suspensible = true, + onError: userOnError + } = source; + let pendingRequest = null; + let resolvedComp; + let retries = 0; + const retry = () => { + retries++; + pendingRequest = null; + return load(); + }; + const load = () => { + let thisRequest; + return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => { + err = err instanceof Error ? err : new Error(String(err)); + if (userOnError) { + return new Promise((resolve2, reject) => { + const userRetry = () => resolve2(retry()); + const userFail = () => reject(err); + userOnError(err, userRetry, userFail, retries + 1); + }); + } else { + throw err; + } + }).then((comp) => { + if (thisRequest !== pendingRequest && pendingRequest) { + return pendingRequest; + } + if (!comp) { + warn$1( + `Async component loader resolved to undefined. If you are using retry(), make sure to return its return value.` + ); + } + if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) { + comp = comp.default; + } + if (comp && !isObject(comp) && !isFunction(comp)) { + throw new Error(`Invalid async component load result: ${comp}`); + } + resolvedComp = comp; + return comp; + })); + }; + return defineComponent({ + name: "AsyncComponentWrapper", + __asyncLoader: load, + __asyncHydrate(el, instance, hydrate2) { + const wasConnected = el.isConnected; + let patched = false; + (instance.bu || (instance.bu = [])).push(() => patched = true); + const performHydrate = () => { + if (patched) { + if (true) { + warn$1( + `Skipping lazy hydration for component '${getComponentName(resolvedComp) || resolvedComp.__file}': it was updated before lazy hydration performed.` + ); + } + return; + } + if (!el.parentNode || wasConnected && !el.isConnected) return; + hydrate2(); + }; + const doHydrate = hydrateStrategy ? () => { + const teardown = hydrateStrategy( + performHydrate, + (cb) => forEachElement(el, cb) + ); + if (teardown) { + (instance.bum || (instance.bum = [])).push(teardown); + } + } : performHydrate; + if (resolvedComp) { + doHydrate(); + } else { + load().then(() => !instance.isUnmounted && doHydrate()); + } + }, + get __asyncResolved() { + return resolvedComp; + }, + setup() { + const instance = currentInstance; + markAsyncBoundary(instance); + if (resolvedComp) { + return () => createInnerComp(resolvedComp, instance); + } + const onError = (err) => { + pendingRequest = null; + handleError( + err, + instance, + 13, + !errorComponent + ); + }; + if (suspensible && instance.suspense || isInSSRComponentSetup) { + return load().then((comp) => { + return () => createInnerComp(comp, instance); + }).catch((err) => { + onError(err); + return () => errorComponent ? createVNode(errorComponent, { + error: err + }) : null; + }); + } + const loaded = ref(false); + const error = ref(); + const delayed = ref(!!delay); + let timeoutTimer; + let delayTimer; + onUnmounted(() => { + if (timeoutTimer != null) clearTimeout(timeoutTimer); + if (delayTimer != null) clearTimeout(delayTimer); + }); + if (delay) { + delayTimer = setTimeout(() => { + if (instance.isUnmounted) return; + delayed.value = false; + }, delay); + } + if (timeout != null) { + timeoutTimer = setTimeout(() => { + if (instance.isUnmounted) return; + if (!loaded.value && !error.value) { + const err = new Error( + `Async component timed out after ${timeout}ms.` + ); + onError(err); + error.value = err; + } + }, timeout); + } + load().then(() => { + if (instance.isUnmounted) return; + loaded.value = true; + if (instance.parent && isKeepAlive(instance.parent.vnode)) { + instance.parent.update(); + } + }).catch((err) => { + if (instance.isUnmounted) { + pendingRequest = null; + return; + } + onError(err); + error.value = err; + }); + return () => { + if (loaded.value && resolvedComp) { + return createInnerComp(resolvedComp, instance); + } else if (error.value && errorComponent) { + return createVNode(errorComponent, { + error: error.value + }); + } else if (loadingComponent && !delayed.value) { + return createInnerComp( + loadingComponent, + instance + ); + } + }; + } + }); +} +function createInnerComp(comp, parent) { + const { ref: ref2, props, children, ce } = parent.vnode; + const vnode = createVNode(comp, props, children); + vnode.ref = ref2; + vnode.ce = ce; + delete parent.vnode.ce; + return vnode; +} +var isKeepAlive = (vnode) => vnode.type.__isKeepAlive; +var KeepAliveImpl = { + name: `KeepAlive`, + // Marker for special handling inside the renderer. We are not using a === + // check directly on KeepAlive in the renderer, because importing it directly + // would prevent it from being tree-shaken. + __isKeepAlive: true, + props: { + include: [String, RegExp, Array], + exclude: [String, RegExp, Array], + max: [String, Number] + }, + setup(props, { slots }) { + const instance = getCurrentInstance(); + const sharedContext = instance.ctx; + if (!sharedContext.renderer) { + return () => { + const children = slots.default && slots.default(); + return children && children.length === 1 ? children[0] : children; + }; + } + const cache = /* @__PURE__ */ new Map(); + const keys = /* @__PURE__ */ new Set(); + let current = null; + if (true) { + instance.__v_cache = cache; + } + const parentSuspense = instance.suspense; + const { + renderer: { + p: patch, + m: move, + um: _unmount, + o: { createElement } + } + } = sharedContext; + const storageContainer = createElement("div"); + sharedContext.activate = (vnode, container, anchor, namespace, optimized) => { + const instance2 = vnode.component; + move(vnode, container, anchor, 0, parentSuspense); + patch( + instance2.vnode, + vnode, + container, + anchor, + instance2, + parentSuspense, + namespace, + vnode.slotScopeIds, + optimized + ); + queuePostRenderEffect(() => { + instance2.isDeactivated = false; + if (instance2.a) { + invokeArrayFns(instance2.a); + } + const vnodeHook = vnode.props && vnode.props.onVnodeMounted; + if (vnodeHook) { + invokeVNodeHook(vnodeHook, instance2.parent, vnode); + } + }, parentSuspense); + if (true) { + devtoolsComponentAdded(instance2); + } + }; + sharedContext.deactivate = (vnode) => { + const instance2 = vnode.component; + invalidateMount(instance2.m); + invalidateMount(instance2.a); + move(vnode, storageContainer, null, 1, parentSuspense); + queuePostRenderEffect(() => { + if (instance2.da) { + invokeArrayFns(instance2.da); + } + const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted; + if (vnodeHook) { + invokeVNodeHook(vnodeHook, instance2.parent, vnode); + } + instance2.isDeactivated = true; + }, parentSuspense); + if (true) { + devtoolsComponentAdded(instance2); + } + if (true) { + instance2.__keepAliveStorageContainer = storageContainer; + } + }; + function unmount(vnode) { + resetShapeFlag(vnode); + _unmount(vnode, instance, parentSuspense, true); + } + function pruneCache(filter) { + cache.forEach((vnode, key) => { + const name = getComponentName( + isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : vnode.type + ); + if (name && !filter(name)) { + pruneCacheEntry(key); + } + }); + } + function pruneCacheEntry(key) { + const cached = cache.get(key); + if (cached && (!current || !isSameVNodeType(cached, current))) { + unmount(cached); + } else if (current) { + resetShapeFlag(current); + } + cache.delete(key); + keys.delete(key); + } + watch2( + () => [props.include, props.exclude], + ([include, exclude]) => { + include && pruneCache((name) => matches(include, name)); + exclude && pruneCache((name) => !matches(exclude, name)); + }, + // prune post-render after `current` has been updated + { flush: "post", deep: true } + ); + let pendingCacheKey = null; + const cacheSubtree = () => { + if (pendingCacheKey != null) { + if (isSuspense(instance.subTree.type)) { + queuePostRenderEffect(() => { + const vnode = getInnerChild(instance.subTree); + if (vnode.component) { + cache.set(pendingCacheKey, vnode); + } + }, instance.subTree.suspense); + } else { + cache.set(pendingCacheKey, getInnerChild(instance.subTree)); + } + } + }; + onMounted(cacheSubtree); + onUpdated(cacheSubtree); + onBeforeUnmount(() => { + cache.forEach((cached) => { + const { subTree, suspense } = instance; + const vnode = getInnerChild(subTree); + if (cached.type === vnode.type && cached.key === vnode.key) { + resetShapeFlag(vnode); + const da = vnode.component.da; + da && queuePostRenderEffect(da, suspense); + return; + } + unmount(cached); + }); + }); + return () => { + pendingCacheKey = null; + if (!slots.default) { + return current = null; + } + const children = slots.default(); + const rawVNode = children[0]; + if (children.length > 1) { + if (true) { + warn$1(`KeepAlive should contain exactly one component child.`); + } + current = null; + return children; + } else if (!isVNode(rawVNode) || !(rawVNode.shapeFlag & 4) && !(rawVNode.shapeFlag & 128)) { + current = null; + return rawVNode; + } + let vnode = getInnerChild(rawVNode); + if (vnode.type === Comment) { + current = null; + return vnode; + } + const comp = vnode.type; + const name = getComponentName( + isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : comp + ); + const { include, exclude, max } = props; + if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) { + vnode.shapeFlag &= -257; + current = vnode; + return rawVNode; + } + const key = vnode.key == null ? comp : vnode.key; + const cachedVNode = cache.get(key); + if (vnode.el) { + vnode = cloneVNode(vnode); + if (rawVNode.shapeFlag & 128) { + rawVNode.ssContent = vnode; + } + } + pendingCacheKey = key; + if (cachedVNode) { + vnode.el = cachedVNode.el; + vnode.component = cachedVNode.component; + if (vnode.transition) { + setTransitionHooks(vnode, vnode.transition); + } + vnode.shapeFlag |= 512; + keys.delete(key); + keys.add(key); + } else { + keys.add(key); + if (max && keys.size > parseInt(max, 10)) { + pruneCacheEntry(keys.values().next().value); + } + } + vnode.shapeFlag |= 256; + current = vnode; + return isSuspense(rawVNode.type) ? rawVNode : vnode; + }; + } +}; +var KeepAlive = KeepAliveImpl; +function matches(pattern, name) { + if (isArray(pattern)) { + return pattern.some((p2) => matches(p2, name)); + } else if (isString(pattern)) { + return pattern.split(",").includes(name); + } else if (isRegExp(pattern)) { + pattern.lastIndex = 0; + return pattern.test(name); + } + return false; +} +function onActivated(hook, target) { + registerKeepAliveHook(hook, "a", target); +} +function onDeactivated(hook, target) { + registerKeepAliveHook(hook, "da", target); +} +function registerKeepAliveHook(hook, type, target = currentInstance) { + const wrappedHook = hook.__wdc || (hook.__wdc = () => { + let current = target; + while (current) { + if (current.isDeactivated) { + return; + } + current = current.parent; + } + return hook(); + }); + injectHook(type, wrappedHook, target); + if (target) { + let current = target.parent; + while (current && current.parent) { + if (isKeepAlive(current.parent.vnode)) { + injectToKeepAliveRoot(wrappedHook, type, target, current); + } + current = current.parent; + } + } +} +function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) { + const injected = injectHook( + type, + hook, + keepAliveRoot, + true + /* prepend */ + ); + onUnmounted(() => { + remove(keepAliveRoot[type], injected); + }, target); +} +function resetShapeFlag(vnode) { + vnode.shapeFlag &= -257; + vnode.shapeFlag &= -513; +} +function getInnerChild(vnode) { + return vnode.shapeFlag & 128 ? vnode.ssContent : vnode; +} +function injectHook(type, hook, target = currentInstance, prepend = false) { + if (target) { + const hooks = target[type] || (target[type] = []); + const wrappedHook = hook.__weh || (hook.__weh = (...args) => { + pauseTracking(); + const reset = setCurrentInstance(target); + const res = callWithAsyncErrorHandling(hook, target, type, args); + reset(); + resetTracking(); + return res; + }); + if (prepend) { + hooks.unshift(wrappedHook); + } else { + hooks.push(wrappedHook); + } + return wrappedHook; + } else if (true) { + const apiName = toHandlerKey(ErrorTypeStrings$1[type].replace(/ hook$/, "")); + warn$1( + `${apiName} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.` + ); + } +} +var createHook = (lifecycle) => (hook, target = currentInstance) => { + if (!isInSSRComponentSetup || lifecycle === "sp") { + injectHook(lifecycle, (...args) => hook(...args), target); + } +}; +var onBeforeMount = createHook("bm"); +var onMounted = createHook("m"); +var onBeforeUpdate = createHook( + "bu" +); +var onUpdated = createHook("u"); +var onBeforeUnmount = createHook( + "bum" +); +var onUnmounted = createHook("um"); +var onServerPrefetch = createHook( + "sp" +); +var onRenderTriggered = createHook("rtg"); +var onRenderTracked = createHook("rtc"); +function onErrorCaptured(hook, target = currentInstance) { + injectHook("ec", hook, target); +} +var COMPONENTS = "components"; +var DIRECTIVES = "directives"; +function resolveComponent(name, maybeSelfReference) { + return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name; +} +var NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc"); +function resolveDynamicComponent(component) { + if (isString(component)) { + return resolveAsset(COMPONENTS, component, false) || component; + } else { + return component || NULL_DYNAMIC_COMPONENT; + } +} +function resolveDirective(name) { + return resolveAsset(DIRECTIVES, name); +} +function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) { + const instance = currentRenderingInstance || currentInstance; + if (instance) { + const Component = instance.type; + if (type === COMPONENTS) { + const selfName = getComponentName( + Component, + false + ); + if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) { + return Component; + } + } + const res = ( + // local registration + // check instance[type] first which is resolved for options API + resolve(instance[type] || Component[type], name) || // global registration + resolve(instance.appContext[type], name) + ); + if (!res && maybeSelfReference) { + return Component; + } + if (warnMissing && !res) { + const extra = type === COMPONENTS ? ` +If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``; + warn$1(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`); + } + return res; + } else if (true) { + warn$1( + `resolve${capitalize(type.slice(0, -1))} can only be used in render() or setup().` + ); + } +} +function resolve(registry, name) { + return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]); +} +function renderList(source, renderItem, cache, index) { + let ret; + const cached = cache && cache[index]; + const sourceIsArray = isArray(source); + if (sourceIsArray || isString(source)) { + const sourceIsReactiveArray = sourceIsArray && isReactive(source); + let needsWrap = false; + let isReadonlySource = false; + if (sourceIsReactiveArray) { + needsWrap = !isShallow(source); + isReadonlySource = isReadonly(source); + source = shallowReadArray(source); + } + ret = new Array(source.length); + for (let i = 0, l = source.length; i < l; i++) { + ret[i] = renderItem( + needsWrap ? isReadonlySource ? toReadonly(toReactive(source[i])) : toReactive(source[i]) : source[i], + i, + void 0, + cached && cached[i] + ); + } + } else if (typeof source === "number") { + if (!Number.isInteger(source) || source < 0) { + warn$1( + `The v-for range expects a positive integer value but got ${source}.` + ); + ret = []; + } else { + ret = new Array(source); + for (let i = 0; i < source; i++) { + ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]); + } + } + } else if (isObject(source)) { + if (source[Symbol.iterator]) { + ret = Array.from( + source, + (item, i) => renderItem(item, i, void 0, cached && cached[i]) + ); + } else { + const keys = Object.keys(source); + ret = new Array(keys.length); + for (let i = 0, l = keys.length; i < l; i++) { + const key = keys[i]; + ret[i] = renderItem(source[key], key, i, cached && cached[i]); + } + } + } else { + ret = []; + } + if (cache) { + cache[index] = ret; + } + return ret; +} +function createSlots(slots, dynamicSlots) { + for (let i = 0; i < dynamicSlots.length; i++) { + const slot = dynamicSlots[i]; + if (isArray(slot)) { + for (let j = 0; j < slot.length; j++) { + slots[slot[j].name] = slot[j].fn; + } + } else if (slot) { + slots[slot.name] = slot.key ? (...args) => { + const res = slot.fn(...args); + if (res) res.key = slot.key; + return res; + } : slot.fn; + } + } + return slots; +} +function renderSlot(slots, name, props, fallback, noSlotted, branchKey) { + if (props == null) props = {}; + if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) { + const slotProps = branchKey != null && props.key == null ? extend({}, props, { key: branchKey }) : props; + const hasProps = Object.keys(slotProps).length > 0; + if (name !== "default") slotProps.name = name; + return openBlock(), createBlock( + Fragment, + null, + [createVNode("slot", slotProps, fallback && fallback())], + hasProps ? -2 : 64 + ); + } + let slot = slots[name]; + if (slot && slot.length > 1) { + warn$1( + `SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template.` + ); + slot = () => []; + } + if (slot && slot._c) { + slot._d = false; + } + const prevStackSize = blockStack.length; + openBlock(); + let rendered; + try { + const validSlotContent = slot && ensureValidVNode(slot(props)); + const slotKey = props.key || branchKey || // slot content array of a dynamic conditional slot may have a branch + // key attached in the `createSlots` helper, respect that + validSlotContent && validSlotContent.key; + rendered = createBlock( + Fragment, + { + key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content + (!validSlotContent && fallback ? "_fb" : "") + }, + validSlotContent || (fallback ? fallback() : []), + validSlotContent && slots._ === 1 ? 64 : -2 + ); + } catch (err) { + for (let i = blockStack.length; i > prevStackSize; i--) closeBlock(); + throw err; + } finally { + if (slot && slot._c) { + slot._d = true; + } + } + if (!noSlotted && rendered.scopeId) { + rendered.slotScopeIds = [rendered.scopeId + "-s"]; + } + return rendered; +} +function ensureValidVNode(vnodes) { + return vnodes.some((child) => { + if (!isVNode(child)) return true; + if (child.type === Comment) return false; + if (child.type === Fragment && !ensureValidVNode(child.children)) + return false; + return true; + }) ? vnodes : null; +} +function toHandlers(obj, preserveCaseIfNecessary) { + const ret = {}; + if (!isObject(obj)) { + warn$1(`v-on with no argument expects an object value.`); + return ret; + } + for (const key in obj) { + ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : toHandlerKey(key)] = obj[key]; + } + return ret; +} +var getPublicInstance = (i) => { + if (!i) return null; + if (isStatefulComponent(i)) return getComponentPublicInstance(i); + return getPublicInstance(i.parent); +}; +var resolveDevRootEl = (vnode) => { + let found = false; + while (true) { + if (vnode.patchFlag > 0 && vnode.patchFlag & 2048) { + const root = filterSingleRoot(vnode.children); + if (!root) { + return; + } + vnode = root; + found = true; + continue; + } + const component = vnode.component; + if (component && component.subTree) { + vnode = component.subTree; + continue; + } + const suspense = vnode.suspense; + if (suspense && suspense.activeBranch) { + vnode = suspense.activeBranch; + continue; + } + return found ? vnode.el : void 0; + } +}; +var getDevRootFragmentEl = (i) => { + const el = i.subTree && resolveDevRootEl(i.subTree); + return el === void 0 ? i.vnode.el : el; +}; +var publicPropertiesMap = ( + // Move PURE marker to new line to workaround compiler discarding it + // due to type annotation + extend(/* @__PURE__ */ Object.create(null), { + $: (i) => i, + $el: (i) => true ? getDevRootFragmentEl(i) : i.vnode.el, + $data: (i) => i.data, + $props: (i) => true ? shallowReadonly(i.props) : i.props, + $attrs: (i) => true ? shallowReadonly(i.attrs) : i.attrs, + $slots: (i) => true ? shallowReadonly(i.slots) : i.slots, + $refs: (i) => true ? shallowReadonly(i.refs) : i.refs, + $parent: (i) => getPublicInstance(i.parent), + $root: (i) => getPublicInstance(i.root), + $host: (i) => i.ce, + $emit: (i) => i.emit, + $options: (i) => __VUE_OPTIONS_API__ ? resolveMergedOptions(i) : i.type, + $forceUpdate: (i) => i.f || (i.f = () => { + queueJob(i.update); + }), + $nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)), + $watch: (i) => __VUE_OPTIONS_API__ ? instanceWatch.bind(i) : NOOP + }) +); +var isReservedPrefix = (key) => key === "_" || key === "$"; +var hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key); +var PublicInstanceProxyHandlers = { + get({ _: instance }, key) { + if (key === "__v_skip") { + return true; + } + const { ctx, setupState, data, props, accessCache, type, appContext } = instance; + if (key === "__isVue") { + return true; + } + if (key[0] !== "$") { + const n = accessCache[key]; + if (n !== void 0) { + switch (n) { + case 1: + return setupState[key]; + case 2: + return data[key]; + case 4: + return ctx[key]; + case 3: + return props[key]; + } + } else if (hasSetupBinding(setupState, key)) { + accessCache[key] = 1; + return setupState[key]; + } else if (__VUE_OPTIONS_API__ && data !== EMPTY_OBJ && hasOwn(data, key)) { + accessCache[key] = 2; + return data[key]; + } else if (hasOwn(props, key)) { + accessCache[key] = 3; + return props[key]; + } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) { + accessCache[key] = 4; + return ctx[key]; + } else if (!__VUE_OPTIONS_API__ || shouldCacheAccess) { + accessCache[key] = 0; + } + } + const publicGetter = publicPropertiesMap[key]; + let cssModule, globalProperties; + if (publicGetter) { + if (key === "$attrs") { + track(instance.attrs, "get", ""); + markAttrsAccessed(); + } else if (key === "$slots") { + track(instance, "get", key); + } + return publicGetter(instance); + } else if ( + // css module (injected by vue-loader) + (cssModule = type.__cssModules) && (cssModule = cssModule[key]) + ) { + return cssModule; + } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) { + accessCache[key] = 4; + return ctx[key]; + } else if ( + // global properties + globalProperties = appContext.config.globalProperties, hasOwn(globalProperties, key) + ) { + { + return globalProperties[key]; + } + } else if (currentRenderingInstance && (!isString(key) || // #1091 avoid internal isRef/isVNode checks on component instance leading + // to infinite warning loop + key.indexOf("__v") !== 0)) { + if (data !== EMPTY_OBJ && isReservedPrefix(key[0]) && hasOwn(data, key)) { + warn$1( + `Property ${JSON.stringify( + key + )} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.` + ); + } else if (instance === currentRenderingInstance) { + warn$1( + `Property ${JSON.stringify(key)} was accessed during render but is not defined on instance.` + ); + } + } + }, + set({ _: instance }, key, value) { + const { data, setupState, ctx } = instance; + if (hasSetupBinding(setupState, key)) { + setupState[key] = value; + return true; + } else if (setupState.__isScriptSetup && hasOwn(setupState, key)) { + warn$1(`Cannot mutate + + +``` + +By default the following tag/attribute combinations are transformed, and can be configured using the `template.transformAssetUrls` option. + +```js +{ + video: ['src', 'poster'], + source: ['src'], + img: ['src'], + image: ['xlink:href', 'href'], + use: ['xlink:href', 'href'] +} +``` + +Note that only attribute values that are static strings are transformed. Otherwise, you'd need to import the asset manually, e.g. `import imgUrl from '../image.png'`. + +## Example for passing options to `vue/compiler-sfc`: + +```ts +import vue from '@vitejs/plugin-vue' + +export default { + plugins: [ + vue({ + template: { + compilerOptions: { + // ... + }, + transformAssetUrls: { + // ... + }, + }, + }), + ], +} +``` + +## Example for transforming custom blocks + +```ts +import vue from '@vitejs/plugin-vue' +import yaml from 'js-yaml' + +const vueI18nPlugin = { + name: 'vue-i18n', + transform(code, id) { + // if .vue file don't have block, just return + if (!/vue&type=i18n/.test(id)) { + return + } + // parse yaml + if (/\.ya?ml$/.test(id)) { + code = JSON.stringify(yaml.load(code.trim())) + } + // mount the value on the i18n property of the component instance + return `export default Comp => { + Comp.i18n = ${code} + }` + }, +} + +export default { + plugins: [vue(), vueI18nPlugin], +} +``` + +Create a file named `Demo.vue`, add `lang="yaml"` to the `` blocks, then you can use the syntax of `YAML`: + +```vue + + + +message: 'world' +fullWord: 'hello world' + +``` + +`message` is mounted on the i18n property of the component instance, you can use like this: + +```vue + + + +``` + +## Using Vue SFCs as Custom Elements + +> Requires `vue@^3.2.0` & `@vitejs/plugin-vue@^1.4.0` + +Vue 3.2 introduces the `defineCustomElement` method, which works with SFCs. By default, ` diff --git a/frontend/src/components/common/ConfirmDialog.vue b/frontend/src/components/common/ConfirmDialog.vue new file mode 100644 index 0000000..48e92f2 --- /dev/null +++ b/frontend/src/components/common/ConfirmDialog.vue @@ -0,0 +1,35 @@ + + + diff --git a/frontend/src/components/common/EmptyState.vue b/frontend/src/components/common/EmptyState.vue new file mode 100644 index 0000000..a2366af --- /dev/null +++ b/frontend/src/components/common/EmptyState.vue @@ -0,0 +1,18 @@ + + + diff --git a/frontend/src/components/common/HealthBadge.vue b/frontend/src/components/common/HealthBadge.vue new file mode 100644 index 0000000..e2c5934 --- /dev/null +++ b/frontend/src/components/common/HealthBadge.vue @@ -0,0 +1,13 @@ + + + diff --git a/frontend/src/components/common/Sparkline.vue b/frontend/src/components/common/Sparkline.vue new file mode 100644 index 0000000..b8f836f --- /dev/null +++ b/frontend/src/components/common/Sparkline.vue @@ -0,0 +1,46 @@ + + + diff --git a/frontend/src/components/common/StatCard.vue b/frontend/src/components/common/StatCard.vue new file mode 100644 index 0000000..6650446 --- /dev/null +++ b/frontend/src/components/common/StatCard.vue @@ -0,0 +1,34 @@ + + + diff --git a/frontend/src/components/common/StatusBadge.vue b/frontend/src/components/common/StatusBadge.vue new file mode 100644 index 0000000..f07e1ed --- /dev/null +++ b/frontend/src/components/common/StatusBadge.vue @@ -0,0 +1,16 @@ + + + diff --git a/frontend/src/components/common/ToastHost.vue b/frontend/src/components/common/ToastHost.vue new file mode 100644 index 0000000..e0f0d27 --- /dev/null +++ b/frontend/src/components/common/ToastHost.vue @@ -0,0 +1,47 @@ + + + + + diff --git a/frontend/src/components/flow/FlowEditorDialog.vue b/frontend/src/components/flow/FlowEditorDialog.vue new file mode 100644 index 0000000..b253a8a --- /dev/null +++ b/frontend/src/components/flow/FlowEditorDialog.vue @@ -0,0 +1,246 @@ + + + diff --git a/frontend/src/components/flow/FlowGraph.vue b/frontend/src/components/flow/FlowGraph.vue new file mode 100644 index 0000000..2308557 --- /dev/null +++ b/frontend/src/components/flow/FlowGraph.vue @@ -0,0 +1,629 @@ + + + + + diff --git a/frontend/src/components/flow/FlowInspector.vue b/frontend/src/components/flow/FlowInspector.vue new file mode 100644 index 0000000..19fa7c6 --- /dev/null +++ b/frontend/src/components/flow/FlowInspector.vue @@ -0,0 +1,176 @@ + + + diff --git a/frontend/src/components/flow/FlowLegend.vue b/frontend/src/components/flow/FlowLegend.vue new file mode 100644 index 0000000..526ac4a --- /dev/null +++ b/frontend/src/components/flow/FlowLegend.vue @@ -0,0 +1,80 @@ + + + diff --git a/frontend/src/components/flow/FlowPresentation.vue b/frontend/src/components/flow/FlowPresentation.vue new file mode 100644 index 0000000..8c011bc --- /dev/null +++ b/frontend/src/components/flow/FlowPresentation.vue @@ -0,0 +1,529 @@ + + + diff --git a/frontend/src/components/flow/LineSample.vue b/frontend/src/components/flow/LineSample.vue new file mode 100644 index 0000000..a62c624 --- /dev/null +++ b/frontend/src/components/flow/LineSample.vue @@ -0,0 +1,24 @@ + + + diff --git a/frontend/src/components/flow/RouteStylePicker.vue b/frontend/src/components/flow/RouteStylePicker.vue new file mode 100644 index 0000000..f3b42ea --- /dev/null +++ b/frontend/src/components/flow/RouteStylePicker.vue @@ -0,0 +1,46 @@ + + + diff --git a/frontend/src/components/flow/flowExport.ts b/frontend/src/components/flow/flowExport.ts new file mode 100644 index 0000000..dd7f7ef --- /dev/null +++ b/frontend/src/components/flow/flowExport.ts @@ -0,0 +1,249 @@ +/** + * Turn the live data-flow layout into a standalone SVG, and from there into a PNG. + * + * The canvas on screen is HTML plus animated SVG; a report needs one flat picture that can be + * dropped into a slide or printed. Instead of screenshotting the DOM this reuses the geometry + * the canvas already computed -- cards, routed curves, caption spots -- so the exported + * picture is the one the presenter was looking at, minus the animation. + */ +import type { FlowEdge } from '@/types' +import type { FlowLayout } from './flowLayout' +import { BAND_COLORS, NODE_H, NODE_W, dashArray, tierCounts } from './flowLayout' +import { LINE_STYLE_OPTIONS } from '@/utils/constants' +import { STATUS_META } from '@/utils/constants' + +export interface FlowReportLegendItem { + name: string + color: string + count: number + line_style: string +} + +export interface FlowReportMeta { + title: string + subtitle?: string + legend: FlowReportLegendItem[] +} + +export interface FlowReportImage { + svg: string + width: number + height: number +} + +const HEADER_H = 96 +const FOOTER_H = 46 +const PAD_X = 40 +const FONT = "system-ui, -apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif" + +const escapeXml = (value: string): string => + value.replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"') + +const markerId = (edge: FlowEdge): string => `a-${edge.flow_type_id}-${edge.line_style}` + +/** Rough advance width, good enough to space the legend and the column counters. */ +function textWidth(value: string, size: number): number { + let width = 0 + for (const char of value) width += char.charCodeAt(0) > 0x2e80 ? size : size * 0.55 + return Math.round(width) +} + +/** CJK glyphs are roughly square, so a shared width budget cuts mixed names fairly. */ +function truncate(value: string, limit: number): string { + let used = 0 + let out = '' + for (const char of value) { + used += char.charCodeAt(0) > 0x2e80 ? 1 : 0.58 + if (used > limit) return `${out}…` + out += char + } + return out +} + +const statusColor = (status: string): string => + STATUS_META[status as keyof typeof STATUS_META]?.stroke || '#a8adb5' + +const dashAttr = (style: string): string => { + const dash = dashArray(style) + return dash ? ` stroke-dasharray="${dash}"` : '' +} + +/** The line-style key, spelled out so a printed slide still explains itself. */ +function legendMeaning(): string { + return `线型:${LINE_STYLE_OPTIONS.filter((option) => option.value !== 'dotted') + .map((option) => `${option.label}=${option.meaning}`) + .join(' · ')}` +} + +/** Cards and bands share one hue per column, so the export needs the same lookup. */ +const bandColor = (tier: number): string => BAND_COLORS[Math.abs(tier) % BAND_COLORS.length] + +/** + * Marker units follow the stroke, so a hub with eight links on one edge becomes a solid fan + * at the default size. A smaller head keeps each arrow readable where links converge. + */ +const MARKER_SIZE = 4.6 + +function markersFor(edges: FlowEdge[]): string { + const seen = new Map() + edges.forEach((edge) => seen.set(markerId(edge), edge.color)) + const body = [...seen.entries()] + .map( + ([id, color]) => + `` + ) + .join('') + return `${body}` +} + +export function buildFlowReport(layout: FlowLayout, meta: FlowReportMeta): FlowReportImage { + const width = Math.max(Math.round(layout.width), 980) + const height = HEADER_H + Math.round(layout.height) + FOOTER_H + const parts: string[] = [] + + parts.push(``) + parts.push(`${escapeXml(meta.title)}`) + + const subtitle = [ + meta.subtitle, + `${layout.boxes.size} 个系统 · ${layout.geometry.length} 条数据链路`, + `生成于 ${new Date().toLocaleString('zh-CN', { hour12: false })}` + ] + .filter(Boolean) + .join(' | ') + parts.push(`${escapeXml(subtitle)}`) + + let legendX = PAD_X + meta.legend.forEach((item) => { + const label = `${item.name} ${item.count}` + parts.push( + `` + ) + parts.push(``) + parts.push(`${escapeXml(label)}`) + legendX += 33 + textWidth(label, 11.5) + 24 + }) + + parts.push(``) + + const counts = tierCounts(layout.boxes) + layout.columns.forEach((column, index) => { + const count = counts.get(column.tier) ?? 0 + parts.push( + `` + ) + parts.push( + `` + ) + parts.push( + `${escapeXml(column.label)}` + ) + parts.push( + `${count} 个系统` + ) + }) + + // The rope a bundle is drawn as, under the links that share it. + layout.bundles.forEach((bundle) => { + parts.push( + `` + ) + }) + + layout.geometry.forEach((item) => { + const marker = `url(#${markerId(item.edge)})` + const width = 1 + item.intensity * 2.4 + const opacity = 0.32 + item.intensity * 0.6 + parts.push( + `` + ) + }) + + // A white halo on each caption keeps it legible where curves cross, without measuring text. + layout.geometry.forEach((item) => { + if (item.labelHidden) return + parts.push( + `${escapeXml(truncate(item.edge.label, 16))}` + ) + }) + + layout.boxes.forEach((box) => { + const { node } = box + const tint = bandColor(node.tier) + parts.push( + `` + ) + parts.push(``) + parts.push( + `${escapeXml(truncate(node.name, 10))}` + ) + parts.push( + `${escapeXml(truncate(node.dept || node.layer_name || '—', 13))}` + ) + parts.push( + `入 ${node.in_count} · 出 ${node.out_count}` + ) + }) + + parts.push('') + parts.push( + `${escapeXml(legendMeaning())};线条越粗代表同步越频繁;汇入同一系统的同类链路会并成一股,到卡片前才散开;每一列代表系统在数据链路中的位置。` + ) + + const svg = [ + ``, + markersFor(layout.geometry.map((item) => item.edge)), + ...parts, + '' + ].join('') + + return { svg, width, height } +} + +function loadImage(url: string): Promise { + return new Promise((resolve, reject) => { + const image = new Image() + image.onload = () => resolve(image) + image.onerror = () => reject(new Error('图片渲染失败')) + image.src = url + }) +} + +export function downloadBlob(blob: Blob, fileName: string): void { + const url = URL.createObjectURL(blob) + const anchor = document.createElement('a') + anchor.href = url + anchor.download = fileName + anchor.click() + URL.revokeObjectURL(url) +} + +/** + * Rasterise on a 2x canvas so the picture stays sharp on projectors and retina slides. + * A browser that taints the canvas on SVG images surfaces here as a plain error, and the + * caller offers the SVG file instead. + */ +export async function exportFlowPng(image: FlowReportImage, fileName: string, scale = 2): Promise { + const url = URL.createObjectURL(new Blob([image.svg], { type: 'image/svg+xml;charset=utf-8' })) + try { + const bitmap = await loadImage(url) + const canvas = document.createElement('canvas') + canvas.width = Math.round(image.width * scale) + canvas.height = Math.round(image.height * scale) + const ctx = canvas.getContext('2d') + if (!ctx) throw new Error('当前浏览器不支持导出图片') + ctx.fillStyle = '#ffffff' + ctx.fillRect(0, 0, canvas.width, canvas.height) + ctx.setTransform(scale, 0, 0, scale, 0, 0) + ctx.drawImage(bitmap, 0, 0, image.width, image.height) + const blob = await new Promise((resolve) => canvas.toBlob(resolve, 'image/png')) + if (!blob) throw new Error('导出图片失败') + downloadBlob(blob, fileName) + } finally { + URL.revokeObjectURL(url) + } +} + +export function exportFlowSvg(image: FlowReportImage, fileName: string): void { + downloadBlob(new Blob([image.svg], { type: 'image/svg+xml;charset=utf-8' }), fileName) +} diff --git a/frontend/src/components/flow/flowLayout.ts b/frontend/src/components/flow/flowLayout.ts new file mode 100644 index 0000000..9f22bfd --- /dev/null +++ b/frontend/src/components/flow/flowLayout.ts @@ -0,0 +1,1023 @@ +/** + * Deterministic layout for the data-flow graph. + * + * Columns come from each system's tier. Inside a column the cards are ordered with a + * barycentre sweep -- a card drifts to the height of the cards it talks to -- which is what + * keeps the picture readable once there are forty links on it: systems that exchange data + * sit opposite each other instead of throwing diagonals across the whole canvas. Links that + * converge on one card then share a single trunk in the corridor in front of it, so twelve + * SSO checks read as one rope that fans out at the door instead of twelve separate lines. + * + * Everything is deterministic because particles animate along path geometry, and a layout + * that shuffled between frames would make the animation unreadable. + */ +import type { FlowEdge, GraphNode, RouteStyle } from '@/types' + +export type { RouteStyle } + +export const NODE_W = 176 +export const NODE_H = 64 +export const MAX_COL_GAP = 320 +export const MIN_SCALE = 0.68 +export const MIN_COL_GAP = 92 +export const MAX_ROW_GAP = 26 +export const MIN_ROW_GAP = 12 +export const PAD_X = 40 +export const PAD_Y = 54 +export const MIN_HEIGHT = 560 + +/** One palette per column band, shared by the canvas and the exported report. */ +/** + * One palette per column band, shared by the canvas and the exported report: 入口青、中枢绿、 + * 业务蓝、底座橙. Colouring the columns is what lets a reader tell which world a card lives in + * before they have read a single name. + */ +export const BAND_COLORS = ['#0891b2', '#16a34a', '#2563eb', '#ea580c'] + +/** The same bands at ~5% alpha, for the CSS canvas. */ +export const BAND_TINTS = BAND_COLORS.map((color) => `${color}0d`) + +/** Card fill for a column: the band colour, light enough for grey text to stay legible. */ +export const BAND_FILLS = BAND_COLORS.map((color) => `${color}14`) + +/** Card border for a column: the same colour, kept quiet. */ +export const BAND_EDGES = BAND_COLORS.map((color) => `${color}59`) + +export function dashArray(style: string): string | undefined { + if (style === 'dashed') return '7 5' + if (style === 'dotted') return '2 4' + // 点划线: a long dash then a dot, which is how the legend promises 定时任务 / 人工流程. + if (style === 'dash-dot') return '10 4 2 4' + return undefined +} + +export interface NodeBox { + node: GraphNode + x: number + y: number + w: number + h: number + cx: number + cy: number +} + +export interface EdgeGeometry { + edge: FlowEdge + path: string + length: number + labelX: number + labelY: number + /** True when every candidate spot on the curve sits behind a card. */ + labelHidden: boolean + intensity: number + particles: number + duration: number + /** True when the link runs against the column order (right to left). */ + backward: boolean + /** The shared trunk this link was folded into, when it belongs to a bundle. */ + bundleKey: string | null +} + +/** + * The rope a bundle is drawn as: one thick, faint segment sitting under the links that + * share it, so a hub with a dozen links reads as a single flow before it reads as twelve. + */ +export interface BundleGeometry { + key: string + path: string + color: string + width: number + count: number +} + +export interface FlowColumn { + tier: number + label: string + x: number + width: number + /** Band box: hugging this column's own cards keeps a two-system column from looking empty. */ + top: number + height: number +} + +export interface FlowLayout { + boxes: Map + columns: FlowColumn[] + geometry: EdgeGeometry[] + bundles: BundleGeometry[] + width: number + height: number + colGap: number + rowGap: number + /** Uniform stage scale: 1 means the panel is roomy enough for the natural size. */ + scale: number +} + +/** What the switch on the toolbar offers, in the order the presenter meets it. */ +export const ROUTE_STYLES: Array<{ value: RouteStyle; label: string; hint: string }> = [ + { value: 'elbow', label: '折线', hint: '直角走线,线段走列与列之间的通道,交叉最少、整体流向最清楚' }, + { value: 'curve', label: '曲线', hint: '弧线连接,画面柔和,长距离链路会比较飘' }, + { value: 'straight', label: '直线', hint: '两点直线,最短最直接,链路多时交叉会变多' } +] + +export const DEFAULT_ROUTE_STYLE: RouteStyle = 'elbow' + +export function isRouteStyle(value: unknown): value is RouteStyle { + return value === 'curve' || value === 'straight' || value === 'elbow' +} + +export interface FlowLayoutOptions { + /** Usable width of the graph panel; the column gap stretches to fill it. */ + availableWidth?: number + /** Usable height of the graph panel; the row gap stretches to fill it. */ + availableHeight?: number + /** Live position of the card being dragged, so links follow it while it moves. */ + overrides?: Record + /** + * Report mode: keep every caption even when the crowded spot sits behind a card. The + * presenter asked to read every relation, so a collision beats a missing link. + */ + showAllLabels?: boolean + /** How links travel between two cards. Defaults to the orthogonal router. */ + route?: RouteStyle +} + +type Side = 'left' | 'right' + +const LABEL_MIN_T = 0.24 +const LABEL_SPAN = 0.5 + +interface Plan { + edge: FlowEdge + source: NodeBox + target: NodeBox + sourceSide: Side + targetSide: Side + /** Position of each end in the left-to-right column order; drives corridors and flow direction. */ + sourceIndex: number + targetIndex: number + /** Same-column links bow outward by a fixed amount instead of using control slack. */ + bow: number | null +} + +/** Deterministic 0..1 hash so repeated renders place labels identically. */ +function jitter(seed: number): number { + const value = Math.sin(seed * 12.9898) * 43758.5453 + return value - Math.floor(value) +} + +function clamp(value: number, min: number, max: number): number { + return Math.min(max, Math.max(min, value)) +} + +/** Gap between columns: stretch to use the panel, never so tight that cards touch. */ +function resolveColGap(tierCount: number, availableWidth?: number): number { + if (!availableWidth || tierCount < 2) return MAX_COL_GAP + const slack = (availableWidth - PAD_X * 2 - tierCount * NODE_W) / (tierCount - 1) + return Math.round(clamp(slack, MIN_COL_GAP, MAX_COL_GAP)) +} + +/** Same idea vertically, so a short window compresses rows instead of cutting cards. */ +function resolveRowGap(busiestColumn: number, availableHeight?: number): number { + if (!availableHeight || busiestColumn < 2) return MAX_ROW_GAP + const slack = (availableHeight - PAD_Y - 40 - busiestColumn * NODE_H) / (busiestColumn - 1) + return Math.round(clamp(slack, MIN_ROW_GAP, MAX_ROW_GAP)) +} + +function stackHeight(count: number, rowGap: number): number { + return count * (NODE_H + rowGap) - rowGap + PAD_Y + 40 +} + +/** + * Pick the biggest gap set that still shows every system. Rows compress first; when even + * the tightest rows overflow the panel the whole stage scales down instead of hiding cards + * behind a scrollbar, and the freed width goes back into the column gap where the links + * and their captions need it. + */ +function fit( + tierCount: number, + busiest: number, + availableWidth: number, + availableHeight: number +): { colGap: number; rowGap: number; scale: number } { + const rowGap = resolveRowGap(busiest, availableHeight) + const height = Math.max(MIN_HEIGHT, stackHeight(busiest, rowGap)) + const widthScale = (gap: number) => availableWidth / (PAD_X * 2 + tierCount * NODE_W + Math.max(0, tierCount - 1) * gap) + const scale = clamp(Math.min(widthScale(MAX_COL_GAP), availableHeight / height), MIN_SCALE, 1) + const colGap = resolveColGap(tierCount, availableWidth / scale) + return { colGap, rowGap, scale: Math.min(scale, clamp(widthScale(colGap), MIN_SCALE, 1)) } +} + +export function buildLayout( + nodes: GraphNode[], + edges: FlowEdge[], + tierLabel: (tier: number) => string, + options: FlowLayoutOptions = {} +): FlowLayout { + const tiers = [...new Set(nodes.map((node) => node.tier))].sort((a, b) => a - b) + const columns: FlowLayout['columns'] = [] + const boxes = new Map() + + const busiest = Math.max(0, ...tiers.map((tier) => nodes.filter((n) => n.tier === tier).length)) + const fitted = + options.availableWidth && options.availableHeight + ? fit(tiers.length, busiest, options.availableWidth, options.availableHeight) + : { colGap: MAX_COL_GAP, rowGap: resolveRowGap(busiest, options.availableHeight), scale: 1 } + const { colGap, rowGap, scale: fittedScale } = fitted + const tallest = Math.max(MIN_HEIGHT, stackHeight(busiest, rowGap)) + + // Crossing reduction first: a card ends up opposite the cards it exchanges data with. + const ordered = orderColumns(tiers, nodes, edges) + + tiers.forEach((tier, index) => { + const columnNodes = ordered.get(tier) ?? [] + const x = PAD_X + index * (NODE_W + colGap) + const stack = columnNodes.length * (NODE_H + rowGap) - rowGap + let cursor = PAD_Y + (tallest - PAD_Y - 40 - stack) / 2 + + columnNodes.forEach((node) => { + const box: NodeBox = { node, x, y: cursor, w: NODE_W, h: NODE_H, cx: x + NODE_W / 2, cy: cursor + NODE_H / 2 } + boxes.set(node.key, box) + cursor += NODE_H + rowGap + }) + + columns.push({ tier, label: tierLabel(tier), x, width: NODE_W, top: 34, height: tallest }) + }) + + applyManualPositions(boxes, nodes, options.overrides) + // A column of two cards should be a short band, not a full-height empty box. + hugBands(columns, boxes) + const bounds = contentBounds(boxes) + + const plans: Plan[] = [] + const tierIndex = new Map(tiers.map((tier, index) => [tier, index])) + edges.forEach((edge, index) => { + const source = boxes.get(edge.source_key) + const target = boxes.get(edge.target_key) + if (source && target) plans.push(plan(edge, source, target, index, tierIndex)) + }) + const anchors = distributeAnchors(plans, boxes) + const labelTs = spreadLabels(plans) + const lanes = assignLanes(plans, anchors) + const style = options.route ?? DEFAULT_ROUTE_STYLE + // Links converging on the same card are folded onto one trunk before they fan out. Two-point + // straight lines have no corridor to fold into, so that style keeps every link its own line. + const bundles = style === 'straight' ? NO_BUNDLES : assignBundles(plans, anchors, columns) + const cards = [...boxes.values()] + const takenLabels: Rect[] = [] + + const geometry: EdgeGeometry[] = plans.map((planItem, index) => { + const { edge } = planItem + const routed = routeFor(planItem, anchors[index].sourceY, anchors[index].targetY, { + style, + lane: lanes.get(index)?.lane ?? 0, + total: lanes.get(index)?.total ?? 1, + columns, + bundle: bundles.trunks.get(index) + }) + const placed = placeLabel(routed.at, labelTs[index], labelWidth(edge), cards, takenLabels) + // Density and speed read as rhythm: a link that runs every few minutes carries more + // moving particles than a nightly batch, without showing any throughput numbers. + const intensity = cadence(edge) + const particles = Math.max(1, Math.min(9, Math.round(1 + intensity * 8))) + const duration = Math.max(0.9, (routed.length / 150) * (1.75 - intensity * 1.05)) + + return { + edge, + path: routed.d, + length: Math.round(routed.length), + labelX: placed.point.x, + labelY: placed.point.y, + labelHidden: placed.hidden && !options.showAllLabels, + intensity, + particles, + duration: Number(duration.toFixed(2)), + backward: planItem.targetIndex < planItem.sourceIndex, + bundleKey: bundles.keys.get(index) ?? null + } + }) + + // A card dragged past the last column widens the stage instead of running off it. + const width = Math.max(PAD_X * 2 + tiers.length * NODE_W + Math.max(0, tiers.length - 1) * colGap, bounds.width) + const height = Math.max(tallest, bounds.height) + const scale = shrinkToFit(fittedScale, width, height, options) + return { boxes, columns, geometry, bundles: bundles.geometry, width, height, colGap, rowGap, scale } +} + +/** Cards the user dragged keep their exact spot; everything else stays automatic. */ +function applyManualPositions( + boxes: Map, + nodes: GraphNode[], + overrides?: Record +): void { + nodes.forEach((node) => { + const box = boxes.get(node.key) + if (!box) return + const placed = { x: node.flow_x, y: node.flow_y } + const dragging = overrides?.[node.key] + if (dragging) Object.assign(placed, dragging) + if (Number.isFinite(placed.x ?? NaN)) { + box.x = Math.round(placed.x as number) + box.cx = box.x + NODE_W / 2 + } + if (Number.isFinite(placed.y ?? NaN)) { + box.y = Math.round(placed.y as number) + box.cy = box.y + NODE_H / 2 + } + }) +} + +function contentBounds(boxes: Map): { width: number; height: number } { + let width = 0 + let height = 0 + boxes.forEach((box) => { + width = Math.max(width, box.x + box.w + PAD_X) + height = Math.max(height, box.y + box.h + PAD_Y) + }) + return { width, height } +} + +/** Breathing room between a column's outermost cards and the edge of its band. */ +const BAND_PAD = 18 + +/** + * Order the cards inside each column by the height of the cards they exchange data with. + * + * Two alternating sweeps over every neighbour's barycentre is the standard crossing reduction + * for layered graphs, and it is what answers "why do the lines slalomed everywhere": systems + * that talk to each other end up opposite each other, so most links become short horizontal + * hops instead of diagonals crossing four columns. The seed order and the tie-breaks are fixed, + * so the arrangement is identical on every reload. + */ +const ORDER_PASSES = 6 + +function orderColumns( + tiers: number[], + nodes: GraphNode[], + edges: FlowEdge[] +): Map { + const columns = new Map() + tiers.forEach((tier) => { + columns.set( + tier, + [...nodes.filter((node) => node.tier === tier)].sort( + (a, b) => b.degree - a.degree || a.name.localeCompare(b.name, 'zh') + ) + ) + }) + + const nodeOf = new Map(nodes.map((node) => [node.key, node])) + const rankOf = new Map() + const reshuffle = (): void => { + columns.forEach((list) => list.forEach((node, index) => rankOf.set(node.key, index))) + } + reshuffle() + + /** Height of a card inside its own column, 0..1, so columns of different sizes compare. */ + const level = (key: string): number | null => { + const index = rankOf.get(key) + if (index === undefined) return null + const list = nodeOf.get(key) ? columns.get(nodeOf.get(key)!.tier) : undefined + if (!list || list.length < 2) return 0.5 + return index / (list.length - 1) + } + + for (let pass = 0; pass < ORDER_PASSES; pass += 1) { + const forward = pass % 2 === 0 + const sweep = forward ? tiers : [...tiers].reverse() + sweep.forEach((tier) => { + const list = columns.get(tier) + if (!list || list.length < 2) return + const seed = new Map(list.map((node, index) => [node.key, index / Math.max(1, list.length - 1)])) + const pull = new Map() + list.forEach((node) => { + const values: number[] = [] + edges.forEach((edge) => { + const incoming = edge.target_key === node.key + const outgoing = edge.source_key === node.key + if (!incoming && !outgoing) return + const neighbour = nodeOf.get(incoming ? edge.source_key : edge.target_key) + if (!neighbour || neighbour.tier === tier) return + if (forward ? neighbour.tier > tier : neighbour.tier < tier) return + const value = level(neighbour.key) + if (value !== null) values.push(value) + }) + if (values.length) pull.set(node.key, values.reduce((sum, value) => sum + value, 0) / values.length) + }) + const wanted = (node: GraphNode) => pull.get(node.key) ?? seed.get(node.key)! + list.sort((a, b) => wanted(a) - wanted(b) || a.name.localeCompare(b.name, 'zh')) + reshuffle() + }) + } + + return columns +} + +/** + * Give every band the height of its own cards. A two-system column stretched over the whole + * stage reads as dead space next to a seven-system column, which is most of what made the + * left-hand side of the picture feel empty while the right-hand side felt crammed. + */ +function hugBands(columns: FlowColumn[], boxes: Map): void { + const cards = [...boxes.values()] + columns.forEach((column) => { + const own = cards.filter((box) => box.node.tier === column.tier) + if (!own.length) return + const top = Math.max(34, Math.round(Math.min(...own.map((box) => box.y)) - BAND_PAD)) + const bottom = Math.round(Math.max(...own.map((box) => box.y + box.h)) + BAND_PAD) + column.top = top + column.height = Math.max(NODE_H + BAND_PAD * 2, bottom - top) + }) +} + +/** Cards per column, for the header counters on both the canvas and the exported report. */ +export function tierCounts(boxes: Map): Map { + const counts = new Map() + boxes.forEach((box) => counts.set(box.node.tier, (counts.get(box.node.tier) ?? 0) + 1)) + return counts +} + +/** Manual cards can push the stage past the panel, so the fit shrinks a little further. */ +function shrinkToFit( + base: number, + width: number, + height: number, + options: FlowLayoutOptions +): number { + if (!options.availableWidth || !options.availableHeight) return base + return clamp(Math.min(base, options.availableWidth / width, options.availableHeight / height), MIN_SCALE, 1) +} + +/** + * Decide which sides of the two cards a link attaches to. Forward links leave right and + * enter left; links pointing back a column flip; same-column links bow out of the side + * with the most room. + */ +function plan( + edge: FlowEdge, + source: NodeBox, + target: NodeBox, + index: number, + tierIndex: Map +): Plan { + const sourceIndex = tierIndex.get(source.node.tier) ?? 0 + const targetIndex = tierIndex.get(target.node.tier) ?? 0 + + if (source.node.tier === target.node.tier) { + const side: Side = source.x - PAD_X > 60 ? 'left' : 'right' + return { + edge, + source, + target, + sourceSide: side, + targetSide: side, + sourceIndex, + targetIndex, + bow: 14 + jitter(index + 7) * 40 + } + } + + const forward = target.cx > source.cx + return { + edge, + source, + target, + sourceSide: forward ? 'right' : 'left', + targetSide: forward ? 'left' : 'right', + sourceIndex, + targetIndex, + bow: null + } +} + +/** + * Links that share a column corridor cross roughly the same area, so their captions are + * ranked by vertical position and given evenly spaced positions along the curve. Without + * this the captions of eight SSO links land on top of each other. + */ +function spreadLabels(plans: Plan[]): number[] { + const corridors = new Map() + plans.forEach((planItem, index) => { + const key = `${planItem.source.node.tier}->${planItem.target.node.tier}` + const list = corridors.get(key) + if (list) list.push(index) + else corridors.set(key, [index]) + }) + + const fractions = new Map() + corridors.forEach((members) => { + members + .map((index) => ({ index, mid: (plans[index].source.cy + plans[index].target.cy) / 2 })) + .sort((a, b) => a.mid - b.mid) + .forEach((entry, position) => { + fractions.set(entry.index, LABEL_MIN_T + (LABEL_SPAN * (position + 1)) / (members.length + 1)) + }) + }) + + return plans.map((_, index) => fractions.get(index) ?? 0.5) +} + +/** + * Keep captions off the cards and off each other. A caption that lands on a system reads as + * a rendering bug, and two captions on top of each other read as noise, so each one walks + * along its own curve looking for clear space and gives up only when nothing is free; a + * buried caption then waits for hover instead of cluttering the picture. + */ +interface Rect { + x: number + y: number + w: number + h: number +} + +const LABEL_CANDIDATES = [0.5, 0.44, 0.56, 0.38, 0.62, 0.32, 0.68, 0.26, 0.74] +const LABEL_H = 18 + +function placeLabel( + at: (t: number) => { x: number; y: number }, + preferred: number, + width: number, + cards: NodeBox[], + taken: Rect[] +): { point: { x: number; y: number }; hidden: boolean } { + for (const t of [preferred, ...LABEL_CANDIDATES]) { + const point = at(t) + const rect = { x: point.x - width / 2, y: point.y - LABEL_H / 2, w: width, h: LABEL_H } + if (cards.some((card) => overlaps(rect, card))) continue + if (taken.some((other) => overlaps(rect, other))) continue + taken.push(rect) + return { point, hidden: false } + } + return { point: at(preferred), hidden: true } +} + +function overlaps(a: Rect, b: Rect): boolean { + return a.x < b.x + b.w + PAD_X * 0.3 && a.x + a.w + PAD_X * 0.3 > b.x && a.y < b.y + b.h + 3 && a.y + a.h + 3 > b.y +} + +/** Mixed CJK/latin estimate, good enough to reserve room for the caption. */ +function labelWidth(edge: FlowEdge): number { + let width = 0 + for (const char of edge.label) width += char.charCodeAt(0) > 0x2e80 ? 10 : 5.8 + return Math.round(width + 14) +} + +/** How often a link moves mapped to 0..1: every minute is 1, every six hours is 0. */ +function cadence(edge: FlowEdge): number { + const seconds = Math.max(30, edge.interval_sec || 3600) + const ratio = 1 - clamp((Math.log(seconds) - Math.log(30)) / (Math.log(6 * 3600) - Math.log(30)), 0, 1) + return Math.sqrt(clamp(ratio + (edge.reliability === 'sync' ? 0.08 : 0), 0, 1)) +} + +/** + * Spread the endpoints that pile onto one side of a card. Slots are ordered by where the + * far end of each link sits, so a fan of links reads as a fan instead of a knot. + */ +function distributeAnchors( + plans: Plan[], + boxes: Map +): Array<{ sourceY: number; targetY: number }> { + const groups = new Map>() + + plans.forEach((planItem, index) => { + const ends: Array<[string, number]> = [ + [`${planItem.edge.source_key}:${planItem.sourceSide}`, planItem.target.cy], + [`${planItem.edge.target_key}:${planItem.targetSide}`, planItem.source.cy] + ] + ends.forEach(([key, otherCy]) => { + const entry = { plan: index, otherCy } + const list = groups.get(key) + if (list) list.push(entry) + else groups.set(key, [entry]) + }) + }) + + const anchors = plans.map((planItem) => ({ sourceY: planItem.source.cy, targetY: planItem.target.cy })) + + groups.forEach((members, key) => { + const nodeKey = key.split(':')[0] + const box = boxes.get(nodeKey) + if (!box) return + members.sort((a, b) => a.otherCy - b.otherCy) + members.forEach((member, position) => { + const y = box.y + (NODE_H * (position + 1)) / (members.length + 1) + if (plans[member.plan].edge.source_key === nodeKey) anchors[member.plan].sourceY = y + else anchors[member.plan].targetY = y + }) + }) + + return anchors +} + +interface Point { + x: number + y: number +} + +interface RoutedPath { + d: string + /** True geometric length, which is what keeps particle speed honest across styles. */ + length: number + at: (t: number) => Point +} + +interface RouteContext { + style: RouteStyle + /** This link's slot inside its corridor. */ + lane: number + /** Links sharing the corridor, so the slots divide it evenly. */ + total: number + columns: FlowColumn[] + /** Set when this link was folded onto a shared trunk with its siblings. */ + bundle?: BundleTrunk +} + +const CORNER = 10 +const CORRIDOR_INSET = 10 +const GUTTER_FIRST = 20 +const GUTTER_STEP = 9 + +/** + * Every link entering a column from one side has to cross the same corridor. Ranking the + * links that share it by height and handing each a slot inside the corridor is what turns a + * knot of parallel verticals into a readable fan: inside a corridor nothing crosses, and the + * crossings that remain happen where the reader expects a change of direction. + */ +function assignLanes( + plans: Plan[], + anchors: Array<{ sourceY: number; targetY: number }> +): Map { + const groups = new Map() + plans.forEach((planItem, index) => { + const key = + planItem.sourceIndex === planItem.targetIndex + ? `same:${planItem.sourceIndex}:${planItem.sourceSide}` + : `gap:${corridorGap(planItem)}` + const list = groups.get(key) + if (list) list.push(index) + else groups.set(key, [index]) + }) + + const lanes = new Map() + groups.forEach((members) => { + members + .map((index) => ({ index, mid: (anchors[index].sourceY + anchors[index].targetY) / 2 })) + .sort((a, b) => a.mid - b.mid) + .forEach((entry, position) => lanes.set(entry.index, { lane: position, total: members.length })) + }) + return lanes +} + +/** + * The corridor a link's vertical run sits in: the gap directly in front of the target, i.e. + * the one the link must pass anyway. Keeping it there means a long link travels horizontally + * through open rows instead of weaving between columns. + */ +function corridorGap(planItem: Plan): number { + return planItem.targetIndex > planItem.sourceIndex ? planItem.targetIndex - 1 : planItem.targetIndex +} + +function routeFor(planItem: Plan, fromY: number, toY: number, ctx: RouteContext): RoutedPath { + const { source, target, sourceSide, targetSide, bow } = planItem + const fromX = sourceSide === 'right' ? source.x + NODE_W : source.x + const toX = targetSide === 'right' ? target.x + NODE_W : target.x + const sameColumn = planItem.sourceIndex === planItem.targetIndex + + if (ctx.style === 'curve') { + const dirSource = sourceSide === 'right' ? 1 : -1 + const dirTarget = targetSide === 'right' ? 1 : -1 + const control = Math.max(46, Math.abs(toX - fromX) * 0.42) + if (ctx.bundle && !sameColumn) { + // Both halves aim at one point in the corridor: the links fuse into a rope and split + // again on the way into the card, which is the edge-bundling the reader asked for. + const anchor = { x: ctx.bundle.trunkX, y: ctx.bundle.anchorY } + const dir = toX >= anchor.x ? 1 : -1 + const reach = Math.max(42, Math.abs(toX - anchor.x) * 0.55) + return chainRoutes( + bezierRoute( + fromX, + fromY, + fromX + dirSource * control, + fromY, + anchor.x - dir * reach, + anchor.y, + anchor.x, + anchor.y + ), + bezierRoute( + anchor.x, + anchor.y, + anchor.x + dir * reach, + anchor.y, + toX + dirTarget * control * 0.6, + toY, + toX, + toY + ) + ) + } + const c1 = fromX + dirSource * (bow ?? control) + const c2 = toX + dirTarget * (bow ?? control) + return bezierRoute(fromX, fromY, c1, fromY, c2, toY, toX, toY) + } + + if (ctx.style === 'straight') { + if (!sameColumn) return polylineRoute([{ x: fromX, y: fromY }, { x: toX, y: toY }]) + // Even the plainest style has to take the gutter: a direct line between two cards in one + // column would be drawn straight over the cards stacked between them. + return polylineRoute(gutterPoints(planItem, fromX, fromY, toX, toY, ctx.lane)) + } + + if (sameColumn) return polylineRoute(gutterPoints(planItem, fromX, fromY, toX, toY, ctx.lane)) + + const corridor = ctx.bundle ? ctx.bundle.trunkX : corridorX(planItem, ctx, (fromX + toX) / 2) + return polylineRoute([ + { x: fromX, y: fromY }, + { x: corridor, y: fromY }, + { x: corridor, y: toY }, + { x: toX, y: toY } + ]) +} + +/** Down the gutter beside the column rather than through the cards stacked between the two. */ +function gutterPoints( + planItem: Plan, + fromX: number, + fromY: number, + toX: number, + toY: number, + lane: number +): Point[] { + const right = planItem.sourceSide === 'right' + const edge = right + ? Math.max(planItem.source.x + NODE_W, planItem.target.x + NODE_W) + : Math.min(planItem.source.x, planItem.target.x) + const gutter = right ? edge + GUTTER_FIRST + lane * GUTTER_STEP : edge - GUTTER_FIRST - lane * GUTTER_STEP + return [ + { x: fromX, y: fromY }, + { x: gutter, y: fromY }, + { x: gutter, y: toY }, + { x: toX, y: toY } + ] +} + +function corridorBounds(columns: FlowColumn[], gap: number): { from: number; to: number } | null { + const left = columns[gap] + const right = columns[gap + 1] + if (!left || !right) return null + const from = left.x + left.width + CORRIDOR_INSET + const to = right.x - CORRIDOR_INSET + if (to > from) return { from, to } + const middle = (from + to) / 2 + return { from: middle, to: middle } +} + +function corridorX(planItem: Plan, ctx: RouteContext, fallback: number): number { + const bounds = corridorBounds(ctx.columns, corridorGap(planItem)) + if (!bounds) return fallback + const slots = Math.max(2, ctx.total) + return bounds.from + ((bounds.to - bounds.from) * (ctx.lane + 0.5)) / slots +} + +/** How many links have to arrive at the same door before a trunk is worth drawing. */ +const MIN_BUNDLE = 3 + +interface BundleTrunk { + key: string + /** The shared vertical run every member of the bundle travels along. */ + trunkX: number + /** Where the bundled curves meet before they fan out into the card. */ + anchorY: number +} + +interface BundleAssignment { + trunks: Map + keys: Map + geometry: BundleGeometry[] +} + +const NO_BUNDLES: BundleAssignment = { trunks: new Map(), keys: new Map(), geometry: [] } + +/** + * Edge bundling, the cheap honest kind. + * + * Every link that arrives at the same card through the same corridor already has to cross it, + * so they are given one shared x instead of one lane each: the vertical runs sit exactly on + * top of each other and only fan out again into the card's own ports. A hub like the SSO + * platform, which twelve systems check tickets against, turns from a fan of twelve lines into + * one rope with twelve short stubs. + */ +function assignBundles( + plans: Plan[], + anchors: Array<{ sourceY: number; targetY: number }>, + columns: FlowColumn[] +): BundleAssignment { + const trunks = new Map() + const keys = new Map() + const geometry: BundleGeometry[] = [] + const groups = new Map() + + plans.forEach((planItem, index) => { + // Same-column links already share the gutter beside their cards. + if (planItem.sourceIndex === planItem.targetIndex) return + const key = `${planItem.edge.target_key}@${planItem.targetSide}#${corridorGap(planItem)}` + const list = groups.get(key) + if (list) list.push(index) + else groups.set(key, [index]) + }) + + groups.forEach((members, key) => { + if (members.length < MIN_BUNDLE) return + const trunkX = corridorCenter(columns, corridorGap(plans[members[0]]), 0.58) + if (!Number.isFinite(trunkX)) return + const runs = members.map((index) => ({ from: anchors[index].sourceY, to: anchors[index].targetY })) + const anchorY = runs.reduce((sum, run) => sum + run.to, 0) / runs.length + members.forEach((index) => { + trunks.set(index, { key, trunkX, anchorY }) + keys.set(index, key) + }) + // Only the stretch where members really lie on top of each other becomes a rope; drawing + // the full span would invent a line that most of the links never travel. + const rope = densestRun(runs) + if (!rope) return + geometry.push({ + key, + path: `M ${round(trunkX)} ${round(rope.top)} L ${round(trunkX)} ${round(rope.bottom)}`, + color: bundleColor(members.map((index) => plans[index].edge)), + width: Math.min(7, 1.8 + members.length * 0.36), + count: members.length + }) + }) + + return { trunks, keys, geometry } +} + +/** + * The longest stretch of a trunk that at least two links actually share. + * + * Members of a bundle arrive from different heights, so the region every one of them crosses + * is usually tiny, while the region a crowd of them crosses is the visible rope. Sweeping the + * interval endpoints finds that crowded middle without assuming the links are sorted. + */ +function densestRun( + runs: Array<{ from: number; to: number }>, + minCover = 2 +): { top: number; bottom: number } | null { + const events: Array<{ at: number; delta: number }> = [] + runs.forEach((run) => { + events.push({ at: Math.min(run.from, run.to), delta: 1 }, { at: Math.max(run.from, run.to), delta: -1 }) + }) + events.sort((a, b) => a.at - b.at || b.delta - a.delta) + + let cover = 0 + let start: number | null = null + let best: { top: number; bottom: number } | null = null + const keep = (top: number, bottom: number) => { + if (bottom - top < 12) return + if (!best || bottom - top > best.bottom - best.top) best = { top, bottom } + } + + events.forEach((event) => { + const before = cover + cover += event.delta + if (before < minCover && cover >= minCover) start = event.at + else if (before >= minCover && cover < minCover && start !== null) { + keep(start, event.at) + start = null + } + }) + if (start !== null) keep(start, events[events.length - 1].at) + return best +} + +function corridorCenter(columns: FlowColumn[], gap: number, bias: number): number { + const bounds = corridorBounds(columns, gap) + return bounds ? bounds.from + (bounds.to - bounds.from) * bias : Number.NaN +} + +/** A rope of one colour takes that colour; a mixed bundle stays a neutral grey. */ +function bundleColor(edges: FlowEdge[]): string { + const colors = new Set(edges.map((edge) => edge.color)) + return colors.size === 1 ? [...colors][0] : '#94a3b8' +} + +/** Two routed stretches joined end to end, so a bundled curve still has one sampler. */ +function chainRoutes(first: RoutedPath, second: RoutedPath): RoutedPath { + const total = Math.max(1, first.length + second.length) + return { + d: `${first.d} ${second.d.replace('M', 'L')}`, + length: total, + at: (t: number) => { + const travelled = clamp(t, 0, 1) * total + if (travelled <= first.length) return first.at(first.length === 0 ? 0 : travelled / first.length) + return second.at(second.length === 0 ? 1 : (travelled - first.length) / second.length) + } + } +} + +/** Polyline into a path with rounded corners: right angles read as routing, not as box art. */ +function polylineRoute(points: Point[]): RoutedPath { + const kept = points.filter( + (point, index) => index === 0 || Math.hypot(point.x - points[index - 1].x, point.y - points[index - 1].y) > 0.5 + ) + // Two cards may sit exactly edge to edge; a link still needs something to be drawn on. + if (kept.length < 2) { + const only = kept[0] ?? { x: 0, y: 0 } + return { d: `M ${round(only.x)} ${round(only.y)} L ${round(only.x + 1)} ${round(only.y)}`, at: () => only, length: 60 } + } + const at = polySampler(kept) + const d = + kept.length < 3 + ? `M ${round(kept[0].x)} ${round(kept[0].y)} L ${round(kept[kept.length - 1].x)} ${round(kept[kept.length - 1].y)}` + : roundedPath(kept) + return { d, at, length: Math.max(60, polyLength(kept)) } +} + +function roundedPath(points: Point[]): string { + let d = `M ${round(points[0].x)} ${round(points[0].y)}` + for (let index = 1; index < points.length - 1; index += 1) { + const prev = points[index - 1] + const here = points[index] + const next = points[index + 1] + const inLen = Math.hypot(here.x - prev.x, here.y - prev.y) + const outLen = Math.hypot(next.x - here.x, next.y - here.y) + const radius = Math.min(CORNER, inLen / 2, outLen / 2) + if (radius < 1) { + d += ` L ${round(here.x)} ${round(here.y)}` + continue + } + const entry = { x: here.x + ((prev.x - here.x) / inLen) * radius, y: here.y + ((prev.y - here.y) / inLen) * radius } + const exit = { x: here.x + ((next.x - here.x) / outLen) * radius, y: here.y + ((next.y - here.y) / outLen) * radius } + d += ` L ${round(entry.x)} ${round(entry.y)} Q ${round(here.x)} ${round(here.y)} ${round(exit.x)} ${round(exit.y)}` + } + const last = points[points.length - 1] + return `${d} L ${round(last.x)} ${round(last.y)}` +} + +function polyLength(points: Point[]): number { + let length = 0 + for (let index = 1; index < points.length; index += 1) { + length += Math.hypot(points[index].x - points[index - 1].x, points[index].y - points[index - 1].y) + } + return length +} + +/** Walk the polyline by real distance so a caption at t=0.5 sits at the visual middle. */ +function polySampler(points: Point[]): (t: number) => Point { + if (points.length < 2) return () => points[0] ?? { x: 0, y: 0 } + const total = polyLength(points) + return (t: number) => { + let remaining = clamp(t, 0, 1) * total + for (let index = 1; index < points.length; index += 1) { + const step = Math.hypot(points[index].x - points[index - 1].x, points[index].y - points[index - 1].y) + if (remaining <= step || index === points.length - 1) { + const ratio = step === 0 ? 0 : clamp(remaining / step, 0, 1) + return { + x: points[index - 1].x + (points[index].x - points[index - 1].x) * ratio, + y: points[index - 1].y + (points[index].y - points[index - 1].y) * ratio + } + } + remaining -= step + } + return points[points.length - 1] + } +} + +function bezierRoute( + x0: number, y0: number, x1: number, y1: number, + x2: number, y2: number, x3: number, y3: number +): RoutedPath { + const at = cubicSampler(x0, y0, x1, y1, x2, y2, x3, y3) + const samples: Point[] = [] + for (let step = 0; step <= 24; step += 1) samples.push(at(step / 24)) + return { d: cubic(x0, y0, x1, y1, x2, y2, x3, y3), at, length: Math.max(60, polyLength(samples)) } +} + +function cubic( + x0: number, y0: number, x1: number, y1: number, + x2: number, y2: number, x3: number, y3: number +): string { + return `M ${round(x0)} ${round(y0)} C ${round(x1)} ${round(y1)}, ${round(x2)} ${round(y2)}, ${round(x3)} ${round(y3)}` +} + +function round(value: number): number { + return Math.round(value * 10) / 10 +} + +/** Evaluate a cubic path at t without a DOM round-trip. */ +function cubicSampler( + x0: number, y0: number, x1: number, y1: number, + x2: number, y2: number, x3: number, y3: number +): (t: number) => Point { + return (t: number) => { + const mt = 1 - t + const a = mt * mt * mt + const b = 3 * mt * mt * t + const c = 3 * mt * t * t + const d = t * t * t + return { + x: a * x0 + b * x1 + c * x2 + d * x3, + y: a * y0 + b * y1 + c * y2 + d * y3 + } + } +} diff --git a/frontend/src/components/flow/flowStyle.ts b/frontend/src/components/flow/flowStyle.ts new file mode 100644 index 0000000..6fe5217 --- /dev/null +++ b/frontend/src/components/flow/flowStyle.ts @@ -0,0 +1,89 @@ +/** + * One shared visual encoding for the flow canvas, its legend and the exported report. + * + * A picture shown to a room has to be readable without a presenter next to it, so colour + * carries the *kind* of exchange (调用 / 鉴权取数 / 消息 / 定时批量 / 人工) and the dash + * pattern carries the *rhythm* (实线同步、虚线异步、点划线定时或人工). Both the on-screen + * legend and the exported SVG read from this table, so they can never drift apart. + */ +export type LineFamily = 'call' | 'auth' | 'message' | 'batch' | 'manual' | 'other' + +export interface FamilyMeta { + key: LineFamily + /** Short label used as the legend prefix. */ + label: string + /** What the colour means, spelled out for the audience. */ + meaning: string + color: string +} + +export const LINE_FAMILIES: Record = { + call: { key: 'call', label: '调用', meaning: '蓝:API / 同步调用', color: '#2563eb' }, + auth: { key: 'auth', label: '鉴权取数', meaning: '紫:鉴权 / MCP 取数', color: '#9333ea' }, + message: { key: 'message', label: '消息', meaning: '绿:异步消息 / 事件推送', color: '#16a34a' }, + batch: { key: 'batch', label: '定时批量', meaning: '灰:定时任务 / 归档沉淀', color: '#64748b' }, + manual: { key: 'manual', label: '人工', meaning: '红:人工操作 / 线下流程', color: '#e20829' }, + other: { key: 'other', label: '其他', meaning: '未归类链路', color: '#64748b' } +} + +/** Order the legend walks families in, so the report always reads top-down the same way. */ +export const FAMILY_ORDER: LineFamily[] = ['call', 'message', 'auth', 'batch', 'manual', 'other'] + +/** Known data types, so the shipped seed does not depend on keyword guessing. */ +const FAMILY_BY_TYPE_ID: Record = { + core: 'call', + cap: 'call', + entry: 'message', + mcp: 'auth', + auth: 'auth', + archive: 'batch', + handmade: 'manual' +} + +const FAMILY_BY_KEYWORD: Array<[RegExp, LineFamily]> = [ + [/认证|鉴权|登录|票据|sso|token/i, 'auth'], + [/mcp|取数|智能体|agent|分析/i, 'auth'], + [/消息|推送|通知|事件|移动|微信|im\b/i, 'message'], + [/人工|线下|手工|盖章|记账|录入/i, 'manual'], + [/归档|知识|沉淀|备份|日志|定时/i, 'batch'], + [/调用|接口|api|业务|核心|订单|合同/i, 'call'] +] + +/** Which colour family a data type belongs to: explicit id first, then its name. */ +export function lineFamily(typeId: string, name = ''): LineFamily { + const known = FAMILY_BY_TYPE_ID[typeId] + if (known) return known + const haystack = `${typeId} ${name}` + for (const [pattern, family] of FAMILY_BY_KEYWORD) if (pattern.test(haystack)) return family + return 'other' +} + +/** + * The encoding this family is meant to use: one hue per family, one dash per rhythm. + * + * The shipped seed and the live 配置 screen are both set to these values, which is what makes + * "蓝色是调用、紫色是鉴权取数、绿色是消息、灰色是定时、红色是人工" true on the picture rather + * than just a claim in the legend. + */ +export const FAMILY_DEFAULT_STYLE: Record = { + call: { color: '#1d4ed8', line_style: 'solid' }, + auth: { color: '#7c3aed', line_style: 'solid' }, + message: { color: '#16a34a', line_style: 'dashed' }, + batch: { color: '#64748b', line_style: 'dash-dot' }, + manual: { color: '#e20829', line_style: 'dash-dot' }, + other: { color: '#64748b', line_style: 'dashed' } +} + +/** Two types inside one family still have to tell each other apart, so the hue steps per type. */ +export const FAMILY_HUES: Record = { + core: '#1d4ed8', + cap: '#0ea5e9', + auth: '#7c3aed', + mcp: '#a855f7', + entry: '#16a34a', + archive: '#64748b', + handmade: '#e20829' +} + +// The dash patterns themselves live with the other shared labels in utils/constants, and the +// canvas draws them through dashArray() in flowLayout. This module only owns the colours. diff --git a/frontend/src/components/icons/Icon.vue b/frontend/src/components/icons/Icon.vue new file mode 100644 index 0000000..01486ac --- /dev/null +++ b/frontend/src/components/icons/Icon.vue @@ -0,0 +1,73 @@ + + + diff --git a/frontend/src/components/layout/AppShell.vue b/frontend/src/components/layout/AppShell.vue new file mode 100644 index 0000000..d740562 --- /dev/null +++ b/frontend/src/components/layout/AppShell.vue @@ -0,0 +1,101 @@ + + + diff --git a/frontend/src/components/layout/AppSidebar.vue b/frontend/src/components/layout/AppSidebar.vue new file mode 100644 index 0000000..b00efbe --- /dev/null +++ b/frontend/src/components/layout/AppSidebar.vue @@ -0,0 +1,74 @@ + + + diff --git a/frontend/src/components/panorama/SystemDetailPanel.vue b/frontend/src/components/panorama/SystemDetailPanel.vue new file mode 100644 index 0000000..8930b35 --- /dev/null +++ b/frontend/src/components/panorama/SystemDetailPanel.vue @@ -0,0 +1,245 @@ + + + diff --git a/frontend/src/components/panorama/SystemDiagram.vue b/frontend/src/components/panorama/SystemDiagram.vue new file mode 100644 index 0000000..9e2e538 --- /dev/null +++ b/frontend/src/components/panorama/SystemDiagram.vue @@ -0,0 +1,149 @@ + + + diff --git a/frontend/src/components/panorama/SystemFormDialog.vue b/frontend/src/components/panorama/SystemFormDialog.vue new file mode 100644 index 0000000..73dd6c3 --- /dev/null +++ b/frontend/src/components/panorama/SystemFormDialog.vue @@ -0,0 +1,162 @@ + + + diff --git a/frontend/src/composables/useEditable.ts b/frontend/src/composables/useEditable.ts new file mode 100644 index 0000000..f15171b --- /dev/null +++ b/frontend/src/composables/useEditable.ts @@ -0,0 +1,28 @@ +/** + * One place to ask "may this visitor change anything right now?". + * + * The master switch lives in 系统配置 · 平台配置 and the backend answers a locked write + * with 423, so the UI job is only to hide the affordance and explain why. Views that keep + * a control visible anyway call `block()` to get the same sentence the API would give. + */ +import { computed } from 'vue' +import { useUiStore } from '@/stores/ui' + +export const LOCK_MESSAGE = '当前是只读模式,请在「系统配置 · 平台配置」打开「允许编辑」' + +export function useEditable() { + const ui = useUiStore() + + const editable = computed(() => ui.editable) + + /** True when the action may run; otherwise toasts the reason and returns false. */ + function block(): boolean { + if (editable.value) return true + ui.toast(LOCK_MESSAGE, 'info') + return false + } + + return { editable, block } +} + +export default useEditable diff --git a/frontend/src/main.ts b/frontend/src/main.ts new file mode 100644 index 0000000..501dee0 --- /dev/null +++ b/frontend/src/main.ts @@ -0,0 +1,10 @@ +import { createApp } from 'vue' +import { createPinia } from 'pinia' +import App from './App.vue' +import router from './router' +import './style.css' + +const app = createApp(App) +app.use(createPinia()) +app.use(router) +app.mount('#app') diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts new file mode 100644 index 0000000..5c42c80 --- /dev/null +++ b/frontend/src/router/index.ts @@ -0,0 +1,50 @@ +import { createRouter, createWebHistory, type RouteRecordRaw } from 'vue-router' + +const routes: RouteRecordRaw[] = [ + { path: '/', redirect: '/panorama' }, + { + path: '/panorama', + name: 'panorama', + component: () => import('@/views/PanoramaView.vue'), + meta: { title: '系统全景总览' } + }, + { + path: '/flow', + name: 'flow', + component: () => import('@/views/FlowView.vue'), + meta: { title: '数据流向图' } + }, + { + path: '/agent', + name: 'agent', + component: () => import('@/views/AgentOverviewView.vue'), + meta: { title: 'Agent 布局总览图' } + }, + { path: '/exchange', redirect: '/agent' }, + { + path: '/config', + name: 'config', + component: () => import('@/views/ConfigView.vue'), + meta: { title: '系统配置' } + }, + { + path: '/history', + name: 'history', + component: () => import('@/views/HistoryView.vue'), + meta: { title: '变更审计' } + }, + { path: '/:pathMatch(.*)*', redirect: '/panorama' } +] + +export const router = createRouter({ + history: createWebHistory(), + routes, + scrollBehavior: () => ({ top: 0 }) +}) + +router.afterEach((to) => { + const title = (to.meta?.title as string) || '' + document.title = title ? `${title} · IT 系统全景平台` : 'IT 系统全景平台' +}) + +export default router diff --git a/frontend/src/stores/flow.ts b/frontend/src/stores/flow.ts new file mode 100644 index 0000000..ba80988 --- /dev/null +++ b/frontend/src/stores/flow.ts @@ -0,0 +1,278 @@ +/** + * Data-flow canvas state: the topology, the filters that shade it, and the edits that + * keep it accurate (drag a card, pull a link, add a system). + * + * Deliberately metric-free. This page answers "who talks to whom, how often", so it never + * polls the metrics API; volumes and latencies live in 系统配置. + */ +import { defineStore } from 'pinia' +import { computed, ref } from 'vue' +import { createFlow, deleteFlow, fetchGraph, resetGraphLayout, saveGraphLayout, updateFlow } from '@/api' +import { apiError } from '@/api/client' +import { LOCK_MESSAGE } from '@/composables/useEditable' +import type { Flow, FlowEdge, GraphCounts, GraphNode, GraphPayload } from '@/types' +import { useUiStore } from './ui' + +export interface FlowFilters { + types: Set + keyword: string +} + +/** Only sets how far back the node health badges look; nothing here displays them. */ +const GRAPH_DAYS = 7 + +const EMPTY_COUNTS: GraphCounts = { + systems: 0, + layers: 0, + tiers: 0, + flows_total: 0, + flows_enabled: 0, + linked_systems: 0 +} + +export const useFlowStore = defineStore('flow', () => { + const ui = useUiStore() + + const nodes = ref([]) + const edges = ref([]) + const suggestions = ref([]) + const counts = ref({ ...EMPTY_COUNTS }) + const loading = ref(false) + const loaded = ref(false) + const filters = ref({ types: new Set(), keyword: '' }) + + const nodeByKey = computed(() => new Map(nodes.value.map((node) => [node.key, node]))) + + /** A link survives the filter only when its type matches and its words match. */ + const visibleEdges = computed(() => + edges.value.filter((edge) => { + if (!edge.enabled) return false + const { types, keyword } = filters.value + if (types.size && !types.has(edge.flow_type_id)) return false + if (keyword) { + const needle = keyword.toLowerCase() + const haystack = `${edge.label}${edge.payload}${edge.source_name}${edge.target_name}`.toLowerCase() + if (!haystack.includes(needle)) return false + } + return true + }) + ) + + const visibleNodeKeys = computed(() => { + const keys = new Set() + visibleEdges.value.forEach((edge) => { + keys.add(edge.source_key) + keys.add(edge.target_key) + }) + return keys + }) + + const visibleNodes = computed(() => nodes.value.filter((node) => visibleNodeKeys.value.has(node.key))) + + /** + * What the canvas draws. With no filter on, every system belongs there, including the + * ones with no links yet: that is exactly what the canvas exists to connect up. + */ + const canvasNodes = computed(() => { + const filtering = filters.value.types.size > 0 || filters.value.keyword.trim() !== '' + return filtering ? visibleNodes.value : nodes.value + }) + + const rankedNodes = computed(() => { + const groups = new Map() + visibleNodes.value.forEach((node) => { + const bucket = groups.get(node.tier) || [] + bucket.push(node) + groups.set(node.tier, bucket) + }) + // Degree first keeps hubs near the middle of their column, which shortens edges. + groups.forEach((bucket) => bucket.sort((a, b) => b.degree - a.degree || a.name.localeCompare(b.name, 'zh'))) + return groups + }) + + const typeBreakdown = computed(() => { + const map = new Map() + edges.value.forEach((edge) => { + const entry = map.get(edge.flow_type_id) || { + name: edge.flow_type_name || edge.flow_type_id, + color: edge.color, + count: 0 + } + entry.count += 1 + map.set(edge.flow_type_id, entry) + }) + return [...map.entries()].map(([id, value]) => ({ id, ...value })).sort((a, b) => b.count - a.count) + }) + + /** The system the most links run through. */ + const topHub = computed(() => + [...nodes.value].sort((a, b) => b.degree - a.degree || a.name.localeCompare(b.name, 'zh'))[0] || null + ) + + /** Cards the user placed by hand; the rest still follow the automatic layered layout. */ + const manualLayoutKeys = computed(() => + nodes.value.filter((node) => node.flow_x != null || node.flow_y != null).map((node) => node.key) + ) + const hasManualLayout = computed(() => manualLayoutKeys.value.length > 0) + + /** Systems with no enabled link at all -- the canvas is where they get one. */ + const disconnectedNodes = computed(() => nodes.value.filter((node) => !node.degree)) + + async function load(silent = false): Promise { + if (!silent) loading.value = true + try { + const graph = await fetchGraph(GRAPH_DAYS) + nodes.value = graph.nodes + edges.value = graph.edges + suggestions.value = graph.suggestions + counts.value = graph.counts ?? counts.value + loaded.value = true + } catch (error) { + if (!silent) ui.toast(apiError(error), 'error') + } finally { + loading.value = false + } + } + + /** Cheap refresh after a canvas edit: topology only, no metrics round trip. */ + async function refreshGraph(): Promise { + try { + const graph = await fetchGraph(GRAPH_DAYS) + nodes.value = graph.nodes + edges.value = graph.edges + suggestions.value = graph.suggestions + counts.value = graph.counts ?? counts.value + } catch (error) { + ui.toast(apiError(error), 'error') + } + } + + /** + * Every mutation goes through here, so the read-only switch is enforced in one place + * rather than at each call site. The backend refuses locked writes as well; stopping + * here keeps the toast honest and skips a request that can only fail. + */ + async function write(action: () => Promise, successText: string): Promise { + if (!ui.editable) { + ui.toast(LOCK_MESSAGE, 'info') + return null + } + try { + const result = await action() + ui.toast(successText) + return result + } catch (error) { + ui.toast(apiError(error), 'error') + return null + } + } + + async function saveFlow(id: number, patch: Partial): Promise { + const saved = await write(() => updateFlow(id, patch), '数据流已保存,流动效果已更新') + if (saved) await load(true) + return Boolean(saved) + } + + async function addFlow( + payload: Partial & { source_key: string; target_key: string; flow_type_id: string; label: string } + ) { + const created = await write(() => createFlow(payload), '已新增数据流') + if (created) await load(true) + return created + } + + async function removeFlow(id: number): Promise { + const ok = await write(() => deleteFlow(id), '已删除数据流') + if (ok) { + await load(true) + return true + } + return false + } + + /** + * Persist where a card was dropped. The canvas already moved it, so this only has to put + * it back when the write fails; a tier change means it was dropped into another column. + */ + async function moveNode(key: string, patch: { x: number; y: number; tier?: number }): Promise { + const node = nodeByKey.value.get(key) + if (!node) return false + // Bail before the optimistic move so a locked drag never snaps back across the canvas. + if (!ui.editable) { + ui.toast(LOCK_MESSAGE, 'info') + return false + } + const previous = { x: node.flow_x, y: node.flow_y, tier: node.tier } + node.flow_x = patch.x + node.flow_y = patch.y + if (patch.tier !== undefined) node.tier = patch.tier + try { + await saveGraphLayout([{ key, x: patch.x, y: patch.y, tier: patch.tier }]) + await refreshGraph() + return true + } catch (error) { + node.flow_x = previous.x + node.flow_y = previous.y + node.tier = previous.tier + ui.toast(apiError(error), 'error') + return false + } + } + + async function resetLayout(): Promise { + if (!ui.editable) { + ui.toast(LOCK_MESSAGE, 'info') + return false + } + try { + await resetGraphLayout() + await refreshGraph() + ui.toast('已恢复自动排列') + return true + } catch (error) { + ui.toast(apiError(error), 'error') + return false + } + } + + function toggleType(id: string): void { + const set = filters.value.types + if (set.has(id)) set.delete(id) + else set.add(id) + filters.value = { ...filters.value, types: new Set(set) } + } + + function resetFilters(): void { + filters.value = { types: new Set(), keyword: '' } + } + + return { + nodes, + edges, + suggestions, + counts, + loading, + loaded, + filters, + nodeByKey, + visibleEdges, + visibleNodes, + canvasNodes, + visibleNodeKeys, + rankedNodes, + typeBreakdown, + topHub, + manualLayoutKeys, + hasManualLayout, + disconnectedNodes, + load, + refreshGraph, + saveFlow, + addFlow, + removeFlow, + moveNode, + resetLayout, + toggleType, + resetFilters + } +}) diff --git a/frontend/src/stores/panorama.ts b/frontend/src/stores/panorama.ts new file mode 100644 index 0000000..7ebe133 --- /dev/null +++ b/frontend/src/stores/panorama.ts @@ -0,0 +1,141 @@ +/** System inventory: layers and systems, plus the CRUD that keeps them current. */ +import { defineStore } from 'pinia' +import { computed, ref } from 'vue' +import { + createLayer, createSystem, deleteLayer, deleteSystem, fetchLayers, fetchSystems, updateLayer, updateSystem +} from '@/api' +import { apiError } from '@/api/client' +import { LOCK_MESSAGE } from '@/composables/useEditable' +import type { Layer, System } from '@/types' +import { useUiStore } from './ui' +import { useFlowStore } from './flow' + +export const usePanoramaStore = defineStore('panorama', () => { + const ui = useUiStore() + + const layers = ref([]) + const systems = ref([]) + const loading = ref(false) + const loaded = ref(false) + const keyword = ref('') + const layerFilter = ref('') + const statusFilter = ref('') + + const filteredSystems = computed(() => { + const needle = keyword.value.trim().toLowerCase() + return systems.value.filter((system) => { + if (layerFilter.value && system.layer_id !== layerFilter.value) return false + if (statusFilter.value && system.status !== statusFilter.value) return false + if (!needle) return true + return [system.name, system.dept, system.tech, system.domain, system.description] + .some((field) => (field || '').toLowerCase().includes(needle)) + }) + }) + + const groupedByLayer = computed(() => + layers.value + .map((layer) => ({ layer, items: filteredSystems.value.filter((s) => s.layer_id === layer.id) })) + .filter((group) => group.items.length > 0) + ) + + const statusCounts = computed(() => { + const counts: Record = { running: 0, improving: 0, dev: 0, unknown: 0 } + systems.value.forEach((system) => { + counts[system.status] = (counts[system.status] || 0) + 1 + }) + return counts + }) + + const layerById = computed(() => new Map(layers.value.map((layer) => [layer.id, layer]))) + + async function load(force = false): Promise { + if (loaded.value && !force) return + loading.value = true + try { + const [layerRows, systemRows] = await Promise.all([fetchLayers(), fetchSystems()]) + layers.value = layerRows + systems.value = systemRows + loaded.value = true + } catch (error) { + ui.toast(apiError(error), 'error') + } finally { + loading.value = false + } + } + + /** + * Shared write helper so every CRUD path reports failures the same way, and so the + * read-only switch stops them all in one place. /api/settings is deliberately not here: + * turning the lock off has to stay possible while it is on. + */ + async function write(action: () => Promise, successText: string): Promise { + if (!ui.editable) { + ui.toast(LOCK_MESSAGE, 'info') + return null + } + try { + const result = await action() + ui.toast(successText) + return result + } catch (error) { + ui.toast(apiError(error), 'error') + return null + } + } + + async function saveSystem(key: string, patch: Partial): Promise { + const saved = await write(() => updateSystem(key, patch), '已保存') + if (!saved) return null + systems.value = systems.value.map((row) => (row.key === key ? saved : row)) + // The graph read model carries its own copy of the name, so a rename has to travel there too. + if (patch.name !== undefined) await useFlowStore().refreshGraph() + return saved + } + + async function addSystem(payload: Partial & { key: string; name: string }): Promise { + const created = await write(() => createSystem(payload), `已新增系统 ${payload.name}`) + if (created) systems.value = [...systems.value, created] + return created + } + + async function removeSystem(key: string): Promise { + const flows = await write(() => deleteSystem(key), `已删除系统 ${key}`) + if (flows) { + systems.value = systems.value.filter((row) => row.key !== key) + return true + } + return false + } + + async function addLayer(payload: { id: string; name: string; color: string; short_name: string; description: string; sort_order: number }) { + const created = await write(() => createLayer(payload), `已新增层级 ${payload.name}`) + if (created) await load(true) + return created + } + + async function saveLayer(id: string, payload: { id: string; name: string; color: string; short_name: string; description: string; sort_order: number }) { + const saved = await write(() => updateLayer(id, payload), `已更新层级 ${payload.name}`) + if (saved) await load(true) + return saved + } + + async function removeLayer(id: string): Promise { + const ok = await write(() => deleteLayer(id), '已删除层级') + if (ok) { + await load(true) + return true + } + return false + } + + function layerName(id: string | null): string { + if (!id) return '未分组' + return layerById.value.get(id)?.name || id + } + + return { + layers, systems, loading, loaded, keyword, layerFilter, statusFilter, + filteredSystems, groupedByLayer, statusCounts, layerById, + load, saveSystem, addSystem, removeSystem, addLayer, saveLayer, removeLayer, layerName + } +}) diff --git a/frontend/src/stores/ui.ts b/frontend/src/stores/ui.ts new file mode 100644 index 0000000..3a648c9 --- /dev/null +++ b/frontend/src/stores/ui.ts @@ -0,0 +1,78 @@ +/** Editor identity, toast queue, and the global site settings. */ +import { defineStore } from 'pinia' +import { computed, ref } from 'vue' +import { fetchSettings, patchSettings } from '@/api' +import { getEditor, setEditor as persistEditor } from '@/api/client' +import type { Settings } from '@/types' +import { DEFAULT_ROUTE_STYLE, isRouteStyle } from '@/components/flow/flowLayout' + +export interface Toast { + id: number + kind: 'success' | 'error' | 'info' + text: string +} + +let toastSeq = 0 + +export const useUiStore = defineStore('ui', () => { + const editor = ref(getEditor()) + const settings = ref({}) + const settingsLoaded = ref(false) + const toasts = ref([]) + + const siteTitle = computed(() => settings.value.site_title || '公司 IT 系统全景与数据流向平台') + /** + * Master edit switch from 系统配置 · 平台配置. Defaults to editable so a settings + * payload from an older backend (which never sends the key) keeps today's behaviour. + */ + const editable = computed(() => settings.value.editing_enabled !== false) + const siteSubtitle = computed(() => settings.value.site_subtitle || '') + const animationEnabled = computed(() => settings.value.animation_enabled !== false) + const animationSpeed = computed(() => Number(settings.value.animation_speed ?? 1)) + /** + * How the data-flow canvas draws links. The fallback lives with the layout engine so an + * older settings row, or a value from another build, still renders a sensible picture. + */ + const routeStyle = computed(() => + isRouteStyle(settings.value.flow_route_style) ? settings.value.flow_route_style : DEFAULT_ROUTE_STYLE + ) + + function toast(text: string, kind: Toast['kind'] = 'success'): void { + const id = ++toastSeq + toasts.value.push({ id, kind, text }) + setTimeout(() => dismiss(id), kind === 'error' ? 6000 : 3200) + } + + function dismiss(id: number): void { + toasts.value = toasts.value.filter((item) => item.id !== id) + } + + function setEditor(name: string): void { + editor.value = persistEditor(name) + } + + async function loadSettings(): Promise { + try { + settings.value = await fetchSettings() + settingsLoaded.value = true + } catch { + settingsLoaded.value = true + toast('读取系统配置失败', 'error') + } + } + + async function saveSettings(patch: Partial): Promise { + try { + settings.value = await patchSettings(patch) + return true + } catch { + return false + } + } + + return { + editor, settings, settingsLoaded, toasts, + siteTitle, siteSubtitle, editable, animationEnabled, animationSpeed, routeStyle, + toast, dismiss, setEditor, loadSettings, saveSettings + } +}) diff --git a/frontend/src/style.css b/frontend/src/style.css new file mode 100644 index 0000000..38936ed --- /dev/null +++ b/frontend/src/style.css @@ -0,0 +1,282 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; + +@layer base { + * { + @apply border-gray-200 dark:border-dark-700; + } + + html { + @apply scroll-smooth antialiased; + color-scheme: light; + } + + body { + @apply bg-gray-50 text-gray-900 dark:bg-dark-950 dark:text-gray-100; + @apply min-h-screen; + } + + ::-webkit-scrollbar { + @apply h-2 w-2; + } + + ::-webkit-scrollbar-track { + @apply bg-transparent; + } + + ::-webkit-scrollbar-thumb { + @apply rounded-full bg-gray-300/60 dark:bg-dark-700/60; + } + + ::selection { + @apply bg-primary-500/20 text-primary-900 dark:text-primary-100; + } + + input[type='number']::-webkit-inner-spin-button, + input[type='number']::-webkit-outer-spin-button { + -webkit-appearance: none; + margin: 0; + } +} + +@layer components { + /* ============ 按钮 ============ */ + .btn { + @apply inline-flex items-center justify-center gap-2; + @apply rounded-xl px-4 py-2.5 text-sm font-medium; + @apply transition-all duration-200 ease-out; + @apply focus:outline-none focus:ring-2 focus:ring-primary-500/50 focus:ring-offset-2; + @apply disabled:transform-none disabled:cursor-not-allowed disabled:opacity-50; + @apply active:scale-[0.98]; + } + + .btn-primary { + @apply bg-gradient-to-r from-primary-500 to-primary-600; + @apply text-white shadow-md shadow-primary-500/25; + @apply hover:from-primary-600 hover:to-primary-700 hover:shadow-lg hover:shadow-primary-500/30; + } + + .btn-secondary { + @apply bg-white dark:bg-dark-800; + @apply text-gray-700 dark:text-gray-200; + @apply border border-gray-200 dark:border-dark-600; + @apply shadow-sm hover:bg-gray-50 dark:hover:bg-dark-700; + } + + .btn-ghost { + @apply bg-transparent text-gray-600 dark:text-gray-300; + @apply hover:bg-gray-100 dark:hover:bg-dark-800; + } + + .btn-danger { + @apply bg-gradient-to-r from-red-500 to-red-600; + @apply text-white shadow-md shadow-red-500/25; + @apply hover:from-red-600 hover:to-red-700; + } + + .btn-sm { + @apply rounded-lg px-3 py-1.5 text-xs; + } + + .btn-icon { + @apply rounded-xl p-2; + } + + /* ============ 输入框 ============ */ + .input { + @apply w-full rounded-xl px-3 py-2 text-sm; + @apply bg-white dark:bg-dark-800; + @apply border border-gray-200 dark:border-dark-600; + @apply text-gray-900 dark:text-gray-100; + @apply placeholder:text-gray-400 dark:placeholder:text-dark-400; + @apply transition-all duration-200; + @apply focus:border-primary-500 focus:outline-none focus:ring-2 focus:ring-primary-500/30; + @apply disabled:cursor-not-allowed disabled:bg-gray-100 dark:disabled:bg-dark-900; + } + + .input-label { + @apply mb-1.5 block text-xs font-medium text-gray-600 dark:text-gray-300; + } + + .input-hint { + @apply mt-1 text-xs text-gray-500 dark:text-dark-400; + } + + /* ============ 卡片 ============ */ + .card { + @apply bg-white dark:bg-dark-800/50; + @apply rounded-2xl; + @apply border border-gray-100 dark:border-dark-700/50; + @apply shadow-card; + @apply transition-all duration-300; + } + + .card-header { + @apply border-b border-gray-100 dark:border-dark-700 px-5 py-3.5; + } + + .card-body { + @apply p-5; + } + + /* ============ 统计卡片 ============ */ + .stat-card { + @apply card flex items-start gap-4 p-4; + } + + .stat-icon { + @apply flex h-11 w-11 shrink-0 items-center justify-center rounded-xl text-lg; + } + + .stat-icon-primary { + @apply bg-primary-100 text-primary-600 dark:bg-primary-900/30 dark:text-primary-400; + } + + .stat-icon-success { + @apply bg-emerald-100 text-emerald-600 dark:bg-emerald-900/30 dark:text-emerald-400; + } + + .stat-icon-warning { + @apply bg-amber-100 text-amber-600 dark:bg-amber-900/30 dark:text-amber-400; + } + + .stat-icon-danger { + @apply bg-red-100 text-red-600 dark:bg-red-900/30 dark:text-red-400; + } + + .stat-value { + @apply truncate text-2xl font-bold text-gray-900 dark:text-white; + } + + .stat-label { + @apply text-xs text-gray-500 dark:text-dark-400; + } + + /* ============ 表格 ============ */ + .table-container { + @apply overflow-x-auto rounded-xl border border-gray-200 dark:border-dark-700; + } + + .table { + @apply w-full text-sm; + } + + .table th { + @apply whitespace-nowrap px-3 py-2.5 text-left font-medium; + @apply text-gray-600 dark:text-dark-300; + @apply bg-gray-50 dark:bg-dark-800/50; + @apply border-b border-gray-200 dark:border-dark-700; + } + + .table td { + @apply px-3 py-2.5 text-gray-700 dark:text-gray-300; + @apply border-b border-gray-100 dark:border-dark-800; + } + + .table tr:last-child td { + @apply border-b-0; + } + + .table tbody tr { + @apply transition-colors duration-150 hover:bg-gray-50 dark:hover:bg-dark-800/30; + } + + /* ============ 徽章 ============ */ + .badge { + @apply inline-flex items-center gap-1; + @apply rounded-full px-2 py-0.5 text-xs font-medium whitespace-nowrap; + } + + .badge-primary { + @apply bg-primary-100 text-primary-700 dark:bg-primary-900/30 dark:text-primary-400; + } + + .badge-success { + @apply bg-emerald-100 text-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-400; + } + + .badge-warning { + @apply bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-400; + } + + .badge-danger { + @apply bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400; + } + + .badge-gray { + @apply bg-gray-100 text-gray-700 dark:bg-dark-700 dark:text-dark-300; + } + + .badge-purple { + @apply bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-400; + } + + /* ============ 模态框 ============ */ + .modal-overlay { + @apply fixed inset-0 z-50; + @apply bg-black/50 backdrop-blur-sm; + @apply flex items-center justify-center p-4; + } + + .modal-content { + @apply w-full max-h-[92vh]; + @apply bg-white dark:bg-dark-800; + @apply rounded-2xl shadow-2xl; + @apply border border-gray-200 dark:border-dark-700; + @apply flex flex-col; + } + + .modal-header { + @apply flex shrink-0 items-center justify-between; + @apply border-b border-gray-200 px-5 py-3.5 dark:border-dark-700; + } + + .modal-title { + @apply text-base font-semibold text-gray-900 dark:text-white; + } + + .modal-body { + @apply flex-1 overflow-y-auto px-5 py-4; + } + + .modal-footer { + @apply flex shrink-0 items-center justify-end gap-2; + @apply border-t border-gray-200 px-5 py-3.5 dark:border-dark-700; + } + + /* ============ 侧边栏导航 ============ */ + .nav-item { + @apply flex items-center gap-2.5 rounded-xl px-3 py-2 text-sm font-medium; + @apply text-gray-600 dark:text-gray-400; + @apply transition-colors duration-150; + @apply hover:bg-gray-100 dark:hover:bg-dark-800 hover:text-gray-900 dark:hover:text-gray-100; + } + + .nav-item-active { + @apply bg-primary-50 text-primary-700 dark:bg-primary-900/30 dark:text-primary-300; + } + + /* ============ 数据流向图专用 ============ */ + .flow-canvas { + @apply relative w-full overflow-auto rounded-xl bg-white dark:bg-dark-900; + } + + .flow-node { + @apply absolute rounded-xl border bg-white text-left; + @apply dark:bg-dark-800; + @apply shadow-card transition-shadow duration-200; + @apply hover:shadow-card-hover; + } + + .flow-edge-label { + @apply pointer-events-none absolute -translate-x-1/2 -translate-y-1/2; + @apply rounded-md px-1.5 py-0.5 text-[10px] font-medium leading-tight; + @apply bg-white/90 text-gray-600 shadow-sm dark:bg-dark-800/90 dark:text-gray-300; + @apply whitespace-nowrap; + } + + .legend-chip { + @apply inline-flex items-center gap-1.5 text-xs text-gray-600 dark:text-gray-400; + } +} diff --git a/frontend/src/types/index.ts b/frontend/src/types/index.ts new file mode 100644 index 0000000..afb7f64 --- /dev/null +++ b/frontend/src/types/index.ts @@ -0,0 +1,203 @@ +export type StatusKey = 'running' | 'improving' | 'dev' | 'unknown' +export type Direction = 'forward' | 'backward' | 'bidirectional' +export type Reliability = 'sync' | 'async' +export type HealthState = 'healthy' | 'watch' | 'risk' | 'idle' +/** How the data-flow canvas draws a link: orthogonal corridors, arcs, or plain segments. */ +export type RouteStyle = 'elbow' | 'curve' | 'straight' + +export interface Layer { + id: string + name: string + short_name: string + color: string + description: string + sort_order: number + system_count?: number +} + +export interface System { + id: number + key: string + name: string + layer_id: string | null + layer_name?: string | null + layer_color?: string | null + dept: string + status: StatusKey + tech: string + url: string + domain: string + owner: string + /** When the system went live. Free form text: '2024-06', '2023 Q4 上线'. */ + impl_time: string + /** Whether the overview offers a jump button for this system. */ + entry_enabled: boolean + description: string + tier: number + /** Manual position on the data-flow canvas; null means the layout engine places it. */ + flow_x?: number | null + flow_y?: number | null + sort_order: number + created_at: string + updated_at: string +} + +export interface FlowType { + id: string + name: string + color: string + line_style: 'solid' | 'dashed' | 'dotted' + default_interval: number + description: string + sort_order: number + flow_count?: number +} + +export interface Flow { + id: number + source_key: string + target_key: string + flow_type_id: string + flow_type_name?: string + flow_type_color?: string + flow_type_line_style?: string + source_name?: string + target_name?: string + label: string + payload: string + direction: Direction + interval_sec: number + records_per_batch: number + avg_payload_kb: number + latency_ms: number + reliability: Reliability + peak_hours: number[] + enabled: boolean + note: string + sort_order: number +} + +export interface FlowHealth { + batches: number + records: number + bytes: number + errors: number + error_rate: number + avg_latency_ms: number + peak_hour_records: number + state: HealthState +} + +export interface FlowEdge extends Flow { + color: string + line_style: string + throughput_rps: number + payload_mb_per_hour: number + health: FlowHealth +} + +export interface GraphNode extends System { + layer_name: string | null + layer_color: string | null + rank: number + depth: number + degree: number + out_count: number + in_count: number + health: HealthState +} + +export interface LayoutSuggestion { + key: string + name: string + tier: number + implied_depth: number + reason: string +} + +export interface GraphCounts { + systems: number + layers: number + tiers: number + flows_total: number + flows_enabled: number + /** Systems taking part in at least one enabled link. */ + linked_systems: number +} + +export interface GraphPayload { + nodes: GraphNode[] + edges: FlowEdge[] + ranks: Record + rank_count: number + suggestions: LayoutSuggestion[] + counts?: GraphCounts +} + +export interface Summary { + range_days: number + totals: { + batches: number + records: number + bytes: number + errors: number + avg_latency_ms: number + active_buckets: number + } + counts: { systems: number; flows: number; flows_all: number; flow_types: number; layers: number } + health: { healthy: number; watch: number; risk: number } + generated_at: string +} + +export interface LiveFlow { + flow_id: number + source_key: string + target_key: string + flow_type_id: string + label: string + direction: Direction + enabled: boolean + batches: number + records: number + bytes: number + errors: number + latency_ms: number +} + +export interface LivePayload { + day: string + hour: number + flows: LiveFlow[] +} + +export interface HourPoint { + day: string + hour: number + batches: number + records: number + bytes: number + errors: number + latency: number +} + +export interface Settings { + site_title?: string + site_subtitle?: string + /** Master switch: when false every page turns read-only and the API rejects writes. */ + editing_enabled?: boolean + animation_enabled?: boolean + animation_speed?: number + /** Shared line style for the data-flow canvas, so everyone sees the same picture. */ + flow_route_style?: RouteStyle + [key: string]: unknown +} + +export interface AuditEntry { + id: number + actor: string + entity: string + entity_id: string + action: string + summary: string + created_at: string +} diff --git a/frontend/src/utils/constants.ts b/frontend/src/utils/constants.ts new file mode 100644 index 0000000..79941e0 --- /dev/null +++ b/frontend/src/utils/constants.ts @@ -0,0 +1,89 @@ +import type { HealthState, StatusKey } from '@/types' + +export interface StatusMeta { + label: string + badge: string + dot: string + fill: string + stroke: string +} + +export const STATUS_META: Record = { + running: { + label: '正常使用中', badge: 'badge-success', dot: 'bg-emerald-500', + fill: '#e8f7e8', stroke: '#52c41a' + }, + improving: { + label: '正常使用并完善中', badge: 'badge-primary', dot: 'bg-sky-500', + fill: '#e6f2ff', stroke: '#1890ff' + }, + dev: { + label: '开发完善中', badge: 'badge-warning', dot: 'bg-amber-500', + fill: '#fff4e0', stroke: '#fa8c16' + }, + unknown: { + label: '状态未标注', badge: 'badge-gray', dot: 'bg-gray-400', + fill: '#f2f3f5', stroke: '#a8adb5' + } +} + +export const STATUS_OPTIONS = (Object.keys(STATUS_META) as StatusKey[]).map((value) => ({ + value, + label: STATUS_META[value].label +})) + +export interface HealthMeta { + label: string + badge: string + color: string +} + +export const HEALTH_META: Record = { + healthy: { label: '运行正常', badge: 'badge-success', color: '#10b981' }, + watch: { label: '需要关注', badge: 'badge-warning', color: '#f59e0b' }, + risk: { label: '存在风险', badge: 'badge-danger', color: '#ef4444' }, + idle: { label: '暂无数据', badge: 'badge-gray', color: '#94a3b8' } +} + +/** Column meaning for the flow graph; index maps to a node's tier. */ +export const TIER_LABELS = ['统一入口层', '审批 / 流程中枢', '业务系统层', '底座能力层'] + +export function tierLabel(tier: number): string { + return TIER_LABELS[tier] ?? `第 ${tier + 1} 层` +} + +export const RANGE_OPTIONS = [ + { value: 1, label: '今天' }, + { value: 3, label: '近 3 天' }, + { value: 7, label: '近 7 天' }, + { value: 30, label: '近 30 天' } +] + +export const DIRECTION_OPTIONS = [ + { value: 'forward', label: '单向:起点 → 终点' }, + { value: 'backward', label: '单向:终点 → 起点' }, + { value: 'bidirectional', label: '双向:来回传输' } +] + +export const RELIABILITY_OPTIONS = [ + { value: 'sync', label: '同步调用(等待返回)' }, + { value: 'async', label: '异步任务(消息/队列)' } +] + +export const LINE_STYLE_OPTIONS = [ + // The dash pattern is the rhythm of the link, so the canvas legend and 配置 all read it the + // same way: 实线同步、虚线异步、点划线定时或人工。 + { value: 'solid', label: '实线', meaning: '同步调用' }, + { value: 'dashed', label: '虚线', meaning: '异步消息' }, + { value: 'dash-dot', label: '点划线', meaning: '定时任务 / 人工' }, + { value: 'dotted', label: '点线', meaning: '低频参考链路' } +] + +export const TIER_OPTIONS = TIER_LABELS.map((label, value) => ({ value, label })) + +export const ACTION_LABELS: Record = { + create: '新增', + update: '修改', + delete: '删除', + import: '导入' +} diff --git a/frontend/src/utils/entry.ts b/frontend/src/utils/entry.ts new file mode 100644 index 0000000..67ae936 --- /dev/null +++ b/frontend/src/utils/entry.ts @@ -0,0 +1,25 @@ +/** Resolve where a system's "访问系统" button should send the visitor. */ +import type { System } from '@/types' + +/** + * Deployment URL wins, then a bare domain. + * + * Either field may be typed without a scheme, and a schemeless href is resolved as a path + * relative to this app, so the jump would land on a 404 of our own origin. Anything that + * does not already carry a `scheme://` prefix therefore gets http:// prepended, which also + * keeps non-http schemes such as `javascript:` out of the clickable links. + */ +export function systemEntryUrl(system: System | null | undefined): string { + if (!system) return '' + const absolute = (value: string) => (/^[a-z][a-z0-9+.-]*:\/\//i.test(value) ? value : `http://${value}`) + const url = (system.url || '').trim() + if (url) return absolute(url) + const domain = (system.domain || '').trim() + return domain ? absolute(domain) : '' +} + +/** Short text for the button tooltip when both fields are filled in. */ +export function systemEntryHint(system: System | null | undefined): string { + const url = systemEntryUrl(system) + return url ? `新标签页打开 ${url}` : '尚未配置访问地址' +} diff --git a/frontend/src/utils/format.ts b/frontend/src/utils/format.ts new file mode 100644 index 0000000..28e7cb8 --- /dev/null +++ b/frontend/src/utils/format.ts @@ -0,0 +1,69 @@ +/** Display formatting shared by the panorama and flow views. */ + +export function formatNumber(value: number | null | undefined): string { + if (value === null || value === undefined || Number.isNaN(value)) return '—' + return Math.round(value).toLocaleString('zh-CN') +} + +export function formatCompact(value: number | null | undefined): string { + if (value === null || value === undefined || Number.isNaN(value)) return '—' + const abs = Math.abs(value) + if (abs >= 1e8) return `${(value / 1e8).toFixed(2)} 亿` + if (abs >= 1e4) return `${(value / 1e4).toFixed(1)} 万` + if (abs >= 1e3) return `${(value / 1e3).toFixed(1)} 千` + return Math.round(value).toLocaleString('zh-CN') +} + +export function formatBytes(bytes: number | null | undefined): string { + if (!bytes || bytes < 0) return '0 B' + const units = ['B', 'KB', 'MB', 'GB', 'TB'] + let value = bytes + let index = 0 + while (value >= 1024 && index < units.length - 1) { + value /= 1024 + index += 1 + } + return `${value.toFixed(value >= 100 || index === 0 ? 0 : 1)} ${units[index]}` +} + +export function formatRate(rps: number | null | undefined): string { + if (!rps || rps <= 0) return '0 条/秒' + if (rps < 1) return `${(rps * 60).toFixed(1)} 条/分` + return `${rps.toFixed(2)} 条/秒` +} + +export function formatInterval(seconds: number): string { + if (!seconds || seconds <= 0) return '—' + if (seconds < 60) return `每 ${seconds} 秒` + if (seconds < 3600) return `每 ${Math.round(seconds / 60)} 分钟` + if (seconds < 86400) return `每 ${+(seconds / 3600).toFixed(1)} 小时` + return `每 ${+(seconds / 86400).toFixed(1)} 天` +} + +export function formatLatency(ms: number): string { + if (!ms || ms <= 0) return '—' + return ms >= 1000 ? `${(ms / 1000).toFixed(2)} 秒` : `${Math.round(ms)} 毫秒` +} + +export function formatPercent(value: number, digits = 2): string { + if (!value) return '0%' + return `${(value * 100).toFixed(digits)}%` +} + +export function formatHourRange(hours: number[]): string { + if (!hours || hours.length === 0) return '未设置' + if (hours.length === 24) return '全天 24 小时' + const sorted = [...hours].sort((a, b) => a - b) + const runs: number[][] = [] + for (const hour of sorted) { + const last = runs[runs.length - 1] + if (last && hour === last[last.length - 1] + 1) last.push(hour) + else runs.push([hour]) + } + return runs.map((run) => (run.length === 1 ? `${run[0]} 时` : `${run[0]}-${run[run.length - 1]} 时`)).join('、') +} + +export function formatDateTime(value: string | null | undefined): string { + if (!value) return '—' + return value.replace('T', ' ').slice(0, 16) +} diff --git a/frontend/src/views/AgentOverviewView.vue b/frontend/src/views/AgentOverviewView.vue new file mode 100644 index 0000000..dcb9263 --- /dev/null +++ b/frontend/src/views/AgentOverviewView.vue @@ -0,0 +1,39 @@ + + + diff --git a/frontend/src/views/ConfigView.vue b/frontend/src/views/ConfigView.vue new file mode 100644 index 0000000..a2b334b --- /dev/null +++ b/frontend/src/views/ConfigView.vue @@ -0,0 +1,801 @@ + + + diff --git a/frontend/src/views/FlowView.vue b/frontend/src/views/FlowView.vue new file mode 100644 index 0000000..7909e51 --- /dev/null +++ b/frontend/src/views/FlowView.vue @@ -0,0 +1,451 @@ + + + diff --git a/frontend/src/views/HistoryView.vue b/frontend/src/views/HistoryView.vue new file mode 100644 index 0000000..84ebced --- /dev/null +++ b/frontend/src/views/HistoryView.vue @@ -0,0 +1,95 @@ + + + diff --git a/frontend/src/views/PanoramaView.vue b/frontend/src/views/PanoramaView.vue new file mode 100644 index 0000000..29ad8d5 --- /dev/null +++ b/frontend/src/views/PanoramaView.vue @@ -0,0 +1,237 @@ + + + diff --git a/frontend/src/vite-env.d.ts b/frontend/src/vite-env.d.ts new file mode 100644 index 0000000..323c78a --- /dev/null +++ b/frontend/src/vite-env.d.ts @@ -0,0 +1,7 @@ +/// + +declare module '*.vue' { + import type { DefineComponent } from 'vue' + const component: DefineComponent<{}, {}, any> + export default component +} diff --git a/frontend/tailwind.config.js b/frontend/tailwind.config.js new file mode 100644 index 0000000..cd7f95f --- /dev/null +++ b/frontend/tailwind.config.js @@ -0,0 +1,60 @@ +/** @type {import('tailwindcss').Config} */ +export default { + content: ['./index.html', './src/**/*.{vue,js,ts,jsx,tsx}'], + darkMode: 'class', + theme: { + extend: { + colors: { + // 主色调 - Teal/Cyan 青色系(与 sub2api 保持一致) + primary: { + 50: '#f0fdfa', 100: '#ccfbf1', 200: '#99f6e4', 300: '#5eead4', 400: '#2dd4bf', + 500: '#14b8a6', 600: '#0d9488', 700: '#0f766e', 800: '#115e59', 900: '#134e4a', + 950: '#042f2e' + }, + // 辅助色 - 深蓝灰 + accent: { + 50: '#f8fafc', 100: '#f1f5f9', 200: '#e2e8f0', 300: '#cbd5e1', 400: '#94a3b8', + 500: '#64748b', 600: '#475569', 700: '#334155', 800: '#1e293b', 900: '#0f172a', + 950: '#020617' + }, + dark: { + 50: '#f8fafc', 100: '#f1f5f9', 200: '#e2e8f0', 300: '#cbd5e1', 400: '#94a3b8', + 500: '#64748b', 600: '#475569', 700: '#334155', 800: '#1e293b', 900: '#0f172a', + 950: '#020617' + } + }, + fontFamily: { + sans: [ + 'system-ui', '-apple-system', 'BlinkMacSystemFont', 'Segoe UI', 'Roboto', + 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'sans-serif' + ], + mono: ['ui-monospace', 'SFMono-Regular', 'Menlo', 'Monaco', 'Consolas', 'monospace'] + }, + boxShadow: { + card: '0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06)', + 'card-hover': '0 10px 40px rgba(0, 0, 0, 0.08)', + glow: '0 0 20px rgba(20, 184, 166, 0.25)' + }, + backgroundImage: { + 'gradient-primary': 'linear-gradient(135deg, #14b8a6 0%, #0d9488 100%)' + }, + animation: { + 'fade-in': 'fadeIn 0.3s ease-out', + 'slide-up': 'slideUp 0.3s ease-out', + 'scale-in': 'scaleIn 0.2s ease-out' + }, + keyframes: { + fadeIn: { '0%': { opacity: '0' }, '100%': { opacity: '1' } }, + slideUp: { + '0%': { opacity: '0', transform: 'translateY(10px)' }, + '100%': { opacity: '1', transform: 'translateY(0)' } + }, + scaleIn: { + '0%': { opacity: '0', transform: 'scale(0.95)' }, + '100%': { opacity: '1', transform: 'scale(1)' } + } + } + } + }, + plugins: [] +} diff --git a/frontend/tsconfig.json b/frontend/tsconfig.json new file mode 100644 index 0000000..b8b22e9 --- /dev/null +++ b/frontend/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "target": "ES2020", + "useDefineForClassFields": true, + "module": "ESNext", + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "skipLibCheck": true, + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "preserve", + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true, + "baseUrl": ".", + "paths": { "@/*": ["./src/*"] }, + "types": ["node"] + }, + "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.vue"], + "exclude": ["src/**/__tests__/*"] +} diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts new file mode 100644 index 0000000..51c4618 --- /dev/null +++ b/frontend/vite.config.ts @@ -0,0 +1,20 @@ +import { fileURLToPath, URL } from 'node:url' +import { defineConfig } from 'vite' +import vue from '@vitejs/plugin-vue' + +const API_TARGET = process.env.VITE_API_TARGET || 'http://127.0.0.1:8787' + +export default defineConfig({ + plugins: [vue()], + resolve: { + alias: { '@': fileURLToPath(new URL('./src', import.meta.url)) } + }, + server: { + port: 5273, + strictPort: false, + proxy: { + '/api': { target: API_TARGET, changeOrigin: true } + } + }, + build: { outDir: 'dist', emptyOutDir: true } +}) diff --git a/start.sh b/start.sh new file mode 100755 index 0000000..8743e47 --- /dev/null +++ b/start.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash +# 一键启动:首次运行自动安装依赖并构建前端,然后用一个 Python 进程同时提供 API 与页面。 +set -euo pipefail +cd "$(dirname "$0")" + +PORT="${PORT:-8787}" +DB_PATH="${DB_PATH:-$PWD/backend/panorama.db}" +export PORT DB_PATH + +echo "==> 检查 Python 依赖" +python3 -c "import fastapi, uvicorn" 2>/dev/null || python3 -m pip install -r backend/requirements.txt + +if [ ! -d frontend/node_modules ]; then + echo "==> 安装前端依赖(首次较慢)" + (cd frontend && npm install --no-audit --no-fund) +fi + +if [ ! -f frontend/dist/index.html ]; then + echo "==> 构建前端" + (cd frontend && npm run build) +fi + +echo "==> 启动服务:http://localhost:${PORT} (数据库:${DB_PATH})" +cd backend && exec python3 -m uvicorn app.main:app --host 0.0.0.0 --port "${PORT}"